From 68c4d5e81137a5a4bc19bdb7a4ee12936b82c81b Mon Sep 17 00:00:00 2001 From: "PC-20230316NUNE\\Administrator" <2858626794@qq.com> Date: Fri, 26 Jan 2024 19:15:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=B8=A7=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JNFrame/App.config | 50 + JNFrame/Assembly-CSharp-Editor.csproj | 63 + JNFrame/Assembly-CSharp-firstpass.csproj | 2531 ++++ JNFrame/Assembly-CSharp.csproj | 801 ++ JNFrame/Assets/NuGet.config | 16 + JNFrame/Assets/NuGet.config.meta | 23 + JNFrame/Assets/NuGet.meta | 8 + JNFrame/Assets/NuGet/Editor.meta | 9 + JNFrame/Assets/NuGet/Editor/NugetForUnity.dll | Bin 0 -> 187904 bytes .../NuGet/Editor/NugetForUnity.dll.meta | 33 + JNFrame/Assets/NuGet/LICENSE | 21 + JNFrame/Assets/NuGet/LICENSE.meta | 8 + JNFrame/Assets/NuGet/README.pdf | Bin 0 -> 246595 bytes JNFrame/Assets/NuGet/README.pdf.meta | 8 + JNFrame/Assets/NuGet/Resources.meta | 9 + .../Assets/NuGet/Resources/defaultIcon.png | Bin 0 -> 4415 bytes .../NuGet/Resources/defaultIcon.png.meta | 88 + JNFrame/Assets/Packages.meta | 8 + .../Packages/Google.Protobuf.3.15.8.meta | 8 + .../Google.Protobuf.3.15.8/.signature.p7s | Bin 0 -> 18165 bytes .../Google.Protobuf.nuspec | 30 + .../Google.Protobuf.nuspec.meta | 7 + .../Packages/Google.Protobuf.3.15.8/lib.meta | 8 + .../lib/netstandard2.0.meta | 8 + .../lib/netstandard2.0/Google.Protobuf.dll | Bin 0 -> 390248 bytes .../netstandard2.0/Google.Protobuf.dll.meta | 23 + .../lib/netstandard2.0/Google.Protobuf.xml | 10097 ++++++++++++++ .../netstandard2.0/Google.Protobuf.xml.meta | 7 + ...Runtime.CompilerServices.Unsafe.4.5.2.meta | 8 + .../.signature.p7s | Bin 0 -> 22354 bytes .../LICENSE.TXT | 23 + .../LICENSE.TXT.meta | 7 + ...tem.Runtime.CompilerServices.Unsafe.nuspec | 36 + ...untime.CompilerServices.Unsafe.nuspec.meta | 7 + .../THIRD-PARTY-NOTICES.TXT | 309 + .../THIRD-PARTY-NOTICES.TXT.meta | 7 + .../lib.meta | 8 + .../lib/netstandard2.0.meta | 8 + ...System.Runtime.CompilerServices.Unsafe.dll | Bin 0 -> 23600 bytes ...m.Runtime.CompilerServices.Unsafe.dll.meta | 23 + ...System.Runtime.CompilerServices.Unsafe.xml | 200 + ...m.Runtime.CompilerServices.Unsafe.xml.meta | 7 + .../useSharedDesignerContext.txt | 0 .../useSharedDesignerContext.txt.meta | 7 + .../version.txt | 1 + .../version.txt.meta | 7 + JNFrame/Assets/Plugins.meta | 8 + JNFrame/Assets/Plugins/BestHTTP.meta | 8 + JNFrame/Assets/Plugins/BestHTTP/BestHTTP.meta | 7 + .../BestHTTP/BestHTTP/Authentication.meta | 7 + .../BestHTTP/Authentication/Credentials.cs | 63 + .../Authentication/Credentials.cs.meta | 10 + .../BestHTTP/Authentication/Digest.cs | 280 + .../BestHTTP/Authentication/Digest.cs.meta | 10 + .../BestHTTP/Authentication/DigestStore.cs | 73 + .../Authentication/DigestStore.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/Caching.meta | 7 + .../BestHTTP/Caching/HTTPCacheFileInfo.cs | 394 + .../Caching/HTTPCacheFileInfo.cs.meta | 10 + .../BestHTTP/Caching/HTTPCacheFileLock.cs | 44 + .../Caching/HTTPCacheFileLock.cs.meta | 10 + .../Caching/HTTPCacheMaintananceParams.cs | 27 + .../HTTPCacheMaintananceParams.cs.meta | 10 + .../BestHTTP/Caching/HTTPCacheService.cs | 716 + .../BestHTTP/Caching/HTTPCacheService.cs.meta | 10 + .../BestHTTP/BestHTTP/Connections.meta | 7 + .../BestHTTP/Connections/ConnectionBase.cs | 226 + .../Connections/ConnectionBase.cs.meta | 10 + .../BestHTTP/Connections/FileConnection.cs | 300 + .../Connections/FileConnection.cs.meta | 10 + .../BestHTTP/Connections/WebGLConnection.cs | 411 + .../Connections/WebGLConnection.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/Cookies.meta | 7 + .../BestHTTP/BestHTTP/Cookies/Cookie.cs | 359 + .../BestHTTP/BestHTTP/Cookies/Cookie.cs.meta | 10 + .../BestHTTP/BestHTTP/Cookies/CookieJar.cs | 489 + .../BestHTTP/Cookies/CookieJar.cs.meta | 10 + .../BestHTTP/BestHTTP/Decompression.meta | 7 + .../BestHTTP/BestHTTP/Decompression/CRC32.cs | 473 + .../BestHTTP/Decompression/CRC32.cs.meta | 10 + .../BestHTTP/Decompression/Deflate.cs | 1883 +++ .../BestHTTP/Decompression/Deflate.cs.meta | 10 + .../BestHTTP/Decompression/DeflateStream.cs | 692 + .../Decompression/DeflateStream.cs.meta | 10 + .../BestHTTP/Decompression/GZipStream.cs | 919 ++ .../BestHTTP/Decompression/GZipStream.cs.meta | 10 + .../BestHTTP/Decompression/InfTree.cs | 436 + .../BestHTTP/Decompression/InfTree.cs.meta | 10 + .../BestHTTP/Decompression/Inflate.cs | 1797 +++ .../BestHTTP/Decompression/Inflate.cs.meta | 10 + .../BestHTTP/BestHTTP/Decompression/ZTree.cs | 423 + .../BestHTTP/Decompression/ZTree.cs.meta | 10 + .../BestHTTP/BestHTTP/Decompression/Zlib.cs | 546 + .../BestHTTP/Decompression/Zlib.cs.meta | 10 + .../BestHTTP/Decompression/ZlibBaseStream.cs | 606 + .../Decompression/ZlibBaseStream.cs.meta | 10 + .../BestHTTP/Decompression/ZlibCodec.cs | 712 + .../BestHTTP/Decompression/ZlibCodec.cs.meta | 10 + .../BestHTTP/Decompression/ZlibConstants.cs | 128 + .../Decompression/ZlibConstants.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/Extensions.meta | 7 + .../Extensions/BufferPoolMemoryStream.cs | 447 + .../Extensions/BufferPoolMemoryStream.cs.meta | 11 + .../BestHTTP/Extensions/CircularBuffer.cs | 55 + .../Extensions/CircularBuffer.cs.meta | 13 + .../BestHTTP/Extensions/Extensions.cs | 465 + .../BestHTTP/Extensions/Extensions.cs.meta | 10 + .../BestHTTP/BestHTTP/Extensions/Future.cs | 402 + .../BestHTTP/Extensions/Future.cs.meta | 13 + .../BestHTTP/Extensions/HeaderParser.cs | 40 + .../BestHTTP/Extensions/HeaderParser.cs.meta | 10 + .../BestHTTP/Extensions/HeaderValue.cs | 114 + .../BestHTTP/Extensions/HeaderValue.cs.meta | 10 + .../BestHTTP/Extensions/HeartbeatManager.cs | 70 + .../Extensions/HeartbeatManager.cs.meta | 10 + .../BestHTTP/Extensions/KeyValuePairList.cs | 27 + .../Extensions/KeyValuePairList.cs.meta | 10 + .../Extensions/ReadOnlyBufferedStream.cs | 177 + .../Extensions/ReadOnlyBufferedStream.cs.meta | 12 + .../Extensions/VariableSizedBufferPool.cs | 386 + .../VariableSizedBufferPool.cs.meta | 12 + .../Extensions/WWWAuthenticateHeaderParser.cs | 50 + .../WWWAuthenticateHeaderParser.cs.meta | 10 + .../Extensions/WriteOnlyBufferedStream.cs | 79 + .../WriteOnlyBufferedStream.cs.meta | 12 + .../Plugins/BestHTTP/BestHTTP/Forms.meta | 7 + .../BestHTTP/BestHTTP/Forms/HTTPFieldData.cs | 60 + .../BestHTTP/Forms/HTTPFieldData.cs.meta | 10 + .../BestHTTP/BestHTTP/Forms/HTTPFormBase.cs | 141 + .../BestHTTP/Forms/HTTPFormBase.cs.meta | 10 + .../BestHTTP/BestHTTP/Forms/HTTPFormUsage.cs | 31 + .../BestHTTP/Forms/HTTPFormUsage.cs.meta | 10 + .../BestHTTP/Forms/Implementations.meta | 7 + .../Implementations/HTTPMultiPartForm.cs | 79 + .../Implementations/HTTPMultiPartForm.cs.meta | 10 + .../Implementations/HTTPUrlEncodedForm.cs | 69 + .../HTTPUrlEncodedForm.cs.meta | 10 + .../Forms/Implementations/RawJSonForm.cs | 36 + .../Forms/Implementations/RawJSonForm.cs.meta | 12 + .../BestHTTP/BestHTTP/HTTPConnection.cs | 780 ++ .../BestHTTP/BestHTTP/HTTPConnection.cs.meta | 10 + .../BestHTTP/BestHTTP/HTTPConnectionStates.cs | 59 + .../BestHTTP/HTTPConnectionStates.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/HTTPManager.cs | 823 ++ .../BestHTTP/BestHTTP/HTTPManager.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/HTTPMethods.cs | 76 + .../BestHTTP/BestHTTP/HTTPMethods.cs.meta | 10 + .../BestHTTP/BestHTTP/HTTPProtocolFactory.cs | 77 + .../BestHTTP/HTTPProtocolFactory.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/HTTPProxy.cs | 192 + .../BestHTTP/BestHTTP/HTTPProxy.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/HTTPRange.cs | 57 + .../BestHTTP/BestHTTP/HTTPRange.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/HTTPRequest.cs | 1453 ++ .../BestHTTP/BestHTTP/HTTPRequest.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/HTTPResponse.cs | 1250 ++ .../BestHTTP/BestHTTP/HTTPResponse.cs.meta | 10 + .../BestHTTP/BestHTTP/HTTPUpdateDelegator.cs | 257 + .../BestHTTP/HTTPUpdateDelegator.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/JSON.meta | 7 + .../Plugins/BestHTTP/BestHTTP/JSON/JSON.cs | 487 + .../BestHTTP/BestHTTP/JSON/JSON.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/Logger.meta | 7 + .../BestHTTP/BestHTTP/Logger/DefaultLogger.cs | 128 + .../BestHTTP/Logger/DefaultLogger.cs.meta | 10 + .../BestHTTP/BestHTTP/Logger/ILogger.cs | 62 + .../BestHTTP/BestHTTP/Logger/ILogger.cs.meta | 10 + .../BestHTTP/BestHTTP/PlatformSupport.meta | 7 + .../BestHTTP/PlatformSupport/Collections.meta | 7 + .../Collections/ObjectModel.meta | 7 + .../ObjectModel/ObservableDictionary.cs | 263 + .../ObjectModel/ObservableDictionary.cs.meta | 10 + .../Collections/Specialized.meta | 7 + .../NotifyCollectionChangedEventArgs.cs | 467 + .../NotifyCollectionChangedEventArgs.cs.meta | 10 + .../BestHTTP/PlatformSupport/FileSystem.meta | 9 + .../FileSystem/DefaultIOService.cs | 73 + .../FileSystem/DefaultIOService.cs.meta | 11 + .../PlatformSupport/FileSystem/IIOService.cs | 63 + .../FileSystem/IIOService.cs.meta | 11 + .../FileSystem/NETFXCOREIOService.cs | 244 + .../FileSystem/NETFXCOREIOService.cs.meta | 11 + .../FileSystem/WebGLIOService.cs | 40 + .../FileSystem/WebGLIOService.cs.meta | 11 + .../BestHTTP/PlatformSupport/TcpClient.meta | 7 + .../PlatformSupport/TcpClient/TcpClient.cs | 630 + .../TcpClient/TcpClient.cs.meta | 10 + .../PlatformSupport/TcpClient/WinRT.meta | 7 + .../TcpClient/WinRT/DataReaderWriterStream.cs | 66 + .../WinRT/DataReaderWriterStream.cs.meta | 10 + .../TcpClient/WinRT/TcpClient.cs | 143 + .../TcpClient/WinRT/TcpClient.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/SOCKSProxy.cs | 356 + .../BestHTTP/BestHTTP/SOCKSProxy.cs.meta | 12 + .../BestHTTP/BestHTTP/SecureProtocol.meta | 7 + .../BestHTTP/SecureProtocol/License.txt | 7 + .../BestHTTP/SecureProtocol/License.txt.meta | 8 + .../SecureProtocol/ReflectionHelpers.cs | 112 + .../SecureProtocol/ReflectionHelpers.cs.meta | 12 + .../BestHTTP/SecureProtocol/asn1.meta | 7 + .../SecureProtocol/asn1/ASN1Generator.cs | 31 + .../SecureProtocol/asn1/ASN1Generator.cs.meta | 11 + .../asn1/ASN1OctetStringParser.cs | 14 + .../asn1/ASN1OctetStringParser.cs.meta | 11 + .../SecureProtocol/asn1/ASN1SequenceParser.cs | 12 + .../asn1/ASN1SequenceParser.cs.meta | 11 + .../SecureProtocol/asn1/ASN1SetParser.cs | 12 + .../SecureProtocol/asn1/ASN1SetParser.cs.meta | 11 + .../SecureProtocol/asn1/ASN1StreamParser.cs | 238 + .../asn1/ASN1StreamParser.cs.meta | 11 + .../asn1/ASN1TaggedObjectParser.cs | 14 + .../asn1/ASN1TaggedObjectParser.cs.meta | 11 + .../SecureProtocol/asn1/Asn1Encodable.cs | 82 + .../SecureProtocol/asn1/Asn1Encodable.cs.meta | 11 + .../asn1/Asn1EncodableVector.cs | 97 + .../asn1/Asn1EncodableVector.cs.meta | 11 + .../SecureProtocol/asn1/Asn1Exception.cs | 34 + .../SecureProtocol/asn1/Asn1Exception.cs.meta | 11 + .../SecureProtocol/asn1/Asn1InputStream.cs | 375 + .../asn1/Asn1InputStream.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/Asn1Null.cs | 22 + .../SecureProtocol/asn1/Asn1Null.cs.meta | 11 + .../SecureProtocol/asn1/Asn1Object.cs | 74 + .../SecureProtocol/asn1/Asn1Object.cs.meta | 11 + .../SecureProtocol/asn1/Asn1OctetString.cs | 123 + .../asn1/Asn1OctetString.cs.meta | 11 + .../SecureProtocol/asn1/Asn1OutputStream.cs | 39 + .../asn1/Asn1OutputStream.cs.meta | 11 + .../asn1/Asn1ParsingException.cs | 33 + .../asn1/Asn1ParsingException.cs.meta | 11 + .../SecureProtocol/asn1/Asn1Sequence.cs | 272 + .../SecureProtocol/asn1/Asn1Sequence.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/Asn1Set.cs | 376 + .../SecureProtocol/asn1/Asn1Set.cs.meta | 11 + .../SecureProtocol/asn1/Asn1TaggedObject.cs | 192 + .../asn1/Asn1TaggedObject.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/Asn1Tags.cs | 40 + .../SecureProtocol/asn1/Asn1Tags.cs.meta | 11 + .../SecureProtocol/asn1/BERBitString.cs | 47 + .../SecureProtocol/asn1/BERBitString.cs.meta | 11 + .../SecureProtocol/asn1/BERGenerator.cs | 106 + .../SecureProtocol/asn1/BERGenerator.cs.meta | 11 + .../asn1/BEROctetStringGenerator.cs | 137 + .../asn1/BEROctetStringGenerator.cs.meta | 11 + .../asn1/BEROctetStringParser.cs | 40 + .../asn1/BEROctetStringParser.cs.meta | 11 + .../asn1/BERSequenceGenerator.cs | 28 + .../asn1/BERSequenceGenerator.cs.meta | 11 + .../SecureProtocol/asn1/BERSequenceParser.cs | 28 + .../asn1/BERSequenceParser.cs.meta | 11 + .../SecureProtocol/asn1/BERSetGenerator.cs | 28 + .../asn1/BERSetGenerator.cs.meta | 11 + .../SecureProtocol/asn1/BERSetParser.cs | 28 + .../SecureProtocol/asn1/BERSetParser.cs.meta | 11 + .../asn1/BERTaggedObjectParser.cs | 75 + .../asn1/BERTaggedObjectParser.cs.meta | 11 + .../asn1/BerApplicationSpecific.cs | 19 + .../asn1/BerApplicationSpecific.cs.meta | 11 + .../asn1/BerApplicationSpecificParser.cs | 33 + .../asn1/BerApplicationSpecificParser.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/BerNull.cs | 39 + .../SecureProtocol/asn1/BerNull.cs.meta | 11 + .../SecureProtocol/asn1/BerOctetString.cs | 139 + .../asn1/BerOctetString.cs.meta | 11 + .../SecureProtocol/asn1/BerOutputStream.cs | 40 + .../asn1/BerOutputStream.cs.meta | 11 + .../SecureProtocol/asn1/BerSequence.cs | 73 + .../SecureProtocol/asn1/BerSequence.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/BerSet.cs | 74 + .../SecureProtocol/asn1/BerSet.cs.meta | 11 + .../SecureProtocol/asn1/BerTaggedObject.cs | 112 + .../asn1/BerTaggedObject.cs.meta | 11 + .../asn1/ConstructedOctetStream.cs | 106 + .../asn1/ConstructedOctetStream.cs.meta | 11 + .../SecureProtocol/asn1/DERExternal.cs | 206 + .../SecureProtocol/asn1/DERExternal.cs.meta | 11 + .../SecureProtocol/asn1/DERExternalParser.cs | 30 + .../asn1/DERExternalParser.cs.meta | 11 + .../SecureProtocol/asn1/DERGenerator.cs | 111 + .../SecureProtocol/asn1/DERGenerator.cs.meta | 11 + .../asn1/DEROctetStringParser.cs | 40 + .../asn1/DEROctetStringParser.cs.meta | 11 + .../asn1/DERSequenceGenerator.cs | 44 + .../asn1/DERSequenceGenerator.cs.meta | 11 + .../SecureProtocol/asn1/DERSequenceParser.cs | 28 + .../asn1/DERSequenceParser.cs.meta | 11 + .../SecureProtocol/asn1/DERSetGenerator.cs | 44 + .../asn1/DERSetGenerator.cs.meta | 11 + .../SecureProtocol/asn1/DERSetParser.cs | 28 + .../SecureProtocol/asn1/DERSetParser.cs.meta | 11 + .../asn1/DefiniteLengthInputStream.cs | 104 + .../asn1/DefiniteLengthInputStream.cs.meta | 11 + .../asn1/DerApplicationSpecific.cs | 230 + .../asn1/DerApplicationSpecific.cs.meta | 11 + .../SecureProtocol/asn1/DerBMPString.cs | 121 + .../SecureProtocol/asn1/DerBMPString.cs.meta | 11 + .../SecureProtocol/asn1/DerBitString.cs | 280 + .../SecureProtocol/asn1/DerBitString.cs.meta | 11 + .../SecureProtocol/asn1/DerBoolean.cs | 128 + .../SecureProtocol/asn1/DerBoolean.cs.meta | 11 + .../SecureProtocol/asn1/DerEnumerated.cs | 138 + .../SecureProtocol/asn1/DerEnumerated.cs.meta | 11 + .../SecureProtocol/asn1/DerGeneralString.cs | 85 + .../asn1/DerGeneralString.cs.meta | 11 + .../SecureProtocol/asn1/DerGeneralizedTime.cs | 324 + .../asn1/DerGeneralizedTime.cs.meta | 11 + .../SecureProtocol/asn1/DerGraphicString.cs | 107 + .../asn1/DerGraphicString.cs.meta | 11 + .../SecureProtocol/asn1/DerIA5String.cs | 149 + .../SecureProtocol/asn1/DerIA5String.cs.meta | 11 + .../SecureProtocol/asn1/DerInteger.cs | 138 + .../SecureProtocol/asn1/DerInteger.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/DerNull.cs | 45 + .../SecureProtocol/asn1/DerNull.cs.meta | 11 + .../SecureProtocol/asn1/DerNumericString.cs | 142 + .../asn1/DerNumericString.cs.meta | 11 + .../asn1/DerObjectIdentifier.cs | 358 + .../asn1/DerObjectIdentifier.cs.meta | 11 + .../SecureProtocol/asn1/DerOctetString.cs | 38 + .../asn1/DerOctetString.cs.meta | 11 + .../SecureProtocol/asn1/DerOutputStream.cs | 175 + .../asn1/DerOutputStream.cs.meta | 11 + .../SecureProtocol/asn1/DerPrintableString.cs | 167 + .../asn1/DerPrintableString.cs.meta | 11 + .../SecureProtocol/asn1/DerSequence.cs | 92 + .../SecureProtocol/asn1/DerSequence.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/DerSet.cs | 115 + .../SecureProtocol/asn1/DerSet.cs.meta | 11 + .../SecureProtocol/asn1/DerStringBase.cs | 26 + .../SecureProtocol/asn1/DerStringBase.cs.meta | 11 + .../SecureProtocol/asn1/DerT61String.cs | 106 + .../SecureProtocol/asn1/DerT61String.cs.meta | 11 + .../SecureProtocol/asn1/DerTaggedObject.cs | 76 + .../asn1/DerTaggedObject.cs.meta | 11 + .../SecureProtocol/asn1/DerUTCTime.cs | 271 + .../SecureProtocol/asn1/DerUTCTime.cs.meta | 11 + .../SecureProtocol/asn1/DerUTF8String.cs | 102 + .../SecureProtocol/asn1/DerUTF8String.cs.meta | 11 + .../SecureProtocol/asn1/DerUniversalString.cs | 111 + .../asn1/DerUniversalString.cs.meta | 11 + .../SecureProtocol/asn1/DerVideotexString.cs | 107 + .../asn1/DerVideotexString.cs.meta | 11 + .../SecureProtocol/asn1/DerVisibleString.cs | 115 + .../asn1/DerVisibleString.cs.meta | 11 + .../asn1/IAsn1ApplicationSpecificParser.cs | 14 + .../IAsn1ApplicationSpecificParser.cs.meta | 11 + .../SecureProtocol/asn1/IAsn1Choice.cs | 21 + .../SecureProtocol/asn1/IAsn1Choice.cs.meta | 11 + .../SecureProtocol/asn1/IAsn1Convertible.cs | 11 + .../asn1/IAsn1Convertible.cs.meta | 11 + .../SecureProtocol/asn1/IAsn1String.cs | 14 + .../SecureProtocol/asn1/IAsn1String.cs.meta | 11 + .../asn1/IndefiniteLengthInputStream.cs | 174 + .../asn1/IndefiniteLengthInputStream.cs.meta | 11 + .../asn1/LazyASN1InputStream.cs | 37 + .../asn1/LazyASN1InputStream.cs.meta | 11 + .../SecureProtocol/asn1/LazyDERSequence.cs | 84 + .../asn1/LazyDERSequence.cs.meta | 11 + .../SecureProtocol/asn1/LazyDERSet.cs | 84 + .../SecureProtocol/asn1/LazyDERSet.cs.meta | 11 + .../SecureProtocol/asn1/LimitedInputStream.cs | 39 + .../asn1/LimitedInputStream.cs.meta | 11 + .../SecureProtocol/asn1/OidTokenizer.cs | 49 + .../SecureProtocol/asn1/OidTokenizer.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/anssi.meta | 8 + .../asn1/anssi/ANSSINamedCurves.cs | 127 + .../asn1/anssi/ANSSINamedCurves.cs.meta | 11 + .../asn1/anssi/ANSSIObjectIdentifiers.cs | 17 + .../asn1/anssi/ANSSIObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/bc.meta | 8 + .../asn1/bc/BCObjectIdentifiers.cs | 112 + .../asn1/bc/BCObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/bsi.meta | 8 + .../asn1/bsi/BsiObjectIdentifiers.cs | 107 + .../asn1/bsi/BsiObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/cmp.meta | 8 + .../asn1/cmp/CAKeyUpdAnnContent.cs | 66 + .../asn1/cmp/CAKeyUpdAnnContent.cs.meta | 11 + .../asn1/cmp/CertConfirmContent.cs | 53 + .../asn1/cmp/CertConfirmContent.cs.meta | 11 + .../SecureProtocol/asn1/cmp/CertOrEncCert.cs | 90 + .../asn1/cmp/CertOrEncCert.cs.meta | 11 + .../SecureProtocol/asn1/cmp/CertRepMessage.cs | 100 + .../asn1/cmp/CertRepMessage.cs.meta | 11 + .../SecureProtocol/asn1/cmp/CertResponse.cs | 120 + .../asn1/cmp/CertResponse.cs.meta | 11 + .../SecureProtocol/asn1/cmp/CertStatus.cs | 89 + .../asn1/cmp/CertStatus.cs.meta | 11 + .../asn1/cmp/CertifiedKeyPair.cs | 119 + .../asn1/cmp/CertifiedKeyPair.cs.meta | 11 + .../SecureProtocol/asn1/cmp/Challenge.cs | 84 + .../SecureProtocol/asn1/cmp/Challenge.cs.meta | 11 + .../SecureProtocol/asn1/cmp/CmpCertificate.cs | 85 + .../asn1/cmp/CmpCertificate.cs.meta | 11 + .../asn1/cmp/CmpObjectIdentifiers.cs | 110 + .../asn1/cmp/CmpObjectIdentifiers.cs.meta | 11 + .../SecureProtocol/asn1/cmp/CrlAnnContent.cs | 54 + .../asn1/cmp/CrlAnnContent.cs.meta | 11 + .../asn1/cmp/ErrorMsgContent.cs | 99 + .../asn1/cmp/ErrorMsgContent.cs.meta | 11 + .../SecureProtocol/asn1/cmp/GenMsgContent.cs | 58 + .../asn1/cmp/GenMsgContent.cs.meta | 11 + .../SecureProtocol/asn1/cmp/GenRepContent.cs | 58 + .../asn1/cmp/GenRepContent.cs.meta | 11 + .../asn1/cmp/InfoTypeAndValue.cs | 127 + .../asn1/cmp/InfoTypeAndValue.cs.meta | 11 + .../asn1/cmp/KeyRecRepContent.cs | 121 + .../asn1/cmp/KeyRecRepContent.cs.meta | 11 + .../SecureProtocol/asn1/cmp/OobCertHash.cs | 92 + .../asn1/cmp/OobCertHash.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PKIBody.cs | 191 + .../SecureProtocol/asn1/cmp/PKIBody.cs.meta | 11 + .../asn1/cmp/PKIConfirmContent.cs | 40 + .../asn1/cmp/PKIConfirmContent.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PKIFailureInfo.cs | 100 + .../asn1/cmp/PKIFailureInfo.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PKIFreeText.cs | 103 + .../asn1/cmp/PKIFreeText.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PKIHeader.cs | 242 + .../SecureProtocol/asn1/cmp/PKIHeader.cs.meta | 11 + .../asn1/cmp/PKIHeaderBuilder.cs | 227 + .../asn1/cmp/PKIHeaderBuilder.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PKIMessage.cs | 144 + .../asn1/cmp/PKIMessage.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PKIMessages.cs | 58 + .../asn1/cmp/PKIMessages.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PKIStatus.cs | 67 + .../SecureProtocol/asn1/cmp/PKIStatus.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PKIStatusInfo.cs | 170 + .../asn1/cmp/PKIStatusInfo.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PbmParameter.cs | 105 + .../asn1/cmp/PbmParameter.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PollRepContent.cs | 91 + .../asn1/cmp/PollRepContent.cs.meta | 11 + .../SecureProtocol/asn1/cmp/PollReqContent.cs | 65 + .../asn1/cmp/PollReqContent.cs.meta | 11 + .../asn1/cmp/PopoDecKeyChallContent.cs | 53 + .../asn1/cmp/PopoDecKeyChallContent.cs.meta | 11 + .../asn1/cmp/PopoDecKeyRespContent.cs | 53 + .../asn1/cmp/PopoDecKeyRespContent.cs.meta | 11 + .../SecureProtocol/asn1/cmp/ProtectedPart.cs | 64 + .../asn1/cmp/ProtectedPart.cs.meta | 11 + .../SecureProtocol/asn1/cmp/RevAnnContent.cs | 91 + .../asn1/cmp/RevAnnContent.cs.meta | 11 + .../SecureProtocol/asn1/cmp/RevDetails.cs | 79 + .../asn1/cmp/RevDetails.cs.meta | 11 + .../SecureProtocol/asn1/cmp/RevRepContent.cs | 117 + .../asn1/cmp/RevRepContent.cs.meta | 11 + .../asn1/cmp/RevRepContentBuilder.cs | 59 + .../asn1/cmp/RevRepContentBuilder.cs.meta | 11 + .../SecureProtocol/asn1/cmp/RevReqContent.cs | 58 + .../asn1/cmp/RevReqContent.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/cms.meta | 8 + .../SecureProtocol/asn1/cms/Attribute.cs | 74 + .../SecureProtocol/asn1/cms/Attribute.cs.meta | 11 + .../SecureProtocol/asn1/cms/AttributeTable.cs | 235 + .../asn1/cms/AttributeTable.cs.meta | 11 + .../SecureProtocol/asn1/cms/Attributes.cs | 59 + .../asn1/cms/Attributes.cs.meta | 11 + .../asn1/cms/AuthEnvelopedData.cs | 209 + .../asn1/cms/AuthEnvelopedData.cs.meta | 11 + .../asn1/cms/AuthEnvelopedDataParser.cs | 149 + .../asn1/cms/AuthEnvelopedDataParser.cs.meta | 11 + .../asn1/cms/AuthenticatedData.cs | 275 + .../asn1/cms/AuthenticatedData.cs.meta | 11 + .../asn1/cms/AuthenticatedDataParser.cs | 186 + .../asn1/cms/AuthenticatedDataParser.cs.meta | 11 + .../SecureProtocol/asn1/cms/CMSAttributes.cs | 18 + .../asn1/cms/CMSAttributes.cs.meta | 11 + .../asn1/cms/CMSObjectIdentifiers.cs | 32 + .../asn1/cms/CMSObjectIdentifiers.cs.meta | 11 + .../SecureProtocol/asn1/cms/CompressedData.cs | 100 + .../asn1/cms/CompressedData.cs.meta | 11 + .../asn1/cms/CompressedDataParser.cs | 51 + .../asn1/cms/CompressedDataParser.cs.meta | 11 + .../SecureProtocol/asn1/cms/ContentInfo.cs | 92 + .../asn1/cms/ContentInfo.cs.meta | 11 + .../asn1/cms/ContentInfoParser.cs | 44 + .../asn1/cms/ContentInfoParser.cs.meta | 11 + .../asn1/cms/EncryptedContentInfo.cs | 98 + .../asn1/cms/EncryptedContentInfo.cs.meta | 11 + .../asn1/cms/EncryptedContentInfoParser.cs | 50 + .../cms/EncryptedContentInfoParser.cs.meta | 11 + .../SecureProtocol/asn1/cms/EncryptedData.cs | 101 + .../asn1/cms/EncryptedData.cs.meta | 11 + .../SecureProtocol/asn1/cms/EnvelopedData.cs | 180 + .../asn1/cms/EnvelopedData.cs.meta | 11 + .../asn1/cms/EnvelopedDataParser.cs | 111 + .../asn1/cms/EnvelopedDataParser.cs.meta | 11 + .../SecureProtocol/asn1/cms/Evidence.cs | 53 + .../SecureProtocol/asn1/cms/Evidence.cs.meta | 11 + .../asn1/cms/IssuerAndSerialNumber.cs | 68 + .../asn1/cms/IssuerAndSerialNumber.cs.meta | 11 + .../SecureProtocol/asn1/cms/KEKIdentifier.cs | 123 + .../asn1/cms/KEKIdentifier.cs.meta | 11 + .../asn1/cms/KEKRecipientInfo.cs | 110 + .../asn1/cms/KEKRecipientInfo.cs.meta | 11 + .../asn1/cms/KeyAgreeRecipientIdentifier.cs | 98 + .../cms/KeyAgreeRecipientIdentifier.cs.meta | 11 + .../asn1/cms/KeyAgreeRecipientInfo.cs | 145 + .../asn1/cms/KeyAgreeRecipientInfo.cs.meta | 11 + .../asn1/cms/KeyTransRecipientInfo.cs | 103 + .../asn1/cms/KeyTransRecipientInfo.cs.meta | 11 + .../SecureProtocol/asn1/cms/MetaData.cs | 98 + .../SecureProtocol/asn1/cms/MetaData.cs.meta | 11 + .../asn1/cms/OriginatorIdentifierOrKey.cs | 172 + .../cms/OriginatorIdentifierOrKey.cs.meta | 11 + .../SecureProtocol/asn1/cms/OriginatorInfo.cs | 125 + .../asn1/cms/OriginatorInfo.cs.meta | 11 + .../asn1/cms/OriginatorPublicKey.cs | 92 + .../asn1/cms/OriginatorPublicKey.cs.meta | 11 + .../asn1/cms/OtherKeyAttribute.cs | 74 + .../asn1/cms/OtherKeyAttribute.cs.meta | 11 + .../asn1/cms/OtherRecipientInfo.cs | 87 + .../asn1/cms/OtherRecipientInfo.cs.meta | 11 + .../asn1/cms/OtherRevocationInfoFormat.cs | 81 + .../cms/OtherRevocationInfoFormat.cs.meta | 11 + .../asn1/cms/PasswordRecipientInfo.cs | 137 + .../asn1/cms/PasswordRecipientInfo.cs.meta | 11 + .../asn1/cms/RecipientEncryptedKey.cs | 94 + .../asn1/cms/RecipientEncryptedKey.cs.meta | 11 + .../asn1/cms/RecipientIdentifier.cs | 93 + .../asn1/cms/RecipientIdentifier.cs.meta | 11 + .../SecureProtocol/asn1/cms/RecipientInfo.cs | 149 + .../asn1/cms/RecipientInfo.cs.meta | 11 + .../asn1/cms/RecipientKeyIdentifier.cs | 141 + .../asn1/cms/RecipientKeyIdentifier.cs.meta | 11 + .../SecureProtocol/asn1/cms/SCVPReqRes.cs | 81 + .../asn1/cms/SCVPReqRes.cs.meta | 11 + .../SecureProtocol/asn1/cms/SignedData.cs | 291 + .../asn1/cms/SignedData.cs.meta | 11 + .../asn1/cms/SignedDataParser.cs | 118 + .../asn1/cms/SignedDataParser.cs.meta | 11 + .../asn1/cms/SignerIdentifier.cs | 93 + .../asn1/cms/SignerIdentifier.cs.meta | 11 + .../SecureProtocol/asn1/cms/SignerInfo.cs | 189 + .../asn1/cms/SignerInfo.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/cms/Time.cs | 119 + .../SecureProtocol/asn1/cms/Time.cs.meta | 11 + .../asn1/cms/TimeStampAndCRL.cs | 66 + .../asn1/cms/TimeStampAndCRL.cs.meta | 11 + .../asn1/cms/TimeStampTokenEvidence.cs | 69 + .../asn1/cms/TimeStampTokenEvidence.cs.meta | 11 + .../asn1/cms/TimeStampedData.cs | 99 + .../asn1/cms/TimeStampedData.cs.meta | 11 + .../asn1/cms/TimeStampedDataParser.cs | 80 + .../asn1/cms/TimeStampedDataParser.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/cms/ecc.meta | 8 + .../asn1/cms/ecc/MQVuserKeyingMaterial.cs | 109 + .../cms/ecc/MQVuserKeyingMaterial.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/crmf.meta | 8 + .../asn1/crmf/AttributeTypeAndValue.cs | 72 + .../asn1/crmf/AttributeTypeAndValue.cs.meta | 11 + .../SecureProtocol/asn1/crmf/CertId.cs | 63 + .../SecureProtocol/asn1/crmf/CertId.cs.meta | 11 + .../asn1/crmf/CertReqMessages.cs | 58 + .../asn1/crmf/CertReqMessages.cs.meta | 11 + .../SecureProtocol/asn1/crmf/CertReqMsg.cs | 116 + .../asn1/crmf/CertReqMsg.cs.meta | 11 + .../SecureProtocol/asn1/crmf/CertRequest.cs | 86 + .../asn1/crmf/CertRequest.cs.meta | 11 + .../SecureProtocol/asn1/crmf/CertTemplate.cs | 153 + .../asn1/crmf/CertTemplate.cs.meta | 11 + .../asn1/crmf/CertTemplateBuilder.cs | 129 + .../asn1/crmf/CertTemplateBuilder.cs.meta | 11 + .../SecureProtocol/asn1/crmf/Controls.cs | 58 + .../SecureProtocol/asn1/crmf/Controls.cs.meta | 11 + .../asn1/crmf/CrmfObjectIdentifiers.cs | 27 + .../asn1/crmf/CrmfObjectIdentifiers.cs.meta | 11 + .../SecureProtocol/asn1/crmf/EncKeyWithID.cs | 107 + .../asn1/crmf/EncKeyWithID.cs.meta | 11 + .../SecureProtocol/asn1/crmf/EncryptedKey.cs | 82 + .../asn1/crmf/EncryptedKey.cs.meta | 11 + .../asn1/crmf/EncryptedValue.cs | 158 + .../asn1/crmf/EncryptedValue.cs.meta | 11 + .../asn1/crmf/OptionalValidity.cs | 75 + .../asn1/crmf/OptionalValidity.cs.meta | 11 + .../asn1/crmf/PKIArchiveOptions.cs | 111 + .../asn1/crmf/PKIArchiveOptions.cs.meta | 11 + .../asn1/crmf/PKIPublicationInfo.cs | 70 + .../asn1/crmf/PKIPublicationInfo.cs.meta | 11 + .../SecureProtocol/asn1/crmf/PKMacValue.cs | 94 + .../asn1/crmf/PKMacValue.cs.meta | 11 + .../SecureProtocol/asn1/crmf/PopoPrivKey.cs | 88 + .../asn1/crmf/PopoPrivKey.cs.meta | 11 + .../asn1/crmf/PopoSigningKey.cs | 120 + .../asn1/crmf/PopoSigningKey.cs.meta | 11 + .../asn1/crmf/PopoSigningKeyInput.cs | 120 + .../asn1/crmf/PopoSigningKeyInput.cs.meta | 11 + .../asn1/crmf/ProofOfPossession.cs | 104 + .../asn1/crmf/ProofOfPossession.cs.meta | 11 + .../SecureProtocol/asn1/crmf/SinglePubInfo.cs | 63 + .../asn1/crmf/SinglePubInfo.cs.meta | 11 + .../asn1/crmf/SubsequentMessage.cs | 31 + .../asn1/crmf/SubsequentMessage.cs.meta | 11 + .../SecureProtocol/asn1/cryptopro.meta | 8 + .../cryptopro/CryptoProObjectIdentifiers.cs | 55 + .../CryptoProObjectIdentifiers.cs.meta | 11 + .../asn1/cryptopro/ECGOST3410NamedCurves.cs | 260 + .../cryptopro/ECGOST3410NamedCurves.cs.meta | 11 + .../cryptopro/ECGOST3410ParamSetParameters.cs | 91 + .../ECGOST3410ParamSetParameters.cs.meta | 11 + .../asn1/cryptopro/GOST28147Parameters.cs | 67 + .../cryptopro/GOST28147Parameters.cs.meta | 11 + .../asn1/cryptopro/GOST3410NamedParameters.cs | 127 + .../cryptopro/GOST3410NamedParameters.cs.meta | 11 + .../cryptopro/GOST3410ParamSetParameters.cs | 91 + .../GOST3410ParamSetParameters.cs.meta | 11 + .../GOST3410PublicKeyAlgParameters.cs | 96 + .../GOST3410PublicKeyAlgParameters.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/eac.meta | 8 + .../asn1/eac/EACObjectIdentifiers.cs | 54 + .../asn1/eac/EACObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/edec.meta | 8 + .../asn1/edec/EdECObjectIdentifiers.cs | 21 + .../asn1/edec/EdECObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/esf.meta | 8 + .../asn1/esf/CertificateValues.cs | 90 + .../asn1/esf/CertificateValues.cs.meta | 11 + .../asn1/esf/CommitmentTypeIdentifier.cs | 21 + .../asn1/esf/CommitmentTypeIdentifier.cs.meta | 11 + .../asn1/esf/CommitmentTypeIndication.cs | 99 + .../asn1/esf/CommitmentTypeIndication.cs.meta | 11 + .../asn1/esf/CommitmentTypeQualifier.cs | 123 + .../asn1/esf/CommitmentTypeQualifier.cs.meta | 11 + .../asn1/esf/CompleteCertificateRefs.cs | 89 + .../asn1/esf/CompleteCertificateRefs.cs.meta | 11 + .../asn1/esf/CompleteRevocationRefs.cs | 89 + .../asn1/esf/CompleteRevocationRefs.cs.meta | 11 + .../SecureProtocol/asn1/esf/CrlIdentifier.cs | 115 + .../asn1/esf/CrlIdentifier.cs.meta | 11 + .../SecureProtocol/asn1/esf/CrlListID.cs | 94 + .../SecureProtocol/asn1/esf/CrlListID.cs.meta | 11 + .../SecureProtocol/asn1/esf/CrlOcspRef.cs | 117 + .../asn1/esf/CrlOcspRef.cs.meta | 11 + .../SecureProtocol/asn1/esf/CrlValidatedID.cs | 95 + .../asn1/esf/CrlValidatedID.cs.meta | 11 + .../SecureProtocol/asn1/esf/ESFAttributes.cs | 29 + .../asn1/esf/ESFAttributes.cs.meta | 11 + .../SecureProtocol/asn1/esf/OcspIdentifier.cs | 82 + .../asn1/esf/OcspIdentifier.cs.meta | 11 + .../SecureProtocol/asn1/esf/OcspListID.cs | 93 + .../asn1/esf/OcspListID.cs.meta | 11 + .../asn1/esf/OcspResponsesID.cs | 98 + .../asn1/esf/OcspResponsesID.cs.meta | 11 + .../SecureProtocol/asn1/esf/OtherCertID.cs | 98 + .../asn1/esf/OtherCertID.cs.meta | 11 + .../SecureProtocol/asn1/esf/OtherHash.cs | 92 + .../SecureProtocol/asn1/esf/OtherHash.cs.meta | 11 + .../asn1/esf/OtherHashAlgAndValue.cs | 99 + .../asn1/esf/OtherHashAlgAndValue.cs.meta | 11 + .../SecureProtocol/asn1/esf/OtherRevRefs.cs | 84 + .../asn1/esf/OtherRevRefs.cs.meta | 11 + .../SecureProtocol/asn1/esf/OtherRevVals.cs | 84 + .../asn1/esf/OtherRevVals.cs.meta | 11 + .../asn1/esf/OtherSigningCertificate.cs | 143 + .../asn1/esf/OtherSigningCertificate.cs.meta | 11 + .../asn1/esf/RevocationValues.cs | 169 + .../asn1/esf/RevocationValues.cs.meta | 11 + .../asn1/esf/SigPolicyQualifierInfo.cs | 77 + .../asn1/esf/SigPolicyQualifierInfo.cs.meta | 11 + .../asn1/esf/SignaturePolicyId.cs | 150 + .../asn1/esf/SignaturePolicyId.cs.meta | 11 + .../asn1/esf/SignaturePolicyIdentifier.cs | 70 + .../esf/SignaturePolicyIdentifier.cs.meta | 11 + .../asn1/esf/SignerAttribute.cs | 101 + .../asn1/esf/SignerAttribute.cs.meta | 11 + .../SecureProtocol/asn1/esf/SignerLocation.cs | 176 + .../asn1/esf/SignerLocation.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/ess.meta | 8 + .../SecureProtocol/asn1/ess/ContentHints.cs | 98 + .../asn1/ess/ContentHints.cs.meta | 11 + .../asn1/ess/ContentIdentifier.cs | 71 + .../asn1/ess/ContentIdentifier.cs.meta | 11 + .../SecureProtocol/asn1/ess/ESSCertID.cs | 98 + .../SecureProtocol/asn1/ess/ESSCertID.cs.meta | 11 + .../SecureProtocol/asn1/ess/ESSCertIDv2.cs | 150 + .../asn1/ess/ESSCertIDv2.cs.meta | 11 + .../SecureProtocol/asn1/ess/OtherCertID.cs | 138 + .../asn1/ess/OtherCertID.cs.meta | 11 + .../asn1/ess/OtherSigningCertificate.cs | 114 + .../asn1/ess/OtherSigningCertificate.cs.meta | 11 + .../asn1/ess/SigningCertificate.cs | 113 + .../asn1/ess/SigningCertificate.cs.meta | 11 + .../asn1/ess/SigningCertificateV2.cs | 117 + .../asn1/ess/SigningCertificateV2.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/gm.meta | 8 + .../SecureProtocol/asn1/gm/GMNamedCurves.cs | 161 + .../asn1/gm/GMNamedCurves.cs.meta | 11 + .../asn1/gm/GMObjectIdentifiers.cs | 89 + .../asn1/gm/GMObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/gnu.meta | 8 + .../asn1/gnu/GNUObjectIdentifiers.cs | 40 + .../asn1/gnu/GNUObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/iana.meta | 8 + .../asn1/iana/IANAObjectIdentifiers.cs | 22 + .../asn1/iana/IANAObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/icao.meta | 8 + .../asn1/icao/CscaMasterList.cs | 87 + .../asn1/icao/CscaMasterList.cs.meta | 11 + .../SecureProtocol/asn1/icao/DataGroupHash.cs | 90 + .../asn1/icao/DataGroupHash.cs.meta | 11 + .../asn1/icao/ICAOObjectIdentifiers.cs | 38 + .../asn1/icao/ICAOObjectIdentifiers.cs.meta | 11 + .../asn1/icao/LDSSecurityObject.cs | 149 + .../asn1/icao/LDSSecurityObject.cs.meta | 11 + .../asn1/icao/LDSVersionInfo.cs | 65 + .../asn1/icao/LDSVersionInfo.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/isismtt.meta | 8 + .../asn1/isismtt/ISISMTTObjectIdentifiers.cs | 181 + .../isismtt/ISISMTTObjectIdentifiers.cs.meta | 11 + .../SecureProtocol/asn1/isismtt/ocsp.meta | 8 + .../asn1/isismtt/ocsp/CertHash.cs | 126 + .../asn1/isismtt/ocsp/CertHash.cs.meta | 11 + .../asn1/isismtt/ocsp/RequestedCertificate.cs | 192 + .../isismtt/ocsp/RequestedCertificate.cs.meta | 11 + .../SecureProtocol/asn1/isismtt/x509.meta | 8 + .../x509/AdditionalInformationSyntax.cs | 75 + .../x509/AdditionalInformationSyntax.cs.meta | 11 + .../asn1/isismtt/x509/AdmissionSyntax.cs | 282 + .../asn1/isismtt/x509/AdmissionSyntax.cs.meta | 11 + .../asn1/isismtt/x509/Admissions.cs | 191 + .../asn1/isismtt/x509/Admissions.cs.meta | 11 + .../isismtt/x509/DeclarationOfMajority.cs | 176 + .../x509/DeclarationOfMajority.cs.meta | 11 + .../asn1/isismtt/x509/MonetaryLimit.cs | 126 + .../asn1/isismtt/x509/MonetaryLimit.cs.meta | 11 + .../asn1/isismtt/x509/NamingAuthority.cs | 219 + .../asn1/isismtt/x509/NamingAuthority.cs.meta | 11 + .../asn1/isismtt/x509/ProcurationSyntax.cs | 237 + .../isismtt/x509/ProcurationSyntax.cs.meta | 11 + .../asn1/isismtt/x509/ProfessionInfo.cs | 391 + .../asn1/isismtt/x509/ProfessionInfo.cs.meta | 11 + .../asn1/isismtt/x509/Restriction.cs | 86 + .../asn1/isismtt/x509/Restriction.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/kisa.meta | 8 + .../asn1/kisa/KISAObjectIdentifiers.cs | 12 + .../asn1/kisa/KISAObjectIdentifiers.cs.meta | 11 + .../SecureProtocol/asn1/microsoft.meta | 8 + .../microsoft/MicrosoftObjectIdentifiers.cs | 23 + .../MicrosoftObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/misc.meta | 8 + .../asn1/misc/CAST5CBCParameters.cs | 78 + .../asn1/misc/CAST5CBCParameters.cs.meta | 11 + .../SecureProtocol/asn1/misc/IDEACBCPar.cs | 72 + .../asn1/misc/IDEACBCPar.cs.meta | 11 + .../asn1/misc/MiscObjectIdentifiers.cs | 92 + .../asn1/misc/MiscObjectIdentifiers.cs.meta | 11 + .../asn1/misc/NetscapeCertType.cs | 58 + .../asn1/misc/NetscapeCertType.cs.meta | 11 + .../asn1/misc/NetscapeRevocationURL.cs | 22 + .../asn1/misc/NetscapeRevocationURL.cs.meta | 11 + .../asn1/misc/VerisignCzagExtension.cs | 22 + .../asn1/misc/VerisignCzagExtension.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/mozilla.meta | 8 + .../asn1/mozilla/PublicKeyAndChallenge.cs | 72 + .../mozilla/PublicKeyAndChallenge.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/nist.meta | 8 + .../asn1/nist/NISTNamedCurves.cs | 106 + .../asn1/nist/NISTNamedCurves.cs.meta | 11 + .../asn1/nist/NISTObjectIdentifiers.cs | 79 + .../asn1/nist/NISTObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/ntt.meta | 8 + .../asn1/ntt/NTTObjectIdentifiers.cs | 18 + .../asn1/ntt/NTTObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/ocsp.meta | 8 + .../asn1/ocsp/BasicOCSPResponse.cs | 141 + .../asn1/ocsp/BasicOCSPResponse.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/CertID.cs | 103 + .../SecureProtocol/asn1/ocsp/CertID.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/CertStatus.cs | 100 + .../asn1/ocsp/CertStatus.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/CrlID.cs | 86 + .../SecureProtocol/asn1/ocsp/CrlID.cs.meta | 11 + .../asn1/ocsp/OCSPObjectIdentifiers.cs | 27 + .../asn1/ocsp/OCSPObjectIdentifiers.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/OCSPRequest.cs | 93 + .../asn1/ocsp/OCSPRequest.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/OCSPResponse.cs | 94 + .../asn1/ocsp/OCSPResponse.cs.meta | 11 + .../asn1/ocsp/OCSPResponseStatus.cs | 45 + .../asn1/ocsp/OCSPResponseStatus.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/Request.cs | 95 + .../SecureProtocol/asn1/ocsp/Request.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/ResponderID.cs | 111 + .../asn1/ocsp/ResponderID.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/ResponseBytes.cs | 86 + .../asn1/ocsp/ResponseBytes.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/ResponseData.cs | 162 + .../asn1/ocsp/ResponseData.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/RevokedInfo.cs | 100 + .../asn1/ocsp/RevokedInfo.cs.meta | 11 + .../asn1/ocsp/ServiceLocator.cs | 99 + .../asn1/ocsp/ServiceLocator.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/Signature.cs | 119 + .../asn1/ocsp/Signature.cs.meta | 11 + .../asn1/ocsp/SingleResponse.cs | 141 + .../asn1/ocsp/SingleResponse.cs.meta | 11 + .../SecureProtocol/asn1/ocsp/TBSRequest.cs | 155 + .../asn1/ocsp/TBSRequest.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/oiw.meta | 8 + .../asn1/oiw/ElGamalParameter.cs | 51 + .../asn1/oiw/ElGamalParameter.cs.meta | 11 + .../asn1/oiw/OIWObjectIdentifiers.cs | 33 + .../asn1/oiw/OIWObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/pkcs.meta | 8 + .../SecureProtocol/asn1/pkcs/Attribute.cs | 83 + .../asn1/pkcs/Attribute.cs.meta | 11 + .../asn1/pkcs/AuthenticatedSafe.cs | 41 + .../asn1/pkcs/AuthenticatedSafe.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/CertBag.cs | 50 + .../SecureProtocol/asn1/pkcs/CertBag.cs.meta | 11 + .../asn1/pkcs/CertificationRequest.cs | 91 + .../asn1/pkcs/CertificationRequest.cs.meta | 11 + .../asn1/pkcs/CertificationRequestInfo.cs | 141 + .../pkcs/CertificationRequestInfo.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/ContentInfo.cs | 78 + .../asn1/pkcs/ContentInfo.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/DHParameter.cs | 76 + .../asn1/pkcs/DHParameter.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/EncryptedData.cs | 109 + .../asn1/pkcs/EncryptedData.cs.meta | 11 + .../asn1/pkcs/EncryptedPrivateKeyInfo.cs | 83 + .../asn1/pkcs/EncryptedPrivateKeyInfo.cs.meta | 11 + .../asn1/pkcs/EncryptionScheme.cs | 59 + .../asn1/pkcs/EncryptionScheme.cs.meta | 11 + .../asn1/pkcs/IssuerAndSerialNumber.cs | 76 + .../asn1/pkcs/IssuerAndSerialNumber.cs.meta | 11 + .../asn1/pkcs/KeyDerivationFunc.cs | 25 + .../asn1/pkcs/KeyDerivationFunc.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/MacData.cs | 100 + .../SecureProtocol/asn1/pkcs/MacData.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/PBEParameter.cs | 64 + .../asn1/pkcs/PBEParameter.cs.meta | 11 + .../asn1/pkcs/PBES2Parameters.cs | 69 + .../asn1/pkcs/PBES2Parameters.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/PBKDF2Params.cs | 148 + .../asn1/pkcs/PBKDF2Params.cs.meta | 11 + .../asn1/pkcs/PKCS12PBEParams.cs | 67 + .../asn1/pkcs/PKCS12PBEParams.cs.meta | 11 + .../asn1/pkcs/PKCSObjectIdentifiers.cs | 297 + .../asn1/pkcs/PKCSObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/pkcs/Pfx.cs | 69 + .../SecureProtocol/asn1/pkcs/Pfx.cs.meta | 11 + .../asn1/pkcs/PrivateKeyInfo.cs | 208 + .../asn1/pkcs/PrivateKeyInfo.cs.meta | 11 + .../asn1/pkcs/RC2CBCParameter.cs | 84 + .../asn1/pkcs/RC2CBCParameter.cs.meta | 11 + .../asn1/pkcs/RSAESOAEPparams.cs | 150 + .../asn1/pkcs/RSAESOAEPparams.cs.meta | 11 + .../asn1/pkcs/RSAPrivateKeyStructure.cs | 150 + .../asn1/pkcs/RSAPrivateKeyStructure.cs.meta | 11 + .../asn1/pkcs/RSASSAPSSparams.cs | 170 + .../asn1/pkcs/RSASSAPSSparams.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/SafeBag.cs | 74 + .../SecureProtocol/asn1/pkcs/SafeBag.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/SignedData.cs | 161 + .../asn1/pkcs/SignedData.cs.meta | 11 + .../SecureProtocol/asn1/pkcs/SignerInfo.cs | 158 + .../asn1/pkcs/SignerInfo.cs.meta | 11 + .../SecureProtocol/asn1/rosstandart.meta | 8 + .../RosstandartObjectIdentifiers.cs | 51 + .../RosstandartObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/sec.meta | 8 + .../asn1/sec/ECPrivateKeyStructure.cs | 179 + .../asn1/sec/ECPrivateKeyStructure.cs.meta | 11 + .../SecureProtocol/asn1/sec/SECNamedCurves.cs | 1188 ++ .../asn1/sec/SECNamedCurves.cs.meta | 11 + .../asn1/sec/SECObjectIdentifiers.cs | 56 + .../asn1/sec/SECObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/smime.meta | 8 + .../asn1/smime/SMIMEAttributes.cs | 15 + .../asn1/smime/SMIMEAttributes.cs.meta | 11 + .../asn1/smime/SMIMECapabilities.cs | 138 + .../asn1/smime/SMIMECapabilities.cs.meta | 11 + .../asn1/smime/SMIMECapabilitiesAttribute.cs | 20 + .../smime/SMIMECapabilitiesAttribute.cs.meta | 11 + .../asn1/smime/SMIMECapability.cs | 105 + .../asn1/smime/SMIMECapability.cs.meta | 11 + .../asn1/smime/SMIMECapabilityVector.cs | 41 + .../asn1/smime/SMIMECapabilityVector.cs.meta | 11 + .../SMIMEEncryptionKeyPreferenceAttribute.cs | 48 + ...MEEncryptionKeyPreferenceAttribute.cs.meta | 11 + .../SecureProtocol/asn1/teletrust.meta | 8 + .../asn1/teletrust/TeleTrusTNamedCurves.cs | 474 + .../teletrust/TeleTrusTNamedCurves.cs.meta | 11 + .../teletrust/TeleTrusTObjectIdentifiers.cs | 49 + .../TeleTrusTObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/tsp.meta | 8 + .../SecureProtocol/asn1/tsp/Accuracy.cs | 155 + .../SecureProtocol/asn1/tsp/Accuracy.cs.meta | 11 + .../SecureProtocol/asn1/tsp/MessageImprint.cs | 79 + .../asn1/tsp/MessageImprint.cs.meta | 11 + .../SecureProtocol/asn1/tsp/TSTInfo.cs | 254 + .../SecureProtocol/asn1/tsp/TSTInfo.cs.meta | 11 + .../SecureProtocol/asn1/tsp/TimeStampReq.cs | 169 + .../asn1/tsp/TimeStampReq.cs.meta | 11 + .../SecureProtocol/asn1/tsp/TimeStampResp.cs | 84 + .../asn1/tsp/TimeStampResp.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/ua.meta | 8 + .../asn1/ua/UAObjectIdentifiers.cs | 111 + .../asn1/ua/UAObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/util.meta | 8 + .../SecureProtocol/asn1/util/Asn1Dump.cs | 385 + .../SecureProtocol/asn1/util/Asn1Dump.cs.meta | 11 + .../SecureProtocol/asn1/util/FilterStream.cs | 87 + .../asn1/util/FilterStream.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/x500.meta | 8 + .../asn1/x500/DirectoryString.cs | 78 + .../asn1/x500/DirectoryString.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/x509.meta | 8 + .../asn1/x509/AccessDescription.cs | 89 + .../asn1/x509/AccessDescription.cs.meta | 11 + .../asn1/x509/AlgorithmIdentifier.cs | 100 + .../asn1/x509/AlgorithmIdentifier.cs.meta | 11 + .../SecureProtocol/asn1/x509/AttCertIssuer.cs | 90 + .../asn1/x509/AttCertIssuer.cs.meta | 11 + .../asn1/x509/AttCertValidityPeriod.cs | 82 + .../asn1/x509/AttCertValidityPeriod.cs.meta | 11 + .../SecureProtocol/asn1/x509/Attribute.cs | 86 + .../asn1/x509/Attribute.cs.meta | 11 + .../asn1/x509/AttributeCertificate.cs | 90 + .../asn1/x509/AttributeCertificate.cs.meta | 11 + .../asn1/x509/AttributeCertificateInfo.cs | 160 + .../x509/AttributeCertificateInfo.cs.meta | 11 + .../asn1/x509/AttributeTable.cs | 77 + .../asn1/x509/AttributeTable.cs.meta | 11 + .../asn1/x509/AuthorityInformationAccess.cs | 102 + .../x509/AuthorityInformationAccess.cs.meta | 11 + .../asn1/x509/AuthorityKeyIdentifier.cs | 215 + .../asn1/x509/AuthorityKeyIdentifier.cs.meta | 11 + .../asn1/x509/BasicConstraints.cs | 137 + .../asn1/x509/BasicConstraints.cs.meta | 11 + .../SecureProtocol/asn1/x509/CRLDistPoint.cs | 97 + .../asn1/x509/CRLDistPoint.cs.meta | 11 + .../SecureProtocol/asn1/x509/CRLNumber.cs | 34 + .../asn1/x509/CRLNumber.cs.meta | 11 + .../SecureProtocol/asn1/x509/CRLReason.cs | 65 + .../asn1/x509/CRLReason.cs.meta | 11 + .../SecureProtocol/asn1/x509/CertPolicyId.cs | 24 + .../asn1/x509/CertPolicyId.cs.meta | 11 + .../asn1/x509/CertificateList.cs | 117 + .../asn1/x509/CertificateList.cs.meta | 11 + .../asn1/x509/CertificatePair.cs | 166 + .../asn1/x509/CertificatePair.cs.meta | 11 + .../asn1/x509/CertificatePolicies.cs | 85 + .../asn1/x509/CertificatePolicies.cs.meta | 11 + .../SecureProtocol/asn1/x509/DSAParameter.cs | 82 + .../asn1/x509/DSAParameter.cs.meta | 11 + .../SecureProtocol/asn1/x509/DigestInfo.cs | 82 + .../asn1/x509/DigestInfo.cs.meta | 11 + .../SecureProtocol/asn1/x509/DisplayText.cs | 178 + .../asn1/x509/DisplayText.cs.meta | 11 + .../asn1/x509/DistributionPoint.cs | 165 + .../asn1/x509/DistributionPoint.cs.meta | 11 + .../asn1/x509/DistributionPointName.cs | 134 + .../asn1/x509/DistributionPointName.cs.meta | 11 + .../asn1/x509/ExtendedKeyUsage.cs | 136 + .../asn1/x509/ExtendedKeyUsage.cs.meta | 11 + .../SecureProtocol/asn1/x509/GeneralName.cs | 423 + .../asn1/x509/GeneralName.cs.meta | 11 + .../SecureProtocol/asn1/x509/GeneralNames.cs | 99 + .../asn1/x509/GeneralNames.cs.meta | 11 + .../asn1/x509/GeneralSubtree.cs | 193 + .../asn1/x509/GeneralSubtree.cs.meta | 11 + .../SecureProtocol/asn1/x509/Holder.cs | 263 + .../SecureProtocol/asn1/x509/Holder.cs.meta | 11 + .../asn1/x509/IetfAttrSyntax.cs | 165 + .../asn1/x509/IetfAttrSyntax.cs.meta | 11 + .../SecureProtocol/asn1/x509/IssuerSerial.cs | 104 + .../asn1/x509/IssuerSerial.cs.meta | 11 + .../asn1/x509/IssuingDistributionPoint.cs | 251 + .../x509/IssuingDistributionPoint.cs.meta | 11 + .../SecureProtocol/asn1/x509/KeyPurposeId.cs | 42 + .../asn1/x509/KeyPurposeId.cs.meta | 11 + .../SecureProtocol/asn1/x509/KeyUsage.cs | 82 + .../SecureProtocol/asn1/x509/KeyUsage.cs.meta | 11 + .../asn1/x509/NameConstraints.cs | 124 + .../asn1/x509/NameConstraints.cs.meta | 11 + .../asn1/x509/NoticeReference.cs | 147 + .../asn1/x509/NoticeReference.cs.meta | 11 + .../asn1/x509/ObjectDigestInfo.cs | 183 + .../asn1/x509/ObjectDigestInfo.cs.meta | 11 + .../asn1/x509/PolicyInformation.cs | 84 + .../asn1/x509/PolicyInformation.cs.meta | 11 + .../asn1/x509/PolicyMappings.cs | 74 + .../asn1/x509/PolicyMappings.cs.meta | 11 + .../asn1/x509/PolicyQualifierId.cs | 32 + .../asn1/x509/PolicyQualifierId.cs.meta | 11 + .../asn1/x509/PolicyQualifierInfo.cs | 99 + .../asn1/x509/PolicyQualifierInfo.cs.meta | 11 + .../asn1/x509/PrivateKeyUsagePeriod.cs | 88 + .../asn1/x509/PrivateKeyUsagePeriod.cs.meta | 11 + .../asn1/x509/RSAPublicKeyStructure.cs | 97 + .../asn1/x509/RSAPublicKeyStructure.cs.meta | 11 + .../SecureProtocol/asn1/x509/ReasonFlags.cs | 49 + .../asn1/x509/ReasonFlags.cs.meta | 11 + .../SecureProtocol/asn1/x509/RoleSyntax.cs | 234 + .../asn1/x509/RoleSyntax.cs.meta | 11 + .../asn1/x509/SubjectDirectoryAttributes.cs | 146 + .../x509/SubjectDirectoryAttributes.cs.meta | 11 + .../asn1/x509/SubjectKeyIdentifier.cs | 146 + .../asn1/x509/SubjectKeyIdentifier.cs.meta | 11 + .../asn1/x509/SubjectPublicKeyInfo.cs | 106 + .../asn1/x509/SubjectPublicKeyInfo.cs.meta | 11 + .../SecureProtocol/asn1/x509/TBSCertList.cs | 279 + .../asn1/x509/TBSCertList.cs.meta | 11 + .../asn1/x509/TBSCertificateStructure.cs | 224 + .../asn1/x509/TBSCertificateStructure.cs.meta | 11 + .../SecureProtocol/asn1/x509/Target.cs | 145 + .../SecureProtocol/asn1/x509/Target.cs.meta | 11 + .../asn1/x509/TargetInformation.cs | 129 + .../asn1/x509/TargetInformation.cs.meta | 11 + .../SecureProtocol/asn1/x509/Targets.cs | 127 + .../SecureProtocol/asn1/x509/Targets.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/x509/Time.cs | 126 + .../SecureProtocol/asn1/x509/Time.cs.meta | 11 + .../SecureProtocol/asn1/x509/UserNotice.cs | 134 + .../asn1/x509/UserNotice.cs.meta | 11 + .../asn1/x509/V1TBSCertificateGenerator.cs | 112 + .../x509/V1TBSCertificateGenerator.cs.meta | 11 + .../V2AttributeCertificateInfoGenerator.cs | 141 + ...2AttributeCertificateInfoGenerator.cs.meta | 11 + .../SecureProtocol/asn1/x509/V2Form.cs | 141 + .../SecureProtocol/asn1/x509/V2Form.cs.meta | 11 + .../asn1/x509/V2TBSCertListGenerator.cs | 205 + .../asn1/x509/V2TBSCertListGenerator.cs.meta | 11 + .../asn1/x509/V3TBSCertificateGenerator.cs | 172 + .../x509/V3TBSCertificateGenerator.cs.meta | 11 + .../asn1/x509/X509Attributes.cs | 13 + .../asn1/x509/X509Attributes.cs.meta | 11 + .../asn1/x509/X509CertificateStructure.cs | 136 + .../x509/X509CertificateStructure.cs.meta | 11 + .../asn1/x509/X509DefaultEntryConverter.cs | 67 + .../x509/X509DefaultEntryConverter.cs.meta | 11 + .../SecureProtocol/asn1/x509/X509Extension.cs | 83 + .../asn1/x509/X509Extension.cs.meta | 11 + .../asn1/x509/X509Extensions.cs | 463 + .../asn1/x509/X509Extensions.cs.meta | 11 + .../asn1/x509/X509ExtensionsGenerator.cs | 85 + .../asn1/x509/X509ExtensionsGenerator.cs.meta | 11 + .../SecureProtocol/asn1/x509/X509Name.cs | 1086 ++ .../SecureProtocol/asn1/x509/X509Name.cs.meta | 11 + .../asn1/x509/X509NameEntryConverter.cs | 93 + .../asn1/x509/X509NameEntryConverter.cs.meta | 11 + .../asn1/x509/X509NameTokenizer.cs | 108 + .../asn1/x509/X509NameTokenizer.cs.meta | 11 + .../asn1/x509/X509ObjectIdentifiers.cs | 65 + .../asn1/x509/X509ObjectIdentifiers.cs.meta | 11 + .../SecureProtocol/asn1/x509/qualified.meta | 8 + .../asn1/x509/qualified/BiometricData.cs | 114 + .../asn1/x509/qualified/BiometricData.cs.meta | 11 + .../x509/qualified/ETSIQCObjectIdentifiers.cs | 23 + .../qualified/ETSIQCObjectIdentifiers.cs.meta | 11 + .../x509/qualified/Iso4217CurrencyCode.cs | 88 + .../qualified/Iso4217CurrencyCode.cs.meta | 11 + .../asn1/x509/qualified/MonetaryValue.cs | 87 + .../asn1/x509/qualified/MonetaryValue.cs.meta | 11 + .../asn1/x509/qualified/QCStatement.cs | 88 + .../asn1/x509/qualified/QCStatement.cs.meta | 11 + .../qualified/RFC3739QCObjectIdentifiers.cs | 25 + .../RFC3739QCObjectIdentifiers.cs.meta | 11 + .../x509/qualified/SemanticsInformation.cs | 128 + .../qualified/SemanticsInformation.cs.meta | 11 + .../x509/qualified/TypeOfBiometricData.cs | 95 + .../qualified/TypeOfBiometricData.cs.meta | 11 + .../SecureProtocol/asn1/x509/sigi.meta | 8 + .../asn1/x509/sigi/NameOrPseudonym.cs | 182 + .../asn1/x509/sigi/NameOrPseudonym.cs.meta | 11 + .../asn1/x509/sigi/PersonalData.cs | 215 + .../asn1/x509/sigi/PersonalData.cs.meta | 11 + .../asn1/x509/sigi/SigIObjectIdentifiers.cs | 53 + .../x509/sigi/SigIObjectIdentifiers.cs.meta | 11 + .../BestHTTP/SecureProtocol/asn1/x9.meta | 8 + .../asn1/x9/DHDomainParameters.cs | 122 + .../asn1/x9/DHDomainParameters.cs.meta | 11 + .../SecureProtocol/asn1/x9/DHPublicKey.cs | 50 + .../asn1/x9/DHPublicKey.cs.meta | 11 + .../asn1/x9/DHValidationParms.cs | 68 + .../asn1/x9/DHValidationParms.cs.meta | 11 + .../asn1/x9/ECNamedCurveTable.cs | 190 + .../asn1/x9/ECNamedCurveTable.cs.meta | 11 + .../SecureProtocol/asn1/x9/KeySpecificInfo.cs | 62 + .../asn1/x9/KeySpecificInfo.cs.meta | 11 + .../SecureProtocol/asn1/x9/OtherInfo.cs | 92 + .../SecureProtocol/asn1/x9/OtherInfo.cs.meta | 11 + .../SecureProtocol/asn1/x9/X962NamedCurves.cs | 755 + .../asn1/x9/X962NamedCurves.cs.meta | 11 + .../SecureProtocol/asn1/x9/X962Parameters.cs | 92 + .../asn1/x9/X962Parameters.cs.meta | 11 + .../SecureProtocol/asn1/x9/X9Curve.cs | 160 + .../SecureProtocol/asn1/x9/X9Curve.cs.meta | 11 + .../SecureProtocol/asn1/x9/X9ECParameters.cs | 234 + .../asn1/x9/X9ECParameters.cs.meta | 11 + .../asn1/x9/X9ECParametersHolder.cs | 29 + .../asn1/x9/X9ECParametersHolder.cs.meta | 11 + .../SecureProtocol/asn1/x9/X9ECPoint.cs | 84 + .../SecureProtocol/asn1/x9/X9ECPoint.cs.meta | 11 + .../SecureProtocol/asn1/x9/X9FieldElement.cs | 75 + .../asn1/x9/X9FieldElement.cs.meta | 11 + .../SecureProtocol/asn1/x9/X9FieldID.cs | 136 + .../SecureProtocol/asn1/x9/X9FieldID.cs.meta | 11 + .../asn1/x9/X9IntegerConverter.cs | 44 + .../asn1/x9/X9IntegerConverter.cs.meta | 11 + .../asn1/x9/X9ObjectIdentifiers.cs | 141 + .../asn1/x9/X9ObjectIdentifiers.cs.meta | 11 + .../BestHTTP/BestHTTP/SecureProtocol/cms.meta | 9 + .../cms/BaseDigestCalculator.cs | 27 + .../cms/BaseDigestCalculator.cs.meta | 11 + .../CMSAttributeTableGenerationException.cs | 32 + ...SAttributeTableGenerationException.cs.meta | 11 + .../cms/CMSAttributeTableGenerator.cs | 29 + .../cms/CMSAttributeTableGenerator.cs.meta | 11 + .../cms/CMSAuthEnvelopedData.cs | 116 + .../cms/CMSAuthEnvelopedData.cs.meta | 11 + .../cms/CMSAuthEnvelopedGenerator.cs | 20 + .../cms/CMSAuthEnvelopedGenerator.cs.meta | 11 + .../cms/CMSAuthenticatedData.cs | 141 + .../cms/CMSAuthenticatedData.cs.meta | 11 + .../cms/CMSAuthenticatedDataGenerator.cs | 160 + .../cms/CMSAuthenticatedDataGenerator.cs.meta | 11 + .../cms/CMSAuthenticatedDataParser.cs | 218 + .../cms/CMSAuthenticatedDataParser.cs.meta | 11 + .../CMSAuthenticatedDataStreamGenerator.cs | 301 + ...MSAuthenticatedDataStreamGenerator.cs.meta | 11 + .../cms/CMSAuthenticatedGenerator.cs | 39 + .../cms/CMSAuthenticatedGenerator.cs.meta | 11 + .../SecureProtocol/cms/CMSCompressedData.cs | 112 + .../cms/CMSCompressedData.cs.meta | 11 + .../cms/CMSCompressedDataGenerator.cs | 71 + .../cms/CMSCompressedDataGenerator.cs.meta | 11 + .../cms/CMSCompressedDataParser.cs | 61 + .../cms/CMSCompressedDataParser.cs.meta | 11 + .../cms/CMSCompressedDataStreamGenerator.cs | 162 + .../CMSCompressedDataStreamGenerator.cs.meta | 11 + .../cms/CMSContentInfoParser.cs | 52 + .../cms/CMSContentInfoParser.cs.meta | 11 + .../SecureProtocol/cms/CMSEnvelopedData.cs | 119 + .../cms/CMSEnvelopedData.cs.meta | 11 + .../cms/CMSEnvelopedDataGenerator.cs | 182 + .../cms/CMSEnvelopedDataGenerator.cs.meta | 11 + .../cms/CMSEnvelopedDataParser.cs | 165 + .../cms/CMSEnvelopedDataParser.cs.meta | 11 + .../cms/CMSEnvelopedDataStreamGenerator.cs | 312 + .../CMSEnvelopedDataStreamGenerator.cs.meta | 11 + .../cms/CMSEnvelopedGenerator.cs | 335 + .../cms/CMSEnvelopedGenerator.cs.meta | 11 + .../SecureProtocol/cms/CMSEnvelopedHelper.cs | 315 + .../cms/CMSEnvelopedHelper.cs.meta | 11 + .../SecureProtocol/cms/CMSException.cs | 32 + .../SecureProtocol/cms/CMSException.cs.meta | 11 + .../BestHTTP/SecureProtocol/cms/CMSPBEKey.cs | 113 + .../SecureProtocol/cms/CMSPBEKey.cs.meta | 11 + .../SecureProtocol/cms/CMSProcessable.cs | 23 + .../SecureProtocol/cms/CMSProcessable.cs.meta | 11 + .../cms/CMSProcessableByteArray.cs | 40 + .../cms/CMSProcessableByteArray.cs.meta | 11 + .../SecureProtocol/cms/CMSProcessableFile.cs | 56 + .../cms/CMSProcessableFile.cs.meta | 11 + .../cms/CMSProcessableInputStream.cs | 57 + .../cms/CMSProcessableInputStream.cs.meta | 11 + .../SecureProtocol/cms/CMSReadable.cs | 14 + .../SecureProtocol/cms/CMSReadable.cs.meta | 11 + .../SecureProtocol/cms/CMSSecureReadable.cs | 18 + .../cms/CMSSecureReadable.cs.meta | 11 + .../SecureProtocol/cms/CMSSignedData.cs | 429 + .../SecureProtocol/cms/CMSSignedData.cs.meta | 11 + .../cms/CMSSignedDataGenerator.cs | 594 + .../cms/CMSSignedDataGenerator.cs.meta | 11 + .../SecureProtocol/cms/CMSSignedDataParser.cs | 454 + .../cms/CMSSignedDataParser.cs.meta | 11 + .../cms/CMSSignedDataStreamGenerator.cs | 937 ++ .../cms/CMSSignedDataStreamGenerator.cs.meta | 11 + .../SecureProtocol/cms/CMSSignedGenerator.cs | 287 + .../cms/CMSSignedGenerator.cs.meta | 11 + .../SecureProtocol/cms/CMSSignedHelper.cs | 430 + .../cms/CMSSignedHelper.cs.meta | 11 + .../SecureProtocol/cms/CMSStreamException.cs | 33 + .../cms/CMSStreamException.cs.meta | 11 + .../SecureProtocol/cms/CMSTypedStream.cs | 76 + .../SecureProtocol/cms/CMSTypedStream.cs.meta | 11 + .../BestHTTP/SecureProtocol/cms/CMSUtils.cs | 190 + .../SecureProtocol/cms/CMSUtils.cs.meta | 11 + .../cms/CounterSignatureDigestCalculator.cs | 32 + .../CounterSignatureDigestCalculator.cs.meta | 11 + ...ultAuthenticatedAttributeTableGenerator.cs | 94 + ...thenticatedAttributeTableGenerator.cs.meta | 11 + .../DefaultSignedAttributeTableGenerator.cs | 128 + ...faultSignedAttributeTableGenerator.cs.meta | 11 + .../SecureProtocol/cms/IDigestCalculator.cs | 13 + .../cms/IDigestCalculator.cs.meta | 11 + .../cms/KEKRecipientInfoGenerator.cs | 142 + .../cms/KEKRecipientInfoGenerator.cs.meta | 11 + .../cms/KEKRecipientInformation.cs | 66 + .../cms/KEKRecipientInformation.cs.meta | 11 + .../cms/KeyAgreeRecipientInfoGenerator.cs | 175 + .../KeyAgreeRecipientInfoGenerator.cs.meta | 11 + .../cms/KeyAgreeRecipientInformation.cs | 230 + .../cms/KeyAgreeRecipientInformation.cs.meta | 11 + .../cms/KeyTransRecipientInfoGenerator.cs | 91 + .../KeyTransRecipientInfoGenerator.cs.meta | 11 + .../cms/KeyTransRecipientInformation.cs | 117 + .../cms/KeyTransRecipientInformation.cs.meta | 11 + .../SecureProtocol/cms/OriginatorId.cs | 55 + .../SecureProtocol/cms/OriginatorId.cs.meta | 11 + .../cms/OriginatorInfoGenerator.cs | 46 + .../cms/OriginatorInfoGenerator.cs.meta | 11 + .../cms/OriginatorInformation.cs | 100 + .../cms/OriginatorInformation.cs.meta | 11 + .../SecureProtocol/cms/PKCS5Scheme2PBEKey.cs | 68 + .../cms/PKCS5Scheme2PBEKey.cs.meta | 11 + .../cms/PKCS5Scheme2UTF8PBEKey.cs | 68 + .../cms/PKCS5Scheme2UTF8PBEKey.cs.meta | 11 + .../cms/PasswordRecipientInfoGenerator.cs | 74 + .../PasswordRecipientInfoGenerator.cs.meta | 11 + .../cms/PasswordRecipientInformation.cs | 83 + .../cms/PasswordRecipientInformation.cs.meta | 11 + .../SecureProtocol/cms/RecipientId.cs | 62 + .../SecureProtocol/cms/RecipientId.cs.meta | 11 + .../cms/RecipientInfoGenerator.cs | 30 + .../cms/RecipientInfoGenerator.cs.meta | 11 + .../cms/RecipientInformation.cs | 130 + .../cms/RecipientInformation.cs.meta | 11 + .../cms/RecipientInformationStore.cs | 90 + .../cms/RecipientInformationStore.cs.meta | 11 + .../BestHTTP/SecureProtocol/cms/SignerId.cs | 55 + .../SecureProtocol/cms/SignerId.cs.meta | 11 + .../SecureProtocol/cms/SignerInfoGenerator.cs | 170 + .../cms/SignerInfoGenerator.cs.meta | 11 + .../SecureProtocol/cms/SignerInformation.cs | 797 ++ .../cms/SignerInformation.cs.meta | 11 + .../cms/SignerInformationStore.cs | 99 + .../cms/SignerInformationStore.cs.meta | 11 + .../cms/SimpleAttributeTableGenerator.cs | 32 + .../cms/SimpleAttributeTableGenerator.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto.meta | 7 + .../crypto/AsymmetricCipherKeyPair.cs | 56 + .../crypto/AsymmetricCipherKeyPair.cs.meta | 11 + .../crypto/AsymmetricKeyParameter.cs | 51 + .../crypto/AsymmetricKeyParameter.cs.meta | 11 + .../crypto/BufferedAeadBlockCipher.cs | 251 + .../crypto/BufferedAeadBlockCipher.cs.meta | 11 + .../crypto/BufferedAsymmetricBlockCipher.cs | 156 + .../BufferedAsymmetricBlockCipher.cs.meta | 11 + .../crypto/BufferedBlockCipher.cs | 371 + .../crypto/BufferedBlockCipher.cs.meta | 11 + .../crypto/BufferedCipherBase.cs | 117 + .../crypto/BufferedCipherBase.cs.meta | 11 + .../crypto/BufferedIesCipher.cs | 117 + .../crypto/BufferedIesCipher.cs.meta | 11 + .../crypto/BufferedStreamCipher.cs | 135 + .../crypto/BufferedStreamCipher.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/Check.cs | 29 + .../SecureProtocol/crypto/Check.cs.meta | 11 + .../crypto/CipherKeyGenerator.cs | 87 + .../crypto/CipherKeyGenerator.cs.meta | 11 + .../SecureProtocol/crypto/CryptoException.cs | 32 + .../crypto/CryptoException.cs.meta | 11 + .../crypto/DataLengthException.cs | 46 + .../crypto/DataLengthException.cs.meta | 11 + .../crypto/IAsymmetricBlockCipher.cs | 34 + .../crypto/IAsymmetricBlockCipher.cs.meta | 11 + .../IAsymmetricCipherKeyPairGenerator.cs | 28 + .../IAsymmetricCipherKeyPairGenerator.cs.meta | 11 + .../SecureProtocol/crypto/IBasicAgreement.cs | 33 + .../crypto/IBasicAgreement.cs.meta | 11 + .../SecureProtocol/crypto/IBlockCipher.cs | 40 + .../crypto/IBlockCipher.cs.meta | 11 + .../SecureProtocol/crypto/IBlockResult.cs | 28 + .../crypto/IBlockResult.cs.meta | 11 + .../SecureProtocol/crypto/IBufferedCipher.cs | 48 + .../crypto/IBufferedCipher.cs.meta | 11 + .../crypto/ICipherParameters.cs | 15 + .../crypto/ICipherParameters.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/IDSA.cs | 45 + .../SecureProtocol/crypto/IDSA.cs.meta | 11 + .../crypto/IDerivationFunction.cs | 28 + .../crypto/IDerivationFunction.cs.meta | 11 + .../crypto/IDerivationParameters.cs | 15 + .../crypto/IDerivationParameters.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/IDigest.cs | 65 + .../SecureProtocol/crypto/IDigest.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/IDsaExt.cs | 21 + .../SecureProtocol/crypto/IDsaExt.cs.meta | 11 + .../SecureProtocol/crypto/IEntropySource.cs | 33 + .../crypto/IEntropySource.cs.meta | 11 + .../crypto/IEntropySourceProvider.cs | 21 + .../crypto/IEntropySourceProvider.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/IMac.cs | 73 + .../SecureProtocol/crypto/IMac.cs.meta | 11 + .../SecureProtocol/crypto/IRawAgreement.cs | 17 + .../crypto/IRawAgreement.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/IRsa.cs | 20 + .../SecureProtocol/crypto/IRsa.cs.meta | 11 + .../crypto/ISignatureFactory.cs | 27 + .../crypto/ISignatureFactory.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/ISigner.cs | 54 + .../SecureProtocol/crypto/ISigner.cs.meta | 11 + .../crypto/ISignerWithRecovery.cs | 41 + .../crypto/ISignerWithRecovery.cs.meta | 11 + .../crypto/IStreamCalculator.cs | 27 + .../crypto/IStreamCalculator.cs.meta | 11 + .../SecureProtocol/crypto/IStreamCipher.cs | 49 + .../crypto/IStreamCipher.cs.meta | 11 + .../SecureProtocol/crypto/IVerifier.cs | 29 + .../SecureProtocol/crypto/IVerifier.cs.meta | 11 + .../SecureProtocol/crypto/IVerifierFactory.cs | 25 + .../crypto/IVerifierFactory.cs.meta | 11 + .../crypto/IVerifierFactoryProvider.cs | 22 + .../crypto/IVerifierFactoryProvider.cs.meta | 11 + .../SecureProtocol/crypto/IWrapper.cs | 22 + .../SecureProtocol/crypto/IWrapper.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/IXof.cs | 35 + .../SecureProtocol/crypto/IXof.cs.meta | 11 + .../crypto/InvalidCipherTextException.cs | 44 + .../crypto/InvalidCipherTextException.cs.meta | 11 + .../crypto/KeyGenerationParameters.cs | 59 + .../crypto/KeyGenerationParameters.cs.meta | 11 + .../crypto/MaxBytesExceededException.cs | 36 + .../crypto/MaxBytesExceededException.cs.meta | 11 + .../crypto/OutputLengthException.cs | 32 + .../crypto/OutputLengthException.cs.meta | 11 + .../crypto/PbeParametersGenerator.cs | 206 + .../crypto/PbeParametersGenerator.cs.meta | 11 + .../crypto/StreamBlockCipher.cs | 113 + .../crypto/StreamBlockCipher.cs.meta | 11 + .../SecureProtocol/crypto/agreement.meta | 8 + .../crypto/agreement/DHAgreement.cs | 103 + .../crypto/agreement/DHAgreement.cs.meta | 11 + .../crypto/agreement/DHBasicAgreement.cs | 76 + .../crypto/agreement/DHBasicAgreement.cs.meta | 11 + .../crypto/agreement/DHStandardGroups.cs | 311 + .../crypto/agreement/DHStandardGroups.cs.meta | 11 + .../crypto/agreement/ECDHBasicAgreement.cs | 78 + .../agreement/ECDHBasicAgreement.cs.meta | 11 + .../crypto/agreement/ECDHCBasicAgreement.cs | 76 + .../agreement/ECDHCBasicAgreement.cs.meta | 11 + .../agreement/ECDHWithKdfBasicAgreement.cs | 67 + .../ECDHWithKdfBasicAgreement.cs.meta | 11 + .../crypto/agreement/ECMqvBasicAgreement.cs | 90 + .../agreement/ECMqvBasicAgreement.cs.meta | 11 + .../agreement/ECMqvWithKdfBasicAgreement.cs | 67 + .../ECMqvWithKdfBasicAgreement.cs.meta | 11 + .../crypto/agreement/SM2KeyExchange.cs | 278 + .../crypto/agreement/SM2KeyExchange.cs.meta | 11 + .../crypto/agreement/X25519Agreement.cs | 31 + .../crypto/agreement/X25519Agreement.cs.meta | 11 + .../crypto/agreement/X448Agreement.cs | 31 + .../crypto/agreement/X448Agreement.cs.meta | 11 + .../crypto/agreement/jpake.meta | 8 + .../agreement/jpake/JPakeParticipant.cs | 460 + .../agreement/jpake/JPakeParticipant.cs.meta | 11 + .../agreement/jpake/JPakePrimeOrderGroup.cs | 107 + .../jpake/JPakePrimeOrderGroup.cs.meta | 11 + .../agreement/jpake/JPakePrimeOrderGroups.cs | 112 + .../jpake/JPakePrimeOrderGroups.cs.meta | 11 + .../agreement/jpake/JPakeRound1Payload.cs | 105 + .../jpake/JPakeRound1Payload.cs.meta | 11 + .../agreement/jpake/JPakeRound2Payload.cs | 76 + .../jpake/JPakeRound2Payload.cs.meta | 11 + .../agreement/jpake/JPakeRound3Payload.cs | 55 + .../jpake/JPakeRound3Payload.cs.meta | 11 + .../crypto/agreement/jpake/JPakeUtilities.cs | 394 + .../agreement/jpake/JPakeUtilities.cs.meta | 11 + .../SecureProtocol/crypto/agreement/kdf.meta | 8 + .../kdf/ConcatenationKdfGenerator.cs | 104 + .../kdf/ConcatenationKdfGenerator.cs.meta | 11 + .../crypto/agreement/kdf/DHKdfParameters.cs | 61 + .../agreement/kdf/DHKdfParameters.cs.meta | 11 + .../crypto/agreement/kdf/DHKekGenerator.cs | 116 + .../agreement/kdf/DHKekGenerator.cs.meta | 11 + .../crypto/agreement/kdf/ECDHKekGenerator.cs | 59 + .../agreement/kdf/ECDHKekGenerator.cs.meta | 11 + .../SecureProtocol/crypto/agreement/srp.meta | 8 + .../crypto/agreement/srp/SRP6Client.cs | 168 + .../crypto/agreement/srp/SRP6Client.cs.meta | 11 + .../crypto/agreement/srp/SRP6Server.cs | 167 + .../crypto/agreement/srp/SRP6Server.cs.meta | 11 + .../agreement/srp/SRP6StandardGroups.cs | 163 + .../agreement/srp/SRP6StandardGroups.cs.meta | 11 + .../crypto/agreement/srp/SRP6Utilities.cs | 157 + .../agreement/srp/SRP6Utilities.cs.meta | 11 + .../agreement/srp/SRP6VerifierGenerator.cs | 59 + .../srp/SRP6VerifierGenerator.cs.meta | 11 + .../SecureProtocol/crypto/digests.meta | 8 + .../crypto/digests/Blake2bDigest.cs | 535 + .../crypto/digests/Blake2bDigest.cs.meta | 11 + .../crypto/digests/Blake2sDigest.cs | 555 + .../crypto/digests/Blake2sDigest.cs.meta | 11 + .../crypto/digests/DSTU7564Digest.cs | 534 + .../crypto/digests/DSTU7564Digest.cs.meta | 11 + .../crypto/digests/GOST3411Digest.cs | 360 + .../crypto/digests/GOST3411Digest.cs.meta | 11 + .../crypto/digests/GOST3411_2012Digest.cs | 1040 ++ .../digests/GOST3411_2012Digest.cs.meta | 11 + .../crypto/digests/GOST3411_2012_256Digest.cs | 58 + .../digests/GOST3411_2012_256Digest.cs.meta | 11 + .../crypto/digests/GOST3411_2012_512Digest.cs | 47 + .../digests/GOST3411_2012_512Digest.cs.meta | 11 + .../crypto/digests/GeneralDigest.cs | 137 + .../crypto/digests/GeneralDigest.cs.meta | 11 + .../crypto/digests/KeccakDigest.cs | 409 + .../crypto/digests/KeccakDigest.cs.meta | 11 + .../crypto/digests/LongDigest.cs | 359 + .../crypto/digests/LongDigest.cs.meta | 11 + .../crypto/digests/MD2Digest.cs | 273 + .../crypto/digests/MD2Digest.cs.meta | 11 + .../crypto/digests/MD4Digest.cs | 296 + .../crypto/digests/MD4Digest.cs.meta | 11 + .../crypto/digests/MD5Digest.cs | 317 + .../crypto/digests/MD5Digest.cs.meta | 11 + .../crypto/digests/NonMemoableDigest.cs | 66 + .../crypto/digests/NonMemoableDigest.cs.meta | 11 + .../crypto/digests/NullDigest.cs | 59 + .../crypto/digests/NullDigest.cs.meta | 11 + .../crypto/digests/RipeMD128Digest.cs | 488 + .../crypto/digests/RipeMD128Digest.cs.meta | 11 + .../crypto/digests/RipeMD160Digest.cs | 449 + .../crypto/digests/RipeMD160Digest.cs.meta | 11 + .../crypto/digests/RipeMD256Digest.cs | 434 + .../crypto/digests/RipeMD256Digest.cs.meta | 11 + .../crypto/digests/RipeMD320Digest.cs | 463 + .../crypto/digests/RipeMD320Digest.cs.meta | 11 + .../crypto/digests/SHA3Digest.cs | 89 + .../crypto/digests/SHA3Digest.cs.meta | 11 + .../crypto/digests/SM3Digest.cs | 324 + .../crypto/digests/SM3Digest.cs.meta | 11 + .../crypto/digests/Sha1Digest.cs | 288 + .../crypto/digests/Sha1Digest.cs.meta | 11 + .../crypto/digests/Sha224Digest.cs | 293 + .../crypto/digests/Sha224Digest.cs.meta | 11 + .../crypto/digests/Sha256Digest.cs | 334 + .../crypto/digests/Sha256Digest.cs.meta | 11 + .../crypto/digests/Sha384Digest.cs | 105 + .../crypto/digests/Sha384Digest.cs.meta | 11 + .../crypto/digests/Sha512Digest.cs | 108 + .../crypto/digests/Sha512Digest.cs.meta | 11 + .../crypto/digests/Sha512tDigest.cs | 204 + .../crypto/digests/Sha512tDigest.cs.meta | 11 + .../crypto/digests/ShakeDigest.cs | 123 + .../crypto/digests/ShakeDigest.cs.meta | 11 + .../crypto/digests/ShortenedDigest.cs | 86 + .../crypto/digests/ShortenedDigest.cs.meta | 11 + .../crypto/digests/SkeinDigest.cs | 121 + .../crypto/digests/SkeinDigest.cs.meta | 11 + .../crypto/digests/SkeinEngine.cs | 808 ++ .../crypto/digests/SkeinEngine.cs.meta | 11 + .../crypto/digests/TigerDigest.cs | 887 ++ .../crypto/digests/TigerDigest.cs.meta | 11 + .../crypto/digests/WhirlpoolDigest.cs | 417 + .../crypto/digests/WhirlpoolDigest.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/ec.meta | 8 + .../crypto/ec/CustomNamedCurves.cs | 917 ++ .../crypto/ec/CustomNamedCurves.cs.meta | 11 + .../SecureProtocol/crypto/encodings.meta | 8 + .../crypto/encodings/ISO9796d1Encoding.cs | 277 + .../encodings/ISO9796d1Encoding.cs.meta | 11 + .../crypto/encodings/OaepEncoding.cs | 356 + .../crypto/encodings/OaepEncoding.cs.meta | 11 + .../crypto/encodings/Pkcs1Encoding.cs | 388 + .../crypto/encodings/Pkcs1Encoding.cs.meta | 11 + .../SecureProtocol/crypto/engines.meta | 8 + .../crypto/engines/AesEngine.cs | 614 + .../crypto/engines/AesEngine.cs.meta | 11 + .../crypto/engines/AesFastEngine.cs | 952 ++ .../crypto/engines/AesFastEngine.cs.meta | 11 + .../crypto/engines/AesLightEngine.cs | 508 + .../crypto/engines/AesLightEngine.cs.meta | 11 + .../crypto/engines/AesWrapEngine.cs | 20 + .../crypto/engines/AesWrapEngine.cs.meta | 11 + .../crypto/engines/BlowfishEngine.cs | 557 + .../crypto/engines/BlowfishEngine.cs.meta | 11 + .../crypto/engines/CamelliaEngine.cs | 672 + .../crypto/engines/CamelliaEngine.cs.meta | 11 + .../crypto/engines/CamelliaLightEngine.cs | 584 + .../engines/CamelliaLightEngine.cs.meta | 11 + .../crypto/engines/CamelliaWrapEngine.cs | 20 + .../crypto/engines/CamelliaWrapEngine.cs.meta | 11 + .../crypto/engines/Cast5Engine.cs | 806 ++ .../crypto/engines/Cast5Engine.cs.meta | 11 + .../crypto/engines/Cast6Engine.cs | 283 + .../crypto/engines/Cast6Engine.cs.meta | 11 + .../crypto/engines/ChaCha7539Engine.cs | 69 + .../crypto/engines/ChaCha7539Engine.cs.meta | 11 + .../crypto/engines/ChaChaEngine.cs | 161 + .../crypto/engines/ChaChaEngine.cs.meta | 11 + .../crypto/engines/DesEdeEngine.cs | 104 + .../crypto/engines/DesEdeEngine.cs.meta | 11 + .../crypto/engines/DesEdeWrapEngine.cs | 326 + .../crypto/engines/DesEdeWrapEngine.cs.meta | 11 + .../crypto/engines/DesEngine.cs | 479 + .../crypto/engines/DesEngine.cs.meta | 11 + .../crypto/engines/Dstu7624Engine.cs | 1088 ++ .../crypto/engines/Dstu7624Engine.cs.meta | 11 + .../crypto/engines/Dstu7624WrapEngine.cs | 220 + .../crypto/engines/Dstu7624WrapEngine.cs.meta | 11 + .../crypto/engines/ElGamalEngine.cs | 182 + .../crypto/engines/ElGamalEngine.cs.meta | 11 + .../crypto/engines/GOST28147Engine.cs | 386 + .../crypto/engines/GOST28147Engine.cs.meta | 11 + .../crypto/engines/HC128Engine.cs | 239 + .../crypto/engines/HC128Engine.cs.meta | 11 + .../crypto/engines/HC256Engine.cs | 228 + .../crypto/engines/HC256Engine.cs.meta | 11 + .../crypto/engines/ISAACEngine.cs | 216 + .../crypto/engines/ISAACEngine.cs.meta | 11 + .../crypto/engines/IdeaEngine.cs | 326 + .../crypto/engines/IdeaEngine.cs.meta | 11 + .../crypto/engines/IesEngine.cs | 247 + .../crypto/engines/IesEngine.cs.meta | 11 + .../crypto/engines/NaccacheSternEngine.cs | 362 + .../engines/NaccacheSternEngine.cs.meta | 11 + .../crypto/engines/NoekeonEngine.cs | 245 + .../crypto/engines/NoekeonEngine.cs.meta | 11 + .../crypto/engines/NullEngine.cs | 73 + .../crypto/engines/NullEngine.cs.meta | 11 + .../crypto/engines/RC2Engine.cs | 315 + .../crypto/engines/RC2Engine.cs.meta | 11 + .../crypto/engines/RC2WrapEngine.cs | 374 + .../crypto/engines/RC2WrapEngine.cs.meta | 11 + .../crypto/engines/RC4Engine.cs | 143 + .../crypto/engines/RC4Engine.cs.meta | 11 + .../crypto/engines/RC532Engine.cs | 301 + .../crypto/engines/RC532Engine.cs.meta | 11 + .../crypto/engines/RC564Engine.cs | 302 + .../crypto/engines/RC564Engine.cs.meta | 11 + .../crypto/engines/RC6Engine.cs | 365 + .../crypto/engines/RC6Engine.cs.meta | 11 + .../crypto/engines/RFC3211WrapEngine.cs | 183 + .../crypto/engines/RFC3211WrapEngine.cs.meta | 11 + .../crypto/engines/RFC3394WrapEngine.cs | 182 + .../crypto/engines/RFC3394WrapEngine.cs.meta | 11 + .../crypto/engines/RSABlindedEngine.cs | 143 + .../crypto/engines/RSABlindedEngine.cs.meta | 11 + .../crypto/engines/RSABlindingEngine.cs | 153 + .../crypto/engines/RSABlindingEngine.cs.meta | 11 + .../crypto/engines/RSACoreEngine.cs | 177 + .../crypto/engines/RSACoreEngine.cs.meta | 11 + .../crypto/engines/RijndaelEngine.cs | 745 + .../crypto/engines/RijndaelEngine.cs.meta | 11 + .../crypto/engines/RsaEngine.cs | 90 + .../crypto/engines/RsaEngine.cs.meta | 11 + .../crypto/engines/SEEDEngine.cs | 364 + .../crypto/engines/SEEDEngine.cs.meta | 11 + .../crypto/engines/SEEDWrapEngine.cs | 20 + .../crypto/engines/SEEDWrapEngine.cs.meta | 11 + .../crypto/engines/SM2Engine.cs | 242 + .../crypto/engines/SM2Engine.cs.meta | 11 + .../crypto/engines/SM4Engine.cs | 193 + .../crypto/engines/SM4Engine.cs.meta | 11 + .../crypto/engines/Salsa20Engine.cs | 366 + .../crypto/engines/Salsa20Engine.cs.meta | 11 + .../crypto/engines/SerpentEngine.cs | 296 + .../crypto/engines/SerpentEngine.cs.meta | 11 + .../crypto/engines/SerpentEngineBase.cs | 473 + .../crypto/engines/SerpentEngineBase.cs.meta | 11 + .../crypto/engines/SkipjackEngine.cs | 258 + .../crypto/engines/SkipjackEngine.cs.meta | 11 + .../crypto/engines/TEAEngine.cs | 170 + .../crypto/engines/TEAEngine.cs.meta | 11 + .../crypto/engines/ThreefishEngine.cs | 1495 ++ .../crypto/engines/ThreefishEngine.cs.meta | 11 + .../crypto/engines/TnepresEngine.cs | 303 + .../crypto/engines/TnepresEngine.cs.meta | 11 + .../crypto/engines/TwofishEngine.cs | 679 + .../crypto/engines/TwofishEngine.cs.meta | 11 + .../crypto/engines/VMPCEngine.cs | 137 + .../crypto/engines/VMPCEngine.cs.meta | 11 + .../crypto/engines/VMPCKSA3Engine.cs | 55 + .../crypto/engines/VMPCKSA3Engine.cs.meta | 11 + .../crypto/engines/XSalsa20Engine.cs | 68 + .../crypto/engines/XSalsa20Engine.cs.meta | 11 + .../crypto/engines/XTEAEngine.cs | 170 + .../crypto/engines/XTEAEngine.cs.meta | 11 + .../SecureProtocol/crypto/generators.meta | 8 + .../crypto/generators/BCrypt.cs | 632 + .../crypto/generators/BCrypt.cs.meta | 11 + .../generators/BaseKdfBytesGenerator.cs | 136 + .../generators/BaseKdfBytesGenerator.cs.meta | 11 + .../generators/DHBasicKeyPairGenerator.cs | 42 + .../DHBasicKeyPairGenerator.cs.meta | 11 + .../crypto/generators/DHKeyGeneratorHelper.cs | 76 + .../generators/DHKeyGeneratorHelper.cs.meta | 11 + .../crypto/generators/DHKeyPairGenerator.cs | 42 + .../generators/DHKeyPairGenerator.cs.meta | 11 + .../generators/DHParametersGenerator.cs | 49 + .../generators/DHParametersGenerator.cs.meta | 11 + .../crypto/generators/DHParametersHelper.cs | 160 + .../generators/DHParametersHelper.cs.meta | 11 + .../crypto/generators/DesEdeKeyGenerator.cs | 71 + .../generators/DesEdeKeyGenerator.cs.meta | 11 + .../crypto/generators/DesKeyGenerator.cs | 61 + .../crypto/generators/DesKeyGenerator.cs.meta | 11 + .../crypto/generators/DsaKeyPairGenerator.cs | 76 + .../generators/DsaKeyPairGenerator.cs.meta | 11 + .../generators/DsaParametersGenerator.cs | 359 + .../generators/DsaParametersGenerator.cs.meta | 11 + .../crypto/generators/ECKeyPairGenerator.cs | 166 + .../generators/ECKeyPairGenerator.cs.meta | 11 + .../generators/Ed25519KeyPairGenerator.cs | 29 + .../Ed25519KeyPairGenerator.cs.meta | 11 + .../generators/Ed448KeyPairGenerator.cs | 29 + .../generators/Ed448KeyPairGenerator.cs.meta | 11 + .../generators/ElGamalKeyPairGenerator.cs | 44 + .../ElGamalKeyPairGenerator.cs.meta | 11 + .../generators/ElGamalParametersGenerator.cs | 50 + .../ElGamalParametersGenerator.cs.meta | 11 + .../generators/GOST3410KeyPairGenerator.cs | 86 + .../GOST3410KeyPairGenerator.cs.meta | 11 + .../generators/GOST3410ParametersGenerator.cs | 534 + .../GOST3410ParametersGenerator.cs.meta | 11 + .../crypto/generators/HKDFBytesGenerator.cs | 156 + .../generators/HKDFBytesGenerator.cs.meta | 11 + .../crypto/generators/Kdf1BytesGenerator.cs | 30 + .../generators/Kdf1BytesGenerator.cs.meta | 11 + .../crypto/generators/Kdf2BytesGenerator.cs | 31 + .../generators/Kdf2BytesGenerator.cs.meta | 11 + .../crypto/generators/Mgf1BytesGenerator.cs | 124 + .../generators/Mgf1BytesGenerator.cs.meta | 11 + .../NaccacheSternKeyPairGenerator.cs | 272 + .../NaccacheSternKeyPairGenerator.cs.meta | 11 + .../crypto/generators/OpenBsdBCrypt.cs | 309 + .../crypto/generators/OpenBsdBCrypt.cs.meta | 11 + .../OpenSSLPBEParametersGenerator.cs | 171 + .../OpenSSLPBEParametersGenerator.cs.meta | 11 + .../generators/Pkcs12ParametersGenerator.cs | 247 + .../Pkcs12ParametersGenerator.cs.meta | 11 + .../generators/Pkcs5S1ParametersGenerator.cs | 164 + .../Pkcs5S1ParametersGenerator.cs.meta | 11 + .../generators/Pkcs5S2ParametersGenerator.cs | 182 + .../Pkcs5S2ParametersGenerator.cs.meta | 11 + .../crypto/generators/Poly1305KeyGenerator.cs | 120 + .../generators/Poly1305KeyGenerator.cs.meta | 11 + .../generators/RSABlindingFactorGenerator.cs | 73 + .../RSABlindingFactorGenerator.cs.meta | 11 + .../crypto/generators/RsaKeyPairGenerator.cs | 167 + .../generators/RsaKeyPairGenerator.cs.meta | 11 + .../crypto/generators/SCrypt.cs | 186 + .../crypto/generators/SCrypt.cs.meta | 11 + .../generators/X25519KeyPairGenerator.cs | 29 + .../generators/X25519KeyPairGenerator.cs.meta | 11 + .../crypto/generators/X448KeyPairGenerator.cs | 29 + .../generators/X448KeyPairGenerator.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/io.meta | 8 + .../SecureProtocol/crypto/io/CipherStream.cs | 256 + .../crypto/io/CipherStream.cs.meta | 11 + .../SecureProtocol/crypto/io/DigestSink.cs | 39 + .../crypto/io/DigestSink.cs.meta | 11 + .../SecureProtocol/crypto/io/DigestStream.cs | 155 + .../crypto/io/DigestStream.cs.meta | 11 + .../SecureProtocol/crypto/io/MacSink.cs | 39 + .../SecureProtocol/crypto/io/MacSink.cs.meta | 11 + .../SecureProtocol/crypto/io/MacStream.cs | 154 + .../crypto/io/MacStream.cs.meta | 11 + .../SecureProtocol/crypto/io/SignerSink.cs | 39 + .../crypto/io/SignerSink.cs.meta | 11 + .../SecureProtocol/crypto/io/SignerStream.cs | 155 + .../crypto/io/SignerStream.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/macs.meta | 8 + .../SecureProtocol/crypto/macs/CMac.cs | 261 + .../SecureProtocol/crypto/macs/CMac.cs.meta | 11 + .../crypto/macs/CbcBlockCipherMac.cs | 213 + .../crypto/macs/CbcBlockCipherMac.cs.meta | 11 + .../crypto/macs/CfbBlockCipherMac.cs | 372 + .../crypto/macs/CfbBlockCipherMac.cs.meta | 11 + .../SecureProtocol/crypto/macs/DSTU7564Mac.cs | 147 + .../crypto/macs/DSTU7564Mac.cs.meta | 11 + .../SecureProtocol/crypto/macs/DSTU7624Mac.cs | 164 + .../crypto/macs/DSTU7624Mac.cs.meta | 11 + .../SecureProtocol/crypto/macs/GMac.cs | 116 + .../SecureProtocol/crypto/macs/GMac.cs.meta | 11 + .../crypto/macs/GOST28147Mac.cs | 319 + .../crypto/macs/GOST28147Mac.cs.meta | 11 + .../SecureProtocol/crypto/macs/HMac.cs | 158 + .../SecureProtocol/crypto/macs/HMac.cs.meta | 11 + .../crypto/macs/ISO9797Alg3Mac.cs | 279 + .../crypto/macs/ISO9797Alg3Mac.cs.meta | 11 + .../SecureProtocol/crypto/macs/Poly1305.cs | 297 + .../crypto/macs/Poly1305.cs.meta | 11 + .../SecureProtocol/crypto/macs/SipHash.cs | 203 + .../crypto/macs/SipHash.cs.meta | 11 + .../SecureProtocol/crypto/macs/SkeinMac.cs | 122 + .../crypto/macs/SkeinMac.cs.meta | 11 + .../SecureProtocol/crypto/macs/VMPCMac.cs | 177 + .../crypto/macs/VMPCMac.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/modes.meta | 8 + .../crypto/modes/CbcBlockCipher.cs | 245 + .../crypto/modes/CbcBlockCipher.cs.meta | 11 + .../crypto/modes/CcmBlockCipher.cs | 451 + .../crypto/modes/CcmBlockCipher.cs.meta | 11 + .../crypto/modes/CfbBlockCipher.cs | 228 + .../crypto/modes/CfbBlockCipher.cs.meta | 11 + .../crypto/modes/CtsBlockCipher.cs | 257 + .../crypto/modes/CtsBlockCipher.cs.meta | 11 + .../crypto/modes/EAXBlockCipher.cs | 383 + .../crypto/modes/EAXBlockCipher.cs.meta | 11 + .../crypto/modes/GCMBlockCipher.cs | 651 + .../crypto/modes/GCMBlockCipher.cs.meta | 11 + .../crypto/modes/GOFBBlockCipher.cs | 238 + .../crypto/modes/GOFBBlockCipher.cs.meta | 11 + .../crypto/modes/IAeadBlockCipher.cs | 109 + .../crypto/modes/IAeadBlockCipher.cs.meta | 11 + .../crypto/modes/KCcmBlockCipher.cs | 494 + .../crypto/modes/KCcmBlockCipher.cs.meta | 11 + .../crypto/modes/KCtrBlockCipher.cs | 239 + .../crypto/modes/KCtrBlockCipher.cs.meta | 11 + .../crypto/modes/OCBBlockCipher.cs | 569 + .../crypto/modes/OCBBlockCipher.cs.meta | 11 + .../crypto/modes/OfbBlockCipher.cs | 186 + .../crypto/modes/OfbBlockCipher.cs.meta | 11 + .../crypto/modes/OpenPgpCfbBlockCipher.cs | 341 + .../modes/OpenPgpCfbBlockCipher.cs.meta | 11 + .../crypto/modes/SicBlockCipher.cs | 124 + .../crypto/modes/SicBlockCipher.cs.meta | 11 + .../SecureProtocol/crypto/modes/gcm.meta | 8 + .../crypto/modes/gcm/BasicGcmExponentiator.cs | 44 + .../modes/gcm/BasicGcmExponentiator.cs.meta | 11 + .../crypto/modes/gcm/BasicGcmMultiplier.cs | 26 + .../modes/gcm/BasicGcmMultiplier.cs.meta | 11 + .../crypto/modes/gcm/GcmUtilities.cs | 357 + .../crypto/modes/gcm/GcmUtilities.cs.meta | 11 + .../crypto/modes/gcm/IGcmExponentiator.cs | 14 + .../modes/gcm/IGcmExponentiator.cs.meta | 11 + .../crypto/modes/gcm/IGcmMultiplier.cs | 14 + .../crypto/modes/gcm/IGcmMultiplier.cs.meta | 11 + .../modes/gcm/Tables1kGcmExponentiator.cs | 63 + .../gcm/Tables1kGcmExponentiator.cs.meta | 11 + .../modes/gcm/Tables64kGcmMultiplier.cs | 81 + .../modes/gcm/Tables64kGcmMultiplier.cs.meta | 11 + .../crypto/modes/gcm/Tables8kGcmMultiplier.cs | 108 + .../modes/gcm/Tables8kGcmMultiplier.cs.meta | 11 + .../SecureProtocol/crypto/operators.meta | 8 + .../crypto/operators/Asn1Signature.cs | 388 + .../crypto/operators/Asn1Signature.cs.meta | 11 + .../operators/DefaultSignatureCalculator.cs | 32 + .../DefaultSignatureCalculator.cs.meta | 11 + .../operators/DefaultSignatureResult.cs | 31 + .../operators/DefaultSignatureResult.cs.meta | 11 + .../operators/DefaultVerifierCalculator.cs | 32 + .../DefaultVerifierCalculator.cs.meta | 11 + .../crypto/operators/DefaultVerifierResult.cs | 33 + .../operators/DefaultVerifierResult.cs.meta | 11 + .../SecureProtocol/crypto/paddings.meta | 8 + .../crypto/paddings/BlockCipherPadding.cs | 47 + .../paddings/BlockCipherPadding.cs.meta | 11 + .../crypto/paddings/ISO10126d2Padding.cs | 80 + .../crypto/paddings/ISO10126d2Padding.cs.meta | 11 + .../crypto/paddings/ISO7816d4Padding.cs | 83 + .../crypto/paddings/ISO7816d4Padding.cs.meta | 11 + .../paddings/PaddedBufferedBlockCipher.cs | 289 + .../PaddedBufferedBlockCipher.cs.meta | 11 + .../crypto/paddings/Pkcs7Padding.cs | 80 + .../crypto/paddings/Pkcs7Padding.cs.meta | 11 + .../crypto/paddings/TbcPadding.cs | 83 + .../crypto/paddings/TbcPadding.cs.meta | 11 + .../crypto/paddings/X923Padding.cs | 86 + .../crypto/paddings/X923Padding.cs.meta | 11 + .../crypto/paddings/ZeroBytePadding.cs | 72 + .../crypto/paddings/ZeroBytePadding.cs.meta | 11 + .../SecureProtocol/crypto/parameters.meta | 8 + .../crypto/parameters/AEADParameters.cs | 69 + .../crypto/parameters/AEADParameters.cs.meta | 11 + .../crypto/parameters/CcmParameters.cs | 30 + .../crypto/parameters/CcmParameters.cs.meta | 11 + .../parameters/DHKeyGenerationParameters.cs | 35 + .../DHKeyGenerationParameters.cs.meta | 11 + .../crypto/parameters/DHKeyParameters.cs | 80 + .../crypto/parameters/DHKeyParameters.cs.meta | 11 + .../crypto/parameters/DHParameters.cs | 189 + .../crypto/parameters/DHParameters.cs.meta | 11 + .../parameters/DHPrivateKeyParameters.cs | 64 + .../parameters/DHPrivateKeyParameters.cs.meta | 11 + .../parameters/DHPublicKeyParameters.cs | 83 + .../parameters/DHPublicKeyParameters.cs.meta | 11 + .../parameters/DHValidationParameters.cs | 63 + .../parameters/DHValidationParameters.cs.meta | 11 + .../DSAParameterGenerationParameters.cs | 78 + .../DSAParameterGenerationParameters.cs.meta | 11 + .../crypto/parameters/DesEdeParameters.cs | 144 + .../parameters/DesEdeParameters.cs.meta | 11 + .../crypto/parameters/DesParameters.cs | 143 + .../crypto/parameters/DesParameters.cs.meta | 11 + .../parameters/DsaKeyGenerationParameters.cs | 30 + .../DsaKeyGenerationParameters.cs.meta | 11 + .../crypto/parameters/DsaKeyParameters.cs | 63 + .../parameters/DsaKeyParameters.cs.meta | 11 + .../crypto/parameters/DsaParameters.cs | 89 + .../crypto/parameters/DsaParameters.cs.meta | 11 + .../parameters/DsaPrivateKeyParameters.cs | 57 + .../DsaPrivateKeyParameters.cs.meta | 11 + .../parameters/DsaPublicKeyParameters.cs | 72 + .../parameters/DsaPublicKeyParameters.cs.meta | 11 + .../parameters/DsaValidationParameters.cs | 76 + .../DsaValidationParameters.cs.meta | 11 + .../crypto/parameters/ECDomainParameters.cs | 152 + .../parameters/ECDomainParameters.cs.meta | 11 + .../parameters/ECKeyGenerationParameters.cs | 45 + .../ECKeyGenerationParameters.cs.meta | 11 + .../crypto/parameters/ECKeyParameters.cs | 140 + .../crypto/parameters/ECKeyParameters.cs.meta | 11 + .../parameters/ECPrivateKeyParameters.cs | 91 + .../parameters/ECPrivateKeyParameters.cs.meta | 11 + .../parameters/ECPublicKeyParameters.cs | 90 + .../parameters/ECPublicKeyParameters.cs.meta | 11 + .../Ed25519KeyGenerationParameters.cs | 19 + .../Ed25519KeyGenerationParameters.cs.meta | 11 + .../parameters/Ed25519PrivateKeyParameters.cs | 102 + .../Ed25519PrivateKeyParameters.cs.meta | 11 + .../parameters/Ed25519PublicKeyParameters.cs | 44 + .../Ed25519PublicKeyParameters.cs.meta | 11 + .../Ed448KeyGenerationParameters.cs | 19 + .../Ed448KeyGenerationParameters.cs.meta | 11 + .../parameters/Ed448PrivateKeyParameters.cs | 94 + .../Ed448PrivateKeyParameters.cs.meta | 11 + .../parameters/Ed448PublicKeyParameters.cs | 44 + .../Ed448PublicKeyParameters.cs.meta | 11 + .../ElGamalKeyGenerationParameters.cs | 35 + .../ElGamalKeyGenerationParameters.cs.meta | 11 + .../crypto/parameters/ElGamalKeyParameters.cs | 63 + .../parameters/ElGamalKeyParameters.cs.meta | 11 + .../crypto/parameters/ElGamalParameters.cs | 85 + .../parameters/ElGamalParameters.cs.meta | 11 + .../parameters/ElGamalPrivateKeyParameters.cs | 57 + .../ElGamalPrivateKeyParameters.cs.meta | 11 + .../parameters/ElGamalPublicKeyParameters.cs | 57 + .../ElGamalPublicKeyParameters.cs.meta | 11 + .../GOST3410KeyGenerationParameters.cs | 59 + .../GOST3410KeyGenerationParameters.cs.meta | 11 + .../parameters/GOST3410KeyParameters.cs | 62 + .../parameters/GOST3410KeyParameters.cs.meta | 11 + .../crypto/parameters/GOST3410Parameters.cs | 90 + .../parameters/GOST3410Parameters.cs.meta | 11 + .../GOST3410PrivateKeyParameters.cs | 45 + .../GOST3410PrivateKeyParameters.cs.meta | 11 + .../parameters/GOST3410PublicKeyParameters.cs | 44 + .../GOST3410PublicKeyParameters.cs.meta | 11 + .../GOST3410ValidationParameters.cs | 55 + .../GOST3410ValidationParameters.cs.meta | 11 + .../crypto/parameters/HKDFParameters.cs | 123 + .../crypto/parameters/HKDFParameters.cs.meta | 11 + .../parameters/ISO18033KDFParameters.cs | 29 + .../parameters/ISO18033KDFParameters.cs.meta | 11 + .../crypto/parameters/IesParameters.cs | 53 + .../crypto/parameters/IesParameters.cs.meta | 11 + .../parameters/IesWithCipherParameters.cs | 37 + .../IesWithCipherParameters.cs.meta | 11 + .../crypto/parameters/KdfParameters.cs | 37 + .../crypto/parameters/KdfParameters.cs.meta | 11 + .../crypto/parameters/KeyParameter.cs | 47 + .../crypto/parameters/KeyParameter.cs.meta | 11 + .../crypto/parameters/MgfParameters.cs | 35 + .../crypto/parameters/MgfParameters.cs.meta | 11 + .../crypto/parameters/MqvPrivateParameters.cs | 68 + .../parameters/MqvPrivateParameters.cs.meta | 11 + .../crypto/parameters/MqvPublicParameters.cs | 40 + .../parameters/MqvPublicParameters.cs.meta | 11 + .../NaccacheSternKeyGenerationParameters.cs | 102 + ...ccacheSternKeyGenerationParameters.cs.meta | 11 + .../parameters/NaccacheSternKeyParameters.cs | 48 + .../NaccacheSternKeyParameters.cs.meta | 11 + .../NaccacheSternPrivateKeyParameters.cs | 83 + .../NaccacheSternPrivateKeyParameters.cs.meta | 11 + .../crypto/parameters/ParametersWithID.cs | 40 + .../parameters/ParametersWithID.cs.meta | 11 + .../crypto/parameters/ParametersWithIV.cs | 44 + .../parameters/ParametersWithIV.cs.meta | 11 + .../crypto/parameters/ParametersWithRandom.cs | 52 + .../parameters/ParametersWithRandom.cs.meta | 11 + .../crypto/parameters/ParametersWithSBox.cs | 28 + .../parameters/ParametersWithSBox.cs.meta | 11 + .../crypto/parameters/ParametersWithSalt.cs | 43 + .../parameters/ParametersWithSalt.cs.meta | 11 + .../crypto/parameters/RC2Parameters.cs | 51 + .../crypto/parameters/RC2Parameters.cs.meta | 11 + .../crypto/parameters/RC5Parameters.cs | 31 + .../crypto/parameters/RC5Parameters.cs.meta | 11 + .../parameters/RSABlindingParameters.cs | 38 + .../parameters/RSABlindingParameters.cs.meta | 11 + .../parameters/RsaKeyGenerationParameters.cs | 59 + .../RsaKeyGenerationParameters.cs.meta | 11 + .../crypto/parameters/RsaKeyParameters.cs | 89 + .../parameters/RsaKeyParameters.cs.meta | 11 + .../parameters/RsaPrivateCrtKeyParameters.cs | 122 + .../RsaPrivateCrtKeyParameters.cs.meta | 11 + .../SM2KeyExchangePrivateParameters.cs | 68 + .../SM2KeyExchangePrivateParameters.cs.meta | 11 + .../SM2KeyExchangePublicParameters.cs | 44 + .../SM2KeyExchangePublicParameters.cs.meta | 11 + .../crypto/parameters/SkeinParameters.cs | 290 + .../crypto/parameters/SkeinParameters.cs.meta | 11 + .../crypto/parameters/Srp6GroupParameters.cs | 31 + .../parameters/Srp6GroupParameters.cs.meta | 11 + .../TweakableBlockCipherParameters.cs | 44 + .../TweakableBlockCipherParameters.cs.meta | 11 + .../X25519KeyGenerationParameters.cs | 19 + .../X25519KeyGenerationParameters.cs.meta | 11 + .../parameters/X25519PrivateKeyParameters.cs | 67 + .../X25519PrivateKeyParameters.cs.meta | 11 + .../parameters/X25519PublicKeyParameters.cs | 44 + .../X25519PublicKeyParameters.cs.meta | 11 + .../parameters/X448KeyGenerationParameters.cs | 19 + .../X448KeyGenerationParameters.cs.meta | 11 + .../parameters/X448PrivateKeyParameters.cs | 67 + .../X448PrivateKeyParameters.cs.meta | 11 + .../parameters/X448PublicKeyParameters.cs | 44 + .../X448PublicKeyParameters.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/prng.meta | 8 + .../crypto/prng/BasicEntropySourceProvider.cs | 75 + .../prng/BasicEntropySourceProvider.cs.meta | 11 + .../prng/CryptoApiEntropySourceProvider.cs | 74 + .../CryptoApiEntropySourceProvider.cs.meta | 11 + .../crypto/prng/CryptoApiRandomGenerator.cs | 70 + .../prng/CryptoApiRandomGenerator.cs.meta | 11 + .../crypto/prng/DigestRandomGenerator.cs | 131 + .../crypto/prng/DigestRandomGenerator.cs.meta | 11 + .../crypto/prng/EntropyUtilities.cs | 34 + .../crypto/prng/EntropyUtilities.cs.meta | 11 + .../crypto/prng/IDrbgProvider.cs | 15 + .../crypto/prng/IDrbgProvider.cs.meta | 11 + .../crypto/prng/IRandomGenerator.cs | 30 + .../crypto/prng/IRandomGenerator.cs.meta | 11 + .../crypto/prng/ReversedWindowGenerator.cs | 102 + .../prng/ReversedWindowGenerator.cs.meta | 11 + .../crypto/prng/SP800SecureRandom.cs | 99 + .../crypto/prng/SP800SecureRandom.cs.meta | 11 + .../crypto/prng/SP800SecureRandomBuilder.cs | 212 + .../prng/SP800SecureRandomBuilder.cs.meta | 11 + .../crypto/prng/ThreadedSeedGenerator.cs | 148 + .../crypto/prng/ThreadedSeedGenerator.cs.meta | 11 + .../crypto/prng/VMPCRandomGenerator.cs | 118 + .../crypto/prng/VMPCRandomGenerator.cs.meta | 11 + .../SecureProtocol/crypto/prng/X931Rng.cs | 150 + .../crypto/prng/X931Rng.cs.meta | 11 + .../crypto/prng/X931SecureRandom.cs | 74 + .../crypto/prng/X931SecureRandom.cs.meta | 11 + .../crypto/prng/X931SecureRandomBuilder.cs | 91 + .../prng/X931SecureRandomBuilder.cs.meta | 11 + .../SecureProtocol/crypto/prng/drbg.meta | 8 + .../crypto/prng/drbg/CtrSP800Drbg.cs | 470 + .../crypto/prng/drbg/CtrSP800Drbg.cs.meta | 11 + .../crypto/prng/drbg/DrbgUtilities.cs | 107 + .../crypto/prng/drbg/DrbgUtilities.cs.meta | 11 + .../crypto/prng/drbg/HMacSP800Drbg.cs | 190 + .../crypto/prng/drbg/HMacSP800Drbg.cs.meta | 11 + .../crypto/prng/drbg/HashSP800Drbg.cs | 291 + .../crypto/prng/drbg/HashSP800Drbg.cs.meta | 11 + .../crypto/prng/drbg/ISP80090Drbg.cs | 39 + .../crypto/prng/drbg/ISP80090Drbg.cs.meta | 11 + .../SecureProtocol/crypto/signers.meta | 8 + .../crypto/signers/DsaDigestSigner.cs | 150 + .../crypto/signers/DsaDigestSigner.cs.meta | 11 + .../crypto/signers/DsaSigner.cs | 165 + .../crypto/signers/DsaSigner.cs.meta | 11 + .../crypto/signers/ECDsaSigner.cs | 249 + .../crypto/signers/ECDsaSigner.cs.meta | 11 + .../crypto/signers/ECGOST3410Signer.cs | 171 + .../crypto/signers/ECGOST3410Signer.cs.meta | 11 + .../crypto/signers/ECNRSigner.cs | 197 + .../crypto/signers/ECNRSigner.cs.meta | 11 + .../crypto/signers/Ed25519Signer.cs | 138 + .../crypto/signers/Ed25519Signer.cs.meta | 11 + .../crypto/signers/Ed25519ctxSigner.cs | 140 + .../crypto/signers/Ed25519ctxSigner.cs.meta | 11 + .../crypto/signers/Ed25519phSigner.cs | 92 + .../crypto/signers/Ed25519phSigner.cs.meta | 11 + .../crypto/signers/Ed448Signer.cs | 140 + .../crypto/signers/Ed448Signer.cs.meta | 11 + .../crypto/signers/Ed448phSigner.cs | 92 + .../crypto/signers/Ed448phSigner.cs.meta | 11 + .../crypto/signers/GOST3410DigestSigner.cs | 149 + .../signers/GOST3410DigestSigner.cs.meta | 11 + .../crypto/signers/GOST3410Signer.cs | 141 + .../crypto/signers/GOST3410Signer.cs.meta | 11 + .../crypto/signers/GenericSigner.cs | 134 + .../crypto/signers/GenericSigner.cs.meta | 11 + .../crypto/signers/HMacDsaKCalculator.cs | 155 + .../crypto/signers/HMacDsaKCalculator.cs.meta | 11 + .../crypto/signers/IDsaEncoding.cs | 29 + .../crypto/signers/IDsaEncoding.cs.meta | 11 + .../crypto/signers/IDsaKCalculator.cs | 48 + .../crypto/signers/IDsaKCalculator.cs.meta | 11 + .../crypto/signers/Iso9796d2PssSigner.cs | 623 + .../crypto/signers/Iso9796d2PssSigner.cs.meta | 11 + .../crypto/signers/Iso9796d2Signer.cs | 560 + .../crypto/signers/Iso9796d2Signer.cs.meta | 11 + .../crypto/signers/IsoTrailers.cs | 61 + .../crypto/signers/IsoTrailers.cs.meta | 11 + .../crypto/signers/PlainDsaEncoding.cs | 62 + .../crypto/signers/PlainDsaEncoding.cs.meta | 11 + .../crypto/signers/PssSigner.cs | 390 + .../crypto/signers/PssSigner.cs.meta | 11 + .../crypto/signers/RandomDsaKCalculator.cs | 48 + .../signers/RandomDsaKCalculator.cs.meta | 11 + .../crypto/signers/RsaDigestSigner.cs | 237 + .../crypto/signers/RsaDigestSigner.cs.meta | 11 + .../crypto/signers/SM2Signer.cs | 246 + .../crypto/signers/SM2Signer.cs.meta | 11 + .../crypto/signers/StandardDsaEncoding.cs | 60 + .../signers/StandardDsaEncoding.cs.meta | 11 + .../crypto/signers/X931Signer.cs | 230 + .../crypto/signers/X931Signer.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/tls.meta | 8 + .../tls/AbstractTlsAgreementCredentials.cs | 16 + .../AbstractTlsAgreementCredentials.cs.meta | 11 + .../crypto/tls/AbstractTlsCipherFactory.cs | 19 + .../tls/AbstractTlsCipherFactory.cs.meta | 11 + .../crypto/tls/AbstractTlsClient.cs | 282 + .../crypto/tls/AbstractTlsClient.cs.meta | 11 + .../crypto/tls/AbstractTlsContext.cs | 158 + .../crypto/tls/AbstractTlsContext.cs.meta | 11 + .../crypto/tls/AbstractTlsCredentials.cs | 14 + .../crypto/tls/AbstractTlsCredentials.cs.meta | 11 + .../tls/AbstractTlsEncryptionCredentials.cs | 16 + .../AbstractTlsEncryptionCredentials.cs.meta | 11 + .../crypto/tls/AbstractTlsKeyExchange.cs | 181 + .../crypto/tls/AbstractTlsKeyExchange.cs.meta | 11 + .../crypto/tls/AbstractTlsPeer.cs | 57 + .../crypto/tls/AbstractTlsPeer.cs.meta | 11 + .../crypto/tls/AbstractTlsServer.cs | 355 + .../crypto/tls/AbstractTlsServer.cs.meta | 11 + .../crypto/tls/AbstractTlsSigner.cs | 54 + .../crypto/tls/AbstractTlsSigner.cs.meta | 11 + .../tls/AbstractTlsSignerCredentials.cs | 24 + .../tls/AbstractTlsSignerCredentials.cs.meta | 11 + .../crypto/tls/AlertDescription.cs | 308 + .../crypto/tls/AlertDescription.cs.meta | 11 + .../SecureProtocol/crypto/tls/AlertLevel.cs | 33 + .../crypto/tls/AlertLevel.cs.meta | 11 + .../crypto/tls/AlwaysValidVerifyer.cs | 25 + .../crypto/tls/AlwaysValidVerifyer.cs.meta | 11 + .../crypto/tls/BasicTlsPskIdentity.cs | 47 + .../crypto/tls/BasicTlsPskIdentity.cs.meta | 11 + .../crypto/tls/BulkCipherAlgorithm.cs | 29 + .../crypto/tls/BulkCipherAlgorithm.cs.meta | 11 + .../SecureProtocol/crypto/tls/ByteQueue.cs | 215 + .../crypto/tls/ByteQueue.cs.meta | 11 + .../crypto/tls/ByteQueueStream.cs | 114 + .../crypto/tls/ByteQueueStream.cs.meta | 11 + .../crypto/tls/CertChainType.cs | 22 + .../crypto/tls/CertChainType.cs.meta | 11 + .../SecureProtocol/crypto/tls/Certificate.cs | 140 + .../crypto/tls/Certificate.cs.meta | 11 + .../crypto/tls/CertificateRequest.cs | 160 + .../crypto/tls/CertificateRequest.cs.meta | 11 + .../crypto/tls/CertificateStatus.cs | 106 + .../crypto/tls/CertificateStatus.cs.meta | 11 + .../crypto/tls/CertificateStatusRequest.cs | 99 + .../tls/CertificateStatusRequest.cs.meta | 11 + .../crypto/tls/CertificateStatusType.cs | 16 + .../crypto/tls/CertificateStatusType.cs.meta | 11 + .../crypto/tls/CertificateType.cs | 22 + .../crypto/tls/CertificateType.cs.meta | 11 + .../crypto/tls/CertificateUrl.cs | 129 + .../crypto/tls/CertificateUrl.cs.meta | 11 + .../crypto/tls/Chacha20Poly1305.cs | 203 + .../crypto/tls/Chacha20Poly1305.cs.meta | 11 + .../crypto/tls/ChangeCipherSpec.cs | 13 + .../crypto/tls/ChangeCipherSpec.cs.meta | 11 + .../SecureProtocol/crypto/tls/CipherSuite.cs | 381 + .../crypto/tls/CipherSuite.cs.meta | 11 + .../SecureProtocol/crypto/tls/CipherType.cs | 24 + .../crypto/tls/CipherType.cs.meta | 11 + .../crypto/tls/ClientAuthenticationType.cs | 18 + .../tls/ClientAuthenticationType.cs.meta | 11 + .../crypto/tls/ClientCertificateType.cs | 27 + .../crypto/tls/ClientCertificateType.cs.meta | 11 + .../SecureProtocol/crypto/tls/CombinedHash.cs | 137 + .../crypto/tls/CombinedHash.cs.meta | 11 + .../crypto/tls/CompressionMethod.cs | 26 + .../crypto/tls/CompressionMethod.cs.meta | 11 + .../crypto/tls/ConnectionEnd.cs | 19 + .../crypto/tls/ConnectionEnd.cs.meta | 11 + .../SecureProtocol/crypto/tls/ContentType.cs | 18 + .../crypto/tls/ContentType.cs.meta | 11 + .../crypto/tls/DatagramTransport.cs | 27 + .../crypto/tls/DatagramTransport.cs.meta | 11 + .../tls/DefaultTlsAgreementCredentials.cs | 73 + .../DefaultTlsAgreementCredentials.cs.meta | 11 + .../crypto/tls/DefaultTlsCipherFactory.cs | 231 + .../tls/DefaultTlsCipherFactory.cs.meta | 11 + .../crypto/tls/DefaultTlsClient.cs | 119 + .../crypto/tls/DefaultTlsClient.cs.meta | 11 + .../crypto/tls/DefaultTlsDHVerifier.cs | 105 + .../crypto/tls/DefaultTlsDHVerifier.cs.meta | 11 + .../tls/DefaultTlsEncryptionCredentials.cs | 56 + .../DefaultTlsEncryptionCredentials.cs.meta | 11 + .../crypto/tls/DefaultTlsServer.cs | 170 + .../crypto/tls/DefaultTlsServer.cs.meta | 11 + .../crypto/tls/DefaultTlsSignerCredentials.cs | 97 + .../tls/DefaultTlsSignerCredentials.cs.meta | 11 + .../crypto/tls/DefaultTlsSrpGroupVerifier.cs | 74 + .../tls/DefaultTlsSrpGroupVerifier.cs.meta | 11 + .../SecureProtocol/crypto/tls/DeferredHash.cs | 205 + .../crypto/tls/DeferredHash.cs.meta | 11 + .../crypto/tls/DigestInputBuffer.cs | 41 + .../crypto/tls/DigestInputBuffer.cs.meta | 11 + .../crypto/tls/DigitallySigned.cs | 74 + .../crypto/tls/DigitallySigned.cs.meta | 11 + .../crypto/tls/DtlsClientProtocol.cs | 866 ++ .../crypto/tls/DtlsClientProtocol.cs.meta | 11 + .../SecureProtocol/crypto/tls/DtlsEpoch.cs | 55 + .../crypto/tls/DtlsEpoch.cs.meta | 11 + .../crypto/tls/DtlsHandshakeRetransmit.cs | 15 + .../tls/DtlsHandshakeRetransmit.cs.meta | 11 + .../SecureProtocol/crypto/tls/DtlsProtocol.cs | 96 + .../crypto/tls/DtlsProtocol.cs.meta | 11 + .../crypto/tls/DtlsReassembler.cs | 129 + .../crypto/tls/DtlsReassembler.cs.meta | 11 + .../crypto/tls/DtlsRecordLayer.cs | 534 + .../crypto/tls/DtlsRecordLayer.cs.meta | 11 + .../crypto/tls/DtlsReliableHandshake.cs | 438 + .../crypto/tls/DtlsReliableHandshake.cs.meta | 11 + .../crypto/tls/DtlsReplayWindow.cs | 89 + .../crypto/tls/DtlsReplayWindow.cs.meta | 11 + .../crypto/tls/DtlsServerProtocol.cs | 722 + .../crypto/tls/DtlsServerProtocol.cs.meta | 11 + .../crypto/tls/DtlsTransport.cs | 81 + .../crypto/tls/DtlsTransport.cs.meta | 11 + .../SecureProtocol/crypto/tls/ECBasisType.cs | 20 + .../crypto/tls/ECBasisType.cs.meta | 11 + .../SecureProtocol/crypto/tls/ECCurveType.cs | 33 + .../crypto/tls/ECCurveType.cs.meta | 11 + .../crypto/tls/ECPointFormat.cs | 20 + .../crypto/tls/ECPointFormat.cs.meta | 11 + .../crypto/tls/EncryptionAlgorithm.cs | 73 + .../crypto/tls/EncryptionAlgorithm.cs.meta | 11 + .../crypto/tls/ExporterLabel.cs | 41 + .../crypto/tls/ExporterLabel.cs.meta | 11 + .../crypto/tls/ExtensionType.cs | 132 + .../crypto/tls/ExtensionType.cs.meta | 11 + .../crypto/tls/FiniteFieldDheGroup.cs | 25 + .../crypto/tls/FiniteFieldDheGroup.cs.meta | 11 + .../crypto/tls/HandshakeType.cs | 44 + .../crypto/tls/HandshakeType.cs.meta | 11 + .../crypto/tls/HashAlgorithm.cs | 69 + .../crypto/tls/HashAlgorithm.cs.meta | 11 + .../crypto/tls/HeartbeatExtension.cs | 56 + .../crypto/tls/HeartbeatExtension.cs.meta | 11 + .../crypto/tls/HeartbeatMessage.cs | 113 + .../crypto/tls/HeartbeatMessage.cs.meta | 11 + .../crypto/tls/HeartbeatMessageType.cs | 22 + .../crypto/tls/HeartbeatMessageType.cs.meta | 11 + .../crypto/tls/HeartbeatMode.cs | 22 + .../crypto/tls/HeartbeatMode.cs.meta | 11 + .../crypto/tls/ICertificateVerifyer.cs | 22 + .../crypto/tls/ICertificateVerifyer.cs.meta | 11 + .../crypto/tls/KeyExchangeAlgorithm.cs | 58 + .../crypto/tls/KeyExchangeAlgorithm.cs.meta | 11 + .../crypto/tls/LegacyTlsAuthentication.cs | 42 + .../tls/LegacyTlsAuthentication.cs.meta | 11 + .../crypto/tls/LegacyTlsClient.cs | 32 + .../crypto/tls/LegacyTlsClient.cs.meta | 11 + .../SecureProtocol/crypto/tls/MacAlgorithm.cs | 29 + .../crypto/tls/MacAlgorithm.cs.meta | 11 + .../crypto/tls/MaxFragmentLength.cs | 24 + .../crypto/tls/MaxFragmentLength.cs.meta | 11 + .../SecureProtocol/crypto/tls/NameType.cs | 21 + .../crypto/tls/NameType.cs.meta | 11 + .../SecureProtocol/crypto/tls/NamedCurve.cs | 81 + .../crypto/tls/NamedCurve.cs.meta | 11 + .../crypto/tls/NewSessionTicket.cs | 57 + .../crypto/tls/NewSessionTicket.cs.meta | 11 + .../crypto/tls/OcspStatusRequest.cs | 135 + .../crypto/tls/OcspStatusRequest.cs.meta | 11 + .../SecureProtocol/crypto/tls/PrfAlgorithm.cs | 28 + .../crypto/tls/PrfAlgorithm.cs.meta | 11 + .../crypto/tls/ProtocolVersion.cs | 163 + .../crypto/tls/ProtocolVersion.cs.meta | 11 + .../SecureProtocol/crypto/tls/PskTlsClient.cs | 79 + .../crypto/tls/PskTlsClient.cs.meta | 11 + .../SecureProtocol/crypto/tls/PskTlsServer.cs | 97 + .../crypto/tls/PskTlsServer.cs.meta | 11 + .../SecureProtocol/crypto/tls/RecordStream.cs | 418 + .../crypto/tls/RecordStream.cs.meta | 11 + .../crypto/tls/SecurityParameters.cs | 112 + .../crypto/tls/SecurityParameters.cs.meta | 11 + .../crypto/tls/ServerDHParams.cs | 0 .../crypto/tls/ServerDHParams.cs.meta | 12 + .../SecureProtocol/crypto/tls/ServerName.cs | 109 + .../crypto/tls/ServerName.cs.meta | 11 + .../crypto/tls/ServerNameList.cs | 109 + .../crypto/tls/ServerNameList.cs.meta | 11 + .../crypto/tls/ServerOnlyTlsAuthentication.cs | 19 + .../tls/ServerOnlyTlsAuthentication.cs.meta | 11 + .../crypto/tls/ServerSrpParams.cs | 79 + .../crypto/tls/ServerSrpParams.cs.meta | 11 + .../crypto/tls/SessionParameters.cs | 184 + .../crypto/tls/SessionParameters.cs.meta | 11 + .../crypto/tls/SignatureAlgorithm.cs | 19 + .../crypto/tls/SignatureAlgorithm.cs.meta | 11 + .../crypto/tls/SignatureAndHashAlgorithm.cs | 98 + .../tls/SignatureAndHashAlgorithm.cs.meta | 11 + .../crypto/tls/SignerInputBuffer.cs | 41 + .../crypto/tls/SignerInputBuffer.cs.meta | 11 + .../tls/SimulatedTlsSrpIdentityManager.cs | 73 + .../SimulatedTlsSrpIdentityManager.cs.meta | 11 + .../SecureProtocol/crypto/tls/SrpTlsClient.cs | 108 + .../crypto/tls/SrpTlsClient.cs.meta | 11 + .../SecureProtocol/crypto/tls/SrpTlsServer.cs | 125 + .../crypto/tls/SrpTlsServer.cs.meta | 11 + .../crypto/tls/SrtpProtectionProfile.cs | 25 + .../crypto/tls/SrtpProtectionProfile.cs.meta | 11 + .../SecureProtocol/crypto/tls/Ssl3Mac.cs | 114 + .../SecureProtocol/crypto/tls/Ssl3Mac.cs.meta | 11 + .../crypto/tls/SupplementalDataEntry.cs | 30 + .../crypto/tls/SupplementalDataEntry.cs.meta | 11 + .../crypto/tls/SupplementalDataType.cs | 17 + .../crypto/tls/SupplementalDataType.cs.meta | 11 + .../crypto/tls/TlsAeadCipher.cs | 253 + .../crypto/tls/TlsAeadCipher.cs.meta | 11 + .../crypto/tls/TlsAgreementCredentials.cs | 16 + .../tls/TlsAgreementCredentials.cs.meta | 11 + .../crypto/tls/TlsAuthentication.cs | 35 + .../crypto/tls/TlsAuthentication.cs.meta | 11 + .../crypto/tls/TlsBlockCipher.cs | 400 + .../crypto/tls/TlsBlockCipher.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsCipher.cs | 20 + .../crypto/tls/TlsCipher.cs.meta | 11 + .../crypto/tls/TlsCipherFactory.cs | 15 + .../crypto/tls/TlsCipherFactory.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsClient.cs | 154 + .../crypto/tls/TlsClient.cs.meta | 11 + .../crypto/tls/TlsClientContext.cs | 15 + .../crypto/tls/TlsClientContext.cs.meta | 11 + .../crypto/tls/TlsClientContextImpl.cs | 24 + .../crypto/tls/TlsClientContextImpl.cs.meta | 11 + .../crypto/tls/TlsClientProtocol.cs | 920 ++ .../crypto/tls/TlsClientProtocol.cs.meta | 11 + .../crypto/tls/TlsCompression.cs | 16 + .../crypto/tls/TlsCompression.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsContext.cs | 49 + .../crypto/tls/TlsContext.cs.meta | 11 + .../crypto/tls/TlsCredentials.cs | 13 + .../crypto/tls/TlsCredentials.cs.meta | 11 + .../crypto/tls/TlsDHKeyExchange.cs | 253 + .../crypto/tls/TlsDHKeyExchange.cs.meta | 11 + .../crypto/tls/TlsDHUtilities.cs | 482 + .../crypto/tls/TlsDHUtilities.cs.meta | 11 + .../crypto/tls/TlsDHVerifier.cs | 19 + .../crypto/tls/TlsDHVerifier.cs.meta | 11 + .../crypto/tls/TlsDeflateCompression.cs | 72 + .../crypto/tls/TlsDeflateCompression.cs.meta | 11 + .../crypto/tls/TlsDheKeyExchange.cs | 101 + .../crypto/tls/TlsDheKeyExchange.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsDsaSigner.cs | 86 + .../crypto/tls/TlsDsaSigner.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsDssSigner.cs | 30 + .../crypto/tls/TlsDssSigner.cs.meta | 11 + .../crypto/tls/TlsECDHKeyExchange.cs | 256 + .../crypto/tls/TlsECDHKeyExchange.cs.meta | 11 + .../crypto/tls/TlsECDheKeyExchange.cs | 135 + .../crypto/tls/TlsECDheKeyExchange.cs.meta | 11 + .../crypto/tls/TlsECDsaSigner.cs | 30 + .../crypto/tls/TlsECDsaSigner.cs.meta | 11 + .../crypto/tls/TlsEccUtilities.cs | 709 + .../crypto/tls/TlsEccUtilities.cs.meta | 11 + .../crypto/tls/TlsEncryptionCredentials.cs | 16 + .../tls/TlsEncryptionCredentials.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsException.cs | 18 + .../crypto/tls/TlsException.cs.meta | 11 + .../crypto/tls/TlsExtensionsUtilities.cs | 372 + .../crypto/tls/TlsExtensionsUtilities.cs.meta | 11 + .../crypto/tls/TlsFatalAlert.cs | 30 + .../crypto/tls/TlsFatalAlert.cs.meta | 11 + .../crypto/tls/TlsFatalAlertReceived.cs | 25 + .../crypto/tls/TlsFatalAlertReceived.cs.meta | 11 + .../crypto/tls/TlsHandshakeHash.cs | 26 + .../crypto/tls/TlsHandshakeHash.cs.meta | 11 + .../crypto/tls/TlsKeyExchange.cs | 58 + .../crypto/tls/TlsKeyExchange.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsMac.cs | 177 + .../SecureProtocol/crypto/tls/TlsMac.cs.meta | 11 + .../crypto/tls/TlsNoCloseNotifyException.cs | 27 + .../tls/TlsNoCloseNotifyException.cs.meta | 11 + .../crypto/tls/TlsNullCipher.cs | 122 + .../crypto/tls/TlsNullCipher.cs.meta | 11 + .../crypto/tls/TlsNullCompression.cs | 23 + .../crypto/tls/TlsNullCompression.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsPeer.cs | 81 + .../SecureProtocol/crypto/tls/TlsPeer.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsProtocol.cs | 1454 ++ .../crypto/tls/TlsProtocol.cs.meta | 11 + .../crypto/tls/TlsProtocolHandler.cs | 43 + .../crypto/tls/TlsProtocolHandler.cs.meta | 11 + .../crypto/tls/TlsPskIdentity.cs | 19 + .../crypto/tls/TlsPskIdentity.cs.meta | 11 + .../crypto/tls/TlsPskIdentityManager.cs | 15 + .../crypto/tls/TlsPskIdentityManager.cs.meta | 11 + .../crypto/tls/TlsPskKeyExchange.cs | 338 + .../crypto/tls/TlsPskKeyExchange.cs.meta | 11 + .../crypto/tls/TlsRsaKeyExchange.cs | 144 + .../crypto/tls/TlsRsaKeyExchange.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsRsaSigner.cs | 106 + .../crypto/tls/TlsRsaSigner.cs.meta | 11 + .../crypto/tls/TlsRsaUtilities.cs | 136 + .../crypto/tls/TlsRsaUtilities.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsServer.cs | 97 + .../crypto/tls/TlsServer.cs.meta | 11 + .../crypto/tls/TlsServerContext.cs | 15 + .../crypto/tls/TlsServerContext.cs.meta | 11 + .../crypto/tls/TlsServerContextImpl.cs | 24 + .../crypto/tls/TlsServerContextImpl.cs.meta | 11 + .../crypto/tls/TlsServerProtocol.cs | 840 ++ .../crypto/tls/TlsServerProtocol.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsSession.cs | 19 + .../crypto/tls/TlsSession.cs.meta | 11 + .../crypto/tls/TlsSessionImpl.cs | 55 + .../crypto/tls/TlsSessionImpl.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsSigner.cs | 33 + .../crypto/tls/TlsSigner.cs.meta | 11 + .../crypto/tls/TlsSignerCredentials.cs | 18 + .../crypto/tls/TlsSignerCredentials.cs.meta | 11 + .../crypto/tls/TlsSrpGroupVerifier.cs | 21 + .../crypto/tls/TlsSrpGroupVerifier.cs.meta | 11 + .../crypto/tls/TlsSrpIdentityManager.cs | 25 + .../crypto/tls/TlsSrpIdentityManager.cs.meta | 11 + .../crypto/tls/TlsSrpKeyExchange.cs | 289 + .../crypto/tls/TlsSrpKeyExchange.cs.meta | 11 + .../crypto/tls/TlsSrpLoginParameters.cs | 40 + .../crypto/tls/TlsSrpLoginParameters.cs.meta | 11 + .../crypto/tls/TlsSrpUtilities.cs | 78 + .../crypto/tls/TlsSrpUtilities.cs.meta | 11 + .../crypto/tls/TlsSrtpUtilities.cs | 66 + .../crypto/tls/TlsSrtpUtilities.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsStream.cs | 101 + .../crypto/tls/TlsStream.cs.meta | 11 + .../crypto/tls/TlsStreamCipher.cs | 156 + .../crypto/tls/TlsStreamCipher.cs.meta | 11 + .../SecureProtocol/crypto/tls/TlsUtilities.cs | 2405 ++++ .../crypto/tls/TlsUtilities.cs.meta | 11 + .../SecureProtocol/crypto/tls/UrlAndHash.cs | 98 + .../crypto/tls/UrlAndHash.cs.meta | 11 + .../SecureProtocol/crypto/tls/UseSrtpData.cs | 60 + .../crypto/tls/UseSrtpData.cs.meta | 11 + .../crypto/tls/UserMappingType.cs | 17 + .../crypto/tls/UserMappingType.cs.meta | 11 + .../BestHTTP/SecureProtocol/crypto/util.meta | 8 + .../SecureProtocol/crypto/util/Pack.cs | 349 + .../SecureProtocol/crypto/util/Pack.cs.meta | 11 + .../BestHTTP/SecureProtocol/math.meta | 7 + .../SecureProtocol/math/BigInteger.cs | 3604 +++++ .../SecureProtocol/math/BigInteger.cs.meta | 11 + .../BestHTTP/SecureProtocol/math/Primes.cs | 633 + .../SecureProtocol/math/Primes.cs.meta | 11 + .../BestHTTP/SecureProtocol/math/ec.meta | 8 + .../SecureProtocol/math/ec/ECAlgorithms.cs | 500 + .../math/ec/ECAlgorithms.cs.meta | 11 + .../SecureProtocol/math/ec/ECCurve.cs | 1287 ++ .../SecureProtocol/math/ec/ECCurve.cs.meta | 11 + .../SecureProtocol/math/ec/ECFieldElement.cs | 978 ++ .../math/ec/ECFieldElement.cs.meta | 11 + .../SecureProtocol/math/ec/ECLookupTable.cs | 14 + .../math/ec/ECLookupTable.cs.meta | 11 + .../SecureProtocol/math/ec/ECPoint.cs | 2130 +++ .../SecureProtocol/math/ec/ECPoint.cs.meta | 11 + .../SecureProtocol/math/ec/ECPointMap.cs | 13 + .../SecureProtocol/math/ec/ECPointMap.cs.meta | 11 + .../SecureProtocol/math/ec/LongArray.cs | 2210 +++ .../SecureProtocol/math/ec/LongArray.cs.meta | 11 + .../SecureProtocol/math/ec/ScaleXPointMap.cs | 24 + .../math/ec/ScaleXPointMap.cs.meta | 11 + .../SecureProtocol/math/ec/ScaleYPointMap.cs | 24 + .../math/ec/ScaleYPointMap.cs.meta | 11 + .../math/ec/SimpleLookupTable.cs | 39 + .../math/ec/SimpleLookupTable.cs.meta | 11 + .../BestHTTP/SecureProtocol/math/ec/abc.meta | 8 + .../math/ec/abc/SimpleBigDecimal.cs | 245 + .../math/ec/abc/SimpleBigDecimal.cs.meta | 11 + .../SecureProtocol/math/ec/abc/Tnaf.cs | 849 ++ .../SecureProtocol/math/ec/abc/Tnaf.cs.meta | 11 + .../SecureProtocol/math/ec/abc/ZTauElement.cs | 40 + .../math/ec/abc/ZTauElement.cs.meta | 11 + .../SecureProtocol/math/ec/custom.meta | 8 + .../SecureProtocol/math/ec/custom/djb.meta | 8 + .../math/ec/custom/djb/Curve25519.cs | 139 + .../math/ec/custom/djb/Curve25519.cs.meta | 11 + .../math/ec/custom/djb/Curve25519Field.cs | 257 + .../ec/custom/djb/Curve25519Field.cs.meta | 11 + .../ec/custom/djb/Curve25519FieldElement.cs | 237 + .../custom/djb/Curve25519FieldElement.cs.meta | 11 + .../math/ec/custom/djb/Curve25519Point.cs | 317 + .../ec/custom/djb/Curve25519Point.cs.meta | 11 + .../SecureProtocol/math/ec/custom/gm.meta | 8 + .../math/ec/custom/gm/SM2P256V1Curve.cs | 140 + .../math/ec/custom/gm/SM2P256V1Curve.cs.meta | 11 + .../math/ec/custom/gm/SM2P256V1Field.cs | 311 + .../math/ec/custom/gm/SM2P256V1Field.cs.meta | 11 + .../ec/custom/gm/SM2P256V1FieldElement.cs | 215 + .../custom/gm/SM2P256V1FieldElement.cs.meta | 11 + .../math/ec/custom/gm/SM2P256V1Point.cs | 283 + .../math/ec/custom/gm/SM2P256V1Point.cs.meta | 11 + .../SecureProtocol/math/ec/custom/sec.meta | 8 + .../math/ec/custom/sec/SecP128R1Curve.cs | 141 + .../math/ec/custom/sec/SecP128R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP128R1Field.cs | 222 + .../math/ec/custom/sec/SecP128R1Field.cs.meta | 11 + .../ec/custom/sec/SecP128R1FieldElement.cs | 202 + .../custom/sec/SecP128R1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP128R1Point.cs | 283 + .../math/ec/custom/sec/SecP128R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP160K1Curve.cs | 137 + .../math/ec/custom/sec/SecP160K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP160K1Point.cs | 273 + .../math/ec/custom/sec/SecP160K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP160R1Curve.cs | 141 + .../math/ec/custom/sec/SecP160R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP160R1Field.cs | 190 + .../math/ec/custom/sec/SecP160R1Field.cs.meta | 11 + .../ec/custom/sec/SecP160R1FieldElement.cs | 207 + .../custom/sec/SecP160R1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP160R1Point.cs | 283 + .../math/ec/custom/sec/SecP160R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP160R2Curve.cs | 141 + .../math/ec/custom/sec/SecP160R2Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP160R2Field.cs | 182 + .../math/ec/custom/sec/SecP160R2Field.cs.meta | 11 + .../ec/custom/sec/SecP160R2FieldElement.cs | 222 + .../custom/sec/SecP160R2FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP160R2Point.cs | 283 + .../math/ec/custom/sec/SecP160R2Point.cs.meta | 11 + .../math/ec/custom/sec/SecP192K1Curve.cs | 138 + .../math/ec/custom/sec/SecP192K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP192K1Field.cs | 182 + .../math/ec/custom/sec/SecP192K1Field.cs.meta | 11 + .../ec/custom/sec/SecP192K1FieldElement.cs | 217 + .../custom/sec/SecP192K1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP192K1Point.cs | 271 + .../math/ec/custom/sec/SecP192K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP192R1Curve.cs | 141 + .../math/ec/custom/sec/SecP192R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP192R1Field.cs | 287 + .../math/ec/custom/sec/SecP192R1Field.cs.meta | 11 + .../ec/custom/sec/SecP192R1FieldElement.cs | 192 + .../custom/sec/SecP192R1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP192R1Point.cs | 283 + .../math/ec/custom/sec/SecP192R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP224K1Curve.cs | 138 + .../math/ec/custom/sec/SecP224K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP224K1Field.cs | 183 + .../math/ec/custom/sec/SecP224K1Field.cs.meta | 11 + .../ec/custom/sec/SecP224K1FieldElement.cs | 246 + .../custom/sec/SecP224K1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP224K1Point.cs | 271 + .../math/ec/custom/sec/SecP224K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP224R1Curve.cs | 141 + .../math/ec/custom/sec/SecP224R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP224R1Field.cs | 301 + .../math/ec/custom/sec/SecP224R1Field.cs.meta | 11 + .../ec/custom/sec/SecP224R1FieldElement.cs | 273 + .../custom/sec/SecP224R1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP224R1Point.cs | 283 + .../math/ec/custom/sec/SecP224R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP256K1Curve.cs | 138 + .../math/ec/custom/sec/SecP256K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP256K1Field.cs | 184 + .../math/ec/custom/sec/SecP256K1Field.cs.meta | 11 + .../ec/custom/sec/SecP256K1FieldElement.cs | 218 + .../custom/sec/SecP256K1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP256K1Point.cs | 271 + .../math/ec/custom/sec/SecP256K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP256R1Curve.cs | 140 + .../math/ec/custom/sec/SecP256R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP256R1Field.cs | 316 + .../math/ec/custom/sec/SecP256R1Field.cs.meta | 11 + .../ec/custom/sec/SecP256R1FieldElement.cs | 192 + .../custom/sec/SecP256R1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP256R1Point.cs | 283 + .../math/ec/custom/sec/SecP256R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP384R1Curve.cs | 140 + .../math/ec/custom/sec/SecP384R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP384R1Field.cs | 299 + .../math/ec/custom/sec/SecP384R1Field.cs.meta | 11 + .../ec/custom/sec/SecP384R1FieldElement.cs | 214 + .../custom/sec/SecP384R1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP384R1Point.cs | 284 + .../math/ec/custom/sec/SecP384R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecP521R1Curve.cs | 140 + .../math/ec/custom/sec/SecP521R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecP521R1Field.cs | 159 + .../math/ec/custom/sec/SecP521R1Field.cs.meta | 11 + .../ec/custom/sec/SecP521R1FieldElement.cs | 171 + .../custom/sec/SecP521R1FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecP521R1Point.cs | 279 + .../math/ec/custom/sec/SecP521R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT113Field.cs | 229 + .../math/ec/custom/sec/SecT113Field.cs.meta | 11 + .../math/ec/custom/sec/SecT113FieldElement.cs | 225 + .../ec/custom/sec/SecT113FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecT113R1Curve.cs | 161 + .../math/ec/custom/sec/SecT113R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT113R1Point.cs | 285 + .../math/ec/custom/sec/SecT113R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT113R2Curve.cs | 161 + .../math/ec/custom/sec/SecT113R2Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT113R2Point.cs | 295 + .../math/ec/custom/sec/SecT113R2Point.cs.meta | 11 + .../math/ec/custom/sec/SecT131Field.cs | 334 + .../math/ec/custom/sec/SecT131Field.cs.meta | 11 + .../math/ec/custom/sec/SecT131FieldElement.cs | 225 + .../ec/custom/sec/SecT131FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecT131R1Curve.cs | 161 + .../math/ec/custom/sec/SecT131R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT131R1Point.cs | 291 + .../math/ec/custom/sec/SecT131R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT131R2Curve.cs | 161 + .../math/ec/custom/sec/SecT131R2Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT131R2Point.cs | 287 + .../math/ec/custom/sec/SecT131R2Point.cs.meta | 11 + .../math/ec/custom/sec/SecT163Field.cs | 344 + .../math/ec/custom/sec/SecT163Field.cs.meta | 11 + .../math/ec/custom/sec/SecT163FieldElement.cs | 225 + .../ec/custom/sec/SecT163FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecT163K1Curve.cs | 167 + .../math/ec/custom/sec/SecT163K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT163K1Point.cs | 285 + .../math/ec/custom/sec/SecT163K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT163R1Curve.cs | 161 + .../math/ec/custom/sec/SecT163R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT163R1Point.cs | 287 + .../math/ec/custom/sec/SecT163R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT163R2Curve.cs | 161 + .../math/ec/custom/sec/SecT163R2Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT163R2Point.cs | 290 + .../math/ec/custom/sec/SecT163R2Point.cs.meta | 11 + .../math/ec/custom/sec/SecT193Field.cs | 309 + .../math/ec/custom/sec/SecT193Field.cs.meta | 11 + .../math/ec/custom/sec/SecT193FieldElement.cs | 225 + .../ec/custom/sec/SecT193FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecT193R1Curve.cs | 161 + .../math/ec/custom/sec/SecT193R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT193R1Point.cs | 287 + .../math/ec/custom/sec/SecT193R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT193R2Curve.cs | 161 + .../math/ec/custom/sec/SecT193R2Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT193R2Point.cs | 287 + .../math/ec/custom/sec/SecT193R2Point.cs.meta | 11 + .../math/ec/custom/sec/SecT233Field.cs | 321 + .../math/ec/custom/sec/SecT233Field.cs.meta | 11 + .../math/ec/custom/sec/SecT233FieldElement.cs | 225 + .../ec/custom/sec/SecT233FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecT233K1Curve.cs | 167 + .../math/ec/custom/sec/SecT233K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT233K1Point.cs | 299 + .../math/ec/custom/sec/SecT233K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT233R1Curve.cs | 161 + .../math/ec/custom/sec/SecT233R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT233R1Point.cs | 282 + .../math/ec/custom/sec/SecT233R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT239Field.cs | 332 + .../math/ec/custom/sec/SecT239Field.cs.meta | 11 + .../math/ec/custom/sec/SecT239FieldElement.cs | 225 + .../ec/custom/sec/SecT239FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecT239K1Curve.cs | 167 + .../math/ec/custom/sec/SecT239K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT239K1Point.cs | 294 + .../math/ec/custom/sec/SecT239K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT283Field.cs | 406 + .../math/ec/custom/sec/SecT283Field.cs.meta | 11 + .../math/ec/custom/sec/SecT283FieldElement.cs | 225 + .../ec/custom/sec/SecT283FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecT283K1Curve.cs | 167 + .../math/ec/custom/sec/SecT283K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT283K1Point.cs | 293 + .../math/ec/custom/sec/SecT283K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT283R1Curve.cs | 161 + .../math/ec/custom/sec/SecT283R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT283R1Point.cs | 282 + .../math/ec/custom/sec/SecT283R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT409Field.cs | 335 + .../math/ec/custom/sec/SecT409Field.cs.meta | 11 + .../math/ec/custom/sec/SecT409FieldElement.cs | 225 + .../ec/custom/sec/SecT409FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecT409K1Curve.cs | 167 + .../math/ec/custom/sec/SecT409K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT409K1Point.cs | 293 + .../math/ec/custom/sec/SecT409K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT409R1Curve.cs | 161 + .../math/ec/custom/sec/SecT409R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT409R1Point.cs | 282 + .../math/ec/custom/sec/SecT409R1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT571Field.cs | 337 + .../math/ec/custom/sec/SecT571Field.cs.meta | 11 + .../math/ec/custom/sec/SecT571FieldElement.cs | 225 + .../ec/custom/sec/SecT571FieldElement.cs.meta | 11 + .../math/ec/custom/sec/SecT571K1Curve.cs | 167 + .../math/ec/custom/sec/SecT571K1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT571K1Point.cs | 293 + .../math/ec/custom/sec/SecT571K1Point.cs.meta | 11 + .../math/ec/custom/sec/SecT571R1Curve.cs | 165 + .../math/ec/custom/sec/SecT571R1Curve.cs.meta | 11 + .../math/ec/custom/sec/SecT571R1Point.cs | 282 + .../math/ec/custom/sec/SecT571R1Point.cs.meta | 11 + .../BestHTTP/SecureProtocol/math/ec/endo.meta | 8 + .../math/ec/endo/ECEndomorphism.cs | 15 + .../math/ec/endo/ECEndomorphism.cs.meta | 11 + .../math/ec/endo/GlvEndomorphism.cs | 14 + .../math/ec/endo/GlvEndomorphism.cs.meta | 11 + .../math/ec/endo/GlvTypeBEndomorphism.cs | 59 + .../math/ec/endo/GlvTypeBEndomorphism.cs.meta | 11 + .../math/ec/endo/GlvTypeBParameters.cs | 64 + .../math/ec/endo/GlvTypeBParameters.cs.meta | 11 + .../SecureProtocol/math/ec/multiplier.meta | 8 + .../ec/multiplier/AbstractECMultiplier.cs | 33 + .../multiplier/AbstractECMultiplier.cs.meta | 11 + .../math/ec/multiplier/DoubleAddMultiplier.cs | 28 + .../ec/multiplier/DoubleAddMultiplier.cs.meta | 11 + .../math/ec/multiplier/ECMultiplier.cs | 22 + .../math/ec/multiplier/ECMultiplier.cs.meta | 11 + .../ec/multiplier/FixedPointCombMultiplier.cs | 62 + .../FixedPointCombMultiplier.cs.meta | 11 + .../ec/multiplier/FixedPointPreCompInfo.cs | 47 + .../multiplier/FixedPointPreCompInfo.cs.meta | 11 + .../math/ec/multiplier/FixedPointUtilities.cs | 99 + .../ec/multiplier/FixedPointUtilities.cs.meta | 11 + .../math/ec/multiplier/GlvMultiplier.cs | 44 + .../math/ec/multiplier/GlvMultiplier.cs.meta | 11 + .../math/ec/multiplier/IPreCompCallback.cs | 13 + .../ec/multiplier/IPreCompCallback.cs.meta | 11 + .../ec/multiplier/MixedNafR2LMultiplier.cs | 79 + .../multiplier/MixedNafR2LMultiplier.cs.meta | 11 + .../multiplier/MontgomeryLadderMultiplier.cs | 29 + .../MontgomeryLadderMultiplier.cs.meta | 11 + .../math/ec/multiplier/NafL2RMultiplier.cs | 34 + .../ec/multiplier/NafL2RMultiplier.cs.meta | 11 + .../math/ec/multiplier/NafR2LMultiplier.cs | 35 + .../ec/multiplier/NafR2LMultiplier.cs.meta | 11 + .../math/ec/multiplier/PreCompInfo.cs | 15 + .../math/ec/multiplier/PreCompInfo.cs.meta | 11 + .../math/ec/multiplier/ReferenceMultiplier.cs | 15 + .../ec/multiplier/ReferenceMultiplier.cs.meta | 11 + .../math/ec/multiplier/ValidityPreCompInfo.cs | 48 + .../ec/multiplier/ValidityPreCompInfo.cs.meta | 11 + .../math/ec/multiplier/WNafL2RMultiplier.cs | 102 + .../ec/multiplier/WNafL2RMultiplier.cs.meta | 11 + .../math/ec/multiplier/WNafPreCompInfo.cs | 50 + .../ec/multiplier/WNafPreCompInfo.cs.meta | 11 + .../math/ec/multiplier/WNafUtilities.cs | 583 + .../math/ec/multiplier/WNafUtilities.cs.meta | 11 + .../math/ec/multiplier/WTauNafMultiplier.cs | 142 + .../ec/multiplier/WTauNafMultiplier.cs.meta | 11 + .../math/ec/multiplier/WTauNafPreCompInfo.cs | 28 + .../ec/multiplier/WTauNafPreCompInfo.cs.meta | 11 + .../multiplier/ZSignedDigitL2RMultiplier.cs | 33 + .../ZSignedDigitL2RMultiplier.cs.meta | 11 + .../multiplier/ZSignedDigitR2LMultiplier.cs | 34 + .../ZSignedDigitR2LMultiplier.cs.meta | 11 + .../SecureProtocol/math/ec/rfc7748.meta | 8 + .../SecureProtocol/math/ec/rfc7748/X25519.cs | 163 + .../math/ec/rfc7748/X25519.cs.meta | 11 + .../math/ec/rfc7748/X25519Field.cs | 643 + .../math/ec/rfc7748/X25519Field.cs.meta | 11 + .../SecureProtocol/math/ec/rfc7748/X448.cs | 170 + .../math/ec/rfc7748/X448.cs.meta | 11 + .../math/ec/rfc7748/X448Field.cs | 1005 ++ .../math/ec/rfc7748/X448Field.cs.meta | 11 + .../SecureProtocol/math/ec/rfc8032.meta | 8 + .../SecureProtocol/math/ec/rfc8032/Ed25519.cs | 1097 ++ .../math/ec/rfc8032/Ed25519.cs.meta | 11 + .../SecureProtocol/math/ec/rfc8032/Ed448.cs | 1160 ++ .../math/ec/rfc8032/Ed448.cs.meta | 11 + .../BestHTTP/SecureProtocol/math/field.meta | 8 + .../SecureProtocol/math/field/FiniteFields.cs | 58 + .../math/field/FiniteFields.cs.meta | 11 + .../math/field/GF2Polynomial.cs | 50 + .../math/field/GF2Polynomial.cs.meta | 11 + .../field/GenericPolynomialExtensionField.cs | 67 + .../GenericPolynomialExtensionField.cs.meta | 11 + .../math/field/IExtensionField.cs | 16 + .../math/field/IExtensionField.cs.meta | 11 + .../SecureProtocol/math/field/IFiniteField.cs | 15 + .../math/field/IFiniteField.cs.meta | 11 + .../SecureProtocol/math/field/IPolynomial.cs | 19 + .../math/field/IPolynomial.cs.meta | 11 + .../math/field/IPolynomialExtensionField.cs | 14 + .../field/IPolynomialExtensionField.cs.meta | 11 + .../SecureProtocol/math/field/PrimeField.cs | 48 + .../math/field/PrimeField.cs.meta | 11 + .../BestHTTP/SecureProtocol/math/raw.meta | 8 + .../SecureProtocol/math/raw/Interleave.cs | 182 + .../math/raw/Interleave.cs.meta | 11 + .../BestHTTP/SecureProtocol/math/raw/Mod.cs | 190 + .../SecureProtocol/math/raw/Mod.cs.meta | 11 + .../BestHTTP/SecureProtocol/math/raw/Nat.cs | 1157 ++ .../SecureProtocol/math/raw/Nat.cs.meta | 11 + .../SecureProtocol/math/raw/Nat128.cs | 874 ++ .../SecureProtocol/math/raw/Nat128.cs.meta | 11 + .../SecureProtocol/math/raw/Nat160.cs | 887 ++ .../SecureProtocol/math/raw/Nat160.cs.meta | 11 + .../SecureProtocol/math/raw/Nat192.cs | 1069 ++ .../SecureProtocol/math/raw/Nat192.cs.meta | 11 + .../SecureProtocol/math/raw/Nat224.cs | 1191 ++ .../SecureProtocol/math/raw/Nat224.cs.meta | 11 + .../SecureProtocol/math/raw/Nat256.cs | 1411 ++ .../SecureProtocol/math/raw/Nat256.cs.meta | 11 + .../SecureProtocol/math/raw/Nat320.cs | 111 + .../SecureProtocol/math/raw/Nat320.cs.meta | 11 + .../SecureProtocol/math/raw/Nat384.cs | 50 + .../SecureProtocol/math/raw/Nat384.cs.meta | 11 + .../SecureProtocol/math/raw/Nat448.cs | 115 + .../SecureProtocol/math/raw/Nat448.cs.meta | 11 + .../SecureProtocol/math/raw/Nat512.cs | 50 + .../SecureProtocol/math/raw/Nat512.cs.meta | 11 + .../SecureProtocol/math/raw/Nat576.cs | 119 + .../SecureProtocol/math/raw/Nat576.cs.meta | 11 + .../BestHTTP/SecureProtocol/ocsp.meta | 9 + .../SecureProtocol/ocsp/BasicOCSPResp.cs | 224 + .../SecureProtocol/ocsp/BasicOCSPResp.cs.meta | 11 + .../ocsp/BasicOCSPRespGenerator.cs | 317 + .../ocsp/BasicOCSPRespGenerator.cs.meta | 11 + .../SecureProtocol/ocsp/CertificateID.cs | 145 + .../SecureProtocol/ocsp/CertificateID.cs.meta | 11 + .../SecureProtocol/ocsp/CertificateStatus.cs | 13 + .../ocsp/CertificateStatus.cs.meta | 11 + .../SecureProtocol/ocsp/OCSPException.cs | 32 + .../SecureProtocol/ocsp/OCSPException.cs.meta | 11 + .../BestHTTP/SecureProtocol/ocsp/OCSPReq.cs | 272 + .../SecureProtocol/ocsp/OCSPReq.cs.meta | 11 + .../SecureProtocol/ocsp/OCSPReqGenerator.cs | 247 + .../ocsp/OCSPReqGenerator.cs.meta | 11 + .../BestHTTP/SecureProtocol/ocsp/OCSPResp.cs | 104 + .../SecureProtocol/ocsp/OCSPResp.cs.meta | 11 + .../SecureProtocol/ocsp/OCSPRespGenerator.cs | 58 + .../ocsp/OCSPRespGenerator.cs.meta | 11 + .../SecureProtocol/ocsp/OCSPRespStatus.cs | 26 + .../ocsp/OCSPRespStatus.cs.meta | 11 + .../BestHTTP/SecureProtocol/ocsp/OCSPUtil.cs | 140 + .../SecureProtocol/ocsp/OCSPUtil.cs.meta | 11 + .../BestHTTP/SecureProtocol/ocsp/Req.cs | 42 + .../BestHTTP/SecureProtocol/ocsp/Req.cs.meta | 11 + .../BestHTTP/SecureProtocol/ocsp/RespData.cs | 64 + .../SecureProtocol/ocsp/RespData.cs.meta | 11 + .../BestHTTP/SecureProtocol/ocsp/RespID.cs | 76 + .../SecureProtocol/ocsp/RespID.cs.meta | 11 + .../SecureProtocol/ocsp/RevokedStatus.cs | 62 + .../SecureProtocol/ocsp/RevokedStatus.cs.meta | 11 + .../SecureProtocol/ocsp/SingleResp.cs | 85 + .../SecureProtocol/ocsp/SingleResp.cs.meta | 11 + .../SecureProtocol/ocsp/UnknownStatus.cs | 19 + .../SecureProtocol/ocsp/UnknownStatus.cs.meta | 11 + .../BestHTTP/SecureProtocol/openssl.meta | 9 + .../openssl/EncryptionException.cs | 29 + .../openssl/EncryptionException.cs.meta | 11 + .../SecureProtocol/openssl/IPasswordFinder.cs | 13 + .../openssl/IPasswordFinder.cs.meta | 11 + .../openssl/MiscPemGenerator.cs | 279 + .../openssl/MiscPemGenerator.cs.meta | 11 + .../SecureProtocol/openssl/PEMException.cs | 29 + .../openssl/PEMException.cs.meta | 11 + .../SecureProtocol/openssl/PEMReader.cs | 405 + .../SecureProtocol/openssl/PEMReader.cs.meta | 11 + .../SecureProtocol/openssl/PEMUtilities.cs | 162 + .../openssl/PEMUtilities.cs.meta | 11 + .../SecureProtocol/openssl/PEMWriter.cs | 65 + .../SecureProtocol/openssl/PEMWriter.cs.meta | 11 + .../openssl/PasswordException.cs | 29 + .../openssl/PasswordException.cs.meta | 11 + .../SecureProtocol/openssl/Pkcs8Generator.cs | 115 + .../openssl/Pkcs8Generator.cs.meta | 11 + .../BestHTTP/SecureProtocol/pkcs.meta | 9 + .../SecureProtocol/pkcs/AsymmetricKeyEntry.cs | 64 + .../pkcs/AsymmetricKeyEntry.cs.meta | 11 + .../pkcs/EncryptedPrivateKeyInfoFactory.cs | 68 + .../EncryptedPrivateKeyInfoFactory.cs.meta | 11 + .../SecureProtocol/pkcs/PKCS12StoreBuilder.cs | 45 + .../pkcs/PKCS12StoreBuilder.cs.meta | 11 + .../pkcs/Pkcs10CertificationRequest.cs | 471 + .../pkcs/Pkcs10CertificationRequest.cs.meta | 11 + .../Pkcs10CertificationRequestDelaySigned.cs | 154 + ...s10CertificationRequestDelaySigned.cs.meta | 11 + .../SecureProtocol/pkcs/Pkcs12Entry.cs | 68 + .../SecureProtocol/pkcs/Pkcs12Entry.cs.meta | 11 + .../SecureProtocol/pkcs/Pkcs12Store.cs | 1108 ++ .../SecureProtocol/pkcs/Pkcs12Store.cs.meta | 11 + .../SecureProtocol/pkcs/Pkcs12Utilities.cs | 81 + .../pkcs/Pkcs12Utilities.cs.meta | 11 + .../pkcs/PrivateKeyInfoFactory.cs | 253 + .../pkcs/PrivateKeyInfoFactory.cs.meta | 11 + .../pkcs/X509CertificateEntry.cs | 64 + .../pkcs/X509CertificateEntry.cs.meta | 11 + .../BestHTTP/SecureProtocol/pkix.meta | 9 + .../SecureProtocol/pkix/CertStatus.cs | 39 + .../SecureProtocol/pkix/CertStatus.cs.meta | 11 + .../pkix/PkixAttrCertChecker.cs | 61 + .../pkix/PkixAttrCertChecker.cs.meta | 11 + .../pkix/PkixAttrCertPathBuilder.cs | 219 + .../pkix/PkixAttrCertPathBuilder.cs.meta | 11 + .../pkix/PkixAttrCertPathValidator.cs | 80 + .../pkix/PkixAttrCertPathValidator.cs.meta | 11 + .../pkix/PkixBuilderParameters.cs | 144 + .../pkix/PkixBuilderParameters.cs.meta | 11 + .../SecureProtocol/pkix/PkixCertPath.cs | 464 + .../SecureProtocol/pkix/PkixCertPath.cs.meta | 11 + .../pkix/PkixCertPathBuilder.cs | 209 + .../pkix/PkixCertPathBuilder.cs.meta | 11 + .../pkix/PkixCertPathBuilderException.cs | 26 + .../pkix/PkixCertPathBuilderException.cs.meta | 11 + .../pkix/PkixCertPathBuilderResult.cs | 49 + .../pkix/PkixCertPathBuilderResult.cs.meta | 11 + .../pkix/PkixCertPathChecker.cs | 103 + .../pkix/PkixCertPathChecker.cs.meta | 11 + .../pkix/PkixCertPathValidator.cs | 452 + .../pkix/PkixCertPathValidator.cs.meta | 11 + .../pkix/PkixCertPathValidatorException.cs | 225 + .../PkixCertPathValidatorException.cs.meta | 11 + .../pkix/PkixCertPathValidatorResult.cs | 73 + .../pkix/PkixCertPathValidatorResult.cs.meta | 11 + .../pkix/PkixCertPathValidatorUtilities.cs | 1212 ++ .../PkixCertPathValidatorUtilities.cs.meta | 11 + .../SecureProtocol/pkix/PkixCrlUtilities.cs | 118 + .../pkix/PkixCrlUtilities.cs.meta | 11 + .../pkix/PkixNameConstraintValidator.cs | 1943 +++ .../pkix/PkixNameConstraintValidator.cs.meta | 11 + .../PkixNameConstraintValidatorException.cs | 20 + ...ixNameConstraintValidatorException.cs.meta | 11 + .../SecureProtocol/pkix/PkixParameters.cs | 897 ++ .../pkix/PkixParameters.cs.meta | 11 + .../SecureProtocol/pkix/PkixPolicyNode.cs | 162 + .../pkix/PkixPolicyNode.cs.meta | 11 + .../SecureProtocol/pkix/ReasonsMask.cs | 100 + .../SecureProtocol/pkix/ReasonsMask.cs.meta | 11 + .../pkix/Rfc3280CertPathUtilities.cs | 2452 ++++ .../pkix/Rfc3280CertPathUtilities.cs.meta | 11 + .../pkix/Rfc3281CertPathUtilities.cs | 612 + .../pkix/Rfc3281CertPathUtilities.cs.meta | 11 + .../SecureProtocol/pkix/TrustAnchor.cs | 263 + .../SecureProtocol/pkix/TrustAnchor.cs.meta | 11 + .../BestHTTP/SecureProtocol/security.meta | 7 + .../security/AgreementUtilities.cs | 128 + .../security/AgreementUtilities.cs.meta | 11 + .../security/CipherUtilities.cs | 764 ++ .../security/CipherUtilities.cs.meta | 11 + .../security/DigestUtilities.cs | 289 + .../security/DigestUtilities.cs.meta | 11 + .../security/DotNetUtilities.cs | 264 + .../security/DotNetUtilities.cs.meta | 11 + .../security/GeneralSecurityException.cs | 33 + .../security/GeneralSecurityException.cs.meta | 11 + .../security/GeneratorUtilities.cs | 394 + .../security/GeneratorUtilities.cs.meta | 11 + .../security/InvalidKeyException.cs | 18 + .../security/InvalidKeyException.cs.meta | 11 + .../security/InvalidParameterException.cs | 18 + .../InvalidParameterException.cs.meta | 11 + .../SecureProtocol/security/KeyException.cs | 18 + .../security/KeyException.cs.meta | 11 + .../SecureProtocol/security/MacUtilities.cs | 270 + .../security/MacUtilities.cs.meta | 11 + .../security/NoSuchAlgorithmException.cs | 19 + .../security/NoSuchAlgorithmException.cs.meta | 11 + .../security/ParameterUtilities.cs | 340 + .../security/ParameterUtilities.cs.meta | 11 + .../SecureProtocol/security/PbeUtilities.cs | 667 + .../security/PbeUtilities.cs.meta | 11 + .../security/PrivateKeyFactory.cs | 259 + .../security/PrivateKeyFactory.cs.meta | 11 + .../security/PublicKeyFactory.cs | 287 + .../security/PublicKeyFactory.cs.meta | 11 + .../SecureProtocol/security/SecureRandom.cs | 266 + .../security/SecureRandom.cs.meta | 11 + .../security/SecurityUtilityException.cs | 40 + .../security/SecurityUtilityException.cs.meta | 11 + .../security/SignatureException.cs | 18 + .../security/SignatureException.cs.meta | 11 + .../security/SignerUtilities.cs | 640 + .../security/SignerUtilities.cs.meta | 11 + .../security/WrapperUtilities.cs | 157 + .../security/WrapperUtilities.cs.meta | 11 + .../SecureProtocol/security/cert.meta | 8 + .../cert/CertificateEncodingException.cs | 18 + .../cert/CertificateEncodingException.cs.meta | 11 + .../security/cert/CertificateException.cs | 18 + .../cert/CertificateException.cs.meta | 11 + .../cert/CertificateExpiredException.cs | 18 + .../cert/CertificateExpiredException.cs.meta | 11 + .../cert/CertificateNotYetValidException.cs | 18 + .../CertificateNotYetValidException.cs.meta | 11 + .../cert/CertificateParsingException.cs | 18 + .../cert/CertificateParsingException.cs.meta | 11 + .../security/cert/CrlException.cs | 18 + .../security/cert/CrlException.cs.meta | 11 + .../BestHTTP/BestHTTP/SecureProtocol/tsp.meta | 9 + .../SecureProtocol/tsp/GenTimeAccuracy.cs | 37 + .../tsp/GenTimeAccuracy.cs.meta | 11 + .../SecureProtocol/tsp/TSPAlgorithms.cs | 58 + .../SecureProtocol/tsp/TSPAlgorithms.cs.meta | 11 + .../SecureProtocol/tsp/TSPException.cs | 32 + .../SecureProtocol/tsp/TSPException.cs.meta | 11 + .../BestHTTP/SecureProtocol/tsp/TSPUtil.cs | 218 + .../SecureProtocol/tsp/TSPUtil.cs.meta | 11 + .../tsp/TSPValidationException.cs | 48 + .../tsp/TSPValidationException.cs.meta | 11 + .../SecureProtocol/tsp/TimeStampRequest.cs | 190 + .../tsp/TimeStampRequest.cs.meta | 11 + .../tsp/TimeStampRequestGenerator.cs | 143 + .../tsp/TimeStampRequestGenerator.cs.meta | 11 + .../SecureProtocol/tsp/TimeStampResponse.cs | 188 + .../tsp/TimeStampResponse.cs.meta | 11 + .../tsp/TimeStampResponseGenerator.cs | 213 + .../tsp/TimeStampResponseGenerator.cs.meta | 11 + .../SecureProtocol/tsp/TimeStampToken.cs | 309 + .../SecureProtocol/tsp/TimeStampToken.cs.meta | 11 + .../tsp/TimeStampTokenGenerator.cs | 249 + .../tsp/TimeStampTokenGenerator.cs.meta | 11 + .../SecureProtocol/tsp/TimeStampTokenInfo.cs | 111 + .../tsp/TimeStampTokenInfo.cs.meta | 11 + .../BestHTTP/SecureProtocol/util.meta | 7 + .../BestHTTP/SecureProtocol/util/Arrays.cs | 729 + .../SecureProtocol/util/Arrays.cs.meta | 11 + .../SecureProtocol/util/BigIntegers.cs | 99 + .../SecureProtocol/util/BigIntegers.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/Enums.cs | 82 + .../SecureProtocol/util/Enums.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/IMemoable.cs | 33 + .../SecureProtocol/util/IMemoable.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/Integers.cs | 33 + .../SecureProtocol/util/Integers.cs.meta | 11 + .../util/MemoableResetException.cs | 31 + .../util/MemoableResetException.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/Platform.cs | 233 + .../SecureProtocol/util/Platform.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/Strings.cs | 107 + .../SecureProtocol/util/Strings.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/Times.cs | 18 + .../SecureProtocol/util/Times.cs.meta | 11 + .../SecureProtocol/util/TypeExtensions.cs | 21 + .../util/TypeExtensions.cs.meta | 11 + .../SecureProtocol/util/collections.meta | 8 + .../util/collections/CollectionUtilities.cs | 79 + .../collections/CollectionUtilities.cs.meta | 11 + .../util/collections/EmptyEnumerable.cs | 48 + .../util/collections/EmptyEnumerable.cs.meta | 11 + .../util/collections/EnumerableProxy.cs | 29 + .../util/collections/EnumerableProxy.cs.meta | 11 + .../util/collections/HashSet.cs | 103 + .../util/collections/HashSet.cs.meta | 11 + .../SecureProtocol/util/collections/ISet.cs | 23 + .../util/collections/ISet.cs.meta | 11 + .../util/collections/LinkedDictionary.cs | 182 + .../util/collections/LinkedDictionary.cs.meta | 11 + .../collections/UnmodifiableDictionary.cs | 68 + .../UnmodifiableDictionary.cs.meta | 11 + .../UnmodifiableDictionaryProxy.cs | 70 + .../UnmodifiableDictionaryProxy.cs.meta | 11 + .../util/collections/UnmodifiableList.cs | 71 + .../util/collections/UnmodifiableList.cs.meta | 11 + .../util/collections/UnmodifiableListProxy.cs | 65 + .../collections/UnmodifiableListProxy.cs.meta | 11 + .../util/collections/UnmodifiableSet.cs | 63 + .../util/collections/UnmodifiableSet.cs.meta | 11 + .../util/collections/UnmodifiableSetProxy.cs | 60 + .../collections/UnmodifiableSetProxy.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/date.meta | 8 + .../util/date/DateTimeObject.cs | 29 + .../util/date/DateTimeObject.cs.meta | 11 + .../util/date/DateTimeUtilities.cs | 51 + .../util/date/DateTimeUtilities.cs.meta | 11 + .../SecureProtocol/util/encoders.meta | 8 + .../SecureProtocol/util/encoders/Base64.cs | 124 + .../util/encoders/Base64.cs.meta | 11 + .../util/encoders/Base64Encoder.cs | 331 + .../util/encoders/Base64Encoder.cs.meta | 11 + .../util/encoders/BufferedDecoder.cs | 121 + .../util/encoders/BufferedDecoder.cs.meta | 11 + .../util/encoders/BufferedEncoder.cs | 121 + .../util/encoders/BufferedEncoder.cs.meta | 11 + .../SecureProtocol/util/encoders/Hex.cs | 134 + .../SecureProtocol/util/encoders/Hex.cs.meta | 11 + .../util/encoders/HexEncoder.cs | 180 + .../util/encoders/HexEncoder.cs.meta | 11 + .../util/encoders/HexTranslator.cs | 112 + .../util/encoders/HexTranslator.cs.meta | 11 + .../SecureProtocol/util/encoders/IEncoder.cs | 22 + .../util/encoders/IEncoder.cs.meta | 11 + .../util/encoders/Translator.cs | 23 + .../util/encoders/Translator.cs.meta | 11 + .../SecureProtocol/util/encoders/UrlBase64.cs | 131 + .../util/encoders/UrlBase64.cs.meta | 11 + .../util/encoders/UrlBase64Encoder.cs | 35 + .../util/encoders/UrlBase64Encoder.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/io.meta | 8 + .../SecureProtocol/util/io/BaseInputStream.cs | 68 + .../util/io/BaseInputStream.cs.meta | 11 + .../util/io/BaseOutputStream.cs | 73 + .../util/io/BaseOutputStream.cs.meta | 11 + .../SecureProtocol/util/io/FilterStream.cs | 82 + .../util/io/FilterStream.cs.meta | 11 + .../util/io/NullOutputStream.cs | 22 + .../util/io/NullOutputStream.cs.meta | 11 + .../SecureProtocol/util/io/PushbackStream.cs | 56 + .../util/io/PushbackStream.cs.meta | 11 + .../util/io/StreamOverflowException.cs | 34 + .../util/io/StreamOverflowException.cs.meta | 11 + .../SecureProtocol/util/io/Streams.cs | 129 + .../SecureProtocol/util/io/Streams.cs.meta | 11 + .../SecureProtocol/util/io/TeeInputStream.cs | 68 + .../util/io/TeeInputStream.cs.meta | 11 + .../SecureProtocol/util/io/TeeOutputStream.cs | 56 + .../util/io/TeeOutputStream.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/io/pem.meta | 8 + .../util/io/pem/PemGenerationException.cs | 33 + .../io/pem/PemGenerationException.cs.meta | 11 + .../SecureProtocol/util/io/pem/PemHeader.cs | 59 + .../util/io/pem/PemHeader.cs.meta | 11 + .../SecureProtocol/util/io/pem/PemObject.cs | 51 + .../util/io/pem/PemObject.cs.meta | 11 + .../util/io/pem/PemObjectGenerator.cs | 17 + .../util/io/pem/PemObjectGenerator.cs.meta | 11 + .../util/io/pem/PemObjectParser.cs | 21 + .../util/io/pem/PemObjectParser.cs.meta | 11 + .../SecureProtocol/util/io/pem/PemReader.cs | 100 + .../util/io/pem/PemReader.cs.meta | 11 + .../SecureProtocol/util/io/pem/PemWriter.cs | 124 + .../util/io/pem/PemWriter.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/net.meta | 8 + .../SecureProtocol/util/net/IPAddress.cs | 201 + .../SecureProtocol/util/net/IPAddress.cs.meta | 11 + .../BestHTTP/SecureProtocol/util/zlib.meta | 8 + .../SecureProtocol/util/zlib/Adler32.cs | 92 + .../SecureProtocol/util/zlib/Adler32.cs.meta | 11 + .../SecureProtocol/util/zlib/Deflate.cs | 1644 +++ .../SecureProtocol/util/zlib/Deflate.cs.meta | 11 + .../SecureProtocol/util/zlib/InfBlocks.cs | 622 + .../util/zlib/InfBlocks.cs.meta | 11 + .../SecureProtocol/util/zlib/InfCodes.cs | 615 + .../SecureProtocol/util/zlib/InfCodes.cs.meta | 11 + .../SecureProtocol/util/zlib/InfTree.cs | 527 + .../SecureProtocol/util/zlib/InfTree.cs.meta | 11 + .../SecureProtocol/util/zlib/Inflate.cs | 391 + .../SecureProtocol/util/zlib/Inflate.cs.meta | 11 + .../SecureProtocol/util/zlib/JZlib.cs | 77 + .../SecureProtocol/util/zlib/JZlib.cs.meta | 11 + .../SecureProtocol/util/zlib/StaticTree.cs | 156 + .../util/zlib/StaticTree.cs.meta | 11 + .../util/zlib/ZDeflaterOutputStream.cs | 175 + .../util/zlib/ZDeflaterOutputStream.cs.meta | 11 + .../util/zlib/ZInflaterInputStream.cs | 144 + .../util/zlib/ZInflaterInputStream.cs.meta | 11 + .../SecureProtocol/util/zlib/ZInputStream.cs | 242 + .../util/zlib/ZInputStream.cs.meta | 11 + .../SecureProtocol/util/zlib/ZOutputStream.cs | 269 + .../util/zlib/ZOutputStream.cs.meta | 11 + .../SecureProtocol/util/zlib/ZStream.cs | 218 + .../SecureProtocol/util/zlib/ZStream.cs.meta | 11 + .../SecureProtocol/util/zlib/ZTree.cs | 371 + .../SecureProtocol/util/zlib/ZTree.cs.meta | 11 + .../BestHTTP/SecureProtocol/x509.meta | 7 + .../x509/AttributeCertificateHolder.cs | 446 + .../x509/AttributeCertificateHolder.cs.meta | 11 + .../x509/AttributeCertificateIssuer.cs | 203 + .../x509/AttributeCertificateIssuer.cs.meta | 11 + .../x509/IX509AttributeCertificate.cs | 61 + .../x509/IX509AttributeCertificate.cs.meta | 11 + .../SecureProtocol/x509/IX509Extension.cs | 31 + .../x509/IX509Extension.cs.meta | 11 + .../BestHTTP/SecureProtocol/x509/PEMParser.cs | 99 + .../SecureProtocol/x509/PEMParser.cs.meta | 11 + .../SecureProtocol/x509/PrincipalUtil.cs | 74 + .../SecureProtocol/x509/PrincipalUtil.cs.meta | 11 + .../x509/SubjectPublicKeyInfoFactory.cs | 217 + .../x509/SubjectPublicKeyInfoFactory.cs.meta | 11 + .../SecureProtocol/x509/X509AttrCertParser.cs | 177 + .../x509/X509AttrCertParser.cs.meta | 11 + .../SecureProtocol/x509/X509Attribute.cs | 80 + .../SecureProtocol/x509/X509Attribute.cs.meta | 11 + .../SecureProtocol/x509/X509CertPairParser.cs | 99 + .../x509/X509CertPairParser.cs.meta | 11 + .../SecureProtocol/x509/X509Certificate.cs | 608 + .../x509/X509Certificate.cs.meta | 11 + .../x509/X509CertificatePair.cs | 127 + .../x509/X509CertificatePair.cs.meta | 11 + .../x509/X509CertificateParser.cs | 187 + .../x509/X509CertificateParser.cs.meta | 11 + .../BestHTTP/SecureProtocol/x509/X509Crl.cs | 430 + .../SecureProtocol/x509/X509Crl.cs.meta | 11 + .../SecureProtocol/x509/X509CrlEntry.cs | 205 + .../SecureProtocol/x509/X509CrlEntry.cs.meta | 11 + .../SecureProtocol/x509/X509CrlParser.cs | 199 + .../SecureProtocol/x509/X509CrlParser.cs.meta | 11 + .../SecureProtocol/x509/X509ExtensionBase.cs | 86 + .../x509/X509ExtensionBase.cs.meta | 11 + .../SecureProtocol/x509/X509KeyUsage.cs | 63 + .../SecureProtocol/x509/X509KeyUsage.cs.meta | 11 + .../SecureProtocol/x509/X509SignatureUtil.cs | 132 + .../x509/X509SignatureUtil.cs.meta | 11 + .../SecureProtocol/x509/X509Utilities.cs | 191 + .../SecureProtocol/x509/X509Utilities.cs.meta | 11 + .../x509/X509V1CertificateGenerator.cs | 214 + .../x509/X509V1CertificateGenerator.cs.meta | 11 + .../x509/X509V2AttributeCertificate.cs | 284 + .../x509/X509V2AttributeCertificate.cs.meta | 11 + .../X509V2AttributeCertificateGenerator.cs | 207 + ...509V2AttributeCertificateGenerator.cs.meta | 11 + .../SecureProtocol/x509/X509V2CRLGenerator.cs | 282 + .../x509/X509V2CRLGenerator.cs.meta | 11 + .../x509/X509V3CertificateGenerator.cs | 348 + .../x509/X509V3CertificateGenerator.cs.meta | 11 + .../SecureProtocol/x509/extension.meta | 8 + .../AuthorityKeyIdentifierStructure.cs | 106 + .../AuthorityKeyIdentifierStructure.cs.meta | 11 + .../SubjectKeyIdentifierStructure.cs | 53 + .../SubjectKeyIdentifierStructure.cs.meta | 11 + .../x509/extension/X509ExtensionUtil.cs | 95 + .../x509/extension/X509ExtensionUtil.cs.meta | 11 + .../BestHTTP/SecureProtocol/x509/store.meta | 8 + .../x509/store/IX509Selector.cs | 19 + .../x509/store/IX509Selector.cs.meta | 11 + .../SecureProtocol/x509/store/IX509Store.cs | 15 + .../x509/store/IX509Store.cs.meta | 11 + .../x509/store/IX509StoreParameters.cs | 12 + .../x509/store/IX509StoreParameters.cs.meta | 11 + .../x509/store/NoSuchStoreException.cs | 32 + .../x509/store/NoSuchStoreException.cs.meta | 11 + .../x509/store/X509AttrCertStoreSelector.cs | 380 + .../store/X509AttrCertStoreSelector.cs.meta | 11 + .../x509/store/X509CertPairStoreSelector.cs | 96 + .../store/X509CertPairStoreSelector.cs.meta | 11 + .../x509/store/X509CertStoreSelector.cs | 350 + .../x509/store/X509CertStoreSelector.cs.meta | 11 + .../x509/store/X509CollectionStore.cs | 55 + .../x509/store/X509CollectionStore.cs.meta | 11 + .../store/X509CollectionStoreParameters.cs | 64 + .../X509CollectionStoreParameters.cs.meta | 11 + .../x509/store/X509CrlStoreSelector.cs | 287 + .../x509/store/X509CrlStoreSelector.cs.meta | 11 + .../x509/store/X509StoreException.cs | 32 + .../x509/store/X509StoreException.cs.meta | 11 + .../x509/store/X509StoreFactory.cs | 69 + .../x509/store/X509StoreFactory.cs.meta | 11 + .../BestHTTP/BestHTTP/ServerSentEvents.meta | 7 + .../BestHTTP/ServerSentEvents/EventSource.cs | 649 + .../ServerSentEvents/EventSource.cs.meta | 10 + .../ServerSentEvents/EventSourceResponse.cs | 390 + .../EventSourceResponse.cs.meta | 10 + .../BestHTTP/ServerSentEvents/Message.cs | 36 + .../BestHTTP/ServerSentEvents/Message.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/SignalR.meta | 7 + .../BestHTTP/SignalR/Authentication.meta | 7 + .../Authentication/IAuthenticationProvider.cs | 37 + .../IAuthenticationProvider.cs.meta | 10 + .../BestHTTP/BestHTTP/SignalR/Connection.cs | 1306 ++ .../BestHTTP/SignalR/Connection.cs.meta | 10 + .../BestHTTP/BestHTTP/SignalR/Enums.cs | 196 + .../BestHTTP/BestHTTP/SignalR/Enums.cs.meta | 10 + .../BestHTTP/BestHTTP/SignalR/Hubs.meta | 7 + .../BestHTTP/BestHTTP/SignalR/Hubs/Hub.cs | 391 + .../BestHTTP/SignalR/Hubs/Hub.cs.meta | 10 + .../BestHTTP/BestHTTP/SignalR/Hubs/IHub.cs | 24 + .../BestHTTP/SignalR/Hubs/IHub.cs.meta | 10 + .../BestHTTP/SignalR/JsonEncoders.meta | 7 + .../JsonEncoders/DefaultJsonEncoder.cs | 24 + .../JsonEncoders/DefaultJsonEncoder.cs.meta | 10 + .../SignalR/JsonEncoders/IJsonEncoder.cs | 24 + .../SignalR/JsonEncoders/IJsonEncoder.cs.meta | 10 + .../BestHTTP/BestHTTP/SignalR/Messages.meta | 7 + .../SignalR/Messages/ClientMessage.cs | 71 + .../SignalR/Messages/ClientMessage.cs.meta | 10 + .../SignalR/Messages/IServerMessage.cs | 19 + .../SignalR/Messages/IServerMessage.cs.meta | 10 + .../SignalR/Messages/ServerMessages.cs | 354 + .../SignalR/Messages/ServerMessages.cs.meta | 10 + .../BestHTTP/SignalR/NegotiationData.cs | 276 + .../BestHTTP/SignalR/NegotiationData.cs.meta | 10 + .../BestHTTP/BestHTTP/SignalR/Transports.meta | 7 + .../SignalR/Transports/PollingTransport.cs | 256 + .../Transports/PollingTransport.cs.meta | 10 + .../Transports/PostSendTransportBase.cs | 103 + .../Transports/PostSendTransportBase.cs.meta | 10 + .../Transports/ServerSentEventsTransport.cs | 171 + .../ServerSentEventsTransport.cs.meta | 10 + .../SignalR/Transports/TransportBase.cs | 386 + .../SignalR/Transports/TransportBase.cs.meta | 10 + .../SignalR/Transports/WebSocketTransport.cs | 173 + .../Transports/WebSocketTransport.cs.meta | 10 + .../BestHTTP/BestHTTP/SignalRCore.meta | 10 + .../BestHTTP/SignalRCore/Authentication.meta | 8 + .../DefaultAccessTokenAuthenticator.cs | 59 + .../DefaultAccessTokenAuthenticator.cs.meta | 11 + .../BestHTTP/SignalRCore/HelperClasses.cs | 148 + .../SignalRCore/HelperClasses.cs.meta | 13 + .../BestHTTP/SignalRCore/HubConnection.cs | 741 + .../SignalRCore/HubConnection.cs.meta | 13 + .../SignalRCore/IAuthenticationProvider.cs | 44 + .../IAuthenticationProvider.cs.meta | 13 + .../BestHTTP/SignalRCore/JsonProtocol.cs | 169 + .../BestHTTP/SignalRCore/JsonProtocol.cs.meta | 13 + .../BestHTTP/SignalRCore/Messages.meta | 10 + .../SignalRCore/Messages/Invocation.cs | 26 + .../SignalRCore/Messages/Invocation.cs.meta | 13 + .../BestHTTP/SignalRCore/Messages/Message.cs | 84 + .../SignalRCore/Messages/Message.cs.meta | 13 + .../SignalRCore/Messages/NegotiationResult.cs | 142 + .../Messages/NegotiationResult.cs.meta | 12 + .../BestHTTP/SignalRCore/Transports.meta | 10 + .../Transports/WebsocketTransport.cs | 247 + .../Transports/WebsocketTransport.cs.meta | 13 + .../Plugins/BestHTTP/BestHTTP/SocketIO.meta | 7 + .../BestHTTP/BestHTTP/SocketIO/Enums.cs | 105 + .../BestHTTP/BestHTTP/SocketIO/Enums.cs.meta | 10 + .../BestHTTP/BestHTTP/SocketIO/Error.cs | 23 + .../BestHTTP/BestHTTP/SocketIO/Error.cs.meta | 10 + .../BestHTTP/BestHTTP/SocketIO/Events.meta | 7 + .../SocketIO/Events/EventDescriptor.cs | 97 + .../SocketIO/Events/EventDescriptor.cs.meta | 10 + .../BestHTTP/SocketIO/Events/EventNames.cs | 48 + .../SocketIO/Events/EventNames.cs.meta | 10 + .../BestHTTP/SocketIO/Events/EventTable.cs | 154 + .../SocketIO/Events/EventTable.cs.meta | 10 + .../BestHTTP/SocketIO/HandshakeData.cs | 101 + .../BestHTTP/SocketIO/HandshakeData.cs.meta | 10 + .../BestHTTP/BestHTTP/SocketIO/Interfaces.cs | 40 + .../BestHTTP/SocketIO/Interfaces.cs.meta | 10 + .../BestHTTP/SocketIO/JsonEncoders.meta | 7 + .../JsonEncoders/DefaultJSonEncoder.cs | 25 + .../JsonEncoders/DefaultJSonEncoder.cs.meta | 10 + .../SocketIO/JsonEncoders/IJSonEncoder.cs | 24 + .../JsonEncoders/IJSonEncoder.cs.meta | 10 + .../BestHTTP/BestHTTP/SocketIO/Packet.cs | 611 + .../BestHTTP/BestHTTP/SocketIO/Packet.cs.meta | 10 + .../BestHTTP/BestHTTP/SocketIO/Socket.cs | 475 + .../BestHTTP/BestHTTP/SocketIO/Socket.cs.meta | 10 + .../BestHTTP/SocketIO/SocketManager.cs | 684 + .../BestHTTP/SocketIO/SocketManager.cs.meta | 10 + .../BestHTTP/SocketIO/SocketOptions.cs | 158 + .../BestHTTP/SocketIO/SocketOptions.cs.meta | 10 + .../BestHTTP/SocketIO/Transports.meta | 7 + .../SocketIO/Transports/ITransport.cs | 104 + .../SocketIO/Transports/ITransport.cs.meta | 10 + .../SocketIO/Transports/PollingTransport.cs | 449 + .../Transports/PollingTransport.cs.meta | 10 + .../SocketIO/Transports/WebSocketTransport.cs | 369 + .../Transports/WebSocketTransport.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/Statistics.meta | 7 + .../BestHTTP/Statistics/Statistics.cs | 90 + .../BestHTTP/Statistics/Statistics.cs.meta | 10 + .../Plugins/BestHTTP/BestHTTP/WebSocket.meta | 7 + .../BestHTTP/WebSocket/Extensions.meta | 7 + .../WebSocket/Extensions/IExtension.cs | 41 + .../WebSocket/Extensions/IExtension.cs.meta | 10 + .../Extensions/PerMessageCompression.cs | 338 + .../Extensions/PerMessageCompression.cs.meta | 10 + .../BestHTTP/BestHTTP/WebSocket/Frames.meta | 7 + .../WebSocket/Frames/WebSocketFrame.cs | 199 + .../WebSocket/Frames/WebSocketFrame.cs.meta | 10 + .../WebSocket/Frames/WebSocketFrameReader.cs | 229 + .../Frames/WebSocketFrameReader.cs.meta | 10 + .../WebSocket/Frames/WebSocketFrameTypes.cs | 48 + .../Frames/WebSocketFrameTypes.cs.meta | 10 + .../BestHTTP/BestHTTP/WebSocket/WebSocket.cs | 836 ++ .../BestHTTP/WebSocket/WebSocket.cs.meta | 10 + .../BestHTTP/WebSocket/WebSocketResponse.cs | 739 + .../WebSocket/WebSocketResponse.cs.meta | 10 + .../WebSocket/WebSocketStatusCodes.cs | 83 + .../WebSocket/WebSocketStatusCodes.cs.meta | 10 + .../BestHTTP/BestHTTPDocumentationEN.pdf | Bin 0 -> 444035 bytes .../BestHTTP/BestHTTPDocumentationEN.pdf.meta | 38 + JNFrame/Assets/Plugins/BestHTTP/Examples.meta | 7 + .../Plugins/BestHTTP/Examples/HTTP.meta | 7 + .../Examples/HTTP/AssetBundleSample.cs | 195 + .../Examples/HTTP/AssetBundleSample.cs.meta | 10 + .../Examples/HTTP/LargeFileDownloadSample.cs | 244 + .../HTTP/LargeFileDownloadSample.cs.meta | 10 + .../Examples/HTTP/TextureDownloadSample.cs | 181 + .../HTTP/TextureDownloadSample.cs.meta | 10 + .../BestHTTP/Examples/HTTP/UploadStream.cs | 222 + .../Examples/HTTP/UploadStream.cs.meta | 10 + .../Plugins/BestHTTP/Examples/Helpers.meta | 7 + .../BestHTTP/Examples/Helpers/GUIHelper.cs | 101 + .../Examples/Helpers/GUIHelper.cs.meta | 10 + .../Plugins/BestHTTP/Examples/LitJson.meta | 7 + .../BestHTTP/Examples/LitJson/IJsonWrapper.cs | 73 + .../Examples/LitJson/IJsonWrapper.cs.meta | 10 + .../BestHTTP/Examples/LitJson/JsonData.cs | 1004 ++ .../Examples/LitJson/JsonData.cs.meta | 10 + .../Examples/LitJson/JsonException.cs | 60 + .../Examples/LitJson/JsonException.cs.meta | 10 + .../BestHTTP/Examples/LitJson/JsonMapper.cs | 1014 ++ .../Examples/LitJson/JsonMapper.cs.meta | 10 + .../Examples/LitJson/JsonMockWrapper.cs | 105 + .../Examples/LitJson/JsonMockWrapper.cs.meta | 10 + .../BestHTTP/Examples/LitJson/JsonReader.cs | 464 + .../Examples/LitJson/JsonReader.cs.meta | 10 + .../BestHTTP/Examples/LitJson/JsonWriter.cs | 463 + .../Examples/LitJson/JsonWriter.cs.meta | 10 + .../BestHTTP/Examples/LitJson/Lexer.cs | 912 ++ .../BestHTTP/Examples/LitJson/Lexer.cs.meta | 10 + .../BestHTTP/Examples/LitJson/ParserToken.cs | 44 + .../Examples/LitJson/ParserToken.cs.meta | 10 + .../Plugins/BestHTTP/Examples/Plugin.meta | 7 + .../Examples/Plugin/CacheMaintenanceSample.cs | 98 + .../Plugin/CacheMaintenanceSample.cs.meta | 10 + .../BestHTTP/Examples/SampleSelector.cs | 298 + .../BestHTTP/Examples/SampleSelector.cs.meta | 10 + .../BestHTTP/Examples/SampleSelector.unity | 286 + .../Examples/SampleSelector.unity.meta | 6 + .../Plugins/BestHTTP/Examples/SignalR.meta | 7 + .../SignalR/Authentication Providers.meta | 7 + .../SampleCookieAuthentication.cs | 135 + .../SampleCookieAuthentication.cs.meta | 10 + .../SampleHeaderAuthentication.cs | 97 + .../SampleHeaderAuthentication.cs.meta | 10 + .../Examples/SignalR/AuthenticationSample.cs | 210 + .../SignalR/AuthenticationSample.cs.meta | 10 + .../Examples/SignalR/ConnectionAPISample.cs | 275 + .../SignalR/ConnectionAPISample.cs.meta | 10 + .../SignalR/ConnectionStatusSample.cs | 141 + .../SignalR/ConnectionStatusSample.cs.meta | 10 + .../Examples/SignalR/DemoHubSample.cs | 557 + .../Examples/SignalR/DemoHubSample.cs.meta | 10 + .../Examples/SignalR/Json Encoders.meta | 7 + .../Json Encoders/JSonDotnetEncoder.cs | 23 + .../Json Encoders/JSonDotnetEncoder.cs.meta | 10 + .../SignalR/Json Encoders/LitJsonEncoder.cs | 28 + .../Json Encoders/LitJsonEncoder.cs.meta | 10 + .../Examples/SignalR/SimpleStreamingSample.cs | 91 + .../SignalR/SimpleStreamingSample.cs.meta | 10 + .../BestHTTP/Examples/SignalRCore.meta | 10 + .../SignalRCore/Authentication Providers.meta | 8 + .../HeaderAuthenticator.cs | 63 + .../HeaderAuthenticator.cs.meta | 11 + .../Examples/SignalRCore/Encoders.meta | 10 + .../SignalRCore/Encoders/JsonDotNetEncoder.cs | 38 + .../Encoders/JsonDotNetEncoder.cs.meta | 13 + .../SignalRCore/Encoders/LitJsonEncoder.cs | 48 + .../Encoders/LitJsonEncoder.cs.meta | 13 + .../Encoders/MessagePackProtocol.cs | 92 + .../Encoders/MessagePackProtocol.cs.meta | 11 + .../SignalRCore/HubWithAuthorization.cs | 109 + .../SignalRCore/HubWithAuthorization.cs.meta | 11 + .../HubWithPreAuthorizationSample.cs | 224 + .../HubWithPreAuthorizationSample.cs.meta | 11 + .../Examples/SignalRCore/RedirectSample.cs | 175 + .../SignalRCore/RedirectSample.cs.meta | 11 + .../Examples/SignalRCore/TestHubExample.cs | 174 + .../SignalRCore/TestHubExample.cs.meta | 11 + .../Plugins/BestHTTP/Examples/SocketIO.meta | 7 + .../SocketIO/SocketIO Json Encoders.meta | 7 + .../JsonDotNetEncoder.cs | 27 + .../JsonDotNetEncoder.cs.meta | 10 + .../SocketIO Json Encoders/LitJsonEncoder.cs | 30 + .../LitJsonEncoder.cs.meta | 10 + .../Examples/SocketIO/SocketIOChatSample.cs | 321 + .../SocketIO/SocketIOChatSample.cs.meta | 10 + .../Examples/SocketIO/SocketIOWePlaySample.cs | 394 + .../SocketIO/SocketIOWePlaySample.cs.meta | 10 + .../Plugins/BestHTTP/Examples/Websocket.meta | 7 + .../Examples/Websocket/WebSocketSample.cs | 169 + .../Websocket/WebSocketSample.cs.meta | 10 + JNFrame/Assets/Plugins/BestHTTP/Plugins.meta | 7 + .../Plugins/BestHTTP/Plugins/WebGL.meta | 7 + .../Plugins/WebGL/BestHTTP_EventSource.jslib | 154 + .../WebGL/BestHTTP_EventSource.jslib.meta | 21 + .../Plugins/WebGL/BestHTTP_WebRequest.jslib | 259 + .../WebGL/BestHTTP_WebRequest.jslib.meta | 21 + .../Plugins/WebGL/BestHTTP_WebSocket.jslib | 211 + .../WebGL/BestHTTP_WebSocket.jslib.meta | 21 + .../Assets/Plugins/BestHTTP/ReleaseNotes.txt | 627 + .../Plugins/BestHTTP/ReleaseNotes.txt.meta | 38 + .../Unity 2017.2 and up - Editor.csproj | 67 + .../Unity 2017.2 and up - Editor.csproj.meta | 8 + .../BestHTTP/Unity 2017.2 and up - UWP.csproj | 71 + .../Unity 2017.2 and up - UWP.csproj.meta | 9 + .../BestHTTP/Unity 5.x and up - Editor.csproj | 62 + .../Unity 5.x and up - Editor.csproj.meta | 8 + .../Unity 5.x and up - General.csproj | 58 + .../Unity 5.x and up - General.csproj.meta | 8 + .../BestHTTP/Unity 5.x and up - UWP.csproj | 69 + .../Unity 5.x and up - UWP.csproj.meta | 8 + .../BestHTTP/Unity 5.x and up - WebGL.csproj | 58 + .../Unity 5.x and up - WebGL.csproj.meta | 8 + JNFrame/Assets/Plugins/BestHTTP/license.txt | 154 + .../Assets/Plugins/BestHTTP/license.txt.meta | 8 + JNFrame/Assets/Plugins/BestHTTP/link.xml | 11 + JNFrame/Assets/Plugins/BestHTTP/link.xml.meta | 38 + .../Plugins/BestHTTP/link_android_subset.xml | 12 + .../BestHTTP/link_android_subset.xml.meta | 6 + JNFrame/Assets/Plugins/JNGame.meta | 8 + JNFrame/Assets/Plugins/JNGame/JNGame.cs | 18 + JNFrame/Assets/Plugins/JNGame/JNGame.cs.meta | 3 + JNFrame/Assets/Plugins/JNGame/NSystem.cs | 12 + JNFrame/Assets/Plugins/JNGame/NSystem.cs.meta | 3 + JNFrame/Assets/Plugins/JNGame/Network.meta | 8 + .../Assets/Plugins/JNGame/Network/Action.meta | 3 + .../JNGame/Network/Action/NActionEnum.cs | 15 + .../JNGame/Network/Action/NActionEnum.cs.meta | 3 + .../Assets/Plugins/JNGame/Network/Entity.meta | 8 + .../JNGame/Network/Entity/JNetParam.cs | 50 + .../JNGame/Network/Entity/JNetParam.cs.meta | 3 + .../Assets/Plugins/JNGame/Network/JNSocket.cs | 135 + .../Plugins/JNGame/Network/JNSocket.cs.meta | 11 + .../Assets/Plugins/JNGame/Network/Proto.meta | 8 + .../JNGame/Network/Proto/JNSyncMessage.cs | 1092 ++ .../Network/Proto/JNSyncMessage.cs.meta | 11 + .../JNGame/Network/Proto/JNSyncMessage.proto | 27 + .../Network/Proto/JNSyncMessage.proto.meta | 7 + .../JNGame/Network/Proto/NActionMessage.cs | 445 + .../Network/Proto/NActionMessage.cs.meta | 11 + .../JNGame/Network/Proto/NActionMessage.proto | 12 + .../Network/Proto/NActionMessage.proto.meta | 3 + .../Assets/Plugins/JNGame/Network/Util.meta | 3 + .../Plugins/JNGame/Network/Util/NDataUtil.cs | 41 + .../JNGame/Network/Util/NDataUtil.cs.meta | 3 + JNFrame/Assets/Plugins/JNGame/Sync.meta | 8 + JNFrame/Assets/Plugins/JNGame/Sync/Frame.meta | 8 + .../Plugins/JNGame/Sync/Frame/JNSyncFrame.cs | 181 + .../JNGame/Sync/Frame/JNSyncFrame.cs.meta | 3 + .../Plugins/JNGame/Sync/Frame/game.meta | 3 + .../Sync/Frame/game/JNSyncFrameComponent.cs | 51 + .../Frame/game/JNSyncFrameComponent.cs.meta | 3 + JNFrame/Assets/Plugins/JNGame/System.meta | 8 + .../Plugins/JNGame/System/SystemBase.cs | 12 + .../Plugins/JNGame/System/SystemBase.cs.meta | 11 + JNFrame/Assets/Plugins/JNGame/UI.meta | 8 + JNFrame/Assets/Plugins/JNGame/Util.meta | 3 + .../Plugins/JNGame/Util/EventDispatcher.cs | 74 + .../JNGame/Util/EventDispatcher.cs.meta | 3 + .../Assets/Plugins/JNGame/Util/ProtoUtil.cs | 11 + .../Plugins/JNGame/Util/ProtoUtil.cs.meta | 3 + .../Assets/Plugins/JNGame/Util/RandomUtil.cs | 38 + .../Plugins/JNGame/Util/RandomUtil.cs.meta | 3 + .../Assets/Plugins/JNGame/Util/Singleton.cs | 32 + .../Plugins/JNGame/Util/Singleton.cs.meta | 3 + .../Plugins/JNGame/Util/SingletonScene.cs | 85 + .../JNGame/Util/SingletonScene.cs.meta | 3 + JNFrame/Assets/Plugins/JNGame/Util/ToUtil.cs | 19 + .../Assets/Plugins/JNGame/Util/ToUtil.cs.meta | 3 + JNFrame/Assets/Plugins/UniTask.meta | 8 + JNFrame/Assets/Plugins/UniTask/Editor.meta | 8 + .../UniTask/Editor/SplitterGUILayout.cs | 62 + .../UniTask/Editor/SplitterGUILayout.cs.meta | 11 + .../UniTask/Editor/UniTask.Editor.asmdef | 17 + .../UniTask/Editor/UniTask.Editor.asmdef.meta | 7 + .../UniTask/Editor/UniTaskTrackerTreeView.cs | 182 + .../Editor/UniTaskTrackerTreeView.cs.meta | 11 + .../UniTask/Editor/UniTaskTrackerWindow.cs | 209 + .../Editor/UniTaskTrackerWindow.cs.meta | 11 + JNFrame/Assets/Plugins/UniTask/Runtime.meta | 8 + .../Plugins/UniTask/Runtime/AsyncLazy.cs | 245 + .../Plugins/UniTask/Runtime/AsyncLazy.cs.meta | 11 + .../UniTask/Runtime/AsyncReactiveProperty.cs | 644 + .../Runtime/AsyncReactiveProperty.cs.meta | 11 + .../Plugins/UniTask/Runtime/AsyncUnit.cs | 26 + .../Plugins/UniTask/Runtime/AsyncUnit.cs.meta | 11 + .../CancellationTokenEqualityComparer.cs | 23 + .../CancellationTokenEqualityComparer.cs.meta | 11 + .../Runtime/CancellationTokenExtensions.cs | 182 + .../CancellationTokenExtensions.cs.meta | 11 + .../CancellationTokenSourceExtensions.cs | 44 + .../CancellationTokenSourceExtensions.cs.meta | 11 + .../Assets/Plugins/UniTask/Runtime/Channel.cs | 450 + .../Plugins/UniTask/Runtime/Channel.cs.meta | 11 + .../UniTask/Runtime/CompilerServices.meta | 8 + .../AsyncMethodBuilderAttribute.cs | 17 + .../AsyncMethodBuilderAttribute.cs.meta | 11 + .../AsyncUniTaskMethodBuilder.cs | 269 + .../AsyncUniTaskMethodBuilder.cs.meta | 11 + .../AsyncUniTaskVoidMethodBuilder.cs | 137 + .../AsyncUniTaskVoidMethodBuilder.cs.meta | 11 + .../CompilerServices/StateMachineRunner.cs | 380 + .../StateMachineRunner.cs.meta | 11 + .../Runtime/EnumerableAsyncExtensions.cs | 34 + .../Runtime/EnumerableAsyncExtensions.cs.meta | 11 + .../Runtime/EnumeratorAsyncExtensions.cs | 287 + .../Runtime/EnumeratorAsyncExtensions.cs.meta | 11 + .../UniTask/Runtime/ExceptionExtensions.cs | 14 + .../Runtime/ExceptionExtensions.cs.meta | 11 + .../Plugins/UniTask/Runtime/External.meta | 8 + .../Runtime/External/Addressables.meta | 8 + .../AddressablesAsyncExtensions.cs | 433 + .../AddressablesAsyncExtensions.cs.meta | 11 + .../Addressables/UniTask.Addressables.asmdef | 27 + .../UniTask.Addressables.asmdef.meta | 7 + .../UniTask/Runtime/External/DOTween.meta | 8 + .../DOTween/DOTweenAsyncExtensions.cs | 436 + .../DOTween/DOTweenAsyncExtensions.cs.meta | 11 + .../External/DOTween/UniTask.DOTween.asmdef | 22 + .../DOTween/UniTask.DOTween.asmdef.meta | 7 + .../UniTask/Runtime/External/TextMeshPro.meta | 8 + .../TextMeshProAsyncExtensions.InputField.cs | 224 + ...tMeshProAsyncExtensions.InputField.cs.meta | 11 + .../TextMeshPro/TextMeshProAsyncExtensions.cs | 130 + .../TextMeshProAsyncExtensions.cs.meta | 11 + .../TextMeshPro/UniTask.TextMeshPro.asmdef | 22 + .../UniTask.TextMeshPro.asmdef.meta | 7 + .../Runtime/IUniTaskAsyncEnumerable.cs | 91 + .../Runtime/IUniTaskAsyncEnumerable.cs.meta | 11 + .../Plugins/UniTask/Runtime/IUniTaskSource.cs | 124 + .../UniTask/Runtime/IUniTaskSource.cs.meta | 11 + .../Plugins/UniTask/Runtime/Internal.meta | 8 + .../UniTask/Runtime/Internal/ArrayPool.cs | 150 + .../Runtime/Internal/ArrayPool.cs.meta | 12 + .../UniTask/Runtime/Internal/ArrayPoolUtil.cs | 115 + .../Runtime/Internal/ArrayPoolUtil.cs.meta | 12 + .../UniTask/Runtime/Internal/ArrayUtil.cs | 73 + .../Runtime/Internal/ArrayUtil.cs.meta | 12 + .../Runtime/Internal/ContinuationQueue.cs | 225 + .../Internal/ContinuationQueue.cs.meta | 11 + .../Runtime/Internal/DiagnosticsExtensions.cs | 249 + .../Internal/DiagnosticsExtensions.cs.meta | 11 + .../Plugins/UniTask/Runtime/Internal/Error.cs | 79 + .../UniTask/Runtime/Internal/Error.cs.meta | 12 + .../UniTask/Runtime/Internal/MinimumQueue.cs | 112 + .../Runtime/Internal/MinimumQueue.cs.meta | 11 + .../Runtime/Internal/PlayerLoopRunner.cs | 260 + .../Runtime/Internal/PlayerLoopRunner.cs.meta | 11 + .../Runtime/Internal/PooledDelegate.cs | 50 + .../Runtime/Internal/PooledDelegate.cs.meta | 11 + .../Internal/RuntimeHelpersAbstraction.cs | 64 + .../RuntimeHelpersAbstraction.cs.meta | 12 + .../UniTask/Runtime/Internal/StatePool.cs | 153 + .../Runtime/Internal/StatePool.cs.meta | 11 + .../UniTask/Runtime/Internal/TaskTracker.cs | 178 + .../Runtime/Internal/TaskTracker.cs.meta | 11 + .../Runtime/Internal/UnityEqualityComparer.cs | 267 + .../Internal/UnityEqualityComparer.cs.meta | 11 + .../Internal/UnityWebRequestExtensions.cs | 28 + .../UnityWebRequestExtensions.cs.meta | 11 + .../Runtime/Internal/ValueStopwatch.cs | 37 + .../Runtime/Internal/ValueStopwatch.cs.meta | 11 + .../Runtime/Internal/WeakDictionary.cs | 334 + .../Runtime/Internal/WeakDictionary.cs.meta | 11 + .../Assets/Plugins/UniTask/Runtime/Linq.meta | 8 + .../Plugins/UniTask/Runtime/Linq/Aggregate.cs | 318 + .../UniTask/Runtime/Linq/Aggregate.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/All.cs | 108 + .../Plugins/UniTask/Runtime/Linq/All.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Any.cs | 136 + .../Plugins/UniTask/Runtime/Linq/Any.cs.meta | 11 + .../UniTask/Runtime/Linq/AppendPrepend.cs | 151 + .../Runtime/Linq/AppendPrepend.cs.meta | 11 + .../Runtime/Linq/AsUniTaskAsyncEnumerable.cs | 10 + .../Linq/AsUniTaskAsyncEnumerable.cs.meta | 11 + .../Runtime/Linq/AsyncEnumeratorBase.cs | 356 + .../Runtime/Linq/AsyncEnumeratorBase.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Average.cs | 1524 +++ .../UniTask/Runtime/Linq/Average.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Buffer.cs | 345 + .../UniTask/Runtime/Linq/Buffer.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Cast.cs | 53 + .../Plugins/UniTask/Runtime/Linq/Cast.cs.meta | 11 + .../UniTask/Runtime/Linq/CombineLatest.cs | 11372 ++++++++++++++++ .../Runtime/Linq/CombineLatest.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Concat.cs | 164 + .../UniTask/Runtime/Linq/Concat.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Contains.cs | 50 + .../UniTask/Runtime/Linq/Contains.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Count.cs | 144 + .../UniTask/Runtime/Linq/Count.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Create.cs | 184 + .../UniTask/Runtime/Linq/Create.cs.meta | 11 + .../UniTask/Runtime/Linq/DefaultIfEmpty.cs | 142 + .../Runtime/Linq/DefaultIfEmpty.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Distinct.cs | 277 + .../UniTask/Runtime/Linq/Distinct.cs.meta | 11 + .../Runtime/Linq/DistinctUntilChanged.cs | 662 + .../Runtime/Linq/DistinctUntilChanged.cs.meta | 11 + .../Assets/Plugins/UniTask/Runtime/Linq/Do.cs | 258 + .../Plugins/UniTask/Runtime/Linq/Do.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/ElementAt.cs | 58 + .../UniTask/Runtime/Linq/ElementAt.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Empty.cs | 47 + .../UniTask/Runtime/Linq/Empty.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Except.cs | 116 + .../UniTask/Runtime/Linq/Except.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/First.cs | 200 + .../UniTask/Runtime/Linq/First.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/ForEach.cs | 193 + .../UniTask/Runtime/Linq/ForEach.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/GroupBy.cs | 923 ++ .../UniTask/Runtime/Linq/GroupBy.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/GroupJoin.cs | 612 + .../UniTask/Runtime/Linq/GroupJoin.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Intersect.cs | 117 + .../UniTask/Runtime/Linq/Intersect.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Join.cs | 728 + .../Plugins/UniTask/Runtime/Linq/Join.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Last.cs | 240 + .../Plugins/UniTask/Runtime/Linq/Last.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/LongCount.cs | 144 + .../UniTask/Runtime/Linq/LongCount.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Max.cs | 200 + .../Plugins/UniTask/Runtime/Linq/Max.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Merge.cs | 232 + .../UniTask/Runtime/Linq/Merge.cs.meta | 3 + .../Plugins/UniTask/Runtime/Linq/Min.cs | 200 + .../Plugins/UniTask/Runtime/Linq/Min.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/MinMax.cs | 3763 +++++ .../UniTask/Runtime/Linq/MinMax.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Never.cs | 56 + .../UniTask/Runtime/Linq/Never.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/OfType.cs | 61 + .../UniTask/Runtime/Linq/OfType.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/OrderBy.cs | 558 + .../UniTask/Runtime/Linq/OrderBy.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Pairwise.cs | 128 + .../UniTask/Runtime/Linq/Pairwise.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Publish.cs | 173 + .../UniTask/Runtime/Linq/Publish.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Queue.cs | 103 + .../UniTask/Runtime/Linq/Queue.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Range.cs | 75 + .../UniTask/Runtime/Linq/Range.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Repeat.cs | 68 + .../UniTask/Runtime/Linq/Repeat.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Return.cs | 63 + .../UniTask/Runtime/Linq/Return.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Reverse.cs | 78 + .../UniTask/Runtime/Linq/Reverse.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Select.cs | 760 ++ .../UniTask/Runtime/Linq/Select.cs.meta | 11 + .../UniTask/Runtime/Linq/SelectMany.cs | 892 ++ .../UniTask/Runtime/Linq/SelectMany.cs.meta | 11 + .../UniTask/Runtime/Linq/SequenceEqual.cs | 87 + .../Runtime/Linq/SequenceEqual.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Single.cs | 230 + .../UniTask/Runtime/Linq/Single.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Skip.cs | 69 + .../Plugins/UniTask/Runtime/Linq/Skip.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/SkipLast.cs | 159 + .../UniTask/Runtime/Linq/SkipLast.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/SkipUntil.cs | 187 + .../UniTask/Runtime/Linq/SkipUntil.cs.meta | 11 + .../UniTask/Runtime/Linq/SkipUntilCanceled.cs | 173 + .../Runtime/Linq/SkipUntilCanceled.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/SkipWhile.cs | 379 + .../UniTask/Runtime/Linq/SkipWhile.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Subscribe.cs | 536 + .../UniTask/Runtime/Linq/Subscribe.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Sum.cs | 1244 ++ .../Plugins/UniTask/Runtime/Linq/Sum.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Take.cs | 124 + .../Plugins/UniTask/Runtime/Linq/Take.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/TakeLast.cs | 175 + .../UniTask/Runtime/Linq/TakeLast.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/TakeUntil.cs | 190 + .../UniTask/Runtime/Linq/TakeUntil.cs.meta | 11 + .../UniTask/Runtime/Linq/TakeUntilCanceled.cs | 164 + .../Runtime/Linq/TakeUntilCanceled.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/TakeWhile.cs | 342 + .../UniTask/Runtime/Linq/TakeWhile.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Throw.cs | 54 + .../UniTask/Runtime/Linq/Throw.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/ToArray.cs | 60 + .../UniTask/Runtime/Linq/ToArray.cs.meta | 11 + .../UniTask/Runtime/Linq/ToDictionary.cs | 278 + .../UniTask/Runtime/Linq/ToDictionary.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/ToHashSet.cs | 50 + .../UniTask/Runtime/Linq/ToHashSet.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/ToList.cs | 42 + .../UniTask/Runtime/Linq/ToList.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/ToLookup.cs | 554 + .../UniTask/Runtime/Linq/ToLookup.cs.meta | 11 + .../UniTask/Runtime/Linq/ToObservable.cs | 97 + .../UniTask/Runtime/Linq/ToObservable.cs.meta | 11 + .../Runtime/Linq/ToUniTaskAsyncEnumerable.cs | 1115 ++ .../Linq/ToUniTaskAsyncEnumerable.cs.meta | 11 + .../UniTask/Runtime/Linq/UniTask.Linq.asmdef | 15 + .../Runtime/Linq/UniTask.Linq.asmdef.meta | 7 + .../Plugins/UniTask/Runtime/Linq/Union.cs | 26 + .../UniTask/Runtime/Linq/Union.cs.meta | 11 + .../UniTask/Runtime/Linq/UnityExtensions.meta | 8 + .../Linq/UnityExtensions/EveryUpdate.cs | 100 + .../Linq/UnityExtensions/EveryUpdate.cs.meta | 11 + .../Linq/UnityExtensions/EveryValueChanged.cs | 292 + .../UnityExtensions/EveryValueChanged.cs.meta | 11 + .../Runtime/Linq/UnityExtensions/Timer.cs | 355 + .../Linq/UnityExtensions/Timer.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Where.cs | 818 ++ .../UniTask/Runtime/Linq/Where.cs.meta | 11 + .../Plugins/UniTask/Runtime/Linq/Zip.cs | 541 + .../Plugins/UniTask/Runtime/Linq/Zip.cs.meta | 11 + .../Plugins/UniTask/Runtime/MoveNextSource.cs | 63 + .../UniTask/Runtime/MoveNextSource.cs.meta | 11 + .../UniTask/Runtime/PlayerLoopHelper.cs | 581 + .../UniTask/Runtime/PlayerLoopHelper.cs.meta | 11 + .../UniTask/Runtime/PlayerLoopTimer.cs | 262 + .../UniTask/Runtime/PlayerLoopTimer.cs.meta | 11 + .../Plugins/UniTask/Runtime/Progress.cs | 87 + .../Plugins/UniTask/Runtime/Progress.cs.meta | 11 + .../Plugins/UniTask/Runtime/TaskPool.cs | 123 + .../Plugins/UniTask/Runtime/TaskPool.cs.meta | 11 + .../UniTask/Runtime/TimeoutController.cs | 129 + .../UniTask/Runtime/TimeoutController.cs.meta | 11 + .../Plugins/UniTask/Runtime/TriggerEvent.cs | 291 + .../UniTask/Runtime/TriggerEvent.cs.meta | 11 + .../Plugins/UniTask/Runtime/Triggers.meta | 8 + .../Runtime/Triggers/AsyncAwakeTrigger.cs | 32 + .../Triggers/AsyncAwakeTrigger.cs.meta | 11 + .../Runtime/Triggers/AsyncDestroyTrigger.cs | 95 + .../Triggers/AsyncDestroyTrigger.cs.meta | 11 + .../Runtime/Triggers/AsyncStartTrigger.cs | 38 + .../Triggers/AsyncStartTrigger.cs.meta | 11 + .../Runtime/Triggers/AsyncTriggerBase.cs | 310 + .../Runtime/Triggers/AsyncTriggerBase.cs.meta | 11 + .../Triggers/AsyncTriggerExtensions.cs | 102 + .../Triggers/AsyncTriggerExtensions.cs.meta | 11 + .../Triggers/MonoBehaviourMessagesTriggers.cs | 4457 ++++++ .../MonoBehaviourMessagesTriggers.cs.meta | 11 + .../Plugins/UniTask/Runtime/UniTask.Bridge.cs | 18 + .../UniTask/Runtime/UniTask.Bridge.cs.meta | 11 + .../Plugins/UniTask/Runtime/UniTask.Delay.cs | 1064 ++ .../UniTask/Runtime/UniTask.Delay.cs.meta | 11 + .../UniTask/Runtime/UniTask.Factory.cs | 499 + .../UniTask/Runtime/UniTask.Factory.cs.meta | 11 + .../Plugins/UniTask/Runtime/UniTask.Run.cs | 289 + .../UniTask/Runtime/UniTask.Run.cs.meta | 11 + .../UniTask/Runtime/UniTask.Threading.cs | 412 + .../UniTask/Runtime/UniTask.Threading.cs.meta | 11 + .../UniTask/Runtime/UniTask.WaitUntil.cs | 637 + .../UniTask/Runtime/UniTask.WaitUntil.cs.meta | 11 + .../Runtime/UniTask.WhenAll.Generated.cs | 5011 +++++++ .../Runtime/UniTask.WhenAll.Generated.cs.meta | 11 + .../UniTask/Runtime/UniTask.WhenAll.cs | 237 + .../UniTask/Runtime/UniTask.WhenAll.cs.meta | 11 + .../Runtime/UniTask.WhenAny.Generated.cs | 5060 +++++++ .../Runtime/UniTask.WhenAny.Generated.cs.meta | 11 + .../UniTask/Runtime/UniTask.WhenAny.cs | 359 + .../UniTask/Runtime/UniTask.WhenAny.cs.meta | 11 + .../Plugins/UniTask/Runtime/UniTask.asmdef | 45 + .../UniTask/Runtime/UniTask.asmdef.meta | 7 + .../Assets/Plugins/UniTask/Runtime/UniTask.cs | 707 + .../Plugins/UniTask/Runtime/UniTask.cs.meta | 11 + .../Runtime/UniTaskCompletionSource.cs | 944 ++ .../Runtime/UniTaskCompletionSource.cs.meta | 11 + .../Runtime/UniTaskExtensions.Shorthand.cs | 187 + .../UniTaskExtensions.Shorthand.cs.meta | 11 + .../UniTask/Runtime/UniTaskExtensions.cs | 921 ++ .../UniTask/Runtime/UniTaskExtensions.cs.meta | 11 + .../Runtime/UniTaskObservableExtensions.cs | 750 + .../UniTaskObservableExtensions.cs.meta | 11 + .../UniTask/Runtime/UniTaskScheduler.cs | 103 + .../UniTask/Runtime/UniTaskScheduler.cs.meta | 11 + .../Runtime/UniTaskSynchronizationContext.cs | 158 + .../UniTaskSynchronizationContext.cs.meta | 11 + .../Plugins/UniTask/Runtime/UniTaskVoid.cs | 19 + .../UniTask/Runtime/UniTaskVoid.cs.meta | 11 + ...cExtensions.AssetBundleRequestAllAssets.cs | 246 + ...nsions.AssetBundleRequestAllAssets.cs.meta | 11 + .../UnityAsyncExtensions.AsyncGPUReadback.cs | 155 + ...tyAsyncExtensions.AsyncGPUReadback.cs.meta | 11 + .../Runtime/UnityAsyncExtensions.Jobs.cs | 102 + .../Runtime/UnityAsyncExtensions.Jobs.cs.meta | 11 + .../UnityAsyncExtensions.MonoBehaviour.cs | 14 + ...UnityAsyncExtensions.MonoBehaviour.cs.meta | 11 + .../UniTask/Runtime/UnityAsyncExtensions.cs | 1181 ++ .../Runtime/UnityAsyncExtensions.cs.meta | 11 + .../Runtime/UnityAsyncExtensions.uGUI.cs | 858 ++ .../Runtime/UnityAsyncExtensions.uGUI.cs.meta | 11 + .../Runtime/UnityAwaitableExtensions.cs | 17 + .../Runtime/UnityAwaitableExtensions.cs.meta | 3 + .../UniTask/Runtime/UnityBindingExtensions.cs | 245 + .../Runtime/UnityBindingExtensions.cs.meta | 11 + .../Runtime/UnityWebRequestException.cs | 67 + .../Runtime/UnityWebRequestException.cs.meta | 11 + .../UniTask/Runtime/_InternalVisibleTo.cs | 6 + .../Runtime/_InternalVisibleTo.cs.meta | 11 + JNFrame/Assets/Plugins/UniTask/package.json | 12 + .../Assets/Plugins/UniTask/package.json.meta | 7 + JNFrame/Assets/Resources.meta | 8 + JNFrame/Assets/Scenes.meta | 8 + JNFrame/Assets/Scenes/Main.unity | 169 + JNFrame/Assets/Scenes/Main.unity.meta | 7 + JNFrame/Assets/Scenes/UIScene.unity | 620 + JNFrame/Assets/Scenes/UIScene.unity.meta | 7 + JNFrame/Assets/Scenes/WorldScene.unity | 553 + JNFrame/Assets/Scenes/WorldScene.unity.meta | 7 + JNFrame/Assets/Script.meta | 8 + JNFrame/Assets/Script/App.cs | 22 + JNFrame/Assets/Script/App.cs.meta | 3 + JNFrame/Assets/Script/AppImpl.meta | 3 + JNFrame/Assets/Script/AppImpl/JNGSocket.cs | 14 + .../Assets/Script/AppImpl/JNGSocket.cs.meta | 3 + JNFrame/Assets/Script/AppImpl/JNGSyncFrame.cs | 12 + .../Script/AppImpl/JNGSyncFrame.cs.meta | 3 + JNFrame/Assets/Script/Main.cs | 58 + JNFrame/Assets/Script/Main.cs.meta | 11 + JNFrame/Assets/Script/UIMain.cs | 8 + JNFrame/Assets/Script/UIMain.cs.meta | 11 + JNFrame/Assets/Script/battle.meta | 3 + JNFrame/Assets/Script/battle/GBaseMode.cs | 7 + .../Assets/Script/battle/GBaseMode.cs.meta | 3 + .../Script/battle/GBattleModeManager.cs | 83 + .../Script/battle/GBattleModeManager.cs.meta | 3 + JNFrame/Assets/packages.config | 5 + JNFrame/Assets/packages.config.meta | 23 + JNFrame/JNFrame.sln | 49 + JNFrame/Logs/AssetImportWorker0-prev.log | 7434 ++++++++++ JNFrame/Logs/AssetImportWorker0.log | 7362 ++++++++++ JNFrame/Logs/AssetImportWorker1-prev.log | 7333 ++++++++++ JNFrame/Logs/AssetImportWorker1.log | 7301 ++++++++++ JNFrame/Logs/AssetImportWorker2.log | 5420 ++++++++ JNFrame/Logs/AssetImportWorker3.log | 5378 ++++++++ JNFrame/Logs/Packages-Update.log | 46 + .../shadercompiler-AssetImportWorker0.log | 6 + ...hadercompiler-UnityShaderCompiler.exe0.log | 16 + ...hadercompiler-UnityShaderCompiler.exe1.log | 7 + ...hadercompiler-UnityShaderCompiler.exe2.log | 7 + ...hadercompiler-UnityShaderCompiler.exe3.log | 7 + ...hadercompiler-UnityShaderCompiler.exe4.log | 7 + ...hadercompiler-UnityShaderCompiler.exe5.log | 7 + ...hadercompiler-UnityShaderCompiler.exe6.log | 7 + ...hadercompiler-UnityShaderCompiler.exe7.log | 7 + ...hadercompiler-UnityShaderCompiler.exe8.log | 7 + .../System.Buffers.4.4.0/.signature.p7s | Bin 0 -> 9482 bytes .../Packages/System.Buffers.4.4.0/LICENSE.TXT | 23 + .../System.Buffers.4.4.0.nupkg | Bin 0 -> 78363 bytes .../THIRD-PARTY-NOTICES.TXT | 226 + .../lib/netcoreapp2.0/_._ | 0 .../lib/netstandard1.1/System.Buffers.dll | Bin 0 -> 27840 bytes .../lib/netstandard1.1/System.Buffers.xml | 39 + .../lib/netstandard2.0/System.Buffers.dll | Bin 0 -> 27992 bytes .../lib/netstandard2.0/System.Buffers.xml | 39 + .../ref/netcoreapp2.0/_._ | 0 .../ref/netstandard1.1/System.Buffers.dll | Bin 0 -> 21848 bytes .../ref/netstandard1.1/System.Buffers.xml | 39 + .../ref/netstandard2.0/System.Buffers.dll | Bin 0 -> 21848 bytes .../ref/netstandard2.0/System.Buffers.xml | 39 + .../useSharedDesignerContext.txt | 0 .../Packages/System.Buffers.4.4.0/version.txt | 1 + .../System.Memory.4.5.3/.signature.p7s | Bin 0 -> 18703 bytes .../Packages/System.Memory.4.5.3/LICENSE.TXT | 23 + .../System.Memory.4.5.3.nupkg | Bin 0 -> 154054 bytes .../THIRD-PARTY-NOTICES.TXT | 309 + .../System.Memory.4.5.3/lib/netcoreapp2.1/_._ | 0 .../lib/netstandard1.1/System.Memory.dll | Bin 0 -> 143920 bytes .../lib/netstandard1.1/System.Memory.xml | 355 + .../lib/netstandard2.0/System.Memory.dll | Bin 0 -> 148760 bytes .../lib/netstandard2.0/System.Memory.xml | 355 + .../System.Memory.4.5.3/ref/netcoreapp2.1/_._ | 0 .../useSharedDesignerContext.txt | 0 .../Packages/System.Memory.4.5.3/version.txt | 1 + .../.signature.p7s | Bin 0 -> 9482 bytes .../System.Numerics.Vectors.4.4.0/LICENSE.TXT | 23 + .../System.Numerics.Vectors.4.4.0.nupkg | Bin 0 -> 337043 bytes .../THIRD-PARTY-NOTICES.TXT | 226 + .../lib/MonoAndroid10/_._ | 0 .../lib/MonoTouch10/_._ | 0 .../lib/net46/System.Numerics.Vectors.dll | Bin 0 -> 115936 bytes .../lib/net46/System.Numerics.Vectors.xml | 2597 ++++ .../lib/netcoreapp2.0/_._ | 0 .../System.Numerics.Vectors.dll | Bin 0 -> 161152 bytes .../System.Numerics.Vectors.xml | 2597 ++++ .../System.Numerics.Vectors.dll | Bin 0 -> 163712 bytes .../System.Numerics.Vectors.xml | 2597 ++++ .../System.Numerics.Vectors.dll | Bin 0 -> 161152 bytes .../System.Numerics.Vectors.xml | 2597 ++++ .../lib/xamarinios10/_._ | 0 .../lib/xamarinmac20/_._ | 0 .../lib/xamarintvos10/_._ | 0 .../lib/xamarinwatchos10/_._ | 0 .../ref/MonoAndroid10/_._ | 0 .../ref/MonoTouch10/_._ | 0 .../ref/net46/System.Numerics.Vectors.dll | Bin 0 -> 29568 bytes .../ref/net46/System.Numerics.Vectors.xml | 2597 ++++ .../ref/netcoreapp2.0/_._ | 0 .../System.Numerics.Vectors.dll | Bin 0 -> 38272 bytes .../System.Numerics.Vectors.xml | 2597 ++++ .../System.Numerics.Vectors.dll | Bin 0 -> 38272 bytes .../System.Numerics.Vectors.xml | 2597 ++++ .../ref/xamarinios10/_._ | 0 .../ref/xamarinmac20/_._ | 0 .../ref/xamarintvos10/_._ | 0 .../ref/xamarinwatchos10/_._ | 0 .../useSharedDesignerContext.txt | 0 .../System.Numerics.Vectors.4.4.0/version.txt | 1 + .../.signature.p7s | Bin 0 -> 22354 bytes .../LICENSE.TXT | 23 + ...untime.CompilerServices.Unsafe.4.5.2.nupkg | Bin 0 -> 104723 bytes .../THIRD-PARTY-NOTICES.TXT | 309 + ...System.Runtime.CompilerServices.Unsafe.dll | Bin 0 -> 23088 bytes ...System.Runtime.CompilerServices.Unsafe.xml | 200 + ...System.Runtime.CompilerServices.Unsafe.dll | Bin 0 -> 23600 bytes ...System.Runtime.CompilerServices.Unsafe.xml | 200 + ...System.Runtime.CompilerServices.Unsafe.dll | Bin 0 -> 23600 bytes ...System.Runtime.CompilerServices.Unsafe.xml | 200 + ...System.Runtime.CompilerServices.Unsafe.dll | Bin 0 -> 23304 bytes ...System.Runtime.CompilerServices.Unsafe.xml | 200 + ...System.Runtime.CompilerServices.Unsafe.dll | Bin 0 -> 23816 bytes ...System.Runtime.CompilerServices.Unsafe.xml | 200 + .../useSharedDesignerContext.txt | 0 .../version.txt | 1 + JNFrame/Packages/manifest.json | 45 + JNFrame/Packages/packages-lock.json | 393 + JNFrame/ProjectSettings/AudioManager.asset | 19 + .../AutoStreamingSettings.asset | 21 + .../ProjectSettings/ClusterInputManager.asset | 6 + JNFrame/ProjectSettings/DynamicsManager.asset | 34 + .../ProjectSettings/EditorBuildSettings.asset | 14 + JNFrame/ProjectSettings/EditorSettings.asset | 30 + .../ProjectSettings/GraphicsSettings.asset | 63 + JNFrame/ProjectSettings/InputManager.asset | 295 + JNFrame/ProjectSettings/MemorySettings.asset | 35 + JNFrame/ProjectSettings/NavMeshAreas.asset | 91 + .../PackageManagerSettings.asset | 36 + .../Settings.json | 7 + .../ProjectSettings/Physics2DSettings.asset | 56 + JNFrame/ProjectSettings/PresetManager.asset | 7 + JNFrame/ProjectSettings/ProjectSettings.asset | 736 + JNFrame/ProjectSettings/ProjectVersion.txt | 2 + JNFrame/ProjectSettings/QualitySettings.asset | 234 + .../SceneTemplateSettings.json | 167 + JNFrame/ProjectSettings/TagManager.asset | 43 + JNFrame/ProjectSettings/TimeManager.asset | 9 + .../UnityConnectSettings.asset | 38 + JNFrame/ProjectSettings/VFXManager.asset | 12 + .../VersionControlSettings.asset | 8 + JNFrame/ProjectSettings/XRSettings.asset | 10 + JNFrame/ProjectSettings/boot.config | 0 JNFrame/UniTask.Addressables.csproj | 725 + JNFrame/UniTask.DOTween.csproj | 725 + JNFrame/UniTask.Editor.csproj | 751 + JNFrame/UniTask.Linq.csproj | 798 ++ JNFrame/UniTask.TextMeshPro.csproj | 729 + JNFrame/UniTask.csproj | 797 ++ JNFrame/UserSettings/EditorUserSettings.asset | 34 + .../UserSettings/Layouts/default-2021.dwlt | 1005 ++ JNFrame/UserSettings/Search.settings | 1 + ...ework,Version=v4.7.1.AssemblyAttributes.cs | 4 + ...harp-Editor.csproj.AssemblyReference.cache | Bin 0 -> 7736 bytes ...p-firstpass.csproj.AssemblyReference.cache | Bin 0 -> 117460 bytes ...mbly-CSharp.csproj.AssemblyReference.cache | Bin 0 -> 115088 bytes ...ddressables.csproj.AssemblyReference.cache | Bin 0 -> 111925 bytes ...ask.DOTween.csproj.AssemblyReference.cache | Bin 0 -> 111925 bytes ...Task.Editor.csproj.AssemblyReference.cache | Bin 0 -> 116967 bytes ...niTask.Linq.csproj.AssemblyReference.cache | Bin 0 -> 111925 bytes ...TextMeshPro.csproj.AssemblyReference.cache | Bin 0 -> 112254 bytes .../UniTask.csproj.AssemblyReference.cache | Bin 0 -> 111925 bytes JNFrame/packages.config | 7 + .../jisol/ngame/frame/network/WebSocket.java | 2 +- 3928 files changed, 463020 insertions(+), 1 deletion(-) create mode 100644 JNFrame/App.config create mode 100644 JNFrame/Assembly-CSharp-Editor.csproj create mode 100644 JNFrame/Assembly-CSharp-firstpass.csproj create mode 100644 JNFrame/Assembly-CSharp.csproj create mode 100644 JNFrame/Assets/NuGet.config create mode 100644 JNFrame/Assets/NuGet.config.meta create mode 100644 JNFrame/Assets/NuGet.meta create mode 100644 JNFrame/Assets/NuGet/Editor.meta create mode 100644 JNFrame/Assets/NuGet/Editor/NugetForUnity.dll create mode 100644 JNFrame/Assets/NuGet/Editor/NugetForUnity.dll.meta create mode 100644 JNFrame/Assets/NuGet/LICENSE create mode 100644 JNFrame/Assets/NuGet/LICENSE.meta create mode 100644 JNFrame/Assets/NuGet/README.pdf create mode 100644 JNFrame/Assets/NuGet/README.pdf.meta create mode 100644 JNFrame/Assets/NuGet/Resources.meta create mode 100644 JNFrame/Assets/NuGet/Resources/defaultIcon.png create mode 100644 JNFrame/Assets/NuGet/Resources/defaultIcon.png.meta create mode 100644 JNFrame/Assets/Packages.meta create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8.meta create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8/.signature.p7s create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8/Google.Protobuf.nuspec create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8/Google.Protobuf.nuspec.meta create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib.meta create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0.meta create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.dll create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.dll.meta create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.xml create mode 100644 JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.xml.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/.signature.p7s create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.nuspec create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.nuspec.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt.meta create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt create mode 100644 JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt.meta create mode 100644 JNFrame/Assets/Plugins.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Credentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Credentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/DigestStore.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/DigestStore.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileLock.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileLock.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheMaintananceParams.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheMaintananceParams.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheService.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheService.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/ConnectionBase.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/ConnectionBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/FileConnection.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/FileConnection.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/WebGLConnection.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/WebGLConnection.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/Cookie.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/Cookie.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/CookieJar.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/CookieJar.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/CRC32.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/CRC32.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Deflate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Deflate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/DeflateStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/DeflateStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/GZipStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/GZipStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/InfTree.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/InfTree.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Inflate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Inflate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZTree.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZTree.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Zlib.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Zlib.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibBaseStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibBaseStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibCodec.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibCodec.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibConstants.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibConstants.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/BufferPoolMemoryStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/BufferPoolMemoryStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/CircularBuffer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/CircularBuffer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Extensions.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Extensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Future.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Future.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderValue.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderValue.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeartbeatManager.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeartbeatManager.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/KeyValuePairList.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/KeyValuePairList.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/ReadOnlyBufferedStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/ReadOnlyBufferedStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/VariableSizedBufferPool.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/VariableSizedBufferPool.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WWWAuthenticateHeaderParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WWWAuthenticateHeaderParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WriteOnlyBufferedStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WriteOnlyBufferedStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFieldData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFieldData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormBase.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormUsage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormUsage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPMultiPartForm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPMultiPartForm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPUrlEncodedForm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPUrlEncodedForm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/RawJSonForm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/RawJSonForm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnection.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnection.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnectionStates.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnectionStates.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPManager.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPManager.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPMethods.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPMethods.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProtocolFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProtocolFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProxy.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProxy.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPResponse.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPResponse.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPUpdateDelegator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPUpdateDelegator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON/JSON.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON/JSON.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/DefaultLogger.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/DefaultLogger.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/ILogger.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/ILogger.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel/ObservableDictionary.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel/ObservableDictionary.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized/NotifyCollectionChangedEventArgs.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized/NotifyCollectionChangedEventArgs.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/DefaultIOService.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/DefaultIOService.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/IIOService.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/IIOService.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/NETFXCOREIOService.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/NETFXCOREIOService.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/WebGLIOService.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/WebGLIOService.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/TcpClient.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/TcpClient.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/DataReaderWriterStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/DataReaderWriterStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/TcpClient.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/TcpClient.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SOCKSProxy.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SOCKSProxy.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/License.txt create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/License.txt.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ReflectionHelpers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ReflectionHelpers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1Generator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1Generator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1OctetStringParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1OctetStringParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SequenceParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SequenceParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SetParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SetParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1StreamParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1StreamParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1TaggedObjectParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1TaggedObjectParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Encodable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Encodable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1EncodableVector.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1EncodableVector.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Exception.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Exception.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1InputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1InputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Null.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Null.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Object.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Object.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OctetString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OctetString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OutputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OutputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1ParsingException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1ParsingException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Sequence.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Sequence.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Set.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Set.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1TaggedObject.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1TaggedObject.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Tags.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Tags.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERBitString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERBitString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERTaggedObjectParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERTaggedObjectParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecific.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecific.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecificParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecificParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerNull.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerNull.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOctetString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOctetString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOutputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOutputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSequence.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSequence.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSet.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSet.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerTaggedObject.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerTaggedObject.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ConstructedOctetStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ConstructedOctetStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternal.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternal.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternalParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternalParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DEROctetStringParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DEROctetStringParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DefiniteLengthInputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DefiniteLengthInputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerApplicationSpecific.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerApplicationSpecific.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBMPString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBMPString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBitString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBitString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBoolean.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBoolean.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerEnumerated.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerEnumerated.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralizedTime.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralizedTime.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGraphicString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGraphicString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerIA5String.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerIA5String.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerInteger.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerInteger.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNull.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNull.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNumericString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNumericString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerObjectIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerObjectIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOctetString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOctetString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOutputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOutputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerPrintableString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerPrintableString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSequence.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSequence.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSet.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSet.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerStringBase.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerStringBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerT61String.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerT61String.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerTaggedObject.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerTaggedObject.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTCTime.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTCTime.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTF8String.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTF8String.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUniversalString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUniversalString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVideotexString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVideotexString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVisibleString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVisibleString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1ApplicationSpecificParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1ApplicationSpecificParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Choice.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Choice.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Convertible.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Convertible.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1String.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1String.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IndefiniteLengthInputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IndefiniteLengthInputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyASN1InputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyASN1InputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSequence.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSequence.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSet.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSet.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LimitedInputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LimitedInputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/OidTokenizer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/OidTokenizer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSINamedCurves.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSINamedCurves.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSIObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSIObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc/BCObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc/BCObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi/BsiObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi/BsiObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CAKeyUpdAnnContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CAKeyUpdAnnContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertConfirmContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertConfirmContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertOrEncCert.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertOrEncCert.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertRepMessage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertRepMessage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertResponse.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertResponse.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertifiedKeyPair.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertifiedKeyPair.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/Challenge.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/Challenge.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpCertificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpCertificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CrlAnnContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CrlAnnContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ErrorMsgContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ErrorMsgContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenMsgContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenMsgContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenRepContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenRepContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/InfoTypeAndValue.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/InfoTypeAndValue.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/KeyRecRepContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/KeyRecRepContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/OobCertHash.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/OobCertHash.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIBody.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIBody.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIConfirmContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIConfirmContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFailureInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFailureInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFreeText.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFreeText.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeader.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeader.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeaderBuilder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeaderBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessages.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessages.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatusInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatusInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PbmParameter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PbmParameter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollRepContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollRepContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollReqContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollReqContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyChallContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyChallContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyRespContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyRespContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ProtectedPart.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ProtectedPart.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevAnnContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevAnnContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevDetails.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevDetails.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContentBuilder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContentBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevReqContent.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevReqContent.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attribute.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attribute.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AttributeTable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AttributeTable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attributes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attributes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSAttributes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSAttributes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfoParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfoParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfoParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfoParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Evidence.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Evidence.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/IssuerAndSerialNumber.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/IssuerAndSerialNumber.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKRecipientInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKRecipientInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyTransRecipientInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyTransRecipientInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/MetaData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/MetaData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorIdentifierOrKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorIdentifierOrKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorPublicKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorPublicKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherKeyAttribute.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherKeyAttribute.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRecipientInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRecipientInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRevocationInfoFormat.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRevocationInfoFormat.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/PasswordRecipientInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/PasswordRecipientInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientEncryptedKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientEncryptedKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientKeyIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientKeyIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SCVPReqRes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SCVPReqRes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Time.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Time.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampAndCRL.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampAndCRL.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampTokenEvidence.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampTokenEvidence.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc/MQVuserKeyingMaterial.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc/MQVuserKeyingMaterial.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/AttributeTypeAndValue.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/AttributeTypeAndValue.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertId.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertId.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMessages.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMessages.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMsg.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMsg.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplateBuilder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplateBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/Controls.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/Controls.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CrmfObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CrmfObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncKeyWithID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncKeyWithID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedValue.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedValue.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/OptionalValidity.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/OptionalValidity.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIArchiveOptions.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIArchiveOptions.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIPublicationInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIPublicationInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKMacValue.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKMacValue.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoPrivKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoPrivKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKeyInput.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKeyInput.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/ProofOfPossession.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/ProofOfPossession.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SinglePubInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SinglePubInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SubsequentMessage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SubsequentMessage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/CryptoProObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/CryptoProObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410NamedCurves.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410NamedCurves.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410ParamSetParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410ParamSetParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST28147Parameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST28147Parameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410NamedParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410NamedParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410ParamSetParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410ParamSetParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac/EACObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac/EACObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec/EdECObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec/EdECObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CertificateValues.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CertificateValues.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIndication.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIndication.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeQualifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeQualifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteCertificateRefs.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteCertificateRefs.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteRevocationRefs.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteRevocationRefs.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlListID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlListID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlOcspRef.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlOcspRef.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlValidatedID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlValidatedID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/ESFAttributes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/ESFAttributes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspListID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspListID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspResponsesID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspResponsesID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherCertID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherCertID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHash.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHash.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHashAlgAndValue.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHashAlgAndValue.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevRefs.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevRefs.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevVals.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevVals.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherSigningCertificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherSigningCertificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/RevocationValues.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/RevocationValues.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SigPolicyQualifierInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SigPolicyQualifierInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyId.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyId.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerAttribute.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerAttribute.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerLocation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerLocation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentHints.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentHints.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertIDv2.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertIDv2.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherCertID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherCertID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherSigningCertificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherSigningCertificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificateV2.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificateV2.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMNamedCurves.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMNamedCurves.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu/GNUObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu/GNUObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana/IANAObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana/IANAObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/CscaMasterList.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/CscaMasterList.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/DataGroupHash.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/DataGroupHash.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/ICAOObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/ICAOObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSSecurityObject.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSSecurityObject.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSVersionInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSVersionInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ISISMTTObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ISISMTTObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/CertHash.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/CertHash.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/RequestedCertificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/RequestedCertificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdditionalInformationSyntax.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdditionalInformationSyntax.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdmissionSyntax.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdmissionSyntax.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Admissions.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Admissions.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/DeclarationOfMajority.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/DeclarationOfMajority.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/MonetaryLimit.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/MonetaryLimit.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/NamingAuthority.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/NamingAuthority.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProcurationSyntax.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProcurationSyntax.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProfessionInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProfessionInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Restriction.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Restriction.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa/KISAObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa/KISAObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft/MicrosoftObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft/MicrosoftObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/CAST5CBCParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/CAST5CBCParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/IDEACBCPar.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/IDEACBCPar.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/MiscObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/MiscObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeCertType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeCertType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeRevocationURL.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeRevocationURL.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/VerisignCzagExtension.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/VerisignCzagExtension.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla/PublicKeyAndChallenge.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla/PublicKeyAndChallenge.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTNamedCurves.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTNamedCurves.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt/NTTObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt/NTTObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/BasicOCSPResponse.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/BasicOCSPResponse.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CrlID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CrlID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponse.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponse.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponseStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponseStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Request.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Request.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponderID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponderID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseBytes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseBytes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/RevokedInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/RevokedInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ServiceLocator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ServiceLocator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Signature.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Signature.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/SingleResponse.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/SingleResponse.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/TBSRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/TBSRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/ElGamalParameter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/ElGamalParameter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/OIWObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/OIWObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Attribute.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Attribute.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/AuthenticatedSafe.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/AuthenticatedSafe.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertBag.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertBag.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequestInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequestInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/ContentInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/ContentInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/DHParameter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/DHParameter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedPrivateKeyInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedPrivateKeyInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptionScheme.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptionScheme.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/IssuerAndSerialNumber.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/IssuerAndSerialNumber.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/KeyDerivationFunc.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/KeyDerivationFunc.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/MacData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/MacData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBEParameter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBEParameter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBES2Parameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBES2Parameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBKDF2Params.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBKDF2Params.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCS12PBEParams.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCS12PBEParams.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCSObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCSObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Pfx.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Pfx.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PrivateKeyInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PrivateKeyInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RC2CBCParameter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RC2CBCParameter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAESOAEPparams.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAESOAEPparams.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAPrivateKeyStructure.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAPrivateKeyStructure.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSASSAPSSparams.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSASSAPSSparams.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SafeBag.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SafeBag.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignerInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignerInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart/RosstandartObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart/RosstandartObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/ECPrivateKeyStructure.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/ECPrivateKeyStructure.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECNamedCurves.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECNamedCurves.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEAttributes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEAttributes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilitiesAttribute.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilitiesAttribute.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapability.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapability.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilityVector.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilityVector.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEEncryptionKeyPreferenceAttribute.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEEncryptionKeyPreferenceAttribute.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTNamedCurves.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTNamedCurves.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/Accuracy.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/Accuracy.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/MessageImprint.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/MessageImprint.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TSTInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TSTInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampReq.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampReq.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampResp.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampResp.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua/UAObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua/UAObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/Asn1Dump.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/Asn1Dump.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/FilterStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/FilterStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500/DirectoryString.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500/DirectoryString.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AccessDescription.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AccessDescription.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AlgorithmIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AlgorithmIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertIssuer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertIssuer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertValidityPeriod.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertValidityPeriod.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Attribute.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Attribute.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificateInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificateInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeTable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeTable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityInformationAccess.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityInformationAccess.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityKeyIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityKeyIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/BasicConstraints.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/BasicConstraints.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLDistPoint.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLDistPoint.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLNumber.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLNumber.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLReason.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLReason.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertPolicyId.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertPolicyId.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificateList.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificateList.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePair.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePair.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePolicies.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePolicies.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DSAParameter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DSAParameter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DigestInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DigestInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DisplayText.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DisplayText.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPoint.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPoint.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPointName.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPointName.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ExtendedKeyUsage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ExtendedKeyUsage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralName.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralName.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralNames.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralNames.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralSubtree.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralSubtree.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Holder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Holder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IetfAttrSyntax.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IetfAttrSyntax.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuerSerial.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuerSerial.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuingDistributionPoint.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuingDistributionPoint.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyPurposeId.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyPurposeId.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyUsage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyUsage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NameConstraints.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NameConstraints.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NoticeReference.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NoticeReference.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ObjectDigestInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ObjectDigestInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyMappings.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyMappings.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierId.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierId.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PrivateKeyUsagePeriod.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PrivateKeyUsagePeriod.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RSAPublicKeyStructure.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RSAPublicKeyStructure.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ReasonFlags.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ReasonFlags.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RoleSyntax.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RoleSyntax.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectDirectoryAttributes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectDirectoryAttributes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectKeyIdentifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectKeyIdentifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectPublicKeyInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectPublicKeyInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertList.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertList.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertificateStructure.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertificateStructure.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Target.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Target.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TargetInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TargetInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Targets.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Targets.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Time.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Time.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/UserNotice.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/UserNotice.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V1TBSCertificateGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V1TBSCertificateGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2AttributeCertificateInfoGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2AttributeCertificateInfoGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2Form.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2Form.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2TBSCertListGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2TBSCertListGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V3TBSCertificateGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V3TBSCertificateGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Attributes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Attributes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509CertificateStructure.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509CertificateStructure.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509DefaultEntryConverter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509DefaultEntryConverter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extension.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extension.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extensions.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ExtensionsGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ExtensionsGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Name.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Name.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameEntryConverter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameEntryConverter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameTokenizer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameTokenizer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/BiometricData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/BiometricData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/ETSIQCObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/ETSIQCObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/Iso4217CurrencyCode.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/Iso4217CurrencyCode.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/MonetaryValue.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/MonetaryValue.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/QCStatement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/QCStatement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/RFC3739QCObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/RFC3739QCObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/SemanticsInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/SemanticsInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/TypeOfBiometricData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/TypeOfBiometricData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/NameOrPseudonym.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/NameOrPseudonym.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/PersonalData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/PersonalData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/SigIObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/SigIObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHDomainParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHDomainParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHPublicKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHPublicKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHValidationParms.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHValidationParms.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/ECNamedCurveTable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/ECNamedCurveTable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/KeySpecificInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/KeySpecificInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/OtherInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/OtherInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962NamedCurves.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962NamedCurves.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962Parameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962Parameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParametersHolder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParametersHolder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECPoint.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECPoint.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9IntegerConverter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9IntegerConverter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ObjectIdentifiers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ObjectIdentifiers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/BaseDigestCalculator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/BaseDigestCalculator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerationException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerationException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataStreamGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataStreamGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataStreamGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataStreamGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSContentInfoParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSContentInfoParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataStreamGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataStreamGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedHelper.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedHelper.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSPBEKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSPBEKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableByteArray.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableByteArray.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableFile.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableFile.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableInputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableInputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSReadable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSReadable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSecureReadable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSecureReadable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataStreamGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataStreamGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedHelper.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedHelper.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSStreamException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSStreamException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSTypedStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSTypedStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSUtils.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSUtils.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CounterSignatureDigestCalculator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CounterSignatureDigestCalculator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultAuthenticatedAttributeTableGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultAuthenticatedAttributeTableGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultSignedAttributeTableGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultSignedAttributeTableGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/IDigestCalculator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/IDigestCalculator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInfoGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInfoGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInfoGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInfoGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInfoGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInfoGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorId.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorId.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInfoGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInfoGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2PBEKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2PBEKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2UTF8PBEKey.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2UTF8PBEKey.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInfoGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInfoGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientId.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientId.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInfoGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInfoGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformationStore.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformationStore.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerId.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerId.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInfoGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInfoGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformationStore.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformationStore.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SimpleAttributeTableGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SimpleAttributeTableGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricCipherKeyPair.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricCipherKeyPair.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricKeyParameter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricKeyParameter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAeadBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAeadBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAsymmetricBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAsymmetricBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedCipherBase.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedCipherBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedIesCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedIesCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedStreamCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedStreamCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/Check.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/Check.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CipherKeyGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CipherKeyGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CryptoException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CryptoException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/DataLengthException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/DataLengthException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricCipherKeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricCipherKeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBasicAgreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBasicAgreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockResult.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockResult.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBufferedCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBufferedCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ICipherParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ICipherParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDSA.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDSA.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationFunction.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationFunction.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDsaExt.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDsaExt.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySource.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySource.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySourceProvider.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySourceProvider.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IMac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IMac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRawAgreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRawAgreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRsa.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRsa.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignatureFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignatureFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignerWithRecovery.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignerWithRecovery.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCalculator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCalculator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactoryProvider.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactoryProvider.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IWrapper.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IWrapper.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IXof.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IXof.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/InvalidCipherTextException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/InvalidCipherTextException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/KeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/KeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/MaxBytesExceededException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/MaxBytesExceededException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/OutputLengthException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/OutputLengthException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/PbeParametersGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/PbeParametersGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/StreamBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/StreamBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHAgreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHAgreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHBasicAgreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHBasicAgreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHStandardGroups.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHStandardGroups.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHBasicAgreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHBasicAgreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHCBasicAgreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHCBasicAgreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHWithKdfBasicAgreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHWithKdfBasicAgreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvBasicAgreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvBasicAgreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvWithKdfBasicAgreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvWithKdfBasicAgreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/SM2KeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/SM2KeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X25519Agreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X25519Agreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X448Agreement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X448Agreement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeParticipant.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeParticipant.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroup.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroup.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroups.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroups.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound1Payload.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound1Payload.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound2Payload.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound2Payload.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound3Payload.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound3Payload.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ConcatenationKdfGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ConcatenationKdfGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKdfParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKdfParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKekGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKekGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ECDHKekGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ECDHKekGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Client.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Client.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Server.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Server.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6StandardGroups.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6StandardGroups.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Utilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Utilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6VerifierGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6VerifierGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2bDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2bDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2sDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2sDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/DSTU7564Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/DSTU7564Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_256Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_256Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_512Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_512Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GeneralDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GeneralDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/KeccakDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/KeccakDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/LongDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/LongDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD2Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD2Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD4Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD4Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD5Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD5Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NonMemoableDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NonMemoableDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NullDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NullDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD128Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD128Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD160Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD160Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD256Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD256Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD320Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD320Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SHA3Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SHA3Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SM3Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SM3Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha1Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha1Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha224Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha224Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha256Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha256Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha384Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha384Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512Digest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512Digest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512tDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512tDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShakeDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShakeDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShortenedDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShortenedDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/TigerDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/TigerDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/WhirlpoolDigest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/WhirlpoolDigest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec/CustomNamedCurves.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec/CustomNamedCurves.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/ISO9796d1Encoding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/ISO9796d1Encoding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/OaepEncoding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/OaepEncoding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/Pkcs1Encoding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/Pkcs1Encoding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesFastEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesFastEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesLightEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesLightEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesWrapEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesWrapEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/BlowfishEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/BlowfishEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaLightEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaLightEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaWrapEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaWrapEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast5Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast5Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast6Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast6Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaCha7539Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaCha7539Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaChaEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaChaEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeWrapEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeWrapEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624WrapEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624WrapEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ElGamalEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ElGamalEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/GOST28147Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/GOST28147Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC128Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC128Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC256Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC256Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ISAACEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ISAACEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IdeaEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IdeaEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IesEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IesEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NaccacheSternEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NaccacheSternEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NoekeonEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NoekeonEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NullEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NullEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2WrapEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2WrapEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC4Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC4Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC532Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC532Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC564Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC564Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC6Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC6Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3211WrapEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3211WrapEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3394WrapEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3394WrapEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindedEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindedEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindingEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindingEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSACoreEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSACoreEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RijndaelEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RijndaelEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RsaEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RsaEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDWrapEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDWrapEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM2Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM2Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM4Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM4Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Salsa20Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Salsa20Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngineBase.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngineBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SkipjackEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SkipjackEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TEAEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TEAEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ThreefishEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ThreefishEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TnepresEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TnepresEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TwofishEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TwofishEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCKSA3Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCKSA3Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XSalsa20Engine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XSalsa20Engine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XTEAEngine.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XTEAEngine.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BCrypt.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BCrypt.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BaseKdfBytesGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BaseKdfBytesGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHBasicKeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHBasicKeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyGeneratorHelper.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyGeneratorHelper.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersHelper.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersHelper.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesEdeKeyGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesEdeKeyGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesKeyGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesKeyGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaKeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaKeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaParametersGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaParametersGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ECKeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ECKeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed25519KeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed25519KeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed448KeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed448KeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalKeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalKeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalParametersGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalParametersGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410KeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410KeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410ParametersGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410ParametersGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/HKDFBytesGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/HKDFBytesGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf1BytesGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf1BytesGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf2BytesGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf2BytesGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Mgf1BytesGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Mgf1BytesGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/NaccacheSternKeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/NaccacheSternKeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenBsdBCrypt.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenBsdBCrypt.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenSSLPBEParametersGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenSSLPBEParametersGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs12ParametersGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs12ParametersGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S1ParametersGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S1ParametersGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S2ParametersGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S2ParametersGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Poly1305KeyGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Poly1305KeyGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RSABlindingFactorGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RSABlindingFactorGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RsaKeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RsaKeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/SCrypt.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/SCrypt.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X25519KeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X25519KeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X448KeyPairGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X448KeyPairGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/CipherStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/CipherStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestSink.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestSink.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacSink.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacSink.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerSink.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerSink.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CMac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CMac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CbcBlockCipherMac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CbcBlockCipherMac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CfbBlockCipherMac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CfbBlockCipherMac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7564Mac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7564Mac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7624Mac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7624Mac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GMac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GMac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GOST28147Mac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GOST28147Mac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/HMac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/HMac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/ISO9797Alg3Mac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/ISO9797Alg3Mac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/Poly1305.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/Poly1305.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SipHash.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SipHash.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SkeinMac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SkeinMac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/VMPCMac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/VMPCMac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CbcBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CbcBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CcmBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CcmBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CfbBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CfbBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CtsBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CtsBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/EAXBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/EAXBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GCMBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GCMBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GOFBBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GOFBBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/IAeadBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/IAeadBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCcmBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCcmBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCtrBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCtrBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OCBBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OCBBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OfbBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OfbBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OpenPgpCfbBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OpenPgpCfbBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/SicBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/SicBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmExponentiator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmExponentiator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/GcmUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/GcmUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmExponentiator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmExponentiator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables1kGcmExponentiator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables1kGcmExponentiator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables64kGcmMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables64kGcmMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables8kGcmMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables8kGcmMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/Asn1Signature.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/Asn1Signature.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureCalculator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureCalculator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureResult.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureResult.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierCalculator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierCalculator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierResult.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierResult.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/BlockCipherPadding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/BlockCipherPadding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO10126d2Padding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO10126d2Padding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO7816d4Padding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO7816d4Padding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/PaddedBufferedBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/PaddedBufferedBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/Pkcs7Padding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/Pkcs7Padding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/TbcPadding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/TbcPadding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/X923Padding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/X923Padding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ZeroBytePadding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ZeroBytePadding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/AEADParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/AEADParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/CcmParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/CcmParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPublicKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPublicKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHValidationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHValidationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DSAParameterGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DSAParameterGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesEdeParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesEdeParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPublicKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPublicKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaValidationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaValidationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECDomainParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECDomainParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPublicKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPublicKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519KeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519KeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PublicKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PublicKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448KeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448KeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PublicKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PublicKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPublicKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPublicKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410Parameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410Parameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PublicKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PublicKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410ValidationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410ValidationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/HKDFParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/HKDFParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ISO18033KDFParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ISO18033KDFParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesWithCipherParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesWithCipherParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KdfParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KdfParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KeyParameter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KeyParameter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MgfParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MgfParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPrivateParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPrivateParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPublicParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPublicParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternPrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternPrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithIV.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithIV.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithRandom.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithRandom.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSBox.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSBox.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSalt.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSalt.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC2Parameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC2Parameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC5Parameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC5Parameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RSABlindingParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RSABlindingParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaPrivateCrtKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaPrivateCrtKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePrivateParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePrivateParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePublicParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePublicParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SkeinParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SkeinParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Srp6GroupParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Srp6GroupParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/TweakableBlockCipherParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/TweakableBlockCipherParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519KeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519KeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PublicKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PublicKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448KeyGenerationParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448KeyGenerationParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PrivateKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PrivateKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PublicKeyParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PublicKeyParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/BasicEntropySourceProvider.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/BasicEntropySourceProvider.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiEntropySourceProvider.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiEntropySourceProvider.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiRandomGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiRandomGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/DigestRandomGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/DigestRandomGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/EntropyUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/EntropyUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IDrbgProvider.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IDrbgProvider.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IRandomGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IRandomGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ReversedWindowGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ReversedWindowGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandom.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandom.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandomBuilder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandomBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ThreadedSeedGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ThreadedSeedGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/VMPCRandomGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/VMPCRandomGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931Rng.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931Rng.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandom.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandom.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandomBuilder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandomBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/CtrSP800Drbg.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/CtrSP800Drbg.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/DrbgUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/DrbgUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HMacSP800Drbg.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HMacSP800Drbg.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HashSP800Drbg.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HashSP800Drbg.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/ISP80090Drbg.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/ISP80090Drbg.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaDigestSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaDigestSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECDsaSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECDsaSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECGOST3410Signer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECGOST3410Signer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECNRSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECNRSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519Signer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519Signer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519ctxSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519ctxSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519phSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519phSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448Signer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448Signer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448phSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448phSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410DigestSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410DigestSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410Signer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410Signer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GenericSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GenericSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/HMacDsaKCalculator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/HMacDsaKCalculator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaEncoding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaEncoding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaKCalculator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaKCalculator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2PssSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2PssSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2Signer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2Signer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IsoTrailers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IsoTrailers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PlainDsaEncoding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PlainDsaEncoding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PssSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PssSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RandomDsaKCalculator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RandomDsaKCalculator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RsaDigestSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RsaDigestSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/SM2Signer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/SM2Signer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/StandardDsaEncoding.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/StandardDsaEncoding.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/X931Signer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/X931Signer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsAgreementCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsAgreementCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCipherFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCipherFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsClient.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsClient.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsContext.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsContext.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsEncryptionCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsEncryptionCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsKeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsKeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsPeer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsPeer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsServer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsServer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSignerCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSignerCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertDescription.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertDescription.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertLevel.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertLevel.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BasicTlsPskIdentity.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BasicTlsPskIdentity.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BulkCipherAlgorithm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BulkCipherAlgorithm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueue.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueue.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueueStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueueStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertChainType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertChainType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Certificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Certificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateUrl.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateUrl.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Chacha20Poly1305.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Chacha20Poly1305.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ChangeCipherSpec.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ChangeCipherSpec.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherSuite.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherSuite.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientAuthenticationType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientAuthenticationType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientCertificateType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientCertificateType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CombinedHash.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CombinedHash.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CompressionMethod.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CompressionMethod.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ConnectionEnd.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ConnectionEnd.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ContentType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ContentType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DatagramTransport.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DatagramTransport.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsAgreementCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsAgreementCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsCipherFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsCipherFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsClient.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsClient.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsDHVerifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsDHVerifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsEncryptionCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsEncryptionCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsServer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsServer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSignerCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSignerCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSrpGroupVerifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSrpGroupVerifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DeferredHash.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DeferredHash.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigestInputBuffer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigestInputBuffer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigitallySigned.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigitallySigned.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsClientProtocol.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsClientProtocol.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsEpoch.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsEpoch.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsHandshakeRetransmit.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsHandshakeRetransmit.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsProtocol.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsProtocol.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReassembler.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReassembler.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsRecordLayer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsRecordLayer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReliableHandshake.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReliableHandshake.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReplayWindow.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReplayWindow.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsServerProtocol.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsServerProtocol.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsTransport.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsTransport.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECBasisType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECBasisType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECCurveType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECCurveType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECPointFormat.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECPointFormat.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/EncryptionAlgorithm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/EncryptionAlgorithm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExporterLabel.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExporterLabel.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExtensionType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExtensionType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/FiniteFieldDheGroup.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/FiniteFieldDheGroup.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HandshakeType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HandshakeType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HashAlgorithm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HashAlgorithm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatExtension.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatExtension.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessageType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessageType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMode.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMode.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/KeyExchangeAlgorithm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/KeyExchangeAlgorithm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MacAlgorithm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MacAlgorithm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MaxFragmentLength.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MaxFragmentLength.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NameType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NameType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NamedCurve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NamedCurve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NewSessionTicket.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NewSessionTicket.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/OcspStatusRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/OcspStatusRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PrfAlgorithm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PrfAlgorithm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ProtocolVersion.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ProtocolVersion.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsClient.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsClient.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsServer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsServer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/RecordStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/RecordStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SecurityParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SecurityParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerDHParams.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerDHParams.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerName.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerName.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerNameList.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerNameList.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerOnlyTlsAuthentication.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerOnlyTlsAuthentication.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerSrpParams.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerSrpParams.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SessionParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SessionParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAlgorithm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAlgorithm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAndHashAlgorithm.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAndHashAlgorithm.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignerInputBuffer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignerInputBuffer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SimulatedTlsSrpIdentityManager.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SimulatedTlsSrpIdentityManager.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsClient.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsClient.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsServer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsServer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrtpProtectionProfile.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrtpProtectionProfile.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Ssl3Mac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Ssl3Mac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataEntry.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataEntry.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAeadCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAeadCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAgreementCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAgreementCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAuthentication.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAuthentication.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsBlockCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsBlockCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipherFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipherFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClient.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClient.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContext.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContext.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContextImpl.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContextImpl.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientProtocol.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientProtocol.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCompression.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCompression.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsContext.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsContext.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHKeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHKeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHVerifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHVerifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDeflateCompression.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDeflateCompression.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDheKeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDheKeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDsaSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDsaSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDssSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDssSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDHKeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDHKeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDheKeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDheKeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDsaSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDsaSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEccUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEccUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEncryptionCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEncryptionCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsExtensionsUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsExtensionsUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlert.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlert.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlertReceived.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlertReceived.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsHandshakeHash.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsHandshakeHash.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsKeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsKeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsMac.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsMac.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNoCloseNotifyException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNoCloseNotifyException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCompression.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCompression.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPeer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPeer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocolHandler.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocolHandler.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentity.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentity.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentityManager.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentityManager.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskKeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskKeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaKeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaKeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContext.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContext.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContextImpl.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContextImpl.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerProtocol.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerProtocol.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSession.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSession.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSessionImpl.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSessionImpl.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSigner.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSigner.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSignerCredentials.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSignerCredentials.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpGroupVerifier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpGroupVerifier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpIdentityManager.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpIdentityManager.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpKeyExchange.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpKeyExchange.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpLoginParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpLoginParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrtpUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrtpUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStreamCipher.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStreamCipher.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UrlAndHash.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UrlAndHash.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UseSrtpData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UseSrtpData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UserMappingType.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UserMappingType.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util/Pack.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util/Pack.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/BigInteger.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/BigInteger.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/Primes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/Primes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECAlgorithms.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECAlgorithms.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECCurve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECCurve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECFieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECFieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECLookupTable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECLookupTable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPoint.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPoint.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPointMap.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPointMap.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/LongArray.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/LongArray.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleXPointMap.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleXPointMap.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleYPointMap.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleYPointMap.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/SimpleLookupTable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/SimpleLookupTable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/SimpleBigDecimal.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/SimpleBigDecimal.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/Tnaf.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/Tnaf.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/ZTauElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/ZTauElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571FieldElement.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571FieldElement.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Curve.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Curve.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Point.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Point.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/ECEndomorphism.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/ECEndomorphism.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvEndomorphism.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvEndomorphism.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBEndomorphism.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBEndomorphism.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/AbstractECMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/AbstractECMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/DoubleAddMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/DoubleAddMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ECMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ECMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointCombMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointCombMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointPreCompInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointPreCompInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/GlvMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/GlvMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/IPreCompCallback.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/IPreCompCallback.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MixedNafR2LMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MixedNafR2LMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MontgomeryLadderMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MontgomeryLadderMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafL2RMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafL2RMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafR2LMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafR2LMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/PreCompInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/PreCompInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ReferenceMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ReferenceMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ValidityPreCompInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ValidityPreCompInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafL2RMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafL2RMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafPreCompInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafPreCompInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafPreCompInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafPreCompInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448Field.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448Field.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed25519.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed25519.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed448.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed448.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/FiniteFields.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/FiniteFields.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GF2Polynomial.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GF2Polynomial.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GenericPolynomialExtensionField.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GenericPolynomialExtensionField.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IExtensionField.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IExtensionField.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IFiniteField.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IFiniteField.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomial.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomial.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomialExtensionField.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomialExtensionField.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/PrimeField.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/PrimeField.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Interleave.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Interleave.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Mod.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Mod.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat128.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat128.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat160.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat160.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat192.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat192.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat224.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat224.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat256.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat256.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat320.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat320.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat384.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat384.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat448.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat448.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat512.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat512.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat576.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat576.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPResp.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPResp.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPRespGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPRespGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReq.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReq.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReqGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReqGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPResp.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPResp.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPUtil.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/Req.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/Req.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespID.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespID.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RevokedStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RevokedStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/SingleResp.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/SingleResp.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/UnknownStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/UnknownStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/EncryptionException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/EncryptionException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/IPasswordFinder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/IPasswordFinder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/MiscPemGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/MiscPemGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMReader.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMReader.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMWriter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMWriter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PasswordException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PasswordException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/Pkcs8Generator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/Pkcs8Generator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/AsymmetricKeyEntry.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/AsymmetricKeyEntry.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/EncryptedPrivateKeyInfoFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/EncryptedPrivateKeyInfoFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PKCS12StoreBuilder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PKCS12StoreBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequestDelaySigned.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequestDelaySigned.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Entry.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Entry.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Store.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Store.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Utilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Utilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PrivateKeyInfoFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PrivateKeyInfoFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/X509CertificateEntry.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/X509CertificateEntry.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/CertStatus.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/CertStatus.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertChecker.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertChecker.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathBuilder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathValidator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathValidator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixBuilderParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixBuilderParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPath.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPath.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderResult.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderResult.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathChecker.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathChecker.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorResult.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorResult.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCrlUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCrlUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidatorException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidatorException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixPolicyNode.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixPolicyNode.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/ReasonsMask.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/ReasonsMask.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3280CertPathUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3280CertPathUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3281CertPathUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3281CertPathUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/TrustAnchor.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/TrustAnchor.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/AgreementUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/AgreementUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/CipherUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/CipherUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DigestUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DigestUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DotNetUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DotNetUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneralSecurityException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneralSecurityException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneratorUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneratorUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidKeyException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidKeyException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidParameterException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidParameterException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/KeyException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/KeyException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/MacUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/MacUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/NoSuchAlgorithmException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/NoSuchAlgorithmException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/ParameterUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/ParameterUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PbeUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PbeUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PrivateKeyFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PrivateKeyFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PublicKeyFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PublicKeyFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecureRandom.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecureRandom.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecurityUtilityException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecurityUtilityException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignatureException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignatureException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignerUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignerUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/WrapperUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/WrapperUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateEncodingException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateEncodingException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateExpiredException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateExpiredException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateNotYetValidException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateNotYetValidException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateParsingException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateParsingException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CrlException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CrlException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/GenTimeAccuracy.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/GenTimeAccuracy.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPAlgorithms.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPAlgorithms.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPUtil.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPValidationException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPValidationException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequest.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequest.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequestGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequestGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponse.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponse.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponseGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponseGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampToken.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampToken.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenInfo.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenInfo.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Arrays.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Arrays.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/BigIntegers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/BigIntegers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Enums.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Enums.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/IMemoable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/IMemoable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Integers.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Integers.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/MemoableResetException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/MemoableResetException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Platform.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Platform.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Strings.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Strings.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Times.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Times.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/TypeExtensions.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/TypeExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/CollectionUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/CollectionUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EmptyEnumerable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EmptyEnumerable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EnumerableProxy.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EnumerableProxy.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/HashSet.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/HashSet.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/ISet.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/ISet.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/LinkedDictionary.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/LinkedDictionary.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionary.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionary.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionaryProxy.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionaryProxy.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableList.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableList.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableListProxy.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableListProxy.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSet.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSet.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSetProxy.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSetProxy.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeObject.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeObject.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeUtilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeUtilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64Encoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64Encoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedDecoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedDecoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Hex.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Hex.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexTranslator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexTranslator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/IEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/IEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Translator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Translator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64Encoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64Encoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseInputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseInputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseOutputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseOutputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/FilterStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/FilterStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/NullOutputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/NullOutputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/PushbackStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/PushbackStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/StreamOverflowException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/StreamOverflowException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/Streams.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/Streams.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeInputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeInputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeOutputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeOutputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemGenerationException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemGenerationException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemHeader.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemHeader.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObject.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObject.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemReader.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemReader.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemWriter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemWriter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net/IPAddress.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net/IPAddress.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Adler32.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Adler32.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Deflate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Deflate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfBlocks.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfBlocks.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfCodes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfCodes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfTree.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfTree.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Inflate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Inflate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/JZlib.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/JZlib.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/StaticTree.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/StaticTree.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZDeflaterOutputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZDeflaterOutputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZInflaterInputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZInflaterInputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZInputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZInputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZOutputStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZOutputStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZTree.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZTree.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateHolder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateHolder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateIssuer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateIssuer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509AttributeCertificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509AttributeCertificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509Extension.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509Extension.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PEMParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PEMParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PrincipalUtil.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PrincipalUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/SubjectPublicKeyInfoFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/SubjectPublicKeyInfoFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509AttrCertParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509AttrCertParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Attribute.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Attribute.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertPairParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertPairParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Certificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Certificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificatePair.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificatePair.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificateParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificateParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Crl.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Crl.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlEntry.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlEntry.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlParser.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlParser.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509ExtensionBase.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509ExtensionBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509KeyUsage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509KeyUsage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509SignatureUtil.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509SignatureUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Utilities.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Utilities.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V1CertificateGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V1CertificateGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificate.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificate.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificateGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificateGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2CRLGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2CRLGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V3CertificateGenerator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V3CertificateGenerator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/AuthorityKeyIdentifierStructure.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/AuthorityKeyIdentifierStructure.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/SubjectKeyIdentifierStructure.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/SubjectKeyIdentifierStructure.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/X509ExtensionUtil.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/X509ExtensionUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Selector.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Selector.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Store.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Store.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509StoreParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509StoreParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/NoSuchStoreException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/NoSuchStoreException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509AttrCertStoreSelector.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509AttrCertStoreSelector.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertPairStoreSelector.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertPairStoreSelector.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertStoreSelector.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertStoreSelector.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStore.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStore.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStoreParameters.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStoreParameters.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CrlStoreSelector.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CrlStoreSelector.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreFactory.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreFactory.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSource.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSource.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSourceResponse.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSourceResponse.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/Message.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/Message.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication/IAuthenticationProvider.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication/IAuthenticationProvider.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Connection.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Connection.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Enums.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Enums.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/Hub.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/Hub.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/IHub.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/IHub.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/IJsonEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/IJsonEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ClientMessage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ClientMessage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/IServerMessage.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/IServerMessage.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ServerMessages.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ServerMessages.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/NegotiationData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/NegotiationData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PollingTransport.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PollingTransport.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PostSendTransportBase.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PostSendTransportBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/ServerSentEventsTransport.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/ServerSentEventsTransport.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/TransportBase.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/TransportBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/WebSocketTransport.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/WebSocketTransport.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication/DefaultAccessTokenAuthenticator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication/DefaultAccessTokenAuthenticator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HelperClasses.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HelperClasses.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HubConnection.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HubConnection.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/IAuthenticationProvider.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/IAuthenticationProvider.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/JsonProtocol.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/JsonProtocol.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Invocation.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Invocation.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Message.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Message.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/NegotiationResult.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/NegotiationResult.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports/WebsocketTransport.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports/WebsocketTransport.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Enums.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Enums.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Error.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Error.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventDescriptor.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventDescriptor.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventNames.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventNames.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventTable.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventTable.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/HandshakeData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/HandshakeData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Interfaces.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Interfaces.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/DefaultJSonEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/DefaultJSonEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/IJSonEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/IJSonEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Packet.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Packet.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Socket.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Socket.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketManager.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketManager.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketOptions.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketOptions.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/ITransport.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/ITransport.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/PollingTransport.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/PollingTransport.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/WebSocketTransport.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/WebSocketTransport.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics/Statistics.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics/Statistics.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/IExtension.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/IExtension.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/PerMessageCompression.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/PerMessageCompression.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrame.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrame.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameReader.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameReader.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameTypes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameTypes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocket.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocket.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketResponse.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketResponse.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketStatusCodes.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketStatusCodes.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTPDocumentationEN.pdf create mode 100644 JNFrame/Assets/Plugins/BestHTTP/BestHTTPDocumentationEN.pdf.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/AssetBundleSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/AssetBundleSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/LargeFileDownloadSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/LargeFileDownloadSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/TextureDownloadSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/TextureDownloadSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/UploadStream.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/UploadStream.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers/GUIHelper.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers/GUIHelper.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/IJsonWrapper.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/IJsonWrapper.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonData.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonData.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonException.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonException.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMapper.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMapper.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMockWrapper.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMockWrapper.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonReader.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonReader.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonWriter.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonWriter.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/Lexer.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/Lexer.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/ParserToken.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/ParserToken.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin/CacheMaintenanceSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin/CacheMaintenanceSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.unity create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.unity.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleCookieAuthentication.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleCookieAuthentication.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleHeaderAuthentication.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleHeaderAuthentication.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/AuthenticationSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/AuthenticationSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionAPISample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionAPISample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionStatusSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionStatusSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/DemoHubSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/DemoHubSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/JSonDotnetEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/JSonDotnetEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/LitJsonEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/LitJsonEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/SimpleStreamingSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/SimpleStreamingSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers/HeaderAuthenticator.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers/HeaderAuthenticator.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/JsonDotNetEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/JsonDotNetEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/LitJsonEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/LitJsonEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/MessagePackProtocol.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/MessagePackProtocol.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithAuthorization.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithAuthorization.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithPreAuthorizationSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithPreAuthorizationSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/RedirectSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/RedirectSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/TestHubExample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/TestHubExample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/JsonDotNetEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/JsonDotNetEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/LitJsonEncoder.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/LitJsonEncoder.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOChatSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOChatSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOWePlaySample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOWePlaySample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket/WebSocketSample.cs create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket/WebSocketSample.cs.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Plugins.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_EventSource.jslib create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_EventSource.jslib.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebRequest.jslib create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebRequest.jslib.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebSocket.jslib create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebSocket.jslib.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/ReleaseNotes.txt create mode 100644 JNFrame/Assets/Plugins/BestHTTP/ReleaseNotes.txt.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - Editor.csproj create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - Editor.csproj.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - UWP.csproj create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - UWP.csproj.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - Editor.csproj create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - Editor.csproj.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - General.csproj create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - General.csproj.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - UWP.csproj create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - UWP.csproj.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - WebGL.csproj create mode 100644 JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - WebGL.csproj.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/license.txt create mode 100644 JNFrame/Assets/Plugins/BestHTTP/license.txt.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/link.xml create mode 100644 JNFrame/Assets/Plugins/BestHTTP/link.xml.meta create mode 100644 JNFrame/Assets/Plugins/BestHTTP/link_android_subset.xml create mode 100644 JNFrame/Assets/Plugins/BestHTTP/link_android_subset.xml.meta create mode 100644 JNFrame/Assets/Plugins/JNGame.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/JNGame.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/JNGame.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/NSystem.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/NSystem.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Action.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Action/NActionEnum.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Action/NActionEnum.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Entity.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/JNSocket.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/JNSocket.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Proto.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.proto create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.proto.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.proto create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.proto.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Util.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Util/NDataUtil.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Network/Util/NDataUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Sync.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Sync/Frame.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Sync/Frame/JNSyncFrame.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Sync/Frame/JNSyncFrame.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Sync/Frame/game.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Sync/Frame/game/JNSyncFrameComponent.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Sync/Frame/game/JNSyncFrameComponent.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/System.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/System/SystemBase.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/System/SystemBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/UI.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Util.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/EventDispatcher.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/EventDispatcher.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/ProtoUtil.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/ProtoUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/RandomUtil.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/RandomUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/Singleton.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/Singleton.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/SingletonScene.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/SingletonScene.cs.meta create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/ToUtil.cs create mode 100644 JNFrame/Assets/Plugins/JNGame/Util/ToUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Editor.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Editor/SplitterGUILayout.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Editor/SplitterGUILayout.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Editor/UniTask.Editor.asmdef create mode 100644 JNFrame/Assets/Plugins/UniTask/Editor/UniTask.Editor.asmdef.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerTreeView.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerTreeView.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerWindow.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerWindow.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/AsyncLazy.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/AsyncLazy.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/AsyncReactiveProperty.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/AsyncReactiveProperty.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/AsyncUnit.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/AsyncUnit.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenEqualityComparer.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenEqualityComparer.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenSourceExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenSourceExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Channel.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Channel.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/EnumerableAsyncExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/EnumerableAsyncExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/EnumeratorAsyncExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/EnumeratorAsyncExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/ExceptionExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/ExceptionExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/UniTask.Addressables.asmdef create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/UniTask.Addressables.asmdef.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/DOTweenAsyncExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/DOTweenAsyncExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/UniTask.DOTween.asmdef create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/UniTask.DOTween.asmdef.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.InputField.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.InputField.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/UniTask.TextMeshPro.asmdef create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/UniTask.TextMeshPro.asmdef.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskAsyncEnumerable.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskAsyncEnumerable.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskSource.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskSource.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPool.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPool.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPoolUtil.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPoolUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayUtil.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayUtil.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/DiagnosticsExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/DiagnosticsExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/Error.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/Error.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PooledDelegate.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PooledDelegate.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/RuntimeHelpersAbstraction.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/RuntimeHelpersAbstraction.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/StatePool.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/StatePool.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/TaskTracker.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/TaskTracker.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityEqualityComparer.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityEqualityComparer.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ValueStopwatch.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ValueStopwatch.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/WeakDictionary.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Internal/WeakDictionary.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/All.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/All.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Any.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Any.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsUniTaskAsyncEnumerable.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsUniTaskAsyncEnumerable.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsyncEnumeratorBase.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsyncEnumeratorBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Average.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Average.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Count.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Count.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Create.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Create.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Do.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Do.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Except.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Except.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/First.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/First.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Join.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Join.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Last.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Last.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Max.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Max.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Merge.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Merge.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Min.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Min.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Never.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Never.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Pairwise.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Pairwise.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Publish.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Publish.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Queue.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Queue.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Range.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Range.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Return.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Return.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Select.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Select.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Single.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Single.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Subscribe.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Subscribe.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Take.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Take.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntil.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntil.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntilCanceled.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntilCanceled.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToObservable.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToObservable.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UniTask.Linq.asmdef create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UniTask.Linq.asmdef.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Union.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Union.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryValueChanged.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryValueChanged.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Where.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Where.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/MoveNextSource.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/MoveNextSource.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopTimer.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopTimer.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Progress.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Progress.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/TaskPool.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/TaskPool.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/TimeoutController.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/TimeoutController.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/TriggerEvent.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/TriggerEvent.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncAwakeTrigger.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncAwakeTrigger.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncDestroyTrigger.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncDestroyTrigger.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncStartTrigger.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncStartTrigger.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Bridge.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Bridge.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Delay.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Delay.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Factory.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Factory.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Threading.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Threading.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WaitUntil.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WaitUntil.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.Generated.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.Generated.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.Generated.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.Generated.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.asmdef create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.asmdef.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.Shorthand.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.Shorthand.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskObservableExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskObservableExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskScheduler.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskScheduler.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskSynchronizationContext.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskSynchronizationContext.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskVoid.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskVoid.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AssetBundleRequestAllAssets.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AssetBundleRequestAllAssets.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AsyncGPUReadback.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AsyncGPUReadback.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.Jobs.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.Jobs.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.MonoBehaviour.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.MonoBehaviour.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAwaitableExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityAwaitableExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/_InternalVisibleTo.cs create mode 100644 JNFrame/Assets/Plugins/UniTask/Runtime/_InternalVisibleTo.cs.meta create mode 100644 JNFrame/Assets/Plugins/UniTask/package.json create mode 100644 JNFrame/Assets/Plugins/UniTask/package.json.meta create mode 100644 JNFrame/Assets/Resources.meta create mode 100644 JNFrame/Assets/Scenes.meta create mode 100644 JNFrame/Assets/Scenes/Main.unity create mode 100644 JNFrame/Assets/Scenes/Main.unity.meta create mode 100644 JNFrame/Assets/Scenes/UIScene.unity create mode 100644 JNFrame/Assets/Scenes/UIScene.unity.meta create mode 100644 JNFrame/Assets/Scenes/WorldScene.unity create mode 100644 JNFrame/Assets/Scenes/WorldScene.unity.meta create mode 100644 JNFrame/Assets/Script.meta create mode 100644 JNFrame/Assets/Script/App.cs create mode 100644 JNFrame/Assets/Script/App.cs.meta create mode 100644 JNFrame/Assets/Script/AppImpl.meta create mode 100644 JNFrame/Assets/Script/AppImpl/JNGSocket.cs create mode 100644 JNFrame/Assets/Script/AppImpl/JNGSocket.cs.meta create mode 100644 JNFrame/Assets/Script/AppImpl/JNGSyncFrame.cs create mode 100644 JNFrame/Assets/Script/AppImpl/JNGSyncFrame.cs.meta create mode 100644 JNFrame/Assets/Script/Main.cs create mode 100644 JNFrame/Assets/Script/Main.cs.meta create mode 100644 JNFrame/Assets/Script/UIMain.cs create mode 100644 JNFrame/Assets/Script/UIMain.cs.meta create mode 100644 JNFrame/Assets/Script/battle.meta create mode 100644 JNFrame/Assets/Script/battle/GBaseMode.cs create mode 100644 JNFrame/Assets/Script/battle/GBaseMode.cs.meta create mode 100644 JNFrame/Assets/Script/battle/GBattleModeManager.cs create mode 100644 JNFrame/Assets/Script/battle/GBattleModeManager.cs.meta create mode 100644 JNFrame/Assets/packages.config create mode 100644 JNFrame/Assets/packages.config.meta create mode 100644 JNFrame/JNFrame.sln create mode 100644 JNFrame/Logs/AssetImportWorker0-prev.log create mode 100644 JNFrame/Logs/AssetImportWorker0.log create mode 100644 JNFrame/Logs/AssetImportWorker1-prev.log create mode 100644 JNFrame/Logs/AssetImportWorker1.log create mode 100644 JNFrame/Logs/AssetImportWorker2.log create mode 100644 JNFrame/Logs/AssetImportWorker3.log create mode 100644 JNFrame/Logs/Packages-Update.log create mode 100644 JNFrame/Logs/shadercompiler-AssetImportWorker0.log create mode 100644 JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe0.log create mode 100644 JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe1.log create mode 100644 JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe2.log create mode 100644 JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe3.log create mode 100644 JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe4.log create mode 100644 JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe5.log create mode 100644 JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe6.log create mode 100644 JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe7.log create mode 100644 JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe8.log create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/.signature.p7s create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/LICENSE.TXT create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/System.Buffers.4.4.0.nupkg create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/THIRD-PARTY-NOTICES.TXT create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/lib/netcoreapp2.0/_._ create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard1.1/System.Buffers.dll create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard1.1/System.Buffers.xml create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.xml create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/ref/netcoreapp2.0/_._ create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard1.1/System.Buffers.dll create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard1.1/System.Buffers.xml create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard2.0/System.Buffers.dll create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard2.0/System.Buffers.xml create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/useSharedDesignerContext.txt create mode 100644 JNFrame/Packages/System.Buffers.4.4.0/version.txt create mode 100644 JNFrame/Packages/System.Memory.4.5.3/.signature.p7s create mode 100644 JNFrame/Packages/System.Memory.4.5.3/LICENSE.TXT create mode 100644 JNFrame/Packages/System.Memory.4.5.3/System.Memory.4.5.3.nupkg create mode 100644 JNFrame/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT create mode 100644 JNFrame/Packages/System.Memory.4.5.3/lib/netcoreapp2.1/_._ create mode 100644 JNFrame/Packages/System.Memory.4.5.3/lib/netstandard1.1/System.Memory.dll create mode 100644 JNFrame/Packages/System.Memory.4.5.3/lib/netstandard1.1/System.Memory.xml create mode 100644 JNFrame/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll create mode 100644 JNFrame/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml create mode 100644 JNFrame/Packages/System.Memory.4.5.3/ref/netcoreapp2.1/_._ create mode 100644 JNFrame/Packages/System.Memory.4.5.3/useSharedDesignerContext.txt create mode 100644 JNFrame/Packages/System.Memory.4.5.3/version.txt create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/.signature.p7s create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/LICENSE.TXT create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/System.Numerics.Vectors.4.4.0.nupkg create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/THIRD-PARTY-NOTICES.TXT create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/MonoAndroid10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/MonoTouch10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/net46/System.Numerics.Vectors.dll create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/net46/System.Numerics.Vectors.xml create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netcoreapp2.0/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard1.0/System.Numerics.Vectors.dll create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard1.0/System.Numerics.Vectors.xml create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard2.0/System.Numerics.Vectors.dll create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard2.0/System.Numerics.Vectors.xml create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.xml create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarinios10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarinmac20/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarintvos10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarinwatchos10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/MonoAndroid10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/MonoTouch10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/net46/System.Numerics.Vectors.dll create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/net46/System.Numerics.Vectors.xml create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netcoreapp2.0/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netstandard1.0/System.Numerics.Vectors.dll create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netstandard1.0/System.Numerics.Vectors.xml create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netstandard2.0/System.Numerics.Vectors.dll create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netstandard2.0/System.Numerics.Vectors.xml create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarinios10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarinmac20/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarintvos10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarinwatchos10/_._ create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/useSharedDesignerContext.txt create mode 100644 JNFrame/Packages/System.Numerics.Vectors.4.4.0/version.txt create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/.signature.p7s create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.4.5.2.nupkg create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.xml create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt create mode 100644 JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt create mode 100644 JNFrame/Packages/manifest.json create mode 100644 JNFrame/Packages/packages-lock.json create mode 100644 JNFrame/ProjectSettings/AudioManager.asset create mode 100644 JNFrame/ProjectSettings/AutoStreamingSettings.asset create mode 100644 JNFrame/ProjectSettings/ClusterInputManager.asset create mode 100644 JNFrame/ProjectSettings/DynamicsManager.asset create mode 100644 JNFrame/ProjectSettings/EditorBuildSettings.asset create mode 100644 JNFrame/ProjectSettings/EditorSettings.asset create mode 100644 JNFrame/ProjectSettings/GraphicsSettings.asset create mode 100644 JNFrame/ProjectSettings/InputManager.asset create mode 100644 JNFrame/ProjectSettings/MemorySettings.asset create mode 100644 JNFrame/ProjectSettings/NavMeshAreas.asset create mode 100644 JNFrame/ProjectSettings/PackageManagerSettings.asset create mode 100644 JNFrame/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json create mode 100644 JNFrame/ProjectSettings/Physics2DSettings.asset create mode 100644 JNFrame/ProjectSettings/PresetManager.asset create mode 100644 JNFrame/ProjectSettings/ProjectSettings.asset create mode 100644 JNFrame/ProjectSettings/ProjectVersion.txt create mode 100644 JNFrame/ProjectSettings/QualitySettings.asset create mode 100644 JNFrame/ProjectSettings/SceneTemplateSettings.json create mode 100644 JNFrame/ProjectSettings/TagManager.asset create mode 100644 JNFrame/ProjectSettings/TimeManager.asset create mode 100644 JNFrame/ProjectSettings/UnityConnectSettings.asset create mode 100644 JNFrame/ProjectSettings/VFXManager.asset create mode 100644 JNFrame/ProjectSettings/VersionControlSettings.asset create mode 100644 JNFrame/ProjectSettings/XRSettings.asset create mode 100644 JNFrame/ProjectSettings/boot.config create mode 100644 JNFrame/UniTask.Addressables.csproj create mode 100644 JNFrame/UniTask.DOTween.csproj create mode 100644 JNFrame/UniTask.Editor.csproj create mode 100644 JNFrame/UniTask.Linq.csproj create mode 100644 JNFrame/UniTask.TextMeshPro.csproj create mode 100644 JNFrame/UniTask.csproj create mode 100644 JNFrame/UserSettings/EditorUserSettings.asset create mode 100644 JNFrame/UserSettings/Layouts/default-2021.dwlt create mode 100644 JNFrame/UserSettings/Search.settings create mode 100644 JNFrame/obj/Debug/.NETFramework,Version=v4.7.1.AssemblyAttributes.cs create mode 100644 JNFrame/obj/Debug/Assembly-CSharp-Editor.csproj.AssemblyReference.cache create mode 100644 JNFrame/obj/Debug/Assembly-CSharp-firstpass.csproj.AssemblyReference.cache create mode 100644 JNFrame/obj/Debug/Assembly-CSharp.csproj.AssemblyReference.cache create mode 100644 JNFrame/obj/Debug/UniTask.Addressables.csproj.AssemblyReference.cache create mode 100644 JNFrame/obj/Debug/UniTask.DOTween.csproj.AssemblyReference.cache create mode 100644 JNFrame/obj/Debug/UniTask.Editor.csproj.AssemblyReference.cache create mode 100644 JNFrame/obj/Debug/UniTask.Linq.csproj.AssemblyReference.cache create mode 100644 JNFrame/obj/Debug/UniTask.TextMeshPro.csproj.AssemblyReference.cache create mode 100644 JNFrame/obj/Debug/UniTask.csproj.AssemblyReference.cache create mode 100644 JNFrame/packages.config diff --git a/JNFrame/App.config b/JNFrame/App.config new file mode 100644 index 00000000..bc95b853 --- /dev/null +++ b/JNFrame/App.config @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assembly-CSharp-Editor.csproj b/JNFrame/Assembly-CSharp-Editor.csproj new file mode 100644 index 00000000..4eb2afca --- /dev/null +++ b/JNFrame/Assembly-CSharp-Editor.csproj @@ -0,0 +1,63 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {520fb43a-8c94-8ecf-d51a-d5407030f9ec} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + Assembly-CSharp-Editor + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\Unity.Rider.Editor\ + UNITY_EDITOR + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + + + diff --git a/JNFrame/Assembly-CSharp-firstpass.csproj b/JNFrame/Assembly-CSharp-firstpass.csproj new file mode 100644 index 00000000..d6e233d1 --- /dev/null +++ b/JNFrame/Assembly-CSharp-firstpass.csproj @@ -0,0 +1,2531 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {e5544f0c-cd3e-f7be-dc52-046b131df43d} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + Assembly-CSharp-firstpass + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\Assembly-CSharp-firstpass\ + UNITY_2021_3_27;UNITY_2021_3;UNITY_2021;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;UNITY_UGP_API;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_IG;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsNativeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIWidgetsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UNETModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.PackageManagerUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIServiceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\Google.Protobuf.3.15.8\lib\netstandard2.0\Google.Protobuf.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\ref\2.1.0\netstandard.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\Microsoft.Win32.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.AppContext.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Buffers.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Concurrent.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.NonGeneric.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Specialized.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Console.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Data.Common.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Contracts.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Debug.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Process.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.StackTrace.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tools.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TraceSource.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tracing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Drawing.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Dynamic.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Calendars.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.ZipFile.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.IsolatedStorage.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Pipes.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Expressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Queryable.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Memory.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Http.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NameResolution.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NetworkInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Ping.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Requests.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Security.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Sockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebHeaderCollection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.Client.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Numerics.Vectors.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ObjectModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.DispatchProxy.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Reader.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.ResourceManager.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Writer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Handles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Json.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Claims.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Csp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Principal.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.SecureString.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.RegularExpressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Overlapped.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Thread.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.ThreadPool.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Timer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ValueTuple.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.ReaderWriter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlSerializer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\Extensions\2.0.0\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\mscorlib.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ComponentModel.Composition.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Core.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Data.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Drawing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.IO.Compression.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Net.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Runtime.Serialization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ServiceModel.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Transactions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Windows.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Serialization.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Flow.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VSCode.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Shared.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TextMeshPro.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualStudio.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.Performance.Profile-Analyzer.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TestTools.CodeCoverage.Editor.OpenCover.Model.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.Timeline.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.Timeline.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Core.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TextMeshPro.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.State.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.SettingsProvider.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TestTools.CodeCoverage.Editor.OpenCover.Mono.Reflection.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Flow.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.PlasticSCM.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.Rider.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TestTools.CodeCoverage.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEngine.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.State.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Core.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.EditorCoroutines.Editor.dll + + + + + {4b964c85-7c9d-2d07-a2e0-8595262e4e96} + UniTask.TextMeshPro + + + {99c4c7d2-ca96-1038-95e0-77e225df2b06} + UniTask.DOTween + + + {39f5acb9-cdbb-9f48-497c-14159a0afd38} + UniTask + + + {6d8bd378-3e5b-6997-5e5e-288243f0f72b} + UniTask.Addressables + + + {7f60f694-1f75-f2f0-5fde-36ccb7fd82d1} + UniTask.Linq + + + + + diff --git a/JNFrame/Assembly-CSharp.csproj b/JNFrame/Assembly-CSharp.csproj new file mode 100644 index 00000000..a389f015 --- /dev/null +++ b/JNFrame/Assembly-CSharp.csproj @@ -0,0 +1,801 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {3ca4410c-c33b-25ce-55bc-3a432b9830ed} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + Assembly-CSharp + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\Assembly-CSharp\ + UNITY_2021_3_27;UNITY_2021_3;UNITY_2021;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;UNITY_UGP_API;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_IG;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsNativeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIWidgetsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UNETModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.PackageManagerUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIServiceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\Google.Protobuf.3.15.8\lib\netstandard2.0\Google.Protobuf.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\ref\2.1.0\netstandard.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\Microsoft.Win32.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.AppContext.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Buffers.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Concurrent.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.NonGeneric.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Specialized.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Console.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Data.Common.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Contracts.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Debug.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Process.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.StackTrace.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tools.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TraceSource.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tracing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Drawing.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Dynamic.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Calendars.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.ZipFile.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.IsolatedStorage.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Pipes.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Expressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Queryable.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Memory.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Http.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NameResolution.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NetworkInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Ping.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Requests.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Security.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Sockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebHeaderCollection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.Client.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Numerics.Vectors.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ObjectModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.DispatchProxy.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Reader.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.ResourceManager.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Writer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Handles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Json.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Claims.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Csp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Principal.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.SecureString.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.RegularExpressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Overlapped.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Thread.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.ThreadPool.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Timer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ValueTuple.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.ReaderWriter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlSerializer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\Extensions\2.0.0\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\mscorlib.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ComponentModel.Composition.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Core.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Data.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Drawing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.IO.Compression.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Net.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Runtime.Serialization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ServiceModel.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Transactions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Windows.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Serialization.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Flow.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VSCode.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Shared.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TextMeshPro.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualStudio.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.Performance.Profile-Analyzer.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TestTools.CodeCoverage.Editor.OpenCover.Model.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.Timeline.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.Timeline.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Core.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TextMeshPro.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.State.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.SettingsProvider.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TestTools.CodeCoverage.Editor.OpenCover.Mono.Reflection.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Flow.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.PlasticSCM.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.Rider.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TestTools.CodeCoverage.Editor.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEngine.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.State.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.VisualScripting.Core.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.EditorCoroutines.Editor.dll + + + + + {e5544f0c-cd3e-f7be-dc52-046b131df43d} + Assembly-CSharp-firstpass + + + {4b964c85-7c9d-2d07-a2e0-8595262e4e96} + UniTask.TextMeshPro + + + {99c4c7d2-ca96-1038-95e0-77e225df2b06} + UniTask.DOTween + + + {39f5acb9-cdbb-9f48-497c-14159a0afd38} + UniTask + + + {6d8bd378-3e5b-6997-5e5e-288243f0f72b} + UniTask.Addressables + + + {7f60f694-1f75-f2f0-5fde-36ccb7fd82d1} + UniTask.Linq + + + + + diff --git a/JNFrame/Assets/NuGet.config b/JNFrame/Assets/NuGet.config new file mode 100644 index 00000000..82fb1c87 --- /dev/null +++ b/JNFrame/Assets/NuGet.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/NuGet.config.meta b/JNFrame/Assets/NuGet.config.meta new file mode 100644 index 00000000..d327f1b6 --- /dev/null +++ b/JNFrame/Assets/NuGet.config.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: ce5d180ef4cefe947b2cd08b26c11bc1 +labels: +- NuGetForUnity +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/NuGet.meta b/JNFrame/Assets/NuGet.meta new file mode 100644 index 00000000..27037b55 --- /dev/null +++ b/JNFrame/Assets/NuGet.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dbf134857daf7df428aa31cdd055514f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/NuGet/Editor.meta b/JNFrame/Assets/NuGet/Editor.meta new file mode 100644 index 00000000..3b6fd6bc --- /dev/null +++ b/JNFrame/Assets/NuGet/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b3fad56c531ac5a4db190a745f589a8e +folderAsset: yes +timeCreated: 1510280304 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/NuGet/Editor/NugetForUnity.dll b/JNFrame/Assets/NuGet/Editor/NugetForUnity.dll new file mode 100644 index 0000000000000000000000000000000000000000..d010342447f4d95d79129bdb82c032d8f00a2dd4 GIT binary patch literal 187904 zcmbrn2YejG+4#TOJMC4;TAg$!%SEz5V!7fk7u5k_o!C9{w zKIg1UFZC}UKKs1kV8f-u>n|NX;HcwA2PAyUU*uY=hzBlz3G2+)3#$Cza>Jm2_ zk5XU4dP+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S4~(2V z8Cl@HJHGRDBVj~Vx0l{y=FIR&v3F*ABx!Ve)T-wZg`u~0Kt$%vsz^-orZTs^kj|=uJ z`TZYa?Z6r^3#c3(9-A~1Gb7+!v1fFgB*M?{*8xc7)b-ZCecm7iJR#s6#stX@jD8H> z?Noi8?GEDqqbTFdvXT@1%%-90<`Kg`)A6hw-m3eT|DzIJ zhck|%-w*O8et70YMJ}0r`0@aig?IbHQ9c^ZS5xq3t@PpxR=GsTML!ni_2o&@zO?N&L-BV?6j7>}Tp`vcbO z>z2Lvf)3-&|64vsr#DzCeU888zkwylw$L9Q{v8Z_e=yXhO_SVHtB4 zZK|&oa`;MMp5 literal 0 HcmV?d00001 diff --git a/JNFrame/Assets/NuGet/Editor/NugetForUnity.dll.meta b/JNFrame/Assets/NuGet/Editor/NugetForUnity.dll.meta new file mode 100644 index 00000000..833aac7d --- /dev/null +++ b/JNFrame/Assets/NuGet/Editor/NugetForUnity.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 8dc1be91775c4bb469f6b74cef450eaa +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/NuGet/LICENSE b/JNFrame/Assets/NuGet/LICENSE new file mode 100644 index 00000000..e5e72104 --- /dev/null +++ b/JNFrame/Assets/NuGet/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Patrick McCarthy + +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. diff --git a/JNFrame/Assets/NuGet/LICENSE.meta b/JNFrame/Assets/NuGet/LICENSE.meta new file mode 100644 index 00000000..9de0ac8d --- /dev/null +++ b/JNFrame/Assets/NuGet/LICENSE.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d9014b99ad06af428514a5902d29ff3 +timeCreated: 1573248500 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/NuGet/README.pdf b/JNFrame/Assets/NuGet/README.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e67f9fa5922f206ddc30562e92cf9ed7e8381e04 GIT binary patch literal 246595 zcmbTe1z6Nu+dhiA6-5zILP0=Lx?6G-1f;tgq@=qCwty%|NFy z8Nb655@Hi`G&ORzb9_QCXXj~YZEeKH!^-|dmtMot_N|?p(-V2sCmigo?1E3g2fW;Z zPuzLAbs3(#vbVQ3)i5=dv2=L z%ErsZ%FfEg$;Hq5g8PYzk(rUB+P!r#F$F_Vv9dH`10#K6!^;J}xEz|L zo$YHQXVWM2uLU^SIbN`HvU78CaB*_;FtM}Kf&aj9a&~Y3pAQic!7~Mq10I<3-w&?p zVQ>0`O;f@6ovDd49-E4bvGe68QZ`2Br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Wid_J7;E--soDU`qZ5E0Op~bg*^#&-w}kf`6ua5cJRPf`Na~ zN4WlNcTp!3g%2@Au>ZuXSlc2{*RDSt{3WUVtR((9djRx5MZo!k9q?zs%}=b$|4XV3 z041dl2B9MP0rYPL0~CgW8Nk@NxVV9+;QpgxKrtl#^*H{$U_jN;_C_402)myp0-Fm8 zAjF1nvSRyN0by)pWcatT;g`kvJNf6ITydOjjf`II@@k=`>7mynTc=^S~4F&$C9XIsn znf#?4fD_F5`>_B{D1h^~{s5?k+$iM9pT_{8$U~^Q=vNzv6a1GkKtLe$_i;f$C>V7) z|D`{a4ffmI03aYY3{|@R+K!7GhPuf9W`m*FN59!XoPU`ID!_i;fBkwah#T;id4M^8 zKlcC#4EC4)pqyMNuF0?cp%U*;%)>8ZKmowN^alliexC;r6m8=7 z^Ng~AQC0RYmF2&W3xI)tmL-3l2M_>*p-3LT+JKxO?%$6E zazcKBwSGAk$jSZlHsn_uD%yVU4+I3G_WrN!KwO+$zxxd0f}s-iZ|%US+5K;uy{(=Z z>bih~N@R*=t|+Jqiu>^jfv|t@b5s6IyHZxhhzF>S|DbxIxInh{e{5h1&v#bIO= HlNbMAQybwF literal 0 HcmV?d00001 diff --git a/JNFrame/Assets/NuGet/README.pdf.meta b/JNFrame/Assets/NuGet/README.pdf.meta new file mode 100644 index 00000000..e95001a0 --- /dev/null +++ b/JNFrame/Assets/NuGet/README.pdf.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 83c5d2001771f15429a88d67e81366d6 +timeCreated: 1517876157 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/NuGet/Resources.meta b/JNFrame/Assets/NuGet/Resources.meta new file mode 100644 index 00000000..49a5e3b4 --- /dev/null +++ b/JNFrame/Assets/NuGet/Resources.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1738075a39a390447b7a620ca6962142 +folderAsset: yes +timeCreated: 1510280362 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/NuGet/Resources/defaultIcon.png b/JNFrame/Assets/NuGet/Resources/defaultIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..a16cc1989ebe2038ab00f914223a2a4a26b4ee9d GIT binary patch literal 4415 zcmV-F5y0+=P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vHLFN5^(?k02y>eSaefwW^{L9 za%BK;VQFr3E^cLXAT%y8E-^XO*0N*(01&T9L_t(|UhQ2CkQ_x7o>LK2ek?&tL_kzT zK;$P<1xPrmxZ9q+3k0m3lnPc+NCYupgaq<)*FAd#W5hzB2n0$($!|eH6&mD65GV=^ zCV>2efB__6FbM?#f#WBJ_`cVDa68j;JNq-cJ3IYVy_&t7o}TIM*WIt*d;QvrL6_Gp zckq05iYMeBJ)u?;y-V~S(M$CIB}CJ_Uik%1>(D_MkXw7cEKvi$PPDlKy-8^ocs*xr zXP$P*GpcyY-Y?5T$o1Zo-+s!ZaA<2l!&laL5bj9WOA5^QLcLLz2N z2i3)v=a)GlFe`vnFWP`_)7;);Qp7_92UFVrMxU4GnG_Cf514e>suyZRD0zfD+&&VZ z=TqbRGCX~NM%b?4kQqP~yui|sM6BewoR@l#_F3TLIsam7&u0q$;8ej`1MK-iJ!NlD z5H0KUQtx%TmJ57iNvIc$lZZp+AWC~vFJEhI*d!$6YdkGDWEh3H`%+`BiZpH|Vr?Q# z4bDBR0|0wIOuDe@*&4f?MtIJ5!+wVWLL94j<$P-7hv>SVuJ0RJ;1!}}^uP01+IIq9 zhXV>7X!W4l1>tvVlssKt|2aDm)A_`JrxPiL7mcvBa3lFA*jM=!wc{N%v3u%qyU#ZZSQlU>L zrujboE)X5s5mX3zsYee`8K+U%7E*cdrvE3|r3GaigvjHQx%0IH^m3Dyn#94j0*#VT z8|b>2(jM*&$WPLfd6I^^ya_bVi(n$v!6igkCD`jp(+5;vi#&hYmgf031sYPwt1Sii zh=f{0%<&6vlKixJ%As3sMRfyD?n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d??Ta14+l`s998xsOu$><+25(|(-^ zHHnV9!O?HL3<;@B>a`jmA{^h;Xpv@ijAnV}J$&J)hmp!)0VbXuBnJ z{{RltmIOMeBc-Kf^YOYkAgUmb=6vk= zujR(97LEZL1W5Zh)+SOmA|W5CIg&{jaA!v}b?bZ7-;xE}90SJy4M7*r=XPly+t+t6 z=^BGR`9(XkL6Ia+GpUlnF+c;Ll{~g}{u&O?o(6D4KXd}&cMAFMs^T9z2511ZhA&hm z64;8RNhU=)=;NiPCEOjY9+JW_K%GGBBB7qOlxa!L0$)m!48BWs7>;`OY$A)HV}LpU zPoD7M6)@~Tx8F=?G-)bB1QV(L z!=6m*%-s}VKdYxYH>P$2ABSu4&VffzS|Mrs=I&{Kr+m@#XH{PQjiShoreOwHW$vZ` zA+HR*3=FW)+|4R*AoffuOLQ*9&Y(u?1#nWTP4MHnT>i|YN``_uBbtxA)7(t~`T*zf z3-6*kjoa|p3c&Iv_a`GSEviK(LB>Jl!(P33CLm%Tz9;B%ev>+&|un~Eqa2Q2re@zQiLe&O)s--bgWW>ZFgWO<+Jdn!?sZO z*ELjQTe+3Vnxd7({&{872Rz#}Z`x)7b3ODN*s&8XZ}misgmpf3lxn5@vEbgX9uDOV z#(JjW*^3Q>RzO5KP^eiZMQ4G}E0$+d8R5bmBh1B+wl%Dz>&&W@JaG_1kWp;H-_K2o zCO~uH%E(6u5}x`y_&_I?>P!231vQV#`v8>}yNWhY>j%eBVJ-6`&6`s?MIampu-8L@#7E%G-chTR>8eMIZ4=q^ zs{wbqpEt%PfL>y*i#K&T5FBzk=-!Z3)c;w?#hs zLtWM z{;36|*s$%{BV87laaYmrJL!56HT+MtS5OTuVdKK{{tvFY{eH4LE8GA8002ovPDHLk FV1mv%Ns0gf literal 0 HcmV?d00001 diff --git a/JNFrame/Assets/NuGet/Resources/defaultIcon.png.meta b/JNFrame/Assets/NuGet/Resources/defaultIcon.png.meta new file mode 100644 index 00000000..d23111ab --- /dev/null +++ b/JNFrame/Assets/NuGet/Resources/defaultIcon.png.meta @@ -0,0 +1,88 @@ +fileFormatVersion: 2 +guid: eec19781926cd2248b7c9abfde8db555 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: -1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 215e43cda847e6d44af8b40376eeed8a + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages.meta b/JNFrame/Assets/Packages.meta new file mode 100644 index 00000000..d1263c8c --- /dev/null +++ b/JNFrame/Assets/Packages.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f5ddeed46214a6549ad76520afa1f466 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/Google.Protobuf.3.15.8.meta b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8.meta new file mode 100644 index 00000000..2145a8cd --- /dev/null +++ b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4e6b7d62fcb9ab846a7e98ef1d3266dd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/.signature.p7s b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..9022ef6e9399872b1746eaaa08d208ec32ee7eb8 GIT binary patch literal 18165 zcmeHvc|4U{+rK^7=6Rksl9_vNvq&-%88Sr0whfutrbM)Nh7yGcO@@dhGAE)8MMPvM zr81UO$gJ?*TR3$3opYY&{d}JD{@(ZShtFE~TK8W2zSsI**Y|r}7l5EWg`g0N)Qy~{ zfsjGd3EG1ILHi990z=UOGzbd2NL`2{3=V~mk^m0B4TPjy!p$ulalS5Ip2{dnO0*P8 zUP@6GkU~kJ0F;!Bl&lokC8>+?J*w=jYv}9Xh*gqz_mXjtv)_+1a`$kzGBfe_+9!Wd z*JH0zfPsm>EJ{I3OHY-OGM&JE03g6B00J~E9R`I!q4d=6-;J=n&|Wz|V)vbE5>O(p zYkkEKQgB_4C@O#g0W*gqn4sonC>DT;*q~&h)^u@p(Qw51A@w}5C=P&)*i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Z#&`1IO{{nj~o$mku literal 0 HcmV?d00001 diff --git a/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/Google.Protobuf.nuspec b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/Google.Protobuf.nuspec new file mode 100644 index 00000000..377b49cb --- /dev/null +++ b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/Google.Protobuf.nuspec @@ -0,0 +1,30 @@ + + + + Google.Protobuf + 3.15.8 + Google Inc. + Google Inc. + false + https://github.com/protocolbuffers/protobuf/blob/master/LICENSE + https://github.com/protocolbuffers/protobuf + C# runtime library for Protocol Buffers - Google's data interchange format. + C# proto3 support + Copyright 2015, Google Inc. + Protocol Buffers Binary Serialization Format Google proto proto3 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/Google.Protobuf.nuspec.meta b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/Google.Protobuf.nuspec.meta new file mode 100644 index 00000000..0584abef --- /dev/null +++ b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/Google.Protobuf.nuspec.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f251e4c06aaa618458c77025c57ea05c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib.meta b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib.meta new file mode 100644 index 00000000..2dc9d18d --- /dev/null +++ b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c3a32c58ec0f04f43b8a83eaaee0fad6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0.meta b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0.meta new file mode 100644 index 00000000..be639f5e --- /dev/null +++ b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d6bbee8d0e4206419e6a1f3d21c49d6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.dll b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.dll new file mode 100644 index 0000000000000000000000000000000000000000..207a7fca06612e54991c716cf1f5897cb1b2230b GIT binary patch literal 390248 zcmcG%37i~NwLe}{Rb9Q!Owu!x?pcz|1el@dWs=N52wMnSkgx~DNm#N0LVy%hCn%Zp zFrcC!pdc=w;0mtbiinDexIGn#sE7y=-0}U?r%#{n>3iY-{hm{|yLx7_`2W1upP8z2 z?>+b2bI&>Vp1W1mscYVBIhJL)_cEv@@XB!g6$2aBZ{8ei8Q5^qK)7}Dz@?i9jz9gZfh&RwFB)!Z%N!7qKH~(- zI;F+2R=?>N-!i2=Z|ygbZCPYlI}(t07x{x$AVP_ZowbWa!9v))rDf{14l)+N2T4|rB9ZmoYvSZ52~K3)dutV@Oz!Y_+u z9o}-$tG6Khh9{zWv991d{u{8Yb;Dsb+=xi!4RvGnp9F5~w;bvk4llYq03vxM&qC|z zX?VxRvI%%F<%%D9v#o@+?o8V%zss@G65F`k{QHD8*$D0yns58ZSyrZK?wyMg)GD*aH$&p{9&}tGADz317lvnaspbQ`N^NNSt z{)q_KP7TKH7JDZ^(=CqJ+Zpsx`Ao5B`>3>+-_=r&KZ)`4?QzLtkXJGiygAkp;0;MR zMd+}65G|Ga0Gt9G+)mZoX}I|?vP>~5k0ksv7;(EDg3~MgGZCodY=0F~&ca12;=}sA zV&@{;T86S2iC6l#l!oj87MZCy`BJ+byd0n%oP+B#4^>}*TgLW+G2FdiHLgBQ zr?{#qyW>N;UU7{btO3TBA6Qm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15.8/lib/netstandard2.0/Google.Protobuf.dll.meta b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.dll.meta new file mode 100644 index 00000000..26f8086d --- /dev/null +++ b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.dll.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 57fb929cf6fba524c850bd783eeff4a7 +labels: +- NuGetForUnity +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.xml b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.xml new file mode 100644 index 00000000..ba87ed87 --- /dev/null +++ b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.xml @@ -0,0 +1,10097 @@ + + + + Google.Protobuf + + + +

+ Provides a utility routine to copy small arrays much more quickly than Buffer.BlockCopy + + + + + The threshold above which you should use Buffer.BlockCopy rather than ByteArray.Copy + + + + + Determines which copy routine to use based on the number of bytes to be copied. + + + + + Reverses the order of bytes in the array + + + + + Immutable array of bytes. + + + + + Internal use only. Ensure that the provided memory is not mutated and belongs to this instance. + + + + + Internal use only. Ensure that the provided memory is not mutated and belongs to this instance. + This method encapsulates converting array to memory. Reduces need for SecuritySafeCritical + in .NET Framework. + + + + + Constructs a new ByteString from the given memory. The memory is + *not* copied, and must not be modified after this constructor is called. + + + + + Returns an empty ByteString. + + + + + Returns the length of this ByteString in bytes. + + + + + Returns true if this byte string is empty, false otherwise. + + + + + Provides read-only access to the data of this . + No data is copied so this is the most efficient way of accessing. + + + + + Provides read-only access to the data of this . + No data is copied so this is the most efficient way of accessing. + + + + + Converts this into a byte array. + + The data is copied - changes to the returned array will not be reflected in this ByteString. + A byte array with the same data as this ByteString. + + + + Converts this into a standard base64 representation. + + A base64 representation of this ByteString. + + + + Constructs a from the Base64 Encoded String. + + + + + Constructs a from data in the given stream, synchronously. + + If successful, will be read completely, from the position + at the start of the call. + The stream to copy into a ByteString. + A ByteString with content read from the given stream. + + + + Constructs a from data in the given stream, asynchronously. + + If successful, will be read completely, from the position + at the start of the call. + The stream to copy into a ByteString. + The cancellation token to use when reading from the stream, if any. + A ByteString with content read from the given stream. + + + + Constructs a from the given array. The contents + are copied, so further modifications to the array will not + be reflected in the returned ByteString. + This method can also be invoked in ByteString.CopyFrom(0xaa, 0xbb, ...) form + which is primarily useful for testing. + + + + + Constructs a from a portion of a byte array. + + + + + Constructs a from a read only span. The contents + are copied, so further modifications to the span will not + be reflected in the returned . + + + + + Creates a new by encoding the specified text with + the given encoding. + + + + + Creates a new by encoding the specified text in UTF-8. + + + + + Returns the byte at the given index. + + + + + Converts this into a string by applying the given encoding. + + + This method should only be used to convert binary data which was the result of encoding + text with the given encoding. + + The encoding to use to decode the binary data into text. + The result of decoding the binary data with the given decoding. + + + + Converts this into a string by applying the UTF-8 encoding. + + + This method should only be used to convert binary data which was the result of encoding + text with UTF-8. + + The result of decoding the binary data with the given decoding. + + + + Returns an iterator over the bytes in this . + + An iterator over the bytes in this object. + + + + Returns an iterator over the bytes in this . + + An iterator over the bytes in this object. + + + + Creates a CodedInputStream from this ByteString's data. + + + + + Compares two byte strings for equality. + + The first byte string to compare. + The second byte string to compare. + true if the byte strings are equal; false otherwise. + + + + Compares two byte strings for inequality. + + The first byte string to compare. + The second byte string to compare. + false if the byte strings are equal; true otherwise. + + + + Compares this byte string with another object. + + The object to compare this with. + true if refers to an equal ; false otherwise. + + + + Returns a hash code for this object. Two equal byte strings + will return the same hash code. + + A hash code for this object. + + + + Compares this byte string with another. + + The to compare this with. + true if refers to an equal byte string; false otherwise. + + + + Copies the entire byte array to the destination array provided at the offset specified. + + + + + Writes the entire byte array to the provided stream + + + + + SecuritySafeCritical attribute can not be placed on types with async methods. + This class has ByteString's async methods so it can be marked with SecuritySafeCritical. + + + + + Reads and decodes protocol message fields. + + + + This class is generally used by generated code to read appropriate + primitives from the stream. It effectively encapsulates the lowest + levels of protocol buffer format. + + + Repeated fields and map fields are not handled by this class; use + and to serialize such fields. + + + + + + Whether to leave the underlying stream open when disposing of this stream. + This is always true when there's no stream. + + + + + Buffer of data read from the stream or provided at construction time. + + + + + The stream to read further input from, or null if the byte array buffer was provided + directly on construction, with no further data available. + + + + + The parser state is kept separately so that other parse implementations can reuse the same + parsing primitives. + + + + + Creates a new CodedInputStream reading data from the given byte array. + + + + + Creates a new that reads from the given byte array slice. + + + + + Creates a new reading data from the given stream, which will be disposed + when the returned object is disposed. + + The stream to read from. + + + + Creates a new reading data from the given stream. + + The stream to read from. + true to leave open when the returned + is disposed; false to dispose of the given stream when the + returned object is disposed. + + + + Creates a new CodedInputStream reading data from the given + stream and buffer, using the default limits. + + + + + Creates a new CodedInputStream reading data from the given + stream and buffer, using the specified limits. + + + This chains to the version with the default limits instead of vice versa to avoid + having to check that the default values are valid every time. + + + + + Creates a with the specified size and recursion limits, reading + from an input stream. + + + This method exists separately from the constructor to reduce the number of constructor overloads. + It is likely to be used considerably less frequently than the constructors, as the default limits + are suitable for most use cases. + + The input stream to read from + The total limit of data to read from the stream. + The maximum recursion depth to allow while reading. + A CodedInputStream reading from with the specified size + and recursion limits. + + + + Returns the current position in the input stream, or the position in the input buffer + + + + + Returns the last tag read, or 0 if no tags have been read or we've read beyond + the end of the stream. + + + + + Returns the size limit for this stream. + + + This limit is applied when reading from the underlying stream, as a sanity check. It is + not applied when reading from a byte array data source without an underlying stream. + The default value is Int32.MaxValue. + + + The size limit. + + + + + Returns the recursion limit for this stream. This limit is applied whilst reading messages, + to avoid maliciously-recursive data. + + + The default limit is 100. + + + The recursion limit for this stream. + + + + + Internal-only property; when set to true, unknown fields will be discarded while parsing. + + + + + Internal-only property; provides extension identifiers to compatible messages while parsing. + + + + + Disposes of this instance, potentially closing any underlying stream. + + + As there is no flushing to perform here, disposing of a which + was constructed with the leaveOpen option parameter set to true (or one which + was constructed to read from a byte array) has no effect. + + + + + Verifies that the last call to ReadTag() returned tag 0 - in other words, + we've reached the end of the stream when we expected to. + + The + tag read was not the one specified + + + + Peeks at the next field tag. This is like calling , but the + tag is not consumed. (So a subsequent call to will return the + same value.) + + + + + Reads a field tag, returning the tag of 0 for "end of stream". + + + If this method returns 0, it doesn't necessarily mean the end of all + the data in this CodedInputStream; it may be the end of the logical stream + for an embedded message, for example. + + The next field tag, or 0 for end of stream. (0 is never a valid tag.) + + + + Skips the data for the field with the tag we've just read. + This should be called directly after , when + the caller wishes to skip an unknown field. + + + This method throws if the last-read tag was an end-group tag. + If a caller wishes to skip a group, they should skip the whole group, by calling this method after reading the + start-group tag. This behavior allows callers to call this method on any field they don't understand, correctly + resulting in an error if an end-group tag has not been paired with an earlier start-group tag. + + The last tag was an end-group tag + The last read operation read to the end of the logical stream + + + + Skip a group. + + + + + Reads a double field from the stream. + + + + + Reads a float field from the stream. + + + + + Reads a uint64 field from the stream. + + + + + Reads an int64 field from the stream. + + + + + Reads an int32 field from the stream. + + + + + Reads a fixed64 field from the stream. + + + + + Reads a fixed32 field from the stream. + + + + + Reads a bool field from the stream. + + + + + Reads a string field from the stream. + + + + + Reads an embedded message field value from the stream. + + + + + Reads an embedded group field from the stream. + + + + + Reads a bytes field value from the stream. + + + + + Reads a uint32 field value from the stream. + + + + + Reads an enum field value from the stream. + + + + + Reads an sfixed32 field value from the stream. + + + + + Reads an sfixed64 field value from the stream. + + + + + Reads an sint32 field value from the stream. + + + + + Reads an sint64 field value from the stream. + + + + + Reads a length for length-delimited data. + + + This is internally just reading a varint, but this method exists + to make the calling code clearer. + + + + + Peeks at the next tag in the stream. If it matches , + the tag is consumed and the method returns true; otherwise, the + stream is left in the original position and the method returns false. + + + + + Reads a raw Varint from the stream. If larger than 32 bits, discard the upper bits. + This method is optimised for the case where we've got lots of data in the buffer. + That means we can check the size just once, then just read directly from the buffer + without constant rechecking of the buffer length. + + + + + Reads a varint from the input one byte at a time, so that it does not + read any bytes after the end of the varint. If you simply wrapped the + stream in a CodedInputStream and used ReadRawVarint32(Stream) + then you would probably end up reading past the end of the varint since + CodedInputStream buffers its input. + + + + + + + Reads a raw varint from the stream. + + + + + Reads a 32-bit little-endian integer from the stream. + + + + + Reads a 64-bit little-endian integer from the stream. + + + + + Sets currentLimit to (current position) + byteLimit. This is called + when descending into a length-delimited embedded message. The previous + limit is returned. + + The old limit. + + + + Discards the current limit, returning the previous limit. + + + + + Returns whether or not all the data before the limit has been read. + + + + + + Returns true if the stream has reached the end of the input. This is the + case if either the end of the underlying input source has been reached or + the stream has reached a limit created using PushLimit. + + + + + Called when buffer is empty to read more bytes from the + input. If is true, RefillBuffer() guarantees that + either there will be at least one byte in the buffer when it returns + or it will throw an exception. If is false, + RefillBuffer() returns false if no more bytes were available. + + + + + + + Reads a fixed size of bytes from the input. + + + the end of the stream or the current limit was reached + + + + + Reads a top-level message or a nested message after the limits for this message have been pushed. + (parser will proceed until the end of the current limit) + NOTE: this method needs to be public because it's invoked by the generated code - e.g. msg.MergeFrom(CodedInputStream input) method + + + + + Encodes and writes protocol message fields. + + + + This class is generally used by generated code to write appropriate + primitives to the stream. It effectively encapsulates the lowest + levels of protocol buffer format. Unlike some other implementations, + this does not include combined "write tag and value" methods. Generated + code knows the exact byte representations of the tags they're going to write, + so there's no need to re-encode them each time. Manually-written code calling + this class should just call one of the WriteTag overloads before each value. + + + Repeated fields and map fields are not handled by this class; use RepeatedField<T> + and MapField<TKey, TValue> to serialize such fields. + + + + + + Computes the number of bytes that would be needed to encode a + double field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + float field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + uint64 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode an + int64 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode an + int32 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + fixed64 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + fixed32 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + bool field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + string field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + group field, including the tag. + + + + + Computes the number of bytes that would be needed to encode an + embedded message field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + bytes field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + uint32 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a + enum field, including the tag. The caller is responsible for + converting the enum value to its numeric value. + + + + + Computes the number of bytes that would be needed to encode an + sfixed32 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode an + sfixed64 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode an + sint32 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode an + sint64 field, including the tag. + + + + + Computes the number of bytes that would be needed to encode a length, + as written by . + + + + + Computes the number of bytes that would be needed to encode a varint. + + + + + Computes the number of bytes that would be needed to encode a varint. + + + + + Computes the number of bytes that would be needed to encode a tag. + + + + + The buffer size used by CreateInstance(Stream). + + + + + Creates a new CodedOutputStream that writes directly to the given + byte array. If more bytes are written than fit in the array, + OutOfSpaceException will be thrown. + + + + + Creates a new CodedOutputStream that writes directly to the given + byte array slice. If more bytes are written than fit in the array, + OutOfSpaceException will be thrown. + + + + + Creates a new which write to the given stream, and disposes of that + stream when the returned CodedOutputStream is disposed. + + The stream to write to. It will be disposed when the returned CodedOutputStream is disposed. + + + + Creates a new CodedOutputStream which write to the given stream and uses + the specified buffer size. + + The stream to write to. It will be disposed when the returned CodedOutputStream is disposed. + The size of buffer to use internally. + + + + Creates a new CodedOutputStream which write to the given stream. + + The stream to write to. + If true, is left open when the returned CodedOutputStream is disposed; + if false, the provided stream is disposed as well. + + + + Creates a new CodedOutputStream which write to the given stream and uses + the specified buffer size. + + The stream to write to. + The size of buffer to use internally. + If true, is left open when the returned CodedOutputStream is disposed; + if false, the provided stream is disposed as well. + + + + Returns the current position in the stream, or the position in the output buffer + + + + + Writes a double field value, without a tag, to the stream. + + The value to write + + + + Writes a float field value, without a tag, to the stream. + + The value to write + + + + Writes a uint64 field value, without a tag, to the stream. + + The value to write + + + + Writes an int64 field value, without a tag, to the stream. + + The value to write + + + + Writes an int32 field value, without a tag, to the stream. + + The value to write + + + + Writes a fixed64 field value, without a tag, to the stream. + + The value to write + + + + Writes a fixed32 field value, without a tag, to the stream. + + The value to write + + + + Writes a bool field value, without a tag, to the stream. + + The value to write + + + + Writes a string field value, without a tag, to the stream. + The data is length-prefixed. + + The value to write + + + + Writes a message, without a tag, to the stream. + The data is length-prefixed. + + The value to write + + + + Writes a message, without a tag, to the stream. + Only the message data is written, without a length-delimiter. + + The value to write + + + + Writes a group, without a tag, to the stream. + + The value to write + + + + Write a byte string, without a tag, to the stream. + The data is length-prefixed. + + The value to write + + + + Writes a uint32 value, without a tag, to the stream. + + The value to write + + + + Writes an enum value, without a tag, to the stream. + + The value to write + + + + Writes an sfixed32 value, without a tag, to the stream. + + The value to write. + + + + Writes an sfixed64 value, without a tag, to the stream. + + The value to write + + + + Writes an sint32 value, without a tag, to the stream. + + The value to write + + + + Writes an sint64 value, without a tag, to the stream. + + The value to write + + + + Writes a length (in bytes) for length-delimited data. + + + This method simply writes a rawint, but exists for clarity in calling code. + + Length value, in bytes. + + + + Encodes and writes a tag. + + The number of the field to write the tag for + The wire format type of the tag to write + + + + Writes an already-encoded tag. + + The encoded tag + + + + Writes the given single-byte tag directly to the stream. + + The encoded tag + + + + Writes the given two-byte tag directly to the stream. + + The first byte of the encoded tag + The second byte of the encoded tag + + + + Writes the given three-byte tag directly to the stream. + + The first byte of the encoded tag + The second byte of the encoded tag + The third byte of the encoded tag + + + + Writes the given four-byte tag directly to the stream. + + The first byte of the encoded tag + The second byte of the encoded tag + The third byte of the encoded tag + The fourth byte of the encoded tag + + + + Writes the given five-byte tag directly to the stream. + + The first byte of the encoded tag + The second byte of the encoded tag + The third byte of the encoded tag + The fourth byte of the encoded tag + The fifth byte of the encoded tag + + + + Writes a 32 bit value as a varint. The fast route is taken when + there's enough buffer space left to whizz through without checking + for each byte; otherwise, we resort to calling WriteRawByte each time. + + + + + Writes out an array of bytes. + + + + + Writes out part of an array of bytes. + + + + + Indicates that a CodedOutputStream wrapping a flat byte array + ran out of space. + + + + + Flushes any buffered data and optionally closes the underlying stream, if any. + + + + By default, any underlying stream is closed by this method. To configure this behaviour, + use a constructor overload with a leaveOpen parameter. If this instance does not + have an underlying stream, this method does nothing. + + + For the sake of efficiency, calling this method does not prevent future write calls - but + if a later write ends up writing to a stream which has been disposed, that is likely to + fail. It is recommend that you not call any other methods after this. + + + + + + Flushes any buffered data to the underlying stream (if there is one). + + + + + Verifies that SpaceLeft returns zero. It's common to create a byte array + that is exactly big enough to hold a message, then write to it with + a CodedOutputStream. Calling CheckNoSpaceLeft after writing verifies that + the message was actually as big as expected, which can help finding bugs. + + + + + If writing to a flat array, returns the space left in the array. Otherwise, + throws an InvalidOperationException. + + + + + Utility to compare if two Lists are the same, and the hash code + of a List. + + + + + Checks if two lists are equal. + + + + + Gets the list's hash code. + + + + + Representation of a map field in a Protocol Buffer message. + + Key type in the map. Must be a type supported by Protocol Buffer map keys. + Value type in the map. Must be a type supported by Protocol Buffers. + + + For string keys, the equality comparison is provided by . + + + Null values are not permitted in the map, either for wrapper types or regular messages. + If a map is deserialized from a data stream and the value is missing from an entry, a default value + is created instead. For primitive types, that is the regular default value (0, the empty string and so + on); for message types, an empty instance of the message is created, as if the map entry contained a 0-length + encoded value for the field. + + + This implementation does not generally prohibit the use of key/value types which are not + supported by Protocol Buffers (e.g. using a key type of byte) but nor does it guarantee + that all operations will work in such cases. + + + The order in which entries are returned when iterating over this object is undefined, and may change + in future versions. + + + + + + Creates a deep clone of this object. + + + A deep clone of this object. + + + + + Adds the specified key/value pair to the map. + + + This operation fails if the key already exists in the map. To replace an existing entry, use the indexer. + + The key to add + The value to add. + The given key already exists in map. + + + + Determines whether the specified key is present in the map. + + The key to check. + true if the map contains the given key; false otherwise. + + + + Removes the entry identified by the given key from the map. + + The key indicating the entry to remove from the map. + true if the map contained the given key before the entry was removed; false otherwise. + + + + Gets the value associated with the specified key. + + The key whose value to get. + When this method returns, the value associated with the specified key, if the key is found; + otherwise, the default value for the type of the parameter. + This parameter is passed uninitialized. + true if the map contains an element with the specified key; otherwise, false. + + + + Gets or sets the value associated with the specified key. + + The key of the value to get or set. + The property is retrieved and key does not exist in the collection. + The value associated with the specified key. If the specified key is not found, + a get operation throws a , and a set operation creates a new element with the specified key. + + + + Gets a collection containing the keys in the map. + + + + + Gets a collection containing the values in the map. + + + + + Adds the specified entries to the map. The keys and values are not automatically cloned. + + The entries to add to the map. + + + + Returns an enumerator that iterates through the collection. + + + An enumerator that can be used to iterate through the collection. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Adds the specified item to the map. + + The item to add to the map. + + + + Removes all items from the map. + + + + + Determines whether map contains an entry equivalent to the given key/value pair. + + The key/value pair to find. + + + + + Copies the key/value pairs in this map to an array. + + The array to copy the entries into. + The index of the array at which to start copying values. + + + + Removes the specified key/value pair from the map. + + Both the key and the value must be found for the entry to be removed. + The key/value pair to remove. + true if the key/value pair was found and removed; false otherwise. + + + + Gets the number of elements contained in the map. + + + + + Gets a value indicating whether the map is read-only. + + + + + Determines whether the specified , is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Compares this map with another for equality. + + + The order of the key/value pairs in the maps is not deemed significant in this comparison. + + The map to compare this with. + true if refers to an equal map; false otherwise. + + + + Adds entries to the map from the given stream. + + + It is assumed that the stream is initially positioned after the tag specified by the codec. + This method will continue reading entries from the stream until the end is reached, or + a different tag is encountered. + + Stream to read from + Codec describing how the key/value pairs are encoded + + + + Adds entries to the map from the given parse context. + + + It is assumed that the input is initially positioned after the tag specified by the codec. + This method will continue reading entries from the input until the end is reached, or + a different tag is encountered. + + Input to read from + Codec describing how the key/value pairs are encoded + + + + Writes the contents of this map to the given coded output stream, using the specified codec + to encode each entry. + + The output stream to write to. + The codec to use for each entry. + + + + Writes the contents of this map to the given write context, using the specified codec + to encode each entry. + + The write context to write to. + The codec to use for each entry. + + + + Calculates the size of this map based on the given entry codec. + + The codec to use to encode each entry. + + + + + Returns a string representation of this repeated field, in the same + way as it would be represented by the default JSON formatter. + + + + + A codec for a specific map field. This contains all the information required to encode and + decode the nested messages. + + + + + Creates a new entry codec based on a separate key codec and value codec, + and the tag to use for each map entry. + + The key codec. + The value codec. + The map tag to use to introduce each map entry. + + + + The key codec. + + + + + The value codec. + + + + + The tag used in the enclosing message to indicate map entries. + + + + + Provides a central place to implement equality comparisons, primarily for bitwise float/double equality. + + + + + Returns an equality comparer for suitable for Protobuf equality comparisons. + This is usually just the default equality comparer for the type, but floating point numbers are compared + bitwise. + + The type of equality comparer to return. + The equality comparer. + + + + Returns an equality comparer suitable for comparing 64-bit floating point values, by bitwise comparison. + (NaN values are considered equal, but only when they have the same representation.) + + + + + Returns an equality comparer suitable for comparing 32-bit floating point values, by bitwise comparison. + (NaN values are considered equal, but only when they have the same representation.) + + + + + Returns an equality comparer suitable for comparing nullable 64-bit floating point values, by bitwise comparison. + (NaN values are considered equal, but only when they have the same representation.) + + + + + Returns an equality comparer suitable for comparing nullable 32-bit floating point values, by bitwise comparison. + (NaN values are considered equal, but only when they have the same representation.) + + + + + Read-only wrapper around another dictionary. + + + + + The contents of a repeated field: essentially, a collection with some extra + restrictions (no null values) and capabilities (deep cloning). + + + This implementation does not generally prohibit the use of types which are not + supported by Protocol Buffers but nor does it guarantee that all operations will work in such cases. + + The element type of the repeated field. + + + + Creates a deep clone of this repeated field. + + + If the field type is + a message type, each element is also cloned; otherwise, it is + assumed that the field type is primitive (including string and + bytes, both of which are immutable) and so a simple copy is + equivalent to a deep clone. + + A deep clone of this repeated field. + + + + Adds the entries from the given input stream, decoding them with the specified codec. + + The input stream to read from. + The codec to use in order to read each entry. + + + + Adds the entries from the given parse context, decoding them with the specified codec. + + The input to read from. + The codec to use in order to read each entry. + + + + Calculates the size of this collection based on the given codec. + + The codec to use when encoding each field. + The number of bytes that would be written to an output by one of the WriteTo methods, + using the same codec. + + + + Writes the contents of this collection to the given , + encoding each value using the specified codec. + + The output stream to write to. + The codec to use when encoding each value. + + + + Writes the contents of this collection to the given write context, + encoding each value using the specified codec. + + The write context to write to. + The codec to use when encoding each value. + + + + Gets and sets the capacity of the RepeatedField's internal array. WHen set, the internal array is reallocated to the given capacity. + The new value is less than Count -or- when Count is less than 0. + + + + + Adds the specified item to the collection. + + The item to add. + + + + Removes all items from the collection. + + + + + Determines whether this collection contains the given item. + + The item to find. + true if this collection contains the given item; false otherwise. + + + + Copies this collection to the given array. + + The array to copy to. + The first index of the array to copy to. + + + + Removes the specified item from the collection + + The item to remove. + true if the item was found and removed; false otherwise. + + + + Gets the number of elements contained in the collection. + + + + + Gets a value indicating whether the collection is read-only. + + + + + Adds all of the specified values into this collection. + + The values to add to this collection. + + + + Adds all of the specified values into this collection. This method is present to + allow repeated fields to be constructed from queries within collection initializers. + Within non-collection-initializer code, consider using the equivalent + method instead for clarity. + + The values to add to this collection. + + + + Returns an enumerator that iterates through the collection. + + + An enumerator that can be used to iterate through the collection. + + + + + Determines whether the specified , is equal to this instance. + + The to compare with this instance. + + true if the specified is equal to this instance; otherwise, false. + + + + + Returns an enumerator that iterates through a collection. + + + An object that can be used to iterate through the collection. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Compares this repeated field with another for equality. + + The repeated field to compare this with. + true if refers to an equal repeated field; false otherwise. + + + + Returns the index of the given item within the collection, or -1 if the item is not + present. + + The item to find in the collection. + The zero-based index of the item, or -1 if it is not found. + + + + Inserts the given item at the specified index. + + The index at which to insert the item. + The item to insert. + + + + Removes the item at the given index. + + The zero-based index of the item to remove. + + + + Returns a string representation of this repeated field, in the same + way as it would be represented by the default JSON formatter. + + + + + Gets or sets the item at the specified index. + + + The element at the specified index. + + The zero-based index of the element to get or set. + The item at the specified index. + + + + Extension methods for , effectively providing + the familiar members from previous desktop framework versions while + targeting the newer releases, .NET Core etc. + + + + + Returns the public getter of a property, or null if there is no such getter + (either because it's read-only, or the getter isn't public). + + + + + Returns the public setter of a property, or null if there is no such setter + (either because it's write-only, or the setter isn't public). + + + + + Provides extension methods on Type that just proxy to TypeInfo. + These are used to support the new type system from .NET 4.5, without + having calls to GetTypeInfo all over the place. While the methods here are meant to be + broadly compatible with the desktop framework, there are some subtle differences in behaviour - but + they're not expected to affect our use cases. While the class is internal, that should be fine: we can + evaluate each new use appropriately. + + + + + See https://msdn.microsoft.com/en-us/library/system.type.isassignablefrom + + + + + Returns a representation of the public property associated with the given name in the given type, + including inherited properties or null if there is no such public property. + Here, "public property" means a property where either the getter, or the setter, or both, is public. + + + + + Returns a representation of the public method associated with the given name in the given type, + including inherited methods. + + + This has a few differences compared with Type.GetMethod in the desktop framework. It will throw + if there is an ambiguous match even between a private method and a public one, but it *won't* throw + if there are two overloads at different levels in the type hierarchy (e.g. class Base declares public void Foo(int) and + class Child : Base declares public void Foo(long)). + + One type in the hierarchy declared more than one method with the same name + + + + Represents a non-generic extension definition. This API is experimental and subject to change. + + + + + Internal use. Creates a new extension with the specified field number. + + + + + Gets the field number of this extension + + + + + Represents a type-safe extension identifier used for getting and setting single extension values in instances. + This API is experimental and subject to change. + + The message type this field applies to + The field value type of this extension + + + + Creates a new extension identifier with the specified field number and codec + + + + + Represents a type-safe extension identifier used for getting repeated extension values in instances. + This API is experimental and subject to change. + + The message type this field applies to + The repeated field value type of this extension + + + + Creates a new repeated extension identifier with the specified field number and codec + + + + + Provides extensions to messages while parsing. This API is experimental and subject to change. + + + + + Creates a new empty extension registry + + + + + Gets the total number of extensions in this extension registry + + + + + Returns whether the registry is readonly + + + + + Adds the specified extension to the registry + + + + + Adds the specified extensions to the registry + + + + + Clears the registry of all values + + + + + Gets whether the extension registry contains the specified extension + + + + + Copies the arrays in the registry set to the specified array at the specified index + + The array to copy to + The array index to start at + + + + Returns an enumerator to enumerate through the items in the registry + + Returns an enumerator for the extensions in this registry + + + + Removes the specified extension from the set + + The extension + true if the extension was removed, otherwise false + + + + Clones the registry into a new registry + + + + + Methods for managing s with null checking. + + Most users will not use this class directly and its API is experimental and subject to change. + + + + + Gets the value of the specified extension + + + + + Gets the value of the specified repeated extension or null if it doesn't exist in this set + + + + + Gets the value of the specified repeated extension, registering it if it doesn't exist + + + + + Sets the value of the specified extension. This will make a new instance of ExtensionSet if the set is null. + + + + + Gets whether the value of the specified extension is set + + + + + Clears the value of the specified extension + + + + + Clears the value of the specified extension + + + + + Tries to merge a field from the coded input, returning true if the field was merged. + If the set is null or the field was not otherwise merged, this returns false. + + + + + Tries to merge a field from the coded input, returning true if the field was merged. + If the set is null or the field was not otherwise merged, this returns false. + + + + + Merges the second set into the first set, creating a new instance if first is null + + + + + Clones the set into a new set. If the set is null, this returns null + + + + + Used for keeping track of extensions in messages. + methods route to this set. + + Most users will not need to use this class directly + + The message type that extensions in this set target + + + + Gets a hash code of the set + + + + + Returns whether this set is equal to the other object + + + + + Calculates the size of this extension set + + + + + Writes the extension values in this set to the output stream + + + + + Writes the extension values in this set to the write context + + + + + Factory methods for . + + + + + Retrieves a codec suitable for a string field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for a bytes field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for a bool field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for an int32 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for an sint32 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for a fixed32 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for an sfixed32 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for a uint32 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for an int64 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for an sint64 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for a fixed64 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for an sfixed64 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for a uint64 field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for a float field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for a double field with the given tag. + + The tag. + A codec for the given tag. + + + + Retrieves a codec suitable for an enum field with the given tag. + + The tag. + A conversion function from to the enum type. + A conversion function from the enum type to . + A codec for the given tag. + + + + Retrieves a codec suitable for a string field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for a bytes field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for a bool field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for an int32 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for an sint32 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for a fixed32 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for an sfixed32 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for a uint32 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for an int64 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for an sint64 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for a fixed64 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for an sfixed64 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for a uint64 field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for a float field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for a double field with the given tag. + + The tag. + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for an enum field with the given tag. + + The tag. + A conversion function from to the enum type. + A conversion function from the enum type to . + The default value. + A codec for the given tag. + + + + Retrieves a codec suitable for a message field with the given tag. + + The tag. + A parser to use for the message type. + A codec for the given tag. + + + + Retrieves a codec suitable for a group field with the given tag. + + The start group tag. + The end group tag. + A parser to use for the group message type. + A codec for given tag + + + + Creates a codec for a wrapper type of a class - which must be string or ByteString. + + + + + Creates a codec for a wrapper type of a struct - which must be Int32, Int64, UInt32, UInt64, + Bool, Single or Double. + + + + + Helper code to create codecs for wrapper types. + + + Somewhat ugly with all the static methods, but the conversions involved to/from nullable types make it + slightly tricky to improve. So long as we keep the public API (ForClassWrapper, ForStructWrapper) in place, + we can refactor later if we come up with something cleaner. + + + + + Returns a field codec which effectively wraps a value of type T in a message. + + + + + + + An encode/decode pair for a single field. This effectively encapsulates + all the information needed to read or write the field value from/to a coded + stream. + + + This class is public and has to be as it is used by generated code, but its public + API is very limited - just what the generated code needs to call directly. + + + + This never writes default values to the stream, and does not address "packedness" + in repeated fields itself, other than to know whether or not the field *should* be packed. + + + + + Merges an input stream into a value + + + + + Merges a value into a reference to another value, returning a boolean if the value was set + + + + + Returns a delegate to write a value (unconditionally) to a coded output stream. + + + + + Returns the size calculator for just a value. + + + + + Returns a delegate to read a value from a coded input stream. It is assumed that + the stream is already positioned on the appropriate tag. + + + + + Returns a delegate to merge a value from a coded input stream. + It is assumed that the stream is already positioned on the appropriate tag + + + + + Returns a delegate to merge two values together. + + + + + Returns the fixed size for an entry, or 0 if sizes vary. + + + + + Gets the tag of the codec. + + + The tag of the codec. + + + + + Gets the end tag of the codec or 0 if there is no end tag + + + The end tag of the codec. + + + + + Default value for this codec. Usually the same for every instance of the same type, but + for string/ByteString wrapper fields the codec's default value is null, whereas for + other string/ByteString fields it's "" or ByteString.Empty. + + + The default value of the codec's type. + + + + + Write a tag and the given value, *if* the value is not the default. + + + + + Write a tag and the given value, *if* the value is not the default. + + + + + Reads a value of the codec type from the given . + + The input stream to read from. + The value read from the stream. + + + + Reads a value of the codec type from the given . + + The parse context to read from. + The value read. + + + + Calculates the size required to write the given value, with a tag, + if the value is not the default. + + + + + Calculates the size required to write the given value, with a tag, even + if the value is the default. + + + + + A tree representation of a FieldMask. Each leaf node in this tree represent + a field path in the FieldMask. + + For example, FieldMask "foo.bar,foo.baz,bar.baz" as a tree will be: + + [root] -+- foo -+- bar + | | + | +- baz + | + +- bar --- baz + + + By representing FieldMasks with this tree structure we can easily convert + a FieldMask to a canonical form, merge two FieldMasks, calculate the + intersection to two FieldMasks and traverse all fields specified by the + FieldMask in a message tree. + + + + + Creates an empty FieldMaskTree. + + + + + Creates a FieldMaskTree for a given FieldMask. + + + + + Adds a field path to the tree. In a FieldMask, every field path matches the + specified field as well as all its sub-fields. For example, a field path + "foo.bar" matches field "foo.bar" and also "foo.bar.baz", etc. When adding + a field path to the tree, redundant sub-paths will be removed. That is, + after adding "foo.bar" to the tree, "foo.bar.baz" will be removed if it + exists, which will turn the tree node for "foo.bar" to a leaf node. + Likewise, if the field path to add is a sub-path of an existing leaf node, + nothing will be changed in the tree. + + + + + Merges all field paths in a FieldMask into this tree. + + + + + Converts this tree to a FieldMask. + + + + + Gathers all field paths in a sub-tree. + + + + + Adds the intersection of this tree with the given to . + + + + + Merges all fields specified by this FieldMaskTree from to . + + + + + Merges all fields specified by a sub-tree from to . + + + + + Class containing helpful workarounds for various platform compatibility + + + + + Interface for a Protocol Buffers message, supporting + parsing from and writing to . + + + + + Internal implementation of merging data from given parse context into this message. + Users should never invoke this method directly. + + + + + Internal implementation of writing this message to a given write context. + Users should never invoke this method directly. + + + + + A message type that has a custom string format for diagnostic purposes. + + + + Calling on a generated message type normally + returns the JSON representation. If a message type implements this interface, + then the method will be called instead of the regular + JSON formatting code, but only when ToString() is called either on the message itself + or on another message which contains it. This does not affect the normal JSON formatting of + the message. + + + For example, if you create a proto message representing a GUID, the internal + representation may be a bytes field or four fixed32 fields. However, when debugging + it may be more convenient to see a result in the same format as provides. + + This interface extends to avoid it accidentally being implemented + on types other than messages, where it would not be used by anything in the framework. + + + + + Returns a string representation of this object, for diagnostic purposes. + + + This method is called when a message is formatted as part of a + call. It does not affect the JSON representation used by other than + in calls to . While it is recommended + that the result is valid JSON, this is never assumed by the Protobuf library. + + A string representation of this object, for diagnostic purposes. + + + + Generic interface for a deeply cloneable type. + + + + All generated messages implement this interface, but so do some non-message types. + Additionally, due to the type constraint on T in , + it is simpler to keep this as a separate interface. + + + The type itself, returned by the method. + + + + Creates a deep clone of this object. + + A deep clone of this object. + + + + Generic interface for a Protocol Buffers message containing one or more extensions, where the type parameter is expected to be the same type as the implementation class. + This interface is experiemental and is subject to change. + + + + + Gets the value of the specified extension + + + + + Gets the value of the specified repeated extension or null if the extension isn't registered in this set. + For a version of this method that never returns null, use + + + + + Gets the value of the specified repeated extension, registering it if it hasn't already been registered. + + + + + Sets the value of the specified extension + + + + + Gets whether the value of the specified extension is set + + + + + Clears the value of the specified extension + + + + + Clears the value of the specified repeated extension + + + + + Interface for a Protocol Buffers message, supporting + basic operations required for serialization. + + + + + Merges the data from the specified coded input stream with the current message. + + See the user guide for precise merge semantics. + + + + + Writes the data to the given coded output stream. + + Coded output stream to write the data to. Must not be null. + + + + Calculates the size of this message in Protocol Buffer wire format, in bytes. + + The number of bytes required to write this message + to a coded output stream. + + + + Descriptor for this message. All instances are expected to return the same descriptor, + and for generated types this will be an explicitly-implemented member, returning the + same value as the static property declared on the type. + + + + + Generic interface for a Protocol Buffers message, + where the type parameter is expected to be the same type as + the implementation class. + + The message type. + + + + Merges the given message into this one. + + See the user guide for precise merge semantics. + The message to merge with this one. Must not be null. + + + + Thrown when an attempt is made to parse invalid JSON, e.g. using + a non-string property key, or including a redundant comma. Parsing a protocol buffer + message represented in JSON using can throw both this + exception and depending on the situation. This + exception is only thrown for "pure JSON" errors, whereas InvalidProtocolBufferException + is thrown when the JSON may be valid in and of itself, but cannot be parsed as a protocol buffer + message. + + + + + Thrown when a protocol message being parsed is invalid in some way, + e.g. it contains a malformed varint or a negative byte length. + + + + + Creates an exception for an error condition of an invalid tag being encountered. + + + + + Reflection-based converter from messages to JSON. + + + + Instances of this class are thread-safe, with no mutable state. + + + This is a simple start to get JSON formatting working. As it's reflection-based, + it's not as quick as baking calls into generated messages - but is a simpler implementation. + (This code is generally not heavily optimized.) + + + + + + Returns a formatter using the default settings. + + + + + The JSON representation of the first 160 characters of Unicode. + Empty strings are replaced by the static constructor. + + + + + Creates a new formatted with the given settings. + + The settings. + + + + Formats the specified message as JSON. + + The message to format. + The formatted message. + + + + Formats the specified message as JSON. + + The message to format. + The TextWriter to write the formatted message to. + The formatted message. + + + + Converts a message to JSON for diagnostic purposes with no extra context. + + + + This differs from calling on the default JSON + formatter in its handling of . As no type registry is available + in calls, the normal way of resolving the type of + an Any message cannot be applied. Instead, a JSON property named @value + is included with the base64 data from the property of the message. + + The value returned by this method is only designed to be used for diagnostic + purposes. It may not be parsable by , and may not be parsable + by other Protocol Buffer implementations. + + The message to format for diagnostic purposes. + The diagnostic-only JSON representation of the message + + + + Determines whether or not a field value should be serialized according to the field, + its value in the message, and the settings of this formatter. + + + + + Writes a single value to the given writer as JSON. Only types understood by + Protocol Buffers can be written in this way. This method is only exposed for + advanced use cases; most users should be using + or . + + The writer to write the value to. Must not be null. + The value to write. May be null. + + + + Central interception point for well-known type formatting. Any well-known types which + don't need special handling can fall back to WriteMessage. We avoid assuming that the + values are using the embedded well-known types, in order to allow for dynamic messages + in the future. + + + + + Writes a string (including leading and trailing double quotes) to a builder, escaping as required. + + + Other than surrogate pair handling, this code is mostly taken from src/google/protobuf/util/internal/json_escaping.cc. + + + + + Settings controlling JSON formatting. + + + + + Default settings, as used by + + + + + Whether fields which would otherwise not be included in the formatted data + should be formatted even when the value is not present, or has the default value. + This option only affects fields which don't support "presence" (e.g. + singular non-optional proto3 primitive fields). + + + + + The type registry used to format messages. + + + + + Whether to format enums as ints. Defaults to false. + + + + + Creates a new object with the specified formatting of default values + and an empty type registry. + + true if default values (0, empty strings etc) should be formatted; false otherwise. + + + + Creates a new object with the specified formatting of default values + and type registry. + + true if default values (0, empty strings etc) should be formatted; false otherwise. + The to use when formatting messages. + + + + Creates a new object with the specified parameters. + + true if default values (0, empty strings etc) should be formatted; false otherwise. + The to use when formatting messages. TypeRegistry.Empty will be used if it is null. + true to format the enums as integers; false to format enums as enum names. + + + + Creates a new object with the specified formatting of default values and the current settings. + + true if default values (0, empty strings etc) should be formatted; false otherwise. + + + + Creates a new object with the specified type registry and the current settings. + + The to use when formatting messages. + + + + Creates a new object with the specified enums formatting option and the current settings. + + true to format the enums as integers; false to format enums as enum names. + + + + Reflection-based converter from JSON to messages. + + + + Instances of this class are thread-safe, with no mutable state. + + + This is a simple start to get JSON parsing working. As it's reflection-based, + it's not as quick as baking calls into generated messages - but is a simpler implementation. + (This code is generally not heavily optimized.) + + + + + + Returns a formatter using the default settings. + + + + + Creates a new formatted with the given settings. + + The settings. + + + + Parses and merges the information into the given message. + + The message to merge the JSON information into. + The JSON to parse. + + + + Parses JSON read from and merges the information into the given message. + + The message to merge the JSON information into. + Reader providing the JSON to parse. + + + + Merges the given message using data from the given tokenizer. In most cases, the next + token should be a "start object" token, but wrapper types and nullity can invalidate + that assumption. This is implemented as an LL(1) recursive descent parser over the stream + of tokens provided by the tokenizer. This token stream is assumed to be valid JSON, with the + tokenizer performing that validation - but not every token stream is valid "protobuf JSON". + + + + + Parses into a new message. + + The type of message to create. + The JSON to parse. + The JSON does not comply with RFC 7159 + The JSON does not represent a Protocol Buffers message correctly + + + + Parses JSON read from into a new message. + + The type of message to create. + Reader providing the JSON to parse. + The JSON does not comply with RFC 7159 + The JSON does not represent a Protocol Buffers message correctly + + + + Parses into a new message. + + The JSON to parse. + Descriptor of message type to parse. + The JSON does not comply with RFC 7159 + The JSON does not represent a Protocol Buffers message correctly + + + + Parses JSON read from into a new message. + + Reader providing the JSON to parse. + Descriptor of message type to parse. + The JSON does not comply with RFC 7159 + The JSON does not represent a Protocol Buffers message correctly + + + + Creates a new instance of the message type for the given field. + + + + + Checks that any infinite/NaN values originated from the correct text. + This corrects the lenient whitespace handling of double.Parse/float.Parse, as well as the + way that Mono parses out-of-range values as infinity. + + + + + Settings controlling JSON parsing. + + + + + Default settings, as used by . This has the same default + recursion limit as , and an empty type registry. + + + + + The maximum depth of messages to parse. Note that this limit only applies to parsing + messages, not collections - so a message within a collection within a message only counts as + depth 2, not 3. + + + + + The type registry used to parse messages. + + + + + Whether the parser should ignore unknown fields (true) or throw an exception when + they are encountered (false). + + + + + Creates a new object with the specified recursion limit. + + The maximum depth of messages to parse + + + + Creates a new object with the specified recursion limit and type registry. + + The maximum depth of messages to parse + The type registry used to parse messages + + + + Creates a new object set to either ignore unknown fields, or throw an exception + when unknown fields are encountered. + + true if unknown fields should be ignored when parsing; false to throw an exception. + + + + Creates a new object based on this one, but with the specified recursion limit. + + The new recursion limit. + + + + Creates a new object based on this one, but with the specified type registry. + + The new type registry. Must not be null. + + + + Simple but strict JSON tokenizer, rigidly following RFC 7159. + + + + This tokenizer is stateful, and only returns "useful" tokens - names, values etc. + It does not create tokens for the separator between names and values, or for the comma + between values. It validates the token stream as it goes - so callers can assume that the + tokens it produces are appropriate. For example, it would never produce "start object, end array." + + Implementation details: the base class handles single token push-back and + Not thread-safe. + + + + + Creates a tokenizer that reads from the given text reader. + + + + + Creates a tokenizer that first replays the given list of tokens, then continues reading + from another tokenizer. Note that if the returned tokenizer is "pushed back", that does not push back + on the continuation tokenizer, or vice versa. Care should be taken when using this method - it was + created for the sake of Any parsing. + + + + + Returns the depth of the stack, purely in objects (not collections). + Informally, this is the number of remaining unclosed '{' characters we have. + + + + + Returns the next JSON token in the stream. An EndDocument token is returned to indicate the end of the stream, + after which point Next() should not be called again. + + This implementation provides single-token buffering, and calls if there is no buffered token. + The next token in the stream. This is never null. + This method is called after an EndDocument token has been returned + The input text does not comply with RFC 7159 + + + + Returns the next JSON token in the stream, when requested by the base class. (The method delegates + to this if it doesn't have a buffered token.) + + This method is called after an EndDocument token has been returned + The input text does not comply with RFC 7159 + + + + Skips the value we're about to read. This must only be called immediately after reading a property name. + If the value is an object or an array, the complete object/array is skipped. + + + + + Tokenizer which first exhausts a list of tokens, then consults another tokenizer. + + + + + Tokenizer which does all the *real* work of parsing JSON. + + + + + This method essentially just loops through characters skipping whitespace, validating and + changing state (e.g. from ObjectBeforeColon to ObjectAfterColon) + until it reaches something which will be a genuine token (e.g. a start object, or a value) at which point + it returns the token. Although the method is large, it would be relatively hard to break down further... most + of it is the large switch statement, which sometimes returns and sometimes doesn't. + + + + + Reads a string token. It is assumed that the opening " has already been read. + + + + + Reads an escaped character. It is assumed that the leading backslash has already been read. + + + + + Reads an escaped Unicode 4-nybble hex sequence. It is assumed that the leading \u has already been read. + + + + + Consumes a text-only literal, throwing an exception if the read text doesn't match it. + It is assumed that the first letter of the literal has already been read. + + + + + Validates that we're in a valid state to read a value (using the given error prefix if necessary) + and changes the state to the appropriate one, e.g. ObjectAfterColon to ObjectAfterProperty. + + + + + Pops the top-most container, and sets the state to the appropriate one for the end of a value + in the parent container. + + + + + Possible states of the tokenizer. + + + This is a flags enum purely so we can simply and efficiently represent a set of valid states + for checking. + + Each is documented with an example, + where ^ represents the current position within the text stream. The examples all use string values, + but could be any value, including nested objects/arrays. + The complete state of the tokenizer also includes a stack to indicate the contexts (arrays/objects). + Any additional notional state of "AfterValue" indicates that a value has been completed, at which + point there's an immediate transition to ExpectedEndOfDocument, ObjectAfterProperty or ArrayAfterValue. + + + These states were derived manually by reading RFC 7159 carefully. + + + + + + ^ { "foo": "bar" } + Before the value in a document. Next states: ObjectStart, ArrayStart, "AfterValue" + + + + + { "foo": "bar" } ^ + After the value in a document. Next states: ReaderExhausted + + + + + { "foo": "bar" } ^ (and already read to the end of the reader) + Terminal state. + + + + + { ^ "foo": "bar" } + Before the *first* property in an object. + Next states: + "AfterValue" (empty object) + ObjectBeforeColon (read a name) + + + + + { "foo" ^ : "bar", "x": "y" } + Next state: ObjectAfterColon + + + + + { "foo" : ^ "bar", "x": "y" } + Before any property other than the first in an object. + (Equivalently: after any property in an object) + Next states: + "AfterValue" (value is simple) + ObjectStart (value is object) + ArrayStart (value is array) + + + + + { "foo" : "bar" ^ , "x" : "y" } + At the end of a property, so expecting either a comma or end-of-object + Next states: ObjectAfterComma or "AfterValue" + + + + + { "foo":"bar", ^ "x":"y" } + Read the comma after the previous property, so expecting another property. + This is like ObjectStart, but closing brace isn't valid here + Next state: ObjectBeforeColon. + + + + + [ ^ "foo", "bar" ] + Before the *first* value in an array. + Next states: + "AfterValue" (read a value) + "AfterValue" (end of array; will pop stack) + + + + + [ "foo" ^ , "bar" ] + After any value in an array, so expecting either a comma or end-of-array + Next states: ArrayAfterComma or "AfterValue" + + + + + [ "foo", ^ "bar" ] + After a comma in an array, so there *must* be another value (simple or complex). + Next states: "AfterValue" (simple value), StartObject, StartArray + + + + + Wrapper around a text reader allowing small amounts of buffering and location handling. + + + + + The buffered next character, if we have one. + + + + + Returns the next character in the stream, or null if we have reached the end. + + + + + + Creates a new exception appropriate for the current state of the reader. + + + + + Stream implementation which proxies another stream, only allowing a certain amount + of data to be read. Note that this is only used to read delimited streams, so it + doesn't attempt to implement everything. + + + + + Extension methods on and . + + + + + Merges data from the given byte array into an existing message. + + The message to merge the data into. + The data to merge, which must be protobuf-encoded binary data. + + + + Merges data from the given byte array slice into an existing message. + + The message to merge the data into. + The data containing the slice to merge, which must be protobuf-encoded binary data. + The offset of the slice to merge. + The length of the slice to merge. + + + + Merges data from the given byte string into an existing message. + + The message to merge the data into. + The data to merge, which must be protobuf-encoded binary data. + + + + Merges data from the given stream into an existing message. + + The message to merge the data into. + Stream containing the data to merge, which must be protobuf-encoded binary data. + + + + Merges length-delimited data from the given stream into an existing message. + + + The stream is expected to contain a length and then the data. Only the amount of data + specified by the length will be consumed. + + The message to merge the data into. + Stream containing the data to merge, which must be protobuf-encoded binary data. + + + + Converts the given message into a byte array in protobuf encoding. + + The message to convert. + The message data as a byte array. + + + + Writes the given message data to the given stream in protobuf encoding. + + The message to write to the stream. + The stream to write to. + + + + Writes the length and then data of the given message to a stream. + + The message to write. + The output stream to write to. + + + + Converts the given message into a byte string in protobuf encoding. + + The message to convert. + The message data as a byte string. + + + + Writes the given message data to the given buffer writer in protobuf encoding. + + The message to write to the stream. + The stream to write to. + + + + Writes the given message data to the given span in protobuf encoding. + The size of the destination span needs to fit the serialized size + of the message exactly, otherwise an exception is thrown. + + The message to write to the stream. + The span to write to. Size must match size of the message exactly. + + + + Checks if all required fields in a message have values set. For proto3 messages, this returns true + + + + + A general message parser, typically used by reflection-based code as all the methods + return simple . + + + + + Creates a template instance ready for population. + + An empty message. + + + + Parses a message from a byte array. + + The byte array containing the message. Must not be null. + The newly parsed message. + + + + Parses a message from a byte array slice. + + The byte array containing the message. Must not be null. + The offset of the slice to parse. + The length of the slice to parse. + The newly parsed message. + + + + Parses a message from the given byte string. + + The data to parse. + The parsed message. + + + + Parses a message from the given stream. + + The stream to parse. + The parsed message. + + + + Parses a message from the given sequence. + + The data to parse. + The parsed message. + + + + Parses a length-delimited message from the given stream. + + + The stream is expected to contain a length and then the data. Only the amount of data + specified by the length will be consumed. + + The stream to parse. + The parsed message. + + + + Parses a message from the given coded input stream. + + The stream to parse. + The parsed message. + + + + Parses a message from the given JSON. + + The JSON to parse. + The parsed message. + The JSON does not comply with RFC 7159 + The JSON does not represent a Protocol Buffers message correctly + + + + Creates a new message parser which optionally discards unknown fields when parsing. + + Whether or not to discard unknown fields when parsing. + A newly configured message parser. + + + + Creates a new message parser which registers extensions from the specified registry upon creating the message instance + + The extensions to register + A newly configured message parser. + + + + A parser for a specific message type. + + +

+ This delegates most behavior to the + implementation within the original type, but + provides convenient overloads to parse from a variety of sources. +

+

+ Most applications will never need to create their own instances of this type; + instead, use the static Parser property of a generated message type to obtain a + parser for that type. +

+
+ The type of message to be parsed. +
+ + + Creates a new parser. + + + The factory method is effectively an optimization over using a generic constraint + to require a parameterless constructor: delegates are significantly faster to execute. + + Function to invoke when a new, empty message is required. + + + + Creates a template instance ready for population. + + An empty message. + + + + Parses a message from a byte array. + + The byte array containing the message. Must not be null. + The newly parsed message. + + + + Parses a message from a byte array slice. + + The byte array containing the message. Must not be null. + The offset of the slice to parse. + The length of the slice to parse. + The newly parsed message. + + + + Parses a message from the given byte string. + + The data to parse. + The parsed message. + + + + Parses a message from the given stream. + + The stream to parse. + The parsed message. + + + + Parses a message from the given sequence. + + The data to parse. + The parsed message. + + + + Parses a length-delimited message from the given stream. + + + The stream is expected to contain a length and then the data. Only the amount of data + specified by the length will be consumed. + + The stream to parse. + The parsed message. + + + + Parses a message from the given coded input stream. + + The stream to parse. + The parsed message. + + + + Parses a message from the given JSON. + + The JSON to parse. + The parsed message. + The JSON does not comply with RFC 7159 + The JSON does not represent a Protocol Buffers message correctly + + + + Creates a new message parser which optionally discards unknown fields when parsing. + + Whether or not to discard unknown fields when parsing. + A newly configured message parser. + + + + Creates a new message parser which registers extensions from the specified registry upon creating the message instance + + The extensions to register + A newly configured message parser. + + + + Struct used to hold the keys for the fieldByNumber table in DescriptorPool and the keys for the + extensionByNumber table in ExtensionRegistry. + + + + + An opaque struct that represents the current parsing state and is passed along + as the parsing proceeds. + All the public methods are intended to be invoked only by the generated code, + users should never invoke them directly. + + + + + Creates a ParseContext instance from CodedInputStream. + WARNING: internally this copies the CodedInputStream's state, so after done with the ParseContext, + the CodedInputStream's state needs to be updated. + + + + + Returns the last tag read, or 0 if no tags have been read or we've read beyond + the end of the input. + + + + + Internal-only property; when set to true, unknown fields will be discarded while parsing. + + + + + Internal-only property; provides extension identifiers to compatible messages while parsing. + + + + + Reads a field tag, returning the tag of 0 for "end of input". + + + If this method returns 0, it doesn't necessarily mean the end of all + the data in this CodedInputReader; it may be the end of the logical input + for an embedded message, for example. + + The next field tag, or 0 for end of input. (0 is never a valid tag.) + + + + Reads a double field from the input. + + + + + Reads a float field from the input. + + + + + Reads a uint64 field from the input. + + + + + Reads an int64 field from the input. + + + + + Reads an int32 field from the input. + + + + + Reads a fixed64 field from the input. + + + + + Reads a fixed32 field from the input. + + + + + Reads a bool field from the input. + + + + + Reads a string field from the input. + + + + + Reads an embedded message field value from the input. + + + + + Reads an embedded group field from the input. + + + + + Reads a bytes field value from the input. + + + + + Reads a uint32 field value from the input. + + + + + Reads an enum field value from the input. + + + + + Reads an sfixed32 field value from the input. + + + + + Reads an sfixed64 field value from the input. + + + + + Reads an sint32 field value from the input. + + + + + Reads an sint64 field value from the input. + + + + + Reads a length for length-delimited data. + + + This is internally just reading a varint, but this method exists + to make the calling code clearer. + + + + + The position within the current buffer (i.e. the next byte to read) + + + + + Size of the current buffer + + + + + If we are currently inside a length-delimited block, this is the number of + bytes in the buffer that are still available once we leave the delimited block. + + + + + The absolute position of the end of the current length-delimited block (including totalBytesRetired) + + + + + The total number of consumed before the start of the current buffer. The + total bytes read up to the current position can be computed as + totalBytesRetired + bufferPos. + + + + + The last tag we read. 0 indicates we've read to the end of the stream + (or haven't read anything yet). + + + + + The next tag, used to store the value read by PeekTag. + + + + + Internal-only property; when set to true, unknown fields will be discarded while parsing. + + + + + Internal-only property; provides extension identifiers to compatible messages while parsing. + + + + + Primitives for parsing protobuf wire format. + + + + + Reads a length for length-delimited data. + + + This is internally just reading a varint, but this method exists + to make the calling code clearer. + + + + + Parses the next tag. + If the end of logical stream was reached, an invalid tag of 0 is returned. + + + + + Peeks at the next tag in the stream. If it matches , + the tag is consumed and the method returns true; otherwise, the + stream is left in the original position and the method returns false. + + + + + Peeks at the next field tag. This is like calling , but the + tag is not consumed. (So a subsequent call to will return the + same value.) + + + + + Parses a raw varint. + + + + + Parses a raw Varint. If larger than 32 bits, discard the upper bits. + This method is optimised for the case where we've got lots of data in the buffer. + That means we can check the size just once, then just read directly from the buffer + without constant rechecking of the buffer length. + + + + + Parses a 32-bit little-endian integer. + + + + + Parses a 64-bit little-endian integer. + + + + + Parses a double value. + + + + + Parses a float value. + + + + + Reads a fixed size of bytes from the input. + + + the end of the stream or the current limit was reached + + + + + Reads and discards bytes. + + the end of the stream + or the current limit was reached + + + + Reads a string field value from the input. + + + + + Reads a bytes field value from the input. + + + + + Reads a UTF-8 string from the next "length" bytes. + + + the end of the stream or the current limit was reached + + + + + Reads a string assuming that it is spread across multiple spans in a . + + + + + Validates that the specified size doesn't exceed the current limit. If it does then remaining bytes + are skipped and an error is thrown. + + + + + Reads a varint from the input one byte at a time, so that it does not + read any bytes after the end of the varint. If you simply wrapped the + stream in a CodedInputStream and used ReadRawVarint32(Stream) + then you would probably end up reading past the end of the varint since + CodedInputStream buffers its input. + + + + + + + Decode a 32-bit value with ZigZag encoding. + + + ZigZag encodes signed integers into values that can be efficiently + encoded with varint. (Otherwise, negative values must be + sign-extended to 32 bits to be varint encoded, thus always taking + 5 bytes on the wire.) + + + + + Decode a 64-bit value with ZigZag encoding. + + + ZigZag encodes signed integers into values that can be efficiently + encoded with varint. (Otherwise, negative values must be + sign-extended to 64 bits to be varint encoded, thus always taking + 10 bytes on the wire.) + + + + + Checks whether there is known data available of the specified size remaining to parse. + When parsing from a Stream this can return false because we have no knowledge of the amount + of data remaining in the stream until it is read. + + + + + Checks whether there is known data available of the specified size remaining to parse + in the underlying data source. + When parsing from a Stream this will return false because we have no knowledge of the amount + of data remaining in the stream until it is read. + + + + + Read raw bytes of the specified length into a span. The amount of data available and the current limit should + be checked before calling this method. + + + + + Reading and skipping messages / groups + + + + + Skip a group. + + + + + Verifies that the last call to ReadTag() returned tag 0 - in other words, + we've reached the end of the stream when we expected to. + + The + tag read was not the one specified + + + + Fast parsing primitives for wrapper types + + + + + Helper methods for throwing exceptions when preconditions are not met. + + + This class is used internally and by generated code; it is not particularly + expected to be used from application code, although nothing prevents it + from being used that way. + + + + + Throws an ArgumentNullException if the given value is null, otherwise + return the value to the caller. + + + + + Throws an ArgumentNullException if the given value is null, otherwise + return the value to the caller. + + + This is equivalent to but without the type parameter + constraint. In most cases, the constraint is useful to prevent you from calling CheckNotNull + with a value type - but it gets in the way if either you want to use it with a nullable + value type, or you want to use it with an unconstrained type parameter. + + + + + Container for a set of custom options specified within a message, field etc. + + + + This type is publicly immutable, but internally mutable. It is only populated + by the descriptor parsing code - by the time any user code is able to see an instance, + it will be fully initialized. + + + If an option is requested using the incorrect method, an answer may still be returned: all + of the numeric types are represented internally using 64-bit integers, for example. It is up to + the caller to ensure that they make the appropriate method call for the option they're interested in. + Note that enum options are simply stored as integers, so the value should be fetched using + and then cast appropriately. + + + Repeated options are currently not supported. Asking for a single value of an option + which was actually repeated will return the last value, except for message types where + all the set values are merged together. + + + + + + Retrieves a Boolean value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a signed 32-bit integer value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a signed 64-bit integer value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves an unsigned 32-bit integer value for the specified option field, + assuming a fixed-length representation. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves an unsigned 64-bit integer value for the specified option field, + assuming a fixed-length representation. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a signed 32-bit integer value for the specified option field, + assuming a fixed-length representation. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a signed 64-bit integer value for the specified option field, + assuming a fixed-length representation. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a signed 32-bit integer value for the specified option field, + assuming a zigzag encoding. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a signed 64-bit integer value for the specified option field, + assuming a zigzag encoding. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves an unsigned 32-bit integer value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves an unsigned 64-bit integer value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a 32-bit floating point value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a 64-bit floating point value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a string value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a bytes value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + + Retrieves a message value for the specified option field. + + The field to fetch the value for. + The output variable to populate. + true if a suitable value for the field was found; false otherwise. + + + Holder for reflection information generated from google/protobuf/descriptor.proto + + + File descriptor for google/protobuf/descriptor.proto + + + + The protocol compiler can output a FileDescriptorSet containing the .proto + files it parses. + + + + Field number for the "file" field. + + + + Describes a complete .proto file. + + + + Field number for the "name" field. + + + + file name, relative to root of source tree + + + + Gets whether the "name" field is set + + + Clears the value of the "name" field + + + Field number for the "package" field. + + + + e.g. "foo", "foo.bar", etc. + + + + Gets whether the "package" field is set + + + Clears the value of the "package" field + + + Field number for the "dependency" field. + + + + Names of files imported by this file. + + + + Field number for the "public_dependency" field. + + + + Indexes of the public imported files in the dependency list above. + + + + Field number for the "weak_dependency" field. + + + + Indexes of the weak imported files in the dependency list. + For Google-internal migration only. Do not use. + + + + Field number for the "message_type" field. + + + + All top-level definitions in this file. + + + + Field number for the "enum_type" field. + + + Field number for the "service" field. + + + Field number for the "extension" field. + + + Field number for the "options" field. + + + Field number for the "source_code_info" field. + + + + This field contains optional information about the original source code. + You may safely remove this entire field without harming runtime + functionality of the descriptors -- the information is needed only by + development tools. + + + + Field number for the "syntax" field. + + + + The syntax of the proto file. + The supported values are "proto2" and "proto3". + + + + Gets whether the "syntax" field is set + + + Clears the value of the "syntax" field + + + + Describes a message type. + + + + Field number for the "name" field. + + + Gets whether the "name" field is set + + + Clears the value of the "name" field + + + Field number for the "field" field. + + + Field number for the "extension" field. + + + Field number for the "nested_type" field. + + + Field number for the "enum_type" field. + + + Field number for the "extension_range" field. + + + Field number for the "oneof_decl" field. + + + Field number for the "options" field. + + + Field number for the "reserved_range" field. + + + Field number for the "reserved_name" field. + + + + Reserved field names, which may not be used by fields in the same message. + A given name may only be reserved once. + + + + Container for nested types declared in the DescriptorProto message type. + + + Field number for the "start" field. + + + + Inclusive. + + + + Gets whether the "start" field is set + + + Clears the value of the "start" field + + + Field number for the "end" field. + + + + Exclusive. + + + + Gets whether the "end" field is set + + + Clears the value of the "end" field + + + Field number for the "options" field. + + + + Range of reserved tag numbers. Reserved tag numbers may not be used by + fields or extension ranges in the same message. Reserved ranges may + not overlap. + + + + Field number for the "start" field. + + + + Inclusive. + + + + Gets whether the "start" field is set + + + Clears the value of the "start" field + + + Field number for the "end" field. + + + + Exclusive. + + + + Gets whether the "end" field is set + + + Clears the value of the "end" field + + + Field number for the "uninterpreted_option" field. + + + + The parser stores options it doesn't recognize here. See above. + + + + + Describes a field within a message. + + + + Field number for the "name" field. + + + Gets whether the "name" field is set + + + Clears the value of the "name" field + + + Field number for the "number" field. + + + Gets whether the "number" field is set + + + Clears the value of the "number" field + + + Field number for the "label" field. + + + Gets whether the "label" field is set + + + Clears the value of the "label" field + + + Field number for the "type" field. + + + + If type_name is set, this need not be set. If both this and type_name + are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + + + + Gets whether the "type" field is set + + + Clears the value of the "type" field + + + Field number for the "type_name" field. + + + + For message and enum types, this is the name of the type. If the name + starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + rules are used to find the type (i.e. first the nested types within this + message are searched, then within the parent, on up to the root + namespace). + + + + Gets whether the "type_name" field is set + + + Clears the value of the "type_name" field + + + Field number for the "extendee" field. + + + + For extensions, this is the name of the type being extended. It is + resolved in the same manner as type_name. + + + + Gets whether the "extendee" field is set + + + Clears the value of the "extendee" field + + + Field number for the "default_value" field. + + + + For numeric types, contains the original text representation of the value. + For booleans, "true" or "false". + For strings, contains the default text contents (not escaped in any way). + For bytes, contains the C escaped value. All bytes >= 128 are escaped. + TODO(kenton): Base-64 encode? + + + + Gets whether the "default_value" field is set + + + Clears the value of the "default_value" field + + + Field number for the "oneof_index" field. + + + + If set, gives the index of a oneof in the containing type's oneof_decl + list. This field is a member of that oneof. + + + + Gets whether the "oneof_index" field is set + + + Clears the value of the "oneof_index" field + + + Field number for the "json_name" field. + + + + JSON name of this field. The value is set by protocol compiler. If the + user has set a "json_name" option on this field, that option's value + will be used. Otherwise, it's deduced from the field's name by converting + it to camelCase. + + + + Gets whether the "json_name" field is set + + + Clears the value of the "json_name" field + + + Field number for the "options" field. + + + Field number for the "proto3_optional" field. + + + + If true, this is a proto3 "optional". When a proto3 field is optional, it + tracks presence regardless of field type. + + When proto3_optional is true, this field must be belong to a oneof to + signal to old proto3 clients that presence is tracked for this field. This + oneof is known as a "synthetic" oneof, and this field must be its sole + member (each proto3 optional field gets its own synthetic oneof). Synthetic + oneofs exist in the descriptor only, and do not generate any API. Synthetic + oneofs must be ordered after all "real" oneofs. + + For message fields, proto3_optional doesn't create any semantic change, + since non-repeated message fields always track presence. However it still + indicates the semantic detail of whether the user wrote "optional" or not. + This can be useful for round-tripping the .proto file. For consistency we + give message fields a synthetic oneof also, even though it is not required + to track presence. This is especially important because the parser can't + tell if a field is a message or an enum, so it must always create a + synthetic oneof. + + Proto2 optional fields do not set this flag, because they already indicate + optional with `LABEL_OPTIONAL`. + + + + Gets whether the "proto3_optional" field is set + + + Clears the value of the "proto3_optional" field + + + Container for nested types declared in the FieldDescriptorProto message type. + + + + 0 is reserved for errors. + Order is weird for historical reasons. + + + + + Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + negative values are likely. + + + + + Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + negative values are likely. + + + + + Tag-delimited aggregate. + Group type is deprecated and not supported in proto3. However, Proto3 + implementations should still be able to parse the group wire format and + treat group fields as unknown fields. + + + + + Length-delimited aggregate. + + + + + New in version 2. + + + + + Uses ZigZag encoding. + + + + + Uses ZigZag encoding. + + + + + 0 is reserved for errors + + + + + Describes a oneof. + + + + Field number for the "name" field. + + + Gets whether the "name" field is set + + + Clears the value of the "name" field + + + Field number for the "options" field. + + + + Describes an enum type. + + + + Field number for the "name" field. + + + Gets whether the "name" field is set + + + Clears the value of the "name" field + + + Field number for the "value" field. + + + Field number for the "options" field. + + + Field number for the "reserved_range" field. + + + + Range of reserved numeric values. Reserved numeric values may not be used + by enum values in the same enum declaration. Reserved ranges may not + overlap. + + + + Field number for the "reserved_name" field. + + + + Reserved enum value names, which may not be reused. A given name may only + be reserved once. + + + + Container for nested types declared in the EnumDescriptorProto message type. + + + + Range of reserved numeric values. Reserved values may not be used by + entries in the same enum. Reserved ranges may not overlap. + + Note that this is distinct from DescriptorProto.ReservedRange in that it + is inclusive such that it can appropriately represent the entire int32 + domain. + + + + Field number for the "start" field. + + + + Inclusive. + + + + Gets whether the "start" field is set + + + Clears the value of the "start" field + + + Field number for the "end" field. + + + + Inclusive. + + + + Gets whether the "end" field is set + + + Clears the value of the "end" field + + + + Describes a value within an enum. + + + + Field number for the "name" field. + + + Gets whether the "name" field is set + + + Clears the value of the "name" field + + + Field number for the "number" field. + + + Gets whether the "number" field is set + + + Clears the value of the "number" field + + + Field number for the "options" field. + + + + Describes a service. + + + + Field number for the "name" field. + + + Gets whether the "name" field is set + + + Clears the value of the "name" field + + + Field number for the "method" field. + + + Field number for the "options" field. + + + + Describes a method of a service. + + + + Field number for the "name" field. + + + Gets whether the "name" field is set + + + Clears the value of the "name" field + + + Field number for the "input_type" field. + + + + Input and output type names. These are resolved in the same way as + FieldDescriptorProto.type_name, but must refer to a message type. + + + + Gets whether the "input_type" field is set + + + Clears the value of the "input_type" field + + + Field number for the "output_type" field. + + + Gets whether the "output_type" field is set + + + Clears the value of the "output_type" field + + + Field number for the "options" field. + + + Field number for the "client_streaming" field. + + + + Identifies if client streams multiple client messages + + + + Gets whether the "client_streaming" field is set + + + Clears the value of the "client_streaming" field + + + Field number for the "server_streaming" field. + + + + Identifies if server streams multiple server messages + + + + Gets whether the "server_streaming" field is set + + + Clears the value of the "server_streaming" field + + + Field number for the "java_package" field. + + + + Sets the Java package where classes generated from this .proto will be + placed. By default, the proto package is used, but this is often + inappropriate because proto packages do not normally start with backwards + domain names. + + + + Gets whether the "java_package" field is set + + + Clears the value of the "java_package" field + + + Field number for the "java_outer_classname" field. + + + + If set, all the classes from the .proto file are wrapped in a single + outer class with the given name. This applies to both Proto1 + (equivalent to the old "--one_java_file" option) and Proto2 (where + a .proto always translates to a single class, but you may want to + explicitly choose the class name). + + + + Gets whether the "java_outer_classname" field is set + + + Clears the value of the "java_outer_classname" field + + + Field number for the "java_multiple_files" field. + + + + If set true, then the Java code generator will generate a separate .java + file for each top-level message, enum, and service defined in the .proto + file. Thus, these types will *not* be nested inside the outer class + named by java_outer_classname. However, the outer class will still be + generated to contain the file's getDescriptor() method as well as any + top-level extensions defined in the file. + + + + Gets whether the "java_multiple_files" field is set + + + Clears the value of the "java_multiple_files" field + + + Field number for the "java_generate_equals_and_hash" field. + + + + This option does nothing. + + + + Gets whether the "java_generate_equals_and_hash" field is set + + + Clears the value of the "java_generate_equals_and_hash" field + + + Field number for the "java_string_check_utf8" field. + + + + If set true, then the Java2 code generator will generate code that + throws an exception whenever an attempt is made to assign a non-UTF-8 + byte sequence to a string field. + Message reflection will do the same. + However, an extension field still accepts non-UTF-8 byte sequences. + This option has no effect on when used with the lite runtime. + + + + Gets whether the "java_string_check_utf8" field is set + + + Clears the value of the "java_string_check_utf8" field + + + Field number for the "optimize_for" field. + + + Gets whether the "optimize_for" field is set + + + Clears the value of the "optimize_for" field + + + Field number for the "go_package" field. + + + + Sets the Go package where structs generated from this .proto will be + placed. If omitted, the Go package will be derived from the following: + - The basename of the package import path, if provided. + - Otherwise, the package statement in the .proto file, if present. + - Otherwise, the basename of the .proto file, without extension. + + + + Gets whether the "go_package" field is set + + + Clears the value of the "go_package" field + + + Field number for the "cc_generic_services" field. + + + + Should generic services be generated in each language? "Generic" services + are not specific to any particular RPC system. They are generated by the + main code generators in each language (without additional plugins). + Generic services were the only kind of service generation supported by + early versions of google.protobuf. + + Generic services are now considered deprecated in favor of using plugins + that generate code specific to your particular RPC system. Therefore, + these default to false. Old code which depends on generic services should + explicitly set them to true. + + + + Gets whether the "cc_generic_services" field is set + + + Clears the value of the "cc_generic_services" field + + + Field number for the "java_generic_services" field. + + + Gets whether the "java_generic_services" field is set + + + Clears the value of the "java_generic_services" field + + + Field number for the "py_generic_services" field. + + + Gets whether the "py_generic_services" field is set + + + Clears the value of the "py_generic_services" field + + + Field number for the "php_generic_services" field. + + + Gets whether the "php_generic_services" field is set + + + Clears the value of the "php_generic_services" field + + + Field number for the "deprecated" field. + + + + Is this file deprecated? + Depending on the target platform, this can emit Deprecated annotations + for everything in the file, or it will be completely ignored; in the very + least, this is a formalization for deprecating files. + + + + Gets whether the "deprecated" field is set + + + Clears the value of the "deprecated" field + + + Field number for the "cc_enable_arenas" field. + + + + Enables the use of arenas for the proto messages in this file. This applies + only to generated classes for C++. + + + + Gets whether the "cc_enable_arenas" field is set + + + Clears the value of the "cc_enable_arenas" field + + + Field number for the "objc_class_prefix" field. + + + + Sets the objective c class prefix which is prepended to all objective c + generated classes from this .proto. There is no default. + + + + Gets whether the "objc_class_prefix" field is set + + + Clears the value of the "objc_class_prefix" field + + + Field number for the "csharp_namespace" field. + + + + Namespace for generated classes; defaults to the package. + + + + Gets whether the "csharp_namespace" field is set + + + Clears the value of the "csharp_namespace" field + + + Field number for the "swift_prefix" field. + + + + By default Swift generators will take the proto package and CamelCase it + replacing '.' with underscore and use that to prefix the types/symbols + defined. When this options is provided, they will use this value instead + to prefix the types/symbols defined. + + + + Gets whether the "swift_prefix" field is set + + + Clears the value of the "swift_prefix" field + + + Field number for the "php_class_prefix" field. + + + + Sets the php class prefix which is prepended to all php generated classes + from this .proto. Default is empty. + + + + Gets whether the "php_class_prefix" field is set + + + Clears the value of the "php_class_prefix" field + + + Field number for the "php_namespace" field. + + + + Use this option to change the namespace of php generated classes. Default + is empty. When this option is empty, the package name will be used for + determining the namespace. + + + + Gets whether the "php_namespace" field is set + + + Clears the value of the "php_namespace" field + + + Field number for the "php_metadata_namespace" field. + + + + Use this option to change the namespace of php generated metadata classes. + Default is empty. When this option is empty, the proto file name will be + used for determining the namespace. + + + + Gets whether the "php_metadata_namespace" field is set + + + Clears the value of the "php_metadata_namespace" field + + + Field number for the "ruby_package" field. + + + + Use this option to change the package of ruby generated classes. Default + is empty. When this option is not set, the package name will be used for + determining the ruby package. + + + + Gets whether the "ruby_package" field is set + + + Clears the value of the "ruby_package" field + + + Field number for the "uninterpreted_option" field. + + + + The parser stores options it doesn't recognize here. + See the documentation for the "Options" section above. + + + + Container for nested types declared in the FileOptions message type. + + + + Generated classes can be optimized for speed or code size. + + + + + Generate complete code for parsing, serialization, + + + + + etc. + + + + + Generate code using MessageLite and the lite runtime. + + + + Field number for the "message_set_wire_format" field. + + + + Set true to use the old proto1 MessageSet wire format for extensions. + This is provided for backwards-compatibility with the MessageSet wire + format. You should not use this for any other reason: It's less + efficient, has fewer features, and is more complicated. + + The message must be defined exactly as follows: + message Foo { + option message_set_wire_format = true; + extensions 4 to max; + } + Note that the message cannot have any defined fields; MessageSets only + have extensions. + + All extensions of your type must be singular messages; e.g. they cannot + be int32s, enums, or repeated messages. + + Because this is an option, the above two restrictions are not enforced by + the protocol compiler. + + + + Gets whether the "message_set_wire_format" field is set + + + Clears the value of the "message_set_wire_format" field + + + Field number for the "no_standard_descriptor_accessor" field. + + + + Disables the generation of the standard "descriptor()" accessor, which can + conflict with a field of the same name. This is meant to make migration + from proto1 easier; new code should avoid fields named "descriptor". + + + + Gets whether the "no_standard_descriptor_accessor" field is set + + + Clears the value of the "no_standard_descriptor_accessor" field + + + Field number for the "deprecated" field. + + + + Is this message deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the message, or it will be completely ignored; in the very least, + this is a formalization for deprecating messages. + + + + Gets whether the "deprecated" field is set + + + Clears the value of the "deprecated" field + + + Field number for the "map_entry" field. + + + + Whether the message is an automatically generated map entry type for the + maps field. + + For maps fields: + map<KeyType, ValueType> map_field = 1; + The parsed descriptor looks like: + message MapFieldEntry { + option map_entry = true; + optional KeyType key = 1; + optional ValueType value = 2; + } + repeated MapFieldEntry map_field = 1; + + Implementations may choose not to generate the map_entry=true message, but + use a native map in the target language to hold the keys and values. + The reflection APIs in such implementations still need to work as + if the field is a repeated message field. + + NOTE: Do not set the option in .proto files. Always use the maps syntax + instead. The option should only be implicitly set by the proto compiler + parser. + + + + Gets whether the "map_entry" field is set + + + Clears the value of the "map_entry" field + + + Field number for the "uninterpreted_option" field. + + + + The parser stores options it doesn't recognize here. See above. + + + + Field number for the "ctype" field. + + + + The ctype option instructs the C++ code generator to use a different + representation of the field than it normally would. See the specific + options below. This option is not yet implemented in the open source + release -- sorry, we'll try to include it in a future version! + + + + Gets whether the "ctype" field is set + + + Clears the value of the "ctype" field + + + Field number for the "packed" field. + + + + The packed option can be enabled for repeated primitive fields to enable + a more efficient representation on the wire. Rather than repeatedly + writing the tag and type for each element, the entire array is encoded as + a single length-delimited blob. In proto3, only explicit setting it to + false will avoid using packed encoding. + + + + Gets whether the "packed" field is set + + + Clears the value of the "packed" field + + + Field number for the "jstype" field. + + + + The jstype option determines the JavaScript type used for values of the + field. The option is permitted only for 64 bit integral and fixed types + (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + is represented as JavaScript string, which avoids loss of precision that + can happen when a large value is converted to a floating point JavaScript. + Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + use the JavaScript "number" type. The behavior of the default option + JS_NORMAL is implementation dependent. + + This option is an enum to permit additional types to be added, e.g. + goog.math.Integer. + + + + Gets whether the "jstype" field is set + + + Clears the value of the "jstype" field + + + Field number for the "lazy" field. + + + + Should this field be parsed lazily? Lazy applies only to message-type + fields. It means that when the outer message is initially parsed, the + inner message's contents will not be parsed but instead stored in encoded + form. The inner message will actually be parsed when it is first accessed. + + This is only a hint. Implementations are free to choose whether to use + eager or lazy parsing regardless of the value of this option. However, + setting this option true suggests that the protocol author believes that + using lazy parsing on this field is worth the additional bookkeeping + overhead typically needed to implement it. + + This option does not affect the public interface of any generated code; + all method signatures remain the same. Furthermore, thread-safety of the + interface is not affected by this option; const methods remain safe to + call from multiple threads concurrently, while non-const methods continue + to require exclusive access. + + Note that implementations may choose not to check required fields within + a lazy sub-message. That is, calling IsInitialized() on the outer message + may return true even if the inner message has missing required fields. + This is necessary because otherwise the inner message would have to be + parsed in order to perform the check, defeating the purpose of lazy + parsing. An implementation which chooses not to check required fields + must be consistent about it. That is, for any particular sub-message, the + implementation must either *always* check its required fields, or *never* + check its required fields, regardless of whether or not the message has + been parsed. + + + + Gets whether the "lazy" field is set + + + Clears the value of the "lazy" field + + + Field number for the "deprecated" field. + + + + Is this field deprecated? + Depending on the target platform, this can emit Deprecated annotations + for accessors, or it will be completely ignored; in the very least, this + is a formalization for deprecating fields. + + + + Gets whether the "deprecated" field is set + + + Clears the value of the "deprecated" field + + + Field number for the "weak" field. + + + + For Google-internal migration only. Do not use. + + + + Gets whether the "weak" field is set + + + Clears the value of the "weak" field + + + Field number for the "uninterpreted_option" field. + + + + The parser stores options it doesn't recognize here. See above. + + + + Container for nested types declared in the FieldOptions message type. + + + + Default mode. + + + + + Use the default type. + + + + + Use JavaScript strings. + + + + + Use JavaScript numbers. + + + + Field number for the "uninterpreted_option" field. + + + + The parser stores options it doesn't recognize here. See above. + + + + Field number for the "allow_alias" field. + + + + Set this option to true to allow mapping different tag names to the same + value. + + + + Gets whether the "allow_alias" field is set + + + Clears the value of the "allow_alias" field + + + Field number for the "deprecated" field. + + + + Is this enum deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the enum, or it will be completely ignored; in the very least, this + is a formalization for deprecating enums. + + + + Gets whether the "deprecated" field is set + + + Clears the value of the "deprecated" field + + + Field number for the "uninterpreted_option" field. + + + + The parser stores options it doesn't recognize here. See above. + + + + Field number for the "deprecated" field. + + + + Is this enum value deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the enum value, or it will be completely ignored; in the very least, + this is a formalization for deprecating enum values. + + + + Gets whether the "deprecated" field is set + + + Clears the value of the "deprecated" field + + + Field number for the "uninterpreted_option" field. + + + + The parser stores options it doesn't recognize here. See above. + + + + Field number for the "deprecated" field. + + + + Is this service deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the service, or it will be completely ignored; in the very least, + this is a formalization for deprecating services. + + + + Gets whether the "deprecated" field is set + + + Clears the value of the "deprecated" field + + + Field number for the "uninterpreted_option" field. + + + + The parser stores options it doesn't recognize here. See above. + + + + Field number for the "deprecated" field. + + + + Is this method deprecated? + Depending on the target platform, this can emit Deprecated annotations + for the method, or it will be completely ignored; in the very least, + this is a formalization for deprecating methods. + + + + Gets whether the "deprecated" field is set + + + Clears the value of the "deprecated" field + + + Field number for the "idempotency_level" field. + + + Gets whether the "idempotency_level" field is set + + + Clears the value of the "idempotency_level" field + + + Field number for the "uninterpreted_option" field. + + + + The parser stores options it doesn't recognize here. See above. + + + + Container for nested types declared in the MethodOptions message type. + + + + Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + or neither? HTTP based RPC implementation may choose GET verb for safe + methods, and PUT verb for idempotent methods instead of the default POST. + + + + + implies idempotent + + + + + idempotent, but may have side effects + + + + + A message representing a option the parser does not recognize. This only + appears in options protos created by the compiler::Parser class. + DescriptorPool resolves these when building Descriptor objects. Therefore, + options protos in descriptor objects (e.g. returned by Descriptor::options(), + or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + in them. + + + + Field number for the "name" field. + + + Field number for the "identifier_value" field. + + + + The value of the uninterpreted option, in whatever type the tokenizer + identified it as during parsing. Exactly one of these should be set. + + + + Gets whether the "identifier_value" field is set + + + Clears the value of the "identifier_value" field + + + Field number for the "positive_int_value" field. + + + Gets whether the "positive_int_value" field is set + + + Clears the value of the "positive_int_value" field + + + Field number for the "negative_int_value" field. + + + Gets whether the "negative_int_value" field is set + + + Clears the value of the "negative_int_value" field + + + Field number for the "double_value" field. + + + Gets whether the "double_value" field is set + + + Clears the value of the "double_value" field + + + Field number for the "string_value" field. + + + Gets whether the "string_value" field is set + + + Clears the value of the "string_value" field + + + Field number for the "aggregate_value" field. + + + Gets whether the "aggregate_value" field is set + + + Clears the value of the "aggregate_value" field + + + Container for nested types declared in the UninterpretedOption message type. + + + + The name of the uninterpreted option. Each string represents a segment in + a dot-separated name. is_extension is true iff a segment represents an + extension (denoted with parentheses in options specs in .proto files). + E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + "foo.(bar.baz).qux". + + + + Field number for the "name_part" field. + + + Gets whether the "name_part" field is set + + + Clears the value of the "name_part" field + + + Field number for the "is_extension" field. + + + Gets whether the "is_extension" field is set + + + Clears the value of the "is_extension" field + + + + Encapsulates information about the original source file from which a + FileDescriptorProto was generated. + + + + Field number for the "location" field. + + + + A Location identifies a piece of source code in a .proto file which + corresponds to a particular definition. This information is intended + to be useful to IDEs, code indexers, documentation generators, and similar + tools. + + For example, say we have a file like: + message Foo { + optional string foo = 1; + } + Let's look at just the field definition: + optional string foo = 1; + ^ ^^ ^^ ^ ^^^ + a bc de f ghi + We have the following locations: + span path represents + [a,i) [ 4, 0, 2, 0 ] The whole field definition. + [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + + Notes: + - A location may refer to a repeated field itself (i.e. not to any + particular index within it). This is used whenever a set of elements are + logically enclosed in a single code segment. For example, an entire + extend block (possibly containing multiple extension definitions) will + have an outer location whose path refers to the "extensions" repeated + field without an index. + - Multiple locations may have the same path. This happens when a single + logical declaration is spread out across multiple places. The most + obvious example is the "extend" block again -- there may be multiple + extend blocks in the same scope, each of which will have the same path. + - A location's span is not always a subset of its parent's span. For + example, the "extendee" of an extension declaration appears at the + beginning of the "extend" block and is shared by all extensions within + the block. + - Just because a location's span is a subset of some other location's span + does not mean that it is a descendant. For example, a "group" defines + both a type and a field in a single declaration. Thus, the locations + corresponding to the type and field and their components will overlap. + - Code which tries to interpret locations should probably be designed to + ignore those that it doesn't understand, as more types of locations could + be recorded in the future. + + + + Container for nested types declared in the SourceCodeInfo message type. + + + Field number for the "path" field. + + + + Identifies which part of the FileDescriptorProto was defined at this + location. + + Each element is a field number or an index. They form a path from + the root FileDescriptorProto to the place where the definition. For + example, this path: + [ 4, 3, 2, 7, 1 ] + refers to: + file.message_type(3) // 4, 3 + .field(7) // 2, 7 + .name() // 1 + This is because FileDescriptorProto.message_type has field number 4: + repeated DescriptorProto message_type = 4; + and DescriptorProto.field has field number 2: + repeated FieldDescriptorProto field = 2; + and FieldDescriptorProto.name has field number 1: + optional string name = 1; + + Thus, the above path gives the location of a field name. If we removed + the last element: + [ 4, 3, 2, 7 ] + this path refers to the whole field declaration (from the beginning + of the label to the terminating semicolon). + + + + Field number for the "span" field. + + + + Always has exactly three or four elements: start line, start column, + end line (optional, otherwise assumed same as start line), end column. + These are packed into a single field for efficiency. Note that line + and column numbers are zero-based -- typically you will want to add + 1 to each before displaying to a user. + + + + Field number for the "leading_comments" field. + + + + If this SourceCodeInfo represents a complete declaration, these are any + comments appearing before and after the declaration which appear to be + attached to the declaration. + + A series of line comments appearing on consecutive lines, with no other + tokens appearing on those lines, will be treated as a single comment. + + leading_detached_comments will keep paragraphs of comments that appear + before (but not connected to) the current element. Each paragraph, + separated by empty lines, will be one comment element in the repeated + field. + + Only the comment content is provided; comment markers (e.g. //) are + stripped out. For block comments, leading whitespace and an asterisk + will be stripped from the beginning of each line other than the first. + Newlines are included in the output. + + Examples: + + optional int32 foo = 1; // Comment attached to foo. + // Comment attached to bar. + optional int32 bar = 2; + + optional string baz = 3; + // Comment attached to baz. + // Another line attached to baz. + + // Comment attached to qux. + // + // Another line attached to qux. + optional double qux = 4; + + // Detached comment for corge. This is not leading or trailing comments + // to qux or corge because there are blank lines separating it from + // both. + + // Detached comment for corge paragraph 2. + + optional string corge = 5; + /* Block comment attached + * to corge. Leading asterisks + * will be removed. */ + /* Block comment attached to + * grault. */ + optional int32 grault = 6; + + // ignored detached comments. + + + + Gets whether the "leading_comments" field is set + + + Clears the value of the "leading_comments" field + + + Field number for the "trailing_comments" field. + + + Gets whether the "trailing_comments" field is set + + + Clears the value of the "trailing_comments" field + + + Field number for the "leading_detached_comments" field. + + + + Describes the relationship between generated code and its original source + file. A GeneratedCodeInfo message is associated with only one generated + source file, but may contain references to different source .proto files. + + + + Field number for the "annotation" field. + + + + An Annotation connects some span of text in generated code to an element + of its generating .proto file. + + + + Container for nested types declared in the GeneratedCodeInfo message type. + + + Field number for the "path" field. + + + + Identifies the element in the original source .proto file. This field + is formatted the same as SourceCodeInfo.Location.path. + + + + Field number for the "source_file" field. + + + + Identifies the filesystem path to the original source .proto. + + + + Gets whether the "source_file" field is set + + + Clears the value of the "source_file" field + + + Field number for the "begin" field. + + + + Identifies the starting offset in bytes in the generated code + that relates to the identified object. + + + + Gets whether the "begin" field is set + + + Clears the value of the "begin" field + + + Field number for the "end" field. + + + + Identifies the ending offset in bytes in the generated code that + relates to the identified offset. The end offset should be one past + the last relevant byte (so the length of the text = end - begin). + + + + Gets whether the "end" field is set + + + Clears the value of the "end" field + + + + Base class for nearly all descriptors, providing common functionality. + + + + + The index of this descriptor within its parent descriptor. + + + This returns the index of this descriptor within its parent, for + this descriptor's type. (There can be duplicate values for different + types, e.g. one enum type with index 0 and one message type with index 0.) + + + + + Returns the name of the entity (field, message etc) being described. + + + + + The fully qualified name of the descriptor's target. + + + + + The file this descriptor was declared in. + + + + + The declaration information about the descriptor, or null if no declaration information + is available for this descriptor. + + + This information is typically only available for dynamically loaded descriptors, + for example within a protoc plugin where the full descriptors, including source info, + are passed to the code by protoc. + + + + + Retrieves the list of nested descriptors corresponding to the given field number, if any. + If the field is unknown or not a nested descriptor list, return null to terminate the search. + The default implementation returns null. + + + + + Provides additional information about the declaration of a descriptor, + such as source location and comments. + + + + + The descriptor this declaration relates to. + + + + + The start line of the declaration within the source file. This value is 1-based. + + + + + The start column of the declaration within the source file. This value is 1-based. + + + + + // The end line of the declaration within the source file. This value is 1-based. + + + + + The end column of the declaration within the source file. This value is 1-based, and + exclusive. (The final character of the declaration is on the column before this value.) + + + + + Comments appearing before the declaration. Never null, but may be empty. Multi-line comments + are represented as a newline-separated string. Leading whitespace and the comment marker ("//") + are removed from each line. + + + + + Comments appearing after the declaration. Never null, but may be empty. Multi-line comments + are represented as a newline-separated string. Leading whitespace and the comment marker ("//") + are removed from each line. + + + + + Comments appearing before the declaration, but separated from it by blank + lines. Each string represents a newline-separated paragraph of comments. + Leading whitespace and the comment marker ("//") are removed from each line. + The list is never null, but may be empty. Likewise each element is never null, but may be empty. + + + + + Contains lookup tables containing all the descriptors defined in a particular file. + + + + + Finds a symbol of the given name within the pool. + + The type of symbol to look for + Fully-qualified name to look up + The symbol with the given name and type, + or null if the symbol doesn't exist or has the wrong type + + + + Adds a package to the symbol tables. If a package by the same name + already exists, that is fine, but if some other kind of symbol + exists under the same name, an exception is thrown. If the package + has multiple components, this also adds the parent package(s). + + + + + Adds a symbol to the symbol table. + + The symbol already existed + in the symbol table. + + + + Verifies that the descriptor's name is valid (i.e. it contains + only letters, digits and underscores, and does not start with a digit). + + + + + + Returns the field with the given number in the given descriptor, + or null if it can't be found. + + + + + Adds a field to the fieldsByNumber table. + + A field with the same + containing type and number already exists. + + + + Adds an enum value to the enumValuesByNumber table. If an enum value + with the same type and number already exists, this method does nothing. + (This is allowed; the first value defined with the number takes precedence.) + + + + + Looks up a descriptor by name, relative to some other descriptor. + The name may be fully-qualified (with a leading '.'), partially-qualified, + or unqualified. C++-like name lookup semantics are used to search for the + matching descriptor. + + + This isn't heavily optimized, but it's only used during cross linking anyway. + If it starts being used more widely, we should look at performance more carefully. + + + + + Internal class containing utility methods when working with descriptors. + + + + + Equivalent to Func[TInput, int, TOutput] but usable in .NET 2.0. Only used to convert + arrays. + + + + + Converts the given array into a read-only list, applying the specified conversion to + each input element. + + + + + Thrown when building descriptors fails because the source DescriptorProtos + are not valid. + + + + + The full name of the descriptor where the error occurred. + + + + + A human-readable description of the error. (The Message property + is made up of the descriptor's name and this description.) + + + + + Descriptor for an enum type in a .proto file. + + + + + The brief name of the descriptor's target. + + + + + The CLR type for this enum. For generated code, this will be a CLR enum type. + + + + + If this is a nested type, get the outer descriptor, otherwise null. + + + + + An unmodifiable list of defined value descriptors for this enum. + + + + + Finds an enum value by number. If multiple enum values have the + same number, this returns the first defined value with that number. + If there is no value for the given number, this returns null. + + + + + Finds an enum value by name. + + The unqualified name of the value (e.g. "FOO"). + The value's descriptor, or null if not found. + + + + The (possibly empty) set of custom options for this enum. + + + + + The EnumOptions, defined in descriptor.proto. + If the options message is not present (i.e. there are no options), null is returned. + Custom options can be retrieved as extensions of the returned message. + NOTE: A defensive copy is created each time this property is retrieved. + + + + + Gets a single value enum option for this descriptor + + + + + Gets a repeated value enum option for this descriptor + + + + + Descriptor for a single enum value within an enum in a .proto file. + + + + + Returns the name of the enum value described by this object. + + + + + Returns the number associated with this enum value. + + + + + Returns the enum descriptor that this value is part of. + + + + + The (possibly empty) set of custom options for this enum value. + + + + + The EnumValueOptions, defined in descriptor.proto. + If the options message is not present (i.e. there are no options), null is returned. + Custom options can be retrieved as extensions of the returned message. + NOTE: A defensive copy is created each time this property is retrieved. + + + + + Gets a single value enum value option for this descriptor + + + + + Gets a repeated value enum value option for this descriptor + + + + + A collection to simplify retrieving the descriptors of extensions in a descriptor for a message + + + + + Returns a readonly list of all the extensions defined in this type in + the order they were defined in the source .proto file + + + + + Returns a readonly list of all the extensions define in this type that extend + the provided descriptor type in the order they were defined in the source .proto file + + + + + Returns a readonly list of all the extensions define in this type that extend + the provided descriptor type in accending field order + + + + + Base class for field accessors. + + + + + Descriptor for a field or extension within a message in a .proto file. + + + + + Get the field's containing message type, or null if it is a field defined at the top level of a file as an extension. + + + + + Returns the oneof containing this field, or null if it is not part of a oneof. + + + + + Returns the oneof containing this field if it's a "real" oneof, or null if either this + field is not part of a oneof, or the oneof is synthetic. + + + + + The effective JSON name for this field. This is usually the lower-camel-cased form of the field name, + but can be overridden using the json_name option in the .proto file. + + + + + Indicates whether this field supports presence, either implicitly (e.g. due to it being a message + type field) or explicitly via Has/Clear members. If this returns true, it is safe to call + and + on this field's accessor with a suitable message. + + + + + An extension identifier for this field, or null if this field isn't an extension. + + + + + The brief name of the descriptor's target. + + + + + Returns the accessor for this field. + + + + While a describes the field, it does not provide + any way of obtaining or changing the value of the field within a specific message; + that is the responsibility of the accessor. + + + In descriptors for generated code, the value returned by this property will be non-null for all + regular fields. However, if a message containing a map field is introspected, the list of nested messages will include + an auto-generated nested key/value pair message for the field. This is not represented in any + generated type, and the value of the map field itself is represented by a dictionary in the + reflection API. There are never instances of those "hidden" messages, so no accessor is provided + and this property will return null. + + + In dynamically loaded descriptors, the value returned by this property will current be null; + if and when dynamic messages are supported, it will return a suitable accessor to work with + them. + + + + + + Maps a field type as included in the .proto file to a FieldType. + + + + + Returns true if this field is a repeated field; false otherwise. + + + + + Returns true if this field is a required field; false otherwise. + + + + + Returns true if this field is a map field; false otherwise. + + + + + Returns true if this field is a packed, repeated field; false otherwise. + + + + + Returns true if this field extends another message type; false otherwise. + + + + + Returns the type of the field. + + + + + Returns the field number declared in the proto file. + + + + + Compares this descriptor with another one, ordering in "canonical" order + which simply means ascending order by field number. + must be a field of the same type, i.e. the of + both fields must be the same. + + + + + For enum fields, returns the field's type. + + + + + For embedded message and group fields, returns the field's type. + + + + + For extension fields, returns the extended type + + + + + The (possibly empty) set of custom options for this field. + + + + + The FieldOptions, defined in descriptor.proto. + If the options message is not present (i.e. there are no options), null is returned. + Custom options can be retrieved as extensions of the returned message. + NOTE: A defensive copy is created each time this property is retrieved. + + + + + Gets a single value field option for this descriptor + + + + + Gets a repeated value field option for this descriptor + + + + + Look up and cross-link all field types etc. + + + + + Enumeration of all the possible field types. + + + + + The double field type. + + + + + The float field type. + + + + + The int64 field type. + + + + + The uint64 field type. + + + + + The int32 field type. + + + + + The fixed64 field type. + + + + + The fixed32 field type. + + + + + The bool field type. + + + + + The string field type. + + + + + The field type used for groups. + + + + + The field type used for message fields. + + + + + The bytes field type. + + + + + The uint32 field type. + + + + + The sfixed32 field type. + + + + + The sfixed64 field type. + + + + + The sint32 field type. + + + + + The sint64 field type. + + + + + The field type used for enum fields. + + + + + The syntax of a .proto file + + + + + Proto2 syntax + + + + + Proto3 syntax + + + + + An unknown declared syntax + + + + + Describes a .proto file, including everything defined within. + IDescriptor is implemented such that the File property returns this descriptor, + and the FullName is the same as the Name. + + + + + Computes the full name of a descriptor within this file, with an optional parent message. + + + + + Extracts public dependencies from direct dependencies. This is a static method despite its + first parameter, as the value we're in the middle of constructing is only used for exceptions. + + + + + The descriptor in its protocol message representation. + + + + + The syntax of the file + + + + + The file name. + + + + + The package as declared in the .proto file. This may or may not + be equivalent to the .NET namespace of the generated classes. + + + + + Unmodifiable list of top-level message types declared in this file. + + + + + Unmodifiable list of top-level enum types declared in this file. + + + + + Unmodifiable list of top-level services declared in this file. + + + + + Unmodifiable list of top-level extensions declared in this file. + Note that some extensions may be incomplete (FieldDescriptor.Extension may be null) + if this descriptor was generated using a version of protoc that did not fully + support extensions in C#. + + + + + Unmodifiable list of this file's dependencies (imports). + + + + + Unmodifiable list of this file's public dependencies (public imports). + + + + + The original serialized binary form of this descriptor. + + + + + Implementation of IDescriptor.FullName - just returns the same as Name. + + + + + Implementation of IDescriptor.File - just returns this descriptor. + + + + + Pool containing symbol descriptors. + + + + + Finds a type (message, enum, service or extension) in the file by name. Does not find nested types. + + The unqualified type name to look for. + The type of descriptor to look for + The type's descriptor, or null if not found. + + + + Builds a FileDescriptor from its protocol buffer representation. + + The original serialized descriptor data. + We have only limited proto2 support, so serializing FileDescriptorProto + would not necessarily give us this. + The protocol message form of the FileDescriptor. + FileDescriptors corresponding to all of the + file's dependencies, in the exact order listed in the .proto file. May be null, + in which case it is treated as an empty array. + Whether unknown dependencies are ignored (true) or cause an exception to be thrown (false). + Details about generated code, for the purposes of reflection. + If is not + a valid descriptor. This can occur for a number of reasons, such as a field + having an undefined type or because two messages were defined with the same name. + + + + Creates a descriptor for generated code. + + + This method is only designed to be used by the results of generating code with protoc, + which creates the appropriate dependencies etc. It has to be public because the generated + code is "external", but should not be called directly by end users. + + + + + Converts the given descriptor binary data into FileDescriptor objects. + Note: reflection using the returned FileDescriptors is not currently supported. + + The binary file descriptor proto data. Must not be null, and any + dependencies must come before the descriptor which depends on them. (If A depends on B, and B + depends on C, then the descriptors must be presented in the order C, B, A.) This is compatible + with the order in which protoc provides descriptors to plugins. + The extension registry to use when parsing, or null if no extensions are required. + The file descriptors corresponding to . + + + + Converts the given descriptor binary data into FileDescriptor objects. + Note: reflection using the returned FileDescriptors is not currently supported. + + The binary file descriptor proto data. Must not be null, and any + dependencies must come before the descriptor which depends on them. (If A depends on B, and B + depends on C, then the descriptors must be presented in the order C, B, A.) This is compatible + with the order in which protoc provides descriptors to plugins. + The file descriptors corresponding to . + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Returns the file descriptor for descriptor.proto. + + + This is used for protos which take a direct dependency on descriptor.proto, typically for + annotations. While descriptor.proto is a proto2 file, it is built into the Google.Protobuf + runtime for reflection purposes. The messages are internal to the runtime as they would require + proto2 semantics for full support, but the file descriptor is available via this property. The + C# codegen in protoc automatically uses this property when it detects a dependency on descriptor.proto. + + + The file descriptor for descriptor.proto. + + + + + The (possibly empty) set of custom options for this file. + + + + + The FileOptions, defined in descriptor.proto. + If the options message is not present (i.e. there are no options), null is returned. + Custom options can be retrieved as extensions of the returned message. + NOTE: A defensive copy is created each time this property is retrieved. + + + + + Gets a single value file option for this descriptor + + + + + Gets a repeated value file option for this descriptor + + + + + Performs initialization for the given generic type argument. + + + This method is present for the sake of AOT compilers. It allows code (whether handwritten or generated) + to make calls into the reflection machinery of this library to express an intention to use that type + reflectively (e.g. for JSON parsing and formatting). The call itself does almost nothing, but AOT compilers + attempting to determine which generic type arguments need to be handled will spot the code path and act + accordingly. + + The type to force initialization for. + + + + Extra information provided by generated code when initializing a message or file descriptor. + These are constructed as required, and are not long-lived. Hand-written code should + never need to use this type. + + + + + Irrelevant for file descriptors; the CLR type for the message for message descriptors. + + + + + Irrelevant for file descriptors; the parser for message descriptors. + + + + + Irrelevant for file descriptors; the CLR property names (in message descriptor field order) + for fields in the message for message descriptors. + + + + + The extensions defined within this file/message descriptor + + + + + Irrelevant for file descriptors; the CLR property "base" names (in message descriptor oneof order) + for oneofs in the message for message descriptors. It is expected that for a oneof name of "Foo", + there will be a "FooCase" property and a "ClearFoo" method. + + + + + The reflection information for types within this file/message descriptor. Elements may be null + if there is no corresponding generated type, e.g. for map entry types. + + + + + The CLR types for enums within this file/message descriptor. + + + + + Creates a GeneratedClrTypeInfo for a message descriptor, with nested types, nested enums, the CLR type, property names and oneof names. + Each array parameter may be null, to indicate a lack of values. + The parameter order is designed to make it feasible to format the generated code readably. + + + + + Creates a GeneratedClrTypeInfo for a message descriptor, with nested types, nested enums, the CLR type, property names and oneof names. + Each array parameter may be null, to indicate a lack of values. + The parameter order is designed to make it feasible to format the generated code readably. + + + + + Creates a GeneratedClrTypeInfo for a file descriptor, with only types, enums, and extensions. + + + + + Creates a GeneratedClrTypeInfo for a file descriptor, with only types and enums. + + + + + Interface implemented by all descriptor types. + + + + + Returns the name of the entity (message, field etc) being described. + + + + + Returns the fully-qualified name of the entity being described. + + + + + Returns the descriptor for the .proto file that this entity is part of. + + + + + Allows fields to be reflectively accessed. + + + + + Returns the descriptor associated with this field. + + + + + Clears the field in the specified message. (For repeated fields, + this clears the list.) + + + + + Fetches the field value. For repeated values, this will be an + implementation. For map values, this will be an + implementation. + + + + + Indicates whether the field in the specified message is set. + For proto3 fields that aren't explicitly optional, this throws an + + + + + Mutator for single "simple" fields only. + + + Repeated fields are mutated by fetching the value and manipulating it as a list. + Map fields are mutated by fetching the value and manipulating it as a dictionary. + + The field is not a "simple" field. + + + + Accessor for map fields. + + + + + Describes a message type. + + + + + The brief name of the descriptor's target. + + + + + The CLR type used to represent message instances from this descriptor. + + + + The value returned by this property will be non-null for all regular fields. However, + if a message containing a map field is introspected, the list of nested messages will include + an auto-generated nested key/value pair message for the field. This is not represented in any + generated type, so this property will return null in such cases. + + + For wrapper types ( and the like), the type returned here + will be the generated message type, not the native type used by reflection for fields of those types. Code + using reflection should call to determine whether a message descriptor represents + a wrapper type, and handle the result appropriately. + + + + + + A parser for this message type. + + + + As is not generic, this cannot be statically + typed to the relevant type, but it should produce objects of a type compatible with . + + + The value returned by this property will be non-null for all regular fields. However, + if a message containing a map field is introspected, the list of nested messages will include + an auto-generated nested key/value pair message for the field. No message parser object is created for + such messages, so this property will return null in such cases. + + + For wrapper types ( and the like), the parser returned here + will be the generated message type, not the native type used by reflection for fields of those types. Code + using reflection should call to determine whether a message descriptor represents + a wrapper type, and handle the result appropriately. + + + + + + Returns whether this message is one of the "well known types" which may have runtime/protoc support. + + + + + Returns whether this message is one of the "wrapper types" used for fields which represent primitive values + with the addition of presence. + + + + + If this is a nested type, get the outer descriptor, otherwise null. + + + + + A collection of fields, which can be retrieved by name or field number. + + + + + An unmodifiable list of extensions defined in this message's scope. + Note that some extensions may be incomplete (FieldDescriptor.Extension may be null) + if they are declared in a file generated using a version of protoc that did not fully + support extensions in C#. + + + + + An unmodifiable list of this message type's nested types. + + + + + An unmodifiable list of this message type's enum types. + + + + + An unmodifiable list of the "oneof" field collections in this message type. + All "real" oneofs (where returns false) + come before synthetic ones. + + + + + The number of real "oneof" descriptors in this message type. Every element in + with an index less than this will have a property value + of false; every element with an index greater than or equal to this will have a + property value of true. + + + + + Finds a field by field name. + + The unqualified name of the field (e.g. "foo"). + The field's descriptor, or null if not found. + + + + Finds a field by field number. + + The field number within this message type. + The field's descriptor, or null if not found. + + + + Finds a nested descriptor by name. The is valid for fields, nested + message types, oneofs and enums. + + The unqualified name of the descriptor, e.g. "Foo" + The descriptor, or null if not found. + + + + The (possibly empty) set of custom options for this message. + + + + + The MessageOptions, defined in descriptor.proto. + If the options message is not present (i.e. there are no options), null is returned. + Custom options can be retrieved as extensions of the returned message. + NOTE: A defensive copy is created each time this property is retrieved. + + + + + Gets a single value message option for this descriptor + + + + + Gets a repeated value message option for this descriptor + + + + + Looks up and cross-links all fields and nested types. + + + + + A collection to simplify retrieving the field accessor for a particular field. + + + + + Returns the fields in the message as an immutable list, in the order in which they + are declared in the source .proto file. + + + + + Returns the fields in the message as an immutable list, in ascending field number + order. Field numbers need not be contiguous, so there is no direct mapping from the + index in the list to the field number; to retrieve a field by field number, it is better + to use the indexer. + + + + + Returns a read-only dictionary mapping the field names in this message as they're available + in the JSON representation to the field descriptors. For example, a field foo_bar + in the message would result two entries, one with a key fooBar and one with a key + foo_bar, both referring to the same field. + + + + + Retrieves the descriptor for the field with the given number. + + Number of the field to retrieve the descriptor for + The accessor for the given field + The message descriptor does not contain a field + with the given number + + + + Retrieves the descriptor for the field with the given name. + + Name of the field to retrieve the descriptor for + The descriptor for the given field + The message descriptor does not contain a field + with the given name + + + + Describes a single method in a service. + + + + + The service this method belongs to. + + + + + The method's input type. + + + + + The method's input type. + + + + + Indicates if client streams multiple requests. + + + + + Indicates if server streams multiple responses. + + + + + The (possibly empty) set of custom options for this method. + + + + + The MethodOptions, defined in descriptor.proto. + If the options message is not present (i.e. there are no options), null is returned. + Custom options can be retrieved as extensions of the returned message. + NOTE: A defensive copy is created each time this property is retrieved. + + + + + Gets a single value method option for this descriptor + + + + + Gets a repeated value method option for this descriptor + + + + + The brief name of the descriptor's target. + + + + + Reflection access for a oneof, allowing clear and "get case" actions. + + + + + Gets the descriptor for this oneof. + + + The descriptor of the oneof. + + + + + Clears the oneof in the specified message. + + + + + Indicates which field in the oneof is set for specified message + + + + + Describes a "oneof" field collection in a message type: a set of + fields of which at most one can be set in any particular message. + + + + + The brief name of the descriptor's target. + + + + + Gets the message type containing this oneof. + + + The message type containing this oneof. + + + + + Gets the fields within this oneof, in declaration order. + + + The fields within this oneof, in declaration order. + + + + + Returns true if this oneof is a synthetic oneof containing a proto3 optional field; + false otherwise. + + + + + Gets an accessor for reflective access to the values associated with the oneof + in a particular message. + + + + In descriptors for generated code, the value returned by this property will always be non-null. + + + In dynamically loaded descriptors, the value returned by this property will current be null; + if and when dynamic messages are supported, it will return a suitable accessor to work with + them. + + + + The accessor used for reflective access. + + + + + The (possibly empty) set of custom options for this oneof. + + + + + The OneofOptions, defined in descriptor.proto. + If the options message is not present (i.e. there are no options), null is returned. + Custom options can be retrieved as extensions of the returned message. + NOTE: A defensive copy is created each time this property is retrieved. + + + + + Gets a single value oneof option for this descriptor + + + + + Gets a repeated value oneof option for this descriptor + + + + + Specifies the original name (in the .proto file) of a named element, + such as an enum value. + + + + + The name of the element in the .proto file. + + + + + If the name is preferred in the .proto file. + + + + + Constructs a new attribute instance for the given name. + + The name of the element in the .proto file. + + + + Represents a package in the symbol table. We use PackageDescriptors + just as placeholders so that someone cannot define, say, a message type + that has the same name as an existing package. + + + + + The methods in this class are somewhat evil, and should not be tampered with lightly. + Basically they allow the creation of relatively weakly typed delegates from MethodInfos + which are more strongly typed. They do this by creating an appropriate strongly typed + delegate from the MethodInfo, and then calling that within an anonymous method. + Mind-bending stuff (at least to your humble narrator) but the resulting delegates are + very fast compared with calling Invoke later on. + + + + + Empty Type[] used when calling GetProperty to force property instead of indexer fetching. + + + + + Creates a delegate which will cast the argument to the type that declares the method, + call the method on it, then convert the result to object. + + The method to create a delegate for, which must be declared in an IMessage + implementation. + + + + Creates a delegate which will cast the argument to the type that declares the method, + call the method on it, then convert the result to the specified type. The method is expected + to actually return an enum (because of where we're calling it - for oneof cases). Sometimes that + means we need some extra work to perform conversions. + + The method to create a delegate for, which must be declared in an IMessage + implementation. + + + + Creates a delegate which will execute the given method after casting the first argument to + the type that declares the method, and the second argument to the first parameter type of the method. + + The method to create a delegate for, which must be declared in an IMessage + implementation. + + + + Creates a delegate which will execute the given method after casting the first argument to + type that declares the method. + + The method to create a delegate for, which must be declared in an IMessage + implementation. + + + + Creates a delegate which will execute the given method after casting the first argument to + the type that declares the method, and the second argument to the first parameter type of the method. + + + + + Creates a reflection helper for the given type arguments. Currently these are created on demand + rather than cached; this will be "busy" when initially loading a message's descriptor, but after that + they can be garbage collected. We could cache them by type if that proves to be important, but creating + an object is pretty cheap. + + + + + Accessor for repeated fields. + + + + + Describes a service type. + + + + + The brief name of the descriptor's target. + + + + + An unmodifiable list of methods in this service. + + + + + Finds a method by name. + + The unqualified name of the method (e.g. "Foo"). + The method's descriptor, or null if not found. + + + + The (possibly empty) set of custom options for this service. + + + + + The ServiceOptions, defined in descriptor.proto. + If the options message is not present (i.e. there are no options), null is returned. + Custom options can be retrieved as extensions of the returned message. + NOTE: A defensive copy is created each time this property is retrieved. + + + + + Gets a single value service option for this descriptor + + + + + Gets a repeated value service option for this descriptor + + + + + Accessor for single fields. + + + + + An immutable registry of types which can be looked up by their full name. + + + + + An empty type registry, containing no types. + + + + + Attempts to find a message descriptor by its full name. + + The full name of the message, which is the dot-separated + combination of package, containing messages and message name + The message descriptor corresponding to or null + if there is no such message descriptor. + + + + Creates a type registry from the specified set of file descriptors. + + + This is a convenience overload for + to allow calls such as TypeRegistry.FromFiles(descriptor1, descriptor2). + + The set of files to include in the registry. Must not contain null values. + A type registry for the given files. + + + + Creates a type registry from the specified set of file descriptors. + + + All message types within all the specified files are added to the registry, and + the dependencies of the specified files are also added, recursively. + + The set of files to include in the registry. Must not contain null values. + A type registry for the given files. + + + + Creates a type registry from the file descriptor parents of the specified set of message descriptors. + + + This is a convenience overload for + to allow calls such as TypeRegistry.FromFiles(descriptor1, descriptor2). + + The set of message descriptors to use to identify file descriptors to include in the registry. + Must not contain null values. + A type registry for the given files. + + + + Creates a type registry from the file descriptor parents of the specified set of message descriptors. + + + The specified message descriptors are only used to identify their file descriptors; the returned registry + contains all the types within the file descriptors which contain the specified message descriptors (and + the dependencies of those files), not just the specified messages. + + The set of message descriptors to use to identify file descriptors to include in the registry. + Must not contain null values. + A type registry for the given files. + + + + Builder class which isn't exposed, but acts as a convenient alternative to passing round two dictionaries in recursive calls. + + + + + Abstraction for reading from a stream / read only sequence. + Parsing from the buffer is a loop of reading from current buffer / refreshing the buffer once done. + + + + + Initialize an instance with a coded input stream. + This approach is faster than using a constructor because the instance to initialize is passed by reference + and we can write directly into it without copying. + + + + + Initialize an instance with a read only sequence. + This approach is faster than using a constructor because the instance to initialize is passed by reference + and we can write directly into it without copying. + + + + + Sets currentLimit to (current position) + byteLimit. This is called + when descending into a length-delimited embedded message. The previous + limit is returned. + + The old limit. + + + + Discards the current limit, returning the previous limit. + + + + + Returns whether or not all the data before the limit has been read. + + + + + + Returns true if the stream has reached the end of the input. This is the + case if either the end of the underlying input source has been reached or + the stream has reached a limit created using PushLimit. + + + + + Represents a single field in an UnknownFieldSet. + + An UnknownField consists of four lists of values. The lists correspond + to the four "wire types" used in the protocol buffer binary format. + Normally, only one of the four lists will contain any values, since it + is impossible to define a valid message type that declares two different + types for the same field number. However, the code is designed to allow + for the case where the same unknown field number is encountered using + multiple different wire types. + + + + + + Creates a new UnknownField. + + + + + Checks if two unknown field are equal. + + + + + Get the hash code of the unknown field. + + + + + Serializes the field, including the field number, and writes it to + + + The unknown field number. + The write context to write to. + + + + Computes the number of bytes required to encode this field, including field + number. + + + + + Merge the values in into this field. For each list + of values, 's values are append to the ones in this + field. + + + + + Returns a new list containing all of the given specified values from + both the and lists. + If is null and is null or empty, + null is returned. Otherwise, either a new list is created (if + is null) or the elements of are added to . + + + + + Adds a varint value. + + + + + Adds a fixed32 value. + + + + + Adds a fixed64 value. + + + + + Adds a length-delimited value. + + + + + Adds to the , creating + a new list if is null. The list is returned - either + the original reference or the new list. + + + + + Used to keep track of fields which were seen when parsing a protocol message + but whose field numbers or types are unrecognized. This most frequently + occurs when new fields are added to a message type and then messages containing + those fields are read by old software that was built before the new types were + added. + + Most users will never need to use this class directly. + + + + + Creates a new UnknownFieldSet. + + + + + Checks whether or not the given field number is present in the set. + + + + + Serializes the set and writes it to . + + + + + Serializes the set and writes it to . + + + + + Gets the number of bytes required to encode this set. + + + + + Checks if two unknown field sets are equal. + + + + + Gets the unknown field set's hash code. + + + + + Adds a field to the set. If a field with the same number already exists, it + is replaced. + + + + + Parse a single field from and merge it + into this set. + + The parse context from which to read the field + false if the tag is an "end group" tag, true otherwise + + + + Create a new UnknownFieldSet if unknownFields is null. + Parse a single field from and merge it + into unknownFields. If is configured to discard unknown fields, + will be returned as-is and the field will be skipped. + + The UnknownFieldSet which need to be merged + The coded input stream containing the field + The merged UnknownFieldSet + + + + Create a new UnknownFieldSet if unknownFields is null. + Parse a single field from and merge it + into unknownFields. If is configured to discard unknown fields, + will be returned as-is and the field will be skipped. + + The UnknownFieldSet which need to be merged + The parse context from which to read the field + The merged UnknownFieldSet + + + + Merges the fields from into this set. + If a field number exists in both sets, the values in + will be appended to the values in this set. + + + + + Created a new UnknownFieldSet to if + needed and merges the fields from into the first set. + If a field number exists in both sets, the values in + will be appended to the values in this set. + + + + + Adds a field to the unknown field set. If a field with the same + number already exists, the two are merged. + + + + + Clone an unknown field set from . + + + + + Provides a number of unsafe byte operations to be used by advanced applications with high performance + requirements. These methods are referred to as "unsafe" due to the fact that they potentially expose + the backing buffer of a to the application. + + + + The methods in this class should only be called if it is guaranteed that the buffer backing the + will never change! Mutation of a can lead to unexpected + and undesirable consequences in your application, and will likely be difficult to debug. Proceed with caution! + + + This can have a number of significant side affects that have spooky-action-at-a-distance-like behavior. In + particular, if the bytes value changes out from under a Protocol Buffer: + + + + serialization may throw + + + serialization may succeed but the wrong bytes may be written out + + + objects that are normally immutable (such as ByteString) are no longer immutable + + + hashCode may be incorrect + + + + + + + Constructs a new from the given bytes. The bytes are not copied, + and must not be modified while the is in use. + This API is experimental and subject to change. + + + + Holder for reflection information generated from google/protobuf/any.proto + + + File descriptor for google/protobuf/any.proto + + + + `Any` contains an arbitrary serialized protocol buffer message along with a + URL that describes the type of the serialized message. + + Protobuf library provides support to pack/unpack Any values in the form + of utility functions or additional generated methods of the Any type. + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by default use + 'type.googleapis.com/full.type.name' as the type URL and the unpack + methods only use the fully qualified type name after the last '/' + in the type URL, for example "foo.bar.com/x/y.z" will yield type + name "y.z". + + JSON + ==== + The JSON representation of an `Any` value uses the regular + representation of the deserialized, embedded message, with an + additional field `@type` which contains the type URL. Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": <string>, + "lastName": <string> + } + + If the embedded message type is well-known and has a custom JSON + representation, that representation will be embedded adding a field + `value` which holds the custom JSON in addition to the `@type` + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } + + + + Field number for the "type_url" field. + + + + A URL/resource name that uniquely identifies the type of the serialized + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a canonical form + (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that they + expect it to use in the context of Any. However, for URLs which use the + scheme `http`, `https`, or no scheme, one can optionally set up a type + server that maps type URLs to message definitions as follows: + + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. + + Schemes other than `http`, `https` (or the empty scheme) might be + used with implementation specific semantics. + + + + Field number for the "value" field. + + + + Must be a valid serialized protocol buffer of the above specified type. + + + + + Retrieves the type name for a type URL, matching the + of the packed message type. + + + + This is always just the last part of the URL, after the final slash. No validation of + anything before the trailing slash is performed. If the type URL does not include a slash, + an empty string is returned rather than an exception being thrown; this won't match any types, + and the calling code is probably in a better position to give a meaningful error. + + + There is no handling of fragments or queries at the moment. + + + The URL to extract the type name from + The type name + + + + Returns a bool indictating whether this Any message is of the target message type + + The descriptor of the message type + true if the type name matches the descriptor's full name or false otherwise + + + + Unpacks the content of this Any message into the target message type, + which must match the type URL within this Any message. + + The type of message to unpack the content into. + The unpacked message. + The target message type doesn't match the type URL in this message + + + + Attempts to unpack the content of this Any message into the target message type, + if it matches the type URL within this Any message. + + The type of message to attempt to unpack the content into. + true if the message was successfully unpacked; false if the type name didn't match + + + + Packs the specified message into an Any message using a type URL prefix of "type.googleapis.com". + + The message to pack. + An Any message with the content and type URL of . + + + + Packs the specified message into an Any message using the specified type URL prefix. + + The message to pack. + The prefix for the type URL. + An Any message with the content and type URL of . + + + Holder for reflection information generated from google/protobuf/api.proto + + + File descriptor for google/protobuf/api.proto + + + + Api is a light-weight descriptor for an API Interface. + + Interfaces are also described as "protocol buffer services" in some contexts, + such as by the "service" keyword in a .proto file, but they are different + from API Services, which represent a concrete implementation of an interface + as opposed to simply a description of methods and bindings. They are also + sometimes simply referred to as "APIs" in other contexts, such as the name of + this message itself. See https://cloud.google.com/apis/design/glossary for + detailed terminology. + + + + Field number for the "name" field. + + + + The fully qualified name of this interface, including package name + followed by the interface's simple name. + + + + Field number for the "methods" field. + + + + The methods of this interface, in unspecified order. + + + + Field number for the "options" field. + + + + Any metadata attached to the interface. + + + + Field number for the "version" field. + + + + A version string for this interface. If specified, must have the form + `major-version.minor-version`, as in `1.10`. If the minor version is + omitted, it defaults to zero. If the entire version field is empty, the + major version is derived from the package name, as outlined below. If the + field is not empty, the version in the package name will be verified to be + consistent with what is provided here. + + The versioning schema uses [semantic + versioning](http://semver.org) where the major version number + indicates a breaking change and the minor version an additive, + non-breaking change. Both version numbers are signals to users + what to expect from different versions, and should be carefully + chosen based on the product plan. + + The major version is also reflected in the package name of the + interface, which must end in `v<major-version>`, as in + `google.feature.v1`. For major versions 0 and 1, the suffix can + be omitted. Zero major versions must only be used for + experimental, non-GA interfaces. + + + + Field number for the "source_context" field. + + + + Source context for the protocol buffer service represented by this + message. + + + + Field number for the "mixins" field. + + + + Included interfaces. See [Mixin][]. + + + + Field number for the "syntax" field. + + + + The source syntax of the service. + + + + + Method represents a method of an API interface. + + + + Field number for the "name" field. + + + + The simple name of this method. + + + + Field number for the "request_type_url" field. + + + + A URL of the input message type. + + + + Field number for the "request_streaming" field. + + + + If true, the request is streamed. + + + + Field number for the "response_type_url" field. + + + + The URL of the output message type. + + + + Field number for the "response_streaming" field. + + + + If true, the response is streamed. + + + + Field number for the "options" field. + + + + Any metadata attached to the method. + + + + Field number for the "syntax" field. + + + + The source syntax of this method. + + + + + Declares an API Interface to be included in this interface. The including + interface must redeclare all the methods from the included interface, but + documentation and options are inherited as follows: + + - If after comment and whitespace stripping, the documentation + string of the redeclared method is empty, it will be inherited + from the original method. + + - Each annotation belonging to the service config (http, + visibility) which is not set in the redeclared method will be + inherited. + + - If an http annotation is inherited, the path pattern will be + modified as follows. Any version prefix will be replaced by the + version of the including interface plus the [root][] path if + specified. + + Example of a simple mixin: + + package google.acl.v1; + service AccessControl { + // Get the underlying ACL object. + rpc GetAcl(GetAclRequest) returns (Acl) { + option (google.api.http).get = "/v1/{resource=**}:getAcl"; + } + } + + package google.storage.v2; + service Storage { + rpc GetAcl(GetAclRequest) returns (Acl); + + // Get a data record. + rpc GetData(GetDataRequest) returns (Data) { + option (google.api.http).get = "/v2/{resource=**}"; + } + } + + Example of a mixin configuration: + + apis: + - name: google.storage.v2.Storage + mixins: + - name: google.acl.v1.AccessControl + + The mixin construct implies that all methods in `AccessControl` are + also declared with same name and request/response types in + `Storage`. A documentation generator or annotation processor will + see the effective `Storage.GetAcl` method after inheriting + documentation and annotations as follows: + + service Storage { + // Get the underlying ACL object. + rpc GetAcl(GetAclRequest) returns (Acl) { + option (google.api.http).get = "/v2/{resource=**}:getAcl"; + } + ... + } + + Note how the version in the path pattern changed from `v1` to `v2`. + + If the `root` field in the mixin is specified, it should be a + relative path under which inherited HTTP paths are placed. Example: + + apis: + - name: google.storage.v2.Storage + mixins: + - name: google.acl.v1.AccessControl + root: acls + + This implies the following inherited HTTP annotation: + + service Storage { + // Get the underlying ACL object. + rpc GetAcl(GetAclRequest) returns (Acl) { + option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + } + ... + } + + + + Field number for the "name" field. + + + + The fully qualified name of the interface which is included. + + + + Field number for the "root" field. + + + + If non-empty specifies a path under which inherited HTTP paths + are rooted. + + + + Holder for reflection information generated from google/protobuf/duration.proto + + + File descriptor for google/protobuf/duration.proto + + + + A Duration represents a signed, fixed-length span of time represented + as a count of seconds and fractions of seconds at nanosecond + resolution. It is independent of any calendar and concepts like "day" + or "month". It is related to Timestamp in that the difference between + two Timestamp values is a Duration and it can be added or subtracted + from a Timestamp. Range is approximately +-10,000 years. + + # Examples + + Example 1: Compute Duration from two Timestamps in pseudo code. + + Timestamp start = ...; + Timestamp end = ...; + Duration duration = ...; + + duration.seconds = end.seconds - start.seconds; + duration.nanos = end.nanos - start.nanos; + + if (duration.seconds < 0 && duration.nanos > 0) { + duration.seconds += 1; + duration.nanos -= 1000000000; + } else if (duration.seconds > 0 && duration.nanos < 0) { + duration.seconds -= 1; + duration.nanos += 1000000000; + } + + Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + + Timestamp start = ...; + Duration duration = ...; + Timestamp end = ...; + + end.seconds = start.seconds + duration.seconds; + end.nanos = start.nanos + duration.nanos; + + if (end.nanos < 0) { + end.seconds -= 1; + end.nanos += 1000000000; + } else if (end.nanos >= 1000000000) { + end.seconds += 1; + end.nanos -= 1000000000; + } + + Example 3: Compute Duration from datetime.timedelta in Python. + + td = datetime.timedelta(days=3, minutes=10) + duration = Duration() + duration.FromTimedelta(td) + + # JSON Mapping + + In JSON format, the Duration type is encoded as a string rather than an + object, where the string ends in the suffix "s" (indicating seconds) and + is preceded by the number of seconds, with nanoseconds expressed as + fractional seconds. For example, 3 seconds with 0 nanoseconds should be + encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + microsecond should be expressed in JSON format as "3.000001s". + + + + Field number for the "seconds" field. + + + + Signed seconds of the span of time. Must be from -315,576,000,000 + to +315,576,000,000 inclusive. Note: these bounds are computed from: + 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + + + + Field number for the "nanos" field. + + + + Signed fractions of a second at nanosecond resolution of the span + of time. Durations less than one second are represented with a 0 + `seconds` field and a positive or negative `nanos` field. For durations + of one second or more, a non-zero value for the `nanos` field must be + of the same sign as the `seconds` field. Must be from -999,999,999 + to +999,999,999 inclusive. + + + + + The number of nanoseconds in a second. + + + + + The number of nanoseconds in a BCL tick (as used by and ). + + + + + The maximum permitted number of seconds. + + + + + The minimum permitted number of seconds. + + + + + Converts this to a . + + If the duration is not a precise number of ticks, it is truncated towards 0. + The value of this duration, as a TimeSpan. + This value isn't a valid normalized duration, as + described in the documentation. + + + + Converts the given to a . + + The TimeSpan to convert. + The value of the given TimeSpan, as a Duration. + + + + Returns the result of negating the duration. For example, the negation of 5 minutes is -5 minutes. + + The duration to negate. Must not be null. + The negated value of this duration. + + + + Adds the two specified values together. + + The first value to add. Must not be null. + The second value to add. Must not be null. + + + + + Subtracts one from another. + + The duration to subtract from. Must not be null. + The duration to subtract. Must not be null. + The difference between the two specified durations. + + + + Creates a duration with the normalized values from the given number of seconds and + nanoseconds, conforming with the description in the proto file. + + + + + Converts a duration specified in seconds/nanoseconds to a string. + + + If the value is a normalized duration in the range described in duration.proto, + is ignored. Otherwise, if the parameter is true, + a JSON object with a warning is returned; if it is false, an is thrown. + + Seconds portion of the duration. + Nanoseconds portion of the duration. + Determines the handling of non-normalized values + The represented duration is invalid, and is false. + + + + Returns a string representation of this for diagnostic purposes. + + + Normally the returned value will be a JSON string value (including leading and trailing quotes) but + when the value is non-normalized or out of range, a JSON object representation will be returned + instead, including a warning. This is to avoid exceptions being thrown when trying to + diagnose problems - the regular JSON formatter will still throw an exception for non-normalized + values. + + A string representation of this value. + + + + Appends a number of nanoseconds to a StringBuilder. Either 0 digits are added (in which + case no "." is appended), or 3 6 or 9 digits. This is internal for use in Timestamp as well + as Duration. + + + + Holder for reflection information generated from google/protobuf/empty.proto + + + File descriptor for google/protobuf/empty.proto + + + + A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to use it as the request + or the response type of an API method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + } + + The JSON representation for `Empty` is empty JSON object `{}`. + + + + Holder for reflection information generated from google/protobuf/field_mask.proto + + + File descriptor for google/protobuf/field_mask.proto + + + + `FieldMask` represents a set of symbolic field paths, for example: + + paths: "f.a" + paths: "f.b.d" + + Here `f` represents a field in some root message, `a` and `b` + fields in the message found in `f`, and `d` a field found in the + message in `f.b`. + + Field masks are used to specify a subset of fields that should be + returned by a get operation or modified by an update operation. + Field masks also have a custom JSON encoding (see below). + + # Field Masks in Projections + + When used in the context of a projection, a response message or + sub-message is filtered by the API to only contain those fields as + specified in the mask. For example, if the mask in the previous + example is applied to a response message as follows: + + f { + a : 22 + b { + d : 1 + x : 2 + } + y : 13 + } + z: 8 + + The result will not contain specific values for fields x,y and z + (their value will be set to the default, and omitted in proto text + output): + + f { + a : 22 + b { + d : 1 + } + } + + A repeated field is not allowed except at the last position of a + paths string. + + If a FieldMask object is not present in a get operation, the + operation applies to all fields (as if a FieldMask of all fields + had been specified). + + Note that a field mask does not necessarily apply to the + top-level response message. In case of a REST get operation, the + field mask applies directly to the response, but in case of a REST + list operation, the mask instead applies to each individual message + in the returned resource list. In case of a REST custom method, + other definitions may be used. Where the mask applies will be + clearly documented together with its declaration in the API. In + any case, the effect on the returned resource/resources is required + behavior for APIs. + + # Field Masks in Update Operations + + A field mask in update operations specifies which fields of the + targeted resource are going to be updated. The API is required + to only change the values of the fields as specified in the mask + and leave the others untouched. If a resource is passed in to + describe the updated values, the API ignores the values of all + fields not covered by the mask. + + If a repeated field is specified for an update operation, new values will + be appended to the existing repeated field in the target resource. Note that + a repeated field is only allowed in the last position of a `paths` string. + + If a sub-message is specified in the last position of the field mask for an + update operation, then new value will be merged into the existing sub-message + in the target resource. + + For example, given the target message: + + f { + b { + d: 1 + x: 2 + } + c: [1] + } + + And an update message: + + f { + b { + d: 10 + } + c: [2] + } + + then if the field mask is: + + paths: ["f.b", "f.c"] + + then the result will be: + + f { + b { + d: 10 + x: 2 + } + c: [1, 2] + } + + An implementation may provide options to override this default behavior for + repeated and message fields. + + In order to reset a field's value to the default, the field must + be in the mask and set to the default value in the provided resource. + Hence, in order to reset all fields of a resource, provide a default + instance of the resource and set all fields in the mask, or do + not provide a mask as described below. + + If a field mask is not present on update, the operation applies to + all fields (as if a field mask of all fields has been specified). + Note that in the presence of schema evolution, this may mean that + fields the client does not know and has therefore not filled into + the request will be reset to their default. If this is unwanted + behavior, a specific service may require a client to always specify + a field mask, producing an error if not. + + As with get operations, the location of the resource which + describes the updated values in the request message depends on the + operation kind. In any case, the effect of the field mask is + required to be honored by the API. + + ## Considerations for HTTP REST + + The HTTP kind of an update operation which uses a field mask must + be set to PATCH instead of PUT in order to satisfy HTTP semantics + (PUT must only be used for full updates). + + # JSON Encoding of Field Masks + + In JSON, a field mask is encoded as a single string where paths are + separated by a comma. Fields name in each path are converted + to/from lower-camel naming conventions. + + As an example, consider the following message declarations: + + message Profile { + User user = 1; + Photo photo = 2; + } + message User { + string display_name = 1; + string address = 2; + } + + In proto a field mask for `Profile` may look as such: + + mask { + paths: "user.display_name" + paths: "photo" + } + + In JSON, the same mask is represented as below: + + { + mask: "user.displayName,photo" + } + + # Field Masks and Oneof Fields + + Field masks treat fields in oneofs just as regular fields. Consider the + following message: + + message SampleMessage { + oneof test_oneof { + string name = 4; + SubMessage sub_message = 9; + } + } + + The field mask can be: + + mask { + paths: "name" + } + + Or: + + mask { + paths: "sub_message" + } + + Note that oneof type names ("test_oneof" in this case) cannot be used in + paths. + + ## Field Mask Verification + + The implementation of any API method which has a FieldMask type field in the + request should verify the included field paths, and return an + `INVALID_ARGUMENT` error if any path is unmappable. + + + + Field number for the "paths" field. + + + + The set of field mask paths. + + + + + Converts a field mask specified by paths to a string. + + + If the value is a normalized duration in the range described in field_mask.proto, + is ignored. Otherwise, if the parameter is true, + a JSON object with a warning is returned; if it is false, an is thrown. + + Paths in the field mask + Determines the handling of non-normalized values + The represented field mask is invalid, and is false. + + + + Returns a string representation of this for diagnostic purposes. + + + Normally the returned value will be a JSON string value (including leading and trailing quotes) but + when the value is non-normalized or out of range, a JSON object representation will be returned + instead, including a warning. This is to avoid exceptions being thrown when trying to + diagnose problems - the regular JSON formatter will still throw an exception for non-normalized + values. + + A string representation of this value. + + + + Parses from a string to a FieldMask. + + + + + Parses from a string to a FieldMask and validates all field paths. + + The type to validate the field paths against. + + + + Constructs a FieldMask for a list of field paths in a certain type. + + The type to validate the field paths against. + + + + Constructs a FieldMask from the passed field numbers. + + The type to validate the field paths against. + + + + Constructs a FieldMask from the passed field numbers. + + The type to validate the field paths against. + + + + Checks whether the given path is valid for a field mask. + + true if the path is valid; false otherwise + + + + Checks whether paths in a given fields mask are valid. + + The type to validate the field paths against. + + + + Checks whether paths in a given fields mask are valid. + + + + + Checks whether a given field path is valid. + + The type to validate the field paths against. + + + + Checks whether paths in a given fields mask are valid. + + + + + Converts this FieldMask to its canonical form. In the canonical form of a + FieldMask, all field paths are sorted alphabetically and redundant field + paths are removed. + + + + + Creates a union of two or more FieldMasks. + + + + + Calculates the intersection of two FieldMasks. + + + + + Merges fields specified by this FieldMask from one message to another with the + specified merge options. + + + + + Merges fields specified by this FieldMask from one message to another. + + + + + Options to customize merging behavior. + + + + + Whether to replace message fields(i.e., discard existing content in + destination message fields) when merging. + Default behavior is to merge the source message field into the + destination message field. + + + + + Whether to replace repeated fields (i.e., discard existing content in + destination repeated fields) when merging. + Default behavior is to append elements from source repeated field to the + destination repeated field. + + + + + Whether to replace primitive (non-repeated and non-message) fields in + destination message fields with the source primitive fields (i.e., if the + field is set in the source, the value is copied to the + destination; if the field is unset in the source, the field is cleared + from the destination) when merging. + + Default behavior is to always set the value of the source primitive + field to the destination primitive field, and if the source field is + unset, the default value of the source field is copied to the + destination. + + + + Holder for reflection information generated from google/protobuf/source_context.proto + + + File descriptor for google/protobuf/source_context.proto + + + + `SourceContext` represents information about the source of a + protobuf element, like the file in which it is defined. + + + + Field number for the "file_name" field. + + + + The path-qualified name of the .proto file that contained the associated + protobuf element. For example: `"google/protobuf/source_context.proto"`. + + + + Holder for reflection information generated from google/protobuf/struct.proto + + + File descriptor for google/protobuf/struct.proto + + + + `NullValue` is a singleton enumeration to represent the null value for the + `Value` type union. + + The JSON representation for `NullValue` is JSON `null`. + + + + + Null value. + + + + + `Struct` represents a structured data value, consisting of fields + which map to dynamically typed values. In some languages, `Struct` + might be supported by a native representation. For example, in + scripting languages like JS a struct is represented as an + object. The details of that representation are described together + with the proto support for the language. + + The JSON representation for `Struct` is JSON object. + + + + Field number for the "fields" field. + + + + Unordered map of dynamically typed values. + + + + + `Value` represents a dynamically typed value which can be either + null, a number, a string, a boolean, a recursive struct value, or a + list of values. A producer of value is expected to set one of that + variants, absence of any variant indicates an error. + + The JSON representation for `Value` is JSON value. + + + + Field number for the "null_value" field. + + + + Represents a null value. + + + + Field number for the "number_value" field. + + + + Represents a double value. + + + + Field number for the "string_value" field. + + + + Represents a string value. + + + + Field number for the "bool_value" field. + + + + Represents a boolean value. + + + + Field number for the "struct_value" field. + + + + Represents a structured value. + + + + Field number for the "list_value" field. + + + + Represents a repeated `Value`. + + + + Enum of possible cases for the "kind" oneof. + + + + Convenience method to create a Value message with a string value. + + Value to set for the StringValue property. + A newly-created Value message with the given value. + + + + Convenience method to create a Value message with a number value. + + Value to set for the NumberValue property. + A newly-created Value message with the given value. + + + + Convenience method to create a Value message with a Boolean value. + + Value to set for the BoolValue property. + A newly-created Value message with the given value. + + + + Convenience method to create a Value message with a null initial value. + + A newly-created Value message a null initial value. + + + + Convenience method to create a Value message with an initial list of values. + + The values provided are not cloned; the references are copied directly. + A newly-created Value message an initial list value. + + + + Convenience method to create a Value message with an initial struct value + + The value provided is not cloned; the reference is copied directly. + A newly-created Value message an initial struct value. + + + + `ListValue` is a wrapper around a repeated field of values. + + The JSON representation for `ListValue` is JSON array. + + + + Field number for the "values" field. + + + + Repeated field of dynamically typed values. + + + + + Extension methods on BCL time-related types, converting to protobuf types. + + + + + Converts the given to a . + + The date and time to convert to a timestamp. + The value has a other than Utc. + The converted timestamp. + + + + Converts the given to a + + The offset is taken into consideration when converting the value (so the same instant in time + is represented) but is not a separate part of the resulting value. In other words, there is no + roundtrip operation to retrieve the original DateTimeOffset. + The date and time (with UTC offset) to convert to a timestamp. + The converted timestamp. + + + + Converts the given to a . + + The time span to convert. + The converted duration. + + + Holder for reflection information generated from google/protobuf/timestamp.proto + + + File descriptor for google/protobuf/timestamp.proto + + + + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at + nanosecond resolution. The count is relative to an epoch at UTC midnight on + January 1, 1970, in the proleptic Gregorian calendar which extends the + Gregorian calendar backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a [24-hour linear + smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from [RFC + 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + where {year} is always expressed using four digits while {month}, {day}, + {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + is required. A proto3 JSON serializer should always use UTC (as indicated by + "Z") when printing the Timestamp type and a proto3 JSON parser should be + able to accept both UTC and other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + 01:30 UTC on January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the + standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted + to this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + the Joda Time's [`ISODateTimeFormat.dateTime()`]( + http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + ) to obtain a formatter capable of generating timestamps in this format. + + + + Field number for the "seconds" field. + + + + Represents seconds of UTC time since Unix epoch + 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + 9999-12-31T23:59:59Z inclusive. + + + + Field number for the "nanos" field. + + + + Non-negative fractions of a second at nanosecond resolution. Negative + second values with fractions must still have non-negative nanos values + that count forward in time. Must be from 0 to 999,999,999 + inclusive. + + + + + Returns the difference between one and another, as a . + + The timestamp to subtract from. Must not be null. + The timestamp to subtract. Must not be null. + The difference between the two specified timestamps. + + + + Adds a to a , to obtain another Timestamp. + + The timestamp to add the duration to. Must not be null. + The duration to add. Must not be null. + The result of adding the duration to the timestamp. + + + + Subtracts a from a , to obtain another Timestamp. + + The timestamp to subtract the duration from. Must not be null. + The duration to subtract. + The result of subtracting the duration from the timestamp. + + + + Converts this timestamp into a . + + + The resulting DateTime will always have a Kind of Utc. + If the timestamp is not a precise number of ticks, it will be truncated towards the start + of time. For example, a timestamp with a value of 99 will result in a + value precisely on a second. + + This timestamp as a DateTime. + The timestamp contains invalid values; either it is + incorrectly normalized or is outside the valid range. + + + + Converts this timestamp into a . + + + The resulting DateTimeOffset will always have an Offset of zero. + If the timestamp is not a precise number of ticks, it will be truncated towards the start + of time. For example, a timestamp with a value of 99 will result in a + value precisely on a second. + + This timestamp as a DateTimeOffset. + The timestamp contains invalid values; either it is + incorrectly normalized or is outside the valid range. + + + + Converts the specified to a . + + + The Kind of is not DateTimeKind.Utc. + The converted timestamp. + + + + Converts the given to a + + The offset is taken into consideration when converting the value (so the same instant in time + is represented) but is not a separate part of the resulting value. In other words, there is no + roundtrip operation to retrieve the original DateTimeOffset. + The date and time (with UTC offset) to convert to a timestamp. + The converted timestamp. + + + + Converts a timestamp specified in seconds/nanoseconds to a string. + + + If the value is a normalized duration in the range described in timestamp.proto, + is ignored. Otherwise, if the parameter is true, + a JSON object with a warning is returned; if it is false, an is thrown. + + Seconds portion of the duration. + Nanoseconds portion of the duration. + Determines the handling of non-normalized values + The represented duration is invalid, and is false. + + + + Given another timestamp, returns 0 if the timestamps are equivalent, -1 if this timestamp precedes the other, and 1 otherwise + + + Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. + + Timestamp to compare + an integer indicating whether this timestamp precedes or follows the other + + + + Compares two timestamps and returns whether the first is less than (chronologically precedes) the second + + + Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. + + + + true if a precedes b + + + + Compares two timestamps and returns whether the first is greater than (chronologically follows) the second + + + Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. + + + + true if a follows b + + + + Compares two timestamps and returns whether the first is less than (chronologically precedes) the second + + + Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. + + + + true if a precedes b + + + + Compares two timestamps and returns whether the first is greater than (chronologically follows) the second + + + Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. + + + + true if a follows b + + + + Returns whether two timestamps are equivalent + + + Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. + + + + true if the two timestamps refer to the same nanosecond + + + + Returns whether two timestamps differ + + + Make sure the timestamps are normalized. Comparing non-normalized timestamps is not specified and may give unexpected results. + + + + true if the two timestamps differ + + + + Returns a string representation of this for diagnostic purposes. + + + Normally the returned value will be a JSON string value (including leading and trailing quotes) but + when the value is non-normalized or out of range, a JSON object representation will be returned + instead, including a warning. This is to avoid exceptions being thrown when trying to + diagnose problems - the regular JSON formatter will still throw an exception for non-normalized + values. + + A string representation of this value. + + + Holder for reflection information generated from google/protobuf/type.proto + + + File descriptor for google/protobuf/type.proto + + + + The syntax in which a protocol buffer element is defined. + + + + + Syntax `proto2`. + + + + + Syntax `proto3`. + + + + + A protocol buffer message type. + + + + Field number for the "name" field. + + + + The fully qualified message name. + + + + Field number for the "fields" field. + + + + The list of fields. + + + + Field number for the "oneofs" field. + + + + The list of types appearing in `oneof` definitions in this type. + + + + Field number for the "options" field. + + + + The protocol buffer options. + + + + Field number for the "source_context" field. + + + + The source context. + + + + Field number for the "syntax" field. + + + + The source syntax. + + + + + A single field of a message type. + + + + Field number for the "kind" field. + + + + The field type. + + + + Field number for the "cardinality" field. + + + + The field cardinality. + + + + Field number for the "number" field. + + + + The field number. + + + + Field number for the "name" field. + + + + The field name. + + + + Field number for the "type_url" field. + + + + The field type URL, without the scheme, for message or enumeration + types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + + + + Field number for the "oneof_index" field. + + + + The index of the field type in `Type.oneofs`, for message or enumeration + types. The first type has index 1; zero means the type is not in the list. + + + + Field number for the "packed" field. + + + + Whether to use alternative packed wire representation. + + + + Field number for the "options" field. + + + + The protocol buffer options. + + + + Field number for the "json_name" field. + + + + The field JSON name. + + + + Field number for the "default_value" field. + + + + The string value of the default value of this field. Proto2 syntax only. + + + + Container for nested types declared in the Field message type. + + + + Basic field types. + + + + + Field type unknown. + + + + + Field type double. + + + + + Field type float. + + + + + Field type int64. + + + + + Field type uint64. + + + + + Field type int32. + + + + + Field type fixed64. + + + + + Field type fixed32. + + + + + Field type bool. + + + + + Field type string. + + + + + Field type group. Proto2 syntax only, and deprecated. + + + + + Field type message. + + + + + Field type bytes. + + + + + Field type uint32. + + + + + Field type enum. + + + + + Field type sfixed32. + + + + + Field type sfixed64. + + + + + Field type sint32. + + + + + Field type sint64. + + + + + Whether a field is optional, required, or repeated. + + + + + For fields with unknown cardinality. + + + + + For optional fields. + + + + + For required fields. Proto2 syntax only. + + + + + For repeated fields. + + + + + Enum type definition. + + + + Field number for the "name" field. + + + + Enum type name. + + + + Field number for the "enumvalue" field. + + + + Enum value definitions. + + + + Field number for the "options" field. + + + + Protocol buffer options. + + + + Field number for the "source_context" field. + + + + The source context. + + + + Field number for the "syntax" field. + + + + The source syntax. + + + + + Enum value definition. + + + + Field number for the "name" field. + + + + Enum value name. + + + + Field number for the "number" field. + + + + Enum value number. + + + + Field number for the "options" field. + + + + Protocol buffer options. + + + + + A protocol buffer option, which can be attached to a message, field, + enumeration, etc. + + + + Field number for the "name" field. + + + + The option's name. For protobuf built-in options (options defined in + descriptor.proto), this is the short name. For example, `"map_entry"`. + For custom options, it should be the fully-qualified name. For example, + `"google.api.http"`. + + + + Field number for the "value" field. + + + + The option's value packed in an Any message. If the value is a primitive, + the corresponding wrapper type defined in google/protobuf/wrappers.proto + should be used. If the value is an enum, it should be stored as an int32 + value using the google.protobuf.Int32Value type. + + + + Holder for reflection information generated from google/protobuf/wrappers.proto + + + File descriptor for google/protobuf/wrappers.proto + + + + Field number for the single "value" field in all wrapper types. + + + + + Wrapper message for `double`. + + The JSON representation for `DoubleValue` is JSON number. + + + + Field number for the "value" field. + + + + The double value. + + + + + Wrapper message for `float`. + + The JSON representation for `FloatValue` is JSON number. + + + + Field number for the "value" field. + + + + The float value. + + + + + Wrapper message for `int64`. + + The JSON representation for `Int64Value` is JSON string. + + + + Field number for the "value" field. + + + + The int64 value. + + + + + Wrapper message for `uint64`. + + The JSON representation for `UInt64Value` is JSON string. + + + + Field number for the "value" field. + + + + The uint64 value. + + + + + Wrapper message for `int32`. + + The JSON representation for `Int32Value` is JSON number. + + + + Field number for the "value" field. + + + + The int32 value. + + + + + Wrapper message for `uint32`. + + The JSON representation for `UInt32Value` is JSON number. + + + + Field number for the "value" field. + + + + The uint32 value. + + + + + Wrapper message for `bool`. + + The JSON representation for `BoolValue` is JSON `true` and `false`. + + + + Field number for the "value" field. + + + + The bool value. + + + + + Wrapper message for `string`. + + The JSON representation for `StringValue` is JSON string. + + + + Field number for the "value" field. + + + + The string value. + + + + + Wrapper message for `bytes`. + + The JSON representation for `BytesValue` is JSON string. + + + + Field number for the "value" field. + + + + The bytes value. + + + + + This class is used internally by the Protocol Buffer Library and generated + message implementations. It is public only for the sake of those generated + messages. Others should not use this class directly. + + This class contains constants and helper functions useful for dealing with + the Protocol Buffer wire format. + + + + + + Wire types within protobuf encoding. + + + + + Variable-length integer. + + + + + A fixed-length 64-bit value. + + + + + A length-delimited value, i.e. a length followed by that many bytes of data. + + + + + A "start group" value + + + + + An "end group" value + + + + + A fixed-length 32-bit value. + + + + + Given a tag value, determines the wire type (lower 3 bits). + + + + + Given a tag value, determines the field number (the upper 29 bits). + + + + + Makes a tag value given a field number and wire type. + + + + + Abstraction for writing to a steam / IBufferWriter + + + + + Initialize an instance with a coded output stream. + This approach is faster than using a constructor because the instance to initialize is passed by reference + and we can write directly into it without copying. + + + + + Initialize an instance with a buffer writer. + This approach is faster than using a constructor because the instance to initialize is passed by reference + and we can write directly into it without copying. + + + + + Initialize an instance with a buffer represented by a single span (i.e. buffer cannot be refreshed) + This approach is faster than using a constructor because the instance to initialize is passed by reference + and we can write directly into it without copying. + + + + + Verifies that SpaceLeft returns zero. + + + + + If writing to a flat array, returns the space left in the array. Otherwise, + throws an InvalidOperationException. + + + + + An opaque struct that represents the current serialization state and is passed along + as the serialization proceeds. + All the public methods are intended to be invoked only by the generated code, + users should never invoke them directly. + + + + + Creates a WriteContext instance from CodedOutputStream. + WARNING: internally this copies the CodedOutputStream's state, so after done with the WriteContext, + the CodedOutputStream's state needs to be updated. + + + + + Writes a double field value, without a tag. + + The value to write + + + + Writes a float field value, without a tag. + + The value to write + + + + Writes a uint64 field value, without a tag. + + The value to write + + + + Writes an int64 field value, without a tag. + + The value to write + + + + Writes an int32 field value, without a tag. + + The value to write + + + + Writes a fixed64 field value, without a tag. + + The value to write + + + + Writes a fixed32 field value, without a tag. + + The value to write + + + + Writes a bool field value, without a tag. + + The value to write + + + + Writes a string field value, without a tag. + The data is length-prefixed. + + The value to write + + + + Writes a message, without a tag. + The data is length-prefixed. + + The value to write + + + + Writes a group, without a tag, to the stream. + + The value to write + + + + Write a byte string, without a tag, to the stream. + The data is length-prefixed. + + The value to write + + + + Writes a uint32 value, without a tag. + + The value to write + + + + Writes an enum value, without a tag. + + The value to write + + + + Writes an sfixed32 value, without a tag. + + The value to write. + + + + Writes an sfixed64 value, without a tag. + + The value to write + + + + Writes an sint32 value, without a tag. + + The value to write + + + + Writes an sint64 value, without a tag. + + The value to write + + + + Writes a length (in bytes) for length-delimited data. + + + This method simply writes a rawint, but exists for clarity in calling code. + + Length value, in bytes. + + + + Encodes and writes a tag. + + The number of the field to write the tag for + The wire format type of the tag to write + + + + Writes an already-encoded tag. + + The encoded tag + + + + Writes the given single-byte tag. + + The encoded tag + + + + Writes the given two-byte tag. + + The first byte of the encoded tag + The second byte of the encoded tag + + + + Writes the given three-byte tag. + + The first byte of the encoded tag + The second byte of the encoded tag + The third byte of the encoded tag + + + + Writes the given four-byte tag. + + The first byte of the encoded tag + The second byte of the encoded tag + The third byte of the encoded tag + The fourth byte of the encoded tag + + + + Writes the given five-byte tag. + + The first byte of the encoded tag + The second byte of the encoded tag + The third byte of the encoded tag + The fourth byte of the encoded tag + The fifth byte of the encoded tag + + + + Primitives for encoding protobuf wire format. + + + + + Writes a double field value, without a tag, to the stream. + + + + + Writes a float field value, without a tag, to the stream. + + + + + Writes a uint64 field value, without a tag, to the stream. + + + + + Writes an int64 field value, without a tag, to the stream. + + + + + Writes an int32 field value, without a tag, to the stream. + + + + + Writes a fixed64 field value, without a tag, to the stream. + + + + + Writes a fixed32 field value, without a tag, to the stream. + + + + + Writes a bool field value, without a tag, to the stream. + + + + + Writes a string field value, without a tag, to the stream. + The data is length-prefixed. + + + + + Write a byte string, without a tag, to the stream. + The data is length-prefixed. + + + + + Writes a uint32 value, without a tag, to the stream. + + + + + Writes an enum value, without a tag, to the stream. + + + + + Writes an sfixed32 value, without a tag, to the stream. + + + + + Writes an sfixed64 value, without a tag, to the stream. + + + + + Writes an sint32 value, without a tag, to the stream. + + + + + Writes an sint64 value, without a tag, to the stream. + + + + + Writes a length (in bytes) for length-delimited data. + + + This method simply writes a rawint, but exists for clarity in calling code. + + + + + Writes a 32 bit value as a varint. The fast route is taken when + there's enough buffer space left to whizz through without checking + for each byte; otherwise, we resort to calling WriteRawByte each time. + + + + + Writes out an array of bytes. + + + + + Writes out part of an array of bytes. + + + + + Writes out part of an array of bytes. + + + + + Encodes and writes a tag. + + + + + Writes an already-encoded tag. + + + + + Writes the given single-byte tag directly to the stream. + + + + + Writes the given two-byte tag directly to the stream. + + + + + Writes the given three-byte tag directly to the stream. + + + + + Writes the given four-byte tag directly to the stream. + + + + + Writes the given five-byte tag directly to the stream. + + + + + Encode a 32-bit value with ZigZag encoding. + + + ZigZag encodes signed integers into values that can be efficiently + encoded with varint. (Otherwise, negative values must be + sign-extended to 64 bits to be varint encoded, thus always taking + 10 bytes on the wire.) + + + + + Encode a 64-bit value with ZigZag encoding. + + + ZigZag encodes signed integers into values that can be efficiently + encoded with varint. (Otherwise, negative values must be + sign-extended to 64 bits to be varint encoded, thus always taking + 10 bytes on the wire.) + + + + + Writing messages / groups. + + + + + Writes a message, without a tag. + The data is length-prefixed. + + + + + Writes a group, without a tag. + + + + + Writes a message, without a tag. + Message will be written without a length prefix. + + + + diff --git a/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.xml.meta b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.xml.meta new file mode 100644 index 00000000..5b5e2a56 --- /dev/null +++ b/JNFrame/Assets/Packages/Google.Protobuf.3.15.8/lib/netstandard2.0/Google.Protobuf.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 64f78998eaa18134589fb236352aab0d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2.meta b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2.meta new file mode 100644 index 00000000..cfdb59e9 --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1435edfef9c5969418a51104922af85c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/.signature.p7s b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..a7fbb7345d4637e6451f79984453106e7600fc77 GIT binary patch literal 22354 zcmeHvc|4SD-@X}R?E9J}6DhlE#x8{{*@Y~*E5_J&W9&*ZmP!gqBtnrCvL+!}BS~a0 zDXBzu*(%;^Yb|erB%2l#Fi8Wg^-Z|Hh(sRq?*A@Ol`4Vj_z&>NGd9nI8sJj zP6`l5iX#D}xTLt0ICx1+6Yb@oU}lXomcuw3+WOd{EldqGwOmx3v4>gps>D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{rMF(uIAxJ+P2|;6$u}e7 zqaI`_$yp0$L_D}9r*>%(S1G0(bs`K>==ABzL19tK#XSg_38>76I*)TLh90#{uIwRh zb{^%6N|4j1c+TjXe(di}b76WLkCTU){7?0ptWK~6PnNh3C z^Sjgg6B~6Cl(m3vVE2%D;0aUN#4y87pR9d z{9Dp45(R230DzK|`IWQ_1w%+0@C_RngdlqeeE6Y62NeyyjXTcG7H5Y=yV?@PDH_TR zXTV>i;9se4fb^yhfFRfCH1QP`w1=a(o45U{7eT^DQo_;A#@0{V$;;jC-%yb0Eag5Q zuPSeVcWW6KM1OhOmvC0Yhn%u$tbS%k;tkg0|EPlecm9$!1v#a;|8ZrxYkhFNmwtzQ zawooC&SJ&9O}2-eurJJyB=GYVN(GC@9xsj3$7N+#DDI|%r*=)bOBun;-Jsh6|0B;Q!X^Yf&uB*0O=M|-U z(v){ylvjQfW^OHF;A*2oEq4h13YFBMJer=9z>?LpBVI+6Z7hwz3`)JsT;HP&Q9-5x zFTyvr&5D9N2P(+ZKUI(=zw5oCAoGF1vmK0BIDbPy)~Yn(hsBXHE-qvI$atfv7OWL; z+6>A&&sByVcZgqbgR)SWv3w%w{NjkB&pSx&t?x6#F0ZsIAb-EtRt02rcztrfGxXVl z)ROKKDcMr6s-d0dy?huaoI+mp@2kk$5|D{{_m+VC|3V=D6_?o(kcmI!vLzsI3CQ4& zI{hEaer*ZJTLSWyfV?FjZwbijS+gwxc}qZEv4lhaHdD4GAcF>?)qLERfV?FjulzLY z?+D1>%Nsum$Zq$w%rxe!s!jRlnrPoS?`?WWCUTpEy!zv%pfsfYq|yJLfE>11`qcY^ z0@?d}bIj>x5r^lM6SE%Z+}ra^`bp<4iFdQZrVJAS+tRxf^IoPkWepE}FgIcdEaZ5V zUQyqxeay%>$fII$X^E5NHQSy|}PL!J- + + + System.Runtime.CompilerServices.Unsafe + 4.5.2 + System.Runtime.CompilerServices.Unsafe + Microsoft + microsoft,dotnetframework + false + https://github.com/dotnet/corefx/blob/master/LICENSE.TXT + https://dot.net/ + http://go.microsoft.com/fwlink/?LinkID=288859 + Provides the System.Runtime.CompilerServices.Unsafe class, which provides generic, low-level functionality for manipulating pointers. + +Commonly Used Types: +System.Runtime.CompilerServices.Unsafe + +02b11eeee1fbc5f3ef43a1452fe07efd25fa1715 +When using NuGet 3.x this package requires at least version 3.4. + https://go.microsoft.com/fwlink/?LinkID=799421 + © Microsoft Corporation. All rights reserved. + true + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.nuspec.meta b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.nuspec.meta new file mode 100644 index 00000000..5e2fc268 --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.nuspec.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0ad80367ad9e0fd418de576d0bc7197c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT new file mode 100644 index 00000000..db542ca2 --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT @@ -0,0 +1,309 @@ +.NET Core uses third-party libraries or other resources that may be +distributed under licenses different than the .NET Core software. + +In the event that we accidentally failed to list a required notice, please +bring it to our attention. Post an issue or email us: + + dotnet@microsoft.com + +The attached notices are provided for information only. + +License notice for Slicing-by-8 +------------------------------- + +http://sourceforge.net/projects/slicing-by-8/ + +Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + + +This software program is licensed subject to the BSD License, available at +http://www.opensource.org/licenses/bsd-license.html. + + +License notice for Unicode data +------------------------------- + +http://www.unicode.org/copyright.html#License + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +License notice for Zlib +----------------------- + +https://github.com/madler/zlib +http://zlib.net/zlib_license.html + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.11, January 15th, 2017 + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +*/ + +License notice for Mono +------------------------------- + +http://www.mono-project.com/docs/about-mono/ + +Copyright (c) .NET Foundation Contributors + +MIT License + +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. + +License notice for International Organization for Standardization +----------------------------------------------------------------- + +Portions (C) International Organization for Standardization 1986: + Permission to copy in any form is granted for use with + conforming SGML systems and applications as defined in + ISO 8879, provided this notice is included in all copies. + +License notice for Intel +------------------------ + +"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License notice for Xamarin and Novell +------------------------------------- + +Copyright (c) 2015 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. + +Copyright (c) 2011 Novell, Inc (http://www.novell.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. + +Third party notice for W3C +-------------------------- + +"W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE +Status: This license takes effect 13 May, 2015. +This work is being provided by the copyright holders under the following license. +License +By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. +Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: +The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. +Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. +Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." +Disclaimers +THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders." + +License notice for Bit Twiddling Hacks +-------------------------------------- + +Bit Twiddling Hacks + +By Sean Eron Anderson +seander@cs.stanford.edu + +Individually, the code snippets here are in the public domain (unless otherwise +noted) — feel free to use them however you please. The aggregate collection and +descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are +distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and +without even the implied warranty of merchantability or fitness for a particular +purpose. + +License notice for Brotli +-------------------------------------- + +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +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. + +compress_fragment.c: +Copyright (c) 2011, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +decode_fuzzer.c: +Copyright (c) 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT.meta b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT.meta new file mode 100644 index 00000000..1758acfd --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 495cf1a0b48abaf439035bd6e3ba0226 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib.meta b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib.meta new file mode 100644 index 00000000..6cda140f --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 736ce6b581f4a124b9ff225ee55ca2b8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0.meta b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0.meta new file mode 100644 index 00000000..2f6e5ce6 --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4238dd05a5a67de4ea235923baaa8b9a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000000000000000000000000000000000000..3156239266db9cceede249731f00c3822e479a1f GIT binary patch literal 23600 zcmeHv2V4|OllW{P=ZwT92MM!eL~@p>BoUCf1PP0~OEi!a5k*juAO=uSR0P3=hrCdY9sDx+=IfUXLNeJ|hiXzhp0VDz?CW;Ui zMX+#kAw-gcNNOA$tg`g1oh>2A9)p8qs!P0POY4EKQfwGD2;v76<{9c&A_xiKH32UI z2q3`D)EmUm`XeEf3|>HQDuzJ2Og2IgH~RZMq@#chc}{?Q?U0BGco~rh{gHqm*a*b^ zAc%dI_8$oeb5%!EF$3IYUV1eeDV_#!JTCy?8`@S-@A(e_l&(ghQUVboQa2NNCsV&W+Uom_4<^PJ*Ysj2(R{q8_?$lS*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5>8CTae%!e3#!pO|Jfcz-AljPy3Thm zrDB%AB6A)Ga4(AE4?YF>M}N`Rd-t?mxAG7_-tQe$?v0FGo;xtQR-dq^#yqG{JXtdi zPMMmQ0al%u@)AxNgj4$AlnZ!5S&F(_sitC$2PJK3j-gx7AUlViaW=(gcX3^Ng_$q7 zuUYWlU?}`raKKq6yv_Y(W8#5FW<^uiFMHo+?yt$tdAQLa&iu9imFF(DY4a5lY%GvF zIoWz5Z<1Dd?z6u1(R!s?3Wk-9!`n+V=yB4BrGxd7+Wy418)DDsT*W@z8T|gj`Ziw1 z3zJ`bUObkFKYhNL>KB;&Cf&G9>|?%(w(L0nmAo4UHOD#zp<~Q>buDpQEVpSdb|&1~ zvFFZ;Vg;|_Re_5}3t#OKpV*jl{N;hPI?2?n(F<3Itc}~ec+`u*NL!kBApK(J_OV-- zVh=u{vw%Gji#@PaP4!O~Kaxp%m^is6ysP(Sb|NL;Vt_SC OyIXQg_#$)@0sTLk9O=pc literal 0 HcmV?d00001 diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll.meta b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll.meta new file mode 100644 index 00000000..9416513d --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 6dc30032884285a4c9d2e3474a13121d +labels: +- NuGetForUnity +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml new file mode 100644 index 00000000..6a7cfcff --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml @@ -0,0 +1,200 @@ + + + System.Runtime.CompilerServices.Unsafe + + + + Contains generic, low-level functionality for manipulating pointers. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds a byte offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of byte offset to pointer. + + + Determines whether the specified references point to the same location. + The first reference to compare. + The second reference to compare. + The type of reference. + true if left and right point to the same location; otherwise, false. + + + Casts the given object to the specified type. + The object to cast. + The type which the object will be cast to. + The original object, casted to the given type. + + + Reinterprets the given reference as a reference to a value of type TTo. + The reference to reinterpret. + The type of reference to reinterpret.. + The desired type of the reference. + A reference to a value of type TTo. + + + Returns a pointer to the given by-ref parameter. + The object whose pointer is obtained. + The type of object. + A pointer to the given value. + + + Reinterprets the given location as a reference to a value of type T. + The location of the value to reference. + The type of the interpreted location. + A reference to a value of type T. + + + Determines the byte offset from origin to target from the given references. + The reference to origin. + The reference to target. + The type of reference. + Byte offset from origin to target i.e. target - origin. + + + Copies a value of type T to the given location. + The location to copy to. + A reference to the value to copy. + The type of value to copy. + + + Copies a value of type T to the given location. + The location to copy to. + A pointer to the value to copy. + The type of value to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Reads a value of type T from the given location. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Returns the size of an object of the given type parameter. + The type of object whose size is retrieved. + The size of an object of type T. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts a byte offset from the given reference. + The reference to subtract the offset from. + + The type of reference. + A new reference that reflects the subraction of byte offset from pointer. + + + Writes a value of type T to the given location. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + \ No newline at end of file diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml.meta b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml.meta new file mode 100644 index 00000000..d28b51b8 --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2861a8d84ffb5fd43a88e4c52b8ce4f0 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt.meta b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt.meta new file mode 100644 index 00000000..ccccb5fe --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6ebb778c1b6cae64aa3983e2f5abdbe2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt new file mode 100644 index 00000000..69308609 --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt @@ -0,0 +1 @@ +02b11eeee1fbc5f3ef43a1452fe07efd25fa1715 diff --git a/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt.meta b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt.meta new file mode 100644 index 00000000..09f19c90 --- /dev/null +++ b/JNFrame/Assets/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 48d11621921abb349a5ac31a6e0b8a95 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins.meta b/JNFrame/Assets/Plugins.meta new file mode 100644 index 00000000..080b7533 --- /dev/null +++ b/JNFrame/Assets/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0c7f1863e7cce884fa6118afce008274 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP.meta b/JNFrame/Assets/Plugins/BestHTTP.meta new file mode 100644 index 00000000..a466926f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 74209c3e8feb2fa4c93547e19081d34b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP.meta new file mode 100644 index 00000000..958753b8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dc57aabb2dd648642bdfb021906367b1 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication.meta new file mode 100644 index 00000000..37d02f00 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e9dc42aeefc20544bb572bce27e3b7b1 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Credentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Credentials.cs new file mode 100644 index 00000000..4d87cdee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Credentials.cs @@ -0,0 +1,63 @@ +namespace BestHTTP.Authentication +{ + /// + /// Authentication types that supported by BestHTTP. + /// The authentication is defined by the server, so the Basic and Digest are not interchangeable. If you don't know what to use, the preferred way is to choose Unknow. + /// + public enum AuthenticationTypes + { + /// + /// If the authentication type is not known this will do a challenge turn to receive what methode should be choosen. + /// + Unknown, + + /// + /// The most basic authentication type. It's easy to do, and easy to crack. ;) + /// + Basic, + + /// + /// + /// + Digest + } + + /// + /// Hold all information that required to authenticate to a remote server. + /// + public sealed class Credentials + { + /// + /// The type of the Authentication. If you don't know what to use, the preferred way is to choose Unknow. + /// + public AuthenticationTypes Type { get; private set; } + + /// + /// The username to authenticate on the remote server. + /// + public string UserName { get; private set; } + + /// + /// The password to use in the authentication process. The password will be stored only in this class. + /// + public string Password { get; private set; } + + /// + /// Set up the authentication credentials with the username and password. The Type will be set to Unknown. + /// + public Credentials(string userName, string password) + :this(AuthenticationTypes.Unknown, userName, password) + { + } + + /// + /// Set up the authentication credentials with the given authentication type, username and password. + /// + public Credentials(AuthenticationTypes type, string userName, string password) + { + this.Type = type; + this.UserName = userName; + this.Password = password; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Credentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Credentials.cs.meta new file mode 100644 index 00000000..06dea042 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Credentials.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a6a6217993b733a4e8555355d5d62776 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Digest.cs new file mode 100644 index 00000000..6537e848 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Digest.cs @@ -0,0 +1,280 @@ +using System; +using System.Collections.Generic; + +namespace BestHTTP.Authentication +{ + using BestHTTP.Extensions; + using System.Text; + + /// + /// Internal class that stores all information that received from a server in a WWW-Authenticate and need to construct a valid Authorization header. Based on rfc 2617 (http://tools.ietf.org/html/rfc2617). + /// Used only internally by the plugin. + /// + public sealed class Digest + { + #region Public Properties + + /// + /// The Uri that this Digest is bound to. + /// + public Uri Uri { get; private set; } + + public AuthenticationTypes Type { get; private set; } + + /// + /// A string to be displayed to users so they know which username and password to use. + /// This string should contain at least the name of the host performing the authentication and might additionally indicate the collection of users who might have access. + /// + public string Realm { get; private set; } + + /// + /// A flag, indicating that the previous request from the client was rejected because the nonce value was stale. + /// If stale is TRUE (case-insensitive), the client may wish to simply retry the request with a new encrypted response, without the user for a new username and password. + /// The server should only set stale to TRUE if it receives a request for which the nonce is invalid but with a valid digest for that nonce + /// (indicating that the client knows the correct username/password). + /// If stale is FALSE, or anything other than TRUE, or the stale directive is not present, the username and/or password are invalid, and new values must be obtained. + /// + public bool Stale { get; private set; } + + #endregion + + #region Private Properties + + /// + /// A server-specified data string which should be uniquely generated each time a 401 response is made. + /// Specifically, since the string is passed in the header lines as a quoted string, the double-quote character is not allowed. + /// + private string Nonce { get; set; } + + /// + /// A string of data, specified by the server, which should be returned by the client unchanged in the Authorization header of subsequent requests with URIs in the same protection space. + /// It is recommended that this string be base64 or data. + /// + private string Opaque { get; set; } + + /// + /// A string indicating a pair of algorithms used to produce the digest and a checksum. If this is not present it is assumed to be "MD5". + /// If the algorithm is not understood, the challenge should be ignored (and a different one used, if there is more than one). + /// + private string Algorithm { get; set; } + + /// + /// List of URIs, as specified in RFC XURI, that define the protection space. + /// If a URI is an abs_path, it is relative to the canonical root URL (see section 1.2 above) of the server being accessed. + /// An absoluteURI in this list may refer to a different server than the one being accessed. + /// The client can use this list to determine the set of URIs for which the same authentication information may be sent: + /// any URI that has a URI in this list as a prefix (after both have been made absolute) may be assumed to be in the same protection space. + /// If this directive is omitted or its value is empty, the client should assume that the protection space consists of all URIs on the responding server. + /// + public List ProtectedUris { get; private set; } + + /// + /// If present, it is a quoted string of one or more tokens indicating the "quality of protection" values supported by the server. + /// The value "auth" indicates authentication. The value "auth-int" indicates authentication with integrity protection. + /// + private string QualityOfProtections { get; set; } + + /// + /// his MUST be specified if a qop directive is sent (see above), and MUST NOT be specified if the server did not send a qop directive in the WWW-Authenticate header field. + /// The nc-value is the hexadecimal count of the number of requests (including the current request) that the client has sent with the nonce value in this request. + /// + private int NonceCount { get; set; } + + /// + /// Used to store the last HA1 that can be used in the next header generation when Algorithm is set to "md5-sess". + /// + private string HA1Sess { get; set; } + + #endregion + + internal Digest(Uri uri) + { + this.Uri = uri; + this.Algorithm = "md5"; + } + + /// + /// Parses a WWW-Authenticate header's value to retrive all information. + /// + public void ParseChallange(string header) + { + // Reset some values to its defaults. + this.Type = AuthenticationTypes.Unknown; + this.Stale = false; + this.Opaque = null; + this.HA1Sess = null; + this.NonceCount = 0; + this.QualityOfProtections = null; + + if (this.ProtectedUris != null) + this.ProtectedUris.Clear(); + + // Parse the header + WWWAuthenticateHeaderParser qpl = new WWWAuthenticateHeaderParser(header); + + // Then process + foreach (var qp in qpl.Values) + switch (qp.Key) + { + case "basic": this.Type = AuthenticationTypes.Basic; break; + case "digest": this.Type = AuthenticationTypes.Digest; break; + case "realm": this.Realm = qp.Value; break; + case "domain": + { + if (string.IsNullOrEmpty(qp.Value) || qp.Value.Length == 0) + break; + + if (this.ProtectedUris == null) + this.ProtectedUris = new List(); + + int idx = 0; + string val = qp.Value.Read(ref idx, ' '); + do + { + this.ProtectedUris.Add(val); + val = qp.Value.Read(ref idx, ' '); + } while (idx < qp.Value.Length); + + break; + } + case "nonce": this.Nonce = qp.Value; break; + case "qop": this.QualityOfProtections = qp.Value; break; + case "stale": this.Stale = bool.Parse(qp.Value); break; + case "opaque": this.Opaque = qp.Value; break; + case "algorithm": this.Algorithm = qp.Value; break; + } + } + + /// + /// Generates a string that can be set to an Authorization header. + /// + public string GenerateResponseHeader(HTTPRequest request, Credentials credentials, bool isProxy = false) + { + try + { + switch (Type) + { + case AuthenticationTypes.Basic: + return string.Concat("Basic ", Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format("{0}:{1}", credentials.UserName, credentials.Password)))); + + case AuthenticationTypes.Digest: + { + NonceCount++; + + string HA1 = string.Empty; + + // The cnonce-value is an opaque quoted string value provided by the client and used by both client and server to avoid chosen plaintext attacks, to provide mutual + // authentication, and to provide some message integrity protection. + string cnonce = new System.Random(request.GetHashCode()).Next(int.MinValue, int.MaxValue).ToString("X8"); + + string ncvalue = NonceCount.ToString("X8"); + switch (Algorithm.TrimAndLower()) + { + case "md5": + HA1 = string.Format("{0}:{1}:{2}", credentials.UserName, Realm, credentials.Password).CalculateMD5Hash(); + break; + + case "md5-sess": + if (string.IsNullOrEmpty(this.HA1Sess)) + this.HA1Sess = string.Format("{0}:{1}:{2}:{3}:{4}", credentials.UserName, Realm, credentials.Password, Nonce, ncvalue).CalculateMD5Hash(); + HA1 = this.HA1Sess; + break; + + default: //throw new NotSupportedException("Not supported hash algorithm found in Web Authentication: " + Algorithm); + return string.Empty; + } + + // A string of 32 hex digits, which proves that the user knows a password. Set according to the qop value. + string response = string.Empty; + + // The server sent QoP-value can be a list of supported methodes(if sent at all - in this case it's null). + // The rfc is not specify that this is a space or comma separeted list. So it can be "auth, auth-int" or "auth auth-int". + // We will first check the longer value("auth-int") then the short one ("auth"). If one matches we will reset the qop to the exact value. + string qop = this.QualityOfProtections != null ? this.QualityOfProtections.TrimAndLower() : null; + + // When we authenticate with a proxy and we want to tunnel the request, we have to use the CONNECT method instead of the + // request's, as the proxy will not know about the request itself. + string method = isProxy ? "CONNECT" : request.MethodType.ToString().ToUpper(); + + // When we authenticate with a proxy and we want to tunnel the request, the uri must match what we are sending in the CONNECT request's + // Host header. + string uri = isProxy ? request.CurrentUri.Host + ":" + request.CurrentUri.Port : request.CurrentUri.GetRequestPathAndQueryURL(); + + if (qop == null) + { + string HA2 = string.Concat(request.MethodType.ToString().ToUpper(), ":", request.CurrentUri.GetRequestPathAndQueryURL()).CalculateMD5Hash(); + response = string.Format("{0}:{1}:{2}", HA1, Nonce, HA2).CalculateMD5Hash(); + } + else if (qop.Contains("auth-int")) + { + qop = "auth-int"; + + byte[] entityBody = request.GetEntityBody(); + + if (entityBody == null) + entityBody = VariableSizedBufferPool.NoData; //string.Empty.GetASCIIBytes(); + + string HA2 = string.Format("{0}:{1}:{2}", method, uri, entityBody.CalculateMD5Hash()).CalculateMD5Hash(); + + response = string.Format("{0}:{1}:{2}:{3}:{4}:{5}", HA1, Nonce, ncvalue, cnonce, qop, HA2).CalculateMD5Hash(); + } + else if (qop.Contains("auth")) + { + qop = "auth"; + string HA2 = string.Concat(method, ":", uri).CalculateMD5Hash(); + + response = string.Format("{0}:{1}:{2}:{3}:{4}:{5}", HA1, Nonce, ncvalue, cnonce, qop, HA2).CalculateMD5Hash(); + } + else //throw new NotSupportedException("Unrecognized Quality of Protection value found: " + this.QualityOfProtections); + return string.Empty; + + string result = string.Format("Digest username=\"{0}\", realm=\"{1}\", nonce=\"{2}\", uri=\"{3}\", cnonce=\"{4}\", response=\"{5}\"", + credentials.UserName, Realm, Nonce, uri, cnonce, response); + + if (qop != null) + result += String.Concat(", qop=\"", qop, "\", nc=", ncvalue); + + if (!string.IsNullOrEmpty(Opaque)) + result = String.Concat(result, ", opaque=\"", Opaque, "\""); + + return result; + }// end of case "digest": + + default: + break; + } + } + catch + { + } + + return string.Empty; + } + + public bool IsUriProtected(Uri uri) + { + // http://tools.ietf.org/html/rfc2617#section-3.2.1 + // An absoluteURI in this list may refer to + // a different server than the one being accessed. The client can use + // this list to determine the set of URIs for which the same + // authentication information may be sent: any URI that has a URI in + // this list as a prefix (after both have been made absolute) may be + // assumed to be in the same protection space. If this directive is + // omitted or its value is empty, the client should assume that the + // protection space consists of all URIs on the responding server. + + if (string.CompareOrdinal(uri.Host, this.Uri.Host) != 0) + return false; + + string uriStr = uri.ToString(); + + if (ProtectedUris != null && ProtectedUris.Count > 0) + for (int i = 0; i < ProtectedUris.Count; ++i) + if (uriStr.Contains(ProtectedUris[i])) + return true; + + + return true; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Digest.cs.meta new file mode 100644 index 00000000..869c5964 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/Digest.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 424d976119ee3fc438fe98095013859f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/DigestStore.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/DigestStore.cs new file mode 100644 index 00000000..78e7621e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/DigestStore.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; + +namespace BestHTTP.Authentication +{ + /// + /// Stores and manages already received digest infos. + /// + public static class DigestStore + { + private static Dictionary Digests = new Dictionary(); + + private static object Locker = new object(); + + /// + /// Array of algorithms that the plugin supports. It's in the order of priority(first has the highest priority). + /// + private static string[] SupportedAlgorithms = new string[] { "digest", "basic" }; + + public static Digest Get(Uri uri) + { + lock (Locker) + { + Digest digest = null; + if (Digests.TryGetValue(uri.Host, out digest)) + if (!digest.IsUriProtected(uri)) + return null; + return digest; + } + } + + /// + /// It will retrive or create a new Digest for the given Uri. + /// + /// + /// + public static Digest GetOrCreate(Uri uri) + { + lock (Locker) + { + Digest digest = null; + if (!Digests.TryGetValue(uri.Host, out digest)) + Digests.Add(uri.Host, digest = new Digest(uri)); + return digest; + } + } + + public static void Remove(Uri uri) + { + lock(Locker) + Digests.Remove(uri.Host); + } + + public static string FindBest(List authHeaders) + { + if (authHeaders == null || authHeaders.Count == 0) + return string.Empty; + + List headers = new List(authHeaders.Count); + for (int i = 0; i < authHeaders.Count; ++i) + headers.Add(authHeaders[i].ToLower()); + + for (int i = 0; i < SupportedAlgorithms.Length; ++i) + { + int idx = headers.FindIndex((header) => header.StartsWith(SupportedAlgorithms[i])); + if (idx != -1) + return authHeaders[idx]; + } + + return string.Empty; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/DigestStore.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/DigestStore.cs.meta new file mode 100644 index 00000000..280472e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Authentication/DigestStore.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 0f808b023553ee2419249f92eb8ac31f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching.meta new file mode 100644 index 00000000..319ec4f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 26e64cd0d1567634fb40b1386ba0c48d +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileInfo.cs new file mode 100644 index 00000000..6294f8d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileInfo.cs @@ -0,0 +1,394 @@ +#if !BESTHTTP_DISABLE_CACHING + +using System; +using System.Collections.Generic; +using System.IO; + +namespace BestHTTP.Caching +{ + using BestHTTP.Extensions; + using BestHTTP.PlatformSupport.FileSystem; + + /// + /// Holds all metadata that need for efficient caching, so we don't need to touch the disk to load headers. + /// + public class HTTPCacheFileInfo : IComparable + { + #region Properties + + /// + /// The uri that this HTTPCacheFileInfo belongs to. + /// + internal Uri Uri { get; set; } + + /// + /// The last access time to this cache entity. The date is in UTC. + /// + internal DateTime LastAccess { get; set; } + + /// + /// The length of the cache entity's body. + /// + public int BodyLength { get; set; } + + /// + /// ETag of the entity. + /// + private string ETag { get; set; } + + /// + /// LastModified date of the entity. + /// + private string LastModified { get; set; } + + /// + /// When the cache will expire. + /// + private DateTime Expires { get; set; } + + /// + /// The age that came with the response + /// + private long Age { get; set; } + + /// + /// Maximum how long the entry should served from the cache without revalidation. + /// + private long MaxAge { get; set; } + + /// + /// The Date that came with the response. + /// + private DateTime Date { get; set; } + + /// + /// Indicates whether the entity must be revalidated with the server or can be serverd directly from the cache without touching the server. + /// + private bool MustRevalidate { get; set; } + + /// + /// The date and time when the HTTPResponse received. + /// + private DateTime Received { get; set; } + + /// + /// Cached path. + /// + private string ConstructedPath { get; set; } + + /// + /// This is the index of the entity. Filenames are generated from this value. + /// + internal UInt64 MappedNameIDX { get; set; } + + #endregion + + #region Constructors + + internal HTTPCacheFileInfo(Uri uri) + :this(uri, DateTime.UtcNow, -1) + { + } + + internal HTTPCacheFileInfo(Uri uri, DateTime lastAcces, int bodyLength) + { + this.Uri = uri; + this.LastAccess = lastAcces; + this.BodyLength = bodyLength; + this.MaxAge = -1; + + this.MappedNameIDX = HTTPCacheService.GetNameIdx(); + } + + internal HTTPCacheFileInfo(Uri uri, System.IO.BinaryReader reader, int version) + { + this.Uri = uri; + this.LastAccess = DateTime.FromBinary(reader.ReadInt64()); + this.BodyLength = reader.ReadInt32(); + + switch(version) + { + case 2: + this.MappedNameIDX = reader.ReadUInt64(); + goto case 1; + + case 1: + { + this.ETag = reader.ReadString(); + this.LastModified = reader.ReadString(); + this.Expires = DateTime.FromBinary(reader.ReadInt64()); + this.Age = reader.ReadInt64(); + this.MaxAge = reader.ReadInt64(); + this.Date = DateTime.FromBinary(reader.ReadInt64()); + this.MustRevalidate = reader.ReadBoolean(); + this.Received = DateTime.FromBinary(reader.ReadInt64()); + break; + } + } + } + + #endregion + + #region Helper Functions + + internal void SaveTo(System.IO.BinaryWriter writer) + { + writer.Write(LastAccess.ToBinary()); + writer.Write(BodyLength); + writer.Write(MappedNameIDX); + writer.Write(ETag); + writer.Write(LastModified); + writer.Write(Expires.ToBinary()); + writer.Write(Age); + writer.Write(MaxAge); + writer.Write(Date.ToBinary()); + writer.Write(MustRevalidate); + writer.Write(Received.ToBinary()); + } + + public string GetPath() + { + if (ConstructedPath != null) + return ConstructedPath; + + return ConstructedPath = System.IO.Path.Combine(HTTPCacheService.CacheFolder, MappedNameIDX.ToString("X")); + } + + public bool IsExists() + { + if (!HTTPCacheService.IsSupported) + return false; + + return HTTPManager.IOService.FileExists(GetPath()); + } + + internal void Delete() + { + if (!HTTPCacheService.IsSupported) + return; + + string path = GetPath(); + try + { + HTTPManager.IOService.FileDelete(path); + } + catch + { } + finally + { + Reset(); + } + } + + private void Reset() + { + // MappedNameIDX will remain the same. When we re-save an entity, it will not reset the MappedNameIDX. + this.BodyLength = -1; + this.ETag = string.Empty; + this.Expires = DateTime.FromBinary(0); + this.LastModified = string.Empty; + this.Age = 0; + this.MaxAge = -1; + this.Date = DateTime.FromBinary(0); + this.MustRevalidate = false; + this.Received = DateTime.FromBinary(0); + } + + #endregion + + #region Caching + + private void SetUpCachingValues(HTTPResponse response) + { + response.CacheFileInfo = this; + + this.ETag = response.GetFirstHeaderValue("ETag").ToStrOrEmpty(); + this.Expires = response.GetFirstHeaderValue("Expires").ToDateTime(DateTime.FromBinary(0)); + this.LastModified = response.GetFirstHeaderValue("Last-Modified").ToStrOrEmpty(); + + this.Age = response.GetFirstHeaderValue("Age").ToInt64(0); + + this.Date = response.GetFirstHeaderValue("Date").ToDateTime(DateTime.FromBinary(0)); + + string cacheControl = response.GetFirstHeaderValue("cache-control"); + if (!string.IsNullOrEmpty(cacheControl)) + { + string[] kvp = cacheControl.FindOption("max-age"); + if (kvp != null) + { + // Some cache proxies will return float values + double maxAge; + if (double.TryParse(kvp[1], out maxAge)) + this.MaxAge = (int)maxAge; + } + + this.MustRevalidate = cacheControl.ToLower().Contains("must-revalidate"); + } + + this.Received = DateTime.UtcNow; + } + + internal bool WillExpireInTheFuture() + { + if (!IsExists()) + return false; + + if (MustRevalidate) + return false; + + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.2.4 : + // The max-age directive takes priority over Expires + if (MaxAge != -1) + { + // Age calculation: + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.2.3 + + long apparent_age = Math.Max(0, (long)(Received - Date).TotalSeconds); + long corrected_received_age = Math.Max(apparent_age, Age); + long resident_time = (long)(DateTime.UtcNow - Date).TotalSeconds; + long current_age = corrected_received_age + resident_time; + + return current_age < MaxAge; + } + + return Expires > DateTime.UtcNow; + } + + internal void SetUpRevalidationHeaders(HTTPRequest request) + { + if (!IsExists()) + return; + + // -If an entity tag has been provided by the origin server, MUST use that entity tag in any cache-conditional request (using If-Match or If-None-Match). + // -If only a Last-Modified value has been provided by the origin server, SHOULD use that value in non-subrange cache-conditional requests (using If-Modified-Since). + // -If both an entity tag and a Last-Modified value have been provided by the origin server, SHOULD use both validators in cache-conditional requests. This allows both HTTP/1.0 and HTTP/1.1 caches to respond appropriately. + + if (!string.IsNullOrEmpty(ETag)) + request.SetHeader("If-None-Match", ETag); + + if (!string.IsNullOrEmpty(LastModified)) + request.SetHeader("If-Modified-Since", LastModified); + } + + public System.IO.Stream GetBodyStream(out int length) + { + if (!IsExists()) + { + length = 0; + return null; + } + + length = BodyLength; + + LastAccess = DateTime.UtcNow; + + //FileStream stream = new FileStream(GetPath(), FileMode.Open, FileAccess.Read, FileShare.Read); + Stream stream = HTTPManager.IOService.CreateFileStream(GetPath(), FileStreamModes.Open); + stream.Seek(-length, System.IO.SeekOrigin.End); + + return stream; + } + + internal HTTPResponse ReadResponseTo(HTTPRequest request) + { + if (!IsExists()) + return null; + + LastAccess = DateTime.UtcNow; + + using (Stream stream = HTTPManager.IOService.CreateFileStream(GetPath(), FileStreamModes.Open)/*new FileStream(GetPath(), FileMode.Open, FileAccess.Read, FileShare.Read)*/) + { + var response = new HTTPResponse(request, stream, request.UseStreaming, true); + response.CacheFileInfo = this; + response.Receive(BodyLength); + return response; + } + } + + internal void Store(HTTPResponse response) + { + if (!HTTPCacheService.IsSupported) + return; + + string path = GetPath(); + + // Path name too long, we don't want to get exceptions + if (path.Length > HTTPManager.MaxPathLength) + return; + + if (HTTPManager.IOService.FileExists(path)) + Delete(); + + using (Stream writer = HTTPManager.IOService.CreateFileStream(GetPath(), FileStreamModes.Create) /*new FileStream(path, FileMode.Create)*/) + { + writer.WriteLine("HTTP/1.1 {0} {1}", response.StatusCode, response.Message); + foreach (var kvp in response.Headers) + { + for (int i = 0; i < kvp.Value.Count; ++i) + writer.WriteLine("{0}: {1}", kvp.Key, kvp.Value[i]); + } + + writer.WriteLine(); + + writer.Write(response.Data, 0, response.Data.Length); + } + + BodyLength = response.Data.Length; + LastAccess = DateTime.UtcNow; + + SetUpCachingValues(response); + } + + internal System.IO.Stream GetSaveStream(HTTPResponse response) + { + if (!HTTPCacheService.IsSupported) + return null; + + LastAccess = DateTime.UtcNow; + + string path = GetPath(); + + if (HTTPManager.IOService.FileExists(path)) + Delete(); + + // Path name too long, we don't want to get exceptions + if (path.Length > HTTPManager.MaxPathLength) + return null; + + // First write out the headers + using (Stream writer = HTTPManager.IOService.CreateFileStream(GetPath(), FileStreamModes.Create) /*new FileStream(path, FileMode.Create)*/) + { + writer.WriteLine("HTTP/1.1 {0} {1}", response.StatusCode, response.Message); + foreach (var kvp in response.Headers) + { + for (int i = 0; i < kvp.Value.Count; ++i) + writer.WriteLine("{0}: {1}", kvp.Key, kvp.Value[i]); + } + + writer.WriteLine(); + } + + // If caching is enabled and the response is from cache, and no content-length header set, then we set one to the response. + if (response.IsFromCache && !response.Headers.ContainsKey("content-length")) + response.Headers.Add("content-length", new List { BodyLength.ToString() }); + + SetUpCachingValues(response); + + // then create the stream with Append FileMode + return HTTPManager.IOService.CreateFileStream(GetPath(), FileStreamModes.Append); //new FileStream(GetPath(), FileMode.Append); + } + + #endregion + + #region IComparable + + public int CompareTo(HTTPCacheFileInfo other) + { + return this.LastAccess.CompareTo(other.LastAccess); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileInfo.cs.meta new file mode 100644 index 00000000..7aa44aab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileInfo.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1f50da5c22225384fbe271e0453fe545 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileLock.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileLock.cs new file mode 100644 index 00000000..b96ef195 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileLock.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_CACHING + +using System; +using System.Collections.Generic; + +namespace BestHTTP.Caching +{ + sealed class HTTPCacheFileLock + { + private static Dictionary FileLocks = new Dictionary(); + private static object SyncRoot = new object(); + + internal static object Acquire(Uri uri) + { + lock (SyncRoot) + { + object fileLock; + if (!FileLocks.TryGetValue(uri, out fileLock)) + FileLocks.Add(uri, fileLock = new object()); + + return fileLock; + } + } + + internal static void Remove(Uri uri) + { + lock (SyncRoot) + { + if (FileLocks.ContainsKey(uri)) + FileLocks.Remove(uri); + } + } + + internal static void Clear() + { + lock (SyncRoot) + { + FileLocks.Clear(); + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileLock.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileLock.cs.meta new file mode 100644 index 00000000..5ee7d6ed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheFileLock.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7b141dab023cd9d438e0585b93cf2826 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheMaintananceParams.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheMaintananceParams.cs new file mode 100644 index 00000000..ffffd96e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheMaintananceParams.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_CACHING + +using System; + +namespace BestHTTP.Caching +{ + public sealed class HTTPCacheMaintananceParams + { + /// + /// Delete cache entries that accessed older then this value. If TimeSpan.FromSeconds(0) is used then all cache entries will be deleted. With TimeSpan.FromDays(2) entries that older then two days will be deleted. + /// + public TimeSpan DeleteOlder { get; private set; } + + /// + /// If the cache is larger then the MaxCacheSize after the first maintanance step, then the maintanance job will forcedelete cache entries starting with the oldest last accessed one. + /// + public ulong MaxCacheSize { get; private set; } + + public HTTPCacheMaintananceParams(TimeSpan deleteOlder, ulong maxCacheSize) + { + this.DeleteOlder = deleteOlder; + this.MaxCacheSize = maxCacheSize; + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheMaintananceParams.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheMaintananceParams.cs.meta new file mode 100644 index 00000000..0d3225b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheMaintananceParams.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3ce5552e539e38647a8f37ab36951bf7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheService.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheService.cs new file mode 100644 index 00000000..4f2467b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheService.cs @@ -0,0 +1,716 @@ +#if !BESTHTTP_DISABLE_CACHING + +using System; +using System.Collections.Generic; +using System.Threading; + +// +// Version 1: Initial release +// Version 2: Filenames are generated from an index. +// + +namespace BestHTTP.Caching +{ + using BestHTTP.Extensions; + using BestHTTP.PlatformSupport.FileSystem; + + public sealed class UriComparer : IEqualityComparer + { + public bool Equals(Uri x, Uri y) + { + return Uri.Compare(x, y, UriComponents.HttpRequestUrl, UriFormat.SafeUnescaped, StringComparison.Ordinal) == 0; + } + + public int GetHashCode(Uri uri) + { + return uri.ToString().GetHashCode(); + } + } + + + public static class HTTPCacheService + { + #region Properties & Fields + + /// + /// Library file-format versioning support + /// + private const int LibraryVersion = 2; + + public static bool IsSupported + { + get + { + if (IsSupportCheckDone) + return isSupported; + + try + { + // If DirectoryExists throws an exception we will set IsSupprted to false + + HTTPManager.IOService.DirectoryExists(HTTPManager.GetRootCacheFolder()); + isSupported = true; + } + catch + { + isSupported = false; + + HTTPManager.Logger.Warning("HTTPCacheService", "Cache Service Disabled!"); + } + finally + { + IsSupportCheckDone = true; + } + + return isSupported; + } + } + private static bool isSupported; + private static bool IsSupportCheckDone; + + private static Dictionary library; + private static Dictionary Library { get { LoadLibrary(); return library; } } + + private static Dictionary UsedIndexes = new Dictionary(); + + internal static string CacheFolder { get; private set; } + private static string LibraryPath { get; set; } + + private static bool InClearThread; + private static bool InMaintainenceThread; + + /// + /// Stores the index of the next stored entity. The entity's file name is generated from this index. + /// + private static UInt64 NextNameIDX; + + #endregion + + static HTTPCacheService() + { + NextNameIDX = 0x0001; + } + + #region Common Functions + + internal static void CheckSetup() + { + if (!HTTPCacheService.IsSupported) + return; + + try + { + SetupCacheFolder(); + LoadLibrary(); + } + catch + { } + } + + internal static void SetupCacheFolder() + { + if (!HTTPCacheService.IsSupported) + return; + + try + { + if (string.IsNullOrEmpty(CacheFolder) || string.IsNullOrEmpty(LibraryPath)) + { + CacheFolder = System.IO.Path.Combine(HTTPManager.GetRootCacheFolder(), "HTTPCache"); + if (!HTTPManager.IOService.DirectoryExists(CacheFolder)) + HTTPManager.IOService.DirectoryCreate(CacheFolder); + + LibraryPath = System.IO.Path.Combine(HTTPManager.GetRootCacheFolder(), "Library"); + } + } + catch + { + isSupported = false; + + HTTPManager.Logger.Warning("HTTPCacheService", "Cache Service Disabled!"); + } + } + + internal static UInt64 GetNameIdx() + { + lock(Library) + { + UInt64 result = NextNameIDX; + + do + { + NextNameIDX = ++NextNameIDX % UInt64.MaxValue; + } while (UsedIndexes.ContainsKey(NextNameIDX)); + + return result; + } + } + + internal static bool HasEntity(Uri uri) + { + if (!IsSupported) + return false; + + lock (Library) + return Library.ContainsKey(uri); + } + + public static bool DeleteEntity(Uri uri, bool removeFromLibrary = true) + { + if (!IsSupported) + return false; + + object uriLocker = HTTPCacheFileLock.Acquire(uri); + + // Just use lock now: http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551/page-6#post-1937033 + + // To avoid a dead-lock we try acquire the lock on this uri only for a little time. + // If we can't acquire it, its better to just return without risking a deadlock. + //if (Monitor.TryEnter(uriLocker, TimeSpan.FromSeconds(0.5f))) + lock(uriLocker) + { + try + { + lock (Library) + { + HTTPCacheFileInfo info; + bool inStats = Library.TryGetValue(uri, out info); + if (inStats) + info.Delete(); + + if (inStats && removeFromLibrary) + { + Library.Remove(uri); + UsedIndexes.Remove(info.MappedNameIDX); + } + + return true; + } + } + finally + { + //Monitor.Exit(uriLocker); + } + } + + //return false; + } + + internal static bool IsCachedEntityExpiresInTheFuture(HTTPRequest request) + { + if (!IsSupported) + return false; + + HTTPCacheFileInfo info; + lock (Library) + if (Library.TryGetValue(request.CurrentUri, out info)) + return info.WillExpireInTheFuture(); + + return false; + } + + /// + /// Utility function to set the cache control headers according to the spec.: http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.4 + /// + /// + internal static void SetHeaders(HTTPRequest request) + { + if (!IsSupported) + return; + + request.RemoveHeader("If-None-Match"); + request.RemoveHeader("If-Modified-Since"); + + HTTPCacheFileInfo info; + lock (Library) + if (Library.TryGetValue(request.CurrentUri, out info)) + info.SetUpRevalidationHeaders(request); + } + + #endregion + + #region Get Functions + + internal static HTTPCacheFileInfo GetEntity(Uri uri) + { + if (!IsSupported) + return null; + HTTPCacheFileInfo info = null; + lock (Library) + Library.TryGetValue(uri, out info); + return info; + } + + internal static HTTPResponse GetFullResponse(HTTPRequest request) + { + if (!IsSupported) + return null; + + HTTPCacheFileInfo info; + lock (Library) + if (Library.TryGetValue(request.CurrentUri, out info)) + return info.ReadResponseTo(request); + + return null; + } + + #endregion + + #region Storing + + /// + /// Checks if the given response can be cached. http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.4 + /// + /// Returns true if cacheable, false otherwise. + internal static bool IsCacheble(Uri uri, HTTPMethods method, HTTPResponse response) + { + if (!IsSupported) + return false; + + if (method != HTTPMethods.Get) + return false; + + if (response == null) + return false; + + // https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.12 - Cache Replacement + // It MAY insert it into cache storage and MAY, if it meets all other requirements, use it to respond to any future requests that would previously have caused the old response to be returned. + //if (response.StatusCode == 304) + // return false; + + if (response.StatusCode < 200 || response.StatusCode >= 400) + return false; + + //http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.2 + var cacheControls = response.GetHeaderValues("cache-control"); + if (cacheControls != null) + { + if (cacheControls.Exists(headerValue => { + string value = headerValue.ToLower(); + return value.Contains("no-store") || value.Contains("no-cache"); + })) + return false; + } + + var pragmas = response.GetHeaderValues("pragma"); + if (pragmas != null) + { + if (pragmas.Exists(headerValue => { + string value = headerValue.ToLower(); + return value.Contains("no-store") || value.Contains("no-cache"); + })) + return false; + } + + // Responses with byte ranges not supported yet. + var byteRanges = response.GetHeaderValues("content-range"); + if (byteRanges != null) + return false; + + return true; + } + + internal static HTTPCacheFileInfo Store(Uri uri, HTTPMethods method, HTTPResponse response) + { + if (response == null || response.Data == null || response.Data.Length == 0) + return null; + + if (!IsSupported) + return null; + + HTTPCacheFileInfo info = null; + + lock (Library) + { + if (!Library.TryGetValue(uri, out info)) + { + Library.Add(uri, info = new HTTPCacheFileInfo(uri)); + UsedIndexes.Add(info.MappedNameIDX, info); + } + + try + { + info.Store(response); + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPCacheService", string.Format("{0} - Saved to cache", uri.ToString())); + } + catch + { + // If something happens while we write out the response, than we will delete it because it might be in an invalid state. + DeleteEntity(uri); + + throw; + } + } + + return info; + } + + internal static System.IO.Stream PrepareStreamed(Uri uri, HTTPResponse response) + { + if (!IsSupported) + return null; + + HTTPCacheFileInfo info; + + lock (Library) + { + if (!Library.TryGetValue(uri, out info)) + { + Library.Add(uri, info = new HTTPCacheFileInfo(uri)); + UsedIndexes.Add(info.MappedNameIDX, info); + } + + try + { + return info.GetSaveStream(response); + } + catch + { + // If something happens while we write out the response, than we will delete it because it might be in an invalid state. + DeleteEntity(uri); + + throw; + } + } + } + + #endregion + + #region Public Maintenance Functions + + /// + /// Deletes all cache entity. Non blocking. + /// Call it only if there no requests currently processed, because cache entries can be deleted while a server sends back a 304 result, so there will be no data to read from the cache! + /// + public static void BeginClear() + { + if (!IsSupported) + return; + + if (InClearThread) + return; + InClearThread = true; + + SetupCacheFolder(); + + #if !NETFX_CORE + ThreadPool.QueueUserWorkItem(new WaitCallback((param) => ClearImpl(param))); + //new Thread(ClearImpl).Start(); +#else +#pragma warning disable 4014 + Windows.System.Threading.ThreadPool.RunAsync(ClearImpl); +#pragma warning restore 4014 +#endif + } + + private static void ClearImpl(object param) + { + if (!IsSupported) + return; + + try + { + // GetFiles will return a string array that contains the files in the folder with the full path + string[] cacheEntries = HTTPManager.IOService.GetFiles(CacheFolder); + + for (int i = 0; i < cacheEntries.Length; ++i) + { + // We need a try-catch block because between the Directory.GetFiles call and the File.Delete calls a maintenance job, or other file operations can delete any file from the cache folder. + // So while there might be some problem with any file, we don't want to abort the whole for loop + try + { + HTTPManager.IOService.FileDelete(cacheEntries[i]); + } + catch + { } + } + } + finally + { + UsedIndexes.Clear(); + library.Clear(); + NextNameIDX = 0x0001; + + SaveLibrary(); + InClearThread = false; + } + } + + /// + /// Deletes all expired cache entity. + /// Call it only if there no requests currently processed, because cache entries can be deleted while a server sends back a 304 result, so there will be no data to read from the cache! + /// + public static void BeginMaintainence(HTTPCacheMaintananceParams maintananceParam) + { + if (maintananceParam == null) + throw new ArgumentNullException("maintananceParams == null"); + + if (!HTTPCacheService.IsSupported) + return; + + if (InMaintainenceThread) + return; + + InMaintainenceThread = true; + + SetupCacheFolder(); + +#if !NETFX_CORE + ThreadPool.QueueUserWorkItem(new WaitCallback((param) => + //new Thread((param) => +#else +#pragma warning disable 4014 + Windows.System.Threading.ThreadPool.RunAsync((param) => +#pragma warning restore 4014 +#endif + { + try + { + lock (Library) + { + // Delete cache entries older than the given time. + DateTime deleteOlderAccessed = DateTime.UtcNow - maintananceParam.DeleteOlder; + List removedEntities = new List(); + foreach (var kvp in Library) + if (kvp.Value.LastAccess < deleteOlderAccessed) + { + if (DeleteEntity(kvp.Key, false)) + removedEntities.Add(kvp.Value); + } + + for (int i = 0; i < removedEntities.Count; ++i) + { + Library.Remove(removedEntities[i].Uri); + UsedIndexes.Remove(removedEntities[i].MappedNameIDX); + } + removedEntities.Clear(); + + ulong cacheSize = GetCacheSize(); + + // This step will delete all entries starting with the oldest LastAccess property while the cache size greater then the MaxCacheSize in the given param. + if (cacheSize > maintananceParam.MaxCacheSize) + { + List fileInfos = new List(library.Count); + + foreach(var kvp in library) + fileInfos.Add(kvp.Value); + + fileInfos.Sort(); + + int idx = 0; + while (cacheSize >= maintananceParam.MaxCacheSize && idx < fileInfos.Count) + { + try + { + var fi = fileInfos[idx]; + ulong length = (ulong)fi.BodyLength; + + DeleteEntity(fi.Uri); + + cacheSize -= length; + } + catch + {} + finally + { + ++idx; + } + } + } + } + } + finally + { + SaveLibrary(); + InMaintainenceThread = false; + } + } + #if !NETFX_CORE + )); + #else + ); + #endif + } + + public static int GetCacheEntityCount() + { + if (!HTTPCacheService.IsSupported) + return 0; + + CheckSetup(); + + lock(Library) + return Library.Count; + } + + public static ulong GetCacheSize() + { + ulong size = 0; + + if (!IsSupported) + return size; + + CheckSetup(); + + lock (Library) + foreach (var kvp in Library) + if (kvp.Value.BodyLength > 0) + size += (ulong)kvp.Value.BodyLength; + return size; + } + + #endregion + + #region Cache Library Management + + private static void LoadLibrary() + { + // Already loaded? + if (library != null) + return; + + if (!IsSupported) + return; + + library = new Dictionary(new UriComparer()); + + if (!HTTPManager.IOService.FileExists(LibraryPath)) + { + DeleteUnusedFiles(); + return; + } + + try + { + int version; + + lock (library) + { + using (var fs = HTTPManager.IOService.CreateFileStream(LibraryPath, FileStreamModes.Open)) + using (var br = new System.IO.BinaryReader(fs)) + { + version = br.ReadInt32(); + + if (version > 1) + NextNameIDX = br.ReadUInt64(); + + int statCount = br.ReadInt32(); + + for (int i = 0; i < statCount; ++i) + { + Uri uri = new Uri(br.ReadString()); + + var entity = new HTTPCacheFileInfo(uri, br, version); + if (entity.IsExists()) + { + library.Add(uri, entity); + + if (version > 1) + UsedIndexes.Add(entity.MappedNameIDX, entity); + } + } + } + } + + if (version == 1) + BeginClear(); + else + DeleteUnusedFiles(); + } + catch + {} + } + + internal static void SaveLibrary() + { + if (library == null) + return; + + if (!IsSupported) + return; + + try + { + lock (Library) + { + using (var fs = HTTPManager.IOService.CreateFileStream(LibraryPath, FileStreamModes.Create)) + using (var bw = new System.IO.BinaryWriter(fs)) + { + bw.Write(LibraryVersion); + bw.Write(NextNameIDX); + + bw.Write(Library.Count); + foreach (var kvp in Library) + { + bw.Write(kvp.Key.ToString()); + + kvp.Value.SaveTo(bw); + } + } + } + } + catch + {} + } + + + internal static void SetBodyLength(Uri uri, int bodyLength) + { + if (!IsSupported) + return; + + lock (Library) + { + HTTPCacheFileInfo fileInfo; + if (Library.TryGetValue(uri, out fileInfo)) + fileInfo.BodyLength = bodyLength; + else + { + Library.Add(uri, fileInfo = new HTTPCacheFileInfo(uri, DateTime.UtcNow, bodyLength)); + UsedIndexes.Add(fileInfo.MappedNameIDX, fileInfo); + } + } + } + + /// + /// Deletes all files from the cache folder that isn't in the Library. + /// + private static void DeleteUnusedFiles() + { + if (!IsSupported) + return; + + CheckSetup(); + + // GetFiles will return a string array that contains the files in the folder with the full path + string[] cacheEntries = HTTPManager.IOService.GetFiles(CacheFolder); + + for (int i = 0; i < cacheEntries.Length; ++i) + { + // We need a try-catch block because between the Directory.GetFiles call and the File.Delete calls a maintenance job, or other file operations can delete any file from the cache folder. + // So while there might be some problem with any file, we don't want to abort the whole for loop + try + { + string filename = System.IO.Path.GetFileName(cacheEntries[i]); + UInt64 idx = 0; + bool deleteFile = false; + if (UInt64.TryParse(filename, System.Globalization.NumberStyles.AllowHexSpecifier, null, out idx)) + lock (Library) + deleteFile = !UsedIndexes.ContainsKey(idx); + else + deleteFile = true; + + if (deleteFile) + HTTPManager.IOService.FileDelete(cacheEntries[i]); + } + catch + {} + } + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheService.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheService.cs.meta new file mode 100644 index 00000000..fa7c39fc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Caching/HTTPCacheService.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d29e8551599393f4193bc4daa6968607 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections.meta new file mode 100644 index 00000000..edb913f2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 65fae491919869042be9bb2f969bf050 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/ConnectionBase.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/ConnectionBase.cs new file mode 100644 index 00000000..e965aef8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/ConnectionBase.cs @@ -0,0 +1,226 @@ +using System; +using System.Threading; + +#if NETFX_CORE + using System.Threading.Tasks; + + //Disable CD4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. + #pragma warning disable 4014 + + //Disable warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. + #pragma warning disable 1998 +#endif + +namespace BestHTTP +{ + internal delegate void HTTPConnectionRecycledDelegate(ConnectionBase conn); + + internal abstract class ConnectionBase : IDisposable + { + #region Public Properties + + /// + /// The address of the server that this connection is bound to. + /// + public string ServerAddress { get; protected set; } + + /// + /// The state of this connection. + /// + public HTTPConnectionStates State { get; protected set; } + + /// + /// It's true if this connection is available to process a HTTPRequest. + /// + public bool IsFree { get { return State == HTTPConnectionStates.Initial || State == HTTPConnectionStates.Free; } } + + /// + /// Returns true if it's an active connection. + /// + public bool IsActive { get { return State > HTTPConnectionStates.Initial && State < HTTPConnectionStates.Free; } } + + /// + /// If the State is HTTPConnectionStates.Processing, then it holds a HTTPRequest instance. Otherwise it's null. + /// + public HTTPRequest CurrentRequest { get; protected set; } + + public virtual bool IsRemovable { get { return IsFree && (DateTime.UtcNow - LastProcessTime) > HTTPManager.MaxConnectionIdleTime; } } + + /// + /// When we start to process the current request. It's set after the connection is established. + /// + public DateTime StartTime { get; protected set; } + + /// + /// When this connection timed out. + /// + public DateTime TimedOutStart { get; protected set; } + +#if !BESTHTTP_DISABLE_PROXY + public bool HasProxy { get { return this.CurrentRequest != null && this.CurrentRequest.Proxy != null; } } +#endif + + public Uri LastProcessedUri { get; protected set; } + + #endregion + + #region Protected Fields + + protected DateTime LastProcessTime; + protected HTTPConnectionRecycledDelegate OnConnectionRecycled = null; + + #endregion + + #region Privates + + private bool IsThreaded; + + #endregion + + public ConnectionBase(string serverAddress) + :this(serverAddress, true) + {} + + public ConnectionBase(string serverAddress, bool threaded) + { + this.ServerAddress = serverAddress; + this.State = HTTPConnectionStates.Initial; + this.LastProcessTime = DateTime.UtcNow; + this.IsThreaded = threaded; + } + + internal abstract void Abort(HTTPConnectionStates hTTPConnectionStates); + + internal void Process(HTTPRequest request) + { + if (State == HTTPConnectionStates.Processing) + throw new Exception("Connection already processing a request!"); + + StartTime = DateTime.MaxValue; + State = HTTPConnectionStates.Processing; + + CurrentRequest = request; + + if (IsThreaded) + { +#if NETFX_CORE +#pragma warning disable 4014 + Windows.System.Threading.ThreadPool.RunAsync(ThreadFunc); +#pragma warning restore 4014 +#else + ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadFunc)); + //new Thread(ThreadFunc) + // .Start(); +#endif + } + else + ThreadFunc(null); + } + + protected virtual +#if NETFX_CORE + async +#endif + void ThreadFunc(object param) + { + + } + + internal void HandleProgressCallback() + { + if (CurrentRequest.OnProgress != null && CurrentRequest.DownloadProgressChanged) + { + try + { + CurrentRequest.OnProgress(CurrentRequest, CurrentRequest.Downloaded, CurrentRequest.DownloadLength); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("ConnectionBase", "HandleProgressCallback - OnProgress", ex); + } + + CurrentRequest.DownloadProgressChanged = false; + } + + if (CurrentRequest.OnUploadProgress != null && CurrentRequest.UploadProgressChanged) + { + try + { + CurrentRequest.OnUploadProgress(CurrentRequest, CurrentRequest.Uploaded, CurrentRequest.UploadLength); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("ConnectionBase", "HandleProgressCallback - OnUploadProgress", ex); + } + CurrentRequest.UploadProgressChanged = false; + } + } + + internal void HandleCallback() + { + try + { + HandleProgressCallback(); + + if (State == HTTPConnectionStates.Upgraded) + { + if (CurrentRequest != null && CurrentRequest.Response != null && CurrentRequest.Response.IsUpgraded) + CurrentRequest.UpgradeCallback(); + State = HTTPConnectionStates.WaitForProtocolShutdown; + } + else + CurrentRequest.CallCallback(); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("ConnectionBase", "HandleCallback", ex); + } + } + + internal void Recycle(HTTPConnectionRecycledDelegate onConnectionRecycled) + { + OnConnectionRecycled = onConnectionRecycled; + if (!(State > HTTPConnectionStates.Initial && State < HTTPConnectionStates.WaitForProtocolShutdown) || State == HTTPConnectionStates.Redirected) + RecycleNow(); + } + + protected void RecycleNow() + { + if (State == HTTPConnectionStates.TimedOut || + State == HTTPConnectionStates.Closed) + LastProcessTime = DateTime.MinValue; + + State = HTTPConnectionStates.Free; + if (CurrentRequest != null) + CurrentRequest.Dispose(); + CurrentRequest = null; + + if (OnConnectionRecycled != null) + { + OnConnectionRecycled(this); + OnConnectionRecycled = null; + } + } + + #region Dispose Pattern + + protected bool IsDisposed { get; private set; } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + IsDisposed = true; + } + + ~ConnectionBase() + { + Dispose(false); + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/ConnectionBase.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/ConnectionBase.cs.meta new file mode 100644 index 00000000..695ea4dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/ConnectionBase.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f59e4337e77f0be4d8f6649beaca8362 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/FileConnection.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/FileConnection.cs new file mode 100644 index 00000000..d90356a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/FileConnection.cs @@ -0,0 +1,300 @@ +using System; +using System.Collections.Generic; + +using BestHTTP.Extensions; +using BestHTTP.PlatformSupport.FileSystem; + +namespace BestHTTP +{ + public sealed class StreamList : System.IO.Stream + { + private System.IO.Stream[] Streams; + private int CurrentIdx; + + public StreamList(params System.IO.Stream[] streams) + { + this.Streams = streams; + this.CurrentIdx = 0; + } + + public override bool CanRead + { + get { + if (CurrentIdx >= Streams.Length) + return false; + return Streams[CurrentIdx].CanRead; + } + } + + public override bool CanSeek { get { return false; } } + + public override bool CanWrite + { + get { + if (CurrentIdx >= Streams.Length) + return false; + return Streams[CurrentIdx].CanWrite; + } + } + + public override void Flush() + { + if (CurrentIdx >= Streams.Length) + return; + + // We have to call the flush to all previous streams, as we may advanced the CurrentIdx + for (int i = 0; i <= CurrentIdx; ++i) + Streams[i].Flush(); + } + + public override long Length + { + get { + if (CurrentIdx >= Streams.Length) + return 0; + + long length = 0; + for (int i = 0; i < Streams.Length; ++i) + length += Streams[i].Length; + + return length; + } + } + + public override int Read(byte[] buffer, int offset, int count) + { + if (CurrentIdx >= Streams.Length) + return -1; + + int readCount = Streams[CurrentIdx].Read(buffer, offset, count); + + while (readCount < count && CurrentIdx++ < Streams.Length) + { + readCount += Streams[CurrentIdx].Read(buffer, offset + readCount, count - readCount); + } + + return readCount; + } + + public override void Write(byte[] buffer, int offset, int count) + { + if (CurrentIdx >= Streams.Length) + return; + + Streams[CurrentIdx].Write(buffer, offset, count); + } + + public void Write(string str) + { + byte[] bytes = str.GetASCIIBytes(); + + this.Write(bytes, 0, bytes.Length); + VariableSizedBufferPool.Release(bytes); + } + + protected override void Dispose(bool disposing) + { + for (int i = 0; i < Streams.Length; ++i) + { + try + { + Streams[i].Dispose(); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("StreamList", "Dispose", ex); + } + } + } + + public override long Position + { + get + { + throw new NotImplementedException("Position get"); + } + set + { + throw new NotImplementedException("Position set"); + } + } + + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + if (CurrentIdx >= Streams.Length) + return 0; + + return Streams[CurrentIdx].Seek(offset, origin); + } + + public override void SetLength(long value) + { + throw new NotImplementedException("SetLength"); + } + } + + /*public static class AndroidFileHelper + { + // AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); + // AndroidJavaObject jo = jc.GetStatic("currentActivity"); + + public static Stream GetAPKFileStream(string path) + { + UnityEngine.AndroidJavaClass up = new UnityEngine.AndroidJavaClass("com.unity3d.player.UnityPlayer"); + UnityEngine.AndroidJavaObject cActivity = up.GetStatic("currentActivity"); + + UnityEngine.AndroidJavaObject assetManager = cActivity.GetStatic("getAssets"); + + return new AndroidInputStream(assetManager.Call("open", path)); + } + } + + public sealed class AndroidInputStream : Stream + { + private UnityEngine.AndroidJavaObject baseStream; + + public override bool CanRead + { + get { throw new NotImplementedException(); } + } + + public override bool CanSeek + { + get { throw new NotImplementedException(); } + } + + public override bool CanWrite + { + get { throw new NotImplementedException(); } + } + + public override void Flush() + { + throw new NotImplementedException(); + } + + public override long Length + { + get { throw new NotImplementedException(); } + } + + public override long Position + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public AndroidInputStream(UnityEngine.AndroidJavaObject inputStream) + { + this.baseStream = inputStream; + } + + public override int Read(byte[] buffer, int offset, int count) + { + return this.baseStream.Call("read", buffer, offset, count); + } + + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotImplementedException(); + } + + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotImplementedException(); + } + }*/ + + internal sealed class FileConnection : ConnectionBase + { + public FileConnection(string serverAddress) + :base(serverAddress) + { } + + internal override void Abort(HTTPConnectionStates newState) + { + State = newState; + + switch (State) + { + case HTTPConnectionStates.TimedOut: TimedOutStart = DateTime.UtcNow; break; + } + + throw new NotImplementedException(); + } + + protected override void ThreadFunc(object param) + { + try + { + // Step 1 : create a stream with header information + // Step 2 : create a stream from the file + // Step 3 : create a StreamList + // Step 4 : create a HTTPResponse object + // Step 5 : call the Receive function of the response object + + using (System.IO.Stream fs = HTTPManager.IOService.CreateFileStream(this.CurrentRequest.CurrentUri.LocalPath, FileStreamModes.Open)) + //using (Stream fs = AndroidFileHelper.GetAPKFileStream(this.CurrentRequest.CurrentUri.LocalPath)) + using (StreamList stream = new StreamList(new System.IO.MemoryStream(), fs)) + { + // This will write to the MemoryStream + stream.Write("HTTP/1.1 200 Ok\r\n"); + stream.Write("Content-Type: application/octet-stream\r\n"); + stream.Write("Content-Length: " + fs.Length.ToString() + "\r\n"); + stream.Write("\r\n"); + + stream.Seek(0, System.IO.SeekOrigin.Begin); + + base.CurrentRequest.Response = new HTTPResponse(base.CurrentRequest, stream, base.CurrentRequest.UseStreaming, false); + + if (!CurrentRequest.Response.Receive()) + CurrentRequest.Response = null; + } + } + catch(Exception ex) + { + if (CurrentRequest != null) + { + // Something gone bad, Response must be null! + CurrentRequest.Response = null; + + switch (State) + { + case HTTPConnectionStates.AbortRequested: + CurrentRequest.State = HTTPRequestStates.Aborted; + break; + case HTTPConnectionStates.TimedOut: + CurrentRequest.State = HTTPRequestStates.TimedOut; + break; + default: + CurrentRequest.Exception = ex; + CurrentRequest.State = HTTPRequestStates.Error; + break; + } + } + } + finally + { + State = HTTPConnectionStates.Closed; + if (CurrentRequest.State == HTTPRequestStates.Processing) + { + if (CurrentRequest.Response != null) + CurrentRequest.State = HTTPRequestStates.Finished; + else + CurrentRequest.State = HTTPRequestStates.Error; + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/FileConnection.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/FileConnection.cs.meta new file mode 100644 index 00000000..8d899f8e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/FileConnection.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 24106f78264881a419f83ef4b760ded7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/WebGLConnection.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/WebGLConnection.cs new file mode 100644 index 00000000..584aef4c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/WebGLConnection.cs @@ -0,0 +1,411 @@ +#if UNITY_WEBGL && !UNITY_EDITOR + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; + +using BestHTTP.Authentication; +using BestHTTP.Extensions; + +namespace BestHTTP +{ + delegate void OnWebGLRequestHandlerDelegate(int nativeId, int httpStatus, IntPtr pBuffer, int length, int zero); + delegate void OnWebGLBufferDelegate(int nativeId, IntPtr pBuffer, int length); + delegate void OnWebGLProgressDelegate(int nativeId, int downloaded, int total); + delegate void OnWebGLErrorDelegate(int nativeId, string error); + delegate void OnWebGLTimeoutDelegate(int nativeId); + delegate void OnWebGLAbortedDelegate(int nativeId); + + internal sealed class WebGLConnection : ConnectionBase + { + static Dictionary Connections = new Dictionary(4); + + int NativeId; + BufferPoolMemoryStream Stream; + + public WebGLConnection(string serverAddress) + : base(serverAddress, false) + { + XHR_SetLoglevel((byte)HTTPManager.Logger.Level); + } + + internal override void Abort(HTTPConnectionStates newState) + { + State = newState; + + switch (State) + { + case HTTPConnectionStates.TimedOut: TimedOutStart = DateTime.UtcNow; break; + } + + XHR_Abort(this.NativeId); + } + + protected override void ThreadFunc(object param /*null*/) + { + // XmlHttpRequest setup + + this.NativeId = XHR_Create(HTTPRequest.MethodNames[(byte)CurrentRequest.MethodType], + CurrentRequest.CurrentUri.OriginalString, + CurrentRequest.Credentials != null ? CurrentRequest.Credentials.UserName : null, + CurrentRequest.Credentials != null ? CurrentRequest.Credentials.Password : null, + CurrentRequest.WithCredentials ? 1 : 0); + Connections.Add(NativeId, this); + + CurrentRequest.EnumerateHeaders((header, values) => + { + if (header != "Content-Length") + for (int i = 0; i < values.Count; ++i) + XHR_SetRequestHeader(NativeId, header, values[i]); + }, /*callBeforeSendCallback:*/ true); + + byte[] body = CurrentRequest.GetEntityBody(); + + XHR_SetResponseHandler(NativeId, WebGLConnection.OnResponse, WebGLConnection.OnError, WebGLConnection.OnTimeout, WebGLConnection.OnAborted); + // Setting OnUploadProgress result in an addEventListener("progress", ...) call making the request non-simple. + // https://forum.unity.com/threads/best-http-released.200006/page-49#post-3696220 + XHR_SetProgressHandler(NativeId, WebGLConnection.OnDownloadProgress, CurrentRequest.OnUploadProgress == null ? (OnWebGLProgressDelegate)null : WebGLConnection.OnUploadProgress); + + XHR_SetTimeout(NativeId, (uint)(CurrentRequest.ConnectTimeout.TotalMilliseconds + CurrentRequest.Timeout.TotalMilliseconds)); + + XHR_Send(NativeId, body, body != null ? body.Length : 0); + } + +#region Callback Implementations + + void OnResponse(int httpStatus, byte[] buffer, int bufferLength) + { + try + { + using (var ms = new BufferPoolMemoryStream()) + { + Stream = ms; + + XHR_GetStatusLine(NativeId, OnBufferCallback); + XHR_GetResponseHeaders(NativeId, OnBufferCallback); + + if (buffer != null && bufferLength > 0) + ms.Write(buffer, 0, bufferLength); + + ms.Seek(0L, SeekOrigin.Begin); + + var internalBuffer = ms.GetBuffer(); + string tmp = System.Text.Encoding.UTF8.GetString(internalBuffer); + HTTPManager.Logger.Information(this.NativeId + " OnResponse - full response ", tmp); + + SupportedProtocols protocol = CurrentRequest.ProtocolHandler == SupportedProtocols.Unknown ? HTTPProtocolFactory.GetProtocolFromUri(CurrentRequest.CurrentUri) : CurrentRequest.ProtocolHandler; + CurrentRequest.Response = HTTPProtocolFactory.Get(protocol, CurrentRequest, ms, CurrentRequest.UseStreaming, false); + + CurrentRequest.Response.Receive(buffer != null && bufferLength > 0 ? (int)bufferLength : -1, true); + + if (CurrentRequest.IsCookiesEnabled) + BestHTTP.Cookies.CookieJar.Set(CurrentRequest.Response); + } + } + catch (Exception e) + { + HTTPManager.Logger.Exception(this.NativeId + " WebGLConnection", "OnResponse", e); + + if (CurrentRequest != null) + { + // Something gone bad, Response must be null! + CurrentRequest.Response = null; + + switch (State) + { + case HTTPConnectionStates.AbortRequested: + CurrentRequest.State = HTTPRequestStates.Aborted; + break; + case HTTPConnectionStates.TimedOut: + CurrentRequest.State = HTTPRequestStates.TimedOut; + break; + default: + CurrentRequest.Exception = e; + CurrentRequest.State = HTTPRequestStates.Error; + break; + } + } + } + finally + { + Connections.Remove(NativeId); + + Stream = null; + + if (CurrentRequest != null) + lock (HTTPManager.Locker) + { + State = HTTPConnectionStates.Closed; + if (CurrentRequest.State == HTTPRequestStates.Processing) + { + if (CurrentRequest.Response != null) + CurrentRequest.State = HTTPRequestStates.Finished; + else + CurrentRequest.State = HTTPRequestStates.Error; + } + } + + LastProcessTime = DateTime.UtcNow; + + if (OnConnectionRecycled != null) + RecycleNow(); + + XHR_Release(NativeId); + } + } + + void OnBuffer(byte[] buffer, int bufferLength) + { + if (Stream != null) + { + Stream.Write(buffer, 0, bufferLength); + //Stream.Write(new byte[2] { HTTPResponse.CR, HTTPResponse.LF }, 0, 2); + Stream.Write(HTTPRequest.EOL, 0, HTTPRequest.EOL.Length); + } + } + + void OnDownloadProgress(int down, int total) + { + CurrentRequest.Downloaded = down; + CurrentRequest.DownloadLength = total; + CurrentRequest.DownloadProgressChanged = true; + } + + void OnUploadProgress(int up, int total) + { + CurrentRequest.Uploaded = up; + CurrentRequest.UploadLength = total; + CurrentRequest.UploadProgressChanged = true; + } + + void OnError(string error) + { + HTTPManager.Logger.Information(this.NativeId + " WebGLConnection - OnError", error); + + Connections.Remove(NativeId); + + Stream = null; + + if (CurrentRequest != null) + lock (HTTPManager.Locker) + { + State = HTTPConnectionStates.Closed; + CurrentRequest.State = HTTPRequestStates.Error; + CurrentRequest.Exception = new Exception(error); + } + + LastProcessTime = DateTime.UtcNow; + + if (OnConnectionRecycled != null) + RecycleNow(); + + XHR_Release(NativeId); + } + + void OnTimeout() + { + HTTPManager.Logger.Information(this.NativeId + " WebGLConnection - OnResponse", string.Empty); + + Connections.Remove(NativeId); + + Stream = null; + + if (CurrentRequest != null) + lock (HTTPManager.Locker) + { + State = HTTPConnectionStates.Closed; + CurrentRequest.State = HTTPRequestStates.TimedOut; + } + + LastProcessTime = DateTime.UtcNow; + + if (OnConnectionRecycled != null) + RecycleNow(); + + XHR_Release(NativeId); + } + + void OnAborted() + { + HTTPManager.Logger.Information(this.NativeId + " WebGLConnection - OnAborted", string.Empty); + + Connections.Remove(NativeId); + + Stream = null; + + if (CurrentRequest != null) + lock (HTTPManager.Locker) + { + State = HTTPConnectionStates.Closed; + CurrentRequest.State = HTTPRequestStates.Aborted; + } + + LastProcessTime = DateTime.UtcNow; + + if (OnConnectionRecycled != null) + RecycleNow(); + + XHR_Release(NativeId); + } + +#endregion + +#region WebGL Static Callbacks + + [AOT.MonoPInvokeCallback(typeof(OnWebGLRequestHandlerDelegate))] + static void OnResponse(int nativeId, int httpStatus, IntPtr pBuffer, int length, int err) + { + HTTPManager.Logger.Information("WebGLConnection - OnResponse", string.Format("{0} {1} {2} {3}", nativeId, httpStatus, length, err)); + + WebGLConnection conn = null; + if (!Connections.TryGetValue(nativeId, out conn)) + { + HTTPManager.Logger.Error("WebGLConnection - OnResponse", "No WebGL connection found for nativeId: " + nativeId.ToString()); + return; + } + + byte[] buffer = VariableSizedBufferPool.Get(length, true); + + // Copy data from the 'unmanaged' memory to managed memory. Buffer will be reclaimed by the GC. + Marshal.Copy(pBuffer, buffer, 0, length); + + conn.OnResponse(httpStatus, buffer, length); + + VariableSizedBufferPool.Release(buffer); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLBufferDelegate))] + static void OnBufferCallback(int nativeId, IntPtr pBuffer, int length) + { + WebGLConnection conn = null; + if (!Connections.TryGetValue(nativeId, out conn)) + { + HTTPManager.Logger.Error("WebGLConnection - OnBufferCallback", "No WebGL connection found for nativeId: " + nativeId.ToString()); + return; + } + + byte[] buffer = VariableSizedBufferPool.Get(length, true); + + // Copy data from the 'unmanaged' memory to managed memory. Buffer will be reclaimed by the GC. + Marshal.Copy(pBuffer, buffer, 0, length); + + conn.OnBuffer(buffer, length); + + VariableSizedBufferPool.Release(buffer); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLProgressDelegate))] + static void OnDownloadProgress(int nativeId, int downloaded, int total) + { + HTTPManager.Logger.Information(nativeId + " OnDownloadProgress", downloaded.ToString() + " / " + total.ToString()); + + WebGLConnection conn = null; + if (!Connections.TryGetValue(nativeId, out conn)) + { + HTTPManager.Logger.Error("WebGLConnection - OnDownloadProgress", "No WebGL connection found for nativeId: " + nativeId.ToString()); + return; + } + + conn.OnDownloadProgress(downloaded, total); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLProgressDelegate))] + static void OnUploadProgress(int nativeId, int uploaded, int total) + { + HTTPManager.Logger.Information(nativeId + " OnUploadProgress", uploaded.ToString() + " / " + total.ToString()); + + WebGLConnection conn = null; + if (!Connections.TryGetValue(nativeId, out conn)) + { + HTTPManager.Logger.Error("WebGLConnection - OnUploadProgress", "No WebGL connection found for nativeId: " + nativeId.ToString()); + return; + } + + conn.OnUploadProgress(uploaded, total); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLErrorDelegate))] + static void OnError(int nativeId, string error) + { + WebGLConnection conn = null; + if (!Connections.TryGetValue(nativeId, out conn)) + { + HTTPManager.Logger.Error("WebGLConnection - OnError", "No WebGL connection found for nativeId: " + nativeId.ToString() + " Error: " + error); + return; + } + + conn.OnError(error); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLTimeoutDelegate))] + static void OnTimeout(int nativeId) + { + WebGLConnection conn = null; + if (!Connections.TryGetValue(nativeId, out conn)) + { + HTTPManager.Logger.Error("WebGLConnection - OnTimeout", "No WebGL connection found for nativeId: " + nativeId.ToString()); + return; + } + + conn.OnTimeout(); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLAbortedDelegate))] + static void OnAborted(int nativeId) + { + WebGLConnection conn = null; + if (!Connections.TryGetValue(nativeId, out conn)) + { + HTTPManager.Logger.Error("WebGLConnection - OnAborted", "No WebGL connection found for nativeId: " + nativeId.ToString()); + return; + } + + conn.OnAborted(); + } + +#endregion + +#region WebGL Interface + + [DllImport("__Internal")] + private static extern int XHR_Create(string method, string url, string userName, string passwd, int withCredentials); + + /// + /// Is an unsigned long representing the number of milliseconds a request can take before automatically being terminated. A value of 0 (which is the default) means there is no timeout. + /// + [DllImport("__Internal")] + private static extern void XHR_SetTimeout(int nativeId, uint timeout); + + [DllImport("__Internal")] + private static extern void XHR_SetRequestHeader(int nativeId, string header, string value); + + [DllImport("__Internal")] + private static extern void XHR_SetResponseHandler(int nativeId, OnWebGLRequestHandlerDelegate onresponse, OnWebGLErrorDelegate onerror, OnWebGLTimeoutDelegate ontimeout, OnWebGLAbortedDelegate onabort); + + [DllImport("__Internal")] + private static extern void XHR_SetProgressHandler(int nativeId, OnWebGLProgressDelegate onDownloadProgress, OnWebGLProgressDelegate onUploadProgress); + + [DllImport("__Internal")] + private static extern void XHR_Send(int nativeId, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] body, int length); + + [DllImport("__Internal")] + private static extern void XHR_GetResponseHeaders(int nativeId, OnWebGLBufferDelegate callback); + + [DllImport("__Internal")] + private static extern void XHR_GetStatusLine(int nativeId, OnWebGLBufferDelegate callback); + + [DllImport("__Internal")] + private static extern void XHR_Abort(int nativeId); + + [DllImport("__Internal")] + private static extern void XHR_Release(int nativeId); + + [DllImport("__Internal")] + private static extern void XHR_SetLoglevel(int logLevel); + +#endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/WebGLConnection.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/WebGLConnection.cs.meta new file mode 100644 index 00000000..a8744f42 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Connections/WebGLConnection.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: cca5a5d266418134dbb9c0b87c68e62a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies.meta new file mode 100644 index 00000000..3767b0fb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e138652289c643d4ca6bff547a5bd4f0 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/Cookie.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/Cookie.cs new file mode 100644 index 00000000..e723e5b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/Cookie.cs @@ -0,0 +1,359 @@ +#if !BESTHTTP_DISABLE_COOKIES + +using System; +using System.Collections.Generic; +using BestHTTP.Extensions; +using System.IO; + +namespace BestHTTP.Cookies +{ + /// + /// The Cookie implementation based on RFC 6265(http://tools.ietf.org/html/rfc6265). + /// + public sealed class Cookie : IComparable, IEquatable + { + private const int Version = 1; + + #region Public Properties + + /// + /// The name of the cookie. + /// + public string Name { get; private set; } + + /// + /// The value of the cookie. + /// + public string Value { get; private set; } + + /// + /// The Date when the Cookie is registered. + /// + public DateTime Date { get; internal set; } + + /// + /// When this Cookie last used in a request. + /// + public DateTime LastAccess { get; set; } + + /// + /// The Expires attribute indicates the maximum lifetime of the cookie, represented as the date and time at which the cookie expires. + /// The user agent is not required to retain the cookie until the specified date has passed. + /// In fact, user agents often evict cookies due to memory pressure or privacy concerns. + /// + public DateTime Expires { get; private set; } + + /// + /// The Max-Age attribute indicates the maximum lifetime of the cookie, represented as the number of seconds until the cookie expires. + /// The user agent is not required to retain the cookie for the specified duration. + /// In fact, user agents often evict cookies due to memory pressure or privacy concerns. + /// + public long MaxAge { get; private set; } + + /// + /// If a cookie has neither the Max-Age nor the Expires attribute, the user agent will retain the cookie until "the current session is over". + /// + public bool IsSession { get; private set; } + + /// + /// The Domain attribute specifies those hosts to which the cookie will be sent. + /// For example, if the value of the Domain attribute is "example.com", the user agent will include the cookie + /// in the Cookie header when making HTTP requests to example.com, www.example.com, and www.corp.example.com. + /// If the server omits the Domain attribute, the user agent will return the cookie only to the origin server. + /// + public string Domain { get; private set; } + + /// + /// The scope of each cookie is limited to a set of paths, controlled by the Path attribute. + /// If the server omits the Path attribute, the user agent will use the "directory" of the request-uri's path component as the default value. + /// + public string Path { get; private set; } + + /// + /// The Secure attribute limits the scope of the cookie to "secure" channels (where "secure" is defined by the user agent). + /// When a cookie has the Secure attribute, the user agent will include the cookie in an HTTP request only if the request is + /// transmitted over a secure channel (typically HTTP over Transport Layer Security (TLS)). + /// + public bool IsSecure { get; private set; } + + /// + /// The HttpOnly attribute limits the scope of the cookie to HTTP requests. + /// In particular, the attribute instructs the user agent to omit the cookie when providing access to + /// cookies via "non-HTTP" APIs (such as a web browser API that exposes cookies to scripts). + /// + public bool IsHttpOnly { get; private set; } + + #endregion + + #region Public Constructors + + public Cookie(string name, string value) + :this(name, value, "/", string.Empty) + {} + + public Cookie(string name, string value, string path) + : this(name, value, path, string.Empty) + {} + + public Cookie(string name, string value, string path, string domain) + :this() // call the parameter-less constructor to set default values + { + this.Name = name; + this.Value = value; + this.Path = path; + this.Domain = domain; + } + + public Cookie(Uri uri, string name, string value, DateTime expires, bool isSession = true) + :this(name, value, uri.AbsolutePath, uri.Host) + { + this.Expires = expires; + this.IsSession = isSession; + this.Date = DateTime.UtcNow; + } + + public Cookie(Uri uri, string name, string value, long maxAge = -1, bool isSession = true) + :this(name, value, uri.AbsolutePath, uri.Host) + { + this.MaxAge = maxAge; + this.IsSession = isSession; + this.Date = DateTime.UtcNow; + } + + #endregion + + internal Cookie() + { + // If a cookie has neither the Max-Age nor the Expires attribute, the user agent will retain the cookie + // until "the current session is over" (as defined by the user agent). + IsSession = true; + MaxAge = -1; + LastAccess = DateTime.UtcNow; + } + + public bool WillExpireInTheFuture() + { + // No Expires or Max-Age value sent from the server, we will fake the return value so we will not delete the newly came Cookie + if (IsSession) + return true; + + // If a cookie has both the Max-Age and the Expires attribute, the Max-Age attribute has precedence and controls the expiration date of the cookie. + return MaxAge != -1 ? + Math.Max(0, (long)(DateTime.UtcNow - Date).TotalSeconds) < MaxAge : + Expires > DateTime.UtcNow; + } + + /// + /// Guess the storage size of the cookie. + /// + /// + public uint GuessSize() + { + return (uint)((Name != null ? Name.Length * sizeof(char) : 0) + + (Value != null ? Value.Length * sizeof(char) : 0) + + (Domain != null ? Domain.Length * sizeof(char) : 0) + + (Path != null ? Path.Length * sizeof(char) : 0) + + (sizeof(long) * 4) + + (sizeof(bool) * 3)); + } + + public static Cookie Parse(string header, Uri defaultDomain) + { + Cookie cookie = new Cookie(); + try + { + var kvps = ParseCookieHeader(header); + + foreach (var kvp in kvps) + { + switch (kvp.Key.ToLowerInvariant()) + { + case "path": + // If the attribute-value is empty or if the first character of the attribute-value is not %x2F ("/"): + // Let cookie-path be the default-path. + cookie.Path = string.IsNullOrEmpty(kvp.Value) || !kvp.Value.StartsWith("/") ? "/" : cookie.Path = kvp.Value; + break; + + case "domain": + // If the attribute-value is empty, the behavior is undefined. However, the user agent SHOULD ignore the cookie-av entirely. + if (string.IsNullOrEmpty(kvp.Value)) + return null; + + // If the first character of the attribute-value string is %x2E ("."): + // Let cookie-domain be the attribute-value without the leading %x2E (".") character. + cookie.Domain = kvp.Value.StartsWith(".") ? kvp.Value.Substring(1) : kvp.Value; + break; + + case "expires": + cookie.Expires = kvp.Value.ToDateTime(DateTime.FromBinary(0)); + cookie.IsSession = false; + break; + + case "max-age": + cookie.MaxAge = kvp.Value.ToInt64(-1); + cookie.IsSession = false; + break; + + case "secure": + cookie.IsSecure = true; + break; + + case "httponly": + cookie.IsHttpOnly = true; + break; + + default: + cookie.Name = kvp.Key; + cookie.Value = kvp.Value; + break; + } + } + + // Some user agents provide users the option of preventing persistent storage of cookies across sessions. + // When configured thusly, user agents MUST treat all received cookies as if the persistent-flag were set to false. + if (HTTPManager.EnablePrivateBrowsing) + cookie.IsSession = true; + + // http://tools.ietf.org/html/rfc6265#section-4.1.2.3 + // WARNING: Some existing user agents treat an absent Domain attribute as if the Domain attribute were present and contained the current host name. + // For example, if example.com returns a Set-Cookie header without a Domain attribute, these user agents will erroneously send the cookie to www.example.com as well. + if (string.IsNullOrEmpty(cookie.Domain)) + cookie.Domain = defaultDomain.Host; + + // http://tools.ietf.org/html/rfc6265#section-5.3 section 7: + // If the cookie-attribute-list contains an attribute with an attribute-name of "Path", + // set the cookie's path to attribute-value of the last attribute in the cookie-attribute-list with an attribute-name of "Path". + // __Otherwise, set the cookie's path to the default-path of the request-uri.__ + if (string.IsNullOrEmpty(cookie.Path)) + cookie.Path = defaultDomain.AbsolutePath; + + cookie.Date = cookie.LastAccess = DateTime.UtcNow; + } + catch (Exception ex) + { + HTTPManager.Logger.Warning("Cookie", "Parse - Couldn't parse header: " + header + " exception: " + ex.ToString() + " " + ex.StackTrace); + } + return cookie; + } + + #region Save & Load + + internal void SaveTo(BinaryWriter stream) + { + stream.Write(Version); + stream.Write(Name ?? string.Empty); + stream.Write(Value ?? string.Empty); + stream.Write(Date.ToBinary()); + stream.Write(LastAccess.ToBinary()); + stream.Write(Expires.ToBinary()); + stream.Write(MaxAge); + stream.Write(IsSession); + stream.Write(Domain ?? string.Empty); + stream.Write(Path ?? string.Empty); + stream.Write(IsSecure); + stream.Write(IsHttpOnly); + } + + internal void LoadFrom(BinaryReader stream) + { + /*int version = */stream.ReadInt32(); + this.Name = stream.ReadString(); + this.Value = stream.ReadString(); + this.Date = DateTime.FromBinary(stream.ReadInt64()); + this.LastAccess = DateTime.FromBinary(stream.ReadInt64()); + this.Expires = DateTime.FromBinary(stream.ReadInt64()); + this.MaxAge = stream.ReadInt64(); + this.IsSession = stream.ReadBoolean(); + this.Domain = stream.ReadString(); + this.Path = stream.ReadString(); + this.IsSecure = stream.ReadBoolean(); + this.IsHttpOnly = stream.ReadBoolean(); + } + + #endregion + + #region Overrides and new Equals function + + public override string ToString() + { + return string.Concat(this.Name, "=", this.Value); + } + + public override bool Equals(object obj) + { + if (obj == null) + return false; + + return this.Equals(obj as Cookie); + } + + public bool Equals(Cookie cookie) + { + if (cookie == null) + return false; + + if (Object.ReferenceEquals(this, cookie)) + return true; + + return this.Name.Equals(cookie.Name, StringComparison.Ordinal) && + ((this.Domain == null && cookie.Domain == null) || this.Domain.Equals(cookie.Domain, StringComparison.Ordinal)) && + ((this.Path == null && cookie.Path == null) || this.Path.Equals(cookie.Path, StringComparison.Ordinal)); + } + + public override int GetHashCode() + { + return this.ToString().GetHashCode(); + } + + #endregion + + #region Private Helper Functions + + private static string ReadValue(string str, ref int pos) + { + string result = string.Empty; + if (str == null) + return result; + + return str.Read(ref pos, ';'); + } + + private static List ParseCookieHeader(string str) + { + List result = new List(); + + if (str == null) + return result; + + int idx = 0; + + // process the rest of the text + while (idx < str.Length) + { + // Read key + string key = str.Read(ref idx, (ch) => ch != '=' && ch != ';').Trim(); + HeaderValue qp = new HeaderValue(key); + + if (idx < str.Length && str[idx - 1] == '=') + qp.Value = ReadValue(str, ref idx); + + result.Add(qp); + } + + return result; + } + + #endregion + + #region IComparable implementation + + public int CompareTo(Cookie other) + { + return this.LastAccess.CompareTo(other.LastAccess); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/Cookie.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/Cookie.cs.meta new file mode 100644 index 00000000..cee7bf16 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/Cookie.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3c89f8c2ca77c56448d03216927e0546 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/CookieJar.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/CookieJar.cs new file mode 100644 index 00000000..95c6aba9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/CookieJar.cs @@ -0,0 +1,489 @@ +#if !BESTHTTP_DISABLE_COOKIES + +using BestHTTP.PlatformSupport.FileSystem; +using System; +using System.Collections.Generic; + +namespace BestHTTP.Cookies +{ + /// + /// The Cookie Jar implementation based on RFC 6265(http://tools.ietf.org/html/rfc6265). + /// + public static class CookieJar + { + // Version of the cookie store. It may be used in a future version for maintaining compatibility. + private const int Version = 1; + + /// + /// Returns true if File apis are supported. + /// + public static bool IsSavingSupported + { + get + { +#if !BESTHTTP_DISABLE_COOKIE_SAVE + if (IsSupportCheckDone) + return _isSavingSupported; + + try + { + HTTPManager.IOService.DirectoryExists(HTTPManager.GetRootCacheFolder()); + _isSavingSupported = true; + } + catch + { + _isSavingSupported = false; + + HTTPManager.Logger.Warning("CookieJar", "Cookie saving and loading disabled!"); + } + finally + { + IsSupportCheckDone = true; + } + + return _isSavingSupported; +#else + return false; +#endif + } + } + + /// + /// The plugin will delete cookies that are accessed this threshold ago. Its default value is 7 days. + /// + public static TimeSpan AccessThreshold = TimeSpan.FromDays(7); + +#region Privates + + /// + /// List of the Cookies + /// + private static List Cookies = new List(); + private static string CookieFolder { get; set; } + private static string LibraryPath { get; set; } + + /// + /// Synchronization object for thread safety. + /// + private static object Locker = new object(); + +#if !BESTHTTP_DISABLE_COOKIE_SAVE + private static bool _isSavingSupported; + private static bool IsSupportCheckDone; +#endif + + private static bool Loaded; +#endregion + +#region Internal Functions + + internal static void SetupFolder() + { +#if !BESTHTTP_DISABLE_COOKIE_SAVE + if (!CookieJar.IsSavingSupported) + return; + + try + { + if (string.IsNullOrEmpty(CookieFolder) || string.IsNullOrEmpty(LibraryPath)) + { + CookieFolder = System.IO.Path.Combine(HTTPManager.GetRootCacheFolder(), "Cookies"); + LibraryPath = System.IO.Path.Combine(CookieFolder, "Library"); + } + } + catch + { } +#endif + } + + /// + /// Will set or update all cookies from the response object. + /// + internal static void Set(HTTPResponse response) + { + if (response == null) + return; + + lock(Locker) + { + try + { + Maintain(); + + List newCookies = new List(); + var setCookieHeaders = response.GetHeaderValues("set-cookie"); + + // No cookies. :'( + if (setCookieHeaders == null) + return; + + foreach (var cookieHeader in setCookieHeaders) + { + try + { + Cookie cookie = Cookie.Parse(cookieHeader, response.baseRequest.CurrentUri); + + if (cookie != null) + { + int idx; + var old = Find(cookie, out idx); + + // if no value for the cookie or already expired then the server asked us to delete the cookie + bool expired = string.IsNullOrEmpty(cookie.Value) || !cookie.WillExpireInTheFuture(); + + if (!expired) + { + // no old cookie, add it straight to the list + if (old == null) + { + Cookies.Add(cookie); + + newCookies.Add(cookie); + } + else + { + // Update the creation-time of the newly created cookie to match the creation-time of the old-cookie. + cookie.Date = old.Date; + Cookies[idx] = cookie; + + newCookies.Add(cookie); + } + } + else if (idx != -1) // delete the cookie + Cookies.RemoveAt(idx); + } + } + catch + { + // Ignore cookie on error + } + } + + response.Cookies = newCookies; + } + catch + {} + } + } + + /// + /// Deletes all expired or 'old' cookies, and will keep the sum size of cookies under the given size. + /// + internal static void Maintain() + { + // It's not the same as in the rfc: + // http://tools.ietf.org/html/rfc6265#section-5.3 + + lock (Locker) + { + try + { + uint size = 0; + + for (int i = 0; i < Cookies.Count; ) + { + var cookie = Cookies[i]; + + // Remove expired or not used cookies + if (!cookie.WillExpireInTheFuture() || (cookie.LastAccess + AccessThreshold) < DateTime.UtcNow) + Cookies.RemoveAt(i); + else + { + if (!cookie.IsSession) + size += cookie.GuessSize(); + i++; + } + } + + if (size > HTTPManager.CookieJarSize) + { + Cookies.Sort(); + + while (size > HTTPManager.CookieJarSize && Cookies.Count > 0) + { + var cookie = Cookies[0]; + Cookies.RemoveAt(0); + + size -= cookie.GuessSize(); + } + } + } + catch + { } + } + } + + /// + /// Saves the Cookie Jar to a file. + /// + /// Not implemented under Unity WebPlayer + internal static void Persist() + { +#if !BESTHTTP_DISABLE_COOKIE_SAVE + if (!IsSavingSupported) + return; + + lock (Locker) + { + if (!Loaded) + return; + + try + { + // Delete any expired cookie + Maintain(); + + if (!HTTPManager.IOService.DirectoryExists(CookieFolder)) + HTTPManager.IOService.DirectoryCreate(CookieFolder); + + using (var fs = HTTPManager.IOService.CreateFileStream(LibraryPath, FileStreamModes.Create)) + using (var bw = new System.IO.BinaryWriter(fs)) + { + bw.Write(Version); + + // Count how many non-session cookies we have + int count = 0; + foreach (var cookie in Cookies) + if (!cookie.IsSession) + count++; + + bw.Write(count); + + // Save only the persistable cookies + foreach (var cookie in Cookies) + if (!cookie.IsSession) + cookie.SaveTo(bw); + } + } + catch + { } + } +#endif + } + + /// + /// Load previously persisted cookie library from the file. + /// + internal static void Load() + { +#if !BESTHTTP_DISABLE_COOKIE_SAVE + if (!IsSavingSupported) + return; + + lock (Locker) + { + if (Loaded) + return; + + SetupFolder(); + + try + { + Cookies.Clear(); + + if (!HTTPManager.IOService.DirectoryExists(CookieFolder)) + HTTPManager.IOService.DirectoryCreate(CookieFolder); + + if (!HTTPManager.IOService.FileExists(LibraryPath)) + return; + + using (var fs = HTTPManager.IOService.CreateFileStream(LibraryPath, FileStreamModes.Open)) + using (var br = new System.IO.BinaryReader(fs)) + { + /*int version = */br.ReadInt32(); + int cookieCount = br.ReadInt32(); + + for (int i = 0; i < cookieCount; ++i) + { + Cookie cookie = new Cookie(); + cookie.LoadFrom(br); + + if (cookie.WillExpireInTheFuture()) + Cookies.Add(cookie); + } + } + } + catch + { + Cookies.Clear(); + } + finally + { + Loaded = true; + } + } +#endif + } + +#endregion + +#region Public Functions + + /// + /// Returns all Cookies that corresponds to the given Uri. + /// + public static List Get(Uri uri) + { + lock (Locker) + { + Load(); + + List result = null; + + for (int i = 0; i < Cookies.Count; ++i) + { + Cookie cookie = Cookies[i]; + if (cookie.WillExpireInTheFuture() && uri.Host.IndexOf(cookie.Domain) != -1 && uri.AbsolutePath.StartsWith(cookie.Path)) + { + if (result == null) + result = new List(); + + result.Add(cookie); + } + } + + return result; + } + } + + /// + /// Will add a new, or overwrite an old cookie if already exists. + /// + public static void Set(Uri uri, Cookie cookie) + { + Set(cookie); + } + + /// + /// Will add a new, or overwrite an old cookie if already exists. + /// + public static void Set(Cookie cookie) + { + lock (Locker) + { + Load(); + + int idx; + Find(cookie, out idx); + + if (idx >= 0) + Cookies[idx] = cookie; + else + Cookies.Add(cookie); + } + } + + public static List GetAll() + { + lock (Locker) + { + Load(); + + return Cookies; + } + } + + /// + /// Deletes all cookies from the Jar. + /// + public static void Clear() + { + lock (Locker) + { + Load(); + + Cookies.Clear(); + } + } + + /// + /// Removes cookies that older than the given parameter. + /// + public static void Clear(TimeSpan olderThan) + { + lock (Locker) + { + Load(); + + for (int i = 0; i < Cookies.Count; ) + { + var cookie = Cookies[i]; + + // Remove expired or not used cookies + if (!cookie.WillExpireInTheFuture() || (cookie.Date + olderThan) < DateTime.UtcNow) + Cookies.RemoveAt(i); + else + i++; + } + } + } + + /// + /// Removes cookies that matches to the given domain. + /// + public static void Clear(string domain) + { + lock (Locker) + { + Load(); + + for (int i = 0; i < Cookies.Count; ) + { + var cookie = Cookies[i]; + + // Remove expired or not used cookies + if (!cookie.WillExpireInTheFuture() || cookie.Domain.IndexOf(domain) != -1) + Cookies.RemoveAt(i); + else + i++; + } + } + } + + public static void Remove(Uri uri, string name) + { + lock(Locker) + { + Load(); + + for (int i = 0; i < Cookies.Count; ) + { + var cookie = Cookies[i]; + + if (cookie.Name.Equals(name, StringComparison.OrdinalIgnoreCase) && uri.Host.IndexOf(cookie.Domain) != -1) + Cookies.RemoveAt(i); + else + i++; + } + } + } + +#endregion + +#region Private Helper Functions + + /// + /// Find and return a Cookie and his index in the list. + /// + private static Cookie Find(Cookie cookie, out int idx) + { + for (int i = 0; i < Cookies.Count; ++i) + { + Cookie c = Cookies[i]; + + if (c.Equals(cookie)) + { + idx = i; + return c; + } + } + + idx = -1; + return null; + } + +#endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/CookieJar.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/CookieJar.cs.meta new file mode 100644 index 00000000..83631dca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Cookies/CookieJar.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b6b22cd983735ee46908eac3f37eb798 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression.meta new file mode 100644 index 00000000..14dbc3bf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4d4075eb3d5bdee4c9f373d710808d60 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/CRC32.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/CRC32.cs new file mode 100644 index 00000000..a7065d7e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/CRC32.cs @@ -0,0 +1,473 @@ +// CRC32.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2011 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-August-02 18:25:54> +// +// ------------------------------------------------------------------ +// +// This module defines the CRC32 class, which can do the CRC32 algorithm, using +// arbitrary starting polynomials, and bit reversal. The bit reversal is what +// distinguishes this CRC-32 used in BZip2 from the CRC-32 that is used in PKZIP +// files, or GZIP files. This class does both. +// +// ------------------------------------------------------------------ + + +using System; +using Interop = System.Runtime.InteropServices; + +namespace BestHTTP.Decompression.Crc +{ + /// + /// Computes a CRC-32. The CRC-32 algorithm is parameterized - you + /// can set the polynomial and enable or disable bit + /// reversal. This can be used for GZIP, BZip2, or ZIP. + /// + /// + /// This type is used internally by DotNetZip; it is generally not used + /// directly by applications wishing to create, read, or manipulate zip + /// archive files. + /// + + internal class CRC32 + { + /// + /// Indicates the total number of bytes applied to the CRC. + /// + public Int64 TotalBytesRead + { + get + { + return _TotalBytesRead; + } + } + + /// + /// Indicates the current CRC for all blocks slurped in. + /// + public Int32 Crc32Result + { + get + { + return unchecked((Int32)(~_register)); + } + } + + /// + /// Returns the CRC32 for the specified stream. + /// + /// The stream over which to calculate the CRC32 + /// the CRC32 calculation + public Int32 GetCrc32(System.IO.Stream input) + { + return GetCrc32AndCopy(input, null); + } + + /// + /// Returns the CRC32 for the specified stream, and writes the input into the + /// output stream. + /// + /// The stream over which to calculate the CRC32 + /// The stream into which to deflate the input + /// the CRC32 calculation + public Int32 GetCrc32AndCopy(System.IO.Stream input, System.IO.Stream output) + { + if (input == null) + throw new Exception("The input stream must not be null."); + + unchecked + { + byte[] buffer = new byte[BUFFER_SIZE]; + int readSize = BUFFER_SIZE; + + _TotalBytesRead = 0; + int count = input.Read(buffer, 0, readSize); + if (output != null) output.Write(buffer, 0, count); + _TotalBytesRead += count; + while (count > 0) + { + SlurpBlock(buffer, 0, count); + count = input.Read(buffer, 0, readSize); + if (output != null) output.Write(buffer, 0, count); + _TotalBytesRead += count; + } + + return (Int32)(~_register); + } + } + + + /// + /// Get the CRC32 for the given (word,byte) combo. This is a + /// computation defined by PKzip for PKZIP 2.0 (weak) encryption. + /// + /// The word to start with. + /// The byte to combine it with. + /// The CRC-ized result. + public Int32 ComputeCrc32(Int32 W, byte B) + { + return _InternalComputeCrc32((UInt32)W, B); + } + + internal Int32 _InternalComputeCrc32(UInt32 W, byte B) + { + return (Int32)(crc32Table[(W ^ B) & 0xFF] ^ (W >> 8)); + } + + + /// + /// Update the value for the running CRC32 using the given block of bytes. + /// This is useful when using the CRC32() class in a Stream. + /// + /// block of bytes to slurp + /// starting point in the block + /// how many bytes within the block to slurp + public void SlurpBlock(byte[] block, int offset, int count) + { + if (block == null) + throw new Exception("The data buffer must not be null."); + + // bzip algorithm + for (int i = 0; i < count; i++) + { + int x = offset + i; + byte b = block[x]; + if (this.reverseBits) + { + UInt32 temp = (_register >> 24) ^ b; + _register = (_register << 8) ^ crc32Table[temp]; + } + else + { + UInt32 temp = (_register & 0x000000FF) ^ b; + _register = (_register >> 8) ^ crc32Table[temp]; + } + } + _TotalBytesRead += count; + } + + + /// + /// Process one byte in the CRC. + /// + /// the byte to include into the CRC . + public void UpdateCRC(byte b) + { + if (this.reverseBits) + { + UInt32 temp = (_register >> 24) ^ b; + _register = (_register << 8) ^ crc32Table[temp]; + } + else + { + UInt32 temp = (_register & 0x000000FF) ^ b; + _register = (_register >> 8) ^ crc32Table[temp]; + } + } + + /// + /// Process a run of N identical bytes into the CRC. + /// + /// + /// + /// This method serves as an optimization for updating the CRC when a + /// run of identical bytes is found. Rather than passing in a buffer of + /// length n, containing all identical bytes b, this method accepts the + /// byte value and the length of the (virtual) buffer - the length of + /// the run. + /// + /// + /// the byte to include into the CRC. + /// the number of times that byte should be repeated. + public void UpdateCRC(byte b, int n) + { + while (n-- > 0) + { + if (this.reverseBits) + { + uint temp = (_register >> 24) ^ b; + _register = (_register << 8) ^ crc32Table[(temp >= 0) + ? temp + : (temp + 256)]; + } + else + { + UInt32 temp = (_register & 0x000000FF) ^ b; + _register = (_register >> 8) ^ crc32Table[(temp >= 0) + ? temp + : (temp + 256)]; + + } + } + } + + + + private static uint ReverseBits(uint data) + { + unchecked + { + uint ret = data; + ret = (ret & 0x55555555) << 1 | (ret >> 1) & 0x55555555; + ret = (ret & 0x33333333) << 2 | (ret >> 2) & 0x33333333; + ret = (ret & 0x0F0F0F0F) << 4 | (ret >> 4) & 0x0F0F0F0F; + ret = (ret << 24) | ((ret & 0xFF00) << 8) | ((ret >> 8) & 0xFF00) | (ret >> 24); + return ret; + } + } + + private static byte ReverseBits(byte data) + { + unchecked + { + uint u = (uint)data * 0x00020202; + uint m = 0x01044010; + uint s = u & m; + uint t = (u << 2) & (m << 1); + return (byte)((0x01001001 * (s + t)) >> 24); + } + } + + + + private void GenerateLookupTable() + { + crc32Table = new UInt32[256]; + unchecked + { + UInt32 dwCrc; + byte i = 0; + do + { + dwCrc = i; + for (byte j = 8; j > 0; j--) + { + if ((dwCrc & 1) == 1) + { + dwCrc = (dwCrc >> 1) ^ dwPolynomial; + } + else + { + dwCrc >>= 1; + } + } + if (reverseBits) + { + crc32Table[ReverseBits(i)] = ReverseBits(dwCrc); + } + else + { + crc32Table[i] = dwCrc; + } + i++; + } while (i!=0); + } + +#if VERBOSE + Console.WriteLine(); + Console.WriteLine("private static readonly UInt32[] crc32Table = {"); + for (int i = 0; i < crc32Table.Length; i+=4) + { + Console.Write(" "); + for (int j=0; j < 4; j++) + { + Console.Write(" 0x{0:X8}U,", crc32Table[i+j]); + } + Console.WriteLine(); + } + Console.WriteLine("};"); + Console.WriteLine(); +#endif + } + + + private uint gf2_matrix_times(uint[] matrix, uint vec) + { + uint sum = 0; + int i=0; + while (vec != 0) + { + if ((vec & 0x01)== 0x01) + sum ^= matrix[i]; + vec >>= 1; + i++; + } + return sum; + } + + private void gf2_matrix_square(uint[] square, uint[] mat) + { + for (int i = 0; i < 32; i++) + square[i] = gf2_matrix_times(mat, mat[i]); + } + + + + /// + /// Combines the given CRC32 value with the current running total. + /// + /// + /// This is useful when using a divide-and-conquer approach to + /// calculating a CRC. Multiple threads can each calculate a + /// CRC32 on a segment of the data, and then combine the + /// individual CRC32 values at the end. + /// + /// the crc value to be combined with this one + /// the length of data the CRC value was calculated on + public void Combine(int crc, int length) + { + uint[] even = new uint[32]; // even-power-of-two zeros operator + uint[] odd = new uint[32]; // odd-power-of-two zeros operator + + if (length == 0) + return; + + uint crc1= ~_register; + uint crc2= (uint) crc; + + // put operator for one zero bit in odd + odd[0] = this.dwPolynomial; // the CRC-32 polynomial + uint row = 1; + for (int i = 1; i < 32; i++) + { + odd[i] = row; + row <<= 1; + } + + // put operator for two zero bits in even + gf2_matrix_square(even, odd); + + // put operator for four zero bits in odd + gf2_matrix_square(odd, even); + + uint len2 = (uint) length; + + // apply len2 zeros to crc1 (first square will put the operator for one + // zero byte, eight zero bits, in even) + do { + // apply zeros operator for this bit of len2 + gf2_matrix_square(even, odd); + + if ((len2 & 1)== 1) + crc1 = gf2_matrix_times(even, crc1); + len2 >>= 1; + + if (len2 == 0) + break; + + // another iteration of the loop with odd and even swapped + gf2_matrix_square(odd, even); + if ((len2 & 1)==1) + crc1 = gf2_matrix_times(odd, crc1); + len2 >>= 1; + + + } while (len2 != 0); + + crc1 ^= crc2; + + _register= ~crc1; + + //return (int) crc1; + return; + } + + + /// + /// Create an instance of the CRC32 class using the default settings: no + /// bit reversal, and a polynomial of 0xEDB88320. + /// + public CRC32() : this(false) + { + } + + /// + /// Create an instance of the CRC32 class, specifying whether to reverse + /// data bits or not. + /// + /// + /// specify true if the instance should reverse data bits. + /// + /// + /// + /// In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + /// want a CRC32 with compatibility with BZip2, you should pass true + /// here. In the CRC-32 used by GZIP and PKZIP, the bits are not + /// reversed; Therefore if you want a CRC32 with compatibility with + /// those, you should pass false. + /// + /// + public CRC32(bool reverseBits) : + this( unchecked((int)0xEDB88320), reverseBits) + { + } + + + /// + /// Create an instance of the CRC32 class, specifying the polynomial and + /// whether to reverse data bits or not. + /// + /// + /// The polynomial to use for the CRC, expressed in the reversed (LSB) + /// format: the highest ordered bit in the polynomial value is the + /// coefficient of the 0th power; the second-highest order bit is the + /// coefficient of the 1 power, and so on. Expressed this way, the + /// polynomial for the CRC-32C used in IEEE 802.3, is 0xEDB88320. + /// + /// + /// specify true if the instance should reverse data bits. + /// + /// + /// + /// + /// In the CRC-32 used by BZip2, the bits are reversed. Therefore if you + /// want a CRC32 with compatibility with BZip2, you should pass true + /// here for the reverseBits parameter. In the CRC-32 used by + /// GZIP and PKZIP, the bits are not reversed; Therefore if you want a + /// CRC32 with compatibility with those, you should pass false for the + /// reverseBits parameter. + /// + /// + public CRC32(int polynomial, bool reverseBits) + { + this.reverseBits = reverseBits; + this.dwPolynomial = (uint) polynomial; + this.GenerateLookupTable(); + } + + /// + /// Reset the CRC-32 class - clear the CRC "remainder register." + /// + /// + /// + /// Use this when employing a single instance of this class to compute + /// multiple, distinct CRCs on multiple, distinct data blocks. + /// + /// + public void Reset() + { + _register = 0xFFFFFFFFU; + } + + // private member vars + private UInt32 dwPolynomial; + private Int64 _TotalBytesRead; + private bool reverseBits; + private UInt32[] crc32Table; + private const int BUFFER_SIZE = 8192; + private UInt32 _register = 0xFFFFFFFFU; + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/CRC32.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/CRC32.cs.meta new file mode 100644 index 00000000..31284208 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/CRC32.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 16fc99dd9503b7046bed4bfdbbfec3c0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Deflate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Deflate.cs new file mode 100644 index 00000000..e4aac809 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Deflate.cs @@ -0,0 +1,1883 @@ +// Deflate.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-03 19:52:15> +// +// ------------------------------------------------------------------ +// +// This module defines logic for handling the Deflate or compression. +// +// This code is based on multiple sources: +// - the original zlib v1.2.3 source, which is Copyright (C) 1995-2005 Jean-loup Gailly. +// - the original jzlib, which is Copyright (c) 2000-2003 ymnk, JCraft,Inc. +// +// However, this code is significantly different from both. +// The object model is not the same, and many of the behaviors are different. +// +// In keeping with the license for these other works, the copyrights for +// jzlib and zlib are here. +// +// ----------------------------------------------------------------------- +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; + +#pragma warning disable 0675 + +namespace BestHTTP.Decompression.Zlib +{ + + internal enum BlockState + { + NeedMore = 0, // block not completed, need more input or more output + BlockDone, // block flush performed + FinishStarted, // finish started, need only more output at next deflate + FinishDone // finish done, accept no more input or output + } + + internal enum DeflateFlavor + { + Store, + Fast, + Slow + } + + internal sealed class DeflateManager + { + private static readonly int MEM_LEVEL_MAX = 9; + private static readonly int MEM_LEVEL_DEFAULT = 8; + + internal delegate BlockState CompressFunc(FlushType flush); + + internal class Config + { + // Use a faster search when the previous match is longer than this + internal int GoodLength; // reduce lazy search above this match length + + // Attempt to find a better match only when the current match is + // strictly smaller than this value. This mechanism is used only for + // compression levels >= 4. For levels 1,2,3: MaxLazy is actually + // MaxInsertLength. (See DeflateFast) + + internal int MaxLazy; // do not perform lazy search above this match length + + internal int NiceLength; // quit search above this match length + + // To speed up deflation, hash chains are never searched beyond this + // length. A higher limit improves compression ratio but degrades the speed. + + internal int MaxChainLength; + + internal DeflateFlavor Flavor; + + private Config(int goodLength, int maxLazy, int niceLength, int maxChainLength, DeflateFlavor flavor) + { + this.GoodLength = goodLength; + this.MaxLazy = maxLazy; + this.NiceLength = niceLength; + this.MaxChainLength = maxChainLength; + this.Flavor = flavor; + } + + public static Config Lookup(CompressionLevel level) + { + return Table[(int)level]; + } + + + static Config() + { + Table = new Config[] { + new Config(0, 0, 0, 0, DeflateFlavor.Store), + new Config(4, 4, 8, 4, DeflateFlavor.Fast), + new Config(4, 5, 16, 8, DeflateFlavor.Fast), + new Config(4, 6, 32, 32, DeflateFlavor.Fast), + + new Config(4, 4, 16, 16, DeflateFlavor.Slow), + new Config(8, 16, 32, 32, DeflateFlavor.Slow), + new Config(8, 16, 128, 128, DeflateFlavor.Slow), + new Config(8, 32, 128, 256, DeflateFlavor.Slow), + new Config(32, 128, 258, 1024, DeflateFlavor.Slow), + new Config(32, 258, 258, 4096, DeflateFlavor.Slow), + }; + } + + private static readonly Config[] Table; + } + + + private CompressFunc DeflateFunction; + + private static readonly System.String[] _ErrorMessage = new System.String[] + { + "need dictionary", + "stream end", + "", + "file error", + "stream error", + "data error", + "insufficient memory", + "buffer error", + "incompatible version", + "" + }; + + // preset dictionary flag in zlib header + private static readonly int PRESET_DICT = 0x20; + + private static readonly int INIT_STATE = 42; + private static readonly int BUSY_STATE = 113; + private static readonly int FINISH_STATE = 666; + + // The deflate compression method + private static readonly int Z_DEFLATED = 8; + + private static readonly int STORED_BLOCK = 0; + private static readonly int STATIC_TREES = 1; + private static readonly int DYN_TREES = 2; + + // The three kinds of block type + private static readonly int Z_BINARY = 0; + private static readonly int Z_ASCII = 1; + private static readonly int Z_UNKNOWN = 2; + + private static readonly int Buf_size = 8 * 2; + + private static readonly int MIN_MATCH = 3; + private static readonly int MAX_MATCH = 258; + + private static readonly int MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1); + + private static readonly int HEAP_SIZE = (2 * InternalConstants.L_CODES + 1); + + private static readonly int END_BLOCK = 256; + + internal ZlibCodec _codec; // the zlib encoder/decoder + internal int status; // as the name implies + internal byte[] pending; // output still pending - waiting to be compressed + internal int nextPending; // index of next pending byte to output to the stream + internal int pendingCount; // number of bytes in the pending buffer + + internal sbyte data_type; // UNKNOWN, BINARY or ASCII + internal int last_flush; // value of flush param for previous deflate call + + internal int w_size; // LZ77 window size (32K by default) + internal int w_bits; // log2(w_size) (8..16) + internal int w_mask; // w_size - 1 + + //internal byte[] dictionary; + internal byte[] window; + + // Sliding window. Input bytes are read into the second half of the window, + // and move to the first half later to keep a dictionary of at least wSize + // bytes. With this organization, matches are limited to a distance of + // wSize-MAX_MATCH bytes, but this ensures that IO is always + // performed with a length multiple of the block size. + // + // To do: use the user input buffer as sliding window. + + internal int window_size; + // Actual size of window: 2*wSize, except when the user input buffer + // is directly used as sliding window. + + internal short[] prev; + // Link to older string with same hash index. To limit the size of this + // array to 64K, this link is maintained only for the last 32K strings. + // An index in this array is thus a window index modulo 32K. + + internal short[] head; // Heads of the hash chains or NIL. + + internal int ins_h; // hash index of string to be inserted + internal int hash_size; // number of elements in hash table + internal int hash_bits; // log2(hash_size) + internal int hash_mask; // hash_size-1 + + // Number of bits by which ins_h must be shifted at each input + // step. It must be such that after MIN_MATCH steps, the oldest + // byte no longer takes part in the hash key, that is: + // hash_shift * MIN_MATCH >= hash_bits + internal int hash_shift; + + // Window position at the beginning of the current output block. Gets + // negative when the window is moved backwards. + + internal int block_start; + + Config config; + internal int match_length; // length of best match + internal int prev_match; // previous match + internal int match_available; // set if previous match exists + internal int strstart; // start of string to insert into.....???? + internal int match_start; // start of matching string + internal int lookahead; // number of valid bytes ahead in window + + // Length of the best match at previous step. Matches not greater than this + // are discarded. This is used in the lazy match evaluation. + internal int prev_length; + + // Insert new strings in the hash table only if the match length is not + // greater than this length. This saves time but degrades compression. + // max_insert_length is used only for compression levels <= 3. + + internal CompressionLevel compressionLevel; // compression level (1..9) + internal CompressionStrategy compressionStrategy; // favor or force Huffman coding + + + internal short[] dyn_ltree; // literal and length tree + internal short[] dyn_dtree; // distance tree + internal short[] bl_tree; // Huffman tree for bit lengths + + internal ZTree treeLiterals = new ZTree(); // desc for literal tree + internal ZTree treeDistances = new ZTree(); // desc for distance tree + internal ZTree treeBitLengths = new ZTree(); // desc for bit length tree + + // number of codes at each bit length for an optimal tree + internal short[] bl_count = new short[InternalConstants.MAX_BITS + 1]; + + // heap used to build the Huffman trees + internal int[] heap = new int[2 * InternalConstants.L_CODES + 1]; + + internal int heap_len; // number of elements in the heap + internal int heap_max; // element of largest frequency + + // The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + // The same heap array is used to build all trees. + + // Depth of each subtree used as tie breaker for trees of equal frequency + internal sbyte[] depth = new sbyte[2 * InternalConstants.L_CODES + 1]; + + internal int _lengthOffset; // index for literals or lengths + + + // Size of match buffer for literals/lengths. There are 4 reasons for + // limiting lit_bufsize to 64K: + // - frequencies can be kept in 16 bit counters + // - if compression is not successful for the first block, all input + // data is still in the window so we can still emit a stored block even + // when input comes from standard input. (This can also be done for + // all blocks if lit_bufsize is not greater than 32K.) + // - if compression is not successful for a file smaller than 64K, we can + // even emit a stored file instead of a stored block (saving 5 bytes). + // This is applicable only for zip (not gzip or zlib). + // - creating new Huffman trees less frequently may not provide fast + // adaptation to changes in the input data statistics. (Take for + // example a binary file with poorly compressible code followed by + // a highly compressible string table.) Smaller buffer sizes give + // fast adaptation but have of course the overhead of transmitting + // trees more frequently. + + internal int lit_bufsize; + + internal int last_lit; // running index in l_buf + + // Buffer for distances. To simplify the code, d_buf and l_buf have + // the same number of elements. To use different lengths, an extra flag + // array would be necessary. + + internal int _distanceOffset; // index into pending; points to distance data?? + + internal int opt_len; // bit length of current block with optimal trees + internal int static_len; // bit length of current block with static trees + internal int matches; // number of string matches in current block + internal int last_eob_len; // bit length of EOB code for last block + + // Output buffer. bits are inserted starting at the bottom (least + // significant bits). + internal short bi_buf; + + // Number of valid bits in bi_buf. All bits above the last valid bit + // are always zero. + internal int bi_valid; + + + internal DeflateManager() + { + dyn_ltree = new short[HEAP_SIZE * 2]; + dyn_dtree = new short[(2 * InternalConstants.D_CODES + 1) * 2]; // distance tree + bl_tree = new short[(2 * InternalConstants.BL_CODES + 1) * 2]; // Huffman tree for bit lengths + } + + + // lm_init + private void _InitializeLazyMatch() + { + window_size = 2 * w_size; + + // clear the hash - workitem 9063 + Array.Clear(head, 0, hash_size); + //for (int i = 0; i < hash_size; i++) head[i] = 0; + + config = Config.Lookup(compressionLevel); + SetDeflater(); + + strstart = 0; + block_start = 0; + lookahead = 0; + match_length = prev_length = MIN_MATCH - 1; + match_available = 0; + ins_h = 0; + } + + // Initialize the tree data structures for a new zlib stream. + private void _InitializeTreeData() + { + treeLiterals.dyn_tree = dyn_ltree; + treeLiterals.staticTree = StaticTree.Literals; + + treeDistances.dyn_tree = dyn_dtree; + treeDistances.staticTree = StaticTree.Distances; + + treeBitLengths.dyn_tree = bl_tree; + treeBitLengths.staticTree = StaticTree.BitLengths; + + bi_buf = 0; + bi_valid = 0; + last_eob_len = 8; // enough lookahead for inflate + + // Initialize the first block of the first file: + _InitializeBlocks(); + } + + internal void _InitializeBlocks() + { + // Initialize the trees. + for (int i = 0; i < InternalConstants.L_CODES; i++) + dyn_ltree[i * 2] = 0; + for (int i = 0; i < InternalConstants.D_CODES; i++) + dyn_dtree[i * 2] = 0; + for (int i = 0; i < InternalConstants.BL_CODES; i++) + bl_tree[i * 2] = 0; + + dyn_ltree[END_BLOCK * 2] = 1; + opt_len = static_len = 0; + last_lit = matches = 0; + } + + // Restore the heap property by moving down the tree starting at node k, + // exchanging a node with the smallest of its two sons if necessary, stopping + // when the heap property is re-established (each father smaller than its + // two sons). + internal void pqdownheap(short[] tree, int k) + { + int v = heap[k]; + int j = k << 1; // left son of k + while (j <= heap_len) + { + // Set j to the smallest of the two sons: + if (j < heap_len && _IsSmaller(tree, heap[j + 1], heap[j], depth)) + { + j++; + } + // Exit if v is smaller than both sons + if (_IsSmaller(tree, v, heap[j], depth)) + break; + + // Exchange v with the smallest son + heap[k] = heap[j]; k = j; + // And continue down the tree, setting j to the left son of k + j <<= 1; + } + heap[k] = v; + } + + internal static bool _IsSmaller(short[] tree, int n, int m, sbyte[] depth) + { + short tn2 = tree[n * 2]; + short tm2 = tree[m * 2]; + return (tn2 < tm2 || (tn2 == tm2 && depth[n] <= depth[m])); + } + + + // Scan a literal or distance tree to determine the frequencies of the codes + // in the bit length tree. + internal void scan_tree(short[] tree, int max_code) + { + int n; // iterates over all tree elements + int prevlen = -1; // last emitted length + int curlen; // length of current code + int nextlen = (int)tree[0 * 2 + 1]; // length of next code + int count = 0; // repeat count of the current code + int max_count = 7; // max repeat count + int min_count = 4; // min repeat count + + if (nextlen == 0) + { + max_count = 138; min_count = 3; + } + tree[(max_code + 1) * 2 + 1] = (short)0x7fff; // guard //?? + + for (n = 0; n <= max_code; n++) + { + curlen = nextlen; nextlen = (int)tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen == nextlen) + { + continue; + } + else if (count < min_count) + { + bl_tree[curlen * 2] = (short)(bl_tree[curlen * 2] + count); + } + else if (curlen != 0) + { + if (curlen != prevlen) + bl_tree[curlen * 2]++; + bl_tree[InternalConstants.REP_3_6 * 2]++; + } + else if (count <= 10) + { + bl_tree[InternalConstants.REPZ_3_10 * 2]++; + } + else + { + bl_tree[InternalConstants.REPZ_11_138 * 2]++; + } + count = 0; prevlen = curlen; + if (nextlen == 0) + { + max_count = 138; min_count = 3; + } + else if (curlen == nextlen) + { + max_count = 6; min_count = 3; + } + else + { + max_count = 7; min_count = 4; + } + } + } + + // Construct the Huffman tree for the bit lengths and return the index in + // bl_order of the last bit length code to send. + internal int build_bl_tree() + { + int max_blindex; // index of last bit length code of non zero freq + + // Determine the bit length frequencies for literal and distance trees + scan_tree(dyn_ltree, treeLiterals.max_code); + scan_tree(dyn_dtree, treeDistances.max_code); + + // Build the bit length tree: + treeBitLengths.build_tree(this); + // opt_len now includes the length of the tree representations, except + // the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + + // Determine the number of bit length codes to send. The pkzip format + // requires that at least 4 bit length codes be sent. (appnote.txt says + // 3 but the actual value used is 4.) + for (max_blindex = InternalConstants.BL_CODES - 1; max_blindex >= 3; max_blindex--) + { + if (bl_tree[ZTree.bl_order[max_blindex] * 2 + 1] != 0) + break; + } + // Update opt_len to include the bit length tree and counts + opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + + return max_blindex; + } + + + // Send the header for a block using dynamic Huffman trees: the counts, the + // lengths of the bit length codes, the literal tree and the distance tree. + // IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + internal void send_all_trees(int lcodes, int dcodes, int blcodes) + { + int rank; // index in bl_order + + send_bits(lcodes - 257, 5); // not +255 as stated in appnote.txt + send_bits(dcodes - 1, 5); + send_bits(blcodes - 4, 4); // not -3 as stated in appnote.txt + for (rank = 0; rank < blcodes; rank++) + { + send_bits(bl_tree[ZTree.bl_order[rank] * 2 + 1], 3); + } + send_tree(dyn_ltree, lcodes - 1); // literal tree + send_tree(dyn_dtree, dcodes - 1); // distance tree + } + + // Send a literal or distance tree in compressed form, using the codes in + // bl_tree. + internal void send_tree(short[] tree, int max_code) + { + int n; // iterates over all tree elements + int prevlen = -1; // last emitted length + int curlen; // length of current code + int nextlen = tree[0 * 2 + 1]; // length of next code + int count = 0; // repeat count of the current code + int max_count = 7; // max repeat count + int min_count = 4; // min repeat count + + if (nextlen == 0) + { + max_count = 138; min_count = 3; + } + + for (n = 0; n <= max_code; n++) + { + curlen = nextlen; nextlen = tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen == nextlen) + { + continue; + } + else if (count < min_count) + { + do + { + send_code(curlen, bl_tree); + } + while (--count != 0); + } + else if (curlen != 0) + { + if (curlen != prevlen) + { + send_code(curlen, bl_tree); count--; + } + send_code(InternalConstants.REP_3_6, bl_tree); + send_bits(count - 3, 2); + } + else if (count <= 10) + { + send_code(InternalConstants.REPZ_3_10, bl_tree); + send_bits(count - 3, 3); + } + else + { + send_code(InternalConstants.REPZ_11_138, bl_tree); + send_bits(count - 11, 7); + } + count = 0; prevlen = curlen; + if (nextlen == 0) + { + max_count = 138; min_count = 3; + } + else if (curlen == nextlen) + { + max_count = 6; min_count = 3; + } + else + { + max_count = 7; min_count = 4; + } + } + } + + // Output a block of bytes on the stream. + // IN assertion: there is enough room in pending_buf. + private void put_bytes(byte[] p, int start, int len) + { + Array.Copy(p, start, pending, pendingCount, len); + pendingCount += len; + } + +#if NOTNEEDED + private void put_byte(byte c) + { + pending[pendingCount++] = c; + } + internal void put_short(int b) + { + unchecked + { + pending[pendingCount++] = (byte)b; + pending[pendingCount++] = (byte)(b >> 8); + } + } + internal void putShortMSB(int b) + { + unchecked + { + pending[pendingCount++] = (byte)(b >> 8); + pending[pendingCount++] = (byte)b; + } + } +#endif + + internal void send_code(int c, short[] tree) + { + int c2 = c * 2; + send_bits((tree[c2] & 0xffff), (tree[c2 + 1] & 0xffff)); + } + + internal void send_bits(int value, int length) + { + int len = length; + unchecked + { + if (bi_valid > (int)Buf_size - len) + { + //int val = value; + // bi_buf |= (val << bi_valid); + + bi_buf |= (short)((value << bi_valid) & 0xffff); + //put_short(bi_buf); + pending[pendingCount++] = (byte)bi_buf; + pending[pendingCount++] = (byte)(bi_buf >> 8); + + + bi_buf = (short)((uint)value >> (Buf_size - bi_valid)); + bi_valid += len - Buf_size; + } + else + { + // bi_buf |= (value) << bi_valid; + bi_buf |= (short)((value << bi_valid) & 0xffff); + bi_valid += len; + } + } + } + + // Send one empty static block to give enough lookahead for inflate. + // This takes 10 bits, of which 7 may remain in the bit buffer. + // The current inflate code requires 9 bits of lookahead. If the + // last two codes for the previous block (real code plus EOB) were coded + // on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode + // the last real code. In this case we send two empty static blocks instead + // of one. (There are no problems if the previous block is stored or fixed.) + // To simplify the code, we assume the worst case of last real code encoded + // on one bit only. + internal void _tr_align() + { + send_bits(STATIC_TREES << 1, 3); + send_code(END_BLOCK, StaticTree.lengthAndLiteralsTreeCodes); + + bi_flush(); + + // Of the 10 bits for the empty block, we have already sent + // (10 - bi_valid) bits. The lookahead for the last real code (before + // the EOB of the previous block) was thus at least one plus the length + // of the EOB plus what we have just sent of the empty static block. + if (1 + last_eob_len + 10 - bi_valid < 9) + { + send_bits(STATIC_TREES << 1, 3); + send_code(END_BLOCK, StaticTree.lengthAndLiteralsTreeCodes); + bi_flush(); + } + last_eob_len = 7; + } + + + // Save the match info and tally the frequency counts. Return true if + // the current block must be flushed. + internal bool _tr_tally(int dist, int lc) + { + pending[_distanceOffset + last_lit * 2] = unchecked((byte) ( (uint)dist >> 8 ) ); + pending[_distanceOffset + last_lit * 2 + 1] = unchecked((byte)dist); + pending[_lengthOffset + last_lit] = unchecked((byte)lc); + last_lit++; + + if (dist == 0) + { + // lc is the unmatched char + dyn_ltree[lc * 2]++; + } + else + { + matches++; + // Here, lc is the match length - MIN_MATCH + dist--; // dist = match distance - 1 + dyn_ltree[(ZTree.LengthCode[lc] + InternalConstants.LITERALS + 1) * 2]++; + dyn_dtree[ZTree.DistanceCode(dist) * 2]++; + } + + if ((last_lit & 0x1fff) == 0 && (int)compressionLevel > 2) + { + // Compute an upper bound for the compressed length + int out_length = last_lit << 3; + int in_length = strstart - block_start; + int dcode; + for (dcode = 0; dcode < InternalConstants.D_CODES; dcode++) + { + out_length = (int)(out_length + (int)dyn_dtree[dcode * 2] * (5L + ZTree.ExtraDistanceBits[dcode])); + } + out_length >>= 3; + if ((matches < (last_lit / 2)) && out_length < in_length / 2) + return true; + } + + return (last_lit == lit_bufsize - 1) || (last_lit == lit_bufsize); + // dinoch - wraparound? + // We avoid equality with lit_bufsize because of wraparound at 64K + // on 16 bit machines and because stored blocks are restricted to + // 64K-1 bytes. + } + + + + // Send the block data compressed using the given Huffman trees + internal void send_compressed_block(short[] ltree, short[] dtree) + { + int distance; // distance of matched string + int lc; // match length or unmatched char (if dist == 0) + int lx = 0; // running index in l_buf + int code; // the code to send + int extra; // number of extra bits to send + + if (last_lit != 0) + { + do + { + int ix = _distanceOffset + lx * 2; + distance = ((pending[ix] << 8) & 0xff00) | + (pending[ix + 1] & 0xff); + lc = (pending[_lengthOffset + lx]) & 0xff; + lx++; + + if (distance == 0) + { + send_code(lc, ltree); // send a literal byte + } + else + { + // literal or match pair + // Here, lc is the match length - MIN_MATCH + code = ZTree.LengthCode[lc]; + + // send the length code + send_code(code + InternalConstants.LITERALS + 1, ltree); + extra = ZTree.ExtraLengthBits[code]; + if (extra != 0) + { + // send the extra length bits + lc -= ZTree.LengthBase[code]; + send_bits(lc, extra); + } + distance--; // dist is now the match distance - 1 + code = ZTree.DistanceCode(distance); + + // send the distance code + send_code(code, dtree); + + extra = ZTree.ExtraDistanceBits[code]; + if (extra != 0) + { + // send the extra distance bits + distance -= ZTree.DistanceBase[code]; + send_bits(distance, extra); + } + } + + // Check that the overlay between pending and d_buf+l_buf is ok: + } + while (lx < last_lit); + } + + send_code(END_BLOCK, ltree); + last_eob_len = ltree[END_BLOCK * 2 + 1]; + } + + + + // Set the data type to ASCII or BINARY, using a crude approximation: + // binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. + // IN assertion: the fields freq of dyn_ltree are set and the total of all + // frequencies does not exceed 64K (to fit in an int on 16 bit machines). + internal void set_data_type() + { + int n = 0; + int ascii_freq = 0; + int bin_freq = 0; + while (n < 7) + { + bin_freq += dyn_ltree[n * 2]; n++; + } + while (n < 128) + { + ascii_freq += dyn_ltree[n * 2]; n++; + } + while (n < InternalConstants.LITERALS) + { + bin_freq += dyn_ltree[n * 2]; n++; + } + data_type = (sbyte)(bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); + } + + + + // Flush the bit buffer, keeping at most 7 bits in it. + internal void bi_flush() + { + if (bi_valid == 16) + { + pending[pendingCount++] = (byte)bi_buf; + pending[pendingCount++] = (byte)(bi_buf >> 8); + bi_buf = 0; + bi_valid = 0; + } + else if (bi_valid >= 8) + { + //put_byte((byte)bi_buf); + pending[pendingCount++] = (byte)bi_buf; + bi_buf >>= 8; + bi_valid -= 8; + } + } + + // Flush the bit buffer and align the output on a byte boundary + internal void bi_windup() + { + if (bi_valid > 8) + { + pending[pendingCount++] = (byte)bi_buf; + pending[pendingCount++] = (byte)(bi_buf >> 8); + } + else if (bi_valid > 0) + { + //put_byte((byte)bi_buf); + pending[pendingCount++] = (byte)bi_buf; + } + bi_buf = 0; + bi_valid = 0; + } + + // Copy a stored block, storing first the length and its + // one's complement if requested. + internal void copy_block(int buf, int len, bool header) + { + bi_windup(); // align on byte boundary + last_eob_len = 8; // enough lookahead for inflate + + if (header) + unchecked + { + //put_short((short)len); + pending[pendingCount++] = (byte)len; + pending[pendingCount++] = (byte)(len >> 8); + //put_short((short)~len); + pending[pendingCount++] = (byte)~len; + pending[pendingCount++] = (byte)(~len >> 8); + } + + put_bytes(window, buf, len); + } + + internal void flush_block_only(bool eof) + { + _tr_flush_block(block_start >= 0 ? block_start : -1, strstart - block_start, eof); + block_start = strstart; + _codec.flush_pending(); + } + + // Copy without compression as much as possible from the input stream, return + // the current block state. + // This function does not insert new strings in the dictionary since + // uncompressible data is probably not useful. This function is used + // only for the level=0 compression option. + // NOTE: this function should be optimized to avoid extra copying from + // window to pending_buf. + internal BlockState DeflateNone(FlushType flush) + { + // Stored blocks are limited to 0xffff bytes, pending is limited + // to pending_buf_size, and each stored block has a 5 byte header: + + int max_block_size = 0xffff; + int max_start; + + if (max_block_size > pending.Length - 5) + { + max_block_size = pending.Length - 5; + } + + // Copy as much as possible from input to output: + while (true) + { + // Fill the window as much as possible: + if (lookahead <= 1) + { + _fillWindow(); + if (lookahead == 0 && flush == FlushType.None) + return BlockState.NeedMore; + if (lookahead == 0) + break; // flush the current block + } + + strstart += lookahead; + lookahead = 0; + + // Emit a stored block if pending will be full: + max_start = block_start + max_block_size; + if (strstart == 0 || strstart >= max_start) + { + // strstart == 0 is possible when wraparound on 16-bit machine + lookahead = (int)(strstart - max_start); + strstart = (int)max_start; + + flush_block_only(false); + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + + // Flush if we may have to slide, otherwise block_start may become + // negative and the data will be gone: + if (strstart - block_start >= w_size - MIN_LOOKAHEAD) + { + flush_block_only(false); + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + } + + flush_block_only(flush == FlushType.Finish); + if (_codec.AvailableBytesOut == 0) + return (flush == FlushType.Finish) ? BlockState.FinishStarted : BlockState.NeedMore; + + return flush == FlushType.Finish ? BlockState.FinishDone : BlockState.BlockDone; + } + + + // Send a stored block + internal void _tr_stored_block(int buf, int stored_len, bool eof) + { + send_bits((STORED_BLOCK << 1) + (eof ? 1 : 0), 3); // send block type + copy_block(buf, stored_len, true); // with header + } + + // Determine the best encoding for the current block: dynamic trees, static + // trees or store, and output the encoded block to the zip file. + internal void _tr_flush_block(int buf, int stored_len, bool eof) + { + int opt_lenb, static_lenb; // opt_len and static_len in bytes + int max_blindex = 0; // index of last bit length code of non zero freq + + // Build the Huffman trees unless a stored block is forced + if (compressionLevel > 0) + { + // Check if the file is ascii or binary + if (data_type == Z_UNKNOWN) + set_data_type(); + + // Construct the literal and distance trees + treeLiterals.build_tree(this); + + treeDistances.build_tree(this); + + // At this point, opt_len and static_len are the total bit lengths of + // the compressed block data, excluding the tree representations. + + // Build the bit length tree for the above two trees, and get the index + // in bl_order of the last bit length code to send. + max_blindex = build_bl_tree(); + + // Determine the best encoding. Compute first the block length in bytes + opt_lenb = (opt_len + 3 + 7) >> 3; + static_lenb = (static_len + 3 + 7) >> 3; + + if (static_lenb <= opt_lenb) + opt_lenb = static_lenb; + } + else + { + opt_lenb = static_lenb = stored_len + 5; // force a stored block + } + + if (stored_len + 4 <= opt_lenb && buf != -1) + { + // 4: two words for the lengths + // The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + // Otherwise we can't have processed more than WSIZE input bytes since + // the last block flush, because compression would have been + // successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + // transform a block into a stored block. + _tr_stored_block(buf, stored_len, eof); + } + else if (static_lenb == opt_lenb) + { + send_bits((STATIC_TREES << 1) + (eof ? 1 : 0), 3); + send_compressed_block(StaticTree.lengthAndLiteralsTreeCodes, StaticTree.distTreeCodes); + } + else + { + send_bits((DYN_TREES << 1) + (eof ? 1 : 0), 3); + send_all_trees(treeLiterals.max_code + 1, treeDistances.max_code + 1, max_blindex + 1); + send_compressed_block(dyn_ltree, dyn_dtree); + } + + // The above check is made mod 2^32, for files larger than 512 MB + // and uLong implemented on 32 bits. + + _InitializeBlocks(); + + if (eof) + { + bi_windup(); + } + } + + // Fill the window when the lookahead becomes insufficient. + // Updates strstart and lookahead. + // + // IN assertion: lookahead < MIN_LOOKAHEAD + // OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + // At least one byte has been read, or avail_in == 0; reads are + // performed for at least two bytes (required for the zip translate_eol + // option -- not supported here). + private void _fillWindow() + { + int n, m; + int p; + int more; // Amount of free space at the end of the window. + + do + { + more = (window_size - lookahead - strstart); + + // Deal with !@#$% 64K limit: + if (more == 0 && strstart == 0 && lookahead == 0) + { + more = w_size; + } + else if (more == -1) + { + // Very unlikely, but possible on 16 bit machine if strstart == 0 + // and lookahead == 1 (input done one byte at time) + more--; + + // If the window is almost full and there is insufficient lookahead, + // move the upper half to the lower one to make room in the upper half. + } + else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) + { + Array.Copy(window, w_size, window, 0, w_size); + match_start -= w_size; + strstart -= w_size; // we now have strstart >= MAX_DIST + block_start -= w_size; + + // Slide the hash table (could be avoided with 32 bit values + // at the expense of memory usage). We slide even when level == 0 + // to keep the hash table consistent if we switch back to level > 0 + // later. (Using level 0 permanently is not an optimal usage of + // zlib, so we don't care about this pathological case.) + + n = hash_size; + p = n; + do + { + m = (head[--p] & 0xffff); + head[p] = (short)((m >= w_size) ? (m - w_size) : 0); + } + while (--n != 0); + + n = w_size; + p = n; + do + { + m = (prev[--p] & 0xffff); + prev[p] = (short)((m >= w_size) ? (m - w_size) : 0); + // If n is not on any hash chain, prev[n] is garbage but + // its value will never be used. + } + while (--n != 0); + more += w_size; + } + + if (_codec.AvailableBytesIn == 0) + return; + + // If there was no sliding: + // strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + // more == window_size - lookahead - strstart + // => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + // => more >= window_size - 2*WSIZE + 2 + // In the BIG_MEM or MMAP case (not yet supported), + // window_size == input_size + MIN_LOOKAHEAD && + // strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + // Otherwise, window_size == 2*WSIZE so more >= 2. + // If there was sliding, more >= WSIZE. So in all cases, more >= 2. + + n = _codec.read_buf(window, strstart + lookahead, more); + lookahead += n; + + // Initialize the hash value now that we have some input: + if (lookahead >= MIN_MATCH) + { + ins_h = window[strstart] & 0xff; + ins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask; + } + // If the whole input has less than MIN_MATCH bytes, ins_h is garbage, + // but this is not important since only literal bytes will be emitted. + } + while (lookahead < MIN_LOOKAHEAD && _codec.AvailableBytesIn != 0); + } + + // Compress as much as possible from the input stream, return the current + // block state. + // This function does not perform lazy evaluation of matches and inserts + // new strings in the dictionary only for unmatched strings or for short + // matches. It is used only for the fast compression options. + internal BlockState DeflateFast(FlushType flush) + { + // short hash_head = 0; // head of the hash chain + int hash_head = 0; // head of the hash chain + bool bflush; // set if current block must be flushed + + while (true) + { + // Make sure that we always have enough lookahead, except + // at the end of the input file. We need MAX_MATCH bytes + // for the next match, plus MIN_MATCH bytes to insert the + // string following the next match. + if (lookahead < MIN_LOOKAHEAD) + { + _fillWindow(); + if (lookahead < MIN_LOOKAHEAD && flush == FlushType.None) + { + return BlockState.NeedMore; + } + if (lookahead == 0) + break; // flush the current block + } + + // Insert the string window[strstart .. strstart+2] in the + // dictionary, and set hash_head to the head of the hash chain: + if (lookahead >= MIN_MATCH) + { + ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + + // prev[strstart&w_mask]=hash_head=head[ins_h]; + hash_head = (head[ins_h] & 0xffff); + prev[strstart & w_mask] = head[ins_h]; + head[ins_h] = unchecked((short)strstart); + } + + // Find the longest match, discarding those <= prev_length. + // At this point we have always match_length < MIN_MATCH + + if (hash_head != 0L && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) + { + // To simplify the code, we prevent matches with the string + // of window index 0 (in particular we have to avoid a match + // of the string with itself at the start of the input file). + if (compressionStrategy != CompressionStrategy.HuffmanOnly) + { + match_length = longest_match(hash_head); + } + // longest_match() sets match_start + } + if (match_length >= MIN_MATCH) + { + // check_match(strstart, match_start, match_length); + + bflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH); + + lookahead -= match_length; + + // Insert new strings in the hash table only if the match length + // is not too large. This saves time but degrades compression. + if (match_length <= config.MaxLazy && lookahead >= MIN_MATCH) + { + match_length--; // string at strstart already in hash table + do + { + strstart++; + + ins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + // prev[strstart&w_mask]=hash_head=head[ins_h]; + hash_head = (head[ins_h] & 0xffff); + prev[strstart & w_mask] = head[ins_h]; + head[ins_h] = unchecked((short)strstart); + + // strstart never exceeds WSIZE-MAX_MATCH, so there are + // always MIN_MATCH bytes ahead. + } + while (--match_length != 0); + strstart++; + } + else + { + strstart += match_length; + match_length = 0; + ins_h = window[strstart] & 0xff; + + ins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask; + // If lookahead < MIN_MATCH, ins_h is garbage, but it does not + // matter since it will be recomputed at next deflate call. + } + } + else + { + // No match, output a literal byte + + bflush = _tr_tally(0, window[strstart] & 0xff); + lookahead--; + strstart++; + } + if (bflush) + { + flush_block_only(false); + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + } + + flush_block_only(flush == FlushType.Finish); + if (_codec.AvailableBytesOut == 0) + { + if (flush == FlushType.Finish) + return BlockState.FinishStarted; + else + return BlockState.NeedMore; + } + return flush == FlushType.Finish ? BlockState.FinishDone : BlockState.BlockDone; + } + + // Same as above, but achieves better compression. We use a lazy + // evaluation for matches: a match is finally adopted only if there is + // no better match at the next window position. + internal BlockState DeflateSlow(FlushType flush) + { + // short hash_head = 0; // head of hash chain + int hash_head = 0; // head of hash chain + bool bflush; // set if current block must be flushed + + // Process the input block. + while (true) + { + // Make sure that we always have enough lookahead, except + // at the end of the input file. We need MAX_MATCH bytes + // for the next match, plus MIN_MATCH bytes to insert the + // string following the next match. + + if (lookahead < MIN_LOOKAHEAD) + { + _fillWindow(); + if (lookahead < MIN_LOOKAHEAD && flush == FlushType.None) + return BlockState.NeedMore; + + if (lookahead == 0) + break; // flush the current block + } + + // Insert the string window[strstart .. strstart+2] in the + // dictionary, and set hash_head to the head of the hash chain: + + if (lookahead >= MIN_MATCH) + { + ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + // prev[strstart&w_mask]=hash_head=head[ins_h]; + hash_head = (head[ins_h] & 0xffff); + prev[strstart & w_mask] = head[ins_h]; + head[ins_h] = unchecked((short)strstart); + } + + // Find the longest match, discarding those <= prev_length. + prev_length = match_length; + prev_match = match_start; + match_length = MIN_MATCH - 1; + + if (hash_head != 0 && prev_length < config.MaxLazy && + ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) + { + // To simplify the code, we prevent matches with the string + // of window index 0 (in particular we have to avoid a match + // of the string with itself at the start of the input file). + + if (compressionStrategy != CompressionStrategy.HuffmanOnly) + { + match_length = longest_match(hash_head); + } + // longest_match() sets match_start + + if (match_length <= 5 && (compressionStrategy == CompressionStrategy.Filtered || + (match_length == MIN_MATCH && strstart - match_start > 4096))) + { + + // If prev_match is also MIN_MATCH, match_start is garbage + // but we will ignore the current match anyway. + match_length = MIN_MATCH - 1; + } + } + + // If there was a match at the previous step and the current + // match is not better, output the previous match: + if (prev_length >= MIN_MATCH && match_length <= prev_length) + { + int max_insert = strstart + lookahead - MIN_MATCH; + // Do not insert strings in hash table beyond this. + + // check_match(strstart-1, prev_match, prev_length); + + bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH); + + // Insert in hash table all strings up to the end of the match. + // strstart-1 and strstart are already inserted. If there is not + // enough lookahead, the last two strings are not inserted in + // the hash table. + lookahead -= (prev_length - 1); + prev_length -= 2; + do + { + if (++strstart <= max_insert) + { + ins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + //prev[strstart&w_mask]=hash_head=head[ins_h]; + hash_head = (head[ins_h] & 0xffff); + prev[strstart & w_mask] = head[ins_h]; + head[ins_h] = unchecked((short)strstart); + } + } + while (--prev_length != 0); + match_available = 0; + match_length = MIN_MATCH - 1; + strstart++; + + if (bflush) + { + flush_block_only(false); + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + } + else if (match_available != 0) + { + + // If there was no match at the previous position, output a + // single literal. If there was a match but the current match + // is longer, truncate the previous match to a single literal. + + bflush = _tr_tally(0, window[strstart - 1] & 0xff); + + if (bflush) + { + flush_block_only(false); + } + strstart++; + lookahead--; + if (_codec.AvailableBytesOut == 0) + return BlockState.NeedMore; + } + else + { + // There is no previous match to compare with, wait for + // the next step to decide. + + match_available = 1; + strstart++; + lookahead--; + } + } + + if (match_available != 0) + { + bflush = _tr_tally(0, window[strstart - 1] & 0xff); + match_available = 0; + } + flush_block_only(flush == FlushType.Finish); + + if (_codec.AvailableBytesOut == 0) + { + if (flush == FlushType.Finish) + return BlockState.FinishStarted; + else + return BlockState.NeedMore; + } + + return flush == FlushType.Finish ? BlockState.FinishDone : BlockState.BlockDone; + } + + + internal int longest_match(int cur_match) + { + int chain_length = config.MaxChainLength; // max hash chain length + int scan = strstart; // current string + int match; // matched string + int len; // length of current match + int best_len = prev_length; // best match length so far + int limit = strstart > (w_size - MIN_LOOKAHEAD) ? strstart - (w_size - MIN_LOOKAHEAD) : 0; + + int niceLength = config.NiceLength; + + // Stop when cur_match becomes <= limit. To simplify the code, + // we prevent matches with the string of window index 0. + + int wmask = w_mask; + + int strend = strstart + MAX_MATCH; + byte scan_end1 = window[scan + best_len - 1]; + byte scan_end = window[scan + best_len]; + + // The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + // It is easy to get rid of this optimization if necessary. + + // Do not waste too much time if we already have a good match: + if (prev_length >= config.GoodLength) + { + chain_length >>= 2; + } + + // Do not look for matches beyond the end of the input. This is necessary + // to make deflate deterministic. + if (niceLength > lookahead) + niceLength = lookahead; + + do + { + match = cur_match; + + // Skip to next match if the match length cannot increase + // or if the match length is less than 2: + if (window[match + best_len] != scan_end || + window[match + best_len - 1] != scan_end1 || + window[match] != window[scan] || + window[++match] != window[scan + 1]) + continue; + + // The check at best_len-1 can be removed because it will be made + // again later. (This heuristic is not always a win.) + // It is not necessary to compare scan[2] and match[2] since they + // are always equal when the other bytes match, given that + // the hash keys are equal and that HASH_BITS >= 8. + scan += 2; match++; + + // We check for insufficient lookahead only every 8th comparison; + // the 256th check will be made at strstart+258. + do + { + } + while (window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && scan < strend); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + + if (len > best_len) + { + match_start = cur_match; + best_len = len; + if (len >= niceLength) + break; + scan_end1 = window[scan + best_len - 1]; + scan_end = window[scan + best_len]; + } + } + while ((cur_match = (prev[cur_match & wmask] & 0xffff)) > limit && --chain_length != 0); + + if (best_len <= lookahead) + return best_len; + return lookahead; + } + + + private bool Rfc1950BytesEmitted = false; + private bool _WantRfc1950HeaderBytes = true; + internal bool WantRfc1950HeaderBytes + { + get { return _WantRfc1950HeaderBytes; } + set { _WantRfc1950HeaderBytes = value; } + } + + + internal int Initialize(ZlibCodec codec, CompressionLevel level) + { + return Initialize(codec, level, ZlibConstants.WindowBitsMax); + } + + internal int Initialize(ZlibCodec codec, CompressionLevel level, int bits) + { + return Initialize(codec, level, bits, MEM_LEVEL_DEFAULT, CompressionStrategy.Default); + } + + internal int Initialize(ZlibCodec codec, CompressionLevel level, int bits, CompressionStrategy compressionStrategy) + { + return Initialize(codec, level, bits, MEM_LEVEL_DEFAULT, compressionStrategy); + } + + internal int Initialize(ZlibCodec codec, CompressionLevel level, int windowBits, int memLevel, CompressionStrategy strategy) + { + _codec = codec; + _codec.Message = null; + + // validation + if (windowBits < 9 || windowBits > 15) + throw new ZlibException("windowBits must be in the range 9..15."); + + if (memLevel < 1 || memLevel > MEM_LEVEL_MAX) + throw new ZlibException(String.Format("memLevel must be in the range 1.. {0}", MEM_LEVEL_MAX)); + + _codec.dstate = this; + + w_bits = windowBits; + w_size = 1 << w_bits; + w_mask = w_size - 1; + + hash_bits = memLevel + 7; + hash_size = 1 << hash_bits; + hash_mask = hash_size - 1; + hash_shift = ((hash_bits + MIN_MATCH - 1) / MIN_MATCH); + + window = Extensions.VariableSizedBufferPool.Get(w_size * 2, false); + prev = new short[w_size]; + head = new short[hash_size]; + + // for memLevel==8, this will be 16384, 16k + lit_bufsize = 1 << (memLevel + 6); + + // Use a single array as the buffer for data pending compression, + // the output distance codes, and the output length codes (aka tree). + // orig comment: This works just fine since the average + // output size for (length,distance) codes is <= 24 bits. + pending = Extensions.VariableSizedBufferPool.Get(lit_bufsize * 4, false); + _distanceOffset = lit_bufsize; + _lengthOffset = (1 + 2) * lit_bufsize; + + // So, for memLevel 8, the length of the pending buffer is 65536. 64k. + // The first 16k are pending bytes. + // The middle slice, of 32k, is used for distance codes. + // The final 16k are length codes. + + this.compressionLevel = level; + this.compressionStrategy = strategy; + + Reset(); + return ZlibConstants.Z_OK; + } + + + internal void Reset() + { + _codec.TotalBytesIn = _codec.TotalBytesOut = 0; + _codec.Message = null; + //strm.data_type = Z_UNKNOWN; + + pendingCount = 0; + nextPending = 0; + + Rfc1950BytesEmitted = false; + + status = (WantRfc1950HeaderBytes) ? INIT_STATE : BUSY_STATE; + _codec._Adler32 = Adler.Adler32(0, null, 0, 0); + + last_flush = (int)FlushType.None; + + _InitializeTreeData(); + _InitializeLazyMatch(); + } + + + internal int End() + { + if (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) + { + return ZlibConstants.Z_STREAM_ERROR; + } + // Deallocate in reverse order of allocations: + Extensions.VariableSizedBufferPool.Release(pending); + pending = null; + head = null; + prev = null; + Extensions.VariableSizedBufferPool.Release(window); + window = null; + // free + // dstate=null; + return status == BUSY_STATE ? ZlibConstants.Z_DATA_ERROR : ZlibConstants.Z_OK; + } + + + private void SetDeflater() + { + switch (config.Flavor) + { + case DeflateFlavor.Store: + DeflateFunction = DeflateNone; + break; + case DeflateFlavor.Fast: + DeflateFunction = DeflateFast; + break; + case DeflateFlavor.Slow: + DeflateFunction = DeflateSlow; + break; + } + } + + + internal int SetParams(CompressionLevel level, CompressionStrategy strategy) + { + int result = ZlibConstants.Z_OK; + + if (compressionLevel != level) + { + Config newConfig = Config.Lookup(level); + + // change in the deflate flavor (Fast vs slow vs none)? + if (newConfig.Flavor != config.Flavor && _codec.TotalBytesIn != 0) + { + // Flush the last buffer: + result = _codec.Deflate(FlushType.Partial); + } + + compressionLevel = level; + config = newConfig; + SetDeflater(); + } + + // no need to flush with change in strategy? Really? + compressionStrategy = strategy; + + return result; + } + + + internal int SetDictionary(byte[] dictionary) + { + int length = dictionary.Length; + int index = 0; + + if (dictionary == null || status != INIT_STATE) + throw new ZlibException("Stream error."); + + _codec._Adler32 = Adler.Adler32(_codec._Adler32, dictionary, 0, dictionary.Length); + + if (length < MIN_MATCH) + return ZlibConstants.Z_OK; + if (length > w_size - MIN_LOOKAHEAD) + { + length = w_size - MIN_LOOKAHEAD; + index = dictionary.Length - length; // use the tail of the dictionary + } + Array.Copy(dictionary, index, window, 0, length); + strstart = length; + block_start = length; + + // Insert all strings in the hash table (except for the last two bytes). + // s->lookahead stays null, so s->ins_h will be recomputed at the next + // call of fill_window. + + ins_h = window[0] & 0xff; + ins_h = (((ins_h) << hash_shift) ^ (window[1] & 0xff)) & hash_mask; + + for (int n = 0; n <= length - MIN_MATCH; n++) + { + ins_h = (((ins_h) << hash_shift) ^ (window[(n) + (MIN_MATCH - 1)] & 0xff)) & hash_mask; + prev[n & w_mask] = head[ins_h]; + head[ins_h] = (short)n; + } + return ZlibConstants.Z_OK; + } + + + + internal int Deflate(FlushType flush) + { + int old_flush; + + if (_codec.OutputBuffer == null || + (_codec.InputBuffer == null && _codec.AvailableBytesIn != 0) || + (status == FINISH_STATE && flush != FlushType.Finish)) + { + _codec.Message = _ErrorMessage[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_STREAM_ERROR)]; + throw new ZlibException(String.Format("Something is fishy. [{0}]", _codec.Message)); + } + if (_codec.AvailableBytesOut == 0) + { + _codec.Message = _ErrorMessage[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_BUF_ERROR)]; + throw new ZlibException("OutputBuffer is full (AvailableBytesOut == 0)"); + } + + old_flush = last_flush; + last_flush = (int)flush; + + // Write the zlib (rfc1950) header bytes + if (status == INIT_STATE) + { + int header = (Z_DEFLATED + ((w_bits - 8) << 4)) << 8; + int level_flags = (((int)compressionLevel - 1) & 0xff) >> 1; + + if (level_flags > 3) + level_flags = 3; + header |= (level_flags << 6); + if (strstart != 0) + header |= PRESET_DICT; + header += 31 - (header % 31); + + status = BUSY_STATE; + //putShortMSB(header); + unchecked + { + pending[pendingCount++] = (byte)(header >> 8); + pending[pendingCount++] = (byte)header; + } + // Save the adler32 of the preset dictionary: + if (strstart != 0) + { + pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF000000) >> 24); + pending[pendingCount++] = (byte)((_codec._Adler32 & 0x00FF0000) >> 16); + pending[pendingCount++] = (byte)((_codec._Adler32 & 0x0000FF00) >> 8); + pending[pendingCount++] = (byte)(_codec._Adler32 & 0x000000FF); + } + _codec._Adler32 = Adler.Adler32(0, null, 0, 0); + } + + // Flush as much pending output as possible + if (pendingCount != 0) + { + _codec.flush_pending(); + if (_codec.AvailableBytesOut == 0) + { + //System.out.println(" avail_out==0"); + // Since avail_out is 0, deflate will be called again with + // more output space, but possibly with both pending and + // avail_in equal to zero. There won't be anything to do, + // but this is not an error situation so make sure we + // return OK instead of BUF_ERROR at next call of deflate: + last_flush = -1; + return ZlibConstants.Z_OK; + } + + // Make sure there is something to do and avoid duplicate consecutive + // flushes. For repeated and useless calls with Z_FINISH, we keep + // returning Z_STREAM_END instead of Z_BUFF_ERROR. + } + else if (_codec.AvailableBytesIn == 0 && + (int)flush <= old_flush && + flush != FlushType.Finish) + { + // workitem 8557 + // + // Not sure why this needs to be an error. pendingCount == 0, which + // means there's nothing to deflate. And the caller has not asked + // for a FlushType.Finish, but... that seems very non-fatal. We + // can just say "OK" and do nothing. + + // _codec.Message = z_errmsg[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_BUF_ERROR)]; + // throw new ZlibException("AvailableBytesIn == 0 && flush<=old_flush && flush != FlushType.Finish"); + + return ZlibConstants.Z_OK; + } + + // User must not provide more input after the first FINISH: + if (status == FINISH_STATE && _codec.AvailableBytesIn != 0) + { + _codec.Message = _ErrorMessage[ZlibConstants.Z_NEED_DICT - (ZlibConstants.Z_BUF_ERROR)]; + throw new ZlibException("status == FINISH_STATE && _codec.AvailableBytesIn != 0"); + } + + // Start a new block or continue the current one. + if (_codec.AvailableBytesIn != 0 || lookahead != 0 || (flush != FlushType.None && status != FINISH_STATE)) + { + BlockState bstate = DeflateFunction(flush); + + if (bstate == BlockState.FinishStarted || bstate == BlockState.FinishDone) + { + status = FINISH_STATE; + } + if (bstate == BlockState.NeedMore || bstate == BlockState.FinishStarted) + { + if (_codec.AvailableBytesOut == 0) + { + last_flush = -1; // avoid BUF_ERROR next call, see above + } + return ZlibConstants.Z_OK; + // If flush != Z_NO_FLUSH && avail_out == 0, the next call + // of deflate should use the same flush parameter to make sure + // that the flush is complete. So we don't have to output an + // empty block here, this will be done at next call. This also + // ensures that for a very small output buffer, we emit at most + // one empty block. + } + + if (bstate == BlockState.BlockDone) + { + if (flush == FlushType.Partial) + { + _tr_align(); + } + else + { + // FlushType.Full or FlushType.Sync + _tr_stored_block(0, 0, false); + // For a full flush, this empty block will be recognized + // as a special marker by inflate_sync(). + if (flush == FlushType.Full) + { + // clear hash (forget the history) + for (int i = 0; i < hash_size; i++) + head[i] = 0; + } + } + _codec.flush_pending(); + if (_codec.AvailableBytesOut == 0) + { + last_flush = -1; // avoid BUF_ERROR at next call, see above + return ZlibConstants.Z_OK; + } + } + } + + if (flush != FlushType.Finish) + return ZlibConstants.Z_OK; + + if (!WantRfc1950HeaderBytes || Rfc1950BytesEmitted) + return ZlibConstants.Z_STREAM_END; + + // Write the zlib trailer (adler32) + pending[pendingCount++] = (byte)((_codec._Adler32 & 0xFF000000) >> 24); + pending[pendingCount++] = (byte)((_codec._Adler32 & 0x00FF0000) >> 16); + pending[pendingCount++] = (byte)((_codec._Adler32 & 0x0000FF00) >> 8); + pending[pendingCount++] = (byte)(_codec._Adler32 & 0x000000FF); + //putShortMSB((int)(SharedUtils.URShift(_codec._Adler32, 16))); + //putShortMSB((int)(_codec._Adler32 & 0xffff)); + + _codec.flush_pending(); + + // If avail_out is zero, the application will call deflate again + // to flush the rest. + + Rfc1950BytesEmitted = true; // write the trailer only once! + + return pendingCount != 0 ? ZlibConstants.Z_OK : ZlibConstants.Z_STREAM_END; + } + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Deflate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Deflate.cs.meta new file mode 100644 index 00000000..dc340195 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Deflate.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ad45ad0b3a07a2f4181d9f4243b82395 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/DeflateStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/DeflateStream.cs new file mode 100644 index 00000000..9aaa9c2f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/DeflateStream.cs @@ -0,0 +1,692 @@ +// DeflateStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2010 Dino Chiesa. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-31 14:48:11> +// +// ------------------------------------------------------------------ +// +// This module defines the DeflateStream class, which can be used as a replacement for +// the System.IO.Compression.DeflateStream class in the .NET BCL. +// +// ------------------------------------------------------------------ + + +using System; + +namespace BestHTTP.Decompression.Zlib +{ + /// + /// A class for compressing and decompressing streams using the Deflate algorithm. + /// + /// + /// + /// + /// + /// The DeflateStream is a Decorator on a . It adds DEFLATE compression or decompression to any + /// stream. + /// + /// + /// + /// Using this stream, applications can compress or decompress data via stream + /// Read and Write operations. Either compresssion or decompression + /// can occur through either reading or writing. The compression format used is + /// DEFLATE, which is documented in IETF RFC 1951, "DEFLATE + /// Compressed Data Format Specification version 1.3.". + /// + /// + /// + /// + /// + public class DeflateStream : System.IO.Stream + { + internal ZlibBaseStream _baseStream; + internal System.IO.Stream _innerStream; + bool _disposed; + + /// + /// Create a DeflateStream using the specified CompressionMode. + /// + /// + /// + /// When mode is CompressionMode.Compress, the DeflateStream will use + /// the default compression level. The "captive" stream will be closed when + /// the DeflateStream is closed. + /// + /// + /// + /// This example uses a DeflateStream to compress data from a file, and writes + /// the compressed data to another file. + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + /// { + /// using (Stream compressor = new DeflateStream(raw, CompressionMode.Compress)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(fileToCompress & ".deflated") + /// Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream which will be read or written. + /// Indicates whether the DeflateStream will compress or decompress. + public DeflateStream(System.IO.Stream stream, CompressionMode mode) + : this(stream, mode, CompressionLevel.Default, false) + { + } + + /// + /// Create a DeflateStream using the specified CompressionMode and the specified CompressionLevel. + /// + /// + /// + /// + /// + /// When mode is CompressionMode.Decompress, the level parameter is + /// ignored. The "captive" stream will be closed when the DeflateStream is + /// closed. + /// + /// + /// + /// + /// + /// + /// This example uses a DeflateStream to compress data from a file, and writes + /// the compressed data to another file. + /// + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(fileToCompress + ".deflated")) + /// { + /// using (Stream compressor = new DeflateStream(raw, + /// CompressionMode.Compress, + /// CompressionLevel.BestCompression)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n= -1; + /// while (n != 0) + /// { + /// if (n > 0) + /// compressor.Write(buffer, 0, n); + /// n= input.Read(buffer, 0, buffer.Length); + /// } + /// } + /// } + /// } + /// + /// + /// + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(fileToCompress & ".deflated") + /// Using compressor As Stream = New DeflateStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream to be read or written while deflating or inflating. + /// Indicates whether the DeflateStream will compress or decompress. + /// A tuning knob to trade speed for effectiveness. + public DeflateStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level) + : this(stream, mode, level, false) + { + } + + /// + /// Create a DeflateStream using the specified + /// CompressionMode, and explicitly specify whether the + /// stream should be left open after Deflation or Inflation. + /// + /// + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// memory stream that will be re-read after compression. Specify true for + /// the parameter to leave the stream open. + /// + /// + /// + /// The DeflateStream will use the default compression level. + /// + /// + /// + /// See the other overloads of this constructor for example code. + /// + /// + /// + /// + /// The stream which will be read or written. This is called the + /// "captive" stream in other places in this documentation. + /// + /// + /// + /// Indicates whether the DeflateStream will compress or decompress. + /// + /// + /// true if the application would like the stream to + /// remain open after inflation/deflation. + public DeflateStream(System.IO.Stream stream, CompressionMode mode, bool leaveOpen) + : this(stream, mode, CompressionLevel.Default, leaveOpen) + { + } + + /// + /// Create a DeflateStream using the specified CompressionMode + /// and the specified CompressionLevel, and explicitly specify whether + /// the stream should be left open after Deflation or Inflation. + /// + /// + /// + /// + /// + /// When mode is CompressionMode.Decompress, the level parameter is ignored. + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// that will be re-read after + /// compression. Specify true for the parameter + /// to leave the stream open. + /// + /// + /// + /// + /// + /// + /// This example shows how to use a DeflateStream to compress data from + /// a file, and store the compressed data into another file. + /// + /// + /// using (var output = System.IO.File.Create(fileToCompress + ".deflated")) + /// { + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (Stream compressor = new DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n= -1; + /// while (n != 0) + /// { + /// if (n > 0) + /// compressor.Write(buffer, 0, n); + /// n= input.Read(buffer, 0, buffer.Length); + /// } + /// } + /// } + /// // can write additional data to the output stream here + /// } + /// + /// + /// + /// Using output As FileStream = File.Create(fileToCompress & ".deflated") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using compressor As Stream = New DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// ' can write additional data to the output stream here. + /// End Using + /// + /// + /// The stream which will be read or written. + /// Indicates whether the DeflateStream will compress or decompress. + /// true if the application would like the stream to remain open after inflation/deflation. + /// A tuning knob to trade speed for effectiveness. + public DeflateStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen) + { + _innerStream = stream; + _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.DEFLATE, leaveOpen); + } + + /// + /// Create a DeflateStream using the specified CompressionMode + /// and the specified CompressionLevel, and explicitly specify whether + /// the stream should be left open after Deflation or Inflation. + /// + /// + /// + /// + /// + /// When mode is CompressionMode.Decompress, the level parameter is ignored. + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// that will be re-read after + /// compression. Specify true for the parameter + /// to leave the stream open. + /// + /// + /// + /// + /// + /// + /// This example shows how to use a DeflateStream to compress data from + /// a file, and store the compressed data into another file. + /// + /// + /// using (var output = System.IO.File.Create(fileToCompress + ".deflated")) + /// { + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (Stream compressor = new DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n= -1; + /// while (n != 0) + /// { + /// if (n > 0) + /// compressor.Write(buffer, 0, n); + /// n= input.Read(buffer, 0, buffer.Length); + /// } + /// } + /// } + /// // can write additional data to the output stream here + /// } + /// + /// + /// + /// Using output As FileStream = File.Create(fileToCompress & ".deflated") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using compressor As Stream = New DeflateStream(output, CompressionMode.Compress, CompressionLevel.BestCompression, True) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// ' can write additional data to the output stream here. + /// End Using + /// + /// + /// The stream which will be read or written. + /// Indicates whether the DeflateStream will compress or decompress. + /// true if the application would like the stream to remain open after inflation/deflation. + /// A tuning knob to trade speed for effectiveness. + /// Desired window bits. + public DeflateStream(System.IO.Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen, int windowBits) + { + _innerStream = stream; + _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.DEFLATE, leaveOpen, windowBits); + } + + #region Zlib properties + + /// + /// This property sets the flush behavior on the stream. + /// + /// See the ZLIB documentation for the meaning of the flush behavior. + /// + virtual public FlushType FlushMode + { + get { return (this._baseStream._flushMode); } + set + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + this._baseStream._flushMode = value; + } + } + + /// + /// The size of the working buffer for the compression codec. + /// + /// + /// + /// + /// The working buffer is used for all stream operations. The default size is + /// 1024 bytes. The minimum size is 128 bytes. You may get better performance + /// with a larger buffer. Then again, you might not. You would have to test + /// it. + /// + /// + /// + /// Set this before the first call to Read() or Write() on the + /// stream. If you try to set it afterwards, it will throw. + /// + /// + public int BufferSize + { + get + { + return this._baseStream._bufferSize; + } + set + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + if (this._baseStream._workingBuffer != null) + throw new ZlibException("The working buffer is already set."); + if (value < ZlibConstants.WorkingBufferSizeMin) + throw new ZlibException(String.Format("Don't be silly. {0} bytes?? Use a bigger buffer, at least {1}.", value, ZlibConstants.WorkingBufferSizeMin)); + this._baseStream._bufferSize = value; + } + } + + /// + /// The ZLIB strategy to be used during compression. + /// + /// + /// + /// By tweaking this parameter, you may be able to optimize the compression for + /// data with particular characteristics. + /// + public CompressionStrategy Strategy + { + get + { + return this._baseStream.Strategy; + } + set + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + this._baseStream.Strategy = value; + } + } + + /// Returns the total number of bytes input so far. + virtual public long TotalIn + { + get + { + return this._baseStream._z.TotalBytesIn; + } + } + + /// Returns the total number of bytes output so far. + virtual public long TotalOut + { + get + { + return this._baseStream._z.TotalBytesOut; + } + } + + #endregion + + #region System.IO.Stream methods + /// + /// Dispose the stream. + /// + /// + /// + /// This may or may not result in a Close() call on the captive + /// stream. See the constructors that have a leaveOpen parameter + /// for more information. + /// + /// + /// Application code won't call this code directly. This method may be + /// invoked in two distinct scenarios. If disposing == true, the method + /// has been called directly or indirectly by a user's code, for example + /// via the public Dispose() method. In this case, both managed and + /// unmanaged resources can be referenced and disposed. If disposing == + /// false, the method has been called by the runtime from inside the + /// object finalizer and this method should not reference other objects; + /// in that case only unmanaged resources must be referenced or + /// disposed. + /// + /// + /// + /// true if the Dispose method was invoked by user code. + /// + protected override void Dispose(bool disposing) + { + try + { + if (!_disposed) + { + if (disposing && (this._baseStream != null)) + this._baseStream.Close(); + _disposed = true; + } + } + finally + { + base.Dispose(disposing); + } + } + + + + /// + /// Indicates whether the stream can be read. + /// + /// + /// The return value depends on whether the captive stream supports reading. + /// + public override bool CanRead + { + get + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + return _baseStream._stream.CanRead; + } + } + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + + /// + /// Indicates whether the stream can be written. + /// + /// + /// The return value depends on whether the captive stream supports writing. + /// + public override bool CanWrite + { + get + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + return _baseStream._stream.CanWrite; + } + } + + /// + /// Flush the stream. + /// + public override void Flush() + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + _baseStream.Flush(); + } + + /// + /// Reading this property always throws a . + /// + public override long Length + { + get { throw new NotImplementedException(); } + } + + /// + /// The position of the stream pointer. + /// + /// + /// + /// Setting this property always throws a . Reading will return the total bytes + /// written out, if used in writing, or the total bytes read in, if used in + /// reading. The count may refer to compressed bytes or uncompressed bytes, + /// depending on how you've used the stream. + /// + public override long Position + { + get + { + if (this._baseStream._streamMode == BestHTTP.Decompression.Zlib.ZlibBaseStream.StreamMode.Writer) + return this._baseStream._z.TotalBytesOut; + if (this._baseStream._streamMode == BestHTTP.Decompression.Zlib.ZlibBaseStream.StreamMode.Reader) + return this._baseStream._z.TotalBytesIn; + return 0; + } + set { throw new NotImplementedException(); } + } + + /// + /// Read data from the stream. + /// + /// + /// + /// + /// If you wish to use the DeflateStream to compress data while + /// reading, you can create a DeflateStream with + /// CompressionMode.Compress, providing an uncompressed data stream. + /// Then call Read() on that DeflateStream, and the data read will be + /// compressed as you read. If you wish to use the DeflateStream to + /// decompress data while reading, you can create a DeflateStream with + /// CompressionMode.Decompress, providing a readable compressed data + /// stream. Then call Read() on that DeflateStream, and the data read + /// will be decompressed as you read. + /// + /// + /// + /// A DeflateStream can be used for Read() or Write(), but not both. + /// + /// + /// + /// The buffer into which the read data should be placed. + /// the offset within that data array to put the first byte read. + /// the number of bytes to read. + /// the number of bytes actually read + public override int Read(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + return _baseStream.Read(buffer, offset, count); + } + + + /// + /// Calling this method always throws a . + /// + /// this is irrelevant, since it will always throw! + /// this is irrelevant, since it will always throw! + /// irrelevant! + public override long Seek(long offset, System.IO.SeekOrigin origin) + { + throw new NotImplementedException(); + } + + /// + /// Will call the base stream's SetLength method. + /// + public override void SetLength(long value) + { + _baseStream.SetLength(value); + } + + /// + /// Write data to the stream. + /// + /// + /// + /// + /// If you wish to use the DeflateStream to compress data while + /// writing, you can create a DeflateStream with + /// CompressionMode.Compress, and a writable output stream. Then call + /// Write() on that DeflateStream, providing uncompressed data + /// as input. The data sent to the output stream will be the compressed form + /// of the data written. If you wish to use the DeflateStream to + /// decompress data while writing, you can create a DeflateStream with + /// CompressionMode.Decompress, and a writable output stream. Then + /// call Write() on that stream, providing previously compressed + /// data. The data sent to the output stream will be the decompressed form of + /// the data written. + /// + /// + /// + /// A DeflateStream can be used for Read() or Write(), + /// but not both. + /// + /// + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("DeflateStream"); + _baseStream.Write(buffer, offset, count); + } + #endregion + } + +} + diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/DeflateStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/DeflateStream.cs.meta new file mode 100644 index 00000000..e4d5ac67 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/DeflateStream.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 8b7a3b80f9aa82941a62c619c263ff5e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/GZipStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/GZipStream.cs new file mode 100644 index 00000000..60ac70e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/GZipStream.cs @@ -0,0 +1,919 @@ +// GZipStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-July-11 21:42:34> +// +// ------------------------------------------------------------------ +// +// This module defines the GZipStream class, which can be used as a replacement for +// the System.IO.Compression.GZipStream class in the .NET BCL. NB: The design is not +// completely OO clean: there is some intelligence in the ZlibBaseStream that reads the +// GZip header. +// +// ------------------------------------------------------------------ + + +using System; +using System.IO; + +namespace BestHTTP.Decompression.Zlib +{ + /// + /// A class for compressing and decompressing GZIP streams. + /// + /// + /// + /// + /// The GZipStream is a Decorator on a + /// . It adds GZIP compression or decompression to any + /// stream. + /// + /// + /// + /// Like the System.IO.Compression.GZipStream in the .NET Base Class Library, the + /// Ionic.Zlib.GZipStream can compress while writing, or decompress while + /// reading, but not vice versa. The compression method used is GZIP, which is + /// documented in IETF RFC + /// 1952, "GZIP file format specification version 4.3". + /// + /// + /// A GZipStream can be used to decompress data (through Read()) or + /// to compress data (through Write()), but not both. + /// + /// + /// + /// If you wish to use the GZipStream to compress data, you must wrap it + /// around a write-able stream. As you call Write() on the GZipStream, the + /// data will be compressed into the GZIP format. If you want to decompress data, + /// you must wrap the GZipStream around a readable stream that contains an + /// IETF RFC 1952-compliant stream. The data will be decompressed as you call + /// Read() on the GZipStream. + /// + /// + /// + /// Though the GZIP format allows data from multiple files to be concatenated + /// together, this stream handles only a single segment of GZIP format, typically + /// representing a single file. + /// + /// + /// + /// + /// + public class GZipStream : System.IO.Stream + { + // GZip format + // source: http://tools.ietf.org/html/rfc1952 + // + // header id: 2 bytes 1F 8B + // compress method 1 byte 8= DEFLATE (none other supported) + // flag 1 byte bitfield (See below) + // mtime 4 bytes time_t (seconds since jan 1, 1970 UTC of the file. + // xflg 1 byte 2 = max compress used , 4 = max speed (can be ignored) + // OS 1 byte OS for originating archive. set to 0xFF in compression. + // extra field length 2 bytes optional - only if FEXTRA is set. + // extra field varies + // filename varies optional - if FNAME is set. zero terminated. ISO-8859-1. + // file comment varies optional - if FCOMMENT is set. zero terminated. ISO-8859-1. + // crc16 1 byte optional - present only if FHCRC bit is set + // compressed data varies + // CRC32 4 bytes + // isize 4 bytes data size modulo 2^32 + // + // FLG (FLaGs) + // bit 0 FTEXT - indicates file is ASCII text (can be safely ignored) + // bit 1 FHCRC - there is a CRC16 for the header immediately following the header + // bit 2 FEXTRA - extra fields are present + // bit 3 FNAME - the zero-terminated filename is present. encoding; ISO-8859-1. + // bit 4 FCOMMENT - a zero-terminated file comment is present. encoding: ISO-8859-1 + // bit 5 reserved + // bit 6 reserved + // bit 7 reserved + // + // On consumption: + // Extra field is a bunch of nonsense and can be safely ignored. + // Header CRC and OS, likewise. + // + // on generation: + // all optional fields get 0, except for the OS, which gets 255. + // + + + + /// + /// The comment on the GZIP stream. + /// + /// + /// + /// + /// The GZIP format allows for each file to optionally have an associated + /// comment stored with the file. The comment is encoded with the ISO-8859-1 + /// code page. To include a comment in a GZIP stream you create, set this + /// property before calling Write() for the first time on the + /// GZipStream. + /// + /// + /// + /// When using GZipStream to decompress, you can retrieve this property + /// after the first call to Read(). If no comment has been set in the + /// GZIP bytestream, the Comment property will return null + /// (Nothing in VB). + /// + /// + public String Comment + { + get + { + return _Comment; + } + set + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + _Comment = value; + } + } + + /// + /// The FileName for the GZIP stream. + /// + /// + /// + /// + /// + /// The GZIP format optionally allows each file to have an associated + /// filename. When compressing data (through Write()), set this + /// FileName before calling Write() the first time on the GZipStream. + /// The actual filename is encoded into the GZIP bytestream with the + /// ISO-8859-1 code page, according to RFC 1952. It is the application's + /// responsibility to insure that the FileName can be encoded and decoded + /// correctly with this code page. + /// + /// + /// + /// When decompressing (through Read()), you can retrieve this value + /// any time after the first Read(). In the case where there was no filename + /// encoded into the GZIP bytestream, the property will return null (Nothing + /// in VB). + /// + /// + public String FileName + { + get { return _FileName; } + set + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + _FileName = value; + if (_FileName == null) return; + if (_FileName.IndexOf("/") != -1) + { + _FileName = _FileName.Replace("/", "\\"); + } + if (_FileName.EndsWith("\\")) + throw new Exception("Illegal filename"); + if (_FileName.IndexOf("\\") != -1) + { + // trim any leading path + _FileName = Path.GetFileName(_FileName); + } + } + } + + /// + /// The last modified time for the GZIP stream. + /// + /// + /// + /// GZIP allows the storage of a last modified time with each GZIP entity. + /// When compressing data, you can set this before the first call to + /// Write(). When decompressing, you can retrieve this value any time + /// after the first call to Read(). + /// + public DateTime? LastModified; + + /// + /// The CRC on the GZIP stream. + /// + /// + /// This is used for internal error checking. You probably don't need to look at this property. + /// + public int Crc32 { get { return _Crc32; } } + + private int _headerByteCount; + internal ZlibBaseStream _baseStream; + bool _disposed; + bool _firstReadDone; + string _FileName; + string _Comment; + int _Crc32; + + + /// + /// Create a GZipStream using the specified CompressionMode. + /// + /// + /// + /// + /// When mode is CompressionMode.Compress, the GZipStream will use the + /// default compression level. + /// + /// + /// + /// As noted in the class documentation, the CompressionMode (Compress + /// or Decompress) also establishes the "direction" of the stream. A + /// GZipStream with CompressionMode.Compress works only through + /// Write(). A GZipStream with + /// CompressionMode.Decompress works only through Read(). + /// + /// + /// + /// + /// + /// This example shows how to use a GZipStream to compress data. + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(outputFile)) + /// { + /// using (Stream compressor = new GZipStream(raw, CompressionMode.Compress)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// Dim outputFile As String = (fileToCompress & ".compressed") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(outputFile) + /// Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// + /// + /// This example shows how to use a GZipStream to uncompress a file. + /// + /// private void GunZipFile(string filename) + /// { + /// if (!filename.EndsWith(".gz)) + /// throw new ArgumentException("filename"); + /// var DecompressedFile = filename.Substring(0,filename.Length-3); + /// byte[] working = new byte[WORKING_BUFFER_SIZE]; + /// int n= 1; + /// using (System.IO.Stream input = System.IO.File.OpenRead(filename)) + /// { + /// using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + /// { + /// using (var output = System.IO.File.Create(DecompressedFile)) + /// { + /// while (n !=0) + /// { + /// n= decompressor.Read(working, 0, working.Length); + /// if (n > 0) + /// { + /// output.Write(working, 0, n); + /// } + /// } + /// } + /// } + /// } + /// } + /// + /// + /// + /// Private Sub GunZipFile(ByVal filename as String) + /// If Not (filename.EndsWith(".gz)) Then + /// Throw New ArgumentException("filename") + /// End If + /// Dim DecompressedFile as String = filename.Substring(0,filename.Length-3) + /// Dim working(WORKING_BUFFER_SIZE) as Byte + /// Dim n As Integer = 1 + /// Using input As Stream = File.OpenRead(filename) + /// Using decompressor As Stream = new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, True) + /// Using output As Stream = File.Create(UncompressedFile) + /// Do + /// n= decompressor.Read(working, 0, working.Length) + /// If n > 0 Then + /// output.Write(working, 0, n) + /// End IF + /// Loop While (n > 0) + /// End Using + /// End Using + /// End Using + /// End Sub + /// + /// + /// + /// The stream which will be read or written. + /// Indicates whether the GZipStream will compress or decompress. + public GZipStream(Stream stream, CompressionMode mode) + : this(stream, mode, CompressionLevel.Default, false) + { + } + + /// + /// Create a GZipStream using the specified CompressionMode and + /// the specified CompressionLevel. + /// + /// + /// + /// + /// The CompressionMode (Compress or Decompress) also establishes the + /// "direction" of the stream. A GZipStream with + /// CompressionMode.Compress works only through Write(). A + /// GZipStream with CompressionMode.Decompress works only + /// through Read(). + /// + /// + /// + /// + /// + /// + /// This example shows how to use a GZipStream to compress a file into a .gz file. + /// + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(fileToCompress + ".gz")) + /// { + /// using (Stream compressor = new GZipStream(raw, + /// CompressionMode.Compress, + /// CompressionLevel.BestCompression)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(fileToCompress & ".gz") + /// Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream to be read or written while deflating or inflating. + /// Indicates whether the GZipStream will compress or decompress. + /// A tuning knob to trade speed for effectiveness. + public GZipStream(Stream stream, CompressionMode mode, CompressionLevel level) + : this(stream, mode, level, false) + { + } + + /// + /// Create a GZipStream using the specified CompressionMode, and + /// explicitly specify whether the stream should be left open after Deflation + /// or Inflation. + /// + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// memory stream that will be re-read after compressed data has been written + /// to it. Specify true for the parameter to leave + /// the stream open. + /// + /// + /// + /// The (Compress or Decompress) also + /// establishes the "direction" of the stream. A GZipStream with + /// CompressionMode.Compress works only through Write(). A GZipStream + /// with CompressionMode.Decompress works only through Read(). + /// + /// + /// + /// The GZipStream will use the default compression level. If you want + /// to specify the compression level, see . + /// + /// + /// + /// See the other overloads of this constructor for example code. + /// + /// + /// + /// + /// + /// The stream which will be read or written. This is called the "captive" + /// stream in other places in this documentation. + /// + /// + /// Indicates whether the GZipStream will compress or decompress. + /// + /// + /// + /// true if the application would like the base stream to remain open after + /// inflation/deflation. + /// + public GZipStream(Stream stream, CompressionMode mode, bool leaveOpen) + : this(stream, mode, CompressionLevel.Default, leaveOpen) + { + } + + /// + /// Create a GZipStream using the specified CompressionMode and the + /// specified CompressionLevel, and explicitly specify whether the + /// stream should be left open after Deflation or Inflation. + /// + /// + /// + /// + /// + /// This constructor allows the application to request that the captive stream + /// remain open after the deflation or inflation occurs. By default, after + /// Close() is called on the stream, the captive stream is also + /// closed. In some cases this is not desired, for example if the stream is a + /// memory stream that will be re-read after compressed data has been written + /// to it. Specify true for the parameter to + /// leave the stream open. + /// + /// + /// + /// As noted in the class documentation, the CompressionMode (Compress + /// or Decompress) also establishes the "direction" of the stream. A + /// GZipStream with CompressionMode.Compress works only through + /// Write(). A GZipStream with CompressionMode.Decompress works only + /// through Read(). + /// + /// + /// + /// + /// + /// This example shows how to use a GZipStream to compress data. + /// + /// using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress)) + /// { + /// using (var raw = System.IO.File.Create(outputFile)) + /// { + /// using (Stream compressor = new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true)) + /// { + /// byte[] buffer = new byte[WORKING_BUFFER_SIZE]; + /// int n; + /// while ((n= input.Read(buffer, 0, buffer.Length)) != 0) + /// { + /// compressor.Write(buffer, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// Dim outputFile As String = (fileToCompress & ".compressed") + /// Using input As Stream = File.OpenRead(fileToCompress) + /// Using raw As FileStream = File.Create(outputFile) + /// Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, True) + /// Dim buffer As Byte() = New Byte(4096) {} + /// Dim n As Integer = -1 + /// Do While (n <> 0) + /// If (n > 0) Then + /// compressor.Write(buffer, 0, n) + /// End If + /// n = input.Read(buffer, 0, buffer.Length) + /// Loop + /// End Using + /// End Using + /// End Using + /// + /// + /// The stream which will be read or written. + /// Indicates whether the GZipStream will compress or decompress. + /// true if the application would like the stream to remain open after inflation/deflation. + /// A tuning knob to trade speed for effectiveness. + public GZipStream(Stream stream, CompressionMode mode, CompressionLevel level, bool leaveOpen) + { + _baseStream = new ZlibBaseStream(stream, mode, level, ZlibStreamFlavor.GZIP, leaveOpen); + } + + #region Zlib properties + + /// + /// This property sets the flush behavior on the stream. + /// + virtual public FlushType FlushMode + { + get { return (this._baseStream._flushMode); } + set { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + this._baseStream._flushMode = value; + } + } + + /// + /// The size of the working buffer for the compression codec. + /// + /// + /// + /// + /// The working buffer is used for all stream operations. The default size is + /// 1024 bytes. The minimum size is 128 bytes. You may get better performance + /// with a larger buffer. Then again, you might not. You would have to test + /// it. + /// + /// + /// + /// Set this before the first call to Read() or Write() on the + /// stream. If you try to set it afterwards, it will throw. + /// + /// + public int BufferSize + { + get + { + return this._baseStream._bufferSize; + } + set + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + if (this._baseStream._workingBuffer != null) + throw new ZlibException("The working buffer is already set."); + if (value < ZlibConstants.WorkingBufferSizeMin) + throw new ZlibException(String.Format("Don't be silly. {0} bytes?? Use a bigger buffer, at least {1}.", value, ZlibConstants.WorkingBufferSizeMin)); + this._baseStream._bufferSize = value; + } + } + + + /// Returns the total number of bytes input so far. + virtual public long TotalIn + { + get + { + return this._baseStream._z.TotalBytesIn; + } + } + + /// Returns the total number of bytes output so far. + virtual public long TotalOut + { + get + { + return this._baseStream._z.TotalBytesOut; + } + } + + #endregion + + #region Stream methods + + /// + /// Dispose the stream. + /// + /// + /// + /// This may or may not result in a Close() call on the captive + /// stream. See the constructors that have a leaveOpen parameter + /// for more information. + /// + /// + /// This method may be invoked in two distinct scenarios. If disposing + /// == true, the method has been called directly or indirectly by a + /// user's code, for example via the public Dispose() method. In this + /// case, both managed and unmanaged resources can be referenced and + /// disposed. If disposing == false, the method has been called by the + /// runtime from inside the object finalizer and this method should not + /// reference other objects; in that case only unmanaged resources must + /// be referenced or disposed. + /// + /// + /// + /// indicates whether the Dispose method was invoked by user code. + /// + protected override void Dispose(bool disposing) + { + try + { + if (!_disposed) + { + if (disposing && (this._baseStream != null)) + { + this._baseStream.Close(); + this._Crc32 = _baseStream.Crc32; + } + _disposed = true; + } + } + finally + { + base.Dispose(disposing); + } + } + + + /// + /// Indicates whether the stream can be read. + /// + /// + /// The return value depends on whether the captive stream supports reading. + /// + public override bool CanRead + { + get + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + return _baseStream._stream.CanRead; + } + } + + /// + /// Indicates whether the stream supports Seek operations. + /// + /// + /// Always returns false. + /// + public override bool CanSeek + { + get { return false; } + } + + + /// + /// Indicates whether the stream can be written. + /// + /// + /// The return value depends on whether the captive stream supports writing. + /// + public override bool CanWrite + { + get + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + return _baseStream._stream.CanWrite; + } + } + + /// + /// Flush the stream. + /// + public override void Flush() + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + _baseStream.Flush(); + } + + /// + /// Reading this property always throws a . + /// + public override long Length + { + get { throw new NotImplementedException(); } + } + + /// + /// The position of the stream pointer. + /// + /// + /// + /// Setting this property always throws a . Reading will return the total bytes + /// written out, if used in writing, or the total bytes read in, if used in + /// reading. The count may refer to compressed bytes or uncompressed bytes, + /// depending on how you've used the stream. + /// + public override long Position + { + get + { + if (this._baseStream._streamMode == BestHTTP.Decompression.Zlib.ZlibBaseStream.StreamMode.Writer) + return this._baseStream._z.TotalBytesOut + _headerByteCount; + if (this._baseStream._streamMode == BestHTTP.Decompression.Zlib.ZlibBaseStream.StreamMode.Reader) + return this._baseStream._z.TotalBytesIn + this._baseStream._gzipHeaderByteCount; + return 0; + } + + set { throw new NotImplementedException(); } + } + + /// + /// Read and decompress data from the source stream. + /// + /// + /// + /// With a GZipStream, decompression is done through reading. + /// + /// + /// + /// + /// byte[] working = new byte[WORKING_BUFFER_SIZE]; + /// using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile)) + /// { + /// using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true)) + /// { + /// using (var output = System.IO.File.Create(_DecompressedFile)) + /// { + /// int n; + /// while ((n= decompressor.Read(working, 0, working.Length)) !=0) + /// { + /// output.Write(working, 0, n); + /// } + /// } + /// } + /// } + /// + /// + /// The buffer into which the decompressed data should be placed. + /// the offset within that data array to put the first byte read. + /// the number of bytes to read. + /// the number of bytes actually read + public override int Read(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + int n = _baseStream.Read(buffer, offset, count); + + // Console.WriteLine("GZipStream::Read(buffer, off({0}), c({1}) = {2}", offset, count, n); + // Console.WriteLine( Util.FormatByteArray(buffer, offset, n) ); + + if (!_firstReadDone) + { + _firstReadDone = true; + FileName = _baseStream._GzipFileName; + Comment = _baseStream._GzipComment; + } + return n; + } + + + + /// + /// Calling this method always throws a . + /// + /// irrelevant; it will always throw! + /// irrelevant; it will always throw! + /// irrelevant! + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotImplementedException(); + } + + /// + /// Calling this method always throws a . + /// + /// irrelevant; this method will always throw! + public override void SetLength(long value) + { + //throw new NotImplementedException(); + _baseStream.SetLength(value); + } + + /// + /// Write data to the stream. + /// + /// + /// + /// + /// If you wish to use the GZipStream to compress data while writing, + /// you can create a GZipStream with CompressionMode.Compress, and a + /// writable output stream. Then call Write() on that GZipStream, + /// providing uncompressed data as input. The data sent to the output stream + /// will be the compressed form of the data written. + /// + /// + /// + /// A GZipStream can be used for Read() or Write(), but not + /// both. Writing implies compression. Reading implies decompression. + /// + /// + /// + /// The buffer holding data to write to the stream. + /// the offset within that data array to find the first byte to write. + /// the number of bytes to write. + public override void Write(byte[] buffer, int offset, int count) + { + if (_disposed) throw new ObjectDisposedException("GZipStream"); + if (_baseStream._streamMode == BestHTTP.Decompression.Zlib.ZlibBaseStream.StreamMode.Undefined) + { + //Console.WriteLine("GZipStream: First write"); + if (_baseStream._wantCompress) + { + // first write in compression, therefore, emit the GZIP header + _headerByteCount = EmitHeader(); + } + else + { + throw new InvalidOperationException(); + } + } + + _baseStream.Write(buffer, offset, count); + } + #endregion + + + internal static readonly System.DateTime _unixEpoch = new System.DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + internal static readonly System.Text.Encoding iso8859dash1 = System.Text.Encoding.GetEncoding("iso-8859-1"); + + + private int EmitHeader() + { + byte[] commentBytes = (Comment == null) ? null : iso8859dash1.GetBytes(Comment); + byte[] filenameBytes = (FileName == null) ? null : iso8859dash1.GetBytes(FileName); + + int cbLength = (Comment == null) ? 0 : commentBytes.Length + 1; + int fnLength = (FileName == null) ? 0 : filenameBytes.Length + 1; + + int bufferLength = 10 + cbLength + fnLength; + byte[] header = Extensions.VariableSizedBufferPool.Get(bufferLength, false); + int i = 0; + // ID + header[i++] = 0x1F; + header[i++] = 0x8B; + + // compression method + header[i++] = 8; + byte flag = 0; + if (Comment != null) + flag ^= 0x10; + if (FileName != null) + flag ^= 0x8; + + // flag + header[i++] = flag; + + // mtime + if (!LastModified.HasValue) LastModified = DateTime.Now; + System.TimeSpan delta = LastModified.Value - _unixEpoch; + Int32 timet = (Int32)delta.TotalSeconds; + Array.Copy(BitConverter.GetBytes(timet), 0, header, i, 4); + i += 4; + + // xflg + header[i++] = 0; // this field is totally useless + // OS + header[i++] = 0xFF; // 0xFF == unspecified + + // extra field length - only if FEXTRA is set, which it is not. + //header[i++]= 0; + //header[i++]= 0; + + // filename + if (fnLength != 0) + { + Array.Copy(filenameBytes, 0, header, i, fnLength - 1); + i += fnLength - 1; + header[i++] = 0; // terminate + } + + // comment + if (cbLength != 0) + { + Array.Copy(commentBytes, 0, header, i, cbLength - 1); + i += cbLength - 1; + header[i++] = 0; // terminate + } + + _baseStream._stream.Write(header, 0, header.Length); + int headerLength = header.Length; + + Extensions.VariableSizedBufferPool.Release(header); + + return headerLength; // bytes written + } + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/GZipStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/GZipStream.cs.meta new file mode 100644 index 00000000..7d859b36 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/GZipStream.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: be79ee53ca164d04cbbb654f7de657f5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/InfTree.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/InfTree.cs new file mode 100644 index 00000000..3fdb4253 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/InfTree.cs @@ -0,0 +1,436 @@ +// Inftree.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-October-28 12:43:54> +// +// ------------------------------------------------------------------ +// +// This module defines classes used in decompression. This code is derived +// from the jzlib implementation of zlib. In keeping with the license for jzlib, +// the copyright to that code is below. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + + +using System; +namespace BestHTTP.Decompression.Zlib +{ + + sealed class InfTree + { + + private const int MANY = 1440; + + private const int Z_OK = 0; + private const int Z_STREAM_END = 1; + private const int Z_NEED_DICT = 2; + private const int Z_ERRNO = - 1; + private const int Z_STREAM_ERROR = - 2; + private const int Z_DATA_ERROR = - 3; + private const int Z_MEM_ERROR = - 4; + private const int Z_BUF_ERROR = - 5; + private const int Z_VERSION_ERROR = - 6; + + internal const int fixed_bl = 9; + internal const int fixed_bd = 5; + + //UPGRADE_NOTE: Final was removed from the declaration of 'fixed_tl'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] fixed_tl = new int[]{96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 192, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 160, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 224, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 144, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 208, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 176, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 240, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 200, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 168, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 232, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 152, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 216, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 184, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 248, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 196, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 164, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 228, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 148, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 212, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 180, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 244, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 204, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 172, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 236, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 156, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 220, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 188, 0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 252, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 194, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 162, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 226, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 146, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 210, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 178, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 242, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 202, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 170, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 234, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 154, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 218, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 186, + 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 250, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 198, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 166, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 230, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 150, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 214, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 182, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 246, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 206, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 174, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 238, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 158, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 222, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 190, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 254, 96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 193, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 161, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 225, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 145, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 209, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 177, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 241, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 201, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 169, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 233, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 153, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 217, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 185, 0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 249, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 197, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 165, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 229, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 149, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 213, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 181, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 245, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 205, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 173, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 237, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 157, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 221, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 189, 0, 8, + 14, 0, 8, 142, 0, 8, 78, 0, 9, 253, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9, 195, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 163, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 227, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 147, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 211, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 179, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 243, 80, 7, 4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 203, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9, 171, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 235, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 155, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 219, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 187, 0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 251, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8, 51, 0, 9, 199, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 167, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9, 231, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 151, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 215, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 183, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 247, 80, 7, 5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 207, 81, 7, 15, 0, 8, 103, 0, 8, 39, 0, 9, 175, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 239, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 159, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 223, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 191, 0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 255}; + //UPGRADE_NOTE: Final was removed from the declaration of 'fixed_td'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] fixed_td = new int[]{80, 5, 1, 87, 5, 257, 83, 5, 17, 91, 5, 4097, 81, 5, 5, 89, 5, 1025, 85, 5, 65, 93, 5, 16385, 80, 5, 3, 88, 5, 513, 84, 5, 33, 92, 5, 8193, 82, 5, 9, 90, 5, 2049, 86, 5, 129, 192, 5, 24577, 80, 5, 2, 87, 5, 385, 83, 5, 25, 91, 5, 6145, 81, 5, 7, 89, 5, 1537, 85, 5, 97, 93, 5, 24577, 80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5, 24577}; + + // Tables for deflate from PKZIP's appnote.txt. + //UPGRADE_NOTE: Final was removed from the declaration of 'cplens'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] cplens = new int[]{3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + + // see note #13 above about 258 + //UPGRADE_NOTE: Final was removed from the declaration of 'cplext'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] cplext = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; + + //UPGRADE_NOTE: Final was removed from the declaration of 'cpdist'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] cpdist = new int[]{1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; + + //UPGRADE_NOTE: Final was removed from the declaration of 'cpdext'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1003'" + internal static readonly int[] cpdext = new int[]{0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; + + // If BMAX needs to be larger than 16, then h and x[] should be uLong. + internal const int BMAX = 15; // maximum bit length of any code + + internal int[] hn = null; // hufts used in space + internal int[] v = null; // work area for huft_build + internal int[] c = null; // bit length count table + internal int[] r = null; // table entity for structure assignment + internal int[] u = null; // table stack + internal int[] x = null; // bit offsets, then code stack + + private int huft_build(int[] b, int bindex, int n, int s, int[] d, int[] e, int[] t, int[] m, int[] hp, int[] hn, int[] v) + { + // Given a list of code lengths and a maximum table size, make a set of + // tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + // if the given code set is incomplete (the tables are still built in this + // case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of + // lengths), or Z_MEM_ERROR if not enough memory. + + int a; // counter for codes of length k + int f; // i repeats in table every f entries + int g; // maximum code length + int h; // table level + int i; // counter, current code + int j; // counter + int k; // number of bits in current code + int l; // bits per table (returned in m) + int mask; // (1 << w) - 1, to avoid cc -O bug on HP + int p; // pointer into c[], b[], or v[] + int q; // points to current table + int w; // bits before this table == (l * h) + int xp; // pointer into x + int y; // number of dummy codes added + int z; // number of entries in current table + + // Generate counts for each bit length + + p = 0; i = n; + do + { + c[b[bindex + p]]++; p++; i--; // assume all entries <= BMAX + } + while (i != 0); + + if (c[0] == n) + { + // null input--all zero length codes + t[0] = - 1; + m[0] = 0; + return Z_OK; + } + + // Find minimum and maximum length, bound *m by those + l = m[0]; + for (j = 1; j <= BMAX; j++) + if (c[j] != 0) + break; + k = j; // minimum code length + if (l < j) + { + l = j; + } + for (i = BMAX; i != 0; i--) + { + if (c[i] != 0) + break; + } + g = i; // maximum code length + if (l > i) + { + l = i; + } + m[0] = l; + + // Adjust last length count to fill out codes, if needed + for (y = 1 << j; j < i; j++, y <<= 1) + { + if ((y -= c[j]) < 0) + { + return Z_DATA_ERROR; + } + } + if ((y -= c[i]) < 0) + { + return Z_DATA_ERROR; + } + c[i] += y; + + // Generate starting offsets into the value table for each length + x[1] = j = 0; + p = 1; xp = 2; + while (--i != 0) + { + // note that i == g from above + x[xp] = (j += c[p]); + xp++; + p++; + } + + // Make a table of values in order of bit lengths + i = 0; p = 0; + do + { + if ((j = b[bindex + p]) != 0) + { + v[x[j]++] = i; + } + p++; + } + while (++i < n); + n = x[g]; // set n to length of v + + // Generate the Huffman codes and for each, make the table entries + x[0] = i = 0; // first Huffman code is zero + p = 0; // grab values in bit order + h = - 1; // no tables yet--level -1 + w = - l; // bits decoded == (l * h) + u[0] = 0; // just to keep compilers happy + q = 0; // ditto + z = 0; // ditto + + // go through the bit lengths (k already is bits in shortest code) + for (; k <= g; k++) + { + a = c[k]; + while (a-- != 0) + { + // here i is the Huffman code of length k bits for value *p + // make tables up to required level + while (k > w + l) + { + h++; + w += l; // previous table always l bits + // compute minimum size table less than or equal to l bits + z = g - w; + z = (z > l)?l:z; // table size upper limit + if ((f = 1 << (j = k - w)) > a + 1) + { + // try a k-w bit table + // too few codes for k-w bit table + f -= (a + 1); // deduct codes from patterns left + xp = k; + if (j < z) + { + while (++j < z) + { + // try smaller tables up to z bits + if ((f <<= 1) <= c[++xp]) + break; // enough codes to use up j bits + f -= c[xp]; // else deduct codes from patterns + } + } + } + z = 1 << j; // table entries for j-bit table + + // allocate new table + if (hn[0] + z > MANY) + { + // (note: doesn't matter for fixed) + return Z_DATA_ERROR; // overflow of MANY + } + u[h] = q = hn[0]; // DEBUG + hn[0] += z; + + // connect to last table, if there is one + if (h != 0) + { + x[h] = i; // save pattern for backing up + r[0] = (sbyte) j; // bits in this table + r[1] = (sbyte) l; // bits to dump before this table + j = SharedUtils.URShift(i, (w - l)); + r[2] = (int) (q - u[h - 1] - j); // offset to this table + Array.Copy(r, 0, hp, (u[h - 1] + j) * 3, 3); // connect to last table + } + else + { + t[0] = q; // first table is returned result + } + } + + // set up table entity in r + r[1] = (sbyte) (k - w); + if (p >= n) + { + r[0] = 128 + 64; // out of values--invalid code + } + else if (v[p] < s) + { + r[0] = (sbyte) (v[p] < 256?0:32 + 64); // 256 is end-of-block + r[2] = v[p++]; // simple code is just the value + } + else + { + r[0] = (sbyte) (e[v[p] - s] + 16 + 64); // non-simple--look up in lists + r[2] = d[v[p++] - s]; + } + + // fill code-like entries with r + f = 1 << (k - w); + for (j = SharedUtils.URShift(i, w); j < z; j += f) + { + Array.Copy(r, 0, hp, (q + j) * 3, 3); + } + + // backwards increment the k-bit code i + for (j = 1 << (k - 1); (i & j) != 0; j = SharedUtils.URShift(j, 1)) + { + i ^= j; + } + i ^= j; + + // backup over finished tables + mask = (1 << w) - 1; // needed on HP, cc -O bug + while ((i & mask) != x[h]) + { + h--; // don't need to update q + w -= l; + mask = (1 << w) - 1; + } + } + } + // Return Z_BUF_ERROR if we were given an incomplete table + return y != 0 && g != 1?Z_BUF_ERROR:Z_OK; + } + + internal int inflate_trees_bits(int[] c, int[] bb, int[] tb, int[] hp, ZlibCodec z) + { + int result; + initWorkArea(19); + hn[0] = 0; + result = huft_build(c, 0, 19, 19, null, null, tb, bb, hp, hn, v); + + if (result == Z_DATA_ERROR) + { + z.Message = "oversubscribed dynamic bit lengths tree"; + } + else if (result == Z_BUF_ERROR || bb[0] == 0) + { + z.Message = "incomplete dynamic bit lengths tree"; + result = Z_DATA_ERROR; + } + return result; + } + + internal int inflate_trees_dynamic(int nl, int nd, int[] c, int[] bl, int[] bd, int[] tl, int[] td, int[] hp, ZlibCodec z) + { + int result; + + // build literal/length tree + initWorkArea(288); + hn[0] = 0; + result = huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, hn, v); + if (result != Z_OK || bl[0] == 0) + { + if (result == Z_DATA_ERROR) + { + z.Message = "oversubscribed literal/length tree"; + } + else if (result != Z_MEM_ERROR) + { + z.Message = "incomplete literal/length tree"; + result = Z_DATA_ERROR; + } + return result; + } + + // build distance tree + initWorkArea(288); + result = huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, hn, v); + + if (result != Z_OK || (bd[0] == 0 && nl > 257)) + { + if (result == Z_DATA_ERROR) + { + z.Message = "oversubscribed distance tree"; + } + else if (result == Z_BUF_ERROR) + { + z.Message = "incomplete distance tree"; + result = Z_DATA_ERROR; + } + else if (result != Z_MEM_ERROR) + { + z.Message = "empty distance tree with lengths"; + result = Z_DATA_ERROR; + } + return result; + } + + return Z_OK; + } + + internal static int inflate_trees_fixed(int[] bl, int[] bd, int[][] tl, int[][] td, ZlibCodec z) + { + bl[0] = fixed_bl; + bd[0] = fixed_bd; + tl[0] = fixed_tl; + td[0] = fixed_td; + return Z_OK; + } + + private void initWorkArea(int vsize) + { + if (hn == null) + { + hn = new int[1]; + v = new int[vsize]; + c = new int[BMAX + 1]; + r = new int[3]; + u = new int[BMAX]; + x = new int[BMAX + 1]; + } + else + { + if (v.Length < vsize) + { + v = new int[vsize]; + } + Array.Clear(v,0,vsize); + Array.Clear(c,0,BMAX+1); + r[0]=0; r[1]=0; r[2]=0; + // for(int i=0; i +// +// ------------------------------------------------------------------ +// +// This module defines classes for decompression. This code is derived +// from the jzlib implementation of zlib, but significantly modified. +// The object model is not the same, and many of the behaviors are +// different. Nonetheless, in keeping with the license for jzlib, I am +// reproducing the copyright to that code here. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; +namespace BestHTTP.Decompression.Zlib +{ + sealed class InflateBlocks + { + private const int MANY = 1440; + + // Table for deflate from PKZIP's appnote.txt. + internal static readonly int[] border = new int[] + { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + + private enum InflateBlockMode + { + TYPE = 0, // get type bits (3, including end bit) + LENS = 1, // get lengths for stored + STORED = 2, // processing stored block + TABLE = 3, // get table lengths + BTREE = 4, // get bit lengths tree for a dynamic block + DTREE = 5, // get length, distance trees for a dynamic block + CODES = 6, // processing fixed or dynamic block + DRY = 7, // output remaining window bytes + DONE = 8, // finished last block, done + BAD = 9, // ot a data error--stuck here + } + + private InflateBlockMode mode; // current inflate_block mode + + internal int left; // if STORED, bytes left to copy + + internal int table; // table lengths (14 bits) + internal int index; // index into blens (or border) + internal int[] blens; // bit lengths of codes + internal int[] bb = new int[1]; // bit length tree depth + internal int[] tb = new int[1]; // bit length decoding tree + + internal InflateCodes codes = new InflateCodes(); // if CODES, current state + + internal int last; // true if this block is the last block + + internal ZlibCodec _codec; // pointer back to this zlib stream + + // mode independent information + internal int bitk; // bits in bit buffer + internal int bitb; // bit buffer + internal int[] hufts; // single malloc for tree space + internal byte[] window; // sliding window + internal int end; // one byte after sliding window + internal int readAt; // window read pointer + internal int writeAt; // window write pointer + internal System.Object checkfn; // check function + internal uint check; // check on output + + internal InfTree inftree = new InfTree(); + + internal InflateBlocks(ZlibCodec codec, System.Object checkfn, int w) + { + _codec = codec; + hufts = new int[MANY * 3]; + window = Extensions.VariableSizedBufferPool.Get(w, true); + end = w; + this.checkfn = checkfn; + mode = InflateBlockMode.TYPE; + Reset(); + } + + internal uint Reset() + { + uint oldCheck = check; + mode = InflateBlockMode.TYPE; + bitk = 0; + bitb = 0; + readAt = writeAt = 0; + + if (checkfn != null) + _codec._Adler32 = check = Adler.Adler32(0, null, 0, 0); + return oldCheck; + } + + + internal int Process(int r) + { + int t; // temporary storage + int b; // bit buffer + int k; // bits in bit buffer + int p; // input data pointer + int n; // bytes available there + int q; // output window write pointer + int m; // bytes to end of window or read pointer + + // copy input/output information to locals (UPDATE macro restores) + + p = _codec.NextIn; + n = _codec.AvailableBytesIn; + b = bitb; + k = bitk; + + q = writeAt; + m = (int)(q < readAt ? readAt - q - 1 : end - q); + + + // process input based on current state + while (true) + { + switch (mode) + { + case InflateBlockMode.TYPE: + + while (k < (3)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + t = (int)(b & 7); + last = t & 1; + + switch ((uint)t >> 1) + { + case 0: // stored + b >>= 3; k -= (3); + t = k & 7; // go to byte boundary + b >>= t; k -= t; + mode = InflateBlockMode.LENS; // get length of stored block + break; + + case 1: // fixed + int[] bl = new int[1]; + int[] bd = new int[1]; + int[][] tl = new int[1][]; + int[][] td = new int[1][]; + InfTree.inflate_trees_fixed(bl, bd, tl, td, _codec); + codes.Init(bl[0], bd[0], tl[0], 0, td[0], 0); + b >>= 3; k -= 3; + mode = InflateBlockMode.CODES; + break; + + case 2: // dynamic + b >>= 3; k -= 3; + mode = InflateBlockMode.TABLE; + break; + + case 3: // illegal + b >>= 3; k -= 3; + mode = InflateBlockMode.BAD; + _codec.Message = "invalid block type"; + r = ZlibConstants.Z_DATA_ERROR; + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + break; + + case InflateBlockMode.LENS: + + while (k < (32)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + ; + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + if ( ( ((~b)>>16) & 0xffff) != (b & 0xffff)) + { + mode = InflateBlockMode.BAD; + _codec.Message = "invalid stored block lengths"; + r = ZlibConstants.Z_DATA_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + left = (b & 0xffff); + b = k = 0; // dump bits + mode = left != 0 ? InflateBlockMode.STORED : (last != 0 ? InflateBlockMode.DRY : InflateBlockMode.TYPE); + break; + + case InflateBlockMode.STORED: + if (n == 0) + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + if (m == 0) + { + if (q == end && readAt != 0) + { + q = 0; m = (int)(q < readAt ? readAt - q - 1 : end - q); + } + if (m == 0) + { + writeAt = q; + r = Flush(r); + q = writeAt; m = (int)(q < readAt ? readAt - q - 1 : end - q); + if (q == end && readAt != 0) + { + q = 0; m = (int)(q < readAt ? readAt - q - 1 : end - q); + } + if (m == 0) + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + } + } + r = ZlibConstants.Z_OK; + + t = left; + if (t > n) + t = n; + if (t > m) + t = m; + Array.Copy(_codec.InputBuffer, p, window, q, t); + p += t; n -= t; + q += t; m -= t; + if ((left -= t) != 0) + break; + mode = last != 0 ? InflateBlockMode.DRY : InflateBlockMode.TYPE; + break; + + case InflateBlockMode.TABLE: + + while (k < (14)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + table = t = (b & 0x3fff); + if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) + { + mode = InflateBlockMode.BAD; + _codec.Message = "too many length or distance symbols"; + r = ZlibConstants.Z_DATA_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); + if (blens == null || blens.Length < t) + { + blens = new int[t]; + } + else + { + Array.Clear(blens, 0, t); + // for (int i = 0; i < t; i++) + // { + // blens[i] = 0; + // } + } + + b >>= 14; + k -= 14; + + + index = 0; + mode = InflateBlockMode.BTREE; + goto case InflateBlockMode.BTREE; + + case InflateBlockMode.BTREE: + while (index < 4 + (table >> 10)) + { + while (k < (3)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + blens[border[index++]] = b & 7; + + b >>= 3; k -= 3; + } + + while (index < 19) + { + blens[border[index++]] = 0; + } + + bb[0] = 7; + t = inftree.inflate_trees_bits(blens, bb, tb, hufts, _codec); + if (t != ZlibConstants.Z_OK) + { + r = t; + if (r == ZlibConstants.Z_DATA_ERROR) + { + blens = null; + mode = InflateBlockMode.BAD; + } + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + index = 0; + mode = InflateBlockMode.DTREE; + goto case InflateBlockMode.DTREE; + + case InflateBlockMode.DTREE: + while (true) + { + t = table; + if (!(index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))) + { + break; + } + + int i, j, c; + + t = bb[0]; + + while (k < t) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + t = hufts[(tb[0] + (b & InternalInflateConstants.InflateMask[t])) * 3 + 1]; + c = hufts[(tb[0] + (b & InternalInflateConstants.InflateMask[t])) * 3 + 2]; + + if (c < 16) + { + b >>= t; k -= t; + blens[index++] = c; + } + else + { + // c == 16..18 + i = c == 18 ? 7 : c - 14; + j = c == 18 ? 11 : 3; + + while (k < (t + i)) + { + if (n != 0) + { + r = ZlibConstants.Z_OK; + } + else + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + n--; + b |= (_codec.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + b >>= t; k -= t; + + j += (b & InternalInflateConstants.InflateMask[i]); + + b >>= i; k -= i; + + i = index; + t = table; + if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) + { + blens = null; + mode = InflateBlockMode.BAD; + _codec.Message = "invalid bit length repeat"; + r = ZlibConstants.Z_DATA_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + + c = (c == 16) ? blens[i-1] : 0; + do + { + blens[i++] = c; + } + while (--j != 0); + index = i; + } + } + + tb[0] = -1; + { + int[] bl = new int[] { 9 }; // must be <= 9 for lookahead assumptions + int[] bd = new int[] { 6 }; // must be <= 9 for lookahead assumptions + int[] tl = new int[1]; + int[] td = new int[1]; + + t = table; + t = inftree.inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), blens, bl, bd, tl, td, hufts, _codec); + + if (t != ZlibConstants.Z_OK) + { + if (t == ZlibConstants.Z_DATA_ERROR) + { + blens = null; + mode = InflateBlockMode.BAD; + } + r = t; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + codes.Init(bl[0], bd[0], hufts, tl[0], hufts, td[0]); + } + mode = InflateBlockMode.CODES; + goto case InflateBlockMode.CODES; + + case InflateBlockMode.CODES: + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + + r = codes.Process(this, r); + if (r != ZlibConstants.Z_STREAM_END) + { + return Flush(r); + } + + r = ZlibConstants.Z_OK; + p = _codec.NextIn; + n = _codec.AvailableBytesIn; + b = bitb; + k = bitk; + q = writeAt; + m = (int)(q < readAt ? readAt - q - 1 : end - q); + + if (last == 0) + { + mode = InflateBlockMode.TYPE; + break; + } + mode = InflateBlockMode.DRY; + goto case InflateBlockMode.DRY; + + case InflateBlockMode.DRY: + writeAt = q; + r = Flush(r); + q = writeAt; m = (int)(q < readAt ? readAt - q - 1 : end - q); + if (readAt != writeAt) + { + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + mode = InflateBlockMode.DONE; + goto case InflateBlockMode.DONE; + + case InflateBlockMode.DONE: + r = ZlibConstants.Z_STREAM_END; + bitb = b; + bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + + case InflateBlockMode.BAD: + r = ZlibConstants.Z_DATA_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + + + default: + r = ZlibConstants.Z_STREAM_ERROR; + + bitb = b; bitk = k; + _codec.AvailableBytesIn = n; + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + writeAt = q; + return Flush(r); + } + } + } + + + internal void Free() + { + Reset(); + Extensions.VariableSizedBufferPool.Release(window); + window = null; + hufts = null; + } + + internal void SetDictionary(byte[] d, int start, int n) + { + Array.Copy(d, start, window, 0, n); + readAt = writeAt = n; + } + + // Returns true if inflate is currently at the end of a block generated + // by Z_SYNC_FLUSH or Z_FULL_FLUSH. + internal int SyncPoint() + { + return mode == InflateBlockMode.LENS ? 1 : 0; + } + + // copy as much as possible from the sliding window to the output area + internal int Flush(int r) + { + int nBytes; + + for (int pass=0; pass < 2; pass++) + { + if (pass==0) + { + // compute number of bytes to copy as far as end of window + nBytes = (int)((readAt <= writeAt ? writeAt : end) - readAt); + } + else + { + // compute bytes to copy + nBytes = writeAt - readAt; + } + + // workitem 8870 + if (nBytes == 0) + { + if (r == ZlibConstants.Z_BUF_ERROR) + r = ZlibConstants.Z_OK; + return r; + } + + if (nBytes > _codec.AvailableBytesOut) + nBytes = _codec.AvailableBytesOut; + + if (nBytes != 0 && r == ZlibConstants.Z_BUF_ERROR) + r = ZlibConstants.Z_OK; + + // update counters + _codec.AvailableBytesOut -= nBytes; + _codec.TotalBytesOut += nBytes; + + // update check information + if (checkfn != null) + _codec._Adler32 = check = Adler.Adler32(check, window, readAt, nBytes); + + // copy as far as end of window + Array.Copy(window, readAt, _codec.OutputBuffer, _codec.NextOut, nBytes); + _codec.NextOut += nBytes; + readAt += nBytes; + + // see if more to copy at beginning of window + if (readAt == end && pass == 0) + { + // wrap pointers + readAt = 0; + if (writeAt == end) + writeAt = 0; + } + else pass++; + } + + // done + return r; + } + } + + + internal static class InternalInflateConstants + { + // And'ing with mask[n] masks the lower n bits + internal static readonly int[] InflateMask = new int[] { + 0x00000000, 0x00000001, 0x00000003, 0x00000007, + 0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f, + 0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff, + 0x00000fff, 0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff }; + } + + + sealed class InflateCodes + { + // waiting for "i:"=input, + // "o:"=output, + // "x:"=nothing + private const int START = 0; // x: set up for LEN + private const int LEN = 1; // i: get length/literal/eob next + private const int LENEXT = 2; // i: getting length extra (have base) + private const int DIST = 3; // i: get distance next + private const int DISTEXT = 4; // i: getting distance extra + private const int COPY = 5; // o: copying bytes in window, waiting for space + private const int LIT = 6; // o: got literal, waiting for output space + private const int WASH = 7; // o: got eob, possibly still output waiting + private const int END = 8; // x: got eob and all data flushed + private const int BADCODE = 9; // x: got error + + internal int mode; // current inflate_codes mode + + // mode dependent information + internal int len; + + internal int[] tree; // pointer into tree + internal int tree_index = 0; + internal int need; // bits needed + + internal int lit; + + // if EXT or COPY, where and how much + internal int bitsToGet; // bits to get for extra + internal int dist; // distance back to copy from + + internal byte lbits; // ltree bits decoded per branch + internal byte dbits; // dtree bits decoder per branch + internal int[] ltree; // literal/length/eob tree + internal int ltree_index; // literal/length/eob tree + internal int[] dtree; // distance tree + internal int dtree_index; // distance tree + + internal InflateCodes() + { + } + + internal void Init(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index) + { + mode = START; + lbits = (byte)bl; + dbits = (byte)bd; + ltree = tl; + ltree_index = tl_index; + dtree = td; + dtree_index = td_index; + tree = null; + } + + internal int Process(InflateBlocks blocks, int r) + { + int j; // temporary storage + int tindex; // temporary pointer + int e; // extra bits or operation + int b = 0; // bit buffer + int k = 0; // bits in bit buffer + int p = 0; // input data pointer + int n; // bytes available there + int q; // output window write pointer + int m; // bytes to end of window or read pointer + int f; // pointer to copy strings from + + ZlibCodec z = blocks._codec; + + // copy input/output information to locals (UPDATE macro restores) + p = z.NextIn; + n = z.AvailableBytesIn; + b = blocks.bitb; + k = blocks.bitk; + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + // process input and output based on current state + while (true) + { + switch (mode) + { + // waiting for "i:"=input, "o:"=output, "x:"=nothing + case START: // x: set up for LEN + if (m >= 258 && n >= 10) + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; + z.TotalBytesIn += p - z.NextIn; + z.NextIn = p; + blocks.writeAt = q; + r = InflateFast(lbits, dbits, ltree, ltree_index, dtree, dtree_index, blocks, z); + + p = z.NextIn; + n = z.AvailableBytesIn; + b = blocks.bitb; + k = blocks.bitk; + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + if (r != ZlibConstants.Z_OK) + { + mode = (r == ZlibConstants.Z_STREAM_END) ? WASH : BADCODE; + break; + } + } + need = lbits; + tree = ltree; + tree_index = ltree_index; + + mode = LEN; + goto case LEN; + + case LEN: // i: get length/literal/eob next + j = need; + + while (k < j) + { + if (n != 0) + r = ZlibConstants.Z_OK; + else + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; + z.TotalBytesIn += p - z.NextIn; + z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + n--; + b |= (z.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + tindex = (tree_index + (b & InternalInflateConstants.InflateMask[j])) * 3; + + b >>= (tree[tindex + 1]); + k -= (tree[tindex + 1]); + + e = tree[tindex]; + + if (e == 0) + { + // literal + lit = tree[tindex + 2]; + mode = LIT; + break; + } + if ((e & 16) != 0) + { + // length + bitsToGet = e & 15; + len = tree[tindex + 2]; + mode = LENEXT; + break; + } + if ((e & 64) == 0) + { + // next table + need = e; + tree_index = tindex / 3 + tree[tindex + 2]; + break; + } + if ((e & 32) != 0) + { + // end of block + mode = WASH; + break; + } + mode = BADCODE; // invalid code + z.Message = "invalid literal/length code"; + r = ZlibConstants.Z_DATA_ERROR; + + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; + z.TotalBytesIn += p - z.NextIn; + z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + + + case LENEXT: // i: getting length extra (have base) + j = bitsToGet; + + while (k < j) + { + if (n != 0) + r = ZlibConstants.Z_OK; + else + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + n--; b |= (z.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + len += (b & InternalInflateConstants.InflateMask[j]); + + b >>= j; + k -= j; + + need = dbits; + tree = dtree; + tree_index = dtree_index; + mode = DIST; + goto case DIST; + + case DIST: // i: get distance next + j = need; + + while (k < j) + { + if (n != 0) + r = ZlibConstants.Z_OK; + else + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + n--; b |= (z.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + tindex = (tree_index + (b & InternalInflateConstants.InflateMask[j])) * 3; + + b >>= tree[tindex + 1]; + k -= tree[tindex + 1]; + + e = (tree[tindex]); + if ((e & 0x10) != 0) + { + // distance + bitsToGet = e & 15; + dist = tree[tindex + 2]; + mode = DISTEXT; + break; + } + if ((e & 64) == 0) + { + // next table + need = e; + tree_index = tindex / 3 + tree[tindex + 2]; + break; + } + mode = BADCODE; // invalid code + z.Message = "invalid distance code"; + r = ZlibConstants.Z_DATA_ERROR; + + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + + + case DISTEXT: // i: getting distance extra + j = bitsToGet; + + while (k < j) + { + if (n != 0) + r = ZlibConstants.Z_OK; + else + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + n--; b |= (z.InputBuffer[p++] & 0xff) << k; + k += 8; + } + + dist += (b & InternalInflateConstants.InflateMask[j]); + + b >>= j; + k -= j; + + mode = COPY; + goto case COPY; + + case COPY: // o: copying bytes in window, waiting for space + f = q - dist; + while (f < 0) + { + // modulo window size-"while" instead + f += blocks.end; // of "if" handles invalid distances + } + while (len != 0) + { + if (m == 0) + { + if (q == blocks.end && blocks.readAt != 0) + { + q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + } + if (m == 0) + { + blocks.writeAt = q; r = blocks.Flush(r); + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + if (q == blocks.end && blocks.readAt != 0) + { + q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + } + + if (m == 0) + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; + z.TotalBytesIn += p - z.NextIn; + z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + } + } + + blocks.window[q++] = blocks.window[f++]; m--; + + if (f == blocks.end) + f = 0; + len--; + } + mode = START; + break; + + case LIT: // o: got literal, waiting for output space + if (m == 0) + { + if (q == blocks.end && blocks.readAt != 0) + { + q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + } + if (m == 0) + { + blocks.writeAt = q; r = blocks.Flush(r); + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + if (q == blocks.end && blocks.readAt != 0) + { + q = 0; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + } + if (m == 0) + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + } + } + r = ZlibConstants.Z_OK; + + blocks.window[q++] = (byte)lit; m--; + + mode = START; + break; + + case WASH: // o: got eob, possibly more output + if (k > 7) + { + // return unused byte, if any + k -= 8; + n++; + p--; // can always return one + } + + blocks.writeAt = q; r = blocks.Flush(r); + q = blocks.writeAt; m = q < blocks.readAt ? blocks.readAt - q - 1 : blocks.end - q; + + if (blocks.readAt != blocks.writeAt) + { + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + mode = END; + goto case END; + + case END: + r = ZlibConstants.Z_STREAM_END; + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + + case BADCODE: // x: got error + + r = ZlibConstants.Z_DATA_ERROR; + + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + + default: + r = ZlibConstants.Z_STREAM_ERROR; + + blocks.bitb = b; blocks.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + blocks.writeAt = q; + return blocks.Flush(r); + } + } + } + + + // Called with number of bytes left to write in window at least 258 + // (the maximum string length) and number of input bytes available + // at least ten. The ten bytes are six bytes for the longest length/ + // distance pair plus four bytes for overloading the bit buffer. + + internal int InflateFast(int bl, int bd, int[] tl, int tl_index, int[] td, int td_index, InflateBlocks s, ZlibCodec z) + { + int t; // temporary pointer + int[] tp; // temporary pointer + int tp_index; // temporary pointer + int e; // extra bits or operation + int b; // bit buffer + int k; // bits in bit buffer + int p; // input data pointer + int n; // bytes available there + int q; // output window write pointer + int m; // bytes to end of window or read pointer + int ml; // mask for literal/length tree + int md; // mask for distance tree + int c; // bytes to copy + int d; // distance back to copy from + int r; // copy source pointer + + int tp_index_t_3; // (tp_index+t)*3 + + // load input, output, bit values + p = z.NextIn; n = z.AvailableBytesIn; b = s.bitb; k = s.bitk; + q = s.writeAt; m = q < s.readAt ? s.readAt - q - 1 : s.end - q; + + // initialize masks + ml = InternalInflateConstants.InflateMask[bl]; + md = InternalInflateConstants.InflateMask[bd]; + + // do until not enough input or output space for fast loop + do + { + // assume called with m >= 258 && n >= 10 + // get literal/length code + while (k < (20)) + { + // max bits for literal/length code + n--; + b |= (z.InputBuffer[p++] & 0xff) << k; k += 8; + } + + t = b & ml; + tp = tl; + tp_index = tl_index; + tp_index_t_3 = (tp_index + t) * 3; + if ((e = tp[tp_index_t_3]) == 0) + { + b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); + + s.window[q++] = (byte)tp[tp_index_t_3 + 2]; + m--; + continue; + } + do + { + + b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); + + if ((e & 16) != 0) + { + e &= 15; + c = tp[tp_index_t_3 + 2] + ((int)b & InternalInflateConstants.InflateMask[e]); + + b >>= e; k -= e; + + // decode distance base of block to copy + while (k < 15) + { + // max bits for distance code + n--; + b |= (z.InputBuffer[p++] & 0xff) << k; k += 8; + } + + t = b & md; + tp = td; + tp_index = td_index; + tp_index_t_3 = (tp_index + t) * 3; + e = tp[tp_index_t_3]; + + do + { + + b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); + + if ((e & 16) != 0) + { + // get extra bits to add to distance base + e &= 15; + while (k < e) + { + // get extra bits (up to 13) + n--; + b |= (z.InputBuffer[p++] & 0xff) << k; k += 8; + } + + d = tp[tp_index_t_3 + 2] + (b & InternalInflateConstants.InflateMask[e]); + + b >>= e; k -= e; + + // do the copy + m -= c; + if (q >= d) + { + // offset before dest + // just copy + r = q - d; + if (q - r > 0 && 2 > (q - r)) + { + s.window[q++] = s.window[r++]; // minimum count is three, + s.window[q++] = s.window[r++]; // so unroll loop a little + c -= 2; + } + else + { + Array.Copy(s.window, r, s.window, q, 2); + q += 2; r += 2; c -= 2; + } + } + else + { + // else offset after destination + r = q - d; + do + { + r += s.end; // force pointer in window + } + while (r < 0); // covers invalid distances + e = s.end - r; + if (c > e) + { + // if source crosses, + c -= e; // wrapped copy + if (q - r > 0 && e > (q - r)) + { + do + { + s.window[q++] = s.window[r++]; + } + while (--e != 0); + } + else + { + Array.Copy(s.window, r, s.window, q, e); + q += e; r += e; e = 0; + } + r = 0; // copy rest from start of window + } + } + + // copy all or what's left + if (q - r > 0 && c > (q - r)) + { + do + { + s.window[q++] = s.window[r++]; + } + while (--c != 0); + } + else + { + Array.Copy(s.window, r, s.window, q, c); + q += c; r += c; c = 0; + } + break; + } + else if ((e & 64) == 0) + { + t += tp[tp_index_t_3 + 2]; + t += (b & InternalInflateConstants.InflateMask[e]); + tp_index_t_3 = (tp_index + t) * 3; + e = tp[tp_index_t_3]; + } + else + { + z.Message = "invalid distance code"; + + c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); + + s.bitb = b; s.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + s.writeAt = q; + + return ZlibConstants.Z_DATA_ERROR; + } + } + while (true); + break; + } + + if ((e & 64) == 0) + { + t += tp[tp_index_t_3 + 2]; + t += (b & InternalInflateConstants.InflateMask[e]); + tp_index_t_3 = (tp_index + t) * 3; + if ((e = tp[tp_index_t_3]) == 0) + { + b >>= (tp[tp_index_t_3 + 1]); k -= (tp[tp_index_t_3 + 1]); + s.window[q++] = (byte)tp[tp_index_t_3 + 2]; + m--; + break; + } + } + else if ((e & 32) != 0) + { + c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); + + s.bitb = b; s.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + s.writeAt = q; + + return ZlibConstants.Z_STREAM_END; + } + else + { + z.Message = "invalid literal/length code"; + + c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); + + s.bitb = b; s.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + s.writeAt = q; + + return ZlibConstants.Z_DATA_ERROR; + } + } + while (true); + } + while (m >= 258 && n >= 10); + + // not enough input or output--restore pointers and return + c = z.AvailableBytesIn - n; c = (k >> 3) < c ? k >> 3 : c; n += c; p -= c; k -= (c << 3); + + s.bitb = b; s.bitk = k; + z.AvailableBytesIn = n; z.TotalBytesIn += p - z.NextIn; z.NextIn = p; + s.writeAt = q; + + return ZlibConstants.Z_OK; + } + } + + + internal sealed class InflateManager + { + // preset dictionary flag in zlib header + private const int PRESET_DICT = 0x20; + + private const int Z_DEFLATED = 8; + + private enum InflateManagerMode + { + METHOD = 0, // waiting for method byte + FLAG = 1, // waiting for flag byte + DICT4 = 2, // four dictionary check bytes to go + DICT3 = 3, // three dictionary check bytes to go + DICT2 = 4, // two dictionary check bytes to go + DICT1 = 5, // one dictionary check byte to go + DICT0 = 6, // waiting for inflateSetDictionary + BLOCKS = 7, // decompressing blocks + CHECK4 = 8, // four check bytes to go + CHECK3 = 9, // three check bytes to go + CHECK2 = 10, // two check bytes to go + CHECK1 = 11, // one check byte to go + DONE = 12, // finished check, done + BAD = 13, // got an error--stay here + } + + private InflateManagerMode mode; // current inflate mode + internal ZlibCodec _codec; // pointer back to this zlib stream + + // mode dependent information + internal int method; // if FLAGS, method byte + + // if CHECK, check values to compare + internal uint computedCheck; // computed check value + internal uint expectedCheck; // stream check value + + // if BAD, inflateSync's marker bytes count + internal int marker; + + // mode independent information + //internal int nowrap; // flag for no wrapper + private bool _handleRfc1950HeaderBytes = true; + internal bool HandleRfc1950HeaderBytes + { + get { return _handleRfc1950HeaderBytes; } + set { _handleRfc1950HeaderBytes = value; } + } + internal int wbits; // log2(window size) (8..15, defaults to 15) + + internal InflateBlocks blocks; // current inflate_blocks state + + public InflateManager() { } + + public InflateManager(bool expectRfc1950HeaderBytes) + { + _handleRfc1950HeaderBytes = expectRfc1950HeaderBytes; + } + + internal int Reset() + { + _codec.TotalBytesIn = _codec.TotalBytesOut = 0; + _codec.Message = null; + mode = HandleRfc1950HeaderBytes ? InflateManagerMode.METHOD : InflateManagerMode.BLOCKS; + blocks.Reset(); + return ZlibConstants.Z_OK; + } + + internal int End() + { + if (blocks != null) + blocks.Free(); + blocks = null; + return ZlibConstants.Z_OK; + } + + internal int Initialize(ZlibCodec codec, int w) + { + _codec = codec; + _codec.Message = null; + blocks = null; + + // handle undocumented nowrap option (no zlib header or check) + //nowrap = 0; + //if (w < 0) + //{ + // w = - w; + // nowrap = 1; + //} + + // set window size + if (w < 8 || w > 15) + { + End(); + throw new ZlibException("Bad window size."); + + //return ZlibConstants.Z_STREAM_ERROR; + } + wbits = w; + + blocks = new InflateBlocks(codec, + HandleRfc1950HeaderBytes ? this : null, + 1 << w); + + // reset state + Reset(); + return ZlibConstants.Z_OK; + } + + + internal int Inflate(FlushType flush) + { + int b; + + if (_codec.InputBuffer == null) + throw new ZlibException("InputBuffer is null. "); + +// int f = (flush == FlushType.Finish) +// ? ZlibConstants.Z_BUF_ERROR +// : ZlibConstants.Z_OK; + + // workitem 8870 + int f = ZlibConstants.Z_OK; + int r = ZlibConstants.Z_BUF_ERROR; + + while (true) + { + switch (mode) + { + case InflateManagerMode.METHOD: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + if (((method = _codec.InputBuffer[_codec.NextIn++]) & 0xf) != Z_DEFLATED) + { + mode = InflateManagerMode.BAD; + _codec.Message = String.Format("unknown compression method (0x{0:X2})", method); + marker = 5; // can't try inflateSync + break; + } + if ((method >> 4) + 8 > wbits) + { + mode = InflateManagerMode.BAD; + _codec.Message = String.Format("invalid window size ({0})", (method >> 4) + 8); + marker = 5; // can't try inflateSync + break; + } + mode = InflateManagerMode.FLAG; + break; + + + case InflateManagerMode.FLAG: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + b = (_codec.InputBuffer[_codec.NextIn++]) & 0xff; + + if ((((method << 8) + b) % 31) != 0) + { + mode = InflateManagerMode.BAD; + _codec.Message = "incorrect header check"; + marker = 5; // can't try inflateSync + break; + } + + mode = ((b & PRESET_DICT) == 0) + ? InflateManagerMode.BLOCKS + : InflateManagerMode.DICT4; + break; + + case InflateManagerMode.DICT4: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck = (uint)((_codec.InputBuffer[_codec.NextIn++] << 24) & 0xff000000); + mode = InflateManagerMode.DICT3; + break; + + case InflateManagerMode.DICT3: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 16) & 0x00ff0000); + mode = InflateManagerMode.DICT2; + break; + + case InflateManagerMode.DICT2: + + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 8) & 0x0000ff00); + mode = InflateManagerMode.DICT1; + break; + + + case InflateManagerMode.DICT1: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; _codec.TotalBytesIn++; + expectedCheck += (uint)(_codec.InputBuffer[_codec.NextIn++] & 0x000000ff); + _codec._Adler32 = expectedCheck; + mode = InflateManagerMode.DICT0; + return ZlibConstants.Z_NEED_DICT; + + + case InflateManagerMode.DICT0: + mode = InflateManagerMode.BAD; + _codec.Message = "need dictionary"; + marker = 0; // can try inflateSync + return ZlibConstants.Z_STREAM_ERROR; + + + case InflateManagerMode.BLOCKS: + r = blocks.Process(r); + if (r == ZlibConstants.Z_DATA_ERROR) + { + mode = InflateManagerMode.BAD; + marker = 0; // can try inflateSync + break; + } + + if (r == ZlibConstants.Z_OK) r = f; + + if (r != ZlibConstants.Z_STREAM_END) + return r; + + r = f; + computedCheck = blocks.Reset(); + if (!HandleRfc1950HeaderBytes) + { + mode = InflateManagerMode.DONE; + return ZlibConstants.Z_STREAM_END; + } + mode = InflateManagerMode.CHECK4; + break; + + case InflateManagerMode.CHECK4: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck = (uint)((_codec.InputBuffer[_codec.NextIn++] << 24) & 0xff000000); + mode = InflateManagerMode.CHECK3; + break; + + case InflateManagerMode.CHECK3: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; _codec.TotalBytesIn++; + expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 16) & 0x00ff0000); + mode = InflateManagerMode.CHECK2; + break; + + case InflateManagerMode.CHECK2: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; + _codec.TotalBytesIn++; + expectedCheck += (uint)((_codec.InputBuffer[_codec.NextIn++] << 8) & 0x0000ff00); + mode = InflateManagerMode.CHECK1; + break; + + case InflateManagerMode.CHECK1: + if (_codec.AvailableBytesIn == 0) return r; + r = f; + _codec.AvailableBytesIn--; _codec.TotalBytesIn++; + expectedCheck += (uint)(_codec.InputBuffer[_codec.NextIn++] & 0x000000ff); + if (computedCheck != expectedCheck) + { + mode = InflateManagerMode.BAD; + _codec.Message = "incorrect data check"; + marker = 5; // can't try inflateSync + break; + } + mode = InflateManagerMode.DONE; + return ZlibConstants.Z_STREAM_END; + + case InflateManagerMode.DONE: + return ZlibConstants.Z_STREAM_END; + + case InflateManagerMode.BAD: + throw new ZlibException(String.Format("Bad state ({0})", _codec.Message)); + + default: + throw new ZlibException("Stream error."); + + } + } + } + + + + internal int SetDictionary(byte[] dictionary) + { + int index = 0; + int length = dictionary.Length; + if (mode != InflateManagerMode.DICT0) + throw new ZlibException("Stream error."); + + if (Adler.Adler32(1, dictionary, 0, dictionary.Length) != _codec._Adler32) + { + return ZlibConstants.Z_DATA_ERROR; + } + + _codec._Adler32 = Adler.Adler32(0, null, 0, 0); + + if (length >= (1 << wbits)) + { + length = (1 << wbits) - 1; + index = dictionary.Length - length; + } + blocks.SetDictionary(dictionary, index, length); + mode = InflateManagerMode.BLOCKS; + return ZlibConstants.Z_OK; + } + + + private static readonly byte[] mark = new byte[] { 0, 0, 0xff, 0xff }; + + internal int Sync() + { + int n; // number of bytes to look at + int p; // pointer to bytes + int m; // number of marker bytes found in a row + long r, w; // temporaries to save total_in and total_out + + // set up + if (mode != InflateManagerMode.BAD) + { + mode = InflateManagerMode.BAD; + marker = 0; + } + if ((n = _codec.AvailableBytesIn) == 0) + return ZlibConstants.Z_BUF_ERROR; + p = _codec.NextIn; + m = marker; + + // search + while (n != 0 && m < 4) + { + if (_codec.InputBuffer[p] == mark[m]) + { + m++; + } + else if (_codec.InputBuffer[p] != 0) + { + m = 0; + } + else + { + m = 4 - m; + } + p++; n--; + } + + // restore + _codec.TotalBytesIn += p - _codec.NextIn; + _codec.NextIn = p; + _codec.AvailableBytesIn = n; + marker = m; + + // return no joy or set up to restart on a new block + if (m != 4) + { + return ZlibConstants.Z_DATA_ERROR; + } + r = _codec.TotalBytesIn; + w = _codec.TotalBytesOut; + Reset(); + _codec.TotalBytesIn = r; + _codec.TotalBytesOut = w; + mode = InflateManagerMode.BLOCKS; + return ZlibConstants.Z_OK; + } + + + // Returns true if inflate is currently at the end of a block generated + // by Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP + // implementation to provide an additional safety check. PPP uses Z_SYNC_FLUSH + // but removes the length bytes of the resulting empty stored block. When + // decompressing, PPP checks that at the end of input packet, inflate is + // waiting for these length bytes. + internal int SyncPoint(ZlibCodec z) + { + return blocks.SyncPoint(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Inflate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Inflate.cs.meta new file mode 100644 index 00000000..7eb68f07 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Inflate.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 01ece23e3663e424ba8672d6d3d50f19 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZTree.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZTree.cs new file mode 100644 index 00000000..04437d50 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZTree.cs @@ -0,0 +1,423 @@ +// Tree.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-October-28 13:29:50> +// +// ------------------------------------------------------------------ +// +// This module defines classes for zlib compression and +// decompression. This code is derived from the jzlib implementation of +// zlib. In keeping with the license for jzlib, the copyright to that +// code is below. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; + +namespace BestHTTP.Decompression.Zlib +{ + sealed class ZTree + { + private static readonly int HEAP_SIZE = (2 * InternalConstants.L_CODES + 1); + + // extra bits for each length code + internal static readonly int[] ExtraLengthBits = new int[] + { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 + }; + + // extra bits for each distance code + internal static readonly int[] ExtraDistanceBits = new int[] + { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 + }; + + // extra bits for each bit length code + internal static readonly int[] extra_blbits = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7}; + + internal static readonly sbyte[] bl_order = new sbyte[]{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + + + // The lengths of the bit length codes are sent in order of decreasing + // probability, to avoid transmitting the lengths for unused bit + // length codes. + + internal const int Buf_size = 8 * 2; + + // see definition of array dist_code below + //internal const int DIST_CODE_LEN = 512; + + private static readonly sbyte[] _dist_code = new sbyte[] + { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, + 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 + }; + + internal static readonly sbyte[] LengthCode = new sbyte[] + { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, + 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 + }; + + + internal static readonly int[] LengthBase = new int[] + { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, + 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0 + }; + + + internal static readonly int[] DistanceBase = new int[] + { + 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, + 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 + }; + + + /// + /// Map from a distance to a distance code. + /// + /// + /// No side effects. _dist_code[256] and _dist_code[257] are never used. + /// + internal static int DistanceCode(int dist) + { + return (dist < 256) + ? _dist_code[dist] + : _dist_code[256 + SharedUtils.URShift(dist, 7)]; + } + + internal short[] dyn_tree; // the dynamic tree + internal int max_code; // largest code with non zero frequency + internal StaticTree staticTree; // the corresponding static tree + + // Compute the optimal bit lengths for a tree and update the total bit length + // for the current block. + // IN assertion: the fields freq and dad are set, heap[heap_max] and + // above are the tree nodes sorted by increasing frequency. + // OUT assertions: the field len is set to the optimal bit length, the + // array bl_count contains the frequencies for each bit length. + // The length opt_len is updated; static_len is also updated if stree is + // not null. + internal void gen_bitlen(DeflateManager s) + { + short[] tree = dyn_tree; + short[] stree = staticTree.treeCodes; + int[] extra = staticTree.extraBits; + int base_Renamed = staticTree.extraBase; + int max_length = staticTree.maxLength; + int h; // heap index + int n, m; // iterate over the tree elements + int bits; // bit length + int xbits; // extra bits + short f; // frequency + int overflow = 0; // number of elements with bit length too large + + for (bits = 0; bits <= InternalConstants.MAX_BITS; bits++) + s.bl_count[bits] = 0; + + // In a first pass, compute the optimal bit lengths (which may + // overflow in the case of the bit length tree). + tree[s.heap[s.heap_max] * 2 + 1] = 0; // root of the heap + + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) + { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1] * 2 + 1] + 1; + if (bits > max_length) + { + bits = max_length; overflow++; + } + tree[n * 2 + 1] = (short) bits; + // We overwrite tree[n*2+1] which is no longer needed + + if (n > max_code) + continue; // not a leaf node + + s.bl_count[bits]++; + xbits = 0; + if (n >= base_Renamed) + xbits = extra[n - base_Renamed]; + f = tree[n * 2]; + s.opt_len += f * (bits + xbits); + if (stree != null) + s.static_len += f * (stree[n * 2 + 1] + xbits); + } + if (overflow == 0) + return ; + + // This happens for example on obj2 and pic of the Calgary corpus + // Find the first bit length which could increase: + do + { + bits = max_length - 1; + while (s.bl_count[bits] == 0) + bits--; + s.bl_count[bits]--; // move one leaf down the tree + s.bl_count[bits + 1] = (short) (s.bl_count[bits + 1] + 2); // move one overflow item as its brother + s.bl_count[max_length]--; + // The brother of the overflow item also moves one step up, + // but this does not affect bl_count[max_length] + overflow -= 2; + } + while (overflow > 0); + + for (bits = max_length; bits != 0; bits--) + { + n = s.bl_count[bits]; + while (n != 0) + { + m = s.heap[--h]; + if (m > max_code) + continue; + if (tree[m * 2 + 1] != bits) + { + s.opt_len = (int) (s.opt_len + ((long) bits - (long) tree[m * 2 + 1]) * (long) tree[m * 2]); + tree[m * 2 + 1] = (short) bits; + } + n--; + } + } + } + + // Construct one Huffman tree and assigns the code bit strings and lengths. + // Update the total bit length for the current block. + // IN assertion: the field freq is set for all tree elements. + // OUT assertions: the fields len and code are set to the optimal bit length + // and corresponding code. The length opt_len is updated; static_len is + // also updated if stree is not null. The field max_code is set. + internal void build_tree(DeflateManager s) + { + short[] tree = dyn_tree; + short[] stree = staticTree.treeCodes; + int elems = staticTree.elems; + int n, m; // iterate over heap elements + int max_code = -1; // largest code with non zero frequency + int node; // new node being created + + // Construct the initial heap, with least frequent element in + // heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + // heap[0] is not used. + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for (n = 0; n < elems; n++) + { + if (tree[n * 2] != 0) + { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + } + else + { + tree[n * 2 + 1] = 0; + } + } + + // The pkzip format requires that at least one distance code exists, + // and that at least one bit should be sent even if there is only one + // possible code. So to avoid special checks later on we force at least + // two codes of non zero frequency. + while (s.heap_len < 2) + { + node = s.heap[++s.heap_len] = (max_code < 2?++max_code:0); + tree[node * 2] = 1; + s.depth[node] = 0; + s.opt_len--; + if (stree != null) + s.static_len -= stree[node * 2 + 1]; + // node is 0 or 1 so it does not have extra bits + } + this.max_code = max_code; + + // The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree, + // establish sub-heaps of increasing lengths: + + for (n = s.heap_len / 2; n >= 1; n--) + s.pqdownheap(tree, n); + + // Construct the Huffman tree by repeatedly combining the least two + // frequent nodes. + + node = elems; // next internal node of the tree + do + { + // n = node of least frequency + n = s.heap[1]; + s.heap[1] = s.heap[s.heap_len--]; + s.pqdownheap(tree, 1); + m = s.heap[1]; // m = node of next least frequency + + s.heap[--s.heap_max] = n; // keep the nodes sorted by frequency + s.heap[--s.heap_max] = m; + + // Create a new node father of n and m + tree[node * 2] = unchecked((short) (tree[n * 2] + tree[m * 2])); + s.depth[node] = (sbyte) (System.Math.Max((byte) s.depth[n], (byte) s.depth[m]) + 1); + tree[n * 2 + 1] = tree[m * 2 + 1] = (short) node; + + // and insert the new node in the heap + s.heap[1] = node++; + s.pqdownheap(tree, 1); + } + while (s.heap_len >= 2); + + s.heap[--s.heap_max] = s.heap[1]; + + // At this point, the fields freq and dad are set. We can now + // generate the bit lengths. + + gen_bitlen(s); + + // The field len is now set, we can generate the bit codes + gen_codes(tree, max_code, s.bl_count); + } + + // Generate the codes for a given tree and bit counts (which need not be + // optimal). + // IN assertion: the array bl_count contains the bit length statistics for + // the given tree and the field len is set for all tree elements. + // OUT assertion: the field code is set for all tree elements of non + // zero code length. + internal static void gen_codes(short[] tree, int max_code, short[] bl_count) + { + short[] next_code = new short[InternalConstants.MAX_BITS + 1]; // next code value for each bit length + short code = 0; // running code value + int bits; // bit index + int n; // code index + + // The distribution counts are first used to generate the code values + // without bit reversal. + for (bits = 1; bits <= InternalConstants.MAX_BITS; bits++) + unchecked { + next_code[bits] = code = (short) ((code + bl_count[bits - 1]) << 1); + } + + // Check that the bit counts in bl_count are consistent. The last code + // must be all ones. + //Assert (code + bl_count[MAX_BITS]-1 == (1<>= 1; //SharedUtils.URShift(code, 1); + res <<= 1; + } + while (--len > 0); + return res >> 1; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZTree.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZTree.cs.meta new file mode 100644 index 00000000..47691c86 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZTree.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 567080ac494bf3b47acca3e05bf46e84 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Zlib.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Zlib.cs new file mode 100644 index 00000000..082232d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Zlib.cs @@ -0,0 +1,546 @@ +// Zlib.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009-2011 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// Last Saved: <2011-August-03 19:52:28> +// +// ------------------------------------------------------------------ +// +// This module defines classes for ZLIB compression and +// decompression. This code is derived from the jzlib implementation of +// zlib, but significantly modified. The object model is not the same, +// and many of the behaviors are new or different. Nonetheless, in +// keeping with the license for jzlib, the copyright to that code is +// included below. +// +// ------------------------------------------------------------------ +// +// The following notice applies to jzlib: +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// jzlib is based on zlib-1.1.3. +// +// The following notice applies to zlib: +// +// ----------------------------------------------------------------------- +// +// Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler +// +// The ZLIB software is provided 'as-is', without any express or implied +// warranty. In no event will the authors be held liable for any damages +// arising from the use of this software. +// +// Permission is granted to anyone to use this software for any purpose, +// including commercial applications, and to alter it and redistribute it +// freely, subject to the following restrictions: +// +// 1. The origin of this software must not be misrepresented; you must not +// claim that you wrote the original software. If you use this software +// in a product, an acknowledgment in the product documentation would be +// appreciated but is not required. +// 2. Altered source versions must be plainly marked as such, and must not be +// misrepresented as being the original software. +// 3. This notice may not be removed or altered from any source distribution. +// +// Jean-loup Gailly jloup@gzip.org +// Mark Adler madler@alumni.caltech.edu +// +// ----------------------------------------------------------------------- + + + +using System; +using Interop=System.Runtime.InteropServices; + +namespace BestHTTP.Decompression.Zlib +{ + + /// + /// Describes how to flush the current deflate operation. + /// + /// + /// The different FlushType values are useful when using a Deflate in a streaming application. + /// + public enum FlushType + { + /// No flush at all. + None = 0, + + /// Closes the current block, but doesn't flush it to + /// the output. Used internally only in hypothetical + /// scenarios. This was supposed to be removed by Zlib, but it is + /// still in use in some edge cases. + /// + Partial, + + /// + /// Use this during compression to specify that all pending output should be + /// flushed to the output buffer and the output should be aligned on a byte + /// boundary. You might use this in a streaming communication scenario, so that + /// the decompressor can get all input data available so far. When using this + /// with a ZlibCodec, AvailableBytesIn will be zero after the call if + /// enough output space has been provided before the call. Flushing will + /// degrade compression and so it should be used only when necessary. + /// + Sync, + + /// + /// Use this during compression to specify that all output should be flushed, as + /// with FlushType.Sync, but also, the compression state should be reset + /// so that decompression can restart from this point if previous compressed + /// data has been damaged or if random access is desired. Using + /// FlushType.Full too often can significantly degrade the compression. + /// + Full, + + /// Signals the end of the compression/decompression stream. + Finish, + } + + + /// + /// The compression level to be used when using a DeflateStream or ZlibStream with CompressionMode.Compress. + /// + public enum CompressionLevel + { + /// + /// None means that the data will be simply stored, with no change at all. + /// If you are producing ZIPs for use on Mac OSX, be aware that archives produced with CompressionLevel.None + /// cannot be opened with the default zip reader. Use a different CompressionLevel. + /// + None= 0, + /// + /// Same as None. + /// + Level0 = 0, + + /// + /// The fastest but least effective compression. + /// + BestSpeed = 1, + + /// + /// A synonym for BestSpeed. + /// + Level1 = 1, + + /// + /// A little slower, but better, than level 1. + /// + Level2 = 2, + + /// + /// A little slower, but better, than level 2. + /// + Level3 = 3, + + /// + /// A little slower, but better, than level 3. + /// + Level4 = 4, + + /// + /// A little slower than level 4, but with better compression. + /// + Level5 = 5, + + /// + /// The default compression level, with a good balance of speed and compression efficiency. + /// + Default = 6, + /// + /// A synonym for Default. + /// + Level6 = 6, + + /// + /// Pretty good compression! + /// + Level7 = 7, + + /// + /// Better compression than Level7! + /// + Level8 = 8, + + /// + /// The "best" compression, where best means greatest reduction in size of the input data stream. + /// This is also the slowest compression. + /// + BestCompression = 9, + + /// + /// A synonym for BestCompression. + /// + Level9 = 9, + } + + /// + /// Describes options for how the compression algorithm is executed. Different strategies + /// work better on different sorts of data. The strategy parameter can affect the compression + /// ratio and the speed of compression but not the correctness of the compresssion. + /// + public enum CompressionStrategy + { + /// + /// The default strategy is probably the best for normal data. + /// + Default = 0, + + /// + /// The Filtered strategy is intended to be used most effectively with data produced by a + /// filter or predictor. By this definition, filtered data consists mostly of small + /// values with a somewhat random distribution. In this case, the compression algorithm + /// is tuned to compress them better. The effect of Filtered is to force more Huffman + /// coding and less string matching; it is a half-step between Default and HuffmanOnly. + /// + Filtered = 1, + + /// + /// Using HuffmanOnly will force the compressor to do Huffman encoding only, with no + /// string matching. + /// + HuffmanOnly = 2, + } + + + /// + /// An enum to specify the direction of transcoding - whether to compress or decompress. + /// + public enum CompressionMode + { + /// + /// Used to specify that the stream should compress the data. + /// + Compress= 0, + /// + /// Used to specify that the stream should decompress the data. + /// + Decompress = 1, + } + + + /// + /// A general purpose exception class for exceptions in the Zlib library. + /// + [Interop.GuidAttribute("ebc25cf6-9120-4283-b972-0e5520d0000E")] + internal class ZlibException : System.Exception + { + /// + /// The ZlibException class captures exception information generated + /// by the Zlib library. + /// + public ZlibException() + : base() + { + } + + /// + /// This ctor collects a message attached to the exception. + /// + /// the message for the exception. + public ZlibException(System.String s) + : base(s) + { + } + } + + + internal class SharedUtils + { + /// + /// Performs an unsigned bitwise right shift with the specified number + /// + /// Number to operate on + /// Ammount of bits to shift + /// The resulting number from the shift operation + public static int URShift(int number, int bits) + { + return (int)((uint)number >> bits); + } + +#if NOT + /// + /// Performs an unsigned bitwise right shift with the specified number + /// + /// Number to operate on + /// Ammount of bits to shift + /// The resulting number from the shift operation + public static long URShift(long number, int bits) + { + return (long) ((UInt64)number >> bits); + } +#endif + + /// + /// Reads a number of characters from the current source TextReader and writes + /// the data to the target array at the specified index. + /// + /// + /// The source TextReader to read from + /// Contains the array of characteres read from the source TextReader. + /// The starting index of the target array. + /// The maximum number of characters to read from the source TextReader. + /// + /// + /// The number of characters read. The number will be less than or equal to + /// count depending on the data available in the source TextReader. Returns -1 + /// if the end of the stream is reached. + /// + public static System.Int32 ReadInput(System.IO.TextReader sourceTextReader, byte[] target, int start, int count) + { + // Returns 0 bytes if not enough space in target + if (target.Length == 0) return 0; + + char[] charArray = new char[target.Length]; + int bytesRead = sourceTextReader.Read(charArray, start, count); + + // Returns -1 if EOF + if (bytesRead == 0) return -1; + + for (int index = start; index < start + bytesRead; index++) + target[index] = (byte)charArray[index]; + + return bytesRead; + } + + + internal static byte[] ToByteArray(System.String sourceString) + { + return System.Text.UTF8Encoding.UTF8.GetBytes(sourceString); + } + + + internal static char[] ToCharArray(byte[] byteArray) + { + return System.Text.UTF8Encoding.UTF8.GetChars(byteArray); + } + } + + internal static class InternalConstants + { + internal static readonly int MAX_BITS = 15; + internal static readonly int BL_CODES = 19; + internal static readonly int D_CODES = 30; + internal static readonly int LITERALS = 256; + internal static readonly int LENGTH_CODES = 29; + internal static readonly int L_CODES = (LITERALS + 1 + LENGTH_CODES); + + // Bit length codes must not exceed MAX_BL_BITS bits + internal static readonly int MAX_BL_BITS = 7; + + // repeat previous bit length 3-6 times (2 bits of repeat count) + internal static readonly int REP_3_6 = 16; + + // repeat a zero length 3-10 times (3 bits of repeat count) + internal static readonly int REPZ_3_10 = 17; + + // repeat a zero length 11-138 times (7 bits of repeat count) + internal static readonly int REPZ_11_138 = 18; + + } + + internal sealed class StaticTree + { + internal static readonly short[] lengthAndLiteralsTreeCodes = new short[] { + 12, 8, 140, 8, 76, 8, 204, 8, 44, 8, 172, 8, 108, 8, 236, 8, + 28, 8, 156, 8, 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, 252, 8, + 2, 8, 130, 8, 66, 8, 194, 8, 34, 8, 162, 8, 98, 8, 226, 8, + 18, 8, 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, 114, 8, 242, 8, + 10, 8, 138, 8, 74, 8, 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, + 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, 186, 8, 122, 8, 250, 8, + 6, 8, 134, 8, 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, 230, 8, + 22, 8, 150, 8, 86, 8, 214, 8, 54, 8, 182, 8, 118, 8, 246, 8, + 14, 8, 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, 110, 8, 238, 8, + 30, 8, 158, 8, 94, 8, 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, + 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, 161, 8, 97, 8, 225, 8, + 17, 8, 145, 8, 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, 241, 8, + 9, 8, 137, 8, 73, 8, 201, 8, 41, 8, 169, 8, 105, 8, 233, 8, + 25, 8, 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, 121, 8, 249, 8, + 5, 8, 133, 8, 69, 8, 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, + 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, 181, 8, 117, 8, 245, 8, + 13, 8, 141, 8, 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, 237, 8, + 29, 8, 157, 8, 93, 8, 221, 8, 61, 8, 189, 8, 125, 8, 253, 8, + 19, 9, 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, 211, 9, 467, 9, + 51, 9, 307, 9, 179, 9, 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, + 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, 331, 9, 203, 9, 459, 9, + 43, 9, 299, 9, 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, 491, 9, + 27, 9, 283, 9, 155, 9, 411, 9, 91, 9, 347, 9, 219, 9, 475, 9, + 59, 9, 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, 251, 9, 507, 9, + 7, 9, 263, 9, 135, 9, 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, + 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, 359, 9, 231, 9, 487, 9, + 23, 9, 279, 9, 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, 471, 9, + 55, 9, 311, 9, 183, 9, 439, 9, 119, 9, 375, 9, 247, 9, 503, 9, + 15, 9, 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, 207, 9, 463, 9, + 47, 9, 303, 9, 175, 9, 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, + 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, 351, 9, 223, 9, 479, 9, + 63, 9, 319, 9, 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, 511, 9, + 0, 7, 64, 7, 32, 7, 96, 7, 16, 7, 80, 7, 48, 7, 112, 7, + 8, 7, 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, 56, 7, 120, 7, + 4, 7, 68, 7, 36, 7, 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, + 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, 163, 8, 99, 8, 227, 8 + }; + + internal static readonly short[] distTreeCodes = new short[] { + 0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, + 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, + 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, + 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5 }; + + internal static readonly StaticTree Literals; + internal static readonly StaticTree Distances; + internal static readonly StaticTree BitLengths; + + internal short[] treeCodes; // static tree or null + internal int[] extraBits; // extra bits for each code or null + internal int extraBase; // base index for extra_bits + internal int elems; // max number of elements in the tree + internal int maxLength; // max bit length for the codes + + private StaticTree(short[] treeCodes, int[] extraBits, int extraBase, int elems, int maxLength) + { + this.treeCodes = treeCodes; + this.extraBits = extraBits; + this.extraBase = extraBase; + this.elems = elems; + this.maxLength = maxLength; + } + static StaticTree() + { + Literals = new StaticTree(lengthAndLiteralsTreeCodes, ZTree.ExtraLengthBits, InternalConstants.LITERALS + 1, InternalConstants.L_CODES, InternalConstants.MAX_BITS); + Distances = new StaticTree(distTreeCodes, ZTree.ExtraDistanceBits, 0, InternalConstants.D_CODES, InternalConstants.MAX_BITS); + BitLengths = new StaticTree(null, ZTree.extra_blbits, 0, InternalConstants.BL_CODES, InternalConstants.MAX_BL_BITS); + } + } + + + + /// + /// Computes an Adler-32 checksum. + /// + /// + /// The Adler checksum is similar to a CRC checksum, but faster to compute, though less + /// reliable. It is used in producing RFC1950 compressed streams. The Adler checksum + /// is a required part of the "ZLIB" standard. Applications will almost never need to + /// use this class directly. + /// + /// + /// + public sealed class Adler + { + // largest prime smaller than 65536 + private static readonly uint BASE = 65521; + // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 + private static readonly int NMAX = 5552; + + +#pragma warning disable 3001 +#pragma warning disable 3002 + + /// + /// Calculates the Adler32 checksum. + /// + /// + /// + /// This is used within ZLIB. You probably don't need to use this directly. + /// + /// + /// + /// To compute an Adler32 checksum on a byte array: + /// + /// var adler = Adler.Adler32(0, null, 0, 0); + /// adler = Adler.Adler32(adler, buffer, index, length); + /// + /// + public static uint Adler32(uint adler, byte[] buf, int index, int len) + { + if (buf == null) + return 1; + + uint s1 = (uint) (adler & 0xffff); + uint s2 = (uint) ((adler >> 16) & 0xffff); + + while (len > 0) + { + int k = len < NMAX ? len : NMAX; + len -= k; + while (k >= 16) + { + //s1 += (buf[index++] & 0xff); s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + s1 += buf[index++]; s2 += s1; + k -= 16; + } + if (k != 0) + { + do + { + s1 += buf[index++]; + s2 += s1; + } + while (--k != 0); + } + s1 %= BASE; + s2 %= BASE; + } + return (uint)((s2 << 16) | s1); + } +#pragma warning restore 3001 +#pragma warning restore 3002 + + } + +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Zlib.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Zlib.cs.meta new file mode 100644 index 00000000..a81b918d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/Zlib.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7d946fbf5f38d4049a7b50fe52bd8b0e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibBaseStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibBaseStream.cs new file mode 100644 index 00000000..0eccd4f0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibBaseStream.cs @@ -0,0 +1,606 @@ +// ZlibBaseStream.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2011-August-06 21:22:38> +// +// ------------------------------------------------------------------ +// +// This module defines the ZlibBaseStream class, which is an intnernal +// base class for DeflateStream, ZlibStream and GZipStream. +// +// ------------------------------------------------------------------ + +using System; +using System.IO; + +namespace BestHTTP.Decompression.Zlib +{ + + internal enum ZlibStreamFlavor { ZLIB = 1950, DEFLATE = 1951, GZIP = 1952 } + + internal class ZlibBaseStream : System.IO.Stream + { + protected internal ZlibCodec _z = null; // deferred init... new ZlibCodec(); + + protected internal StreamMode _streamMode = StreamMode.Undefined; + protected internal FlushType _flushMode; + protected internal ZlibStreamFlavor _flavor; + protected internal CompressionMode _compressionMode; + protected internal CompressionLevel _level; + protected internal bool _leaveOpen; + protected internal byte[] _workingBuffer; + protected internal int _bufferSize = ZlibConstants.WorkingBufferSizeDefault; + protected internal int windowBitsMax; + protected internal byte[] _buf1 = new byte[1]; + + protected internal System.IO.Stream _stream; + protected internal CompressionStrategy Strategy = CompressionStrategy.Default; + + // workitem 7159 + BestHTTP.Decompression.Crc.CRC32 crc; + protected internal string _GzipFileName; + protected internal string _GzipComment; + protected internal DateTime _GzipMtime; + protected internal int _gzipHeaderByteCount; + + internal int Crc32 { get { if (crc == null) return 0; return crc.Crc32Result; } } + + public ZlibBaseStream(System.IO.Stream stream, + CompressionMode compressionMode, + CompressionLevel level, + ZlibStreamFlavor flavor, + bool leaveOpen) + :this(stream, compressionMode, level, flavor,leaveOpen, ZlibConstants.WindowBitsDefault) + { } + + public ZlibBaseStream(System.IO.Stream stream, + CompressionMode compressionMode, + CompressionLevel level, + ZlibStreamFlavor flavor, + bool leaveOpen, + int windowBits) + : base() + { + this._flushMode = FlushType.None; + //this._workingBuffer = new byte[WORKING_BUFFER_SIZE_DEFAULT]; + this._stream = stream; + this._leaveOpen = leaveOpen; + this._compressionMode = compressionMode; + this._flavor = flavor; + this._level = level; + this.windowBitsMax = windowBits; + // workitem 7159 + if (flavor == ZlibStreamFlavor.GZIP) + { + this.crc = new BestHTTP.Decompression.Crc.CRC32(); + } + } + + + protected internal bool _wantCompress + { + get + { + return (this._compressionMode == CompressionMode.Compress); + } + } + + private ZlibCodec z + { + get + { + if (_z == null) + { + bool wantRfc1950Header = (this._flavor == ZlibStreamFlavor.ZLIB); + _z = new ZlibCodec(); + if (this._compressionMode == CompressionMode.Decompress) + { + _z.InitializeInflate(this.windowBitsMax, wantRfc1950Header); + } + else + { + _z.Strategy = Strategy; + _z.InitializeDeflate(this._level, this.windowBitsMax, wantRfc1950Header); + } + } + return _z; + } + } + + + + private byte[] workingBuffer + { + get + { + if (_workingBuffer == null) + _workingBuffer = Extensions.VariableSizedBufferPool.Get(_bufferSize, true); + return _workingBuffer; + } + } + + + + public override void Write(System.Byte[] buffer, int offset, int count) + { + // workitem 7159 + // calculate the CRC on the unccompressed data (before writing) + if (crc != null) + crc.SlurpBlock(buffer, offset, count); + + if (_streamMode == StreamMode.Undefined) + _streamMode = StreamMode.Writer; + else if (_streamMode != StreamMode.Writer) + throw new ZlibException("Cannot Write after Reading."); + + if (count == 0) + return; + + // first reference of z property will initialize the private var _z + z.InputBuffer = buffer; + _z.NextIn = offset; + _z.AvailableBytesIn = count; + bool done = false; + do + { + _z.OutputBuffer = workingBuffer; + _z.NextOut = 0; + _z.AvailableBytesOut = _workingBuffer.Length; + int rc = (_wantCompress) + ? _z.Deflate(_flushMode) + : _z.Inflate(_flushMode); + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new ZlibException((_wantCompress ? "de" : "in") + "flating: " + _z.Message); + + //if (_workingBuffer.Length - _z.AvailableBytesOut > 0) + _stream.Write(_workingBuffer, 0, _workingBuffer.Length - _z.AvailableBytesOut); + + done = _z.AvailableBytesIn == 0 && _z.AvailableBytesOut != 0; + + // If GZIP and de-compress, we're done when 8 bytes remain. + if (_flavor == ZlibStreamFlavor.GZIP && !_wantCompress) + done = (_z.AvailableBytesIn == 8 && _z.AvailableBytesOut != 0); + + } + while (!done); + } + + + + private void finish() + { + if (_z == null) return; + + if (_streamMode == StreamMode.Writer) + { + bool done = false; + do + { + _z.OutputBuffer = workingBuffer; + _z.NextOut = 0; + _z.AvailableBytesOut = _workingBuffer.Length; + int rc = (_wantCompress) + ? _z.Deflate(FlushType.Finish) + : _z.Inflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + { + string verb = (_wantCompress ? "de" : "in") + "flating"; + if (_z.Message == null) + throw new ZlibException(String.Format("{0}: (rc = {1})", verb, rc)); + else + throw new ZlibException(verb + ": " + _z.Message); + } + + if (_workingBuffer.Length - _z.AvailableBytesOut > 0) + { + _stream.Write(_workingBuffer, 0, _workingBuffer.Length - _z.AvailableBytesOut); + } + + done = _z.AvailableBytesIn == 0 && _z.AvailableBytesOut != 0; + // If GZIP and de-compress, we're done when 8 bytes remain. + if (_flavor == ZlibStreamFlavor.GZIP && !_wantCompress) + done = (_z.AvailableBytesIn == 8 && _z.AvailableBytesOut != 0); + + } + while (!done); + + Flush(); + + // workitem 7159 + if (_flavor == ZlibStreamFlavor.GZIP) + { + if (_wantCompress) + { + // Emit the GZIP trailer: CRC32 and size mod 2^32 + int c1 = crc.Crc32Result; + _stream.Write(BitConverter.GetBytes(c1), 0, 4); + int c2 = (Int32)(crc.TotalBytesRead & 0x00000000FFFFFFFF); + _stream.Write(BitConverter.GetBytes(c2), 0, 4); + } + else + { + throw new ZlibException("Writing with decompression is not supported."); + } + } + } + // workitem 7159 + else if (_streamMode == StreamMode.Reader) + { + if (_flavor == ZlibStreamFlavor.GZIP) + { + if (!_wantCompress) + { + // workitem 8501: handle edge case (decompress empty stream) + if (_z.TotalBytesOut == 0L) + return; + + // Read and potentially verify the GZIP trailer: + // CRC32 and size mod 2^32 + byte[] trailer = Extensions.VariableSizedBufferPool.Get(8, true); + + // workitems 8679 & 12554 + if (_z.AvailableBytesIn < 8) + { + // Make sure we have read to the end of the stream + Array.Copy(_z.InputBuffer, _z.NextIn, trailer, 0, _z.AvailableBytesIn); + int bytesNeeded = 8 - _z.AvailableBytesIn; + int bytesRead = _stream.Read(trailer, + _z.AvailableBytesIn, + bytesNeeded); + if (bytesNeeded != bytesRead) + { + Extensions.VariableSizedBufferPool.Release(trailer); + throw new ZlibException(String.Format("Missing or incomplete GZIP trailer. Expected 8 bytes, got {0}.", + _z.AvailableBytesIn + bytesRead)); + } + } + else + { + Array.Copy(_z.InputBuffer, _z.NextIn, trailer, 0, 8); + } + + Int32 crc32_expected = BitConverter.ToInt32(trailer, 0); + Int32 crc32_actual = crc.Crc32Result; + Int32 isize_expected = BitConverter.ToInt32(trailer, 4); + Int32 isize_actual = (Int32)(_z.TotalBytesOut & 0x00000000FFFFFFFF); + + if (crc32_actual != crc32_expected) + { + Extensions.VariableSizedBufferPool.Release(trailer); + throw new ZlibException(String.Format("Bad CRC32 in GZIP trailer. (actual({0:X8})!=expected({1:X8}))", crc32_actual, crc32_expected)); + } + + if (isize_actual != isize_expected) + { + Extensions.VariableSizedBufferPool.Release(trailer); + throw new ZlibException(String.Format("Bad size in GZIP trailer. (actual({0})!=expected({1}))", isize_actual, isize_expected)); + } + Extensions.VariableSizedBufferPool.Release(trailer); + } + else + { + throw new ZlibException("Reading with compression is not supported."); + } + } + } + } + + + private void end() + { + if (z == null) + return; + if (_wantCompress) + { + _z.EndDeflate(); + } + else + { + _z.EndInflate(); + } + _z = null; + Extensions.VariableSizedBufferPool.Release(_workingBuffer); + _workingBuffer = null; + } + + + public +#if !NETFX_CORE + override +#endif + void Close() + { + if (_stream == null) return; + try + { + finish(); + } + finally + { + end(); + if (!_leaveOpen) _stream.Dispose(); + _stream = null; + } + } + + public override void Flush() + { + _stream.Flush(); + } + + public override System.Int64 Seek(System.Int64 offset, System.IO.SeekOrigin origin) + { + throw new NotImplementedException(); + //_outStream.Seek(offset, origin); + } + public override void SetLength(System.Int64 value) + { + _stream.SetLength(value); + nomoreinput = false; + } + + +#if NOT + public int Read() + { + if (Read(_buf1, 0, 1) == 0) + return 0; + // calculate CRC after reading + if (crc!=null) + crc.SlurpBlock(_buf1,0,1); + return (_buf1[0] & 0xFF); + } +#endif + + private bool nomoreinput = false; + + + + private string ReadZeroTerminatedString() + { + var list = new System.Collections.Generic.List(); + bool done = false; + do + { + // workitem 7740 + int n = _stream.Read(_buf1, 0, 1); + if (n != 1) + throw new ZlibException("Unexpected EOF reading GZIP header."); + else + { + if (_buf1[0] == 0) + done = true; + else + list.Add(_buf1[0]); + } + } while (!done); + byte[] a = list.ToArray(); + return GZipStream.iso8859dash1.GetString(a, 0, a.Length); + } + + + private int _ReadAndValidateGzipHeader() + { + int totalBytesRead = 0; + // read the header on the first read + byte[] header = Extensions.VariableSizedBufferPool.Get(10, true); + int n = _stream.Read(header, 0, 10); + + // workitem 8501: handle edge case (decompress empty stream) + if (n == 0) + { + Extensions.VariableSizedBufferPool.Release(header); + return 0; + } + + if (n != 10) + { + Extensions.VariableSizedBufferPool.Release(header); + throw new ZlibException("Not a valid GZIP stream."); + } + + if (header[0] != 0x1F || header[1] != 0x8B || header[2] != 8) + { + Extensions.VariableSizedBufferPool.Release(header); + throw new ZlibException("Bad GZIP header."); + } + + Int32 timet = BitConverter.ToInt32(header, 4); + _GzipMtime = GZipStream._unixEpoch.AddSeconds(timet); + totalBytesRead += n; + if ((header[3] & 0x04) == 0x04) + { + // read and discard extra field + n = _stream.Read(header, 0, 2); // 2-byte length field + totalBytesRead += n; + + Int16 extraLength = (Int16)(header[0] + header[1] * 256); + byte[] extra = Extensions.VariableSizedBufferPool.Get(extraLength, true); + n = _stream.Read(extra, 0, extraLength); + if (n != extraLength) + { + Extensions.VariableSizedBufferPool.Release(extra); + Extensions.VariableSizedBufferPool.Release(header); + throw new ZlibException("Unexpected end-of-file reading GZIP header."); + } + totalBytesRead += n; + } + if ((header[3] & 0x08) == 0x08) + _GzipFileName = ReadZeroTerminatedString(); + if ((header[3] & 0x10) == 0x010) + _GzipComment = ReadZeroTerminatedString(); + if ((header[3] & 0x02) == 0x02) + Read(_buf1, 0, 1); // CRC16, ignore + + Extensions.VariableSizedBufferPool.Release(header); + return totalBytesRead; + } + + + + public override System.Int32 Read(System.Byte[] buffer, System.Int32 offset, System.Int32 count) + { + // According to MS documentation, any implementation of the IO.Stream.Read function must: + // (a) throw an exception if offset & count reference an invalid part of the buffer, + // or if count < 0, or if buffer is null + // (b) return 0 only upon EOF, or if count = 0 + // (c) if not EOF, then return at least 1 byte, up to bytes + + if (_streamMode == StreamMode.Undefined) + { + if (!this._stream.CanRead) throw new ZlibException("The stream is not readable."); + // for the first read, set up some controls. + _streamMode = StreamMode.Reader; + // (The first reference to _z goes through the private accessor which + // may initialize it.) + z.AvailableBytesIn = 0; + if (_flavor == ZlibStreamFlavor.GZIP) + { + _gzipHeaderByteCount = _ReadAndValidateGzipHeader(); + // workitem 8501: handle edge case (decompress empty stream) + if (_gzipHeaderByteCount == 0) + return 0; + } + } + + if (_streamMode != StreamMode.Reader) + throw new ZlibException("Cannot Read after Writing."); + + if (count == 0) return 0; + if (nomoreinput && _wantCompress) return 0; // workitem 8557 + if (buffer == null) throw new ArgumentNullException("buffer"); + if (count < 0) throw new ArgumentOutOfRangeException("count"); + if (offset < buffer.GetLowerBound(0)) throw new ArgumentOutOfRangeException("offset"); + if ((offset + count) > buffer.GetLength(0)) throw new ArgumentOutOfRangeException("count"); + + int rc = 0; + + // set up the output of the deflate/inflate codec: + _z.OutputBuffer = buffer; + _z.NextOut = offset; + _z.AvailableBytesOut = count; + + // This is necessary in case _workingBuffer has been resized. (new byte[]) + // (The first reference to _workingBuffer goes through the private accessor which + // may initialize it.) + _z.InputBuffer = workingBuffer; + + do + { + // need data in _workingBuffer in order to deflate/inflate. Here, we check if we have any. + if ((_z.AvailableBytesIn == 0) && (!nomoreinput)) + { + // No data available, so try to Read data from the captive stream. + _z.NextIn = 0; + _z.AvailableBytesIn = _stream.Read(_workingBuffer, 0, _workingBuffer.Length); + if (_z.AvailableBytesIn == 0) + nomoreinput = true; + + } + // we have data in InputBuffer; now compress or decompress as appropriate + rc = (_wantCompress) + ? _z.Deflate(_flushMode) + : _z.Inflate(_flushMode); + + if (nomoreinput && (rc == ZlibConstants.Z_BUF_ERROR)) + return 0; + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new ZlibException(String.Format("{0}flating: rc={1} msg={2}", (_wantCompress ? "de" : "in"), rc, _z.Message)); + + if ((nomoreinput || rc == ZlibConstants.Z_STREAM_END) && (_z.AvailableBytesOut == count)) + break; // nothing more to read + } + //while (_z.AvailableBytesOut == count && rc == ZlibConstants.Z_OK); + while (_z.AvailableBytesOut > 0 && !nomoreinput && rc == ZlibConstants.Z_OK); + + + // workitem 8557 + // is there more room in output? + if (_z.AvailableBytesOut > 0) + { + if (rc == ZlibConstants.Z_OK && _z.AvailableBytesIn == 0) + { + // deferred + } + + // are we completely done reading? + if (nomoreinput) + { + // and in compression? + if (_wantCompress) + { + // no more input data available; therefore we flush to + // try to complete the read + rc = _z.Deflate(FlushType.Finish); + + if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + throw new ZlibException(String.Format("Deflating: rc={0} msg={1}", rc, _z.Message)); + } + } + } + + + rc = (count - _z.AvailableBytesOut); + + // calculate CRC after reading + if (crc != null) + crc.SlurpBlock(buffer, offset, rc); + + return rc; + } + + + + public override System.Boolean CanRead + { + get { return this._stream.CanRead; } + } + + public override System.Boolean CanSeek + { + get { return this._stream.CanSeek; } + } + + public override System.Boolean CanWrite + { + get { return this._stream.CanWrite; } + } + + public override System.Int64 Length + { + get { return _stream.Length; } + } + + public override long Position + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + internal enum StreamMode + { + Writer, + Reader, + Undefined, + } + + } + + +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibBaseStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibBaseStream.cs.meta new file mode 100644 index 00000000..7824525c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibBaseStream.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b34dd239e486b474aad68fb4080797c8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibCodec.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibCodec.cs new file mode 100644 index 00000000..2e45ee73 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibCodec.cs @@ -0,0 +1,712 @@ +// ZlibCodec.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-November-03 15:40:51> +// +// ------------------------------------------------------------------ +// +// This module defines a Codec for ZLIB compression and +// decompression. This code extends code that was based the jzlib +// implementation of zlib, but this code is completely novel. The codec +// class is new, and encapsulates some behaviors that are new, and some +// that were present in other classes in the jzlib code base. In +// keeping with the license for jzlib, the copyright to the jzlib code +// is included below. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; +using Interop=System.Runtime.InteropServices; + +namespace BestHTTP.Decompression.Zlib +{ + /// + /// Encoder and Decoder for ZLIB and DEFLATE (IETF RFC1950 and RFC1951). + /// + /// + /// + /// This class compresses and decompresses data according to the Deflate algorithm + /// and optionally, the ZLIB format, as documented in RFC 1950 - ZLIB and RFC 1951 - DEFLATE. + /// + sealed internal class ZlibCodec + { + /// + /// The buffer from which data is taken. + /// + public byte[] InputBuffer; + + /// + /// An index into the InputBuffer array, indicating where to start reading. + /// + public int NextIn; + + /// + /// The number of bytes available in the InputBuffer, starting at NextIn. + /// + /// + /// Generally you should set this to InputBuffer.Length before the first Inflate() or Deflate() call. + /// The class will update this number as calls to Inflate/Deflate are made. + /// + public int AvailableBytesIn; + + /// + /// Total number of bytes read so far, through all calls to Inflate()/Deflate(). + /// + public long TotalBytesIn; + + /// + /// Buffer to store output data. + /// + public byte[] OutputBuffer; + + /// + /// An index into the OutputBuffer array, indicating where to start writing. + /// + public int NextOut; + + /// + /// The number of bytes available in the OutputBuffer, starting at NextOut. + /// + /// + /// Generally you should set this to OutputBuffer.Length before the first Inflate() or Deflate() call. + /// The class will update this number as calls to Inflate/Deflate are made. + /// + public int AvailableBytesOut; + + /// + /// Total number of bytes written to the output so far, through all calls to Inflate()/Deflate(). + /// + public long TotalBytesOut; + + /// + /// used for diagnostics, when something goes wrong! + /// + public System.String Message; + + internal DeflateManager dstate; + internal InflateManager istate; + + internal uint _Adler32; + + /// + /// The compression level to use in this codec. Useful only in compression mode. + /// + public CompressionLevel CompressLevel = CompressionLevel.Default; + + /// + /// The number of Window Bits to use. + /// + /// + /// This gauges the size of the sliding window, and hence the + /// compression effectiveness as well as memory consumption. It's best to just leave this + /// setting alone if you don't know what it is. The maximum value is 15 bits, which implies + /// a 32k window. + /// + public int WindowBits = ZlibConstants.WindowBitsDefault; + + /// + /// The compression strategy to use. + /// + /// + /// This is only effective in compression. The theory offered by ZLIB is that different + /// strategies could potentially produce significant differences in compression behavior + /// for different data sets. Unfortunately I don't have any good recommendations for how + /// to set it differently. When I tested changing the strategy I got minimally different + /// compression performance. It's best to leave this property alone if you don't have a + /// good feel for it. Or, you may want to produce a test harness that runs through the + /// different strategy options and evaluates them on different file types. If you do that, + /// let me know your results. + /// + public CompressionStrategy Strategy = CompressionStrategy.Default; + + + /// + /// The Adler32 checksum on the data transferred through the codec so far. You probably don't need to look at this. + /// + public int Adler32 { get { return (int)_Adler32; } } + + + /// + /// Create a ZlibCodec. + /// + /// + /// If you use this default constructor, you will later have to explicitly call + /// InitializeInflate() or InitializeDeflate() before using the ZlibCodec to compress + /// or decompress. + /// + public ZlibCodec() { } + + /// + /// Create a ZlibCodec that either compresses or decompresses. + /// + /// + /// Indicates whether the codec should compress (deflate) or decompress (inflate). + /// + public ZlibCodec(CompressionMode mode) + { + if (mode == CompressionMode.Compress) + { + int rc = InitializeDeflate(); + if (rc != ZlibConstants.Z_OK) throw new ZlibException("Cannot initialize for deflate."); + } + else if (mode == CompressionMode.Decompress) + { + int rc = InitializeInflate(); + if (rc != ZlibConstants.Z_OK) throw new ZlibException("Cannot initialize for inflate."); + } + else throw new ZlibException("Invalid ZlibStreamFlavor."); + } + + /// + /// Initialize the inflation state. + /// + /// + /// It is not necessary to call this before using the ZlibCodec to inflate data; + /// It is implicitly called when you call the constructor. + /// + /// Z_OK if everything goes well. + public int InitializeInflate() + { + return InitializeInflate(this.WindowBits); + } + + /// + /// Initialize the inflation state with an explicit flag to + /// govern the handling of RFC1950 header bytes. + /// + /// + /// + /// By default, the ZLIB header defined in RFC 1950 is expected. If + /// you want to read a zlib stream you should specify true for + /// expectRfc1950Header. If you have a deflate stream, you will want to specify + /// false. It is only necessary to invoke this initializer explicitly if you + /// want to specify false. + /// + /// + /// whether to expect an RFC1950 header byte + /// pair when reading the stream of data to be inflated. + /// + /// Z_OK if everything goes well. + public int InitializeInflate(bool expectRfc1950Header) + { + return InitializeInflate(this.WindowBits, expectRfc1950Header); + } + + /// + /// Initialize the ZlibCodec for inflation, with the specified number of window bits. + /// + /// The number of window bits to use. If you need to ask what that is, + /// then you shouldn't be calling this initializer. + /// Z_OK if all goes well. + public int InitializeInflate(int windowBits) + { + this.WindowBits = windowBits; + return InitializeInflate(windowBits, true); + } + + /// + /// Initialize the inflation state with an explicit flag to govern the handling of + /// RFC1950 header bytes. + /// + /// + /// + /// If you want to read a zlib stream you should specify true for + /// expectRfc1950Header. In this case, the library will expect to find a ZLIB + /// header, as defined in RFC + /// 1950, in the compressed stream. If you will be reading a DEFLATE or + /// GZIP stream, which does not have such a header, you will want to specify + /// false. + /// + /// + /// whether to expect an RFC1950 header byte pair when reading + /// the stream of data to be inflated. + /// The number of window bits to use. If you need to ask what that is, + /// then you shouldn't be calling this initializer. + /// Z_OK if everything goes well. + public int InitializeInflate(int windowBits, bool expectRfc1950Header) + { + this.WindowBits = windowBits; + if (dstate != null) throw new ZlibException("You may not call InitializeInflate() after calling InitializeDeflate()."); + istate = new InflateManager(expectRfc1950Header); + return istate.Initialize(this, windowBits); + } + + /// + /// Inflate the data in the InputBuffer, placing the result in the OutputBuffer. + /// + /// + /// You must have set InputBuffer and OutputBuffer, NextIn and NextOut, and AvailableBytesIn and + /// AvailableBytesOut before calling this method. + /// + /// + /// + /// private void InflateBuffer() + /// { + /// int bufferSize = 1024; + /// byte[] buffer = new byte[bufferSize]; + /// ZlibCodec decompressor = new ZlibCodec(); + /// + /// Console.WriteLine("\n============================================"); + /// Console.WriteLine("Size of Buffer to Inflate: {0} bytes.", CompressedBytes.Length); + /// MemoryStream ms = new MemoryStream(DecompressedBytes); + /// + /// int rc = decompressor.InitializeInflate(); + /// + /// decompressor.InputBuffer = CompressedBytes; + /// decompressor.NextIn = 0; + /// decompressor.AvailableBytesIn = CompressedBytes.Length; + /// + /// decompressor.OutputBuffer = buffer; + /// + /// // pass 1: inflate + /// do + /// { + /// decompressor.NextOut = 0; + /// decompressor.AvailableBytesOut = buffer.Length; + /// rc = decompressor.Inflate(FlushType.None); + /// + /// if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + /// throw new Exception("inflating: " + decompressor.Message); + /// + /// ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut); + /// } + /// while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + /// + /// // pass 2: finish and flush + /// do + /// { + /// decompressor.NextOut = 0; + /// decompressor.AvailableBytesOut = buffer.Length; + /// rc = decompressor.Inflate(FlushType.Finish); + /// + /// if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + /// throw new Exception("inflating: " + decompressor.Message); + /// + /// if (buffer.Length - decompressor.AvailableBytesOut > 0) + /// ms.Write(buffer, 0, buffer.Length - decompressor.AvailableBytesOut); + /// } + /// while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0); + /// + /// decompressor.EndInflate(); + /// } + /// + /// + /// + /// The flush to use when inflating. + /// Z_OK if everything goes well. + public int Inflate(FlushType flush) + { + if (istate == null) + throw new ZlibException("No Inflate State!"); + return istate.Inflate(flush); + } + + + /// + /// Ends an inflation session. + /// + /// + /// Call this after successively calling Inflate(). This will cause all buffers to be flushed. + /// After calling this you cannot call Inflate() without a intervening call to one of the + /// InitializeInflate() overloads. + /// + /// Z_OK if everything goes well. + public int EndInflate() + { + if (istate == null) + throw new ZlibException("No Inflate State!"); + int ret = istate.End(); + istate = null; + return ret; + } + + /// + /// I don't know what this does! + /// + /// Z_OK if everything goes well. + public int SyncInflate() + { + if (istate == null) + throw new ZlibException("No Inflate State!"); + return istate.Sync(); + } + + /// + /// Initialize the ZlibCodec for deflation operation. + /// + /// + /// The codec will use the MAX window bits and the default level of compression. + /// + /// + /// + /// int bufferSize = 40000; + /// byte[] CompressedBytes = new byte[bufferSize]; + /// byte[] DecompressedBytes = new byte[bufferSize]; + /// + /// ZlibCodec compressor = new ZlibCodec(); + /// + /// compressor.InitializeDeflate(CompressionLevel.Default); + /// + /// compressor.InputBuffer = System.Text.ASCIIEncoding.ASCII.GetBytes(TextToCompress); + /// compressor.NextIn = 0; + /// compressor.AvailableBytesIn = compressor.InputBuffer.Length; + /// + /// compressor.OutputBuffer = CompressedBytes; + /// compressor.NextOut = 0; + /// compressor.AvailableBytesOut = CompressedBytes.Length; + /// + /// while (compressor.TotalBytesIn != TextToCompress.Length && compressor.TotalBytesOut < bufferSize) + /// { + /// compressor.Deflate(FlushType.None); + /// } + /// + /// while (true) + /// { + /// int rc= compressor.Deflate(FlushType.Finish); + /// if (rc == ZlibConstants.Z_STREAM_END) break; + /// } + /// + /// compressor.EndDeflate(); + /// + /// + /// + /// Z_OK if all goes well. You generally don't need to check the return code. + public int InitializeDeflate() + { + return _InternalInitializeDeflate(true); + } + + /// + /// Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel. + /// + /// + /// The codec will use the maximum window bits (15) and the specified + /// CompressionLevel. It will emit a ZLIB stream as it compresses. + /// + /// The compression level for the codec. + /// Z_OK if all goes well. + public int InitializeDeflate(CompressionLevel level) + { + this.CompressLevel = level; + return _InternalInitializeDeflate(true); + } + + + /// + /// Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + /// and the explicit flag governing whether to emit an RFC1950 header byte pair. + /// + /// + /// The codec will use the maximum window bits (15) and the specified CompressionLevel. + /// If you want to generate a zlib stream, you should specify true for + /// wantRfc1950Header. In this case, the library will emit a ZLIB + /// header, as defined in RFC + /// 1950, in the compressed stream. + /// + /// The compression level for the codec. + /// whether to emit an initial RFC1950 byte pair in the compressed stream. + /// Z_OK if all goes well. + public int InitializeDeflate(CompressionLevel level, bool wantRfc1950Header) + { + this.CompressLevel = level; + return _InternalInitializeDeflate(wantRfc1950Header); + } + + + /// + /// Initialize the ZlibCodec for deflation operation, using the specified CompressionLevel, + /// and the specified number of window bits. + /// + /// + /// The codec will use the specified number of window bits and the specified CompressionLevel. + /// + /// The compression level for the codec. + /// the number of window bits to use. If you don't know what this means, don't use this method. + /// Z_OK if all goes well. + public int InitializeDeflate(CompressionLevel level, int bits) + { + this.CompressLevel = level; + this.WindowBits = bits; + return _InternalInitializeDeflate(true); + } + + /// + /// Initialize the ZlibCodec for deflation operation, using the specified + /// CompressionLevel, the specified number of window bits, and the explicit flag + /// governing whether to emit an RFC1950 header byte pair. + /// + /// + /// The compression level for the codec. + /// whether to emit an initial RFC1950 byte pair in the compressed stream. + /// the number of window bits to use. If you don't know what this means, don't use this method. + /// Z_OK if all goes well. + public int InitializeDeflate(CompressionLevel level, int bits, bool wantRfc1950Header) + { + this.CompressLevel = level; + this.WindowBits = bits; + return _InternalInitializeDeflate(wantRfc1950Header); + } + + private int _InternalInitializeDeflate(bool wantRfc1950Header) + { + if (istate != null) throw new ZlibException("You may not call InitializeDeflate() after calling InitializeInflate()."); + dstate = new DeflateManager(); + dstate.WantRfc1950HeaderBytes = wantRfc1950Header; + + return dstate.Initialize(this, this.CompressLevel, this.WindowBits, this.Strategy); + } + + /// + /// Deflate one batch of data. + /// + /// + /// You must have set InputBuffer and OutputBuffer before calling this method. + /// + /// + /// + /// private void DeflateBuffer(CompressionLevel level) + /// { + /// int bufferSize = 1024; + /// byte[] buffer = new byte[bufferSize]; + /// ZlibCodec compressor = new ZlibCodec(); + /// + /// Console.WriteLine("\n============================================"); + /// Console.WriteLine("Size of Buffer to Deflate: {0} bytes.", UncompressedBytes.Length); + /// MemoryStream ms = new MemoryStream(); + /// + /// int rc = compressor.InitializeDeflate(level); + /// + /// compressor.InputBuffer = UncompressedBytes; + /// compressor.NextIn = 0; + /// compressor.AvailableBytesIn = UncompressedBytes.Length; + /// + /// compressor.OutputBuffer = buffer; + /// + /// // pass 1: deflate + /// do + /// { + /// compressor.NextOut = 0; + /// compressor.AvailableBytesOut = buffer.Length; + /// rc = compressor.Deflate(FlushType.None); + /// + /// if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END) + /// throw new Exception("deflating: " + compressor.Message); + /// + /// ms.Write(compressor.OutputBuffer, 0, buffer.Length - compressor.AvailableBytesOut); + /// } + /// while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + /// + /// // pass 2: finish and flush + /// do + /// { + /// compressor.NextOut = 0; + /// compressor.AvailableBytesOut = buffer.Length; + /// rc = compressor.Deflate(FlushType.Finish); + /// + /// if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK) + /// throw new Exception("deflating: " + compressor.Message); + /// + /// if (buffer.Length - compressor.AvailableBytesOut > 0) + /// ms.Write(buffer, 0, buffer.Length - compressor.AvailableBytesOut); + /// } + /// while (compressor.AvailableBytesIn > 0 || compressor.AvailableBytesOut == 0); + /// + /// compressor.EndDeflate(); + /// + /// ms.Seek(0, SeekOrigin.Begin); + /// CompressedBytes = new byte[compressor.TotalBytesOut]; + /// ms.Read(CompressedBytes, 0, CompressedBytes.Length); + /// } + /// + /// + /// whether to flush all data as you deflate. Generally you will want to + /// use Z_NO_FLUSH here, in a series of calls to Deflate(), and then call EndDeflate() to + /// flush everything. + /// + /// Z_OK if all goes well. + public int Deflate(FlushType flush) + { + if (dstate == null) + throw new ZlibException("No Deflate State!"); + return dstate.Deflate(flush); + } + + /// + /// End a deflation session. + /// + /// + /// Call this after making a series of one or more calls to Deflate(). All buffers are flushed. + /// + /// Z_OK if all goes well. + public int EndDeflate() + { + if (dstate == null) + throw new ZlibException("No Deflate State!"); + // TODO: dinoch Tue, 03 Nov 2009 15:39 (test this) + //int ret = dstate.End(); + dstate = null; + return ZlibConstants.Z_OK; //ret; + } + + /// + /// Reset a codec for another deflation session. + /// + /// + /// Call this to reset the deflation state. For example if a thread is deflating + /// non-consecutive blocks, you can call Reset() after the Deflate(Sync) of the first + /// block and before the next Deflate(None) of the second block. + /// + /// Z_OK if all goes well. + public void ResetDeflate() + { + if (dstate == null) + throw new ZlibException("No Deflate State!"); + dstate.Reset(); + } + + + /// + /// Set the CompressionStrategy and CompressionLevel for a deflation session. + /// + /// the level of compression to use. + /// the strategy to use for compression. + /// Z_OK if all goes well. + public int SetDeflateParams(CompressionLevel level, CompressionStrategy strategy) + { + if (dstate == null) + throw new ZlibException("No Deflate State!"); + return dstate.SetParams(level, strategy); + } + + + /// + /// Set the dictionary to be used for either Inflation or Deflation. + /// + /// The dictionary bytes to use. + /// Z_OK if all goes well. + public int SetDictionary(byte[] dictionary) + { + if (istate != null) + return istate.SetDictionary(dictionary); + + if (dstate != null) + return dstate.SetDictionary(dictionary); + + throw new ZlibException("No Inflate or Deflate state!"); + } + + // Flush as much pending output as possible. All deflate() output goes + // through this function so some applications may wish to modify it + // to avoid allocating a large strm->next_out buffer and copying into it. + // (See also read_buf()). + internal void flush_pending() + { + int len = dstate.pendingCount; + + if (len > AvailableBytesOut) + len = AvailableBytesOut; + if (len == 0) + return; + + if (dstate.pending.Length <= dstate.nextPending || + OutputBuffer.Length <= NextOut || + dstate.pending.Length < (dstate.nextPending + len) || + OutputBuffer.Length < (NextOut + len)) + { + throw new ZlibException(String.Format("Invalid State. (pending.Length={0}, pendingCount={1})", + dstate.pending.Length, dstate.pendingCount)); + } + + Array.Copy(dstate.pending, dstate.nextPending, OutputBuffer, NextOut, len); + + NextOut += len; + dstate.nextPending += len; + TotalBytesOut += len; + AvailableBytesOut -= len; + dstate.pendingCount -= len; + if (dstate.pendingCount == 0) + { + dstate.nextPending = 0; + } + } + + // Read a new buffer from the current input stream, update the adler32 + // and total number of bytes read. All deflate() input goes through + // this function so some applications may wish to modify it to avoid + // allocating a large strm->next_in buffer and copying from it. + // (See also flush_pending()). + internal int read_buf(byte[] buf, int start, int size) + { + int len = AvailableBytesIn; + + if (len > size) + len = size; + if (len == 0) + return 0; + + AvailableBytesIn -= len; + + if (dstate.WantRfc1950HeaderBytes) + { + _Adler32 = Adler.Adler32(_Adler32, InputBuffer, NextIn, len); + } + Array.Copy(InputBuffer, NextIn, buf, start, len); + NextIn += len; + TotalBytesIn += len; + return len; + } + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibCodec.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibCodec.cs.meta new file mode 100644 index 00000000..a017f14f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibCodec.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bc104cfa5b2ba31408766b86b9977226 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibConstants.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibConstants.cs new file mode 100644 index 00000000..b530c39b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibConstants.cs @@ -0,0 +1,128 @@ +// ZlibConstants.cs +// ------------------------------------------------------------------ +// +// Copyright (c) 2009 Dino Chiesa and Microsoft Corporation. +// All rights reserved. +// +// This code module is part of DotNetZip, a zipfile class library. +// +// ------------------------------------------------------------------ +// +// This code is licensed under the Microsoft Public License. +// See the file License.txt for the license details. +// More info on: http://dotnetzip.codeplex.com +// +// ------------------------------------------------------------------ +// +// last saved (in emacs): +// Time-stamp: <2009-November-03 18:50:19> +// +// ------------------------------------------------------------------ +// +// This module defines constants used by the zlib class library. This +// code is derived from the jzlib implementation of zlib, but +// significantly modified. In keeping with the license for jzlib, the +// copyright to that code is included here. +// +// ------------------------------------------------------------------ +// +// Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in +// the documentation and/or other materials provided with the distribution. +// +// 3. The names of the authors may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +// INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ----------------------------------------------------------------------- +// +// This program is based on zlib-1.1.3; credit to authors +// Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) +// and contributors of zlib. +// +// ----------------------------------------------------------------------- + + +using System; + +namespace BestHTTP.Decompression.Zlib +{ + /// + /// A bunch of constants used in the Zlib interface. + /// + public static class ZlibConstants + { + /// + /// The maximum number of window bits for the Deflate algorithm. + /// + public const int WindowBitsMax = 15; // 32K LZ77 window + + /// + /// The default number of window bits for the Deflate algorithm. + /// + public const int WindowBitsDefault = WindowBitsMax; + + /// + /// indicates everything is A-OK + /// + public const int Z_OK = 0; + + /// + /// Indicates that the last operation reached the end of the stream. + /// + public const int Z_STREAM_END = 1; + + /// + /// The operation ended in need of a dictionary. + /// + public const int Z_NEED_DICT = 2; + + /// + /// There was an error with the stream - not enough data, not open and readable, etc. + /// + public const int Z_STREAM_ERROR = -2; + + /// + /// There was an error with the data - not enough data, bad data, etc. + /// + public const int Z_DATA_ERROR = -3; + + /// + /// There was an error with the working buffer. + /// + public const int Z_BUF_ERROR = -5; + + /// + /// The size of the working buffer used in the ZlibCodec class. Defaults to 8192 bytes. + /// +#if NETCF + public const int WorkingBufferSizeDefault = 8192; +#else + public const int WorkingBufferSizeDefault = 16384; +#endif + /// + /// The minimum size of the working buffer used in the ZlibCodec class. Currently it is 128 bytes. + /// + public const int WorkingBufferSizeMin = 1024; + } + +} + diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibConstants.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibConstants.cs.meta new file mode 100644 index 00000000..a1659c4d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Decompression/ZlibConstants.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4cd9445fbeecd0642955b4ea35e211c8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions.meta new file mode 100644 index 00000000..ee824e77 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e3ba637693c35a745aeb4052cfb287cb +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/BufferPoolMemoryStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/BufferPoolMemoryStream.cs new file mode 100644 index 00000000..c7aab71c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/BufferPoolMemoryStream.cs @@ -0,0 +1,447 @@ +// +// System.IO.MemoryStream.cs +// +// Authors: Marcin Szczepanski (marcins@zipworld.com.au) +// Patrik Torstensson +// Gonzalo Paniagua Javier (gonzalo@ximian.com) +// +// (c) 2001,2002 Marcin Szczepanski, Patrik Torstensson +// (c) 2003 Ximian, Inc. (http://www.ximian.com) +// Copyright (C) 2004 Novell (http://www.novell.com) +// + +// +// Copyright (C) 2004 Novell, Inc (http://www.novell.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. +// + +using System; +using System.IO; + +namespace BestHTTP.Extensions +{ + /// + /// This is a modified MemoryStream class to use VariableSizedBufferPool + /// + public sealed class BufferPoolMemoryStream : System.IO.Stream + { + bool canWrite; + bool allowGetBuffer; + int capacity; + int length; + byte[] internalBuffer; + int initialIndex; + bool expandable; + bool streamClosed; + int position; + int dirty_bytes; + + public BufferPoolMemoryStream() : this(0) + { + } + + public BufferPoolMemoryStream(int capacity) + { + if (capacity < 0) + throw new ArgumentOutOfRangeException("capacity"); + + canWrite = true; + + internalBuffer = capacity > 0 ? VariableSizedBufferPool.Get(capacity, true) : VariableSizedBufferPool.NoData; + this.capacity = internalBuffer.Length; + + expandable = true; + allowGetBuffer = true; + } + + public BufferPoolMemoryStream(byte[] buffer) + { + if (buffer == null) + throw new ArgumentNullException("buffer"); + + InternalConstructor(buffer, 0, buffer.Length, true, false); + } + + public BufferPoolMemoryStream(byte[] buffer, bool writable) + { + if (buffer == null) + throw new ArgumentNullException("buffer"); + + InternalConstructor(buffer, 0, buffer.Length, writable, false); + } + + public BufferPoolMemoryStream(byte[] buffer, int index, int count) + { + InternalConstructor(buffer, index, count, true, false); + } + + public BufferPoolMemoryStream(byte[] buffer, int index, int count, bool writable) + { + InternalConstructor(buffer, index, count, writable, false); + } + + public BufferPoolMemoryStream(byte[] buffer, int index, int count, bool writable, bool publiclyVisible) + { + InternalConstructor(buffer, index, count, writable, publiclyVisible); + } + + void InternalConstructor(byte[] buffer, int index, int count, bool writable, bool publicallyVisible) + { + if (buffer == null) + throw new ArgumentNullException("buffer"); + + if (index < 0 || count < 0) + throw new ArgumentOutOfRangeException("index or count is less than 0."); + + if (buffer.Length - index < count) + throw new ArgumentException("index+count", + "The size of the buffer is less than index + count."); + + canWrite = writable; + + internalBuffer = buffer; + capacity = count + index; + length = capacity; + position = index; + initialIndex = index; + + allowGetBuffer = publicallyVisible; + expandable = false; + } + + void CheckIfClosedThrowDisposed() + { + if (streamClosed) + throw new ObjectDisposedException("MemoryStream"); + } + + public override bool CanRead + { + get { return !streamClosed; } + } + + public override bool CanSeek + { + get { return !streamClosed; } + } + + public override bool CanWrite + { + get { return (!streamClosed && canWrite); } + } + + public int Capacity + { + get + { + CheckIfClosedThrowDisposed(); + return capacity - initialIndex; + } + + set + { + CheckIfClosedThrowDisposed(); + if (value == capacity) + return; // LAMENESS: see MemoryStreamTest.ConstructorFive + + if (!expandable) + throw new NotSupportedException("Cannot expand this MemoryStream"); + + if (value < 0 || value < length) + throw new ArgumentOutOfRangeException("value", + "New capacity cannot be negative or less than the current capacity " + value + " " + capacity); + + byte[] newBuffer = null; + if (value != 0) + { + newBuffer = VariableSizedBufferPool.Get(value, true); + Buffer.BlockCopy(internalBuffer, 0, newBuffer, 0, length); + } + + dirty_bytes = 0; // discard any dirty area beyond previous length + VariableSizedBufferPool.Release(internalBuffer); + internalBuffer = newBuffer; // It's null when capacity is set to 0 + capacity = internalBuffer != null ? internalBuffer.Length : 0; + } + } + + public override long Length + { + get + { + // LAMESPEC: The spec says to throw an IOException if the + // stream is closed and an ObjectDisposedException if + // "methods were called after the stream was closed". What + // is the difference? + + CheckIfClosedThrowDisposed(); + + // This is ok for MemoryStreamTest.ConstructorFive + return length - initialIndex; + } + } + + public override long Position + { + get + { + CheckIfClosedThrowDisposed(); + return position - initialIndex; + } + + set + { + CheckIfClosedThrowDisposed(); + if (value < 0) + throw new ArgumentOutOfRangeException("value", + "Position cannot be negative"); + + if (value > Int32.MaxValue) + throw new ArgumentOutOfRangeException("value", + "Position must be non-negative and less than 2^31 - 1 - origin"); + + position = initialIndex + (int)value; + } + } + + protected override void Dispose (bool disposing) + { + streamClosed = true; + expandable = false; + if (internalBuffer != null) + VariableSizedBufferPool.Release(internalBuffer); + internalBuffer = null; + } + + public override void Flush() + { + // Do nothing + } + + public byte[] GetBuffer() + { + if (!allowGetBuffer) + throw new UnauthorizedAccessException(); + + return internalBuffer; + } + + public override int Read(byte[] buffer, int offset, int count) + { + CheckIfClosedThrowDisposed(); + + if (buffer == null) + throw new ArgumentNullException("buffer"); + + if (offset < 0 || count < 0) + throw new ArgumentOutOfRangeException("offset or count less than zero."); + + if (buffer.Length - offset < count) + throw new ArgumentException("offset+count", + "The size of the buffer is less than offset + count."); + + if (position >= length || count == 0) + return 0; + + if (position > length - count) + count = length - position; + + Buffer.BlockCopy(internalBuffer, position, buffer, offset, count); + position += count; + return count; + } + + public override int ReadByte() + { + CheckIfClosedThrowDisposed(); + if (position >= length) + return -1; + + return internalBuffer[position++]; + } + + public override long Seek(long offset, SeekOrigin loc) + { + CheckIfClosedThrowDisposed(); + + // It's funny that they don't throw this exception for < Int32.MinValue + if (offset > (long)Int32.MaxValue) + throw new ArgumentOutOfRangeException("Offset out of range. " + offset); + + int refPoint; + switch (loc) + { + case SeekOrigin.Begin: + if (offset < 0) + throw new IOException("Attempted to seek before start of MemoryStream."); + refPoint = initialIndex; + break; + case SeekOrigin.Current: + refPoint = position; + break; + case SeekOrigin.End: + refPoint = length; + break; + default: + throw new ArgumentException("loc", "Invalid SeekOrigin"); + } + + // LAMESPEC: My goodness, how may LAMESPECs are there in this + // class! :) In the spec for the Position property it's stated + // "The position must not be more than one byte beyond the end of the stream." + // In the spec for seek it says "Seeking to any location beyond the length of the + // stream is supported." That's a contradiction i'd say. + // I guess seek can go anywhere but if you use position it may get moved back. + + refPoint += (int)offset; + if (refPoint < initialIndex) + throw new IOException("Attempted to seek before start of MemoryStream."); + + position = refPoint; + return position; + } + + int CalculateNewCapacity(int minimum) + { + if (minimum < 256) + minimum = 256; // See GetBufferTwo test + + if (minimum < capacity * 2) + minimum = capacity * 2; + + if (!UnityEngine.Mathf.IsPowerOfTwo(minimum)) + minimum = UnityEngine.Mathf.NextPowerOfTwo(minimum); + + return minimum; + } + + void Expand(int newSize) + { + // We don't need to take into account the dirty bytes when incrementing the + // Capacity, as changing it will only preserve the valid clear region. + if (newSize > capacity) + Capacity = CalculateNewCapacity(newSize); + else if (dirty_bytes > 0) + { + Array.Clear(internalBuffer, length, dirty_bytes); + dirty_bytes = 0; + } + } + + public override void SetLength(long value) + { + if (!expandable && value > capacity) + throw new NotSupportedException("Expanding this MemoryStream is not supported"); + + CheckIfClosedThrowDisposed(); + + if (!canWrite) + { + throw new NotSupportedException("Cannot write to this MemoryStream"); + } + + // LAMESPEC: AGAIN! It says to throw this exception if value is + // greater than "the maximum length of the MemoryStream". I haven't + // seen anywhere mention what the maximum length of a MemoryStream is and + // since we're this far this memory stream is expandable. + if (value < 0 || (value + initialIndex) > (long)Int32.MaxValue) + throw new ArgumentOutOfRangeException(); + + int newSize = (int)value + initialIndex; + + if (newSize > length) + Expand(newSize); + else if (newSize < length) // Postpone the call to Array.Clear till expand time + dirty_bytes += length - newSize; + + length = newSize; + if (position > length) + position = length; + } + + public byte[] ToArray() + { + return ToArray(false); + } + + public byte[] ToArray(bool canBeLarger) + { + int l = length - initialIndex; + byte[] outBuffer = l > 0 ? VariableSizedBufferPool.Get(l, canBeLarger) : VariableSizedBufferPool.NoData; + + if (internalBuffer != null) + Buffer.BlockCopy(internalBuffer, initialIndex, outBuffer, 0, l); + return outBuffer; + } + + public override void Write(byte[] buffer, int offset, int count) + { + CheckIfClosedThrowDisposed(); + + if (!canWrite) + throw new NotSupportedException("Cannot write to this stream."); + + if (buffer == null) + throw new ArgumentNullException("buffer"); + + if (offset < 0 || count < 0) + throw new ArgumentOutOfRangeException(); + + if (buffer.Length - offset < count) + throw new ArgumentException("offset+count", + "The size of the buffer is less than offset + count."); + + // reordered to avoid possible integer overflow + if (position > length - count) + Expand(position + count); + + Buffer.BlockCopy(buffer, offset, internalBuffer, position, count); + position += count; + if (position >= length) + length = position; + } + + public override void WriteByte(byte value) + { + CheckIfClosedThrowDisposed(); + if (!canWrite) + throw new NotSupportedException("Cannot write to this stream."); + + if (position >= length) + { + Expand(position + 1); + length = position + 1; + } + + internalBuffer[position++] = value; + } + + public void WriteTo(Stream stream) + { + CheckIfClosedThrowDisposed(); + + if (stream == null) + throw new ArgumentNullException("stream"); + + stream.Write(internalBuffer, initialIndex, length - initialIndex); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/BufferPoolMemoryStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/BufferPoolMemoryStream.cs.meta new file mode 100644 index 00000000..1cc7e2f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/BufferPoolMemoryStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce34f1f3b5c30794b9e26c0922185261 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/CircularBuffer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/CircularBuffer.cs new file mode 100644 index 00000000..9d1d5a6d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/CircularBuffer.cs @@ -0,0 +1,55 @@ +using System; + +namespace BestHTTP.Extensions +{ + public sealed class CircularBuffer + { + public int Capacity { get; private set; } + public int Count { get; private set; } + + public T this[int idx] + { + get + { + int realIdx = (this.startIdx + idx) % this.Capacity; + + return this.buffer[realIdx]; + } + + set + { + int realIdx = (this.startIdx + idx) % this.Capacity; + + this.buffer[realIdx] = value; + } + } + + private T[] buffer; + private int startIdx; + private int endIdx; + + public CircularBuffer(int capacity) + { + this.Capacity = capacity; + } + + public void Add(T element) + { + if (this.buffer == null) + this.buffer = new T[this.Capacity]; + + this.buffer[this.endIdx] = element; + + this.endIdx = (this.endIdx + 1) % this.Capacity; + if (this.endIdx == this.startIdx) + this.startIdx = (this.startIdx + 1) % this.Capacity; + + this.Count = Math.Min(this.Count + 1, this.Capacity); + } + + public void Clear() + { + this.startIdx = this.endIdx = 0; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/CircularBuffer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/CircularBuffer.cs.meta new file mode 100644 index 00000000..78d460ce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/CircularBuffer.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d3e42ed97af74b54fba27235416b1191 +timeCreated: 1508423928 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Extensions.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Extensions.cs new file mode 100644 index 00000000..a026a1f0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Extensions.cs @@ -0,0 +1,465 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +#if NETFX_CORE + using Windows.Security.Cryptography; + using Windows.Security.Cryptography.Core; + using Windows.Storage.Streams; +#else + using Cryptography = System.Security.Cryptography; + using FileStream = System.IO.FileStream; +#endif + +namespace BestHTTP.Extensions +{ + public static class Extensions + { + #region ASCII Encoding (These are required because Windows Phone doesn't supports the Encoding.ASCII class.) + + /// + /// On WP8 platform there are no ASCII encoding. + /// + public static string AsciiToString(this byte[] bytes) + { + StringBuilder sb = new StringBuilder(bytes.Length); + foreach (byte b in bytes) + sb.Append(b <= 0x7f ? (char)b : '?'); + return sb.ToString(); + } + + /// + /// On WP8 platform there are no ASCII encoding. + /// + public static byte[] GetASCIIBytes(this string str) + { + byte[] result = VariableSizedBufferPool.Get(str.Length, false); + for (int i = 0; i < str.Length; ++i) + { + char ch = str[i]; + result[i] = (byte)((ch < (char)0x80) ? ch : '?'); + } + + return result; + } + + public static void SendAsASCII(this BinaryWriter stream, string str) + { + for (int i = 0; i < str.Length; ++i) + { + char ch = str[i]; + + stream.Write((byte)((ch < (char)0x80) ? ch : '?')); + } + } + + #endregion + + #region FileSystem WriteLine function support + + public static void WriteLine(this Stream fs) + { + fs.Write(HTTPRequest.EOL, 0, 2); + } + + public static void WriteLine(this Stream fs, string line) + { + var buff = line.GetASCIIBytes(); + fs.Write(buff, 0, buff.Length); + fs.WriteLine(); + VariableSizedBufferPool.Release(buff); + } + + public static void WriteLine(this Stream fs, string format, params object[] values) + { + var buff = string.Format(format, values).GetASCIIBytes(); + fs.Write(buff, 0, buff.Length); + fs.WriteLine(); + VariableSizedBufferPool.Release(buff); + } + + #endregion + + #region Other Extensions + + public static string GetRequestPathAndQueryURL(this Uri uri) + { + string requestPathAndQuery = uri.GetComponents(UriComponents.PathAndQuery, UriFormat.UriEscaped); + + // http://forum.unity3d.com/threads/best-http-released.200006/page-26#post-2723250 + if (string.IsNullOrEmpty(requestPathAndQuery)) + requestPathAndQuery = "/"; + + return requestPathAndQuery; + } + + public static string[] FindOption(this string str, string option) + { + //s-maxage=2678400, must-revalidate, max-age=0 + string[] options = str.ToLower().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + option = option.ToLower(); + + for (int i = 0; i < options.Length; ++i) + if (options[i].Contains(option)) + return options[i].Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); + + return null; + } + + public static void WriteArray(this Stream stream, byte[] array) + { + stream.Write(array, 0, array.Length); + } + + /// + /// Returns true if the Uri's host is a valid IPv4 or IPv6 address. + /// + public static bool IsHostIsAnIPAddress(this Uri uri) + { + if (uri == null) + return false; + + return IsIpV4AddressValid(uri.Host) || IsIpV6AddressValid(uri.Host); + } + + // Original idea from: https://www.code4copy.com/csharp/c-validate-ip-address-string/ + // Working regex: https://www.regular-expressions.info/ip.html + private static readonly System.Text.RegularExpressions.Regex validIpV4AddressRegex = new System.Text.RegularExpressions.Regex("\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b", System.Text.RegularExpressions.RegexOptions.IgnoreCase); + + /// + /// Validates an IPv4 address. + /// + public static bool IsIpV4AddressValid(string address) + { + if (!string.IsNullOrEmpty(address)) + return validIpV4AddressRegex.IsMatch(address.Trim()); + + return false; + } + + /// + /// Validates an IPv6 address. + /// + public static bool IsIpV6AddressValid(string address) + { +#if !NETFX_CORE + if (!string.IsNullOrEmpty(address)) + { + System.Net.IPAddress ip; + if (System.Net.IPAddress.TryParse(address, out ip)) + return ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6; + } +#endif + return false; + } + + #endregion + + #region String Conversions + + public static int ToInt32(this string str, int defaultValue = default(int)) + { + if (str == null) + return defaultValue; + + try + { + return int.Parse(str); + } + catch + { + return defaultValue; + } + } + + public static long ToInt64(this string str, long defaultValue = default(long)) + { + if (str == null) + return defaultValue; + + try + { + return long.Parse(str); + } + catch + { + return defaultValue; + } + } + + public static DateTime ToDateTime(this string str, DateTime defaultValue = default(DateTime)) + { + if (str == null) + return defaultValue; + + try + { + DateTime.TryParse(str, out defaultValue); + return defaultValue.ToUniversalTime(); + } + catch + { + return defaultValue; + } + } + + public static string ToStrOrEmpty(this string str) + { + if (str == null) + return String.Empty; + + return str; + } + + #endregion + + #region MD5 Hashing + + public static string CalculateMD5Hash(this string input) + { + byte[] ascii = input.GetASCIIBytes(); + var hash = ascii.CalculateMD5Hash(); + VariableSizedBufferPool.Release(ascii); + return hash; + } + + public static string CalculateMD5Hash(this byte[] input) + { +#if NETFX_CORE + var alg = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Md5); + IBuffer buff = CryptographicBuffer.CreateFromByteArray(input); + var hashed = alg.HashData(buff); + var res = CryptographicBuffer.EncodeToHexString(hashed); + return res; +#else + using (var md5 = Cryptography.MD5.Create()) { + var hash = md5.ComputeHash(input); + var sb = new StringBuilder(hash.Length); + for (int i = 0; i < hash.Length; ++i) + sb.Append(hash[i].ToString("x2")); + VariableSizedBufferPool.Release(hash); + return sb.ToString(); + } +#endif + } + + #endregion + + #region Efficient String Parsing Helpers + + internal static string Read(this string str, ref int pos, char block, bool needResult = true) + { + return str.Read(ref pos, (ch) => ch != block, needResult); + } + + internal static string Read(this string str, ref int pos, Func block, bool needResult = true) + { + if (pos >= str.Length) + return string.Empty; + + str.SkipWhiteSpace(ref pos); + + int startPos = pos; + + while (pos < str.Length && block(str[pos])) + pos++; + + string result = needResult ? str.Substring(startPos, pos - startPos) : null; + + // set position to the next char + pos++; + + return result; + } + + internal static string ReadPossibleQuotedText(this string str, ref int pos) + { + string result = string.Empty; + if (str == null) + return result; + + // It's a quoted text? + if (str[pos] == '\"') + { + // Skip the starting quote + str.Read(ref pos, '\"', false); + + // Read the text until the ending quote + result = str.Read(ref pos, '\"'); + + // Next option + str.Read(ref pos, ',', false); + } + else + // It's not a quoted text, so we will read until the next option + result = str.Read(ref pos, (ch) => ch != ',' && ch != ';'); + + return result; + } + + internal static void SkipWhiteSpace(this string str, ref int pos) + { + if (pos >= str.Length) + return; + + while (pos < str.Length && char.IsWhiteSpace(str[pos])) + pos++; + } + + internal static string TrimAndLower(this string str) + { + if (str == null) + return null; + + char[] buffer = new char[str.Length]; + int length = 0; + + for (int i = 0; i < str.Length; ++i) + { + char ch = str[i]; + if (!char.IsWhiteSpace(ch) && !char.IsControl(ch)) + buffer[length++] = char.ToLowerInvariant(ch); + } + + return new string(buffer, 0, length); + } + + internal static char? Peek(this string str, int pos) + { + if (pos < 0 || pos >= str.Length) + return null; + + return str[pos]; + } + + #endregion + + #region Specialized String Parsers + + //public, max-age=2592000 + internal static List ParseOptionalHeader(this string str) + { + List result = new List(); + + if (str == null) + return result; + + int idx = 0; + + // process the rest of the text + while (idx < str.Length) + { + // Read key + string key = str.Read(ref idx, (ch) => ch != '=' && ch != ',').TrimAndLower(); + HeaderValue qp = new HeaderValue(key); + + if (str[idx - 1] == '=') + qp.Value = str.ReadPossibleQuotedText(ref idx); + + result.Add(qp); + } + + return result; + } + + //deflate, gzip, x-gzip, identity, *;q=0 + internal static List ParseQualityParams(this string str) + { + List result = new List(); + + if (str == null) + return result; + + int idx = 0; + while (idx < str.Length) + { + string key = str.Read(ref idx, (ch) => ch != ',' && ch != ';').TrimAndLower(); + + HeaderValue qp = new HeaderValue(key); + + if (str[idx - 1] == ';') + { + str.Read(ref idx, '=', false); + qp.Value = str.Read(ref idx, ','); + } + + result.Add(qp); + } + + return result; + } + + #endregion + + #region Buffer Filling + + /// + /// Will fill the entire buffer from the stream. Will throw an exception when the underlying stream is closed. + /// + public static void ReadBuffer(this Stream stream, byte[] buffer) + { + int count = 0; + + do + { + int read = stream.Read(buffer, count, buffer.Length - count); + + if (read <= 0) + throw ExceptionHelper.ServerClosedTCPStream(); + + count += read; + } while (count < buffer.Length); + } + + public static void ReadBuffer(this Stream stream, byte[] buffer, int length) + { + int count = 0; + + do + { + int read = stream.Read(buffer, count, length - count); + + if (read <= 0) + throw ExceptionHelper.ServerClosedTCPStream(); + + count += read; + } while (count < length); + } + + #endregion + + #region BufferPoolMemoryStream + + public static void WriteString(this BufferPoolMemoryStream ms, string str) + { + var byteCount = Encoding.UTF8.GetByteCount(str); + byte[] buffer = VariableSizedBufferPool.Get(byteCount, true); + Encoding.UTF8.GetBytes(str, 0, str.Length, buffer, 0); + ms.Write(buffer, 0, byteCount); + VariableSizedBufferPool.Release(buffer); + } + + public static void WriteLine(this BufferPoolMemoryStream ms) + { + ms.Write(HTTPRequest.EOL, 0, HTTPRequest.EOL.Length); + } + + public static void WriteLine(this BufferPoolMemoryStream ms, string str) + { + ms.WriteString(str); + ms.Write(HTTPRequest.EOL, 0, HTTPRequest.EOL.Length); + } + + #endregion + } + + public static class ExceptionHelper + { + public static Exception ServerClosedTCPStream() + { + return new Exception("TCP Stream closed unexpectedly by the remote server"); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Extensions.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Extensions.cs.meta new file mode 100644 index 00000000..d37e2a4c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Extensions.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3ed17defed57cb64697daf74b5bb5873 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Future.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Future.cs new file mode 100644 index 00000000..0b4d173a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Future.cs @@ -0,0 +1,402 @@ +// Based on https://github.com/nickgravelyn/UnityToolbag/blob/master/Future/Future.cs +/* + * The MIT License (MIT) + +Copyright (c) 2017, Nick Gravelyn + +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. + * */ + +using System; +using System.Collections.Generic; + +namespace BestHTTP.Futures +{ + /// + /// Describes the state of a future. + /// + public enum FutureState + { + /// + /// The future hasn't begun to resolve a value. + /// + Pending, + + /// + /// The future is working on resolving a value. + /// + Processing, + + /// + /// The future has a value ready. + /// + Success, + + /// + /// The future failed to resolve a value. + /// + Error + } + + /// + /// Defines the interface of an object that can be used to track a future value. + /// + /// The type of object being retrieved. + public interface IFuture + { + /// + /// Gets the state of the future. + /// + FutureState state { get; } + + /// + /// Gets the value if the State is Success. + /// + T value { get; } + + /// + /// Gets the failure exception if the State is Error. + /// + Exception error { get; } + + /// + /// Adds a new callback to invoke when an intermediate result is known. + /// + /// The callback to invoke. + /// The future so additional calls can be chained together. + IFuture OnItem(FutureValueCallback callback); + + /// + /// Adds a new callback to invoke if the future value is retrieved successfully. + /// + /// The callback to invoke. + /// The future so additional calls can be chained together. + IFuture OnSuccess(FutureValueCallback callback); + + /// + /// Adds a new callback to invoke if the future has an error. + /// + /// The callback to invoke. + /// The future so additional calls can be chained together. + IFuture OnError(FutureErrorCallback callback); + + /// + /// Adds a new callback to invoke if the future value is retrieved successfully or has an error. + /// + /// The callback to invoke. + /// The future so additional calls can be chained together. + IFuture OnComplete(FutureCallback callback); + } + + /// + /// Defines the signature for callbacks used by the future. + /// + /// The future. + public delegate void FutureCallback(IFuture future); + + public delegate void FutureValueCallback(T value); + public delegate void FutureErrorCallback(Exception error); + + /// + /// An implementation of that can be used internally by methods that return futures. + /// + /// + /// Methods should always return the interface when calling code requests a future. + /// This class is intended to be constructed internally in the method to provide a simple implementation of + /// the interface. By returning the interface instead of the class it ensures the implementation can change + /// later on if requirements change, without affecting the calling code. + /// + /// The type of object being retrieved. + public class Future : IFuture + { + private volatile FutureState _state; + private T _value; + private Exception _error; + private Func _processFunc; + + private readonly List> _itemCallbacks = new List>(); + private readonly List> _successCallbacks = new List>(); + private readonly List _errorCallbacks = new List(); + private readonly List> _complationCallbacks = new List>(); + + /// + /// Gets the state of the future. + /// + public FutureState state { get { return _state; } } + + /// + /// Gets the value if the State is Success. + /// + public T value + { + get + { + if (_state != FutureState.Success && _state != FutureState.Processing) + { + throw new InvalidOperationException("value is not available unless state is Success or Processing."); + } + + return _value; + } + } + + /// + /// Gets the failure exception if the State is Error. + /// + public Exception error + { + get + { + if (_state != FutureState.Error) + { + throw new InvalidOperationException("error is not available unless state is Error."); + } + + return _error; + } + } + + /// + /// Initializes a new instance of the class. + /// + public Future() + { + _state = FutureState.Pending; + } + + public IFuture OnItem(FutureValueCallback callback) + { + if (_state < FutureState.Success && !_itemCallbacks.Contains(callback)) + _itemCallbacks.Add(callback); + + return this; + } + + /// + /// Adds a new callback to invoke if the future value is retrieved successfully. + /// + /// The callback to invoke. + /// The future so additional calls can be chained together. + public IFuture OnSuccess(FutureValueCallback callback) + { + if (_state == FutureState.Success) + { + callback(this.value); + } + else if (_state != FutureState.Error && !_successCallbacks.Contains(callback)) + { + _successCallbacks.Add(callback); + } + + return this; + } + + /// + /// Adds a new callback to invoke if the future has an error. + /// + /// The callback to invoke. + /// The future so additional calls can be chained together. + public IFuture OnError(FutureErrorCallback callback) + { + if (_state == FutureState.Error) + { + callback(this.error); + } + else if (_state != FutureState.Success && !_errorCallbacks.Contains(callback)) + { + _errorCallbacks.Add(callback); + } + + return this; + } + + /// + /// Adds a new callback to invoke if the future value is retrieved successfully or has an error. + /// + /// The callback to invoke. + /// The future so additional calls can be chained together. + public IFuture OnComplete(FutureCallback callback) + { + if (_state == FutureState.Success || _state == FutureState.Error) + { + callback(this); + } + else + { + if (!_complationCallbacks.Contains(callback)) + _complationCallbacks.Add(callback); + } + + return this; + } + +#pragma warning disable 1998 + + /// + /// Begins running a given function on a background thread to resolve the future's value, as long + /// as it is still in the Pending state. + /// + /// The function that will retrieve the desired value. + public IFuture Process(Func func) + { + if (_state != FutureState.Pending) + { + throw new InvalidOperationException("Cannot process a future that isn't in the Pending state."); + } + + BeginProcess(); + _processFunc = func; + +#if NETFX_CORE +#pragma warning disable 4014 + Windows.System.Threading.ThreadPool.RunAsync(ThreadFunc); +#pragma warning restore 4014 +#else + System.Threading.ThreadPool.QueueUserWorkItem(ThreadFunc); +#endif + + return this; + } + + private +#if NETFX_CORE + async +#endif + void ThreadFunc(object param) + { + try + { + // Directly call the Impl version to avoid the state validation of the public method + AssignImpl(_processFunc()); + } + catch (Exception e) + { + // Directly call the Impl version to avoid the state validation of the public method + FailImpl(e); + } + finally + { + _processFunc = null; + } + } + +#pragma warning restore 1998 + + /// + /// Allows manually assigning a value to a future, as long as it is still in the pending state. + /// + /// + /// There are times where you may not need to do background processing for a value. For example, + /// you may have a cache of values and can just hand one out. In those cases you still want to + /// return a future for the method signature, but can just call this method to fill in the future. + /// + /// The value to assign the future. + public void Assign(T value) + { + if (_state != FutureState.Pending && _state != FutureState.Processing) + { + throw new InvalidOperationException("Cannot assign a value to a future that isn't in the Pending or Processing state."); + } + + AssignImpl(value); + } + + public void BeginProcess(T initialItem = default(T)) + { + _state = FutureState.Processing; + _value = initialItem; + } + + public void AssignItem(T value) + { + _value = value; + _error = null; + + foreach (var callback in _itemCallbacks) + callback(this.value); + } + + /// + /// Allows manually failing a future, as long as it is still in the pending state. + /// + /// + /// As with the Assign method, there are times where you may know a future value is a failure without + /// doing any background work. In those cases you can simply fail the future manually and return it. + /// + /// The exception to use to fail the future. + public void Fail(Exception error) + { + if (_state != FutureState.Pending && _state != FutureState.Processing) + { + throw new InvalidOperationException("Cannot fail future that isn't in the Pending or Processing state."); + } + + FailImpl(error); + } + + private void AssignImpl(T value) + { + _value = value; + _error = null; + _state = FutureState.Success; + + FlushSuccessCallbacks(); + } + + private void FailImpl(Exception error) + { + _value = default(T); + _error = error; + _state = FutureState.Error; + + FlushErrorCallbacks(); + } + + private void FlushSuccessCallbacks() + { + foreach (var callback in _successCallbacks) + callback(this.value); + + FlushComplationCallbacks(); + } + + private void FlushErrorCallbacks() + { + foreach (var callback in _errorCallbacks) + callback(this.error); + + FlushComplationCallbacks(); + } + + private void FlushComplationCallbacks() + { + foreach (var callback in _complationCallbacks) + callback(this); + ClearCallbacks(); + } + + private void ClearCallbacks() + { + _itemCallbacks.Clear(); + _successCallbacks.Clear(); + _errorCallbacks.Clear(); + _complationCallbacks.Clear(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Future.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Future.cs.meta new file mode 100644 index 00000000..d9ecc463 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/Future.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: a9009e6f5e86bd5459d443846e42be9e +timeCreated: 1515175777 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderParser.cs new file mode 100644 index 00000000..a2a63ad9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderParser.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; + +namespace BestHTTP.Extensions +{ + /// + /// Will parse a comma-separeted header value + /// + public sealed class HeaderParser : KeyValuePairList + { + public HeaderParser(string headerStr) + { + base.Values = Parse(headerStr); + } + + private List Parse(string headerStr) + { + List result = new List(); + + int pos = 0; + + try + { + while (pos < headerStr.Length) + { + HeaderValue current = new HeaderValue(); + + current.Parse(headerStr, ref pos); + + result.Add(current); + } + } + catch(System.Exception ex) + { + HTTPManager.Logger.Exception("HeaderParser - Parse", headerStr, ex); + } + + return result; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderParser.cs.meta new file mode 100644 index 00000000..3fffbeca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderParser.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 40ea771765c2ae549abc4c264e500b76 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderValue.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderValue.cs new file mode 100644 index 00000000..923b53a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderValue.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Extensions +{ + /// + /// Used in string parsers. Its Value is optional. + /// + public sealed class HeaderValue + { + #region Public Properties + + public string Key { get; set; } + public string Value { get; set; } + public List Options { get; set; } + + public bool HasValue { get { return !string.IsNullOrEmpty(this.Value); } } + + #endregion + + #region Constructors + + public HeaderValue() + { } + + public HeaderValue(string key) + { + this.Key = key; + } + + #endregion + + #region Public Helper Functions + + public void Parse(string headerStr, ref int pos) + { + ParseImplementation(headerStr, ref pos, true); + } + + public bool TryGetOption(string key, out HeaderValue option) + { + option = null; + + if (Options == null || Options.Count == 0) + return false; + + for (int i = 0; i < Options.Count; ++i) + if (String.Equals(Options[i].Key, key, StringComparison.OrdinalIgnoreCase)) + { + option = Options[i]; + return true; + } + + return false; + } + + #endregion + + #region Private Helper Functions + + private void ParseImplementation(string headerStr, ref int pos, bool isOptionIsAnOption) + { + string key = headerStr.Read(ref pos, (ch) => ch != ';' && ch != '=' && ch != ',', true); + this.Key = key; + + char? skippedChar = headerStr.Peek(pos - 1); + bool isValue = skippedChar == '='; + bool isOption = isOptionIsAnOption && skippedChar == ';'; + + while (skippedChar != null && isValue || isOption) + { + + if (isValue) + { + string value = headerStr.ReadPossibleQuotedText(ref pos); + this.Value = value; + } + else if (isOption) + { + HeaderValue option = new HeaderValue(); + option.ParseImplementation(headerStr, ref pos, false); + + if (this.Options == null) + this.Options = new List(); + + this.Options.Add(option); + } + + if (!isOptionIsAnOption) + return; + + skippedChar = headerStr.Peek(pos - 1); + isValue = skippedChar == '='; + isOption = isOptionIsAnOption && skippedChar == ';'; + } + } + + #endregion + + #region Overrides + + public override string ToString() + { + if (!string.IsNullOrEmpty(Value)) + return String.Concat(Key, '=', Value); + else + return Key; + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderValue.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderValue.cs.meta new file mode 100644 index 00000000..b2c250c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeaderValue.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1465d4183951bf64dad0047b7c6e7243 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeartbeatManager.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeartbeatManager.cs new file mode 100644 index 00000000..f768fa24 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeartbeatManager.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Extensions +{ + public interface IHeartbeat + { + void OnHeartbeatUpdate(TimeSpan dif); + } + + /// + /// A manager class that can handle subscribing and unsubscribeing in the same update. + /// + public sealed class HeartbeatManager + { + private List Heartbeats = new List(); + private IHeartbeat[] UpdateArray; + private DateTime LastUpdate = DateTime.MinValue; + + public void Subscribe(IHeartbeat heartbeat) + { + lock (Heartbeats) + { + if (!Heartbeats.Contains(heartbeat)) + Heartbeats.Add(heartbeat); + } + } + + public void Unsubscribe(IHeartbeat heartbeat) + { + lock (Heartbeats) + Heartbeats.Remove(heartbeat); + } + + public void Update() + { + if (LastUpdate == DateTime.MinValue) + LastUpdate = DateTime.UtcNow; + else + { + TimeSpan dif = DateTime.UtcNow - LastUpdate; + LastUpdate = DateTime.UtcNow; + + int count = 0; + + lock (Heartbeats) + { + if (UpdateArray == null || UpdateArray.Length < Heartbeats.Count) + Array.Resize(ref UpdateArray, Heartbeats.Count); + + Heartbeats.CopyTo(0, UpdateArray, 0, Heartbeats.Count); + + count = Heartbeats.Count; + } + + for (int i = 0; i < count; ++i) + { + try + { + UpdateArray[i].OnHeartbeatUpdate(dif); + } + catch + { } + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeartbeatManager.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeartbeatManager.cs.meta new file mode 100644 index 00000000..c9d056e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/HeartbeatManager.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 6c610eeb580ec8e4c90789edb631cc76 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/KeyValuePairList.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/KeyValuePairList.cs new file mode 100644 index 00000000..c18c18b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/KeyValuePairList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Extensions +{ + /// + /// Base class for specialized parsers + /// + public class KeyValuePairList + { + public List Values { get; protected set; } + + public bool TryGet(string valueKeyName, out HeaderValue @param) + { + @param = null; + for (int i = 0; i < Values.Count; ++i) + if (string.CompareOrdinal(Values[i].Key, valueKeyName) == 0) + { + @param = Values[i]; + return true; + } + return false; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/KeyValuePairList.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/KeyValuePairList.cs.meta new file mode 100644 index 00000000..5c6d9fc3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/KeyValuePairList.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 834cc34ef3418894589ef2e8389ff8c0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/ReadOnlyBufferedStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/ReadOnlyBufferedStream.cs new file mode 100644 index 00000000..06748525 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/ReadOnlyBufferedStream.cs @@ -0,0 +1,177 @@ +using System; +using System.IO; + +namespace BestHTTP.Extensions +{ + public class ReadOnlyBufferedStream : Stream + { + public bool CheckForDataAvailability { get; set; } + Stream stream; + public const int READBUFFER = 8192; + byte[] buf; + int available = 0; + int pos = 0; + + public ReadOnlyBufferedStream(Stream nstream) + { + stream = nstream; + buf = VariableSizedBufferPool.Get(READBUFFER, true); + } + + public override int Read(byte[] buffer, int offset, int size) + { + if (size <= available) + { + Array.Copy(buf, pos, buffer, offset, size); + available -= size; + pos += size; + return size; + } + else + { + int readcount = 0; + if (available > 0) + { + Array.Copy(buf, pos, buffer, offset, available); + offset += available; + readcount += available; + available = 0; + pos = 0; + } + + while (true) + { + try + { + available = stream.Read(buf, 0, buf.Length); + pos = 0; + } + catch (Exception ex) + { + if (readcount > 0) + { + return readcount; + } + + throw (ex); + } + if (available < 1) + { + if (readcount > 0) + { + return readcount; + } + + return 0; + } + else + { + int toread = size - readcount; + if (toread <= available) + { + Array.Copy(buf, pos, buffer, offset, toread); + available -= toread; + pos += toread; + readcount += toread; + return readcount; + } + else + { + Array.Copy(buf, pos, buffer, offset, available); + offset += available; + readcount += available; + pos = 0; + available = 0; + } + } + } + } + } + + public override int ReadByte() + { + if (available > 0) + { + available -= 1; + pos += 1; + return buf[pos - 1]; + } + else + { + try + { + available = stream.Read(buf, 0, buf.Length); + pos = 0; + } + catch + { + return -1; + } + if (available < 1) + { + return -1; + } + else + { + available -= 1; + pos += 1; + return buf[pos - 1]; + } + } + } + + protected override void Dispose(bool disposing) + { + if (buf != null) + VariableSizedBufferPool.Release(buf); + + buf = null; + } + + public override bool CanRead + { + get { return true; } + } + + public override bool CanSeek + { + get { throw new NotImplementedException(); } + } + + public override bool CanWrite + { + get { throw new NotImplementedException(); } + } + + public override long Length + { + get { throw new NotImplementedException(); } + } + + public override long Position + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + public override void Flush() + { + throw new NotImplementedException(); + } + + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotImplementedException(); + } + + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + public override void Write(byte[] buffer, int offset, int count) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/ReadOnlyBufferedStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/ReadOnlyBufferedStream.cs.meta new file mode 100644 index 00000000..1749a3f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/ReadOnlyBufferedStream.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e6b9a4ff6813b4f4b9f2ffa453c3fccc +timeCreated: 1543513046 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/VariableSizedBufferPool.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/VariableSizedBufferPool.cs new file mode 100644 index 00000000..79346e1e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/VariableSizedBufferPool.cs @@ -0,0 +1,386 @@ +using System; +using System.Collections.Generic; + +namespace BestHTTP.Extensions +{ + /// + /// Private data struct that contains the size <-> byte arrays mapping. + /// + struct BufferStore + { + /// + /// Size/length of the arrays stored in the buffers. + /// + public readonly long Size; + + /// + /// + /// + public List buffers; + + public BufferStore(long size) + { + this.Size = size; + this.buffers = new List(); + } + + /// + /// Create a new store with its first byte[] to store. + /// + public BufferStore(long size, byte[] buffer) + : this(size) + { + this.buffers.Add(new BufferDesc(buffer)); + } + } + + struct BufferDesc + { + public static readonly BufferDesc Empty = new BufferDesc(null); + + /// + /// The actual reference to the stored byte array. + /// + public byte[] buffer; + + /// + /// When the buffer is put back to the pool. Based on this value the pool will calculate the age of the buffer. + /// + public DateTime released; + + public BufferDesc(byte[] buff) + { + this.buffer = buff; + this.released = DateTime.UtcNow; + } + } + + public static class VariableSizedBufferPool + { + public static readonly byte[] NoData = new byte[0]; + + /// + /// Setting this property to false the pooling mechanism can be disabled. + /// + public static bool IsEnabled { + get { return _isEnabled; } + set + { + _isEnabled = value; + + // When set to non-enabled remove all stored entries + if (!_isEnabled) + Clear(); + } + } + public static volatile bool _isEnabled = true; + + /// + /// Buffer entries that released back to the pool and older than this value are moved when next maintenance is triggered. + /// + public static TimeSpan RemoveOlderThan = TimeSpan.FromSeconds(30); + + /// + /// How often pool maintenance must run. + /// + public static TimeSpan RunMaintenanceEvery = TimeSpan.FromSeconds(10); + + /// + /// Minumum buffer size that the plugin will allocate when the requested size is smaller than this value, and canBeLarger is set to true. + /// + public static long MinBufferSize = 256; + + /// + /// Maximum size of a buffer that the plugin will store. + /// + public static long MaxBufferSize = long.MaxValue; + + /// + /// Maximum accomulated size of the stored buffers. + /// + public static long MaxPoolSize = 10 * 1024 * 1024; + + /// + /// Whether to remove empty buffer stores from the free list. + /// + public static bool RemoveEmptyLists = true; + + /// + /// If it set to true and a byte[] is released more than once it will log out an error. + /// + public static bool IsDoubleReleaseCheckEnabled = false; + + // It must be sorted by buffer size! + private static List FreeBuffers = new List(); + private static DateTime lastMaintenance = DateTime.MinValue; + + // Statistics + private static volatile int PoolSize = 0; + private static volatile uint GetBuffers = 0; + private static volatile uint ReleaseBuffers = 0; + private static System.Text.StringBuilder statiscticsBuilder = new System.Text.StringBuilder(); + + static VariableSizedBufferPool() + { +#if UNITY_EDITOR + IsDoubleReleaseCheckEnabled = true; +#else + IsDoubleReleaseCheckEnabled = false; +#endif + } + + /// + /// Get byte[] from the pool. If canBeLarge is true, the returned buffer might be larger than the requested size. + /// + public static byte[] Get(long size, bool canBeLarger) + { + if (!_isEnabled) + return new byte[size]; + + // Return a fix reference for 0 length requests. Any resize call (even Array.Resize) creates a new reference + // so we are safe to expose it to multiple callers. + if (size == 0) + return VariableSizedBufferPool.NoData; + + lock (FreeBuffers) + { + if (FreeBuffers.Count == 0) + return new byte[size]; + + BufferDesc bufferDesc = FindFreeBuffer(size, canBeLarger); + if (bufferDesc.buffer == null) + { + if (canBeLarger) + { + if (size < MinBufferSize) + size = MinBufferSize; + else if (!IsPowerOfTwo(size)) + size = NextPowerOf2(size); + } + + return new byte[size]; + } + else + GetBuffers++; + + PoolSize -= bufferDesc.buffer.Length; + + return bufferDesc.buffer; + } + } + + /// + /// Release a list of byte arrays back to the pool + /// + public static void Release(List buffers) + { + if (!_isEnabled || buffers == null || buffers.Count == 0) + return; + + for (int i = 0; i < buffers.Count; ++i) + Release(buffers[i]); + } + + /// + /// Release back a byte array to the pool. + /// + public static void Release(byte[] buffer) + { + if (!_isEnabled || buffer == null) + return; + + int size = buffer.Length; + + if (size == 0 || size > MaxBufferSize) + return; + + lock (FreeBuffers) + { + if (PoolSize + size > MaxPoolSize) + return; + PoolSize += size; + + ReleaseBuffers++; + + AddFreeBuffer(buffer); + } + } + + /// + /// Resize a byte array. It will release the old one to the pool, and the new one is from the pool too. + /// + public static byte[] Resize(ref byte[] buffer, int newSize, bool canBeLarger) + { + if (!_isEnabled) + { + Array.Resize(ref buffer, newSize); + return buffer; + } + + byte[] newBuf = VariableSizedBufferPool.Get(newSize, canBeLarger); + Array.Copy(buffer, 0, newBuf, 0, Math.Min(newBuf.Length, buffer.Length)); + VariableSizedBufferPool.Release(buffer); + return buffer = newBuf; + } + + /// + /// Get textual statistics about the buffer pool. + /// + public static string GetStatistics(bool showEmptyBuffers = true) + { + lock (FreeBuffers) + { + statiscticsBuilder.Length = 0; + statiscticsBuilder.AppendFormat("Pooled array reused count: {0:N0}\n", GetBuffers); + statiscticsBuilder.AppendFormat("Release call count: {0:N0}\n", ReleaseBuffers); + statiscticsBuilder.AppendFormat("PoolSize: {0:N0}\n", PoolSize); + statiscticsBuilder.AppendFormat("Buffers: {0}\n", FreeBuffers.Count); + + for (int i = 0; i < FreeBuffers.Count; ++i) + { + BufferStore store = FreeBuffers[i]; + List buffers = store.buffers; + + if (showEmptyBuffers || buffers.Count > 0) + statiscticsBuilder.AppendFormat("- Size: {0:N0} Count: {1:N0}\n", store.Size, buffers.Count); + } + + return statiscticsBuilder.ToString(); + } + } + + /// + /// Remove all stored entries instantly. + /// + public static void Clear() + { + lock (FreeBuffers) + { + FreeBuffers.Clear(); + PoolSize = 0; + } + } + + /// + /// Internal function called by the plugin the remove old, non-used buffers. + /// + internal static void Maintain() + { + DateTime now = DateTime.UtcNow; + if (!_isEnabled || lastMaintenance + RunMaintenanceEvery > now) + return; + lastMaintenance = now; + + DateTime olderThan = now - RemoveOlderThan; + lock (FreeBuffers) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Information("VariableSizedBufferPool", "Before Maintain: " + GetStatistics()); + + for (int i = 0; i < FreeBuffers.Count; ++i) + { + BufferStore store = FreeBuffers[i]; + List buffers = store.buffers; + + for (int cv = buffers.Count - 1; cv >= 0; cv--) + { + BufferDesc desc = buffers[cv]; + + if (desc.released < olderThan) + { + // buffers stores available buffers ascending by age. So, when we find an old enough, we can + // delete all entries in the [0..cv] range. + + int removeCount = cv + 1; + buffers.RemoveRange(0, removeCount); + PoolSize -= (int)(removeCount * store.Size); + break; + } + } + + if (RemoveEmptyLists && buffers.Count == 0) + FreeBuffers.RemoveAt(i--); + } + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Information("VariableSizedBufferPool", "After Maintain: " + GetStatistics()); + } + } + +#region Private helper functions + + private static bool IsPowerOfTwo(long x) + { + return (x & (x - 1)) == 0; + } + + private static long NextPowerOf2(long x) + { + long pow = 1; + while (pow <= x) + pow *= 2; + return pow; + } + + private static BufferDesc FindFreeBuffer(long size, bool canBeLarger) + { + for (int i = 0; i < FreeBuffers.Count; ++i) + { + BufferStore store = FreeBuffers[i]; + + if (store.buffers.Count > 0 && (store.Size == size || (canBeLarger && store.Size > size))) + { + // Getting the last one has two desired effect: + // 1.) RemoveAt should be quicker as it don't have to move all the remaining entries + // 2.) Old, non-used buffers will age. Getting a buffer and putting it back will not keep buffers fresh. + + BufferDesc lastFree = store.buffers[store.buffers.Count - 1]; + store.buffers.RemoveAt(store.buffers.Count - 1); + + return lastFree; + } + } + + return BufferDesc.Empty; + } + + private static void AddFreeBuffer(byte[] buffer) + { + int bufferLength = buffer.Length; + for (int i = 0; i < FreeBuffers.Count; ++i) + { + BufferStore store = FreeBuffers[i]; + + if (store.Size == bufferLength) + { + // We highly assume here that every buffer will be released only once. + // Checking for double-release would mean that we have to do another O(n) operation, where n is the + // count of the store's elements. + + if (IsDoubleReleaseCheckEnabled) + for (int cv = 0; cv < store.buffers.Count; ++cv) + if (store.buffers[cv].buffer == buffer) + { + HTTPManager.Logger.Error("VariableSizedBufferPool", "Buffer already added to the pool!"); + return; + } + + store.buffers.Add(new BufferDesc(buffer)); + return; + } + + if (store.Size > bufferLength) + { + FreeBuffers.Insert(i, new BufferStore(bufferLength, buffer)); + return; + } + } + + // When we reach this point, there's no same sized or larger BufferStore present, so we have to add a new one + // to the endo of our list. + FreeBuffers.Add(new BufferStore(bufferLength, buffer)); + } + +#endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/VariableSizedBufferPool.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/VariableSizedBufferPool.cs.meta new file mode 100644 index 00000000..d54fd40c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/VariableSizedBufferPool.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f00c45d747a5e2c46ac0957c9a17523c +timeCreated: 1543513047 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WWWAuthenticateHeaderParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WWWAuthenticateHeaderParser.cs new file mode 100644 index 00000000..3af73ee7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WWWAuthenticateHeaderParser.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Extensions +{ + /// + /// Used for parsing WWW-Authenticate headers: + /// Digest realm="my realm", nonce="4664b327a2963503ba58bbe13ad672c0", qop=auth, opaque="f7e38bdc1c66fce214f9019ffe43117c" + /// + public sealed class WWWAuthenticateHeaderParser : KeyValuePairList + { + public WWWAuthenticateHeaderParser(string headerValue) + { + Values = ParseQuotedHeader(headerValue); + } + + private List ParseQuotedHeader(string str) + { + List result = new List(); + + if (str != null) + { + + int idx = 0; + + // Read Type (Basic|Digest) + string type = str.Read(ref idx, (ch) => !char.IsWhiteSpace(ch) && !char.IsControl(ch)).TrimAndLower(); + result.Add(new HeaderValue(type)); + + // process the rest of the text + while (idx < str.Length) + { + // Read key + string key = str.Read(ref idx, '=').TrimAndLower(); + HeaderValue qp = new HeaderValue(key); + + // Skip any white space + str.SkipWhiteSpace(ref idx); + + qp.Value = str.ReadPossibleQuotedText(ref idx); + + result.Add(qp); + } + } + return result; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WWWAuthenticateHeaderParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WWWAuthenticateHeaderParser.cs.meta new file mode 100644 index 00000000..d26dda63 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WWWAuthenticateHeaderParser.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4cba91161fe643c419eedafefdf1f959 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WriteOnlyBufferedStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WriteOnlyBufferedStream.cs new file mode 100644 index 00000000..b9fe94a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WriteOnlyBufferedStream.cs @@ -0,0 +1,79 @@ +using System; +using System.IO; + +namespace BestHTTP.Extensions +{ + /// + /// A custom buffer stream implementation that will not close the underlying stream. + /// + public sealed class WriteOnlyBufferedStream : Stream + { + public override bool CanRead { get { return false; } } + public override bool CanSeek { get { return false; } } + public override bool CanWrite { get { return true; } } + public override long Length { get { return this.buffer.Length; } } + + public override long Position { get { return this._position; } set { throw new NotImplementedException("Position set"); } } + private int _position; + + private byte[] buffer; + private Stream stream; + + public WriteOnlyBufferedStream(Stream stream, int bufferSize) + { + this.stream = stream; + + this.buffer = VariableSizedBufferPool.Get(bufferSize, true); + this._position = 0; + } + + public override void Flush() + { + if (this._position > 0) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Information("BufferStream", string.Format("Flushing {0:N0} bytes", this._position)); + + this.stream.Write(this.buffer, 0, this._position); + this._position = 0; + } + } + + public override void Write(byte[] bufferFrom, int offset, int count) + { + while (count > 0) + { + int writeCount = Math.Min(count, this.buffer.Length - this._position); + Array.Copy(bufferFrom, offset, this.buffer, this._position, writeCount); + + this._position += writeCount; + offset += writeCount; + count -= writeCount; + + if (this._position == this.buffer.Length) + this.Flush(); + } + } + + public override int Read(byte[] buffer, int offset, int count) + { + return 0; + } + + public override long Seek(long offset, SeekOrigin origin) + { + return 0; + } + + public override void SetLength(long value) { } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (this.buffer != null) + VariableSizedBufferPool.Release(this.buffer); + this.buffer = null; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WriteOnlyBufferedStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WriteOnlyBufferedStream.cs.meta new file mode 100644 index 00000000..1c4cc6ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Extensions/WriteOnlyBufferedStream.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2df120a767773ee478acf872b86ae326 +timeCreated: 1530027551 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms.meta new file mode 100644 index 00000000..dbba7c22 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 867abf3a1ab01c84681b6c85becf6b6d +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFieldData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFieldData.cs new file mode 100644 index 00000000..5ff5e795 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFieldData.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Forms +{ + /// + /// This class represents a HTTP Form's field. + /// + public class HTTPFieldData + { + /// + /// The form's field. + /// + public string Name { get; set; } + + /// + /// Filename of the field. Optional. + /// + public string FileName { get; set; } + + /// + /// Mime-type of the field. Optional + /// + public string MimeType { get; set; } + + /// + /// Encoding of the data. Optional + /// + public Encoding Encoding { get; set; } + + /// + /// The field's textual data. + /// + public string Text { get; set; } + + /// + /// The field's binary data. + /// + public byte[] Binary { get; set; } + + /// + /// Will return with the binary data, or if it's not present the textual data will be decoded to binary. + /// + public byte[] Payload + { + get + { + if (Binary != null) + return Binary; + + if (Encoding == null) + Encoding = Encoding.UTF8; + + return Binary = Encoding.GetBytes(Text); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFieldData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFieldData.cs.meta new file mode 100644 index 00000000..27f683ca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFieldData.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bdf9d0d59653fa8418a86f22360ff91e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormBase.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormBase.cs new file mode 100644 index 00000000..949dfd74 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormBase.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Forms +{ + /// + /// Base class of a concrete implementation. Don't use it to create a form, use instead one of the already wrote implementation(HTTPMultiPartForm, HTTPUrlEncodedForm), or create a new one by inheriting from this base class. + /// + public class HTTPFormBase + { + const int LongLength = 256; + + #region Properties + + /// + /// A list that holds the form's fields. + /// + public List Fields { get; set; } + + /// + /// Returns true if the Fields has no element. + /// + public bool IsEmpty { get { return Fields == null || Fields.Count == 0; } } + + /// + /// True if new fields has been added to our list. + /// + public bool IsChanged { get; protected set; } + + /// + /// True if there are at least one form-field with binary data. + /// + public bool HasBinary { get; protected set; } + + /// + /// True if there are at least one form-field with a long textual data. + /// + public bool HasLongValue { get; protected set; } + + #endregion + + #region Field Management + + public void AddBinaryData(string fieldName, byte[] content) + { + AddBinaryData(fieldName, content, null, null); + } + + public void AddBinaryData(string fieldName, byte[] content, string fileName) + { + AddBinaryData(fieldName, content, fileName, null); + } + + public void AddBinaryData(string fieldName, byte[] content, string fileName, string mimeType) + { + if (Fields == null) + Fields = new List(); + + HTTPFieldData field = new HTTPFieldData(); + field.Name = fieldName; + + if (fileName == null) + field.FileName = fieldName + ".dat"; + else + field.FileName = fileName; + + if (mimeType == null) + field.MimeType = "application/octet-stream"; + else + field.MimeType = mimeType; + + field.Binary = content; + + Fields.Add(field); + + HasBinary = IsChanged = true; + } + + public void AddField(string fieldName, string value) + { + AddField(fieldName, value, System.Text.Encoding.UTF8); + } + + public void AddField(string fieldName, string value, System.Text.Encoding e) + { + if (Fields == null) + Fields = new List(); + + HTTPFieldData field = new HTTPFieldData(); + field.Name = fieldName; + field.FileName = null; + if (e != null) + field.MimeType = "text/plain; charset=" + e.WebName; + field.Text = value; + field.Encoding = e; + + Fields.Add(field); + + IsChanged = true; + + HasLongValue |= value.Length > LongLength; + } + + #endregion + + #region Virtual Functions + + /// + /// It should 'clone' all the data from the given HTTPFormBase object. + /// Called after the form-implementation created. + /// + public virtual void CopyFrom(HTTPFormBase fields) + { + this.Fields = new List(fields.Fields); + this.IsChanged = true; + + this.HasBinary = fields.HasBinary; + this.HasLongValue = fields.HasLongValue; + } + + /// + /// Prepares the request to sending a form. It should set only the headers. + /// + public virtual void PrepareRequest(HTTPRequest request) + { + throw new NotImplementedException(); + } + + /// + /// Prepares and returns with the form's raw data. + /// + public virtual byte[] GetData() + { + throw new NotImplementedException(); + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormBase.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormBase.cs.meta new file mode 100644 index 00000000..88b2c9a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormBase.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7d275ec92441f18449bffc98e08d44e8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormUsage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormUsage.cs new file mode 100644 index 00000000..6ce8cb1d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormUsage.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Forms +{ + public enum HTTPFormUsage + { + /// + /// The plugin will try to choose the best form sending method. + /// + Automatic, + + /// + /// The plugin will use the Url-Encoded form sending. + /// + UrlEncoded, + + /// + /// The plugin will use the Multipart form sending. + /// + Multipart, + + /// + /// Using this type of form, the plugin will send the data converted to a JSon string. + /// + RawJSon, + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormUsage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormUsage.cs.meta new file mode 100644 index 00000000..f23208ab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/HTTPFormUsage.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: fc8643409dcf53d4db0bf0f654ad8500 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations.meta new file mode 100644 index 00000000..f7423259 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: acc326f47252d77498d6489dce7ff997 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPMultiPartForm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPMultiPartForm.cs new file mode 100644 index 00000000..d8fc84c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPMultiPartForm.cs @@ -0,0 +1,79 @@ +using BestHTTP.Extensions; + +namespace BestHTTP.Forms +{ + /// + /// A HTTP Form implementation to send textual and binary values. + /// + public sealed class HTTPMultiPartForm : HTTPFormBase + { + #region Private Fields + + /// + /// A random boundary generated in the constructor. + /// + private string Boundary; + + /// + /// + /// + private byte[] CachedData; + + #endregion + + public HTTPMultiPartForm() + { + this.Boundary = "BestHTTP_HTTPMultiPartForm_" + this.GetHashCode().ToString("X"); + } + + #region IHTTPForm Implementation + + public override void PrepareRequest(HTTPRequest request) + { + // Set up Content-Type header for the request + request.SetHeader("Content-Type", "multipart/form-data; boundary=\"" + Boundary + "\""); + } + + public override byte[] GetData() + { + if (CachedData != null) + return CachedData; + + using (var ms = new Extensions.BufferPoolMemoryStream()) + { + for (int i = 0; i < Fields.Count; ++i) + { + HTTPFieldData field = Fields[i]; + + // Set the boundary + ms.WriteLine("--" + Boundary); + + // Set up Content-Disposition header to our form with the name + ms.WriteLine("Content-Disposition: form-data; name=\"" + field.Name + "\"" + (!string.IsNullOrEmpty(field.FileName) ? "; filename=\"" + field.FileName + "\"" : string.Empty)); + + // Set up Content-Type head for the form. + if (!string.IsNullOrEmpty(field.MimeType)) + ms.WriteLine("Content-Type: " + field.MimeType); + + ms.WriteLine("Content-Length: " + field.Payload.Length.ToString()); + ms.WriteLine(); + + // Write the actual data to the MemoryStream + ms.Write(field.Payload, 0, field.Payload.Length); + + ms.Write(HTTPRequest.EOL, 0, HTTPRequest.EOL.Length); + } + + // Write out the trailing boundary + ms.WriteLine("--" + Boundary + "--"); + + IsChanged = false; + + // Set the RawData of our request + return CachedData = ms.ToArray(); + } + } + + #endregion + }; +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPMultiPartForm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPMultiPartForm.cs.meta new file mode 100644 index 00000000..d223b1ff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPMultiPartForm.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5f9390c7b6f72b845805363b01dfbba9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPUrlEncodedForm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPUrlEncodedForm.cs new file mode 100644 index 00000000..694123d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPUrlEncodedForm.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Forms +{ + /// + /// A HTTP Form implementation to send textual values. + /// + public sealed class HTTPUrlEncodedForm : HTTPFormBase + { + private const int EscapeTreshold = 256; + + private byte[] CachedData; + + public override void PrepareRequest(HTTPRequest request) + { + request.SetHeader("Content-Type", "application/x-www-form-urlencoded"); + } + + public override byte[] GetData() + { + if (CachedData != null && !IsChanged) + return CachedData; + + StringBuilder sb = new StringBuilder(); + + // Create a "field1=value1&field2=value2" formatted string + for (int i = 0; i < Fields.Count; ++i) + { + var field = Fields[i]; + + if (i > 0) + sb.Append("&"); + + sb.Append(EscapeString(field.Name)); + sb.Append("="); + + if (!string.IsNullOrEmpty(field.Text) || field.Binary == null) + sb.Append(EscapeString(field.Text)); + else + // If forced to this form type with binary data, we will create a string from the binary data first and encode this string. + sb.Append(EscapeString(Encoding.UTF8.GetString(field.Binary, 0, field.Binary.Length))); + } + + IsChanged = false; + return CachedData = Encoding.UTF8.GetBytes(sb.ToString()); + } + + public static string EscapeString(string originalString) + { + if (originalString.Length < EscapeTreshold) + return Uri.EscapeDataString(originalString); + else + { + int loops = originalString.Length / EscapeTreshold; + StringBuilder sb = new StringBuilder(loops); + + for (int i = 0; i <= loops; i++) + sb.Append(i < loops ? + Uri.EscapeDataString(originalString.Substring(EscapeTreshold * i, EscapeTreshold)) : + Uri.EscapeDataString(originalString.Substring(EscapeTreshold * i))); + return sb.ToString(); + } + } + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPUrlEncodedForm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPUrlEncodedForm.cs.meta new file mode 100644 index 00000000..74123e87 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/HTTPUrlEncodedForm.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 023a00e6d3a980b4babe8c70a7d00088 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/RawJSonForm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/RawJSonForm.cs new file mode 100644 index 00000000..123fd305 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/RawJSonForm.cs @@ -0,0 +1,36 @@ +// Contributed by Matt Senne from conjoinedcats.com +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Forms +{ + public sealed class RawJsonForm : HTTPFormBase + { + private byte[] CachedData; + + /// + /// Prepares the request to sending a form. It should set only the headers. + /// + public override void PrepareRequest(HTTPRequest request) + { + request.SetHeader("Content-Type", "application/json"); + } + + /// + /// Prepares and returns with the form's raw data. + /// + public override byte[] GetData() + { + if (CachedData != null && !IsChanged) + return CachedData; + + Dictionary dict = Fields.ToDictionary(x => x.Name, x => x.Text); + string json = JSON.Json.Encode(dict); + + IsChanged = false; + return CachedData = Encoding.UTF8.GetBytes(json); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/RawJSonForm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/RawJSonForm.cs.meta new file mode 100644 index 00000000..6d35d02f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Forms/Implementations/RawJSonForm.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 23946220d212ad04aaff31e9eccd4018 +timeCreated: 1493280601 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnection.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnection.cs new file mode 100644 index 00000000..477fd242 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnection.cs @@ -0,0 +1,780 @@ +using System; +using System.Collections.Generic; +using System.IO; + +using System.Text; +using System.Threading; +using BestHTTP.Extensions; +using BestHTTP.Authentication; + +#if !NETFX_CORE || UNITY_EDITOR + using System.Net.Security; +#endif + +#if !BESTHTTP_DISABLE_CACHING + using BestHTTP.Caching; +#endif + +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls; + using Org.BouncyCastle.Crypto.Tls; +#endif + +#if !BESTHTTP_DISABLE_COOKIES + using BestHTTP.Cookies; +#endif + +#if NETFX_CORE || BUILD_FOR_WP8 + using System.Threading.Tasks; + using Windows.Networking.Sockets; + + using TcpClient = BestHTTP.PlatformSupport.TcpClient.WinRT.TcpClient; + + //Disable CD4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. + #pragma warning disable 4014 +#else + using TcpClient = BestHTTP.PlatformSupport.TcpClient.General.TcpClient; +#endif + +namespace BestHTTP +{ + /// + /// https://tools.ietf.org/html/draft-thomson-hybi-http-timeout-03 + /// Test servers: http://tools.ietf.org/ http://nginx.org/ + /// + internal sealed class KeepAliveHeader + { + /// + /// A host sets the value of the "timeout" parameter to the time that the host will allow an idle connection to remain open before it is closed. A connection is idle if no data is sent or received by a host. + /// + public TimeSpan TimeOut { get; private set; } + + /// + /// The "max" parameter has been used to indicate the maximum number of requests that would be made on the connection.This parameter is deprecated.Any limit on requests can be enforced by sending "Connection: close" and closing the connection. + /// + public int MaxRequests { get; private set; } + + public void Parse(List headerValues) + { + HeaderParser parser = new HeaderParser(headerValues[0]); + HeaderValue value; + if (parser.TryGet("timeout", out value) && value.HasValue) + { + int intValue = 0; + if (int.TryParse(value.Value, out intValue)) + this.TimeOut = TimeSpan.FromSeconds(intValue); + else + this.TimeOut = TimeSpan.MaxValue; + } + + if (parser.TryGet("max", out value) && value.HasValue) + { + int intValue = 0; + if (int.TryParse("max", out intValue)) + this.MaxRequests = intValue; + else + this.MaxRequests = int.MaxValue; + } + } + } + + internal enum RetryCauses + { + /// + /// The request processed without any special case. + /// + None, + + /// + /// If the server closed the connection while we sending a request we should reconnect and send the request again. But we will try it once. + /// + Reconnect, + + /// + /// We need an another try with Authorization header set. + /// + Authenticate, + +#if !BESTHTTP_DISABLE_PROXY + /// + /// The proxy needs authentication. + /// + ProxyAuthenticate, +#endif + } + + /// + /// Represents and manages a connection to a server. + /// + internal sealed class HTTPConnection : ConnectionBase + { + public override bool IsRemovable + { + get + { + // Plugin's own connection pooling + if (base.IsRemovable) + return true; + + // Overridden keep-alive timeout by a Keep-Alive header + if (IsFree && KeepAlive != null && (DateTime.UtcNow - base.LastProcessTime) >= KeepAlive.TimeOut) + return true; + + return false; + } + } + + #region Private Properties + + private TcpClient Client; + private Stream Stream; + private KeepAliveHeader KeepAlive; + + #endregion + + internal HTTPConnection(string serverAddress) + :base(serverAddress) + {} + + #region Request Processing Implementation + + protected override +#if NETFX_CORE + async +#endif + void ThreadFunc(object param) + { + bool alreadyReconnected = false; + bool redirected = false; + + RetryCauses cause = RetryCauses.None; + + try + { +#if !BESTHTTP_DISABLE_CACHING + // Try load the full response from an already saved cache entity. If the response + if (TryLoadAllFromCache()) + return; +#endif + + if (Client != null && !Client.IsConnected()) + Close(); + + do // of while (reconnect) + { + if (cause == RetryCauses.Reconnect) + { + Close(); +#if NETFX_CORE + await Task.Delay(100); +#else + Thread.Sleep(100); +#endif + } + + LastProcessedUri = CurrentRequest.CurrentUri; + + cause = RetryCauses.None; + + // Connect to the server + Connect(); + + if (State == HTTPConnectionStates.AbortRequested) + throw new Exception("AbortRequested"); + + #if !BESTHTTP_DISABLE_CACHING + // Setup cache control headers before we send out the request + if (!CurrentRequest.DisableCache) + HTTPCacheService.SetHeaders(CurrentRequest); + #endif + + // Write the request to the stream + // sentRequest will be true if the request sent out successfully(no SocketException), so we can try read the response + bool sentRequest = false; + try + { +#if !NETFX_CORE + Client.NoDelay = CurrentRequest.TryToMinimizeTCPLatency; +#endif + CurrentRequest.SendOutTo(Stream); + + sentRequest = true; + } + catch (Exception ex) + { + Close(); + + if (State == HTTPConnectionStates.TimedOut || + State == HTTPConnectionStates.AbortRequested) + throw new Exception("AbortRequested"); + + // We will try again only once + if (!alreadyReconnected && !CurrentRequest.DisableRetry) + { + alreadyReconnected = true; + cause = RetryCauses.Reconnect; + } + else // rethrow exception + throw ex; + } + + // If sending out the request succeeded, we will try read the response. + if (sentRequest) + { + bool received = Receive(); + + if (State == HTTPConnectionStates.TimedOut || + State == HTTPConnectionStates.AbortRequested) + throw new Exception("AbortRequested"); + + if (!received && !alreadyReconnected && !CurrentRequest.DisableRetry) + { + alreadyReconnected = true; + cause = RetryCauses.Reconnect; + } + + if (CurrentRequest.Response != null) + { +#if !BESTHTTP_DISABLE_COOKIES + // Try to store cookies before we do anything else, as we may remove the response deleting the cookies as well. + if (CurrentRequest.IsCookiesEnabled) + { + CookieJar.Set(CurrentRequest.Response); + CookieJar.Persist(); + } +#endif + + switch (CurrentRequest.Response.StatusCode) + { + // Not authorized + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2 + case 401: + { + string authHeader = DigestStore.FindBest(CurrentRequest.Response.GetHeaderValues("www-authenticate")); + if (!string.IsNullOrEmpty(authHeader)) + { + var digest = DigestStore.GetOrCreate(CurrentRequest.CurrentUri); + digest.ParseChallange(authHeader); + + if (CurrentRequest.Credentials != null && digest.IsUriProtected(CurrentRequest.CurrentUri) && (!CurrentRequest.HasHeader("Authorization") || digest.Stale)) + cause = RetryCauses.Authenticate; + } + + goto default; + } + +#if !BESTHTTP_DISABLE_PROXY + // Proxy authentication required + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.8 + case 407: + { + if (CurrentRequest.HasProxy) + { + string authHeader = DigestStore.FindBest(CurrentRequest.Response.GetHeaderValues("proxy-authenticate")); + if (!string.IsNullOrEmpty(authHeader)) + { + var digest = DigestStore.GetOrCreate(CurrentRequest.Proxy.Address); + digest.ParseChallange(authHeader); + + if (CurrentRequest.Proxy.Credentials != null && digest.IsUriProtected(CurrentRequest.Proxy.Address) && (!CurrentRequest.HasHeader("Proxy-Authorization") || digest.Stale)) + cause = RetryCauses.ProxyAuthenticate; + } + } + + goto default; + } +#endif + + // Redirected + case 301: // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2 + case 302: // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3 + case 307: // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8 + case 308: // http://tools.ietf.org/html/rfc7238 + { + if (CurrentRequest.RedirectCount >= CurrentRequest.MaxRedirects) + goto default; + CurrentRequest.RedirectCount++; + + string location = CurrentRequest.Response.GetFirstHeaderValue("location"); + if (!string.IsNullOrEmpty(location)) + { + Uri redirectUri = GetRedirectUri(location); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPConnection", string.Format("{0} - Redirected to Location: '{1}' redirectUri: '{1}'", this.CurrentRequest.CurrentUri.ToString(), location, redirectUri)); + + // Let the user to take some control over the redirection + if (!CurrentRequest.CallOnBeforeRedirection(redirectUri)) + { + HTTPManager.Logger.Information("HTTPConnection", "OnBeforeRedirection returned False"); + goto default; + } + + // Remove the previously set Host header. + CurrentRequest.RemoveHeader("Host"); + + // Set the Referer header to the last Uri. + CurrentRequest.SetHeader("Referer", CurrentRequest.CurrentUri.ToString()); + + // Set the new Uri, the CurrentUri will return this while the IsRedirected property is true + CurrentRequest.RedirectUri = redirectUri; + + // Discard the redirect response, we don't need it any more + CurrentRequest.Response = null; + + redirected = CurrentRequest.IsRedirected = true; + } + else + #if !NETFX_CORE + throw new MissingFieldException(string.Format("Got redirect status({0}) without 'location' header!", CurrentRequest.Response.StatusCode.ToString())); + #else + throw new Exception(string.Format("Got redirect status({0}) without 'location' header!", CurrentRequest.Response.StatusCode.ToString())); + #endif + + goto default; + } + + + default: +#if !BESTHTTP_DISABLE_CACHING + TryStoreInCache(); +#endif + break; + } + + // Closing the stream is done manually + if (CurrentRequest.Response == null || !CurrentRequest.Response.IsClosedManually) { + // If we have a response and the server telling us that it closed the connection after the message sent to us, then + // we will close the connection too. + bool closeByServer = CurrentRequest.Response == null || CurrentRequest.Response.HasHeaderWithValue("connection", "close"); + bool closeByClient = !CurrentRequest.IsKeepAlive; + + if (closeByServer || closeByClient) + Close(); + else if (CurrentRequest.Response != null) + { + var keepAliveheaderValues = CurrentRequest.Response.GetHeaderValues("keep-alive"); + if (keepAliveheaderValues != null && keepAliveheaderValues.Count > 0) + { + if (KeepAlive == null) + KeepAlive = new KeepAliveHeader(); + KeepAlive.Parse(keepAliveheaderValues); + } + } + } + } + } + + } while (cause != RetryCauses.None); + } + catch(TimeoutException e) + { + CurrentRequest.Response = null; + CurrentRequest.Exception = e; + CurrentRequest.State = HTTPRequestStates.ConnectionTimedOut; + + Close(); + } + catch (Exception e) + { + if (CurrentRequest != null) + { +#if !BESTHTTP_DISABLE_CACHING + if (CurrentRequest.UseStreaming) + HTTPCacheService.DeleteEntity(CurrentRequest.CurrentUri); +#endif + + // Something gone bad, Response must be null! + CurrentRequest.Response = null; + + switch (State) + { + case HTTPConnectionStates.Closed: + case HTTPConnectionStates.AbortRequested: + CurrentRequest.State = HTTPRequestStates.Aborted; + break; + case HTTPConnectionStates.TimedOut: + CurrentRequest.State = HTTPRequestStates.TimedOut; + break; + default: + CurrentRequest.Exception = e; + CurrentRequest.State = HTTPRequestStates.Error; + break; + } + } + + Close(); + } + finally + { + if (CurrentRequest != null) + { + // Avoid state changes. While we are in this block changing the connection's State, on Unity's main thread + // the HTTPManager's OnUpdate will check the connections's State and call functions that can change the inner state of + // the object. (Like setting the CurrentRequest to null in function Recycle() causing a NullRef exception) + lock (HTTPManager.Locker) + { + if (CurrentRequest != null && CurrentRequest.Response != null && CurrentRequest.Response.IsUpgraded) + State = HTTPConnectionStates.Upgraded; + else + State = redirected ? HTTPConnectionStates.Redirected : (Client == null ? HTTPConnectionStates.Closed : HTTPConnectionStates.WaitForRecycle); + + // Change the request's state only when the whole processing finished + if (CurrentRequest.State == HTTPRequestStates.Processing && (State == HTTPConnectionStates.Closed || State == HTTPConnectionStates.WaitForRecycle)) + { + if (CurrentRequest.Response != null) + CurrentRequest.State = HTTPRequestStates.Finished; + else + { + CurrentRequest.Exception = new Exception(string.Format("Remote server closed the connection before sending response header! Previous request state: {0}. Connection state: {1}", + CurrentRequest.State.ToString(), + State.ToString())); + CurrentRequest.State = HTTPRequestStates.Error; + } + } + + if (CurrentRequest.State == HTTPRequestStates.ConnectionTimedOut) + State = HTTPConnectionStates.Closed; + + LastProcessTime = DateTime.UtcNow; + + if (OnConnectionRecycled != null) + RecycleNow(); + } + } + } + } + + private void Connect() + { + Uri uri = +#if !BESTHTTP_DISABLE_PROXY + CurrentRequest.HasProxy ? CurrentRequest.Proxy.Address : +#endif + CurrentRequest.CurrentUri; + + #region TCP Connection + + if (Client == null) + Client = new TcpClient(); + + if (!Client.Connected) + { + Client.ConnectTimeout = CurrentRequest.ConnectTimeout; + +#if NETFX_CORE + Client.UseHTTPSProtocol = + #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + !CurrentRequest.UseAlternateSSL && + #endif + HTTPProtocolFactory.IsSecureProtocol(uri); +#endif + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPConnection", string.Format("'{0}' - Connecting to {1}:{2}", this.CurrentRequest.CurrentUri.ToString(), uri.Host, uri.Port.ToString())); + +#if !NETFX_CORE && (!UNITY_WEBGL || UNITY_EDITOR) + Client.SendBufferSize = HTTPManager.SendBufferSize; + Client.ReceiveBufferSize = HTTPManager.ReceiveBufferSize; + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPConnection", string.Format("'{0}' - Buffer sizes - Send: {1} Receive: {2} Blocking: {3}", this.CurrentRequest.CurrentUri.ToString(), Client.SendBufferSize.ToString(), Client.ReceiveBufferSize.ToString(), Client.Client.Blocking.ToString())); +#endif + + Client.Connect(uri.Host, uri.Port); + + if (HTTPManager.Logger.Level <= Logger.Loglevels.Information) + HTTPManager.Logger.Information("HTTPConnection", "Connected to " + uri.Host + ":" + uri.Port.ToString()); + } + else if (HTTPManager.Logger.Level <= Logger.Loglevels.Information) + HTTPManager.Logger.Information("HTTPConnection", "Already connected to " + uri.Host + ":" + uri.Port.ToString()); + + #endregion + + StartTime = DateTime.UtcNow; + + if (Stream == null) + { + bool isSecure = HTTPProtocolFactory.IsSecureProtocol(CurrentRequest.CurrentUri); + + Stream = Client.GetStream(); + /*if (Stream.CanTimeout) + Stream.ReadTimeout = Stream.WriteTimeout = (int)CurrentRequest.Timeout.TotalMilliseconds;*/ + + +#if !BESTHTTP_DISABLE_PROXY + if (CurrentRequest.Proxy != null) + CurrentRequest.Proxy.Connect(this.Stream, this.CurrentRequest); +#endif + + // We have to use CurrentRequest.CurrentUri here, because uri can be a proxy uri with a different protocol + if (isSecure) + { + // Under the new experimental runtime there's a bug in the Socket.Send implementation that can cause a + // connection when the TLS protocol is used. +#if !NETFX_CORE && (!UNITY_WEBGL || UNITY_EDITOR) && NET_4_6 + //Client.SendBufferSize = 0; +#endif + +#region SSL Upgrade + +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + if (CurrentRequest.UseAlternateSSL) + { + var handler = new TlsClientProtocol(Client.GetStream(), new BestHTTP.SecureProtocol.Org.BouncyCastle.Security.SecureRandom()); + + // http://tools.ietf.org/html/rfc3546#section-3.1 + // -It is RECOMMENDED that clients include an extension of type "server_name" in the client hello whenever they locate a server by a supported name type. + // -Literal IPv4 and IPv6 addresses are not permitted in "HostName". + + // User-defined list has a higher priority + List hostNames = CurrentRequest.CustomTLSServerNameList; + + // If there's no user defined one and the host isn't an IP address, add the default one + if ((hostNames == null || hostNames.Count == 0) && !CurrentRequest.CurrentUri.IsHostIsAnIPAddress()) + { + hostNames = new List(1); + hostNames.Add(CurrentRequest.CurrentUri.Host); + } + + handler.Connect(new LegacyTlsClient(CurrentRequest.CurrentUri, + CurrentRequest.CustomCertificateVerifyer == null ? new AlwaysValidVerifyer() : CurrentRequest.CustomCertificateVerifyer, + CurrentRequest.CustomClientCredentialsProvider, + hostNames)); + + Stream = handler.Stream; + } + else +#endif + { +#if !NETFX_CORE + SslStream sslStream = new SslStream(Client.GetStream(), false, (sender, cert, chain, errors) => + { + return CurrentRequest.CallCustomCertificationValidator(cert, chain); + }); + + if (!sslStream.IsAuthenticated) + sslStream.AuthenticateAsClient(CurrentRequest.CurrentUri.Host); + Stream = sslStream; +#else + Stream = Client.GetStream(); +#endif + } + +#endregion + } + } + } + + private bool Receive() + { + SupportedProtocols protocol = CurrentRequest.ProtocolHandler == SupportedProtocols.Unknown ? HTTPProtocolFactory.GetProtocolFromUri(CurrentRequest.CurrentUri) : CurrentRequest.ProtocolHandler; + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPConnection", string.Format("{0} - Receive - protocol: {1}", this.CurrentRequest.CurrentUri.ToString(), protocol.ToString())); + + CurrentRequest.Response = HTTPProtocolFactory.Get(protocol, CurrentRequest, Stream, CurrentRequest.UseStreaming, false); + + if (!CurrentRequest.Response.Receive()) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPConnection", string.Format("{0} - Receive - Failed! Response will be null, returning with false.", this.CurrentRequest.CurrentUri.ToString())); + CurrentRequest.Response = null; + return false; + } + + if (CurrentRequest.Response.StatusCode == 304 +#if !BESTHTTP_DISABLE_CACHING + && !CurrentRequest.DisableCache +#endif + ) + { +#if !BESTHTTP_DISABLE_CACHING + if (CurrentRequest.IsRedirected) + { + if (!LoadFromCache(CurrentRequest.RedirectUri)) + LoadFromCache(CurrentRequest.Uri); + } + else + LoadFromCache(CurrentRequest.Uri); +#else + return false; +#endif + } + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPConnection", string.Format("{0} - Receive - Finished Successfully!", this.CurrentRequest.CurrentUri.ToString())); + + return true; + } + +#endregion + +#region Helper Functions + +#if !BESTHTTP_DISABLE_CACHING + + private bool LoadFromCache(Uri uri) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPConnection", string.Format("{0} - LoadFromCache for Uri: {1}", this.CurrentRequest.CurrentUri.ToString(), uri.ToString())); + + var cacheEntity = HTTPCacheService.GetEntity(uri); + if (cacheEntity == null) + { + HTTPManager.Logger.Warning("HTTPConnection", string.Format("{0} - LoadFromCache for Uri: {1} - Cached entity not found!", this.CurrentRequest.CurrentUri.ToString(), uri.ToString())); + return false; + } + + CurrentRequest.Response.CacheFileInfo = cacheEntity; + + int bodyLength; + using (var cacheStream = cacheEntity.GetBodyStream(out bodyLength)) + { + if (cacheStream == null) + return false; + + if (!CurrentRequest.Response.HasHeader("content-length")) + CurrentRequest.Response.Headers.Add("content-length", new List(1) { bodyLength.ToString() }); + CurrentRequest.Response.IsFromCache = true; + + if (!CurrentRequest.CacheOnly) + CurrentRequest.Response.ReadRaw(cacheStream, bodyLength); + } + + return true; + } + + private bool TryLoadAllFromCache() + { + if (CurrentRequest.DisableCache || !HTTPCacheService.IsSupported) + return false; + + // We will try read the response from the cache, but if something happens we will fallback to the normal way. + try + { + //Unless specifically constrained by a cache-control (section 14.9) directive, a caching system MAY always store a successful response (see section 13.8) as a cache entity, + // MAY return it without validation if it is fresh, and MAY return it after successful validation. + // MAY return it without validation if it is fresh! + if (HTTPCacheService.IsCachedEntityExpiresInTheFuture(CurrentRequest)) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPConnection", string.Format("{0} - TryLoadAllFromCache - whole response loading from cache", this.CurrentRequest.CurrentUri.ToString())); + + CurrentRequest.Response = HTTPCacheService.GetFullResponse(CurrentRequest); + + if (CurrentRequest.Response != null) + return true; + } + } + catch + { + HTTPCacheService.DeleteEntity(CurrentRequest.CurrentUri); + } + + return false; + } +#endif + +#if !BESTHTTP_DISABLE_CACHING + private void TryStoreInCache() + { + // if UseStreaming && !DisableCache then we already wrote the response to the cache + if (!CurrentRequest.UseStreaming && + !CurrentRequest.DisableCache && + CurrentRequest.Response != null && + HTTPCacheService.IsSupported && + HTTPCacheService.IsCacheble(CurrentRequest.CurrentUri, CurrentRequest.MethodType, CurrentRequest.Response)) + { + if(CurrentRequest.IsRedirected) + HTTPCacheService.Store(CurrentRequest.Uri, CurrentRequest.MethodType, CurrentRequest.Response); + else + HTTPCacheService.Store(CurrentRequest.CurrentUri, CurrentRequest.MethodType, CurrentRequest.Response); + HTTPCacheService.SaveLibrary(); + } + } +#endif + + private Uri GetRedirectUri(string location) + { + Uri result = null; + try + { + result = new Uri(location); + + if (result.IsFile || result.AbsolutePath == location) + result = null; + } +#if !NETFX_CORE + catch (UriFormatException) +#else + catch +#endif + { + // Sometimes the server sends back only the path and query component of the new uri + result = null; + } + + if (result == null) + { + var uri = CurrentRequest.Uri; + var builder = new UriBuilder(uri.Scheme, uri.Host, uri.Port, location); + result = builder.Uri; + + } + + return result; + } + + internal override void Abort(HTTPConnectionStates newState) + { + State = newState; + + switch(State) + { + case HTTPConnectionStates.TimedOut: TimedOutStart = DateTime.UtcNow; break; + } + + if (Stream != null) + { + try + { + Stream.Dispose(); + } + catch + { } + } + } + + private void Close() + { + KeepAlive = null; + LastProcessedUri = null; + if (Client != null) + { + try + { + Client.Close(); + } + catch + { + + } + finally + { + Stream = null; + Client = null; + } + } + } + +#endregion + + protected override void Dispose(bool disposing) + { + Close(); + + base.Dispose(disposing); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnection.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnection.cs.meta new file mode 100644 index 00000000..997691da --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnection.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c6e10f65ea45b8e4682ebe6a0c885e06 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnectionStates.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnectionStates.cs new file mode 100644 index 00000000..90f2465b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnectionStates.cs @@ -0,0 +1,59 @@ +namespace BestHTTP +{ + /// + /// Possible states of a Http Connection. + /// The ideal lifecycle of a connection that has KeepAlive is the following: Initial => [Processing => WaitForRecycle => Free] => Closed. + /// + internal enum HTTPConnectionStates + { + /// + /// This Connection instance is just created. + /// + Initial, + + /// + /// This Connection is processing a request + /// + Processing, + + /// + /// The request redirected. + /// + Redirected, + + /// + /// The connection is upgraded from http. + /// + Upgraded, + + /// + /// Wait for the upgraded protocol to shut down. + /// + WaitForProtocolShutdown, + + /// + /// The Connection is finished processing the request, it's waiting now to deliver it's result. + /// + WaitForRecycle, + + /// + /// The request result's delivered, it's now up to processing again. + /// + Free, + + /// + /// A request from outside of the plugin to abort the connection. + /// + AbortRequested, + + /// + /// The request is not finished in the given time. + /// + TimedOut, + + /// + /// If it's not a KeepAlive connection, or something happend, then we close this connection and remove from the pool. + /// + Closed + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnectionStates.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnectionStates.cs.meta new file mode 100644 index 00000000..3ead1f3b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPConnectionStates.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ae2c4bf49da6b1b4097d46250f2ff3bf +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPManager.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPManager.cs new file mode 100644 index 00000000..f79188b1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPManager.cs @@ -0,0 +1,823 @@ +using System; +using System.Collections.Generic; + +#if !BESTHTTP_DISABLE_CACHING + using BestHTTP.Caching; +#endif + +using BestHTTP.Extensions; +using BestHTTP.Logger; +using BestHTTP.Statistics; + +namespace BestHTTP +{ + /// + /// + /// + public static class HTTPManager + { + // Static constructor. Setup default values + static HTTPManager() + { + MaxConnectionPerServer = 4; + KeepAliveDefaultValue = true; + MaxPathLength = 255; + MaxConnectionIdleTime = TimeSpan.FromSeconds(20); + +#if !BESTHTTP_DISABLE_COOKIES +#if UNITY_WEBGL + // Under webgl when IsCookiesEnabled is true, it will set the withCredentials flag for the XmlHTTPRequest + // and that's different from the default behavior. + // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials + IsCookiesEnabled = false; +#else + IsCookiesEnabled = true; +#endif +#endif + + CookieJarSize = 10 * 1024 * 1024; + EnablePrivateBrowsing = false; + ConnectTimeout = TimeSpan.FromSeconds(20); + RequestTimeout = TimeSpan.FromSeconds(60); + + // Set the default logger mechanism + logger = new BestHTTP.Logger.DefaultLogger(); + +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + DefaultCertificateVerifyer = null; + UseAlternateSSLDefaultValue = true; +#endif + +#if NETFX_CORE + IOService = new PlatformSupport.FileSystem.NETFXCOREIOService(); +#elif UNITY_WEBGL && !UNITY_EDITOR + IOService = new PlatformSupport.FileSystem.WebGLIOService(); +#else + IOService = new PlatformSupport.FileSystem.DefaultIOService(); +#endif + + } + + #region Global Options + + /// + /// The maximum active TCP connections that the client will maintain to a server. Default value is 4. Minimum value is 1. + /// + public static byte MaxConnectionPerServer + { + get{ return maxConnectionPerServer; } + set + { + if (value <= 0) + throw new ArgumentOutOfRangeException("MaxConnectionPerServer must be greater than 0!"); + maxConnectionPerServer = value; + } + } + private static byte maxConnectionPerServer; + + /// + /// Default value of a HTTP request's IsKeepAlive value. Default value is true. If you make rare request to the server it should be changed to false. + /// + public static bool KeepAliveDefaultValue { get; set; } + +#if !BESTHTTP_DISABLE_CACHING + /// + /// Set to true, if caching is prohibited. + /// + public static bool IsCachingDisabled { get; set; } +#endif + + /// + /// How many time must be passed to destroy that connection after a connection finished its last request. Its default value is 20 seconds. + /// + public static TimeSpan MaxConnectionIdleTime { get; set; } + +#if !BESTHTTP_DISABLE_COOKIES + /// + /// Set to false to disable all Cookie. It's default value is true. + /// + public static bool IsCookiesEnabled { get; set; } +#endif + + /// + /// Size of the Cookie Jar in bytes. It's default value is 10485760 (10 MB). + /// + public static uint CookieJarSize { get; set; } + + /// + /// If this property is set to true, then new cookies treated as session cookies and these cookies are not saved to disk. Its default value is false; + /// + public static bool EnablePrivateBrowsing { get; set; } + + /// + /// Global, default value of the HTTPRequest's ConnectTimeout property. If set to TimeSpan.Zero or lower, no connect timeout logic is executed. Default value is 20 seconds. + /// + public static TimeSpan ConnectTimeout { get; set; } + + /// + /// Global, default value of the HTTPRequest's Timeout property. Default value is 60 seconds. + /// + public static TimeSpan RequestTimeout { get; set; } + +#if !(BESTHTTP_DISABLE_CACHING && BESTHTTP_DISABLE_COOKIES) + /// + /// By default the plugin will save all cache and cookie data under the path returned by Application.persistentDataPath. + /// You can assign a function to this delegate to return a custom root path to define a new path. + /// This delegate will be called on a non Unity thread! + /// + public static System.Func RootCacheFolderProvider { get; set; } +#endif + +#if !BESTHTTP_DISABLE_PROXY + /// + /// The global, default proxy for all HTTPRequests. The HTTPRequest's Proxy still can be changed per-request. Default value is null. + /// + public static Proxy Proxy { get; set; } +#endif + + /// + /// Heartbeat manager to use less threads in the plugin. The heartbeat updates are called from the OnUpdate function. + /// + public static HeartbeatManager Heartbeats + { + get + { + if (heartbeats == null) + heartbeats = new HeartbeatManager(); + return heartbeats; + } + } + private static HeartbeatManager heartbeats; + + /// + /// A basic BestHTTP.Logger.ILogger implementation to be able to log intelligently additional informations about the plugin's internal mechanism. + /// + public static BestHTTP.Logger.ILogger Logger + { + get + { + // Make sure that it has a valid logger instance. + if (logger == null) + { + logger = new DefaultLogger(); + logger.Level = Loglevels.None; + } + + return logger; + } + + set { logger = value; } + } + private static BestHTTP.Logger.ILogger logger; + +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + /// + /// The default ICertificateVerifyer implementation that the plugin will use when the request's UseAlternateSSL property is set to true. + /// + public static Org.BouncyCastle.Crypto.Tls.ICertificateVerifyer DefaultCertificateVerifyer { get; set; } + + /// + /// The default IClientCredentialsProvider implementation that the plugin will use when the request's UseAlternateSSL property is set to true. + /// + public static Org.BouncyCastle.Crypto.Tls.IClientCredentialsProvider DefaultClientCredentialsProvider { get; set; } + + /// + /// The default value for the HTTPRequest's UseAlternateSSL property. + /// + public static bool UseAlternateSSLDefaultValue { get; set; } +#endif + +#if !NETFX_CORE + public static Func DefaultCertificationValidator { get; set; } +#endif + + /// + /// Setting this option to true, the processing connection will set the TCP NoDelay option to send out data as soon as it can. + /// + public static bool TryToMinimizeTCPLatency = false; + + public static int SendBufferSize = 65 * 1024; + public static int ReceiveBufferSize = 65 * 1024; + + /// + /// An IIOService implementation to handle filesystem operations. + /// + public static PlatformSupport.FileSystem.IIOService IOService; + + /// + /// On most systems the maximum length of a path is around 255 character. If a cache entity's path is longer than this value it doesn't get cached. There no platform independent API to query the exact value on the current system, but it's + /// exposed here and can be overridden. It's default value is 255. + /// + internal static int MaxPathLength { get; set; } + + #endregion + + #region Manager variables + + /// + /// All connection has a reference in this Dictionary until it's removed completely. + /// + private static Dictionary> Connections = new Dictionary>(); + + /// + /// Active connections. These connections all has a request to process. + /// + private static List ActiveConnections = new List(); + + /// + /// Free connections. They can be removed completely after a specified time. + /// + private static List FreeConnections = new List(); + + /// + /// Connections that recycled in the Update loop. If they are not used in the same loop to process a request, they will be transferred to the FreeConnections list. + /// + private static List RecycledConnections = new List(); + + /// + /// List of request that have to wait until there is a free connection to the server. + /// + private static List RequestQueue = new List(); + private static bool IsCallingCallbacks; + + internal static System.Object Locker = new System.Object(); + + internal static bool IsQuitting { get; private set; } + + #endregion + + #region Public Interface + + public static void Setup() + { + HTTPUpdateDelegator.CheckInstance(); + +#if !BESTHTTP_DISABLE_CACHING + HTTPCacheService.CheckSetup(); +#endif + +#if !BESTHTTP_DISABLE_COOKIES + Cookies.CookieJar.SetupFolder(); +#endif + } + + public static HTTPRequest SendRequest(string url, OnRequestFinishedDelegate callback) + { + return SendRequest(new HTTPRequest(new Uri(url), HTTPMethods.Get, callback)); + } + + public static HTTPRequest SendRequest(string url, HTTPMethods methodType, OnRequestFinishedDelegate callback) + { + return SendRequest(new HTTPRequest(new Uri(url), methodType, callback)); + } + + public static HTTPRequest SendRequest(string url, HTTPMethods methodType, bool isKeepAlive, OnRequestFinishedDelegate callback) + { + return SendRequest(new HTTPRequest(new Uri(url), methodType, isKeepAlive, callback)); + } + + public static HTTPRequest SendRequest(string url, HTTPMethods methodType, bool isKeepAlive, bool disableCache, OnRequestFinishedDelegate callback) + { + return SendRequest(new HTTPRequest(new Uri(url), methodType, isKeepAlive, disableCache, callback)); + } + + public static HTTPRequest SendRequest(HTTPRequest request) + { + lock (Locker) + { + Setup(); + + if (IsCallingCallbacks) + { + request.State = HTTPRequestStates.Queued; + RequestQueue.Add(request); + } + else + SendRequestImpl(request); + + return request; + } + } + + public static GeneralStatistics GetGeneralStatistics(StatisticsQueryFlags queryFlags) + { + GeneralStatistics stat = new GeneralStatistics(); + + stat.QueryFlags = queryFlags; + + if ((queryFlags & StatisticsQueryFlags.Connections) != 0) + { + int connections = 0; + foreach(var conn in HTTPManager.Connections) + { + if (conn.Value != null) + connections += conn.Value.Count; + } + +#if !BESTHTTP_DISABLE_WEBSOCKET && UNITY_WEBGL && !UNITY_EDITOR + connections += WebSocket.WebSocket.WebSockets.Count; +#endif + + stat.Connections = connections; + stat.ActiveConnections = ActiveConnections.Count +#if !BESTHTTP_DISABLE_WEBSOCKET && UNITY_WEBGL && !UNITY_EDITOR + + WebSocket.WebSocket.WebSockets.Count +#endif + ; + stat.FreeConnections = FreeConnections.Count; + stat.RecycledConnections = RecycledConnections.Count; + stat.RequestsInQueue = RequestQueue.Count; + } + +#if !BESTHTTP_DISABLE_CACHING + if ((queryFlags & StatisticsQueryFlags.Cache) != 0) + { + stat.CacheEntityCount = HTTPCacheService.GetCacheEntityCount(); + stat.CacheSize = HTTPCacheService.GetCacheSize(); + } +#endif + +#if !BESTHTTP_DISABLE_COOKIES + if ((queryFlags & StatisticsQueryFlags.Cookies) != 0) + { + List cookies = Cookies.CookieJar.GetAll(); + stat.CookieCount = cookies.Count; + uint cookiesSize = 0; + for (int i = 0; i < cookies.Count; ++i) + cookiesSize += cookies[i].GuessSize(); + stat.CookieJarSize = cookiesSize; + } +#endif + + return stat; + } + + #endregion + + #region Private Functions + + private static void SendRequestImpl(HTTPRequest request) + { + ConnectionBase conn = FindOrCreateFreeConnection(request); + + if (conn != null) + { + // found a free connection: put it in the ActiveConnection list(they will be checked periodically in the OnUpdate call) + if (ActiveConnections.Find((c) => c == conn) == null) + ActiveConnections.Add(conn); + + FreeConnections.Remove(conn); + + request.State = HTTPRequestStates.Processing; + + request.Prepare(); + + // then start process the request + conn.Process(request); + } + else + { + // If no free connection found and creation prohibited, we will put back to the queue + request.State = HTTPRequestStates.Queued; + RequestQueue.Add(request); + } + } + + private static string GetKeyForRequest(HTTPRequest request) + { + if (request.CurrentUri.IsFile) + return request.CurrentUri.ToString(); + + // proxyUri + requestUri + // HTTP and HTTPS needs different connections. + return +#if !BESTHTTP_DISABLE_PROXY + (request.Proxy != null ? new UriBuilder(request.Proxy.Address.Scheme, request.Proxy.Address.Host, request.Proxy.Address.Port).Uri.ToString() : string.Empty) + +#endif + new UriBuilder(request.CurrentUri.Scheme, request.CurrentUri.Host, request.CurrentUri.Port).Uri.ToString(); + } + + /// + /// Factory method to create a concrete connection object. + /// + private static ConnectionBase CreateConnection(HTTPRequest request, string serverUrl) + { + if (request.CurrentUri.IsFile && UnityEngine.Application.platform != UnityEngine.RuntimePlatform.WebGLPlayer) + return new FileConnection(serverUrl); + +#if UNITY_WEBGL && !UNITY_EDITOR + return new WebGLConnection(serverUrl); +#else + return new HTTPConnection(serverUrl); +#endif + } + + private static ConnectionBase FindOrCreateFreeConnection(HTTPRequest request) + { + ConnectionBase conn = null; + List connections; + + string serverUrl = GetKeyForRequest(request); + + if (Connections.TryGetValue(serverUrl, out connections)) + { + // count active connections + + int activeConnections = 0; + for (int i = 0; i < connections.Count; ++i) + if (connections[i].IsActive) + activeConnections++; + + if (activeConnections <= MaxConnectionPerServer) + // search for a Free connection + for (int i = 0; i < connections.Count && conn == null; ++i) + { + var tmpConn = connections[i]; + + if (tmpConn != null && + tmpConn.IsFree && + ( +#if !BESTHTTP_DISABLE_PROXY + !tmpConn.HasProxy || +#endif + tmpConn.LastProcessedUri == null || + tmpConn.LastProcessedUri.Host.Equals(request.CurrentUri.Host, StringComparison.OrdinalIgnoreCase))) + conn = tmpConn; + } + } + else + Connections.Add(serverUrl, connections = new List(MaxConnectionPerServer)); + + // No free connection found? + if (conn == null) + { + // Max connection reached? + if (connections.Count >= MaxConnectionPerServer) + return null; + + // if no, create a new one + connections.Add(conn = CreateConnection(request, serverUrl)); + } + + return conn; + } + + /// + /// Will return with true when there at least one request that can be processed from the RequestQueue. + /// + private static bool CanProcessFromQueue() + { + for (int i = 0; i < RequestQueue.Count; ++i) + if (FindOrCreateFreeConnection(RequestQueue[i]) != null) + return true; + + return false; + } + + private static void RecycleConnection(ConnectionBase conn) + { + conn.Recycle(OnConnectionRecylced); + } + + private static void OnConnectionRecylced(ConnectionBase conn) + { + lock (RecycledConnections) + { + RecycledConnections.Add(conn); + } + } + + #endregion + + #region Internal Helper Functions + + /// + /// Will return the ConnectionBase object that processing the given request. + /// + internal static ConnectionBase GetConnectionWith(HTTPRequest request) + { + lock (Locker) + { + for (int i = 0; i < ActiveConnections.Count; ++i) + { + var connection = ActiveConnections[i]; + if (connection.CurrentRequest == request) + return connection; + } + + return null; + } + } + + internal static bool RemoveFromQueue(HTTPRequest request) + { + return RequestQueue.Remove(request); + } + +#if !(BESTHTTP_DISABLE_CACHING && BESTHTTP_DISABLE_COOKIES) + /// + /// Will return where the various caches should be saved. + /// + internal static string GetRootCacheFolder() + { + try + { + if (RootCacheFolderProvider != null) + return RootCacheFolderProvider(); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("HTTPManager", "GetRootCacheFolder", ex); + } + +#if NETFX_CORE + return Windows.Storage.ApplicationData.Current.LocalFolder.Path; +#else + return UnityEngine.Application.persistentDataPath; +#endif + } +#endif + + #endregion + + #region MonoBehaviour Events (Called from HTTPUpdateDelegator) + + /// + /// Update function that should be called regularly from a Unity event(Update, LateUpdate). Callbacks are dispatched from this function. + /// + public static void OnUpdate() + { + // We will try to acquire a lock. If it fails, we will skip this frame without calling any callback. + if (System.Threading.Monitor.TryEnter(Locker)) + { + try + { + IsCallingCallbacks = true; + try + { + for (int i = 0; i < ActiveConnections.Count; ++i) + { + ConnectionBase conn = ActiveConnections[i]; + + switch (conn.State) + { + case HTTPConnectionStates.Processing: + conn.HandleProgressCallback(); + + if (conn.CurrentRequest.UseStreaming && conn.CurrentRequest.Response != null && conn.CurrentRequest.Response.HasStreamedFragments()) + conn.HandleCallback(); + + try + { + if (((!conn.CurrentRequest.UseStreaming && conn.CurrentRequest.UploadStream == null) || conn.CurrentRequest.EnableTimoutForStreaming) && + DateTime.UtcNow - conn.StartTime > conn.CurrentRequest.Timeout) + conn.Abort(HTTPConnectionStates.TimedOut); + } + catch (OverflowException) + { + HTTPManager.Logger.Warning("HTTPManager", "TimeSpan overflow"); + } + break; + + case HTTPConnectionStates.TimedOut: + // The connection is still in TimedOut state, and if we waited enough time, we will dispatch the + // callback and recycle the connection + try + { + if (DateTime.UtcNow - conn.TimedOutStart > TimeSpan.FromMilliseconds(500)) + { + HTTPManager.Logger.Information("HTTPManager", "Hard aborting connection because of a long waiting TimedOut state"); + + conn.CurrentRequest.Response = null; + conn.CurrentRequest.State = HTTPRequestStates.TimedOut; + conn.HandleCallback(); + + // this will set the connection's CurrentRequest to null + RecycleConnection(conn); + } + } + catch(OverflowException) + { + HTTPManager.Logger.Warning("HTTPManager", "TimeSpan overflow"); + } + break; + + case HTTPConnectionStates.Redirected: + // If the server redirected us, we need to find or create a connection to the new server and send out the request again. + SendRequest(conn.CurrentRequest); + + RecycleConnection(conn); + break; + + case HTTPConnectionStates.WaitForRecycle: + // If it's a streamed request, it's finished now + conn.CurrentRequest.FinishStreaming(); + + // Call the callback + conn.HandleCallback(); + + // Then recycle the connection + RecycleConnection(conn); + break; + + case HTTPConnectionStates.Upgraded: + // The connection upgraded to an other protocol + conn.HandleCallback(); + break; + + case HTTPConnectionStates.WaitForProtocolShutdown: + var ws = conn.CurrentRequest.Response as IProtocol; + if (ws != null) + ws.HandleEvents(); + + if (ws == null || ws.IsClosed) + { + conn.HandleCallback(); + + // After both sending and receiving a Close message, an endpoint considers the WebSocket connection closed and MUST close the underlying TCP connection. + conn.Dispose(); + RecycleConnection(conn); + } + break; + + case HTTPConnectionStates.AbortRequested: + // Corner case: we aborted a WebSocket connection + { + ws = conn.CurrentRequest.Response as IProtocol; + if (ws != null) + { + ws.HandleEvents(); + + if (ws.IsClosed) + { + conn.HandleCallback(); + conn.Dispose(); + + RecycleConnection(conn); + } + } + } + break; + + case HTTPConnectionStates.Closed: + // If it's a streamed request, it's finished now + conn.CurrentRequest.FinishStreaming(); + + // Call the callback + conn.HandleCallback(); + + // It will remove from the ActiveConnections + RecycleConnection(conn); + break; + + case HTTPConnectionStates.Free: + RecycleConnection(conn); + break; + } + } + } + finally + { + IsCallingCallbacks = false; + } + + // Just try to grab the lock, if we can't have it we can wait another turn because it isn't + // critical to do it right now. + if (System.Threading.Monitor.TryEnter(RecycledConnections)) + try + { + if (RecycledConnections.Count > 0) + { + for (int i = 0; i < RecycledConnections.Count; ++i) + { + var connection = RecycledConnections[i]; + // If in a callback made a request that acquired this connection, then we will not remove it from the + // active connections. + if (connection.IsFree) + { + ActiveConnections.Remove(connection); + FreeConnections.Add(connection); + } + } + RecycledConnections.Clear(); + } + } + finally + { + System.Threading.Monitor.Exit(RecycledConnections); + } + + if (FreeConnections.Count > 0) + for (int i = 0; i < FreeConnections.Count; i++) + { + var connection = FreeConnections[i]; + + if (connection.IsRemovable) + { + // Remove the connection from the connection reference table + List connections = null; + if (Connections.TryGetValue(connection.ServerAddress, out connections)) + connections.Remove(connection); + + // Dispose the connection + connection.Dispose(); + + FreeConnections.RemoveAt(i); + i--; + } + } + + + if (CanProcessFromQueue()) + { + // Sort the queue by priority, only if we have to + if (RequestQueue.Find((req) => req.Priority != 0) != null) + RequestQueue.Sort((req1, req2) => req1.Priority - req2.Priority); + + // Create an array from the queue and clear it. When we call the SendRequest while still no room for new connections, the same queue will be rebuilt. + + var queue = RequestQueue.ToArray(); + RequestQueue.Clear(); + + for (int i = 0; i < queue.Length; ++i) + SendRequest(queue[i]); + } + } + finally + { + System.Threading.Monitor.Exit(Locker); + } + } + + if (heartbeats != null) + heartbeats.Update(); + + VariableSizedBufferPool.Maintain(); + } + + public static void OnQuit() + { + lock (Locker) + { + IsQuitting = true; + +#if !BESTHTTP_DISABLE_CACHING + Caching.HTTPCacheService.SaveLibrary(); +#endif + +#if !BESTHTTP_DISABLE_COOKIES + Cookies.CookieJar.Persist(); +#endif + + AbortAll(true); + + OnUpdate(); + } + } + + public static void AbortAll(bool allowCallbacks = false) + { + lock (Locker) + { + var queue = RequestQueue.ToArray(); + RequestQueue.Clear(); + foreach (var req in queue) + { + // Swallow any exceptions, we are quitting anyway. + try + { + if (!allowCallbacks) + req.Callback = null; + req.Abort(); + } + catch { } + } + + // Close all TCP connections when the application is terminating. + foreach (var kvp in Connections) + { + foreach (var conn in kvp.Value) + { + // Swallow any exceptions, we are quitting anyway. + try + { + if (conn.CurrentRequest != null) + { + if (!allowCallbacks) + conn.CurrentRequest.Callback = null; + conn.CurrentRequest.State = HTTPRequestStates.Aborted; + } + conn.Abort(HTTPConnectionStates.Closed); + conn.Dispose(); + } + catch { } + } + kvp.Value.Clear(); + } + Connections.Clear(); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPManager.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPManager.cs.meta new file mode 100644 index 00000000..22e9749d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPManager.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 8598bf6546f50e64197d043a215a5897 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPMethods.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPMethods.cs new file mode 100644 index 00000000..8a4a48d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPMethods.cs @@ -0,0 +1,76 @@ +namespace BestHTTP +{ + /// + /// Some supported methods described in the rfc: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 + /// + public enum HTTPMethods : byte + { + /// + /// The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. + /// If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the + /// entity in the response and not the source text of the process, unless that text happens to be the output of the process. + /// + Get, + + /// + /// The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. + /// The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. + /// This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. + /// This method is often used for testing hypertext links for validity, accessibility, and recent modification. + /// + Head, + + /// + /// The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. + /// POST is designed to allow a uniform method to cover the following functions: + /// + /// Annotation of existing resources; + /// Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; + /// Providing a block of data, such as the result of submitting a form, to a data-handling process; + /// Extending a database through an append operation. + /// + /// The actual function performed by the POST method is determined by the server and is usually dependent on the Request-URI. + /// The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory containing it, + /// a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a database. + /// The action performed by the POST method might not result in a resource that can be identified by a URI. In this case, + /// either 200 (OK) or 204 (No Content) is the appropriate response status, depending on whether or not the response includes an entity that describes the result. + /// + Post, + + /// + /// The PUT method requests that the enclosed entity be stored under the supplied Request-URI. + /// If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. + /// If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, + /// the origin server can create the resource with that URI. If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response. + /// If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate successful completion of the request. + /// If the resource could not be created or modified with the Request-URI, an appropriate error response SHOULD be given that reflects the nature of the problem. + /// The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a 501 (Not Implemented) response in such cases. + /// + Put, + + /// + /// The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY be overridden by human intervention (or other means) on the origin server. + /// The client cannot be guaranteed that the operation has been carried out, even if the status code returned from the origin server indicates that the action has been completed successfully. + /// However, the server SHOULD NOT indicate success unless, at the time the response is given, it intends to delete the resource or move it to an inaccessible location. + /// A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) + /// if the action has been enacted but the response does not include an entity. + /// + Delete, + + /// + /// http://tools.ietf.org/html/rfc5789 + /// The PATCH method requests that a set of changes described in the request entity be applied to the resource identified by the Request-URI. + /// The set of changes is represented in a format called a "patchdocument" identified by a media type. If the Request-URI does not point to an existing resource, + /// the server MAY create a new resource, depending on the patch document type (whether it can logically modify a null resource) and permissions, etc. + /// + Patch, + + /// + /// The HTTP methods PATCH can be used to update partial resources. For instance, when you only need to update one field of the resource, PUTting a complete resource representation might be cumbersome and utilizes more bandwidth. + /// + /// + Merge, + + Options + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPMethods.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPMethods.cs.meta new file mode 100644 index 00000000..d60a3c2a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPMethods.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: faf468f5056a1614da3acf7f571cc6bb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProtocolFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProtocolFactory.cs new file mode 100644 index 00000000..822f0e65 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProtocolFactory.cs @@ -0,0 +1,77 @@ +using System; +using System.IO; + +namespace BestHTTP +{ + public enum SupportedProtocols + { + Unknown, + HTTP, + +#if !BESTHTTP_DISABLE_WEBSOCKET + WebSocket, +#endif + +#if !BESTHTTP_DISABLE_SERVERSENT_EVENTS + ServerSentEvents +#endif + } + + public static class HTTPProtocolFactory + { + public static HTTPResponse Get(SupportedProtocols protocol, HTTPRequest request, Stream stream, bool isStreamed, bool isFromCache) + { + switch (protocol) + { +#if !BESTHTTP_DISABLE_WEBSOCKET && (!UNITY_WEBGL || UNITY_EDITOR) + case SupportedProtocols.WebSocket: return new WebSocket.WebSocketResponse(request, stream, isStreamed, isFromCache); +#endif + +#if !BESTHTTP_DISABLE_SERVERSENT_EVENTS && (!UNITY_WEBGL || UNITY_EDITOR) + case SupportedProtocols.ServerSentEvents: return new ServerSentEvents.EventSourceResponse(request, stream, isStreamed, isFromCache); +#endif + default: return new HTTPResponse(request, new Extensions.ReadOnlyBufferedStream(stream), isStreamed, isFromCache); + } + } + + public static SupportedProtocols GetProtocolFromUri(Uri uri) + { + if (uri == null || uri.Scheme == null) + throw new Exception("Malformed URI in GetProtocolFromUri"); + + string scheme = uri.Scheme.ToLowerInvariant(); + switch (scheme) + { +#if !BESTHTTP_DISABLE_WEBSOCKET + case "ws": + case "wss": + return SupportedProtocols.WebSocket; +#endif + + default: + return SupportedProtocols.HTTP; + } + } + + public static bool IsSecureProtocol(Uri uri) + { + if (uri == null || uri.Scheme == null) + throw new Exception("Malformed URI in IsSecureProtocol"); + + string scheme = uri.Scheme.ToLowerInvariant(); + switch (scheme) + { + // http + case "https": + +#if !BESTHTTP_DISABLE_WEBSOCKET + // WebSocket + case "wss": +#endif + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProtocolFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProtocolFactory.cs.meta new file mode 100644 index 00000000..96dfe0b3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProtocolFactory.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 42fc2aaed5d783a48b2d61c1d7db8f23 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProxy.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProxy.cs new file mode 100644 index 00000000..382ea03d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProxy.cs @@ -0,0 +1,192 @@ +#if !BESTHTTP_DISABLE_PROXY + +using System; +using System.IO; +using System.Text; +using BestHTTP.Authentication; +using BestHTTP.Extensions; + +namespace BestHTTP +{ + public abstract class Proxy + { + /// + /// Address of the proxy server. It has to be in the http://proxyaddress:port form. + /// + public Uri Address { get; set; } + + /// + /// Credentials of the proxy + /// + public Credentials Credentials { get; set; } + + internal Proxy(Uri address, Credentials credentials) + { + this.Address = address; + this.Credentials = credentials; + } + + internal abstract void Connect(Stream stream, HTTPRequest request); + internal abstract string GetRequestPath(Uri uri); + } + + public sealed class HTTPProxy : Proxy + { + /// + /// True if the proxy can act as a transparent proxy + /// + public bool IsTransparent { get; set; } + + /// + /// Some non-transparent proxies are except only the path and query of the request uri. Default value is true + /// + public bool SendWholeUri { get; set; } + + /// + /// Regardless of the value of IsTransparent, for secure protocols(HTTPS://, WSS://) the plugin will use the proxy as an explicit proxy(will issue a CONNECT request to the proxy) + /// + public bool NonTransparentForHTTPS { get; set; } + + public HTTPProxy(Uri address) + :this(address, null, false) + {} + + public HTTPProxy(Uri address, Credentials credentials) + :this(address, credentials, false) + {} + + public HTTPProxy(Uri address, Credentials credentials, bool isTransparent) + :this(address, credentials, isTransparent, true) + { } + + public HTTPProxy(Uri address, Credentials credentials, bool isTransparent, bool sendWholeUri) + : this(address, credentials, isTransparent, sendWholeUri, true) + { } + + public HTTPProxy(Uri address, Credentials credentials, bool isTransparent, bool sendWholeUri, bool nonTransparentForHTTPS) + :base(address, credentials) + { + this.IsTransparent = isTransparent; + this.SendWholeUri = sendWholeUri; + this.NonTransparentForHTTPS = nonTransparentForHTTPS; + } + + internal override string GetRequestPath(Uri uri) + { + return this.SendWholeUri ? uri.OriginalString : uri.GetRequestPathAndQueryURL(); + } + + internal override void Connect(Stream stream, HTTPRequest request) + { + bool isSecure = HTTPProtocolFactory.IsSecureProtocol(request.CurrentUri); + + if ((!this.IsTransparent || (isSecure && this.NonTransparentForHTTPS))) + { + using (var bufferedStream = new WriteOnlyBufferedStream(stream, HTTPRequest.UploadChunkSize)) + using (var outStream = new BinaryWriter(bufferedStream, Encoding.UTF8)) + { + bool retry; + do + { + // If we have to because of a authentication request, we will switch it to true + retry = false; + + string connectStr = string.Format("CONNECT {0}:{1} HTTP/1.1", request.CurrentUri.Host, request.CurrentUri.Port.ToString()); + + HTTPManager.Logger.Information("HTTPConnection", "Sending " + connectStr); + + outStream.SendAsASCII(connectStr); + outStream.Write(HTTPRequest.EOL); + + outStream.SendAsASCII("Proxy-Connection: Keep-Alive"); + outStream.Write(HTTPRequest.EOL); + + outStream.SendAsASCII("Connection: Keep-Alive"); + outStream.Write(HTTPRequest.EOL); + + outStream.SendAsASCII(string.Format("Host: {0}:{1}", request.CurrentUri.Host, request.CurrentUri.Port.ToString())); + outStream.Write(HTTPRequest.EOL); + + // Proxy Authentication + if (this.Credentials != null) + { + switch (this.Credentials.Type) + { + case AuthenticationTypes.Basic: + // With Basic authentication we don't want to wait for a challenge, we will send the hash with the first request + outStream.Write(string.Format("Proxy-Authorization: {0}", string.Concat("Basic ", Convert.ToBase64String(Encoding.UTF8.GetBytes(this.Credentials.UserName + ":" + this.Credentials.Password)))).GetASCIIBytes()); + outStream.Write(HTTPRequest.EOL); + break; + + case AuthenticationTypes.Unknown: + case AuthenticationTypes.Digest: + var digest = DigestStore.Get(this.Address); + if (digest != null) + { + string authentication = digest.GenerateResponseHeader(request, this.Credentials, true); + if (!string.IsNullOrEmpty(authentication)) + { + string auth = string.Format("Proxy-Authorization: {0}", authentication); + if (HTTPManager.Logger.Level <= Logger.Loglevels.Information) + HTTPManager.Logger.Information("HTTPConnection", "Sending proxy authorization header: " + auth); + + var bytes = auth.GetASCIIBytes(); + outStream.Write(bytes); + outStream.Write(HTTPRequest.EOL); + VariableSizedBufferPool.Release(bytes); + } + } + + break; + } + } + + outStream.Write(HTTPRequest.EOL); + + // Make sure to send all the wrote data to the wire + outStream.Flush(); + + request.ProxyResponse = new HTTPResponse(request, stream, false, false); + + // Read back the response of the proxy + if (!request.ProxyResponse.Receive(-1, true)) + throw new Exception("Connection to the Proxy Server failed!"); + + if (HTTPManager.Logger.Level <= Logger.Loglevels.Information) + HTTPManager.Logger.Information("HTTPConnection", "Proxy returned - status code: " + request.ProxyResponse.StatusCode + " message: " + request.ProxyResponse.Message + " Body: " + request.ProxyResponse.DataAsText); + + switch (request.ProxyResponse.StatusCode) + { + // Proxy authentication required + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.8 + case 407: + { + string authHeader = DigestStore.FindBest(request.ProxyResponse.GetHeaderValues("proxy-authenticate")); + if (!string.IsNullOrEmpty(authHeader)) + { + var digest = DigestStore.GetOrCreate(this.Address); + digest.ParseChallange(authHeader); + + if (this.Credentials != null && digest.IsUriProtected(this.Address) && (!request.HasHeader("Proxy-Authorization") || digest.Stale)) + retry = true; + } + + if (!retry) + throw new Exception(string.Format("Can't authenticate Proxy! Status Code: \"{0}\", Message: \"{1}\" and Response: {2}", request.ProxyResponse.StatusCode, request.ProxyResponse.Message, request.ProxyResponse.DataAsText)); + break; + } + + default: + if (!request.ProxyResponse.IsSuccess) + throw new Exception(string.Format("Proxy returned Status Code: \"{0}\", Message: \"{1}\" and Response: {2}", request.ProxyResponse.StatusCode, request.ProxyResponse.Message, request.ProxyResponse.DataAsText)); + break; + } + + } while (retry); + } // using outstream + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProxy.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProxy.cs.meta new file mode 100644 index 00000000..632889ca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPProxy.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9e3868a6f38c2cc42bbb8c562caba79a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRange.cs new file mode 100644 index 00000000..aa032496 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRange.cs @@ -0,0 +1,57 @@ +using System; + +namespace BestHTTP +{ + /// + /// + /// + public sealed class HTTPRange + { + /// + /// The first byte's position that the server sent. + /// + public int FirstBytePos { get; private set; } + + /// + /// The last byte's position that the server sent. + /// + public int LastBytePos { get; private set; } + + /// + /// Indicates the total length of the full entity-body on the server, -1 if this length is unknown or difficult to determine. + /// + public int ContentLength { get; private set; } + + /// + /// + /// + public bool IsValid { get; private set; } + + internal HTTPRange() + { + this.ContentLength = -1; + this.IsValid = false; + } + + internal HTTPRange(int contentLength) + { + this.ContentLength = contentLength; + this.IsValid = false; + } + + internal HTTPRange(int firstBytePosition, int lastBytePosition, int contentLength) + { + this.FirstBytePos = firstBytePosition; + this.LastBytePos = lastBytePosition; + this.ContentLength = contentLength; + + // A byte-content-range-spec with a byte-range-resp-spec whose last-byte-pos value is less than its first-byte-pos value, or whose instance-length value is less than or equal to its last-byte-pos value, is invalid. + this.IsValid = this.FirstBytePos <= this.LastBytePos && this.ContentLength > this.LastBytePos; + } + + public override string ToString() + { + return string.Format("{0}-{1}/{2} (valid: {3})", FirstBytePos, LastBytePos, ContentLength, IsValid); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRange.cs.meta new file mode 100644 index 00000000..b9bf1e94 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRange.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 874904f9618b97045b510c161f498030 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRequest.cs new file mode 100644 index 00000000..4b4617d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRequest.cs @@ -0,0 +1,1453 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace BestHTTP +{ + using BestHTTP.Authentication; + using BestHTTP.Extensions; + using BestHTTP.Forms; + + #if !BESTHTTP_DISABLE_COOKIES + using BestHTTP.Cookies; + #endif + + /// + /// Possible logical states of a HTTTPRequest object. + /// + public enum HTTPRequestStates + { + /// + /// Initial status of a request. No callback will be called with this status. + /// + Initial, + + /// + /// Waiting in a queue to be processed. No callback will be called with this status. + /// + Queued, + + /// + /// Processing of the request started. In this state the client will send the request, and parse the response. No callback will be called with this status. + /// + Processing, + + /// + /// The request finished without problem. Parsing the response done, the result can be used. The user defined callback will be called with a valid response object. The request’s Exception property will be null. + /// + Finished, + + /// + /// The request finished with an unexpected error. The user defined callback will be called with a null response object. The request's Exception property may contain more info about the error, but it can be null. + /// + Error, + + /// + /// The request aborted by the client(HTTPRequest’s Abort() function). The user defined callback will be called with a null response. The request’s Exception property will be null. + /// + Aborted, + + /// + /// Connecting to the server timed out. The user defined callback will be called with a null response. The request’s Exception property will be null. + /// + ConnectionTimedOut, + + /// + /// The request didn't finished in the given time. The user defined callback will be called with a null response. The request’s Exception property will be null. + /// + TimedOut + } + + public delegate void OnRequestFinishedDelegate(HTTPRequest originalRequest, HTTPResponse response); + public delegate void OnDownloadProgressDelegate(HTTPRequest originalRequest, long downloaded, long downloadLength); + public delegate void OnUploadProgressDelegate(HTTPRequest originalRequest, long uploaded, long uploadLength); + public delegate bool OnBeforeRedirectionDelegate(HTTPRequest originalRequest, HTTPResponse response, Uri redirectUri); + public delegate void OnHeaderEnumerationDelegate(string header, List values); + public delegate void OnBeforeHeaderSendDelegate(HTTPRequest req); + + /// + /// + /// + public sealed class HTTPRequest : IEnumerator, IEnumerator + { + #region Statics + + public static readonly byte[] EOL = { HTTPResponse.CR, HTTPResponse.LF }; + + /// + /// Cached uppercase values to save some cpu cycles and GC alloc per request. + /// + public static readonly string[] MethodNames = { + HTTPMethods.Get.ToString().ToUpper(), + HTTPMethods.Head.ToString().ToUpper(), + HTTPMethods.Post.ToString().ToUpper(), + HTTPMethods.Put.ToString().ToUpper(), + HTTPMethods.Delete.ToString().ToUpper(), + HTTPMethods.Patch.ToString().ToUpper(), + HTTPMethods.Merge.ToString().ToUpper(), + HTTPMethods.Options.ToString().ToUpper() + }; + + /// + /// Size of the internal buffer, and upload progress will be fired when this size of data sent to the wire. It's default value is 2 KiB. + /// + public static int UploadChunkSize = 2 * 1024; + + #endregion + + #region Properties + + /// + /// The original request's Uri. + /// + public Uri Uri { get; set; } + + /// + /// The method that how we want to process our request the server. + /// + public HTTPMethods MethodType { get; set; } + + /// + /// The raw data to send in a POST request. If it set all other fields that added to this request will be ignored. + /// + public byte[] RawData { get; set; } + + /// + /// The stream that the plugin will use to get the data to send out the server. When this property is set, no forms or the RawData property will be used + /// + public Stream UploadStream { get; set; } + + /// + /// When set to true(its default value) the plugin will call the UploadStream's Dispose() function when finished uploading the data from it. Default value is true. + /// + public bool DisposeUploadStream { get; set; } + + /// + /// If it's true, the plugin will use the Stream's Length property. Otherwise the plugin will send the data chunked. Default value is true. + /// + public bool UseUploadStreamLength { get; set; } + + /// + /// Called after data sent out to the wire. + /// + public OnUploadProgressDelegate OnUploadProgress; + + /// + /// Indicates that the connection should be open after the response received. If its true, then the internal TCP connections will be reused if it's possible. Default value is true. + /// The default value can be changed in the HTTPManager class. If you make rare request to the server it's should be changed to false. + /// + public bool IsKeepAlive + { + get { return isKeepAlive; } + set + { + if (State == HTTPRequestStates.Processing) + throw new NotSupportedException("Changing the IsKeepAlive property while processing the request is not supported."); + isKeepAlive = value; + } + } + +#if !BESTHTTP_DISABLE_CACHING + /// + /// With this property caching can be enabled/disabled on a per-request basis. + /// + public bool DisableCache + { + get { return disableCache; } + set + { + if (State == HTTPRequestStates.Processing) + throw new NotSupportedException("Changing the DisableCache property while processing the request is not supported."); + disableCache = value; + } + } + + public bool CacheOnly + { + get { return cacheOnly; } + set + { + if (State == HTTPRequestStates.Processing) + throw new NotSupportedException("Changing the CacheOnly property while processing the request is not supported."); + cacheOnly = value; + } + } +#endif + + /// + /// If it's true, the Callback will be called every time if we can send out at least one fragment. + /// + public bool UseStreaming + { + get { return useStreaming; } + set + { + if (State == HTTPRequestStates.Processing) + throw new NotSupportedException("Changing the UseStreaming property while processing the request is not supported."); + useStreaming = value; + } + } + + /// + /// Maximum size of a data chunk that we want to receive when streaming is set. + /// + public int StreamFragmentSize + { + get{ return streamFragmentSize; } + set + { + if (State == HTTPRequestStates.Processing) + throw new NotSupportedException("Changing the StreamFragmentSize property while processing the request is not supported."); + + if (value < 1) + throw new System.ArgumentException("StreamFragmentSize must be at least 1."); + + streamFragmentSize = value; + } + } + + public int MaxFragmentQueueLength { get; set; } + + /// + /// The callback function that will be called when a request is fully processed or when any downloaded fragment is available if UseStreaming is true. Can be null for fire-and-forget requests. + /// + public OnRequestFinishedDelegate Callback { get; set; } + + /// + /// Called when new data downloaded from the server. + /// The first parameter is the original HTTTPRequest object itself, the second parameter is the downloaded bytes while the third parameter is the content length. + /// There are download modes where we can't figure out the exact length of the final content. In these cases we just guarantee that the third parameter will be at least the size of the second one. + /// + public OnDownloadProgressDelegate OnProgress; + + /// + /// Called when the current protocol is upgraded to an other. (HTTP => WebSocket for example) + /// + public OnRequestFinishedDelegate OnUpgraded; + + /// + /// With this option if reading back the server's response fails, the request will fail and any exceptions can be checked through the Exception property. The default value is True for POST requests, otherwise false. + /// + public bool DisableRetry { get; set; } + + /// + /// Indicates that the request is redirected. If a request is redirected, the connection that served it will be closed regardless of the value of IsKeepAlive. + /// + public bool IsRedirected { get; internal set; } + + /// + /// The Uri that the request redirected to. + /// + public Uri RedirectUri { get; internal set; } + + /// + /// If redirected it contains the RedirectUri. + /// + public Uri CurrentUri { get { return IsRedirected ? RedirectUri : Uri; } } + + /// + /// The response to the query. + /// If an exception occurred during reading of the response stream or can't connect to the server, this will be null! + /// + public HTTPResponse Response { get; internal set; } + +#if !BESTHTTP_DISABLE_PROXY + /// + /// Response from the Proxy server. It's null with transparent proxies. + /// + public HTTPResponse ProxyResponse { get; internal set; } +#endif + + /// + /// It there is an exception while processing the request or response the Response property will be null, and the Exception will be stored in this property. + /// + public Exception Exception { get; internal set; } + + /// + /// Any object can be passed with the request with this property. (eq. it can be identified, etc.) + /// + public object Tag { get; set; } + + /// + /// The UserName, Password pair that the plugin will use to authenticate to the remote server. + /// + public Credentials Credentials { get; set; } + +#if !BESTHTTP_DISABLE_PROXY + /// + /// True, if there is a Proxy object. + /// + public bool HasProxy { get { return Proxy != null; } } + + /// + /// A web proxy's properties where the request must pass through. + /// + public Proxy Proxy { get; set; } +#endif + + /// + /// How many redirection supported for this request. The default is int.MaxValue. 0 or a negative value means no redirection supported. + /// + public int MaxRedirects { get; set; } + +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + /// + /// Use Bouncy Castle's code to handle the secure protocol instead of Mono's. You can try to set it true if you receive a "System.Security.Cryptography.CryptographicException: Unsupported hash algorithm" exception. + /// + public bool UseAlternateSSL { get; set; } +#endif + +#if !BESTHTTP_DISABLE_COOKIES + + /// + /// If true cookies will be added to the headers (if any), and parsed from the response. If false, all cookie operations will be ignored. It's default value is HTTPManager's IsCookiesEnabled. + /// + public bool IsCookiesEnabled { get; set; } + + /// + /// Cookies that are added to this list will be sent to the server alongside withe the server sent ones. If cookies are disabled only these cookies will be sent. + /// + public List Cookies + { + get + { + if (customCookies == null) + customCookies = new List(); + return customCookies; + } + set { customCookies = value; } + } + + private List customCookies; +#endif + + /// + /// What form should used. Default to Automatic. + /// + public HTTPFormUsage FormUsage { get; set; } + + /// + /// Current state of this request. + /// + public HTTPRequestStates State { get; internal set; } + + /// + /// How many times redirected. + /// + public int RedirectCount { get; internal set; } + +#if !NETFX_CORE + /// + /// Custom validator for an SslStream. This event will receive the original HTTPRequest, an X509Certificate and an X509Chain objects. It must return true if the certificate valid, false otherwise. + /// It's called in a thread! Not available on Windows Phone! + /// + public event System.Func CustomCertificationValidator; +#endif + + /// + /// Maximum time we wait to establish the connection to the target server. If set to TimeSpan.Zero or lower, no connect timeout logic is executed. Default value is 20 seconds. + /// + public TimeSpan ConnectTimeout { get; set; } + + /// + /// Maximum time we want to wait to the request to finish after the connection is established. Default value is 60 seconds. + /// It's disabled for streaming requests! See . + /// + public TimeSpan Timeout { get; set; } + + /// + /// Set to true to enable Timeouts on streaming request. Default value is false. + /// + public bool EnableTimoutForStreaming { get; set; } + + /// + /// Enables safe read method when the response's length of the content is unknown. Its default value is enabled (true). + /// + public bool EnableSafeReadOnUnknownContentLength { get; set; } + + /// + /// The priority of the request. Higher priority requests will be picked from the request queue sooner than lower priority ones. + /// + public int Priority { get; set; } + +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + /// + /// The ICertificateVerifyer implementation that the plugin will use to verify the server certificates when the request's UseAlternateSSL property is set to true. + /// + public Org.BouncyCastle.Crypto.Tls.ICertificateVerifyer CustomCertificateVerifyer { get; set; } + + /// + /// The IClientCredentialsProvider implementation that the plugin will use to send client certificates when the request's UseAlternateSSL property is set to true. + /// + public Org.BouncyCastle.Crypto.Tls.IClientCredentialsProvider CustomClientCredentialsProvider { get; set; } + + /// + /// With this property custom Server Name Indication entries can be sent to the server while negotiating TLS. + /// All added entries must conform to the rules defined in the RFC (https://tools.ietf.org/html/rfc3546#section-3.1), the plugin will not check the entries' validity! + /// This list will be sent to every server that the plugin must connect to while it tries to finish the request. + /// So for example if redirected to an another server, that new server will receive this list too! + /// + public List CustomTLSServerNameList { get; set; } +#endif + + /// + /// + /// + public SupportedProtocols ProtocolHandler { get; set; } + + /// + /// It's called before the plugin will do a new request to the new uri. The return value of this function will control the redirection: if it's false the redirection is aborted. + /// This function is called on a thread other than the main Unity thread! + /// + public event OnBeforeRedirectionDelegate OnBeforeRedirection + { + add { onBeforeRedirection += value; } + remove { onBeforeRedirection -= value; } + } + private OnBeforeRedirectionDelegate onBeforeRedirection; + + /// + /// This event will be fired before the plugin will write headers to the wire. New headers can be added in this callback. This event is called on a non-Unity thread! + /// + public event OnBeforeHeaderSendDelegate OnBeforeHeaderSend + { + add { _onBeforeHeaderSend += value; } + remove { _onBeforeHeaderSend -= value; } + } + private OnBeforeHeaderSendDelegate _onBeforeHeaderSend; + + /// + /// Setting this option to true, the processing connection will set the TCP NoDelay option to send out data as soon as it can. + /// + public bool TryToMinimizeTCPLatency { get; set; } + +#if UNITY_WEBGL + /// + /// Its value will be set to the XmlHTTPRequest's withCredentials field. Its default value is HTTPManager.IsCookiesEnabled's value. + /// + public bool WithCredentials { get; set; } +#endif + + #region Internal Properties For Progress Report Support + + /// + /// How many bytes downloaded so far. + /// + internal long Downloaded { get; set; } + + /// + /// The length of the content that we are currently downloading. + /// If chunked encoding is used, then it is the size of the sum of all previous chunks plus the current one. + /// When no Content-Length present and no chunked encoding is used then its size is the currently downloaded size. + /// + internal long DownloadLength { get; set; } + + /// + /// Set to true when the downloaded bytes are changed, and set to false when the OnProgress event called. + /// + internal bool DownloadProgressChanged { get; set; } + + /// + /// Will return the length of the UploadStream, or -1 if it's not supported. + /// + internal long UploadStreamLength + { + get + { + if (UploadStream == null || !UseUploadStreamLength) + return -1; + + try + { + // This may will throw a NotSupportedException + return UploadStream.Length; + } + catch + { + // We will fall back to chunked + return -1; + } + } + } + + /// + /// How many bytes are sent to the wire + /// + internal long Uploaded { get; set; } + + /// + /// How many bytes are expected we are sending. If we are don't know, then it will be -1. + /// + internal long UploadLength { get; set; } + + /// + /// Set to true when the uploaded bytes are changed, and set to false when the OnUploadProgress event called. + /// + internal bool UploadProgressChanged { get; set; } + + #endregion + + #endregion + + #region Privates + + private bool isKeepAlive; +#if !BESTHTTP_DISABLE_CACHING + private bool disableCache; + private bool cacheOnly; +#endif + private int streamFragmentSize; + private bool useStreaming; + + private Dictionary> Headers { get; set; } + + /// + /// We will collect the fields and values to the FieldCollector through the AddField and AddBinaryData functions. + /// + private HTTPFormBase FieldCollector; + + /// + /// When the request about to send the request we will create a specialized form implementation(url-encoded, multipart, or the legacy WWWForm based). + /// And we will use this instance to create the data that we will send to the server. + /// + private HTTPFormBase FormImpl; + + #endregion + + #region Constructors + + #region Default Get Constructors + + public HTTPRequest(Uri uri) + : this(uri, HTTPMethods.Get, HTTPManager.KeepAliveDefaultValue, +#if !BESTHTTP_DISABLE_CACHING + HTTPManager.IsCachingDisabled +#else + true +#endif + , null) + { + } + + public HTTPRequest(Uri uri, OnRequestFinishedDelegate callback) + : this(uri, HTTPMethods.Get, HTTPManager.KeepAliveDefaultValue, +#if !BESTHTTP_DISABLE_CACHING + HTTPManager.IsCachingDisabled +#else + true +#endif + , callback) + { + } + + public HTTPRequest(Uri uri, bool isKeepAlive, OnRequestFinishedDelegate callback) + : this(uri, HTTPMethods.Get, isKeepAlive, +#if !BESTHTTP_DISABLE_CACHING + HTTPManager.IsCachingDisabled +#else + true +#endif + + , callback) + { + } + public HTTPRequest(Uri uri, bool isKeepAlive, bool disableCache, OnRequestFinishedDelegate callback) + : this(uri, HTTPMethods.Get, isKeepAlive, disableCache, callback) + { + } + + #endregion + + public HTTPRequest(Uri uri, HTTPMethods methodType) + : this(uri, methodType, HTTPManager.KeepAliveDefaultValue, +#if !BESTHTTP_DISABLE_CACHING + HTTPManager.IsCachingDisabled || methodType != HTTPMethods.Get +#else + true +#endif + , null) + { + } + + public HTTPRequest(Uri uri, HTTPMethods methodType, OnRequestFinishedDelegate callback) + : this(uri, methodType, HTTPManager.KeepAliveDefaultValue, +#if !BESTHTTP_DISABLE_CACHING + HTTPManager.IsCachingDisabled || methodType != HTTPMethods.Get +#else + true +#endif + , callback) + { + } + + public HTTPRequest(Uri uri, HTTPMethods methodType, bool isKeepAlive, OnRequestFinishedDelegate callback) + : this(uri, methodType, isKeepAlive, +#if !BESTHTTP_DISABLE_CACHING + HTTPManager.IsCachingDisabled || methodType != HTTPMethods.Get +#else + true +#endif + , callback) + { + } + + public HTTPRequest(Uri uri, HTTPMethods methodType, bool isKeepAlive, bool disableCache, OnRequestFinishedDelegate callback) + { + this.Uri = uri; + this.MethodType = methodType; + this.IsKeepAlive = isKeepAlive; +#if !BESTHTTP_DISABLE_CACHING + this.DisableCache = disableCache; +#endif + this.Callback = callback; + this.StreamFragmentSize = 4 * 1024; + this.MaxFragmentQueueLength = 10; + + this.DisableRetry = !(methodType == HTTPMethods.Get); + this.MaxRedirects = int.MaxValue; + this.RedirectCount = 0; +#if !BESTHTTP_DISABLE_COOKIES + this.IsCookiesEnabled = HTTPManager.IsCookiesEnabled; +#endif + + this.Downloaded = DownloadLength = 0; + this.DownloadProgressChanged = false; + + this.State = HTTPRequestStates.Initial; + + this.ConnectTimeout = HTTPManager.ConnectTimeout; + this.Timeout = HTTPManager.RequestTimeout; + this.EnableTimoutForStreaming = false; + + this.EnableSafeReadOnUnknownContentLength = true; + +#if !BESTHTTP_DISABLE_PROXY + this.Proxy = HTTPManager.Proxy; +#endif + + this.UseUploadStreamLength = true; + this.DisposeUploadStream = true; + +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + this.CustomCertificateVerifyer = HTTPManager.DefaultCertificateVerifyer; + this.CustomClientCredentialsProvider = HTTPManager.DefaultClientCredentialsProvider; + this.UseAlternateSSL = HTTPManager.UseAlternateSSLDefaultValue; +#endif + +#if !NETFX_CORE + this.CustomCertificationValidator += HTTPManager.DefaultCertificationValidator; +#endif + this.TryToMinimizeTCPLatency = HTTPManager.TryToMinimizeTCPLatency; + +#if UNITY_WEBGL + this.WithCredentials = this.IsCookiesEnabled; +#endif + } + + #endregion + + #region Public Field Functions + + /// + /// Add a field with a given string value. + /// + public void AddField(string fieldName, string value) + { + AddField(fieldName, value, System.Text.Encoding.UTF8); + } + + /// + /// Add a field with a given string value. + /// + public void AddField(string fieldName, string value, System.Text.Encoding e) + { + if (FieldCollector == null) + FieldCollector = new HTTPFormBase(); + + FieldCollector.AddField(fieldName, value, e); + } + + /// + /// Add a field with binary content to the form. + /// + public void AddBinaryData(string fieldName, byte[] content) + { + AddBinaryData(fieldName, content, null, null); + } + + /// + /// Add a field with binary content to the form. + /// + public void AddBinaryData(string fieldName, byte[] content, string fileName) + { + AddBinaryData(fieldName, content, fileName, null); + } + + /// + /// Add a field with binary content to the form. + /// + public void AddBinaryData(string fieldName, byte[] content, string fileName, string mimeType) + { + if (FieldCollector == null) + FieldCollector = new HTTPFormBase(); + + FieldCollector.AddBinaryData(fieldName, content, fileName, mimeType); + } + + /// + /// Manually set a HTTP Form. + /// + public void SetForm(HTTPFormBase form) + { + FormImpl = form; + } + + /// + /// Returns with the added form-fields or null if no one added. + /// + public List GetFormFields() + { + if (this.FieldCollector == null || this.FieldCollector.IsEmpty) + return null; + + return new List(this.FieldCollector.Fields); + } + + /// + /// Clears all data from the form. + /// + public void ClearForm() + { + FormImpl = null; + FieldCollector = null; + } + + /// + /// Will create the form implementation based on the value of the FormUsage property. + /// + private HTTPFormBase SelectFormImplementation() + { + // Our form already created with a previous + if (FormImpl != null) + return FormImpl; + + // No field added to this request yet + if (FieldCollector == null) + return null; + + switch (FormUsage) + { + case HTTPFormUsage.Automatic: + // A really simple decision making: if there are at least one field with binary data, or a 'long' string value then we will choose a Multipart form. + // Otherwise Url Encoded form will be used. + if (FieldCollector.HasBinary || FieldCollector.HasLongValue) + goto case HTTPFormUsage.Multipart; + else + goto case HTTPFormUsage.UrlEncoded; + + case HTTPFormUsage.UrlEncoded: FormImpl = new HTTPUrlEncodedForm(); break; + case HTTPFormUsage.Multipart: FormImpl = new HTTPMultiPartForm(); break; + case HTTPFormUsage.RawJSon: FormImpl = new RawJsonForm(); break; + } + + // Copy the fields, and other properties to the new implementation + FormImpl.CopyFrom(FieldCollector); + + return FormImpl; + } + + #endregion + + #region Header Management + + #region General Management + + /// + /// Adds a header and value pair to the Headers. Use it to add custom headers to the request. + /// + /// AddHeader("User-Agent', "FooBar 1.0") + public void AddHeader(string name, string value) + { + if (Headers == null) + Headers = new Dictionary>(); + + List values; + if (!Headers.TryGetValue(name, out values)) + Headers.Add(name, values = new List(1)); + + values.Add(value); + } + + /// + /// Removes any previously added values, and sets the given one. + /// + public void SetHeader(string name, string value) + { + if (Headers == null) + Headers = new Dictionary>(); + + List values; + if (!Headers.TryGetValue(name, out values)) + Headers.Add(name, values = new List(1)); + + values.Clear(); + values.Add(value); + } + + /// + /// Removes the specified header. Returns true, if the header found and succesfully removed. + /// + /// + /// + public bool RemoveHeader(string name) + { + if (Headers == null) + return false; + + return Headers.Remove(name); + } + + /// + /// Returns true if the given head name is already in the Headers. + /// + public bool HasHeader(string name) + { + return Headers != null && Headers.ContainsKey(name); + } + + /// + /// Returns the first header or null for the given header name. + /// + public string GetFirstHeaderValue(string name) + { + if (Headers == null) + return null; + + List headers = null; + if (Headers.TryGetValue(name, out headers) && headers.Count > 0) + return headers[0]; + + return null; + } + + /// + /// Returns all header values for the given header or null. + /// + public List GetHeaderValues(string name) + { + if (Headers == null) + return null; + + List headers = null; + if (Headers.TryGetValue(name, out headers) && headers.Count > 0) + return headers; + + return null; + } + + public void RemoveHeaders() + { + if (Headers == null) + return; + + Headers.Clear(); + } + + #endregion + + #region Range Headers + + /// + /// Sets the Range header to download the content from the given byte position. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 + /// + /// Start position of the download. + public void SetRangeHeader(int firstBytePos) + { + SetHeader("Range", string.Format("bytes={0}-", firstBytePos)); + } + + /// + /// Sets the Range header to download the content from the given byte position to the given last position. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 + /// + /// Start position of the download. + /// The end position of the download. + public void SetRangeHeader(int firstBytePos, int lastBytePos) + { + SetHeader("Range", string.Format("bytes={0}-{1}", firstBytePos, lastBytePos)); + } + + #endregion + + public void EnumerateHeaders(OnHeaderEnumerationDelegate callback) + { + EnumerateHeaders(callback, false); + } + + public void EnumerateHeaders(OnHeaderEnumerationDelegate callback, bool callBeforeSendCallback) + { +#if !UNITY_WEBGL || UNITY_EDITOR + if (!HasHeader("Host")) + { + if (CurrentUri.Port == 80 || CurrentUri.Port == 443) + SetHeader("Host", CurrentUri.Host); + else + SetHeader("Host", CurrentUri.Authority); + } + + if (IsRedirected && !HasHeader("Referer")) + AddHeader("Referer", Uri.ToString()); + + if (!HasHeader("Accept-Encoding")) +#if BESTHTTP_DISABLE_GZIP + AddHeader("Accept-Encoding", "identity"); +#else + AddHeader("Accept-Encoding", "gzip, identity"); +#endif + + #if !BESTHTTP_DISABLE_PROXY + if (HasProxy && !HasHeader("Proxy-Connection")) + AddHeader("Proxy-Connection", IsKeepAlive ? "Keep-Alive" : "Close"); + #endif + + if (!HasHeader("Connection")) + AddHeader("Connection", IsKeepAlive ? "Keep-Alive, TE" : "Close, TE"); + + if (!HasHeader("TE")) + AddHeader("TE", "identity"); + + if (!HasHeader("User-Agent")) + AddHeader("User-Agent", "BestHTTP"); +#endif + long contentLength = -1; + + if (UploadStream == null) + { + byte[] entityBody = GetEntityBody(); + contentLength = entityBody != null ? entityBody.Length : 0; + + if (RawData == null && (FormImpl != null || (FieldCollector != null && !FieldCollector.IsEmpty))) + { + SelectFormImplementation(); + if (FormImpl != null) + FormImpl.PrepareRequest(this); + } + } + else + { + contentLength = UploadStreamLength; + + if (contentLength == -1) + SetHeader("Transfer-Encoding", "Chunked"); + + if (!HasHeader("Content-Type")) + SetHeader("Content-Type", "application/octet-stream"); + } + + // Always set the Content-Length header if possible + // http://tools.ietf.org/html/rfc2616#section-4.4 : For compatibility with HTTP/1.0 applications, HTTP/1.1 requests containing a message-body MUST include a valid Content-Length header field unless the server is known to be HTTP/1.1 compliant. + // 2018.06.03: Changed the condition so that content-length header will be included for zero length too. + if ( +#if !UNITY_WEBGL || UNITY_EDITOR + contentLength >= 0 +#else + contentLength != -1 +#endif + && !HasHeader("Content-Length")) + SetHeader("Content-Length", contentLength.ToString()); + +#if !UNITY_WEBGL || UNITY_EDITOR + #if !BESTHTTP_DISABLE_PROXY + // Proxy Authentication + if (HasProxy && Proxy.Credentials != null) + { + switch (Proxy.Credentials.Type) + { + case AuthenticationTypes.Basic: + // With Basic authentication we don't want to wait for a challenge, we will send the hash with the first request + SetHeader("Proxy-Authorization", string.Concat("Basic ", Convert.ToBase64String(Encoding.UTF8.GetBytes(Proxy.Credentials.UserName + ":" + Proxy.Credentials.Password)))); + break; + + case AuthenticationTypes.Unknown: + case AuthenticationTypes.Digest: + var digest = DigestStore.Get(Proxy.Address); + if (digest != null) + { + string authentication = digest.GenerateResponseHeader(this, Proxy.Credentials); + if (!string.IsNullOrEmpty(authentication)) + SetHeader("Proxy-Authorization", authentication); + } + + break; + } + } + #endif + +#endif + + // Server authentication + if (Credentials != null) + { + switch (Credentials.Type) + { + case AuthenticationTypes.Basic: + // With Basic authentication we don't want to wait for a challenge, we will send the hash with the first request + SetHeader("Authorization", string.Concat("Basic ", Convert.ToBase64String(Encoding.UTF8.GetBytes(Credentials.UserName + ":" + Credentials.Password)))); + break; + + case AuthenticationTypes.Unknown: + case AuthenticationTypes.Digest: + var digest = DigestStore.Get(this.CurrentUri); + if (digest != null) + { + string authentication = digest.GenerateResponseHeader(this, Credentials); + if (!string.IsNullOrEmpty(authentication)) + SetHeader("Authorization", authentication); + } + + break; + } + } + + // Cookies. +#if !BESTHTTP_DISABLE_COOKIES + // User added cookies are sent even when IsCookiesEnabled is set to false + List cookies = IsCookiesEnabled ? CookieJar.Get(CurrentUri) : null; + + // Merge server sent cookies with user-set cookies + if (cookies == null || cookies.Count == 0) + cookies = this.customCookies; + else if (this.customCookies != null) + { + // Merge + int idx = 0; + while (idx < this.customCookies.Count) + { + Cookie customCookie = customCookies[idx]; + + int foundIdx = cookies.FindIndex(c => c.Name.Equals(customCookie.Name)); + if (foundIdx >= 0) + cookies[foundIdx] = customCookie; + else + cookies.Add(customCookie); + + idx++; + } + } + + // http://tools.ietf.org/html/rfc6265#section-5.4 + // -When the user agent generates an HTTP request, the user agent MUST NOT attach more than one Cookie header field. + if (cookies != null && cookies.Count > 0) + { + // TODO: + // 2. The user agent SHOULD sort the cookie-list in the following order: + // * Cookies with longer paths are listed before cookies with shorter paths. + // * Among cookies that have equal-length path fields, cookies with earlier creation-times are listed before cookies with later creation-times. + + bool first = true; + string cookieStr = string.Empty; + + bool isSecureProtocolInUse = HTTPProtocolFactory.IsSecureProtocol(CurrentUri); + + foreach (var cookie in cookies) + if (!cookie.IsSecure || (cookie.IsSecure && isSecureProtocolInUse)) + { + if (!first) + cookieStr += "; "; + else + first = false; + + cookieStr += cookie.ToString(); + + // 3. Update the last-access-time of each cookie in the cookie-list to the current date and time. + cookie.LastAccess = DateTime.UtcNow; + } + + if (!string.IsNullOrEmpty(cookieStr)) + SetHeader("Cookie", cookieStr); + } +#endif + + if (callBeforeSendCallback && _onBeforeHeaderSend != null) + { + try + { + _onBeforeHeaderSend(this); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("HTTPRequest", "OnBeforeHeaderSend", ex); + } + } + + // Write out the headers to the stream + if (callback != null && Headers != null) + foreach (var kvp in Headers) + callback(kvp.Key, kvp.Value); + } + + /// + /// Writes out the Headers to the stream. + /// + private void SendHeaders(Stream stream) + { + EnumerateHeaders((header, values) => + { + if (string.IsNullOrEmpty(header) || values == null) + return; + + byte[] headerName = string.Concat(header, ": ").GetASCIIBytes(); + + for (int i = 0; i < values.Count; ++i) + { + if (string.IsNullOrEmpty(values[i])) + { + HTTPManager.Logger.Warning("HTTPRequest", string.Format("Null/empty value for header: {0}", header)); + continue; + } + + if (HTTPManager.Logger.Level <= Logger.Loglevels.Information) + VerboseLogging("Header - '" + header + "': '" + values[i] + "'"); + + byte[] valueBytes = values[i].GetASCIIBytes(); + + stream.WriteArray(headerName); + stream.WriteArray(valueBytes); + stream.WriteArray(EOL); + + VariableSizedBufferPool.Release(valueBytes); + } + + VariableSizedBufferPool.Release(headerName); + }, /*callBeforeSendCallback:*/ true); + } + + /// + /// Returns a string representation of the headers. + /// + public string DumpHeaders() + { + using (var ms = new BufferPoolMemoryStream(5 * 1024)) + { + SendHeaders(ms); + return ms.ToArray().AsciiToString(); + } + } + + /// + /// Returns with the bytes that will be sent to the server as the request's payload. + /// + /// Call this only after all form-fields are added! + public byte[] GetEntityBody() + { + if (RawData != null) + return RawData; + + if (FormImpl != null || (FieldCollector != null && !FieldCollector.IsEmpty)) + { + SelectFormImplementation(); + if (FormImpl != null) + return FormImpl.GetData(); + } + + return null; + } + + #endregion + + #region Internal Helper Functions + + internal void SendOutTo(Stream stream) + { + // Under WEBGL EnumerateHeaders and GetEntityBody are used instead of this function. +#if !UNITY_WEBGL || UNITY_EDITOR + try + { + string requestPathAndQuery = + #if !BESTHTTP_DISABLE_PROXY + HasProxy ? this.Proxy.GetRequestPath(CurrentUri) : + #endif + CurrentUri.GetRequestPathAndQueryURL(); + + string requestLine = string.Format("{0} {1} HTTP/1.1", MethodNames[(byte)MethodType], requestPathAndQuery); + + if (HTTPManager.Logger.Level <= Logger.Loglevels.Information) + HTTPManager.Logger.Information("HTTPRequest", string.Format("Sending request: '{0}'", requestLine)); + + // Create a buffer stream that will not close 'stream' when disposed or closed. + // buffersize should be larger than UploadChunkSize as it might be used for uploading user data and + // it should have enough room for UploadChunkSize data and additional chunk information. + using (WriteOnlyBufferedStream bufferStream = new WriteOnlyBufferedStream(stream, (int)(UploadChunkSize * 1.5f))) + { + byte[] requestLineBytes = requestLine.GetASCIIBytes(); + bufferStream.WriteArray(requestLineBytes); + bufferStream.WriteArray(EOL); + + VariableSizedBufferPool.Release(requestLineBytes); + + // Write headers to the buffer + SendHeaders(bufferStream); + bufferStream.WriteArray(EOL); + + // Send remaining data to the wire + bufferStream.Flush(); + + byte[] data = RawData; + + // We are sending forms? Then convert the form to a byte array + if (data == null && FormImpl != null) + data = FormImpl.GetData(); + + if (data != null || UploadStream != null) + { + // Make a new reference, as we will check the UploadStream property in the HTTPManager + Stream uploadStream = UploadStream; + + if (uploadStream == null) + { + // Make stream from the data + uploadStream = new MemoryStream(data, 0, data.Length); + + // Initialize progress report variable + UploadLength = data.Length; + } + else + UploadLength = UseUploadStreamLength ? UploadStreamLength : -1; + + // Initialize the progress report variables + Uploaded = 0; + + // Upload buffer. First we will read the data into this buffer from the UploadStream, then write this buffer to our outStream + byte[] buffer = VariableSizedBufferPool.Get(UploadChunkSize, true); + + // How many bytes was read from the UploadStream + int count = 0; + while ((count = uploadStream.Read(buffer, 0, buffer.Length)) > 0) + { + // If we don't know the size, send as chunked + if (!UseUploadStreamLength) + { + byte[] countBytes = count.ToString("X").GetASCIIBytes(); + bufferStream.WriteArray(countBytes); + bufferStream.WriteArray(EOL); + + VariableSizedBufferPool.Release(countBytes); + } + + // write out the buffer to the wire + bufferStream.Write(buffer, 0, count); + + // chunk trailing EOL + if (!UseUploadStreamLength) + bufferStream.WriteArray(EOL); + + // update how many bytes are uploaded + Uploaded += count; + + // Write to the wire + bufferStream.Flush(); + + // let the callback fire + UploadProgressChanged = true; + } + + VariableSizedBufferPool.Release(buffer); + + // All data from the stream are sent, write the 'end' chunk if necessary + if (!UseUploadStreamLength) + { + byte[] noMoreChunkBytes = VariableSizedBufferPool.Get(1, true); + noMoreChunkBytes[0] = (byte)'0'; + bufferStream.Write(noMoreChunkBytes, 0, 1); + bufferStream.WriteArray(EOL); + bufferStream.WriteArray(EOL); + + VariableSizedBufferPool.Release(noMoreChunkBytes); + } + + // Make sure all remaining data will be on the wire + bufferStream.Flush(); + + // Dispose the MemoryStream + if (UploadStream == null && uploadStream != null) + uploadStream.Dispose(); + } + else + bufferStream.Flush(); + } // bufferStream.Dispose + + HTTPManager.Logger.Information("HTTPRequest", "'" + requestLine + "' sent out"); + } + finally + { + if (UploadStream != null && DisposeUploadStream) + UploadStream.Dispose(); + } +#endif + } + + internal void UpgradeCallback() + { + if (Response == null || !Response.IsUpgraded) + return; + + try + { + if (OnUpgraded != null) + OnUpgraded(this, Response); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("HTTPRequest", "UpgradeCallback", ex); + } + } + + internal void CallCallback() + { + try + { + if (this.Callback != null) + this.Callback(this, Response); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("HTTPRequest", "CallCallback", ex); + } + } + + internal bool CallOnBeforeRedirection(Uri redirectUri) + { + if (onBeforeRedirection != null) + return onBeforeRedirection(this, this.Response, redirectUri); + + return true; + } + + internal void FinishStreaming() + { + if (Response != null && UseStreaming) + Response.FinishStreaming(); + } + + /// + /// Called on Unity's main thread just before processing it. + /// + internal void Prepare() + { + + } + +#if !NETFX_CORE + internal bool CallCustomCertificationValidator(System.Security.Cryptography.X509Certificates.X509Certificate cert, System.Security.Cryptography.X509Certificates.X509Chain chain) + { + if (CustomCertificationValidator != null) + return CustomCertificationValidator(this, cert, chain); + return true; + } +#endif + +#endregion + + /// + /// Starts processing the request. + /// + public HTTPRequest Send() + { + return HTTPManager.SendRequest(this); + } + + /// + /// Aborts an already established connection, so no further download or upload are done. + /// + public void Abort() + { + if (System.Threading.Monitor.TryEnter(HTTPManager.Locker, TimeSpan.FromMilliseconds(100))) + { + try + { + if (this.State >= HTTPRequestStates.Finished) + { + HTTPManager.Logger.Warning("HTTPRequest", string.Format("Abort - Already in a state({0}) where no Abort required!", this.State.ToString())); + + return; + } + + // Get the parent connection + var connection = HTTPManager.GetConnectionWith(this); + + // No Connection found for this request, maybe not even started + if (connection == null) + { + // so try to remove from the request queue + if (!HTTPManager.RemoveFromQueue(this)) + HTTPManager.Logger.Warning("HTTPRequest", "Abort - No active connection found with this request! (The request may already finished?)"); + + this.State = HTTPRequestStates.Aborted; + this.CallCallback(); + } + else + { + // destroy the incomplete response + if (Response != null && Response.IsStreamed) + Response.Dispose(); + + // send an abort request to the connection + connection.Abort(HTTPConnectionStates.AbortRequested); + } + } + finally + { + System.Threading.Monitor.Exit(HTTPManager.Locker); + } + } + else + throw new Exception("Wasn't able to acquire a thread lock. Abort failed!"); + } + + /// + /// Resets the request for a state where switching MethodType is possible. + /// + public void Clear() + { + ClearForm(); + RemoveHeaders(); + + this.IsRedirected = false; + this.RedirectCount = 0; + this.Downloaded = this.DownloadLength = 0; + } + + private void VerboseLogging(string str) + { + HTTPManager.Logger.Verbose("HTTPRequest", "'" + this.CurrentUri.ToString() + "' - " + str); + } + + #region System.Collections.IEnumerator implementation + + public object Current { get { return null; } } + + public bool MoveNext() + { + return this.State < HTTPRequestStates.Finished; + } + + public void Reset() + { + throw new NotImplementedException(); + } + +#endregion + + HTTPRequest IEnumerator.Current + { + get { return this; } + } + + public void Dispose() + { + if (Response != null) + Response.Dispose(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRequest.cs.meta new file mode 100644 index 00000000..5ad5cae2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPRequest.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bb4a0cfc508761746bb8e11d32d4c8e0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPResponse.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPResponse.cs new file mode 100644 index 00000000..9bbe0464 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPResponse.cs @@ -0,0 +1,1250 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +#if !NETFX_CORE || UNITY_EDITOR + using System.Net.Sockets; +#endif + +using UnityEngine; + +namespace BestHTTP +{ + #if !BESTHTTP_DISABLE_CACHING + using BestHTTP.Caching; + #endif + + using BestHTTP.Extensions; + + #if !BESTHTTP_DISABLE_COOKIES + using BestHTTP.Cookies; + #endif + + public interface IProtocol + { + bool IsClosed { get; } + void HandleEvents(); + } + + /// + /// + /// + public class HTTPResponse : IDisposable + { + internal const byte CR = 13; + internal const byte LF = 10; + + public const int MinBufferSize = 4 * 1024; + + #region Public Properties + + public int VersionMajor { get; protected set; } + public int VersionMinor { get; protected set; } + + /// + /// The status code that sent from the server. + /// + public int StatusCode { get; protected set; } + + /// + /// Returns true if the status code is in the range of [200..300[ or 304 (Not Modified) + /// + public bool IsSuccess { get { return (this.StatusCode >= 200 && this.StatusCode < 300) || this.StatusCode == 304; } } + + /// + /// The message that sent along with the StatusCode from the server. You can check it for errors from the server. + /// + public string Message { get; protected set; } + + /// + /// True if it's a streamed response. + /// + public bool IsStreamed { get; protected set; } + + /// + /// True if the streaming is finished, and no more fragments are coming. + /// + public bool IsStreamingFinished { get; internal set; } + +#if !BESTHTTP_DISABLE_CACHING + /// + /// Indicates that the response body is read from the cache. + /// + public bool IsFromCache { get; internal set; } + + /// + /// Provides information about the file used for caching the request. + /// + public HTTPCacheFileInfo CacheFileInfo { get; internal set; } + + /// + /// Determines if this response is only stored to cache. + /// If both IsCacheOnly and IsStreamed are true, GetStreamedFragments should not be called. + /// + public bool IsCacheOnly { get; private set; } +#endif + + /// + /// The headers that sent from the server. + /// + public Dictionary> Headers { get; protected set; } + + /// + /// The data that downloaded from the server. All Transfer and Content encodings decoded if any(eg. chunked, gzip, deflate). + /// + public byte[] Data { get; internal set; } + + /// + /// The normal HTTP protocol is upgraded to an other. + /// + public bool IsUpgraded { get; protected set; } + +#if !BESTHTTP_DISABLE_COOKIES + /// + /// The cookies that the server sent to the client. + /// + public List Cookies { get; internal set; } +#endif + + /// + /// Cached, converted data. + /// + protected string dataAsText; + + /// + /// The data converted to an UTF8 string. + /// + public string DataAsText + { + get + { + if (Data == null) + return string.Empty; + + if (!string.IsNullOrEmpty(dataAsText)) + return dataAsText; + + return dataAsText = Encoding.UTF8.GetString(Data, 0, Data.Length); + } + } + + /// + /// Cached converted data. + /// + protected Texture2D texture; + + /// + /// The data loaded to a Texture2D. + /// + public Texture2D DataAsTexture2D + { + get + { + if (Data == null) + return null; + + if (texture != null) + return texture; + + texture = new Texture2D(0, 0, TextureFormat.ARGB32, false); + texture.LoadImage(Data); + + return texture; + } + } + + /// + /// True if the connection's stream will be closed manually. Used in custom protocols (WebSocket, EventSource). + /// + public bool IsClosedManually { get; protected set; } + + #endregion + + #region Internal Fields + + internal HTTPRequest baseRequest; + + #endregion + + #region Protected Properties And Fields + + protected Stream Stream; + + protected List streamedFragments; + protected object SyncRoot = new object(); + + protected byte[] fragmentBuffer; + protected int fragmentBufferDataLength; +#if !BESTHTTP_DISABLE_CACHING + protected Stream cacheStream; +#endif + protected int allFragmentSize; + + #endregion + + public HTTPResponse(HTTPRequest request, Stream stream, bool isStreamed, bool isFromCache) + { + this.baseRequest = request; + this.Stream = /*new ReadOnlyBufferedStream*/(stream); + this.IsStreamed = isStreamed; +#if !BESTHTTP_DISABLE_CACHING + this.IsFromCache = isFromCache; + this.IsCacheOnly = request.CacheOnly; +#endif + this.IsClosedManually = false; + } + + public virtual bool Receive(int forceReadRawContentLength = -1, bool readPayloadData = true) + { + string statusLine = string.Empty; + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("Receive. forceReadRawContentLength: '{0:N0}', readPayloadData: '{1:N0}'", forceReadRawContentLength, readPayloadData)); + + // On WP platform we aren't able to determined sure enough whether the tcp connection is closed or not. + // So if we get an exception here, we need to recreate the connection. + try + { + // Read out 'HTTP/1.1' from the "HTTP/1.1 {StatusCode} {Message}" + statusLine = ReadTo(Stream, (byte)' '); + } + catch + { + if (!baseRequest.DisableRetry) + { + HTTPManager.Logger.Warning("HTTPResponse", string.Format("{0} - Failed to read Status Line! Retry is enabled, returning with false.", this.baseRequest.CurrentUri.ToString())); + return false; + } + + HTTPManager.Logger.Warning("HTTPResponse", string.Format("{0} - Failed to read Status Line! Retry is disabled, re-throwing exception.", this.baseRequest.CurrentUri.ToString())); + throw; + } + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("Status Line: '{0}'", statusLine)); + + if (string.IsNullOrEmpty(statusLine)) + { + if (!baseRequest.DisableRetry) + return false; + + throw new Exception("Remote server closed the connection before sending response header!"); + } + + string[] versions = statusLine.Split(new char[] { '/', '.' }); + this.VersionMajor = int.Parse(versions[1]); + this.VersionMinor = int.Parse(versions[2]); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("HTTP Version: '{0}.{1}'", this.VersionMajor.ToString(), this.VersionMinor.ToString())); + + int statusCode; + string statusCodeStr = NoTrimReadTo(Stream, (byte)' ', LF); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("Status Code: '{0}'", statusCodeStr)); + + if (baseRequest.DisableRetry) + statusCode = int.Parse(statusCodeStr); + else if (!int.TryParse(statusCodeStr, out statusCode)) + return false; + + this.StatusCode = statusCode; + + if (statusCodeStr.Length > 0 && (byte)statusCodeStr[statusCodeStr.Length - 1] != LF && (byte)statusCodeStr[statusCodeStr.Length - 1] != CR) + { + this.Message = ReadTo(Stream, LF); + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("Status Message: '{0}'", this.Message)); + } + else + { + HTTPManager.Logger.Warning("HTTPResponse", string.Format("{0} - Skipping Status Message reading!", this.baseRequest.CurrentUri.ToString())); + + this.Message = string.Empty; + } + + //Read Headers + ReadHeaders(Stream); + + IsUpgraded = StatusCode == 101 && (HasHeaderWithValue("connection", "upgrade") || HasHeader("upgrade")); + + if (IsUpgraded && HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging("Request Upgraded!"); + + if (!readPayloadData) + return true; + + return ReadPayload(forceReadRawContentLength); + } + + protected bool ReadPayload(int forceReadRawContentLength) + { + // Reading from an already unpacked stream (eq. From a file cache) + if (forceReadRawContentLength != -1) + { +#if !BESTHTTP_DISABLE_CACHING + this.IsFromCache = true; +#endif + ReadRaw(Stream, forceReadRawContentLength); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging("ReadPayload Finished!"); + return true; + } + + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 + // 1.Any response message which "MUST NOT" include a message-body (such as the 1xx, 204, and 304 responses and any response to a HEAD request) + // is always terminated by the first empty line after the header fields, regardless of the entity-header fields present in the message. + if ((StatusCode >= 100 && StatusCode < 200) || StatusCode == 204 || StatusCode == 304 || baseRequest.MethodType == HTTPMethods.Head) + return true; + +#if (!UNITY_WEBGL || UNITY_EDITOR) + if (HasHeaderWithValue("transfer-encoding", "chunked")) + ReadChunked(Stream); + else +#endif + { + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4 + // Case 3 in the above link. + List contentLengthHeaders = GetHeaderValues("content-length"); + var contentRangeHeaders = GetHeaderValues("content-range"); + if (contentLengthHeaders != null && contentRangeHeaders == null) + ReadRaw(Stream, long.Parse(contentLengthHeaders[0])); + else if (contentRangeHeaders != null) + { + if (contentLengthHeaders != null) + ReadRaw(Stream, long.Parse(contentLengthHeaders[0])); + else + { + HTTPRange range = GetRange(); + ReadRaw(Stream, (range.LastBytePos - range.FirstBytePos) + 1); + } + } + else + ReadUnknownSize(Stream); + } + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging("ReadPayload Finished!"); + + return true; + } + + #region Header Management + + protected void ReadHeaders(Stream stream) + { + string headerName = ReadTo(stream, (byte)':', LF)/*.Trim()*/; + while (headerName != string.Empty) + { + string value = ReadTo(stream, LF); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("Header - '{0}': '{1}'", headerName, value)); + + AddHeader(headerName, value); + + headerName = ReadTo(stream, (byte)':', LF); + } + } + + protected void AddHeader(string name, string value) + { + name = name.ToLower(); + + if (Headers == null) + Headers = new Dictionary>(); + + List values; + if (!Headers.TryGetValue(name, out values)) + Headers.Add(name, values = new List(1)); + + values.Add(value); + } + + /// + /// Returns the list of values that received from the server for the given header name. + /// Remarks: All headers converted to lowercase while reading the response. + /// + /// Name of the header + /// If no header found with the given name or there are no values in the list (eg. Count == 0) returns null. + public List GetHeaderValues(string name) + { + if (Headers == null) + return null; + + name = name.ToLower(); + + List values; + if (!Headers.TryGetValue(name, out values) || values.Count == 0) + return null; + + return values; + } + + /// + /// Returns the first value in the header list or null if there are no header or value. + /// + /// Name of the header + /// If no header found with the given name or there are no values in the list (eg. Count == 0) returns null. + public string GetFirstHeaderValue(string name) + { + if (Headers == null) + return null; + + name = name.ToLower(); + + List values; + if (!Headers.TryGetValue(name, out values) || values.Count == 0) + return null; + + return values[0]; + } + + /// + /// Checks if there is a header with the given name and value. + /// + /// Name of the header. + /// + /// Returns true if there is a header with the given name and value. + public bool HasHeaderWithValue(string headerName, string value) + { + var values = GetHeaderValues(headerName); + if (values == null) + return false; + + for (int i = 0; i < values.Count; ++i) + if (string.Compare(values[i], value, StringComparison.OrdinalIgnoreCase) == 0) + return true; + + return false; + } + + /// + /// Checks if there is a header with the given name. + /// + /// Name of the header. + /// Returns true if there is a header with the given name. + public bool HasHeader(string headerName) + { + var values = GetHeaderValues(headerName); + if (values == null) + return false; + + return true; + } + + /// + /// Parses the 'Content-Range' header's value and returns a HTTPRange object. + /// + /// If the server ignores a byte-range-spec because it is syntactically invalid, the server SHOULD treat the request as if the invalid Range header field did not exist. + /// (Normally, this means return a 200 response containing the full entity). In this case because of there are no 'Content-Range' header, this function will return null! + /// Returns null if no 'Content-Range' header found. + public HTTPRange GetRange() + { + var rangeHeaders = GetHeaderValues("content-range"); + if (rangeHeaders == null) + return null; + + // A byte-content-range-spec with a byte-range-resp-spec whose last- byte-pos value is less than its first-byte-pos value, + // or whose instance-length value is less than or equal to its last-byte-pos value, is invalid. + // The recipient of an invalid byte-content-range- spec MUST ignore it and any content transferred along with it. + + // A valid content-range sample: "bytes 500-1233/1234" + var ranges = rangeHeaders[0].Split(new char[] { ' ', '-', '/' }, StringSplitOptions.RemoveEmptyEntries); + + // A server sending a response with status code 416 (Requested range not satisfiable) SHOULD include a Content-Range field with a byte-range-resp-spec of "*". + // The instance-length specifies the current length of the selected resource. + // "bytes */1234" + if (ranges[1] == "*") + return new HTTPRange(int.Parse(ranges[2])); + + return new HTTPRange(int.Parse(ranges[1]), int.Parse(ranges[2]), ranges[3] != "*" ? int.Parse(ranges[3]) : -1); + } + + #endregion + + #region Static Stream Management Helper Functions + + public static string ReadTo(Stream stream, byte blocker) + { + byte[] readBuf = VariableSizedBufferPool.Get(1024, true); + try + { + int bufpos = 0; + + int ch = stream.ReadByte(); + while (ch != blocker && ch != -1) + { + if (ch > 0x7f) //replaces asciitostring + ch = '?'; + + //make buffer larger if too short + if (readBuf.Length <= bufpos) + VariableSizedBufferPool.Resize(ref readBuf, readBuf.Length * 2, true); + + if (bufpos > 0 || !char.IsWhiteSpace((char)ch)) //trimstart + readBuf[bufpos++] = (byte)ch; + ch = stream.ReadByte(); + } + + while (bufpos > 0 && char.IsWhiteSpace((char)readBuf[bufpos - 1])) + bufpos--; + + return System.Text.Encoding.UTF8.GetString(readBuf, 0, bufpos); + } + finally + { + VariableSizedBufferPool.Release(readBuf); + } + } + + public static string ReadTo(Stream stream, byte blocker1, byte blocker2) + { + byte[] readBuf = VariableSizedBufferPool.Get(1024, true); + try { + int bufpos = 0; + + int ch = stream.ReadByte(); + while (ch != blocker1 && ch != blocker2 && ch != -1) + { + if (ch > 0x7f) //replaces asciitostring + ch = '?'; + + //make buffer larger if too short + if (readBuf.Length <= bufpos) + VariableSizedBufferPool.Resize(ref readBuf, readBuf.Length * 2, true); + + if (bufpos > 0 || !char.IsWhiteSpace((char)ch)) //trimstart + readBuf[bufpos++] = (byte)ch; + ch = stream.ReadByte(); + } + + while (bufpos > 0 && char.IsWhiteSpace((char)readBuf[bufpos - 1])) + bufpos--; + + return System.Text.Encoding.UTF8.GetString(readBuf, 0, bufpos); + } + finally + { + VariableSizedBufferPool.Release(readBuf); + } + } + + public static string NoTrimReadTo(Stream stream, byte blocker1, byte blocker2) + { + byte[] readBuf = VariableSizedBufferPool.Get(1024, true); + try { + int bufpos = 0; + + int ch = stream.ReadByte(); + while (ch != blocker1 && ch != blocker2 && ch != -1) + { + if (ch > 0x7f) //replaces asciitostring + ch = '?'; + + //make buffer larger if too short + if (readBuf.Length <= bufpos) + VariableSizedBufferPool.Resize(ref readBuf, readBuf.Length * 2, true); + + if (bufpos > 0 || !char.IsWhiteSpace((char)ch)) //trimstart + readBuf[bufpos++] = (byte)ch; + ch = stream.ReadByte(); + } + + return System.Text.Encoding.UTF8.GetString(readBuf, 0, bufpos); + } + finally + { + VariableSizedBufferPool.Release(readBuf); + } + } + + #endregion + + #region Read Chunked Body + + protected int ReadChunkLength(Stream stream) + { + // Read until the end of line, then split the string so we will discard any optional chunk extensions + string line = ReadTo(stream, LF); + string[] splits = line.Split(';'); + string num = splits[0]; + + int result; + if (int.TryParse(num, System.Globalization.NumberStyles.AllowHexSpecifier, null, out result)) + return result; + + throw new Exception(string.Format("Can't parse '{0}' as a hex number!", num)); + } + + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1 + protected void ReadChunked(Stream stream) + { + BeginReceiveStreamFragments(); + + string contentLengthHeader = GetFirstHeaderValue("Content-Length"); + bool hasContentLengthHeader = !string.IsNullOrEmpty(contentLengthHeader); + int realLength = 0; + if (hasContentLengthHeader) + hasContentLengthHeader = int.TryParse(contentLengthHeader, out realLength); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("ReadChunked - hasContentLengthHeader: {0}, contentLengthHeader: {1} realLength: {2:N0}", hasContentLengthHeader.ToString(), contentLengthHeader, realLength)); + + using (var output = new BufferPoolMemoryStream()) + { + int chunkLength = ReadChunkLength(stream); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("chunkLength: {0:N0}", chunkLength)); + + byte[] buffer = VariableSizedBufferPool.Get(Mathf.NextPowerOfTwo(chunkLength), true); + + int contentLength = 0; + + // Progress report: + baseRequest.DownloadLength = hasContentLengthHeader ? realLength : chunkLength; + baseRequest.DownloadProgressChanged = this.IsSuccess +#if !BESTHTTP_DISABLE_CACHING + || this.IsFromCache +#endif + ; + + string encoding = +#if !BESTHTTP_DISABLE_CACHING + IsFromCache ? null : +#endif + GetFirstHeaderValue("content-encoding"); + bool gzipped = !string.IsNullOrEmpty(encoding) && encoding == "gzip"; + + while (chunkLength != 0) + { + // To avoid more GC garbage we use only one buffer, and resize only if the next chunk doesn't fit. + if (buffer.Length < chunkLength) + VariableSizedBufferPool.Resize(ref buffer, chunkLength, true); + + int readBytes = 0; + + // Fill up the buffer + do + { + int bytes = stream.Read(buffer, readBytes, chunkLength - readBytes); + if (bytes <= 0) + throw ExceptionHelper.ServerClosedTCPStream(); + + readBytes += bytes; + + // Progress report: + // Placing reporting inside this cycle will report progress much more frequent + baseRequest.Downloaded += bytes; + baseRequest.DownloadProgressChanged = this.IsSuccess +#if !BESTHTTP_DISABLE_CACHING + || this.IsFromCache +#endif + ; + + } while (readBytes < chunkLength); + + if (baseRequest.UseStreaming) + { + if (gzipped) + { + var decompressed = Decompress(buffer, 0, readBytes); + if (decompressed != null) + FeedStreamFragment(decompressed, 0, decompressed.Length); + } + else + FeedStreamFragment(buffer, 0, readBytes); + } + else + output.Write(buffer, 0, readBytes); + + // Every chunk data has a trailing CRLF + ReadTo(stream, LF); + + contentLength += readBytes; + + // read the next chunk's length + chunkLength = ReadChunkLength(stream); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("chunkLength: {0:N0}", chunkLength)); + + if (!hasContentLengthHeader) + baseRequest.DownloadLength += chunkLength; + baseRequest.DownloadProgressChanged = this.IsSuccess +#if !BESTHTTP_DISABLE_CACHING + || this.IsFromCache +#endif + ; + } + + VariableSizedBufferPool.Release(buffer); + + if (baseRequest.UseStreaming) + { + if (gzipped) + { + var decompressed = Decompress(null, 0, 0, true); + if (decompressed != null) + FeedStreamFragment(decompressed, 0, decompressed.Length); + } + + FlushRemainingFragmentBuffer(); + } + + // Read the trailing headers or the CRLF + ReadHeaders(stream); + + // HTTP servers sometimes use compression (gzip) or deflate methods to optimize transmission. + // How both chunked and gzip encoding interact is dictated by the two-staged encoding of HTTP: + // first the content stream is encoded as (Content-Encoding: gzip), after which the resulting byte stream is encoded for transfer using another encoder (Transfer-Encoding: chunked). + // This means that in case both compression and chunked encoding are enabled, the chunk encoding itself is not compressed, and the data in each chunk should not be compressed individually. + // The remote endpoint can decode the incoming stream by first decoding it with the Transfer-Encoding, followed by the specified Content-Encoding. + // It would be a better implementation when the chunk would be decododed on-the-fly. Becouse now the whole stream must be downloaded, and then decoded. It needs more memory. + if (!baseRequest.UseStreaming) + this.Data = DecodeStream(output); + } + + CloseDecompressors(); + } + + #endregion + + #region Read Raw Body + + // No transfer-encoding just raw bytes. + internal void ReadRaw(Stream stream, long contentLength) + { + BeginReceiveStreamFragments(); + + // Progress report: + baseRequest.DownloadLength = contentLength; + baseRequest.DownloadProgressChanged = this.IsSuccess +#if !BESTHTTP_DISABLE_CACHING + || this.IsFromCache +#endif + ; + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("ReadRaw - contentLength: {0:N0}", contentLength)); + + string encoding = +#if !BESTHTTP_DISABLE_CACHING + IsFromCache ? null : +#endif + GetFirstHeaderValue("content-encoding"); + bool gzipped = !string.IsNullOrEmpty(encoding) && encoding == "gzip"; + if(!baseRequest.UseStreaming && contentLength > 2147483646) + { + throw new OverflowException("You have to use STREAMING to download files bigger than 2GB!"); + } + + using (var output = new BufferPoolMemoryStream(baseRequest.UseStreaming ? 0 : (int)contentLength)) + { + byte[] buffer = VariableSizedBufferPool.Get(Math.Max(baseRequest.StreamFragmentSize, MinBufferSize), true); + int readBytes = 0; + + while (contentLength > 0) + { + readBytes = 0; + + do + { + int readbuffer = (int)Math.Min(2147483646, (uint)contentLength); + int bytes = stream.Read(buffer, readBytes, Math.Min(readbuffer, buffer.Length - readBytes)); + + if (bytes <= 0) + throw ExceptionHelper.ServerClosedTCPStream(); + + readBytes += bytes; + contentLength -= bytes; + + // Progress report: + baseRequest.Downloaded += bytes; + baseRequest.DownloadProgressChanged = this.IsSuccess +#if !BESTHTTP_DISABLE_CACHING + || this.IsFromCache +#endif + ; + + } while (readBytes < buffer.Length && contentLength > 0); + + if (baseRequest.UseStreaming) + { + if (gzipped) + { + var decompressed = Decompress(buffer, 0, readBytes); + if (decompressed != null) + FeedStreamFragment(decompressed, 0, decompressed.Length); + } + else + FeedStreamFragment(buffer, 0, readBytes); + } + else + output.Write(buffer, 0, readBytes); + }; + + VariableSizedBufferPool.Release(buffer); + + if (baseRequest.UseStreaming) + { + if (gzipped) + { + var decompressed = Decompress(null, 0, 0, true); + if (decompressed != null) + FeedStreamFragment(decompressed, 0, decompressed.Length); + } + + FlushRemainingFragmentBuffer(); + } + + if (!baseRequest.UseStreaming) + this.Data = DecodeStream(output); + } + + CloseDecompressors(); + } + + #endregion + + #region Read Unknown Size + + protected void ReadUnknownSize(Stream stream) + { + string encoding = +#if !BESTHTTP_DISABLE_CACHING + IsFromCache ? null : +#endif + GetFirstHeaderValue("content-encoding"); + bool gzipped = !string.IsNullOrEmpty(encoding) && encoding == "gzip"; + + using (var output = new BufferPoolMemoryStream()) + { + byte[] buffer = VariableSizedBufferPool.Get(Math.Max(baseRequest.StreamFragmentSize, MinBufferSize), false); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("ReadUnknownSize - buffer size: {0:N0}", buffer.Length)); + + int readBytes = 0; + int bytes = 0; + do + { + readBytes = 0; + + do + { + bytes = 0; + +#if !NETFX_CORE || UNITY_EDITOR + NetworkStream networkStream = stream as NetworkStream; + // If we have the good-old NetworkStream, than we can use the DataAvailable property. On WP8 platforms, these are omitted... :/ + if (networkStream != null && baseRequest.EnableSafeReadOnUnknownContentLength) + { + for (int i = readBytes; i < buffer.Length && networkStream.DataAvailable; ++i) + { + int read = stream.ReadByte(); + if (read >= 0) + { + buffer[i] = (byte)read; + bytes++; + } + else + break; + } + } + else // This will be good anyway, but a little slower. +#endif + { + bytes = stream.Read(buffer, readBytes, buffer.Length - readBytes); + } + + readBytes += bytes; + + // Progress report: + baseRequest.Downloaded += bytes; + baseRequest.DownloadLength = baseRequest.Downloaded; + baseRequest.DownloadProgressChanged = this.IsSuccess +#if !BESTHTTP_DISABLE_CACHING + || this.IsFromCache +#endif + ; + + } while (readBytes < buffer.Length && bytes > 0); + + if (baseRequest.UseStreaming) + { + if (gzipped) + { + var decompressed = Decompress(buffer, 0, readBytes); + if (decompressed != null) + FeedStreamFragment(decompressed, 0, decompressed.Length); + } + else + FeedStreamFragment(buffer, 0, readBytes); + } + else + output.Write(buffer, 0, readBytes); + + } while (bytes > 0); + + VariableSizedBufferPool.Release(buffer); + + if (baseRequest.UseStreaming) + { + if (gzipped) + { + var decompressed = Decompress(null, 0, 0, true); + if (decompressed != null) + FeedStreamFragment(decompressed, 0, decompressed.Length); + } + + FlushRemainingFragmentBuffer(); + } + + if (!baseRequest.UseStreaming) + this.Data = DecodeStream(output); + } + + CloseDecompressors(); + } + + #endregion + + #region Stream Decoding + + protected byte[] DecodeStream(BufferPoolMemoryStream streamToDecode) + { + streamToDecode.Seek(0, SeekOrigin.Begin); + + // The cache stores the decoded data + var encoding = +#if !BESTHTTP_DISABLE_CACHING + IsFromCache ? null : +#endif + GetHeaderValues("content-encoding"); + +#if !UNITY_WEBGL || UNITY_EDITOR + Stream decoderStream = null; +#endif + + // Return early if there are no encoding used. + if (encoding == null) + return streamToDecode.ToArray(); + else + { + switch (encoding[0]) + { +#if !UNITY_WEBGL || UNITY_EDITOR + case "gzip": decoderStream = new Decompression.Zlib.GZipStream(streamToDecode, Decompression.Zlib.CompressionMode.Decompress); break; + case "deflate": decoderStream = new Decompression.Zlib.DeflateStream(streamToDecode, Decompression.Zlib.CompressionMode.Decompress); break; +#endif + //identity, utf-8, etc. + default: + // Do not copy from one stream to an other, just return with the raw bytes + return streamToDecode.ToArray(); + } + } + +#if !UNITY_WEBGL || UNITY_EDITOR + using (var ms = new BufferPoolMemoryStream((int)streamToDecode.Length)) + { + var buf = VariableSizedBufferPool.Get(1024, true); + int byteCount = 0; + + while ((byteCount = decoderStream.Read(buf, 0, buf.Length)) > 0) + ms.Write(buf, 0, byteCount); + + VariableSizedBufferPool.Release(buf); + + decoderStream.Dispose(); + return ms.ToArray(); + } +#endif + } + + #endregion + + #region Streaming Fragments Support + + private BufferPoolMemoryStream decompressorInputStream; + private BufferPoolMemoryStream decompressorOutputStream; + private Decompression.Zlib.GZipStream decompressorGZipStream; + + const int MinLengthToDecompress = 256; + + private void CloseDecompressors() + { + if (decompressorGZipStream != null) + decompressorGZipStream.Dispose(); + decompressorGZipStream = null; + + if (decompressorInputStream != null) + decompressorInputStream.Dispose(); + decompressorInputStream = null; + + if (decompressorOutputStream != null) + decompressorOutputStream.Dispose(); + decompressorOutputStream = null; + } + + private byte[] Decompress(byte[] data, int offset, int count, bool forceDecompress = false) + { + if (decompressorInputStream == null) + decompressorInputStream = new BufferPoolMemoryStream(count); + + if (data != null) + decompressorInputStream.Write(data, offset, count); + + if (!forceDecompress && decompressorInputStream.Length < MinLengthToDecompress) + return null; + + decompressorInputStream.Position = 0; + + if (decompressorGZipStream == null) + { + decompressorGZipStream = new Decompression.Zlib.GZipStream(decompressorInputStream, + Decompression.Zlib.CompressionMode.Decompress, + Decompression.Zlib.CompressionLevel.Default, + true); + decompressorGZipStream.FlushMode = Decompression.Zlib.FlushType.Sync; + } + + if (decompressorOutputStream == null) + decompressorOutputStream = new BufferPoolMemoryStream(); + decompressorOutputStream.SetLength(0); + + byte[] copyBuffer = VariableSizedBufferPool.Get(1024, true); + + int readCount; + while ((readCount = decompressorGZipStream.Read(copyBuffer, 0, copyBuffer.Length)) != 0) + decompressorOutputStream.Write(copyBuffer, 0, readCount); + + VariableSizedBufferPool.Release(copyBuffer); + + decompressorGZipStream.SetLength(0); + + // TODO: be able to use a larger array + byte[] result = decompressorOutputStream.ToArray(); + + return result; + } + + protected void BeginReceiveStreamFragments() + { +#if !BESTHTTP_DISABLE_CACHING + if (!baseRequest.DisableCache && baseRequest.UseStreaming) + { + // If caching is enabled and the response not from cache and it's cacheble we will cache the downloaded data. + if (!IsFromCache && HTTPCacheService.IsCacheble(baseRequest.CurrentUri, baseRequest.MethodType, this)) + cacheStream = HTTPCacheService.PrepareStreamed(baseRequest.CurrentUri, this); + } +#endif + allFragmentSize = 0; + } + + /// + /// Add data to the fragments list. + /// + /// The buffer to be added. + /// The position where we start copy the data. + /// How many data we want to copy. + protected void FeedStreamFragment(byte[] buffer, int pos, int length) + { + if (buffer == null || length == 0) + return; + + // If reading from cache, we don't want to read too much data to memory. So we will wait until the loaded fragment processed. + WaitWhileFragmentQueueIsFull(); + + if (fragmentBuffer == null) + { + fragmentBuffer = VariableSizedBufferPool.Get(baseRequest.StreamFragmentSize, false); + fragmentBufferDataLength = 0; + } + + if (fragmentBufferDataLength + length <= baseRequest.StreamFragmentSize) + { + Array.Copy(buffer, pos, fragmentBuffer, fragmentBufferDataLength, length); + fragmentBufferDataLength += length; + + if (fragmentBufferDataLength == baseRequest.StreamFragmentSize) + { + AddStreamedFragment(fragmentBuffer); + fragmentBuffer = null; + fragmentBufferDataLength = 0; + } + } + else + { + int remaining = baseRequest.StreamFragmentSize - fragmentBufferDataLength; + + FeedStreamFragment(buffer, pos, remaining); + FeedStreamFragment(buffer, pos + remaining, length - remaining); + } + } + + protected void FlushRemainingFragmentBuffer() + { + if (fragmentBuffer != null) + { + VariableSizedBufferPool.Resize(ref fragmentBuffer, fragmentBufferDataLength, false); + + AddStreamedFragment(fragmentBuffer); + fragmentBuffer = null; + fragmentBufferDataLength = 0; + } + +#if !BESTHTTP_DISABLE_CACHING + if (cacheStream != null) + { + cacheStream.Dispose(); + cacheStream = null; + + HTTPCacheService.SetBodyLength(baseRequest.CurrentUri, allFragmentSize); + } +#endif + var tmp = fragmentWaitEvent; + fragmentWaitEvent = null; + if (tmp != null) + (tmp as IDisposable).Dispose(); + } + + protected void AddStreamedFragment(byte[] buffer) + { + lock (SyncRoot) + { +#if !BESTHTTP_DISABLE_CACHING + if (!IsCacheOnly) +#endif + { + if (streamedFragments == null) + streamedFragments = new List(); + + streamedFragments.Add(buffer); + } + + if (HTTPManager.Logger.Level == Logger.Loglevels.All && buffer != null && streamedFragments != null) + VerboseLogging(string.Format("AddStreamedFragment buffer length: {0:N0} streamedFragments: {1:N0}", buffer.Length, streamedFragments.Count)); + +#if !BESTHTTP_DISABLE_CACHING + if (cacheStream != null) + { + cacheStream.Write(buffer, 0, buffer.Length); + allFragmentSize += buffer.Length; + } +#endif + } + } + + private volatile System.Threading.AutoResetEvent fragmentWaitEvent; +#pragma warning disable 1998 + protected +#if NETFX_CORE + async +#endif + void WaitWhileFragmentQueueIsFull() + { +#if !UNITY_WEBGL || UNITY_EDITOR + while (baseRequest.UseStreaming && FragmentQueueIsFull()) + { + VerboseLogging("WaitWhileFragmentQueueIsFull"); + + if (fragmentWaitEvent == null) + fragmentWaitEvent = new System.Threading.AutoResetEvent(false); + fragmentWaitEvent.WaitOne(16); + } +#endif + } + +#pragma warning restore 1998 + + bool FragmentQueueIsFull() + { + lock (SyncRoot) + { + bool result = streamedFragments != null && streamedFragments.Count >= baseRequest.MaxFragmentQueueLength; + if (result && HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("HasFragmentsInQueue - {0} / {1}", streamedFragments.Count, baseRequest.MaxFragmentQueueLength)); + + return result; + } + } + + /// + /// If streaming is used, then every time this callback function called we can use this function to + /// retrieve the downloaded and buffered data. The returned list can be null, if there is no data yet. + /// + /// + public List GetStreamedFragments() + { + lock (SyncRoot) + { + if (streamedFragments == null || streamedFragments.Count == 0) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging("GetStreamedFragments - no fragments, returning with null"); + return null; + } + + var result = new List(streamedFragments); + streamedFragments.Clear(); + + if (fragmentWaitEvent != null) + fragmentWaitEvent.Set(); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging(string.Format("GetStreamedFragments - returning with {0:N0} fragments", result.Count.ToString())); + + return result; + } + } + + internal bool HasStreamedFragments() + { + lock (SyncRoot) + return streamedFragments != null && streamedFragments.Count >= baseRequest.MaxFragmentQueueLength; + } + + internal void FinishStreaming() + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + VerboseLogging("FinishStreaming"); + + IsStreamingFinished = true; + Dispose(); + } + + #endregion + + void VerboseLogging(string str) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("HTTPResponse", "'" + this.baseRequest.CurrentUri.ToString() + "' - " + str); + } + + /// + /// IDisposable implementation. + /// + public void Dispose() + { + // Release resources in case we are using ReadOnlyBufferedStream, it will not close its inner stream. + // Otherwise, closing the (inner) Stream is the connection's responsibility + if (Stream != null && Stream is ReadOnlyBufferedStream) + (Stream as IDisposable).Dispose(); + Stream = null; + +#if !BESTHTTP_DISABLE_CACHING + if (cacheStream != null) + { + cacheStream.Dispose(); + cacheStream = null; + } +#endif + GC.SuppressFinalize(this); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPResponse.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPResponse.cs.meta new file mode 100644 index 00000000..7792ad90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPResponse.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 555ceb051cbef0648b81ad42a853d672 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPUpdateDelegator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPUpdateDelegator.cs new file mode 100644 index 00000000..01106d0e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPUpdateDelegator.cs @@ -0,0 +1,257 @@ +using UnityEngine; + +#if NETFX_CORE || BUILD_FOR_WP8 + using System.Threading.Tasks; +#endif + +namespace BestHTTP +{ + /// + /// Will route some U3D calls to the HTTPManager. + /// + [ExecuteInEditMode] + public sealed class HTTPUpdateDelegator : MonoBehaviour + { + #region Public Properties + + /// + /// The singleton instance of the HTTPUpdateDelegator + /// + public static HTTPUpdateDelegator Instance { get; private set; } + + /// + /// True, if the Instance property should hold a valid value. + /// + public static bool IsCreated { get; private set; } + + /// + /// Set it true before any CheckInstance() call, or before any request sent to dispatch callbacks on another thread. + /// + public static bool IsThreaded { get; set; } + + /// + /// It's true if the dispatch thread running. + /// + public static bool IsThreadRunning { get; private set; } + + /// + /// How much time the plugin should wait between two update call. Its default value 100 ms. + /// + public static int ThreadFrequencyInMS { get; set; } + + /// + /// Called in the OnApplicationQuit function. If this function returns False, the plugin will not start to + /// shut down itself. + /// + public static System.Func OnBeforeApplicationQuit; + + public static System.Action OnApplicationForegroundStateChanged; + + #endregion + + private static bool IsSetupCalled; + + static HTTPUpdateDelegator() + { + ThreadFrequencyInMS = 100; + } + + /// + /// Will create the HTTPUpdateDelegator instance and set it up. + /// + public static void CheckInstance() + { + try + { + if (!IsCreated) + { + GameObject go = GameObject.Find("HTTP Update Delegator"); + + if (go != null) + Instance = go.GetComponent(); + + if (Instance == null) + { + go = new GameObject("HTTP Update Delegator"); + go.hideFlags = HideFlags.DontSave; + + Instance = go.AddComponent(); + } + IsCreated = true; + +#if UNITY_EDITOR + if (!UnityEditor.EditorApplication.isPlaying) + { + UnityEditor.EditorApplication.update -= Instance.Update; + UnityEditor.EditorApplication.update += Instance.Update; + } + +#if UNITY_2017_2_OR_NEWER + UnityEditor.EditorApplication.playModeStateChanged -= Instance.OnPlayModeStateChanged; + UnityEditor.EditorApplication.playModeStateChanged += Instance.OnPlayModeStateChanged; +#else + UnityEditor.EditorApplication.playmodeStateChanged -= Instance.OnPlayModeStateChanged; + UnityEditor.EditorApplication.playmodeStateChanged += Instance.OnPlayModeStateChanged; +#endif +#endif + HTTPManager.Logger.Information("HTTPUpdateDelegator", "Instance Created!"); + } + } + catch + { + HTTPManager.Logger.Error("HTTPUpdateDelegator", "Please call the BestHTTP.HTTPManager.Setup() from one of Unity's event(eg. awake, start) before you send any request!"); + } + } + + private void Setup() + { +#if !BESTHTTP_DISABLE_CACHING + Caching.HTTPCacheService.SetupCacheFolder(); +#endif + +#if !BESTHTTP_DISABLE_COOKIES + Cookies.CookieJar.SetupFolder(); + Cookies.CookieJar.Load(); +#endif + +#if UNITY_WEBGL && !UNITY_EDITOR + // Threads are not implemented in WEBGL builds, disable it for now. + IsThreaded = false; +#endif + if (IsThreaded) + { +#if NETFX_CORE +#pragma warning disable 4014 + Windows.System.Threading.ThreadPool.RunAsync(ThreadFunc); +#pragma warning restore 4014 +#else + System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(ThreadFunc)); +#endif + } + + IsSetupCalled = true; + + // Unity doesn't tolerate well if the DontDestroyOnLoad called when purely in editor mode. So, we will set the flag + // only when we are playing, or not in the editor. + if (!Application.isEditor || Application.isPlaying) + GameObject.DontDestroyOnLoad(this.gameObject); + + HTTPManager.Logger.Information("HTTPUpdateDelegator", "Setup done!"); + } + +#if NETFX_CORE + async +#endif + void ThreadFunc(object obj) + { + HTTPManager.Logger.Information ("HTTPUpdateDelegator", "Update Thread Started"); + + try + { + IsThreadRunning = true; + while (IsThreadRunning) + { + HTTPManager.OnUpdate(); + +#if NETFX_CORE + await Task.Delay(ThreadFrequencyInMS); +#else + System.Threading.Thread.Sleep(ThreadFrequencyInMS); +#endif + } + } + finally + { + HTTPManager.Logger.Information("HTTPUpdateDelegator", "Update Thread Ended"); + } + } + + void Update() + { + if (!IsSetupCalled) + { + IsSetupCalled = true; + Setup(); + } + + if (!IsThreaded) + HTTPManager.OnUpdate(); + } + +#if UNITY_EDITOR +#if UNITY_2017_2_OR_NEWER + void OnPlayModeStateChanged(UnityEditor.PlayModeStateChange playMode) + { + if (playMode == UnityEditor.PlayModeStateChange.EnteredPlayMode) + UnityEditor.EditorApplication.update -= Update; + else if (playMode == UnityEditor.PlayModeStateChange.ExitingPlayMode) + UnityEditor.EditorApplication.update += Update; + } +#else + void OnPlayModeStateChanged() + { + if (UnityEditor.EditorApplication.isPlaying) + UnityEditor.EditorApplication.update -= Update; + else if (!UnityEditor.EditorApplication.isPlaying) + UnityEditor.EditorApplication.update += Update; + } + +#endif +#endif + + void OnDisable() + { + HTTPManager.Logger.Information("HTTPUpdateDelegator", "OnDisable Called!"); + +#if UNITY_EDITOR + if (UnityEditor.EditorApplication.isPlaying) +#endif + OnApplicationQuit(); + } + + void OnApplicationPause(bool isPaused) + { + if (HTTPUpdateDelegator.OnApplicationForegroundStateChanged != null) + HTTPUpdateDelegator.OnApplicationForegroundStateChanged(isPaused); + } + + void OnApplicationQuit() + { + HTTPManager.Logger.Information("HTTPUpdateDelegator", "OnApplicationQuit Called!"); + + if (OnBeforeApplicationQuit != null) + { + try + { + if (!OnBeforeApplicationQuit()) + { + HTTPManager.Logger.Information("HTTPUpdateDelegator", "OnBeforeApplicationQuit call returned false, postponing plugin shutdown."); + return; + } + } + catch(System.Exception ex) + { + HTTPManager.Logger.Exception("HTTPUpdateDelegator", string.Empty, ex); + } + } + + IsThreadRunning = false; + + if (!IsCreated) + return; + + IsCreated = false; + + HTTPManager.OnQuit(); + +#if UNITY_EDITOR + UnityEditor.EditorApplication.update -= Update; +#if UNITY_2017_2_OR_NEWER + UnityEditor.EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; +#else + UnityEditor.EditorApplication.playmodeStateChanged -= OnPlayModeStateChanged; +#endif +#endif + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPUpdateDelegator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPUpdateDelegator.cs.meta new file mode 100644 index 00000000..0ea19214 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/HTTPUpdateDelegator.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 232e901bb55e034408a6e54c43880ed6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON.meta new file mode 100644 index 00000000..e2b1bb5d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e64190d0765d2dc4597de64694e99b53 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON/JSON.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON/JSON.cs new file mode 100644 index 00000000..ccfef9e5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON/JSON.cs @@ -0,0 +1,487 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Text; + +namespace BestHTTP.JSON +{ + /// + /// Based on the download from http://techblog.procurios.nl/k/news/view/14605/14863/how-do-i-write-my-own-parser-%28for-json%29.html + /// This class encodes and decodes JSON strings. + /// Spec. details, see http://www.json.org/ + /// + /// JSON uses Arrays and Objects. These correspond here to the datatypes List and Dictionary. + /// All numbers are parsed to doubles. + /// + public class Json + { + private const int TOKEN_NONE = 0; + private const int TOKEN_CURLY_OPEN = 1; + private const int TOKEN_CURLY_CLOSE = 2; + private const int TOKEN_SQUARED_OPEN = 3; + private const int TOKEN_SQUARED_CLOSE = 4; + private const int TOKEN_COLON = 5; + private const int TOKEN_COMMA = 6; + private const int TOKEN_STRING = 7; + private const int TOKEN_NUMBER = 8; + private const int TOKEN_TRUE = 9; + private const int TOKEN_FALSE = 10; + private const int TOKEN_NULL = 11; + + private const int BUILDER_CAPACITY = 2000; + + /// + /// Parses the string json into a value + /// + /// A JSON string. + /// A List, a Dictionary, a double, a string, null, true, or false + public static object Decode(string json) + { + bool success = true; + + return Decode(json, ref success); + } + + /// + /// Parses the string json into a value; and fills 'success' with the successfullness of the parse. + /// + /// A JSON string. + /// Successful parse? + /// A List, a Dictionary, a double, a string, null, true, or false + public static object Decode(string json, ref bool success) + { + success = true; + if (json != null) { + char[] charArray = json.ToCharArray(); + int index = 0; + object value = ParseValue(charArray, ref index, ref success); + return value; + } else { + return null; + } + } + + /// + /// Converts a Dictionary / List object into a JSON string + /// + /// A Dictionary / List + /// A JSON encoded string, or null if object 'json' is not serializable + public static string Encode(object json) + { + StringBuilder builder = new StringBuilder(BUILDER_CAPACITY); + bool success = SerializeValue(json, builder); + return (success ? builder.ToString() : null); + } + + protected static Dictionary ParseObject(char[] json, ref int index, ref bool success) + { + Dictionary table = new Dictionary(); + int token; + + // { + NextToken(json, ref index); + + bool done = false; + while (!done) { + token = LookAhead(json, index); + if (token == Json.TOKEN_NONE) { + success = false; + return null; + } else if (token == Json.TOKEN_COMMA) { + NextToken(json, ref index); + } else if (token == Json.TOKEN_CURLY_CLOSE) { + NextToken(json, ref index); + return table; + } else { + + // name + string name = ParseString(json, ref index, ref success); + if (!success) { + success = false; + return null; + } + + // : + token = NextToken(json, ref index); + if (token != Json.TOKEN_COLON) { + success = false; + return null; + } + + // value + object value = ParseValue(json, ref index, ref success); + if (!success) { + success = false; + return null; + } + + table[name] = value; + } + } + + return table; + } + + protected static List ParseArray(char[] json, ref int index, ref bool success) + { + List array = new List(); + + // [ + NextToken(json, ref index); + + bool done = false; + while (!done) { + int token = LookAhead(json, index); + if (token == Json.TOKEN_NONE) { + success = false; + return null; + } else if (token == Json.TOKEN_COMMA) { + NextToken(json, ref index); + } else if (token == Json.TOKEN_SQUARED_CLOSE) { + NextToken(json, ref index); + break; + } else { + object value = ParseValue(json, ref index, ref success); + if (!success) { + return null; + } + + array.Add(value); + } + } + + return array; + } + + protected static object ParseValue(char[] json, ref int index, ref bool success) + { + switch (LookAhead(json, index)) { + case Json.TOKEN_STRING: + return ParseString(json, ref index, ref success); + case Json.TOKEN_NUMBER: + return ParseNumber(json, ref index, ref success); + case Json.TOKEN_CURLY_OPEN: + return ParseObject(json, ref index, ref success); + case Json.TOKEN_SQUARED_OPEN: + return ParseArray(json, ref index, ref success); + case Json.TOKEN_TRUE: + NextToken(json, ref index); + return true; + case Json.TOKEN_FALSE: + NextToken(json, ref index); + return false; + case Json.TOKEN_NULL: + NextToken(json, ref index); + return null; + case Json.TOKEN_NONE: + break; + } + + success = false; + return null; + } + + protected static string ParseString(char[] json, ref int index, ref bool success) + { + StringBuilder s = new StringBuilder(BUILDER_CAPACITY); + char c; + + EatWhitespace(json, ref index); + + // " + c = json[index++]; + + bool complete = false; + while (!complete) { + + if (index == json.Length) { + break; + } + + c = json[index++]; + if (c == '"') { + complete = true; + break; + } else if (c == '\\') { + + if (index == json.Length) { + break; + } + c = json[index++]; + if (c == '"') { + s.Append('"'); + } else if (c == '\\') { + s.Append('\\'); + } else if (c == '/') { + s.Append('/'); + } else if (c == 'b') { + s.Append('\b'); + } else if (c == 'f') { + s.Append('\f'); + } else if (c == 'n') { + s.Append('\n'); + } else if (c == 'r') { + s.Append('\r'); + } else if (c == 't') { + s.Append('\t'); + } else if (c == 'u') { + int remainingLength = json.Length - index; + if (remainingLength >= 4) { + // parse the 32 bit hex into an integer codepoint + uint codePoint; + if (!(success = UInt32.TryParse(new string(json, index, 4), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out codePoint))) { + return ""; + } + // convert the integer codepoint to a unicode char and add to string + s.Append(Char.ConvertFromUtf32((int)codePoint)); + // skip 4 chars + index += 4; + } else { + break; + } + } + + } else { + s.Append(c); + } + + } + + if (!complete) { + success = false; + return null; + } + + return s.ToString(); + } + + protected static double ParseNumber(char[] json, ref int index, ref bool success) + { + EatWhitespace(json, ref index); + + int lastIndex = GetLastIndexOfNumber(json, index); + int charLength = (lastIndex - index) + 1; + + double number; + success = Double.TryParse(new string(json, index, charLength), NumberStyles.Any, CultureInfo.InvariantCulture, out number); + + index = lastIndex + 1; + return number; + } + + protected static int GetLastIndexOfNumber(char[] json, int index) + { + int lastIndex; + + for (lastIndex = index; lastIndex < json.Length; lastIndex++) { + if ("0123456789+-.eE".IndexOf(json[lastIndex]) == -1) { + break; + } + } + return lastIndex - 1; + } + + protected static void EatWhitespace(char[] json, ref int index) + { + for (; index < json.Length; index++) { + if (" \t\n\r".IndexOf(json[index]) == -1) { + break; + } + } + } + + protected static int LookAhead(char[] json, int index) + { + int saveIndex = index; + return NextToken(json, ref saveIndex); + } + + protected static int NextToken(char[] json, ref int index) + { + EatWhitespace(json, ref index); + + if (index == json.Length) { + return Json.TOKEN_NONE; + } + + char c = json[index]; + index++; + switch (c) { + case '{': + return Json.TOKEN_CURLY_OPEN; + case '}': + return Json.TOKEN_CURLY_CLOSE; + case '[': + return Json.TOKEN_SQUARED_OPEN; + case ']': + return Json.TOKEN_SQUARED_CLOSE; + case ',': + return Json.TOKEN_COMMA; + case '"': + return Json.TOKEN_STRING; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + case '-': + return Json.TOKEN_NUMBER; + case ':': + return Json.TOKEN_COLON; + } + index--; + + int remainingLength = json.Length - index; + + // false + if (remainingLength >= 5) { + if (json[index] == 'f' && + json[index + 1] == 'a' && + json[index + 2] == 'l' && + json[index + 3] == 's' && + json[index + 4] == 'e') { + index += 5; + return Json.TOKEN_FALSE; + } + } + + // true + if (remainingLength >= 4) { + if (json[index] == 't' && + json[index + 1] == 'r' && + json[index + 2] == 'u' && + json[index + 3] == 'e') { + index += 4; + return Json.TOKEN_TRUE; + } + } + + // null + if (remainingLength >= 4) { + if (json[index] == 'n' && + json[index + 1] == 'u' && + json[index + 2] == 'l' && + json[index + 3] == 'l') { + index += 4; + return Json.TOKEN_NULL; + } + } + + return Json.TOKEN_NONE; + } + + protected static bool SerializeValue(object value, StringBuilder builder) + { + bool success = true; + + if (value is string) { + success = SerializeString((string)value, builder); + } else if (value is IDictionary) { + success = SerializeObject((IDictionary)value, builder); + } else if (value is IList) { + success = SerializeArray(value as IList, builder); + } else if ((value is Boolean) && ((Boolean)value == true)) { + builder.Append("true"); + } else if ((value is Boolean) && ((Boolean)value == false)) { + builder.Append("false"); + } else if (value is ValueType) { + // thanks to ritchie for pointing out ValueType to me + success = SerializeNumber(Convert.ToDouble(value), builder); + } else if (value == null) { + builder.Append("null"); + } else { + success = false; + } + return success; + } + + protected static bool SerializeObject(IDictionary anObject, StringBuilder builder) + { + builder.Append("{"); + + IDictionaryEnumerator e = anObject.GetEnumerator(); + bool first = true; + while (e.MoveNext()) { + string key = e.Key.ToString(); + object value = e.Value; + + if (!first) { + builder.Append(", "); + } + + SerializeString(key, builder); + builder.Append(":"); + if (!SerializeValue(value, builder)) { + return false; + } + + first = false; + } + + builder.Append("}"); + return true; + } + + protected static bool SerializeArray(IList anArray, StringBuilder builder) + { + builder.Append("["); + + bool first = true; + for (int i = 0; i < anArray.Count; i++) { + object value = anArray[i]; + + if (!first) { + builder.Append(", "); + } + + if (!SerializeValue(value, builder)) { + return false; + } + + first = false; + } + + builder.Append("]"); + return true; + } + + protected static bool SerializeString(string aString, StringBuilder builder) + { + builder.Append("\""); + + char[] charArray = aString.ToCharArray(); + for (int i = 0; i < charArray.Length; i++) { + char c = charArray[i]; + if (c == '"') { + builder.Append("\\\""); + } else if (c == '\\') { + builder.Append("\\\\"); + } else if (c == '\b') { + builder.Append("\\b"); + } else if (c == '\f') { + builder.Append("\\f"); + } else if (c == '\n') { + builder.Append("\\n"); + } else if (c == '\r') { + builder.Append("\\r"); + } else if (c == '\t') { + builder.Append("\\t"); + } else { + int codepoint = Convert.ToInt32(c); + if ((codepoint >= 32) && (codepoint <= 126)) { + builder.Append(c); + } else { + builder.Append("\\u" + Convert.ToString(codepoint, 16).PadLeft(4, '0')); + } + } + } + + builder.Append("\""); + return true; + } + + protected static bool SerializeNumber(double number, StringBuilder builder) + { + builder.Append(Convert.ToString(number, CultureInfo.InvariantCulture)); + return true; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON/JSON.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON/JSON.cs.meta new file mode 100644 index 00000000..ae551789 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/JSON/JSON.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 60c48240ba404f04db57f061215d0f36 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger.meta new file mode 100644 index 00000000..812d0971 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 603b8a5653cd7d84ab97cc7367e95682 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/DefaultLogger.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/DefaultLogger.cs new file mode 100644 index 00000000..24f5888c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/DefaultLogger.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Logger +{ + /// + /// A basic logger implementation to be able to log intelligently additional informations about the plugin's internal mechanism. + /// + public class DefaultLogger : BestHTTP.Logger.ILogger + { + public Loglevels Level { get; set; } + public string FormatVerbose { get; set; } + public string FormatInfo { get; set; } + public string FormatWarn { get; set; } + public string FormatErr { get; set; } + public string FormatEx { get; set; } + + public DefaultLogger() + { + FormatVerbose = "[{0}] D [{1}]: {2}"; + FormatInfo = "[{0}] I [{1}]: {2}"; + FormatWarn = "[{0}] W [{1}]: {2}"; + FormatErr = "[{0}] Err [{1}]: {2}"; + FormatEx = "[{0}] Ex [{1}]: {2} - Message: {3} StackTrace: {4}"; + + Level = UnityEngine.Debug.isDebugBuild ? Loglevels.Warning : Loglevels.Error; + } + + public void Verbose(string division, string verb) + { + if (Level <= Loglevels.All) + { + try + { + UnityEngine.Debug.Log(string.Format(FormatVerbose, GetFormattedTime(), division, verb)); + } + catch + { } + } + } + + public void Information(string division, string info) + { + if (Level <= Loglevels.Information) + { + try + { + UnityEngine.Debug.Log(string.Format(FormatInfo, GetFormattedTime(), division, info)); + } + catch + { } + } + } + + public void Warning(string division, string warn) + { + if (Level <= Loglevels.Warning) + { + try + { + UnityEngine.Debug.LogWarning(string.Format(FormatWarn, GetFormattedTime(), division, warn)); + } + catch + { } + } + } + + public void Error(string division, string err) + { + if (Level <= Loglevels.Error) + { + try + { + UnityEngine.Debug.LogError(string.Format(FormatErr, GetFormattedTime(), division, err)); + } + catch + { } + } + } + + public void Exception(string division, string msg, Exception ex) + { + if (Level <= Loglevels.Exception) + { + try + { + string exceptionMessage = string.Empty; + if (ex == null) + exceptionMessage = "null"; + else + { + StringBuilder sb = new StringBuilder(); + + Exception exception = ex; + int counter = 1; + while (exception != null) + { + sb.AppendFormat("{0}: {1} {2}", counter++.ToString(), exception.Message, exception.StackTrace); + + exception = exception.InnerException; + + if (exception != null) + sb.AppendLine(); + } + + exceptionMessage = sb.ToString(); + } + + UnityEngine.Debug.LogError(string.Format(FormatEx, + GetFormattedTime(), + division, + msg, + exceptionMessage, + ex != null ? ex.StackTrace : "null")); + } + catch + { } + } + } + + private string GetFormattedTime() + { + return DateTime.Now.Ticks.ToString(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/DefaultLogger.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/DefaultLogger.cs.meta new file mode 100644 index 00000000..6138af61 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/DefaultLogger.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f0c6097670314f141ad42c8060f64ecb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/ILogger.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/ILogger.cs new file mode 100644 index 00000000..841b041c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/ILogger.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BestHTTP.Logger +{ + /// + /// Available logging levels. + /// + public enum Loglevels : byte + { + /// + /// All message will be logged. + /// + All, + + /// + /// Only Informations and above will be logged. + /// + Information, + + /// + /// Only Warnings and above will be logged. + /// + Warning, + + /// + /// Only Errors and above will be logged. + /// + Error, + + /// + /// Only Exceptions will be logged. + /// + Exception, + + /// + /// No logging will occur. + /// + None + } + + public interface ILogger + { + /// + /// The minimum severity to log + /// + Loglevels Level { get; set; } + string FormatVerbose { get; set; } + string FormatInfo { get; set; } + string FormatWarn { get; set; } + string FormatErr { get; set; } + string FormatEx { get; set; } + + void Verbose(string division, string verb); + void Information(string division, string info); + void Warning(string division, string warn); + void Error(string division, string err); + void Exception(string division, string msg, Exception ex); + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/ILogger.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/ILogger.cs.meta new file mode 100644 index 00000000..b0933940 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Logger/ILogger.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 41bbbfdb18d1d6f479d52229e8e4e827 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport.meta new file mode 100644 index 00000000..49315e33 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 164dda27bfff2e7449444d94e5c7de32 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections.meta new file mode 100644 index 00000000..672d0460 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f8b56237e32291c40859f2f1660759d9 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel.meta new file mode 100644 index 00000000..d2085d2f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e58ef16077b4b374b806509cec119484 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel/ObservableDictionary.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel/ObservableDictionary.cs new file mode 100644 index 00000000..5cfdd728 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel/ObservableDictionary.cs @@ -0,0 +1,263 @@ +using System; +using System.Linq; +using System.ComponentModel; +using System.Collections.Generic; +using System.Collections; + +#if NETFX_CORE + using specialized = System.Collections.Specialized; +#else + using specialized = PlatformSupport.Collections.Specialized; +#endif + +namespace PlatformSupport.Collections.ObjectModel +{ + public class ObservableDictionary : IDictionary, specialized.INotifyCollectionChanged, INotifyPropertyChanged + { + private const string CountString = "Count"; + private const string IndexerName = "Item[]"; + private const string KeysName = "Keys"; + private const string ValuesName = "Values"; + + private IDictionary _Dictionary; + protected IDictionary Dictionary + { + get { return _Dictionary; } + } + +#region Constructors + public ObservableDictionary() + { + _Dictionary = new Dictionary(); + } + public ObservableDictionary(IDictionary dictionary) + { + _Dictionary = new Dictionary(dictionary); + } + public ObservableDictionary(IEqualityComparer comparer) + { + _Dictionary = new Dictionary(comparer); + } + public ObservableDictionary(int capacity) + { + _Dictionary = new Dictionary(capacity); + } + public ObservableDictionary(IDictionary dictionary, IEqualityComparer comparer) + { + _Dictionary = new Dictionary(dictionary, comparer); + } + public ObservableDictionary(int capacity, IEqualityComparer comparer) + { + _Dictionary = new Dictionary(capacity, comparer); + } +#endregion + +#region IDictionary Members + + public void Add(TKey key, TValue value) + { + Insert(key, value, true); + } + + public bool ContainsKey(TKey key) + { + return Dictionary.ContainsKey(key); + } + + public ICollection Keys + { + get { return Dictionary.Keys; } + } + + public bool Remove(TKey key) + { + if (key == null) throw new ArgumentNullException("key"); + + TValue value; + Dictionary.TryGetValue(key, out value); + var removed = Dictionary.Remove(key); + if (removed) + + //OnCollectionChanged(NotifyCollectionChangedAction.Remove, new KeyValuePair(key, value)); + OnCollectionChanged(); + + + return removed; + } + + public bool TryGetValue(TKey key, out TValue value) + { + return Dictionary.TryGetValue(key, out value); + } + + public ICollection Values + { + get { return Dictionary.Values; } + } + + public TValue this[TKey key] + { + get + { + return Dictionary[key]; + } + set + { + Insert(key, value, false); + } + } + +#endregion + +#region ICollection> Members + + public void Add(KeyValuePair item) + { + Insert(item.Key, item.Value, true); + } + + public void Clear() + { + if (Dictionary.Count > 0) + { + Dictionary.Clear(); + OnCollectionChanged(); + } + } + + public bool Contains(KeyValuePair item) + { + return Dictionary.Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + Dictionary.CopyTo(array, arrayIndex); + } + + public int Count + { + get { return Dictionary.Count; } + } + + public bool IsReadOnly + { + get { return Dictionary.IsReadOnly; } + } + + public bool Remove(KeyValuePair item) + { + return Remove(item.Key); + } + +#endregion + +#region IEnumerable> Members + + public IEnumerator> GetEnumerator() + { + return Dictionary.GetEnumerator(); + } + +#endregion + +#region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable)Dictionary).GetEnumerator(); + } + +#endregion + +#region INotifyCollectionChanged Members + + public event specialized.NotifyCollectionChangedEventHandler CollectionChanged; + +#endregion + +#region INotifyPropertyChanged Members + + public event PropertyChangedEventHandler PropertyChanged; + +#endregion + + public void AddRange(IDictionary items) + { + if (items == null) throw new ArgumentNullException("items"); + + if (items.Count > 0) + { + if (Dictionary.Count > 0) + { + if (items.Keys.Any((k) => Dictionary.ContainsKey(k))) + throw new ArgumentException("An item with the same key has already been added."); + else + foreach (var item in items) Dictionary.Add(item); + } + else + _Dictionary = new Dictionary(items); + + OnCollectionChanged(specialized.NotifyCollectionChangedAction.Add, items.ToArray()); + } + } + + private void Insert(TKey key, TValue value, bool add) + { + if (key == null) throw new ArgumentNullException("key"); + + TValue item; + if (Dictionary.TryGetValue(key, out item)) + { + if (add) throw new ArgumentException("An item with the same key has already been added."); + if (Equals(item, value)) return; + Dictionary[key] = value; + + OnCollectionChanged(specialized.NotifyCollectionChangedAction.Replace, new KeyValuePair(key, value), new KeyValuePair(key, item)); + } + else + { + Dictionary[key] = value; + + OnCollectionChanged(specialized.NotifyCollectionChangedAction.Add, new KeyValuePair(key, value)); + } + } + + private void OnPropertyChanged() + { + OnPropertyChanged(CountString); + OnPropertyChanged(IndexerName); + OnPropertyChanged(KeysName); + OnPropertyChanged(ValuesName); + } + + protected virtual void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + + private void OnCollectionChanged() + { + OnPropertyChanged(); + if (CollectionChanged != null) CollectionChanged(this, new specialized.NotifyCollectionChangedEventArgs(specialized.NotifyCollectionChangedAction.Reset)); + } + + private void OnCollectionChanged(specialized.NotifyCollectionChangedAction action, KeyValuePair changedItem) + { + OnPropertyChanged(); + if (CollectionChanged != null) CollectionChanged(this, new specialized.NotifyCollectionChangedEventArgs(action, changedItem)); + } + + private void OnCollectionChanged(specialized.NotifyCollectionChangedAction action, KeyValuePair newItem, KeyValuePair oldItem) + { + OnPropertyChanged(); + if (CollectionChanged != null) CollectionChanged(this, new specialized.NotifyCollectionChangedEventArgs(action, newItem, oldItem)); + } + + private void OnCollectionChanged(specialized.NotifyCollectionChangedAction action, IList newItems) + { + OnPropertyChanged(); + if (CollectionChanged != null) CollectionChanged(this, new specialized.NotifyCollectionChangedEventArgs(action, newItems)); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel/ObservableDictionary.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel/ObservableDictionary.cs.meta new file mode 100644 index 00000000..2fa1dc41 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/ObjectModel/ObservableDictionary.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b5467f7e4679aea4bbadc541e674c23d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized.meta new file mode 100644 index 00000000..2815645a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ed08c64055c2bad49888497192d9980b +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized/NotifyCollectionChangedEventArgs.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized/NotifyCollectionChangedEventArgs.cs new file mode 100644 index 00000000..79df06bb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized/NotifyCollectionChangedEventArgs.cs @@ -0,0 +1,467 @@ +#if !NETFX_CORE +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections; +using System.Diagnostics; + +namespace PlatformSupport.Collections.Specialized +{ + public delegate void NotifyCollectionChangedEventHandler(object sender, PlatformSupport.Collections.Specialized.NotifyCollectionChangedEventArgs e); + + public interface INotifyCollectionChanged + { + event NotifyCollectionChangedEventHandler CollectionChanged; + } + + /// + /// This enum describes the action that caused a CollectionChanged event. + /// + public enum NotifyCollectionChangedAction + { + /// One or more items were added to the collection. + Add, + /// One or more items were removed from the collection. + Remove, + /// One or more items were replaced in the collection. + Replace, + /// One or more items were moved within the collection. + Move, + /// The contents of the collection changed dramatically. + Reset, + } + + /// + /// Arguments for the CollectionChanged event. + /// A collection that supports INotifyCollectionChangedThis raises this event + /// whenever an item is added or removed, or when the contents of the collection + /// changes dramatically. + /// + public class NotifyCollectionChangedEventArgs : EventArgs + { + //------------------------------------------------------ + // + // Constructors + // + //------------------------------------------------------ + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a reset change. + /// + /// The action that caused the event (must be Reset). + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action) + { + if (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Reset) + throw new ArgumentException("action"); + + InitializeAdd(action, null, -1); + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a one-item change. + /// + /// The action that caused the event; can only be Reset, Add or Remove action. + /// The item affected by the change. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, object changedItem) + { + if ((action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Add) && (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Remove) + && (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Reset)) + throw new ArgumentException("action"); + + if (action == PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Reset) + { + if (changedItem != null) + throw new ArgumentException("action"); + + InitializeAdd(action, null, -1); + } + else + { + InitializeAddOrRemove(action, new object[] { changedItem }, -1); + } + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a one-item change. + /// + /// The action that caused the event. + /// The item affected by the change. + /// The index where the change occurred. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, object changedItem, int index) + { + if ((action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Add) && (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Remove) + && (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Reset)) + throw new ArgumentException("action"); + + if (action == PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Reset) + { + if (changedItem != null) + throw new ArgumentException("action"); + if (index != -1) + throw new ArgumentException("action"); + + InitializeAdd(action, null, -1); + } + else + { + InitializeAddOrRemove(action, new object[] { changedItem }, index); + } + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a multi-item change. + /// + /// The action that caused the event. + /// The items affected by the change. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList changedItems) + { + if ((action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Add) && (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Remove) + && (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Reset)) + throw new ArgumentException("action"); + + if (action == PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Reset) + { + if (changedItems != null) + throw new ArgumentException("action"); + + InitializeAdd(action, null, -1); + } + else + { + if (changedItems == null) + throw new ArgumentNullException("changedItems"); + + InitializeAddOrRemove(action, changedItems, -1); + } + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a multi-item change (or a reset). + /// + /// The action that caused the event. + /// The items affected by the change. + /// The index where the change occurred. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList changedItems, int startingIndex) + { + if ((action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Add) && (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Remove) + && (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Reset)) + throw new ArgumentException("action"); + + if (action == PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Reset) + { + if (changedItems != null) + throw new ArgumentException("action"); + if (startingIndex != -1) + throw new ArgumentException("action"); + + InitializeAdd(action, null, -1); + } + else + { + if (changedItems == null) + throw new ArgumentNullException("changedItems"); + if (startingIndex < -1) + throw new ArgumentException("startingIndex"); + + InitializeAddOrRemove(action, changedItems, startingIndex); + } + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a one-item Replace event. + /// + /// Can only be a Replace action. + /// The new item replacing the original item. + /// The original item that is replaced. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, object newItem, object oldItem) + { + if (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Replace) + throw new ArgumentException("action"); + + InitializeMoveOrReplace(action, new object[] { newItem }, new object[] { oldItem }, -1, -1); + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a one-item Replace event. + /// + /// Can only be a Replace action. + /// The new item replacing the original item. + /// The original item that is replaced. + /// The index of the item being replaced. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, object newItem, object oldItem, int index) + { + if (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Replace) + throw new ArgumentException("action"); + + InitializeMoveOrReplace(action, new object[] { newItem }, new object[] { oldItem }, index, index); + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a multi-item Replace event. + /// + /// Can only be a Replace action. + /// The new items replacing the original items. + /// The original items that are replaced. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList newItems, IList oldItems) + { + if (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Replace) + throw new ArgumentException("action"); + if (newItems == null) + throw new ArgumentNullException("newItems"); + if (oldItems == null) + throw new ArgumentNullException("oldItems"); + + InitializeMoveOrReplace(action, newItems, oldItems, -1, -1); + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a multi-item Replace event. + /// + /// Can only be a Replace action. + /// The new items replacing the original items. + /// The original items that are replaced. + /// The starting index of the items being replaced. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList newItems, IList oldItems, int startingIndex) + { + if (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Replace) + throw new ArgumentException("action"); + if (newItems == null) + throw new ArgumentNullException("newItems"); + if (oldItems == null) + throw new ArgumentNullException("oldItems"); + + InitializeMoveOrReplace(action, newItems, oldItems, startingIndex, startingIndex); + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a one-item Move event. + /// + /// Can only be a Move action. + /// The item affected by the change. + /// The new index for the changed item. + /// The old index for the changed item. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, object changedItem, int index, int oldIndex) + { + if (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Move) + throw new ArgumentException("action"); + if (index < 0) + throw new ArgumentException("index"); + + object[] changedItems = new object[] { changedItem }; + InitializeMoveOrReplace(action, changedItems, changedItems, index, oldIndex); + } + + /// + /// Construct a NotifyCollectionChangedEventArgs that describes a multi-item Move event. + /// + /// The action that caused the event. + /// The items affected by the change. + /// The new index for the changed items. + /// The old index for the changed items. + public NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList changedItems, int index, int oldIndex) + { + if (action != PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Move) + throw new ArgumentException("action"); + if (index < 0) + throw new ArgumentException("index"); + + InitializeMoveOrReplace(action, changedItems, changedItems, index, oldIndex); + } + + /// + /// Construct a NotifyCollectionChangedEventArgs with given fields (no validation). Used by WinRT marshaling. + /// + internal NotifyCollectionChangedEventArgs(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList newItems, IList oldItems, int newIndex, int oldIndex) + { + _action = action; + _newItems = (newItems == null) ? null : new ReadOnlyList(newItems); + _oldItems = (oldItems == null) ? null : new ReadOnlyList(oldItems); + _newStartingIndex = newIndex; + _oldStartingIndex = oldIndex; + } + + private void InitializeAddOrRemove(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList changedItems, int startingIndex) + { + if (action == PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Add) + InitializeAdd(action, changedItems, startingIndex); + else if (action == PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction.Remove) + InitializeRemove(action, changedItems, startingIndex); + else + Debug.Assert(false, String.Format("Unsupported action: {0}", action.ToString())); + } + + private void InitializeAdd(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList newItems, int newStartingIndex) + { + _action = action; + _newItems = (newItems == null) ? null : new ReadOnlyList(newItems); + _newStartingIndex = newStartingIndex; + } + + private void InitializeRemove(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList oldItems, int oldStartingIndex) + { + _action = action; + _oldItems = (oldItems == null) ? null : new ReadOnlyList(oldItems); + _oldStartingIndex = oldStartingIndex; + } + + private void InitializeMoveOrReplace(PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction action, IList newItems, IList oldItems, int startingIndex, int oldStartingIndex) + { + InitializeAdd(action, newItems, startingIndex); + InitializeRemove(action, oldItems, oldStartingIndex); + } + + //------------------------------------------------------ + // + // Public Properties + // + //------------------------------------------------------ + + /// + /// The action that caused the event. + /// + public PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction Action + { + get { return _action; } + } + + /// + /// The items affected by the change. + /// + public IList NewItems + { + get { return _newItems; } + } + + /// + /// The old items affected by the change (for Replace events). + /// + public IList OldItems + { + get { return _oldItems; } + } + + /// + /// The index where the change occurred. + /// + public int NewStartingIndex + { + get { return _newStartingIndex; } + } + + /// + /// The old index where the change occurred (for Move events). + /// + public int OldStartingIndex + { + get { return _oldStartingIndex; } + } + + //------------------------------------------------------ + // + // Private Fields + // + //------------------------------------------------------ + + private PlatformSupport.Collections.Specialized.NotifyCollectionChangedAction _action; + private IList _newItems, _oldItems; + private int _newStartingIndex = -1; + private int _oldStartingIndex = -1; + } + + internal sealed class ReadOnlyList : IList + { + private readonly IList _list; + + internal ReadOnlyList(IList list) + { + Debug.Assert(list != null); + + _list = list; + } + + public int Count + { + get { return _list.Count; } + } + + public bool IsReadOnly + { + get { return true; } + } + + public bool IsFixedSize + { + get { return true; } + } + + public bool IsSynchronized + { + get { return _list.IsSynchronized; } + } + + public object this[int index] + { + get + { + return _list[index]; + } + set + { + throw new NotSupportedException(); + } + } + + public object SyncRoot + { + get { return _list.SyncRoot; } + } + + public int Add(object value) + { + throw new NotSupportedException(); + } + + public void Clear() + { + throw new NotSupportedException(); + } + + public bool Contains(object value) + { + return _list.Contains(value); + } + + public void CopyTo(Array array, int index) + { + _list.CopyTo(array, index); + } + + public IEnumerator GetEnumerator() + { + return _list.GetEnumerator(); + } + + public int IndexOf(object value) + { + return _list.IndexOf(value); + } + + public void Insert(int index, object value) + { + throw new NotSupportedException(); + } + + public void Remove(object value) + { + throw new NotSupportedException(); + } + + public void RemoveAt(int index) + { + throw new NotSupportedException(); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized/NotifyCollectionChangedEventArgs.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized/NotifyCollectionChangedEventArgs.cs.meta new file mode 100644 index 00000000..eb739997 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/Collections/Specialized/NotifyCollectionChangedEventArgs.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7578ac65ac9a66a4f920882f3e04ea5f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem.meta new file mode 100644 index 00000000..222f79ba --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c9301e8ec954a2d4babaa5044b7967e8 +folderAsset: yes +timeCreated: 1547115442 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/DefaultIOService.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/DefaultIOService.cs new file mode 100644 index 00000000..036fc8d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/DefaultIOService.cs @@ -0,0 +1,73 @@ +#if !NETFX_CORE && (!UNITY_WEBGL || UNITY_EDITOR) +using System; +using System.IO; + +namespace BestHTTP.PlatformSupport.FileSystem +{ + public sealed class DefaultIOService : IIOService + { + public Stream CreateFileStream(string path, FileStreamModes mode) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("DefaultIOService", string.Format("CreateFileStream path: '{0}' mode: {1}", path, mode)); + + switch (mode) + { + case FileStreamModes.Create: + return new FileStream(path, FileMode.Create); + case FileStreamModes.Open: + return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); + case FileStreamModes.Append: + return new FileStream(path, FileMode.Append); + } + + throw new NotImplementedException("DefaultIOService.CreateFileStream - mode not implemented: " + mode.ToString()); + } + + public void DirectoryCreate(string path) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("DefaultIOService", string.Format("DirectoryCreate path: '{0}'", path)); + Directory.CreateDirectory(path); + } + + public bool DirectoryExists(string path) + { + bool exists = Directory.Exists(path); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("DefaultIOService", string.Format("DirectoryExists path: '{0}' exists: {1}", path, exists)); + + return exists; + } + + public string[] GetFiles(string path) + { + var files = Directory.GetFiles(path); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("DefaultIOService", string.Format("GetFiles path: '{0}' files count: {1}", path, files.Length)); + + return files; + } + + public void FileDelete(string path) + { + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("DefaultIOService", string.Format("FileDelete path: '{0}'", path)); + File.Delete(path); + } + + public bool FileExists(string path) + { + bool exists = File.Exists(path); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Verbose("DefaultIOService", string.Format("FileExists path: '{0}' exists: {1}", path, exists)); + + return exists; + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/DefaultIOService.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/DefaultIOService.cs.meta new file mode 100644 index 00000000..4d69f33b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/DefaultIOService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0324d8e9b4f9e7f4599f8e988e2e1927 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/IIOService.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/IIOService.cs new file mode 100644 index 00000000..8fa58f48 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/IIOService.cs @@ -0,0 +1,63 @@ +using System; +using System.IO; + +namespace BestHTTP.PlatformSupport.FileSystem +{ + /// + /// These are the different modes that the plugin want's to use a filestream. + /// + public enum FileStreamModes + { + /// + /// Create a new file. + /// + Create, + + /// + /// Open an existing file for reading. + /// + Open, + + /// + /// Open an existing file for writing to the end. + /// + Append + } + + public interface IIOService + { + /// + /// Create a directory for the given path. + /// + void DirectoryCreate(string path); + + /// + /// Return true if the directory exists for the given path. + /// + /// + /// + bool DirectoryExists(string path); + + /// + /// Return with the file names for the given path. + /// + /// + /// + string[] GetFiles(string path); + + /// + /// Delete the file for the given path. + /// + void FileDelete(string path); + + /// + /// Return true if the file exists on the given path. + /// + bool FileExists(string path); + + /// + /// Create a stream that can read and/or write a file on the given path. + /// + Stream CreateFileStream(string path, FileStreamModes mode); + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/IIOService.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/IIOService.cs.meta new file mode 100644 index 00000000..d60ad47b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/IIOService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90b2250bdf568eb4aa0723186dfa0ecc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/NETFXCOREIOService.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/NETFXCOREIOService.cs new file mode 100644 index 00000000..214bd3cf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/NETFXCOREIOService.cs @@ -0,0 +1,244 @@ +#if NETFX_CORE +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using System.IO; +using System.Linq; +using System.Text; +using Windows.Storage; +using Windows.Storage.Streams; +using Windows.Foundation; + +namespace BestHTTP.PlatformSupport.FileSystem +{ + public sealed class NETFXCOREIOService : IIOService + { + public Stream CreateFileStream(string path, FileStreamModes mode) + { + switch (mode) + { + case FileStreamModes.Create: + return new FileStream(path, FileMode.Create); + case FileStreamModes.Open: + return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); + case FileStreamModes.Append: + return new FileStream(path, FileMode.Append); + } + + throw new NotImplementedException("DefaultIOService.CreateFileStream - mode not implemented: " + mode.ToString()); + } + + public void DirectoryCreate(string path) + { + if (path == null) + throw new ArgumentNullException(); + if (string.IsNullOrWhiteSpace(path)) + throw new ArgumentNullException("Path is empty"); + StorageFolder folder = (StorageFolder)null; + path = path.Replace('/', '\\'); + string path1 = path; + Stack stack = new Stack(); + do + { + try + { + folder = NETFXCOREIOService.GetDirectoryForPath(path1); + break; + } + catch + { + int length = path1.LastIndexOf('\\'); + if (length < 0) + { + path1 = (string)null; + } + else + { + stack.Push(path1.Substring(length + 1)); + path1 = path1.Substring(0, length); + } + } + } + while (path1 != null); + if (path1 == null) + { + System.Diagnostics.Debug.WriteLine("NETFXCOREIOService.DirectoryCreate: Could not find any part of the path: " + path); + throw new IOException("Could not find any part of the path: " + path); + } + try + { + while (stack.Count > 0) + { + string desiredName = stack.Pop(); + if (string.IsNullOrWhiteSpace(desiredName) && stack.Count > 0) + throw new ArgumentNullException("Empty directory name in the path"); + IAsyncOperation folderAsync = folder.CreateFolderAsync(desiredName); + WindowsRuntimeSystemExtensions.AsTask(folderAsync).Wait(); + folder = folderAsync.GetResults(); + } + } + catch (IOException ex) + { + System.Diagnostics.Debug.WriteLine("NETFXCOREIOService.DirectoryCreate: " + ex.Message + "\n" + ex.StackTrace); + throw; + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine("NETFXCOREIOService.DirectoryCreate: " + ex.Message + "\n" + ex.StackTrace); + throw new IOException(ex.Message, ex); + } + } + + public bool DirectoryExists(string path) + { + try + { + return NETFXCOREIOService.GetDirectoryForPath(path) != null; + } + catch + { + return false; + } + } + + public string[] GetFiles(string path) + { + if (path == null) + throw new ArgumentNullException(); + if (string.IsNullOrWhiteSpace(path)) + throw new ArgumentException("Path is empty"); + try + { + IAsyncOperation> filesAsync = NETFXCOREIOService.GetDirectoryForPath(path).GetFilesAsync(); + WindowsRuntimeSystemExtensions.AsTask>(filesAsync).Wait(); + IReadOnlyList results = filesAsync.GetResults(); + List list = new List(Enumerable.Count((IEnumerable)results)); + foreach (StorageFile storageFile in (IEnumerable)results) + list.Add(storageFile.Path); + return list.ToArray(); + } + catch (IOException ex) + { + System.Diagnostics.Debug.WriteLine("NETFXCOREIOService.GetFiles: " + ex.Message + "\n" + ex.StackTrace); + throw; + } + catch (Exception ex) + { + System.Diagnostics.Debug.WriteLine("NETFXCOREIOService.GetFiles: " + ex.Message + "\n" + ex.StackTrace); + throw new IOException(ex.Message, ex); + } + } + + public void FileDelete(string path) + { + if (path == null) + throw new ArgumentNullException(); + if (path.Trim() == "") + throw new ArgumentException(); + try + { + WindowsRuntimeSystemExtensions.AsTask(NETFXCOREIOService.GetFileForPathOrURI(path).DeleteAsync()) + .Wait(); + } + catch (Exception ex) + { + throw NETFXCOREIOService.GetRethrowException(ex); + } + } + + public bool FileExists(string path) + { + try + { + return NETFXCOREIOService.GetFileForPathOrURI(path) != null; + } + catch + { + return false; + } + } + + private const string LOCAL_FOLDER = "ms-appdata:///local/"; + private const string ROAMING_FOLDER = "ms-appdata:///roaming/"; + private const string TEMP_FOLDER = "ms-appdata:///temp/"; + private const string STORE_FOLDER = "isostore:/"; + + private static Exception GetRethrowException(Exception ex) + { + System.Diagnostics.Debug.WriteLine("NETFXCOREIOService.GetRethrowException: " + ex.Message + "\n" + ex.StackTrace); + if (ex.GetType() == typeof(IOException)) + return ex; + else + return (Exception)new IOException(ex.Message, ex); + } + + private static StorageFolder GetDirectoryForPath(string path) + { + IAsyncOperation folderFromPathAsync = StorageFolder.GetFolderFromPathAsync(path); + WindowsRuntimeSystemExtensions.AsTask(folderFromPathAsync).Wait(); + return folderFromPathAsync.GetResults(); + } + + private static StorageFolder GetFolderForURI(string uri) + { + uri = uri.ToLower(); + StorageFolder storageFolder1; + if (uri.StartsWith("ms-appdata:///local/")) + { + storageFolder1 = ApplicationData.Current.LocalFolder; + uri = uri.Replace("ms-appdata:///local/", ""); + } + else if (uri.StartsWith("ms-appdata:///roaming/")) + { + storageFolder1 = ApplicationData.Current.RoamingFolder; + uri = uri.Replace("ms-appdata:///roaming/", ""); + } + else + { + if (!uri.StartsWith("ms-appdata:///temp/")) + throw new Exception("Unsupported URI: " + uri); + storageFolder1 = ApplicationData.Current.TemporaryFolder; + uri = uri.Replace("ms-appdata:///temp/", ""); + } + string[] strArray = uri.Split(new char[1] { '/' }); + for (int index = 0; index < strArray.Length - 1; ++index) + { + Task> task = WindowsRuntimeSystemExtensions.AsTask>(storageFolder1.CreateFolderQuery().GetFoldersAsync()); + task.Wait(); + if (task.Status != TaskStatus.RanToCompletion) + throw new Exception("Failed to find folder: " + strArray[index]); + IReadOnlyList result = task.Result; + bool flag = false; + foreach (StorageFolder storageFolder2 in (IEnumerable)result) + { + if (storageFolder2.Name == strArray[index]) + { + storageFolder1 = storageFolder2; + flag = true; + break; + } + } + if (!flag) + throw new Exception("Folder not found: " + strArray[index]); + } + return storageFolder1; + } + + internal static StorageFolder GetFolderForPathOrURI(string path) + { + if (System.Uri.IsWellFormedUriString(path, UriKind.RelativeOrAbsolute)) + return NETFXCOREIOService.GetFolderForURI(path); + IAsyncOperation folderFromPathAsync = StorageFolder.GetFolderFromPathAsync(Path.GetDirectoryName(path)); + WindowsRuntimeSystemExtensions.AsTask(folderFromPathAsync).Wait(); + return folderFromPathAsync.GetResults(); + } + + internal static StorageFile GetFileForPathOrURI(string path) + { + IAsyncOperation source = !System.Uri.IsWellFormedUriString(path, UriKind.RelativeOrAbsolute) ? StorageFile.GetFileFromPathAsync(path) : StorageFile.GetFileFromApplicationUriAsync(new System.Uri(path)); + WindowsRuntimeSystemExtensions.AsTask(source).Wait(); + return source.GetResults(); + } + } +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/NETFXCOREIOService.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/NETFXCOREIOService.cs.meta new file mode 100644 index 00000000..16ebe6e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/NETFXCOREIOService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 21d8ec4418877f947b6d37200985904d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/WebGLIOService.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/WebGLIOService.cs new file mode 100644 index 00000000..e84b3e9a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/WebGLIOService.cs @@ -0,0 +1,40 @@ +#if UNITY_WEBGL && !UNITY_EDITOR +using System; +using System.IO; + +namespace BestHTTP.PlatformSupport.FileSystem +{ + public sealed class WebGLIOService : IIOService + { + public Stream CreateFileStream(string path, FileStreamModes mode) + { + throw new NotImplementedException(); + } + + public void DirectoryCreate(string path) + { + throw new NotImplementedException(); + } + + public bool DirectoryExists(string path) + { + throw new NotImplementedException(); + } + + public void FileDelete(string path) + { + throw new NotImplementedException(); + } + + public bool FileExists(string path) + { + throw new NotImplementedException(); + } + + public string[] GetFiles(string path) + { + throw new NotImplementedException(); + } + } +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/WebGLIOService.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/WebGLIOService.cs.meta new file mode 100644 index 00000000..847bda28 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/FileSystem/WebGLIOService.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70dddfbf0ab9b1643a2b181a449a096f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient.meta new file mode 100644 index 00000000..9060705e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2b874ed66c4deeb4f9a5f68d9de30628 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/TcpClient.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/TcpClient.cs new file mode 100644 index 00000000..197fa0ba --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/TcpClient.cs @@ -0,0 +1,630 @@ +#if !NETFX_CORE || UNITY_EDITOR + +// TcpClient.cs +// +// Author: +// Phillip Pearson (pp@myelin.co.nz) +// Gonzalo Paniagua Javier (gonzalo@novell.com) +// Sridhar Kulkarni (sridharkulkarni@gmail.com) +// Marek Safar (marek.safar@gmail.com) +// +// Copyright (C) 2001, Phillip Pearson http://www.myelin.co.nz +// Copyright (c) 2006 Novell, Inc. (http://www.novell.com) +// Copyright 2011 Xamarin Inc. +// + +// +// 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. +// +using System; +using System.IO; +using System.Net; +using System.Net.Sockets; + +namespace BestHTTP.PlatformSupport.TcpClient.General +{ + // This is a little modified TcpClient class from the Mono src tree. + public class TcpClient : IDisposable + { + enum Properties : uint + { + LingerState = 1, + NoDelay = 2, + ReceiveBufferSize = 4, + ReceiveTimeout = 8, + SendBufferSize = 16, + SendTimeout = 32 + } + + // private data + NetworkStream stream; + bool active; + Socket client; + bool disposed; + Properties values; + int recv_timeout, send_timeout; + int recv_buffer_size, send_buffer_size; + LingerOption linger_state; + bool no_delay; + + private void Init(AddressFamily family) + { + active = false; + + if (client != null) + { + client.Close(); + client = null; + } + + client = new Socket(family, SocketType.Stream, ProtocolType.Tcp); + } + + public TcpClient() + { + Init(AddressFamily.InterNetwork); + //client.Bind(new IPEndPoint(IPAddress.Any, 0)); + + ConnectTimeout = TimeSpan.FromSeconds(2); + } + + public TcpClient(AddressFamily family) + { + if (family != AddressFamily.InterNetwork && + family != AddressFamily.InterNetworkV6) + { + throw new ArgumentException("Family must be InterNetwork or InterNetworkV6", "family"); + } + + Init(family); + /*IPAddress any = IPAddress.Any; + if (family == AddressFamily.InterNetworkV6) + any = IPAddress.IPv6Any; + client.Bind(new IPEndPoint(any, 0));*/ + + ConnectTimeout = TimeSpan.FromSeconds(2); + } + + public TcpClient(IPEndPoint localEP) + { + Init(localEP.AddressFamily); + //client.Bind(localEP); + + ConnectTimeout = TimeSpan.FromSeconds(2); + } + + public TcpClient(string hostname, int port) + { + ConnectTimeout = TimeSpan.FromSeconds(2); + + Connect(hostname, port); + } + + protected bool Active + { + get { return active; } + set { active = value; } + } + + public Socket Client + { + get { return client; } + set + { + client = value; + stream = null; + } + } + + public int Available + { + get { return client.Available; } + } + + public bool Connected + { + get { return client.Connected; } + } + + + public bool IsConnected() + { + try + { + return !(Client.Poll(1, SelectMode.SelectRead) && Client.Available == 0); + } + catch (Exception) { return false; } + } + + public bool ExclusiveAddressUse + { + get + { + return (client.ExclusiveAddressUse); + } + set + { + client.ExclusiveAddressUse = value; + } + } + + internal void SetTcpClient(Socket s) + { + Client = s; + } + + public LingerOption LingerState + { + get + { + if ((values & Properties.LingerState) != 0) + return linger_state; + + return (LingerOption)client.GetSocketOption(SocketOptionLevel.Socket, + SocketOptionName.Linger); + } + set + { + if (!client.Connected) + { + linger_state = value; + values |= Properties.LingerState; + return; + } + client.SetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.Linger, value); + } + } + + public bool NoDelay + { + get + { + if ((values & Properties.NoDelay) != 0) + return no_delay; + + return (bool)client.GetSocketOption( + SocketOptionLevel.Tcp, + SocketOptionName.NoDelay); + } + set + { + if (!client.Connected) + { + no_delay = value; + values |= Properties.NoDelay; + return; + } + client.SetSocketOption( + SocketOptionLevel.Tcp, + SocketOptionName.NoDelay, value ? 1 : 0); + } + } + + public int ReceiveBufferSize + { + get + { + if ((values & Properties.ReceiveBufferSize) != 0) + return recv_buffer_size; + + return (int)client.GetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.ReceiveBuffer); + } + set + { + if (!client.Connected) + { + recv_buffer_size = value; + values |= Properties.ReceiveBufferSize; + return; + } + client.SetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.ReceiveBuffer, value); + } + } + + public int ReceiveTimeout + { + get + { + if ((values & Properties.ReceiveTimeout) != 0) + return recv_timeout; + + return (int)client.GetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.ReceiveTimeout); + } + set + { + if (!client.Connected) + { + recv_timeout = value; + values |= Properties.ReceiveTimeout; + return; + } + client.SetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.ReceiveTimeout, value); + } + } + + public int SendBufferSize + { + get + { + if ((values & Properties.SendBufferSize) != 0) + return send_buffer_size; + + return (int)client.GetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.SendBuffer); + } + set + { + if (!client.Connected) + { + send_buffer_size = value; + values |= Properties.SendBufferSize; + return; + } + client.SetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.SendBuffer, value); + } + } + + public int SendTimeout + { + get + { + if ((values & Properties.SendTimeout) != 0) + return send_timeout; + + return (int)client.GetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.SendTimeout); + } + set + { + if (!client.Connected) + { + send_timeout = value; + values |= Properties.SendTimeout; + return; + } + client.SetSocketOption( + SocketOptionLevel.Socket, + SocketOptionName.SendTimeout, value); + } + } + + public TimeSpan ConnectTimeout { get; set; } + + // methods + + public void Close() + { + ((IDisposable)this).Dispose(); + } + + public void Connect(IPEndPoint remoteEP) + { + try + { + if (ConnectTimeout > TimeSpan.Zero) + { + // Third version, works in WebPlayer + System.Threading.ManualResetEvent mre = new System.Threading.ManualResetEvent(false); + IAsyncResult result = client.BeginConnect(remoteEP, (res) => mre.Set(), null); + active = mre.WaitOne(ConnectTimeout); + if (active) + client.EndConnect(result); + else + { + try + { + client.Disconnect(true); + } + catch + { } + + throw new TimeoutException("Connection timed out!"); + } + + // Second version with timeout, in WebPlayer can't connect: + // Attempt to access a private/protected method failed. at System.Security.SecurityManager.ThrowException (System.Exception ex) [0x00000] in :0 + /*IAsyncResult result = client.BeginConnect(remoteEP, null, null); + Active = result.AsyncWaitHandle.WaitOne(ConnectTimeout, true); + if (active) + { + client.EndConnect(result); + } + else + { + client.Close(); + //throw new SocketException(10060); + throw new TimeoutException("Connection timed out!"); + }*/ + } + else + { + // First(old) version, no timeout + client.Connect(remoteEP); + active = true; + } + } + finally + { + CheckDisposed(); + } + } + + public void Connect(IPAddress address, int port) + { + Connect(new IPEndPoint(address, port)); + } + + void SetOptions() + { + Properties props = values; + values = 0; + + if ((props & Properties.LingerState) != 0) + LingerState = linger_state; + if ((props & Properties.NoDelay) != 0) + NoDelay = no_delay; + if ((props & Properties.ReceiveBufferSize) != 0) + ReceiveBufferSize = recv_buffer_size; + if ((props & Properties.ReceiveTimeout) != 0) + ReceiveTimeout = recv_timeout; + if ((props & Properties.SendBufferSize) != 0) + SendBufferSize = send_buffer_size; + if ((props & Properties.SendTimeout) != 0) + SendTimeout = send_timeout; + } + + public void Connect(string hostname, int port) + { + if (ConnectTimeout > TimeSpan.Zero) + { + // https://forum.unity3d.com/threads/best-http-released.200006/page-37#post-3150972 + System.Threading.ManualResetEvent mre = new System.Threading.ManualResetEvent(false); + IAsyncResult result = Dns.BeginGetHostAddresses(hostname, (res) => mre.Set(), null); + bool success = mre.WaitOne(ConnectTimeout); + if (success) + { + IPAddress[] addresses = Dns.EndGetHostAddresses(result); + Connect(addresses, port); + } + else + { + throw new TimeoutException("DNS resolve timed out!"); + } + } + else + { + IPAddress[] addresses = Dns.GetHostAddresses(hostname); + Connect(addresses, port); + } + } + + public void Connect(IPAddress[] ipAddresses, int port) + { + CheckDisposed(); + + if (ipAddresses == null) + { + throw new ArgumentNullException("ipAddresses"); + } + + for (int i = 0; i < ipAddresses.Length; i++) + { + try + { + IPAddress address = ipAddresses[i]; + + if (address.Equals(IPAddress.Any) || + address.Equals(IPAddress.IPv6Any)) + { + throw new SocketException((int)SocketError.AddressNotAvailable); + } + + Init(address.AddressFamily); + + if (address.AddressFamily == AddressFamily.InterNetwork) + { + //client.Bind(new IPEndPoint(IPAddress.Any, 0)); + } + else if (address.AddressFamily == AddressFamily.InterNetworkV6) + { + //client.Bind(new IPEndPoint(IPAddress.IPv6Any, 0)); + } + else + { + throw new NotSupportedException("This method is only valid for sockets in the InterNetwork and InterNetworkV6 families"); + } + + Connect(new IPEndPoint(address, port)); + + if (values != 0) + { + SetOptions(); + } + + // Enable Keep-Alive packets + client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true); + + try + { + /* + TCP_KEEPIDLE 4 // Start keeplives after this period + TCP_KEEPINTVL 5 // Interval between keepalives + TCP_KEEPCNT 6 // Number of keepalives before death + */ + + //client.SetSocketOption(SocketOptionLevel.Tcp, (SocketOptionName)4, 30); + //client.SetSocketOption(SocketOptionLevel.Tcp, (SocketOptionName)5, 10); + } + catch { } + + +#if UNITY_WINDOWS || UNITY_EDITOR + // Set the keep-alive time and interval on windows + + // https://msdn.microsoft.com/en-us/library/windows/desktop/dd877220%28v=vs.85%29.aspx + // https://msdn.microsoft.com/en-us/library/windows/desktop/ee470551%28v=vs.85%29.aspx + try + { + //SetKeepAlive(true, 30000, 1000); + } + catch{ } +#endif + + HTTPManager.Logger.Information("TcpClient", string.Format("Connected to {0}:{1}", address.ToString(), port.ToString())); + + break; + } + catch (Exception e) + { + /* Reinitialise the socket so + * other properties still work + * (see no-arg constructor) + */ + Init(AddressFamily.InterNetwork); + + /* This is the last known + * address, so re-throw the + * exception + */ + if (i == ipAddresses.Length - 1) + { + throw e; + } + } + } + } + + public void EndConnect(IAsyncResult asyncResult) + { + client.EndConnect(asyncResult); + } + + public IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback requestCallback, object state) + { + return client.BeginConnect(address, port, requestCallback, state); + } + + public IAsyncResult BeginConnect(IPAddress[] addresses, int port, AsyncCallback requestCallback, object state) + { + return client.BeginConnect(addresses, port, requestCallback, state); + } + + public IAsyncResult BeginConnect(string host, int port, AsyncCallback requestCallback, object state) + { + return client.BeginConnect(host, port, requestCallback, state); + } + + void IDisposable.Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + return; + disposed = true; + + if (disposing) + { + // release managed resources + NetworkStream s = stream; + stream = null; + if (s != null) + { + // This closes the socket as well, as the NetworkStream + // owns the socket. + s.Close(); + active = false; + s = null; + } + else if (client != null) + { + client.Close(); + client = null; + } + } + } + + ~TcpClient() + { + Dispose(false); + } + + public Stream GetStream() + { + try + { + if (stream == null) + stream = new NetworkStream(client, true); + return stream; + } + finally { CheckDisposed(); } + } + + private void CheckDisposed() + { + if (disposed) + throw new ObjectDisposedException(GetType().FullName); + } + +#if UNITY_WINDOWS || UNITY_EDITOR + public void SetKeepAlive(bool on, uint keepAliveTime, uint keepAliveInterval) + { + int size = System.Runtime.InteropServices.Marshal.SizeOf(new uint()); + + var inOptionValues = new byte[size * 3]; + + BitConverter.GetBytes((uint)(on ? 1 : 0)).CopyTo(inOptionValues, 0); + BitConverter.GetBytes((uint)keepAliveTime).CopyTo(inOptionValues, size); + BitConverter.GetBytes((uint)keepAliveInterval).CopyTo(inOptionValues, size * 2); + + //client.IOControl(IOControlCode.KeepAliveValues, inOptionValues, null); + int dwBytesRet = 0; + WSAIoctl(client.Handle, /*SIO_KEEPALIVE_VALS*/ System.Net.Sockets.IOControlCode.KeepAliveValues, inOptionValues, inOptionValues.Length, /*NULL*/IntPtr.Zero, 0, ref dwBytesRet, /*NULL*/IntPtr.Zero, /*NULL*/IntPtr.Zero); + } + + [System.Runtime.InteropServices.DllImport("Ws2_32.dll")] + public static extern int WSAIoctl( + /* Socket, Mode */ IntPtr s, System.Net.Sockets.IOControlCode dwIoControlCode, + /* Optional Or IntPtr.Zero, 0 */ byte[] lpvInBuffer, int cbInBuffer, + /* Optional Or IntPtr.Zero, 0 */ IntPtr lpvOutBuffer, int cbOutBuffer, + /* reference to receive Size */ ref int lpcbBytesReturned, + /* IntPtr.Zero, IntPtr.Zero */ IntPtr lpOverlapped, IntPtr lpCompletionRoutine); +#endif + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/TcpClient.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/TcpClient.cs.meta new file mode 100644 index 00000000..fb6f20b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/TcpClient.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e8000d20829121a4aa2466c39057835e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT.meta new file mode 100644 index 00000000..dd22bf7a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1d6092b0b312e184b8d45e66dba37d60 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/DataReaderWriterStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/DataReaderWriterStream.cs new file mode 100644 index 00000000..d7694c21 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/DataReaderWriterStream.cs @@ -0,0 +1,66 @@ +#if (UNITY_WSA || BUILD_FOR_WP8) && !UNITY_EDITOR && !ENABLE_IL2CPP + +using System; +using System.IO; + +using Windows.Storage.Streams; +using System.Runtime.InteropServices.WindowsRuntime; + +namespace BestHTTP.PlatformSupport.TcpClient.WinRT +{ + public sealed class DataReaderWriterStream : System.IO.Stream + { + private TcpClient Client { get; set; } + + public DataReaderWriterStream(TcpClient socket) + { + this.Client = socket; + } + + public override bool CanRead { get { return true; } } + public override bool CanSeek { get { return false; } } + public override bool CanWrite { get { return true; } } + public override void Flush() { } + public override long Length { get { throw new NotImplementedException(); } } + public override long Position { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } + public bool DataAvailable { get { return true; } } + + public override int Read(byte[] buffer, int offset, int count) + { + Windows.Storage.Streams.Buffer tmpBuffer = new Windows.Storage.Streams.Buffer((uint)count); + + try + { + var task = Client.Socket.InputStream.ReadAsync(tmpBuffer, tmpBuffer.Capacity, InputStreamOptions.Partial) + .AsTask(); + task.ConfigureAwait(false); + task.Wait(); + } + catch(AggregateException ex) + { + if (ex.InnerException != null) + throw ex.InnerException; + else + throw ex; + } + + DataReader reader = DataReader.FromBuffer(tmpBuffer); + int length = (int)reader.UnconsumedBufferLength; + for (int i = 0; i < length; ++i) + buffer[offset + i] = reader.ReadByte(); + return length; + } + + public override void Write(byte[] buffer, int offset, int count) + { + var task = Client.Socket.OutputStream.WriteAsync(buffer.AsBuffer(offset, count)).AsTask(); + task.ConfigureAwait(false); + task.Wait(); + } + + public override long Seek(long offset, System.IO.SeekOrigin origin) { return 0; } + public override void SetLength(long value) { } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/DataReaderWriterStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/DataReaderWriterStream.cs.meta new file mode 100644 index 00000000..0ccf26b3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/DataReaderWriterStream.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 427d34e18e3b2874bb249aea978feba8 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/TcpClient.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/TcpClient.cs new file mode 100644 index 00000000..9b94edb1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/TcpClient.cs @@ -0,0 +1,143 @@ +#if (NETFX_CORE || BUILD_FOR_WP8) && !UNITY_EDITOR && !ENABLE_IL2CPP + +using System; +using Windows.Networking; +using Windows.Networking.Sockets; + +namespace BestHTTP.PlatformSupport.TcpClient.WinRT +{ + public sealed class TcpClient : IDisposable + { +#region Public Properties + + public bool Connected { get; private set; } + public TimeSpan ConnectTimeout { get; set; } + + public bool UseHTTPSProtocol { get; set; } +#endregion + +#region Private Properties + + internal StreamSocket Socket { get; set; } + private System.IO.Stream Stream { get; set; } + +#endregion + + public TcpClient() + { + ConnectTimeout = TimeSpan.FromSeconds(2); + } + + public void Connect(string hostName, int port) + { + //How to secure socket connections with TLS/SSL: + //http://msdn.microsoft.com/en-us/library/windows/apps/jj150597.aspx + + //Networking in Windows 8 Apps - Using StreamSocket for TCP Communication + //http://blogs.msdn.com/b/metulev/archive/2012/10/22/networking-in-windows-8-apps-using-streamsocket-for-tcp-communication.aspx + + Socket = new StreamSocket(); + Socket.Control.KeepAlive = true; + Socket.Control.NoDelay = true; + + var host = new HostName(hostName); + + SocketProtectionLevel spl = SocketProtectionLevel.PlainSocket; + if (UseHTTPSProtocol) + spl = SocketProtectionLevel. +#if UNITY_WSA_8_0 || BUILD_FOR_WP8 + Ssl; +#else + Tls12; +#endif + + System.Threading.CancellationTokenSource tokenSource = new System.Threading.CancellationTokenSource(); + + // https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj710176.aspx#content + try + { + if (ConnectTimeout > TimeSpan.Zero) + tokenSource.CancelAfter(ConnectTimeout); + + var task = Socket.ConnectAsync(host, UseHTTPSProtocol ? "https" : port.ToString(), spl).AsTask(tokenSource.Token); + task.ConfigureAwait(false); + task.Wait(); + Connected = task.IsCompleted; + } + catch(AggregateException ex) + { + //https://msdn.microsoft.com/en-us/library/dd537614(v=vs.110).aspx?f=255&MSPPError=-2147217396 + + Connected = false; + if (ex.InnerException != null) + //throw ex.InnerException; + { + if ( ex.Message.Contains("No such host is known") || ex.Message.Contains("unreachable host") ) + throw new Exception("Socket Exception"); + else + throw ex.InnerException; + } + else + throw ex; + } + finally { + // https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtokensource + tokenSource.Dispose(); + } + + if (!Connected) + throw new TimeoutException("Connection timed out!"); + } + + public bool IsConnected() + { + return true; + } + + public System.IO.Stream GetStream() + { + if (Stream == null) + Stream = new DataReaderWriterStream(this); + return Stream; + } + + public void Close() + { + Dispose(); + } + +#region IDisposeble + + private bool disposed = false; + + private void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + if (Stream != null) + Stream.Dispose(); + Stream = null; + Connected = false; + } + disposed = true; + } + } + + ~TcpClient() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + +#endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/TcpClient.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/TcpClient.cs.meta new file mode 100644 index 00000000..44682dda --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/PlatformSupport/TcpClient/WinRT/TcpClient.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f655ab9e34dc51541b1d220a7ba46446 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SOCKSProxy.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SOCKSProxy.cs new file mode 100644 index 00000000..f716db7e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SOCKSProxy.cs @@ -0,0 +1,356 @@ +#if !BESTHTTP_DISABLE_PROXY +using System; +using System.IO; +using System.Text; +using BestHTTP.Authentication; +using BestHTTP.Extensions; + +namespace BestHTTP +{ + internal enum SOCKSVersions : byte + { + Unknown = 0x00, + V5 = 0x05 + } + + /// + /// https://tools.ietf.org/html/rfc1928 + /// The values currently defined for METHOD are: + /// o X'00' NO AUTHENTICATION REQUIRED + /// o X'01' GSSAPI + /// o X'02' USERNAME/PASSWORD + /// o X'03' to X'7F' IANA ASSIGNED + /// o X'80' to X'FE' RESERVED FOR PRIVATE METHODS + /// o X'FF' NO ACCEPTABLE METHODS + /// + internal enum SOCKSMethods : byte + { + NoAuthenticationRequired = 0x00, + GSSAPI = 0x01, + UsernameAndPassword = 0x02, + NoAcceptableMethods = 0xFF + } + + internal enum SOCKSReplies : byte + { + Succeeded = 0x00, + GeneralSOCKSServerFailure = 0x01, + ConnectionNotAllowedByRuleset = 0x02, + NetworkUnreachable = 0x03, + HostUnreachable = 0x04, + ConnectionRefused = 0x05, + TTLExpired = 0x06, + CommandNotSupported = 0x07, + AddressTypeNotSupported = 0x08 + } + + internal enum SOCKSAddressTypes + { + IPV4 = 0x00, + DomainName = 0x03, + IPv6 = 0x04 + } + + public sealed class SOCKSProxy : Proxy + { + public SOCKSProxy(Uri address, Credentials credentials) + : base(address, credentials) + { } + + internal override string GetRequestPath(Uri uri) + { + return uri.GetRequestPathAndQueryURL(); + } + + internal override void Connect(Stream stream, HTTPRequest request) + { + // https://tools.ietf.org/html/rfc1928 + // The client connects to the server, and sends a version + // identifier/method selection message: + // + // +----+----------+----------+ + // |VER | NMETHODS | METHODS | + // +----+----------+----------+ + // | 1 | 1 | 1 to 255 | + // +----+----------+----------+ + // + // The VER field is set to X'05' for this version of the protocol. The + // NMETHODS field contains the number of method identifier octets that + // appear in the METHODS field. + // + + var buffer = new byte[1024]; + int count = 0; + + buffer[count++] = (byte)SOCKSVersions.V5; + if (this.Credentials != null) + { + buffer[count++] = 0x02; // method count + buffer[count++] = (byte)SOCKSMethods.UsernameAndPassword; + buffer[count++] = (byte)SOCKSMethods.NoAuthenticationRequired; + } + else + { + buffer[count++] = 0x01; // method count + buffer[count++] = (byte)SOCKSMethods.NoAuthenticationRequired; + } + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Information("SOCKSProxy", string.Format("Sending method negotiation - count: {0} buffer: {1} ", count.ToString(), BufferToHexStr(buffer, count))); + + // Write negotiation + stream.Write(buffer, 0, count); + // Read result + count = stream.Read(buffer, 0, buffer.Length); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Information("SOCKSProxy", string.Format("Negotiation response - count: {0} buffer: {1} ", count.ToString(), BufferToHexStr(buffer, count))); + + // The server selects from one of the methods given in METHODS, and + // sends a METHOD selection message: + // + // +----+--------+ + // |VER | METHOD | + // +----+--------+ + // | 1 | 1 | + // +----+--------+ + // + // If the selected METHOD is X'FF', none of the methods listed by the + // client are acceptable, and the client MUST close the connection. + // + // The values currently defined for METHOD are: + // + // o X'00' NO AUTHENTICATION REQUIRED + // o X'01' GSSAPI + // o X'02' USERNAME/PASSWORD + // o X'03' to X'7F' IANA ASSIGNED + // o X'80' to X'FE' RESERVED FOR PRIVATE METHODS + // o X'FF' NO ACCEPTABLE METHODS + // + // The client and server then enter a method-specific sub-negotiation. + + SOCKSVersions version = (SOCKSVersions)buffer[0]; + SOCKSMethods method = (SOCKSMethods)buffer[1]; + + // Expected result: + // 1.) Received bytes' count is 2: version + preferred method + // 2.) Version must be 5 + // 3.) Preferred method must NOT be 0xFF + if (count != 2) + throw new Exception(string.Format("SOCKS Proxy - Expected read count: 2! count: {0} buffer: {1}" + count.ToString(), BufferToHexStr(buffer, count))); + else if (version != SOCKSVersions.V5) + throw new Exception("SOCKS Proxy - Expected version: 5, received version: " + buffer[0].ToString("X2")); + else if (method == SOCKSMethods.NoAcceptableMethods) + throw new Exception("SOCKS Proxy - Received 'NO ACCEPTABLE METHODS' (0xFF)"); + else + { + HTTPManager.Logger.Information("SOCKSProxy", "Method negotiation over. Method: " + method.ToString()); + switch (method) + { + case SOCKSMethods.NoAuthenticationRequired: + // nothing to do + break; + + case SOCKSMethods.UsernameAndPassword: + if (this.Credentials.UserName.Length > 255) + throw new Exception(string.Format("SOCKS Proxy - Credentials.UserName too long! {0} > 255", this.Credentials.UserName.Length.ToString())); + if (this.Credentials.Password.Length > 255) + throw new Exception(string.Format("SOCKS Proxy - Credentials.Password too long! {0} > 255", this.Credentials.Password.Length.ToString())); + + // https://tools.ietf.org/html/rfc1929 : Username/Password Authentication for SOCKS V5 + // Once the SOCKS V5 server has started, and the client has selected the + // Username/Password Authentication protocol, the Username/Password + // subnegotiation begins. This begins with the client producing a + // Username/Password request: + // + // +----+------+----------+------+----------+ + // |VER | ULEN | UNAME | PLEN | PASSWD | + // +----+------+----------+------+----------+ + // | 1 | 1 | 1 to 255 | 1 | 1 to 255 | + // +----+------+----------+------+----------+ + + HTTPManager.Logger.Information("SOCKSProxy", "starting sub-negotiation"); + count = 0; + buffer[count++] = 0x01; // version of sub negotiation + + WriteString(buffer, ref count, this.Credentials.UserName); + WriteString(buffer, ref count, this.Credentials.Password); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Information("SOCKSProxy", string.Format("Sending username and password sub-negotiation - count: {0} buffer: {1} ", count.ToString(), BufferToHexStr(buffer, count))); + + // Write negotiation + stream.Write(buffer, 0, count); + // Read result + count = stream.Read(buffer, 0, buffer.Length); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Information("SOCKSProxy", string.Format("Username and password sub-negotiation response - count: {0} buffer: {1} ", count.ToString(), BufferToHexStr(buffer, count))); + + // The server verifies the supplied UNAME and PASSWD, and sends the + // following response: + // + // +----+--------+ + // |VER | STATUS | + // +----+--------+ + // | 1 | 1 | + // +----+--------+ + + // A STATUS field of X'00' indicates success. If the server returns a + // `failure' (STATUS value other than X'00') status, it MUST close the + // connection. + bool success = buffer[1] == 0; + + if (count != 2) + throw new Exception(string.Format("SOCKS Proxy - Expected read count: 2! count: {0} buffer: {1}" + count.ToString(), BufferToHexStr(buffer, count))); + else if (!success) + throw new Exception("SOCKS proxy: username+password authentication failed!"); + + HTTPManager.Logger.Information("SOCKSProxy", "Authenticated!"); + break; + + case SOCKSMethods.GSSAPI: + throw new Exception("SOCKS proxy: GSSAPI not supported!"); + + case SOCKSMethods.NoAcceptableMethods: + throw new Exception("SOCKS proxy: No acceptable method"); + } + } + + // The SOCKS request is formed as follows: + // + // +----+-----+-------+------+----------+----------+ + // |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | + // +----+-----+-------+------+----------+----------+ + // | 1 | 1 | X'00' | 1 | Variable | 2 | + // +----+-----+-------+------+----------+----------+ + // + // Where: + // + // o VER protocol version: X'05' + // o CMD + // o CONNECT X'01' + // o BIND X'02' + // o UDP ASSOCIATE X'03' + // o RSV RESERVED + // o ATYP address type of following address + // o IP V4 address: X'01' + // o DOMAINNAME: X'03' + // o IP V6 address: X'04' + // o DST.ADDR desired destination address + // o DST.PORT desired destination port in network octet + // order + + count = 0; + buffer[count++] = (byte)SOCKSVersions.V5; // version: 5 + buffer[count++] = 0x01; // command: connect + buffer[count++] = 0x00; // reserved, bust be 0x00 + + if (request.CurrentUri.IsHostIsAnIPAddress()) + { + bool isIPV4 = Extensions.Extensions.IsIpV4AddressValid(request.CurrentUri.Host); + buffer[count++] = isIPV4 ? (byte)SOCKSAddressTypes.IPV4 : (byte)SOCKSAddressTypes.IPv6; + + var ipAddress = System.Net.IPAddress.Parse(request.CurrentUri.Host); + var ipBytes = ipAddress.GetAddressBytes(); + WriteBytes(buffer, ref count, ipBytes); // destination address + } + else + { + buffer[count++] = (byte)SOCKSAddressTypes.DomainName; + + // The first octet of the address field contains the number of octets of name that + // follow, there is no terminating NUL octet. + WriteString(buffer, ref count, request.CurrentUri.Host); + } + + // destination port in network octet order + buffer[count++] = (byte)((request.CurrentUri.Port >> 8) & 0xFF); + buffer[count++] = (byte)(request.CurrentUri.Port & 0xFF); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Information("SOCKSProxy", string.Format("Sending connect request - count: {0} buffer: {1} ", count.ToString(), BufferToHexStr(buffer, count))); + + stream.Write(buffer, 0, count); + count = stream.Read(buffer, 0, buffer.Length); + + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + HTTPManager.Logger.Information("SOCKSProxy", string.Format("Connect response - count: {0} buffer: {1} ", count.ToString(), BufferToHexStr(buffer, count))); + + // The SOCKS request information is sent by the client as soon as it has + // established a connection to the SOCKS server, and completed the + // authentication negotiations. The server evaluates the request, and + // returns a reply formed as follows: + // + // +----+-----+-------+------+----------+----------+ + // |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT | + // +----+-----+-------+------+----------+----------+ + // | 1 | 1 | X'00' | 1 | Variable | 2 | + // +----+-----+-------+------+----------+----------+ + // + // Where: + // o VER protocol version: X'05' + // o REP Reply field: + // o X'00' succeeded + // o X'01' general SOCKS server failure + // o X'02' connection not allowed by ruleset + // o X'03' Network unreachable + // o X'04' Host unreachable + // o X'05' Connection refused + // o X'06' TTL expired + // o X'07' Command not supported + // o X'08' Address type not supported + // o X'09' to X'FF' unassigned + // o RSV RESERVED + // o ATYP address type of following address + // o IP V4 address: X'01' + // o DOMAINNAME: X'03' + // o IP V6 address: X'04' + // o BND.ADDR server bound address + // o BND.PORT server bound port in network octet order + // + // Fields marked RESERVED (RSV) must be set to X'00'. + + version = (SOCKSVersions)buffer[0]; + SOCKSReplies reply = (SOCKSReplies)buffer[1]; + + // at least 10 bytes expected as a result + if (count < 10) + throw new Exception(string.Format("SOCKS proxy: not enough data returned by the server. Expected count is at least 10 bytes, server returned {0} bytes! content: {1}", count.ToString(), BufferToHexStr(buffer, count))); + else if (reply != SOCKSReplies.Succeeded) + throw new Exception("SOCKS proxy error: " + reply.ToString()); + + HTTPManager.Logger.Information("SOCKSProxy", "Connected!"); + } + + private void WriteString(byte[] buffer, ref int count, string str) + { + // Get the bytes + byte[] strBytes = Encoding.UTF8.GetBytes(str); + + if (strBytes.Length > 255) + throw new Exception(string.Format("SOCKS Proxy - String is too large ({0}) to fit in 255 bytes!", strBytes.Length.ToString())); + + // number of bytes + buffer[count++] = (byte)strBytes.Length; + // and the bytes itself + Array.Copy(strBytes, 0, buffer, count, strBytes.Length); + count += strBytes.Length; + } + + private void WriteBytes(byte[] buffer, ref int count, byte[] bytes) + { + Array.Copy(bytes, 0, buffer, count, bytes.Length); + count += bytes.Length; + } + + private string BufferToHexStr(byte[] buffer, int count) + { + StringBuilder sb = new StringBuilder(count * 2); + for (int i = 0; i < count; ++i) + sb.AppendFormat("0x{0} ", buffer[i].ToString("X2")); + return sb.ToString(); + } + } +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SOCKSProxy.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SOCKSProxy.cs.meta new file mode 100644 index 00000000..37dcab6c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SOCKSProxy.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c9df92482bea23b4aab51dbfc2522c63 +timeCreated: 1548063275 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol.meta new file mode 100644 index 00000000..3d21f306 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 97fdcd3872eb99b47b5b13fc86176ca5 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/License.txt b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/License.txt new file mode 100644 index 00000000..96e67d58 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/License.txt @@ -0,0 +1,7 @@ +Copyright (c) 2000 - 2017 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) + +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. \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/License.txt.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/License.txt.meta new file mode 100644 index 00000000..8f3271c4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/License.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fc7453f14fee55347b287df5490f3c4d +timeCreated: 1490202077 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ReflectionHelpers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ReflectionHelpers.cs new file mode 100644 index 00000000..2b9991be --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ReflectionHelpers.cs @@ -0,0 +1,112 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#if UNITY_WSA && !UNITY_EDITOR && !ENABLE_IL2CPP + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Reflection; + + +namespace System.TypeFix +{ + public static class ReflectionHelpers + { + /// + /// Determines whether the specified object is an instance of the current Type. + /// + /// The type. + /// The object to compare with the current type. + /// true if the current Type is in the inheritance hierarchy of the + /// object represented by o, or if the current Type is an interface that o + /// supports. false if neither of these conditions is the case, or if o is + /// null, or if the current Type is an open generic type (that is, + /// ContainsGenericParameters returns true). + public static bool IsInstanceOfType(this Type type, object o) + { + return o != null && type.IsAssignableFrom(o.GetType()); + } + + + internal static bool ImplementInterface(this Type type, Type ifaceType) + { + while (type != null) + { + Type[] interfaces = type.GetTypeInfo().ImplementedInterfaces.ToArray(); // .GetInterfaces(); + if (interfaces != null) + { + for (int i = 0; i < interfaces.Length; i++) + { + if (interfaces[i] == ifaceType || (interfaces[i] != null && interfaces[i].ImplementInterface(ifaceType))) + { + return true; + } + } + } + type = type.GetTypeInfo().BaseType; + // type = type.BaseType; + } + return false; + } + + + public static bool IsAssignableFrom(this Type type, Type c) + { + if (c == null) + { + return false; + } + if (type == c) + { + return true; + } + + + //RuntimeType runtimeType = type.UnderlyingSystemType as RuntimeType; + //if (runtimeType != null) + //{ + // return runtimeType.IsAssignableFrom(c); + //} + + + //if (c.IsSubclassOf(type)) + if (c.GetTypeInfo().IsSubclassOf(c)) + { + return true; + } + + + //if (type.IsInterface) + if (type.GetTypeInfo().IsInterface) + { + return c.ImplementInterface(type); + } + + + if (type.IsGenericParameter) + { + Type[] genericParameterConstraints = type.GetTypeInfo().GetGenericParameterConstraints(); + for (int i = 0; i < genericParameterConstraints.Length; i++) + { + if (!genericParameterConstraints[i].IsAssignableFrom(c)) + { + return false; + } + } + return true; + } + return false; + } + + public static bool IsEnum(this Type type) + { + return type.GetTypeInfo().IsEnum; + } + + + } +} + +#endif +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ReflectionHelpers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ReflectionHelpers.cs.meta new file mode 100644 index 00000000..5f42f5b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ReflectionHelpers.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 3e90bd9651eef344fa8bacc831f397bc +timeCreated: 1547051959 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1.meta new file mode 100644 index 00000000..c4943d1a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bedc740ef99712e40b82c0c7de92cf9c +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1Generator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1Generator.cs new file mode 100644 index 00000000..4feefac2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1Generator.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.Collections; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public abstract class Asn1Generator + { + private Stream _out; + + protected Asn1Generator( + Stream outStream) + { + _out = outStream; + } + + protected Stream Out + { + get { return _out; } + } + + public abstract void AddObject(Asn1Encodable obj); + + public abstract Stream GetRawOutputStream(); + + public abstract void Close(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1Generator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1Generator.cs.meta new file mode 100644 index 00000000..866fb88d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1Generator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bdc81b96ab45ff94098a67c1dcf27e23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1OctetStringParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1OctetStringParser.cs new file mode 100644 index 00000000..a0390fd5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1OctetStringParser.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public interface Asn1OctetStringParser + : IAsn1Convertible + { + Stream GetOctetStream(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1OctetStringParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1OctetStringParser.cs.meta new file mode 100644 index 00000000..83de6122 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1OctetStringParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cc7b00883ebe075438a06d46defe0b35 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SequenceParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SequenceParser.cs new file mode 100644 index 00000000..81605115 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SequenceParser.cs @@ -0,0 +1,12 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public interface Asn1SequenceParser + : IAsn1Convertible + { + IAsn1Convertible ReadObject(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SequenceParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SequenceParser.cs.meta new file mode 100644 index 00000000..e4194e05 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SequenceParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 945f35756f280754580483acdd35d1f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SetParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SetParser.cs new file mode 100644 index 00000000..c5eda4c5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SetParser.cs @@ -0,0 +1,12 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public interface Asn1SetParser + : IAsn1Convertible + { + IAsn1Convertible ReadObject(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SetParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SetParser.cs.meta new file mode 100644 index 00000000..ce0441dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1SetParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5c4059ebe7ac0240878ec76e191d1ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1StreamParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1StreamParser.cs new file mode 100644 index 00000000..d76a3ad1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1StreamParser.cs @@ -0,0 +1,238 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class Asn1StreamParser + { + private readonly Stream _in; + private readonly int _limit; + + private readonly byte[][] tmpBuffers; + + public Asn1StreamParser( + Stream inStream) + : this(inStream, Asn1InputStream.FindLimit(inStream)) + { + } + + public Asn1StreamParser( + Stream inStream, + int limit) + { + if (!inStream.CanRead) + throw new ArgumentException("Expected stream to be readable", "inStream"); + + this._in = inStream; + this._limit = limit; + this.tmpBuffers = new byte[16][]; + } + + public Asn1StreamParser( + byte[] encoding) + : this(new MemoryStream(encoding, false), encoding.Length) + { + } + + internal IAsn1Convertible ReadIndef(int tagValue) + { + // Note: INDEF => CONSTRUCTED + + // TODO There are other tags that may be constructed (e.g. BIT_STRING) + switch (tagValue) + { + case Asn1Tags.External: + return new DerExternalParser(this); + case Asn1Tags.OctetString: + return new BerOctetStringParser(this); + case Asn1Tags.Sequence: + return new BerSequenceParser(this); + case Asn1Tags.Set: + return new BerSetParser(this); + default: + throw new Asn1Exception("unknown BER object encountered: 0x" + tagValue.ToString("X")); + } + } + + internal IAsn1Convertible ReadImplicit(bool constructed, int tag) + { + if (_in is IndefiniteLengthInputStream) + { + if (!constructed) + throw new IOException("indefinite length primitive encoding encountered"); + + return ReadIndef(tag); + } + + if (constructed) + { + switch (tag) + { + case Asn1Tags.Set: + return new DerSetParser(this); + case Asn1Tags.Sequence: + return new DerSequenceParser(this); + case Asn1Tags.OctetString: + return new BerOctetStringParser(this); + } + } + else + { + switch (tag) + { + case Asn1Tags.Set: + throw new Asn1Exception("sequences must use constructed encoding (see X.690 8.9.1/8.10.1)"); + case Asn1Tags.Sequence: + throw new Asn1Exception("sets must use constructed encoding (see X.690 8.11.1/8.12.1)"); + case Asn1Tags.OctetString: + return new DerOctetStringParser((DefiniteLengthInputStream)_in); + } + } + + throw new Asn1Exception("implicit tagging not implemented"); + } + + internal Asn1Object ReadTaggedObject(bool constructed, int tag) + { + if (!constructed) + { + // Note: !CONSTRUCTED => IMPLICIT + DefiniteLengthInputStream defIn = (DefiniteLengthInputStream)_in; + return new DerTaggedObject(false, tag, new DerOctetString(defIn.ToArray())); + } + + Asn1EncodableVector v = ReadVector(); + + if (_in is IndefiniteLengthInputStream) + { + return v.Count == 1 + ? new BerTaggedObject(true, tag, v[0]) + : new BerTaggedObject(false, tag, BerSequence.FromVector(v)); + } + + return v.Count == 1 + ? new DerTaggedObject(true, tag, v[0]) + : new DerTaggedObject(false, tag, DerSequence.FromVector(v)); + } + + public virtual IAsn1Convertible ReadObject() + { + int tag = _in.ReadByte(); + if (tag == -1) + return null; + + // turn of looking for "00" while we resolve the tag + Set00Check(false); + + // + // calculate tag number + // + int tagNo = Asn1InputStream.ReadTagNumber(_in, tag); + + bool isConstructed = (tag & Asn1Tags.Constructed) != 0; + + // + // calculate length + // + int length = Asn1InputStream.ReadLength(_in, _limit); + + if (length < 0) // indefinite length method + { + if (!isConstructed) + throw new IOException("indefinite length primitive encoding encountered"); + + IndefiniteLengthInputStream indIn = new IndefiniteLengthInputStream(_in, _limit); + Asn1StreamParser sp = new Asn1StreamParser(indIn, _limit); + + if ((tag & Asn1Tags.Application) != 0) + { + return new BerApplicationSpecificParser(tagNo, sp); + } + + if ((tag & Asn1Tags.Tagged) != 0) + { + return new BerTaggedObjectParser(true, tagNo, sp); + } + + return sp.ReadIndef(tagNo); + } + else + { + DefiniteLengthInputStream defIn = new DefiniteLengthInputStream(_in, length); + + if ((tag & Asn1Tags.Application) != 0) + { + return new DerApplicationSpecific(isConstructed, tagNo, defIn.ToArray()); + } + + if ((tag & Asn1Tags.Tagged) != 0) + { + return new BerTaggedObjectParser(isConstructed, tagNo, new Asn1StreamParser(defIn)); + } + + if (isConstructed) + { + // TODO There are other tags that may be constructed (e.g. BitString) + switch (tagNo) + { + case Asn1Tags.OctetString: + // + // yes, people actually do this... + // + return new BerOctetStringParser(new Asn1StreamParser(defIn)); + case Asn1Tags.Sequence: + return new DerSequenceParser(new Asn1StreamParser(defIn)); + case Asn1Tags.Set: + return new DerSetParser(new Asn1StreamParser(defIn)); + case Asn1Tags.External: + return new DerExternalParser(new Asn1StreamParser(defIn)); + default: + throw new IOException("unknown tag " + tagNo + " encountered"); + } + } + + // Some primitive encodings can be handled by parsers too... + switch (tagNo) + { + case Asn1Tags.OctetString: + return new DerOctetStringParser(defIn); + } + + try + { + return Asn1InputStream.CreatePrimitiveDerObject(tagNo, defIn, tmpBuffers); + } + catch (ArgumentException e) + { + throw new Asn1Exception("corrupted stream detected", e); + } + } + } + + private void Set00Check( + bool enabled) + { + if (_in is IndefiniteLengthInputStream) + { + ((IndefiniteLengthInputStream) _in).SetEofOn00(enabled); + } + } + + internal Asn1EncodableVector ReadVector() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + IAsn1Convertible obj; + while ((obj = ReadObject()) != null) + { + v.Add(obj.ToAsn1Object()); + } + + return v; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1StreamParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1StreamParser.cs.meta new file mode 100644 index 00000000..dcf144f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1StreamParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12d648f2463b0b34a8a0756dbb9d6bfb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1TaggedObjectParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1TaggedObjectParser.cs new file mode 100644 index 00000000..12410c0f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1TaggedObjectParser.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public interface Asn1TaggedObjectParser + : IAsn1Convertible + { + int TagNo { get; } + + IAsn1Convertible GetObjectParser(int tag, bool isExplicit); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1TaggedObjectParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1TaggedObjectParser.cs.meta new file mode 100644 index 00000000..fffc2b3e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ASN1TaggedObjectParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e183ed6c26f0fac4caebd14e56080e86 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Encodable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Encodable.cs new file mode 100644 index 00000000..9e29de9e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Encodable.cs @@ -0,0 +1,82 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public abstract class Asn1Encodable + : IAsn1Convertible + { + public const string Der = "DER"; + public const string Ber = "BER"; + + public byte[] GetEncoded() + { + MemoryStream bOut = new MemoryStream(); + Asn1OutputStream aOut = new Asn1OutputStream(bOut); + + aOut.WriteObject(this); + + return bOut.ToArray(); + } + + public byte[] GetEncoded( + string encoding) + { + if (encoding.Equals(Der)) + { + MemoryStream bOut = new MemoryStream(); + DerOutputStream dOut = new DerOutputStream(bOut); + + dOut.WriteObject(this); + + return bOut.ToArray(); + } + + return GetEncoded(); + } + + /** + * Return the DER encoding of the object, null if the DER encoding can not be made. + * + * @return a DER byte array, null otherwise. + */ + public byte[] GetDerEncoded() + { + try + { + return GetEncoded(Der); + } + catch (IOException) + { + return null; + } + } + + public sealed override int GetHashCode() + { + return ToAsn1Object().CallAsn1GetHashCode(); + } + + public sealed override bool Equals( + object obj) + { + if (obj == this) + return true; + + IAsn1Convertible other = obj as IAsn1Convertible; + + if (other == null) + return false; + + Asn1Object o1 = ToAsn1Object(); + Asn1Object o2 = other.ToAsn1Object(); + + return o1 == o2 || o1.CallAsn1Equals(o2); + } + + public abstract Asn1Object ToAsn1Object(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Encodable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Encodable.cs.meta new file mode 100644 index 00000000..f4215c8f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Encodable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b69b682df6ac1845b77ec1b6bf0427d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1EncodableVector.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1EncodableVector.cs new file mode 100644 index 00000000..df2769d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1EncodableVector.cs @@ -0,0 +1,97 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class Asn1EncodableVector + : IEnumerable + { + private IList v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + public static Asn1EncodableVector FromEnumerable( + IEnumerable e) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + foreach (Asn1Encodable obj in e) + { + v.Add(obj); + } + return v; + } + +// public Asn1EncodableVector() +// { +// } + + public Asn1EncodableVector( + params Asn1Encodable[] v) + { + Add(v); + } + +// public void Add( +// Asn1Encodable obj) +// { +// v.Add(obj); +// } + + public void Add( + params Asn1Encodable[] objs) + { + foreach (Asn1Encodable obj in objs) + { + v.Add(obj); + } + } + + public void AddOptional( + params Asn1Encodable[] objs) + { + if (objs != null) + { + foreach (Asn1Encodable obj in objs) + { + if (obj != null) + { + v.Add(obj); + } + } + } + } + + public Asn1Encodable this[ + int index] + { + get { return (Asn1Encodable) v[index]; } + } + + [Obsolete("Use 'object[index]' syntax instead")] + public Asn1Encodable Get( + int index) + { + return this[index]; + } + + [Obsolete("Use 'Count' property instead")] + public int Size + { + get { return v.Count; } + } + + public int Count + { + get { return v.Count; } + } + + public IEnumerator GetEnumerator() + { + return v.GetEnumerator(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1EncodableVector.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1EncodableVector.cs.meta new file mode 100644 index 00000000..8a71ee65 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1EncodableVector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3245f80405a56e41ad1c7af42022aea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Exception.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Exception.cs new file mode 100644 index 00000000..0cb0ac2a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Exception.cs @@ -0,0 +1,34 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class Asn1Exception + : IOException + { + public Asn1Exception() + : base() + { + } + + public Asn1Exception( + string message) + : base(message) + { + } + + public Asn1Exception( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Exception.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Exception.cs.meta new file mode 100644 index 00000000..eea64643 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Exception.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bbd822b3cbfd4b643a313c46df1ee0a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1InputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1InputStream.cs new file mode 100644 index 00000000..20382bfa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1InputStream.cs @@ -0,0 +1,375 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * a general purpose ASN.1 decoder - note: this class differs from the + * others in that it returns null after it has read the last object in + * the stream. If an ASN.1 Null is encountered a Der/BER Null object is + * returned. + */ + public class Asn1InputStream + : FilterStream + { + private readonly int limit; + + private readonly byte[][] tmpBuffers; + + internal static int FindLimit(Stream input) + { + if (input is LimitedInputStream) + { + return ((LimitedInputStream)input).GetRemaining(); + } + else if (input is MemoryStream) + { + MemoryStream mem = (MemoryStream)input; + return (int)(mem.Length - mem.Position); + } + + return int.MaxValue; + } + + public Asn1InputStream( + Stream inputStream) + : this(inputStream, FindLimit(inputStream)) + { + } + + /** + * Create an ASN1InputStream where no DER object will be longer than limit. + * + * @param input stream containing ASN.1 encoded data. + * @param limit maximum size of a DER encoded object. + */ + public Asn1InputStream( + Stream inputStream, + int limit) + : base(inputStream) + { + this.limit = limit; + this.tmpBuffers = new byte[16][]; + } + + /** + * Create an ASN1InputStream based on the input byte array. The length of DER objects in + * the stream is automatically limited to the length of the input array. + * + * @param input array containing ASN.1 encoded data. + */ + public Asn1InputStream( + byte[] input) + : this(new MemoryStream(input, false), input.Length) + { + } + + /** + * build an object given its tag and the number of bytes to construct it from. + */ + private Asn1Object BuildObject( + int tag, + int tagNo, + int length) + { + bool isConstructed = (tag & Asn1Tags.Constructed) != 0; + + DefiniteLengthInputStream defIn = new DefiniteLengthInputStream(this.s, length); + + if ((tag & Asn1Tags.Application) != 0) + { + return new DerApplicationSpecific(isConstructed, tagNo, defIn.ToArray()); + } + + if ((tag & Asn1Tags.Tagged) != 0) + { + return new Asn1StreamParser(defIn).ReadTaggedObject(isConstructed, tagNo); + } + + if (isConstructed) + { + // TODO There are other tags that may be constructed (e.g. BitString) + switch (tagNo) + { + case Asn1Tags.OctetString: + // + // yes, people actually do this... + // + return new BerOctetString(BuildDerEncodableVector(defIn)); + case Asn1Tags.Sequence: + return CreateDerSequence(defIn); + case Asn1Tags.Set: + return CreateDerSet(defIn); + case Asn1Tags.External: + return new DerExternal(BuildDerEncodableVector(defIn)); + default: + throw new IOException("unknown tag " + tagNo + " encountered"); + } + } + + return CreatePrimitiveDerObject(tagNo, defIn, tmpBuffers); + } + + internal Asn1EncodableVector BuildEncodableVector() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + Asn1Object o; + while ((o = ReadObject()) != null) + { + v.Add(o); + } + + return v; + } + + internal virtual Asn1EncodableVector BuildDerEncodableVector( + DefiniteLengthInputStream dIn) + { + return new Asn1InputStream(dIn).BuildEncodableVector(); + } + + internal virtual DerSequence CreateDerSequence( + DefiniteLengthInputStream dIn) + { + return DerSequence.FromVector(BuildDerEncodableVector(dIn)); + } + + internal virtual DerSet CreateDerSet( + DefiniteLengthInputStream dIn) + { + return DerSet.FromVector(BuildDerEncodableVector(dIn), false); + } + + public Asn1Object ReadObject() + { + int tag = ReadByte(); + if (tag <= 0) + { + if (tag == 0) + throw new IOException("unexpected end-of-contents marker"); + + return null; + } + + // + // calculate tag number + // + int tagNo = ReadTagNumber(this.s, tag); + + bool isConstructed = (tag & Asn1Tags.Constructed) != 0; + + // + // calculate length + // + int length = ReadLength(this.s, limit); + + if (length < 0) // indefinite length method + { + if (!isConstructed) + throw new IOException("indefinite length primitive encoding encountered"); + + IndefiniteLengthInputStream indIn = new IndefiniteLengthInputStream(this.s, limit); + Asn1StreamParser sp = new Asn1StreamParser(indIn, limit); + + if ((tag & Asn1Tags.Application) != 0) + { + return new BerApplicationSpecificParser(tagNo, sp).ToAsn1Object(); + } + + if ((tag & Asn1Tags.Tagged) != 0) + { + return new BerTaggedObjectParser(true, tagNo, sp).ToAsn1Object(); + } + + // TODO There are other tags that may be constructed (e.g. BitString) + switch (tagNo) + { + case Asn1Tags.OctetString: + return new BerOctetStringParser(sp).ToAsn1Object(); + case Asn1Tags.Sequence: + return new BerSequenceParser(sp).ToAsn1Object(); + case Asn1Tags.Set: + return new BerSetParser(sp).ToAsn1Object(); + case Asn1Tags.External: + return new DerExternalParser(sp).ToAsn1Object(); + default: + throw new IOException("unknown BER object encountered"); + } + } + else + { + try + { + return BuildObject(tag, tagNo, length); + } + catch (ArgumentException e) + { + throw new Asn1Exception("corrupted stream detected", e); + } + } + } + + internal static int ReadTagNumber( + Stream s, + int tag) + { + int tagNo = tag & 0x1f; + + // + // with tagged object tag number is bottom 5 bits, or stored at the start of the content + // + if (tagNo == 0x1f) + { + tagNo = 0; + + int b = s.ReadByte(); + + // X.690-0207 8.1.2.4.2 + // "c) bits 7 to 1 of the first subsequent octet shall not all be zero." + if ((b & 0x7f) == 0) // Note: -1 will pass + { + throw new IOException("Corrupted stream - invalid high tag number found"); + } + + while ((b >= 0) && ((b & 0x80) != 0)) + { + tagNo |= (b & 0x7f); + tagNo <<= 7; + b = s.ReadByte(); + } + + if (b < 0) + throw new EndOfStreamException("EOF found inside tag value."); + + tagNo |= (b & 0x7f); + } + + return tagNo; + } + + internal static int ReadLength( + Stream s, + int limit) + { + int length = s.ReadByte(); + if (length < 0) + throw new EndOfStreamException("EOF found when length expected"); + + if (length == 0x80) + return -1; // indefinite-length encoding + + if (length > 127) + { + int size = length & 0x7f; + + // Note: The invalid long form "0xff" (see X.690 8.1.3.5c) will be caught here + if (size > 4) + throw new IOException("DER length more than 4 bytes: " + size); + + length = 0; + for (int i = 0; i < size; i++) + { + int next = s.ReadByte(); + + if (next < 0) + throw new EndOfStreamException("EOF found reading length"); + + length = (length << 8) + next; + } + + if (length < 0) + throw new IOException("Corrupted stream - negative length found"); + + if (length >= limit) // after all we must have read at least 1 byte + throw new IOException("Corrupted stream - out of bounds length found"); + } + + return length; + } + + internal static byte[] GetBuffer(DefiniteLengthInputStream defIn, byte[][] tmpBuffers) + { + int len = defIn.GetRemaining(); + if (len >= tmpBuffers.Length) + { + return defIn.ToArray(); + } + + byte[] buf = tmpBuffers[len]; + if (buf == null) + { + buf = tmpBuffers[len] = new byte[len]; + } + + defIn.ReadAllIntoByteArray(buf); + + return buf; + } + + internal static Asn1Object CreatePrimitiveDerObject( + int tagNo, + DefiniteLengthInputStream defIn, + byte[][] tmpBuffers) + { + switch (tagNo) + { + case Asn1Tags.Boolean: + return DerBoolean.FromOctetString(GetBuffer(defIn, tmpBuffers)); + case Asn1Tags.Enumerated: + return DerEnumerated.FromOctetString(GetBuffer(defIn, tmpBuffers)); + case Asn1Tags.ObjectIdentifier: + return DerObjectIdentifier.FromOctetString(GetBuffer(defIn, tmpBuffers)); + } + + byte[] bytes = defIn.ToArray(); + + switch (tagNo) + { + case Asn1Tags.BitString: + return DerBitString.FromAsn1Octets(bytes); + case Asn1Tags.BmpString: + return new DerBmpString(bytes); + case Asn1Tags.GeneralizedTime: + return new DerGeneralizedTime(bytes); + case Asn1Tags.GeneralString: + return new DerGeneralString(bytes); + case Asn1Tags.GraphicString: + return new DerGraphicString(bytes); + case Asn1Tags.IA5String: + return new DerIA5String(bytes); + case Asn1Tags.Integer: + return new DerInteger(bytes); + case Asn1Tags.Null: + return DerNull.Instance; // actual content is ignored (enforce 0 length?) + case Asn1Tags.NumericString: + return new DerNumericString(bytes); + case Asn1Tags.OctetString: + return new DerOctetString(bytes); + case Asn1Tags.PrintableString: + return new DerPrintableString(bytes); + case Asn1Tags.T61String: + return new DerT61String(bytes); + case Asn1Tags.UniversalString: + return new DerUniversalString(bytes); + case Asn1Tags.UtcTime: + return new DerUtcTime(bytes); + case Asn1Tags.Utf8String: + return new DerUtf8String(bytes); + case Asn1Tags.VideotexString: + return new DerVideotexString(bytes); + case Asn1Tags.VisibleString: + return new DerVisibleString(bytes); + default: + throw new IOException("unknown tag " + tagNo + " encountered"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1InputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1InputStream.cs.meta new file mode 100644 index 00000000..f97b5115 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1InputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e252ac704e464264d8409a56a0bb3eb3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Null.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Null.cs new file mode 100644 index 00000000..f1d756b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Null.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * A Null object. + */ + public abstract class Asn1Null + : Asn1Object + { + internal Asn1Null() + { + } + + public override string ToString() + { + return "NULL"; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Null.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Null.cs.meta new file mode 100644 index 00000000..a829bca4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Null.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b6ffeb7c543040429c96c7fa0041261 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Object.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Object.cs new file mode 100644 index 00000000..7deefbae --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Object.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public abstract class Asn1Object + : Asn1Encodable + { + /// Create a base ASN.1 object from a byte array. + /// The byte array to parse. + /// The base ASN.1 object represented by the byte array. + /// + /// If there is a problem parsing the data, or parsing an object did not exhaust the available data. + /// + public static Asn1Object FromByteArray( + byte[] data) + { + try + { + MemoryStream input = new MemoryStream(data, false); + Asn1InputStream asn1 = new Asn1InputStream(input, data.Length); + Asn1Object result = asn1.ReadObject(); + if (input.Position != input.Length) + throw new IOException("extra data found after object"); + return result; + } + catch (InvalidCastException) + { + throw new IOException("cannot recognise object in byte array"); + } + } + + /// Read a base ASN.1 object from a stream. + /// The stream to parse. + /// The base ASN.1 object represented by the byte array. + /// If there is a problem parsing the data. + public static Asn1Object FromStream( + Stream inStr) + { + try + { + return new Asn1InputStream(inStr).ReadObject(); + } + catch (InvalidCastException) + { + throw new IOException("cannot recognise object in stream"); + } + } + + public sealed override Asn1Object ToAsn1Object() + { + return this; + } + + internal abstract void Encode(DerOutputStream derOut); + + protected abstract bool Asn1Equals(Asn1Object asn1Object); + protected abstract int Asn1GetHashCode(); + + internal bool CallAsn1Equals(Asn1Object obj) + { + return Asn1Equals(obj); + } + + internal int CallAsn1GetHashCode() + { + return Asn1GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Object.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Object.cs.meta new file mode 100644 index 00000000..a702d99c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Object.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 86b4801bceb05f54ab0490784feb75c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OctetString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OctetString.cs new file mode 100644 index 00000000..422d4e19 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OctetString.cs @@ -0,0 +1,123 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public abstract class Asn1OctetString + : Asn1Object, Asn1OctetStringParser + { + internal byte[] str; + + /** + * return an Octet string from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static Asn1OctetString GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is Asn1OctetString) + { + return GetInstance(o); + } + + return BerOctetString.FromSequence(Asn1Sequence.GetInstance(o)); + } + + /** + * return an Octet string from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static Asn1OctetString GetInstance(object obj) + { + if (obj == null || obj is Asn1OctetString) + { + return (Asn1OctetString)obj; + } + + // TODO: this needs to be deleted in V2 + if (obj is Asn1TaggedObject) + return GetInstance(((Asn1TaggedObject)obj).GetObject()); + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * @param string the octets making up the octet string. + */ + internal Asn1OctetString( + byte[] str) + { + if (str == null) + throw new ArgumentNullException("str"); + + this.str = str; + } + + internal Asn1OctetString( + Asn1Encodable obj) + { + try + { + this.str = obj.GetEncoded(Asn1Encodable.Der); + } + catch (IOException e) + { + throw new ArgumentException("Error processing object : " + e.ToString()); + } + } + + public Stream GetOctetStream() + { + return new MemoryStream(str, false); + } + + public Asn1OctetStringParser Parser + { + get { return this; } + } + + public virtual byte[] GetOctets() + { + return str; + } + + protected override int Asn1GetHashCode() + { + return Arrays.GetHashCode(GetOctets()); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerOctetString other = asn1Object as DerOctetString; + + if (other == null) + return false; + + return Arrays.AreEqual(GetOctets(), other.GetOctets()); + } + + public override string ToString() + { + return "#" + Hex.ToHexString(str); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OctetString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OctetString.cs.meta new file mode 100644 index 00000000..da7987a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OctetString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 605a6b277ffde7640a895840c2243816 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OutputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OutputStream.cs new file mode 100644 index 00000000..b11954c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OutputStream.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class Asn1OutputStream + : DerOutputStream + { + public Asn1OutputStream(Stream os) : base(os) + { + } + + [Obsolete("Use version taking an Asn1Encodable arg instead")] + public override void WriteObject( + object obj) + { + if (obj == null) + { + WriteNull(); + } + else if (obj is Asn1Object) + { + ((Asn1Object)obj).Encode(this); + } + else if (obj is Asn1Encodable) + { + ((Asn1Encodable)obj).ToAsn1Object().Encode(this); + } + else + { + throw new IOException("object not Asn1Encodable"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OutputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OutputStream.cs.meta new file mode 100644 index 00000000..164c0172 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1OutputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca2e340a1bd44254cac396effbb16cda +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1ParsingException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1ParsingException.cs new file mode 100644 index 00000000..48b6a8f2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1ParsingException.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class Asn1ParsingException + : InvalidOperationException + { + public Asn1ParsingException() + : base() + { + } + + public Asn1ParsingException( + string message) + : base(message) + { + } + + public Asn1ParsingException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1ParsingException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1ParsingException.cs.meta new file mode 100644 index 00000000..ce065d28 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1ParsingException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e565a5f2f13a702468596b17c248ac68 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Sequence.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Sequence.cs new file mode 100644 index 00000000..43af0b1d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Sequence.cs @@ -0,0 +1,272 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public abstract class Asn1Sequence + : Asn1Object, IEnumerable + { + private readonly IList seq; + + /** + * return an Asn1Sequence from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static Asn1Sequence GetInstance( + object obj) + { + if (obj == null || obj is Asn1Sequence) + { + return (Asn1Sequence)obj; + } + else if (obj is Asn1SequenceParser) + { + return Asn1Sequence.GetInstance(((Asn1SequenceParser)obj).ToAsn1Object()); + } + else if (obj is byte[]) + { + try + { + return Asn1Sequence.GetInstance(FromByteArray((byte[])obj)); + } + catch (IOException e) + { + throw new ArgumentException("failed to construct sequence from byte[]: " + e.Message); + } + } + else if (obj is Asn1Encodable) + { + Asn1Object primitive = ((Asn1Encodable)obj).ToAsn1Object(); + + if (primitive is Asn1Sequence) + { + return (Asn1Sequence)primitive; + } + } + + throw new ArgumentException("Unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Return an ASN1 sequence from a tagged object. There is a special + * case here, if an object appears to have been explicitly tagged on + * reading but we were expecting it to be implicitly tagged in the + * normal course of events it indicates that we lost the surrounding + * sequence - so we need to add it back (this will happen if the tagged + * object is a sequence that contains other sequences). If you are + * dealing with implicitly tagged sequences you really should + * be using this method. + * + * @param obj the tagged object. + * @param explicitly true if the object is meant to be explicitly tagged, + * false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static Asn1Sequence GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + Asn1Object inner = obj.GetObject(); + + if (explicitly) + { + if (!obj.IsExplicit()) + throw new ArgumentException("object implicit - explicit expected."); + + return (Asn1Sequence) inner; + } + + // + // constructed object which appears to be explicitly tagged + // when it should be implicit means we have to add the + // surrounding sequence. + // + if (obj.IsExplicit()) + { + if (obj is BerTaggedObject) + { + return new BerSequence(inner); + } + + return new DerSequence(inner); + } + + if (inner is Asn1Sequence) + { + return (Asn1Sequence) inner; + } + + throw new ArgumentException("Unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + protected internal Asn1Sequence( + int capacity) + { + seq = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(capacity); + } + + public virtual IEnumerator GetEnumerator() + { + return seq.GetEnumerator(); + } + + [Obsolete("Use GetEnumerator() instead")] + public IEnumerator GetObjects() + { + return GetEnumerator(); + } + + private class Asn1SequenceParserImpl + : Asn1SequenceParser + { + private readonly Asn1Sequence outer; + private readonly int max; + private int index; + + public Asn1SequenceParserImpl( + Asn1Sequence outer) + { + this.outer = outer; + this.max = outer.Count; + } + + public IAsn1Convertible ReadObject() + { + if (index == max) + return null; + + Asn1Encodable obj = outer[index++]; + + if (obj is Asn1Sequence) + return ((Asn1Sequence)obj).Parser; + + if (obj is Asn1Set) + return ((Asn1Set)obj).Parser; + + // NB: Asn1OctetString implements Asn1OctetStringParser directly +// if (obj is Asn1OctetString) +// return ((Asn1OctetString)obj).Parser; + + return obj; + } + + public Asn1Object ToAsn1Object() + { + return outer; + } + } + + public virtual Asn1SequenceParser Parser + { + get { return new Asn1SequenceParserImpl(this); } + } + + /** + * return the object at the sequence position indicated by index. + * + * @param index the sequence number (starting at zero) of the object + * @return the object at the sequence position indicated by index. + */ + public virtual Asn1Encodable this[int index] + { + get { return (Asn1Encodable) seq[index]; } + } + + [Obsolete("Use 'object[index]' syntax instead")] + public Asn1Encodable GetObjectAt( + int index) + { + return this[index]; + } + + [Obsolete("Use 'Count' property instead")] + public int Size + { + get { return Count; } + } + + public virtual int Count + { + get { return seq.Count; } + } + + protected override int Asn1GetHashCode() + { + int hc = Count; + + foreach (object o in this) + { + hc *= 17; + if (o == null) + { + hc ^= DerNull.Instance.GetHashCode(); + } + else + { + hc ^= o.GetHashCode(); + } + } + + return hc; + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + Asn1Sequence other = asn1Object as Asn1Sequence; + + if (other == null) + return false; + + if (Count != other.Count) + return false; + + IEnumerator s1 = GetEnumerator(); + IEnumerator s2 = other.GetEnumerator(); + + while (s1.MoveNext() && s2.MoveNext()) + { + Asn1Object o1 = GetCurrent(s1).ToAsn1Object(); + Asn1Object o2 = GetCurrent(s2).ToAsn1Object(); + + if (!o1.Equals(o2)) + return false; + } + + return true; + } + + private Asn1Encodable GetCurrent(IEnumerator e) + { + Asn1Encodable encObj = (Asn1Encodable)e.Current; + + // unfortunately null was allowed as a substitute for DER null + if (encObj == null) + return DerNull.Instance; + + return encObj; + } + + protected internal void AddObject( + Asn1Encodable obj) + { + seq.Add(obj); + } + + public override string ToString() + { + return CollectionUtilities.ToString(seq); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Sequence.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Sequence.cs.meta new file mode 100644 index 00000000..a7ac3670 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Sequence.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 251efabb5e3250d49ad3fb7b45d68d01 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Set.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Set.cs new file mode 100644 index 00000000..c805afd5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Set.cs @@ -0,0 +1,376 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +#if PORTABLE || NETFX_CORE +using System.Collections.Generic; +using System.Linq; +#endif + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + abstract public class Asn1Set + : Asn1Object, IEnumerable + { + private readonly IList _set; + + /** + * return an ASN1Set from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static Asn1Set GetInstance( + object obj) + { + if (obj == null || obj is Asn1Set) + { + return (Asn1Set)obj; + } + else if (obj is Asn1SetParser) + { + return Asn1Set.GetInstance(((Asn1SetParser)obj).ToAsn1Object()); + } + else if (obj is byte[]) + { + try + { + return Asn1Set.GetInstance(FromByteArray((byte[])obj)); + } + catch (IOException e) + { + throw new ArgumentException("failed to construct set from byte[]: " + e.Message); + } + } + else if (obj is Asn1Encodable) + { + Asn1Object primitive = ((Asn1Encodable)obj).ToAsn1Object(); + + if (primitive is Asn1Set) + { + return (Asn1Set)primitive; + } + } + + throw new ArgumentException("Unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Return an ASN1 set from a tagged object. There is a special + * case here, if an object appears to have been explicitly tagged on + * reading but we were expecting it to be implicitly tagged in the + * normal course of events it indicates that we lost the surrounding + * set - so we need to add it back (this will happen if the tagged + * object is a sequence that contains other sequences). If you are + * dealing with implicitly tagged sets you really should + * be using this method. + * + * @param obj the tagged object. + * @param explicitly true if the object is meant to be explicitly tagged + * false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static Asn1Set GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + Asn1Object inner = obj.GetObject(); + + if (explicitly) + { + if (!obj.IsExplicit()) + throw new ArgumentException("object implicit - explicit expected."); + + return (Asn1Set) inner; + } + + // + // constructed object which appears to be explicitly tagged + // and it's really implicit means we have to add the + // surrounding sequence. + // + if (obj.IsExplicit()) + { + return new DerSet(inner); + } + + if (inner is Asn1Set) + { + return (Asn1Set) inner; + } + + // + // in this case the parser returns a sequence, convert it + // into a set. + // + if (inner is Asn1Sequence) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + Asn1Sequence s = (Asn1Sequence) inner; + + foreach (Asn1Encodable ae in s) + { + v.Add(ae); + } + + // TODO Should be able to construct set directly from sequence? + return new DerSet(v, false); + } + + throw new ArgumentException("Unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + protected internal Asn1Set( + int capacity) + { + _set = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(capacity); + } + + public virtual IEnumerator GetEnumerator() + { + return _set.GetEnumerator(); + } + + [Obsolete("Use GetEnumerator() instead")] + public IEnumerator GetObjects() + { + return GetEnumerator(); + } + + /** + * return the object at the set position indicated by index. + * + * @param index the set number (starting at zero) of the object + * @return the object at the set position indicated by index. + */ + public virtual Asn1Encodable this[int index] + { + get { return (Asn1Encodable) _set[index]; } + } + + [Obsolete("Use 'object[index]' syntax instead")] + public Asn1Encodable GetObjectAt( + int index) + { + return this[index]; + } + + [Obsolete("Use 'Count' property instead")] + public int Size + { + get { return Count; } + } + + public virtual int Count + { + get { return _set.Count; } + } + + public virtual Asn1Encodable[] ToArray() + { + Asn1Encodable[] values = new Asn1Encodable[this.Count]; + for (int i = 0; i < this.Count; ++i) + { + values[i] = this[i]; + } + return values; + } + + private class Asn1SetParserImpl + : Asn1SetParser + { + private readonly Asn1Set outer; + private readonly int max; + private int index; + + public Asn1SetParserImpl( + Asn1Set outer) + { + this.outer = outer; + this.max = outer.Count; + } + + public IAsn1Convertible ReadObject() + { + if (index == max) + return null; + + Asn1Encodable obj = outer[index++]; + if (obj is Asn1Sequence) + return ((Asn1Sequence)obj).Parser; + + if (obj is Asn1Set) + return ((Asn1Set)obj).Parser; + + // NB: Asn1OctetString implements Asn1OctetStringParser directly +// if (obj is Asn1OctetString) +// return ((Asn1OctetString)obj).Parser; + + return obj; + } + + public virtual Asn1Object ToAsn1Object() + { + return outer; + } + } + + public Asn1SetParser Parser + { + get { return new Asn1SetParserImpl(this); } + } + + protected override int Asn1GetHashCode() + { + int hc = Count; + + foreach (object o in this) + { + hc *= 17; + if (o == null) + { + hc ^= DerNull.Instance.GetHashCode(); + } + else + { + hc ^= o.GetHashCode(); + } + } + + return hc; + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + Asn1Set other = asn1Object as Asn1Set; + + if (other == null) + return false; + + if (Count != other.Count) + { + return false; + } + + IEnumerator s1 = GetEnumerator(); + IEnumerator s2 = other.GetEnumerator(); + + while (s1.MoveNext() && s2.MoveNext()) + { + Asn1Object o1 = GetCurrent(s1).ToAsn1Object(); + Asn1Object o2 = GetCurrent(s2).ToAsn1Object(); + + if (!o1.Equals(o2)) + return false; + } + + return true; + } + + private Asn1Encodable GetCurrent(IEnumerator e) + { + Asn1Encodable encObj = (Asn1Encodable)e.Current; + + // unfortunately null was allowed as a substitute for DER null + if (encObj == null) + return DerNull.Instance; + + return encObj; + } + + protected internal void Sort() + { + if (_set.Count < 2) + return; + +#if PORTABLE || NETFX_CORE + var sorted = _set.Cast() + .Select(a => new { Item = a, Key = a.GetEncoded(Asn1Encodable.Der) }) + .OrderBy(t => t.Key, new DerComparer()) + .Select(t => t.Item) + .ToList(); + + for (int i = 0; i < _set.Count; ++i) + { + _set[i] = sorted[i]; + } +#else + Asn1Encodable[] items = new Asn1Encodable[_set.Count]; + byte[][] keys = new byte[_set.Count][]; + + for (int i = 0; i < _set.Count; ++i) + { + Asn1Encodable item = (Asn1Encodable)_set[i]; + items[i] = item; + keys[i] = item.GetEncoded(Asn1Encodable.Der); + } + + Array.Sort(keys, items, new DerComparer()); + + for (int i = 0; i < _set.Count; ++i) + { + _set[i] = items[i]; + } +#endif + } + + protected internal void AddObject(Asn1Encodable obj) + { + _set.Add(obj); + } + + public override string ToString() + { + return CollectionUtilities.ToString(_set); + } + +#if PORTABLE || NETFX_CORE + private class DerComparer + : IComparer + { + public int Compare(byte[] x, byte[] y) + { + byte[] a = x, b = y; +#else + private class DerComparer + : IComparer + { + public int Compare(object x, object y) + { + byte[] a = (byte[])x, b = (byte[])y; +#endif + int len = System.Math.Min(a.Length, b.Length); + for (int i = 0; i != len; ++i) + { + byte ai = a[i], bi = b[i]; + if (ai != bi) + return ai < bi ? -1 : 1; + } + if (a.Length > b.Length) + return AllZeroesFrom(a, len) ? 0 : 1; + if (a.Length < b.Length) + return AllZeroesFrom(b, len) ? 0 : -1; + return 0; + } + + private bool AllZeroesFrom(byte[] bs, int pos) + { + while (pos < bs.Length) + { + if (bs[pos++] != 0) + return false; + } + return true; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Set.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Set.cs.meta new file mode 100644 index 00000000..ea0fc21b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Set.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db687a85bbc7c7240b1b2f57359d0c46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1TaggedObject.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1TaggedObject.cs new file mode 100644 index 00000000..929f1902 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1TaggedObject.cs @@ -0,0 +1,192 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * ASN.1 TaggedObject - in ASN.1 notation this is any object preceded by + * a [n] where n is some number - these are assumed to follow the construction + * rules (as with sequences). + */ + public abstract class Asn1TaggedObject + : Asn1Object, Asn1TaggedObjectParser + { + internal static bool IsConstructed(bool isExplicit, Asn1Object obj) + { + if (isExplicit || obj is Asn1Sequence || obj is Asn1Set) + return true; + Asn1TaggedObject tagged = obj as Asn1TaggedObject; + if (tagged == null) + return false; + return IsConstructed(tagged.IsExplicit(), tagged.GetObject()); + } + + internal int tagNo; +// internal bool empty; + internal bool explicitly = true; + internal Asn1Encodable obj; + + static public Asn1TaggedObject GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + if (explicitly) + { + return (Asn1TaggedObject) obj.GetObject(); + } + + throw new ArgumentException("implicitly tagged tagged object"); + } + + static public Asn1TaggedObject GetInstance( + object obj) + { + if (obj == null || obj is Asn1TaggedObject) + { + return (Asn1TaggedObject) obj; + } + + throw new ArgumentException("Unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * @param tagNo the tag number for this object. + * @param obj the tagged object. + */ + protected Asn1TaggedObject( + int tagNo, + Asn1Encodable obj) + { + this.explicitly = true; + this.tagNo = tagNo; + this.obj = obj; + } + + /** + * @param explicitly true if the object is explicitly tagged. + * @param tagNo the tag number for this object. + * @param obj the tagged object. + */ + protected Asn1TaggedObject( + bool explicitly, + int tagNo, + Asn1Encodable obj) + { + // IAsn1Choice marker interface 'insists' on explicit tagging + this.explicitly = explicitly || (obj is IAsn1Choice); + this.tagNo = tagNo; + this.obj = obj; + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + Asn1TaggedObject other = asn1Object as Asn1TaggedObject; + + if (other == null) + return false; + + return this.tagNo == other.tagNo +// && this.empty == other.empty + && this.explicitly == other.explicitly // TODO Should this be part of equality? + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(GetObject(), other.GetObject()); + } + + protected override int Asn1GetHashCode() + { + int code = tagNo.GetHashCode(); + + // TODO: actually this is wrong - the problem is that a re-encoded + // object may end up with a different hashCode due to implicit + // tagging. As implicit tagging is ambiguous if a sequence is involved + // it seems the only correct method for both equals and hashCode is to + // compare the encodings... +// code ^= explicitly.GetHashCode(); + + if (obj != null) + { + code ^= obj.GetHashCode(); + } + + return code; + } + + public int TagNo + { + get { return tagNo; } + } + + /** + * return whether or not the object may be explicitly tagged. + *

+ * Note: if the object has been read from an input stream, the only + * time you can be sure if isExplicit is returning the true state of + * affairs is if it returns false. An implicitly tagged object may appear + * to be explicitly tagged, so you need to understand the context under + * which the reading was done as well, see GetObject below.

+ */ + public bool IsExplicit() + { + return explicitly; + } + + public bool IsEmpty() + { + return false; //empty; + } + + /** + * return whatever was following the tag. + *

+ * Note: tagged objects are generally context dependent if you're + * trying to extract a tagged object you should be going via the + * appropriate GetInstance method.

+ */ + public Asn1Object GetObject() + { + if (obj != null) + { + return obj.ToAsn1Object(); + } + + return null; + } + + /** + * Return the object held in this tagged object as a parser assuming it has + * the type of the passed in tag. If the object doesn't have a parser + * associated with it, the base object is returned. + */ + public IAsn1Convertible GetObjectParser( + int tag, + bool isExplicit) + { + switch (tag) + { + case Asn1Tags.Set: + return Asn1Set.GetInstance(this, isExplicit).Parser; + case Asn1Tags.Sequence: + return Asn1Sequence.GetInstance(this, isExplicit).Parser; + case Asn1Tags.OctetString: + return Asn1OctetString.GetInstance(this, isExplicit).Parser; + } + + if (isExplicit) + { + return GetObject(); + } + + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("implicit tagging for tag: " + tag); + } + + public override string ToString() + { + return "[" + tagNo + "]" + obj; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1TaggedObject.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1TaggedObject.cs.meta new file mode 100644 index 00000000..b1939c6b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1TaggedObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8dc761d7a5e48814998a495824555f3a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Tags.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Tags.cs new file mode 100644 index 00000000..ded6d895 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Tags.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class Asn1Tags + { + public const int Boolean = 0x01; + public const int Integer = 0x02; + public const int BitString = 0x03; + public const int OctetString = 0x04; + public const int Null = 0x05; + public const int ObjectIdentifier = 0x06; + public const int External = 0x08; + public const int Enumerated = 0x0a; + public const int Sequence = 0x10; + public const int SequenceOf = 0x10; // for completeness + public const int Set = 0x11; + public const int SetOf = 0x11; // for completeness + + public const int NumericString = 0x12; + public const int PrintableString = 0x13; + public const int T61String = 0x14; + public const int VideotexString = 0x15; + public const int IA5String = 0x16; + public const int UtcTime = 0x17; + public const int GeneralizedTime = 0x18; + public const int GraphicString = 0x19; + public const int VisibleString = 0x1a; + public const int GeneralString = 0x1b; + public const int UniversalString = 0x1c; + public const int BmpString = 0x1e; + public const int Utf8String = 0x0c; + + public const int Constructed = 0x20; + public const int Application = 0x40; + public const int Tagged = 0x80; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Tags.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Tags.cs.meta new file mode 100644 index 00000000..d12170b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/Asn1Tags.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d609f8d10b0a5c469fd85eb4b389e30 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERBitString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERBitString.cs new file mode 100644 index 00000000..93dafa25 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERBitString.cs @@ -0,0 +1,47 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerBitString + : DerBitString + { + public BerBitString(byte[] data, int padBits) + : base(data, padBits) + { + } + + public BerBitString(byte[] data) + : base(data) + { + } + + public BerBitString(int namedBits) + : base(namedBits) + { + } + + public BerBitString(Asn1Encodable obj) + : base(obj) + { + } + + internal override void Encode( + DerOutputStream derOut) + { + if (derOut is Asn1OutputStream || derOut is BerOutputStream) + { + derOut.WriteEncoded(Asn1Tags.BitString, (byte)mPadBits, mData); + } + else + { + base.Encode(derOut); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERBitString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERBitString.cs.meta new file mode 100644 index 00000000..3814fd63 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERBitString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e6d38188b772c2409c7dad9240d601a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERGenerator.cs new file mode 100644 index 00000000..5d1b6466 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERGenerator.cs @@ -0,0 +1,106 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerGenerator + : Asn1Generator + { + private bool _tagged = false; + private bool _isExplicit; + private int _tagNo; + + protected BerGenerator( + Stream outStream) + : base(outStream) + { + } + + public BerGenerator( + Stream outStream, + int tagNo, + bool isExplicit) + : base(outStream) + { + _tagged = true; + _isExplicit = isExplicit; + _tagNo = tagNo; + } + + public override void AddObject( + Asn1Encodable obj) + { + new BerOutputStream(Out).WriteObject(obj); + } + + public override Stream GetRawOutputStream() + { + return Out; + } + + public override void Close() + { + WriteBerEnd(); + } + + private void WriteHdr( + int tag) + { + Out.WriteByte((byte) tag); + Out.WriteByte(0x80); + } + + protected void WriteBerHeader( + int tag) + { + if (_tagged) + { + int tagNum = _tagNo | Asn1Tags.Tagged; + + if (_isExplicit) + { + WriteHdr(tagNum | Asn1Tags.Constructed); + WriteHdr(tag); + } + else + { + if ((tag & Asn1Tags.Constructed) != 0) + { + WriteHdr(tagNum | Asn1Tags.Constructed); + } + else + { + WriteHdr(tagNum); + } + } + } + else + { + WriteHdr(tag); + } + } + + protected void WriteBerBody( + Stream contentStream) + { + Streams.PipeAll(contentStream, Out); + } + + protected void WriteBerEnd() + { + Out.WriteByte(0x00); + Out.WriteByte(0x00); + + if (_tagged && _isExplicit) // write extra end for tag header + { + Out.WriteByte(0x00); + Out.WriteByte(0x00); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERGenerator.cs.meta new file mode 100644 index 00000000..8dfa7db6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebf471a1d43735f4aa2425eda406c2d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringGenerator.cs new file mode 100644 index 00000000..7135b85a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringGenerator.cs @@ -0,0 +1,137 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerOctetStringGenerator + : BerGenerator + { + public BerOctetStringGenerator(Stream outStream) + : base(outStream) + { + WriteBerHeader(Asn1Tags.Constructed | Asn1Tags.OctetString); + } + + public BerOctetStringGenerator( + Stream outStream, + int tagNo, + bool isExplicit) + : base(outStream, tagNo, isExplicit) + { + WriteBerHeader(Asn1Tags.Constructed | Asn1Tags.OctetString); + } + + public Stream GetOctetOutputStream() + { + return GetOctetOutputStream(new byte[1000]); // limit for CER encoding. + } + + public Stream GetOctetOutputStream( + int bufSize) + { + return bufSize < 1 + ? GetOctetOutputStream() + : GetOctetOutputStream(new byte[bufSize]); + } + + public Stream GetOctetOutputStream( + byte[] buf) + { + return new BufferedBerOctetStream(this, buf); + } + + private class BufferedBerOctetStream + : BaseOutputStream + { + private byte[] _buf; + private int _off; + private readonly BerOctetStringGenerator _gen; + private readonly DerOutputStream _derOut; + + internal BufferedBerOctetStream( + BerOctetStringGenerator gen, + byte[] buf) + { + _gen = gen; + _buf = buf; + _off = 0; + _derOut = new DerOutputStream(_gen.Out); + } + + public override void WriteByte( + byte b) + { + _buf[_off++] = b; + + if (_off == _buf.Length) + { + DerOctetString.Encode(_derOut, _buf, 0, _off); + _off = 0; + } + } + + public override void Write( + byte[] buf, + int offset, + int len) + { + while (len > 0) + { + int numToCopy = System.Math.Min(len, _buf.Length - _off); + + if (numToCopy == _buf.Length) + { + DerOctetString.Encode(_derOut, buf, offset, numToCopy); + } + else + { + Array.Copy(buf, offset, _buf, _off, numToCopy); + + _off += numToCopy; + if (_off < _buf.Length) + break; + + DerOctetString.Encode(_derOut, _buf, 0, _off); + _off = 0; + } + + offset += numToCopy; + len -= numToCopy; + } + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (_off != 0) + { + DerOctetString.Encode(_derOut, _buf, 0, _off); + } + + _gen.WriteBerEnd(); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + if (_off != 0) + { + DerOctetString.Encode(_derOut, _buf, 0, _off); + } + + _gen.WriteBerEnd(); + base.Close(); + } +#endif + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringGenerator.cs.meta new file mode 100644 index 00000000..0c299599 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5318cc9ca270a547b9434252273ff30 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringParser.cs new file mode 100644 index 00000000..3e84f706 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringParser.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerOctetStringParser + : Asn1OctetStringParser + { + private readonly Asn1StreamParser _parser; + + internal BerOctetStringParser( + Asn1StreamParser parser) + { + _parser = parser; + } + + public Stream GetOctetStream() + { + return new ConstructedOctetStream(_parser); + } + + public Asn1Object ToAsn1Object() + { + try + { + return new BerOctetString(Streams.ReadAll(GetOctetStream())); + } + catch (IOException e) + { + throw new Asn1ParsingException("IOException converting stream to byte array: " + e.Message, e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringParser.cs.meta new file mode 100644 index 00000000..5eb6569f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BEROctetStringParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f349002b9962c3f449219681235b114a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceGenerator.cs new file mode 100644 index 00000000..f91d4d0b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceGenerator.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerSequenceGenerator + : BerGenerator + { + public BerSequenceGenerator( + Stream outStream) + : base(outStream) + { + WriteBerHeader(Asn1Tags.Constructed | Asn1Tags.Sequence); + } + + public BerSequenceGenerator( + Stream outStream, + int tagNo, + bool isExplicit) + : base(outStream, tagNo, isExplicit) + { + WriteBerHeader(Asn1Tags.Constructed | Asn1Tags.Sequence); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceGenerator.cs.meta new file mode 100644 index 00000000..2de6026f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39e69b682926f0348a2f183f3d1c8913 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceParser.cs new file mode 100644 index 00000000..f97d2627 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceParser.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerSequenceParser + : Asn1SequenceParser + { + private readonly Asn1StreamParser _parser; + + internal BerSequenceParser( + Asn1StreamParser parser) + { + this._parser = parser; + } + + public IAsn1Convertible ReadObject() + { + return _parser.ReadObject(); + } + + public Asn1Object ToAsn1Object() + { + return new BerSequence(_parser.ReadVector()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceParser.cs.meta new file mode 100644 index 00000000..8bcc4d1d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSequenceParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d593cc0e2b63d14a8aeed9ce0369876 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetGenerator.cs new file mode 100644 index 00000000..1a441940 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetGenerator.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerSetGenerator + : BerGenerator + { + public BerSetGenerator( + Stream outStream) + : base(outStream) + { + WriteBerHeader(Asn1Tags.Constructed | Asn1Tags.Set); + } + + public BerSetGenerator( + Stream outStream, + int tagNo, + bool isExplicit) + : base(outStream, tagNo, isExplicit) + { + WriteBerHeader(Asn1Tags.Constructed | Asn1Tags.Set); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetGenerator.cs.meta new file mode 100644 index 00000000..0bfa4a9b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0fbdbc3f5ccf9f446b5a5b30159adca1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetParser.cs new file mode 100644 index 00000000..9682d945 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetParser.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerSetParser + : Asn1SetParser + { + private readonly Asn1StreamParser _parser; + + internal BerSetParser( + Asn1StreamParser parser) + { + this._parser = parser; + } + + public IAsn1Convertible ReadObject() + { + return _parser.ReadObject(); + } + + public Asn1Object ToAsn1Object() + { + return new BerSet(_parser.ReadVector(), false); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetParser.cs.meta new file mode 100644 index 00000000..94bfc53b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERSetParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0260d4642cd5cf94c965eb9cd0ea9635 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERTaggedObjectParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERTaggedObjectParser.cs new file mode 100644 index 00000000..245cba77 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERTaggedObjectParser.cs @@ -0,0 +1,75 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerTaggedObjectParser + : Asn1TaggedObjectParser + { + private bool _constructed; + private int _tagNumber; + private Asn1StreamParser _parser; + + [Obsolete] + internal BerTaggedObjectParser( + int baseTag, + int tagNumber, + Stream contentStream) + : this((baseTag & Asn1Tags.Constructed) != 0, tagNumber, new Asn1StreamParser(contentStream)) + { + } + + internal BerTaggedObjectParser( + bool constructed, + int tagNumber, + Asn1StreamParser parser) + { + _constructed = constructed; + _tagNumber = tagNumber; + _parser = parser; + } + + public bool IsConstructed + { + get { return _constructed; } + } + + public int TagNo + { + get { return _tagNumber; } + } + + public IAsn1Convertible GetObjectParser( + int tag, + bool isExplicit) + { + if (isExplicit) + { + if (!_constructed) + throw new IOException("Explicit tags must be constructed (see X.690 8.14.2)"); + + return _parser.ReadObject(); + } + + return _parser.ReadImplicit(_constructed, tag); + } + + public Asn1Object ToAsn1Object() + { + try + { + return _parser.ReadTaggedObject(_constructed, _tagNumber); + } + catch (IOException e) + { + throw new Asn1ParsingException(e.Message); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERTaggedObjectParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERTaggedObjectParser.cs.meta new file mode 100644 index 00000000..d6f0bbf0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BERTaggedObjectParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59190053596d8924a9902581e3b94f46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecific.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecific.cs new file mode 100644 index 00000000..1cf90146 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecific.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerApplicationSpecific + : DerApplicationSpecific + { + public BerApplicationSpecific( + int tagNo, + Asn1EncodableVector vec) + : base(tagNo, vec) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecific.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecific.cs.meta new file mode 100644 index 00000000..f96ac9aa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecific.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e34e4ccb03d83c34393d6d2588965d04 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecificParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecificParser.cs new file mode 100644 index 00000000..6bf80e8c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecificParser.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerApplicationSpecificParser + : IAsn1ApplicationSpecificParser + { + private readonly int tag; + private readonly Asn1StreamParser parser; + + internal BerApplicationSpecificParser( + int tag, + Asn1StreamParser parser) + { + this.tag = tag; + this.parser = parser; + } + + public IAsn1Convertible ReadObject() + { + return parser.ReadObject(); + } + + public Asn1Object ToAsn1Object() + { + return new BerApplicationSpecific(tag, parser.ReadVector()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecificParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecificParser.cs.meta new file mode 100644 index 00000000..1e4e53b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerApplicationSpecificParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 584fba93d29d0d84da6c0b7606076a8a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerNull.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerNull.cs new file mode 100644 index 00000000..1f58a08b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerNull.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * A BER Null object. + */ + public class BerNull + : DerNull + { + public static new readonly BerNull Instance = new BerNull(0); + + [Obsolete("Use static Instance object")] + public BerNull() + { + } + + private BerNull(int dummy) : base(dummy) + { + } + + internal override void Encode( + DerOutputStream derOut) + { + if (derOut is Asn1OutputStream || derOut is BerOutputStream) + { + derOut.WriteByte(Asn1Tags.Null); + } + else + { + base.Encode(derOut); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerNull.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerNull.cs.meta new file mode 100644 index 00000000..0419ff4d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerNull.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a02dceb11cea3ba429c665816f9ac259 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOctetString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOctetString.cs new file mode 100644 index 00000000..3337ca54 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOctetString.cs @@ -0,0 +1,139 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerOctetString + : DerOctetString, IEnumerable + { + public static BerOctetString FromSequence(Asn1Sequence seq) + { + IList v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + foreach (Asn1Encodable obj in seq) + { + v.Add(obj); + } + + return new BerOctetString(v); + } + + private const int MaxLength = 1000; + + /** + * convert a vector of octet strings into a single byte string + */ + private static byte[] ToBytes( + IEnumerable octs) + { + MemoryStream bOut = new MemoryStream(); + foreach (DerOctetString o in octs) + { + byte[] octets = o.GetOctets(); + bOut.Write(octets, 0, octets.Length); + } + return bOut.ToArray(); + } + + private readonly IEnumerable octs; + + /// The octets making up the octet string. + public BerOctetString( + byte[] str) + : base(str) + { + } + + public BerOctetString( + IEnumerable octets) + : base(ToBytes(octets)) + { + this.octs = octets; + } + + public BerOctetString( + Asn1Object obj) + : base(obj) + { + } + + public BerOctetString( + Asn1Encodable obj) + : base(obj.ToAsn1Object()) + { + } + + public override byte[] GetOctets() + { + return str; + } + + /** + * return the DER octets that make up this string. + */ + public IEnumerator GetEnumerator() + { + if (octs == null) + { + return GenerateOcts().GetEnumerator(); + } + + return octs.GetEnumerator(); + } + + [Obsolete("Use GetEnumerator() instead")] + public IEnumerator GetObjects() + { + return GetEnumerator(); + } + + private IList GenerateOcts() + { + IList vec = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + for (int i = 0; i < str.Length; i += MaxLength) + { + int end = System.Math.Min(str.Length, i + MaxLength); + + byte[] nStr = new byte[end - i]; + + Array.Copy(str, i, nStr, 0, nStr.Length); + + vec.Add(new DerOctetString(nStr)); + } + return vec; + } + + internal override void Encode( + DerOutputStream derOut) + { + if (derOut is Asn1OutputStream || derOut is BerOutputStream) + { + derOut.WriteByte(Asn1Tags.Constructed | Asn1Tags.OctetString); + + derOut.WriteByte(0x80); + + // + // write out the octet array + // + foreach (DerOctetString oct in this) + { + derOut.WriteObject(oct); + } + + derOut.WriteByte(0x00); + derOut.WriteByte(0x00); + } + else + { + base.Encode(derOut); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOctetString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOctetString.cs.meta new file mode 100644 index 00000000..7e1c7dcf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOctetString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d06a07cbd3b71a74f8cb664efab20cd0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOutputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOutputStream.cs new file mode 100644 index 00000000..e4caa844 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOutputStream.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + // TODO Make Obsolete in favour of Asn1OutputStream? + public class BerOutputStream + : DerOutputStream + { + public BerOutputStream(Stream os) : base(os) + { + } + + [Obsolete("Use version taking an Asn1Encodable arg instead")] + public override void WriteObject( + object obj) + { + if (obj == null) + { + WriteNull(); + } + else if (obj is Asn1Object) + { + ((Asn1Object)obj).Encode(this); + } + else if (obj is Asn1Encodable) + { + ((Asn1Encodable)obj).ToAsn1Object().Encode(this); + } + else + { + throw new IOException("object not BerEncodable"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOutputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOutputStream.cs.meta new file mode 100644 index 00000000..87584cc9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerOutputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2fda066304739a7438fe6eedca01a7a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSequence.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSequence.cs new file mode 100644 index 00000000..b3f905c1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSequence.cs @@ -0,0 +1,73 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerSequence + : DerSequence + { + public static new readonly BerSequence Empty = new BerSequence(); + + public static new BerSequence FromVector( + Asn1EncodableVector v) + { + return v.Count < 1 ? Empty : new BerSequence(v); + } + + /** + * create an empty sequence + */ + public BerSequence() + { + } + + /** + * create a sequence containing one object + */ + public BerSequence( + Asn1Encodable obj) + : base(obj) + { + } + + public BerSequence( + params Asn1Encodable[] v) + : base(v) + { + } + + /** + * create a sequence containing a vector of objects. + */ + public BerSequence( + Asn1EncodableVector v) + : base(v) + { + } + + /* + */ + internal override void Encode( + DerOutputStream derOut) + { + if (derOut is Asn1OutputStream || derOut is BerOutputStream) + { + derOut.WriteByte(Asn1Tags.Sequence | Asn1Tags.Constructed); + derOut.WriteByte(0x80); + + foreach (Asn1Encodable o in this) + { + derOut.WriteObject(o); + } + + derOut.WriteByte(0x00); + derOut.WriteByte(0x00); + } + else + { + base.Encode(derOut); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSequence.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSequence.cs.meta new file mode 100644 index 00000000..8acfaef6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSequence.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c5bc0026174da4a4e878a4914a50457b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSet.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSet.cs new file mode 100644 index 00000000..50ad35b1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSet.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class BerSet + : DerSet + { + public static new readonly BerSet Empty = new BerSet(); + + public static new BerSet FromVector( + Asn1EncodableVector v) + { + return v.Count < 1 ? Empty : new BerSet(v); + } + + internal static new BerSet FromVector( + Asn1EncodableVector v, + bool needsSorting) + { + return v.Count < 1 ? Empty : new BerSet(v, needsSorting); + } + + /** + * create an empty sequence + */ + public BerSet() + { + } + + /** + * create a set containing one object + */ + public BerSet(Asn1Encodable obj) : base(obj) + { + } + + /** + * create a set containing a vector of objects. + */ + public BerSet(Asn1EncodableVector v) : base(v, false) + { + } + + internal BerSet(Asn1EncodableVector v, bool needsSorting) : base(v, needsSorting) + { + } + + /* + */ + internal override void Encode( + DerOutputStream derOut) + { + if (derOut is Asn1OutputStream || derOut is BerOutputStream) + { + derOut.WriteByte(Asn1Tags.Set | Asn1Tags.Constructed); + derOut.WriteByte(0x80); + + foreach (Asn1Encodable o in this) + { + derOut.WriteObject(o); + } + + derOut.WriteByte(0x00); + derOut.WriteByte(0x00); + } + else + { + base.Encode(derOut); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSet.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSet.cs.meta new file mode 100644 index 00000000..8c283b4d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerSet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01890d0dd345cff48bdbba411a658317 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerTaggedObject.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerTaggedObject.cs new file mode 100644 index 00000000..6d3601dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerTaggedObject.cs @@ -0,0 +1,112 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * BER TaggedObject - in ASN.1 notation this is any object preceded by + * a [n] where n is some number - these are assumed to follow the construction + * rules (as with sequences). + */ + public class BerTaggedObject + : DerTaggedObject + { + /** + * @param tagNo the tag number for this object. + * @param obj the tagged object. + */ + public BerTaggedObject( + int tagNo, + Asn1Encodable obj) + : base(tagNo, obj) + { + } + + /** + * @param explicitly true if an explicitly tagged object. + * @param tagNo the tag number for this object. + * @param obj the tagged object. + */ + public BerTaggedObject( + bool explicitly, + int tagNo, + Asn1Encodable obj) + : base(explicitly, tagNo, obj) + { + } + + /** + * create an implicitly tagged object that contains a zero + * length sequence. + */ + public BerTaggedObject( + int tagNo) + : base(false, tagNo, BerSequence.Empty) + { + } + + internal override void Encode( + DerOutputStream derOut) + { + if (derOut is Asn1OutputStream || derOut is BerOutputStream) + { + derOut.WriteTag((byte)(Asn1Tags.Constructed | Asn1Tags.Tagged), tagNo); + derOut.WriteByte(0x80); + + if (!IsEmpty()) + { + if (!explicitly) + { + IEnumerable eObj; + if (obj is Asn1OctetString) + { + if (obj is BerOctetString) + { + eObj = (BerOctetString) obj; + } + else + { + Asn1OctetString octs = (Asn1OctetString)obj; + eObj = new BerOctetString(octs.GetOctets()); + } + } + else if (obj is Asn1Sequence) + { + eObj = (Asn1Sequence) obj; + } + else if (obj is Asn1Set) + { + eObj = (Asn1Set) obj; + } + else + { + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + foreach (Asn1Encodable o in eObj) + { + derOut.WriteObject(o); + } + } + else + { + derOut.WriteObject(obj); + } + } + + derOut.WriteByte(0x00); + derOut.WriteByte(0x00); + } + else + { + base.Encode(derOut); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerTaggedObject.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerTaggedObject.cs.meta new file mode 100644 index 00000000..655fb05c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/BerTaggedObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cb57ca2d9225e0340bc7c9ef54c0bd13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ConstructedOctetStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ConstructedOctetStream.cs new file mode 100644 index 00000000..97014419 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ConstructedOctetStream.cs @@ -0,0 +1,106 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + internal class ConstructedOctetStream + : BaseInputStream + { + private readonly Asn1StreamParser _parser; + + private bool _first = true; + private Stream _currentStream; + + internal ConstructedOctetStream( + Asn1StreamParser parser) + { + _parser = parser; + } + + public override int Read(byte[] buffer, int offset, int count) + { + if (_currentStream == null) + { + if (!_first) + return 0; + + Asn1OctetStringParser s = (Asn1OctetStringParser)_parser.ReadObject(); + + if (s == null) + return 0; + + _first = false; + _currentStream = s.GetOctetStream(); + } + + int totalRead = 0; + + for (;;) + { + int numRead = _currentStream.Read(buffer, offset + totalRead, count - totalRead); + + if (numRead > 0) + { + totalRead += numRead; + + if (totalRead == count) + return totalRead; + } + else + { + Asn1OctetStringParser aos = (Asn1OctetStringParser)_parser.ReadObject(); + + if (aos == null) + { + _currentStream = null; + return totalRead; + } + + _currentStream = aos.GetOctetStream(); + } + } + } + + public override int ReadByte() + { + if (_currentStream == null) + { + if (!_first) + return 0; + + Asn1OctetStringParser s = (Asn1OctetStringParser)_parser.ReadObject(); + + if (s == null) + return 0; + + _first = false; + _currentStream = s.GetOctetStream(); + } + + for (;;) + { + int b = _currentStream.ReadByte(); + + if (b >= 0) + { + return b; + } + + Asn1OctetStringParser aos = (Asn1OctetStringParser)_parser.ReadObject(); + + if (aos == null) + { + _currentStream = null; + return -1; + } + + _currentStream = aos.GetOctetStream(); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ConstructedOctetStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ConstructedOctetStream.cs.meta new file mode 100644 index 00000000..92da60a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ConstructedOctetStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b0993a20facfcf478ecec624bad7b88 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternal.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternal.cs new file mode 100644 index 00000000..5771b6a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternal.cs @@ -0,0 +1,206 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Class representing the DER-type External + */ + public class DerExternal + : Asn1Object + { + private DerObjectIdentifier directReference; + private DerInteger indirectReference; + private Asn1Object dataValueDescriptor; + private int encoding; + private Asn1Object externalContent; + + public DerExternal( + Asn1EncodableVector vector) + { + int offset = 0; + Asn1Object enc = GetObjFromVector(vector, offset); + if (enc is DerObjectIdentifier) + { + directReference = (DerObjectIdentifier)enc; + offset++; + enc = GetObjFromVector(vector, offset); + } + if (enc is DerInteger) + { + indirectReference = (DerInteger) enc; + offset++; + enc = GetObjFromVector(vector, offset); + } + if (!(enc is Asn1TaggedObject)) + { + dataValueDescriptor = enc; + offset++; + enc = GetObjFromVector(vector, offset); + } + + if (vector.Count != offset + 1) + throw new ArgumentException("input vector too large", "vector"); + + if (!(enc is Asn1TaggedObject)) + throw new ArgumentException("No tagged object found in vector. Structure doesn't seem to be of type External", "vector"); + + Asn1TaggedObject obj = (Asn1TaggedObject)enc; + + // Use property accessor to include check on value + Encoding = obj.TagNo; + + if (encoding < 0 || encoding > 2) + throw new InvalidOperationException("invalid encoding value"); + + externalContent = obj.GetObject(); + } + + /** + * Creates a new instance of DerExternal + * See X.690 for more informations about the meaning of these parameters + * @param directReference The direct reference or null if not set. + * @param indirectReference The indirect reference or null if not set. + * @param dataValueDescriptor The data value descriptor or null if not set. + * @param externalData The external data in its encoded form. + */ + public DerExternal(DerObjectIdentifier directReference, DerInteger indirectReference, Asn1Object dataValueDescriptor, DerTaggedObject externalData) + : this(directReference, indirectReference, dataValueDescriptor, externalData.TagNo, externalData.ToAsn1Object()) + { + } + + /** + * Creates a new instance of DerExternal. + * See X.690 for more informations about the meaning of these parameters + * @param directReference The direct reference or null if not set. + * @param indirectReference The indirect reference or null if not set. + * @param dataValueDescriptor The data value descriptor or null if not set. + * @param encoding The encoding to be used for the external data + * @param externalData The external data + */ + public DerExternal(DerObjectIdentifier directReference, DerInteger indirectReference, Asn1Object dataValueDescriptor, int encoding, Asn1Object externalData) + { + DirectReference = directReference; + IndirectReference = indirectReference; + DataValueDescriptor = dataValueDescriptor; + Encoding = encoding; + ExternalContent = externalData.ToAsn1Object(); + } + + internal override void Encode(DerOutputStream derOut) + { + MemoryStream ms = new MemoryStream(); + WriteEncodable(ms, directReference); + WriteEncodable(ms, indirectReference); + WriteEncodable(ms, dataValueDescriptor); + WriteEncodable(ms, new DerTaggedObject(Asn1Tags.External, externalContent)); + + derOut.WriteEncoded(Asn1Tags.Constructed, Asn1Tags.External, ms.ToArray()); + } + + protected override int Asn1GetHashCode() + { + int ret = externalContent.GetHashCode(); + if (directReference != null) + { + ret ^= directReference.GetHashCode(); + } + if (indirectReference != null) + { + ret ^= indirectReference.GetHashCode(); + } + if (dataValueDescriptor != null) + { + ret ^= dataValueDescriptor.GetHashCode(); + } + return ret; + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + if (this == asn1Object) + return true; + + DerExternal other = asn1Object as DerExternal; + + if (other == null) + return false; + + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(directReference, other.directReference) + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(indirectReference, other.indirectReference) + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(dataValueDescriptor, other.dataValueDescriptor) + && externalContent.Equals(other.externalContent); + } + + public Asn1Object DataValueDescriptor + { + get { return dataValueDescriptor; } + set { this.dataValueDescriptor = value; } + } + + public DerObjectIdentifier DirectReference + { + get { return directReference; } + set { this.directReference = value; } + } + + /** + * The encoding of the content. Valid values are + *
    + *
  • 0 single-ASN1-type
  • + *
  • 1 OCTET STRING
  • + *
  • 2 BIT STRING
  • + *
+ */ + public int Encoding + { + get + { + return encoding; + } + set + { + if (encoding < 0 || encoding > 2) + throw new InvalidOperationException("invalid encoding value: " + encoding); + + this.encoding = value; + } + } + + public Asn1Object ExternalContent + { + get { return externalContent; } + set { this.externalContent = value; } + } + + public DerInteger IndirectReference + { + get { return indirectReference; } + set { this.indirectReference = value; } + } + + private static Asn1Object GetObjFromVector(Asn1EncodableVector v, int index) + { + if (v.Count <= index) + throw new ArgumentException("too few objects in input vector", "v"); + + return v[index].ToAsn1Object(); + } + + private static void WriteEncodable(MemoryStream ms, Asn1Encodable e) + { + if (e != null) + { + byte[] bs = e.GetDerEncoded(); + ms.Write(bs, 0, bs.Length); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternal.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternal.cs.meta new file mode 100644 index 00000000..2ad5d445 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 935fe2462b03f3d428919bf7cefbb60b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternalParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternalParser.cs new file mode 100644 index 00000000..f5a243fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternalParser.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerExternalParser + : Asn1Encodable + { + private readonly Asn1StreamParser _parser; + + public DerExternalParser(Asn1StreamParser parser) + { + this._parser = parser; + } + + public IAsn1Convertible ReadObject() + { + return _parser.ReadObject(); + } + + public override Asn1Object ToAsn1Object() + { + return new DerExternal(_parser.ReadVector()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternalParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternalParser.cs.meta new file mode 100644 index 00000000..58402392 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERExternalParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31eecbd25b910414fa16a090b4665272 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERGenerator.cs new file mode 100644 index 00000000..f23fcfdd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERGenerator.cs @@ -0,0 +1,111 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public abstract class DerGenerator + : Asn1Generator + { + private bool _tagged = false; + private bool _isExplicit; + private int _tagNo; + + protected DerGenerator( + Stream outStream) + : base(outStream) + { + } + + protected DerGenerator( + Stream outStream, + int tagNo, + bool isExplicit) + : base(outStream) + { + _tagged = true; + _isExplicit = isExplicit; + _tagNo = tagNo; + } + + private static void WriteLength( + Stream outStr, + int length) + { + if (length > 127) + { + int size = 1; + int val = length; + + while ((val >>= 8) != 0) + { + size++; + } + + outStr.WriteByte((byte)(size | 0x80)); + + for (int i = (size - 1) * 8; i >= 0; i -= 8) + { + outStr.WriteByte((byte)(length >> i)); + } + } + else + { + outStr.WriteByte((byte)length); + } + } + + internal static void WriteDerEncoded( + Stream outStream, + int tag, + byte[] bytes) + { + outStream.WriteByte((byte) tag); + WriteLength(outStream, bytes.Length); + outStream.Write(bytes, 0, bytes.Length); + } + + internal void WriteDerEncoded( + int tag, + byte[] bytes) + { + if (_tagged) + { + int tagNum = _tagNo | Asn1Tags.Tagged; + + if (_isExplicit) + { + int newTag = _tagNo | Asn1Tags.Constructed | Asn1Tags.Tagged; + MemoryStream bOut = new MemoryStream(); + WriteDerEncoded(bOut, tag, bytes); + WriteDerEncoded(Out, newTag, bOut.ToArray()); + } + else + { + if ((tag & Asn1Tags.Constructed) != 0) + { + tagNum |= Asn1Tags.Constructed; + } + + WriteDerEncoded(Out, tagNum, bytes); + } + } + else + { + WriteDerEncoded(Out, tag, bytes); + } + } + + internal static void WriteDerEncoded( + Stream outStr, + int tag, + Stream inStr) + { + WriteDerEncoded(outStr, tag, Streams.ReadAll(inStr)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERGenerator.cs.meta new file mode 100644 index 00000000..e2c2ee6a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 86052d0b423f7dd4e812736107d50f9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DEROctetStringParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DEROctetStringParser.cs new file mode 100644 index 00000000..d67c9d92 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DEROctetStringParser.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerOctetStringParser + : Asn1OctetStringParser + { + private readonly DefiniteLengthInputStream stream; + + internal DerOctetStringParser( + DefiniteLengthInputStream stream) + { + this.stream = stream; + } + + public Stream GetOctetStream() + { + return stream; + } + + public Asn1Object ToAsn1Object() + { + try + { + return new DerOctetString(stream.ToArray()); + } + catch (IOException e) + { + throw new InvalidOperationException("IOException converting stream to byte array: " + e.Message, e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DEROctetStringParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DEROctetStringParser.cs.meta new file mode 100644 index 00000000..bba9aa90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DEROctetStringParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d08d17989b4e0584ba0cd58d1293e26f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceGenerator.cs new file mode 100644 index 00000000..be634121 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceGenerator.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerSequenceGenerator + : DerGenerator + { + private readonly MemoryStream _bOut = new MemoryStream(); + + public DerSequenceGenerator( + Stream outStream) + : base(outStream) + { + } + + public DerSequenceGenerator( + Stream outStream, + int tagNo, + bool isExplicit) + : base(outStream, tagNo, isExplicit) + { + } + + public override void AddObject( + Asn1Encodable obj) + { + new DerOutputStream(_bOut).WriteObject(obj); + } + + public override Stream GetRawOutputStream() + { + return _bOut; + } + + public override void Close() + { + WriteDerEncoded(Asn1Tags.Constructed | Asn1Tags.Sequence, _bOut.ToArray()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceGenerator.cs.meta new file mode 100644 index 00000000..010e2caa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c132559ea4aae9448f2cc6da224abc4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceParser.cs new file mode 100644 index 00000000..02aa6866 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceParser.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerSequenceParser + : Asn1SequenceParser + { + private readonly Asn1StreamParser _parser; + + internal DerSequenceParser( + Asn1StreamParser parser) + { + this._parser = parser; + } + + public IAsn1Convertible ReadObject() + { + return _parser.ReadObject(); + } + + public Asn1Object ToAsn1Object() + { + return new DerSequence(_parser.ReadVector()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceParser.cs.meta new file mode 100644 index 00000000..69baa4f1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSequenceParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78a54d52c5aa20746a40a83ecd7dcf8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetGenerator.cs new file mode 100644 index 00000000..c1b2be11 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetGenerator.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerSetGenerator + : DerGenerator + { + private readonly MemoryStream _bOut = new MemoryStream(); + + public DerSetGenerator( + Stream outStream) + : base(outStream) + { + } + + public DerSetGenerator( + Stream outStream, + int tagNo, + bool isExplicit) + : base(outStream, tagNo, isExplicit) + { + } + + public override void AddObject( + Asn1Encodable obj) + { + new DerOutputStream(_bOut).WriteObject(obj); + } + + public override Stream GetRawOutputStream() + { + return _bOut; + } + + public override void Close() + { + WriteDerEncoded(Asn1Tags.Constructed | Asn1Tags.Set, _bOut.ToArray()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetGenerator.cs.meta new file mode 100644 index 00000000..cbe6ff02 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1f54b39d3b0bb24a932046d612bdac3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetParser.cs new file mode 100644 index 00000000..346cec0f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetParser.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerSetParser + : Asn1SetParser + { + private readonly Asn1StreamParser _parser; + + internal DerSetParser( + Asn1StreamParser parser) + { + this._parser = parser; + } + + public IAsn1Convertible ReadObject() + { + return _parser.ReadObject(); + } + + public Asn1Object ToAsn1Object() + { + return new DerSet(_parser.ReadVector(), false); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetParser.cs.meta new file mode 100644 index 00000000..554a6dd9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DERSetParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e88a6ff513bc2d0438d22d47ace8fe6f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DefiniteLengthInputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DefiniteLengthInputStream.cs new file mode 100644 index 00000000..3c960fde --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DefiniteLengthInputStream.cs @@ -0,0 +1,104 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + class DefiniteLengthInputStream + : LimitedInputStream + { + private static readonly byte[] EmptyBytes = new byte[0]; + + private readonly int _originalLength; + private int _remaining; + + internal DefiniteLengthInputStream( + Stream inStream, + int length) + : base(inStream, length) + { + if (length < 0) + throw new ArgumentException("negative lengths not allowed", "length"); + + this._originalLength = length; + this._remaining = length; + + if (length == 0) + { + SetParentEofDetect(true); + } + } + + internal int Remaining + { + get { return _remaining; } + } + + public override int ReadByte() + { + if (_remaining == 0) + return -1; + + int b = _in.ReadByte(); + + if (b < 0) + throw new EndOfStreamException("DEF length " + _originalLength + " object truncated by " + _remaining); + + if (--_remaining == 0) + { + SetParentEofDetect(true); + } + + return b; + } + + public override int Read( + byte[] buf, + int off, + int len) + { + if (_remaining == 0) + return 0; + + int toRead = System.Math.Min(len, _remaining); + int numRead = _in.Read(buf, off, toRead); + + if (numRead < 1) + throw new EndOfStreamException("DEF length " + _originalLength + " object truncated by " + _remaining); + + if ((_remaining -= numRead) == 0) + { + SetParentEofDetect(true); + } + + return numRead; + } + + internal void ReadAllIntoByteArray(byte[] buf) + { + if (_remaining != buf.Length) + throw new ArgumentException("buffer length not right for data"); + + if ((_remaining -= Streams.ReadFully(_in, buf)) != 0) + throw new EndOfStreamException("DEF length " + _originalLength + " object truncated by " + _remaining); + SetParentEofDetect(true); + } + + internal byte[] ToArray() + { + if (_remaining == 0) + return EmptyBytes; + + byte[] bytes = new byte[_remaining]; + if ((_remaining -= Streams.ReadFully(_in, bytes)) != 0) + throw new EndOfStreamException("DEF length " + _originalLength + " object truncated by " + _remaining); + SetParentEofDetect(true); + return bytes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DefiniteLengthInputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DefiniteLengthInputStream.cs.meta new file mode 100644 index 00000000..cbb40d49 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DefiniteLengthInputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 062975b128b005345a6d1502412231dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerApplicationSpecific.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerApplicationSpecific.cs new file mode 100644 index 00000000..12e946c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerApplicationSpecific.cs @@ -0,0 +1,230 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Base class for an application specific object + */ + public class DerApplicationSpecific + : Asn1Object + { + private readonly bool isConstructed; + private readonly int tag; + private readonly byte[] octets; + + internal DerApplicationSpecific( + bool isConstructed, + int tag, + byte[] octets) + { + this.isConstructed = isConstructed; + this.tag = tag; + this.octets = octets; + } + + public DerApplicationSpecific( + int tag, + byte[] octets) + : this(false, tag, octets) + { + } + + public DerApplicationSpecific( + int tag, + Asn1Encodable obj) + : this(true, tag, obj) + { + } + + public DerApplicationSpecific( + bool isExplicit, + int tag, + Asn1Encodable obj) + { + Asn1Object asn1Obj = obj.ToAsn1Object(); + + byte[] data = asn1Obj.GetDerEncoded(); + + this.isConstructed = Asn1TaggedObject.IsConstructed(isExplicit, asn1Obj); + this.tag = tag; + + if (isExplicit) + { + this.octets = data; + } + else + { + int lenBytes = GetLengthOfHeader(data); + byte[] tmp = new byte[data.Length - lenBytes]; + Array.Copy(data, lenBytes, tmp, 0, tmp.Length); + this.octets = tmp; + } + } + + public DerApplicationSpecific( + int tagNo, + Asn1EncodableVector vec) + { + this.tag = tagNo; + this.isConstructed = true; + MemoryStream bOut = new MemoryStream(); + + for (int i = 0; i != vec.Count; i++) + { + try + { + byte[] bs = vec[i].GetDerEncoded(); + bOut.Write(bs, 0, bs.Length); + } + catch (IOException e) + { + throw new InvalidOperationException("malformed object", e); + } + } + this.octets = bOut.ToArray(); + } + + private int GetLengthOfHeader( + byte[] data) + { + int length = data[1]; // TODO: assumes 1 byte tag + + if (length == 0x80) + { + return 2; // indefinite-length encoding + } + + if (length > 127) + { + int size = length & 0x7f; + + // Note: The invalid long form "0xff" (see X.690 8.1.3.5c) will be caught here + if (size > 4) + { + throw new InvalidOperationException("DER length more than 4 bytes: " + size); + } + + return size + 2; + } + + return 2; + } + + public bool IsConstructed() + { + return isConstructed; + } + + public byte[] GetContents() + { + return octets; + } + + public int ApplicationTag + { + get { return tag; } + } + + /** + * Return the enclosed object assuming explicit tagging. + * + * @return the resulting object + * @throws IOException if reconstruction fails. + */ + public Asn1Object GetObject() + { + return FromByteArray(GetContents()); + } + + /** + * Return the enclosed object assuming implicit tagging. + * + * @param derTagNo the type tag that should be applied to the object's contents. + * @return the resulting object + * @throws IOException if reconstruction fails. + */ + public Asn1Object GetObject( + int derTagNo) + { + if (derTagNo >= 0x1f) + throw new IOException("unsupported tag number"); + + byte[] orig = this.GetEncoded(); + byte[] tmp = ReplaceTagNumber(derTagNo, orig); + + if ((orig[0] & Asn1Tags.Constructed) != 0) + { + tmp[0] |= Asn1Tags.Constructed; + } + + return FromByteArray(tmp); + } + + internal override void Encode( + DerOutputStream derOut) + { + int classBits = Asn1Tags.Application; + if (isConstructed) + { + classBits |= Asn1Tags.Constructed; + } + + derOut.WriteEncoded(classBits, tag, octets); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerApplicationSpecific other = asn1Object as DerApplicationSpecific; + + if (other == null) + return false; + + return this.isConstructed == other.isConstructed + && this.tag == other.tag + && Arrays.AreEqual(this.octets, other.octets); + } + + protected override int Asn1GetHashCode() + { + return isConstructed.GetHashCode() ^ tag.GetHashCode() ^ Arrays.GetHashCode(octets); + } + + private byte[] ReplaceTagNumber( + int newTag, + byte[] input) + { + int tagNo = input[0] & 0x1f; + int index = 1; + + // with tagged object tag number is bottom 5 bits, or stored at the start of the content + if (tagNo == 0x1f) + { + int b = input[index++]; + + // X.690-0207 8.1.2.4.2 + // "c) bits 7 to 1 of the first subsequent octet shall not all be zero." + if ((b & 0x7f) == 0) // Note: -1 will pass + throw new IOException("corrupted stream - invalid high tag number found"); + + while ((b & 0x80) != 0) + { + b = input[index++]; + } + } + + int remaining = input.Length - index; + byte[] tmp = new byte[1 + remaining]; + tmp[0] = (byte)newTag; + Array.Copy(input, index, tmp, 1, remaining); + return tmp; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerApplicationSpecific.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerApplicationSpecific.cs.meta new file mode 100644 index 00000000..335a2047 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerApplicationSpecific.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 788472ee00a6d10478a465572f1ffddb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBMPString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBMPString.cs new file mode 100644 index 00000000..978da8aa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBMPString.cs @@ -0,0 +1,121 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Der BMPString object. + */ + public class DerBmpString + : DerStringBase + { + private readonly string str; + + /** + * return a BMP string from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static DerBmpString GetInstance( + object obj) + { + if (obj == null || obj is DerBmpString) + { + return (DerBmpString)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return a BMP string from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerBmpString GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerBmpString) + { + return GetInstance(o); + } + + return new DerBmpString(Asn1OctetString.GetInstance(o).GetOctets()); + } + + /** + * basic constructor - byte encoded string. + */ + public DerBmpString( + byte[] str) + { + if (str == null) + throw new ArgumentNullException("str"); + + char[] cs = new char[str.Length / 2]; + + for (int i = 0; i != cs.Length; i++) + { + cs[i] = (char)((str[2 * i] << 8) | (str[2 * i + 1] & 0xff)); + } + + this.str = new string(cs); + } + + /** + * basic constructor + */ + public DerBmpString( + string str) + { + if (str == null) + throw new ArgumentNullException("str"); + + this.str = str; + } + + public override string GetString() + { + return str; + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerBmpString other = asn1Object as DerBmpString; + + if (other == null) + return false; + + return this.str.Equals(other.str); + } + + internal override void Encode( + DerOutputStream derOut) + { + char[] c = str.ToCharArray(); + byte[] b = new byte[c.Length * 2]; + + for (int i = 0; i != c.Length; i++) + { + b[2 * i] = (byte)(c[i] >> 8); + b[2 * i + 1] = (byte)c[i]; + } + + derOut.WriteEncoded(Asn1Tags.BmpString, b); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBMPString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBMPString.cs.meta new file mode 100644 index 00000000..c094578e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBMPString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1237842c248008f47ae09b2fc3d95cb2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBitString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBitString.cs new file mode 100644 index 00000000..dabd5974 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBitString.cs @@ -0,0 +1,280 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerBitString + : DerStringBase + { + private static readonly char[] table + = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + protected readonly byte[] mData; + protected readonly int mPadBits; + + /** + * return a Bit string from the passed in object + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerBitString GetInstance( + object obj) + { + if (obj == null || obj is DerBitString) + { + return (DerBitString) obj; + } + if (obj is byte[]) + { + try + { + return (DerBitString)FromByteArray((byte[])obj); + } + catch (Exception e) + { + throw new ArgumentException("encoding error in GetInstance: " + e.ToString()); + } + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return a Bit string from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerBitString GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerBitString) + { + return GetInstance(o); + } + + return FromAsn1Octets(((Asn1OctetString)o).GetOctets()); + } + + /** + * @param data the octets making up the bit string. + * @param padBits the number of extra bits at the end of the string. + */ + public DerBitString( + byte[] data, + int padBits) + { + if (data == null) + throw new ArgumentNullException("data"); + if (padBits < 0 || padBits > 7) + throw new ArgumentException("must be in the range 0 to 7", "padBits"); + if (data.Length == 0 && padBits != 0) + throw new ArgumentException("if 'data' is empty, 'padBits' must be 0"); + + this.mData = Arrays.Clone(data); + this.mPadBits = padBits; + } + + public DerBitString( + byte[] data) + : this(data, 0) + { + } + + public DerBitString( + int namedBits) + { + if (namedBits == 0) + { + this.mData = new byte[0]; + this.mPadBits = 0; + return; + } + + int bits = BigInteger.BitLen(namedBits); + int bytes = (bits + 7) / 8; + + Debug.Assert(0 < bytes && bytes <= 4); + + byte[] data = new byte[bytes]; + --bytes; + + for (int i = 0; i < bytes; i++) + { + data[i] = (byte)namedBits; + namedBits >>= 8; + } + + Debug.Assert((namedBits & 0xFF) != 0); + + data[bytes] = (byte)namedBits; + + int padBits = 0; + while ((namedBits & (1 << padBits)) == 0) + { + ++padBits; + } + + Debug.Assert(padBits < 8); + + this.mData = data; + this.mPadBits = padBits; + } + + public DerBitString( + Asn1Encodable obj) + : this(obj.GetDerEncoded()) + { + } + + /** + * Return the octets contained in this BIT STRING, checking that this BIT STRING really + * does represent an octet aligned string. Only use this method when the standard you are + * following dictates that the BIT STRING will be octet aligned. + * + * @return a copy of the octet aligned data. + */ + public virtual byte[] GetOctets() + { + if (mPadBits != 0) + throw new InvalidOperationException("attempt to get non-octet aligned data from BIT STRING"); + + return Arrays.Clone(mData); + } + + public virtual byte[] GetBytes() + { + byte[] data = Arrays.Clone(mData); + + // DER requires pad bits be zero + if (mPadBits > 0) + { + data[data.Length - 1] &= (byte)(0xFF << mPadBits); + } + + return data; + } + + public virtual int PadBits + { + get { return mPadBits; } + } + + /** + * @return the value of the bit string as an int (truncating if necessary) + */ + public virtual int IntValue + { + get + { + int value = 0, length = System.Math.Min(4, mData.Length); + for (int i = 0; i < length; ++i) + { + value |= (int)mData[i] << (8 * i); + } + if (mPadBits > 0 && length == mData.Length) + { + int mask = (1 << mPadBits) - 1; + value &= ~(mask << (8 * (length - 1))); + } + return value; + } + } + + internal override void Encode( + DerOutputStream derOut) + { + if (mPadBits > 0) + { + int last = mData[mData.Length - 1]; + int mask = (1 << mPadBits) - 1; + int unusedBits = last & mask; + + if (unusedBits != 0) + { + byte[] contents = Arrays.Prepend(mData, (byte)mPadBits); + + /* + * X.690-0207 11.2.1: Each unused bit in the final octet of the encoding of a bit string value shall be set to zero. + */ + contents[contents.Length - 1] = (byte)(last ^ unusedBits); + + derOut.WriteEncoded(Asn1Tags.BitString, contents); + return; + } + } + + derOut.WriteEncoded(Asn1Tags.BitString, (byte)mPadBits, mData); + } + + protected override int Asn1GetHashCode() + { + return mPadBits.GetHashCode() ^ Arrays.GetHashCode(mData); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerBitString other = asn1Object as DerBitString; + + if (other == null) + return false; + + return this.mPadBits == other.mPadBits + && Arrays.AreEqual(this.mData, other.mData); + } + + public override string GetString() + { + StringBuilder buffer = new StringBuilder("#"); + + byte[] str = GetDerEncoded(); + + for (int i = 0; i != str.Length; i++) + { + uint ubyte = str[i]; + buffer.Append(table[(ubyte >> 4) & 0xf]); + buffer.Append(table[str[i] & 0xf]); + } + + return buffer.ToString(); + } + + internal static DerBitString FromAsn1Octets(byte[] octets) + { + if (octets.Length < 1) + throw new ArgumentException("truncated BIT STRING detected", "octets"); + + int padBits = octets[0]; + byte[] data = Arrays.CopyOfRange(octets, 1, octets.Length); + + if (padBits > 0 && padBits < 8 && data.Length > 0) + { + int last = data[data.Length - 1]; + int mask = (1 << padBits) - 1; + + if ((last & mask) != 0) + { + return new BerBitString(data, padBits); + } + } + + return new DerBitString(data, padBits); + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBitString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBitString.cs.meta new file mode 100644 index 00000000..610a4e6b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBitString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3267bb6b435ba4a4a90fa383aa2c3bde +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBoolean.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBoolean.cs new file mode 100644 index 00000000..3ff44967 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBoolean.cs @@ -0,0 +1,128 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerBoolean + : Asn1Object + { + private readonly byte value; + + public static readonly DerBoolean False = new DerBoolean(false); + public static readonly DerBoolean True = new DerBoolean(true); + + /** + * return a bool from the passed in object. + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerBoolean GetInstance( + object obj) + { + if (obj == null || obj is DerBoolean) + { + return (DerBoolean) obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return a DerBoolean from the passed in bool. + */ + public static DerBoolean GetInstance( + bool value) + { + return value ? True : False; + } + + /** + * return a Boolean from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerBoolean GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerBoolean) + { + return GetInstance(o); + } + + return FromOctetString(((Asn1OctetString)o).GetOctets()); + } + + public DerBoolean( + byte[] val) + { + if (val.Length != 1) + throw new ArgumentException("byte value should have 1 byte in it", "val"); + + // TODO Are there any constraints on the possible byte values? + this.value = val[0]; + } + + private DerBoolean( + bool value) + { + this.value = value ? (byte)0xff : (byte)0; + } + + public bool IsTrue + { + get { return value != 0; } + } + + internal override void Encode( + DerOutputStream derOut) + { + // TODO Should we make sure the byte value is one of '0' or '0xff' here? + derOut.WriteEncoded(Asn1Tags.Boolean, new byte[]{ value }); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerBoolean other = asn1Object as DerBoolean; + + if (other == null) + return false; + + return IsTrue == other.IsTrue; + } + + protected override int Asn1GetHashCode() + { + return IsTrue.GetHashCode(); + } + + public override string ToString() + { + return IsTrue ? "TRUE" : "FALSE"; + } + + internal static DerBoolean FromOctetString(byte[] value) + { + if (value.Length != 1) + { + throw new ArgumentException("BOOLEAN value should have 1 byte in it", "value"); + } + + byte b = value[0]; + + return b == 0 ? False : b == 0xFF ? True : new DerBoolean(value); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBoolean.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBoolean.cs.meta new file mode 100644 index 00000000..c6ac4376 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerBoolean.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 720c28a719a95734a88eab4e5bfce644 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerEnumerated.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerEnumerated.cs new file mode 100644 index 00000000..d2a49060 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerEnumerated.cs @@ -0,0 +1,138 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerEnumerated + : Asn1Object + { + private readonly byte[] bytes; + + /** + * return an integer from the passed in object + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerEnumerated GetInstance( + object obj) + { + if (obj == null || obj is DerEnumerated) + { + return (DerEnumerated)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return an Enumerated from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerEnumerated GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerEnumerated) + { + return GetInstance(o); + } + + return FromOctetString(((Asn1OctetString)o).GetOctets()); + } + + public DerEnumerated( + int val) + { + bytes = BigInteger.ValueOf(val).ToByteArray(); + } + + public DerEnumerated( + BigInteger val) + { + bytes = val.ToByteArray(); + } + + public DerEnumerated( + byte[] bytes) + { + if (bytes.Length > 1) + { + if ((bytes[0] == 0 && (bytes[1] & 0x80) == 0) + || (bytes[0] == (byte)0xff && (bytes[1] & 0x80) != 0)) + { + if (!DerInteger.AllowUnsafe()) + throw new ArgumentException("malformed enumerated"); + } + } + + this.bytes = Arrays.Clone(bytes); + } + + public BigInteger Value + { + get { return new BigInteger(bytes); } + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.Enumerated, bytes); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerEnumerated other = asn1Object as DerEnumerated; + + if (other == null) + return false; + + return Arrays.AreEqual(this.bytes, other.bytes); + } + + protected override int Asn1GetHashCode() + { + return Arrays.GetHashCode(bytes); + } + + private static readonly DerEnumerated[] cache = new DerEnumerated[12]; + + internal static DerEnumerated FromOctetString(byte[] enc) + { + if (enc.Length == 0) + { + throw new ArgumentException("ENUMERATED has zero length", "enc"); + } + + if (enc.Length == 1) + { + int value = enc[0]; + if (value < cache.Length) + { + DerEnumerated cached = cache[value]; + if (cached != null) + { + return cached; + } + + return cache[value] = new DerEnumerated(Arrays.Clone(enc)); + } + } + + return new DerEnumerated(Arrays.Clone(enc)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerEnumerated.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerEnumerated.cs.meta new file mode 100644 index 00000000..e6cd2a40 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerEnumerated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 061d704d9da7baf4a98aaad06e96b37c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralString.cs new file mode 100644 index 00000000..29a01fed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralString.cs @@ -0,0 +1,85 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerGeneralString + : DerStringBase + { + private readonly string str; + + public static DerGeneralString GetInstance( + object obj) + { + if (obj == null || obj is DerGeneralString) + { + return (DerGeneralString) obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public static DerGeneralString GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerGeneralString) + { + return GetInstance(o); + } + + return new DerGeneralString(((Asn1OctetString)o).GetOctets()); + } + + public DerGeneralString( + byte[] str) + : this(Strings.FromAsciiByteArray(str)) + { + } + + public DerGeneralString( + string str) + { + if (str == null) + throw new ArgumentNullException("str"); + + this.str = str; + } + + public override string GetString() + { + return str; + } + + public byte[] GetOctets() + { + return Strings.ToAsciiByteArray(str); + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.GeneralString, GetOctets()); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerGeneralString other = asn1Object as DerGeneralString; + + if (other == null) + return false; + + return this.str.Equals(other.str); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralString.cs.meta new file mode 100644 index 00000000..2c41ef2d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f83195af35e42dd42900ea19ea491dda +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralizedTime.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralizedTime.cs new file mode 100644 index 00000000..fcf44263 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralizedTime.cs @@ -0,0 +1,324 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Globalization; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Generalized time object. + */ + public class DerGeneralizedTime + : Asn1Object + { + private readonly string time; + + /** + * return a generalized time from the passed in object + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerGeneralizedTime GetInstance( + object obj) + { + if (obj == null || obj is DerGeneralizedTime) + { + return (DerGeneralizedTime)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * return a Generalized Time object from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerGeneralizedTime GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerGeneralizedTime) + { + return GetInstance(o); + } + + return new DerGeneralizedTime(((Asn1OctetString)o).GetOctets()); + } + + /** + * The correct format for this is YYYYMMDDHHMMSS[.f]Z, or without the Z + * for local time, or Z+-HHMM on the end, for difference between local + * time and UTC time. The fractional second amount f must consist of at + * least one number with trailing zeroes removed. + * + * @param time the time string. + * @exception ArgumentException if string is an illegal format. + */ + public DerGeneralizedTime( + string time) + { + this.time = time; + + try + { + ToDateTime(); + } + catch (FormatException e) + { + throw new ArgumentException("invalid date string: " + e.Message); + } + } + + /** + * base constructor from a local time object + */ + public DerGeneralizedTime( + DateTime time) + { +#if PORTABLE || NETFX_CORE + this.time = time.ToUniversalTime().ToString(@"yyyyMMddHHmmss\Z"); +#else + this.time = time.ToString(@"yyyyMMddHHmmss\Z"); +#endif + } + + internal DerGeneralizedTime( + byte[] bytes) + { + // + // explicitly convert to characters + // + this.time = Strings.FromAsciiByteArray(bytes); + } + + /** + * Return the time. + * @return The time string as it appeared in the encoded object. + */ + public string TimeString + { + get { return time; } + } + + /** + * return the time - always in the form of + * YYYYMMDDhhmmssGMT(+hh:mm|-hh:mm). + *

+ * Normally in a certificate we would expect "Z" rather than "GMT", + * however adding the "GMT" means we can just use: + *

+         *     dateF = new SimpleDateFormat("yyyyMMddHHmmssz");
+         * 
+ * To read in the time and Get a date which is compatible with our local + * time zone.

+ */ + public string GetTime() + { + // + // standardise the format. + // + if (time[time.Length - 1] == 'Z') + { + return time.Substring(0, time.Length - 1) + "GMT+00:00"; + } + else + { + int signPos = time.Length - 5; + char sign = time[signPos]; + if (sign == '-' || sign == '+') + { + return time.Substring(0, signPos) + + "GMT" + + time.Substring(signPos, 3) + + ":" + + time.Substring(signPos + 3); + } + else + { + signPos = time.Length - 3; + sign = time[signPos]; + if (sign == '-' || sign == '+') + { + return time.Substring(0, signPos) + + "GMT" + + time.Substring(signPos) + + ":00"; + } + } + } + + return time + CalculateGmtOffset(); + } + + private string CalculateGmtOffset() + { + char sign = '+'; + DateTime time = ToDateTime(); + +#if SILVERLIGHT || PORTABLE || NETFX_CORE + long offset = time.Ticks - time.ToUniversalTime().Ticks; + if (offset < 0) + { + sign = '-'; + offset = -offset; + } + int hours = (int)(offset / TimeSpan.TicksPerHour); + int minutes = (int)(offset / TimeSpan.TicksPerMinute) % 60; +#else + // Note: GetUtcOffset incorporates Daylight Savings offset + TimeSpan offset = TimeZone.CurrentTimeZone.GetUtcOffset(time); + if (offset.CompareTo(TimeSpan.Zero) < 0) + { + sign = '-'; + offset = offset.Duration(); + } + int hours = offset.Hours; + int minutes = offset.Minutes; +#endif + + return "GMT" + sign + Convert(hours) + ":" + Convert(minutes); + } + + private static string Convert( + int time) + { + if (time < 10) + { + return "0" + time; + } + + return time.ToString(); + } + + public DateTime ToDateTime() + { + string formatStr; + string d = time; + bool makeUniversal = false; + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(d, "Z")) + { + if (HasFractionalSeconds) + { + int fCount = d.Length - d.IndexOf('.') - 2; + formatStr = @"yyyyMMddHHmmss." + FString(fCount) + @"\Z"; + } + else + { + formatStr = @"yyyyMMddHHmmss\Z"; + } + } + else if (time.IndexOf('-') > 0 || time.IndexOf('+') > 0) + { + d = GetTime(); + makeUniversal = true; + + if (HasFractionalSeconds) + { + int fCount = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.IndexOf(d, "GMT") - 1 - d.IndexOf('.'); + formatStr = @"yyyyMMddHHmmss." + FString(fCount) + @"'GMT'zzz"; + } + else + { + formatStr = @"yyyyMMddHHmmss'GMT'zzz"; + } + } + else + { + if (HasFractionalSeconds) + { + int fCount = d.Length - 1 - d.IndexOf('.'); + formatStr = @"yyyyMMddHHmmss." + FString(fCount); + } + else + { + formatStr = @"yyyyMMddHHmmss"; + } + + // TODO? +// dateF.setTimeZone(new SimpleTimeZone(0, TimeZone.getDefault().getID())); + } + + return ParseDateString(d, formatStr, makeUniversal); + } + + private string FString( + int count) + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < count; ++i) + { + sb.Append('f'); + } + return sb.ToString(); + } + + private DateTime ParseDateString(string s, string format, bool makeUniversal) + { + /* + * NOTE: DateTime.Kind and DateTimeStyles.AssumeUniversal not available in .NET 1.1 + */ + DateTimeStyles style = DateTimeStyles.None; + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(format, "Z")) + { + try + { + style = (DateTimeStyles)Enums.GetEnumValue(typeof(DateTimeStyles), "AssumeUniversal"); + } + catch (Exception) + { + } + + style |= DateTimeStyles.AdjustToUniversal; + } + + DateTime dt = DateTime.ParseExact(s, format, DateTimeFormatInfo.InvariantInfo, style); + + return makeUniversal ? dt.ToUniversalTime() : dt; + } + + private bool HasFractionalSeconds + { + get { return time.IndexOf('.') == 14; } + } + + private byte[] GetOctets() + { + return Strings.ToAsciiByteArray(time); + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.GeneralizedTime, GetOctets()); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerGeneralizedTime other = asn1Object as DerGeneralizedTime; + + if (other == null) + return false; + + return this.time.Equals(other.time); + } + + protected override int Asn1GetHashCode() + { + return time.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralizedTime.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralizedTime.cs.meta new file mode 100644 index 00000000..b7a2d0f0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGeneralizedTime.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1ebcc047ba1daf04db5d2ebd9c124a28 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGraphicString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGraphicString.cs new file mode 100644 index 00000000..08a518aa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGraphicString.cs @@ -0,0 +1,107 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerGraphicString + : DerStringBase + { + private readonly byte[] mString; + + /** + * return a Graphic String from the passed in object + * + * @param obj a DerGraphicString or an object that can be converted into one. + * @exception IllegalArgumentException if the object cannot be converted. + * @return a DerGraphicString instance, or null. + */ + public static DerGraphicString GetInstance(object obj) + { + if (obj == null || obj is DerGraphicString) + { + return (DerGraphicString)obj; + } + + if (obj is byte[]) + { + try + { + return (DerGraphicString)FromByteArray((byte[])obj); + } + catch (Exception e) + { + throw new ArgumentException("encoding error in GetInstance: " + e.ToString(), "obj"); + } + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * return a Graphic String from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicit true if the object is meant to be explicitly + * tagged false otherwise. + * @exception IllegalArgumentException if the tagged object cannot + * be converted. + * @return a DerGraphicString instance, or null. + */ + public static DerGraphicString GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerGraphicString) + { + return GetInstance(o); + } + + return new DerGraphicString(((Asn1OctetString)o).GetOctets()); + } + + /** + * basic constructor - with bytes. + * @param string the byte encoding of the characters making up the string. + */ + public DerGraphicString(byte[] encoding) + { + this.mString = Arrays.Clone(encoding); + } + + public override string GetString() + { + return Strings.FromByteArray(mString); + } + + public byte[] GetOctets() + { + return Arrays.Clone(mString); + } + + internal override void Encode(DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.GraphicString, mString); + } + + protected override int Asn1GetHashCode() + { + return Arrays.GetHashCode(mString); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerGraphicString other = asn1Object as DerGraphicString; + + if (other == null) + return false; + + return Arrays.AreEqual(mString, other.mString); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGraphicString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGraphicString.cs.meta new file mode 100644 index 00000000..80a2f5ce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerGraphicString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f18e39588618e334c961eec4c763ef13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerIA5String.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerIA5String.cs new file mode 100644 index 00000000..2089d6c4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerIA5String.cs @@ -0,0 +1,149 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Der IA5String object - this is an ascii string. + */ + public class DerIA5String + : DerStringBase + { + private readonly string str; + + /** + * return a IA5 string from the passed in object + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerIA5String GetInstance( + object obj) + { + if (obj == null || obj is DerIA5String) + { + return (DerIA5String)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return an IA5 string from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerIA5String GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerIA5String) + { + return GetInstance(o); + } + + return new DerIA5String(((Asn1OctetString)o).GetOctets()); + } + + /** + * basic constructor - with bytes. + */ + public DerIA5String( + byte[] str) + : this(Strings.FromAsciiByteArray(str), false) + { + } + + /** + * basic constructor - without validation. + */ + public DerIA5String( + string str) + : this(str, false) + { + } + + /** + * Constructor with optional validation. + * + * @param string the base string to wrap. + * @param validate whether or not to check the string. + * @throws ArgumentException if validate is true and the string + * contains characters that should not be in an IA5String. + */ + public DerIA5String( + string str, + bool validate) + { + if (str == null) + throw new ArgumentNullException("str"); + if (validate && !IsIA5String(str)) + throw new ArgumentException("string contains illegal characters", "str"); + + this.str = str; + } + + public override string GetString() + { + return str; + } + + public byte[] GetOctets() + { + return Strings.ToAsciiByteArray(str); + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.IA5String, GetOctets()); + } + + protected override int Asn1GetHashCode() + { + return this.str.GetHashCode(); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerIA5String other = asn1Object as DerIA5String; + + if (other == null) + return false; + + return this.str.Equals(other.str); + } + + /** + * return true if the passed in String can be represented without + * loss as an IA5String, false otherwise. + * + * @return true if in printable set, false otherwise. + */ + public static bool IsIA5String( + string str) + { + foreach (char ch in str) + { + if (ch > 0x007f) + { + return false; + } + } + + return true; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerIA5String.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerIA5String.cs.meta new file mode 100644 index 00000000..286717d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerIA5String.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 92ba1c46247b34d4b83218ac4a011b9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerInteger.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerInteger.cs new file mode 100644 index 00000000..099ead44 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerInteger.cs @@ -0,0 +1,138 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerInteger + : Asn1Object + { + public const string AllowUnsafeProperty = "BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.AllowUnsafeInteger"; + + internal static bool AllowUnsafe() + { + string allowUnsafeValue = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetEnvironmentVariable(AllowUnsafeProperty); + return allowUnsafeValue != null && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase("true", allowUnsafeValue); + } + + private readonly byte[] bytes; + + /** + * return an integer from the passed in object + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerInteger GetInstance( + object obj) + { + if (obj == null || obj is DerInteger) + { + return (DerInteger)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return an Integer from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param isExplicit true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerInteger GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + if (obj == null) + throw new ArgumentNullException("obj"); + + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerInteger) + { + return GetInstance(o); + } + + return new DerInteger(Asn1OctetString.GetInstance(o).GetOctets()); + } + + public DerInteger( + int value) + { + bytes = BigInteger.ValueOf(value).ToByteArray(); + } + + public DerInteger( + BigInteger value) + { + if (value == null) + throw new ArgumentNullException("value"); + + bytes = value.ToByteArray(); + } + + public DerInteger( + byte[] bytes) + { + if (bytes.Length > 1) + { + if ((bytes[0] == 0 && (bytes[1] & 0x80) == 0) + || (bytes[0] == (byte)0xff && (bytes[1] & 0x80) != 0)) + { + if (!AllowUnsafe()) + throw new ArgumentException("malformed integer"); + } + } + this.bytes = Arrays.Clone(bytes); + } + + public BigInteger Value + { + get { return new BigInteger(bytes); } + } + + /** + * in some cases positive values Get crammed into a space, + * that's not quite big enough... + */ + public BigInteger PositiveValue + { + get { return new BigInteger(1, bytes); } + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.Integer, bytes); + } + + protected override int Asn1GetHashCode() + { + return Arrays.GetHashCode(bytes); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerInteger other = asn1Object as DerInteger; + + if (other == null) + return false; + + return Arrays.AreEqual(this.bytes, other.bytes); + } + + public override string ToString() + { + return Value.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerInteger.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerInteger.cs.meta new file mode 100644 index 00000000..7492aca5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerInteger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae09d83855723bc498fdae7631d51686 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNull.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNull.cs new file mode 100644 index 00000000..97894bf6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNull.cs @@ -0,0 +1,45 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * A Null object. + */ + public class DerNull + : Asn1Null + { + public static readonly DerNull Instance = new DerNull(0); + + byte[] zeroBytes = new byte[0]; + + [Obsolete("Use static Instance object")] + public DerNull() + { + } + + protected internal DerNull(int dummy) + { + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.Null, zeroBytes); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + return asn1Object is DerNull; + } + + protected override int Asn1GetHashCode() + { + return -1; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNull.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNull.cs.meta new file mode 100644 index 00000000..6513dbce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNull.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48eba232a4b25614c941a9adb09edc24 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNumericString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNumericString.cs new file mode 100644 index 00000000..d3939505 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNumericString.cs @@ -0,0 +1,142 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Der NumericString object - this is an ascii string of characters {0,1,2,3,4,5,6,7,8,9, }. + */ + public class DerNumericString + : DerStringBase + { + private readonly string str; + + /** + * return a Numeric string from the passed in object + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerNumericString GetInstance( + object obj) + { + if (obj == null || obj is DerNumericString) + { + return (DerNumericString)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return an Numeric string from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerNumericString GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerNumericString) + { + return GetInstance(o); + } + + return new DerNumericString(Asn1OctetString.GetInstance(o).GetOctets()); + } + + /** + * basic constructor - with bytes. + */ + public DerNumericString( + byte[] str) + : this(Strings.FromAsciiByteArray(str), false) + { + } + + /** + * basic constructor - without validation.. + */ + public DerNumericString( + string str) + : this(str, false) + { + } + + /** + * Constructor with optional validation. + * + * @param string the base string to wrap. + * @param validate whether or not to check the string. + * @throws ArgumentException if validate is true and the string + * contains characters that should not be in a NumericString. + */ + public DerNumericString( + string str, + bool validate) + { + if (str == null) + throw new ArgumentNullException("str"); + if (validate && !IsNumericString(str)) + throw new ArgumentException("string contains illegal characters", "str"); + + this.str = str; + } + + public override string GetString() + { + return str; + } + + public byte[] GetOctets() + { + return Strings.ToAsciiByteArray(str); + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.NumericString, GetOctets()); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerNumericString other = asn1Object as DerNumericString; + + if (other == null) + return false; + + return this.str.Equals(other.str); + } + + /** + * Return true if the string can be represented as a NumericString ('0'..'9', ' ') + * + * @param str string to validate. + * @return true if numeric, fale otherwise. + */ + public static bool IsNumericString( + string str) + { + foreach (char ch in str) + { + if (ch > 0x007f || (ch != ' ' && !char.IsDigit(ch))) + return false; + } + + return true; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNumericString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNumericString.cs.meta new file mode 100644 index 00000000..3cc5a3bf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerNumericString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0707908aca9e6943ba955d46365d37e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerObjectIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerObjectIdentifier.cs new file mode 100644 index 00000000..3d160bf4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerObjectIdentifier.cs @@ -0,0 +1,358 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerObjectIdentifier + : Asn1Object + { + private readonly string identifier; + + private byte[] body = null; + + /** + * return an Oid from the passed in object + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerObjectIdentifier GetInstance(object obj) + { + if (obj == null || obj is DerObjectIdentifier) + return (DerObjectIdentifier) obj; + if (obj is byte[]) + return FromOctetString((byte[])obj); + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * return an object Identifier from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerObjectIdentifier GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + Asn1Object o = obj.GetObject(); + + if (explicitly || o is DerObjectIdentifier) + { + return GetInstance(o); + } + + return FromOctetString(Asn1OctetString.GetInstance(o).GetOctets()); + } + + public DerObjectIdentifier( + string identifier) + { + if (identifier == null) + throw new ArgumentNullException("identifier"); + if (!IsValidIdentifier(identifier)) + throw new FormatException("string " + identifier + " not an OID"); + + this.identifier = identifier; + } + + internal DerObjectIdentifier(DerObjectIdentifier oid, string branchID) + { + if (!IsValidBranchID(branchID, 0)) + throw new ArgumentException("string " + branchID + " not a valid OID branch", "branchID"); + + this.identifier = oid.Id + "." + branchID; + } + + // TODO Change to ID? + public string Id + { + get { return identifier; } + } + + public virtual DerObjectIdentifier Branch(string branchID) + { + return new DerObjectIdentifier(this, branchID); + } + + /** + * Return true if this oid is an extension of the passed in branch, stem. + * @param stem the arc or branch that is a possible parent. + * @return true if the branch is on the passed in stem, false otherwise. + */ + public virtual bool On(DerObjectIdentifier stem) + { + string id = Id, stemId = stem.Id; + return id.Length > stemId.Length && id[stemId.Length] == '.' && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(id, stemId); + } + + internal DerObjectIdentifier(byte[] bytes) + { + this.identifier = MakeOidStringFromBytes(bytes); + this.body = Arrays.Clone(bytes); + } + + private void WriteField( + Stream outputStream, + long fieldValue) + { + byte[] result = new byte[9]; + int pos = 8; + result[pos] = (byte)(fieldValue & 0x7f); + while (fieldValue >= (1L << 7)) + { + fieldValue >>= 7; + result[--pos] = (byte)((fieldValue & 0x7f) | 0x80); + } + outputStream.Write(result, pos, 9 - pos); + } + + private void WriteField( + Stream outputStream, + BigInteger fieldValue) + { + int byteCount = (fieldValue.BitLength + 6) / 7; + if (byteCount == 0) + { + outputStream.WriteByte(0); + } + else + { + BigInteger tmpValue = fieldValue; + byte[] tmp = new byte[byteCount]; + for (int i = byteCount-1; i >= 0; i--) + { + tmp[i] = (byte) ((tmpValue.IntValue & 0x7f) | 0x80); + tmpValue = tmpValue.ShiftRight(7); + } + tmp[byteCount-1] &= 0x7f; + outputStream.Write(tmp, 0, tmp.Length); + } + } + + private void DoOutput(MemoryStream bOut) + { + OidTokenizer tok = new OidTokenizer(identifier); + + string token = tok.NextToken(); + int first = int.Parse(token) * 40; + + token = tok.NextToken(); + if (token.Length <= 18) + { + WriteField(bOut, first + Int64.Parse(token)); + } + else + { + WriteField(bOut, new BigInteger(token).Add(BigInteger.ValueOf(first))); + } + + while (tok.HasMoreTokens) + { + token = tok.NextToken(); + if (token.Length <= 18) + { + WriteField(bOut, Int64.Parse(token)); + } + else + { + WriteField(bOut, new BigInteger(token)); + } + } + } + + internal byte[] GetBody() + { + lock (this) + { + if (body == null) + { + MemoryStream bOut = new MemoryStream(); + DoOutput(bOut); + body = bOut.ToArray(); + } + } + + return body; + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.ObjectIdentifier, GetBody()); + } + + protected override int Asn1GetHashCode() + { + return identifier.GetHashCode(); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerObjectIdentifier other = asn1Object as DerObjectIdentifier; + + if (other == null) + return false; + + return this.identifier.Equals(other.identifier); + } + + public override string ToString() + { + return identifier; + } + + private static bool IsValidBranchID( + String branchID, int start) + { + bool periodAllowed = false; + + int pos = branchID.Length; + while (--pos >= start) + { + char ch = branchID[pos]; + + // TODO Leading zeroes? + if ('0' <= ch && ch <= '9') + { + periodAllowed = true; + continue; + } + + if (ch == '.') + { + if (!periodAllowed) + return false; + + periodAllowed = false; + continue; + } + + return false; + } + + return periodAllowed; + } + + private static bool IsValidIdentifier(string identifier) + { + if (identifier.Length < 3 || identifier[1] != '.') + return false; + + char first = identifier[0]; + if (first < '0' || first > '2') + return false; + + return IsValidBranchID(identifier, 2); + } + + private const long LONG_LIMIT = (long.MaxValue >> 7) - 0x7f; + + private static string MakeOidStringFromBytes( + byte[] bytes) + { + StringBuilder objId = new StringBuilder(); + long value = 0; + BigInteger bigValue = null; + bool first = true; + + for (int i = 0; i != bytes.Length; i++) + { + int b = bytes[i]; + + if (value <= LONG_LIMIT) + { + value += (b & 0x7f); + if ((b & 0x80) == 0) // end of number reached + { + if (first) + { + if (value < 40) + { + objId.Append('0'); + } + else if (value < 80) + { + objId.Append('1'); + value -= 40; + } + else + { + objId.Append('2'); + value -= 80; + } + first = false; + } + + objId.Append('.'); + objId.Append(value); + value = 0; + } + else + { + value <<= 7; + } + } + else + { + if (bigValue == null) + { + bigValue = BigInteger.ValueOf(value); + } + bigValue = bigValue.Or(BigInteger.ValueOf(b & 0x7f)); + if ((b & 0x80) == 0) + { + if (first) + { + objId.Append('2'); + bigValue = bigValue.Subtract(BigInteger.ValueOf(80)); + first = false; + } + + objId.Append('.'); + objId.Append(bigValue); + bigValue = null; + value = 0; + } + else + { + bigValue = bigValue.ShiftLeft(7); + } + } + } + + return objId.ToString(); + } + + private static readonly DerObjectIdentifier[] cache = new DerObjectIdentifier[1024]; + + internal static DerObjectIdentifier FromOctetString(byte[] enc) + { + int hashCode = Arrays.GetHashCode(enc); + int first = hashCode & 1023; + + lock (cache) + { + DerObjectIdentifier entry = cache[first]; + if (entry != null && Arrays.AreEqual(enc, entry.GetBody())) + { + return entry; + } + + return cache[first] = new DerObjectIdentifier(enc); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerObjectIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerObjectIdentifier.cs.meta new file mode 100644 index 00000000..d76bd72a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerObjectIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44d9a2bc67c903f468455f944abaccfc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOctetString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOctetString.cs new file mode 100644 index 00000000..4b59c167 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOctetString.cs @@ -0,0 +1,38 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerOctetString + : Asn1OctetString + { + /// The octets making up the octet string. + public DerOctetString( + byte[] str) + : base(str) + { + } + + public DerOctetString( + Asn1Encodable obj) + : base(obj) + { + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.OctetString, str); + } + + internal static void Encode( + DerOutputStream derOut, + byte[] bytes, + int offset, + int length) + { + derOut.WriteEncoded(Asn1Tags.OctetString, bytes, offset, length); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOctetString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOctetString.cs.meta new file mode 100644 index 00000000..3a2f33f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOctetString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d4f36a04b2ccfc478c9e105de48f09f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOutputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOutputStream.cs new file mode 100644 index 00000000..2b610cab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOutputStream.cs @@ -0,0 +1,175 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerOutputStream + : FilterStream + { + public DerOutputStream(Stream os) + : base(os) + { + } + + private void WriteLength( + int length) + { + if (length > 127) + { + int size = 1; + uint val = (uint)length; + + while ((val >>= 8) != 0) + { + size++; + } + + WriteByte((byte)(size | 0x80)); + + for (int i = (size - 1) * 8; i >= 0; i -= 8) + { + WriteByte((byte)(length >> i)); + } + } + else + { + WriteByte((byte)length); + } + } + + internal void WriteEncoded( + int tag, + byte[] bytes) + { + WriteByte((byte)tag); + WriteLength(bytes.Length); + Write(bytes, 0, bytes.Length); + } + + internal void WriteEncoded( + int tag, + byte first, + byte[] bytes) + { + WriteByte((byte)tag); + WriteLength(bytes.Length + 1); + WriteByte(first); + Write(bytes, 0, bytes.Length); + } + + internal void WriteEncoded( + int tag, + byte[] bytes, + int offset, + int length) + { + WriteByte((byte)tag); + WriteLength(length); + Write(bytes, offset, length); + } + + internal void WriteTag( + int flags, + int tagNo) + { + if (tagNo < 31) + { + WriteByte((byte)(flags | tagNo)); + } + else + { + WriteByte((byte)(flags | 0x1f)); + if (tagNo < 128) + { + WriteByte((byte)tagNo); + } + else + { + byte[] stack = new byte[5]; + int pos = stack.Length; + + stack[--pos] = (byte)(tagNo & 0x7F); + + do + { + tagNo >>= 7; + stack[--pos] = (byte)(tagNo & 0x7F | 0x80); + } + while (tagNo > 127); + + Write(stack, pos, stack.Length - pos); + } + } + } + + internal void WriteEncoded( + int flags, + int tagNo, + byte[] bytes) + { + WriteTag(flags, tagNo); + WriteLength(bytes.Length); + Write(bytes, 0, bytes.Length); + } + + protected void WriteNull() + { + WriteByte(Asn1Tags.Null); + WriteByte(0x00); + } + + [Obsolete("Use version taking an Asn1Encodable arg instead")] + public virtual void WriteObject( + object obj) + { + if (obj == null) + { + WriteNull(); + } + else if (obj is Asn1Object) + { + ((Asn1Object)obj).Encode(this); + } + else if (obj is Asn1Encodable) + { + ((Asn1Encodable)obj).ToAsn1Object().Encode(this); + } + else + { + throw new IOException("object not Asn1Object"); + } + } + + public virtual void WriteObject( + Asn1Encodable obj) + { + if (obj == null) + { + WriteNull(); + } + else + { + obj.ToAsn1Object().Encode(this); + } + } + + public virtual void WriteObject( + Asn1Object obj) + { + if (obj == null) + { + WriteNull(); + } + else + { + obj.Encode(this); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOutputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOutputStream.cs.meta new file mode 100644 index 00000000..68f7bbb1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerOutputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b1bb944f8dee86942a8e2fb0c5c9520c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerPrintableString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerPrintableString.cs new file mode 100644 index 00000000..d510d974 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerPrintableString.cs @@ -0,0 +1,167 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Der PrintableString object. + */ + public class DerPrintableString + : DerStringBase + { + private readonly string str; + + /** + * return a printable string from the passed in object. + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerPrintableString GetInstance( + object obj) + { + if (obj == null || obj is DerPrintableString) + { + return (DerPrintableString)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return a Printable string from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerPrintableString GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerPrintableString) + { + return GetInstance(o); + } + + return new DerPrintableString(Asn1OctetString.GetInstance(o).GetOctets()); + } + + /** + * basic constructor - byte encoded string. + */ + public DerPrintableString( + byte[] str) + : this(Strings.FromAsciiByteArray(str), false) + { + } + + /** + * basic constructor - this does not validate the string + */ + public DerPrintableString( + string str) + : this(str, false) + { + } + + /** + * Constructor with optional validation. + * + * @param string the base string to wrap. + * @param validate whether or not to check the string. + * @throws ArgumentException if validate is true and the string + * contains characters that should not be in a PrintableString. + */ + public DerPrintableString( + string str, + bool validate) + { + if (str == null) + throw new ArgumentNullException("str"); + if (validate && !IsPrintableString(str)) + throw new ArgumentException("string contains illegal characters", "str"); + + this.str = str; + } + + public override string GetString() + { + return str; + } + + public byte[] GetOctets() + { + return Strings.ToAsciiByteArray(str); + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.PrintableString, GetOctets()); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerPrintableString other = asn1Object as DerPrintableString; + + if (other == null) + return false; + + return this.str.Equals(other.str); + } + + /** + * return true if the passed in String can be represented without + * loss as a PrintableString, false otherwise. + * + * @return true if in printable set, false otherwise. + */ + public static bool IsPrintableString( + string str) + { + foreach (char ch in str) + { + if (ch > 0x007f) + return false; + + if (char.IsLetterOrDigit(ch)) + continue; + +// if (char.IsPunctuation(ch)) +// continue; + + switch (ch) + { + case ' ': + case '\'': + case '(': + case ')': + case '+': + case '-': + case '.': + case ':': + case '=': + case '?': + case '/': + case ',': + continue; + } + + return false; + } + + return true; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerPrintableString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerPrintableString.cs.meta new file mode 100644 index 00000000..fedbd301 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerPrintableString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1200ec73d3f7fca4aaff102854e1059d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSequence.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSequence.cs new file mode 100644 index 00000000..876a43d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSequence.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerSequence + : Asn1Sequence + { + public static readonly DerSequence Empty = new DerSequence(); + + public static DerSequence FromVector( + Asn1EncodableVector v) + { + return v.Count < 1 ? Empty : new DerSequence(v); + } + + /** + * create an empty sequence + */ + public DerSequence() + : base(0) + { + } + + /** + * create a sequence containing one object + */ + public DerSequence( + Asn1Encodable obj) + : base(1) + { + AddObject(obj); + } + + public DerSequence( + params Asn1Encodable[] v) + : base(v.Length) + { + foreach (Asn1Encodable ae in v) + { + AddObject(ae); + } + } + + /** + * create a sequence containing a vector of objects. + */ + public DerSequence( + Asn1EncodableVector v) + : base(v.Count) + { + foreach (Asn1Encodable ae in v) + { + AddObject(ae); + } + } + + /* + * A note on the implementation: + *

+ * As Der requires the constructed, definite-length model to + * be used for structured types, this varies slightly from the + * ASN.1 descriptions given. Rather than just outputing Sequence, + * we also have to specify Constructed, and the objects length. + */ + internal override void Encode( + DerOutputStream derOut) + { + // TODO Intermediate buffer could be avoided if we could calculate expected length + MemoryStream bOut = new MemoryStream(); + DerOutputStream dOut = new DerOutputStream(bOut); + + foreach (Asn1Encodable obj in this) + { + dOut.WriteObject(obj); + } + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(dOut); + + byte[] bytes = bOut.ToArray(); + + derOut.WriteEncoded(Asn1Tags.Sequence | Asn1Tags.Constructed, bytes); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSequence.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSequence.cs.meta new file mode 100644 index 00000000..6f646b1f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSequence.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1ca9f0cbe9fb5c1489017b4d412573eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSet.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSet.cs new file mode 100644 index 00000000..72e94224 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSet.cs @@ -0,0 +1,115 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * A Der encoded set object + */ + public class DerSet + : Asn1Set + { + public static readonly DerSet Empty = new DerSet(); + + public static DerSet FromVector( + Asn1EncodableVector v) + { + return v.Count < 1 ? Empty : new DerSet(v); + } + + internal static DerSet FromVector( + Asn1EncodableVector v, + bool needsSorting) + { + return v.Count < 1 ? Empty : new DerSet(v, needsSorting); + } + + /** + * create an empty set + */ + public DerSet() + : base(0) + { + } + + /** + * @param obj - a single object that makes up the set. + */ + public DerSet( + Asn1Encodable obj) + : base(1) + { + AddObject(obj); + } + + public DerSet( + params Asn1Encodable[] v) + : base(v.Length) + { + foreach (Asn1Encodable o in v) + { + AddObject(o); + } + + Sort(); + } + + /** + * @param v - a vector of objects making up the set. + */ + public DerSet( + Asn1EncodableVector v) + : this(v, true) + { + } + + internal DerSet( + Asn1EncodableVector v, + bool needsSorting) + : base(v.Count) + { + foreach (Asn1Encodable o in v) + { + AddObject(o); + } + + if (needsSorting) + { + Sort(); + } + } + + /* + * A note on the implementation: + *

+ * As Der requires the constructed, definite-length model to + * be used for structured types, this varies slightly from the + * ASN.1 descriptions given. Rather than just outputing Set, + * we also have to specify Constructed, and the objects length. + */ + internal override void Encode( + DerOutputStream derOut) + { + // TODO Intermediate buffer could be avoided if we could calculate expected length + MemoryStream bOut = new MemoryStream(); + DerOutputStream dOut = new DerOutputStream(bOut); + + foreach (Asn1Encodable obj in this) + { + dOut.WriteObject(obj); + } + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(dOut); + + byte[] bytes = bOut.ToArray(); + + derOut.WriteEncoded(Asn1Tags.Set | Asn1Tags.Constructed, bytes); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSet.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSet.cs.meta new file mode 100644 index 00000000..eb8e6376 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerSet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f364dec2c9a290d44970ffd282c606bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerStringBase.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerStringBase.cs new file mode 100644 index 00000000..fd1c5039 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerStringBase.cs @@ -0,0 +1,26 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public abstract class DerStringBase + : Asn1Object, IAsn1String + { + protected DerStringBase() + { + } + + public abstract string GetString(); + + public override string ToString() + { + return GetString(); + } + + protected override int Asn1GetHashCode() + { + return GetString().GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerStringBase.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerStringBase.cs.meta new file mode 100644 index 00000000..8065a32e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerStringBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ff347a2eb85434458a6035f9c07cb84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerT61String.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerT61String.cs new file mode 100644 index 00000000..afc7649e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerT61String.cs @@ -0,0 +1,106 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Der T61String (also the teletex string) - 8-bit characters + */ + public class DerT61String + : DerStringBase + { + private readonly string str; + + /** + * return a T61 string from the passed in object. + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerT61String GetInstance( + object obj) + { + if (obj == null || obj is DerT61String) + { + return (DerT61String)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return an T61 string from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerT61String GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerT61String) + { + return GetInstance(o); + } + + return new DerT61String(Asn1OctetString.GetInstance(o).GetOctets()); + } + + /** + * basic constructor - with bytes. + */ + public DerT61String( + byte[] str) + : this(Strings.FromByteArray(str)) + { + } + + /** + * basic constructor - with string. + */ + public DerT61String( + string str) + { + if (str == null) + throw new ArgumentNullException("str"); + + this.str = str; + } + + public override string GetString() + { + return str; + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.T61String, GetOctets()); + } + + public byte[] GetOctets() + { + return Strings.ToByteArray(str); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerT61String other = asn1Object as DerT61String; + + if (other == null) + return false; + + return this.str.Equals(other.str); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerT61String.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerT61String.cs.meta new file mode 100644 index 00000000..20d449ec --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerT61String.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3128101ae52c6af4982834c862464364 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerTaggedObject.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerTaggedObject.cs new file mode 100644 index 00000000..2fe3afae --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerTaggedObject.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * DER TaggedObject - in ASN.1 notation this is any object preceded by + * a [n] where n is some number - these are assumed to follow the construction + * rules (as with sequences). + */ + public class DerTaggedObject + : Asn1TaggedObject + { + /** + * @param tagNo the tag number for this object. + * @param obj the tagged object. + */ + public DerTaggedObject( + int tagNo, + Asn1Encodable obj) + : base(tagNo, obj) + { + } + + /** + * @param explicitly true if an explicitly tagged object. + * @param tagNo the tag number for this object. + * @param obj the tagged object. + */ + public DerTaggedObject( + bool explicitly, + int tagNo, + Asn1Encodable obj) + : base(explicitly, tagNo, obj) + { + } + + /** + * create an implicitly tagged object that contains a zero + * length sequence. + */ + public DerTaggedObject( + int tagNo) + : base(false, tagNo, DerSequence.Empty) + { + } + + internal override void Encode( + DerOutputStream derOut) + { + if (!IsEmpty()) + { + byte[] bytes = obj.GetDerEncoded(); + + if (explicitly) + { + derOut.WriteEncoded(Asn1Tags.Constructed | Asn1Tags.Tagged, tagNo, bytes); + } + else + { + // + // need to mark constructed types... (preserve Constructed tag) + // + int flags = (bytes[0] & Asn1Tags.Constructed) | Asn1Tags.Tagged; + derOut.WriteTag(flags, tagNo); + derOut.Write(bytes, 1, bytes.Length - 1); + } + } + else + { + derOut.WriteEncoded(Asn1Tags.Constructed | Asn1Tags.Tagged, tagNo, new byte[0]); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerTaggedObject.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerTaggedObject.cs.meta new file mode 100644 index 00000000..9d6344ad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerTaggedObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 09a923adf168ad244bfe61ba31f805bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTCTime.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTCTime.cs new file mode 100644 index 00000000..eb4b4a48 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTCTime.cs @@ -0,0 +1,271 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Globalization; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * UTC time object. + */ + public class DerUtcTime + : Asn1Object + { + private readonly string time; + + /** + * return an UTC Time from the passed in object. + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerUtcTime GetInstance( + object obj) + { + if (obj == null || obj is DerUtcTime) + { + return (DerUtcTime)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return an UTC Time from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerUtcTime GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerUtcTime) + { + return GetInstance(o); + } + + return new DerUtcTime(((Asn1OctetString)o).GetOctets()); + } + + /** + * The correct format for this is YYMMDDHHMMSSZ (it used to be that seconds were + * never encoded. When you're creating one of these objects from scratch, that's + * what you want to use, otherwise we'll try to deal with whatever Gets read from + * the input stream... (this is why the input format is different from the GetTime() + * method output). + *

+ * @param time the time string.

+ */ + public DerUtcTime( + string time) + { + if (time == null) + throw new ArgumentNullException("time"); + + this.time = time; + + try + { + ToDateTime(); + } + catch (FormatException e) + { + throw new ArgumentException("invalid date string: " + e.Message); + } + } + + /** + * base constructor from a DateTime object + */ + public DerUtcTime( + DateTime time) + { +#if PORTABLE || NETFX_CORE + this.time = time.ToUniversalTime().ToString("yyMMddHHmmss", CultureInfo.InvariantCulture) + "Z"; +#else + this.time = time.ToString("yyMMddHHmmss", CultureInfo.InvariantCulture) + "Z"; +#endif + } + + internal DerUtcTime( + byte[] bytes) + { + // + // explicitly convert to characters + // + this.time = Strings.FromAsciiByteArray(bytes); + } + +// public DateTime ToDateTime() +// { +// string tm = this.AdjustedTimeString; +// +// return new DateTime( +// Int16.Parse(tm.Substring(0, 4)), +// Int16.Parse(tm.Substring(4, 2)), +// Int16.Parse(tm.Substring(6, 2)), +// Int16.Parse(tm.Substring(8, 2)), +// Int16.Parse(tm.Substring(10, 2)), +// Int16.Parse(tm.Substring(12, 2))); +// } + + /** + * return the time as a date based on whatever a 2 digit year will return. For + * standardised processing use ToAdjustedDateTime(). + * + * @return the resulting date + * @exception ParseException if the date string cannot be parsed. + */ + public DateTime ToDateTime() + { + return ParseDateString(TimeString, @"yyMMddHHmmss'GMT'zzz"); + } + + /** + * return the time as an adjusted date + * in the range of 1950 - 2049. + * + * @return a date in the range of 1950 to 2049. + * @exception ParseException if the date string cannot be parsed. + */ + public DateTime ToAdjustedDateTime() + { + return ParseDateString(AdjustedTimeString, @"yyyyMMddHHmmss'GMT'zzz"); + } + + private DateTime ParseDateString( + string dateStr, + string formatStr) + { + DateTime dt = DateTime.ParseExact( + dateStr, + formatStr, + DateTimeFormatInfo.InvariantInfo); + + return dt.ToUniversalTime(); + } + + /** + * return the time - always in the form of + * YYMMDDhhmmssGMT(+hh:mm|-hh:mm). + *

+ * Normally in a certificate we would expect "Z" rather than "GMT", + * however adding the "GMT" means we can just use: + *

+         *     dateF = new SimpleDateFormat("yyMMddHHmmssz");
+         * 
+ * To read in the time and Get a date which is compatible with our local + * time zone.

+ *

+ * Note: In some cases, due to the local date processing, this + * may lead to unexpected results. If you want to stick the normal + * convention of 1950 to 2049 use the GetAdjustedTime() method.

+ */ + public string TimeString + { + get + { + // + // standardise the format. + // + if (time.IndexOf('-') < 0 && time.IndexOf('+') < 0) + { + if (time.Length == 11) + { + return time.Substring(0, 10) + "00GMT+00:00"; + } + else + { + return time.Substring(0, 12) + "GMT+00:00"; + } + } + else + { + int index = time.IndexOf('-'); + if (index < 0) + { + index = time.IndexOf('+'); + } + string d = time; + + if (index == time.Length - 3) + { + d += "00"; + } + + if (index == 10) + { + return d.Substring(0, 10) + "00GMT" + d.Substring(10, 3) + ":" + d.Substring(13, 2); + } + else + { + return d.Substring(0, 12) + "GMT" + d.Substring(12, 3) + ":" + d.Substring(15, 2); + } + } + } + } + + [Obsolete("Use 'AdjustedTimeString' property instead")] + public string AdjustedTime + { + get { return AdjustedTimeString; } + } + + /// + /// Return a time string as an adjusted date with a 4 digit year. + /// This goes in the range of 1950 - 2049. + /// + public string AdjustedTimeString + { + get + { + string d = TimeString; + string c = d[0] < '5' ? "20" : "19"; + + return c + d; + } + } + + private byte[] GetOctets() + { + return Strings.ToAsciiByteArray(time); + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.UtcTime, GetOctets()); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerUtcTime other = asn1Object as DerUtcTime; + + if (other == null) + return false; + + return this.time.Equals(other.time); + } + + protected override int Asn1GetHashCode() + { + return time.GetHashCode(); + } + + public override string ToString() + { + return time; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTCTime.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTCTime.cs.meta new file mode 100644 index 00000000..f6ae5216 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTCTime.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 974cf3154ca4d22409f3c9f174fd6f5d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTF8String.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTF8String.cs new file mode 100644 index 00000000..64778583 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTF8String.cs @@ -0,0 +1,102 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Der UTF8String object. + */ + public class DerUtf8String + : DerStringBase + { + private readonly string str; + + /** + * return an UTF8 string from the passed in object. + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerUtf8String GetInstance( + object obj) + { + if (obj == null || obj is DerUtf8String) + { + return (DerUtf8String)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return an UTF8 string from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerUtf8String GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerUtf8String) + { + return GetInstance(o); + } + + return new DerUtf8String(Asn1OctetString.GetInstance(o).GetOctets()); + } + + /** + * basic constructor - byte encoded string. + */ + public DerUtf8String( + byte[] str) + : this(Encoding.UTF8.GetString(str, 0, str.Length)) + { + } + + /** + * basic constructor + */ + public DerUtf8String( + string str) + { + if (str == null) + throw new ArgumentNullException("str"); + + this.str = str; + } + + public override string GetString() + { + return str; + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerUtf8String other = asn1Object as DerUtf8String; + + if (other == null) + return false; + + return this.str.Equals(other.str); + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.Utf8String, Encoding.UTF8.GetBytes(str)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTF8String.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTF8String.cs.meta new file mode 100644 index 00000000..70a0e116 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUTF8String.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59793e3c98172f046a238fb0352e1e38 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUniversalString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUniversalString.cs new file mode 100644 index 00000000..ef688f9e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUniversalString.cs @@ -0,0 +1,111 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Der UniversalString object. + */ + public class DerUniversalString + : DerStringBase + { + private static readonly char[] table = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + private readonly byte[] str; + + /** + * return a Universal string from the passed in object. + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerUniversalString GetInstance( + object obj) + { + if (obj == null || obj is DerUniversalString) + { + return (DerUniversalString)obj; + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return a Universal string from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerUniversalString GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerUniversalString) + { + return GetInstance(o); + } + + return new DerUniversalString(Asn1OctetString.GetInstance(o).GetOctets()); + } + + /** + * basic constructor - byte encoded string. + */ + public DerUniversalString( + byte[] str) + { + if (str == null) + throw new ArgumentNullException("str"); + + this.str = str; + } + + public override string GetString() + { + StringBuilder buffer = new StringBuilder("#"); + byte[] enc = GetDerEncoded(); + + for (int i = 0; i != enc.Length; i++) + { + uint ubyte = enc[i]; + buffer.Append(table[(ubyte >> 4) & 0xf]); + buffer.Append(table[enc[i] & 0xf]); + } + + return buffer.ToString(); + } + + public byte[] GetOctets() + { + return (byte[]) str.Clone(); + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.UniversalString, this.str); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerUniversalString other = asn1Object as DerUniversalString; + + if (other == null) + return false; + +// return this.GetString().Equals(other.GetString()); + return Arrays.AreEqual(this.str, other.str); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUniversalString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUniversalString.cs.meta new file mode 100644 index 00000000..648b26f4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerUniversalString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9aeab3619d1c4324f9e7968fa71c7ed4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVideotexString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVideotexString.cs new file mode 100644 index 00000000..e730dce5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVideotexString.cs @@ -0,0 +1,107 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class DerVideotexString + : DerStringBase + { + private readonly byte[] mString; + + /** + * return a Videotex String from the passed in object + * + * @param obj a DERVideotexString or an object that can be converted into one. + * @exception IllegalArgumentException if the object cannot be converted. + * @return a DERVideotexString instance, or null. + */ + public static DerVideotexString GetInstance(object obj) + { + if (obj == null || obj is DerVideotexString) + { + return (DerVideotexString)obj; + } + + if (obj is byte[]) + { + try + { + return (DerVideotexString)FromByteArray((byte[])obj); + } + catch (Exception e) + { + throw new ArgumentException("encoding error in GetInstance: " + e.ToString(), "obj"); + } + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * return a Videotex String from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicit true if the object is meant to be explicitly + * tagged false otherwise. + * @exception IllegalArgumentException if the tagged object cannot + * be converted. + * @return a DERVideotexString instance, or null. + */ + public static DerVideotexString GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + Asn1Object o = obj.GetObject(); + + if (isExplicit || o is DerVideotexString) + { + return GetInstance(o); + } + + return new DerVideotexString(((Asn1OctetString)o).GetOctets()); + } + + /** + * basic constructor - with bytes. + * @param string the byte encoding of the characters making up the string. + */ + public DerVideotexString(byte[] encoding) + { + this.mString = Arrays.Clone(encoding); + } + + public override string GetString() + { + return Strings.FromByteArray(mString); + } + + public byte[] GetOctets() + { + return Arrays.Clone(mString); + } + + internal override void Encode(DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.VideotexString, mString); + } + + protected override int Asn1GetHashCode() + { + return Arrays.GetHashCode(mString); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerVideotexString other = asn1Object as DerVideotexString; + + if (other == null) + return false; + + return Arrays.AreEqual(mString, other.mString); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVideotexString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVideotexString.cs.meta new file mode 100644 index 00000000..b9e4a3c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVideotexString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd1f8c7688b859b4d990225267b276ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVisibleString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVisibleString.cs new file mode 100644 index 00000000..3c422fb1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVisibleString.cs @@ -0,0 +1,115 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Der VisibleString object. + */ + public class DerVisibleString + : DerStringBase + { + private readonly string str; + + /** + * return a Visible string from the passed in object. + * + * @exception ArgumentException if the object cannot be converted. + */ + public static DerVisibleString GetInstance( + object obj) + { + if (obj == null || obj is DerVisibleString) + { + return (DerVisibleString)obj; + } + + if (obj is Asn1OctetString) + { + return new DerVisibleString(((Asn1OctetString)obj).GetOctets()); + } + + if (obj is Asn1TaggedObject) + { + return GetInstance(((Asn1TaggedObject)obj).GetObject()); + } + + throw new ArgumentException("illegal object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + /** + * return a Visible string from a tagged object. + * + * @param obj the tagged object holding the object we want + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the tagged object cannot + * be converted. + */ + public static DerVisibleString GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(obj.GetObject()); + } + + /** + * basic constructor - byte encoded string. + */ + public DerVisibleString( + byte[] str) + : this(Strings.FromAsciiByteArray(str)) + { + } + + /** + * basic constructor + */ + public DerVisibleString( + string str) + { + if (str == null) + throw new ArgumentNullException("str"); + + this.str = str; + } + + public override string GetString() + { + return str; + } + + public byte[] GetOctets() + { + return Strings.ToAsciiByteArray(str); + } + + internal override void Encode( + DerOutputStream derOut) + { + derOut.WriteEncoded(Asn1Tags.VisibleString, GetOctets()); + } + + protected override bool Asn1Equals( + Asn1Object asn1Object) + { + DerVisibleString other = asn1Object as DerVisibleString; + + if (other == null) + return false; + + return this.str.Equals(other.str); + } + + protected override int Asn1GetHashCode() + { + return this.str.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVisibleString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVisibleString.cs.meta new file mode 100644 index 00000000..92b11d14 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/DerVisibleString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f9c45522cf4626c4c81e4e6b8b3fe74b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1ApplicationSpecificParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1ApplicationSpecificParser.cs new file mode 100644 index 00000000..a7f0e115 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1ApplicationSpecificParser.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public interface IAsn1ApplicationSpecificParser + : IAsn1Convertible + { + IAsn1Convertible ReadObject(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1ApplicationSpecificParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1ApplicationSpecificParser.cs.meta new file mode 100644 index 00000000..3e400bf1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1ApplicationSpecificParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5db852656650b934d8a382f2d26d18b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Choice.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Choice.cs new file mode 100644 index 00000000..77b82c8e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Choice.cs @@ -0,0 +1,21 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * Marker interface for CHOICE objects - if you implement this in a roll-your-own + * object, any attempt to tag the object implicitly will convert the tag to an + * explicit one as the encoding rules require. + *

+ * If you use this interface your class should also implement the getInstance + * pattern which takes a tag object and the tagging mode used. + *

+ */ + public interface IAsn1Choice + { + // marker interface + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Choice.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Choice.cs.meta new file mode 100644 index 00000000..d0f7086c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Choice.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71028704810a2d447920c97d24f875e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Convertible.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Convertible.cs new file mode 100644 index 00000000..2fbeaa8d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Convertible.cs @@ -0,0 +1,11 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public interface IAsn1Convertible + { + Asn1Object ToAsn1Object(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Convertible.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Convertible.cs.meta new file mode 100644 index 00000000..98058a2f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1Convertible.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07cd5c034ed2a474690fa66bd2118ce9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1String.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1String.cs new file mode 100644 index 00000000..8a101615 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1String.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * basic interface for Der string objects. + */ + public interface IAsn1String + { + string GetString(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1String.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1String.cs.meta new file mode 100644 index 00000000..83cedd8a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IAsn1String.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f46d890a56de484eb4eef965cc5cb64 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IndefiniteLengthInputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IndefiniteLengthInputStream.cs new file mode 100644 index 00000000..991d6f8b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IndefiniteLengthInputStream.cs @@ -0,0 +1,174 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + class IndefiniteLengthInputStream + : LimitedInputStream + { + private int _lookAhead; + private bool _eofOn00 = true; + + internal IndefiniteLengthInputStream( + Stream inStream, + int limit) + : base(inStream, limit) + { + _lookAhead = RequireByte(); + CheckForEof(); + } + + internal void SetEofOn00( + bool eofOn00) + { + _eofOn00 = eofOn00; + if (_eofOn00) + { + CheckForEof(); + } + } + + private bool CheckForEof() + { + if (_lookAhead == 0x00) + { + int extra = RequireByte(); + if (extra != 0) + { + throw new IOException("malformed end-of-contents marker"); + } + + _lookAhead = -1; + SetParentEofDetect(true); + return true; + } + return _lookAhead < 0; + } + + public override int Read( + byte[] buffer, + int offset, + int count) + { + // Only use this optimisation if we aren't checking for 00 + if (_eofOn00 || count <= 1) + return base.Read(buffer, offset, count); + + if (_lookAhead < 0) + return 0; + + int numRead = _in.Read(buffer, offset + 1, count - 1); + + if (numRead <= 0) + { + // Corrupted stream + throw new EndOfStreamException(); + } + + buffer[offset] = (byte)_lookAhead; + _lookAhead = RequireByte(); + + return numRead + 1; + } + + public override int ReadByte() + { + if (_eofOn00 && CheckForEof()) + return -1; + + int result = _lookAhead; + _lookAhead = RequireByte(); + return result; + } + + private int RequireByte() + { + int b = _in.ReadByte(); + if (b < 0) + { + // Corrupted stream + throw new EndOfStreamException(); + } + return b; + } + } +} + +//using System; +//using System.IO; + +//namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +//{ +// class IndefiniteLengthInputStream +// : LimitedInputStream +// { +// private bool _eofReached = false; +// private bool _eofOn00 = true; + +// internal IndefiniteLengthInputStream( +// Stream inStream, +// int limit) +// : base(inStream, limit) +// { +// } + +// internal void SetEofOn00( +// bool eofOn00) +// { +// _eofOn00 = eofOn00; +// } + +// public override int Read( +// byte[] buffer, +// int offset, +// int count) +// { +// if (_eofReached) +// return 0; + +// if (_eofOn00) +// return base.Read(buffer, offset, count); + +// int numRead = _in.Read(buffer, offset, count); + +// if (numRead <= 0) +// throw new EndOfStreamException(); + +// return numRead; +// } + +// public override int ReadByte() +// { +// if (_eofReached) +// return -1; + +// int b1 = _in.ReadByte(); + +// if (b1 < 0) +// throw new EndOfStreamException(); + +// if (b1 == 0 && _eofOn00) +// { +// int b2 = _in.ReadByte(); + +// if (b2 < 0) +// throw new EndOfStreamException(); + +// if (b2 == 0) +// { +// _eofReached = true; +// SetParentEofDetect(true); +// return -1; +// } + +// throw new InvalidDataException(); +// } + +// return b1; +// } +// } +//} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IndefiniteLengthInputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IndefiniteLengthInputStream.cs.meta new file mode 100644 index 00000000..e533b1db --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/IndefiniteLengthInputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5faa2aff355d23945ae836ec7393a1b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyASN1InputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyASN1InputStream.cs new file mode 100644 index 00000000..b352026f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyASN1InputStream.cs @@ -0,0 +1,37 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + public class LazyAsn1InputStream + : Asn1InputStream + { + public LazyAsn1InputStream( + byte[] input) + : base(input) + { + } + + public LazyAsn1InputStream( + Stream inputStream) + : base(inputStream) + { + } + + internal override DerSequence CreateDerSequence( + DefiniteLengthInputStream dIn) + { + return new LazyDerSequence(dIn.ToArray()); + } + + internal override DerSet CreateDerSet( + DefiniteLengthInputStream dIn) + { + return new LazyDerSet(dIn.ToArray()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyASN1InputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyASN1InputStream.cs.meta new file mode 100644 index 00000000..502f4b5b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyASN1InputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b99b4c1a9bb0e04cac3fe4ae55f6cf9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSequence.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSequence.cs new file mode 100644 index 00000000..725a0929 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSequence.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Diagnostics; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + internal class LazyDerSequence + : DerSequence + { + private byte[] encoded; + + internal LazyDerSequence( + byte[] encoded) + { + this.encoded = encoded; + } + + private void Parse() + { + lock (this) + { + if (encoded != null) + { + Asn1InputStream e = new LazyAsn1InputStream(encoded); + + Asn1Object o; + while ((o = e.ReadObject()) != null) + { + AddObject(o); + } + + encoded = null; + } + } + } + + public override Asn1Encodable this[int index] + { + get + { + Parse(); + + return base[index]; + } + } + + public override IEnumerator GetEnumerator() + { + Parse(); + + return base.GetEnumerator(); + } + + public override int Count + { + get + { + Parse(); + + return base.Count; + } + } + + internal override void Encode( + DerOutputStream derOut) + { + lock (this) + { + if (encoded == null) + { + base.Encode(derOut); + } + else + { + derOut.WriteEncoded(Asn1Tags.Sequence | Asn1Tags.Constructed, encoded); + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSequence.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSequence.cs.meta new file mode 100644 index 00000000..e266c267 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSequence.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05b54ca5e1058684db4f666dfd635913 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSet.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSet.cs new file mode 100644 index 00000000..e5358c78 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSet.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Diagnostics; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + internal class LazyDerSet + : DerSet + { + private byte[] encoded; + + internal LazyDerSet( + byte[] encoded) + { + this.encoded = encoded; + } + + private void Parse() + { + lock (this) + { + if (encoded != null) + { + Asn1InputStream e = new LazyAsn1InputStream(encoded); + + Asn1Object o; + while ((o = e.ReadObject()) != null) + { + AddObject(o); + } + + encoded = null; + } + } + } + + public override Asn1Encodable this[int index] + { + get + { + Parse(); + + return base[index]; + } + } + + public override IEnumerator GetEnumerator() + { + Parse(); + + return base.GetEnumerator(); + } + + public override int Count + { + get + { + Parse(); + + return base.Count; + } + } + + internal override void Encode( + DerOutputStream derOut) + { + lock (this) + { + if (encoded == null) + { + base.Encode(derOut); + } + else + { + derOut.WriteEncoded(Asn1Tags.Set | Asn1Tags.Constructed, encoded); + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSet.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSet.cs.meta new file mode 100644 index 00000000..25ae00b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LazyDERSet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 76bf92893e66b884594d31a9693939d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LimitedInputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LimitedInputStream.cs new file mode 100644 index 00000000..7e4ad001 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LimitedInputStream.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + internal abstract class LimitedInputStream + : BaseInputStream + { + protected readonly Stream _in; + private int _limit; + + internal LimitedInputStream( + Stream inStream, + int limit) + { + this._in = inStream; + this._limit = limit; + } + + internal virtual int GetRemaining() + { + // TODO: maybe one day this can become more accurate + return _limit; + } + + protected virtual void SetParentEofDetect(bool on) + { + if (_in is IndefiniteLengthInputStream) + { + ((IndefiniteLengthInputStream)_in).SetEofOn00(on); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LimitedInputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LimitedInputStream.cs.meta new file mode 100644 index 00000000..1544ee84 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/LimitedInputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2282e5c2e036b444d8ef59d4ca1522dc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/OidTokenizer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/OidTokenizer.cs new file mode 100644 index 00000000..f40c5192 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/OidTokenizer.cs @@ -0,0 +1,49 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1 +{ + /** + * class for breaking up an Oid into it's component tokens, ala + * java.util.StringTokenizer. We need this class as some of the + * lightweight Java environment don't support classes like + * StringTokenizer. + */ + public class OidTokenizer + { + private string oid; + private int index; + + public OidTokenizer( + string oid) + { + this.oid = oid; + } + + public bool HasMoreTokens + { + get { return index != -1; } + } + + public string NextToken() + { + if (index == -1) + { + return null; + } + + int end = oid.IndexOf('.', index); + if (end == -1) + { + string lastToken = oid.Substring(index); + index = -1; + return lastToken; + } + + string nextToken = oid.Substring(index, end - index); + index = end + 1; + return nextToken; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/OidTokenizer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/OidTokenizer.cs.meta new file mode 100644 index 00000000..9f3cfe43 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/OidTokenizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d6be1ce8f546e0745948e3d162116698 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi.meta new file mode 100644 index 00000000..670bc12c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a78b3d8524e59be4999d414a705d774a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSINamedCurves.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSINamedCurves.cs new file mode 100644 index 00000000..92adb0ce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSINamedCurves.cs @@ -0,0 +1,127 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Anssi +{ + public class AnssiNamedCurves + { + private static ECCurve ConfigureCurve(ECCurve curve) + { + return curve; + } + + private static BigInteger FromHex(string hex) + { + return new BigInteger(1, Hex.Decode(hex)); + } + + /* + * FRP256v1 + */ + internal class Frp256v1Holder + : X9ECParametersHolder + { + private Frp256v1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Frp256v1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger p = FromHex("F1FD178C0B3AD58F10126DE8CE42435B3961ADBCABC8CA6DE8FCF353D86E9C03"); + BigInteger a = FromHex("F1FD178C0B3AD58F10126DE8CE42435B3961ADBCABC8CA6DE8FCF353D86E9C00"); + BigInteger b = FromHex("EE353FCA5428A9300D4ABA754A44C00FDFEC0C9AE4B1A1803075ED967B7BB73F"); + byte[] S = null; + BigInteger n = FromHex("F1FD178C0B3AD58F10126DE8CE42435B53DC67E140D2BF941FFDD459C6D655E1"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "B6B3D4C356C139EB31183D4749D423958C27D2DCAF98B70164C97A2DD98F5CFF" + + "6142E0F7C8B204911F9271F0F3ECEF8C2701C307E8E4C9E183115A1554062CFB")); + + return new X9ECParameters(curve, G, n, h, S); + } + }; + + + private static readonly IDictionary objIds = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary curves = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary names = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + private static void DefineCurve( + string name, + DerObjectIdentifier oid, + X9ECParametersHolder holder) + { + objIds.Add(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name), oid); + names.Add(oid, name); + curves.Add(oid, holder); + } + + static AnssiNamedCurves() + { + DefineCurve("FRP256v1", AnssiObjectIdentifiers.FRP256v1, Frp256v1Holder.Instance); + } + + public static X9ECParameters GetByName( + string name) + { + DerObjectIdentifier oid = GetOid(name); + return oid == null ? null : GetByOid(oid); + } + + /** + * return the X9ECParameters object for the named curve represented by + * the passed in object identifier. Null if the curve isn't present. + * + * @param oid an object identifier representing a named curve, if present. + */ + public static X9ECParameters GetByOid( + DerObjectIdentifier oid) + { + X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid]; + return holder == null ? null : holder.Parameters; + } + + /** + * return the object identifier signified by the passed in name. Null + * if there is no object identifier associated with name. + * + * @return the object identifier associated with name, if present. + */ + public static DerObjectIdentifier GetOid( + string name) + { + return (DerObjectIdentifier)objIds[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name)]; + } + + /** + * return the named curve name represented by the given object identifier. + */ + public static string GetName( + DerObjectIdentifier oid) + { + return (string)names[oid]; + } + + /** + * returns an enumeration containing the name strings for curves + * contained in this structure. + */ + public static IEnumerable Names + { + get { return new EnumerableProxy(names.Values); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSINamedCurves.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSINamedCurves.cs.meta new file mode 100644 index 00000000..0522f616 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSINamedCurves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e908adca735a50b4ea4afcceea30542f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSIObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSIObjectIdentifiers.cs new file mode 100644 index 00000000..1c406c74 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSIObjectIdentifiers.cs @@ -0,0 +1,17 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Anssi +{ + public sealed class AnssiObjectIdentifiers + { + private AnssiObjectIdentifiers() + { + } + + public static readonly DerObjectIdentifier FRP256v1 = new DerObjectIdentifier("1.2.250.1.223.101.256.1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSIObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSIObjectIdentifiers.cs.meta new file mode 100644 index 00000000..0dcf77ab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/anssi/ANSSIObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: edd7ffa2202a9ad4fb1a88ae60f09ea7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc.meta new file mode 100644 index 00000000..d356e923 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 458d0ea5f30d18d4c984273e5827384a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc/BCObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc/BCObjectIdentifiers.cs new file mode 100644 index 00000000..cf263c1c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc/BCObjectIdentifiers.cs @@ -0,0 +1,112 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.BC +{ + public abstract class BCObjectIdentifiers + { + /** + * iso.org.dod.internet.private.enterprise.legion-of-the-bouncy-castle + *

+ * 1.3.6.1.4.1.22554 + */ + public static readonly DerObjectIdentifier bc = new DerObjectIdentifier("1.3.6.1.4.1.22554"); + + /** + * pbe(1) algorithms + *

+ * 1.3.6.1.4.1.22554.1 + */ + public static readonly DerObjectIdentifier bc_pbe = bc.Branch("1"); + + /** + * SHA-1(1) + *

+ * 1.3.6.1.4.1.22554.1.1 + */ + public static readonly DerObjectIdentifier bc_pbe_sha1 = bc_pbe.Branch("1"); + + /** SHA-2.SHA-256; 1.3.6.1.4.1.22554.1.2.1 */ + public static readonly DerObjectIdentifier bc_pbe_sha256 = bc_pbe.Branch("2.1"); + /** SHA-2.SHA-384; 1.3.6.1.4.1.22554.1.2.2 */ + public static readonly DerObjectIdentifier bc_pbe_sha384 = bc_pbe.Branch("2.2"); + /** SHA-2.SHA-512; 1.3.6.1.4.1.22554.1.2.3 */ + public static readonly DerObjectIdentifier bc_pbe_sha512 = bc_pbe.Branch("2.3"); + /** SHA-2.SHA-224; 1.3.6.1.4.1.22554.1.2.4 */ + public static readonly DerObjectIdentifier bc_pbe_sha224 = bc_pbe.Branch("2.4"); + + /** + * PKCS-5(1)|PKCS-12(2) + */ + /** SHA-1.PKCS5; 1.3.6.1.4.1.22554.1.1.1 */ + public static readonly DerObjectIdentifier bc_pbe_sha1_pkcs5 = bc_pbe_sha1.Branch("1"); + /** SHA-1.PKCS12; 1.3.6.1.4.1.22554.1.1.2 */ + public static readonly DerObjectIdentifier bc_pbe_sha1_pkcs12 = bc_pbe_sha1.Branch("2"); + + /** SHA-256.PKCS12; 1.3.6.1.4.1.22554.1.2.1.1 */ + public static readonly DerObjectIdentifier bc_pbe_sha256_pkcs5 = bc_pbe_sha256.Branch("1"); + /** SHA-256.PKCS12; 1.3.6.1.4.1.22554.1.2.1.2 */ + public static readonly DerObjectIdentifier bc_pbe_sha256_pkcs12 = bc_pbe_sha256.Branch("2"); + + /** + * AES(1) . (CBC-128(2)|CBC-192(22)|CBC-256(42)) + */ + /** 1.3.6.1.4.1.22554.1.1.2.1.2 */ + public static readonly DerObjectIdentifier bc_pbe_sha1_pkcs12_aes128_cbc = bc_pbe_sha1_pkcs12.Branch("1.2"); + /** 1.3.6.1.4.1.22554.1.1.2.1.22 */ + public static readonly DerObjectIdentifier bc_pbe_sha1_pkcs12_aes192_cbc = bc_pbe_sha1_pkcs12.Branch("1.22"); + /** 1.3.6.1.4.1.22554.1.1.2.1.42 */ + public static readonly DerObjectIdentifier bc_pbe_sha1_pkcs12_aes256_cbc = bc_pbe_sha1_pkcs12.Branch("1.42"); + + /** 1.3.6.1.4.1.22554.1.1.2.2.2 */ + public static readonly DerObjectIdentifier bc_pbe_sha256_pkcs12_aes128_cbc = bc_pbe_sha256_pkcs12.Branch("1.2"); + /** 1.3.6.1.4.1.22554.1.1.2.2.22 */ + public static readonly DerObjectIdentifier bc_pbe_sha256_pkcs12_aes192_cbc = bc_pbe_sha256_pkcs12.Branch("1.22"); + /** 1.3.6.1.4.1.22554.1.1.2.2.42 */ + public static readonly DerObjectIdentifier bc_pbe_sha256_pkcs12_aes256_cbc = bc_pbe_sha256_pkcs12.Branch("1.42"); + + /** + * signature(2) algorithms + */ + public static readonly DerObjectIdentifier bc_sig = bc.Branch("2"); + + /** + * Sphincs-256 + */ + public static readonly DerObjectIdentifier sphincs256 = bc_sig.Branch("1"); + public static readonly DerObjectIdentifier sphincs256_with_BLAKE512 = sphincs256.Branch("1"); + public static readonly DerObjectIdentifier sphincs256_with_SHA512 = sphincs256.Branch("2"); + public static readonly DerObjectIdentifier sphincs256_with_SHA3_512 = sphincs256.Branch("3"); + + /** + * XMSS + */ + public static readonly DerObjectIdentifier xmss = bc_sig.Branch("2"); + public static readonly DerObjectIdentifier xmss_with_SHA256 = xmss.Branch("1"); + public static readonly DerObjectIdentifier xmss_with_SHA512 = xmss.Branch("2"); + public static readonly DerObjectIdentifier xmss_with_SHAKE128 = xmss.Branch("3"); + public static readonly DerObjectIdentifier xmss_with_SHAKE256 = xmss.Branch("4"); + + /** + * XMSS^MT + */ + public static readonly DerObjectIdentifier xmss_mt = bc_sig.Branch("3"); + public static readonly DerObjectIdentifier xmss_mt_with_SHA256 = xmss_mt.Branch("1"); + public static readonly DerObjectIdentifier xmss_mt_with_SHA512 = xmss_mt.Branch("2"); + public static readonly DerObjectIdentifier xmss_mt_with_SHAKE128 = xmss_mt.Branch("3"); + public static readonly DerObjectIdentifier xmss_mt_with_SHAKE256 = xmss_mt.Branch("4"); + + /** + * key_exchange(3) algorithms + */ + public static readonly DerObjectIdentifier bc_exch = bc.Branch("3"); + + /** + * NewHope + */ + public static readonly DerObjectIdentifier newHope = bc_exch.Branch("1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc/BCObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc/BCObjectIdentifiers.cs.meta new file mode 100644 index 00000000..040ff09c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bc/BCObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88b600bd01c1bd84d852eaee534e8c9a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi.meta new file mode 100644 index 00000000..211a68ae --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d69a6d859d991b64f8b842ce92e9378d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi/BsiObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi/BsiObjectIdentifiers.cs new file mode 100644 index 00000000..61731e90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi/BsiObjectIdentifiers.cs @@ -0,0 +1,107 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Bsi +{ + /// See https://www.bsi.bund.de/cae/servlet/contentblob/471398/publicationFile/30615/BSI-TR-03111_pdf.pdf + public abstract class BsiObjectIdentifiers + { + public static readonly DerObjectIdentifier bsi_de = new DerObjectIdentifier("0.4.0.127.0.7"); + + /* 0.4.0.127.0.7.1.1 */ + public static readonly DerObjectIdentifier id_ecc = bsi_de.Branch("1.1"); + + /* 0.4.0.127.0.7.1.1.4.1 */ + public static readonly DerObjectIdentifier ecdsa_plain_signatures = id_ecc.Branch("4.1"); + + /* 0.4.0.127.0.7.1.1.4.1.1 */ + public static readonly DerObjectIdentifier ecdsa_plain_SHA1 = ecdsa_plain_signatures.Branch("1"); + + /* 0.4.0.127.0.7.1.1.4.1.2 */ + public static readonly DerObjectIdentifier ecdsa_plain_SHA224 = ecdsa_plain_signatures.Branch("2"); + + /* 0.4.0.127.0.7.1.1.4.1.3 */ + public static readonly DerObjectIdentifier ecdsa_plain_SHA256 = ecdsa_plain_signatures.Branch("3"); + + /* 0.4.0.127.0.7.1.1.4.1.4 */ + public static readonly DerObjectIdentifier ecdsa_plain_SHA384 = ecdsa_plain_signatures.Branch("4"); + + /* 0.4.0.127.0.7.1.1.4.1.5 */ + public static readonly DerObjectIdentifier ecdsa_plain_SHA512 = ecdsa_plain_signatures.Branch("5"); + + /* 0.4.0.127.0.7.1.1.4.1.6 */ + public static readonly DerObjectIdentifier ecdsa_plain_RIPEMD160 = ecdsa_plain_signatures.Branch("6"); + + /** 0.4.0.127.0.7.1 */ + public static readonly DerObjectIdentifier algorithm = bsi_de.Branch("1"); + + public static readonly DerObjectIdentifier ecka_eg = id_ecc.Branch("5.1"); + + /** ElGamal Elliptic Curve Key Agreement and Key Derivation according to X963 OID: 0.4.0.127.0.7.1.1.5.1.1 */ + public static readonly DerObjectIdentifier ecka_eg_X963kdf = ecka_eg.Branch("1"); + + /** ElGamal Elliptic Curve Key Agreement and Key Derivation according to X963 + * with hash function SHA-1 + * OID: 0.4.0.127.0.7.1.1.5.1.1.1 */ + public static readonly DerObjectIdentifier ecka_eg_X963kdf_SHA1 = ecka_eg_X963kdf.Branch("1"); + + /** ElGamal Elliptic Curve Key Agreement and Key Derivation according to X963 + * with hash function SHA224 + * OID: 0.4.0.127.0.7.1.1.5.1.1.2 */ + public static readonly DerObjectIdentifier ecka_eg_X963kdf_SHA224 = ecka_eg_X963kdf.Branch("2"); + + /** ElGamal Elliptic Curve Key Agreement and Key Derivation according to X963 + * with hash function SHA256 + * OID: 0.4.0.127.0.7.1.1.5.1.1.3 */ + public static readonly DerObjectIdentifier ecka_eg_X963kdf_SHA256 = ecka_eg_X963kdf.Branch("3"); + + /** ElGamal Elliptic Curve Key Agreement and Key Derivation according to X963 + * with hash function SHA384 + * OID: 0.4.0.127.0.7.1.1.5.1.1.4 */ + public static readonly DerObjectIdentifier ecka_eg_X963kdf_SHA384 = ecka_eg_X963kdf.Branch("4"); + + /** ElGamal Elliptic Curve Key Agreement and Key Derivation according to X963 + * with hash function SHA512 + * OID: 0.4.0.127.0.7.1.1.5.1.1.5 */ + public static readonly DerObjectIdentifier ecka_eg_X963kdf_SHA512 = ecka_eg_X963kdf.Branch("5"); + + /** ElGamal Elliptic Curve Key Agreement and Key Derivation according to X963 + * with hash function RIPEMD160 + * OID: 0.4.0.127.0.7.1.1.5.1.1.6 */ + public static readonly DerObjectIdentifier ecka_eg_X963kdf_RIPEMD160 = ecka_eg_X963kdf.Branch("6"); + + /** + * Key Derivation Function for Session Keys + */ + public static readonly DerObjectIdentifier ecka_eg_SessionKDF = ecka_eg.Branch("2"); + + public static readonly DerObjectIdentifier ecka_eg_SessionKDF_3DES = ecka_eg_SessionKDF.Branch("1"); + public static readonly DerObjectIdentifier ecka_eg_SessionKDF_AES128 = ecka_eg_SessionKDF.Branch("2"); + public static readonly DerObjectIdentifier ecka_eg_SessionKDF_AES192 = ecka_eg_SessionKDF.Branch("3"); + public static readonly DerObjectIdentifier ecka_eg_SessionKDF_AES256 = ecka_eg_SessionKDF.Branch("4"); + + /** AES encryption (CBC) and authentication (CMAC) + * OID: 0.4.0.127.0.7.1.x */ + //TODO: replace "1" with correct OID + //public static readonly DerObjectIdentifier aes_cbc_cmac = algorithm.Branch("1"); + + /** AES encryption (CBC) and authentication (CMAC) with 128 bit + * OID: 0.4.0.127.0.7.1.x.y1 */ + //TODO: replace "1" with correct OID + //public static readonly DerObjectIdentifier id_aes128_CBC_CMAC = aes_cbc_cmac.Branch("1"); + + + /** AES encryption (CBC) and authentication (CMAC) with 192 bit + * OID: 0.4.0.127.0.7.1.x.y2 */ + //TODO: replace "1" with correct OID + //public static readonly DerObjectIdentifier id_aes192_CBC_CMAC = aes_cbc_cmac.Branch("1"); + + /** AES encryption (CBC) and authentication (CMAC) with 256 bit + * OID: 0.4.0.127.0.7.1.x.y3 */ + //TODO: replace "1" with correct OID + //public static readonly DerObjectIdentifier id_aes256_CBC_CMAC = aes_cbc_cmac.Branch("1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi/BsiObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi/BsiObjectIdentifiers.cs.meta new file mode 100644 index 00000000..505ba3bf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/bsi/BsiObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c637ff969c8ac00459df1c73c136ad8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp.meta new file mode 100644 index 00000000..5419c323 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 90e6fc2668a091f4dba719add4667fee +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CAKeyUpdAnnContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CAKeyUpdAnnContent.cs new file mode 100644 index 00000000..84ee8c32 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CAKeyUpdAnnContent.cs @@ -0,0 +1,66 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class CAKeyUpdAnnContent + : Asn1Encodable + { + private readonly CmpCertificate oldWithNew; + private readonly CmpCertificate newWithOld; + private readonly CmpCertificate newWithNew; + + private CAKeyUpdAnnContent(Asn1Sequence seq) + { + oldWithNew = CmpCertificate.GetInstance(seq[0]); + newWithOld = CmpCertificate.GetInstance(seq[1]); + newWithNew = CmpCertificate.GetInstance(seq[2]); + } + + public static CAKeyUpdAnnContent GetInstance(object obj) + { + if (obj is CAKeyUpdAnnContent) + return (CAKeyUpdAnnContent)obj; + + if (obj is Asn1Sequence) + return new CAKeyUpdAnnContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual CmpCertificate OldWithNew + { + get { return oldWithNew; } + } + + public virtual CmpCertificate NewWithOld + { + get { return newWithOld; } + } + + public virtual CmpCertificate NewWithNew + { + get { return newWithNew; } + } + + /** + *

+		 * CAKeyUpdAnnContent ::= SEQUENCE {
+		 *                             oldWithNew   CmpCertificate, -- old pub signed with new priv
+		 *                             newWithOld   CmpCertificate, -- new pub signed with old priv
+		 *                             newWithNew   CmpCertificate  -- new pub signed with new priv
+		 *  }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(oldWithNew, newWithOld, newWithNew); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CAKeyUpdAnnContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CAKeyUpdAnnContent.cs.meta new file mode 100644 index 00000000..fa080768 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CAKeyUpdAnnContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 150c338559420ab47bb4a131373c25e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertConfirmContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertConfirmContent.cs new file mode 100644 index 00000000..77d8852f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertConfirmContent.cs @@ -0,0 +1,53 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class CertConfirmContent + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private CertConfirmContent(Asn1Sequence seq) + { + content = seq; + } + + public static CertConfirmContent GetInstance(object obj) + { + if (obj is CertConfirmContent) + return (CertConfirmContent)obj; + + if (obj is Asn1Sequence) + return new CertConfirmContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual CertStatus[] ToCertStatusArray() + { + CertStatus[] result = new CertStatus[content.Count]; + for (int i = 0; i != result.Length; i++) + { + result[i] = CertStatus.GetInstance(content[i]); + } + return result; + } + + /** + *
+		 * CertConfirmContent ::= SEQUENCE OF CertStatus
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertConfirmContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertConfirmContent.cs.meta new file mode 100644 index 00000000..545a300f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertConfirmContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b732b337a24c214dba59e936c4ee227 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertOrEncCert.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertOrEncCert.cs new file mode 100644 index 00000000..05bc6a33 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertOrEncCert.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class CertOrEncCert + : Asn1Encodable, IAsn1Choice + { + private readonly CmpCertificate certificate; + private readonly EncryptedValue encryptedCert; + + private CertOrEncCert(Asn1TaggedObject tagged) + { + if (tagged.TagNo == 0) + { + certificate = CmpCertificate.GetInstance(tagged.GetObject()); + } + else if (tagged.TagNo == 1) + { + encryptedCert = EncryptedValue.GetInstance(tagged.GetObject()); + } + else + { + throw new ArgumentException("unknown tag: " + tagged.TagNo, "tagged"); + } + } + + public static CertOrEncCert GetInstance(object obj) + { + if (obj is CertOrEncCert) + return (CertOrEncCert)obj; + + if (obj is Asn1TaggedObject) + return new CertOrEncCert((Asn1TaggedObject)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public CertOrEncCert(CmpCertificate certificate) + { + if (certificate == null) + throw new ArgumentNullException("certificate"); + + this.certificate = certificate; + } + + public CertOrEncCert(EncryptedValue encryptedCert) + { + if (encryptedCert == null) + throw new ArgumentNullException("encryptedCert"); + + this.encryptedCert = encryptedCert; + } + + public virtual CmpCertificate Certificate + { + get { return certificate; } + } + + public virtual EncryptedValue EncryptedCert + { + get { return encryptedCert; } + } + + /** + *
+		 * CertOrEncCert ::= CHOICE {
+		 *                      certificate     [0] CMPCertificate,
+		 *                      encryptedCert   [1] EncryptedValue
+		 *           }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + if (certificate != null) + { + return new DerTaggedObject(true, 0, certificate); + } + + return new DerTaggedObject(true, 1, encryptedCert); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertOrEncCert.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertOrEncCert.cs.meta new file mode 100644 index 00000000..457de270 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertOrEncCert.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce884c7a300e0334c910c96cd680bfef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertRepMessage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertRepMessage.cs new file mode 100644 index 00000000..eee03801 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertRepMessage.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class CertRepMessage + : Asn1Encodable + { + private readonly Asn1Sequence caPubs; + private readonly Asn1Sequence response; + + private CertRepMessage(Asn1Sequence seq) + { + int index = 0; + + if (seq.Count > 1) + { + caPubs = Asn1Sequence.GetInstance((Asn1TaggedObject)seq[index++], true); + } + + response = Asn1Sequence.GetInstance(seq[index]); + } + + public static CertRepMessage GetInstance(object obj) + { + if (obj is CertRepMessage) + return (CertRepMessage)obj; + + if (obj is Asn1Sequence) + return new CertRepMessage((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public CertRepMessage(CmpCertificate[] caPubs, CertResponse[] response) + { + if (response == null) + throw new ArgumentNullException("response"); + + if (caPubs != null) + { + this.caPubs = new DerSequence(caPubs); + } + + this.response = new DerSequence(response); + } + + public virtual CmpCertificate[] GetCAPubs() + { + if (caPubs == null) + return null; + + CmpCertificate[] results = new CmpCertificate[caPubs.Count]; + for (int i = 0; i != results.Length; ++i) + { + results[i] = CmpCertificate.GetInstance(caPubs[i]); + } + return results; + } + + public virtual CertResponse[] GetResponse() + { + CertResponse[] results = new CertResponse[response.Count]; + for (int i = 0; i != results.Length; ++i) + { + results[i] = CertResponse.GetInstance(response[i]); + } + return results; + } + + /** + *
+		 * CertRepMessage ::= SEQUENCE {
+		 *                          caPubs       [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate
+		 *                                                                             OPTIONAL,
+		 *                          response         SEQUENCE OF CertResponse
+		 * }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (caPubs != null) + { + v.Add(new DerTaggedObject(true, 1, caPubs)); + } + + v.Add(response); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertRepMessage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertRepMessage.cs.meta new file mode 100644 index 00000000..3b070b88 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertRepMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bfe88edcc13d18b449bf9f9319595135 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertResponse.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertResponse.cs new file mode 100644 index 00000000..0e7d4cdc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertResponse.cs @@ -0,0 +1,120 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class CertResponse + : Asn1Encodable + { + private readonly DerInteger certReqId; + private readonly PkiStatusInfo status; + private readonly CertifiedKeyPair certifiedKeyPair; + private readonly Asn1OctetString rspInfo; + + private CertResponse(Asn1Sequence seq) + { + certReqId = DerInteger.GetInstance(seq[0]); + status = PkiStatusInfo.GetInstance(seq[1]); + + if (seq.Count >= 3) + { + if (seq.Count == 3) + { + Asn1Encodable o = seq[2]; + if (o is Asn1OctetString) + { + rspInfo = Asn1OctetString.GetInstance(o); + } + else + { + certifiedKeyPair = CertifiedKeyPair.GetInstance(o); + } + } + else + { + certifiedKeyPair = CertifiedKeyPair.GetInstance(seq[2]); + rspInfo = Asn1OctetString.GetInstance(seq[3]); + } + } + } + + public static CertResponse GetInstance(object obj) + { + if (obj is CertResponse) + return (CertResponse)obj; + + if (obj is Asn1Sequence) + return new CertResponse((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public CertResponse( + DerInteger certReqId, + PkiStatusInfo status) + : this(certReqId, status, null, null) + { + } + + public CertResponse( + DerInteger certReqId, + PkiStatusInfo status, + CertifiedKeyPair certifiedKeyPair, + Asn1OctetString rspInfo) + { + if (certReqId == null) + throw new ArgumentNullException("certReqId"); + + if (status == null) + throw new ArgumentNullException("status"); + + this.certReqId = certReqId; + this.status = status; + this.certifiedKeyPair = certifiedKeyPair; + this.rspInfo = rspInfo; + } + + public virtual DerInteger CertReqID + { + get { return certReqId; } + } + + public virtual PkiStatusInfo Status + { + get { return status; } + } + + public virtual CertifiedKeyPair CertifiedKeyPair + { + get { return certifiedKeyPair; } + } + + /** + *
+		 * CertResponse ::= SEQUENCE {
+		 *                            certReqId           INTEGER,
+		 *                            -- to match this response with corresponding request (a value
+		 *                            -- of -1 is to be used if certReqId is not specified in the
+		 *                            -- corresponding request)
+		 *                            status              PKIStatusInfo,
+		 *                            certifiedKeyPair    CertifiedKeyPair    OPTIONAL,
+		 *                            rspInfo             OCTET STRING        OPTIONAL
+		 *                            -- analogous to the id-regInfo-utf8Pairs string defined
+		 *                            -- for regInfo in CertReqMsg [CRMF]
+		 *             }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certReqId, status); + v.AddOptional(certifiedKeyPair, rspInfo); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertResponse.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertResponse.cs.meta new file mode 100644 index 00000000..76cf2605 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertResponse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 35d34c1b3a2dfb14a82957b9abb1a115 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertStatus.cs new file mode 100644 index 00000000..8b647118 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertStatus.cs @@ -0,0 +1,89 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class CertStatus + : Asn1Encodable + { + private readonly Asn1OctetString certHash; + private readonly DerInteger certReqId; + private readonly PkiStatusInfo statusInfo; + + private CertStatus(Asn1Sequence seq) + { + certHash = Asn1OctetString.GetInstance(seq[0]); + certReqId = DerInteger.GetInstance(seq[1]); + + if (seq.Count > 2) + { + statusInfo = PkiStatusInfo.GetInstance(seq[2]); + } + } + + public CertStatus(byte[] certHash, BigInteger certReqId) + { + this.certHash = new DerOctetString(certHash); + this.certReqId = new DerInteger(certReqId); + } + + public CertStatus(byte[] certHash, BigInteger certReqId, PkiStatusInfo statusInfo) + { + this.certHash = new DerOctetString(certHash); + this.certReqId = new DerInteger(certReqId); + this.statusInfo = statusInfo; + } + + public static CertStatus GetInstance(object obj) + { + if (obj is CertStatus) + return (CertStatus)obj; + + if (obj is Asn1Sequence) + return new CertStatus((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual Asn1OctetString CertHash + { + get { return certHash; } + } + + public virtual DerInteger CertReqID + { + get { return certReqId; } + } + + public virtual PkiStatusInfo StatusInfo + { + get { return statusInfo; } + } + + /** + *
+		 * CertStatus ::= SEQUENCE {
+		 *                   certHash    OCTET STRING,
+		 *                   -- the hash of the certificate, using the same hash algorithm
+		 *                   -- as is used to create and verify the certificate signature
+		 *                   certReqId   INTEGER,
+		 *                   -- to match this confirmation with the corresponding req/rep
+		 *                   statusInfo  PKIStatusInfo OPTIONAL
+		 * }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certHash, certReqId); + v.AddOptional(statusInfo); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertStatus.cs.meta new file mode 100644 index 00000000..271c60e3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93801c7195f300e47aefca0ff93ee8f4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertifiedKeyPair.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertifiedKeyPair.cs new file mode 100644 index 00000000..38b38e03 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertifiedKeyPair.cs @@ -0,0 +1,119 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class CertifiedKeyPair + : Asn1Encodable + { + private readonly CertOrEncCert certOrEncCert; + private readonly EncryptedValue privateKey; + private readonly PkiPublicationInfo publicationInfo; + + private CertifiedKeyPair(Asn1Sequence seq) + { + certOrEncCert = CertOrEncCert.GetInstance(seq[0]); + + if (seq.Count >= 2) + { + if (seq.Count == 2) + { + Asn1TaggedObject tagged = Asn1TaggedObject.GetInstance(seq[1]); + if (tagged.TagNo == 0) + { + privateKey = EncryptedValue.GetInstance(tagged.GetObject()); + } + else + { + publicationInfo = PkiPublicationInfo.GetInstance(tagged.GetObject()); + } + } + else + { + privateKey = EncryptedValue.GetInstance(Asn1TaggedObject.GetInstance(seq[1])); + publicationInfo = PkiPublicationInfo.GetInstance(Asn1TaggedObject.GetInstance(seq[2])); + } + } + } + + public static CertifiedKeyPair GetInstance(object obj) + { + if (obj is CertifiedKeyPair) + return (CertifiedKeyPair)obj; + + if (obj is Asn1Sequence) + return new CertifiedKeyPair((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public CertifiedKeyPair( + CertOrEncCert certOrEncCert) + : this(certOrEncCert, null, null) + { + } + + public CertifiedKeyPair( + CertOrEncCert certOrEncCert, + EncryptedValue privateKey, + PkiPublicationInfo publicationInfo + ) + { + if (certOrEncCert == null) + throw new ArgumentNullException("certOrEncCert"); + + this.certOrEncCert = certOrEncCert; + this.privateKey = privateKey; + this.publicationInfo = publicationInfo; + } + + public virtual CertOrEncCert CertOrEncCert + { + get { return certOrEncCert; } + } + + public virtual EncryptedValue PrivateKey + { + get { return privateKey; } + } + + public virtual PkiPublicationInfo PublicationInfo + { + get { return publicationInfo; } + } + + /** + *
+		 * CertifiedKeyPair ::= SEQUENCE {
+		 *                                  certOrEncCert       CertOrEncCert,
+		 *                                  privateKey      [0] EncryptedValue      OPTIONAL,
+		 *                                  -- see [CRMF] for comment on encoding
+		 *                                  publicationInfo [1] PKIPublicationInfo  OPTIONAL
+		 *       }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certOrEncCert); + + if (privateKey != null) + { + v.Add(new DerTaggedObject(true, 0, privateKey)); + } + + if (publicationInfo != null) + { + v.Add(new DerTaggedObject(true, 1, publicationInfo)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertifiedKeyPair.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertifiedKeyPair.cs.meta new file mode 100644 index 00000000..10edf2d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CertifiedKeyPair.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f1ce79d23a53ca47979c3dd7e561fbc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/Challenge.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/Challenge.cs new file mode 100644 index 00000000..4527e374 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/Challenge.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class Challenge + : Asn1Encodable + { + private readonly AlgorithmIdentifier owf; + private readonly Asn1OctetString witness; + private readonly Asn1OctetString challenge; + + private Challenge(Asn1Sequence seq) + { + int index = 0; + + if (seq.Count == 3) + { + owf = AlgorithmIdentifier.GetInstance(seq[index++]); + } + + witness = Asn1OctetString.GetInstance(seq[index++]); + challenge = Asn1OctetString.GetInstance(seq[index]); + } + + public static Challenge GetInstance(object obj) + { + if (obj is Challenge) + return (Challenge)obj; + + if (obj is Asn1Sequence) + return new Challenge((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual AlgorithmIdentifier Owf + { + get { return owf; } + } + + /** + *
+		 * Challenge ::= SEQUENCE {
+		 *                 owf                 AlgorithmIdentifier  OPTIONAL,
+		 *
+		 *                 -- MUST be present in the first Challenge; MAY be omitted in
+		 *                 -- any subsequent Challenge in POPODecKeyChallContent (if
+		 *                 -- omitted, then the owf used in the immediately preceding
+		 *                 -- Challenge is to be used).
+		 *
+		 *                 witness             OCTET STRING,
+		 *                 -- the result of applying the one-way function (owf) to a
+		 *                 -- randomly-generated INTEGER, A.  [Note that a different
+		 *                 -- INTEGER MUST be used for each Challenge.]
+		 *                 challenge           OCTET STRING
+		 *                 -- the encryption (under the public key for which the cert.
+		 *                 -- request is being made) of Rand, where Rand is specified as
+		 *                 --   Rand ::= SEQUENCE {
+		 *                 --      int      INTEGER,
+		 *                 --       - the randomly-generated INTEGER A (above)
+		 *                 --      sender   GeneralName
+		 *                 --       - the sender's name (as included in PKIHeader)
+		 *                 --   }
+		 *      }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + v.AddOptional(owf); + v.Add(witness); + v.Add(challenge); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/Challenge.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/Challenge.cs.meta new file mode 100644 index 00000000..2d13e282 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/Challenge.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab7eeb71d93e81e498a0911105158b6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpCertificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpCertificate.cs new file mode 100644 index 00000000..e45dd315 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpCertificate.cs @@ -0,0 +1,85 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class CmpCertificate + : Asn1Encodable, IAsn1Choice + { + private readonly X509CertificateStructure x509v3PKCert; + private readonly AttributeCertificate x509v2AttrCert; + + /** + * Note: the addition of attribute certificates is a BC extension. + */ + public CmpCertificate(AttributeCertificate x509v2AttrCert) + { + this.x509v2AttrCert = x509v2AttrCert; + } + + public CmpCertificate(X509CertificateStructure x509v3PKCert) + { + if (x509v3PKCert.Version != 3) + throw new ArgumentException("only version 3 certificates allowed", "x509v3PKCert"); + + this.x509v3PKCert = x509v3PKCert; + } + + public static CmpCertificate GetInstance(object obj) + { + if (obj is CmpCertificate) + return (CmpCertificate)obj; + + if (obj is Asn1Sequence) + return new CmpCertificate(X509CertificateStructure.GetInstance(obj)); + + if (obj is Asn1TaggedObject) + return new CmpCertificate(AttributeCertificate.GetInstance(((Asn1TaggedObject)obj).GetObject())); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual bool IsX509v3PKCert + { + get { return x509v3PKCert != null; } + } + + public virtual X509CertificateStructure X509v3PKCert + { + get { return x509v3PKCert; } + } + + public virtual AttributeCertificate X509v2AttrCert + { + get { return x509v2AttrCert; } + } + + /** + *
+         * CMPCertificate ::= CHOICE {
+         *            x509v3PKCert        Certificate
+         *            x509v2AttrCert      [1] AttributeCertificate
+         *  }
+         * 
+ * Note: the addition of attribute certificates is a BC extension. + * + * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + if (x509v2AttrCert != null) + { + // explicit following CMP conventions + return new DerTaggedObject(true, 1, x509v2AttrCert); + } + + return x509v3PKCert.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpCertificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpCertificate.cs.meta new file mode 100644 index 00000000..c738f165 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpCertificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 887d3ec3a21a312428d4cbe2e4e539ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpObjectIdentifiers.cs new file mode 100644 index 00000000..e7ff6948 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpObjectIdentifiers.cs @@ -0,0 +1,110 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public abstract class CmpObjectIdentifiers + { + // RFC 4210 + + // id-PasswordBasedMac OBJECT IDENTIFIER ::= {1 2 840 113533 7 66 13} + public static readonly DerObjectIdentifier passwordBasedMac = new DerObjectIdentifier("1.2.840.113533.7.66.13"); + + // id-DHBasedMac OBJECT IDENTIFIER ::= {1 2 840 113533 7 66 30} + public static readonly DerObjectIdentifier dhBasedMac = new DerObjectIdentifier("1.2.840.113533.7.66.30"); + + // Example InfoTypeAndValue contents include, but are not limited + // to, the following (un-comment in this ASN.1 module and use as + // appropriate for a given environment): + // + // id-it-caProtEncCert OBJECT IDENTIFIER ::= {id-it 1} + // CAProtEncCertValue ::= CMPCertificate + // id-it-signKeyPairTypes OBJECT IDENTIFIER ::= {id-it 2} + // SignKeyPairTypesValue ::= SEQUENCE OF AlgorithmIdentifier + // id-it-encKeyPairTypes OBJECT IDENTIFIER ::= {id-it 3} + // EncKeyPairTypesValue ::= SEQUENCE OF AlgorithmIdentifier + // id-it-preferredSymmAlg OBJECT IDENTIFIER ::= {id-it 4} + // PreferredSymmAlgValue ::= AlgorithmIdentifier + // id-it-caKeyUpdateInfo OBJECT IDENTIFIER ::= {id-it 5} + // CAKeyUpdateInfoValue ::= CAKeyUpdAnnContent + // id-it-currentCRL OBJECT IDENTIFIER ::= {id-it 6} + // CurrentCRLValue ::= CertificateList + // id-it-unsupportedOIDs OBJECT IDENTIFIER ::= {id-it 7} + // UnsupportedOIDsValue ::= SEQUENCE OF OBJECT IDENTIFIER + // id-it-keyPairParamReq OBJECT IDENTIFIER ::= {id-it 10} + // KeyPairParamReqValue ::= OBJECT IDENTIFIER + // id-it-keyPairParamRep OBJECT IDENTIFIER ::= {id-it 11} + // KeyPairParamRepValue ::= AlgorithmIdentifer + // id-it-revPassphrase OBJECT IDENTIFIER ::= {id-it 12} + // RevPassphraseValue ::= EncryptedValue + // id-it-implicitConfirm OBJECT IDENTIFIER ::= {id-it 13} + // ImplicitConfirmValue ::= NULL + // id-it-confirmWaitTime OBJECT IDENTIFIER ::= {id-it 14} + // ConfirmWaitTimeValue ::= GeneralizedTime + // id-it-origPKIMessage OBJECT IDENTIFIER ::= {id-it 15} + // OrigPKIMessageValue ::= PKIMessages + // id-it-suppLangTags OBJECT IDENTIFIER ::= {id-it 16} + // SuppLangTagsValue ::= SEQUENCE OF UTF8String + // + // where + // + // id-pkix OBJECT IDENTIFIER ::= { + // iso(1) identified-organization(3) + // dod(6) internet(1) security(5) mechanisms(5) pkix(7)} + // and + // id-it OBJECT IDENTIFIER ::= {id-pkix 4} + public static readonly DerObjectIdentifier it_caProtEncCert = new DerObjectIdentifier("1.3.6.1.5.5.7.4.1"); + public static readonly DerObjectIdentifier it_signKeyPairTypes = new DerObjectIdentifier("1.3.6.1.5.5.7.4.2"); + public static readonly DerObjectIdentifier it_encKeyPairTypes = new DerObjectIdentifier("1.3.6.1.5.5.7.4.3"); + public static readonly DerObjectIdentifier it_preferredSymAlg = new DerObjectIdentifier("1.3.6.1.5.5.7.4.4"); + public static readonly DerObjectIdentifier it_caKeyUpdateInfo = new DerObjectIdentifier("1.3.6.1.5.5.7.4.5"); + public static readonly DerObjectIdentifier it_currentCRL = new DerObjectIdentifier("1.3.6.1.5.5.7.4.6"); + public static readonly DerObjectIdentifier it_unsupportedOIDs = new DerObjectIdentifier("1.3.6.1.5.5.7.4.7"); + public static readonly DerObjectIdentifier it_keyPairParamReq = new DerObjectIdentifier("1.3.6.1.5.5.7.4.10"); + public static readonly DerObjectIdentifier it_keyPairParamRep = new DerObjectIdentifier("1.3.6.1.5.5.7.4.11"); + public static readonly DerObjectIdentifier it_revPassphrase = new DerObjectIdentifier("1.3.6.1.5.5.7.4.12"); + public static readonly DerObjectIdentifier it_implicitConfirm = new DerObjectIdentifier("1.3.6.1.5.5.7.4.13"); + public static readonly DerObjectIdentifier it_confirmWaitTime = new DerObjectIdentifier("1.3.6.1.5.5.7.4.14"); + public static readonly DerObjectIdentifier it_origPKIMessage = new DerObjectIdentifier("1.3.6.1.5.5.7.4.15"); + public static readonly DerObjectIdentifier it_suppLangTags = new DerObjectIdentifier("1.3.6.1.5.5.7.4.16"); + + // RFC 4211 + + // id-pkix OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) + // dod(6) internet(1) security(5) mechanisms(5) pkix(7) } + // + // arc for Internet X.509 PKI protocols and their components + // id-pkip OBJECT IDENTIFIER :: { id-pkix pkip(5) } + // + // arc for Registration Controls in CRMF + // id-regCtrl OBJECT IDENTIFIER ::= { id-pkip regCtrl(1) } + // + // arc for Registration Info in CRMF + // id-regInfo OBJECT IDENTIFIER ::= { id-pkip id-regInfo(2) } + + public static readonly DerObjectIdentifier regCtrl_regToken = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.1"); + public static readonly DerObjectIdentifier regCtrl_authenticator = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.2"); + public static readonly DerObjectIdentifier regCtrl_pkiPublicationInfo = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.3"); + public static readonly DerObjectIdentifier regCtrl_pkiArchiveOptions = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.4"); + public static readonly DerObjectIdentifier regCtrl_oldCertID = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.5"); + public static readonly DerObjectIdentifier regCtrl_protocolEncrKey = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.6"); + + // From RFC4210: + // id-regCtrl-altCertTemplate OBJECT IDENTIFIER ::= {id-regCtrl 7} + public static readonly DerObjectIdentifier regCtrl_altCertTemplate = new DerObjectIdentifier("1.3.6.1.5.5.7.5.1.7"); + + public static readonly DerObjectIdentifier regInfo_utf8Pairs = new DerObjectIdentifier("1.3.6.1.5.5.7.5.2.1"); + public static readonly DerObjectIdentifier regInfo_certReq = new DerObjectIdentifier("1.3.6.1.5.5.7.5.2.2"); + + // id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2) + // us(840) rsadsi(113549) pkcs(1) pkcs9(9) 16 } + // + // id-ct OBJECT IDENTIFIER ::= { id-smime 1 } -- content types + // + // id-ct-encKeyWithID OBJECT IDENTIFIER ::= {id-ct 21} + public static readonly DerObjectIdentifier ct_encKeyWithID = new DerObjectIdentifier("1.2.840.113549.1.9.16.1.21"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpObjectIdentifiers.cs.meta new file mode 100644 index 00000000..6065cff1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CmpObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e92835683fd3ad948ba0990d3be48a86 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CrlAnnContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CrlAnnContent.cs new file mode 100644 index 00000000..11c94fa6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CrlAnnContent.cs @@ -0,0 +1,54 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class CrlAnnContent + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private CrlAnnContent(Asn1Sequence seq) + { + content = seq; + } + + public static CrlAnnContent GetInstance(object obj) + { + if (obj is CrlAnnContent) + return (CrlAnnContent)obj; + + if (obj is Asn1Sequence) + return new CrlAnnContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual CertificateList[] ToCertificateListArray() + { + CertificateList[] result = new CertificateList[content.Count]; + for (int i = 0; i != result.Length; ++ i) + { + result[i] = CertificateList.GetInstance(content[i]); + } + return result; + } + + /** + *
+		 * CrlAnnContent ::= SEQUENCE OF CertificateList
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CrlAnnContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CrlAnnContent.cs.meta new file mode 100644 index 00000000..70877d23 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/CrlAnnContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4143a5fd08c41b41b39f20b7af3d7dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ErrorMsgContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ErrorMsgContent.cs new file mode 100644 index 00000000..aa8e0528 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ErrorMsgContent.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class ErrorMsgContent + : Asn1Encodable + { + private readonly PkiStatusInfo pkiStatusInfo; + private readonly DerInteger errorCode; + private readonly PkiFreeText errorDetails; + + private ErrorMsgContent(Asn1Sequence seq) + { + pkiStatusInfo = PkiStatusInfo.GetInstance(seq[0]); + + for (int pos = 1; pos < seq.Count; ++pos) + { + Asn1Encodable ae = seq[pos]; + if (ae is DerInteger) + { + errorCode = DerInteger.GetInstance(ae); + } + else + { + errorDetails = PkiFreeText.GetInstance(ae); + } + } + } + + public static ErrorMsgContent GetInstance(object obj) + { + if (obj is ErrorMsgContent) + return (ErrorMsgContent)obj; + + if (obj is Asn1Sequence) + return new ErrorMsgContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public ErrorMsgContent(PkiStatusInfo pkiStatusInfo) + : this(pkiStatusInfo, null, null) + { + } + + public ErrorMsgContent( + PkiStatusInfo pkiStatusInfo, + DerInteger errorCode, + PkiFreeText errorDetails) + { + if (pkiStatusInfo == null) + throw new ArgumentNullException("pkiStatusInfo"); + + this.pkiStatusInfo = pkiStatusInfo; + this.errorCode = errorCode; + this.errorDetails = errorDetails; + } + + public virtual PkiStatusInfo PkiStatusInfo + { + get { return pkiStatusInfo; } + } + + public virtual DerInteger ErrorCode + { + get { return errorCode; } + } + + public virtual PkiFreeText ErrorDetails + { + get { return errorDetails; } + } + + /** + *
+		 * ErrorMsgContent ::= SEQUENCE {
+		 *                        pKIStatusInfo          PKIStatusInfo,
+		 *                        errorCode              INTEGER           OPTIONAL,
+		 *                        -- implementation-specific error codes
+		 *                        errorDetails           PKIFreeText       OPTIONAL
+		 *                        -- implementation-specific error details
+		 * }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(pkiStatusInfo); + v.AddOptional(errorCode, errorDetails); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ErrorMsgContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ErrorMsgContent.cs.meta new file mode 100644 index 00000000..b10c0fb4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ErrorMsgContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8820469b233f5b9459b2d669b0ea6ee9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenMsgContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenMsgContent.cs new file mode 100644 index 00000000..096e7c70 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenMsgContent.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class GenMsgContent + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private GenMsgContent(Asn1Sequence seq) + { + content = seq; + } + + public static GenMsgContent GetInstance(object obj) + { + if (obj is GenMsgContent) + return (GenMsgContent)obj; + + if (obj is Asn1Sequence) + return new GenMsgContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public GenMsgContent(params InfoTypeAndValue[] itv) + { + content = new DerSequence(itv); + } + + public virtual InfoTypeAndValue[] ToInfoTypeAndValueArray() + { + InfoTypeAndValue[] result = new InfoTypeAndValue[content.Count]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = InfoTypeAndValue.GetInstance(content[i]); + } + return result; + } + + /** + *
+		 * GenMsgContent ::= SEQUENCE OF InfoTypeAndValue
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenMsgContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenMsgContent.cs.meta new file mode 100644 index 00000000..4e813b87 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenMsgContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fd6633fc472f373469b8461ba0ca9665 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenRepContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenRepContent.cs new file mode 100644 index 00000000..ff6fa19c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenRepContent.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class GenRepContent + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private GenRepContent(Asn1Sequence seq) + { + content = seq; + } + + public static GenRepContent GetInstance(object obj) + { + if (obj is GenRepContent) + return (GenRepContent)obj; + + if (obj is Asn1Sequence) + return new GenRepContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public GenRepContent(params InfoTypeAndValue[] itv) + { + content = new DerSequence(itv); + } + + public virtual InfoTypeAndValue[] ToInfoTypeAndValueArray() + { + InfoTypeAndValue[] result = new InfoTypeAndValue[content.Count]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = InfoTypeAndValue.GetInstance(content[i]); + } + return result; + } + + /** + *
+		 * GenRepContent ::= SEQUENCE OF InfoTypeAndValue
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenRepContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenRepContent.cs.meta new file mode 100644 index 00000000..5357e548 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/GenRepContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4647b364f75e5ee428ef793100be1463 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/InfoTypeAndValue.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/InfoTypeAndValue.cs new file mode 100644 index 00000000..954849e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/InfoTypeAndValue.cs @@ -0,0 +1,127 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + /** + * Example InfoTypeAndValue contents include, but are not limited + * to, the following (un-comment in this ASN.1 module and use as + * appropriate for a given environment): + *
+     *   id-it-caProtEncCert    OBJECT IDENTIFIER ::= {id-it 1}
+     *      CAProtEncCertValue      ::= CMPCertificate
+     *   id-it-signKeyPairTypes OBJECT IDENTIFIER ::= {id-it 2}
+     *     SignKeyPairTypesValue   ::= SEQUENCE OF AlgorithmIdentifier
+     *   id-it-encKeyPairTypes  OBJECT IDENTIFIER ::= {id-it 3}
+     *     EncKeyPairTypesValue    ::= SEQUENCE OF AlgorithmIdentifier
+     *   id-it-preferredSymmAlg OBJECT IDENTIFIER ::= {id-it 4}
+     *      PreferredSymmAlgValue   ::= AlgorithmIdentifier
+     *   id-it-caKeyUpdateInfo  OBJECT IDENTIFIER ::= {id-it 5}
+     *      CAKeyUpdateInfoValue    ::= CAKeyUpdAnnContent
+     *   id-it-currentCRL       OBJECT IDENTIFIER ::= {id-it 6}
+     *      CurrentCRLValue         ::= CertificateList
+     *   id-it-unsupportedOIDs  OBJECT IDENTIFIER ::= {id-it 7}
+     *      UnsupportedOIDsValue    ::= SEQUENCE OF OBJECT IDENTIFIER
+     *   id-it-keyPairParamReq  OBJECT IDENTIFIER ::= {id-it 10}
+     *      KeyPairParamReqValue    ::= OBJECT IDENTIFIER
+     *   id-it-keyPairParamRep  OBJECT IDENTIFIER ::= {id-it 11}
+     *      KeyPairParamRepValue    ::= AlgorithmIdentifer
+     *   id-it-revPassphrase    OBJECT IDENTIFIER ::= {id-it 12}
+     *      RevPassphraseValue      ::= EncryptedValue
+     *   id-it-implicitConfirm  OBJECT IDENTIFIER ::= {id-it 13}
+     *      ImplicitConfirmValue    ::= NULL
+     *   id-it-confirmWaitTime  OBJECT IDENTIFIER ::= {id-it 14}
+     *      ConfirmWaitTimeValue    ::= GeneralizedTime
+     *   id-it-origPKIMessage   OBJECT IDENTIFIER ::= {id-it 15}
+     *      OrigPKIMessageValue     ::= PKIMessages
+     *   id-it-suppLangTags     OBJECT IDENTIFIER ::= {id-it 16}
+     *      SuppLangTagsValue       ::= SEQUENCE OF UTF8String
+     *
+     * where
+     *
+     *   id-pkix OBJECT IDENTIFIER ::= {
+     *      iso(1) identified-organization(3)
+     *      dod(6) internet(1) security(5) mechanisms(5) pkix(7)}
+     * and
+     *      id-it   OBJECT IDENTIFIER ::= {id-pkix 4}
+     * 
+ */ + public class InfoTypeAndValue + : Asn1Encodable + { + private readonly DerObjectIdentifier infoType; + private readonly Asn1Encodable infoValue; + + private InfoTypeAndValue(Asn1Sequence seq) + { + infoType = DerObjectIdentifier.GetInstance(seq[0]); + + if (seq.Count > 1) + { + infoValue = (Asn1Encodable)seq[1]; + } + } + + public static InfoTypeAndValue GetInstance(object obj) + { + if (obj is InfoTypeAndValue) + return (InfoTypeAndValue)obj; + + if (obj is Asn1Sequence) + return new InfoTypeAndValue((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public InfoTypeAndValue( + DerObjectIdentifier infoType) + { + this.infoType = infoType; + this.infoValue = null; + } + + public InfoTypeAndValue( + DerObjectIdentifier infoType, + Asn1Encodable optionalValue) + { + this.infoType = infoType; + this.infoValue = optionalValue; + } + + public virtual DerObjectIdentifier InfoType + { + get { return infoType; } + } + + public virtual Asn1Encodable InfoValue + { + get { return infoValue; } + } + + /** + *
+         * InfoTypeAndValue ::= SEQUENCE {
+         *                         infoType               OBJECT IDENTIFIER,
+         *                         infoValue              ANY DEFINED BY infoType  OPTIONAL
+         * }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(infoType); + + if (infoValue != null) + { + v.Add(infoValue); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/InfoTypeAndValue.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/InfoTypeAndValue.cs.meta new file mode 100644 index 00000000..8d36ca4e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/InfoTypeAndValue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be1c69797e9f7b04c925d67140b7cf3b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/KeyRecRepContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/KeyRecRepContent.cs new file mode 100644 index 00000000..a4a9907b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/KeyRecRepContent.cs @@ -0,0 +1,121 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class KeyRecRepContent + : Asn1Encodable + { + private readonly PkiStatusInfo status; + private readonly CmpCertificate newSigCert; + private readonly Asn1Sequence caCerts; + private readonly Asn1Sequence keyPairHist; + + private KeyRecRepContent(Asn1Sequence seq) + { + status = PkiStatusInfo.GetInstance(seq[0]); + + for (int pos = 1; pos < seq.Count; ++pos) + { + Asn1TaggedObject tObj = Asn1TaggedObject.GetInstance(seq[pos]); + + switch (tObj.TagNo) + { + case 0: + newSigCert = CmpCertificate.GetInstance(tObj.GetObject()); + break; + case 1: + caCerts = Asn1Sequence.GetInstance(tObj.GetObject()); + break; + case 2: + keyPairHist = Asn1Sequence.GetInstance(tObj.GetObject()); + break; + default: + throw new ArgumentException("unknown tag number: " + tObj.TagNo, "seq"); + } + } + } + + public static KeyRecRepContent GetInstance(object obj) + { + if (obj is KeyRecRepContent) + return (KeyRecRepContent)obj; + + if (obj is Asn1Sequence) + return new KeyRecRepContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual PkiStatusInfo Status + { + get { return status; } + } + + public virtual CmpCertificate NewSigCert + { + get { return newSigCert; } + } + + public virtual CmpCertificate[] GetCACerts() + { + if (caCerts == null) + return null; + + CmpCertificate[] results = new CmpCertificate[caCerts.Count]; + for (int i = 0; i != results.Length; ++i) + { + results[i] = CmpCertificate.GetInstance(caCerts[i]); + } + return results; + } + + public virtual CertifiedKeyPair[] GetKeyPairHist() + { + if (keyPairHist == null) + return null; + + CertifiedKeyPair[] results = new CertifiedKeyPair[keyPairHist.Count]; + for (int i = 0; i != results.Length; ++i) + { + results[i] = CertifiedKeyPair.GetInstance(keyPairHist[i]); + } + return results; + } + + /** + *
+		 * KeyRecRepContent ::= SEQUENCE {
+		 *                         status                  PKIStatusInfo,
+		 *                         newSigCert          [0] CMPCertificate OPTIONAL,
+		 *                         caCerts             [1] SEQUENCE SIZE (1..MAX) OF
+		 *                                                           CMPCertificate OPTIONAL,
+		 *                         keyPairHist         [2] SEQUENCE SIZE (1..MAX) OF
+		 *                                                           CertifiedKeyPair OPTIONAL
+		 *              }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(status); + AddOptional(v, 0, newSigCert); + AddOptional(v, 1, caCerts); + AddOptional(v, 2, keyPairHist); + return new DerSequence(v); + } + + private void AddOptional(Asn1EncodableVector v, int tagNo, Asn1Encodable obj) + { + if (obj != null) + { + v.Add(new DerTaggedObject(true, tagNo, obj)); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/KeyRecRepContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/KeyRecRepContent.cs.meta new file mode 100644 index 00000000..a441d3cf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/KeyRecRepContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d74e86646a8e6a74388ee918ba063046 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/OobCertHash.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/OobCertHash.cs new file mode 100644 index 00000000..b7c81994 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/OobCertHash.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class OobCertHash + : Asn1Encodable + { + private readonly AlgorithmIdentifier hashAlg; + private readonly CertId certId; + private readonly DerBitString hashVal; + + private OobCertHash(Asn1Sequence seq) + { + int index = seq.Count - 1; + + hashVal = DerBitString.GetInstance(seq[index--]); + + for (int i = index; i >= 0; i--) + { + Asn1TaggedObject tObj = (Asn1TaggedObject)seq[i]; + + if (tObj.TagNo == 0) + { + hashAlg = AlgorithmIdentifier.GetInstance(tObj, true); + } + else + { + certId = CertId.GetInstance(tObj, true); + } + } + } + + public static OobCertHash GetInstance(object obj) + { + if (obj is OobCertHash) + return (OobCertHash)obj; + + if (obj is Asn1Sequence) + return new OobCertHash((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual AlgorithmIdentifier HashAlg + { + get { return hashAlg; } + } + + public virtual CertId CertID + { + get { return certId; } + } + + /** + *
+		 * OobCertHash ::= SEQUENCE {
+		 *                      hashAlg     [0] AlgorithmIdentifier     OPTIONAL,
+		 *                      certId      [1] CertId                  OPTIONAL,
+		 *                      hashVal         BIT STRING
+		 *                      -- hashVal is calculated over the Der encoding of the
+		 *                      -- self-signed certificate with the identifier certID.
+		 *       }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + AddOptional(v, 0, hashAlg); + AddOptional(v, 1, certId); + v.Add(hashVal); + return new DerSequence(v); + } + + private void AddOptional(Asn1EncodableVector v, int tagNo, Asn1Encodable obj) + { + if (obj != null) + { + v.Add(new DerTaggedObject(true, tagNo, obj)); + } + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/OobCertHash.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/OobCertHash.cs.meta new file mode 100644 index 00000000..775cade0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/OobCertHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36ad7355f732cc4479f37fe03095da97 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIBody.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIBody.cs new file mode 100644 index 00000000..0ed2ad90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIBody.cs @@ -0,0 +1,191 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PkiBody + : Asn1Encodable, IAsn1Choice + { + public const int TYPE_INIT_REQ = 0; + public const int TYPE_INIT_REP = 1; + public const int TYPE_CERT_REQ = 2; + public const int TYPE_CERT_REP = 3; + public const int TYPE_P10_CERT_REQ = 4; + public const int TYPE_POPO_CHALL = 5; + public const int TYPE_POPO_REP = 6; + public const int TYPE_KEY_UPDATE_REQ = 7; + public const int TYPE_KEY_UPDATE_REP = 8; + public const int TYPE_KEY_RECOVERY_REQ = 9; + public const int TYPE_KEY_RECOVERY_REP = 10; + public const int TYPE_REVOCATION_REQ = 11; + public const int TYPE_REVOCATION_REP = 12; + public const int TYPE_CROSS_CERT_REQ = 13; + public const int TYPE_CROSS_CERT_REP = 14; + public const int TYPE_CA_KEY_UPDATE_ANN = 15; + public const int TYPE_CERT_ANN = 16; + public const int TYPE_REVOCATION_ANN = 17; + public const int TYPE_CRL_ANN = 18; + public const int TYPE_CONFIRM = 19; + public const int TYPE_NESTED = 20; + public const int TYPE_GEN_MSG = 21; + public const int TYPE_GEN_REP = 22; + public const int TYPE_ERROR = 23; + public const int TYPE_CERT_CONFIRM = 24; + public const int TYPE_POLL_REQ = 25; + public const int TYPE_POLL_REP = 26; + + private int tagNo; + private Asn1Encodable body; + + public static PkiBody GetInstance(object obj) + { + if (obj is PkiBody) + return (PkiBody)obj; + + if (obj is Asn1TaggedObject) + return new PkiBody((Asn1TaggedObject)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private PkiBody(Asn1TaggedObject tagged) + { + tagNo = tagged.TagNo; + body = GetBodyForType(tagNo, tagged.GetObject()); + } + + /** + * Creates a new PkiBody. + * @param type one of the TYPE_* constants + * @param content message content + */ + public PkiBody( + int type, + Asn1Encodable content) + { + tagNo = type; + body = GetBodyForType(type, content); + } + + private static Asn1Encodable GetBodyForType( + int type, + Asn1Encodable o) + { + switch (type) + { + case TYPE_INIT_REQ: + return CertReqMessages.GetInstance(o); + case TYPE_INIT_REP: + return CertRepMessage.GetInstance(o); + case TYPE_CERT_REQ: + return CertReqMessages.GetInstance(o); + case TYPE_CERT_REP: + return CertRepMessage.GetInstance(o); + case TYPE_P10_CERT_REQ: + return CertificationRequest.GetInstance(o); + case TYPE_POPO_CHALL: + return PopoDecKeyChallContent.GetInstance(o); + case TYPE_POPO_REP: + return PopoDecKeyRespContent.GetInstance(o); + case TYPE_KEY_UPDATE_REQ: + return CertReqMessages.GetInstance(o); + case TYPE_KEY_UPDATE_REP: + return CertRepMessage.GetInstance(o); + case TYPE_KEY_RECOVERY_REQ: + return CertReqMessages.GetInstance(o); + case TYPE_KEY_RECOVERY_REP: + return KeyRecRepContent.GetInstance(o); + case TYPE_REVOCATION_REQ: + return RevReqContent.GetInstance(o); + case TYPE_REVOCATION_REP: + return RevRepContent.GetInstance(o); + case TYPE_CROSS_CERT_REQ: + return CertReqMessages.GetInstance(o); + case TYPE_CROSS_CERT_REP: + return CertRepMessage.GetInstance(o); + case TYPE_CA_KEY_UPDATE_ANN: + return CAKeyUpdAnnContent.GetInstance(o); + case TYPE_CERT_ANN: + return CmpCertificate.GetInstance(o); + case TYPE_REVOCATION_ANN: + return RevAnnContent.GetInstance(o); + case TYPE_CRL_ANN: + return CrlAnnContent.GetInstance(o); + case TYPE_CONFIRM: + return PkiConfirmContent.GetInstance(o); + case TYPE_NESTED: + return PkiMessages.GetInstance(o); + case TYPE_GEN_MSG: + return GenMsgContent.GetInstance(o); + case TYPE_GEN_REP: + return GenRepContent.GetInstance(o); + case TYPE_ERROR: + return ErrorMsgContent.GetInstance(o); + case TYPE_CERT_CONFIRM: + return CertConfirmContent.GetInstance(o); + case TYPE_POLL_REQ: + return PollReqContent.GetInstance(o); + case TYPE_POLL_REP: + return PollRepContent.GetInstance(o); + default: + throw new ArgumentException("unknown tag number: " + type, "type"); + } + } + + public virtual int Type + { + get { return tagNo; } + } + + public virtual Asn1Encodable Content + { + get { return body; } + } + + /** + *
+         * PkiBody ::= CHOICE {       -- message-specific body elements
+         *        ir       [0]  CertReqMessages,        --Initialization Request
+         *        ip       [1]  CertRepMessage,         --Initialization Response
+         *        cr       [2]  CertReqMessages,        --Certification Request
+         *        cp       [3]  CertRepMessage,         --Certification Response
+         *        p10cr    [4]  CertificationRequest,   --imported from [PKCS10]
+         *        popdecc  [5]  POPODecKeyChallContent, --pop Challenge
+         *        popdecr  [6]  POPODecKeyRespContent,  --pop Response
+         *        kur      [7]  CertReqMessages,        --Key Update Request
+         *        kup      [8]  CertRepMessage,         --Key Update Response
+         *        krr      [9]  CertReqMessages,        --Key Recovery Request
+         *        krp      [10] KeyRecRepContent,       --Key Recovery Response
+         *        rr       [11] RevReqContent,          --Revocation Request
+         *        rp       [12] RevRepContent,          --Revocation Response
+         *        ccr      [13] CertReqMessages,        --Cross-Cert. Request
+         *        ccp      [14] CertRepMessage,         --Cross-Cert. Response
+         *        ckuann   [15] CAKeyUpdAnnContent,     --CA Key Update Ann.
+         *        cann     [16] CertAnnContent,         --Certificate Ann.
+         *        rann     [17] RevAnnContent,          --Revocation Ann.
+         *        crlann   [18] CRLAnnContent,          --CRL Announcement
+         *        pkiconf  [19] PKIConfirmContent,      --Confirmation
+         *        nested   [20] NestedMessageContent,   --Nested Message
+         *        genm     [21] GenMsgContent,          --General Message
+         *        genp     [22] GenRepContent,          --General Response
+         *        error    [23] ErrorMsgContent,        --Error Message
+         *        certConf [24] CertConfirmContent,     --Certificate confirm
+         *        pollReq  [25] PollReqContent,         --Polling request
+         *        pollRep  [26] PollRepContent          --Polling response
+         * }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return new DerTaggedObject(true, tagNo, body); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIBody.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIBody.cs.meta new file mode 100644 index 00000000..c278d4db --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIBody.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba31bdf64d25dc34080447e485c9a522 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIConfirmContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIConfirmContent.cs new file mode 100644 index 00000000..c7995194 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIConfirmContent.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PkiConfirmContent + : Asn1Encodable + { + public static PkiConfirmContent GetInstance(object obj) + { + if (obj is PkiConfirmContent) + return (PkiConfirmContent)obj; + + if (obj is Asn1Null) + return new PkiConfirmContent(); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public PkiConfirmContent() + { + } + + /** + *
+		 * PkiConfirmContent ::= NULL
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return DerNull.Instance; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIConfirmContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIConfirmContent.cs.meta new file mode 100644 index 00000000..622c0e9b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIConfirmContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1898f6e49b274c84f9988d21199155f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFailureInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFailureInfo.cs new file mode 100644 index 00000000..f55d119c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFailureInfo.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + /** + *
+     * PKIFailureInfo ::= BIT STRING {
+     * badAlg               (0),
+     *   -- unrecognized or unsupported Algorithm Identifier
+     * badMessageCheck      (1), -- integrity check failed (e.g., signature did not verify)
+     * badRequest           (2),
+     *   -- transaction not permitted or supported
+     * badTime              (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
+     * badCertId            (4), -- no certificate could be found matching the provided criteria
+     * badDataFormat        (5),
+     *   -- the data submitted has the wrong format
+     * wrongAuthority       (6), -- the authority indicated in the request is different from the one creating the response token
+     * incorrectData        (7), -- the requester's data is incorrect (for notary services)
+     * missingTimeStamp     (8), -- when the timestamp is missing but should be there (by policy)
+     * badPOP               (9)  -- the proof-of-possession failed
+     * certRevoked         (10),
+     * certConfirmed       (11),
+     * wrongIntegrity      (12),
+     * badRecipientNonce   (13), 
+     * timeNotAvailable    (14),
+     *   -- the TSA's time source is not available
+     * unacceptedPolicy    (15),
+     *   -- the requested TSA policy is not supported by the TSA
+     * unacceptedExtension (16),
+     *   -- the requested extension is not supported by the TSA
+     * addInfoNotAvailable (17)
+     *   -- the additional information requested could not be understood
+     *   -- or is not available
+     * badSenderNonce      (18),
+     * badCertTemplate     (19),
+     * signerNotTrusted    (20),
+     * transactionIdInUse  (21),
+     * unsupportedVersion  (22),
+     * notAuthorized       (23),
+     * systemUnavail       (24),    
+     * systemFailure       (25),
+     *   -- the request cannot be handled due to system failure
+     * duplicateCertReq    (26) 
+     * 
+ */ + public class PkiFailureInfo + : DerBitString + { + public const int BadAlg = (1 << 7); // unrecognized or unsupported Algorithm Identifier + public const int BadMessageCheck = (1 << 6); // integrity check failed (e.g., signature did not verify) + public const int BadRequest = (1 << 5); + public const int BadTime = (1 << 4); // -- messageTime was not sufficiently close to the system time, as defined by local policy + public const int BadCertId = (1 << 3); // no certificate could be found matching the provided criteria + public const int BadDataFormat = (1 << 2); + public const int WrongAuthority = (1 << 1); // the authority indicated in the request is different from the one creating the response token + public const int IncorrectData = 1; // the requester's data is incorrect (for notary services) + public const int MissingTimeStamp = (1 << 15); // when the timestamp is missing but should be there (by policy) + public const int BadPop = (1 << 14); // the proof-of-possession failed + public const int CertRevoked = (1 << 13); + public const int CertConfirmed = (1 << 12); + public const int WrongIntegrity = (1 << 11); + public const int BadRecipientNonce = (1 << 10); + public const int TimeNotAvailable = (1 << 9); // the TSA's time source is not available + public const int UnacceptedPolicy = (1 << 8); // the requested TSA policy is not supported by the TSA + public const int UnacceptedExtension = (1 << 23); //the requested extension is not supported by the TSA + public const int AddInfoNotAvailable = (1 << 22); //the additional information requested could not be understood or is not available + public const int BadSenderNonce = (1 << 21); + public const int BadCertTemplate = (1 << 20); + public const int SignerNotTrusted = (1 << 19); + public const int TransactionIdInUse = (1 << 18); + public const int UnsupportedVersion = (1 << 17); + public const int NotAuthorized = (1 << 16); + public const int SystemUnavail = (1 << 31); + public const int SystemFailure = (1 << 30); //the request cannot be handled due to system failure + public const int DuplicateCertReq = (1 << 29); + + /** + * Basic constructor. + */ + public PkiFailureInfo(int info) + : base(info) + { + } + + public PkiFailureInfo( + DerBitString info) + : base(info.GetBytes(), info.PadBits) + { + } + + public override string ToString() + { + return "PkiFailureInfo: 0x" + this.IntValue.ToString("X"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFailureInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFailureInfo.cs.meta new file mode 100644 index 00000000..b8192f30 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFailureInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a919d31f3c580104786c2734f49858f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFreeText.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFreeText.cs new file mode 100644 index 00000000..af74d46c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFreeText.cs @@ -0,0 +1,103 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PkiFreeText + : Asn1Encodable + { + internal Asn1Sequence strings; + + public static PkiFreeText GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + public static PkiFreeText GetInstance( + object obj) + { + if (obj is PkiFreeText) + { + return (PkiFreeText)obj; + } + else if (obj is Asn1Sequence) + { + return new PkiFreeText((Asn1Sequence)obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public PkiFreeText( + Asn1Sequence seq) + { + foreach (object o in seq) + { + if (!(o is DerUtf8String)) + { + throw new ArgumentException("attempt to insert non UTF8 STRING into PkiFreeText"); + } + } + + this.strings = seq; + } + + public PkiFreeText( + DerUtf8String p) + { + strings = new DerSequence(p); + } + + /** + * Return the number of string elements present. + * + * @return number of elements present. + */ + [Obsolete("Use 'Count' property instead")] + public int Size + { + get { return strings.Count; } + } + + public int Count + { + get { return strings.Count; } + } + + /** + * Return the UTF8STRING at index. + * + * @param index index of the string of interest + * @return the string at index. + */ + public DerUtf8String this[int index] + { + get { return (DerUtf8String) strings[index]; } + } + + [Obsolete("Use 'object[index]' syntax instead")] + public DerUtf8String GetStringAt( + int index) + { + return this[index]; + } + + /** + *
+		 * PkiFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + return strings; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFreeText.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFreeText.cs.meta new file mode 100644 index 00000000..92ffdcb7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIFreeText.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1c30b06d0ba2a3f44b862ceb31b712a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeader.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeader.cs new file mode 100644 index 00000000..6089f87b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeader.cs @@ -0,0 +1,242 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PkiHeader + : Asn1Encodable + { + /** + * Value for a "null" recipient or sender. + */ + public static readonly GeneralName NULL_NAME = new GeneralName(X509Name.GetInstance(new DerSequence())); + + public static readonly int CMP_1999 = 1; + public static readonly int CMP_2000 = 2; + + private readonly DerInteger pvno; + private readonly GeneralName sender; + private readonly GeneralName recipient; + private readonly DerGeneralizedTime messageTime; + private readonly AlgorithmIdentifier protectionAlg; + private readonly Asn1OctetString senderKID; // KeyIdentifier + private readonly Asn1OctetString recipKID; // KeyIdentifier + private readonly Asn1OctetString transactionID; + private readonly Asn1OctetString senderNonce; + private readonly Asn1OctetString recipNonce; + private readonly PkiFreeText freeText; + private readonly Asn1Sequence generalInfo; + + private PkiHeader(Asn1Sequence seq) + { + pvno = DerInteger.GetInstance(seq[0]); + sender = GeneralName.GetInstance(seq[1]); + recipient = GeneralName.GetInstance(seq[2]); + + for (int pos = 3; pos < seq.Count; ++pos) + { + Asn1TaggedObject tObj = (Asn1TaggedObject)seq[pos]; + + switch (tObj.TagNo) + { + case 0: + messageTime = DerGeneralizedTime.GetInstance(tObj, true); + break; + case 1: + protectionAlg = AlgorithmIdentifier.GetInstance(tObj, true); + break; + case 2: + senderKID = Asn1OctetString.GetInstance(tObj, true); + break; + case 3: + recipKID = Asn1OctetString.GetInstance(tObj, true); + break; + case 4: + transactionID = Asn1OctetString.GetInstance(tObj, true); + break; + case 5: + senderNonce = Asn1OctetString.GetInstance(tObj, true); + break; + case 6: + recipNonce = Asn1OctetString.GetInstance(tObj, true); + break; + case 7: + freeText = PkiFreeText.GetInstance(tObj, true); + break; + case 8: + generalInfo = Asn1Sequence.GetInstance(tObj, true); + break; + default: + throw new ArgumentException("unknown tag number: " + tObj.TagNo, "seq"); + } + } + } + + public static PkiHeader GetInstance(object obj) + { + if (obj is PkiHeader) + return (PkiHeader)obj; + + if (obj is Asn1Sequence) + return new PkiHeader((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public PkiHeader( + int pvno, + GeneralName sender, + GeneralName recipient) + : this(new DerInteger(pvno), sender, recipient) + { + } + + private PkiHeader( + DerInteger pvno, + GeneralName sender, + GeneralName recipient) + { + this.pvno = pvno; + this.sender = sender; + this.recipient = recipient; + } + + public virtual DerInteger Pvno + { + get { return pvno; } + } + + public virtual GeneralName Sender + { + get { return sender; } + } + + public virtual GeneralName Recipient + { + get { return recipient; } + } + + public virtual DerGeneralizedTime MessageTime + { + get { return messageTime; } + } + + public virtual AlgorithmIdentifier ProtectionAlg + { + get { return protectionAlg; } + } + + public virtual Asn1OctetString SenderKID + { + get { return senderKID; } + } + + public virtual Asn1OctetString RecipKID + { + get { return recipKID; } + } + + public virtual Asn1OctetString TransactionID + { + get { return transactionID; } + } + + public virtual Asn1OctetString SenderNonce + { + get { return senderNonce; } + } + + public virtual Asn1OctetString RecipNonce + { + get { return recipNonce; } + } + + public virtual PkiFreeText FreeText + { + get { return freeText; } + } + + public virtual InfoTypeAndValue[] GetGeneralInfo() + { + if (generalInfo == null) + { + return null; + } + InfoTypeAndValue[] results = new InfoTypeAndValue[generalInfo.Count]; + for (int i = 0; i < results.Length; i++) + { + results[i] = InfoTypeAndValue.GetInstance(generalInfo[i]); + } + return results; + } + + /** + *
+         *  PkiHeader ::= SEQUENCE {
+         *            pvno                INTEGER     { cmp1999(1), cmp2000(2) },
+         *            sender              GeneralName,
+         *            -- identifies the sender
+         *            recipient           GeneralName,
+         *            -- identifies the intended recipient
+         *            messageTime     [0] GeneralizedTime         OPTIONAL,
+         *            -- time of production of this message (used when sender
+         *            -- believes that the transport will be "suitable"; i.e.,
+         *            -- that the time will still be meaningful upon receipt)
+         *            protectionAlg   [1] AlgorithmIdentifier     OPTIONAL,
+         *            -- algorithm used for calculation of protection bits
+         *            senderKID       [2] KeyIdentifier           OPTIONAL,
+         *            recipKID        [3] KeyIdentifier           OPTIONAL,
+         *            -- to identify specific keys used for protection
+         *            transactionID   [4] OCTET STRING            OPTIONAL,
+         *            -- identifies the transaction; i.e., this will be the same in
+         *            -- corresponding request, response, certConf, and PKIConf
+         *            -- messages
+         *            senderNonce     [5] OCTET STRING            OPTIONAL,
+         *            recipNonce      [6] OCTET STRING            OPTIONAL,
+         *            -- nonces used to provide replay protection, senderNonce
+         *            -- is inserted by the creator of this message; recipNonce
+         *            -- is a nonce previously inserted in a related message by
+         *            -- the intended recipient of this message
+         *            freeText        [7] PKIFreeText             OPTIONAL,
+         *            -- this may be used to indicate context-specific instructions
+         *            -- (this field is intended for human consumption)
+         *            generalInfo     [8] SEQUENCE SIZE (1..MAX) OF
+         *                                 InfoTypeAndValue     OPTIONAL
+         *            -- this may be used to convey context-specific information
+         *            -- (this field not primarily intended for human consumption)
+         * }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(pvno, sender, recipient); + + AddOptional(v, 0, messageTime); + AddOptional(v, 1, protectionAlg); + AddOptional(v, 2, senderKID); + AddOptional(v, 3, recipKID); + AddOptional(v, 4, transactionID); + AddOptional(v, 5, senderNonce); + AddOptional(v, 6, recipNonce); + AddOptional(v, 7, freeText); + AddOptional(v, 8, generalInfo); + + return new DerSequence(v); + } + + private static void AddOptional(Asn1EncodableVector v, int tagNo, Asn1Encodable obj) + { + if (obj != null) + { + v.Add(new DerTaggedObject(true, tagNo, obj)); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeader.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeader.cs.meta new file mode 100644 index 00000000..c2d09da1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aee8ded125544ab41b0c6c5ce69a48ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeaderBuilder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeaderBuilder.cs new file mode 100644 index 00000000..17fb11d8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeaderBuilder.cs @@ -0,0 +1,227 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PkiHeaderBuilder + { + private DerInteger pvno; + private GeneralName sender; + private GeneralName recipient; + private DerGeneralizedTime messageTime; + private AlgorithmIdentifier protectionAlg; + private Asn1OctetString senderKID; // KeyIdentifier + private Asn1OctetString recipKID; // KeyIdentifier + private Asn1OctetString transactionID; + private Asn1OctetString senderNonce; + private Asn1OctetString recipNonce; + private PkiFreeText freeText; + private Asn1Sequence generalInfo; + + public PkiHeaderBuilder( + int pvno, + GeneralName sender, + GeneralName recipient) + : this(new DerInteger(pvno), sender, recipient) + { + } + + private PkiHeaderBuilder( + DerInteger pvno, + GeneralName sender, + GeneralName recipient) + { + this.pvno = pvno; + this.sender = sender; + this.recipient = recipient; + } + + public virtual PkiHeaderBuilder SetMessageTime(DerGeneralizedTime time) + { + messageTime = time; + return this; + } + + public virtual PkiHeaderBuilder SetProtectionAlg(AlgorithmIdentifier aid) + { + protectionAlg = aid; + return this; + } + + public virtual PkiHeaderBuilder SetSenderKID(byte[] kid) + { + return SetSenderKID(kid == null ? null : new DerOctetString(kid)); + } + + public virtual PkiHeaderBuilder SetSenderKID(Asn1OctetString kid) + { + senderKID = kid; + return this; + } + + public virtual PkiHeaderBuilder SetRecipKID(byte[] kid) + { + return SetRecipKID(kid == null ? null : new DerOctetString(kid)); + } + + public virtual PkiHeaderBuilder SetRecipKID(DerOctetString kid) + { + recipKID = kid; + return this; + } + + public virtual PkiHeaderBuilder SetTransactionID(byte[] tid) + { + return SetTransactionID(tid == null ? null : new DerOctetString(tid)); + } + + public virtual PkiHeaderBuilder SetTransactionID(Asn1OctetString tid) + { + transactionID = tid; + return this; + } + + public virtual PkiHeaderBuilder SetSenderNonce(byte[] nonce) + { + return SetSenderNonce(nonce == null ? null : new DerOctetString(nonce)); + } + + public virtual PkiHeaderBuilder SetSenderNonce(Asn1OctetString nonce) + { + senderNonce = nonce; + return this; + } + + public virtual PkiHeaderBuilder SetRecipNonce(byte[] nonce) + { + return SetRecipNonce(nonce == null ? null : new DerOctetString(nonce)); + } + + public virtual PkiHeaderBuilder SetRecipNonce(Asn1OctetString nonce) + { + recipNonce = nonce; + return this; + } + + public virtual PkiHeaderBuilder SetFreeText(PkiFreeText text) + { + freeText = text; + return this; + } + + public virtual PkiHeaderBuilder SetGeneralInfo(InfoTypeAndValue genInfo) + { + return SetGeneralInfo(MakeGeneralInfoSeq(genInfo)); + } + + public virtual PkiHeaderBuilder SetGeneralInfo(InfoTypeAndValue[] genInfos) + { + return SetGeneralInfo(MakeGeneralInfoSeq(genInfos)); + } + + public virtual PkiHeaderBuilder SetGeneralInfo(Asn1Sequence seqOfInfoTypeAndValue) + { + generalInfo = seqOfInfoTypeAndValue; + return this; + } + + private static Asn1Sequence MakeGeneralInfoSeq( + InfoTypeAndValue generalInfo) + { + return new DerSequence(generalInfo); + } + + private static Asn1Sequence MakeGeneralInfoSeq( + InfoTypeAndValue[] generalInfos) + { + Asn1Sequence genInfoSeq = null; + if (generalInfos != null) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + for (int i = 0; i < generalInfos.Length; ++i) + { + v.Add(generalInfos[i]); + } + genInfoSeq = new DerSequence(v); + } + return genInfoSeq; + } + + /** + *
+		 *  PKIHeader ::= SEQUENCE {
+		 *            pvno                INTEGER     { cmp1999(1), cmp2000(2) },
+		 *            sender              GeneralName,
+		 *            -- identifies the sender
+		 *            recipient           GeneralName,
+		 *            -- identifies the intended recipient
+		 *            messageTime     [0] GeneralizedTime         OPTIONAL,
+		 *            -- time of production of this message (used when sender
+		 *            -- believes that the transport will be "suitable"; i.e.,
+		 *            -- that the time will still be meaningful upon receipt)
+		 *            protectionAlg   [1] AlgorithmIdentifier     OPTIONAL,
+		 *            -- algorithm used for calculation of protection bits
+		 *            senderKID       [2] KeyIdentifier           OPTIONAL,
+		 *            recipKID        [3] KeyIdentifier           OPTIONAL,
+		 *            -- to identify specific keys used for protection
+		 *            transactionID   [4] OCTET STRING            OPTIONAL,
+		 *            -- identifies the transaction; i.e., this will be the same in
+		 *            -- corresponding request, response, certConf, and PKIConf
+		 *            -- messages
+		 *            senderNonce     [5] OCTET STRING            OPTIONAL,
+		 *            recipNonce      [6] OCTET STRING            OPTIONAL,
+		 *            -- nonces used to provide replay protection, senderNonce
+		 *            -- is inserted by the creator of this message; recipNonce
+		 *            -- is a nonce previously inserted in a related message by
+		 *            -- the intended recipient of this message
+		 *            freeText        [7] PKIFreeText             OPTIONAL,
+		 *            -- this may be used to indicate context-specific instructions
+		 *            -- (this field is intended for human consumption)
+		 *            generalInfo     [8] SEQUENCE SIZE (1..MAX) OF
+		 *                                 InfoTypeAndValue     OPTIONAL
+		 *            -- this may be used to convey context-specific information
+		 *            -- (this field not primarily intended for human consumption)
+		 * }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public virtual PkiHeader Build() + { + Asn1EncodableVector v = new Asn1EncodableVector(pvno, sender, recipient); + AddOptional(v, 0, messageTime); + AddOptional(v, 1, protectionAlg); + AddOptional(v, 2, senderKID); + AddOptional(v, 3, recipKID); + AddOptional(v, 4, transactionID); + AddOptional(v, 5, senderNonce); + AddOptional(v, 6, recipNonce); + AddOptional(v, 7, freeText); + AddOptional(v, 8, generalInfo); + + messageTime = null; + protectionAlg = null; + senderKID = null; + recipKID = null; + transactionID = null; + senderNonce = null; + recipNonce = null; + freeText = null; + generalInfo = null; + + return PkiHeader.GetInstance(new DerSequence(v)); + } + + private void AddOptional(Asn1EncodableVector v, int tagNo, Asn1Encodable obj) + { + if (obj != null) + { + v.Add(new DerTaggedObject(true, tagNo, obj)); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeaderBuilder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeaderBuilder.cs.meta new file mode 100644 index 00000000..21f73599 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIHeaderBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 24d442ff1814b144a88cfabe826fb351 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessage.cs new file mode 100644 index 00000000..192a9a83 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessage.cs @@ -0,0 +1,144 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PkiMessage + : Asn1Encodable + { + private readonly PkiHeader header; + private readonly PkiBody body; + private readonly DerBitString protection; + private readonly Asn1Sequence extraCerts; + + private PkiMessage(Asn1Sequence seq) + { + header = PkiHeader.GetInstance(seq[0]); + body = PkiBody.GetInstance(seq[1]); + + for (int pos = 2; pos < seq.Count; ++pos) + { + Asn1TaggedObject tObj = (Asn1TaggedObject)seq[pos].ToAsn1Object(); + + if (tObj.TagNo == 0) + { + protection = DerBitString.GetInstance(tObj, true); + } + else + { + extraCerts = Asn1Sequence.GetInstance(tObj, true); + } + } + } + + public static PkiMessage GetInstance(object obj) + { + if (obj is PkiMessage) + return (PkiMessage)obj; + + if (obj != null) + return new PkiMessage(Asn1Sequence.GetInstance(obj)); + + return null; + } + + /** + * Creates a new PkiMessage. + * + * @param header message header + * @param body message body + * @param protection message protection (may be null) + * @param extraCerts extra certificates (may be null) + */ + public PkiMessage( + PkiHeader header, + PkiBody body, + DerBitString protection, + CmpCertificate[] extraCerts) + { + this.header = header; + this.body = body; + this.protection = protection; + if (extraCerts != null) + { + this.extraCerts = new DerSequence(extraCerts); + } + } + + public PkiMessage( + PkiHeader header, + PkiBody body, + DerBitString protection) + : this(header, body, protection, null) + { + } + + public PkiMessage( + PkiHeader header, + PkiBody body) + : this(header, body, null, null) + { + } + + public virtual PkiHeader Header + { + get { return header; } + } + + public virtual PkiBody Body + { + get { return body; } + } + + public virtual DerBitString Protection + { + get { return protection; } + } + + public virtual CmpCertificate[] GetExtraCerts() + { + if (extraCerts == null) + return null; + + CmpCertificate[] results = new CmpCertificate[extraCerts.Count]; + for (int i = 0; i < results.Length; ++i) + { + results[i] = CmpCertificate.GetInstance(extraCerts[i]); + } + return results; + } + + /** + *
+         * PkiMessage ::= SEQUENCE {
+         *                  header           PKIHeader,
+         *                  body             PKIBody,
+         *                  protection   [0] PKIProtection OPTIONAL,
+         *                  extraCerts   [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate
+         *                                                                     OPTIONAL
+         * }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(header, body); + + AddOptional(v, 0, protection); + AddOptional(v, 1, extraCerts); + + return new DerSequence(v); + } + + private static void AddOptional(Asn1EncodableVector v, int tagNo, Asn1Encodable obj) + { + if (obj != null) + { + v.Add(new DerTaggedObject(true, tagNo, obj)); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessage.cs.meta new file mode 100644 index 00000000..4430e84f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0563d398536b954a8c98b851fe52849 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessages.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessages.cs new file mode 100644 index 00000000..0eee398d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessages.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PkiMessages + : Asn1Encodable + { + private Asn1Sequence content; + + private PkiMessages(Asn1Sequence seq) + { + content = seq; + } + + public static PkiMessages GetInstance(object obj) + { + if (obj is PkiMessages) + return (PkiMessages)obj; + + if (obj is Asn1Sequence) + return new PkiMessages((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public PkiMessages(params PkiMessage[] msgs) + { + content = new DerSequence(msgs); + } + + public virtual PkiMessage[] ToPkiMessageArray() + { + PkiMessage[] result = new PkiMessage[content.Count]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = PkiMessage.GetInstance(content[i]); + } + return result; + } + + /** + *
+         * PkiMessages ::= SEQUENCE SIZE (1..MAX) OF PkiMessage
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessages.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessages.cs.meta new file mode 100644 index 00000000..d32d4ebf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIMessages.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0526fbe8e7df8f45acfa32f3ea07a4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatus.cs new file mode 100644 index 00000000..da591a6d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatus.cs @@ -0,0 +1,67 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public enum PkiStatus + { + Granted = 0, + GrantedWithMods = 1, + Rejection = 2, + Waiting = 3, + RevocationWarning = 4, + RevocationNotification = 5, + KeyUpdateWarning = 6, + } + + public class PkiStatusEncodable + : Asn1Encodable + { + public static readonly PkiStatusEncodable granted = new PkiStatusEncodable(PkiStatus.Granted); + public static readonly PkiStatusEncodable grantedWithMods = new PkiStatusEncodable(PkiStatus.GrantedWithMods); + public static readonly PkiStatusEncodable rejection = new PkiStatusEncodable(PkiStatus.Rejection); + public static readonly PkiStatusEncodable waiting = new PkiStatusEncodable(PkiStatus.Waiting); + public static readonly PkiStatusEncodable revocationWarning = new PkiStatusEncodable(PkiStatus.RevocationWarning); + public static readonly PkiStatusEncodable revocationNotification = new PkiStatusEncodable(PkiStatus.RevocationNotification); + public static readonly PkiStatusEncodable keyUpdateWaiting = new PkiStatusEncodable(PkiStatus.KeyUpdateWarning); + + private readonly DerInteger status; + + private PkiStatusEncodable(PkiStatus status) + : this(new DerInteger((int)status)) + { + } + + private PkiStatusEncodable(DerInteger status) + { + this.status = status; + } + + public static PkiStatusEncodable GetInstance(object obj) + { + if (obj is PkiStatusEncodable) + return (PkiStatusEncodable)obj; + + if (obj is DerInteger) + return new PkiStatusEncodable((DerInteger)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual BigInteger Value + { + get { return status.Value; } + } + + public override Asn1Object ToAsn1Object() + { + return status; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatus.cs.meta new file mode 100644 index 00000000..99283ec3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfa7d1eebf7c88b4ca93f109f145db83 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatusInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatusInfo.cs new file mode 100644 index 00000000..fb458171 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatusInfo.cs @@ -0,0 +1,170 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PkiStatusInfo + : Asn1Encodable + { + DerInteger status; + PkiFreeText statusString; + DerBitString failInfo; + + public static PkiStatusInfo GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + public static PkiStatusInfo GetInstance( + object obj) + { + if (obj is PkiStatusInfo) + { + return (PkiStatusInfo)obj; + } + else if (obj is Asn1Sequence) + { + return new PkiStatusInfo((Asn1Sequence)obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public PkiStatusInfo( + Asn1Sequence seq) + { + this.status = DerInteger.GetInstance(seq[0]); + + this.statusString = null; + this.failInfo = null; + + if (seq.Count > 2) + { + this.statusString = PkiFreeText.GetInstance(seq[1]); + this.failInfo = DerBitString.GetInstance(seq[2]); + } + else if (seq.Count > 1) + { + object obj = seq[1]; + if (obj is DerBitString) + { + this.failInfo = DerBitString.GetInstance(obj); + } + else + { + this.statusString = PkiFreeText.GetInstance(obj); + } + } + } + + /** + * @param status + */ + public PkiStatusInfo(int status) + { + this.status = new DerInteger(status); + } + + /** + * @param status + * @param statusString + */ + public PkiStatusInfo( + int status, + PkiFreeText statusString) + { + this.status = new DerInteger(status); + this.statusString = statusString; + } + + public PkiStatusInfo( + int status, + PkiFreeText statusString, + PkiFailureInfo failInfo) + { + this.status = new DerInteger(status); + this.statusString = statusString; + this.failInfo = failInfo; + } + + public BigInteger Status + { + get + { + return status.Value; + } + } + + public PkiFreeText StatusString + { + get + { + return statusString; + } + } + + public DerBitString FailInfo + { + get + { + return failInfo; + } + } + + /** + *
+		 * PkiStatusInfo ::= SEQUENCE {
+		 *     status        PKIStatus,                (INTEGER)
+		 *     statusString  PkiFreeText     OPTIONAL,
+		 *     failInfo      PkiFailureInfo  OPTIONAL  (BIT STRING)
+		 * }
+		 *
+		 * PKIStatus:
+		 *   granted                (0), -- you got exactly what you asked for
+		 *   grantedWithMods        (1), -- you got something like what you asked for
+		 *   rejection              (2), -- you don't get it, more information elsewhere in the message
+		 *   waiting                (3), -- the request body part has not yet been processed, expect to hear more later
+		 *   revocationWarning      (4), -- this message contains a warning that a revocation is imminent
+		 *   revocationNotification (5), -- notification that a revocation has occurred
+		 *   keyUpdateWarning       (6)  -- update already done for the oldCertId specified in CertReqMsg
+		 *
+		 * PkiFailureInfo:
+		 *   badAlg           (0), -- unrecognized or unsupported Algorithm Identifier
+		 *   badMessageCheck  (1), -- integrity check failed (e.g., signature did not verify)
+		 *   badRequest       (2), -- transaction not permitted or supported
+		 *   badTime          (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
+		 *   badCertId        (4), -- no certificate could be found matching the provided criteria
+		 *   badDataFormat    (5), -- the data submitted has the wrong format
+		 *   wrongAuthority   (6), -- the authority indicated in the request is different from the one creating the response token
+		 *   incorrectData    (7), -- the requester's data is incorrect (for notary services)
+		 *   missingTimeStamp (8), -- when the timestamp is missing but should be there (by policy)
+		 *   badPOP           (9)  -- the proof-of-possession failed
+		 *
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(status); + + if (statusString != null) + { + v.Add(statusString); + } + + if (failInfo!= null) + { + v.Add(failInfo); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatusInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatusInfo.cs.meta new file mode 100644 index 00000000..68dc1702 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PKIStatusInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b858b39e6697ba349b591ba47cdb9a47 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PbmParameter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PbmParameter.cs new file mode 100644 index 00000000..b2427349 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PbmParameter.cs @@ -0,0 +1,105 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PbmParameter + : Asn1Encodable + { + private Asn1OctetString salt; + private AlgorithmIdentifier owf; + private DerInteger iterationCount; + private AlgorithmIdentifier mac; + + private PbmParameter(Asn1Sequence seq) + { + salt = Asn1OctetString.GetInstance(seq[0]); + owf = AlgorithmIdentifier.GetInstance(seq[1]); + iterationCount = DerInteger.GetInstance(seq[2]); + mac = AlgorithmIdentifier.GetInstance(seq[3]); + } + + public static PbmParameter GetInstance(object obj) + { + if (obj is PbmParameter) + return (PbmParameter)obj; + + if (obj is Asn1Sequence) + return new PbmParameter((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public PbmParameter( + byte[] salt, + AlgorithmIdentifier owf, + int iterationCount, + AlgorithmIdentifier mac) + : this(new DerOctetString(salt), owf, new DerInteger(iterationCount), mac) + { + } + + public PbmParameter( + Asn1OctetString salt, + AlgorithmIdentifier owf, + DerInteger iterationCount, + AlgorithmIdentifier mac) + { + this.salt = salt; + this.owf = owf; + this.iterationCount = iterationCount; + this.mac = mac; + } + + public virtual Asn1OctetString Salt + { + get { return salt; } + } + + public virtual AlgorithmIdentifier Owf + { + get { return owf; } + } + + public virtual DerInteger IterationCount + { + get { return iterationCount; } + } + + public virtual AlgorithmIdentifier Mac + { + get { return mac; } + } + + /** + *
+         *  PbmParameter ::= SEQUENCE {
+         *                        salt                OCTET STRING,
+         *                        -- note:  implementations MAY wish to limit acceptable sizes
+         *                        -- of this string to values appropriate for their environment
+         *                        -- in order to reduce the risk of denial-of-service attacks
+         *                        owf                 AlgorithmIdentifier,
+         *                        -- AlgId for a One-Way Function (SHA-1 recommended)
+         *                        iterationCount      INTEGER,
+         *                        -- number of times the OWF is applied
+         *                        -- note:  implementations MAY wish to limit acceptable sizes
+         *                        -- of this integer to values appropriate for their environment
+         *                        -- in order to reduce the risk of denial-of-service attacks
+         *                        mac                 AlgorithmIdentifier
+         *                        -- the MAC AlgId (e.g., DES-MAC, Triple-DES-MAC [PKCS11],
+         *    }   -- or HMAC [RFC2104, RFC2202])
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(salt, owf, iterationCount, mac); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PbmParameter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PbmParameter.cs.meta new file mode 100644 index 00000000..3d1c50e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PbmParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd320e494de41774bad9ed84a8fbc952 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollRepContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollRepContent.cs new file mode 100644 index 00000000..c383c978 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollRepContent.cs @@ -0,0 +1,91 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PollRepContent + : Asn1Encodable + { + private readonly DerInteger certReqId; + private readonly DerInteger checkAfter; + private readonly PkiFreeText reason; + + private PollRepContent(Asn1Sequence seq) + { + certReqId = DerInteger.GetInstance(seq[0]); + checkAfter = DerInteger.GetInstance(seq[1]); + + if (seq.Count > 2) + { + reason = PkiFreeText.GetInstance(seq[2]); + } + } + + public static PollRepContent GetInstance(object obj) + { + if (obj is PollRepContent) + return (PollRepContent)obj; + + if (obj is Asn1Sequence) + return new PollRepContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public PollRepContent( + DerInteger certReqId, + DerInteger checkAfter) + { + this.certReqId = certReqId; + this.checkAfter = checkAfter; + this.reason = null; + } + + public PollRepContent( + DerInteger certReqId, + DerInteger checkAfter, + PkiFreeText reason) + { + this.certReqId = certReqId; + this.checkAfter = checkAfter; + this.reason = reason; + } + + public virtual DerInteger CertReqID + { + get { return certReqId; } + } + + public virtual DerInteger CheckAfter + { + get { return checkAfter; } + } + + public virtual PkiFreeText Reason + { + get { return reason; } + } + + /** + *
+		 * PollRepContent ::= SEQUENCE OF SEQUENCE {
+		 *         certReqId              INTEGER,
+		 *         checkAfter             INTEGER,  -- time in seconds
+		 *         reason                 PKIFreeText OPTIONAL
+		 *     }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certReqId, checkAfter); + v.AddOptional(reason); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollRepContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollRepContent.cs.meta new file mode 100644 index 00000000..e17d9626 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollRepContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d2f8b9fe8bebdb41ab51cccec867e82 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollReqContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollReqContent.cs new file mode 100644 index 00000000..0ac731b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollReqContent.cs @@ -0,0 +1,65 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PollReqContent + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private PollReqContent(Asn1Sequence seq) + { + content = seq; + } + + public static PollReqContent GetInstance(object obj) + { + if (obj is PollReqContent) + return (PollReqContent)obj; + + if (obj is Asn1Sequence) + return new PollReqContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual DerInteger[][] GetCertReqIDs() + { + DerInteger[][] result = new DerInteger[content.Count][]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = SequenceToDerIntegerArray((Asn1Sequence)content[i]); + } + return result; + } + + private static DerInteger[] SequenceToDerIntegerArray(Asn1Sequence seq) + { + DerInteger[] result = new DerInteger[seq.Count]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = DerInteger.GetInstance(seq[i]); + } + return result; + } + + /** + *
+		 * PollReqContent ::= SEQUENCE OF SEQUENCE {
+		 *                        certReqId              INTEGER
+		 * }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollReqContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollReqContent.cs.meta new file mode 100644 index 00000000..7c94ee9b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PollReqContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1bca1f54c3479f642b90261dbcf7259d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyChallContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyChallContent.cs new file mode 100644 index 00000000..c04381a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyChallContent.cs @@ -0,0 +1,53 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PopoDecKeyChallContent + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private PopoDecKeyChallContent(Asn1Sequence seq) + { + content = seq; + } + + public static PopoDecKeyChallContent GetInstance(object obj) + { + if (obj is PopoDecKeyChallContent) + return (PopoDecKeyChallContent)obj; + + if (obj is Asn1Sequence) + return new PopoDecKeyChallContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual Challenge[] ToChallengeArray() + { + Challenge[] result = new Challenge[content.Count]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = Challenge.GetInstance(content[i]); + } + return result; + } + + /** + *
+	     * PopoDecKeyChallContent ::= SEQUENCE OF Challenge
+	     * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyChallContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyChallContent.cs.meta new file mode 100644 index 00000000..7105fc8d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyChallContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98d81e1a79824f146878c4c6c52c7746 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyRespContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyRespContent.cs new file mode 100644 index 00000000..bf59de14 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyRespContent.cs @@ -0,0 +1,53 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class PopoDecKeyRespContent + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private PopoDecKeyRespContent(Asn1Sequence seq) + { + content = seq; + } + + public static PopoDecKeyRespContent GetInstance(object obj) + { + if (obj is PopoDecKeyRespContent) + return (PopoDecKeyRespContent)obj; + + if (obj is Asn1Sequence) + return new PopoDecKeyRespContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual DerInteger[] ToDerIntegerArray() + { + DerInteger[] result = new DerInteger[content.Count]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = DerInteger.GetInstance(content[i]); + } + return result; + } + + /** + *
+		 * PopoDecKeyRespContent ::= SEQUENCE OF INTEGER
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyRespContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyRespContent.cs.meta new file mode 100644 index 00000000..1634c7da --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/PopoDecKeyRespContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56dff331657c84e4cad67a130c78763a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ProtectedPart.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ProtectedPart.cs new file mode 100644 index 00000000..a7f4fdb9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ProtectedPart.cs @@ -0,0 +1,64 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class ProtectedPart + : Asn1Encodable + { + private readonly PkiHeader header; + private readonly PkiBody body; + + private ProtectedPart(Asn1Sequence seq) + { + header = PkiHeader.GetInstance(seq[0]); + body = PkiBody.GetInstance(seq[1]); + } + + public static ProtectedPart GetInstance(object obj) + { + if (obj is ProtectedPart) + return (ProtectedPart)obj; + + if (obj is Asn1Sequence) + return new ProtectedPart((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public ProtectedPart(PkiHeader header, PkiBody body) + { + this.header = header; + this.body = body; + } + + public virtual PkiHeader Header + { + get { return header; } + } + + public virtual PkiBody Body + { + get { return body; } + } + + /** + *
+		 * ProtectedPart ::= SEQUENCE {
+		 *                    header    PKIHeader,
+		 *                    body      PKIBody
+		 * }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(header, body); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ProtectedPart.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ProtectedPart.cs.meta new file mode 100644 index 00000000..2ac9526d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/ProtectedPart.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b10f4ec27b6bbd8419746853cb16ce26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevAnnContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevAnnContent.cs new file mode 100644 index 00000000..0a02b559 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevAnnContent.cs @@ -0,0 +1,91 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class RevAnnContent + : Asn1Encodable + { + private readonly PkiStatusEncodable status; + private readonly CertId certId; + private readonly DerGeneralizedTime willBeRevokedAt; + private readonly DerGeneralizedTime badSinceDate; + private readonly X509Extensions crlDetails; + + private RevAnnContent(Asn1Sequence seq) + { + status = PkiStatusEncodable.GetInstance(seq[0]); + certId = CertId.GetInstance(seq[1]); + willBeRevokedAt = DerGeneralizedTime.GetInstance(seq[2]); + badSinceDate = DerGeneralizedTime.GetInstance(seq[3]); + + if (seq.Count > 4) + { + crlDetails = X509Extensions.GetInstance(seq[4]); + } + } + + public static RevAnnContent GetInstance(object obj) + { + if (obj is RevAnnContent) + return (RevAnnContent)obj; + + if (obj is Asn1Sequence) + return new RevAnnContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual PkiStatusEncodable Status + { + get { return status; } + } + + public virtual CertId CertID + { + get { return certId; } + } + + public virtual DerGeneralizedTime WillBeRevokedAt + { + get { return willBeRevokedAt; } + } + + public virtual DerGeneralizedTime BadSinceDate + { + get { return badSinceDate; } + } + + public virtual X509Extensions CrlDetails + { + get { return crlDetails; } + } + + /** + *
+		 * RevAnnContent ::= SEQUENCE {
+		 *       status              PKIStatus,
+		 *       certId              CertId,
+		 *       willBeRevokedAt     GeneralizedTime,
+		 *       badSinceDate        GeneralizedTime,
+		 *       crlDetails          Extensions  OPTIONAL
+		 *        -- extra CRL details (e.g., crl number, reason, location, etc.)
+		 * }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(status, certId, willBeRevokedAt, badSinceDate); + v.AddOptional(crlDetails); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevAnnContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevAnnContent.cs.meta new file mode 100644 index 00000000..95e2818c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevAnnContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c293847cae773d4b84a6258ea122501 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevDetails.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevDetails.cs new file mode 100644 index 00000000..bee4aa3f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevDetails.cs @@ -0,0 +1,79 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class RevDetails + : Asn1Encodable + { + private readonly CertTemplate certDetails; + private readonly X509Extensions crlEntryDetails; + + private RevDetails(Asn1Sequence seq) + { + certDetails = CertTemplate.GetInstance(seq[0]); + crlEntryDetails = seq.Count <= 1 + ? null + : X509Extensions.GetInstance(seq[1]); + } + + public static RevDetails GetInstance(object obj) + { + if (obj is RevDetails) + return (RevDetails)obj; + + if (obj is Asn1Sequence) + return new RevDetails((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public RevDetails(CertTemplate certDetails) + : this(certDetails, null) + { + } + + public RevDetails(CertTemplate certDetails, X509Extensions crlEntryDetails) + { + this.certDetails = certDetails; + this.crlEntryDetails = crlEntryDetails; + } + + public virtual CertTemplate CertDetails + { + get { return certDetails; } + } + + public virtual X509Extensions CrlEntryDetails + { + get { return crlEntryDetails; } + } + + /** + *
+		* RevDetails ::= SEQUENCE {
+		*                  certDetails         CertTemplate,
+		*                   -- allows requester to specify as much as they can about
+		*                   -- the cert. for which revocation is requested
+		*                   -- (e.g., for cases in which serialNumber is not available)
+		*                   crlEntryDetails     Extensions       OPTIONAL
+		*                   -- requested crlEntryExtensions
+		*             }
+		* 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certDetails); + v.AddOptional(crlEntryDetails); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevDetails.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevDetails.cs.meta new file mode 100644 index 00000000..733f620d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevDetails.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f46b291060b224942bd837481375c005 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContent.cs new file mode 100644 index 00000000..bfc27b28 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContent.cs @@ -0,0 +1,117 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class RevRepContent + : Asn1Encodable + { + private readonly Asn1Sequence status; + private readonly Asn1Sequence revCerts; + private readonly Asn1Sequence crls; + + private RevRepContent(Asn1Sequence seq) + { + status = Asn1Sequence.GetInstance(seq[0]); + + for (int pos = 1; pos < seq.Count; ++pos) + { + Asn1TaggedObject tObj = Asn1TaggedObject.GetInstance(seq[pos]); + + if (tObj.TagNo == 0) + { + revCerts = Asn1Sequence.GetInstance(tObj, true); + } + else + { + crls = Asn1Sequence.GetInstance(tObj, true); + } + } + } + + public static RevRepContent GetInstance(object obj) + { + if (obj is RevRepContent) + return (RevRepContent)obj; + + if (obj is Asn1Sequence) + return new RevRepContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual PkiStatusInfo[] GetStatus() + { + PkiStatusInfo[] results = new PkiStatusInfo[status.Count]; + for (int i = 0; i != results.Length; ++i) + { + results[i] = PkiStatusInfo.GetInstance(status[i]); + } + return results; + } + + public virtual CertId[] GetRevCerts() + { + if (revCerts == null) + return null; + + CertId[] results = new CertId[revCerts.Count]; + for (int i = 0; i != results.Length; ++i) + { + results[i] = CertId.GetInstance(revCerts[i]); + } + return results; + } + + public virtual CertificateList[] GetCrls() + { + if (crls == null) + return null; + + CertificateList[] results = new CertificateList[crls.Count]; + for (int i = 0; i != results.Length; ++i) + { + results[i] = CertificateList.GetInstance(crls[i]); + } + return results; + } + + /** + *
+		 * RevRepContent ::= SEQUENCE {
+		 *        status       SEQUENCE SIZE (1..MAX) OF PKIStatusInfo,
+		 *        -- in same order as was sent in RevReqContent
+		 *        revCerts [0] SEQUENCE SIZE (1..MAX) OF CertId OPTIONAL,
+		 *        -- IDs for which revocation was requested
+		 *        -- (same order as status)
+		 *        crls     [1] SEQUENCE SIZE (1..MAX) OF CertificateList OPTIONAL
+		 *        -- the resulting CRLs (there may be more than one)
+		 *   }
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(status); + AddOptional(v, 0, revCerts); + AddOptional(v, 1, crls); + return new DerSequence(v); + } + + private void AddOptional(Asn1EncodableVector v, int tagNo, Asn1Encodable obj) + { + if (obj != null) + { + v.Add(new DerTaggedObject(true, tagNo, obj)); + } + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContent.cs.meta new file mode 100644 index 00000000..76f4795c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 345761cabacdee14199048da28d3c395 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContentBuilder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContentBuilder.cs new file mode 100644 index 00000000..3d82c6f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContentBuilder.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class RevRepContentBuilder + { + private readonly Asn1EncodableVector status = new Asn1EncodableVector(); + private readonly Asn1EncodableVector revCerts = new Asn1EncodableVector(); + private readonly Asn1EncodableVector crls = new Asn1EncodableVector(); + + public virtual RevRepContentBuilder Add(PkiStatusInfo status) + { + this.status.Add(status); + return this; + } + + public virtual RevRepContentBuilder Add(PkiStatusInfo status, CertId certId) + { + if (this.status.Count != this.revCerts.Count) + throw new InvalidOperationException("status and revCerts sequence must be in common order"); + + this.status.Add(status); + this.revCerts.Add(certId); + return this; + } + + public virtual RevRepContentBuilder AddCrl(CertificateList crl) + { + this.crls.Add(crl); + return this; + } + + public virtual RevRepContent Build() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + v.Add(new DerSequence(status)); + + if (revCerts.Count != 0) + { + v.Add(new DerTaggedObject(true, 0, new DerSequence(revCerts))); + } + + if (crls.Count != 0) + { + v.Add(new DerTaggedObject(true, 1, new DerSequence(crls))); + } + + return RevRepContent.GetInstance(new DerSequence(v)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContentBuilder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContentBuilder.cs.meta new file mode 100644 index 00000000..2be8b500 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevRepContentBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0470f2df4fce4e44a4fe1b0bab3e09d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevReqContent.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevReqContent.cs new file mode 100644 index 00000000..8ac7dad7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevReqContent.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp +{ + public class RevReqContent + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private RevReqContent(Asn1Sequence seq) + { + content = seq; + } + + public static RevReqContent GetInstance(object obj) + { + if (obj is RevReqContent) + return (RevReqContent)obj; + + if (obj is Asn1Sequence) + return new RevReqContent((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public RevReqContent(params RevDetails[] revDetails) + { + this.content = new DerSequence(revDetails); + } + + public virtual RevDetails[] ToRevDetailsArray() + { + RevDetails[] result = new RevDetails[content.Count]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = RevDetails.GetInstance(content[i]); + } + return result; + } + + /** + *
+		 * RevReqContent ::= SEQUENCE OF RevDetails
+		 * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevReqContent.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevReqContent.cs.meta new file mode 100644 index 00000000..edf08dd2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cmp/RevReqContent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca8dfb330261e2f449c12dd74b53fde3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms.meta new file mode 100644 index 00000000..6b0ededd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 212c4beac220c8742966c43564131081 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attribute.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attribute.cs new file mode 100644 index 00000000..2baee6e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attribute.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class Attribute + : Asn1Encodable + { + private DerObjectIdentifier attrType; + private Asn1Set attrValues; + + /** + * return an Attribute object from the given object. + * + * @param o the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static Attribute GetInstance( + object obj) + { + if (obj == null || obj is Attribute) + return (Attribute) obj; + + if (obj is Asn1Sequence) + return new Attribute((Asn1Sequence) obj); + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public Attribute( + Asn1Sequence seq) + { + attrType = (DerObjectIdentifier)seq[0]; + attrValues = (Asn1Set)seq[1]; + } + + public Attribute( + DerObjectIdentifier attrType, + Asn1Set attrValues) + { + this.attrType = attrType; + this.attrValues = attrValues; + } + + public DerObjectIdentifier AttrType + { + get { return attrType; } + } + + public Asn1Set AttrValues + { + get { return attrValues; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+        * Attribute ::= SEQUENCE {
+        *     attrType OBJECT IDENTIFIER,
+        *     attrValues SET OF AttributeValue
+        * }
+        * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(attrType, attrValues); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attribute.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attribute.cs.meta new file mode 100644 index 00000000..1bacf0f8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 80a1a404f8f8d0b40802427c7a9a919a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AttributeTable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AttributeTable.cs new file mode 100644 index 00000000..51f11ec4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AttributeTable.cs @@ -0,0 +1,235 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class AttributeTable + { + private readonly IDictionary attributes; + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete] + public AttributeTable( + Hashtable attrs) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(attrs); + } +#endif + + public AttributeTable( + IDictionary attrs) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(attrs); + } + + public AttributeTable( + Asn1EncodableVector v) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(v.Count); + + foreach (Asn1Encodable o in v) + { + Attribute a = Attribute.GetInstance(o); + + AddAttribute(a); + } + } + + public AttributeTable( + Asn1Set s) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(s.Count); + + for (int i = 0; i != s.Count; i++) + { + Attribute a = Attribute.GetInstance(s[i]); + + AddAttribute(a); + } + } + + public AttributeTable( + Attributes attrs) + : this(Asn1Set.GetInstance(attrs.ToAsn1Object())) + { + } + + private void AddAttribute( + Attribute a) + { + DerObjectIdentifier oid = a.AttrType; + object obj = attributes[oid]; + + if (obj == null) + { + attributes[oid] = a; + } + else + { + IList v; + + if (obj is Attribute) + { + v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + v.Add(obj); + v.Add(a); + } + else + { + v = (IList) obj; + + v.Add(a); + } + + attributes[oid] = v; + } + } + + /// Return the first attribute matching the given OBJECT IDENTIFIER + public Attribute this[DerObjectIdentifier oid] + { + get + { + object obj = attributes[oid]; + + if (obj is IList) + { + return (Attribute)((IList)obj)[0]; + } + + return (Attribute) obj; + } + } + + [Obsolete("Use 'object[oid]' syntax instead")] + public Attribute Get( + DerObjectIdentifier oid) + { + return this[oid]; + } + + /** + * Return all the attributes matching the OBJECT IDENTIFIER oid. The vector will be + * empty if there are no attributes of the required type present. + * + * @param oid type of attribute required. + * @return a vector of all the attributes found of type oid. + */ + public Asn1EncodableVector GetAll( + DerObjectIdentifier oid) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + object obj = attributes[oid]; + + if (obj is IList) + { + foreach (Attribute a in (IList)obj) + { + v.Add(a); + } + } + else if (obj != null) + { + v.Add((Attribute) obj); + } + + return v; + } + + public int Count + { + get + { + int total = 0; + + foreach (object o in attributes.Values) + { + if (o is IList) + { + total += ((IList)o).Count; + } + else + { + ++total; + } + } + + return total; + } + } + + public IDictionary ToDictionary() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(attributes); + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete("Use 'ToDictionary' instead")] + public Hashtable ToHashtable() + { + return new Hashtable(attributes); + } +#endif + + public Asn1EncodableVector ToAsn1EncodableVector() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + foreach (object obj in attributes.Values) + { + if (obj is IList) + { + foreach (object el in (IList)obj) + { + v.Add(Attribute.GetInstance(el)); + } + } + else + { + v.Add(Attribute.GetInstance(obj)); + } + } + + return v; + } + + public Attributes ToAttributes() + { + return new Attributes(this.ToAsn1EncodableVector()); + } + + /** + * Return a new table with the passed in attribute added. + * + * @param attrType + * @param attrValue + * @return + */ + public AttributeTable Add(DerObjectIdentifier attrType, Asn1Encodable attrValue) + { + AttributeTable newTable = new AttributeTable(attributes); + + newTable.AddAttribute(new Attribute(attrType, new DerSet(attrValue))); + + return newTable; + } + + public AttributeTable Remove(DerObjectIdentifier attrType) + { + AttributeTable newTable = new AttributeTable(attributes); + + newTable.attributes.Remove(attrType); + + return newTable; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AttributeTable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AttributeTable.cs.meta new file mode 100644 index 00000000..079fe316 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AttributeTable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 912ed9d9330ddd94f9e159d5fc9eff79 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attributes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attributes.cs new file mode 100644 index 00000000..10941f12 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attributes.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class Attributes + : Asn1Encodable + { + private readonly Asn1Set attributes; + + private Attributes(Asn1Set attributes) + { + this.attributes = attributes; + } + + public Attributes(Asn1EncodableVector v) + { + attributes = new BerSet(v); + } + + public static Attributes GetInstance(object obj) + { + if (obj is Attributes) + return (Attributes)obj; + + if (obj != null) + return new Attributes(Asn1Set.GetInstance(obj)); + + return null; + } + + public virtual Attribute[] GetAttributes() + { + Attribute[] rv = new Attribute[attributes.Count]; + + for (int i = 0; i != rv.Length; i++) + { + rv[i] = Attribute.GetInstance(attributes[i]); + } + + return rv; + } + + /** + *
+         * Attributes ::=
+         *   SET SIZE(1..MAX) OF Attribute -- according to RFC 5652
+         * 
+ * @return + */ + public override Asn1Object ToAsn1Object() + { + return attributes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attributes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attributes.cs.meta new file mode 100644 index 00000000..bb988be8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Attributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0312113ad395aa44798f44ad1425c4e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedData.cs new file mode 100644 index 00000000..8fdb4bce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedData.cs @@ -0,0 +1,209 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class AuthEnvelopedData + : Asn1Encodable + { + private DerInteger version; + private OriginatorInfo originatorInfo; + private Asn1Set recipientInfos; + private EncryptedContentInfo authEncryptedContentInfo; + private Asn1Set authAttrs; + private Asn1OctetString mac; + private Asn1Set unauthAttrs; + + public AuthEnvelopedData( + OriginatorInfo originatorInfo, + Asn1Set recipientInfos, + EncryptedContentInfo authEncryptedContentInfo, + Asn1Set authAttrs, + Asn1OctetString mac, + Asn1Set unauthAttrs) + { + // "It MUST be set to 0." + this.version = new DerInteger(0); + + this.originatorInfo = originatorInfo; + + // TODO + // "There MUST be at least one element in the collection." + this.recipientInfos = recipientInfos; + + this.authEncryptedContentInfo = authEncryptedContentInfo; + + // TODO + // "The authAttrs MUST be present if the content type carried in + // EncryptedContentInfo is not id-data." + this.authAttrs = authAttrs; + + this.mac = mac; + + this.unauthAttrs = unauthAttrs; + } + + private AuthEnvelopedData( + Asn1Sequence seq) + { + int index = 0; + + // TODO + // "It MUST be set to 0." + Asn1Object tmp = seq[index++].ToAsn1Object(); + version = (DerInteger)tmp; + + tmp = seq[index++].ToAsn1Object(); + if (tmp is Asn1TaggedObject) + { + originatorInfo = OriginatorInfo.GetInstance((Asn1TaggedObject)tmp, false); + tmp = seq[index++].ToAsn1Object(); + } + + // TODO + // "There MUST be at least one element in the collection." + recipientInfos = Asn1Set.GetInstance(tmp); + + tmp = seq[index++].ToAsn1Object(); + authEncryptedContentInfo = EncryptedContentInfo.GetInstance(tmp); + + tmp = seq[index++].ToAsn1Object(); + if (tmp is Asn1TaggedObject) + { + authAttrs = Asn1Set.GetInstance((Asn1TaggedObject)tmp, false); + tmp = seq[index++].ToAsn1Object(); + } + else + { + // TODO + // "The authAttrs MUST be present if the content type carried in + // EncryptedContentInfo is not id-data." + } + + mac = Asn1OctetString.GetInstance(tmp); + + if (seq.Count > index) + { + tmp = seq[index++].ToAsn1Object(); + unauthAttrs = Asn1Set.GetInstance((Asn1TaggedObject)tmp, false); + } + } + + /** + * return an AuthEnvelopedData object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param isExplicit true if the object is meant to be explicitly + * tagged false otherwise. + * @throws ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static AuthEnvelopedData GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * return an AuthEnvelopedData object from the given object. + * + * @param obj the object we want converted. + * @throws ArgumentException if the object cannot be converted. + */ + public static AuthEnvelopedData GetInstance( + object obj) + { + if (obj == null || obj is AuthEnvelopedData) + return (AuthEnvelopedData)obj; + + if (obj is Asn1Sequence) + return new AuthEnvelopedData((Asn1Sequence)obj); + + throw new ArgumentException("Invalid AuthEnvelopedData: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public DerInteger Version + { + get { return version; } + } + + public OriginatorInfo OriginatorInfo + { + get { return originatorInfo; } + } + + public Asn1Set RecipientInfos + { + get { return recipientInfos; } + } + + public EncryptedContentInfo AuthEncryptedContentInfo + { + get { return authEncryptedContentInfo; } + } + + public Asn1Set AuthAttrs + { + get { return authAttrs; } + } + + public Asn1OctetString Mac + { + get { return mac; } + } + + public Asn1Set UnauthAttrs + { + get { return unauthAttrs; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+		 * AuthEnvelopedData ::= SEQUENCE {
+		 *   version CMSVersion,
+		 *   originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+		 *   recipientInfos RecipientInfos,
+		 *   authEncryptedContentInfo EncryptedContentInfo,
+		 *   authAttrs [1] IMPLICIT AuthAttributes OPTIONAL,
+		 *   mac MessageAuthenticationCode,
+		 *   unauthAttrs [2] IMPLICIT UnauthAttributes OPTIONAL }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(version); + + if (originatorInfo != null) + { + v.Add(new DerTaggedObject(false, 0, originatorInfo)); + } + + v.Add(recipientInfos, authEncryptedContentInfo); + + // "authAttrs optionally contains the authenticated attributes." + if (authAttrs != null) + { + // "AuthAttributes MUST be DER encoded, even if the rest of the + // AuthEnvelopedData structure is BER encoded." + v.Add(new DerTaggedObject(false, 1, authAttrs)); + } + + v.Add(mac); + + // "unauthAttrs optionally contains the unauthenticated attributes." + if (unauthAttrs != null) + { + v.Add(new DerTaggedObject(false, 2, unauthAttrs)); + } + + return new BerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedData.cs.meta new file mode 100644 index 00000000..20f63cb8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c8a15712ba58fe4abdcf4a3af30a4ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedDataParser.cs new file mode 100644 index 00000000..565b8634 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedDataParser.cs @@ -0,0 +1,149 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + /** + * Produce an object suitable for an Asn1OutputStream. + * + *
+	 * AuthEnvelopedData ::= SEQUENCE {
+	 *   version CMSVersion,
+	 *   originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+	 *   recipientInfos RecipientInfos,
+	 *   authEncryptedContentInfo EncryptedContentInfo,
+	 *   authAttrs [1] IMPLICIT AuthAttributes OPTIONAL,
+	 *   mac MessageAuthenticationCode,
+	 *   unauthAttrs [2] IMPLICIT UnauthAttributes OPTIONAL }
+	 * 
+ */ + public class AuthEnvelopedDataParser + { + private Asn1SequenceParser seq; + private DerInteger version; + private IAsn1Convertible nextObject; + private bool originatorInfoCalled; + + public AuthEnvelopedDataParser( + Asn1SequenceParser seq) + { + this.seq = seq; + + // TODO + // "It MUST be set to 0." + this.version = (DerInteger)seq.ReadObject(); + } + + public DerInteger Version + { + get { return version; } + } + + public OriginatorInfo GetOriginatorInfo() + { + originatorInfoCalled = true; + + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject is Asn1TaggedObjectParser && ((Asn1TaggedObjectParser)nextObject).TagNo == 0) + { + Asn1SequenceParser originatorInfo = (Asn1SequenceParser) ((Asn1TaggedObjectParser)nextObject).GetObjectParser(Asn1Tags.Sequence, false); + nextObject = null; + return OriginatorInfo.GetInstance(originatorInfo.ToAsn1Object()); + } + + return null; + } + + public Asn1SetParser GetRecipientInfos() + { + if (!originatorInfoCalled) + { + GetOriginatorInfo(); + } + + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + Asn1SetParser recipientInfos = (Asn1SetParser)nextObject; + nextObject = null; + return recipientInfos; + } + + public EncryptedContentInfoParser GetAuthEncryptedContentInfo() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject != null) + { + Asn1SequenceParser o = (Asn1SequenceParser) nextObject; + nextObject = null; + return new EncryptedContentInfoParser(o); + } + + return null; + } + + public Asn1SetParser GetAuthAttrs() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject is Asn1TaggedObjectParser) + { + IAsn1Convertible o = nextObject; + nextObject = null; + return (Asn1SetParser)((Asn1TaggedObjectParser)o).GetObjectParser(Asn1Tags.Set, false); + } + + // TODO + // "The authAttrs MUST be present if the content type carried in + // EncryptedContentInfo is not id-data." + + return null; + } + + public Asn1OctetString GetMac() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + IAsn1Convertible o = nextObject; + nextObject = null; + + return Asn1OctetString.GetInstance(o.ToAsn1Object()); + } + + public Asn1SetParser GetUnauthAttrs() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject != null) + { + IAsn1Convertible o = nextObject; + nextObject = null; + return (Asn1SetParser)((Asn1TaggedObjectParser)o).GetObjectParser(Asn1Tags.Set, false); + } + + return null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedDataParser.cs.meta new file mode 100644 index 00000000..136a4873 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthEnvelopedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 443c4c049a391fb43a3fbfe484820cd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedData.cs new file mode 100644 index 00000000..9edeac4f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedData.cs @@ -0,0 +1,275 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class AuthenticatedData + : Asn1Encodable + { + private DerInteger version; + private OriginatorInfo originatorInfo; + private Asn1Set recipientInfos; + private AlgorithmIdentifier macAlgorithm; + private AlgorithmIdentifier digestAlgorithm; + private ContentInfo encapsulatedContentInfo; + private Asn1Set authAttrs; + private Asn1OctetString mac; + private Asn1Set unauthAttrs; + + public AuthenticatedData( + OriginatorInfo originatorInfo, + Asn1Set recipientInfos, + AlgorithmIdentifier macAlgorithm, + AlgorithmIdentifier digestAlgorithm, + ContentInfo encapsulatedContent, + Asn1Set authAttrs, + Asn1OctetString mac, + Asn1Set unauthAttrs) + { + if (digestAlgorithm != null || authAttrs != null) + { + if (digestAlgorithm == null || authAttrs == null) + { + throw new ArgumentException("digestAlgorithm and authAttrs must be set together"); + } + } + + version = new DerInteger(CalculateVersion(originatorInfo)); + + this.originatorInfo = originatorInfo; + this.macAlgorithm = macAlgorithm; + this.digestAlgorithm = digestAlgorithm; + this.recipientInfos = recipientInfos; + this.encapsulatedContentInfo = encapsulatedContent; + this.authAttrs = authAttrs; + this.mac = mac; + this.unauthAttrs = unauthAttrs; + } + + private AuthenticatedData( + Asn1Sequence seq) + { + int index = 0; + + version = (DerInteger)seq[index++]; + + Asn1Encodable tmp = seq[index++]; + if (tmp is Asn1TaggedObject) + { + originatorInfo = OriginatorInfo.GetInstance((Asn1TaggedObject)tmp, false); + tmp = seq[index++]; + } + + recipientInfos = Asn1Set.GetInstance(tmp); + macAlgorithm = AlgorithmIdentifier.GetInstance(seq[index++]); + + tmp = seq[index++]; + if (tmp is Asn1TaggedObject) + { + digestAlgorithm = AlgorithmIdentifier.GetInstance((Asn1TaggedObject)tmp, false); + tmp = seq[index++]; + } + + encapsulatedContentInfo = ContentInfo.GetInstance(tmp); + + tmp = seq[index++]; + if (tmp is Asn1TaggedObject) + { + authAttrs = Asn1Set.GetInstance((Asn1TaggedObject)tmp, false); + tmp = seq[index++]; + } + + mac = Asn1OctetString.GetInstance(tmp); + + if (seq.Count > index) + { + unauthAttrs = Asn1Set.GetInstance((Asn1TaggedObject)seq[index], false); + } + } + + /** + * return an AuthenticatedData object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param isExplicit true if the object is meant to be explicitly + * tagged false otherwise. + * @throws ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static AuthenticatedData GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * return an AuthenticatedData object from the given object. + * + * @param obj the object we want converted. + * @throws ArgumentException if the object cannot be converted. + */ + public static AuthenticatedData GetInstance( + object obj) + { + if (obj == null || obj is AuthenticatedData) + { + return (AuthenticatedData)obj; + } + + if (obj is Asn1Sequence) + { + return new AuthenticatedData((Asn1Sequence)obj); + } + + throw new ArgumentException("Invalid AuthenticatedData: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public DerInteger Version + { + get { return version; } + } + + public OriginatorInfo OriginatorInfo + { + get { return originatorInfo; } + } + + public Asn1Set RecipientInfos + { + get { return recipientInfos; } + } + + public AlgorithmIdentifier MacAlgorithm + { + get { return macAlgorithm; } + } + + public AlgorithmIdentifier DigestAlgorithm + { + get { return digestAlgorithm; } + } + + public ContentInfo EncapsulatedContentInfo + { + get { return encapsulatedContentInfo; } + } + + public Asn1Set AuthAttrs + { + get { return authAttrs; } + } + + public Asn1OctetString Mac + { + get { return mac; } + } + + public Asn1Set UnauthAttrs + { + get { return unauthAttrs; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+		 * AuthenticatedData ::= SEQUENCE {
+		 *       version CMSVersion,
+		 *       originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+		 *       recipientInfos RecipientInfos,
+		 *       macAlgorithm MessageAuthenticationCodeAlgorithm,
+		 *       digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL,
+		 *       encapContentInfo EncapsulatedContentInfo,
+		 *       authAttrs [2] IMPLICIT AuthAttributes OPTIONAL,
+		 *       mac MessageAuthenticationCode,
+		 *       unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL }
+		 *
+		 * AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
+		 *
+		 * UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
+		 *
+		 * MessageAuthenticationCode ::= OCTET STRING
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(version); + + if (originatorInfo != null) + { + v.Add(new DerTaggedObject(false, 0, originatorInfo)); + } + + v.Add(recipientInfos, macAlgorithm); + + if (digestAlgorithm != null) + { + v.Add(new DerTaggedObject(false, 1, digestAlgorithm)); + } + + v.Add(encapsulatedContentInfo); + + if (authAttrs != null) + { + v.Add(new DerTaggedObject(false, 2, authAttrs)); + } + + v.Add(mac); + + if (unauthAttrs != null) + { + v.Add(new DerTaggedObject(false, 3, unauthAttrs)); + } + + return new BerSequence(v); + } + + public static int CalculateVersion(OriginatorInfo origInfo) + { + if (origInfo == null) + return 0; + + int ver = 0; + + foreach (object obj in origInfo.Certificates) + { + if (obj is Asn1TaggedObject) + { + Asn1TaggedObject tag = (Asn1TaggedObject)obj; + + if (tag.TagNo == 2) + { + ver = 1; + } + else if (tag.TagNo == 3) + { + ver = 3; + break; + } + } + } + + foreach (object obj in origInfo.Crls) + { + if (obj is Asn1TaggedObject) + { + Asn1TaggedObject tag = (Asn1TaggedObject)obj; + + if (tag.TagNo == 1) + { + ver = 3; + break; + } + } + } + + return ver; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedData.cs.meta new file mode 100644 index 00000000..48b6b252 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bd580b30e67ffd4408ff835aa957e0a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedDataParser.cs new file mode 100644 index 00000000..307751c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedDataParser.cs @@ -0,0 +1,186 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + /** + * Produce an object suitable for an Asn1OutputStream. + *
+	 * AuthenticatedData ::= SEQUENCE {
+	 *       version CMSVersion,
+	 *       originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+	 *       recipientInfos RecipientInfos,
+	 *       macAlgorithm MessageAuthenticationCodeAlgorithm,
+	 *       digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL,
+	 *       encapContentInfo EncapsulatedContentInfo,
+	 *       authAttrs [2] IMPLICIT AuthAttributes OPTIONAL,
+	 *       mac MessageAuthenticationCode,
+	 *       unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL }
+	 *
+	 * AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
+	 *
+	 * UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
+	 *
+	 * MessageAuthenticationCode ::= OCTET STRING
+	 * 
+ */ + public class AuthenticatedDataParser + { + private Asn1SequenceParser seq; + private DerInteger version; + private IAsn1Convertible nextObject; + private bool originatorInfoCalled; + + public AuthenticatedDataParser( + Asn1SequenceParser seq) + { + this.seq = seq; + this.version = (DerInteger)seq.ReadObject(); + } + + public DerInteger Version + { + get { return version; } + } + + public OriginatorInfo GetOriginatorInfo() + { + originatorInfoCalled = true; + + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject is Asn1TaggedObjectParser && ((Asn1TaggedObjectParser)nextObject).TagNo == 0) + { + Asn1SequenceParser originatorInfo = (Asn1SequenceParser) ((Asn1TaggedObjectParser)nextObject).GetObjectParser(Asn1Tags.Sequence, false); + nextObject = null; + return OriginatorInfo.GetInstance(originatorInfo.ToAsn1Object()); + } + + return null; + } + + public Asn1SetParser GetRecipientInfos() + { + if (!originatorInfoCalled) + { + GetOriginatorInfo(); + } + + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + Asn1SetParser recipientInfos = (Asn1SetParser)nextObject; + nextObject = null; + return recipientInfos; + } + + public AlgorithmIdentifier GetMacAlgorithm() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject != null) + { + Asn1SequenceParser o = (Asn1SequenceParser)nextObject; + nextObject = null; + return AlgorithmIdentifier.GetInstance(o.ToAsn1Object()); + } + + return null; + } + + public AlgorithmIdentifier GetDigestAlgorithm() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject is Asn1TaggedObjectParser) + { + AlgorithmIdentifier obj = AlgorithmIdentifier.GetInstance( + (Asn1TaggedObject)nextObject.ToAsn1Object(), false); + nextObject = null; + return obj; + } + + return null; + } + + public ContentInfoParser GetEnapsulatedContentInfo() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject != null) + { + Asn1SequenceParser o = (Asn1SequenceParser)nextObject; + nextObject = null; + return new ContentInfoParser(o); + } + + return null; + } + + public Asn1SetParser GetAuthAttrs() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject is Asn1TaggedObjectParser) + { + IAsn1Convertible o = nextObject; + nextObject = null; + return (Asn1SetParser)((Asn1TaggedObjectParser)o).GetObjectParser(Asn1Tags.Set, false); + } + + return null; + } + + public Asn1OctetString GetMac() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + IAsn1Convertible o = nextObject; + nextObject = null; + + return Asn1OctetString.GetInstance(o.ToAsn1Object()); + } + + public Asn1SetParser GetUnauthAttrs() + { + if (nextObject == null) + { + nextObject = seq.ReadObject(); + } + + if (nextObject != null) + { + IAsn1Convertible o = nextObject; + nextObject = null; + return (Asn1SetParser)((Asn1TaggedObjectParser)o).GetObjectParser(Asn1Tags.Set, false); + } + + return null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedDataParser.cs.meta new file mode 100644 index 00000000..39cc7ec4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/AuthenticatedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebbdcf3516ac7004dbf60b37ec8649ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSAttributes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSAttributes.cs new file mode 100644 index 00000000..ac3eac37 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSAttributes.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public abstract class CmsAttributes + { + public static readonly DerObjectIdentifier ContentType = PkcsObjectIdentifiers.Pkcs9AtContentType; + public static readonly DerObjectIdentifier MessageDigest = PkcsObjectIdentifiers.Pkcs9AtMessageDigest; + public static readonly DerObjectIdentifier SigningTime = PkcsObjectIdentifiers.Pkcs9AtSigningTime; + public static readonly DerObjectIdentifier CounterSignature = PkcsObjectIdentifiers.Pkcs9AtCounterSignature; + public static readonly DerObjectIdentifier ContentHint = PkcsObjectIdentifiers.IdAAContentHint; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSAttributes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSAttributes.cs.meta new file mode 100644 index 00000000..9789db7e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0757271e8a9b09e47b7b926b9e69bc40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSObjectIdentifiers.cs new file mode 100644 index 00000000..c9124b85 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSObjectIdentifiers.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public abstract class CmsObjectIdentifiers + { + public static readonly DerObjectIdentifier Data = PkcsObjectIdentifiers.Data; + public static readonly DerObjectIdentifier SignedData = PkcsObjectIdentifiers.SignedData; + public static readonly DerObjectIdentifier EnvelopedData = PkcsObjectIdentifiers.EnvelopedData; + public static readonly DerObjectIdentifier SignedAndEnvelopedData = PkcsObjectIdentifiers.SignedAndEnvelopedData; + public static readonly DerObjectIdentifier DigestedData = PkcsObjectIdentifiers.DigestedData; + public static readonly DerObjectIdentifier EncryptedData = PkcsObjectIdentifiers.EncryptedData; + public static readonly DerObjectIdentifier AuthenticatedData = PkcsObjectIdentifiers.IdCTAuthData; + public static readonly DerObjectIdentifier CompressedData = PkcsObjectIdentifiers.IdCTCompressedData; + public static readonly DerObjectIdentifier AuthEnvelopedData = PkcsObjectIdentifiers.IdCTAuthEnvelopedData; + public static readonly DerObjectIdentifier timestampedData = PkcsObjectIdentifiers.IdCTTimestampedData; + + /** + * The other Revocation Info arc + * id-ri OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) + * dod(6) internet(1) security(5) mechanisms(5) pkix(7) ri(16) } + */ + public static readonly DerObjectIdentifier id_ri = new DerObjectIdentifier("1.3.6.1.5.5.7.16"); + + public static readonly DerObjectIdentifier id_ri_ocsp_response = id_ri.Branch("2"); + public static readonly DerObjectIdentifier id_ri_scvp = id_ri.Branch("4"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSObjectIdentifiers.cs.meta new file mode 100644 index 00000000..60686d23 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CMSObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1048b2656131c87478097ba9d30c9529 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedData.cs new file mode 100644 index 00000000..71571984 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedData.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + /** + * RFC 3274 - CMS Compressed Data. + *
+     * CompressedData ::= Sequence {
+     *  version CMSVersion,
+     *  compressionAlgorithm CompressionAlgorithmIdentifier,
+     *  encapContentInfo EncapsulatedContentInfo
+     * }
+     * 
+ */ + public class CompressedData + : Asn1Encodable + { + private DerInteger version; + private AlgorithmIdentifier compressionAlgorithm; + private ContentInfo encapContentInfo; + + public CompressedData( + AlgorithmIdentifier compressionAlgorithm, + ContentInfo encapContentInfo) + { + this.version = new DerInteger(0); + this.compressionAlgorithm = compressionAlgorithm; + this.encapContentInfo = encapContentInfo; + } + + public CompressedData( + Asn1Sequence seq) + { + this.version = (DerInteger) seq[0]; + this.compressionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]); + this.encapContentInfo = ContentInfo.GetInstance(seq[2]); + } + + /** + * return a CompressedData object from a tagged object. + * + * @param ato the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static CompressedData GetInstance( + Asn1TaggedObject ato, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(ato, explicitly)); + } + + /** + * return a CompressedData object from the given object. + * + * @param _obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static CompressedData GetInstance( + object obj) + { + if (obj == null || obj is CompressedData) + return (CompressedData)obj; + + if (obj is Asn1Sequence) + return new CompressedData((Asn1Sequence) obj); + + throw new ArgumentException("Invalid CompressedData: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public DerInteger Version + { + get { return version; } + } + + public AlgorithmIdentifier CompressionAlgorithmIdentifier + { + get { return compressionAlgorithm; } + } + + public ContentInfo EncapContentInfo + { + get { return encapContentInfo; } + } + + public override Asn1Object ToAsn1Object() + { + return new BerSequence(version, compressionAlgorithm, encapContentInfo); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedData.cs.meta new file mode 100644 index 00000000..c94c54a2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ce76e0ad7ebaa474b93ee262adb8891f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedDataParser.cs new file mode 100644 index 00000000..978d16f0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedDataParser.cs @@ -0,0 +1,51 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + /** + * RFC 3274 - CMS Compressed Data. + *
+	* CompressedData ::= SEQUENCE {
+	*  version CMSVersion,
+	*  compressionAlgorithm CompressionAlgorithmIdentifier,
+	*  encapContentInfo EncapsulatedContentInfo
+	* }
+	* 
+ */ + public class CompressedDataParser + { + private DerInteger _version; + private AlgorithmIdentifier _compressionAlgorithm; + private ContentInfoParser _encapContentInfo; + + public CompressedDataParser( + Asn1SequenceParser seq) + { + this._version = (DerInteger)seq.ReadObject(); + this._compressionAlgorithm = AlgorithmIdentifier.GetInstance(seq.ReadObject().ToAsn1Object()); + this._encapContentInfo = new ContentInfoParser((Asn1SequenceParser)seq.ReadObject()); + } + + public DerInteger Version + { + get { return _version; } + } + + public AlgorithmIdentifier CompressionAlgorithmIdentifier + { + get { return _compressionAlgorithm; } + } + + public ContentInfoParser GetEncapContentInfo() + { + return _encapContentInfo; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedDataParser.cs.meta new file mode 100644 index 00000000..d3d0c9e0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/CompressedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c601491913dd1a843bb9249917b4d526 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfo.cs new file mode 100644 index 00000000..ddf3b3a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfo.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class ContentInfo + : Asn1Encodable + { + private readonly DerObjectIdentifier contentType; + private readonly Asn1Encodable content; + + public static ContentInfo GetInstance( + object obj) + { + if (obj == null || obj is ContentInfo) + return (ContentInfo) obj; + + if (obj is Asn1Sequence) + return new ContentInfo((Asn1Sequence) obj); + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public static ContentInfo GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + private ContentInfo( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + contentType = (DerObjectIdentifier) seq[0]; + + if (seq.Count > 1) + { + Asn1TaggedObject tagged = (Asn1TaggedObject) seq[1]; + if (!tagged.IsExplicit() || tagged.TagNo != 0) + throw new ArgumentException("Bad tag for 'content'", "seq"); + + content = tagged.GetObject(); + } + } + + public ContentInfo( + DerObjectIdentifier contentType, + Asn1Encodable content) + { + this.contentType = contentType; + this.content = content; + } + + public DerObjectIdentifier ContentType + { + get { return contentType; } + } + + public Asn1Encodable Content + { + get { return content; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * ContentInfo ::= Sequence {
+         *          contentType ContentType,
+         *          content
+         *          [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(contentType); + + if (content != null) + { + v.Add(new BerTaggedObject(0, content)); + } + + return new BerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfo.cs.meta new file mode 100644 index 00000000..00cf2d33 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c6e4f0a47c3351438d7f12b33875555 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfoParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfoParser.cs new file mode 100644 index 00000000..d9a79e97 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfoParser.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + /** + * Produce an object suitable for an Asn1OutputStream. + *
+	* ContentInfo ::= SEQUENCE {
+	*          contentType ContentType,
+	*          content
+	*          [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
+	* 
+ */ + public class ContentInfoParser + { + private DerObjectIdentifier contentType; + private Asn1TaggedObjectParser content; + + public ContentInfoParser( + Asn1SequenceParser seq) + { + contentType = (DerObjectIdentifier)seq.ReadObject(); + content = (Asn1TaggedObjectParser)seq.ReadObject(); + } + + public DerObjectIdentifier ContentType + { + get { return contentType; } + } + + public IAsn1Convertible GetContent( + int tag) + { + if (content == null) + return null; + + return content.GetObjectParser(tag, true); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfoParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfoParser.cs.meta new file mode 100644 index 00000000..747eacf2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ContentInfoParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d534f39bac83c4345bdd3b1116cc1b3b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfo.cs new file mode 100644 index 00000000..c595a368 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfo.cs @@ -0,0 +1,98 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class EncryptedContentInfo + : Asn1Encodable + { + private DerObjectIdentifier contentType; + private AlgorithmIdentifier contentEncryptionAlgorithm; + private Asn1OctetString encryptedContent; + + public EncryptedContentInfo( + DerObjectIdentifier contentType, + AlgorithmIdentifier contentEncryptionAlgorithm, + Asn1OctetString encryptedContent) + { + this.contentType = contentType; + this.contentEncryptionAlgorithm = contentEncryptionAlgorithm; + this.encryptedContent = encryptedContent; + } + + public EncryptedContentInfo( + Asn1Sequence seq) + { + contentType = (DerObjectIdentifier) seq[0]; + contentEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]); + + if (seq.Count > 2) + { + encryptedContent = Asn1OctetString.GetInstance( + (Asn1TaggedObject) seq[2], false); + } + } + + /** + * return an EncryptedContentInfo object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static EncryptedContentInfo GetInstance( + object obj) + { + if (obj == null || obj is EncryptedContentInfo) + return (EncryptedContentInfo)obj; + + if (obj is Asn1Sequence) + return new EncryptedContentInfo((Asn1Sequence)obj); + + throw new ArgumentException("Invalid EncryptedContentInfo: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public DerObjectIdentifier ContentType + { + get { return contentType; } + } + + public AlgorithmIdentifier ContentEncryptionAlgorithm + { + get { return contentEncryptionAlgorithm; } + } + + public Asn1OctetString EncryptedContent + { + get { return encryptedContent; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * EncryptedContentInfo ::= Sequence {
+         *     contentType ContentType,
+         *     contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
+         *     encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + contentType, contentEncryptionAlgorithm); + + if (encryptedContent != null) + { + v.Add(new BerTaggedObject(false, 0, encryptedContent)); + } + + return new BerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfo.cs.meta new file mode 100644 index 00000000..6a4896ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 734316637f0e5fe4ea88123150e3f192 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfoParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfoParser.cs new file mode 100644 index 00000000..2450b226 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfoParser.cs @@ -0,0 +1,50 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + /** + *
+	* EncryptedContentInfo ::= SEQUENCE {
+	*     contentType ContentType,
+	*     contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
+	*     encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
+	* }
+	* 
+ */ + public class EncryptedContentInfoParser + { + private DerObjectIdentifier _contentType; + private AlgorithmIdentifier _contentEncryptionAlgorithm; + private Asn1TaggedObjectParser _encryptedContent; + + public EncryptedContentInfoParser( + Asn1SequenceParser seq) + { + _contentType = (DerObjectIdentifier)seq.ReadObject(); + _contentEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq.ReadObject().ToAsn1Object()); + _encryptedContent = (Asn1TaggedObjectParser)seq.ReadObject(); + } + + public DerObjectIdentifier ContentType + { + get { return _contentType; } + } + + public AlgorithmIdentifier ContentEncryptionAlgorithm + { + get { return _contentEncryptionAlgorithm; } + } + + public IAsn1Convertible GetEncryptedContent( + int tag) + { + return _encryptedContent.GetObjectParser(tag, false); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfoParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfoParser.cs.meta new file mode 100644 index 00000000..a08be01e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedContentInfoParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 301c2fc37f969434998cc7676ef6bf29 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedData.cs new file mode 100644 index 00000000..b9eb970a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedData.cs @@ -0,0 +1,101 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class EncryptedData + : Asn1Encodable + { + private readonly DerInteger version; + private readonly EncryptedContentInfo encryptedContentInfo; + private readonly Asn1Set unprotectedAttrs; + + public static EncryptedData GetInstance( + object obj) + { + if (obj is EncryptedData) + return (EncryptedData) obj; + + if (obj is Asn1Sequence) + return new EncryptedData((Asn1Sequence) obj); + + throw new ArgumentException("Invalid EncryptedData: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public EncryptedData( + EncryptedContentInfo encInfo) + : this(encInfo, null) + { + } + + public EncryptedData( + EncryptedContentInfo encInfo, + Asn1Set unprotectedAttrs) + { + if (encInfo == null) + throw new ArgumentNullException("encInfo"); + + this.version = new DerInteger((unprotectedAttrs == null) ? 0 : 2); + this.encryptedContentInfo = encInfo; + this.unprotectedAttrs = unprotectedAttrs; + } + + private EncryptedData( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count < 2 || seq.Count > 3) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.version = DerInteger.GetInstance(seq[0]); + this.encryptedContentInfo = EncryptedContentInfo.GetInstance(seq[1]); + + if (seq.Count > 2) + { + this.unprotectedAttrs = Asn1Set.GetInstance((Asn1TaggedObject)seq[2], false); + } + } + + public virtual DerInteger Version + { + get { return version; } + } + + public virtual EncryptedContentInfo EncryptedContentInfo + { + get { return encryptedContentInfo; } + } + + public virtual Asn1Set UnprotectedAttrs + { + get { return unprotectedAttrs; } + } + + /** + *
+		*       EncryptedData ::= SEQUENCE {
+		*                     version CMSVersion,
+		*                     encryptedContentInfo EncryptedContentInfo,
+		*                     unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL }
+		* 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(version, encryptedContentInfo); + + if (unprotectedAttrs != null) + { + v.Add(new BerTaggedObject(false, 1, unprotectedAttrs)); + } + + return new BerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedData.cs.meta new file mode 100644 index 00000000..a868e783 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EncryptedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32e23c002c8a122438df52ee042896f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedData.cs new file mode 100644 index 00000000..2d9f1ca8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedData.cs @@ -0,0 +1,180 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class EnvelopedData + : Asn1Encodable + { + private DerInteger version; + private OriginatorInfo originatorInfo; + private Asn1Set recipientInfos; + private EncryptedContentInfo encryptedContentInfo; + private Asn1Set unprotectedAttrs; + + public EnvelopedData( + OriginatorInfo originatorInfo, + Asn1Set recipientInfos, + EncryptedContentInfo encryptedContentInfo, + Asn1Set unprotectedAttrs) + { + this.version = new DerInteger(CalculateVersion(originatorInfo, recipientInfos, unprotectedAttrs)); + this.originatorInfo = originatorInfo; + this.recipientInfos = recipientInfos; + this.encryptedContentInfo = encryptedContentInfo; + this.unprotectedAttrs = unprotectedAttrs; + } + + public EnvelopedData( + OriginatorInfo originatorInfo, + Asn1Set recipientInfos, + EncryptedContentInfo encryptedContentInfo, + Attributes unprotectedAttrs) + { + this.version = new DerInteger(CalculateVersion(originatorInfo, recipientInfos, Asn1Set.GetInstance(unprotectedAttrs))); + this.originatorInfo = originatorInfo; + this.recipientInfos = recipientInfos; + this.encryptedContentInfo = encryptedContentInfo; + this.unprotectedAttrs = Asn1Set.GetInstance(unprotectedAttrs); + } + + [Obsolete("Use 'GetInstance' instead")] + public EnvelopedData( + Asn1Sequence seq) + { + int index = 0; + + version = (DerInteger) seq[index++]; + + object tmp = seq[index++]; + + if (tmp is Asn1TaggedObject) + { + originatorInfo = OriginatorInfo.GetInstance((Asn1TaggedObject) tmp, false); + tmp = seq[index++]; + } + + recipientInfos = Asn1Set.GetInstance(tmp); + encryptedContentInfo = EncryptedContentInfo.GetInstance(seq[index++]); + + if (seq.Count > index) + { + unprotectedAttrs = Asn1Set.GetInstance((Asn1TaggedObject) seq[index], false); + } + } + + /** + * return an EnvelopedData object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static EnvelopedData GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + /** + * return an EnvelopedData object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static EnvelopedData GetInstance( + object obj) + { + if (obj is EnvelopedData) + return (EnvelopedData)obj; + if (obj == null) + return null; + return new EnvelopedData(Asn1Sequence.GetInstance(obj)); + } + + public DerInteger Version + { + get { return version; } + } + + public OriginatorInfo OriginatorInfo + { + get { return originatorInfo; } + } + + public Asn1Set RecipientInfos + { + get { return recipientInfos; } + } + + public EncryptedContentInfo EncryptedContentInfo + { + get { return encryptedContentInfo; } + } + + public Asn1Set UnprotectedAttrs + { + get { return unprotectedAttrs; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * EnvelopedData ::= Sequence {
+         *     version CMSVersion,
+         *     originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+         *     recipientInfos RecipientInfos,
+         *     encryptedContentInfo EncryptedContentInfo,
+         *     unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(version); + + if (originatorInfo != null) + { + v.Add(new DerTaggedObject(false, 0, originatorInfo)); + } + + v.Add(recipientInfos, encryptedContentInfo); + + if (unprotectedAttrs != null) + { + v.Add(new DerTaggedObject(false, 1, unprotectedAttrs)); + } + + return new BerSequence(v); + } + + public static int CalculateVersion(OriginatorInfo originatorInfo, Asn1Set recipientInfos, Asn1Set unprotectedAttrs) + { + if (originatorInfo != null || unprotectedAttrs != null) + { + return 2; + } + + foreach (object o in recipientInfos) + { + RecipientInfo ri = RecipientInfo.GetInstance(o); + + if (ri.Version.Value.IntValue != 0) + { + return 2; + } + } + + return 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedData.cs.meta new file mode 100644 index 00000000..74a2ee2b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2cd9c9aa9076bc2428a5e356f289eb7d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedDataParser.cs new file mode 100644 index 00000000..3ad716ee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedDataParser.cs @@ -0,0 +1,111 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + /** + * Produce an object suitable for an Asn1OutputStream. + *
+	* EnvelopedData ::= SEQUENCE {
+	*     version CMSVersion,
+	*     originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
+	*     recipientInfos RecipientInfos,
+	*     encryptedContentInfo EncryptedContentInfo,
+	*     unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL
+	* }
+	* 
+ */ + public class EnvelopedDataParser + { + private Asn1SequenceParser _seq; + private DerInteger _version; + private IAsn1Convertible _nextObject; + private bool _originatorInfoCalled; + + public EnvelopedDataParser( + Asn1SequenceParser seq) + { + this._seq = seq; + this._version = (DerInteger)seq.ReadObject(); + } + + public DerInteger Version + { + get { return _version; } + } + + public OriginatorInfo GetOriginatorInfo() + { + _originatorInfoCalled = true; + + if (_nextObject == null) + { + _nextObject = _seq.ReadObject(); + } + + if (_nextObject is Asn1TaggedObjectParser && ((Asn1TaggedObjectParser)_nextObject).TagNo == 0) + { + Asn1SequenceParser originatorInfo = (Asn1SequenceParser) + ((Asn1TaggedObjectParser)_nextObject).GetObjectParser(Asn1Tags.Sequence, false); + _nextObject = null; + return OriginatorInfo.GetInstance(originatorInfo.ToAsn1Object()); + } + + return null; + } + + public Asn1SetParser GetRecipientInfos() + { + if (!_originatorInfoCalled) + { + GetOriginatorInfo(); + } + + if (_nextObject == null) + { + _nextObject = _seq.ReadObject(); + } + + Asn1SetParser recipientInfos = (Asn1SetParser)_nextObject; + _nextObject = null; + return recipientInfos; + } + + public EncryptedContentInfoParser GetEncryptedContentInfo() + { + if (_nextObject == null) + { + _nextObject = _seq.ReadObject(); + } + + if (_nextObject != null) + { + Asn1SequenceParser o = (Asn1SequenceParser) _nextObject; + _nextObject = null; + return new EncryptedContentInfoParser(o); + } + + return null; + } + + public Asn1SetParser GetUnprotectedAttrs() + { + if (_nextObject == null) + { + _nextObject = _seq.ReadObject(); + } + + if (_nextObject != null) + { + IAsn1Convertible o = _nextObject; + _nextObject = null; + return (Asn1SetParser)((Asn1TaggedObjectParser)o).GetObjectParser(Asn1Tags.Set, false); + } + + return null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedDataParser.cs.meta new file mode 100644 index 00000000..b37a7d7a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/EnvelopedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 049f3d1fdd7f54b4ebc65dfb671c29cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Evidence.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Evidence.cs new file mode 100644 index 00000000..d0fabe54 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Evidence.cs @@ -0,0 +1,53 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class Evidence + : Asn1Encodable, IAsn1Choice + { + private TimeStampTokenEvidence tstEvidence; + + public Evidence(TimeStampTokenEvidence tstEvidence) + { + this.tstEvidence = tstEvidence; + } + + private Evidence(Asn1TaggedObject tagged) + { + if (tagged.TagNo == 0) + { + this.tstEvidence = TimeStampTokenEvidence.GetInstance(tagged, false); + } + } + + public static Evidence GetInstance(object obj) + { + if (obj is Evidence) + return (Evidence)obj; + + if (obj is Asn1TaggedObject) + return new Evidence(Asn1TaggedObject.GetInstance(obj)); + + throw new ArgumentException("Unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual TimeStampTokenEvidence TstEvidence + { + get { return tstEvidence; } + } + + public override Asn1Object ToAsn1Object() + { + if (tstEvidence != null) + return new DerTaggedObject(false, 0, tstEvidence); + + return null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Evidence.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Evidence.cs.meta new file mode 100644 index 00000000..9de1d692 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Evidence.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46c54e768090c1144ba42fbc8902b810 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/IssuerAndSerialNumber.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/IssuerAndSerialNumber.cs new file mode 100644 index 00000000..402433ef --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/IssuerAndSerialNumber.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class IssuerAndSerialNumber + : Asn1Encodable + { + private X509Name name; + private DerInteger serialNumber; + + public static IssuerAndSerialNumber GetInstance(object obj) + { + if (obj == null) + return null; + IssuerAndSerialNumber existing = obj as IssuerAndSerialNumber; + if (existing != null) + return existing; + return new IssuerAndSerialNumber(Asn1Sequence.GetInstance(obj)); + } + + [Obsolete("Use GetInstance() instead")] + public IssuerAndSerialNumber( + Asn1Sequence seq) + { + this.name = X509Name.GetInstance(seq[0]); + this.serialNumber = (DerInteger) seq[1]; + } + + public IssuerAndSerialNumber( + X509Name name, + BigInteger serialNumber) + { + this.name = name; + this.serialNumber = new DerInteger(serialNumber); + } + + public IssuerAndSerialNumber( + X509Name name, + DerInteger serialNumber) + { + this.name = name; + this.serialNumber = serialNumber; + } + + public X509Name Name + { + get { return name; } + } + + public DerInteger SerialNumber + { + get { return serialNumber; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(name, serialNumber); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/IssuerAndSerialNumber.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/IssuerAndSerialNumber.cs.meta new file mode 100644 index 00000000..04b5c52d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/IssuerAndSerialNumber.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ca6d762d4dfef047abdc3f3b7b31120 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKIdentifier.cs new file mode 100644 index 00000000..33cf621b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKIdentifier.cs @@ -0,0 +1,123 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class KekIdentifier + : Asn1Encodable + { + private Asn1OctetString keyIdentifier; + private DerGeneralizedTime date; + private OtherKeyAttribute other; + + public KekIdentifier( + byte[] keyIdentifier, + DerGeneralizedTime date, + OtherKeyAttribute other) + { + this.keyIdentifier = new DerOctetString(keyIdentifier); + this.date = date; + this.other = other; + } + + public KekIdentifier( + Asn1Sequence seq) + { + keyIdentifier = (Asn1OctetString) seq[0]; + + switch (seq.Count) + { + case 1: + break; + case 2: + if (seq[1] is DerGeneralizedTime) + { + date = (DerGeneralizedTime) seq[1]; + } + else + { + other = OtherKeyAttribute.GetInstance(seq[2]); + } + break; + case 3: + date = (DerGeneralizedTime) seq[1]; + other = OtherKeyAttribute.GetInstance(seq[2]); + break; + default: + throw new ArgumentException("Invalid KekIdentifier"); + } + } + + /** + * return a KekIdentifier object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static KekIdentifier GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + /** + * return a KekIdentifier object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static KekIdentifier GetInstance( + object obj) + { + if (obj == null || obj is KekIdentifier) + return (KekIdentifier)obj; + + if (obj is Asn1Sequence) + return new KekIdentifier((Asn1Sequence)obj); + + throw new ArgumentException("Invalid KekIdentifier: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public Asn1OctetString KeyIdentifier + { + get { return keyIdentifier; } + } + + public DerGeneralizedTime Date + { + get { return date; } + } + + public OtherKeyAttribute Other + { + get { return other; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * KekIdentifier ::= Sequence {
+         *     keyIdentifier OCTET STRING,
+         *     date GeneralizedTime OPTIONAL,
+         *     other OtherKeyAttribute OPTIONAL
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(keyIdentifier); + v.AddOptional(date, other); + return new DerSequence(v); + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKIdentifier.cs.meta new file mode 100644 index 00000000..203d42b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49130dda685b7044b9695b4626ca1598 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKRecipientInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKRecipientInfo.cs new file mode 100644 index 00000000..fa11d59f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKRecipientInfo.cs @@ -0,0 +1,110 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class KekRecipientInfo + : Asn1Encodable + { + private DerInteger version; + private KekIdentifier kekID; + private AlgorithmIdentifier keyEncryptionAlgorithm; + private Asn1OctetString encryptedKey; + + public KekRecipientInfo( + KekIdentifier kekID, + AlgorithmIdentifier keyEncryptionAlgorithm, + Asn1OctetString encryptedKey) + { + this.version = new DerInteger(4); + this.kekID = kekID; + this.keyEncryptionAlgorithm = keyEncryptionAlgorithm; + this.encryptedKey = encryptedKey; + } + + public KekRecipientInfo( + Asn1Sequence seq) + { + version = (DerInteger) seq[0]; + kekID = KekIdentifier.GetInstance(seq[1]); + keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]); + encryptedKey = (Asn1OctetString) seq[3]; + } + + /** + * return a KekRecipientInfo object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static KekRecipientInfo GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + /** + * return a KekRecipientInfo object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static KekRecipientInfo GetInstance( + object obj) + { + if (obj == null || obj is KekRecipientInfo) + return (KekRecipientInfo)obj; + + if(obj is Asn1Sequence) + return new KekRecipientInfo((Asn1Sequence)obj); + + throw new ArgumentException("Invalid KekRecipientInfo: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public DerInteger Version + { + get { return version; } + } + + public KekIdentifier KekID + { + get { return kekID; } + } + + public AlgorithmIdentifier KeyEncryptionAlgorithm + { + get { return keyEncryptionAlgorithm; } + } + + public Asn1OctetString EncryptedKey + { + get { return encryptedKey; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * KekRecipientInfo ::= Sequence {
+         *     version CMSVersion,  -- always set to 4
+         *     kekID KekIdentifier,
+         *     keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
+         *     encryptedKey EncryptedKey
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(version, kekID, keyEncryptionAlgorithm, encryptedKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKRecipientInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKRecipientInfo.cs.meta new file mode 100644 index 00000000..a3fc353b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KEKRecipientInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a08f4c5a8855d34499caeb77a3a5a99 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientIdentifier.cs new file mode 100644 index 00000000..a753c580 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientIdentifier.cs @@ -0,0 +1,98 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class KeyAgreeRecipientIdentifier + : Asn1Encodable, IAsn1Choice + { + /** + * return an KeyAgreeRecipientIdentifier object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param isExplicit true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static KeyAgreeRecipientIdentifier GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * return an KeyAgreeRecipientIdentifier object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static KeyAgreeRecipientIdentifier GetInstance( + object obj) + { + if (obj == null || obj is KeyAgreeRecipientIdentifier) + return (KeyAgreeRecipientIdentifier)obj; + + if (obj is Asn1Sequence) + return new KeyAgreeRecipientIdentifier(IssuerAndSerialNumber.GetInstance(obj)); + + if (obj is Asn1TaggedObject && ((Asn1TaggedObject)obj).TagNo == 0) + { + return new KeyAgreeRecipientIdentifier(RecipientKeyIdentifier.GetInstance( + (Asn1TaggedObject)obj, false)); + } + + throw new ArgumentException("Invalid KeyAgreeRecipientIdentifier: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private readonly IssuerAndSerialNumber issuerSerial; + private readonly RecipientKeyIdentifier rKeyID; + + public KeyAgreeRecipientIdentifier( + IssuerAndSerialNumber issuerSerial) + { + this.issuerSerial = issuerSerial; + } + + public KeyAgreeRecipientIdentifier( + RecipientKeyIdentifier rKeyID) + { + this.rKeyID = rKeyID; + } + + public IssuerAndSerialNumber IssuerAndSerialNumber + { + get { return issuerSerial; } + } + + public RecipientKeyIdentifier RKeyID + { + get { return rKeyID; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+		 * KeyAgreeRecipientIdentifier ::= CHOICE {
+		 *     issuerAndSerialNumber IssuerAndSerialNumber,
+		 *     rKeyId [0] IMPLICIT RecipientKeyIdentifier
+		 * }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + if (issuerSerial != null) + { + return issuerSerial.ToAsn1Object(); + } + + return new DerTaggedObject(false, 0, rKeyID); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientIdentifier.cs.meta new file mode 100644 index 00000000..c5ccc560 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0372bc62893e54440854c9f5bd12da12 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientInfo.cs new file mode 100644 index 00000000..8fa19ff3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientInfo.cs @@ -0,0 +1,145 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class KeyAgreeRecipientInfo + : Asn1Encodable + { + private DerInteger version; + private OriginatorIdentifierOrKey originator; + private Asn1OctetString ukm; + private AlgorithmIdentifier keyEncryptionAlgorithm; + private Asn1Sequence recipientEncryptedKeys; + + public KeyAgreeRecipientInfo( + OriginatorIdentifierOrKey originator, + Asn1OctetString ukm, + AlgorithmIdentifier keyEncryptionAlgorithm, + Asn1Sequence recipientEncryptedKeys) + { + this.version = new DerInteger(3); + this.originator = originator; + this.ukm = ukm; + this.keyEncryptionAlgorithm = keyEncryptionAlgorithm; + this.recipientEncryptedKeys = recipientEncryptedKeys; + } + + public KeyAgreeRecipientInfo( + Asn1Sequence seq) + { + int index = 0; + + version = (DerInteger) seq[index++]; + originator = OriginatorIdentifierOrKey.GetInstance( + (Asn1TaggedObject) seq[index++], true); + + if (seq[index] is Asn1TaggedObject) + { + ukm = Asn1OctetString.GetInstance( + (Asn1TaggedObject) seq[index++], true); + } + + keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance( + seq[index++]); + + recipientEncryptedKeys = (Asn1Sequence) seq[index++]; + } + + /** + * return a KeyAgreeRecipientInfo object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static KeyAgreeRecipientInfo GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + /** + * return a KeyAgreeRecipientInfo object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static KeyAgreeRecipientInfo GetInstance( + object obj) + { + if (obj == null || obj is KeyAgreeRecipientInfo) + return (KeyAgreeRecipientInfo)obj; + + if (obj is Asn1Sequence) + return new KeyAgreeRecipientInfo((Asn1Sequence)obj); + + throw new ArgumentException( + "Illegal object in KeyAgreeRecipientInfo: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + + } + + public DerInteger Version + { + get { return version; } + } + + public OriginatorIdentifierOrKey Originator + { + get { return originator; } + } + + public Asn1OctetString UserKeyingMaterial + { + get { return ukm; } + } + + public AlgorithmIdentifier KeyEncryptionAlgorithm + { + get { return keyEncryptionAlgorithm; } + } + + public Asn1Sequence RecipientEncryptedKeys + { + get { return recipientEncryptedKeys; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * KeyAgreeRecipientInfo ::= Sequence {
+         *     version CMSVersion,  -- always set to 3
+         *     originator [0] EXPLICIT OriginatorIdentifierOrKey,
+         *     ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL,
+         *     keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
+         *     recipientEncryptedKeys RecipientEncryptedKeys
+         * }
+		 *
+		 * UserKeyingMaterial ::= OCTET STRING
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + version, new DerTaggedObject(true, 0, originator)); + + if (ukm != null) + { + v.Add(new DerTaggedObject(true, 1, ukm)); + } + + v.Add(keyEncryptionAlgorithm, recipientEncryptedKeys); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientInfo.cs.meta new file mode 100644 index 00000000..ae16291c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyAgreeRecipientInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc4f430e5e3afd84d8f4f7e81b4f28e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyTransRecipientInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyTransRecipientInfo.cs new file mode 100644 index 00000000..eabcd2f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyTransRecipientInfo.cs @@ -0,0 +1,103 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class KeyTransRecipientInfo + : Asn1Encodable + { + private DerInteger version; + private RecipientIdentifier rid; + private AlgorithmIdentifier keyEncryptionAlgorithm; + private Asn1OctetString encryptedKey; + + public KeyTransRecipientInfo( + RecipientIdentifier rid, + AlgorithmIdentifier keyEncryptionAlgorithm, + Asn1OctetString encryptedKey) + { + if (rid.ToAsn1Object() is Asn1TaggedObject) + { + this.version = new DerInteger(2); + } + else + { + this.version = new DerInteger(0); + } + + this.rid = rid; + this.keyEncryptionAlgorithm = keyEncryptionAlgorithm; + this.encryptedKey = encryptedKey; + } + + public KeyTransRecipientInfo( + Asn1Sequence seq) + { + this.version = (DerInteger) seq[0]; + this.rid = RecipientIdentifier.GetInstance(seq[1]); + this.keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]); + this.encryptedKey = (Asn1OctetString) seq[3]; + } + + /** + * return a KeyTransRecipientInfo object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static KeyTransRecipientInfo GetInstance( + object obj) + { + if (obj == null || obj is KeyTransRecipientInfo) + return (KeyTransRecipientInfo) obj; + + if(obj is Asn1Sequence) + return new KeyTransRecipientInfo((Asn1Sequence) obj); + + throw new ArgumentException( + "Illegal object in KeyTransRecipientInfo: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public DerInteger Version + { + get { return version; } + } + + public RecipientIdentifier RecipientIdentifier + { + get { return rid; } + } + + public AlgorithmIdentifier KeyEncryptionAlgorithm + { + get { return keyEncryptionAlgorithm; } + } + + public Asn1OctetString EncryptedKey + { + get { return encryptedKey; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * KeyTransRecipientInfo ::= Sequence {
+         *     version CMSVersion,  -- always set to 0 or 2
+         *     rid RecipientIdentifier,
+         *     keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
+         *     encryptedKey EncryptedKey
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(version, rid, keyEncryptionAlgorithm, encryptedKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyTransRecipientInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyTransRecipientInfo.cs.meta new file mode 100644 index 00000000..7cc5c6de --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/KeyTransRecipientInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d063c42f925d95d4ebb266d4c0a24edd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/MetaData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/MetaData.cs new file mode 100644 index 00000000..82aa7a54 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/MetaData.cs @@ -0,0 +1,98 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class MetaData + : Asn1Encodable + { + private DerBoolean hashProtected; + private DerUtf8String fileName; + private DerIA5String mediaType; + private Attributes otherMetaData; + + public MetaData( + DerBoolean hashProtected, + DerUtf8String fileName, + DerIA5String mediaType, + Attributes otherMetaData) + { + this.hashProtected = hashProtected; + this.fileName = fileName; + this.mediaType = mediaType; + this.otherMetaData = otherMetaData; + } + + private MetaData(Asn1Sequence seq) + { + this.hashProtected = DerBoolean.GetInstance(seq[0]); + + int index = 1; + + if (index < seq.Count && seq[index] is DerUtf8String) + { + this.fileName = DerUtf8String.GetInstance(seq[index++]); + } + if (index < seq.Count && seq[index] is DerIA5String) + { + this.mediaType = DerIA5String.GetInstance(seq[index++]); + } + if (index < seq.Count) + { + this.otherMetaData = Attributes.GetInstance(seq[index++]); + } + } + + public static MetaData GetInstance(object obj) + { + if (obj is MetaData) + return (MetaData)obj; + + if (obj != null) + return new MetaData(Asn1Sequence.GetInstance(obj)); + + return null; + } + + /** + *
+		 * MetaData ::= SEQUENCE {
+		 *   hashProtected        BOOLEAN,
+		 *   fileName             UTF8String OPTIONAL,
+		 *   mediaType            IA5String OPTIONAL,
+		 *   otherMetaData        Attributes OPTIONAL
+		 * }
+		 * 
+ * @return + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(hashProtected); + v.AddOptional(fileName, mediaType, otherMetaData); + return new DerSequence(v); + } + + public virtual bool IsHashProtected + { + get { return hashProtected.IsTrue; } + } + + public virtual DerUtf8String FileName + { + get { return fileName; } + } + + public virtual DerIA5String MediaType + { + get { return mediaType; } + } + + public virtual Attributes OtherMetaData + { + get { return otherMetaData; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/MetaData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/MetaData.cs.meta new file mode 100644 index 00000000..af16f122 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/MetaData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c069e17a92db0594c807bf2fb47f8ef4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorIdentifierOrKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorIdentifierOrKey.cs new file mode 100644 index 00000000..f7103923 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorIdentifierOrKey.cs @@ -0,0 +1,172 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class OriginatorIdentifierOrKey + : Asn1Encodable, IAsn1Choice + { + private Asn1Encodable id; + + public OriginatorIdentifierOrKey( + IssuerAndSerialNumber id) + { + this.id = id; + } + + [Obsolete("Use version taking a 'SubjectKeyIdentifier'")] + public OriginatorIdentifierOrKey( + Asn1OctetString id) + : this(new SubjectKeyIdentifier(id)) + { + } + + public OriginatorIdentifierOrKey( + SubjectKeyIdentifier id) + { + this.id = new DerTaggedObject(false, 0, id); + } + + public OriginatorIdentifierOrKey( + OriginatorPublicKey id) + { + this.id = new DerTaggedObject(false, 1, id); + } + + [Obsolete("Use more specific version")] + public OriginatorIdentifierOrKey( + Asn1Object id) + { + this.id = id; + } + + private OriginatorIdentifierOrKey( + Asn1TaggedObject id) + { + // TODO Add validation + this.id = id; + } + + /** + * return an OriginatorIdentifierOrKey object from a tagged object. + * + * @param o the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static OriginatorIdentifierOrKey GetInstance( + Asn1TaggedObject o, + bool explicitly) + { + if (!explicitly) + { + throw new ArgumentException( + "Can't implicitly tag OriginatorIdentifierOrKey"); + } + + return GetInstance(o.GetObject()); + } + + /** + * return an OriginatorIdentifierOrKey object from the given object. + * + * @param o the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static OriginatorIdentifierOrKey GetInstance( + object o) + { + if (o == null || o is OriginatorIdentifierOrKey) + return (OriginatorIdentifierOrKey)o; + + if (o is IssuerAndSerialNumber) + return new OriginatorIdentifierOrKey((IssuerAndSerialNumber)o); + + if (o is SubjectKeyIdentifier) + return new OriginatorIdentifierOrKey((SubjectKeyIdentifier)o); + + if (o is OriginatorPublicKey) + return new OriginatorIdentifierOrKey((OriginatorPublicKey)o); + + if (o is Asn1TaggedObject) + return new OriginatorIdentifierOrKey((Asn1TaggedObject)o); + + throw new ArgumentException("Invalid OriginatorIdentifierOrKey: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + public Asn1Encodable ID + { + get { return id; } + } + + public IssuerAndSerialNumber IssuerAndSerialNumber + { + get + { + if (id is IssuerAndSerialNumber) + { + return (IssuerAndSerialNumber)id; + } + + return null; + } + } + + public SubjectKeyIdentifier SubjectKeyIdentifier + { + get + { + if (id is Asn1TaggedObject && ((Asn1TaggedObject)id).TagNo == 0) + { + return SubjectKeyIdentifier.GetInstance((Asn1TaggedObject)id, false); + } + + return null; + } + } + + [Obsolete("Use 'OriginatorPublicKey' property")] + public OriginatorPublicKey OriginatorKey + { + get { return OriginatorPublicKey; } + } + + public OriginatorPublicKey OriginatorPublicKey + { + get + { + if (id is Asn1TaggedObject && ((Asn1TaggedObject)id).TagNo == 1) + { + return OriginatorPublicKey.GetInstance((Asn1TaggedObject)id, false); + } + + return null; + } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * OriginatorIdentifierOrKey ::= CHOICE {
+         *     issuerAndSerialNumber IssuerAndSerialNumber,
+         *     subjectKeyIdentifier [0] SubjectKeyIdentifier,
+         *     originatorKey [1] OriginatorPublicKey
+         * }
+         *
+         * SubjectKeyIdentifier ::= OCTET STRING
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return id.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorIdentifierOrKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorIdentifierOrKey.cs.meta new file mode 100644 index 00000000..f82c9ade --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorIdentifierOrKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: edf95ebe065692842a5dad19e9c09988 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorInfo.cs new file mode 100644 index 00000000..981f16d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorInfo.cs @@ -0,0 +1,125 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class OriginatorInfo + : Asn1Encodable + { + private Asn1Set certs; + private Asn1Set crls; + + public OriginatorInfo( + Asn1Set certs, + Asn1Set crls) + { + this.certs = certs; + this.crls = crls; + } + + public OriginatorInfo( + Asn1Sequence seq) + { + switch (seq.Count) + { + case 0: // empty + break; + case 1: + Asn1TaggedObject o = (Asn1TaggedObject) seq[0]; + switch (o.TagNo) + { + case 0 : + certs = Asn1Set.GetInstance(o, false); + break; + case 1 : + crls = Asn1Set.GetInstance(o, false); + break; + default: + throw new ArgumentException("Bad tag in OriginatorInfo: " + o.TagNo); + } + break; + case 2: + certs = Asn1Set.GetInstance((Asn1TaggedObject) seq[0], false); + crls = Asn1Set.GetInstance((Asn1TaggedObject) seq[1], false); + break; + default: + throw new ArgumentException("OriginatorInfo too big"); + } + } + + /** + * return an OriginatorInfo object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static OriginatorInfo GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + /** + * return an OriginatorInfo object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static OriginatorInfo GetInstance( + object obj) + { + if (obj == null || obj is OriginatorInfo) + return (OriginatorInfo)obj; + + if (obj is Asn1Sequence) + return new OriginatorInfo((Asn1Sequence)obj); + + throw new ArgumentException("Invalid OriginatorInfo: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public Asn1Set Certificates + { + get { return certs; } + } + + public Asn1Set Crls + { + get { return crls; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * OriginatorInfo ::= Sequence {
+         *     certs [0] IMPLICIT CertificateSet OPTIONAL,
+         *     crls [1] IMPLICIT CertificateRevocationLists OPTIONAL
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (certs != null) + { + v.Add(new DerTaggedObject(false, 0, certs)); + } + + if (crls != null) + { + v.Add(new DerTaggedObject(false, 1, crls)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorInfo.cs.meta new file mode 100644 index 00000000..268eba4a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa1c981fcfa71ec40ade9b84d1c85001 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorPublicKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorPublicKey.cs new file mode 100644 index 00000000..c58f769c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorPublicKey.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class OriginatorPublicKey + : Asn1Encodable + { + private readonly AlgorithmIdentifier mAlgorithm; + private readonly DerBitString mPublicKey; + + public OriginatorPublicKey( + AlgorithmIdentifier algorithm, + byte[] publicKey) + { + this.mAlgorithm = algorithm; + this.mPublicKey = new DerBitString(publicKey); + } + + [Obsolete("Use 'GetInstance' instead")] + public OriginatorPublicKey( + Asn1Sequence seq) + { + this.mAlgorithm = AlgorithmIdentifier.GetInstance(seq[0]); + this.mPublicKey = DerBitString.GetInstance(seq[1]); + } + + /** + * return an OriginatorPublicKey object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static OriginatorPublicKey GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + /** + * return an OriginatorPublicKey object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static OriginatorPublicKey GetInstance( + object obj) + { + if (obj == null || obj is OriginatorPublicKey) + return (OriginatorPublicKey)obj; + + if (obj is Asn1Sequence) + return new OriginatorPublicKey(Asn1Sequence.GetInstance(obj)); + + throw new ArgumentException("Invalid OriginatorPublicKey: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public AlgorithmIdentifier Algorithm + { + get { return mAlgorithm; } + } + + public DerBitString PublicKey + { + get { return mPublicKey; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * OriginatorPublicKey ::= Sequence {
+         *     algorithm AlgorithmIdentifier,
+         *     publicKey BIT STRING
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(mAlgorithm, mPublicKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorPublicKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorPublicKey.cs.meta new file mode 100644 index 00000000..9069cdb1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OriginatorPublicKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e8ede139be247f84aada13d5cc2f812c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherKeyAttribute.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherKeyAttribute.cs new file mode 100644 index 00000000..80eda6f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherKeyAttribute.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class OtherKeyAttribute + : Asn1Encodable + { + private DerObjectIdentifier keyAttrId; + private Asn1Encodable keyAttr; + + /** + * return an OtherKeyAttribute object from the given object. + * + * @param o the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static OtherKeyAttribute GetInstance( + object obj) + { + if (obj == null || obj is OtherKeyAttribute) + return (OtherKeyAttribute) obj; + + if (obj is Asn1Sequence) + return new OtherKeyAttribute((Asn1Sequence) obj); + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public OtherKeyAttribute( + Asn1Sequence seq) + { + keyAttrId = (DerObjectIdentifier) seq[0]; + keyAttr = seq[1]; + } + + public OtherKeyAttribute( + DerObjectIdentifier keyAttrId, + Asn1Encodable keyAttr) + { + this.keyAttrId = keyAttrId; + this.keyAttr = keyAttr; + } + + public DerObjectIdentifier KeyAttrId + { + get { return keyAttrId; } + } + + public Asn1Encodable KeyAttr + { + get { return keyAttr; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * OtherKeyAttribute ::= Sequence {
+         *     keyAttrId OBJECT IDENTIFIER,
+         *     keyAttr ANY DEFINED BY keyAttrId OPTIONAL
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(keyAttrId, keyAttr); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherKeyAttribute.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherKeyAttribute.cs.meta new file mode 100644 index 00000000..b0f442f8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherKeyAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 96a6f83f9549ee94b8cb8ec0fc736279 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRecipientInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRecipientInfo.cs new file mode 100644 index 00000000..e06b9132 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRecipientInfo.cs @@ -0,0 +1,87 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class OtherRecipientInfo + : Asn1Encodable + { + private readonly DerObjectIdentifier oriType; + private readonly Asn1Encodable oriValue; + + public OtherRecipientInfo( + DerObjectIdentifier oriType, + Asn1Encodable oriValue) + { + this.oriType = oriType; + this.oriValue = oriValue; + } + + [Obsolete("Use GetInstance() instead")] + public OtherRecipientInfo( + Asn1Sequence seq) + { + oriType = DerObjectIdentifier.GetInstance(seq[0]); + oriValue = seq[1]; + } + + /** + * return a OtherRecipientInfo object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static OtherRecipientInfo GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + /** + * return a OtherRecipientInfo object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static OtherRecipientInfo GetInstance( + object obj) + { + if (obj == null) + return null; + OtherRecipientInfo existing = obj as OtherRecipientInfo; + if (existing != null) + return existing; + return new OtherRecipientInfo(Asn1Sequence.GetInstance(obj)); + } + + public virtual DerObjectIdentifier OriType + { + get { return oriType; } + } + + public virtual Asn1Encodable OriValue + { + get { return oriValue; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * OtherRecipientInfo ::= Sequence {
+         *    oriType OBJECT IDENTIFIER,
+         *    oriValue ANY DEFINED BY oriType }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(oriType, oriValue); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRecipientInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRecipientInfo.cs.meta new file mode 100644 index 00000000..e6781a20 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRecipientInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 412dcb4cb5551154cbe9584c4c280eed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRevocationInfoFormat.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRevocationInfoFormat.cs new file mode 100644 index 00000000..ab007c90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRevocationInfoFormat.cs @@ -0,0 +1,81 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class OtherRevocationInfoFormat + : Asn1Encodable + { + private readonly DerObjectIdentifier otherRevInfoFormat; + private readonly Asn1Encodable otherRevInfo; + + public OtherRevocationInfoFormat( + DerObjectIdentifier otherRevInfoFormat, + Asn1Encodable otherRevInfo) + { + this.otherRevInfoFormat = otherRevInfoFormat; + this.otherRevInfo = otherRevInfo; + } + + private OtherRevocationInfoFormat(Asn1Sequence seq) + { + otherRevInfoFormat = DerObjectIdentifier.GetInstance(seq[0]); + otherRevInfo = seq[1]; + } + + /** + * return a OtherRevocationInfoFormat object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicit true if the object is meant to be explicitly + * tagged false otherwise. + * @exception IllegalArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static OtherRevocationInfoFormat GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * return a OtherRevocationInfoFormat object from the given object. + * + * @param obj the object we want converted. + * @exception IllegalArgumentException if the object cannot be converted. + */ + public static OtherRevocationInfoFormat GetInstance(object obj) + { + if (obj is OtherRevocationInfoFormat) + return (OtherRevocationInfoFormat)obj; + if (obj != null) + return new OtherRevocationInfoFormat(Asn1Sequence.GetInstance(obj)); + return null; + } + + public virtual DerObjectIdentifier InfoFormat + { + get { return otherRevInfoFormat; } + } + + public virtual Asn1Encodable Info + { + get { return otherRevInfo; } + } + + /** + * Produce an object suitable for an ASN1OutputStream. + *
+         * OtherRevocationInfoFormat ::= SEQUENCE {
+         *      otherRevInfoFormat OBJECT IDENTIFIER,
+         *      otherRevInfo ANY DEFINED BY otherRevInfoFormat }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(otherRevInfoFormat, otherRevInfo); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRevocationInfoFormat.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRevocationInfoFormat.cs.meta new file mode 100644 index 00000000..82309ac3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/OtherRevocationInfoFormat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4e3b4defd74e67b4884d478f8fffa56b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/PasswordRecipientInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/PasswordRecipientInfo.cs new file mode 100644 index 00000000..64cfd05e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/PasswordRecipientInfo.cs @@ -0,0 +1,137 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class PasswordRecipientInfo + : Asn1Encodable + { + private readonly DerInteger version; + private readonly AlgorithmIdentifier keyDerivationAlgorithm; + private readonly AlgorithmIdentifier keyEncryptionAlgorithm; + private readonly Asn1OctetString encryptedKey; + + public PasswordRecipientInfo( + AlgorithmIdentifier keyEncryptionAlgorithm, + Asn1OctetString encryptedKey) + { + this.version = new DerInteger(0); + this.keyEncryptionAlgorithm = keyEncryptionAlgorithm; + this.encryptedKey = encryptedKey; + } + + public PasswordRecipientInfo( + AlgorithmIdentifier keyDerivationAlgorithm, + AlgorithmIdentifier keyEncryptionAlgorithm, + Asn1OctetString encryptedKey) + { + this.version = new DerInteger(0); + this.keyDerivationAlgorithm = keyDerivationAlgorithm; + this.keyEncryptionAlgorithm = keyEncryptionAlgorithm; + this.encryptedKey = encryptedKey; + } + + public PasswordRecipientInfo( + Asn1Sequence seq) + { + version = (DerInteger) seq[0]; + + if (seq[1] is Asn1TaggedObject) + { + keyDerivationAlgorithm = AlgorithmIdentifier.GetInstance((Asn1TaggedObject) seq[1], false); + keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]); + encryptedKey = (Asn1OctetString) seq[3]; + } + else + { + keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]); + encryptedKey = (Asn1OctetString) seq[2]; + } + } + + /** + * return a PasswordRecipientInfo object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param explicitly true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static PasswordRecipientInfo GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + /** + * return a PasswordRecipientInfo object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static PasswordRecipientInfo GetInstance( + object obj) + { + if (obj == null || obj is PasswordRecipientInfo) + return (PasswordRecipientInfo) obj; + + if (obj is Asn1Sequence) + return new PasswordRecipientInfo((Asn1Sequence) obj); + + throw new ArgumentException("Invalid PasswordRecipientInfo: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public DerInteger Version + { + get { return version; } + } + + public AlgorithmIdentifier KeyDerivationAlgorithm + { + get { return keyDerivationAlgorithm; } + } + + public AlgorithmIdentifier KeyEncryptionAlgorithm + { + get { return keyEncryptionAlgorithm; } + } + + public Asn1OctetString EncryptedKey + { + get { return encryptedKey; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * PasswordRecipientInfo ::= Sequence {
+         *   version CMSVersion,   -- Always set to 0
+         *   keyDerivationAlgorithm [0] KeyDerivationAlgorithmIdentifier
+         *                             OPTIONAL,
+         *  keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
+         *  encryptedKey EncryptedKey }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(version); + + if (keyDerivationAlgorithm != null) + { + v.Add(new DerTaggedObject(false, 0, keyDerivationAlgorithm)); + } + + v.Add(keyEncryptionAlgorithm, encryptedKey); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/PasswordRecipientInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/PasswordRecipientInfo.cs.meta new file mode 100644 index 00000000..22f7a316 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/PasswordRecipientInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56045582a99e8964cb8d0e7ac4d0cb6b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientEncryptedKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientEncryptedKey.cs new file mode 100644 index 00000000..2524988c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientEncryptedKey.cs @@ -0,0 +1,94 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class RecipientEncryptedKey + : Asn1Encodable + { + private readonly KeyAgreeRecipientIdentifier identifier; + private readonly Asn1OctetString encryptedKey; + + private RecipientEncryptedKey( + Asn1Sequence seq) + { + identifier = KeyAgreeRecipientIdentifier.GetInstance(seq[0]); + encryptedKey = (Asn1OctetString) seq[1]; + } + + /** + * return an RecipientEncryptedKey object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param isExplicit true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static RecipientEncryptedKey GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * return a RecipientEncryptedKey object from the given object. + * + * @param obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static RecipientEncryptedKey GetInstance( + object obj) + { + if (obj == null || obj is RecipientEncryptedKey) + { + return (RecipientEncryptedKey) obj; + } + + if (obj is Asn1Sequence) + { + return new RecipientEncryptedKey((Asn1Sequence) obj); + } + + throw new ArgumentException("Invalid RecipientEncryptedKey: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public RecipientEncryptedKey( + KeyAgreeRecipientIdentifier id, + Asn1OctetString encryptedKey) + { + this.identifier = id; + this.encryptedKey = encryptedKey; + } + + public KeyAgreeRecipientIdentifier Identifier + { + get { return identifier; } + } + + public Asn1OctetString EncryptedKey + { + get { return encryptedKey; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+		 * RecipientEncryptedKey ::= SEQUENCE {
+		 *     rid KeyAgreeRecipientIdentifier,
+		 *     encryptedKey EncryptedKey
+		 * }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(identifier, encryptedKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientEncryptedKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientEncryptedKey.cs.meta new file mode 100644 index 00000000..935c3bca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientEncryptedKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9fad49673d746fd489658518c25af573 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientIdentifier.cs new file mode 100644 index 00000000..3e03a3ab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientIdentifier.cs @@ -0,0 +1,93 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class RecipientIdentifier + : Asn1Encodable, IAsn1Choice + { + private Asn1Encodable id; + + public RecipientIdentifier( + IssuerAndSerialNumber id) + { + this.id = id; + } + + public RecipientIdentifier( + Asn1OctetString id) + { + this.id = new DerTaggedObject(false, 0, id); + } + + public RecipientIdentifier( + Asn1Object id) + { + this.id = id; + } + + /** + * return a RecipientIdentifier object from the given object. + * + * @param o the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static RecipientIdentifier GetInstance( + object o) + { + if (o == null || o is RecipientIdentifier) + return (RecipientIdentifier)o; + + if (o is IssuerAndSerialNumber) + return new RecipientIdentifier((IssuerAndSerialNumber) o); + + if (o is Asn1OctetString) + return new RecipientIdentifier((Asn1OctetString) o); + + if (o is Asn1Object) + return new RecipientIdentifier((Asn1Object) o); + + throw new ArgumentException( + "Illegal object in RecipientIdentifier: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + public bool IsTagged + { + get { return (id is Asn1TaggedObject); } + } + + public Asn1Encodable ID + { + get + { + if (id is Asn1TaggedObject) + { + return Asn1OctetString.GetInstance((Asn1TaggedObject) id, false); + } + + return IssuerAndSerialNumber.GetInstance(id); + } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * RecipientIdentifier ::= CHOICE {
+         *     issuerAndSerialNumber IssuerAndSerialNumber,
+         *     subjectKeyIdentifier [0] SubjectKeyIdentifier
+         * }
+         *
+         * SubjectKeyIdentifier ::= OCTET STRING
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return id.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientIdentifier.cs.meta new file mode 100644 index 00000000..d89ec2f8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 30c7f636380542d4d9712ae601fc5f03 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientInfo.cs new file mode 100644 index 00000000..b6392678 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientInfo.cs @@ -0,0 +1,149 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class RecipientInfo + : Asn1Encodable, IAsn1Choice + { + internal Asn1Encodable info; + + public RecipientInfo( + KeyTransRecipientInfo info) + { + this.info = info; + } + + public RecipientInfo( + KeyAgreeRecipientInfo info) + { + this.info = new DerTaggedObject(false, 1, info); + } + + public RecipientInfo( + KekRecipientInfo info) + { + this.info = new DerTaggedObject(false, 2, info); + } + + public RecipientInfo( + PasswordRecipientInfo info) + { + this.info = new DerTaggedObject(false, 3, info); + } + + public RecipientInfo( + OtherRecipientInfo info) + { + this.info = new DerTaggedObject(false, 4, info); + } + + public RecipientInfo( + Asn1Object info) + { + this.info = info; + } + + public static RecipientInfo GetInstance( + object o) + { + if (o == null || o is RecipientInfo) + return (RecipientInfo) o; + + if (o is Asn1Sequence) + return new RecipientInfo((Asn1Sequence) o); + + if (o is Asn1TaggedObject) + return new RecipientInfo((Asn1TaggedObject) o); + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + public DerInteger Version + { + get + { + if (info is Asn1TaggedObject) + { + Asn1TaggedObject o = (Asn1TaggedObject) info; + + switch (o.TagNo) + { + case 1: + return KeyAgreeRecipientInfo.GetInstance(o, false).Version; + case 2: + return GetKekInfo(o).Version; + case 3: + return PasswordRecipientInfo.GetInstance(o, false).Version; + case 4: + return new DerInteger(0); // no syntax version for OtherRecipientInfo + default: + throw new InvalidOperationException("unknown tag"); + } + } + + return KeyTransRecipientInfo.GetInstance(info).Version; + } + } + + public bool IsTagged + { + get { return info is Asn1TaggedObject; } + } + + public Asn1Encodable Info + { + get + { + if (info is Asn1TaggedObject) + { + Asn1TaggedObject o = (Asn1TaggedObject) info; + + switch (o.TagNo) + { + case 1: + return KeyAgreeRecipientInfo.GetInstance(o, false); + case 2: + return GetKekInfo(o); + case 3: + return PasswordRecipientInfo.GetInstance(o, false); + case 4: + return OtherRecipientInfo.GetInstance(o, false); + default: + throw new InvalidOperationException("unknown tag"); + } + } + + return KeyTransRecipientInfo.GetInstance(info); + } + } + + private KekRecipientInfo GetKekInfo( + Asn1TaggedObject o) + { + // For compatibility with erroneous version, we don't always pass 'false' here + return KekRecipientInfo.GetInstance(o, o.IsExplicit()); + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * RecipientInfo ::= CHOICE {
+         *     ktri KeyTransRecipientInfo,
+         *     kari [1] KeyAgreeRecipientInfo,
+         *     kekri [2] KekRecipientInfo,
+         *     pwri [3] PasswordRecipientInfo,
+         *     ori [4] OtherRecipientInfo }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return info.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientInfo.cs.meta new file mode 100644 index 00000000..d06d8856 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a85a3b31eb7210a47b17a727f44f9928 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientKeyIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientKeyIdentifier.cs new file mode 100644 index 00000000..e338e5cf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientKeyIdentifier.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class RecipientKeyIdentifier + : Asn1Encodable + { + private Asn1OctetString subjectKeyIdentifier; + private DerGeneralizedTime date; + private OtherKeyAttribute other; + + public RecipientKeyIdentifier( + Asn1OctetString subjectKeyIdentifier, + DerGeneralizedTime date, + OtherKeyAttribute other) + { + this.subjectKeyIdentifier = subjectKeyIdentifier; + this.date = date; + this.other = other; + } + + public RecipientKeyIdentifier( + byte[] subjectKeyIdentifier) + : this(subjectKeyIdentifier, null, null) + { + } + + public RecipientKeyIdentifier( + byte[] subjectKeyIdentifier, + DerGeneralizedTime date, + OtherKeyAttribute other) + { + this.subjectKeyIdentifier = new DerOctetString(subjectKeyIdentifier); + this.date = date; + this.other = other; + } + + public RecipientKeyIdentifier( + Asn1Sequence seq) + { + subjectKeyIdentifier = Asn1OctetString.GetInstance( + seq[0]); + + switch(seq.Count) + { + case 1: + break; + case 2: + if (seq[1] is DerGeneralizedTime) + { + date = (DerGeneralizedTime) seq[1]; + } + else + { + other = OtherKeyAttribute.GetInstance(seq[2]); + } + break; + case 3: + date = (DerGeneralizedTime) seq[1]; + other = OtherKeyAttribute.GetInstance(seq[2]); + break; + default: + throw new ArgumentException("Invalid RecipientKeyIdentifier"); + } + } + + /** + * return a RecipientKeyIdentifier object from a tagged object. + * + * @param _ato the tagged object holding the object we want. + * @param _explicit true if the object is meant to be explicitly + * tagged false otherwise. + * @exception ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static RecipientKeyIdentifier GetInstance( + Asn1TaggedObject ato, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(ato, explicitly)); + } + + /** + * return a RecipientKeyIdentifier object from the given object. + * + * @param _obj the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static RecipientKeyIdentifier GetInstance( + object obj) + { + if (obj == null || obj is RecipientKeyIdentifier) + return (RecipientKeyIdentifier) obj; + + if (obj is Asn1Sequence) + return new RecipientKeyIdentifier((Asn1Sequence) obj); + + throw new ArgumentException("Invalid RecipientKeyIdentifier: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public Asn1OctetString SubjectKeyIdentifier + { + get { return subjectKeyIdentifier; } + } + + public DerGeneralizedTime Date + { + get { return date; } + } + + public OtherKeyAttribute OtherKeyAttribute + { + get { return other; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * RecipientKeyIdentifier ::= Sequence {
+         *     subjectKeyIdentifier SubjectKeyIdentifier,
+         *     date GeneralizedTime OPTIONAL,
+         *     other OtherKeyAttribute OPTIONAL
+         * }
+         *
+         * SubjectKeyIdentifier ::= OCTET STRING
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(subjectKeyIdentifier); + v.AddOptional(date, other); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientKeyIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientKeyIdentifier.cs.meta new file mode 100644 index 00000000..31b17e47 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/RecipientKeyIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3a2571078d5b78e4eb534333a1068127 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SCVPReqRes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SCVPReqRes.cs new file mode 100644 index 00000000..2b9090ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SCVPReqRes.cs @@ -0,0 +1,81 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class ScvpReqRes + : Asn1Encodable + { + private readonly ContentInfo request; + private readonly ContentInfo response; + + public static ScvpReqRes GetInstance(object obj) + { + if (obj is ScvpReqRes) + return (ScvpReqRes)obj; + if (obj != null) + return new ScvpReqRes(Asn1Sequence.GetInstance(obj)); + return null; + } + + private ScvpReqRes(Asn1Sequence seq) + { + if (seq[0] is Asn1TaggedObject) + { + this.request = ContentInfo.GetInstance(Asn1TaggedObject.GetInstance(seq[0]), true); + this.response = ContentInfo.GetInstance(seq[1]); + } + else + { + this.request = null; + this.response = ContentInfo.GetInstance(seq[0]); + } + } + + public ScvpReqRes(ContentInfo response) + : this(null, response) + { + } + + public ScvpReqRes(ContentInfo request, ContentInfo response) + { + this.request = request; + this.response = response; + } + + public virtual ContentInfo Request + { + get { return request; } + } + + public virtual ContentInfo Response + { + get { return response; } + } + + /** + *
+         *    ScvpReqRes ::= SEQUENCE {
+         *    request  [0] EXPLICIT ContentInfo OPTIONAL,
+         *    response     ContentInfo }
+         * 
+ * @return the ASN.1 primitive representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (request != null) + { + v.Add(new DerTaggedObject(true, 0, request)); + } + + v.Add(response); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SCVPReqRes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SCVPReqRes.cs.meta new file mode 100644 index 00000000..3978380d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SCVPReqRes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 92dbb27973d540649af93402eedd7360 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedData.cs new file mode 100644 index 00000000..37586cfc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedData.cs @@ -0,0 +1,291 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + /** + * a signed data object. + */ + public class SignedData + : Asn1Encodable + { + private static readonly DerInteger Version1 = new DerInteger(1); + private static readonly DerInteger Version3 = new DerInteger(3); + private static readonly DerInteger Version4 = new DerInteger(4); + private static readonly DerInteger Version5 = new DerInteger(5); + + private readonly DerInteger version; + private readonly Asn1Set digestAlgorithms; + private readonly ContentInfo contentInfo; + private readonly Asn1Set certificates; + private readonly Asn1Set crls; + private readonly Asn1Set signerInfos; + private readonly bool certsBer; + private readonly bool crlsBer; + + public static SignedData GetInstance( + object obj) + { + if (obj is SignedData) + return (SignedData) obj; + + if (obj is Asn1Sequence) + return new SignedData((Asn1Sequence) obj); + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public SignedData( + Asn1Set digestAlgorithms, + ContentInfo contentInfo, + Asn1Set certificates, + Asn1Set crls, + Asn1Set signerInfos) + { + this.version = CalculateVersion(contentInfo.ContentType, certificates, crls, signerInfos); + this.digestAlgorithms = digestAlgorithms; + this.contentInfo = contentInfo; + this.certificates = certificates; + this.crls = crls; + this.signerInfos = signerInfos; + this.crlsBer = crls is BerSet; + this.certsBer = certificates is BerSet; + } + + // RFC3852, section 5.1: + // IF ((certificates is present) AND + // (any certificates with a type of other are present)) OR + // ((crls is present) AND + // (any crls with a type of other are present)) + // THEN version MUST be 5 + // ELSE + // IF (certificates is present) AND + // (any version 2 attribute certificates are present) + // THEN version MUST be 4 + // ELSE + // IF ((certificates is present) AND + // (any version 1 attribute certificates are present)) OR + // (any SignerInfo structures are version 3) OR + // (encapContentInfo eContentType is other than id-data) + // THEN version MUST be 3 + // ELSE version MUST be 1 + // + private DerInteger CalculateVersion( + DerObjectIdentifier contentOid, + Asn1Set certs, + Asn1Set crls, + Asn1Set signerInfs) + { + bool otherCert = false; + bool otherCrl = false; + bool attrCertV1Found = false; + bool attrCertV2Found = false; + + if (certs != null) + { + foreach (object obj in certs) + { + if (obj is Asn1TaggedObject) + { + Asn1TaggedObject tagged = (Asn1TaggedObject)obj; + + if (tagged.TagNo == 1) + { + attrCertV1Found = true; + } + else if (tagged.TagNo == 2) + { + attrCertV2Found = true; + } + else if (tagged.TagNo == 3) + { + otherCert = true; + break; + } + } + } + } + + if (otherCert) + { + return Version5; + } + + if (crls != null) + { + foreach (object obj in crls) + { + if (obj is Asn1TaggedObject) + { + otherCrl = true; + break; + } + } + } + + if (otherCrl) + { + return Version5; + } + + if (attrCertV2Found) + { + return Version4; + } + + if (attrCertV1Found || !CmsObjectIdentifiers.Data.Equals(contentOid) || CheckForVersion3(signerInfs)) + { + return Version3; + } + + return Version1; + } + + private bool CheckForVersion3( + Asn1Set signerInfs) + { + foreach (object obj in signerInfs) + { + SignerInfo s = SignerInfo.GetInstance(obj); + + if (s.Version.Value.IntValue == 3) + { + return true; + } + } + + return false; + } + + private SignedData( + Asn1Sequence seq) + { + IEnumerator e = seq.GetEnumerator(); + + e.MoveNext(); + version = (DerInteger)e.Current; + + e.MoveNext(); + digestAlgorithms = ((Asn1Set)e.Current); + + e.MoveNext(); + contentInfo = ContentInfo.GetInstance(e.Current); + + while (e.MoveNext()) + { + Asn1Object o = (Asn1Object)e.Current; + + // + // an interesting feature of SignedData is that there appear + // to be varying implementations... + // for the moment we ignore anything which doesn't fit. + // + if (o is Asn1TaggedObject) + { + Asn1TaggedObject tagged = (Asn1TaggedObject)o; + + switch (tagged.TagNo) + { + case 0: + certsBer = tagged is BerTaggedObject; + certificates = Asn1Set.GetInstance(tagged, false); + break; + case 1: + crlsBer = tagged is BerTaggedObject; + crls = Asn1Set.GetInstance(tagged, false); + break; + default: + throw new ArgumentException("unknown tag value " + tagged.TagNo); + } + } + else + { + signerInfos = (Asn1Set) o; + } + } + } + + public DerInteger Version + { + get { return version; } + } + + public Asn1Set DigestAlgorithms + { + get { return digestAlgorithms; } + } + + public ContentInfo EncapContentInfo + { + get { return contentInfo; } + } + + public Asn1Set Certificates + { + get { return certificates; } + } + + public Asn1Set CRLs + { + get { return crls; } + } + + public Asn1Set SignerInfos + { + get { return signerInfos; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * SignedData ::= Sequence {
+         *     version CMSVersion,
+         *     digestAlgorithms DigestAlgorithmIdentifiers,
+         *     encapContentInfo EncapsulatedContentInfo,
+         *     certificates [0] IMPLICIT CertificateSet OPTIONAL,
+         *     crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
+         *     signerInfos SignerInfos
+         *   }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + version, digestAlgorithms, contentInfo); + + if (certificates != null) + { + if (certsBer) + { + v.Add(new BerTaggedObject(false, 0, certificates)); + } + else + { + v.Add(new DerTaggedObject(false, 0, certificates)); + } + } + + if (crls != null) + { + if (crlsBer) + { + v.Add(new BerTaggedObject(false, 1, crls)); + } + else + { + v.Add(new DerTaggedObject(false, 1, crls)); + } + } + + v.Add(signerInfos); + + return new BerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedData.cs.meta new file mode 100644 index 00000000..586f90fb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5dc6d047e3b72c4dbc7647580b4200b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedDataParser.cs new file mode 100644 index 00000000..6422e902 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedDataParser.cs @@ -0,0 +1,118 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + /** + *
+	* SignedData ::= SEQUENCE {
+	*     version CMSVersion,
+	*     digestAlgorithms DigestAlgorithmIdentifiers,
+	*     encapContentInfo EncapsulatedContentInfo,
+	*     certificates [0] IMPLICIT CertificateSet OPTIONAL,
+	*     crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
+	*     signerInfos SignerInfos
+	*   }
+	* 
+ */ + public class SignedDataParser + { + private Asn1SequenceParser _seq; + private DerInteger _version; + private object _nextObject; + private bool _certsCalled; + private bool _crlsCalled; + + public static SignedDataParser GetInstance( + object o) + { + if (o is Asn1Sequence) + return new SignedDataParser(((Asn1Sequence)o).Parser); + + if (o is Asn1SequenceParser) + return new SignedDataParser((Asn1SequenceParser)o); + + throw new IOException("unknown object encountered: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + public SignedDataParser( + Asn1SequenceParser seq) + { + this._seq = seq; + this._version = (DerInteger)seq.ReadObject(); + } + + public DerInteger Version + { + get { return _version; } + } + + public Asn1SetParser GetDigestAlgorithms() + { + return (Asn1SetParser)_seq.ReadObject(); + } + + public ContentInfoParser GetEncapContentInfo() + { + return new ContentInfoParser((Asn1SequenceParser)_seq.ReadObject()); + } + + public Asn1SetParser GetCertificates() + { + _certsCalled = true; + _nextObject = _seq.ReadObject(); + + if (_nextObject is Asn1TaggedObjectParser && ((Asn1TaggedObjectParser)_nextObject).TagNo == 0) + { + Asn1SetParser certs = (Asn1SetParser)((Asn1TaggedObjectParser)_nextObject).GetObjectParser(Asn1Tags.Set, false); + _nextObject = null; + + return certs; + } + + return null; + } + + public Asn1SetParser GetCrls() + { + if (!_certsCalled) + throw new IOException("GetCerts() has not been called."); + + _crlsCalled = true; + + if (_nextObject == null) + { + _nextObject = _seq.ReadObject(); + } + + if (_nextObject is Asn1TaggedObjectParser && ((Asn1TaggedObjectParser)_nextObject).TagNo == 1) + { + Asn1SetParser crls = (Asn1SetParser)((Asn1TaggedObjectParser)_nextObject).GetObjectParser(Asn1Tags.Set, false); + _nextObject = null; + + return crls; + } + + return null; + } + + public Asn1SetParser GetSignerInfos() + { + if (!_certsCalled || !_crlsCalled) + throw new IOException("GetCerts() and/or GetCrls() has not been called."); + + if (_nextObject == null) + { + _nextObject = _seq.ReadObject(); + } + + return (Asn1SetParser)_nextObject; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedDataParser.cs.meta new file mode 100644 index 00000000..7264a427 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe03f140a8f8c9140a306a9386ee2e6c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerIdentifier.cs new file mode 100644 index 00000000..29aaaa4a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerIdentifier.cs @@ -0,0 +1,93 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class SignerIdentifier + : Asn1Encodable, IAsn1Choice + { + private Asn1Encodable id; + + public SignerIdentifier( + IssuerAndSerialNumber id) + { + this.id = id; + } + + public SignerIdentifier( + Asn1OctetString id) + { + this.id = new DerTaggedObject(false, 0, id); + } + + public SignerIdentifier( + Asn1Object id) + { + this.id = id; + } + + /** + * return a SignerIdentifier object from the given object. + * + * @param o the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static SignerIdentifier GetInstance( + object o) + { + if (o == null || o is SignerIdentifier) + return (SignerIdentifier) o; + + if (o is IssuerAndSerialNumber) + return new SignerIdentifier((IssuerAndSerialNumber) o); + + if (o is Asn1OctetString) + return new SignerIdentifier((Asn1OctetString) o); + + if (o is Asn1Object) + return new SignerIdentifier((Asn1Object) o); + + throw new ArgumentException( + "Illegal object in SignerIdentifier: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + public bool IsTagged + { + get { return (id is Asn1TaggedObject); } + } + + public Asn1Encodable ID + { + get + { + if (id is Asn1TaggedObject) + { + return Asn1OctetString.GetInstance((Asn1TaggedObject)id, false); + } + + return id; + } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * SignerIdentifier ::= CHOICE {
+         *     issuerAndSerialNumber IssuerAndSerialNumber,
+         *     subjectKeyIdentifier [0] SubjectKeyIdentifier
+         * }
+         *
+         * SubjectKeyIdentifier ::= OCTET STRING
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return id.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerIdentifier.cs.meta new file mode 100644 index 00000000..8f01da1f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1834d9476e2fa5642acce8e4bc2a71c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerInfo.cs new file mode 100644 index 00000000..8447830b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerInfo.cs @@ -0,0 +1,189 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class SignerInfo + : Asn1Encodable + { + private DerInteger version; + private SignerIdentifier sid; + private AlgorithmIdentifier digAlgorithm; + private Asn1Set authenticatedAttributes; + private AlgorithmIdentifier digEncryptionAlgorithm; + private Asn1OctetString encryptedDigest; + private Asn1Set unauthenticatedAttributes; + + public static SignerInfo GetInstance( + object obj) + { + if (obj == null || obj is SignerInfo) + return (SignerInfo) obj; + + if (obj is Asn1Sequence) + return new SignerInfo((Asn1Sequence) obj); + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public SignerInfo( + SignerIdentifier sid, + AlgorithmIdentifier digAlgorithm, + Asn1Set authenticatedAttributes, + AlgorithmIdentifier digEncryptionAlgorithm, + Asn1OctetString encryptedDigest, + Asn1Set unauthenticatedAttributes) + { + this.version = new DerInteger(sid.IsTagged ? 3 : 1); + this.sid = sid; + this.digAlgorithm = digAlgorithm; + this.authenticatedAttributes = authenticatedAttributes; + this.digEncryptionAlgorithm = digEncryptionAlgorithm; + this.encryptedDigest = encryptedDigest; + this.unauthenticatedAttributes = unauthenticatedAttributes; + } + + public SignerInfo( + SignerIdentifier sid, + AlgorithmIdentifier digAlgorithm, + Attributes authenticatedAttributes, + AlgorithmIdentifier digEncryptionAlgorithm, + Asn1OctetString encryptedDigest, + Attributes unauthenticatedAttributes) + { + this.version = new DerInteger(sid.IsTagged ? 3 : 1); + this.sid = sid; + this.digAlgorithm = digAlgorithm; + this.authenticatedAttributes = Asn1Set.GetInstance(authenticatedAttributes); + this.digEncryptionAlgorithm = digEncryptionAlgorithm; + this.encryptedDigest = encryptedDigest; + this.unauthenticatedAttributes = Asn1Set.GetInstance(unauthenticatedAttributes); + } + + [Obsolete("Use 'GetInstance' instead")] + public SignerInfo( + Asn1Sequence seq) + { + IEnumerator e = seq.GetEnumerator(); + + e.MoveNext(); + version = (DerInteger) e.Current; + + e.MoveNext(); + sid = SignerIdentifier.GetInstance(e.Current); + + e.MoveNext(); + digAlgorithm = AlgorithmIdentifier.GetInstance(e.Current); + + e.MoveNext(); + object obj = e.Current; + + if (obj is Asn1TaggedObject) + { + authenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject) obj, false); + + e.MoveNext(); + digEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(e.Current); + } + else + { + authenticatedAttributes = null; + digEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(obj); + } + + e.MoveNext(); + encryptedDigest = DerOctetString.GetInstance(e.Current); + + if (e.MoveNext()) + { + unauthenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject) e.Current, false); + } + else + { + unauthenticatedAttributes = null; + } + } + + public DerInteger Version + { + get { return version; } + } + + public SignerIdentifier SignerID + { + get { return sid; } + } + + public Asn1Set AuthenticatedAttributes + { + get { return authenticatedAttributes; } + } + + public AlgorithmIdentifier DigestAlgorithm + { + get { return digAlgorithm; } + } + + public Asn1OctetString EncryptedDigest + { + get { return encryptedDigest; } + } + + public AlgorithmIdentifier DigestEncryptionAlgorithm + { + get { return digEncryptionAlgorithm; } + } + + public Asn1Set UnauthenticatedAttributes + { + get { return unauthenticatedAttributes; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  SignerInfo ::= Sequence {
+         *      version Version,
+         *      SignerIdentifier sid,
+         *      digestAlgorithm DigestAlgorithmIdentifier,
+         *      authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL,
+         *      digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
+         *      encryptedDigest EncryptedDigest,
+         *      unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL
+         *  }
+         *
+         *  EncryptedDigest ::= OCTET STRING
+         *
+         *  DigestAlgorithmIdentifier ::= AlgorithmIdentifier
+         *
+         *  DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + version, sid, digAlgorithm); + + if (authenticatedAttributes != null) + { + v.Add(new DerTaggedObject(false, 0, authenticatedAttributes)); + } + + v.Add(digEncryptionAlgorithm, encryptedDigest); + + if (unauthenticatedAttributes != null) + { + v.Add(new DerTaggedObject(false, 1, unauthenticatedAttributes)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerInfo.cs.meta new file mode 100644 index 00000000..adaa1194 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/SignerInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b001eabd602e8924b916b46709474a77 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Time.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Time.cs new file mode 100644 index 00000000..4308d4bf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Time.cs @@ -0,0 +1,119 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Globalization; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class Time + : Asn1Encodable, IAsn1Choice + { + private readonly Asn1Object time; + + public static Time GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(obj.GetObject()); + } + + public Time( + Asn1Object time) + { + if (time == null) + throw new ArgumentNullException("time"); + if (!(time is DerUtcTime) && !(time is DerGeneralizedTime)) + throw new ArgumentException("unknown object passed to Time"); + + this.time = time; + } + + /** + * creates a time object from a given date - if the date is between 1950 + * and 2049 a UTCTime object is Generated, otherwise a GeneralizedTime + * is used. + */ + public Time( + DateTime date) + { + string d = date.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture) + "Z"; + + int year = int.Parse(d.Substring(0, 4)); + + if (year < 1950 || year > 2049) + { + time = new DerGeneralizedTime(d); + } + else + { + time = new DerUtcTime(d.Substring(2)); + } + } + + public static Time GetInstance( + object obj) + { + if (obj == null || obj is Time) + return (Time)obj; + if (obj is DerUtcTime) + return new Time((DerUtcTime)obj); + if (obj is DerGeneralizedTime) + return new Time((DerGeneralizedTime)obj); + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public string TimeString + { + get + { + if (time is DerUtcTime) + { + return ((DerUtcTime)time).AdjustedTimeString; + } + else + { + return ((DerGeneralizedTime)time).GetTime(); + } + } + } + + public DateTime Date + { + get + { + try + { + if (time is DerUtcTime) + { + return ((DerUtcTime)time).ToAdjustedDateTime(); + } + + return ((DerGeneralizedTime)time).ToDateTime(); + } + catch (FormatException e) + { + // this should never happen + throw new InvalidOperationException("invalid date string: " + e.Message); + } + } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * Time ::= CHOICE {
+         *             utcTime        UTCTime,
+         *             generalTime    GeneralizedTime }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return time; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Time.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Time.cs.meta new file mode 100644 index 00000000..76f08082 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/Time.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd53b1f6bb9d6d340b540b1b2f98b5e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampAndCRL.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampAndCRL.cs new file mode 100644 index 00000000..755cf979 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampAndCRL.cs @@ -0,0 +1,66 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class TimeStampAndCrl + : Asn1Encodable + { + private ContentInfo timeStamp; + private X509.CertificateList crl; + + public TimeStampAndCrl(ContentInfo timeStamp) + { + this.timeStamp = timeStamp; + } + + private TimeStampAndCrl(Asn1Sequence seq) + { + this.timeStamp = ContentInfo.GetInstance(seq[0]); + if (seq.Count == 2) + { + this.crl = X509.CertificateList.GetInstance(seq[1]); + } + } + + public static TimeStampAndCrl GetInstance(object obj) + { + if (obj is TimeStampAndCrl) + return (TimeStampAndCrl)obj; + + if (obj != null) + return new TimeStampAndCrl(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public virtual ContentInfo TimeStampToken + { + get { return this.timeStamp; } + } + + public virtual X509.CertificateList Crl + { + get { return this.crl; } + } + + /** + *
+		 * TimeStampAndCRL ::= SEQUENCE {
+		 *     timeStamp   TimeStampToken,          -- according to RFC 3161
+		 *     crl         CertificateList OPTIONAL -- according to RFC 5280
+		 *  }
+		 * 
+ * @return + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(timeStamp); + v.AddOptional(crl); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampAndCRL.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampAndCRL.cs.meta new file mode 100644 index 00000000..4fe72d32 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampAndCRL.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aefd69060f6d123459d8901c0ebf1119 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampTokenEvidence.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampTokenEvidence.cs new file mode 100644 index 00000000..6060ef85 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampTokenEvidence.cs @@ -0,0 +1,69 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class TimeStampTokenEvidence + : Asn1Encodable + { + private TimeStampAndCrl[] timeStampAndCrls; + + public TimeStampTokenEvidence(TimeStampAndCrl[] timeStampAndCrls) + { + this.timeStampAndCrls = timeStampAndCrls; + } + + public TimeStampTokenEvidence(TimeStampAndCrl timeStampAndCrl) + { + this.timeStampAndCrls = new TimeStampAndCrl[]{ timeStampAndCrl }; + } + + private TimeStampTokenEvidence(Asn1Sequence seq) + { + this.timeStampAndCrls = new TimeStampAndCrl[seq.Count]; + + int count = 0; + + foreach (Asn1Encodable ae in seq) + { + this.timeStampAndCrls[count++] = TimeStampAndCrl.GetInstance(ae.ToAsn1Object()); + } + } + + public static TimeStampTokenEvidence GetInstance(Asn1TaggedObject tagged, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(tagged, isExplicit)); + } + + public static TimeStampTokenEvidence GetInstance(object obj) + { + if (obj is TimeStampTokenEvidence) + return (TimeStampTokenEvidence)obj; + + if (obj != null) + return new TimeStampTokenEvidence(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public virtual TimeStampAndCrl[] ToTimeStampAndCrlArray() + { + return (TimeStampAndCrl[])timeStampAndCrls.Clone(); + } + + /** + *
+		 * TimeStampTokenEvidence ::=
+		 *    SEQUENCE SIZE(1..MAX) OF TimeStampAndCrl
+		 * 
+ * @return + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(timeStampAndCrls); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampTokenEvidence.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampTokenEvidence.cs.meta new file mode 100644 index 00000000..5b1d1759 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampTokenEvidence.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c5e92824f624151419005181ce6e0331 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedData.cs new file mode 100644 index 00000000..cf7e638c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedData.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class TimeStampedData + : Asn1Encodable + { + private DerInteger version; + private DerIA5String dataUri; + private MetaData metaData; + private Asn1OctetString content; + private Evidence temporalEvidence; + + public TimeStampedData(DerIA5String dataUri, MetaData metaData, Asn1OctetString content, + Evidence temporalEvidence) + { + this.version = new DerInteger(1); + this.dataUri = dataUri; + this.metaData = metaData; + this.content = content; + this.temporalEvidence = temporalEvidence; + } + + private TimeStampedData(Asn1Sequence seq) + { + this.version = DerInteger.GetInstance(seq[0]); + + int index = 1; + if (seq[index] is DerIA5String) + { + this.dataUri = DerIA5String.GetInstance(seq[index++]); + } + if (seq[index] is MetaData || seq[index] is Asn1Sequence) + { + this.metaData = MetaData.GetInstance(seq[index++]); + } + if (seq[index] is Asn1OctetString) + { + this.content = Asn1OctetString.GetInstance(seq[index++]); + } + this.temporalEvidence = Evidence.GetInstance(seq[index]); + } + + public static TimeStampedData GetInstance(object obj) + { + if (obj is TimeStampedData) + return (TimeStampedData)obj; + + if (obj != null) + return new TimeStampedData(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public virtual DerIA5String DataUri + { + get { return dataUri; } + } + + public MetaData MetaData + { + get { return metaData; } + } + + public Asn1OctetString Content + { + get { return content; } + } + + public Evidence TemporalEvidence + { + get { return temporalEvidence; } + } + + /** + *
+		 * TimeStampedData ::= SEQUENCE {
+		 *   version              INTEGER { v1(1) },
+		 *   dataUri              IA5String OPTIONAL,
+		 *   metaData             MetaData OPTIONAL,
+		 *   content              OCTET STRING OPTIONAL,
+		 *   temporalEvidence     Evidence
+		 * }
+		 * 
+ * @return + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(version); + v.AddOptional(dataUri, metaData, content); + v.Add(temporalEvidence); + return new BerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedData.cs.meta new file mode 100644 index 00000000..957a1d5c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e751bd777e44aa74dbd38f3cb1a50108 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedDataParser.cs new file mode 100644 index 00000000..37348625 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedDataParser.cs @@ -0,0 +1,80 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms +{ + public class TimeStampedDataParser + { + private DerInteger version; + private DerIA5String dataUri; + private MetaData metaData; + private Asn1OctetStringParser content; + private Evidence temporalEvidence; + private Asn1SequenceParser parser; + + private TimeStampedDataParser(Asn1SequenceParser parser) + { + this.parser = parser; + this.version = DerInteger.GetInstance(parser.ReadObject()); + + Asn1Object obj = parser.ReadObject().ToAsn1Object(); + + if (obj is DerIA5String) + { + this.dataUri = DerIA5String.GetInstance(obj); + obj = parser.ReadObject().ToAsn1Object(); + } + + if (//obj is MetaData || + obj is Asn1SequenceParser) + { + this.metaData = MetaData.GetInstance(obj.ToAsn1Object()); + obj = parser.ReadObject().ToAsn1Object(); + } + + if (obj is Asn1OctetStringParser) + { + this.content = (Asn1OctetStringParser)obj; + } + } + + public static TimeStampedDataParser GetInstance(object obj) + { + if (obj is Asn1Sequence) + return new TimeStampedDataParser(((Asn1Sequence)obj).Parser); + + if (obj is Asn1SequenceParser) + return new TimeStampedDataParser((Asn1SequenceParser)obj); + + return null; + } + + public virtual DerIA5String DataUri + { + get { return dataUri; } + } + + public virtual MetaData MetaData + { + get { return metaData; } + } + + public virtual Asn1OctetStringParser Content + { + get { return content; } + } + + public virtual Evidence GetTemporalEvidence() + { + if (temporalEvidence == null) + { + temporalEvidence = Evidence.GetInstance(parser.ReadObject().ToAsn1Object()); + } + + return temporalEvidence; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedDataParser.cs.meta new file mode 100644 index 00000000..12bc328c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/TimeStampedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ee0a6768d4e72e40b64486cfe1efff9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc.meta new file mode 100644 index 00000000..c9e909c4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce6f9ee43d9bc864dae54bd548ed363e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc/MQVuserKeyingMaterial.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc/MQVuserKeyingMaterial.cs new file mode 100644 index 00000000..601dc249 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc/MQVuserKeyingMaterial.cs @@ -0,0 +1,109 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Ecc +{ + public class MQVuserKeyingMaterial + : Asn1Encodable + { + private OriginatorPublicKey ephemeralPublicKey; + private Asn1OctetString addedukm; + + public MQVuserKeyingMaterial( + OriginatorPublicKey ephemeralPublicKey, + Asn1OctetString addedukm) + { + // TODO Check ephemeralPublicKey not null + + this.ephemeralPublicKey = ephemeralPublicKey; + this.addedukm = addedukm; + } + + private MQVuserKeyingMaterial( + Asn1Sequence seq) + { + // TODO Check seq has either 1 or 2 elements + + this.ephemeralPublicKey = OriginatorPublicKey.GetInstance(seq[0]); + + if (seq.Count > 1) + { + this.addedukm = Asn1OctetString.GetInstance( + (Asn1TaggedObject)seq[1], true); + } + } + + /** + * return an AuthEnvelopedData object from a tagged object. + * + * @param obj the tagged object holding the object we want. + * @param isExplicit true if the object is meant to be explicitly + * tagged false otherwise. + * @throws ArgumentException if the object held by the + * tagged object cannot be converted. + */ + public static MQVuserKeyingMaterial GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * return an AuthEnvelopedData object from the given object. + * + * @param obj the object we want converted. + * @throws ArgumentException if the object cannot be converted. + */ + public static MQVuserKeyingMaterial GetInstance( + object obj) + { + if (obj == null || obj is MQVuserKeyingMaterial) + { + return (MQVuserKeyingMaterial)obj; + } + + if (obj is Asn1Sequence) + { + return new MQVuserKeyingMaterial((Asn1Sequence)obj); + } + + throw new ArgumentException("Invalid MQVuserKeyingMaterial: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public OriginatorPublicKey EphemeralPublicKey + { + get { return ephemeralPublicKey; } + } + + public Asn1OctetString AddedUkm + { + get { return addedukm; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+		* MQVuserKeyingMaterial ::= SEQUENCE {
+		*   ephemeralPublicKey OriginatorPublicKey,
+		*   addedukm [0] EXPLICIT UserKeyingMaterial OPTIONAL  }
+		* 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(ephemeralPublicKey); + + if (addedukm != null) + { + v.Add(new DerTaggedObject(true, 0, addedukm)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc/MQVuserKeyingMaterial.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc/MQVuserKeyingMaterial.cs.meta new file mode 100644 index 00000000..7eb5ff7f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cms/ecc/MQVuserKeyingMaterial.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 695997000ded4e642af4ecb0946fb50b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf.meta new file mode 100644 index 00000000..e8283793 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 421265fb97e2f904fb773f0f014a9ba1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/AttributeTypeAndValue.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/AttributeTypeAndValue.cs new file mode 100644 index 00000000..f79f0f5e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/AttributeTypeAndValue.cs @@ -0,0 +1,72 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class AttributeTypeAndValue + : Asn1Encodable + { + private readonly DerObjectIdentifier type; + private readonly Asn1Encodable value; + + private AttributeTypeAndValue(Asn1Sequence seq) + { + type = (DerObjectIdentifier)seq[0]; + value = (Asn1Encodable)seq[1]; + } + + public static AttributeTypeAndValue GetInstance(object obj) + { + if (obj is AttributeTypeAndValue) + return (AttributeTypeAndValue)obj; + + if (obj is Asn1Sequence) + return new AttributeTypeAndValue((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public AttributeTypeAndValue( + String oid, + Asn1Encodable value) + : this(new DerObjectIdentifier(oid), value) + { + } + + public AttributeTypeAndValue( + DerObjectIdentifier type, + Asn1Encodable value) + { + this.type = type; + this.value = value; + } + + public virtual DerObjectIdentifier Type + { + get { return type; } + } + + public virtual Asn1Encodable Value + { + get { return value; } + } + + /** + *
+         * AttributeTypeAndValue ::= SEQUENCE {
+         *           type         OBJECT IDENTIFIER,
+         *           value        ANY DEFINED BY type }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(type, value); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/AttributeTypeAndValue.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/AttributeTypeAndValue.cs.meta new file mode 100644 index 00000000..ad14e705 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/AttributeTypeAndValue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 653f45c93caaf0442ada642dbd511ee5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertId.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertId.cs new file mode 100644 index 00000000..d81a2be6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertId.cs @@ -0,0 +1,63 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class CertId + : Asn1Encodable + { + private readonly GeneralName issuer; + private readonly DerInteger serialNumber; + + private CertId(Asn1Sequence seq) + { + issuer = GeneralName.GetInstance(seq[0]); + serialNumber = DerInteger.GetInstance(seq[1]); + } + + public static CertId GetInstance(object obj) + { + if (obj is CertId) + return (CertId)obj; + + if (obj is Asn1Sequence) + return new CertId((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static CertId GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + public virtual GeneralName Issuer + { + get { return issuer; } + } + + public virtual DerInteger SerialNumber + { + get { return serialNumber; } + } + + /** + *
+         * CertId ::= SEQUENCE {
+         *                 issuer           GeneralName,
+         *                 serialNumber     INTEGER }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(issuer, serialNumber); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertId.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertId.cs.meta new file mode 100644 index 00000000..ce0be9b1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e5ffe9cc9bcb1740b2f4820f8252006 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMessages.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMessages.cs new file mode 100644 index 00000000..86d90b17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMessages.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class CertReqMessages + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private CertReqMessages(Asn1Sequence seq) + { + content = seq; + } + + public static CertReqMessages GetInstance(object obj) + { + if (obj is CertReqMessages) + return (CertReqMessages)obj; + + if (obj is Asn1Sequence) + return new CertReqMessages((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public CertReqMessages(params CertReqMsg[] msgs) + { + content = new DerSequence(msgs); + } + + public virtual CertReqMsg[] ToCertReqMsgArray() + { + CertReqMsg[] result = new CertReqMsg[content.Count]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = CertReqMsg.GetInstance(content[i]); + } + return result; + } + + /** + *
+         * CertReqMessages ::= SEQUENCE SIZE (1..MAX) OF CertReqMsg
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMessages.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMessages.cs.meta new file mode 100644 index 00000000..afef5ea4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMessages.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82200b023ea804a49b04c3f12be1db36 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMsg.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMsg.cs new file mode 100644 index 00000000..0f6168d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMsg.cs @@ -0,0 +1,116 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class CertReqMsg + : Asn1Encodable + { + private readonly CertRequest certReq; + private readonly ProofOfPossession popo; + private readonly Asn1Sequence regInfo; + + private CertReqMsg(Asn1Sequence seq) + { + certReq = CertRequest.GetInstance(seq[0]); + + for (int pos = 1; pos < seq.Count; ++pos) + { + object o = seq[pos]; + + if (o is Asn1TaggedObject || o is ProofOfPossession) + { + popo = ProofOfPossession.GetInstance(o); + } + else + { + regInfo = Asn1Sequence.GetInstance(o); + } + } + } + + public static CertReqMsg GetInstance(object obj) + { + if (obj is CertReqMsg) + return (CertReqMsg)obj; + + if (obj != null) + return new CertReqMsg(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public static CertReqMsg GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * Creates a new CertReqMsg. + * @param certReq CertRequest + * @param popo may be null + * @param regInfo may be null + */ + public CertReqMsg( + CertRequest certReq, + ProofOfPossession popo, + AttributeTypeAndValue[] regInfo) + { + if (certReq == null) + throw new ArgumentNullException("certReq"); + + this.certReq = certReq; + this.popo = popo; + + if (regInfo != null) + { + this.regInfo = new DerSequence(regInfo); + } + } + + public virtual CertRequest CertReq + { + get { return certReq; } + } + + public virtual ProofOfPossession Popo + { + get { return popo; } + } + + public virtual AttributeTypeAndValue[] GetRegInfo() + { + if (regInfo == null) + return null; + + AttributeTypeAndValue[] results = new AttributeTypeAndValue[regInfo.Count]; + for (int i = 0; i != results.Length; ++i) + { + results[i] = AttributeTypeAndValue.GetInstance(regInfo[i]); + } + return results; + } + + /** + *
+         * CertReqMsg ::= SEQUENCE {
+         *                    certReq   CertRequest,
+         *                    pop       ProofOfPossession  OPTIONAL,
+         *                    -- content depends upon key type
+         *                    regInfo   SEQUENCE SIZE(1..MAX) OF AttributeTypeAndValue OPTIONAL }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certReq); + v.AddOptional(popo, regInfo); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMsg.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMsg.cs.meta new file mode 100644 index 00000000..ce323858 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertReqMsg.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e659fe800c14c834ebea2ba531c24f69 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertRequest.cs new file mode 100644 index 00000000..75756d9f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertRequest.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class CertRequest + : Asn1Encodable + { + private readonly DerInteger certReqId; + private readonly CertTemplate certTemplate; + private readonly Controls controls; + + private CertRequest(Asn1Sequence seq) + { + certReqId = DerInteger.GetInstance(seq[0]); + certTemplate = CertTemplate.GetInstance(seq[1]); + if (seq.Count > 2) + { + controls = Controls.GetInstance(seq[2]); + } + } + + public static CertRequest GetInstance(object obj) + { + if (obj is CertRequest) + return (CertRequest)obj; + + if (obj != null) + return new CertRequest(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public CertRequest( + int certReqId, + CertTemplate certTemplate, + Controls controls) + : this(new DerInteger(certReqId), certTemplate, controls) + { + } + + public CertRequest( + DerInteger certReqId, + CertTemplate certTemplate, + Controls controls) + { + this.certReqId = certReqId; + this.certTemplate = certTemplate; + this.controls = controls; + } + + public virtual DerInteger CertReqID + { + get { return certReqId; } + } + + public virtual CertTemplate CertTemplate + { + get { return certTemplate; } + } + + public virtual Controls Controls + { + get { return controls; } + } + + /** + *
+         * CertRequest ::= SEQUENCE {
+         *                      certReqId     INTEGER,          -- ID for matching request and reply
+         *                      certTemplate  CertTemplate,  -- Selected fields of cert to be issued
+         *                      controls      Controls OPTIONAL }   -- Attributes affecting issuance
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certReqId, certTemplate); + v.AddOptional(controls); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertRequest.cs.meta new file mode 100644 index 00000000..1921aac2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a580e44b515af04394c93a780461f39 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplate.cs new file mode 100644 index 00000000..dd71f914 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplate.cs @@ -0,0 +1,153 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class CertTemplate + : Asn1Encodable + { + private readonly Asn1Sequence seq; + + private readonly DerInteger version; + private readonly DerInteger serialNumber; + private readonly AlgorithmIdentifier signingAlg; + private readonly X509Name issuer; + private readonly OptionalValidity validity; + private readonly X509Name subject; + private readonly SubjectPublicKeyInfo publicKey; + private readonly DerBitString issuerUID; + private readonly DerBitString subjectUID; + private readonly X509Extensions extensions; + + private CertTemplate(Asn1Sequence seq) + { + this.seq = seq; + + foreach (Asn1TaggedObject tObj in seq) + { + switch (tObj.TagNo) + { + case 0: + version = DerInteger.GetInstance(tObj, false); + break; + case 1: + serialNumber = DerInteger.GetInstance(tObj, false); + break; + case 2: + signingAlg = AlgorithmIdentifier.GetInstance(tObj, false); + break; + case 3: + issuer = X509Name.GetInstance(tObj, true); // CHOICE + break; + case 4: + validity = OptionalValidity.GetInstance(Asn1Sequence.GetInstance(tObj, false)); + break; + case 5: + subject = X509Name.GetInstance(tObj, true); // CHOICE + break; + case 6: + publicKey = SubjectPublicKeyInfo.GetInstance(tObj, false); + break; + case 7: + issuerUID = DerBitString.GetInstance(tObj, false); + break; + case 8: + subjectUID = DerBitString.GetInstance(tObj, false); + break; + case 9: + extensions = X509Extensions.GetInstance(tObj, false); + break; + default: + throw new ArgumentException("unknown tag: " + tObj.TagNo, "seq"); + } + } + } + + public static CertTemplate GetInstance(object obj) + { + if (obj is CertTemplate) + return (CertTemplate)obj; + + if (obj != null) + return new CertTemplate(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public virtual int Version + { + get { return version.Value.IntValue; } + } + + public virtual DerInteger SerialNumber + { + get { return serialNumber; } + } + + public virtual AlgorithmIdentifier SigningAlg + { + get { return signingAlg; } + } + + public virtual X509Name Issuer + { + get { return issuer; } + } + + public virtual OptionalValidity Validity + { + get { return validity; } + } + + public virtual X509Name Subject + { + get { return subject; } + } + + public virtual SubjectPublicKeyInfo PublicKey + { + get { return publicKey; } + } + + public virtual DerBitString IssuerUID + { + get { return issuerUID; } + } + + public virtual DerBitString SubjectUID + { + get { return subjectUID; } + } + + public virtual X509Extensions Extensions + { + get { return extensions; } + } + + /** + *
+         *  CertTemplate ::= SEQUENCE {
+         *      version      [0] Version               OPTIONAL,
+         *      serialNumber [1] INTEGER               OPTIONAL,
+         *      signingAlg   [2] AlgorithmIdentifier   OPTIONAL,
+         *      issuer       [3] Name                  OPTIONAL,
+         *      validity     [4] OptionalValidity      OPTIONAL,
+         *      subject      [5] Name                  OPTIONAL,
+         *      publicKey    [6] SubjectPublicKeyInfo  OPTIONAL,
+         *      issuerUID    [7] UniqueIdentifier      OPTIONAL,
+         *      subjectUID   [8] UniqueIdentifier      OPTIONAL,
+         *      extensions   [9] Extensions            OPTIONAL }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return seq; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplate.cs.meta new file mode 100644 index 00000000..a151e129 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a82a7af9b79d84b4fa7520bc051a97b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplateBuilder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplateBuilder.cs new file mode 100644 index 00000000..9f641465 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplateBuilder.cs @@ -0,0 +1,129 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class CertTemplateBuilder + { + private DerInteger version; + private DerInteger serialNumber; + private AlgorithmIdentifier signingAlg; + private X509Name issuer; + private OptionalValidity validity; + private X509Name subject; + private SubjectPublicKeyInfo publicKey; + private DerBitString issuerUID; + private DerBitString subjectUID; + private X509Extensions extensions; + + /** Sets the X.509 version. Note: for X509v3, use 2 here. */ + public virtual CertTemplateBuilder SetVersion(int ver) + { + version = new DerInteger(ver); + return this; + } + + public virtual CertTemplateBuilder SetSerialNumber(DerInteger ser) + { + serialNumber = ser; + return this; + } + + public virtual CertTemplateBuilder SetSigningAlg(AlgorithmIdentifier aid) + { + signingAlg = aid; + return this; + } + + public virtual CertTemplateBuilder SetIssuer(X509Name name) + { + issuer = name; + return this; + } + + public virtual CertTemplateBuilder SetValidity(OptionalValidity v) + { + validity = v; + return this; + } + + public virtual CertTemplateBuilder SetSubject(X509Name name) + { + subject = name; + return this; + } + + public virtual CertTemplateBuilder SetPublicKey(SubjectPublicKeyInfo spki) + { + publicKey = spki; + return this; + } + + /** Sets the issuer unique ID (deprecated in X.509v3) */ + public virtual CertTemplateBuilder SetIssuerUID(DerBitString uid) + { + issuerUID = uid; + return this; + } + + /** Sets the subject unique ID (deprecated in X.509v3) */ + public virtual CertTemplateBuilder SetSubjectUID(DerBitString uid) + { + subjectUID = uid; + return this; + } + + public virtual CertTemplateBuilder SetExtensions(X509Extensions extens) + { + extensions = extens; + return this; + } + + /** + *
+         *  CertTemplate ::= SEQUENCE {
+         *      version      [0] Version               OPTIONAL,
+         *      serialNumber [1] INTEGER               OPTIONAL,
+         *      signingAlg   [2] AlgorithmIdentifier   OPTIONAL,
+         *      issuer       [3] Name                  OPTIONAL,
+         *      validity     [4] OptionalValidity      OPTIONAL,
+         *      subject      [5] Name                  OPTIONAL,
+         *      publicKey    [6] SubjectPublicKeyInfo  OPTIONAL,
+         *      issuerUID    [7] UniqueIdentifier      OPTIONAL,
+         *      subjectUID   [8] UniqueIdentifier      OPTIONAL,
+         *      extensions   [9] Extensions            OPTIONAL }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public virtual CertTemplate Build() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + AddOptional(v, 0, false, version); + AddOptional(v, 1, false, serialNumber); + AddOptional(v, 2, false, signingAlg); + AddOptional(v, 3, true, issuer); // CHOICE + AddOptional(v, 4, false, validity); + AddOptional(v, 5, true, subject); // CHOICE + AddOptional(v, 6, false, publicKey); + AddOptional(v, 7, false, issuerUID); + AddOptional(v, 8, false, subjectUID); + AddOptional(v, 9, false, extensions); + + return CertTemplate.GetInstance(new DerSequence(v)); + } + + private void AddOptional(Asn1EncodableVector v, int tagNo, bool isExplicit, Asn1Encodable obj) + { + if (obj != null) + { + v.Add(new DerTaggedObject(isExplicit, tagNo, obj)); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplateBuilder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplateBuilder.cs.meta new file mode 100644 index 00000000..bf97106c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CertTemplateBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4bf113698405148429bc8b161fb67386 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/Controls.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/Controls.cs new file mode 100644 index 00000000..293336d5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/Controls.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class Controls + : Asn1Encodable + { + private readonly Asn1Sequence content; + + private Controls(Asn1Sequence seq) + { + content = seq; + } + + public static Controls GetInstance(object obj) + { + if (obj is Controls) + return (Controls)obj; + + if (obj is Asn1Sequence) + return new Controls((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public Controls(params AttributeTypeAndValue[] atvs) + { + content = new DerSequence(atvs); + } + + public virtual AttributeTypeAndValue[] ToAttributeTypeAndValueArray() + { + AttributeTypeAndValue[] result = new AttributeTypeAndValue[content.Count]; + for (int i = 0; i != result.Length; ++i) + { + result[i] = AttributeTypeAndValue.GetInstance(content[i]); + } + return result; + } + + /** + *
+         * Controls  ::= SEQUENCE SIZE(1..MAX) OF AttributeTypeAndValue
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return content; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/Controls.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/Controls.cs.meta new file mode 100644 index 00000000..fe1cb5a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/Controls.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5127d8b9ccfe5f142a48aa88de23eda0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CrmfObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CrmfObjectIdentifiers.cs new file mode 100644 index 00000000..603d5a1a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CrmfObjectIdentifiers.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public abstract class CrmfObjectIdentifiers + { + public static readonly DerObjectIdentifier id_pkix = new DerObjectIdentifier("1.3.6.1.5.5.7"); + + // arc for Internet X.509 PKI protocols and their components + + public static readonly DerObjectIdentifier id_pkip = id_pkix.Branch("5"); + + public static readonly DerObjectIdentifier id_regCtrl = id_pkip.Branch("1"); + public static readonly DerObjectIdentifier id_regCtrl_regToken = id_regCtrl.Branch("1"); + public static readonly DerObjectIdentifier id_regCtrl_authenticator = id_regCtrl.Branch("2"); + public static readonly DerObjectIdentifier id_regCtrl_pkiPublicationInfo = id_regCtrl.Branch("3"); + public static readonly DerObjectIdentifier id_regCtrl_pkiArchiveOptions = id_regCtrl.Branch("4"); + + public static readonly DerObjectIdentifier id_ct_encKeyWithID = new DerObjectIdentifier(PkcsObjectIdentifiers.IdCT + ".21"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CrmfObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CrmfObjectIdentifiers.cs.meta new file mode 100644 index 00000000..d54f6331 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/CrmfObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56f2b5350cd59b64e9acf4ebddec88d3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncKeyWithID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncKeyWithID.cs new file mode 100644 index 00000000..bf774b1e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncKeyWithID.cs @@ -0,0 +1,107 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class EncKeyWithID + : Asn1Encodable + { + private readonly PrivateKeyInfo privKeyInfo; + private readonly Asn1Encodable identifier; + + public static EncKeyWithID GetInstance(object obj) + { + if (obj is EncKeyWithID) + return (EncKeyWithID)obj; + + if (obj != null) + return new EncKeyWithID(Asn1Sequence.GetInstance(obj)); + + return null; + } + + private EncKeyWithID(Asn1Sequence seq) + { + this.privKeyInfo = PrivateKeyInfo.GetInstance(seq[0]); + + if (seq.Count > 1) + { + if (!(seq[1] is DerUtf8String)) + { + this.identifier = GeneralName.GetInstance(seq[1]); + } + else + { + this.identifier = (Asn1Encodable)seq[1]; + } + } + else + { + this.identifier = null; + } + } + + public EncKeyWithID(PrivateKeyInfo privKeyInfo) + { + this.privKeyInfo = privKeyInfo; + this.identifier = null; + } + + public EncKeyWithID(PrivateKeyInfo privKeyInfo, DerUtf8String str) + { + this.privKeyInfo = privKeyInfo; + this.identifier = str; + } + + public EncKeyWithID(PrivateKeyInfo privKeyInfo, GeneralName generalName) + { + this.privKeyInfo = privKeyInfo; + this.identifier = generalName; + } + + public virtual PrivateKeyInfo PrivateKey + { + get { return privKeyInfo; } + } + + public virtual bool HasIdentifier + { + get { return identifier != null; } + } + + public virtual bool IsIdentifierUtf8String + { + get { return identifier is DerUtf8String; } + } + + public virtual Asn1Encodable Identifier + { + get { return identifier; } + } + + /** + *
+         * EncKeyWithID ::= SEQUENCE {
+         *      privateKey           PrivateKeyInfo,
+         *      identifier CHOICE {
+         *         string               UTF8String,
+         *         generalName          GeneralName
+         *     } OPTIONAL
+         * }
+         * 
+ * @return + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(privKeyInfo); + v.AddOptional(identifier); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncKeyWithID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncKeyWithID.cs.meta new file mode 100644 index 00000000..938a172d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncKeyWithID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3d7af5a56b569c4b8bc5a711a1196ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedKey.cs new file mode 100644 index 00000000..6c4a34d5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedKey.cs @@ -0,0 +1,82 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class EncryptedKey + : Asn1Encodable, IAsn1Choice + { + private readonly EnvelopedData envelopedData; + private readonly EncryptedValue encryptedValue; + + public static EncryptedKey GetInstance(object o) + { + if (o is EncryptedKey) + { + return (EncryptedKey)o; + } + else if (o is Asn1TaggedObject) + { + return new EncryptedKey(EnvelopedData.GetInstance((Asn1TaggedObject)o, false)); + } + else if (o is EncryptedValue) + { + return new EncryptedKey((EncryptedValue)o); + } + else + { + return new EncryptedKey(EncryptedValue.GetInstance(o)); + } + } + + public EncryptedKey(EnvelopedData envelopedData) + { + this.envelopedData = envelopedData; + } + + public EncryptedKey(EncryptedValue encryptedValue) + { + this.encryptedValue = encryptedValue; + } + + public virtual bool IsEncryptedValue + { + get { return encryptedValue != null; } + } + + public virtual Asn1Encodable Value + { + get + { + if (encryptedValue != null) + return encryptedValue; + + return envelopedData; + } + } + + /** + *
+         *    EncryptedKey ::= CHOICE {
+         *        encryptedValue        EncryptedValue, -- deprecated
+         *        envelopedData     [0] EnvelopedData }
+         *        -- The encrypted private key MUST be placed in the envelopedData
+         *        -- encryptedContentInfo encryptedContent OCTET STRING.
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + if (encryptedValue != null) + { + return encryptedValue.ToAsn1Object(); + } + + return new DerTaggedObject(false, 0, envelopedData); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedKey.cs.meta new file mode 100644 index 00000000..b8cd1d3f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5dc2937d0f9acaa4aa2371076521984b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedValue.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedValue.cs new file mode 100644 index 00000000..41e9e578 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedValue.cs @@ -0,0 +1,158 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class EncryptedValue + : Asn1Encodable + { + private readonly AlgorithmIdentifier intendedAlg; + private readonly AlgorithmIdentifier symmAlg; + private readonly DerBitString encSymmKey; + private readonly AlgorithmIdentifier keyAlg; + private readonly Asn1OctetString valueHint; + private readonly DerBitString encValue; + + private EncryptedValue(Asn1Sequence seq) + { + int index = 0; + while (seq[index] is Asn1TaggedObject) + { + Asn1TaggedObject tObj = (Asn1TaggedObject)seq[index]; + + switch (tObj.TagNo) + { + case 0: + intendedAlg = AlgorithmIdentifier.GetInstance(tObj, false); + break; + case 1: + symmAlg = AlgorithmIdentifier.GetInstance(tObj, false); + break; + case 2: + encSymmKey = DerBitString.GetInstance(tObj, false); + break; + case 3: + keyAlg = AlgorithmIdentifier.GetInstance(tObj, false); + break; + case 4: + valueHint = Asn1OctetString.GetInstance(tObj, false); + break; + } + ++index; + } + + encValue = DerBitString.GetInstance(seq[index]); + } + + public static EncryptedValue GetInstance(object obj) + { + if (obj is EncryptedValue) + return (EncryptedValue)obj; + + if (obj != null) + return new EncryptedValue(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public EncryptedValue( + AlgorithmIdentifier intendedAlg, + AlgorithmIdentifier symmAlg, + DerBitString encSymmKey, + AlgorithmIdentifier keyAlg, + Asn1OctetString valueHint, + DerBitString encValue) + { + if (encValue == null) + { + throw new ArgumentNullException("encValue"); + } + + this.intendedAlg = intendedAlg; + this.symmAlg = symmAlg; + this.encSymmKey = encSymmKey; + this.keyAlg = keyAlg; + this.valueHint = valueHint; + this.encValue = encValue; + } + + public virtual AlgorithmIdentifier IntendedAlg + { + get { return intendedAlg; } + } + + public virtual AlgorithmIdentifier SymmAlg + { + get { return symmAlg; } + } + + public virtual DerBitString EncSymmKey + { + get { return encSymmKey; } + } + + public virtual AlgorithmIdentifier KeyAlg + { + get { return keyAlg; } + } + + public virtual Asn1OctetString ValueHint + { + get { return valueHint; } + } + + public virtual DerBitString EncValue + { + get { return encValue; } + } + + /** + *
+         * EncryptedValue ::= SEQUENCE {
+         *                     intendedAlg   [0] AlgorithmIdentifier  OPTIONAL,
+         *                     -- the intended algorithm for which the value will be used
+         *                     symmAlg       [1] AlgorithmIdentifier  OPTIONAL,
+         *                     -- the symmetric algorithm used to encrypt the value
+         *                     encSymmKey    [2] BIT STRING           OPTIONAL,
+         *                     -- the (encrypted) symmetric key used to encrypt the value
+         *                     keyAlg        [3] AlgorithmIdentifier  OPTIONAL,
+         *                     -- algorithm used to encrypt the symmetric key
+         *                     valueHint     [4] OCTET STRING         OPTIONAL,
+         *                     -- a brief description or identifier of the encValue content
+         *                     -- (may be meaningful only to the sending entity, and used only
+         *                     -- if EncryptedValue might be re-examined by the sending entity
+         *                     -- in the future)
+         *                     encValue       BIT STRING }
+         *                     -- the encrypted value itself
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + AddOptional(v, 0, intendedAlg); + AddOptional(v, 1, symmAlg); + AddOptional(v, 2, encSymmKey); + AddOptional(v, 3, keyAlg); + AddOptional(v, 4, valueHint); + + v.Add(encValue); + + return new DerSequence(v); + } + + private void AddOptional(Asn1EncodableVector v, int tagNo, Asn1Encodable obj) + { + if (obj != null) + { + v.Add(new DerTaggedObject(false, tagNo, obj)); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedValue.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedValue.cs.meta new file mode 100644 index 00000000..40356f9d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/EncryptedValue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 368e47d04d2ed734fb60cd6268921682 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/OptionalValidity.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/OptionalValidity.cs new file mode 100644 index 00000000..fe1c2061 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/OptionalValidity.cs @@ -0,0 +1,75 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class OptionalValidity + : Asn1Encodable + { + private readonly Time notBefore; + private readonly Time notAfter; + + private OptionalValidity(Asn1Sequence seq) + { + foreach (Asn1TaggedObject tObj in seq) + { + if (tObj.TagNo == 0) + { + notBefore = Time.GetInstance(tObj, true); + } + else + { + notAfter = Time.GetInstance(tObj, true); + } + } + } + + public static OptionalValidity GetInstance(object obj) + { + if (obj == null || obj is OptionalValidity) + return (OptionalValidity)obj; + + return new OptionalValidity(Asn1Sequence.GetInstance(obj)); + } + + public virtual Time NotBefore + { + get { return notBefore; } + } + + public virtual Time NotAfter + { + get { return notAfter; } + } + + /** + *
+         * OptionalValidity ::= SEQUENCE {
+         *                        notBefore  [0] Time OPTIONAL,
+         *                        notAfter   [1] Time OPTIONAL } --at least one MUST be present
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (notBefore != null) + { + v.Add(new DerTaggedObject(true, 0, notBefore)); + } + + if (notAfter != null) + { + v.Add(new DerTaggedObject(true, 1, notAfter)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/OptionalValidity.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/OptionalValidity.cs.meta new file mode 100644 index 00000000..360a4554 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/OptionalValidity.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d6de9f44c885f284d97ff26f588e3437 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIArchiveOptions.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIArchiveOptions.cs new file mode 100644 index 00000000..d4a72da6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIArchiveOptions.cs @@ -0,0 +1,111 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class PkiArchiveOptions + : Asn1Encodable, IAsn1Choice + { + public const int encryptedPrivKey = 0; + public const int keyGenParameters = 1; + public const int archiveRemGenPrivKey = 2; + + private readonly Asn1Encodable value; + + public static PkiArchiveOptions GetInstance(object obj) + { + if (obj is PkiArchiveOptions) + return (PkiArchiveOptions)obj; + + if (obj is Asn1TaggedObject) + return new PkiArchiveOptions((Asn1TaggedObject)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private PkiArchiveOptions(Asn1TaggedObject tagged) + { + switch (tagged.TagNo) + { + case encryptedPrivKey: + value = EncryptedKey.GetInstance(tagged.GetObject()); + break; + case keyGenParameters: + value = Asn1OctetString.GetInstance(tagged, false); + break; + case archiveRemGenPrivKey: + value = DerBoolean.GetInstance(tagged, false); + break; + default: + throw new ArgumentException("unknown tag number: " + tagged.TagNo, "tagged"); + } + } + + public PkiArchiveOptions(EncryptedKey encKey) + { + this.value = encKey; + } + + public PkiArchiveOptions(Asn1OctetString keyGenParameters) + { + this.value = keyGenParameters; + } + + public PkiArchiveOptions(bool archiveRemGenPrivKey) + { + this.value = DerBoolean.GetInstance(archiveRemGenPrivKey); + } + + public virtual int Type + { + get + { + if (value is EncryptedKey) + return encryptedPrivKey; + + if (value is Asn1OctetString) + return keyGenParameters; + + return archiveRemGenPrivKey; + } + } + + public virtual Asn1Encodable Value + { + get { return value; } + } + + /** + *
+         *  PkiArchiveOptions ::= CHOICE {
+         *      encryptedPrivKey     [0] EncryptedKey,
+         *      -- the actual value of the private key
+         *      keyGenParameters     [1] KeyGenParameters,
+         *      -- parameters which allow the private key to be re-generated
+         *      archiveRemGenPrivKey [2] BOOLEAN }
+         *      -- set to TRUE if sender wishes receiver to archive the private
+         *      -- key of a key pair that the receiver generates in response to
+         *      -- this request; set to FALSE if no archival is desired.
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + if (value is EncryptedKey) + { + return new DerTaggedObject(true, encryptedPrivKey, value); // choice + } + + if (value is Asn1OctetString) + { + return new DerTaggedObject(false, keyGenParameters, value); + } + + return new DerTaggedObject(false, archiveRemGenPrivKey, value); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIArchiveOptions.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIArchiveOptions.cs.meta new file mode 100644 index 00000000..335884aa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIArchiveOptions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eaa126763652fd9439d5bf4d5b5462b6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIPublicationInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIPublicationInfo.cs new file mode 100644 index 00000000..0f6f4cac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIPublicationInfo.cs @@ -0,0 +1,70 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class PkiPublicationInfo + : Asn1Encodable + { + private readonly DerInteger action; + private readonly Asn1Sequence pubInfos; + + private PkiPublicationInfo(Asn1Sequence seq) + { + action = DerInteger.GetInstance(seq[0]); + pubInfos = Asn1Sequence.GetInstance(seq[1]); + } + + public static PkiPublicationInfo GetInstance(object obj) + { + if (obj is PkiPublicationInfo) + return (PkiPublicationInfo)obj; + + if (obj is Asn1Sequence) + return new PkiPublicationInfo((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual DerInteger Action + { + get { return action; } + } + + public virtual SinglePubInfo[] GetPubInfos() + { + if (pubInfos == null) + return null; + + SinglePubInfo[] results = new SinglePubInfo[pubInfos.Count]; + for (int i = 0; i != results.Length; ++i) + { + results[i] = SinglePubInfo.GetInstance(pubInfos[i]); + } + return results; + } + + /** + *
+         * PkiPublicationInfo ::= SEQUENCE {
+         *                  action     INTEGER {
+         *                                 dontPublish (0),
+         *                                 pleasePublish (1) },
+         *                  pubInfos  SEQUENCE SIZE (1..MAX) OF SinglePubInfo OPTIONAL }
+         * -- pubInfos MUST NOT be present if action is "dontPublish"
+         * -- (if action is "pleasePublish" and pubInfos is omitted,
+         * -- "dontCare" is assumed)
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(action, pubInfos); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIPublicationInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIPublicationInfo.cs.meta new file mode 100644 index 00000000..84c2b54a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKIPublicationInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de4b7fe794a82644eadd8807a60cd8f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKMacValue.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKMacValue.cs new file mode 100644 index 00000000..5d0553ed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKMacValue.cs @@ -0,0 +1,94 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + /** + * Password-based MAC value for use with POPOSigningKeyInput. + */ + public class PKMacValue + : Asn1Encodable + { + private readonly AlgorithmIdentifier algID; + private readonly DerBitString macValue; + + private PKMacValue(Asn1Sequence seq) + { + this.algID = AlgorithmIdentifier.GetInstance(seq[0]); + this.macValue = DerBitString.GetInstance(seq[1]); + } + + public static PKMacValue GetInstance(object obj) + { + if (obj is PKMacValue) + return (PKMacValue)obj; + + if (obj is Asn1Sequence) + return new PKMacValue((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static PKMacValue GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * Creates a new PKMACValue. + * @param params parameters for password-based MAC + * @param value MAC of the DER-encoded SubjectPublicKeyInfo + */ + public PKMacValue( + PbmParameter pbmParams, + DerBitString macValue) + : this(new AlgorithmIdentifier(CmpObjectIdentifiers.passwordBasedMac, pbmParams), macValue) + { + } + + /** + * Creates a new PKMACValue. + * @param aid CMPObjectIdentifiers.passwordBasedMAC, with PBMParameter + * @param value MAC of the DER-encoded SubjectPublicKeyInfo + */ + public PKMacValue( + AlgorithmIdentifier algID, + DerBitString macValue) + { + this.algID = algID; + this.macValue = macValue; + } + + public virtual AlgorithmIdentifier AlgID + { + get { return algID; } + } + + public virtual DerBitString MacValue + { + get { return macValue; } + } + + /** + *
+         * PKMACValue ::= SEQUENCE {
+         *      algId  AlgorithmIdentifier,
+         *      -- algorithm value shall be PasswordBasedMac 1.2.840.113533.7.66.13
+         *      -- parameter value is PBMParameter
+         *      value  BIT STRING }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(algID, macValue); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKMacValue.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKMacValue.cs.meta new file mode 100644 index 00000000..72421417 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PKMacValue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5c2d9623df92ba49b7e5fa1a8da0847 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoPrivKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoPrivKey.cs new file mode 100644 index 00000000..a53773ee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoPrivKey.cs @@ -0,0 +1,88 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class PopoPrivKey + : Asn1Encodable, IAsn1Choice + { + public const int thisMessage = 0; + public const int subsequentMessage = 1; + public const int dhMAC = 2; + public const int agreeMAC = 3; + public const int encryptedKey = 4; + + private readonly int tagNo; + private readonly Asn1Encodable obj; + + private PopoPrivKey(Asn1TaggedObject obj) + { + this.tagNo = obj.TagNo; + + switch (tagNo) + { + case thisMessage: + this.obj = DerBitString.GetInstance(obj, false); + break; + case subsequentMessage: + this.obj = SubsequentMessage.ValueOf(DerInteger.GetInstance(obj, false).Value.IntValue); + break; + case dhMAC: + this.obj = DerBitString.GetInstance(obj, false); + break; + case agreeMAC: + this.obj = PKMacValue.GetInstance(obj, false); + break; + case encryptedKey: + this.obj = EnvelopedData.GetInstance(obj, false); + break; + default: + throw new ArgumentException("unknown tag in PopoPrivKey", "obj"); + } + } + + public static PopoPrivKey GetInstance(Asn1TaggedObject tagged, bool isExplicit) + { + return new PopoPrivKey(Asn1TaggedObject.GetInstance(tagged.GetObject())); + } + + public PopoPrivKey(SubsequentMessage msg) + { + this.tagNo = subsequentMessage; + this.obj = msg; + } + + public virtual int Type + { + get { return tagNo; } + } + + public virtual Asn1Encodable Value + { + get { return obj; } + } + + /** + *
+         * PopoPrivKey ::= CHOICE {
+         *        thisMessage       [0] BIT STRING,         -- Deprecated
+         *         -- possession is proven in this message (which contains the private
+         *         -- key itself (encrypted for the CA))
+         *        subsequentMessage [1] SubsequentMessage,
+         *         -- possession will be proven in a subsequent message
+         *        dhMAC             [2] BIT STRING,         -- Deprecated
+         *        agreeMAC          [3] PKMACValue,
+         *        encryptedKey      [4] EnvelopedData }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerTaggedObject(false, tagNo, obj); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoPrivKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoPrivKey.cs.meta new file mode 100644 index 00000000..53ec0130 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoPrivKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d95dc5442df1cd644ab2f400b01d5596 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKey.cs new file mode 100644 index 00000000..92c0e104 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKey.cs @@ -0,0 +1,120 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class PopoSigningKey + : Asn1Encodable + { + private readonly PopoSigningKeyInput poposkInput; + private readonly AlgorithmIdentifier algorithmIdentifier; + private readonly DerBitString signature; + + private PopoSigningKey(Asn1Sequence seq) + { + int index = 0; + + if (seq[index] is Asn1TaggedObject) + { + Asn1TaggedObject tagObj + = (Asn1TaggedObject) seq[index++]; + if (tagObj.TagNo != 0) + { + throw new ArgumentException( "Unknown PopoSigningKeyInput tag: " + tagObj.TagNo, "seq"); + } + poposkInput = PopoSigningKeyInput.GetInstance(tagObj.GetObject()); + } + algorithmIdentifier = AlgorithmIdentifier.GetInstance(seq[index++]); + signature = DerBitString.GetInstance(seq[index]); + } + + public static PopoSigningKey GetInstance(object obj) + { + if (obj is PopoSigningKey) + return (PopoSigningKey)obj; + + if (obj is Asn1Sequence) + return new PopoSigningKey((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static PopoSigningKey GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * Creates a new Proof of Possession object for a signing key. + * @param poposkIn the PopoSigningKeyInput structure, or null if the + * CertTemplate includes both subject and publicKey values. + * @param aid the AlgorithmIdentifier used to sign the proof of possession. + * @param signature a signature over the DER-encoded value of poposkIn, + * or the DER-encoded value of certReq if poposkIn is null. + */ + public PopoSigningKey( + PopoSigningKeyInput poposkIn, + AlgorithmIdentifier aid, + DerBitString signature) + { + this.poposkInput = poposkIn; + this.algorithmIdentifier = aid; + this.signature = signature; + } + + public virtual PopoSigningKeyInput PoposkInput + { + get { return poposkInput; } + } + + public virtual AlgorithmIdentifier AlgorithmIdentifier + { + get { return algorithmIdentifier; } + } + + public virtual DerBitString Signature + { + get { return signature; } + } + + /** + *
+         * PopoSigningKey ::= SEQUENCE {
+         *                      poposkInput           [0] PopoSigningKeyInput OPTIONAL,
+         *                      algorithmIdentifier   AlgorithmIdentifier,
+         *                      signature             BIT STRING }
+         *  -- The signature (using "algorithmIdentifier") is on the
+         *  -- DER-encoded value of poposkInput.  NOTE: If the CertReqMsg
+         *  -- certReq CertTemplate contains the subject and publicKey values,
+         *  -- then poposkInput MUST be omitted and the signature MUST be
+         *  -- computed on the DER-encoded value of CertReqMsg certReq.  If
+         *  -- the CertReqMsg certReq CertTemplate does not contain the public
+         *  -- key and subject values, then poposkInput MUST be present and
+         *  -- MUST be signed.  This strategy ensures that the public key is
+         *  -- not present in both the poposkInput and CertReqMsg certReq
+         *  -- CertTemplate fields.
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (poposkInput != null) + { + v.Add(new DerTaggedObject(false, 0, poposkInput)); + } + + v.Add(algorithmIdentifier); + v.Add(signature); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKey.cs.meta new file mode 100644 index 00000000..3f372b54 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec8a4d88bfe18d741b1a1b7358aa692e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKeyInput.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKeyInput.cs new file mode 100644 index 00000000..7d7d3507 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKeyInput.cs @@ -0,0 +1,120 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class PopoSigningKeyInput + : Asn1Encodable + { + private readonly GeneralName sender; + private readonly PKMacValue publicKeyMac; + private readonly SubjectPublicKeyInfo publicKey; + + private PopoSigningKeyInput(Asn1Sequence seq) + { + Asn1Encodable authInfo = (Asn1Encodable)seq[0]; + + if (authInfo is Asn1TaggedObject) + { + Asn1TaggedObject tagObj = (Asn1TaggedObject)authInfo; + if (tagObj.TagNo != 0) + { + throw new ArgumentException("Unknown authInfo tag: " + tagObj.TagNo, "seq"); + } + sender = GeneralName.GetInstance(tagObj.GetObject()); + } + else + { + publicKeyMac = PKMacValue.GetInstance(authInfo); + } + + publicKey = SubjectPublicKeyInfo.GetInstance(seq[1]); + } + + public static PopoSigningKeyInput GetInstance(object obj) + { + if (obj is PopoSigningKeyInput) + return (PopoSigningKeyInput)obj; + + if (obj is Asn1Sequence) + return new PopoSigningKeyInput((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** Creates a new PopoSigningKeyInput with sender name as authInfo. */ + public PopoSigningKeyInput( + GeneralName sender, + SubjectPublicKeyInfo spki) + { + this.sender = sender; + this.publicKey = spki; + } + + /** Creates a new PopoSigningKeyInput using password-based MAC. */ + public PopoSigningKeyInput( + PKMacValue pkmac, + SubjectPublicKeyInfo spki) + { + this.publicKeyMac = pkmac; + this.publicKey = spki; + } + + /** Returns the sender field, or null if authInfo is publicKeyMac */ + public virtual GeneralName Sender + { + get { return sender; } + } + + /** Returns the publicKeyMac field, or null if authInfo is sender */ + public virtual PKMacValue PublicKeyMac + { + get { return publicKeyMac; } + } + + public virtual SubjectPublicKeyInfo PublicKey + { + get { return publicKey; } + } + + /** + *
+         * PopoSigningKeyInput ::= SEQUENCE {
+         *        authInfo             CHOICE {
+         *                                 sender              [0] GeneralName,
+         *                                 -- used only if an authenticated identity has been
+         *                                 -- established for the sender (e.g., a DN from a
+         *                                 -- previously-issued and currently-valid certificate
+         *                                 publicKeyMac        PKMacValue },
+         *                                 -- used if no authenticated GeneralName currently exists for
+         *                                 -- the sender; publicKeyMac contains a password-based MAC
+         *                                 -- on the DER-encoded value of publicKey
+         *        publicKey           SubjectPublicKeyInfo }  -- from CertTemplate
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (sender != null) + { + v.Add(new DerTaggedObject(false, 0, sender)); + } + else + { + v.Add(publicKeyMac); + } + + v.Add(publicKey); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKeyInput.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKeyInput.cs.meta new file mode 100644 index 00000000..fe43e4b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/PopoSigningKeyInput.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 905c188ed11f8c7409e765172165a1f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/ProofOfPossession.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/ProofOfPossession.cs new file mode 100644 index 00000000..ad7ccbe3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/ProofOfPossession.cs @@ -0,0 +1,104 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class ProofOfPossession + : Asn1Encodable, IAsn1Choice + { + public const int TYPE_RA_VERIFIED = 0; + public const int TYPE_SIGNING_KEY = 1; + public const int TYPE_KEY_ENCIPHERMENT = 2; + public const int TYPE_KEY_AGREEMENT = 3; + + private readonly int tagNo; + private readonly Asn1Encodable obj; + + private ProofOfPossession(Asn1TaggedObject tagged) + { + tagNo = tagged.TagNo; + switch (tagNo) + { + case 0: + obj = DerNull.Instance; + break; + case 1: + obj = PopoSigningKey.GetInstance(tagged, false); + break; + case 2: + case 3: + obj = PopoPrivKey.GetInstance(tagged, false); + break; + default: + throw new ArgumentException("unknown tag: " + tagNo, "tagged"); + } + } + + public static ProofOfPossession GetInstance(object obj) + { + if (obj is ProofOfPossession) + return (ProofOfPossession)obj; + + if (obj is Asn1TaggedObject) + return new ProofOfPossession((Asn1TaggedObject)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** Creates a ProofOfPossession with type raVerified. */ + public ProofOfPossession() + { + tagNo = TYPE_RA_VERIFIED; + obj = DerNull.Instance; + } + + /** Creates a ProofOfPossession for a signing key. */ + public ProofOfPossession(PopoSigningKey Poposk) + { + tagNo = TYPE_SIGNING_KEY; + obj = Poposk; + } + + /** + * Creates a ProofOfPossession for key encipherment or agreement. + * @param type one of TYPE_KEY_ENCIPHERMENT or TYPE_KEY_AGREEMENT + */ + public ProofOfPossession(int type, PopoPrivKey privkey) + { + tagNo = type; + obj = privkey; + } + + public virtual int Type + { + get { return tagNo; } + } + + public virtual Asn1Encodable Object + { + get { return obj; } + } + + /** + *
+         * ProofOfPossession ::= CHOICE {
+         *                           raVerified        [0] NULL,
+         *                           -- used if the RA has already verified that the requester is in
+         *                           -- possession of the private key
+         *                           signature         [1] PopoSigningKey,
+         *                           keyEncipherment   [2] PopoPrivKey,
+         *                           keyAgreement      [3] PopoPrivKey }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + return new DerTaggedObject(false, tagNo, obj); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/ProofOfPossession.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/ProofOfPossession.cs.meta new file mode 100644 index 00000000..6da78ae5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/ProofOfPossession.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb50e05648077ff4a856c209154b84f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SinglePubInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SinglePubInfo.cs new file mode 100644 index 00000000..8b70a977 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SinglePubInfo.cs @@ -0,0 +1,63 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class SinglePubInfo + : Asn1Encodable + { + private readonly DerInteger pubMethod; + private readonly GeneralName pubLocation; + + private SinglePubInfo(Asn1Sequence seq) + { + pubMethod = DerInteger.GetInstance(seq[0]); + + if (seq.Count == 2) + { + pubLocation = GeneralName.GetInstance(seq[1]); + } + } + + public static SinglePubInfo GetInstance(object obj) + { + if (obj is SinglePubInfo) + return (SinglePubInfo)obj; + + if (obj is Asn1Sequence) + return new SinglePubInfo((Asn1Sequence)obj); + + throw new ArgumentException("Invalid object: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public virtual GeneralName PubLocation + { + get { return pubLocation; } + } + + /** + *
+         * SinglePubInfo ::= SEQUENCE {
+         *        pubMethod    INTEGER {
+         *           dontCare    (0),
+         *           x500        (1),
+         *           web         (2),
+         *           ldap        (3) },
+         *       pubLocation  GeneralName OPTIONAL }
+         * 
+ * @return a basic ASN.1 object representation. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(pubMethod); + v.AddOptional(pubLocation); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SinglePubInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SinglePubInfo.cs.meta new file mode 100644 index 00000000..a9962425 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SinglePubInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da64e834caac97e47b6b3f30da84c27d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SubsequentMessage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SubsequentMessage.cs new file mode 100644 index 00000000..7e8de58b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SubsequentMessage.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Crmf +{ + public class SubsequentMessage + : DerInteger + { + public static readonly SubsequentMessage encrCert = new SubsequentMessage(0); + public static readonly SubsequentMessage challengeResp = new SubsequentMessage(1); + + private SubsequentMessage(int value) + : base(value) + { + } + + public static SubsequentMessage ValueOf(int value) + { + if (value == 0) + return encrCert; + + if (value == 1) + return challengeResp; + + throw new ArgumentException("unknown value: " + value, "value"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SubsequentMessage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SubsequentMessage.cs.meta new file mode 100644 index 00000000..f403b582 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/crmf/SubsequentMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd09675ac9b89194b9672a085f5f546d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro.meta new file mode 100644 index 00000000..0cbcb83a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e3ca23ca4294d3b4b9a88be14d6cde49 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/CryptoProObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/CryptoProObjectIdentifiers.cs new file mode 100644 index 00000000..de57d5c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/CryptoProObjectIdentifiers.cs @@ -0,0 +1,55 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro +{ + public abstract class CryptoProObjectIdentifiers + { + // GOST Algorithms OBJECT IDENTIFIERS : + // { iso(1) member-body(2) ru(643) rans(2) cryptopro(2)} + public const string GostID = "1.2.643.2.2"; + + public static readonly DerObjectIdentifier GostR3411 = new DerObjectIdentifier(GostID + ".9"); + public static readonly DerObjectIdentifier GostR3411Hmac = new DerObjectIdentifier(GostID + ".10"); + + public static readonly DerObjectIdentifier GostR28147Cbc = new DerObjectIdentifier(GostID + ".21"); + + public static readonly DerObjectIdentifier ID_Gost28147_89_CryptoPro_A_ParamSet = new DerObjectIdentifier(GostID + ".31.1"); + + public static readonly DerObjectIdentifier GostR3410x94 = new DerObjectIdentifier(GostID + ".20"); + public static readonly DerObjectIdentifier GostR3410x2001 = new DerObjectIdentifier(GostID + ".19"); + public static readonly DerObjectIdentifier GostR3411x94WithGostR3410x94 = new DerObjectIdentifier(GostID + ".4"); + public static readonly DerObjectIdentifier GostR3411x94WithGostR3410x2001 = new DerObjectIdentifier(GostID + ".3"); + + // { iso(1) member-body(2) ru(643) rans(2) cryptopro(2) hashes(30) } + public static readonly DerObjectIdentifier GostR3411x94CryptoProParamSet = new DerObjectIdentifier(GostID + ".30.1"); + + // { iso(1) member-body(2) ru(643) rans(2) cryptopro(2) signs(32) } + public static readonly DerObjectIdentifier GostR3410x94CryptoProA = new DerObjectIdentifier(GostID + ".32.2"); + public static readonly DerObjectIdentifier GostR3410x94CryptoProB = new DerObjectIdentifier(GostID + ".32.3"); + public static readonly DerObjectIdentifier GostR3410x94CryptoProC = new DerObjectIdentifier(GostID + ".32.4"); + public static readonly DerObjectIdentifier GostR3410x94CryptoProD = new DerObjectIdentifier(GostID + ".32.5"); + + // { iso(1) member-body(2) ru(643) rans(2) cryptopro(2) exchanges(33) } + public static readonly DerObjectIdentifier GostR3410x94CryptoProXchA = new DerObjectIdentifier(GostID + ".33.1"); + public static readonly DerObjectIdentifier GostR3410x94CryptoProXchB = new DerObjectIdentifier(GostID + ".33.2"); + public static readonly DerObjectIdentifier GostR3410x94CryptoProXchC = new DerObjectIdentifier(GostID + ".33.3"); + + //{ iso(1) member-body(2)ru(643) rans(2) cryptopro(2) ecc-signs(35) } + public static readonly DerObjectIdentifier GostR3410x2001CryptoProA = new DerObjectIdentifier(GostID + ".35.1"); + public static readonly DerObjectIdentifier GostR3410x2001CryptoProB = new DerObjectIdentifier(GostID + ".35.2"); + public static readonly DerObjectIdentifier GostR3410x2001CryptoProC = new DerObjectIdentifier(GostID + ".35.3"); + + // { iso(1) member-body(2) ru(643) rans(2) cryptopro(2) ecc-exchanges(36) } + public static readonly DerObjectIdentifier GostR3410x2001CryptoProXchA = new DerObjectIdentifier(GostID + ".36.0"); + public static readonly DerObjectIdentifier GostR3410x2001CryptoProXchB = new DerObjectIdentifier(GostID + ".36.1"); + + public static readonly DerObjectIdentifier GostElSgDH3410Default = new DerObjectIdentifier(GostID + ".36.0"); + public static readonly DerObjectIdentifier GostElSgDH3410x1 = new DerObjectIdentifier(GostID + ".36.1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/CryptoProObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/CryptoProObjectIdentifiers.cs.meta new file mode 100644 index 00000000..df299af7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/CryptoProObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be4c3eced0609684c9f9ffa5a4ddd1c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410NamedCurves.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410NamedCurves.cs new file mode 100644 index 00000000..bd589943 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410NamedCurves.cs @@ -0,0 +1,260 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro +{ + /// + /// Table of the available named parameters for GOST 3410-2001 / 2012. + /// + public sealed class ECGost3410NamedCurves + { + private ECGost3410NamedCurves() + { + } + + internal static readonly IDictionary objIds = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + internal static readonly IDictionary parameters = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + internal static readonly IDictionary names = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static ECGost3410NamedCurves() + { + BigInteger mod_p = new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639319"); + BigInteger mod_q = new BigInteger("115792089237316195423570985008687907853073762908499243225378155805079068850323"); + + FpCurve curve = new FpCurve( + mod_p, // p + new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639316"), // a + new BigInteger("166"), // b + mod_q, BigInteger.One); + + ECDomainParameters ecParams = new ECDomainParameters( + curve, + curve.CreatePoint( + new BigInteger("1"), // x + new BigInteger("64033881142927202683649881450433473985931760268884941288852745803908878638612")), // y + mod_q, BigInteger.One); + + parameters[CryptoProObjectIdentifiers.GostR3410x2001CryptoProA] = ecParams; + + mod_p = new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639319"); + mod_q = new BigInteger("115792089237316195423570985008687907853073762908499243225378155805079068850323"); + + curve = new FpCurve( + mod_p, // p + new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639316"), + new BigInteger("166"), + mod_q, BigInteger.One); + + ecParams = new ECDomainParameters( + curve, + curve.CreatePoint( + new BigInteger("1"), // x + new BigInteger("64033881142927202683649881450433473985931760268884941288852745803908878638612")), // y + mod_q, BigInteger.One); + + parameters[CryptoProObjectIdentifiers.GostR3410x2001CryptoProXchA] = ecParams; + + mod_p = new BigInteger("57896044618658097711785492504343953926634992332820282019728792003956564823193"); //p + mod_q = new BigInteger("57896044618658097711785492504343953927102133160255826820068844496087732066703"); //q + + curve = new FpCurve( + mod_p, // p + new BigInteger("57896044618658097711785492504343953926634992332820282019728792003956564823190"), // a + new BigInteger("28091019353058090096996979000309560759124368558014865957655842872397301267595"), // b + mod_q, BigInteger.One); + + ecParams = new ECDomainParameters( + curve, + curve.CreatePoint( + new BigInteger("1"), // x + new BigInteger("28792665814854611296992347458380284135028636778229113005756334730996303888124")), // y + mod_q, BigInteger.One); + + parameters[CryptoProObjectIdentifiers.GostR3410x2001CryptoProB] = ecParams; + + mod_p = new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502619"); + mod_q = new BigInteger("70390085352083305199547718019018437840920882647164081035322601458352298396601"); + + curve = new FpCurve( + mod_p, // p + new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502616"), + new BigInteger("32858"), + mod_q, BigInteger.One); + + ecParams = new ECDomainParameters( + curve, + curve.CreatePoint( + new BigInteger("0"), + new BigInteger("29818893917731240733471273240314769927240550812383695689146495261604565990247")), + mod_q, BigInteger.One); + + parameters[CryptoProObjectIdentifiers.GostR3410x2001CryptoProXchB] = ecParams; + + mod_p = new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502619"); //p + mod_q = new BigInteger("70390085352083305199547718019018437840920882647164081035322601458352298396601"); //q + curve = new FpCurve( + mod_p, // p + new BigInteger("70390085352083305199547718019018437841079516630045180471284346843705633502616"), // a + new BigInteger("32858"), // b + mod_q, BigInteger.One); + + ecParams = new ECDomainParameters( + curve, + curve.CreatePoint( + new BigInteger("0"), // x + new BigInteger("29818893917731240733471273240314769927240550812383695689146495261604565990247")), // y + mod_q, BigInteger.One); + + parameters[CryptoProObjectIdentifiers.GostR3410x2001CryptoProC] = ecParams; + + //GOST34.10 2012 + mod_p = new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639319"); //p + mod_q = new BigInteger("115792089237316195423570985008687907853073762908499243225378155805079068850323"); //q + curve = new FpCurve( + mod_p, // p + new BigInteger("115792089237316195423570985008687907853269984665640564039457584007913129639316"), // a + new BigInteger("166"), // b + mod_q, BigInteger.One); + + ecParams = new ECDomainParameters( + curve, + curve.CreatePoint( + new BigInteger("1"), // x + new BigInteger("64033881142927202683649881450433473985931760268884941288852745803908878638612")), // y + mod_q, BigInteger.One); + + parameters[RosstandartObjectIdentifiers.id_tc26_gost_3410_12_256_paramSetA] = ecParams; + + mod_p = new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC7",16); //p + mod_q = new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27E69532F48D89116FF22B8D4E0560609B4B38ABFAD2B85DCACDB1411F10B275",16); //q + curve = new FpCurve( + mod_p, // p + new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC4",16), // a + new BigInteger("E8C2505DEDFC86DDC1BD0B2B6667F1DA34B82574761CB0E879BD081CFD0B6265EE3CB090F30D27614CB4574010DA90DD862EF9D4EBEE4761503190785A71C760",16), // b + mod_q, BigInteger.One); + + ecParams = new ECDomainParameters( + curve, + curve.CreatePoint( + new BigInteger("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003"), // x + new BigInteger("7503CFE87A836AE3A61B8816E25450E6CE5E1C93ACF1ABC1778064FDCBEFA921DF1626BE4FD036E93D75E6A50E3A41E98028FE5FC235F5B889A589CB5215F2A4",16)), // y + mod_q, BigInteger.One); + + parameters[RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512_paramSetA] = ecParams; + + mod_p = new BigInteger("8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006F",16); //p + mod_q = new BigInteger("800000000000000000000000000000000000000000000000000000000000000149A1EC142565A545ACFDB77BD9D40CFA8B996712101BEA0EC6346C54374F25BD",16); //q + curve = new FpCurve( + mod_p, // p + new BigInteger("8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006C",16), // a + new BigInteger("687D1B459DC841457E3E06CF6F5E2517B97C7D614AF138BCBF85DC806C4B289F3E965D2DB1416D217F8B276FAD1AB69C50F78BEE1FA3106EFB8CCBC7C5140116",16), // b + mod_q, BigInteger.One); + + ecParams = new ECDomainParameters( + curve, + curve.CreatePoint( + new BigInteger("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002"), // x + new BigInteger("1A8F7EDA389B094C2C071E3647A8940F3C123B697578C213BE6DD9E6C8EC7335DCB228FD1EDF4A39152CBCAAF8C0398828041055F94CEEEC7E21340780FE41BD",16)), // y + mod_q, BigInteger.One); + + parameters[RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512_paramSetB] = ecParams; + + mod_p = new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC7",16); //p + mod_q = new BigInteger("3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC98CDBA46506AB004C33A9FF5147502CC8EDA9E7A769A12694623CEF47F023ED",16); //q + curve = new FpCurve( + mod_p, // p + new BigInteger("DC9203E514A721875485A529D2C722FB187BC8980EB866644DE41C68E143064546E861C0E2C9EDD92ADE71F46FCF50FF2AD97F951FDA9F2A2EB6546F39689BD3",16), // a + new BigInteger("B4C4EE28CEBC6C2C8AC12952CF37F16AC7EFB6A9F69F4B57FFDA2E4F0DE5ADE038CBC2FFF719D2C18DE0284B8BFEF3B52B8CC7A5F5BF0A3C8D2319A5312557E1",16), // b + mod_q, BigInteger.One); + + ecParams = new ECDomainParameters( + curve, + curve.CreatePoint( + new BigInteger("E2E31EDFC23DE7BDEBE241CE593EF5DE2295B7A9CBAEF021D385F7074CEA043AA27272A7AE602BF2A7B9033DB9ED3610C6FB85487EAE97AAC5BC7928C1950148", 16), // x + new BigInteger("F5CE40D95B5EB899ABBCCFF5911CB8577939804D6527378B8C108C3D2090FF9BE18E2D33E3021ED2EF32D85822423B6304F726AA854BAE07D0396E9A9ADDC40F",16)), // y + mod_q, BigInteger.One); + + parameters[RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512_paramSetC] = ecParams; + + objIds["GostR3410-2001-CryptoPro-A"] = CryptoProObjectIdentifiers.GostR3410x2001CryptoProA; + objIds["GostR3410-2001-CryptoPro-B"] = CryptoProObjectIdentifiers.GostR3410x2001CryptoProB; + objIds["GostR3410-2001-CryptoPro-C"] = CryptoProObjectIdentifiers.GostR3410x2001CryptoProC; + objIds["GostR3410-2001-CryptoPro-XchA"] = CryptoProObjectIdentifiers.GostR3410x2001CryptoProXchA; + objIds["GostR3410-2001-CryptoPro-XchB"] = CryptoProObjectIdentifiers.GostR3410x2001CryptoProXchB; + objIds["Tc26-Gost-3410-12-256-paramSetA"] = RosstandartObjectIdentifiers.id_tc26_gost_3410_12_256_paramSetA; + objIds["Tc26-Gost-3410-12-512-paramSetA"] = RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512_paramSetA; + objIds["Tc26-Gost-3410-12-512-paramSetB"] = RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512_paramSetB; + objIds["Tc26-Gost-3410-12-512-paramSetC"] = RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512_paramSetC; + + names[CryptoProObjectIdentifiers.GostR3410x2001CryptoProA] = "GostR3410-2001-CryptoPro-A"; + names[CryptoProObjectIdentifiers.GostR3410x2001CryptoProB] = "GostR3410-2001-CryptoPro-B"; + names[CryptoProObjectIdentifiers.GostR3410x2001CryptoProC] = "GostR3410-2001-CryptoPro-C"; + names[CryptoProObjectIdentifiers.GostR3410x2001CryptoProXchA] = "GostR3410-2001-CryptoPro-XchA"; + names[CryptoProObjectIdentifiers.GostR3410x2001CryptoProXchB] = "GostR3410-2001-CryptoPro-XchB"; + names[RosstandartObjectIdentifiers.id_tc26_gost_3410_12_256_paramSetA] = "Tc26-Gost-3410-12-256-paramSetA"; + names[RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512_paramSetA] = "Tc26-Gost-3410-12-512-paramSetA"; + names[RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512_paramSetB] = "Tc26-Gost-3410-12-512-paramSetB"; + names[RosstandartObjectIdentifiers.id_tc26_gost_3410_12_512_paramSetC] = "Tc26-Gost-3410-12-512-paramSetC"; + } + + /** + * return the ECDomainParameters object for the given OID, null if it + * isn't present. + * + * @param oid an object identifier representing a named parameters, if present. + */ + public static ECDomainParameters GetByOid( + DerObjectIdentifier oid) + { + return (ECDomainParameters) parameters[oid]; + } + + /** + * returns an enumeration containing the name strings for curves + * contained in this structure. + */ + public static IEnumerable Names + { + get { return new EnumerableProxy(names.Values); } + } + + public static ECDomainParameters GetByName( + string name) + { + DerObjectIdentifier oid = (DerObjectIdentifier) objIds[name]; + + if (oid != null) + { + return (ECDomainParameters) parameters[oid]; + } + + return null; + } + + /** + * return the named curve name represented by the given object identifier. + */ + public static string GetName( + DerObjectIdentifier oid) + { + return (string) names[oid]; + } + + public static DerObjectIdentifier GetOid( + string name) + { + return (DerObjectIdentifier) objIds[name]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410NamedCurves.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410NamedCurves.cs.meta new file mode 100644 index 00000000..fc99fb8c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410NamedCurves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 052c30aad96856e439a9a9ac7651d489 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410ParamSetParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410ParamSetParameters.cs new file mode 100644 index 00000000..d3dd5153 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410ParamSetParameters.cs @@ -0,0 +1,91 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro +{ + public class ECGost3410ParamSetParameters + : Asn1Encodable + { + internal readonly DerInteger p, q, a, b, x, y; + + public static ECGost3410ParamSetParameters GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static ECGost3410ParamSetParameters GetInstance( + object obj) + { + if (obj == null || obj is ECGost3410ParamSetParameters) + { + return (ECGost3410ParamSetParameters) obj; + } + + if (obj is Asn1Sequence) + { + return new ECGost3410ParamSetParameters((Asn1Sequence) obj); + } + + throw new ArgumentException("Invalid GOST3410Parameter: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public ECGost3410ParamSetParameters( + BigInteger a, + BigInteger b, + BigInteger p, + BigInteger q, + int x, + BigInteger y) + { + this.a = new DerInteger(a); + this.b = new DerInteger(b); + this.p = new DerInteger(p); + this.q = new DerInteger(q); + this.x = new DerInteger(x); + this.y = new DerInteger(y); + } + + public ECGost3410ParamSetParameters( + Asn1Sequence seq) + { + if (seq.Count != 6) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + this.a = DerInteger.GetInstance(seq[0]); + this.b = DerInteger.GetInstance(seq[1]); + this.p = DerInteger.GetInstance(seq[2]); + this.q = DerInteger.GetInstance(seq[3]); + this.x = DerInteger.GetInstance(seq[4]); + this.y = DerInteger.GetInstance(seq[5]); + } + + public BigInteger P + { + get { return p.PositiveValue; } + } + + public BigInteger Q + { + get { return q.PositiveValue; } + } + + public BigInteger A + { + get { return a.PositiveValue; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(a, b, p, q, x, y); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410ParamSetParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410ParamSetParameters.cs.meta new file mode 100644 index 00000000..b6899d8a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/ECGOST3410ParamSetParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d82ddd5e96adf74ea6f6a4b7a6c4b73 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST28147Parameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST28147Parameters.cs new file mode 100644 index 00000000..fdafea03 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST28147Parameters.cs @@ -0,0 +1,67 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro +{ + public class Gost28147Parameters + : Asn1Encodable + { + private readonly Asn1OctetString iv; + private readonly DerObjectIdentifier paramSet; + + public static Gost28147Parameters GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static Gost28147Parameters GetInstance( + object obj) + { + if (obj == null || obj is Gost28147Parameters) + { + return (Gost28147Parameters) obj; + } + + if (obj is Asn1Sequence) + { + return new Gost28147Parameters((Asn1Sequence) obj); + } + + throw new ArgumentException("Invalid GOST3410Parameter: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + private Gost28147Parameters( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + this.iv = Asn1OctetString.GetInstance(seq[0]); + this.paramSet = DerObjectIdentifier.GetInstance(seq[1]); + } + + /** + *
+         * Gost28147-89-Parameters ::=
+         *               SEQUENCE {
+         *                       iv                   Gost28147-89-IV,
+         *                       encryptionParamSet   OBJECT IDENTIFIER
+         *                }
+         *
+         *   Gost28147-89-IV ::= OCTET STRING (SIZE (8))
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(iv, paramSet); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST28147Parameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST28147Parameters.cs.meta new file mode 100644 index 00000000..50e099c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST28147Parameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f0e78f8f1d25914794542ae98d5a38d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410NamedParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410NamedParameters.cs new file mode 100644 index 00000000..064ad6d4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410NamedParameters.cs @@ -0,0 +1,127 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro +{ + /** + * table of the available named parameters for GOST 3410-94. + */ + public sealed class Gost3410NamedParameters + { + private Gost3410NamedParameters() + { + } + + private static readonly IDictionary objIds = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary parameters = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + private static readonly Gost3410ParamSetParameters cryptoProA = new Gost3410ParamSetParameters( + 1024, + new BigInteger("127021248288932417465907042777176443525787653508916535812817507265705031260985098497423188333483401180925999995120988934130659205614996724254121049274349357074920312769561451689224110579311248812610229678534638401693520013288995000362260684222750813532307004517341633685004541062586971416883686778842537820383"), + new BigInteger("68363196144955700784444165611827252895102170888761442055095051287550314083023"), + new BigInteger("100997906755055304772081815535925224869841082572053457874823515875577147990529272777244152852699298796483356699682842027972896052747173175480590485607134746852141928680912561502802222185647539190902656116367847270145019066794290930185446216399730872221732889830323194097355403213400972588322876850946740663962") + // validationAlgorithm { + // algorithm + // id-GostR3410-94-bBis, + // parameters + // GostR3410-94-ValidationBisParameters: { + // x0 1376285941, + // c 3996757427 + // } + // } + + ); + + private static readonly Gost3410ParamSetParameters cryptoProB = new Gost3410ParamSetParameters( + 1024, + new BigInteger("139454871199115825601409655107690713107041707059928031797758001454375765357722984094124368522288239833039114681648076688236921220737322672160740747771700911134550432053804647694904686120113087816240740184800477047157336662926249423571248823968542221753660143391485680840520336859458494803187341288580489525163"), + new BigInteger("79885141663410976897627118935756323747307951916507639758300472692338873533959"), + new BigInteger("42941826148615804143873447737955502392672345968607143066798112994089471231420027060385216699563848719957657284814898909770759462613437669456364882730370838934791080835932647976778601915343474400961034231316672578686920482194932878633360203384797092684342247621055760235016132614780652761028509445403338652341") + // validationAlgorithm { + // algorithm + // id-GostR3410-94-bBis, + // parameters + // GostR3410-94-ValidationBisParameters: { + // x0 1536654555, + // c 1855361757, + // d 14408629386140014567655 + //4902939282056547857802241461782996702017713059974755104394739915140 + //6115284791024439062735788342744854120601660303926203867703556828005 + //8957203818114895398976594425537561271800850306 + // } + // } + //} + ); + + private static readonly Gost3410ParamSetParameters cryptoProXchA = new Gost3410ParamSetParameters( + 1024, + new BigInteger("142011741597563481196368286022318089743276138395243738762872573441927459393512718973631166078467600360848946623567625795282774719212241929071046134208380636394084512691828894000571524625445295769349356752728956831541775441763139384457191755096847107846595662547942312293338483924514339614727760681880609734239"), + new BigInteger("91771529896554605945588149018382750217296858393520724172743325725474374979801"), + new BigInteger("133531813272720673433859519948319001217942375967847486899482359599369642528734712461590403327731821410328012529253871914788598993103310567744136196364803064721377826656898686468463277710150809401182608770201615324990468332931294920912776241137878030224355746606283971659376426832674269780880061631528163475887") + ); + + static Gost3410NamedParameters() + { + parameters[CryptoProObjectIdentifiers.GostR3410x94CryptoProA] = cryptoProA; + parameters[CryptoProObjectIdentifiers.GostR3410x94CryptoProB] = cryptoProB; + //parameters[CryptoProObjectIdentifiers.GostR3410x94CryptoProC] = cryptoProC; + //parameters[CryptoProObjectIdentifiers.GostR3410x94CryptoProD] = cryptoProD; + parameters[CryptoProObjectIdentifiers.GostR3410x94CryptoProXchA] = cryptoProXchA; + //parameters[CryptoProObjectIdentifiers.GostR3410x94CryptoProXchB] = cryptoProXchA; + //parameters[CryptoProObjectIdentifiers.GostR3410x94CryptoProXchC] = cryptoProXchA; + + objIds["GostR3410-94-CryptoPro-A"] = CryptoProObjectIdentifiers.GostR3410x94CryptoProA; + objIds["GostR3410-94-CryptoPro-B"] = CryptoProObjectIdentifiers.GostR3410x94CryptoProB; + objIds["GostR3410-94-CryptoPro-XchA"] = CryptoProObjectIdentifiers.GostR3410x94CryptoProXchA; + } + + /** + * return the GOST3410ParamSetParameters object for the given OID, null if it + * isn't present. + * + * @param oid an object identifier representing a named parameters, if present. + */ + public static Gost3410ParamSetParameters GetByOid( + DerObjectIdentifier oid) + { + return (Gost3410ParamSetParameters) parameters[oid]; + } + + /** + * returns an enumeration containing the name strings for parameters + * contained in this structure. + */ + public static IEnumerable Names + { + get { return new EnumerableProxy(objIds.Keys); } + } + + public static Gost3410ParamSetParameters GetByName( + string name) + { + DerObjectIdentifier oid = (DerObjectIdentifier) objIds[name]; + + if (oid != null) + { + return (Gost3410ParamSetParameters) parameters[oid]; + } + + return null; + } + + public static DerObjectIdentifier GetOid( + string name) + { + return (DerObjectIdentifier) objIds[name]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410NamedParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410NamedParameters.cs.meta new file mode 100644 index 00000000..0ceafa89 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410NamedParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b57d96c489c54b94c9770abece1115aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410ParamSetParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410ParamSetParameters.cs new file mode 100644 index 00000000..253b63e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410ParamSetParameters.cs @@ -0,0 +1,91 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro +{ + public class Gost3410ParamSetParameters + : Asn1Encodable + { + private readonly int keySize; + private readonly DerInteger p, q, a; + + public static Gost3410ParamSetParameters GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static Gost3410ParamSetParameters GetInstance( + object obj) + { + if (obj == null || obj is Gost3410ParamSetParameters) + { + return (Gost3410ParamSetParameters) obj; + } + + if (obj is Asn1Sequence) + { + return new Gost3410ParamSetParameters((Asn1Sequence) obj); + } + + throw new ArgumentException("Invalid GOST3410Parameter: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public Gost3410ParamSetParameters( + int keySize, + BigInteger p, + BigInteger q, + BigInteger a) + { + this.keySize = keySize; + this.p = new DerInteger(p); + this.q = new DerInteger(q); + this.a = new DerInteger(a); + } + + private Gost3410ParamSetParameters( + Asn1Sequence seq) + { + if (seq.Count != 4) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + this.keySize = DerInteger.GetInstance(seq[0]).Value.IntValue; + this.p = DerInteger.GetInstance(seq[1]); + this.q = DerInteger.GetInstance(seq[2]); + this.a = DerInteger.GetInstance(seq[3]); + } + + public int KeySize + { + get { return keySize; } + } + + public BigInteger P + { + get { return p.PositiveValue; } + } + + public BigInteger Q + { + get { return q.PositiveValue; } + } + + public BigInteger A + { + get { return a.PositiveValue; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(new DerInteger(keySize), p, q, a); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410ParamSetParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410ParamSetParameters.cs.meta new file mode 100644 index 00000000..d22ec4d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410ParamSetParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3aa39c3f91903543994a83200a235d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs new file mode 100644 index 00000000..042338c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs @@ -0,0 +1,96 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro +{ + public class Gost3410PublicKeyAlgParameters + : Asn1Encodable + { + private DerObjectIdentifier publicKeyParamSet; + private DerObjectIdentifier digestParamSet; + private DerObjectIdentifier encryptionParamSet; + + public static Gost3410PublicKeyAlgParameters GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static Gost3410PublicKeyAlgParameters GetInstance( + object obj) + { + if (obj == null || obj is Gost3410PublicKeyAlgParameters) + return (Gost3410PublicKeyAlgParameters)obj; + + return new Gost3410PublicKeyAlgParameters(Asn1Sequence.GetInstance((obj))); + } + + public Gost3410PublicKeyAlgParameters( + DerObjectIdentifier publicKeyParamSet, + DerObjectIdentifier digestParamSet) + : this (publicKeyParamSet, digestParamSet, null) + { + } + + public Gost3410PublicKeyAlgParameters( + DerObjectIdentifier publicKeyParamSet, + DerObjectIdentifier digestParamSet, + DerObjectIdentifier encryptionParamSet) + { + if (publicKeyParamSet == null) + throw new ArgumentNullException("publicKeyParamSet"); + if (digestParamSet == null) + throw new ArgumentNullException("digestParamSet"); + + this.publicKeyParamSet = publicKeyParamSet; + this.digestParamSet = digestParamSet; + this.encryptionParamSet = encryptionParamSet; + } + + public Gost3410PublicKeyAlgParameters( + Asn1Sequence seq) + { + this.publicKeyParamSet = (DerObjectIdentifier) seq[0]; + this.digestParamSet = (DerObjectIdentifier) seq[1]; + + if (seq.Count > 2) + { + this.encryptionParamSet = (DerObjectIdentifier) seq[2]; + } + } + + public DerObjectIdentifier PublicKeyParamSet + { + get { return publicKeyParamSet; } + } + + public DerObjectIdentifier DigestParamSet + { + get { return digestParamSet; } + } + + public DerObjectIdentifier EncryptionParamSet + { + get { return encryptionParamSet; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + publicKeyParamSet, digestParamSet); + + if (encryptionParamSet != null) + { + v.Add(encryptionParamSet); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs.meta new file mode 100644 index 00000000..d38aa73d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/cryptopro/GOST3410PublicKeyAlgParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4780d2370f25ea43972c78a80d65319 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac.meta new file mode 100644 index 00000000..f73ed181 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8ce3259f985df4047a1c6f106d608f93 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac/EACObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac/EACObjectIdentifiers.cs new file mode 100644 index 00000000..4c3aab98 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac/EACObjectIdentifiers.cs @@ -0,0 +1,54 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Eac +{ + public abstract class EacObjectIdentifiers + { + // bsi-de OBJECT IDENTIFIER ::= { + // itu-t(0) identified-organization(4) etsi(0) + // reserved(127) etsi-identified-organization(0) 7 + // } + public static readonly DerObjectIdentifier bsi_de = new DerObjectIdentifier("0.4.0.127.0.7"); + + // id-PK OBJECT IDENTIFIER ::= { + // bsi-de protocols(2) smartcard(2) 1 + // } + public static readonly DerObjectIdentifier id_PK = new DerObjectIdentifier(bsi_de + ".2.2.1"); + + public static readonly DerObjectIdentifier id_PK_DH = new DerObjectIdentifier(id_PK + ".1"); + public static readonly DerObjectIdentifier id_PK_ECDH = new DerObjectIdentifier(id_PK + ".2"); + + // id-CA OBJECT IDENTIFIER ::= { + // bsi-de protocols(2) smartcard(2) 3 + // } + public static readonly DerObjectIdentifier id_CA = new DerObjectIdentifier(bsi_de + ".2.2.3"); + public static readonly DerObjectIdentifier id_CA_DH = new DerObjectIdentifier(id_CA + ".1"); + public static readonly DerObjectIdentifier id_CA_DH_3DES_CBC_CBC = new DerObjectIdentifier(id_CA_DH + ".1"); + public static readonly DerObjectIdentifier id_CA_ECDH = new DerObjectIdentifier(id_CA + ".2"); + public static readonly DerObjectIdentifier id_CA_ECDH_3DES_CBC_CBC = new DerObjectIdentifier(id_CA_ECDH + ".1"); + + // + // id-TA OBJECT IDENTIFIER ::= { + // bsi-de protocols(2) smartcard(2) 2 + // } + public static readonly DerObjectIdentifier id_TA = new DerObjectIdentifier(bsi_de + ".2.2.2"); + + public static readonly DerObjectIdentifier id_TA_RSA = new DerObjectIdentifier(id_TA + ".1"); + public static readonly DerObjectIdentifier id_TA_RSA_v1_5_SHA_1 = new DerObjectIdentifier(id_TA_RSA + ".1"); + public static readonly DerObjectIdentifier id_TA_RSA_v1_5_SHA_256 = new DerObjectIdentifier(id_TA_RSA + ".2"); + public static readonly DerObjectIdentifier id_TA_RSA_PSS_SHA_1 = new DerObjectIdentifier(id_TA_RSA + ".3"); + public static readonly DerObjectIdentifier id_TA_RSA_PSS_SHA_256 = new DerObjectIdentifier(id_TA_RSA + ".4"); + public static readonly DerObjectIdentifier id_TA_ECDSA = new DerObjectIdentifier(id_TA + ".2"); + public static readonly DerObjectIdentifier id_TA_ECDSA_SHA_1 = new DerObjectIdentifier(id_TA_ECDSA + ".1"); + public static readonly DerObjectIdentifier id_TA_ECDSA_SHA_224 = new DerObjectIdentifier(id_TA_ECDSA + ".2"); + public static readonly DerObjectIdentifier id_TA_ECDSA_SHA_256 = new DerObjectIdentifier(id_TA_ECDSA + ".3"); + public static readonly DerObjectIdentifier id_TA_ECDSA_SHA_384 = new DerObjectIdentifier(id_TA_ECDSA + ".4"); + public static readonly DerObjectIdentifier id_TA_ECDSA_SHA_512 = new DerObjectIdentifier(id_TA_ECDSA + ".5"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac/EACObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac/EACObjectIdentifiers.cs.meta new file mode 100644 index 00000000..dc44d662 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/eac/EACObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d0b75271ac3e464f895c2c6ac33791f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec.meta new file mode 100644 index 00000000..6a8a5a8b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be0b3f81fe633d3409f5f425d34c732b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec/EdECObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec/EdECObjectIdentifiers.cs new file mode 100644 index 00000000..14a80855 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec/EdECObjectIdentifiers.cs @@ -0,0 +1,21 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.EdEC +{ + /** + * Edwards Elliptic Curve Object Identifiers (RFC 8410) + */ + public abstract class EdECObjectIdentifiers + { + public static readonly DerObjectIdentifier id_edwards_curve_algs = new DerObjectIdentifier("1.3.101"); + + public static readonly DerObjectIdentifier id_X25519 = id_edwards_curve_algs.Branch("110"); + public static readonly DerObjectIdentifier id_X448 = id_edwards_curve_algs.Branch("111"); + public static readonly DerObjectIdentifier id_Ed25519 = id_edwards_curve_algs.Branch("112"); + public static readonly DerObjectIdentifier id_Ed448 = id_edwards_curve_algs.Branch("113"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec/EdECObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec/EdECObjectIdentifiers.cs.meta new file mode 100644 index 00000000..fd46093c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/edec/EdECObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4dcf91519f9beba449a2e0874fcaeaa4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf.meta new file mode 100644 index 00000000..edc92328 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d9bcda6a2f10b8342b2a8ab4082e7ea7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CertificateValues.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CertificateValues.cs new file mode 100644 index 00000000..33f9f322 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CertificateValues.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.3.1 Certificate Values Attribute Definition + /// + /// CertificateValues ::= SEQUENCE OF Certificate + /// + /// + public class CertificateValues + : Asn1Encodable + { + private readonly Asn1Sequence certificates; + + public static CertificateValues GetInstance( + object obj) + { + if (obj == null || obj is CertificateValues) + return (CertificateValues) obj; + + if (obj is Asn1Sequence) + return new CertificateValues((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'CertificateValues' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private CertificateValues( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + + foreach (Asn1Encodable ae in seq) + { + X509CertificateStructure.GetInstance(ae.ToAsn1Object()); + } + + this.certificates = seq; + } + + public CertificateValues( + params X509CertificateStructure[] certificates) + { + if (certificates == null) + throw new ArgumentNullException("certificates"); + + this.certificates = new DerSequence(certificates); + } + + public CertificateValues( + IEnumerable certificates) + { + if (certificates == null) + throw new ArgumentNullException("certificates"); + if (!CollectionUtilities.CheckElementsAreOfType(certificates, typeof(X509CertificateStructure))) + throw new ArgumentException("Must contain only 'X509CertificateStructure' objects", "certificates"); + + this.certificates = new DerSequence( + Asn1EncodableVector.FromEnumerable(certificates)); + } + + public X509CertificateStructure[] GetCertificates() + { + X509CertificateStructure[] result = new X509CertificateStructure[certificates.Count]; + for (int i = 0; i < certificates.Count; ++i) + { + result[i] = X509CertificateStructure.GetInstance(certificates[i]); + } + return result; + } + + public override Asn1Object ToAsn1Object() + { + return certificates; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CertificateValues.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CertificateValues.cs.meta new file mode 100644 index 00000000..b1c46c5d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CertificateValues.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b9ae83cd7d55f0945a141df25e248c50 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIdentifier.cs new file mode 100644 index 00000000..f027ccd3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIdentifier.cs @@ -0,0 +1,21 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + public abstract class CommitmentTypeIdentifier + { + public static readonly DerObjectIdentifier ProofOfOrigin = PkcsObjectIdentifiers.IdCtiEtsProofOfOrigin; + public static readonly DerObjectIdentifier ProofOfReceipt = PkcsObjectIdentifiers.IdCtiEtsProofOfReceipt; + public static readonly DerObjectIdentifier ProofOfDelivery = PkcsObjectIdentifiers.IdCtiEtsProofOfDelivery; + public static readonly DerObjectIdentifier ProofOfSender = PkcsObjectIdentifiers.IdCtiEtsProofOfSender; + public static readonly DerObjectIdentifier ProofOfApproval = PkcsObjectIdentifiers.IdCtiEtsProofOfApproval; + public static readonly DerObjectIdentifier ProofOfCreation = PkcsObjectIdentifiers.IdCtiEtsProofOfCreation; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIdentifier.cs.meta new file mode 100644 index 00000000..81b2f131 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 336b70d8be7970a4e8de1375f4a75f23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIndication.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIndication.cs new file mode 100644 index 00000000..2b9b8666 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIndication.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + public class CommitmentTypeIndication + : Asn1Encodable + { + private readonly DerObjectIdentifier commitmentTypeId; + private readonly Asn1Sequence commitmentTypeQualifier; + + public static CommitmentTypeIndication GetInstance( + object obj) + { + if (obj == null || obj is CommitmentTypeIndication) + return (CommitmentTypeIndication) obj; + + if (obj is Asn1Sequence) + return new CommitmentTypeIndication((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'CommitmentTypeIndication' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + public CommitmentTypeIndication( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count < 1 || seq.Count > 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.commitmentTypeId = (DerObjectIdentifier) seq[0].ToAsn1Object(); + + if (seq.Count > 1) + { + this.commitmentTypeQualifier = (Asn1Sequence) seq[1].ToAsn1Object(); + } + } + + public CommitmentTypeIndication( + DerObjectIdentifier commitmentTypeId) + : this(commitmentTypeId, null) + { + } + + public CommitmentTypeIndication( + DerObjectIdentifier commitmentTypeId, + Asn1Sequence commitmentTypeQualifier) + { + if (commitmentTypeId == null) + throw new ArgumentNullException("commitmentTypeId"); + + this.commitmentTypeId = commitmentTypeId; + + if (commitmentTypeQualifier != null) + { + this.commitmentTypeQualifier = commitmentTypeQualifier; + } + } + + public DerObjectIdentifier CommitmentTypeID + { + get { return commitmentTypeId; } + } + + public Asn1Sequence CommitmentTypeQualifier + { + get { return commitmentTypeQualifier; } + } + + /** + *
+        * CommitmentTypeIndication ::= SEQUENCE {
+        *      commitmentTypeId   CommitmentTypeIdentifier,
+        *      commitmentTypeQualifier   SEQUENCE SIZE (1..MAX) OF
+        *              CommitmentTypeQualifier OPTIONAL }
+        * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(commitmentTypeId); + + if (commitmentTypeQualifier != null) + { + v.Add(commitmentTypeQualifier); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIndication.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIndication.cs.meta new file mode 100644 index 00000000..affd97b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeIndication.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88bf9f38a14468341ae7a0327e7528eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeQualifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeQualifier.cs new file mode 100644 index 00000000..853337cf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeQualifier.cs @@ -0,0 +1,123 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /** + * Commitment type qualifiers, used in the Commitment-Type-Indication attribute (RFC3126). + * + *
+    *   CommitmentTypeQualifier ::= SEQUENCE {
+    *       commitmentTypeIdentifier  CommitmentTypeIdentifier,
+    *       qualifier          ANY DEFINED BY commitmentTypeIdentifier OPTIONAL }
+    * 
+ */ + public class CommitmentTypeQualifier + : Asn1Encodable + { + private readonly DerObjectIdentifier commitmentTypeIdentifier; + private readonly Asn1Object qualifier; + + /** + * Creates a new CommitmentTypeQualifier instance. + * + * @param commitmentTypeIdentifier a CommitmentTypeIdentifier value + */ + public CommitmentTypeQualifier( + DerObjectIdentifier commitmentTypeIdentifier) + : this(commitmentTypeIdentifier, null) + { + } + + /** + * Creates a new CommitmentTypeQualifier instance. + * + * @param commitmentTypeIdentifier a CommitmentTypeIdentifier value + * @param qualifier the qualifier, defined by the above field. + */ + public CommitmentTypeQualifier( + DerObjectIdentifier commitmentTypeIdentifier, + Asn1Encodable qualifier) + { + if (commitmentTypeIdentifier == null) + throw new ArgumentNullException("commitmentTypeIdentifier"); + + this.commitmentTypeIdentifier = commitmentTypeIdentifier; + + if (qualifier != null) + { + this.qualifier = qualifier.ToAsn1Object(); + } + } + + /** + * Creates a new CommitmentTypeQualifier instance. + * + * @param as CommitmentTypeQualifier structure + * encoded as an Asn1Sequence. + */ + public CommitmentTypeQualifier( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count < 1 || seq.Count > 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + commitmentTypeIdentifier = (DerObjectIdentifier) seq[0].ToAsn1Object(); + + if (seq.Count > 1) + { + qualifier = seq[1].ToAsn1Object(); + } + } + + public static CommitmentTypeQualifier GetInstance( + object obj) + { + if (obj == null || obj is CommitmentTypeQualifier) + return (CommitmentTypeQualifier) obj; + + if (obj is Asn1Sequence) + return new CommitmentTypeQualifier((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'CommitmentTypeQualifier' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + public DerObjectIdentifier CommitmentTypeIdentifier + { + get { return commitmentTypeIdentifier; } + } + + public Asn1Object Qualifier + { + get { return qualifier; } + } + + /** + * Returns a DER-encodable representation of this instance. + * + * @return a Asn1Object value + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + commitmentTypeIdentifier); + + if (qualifier != null) + { + v.Add(qualifier); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeQualifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeQualifier.cs.meta new file mode 100644 index 00000000..bb853651 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CommitmentTypeQualifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2bbf93b7313b2254c9f5fd30c4fbed90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteCertificateRefs.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteCertificateRefs.cs new file mode 100644 index 00000000..77d2612a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteCertificateRefs.cs @@ -0,0 +1,89 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.1 Complete Certificate Refs Attribute Definition + /// + /// CompleteCertificateRefs ::= SEQUENCE OF OtherCertID + /// + /// + public class CompleteCertificateRefs + : Asn1Encodable + { + private readonly Asn1Sequence otherCertIDs; + + public static CompleteCertificateRefs GetInstance( + object obj) + { + if (obj == null || obj is CompleteCertificateRefs) + return (CompleteCertificateRefs) obj; + + if (obj is Asn1Sequence) + return new CompleteCertificateRefs((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'CompleteCertificateRefs' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private CompleteCertificateRefs( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + + foreach (Asn1Encodable ae in seq) + { + OtherCertID.GetInstance(ae.ToAsn1Object()); + } + + this.otherCertIDs = seq; + } + + public CompleteCertificateRefs( + params OtherCertID[] otherCertIDs) + { + if (otherCertIDs == null) + throw new ArgumentNullException("otherCertIDs"); + + this.otherCertIDs = new DerSequence(otherCertIDs); + } + + public CompleteCertificateRefs( + IEnumerable otherCertIDs) + { + if (otherCertIDs == null) + throw new ArgumentNullException("otherCertIDs"); + if (!CollectionUtilities.CheckElementsAreOfType(otherCertIDs, typeof(OtherCertID))) + throw new ArgumentException("Must contain only 'OtherCertID' objects", "otherCertIDs"); + + this.otherCertIDs = new DerSequence( + Asn1EncodableVector.FromEnumerable(otherCertIDs)); + } + + public OtherCertID[] GetOtherCertIDs() + { + OtherCertID[] result = new OtherCertID[otherCertIDs.Count]; + for (int i = 0; i < otherCertIDs.Count; ++i) + { + result[i] = OtherCertID.GetInstance(otherCertIDs[i].ToAsn1Object()); + } + return result; + } + + public override Asn1Object ToAsn1Object() + { + return otherCertIDs; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteCertificateRefs.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteCertificateRefs.cs.meta new file mode 100644 index 00000000..ceabad5a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteCertificateRefs.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78cb9237027ea2145a39723f2c83ee4a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteRevocationRefs.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteRevocationRefs.cs new file mode 100644 index 00000000..2d08f216 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteRevocationRefs.cs @@ -0,0 +1,89 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + /// + /// CompleteRevocationRefs ::= SEQUENCE OF CrlOcspRef + /// + /// + public class CompleteRevocationRefs + : Asn1Encodable + { + private readonly Asn1Sequence crlOcspRefs; + + public static CompleteRevocationRefs GetInstance( + object obj) + { + if (obj == null || obj is CompleteRevocationRefs) + return (CompleteRevocationRefs) obj; + + if (obj is Asn1Sequence) + return new CompleteRevocationRefs((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'CompleteRevocationRefs' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private CompleteRevocationRefs( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + + foreach (Asn1Encodable ae in seq) + { + CrlOcspRef.GetInstance(ae.ToAsn1Object()); + } + + this.crlOcspRefs = seq; + } + + public CompleteRevocationRefs( + params CrlOcspRef[] crlOcspRefs) + { + if (crlOcspRefs == null) + throw new ArgumentNullException("crlOcspRefs"); + + this.crlOcspRefs = new DerSequence(crlOcspRefs); + } + + public CompleteRevocationRefs( + IEnumerable crlOcspRefs) + { + if (crlOcspRefs == null) + throw new ArgumentNullException("crlOcspRefs"); + if (!CollectionUtilities.CheckElementsAreOfType(crlOcspRefs, typeof(CrlOcspRef))) + throw new ArgumentException("Must contain only 'CrlOcspRef' objects", "crlOcspRefs"); + + this.crlOcspRefs = new DerSequence( + Asn1EncodableVector.FromEnumerable(crlOcspRefs)); + } + + public CrlOcspRef[] GetCrlOcspRefs() + { + CrlOcspRef[] result = new CrlOcspRef[crlOcspRefs.Count]; + for (int i = 0; i < crlOcspRefs.Count; ++i) + { + result[i] = CrlOcspRef.GetInstance(crlOcspRefs[i].ToAsn1Object()); + } + return result; + } + + public override Asn1Object ToAsn1Object() + { + return crlOcspRefs; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteRevocationRefs.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteRevocationRefs.cs.meta new file mode 100644 index 00000000..fabfa63f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CompleteRevocationRefs.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44f51b37ced10d641ab10e0b68eb8000 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlIdentifier.cs new file mode 100644 index 00000000..b6538cad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlIdentifier.cs @@ -0,0 +1,115 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + /// + /// CrlIdentifier ::= SEQUENCE + /// { + /// crlissuer Name, + /// crlIssuedTime UTCTime, + /// crlNumber INTEGER OPTIONAL + /// } + /// + /// + public class CrlIdentifier + : Asn1Encodable + { + private readonly X509Name crlIssuer; + private readonly DerUtcTime crlIssuedTime; + private readonly DerInteger crlNumber; + + public static CrlIdentifier GetInstance( + object obj) + { + if (obj == null || obj is CrlIdentifier) + return (CrlIdentifier) obj; + + if (obj is Asn1Sequence) + return new CrlIdentifier((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'CrlIdentifier' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private CrlIdentifier( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count < 2 || seq.Count > 3) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.crlIssuer = X509Name.GetInstance(seq[0]); + this.crlIssuedTime = DerUtcTime.GetInstance(seq[1]); + + if (seq.Count > 2) + { + this.crlNumber = DerInteger.GetInstance(seq[2]); + } + } + + public CrlIdentifier( + X509Name crlIssuer, + DateTime crlIssuedTime) + : this(crlIssuer, crlIssuedTime, null) + { + } + + public CrlIdentifier( + X509Name crlIssuer, + DateTime crlIssuedTime, + BigInteger crlNumber) + { + if (crlIssuer == null) + throw new ArgumentNullException("crlIssuer"); + + this.crlIssuer = crlIssuer; + this.crlIssuedTime = new DerUtcTime(crlIssuedTime); + + if (crlNumber != null) + { + this.crlNumber = new DerInteger(crlNumber); + } + } + + public X509Name CrlIssuer + { + get { return crlIssuer; } + } + + public DateTime CrlIssuedTime + { + get { return crlIssuedTime.ToAdjustedDateTime(); } + } + + public BigInteger CrlNumber + { + get { return crlNumber == null ? null : crlNumber.Value; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + crlIssuer.ToAsn1Object(), crlIssuedTime); + + if (crlNumber != null) + { + v.Add(crlNumber); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlIdentifier.cs.meta new file mode 100644 index 00000000..14305b17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8b9bbf1d7e684f84fbd58f13c3f2334a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlListID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlListID.cs new file mode 100644 index 00000000..c055fc3d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlListID.cs @@ -0,0 +1,94 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + /// + /// CRLListID ::= SEQUENCE + /// { + /// crls SEQUENCE OF CrlValidatedID + /// } + /// + /// + public class CrlListID + : Asn1Encodable + { + private readonly Asn1Sequence crls; + + public static CrlListID GetInstance( + object obj) + { + if (obj == null || obj is CrlListID) + return (CrlListID) obj; + + if (obj is Asn1Sequence) + return new CrlListID((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'CrlListID' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private CrlListID( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count != 1) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.crls = (Asn1Sequence) seq[0].ToAsn1Object(); + + foreach (Asn1Encodable ae in this.crls) + { + CrlValidatedID.GetInstance(ae.ToAsn1Object()); + } + } + + public CrlListID( + params CrlValidatedID[] crls) + { + if (crls == null) + throw new ArgumentNullException("crls"); + + this.crls = new DerSequence(crls); + } + + public CrlListID( + IEnumerable crls) + { + if (crls == null) + throw new ArgumentNullException("crls"); + if (!CollectionUtilities.CheckElementsAreOfType(crls, typeof(CrlValidatedID))) + throw new ArgumentException("Must contain only 'CrlValidatedID' objects", "crls"); + + this.crls = new DerSequence( + Asn1EncodableVector.FromEnumerable(crls)); + } + + public CrlValidatedID[] GetCrls() + { + CrlValidatedID[] result = new CrlValidatedID[crls.Count]; + for (int i = 0; i < crls.Count; ++i) + { + result[i] = CrlValidatedID.GetInstance(crls[i].ToAsn1Object()); + } + return result; + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(crls); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlListID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlListID.cs.meta new file mode 100644 index 00000000..43bcfff0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlListID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0548220571862154a81c0e79a075edce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlOcspRef.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlOcspRef.cs new file mode 100644 index 00000000..32d75354 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlOcspRef.cs @@ -0,0 +1,117 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + /// + /// CrlOcspRef ::= SEQUENCE { + /// crlids [0] CRLListID OPTIONAL, + /// ocspids [1] OcspListID OPTIONAL, + /// otherRev [2] OtherRevRefs OPTIONAL + /// } + /// + /// + public class CrlOcspRef + : Asn1Encodable + { + private readonly CrlListID crlids; + private readonly OcspListID ocspids; + private readonly OtherRevRefs otherRev; + + public static CrlOcspRef GetInstance( + object obj) + { + if (obj == null || obj is CrlOcspRef) + return (CrlOcspRef) obj; + + if (obj is Asn1Sequence) + return new CrlOcspRef((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'CrlOcspRef' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private CrlOcspRef( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + + foreach (Asn1TaggedObject taggedObj in seq) + { + Asn1Object asn1Obj = taggedObj.GetObject(); + + switch (taggedObj.TagNo) + { + case 0: + this.crlids = CrlListID.GetInstance(asn1Obj); + break; + case 1: + this.ocspids = OcspListID.GetInstance(asn1Obj); + break; + case 2: + this.otherRev = OtherRevRefs.GetInstance(asn1Obj); + break; + default: + throw new ArgumentException("Illegal tag in CrlOcspRef", "seq"); + } + } + } + + public CrlOcspRef( + CrlListID crlids, + OcspListID ocspids, + OtherRevRefs otherRev) + { + this.crlids = crlids; + this.ocspids = ocspids; + this.otherRev = otherRev; + } + + public CrlListID CrlIDs + { + get { return crlids; } + } + + public OcspListID OcspIDs + { + get { return ocspids; } + } + + public OtherRevRefs OtherRev + { + get { return otherRev; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (crlids != null) + { + v.Add(new DerTaggedObject(true, 0, crlids.ToAsn1Object())); + } + + if (ocspids != null) + { + v.Add(new DerTaggedObject(true, 1, ocspids.ToAsn1Object())); + } + + if (otherRev != null) + { + v.Add(new DerTaggedObject(true, 2, otherRev.ToAsn1Object())); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlOcspRef.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlOcspRef.cs.meta new file mode 100644 index 00000000..073cfcda --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlOcspRef.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fec52d54f1a67b54ebf12ba30110c472 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlValidatedID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlValidatedID.cs new file mode 100644 index 00000000..270dd3a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlValidatedID.cs @@ -0,0 +1,95 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + /// + /// CrlValidatedID ::= SEQUENCE { + /// crlHash OtherHash, + /// crlIdentifier CrlIdentifier OPTIONAL} + /// + /// + public class CrlValidatedID + : Asn1Encodable + { + private readonly OtherHash crlHash; + private readonly CrlIdentifier crlIdentifier; + + public static CrlValidatedID GetInstance( + object obj) + { + if (obj == null || obj is CrlValidatedID) + return (CrlValidatedID) obj; + + if (obj is Asn1Sequence) + return new CrlValidatedID((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'CrlValidatedID' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private CrlValidatedID( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count < 1 || seq.Count > 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.crlHash = OtherHash.GetInstance(seq[0].ToAsn1Object()); + + if (seq.Count > 1) + { + this.crlIdentifier = CrlIdentifier.GetInstance(seq[1].ToAsn1Object()); + } + } + + public CrlValidatedID( + OtherHash crlHash) + : this(crlHash, null) + { + } + + public CrlValidatedID( + OtherHash crlHash, + CrlIdentifier crlIdentifier) + { + if (crlHash == null) + throw new ArgumentNullException("crlHash"); + + this.crlHash = crlHash; + this.crlIdentifier = crlIdentifier; + } + + public OtherHash CrlHash + { + get { return crlHash; } + } + + public CrlIdentifier CrlIdentifier + { + get { return crlIdentifier; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(crlHash.ToAsn1Object()); + + if (crlIdentifier != null) + { + v.Add(crlIdentifier.ToAsn1Object()); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlValidatedID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlValidatedID.cs.meta new file mode 100644 index 00000000..eae74f04 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/CrlValidatedID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 79d1caf0af4a8054d93f7b52cb4f58d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/ESFAttributes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/ESFAttributes.cs new file mode 100644 index 00000000..0bfab5a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/ESFAttributes.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + public abstract class EsfAttributes + { + public static readonly DerObjectIdentifier SigPolicyId = PkcsObjectIdentifiers.IdAAEtsSigPolicyID; + public static readonly DerObjectIdentifier CommitmentType = PkcsObjectIdentifiers.IdAAEtsCommitmentType; + public static readonly DerObjectIdentifier SignerLocation = PkcsObjectIdentifiers.IdAAEtsSignerLocation; + public static readonly DerObjectIdentifier SignerAttr = PkcsObjectIdentifiers.IdAAEtsSignerAttr; + public static readonly DerObjectIdentifier OtherSigCert = PkcsObjectIdentifiers.IdAAEtsOtherSigCert; + public static readonly DerObjectIdentifier ContentTimestamp = PkcsObjectIdentifiers.IdAAEtsContentTimestamp; + public static readonly DerObjectIdentifier CertificateRefs = PkcsObjectIdentifiers.IdAAEtsCertificateRefs; + public static readonly DerObjectIdentifier RevocationRefs = PkcsObjectIdentifiers.IdAAEtsRevocationRefs; + public static readonly DerObjectIdentifier CertValues = PkcsObjectIdentifiers.IdAAEtsCertValues; + public static readonly DerObjectIdentifier RevocationValues = PkcsObjectIdentifiers.IdAAEtsRevocationValues; + public static readonly DerObjectIdentifier EscTimeStamp = PkcsObjectIdentifiers.IdAAEtsEscTimeStamp; + public static readonly DerObjectIdentifier CertCrlTimestamp = PkcsObjectIdentifiers.IdAAEtsCertCrlTimestamp; + public static readonly DerObjectIdentifier ArchiveTimestamp = PkcsObjectIdentifiers.IdAAEtsArchiveTimestamp; + public static readonly DerObjectIdentifier ArchiveTimestampV2 = new DerObjectIdentifier(PkcsObjectIdentifiers.IdAA + ".48"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/ESFAttributes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/ESFAttributes.cs.meta new file mode 100644 index 00000000..597e8f3c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/ESFAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27b0e7aba5c89c94eb9fc2ac8618b287 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspIdentifier.cs new file mode 100644 index 00000000..492592b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspIdentifier.cs @@ -0,0 +1,82 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + /// + /// OcspIdentifier ::= SEQUENCE { + /// ocspResponderID ResponderID, + /// -- As in OCSP response data + /// producedAt GeneralizedTime + /// -- As in OCSP response data + /// } + /// + /// + public class OcspIdentifier + : Asn1Encodable + { + private readonly ResponderID ocspResponderID; + private readonly DerGeneralizedTime producedAt; + + public static OcspIdentifier GetInstance( + object obj) + { + if (obj == null || obj is OcspIdentifier) + return (OcspIdentifier) obj; + + if (obj is Asn1Sequence) + return new OcspIdentifier((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'OcspIdentifier' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private OcspIdentifier( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.ocspResponderID = ResponderID.GetInstance(seq[0].ToAsn1Object()); + this.producedAt = (DerGeneralizedTime) seq[1].ToAsn1Object(); + } + + public OcspIdentifier( + ResponderID ocspResponderID, + DateTime producedAt) + { + if (ocspResponderID == null) + throw new ArgumentNullException(); + + this.ocspResponderID = ocspResponderID; + this.producedAt = new DerGeneralizedTime(producedAt); + } + + public ResponderID OcspResponderID + { + get { return ocspResponderID; } + } + + public DateTime ProducedAt + { + get { return producedAt.ToDateTime(); } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(ocspResponderID, producedAt); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspIdentifier.cs.meta new file mode 100644 index 00000000..426eb60d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5768d144eb9d5d743bd69dfd0e52983f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspListID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspListID.cs new file mode 100644 index 00000000..0a400043 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspListID.cs @@ -0,0 +1,93 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + /// + /// OcspListID ::= SEQUENCE { + /// ocspResponses SEQUENCE OF OcspResponsesID + /// } + /// + /// + public class OcspListID + : Asn1Encodable + { + private readonly Asn1Sequence ocspResponses; + + public static OcspListID GetInstance( + object obj) + { + if (obj == null || obj is OcspListID) + return (OcspListID) obj; + + if (obj is Asn1Sequence) + return new OcspListID((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'OcspListID' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private OcspListID( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count != 1) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.ocspResponses = (Asn1Sequence) seq[0].ToAsn1Object(); + + foreach (Asn1Encodable ae in this.ocspResponses) + { + OcspResponsesID.GetInstance(ae.ToAsn1Object()); + } + } + + public OcspListID( + params OcspResponsesID[] ocspResponses) + { + if (ocspResponses == null) + throw new ArgumentNullException("ocspResponses"); + + this.ocspResponses = new DerSequence(ocspResponses); + } + + public OcspListID( + IEnumerable ocspResponses) + { + if (ocspResponses == null) + throw new ArgumentNullException("ocspResponses"); + if (!CollectionUtilities.CheckElementsAreOfType(ocspResponses, typeof(OcspResponsesID))) + throw new ArgumentException("Must contain only 'OcspResponsesID' objects", "ocspResponses"); + + this.ocspResponses = new DerSequence( + Asn1EncodableVector.FromEnumerable(ocspResponses)); + } + + public OcspResponsesID[] GetOcspResponses() + { + OcspResponsesID[] result = new OcspResponsesID[ocspResponses.Count]; + for (int i = 0; i < ocspResponses.Count; ++i) + { + result[i] = OcspResponsesID.GetInstance(ocspResponses[i].ToAsn1Object()); + } + return result; + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(ocspResponses); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspListID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspListID.cs.meta new file mode 100644 index 00000000..ca31e990 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspListID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eb0c80b3b4b2b5447aac0dd47934c395 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspResponsesID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspResponsesID.cs new file mode 100644 index 00000000..c98af45c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspResponsesID.cs @@ -0,0 +1,98 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + /// + /// OcspResponsesID ::= SEQUENCE { + /// ocspIdentifier OcspIdentifier, + /// ocspRepHash OtherHash OPTIONAL + /// } + /// + /// + public class OcspResponsesID + : Asn1Encodable + { + private readonly OcspIdentifier ocspIdentifier; + private readonly OtherHash ocspRepHash; + + public static OcspResponsesID GetInstance( + object obj) + { + if (obj == null || obj is OcspResponsesID) + return (OcspResponsesID) obj; + + if (obj is Asn1Sequence) + return new OcspResponsesID((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'OcspResponsesID' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private OcspResponsesID( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count < 1 || seq.Count > 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.ocspIdentifier = OcspIdentifier.GetInstance(seq[0].ToAsn1Object()); + + if (seq.Count > 1) + { + this.ocspRepHash = OtherHash.GetInstance(seq[1].ToAsn1Object()); + } + } + + public OcspResponsesID( + OcspIdentifier ocspIdentifier) + : this(ocspIdentifier, null) + { + } + + public OcspResponsesID( + OcspIdentifier ocspIdentifier, + OtherHash ocspRepHash) + { + if (ocspIdentifier == null) + throw new ArgumentNullException("ocspIdentifier"); + + this.ocspIdentifier = ocspIdentifier; + this.ocspRepHash = ocspRepHash; + } + + public OcspIdentifier OcspIdentifier + { + get { return ocspIdentifier; } + } + + public OtherHash OcspRepHash + { + get { return ocspRepHash; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + ocspIdentifier.ToAsn1Object()); + + if (ocspRepHash != null) + { + v.Add(ocspRepHash.ToAsn1Object()); + } + + return new DerSequence(v); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspResponsesID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspResponsesID.cs.meta new file mode 100644 index 00000000..7b9aa3d5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OcspResponsesID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c15ad696d7f40db4993112131d5ccc9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherCertID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherCertID.cs new file mode 100644 index 00000000..89cbd493 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherCertID.cs @@ -0,0 +1,98 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// + /// OtherCertID ::= SEQUENCE { + /// otherCertHash OtherHash, + /// issuerSerial IssuerSerial OPTIONAL + /// } + /// + /// + public class OtherCertID + : Asn1Encodable + { + private readonly OtherHash otherCertHash; + private readonly IssuerSerial issuerSerial; + + public static OtherCertID GetInstance( + object obj) + { + if (obj == null || obj is OtherCertID) + return (OtherCertID) obj; + + if (obj is Asn1Sequence) + return new OtherCertID((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'OtherCertID' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private OtherCertID( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count < 1 || seq.Count > 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.otherCertHash = OtherHash.GetInstance(seq[0].ToAsn1Object()); + + if (seq.Count > 1) + { + this.issuerSerial = IssuerSerial.GetInstance(seq[1].ToAsn1Object()); + } + } + + public OtherCertID( + OtherHash otherCertHash) + : this(otherCertHash, null) + { + } + + public OtherCertID( + OtherHash otherCertHash, + IssuerSerial issuerSerial) + { + if (otherCertHash == null) + throw new ArgumentNullException("otherCertHash"); + + this.otherCertHash = otherCertHash; + this.issuerSerial = issuerSerial; + } + + public OtherHash OtherCertHash + { + get { return otherCertHash; } + } + + public IssuerSerial IssuerSerial + { + get { return issuerSerial; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + otherCertHash.ToAsn1Object()); + + if (issuerSerial != null) + { + v.Add(issuerSerial.ToAsn1Object()); + } + + return new DerSequence(v); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherCertID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherCertID.cs.meta new file mode 100644 index 00000000..d0c038fc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherCertID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4fe95960541b4ea46b716b7a538de65c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHash.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHash.cs new file mode 100644 index 00000000..27d9afa8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHash.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// + /// OtherHash ::= CHOICE { + /// sha1Hash OtherHashValue, -- This contains a SHA-1 hash + /// otherHash OtherHashAlgAndValue + /// } + /// + /// OtherHashValue ::= OCTET STRING + /// + /// + public class OtherHash + : Asn1Encodable, IAsn1Choice + { + private readonly Asn1OctetString sha1Hash; + private readonly OtherHashAlgAndValue otherHash; + + public static OtherHash GetInstance( + object obj) + { + if (obj == null || obj is OtherHash) + return (OtherHash) obj; + + if (obj is Asn1OctetString) + return new OtherHash((Asn1OctetString) obj); + + return new OtherHash( + OtherHashAlgAndValue.GetInstance(obj)); + } + + public OtherHash( + byte[] sha1Hash) + { + if (sha1Hash == null) + throw new ArgumentNullException("sha1Hash"); + + this.sha1Hash = new DerOctetString(sha1Hash); + } + + public OtherHash( + Asn1OctetString sha1Hash) + { + if (sha1Hash == null) + throw new ArgumentNullException("sha1Hash"); + + this.sha1Hash = sha1Hash; + } + + public OtherHash( + OtherHashAlgAndValue otherHash) + { + if (otherHash == null) + throw new ArgumentNullException("otherHash"); + + this.otherHash = otherHash; + } + + public AlgorithmIdentifier HashAlgorithm + { + get + { + return otherHash == null + ? new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1) + : otherHash.HashAlgorithm; + } + } + + public byte[] GetHashValue() + { + return otherHash == null + ? sha1Hash.GetOctets() + : otherHash.GetHashValue(); + } + + public override Asn1Object ToAsn1Object() + { + return otherHash == null + ? sha1Hash + : otherHash.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHash.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHash.cs.meta new file mode 100644 index 00000000..6190b769 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58f777dca43ae81438f2da0092e74fba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHashAlgAndValue.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHashAlgAndValue.cs new file mode 100644 index 00000000..199a126f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHashAlgAndValue.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// Summary description for OtherHashAlgAndValue. + /// + /// + /// + /// OtherHashAlgAndValue ::= SEQUENCE { + /// hashAlgorithm AlgorithmIdentifier, + /// hashValue OtherHashValue + /// } + /// + /// OtherHashValue ::= OCTET STRING + /// + /// + public class OtherHashAlgAndValue + : Asn1Encodable + { + private readonly AlgorithmIdentifier hashAlgorithm; + private readonly Asn1OctetString hashValue; + + public static OtherHashAlgAndValue GetInstance( + object obj) + { + if (obj == null || obj is OtherHashAlgAndValue) + return (OtherHashAlgAndValue) obj; + + if (obj is Asn1Sequence) + return new OtherHashAlgAndValue((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'OtherHashAlgAndValue' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private OtherHashAlgAndValue( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.hashAlgorithm = AlgorithmIdentifier.GetInstance(seq[0].ToAsn1Object()); + this.hashValue = (Asn1OctetString) seq[1].ToAsn1Object(); + } + + public OtherHashAlgAndValue( + AlgorithmIdentifier hashAlgorithm, + byte[] hashValue) + { + if (hashAlgorithm == null) + throw new ArgumentNullException("hashAlgorithm"); + if (hashValue == null) + throw new ArgumentNullException("hashValue"); + + this.hashAlgorithm = hashAlgorithm; + this.hashValue = new DerOctetString(hashValue); + } + + public OtherHashAlgAndValue( + AlgorithmIdentifier hashAlgorithm, + Asn1OctetString hashValue) + { + if (hashAlgorithm == null) + throw new ArgumentNullException("hashAlgorithm"); + if (hashValue == null) + throw new ArgumentNullException("hashValue"); + + this.hashAlgorithm = hashAlgorithm; + this.hashValue = hashValue; + } + + public AlgorithmIdentifier HashAlgorithm + { + get { return hashAlgorithm; } + } + + public byte[] GetHashValue() + { + return hashValue.GetOctets(); + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(hashAlgorithm, hashValue); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHashAlgAndValue.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHashAlgAndValue.cs.meta new file mode 100644 index 00000000..42b03c85 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherHashAlgAndValue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eefa24fd14060ff469112a0023643954 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevRefs.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevRefs.cs new file mode 100644 index 00000000..485bfd54 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevRefs.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.2.2 Complete Revocation Refs Attribute Definition + /// + /// OtherRevRefs ::= SEQUENCE + /// { + /// otherRevRefType OtherRevRefType, + /// otherRevRefs ANY DEFINED BY otherRevRefType + /// } + /// + /// OtherRevRefType ::= OBJECT IDENTIFIER + /// + /// + public class OtherRevRefs + : Asn1Encodable + { + private readonly DerObjectIdentifier otherRevRefType; + private readonly Asn1Object otherRevRefs; + + public static OtherRevRefs GetInstance( + object obj) + { + if (obj == null || obj is OtherRevRefs) + return (OtherRevRefs) obj; + + if (obj is Asn1Sequence) + return new OtherRevRefs((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'OtherRevRefs' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private OtherRevRefs( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.otherRevRefType = (DerObjectIdentifier) seq[0].ToAsn1Object(); + this.otherRevRefs = seq[1].ToAsn1Object(); + } + + public OtherRevRefs( + DerObjectIdentifier otherRevRefType, + Asn1Encodable otherRevRefs) + { + if (otherRevRefType == null) + throw new ArgumentNullException("otherRevRefType"); + if (otherRevRefs == null) + throw new ArgumentNullException("otherRevRefs"); + + this.otherRevRefType = otherRevRefType; + this.otherRevRefs = otherRevRefs.ToAsn1Object(); + } + + public DerObjectIdentifier OtherRevRefType + { + get { return otherRevRefType; } + } + + public Asn1Object OtherRevRefsObject + { + get { return otherRevRefs; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(otherRevRefType, otherRevRefs); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevRefs.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevRefs.cs.meta new file mode 100644 index 00000000..3849c634 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevRefs.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 085694bc59fbce84485d29da1ee62c79 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevVals.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevVals.cs new file mode 100644 index 00000000..f9688a22 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevVals.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 3126: 4.3.2 Revocation Values Attribute Definition + /// + /// OtherRevVals ::= SEQUENCE + /// { + /// otherRevValType OtherRevValType, + /// otherRevVals ANY DEFINED BY otherRevValType + /// } + /// + /// OtherRevValType ::= OBJECT IDENTIFIER + /// + /// + public class OtherRevVals + : Asn1Encodable + { + private readonly DerObjectIdentifier otherRevValType; + private readonly Asn1Object otherRevVals; + + public static OtherRevVals GetInstance( + object obj) + { + if (obj == null || obj is OtherRevVals) + return (OtherRevVals) obj; + + if (obj is Asn1Sequence) + return new OtherRevVals((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'OtherRevVals' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private OtherRevVals( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.otherRevValType = (DerObjectIdentifier) seq[0].ToAsn1Object(); + this.otherRevVals = seq[1].ToAsn1Object(); + } + + public OtherRevVals( + DerObjectIdentifier otherRevValType, + Asn1Encodable otherRevVals) + { + if (otherRevValType == null) + throw new ArgumentNullException("otherRevValType"); + if (otherRevVals == null) + throw new ArgumentNullException("otherRevVals"); + + this.otherRevValType = otherRevValType; + this.otherRevVals = otherRevVals.ToAsn1Object(); + } + + public DerObjectIdentifier OtherRevValType + { + get { return otherRevValType; } + } + + public Asn1Object OtherRevValsObject + { + get { return otherRevVals; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(otherRevValType, otherRevVals); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevVals.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevVals.cs.meta new file mode 100644 index 00000000..84983bfa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherRevVals.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a03fbd2d4e225854b90c6419a1562f98 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherSigningCertificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherSigningCertificate.cs new file mode 100644 index 00000000..2fe53d2c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherSigningCertificate.cs @@ -0,0 +1,143 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// + /// OtherSigningCertificate ::= SEQUENCE { + /// certs SEQUENCE OF OtherCertID, + /// policies SEQUENCE OF PolicyInformation OPTIONAL + /// } + /// + /// + public class OtherSigningCertificate + : Asn1Encodable + { + private readonly Asn1Sequence certs; + private readonly Asn1Sequence policies; + + public static OtherSigningCertificate GetInstance( + object obj) + { + if (obj == null || obj is OtherSigningCertificate) + return (OtherSigningCertificate) obj; + + if (obj is Asn1Sequence) + return new OtherSigningCertificate((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'OtherSigningCertificate' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private OtherSigningCertificate( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count < 1 || seq.Count > 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.certs = Asn1Sequence.GetInstance(seq[0].ToAsn1Object()); + + if (seq.Count > 1) + { + this.policies = Asn1Sequence.GetInstance(seq[1].ToAsn1Object()); + } + } + + public OtherSigningCertificate( + params OtherCertID[] certs) + : this(certs, null) + { + } + + public OtherSigningCertificate( + OtherCertID[] certs, + params PolicyInformation[] policies) + { + if (certs == null) + throw new ArgumentNullException("certs"); + + this.certs = new DerSequence(certs); + + if (policies != null) + { + this.policies = new DerSequence(policies); + } + } + + public OtherSigningCertificate( + IEnumerable certs) + : this(certs, null) + { + } + + public OtherSigningCertificate( + IEnumerable certs, + IEnumerable policies) + { + if (certs == null) + throw new ArgumentNullException("certs"); + if (!CollectionUtilities.CheckElementsAreOfType(certs, typeof(OtherCertID))) + throw new ArgumentException("Must contain only 'OtherCertID' objects", "certs"); + + this.certs = new DerSequence( + Asn1EncodableVector.FromEnumerable(certs)); + + if (policies != null) + { + if (!CollectionUtilities.CheckElementsAreOfType(policies, typeof(PolicyInformation))) + throw new ArgumentException("Must contain only 'PolicyInformation' objects", "policies"); + + this.policies = new DerSequence( + Asn1EncodableVector.FromEnumerable(policies)); + } + } + + public OtherCertID[] GetCerts() + { + OtherCertID[] cs = new OtherCertID[certs.Count]; + for (int i = 0; i < certs.Count; ++i) + { + cs[i] = OtherCertID.GetInstance(certs[i].ToAsn1Object()); + } + return cs; + } + + public PolicyInformation[] GetPolicies() + { + if (policies == null) + return null; + + PolicyInformation[] ps = new PolicyInformation[policies.Count]; + for (int i = 0; i < policies.Count; ++i) + { + ps[i] = PolicyInformation.GetInstance(policies[i].ToAsn1Object()); + } + return ps; + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certs); + + if (policies != null) + { + v.Add(policies); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherSigningCertificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherSigningCertificate.cs.meta new file mode 100644 index 00000000..6c17bf5a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/OtherSigningCertificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 16e25eea74d6b9948a1b8bea685c4116 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/RevocationValues.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/RevocationValues.cs new file mode 100644 index 00000000..9ae68bce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/RevocationValues.cs @@ -0,0 +1,169 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// RFC 5126: 6.3.4. revocation-values Attribute Definition + /// + /// RevocationValues ::= SEQUENCE { + /// crlVals [0] SEQUENCE OF CertificateList OPTIONAL, + /// ocspVals [1] SEQUENCE OF BasicOCSPResponse OPTIONAL, + /// otherRevVals [2] OtherRevVals OPTIONAL + /// } + /// + /// + public class RevocationValues + : Asn1Encodable + { + private readonly Asn1Sequence crlVals; + private readonly Asn1Sequence ocspVals; + private readonly OtherRevVals otherRevVals; + + public static RevocationValues GetInstance( + object obj) + { + if (obj == null || obj is RevocationValues) + return (RevocationValues) obj; + + return new RevocationValues(Asn1Sequence.GetInstance(obj)); + } + + private RevocationValues( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count > 3) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + foreach (Asn1TaggedObject taggedObj in seq) + { + Asn1Object asn1Obj = taggedObj.GetObject(); + switch (taggedObj.TagNo) + { + case 0: + Asn1Sequence crlValsSeq = (Asn1Sequence) asn1Obj; + foreach (Asn1Encodable ae in crlValsSeq) + { + CertificateList.GetInstance(ae.ToAsn1Object()); + } + this.crlVals = crlValsSeq; + break; + case 1: + Asn1Sequence ocspValsSeq = (Asn1Sequence) asn1Obj; + foreach (Asn1Encodable ae in ocspValsSeq) + { + BasicOcspResponse.GetInstance(ae.ToAsn1Object()); + } + this.ocspVals = ocspValsSeq; + break; + case 2: + this.otherRevVals = OtherRevVals.GetInstance(asn1Obj); + break; + default: + throw new ArgumentException("Illegal tag in RevocationValues", "seq"); + } + } + } + + public RevocationValues( + CertificateList[] crlVals, + BasicOcspResponse[] ocspVals, + OtherRevVals otherRevVals) + { + if (crlVals != null) + { + this.crlVals = new DerSequence(crlVals); + } + + if (ocspVals != null) + { + this.ocspVals = new DerSequence(ocspVals); + } + + this.otherRevVals = otherRevVals; + } + + public RevocationValues( + IEnumerable crlVals, + IEnumerable ocspVals, + OtherRevVals otherRevVals) + { + if (crlVals != null) + { + if (!CollectionUtilities.CheckElementsAreOfType(crlVals, typeof(CertificateList))) + throw new ArgumentException("Must contain only 'CertificateList' objects", "crlVals"); + + this.crlVals = new DerSequence( + Asn1EncodableVector.FromEnumerable(crlVals)); + } + + if (ocspVals != null) + { + if (!CollectionUtilities.CheckElementsAreOfType(ocspVals, typeof(BasicOcspResponse))) + throw new ArgumentException("Must contain only 'BasicOcspResponse' objects", "ocspVals"); + + this.ocspVals = new DerSequence( + Asn1EncodableVector.FromEnumerable(ocspVals)); + } + + this.otherRevVals = otherRevVals; + } + + public CertificateList[] GetCrlVals() + { + CertificateList[] result = new CertificateList[crlVals.Count]; + for (int i = 0; i < crlVals.Count; ++i) + { + result[i] = CertificateList.GetInstance(crlVals[i].ToAsn1Object()); + } + return result; + } + + public BasicOcspResponse[] GetOcspVals() + { + BasicOcspResponse[] result = new BasicOcspResponse[ocspVals.Count]; + for (int i = 0; i < ocspVals.Count; ++i) + { + result[i] = BasicOcspResponse.GetInstance(ocspVals[i].ToAsn1Object()); + } + return result; + } + + public OtherRevVals OtherRevVals + { + get { return otherRevVals; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (crlVals != null) + { + v.Add(new DerTaggedObject(true, 0, crlVals)); + } + + if (ocspVals != null) + { + v.Add(new DerTaggedObject(true, 1, ocspVals)); + } + + if (otherRevVals != null) + { + v.Add(new DerTaggedObject(true, 2, otherRevVals.ToAsn1Object())); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/RevocationValues.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/RevocationValues.cs.meta new file mode 100644 index 00000000..435654a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/RevocationValues.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ef9495d1fec73844ac79e7d1baf428a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SigPolicyQualifierInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SigPolicyQualifierInfo.cs new file mode 100644 index 00000000..b6e7d11c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SigPolicyQualifierInfo.cs @@ -0,0 +1,77 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// + /// SigPolicyQualifierInfo ::= SEQUENCE { + /// sigPolicyQualifierId SigPolicyQualifierId, + /// sigQualifier ANY DEFINED BY sigPolicyQualifierId + /// } + /// + /// SigPolicyQualifierId ::= OBJECT IDENTIFIER + /// + /// + public class SigPolicyQualifierInfo + : Asn1Encodable + { + private readonly DerObjectIdentifier sigPolicyQualifierId; + private readonly Asn1Object sigQualifier; + + public static SigPolicyQualifierInfo GetInstance( + object obj) + { + if (obj == null || obj is SigPolicyQualifierInfo) + return (SigPolicyQualifierInfo) obj; + + if (obj is Asn1Sequence) + return new SigPolicyQualifierInfo((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'SigPolicyQualifierInfo' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private SigPolicyQualifierInfo( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.sigPolicyQualifierId = (DerObjectIdentifier) seq[0].ToAsn1Object(); + this.sigQualifier = seq[1].ToAsn1Object(); + } + + public SigPolicyQualifierInfo( + DerObjectIdentifier sigPolicyQualifierId, + Asn1Encodable sigQualifier) + { + this.sigPolicyQualifierId = sigPolicyQualifierId; + this.sigQualifier = sigQualifier.ToAsn1Object(); + } + + public DerObjectIdentifier SigPolicyQualifierId + { + get { return sigPolicyQualifierId; } + } + + public Asn1Object SigQualifier + { + get { return sigQualifier; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(sigPolicyQualifierId, sigQualifier); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SigPolicyQualifierInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SigPolicyQualifierInfo.cs.meta new file mode 100644 index 00000000..dd9f7e59 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SigPolicyQualifierInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48561c565612aa04f9aaf7c1d22a3f6b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyId.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyId.cs new file mode 100644 index 00000000..b392d59c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyId.cs @@ -0,0 +1,150 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// + /// SignaturePolicyId ::= SEQUENCE { + /// sigPolicyIdentifier SigPolicyId, + /// sigPolicyHash SigPolicyHash, + /// sigPolicyQualifiers SEQUENCE SIZE (1..MAX) OF SigPolicyQualifierInfo OPTIONAL + /// } + /// + /// SigPolicyId ::= OBJECT IDENTIFIER + /// + /// SigPolicyHash ::= OtherHashAlgAndValue + /// + /// + public class SignaturePolicyId + : Asn1Encodable + { + private readonly DerObjectIdentifier sigPolicyIdentifier; + private readonly OtherHashAlgAndValue sigPolicyHash; + private readonly Asn1Sequence sigPolicyQualifiers; + + public static SignaturePolicyId GetInstance( + object obj) + { + if (obj == null || obj is SignaturePolicyId) + return (SignaturePolicyId) obj; + + if (obj is Asn1Sequence) + return new SignaturePolicyId((Asn1Sequence) obj); + + throw new ArgumentException( + "Unknown object in 'SignaturePolicyId' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private SignaturePolicyId( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + if (seq.Count < 2 || seq.Count > 3) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.sigPolicyIdentifier = (DerObjectIdentifier) seq[0].ToAsn1Object(); + this.sigPolicyHash = OtherHashAlgAndValue.GetInstance(seq[1].ToAsn1Object()); + + if (seq.Count > 2) + { + this.sigPolicyQualifiers = (Asn1Sequence) seq[2].ToAsn1Object(); + } + } + + public SignaturePolicyId( + DerObjectIdentifier sigPolicyIdentifier, + OtherHashAlgAndValue sigPolicyHash) + : this(sigPolicyIdentifier, sigPolicyHash, null) + { + } + + public SignaturePolicyId( + DerObjectIdentifier sigPolicyIdentifier, + OtherHashAlgAndValue sigPolicyHash, + params SigPolicyQualifierInfo[] sigPolicyQualifiers) + { + if (sigPolicyIdentifier == null) + throw new ArgumentNullException("sigPolicyIdentifier"); + if (sigPolicyHash == null) + throw new ArgumentNullException("sigPolicyHash"); + + this.sigPolicyIdentifier = sigPolicyIdentifier; + this.sigPolicyHash = sigPolicyHash; + + if (sigPolicyQualifiers != null) + { + this.sigPolicyQualifiers = new DerSequence(sigPolicyQualifiers); + } + } + + public SignaturePolicyId( + DerObjectIdentifier sigPolicyIdentifier, + OtherHashAlgAndValue sigPolicyHash, + IEnumerable sigPolicyQualifiers) + { + if (sigPolicyIdentifier == null) + throw new ArgumentNullException("sigPolicyIdentifier"); + if (sigPolicyHash == null) + throw new ArgumentNullException("sigPolicyHash"); + + this.sigPolicyIdentifier = sigPolicyIdentifier; + this.sigPolicyHash = sigPolicyHash; + + if (sigPolicyQualifiers != null) + { + if (!CollectionUtilities.CheckElementsAreOfType(sigPolicyQualifiers, typeof(SigPolicyQualifierInfo))) + throw new ArgumentException("Must contain only 'SigPolicyQualifierInfo' objects", "sigPolicyQualifiers"); + + this.sigPolicyQualifiers = new DerSequence( + Asn1EncodableVector.FromEnumerable(sigPolicyQualifiers)); + } + } + + public DerObjectIdentifier SigPolicyIdentifier + { + get { return sigPolicyIdentifier; } + } + + public OtherHashAlgAndValue SigPolicyHash + { + get { return sigPolicyHash; } + } + + public SigPolicyQualifierInfo[] GetSigPolicyQualifiers() + { + if (sigPolicyQualifiers == null) + return null; + + SigPolicyQualifierInfo[] infos = new SigPolicyQualifierInfo[sigPolicyQualifiers.Count]; + for (int i = 0; i < sigPolicyQualifiers.Count; ++i) + { + infos[i] = SigPolicyQualifierInfo.GetInstance(sigPolicyQualifiers[i]); + } + return infos; + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + sigPolicyIdentifier, sigPolicyHash.ToAsn1Object()); + + if (sigPolicyQualifiers != null) + { + v.Add(sigPolicyQualifiers.ToAsn1Object()); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyId.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyId.cs.meta new file mode 100644 index 00000000..30422fcd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6902922cff414ce4dbc76162dba1ffc9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyIdentifier.cs new file mode 100644 index 00000000..84a182de --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyIdentifier.cs @@ -0,0 +1,70 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /// + /// + /// SignaturePolicyIdentifier ::= CHOICE { + /// SignaturePolicyId SignaturePolicyId, + /// SignaturePolicyImplied SignaturePolicyImplied + /// } + /// + /// SignaturePolicyImplied ::= NULL + /// + /// + public class SignaturePolicyIdentifier + : Asn1Encodable, IAsn1Choice + { + private readonly SignaturePolicyId sigPolicy; + + public static SignaturePolicyIdentifier GetInstance( + object obj) + { + if (obj == null || obj is SignaturePolicyIdentifier) + return (SignaturePolicyIdentifier) obj; + + if (obj is SignaturePolicyId) + return new SignaturePolicyIdentifier((SignaturePolicyId) obj); + + if (obj is Asn1Null) + return new SignaturePolicyIdentifier(); + + throw new ArgumentException( + "Unknown object in 'SignaturePolicyIdentifier' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + public SignaturePolicyIdentifier() + { + this.sigPolicy = null; + } + + public SignaturePolicyIdentifier( + SignaturePolicyId signaturePolicyId) + { + if (signaturePolicyId == null) + throw new ArgumentNullException("signaturePolicyId"); + + this.sigPolicy = signaturePolicyId; + } + + public SignaturePolicyId SignaturePolicyId + { + get { return sigPolicy; } + } + + public override Asn1Object ToAsn1Object() + { + return sigPolicy == null + ? DerNull.Instance + : sigPolicy.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyIdentifier.cs.meta new file mode 100644 index 00000000..3ff2cb12 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignaturePolicyIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88b8dce751cd3ce46b923eb32d31d99c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerAttribute.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerAttribute.cs new file mode 100644 index 00000000..5e4370da --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerAttribute.cs @@ -0,0 +1,101 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + public class SignerAttribute + : Asn1Encodable + { + private Asn1Sequence claimedAttributes; + private AttributeCertificate certifiedAttributes; + + public static SignerAttribute GetInstance( + object obj) + { + if (obj == null || obj is SignerAttribute) + return (SignerAttribute) obj; + + if (obj is Asn1Sequence) + return new SignerAttribute(obj); + + throw new ArgumentException( + "Unknown object in 'SignerAttribute' factory: " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), + "obj"); + } + + private SignerAttribute( + object obj) + { + Asn1Sequence seq = (Asn1Sequence) obj; + DerTaggedObject taggedObject = (DerTaggedObject) seq[0]; + if (taggedObject.TagNo == 0) + { + claimedAttributes = Asn1Sequence.GetInstance(taggedObject, true); + } + else if (taggedObject.TagNo == 1) + { + certifiedAttributes = AttributeCertificate.GetInstance(taggedObject); + } + else + { + throw new ArgumentException("illegal tag.", "obj"); + } + } + + public SignerAttribute( + Asn1Sequence claimedAttributes) + { + this.claimedAttributes = claimedAttributes; + } + + public SignerAttribute( + AttributeCertificate certifiedAttributes) + { + this.certifiedAttributes = certifiedAttributes; + } + + public virtual Asn1Sequence ClaimedAttributes + { + get { return claimedAttributes; } + } + + public virtual AttributeCertificate CertifiedAttributes + { + get { return certifiedAttributes; } + } + + /** + * + *
+		*  SignerAttribute ::= SEQUENCE OF CHOICE {
+		*      claimedAttributes   [0] ClaimedAttributes,
+		*      certifiedAttributes [1] CertifiedAttributes }
+		*
+		*  ClaimedAttributes ::= SEQUENCE OF Attribute
+		*  CertifiedAttributes ::= AttributeCertificate -- as defined in RFC 3281: see clause 4.1.
+		* 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (claimedAttributes != null) + { + v.Add(new DerTaggedObject(0, claimedAttributes)); + } + else + { + v.Add(new DerTaggedObject(1, certifiedAttributes)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerAttribute.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerAttribute.cs.meta new file mode 100644 index 00000000..69407a58 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f58fcecdd066ee741b449d23d468df72 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerLocation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerLocation.cs new file mode 100644 index 00000000..431abf9d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerLocation.cs @@ -0,0 +1,176 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Esf +{ + /** + * Signer-Location attribute (RFC3126). + * + *
+	*   SignerLocation ::= SEQUENCE {
+	*       countryName        [0] DirectoryString OPTIONAL,
+	*       localityName       [1] DirectoryString OPTIONAL,
+	*       postalAddress      [2] PostalAddress OPTIONAL }
+	*
+	*   PostalAddress ::= SEQUENCE SIZE(1..6) OF DirectoryString
+	* 
+ */ + public class SignerLocation + : Asn1Encodable + { + private DirectoryString countryName; + private DirectoryString localityName; + private Asn1Sequence postalAddress; + + public SignerLocation( + Asn1Sequence seq) + { + foreach (Asn1TaggedObject obj in seq) + { + switch (obj.TagNo) + { + case 0: + this.countryName = DirectoryString.GetInstance(obj, true); + break; + case 1: + this.localityName = DirectoryString.GetInstance(obj, true); + break; + case 2: + bool isExplicit = obj.IsExplicit(); // handle erroneous implicitly tagged sequences + this.postalAddress = Asn1Sequence.GetInstance(obj, isExplicit); + if (postalAddress != null && postalAddress.Count > 6) + throw new ArgumentException("postal address must contain less than 6 strings"); + break; + default: + throw new ArgumentException("illegal tag"); + } + } + } + + private SignerLocation( + DirectoryString countryName, + DirectoryString localityName, + Asn1Sequence postalAddress) + { + if (postalAddress != null && postalAddress.Count > 6) + throw new ArgumentException("postal address must contain less than 6 strings"); + + this.countryName = countryName; + this.localityName = localityName; + this.postalAddress = postalAddress; + } + + public SignerLocation( + DirectoryString countryName, + DirectoryString localityName, + DirectoryString[] postalAddress) + : this(countryName, localityName, new DerSequence(postalAddress)) + { + } + + public SignerLocation( + DerUtf8String countryName, + DerUtf8String localityName, + Asn1Sequence postalAddress) + : this(DirectoryString.GetInstance(countryName), DirectoryString.GetInstance(localityName), postalAddress) + { + } + + public static SignerLocation GetInstance( + object obj) + { + if (obj == null || obj is SignerLocation) + { + return (SignerLocation) obj; + } + + return new SignerLocation(Asn1Sequence.GetInstance(obj)); + } + + public DirectoryString Country + { + get { return countryName; } + } + + public DirectoryString Locality + { + get { return localityName; } + } + + public DirectoryString[] GetPostal() + { + if (postalAddress == null) + return null; + + DirectoryString[] dirStrings = new DirectoryString[postalAddress.Count]; + for (int i = 0; i != dirStrings.Length; i++) + { + dirStrings[i] = DirectoryString.GetInstance(postalAddress[i]); + } + + return dirStrings; + } + + [Obsolete("Use 'Country' property instead")] + public DerUtf8String CountryName + { + get { return countryName == null ? null : new DerUtf8String(countryName.GetString()); } + } + + [Obsolete("Use 'Locality' property instead")] + public DerUtf8String LocalityName + { + get { return localityName == null ? null : new DerUtf8String(localityName.GetString()); } + } + + public Asn1Sequence PostalAddress + { + get { return postalAddress; } + } + + /** + *
+		*   SignerLocation ::= SEQUENCE {
+		*       countryName        [0] DirectoryString OPTIONAL,
+		*       localityName       [1] DirectoryString OPTIONAL,
+		*       postalAddress      [2] PostalAddress OPTIONAL }
+		*
+		*   PostalAddress ::= SEQUENCE SIZE(1..6) OF DirectoryString
+		*
+		*   DirectoryString ::= CHOICE {
+		*         teletexString           TeletexString (SIZE (1..MAX)),
+		*         printableString         PrintableString (SIZE (1..MAX)),
+		*         universalString         UniversalString (SIZE (1..MAX)),
+		*         utf8String              UTF8String (SIZE (1.. MAX)),
+		*         bmpString               BMPString (SIZE (1..MAX)) }
+		* 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (countryName != null) + { + v.Add(new DerTaggedObject(true, 0, countryName)); + } + + if (localityName != null) + { + v.Add(new DerTaggedObject(true, 1, localityName)); + } + + if (postalAddress != null) + { + v.Add(new DerTaggedObject(true, 2, postalAddress)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerLocation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerLocation.cs.meta new file mode 100644 index 00000000..b853061d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/esf/SignerLocation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f7089095be6eac84d82475eb79a5eeb1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess.meta new file mode 100644 index 00000000..d0c7803d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be5c7e0fbad5cce469d07efe51b4bd28 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentHints.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentHints.cs new file mode 100644 index 00000000..8bd3940f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentHints.cs @@ -0,0 +1,98 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess +{ + public class ContentHints + : Asn1Encodable + { + private readonly DerUtf8String contentDescription; + private readonly DerObjectIdentifier contentType; + + public static ContentHints GetInstance( + object o) + { + if (o == null || o is ContentHints) + { + return (ContentHints)o; + } + + if (o is Asn1Sequence) + { + return new ContentHints((Asn1Sequence)o); + } + + throw new ArgumentException("unknown object in 'ContentHints' factory : " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o) + "."); + } + + /** + * constructor + */ + private ContentHints( + Asn1Sequence seq) + { + IAsn1Convertible field = seq[0]; + if (field.ToAsn1Object() is DerUtf8String) + { + contentDescription = DerUtf8String.GetInstance(field); + contentType = DerObjectIdentifier.GetInstance(seq[1]); + } + else + { + contentType = DerObjectIdentifier.GetInstance(seq[0]); + } + } + + public ContentHints( + DerObjectIdentifier contentType) + { + this.contentType = contentType; + this.contentDescription = null; + } + + public ContentHints( + DerObjectIdentifier contentType, + DerUtf8String contentDescription) + { + this.contentType = contentType; + this.contentDescription = contentDescription; + } + + public DerObjectIdentifier ContentType + { + get { return contentType; } + } + + public DerUtf8String ContentDescription + { + get { return contentDescription; } + } + + /** + *
+		 * ContentHints ::= SEQUENCE {
+		 *   contentDescription UTF8String (SIZE (1..MAX)) OPTIONAL,
+		 *   contentType ContentType }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (contentDescription != null) + { + v.Add(contentDescription); + } + + v.Add(contentType); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentHints.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentHints.cs.meta new file mode 100644 index 00000000..a4dda05d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentHints.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f0d1765f5e7423941ad4b87086d833dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentIdentifier.cs new file mode 100644 index 00000000..1aeadae9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentIdentifier.cs @@ -0,0 +1,71 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess +{ + public class ContentIdentifier + : Asn1Encodable + { + private Asn1OctetString value; + + public static ContentIdentifier GetInstance( + object o) + { + if (o == null || o is ContentIdentifier) + { + return (ContentIdentifier) o; + } + + if (o is Asn1OctetString) + { + return new ContentIdentifier((Asn1OctetString) o); + } + + throw new ArgumentException( + "unknown object in 'ContentIdentifier' factory : " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o) + "."); + } + + /** + * Create from OCTET STRING whose octets represent the identifier. + */ + public ContentIdentifier( + Asn1OctetString value) + { + this.value = value; + } + + /** + * Create from byte array representing the identifier. + */ + public ContentIdentifier( + byte[] value) + : this(new DerOctetString(value)) + { + } + + public Asn1OctetString Value + { + get { return value; } + } + + /** + * The definition of ContentIdentifier is + *
+		 * ContentIdentifier ::=  OCTET STRING
+		 * 
+ * id-aa-contentIdentifier OBJECT IDENTIFIER ::= { iso(1) + * member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + * smime(16) id-aa(2) 7 } + */ + public override Asn1Object ToAsn1Object() + { + return value; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentIdentifier.cs.meta new file mode 100644 index 00000000..7eb95774 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ContentIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 27b1b62e343bdae41b3a77f1059287ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertID.cs new file mode 100644 index 00000000..59aa82a0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertID.cs @@ -0,0 +1,98 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess +{ + public class EssCertID + : Asn1Encodable + { + private Asn1OctetString certHash; + private IssuerSerial issuerSerial; + + public static EssCertID GetInstance( + object o) + { + if (o == null || o is EssCertID) + { + return (EssCertID) o; + } + + if (o is Asn1Sequence) + { + return new EssCertID((Asn1Sequence) o); + } + + throw new ArgumentException( + "unknown object in 'EssCertID' factory : " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o) + "."); + } + + /** + * constructor + */ + public EssCertID( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 2) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + this.certHash = Asn1OctetString.GetInstance(seq[0]); + + if (seq.Count > 1) + { + issuerSerial = IssuerSerial.GetInstance(seq[1]); + } + } + + public EssCertID( + byte[] hash) + { + certHash = new DerOctetString(hash); + } + + public EssCertID( + byte[] hash, + IssuerSerial issuerSerial) + { + this.certHash = new DerOctetString(hash); + this.issuerSerial = issuerSerial; + } + + public byte[] GetCertHash() + { + return certHash.GetOctets(); + } + + public IssuerSerial IssuerSerial + { + get { return issuerSerial; } + } + + /** + *
+		 * EssCertID ::= SEQUENCE {
+		 *     certHash Hash,
+		 *     issuerSerial IssuerSerial OPTIONAL }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certHash); + + if (issuerSerial != null) + { + v.Add(issuerSerial); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertID.cs.meta new file mode 100644 index 00000000..e7042244 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ccdea76922a5cd40ad41188515286ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertIDv2.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertIDv2.cs new file mode 100644 index 00000000..62f19033 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertIDv2.cs @@ -0,0 +1,150 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess +{ + public class EssCertIDv2 + : Asn1Encodable + { + private readonly AlgorithmIdentifier hashAlgorithm; + private readonly byte[] certHash; + private readonly IssuerSerial issuerSerial; + + private static readonly AlgorithmIdentifier DefaultAlgID = new AlgorithmIdentifier( + NistObjectIdentifiers.IdSha256); + + public static EssCertIDv2 GetInstance(object obj) + { + if (obj == null) + return null; + EssCertIDv2 existing = obj as EssCertIDv2; + if (existing != null) + return existing; + return new EssCertIDv2(Asn1Sequence.GetInstance(obj)); + } + + private EssCertIDv2( + Asn1Sequence seq) + { + if (seq.Count > 3) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + int count = 0; + + if (seq[0] is Asn1OctetString) + { + // Default value + this.hashAlgorithm = DefaultAlgID; + } + else + { + this.hashAlgorithm = AlgorithmIdentifier.GetInstance(seq[count++].ToAsn1Object()); + } + + this.certHash = Asn1OctetString.GetInstance(seq[count++].ToAsn1Object()).GetOctets(); + + if (seq.Count > count) + { + this.issuerSerial = IssuerSerial.GetInstance( + Asn1Sequence.GetInstance(seq[count].ToAsn1Object())); + } + } + + public EssCertIDv2(byte[] certHash) + : this(null, certHash, null) + { + } + + public EssCertIDv2( + AlgorithmIdentifier algId, + byte[] certHash) + : this(algId, certHash, null) + { + } + + public EssCertIDv2( + byte[] certHash, + IssuerSerial issuerSerial) + : this(null, certHash, issuerSerial) + { + } + + public EssCertIDv2( + AlgorithmIdentifier algId, + byte[] certHash, + IssuerSerial issuerSerial) + { + if (algId == null) + { + // Default value + this.hashAlgorithm = DefaultAlgID; + } + else + { + this.hashAlgorithm = algId; + } + + this.certHash = certHash; + this.issuerSerial = issuerSerial; + } + + public AlgorithmIdentifier HashAlgorithm + { + get { return this.hashAlgorithm; } + } + + public byte[] GetCertHash() + { + return Arrays.Clone(certHash); + } + + public IssuerSerial IssuerSerial + { + get { return issuerSerial; } + } + + /** + *
+         * EssCertIDv2 ::=  SEQUENCE {
+         *     hashAlgorithm     AlgorithmIdentifier
+         *              DEFAULT {algorithm id-sha256},
+         *     certHash          Hash,
+         *     issuerSerial      IssuerSerial OPTIONAL
+         * }
+         *
+         * Hash ::= OCTET STRING
+         *
+         * IssuerSerial ::= SEQUENCE {
+         *     issuer         GeneralNames,
+         *     serialNumber   CertificateSerialNumber
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (!hashAlgorithm.Equals(DefaultAlgID)) + { + v.Add(hashAlgorithm); + } + + v.Add(new DerOctetString(certHash).ToAsn1Object()); + + if (issuerSerial != null) + { + v.Add(issuerSerial); + } + + return new DerSequence(v); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertIDv2.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertIDv2.cs.meta new file mode 100644 index 00000000..e288d96f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/ESSCertIDv2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 97aacaa98ec473e45b9bece6d113dd65 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherCertID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherCertID.cs new file mode 100644 index 00000000..e05525be --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherCertID.cs @@ -0,0 +1,138 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess +{ + [Obsolete("Use version in Asn1.Esf instead")] + public class OtherCertID + : Asn1Encodable + { + private Asn1Encodable otherCertHash; + private IssuerSerial issuerSerial; + + public static OtherCertID GetInstance( + object o) + { + if (o == null || o is OtherCertID) + { + return (OtherCertID) o; + } + + if (o is Asn1Sequence) + { + return new OtherCertID((Asn1Sequence) o); + } + + throw new ArgumentException( + "unknown object in 'OtherCertID' factory : " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o) + "."); + } + + /** + * constructor + */ + public OtherCertID( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 2) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + if (seq[0].ToAsn1Object() is Asn1OctetString) + { + otherCertHash = Asn1OctetString.GetInstance(seq[0]); + } + else + { + otherCertHash = DigestInfo.GetInstance(seq[0]); + } + + if (seq.Count > 1) + { + issuerSerial = IssuerSerial.GetInstance(Asn1Sequence.GetInstance(seq[1])); + } + } + + public OtherCertID( + AlgorithmIdentifier algId, + byte[] digest) + { + this.otherCertHash = new DigestInfo(algId, digest); + } + + public OtherCertID( + AlgorithmIdentifier algId, + byte[] digest, + IssuerSerial issuerSerial) + { + this.otherCertHash = new DigestInfo(algId, digest); + this.issuerSerial = issuerSerial; + } + + public AlgorithmIdentifier AlgorithmHash + { + get + { + if (otherCertHash.ToAsn1Object() is Asn1OctetString) + { + // SHA-1 + return new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1); + } + + return DigestInfo.GetInstance(otherCertHash).AlgorithmID; + } + } + + public byte[] GetCertHash() + { + if (otherCertHash.ToAsn1Object() is Asn1OctetString) + { + // SHA-1 + return ((Asn1OctetString) otherCertHash.ToAsn1Object()).GetOctets(); + } + + return DigestInfo.GetInstance(otherCertHash).GetDigest(); + } + + public IssuerSerial IssuerSerial + { + get { return issuerSerial; } + } + + /** + *
+		 * OtherCertID ::= SEQUENCE {
+		 *     otherCertHash    OtherHash,
+		 *     issuerSerial     IssuerSerial OPTIONAL }
+		 *
+		 * OtherHash ::= CHOICE {
+		 *     sha1Hash     OCTET STRING,
+		 *     otherHash    OtherHashAlgAndValue }
+		 *
+		 * OtherHashAlgAndValue ::= SEQUENCE {
+		 *     hashAlgorithm    AlgorithmIdentifier,
+		 *     hashValue        OCTET STRING }
+		 *
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(otherCertHash); + + if (issuerSerial != null) + { + v.Add(issuerSerial); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherCertID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherCertID.cs.meta new file mode 100644 index 00000000..a15bd52b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherCertID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 726de2871be4e95408a0f0c07d0e39a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherSigningCertificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherSigningCertificate.cs new file mode 100644 index 00000000..3edb8102 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherSigningCertificate.cs @@ -0,0 +1,114 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess +{ + [Obsolete("Use version in Asn1.Esf instead")] + public class OtherSigningCertificate + : Asn1Encodable + { + private Asn1Sequence certs, policies; + + public static OtherSigningCertificate GetInstance( + object o) + { + if (o == null || o is OtherSigningCertificate) + { + return (OtherSigningCertificate) o; + } + + if (o is Asn1Sequence) + { + return new OtherSigningCertificate((Asn1Sequence) o); + } + + throw new ArgumentException( + "unknown object in 'OtherSigningCertificate' factory : " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o) + "."); + } + + /** + * constructors + */ + public OtherSigningCertificate( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 2) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + this.certs = Asn1Sequence.GetInstance(seq[0]); + + if (seq.Count > 1) + { + this.policies = Asn1Sequence.GetInstance(seq[1]); + } + } + + public OtherSigningCertificate( + OtherCertID otherCertID) + { + certs = new DerSequence(otherCertID); + } + + public OtherCertID[] GetCerts() + { + OtherCertID[] cs = new OtherCertID[certs.Count]; + + for (int i = 0; i != certs.Count; ++i) + { + cs[i] = OtherCertID.GetInstance(certs[i]); + } + + return cs; + } + + public PolicyInformation[] GetPolicies() + { + if (policies == null) + { + return null; + } + + PolicyInformation[] ps = new PolicyInformation[policies.Count]; + + for (int i = 0; i != policies.Count; i++) + { + ps[i] = PolicyInformation.GetInstance(policies[i]); + } + + return ps; + } + + /** + * The definition of OtherSigningCertificate is + *
+		 * OtherSigningCertificate ::=  SEQUENCE {
+		 *      certs        SEQUENCE OF OtherCertID,
+		 *      policies     SEQUENCE OF PolicyInformation OPTIONAL
+		 * }
+		 * 
+ * id-aa-ets-otherSigCert OBJECT IDENTIFIER ::= { iso(1) + * member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + * smime(16) id-aa(2) 19 } + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certs); + + if (policies != null) + { + v.Add(policies); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherSigningCertificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherSigningCertificate.cs.meta new file mode 100644 index 00000000..352ac2b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/OtherSigningCertificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ed7f40da02d3244c809555016d1ac3b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificate.cs new file mode 100644 index 00000000..04a76e4c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificate.cs @@ -0,0 +1,113 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess +{ + public class SigningCertificate + : Asn1Encodable + { + private Asn1Sequence certs, policies; + + public static SigningCertificate GetInstance( + object o) + { + if (o == null || o is SigningCertificate) + { + return (SigningCertificate) o; + } + + if (o is Asn1Sequence) + { + return new SigningCertificate((Asn1Sequence) o); + } + + throw new ArgumentException( + "unknown object in 'SigningCertificate' factory : " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o) + "."); + } + + /** + * constructors + */ + public SigningCertificate( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 2) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + this.certs = Asn1Sequence.GetInstance(seq[0]); + + if (seq.Count > 1) + { + this.policies = Asn1Sequence.GetInstance(seq[1]); + } + } + + public SigningCertificate( + EssCertID essCertID) + { + certs = new DerSequence(essCertID); + } + + public EssCertID[] GetCerts() + { + EssCertID[] cs = new EssCertID[certs.Count]; + + for (int i = 0; i != certs.Count; i++) + { + cs[i] = EssCertID.GetInstance(certs[i]); + } + + return cs; + } + + public PolicyInformation[] GetPolicies() + { + if (policies == null) + { + return null; + } + + PolicyInformation[] ps = new PolicyInformation[policies.Count]; + + for (int i = 0; i != policies.Count; i++) + { + ps[i] = PolicyInformation.GetInstance(policies[i]); + } + + return ps; + } + + /** + * The definition of SigningCertificate is + *
+		 * SigningCertificate ::=  SEQUENCE {
+		 *      certs        SEQUENCE OF EssCertID,
+		 *      policies     SEQUENCE OF PolicyInformation OPTIONAL
+		 * }
+		 * 
+ * id-aa-signingCertificate OBJECT IDENTIFIER ::= { iso(1) + * member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + * smime(16) id-aa(2) 12 } + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certs); + + if (policies != null) + { + v.Add(policies); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificate.cs.meta new file mode 100644 index 00000000..343b5242 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ecb5cb440c6832c4397b528afb561193 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificateV2.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificateV2.cs new file mode 100644 index 00000000..7bf8fe47 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificateV2.cs @@ -0,0 +1,117 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess +{ + public class SigningCertificateV2 + : Asn1Encodable + { + private readonly Asn1Sequence certs; + private readonly Asn1Sequence policies; + + public static SigningCertificateV2 GetInstance( + object o) + { + if (o == null || o is SigningCertificateV2) + return (SigningCertificateV2) o; + + if (o is Asn1Sequence) + return new SigningCertificateV2((Asn1Sequence) o); + + throw new ArgumentException( + "unknown object in 'SigningCertificateV2' factory : " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o) + "."); + } + + private SigningCertificateV2( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.certs = Asn1Sequence.GetInstance(seq[0].ToAsn1Object()); + + if (seq.Count > 1) + { + this.policies = Asn1Sequence.GetInstance(seq[1].ToAsn1Object()); + } + } + + public SigningCertificateV2( + EssCertIDv2 cert) + { + this.certs = new DerSequence(cert); + } + + public SigningCertificateV2( + EssCertIDv2[] certs) + { + this.certs = new DerSequence(certs); + } + + public SigningCertificateV2( + EssCertIDv2[] certs, + PolicyInformation[] policies) + { + this.certs = new DerSequence(certs); + + if (policies != null) + { + this.policies = new DerSequence(policies); + } + } + + public EssCertIDv2[] GetCerts() + { + EssCertIDv2[] certIds = new EssCertIDv2[certs.Count]; + for (int i = 0; i != certs.Count; i++) + { + certIds[i] = EssCertIDv2.GetInstance(certs[i]); + } + return certIds; + } + + public PolicyInformation[] GetPolicies() + { + if (policies == null) + return null; + + PolicyInformation[] policyInformations = new PolicyInformation[policies.Count]; + for (int i = 0; i != policies.Count; i++) + { + policyInformations[i] = PolicyInformation.GetInstance(policies[i]); + } + return policyInformations; + } + + /** + * The definition of SigningCertificateV2 is + *
+         * SigningCertificateV2 ::=  SEQUENCE {
+         *      certs        SEQUENCE OF EssCertIDv2,
+         *      policies     SEQUENCE OF PolicyInformation OPTIONAL
+         * }
+         * 
+ * id-aa-signingCertificateV2 OBJECT IDENTIFIER ::= { iso(1) + * member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) + * smime(16) id-aa(2) 47 } + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(certs); + + if (policies != null) + { + v.Add(policies); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificateV2.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificateV2.cs.meta new file mode 100644 index 00000000..94a9547e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ess/SigningCertificateV2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f785e4cf85621947934ef4f8c805604 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm.meta new file mode 100644 index 00000000..80c96170 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 65d7766a734038745a7014d928c85edb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMNamedCurves.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMNamedCurves.cs new file mode 100644 index 00000000..a3cd3faf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMNamedCurves.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM +{ + public sealed class GMNamedCurves + { + private GMNamedCurves() + { + } + + private static ECCurve ConfigureCurve(ECCurve curve) + { + return curve; + } + + private static BigInteger FromHex(string hex) + { + return new BigInteger(1, Hex.Decode(hex)); + } + + /* + * sm2p256v1 + */ + internal class SM2P256V1Holder + : X9ECParametersHolder + { + private SM2P256V1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new SM2P256V1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger p = FromHex("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF"); + BigInteger a = FromHex("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC"); + BigInteger b = FromHex("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93"); + byte[] S = null; + BigInteger n = FromHex("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7" + + "BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * wapip192v1 + */ + internal class WapiP192V1Holder + : X9ECParametersHolder + { + private WapiP192V1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new WapiP192V1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger p = FromHex("BDB6F4FE3E8B1D9E0DA8C0D46F4C318CEFE4AFE3B6B8551F"); + BigInteger a = FromHex("BB8E5E8FBC115E139FE6A814FE48AAA6F0ADA1AA5DF91985"); + BigInteger b = FromHex("1854BEBDC31B21B7AEFC80AB0ECD10D5B1B3308E6DBF11C1"); + byte[] S = null; + BigInteger n = FromHex("BDB6F4FE3E8B1D9E0DA8C0D40FC962195DFAE76F56564677"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "4AD5F7048DE709AD51236DE6" + "5E4D4B482C836DC6E4106640" + + "02BB3A02D4AAADACAE24817A" + "4CA3A1B014B5270432DB27D2")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + + private static readonly IDictionary objIds = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary curves = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary names = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + private static void DefineCurve( + string name, + DerObjectIdentifier oid, + X9ECParametersHolder holder) + { + objIds.Add(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name), oid); + names.Add(oid, name); + curves.Add(oid, holder); + } + + static GMNamedCurves() + { + DefineCurve("wapip192v1", GMObjectIdentifiers.wapip192v1, WapiP192V1Holder.Instance); + DefineCurve("sm2p256v1", GMObjectIdentifiers.sm2p256v1, SM2P256V1Holder.Instance); + } + + public static X9ECParameters GetByName( + string name) + { + DerObjectIdentifier oid = GetOid(name); + return oid == null ? null : GetByOid(oid); + } + + /** + * return the X9ECParameters object for the named curve represented by + * the passed in object identifier. Null if the curve isn't present. + * + * @param oid an object identifier representing a named curve, if present. + */ + public static X9ECParameters GetByOid( + DerObjectIdentifier oid) + { + X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid]; + return holder == null ? null : holder.Parameters; + } + + /** + * return the object identifier signified by the passed in name. Null + * if there is no object identifier associated with name. + * + * @return the object identifier associated with name, if present. + */ + public static DerObjectIdentifier GetOid( + string name) + { + return (DerObjectIdentifier)objIds[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name)]; + } + + /** + * return the named curve name represented by the given object identifier. + */ + public static string GetName( + DerObjectIdentifier oid) + { + return (string)names[oid]; + } + + /** + * returns an enumeration containing the name strings for curves + * contained in this structure. + */ + public static IEnumerable Names + { + get { return new EnumerableProxy(names.Values); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMNamedCurves.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMNamedCurves.cs.meta new file mode 100644 index 00000000..afc2482e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMNamedCurves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 535b199f82fd148449c845d63b040acf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMObjectIdentifiers.cs new file mode 100644 index 00000000..2f2b66ff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMObjectIdentifiers.cs @@ -0,0 +1,89 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM +{ + public abstract class GMObjectIdentifiers + { + public static readonly DerObjectIdentifier sm_scheme = new DerObjectIdentifier("1.2.156.10197.1"); + + public static readonly DerObjectIdentifier sm6_ecb = sm_scheme.Branch("101.1"); + public static readonly DerObjectIdentifier sm6_cbc = sm_scheme.Branch("101.2"); + public static readonly DerObjectIdentifier sm6_ofb128 = sm_scheme.Branch("101.3"); + public static readonly DerObjectIdentifier sm6_cfb128 = sm_scheme.Branch("101.4"); + + public static readonly DerObjectIdentifier sm1_ecb = sm_scheme.Branch("102.1"); + public static readonly DerObjectIdentifier sm1_cbc = sm_scheme.Branch("102.2"); + public static readonly DerObjectIdentifier sm1_ofb128 = sm_scheme.Branch("102.3"); + public static readonly DerObjectIdentifier sm1_cfb128 = sm_scheme.Branch("102.4"); + public static readonly DerObjectIdentifier sm1_cfb1 = sm_scheme.Branch("102.5"); + public static readonly DerObjectIdentifier sm1_cfb8 = sm_scheme.Branch("102.6"); + + public static readonly DerObjectIdentifier ssf33_ecb = sm_scheme.Branch("103.1"); + public static readonly DerObjectIdentifier ssf33_cbc = sm_scheme.Branch("103.2"); + public static readonly DerObjectIdentifier ssf33_ofb128 = sm_scheme.Branch("103.3"); + public static readonly DerObjectIdentifier ssf33_cfb128 = sm_scheme.Branch("103.4"); + public static readonly DerObjectIdentifier ssf33_cfb1 = sm_scheme.Branch("103.5"); + public static readonly DerObjectIdentifier ssf33_cfb8 = sm_scheme.Branch("103.6"); + + public static readonly DerObjectIdentifier sms4_ecb = sm_scheme.Branch("104.1"); + public static readonly DerObjectIdentifier sms4_cbc = sm_scheme.Branch("104.2"); + public static readonly DerObjectIdentifier sms4_ofb128 = sm_scheme.Branch("104.3"); + public static readonly DerObjectIdentifier sms4_cfb128 = sm_scheme.Branch("104.4"); + public static readonly DerObjectIdentifier sms4_cfb1 = sm_scheme.Branch("104.5"); + public static readonly DerObjectIdentifier sms4_cfb8 = sm_scheme.Branch("104.6"); + public static readonly DerObjectIdentifier sms4_ctr = sm_scheme.Branch("104.7"); + public static readonly DerObjectIdentifier sms4_gcm = sm_scheme.Branch("104.8"); + public static readonly DerObjectIdentifier sms4_ccm = sm_scheme.Branch("104.9"); + public static readonly DerObjectIdentifier sms4_xts = sm_scheme.Branch("104.10"); + public static readonly DerObjectIdentifier sms4_wrap = sm_scheme.Branch("104.11"); + public static readonly DerObjectIdentifier sms4_wrap_pad = sm_scheme.Branch("104.12"); + public static readonly DerObjectIdentifier sms4_ocb = sm_scheme.Branch("104.100"); + + public static readonly DerObjectIdentifier sm5 = sm_scheme.Branch("201"); + + public static readonly DerObjectIdentifier sm2p256v1 = sm_scheme.Branch("301"); + public static readonly DerObjectIdentifier sm2sign = sm_scheme.Branch("301.1"); + public static readonly DerObjectIdentifier sm2exchange = sm_scheme.Branch("301.2"); + public static readonly DerObjectIdentifier sm2encrypt = sm_scheme.Branch("301.3"); + + public static readonly DerObjectIdentifier wapip192v1 = sm_scheme.Branch("301.101"); + + public static readonly DerObjectIdentifier sm2encrypt_recommendedParameters = sm2encrypt.Branch("1"); + public static readonly DerObjectIdentifier sm2encrypt_specifiedParameters = sm2encrypt.Branch("2"); + public static readonly DerObjectIdentifier sm2encrypt_with_sm3 = sm2encrypt.Branch("2.1"); + public static readonly DerObjectIdentifier sm2encrypt_with_sha1 = sm2encrypt.Branch("2.2"); + public static readonly DerObjectIdentifier sm2encrypt_with_sha224 = sm2encrypt.Branch("2.3"); + public static readonly DerObjectIdentifier sm2encrypt_with_sha256 = sm2encrypt.Branch("2.4"); + public static readonly DerObjectIdentifier sm2encrypt_with_sha384 = sm2encrypt.Branch("2.5"); + public static readonly DerObjectIdentifier sm2encrypt_with_sha512 = sm2encrypt.Branch("2.6"); + public static readonly DerObjectIdentifier sm2encrypt_with_rmd160 = sm2encrypt.Branch("2.7"); + public static readonly DerObjectIdentifier sm2encrypt_with_whirlpool = sm2encrypt.Branch("2.8"); + public static readonly DerObjectIdentifier sm2encrypt_with_blake2b512 = sm2encrypt.Branch("2.9"); + public static readonly DerObjectIdentifier sm2encrypt_with_blake2s256 = sm2encrypt.Branch("2.10"); + public static readonly DerObjectIdentifier sm2encrypt_with_md5 = sm2encrypt.Branch("2.11"); + + public static readonly DerObjectIdentifier id_sm9PublicKey = sm_scheme.Branch("302"); + public static readonly DerObjectIdentifier sm9sign = sm_scheme.Branch("302.1"); + public static readonly DerObjectIdentifier sm9keyagreement = sm_scheme.Branch("302.2"); + public static readonly DerObjectIdentifier sm9encrypt = sm_scheme.Branch("302.3"); + + public static readonly DerObjectIdentifier sm3 = sm_scheme.Branch("401"); + + public static readonly DerObjectIdentifier hmac_sm3 = sm3.Branch("2"); + + public static readonly DerObjectIdentifier sm2sign_with_sm3 = sm_scheme.Branch("501"); + public static readonly DerObjectIdentifier sm2sign_with_sha1 = sm_scheme.Branch("502"); + public static readonly DerObjectIdentifier sm2sign_with_sha256 = sm_scheme.Branch("503"); + public static readonly DerObjectIdentifier sm2sign_with_sha512 = sm_scheme.Branch("504"); + public static readonly DerObjectIdentifier sm2sign_with_sha224 = sm_scheme.Branch("505"); + public static readonly DerObjectIdentifier sm2sign_with_sha384 = sm_scheme.Branch("506"); + public static readonly DerObjectIdentifier sm2sign_with_rmd160 = sm_scheme.Branch("507"); + public static readonly DerObjectIdentifier sm2sign_with_whirlpool = sm_scheme.Branch("520"); + public static readonly DerObjectIdentifier sm2sign_with_blake2b512 = sm_scheme.Branch("521"); + public static readonly DerObjectIdentifier sm2sign_with_blake2s256 = sm_scheme.Branch("522"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMObjectIdentifiers.cs.meta new file mode 100644 index 00000000..4ae4e01a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gm/GMObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 23f63dbcf505ada4c8f01fa93a0e2a52 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu.meta new file mode 100644 index 00000000..3fb7837d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 38e3e44dacb703b46859a58b3956fe2e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu/GNUObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu/GNUObjectIdentifiers.cs new file mode 100644 index 00000000..55b8b3bf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu/GNUObjectIdentifiers.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Gnu +{ + public abstract class GnuObjectIdentifiers + { + public static readonly DerObjectIdentifier Gnu = new DerObjectIdentifier("1.3.6.1.4.1.11591.1"); // GNU Radius + public static readonly DerObjectIdentifier GnuPG = new DerObjectIdentifier("1.3.6.1.4.1.11591.2"); // GnuPG (Ägypten) + public static readonly DerObjectIdentifier Notation = new DerObjectIdentifier("1.3.6.1.4.1.11591.2.1"); // notation + public static readonly DerObjectIdentifier PkaAddress = new DerObjectIdentifier("1.3.6.1.4.1.11591.2.1.1"); // pkaAddress + public static readonly DerObjectIdentifier GnuRadar = new DerObjectIdentifier("1.3.6.1.4.1.11591.3"); // GNU Radar + public static readonly DerObjectIdentifier DigestAlgorithm = new DerObjectIdentifier("1.3.6.1.4.1.11591.12"); // digestAlgorithm + public static readonly DerObjectIdentifier Tiger192 = new DerObjectIdentifier("1.3.6.1.4.1.11591.12.2"); // TIGER/192 + public static readonly DerObjectIdentifier EncryptionAlgorithm = new DerObjectIdentifier("1.3.6.1.4.1.11591.13"); // encryptionAlgorithm + public static readonly DerObjectIdentifier Serpent = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2"); // Serpent + public static readonly DerObjectIdentifier Serpent128Ecb = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.1"); // Serpent-128-ECB + public static readonly DerObjectIdentifier Serpent128Cbc = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.2"); // Serpent-128-CBC + public static readonly DerObjectIdentifier Serpent128Ofb = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.3"); // Serpent-128-OFB + public static readonly DerObjectIdentifier Serpent128Cfb = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.4"); // Serpent-128-CFB + public static readonly DerObjectIdentifier Serpent192Ecb = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.21"); // Serpent-192-ECB + public static readonly DerObjectIdentifier Serpent192Cbc = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.22"); // Serpent-192-CBC + public static readonly DerObjectIdentifier Serpent192Ofb = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.23"); // Serpent-192-OFB + public static readonly DerObjectIdentifier Serpent192Cfb = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.24"); // Serpent-192-CFB + public static readonly DerObjectIdentifier Serpent256Ecb = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.41"); // Serpent-256-ECB + public static readonly DerObjectIdentifier Serpent256Cbc = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.42"); // Serpent-256-CBC + public static readonly DerObjectIdentifier Serpent256Ofb = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.43"); // Serpent-256-OFB + public static readonly DerObjectIdentifier Serpent256Cfb = new DerObjectIdentifier("1.3.6.1.4.1.11591.13.2.44"); // Serpent-256-CFB + public static readonly DerObjectIdentifier Crc = new DerObjectIdentifier("1.3.6.1.4.1.11591.14"); // CRC algorithms + public static readonly DerObjectIdentifier Crc32 = new DerObjectIdentifier("1.3.6.1.4.1.11591.14.1"); // CRC 32 + + /** 1.3.6.1.4.1.11591.15 - ellipticCurve */ + public static readonly DerObjectIdentifier EllipticCurve = new DerObjectIdentifier("1.3.6.1.4.1.11591.15"); + + public static readonly DerObjectIdentifier Ed25519 = EllipticCurve.Branch("1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu/GNUObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu/GNUObjectIdentifiers.cs.meta new file mode 100644 index 00000000..0379a87f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/gnu/GNUObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f404fe2564f43a449f5497f81afcd2d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana.meta new file mode 100644 index 00000000..fab96f15 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e16237bf0f5bb14e8475973550804e3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana/IANAObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana/IANAObjectIdentifiers.cs new file mode 100644 index 00000000..395ce69b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana/IANAObjectIdentifiers.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Iana +{ + public abstract class IanaObjectIdentifiers + { + // id-SHA1 OBJECT IDENTIFIER ::= + // {iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) ipsec(8) isakmpOakley(1)} + // + + public static readonly DerObjectIdentifier IsakmpOakley = new DerObjectIdentifier("1.3.6.1.5.5.8.1"); + + public static readonly DerObjectIdentifier HmacMD5 = new DerObjectIdentifier(IsakmpOakley + ".1"); + public static readonly DerObjectIdentifier HmacSha1 = new DerObjectIdentifier(IsakmpOakley + ".2"); + + public static readonly DerObjectIdentifier HmacTiger = new DerObjectIdentifier(IsakmpOakley + ".3"); + + public static readonly DerObjectIdentifier HmacRipeMD160 = new DerObjectIdentifier(IsakmpOakley + ".4"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana/IANAObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana/IANAObjectIdentifiers.cs.meta new file mode 100644 index 00000000..d919d73a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/iana/IANAObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8cd1511c90406684f8d5a303e45a9012 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao.meta new file mode 100644 index 00000000..df5c9201 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6ad23146b2034f54784ce73af93d939e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/CscaMasterList.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/CscaMasterList.cs new file mode 100644 index 00000000..5d34ca72 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/CscaMasterList.cs @@ -0,0 +1,87 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Icao +{ + /** + * The CscaMasterList object. This object can be wrapped in a + * CMSSignedData to be published in LDAP. + * + *
+	 * CscaMasterList ::= SEQUENCE {
+	 *   version                CscaMasterListVersion,
+	 *   certList               SET OF Certificate }
+	 *   
+	 * CscaMasterListVersion :: INTEGER {v0(0)}
+	 * 
+ */ + public class CscaMasterList + : Asn1Encodable + { + private DerInteger version = new DerInteger(0); + private X509CertificateStructure[] certList; + + public static CscaMasterList GetInstance( + object obj) + { + if (obj is CscaMasterList) + return (CscaMasterList)obj; + + if (obj != null) + return new CscaMasterList(Asn1Sequence.GetInstance(obj)); + + return null; + } + + private CscaMasterList( + Asn1Sequence seq) + { + if (seq == null || seq.Count == 0) + throw new ArgumentException("null or empty sequence passed."); + + if (seq.Count != 2) + throw new ArgumentException("Incorrect sequence size: " + seq.Count); + + this.version = DerInteger.GetInstance(seq[0]); + + Asn1Set certSet = Asn1Set.GetInstance(seq[1]); + + this.certList = new X509CertificateStructure[certSet.Count]; + for (int i = 0; i < certList.Length; i++) + { + certList[i] = X509CertificateStructure.GetInstance(certSet[i]); + } + } + + public CscaMasterList( + X509CertificateStructure[] certStructs) + { + certList = CopyCertList(certStructs); + } + + public virtual int Version + { + get { return version.Value.IntValue; } + } + + public X509CertificateStructure[] GetCertStructs() + { + return CopyCertList(certList); + } + + private static X509CertificateStructure[] CopyCertList(X509CertificateStructure[] orig) + { + return (X509CertificateStructure[])orig.Clone(); + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(version, new DerSet(certList)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/CscaMasterList.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/CscaMasterList.cs.meta new file mode 100644 index 00000000..81b4aabc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/CscaMasterList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 673e1f5e682b5fd4a85c571cec2f0a2f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/DataGroupHash.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/DataGroupHash.cs new file mode 100644 index 00000000..d79b0c98 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/DataGroupHash.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Icao +{ + /** + * The DataGroupHash object. + *
+    * DataGroupHash  ::=  SEQUENCE {
+    *      dataGroupNumber         DataGroupNumber,
+    *      dataGroupHashValue     OCTET STRING }
+    *
+    * DataGroupNumber ::= INTEGER {
+    *         dataGroup1    (1),
+    *         dataGroup1    (2),
+    *         dataGroup1    (3),
+    *         dataGroup1    (4),
+    *         dataGroup1    (5),
+    *         dataGroup1    (6),
+    *         dataGroup1    (7),
+    *         dataGroup1    (8),
+    *         dataGroup1    (9),
+    *         dataGroup1    (10),
+    *         dataGroup1    (11),
+    *         dataGroup1    (12),
+    *         dataGroup1    (13),
+    *         dataGroup1    (14),
+    *         dataGroup1    (15),
+    *         dataGroup1    (16) }
+    *
+    * 
+ */ + public class DataGroupHash + : Asn1Encodable + { + private readonly DerInteger dataGroupNumber; + private readonly Asn1OctetString dataGroupHashValue; + + public static DataGroupHash GetInstance( + object obj) + { + if (obj is DataGroupHash) + return (DataGroupHash)obj; + + if (obj != null) + return new DataGroupHash(Asn1Sequence.GetInstance(obj)); + + return null; + } + + private DataGroupHash( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + this.dataGroupNumber = DerInteger.GetInstance(seq[0]); + this.dataGroupHashValue = Asn1OctetString.GetInstance(seq[1]); + } + + public DataGroupHash( + int dataGroupNumber, + Asn1OctetString dataGroupHashValue) + { + this.dataGroupNumber = new DerInteger(dataGroupNumber); + this.dataGroupHashValue = dataGroupHashValue; + } + + public int DataGroupNumber + { + get { return dataGroupNumber.Value.IntValue; } + } + + public Asn1OctetString DataGroupHashValue + { + get { return dataGroupHashValue; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(dataGroupNumber, dataGroupHashValue); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/DataGroupHash.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/DataGroupHash.cs.meta new file mode 100644 index 00000000..852ce826 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/DataGroupHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b2e8130e8ec694947aa88179a7b9b1c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/ICAOObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/ICAOObjectIdentifiers.cs new file mode 100644 index 00000000..1f14c3fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/ICAOObjectIdentifiers.cs @@ -0,0 +1,38 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Icao +{ + public abstract class IcaoObjectIdentifiers + { + // + // base id + // + public static readonly DerObjectIdentifier IdIcao = new DerObjectIdentifier("2.23.136"); + + public static readonly DerObjectIdentifier IdIcaoMrtd = IdIcao.Branch("1"); + public static readonly DerObjectIdentifier IdIcaoMrtdSecurity = IdIcaoMrtd.Branch("1"); + + // LDS security object, see ICAO Doc 9303-Volume 2-Section IV-A3.2 + public static readonly DerObjectIdentifier IdIcaoLdsSecurityObject = IdIcaoMrtdSecurity.Branch("1"); + + // CSCA master list, see TR CSCA Countersigning and Master List issuance + public static readonly DerObjectIdentifier IdIcaoCscaMasterList = IdIcaoMrtdSecurity.Branch("2"); + public static readonly DerObjectIdentifier IdIcaoCscaMasterListSigningKey = IdIcaoMrtdSecurity.Branch("3"); + + // document type list, see draft TR LDS and PKI Maintenance, par. 3.2.1 + public static readonly DerObjectIdentifier IdIcaoDocumentTypeList = IdIcaoMrtdSecurity.Branch("4"); + + // Active Authentication protocol, see draft TR LDS and PKI Maintenance, + // par. 5.2.2 + public static readonly DerObjectIdentifier IdIcaoAAProtocolObject = IdIcaoMrtdSecurity.Branch("5"); + + // CSCA name change and key reoll-over, see draft TR LDS and PKI + // Maintenance, par. 3.2.1 + public static readonly DerObjectIdentifier IdIcaoExtensions = IdIcaoMrtdSecurity.Branch("6"); + public static readonly DerObjectIdentifier IdIcaoExtensionsNamechangekeyrollover = IdIcaoExtensions.Branch("1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/ICAOObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/ICAOObjectIdentifiers.cs.meta new file mode 100644 index 00000000..cd668fda --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/ICAOObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b075f6182a901d141ba71d90145241b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSSecurityObject.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSSecurityObject.cs new file mode 100644 index 00000000..19472629 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSSecurityObject.cs @@ -0,0 +1,149 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Icao +{ + /** + * The LDSSecurityObject object (V1.8). + *
+	 * LDSSecurityObject ::= SEQUENCE {
+	 *   version                LDSSecurityObjectVersion,
+	 *   hashAlgorithm          DigestAlgorithmIdentifier,
+	 *   dataGroupHashValues    SEQUENCE SIZE (2..ub-DataGroups) OF DataHashGroup,
+	 *   ldsVersionInfo         LDSVersionInfo OPTIONAL
+	 *     -- if present, version MUST be v1 }
+	 *
+	 * DigestAlgorithmIdentifier ::= AlgorithmIdentifier,
+	 *
+	 * LDSSecurityObjectVersion :: INTEGER {V0(0)}
+	 * 
+ */ + public class LdsSecurityObject + : Asn1Encodable + { + public const int UBDataGroups = 16; + + private DerInteger version = new DerInteger(0); + private AlgorithmIdentifier digestAlgorithmIdentifier; + private DataGroupHash[] datagroupHash; + private LdsVersionInfo versionInfo; + + public static LdsSecurityObject GetInstance( + object obj) + { + if (obj is LdsSecurityObject) + return (LdsSecurityObject)obj; + + if (obj != null) + return new LdsSecurityObject(Asn1Sequence.GetInstance(obj)); + + return null; + } + + private LdsSecurityObject( + Asn1Sequence seq) + { + if (seq == null || seq.Count == 0) + throw new ArgumentException("null or empty sequence passed."); + + IEnumerator e = seq.GetEnumerator(); + + // version + e.MoveNext(); + version = DerInteger.GetInstance(e.Current); + // digestAlgorithmIdentifier + e.MoveNext(); + digestAlgorithmIdentifier = AlgorithmIdentifier.GetInstance(e.Current); + + e.MoveNext(); + Asn1Sequence datagroupHashSeq = Asn1Sequence.GetInstance(e.Current); + + if (version.Value.Equals(BigInteger.One)) + { + e.MoveNext(); + versionInfo = LdsVersionInfo.GetInstance(e.Current); + } + + CheckDatagroupHashSeqSize(datagroupHashSeq.Count); + + datagroupHash = new DataGroupHash[datagroupHashSeq.Count]; + for (int i= 0; i< datagroupHashSeq.Count; i++) + { + datagroupHash[i] = DataGroupHash.GetInstance(datagroupHashSeq[i]); + } + } + + public LdsSecurityObject( + AlgorithmIdentifier digestAlgorithmIdentifier, + DataGroupHash[] datagroupHash) + { + this.version = new DerInteger(0); + this.digestAlgorithmIdentifier = digestAlgorithmIdentifier; + this.datagroupHash = datagroupHash; + + CheckDatagroupHashSeqSize(datagroupHash.Length); + } + + + public LdsSecurityObject( + AlgorithmIdentifier digestAlgorithmIdentifier, + DataGroupHash[] datagroupHash, + LdsVersionInfo versionInfo) + { + this.version = new DerInteger(1); + this.digestAlgorithmIdentifier = digestAlgorithmIdentifier; + this.datagroupHash = datagroupHash; + this.versionInfo = versionInfo; + + CheckDatagroupHashSeqSize(datagroupHash.Length); + } + + private void CheckDatagroupHashSeqSize(int size) + { + if (size < 2 || size > UBDataGroups) + throw new ArgumentException("wrong size in DataGroupHashValues : not in (2.."+ UBDataGroups +")"); + } + + public BigInteger Version + { + get { return version.Value; } + } + + public AlgorithmIdentifier DigestAlgorithmIdentifier + { + get { return digestAlgorithmIdentifier; } + } + + public DataGroupHash[] GetDatagroupHash() + { + return datagroupHash; + } + + public LdsVersionInfo VersionInfo + { + get { return versionInfo; } + } + + public override Asn1Object ToAsn1Object() + { + DerSequence hashSeq = new DerSequence(datagroupHash); + + Asn1EncodableVector v = new Asn1EncodableVector(version, digestAlgorithmIdentifier, hashSeq); + + if (versionInfo != null) + { + v.Add(versionInfo); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSSecurityObject.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSSecurityObject.cs.meta new file mode 100644 index 00000000..0395ed04 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSSecurityObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f249d42c49a0974c99a8ea26510af18 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSVersionInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSVersionInfo.cs new file mode 100644 index 00000000..4407e143 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSVersionInfo.cs @@ -0,0 +1,65 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Icao +{ + public class LdsVersionInfo + : Asn1Encodable + { + private DerPrintableString ldsVersion; + private DerPrintableString unicodeVersion; + + public LdsVersionInfo(string ldsVersion, string unicodeVersion) + { + this.ldsVersion = new DerPrintableString(ldsVersion); + this.unicodeVersion = new DerPrintableString(unicodeVersion); + } + + private LdsVersionInfo(Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("sequence wrong size for LDSVersionInfo", "seq"); + + this.ldsVersion = DerPrintableString.GetInstance(seq[0]); + this.unicodeVersion = DerPrintableString.GetInstance(seq[1]); + } + + public static LdsVersionInfo GetInstance(object obj) + { + if (obj is LdsVersionInfo) + return (LdsVersionInfo)obj; + + if (obj != null) + return new LdsVersionInfo(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public virtual string GetLdsVersion() + { + return ldsVersion.GetString(); + } + + public virtual string GetUnicodeVersion() + { + return unicodeVersion.GetString(); + } + + /** + *
+		 * LDSVersionInfo ::= SEQUENCE {
+		 *    ldsVersion PRINTABLE STRING
+		 *    unicodeVersion PRINTABLE STRING
+		 *  }
+		 * 
+ * @return + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(ldsVersion, unicodeVersion); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSVersionInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSVersionInfo.cs.meta new file mode 100644 index 00000000..f0b9007d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/icao/LDSVersionInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc5cd50c808246b4ea60097a0befbc88 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt.meta new file mode 100644 index 00000000..d0ce4def --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f34c4124bf07f0a4a99df098156d3a27 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ISISMTTObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ISISMTTObjectIdentifiers.cs new file mode 100644 index 00000000..09678c5a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ISISMTTObjectIdentifiers.cs @@ -0,0 +1,181 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt +{ + public abstract class IsisMttObjectIdentifiers + { + public static readonly DerObjectIdentifier IdIsisMtt = new DerObjectIdentifier("1.3.36.8"); + + public static readonly DerObjectIdentifier IdIsisMttCP = new DerObjectIdentifier(IdIsisMtt + ".1"); + + /** + * The id-isismtt-cp-accredited OID indicates that the certificate is a + * qualified certificate according to Directive 1999/93/EC of the European + * Parliament and of the Council of 13 December 1999 on a Community + * Framework for Electronic Signatures, which additionally conforms the + * special requirements of the SigG and has been issued by an accredited CA. + */ + public static readonly DerObjectIdentifier IdIsisMttCPAccredited = new DerObjectIdentifier(IdIsisMttCP + ".1"); + + public static readonly DerObjectIdentifier IdIsisMttAT = new DerObjectIdentifier(IdIsisMtt + ".3"); + + /** + * Certificate extensionDate of certificate generation + * + *
+		 *		DateOfCertGenSyntax ::= GeneralizedTime
+		 * 
+ */ + public static readonly DerObjectIdentifier IdIsisMttATDateOfCertGen = new DerObjectIdentifier(IdIsisMttAT + ".1"); + + /** + * Attribute to indicate that the certificate holder may sign in the name of + * a third person. May also be used as extension in a certificate. + */ + public static readonly DerObjectIdentifier IdIsisMttATProcuration = new DerObjectIdentifier(IdIsisMttAT + ".2"); + + /** + * Attribute to indicate admissions to certain professions. May be used as + * attribute in attribute certificate or as extension in a certificate + */ + public static readonly DerObjectIdentifier IdIsisMttATAdmission = new DerObjectIdentifier(IdIsisMttAT + ".3"); + + /** + * Monetary limit for transactions. The QcEuMonetaryLimit QC statement MUST + * be used in new certificates in place of the extension/attribute + * MonetaryLimit since January 1, 2004. For the sake of backward + * compatibility with certificates already in use, SigG conforming + * components MUST support MonetaryLimit (as well as QcEuLimitValue). + */ + public static readonly DerObjectIdentifier IdIsisMttATMonetaryLimit = new DerObjectIdentifier(IdIsisMttAT + ".4"); + + /** + * A declaration of majority. May be used as attribute in attribute + * certificate or as extension in a certificate + */ + public static readonly DerObjectIdentifier IdIsisMttATDeclarationOfMajority = new DerObjectIdentifier(IdIsisMttAT + ".5"); + + /** + * + * Serial number of the smart card containing the corresponding private key + * + *
+		 *		ICCSNSyntax ::= OCTET STRING (SIZE(8..20))
+		 * 
+ */ + public static readonly DerObjectIdentifier IdIsisMttATIccsn = new DerObjectIdentifier(IdIsisMttAT + ".6"); + + /** + * + * Reference for a file of a smartcard that stores the public key of this + * certificate and that is used as �security anchor�. + * + *
+		 *		PKReferenceSyntax ::= OCTET STRING (SIZE(20))
+		 * 
+ */ + public static readonly DerObjectIdentifier IdIsisMttATPKReference = new DerObjectIdentifier(IdIsisMttAT + ".7"); + + /** + * Some other restriction regarding the usage of this certificate. May be + * used as attribute in attribute certificate or as extension in a + * certificate. + * + *
+		 *		RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
+		 * 
+ * + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.Restriction + */ + public static readonly DerObjectIdentifier IdIsisMttATRestriction = new DerObjectIdentifier(IdIsisMttAT + ".8"); + + /** + * + * (Single)Request extension: Clients may include this extension in a + * (single) Request to request the responder to send the certificate in the + * response message along with the status information. Besides the LDAP + * service, this extension provides another mechanism for the distribution + * of certificates, which MAY optionally be provided by certificate + * repositories. + * + *
+		 *		RetrieveIfAllowed ::= BOOLEAN
+		 * 
+ */ + public static readonly DerObjectIdentifier IdIsisMttATRetrieveIfAllowed = new DerObjectIdentifier(IdIsisMttAT + ".9"); + + /** + * SingleOCSPResponse extension: The certificate requested by the client by + * inserting the RetrieveIfAllowed extension in the request, will be + * returned in this extension. + * + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.Ocsp.RequestedCertificate + */ + public static readonly DerObjectIdentifier IdIsisMttATRequestedCertificate = new DerObjectIdentifier(IdIsisMttAT + ".10"); + + /** + * Base ObjectIdentifier for naming authorities + */ + public static readonly DerObjectIdentifier IdIsisMttATNamingAuthorities = new DerObjectIdentifier(IdIsisMttAT + ".11"); + + /** + * SingleOCSPResponse extension: Date, when certificate has been published + * in the directory and status information has become available. Currently, + * accrediting authorities enforce that SigG-conforming OCSP servers include + * this extension in the responses. + * + *
+		 *		CertInDirSince ::= GeneralizedTime
+		 * 
+ */ + public static readonly DerObjectIdentifier IdIsisMttATCertInDirSince = new DerObjectIdentifier(IdIsisMttAT + ".12"); + + /** + * Hash of a certificate in OCSP. + * + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.Ocsp.CertHash + */ + public static readonly DerObjectIdentifier IdIsisMttATCertHash = new DerObjectIdentifier(IdIsisMttAT + ".13"); + + /** + *
+		 *		NameAtBirth ::= DirectoryString(SIZE(1..64)
+		 * 
+ * + * Used in + * {@link BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.SubjectDirectoryAttributes SubjectDirectoryAttributes} + */ + public static readonly DerObjectIdentifier IdIsisMttATNameAtBirth = new DerObjectIdentifier(IdIsisMttAT + ".14"); + + /** + * Some other information of non-restrictive nature regarding the usage of + * this certificate. May be used as attribute in atribute certificate or as + * extension in a certificate. + * + *
+		 *               AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
+		 * 
+ * + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.AdditionalInformationSyntax + */ + public static readonly DerObjectIdentifier IdIsisMttATAdditionalInformation = new DerObjectIdentifier(IdIsisMttAT + ".15"); + + /** + * Indicates that an attribute certificate exists, which limits the + * usability of this public key certificate. Whenever verifying a signature + * with the help of this certificate, the content of the corresponding + * attribute certificate should be concerned. This extension MUST be + * included in a PKC, if a corresponding attribute certificate (having the + * PKC as base certificate) contains some attribute that restricts the + * usability of the PKC too. Attribute certificates with restricting content + * MUST always be included in the signed document. + * + *
+		 *		LiabilityLimitationFlagSyntax ::= BOOLEAN
+		 * 
+ */ + public static readonly DerObjectIdentifier IdIsisMttATLiabilityLimitationFlag = new DerObjectIdentifier("0.2.262.1.10.12.0"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ISISMTTObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ISISMTTObjectIdentifiers.cs.meta new file mode 100644 index 00000000..f8acfcce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ISISMTTObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e3c9c5610f76c44f9193c35adb683d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp.meta new file mode 100644 index 00000000..6b8c4d03 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 253673684631a1e4e99ba19279b7cb38 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/CertHash.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/CertHash.cs new file mode 100644 index 00000000..18a645b3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/CertHash.cs @@ -0,0 +1,126 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.Ocsp +{ + /** + * ISIS-MTT PROFILE: The responder may include this extension in a response to + * send the hash of the requested certificate to the responder. This hash is + * cryptographically bound to the certificate and serves as evidence that the + * certificate is known to the responder (i.e. it has been issued and is present + * in the directory). Hence, this extension is a means to provide a positive + * statement of availability as described in T8.[8]. As explained in T13.[1], + * clients may rely on this information to be able to validate signatures after + * the expiry of the corresponding certificate. Hence, clients MUST support this + * extension. If a positive statement of availability is to be delivered, this + * extension syntax and OID MUST be used. + *

+ *

+ *

+	*     CertHash ::= SEQUENCE {
+	*       hashAlgorithm AlgorithmIdentifier,
+	*       certificateHash OCTET STRING
+	*     }
+	* 
+ */ + public class CertHash + : Asn1Encodable + { + private readonly AlgorithmIdentifier hashAlgorithm; + private readonly byte[] certificateHash; + + public static CertHash GetInstance( + object obj) + { + if (obj == null || obj is CertHash) + { + return (CertHash) obj; + } + + if (obj is Asn1Sequence) + { + return new CertHash((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + *

+ * The sequence is of type CertHash: + *

+ *

+		*     CertHash ::= SEQUENCE {
+		*       hashAlgorithm AlgorithmIdentifier,
+		*       certificateHash OCTET STRING
+		*     }
+		* 
+ * + * @param seq The ASN.1 sequence. + */ + private CertHash( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + this.hashAlgorithm = AlgorithmIdentifier.GetInstance(seq[0]); + this.certificateHash = DerOctetString.GetInstance(seq[1]).GetOctets(); + } + + /** + * Constructor from a given details. + * + * @param hashAlgorithm The hash algorithm identifier. + * @param certificateHash The hash of the whole DER encoding of the certificate. + */ + public CertHash( + AlgorithmIdentifier hashAlgorithm, + byte[] certificateHash) + { + if (hashAlgorithm == null) + throw new ArgumentNullException("hashAlgorithm"); + if (certificateHash == null) + throw new ArgumentNullException("certificateHash"); + + this.hashAlgorithm = hashAlgorithm; + this.certificateHash = (byte[]) certificateHash.Clone(); + } + + public AlgorithmIdentifier HashAlgorithm + { + get { return hashAlgorithm; } + } + + public byte[] CertificateHash + { + get { return (byte[]) certificateHash.Clone(); } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*     CertHash ::= SEQUENCE {
+		*       hashAlgorithm AlgorithmIdentifier,
+		*       certificateHash OCTET STRING
+		*     }
+		* 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(hashAlgorithm, new DerOctetString(certificateHash)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/CertHash.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/CertHash.cs.meta new file mode 100644 index 00000000..6b809fde --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/CertHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49e52b41d04217249919b3502b7c9def +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/RequestedCertificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/RequestedCertificate.cs new file mode 100644 index 00000000..a989a46d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/RequestedCertificate.cs @@ -0,0 +1,192 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.Ocsp +{ + /** + * ISIS-MTT-Optional: The certificate requested by the client by inserting the + * RetrieveIfAllowed extension in the request, will be returned in this + * extension. + *

+ * ISIS-MTT-SigG: The signature act allows publishing certificates only then, + * when the certificate owner gives his isExplicit permission. Accordingly, there + * may be �nondownloadable� certificates, about which the responder must provide + * status information, but MUST NOT include them in the response. Clients may + * get therefore the following three kind of answers on a single request + * including the RetrieveIfAllowed extension: + *

    + *
  • a) the responder supports the extension and is allowed to publish the + * certificate: RequestedCertificate returned including the requested + * certificate
  • + *
  • b) the responder supports the extension but is NOT allowed to publish + * the certificate: RequestedCertificate returned including an empty OCTET + * STRING
  • + *
  • c) the responder does not support the extension: RequestedCertificate is + * not included in the response
  • + *
+ * Clients requesting RetrieveIfAllowed MUST be able to handle these cases. If + * any of the OCTET STRING options is used, it MUST contain the DER encoding of + * the requested certificate. + *

+ *

+	*            RequestedCertificate ::= CHOICE {
+	*              Certificate Certificate,
+	*              publicKeyCertificate [0] EXPLICIT OCTET STRING,
+	*              attributeCertificate [1] EXPLICIT OCTET STRING
+	*            }
+	* 
+ */ + public class RequestedCertificate + : Asn1Encodable, IAsn1Choice + { + public enum Choice + { + Certificate = -1, + PublicKeyCertificate = 0, + AttributeCertificate = 1 + } + + private readonly X509CertificateStructure cert; + private readonly byte[] publicKeyCert; + private readonly byte[] attributeCert; + + public static RequestedCertificate GetInstance( + object obj) + { + if (obj == null || obj is RequestedCertificate) + { + return (RequestedCertificate) obj; + } + + if (obj is Asn1Sequence) + { + return new RequestedCertificate(X509CertificateStructure.GetInstance(obj)); + } + + if (obj is Asn1TaggedObject) + { + return new RequestedCertificate((Asn1TaggedObject) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static RequestedCertificate GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + if (!isExplicit) + throw new ArgumentException("choice item must be explicitly tagged"); + + return GetInstance(obj.GetObject()); + } + + private RequestedCertificate( + Asn1TaggedObject tagged) + { + switch ((Choice) tagged.TagNo) + { + case Choice.AttributeCertificate: + this.attributeCert = Asn1OctetString.GetInstance(tagged, true).GetOctets(); + break; + case Choice.PublicKeyCertificate: + this.publicKeyCert = Asn1OctetString.GetInstance(tagged, true).GetOctets(); + break; + default: + throw new ArgumentException("unknown tag number: " + tagged.TagNo); + } + } + + /** + * Constructor from a given details. + *

+ * Only one parameter can be given. All other must be null. + * + * @param certificate Given as Certificate + */ + public RequestedCertificate( + X509CertificateStructure certificate) + { + this.cert = certificate; + } + + public RequestedCertificate( + Choice type, + byte[] certificateOctets) + : this(new DerTaggedObject((int) type, new DerOctetString(certificateOctets))) + { + } + + public Choice Type + { + get + { + if (cert != null) + return Choice.Certificate; + + if (publicKeyCert != null) + return Choice.PublicKeyCertificate; + + return Choice.AttributeCertificate; + } + } + + public byte[] GetCertificateBytes() + { + if (cert != null) + { + try + { + return cert.GetEncoded(); + } + catch (IOException e) + { + throw new InvalidOperationException("can't decode certificate: " + e); + } + } + + if (publicKeyCert != null) + return publicKeyCert; + + return attributeCert; + } + + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*            RequestedCertificate ::= CHOICE {
+		*              Certificate Certificate,
+		*              publicKeyCertificate [0] EXPLICIT OCTET STRING,
+		*              attributeCertificate [1] EXPLICIT OCTET STRING
+		*            }
+		* 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + if (publicKeyCert != null) + { + return new DerTaggedObject(0, new DerOctetString(publicKeyCert)); + } + + if (attributeCert != null) + { + return new DerTaggedObject(1, new DerOctetString(attributeCert)); + } + + return cert.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/RequestedCertificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/RequestedCertificate.cs.meta new file mode 100644 index 00000000..82ae2b3b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/ocsp/RequestedCertificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c972793f90bc37f4c8ad96a494f360fd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509.meta new file mode 100644 index 00000000..97212709 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 75de97a9b8a0a08478e4959ccc72a4a2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdditionalInformationSyntax.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdditionalInformationSyntax.cs new file mode 100644 index 00000000..9cb74c65 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdditionalInformationSyntax.cs @@ -0,0 +1,75 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509 +{ + /** + * Some other information of non-restrictive nature regarding the usage of this + * certificate. + * + *
+	*    AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
+	* 
+ */ + public class AdditionalInformationSyntax + : Asn1Encodable + { + private readonly DirectoryString information; + + public static AdditionalInformationSyntax GetInstance( + object obj) + { + if (obj is AdditionalInformationSyntax) + return (AdditionalInformationSyntax) obj; + + if (obj is IAsn1String) + return new AdditionalInformationSyntax(DirectoryString.GetInstance(obj)); + + throw new ArgumentException("Unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private AdditionalInformationSyntax( + DirectoryString information) + { + this.information = information; + } + + /** + * Constructor from a given details. + * + * @param information The describtion of the information. + */ + public AdditionalInformationSyntax( + string information) + { + this.information = new DirectoryString(information); + } + + public virtual DirectoryString Information + { + get { return information; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*   AdditionalInformationSyntax ::= DirectoryString (SIZE(1..2048))
+		* 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + return information.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdditionalInformationSyntax.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdditionalInformationSyntax.cs.meta new file mode 100644 index 00000000..4565f1c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdditionalInformationSyntax.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 21d333e8be430d74eab3c4a558acb8eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdmissionSyntax.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdmissionSyntax.cs new file mode 100644 index 00000000..b75961be --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdmissionSyntax.cs @@ -0,0 +1,282 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509 +{ + /** + * Attribute to indicate admissions to certain professions. + *

+ *

+    *     AdmissionSyntax ::= SEQUENCE
+    *     {
+    *       admissionAuthority GeneralName OPTIONAL,
+    *       contentsOfAdmissions SEQUENCE OF Admissions
+    *     }
+    * 

+ * Admissions ::= SEQUENCE + * { + * admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + * namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + * professionInfos SEQUENCE OF ProfessionInfo + * } + *

+ * NamingAuthority ::= SEQUENCE + * { + * namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + * namingAuthorityUrl IA5String OPTIONAL, + * namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + * } + *

+ * ProfessionInfo ::= SEQUENCE + * { + * namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + * professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + * professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + * registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + * addProfessionInfo OCTET STRING OPTIONAL + * } + *

+ *

+ *

+ * ISIS-MTT PROFILE: The relatively complex structure of AdmissionSyntax + * supports the following concepts and requirements: + *

    + *
  • External institutions (e.g. professional associations, chambers, unions, + * administrative bodies, companies, etc.), which are responsible for granting + * and verifying professional admissions, are indicated by means of the data + * field admissionAuthority. An admission authority is indicated by a + * GeneralName object. Here an X.501 directory name (distinguished name) can be + * indicated in the field directoryName, a URL address can be indicated in the + * field uniformResourceIdentifier, and an object identifier can be indicated in + * the field registeredId.
  • + *
  • The names of authorities which are responsible for the administration of + * title registers are indicated in the data field namingAuthority. The name of + * the authority can be identified by an object identifier in the field + * namingAuthorityId, by means of a text string in the field + * namingAuthorityText, by means of a URL address in the field + * namingAuthorityUrl, or by a combination of them. For example, the text string + * can contain the name of the authority, the country and the name of the title + * register. The URL-option refers to a web page which contains lists with + * officially registered professions (text and possibly OID) as well as + * further information on these professions. Object identifiers for the + * component namingAuthorityId are grouped under the OID-branch + * id-isis-at-namingAuthorities and must be applied for.
  • + *
  • See http://www.teletrust.de/anwend.asp?Id=30200&Sprache=E_&HomePG=0 + * for an application form and http://www.teletrust.de/links.asp?id=30220,11 + * for an overview of registered naming authorities.
  • + *
  • By means of the data type ProfessionInfo certain professions, + * specializations, disciplines, fields of activity, etc. are identified. A + * profession is represented by one or more text strings, resp. profession OIDs + * in the fields professionItems and professionOIDs and by a registration number + * in the field registrationNumber. An indication in text form must always be + * present, whereas the other indications are optional. The component + * addProfessionInfo may contain additional applicationspecific information in + * DER-encoded form.
  • + *
+ *

+ * By means of different namingAuthority-OIDs or profession OIDs hierarchies of + * professions, specializations, disciplines, fields of activity, etc. can be + * expressed. The issuing admission authority should always be indicated (field + * admissionAuthority), whenever a registration number is presented. Still, + * information on admissions can be given without indicating an admission or a + * naming authority by the exclusive use of the component professionItems. In + * this case the certification authority is responsible for the verification of + * the admission information. + *

+ *

+ *

+ * This attribute is single-valued. Still, several admissions can be captured in + * the sequence structure of the component contentsOfAdmissions of + * AdmissionSyntax or in the component professionInfos of Admissions. The + * component admissionAuthority of AdmissionSyntax serves as default value for + * the component admissionAuthority of Admissions. Within the latter component + * the default value can be overwritten, in case that another authority is + * responsible. The component namingAuthority of Admissions serves as a default + * value for the component namingAuthority of ProfessionInfo. Within the latter + * component the default value can be overwritten, in case that another naming + * authority needs to be recorded. + *

+ * The length of the string objects is limited to 128 characters. It is + * recommended to indicate a namingAuthorityURL in all issued attribute + * certificates. If a namingAuthorityURL is indicated, the field professionItems + * of ProfessionInfo should contain only registered titles. If the field + * professionOIDs exists, it has to contain the OIDs of the professions listed + * in professionItems in the same order. In general, the field professionInfos + * should contain only one entry, unless the admissions that are to be listed + * are logically connected (e.g. they have been issued under the same admission + * number). + * + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.Admissions + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority + */ + public class AdmissionSyntax + : Asn1Encodable + { + private readonly GeneralName admissionAuthority; + private readonly Asn1Sequence contentsOfAdmissions; + + public static AdmissionSyntax GetInstance( + object obj) + { + if (obj == null || obj is AdmissionSyntax) + { + return (AdmissionSyntax)obj; + } + + if (obj is Asn1Sequence) + { + return new AdmissionSyntax((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + *

+ * The sequence is of type ProcurationSyntax: + *

+ *

+        *     AdmissionSyntax ::= SEQUENCE
+        *     {
+        *       admissionAuthority GeneralName OPTIONAL,
+        *       contentsOfAdmissions SEQUENCE OF Admissions
+        *     }
+        * 

+ * Admissions ::= SEQUENCE + * { + * admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + * namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + * professionInfos SEQUENCE OF ProfessionInfo + * } + *

+ * NamingAuthority ::= SEQUENCE + * { + * namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + * namingAuthorityUrl IA5String OPTIONAL, + * namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + * } + *

+ * ProfessionInfo ::= SEQUENCE + * { + * namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + * professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + * professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + * registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + * addProfessionInfo OCTET STRING OPTIONAL + * } + *

+ * + * @param seq The ASN.1 sequence. + */ + private AdmissionSyntax( + Asn1Sequence seq) + { + switch (seq.Count) + { + case 1: + this.contentsOfAdmissions = DerSequence.GetInstance(seq[0]); + break; + case 2: + admissionAuthority = GeneralName.GetInstance(seq[0]); + contentsOfAdmissions = DerSequence.GetInstance(seq[1]); + break; + default: + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + } + + /** + * Constructor from given details. + * + * @param admissionAuthority The admission authority. + * @param contentsOfAdmissions The admissions. + */ + public AdmissionSyntax( + GeneralName admissionAuthority, + Asn1Sequence contentsOfAdmissions) + { + this.admissionAuthority = admissionAuthority; + this.contentsOfAdmissions = contentsOfAdmissions; + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+        *     AdmissionSyntax ::= SEQUENCE
+        *     {
+        *       admissionAuthority GeneralName OPTIONAL,
+        *       contentsOfAdmissions SEQUENCE OF Admissions
+        *     }
+        * 

+ * Admissions ::= SEQUENCE + * { + * admissionAuthority [0] EXPLICIT GeneralName OPTIONAL + * namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL + * professionInfos SEQUENCE OF ProfessionInfo + * } + *

+ * NamingAuthority ::= SEQUENCE + * { + * namingAuthorityId OBJECT IDENTIFIER OPTIONAL, + * namingAuthorityUrl IA5String OPTIONAL, + * namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL + * } + *

+ * ProfessionInfo ::= SEQUENCE + * { + * namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL, + * professionItems SEQUENCE OF DirectoryString (SIZE(1..128)), + * professionOIDs SEQUENCE OF OBJECT IDENTIFIER OPTIONAL, + * registrationNumber PrintableString(SIZE(1..128)) OPTIONAL, + * addProfessionInfo OCTET STRING OPTIONAL + * } + *

+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + if (admissionAuthority != null) + { + vec.Add(admissionAuthority); + } + vec.Add(contentsOfAdmissions); + return new DerSequence(vec); + } + + /** + * @return Returns the admissionAuthority if present, null otherwise. + */ + public virtual GeneralName AdmissionAuthority + { + get { return admissionAuthority; } + } + + /** + * @return Returns the contentsOfAdmissions. + */ + public virtual Admissions[] GetContentsOfAdmissions() + { + Admissions[] result = new Admissions[contentsOfAdmissions.Count]; + + for (int i = 0; i < contentsOfAdmissions.Count; ++i) + { + result[i] = Admissions.GetInstance(contentsOfAdmissions[i]); + } + + return result; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdmissionSyntax.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdmissionSyntax.cs.meta new file mode 100644 index 00000000..60c7a608 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/AdmissionSyntax.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 23a4d30aee976fe48b8a76f5b205eeed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Admissions.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Admissions.cs new file mode 100644 index 00000000..8851d4d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Admissions.cs @@ -0,0 +1,191 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509 +{ + /** + * An Admissions structure. + *

+ *

+	*            Admissions ::= SEQUENCE
+	*            {
+	*              admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
+	*              namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
+	*              professionInfos SEQUENCE OF ProfessionInfo
+	*            }
+	* 

+ *

+ * + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.ProfessionInfo + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.NamingAuthority + */ + public class Admissions + : Asn1Encodable + { + private readonly GeneralName admissionAuthority; + private readonly NamingAuthority namingAuthority; + private readonly Asn1Sequence professionInfos; + + public static Admissions GetInstance( + object obj) + { + if (obj == null || obj is Admissions) + { + return (Admissions) obj; + } + + if (obj is Asn1Sequence) + { + return new Admissions((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + *

+ * The sequence is of type ProcurationSyntax: + *

+ *

+		*            Admissions ::= SEQUENCE
+		*            {
+		*              admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
+		*              namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
+		*              professionInfos SEQUENCE OF ProfessionInfo
+		*            }
+		* 
+ * + * @param seq The ASN.1 sequence. + */ + private Admissions( + Asn1Sequence seq) + { + if (seq.Count > 3) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + IEnumerator e = seq.GetEnumerator(); + + e.MoveNext(); + Asn1Encodable o = (Asn1Encodable) e.Current; + if (o is Asn1TaggedObject) + { + switch (((Asn1TaggedObject)o).TagNo) + { + case 0: + admissionAuthority = GeneralName.GetInstance((Asn1TaggedObject)o, true); + break; + case 1: + namingAuthority = NamingAuthority.GetInstance((Asn1TaggedObject)o, true); + break; + default: + throw new ArgumentException("Bad tag number: " + ((Asn1TaggedObject)o).TagNo); + } + e.MoveNext(); + o = (Asn1Encodable) e.Current; + } + if (o is Asn1TaggedObject) + { + switch (((Asn1TaggedObject)o).TagNo) + { + case 1: + namingAuthority = NamingAuthority.GetInstance((Asn1TaggedObject)o, true); + break; + default: + throw new ArgumentException("Bad tag number: " + ((Asn1TaggedObject)o).TagNo); + } + e.MoveNext(); + o = (Asn1Encodable) e.Current; + } + professionInfos = Asn1Sequence.GetInstance(o); + if (e.MoveNext()) + { + throw new ArgumentException("Bad object encountered: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(e.Current)); + } + } + + /** + * Constructor from a given details. + *

+ * Parameter professionInfos is mandatory. + * + * @param admissionAuthority The admission authority. + * @param namingAuthority The naming authority. + * @param professionInfos The profession infos. + */ + public Admissions( + GeneralName admissionAuthority, + NamingAuthority namingAuthority, + ProfessionInfo[] professionInfos) + { + this.admissionAuthority = admissionAuthority; + this.namingAuthority = namingAuthority; + this.professionInfos = new DerSequence(professionInfos); + } + + public virtual GeneralName AdmissionAuthority + { + get { return admissionAuthority; } + } + + public virtual NamingAuthority NamingAuthority + { + get { return namingAuthority; } + } + + public ProfessionInfo[] GetProfessionInfos() + { + ProfessionInfo[] infos = new ProfessionInfo[professionInfos.Count]; + int count = 0; + foreach (Asn1Encodable ae in professionInfos) + { + infos[count++] = ProfessionInfo.GetInstance(ae); + } + return infos; + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*       Admissions ::= SEQUENCE
+		*       {
+		*         admissionAuthority [0] EXPLICIT GeneralName OPTIONAL
+		*         namingAuthority [1] EXPLICIT NamingAuthority OPTIONAL
+		*         professionInfos SEQUENCE OF ProfessionInfo
+		*       }
+		* 

+ *

+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + + if (admissionAuthority != null) + { + vec.Add(new DerTaggedObject(true, 0, admissionAuthority)); + } + + if (namingAuthority != null) + { + vec.Add(new DerTaggedObject(true, 1, namingAuthority)); + } + + vec.Add(professionInfos); + + return new DerSequence(vec); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Admissions.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Admissions.cs.meta new file mode 100644 index 00000000..60fed24e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Admissions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f95d9ba29daeb49479f647a6f375c272 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/DeclarationOfMajority.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/DeclarationOfMajority.cs new file mode 100644 index 00000000..5f998d00 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/DeclarationOfMajority.cs @@ -0,0 +1,176 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509 +{ + /** + * A declaration of majority. + *

+ *

+	*           DeclarationOfMajoritySyntax ::= CHOICE
+	*           {
+	*             notYoungerThan [0] IMPLICIT INTEGER,
+	*             fullAgeAtCountry [1] IMPLICIT SEQUENCE
+	*             {
+	*               fullAge BOOLEAN DEFAULT TRUE,
+	*               country PrintableString (SIZE(2))
+	*             }
+	*             dateOfBirth [2] IMPLICIT GeneralizedTime
+	*           }
+	* 
+ *

+ * fullAgeAtCountry indicates the majority of the owner with respect to the laws + * of a specific country. + */ + public class DeclarationOfMajority + : Asn1Encodable, IAsn1Choice + { + public enum Choice + { + NotYoungerThan = 0, + FullAgeAtCountry = 1, + DateOfBirth = 2 + }; + + private readonly Asn1TaggedObject declaration; + + public DeclarationOfMajority( + int notYoungerThan) + { + declaration = new DerTaggedObject(false, 0, new DerInteger(notYoungerThan)); + } + + public DeclarationOfMajority( + bool fullAge, + string country) + { + if (country.Length > 2) + throw new ArgumentException("country can only be 2 characters"); + + DerPrintableString countryString = new DerPrintableString(country, true); + + DerSequence seq; + if (fullAge) + { + seq = new DerSequence(countryString); + } + else + { + seq = new DerSequence(DerBoolean.False, countryString); + } + + this.declaration = new DerTaggedObject(false, 1, seq); + } + + public DeclarationOfMajority( + DerGeneralizedTime dateOfBirth) + { + this.declaration = new DerTaggedObject(false, 2, dateOfBirth); + } + + public static DeclarationOfMajority GetInstance( + object obj) + { + if (obj == null || obj is DeclarationOfMajority) + { + return (DeclarationOfMajority) obj; + } + + if (obj is Asn1TaggedObject) + { + return new DeclarationOfMajority((Asn1TaggedObject) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private DeclarationOfMajority( + Asn1TaggedObject o) + { + if (o.TagNo > 2) + throw new ArgumentException("Bad tag number: " + o.TagNo); + + this.declaration = o; + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*           DeclarationOfMajoritySyntax ::= CHOICE
+		*           {
+		*             notYoungerThan [0] IMPLICIT INTEGER,
+		*             fullAgeAtCountry [1] IMPLICIT SEQUENCE
+		*             {
+		*               fullAge BOOLEAN DEFAULT TRUE,
+		*               country PrintableString (SIZE(2))
+		*             }
+		*             dateOfBirth [2] IMPLICIT GeneralizedTime
+		*           }
+		* 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + return declaration; + } + + public Choice Type + { + get { return (Choice) declaration.TagNo; } + } + + /** + * @return notYoungerThan if that's what we are, -1 otherwise + */ + public virtual int NotYoungerThan + { + get + { + switch ((Choice) declaration.TagNo) + { + case Choice.NotYoungerThan: + return DerInteger.GetInstance(declaration, false).Value.IntValue; + default: + return -1; + } + } + } + + public virtual Asn1Sequence FullAgeAtCountry + { + get + { + switch ((Choice) declaration.TagNo) + { + case Choice.FullAgeAtCountry: + return Asn1Sequence.GetInstance(declaration, false); + default: + return null; + } + } + } + + public virtual DerGeneralizedTime DateOfBirth + { + get + { + switch ((Choice) declaration.TagNo) + { + case Choice.DateOfBirth: + return DerGeneralizedTime.GetInstance(declaration, false); + default: + return null; + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/DeclarationOfMajority.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/DeclarationOfMajority.cs.meta new file mode 100644 index 00000000..eba7a61a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/DeclarationOfMajority.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f20d111cf7a822747b272a88f13eb245 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/MonetaryLimit.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/MonetaryLimit.cs new file mode 100644 index 00000000..4cdb4208 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/MonetaryLimit.cs @@ -0,0 +1,126 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509 +{ + /** + * Monetary limit for transactions. The QcEuMonetaryLimit QC statement MUST be + * used in new certificates in place of the extension/attribute MonetaryLimit + * since January 1, 2004. For the sake of backward compatibility with + * certificates already in use, components SHOULD support MonetaryLimit (as well + * as QcEuLimitValue). + *

+ * Indicates a monetary limit within which the certificate holder is authorized + * to act. (This value DOES NOT express a limit on the liability of the + * certification authority). + *

+ *

+	*    MonetaryLimitSyntax ::= SEQUENCE
+	*    {
+	*      currency PrintableString (SIZE(3)),
+	*      amount INTEGER,
+	*      exponent INTEGER
+	*    }
+	* 
+ *

+ * currency must be the ISO code. + *

+ * value = amount�10*exponent + */ + public class MonetaryLimit + : Asn1Encodable + { + private readonly DerPrintableString currency; + private readonly DerInteger amount; + private readonly DerInteger exponent; + + public static MonetaryLimit GetInstance( + object obj) + { + if (obj == null || obj is MonetaryLimit) + { + return (MonetaryLimit) obj; + } + + if (obj is Asn1Sequence) + { + return new MonetaryLimit(Asn1Sequence.GetInstance(obj)); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private MonetaryLimit( + Asn1Sequence seq) + { + if (seq.Count != 3) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + currency = DerPrintableString.GetInstance(seq[0]); + amount = DerInteger.GetInstance(seq[1]); + exponent = DerInteger.GetInstance(seq[2]); + } + + /** + * Constructor from a given details. + *

+ *

+ * value = amount�10^exponent + * + * @param currency The currency. Must be the ISO code. + * @param amount The amount + * @param exponent The exponent + */ + public MonetaryLimit( + string currency, + int amount, + int exponent) + { + this.currency = new DerPrintableString(currency, true); + this.amount = new DerInteger(amount); + this.exponent = new DerInteger(exponent); + } + + public virtual string Currency + { + get { return currency.GetString(); } + } + + public virtual BigInteger Amount + { + get { return amount.Value; } + } + + public virtual BigInteger Exponent + { + get { return exponent.Value; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*    MonetaryLimitSyntax ::= SEQUENCE
+		*    {
+		*      currency PrintableString (SIZE(3)),
+		*      amount INTEGER,
+		*      exponent INTEGER
+		*    }
+		* 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(currency, amount, exponent); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/MonetaryLimit.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/MonetaryLimit.cs.meta new file mode 100644 index 00000000..b2ce7530 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/MonetaryLimit.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b033addc86f1284881821ac60593581 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/NamingAuthority.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/NamingAuthority.cs new file mode 100644 index 00000000..52305f28 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/NamingAuthority.cs @@ -0,0 +1,219 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509 +{ + /** + * Names of authorities which are responsible for the administration of title + * registers. + * + *
+	*             NamingAuthority ::= SEQUENCE 
+	*             {
+	*               namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
+	*               namingAuthorityUrl IA5String OPTIONAL,
+	*               namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
+	*             }
+	* 
+ * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax + * + */ + public class NamingAuthority + : Asn1Encodable + { + /** + * Profession OIDs should always be defined under the OID branch of the + * responsible naming authority. At the time of this writing, the work group + * �Recht, Wirtschaft, Steuern� (�Law, Economy, Taxes�) is registered as the + * first naming authority under the OID id-isismtt-at-namingAuthorities. + */ + public static readonly DerObjectIdentifier IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + = new DerObjectIdentifier(IsisMttObjectIdentifiers.IdIsisMttATNamingAuthorities + ".1"); + + private readonly DerObjectIdentifier namingAuthorityID; + private readonly string namingAuthorityUrl; + private readonly DirectoryString namingAuthorityText; + + public static NamingAuthority GetInstance( + object obj) + { + if (obj == null || obj is NamingAuthority) + { + return (NamingAuthority) obj; + } + + if (obj is Asn1Sequence) + { + return new NamingAuthority((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static NamingAuthority GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * Constructor from Asn1Sequence. + *

+ *

+ *

+		*             NamingAuthority ::= SEQUENCE
+		*             {
+		*               namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
+		*               namingAuthorityUrl IA5String OPTIONAL,
+		*               namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
+		*             }
+		* 
+ * + * @param seq The ASN.1 sequence. + */ + private NamingAuthority( + Asn1Sequence seq) + { + if (seq.Count > 3) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + IEnumerator e = seq.GetEnumerator(); + + if (e.MoveNext()) + { + Asn1Encodable o = (Asn1Encodable) e.Current; + if (o is DerObjectIdentifier) + { + namingAuthorityID = (DerObjectIdentifier) o; + } + else if (o is DerIA5String) + { + namingAuthorityUrl = DerIA5String.GetInstance(o).GetString(); + } + else if (o is IAsn1String) + { + namingAuthorityText = DirectoryString.GetInstance(o); + } + else + { + throw new ArgumentException("Bad object encountered: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + } + + if (e.MoveNext()) + { + Asn1Encodable o = (Asn1Encodable) e.Current; + if (o is DerIA5String) + { + namingAuthorityUrl = DerIA5String.GetInstance(o).GetString(); + } + else if (o is IAsn1String) + { + namingAuthorityText = DirectoryString.GetInstance(o); + } + else + { + throw new ArgumentException("Bad object encountered: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + } + + if (e.MoveNext()) + { + Asn1Encodable o = (Asn1Encodable) e.Current; + if (o is IAsn1String) + { + namingAuthorityText = DirectoryString.GetInstance(o); + } + else + { + throw new ArgumentException("Bad object encountered: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + } + } + + /** + * @return Returns the namingAuthorityID. + */ + public virtual DerObjectIdentifier NamingAuthorityID + { + get { return namingAuthorityID; } + } + + /** + * @return Returns the namingAuthorityText. + */ + public virtual DirectoryString NamingAuthorityText + { + get { return namingAuthorityText; } + } + + /** + * @return Returns the namingAuthorityUrl. + */ + public virtual string NamingAuthorityUrl + { + get { return namingAuthorityUrl; } + } + + /** + * Constructor from given details. + *

+ * All parameters can be combined. + * + * @param namingAuthorityID ObjectIdentifier for naming authority. + * @param namingAuthorityUrl URL for naming authority. + * @param namingAuthorityText Textual representation of naming authority. + */ + public NamingAuthority( + DerObjectIdentifier namingAuthorityID, + string namingAuthorityUrl, + DirectoryString namingAuthorityText) + { + this.namingAuthorityID = namingAuthorityID; + this.namingAuthorityUrl = namingAuthorityUrl; + this.namingAuthorityText = namingAuthorityText; + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*             NamingAuthority ::= SEQUENCE
+		*             {
+		*               namingAuthorityID OBJECT IDENTIFIER OPTIONAL,
+		*               namingAuthorityUrl IA5String OPTIONAL,
+		*               namingAuthorityText DirectoryString(SIZE(1..128)) OPTIONAL
+		*             }
+		* 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + if (namingAuthorityID != null) + { + vec.Add(namingAuthorityID); + } + if (namingAuthorityUrl != null) + { + vec.Add(new DerIA5String(namingAuthorityUrl, true)); + } + if (namingAuthorityText != null) + { + vec.Add(namingAuthorityText); + } + return new DerSequence(vec); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/NamingAuthority.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/NamingAuthority.cs.meta new file mode 100644 index 00000000..2ab74baf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/NamingAuthority.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59bd2c22203ef6d459836bb7661ba720 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProcurationSyntax.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProcurationSyntax.cs new file mode 100644 index 00000000..f03d959d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProcurationSyntax.cs @@ -0,0 +1,237 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509 +{ + /** + * Attribute to indicate that the certificate holder may sign in the name of a + * third person. + *

+ * ISIS-MTT PROFILE: The corresponding ProcurationSyntax contains either the + * name of the person who is represented (subcomponent thirdPerson) or a + * reference to his/her base certificate (in the component signingFor, + * subcomponent certRef), furthermore the optional components country and + * typeSubstitution to indicate the country whose laws apply, and respectively + * the type of procuration (e.g. manager, procuration, custody). + *

+ *

+ * ISIS-MTT PROFILE: The GeneralName MUST be of type directoryName and MAY only + * contain: - RFC3039 attributes, except pseudonym (countryName, commonName, + * surname, givenName, serialNumber, organizationName, organizationalUnitName, + * stateOrProvincename, localityName, postalAddress) and - SubjectDirectoryName + * attributes (title, dateOfBirth, placeOfBirth, gender, countryOfCitizenship, + * countryOfResidence and NameAtBirth). + *

+ *
+	*               ProcurationSyntax ::= SEQUENCE {
+	*                 country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
+	*                 typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
+	*                 signingFor [3] EXPLICIT SigningFor 
+	*               }
+	*               
+	*               SigningFor ::= CHOICE 
+	*               { 
+	*                 thirdPerson GeneralName,
+	*                 certRef IssuerSerial 
+	*               }
+	* 
+ * + */ + public class ProcurationSyntax + : Asn1Encodable + { + private readonly string country; + private readonly DirectoryString typeOfSubstitution; + private readonly GeneralName thirdPerson; + private readonly IssuerSerial certRef; + + public static ProcurationSyntax GetInstance( + object obj) + { + if (obj == null || obj is ProcurationSyntax) + { + return (ProcurationSyntax) obj; + } + + if (obj is Asn1Sequence) + { + return new ProcurationSyntax((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + *

+ * The sequence is of type ProcurationSyntax: + *

+ *

+		*               ProcurationSyntax ::= SEQUENCE {
+		*                 country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
+		*                 typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
+		*                 signingFor [3] EXPLICIT SigningFor
+		*               }
+		* 

+ * SigningFor ::= CHOICE + * { + * thirdPerson GeneralName, + * certRef IssuerSerial + * } + *

+ * + * @param seq The ASN.1 sequence. + */ + private ProcurationSyntax( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 3) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + IEnumerator e = seq.GetEnumerator(); + + while (e.MoveNext()) + { + Asn1TaggedObject o = Asn1TaggedObject.GetInstance(e.Current); + switch (o.TagNo) + { + case 1: + country = DerPrintableString.GetInstance(o, true).GetString(); + break; + case 2: + typeOfSubstitution = DirectoryString.GetInstance(o, true); + break; + case 3: + Asn1Object signingFor = o.GetObject(); + if (signingFor is Asn1TaggedObject) + { + thirdPerson = GeneralName.GetInstance(signingFor); + } + else + { + certRef = IssuerSerial.GetInstance(signingFor); + } + break; + default: + throw new ArgumentException("Bad tag number: " + o.TagNo); + } + } + } + + /** + * Constructor from a given details. + *

+ *

+ * Either generalName or certRef MUST be + * null. + * + * @param country The country code whose laws apply. + * @param typeOfSubstitution The type of procuration. + * @param certRef Reference to certificate of the person who is represented. + */ + public ProcurationSyntax( + string country, + DirectoryString typeOfSubstitution, + IssuerSerial certRef) + { + this.country = country; + this.typeOfSubstitution = typeOfSubstitution; + this.thirdPerson = null; + this.certRef = certRef; + } + + /** + * Constructor from a given details. + *

+ *

+ * Either generalName or certRef MUST be + * null. + * + * @param country The country code whose laws apply. + * @param typeOfSubstitution The type of procuration. + * @param thirdPerson The GeneralName of the person who is represented. + */ + public ProcurationSyntax( + string country, + DirectoryString typeOfSubstitution, + GeneralName thirdPerson) + { + this.country = country; + this.typeOfSubstitution = typeOfSubstitution; + this.thirdPerson = thirdPerson; + this.certRef = null; + } + + public virtual string Country + { + get { return country; } + } + + public virtual DirectoryString TypeOfSubstitution + { + get { return typeOfSubstitution; } + } + + public virtual GeneralName ThirdPerson + { + get { return thirdPerson; } + } + + public virtual IssuerSerial CertRef + { + get { return certRef; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*               ProcurationSyntax ::= SEQUENCE {
+		*                 country [1] EXPLICIT PrintableString(SIZE(2)) OPTIONAL,
+		*                 typeOfSubstitution [2] EXPLICIT DirectoryString (SIZE(1..128)) OPTIONAL,
+		*                 signingFor [3] EXPLICIT SigningFor
+		*               }
+		* 

+ * SigningFor ::= CHOICE + * { + * thirdPerson GeneralName, + * certRef IssuerSerial + * } + *

+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + if (country != null) + { + vec.Add(new DerTaggedObject(true, 1, new DerPrintableString(country, true))); + } + if (typeOfSubstitution != null) + { + vec.Add(new DerTaggedObject(true, 2, typeOfSubstitution)); + } + if (thirdPerson != null) + { + vec.Add(new DerTaggedObject(true, 3, thirdPerson)); + } + else + { + vec.Add(new DerTaggedObject(true, 3, certRef)); + } + + return new DerSequence(vec); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProcurationSyntax.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProcurationSyntax.cs.meta new file mode 100644 index 00000000..702a5aca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProcurationSyntax.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9474a0a6a951b3c4abec5e6d6ff34dfd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProfessionInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProfessionInfo.cs new file mode 100644 index 00000000..a330bffa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProfessionInfo.cs @@ -0,0 +1,391 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509 +{ + /** + * Professions, specializations, disciplines, fields of activity, etc. + * + *
+	*               ProfessionInfo ::= SEQUENCE 
+	*               {
+	*                 namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
+	*                 professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
+	*                 professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
+	*                 registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
+	*                 addProfessionInfo OCTET STRING OPTIONAL 
+	*               }
+	* 
+ * + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509.AdmissionSyntax + */ + public class ProfessionInfo + : Asn1Encodable + { + /** + * Rechtsanw�ltin + */ + public static readonly DerObjectIdentifier Rechtsanwltin = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".1"); + + /** + * Rechtsanwalt + */ + public static readonly DerObjectIdentifier Rechtsanwalt = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".2"); + + /** + * Rechtsbeistand + */ + public static readonly DerObjectIdentifier Rechtsbeistand = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".3"); + + /** + * Steuerberaterin + */ + public static readonly DerObjectIdentifier Steuerberaterin = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".4"); + + /** + * Steuerberater + */ + public static readonly DerObjectIdentifier Steuerberater = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".5"); + + /** + * Steuerbevollm�chtigte + */ + public static readonly DerObjectIdentifier Steuerbevollmchtigte = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".6"); + + /** + * Steuerbevollm�chtigter + */ + public static readonly DerObjectIdentifier Steuerbevollmchtigter = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".7"); + + /** + * Notarin + */ + public static readonly DerObjectIdentifier Notarin = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".8"); + + /** + * Notar + */ + public static readonly DerObjectIdentifier Notar = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".9"); + + /** + * Notarvertreterin + */ + public static readonly DerObjectIdentifier Notarvertreterin = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".10"); + + /** + * Notarvertreter + */ + public static readonly DerObjectIdentifier Notarvertreter = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".11"); + + /** + * Notariatsverwalterin + */ + public static readonly DerObjectIdentifier Notariatsverwalterin = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".12"); + + /** + * Notariatsverwalter + */ + public static readonly DerObjectIdentifier Notariatsverwalter = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".13"); + + /** + * Wirtschaftspr�ferin + */ + public static readonly DerObjectIdentifier Wirtschaftsprferin = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".14"); + + /** + * Wirtschaftspr�fer + */ + public static readonly DerObjectIdentifier Wirtschaftsprfer = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".15"); + + /** + * Vereidigte Buchpr�ferin + */ + public static readonly DerObjectIdentifier VereidigteBuchprferin = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".16"); + + /** + * Vereidigter Buchpr�fer + */ + public static readonly DerObjectIdentifier VereidigterBuchprfer = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".17"); + + /** + * Patentanw�ltin + */ + public static readonly DerObjectIdentifier Patentanwltin = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".18"); + + /** + * Patentanwalt + */ + public static readonly DerObjectIdentifier Patentanwalt = new DerObjectIdentifier( + NamingAuthority.IdIsisMttATNamingAuthoritiesRechtWirtschaftSteuern + ".19"); + + private readonly NamingAuthority namingAuthority; + private readonly Asn1Sequence professionItems; + private readonly Asn1Sequence professionOids; + private readonly string registrationNumber; + private readonly Asn1OctetString addProfessionInfo; + + public static ProfessionInfo GetInstance( + object obj) + { + if (obj == null || obj is ProfessionInfo) + { + return (ProfessionInfo) obj; + } + + if (obj is Asn1Sequence) + { + return new ProfessionInfo((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + *

+ *

+ *

+		*               ProfessionInfo ::= SEQUENCE
+		*               {
+		*                 namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
+		*                 professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
+		*                 professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
+		*                 registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
+		*                 addProfessionInfo OCTET STRING OPTIONAL
+		*               }
+		* 
+ * + * @param seq The ASN.1 sequence. + */ + private ProfessionInfo( + Asn1Sequence seq) + { + if (seq.Count > 5) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + IEnumerator e = seq.GetEnumerator(); + + e.MoveNext(); + Asn1Encodable o = (Asn1Encodable) e.Current; + + if (o is Asn1TaggedObject) + { + Asn1TaggedObject ato = (Asn1TaggedObject) o; + if (ato.TagNo != 0) + throw new ArgumentException("Bad tag number: " + ato.TagNo); + + namingAuthority = NamingAuthority.GetInstance(ato, true); + e.MoveNext(); + o = (Asn1Encodable) e.Current; + } + + professionItems = Asn1Sequence.GetInstance(o); + + if (e.MoveNext()) + { + o = (Asn1Encodable) e.Current; + if (o is Asn1Sequence) + { + professionOids = Asn1Sequence.GetInstance(o); + } + else if (o is DerPrintableString) + { + registrationNumber = DerPrintableString.GetInstance(o).GetString(); + } + else if (o is Asn1OctetString) + { + addProfessionInfo = Asn1OctetString.GetInstance(o); + } + else + { + throw new ArgumentException("Bad object encountered: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + } + + if (e.MoveNext()) + { + o = (Asn1Encodable) e.Current; + if (o is DerPrintableString) + { + registrationNumber = DerPrintableString.GetInstance(o).GetString(); + } + else if (o is DerOctetString) + { + addProfessionInfo = (DerOctetString) o; + } + else + { + throw new ArgumentException("Bad object encountered: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + } + + if (e.MoveNext()) + { + o = (Asn1Encodable) e.Current; + if (o is DerOctetString) + { + addProfessionInfo = (DerOctetString) o; + } + else + { + throw new ArgumentException("Bad object encountered: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + } + } + + /** + * Constructor from given details. + *

+ * professionItems is mandatory, all other parameters are + * optional. + * + * @param namingAuthority The naming authority. + * @param professionItems Directory strings of the profession. + * @param professionOids DERObjectIdentfier objects for the + * profession. + * @param registrationNumber Registration number. + * @param addProfessionInfo Additional infos in encoded form. + */ + public ProfessionInfo( + NamingAuthority namingAuthority, + DirectoryString[] professionItems, + DerObjectIdentifier[] professionOids, + string registrationNumber, + Asn1OctetString addProfessionInfo) + { + this.namingAuthority = namingAuthority; + this.professionItems = new DerSequence(professionItems); + if (professionOids != null) + { + this.professionOids = new DerSequence(professionOids); + } + this.registrationNumber = registrationNumber; + this.addProfessionInfo = addProfessionInfo; + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*               ProfessionInfo ::= SEQUENCE
+		*               {
+		*                 namingAuthority [0] EXPLICIT NamingAuthority OPTIONAL,
+		*                 professionItems SEQUENCE OF DirectoryString (SIZE(1..128)),
+		*                 professionOids SEQUENCE OF OBJECT IDENTIFIER OPTIONAL,
+		*                 registrationNumber PrintableString(SIZE(1..128)) OPTIONAL,
+		*                 addProfessionInfo OCTET STRING OPTIONAL
+		*               }
+		* 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + if (namingAuthority != null) + { + vec.Add(new DerTaggedObject(true, 0, namingAuthority)); + } + vec.Add(professionItems); + if (professionOids != null) + { + vec.Add(professionOids); + } + if (registrationNumber != null) + { + vec.Add(new DerPrintableString(registrationNumber, true)); + } + if (addProfessionInfo != null) + { + vec.Add(addProfessionInfo); + } + return new DerSequence(vec); + } + + /** + * @return Returns the addProfessionInfo. + */ + public virtual Asn1OctetString AddProfessionInfo + { + get { return addProfessionInfo; } + } + + /** + * @return Returns the namingAuthority. + */ + public virtual NamingAuthority NamingAuthority + { + get { return namingAuthority; } + } + + /** + * @return Returns the professionItems. + */ + public virtual DirectoryString[] GetProfessionItems() + { + DirectoryString[] result = new DirectoryString[professionItems.Count]; + + for (int i = 0; i < professionItems.Count; ++i) + { + result[i] = DirectoryString.GetInstance(professionItems[i]); + } + + return result; + } + + /** + * @return Returns the professionOids. + */ + public virtual DerObjectIdentifier[] GetProfessionOids() + { + if (professionOids == null) + { + return new DerObjectIdentifier[0]; + } + + DerObjectIdentifier[] result = new DerObjectIdentifier[professionOids.Count]; + + for (int i = 0; i < professionOids.Count; ++i) + { + result[i] = DerObjectIdentifier.GetInstance(professionOids[i]); + } + + return result; + } + + /** + * @return Returns the registrationNumber. + */ + public virtual string RegistrationNumber + { + get { return registrationNumber; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProfessionInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProfessionInfo.cs.meta new file mode 100644 index 00000000..cf15d707 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/ProfessionInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2057623a426c80c43aae7ccb88f3fde7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Restriction.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Restriction.cs new file mode 100644 index 00000000..50d82e31 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Restriction.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt.X509 +{ + /** + * Some other restriction regarding the usage of this certificate. + *

+ *

+	*  RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
+	* 
+ */ + public class Restriction + : Asn1Encodable + { + private readonly DirectoryString restriction; + + public static Restriction GetInstance( + object obj) + { + if (obj is Restriction) + return (Restriction) obj; + + if (obj is IAsn1String) + return new Restriction(DirectoryString.GetInstance(obj)); + + throw new ArgumentException("Unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from DirectoryString. + *

+ * The DirectoryString is of type RestrictionSyntax: + *

+ *

+		*      RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
+		* 
+ * + * @param restriction A IAsn1String. + */ + private Restriction( + DirectoryString restriction) + { + this.restriction = restriction; + } + + /** + * Constructor from a given details. + * + * @param restriction The description of the restriction. + */ + public Restriction( + string restriction) + { + this.restriction = new DirectoryString(restriction); + } + + public virtual DirectoryString RestrictionString + { + get { return restriction; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*      RestrictionSyntax ::= DirectoryString (SIZE(1..1024))
+		* 

+ *

+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + return restriction.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Restriction.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Restriction.cs.meta new file mode 100644 index 00000000..7e80d9e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/isismtt/x509/Restriction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6d5432c2d3b37549a76c93a4fed9357 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa.meta new file mode 100644 index 00000000..021f0d69 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 669fa057d480bd743b202f7d12974cc9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa/KISAObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa/KISAObjectIdentifiers.cs new file mode 100644 index 00000000..3713eaee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa/KISAObjectIdentifiers.cs @@ -0,0 +1,12 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Kisa +{ + public abstract class KisaObjectIdentifiers + { + public static readonly DerObjectIdentifier IdSeedCbc = new DerObjectIdentifier("1.2.410.200004.1.4"); + public static readonly DerObjectIdentifier IdNpkiAppCmsSeedWrap = new DerObjectIdentifier("1.2.410.200004.7.1.1.1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa/KISAObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa/KISAObjectIdentifiers.cs.meta new file mode 100644 index 00000000..9ca512a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/kisa/KISAObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 796094cd22c787a4eb33f54473a088a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft.meta new file mode 100644 index 00000000..a8e6fa24 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 248bbf2976dfbb4459acd5d2b16b17dd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft/MicrosoftObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft/MicrosoftObjectIdentifiers.cs new file mode 100644 index 00000000..b0e29355 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft/MicrosoftObjectIdentifiers.cs @@ -0,0 +1,23 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Microsoft +{ + public abstract class MicrosoftObjectIdentifiers + { + // + // Microsoft + // iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) Microsoft(311) + // + public static readonly DerObjectIdentifier Microsoft = new DerObjectIdentifier("1.3.6.1.4.1.311"); + public static readonly DerObjectIdentifier MicrosoftCertTemplateV1 = Microsoft.Branch("20.2"); + public static readonly DerObjectIdentifier MicrosoftCAVersion = Microsoft.Branch("21.1"); + public static readonly DerObjectIdentifier MicrosoftPrevCACertHash = Microsoft.Branch("21.2"); + public static readonly DerObjectIdentifier MicrosoftCrlNextPublish = Microsoft.Branch("21.4"); + public static readonly DerObjectIdentifier MicrosoftCertTemplateV2 = Microsoft.Branch("21.7"); + public static readonly DerObjectIdentifier MicrosoftAppPolicies = Microsoft.Branch("21.10"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft/MicrosoftObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft/MicrosoftObjectIdentifiers.cs.meta new file mode 100644 index 00000000..eedcc4ca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/microsoft/MicrosoftObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7471325fadd3ab142bae369d34944f2a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc.meta new file mode 100644 index 00000000..4ae06bbb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5ea43e51ea443414cb46f425a92b6a69 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/CAST5CBCParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/CAST5CBCParameters.cs new file mode 100644 index 00000000..5147d3e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/CAST5CBCParameters.cs @@ -0,0 +1,78 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc +{ + public class Cast5CbcParameters + : Asn1Encodable + { + private readonly DerInteger keyLength; + private readonly Asn1OctetString iv; + + public static Cast5CbcParameters GetInstance( + object o) + { + if (o is Cast5CbcParameters) + { + return (Cast5CbcParameters) o; + } + + if (o is Asn1Sequence) + { + return new Cast5CbcParameters((Asn1Sequence) o); + } + + throw new ArgumentException("unknown object in Cast5CbcParameters factory"); + } + + public Cast5CbcParameters( + byte[] iv, + int keyLength) + { + this.iv = new DerOctetString(iv); + this.keyLength = new DerInteger(keyLength); + } + + private Cast5CbcParameters( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + iv = (Asn1OctetString) seq[0]; + keyLength = (DerInteger) seq[1]; + } + + public byte[] GetIV() + { + return Arrays.Clone(iv.GetOctets()); + } + + public int KeyLength + { + get { return keyLength.Value.IntValue; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * cast5CBCParameters ::= Sequence {
+         *                           iv         OCTET STRING DEFAULT 0,
+         *                                  -- Initialization vector
+         *                           keyLength  Integer
+         *                                  -- Key length, in bits
+         *                      }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(iv, keyLength); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/CAST5CBCParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/CAST5CBCParameters.cs.meta new file mode 100644 index 00000000..513c790f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/CAST5CBCParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 80f0404533dd69c4d8f35f1deabd4d9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/IDEACBCPar.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/IDEACBCPar.cs new file mode 100644 index 00000000..ce7e5ab4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/IDEACBCPar.cs @@ -0,0 +1,72 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc +{ + public class IdeaCbcPar + : Asn1Encodable + { + internal Asn1OctetString iv; + + public static IdeaCbcPar GetInstance( + object o) + { + if (o is IdeaCbcPar) + { + return (IdeaCbcPar) o; + } + + if (o is Asn1Sequence) + { + return new IdeaCbcPar((Asn1Sequence) o); + } + + throw new ArgumentException("unknown object in IDEACBCPar factory"); + } + + public IdeaCbcPar( + byte[] iv) + { + this.iv = new DerOctetString(iv); + } + + private IdeaCbcPar( + Asn1Sequence seq) + { + if (seq.Count == 1) + { + iv = (Asn1OctetString) seq[0]; + } + } + + public byte[] GetIV() + { + return iv == null ? null : iv.GetOctets(); + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * IDEA-CBCPar ::= Sequence {
+         *                      iv    OCTET STRING OPTIONAL -- exactly 8 octets
+         *                  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (iv != null) + { + v.Add(iv); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/IDEACBCPar.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/IDEACBCPar.cs.meta new file mode 100644 index 00000000..b6343cd8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/IDEACBCPar.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 824ef5862fd9d344aac066430b57edd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/MiscObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/MiscObjectIdentifiers.cs new file mode 100644 index 00000000..fbc08edd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/MiscObjectIdentifiers.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc +{ + public abstract class MiscObjectIdentifiers + { + // + // Netscape + // iso/itu(2) joint-assign(16) us(840) uscompany(1) Netscape(113730) cert-extensions(1) } + // + public static readonly DerObjectIdentifier Netscape = new DerObjectIdentifier("2.16.840.1.113730.1"); + public static readonly DerObjectIdentifier NetscapeCertType = Netscape.Branch("1"); + public static readonly DerObjectIdentifier NetscapeBaseUrl = Netscape.Branch("2"); + public static readonly DerObjectIdentifier NetscapeRevocationUrl = Netscape.Branch("3"); + public static readonly DerObjectIdentifier NetscapeCARevocationUrl = Netscape.Branch("4"); + public static readonly DerObjectIdentifier NetscapeRenewalUrl = Netscape.Branch("7"); + public static readonly DerObjectIdentifier NetscapeCAPolicyUrl = Netscape.Branch("8"); + public static readonly DerObjectIdentifier NetscapeSslServerName = Netscape.Branch("12"); + public static readonly DerObjectIdentifier NetscapeCertComment = Netscape.Branch("13"); + + // + // Verisign + // iso/itu(2) joint-assign(16) us(840) uscompany(1) verisign(113733) cert-extensions(1) } + // + public static readonly DerObjectIdentifier Verisign = new DerObjectIdentifier("2.16.840.1.113733.1"); + + // + // CZAG - country, zip, age, and gender + // + public static readonly DerObjectIdentifier VerisignCzagExtension = Verisign.Branch("6.3"); + + public static readonly DerObjectIdentifier VerisignPrivate_6_9 = Verisign.Branch("6.9"); + public static readonly DerObjectIdentifier VerisignOnSiteJurisdictionHash = Verisign.Branch("6.11"); + public static readonly DerObjectIdentifier VerisignBitString_6_13 = Verisign.Branch("6.13"); + + // D&B D-U-N-S number + public static readonly DerObjectIdentifier VerisignDnbDunsNumber = Verisign.Branch("6.15"); + + public static readonly DerObjectIdentifier VerisignIssStrongCrypto = Verisign.Branch("8.1"); + + // + // Novell + // iso/itu(2) country(16) us(840) organization(1) novell(113719) + // + public static readonly string Novell = "2.16.840.1.113719"; + public static readonly DerObjectIdentifier NovellSecurityAttribs = new DerObjectIdentifier(Novell + ".1.9.4.1"); + + // + // Entrust + // iso(1) member-body(16) us(840) nortelnetworks(113533) entrust(7) + // + public static readonly string Entrust = "1.2.840.113533.7"; + public static readonly DerObjectIdentifier EntrustVersionExtension = new DerObjectIdentifier(Entrust + ".65.0"); + + // + // Ascom + // + public static readonly DerObjectIdentifier as_sys_sec_alg_ideaCBC = new DerObjectIdentifier("1.3.6.1.4.1.188.7.1.1.2"); + + // + // Peter Gutmann's Cryptlib + // + public static readonly DerObjectIdentifier cryptlib = new DerObjectIdentifier("1.3.6.1.4.1.3029"); + + public static readonly DerObjectIdentifier cryptlib_algorithm = cryptlib.Branch("1"); + public static readonly DerObjectIdentifier cryptlib_algorithm_blowfish_ECB = cryptlib_algorithm.Branch("1.1"); + public static readonly DerObjectIdentifier cryptlib_algorithm_blowfish_CBC = cryptlib_algorithm.Branch("1.2"); + public static readonly DerObjectIdentifier cryptlib_algorithm_blowfish_CFB = cryptlib_algorithm.Branch("1.3"); + public static readonly DerObjectIdentifier cryptlib_algorithm_blowfish_OFB = cryptlib_algorithm.Branch("1.4"); + + // + // Blake2b + // + public static readonly DerObjectIdentifier blake2 = new DerObjectIdentifier("1.3.6.1.4.1.1722.12.2"); + + public static readonly DerObjectIdentifier id_blake2b160 = blake2.Branch("1.5"); + public static readonly DerObjectIdentifier id_blake2b256 = blake2.Branch("1.8"); + public static readonly DerObjectIdentifier id_blake2b384 = blake2.Branch("1.12"); + public static readonly DerObjectIdentifier id_blake2b512 = blake2.Branch("1.16"); + + public static readonly DerObjectIdentifier id_blake2s128 = blake2.Branch("2.4"); + public static readonly DerObjectIdentifier id_blake2s160 = blake2.Branch("2.5"); + public static readonly DerObjectIdentifier id_blake2s224 = blake2.Branch("2.7"); + public static readonly DerObjectIdentifier id_blake2s256 = blake2.Branch("2.8"); + + // + // Scrypt + public static readonly DerObjectIdentifier id_scrypt = new DerObjectIdentifier("1.3.6.1.4.1.11591.4.11"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/MiscObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/MiscObjectIdentifiers.cs.meta new file mode 100644 index 00000000..8565d297 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/MiscObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ffdbc8830f79f824dba418df238c3d44 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeCertType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeCertType.cs new file mode 100644 index 00000000..d5082844 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeCertType.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc +{ + /** + * The NetscapeCertType object. + *
+     *    NetscapeCertType ::= BIT STRING {
+     *         SSLClient               (0),
+     *         SSLServer               (1),
+     *         S/MIME                  (2),
+     *         Object Signing          (3),
+     *         Reserved                (4),
+     *         SSL CA                  (5),
+     *         S/MIME CA               (6),
+     *         Object Signing CA       (7) }
+     * 
+ */ + public class NetscapeCertType + : DerBitString + { + public const int SslClient = (1 << 7); + public const int SslServer = (1 << 6); + public const int Smime = (1 << 5); + public const int ObjectSigning = (1 << 4); + public const int Reserved = (1 << 3); + public const int SslCA = (1 << 2); + public const int SmimeCA = (1 << 1); + public const int ObjectSigningCA = (1 << 0); + + /** + * Basic constructor. + * + * @param usage - the bitwise OR of the Key Usage flags giving the + * allowed uses for the key. + * e.g. (X509NetscapeCertType.sslCA | X509NetscapeCertType.smimeCA) + */ + public NetscapeCertType(int usage) + : base(usage) + { + } + + public NetscapeCertType(DerBitString usage) + : base(usage.GetBytes(), usage.PadBits) + { + } + + public override string ToString() + { + byte[] data = GetBytes(); + return "NetscapeCertType: 0x" + (data[0] & 0xff).ToString("X"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeCertType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeCertType.cs.meta new file mode 100644 index 00000000..00507c41 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeCertType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d87f849d29198334ab7d6ede2a794d59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeRevocationURL.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeRevocationURL.cs new file mode 100644 index 00000000..6332b4c5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeRevocationURL.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc +{ + public class NetscapeRevocationUrl + : DerIA5String + { + public NetscapeRevocationUrl(DerIA5String str) + : base(str.GetString()) + { + } + + public override string ToString() + { + return "NetscapeRevocationUrl: " + this.GetString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeRevocationURL.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeRevocationURL.cs.meta new file mode 100644 index 00000000..f1eaea84 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/NetscapeRevocationURL.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 566e17568a7913148b5dec3061e0c7ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/VerisignCzagExtension.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/VerisignCzagExtension.cs new file mode 100644 index 00000000..aa210ec6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/VerisignCzagExtension.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc +{ + public class VerisignCzagExtension + : DerIA5String + { + public VerisignCzagExtension(DerIA5String str) + : base(str.GetString()) + { + } + + public override string ToString() + { + return "VerisignCzagExtension: " + this.GetString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/VerisignCzagExtension.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/VerisignCzagExtension.cs.meta new file mode 100644 index 00000000..57ac1414 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/misc/VerisignCzagExtension.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea51add55957484479a5898cc980d7b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla.meta new file mode 100644 index 00000000..e56b49f5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66bc493576bc81d41bec581fe1d40712 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla/PublicKeyAndChallenge.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla/PublicKeyAndChallenge.cs new file mode 100644 index 00000000..42fff9f1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla/PublicKeyAndChallenge.cs @@ -0,0 +1,72 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Mozilla +{ + /** + * This is designed to parse + * the PublicKeyAndChallenge created by the KEYGEN tag included by + * Mozilla based browsers. + *
+	 *  PublicKeyAndChallenge ::= SEQUENCE {
+	 *    spki SubjectPublicKeyInfo,
+	 *    challenge IA5STRING
+	 *  }
+	 *
+	 *  
+ */ + public class PublicKeyAndChallenge + : Asn1Encodable + { + private Asn1Sequence pkacSeq; + private SubjectPublicKeyInfo spki; + private DerIA5String challenge; + + public static PublicKeyAndChallenge GetInstance( + object obj) + { + if (obj is PublicKeyAndChallenge) + { + return (PublicKeyAndChallenge) obj; + } + + if (obj is Asn1Sequence) + { + return new PublicKeyAndChallenge((Asn1Sequence) obj); + } + + throw new ArgumentException( + "unknown object in 'PublicKeyAndChallenge' factory : " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj) + "."); + } + + public PublicKeyAndChallenge( + Asn1Sequence seq) + { + pkacSeq = seq; + spki = SubjectPublicKeyInfo.GetInstance(seq[0]); + challenge = DerIA5String.GetInstance(seq[1]); + } + + public override Asn1Object ToAsn1Object() + { + return pkacSeq; + } + + public SubjectPublicKeyInfo SubjectPublicKeyInfo + { + get { return spki; } + } + + public DerIA5String Challenge + { + get { return challenge; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla/PublicKeyAndChallenge.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla/PublicKeyAndChallenge.cs.meta new file mode 100644 index 00000000..6ee7d41a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/mozilla/PublicKeyAndChallenge.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f1d02959da7cbe449330b04b5b234ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist.meta new file mode 100644 index 00000000..ece03d08 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e02e741e81a810c4a82a0730fa1d0d19 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTNamedCurves.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTNamedCurves.cs new file mode 100644 index 00000000..2d0c4eda --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTNamedCurves.cs @@ -0,0 +1,106 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist +{ + /** + * Utility class for fetching curves using their NIST names as published in FIPS-PUB 186-3 + */ + public sealed class NistNamedCurves + { + private NistNamedCurves() + { + } + + private static readonly IDictionary objIds = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary names = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + private static void DefineCurveAlias( + string name, + DerObjectIdentifier oid) + { + objIds.Add(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name), oid); + names.Add(oid, name); + } + + static NistNamedCurves() + { + DefineCurveAlias("B-163", SecObjectIdentifiers.SecT163r2); + DefineCurveAlias("B-233", SecObjectIdentifiers.SecT233r1); + DefineCurveAlias("B-283", SecObjectIdentifiers.SecT283r1); + DefineCurveAlias("B-409", SecObjectIdentifiers.SecT409r1); + DefineCurveAlias("B-571", SecObjectIdentifiers.SecT571r1); + + DefineCurveAlias("K-163", SecObjectIdentifiers.SecT163k1); + DefineCurveAlias("K-233", SecObjectIdentifiers.SecT233k1); + DefineCurveAlias("K-283", SecObjectIdentifiers.SecT283k1); + DefineCurveAlias("K-409", SecObjectIdentifiers.SecT409k1); + DefineCurveAlias("K-571", SecObjectIdentifiers.SecT571k1); + + DefineCurveAlias("P-192", SecObjectIdentifiers.SecP192r1); + DefineCurveAlias("P-224", SecObjectIdentifiers.SecP224r1); + DefineCurveAlias("P-256", SecObjectIdentifiers.SecP256r1); + DefineCurveAlias("P-384", SecObjectIdentifiers.SecP384r1); + DefineCurveAlias("P-521", SecObjectIdentifiers.SecP521r1); + } + + public static X9ECParameters GetByName( + string name) + { + DerObjectIdentifier oid = GetOid(name); + return oid == null ? null : GetByOid(oid); + } + + /** + * return the X9ECParameters object for the named curve represented by + * the passed in object identifier. Null if the curve isn't present. + * + * @param oid an object identifier representing a named curve, if present. + */ + public static X9ECParameters GetByOid( + DerObjectIdentifier oid) + { + return SecNamedCurves.GetByOid(oid); + } + + /** + * return the object identifier signified by the passed in name. Null + * if there is no object identifier associated with name. + * + * @return the object identifier associated with name, if present. + */ + public static DerObjectIdentifier GetOid( + string name) + { + return (DerObjectIdentifier) objIds[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name)]; + } + + /** + * return the named curve name represented by the given object identifier. + */ + public static string GetName( + DerObjectIdentifier oid) + { + return (string) names[oid]; + } + + /** + * returns an enumeration containing the name strings for curves + * contained in this structure. + */ + public static IEnumerable Names + { + get { return new EnumerableProxy(names.Values); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTNamedCurves.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTNamedCurves.cs.meta new file mode 100644 index 00000000..6cac67b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTNamedCurves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f827e48f3be93842b031d823157cb82 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTObjectIdentifiers.cs new file mode 100644 index 00000000..e2358af7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTObjectIdentifiers.cs @@ -0,0 +1,79 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist +{ + public sealed class NistObjectIdentifiers + { + private NistObjectIdentifiers() + { + } + + // + // NIST + // iso/itu(2) joint-assign(16) us(840) organization(1) gov(101) csor(3) + + // + // nistalgorithms(4) + // + public static readonly DerObjectIdentifier NistAlgorithm = new DerObjectIdentifier("2.16.840.1.101.3.4"); + + public static readonly DerObjectIdentifier HashAlgs = NistAlgorithm.Branch("2"); + + public static readonly DerObjectIdentifier IdSha256 = HashAlgs.Branch("1"); + public static readonly DerObjectIdentifier IdSha384 = HashAlgs.Branch("2"); + public static readonly DerObjectIdentifier IdSha512 = HashAlgs.Branch("3"); + public static readonly DerObjectIdentifier IdSha224 = HashAlgs.Branch("4"); + public static readonly DerObjectIdentifier IdSha512_224 = HashAlgs.Branch("5"); + public static readonly DerObjectIdentifier IdSha512_256 = HashAlgs.Branch("6"); + public static readonly DerObjectIdentifier IdSha3_224 = HashAlgs.Branch("7"); + public static readonly DerObjectIdentifier IdSha3_256 = HashAlgs.Branch("8"); + public static readonly DerObjectIdentifier IdSha3_384 = HashAlgs.Branch("9"); + public static readonly DerObjectIdentifier IdSha3_512 = HashAlgs.Branch("10"); + public static readonly DerObjectIdentifier IdShake128 = HashAlgs.Branch("11"); + public static readonly DerObjectIdentifier IdShake256 = HashAlgs.Branch("12"); + public static readonly DerObjectIdentifier IdHMacWithSha3_224 = HashAlgs.Branch("13"); + public static readonly DerObjectIdentifier IdHMacWithSha3_256 = HashAlgs.Branch("14"); + public static readonly DerObjectIdentifier IdHMacWithSha3_384 = HashAlgs.Branch("15"); + public static readonly DerObjectIdentifier IdHMacWithSha3_512 = HashAlgs.Branch("16"); + + public static readonly DerObjectIdentifier Aes = new DerObjectIdentifier(NistAlgorithm + ".1"); + + public static readonly DerObjectIdentifier IdAes128Ecb = new DerObjectIdentifier(Aes + ".1"); + public static readonly DerObjectIdentifier IdAes128Cbc = new DerObjectIdentifier(Aes + ".2"); + public static readonly DerObjectIdentifier IdAes128Ofb = new DerObjectIdentifier(Aes + ".3"); + public static readonly DerObjectIdentifier IdAes128Cfb = new DerObjectIdentifier(Aes + ".4"); + public static readonly DerObjectIdentifier IdAes128Wrap = new DerObjectIdentifier(Aes + ".5"); + public static readonly DerObjectIdentifier IdAes128Gcm = new DerObjectIdentifier(Aes + ".6"); + public static readonly DerObjectIdentifier IdAes128Ccm = new DerObjectIdentifier(Aes + ".7"); + + public static readonly DerObjectIdentifier IdAes192Ecb = new DerObjectIdentifier(Aes + ".21"); + public static readonly DerObjectIdentifier IdAes192Cbc = new DerObjectIdentifier(Aes + ".22"); + public static readonly DerObjectIdentifier IdAes192Ofb = new DerObjectIdentifier(Aes + ".23"); + public static readonly DerObjectIdentifier IdAes192Cfb = new DerObjectIdentifier(Aes + ".24"); + public static readonly DerObjectIdentifier IdAes192Wrap = new DerObjectIdentifier(Aes + ".25"); + public static readonly DerObjectIdentifier IdAes192Gcm = new DerObjectIdentifier(Aes + ".26"); + public static readonly DerObjectIdentifier IdAes192Ccm = new DerObjectIdentifier(Aes + ".27"); + + public static readonly DerObjectIdentifier IdAes256Ecb = new DerObjectIdentifier(Aes + ".41"); + public static readonly DerObjectIdentifier IdAes256Cbc = new DerObjectIdentifier(Aes + ".42"); + public static readonly DerObjectIdentifier IdAes256Ofb = new DerObjectIdentifier(Aes + ".43"); + public static readonly DerObjectIdentifier IdAes256Cfb = new DerObjectIdentifier(Aes + ".44"); + public static readonly DerObjectIdentifier IdAes256Wrap = new DerObjectIdentifier(Aes + ".45"); + public static readonly DerObjectIdentifier IdAes256Gcm = new DerObjectIdentifier(Aes + ".46"); + public static readonly DerObjectIdentifier IdAes256Ccm = new DerObjectIdentifier(Aes + ".47"); + + // + // signatures + // + public static readonly DerObjectIdentifier IdDsaWithSha2 = new DerObjectIdentifier(NistAlgorithm + ".3"); + + public static readonly DerObjectIdentifier DsaWithSha224 = new DerObjectIdentifier(IdDsaWithSha2 + ".1"); + public static readonly DerObjectIdentifier DsaWithSha256 = new DerObjectIdentifier(IdDsaWithSha2 + ".2"); + public static readonly DerObjectIdentifier DsaWithSha384 = new DerObjectIdentifier(IdDsaWithSha2 + ".3"); + public static readonly DerObjectIdentifier DsaWithSha512 = new DerObjectIdentifier(IdDsaWithSha2 + ".4"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTObjectIdentifiers.cs.meta new file mode 100644 index 00000000..09409c27 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/nist/NISTObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 156ecab2f2766c44d9d74760780d0860 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt.meta new file mode 100644 index 00000000..baa77d86 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 16ca13f58cd6010428f9c56741245ebe +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt/NTTObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt/NTTObjectIdentifiers.cs new file mode 100644 index 00000000..b42b1db1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt/NTTObjectIdentifiers.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ntt +{ + /// From RFC 3657 + public abstract class NttObjectIdentifiers + { + public static readonly DerObjectIdentifier IdCamellia128Cbc = new DerObjectIdentifier("1.2.392.200011.61.1.1.1.2"); + public static readonly DerObjectIdentifier IdCamellia192Cbc = new DerObjectIdentifier("1.2.392.200011.61.1.1.1.3"); + public static readonly DerObjectIdentifier IdCamellia256Cbc = new DerObjectIdentifier("1.2.392.200011.61.1.1.1.4"); + + public static readonly DerObjectIdentifier IdCamellia128Wrap = new DerObjectIdentifier("1.2.392.200011.61.1.1.3.2"); + public static readonly DerObjectIdentifier IdCamellia192Wrap = new DerObjectIdentifier("1.2.392.200011.61.1.1.3.3"); + public static readonly DerObjectIdentifier IdCamellia256Wrap = new DerObjectIdentifier("1.2.392.200011.61.1.1.3.4"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt/NTTObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt/NTTObjectIdentifiers.cs.meta new file mode 100644 index 00000000..36c3c09a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ntt/NTTObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 743cda84966ce1948b33282fe4961b67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp.meta new file mode 100644 index 00000000..b5cd7cce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 44025a17146cfb54bbf85c69cc3fc7d9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/BasicOCSPResponse.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/BasicOCSPResponse.cs new file mode 100644 index 00000000..fc2759a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/BasicOCSPResponse.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class BasicOcspResponse + : Asn1Encodable + { + private readonly ResponseData tbsResponseData; + private readonly AlgorithmIdentifier signatureAlgorithm; + private readonly DerBitString signature; + private readonly Asn1Sequence certs; + + public static BasicOcspResponse GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static BasicOcspResponse GetInstance( + object obj) + { + if (obj == null || obj is BasicOcspResponse) + { + return (BasicOcspResponse)obj; + } + + if (obj is Asn1Sequence) + { + return new BasicOcspResponse((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public BasicOcspResponse( + ResponseData tbsResponseData, + AlgorithmIdentifier signatureAlgorithm, + DerBitString signature, + Asn1Sequence certs) + { + this.tbsResponseData = tbsResponseData; + this.signatureAlgorithm = signatureAlgorithm; + this.signature = signature; + this.certs = certs; + } + + private BasicOcspResponse( + Asn1Sequence seq) + { + this.tbsResponseData = ResponseData.GetInstance(seq[0]); + this.signatureAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]); + this.signature = (DerBitString)seq[2]; + + if (seq.Count > 3) + { + this.certs = Asn1Sequence.GetInstance((Asn1TaggedObject)seq[3], true); + } + } + + [Obsolete("Use TbsResponseData property instead")] + public ResponseData GetTbsResponseData() + { + return tbsResponseData; + } + + public ResponseData TbsResponseData + { + get { return tbsResponseData; } + } + + [Obsolete("Use SignatureAlgorithm property instead")] + public AlgorithmIdentifier GetSignatureAlgorithm() + { + return signatureAlgorithm; + } + + public AlgorithmIdentifier SignatureAlgorithm + { + get { return signatureAlgorithm; } + } + + [Obsolete("Use Signature property instead")] + public DerBitString GetSignature() + { + return signature; + } + + public DerBitString Signature + { + get { return signature; } + } + + public byte[] GetSignatureOctets() + { + return signature.GetOctets(); + } + + [Obsolete("Use Certs property instead")] + public Asn1Sequence GetCerts() + { + return certs; + } + + public Asn1Sequence Certs + { + get { return certs; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * BasicOcspResponse       ::= Sequence {
+         *      tbsResponseData      ResponseData,
+         *      signatureAlgorithm   AlgorithmIdentifier,
+         *      signature            BIT STRING,
+         *      certs                [0] EXPLICIT Sequence OF Certificate OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + tbsResponseData, signatureAlgorithm, signature); + + if (certs != null) + { + v.Add(new DerTaggedObject(true, 0, certs)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/BasicOCSPResponse.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/BasicOCSPResponse.cs.meta new file mode 100644 index 00000000..79a5b1ee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/BasicOCSPResponse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0024dee4352844149816ed3d081fa572 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertID.cs new file mode 100644 index 00000000..96c30352 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertID.cs @@ -0,0 +1,103 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class CertID + : Asn1Encodable + { + private readonly AlgorithmIdentifier hashAlgorithm; + private readonly Asn1OctetString issuerNameHash; + private readonly Asn1OctetString issuerKeyHash; + private readonly DerInteger serialNumber; + + public static CertID GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static CertID GetInstance( + object obj) + { + if (obj == null || obj is CertID) + { + return (CertID)obj; + } + + if (obj is Asn1Sequence) + { + return new CertID((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public CertID( + AlgorithmIdentifier hashAlgorithm, + Asn1OctetString issuerNameHash, + Asn1OctetString issuerKeyHash, + DerInteger serialNumber) + { + this.hashAlgorithm = hashAlgorithm; + this.issuerNameHash = issuerNameHash; + this.issuerKeyHash = issuerKeyHash; + this.serialNumber = serialNumber; + } + + private CertID( + Asn1Sequence seq) + { + if (seq.Count != 4) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + this.hashAlgorithm = AlgorithmIdentifier.GetInstance(seq[0]); + this.issuerNameHash = Asn1OctetString.GetInstance(seq[1]); + this.issuerKeyHash = Asn1OctetString.GetInstance(seq[2]); + this.serialNumber = DerInteger.GetInstance(seq[3]); + } + + public AlgorithmIdentifier HashAlgorithm + { + get { return hashAlgorithm; } + } + + public Asn1OctetString IssuerNameHash + { + get { return issuerNameHash; } + } + + public Asn1OctetString IssuerKeyHash + { + get { return issuerKeyHash; } + } + + public DerInteger SerialNumber + { + get { return serialNumber; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * CertID          ::=     Sequence {
+         *     hashAlgorithm       AlgorithmIdentifier,
+         *     issuerNameHash      OCTET STRING, -- Hash of Issuer's DN
+         *     issuerKeyHash       OCTET STRING, -- Hash of Issuers public key
+         *     serialNumber        CertificateSerialNumber }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(hashAlgorithm, issuerNameHash, issuerKeyHash, serialNumber); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertID.cs.meta new file mode 100644 index 00000000..1d5eccbe --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c00c7fd4fc5076848a82dd1095e8e246 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertStatus.cs new file mode 100644 index 00000000..0eab05d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertStatus.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class CertStatus + : Asn1Encodable, IAsn1Choice + { + private readonly int tagNo; + private readonly Asn1Encodable value; + + /** + * create a CertStatus object with a tag of zero. + */ + public CertStatus() + { + tagNo = 0; + value = DerNull.Instance; + } + + public CertStatus( + RevokedInfo info) + { + tagNo = 1; + value = info; + } + + public CertStatus( + int tagNo, + Asn1Encodable value) + { + this.tagNo = tagNo; + this.value = value; + } + + public CertStatus( + Asn1TaggedObject choice) + { + this.tagNo = choice.TagNo; + + switch (choice.TagNo) + { + case 1: + value = RevokedInfo.GetInstance(choice, false); + break; + case 0: + case 2: + value = DerNull.Instance; + break; + default: + throw new ArgumentException("Unknown tag encountered: " + choice.TagNo); + } + } + + public static CertStatus GetInstance( + object obj) + { + if (obj == null || obj is CertStatus) + { + return (CertStatus)obj; + } + + if (obj is Asn1TaggedObject) + { + return new CertStatus((Asn1TaggedObject)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public int TagNo + { + get { return tagNo; } + } + + public Asn1Encodable Status + { + get { return value; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  CertStatus ::= CHOICE {
+         *                  good        [0]     IMPLICIT Null,
+         *                  revoked     [1]     IMPLICIT RevokedInfo,
+         *                  unknown     [2]     IMPLICIT UnknownInfo }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerTaggedObject(false, tagNo, value); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertStatus.cs.meta new file mode 100644 index 00000000..ec3138a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CertStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6ada7643cbf84f4b94d04fd68ef003f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CrlID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CrlID.cs new file mode 100644 index 00000000..2658a966 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CrlID.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class CrlID + : Asn1Encodable + { + private readonly DerIA5String crlUrl; + private readonly DerInteger crlNum; + private readonly DerGeneralizedTime crlTime; + + // TODO Add GetInstance method(s) and amke this private? + public CrlID( + Asn1Sequence seq) + { + foreach (Asn1TaggedObject o in seq) + { + switch (o.TagNo) + { + case 0: + crlUrl = DerIA5String.GetInstance(o, true); + break; + case 1: + crlNum = DerInteger.GetInstance(o, true); + break; + case 2: + crlTime = DerGeneralizedTime.GetInstance(o, true); + break; + default: + throw new ArgumentException("unknown tag number: " + o.TagNo); + } + } + } + + public DerIA5String CrlUrl + { + get { return crlUrl; } + } + + public DerInteger CrlNum + { + get { return crlNum; } + } + + public DerGeneralizedTime CrlTime + { + get { return crlTime; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * CrlID ::= Sequence {
+         *     crlUrl               [0]     EXPLICIT IA5String OPTIONAL,
+         *     crlNum               [1]     EXPLICIT Integer OPTIONAL,
+         *     crlTime              [2]     EXPLICIT GeneralizedTime OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (crlUrl != null) + { + v.Add(new DerTaggedObject(true, 0, crlUrl)); + } + + if (crlNum != null) + { + v.Add(new DerTaggedObject(true, 1, crlNum)); + } + + if (crlTime != null) + { + v.Add(new DerTaggedObject(true, 2, crlTime)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CrlID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CrlID.cs.meta new file mode 100644 index 00000000..c82f3df7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/CrlID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d87e0a9a858ccb94cb41f29411c725b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPObjectIdentifiers.cs new file mode 100644 index 00000000..fd46cd47 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPObjectIdentifiers.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public abstract class OcspObjectIdentifiers + { + internal const string PkixOcspId = "1.3.6.1.5.5.7.48.1"; + + public static readonly DerObjectIdentifier PkixOcsp = new DerObjectIdentifier(PkixOcspId); + public static readonly DerObjectIdentifier PkixOcspBasic = new DerObjectIdentifier(PkixOcspId + ".1"); + + // + // extensions + // + public static readonly DerObjectIdentifier PkixOcspNonce = new DerObjectIdentifier(PkixOcsp + ".2"); + public static readonly DerObjectIdentifier PkixOcspCrl = new DerObjectIdentifier(PkixOcsp + ".3"); + + public static readonly DerObjectIdentifier PkixOcspResponse = new DerObjectIdentifier(PkixOcsp + ".4"); + public static readonly DerObjectIdentifier PkixOcspNocheck = new DerObjectIdentifier(PkixOcsp + ".5"); + public static readonly DerObjectIdentifier PkixOcspArchiveCutoff = new DerObjectIdentifier(PkixOcsp + ".6"); + public static readonly DerObjectIdentifier PkixOcspServiceLocator = new DerObjectIdentifier(PkixOcsp + ".7"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPObjectIdentifiers.cs.meta new file mode 100644 index 00000000..7936ba3c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8415878ec63dc99489adfa5c7770f4ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPRequest.cs new file mode 100644 index 00000000..40182b1a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPRequest.cs @@ -0,0 +1,93 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class OcspRequest + : Asn1Encodable + { + private readonly TbsRequest tbsRequest; + private readonly Signature optionalSignature; + + public static OcspRequest GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static OcspRequest GetInstance( + object obj) + { + if (obj == null || obj is OcspRequest) + { + return (OcspRequest)obj; + } + + if (obj is Asn1Sequence) + { + return new OcspRequest((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public OcspRequest( + TbsRequest tbsRequest, + Signature optionalSignature) + { + if (tbsRequest == null) + throw new ArgumentNullException("tbsRequest"); + + this.tbsRequest = tbsRequest; + this.optionalSignature = optionalSignature; + } + + private OcspRequest( + Asn1Sequence seq) + { + tbsRequest = TbsRequest.GetInstance(seq[0]); + + if (seq.Count == 2) + { + optionalSignature = Signature.GetInstance( + (Asn1TaggedObject)seq[1], true); + } + } + + public TbsRequest TbsRequest + { + get { return tbsRequest; } + } + + public Signature OptionalSignature + { + get { return optionalSignature; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * OcspRequest     ::=     Sequence {
+         *     tbsRequest                  TBSRequest,
+         *     optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(tbsRequest); + + if (optionalSignature != null) + { + v.Add(new DerTaggedObject(true, 0, optionalSignature)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPRequest.cs.meta new file mode 100644 index 00000000..d173274a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3778c0c035ab13044b79e2d97bee672d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponse.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponse.cs new file mode 100644 index 00000000..4aeb3113 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponse.cs @@ -0,0 +1,94 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class OcspResponse + : Asn1Encodable + { + private readonly OcspResponseStatus responseStatus; + private readonly ResponseBytes responseBytes; + + public static OcspResponse GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static OcspResponse GetInstance( + object obj) + { + if (obj == null || obj is OcspResponse) + { + return (OcspResponse)obj; + } + + if (obj is Asn1Sequence) + { + return new OcspResponse((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public OcspResponse( + OcspResponseStatus responseStatus, + ResponseBytes responseBytes) + { + if (responseStatus == null) + throw new ArgumentNullException("responseStatus"); + + this.responseStatus = responseStatus; + this.responseBytes = responseBytes; + } + + private OcspResponse( + Asn1Sequence seq) + { + responseStatus = new OcspResponseStatus( + DerEnumerated.GetInstance(seq[0])); + + if (seq.Count == 2) + { + responseBytes = ResponseBytes.GetInstance( + (Asn1TaggedObject)seq[1], true); + } + } + + public OcspResponseStatus ResponseStatus + { + get { return responseStatus; } + } + + public ResponseBytes ResponseBytes + { + get { return responseBytes; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * OcspResponse ::= Sequence {
+         *     responseStatus         OcspResponseStatus,
+         *     responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(responseStatus); + + if (responseBytes != null) + { + v.Add(new DerTaggedObject(true, 0, responseBytes)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponse.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponse.cs.meta new file mode 100644 index 00000000..6f0625db --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b6d3078d2d344f4b937e25054e084ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponseStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponseStatus.cs new file mode 100644 index 00000000..1028d3e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponseStatus.cs @@ -0,0 +1,45 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class OcspResponseStatus + : DerEnumerated + { + public const int Successful = 0; + public const int MalformedRequest = 1; + public const int InternalError = 2; + public const int TryLater = 3; + public const int SignatureRequired = 5; + public const int Unauthorized = 6; + + /** + * The OcspResponseStatus enumeration. + *
+         * OcspResponseStatus ::= Enumerated {
+         *     successful            (0),  --Response has valid confirmations
+         *     malformedRequest      (1),  --Illegal confirmation request
+         *     internalError         (2),  --Internal error in issuer
+         *     tryLater              (3),  --Try again later
+         *                                 --(4) is not used
+         *     sigRequired           (5),  --Must sign the request
+         *     unauthorized          (6)   --Request unauthorized
+         * }
+         * 
+ */ + public OcspResponseStatus(int value) + : base(value) + { + } + + public OcspResponseStatus(DerEnumerated value) + : base(value.Value.IntValue) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponseStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponseStatus.cs.meta new file mode 100644 index 00000000..fc642cb1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/OCSPResponseStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 23667b08f22dccd4bbf811e2f210dd74 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Request.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Request.cs new file mode 100644 index 00000000..de2c31dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Request.cs @@ -0,0 +1,95 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class Request + : Asn1Encodable + { + private readonly CertID reqCert; + private readonly X509Extensions singleRequestExtensions; + + public static Request GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static Request GetInstance( + object obj) + { + if (obj == null || obj is Request) + { + return (Request)obj; + } + + if (obj is Asn1Sequence) + { + return new Request((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public Request( + CertID reqCert, + X509Extensions singleRequestExtensions) + { + if (reqCert == null) + throw new ArgumentNullException("reqCert"); + + this.reqCert = reqCert; + this.singleRequestExtensions = singleRequestExtensions; + } + + private Request( + Asn1Sequence seq) + { + reqCert = CertID.GetInstance(seq[0]); + + if (seq.Count == 2) + { + singleRequestExtensions = X509Extensions.GetInstance( + (Asn1TaggedObject)seq[1], true); + } + } + + public CertID ReqCert + { + get { return reqCert; } + } + + public X509Extensions SingleRequestExtensions + { + get { return singleRequestExtensions; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * Request         ::=     Sequence {
+         *     reqCert                     CertID,
+         *     singleRequestExtensions     [0] EXPLICIT Extensions OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(reqCert); + + if (singleRequestExtensions != null) + { + v.Add(new DerTaggedObject(true, 0, singleRequestExtensions)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Request.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Request.cs.meta new file mode 100644 index 00000000..8e1eafd4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Request.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bdab62c940065664d87b68a36ad957dc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponderID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponderID.cs new file mode 100644 index 00000000..b8ee59fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponderID.cs @@ -0,0 +1,111 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class ResponderID + : Asn1Encodable, IAsn1Choice + { + private readonly Asn1Encodable id; + + public static ResponderID GetInstance( + object obj) + { + if (obj == null || obj is ResponderID) + { + return (ResponderID)obj; + } + + if (obj is DerOctetString) + { + return new ResponderID((DerOctetString)obj); + } + + if (obj is Asn1TaggedObject) + { + Asn1TaggedObject o = (Asn1TaggedObject)obj; + + if (o.TagNo == 1) + { + return new ResponderID(X509Name.GetInstance(o, true)); + } + + return new ResponderID(Asn1OctetString.GetInstance(o, true)); + } + + return new ResponderID(X509Name.GetInstance(obj)); + } + + public ResponderID( + Asn1OctetString id) + { + if (id == null) + throw new ArgumentNullException("id"); + + this.id = id; + } + + public ResponderID( + X509Name id) + { + if (id == null) + throw new ArgumentNullException("id"); + + this.id = id; + } + + public static ResponderID GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(obj.GetObject()); // must be explicitly tagged + } + + public virtual byte[] GetKeyHash() + { + if (id is Asn1OctetString) + { + return ((Asn1OctetString)id).GetOctets(); + } + + return null; + } + + public virtual X509Name Name + { + get + { + if (id is Asn1OctetString) + { + return null; + } + + return X509Name.GetInstance(id); + } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * ResponderID ::= CHOICE {
+         *      byName          [1] Name,
+         *      byKey           [2] KeyHash }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + if (id is Asn1OctetString) + { + return new DerTaggedObject(true, 2, id); + } + + return new DerTaggedObject(true, 1, id); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponderID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponderID.cs.meta new file mode 100644 index 00000000..bfcebb1c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponderID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d2f0b66c62702343b6d4d874dab6abe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseBytes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseBytes.cs new file mode 100644 index 00000000..03a8311e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseBytes.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class ResponseBytes + : Asn1Encodable + { + private readonly DerObjectIdentifier responseType; + private readonly Asn1OctetString response; + + public static ResponseBytes GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static ResponseBytes GetInstance( + object obj) + { + if (obj == null || obj is ResponseBytes) + { + return (ResponseBytes)obj; + } + + if (obj is Asn1Sequence) + { + return new ResponseBytes((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public ResponseBytes( + DerObjectIdentifier responseType, + Asn1OctetString response) + { + if (responseType == null) + throw new ArgumentNullException("responseType"); + if (response == null) + throw new ArgumentNullException("response"); + + this.responseType = responseType; + this.response = response; + } + + private ResponseBytes( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + this.responseType = DerObjectIdentifier.GetInstance(seq[0]); + this.response = Asn1OctetString.GetInstance(seq[1]); + } + + public DerObjectIdentifier ResponseType + { + get { return responseType; } + } + + public Asn1OctetString Response + { + get { return response; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * ResponseBytes ::=       Sequence {
+         *     responseType   OBJECT IDENTIFIER,
+         *     response       OCTET STRING }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(responseType, response); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseBytes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseBytes.cs.meta new file mode 100644 index 00000000..39390293 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseBytes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c1277fc319921a4ebca46154111d17d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseData.cs new file mode 100644 index 00000000..c61f3388 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseData.cs @@ -0,0 +1,162 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class ResponseData + : Asn1Encodable + { + private static readonly DerInteger V1 = new DerInteger(0); + + private readonly bool versionPresent; + private readonly DerInteger version; + private readonly ResponderID responderID; + private readonly DerGeneralizedTime producedAt; + private readonly Asn1Sequence responses; + private readonly X509Extensions responseExtensions; + + public static ResponseData GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static ResponseData GetInstance( + object obj) + { + if (obj == null || obj is ResponseData) + { + return (ResponseData)obj; + } + + if (obj is Asn1Sequence) + { + return new ResponseData((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public ResponseData( + DerInteger version, + ResponderID responderID, + DerGeneralizedTime producedAt, + Asn1Sequence responses, + X509Extensions responseExtensions) + { + this.version = version; + this.responderID = responderID; + this.producedAt = producedAt; + this.responses = responses; + this.responseExtensions = responseExtensions; + } + + public ResponseData( + ResponderID responderID, + DerGeneralizedTime producedAt, + Asn1Sequence responses, + X509Extensions responseExtensions) + : this(V1, responderID, producedAt, responses, responseExtensions) + { + } + + private ResponseData( + Asn1Sequence seq) + { + int index = 0; + + Asn1Encodable enc = seq[0]; + if (enc is Asn1TaggedObject) + { + Asn1TaggedObject o = (Asn1TaggedObject)enc; + + if (o.TagNo == 0) + { + this.versionPresent = true; + this.version = DerInteger.GetInstance(o, true); + index++; + } + else + { + this.version = V1; + } + } + else + { + this.version = V1; + } + + this.responderID = ResponderID.GetInstance(seq[index++]); + this.producedAt = (DerGeneralizedTime)seq[index++]; + this.responses = (Asn1Sequence)seq[index++]; + + if (seq.Count > index) + { + this.responseExtensions = X509Extensions.GetInstance( + (Asn1TaggedObject)seq[index], true); + } + } + + public DerInteger Version + { + get { return version; } + } + + public ResponderID ResponderID + { + get { return responderID; } + } + + public DerGeneralizedTime ProducedAt + { + get { return producedAt; } + } + + public Asn1Sequence Responses + { + get { return responses; } + } + + public X509Extensions ResponseExtensions + { + get { return responseExtensions; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * ResponseData ::= Sequence {
+         *     version              [0] EXPLICIT Version DEFAULT v1,
+         *     responderID              ResponderID,
+         *     producedAt               GeneralizedTime,
+         *     responses                Sequence OF SingleResponse,
+         *     responseExtensions   [1] EXPLICIT Extensions OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (versionPresent || !version.Equals(V1)) + { + v.Add(new DerTaggedObject(true, 0, version)); + } + + v.Add(responderID, producedAt, responses); + + if (responseExtensions != null) + { + v.Add(new DerTaggedObject(true, 1, responseExtensions)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseData.cs.meta new file mode 100644 index 00000000..c3fdeb29 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ResponseData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a5e949e97ad55f46a22cdc20c23ac99 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/RevokedInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/RevokedInfo.cs new file mode 100644 index 00000000..fd2ef2e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/RevokedInfo.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class RevokedInfo + : Asn1Encodable + { + private readonly DerGeneralizedTime revocationTime; + private readonly CrlReason revocationReason; + + public static RevokedInfo GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static RevokedInfo GetInstance( + object obj) + { + if (obj == null || obj is RevokedInfo) + { + return (RevokedInfo) obj; + } + + if (obj is Asn1Sequence) + { + return new RevokedInfo((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public RevokedInfo( + DerGeneralizedTime revocationTime) + : this(revocationTime, null) + { + } + + public RevokedInfo( + DerGeneralizedTime revocationTime, + CrlReason revocationReason) + { + if (revocationTime == null) + throw new ArgumentNullException("revocationTime"); + + this.revocationTime = revocationTime; + this.revocationReason = revocationReason; + } + + private RevokedInfo( + Asn1Sequence seq) + { + this.revocationTime = (DerGeneralizedTime) seq[0]; + + if (seq.Count > 1) + { + this.revocationReason = new CrlReason( + DerEnumerated.GetInstance((Asn1TaggedObject) seq[1], true)); + } + } + + public DerGeneralizedTime RevocationTime + { + get { return revocationTime; } + } + + public CrlReason RevocationReason + { + get { return revocationReason; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * RevokedInfo ::= Sequence {
+         *      revocationTime              GeneralizedTime,
+         *      revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(revocationTime); + + if (revocationReason != null) + { + v.Add(new DerTaggedObject(true, 0, revocationReason)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/RevokedInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/RevokedInfo.cs.meta new file mode 100644 index 00000000..6a842b6b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/RevokedInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39642c63b2e65694eb47d4378f1b69da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ServiceLocator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ServiceLocator.cs new file mode 100644 index 00000000..9724c86b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ServiceLocator.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class ServiceLocator + : Asn1Encodable + { + private readonly X509Name issuer; + private readonly Asn1Object locator; + + public static ServiceLocator GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static ServiceLocator GetInstance( + object obj) + { + if (obj == null || obj is ServiceLocator) + { + return (ServiceLocator) obj; + } + + if (obj is Asn1Sequence) + { + return new ServiceLocator((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public ServiceLocator( + X509Name issuer) + : this(issuer, null) + { + } + + public ServiceLocator( + X509Name issuer, + Asn1Object locator) + { + if (issuer == null) + throw new ArgumentNullException("issuer"); + + this.issuer = issuer; + this.locator = locator; + } + + private ServiceLocator( + Asn1Sequence seq) + { + this.issuer = X509Name.GetInstance(seq[0]); + + if (seq.Count > 1) + { + this.locator = seq[1].ToAsn1Object(); + } + } + + public X509Name Issuer + { + get { return issuer; } + } + + public Asn1Object Locator + { + get { return locator; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * ServiceLocator ::= Sequence {
+         *     issuer    Name,
+         *     locator   AuthorityInfoAccessSyntax OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(issuer); + + if (locator != null) + { + v.Add(locator); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ServiceLocator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ServiceLocator.cs.meta new file mode 100644 index 00000000..3417f799 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/ServiceLocator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b835881b17de6fe4786621f9fd55405e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Signature.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Signature.cs new file mode 100644 index 00000000..335b0033 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Signature.cs @@ -0,0 +1,119 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class Signature + : Asn1Encodable + { + internal AlgorithmIdentifier signatureAlgorithm; + internal DerBitString signatureValue; + internal Asn1Sequence certs; + + public static Signature GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static Signature GetInstance( + object obj) + { + if (obj == null || obj is Signature) + { + return (Signature)obj; + } + + if (obj is Asn1Sequence) + { + return new Signature((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public Signature( + AlgorithmIdentifier signatureAlgorithm, + DerBitString signatureValue) + : this(signatureAlgorithm, signatureValue, null) + { + } + + public Signature( + AlgorithmIdentifier signatureAlgorithm, + DerBitString signatureValue, + Asn1Sequence certs) + { + if (signatureAlgorithm == null) + throw new ArgumentException("signatureAlgorithm"); + if (signatureValue == null) + throw new ArgumentException("signatureValue"); + + this.signatureAlgorithm = signatureAlgorithm; + this.signatureValue = signatureValue; + this.certs = certs; + } + + private Signature( + Asn1Sequence seq) + { + signatureAlgorithm = AlgorithmIdentifier.GetInstance(seq[0]); + signatureValue = (DerBitString)seq[1]; + + if (seq.Count == 3) + { + certs = Asn1Sequence.GetInstance( + (Asn1TaggedObject)seq[2], true); + } + } + + public AlgorithmIdentifier SignatureAlgorithm + { + get { return signatureAlgorithm; } + } + + public DerBitString SignatureValue + { + get { return signatureValue; } + } + + public byte[] GetSignatureOctets() + { + return signatureValue.GetOctets(); + } + + public Asn1Sequence Certs + { + get { return certs; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * Signature       ::=     Sequence {
+         *     signatureAlgorithm      AlgorithmIdentifier,
+         *     signature               BIT STRING,
+         *     certs               [0] EXPLICIT Sequence OF Certificate OPTIONAL}
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + signatureAlgorithm, signatureValue); + + if (certs != null) + { + v.Add(new DerTaggedObject(true, 0, certs)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Signature.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Signature.cs.meta new file mode 100644 index 00000000..74f37825 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/Signature.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b21fa2dbdb89eaf49a4a2cc3ee8041e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/SingleResponse.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/SingleResponse.cs new file mode 100644 index 00000000..59d85e06 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/SingleResponse.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class SingleResponse + : Asn1Encodable + { + private readonly CertID certID; + private readonly CertStatus certStatus; + private readonly DerGeneralizedTime thisUpdate; + private readonly DerGeneralizedTime nextUpdate; + private readonly X509Extensions singleExtensions; + + public SingleResponse( + CertID certID, + CertStatus certStatus, + DerGeneralizedTime thisUpdate, + DerGeneralizedTime nextUpdate, + X509Extensions singleExtensions) + { + this.certID = certID; + this.certStatus = certStatus; + this.thisUpdate = thisUpdate; + this.nextUpdate = nextUpdate; + this.singleExtensions = singleExtensions; + } + + public SingleResponse( + Asn1Sequence seq) + { + this.certID = CertID.GetInstance(seq[0]); + this.certStatus = CertStatus.GetInstance(seq[1]); + this.thisUpdate = (DerGeneralizedTime)seq[2]; + + if (seq.Count > 4) + { + this.nextUpdate = DerGeneralizedTime.GetInstance( + (Asn1TaggedObject) seq[3], true); + this.singleExtensions = X509Extensions.GetInstance( + (Asn1TaggedObject) seq[4], true); + } + else if (seq.Count > 3) + { + Asn1TaggedObject o = (Asn1TaggedObject) seq[3]; + + if (o.TagNo == 0) + { + this.nextUpdate = DerGeneralizedTime.GetInstance(o, true); + } + else + { + this.singleExtensions = X509Extensions.GetInstance(o, true); + } + } + } + + public static SingleResponse GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static SingleResponse GetInstance( + object obj) + { + if (obj == null || obj is SingleResponse) + { + return (SingleResponse)obj; + } + + if (obj is Asn1Sequence) + { + return new SingleResponse((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public CertID CertId + { + get { return certID; } + } + + public CertStatus CertStatus + { + get { return certStatus; } + } + + public DerGeneralizedTime ThisUpdate + { + get { return thisUpdate; } + } + + public DerGeneralizedTime NextUpdate + { + get { return nextUpdate; } + } + + public X509Extensions SingleExtensions + { + get { return singleExtensions; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  SingleResponse ::= Sequence {
+         *          certID                       CertID,
+         *          certStatus                   CertStatus,
+         *          thisUpdate                   GeneralizedTime,
+         *          nextUpdate         [0]       EXPLICIT GeneralizedTime OPTIONAL,
+         *          singleExtensions   [1]       EXPLICIT Extensions OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + certID, certStatus, thisUpdate); + + if (nextUpdate != null) + { + v.Add(new DerTaggedObject(true, 0, nextUpdate)); + } + + if (singleExtensions != null) + { + v.Add(new DerTaggedObject(true, 1, singleExtensions)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/SingleResponse.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/SingleResponse.cs.meta new file mode 100644 index 00000000..299afbc9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/SingleResponse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f95d68668b2faba49b1fb25625208006 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/TBSRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/TBSRequest.cs new file mode 100644 index 00000000..948f3add --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/TBSRequest.cs @@ -0,0 +1,155 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp +{ + public class TbsRequest + : Asn1Encodable + { + private static readonly DerInteger V1 = new DerInteger(0); + + private readonly DerInteger version; + private readonly GeneralName requestorName; + private readonly Asn1Sequence requestList; + private readonly X509Extensions requestExtensions; + + private bool versionSet; + + public static TbsRequest GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static TbsRequest GetInstance( + object obj) + { + if (obj == null || obj is TbsRequest) + { + return (TbsRequest)obj; + } + + if (obj is Asn1Sequence) + { + return new TbsRequest((Asn1Sequence)obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public TbsRequest( + GeneralName requestorName, + Asn1Sequence requestList, + X509Extensions requestExtensions) + { + this.version = V1; + this.requestorName = requestorName; + this.requestList = requestList; + this.requestExtensions = requestExtensions; + } + + private TbsRequest( + Asn1Sequence seq) + { + int index = 0; + + Asn1Encodable enc = seq[0]; + if (enc is Asn1TaggedObject) + { + Asn1TaggedObject o = (Asn1TaggedObject) enc; + + if (o.TagNo == 0) + { + versionSet = true; + version = DerInteger.GetInstance(o, true); + index++; + } + else + { + version = V1; + } + } + else + { + version = V1; + } + + if (seq[index] is Asn1TaggedObject) + { + requestorName = GeneralName.GetInstance((Asn1TaggedObject) seq[index++], true); + } + + requestList = (Asn1Sequence) seq[index++]; + + if (seq.Count == (index + 1)) + { + requestExtensions = X509Extensions.GetInstance((Asn1TaggedObject) seq[index], true); + } + } + + public DerInteger Version + { + get { return version; } + } + + public GeneralName RequestorName + { + get { return requestorName; } + } + + public Asn1Sequence RequestList + { + get { return requestList; } + } + + public X509Extensions RequestExtensions + { + get { return requestExtensions; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * TBSRequest      ::=     Sequence {
+         *     version             [0]     EXPLICIT Version DEFAULT v1,
+         *     requestorName       [1]     EXPLICIT GeneralName OPTIONAL,
+         *     requestList                 Sequence OF Request,
+         *     requestExtensions   [2]     EXPLICIT Extensions OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + // + // if default don't include - unless explicitly provided. Not strictly correct + // but required for some requests + // + if (!version.Equals(V1) || versionSet) + { + v.Add(new DerTaggedObject(true, 0, version)); + } + + if (requestorName != null) + { + v.Add(new DerTaggedObject(true, 1, requestorName)); + } + + v.Add(requestList); + + if (requestExtensions != null) + { + v.Add(new DerTaggedObject(true, 2, requestExtensions)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/TBSRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/TBSRequest.cs.meta new file mode 100644 index 00000000..d03d9b47 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ocsp/TBSRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56a7afa756fe1904b853bb8c33b6ece5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw.meta new file mode 100644 index 00000000..5c51a6bd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 09d1a73b7ec49b046a598def5fc61483 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/ElGamalParameter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/ElGamalParameter.cs new file mode 100644 index 00000000..39871380 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/ElGamalParameter.cs @@ -0,0 +1,51 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw +{ + public class ElGamalParameter + : Asn1Encodable + { + internal DerInteger p, g; + + public ElGamalParameter( + BigInteger p, + BigInteger g) + { + this.p = new DerInteger(p); + this.g = new DerInteger(g); + } + + public ElGamalParameter( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + p = DerInteger.GetInstance(seq[0]); + g = DerInteger.GetInstance(seq[1]); + } + + public BigInteger P + { + get { return p.PositiveValue; } + } + + public BigInteger G + { + get { return g.PositiveValue; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(p, g); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/ElGamalParameter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/ElGamalParameter.cs.meta new file mode 100644 index 00000000..cc0bc655 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/ElGamalParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a50b32b1d8a393a438cb8d7e885202e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/OIWObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/OIWObjectIdentifiers.cs new file mode 100644 index 00000000..8932a118 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/OIWObjectIdentifiers.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw +{ + public abstract class OiwObjectIdentifiers + { + public static readonly DerObjectIdentifier MD4WithRsa = new DerObjectIdentifier("1.3.14.3.2.2"); + public static readonly DerObjectIdentifier MD5WithRsa = new DerObjectIdentifier("1.3.14.3.2.3"); + public static readonly DerObjectIdentifier MD4WithRsaEncryption = new DerObjectIdentifier("1.3.14.3.2.4"); + + public static readonly DerObjectIdentifier DesEcb = new DerObjectIdentifier("1.3.14.3.2.6"); + public static readonly DerObjectIdentifier DesCbc = new DerObjectIdentifier("1.3.14.3.2.7"); + public static readonly DerObjectIdentifier DesOfb = new DerObjectIdentifier("1.3.14.3.2.8"); + public static readonly DerObjectIdentifier DesCfb = new DerObjectIdentifier("1.3.14.3.2.9"); + + public static readonly DerObjectIdentifier DesEde = new DerObjectIdentifier("1.3.14.3.2.17"); + + // id-SHA1 OBJECT IDENTIFIER ::= + // {iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 26 } // + public static readonly DerObjectIdentifier IdSha1 = new DerObjectIdentifier("1.3.14.3.2.26"); + + public static readonly DerObjectIdentifier DsaWithSha1 = new DerObjectIdentifier("1.3.14.3.2.27"); + + public static readonly DerObjectIdentifier Sha1WithRsa = new DerObjectIdentifier("1.3.14.3.2.29"); + + // ElGamal Algorithm OBJECT IDENTIFIER ::= + // {iso(1) identified-organization(3) oiw(14) dirservsig(7) algorithm(2) encryption(1) 1 } + // + public static readonly DerObjectIdentifier ElGamalAlgorithm = new DerObjectIdentifier("1.3.14.7.2.1.1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/OIWObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/OIWObjectIdentifiers.cs.meta new file mode 100644 index 00000000..bf2ba50b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/oiw/OIWObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 869fa662a3f9784479a943f14f0a8915 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs.meta new file mode 100644 index 00000000..ce68dc7c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 09fcff0d03b2a6c4c8a625ec7c05be96 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Attribute.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Attribute.cs new file mode 100644 index 00000000..6885fef3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Attribute.cs @@ -0,0 +1,83 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class AttributePkcs + : Asn1Encodable + { + private readonly DerObjectIdentifier attrType; + private readonly Asn1Set attrValues; + + /** + * return an Attribute object from the given object. + * + * @param o the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static AttributePkcs GetInstance( + object obj) + { + AttributePkcs attr = obj as AttributePkcs; + if (obj == null || attr != null) + { + return attr; + } + + Asn1Sequence seq = obj as Asn1Sequence; + if (seq != null) + { + return new AttributePkcs(seq); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private AttributePkcs( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + attrType = DerObjectIdentifier.GetInstance(seq[0]); + attrValues = Asn1Set.GetInstance(seq[1]); + } + + public AttributePkcs( + DerObjectIdentifier attrType, + Asn1Set attrValues) + { + this.attrType = attrType; + this.attrValues = attrValues; + } + + public DerObjectIdentifier AttrType + { + get { return attrType; } + } + + public Asn1Set AttrValues + { + get { return attrValues; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * Attr ::= Sequence {
+         *     attrType OBJECT IDENTIFIER,
+         *     attrValues Set OF AttributeValue
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(attrType, attrValues); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Attribute.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Attribute.cs.meta new file mode 100644 index 00000000..0d3e5a79 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Attribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d43f45bc4a941174f93b102883e8db23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/AuthenticatedSafe.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/AuthenticatedSafe.cs new file mode 100644 index 00000000..f9bc874d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/AuthenticatedSafe.cs @@ -0,0 +1,41 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class AuthenticatedSafe + : Asn1Encodable + { + private readonly ContentInfo[] info; + + public AuthenticatedSafe( + Asn1Sequence seq) + { + info = new ContentInfo[seq.Count]; + + for (int i = 0; i != info.Length; i++) + { + info[i] = ContentInfo.GetInstance(seq[i]); + } + } + + public AuthenticatedSafe( + ContentInfo[] info) + { + this.info = (ContentInfo[]) info.Clone(); + } + + public ContentInfo[] GetContentInfo() + { + return (ContentInfo[]) info.Clone(); + } + + public override Asn1Object ToAsn1Object() + { + return new BerSequence(info); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/AuthenticatedSafe.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/AuthenticatedSafe.cs.meta new file mode 100644 index 00000000..798d17e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/AuthenticatedSafe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5509ac0a56c50c4c9a320a66874e392 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertBag.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertBag.cs new file mode 100644 index 00000000..da591000 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertBag.cs @@ -0,0 +1,50 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class CertBag + : Asn1Encodable + { +// private readonly Asn1Sequence seq; + private readonly DerObjectIdentifier certID; + private readonly Asn1Object certValue; + + public CertBag( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + +// this.seq = seq; + this.certID = DerObjectIdentifier.GetInstance(seq[0]); + this.certValue = DerTaggedObject.GetInstance(seq[1]).GetObject(); + } + + public CertBag( + DerObjectIdentifier certID, + Asn1Object certValue) + { + this.certID = certID; + this.certValue = certValue; + } + + public DerObjectIdentifier CertID + { + get { return certID; } + } + + public Asn1Object CertValue + { + get { return certValue; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(certID, new DerTaggedObject(0, certValue)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertBag.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertBag.cs.meta new file mode 100644 index 00000000..d298c6f3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertBag.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94efdd8ff79c1294ebc94c6454d6e202 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequest.cs new file mode 100644 index 00000000..8e116a4d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequest.cs @@ -0,0 +1,91 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + /** + * Pkcs10 Certfication request object. + *
+     * CertificationRequest ::= Sequence {
+     *   certificationRequestInfo  CertificationRequestInfo,
+     *   signatureAlgorithm        AlgorithmIdentifier{{ SignatureAlgorithms }},
+     *   signature                 BIT STRING
+     * }
+     * 
+ */ + public class CertificationRequest + : Asn1Encodable + { + protected CertificationRequestInfo reqInfo; + protected AlgorithmIdentifier sigAlgId; + protected DerBitString sigBits; + + public static CertificationRequest GetInstance( + object obj) + { + if (obj is CertificationRequest) + return (CertificationRequest)obj; + + if (obj != null) + return new CertificationRequest((Asn1Sequence)obj); + + return null; + } + + protected CertificationRequest() + { + } + + public CertificationRequest( + CertificationRequestInfo requestInfo, + AlgorithmIdentifier algorithm, + DerBitString signature) + { + this.reqInfo = requestInfo; + this.sigAlgId = algorithm; + this.sigBits = signature; + } + + [Obsolete("Use 'GetInstance' instead")] + public CertificationRequest( + Asn1Sequence seq) + { + if (seq.Count != 3) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + reqInfo = CertificationRequestInfo.GetInstance(seq[0]); + sigAlgId = AlgorithmIdentifier.GetInstance(seq[1]); + sigBits = DerBitString.GetInstance(seq[2]); + } + + public CertificationRequestInfo GetCertificationRequestInfo() + { + return reqInfo; + } + + public AlgorithmIdentifier SignatureAlgorithm + { + get { return sigAlgId; } + } + + public DerBitString Signature + { + get { return sigBits; } + } + + public byte[] GetSignatureOctets() + { + return sigBits.GetOctets(); + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(reqInfo, sigAlgId, sigBits); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequest.cs.meta new file mode 100644 index 00000000..71157190 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e4e699e746ace347bd9bbc263c0fd1e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequestInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequestInfo.cs new file mode 100644 index 00000000..969124af --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequestInfo.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + /** + * Pkcs10 CertificationRequestInfo object. + *
+     *  CertificationRequestInfo ::= Sequence {
+     *   version             Integer { v1(0) } (v1,...),
+     *   subject             Name,
+     *   subjectPKInfo   SubjectPublicKeyInfo{{ PKInfoAlgorithms }},
+     *   attributes          [0] Attributes{{ CRIAttributes }}
+     *  }
+     *
+     *  Attributes { ATTRIBUTE:IOSet } ::= Set OF Attr{{ IOSet }}
+     *
+     *  Attr { ATTRIBUTE:IOSet } ::= Sequence {
+     *    type    ATTRIBUTE.&id({IOSet}),
+     *    values  Set SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type})
+     *  }
+     * 
+ */ + public class CertificationRequestInfo + : Asn1Encodable + { + internal DerInteger version = new DerInteger(0); + internal X509Name subject; + internal SubjectPublicKeyInfo subjectPKInfo; + internal Asn1Set attributes; + + public static CertificationRequestInfo GetInstance(object obj) + { + if (obj is CertificationRequestInfo) + return (CertificationRequestInfo)obj; + if (obj != null) + return new CertificationRequestInfo(Asn1Sequence.GetInstance(obj)); + return null; + } + + public CertificationRequestInfo( + X509Name subject, + SubjectPublicKeyInfo pkInfo, + Asn1Set attributes) + { + this.subject = subject; + this.subjectPKInfo = pkInfo; + this.attributes = attributes; + + ValidateAttributes(attributes); + + if (subject == null || version == null || subjectPKInfo == null) + { + throw new ArgumentException( + "Not all mandatory fields set in CertificationRequestInfo generator."); + } + } + + private CertificationRequestInfo( + Asn1Sequence seq) + { + version = (DerInteger) seq[0]; + + subject = X509Name.GetInstance(seq[1]); + subjectPKInfo = SubjectPublicKeyInfo.GetInstance(seq[2]); + + // + // some CertificationRequestInfo objects seem to treat this field + // as optional. + // + if (seq.Count > 3) + { + DerTaggedObject tagobj = (DerTaggedObject) seq[3]; + attributes = Asn1Set.GetInstance(tagobj, false); + } + + ValidateAttributes(attributes); + + if (subject == null || version == null || subjectPKInfo == null) + { + throw new ArgumentException( + "Not all mandatory fields set in CertificationRequestInfo generator."); + } + } + + public DerInteger Version + { + get { return version; } + } + + public X509Name Subject + { + get { return subject; } + } + + public SubjectPublicKeyInfo SubjectPublicKeyInfo + { + get { return subjectPKInfo; } + } + + public Asn1Set Attributes + { + get { return attributes; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + version, subject, subjectPKInfo); + + if (attributes != null) + { + v.Add(new DerTaggedObject(false, 0, attributes)); + } + + return new DerSequence(v); + } + + private static void ValidateAttributes(Asn1Set attributes) + { + if (attributes == null) + return; + + foreach (Asn1Encodable ae in attributes) + { + Asn1Object obj = ae.ToAsn1Object(); + AttributePkcs attr = AttributePkcs.GetInstance(obj); + if (attr.AttrType.Equals(PkcsObjectIdentifiers.Pkcs9AtChallengePassword)) + { + if (attr.AttrValues.Count != 1) + throw new ArgumentException("challengePassword attribute must have one value"); + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequestInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequestInfo.cs.meta new file mode 100644 index 00000000..318d0366 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/CertificationRequestInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e133ac9ba64dd0644824dab07bb829c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/ContentInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/ContentInfo.cs new file mode 100644 index 00000000..e958b3f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/ContentInfo.cs @@ -0,0 +1,78 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class ContentInfo + : Asn1Encodable + { + private readonly DerObjectIdentifier contentType; + private readonly Asn1Encodable content; + + public static ContentInfo GetInstance(object obj) + { + if (obj == null) + return null; + ContentInfo existing = obj as ContentInfo; + if (existing != null) + return existing; + return new ContentInfo(Asn1Sequence.GetInstance(obj)); + } + + private ContentInfo( + Asn1Sequence seq) + { + contentType = (DerObjectIdentifier) seq[0]; + + if (seq.Count > 1) + { + content = ((Asn1TaggedObject) seq[1]).GetObject(); + } + } + + public ContentInfo( + DerObjectIdentifier contentType, + Asn1Encodable content) + { + this.contentType = contentType; + this.content = content; + } + + public DerObjectIdentifier ContentType + { + get { return contentType; } + } + + public Asn1Encodable Content + { + get { return content; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * ContentInfo ::= Sequence {
+         *          contentType ContentType,
+         *          content
+         *          [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(contentType); + + if (content != null) + { + v.Add(new BerTaggedObject(0, content)); + } + + return new BerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/ContentInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/ContentInfo.cs.meta new file mode 100644 index 00000000..f2e3dac3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/ContentInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5322ed3a7bcf61c4cbb3a9aec4ec97cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/DHParameter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/DHParameter.cs new file mode 100644 index 00000000..27c6aae7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/DHParameter.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class DHParameter + : Asn1Encodable + { + internal DerInteger p, g, l; + + public DHParameter( + BigInteger p, + BigInteger g, + int l) + { + this.p = new DerInteger(p); + this.g = new DerInteger(g); + + if (l != 0) + { + this.l = new DerInteger(l); + } + } + + public DHParameter( + Asn1Sequence seq) + { + IEnumerator e = seq.GetEnumerator(); + + e.MoveNext(); + p = (DerInteger)e.Current; + + e.MoveNext(); + g = (DerInteger)e.Current; + + if (e.MoveNext()) + { + l = (DerInteger) e.Current; + } + } + + public BigInteger P + { + get { return p.PositiveValue; } + } + + public BigInteger G + { + get { return g.PositiveValue; } + } + + public BigInteger L + { + get { return l == null ? null : l.PositiveValue; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(p, g); + + if (this.l != null) + { + v.Add(l); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/DHParameter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/DHParameter.cs.meta new file mode 100644 index 00000000..8a311347 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/DHParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67e3f053ff4865548b157255d290ff7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedData.cs new file mode 100644 index 00000000..b216dba2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedData.cs @@ -0,0 +1,109 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + /** + * The EncryptedData object. + *
+     *      EncryptedData ::= Sequence {
+     *           version Version,
+     *           encryptedContentInfo EncryptedContentInfo
+     *      }
+     *
+     *
+     *      EncryptedContentInfo ::= Sequence {
+     *          contentType ContentType,
+     *          contentEncryptionAlgorithm  ContentEncryptionAlgorithmIdentifier,
+     *          encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
+     *    }
+     *
+     *    EncryptedContent ::= OCTET STRING
+     * 
+ */ + public class EncryptedData + : Asn1Encodable + { + private readonly Asn1Sequence data; +// private readonly DerObjectIdentifier bagId; +// private readonly Asn1Object bagValue; + + public static EncryptedData GetInstance( + object obj) + { + if (obj is EncryptedData) + { + return (EncryptedData) obj; + } + + if (obj is Asn1Sequence) + { + return new EncryptedData((Asn1Sequence) obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private EncryptedData( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + int version = ((DerInteger) seq[0]).Value.IntValue; + if (version != 0) + { + throw new ArgumentException("sequence not version 0"); + } + + this.data = (Asn1Sequence) seq[1]; + } + + public EncryptedData( + DerObjectIdentifier contentType, + AlgorithmIdentifier encryptionAlgorithm, + Asn1Encodable content) + { + data = new BerSequence( + contentType, + encryptionAlgorithm.ToAsn1Object(), + new BerTaggedObject(false, 0, content)); + } + + public DerObjectIdentifier ContentType + { + get { return (DerObjectIdentifier) data[0]; } + } + + public AlgorithmIdentifier EncryptionAlgorithm + { + get { return AlgorithmIdentifier.GetInstance(data[1]); } + } + + public Asn1OctetString Content + { + get + { + if (data.Count == 3) + { + DerTaggedObject o = (DerTaggedObject) data[2]; + + return Asn1OctetString.GetInstance(o, false); + } + + return null; + } + } + + public override Asn1Object ToAsn1Object() + { + return new BerSequence(new DerInteger(0), data); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedData.cs.meta new file mode 100644 index 00000000..2336358d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e5a5e27478cb2e4ca76eab1c04d9d47 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedPrivateKeyInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedPrivateKeyInfo.cs new file mode 100644 index 00000000..cf08d469 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedPrivateKeyInfo.cs @@ -0,0 +1,83 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class EncryptedPrivateKeyInfo + : Asn1Encodable + { + private readonly AlgorithmIdentifier algId; + private readonly Asn1OctetString data; + + private EncryptedPrivateKeyInfo( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + algId = AlgorithmIdentifier.GetInstance(seq[0]); + data = Asn1OctetString.GetInstance(seq[1]); + } + + public EncryptedPrivateKeyInfo( + AlgorithmIdentifier algId, + byte[] encoding) + { + this.algId = algId; + this.data = new DerOctetString(encoding); + } + + public static EncryptedPrivateKeyInfo GetInstance( + object obj) + { + if (obj is EncryptedPrivateKeyInfo) + { + return (EncryptedPrivateKeyInfo) obj; + } + + if (obj is Asn1Sequence) + { + return new EncryptedPrivateKeyInfo((Asn1Sequence) obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public AlgorithmIdentifier EncryptionAlgorithm + { + get { return algId; } + } + + public byte[] GetEncryptedData() + { + return data.GetOctets(); + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * EncryptedPrivateKeyInfo ::= Sequence {
+         *      encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
+         *      encryptedData EncryptedData
+         * }
+         *
+         * EncryptedData ::= OCTET STRING
+         *
+         * KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= {
+         *          ... -- For local profiles
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(algId, data); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedPrivateKeyInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedPrivateKeyInfo.cs.meta new file mode 100644 index 00000000..1ab8cab7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptedPrivateKeyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: af5c877a9b9cdf1459c179e82b8524a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptionScheme.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptionScheme.cs new file mode 100644 index 00000000..1350d4fb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptionScheme.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class EncryptionScheme + : AlgorithmIdentifier + { + public EncryptionScheme( + DerObjectIdentifier objectID) + : base(objectID) + { + } + + public EncryptionScheme( + DerObjectIdentifier objectID, + Asn1Encodable parameters) + : base(objectID, parameters) + { + } + + internal EncryptionScheme( + Asn1Sequence seq) + : this((DerObjectIdentifier)seq[0], seq[1]) + { + } + + public new static EncryptionScheme GetInstance(object obj) + { + if (obj is EncryptionScheme) + { + return (EncryptionScheme)obj; + } + + if (obj is Asn1Sequence) + { + return new EncryptionScheme((Asn1Sequence)obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public Asn1Object Asn1Object + { + get { return Parameters.ToAsn1Object(); } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(Algorithm, Parameters); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptionScheme.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptionScheme.cs.meta new file mode 100644 index 00000000..56194898 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/EncryptionScheme.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1be94192fb432444a8f65ef46743b401 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/IssuerAndSerialNumber.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/IssuerAndSerialNumber.cs new file mode 100644 index 00000000..859e457b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/IssuerAndSerialNumber.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class IssuerAndSerialNumber + : Asn1Encodable + { + private readonly X509Name name; + private readonly DerInteger certSerialNumber; + + public static IssuerAndSerialNumber GetInstance( + object obj) + { + if (obj is IssuerAndSerialNumber) + { + return (IssuerAndSerialNumber) obj; + } + + if (obj is Asn1Sequence) + { + return new IssuerAndSerialNumber((Asn1Sequence) obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private IssuerAndSerialNumber( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + this.name = X509Name.GetInstance(seq[0]); + this.certSerialNumber = DerInteger.GetInstance(seq[1]); + } + + public IssuerAndSerialNumber( + X509Name name, + BigInteger certSerialNumber) + { + this.name = name; + this.certSerialNumber = new DerInteger(certSerialNumber); + } + + public IssuerAndSerialNumber( + X509Name name, + DerInteger certSerialNumber) + { + this.name = name; + this.certSerialNumber = certSerialNumber; + } + + public X509Name Name + { + get { return name; } + } + + public DerInteger CertificateSerialNumber + { + get { return certSerialNumber; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(name, certSerialNumber); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/IssuerAndSerialNumber.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/IssuerAndSerialNumber.cs.meta new file mode 100644 index 00000000..d4af237f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/IssuerAndSerialNumber.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 04e4c32bfcc281d43a3839b6418f7c9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/KeyDerivationFunc.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/KeyDerivationFunc.cs new file mode 100644 index 00000000..cc136ec1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/KeyDerivationFunc.cs @@ -0,0 +1,25 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class KeyDerivationFunc + : AlgorithmIdentifier + { + internal KeyDerivationFunc(Asn1Sequence seq) + : base(seq) + { + } + + public KeyDerivationFunc( + DerObjectIdentifier id, + Asn1Encodable parameters) + : base(id, parameters) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/KeyDerivationFunc.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/KeyDerivationFunc.cs.meta new file mode 100644 index 00000000..e0628e20 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/KeyDerivationFunc.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb32edeaaefdcc347a4362febd84a90d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/MacData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/MacData.cs new file mode 100644 index 00000000..5e72c4fb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/MacData.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class MacData + : Asn1Encodable + { + internal DigestInfo digInfo; + internal byte[] salt; + internal BigInteger iterationCount; + + public static MacData GetInstance( + object obj) + { + if (obj is MacData) + { + return (MacData) obj; + } + + if (obj is Asn1Sequence) + { + return new MacData((Asn1Sequence) obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private MacData( + Asn1Sequence seq) + { + this.digInfo = DigestInfo.GetInstance(seq[0]); + this.salt = ((Asn1OctetString) seq[1]).GetOctets(); + + if (seq.Count == 3) + { + this.iterationCount = ((DerInteger) seq[2]).Value; + } + else + { + this.iterationCount = BigInteger.One; + } + } + + public MacData( + DigestInfo digInfo, + byte[] salt, + int iterationCount) + { + this.digInfo = digInfo; + this.salt = (byte[]) salt.Clone(); + this.iterationCount = BigInteger.ValueOf(iterationCount); + } + + public DigestInfo Mac + { + get { return digInfo; } + } + + public byte[] GetSalt() + { + return (byte[]) salt.Clone(); + } + + public BigInteger IterationCount + { + get { return iterationCount; } + } + + /** + *
+		 * MacData ::= SEQUENCE {
+		 *     mac      DigestInfo,
+		 *     macSalt  OCTET STRING,
+		 *     iterations INTEGER DEFAULT 1
+		 *     -- Note: The default is for historic reasons and its use is deprecated. A
+		 *     -- higher value, like 1024 is recommended.
+		 * 
+ * @return the basic DERObject construction. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(digInfo, new DerOctetString(salt)); + + if (!iterationCount.Equals(BigInteger.One)) + { + v.Add(new DerInteger(iterationCount)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/MacData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/MacData.cs.meta new file mode 100644 index 00000000..8de127a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/MacData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9cc5c731aedc89645813d9fe248b448d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBEParameter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBEParameter.cs new file mode 100644 index 00000000..1814c798 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBEParameter.cs @@ -0,0 +1,64 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class PbeParameter + : Asn1Encodable + { + private readonly Asn1OctetString salt; + private readonly DerInteger iterationCount; + + public static PbeParameter GetInstance(object obj) + { + if (obj is PbeParameter || obj == null) + { + return (PbeParameter) obj; + } + + if (obj is Asn1Sequence) + { + return new PbeParameter((Asn1Sequence) obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private PbeParameter(Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + salt = Asn1OctetString.GetInstance(seq[0]); + iterationCount = DerInteger.GetInstance(seq[1]); + } + + public PbeParameter(byte[] salt, int iterationCount) + { + this.salt = new DerOctetString(salt); + this.iterationCount = new DerInteger(iterationCount); + } + + public byte[] GetSalt() + { + return salt.GetOctets(); + } + + public BigInteger IterationCount + { + get { return iterationCount.Value; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(salt, iterationCount); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBEParameter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBEParameter.cs.meta new file mode 100644 index 00000000..47d8d868 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBEParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2905fb1449d42a488e211b8d8d0ab97 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBES2Parameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBES2Parameters.cs new file mode 100644 index 00000000..23367382 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBES2Parameters.cs @@ -0,0 +1,69 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class PbeS2Parameters + : Asn1Encodable + { + private readonly KeyDerivationFunc func; + private readonly EncryptionScheme scheme; + + public static PbeS2Parameters GetInstance(object obj) + { + if (obj == null) + return null; + PbeS2Parameters existing = obj as PbeS2Parameters; + if (existing != null) + return existing; + return new PbeS2Parameters(Asn1Sequence.GetInstance(obj)); + } + + public PbeS2Parameters(KeyDerivationFunc keyDevFunc, EncryptionScheme encScheme) + { + this.func = keyDevFunc; + this.scheme = encScheme; + } + + [Obsolete("Use GetInstance() instead")] + public PbeS2Parameters( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + Asn1Sequence funcSeq = (Asn1Sequence)seq[0].ToAsn1Object(); + + // TODO Not sure if this special case is really necessary/appropriate + if (funcSeq[0].Equals(PkcsObjectIdentifiers.IdPbkdf2)) + { + func = new KeyDerivationFunc(PkcsObjectIdentifiers.IdPbkdf2, + Pbkdf2Params.GetInstance(funcSeq[1])); + } + else + { + func = new KeyDerivationFunc(funcSeq); + } + + scheme = EncryptionScheme.GetInstance(seq[1].ToAsn1Object()); + } + + public KeyDerivationFunc KeyDerivationFunc + { + get { return func; } + } + + public EncryptionScheme EncryptionScheme + { + get { return scheme; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(func, scheme); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBES2Parameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBES2Parameters.cs.meta new file mode 100644 index 00000000..24947f22 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBES2Parameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb3fc7932c18ad24bb197cf87989240d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBKDF2Params.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBKDF2Params.cs new file mode 100644 index 00000000..4f27a1a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBKDF2Params.cs @@ -0,0 +1,148 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class Pbkdf2Params + : Asn1Encodable + { + private static AlgorithmIdentifier algid_hmacWithSHA1 = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdHmacWithSha1, DerNull.Instance); + + private readonly Asn1OctetString octStr; + private readonly DerInteger iterationCount, keyLength; + private readonly AlgorithmIdentifier prf; + + public static Pbkdf2Params GetInstance( + object obj) + { + if (obj == null || obj is Pbkdf2Params) + return (Pbkdf2Params)obj; + + if (obj is Asn1Sequence) + return new Pbkdf2Params((Asn1Sequence)obj); + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public Pbkdf2Params( + Asn1Sequence seq) + { + if (seq.Count < 2 || seq.Count > 4) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + this.octStr = (Asn1OctetString)seq[0]; + this.iterationCount = (DerInteger)seq[1]; + + Asn1Encodable kl = null, d = null; + if (seq.Count > 3) + { + kl = seq[2]; + d = seq[3]; + } + else if (seq.Count > 2) + { + if (seq[2] is DerInteger) + { + kl = seq[2]; + } + else + { + d = seq[2]; + } + } + if (kl != null) + { + keyLength = (DerInteger)kl; + } + if (d != null) + { + prf = AlgorithmIdentifier.GetInstance(d); + } + } + + public Pbkdf2Params( + byte[] salt, + int iterationCount) + { + this.octStr = new DerOctetString(salt); + this.iterationCount = new DerInteger(iterationCount); + } + + public Pbkdf2Params( + byte[] salt, + int iterationCount, + int keyLength) + : this(salt, iterationCount) + { + this.keyLength = new DerInteger(keyLength); + } + + public Pbkdf2Params( + byte[] salt, + int iterationCount, + int keyLength, + AlgorithmIdentifier prf) + : this(salt, iterationCount, keyLength) + { + this.prf = prf; + } + + public Pbkdf2Params( + byte[] salt, + int iterationCount, + AlgorithmIdentifier prf) + : this(salt, iterationCount) + { + this.prf = prf; + } + + public byte[] GetSalt() + { + return octStr.GetOctets(); + } + + public BigInteger IterationCount + { + get { return iterationCount.Value; } + } + + public BigInteger KeyLength + { + get { return keyLength == null ? null : keyLength.Value; } + } + + public bool IsDefaultPrf + { + get { return prf == null || prf.Equals(algid_hmacWithSHA1); } + } + + public AlgorithmIdentifier Prf + { + get { return prf != null ? prf : algid_hmacWithSHA1; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + octStr, iterationCount); + + if (keyLength != null) + { + v.Add(keyLength); + } + if (!IsDefaultPrf) + { + v.Add(prf); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBKDF2Params.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBKDF2Params.cs.meta new file mode 100644 index 00000000..1d5d3048 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PBKDF2Params.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ec42b2b8cbb37f4b99b10df913c771d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCS12PBEParams.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCS12PBEParams.cs new file mode 100644 index 00000000..6a0201a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCS12PBEParams.cs @@ -0,0 +1,67 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class Pkcs12PbeParams + : Asn1Encodable + { + private readonly DerInteger iterations; + private readonly Asn1OctetString iv; + + public Pkcs12PbeParams( + byte[] salt, + int iterations) + { + this.iv = new DerOctetString(salt); + this.iterations = new DerInteger(iterations); + } + + private Pkcs12PbeParams( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + iv = Asn1OctetString.GetInstance(seq[0]); + iterations = DerInteger.GetInstance(seq[1]); + } + + public static Pkcs12PbeParams GetInstance( + object obj) + { + if (obj is Pkcs12PbeParams) + { + return (Pkcs12PbeParams) obj; + } + + if (obj is Asn1Sequence) + { + return new Pkcs12PbeParams((Asn1Sequence) obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public BigInteger Iterations + { + get { return iterations.Value; } + } + + public byte[] GetIV() + { + return iv.GetOctets(); + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(iv, iterations); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCS12PBEParams.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCS12PBEParams.cs.meta new file mode 100644 index 00000000..3d6a5fee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCS12PBEParams.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd66e6bf80ac29d439006d4145a1f961 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCSObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCSObjectIdentifiers.cs new file mode 100644 index 00000000..15e8278e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCSObjectIdentifiers.cs @@ -0,0 +1,297 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public abstract class PkcsObjectIdentifiers + { + // + // pkcs-1 OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 } + // + public const string Pkcs1 = "1.2.840.113549.1.1"; + internal static readonly DerObjectIdentifier Pkcs1Oid = new DerObjectIdentifier(Pkcs1); + + public static readonly DerObjectIdentifier RsaEncryption = Pkcs1Oid.Branch("1"); + public static readonly DerObjectIdentifier MD2WithRsaEncryption = Pkcs1Oid.Branch("2"); + public static readonly DerObjectIdentifier MD4WithRsaEncryption = Pkcs1Oid.Branch("3"); + public static readonly DerObjectIdentifier MD5WithRsaEncryption = Pkcs1Oid.Branch("4"); + public static readonly DerObjectIdentifier Sha1WithRsaEncryption = Pkcs1Oid.Branch("5"); + public static readonly DerObjectIdentifier SrsaOaepEncryptionSet = Pkcs1Oid.Branch("6"); + public static readonly DerObjectIdentifier IdRsaesOaep = Pkcs1Oid.Branch("7"); + public static readonly DerObjectIdentifier IdMgf1 = Pkcs1Oid.Branch("8"); + public static readonly DerObjectIdentifier IdPSpecified = Pkcs1Oid.Branch("9"); + public static readonly DerObjectIdentifier IdRsassaPss = Pkcs1Oid.Branch("10"); + public static readonly DerObjectIdentifier Sha256WithRsaEncryption = Pkcs1Oid.Branch("11"); + public static readonly DerObjectIdentifier Sha384WithRsaEncryption = Pkcs1Oid.Branch("12"); + public static readonly DerObjectIdentifier Sha512WithRsaEncryption = Pkcs1Oid.Branch("13"); + public static readonly DerObjectIdentifier Sha224WithRsaEncryption = Pkcs1Oid.Branch("14"); + /** PKCS#1: 1.2.840.113549.1.1.15 */ + public static readonly DerObjectIdentifier Sha512_224WithRSAEncryption = Pkcs1Oid.Branch("15"); + /** PKCS#1: 1.2.840.113549.1.1.16 */ + public static readonly DerObjectIdentifier Sha512_256WithRSAEncryption = Pkcs1Oid.Branch("16"); + + // + // pkcs-3 OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 3 } + // + public const string Pkcs3 = "1.2.840.113549.1.3"; + + public static readonly DerObjectIdentifier DhKeyAgreement = new DerObjectIdentifier(Pkcs3 + ".1"); + + // + // pkcs-5 OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 5 } + // + public const string Pkcs5 = "1.2.840.113549.1.5"; + + public static readonly DerObjectIdentifier PbeWithMD2AndDesCbc = new DerObjectIdentifier(Pkcs5 + ".1"); + public static readonly DerObjectIdentifier PbeWithMD2AndRC2Cbc = new DerObjectIdentifier(Pkcs5 + ".4"); + public static readonly DerObjectIdentifier PbeWithMD5AndDesCbc = new DerObjectIdentifier(Pkcs5 + ".3"); + public static readonly DerObjectIdentifier PbeWithMD5AndRC2Cbc = new DerObjectIdentifier(Pkcs5 + ".6"); + public static readonly DerObjectIdentifier PbeWithSha1AndDesCbc = new DerObjectIdentifier(Pkcs5 + ".10"); + public static readonly DerObjectIdentifier PbeWithSha1AndRC2Cbc = new DerObjectIdentifier(Pkcs5 + ".11"); + + public static readonly DerObjectIdentifier IdPbeS2 = new DerObjectIdentifier(Pkcs5 + ".13"); + public static readonly DerObjectIdentifier IdPbkdf2 = new DerObjectIdentifier(Pkcs5 + ".12"); + + // + // encryptionAlgorithm OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) rsadsi(113549) 3 } + // + public const string EncryptionAlgorithm = "1.2.840.113549.3"; + + public static readonly DerObjectIdentifier DesEde3Cbc = new DerObjectIdentifier(EncryptionAlgorithm + ".7"); + public static readonly DerObjectIdentifier RC2Cbc = new DerObjectIdentifier(EncryptionAlgorithm + ".2"); + + // + // object identifiers for digests + // + public const string DigestAlgorithm = "1.2.840.113549.2"; + + // + // md2 OBJECT IDENTIFIER ::= + // {iso(1) member-body(2) US(840) rsadsi(113549) DigestAlgorithm(2) 2} + // + public static readonly DerObjectIdentifier MD2 = new DerObjectIdentifier(DigestAlgorithm + ".2"); + + // + // md4 OBJECT IDENTIFIER ::= + // {iso(1) member-body(2) US(840) rsadsi(113549) DigestAlgorithm(2) 4} + // + public static readonly DerObjectIdentifier MD4 = new DerObjectIdentifier(DigestAlgorithm + ".4"); + + // + // md5 OBJECT IDENTIFIER ::= + // {iso(1) member-body(2) US(840) rsadsi(113549) DigestAlgorithm(2) 5} + // + public static readonly DerObjectIdentifier MD5 = new DerObjectIdentifier(DigestAlgorithm + ".5"); + + public static readonly DerObjectIdentifier IdHmacWithSha1 = new DerObjectIdentifier(DigestAlgorithm + ".7"); + public static readonly DerObjectIdentifier IdHmacWithSha224 = new DerObjectIdentifier(DigestAlgorithm + ".8"); + public static readonly DerObjectIdentifier IdHmacWithSha256 = new DerObjectIdentifier(DigestAlgorithm + ".9"); + public static readonly DerObjectIdentifier IdHmacWithSha384 = new DerObjectIdentifier(DigestAlgorithm + ".10"); + public static readonly DerObjectIdentifier IdHmacWithSha512 = new DerObjectIdentifier(DigestAlgorithm + ".11"); + + // + // pkcs-7 OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 7 } + // + public const string Pkcs7 = "1.2.840.113549.1.7"; + + public static readonly DerObjectIdentifier Data = new DerObjectIdentifier(Pkcs7 + ".1"); + public static readonly DerObjectIdentifier SignedData = new DerObjectIdentifier(Pkcs7 + ".2"); + public static readonly DerObjectIdentifier EnvelopedData = new DerObjectIdentifier(Pkcs7 + ".3"); + public static readonly DerObjectIdentifier SignedAndEnvelopedData = new DerObjectIdentifier(Pkcs7 + ".4"); + public static readonly DerObjectIdentifier DigestedData = new DerObjectIdentifier(Pkcs7 + ".5"); + public static readonly DerObjectIdentifier EncryptedData = new DerObjectIdentifier(Pkcs7 + ".6"); + + // + // pkcs-9 OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 } + // + public const string Pkcs9 = "1.2.840.113549.1.9"; + + public static readonly DerObjectIdentifier Pkcs9AtEmailAddress = new DerObjectIdentifier(Pkcs9 + ".1"); + public static readonly DerObjectIdentifier Pkcs9AtUnstructuredName = new DerObjectIdentifier(Pkcs9 + ".2"); + public static readonly DerObjectIdentifier Pkcs9AtContentType = new DerObjectIdentifier(Pkcs9 + ".3"); + public static readonly DerObjectIdentifier Pkcs9AtMessageDigest = new DerObjectIdentifier(Pkcs9 + ".4"); + public static readonly DerObjectIdentifier Pkcs9AtSigningTime = new DerObjectIdentifier(Pkcs9 + ".5"); + public static readonly DerObjectIdentifier Pkcs9AtCounterSignature = new DerObjectIdentifier(Pkcs9 + ".6"); + public static readonly DerObjectIdentifier Pkcs9AtChallengePassword = new DerObjectIdentifier(Pkcs9 + ".7"); + public static readonly DerObjectIdentifier Pkcs9AtUnstructuredAddress = new DerObjectIdentifier(Pkcs9 + ".8"); + public static readonly DerObjectIdentifier Pkcs9AtExtendedCertificateAttributes = new DerObjectIdentifier(Pkcs9 + ".9"); + public static readonly DerObjectIdentifier Pkcs9AtSigningDescription = new DerObjectIdentifier(Pkcs9 + ".13"); + public static readonly DerObjectIdentifier Pkcs9AtExtensionRequest = new DerObjectIdentifier(Pkcs9 + ".14"); + public static readonly DerObjectIdentifier Pkcs9AtSmimeCapabilities = new DerObjectIdentifier(Pkcs9 + ".15"); + public static readonly DerObjectIdentifier IdSmime = new DerObjectIdentifier(Pkcs9 + ".16"); + + public static readonly DerObjectIdentifier Pkcs9AtFriendlyName = new DerObjectIdentifier(Pkcs9 + ".20"); + public static readonly DerObjectIdentifier Pkcs9AtLocalKeyID = new DerObjectIdentifier(Pkcs9 + ".21"); + + [Obsolete("Use X509Certificate instead")] + public static readonly DerObjectIdentifier X509CertType = new DerObjectIdentifier(Pkcs9 + ".22.1"); + + public const string CertTypes = Pkcs9 + ".22"; + public static readonly DerObjectIdentifier X509Certificate = new DerObjectIdentifier(CertTypes + ".1"); + public static readonly DerObjectIdentifier SdsiCertificate = new DerObjectIdentifier(CertTypes + ".2"); + + public const string CrlTypes = Pkcs9 + ".23"; + public static readonly DerObjectIdentifier X509Crl = new DerObjectIdentifier(CrlTypes + ".1"); + + public static readonly DerObjectIdentifier IdAlg = IdSmime.Branch("3"); + + public static readonly DerObjectIdentifier IdAlgEsdh = IdAlg.Branch("5"); + public static readonly DerObjectIdentifier IdAlgCms3DesWrap = IdAlg.Branch("6"); + public static readonly DerObjectIdentifier IdAlgCmsRC2Wrap = IdAlg.Branch("7"); + public static readonly DerObjectIdentifier IdAlgPwriKek = IdAlg.Branch("9"); + public static readonly DerObjectIdentifier IdAlgSsdh = IdAlg.Branch("10"); + + /* + *
+         * -- RSA-KEM Key Transport Algorithm
+         *
+         * id-rsa-kem OID ::= {
+         *      iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1)
+         *      pkcs-9(9) smime(16) alg(3) 14
+         *   }
+         * 
+ */ + public static readonly DerObjectIdentifier IdRsaKem = IdAlg.Branch("14"); + + // + // SMIME capability sub oids. + // + public static readonly DerObjectIdentifier PreferSignedData = Pkcs9AtSmimeCapabilities.Branch("1"); + public static readonly DerObjectIdentifier CannotDecryptAny = Pkcs9AtSmimeCapabilities.Branch("2"); + public static readonly DerObjectIdentifier SmimeCapabilitiesVersions = Pkcs9AtSmimeCapabilities.Branch("3"); + + // + // other SMIME attributes + // + public static readonly DerObjectIdentifier IdAAReceiptRequest = IdSmime.Branch("2.1"); + + // + // id-ct OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) + // rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) ct(1)} + // + public const string IdCT = "1.2.840.113549.1.9.16.1"; + + public static readonly DerObjectIdentifier IdCTAuthData = new DerObjectIdentifier(IdCT + ".2"); + public static readonly DerObjectIdentifier IdCTTstInfo = new DerObjectIdentifier(IdCT + ".4"); + public static readonly DerObjectIdentifier IdCTCompressedData = new DerObjectIdentifier(IdCT + ".9"); + public static readonly DerObjectIdentifier IdCTAuthEnvelopedData = new DerObjectIdentifier(IdCT + ".23"); + public static readonly DerObjectIdentifier IdCTTimestampedData = new DerObjectIdentifier(IdCT + ".31"); + + // + // id-cti OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) + // rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) cti(6)} + // + public const string IdCti = "1.2.840.113549.1.9.16.6"; + + public static readonly DerObjectIdentifier IdCtiEtsProofOfOrigin = new DerObjectIdentifier(IdCti + ".1"); + public static readonly DerObjectIdentifier IdCtiEtsProofOfReceipt = new DerObjectIdentifier(IdCti + ".2"); + public static readonly DerObjectIdentifier IdCtiEtsProofOfDelivery = new DerObjectIdentifier(IdCti + ".3"); + public static readonly DerObjectIdentifier IdCtiEtsProofOfSender = new DerObjectIdentifier(IdCti + ".4"); + public static readonly DerObjectIdentifier IdCtiEtsProofOfApproval = new DerObjectIdentifier(IdCti + ".5"); + public static readonly DerObjectIdentifier IdCtiEtsProofOfCreation = new DerObjectIdentifier(IdCti + ".6"); + + // + // id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) + // rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) attributes(2)} + // + public const string IdAA = "1.2.840.113549.1.9.16.2"; + public static readonly DerObjectIdentifier IdAAOid = new DerObjectIdentifier(IdAA); + + public static readonly DerObjectIdentifier IdAAContentHint = new DerObjectIdentifier(IdAA + ".4"); // See RFC 2634 + public static readonly DerObjectIdentifier IdAAMsgSigDigest = new DerObjectIdentifier(IdAA + ".5"); + public static readonly DerObjectIdentifier IdAAContentReference = new DerObjectIdentifier(IdAA + ".10"); + + /* + * id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11} + * + */ + public static readonly DerObjectIdentifier IdAAEncrypKeyPref = new DerObjectIdentifier(IdAA + ".11"); + public static readonly DerObjectIdentifier IdAASigningCertificate = new DerObjectIdentifier(IdAA + ".12"); + public static readonly DerObjectIdentifier IdAASigningCertificateV2 = new DerObjectIdentifier(IdAA + ".47"); + + public static readonly DerObjectIdentifier IdAAContentIdentifier = new DerObjectIdentifier(IdAA + ".7"); // See RFC 2634 + + /* + * RFC 3126 + */ + public static readonly DerObjectIdentifier IdAASignatureTimeStampToken = new DerObjectIdentifier(IdAA + ".14"); + + public static readonly DerObjectIdentifier IdAAEtsSigPolicyID = new DerObjectIdentifier(IdAA + ".15"); + public static readonly DerObjectIdentifier IdAAEtsCommitmentType = new DerObjectIdentifier(IdAA + ".16"); + public static readonly DerObjectIdentifier IdAAEtsSignerLocation = new DerObjectIdentifier(IdAA + ".17"); + public static readonly DerObjectIdentifier IdAAEtsSignerAttr = new DerObjectIdentifier(IdAA + ".18"); + public static readonly DerObjectIdentifier IdAAEtsOtherSigCert = new DerObjectIdentifier(IdAA + ".19"); + public static readonly DerObjectIdentifier IdAAEtsContentTimestamp = new DerObjectIdentifier(IdAA + ".20"); + public static readonly DerObjectIdentifier IdAAEtsCertificateRefs = new DerObjectIdentifier(IdAA + ".21"); + public static readonly DerObjectIdentifier IdAAEtsRevocationRefs = new DerObjectIdentifier(IdAA + ".22"); + public static readonly DerObjectIdentifier IdAAEtsCertValues = new DerObjectIdentifier(IdAA + ".23"); + public static readonly DerObjectIdentifier IdAAEtsRevocationValues = new DerObjectIdentifier(IdAA + ".24"); + public static readonly DerObjectIdentifier IdAAEtsEscTimeStamp = new DerObjectIdentifier(IdAA + ".25"); + public static readonly DerObjectIdentifier IdAAEtsCertCrlTimestamp = new DerObjectIdentifier(IdAA + ".26"); + public static readonly DerObjectIdentifier IdAAEtsArchiveTimestamp = new DerObjectIdentifier(IdAA + ".27"); + + /** PKCS#9: 1.2.840.113549.1.9.16.2.37 - RFC 4108 */ + public static readonly DerObjectIdentifier IdAADecryptKeyID = IdAAOid.Branch("37"); + + /** PKCS#9: 1.2.840.113549.1.9.16.2.38 - RFC 4108 */ + public static readonly DerObjectIdentifier IdAAImplCryptoAlgs = IdAAOid.Branch("38"); + + /** PKCS#9: 1.2.840.113549.1.9.16.2.54 RFC7030*/ + public static readonly DerObjectIdentifier IdAAAsymmDecryptKeyID = IdAAOid.Branch("54"); + + /** PKCS#9: 1.2.840.113549.1.9.16.2.43 RFC7030*/ + public static readonly DerObjectIdentifier IdAAImplCompressAlgs = IdAAOid.Branch("43"); + /** PKCS#9: 1.2.840.113549.1.9.16.2.40 RFC7030*/ + public static readonly DerObjectIdentifier IdAACommunityIdentifiers = IdAAOid.Branch("40"); + + [Obsolete("Use 'IdAAEtsSigPolicyID' instead")] + public static readonly DerObjectIdentifier IdAASigPolicyID = IdAAEtsSigPolicyID; + [Obsolete("Use 'IdAAEtsCommitmentType' instead")] + public static readonly DerObjectIdentifier IdAACommitmentType = IdAAEtsCommitmentType; + [Obsolete("Use 'IdAAEtsSignerLocation' instead")] + public static readonly DerObjectIdentifier IdAASignerLocation = IdAAEtsSignerLocation; + [Obsolete("Use 'IdAAEtsOtherSigCert' instead")] + public static readonly DerObjectIdentifier IdAAOtherSigCert = IdAAEtsOtherSigCert; + + // + // id-spq OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) + // rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) id-spq(5)} + // + public const string IdSpq = "1.2.840.113549.1.9.16.5"; + + public static readonly DerObjectIdentifier IdSpqEtsUri = new DerObjectIdentifier(IdSpq + ".1"); + public static readonly DerObjectIdentifier IdSpqEtsUNotice = new DerObjectIdentifier(IdSpq + ".2"); + + // + // pkcs-12 OBJECT IDENTIFIER ::= { + // iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 12 } + // + public const string Pkcs12 = "1.2.840.113549.1.12"; + public const string BagTypes = Pkcs12 + ".10.1"; + + public static readonly DerObjectIdentifier KeyBag = new DerObjectIdentifier(BagTypes + ".1"); + public static readonly DerObjectIdentifier Pkcs8ShroudedKeyBag = new DerObjectIdentifier(BagTypes + ".2"); + public static readonly DerObjectIdentifier CertBag = new DerObjectIdentifier(BagTypes + ".3"); + public static readonly DerObjectIdentifier CrlBag = new DerObjectIdentifier(BagTypes + ".4"); + public static readonly DerObjectIdentifier SecretBag = new DerObjectIdentifier(BagTypes + ".5"); + public static readonly DerObjectIdentifier SafeContentsBag = new DerObjectIdentifier(BagTypes + ".6"); + + public const string Pkcs12PbeIds = Pkcs12 + ".1"; + + public static readonly DerObjectIdentifier PbeWithShaAnd128BitRC4 = new DerObjectIdentifier(Pkcs12PbeIds + ".1"); + public static readonly DerObjectIdentifier PbeWithShaAnd40BitRC4 = new DerObjectIdentifier(Pkcs12PbeIds + ".2"); + public static readonly DerObjectIdentifier PbeWithShaAnd3KeyTripleDesCbc = new DerObjectIdentifier(Pkcs12PbeIds + ".3"); + public static readonly DerObjectIdentifier PbeWithShaAnd2KeyTripleDesCbc = new DerObjectIdentifier(Pkcs12PbeIds + ".4"); + public static readonly DerObjectIdentifier PbeWithShaAnd128BitRC2Cbc = new DerObjectIdentifier(Pkcs12PbeIds + ".5"); + public static readonly DerObjectIdentifier PbewithShaAnd40BitRC2Cbc = new DerObjectIdentifier(Pkcs12PbeIds + ".6"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCSObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCSObjectIdentifiers.cs.meta new file mode 100644 index 00000000..0778611a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PKCSObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00c35305dafe0c74eb19e23e1f3f8cb1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Pfx.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Pfx.cs new file mode 100644 index 00000000..97b3032b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Pfx.cs @@ -0,0 +1,69 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + /** + * the infamous Pfx from Pkcs12 + */ + public class Pfx + : Asn1Encodable + { + private ContentInfo contentInfo; + private MacData macData; + + public Pfx( + Asn1Sequence seq) + { + BigInteger version = ((DerInteger) seq[0]).Value; + if (version.IntValue != 3) + { + throw new ArgumentException("wrong version for PFX PDU"); + } + + contentInfo = ContentInfo.GetInstance(seq[1]); + + if (seq.Count == 3) + { + macData = MacData.GetInstance(seq[2]); + } + } + + public Pfx( + ContentInfo contentInfo, + MacData macData) + { + this.contentInfo = contentInfo; + this.macData = macData; + } + + public ContentInfo AuthSafe + { + get { return contentInfo; } + } + + public MacData MacData + { + get { return macData; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + new DerInteger(3), contentInfo); + + if (macData != null) + { + v.Add(macData); + } + + return new BerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Pfx.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Pfx.cs.meta new file mode 100644 index 00000000..ffd87e53 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/Pfx.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3df657f0f5dc2e84eaa5506d529f5d72 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PrivateKeyInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PrivateKeyInfo.cs new file mode 100644 index 00000000..09f2f668 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PrivateKeyInfo.cs @@ -0,0 +1,208 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + /** + * RFC 5958 + * + *
+     *  [IMPLICIT TAGS]
+     *
+     *  OneAsymmetricKey ::= SEQUENCE {
+     *      version                   Version,
+     *      privateKeyAlgorithm       PrivateKeyAlgorithmIdentifier,
+     *      privateKey                PrivateKey,
+     *      attributes            [0] Attributes OPTIONAL,
+     *      ...,
+     *      [[2: publicKey        [1] PublicKey OPTIONAL ]],
+     *      ...
+     *  }
+     *
+     *  PrivateKeyInfo ::= OneAsymmetricKey
+     *
+     *  Version ::= INTEGER { v1(0), v2(1) } (v1, ..., v2)
+     *
+     *  PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
+     *                                     { PUBLIC-KEY,
+     *                                       { PrivateKeyAlgorithms } }
+     *
+     *  PrivateKey ::= OCTET STRING
+     *                     -- Content varies based on type of key.  The
+     *                     -- algorithm identifier dictates the format of
+     *                     -- the key.
+     *
+     *  PublicKey ::= BIT STRING
+     *                     -- Content varies based on type of key.  The
+     *                     -- algorithm identifier dictates the format of
+     *                     -- the key.
+     *
+     *  Attributes ::= SET OF Attribute { { OneAsymmetricKeyAttributes } }
+     *  
+ */ + public class PrivateKeyInfo + : Asn1Encodable + { + private readonly DerInteger version; + private readonly AlgorithmIdentifier privateKeyAlgorithm; + private readonly Asn1OctetString privateKey; + private readonly Asn1Set attributes; + private readonly DerBitString publicKey; + + public static PrivateKeyInfo GetInstance(Asn1TaggedObject obj, bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static PrivateKeyInfo GetInstance( + object obj) + { + if (obj == null) + return null; + if (obj is PrivateKeyInfo) + return (PrivateKeyInfo)obj; + return new PrivateKeyInfo(Asn1Sequence.GetInstance(obj)); + } + + private static int GetVersionValue(DerInteger version) + { + BigInteger bigValue = version.Value; + if (bigValue.CompareTo(BigInteger.Zero) < 0 || bigValue.CompareTo(BigInteger.One) > 0) + throw new ArgumentException("invalid version for private key info", "version"); + + return bigValue.IntValue; + } + + public PrivateKeyInfo( + AlgorithmIdentifier privateKeyAlgorithm, + Asn1Encodable privateKey) + : this(privateKeyAlgorithm, privateKey, null, null) + { + } + + public PrivateKeyInfo( + AlgorithmIdentifier privateKeyAlgorithm, + Asn1Encodable privateKey, + Asn1Set attributes) + : this(privateKeyAlgorithm, privateKey, attributes, null) + { + } + + public PrivateKeyInfo( + AlgorithmIdentifier privateKeyAlgorithm, + Asn1Encodable privateKey, + Asn1Set attributes, + byte[] publicKey) + { + this.version = new DerInteger(publicKey != null ? BigInteger.One : BigInteger.Zero); + this.privateKeyAlgorithm = privateKeyAlgorithm; + this.privateKey = new DerOctetString(privateKey); + this.attributes = attributes; + this.publicKey = publicKey == null ? null : new DerBitString(publicKey); + } + + private PrivateKeyInfo(Asn1Sequence seq) + { + IEnumerator e = seq.GetEnumerator(); + + this.version = DerInteger.GetInstance(CollectionUtilities.RequireNext(e)); + + int versionValue = GetVersionValue(version); + + this.privateKeyAlgorithm = AlgorithmIdentifier.GetInstance(CollectionUtilities.RequireNext(e)); + this.privateKey = Asn1OctetString.GetInstance(CollectionUtilities.RequireNext(e)); + + int lastTag = -1; + while (e.MoveNext()) + { + Asn1TaggedObject tagged = (Asn1TaggedObject)e.Current; + + int tag = tagged.TagNo; + if (tag <= lastTag) + throw new ArgumentException("invalid optional field in private key info", "seq"); + + lastTag = tag; + + switch (tag) + { + case 0: + { + this.attributes = Asn1Set.GetInstance(tagged, false); + break; + } + case 1: + { + if (versionValue < 1) + throw new ArgumentException("'publicKey' requires version v2(1) or later", "seq"); + + this.publicKey = DerBitString.GetInstance(tagged, false); + break; + } + default: + { + throw new ArgumentException("unknown optional field in private key info", "seq"); + } + } + } + } + + public virtual Asn1Set Attributes + { + get { return attributes; } + } + + /// Return true if a public key is present, false otherwise. + public virtual bool HasPublicKey + { + get { return publicKey != null; } + } + + public virtual AlgorithmIdentifier PrivateKeyAlgorithm + { + get { return privateKeyAlgorithm; } + } + + public virtual Asn1Object ParsePrivateKey() + { + return Asn1Object.FromByteArray(privateKey.GetOctets()); + } + + /// For when the public key is an ASN.1 encoding. + public virtual Asn1Object ParsePublicKey() + { + return publicKey == null ? null : Asn1Object.FromByteArray(publicKey.GetOctets()); + } + + /// Return the public key as a raw bit string. + public virtual DerBitString PublicKeyData + { + get { return publicKey; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(version, privateKeyAlgorithm, privateKey); + + if (attributes != null) + { + v.Add(new DerTaggedObject(false, 0, attributes)); + } + + if (publicKey != null) + { + v.Add(new DerTaggedObject(false, 1, publicKey)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PrivateKeyInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PrivateKeyInfo.cs.meta new file mode 100644 index 00000000..8a4354c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/PrivateKeyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 335bcf7659194c5488f3a96b9d1e3b98 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RC2CBCParameter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RC2CBCParameter.cs new file mode 100644 index 00000000..cc740255 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RC2CBCParameter.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class RC2CbcParameter + : Asn1Encodable + { + internal DerInteger version; + internal Asn1OctetString iv; + + public static RC2CbcParameter GetInstance( + object obj) + { + if (obj is Asn1Sequence) + { + return new RC2CbcParameter((Asn1Sequence) obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public RC2CbcParameter( + byte[] iv) + { + this.iv = new DerOctetString(iv); + } + + public RC2CbcParameter( + int parameterVersion, + byte[] iv) + { + this.version = new DerInteger(parameterVersion); + this.iv = new DerOctetString(iv); + } + + private RC2CbcParameter( + Asn1Sequence seq) + { + if (seq.Count == 1) + { + iv = (Asn1OctetString)seq[0]; + } + else + { + version = (DerInteger)seq[0]; + iv = (Asn1OctetString)seq[1]; + } + } + + public BigInteger RC2ParameterVersion + { + get + { + return version == null ? null : version.Value; + } + } + + public byte[] GetIV() + { + return Arrays.Clone(iv.GetOctets()); + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (version != null) + { + v.Add(version); + } + + v.Add(iv); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RC2CBCParameter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RC2CBCParameter.cs.meta new file mode 100644 index 00000000..62db33f1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RC2CBCParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d2335725ce7a9c4ebe1ae1ee1f328fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAESOAEPparams.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAESOAEPparams.cs new file mode 100644 index 00000000..ab063ddb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAESOAEPparams.cs @@ -0,0 +1,150 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class RsaesOaepParameters + : Asn1Encodable + { + private AlgorithmIdentifier hashAlgorithm; + private AlgorithmIdentifier maskGenAlgorithm; + private AlgorithmIdentifier pSourceAlgorithm; + + public readonly static AlgorithmIdentifier DefaultHashAlgorithm = new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1, DerNull.Instance); + public readonly static AlgorithmIdentifier DefaultMaskGenFunction = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdMgf1, DefaultHashAlgorithm); + public readonly static AlgorithmIdentifier DefaultPSourceAlgorithm = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdPSpecified, new DerOctetString(new byte[0])); + + public static RsaesOaepParameters GetInstance( + object obj) + { + if (obj is RsaesOaepParameters) + { + return (RsaesOaepParameters)obj; + } + else if (obj is Asn1Sequence) + { + return new RsaesOaepParameters((Asn1Sequence)obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * The default version + */ + public RsaesOaepParameters() + { + hashAlgorithm = DefaultHashAlgorithm; + maskGenAlgorithm = DefaultMaskGenFunction; + pSourceAlgorithm = DefaultPSourceAlgorithm; + } + + public RsaesOaepParameters( + AlgorithmIdentifier hashAlgorithm, + AlgorithmIdentifier maskGenAlgorithm, + AlgorithmIdentifier pSourceAlgorithm) + { + this.hashAlgorithm = hashAlgorithm; + this.maskGenAlgorithm = maskGenAlgorithm; + this.pSourceAlgorithm = pSourceAlgorithm; + } + + public RsaesOaepParameters( + Asn1Sequence seq) + { + hashAlgorithm = DefaultHashAlgorithm; + maskGenAlgorithm = DefaultMaskGenFunction; + pSourceAlgorithm = DefaultPSourceAlgorithm; + + for (int i = 0; i != seq.Count; i++) + { + Asn1TaggedObject o = (Asn1TaggedObject)seq[i]; + + switch (o.TagNo) + { + case 0: + hashAlgorithm = AlgorithmIdentifier.GetInstance(o, true); + break; + case 1: + maskGenAlgorithm = AlgorithmIdentifier.GetInstance(o, true); + break; + case 2: + pSourceAlgorithm = AlgorithmIdentifier.GetInstance(o, true); + break; + default: + throw new ArgumentException("unknown tag"); + } + } + } + + public AlgorithmIdentifier HashAlgorithm + { + get { return hashAlgorithm; } + } + + public AlgorithmIdentifier MaskGenAlgorithm + { + get { return maskGenAlgorithm; } + } + + public AlgorithmIdentifier PSourceAlgorithm + { + get { return pSourceAlgorithm; } + } + + /** + *
+		 *  RSAES-OAEP-params ::= SEQUENCE {
+		 *     hashAlgorithm      [0] OAEP-PSSDigestAlgorithms     DEFAULT sha1,
+		 *     maskGenAlgorithm   [1] PKCS1MGFAlgorithms  DEFAULT mgf1SHA1,
+		 *     pSourceAlgorithm   [2] PKCS1PSourceAlgorithms  DEFAULT pSpecifiedEmpty
+		 *   }
+		 *
+		 *   OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
+		 *     { OID id-sha1 PARAMETERS NULL   }|
+		 *     { OID id-sha256 PARAMETERS NULL }|
+		 *     { OID id-sha384 PARAMETERS NULL }|
+		 *     { OID id-sha512 PARAMETERS NULL },
+		 *     ...  -- Allows for future expansion --
+		 *   }
+		 *   PKCS1MGFAlgorithms    ALGORITHM-IDENTIFIER ::= {
+		 *     { OID id-mgf1 PARAMETERS OAEP-PSSDigestAlgorithms },
+		 *    ...  -- Allows for future expansion --
+		 *   }
+		 *   PKCS1PSourceAlgorithms    ALGORITHM-IDENTIFIER ::= {
+		 *     { OID id-pSpecified PARAMETERS OCTET STRING },
+		 *     ...  -- Allows for future expansion --
+		 *  }
+		 * 
+ * @return the asn1 primitive representing the parameters. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (!hashAlgorithm.Equals(DefaultHashAlgorithm)) + { + v.Add(new DerTaggedObject(true, 0, hashAlgorithm)); + } + + if (!maskGenAlgorithm.Equals(DefaultMaskGenFunction)) + { + v.Add(new DerTaggedObject(true, 1, maskGenAlgorithm)); + } + + if (!pSourceAlgorithm.Equals(DefaultPSourceAlgorithm)) + { + v.Add(new DerTaggedObject(true, 2, pSourceAlgorithm)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAESOAEPparams.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAESOAEPparams.cs.meta new file mode 100644 index 00000000..c22e16f0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAESOAEPparams.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7df70097725cd54689ca8cea620b7ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAPrivateKeyStructure.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAPrivateKeyStructure.cs new file mode 100644 index 00000000..33c96c74 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAPrivateKeyStructure.cs @@ -0,0 +1,150 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class RsaPrivateKeyStructure + : Asn1Encodable + { + private readonly BigInteger modulus; + private readonly BigInteger publicExponent; + private readonly BigInteger privateExponent; + private readonly BigInteger prime1; + private readonly BigInteger prime2; + private readonly BigInteger exponent1; + private readonly BigInteger exponent2; + private readonly BigInteger coefficient; + + public static RsaPrivateKeyStructure GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + public static RsaPrivateKeyStructure GetInstance(object obj) + { + if (obj == null) + return null; + if (obj is RsaPrivateKeyStructure) + return (RsaPrivateKeyStructure)obj; + return new RsaPrivateKeyStructure(Asn1Sequence.GetInstance(obj)); + } + + public RsaPrivateKeyStructure( + BigInteger modulus, + BigInteger publicExponent, + BigInteger privateExponent, + BigInteger prime1, + BigInteger prime2, + BigInteger exponent1, + BigInteger exponent2, + BigInteger coefficient) + { + this.modulus = modulus; + this.publicExponent = publicExponent; + this.privateExponent = privateExponent; + this.prime1 = prime1; + this.prime2 = prime2; + this.exponent1 = exponent1; + this.exponent2 = exponent2; + this.coefficient = coefficient; + } + + [Obsolete("Use 'GetInstance' method(s) instead")] + public RsaPrivateKeyStructure( + Asn1Sequence seq) + { + BigInteger version = ((DerInteger)seq[0]).Value; + if (version.IntValue != 0) + throw new ArgumentException("wrong version for RSA private key"); + + modulus = ((DerInteger)seq[1]).Value; + publicExponent = ((DerInteger)seq[2]).Value; + privateExponent = ((DerInteger)seq[3]).Value; + prime1 = ((DerInteger)seq[4]).Value; + prime2 = ((DerInteger)seq[5]).Value; + exponent1 = ((DerInteger)seq[6]).Value; + exponent2 = ((DerInteger)seq[7]).Value; + coefficient = ((DerInteger)seq[8]).Value; + } + + public BigInteger Modulus + { + get { return modulus; } + } + + public BigInteger PublicExponent + { + get { return publicExponent; } + } + + public BigInteger PrivateExponent + { + get { return privateExponent; } + } + + public BigInteger Prime1 + { + get { return prime1; } + } + + public BigInteger Prime2 + { + get { return prime2; } + } + + public BigInteger Exponent1 + { + get { return exponent1; } + } + + public BigInteger Exponent2 + { + get { return exponent2; } + } + + public BigInteger Coefficient + { + get { return coefficient; } + } + + /** + * This outputs the key in Pkcs1v2 format. + *
+         *      RsaPrivateKey ::= Sequence {
+         *                          version Version,
+         *                          modulus Integer, -- n
+         *                          publicExponent Integer, -- e
+         *                          privateExponent Integer, -- d
+         *                          prime1 Integer, -- p
+         *                          prime2 Integer, -- q
+         *                          exponent1 Integer, -- d mod (p-1)
+         *                          exponent2 Integer, -- d mod (q-1)
+         *                          coefficient Integer -- (inverse of q) mod p
+         *                      }
+         *
+         *      Version ::= Integer
+         * 
+ *

This routine is written to output Pkcs1 version 0, private keys.

+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence( + new DerInteger(0), // version + new DerInteger(Modulus), + new DerInteger(PublicExponent), + new DerInteger(PrivateExponent), + new DerInteger(Prime1), + new DerInteger(Prime2), + new DerInteger(Exponent1), + new DerInteger(Exponent2), + new DerInteger(Coefficient)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAPrivateKeyStructure.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAPrivateKeyStructure.cs.meta new file mode 100644 index 00000000..3c41cb39 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSAPrivateKeyStructure.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c725dc005bd541e4691f1ed5eaeec816 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSASSAPSSparams.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSASSAPSSparams.cs new file mode 100644 index 00000000..5d4d8f84 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSASSAPSSparams.cs @@ -0,0 +1,170 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class RsassaPssParameters + : Asn1Encodable + { + private AlgorithmIdentifier hashAlgorithm; + private AlgorithmIdentifier maskGenAlgorithm; + private DerInteger saltLength; + private DerInteger trailerField; + + public readonly static AlgorithmIdentifier DefaultHashAlgorithm = new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1, DerNull.Instance); + public readonly static AlgorithmIdentifier DefaultMaskGenFunction = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdMgf1, DefaultHashAlgorithm); + public readonly static DerInteger DefaultSaltLength = new DerInteger(20); + public readonly static DerInteger DefaultTrailerField = new DerInteger(1); + + public static RsassaPssParameters GetInstance( + object obj) + { + if (obj == null || obj is RsassaPssParameters) + { + return (RsassaPssParameters)obj; + } + + if (obj is Asn1Sequence) + { + return new RsassaPssParameters((Asn1Sequence)obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * The default version + */ + public RsassaPssParameters() + { + hashAlgorithm = DefaultHashAlgorithm; + maskGenAlgorithm = DefaultMaskGenFunction; + saltLength = DefaultSaltLength; + trailerField = DefaultTrailerField; + } + + public RsassaPssParameters( + AlgorithmIdentifier hashAlgorithm, + AlgorithmIdentifier maskGenAlgorithm, + DerInteger saltLength, + DerInteger trailerField) + { + this.hashAlgorithm = hashAlgorithm; + this.maskGenAlgorithm = maskGenAlgorithm; + this.saltLength = saltLength; + this.trailerField = trailerField; + } + + public RsassaPssParameters( + Asn1Sequence seq) + { + hashAlgorithm = DefaultHashAlgorithm; + maskGenAlgorithm = DefaultMaskGenFunction; + saltLength = DefaultSaltLength; + trailerField = DefaultTrailerField; + + for (int i = 0; i != seq.Count; i++) + { + Asn1TaggedObject o = (Asn1TaggedObject)seq[i]; + + switch (o.TagNo) + { + case 0: + hashAlgorithm = AlgorithmIdentifier.GetInstance(o, true); + break; + case 1: + maskGenAlgorithm = AlgorithmIdentifier.GetInstance(o, true); + break; + case 2: + saltLength = DerInteger.GetInstance(o, true); + break; + case 3: + trailerField = DerInteger.GetInstance(o, true); + break; + default: + throw new ArgumentException("unknown tag"); + } + } + } + + public AlgorithmIdentifier HashAlgorithm + { + get { return hashAlgorithm; } + } + + public AlgorithmIdentifier MaskGenAlgorithm + { + get { return maskGenAlgorithm; } + } + + public DerInteger SaltLength + { + get { return saltLength; } + } + + public DerInteger TrailerField + { + get { return trailerField; } + } + + /** + *
+		 * RSASSA-PSS-params ::= SEQUENCE {
+		 *   hashAlgorithm      [0] OAEP-PSSDigestAlgorithms  DEFAULT sha1,
+		 *    maskGenAlgorithm   [1] PKCS1MGFAlgorithms  DEFAULT mgf1SHA1,
+		 *    saltLength         [2] INTEGER  DEFAULT 20,
+		 *    trailerField       [3] TrailerField  DEFAULT trailerFieldBC
+		 *  }
+		 *
+		 * OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
+		 *    { OID id-sha1 PARAMETERS NULL   }|
+		 *    { OID id-sha256 PARAMETERS NULL }|
+		 *    { OID id-sha384 PARAMETERS NULL }|
+		 *    { OID id-sha512 PARAMETERS NULL },
+		 *    ...  -- Allows for future expansion --
+		 * }
+		 *
+		 * PKCS1MGFAlgorithms    ALGORITHM-IDENTIFIER ::= {
+		 *   { OID id-mgf1 PARAMETERS OAEP-PSSDigestAlgorithms },
+		 *    ...  -- Allows for future expansion --
+		 * }
+		 *
+		 * TrailerField ::= INTEGER { trailerFieldBC(1) }
+		 * 
+ * @return the asn1 primitive representing the parameters. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (!hashAlgorithm.Equals(DefaultHashAlgorithm)) + { + v.Add(new DerTaggedObject(true, 0, hashAlgorithm)); + } + + if (!maskGenAlgorithm.Equals(DefaultMaskGenFunction)) + { + v.Add(new DerTaggedObject(true, 1, maskGenAlgorithm)); + } + + if (!saltLength.Equals(DefaultSaltLength)) + { + v.Add(new DerTaggedObject(true, 2, saltLength)); + } + + if (!trailerField.Equals(DefaultTrailerField)) + { + v.Add(new DerTaggedObject(true, 3, trailerField)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSASSAPSSparams.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSASSAPSSparams.cs.meta new file mode 100644 index 00000000..a1153407 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/RSASSAPSSparams.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b2c22d57de73f1d48bae3043e36e6a4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SafeBag.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SafeBag.cs new file mode 100644 index 00000000..dba77205 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SafeBag.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + public class SafeBag + : Asn1Encodable + { + private readonly DerObjectIdentifier bagID; + private readonly Asn1Object bagValue; + private readonly Asn1Set bagAttributes; + + public SafeBag( + DerObjectIdentifier oid, + Asn1Object obj) + { + this.bagID = oid; + this.bagValue = obj; + this.bagAttributes = null; + } + + public SafeBag( + DerObjectIdentifier oid, + Asn1Object obj, + Asn1Set bagAttributes) + { + this.bagID = oid; + this.bagValue = obj; + this.bagAttributes = bagAttributes; + } + + public SafeBag( + Asn1Sequence seq) + { + this.bagID = (DerObjectIdentifier) seq[0]; + this.bagValue = ((DerTaggedObject) seq[1]).GetObject(); + if (seq.Count == 3) + { + this.bagAttributes = (Asn1Set) seq[2]; + } + } + + public DerObjectIdentifier BagID + { + get { return bagID; } + } + + public Asn1Object BagValue + { + get { return bagValue; } + } + + public Asn1Set BagAttributes + { + get { return bagAttributes; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + bagID, new DerTaggedObject(0, bagValue)); + + if (bagAttributes != null) + { + v.Add(bagAttributes); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SafeBag.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SafeBag.cs.meta new file mode 100644 index 00000000..be48c244 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SafeBag.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 69c7953ae9f2fba46aba947a13b2f6a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignedData.cs new file mode 100644 index 00000000..89a1d60f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignedData.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + /** + * a Pkcs#7 signed data object. + */ + public class SignedData + : Asn1Encodable + { + private readonly DerInteger version; + private readonly Asn1Set digestAlgorithms; + private readonly ContentInfo contentInfo; + private readonly Asn1Set certificates; + private readonly Asn1Set crls; + private readonly Asn1Set signerInfos; + + public static SignedData GetInstance(object obj) + { + if (obj == null) + return null; + SignedData existing = obj as SignedData; + if (existing != null) + return existing; + return new SignedData(Asn1Sequence.GetInstance(obj)); + } + + public SignedData( + DerInteger _version, + Asn1Set _digestAlgorithms, + ContentInfo _contentInfo, + Asn1Set _certificates, + Asn1Set _crls, + Asn1Set _signerInfos) + { + version = _version; + digestAlgorithms = _digestAlgorithms; + contentInfo = _contentInfo; + certificates = _certificates; + crls = _crls; + signerInfos = _signerInfos; + } + + private SignedData( + Asn1Sequence seq) + { + IEnumerator e = seq.GetEnumerator(); + + e.MoveNext(); + version = (DerInteger) e.Current; + + e.MoveNext(); + digestAlgorithms = (Asn1Set) e.Current; + + e.MoveNext(); + contentInfo = ContentInfo.GetInstance(e.Current); + + while (e.MoveNext()) + { + Asn1Object o = (Asn1Object) e.Current; + + // + // an interesting feature of SignedData is that there appear to be varying implementations... + // for the moment we ignore anything which doesn't fit. + // + if (o is DerTaggedObject) + { + DerTaggedObject tagged = (DerTaggedObject) o; + + switch (tagged.TagNo) + { + case 0: + certificates = Asn1Set.GetInstance(tagged, false); + break; + case 1: + crls = Asn1Set.GetInstance(tagged, false); + break; + default: + throw new ArgumentException("unknown tag value " + tagged.TagNo); + } + } + else + { + signerInfos = (Asn1Set) o; + } + } + } + + public DerInteger Version + { + get { return version; } + } + + public Asn1Set DigestAlgorithms + { + get { return digestAlgorithms; } + } + + public ContentInfo ContentInfo + { + get { return contentInfo; } + } + + public Asn1Set Certificates + { + get { return certificates; } + } + + public Asn1Set Crls + { + get { return crls; } + } + + public Asn1Set SignerInfos + { + get { return signerInfos; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  SignedData ::= Sequence {
+         *      version Version,
+         *      digestAlgorithms DigestAlgorithmIdentifiers,
+         *      contentInfo ContentInfo,
+         *      certificates
+         *          [0] IMPLICIT ExtendedCertificatesAndCertificates
+         *                   OPTIONAL,
+         *      crls
+         *          [1] IMPLICIT CertificateRevocationLists OPTIONAL,
+         *      signerInfos SignerInfos }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + version, digestAlgorithms, contentInfo); + + if (certificates != null) + { + v.Add(new DerTaggedObject(false, 0, certificates)); + } + + if (crls != null) + { + v.Add(new DerTaggedObject(false, 1, crls)); + } + + v.Add(signerInfos); + + return new BerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignedData.cs.meta new file mode 100644 index 00000000..10acb628 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1ec29216e5122374bad13557289fe449 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignerInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignerInfo.cs new file mode 100644 index 00000000..7b304271 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignerInfo.cs @@ -0,0 +1,158 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs +{ + /** + * a Pkcs#7 signer info object. + */ + public class SignerInfo + : Asn1Encodable + { + private DerInteger version; + private IssuerAndSerialNumber issuerAndSerialNumber; + private AlgorithmIdentifier digAlgorithm; + private Asn1Set authenticatedAttributes; + private AlgorithmIdentifier digEncryptionAlgorithm; + private Asn1OctetString encryptedDigest; + private Asn1Set unauthenticatedAttributes; + + public static SignerInfo GetInstance( + object obj) + { + if (obj is SignerInfo) + { + return (SignerInfo) obj; + } + + if (obj is Asn1Sequence) + { + return new SignerInfo((Asn1Sequence) obj); + } + + throw new ArgumentException("Unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public SignerInfo( + DerInteger version, + IssuerAndSerialNumber issuerAndSerialNumber, + AlgorithmIdentifier digAlgorithm, + Asn1Set authenticatedAttributes, + AlgorithmIdentifier digEncryptionAlgorithm, + Asn1OctetString encryptedDigest, + Asn1Set unauthenticatedAttributes) + { + this.version = version; + this.issuerAndSerialNumber = issuerAndSerialNumber; + this.digAlgorithm = digAlgorithm; + this.authenticatedAttributes = authenticatedAttributes; + this.digEncryptionAlgorithm = digEncryptionAlgorithm; + this.encryptedDigest = encryptedDigest; + this.unauthenticatedAttributes = unauthenticatedAttributes; + } + + public SignerInfo( + Asn1Sequence seq) + { + IEnumerator e = seq.GetEnumerator(); + + e.MoveNext(); + version = (DerInteger) e.Current; + + e.MoveNext(); + issuerAndSerialNumber = IssuerAndSerialNumber.GetInstance(e.Current); + + e.MoveNext(); + digAlgorithm = AlgorithmIdentifier.GetInstance(e.Current); + + e.MoveNext(); + object obj = e.Current; + + if (obj is Asn1TaggedObject) + { + authenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject) obj, false); + + e.MoveNext(); + digEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(e.Current); + } + else + { + authenticatedAttributes = null; + digEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(obj); + } + + e.MoveNext(); + encryptedDigest = DerOctetString.GetInstance(e.Current); + + if (e.MoveNext()) + { + unauthenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject)e.Current, false); + } + else + { + unauthenticatedAttributes = null; + } + } + + public DerInteger Version { get { return version; } } + + public IssuerAndSerialNumber IssuerAndSerialNumber { get { return issuerAndSerialNumber; } } + + public Asn1Set AuthenticatedAttributes { get { return authenticatedAttributes; } } + + public AlgorithmIdentifier DigestAlgorithm { get { return digAlgorithm; } } + + public Asn1OctetString EncryptedDigest { get { return encryptedDigest; } } + + public AlgorithmIdentifier DigestEncryptionAlgorithm { get { return digEncryptionAlgorithm; } } + + public Asn1Set UnauthenticatedAttributes { get { return unauthenticatedAttributes; } } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  SignerInfo ::= Sequence {
+         *      version Version,
+         *      issuerAndSerialNumber IssuerAndSerialNumber,
+         *      digestAlgorithm DigestAlgorithmIdentifier,
+         *      authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL,
+         *      digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
+         *      encryptedDigest EncryptedDigest,
+         *      unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL
+         *  }
+         *
+         *  EncryptedDigest ::= OCTET STRING
+         *
+         *  DigestAlgorithmIdentifier ::= AlgorithmIdentifier
+         *
+         *  DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + version, issuerAndSerialNumber, digAlgorithm); + + if (authenticatedAttributes != null) + { + v.Add(new DerTaggedObject(false, 0, authenticatedAttributes)); + } + + v.Add(digEncryptionAlgorithm, encryptedDigest); + + if (unauthenticatedAttributes != null) + { + v.Add(new DerTaggedObject(false, 1, unauthenticatedAttributes)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignerInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignerInfo.cs.meta new file mode 100644 index 00000000..574beeac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/pkcs/SignerInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58ed4961ab7743046883b626554bd657 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart.meta new file mode 100644 index 00000000..a1c3b054 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be558af1c7bddea47a6659440ff96e6d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart/RosstandartObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart/RosstandartObjectIdentifiers.cs new file mode 100644 index 00000000..363228bb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart/RosstandartObjectIdentifiers.cs @@ -0,0 +1,51 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart +{ + public abstract class RosstandartObjectIdentifiers + { + public static readonly DerObjectIdentifier rosstandart = new DerObjectIdentifier("1.2.643.7"); + + public static readonly DerObjectIdentifier id_tc26 = rosstandart.Branch("1"); + + public static readonly DerObjectIdentifier id_tc26_gost_3411_12_256 = id_tc26.Branch("1.2.2"); + + public static readonly DerObjectIdentifier id_tc26_gost_3411_12_512 = id_tc26.Branch("1.2.3"); + + public static readonly DerObjectIdentifier id_tc26_hmac_gost_3411_12_256 = id_tc26.Branch("1.4.1"); + + public static readonly DerObjectIdentifier id_tc26_hmac_gost_3411_12_512 = id_tc26.Branch("1.4.2"); + + public static readonly DerObjectIdentifier id_tc26_gost_3410_12_256 = id_tc26.Branch("1.1.1"); + + public static readonly DerObjectIdentifier id_tc26_gost_3410_12_512 = id_tc26.Branch("1.1.2"); + + public static readonly DerObjectIdentifier id_tc26_signwithdigest_gost_3410_12_256 = id_tc26.Branch("1.3.2"); + + public static readonly DerObjectIdentifier id_tc26_signwithdigest_gost_3410_12_512 = id_tc26.Branch("1.3.3"); + + public static readonly DerObjectIdentifier id_tc26_agreement = id_tc26.Branch("1.6"); + + public static readonly DerObjectIdentifier id_tc26_agreement_gost_3410_12_256 = id_tc26_agreement.Branch("1"); + + public static readonly DerObjectIdentifier id_tc26_agreement_gost_3410_12_512 = id_tc26_agreement.Branch("2"); + + public static readonly DerObjectIdentifier id_tc26_gost_3410_12_256_paramSet = id_tc26.Branch("2.1.1"); + + public static readonly DerObjectIdentifier id_tc26_gost_3410_12_256_paramSetA = id_tc26_gost_3410_12_256_paramSet.Branch("1"); + + public static readonly DerObjectIdentifier id_tc26_gost_3410_12_512_paramSet = id_tc26.Branch("2.1.2"); + + public static readonly DerObjectIdentifier id_tc26_gost_3410_12_512_paramSetA = id_tc26_gost_3410_12_512_paramSet.Branch("1"); + + public static readonly DerObjectIdentifier id_tc26_gost_3410_12_512_paramSetB = id_tc26_gost_3410_12_512_paramSet.Branch("2"); + + public static readonly DerObjectIdentifier id_tc26_gost_3410_12_512_paramSetC = id_tc26_gost_3410_12_512_paramSet.Branch("3"); + + public static readonly DerObjectIdentifier id_tc26_gost_28147_param_Z = id_tc26.Branch("2.5.1.1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart/RosstandartObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart/RosstandartObjectIdentifiers.cs.meta new file mode 100644 index 00000000..6aa215bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/rosstandart/RosstandartObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6ab1e50b9be3ca84eb9839c72f6a2075 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec.meta new file mode 100644 index 00000000..ff268dd1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 33f43652a7e9789499bdc30289b5bc3e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/ECPrivateKeyStructure.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/ECPrivateKeyStructure.cs new file mode 100644 index 00000000..81bc037b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/ECPrivateKeyStructure.cs @@ -0,0 +1,179 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec +{ + /** + * the elliptic curve private key object from SEC 1 + */ + public class ECPrivateKeyStructure + : Asn1Encodable + { + private readonly Asn1Sequence seq; + + public static ECPrivateKeyStructure GetInstance(object obj) + { + if (obj == null) + return null; + if (obj is ECPrivateKeyStructure) + return (ECPrivateKeyStructure)obj; + return new ECPrivateKeyStructure(Asn1Sequence.GetInstance(obj)); + } + + [Obsolete("Use 'GetInstance' instead")] + public ECPrivateKeyStructure( + Asn1Sequence seq) + { + if (seq == null) + throw new ArgumentNullException("seq"); + + this.seq = seq; + } + + [Obsolete("Use constructor which takes 'orderBitLength' instead, to guarantee correct encoding")] + public ECPrivateKeyStructure( + BigInteger key) + { + if (key == null) + throw new ArgumentNullException("key"); + + this.seq = new DerSequence( + new DerInteger(1), + new DerOctetString(key.ToByteArrayUnsigned())); + } + + public ECPrivateKeyStructure( + int orderBitLength, + BigInteger key) + : this(orderBitLength, key, null) + { + } + + [Obsolete("Use constructor which takes 'orderBitLength' instead, to guarantee correct encoding")] + public ECPrivateKeyStructure( + BigInteger key, + Asn1Encodable parameters) + : this(key, null, parameters) + { + } + + [Obsolete("Use constructor which takes 'orderBitLength' instead, to guarantee correct encoding")] + public ECPrivateKeyStructure( + BigInteger key, + DerBitString publicKey, + Asn1Encodable parameters) + { + if (key == null) + throw new ArgumentNullException("key"); + + Asn1EncodableVector v = new Asn1EncodableVector( + new DerInteger(1), + new DerOctetString(key.ToByteArrayUnsigned())); + + if (parameters != null) + { + v.Add(new DerTaggedObject(true, 0, parameters)); + } + + if (publicKey != null) + { + v.Add(new DerTaggedObject(true, 1, publicKey)); + } + + this.seq = new DerSequence(v); + } + + public ECPrivateKeyStructure( + int orderBitLength, + BigInteger key, + Asn1Encodable parameters) + : this(orderBitLength, key, null, parameters) + { + } + + public ECPrivateKeyStructure( + int orderBitLength, + BigInteger key, + DerBitString publicKey, + Asn1Encodable parameters) + { + if (key == null) + throw new ArgumentNullException("key"); + if (orderBitLength < key.BitLength) + throw new ArgumentException("must be >= key bitlength", "orderBitLength"); + + byte[] bytes = BigIntegers.AsUnsignedByteArray((orderBitLength + 7) / 8, key); + + Asn1EncodableVector v = new Asn1EncodableVector( + new DerInteger(1), + new DerOctetString(bytes)); + + if (parameters != null) + { + v.Add(new DerTaggedObject(true, 0, parameters)); + } + + if (publicKey != null) + { + v.Add(new DerTaggedObject(true, 1, publicKey)); + } + + this.seq = new DerSequence(v); + } + + public virtual BigInteger GetKey() + { + Asn1OctetString octs = (Asn1OctetString) seq[1]; + + return new BigInteger(1, octs.GetOctets()); + } + + public virtual DerBitString GetPublicKey() + { + return (DerBitString) GetObjectInTag(1); + } + + public virtual Asn1Object GetParameters() + { + return GetObjectInTag(0); + } + + private Asn1Object GetObjectInTag(int tagNo) + { + foreach (Asn1Encodable ae in seq) + { + Asn1Object obj = ae.ToAsn1Object(); + + if (obj is Asn1TaggedObject) + { + Asn1TaggedObject tag = (Asn1TaggedObject) obj; + if (tag.TagNo == tagNo) + { + return tag.GetObject(); + } + } + } + + return null; + } + + /** + * ECPrivateKey ::= SEQUENCE { + * version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1), + * privateKey OCTET STRING, + * parameters [0] Parameters OPTIONAL, + * publicKey [1] BIT STRING OPTIONAL } + */ + public override Asn1Object ToAsn1Object() + { + return seq; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/ECPrivateKeyStructure.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/ECPrivateKeyStructure.cs.meta new file mode 100644 index 00000000..bef17ece --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/ECPrivateKeyStructure.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 76e4de814cc3dd54891497924540b15f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECNamedCurves.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECNamedCurves.cs new file mode 100644 index 00000000..23886269 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECNamedCurves.cs @@ -0,0 +1,1188 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec +{ + public sealed class SecNamedCurves + { + private SecNamedCurves() + { + } + + private static ECCurve ConfigureCurve(ECCurve curve) + { + return curve; + } + + private static ECCurve ConfigureCurveGlv(ECCurve c, GlvTypeBParameters p) + { + return c.Configure().SetEndomorphism(new GlvTypeBEndomorphism(c, p)).Create(); + } + + private static BigInteger FromHex(string hex) + { + return new BigInteger(1, Hex.Decode(hex)); + } + + /* + * secp112r1 + */ + internal class Secp112r1Holder + : X9ECParametersHolder + { + private Secp112r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp112r1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = (2^128 - 3) / 76439 + BigInteger p = FromHex("DB7C2ABF62E35E668076BEAD208B"); + BigInteger a = FromHex("DB7C2ABF62E35E668076BEAD2088"); + BigInteger b = FromHex("659EF8BA043916EEDE8911702B22"); + byte[] S = Hex.Decode("00F50B028E4D696E676875615175290472783FB1"); + BigInteger n = FromHex("DB7C2ABF62E35E7628DFAC6561C5"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "09487239995A5EE76B55F9C2F098" + + "A89CE5AF8724C0A23E0E0FF77500")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp112r2 + */ + internal class Secp112r2Holder + : X9ECParametersHolder + { + private Secp112r2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp112r2Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = (2^128 - 3) / 76439 + BigInteger p = FromHex("DB7C2ABF62E35E668076BEAD208B"); + BigInteger a = FromHex("6127C24C05F38A0AAAF65C0EF02C"); + BigInteger b = FromHex("51DEF1815DB5ED74FCC34C85D709"); + byte[] S = Hex.Decode("002757A1114D696E6768756151755316C05E0BD4"); + BigInteger n = FromHex("36DF0AAFD8B8D7597CA10520D04B"); + BigInteger h = BigInteger.ValueOf(4); + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "4BA30AB5E892B4E1649DD0928643" + + "ADCD46F5882E3747DEF36E956E97")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp128r1 + */ + internal class Secp128r1Holder + : X9ECParametersHolder + { + private Secp128r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp128r1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^128 - 2^97 - 1 + BigInteger p = FromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"); + BigInteger a = FromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"); + BigInteger b = FromHex("E87579C11079F43DD824993C2CEE5ED3"); + byte[] S = Hex.Decode("000E0D4D696E6768756151750CC03A4473D03679"); + BigInteger n = FromHex("FFFFFFFE0000000075A30D1B9038A115"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "161FF7528B899B2D0C28607CA52C5B86" + + "CF5AC8395BAFEB13C02DA292DDED7A83")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp128r2 + */ + internal class Secp128r2Holder + : X9ECParametersHolder + { + private Secp128r2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp128r2Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^128 - 2^97 - 1 + BigInteger p = FromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"); + BigInteger a = FromHex("D6031998D1B3BBFEBF59CC9BBFF9AEE1"); + BigInteger b = FromHex("5EEEFCA380D02919DC2C6558BB6D8A5D"); + byte[] S = Hex.Decode("004D696E67687561517512D8F03431FCE63B88F4"); + BigInteger n = FromHex("3FFFFFFF7FFFFFFFBE0024720613B5A3"); + BigInteger h = BigInteger.ValueOf(4); + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "7B6AA5D85E572983E6FB32A7CDEBC140" + + "27B6916A894D3AEE7106FE805FC34B44")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp160k1 + */ + internal class Secp160k1Holder + : X9ECParametersHolder + { + private Secp160k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp160k1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1 + BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"); + BigInteger a = BigInteger.Zero; + BigInteger b = BigInteger.ValueOf(7); + byte[] S = null; + BigInteger n = FromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3"); + BigInteger h = BigInteger.One; + + GlvTypeBParameters glv = new GlvTypeBParameters( + new BigInteger("9ba48cba5ebcb9b6bd33b92830b2a2e0e192f10a", 16), + new BigInteger("c39c6c3b3a36d7701b9c71a1f5804ae5d0003f4", 16), + new BigInteger[]{ + new BigInteger("9162fbe73984472a0a9e", 16), + new BigInteger("-96341f1138933bc2f505", 16) }, + new BigInteger[]{ + new BigInteger("127971af8721782ecffa3", 16), + new BigInteger("9162fbe73984472a0a9e", 16) }, + new BigInteger("9162fbe73984472a0a9d0590", 16), + new BigInteger("96341f1138933bc2f503fd44", 16), + 176); + + ECCurve curve = ConfigureCurveGlv(new FpCurve(p, a, b, n, h), glv); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB" + + "938CF935318FDCED6BC28286531733C3F03C4FEE")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp160r1 + */ + internal class Secp160r1Holder + : X9ECParametersHolder + { + private Secp160r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp160r1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^160 - 2^31 - 1 + BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"); + BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"); + BigInteger b = FromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"); + byte[] S = Hex.Decode("1053CDE42C14D696E67687561517533BF3F83345"); + BigInteger n = FromHex("0100000000000000000001F4C8F927AED3CA752257"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "4A96B5688EF573284664698968C38BB913CBFC82" + + "23A628553168947D59DCC912042351377AC5FB32")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp160r2 + */ + internal class Secp160r2Holder + : X9ECParametersHolder + { + private Secp160r2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp160r2Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1 + BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"); + BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70"); + BigInteger b = FromHex("B4E134D3FB59EB8BAB57274904664D5AF50388BA"); + byte[] S = Hex.Decode("B99B99B099B323E02709A4D696E6768756151751"); + BigInteger n = FromHex("0100000000000000000000351EE786A818F3A1A16B"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "52DCB034293A117E1F4FF11B30F7199D3144CE6D" + + "FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp192k1 + */ + internal class Secp192k1Holder + : X9ECParametersHolder + { + private Secp192k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp192k1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1 + BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"); + BigInteger a = BigInteger.Zero; + BigInteger b = BigInteger.ValueOf(3); + byte[] S = null; + BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"); + BigInteger h = BigInteger.One; + + GlvTypeBParameters glv = new GlvTypeBParameters( + new BigInteger("bb85691939b869c1d087f601554b96b80cb4f55b35f433c2", 16), + new BigInteger("3d84f26c12238d7b4f3d516613c1759033b1a5800175d0b1", 16), + new BigInteger[]{ + new BigInteger("71169be7330b3038edb025f1", 16), + new BigInteger("-b3fb3400dec5c4adceb8655c", 16) }, + new BigInteger[]{ + new BigInteger("12511cfe811d0f4e6bc688b4d", 16), + new BigInteger("71169be7330b3038edb025f1", 16) }, + new BigInteger("71169be7330b3038edb025f1d0f9", 16), + new BigInteger("b3fb3400dec5c4adceb8655d4c94", 16), + 208); + + ECCurve curve = ConfigureCurveGlv(new FpCurve(p, a, b, n, h), glv); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D" + + "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp192r1 + */ + internal class Secp192r1Holder + : X9ECParametersHolder + { + private Secp192r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp192r1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^192 - 2^64 - 1 + BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"); + BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"); + BigInteger b = FromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"); + byte[] S = Hex.Decode("3045AE6FC8422F64ED579528D38120EAE12196D5"); + BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012" + + "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp224k1 + */ + internal class Secp224k1Holder + : X9ECParametersHolder + { + private Secp224k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp224k1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^224 - 2^32 - 2^12 - 2^11 - 2^9 - 2^7 - 2^4 - 2 - 1 + BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D"); + BigInteger a = BigInteger.Zero; + BigInteger b = BigInteger.ValueOf(5); + byte[] S = null; + BigInteger n = FromHex("010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7"); + BigInteger h = BigInteger.One; + + GlvTypeBParameters glv = new GlvTypeBParameters( + new BigInteger("fe0e87005b4e83761908c5131d552a850b3f58b749c37cf5b84d6768", 16), + new BigInteger("60dcd2104c4cbc0be6eeefc2bdd610739ec34e317f9b33046c9e4788", 16), + new BigInteger[]{ + new BigInteger("6b8cf07d4ca75c88957d9d670591", 16), + new BigInteger("-b8adf1378a6eb73409fa6c9c637d", 16) }, + new BigInteger[]{ + new BigInteger("1243ae1b4d71613bc9f780a03690e", 16), + new BigInteger("6b8cf07d4ca75c88957d9d670591", 16) }, + new BigInteger("6b8cf07d4ca75c88957d9d67059037a4", 16), + new BigInteger("b8adf1378a6eb73409fa6c9c637ba7f5", 16), + 240); + + ECCurve curve = ConfigureCurveGlv(new FpCurve(p, a, b, n, h), glv); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C" + + "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp224r1 + */ + internal class Secp224r1Holder + : X9ECParametersHolder + { + private Secp224r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp224r1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^224 - 2^96 + 1 + BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"); + BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"); + BigInteger b = FromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"); + byte[] S = Hex.Decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5"); + BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21" + + "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp256k1 + */ + internal class Secp256k1Holder + : X9ECParametersHolder + { + private Secp256k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp256k1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1 + BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F"); + BigInteger a = BigInteger.Zero; + BigInteger b = BigInteger.ValueOf(7); + byte[] S = null; + BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"); + BigInteger h = BigInteger.One; + + GlvTypeBParameters glv = new GlvTypeBParameters( + new BigInteger("7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", 16), + new BigInteger("5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", 16), + new BigInteger[]{ + new BigInteger("3086d221a7d46bcde86c90e49284eb15", 16), + new BigInteger("-e4437ed6010e88286f547fa90abfe4c3", 16) }, + new BigInteger[]{ + new BigInteger("114ca50f7a8e2f3f657c1108d9d44cfd8", 16), + new BigInteger("3086d221a7d46bcde86c90e49284eb15", 16) }, + new BigInteger("3086d221a7d46bcde86c90e49284eb153dab", 16), + new BigInteger("e4437ed6010e88286f547fa90abfe4c42212", 16), + 272); + + ECCurve curve = ConfigureCurveGlv(new FpCurve(p, a, b, n, h), glv); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798" + + "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp256r1 + */ + internal class Secp256r1Holder + : X9ECParametersHolder + { + private Secp256r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp256r1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1 + BigInteger p = FromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"); + BigInteger a = FromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"); + BigInteger b = FromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"); + byte[] S = Hex.Decode("C49D360886E704936A6678E1139D26B7819F7E90"); + BigInteger n = FromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296" + + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp384r1 + */ + internal class Secp384r1Holder + : X9ECParametersHolder + { + private Secp384r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp384r1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^384 - 2^128 - 2^96 + 2^32 - 1 + BigInteger p = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF"); + BigInteger a = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC"); + BigInteger b = FromHex("B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF"); + byte[] S = Hex.Decode("A335926AA319A27A1D00896A6773A4827ACDAC73"); + BigInteger n = FromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7" + + "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * secp521r1 + */ + internal class Secp521r1Holder + : X9ECParametersHolder + { + private Secp521r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Secp521r1Holder(); + + protected override X9ECParameters CreateParameters() + { + // p = 2^521 - 1 + BigInteger p = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + BigInteger a = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC"); + BigInteger b = FromHex("0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00"); + byte[] S = Hex.Decode("D09E8800291CB85396CC6717393284AAA0DA64BA"); + BigInteger n = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409"); + BigInteger h = BigInteger.One; + + ECCurve curve = ConfigureCurve(new FpCurve(p, a, b, n, h)); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66" + + "011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect113r1 + */ + internal class Sect113r1Holder + : X9ECParametersHolder + { + private Sect113r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect113r1Holder(); + + private const int m = 113; + private const int k = 9; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = FromHex("003088250CA6E7C7FE649CE85820F7"); + BigInteger b = FromHex("00E8BEE4D3E2260744188BE0E9C723"); + byte[] S = Hex.Decode("10E723AB14D696E6768756151756FEBF8FCB49A9"); + BigInteger n = FromHex("0100000000000000D9CCEC8A39E56F"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "009D73616F35F4AB1407D73562C10F" + + "00A52830277958EE84D1315ED31886")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect113r2 + */ + internal class Sect113r2Holder + : X9ECParametersHolder + { + private Sect113r2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect113r2Holder(); + + private const int m = 113; + private const int k = 9; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = FromHex("00689918DBEC7E5A0DD6DFC0AA55C7"); + BigInteger b = FromHex("0095E9A9EC9B297BD4BF36E059184F"); + byte[] S = Hex.Decode("10C0FB15760860DEF1EEF4D696E676875615175D"); + BigInteger n = FromHex("010000000000000108789B2496AF93"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "01A57A6A7B26CA5EF52FCDB8164797" + + "00B3ADC94ED1FE674C06E695BABA1D")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect131r1 + */ + internal class Sect131r1Holder + : X9ECParametersHolder + { + private Sect131r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect131r1Holder(); + + private const int m = 131; + private const int k1 = 2; + private const int k2 = 3; + private const int k3 = 8; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = FromHex("07A11B09A76B562144418FF3FF8C2570B8"); + BigInteger b = FromHex("0217C05610884B63B9C6C7291678F9D341"); + byte[] S = Hex.Decode("4D696E676875615175985BD3ADBADA21B43A97E2"); + BigInteger n = FromHex("0400000000000000023123953A9464B54D"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0081BAF91FDF9833C40F9C181343638399" + + "078C6E7EA38C001F73C8134B1B4EF9E150")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect131r2 + */ + internal class Sect131r2Holder + : X9ECParametersHolder + { + private Sect131r2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect131r2Holder(); + + private const int m = 131; + private const int k1 = 2; + private const int k2 = 3; + private const int k3 = 8; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = FromHex("03E5A88919D7CAFCBF415F07C2176573B2"); + BigInteger b = FromHex("04B8266A46C55657AC734CE38F018F2192"); + byte[] S = Hex.Decode("985BD3ADBAD4D696E676875615175A21B43A97E3"); + BigInteger n = FromHex("0400000000000000016954A233049BA98F"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0356DCD8F2F95031AD652D23951BB366A8" + + "0648F06D867940A5366D9E265DE9EB240F")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect163k1 + */ + internal class Sect163k1Holder + : X9ECParametersHolder + { + private Sect163k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect163k1Holder(); + + private const int m = 163; + private const int k1 = 3; + private const int k2 = 6; + private const int k3 = 7; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.One; + BigInteger b = BigInteger.One; + byte[] S = null; + BigInteger n = FromHex("04000000000000000000020108A2E0CC0D99F8A5EF"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8" + + "0289070FB05D38FF58321F2E800536D538CCDAA3D9")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect163r1 + */ + internal class Sect163r1Holder + : X9ECParametersHolder + { + private Sect163r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect163r1Holder(); + + private const int m = 163; + private const int k1 = 3; + private const int k2 = 6; + private const int k3 = 7; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = FromHex("07B6882CAAEFA84F9554FF8428BD88E246D2782AE2"); + BigInteger b = FromHex("0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9"); + byte[] S = Hex.Decode("24B7B137C8A14D696E6768756151756FD0DA2E5C"); + BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0369979697AB43897789566789567F787A7876A654" + + "00435EDB42EFAFB2989D51FEFCE3C80988F41FF883")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect163r2 + */ + internal class Sect163r2Holder + : X9ECParametersHolder + { + private Sect163r2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect163r2Holder(); + + private const int m = 163; + private const int k1 = 3; + private const int k2 = 6; + private const int k3 = 7; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.One; + BigInteger b = FromHex("020A601907B8C953CA1481EB10512F78744A3205FD"); + byte[] S = Hex.Decode("85E25BFE5C86226CDB12016F7553F9D0E693A268"); + BigInteger n = FromHex("040000000000000000000292FE77E70C12A4234C33"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "03F0EBA16286A2D57EA0991168D4994637E8343E36" + + "00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect193r1 + */ + internal class Sect193r1Holder + : X9ECParametersHolder + { + private Sect193r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect193r1Holder(); + + private const int m = 193; + private const int k = 15; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = FromHex("0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01"); + BigInteger b = FromHex("00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814"); + byte[] S = Hex.Decode("103FAEC74D696E676875615175777FC5B191EF30"); + BigInteger n = FromHex("01000000000000000000000000C7F34A778F443ACC920EBA49"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1" + + "0025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect193r2 + */ + internal class Sect193r2Holder + : X9ECParametersHolder + { + private Sect193r2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect193r2Holder(); + + private const int m = 193; + private const int k = 15; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = FromHex("0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B"); + BigInteger b = FromHex("00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE"); + byte[] S = Hex.Decode("10B7B4D696E676875615175137C8A16FD0DA2211"); + BigInteger n = FromHex("010000000000000000000000015AAB561B005413CCD4EE99D5"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F" + + "01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect233k1 + */ + internal class Sect233k1Holder + : X9ECParametersHolder + { + private Sect233k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect233k1Holder(); + + private const int m = 233; + private const int k = 74; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.Zero; + BigInteger b = BigInteger.One; + byte[] S = null; + BigInteger n = FromHex("8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF"); + BigInteger h = BigInteger.ValueOf(4); + + ECCurve curve = new F2mCurve(m, k, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126" + + "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect233r1 + */ + internal class Sect233r1Holder + : X9ECParametersHolder + { + private Sect233r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect233r1Holder(); + + private const int m = 233; + private const int k = 74; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.One; + BigInteger b = FromHex("0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD"); + byte[] S = Hex.Decode("74D59FF07F6B413D0EA14B344B20A2DB049B50C3"); + BigInteger n = FromHex("01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B" + + "01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect239k1 + */ + internal class Sect239k1Holder + : X9ECParametersHolder + { + private Sect239k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect239k1Holder(); + + private const int m = 239; + private const int k = 158; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.Zero; + BigInteger b = BigInteger.One; + byte[] S = null; + BigInteger n = FromHex("2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5"); + BigInteger h = BigInteger.ValueOf(4); + + ECCurve curve = new F2mCurve(m, k, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC" + + "76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect283k1 + */ + internal class Sect283k1Holder + : X9ECParametersHolder + { + private Sect283k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect283k1Holder(); + + private const int m = 283; + private const int k1 = 5; + private const int k2 = 7; + private const int k3 = 12; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.Zero; + BigInteger b = BigInteger.One; + byte[] S = null; + BigInteger n = FromHex("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61"); + BigInteger h = BigInteger.ValueOf(4); + + ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836" + + "01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect283r1 + */ + internal class Sect283r1Holder + : X9ECParametersHolder + { + private Sect283r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect283r1Holder(); + + private const int m = 283; + private const int k1 = 5; + private const int k2 = 7; + private const int k3 = 12; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.One; + BigInteger b = FromHex("027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5"); + byte[] S = Hex.Decode("77E2B07370EB0F832A6DD5B62DFC88CD06BB84BE"); + BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053" + + "03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect409k1 + */ + internal class Sect409k1Holder + : X9ECParametersHolder + { + private Sect409k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect409k1Holder(); + + private const int m = 409; + private const int k = 87; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.Zero; + BigInteger b = BigInteger.One; + byte[] S = null; + BigInteger n = FromHex("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF"); + BigInteger h = BigInteger.ValueOf(4); + + ECCurve curve = new F2mCurve(m, k, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746" + + "01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect409r1 + */ + internal class Sect409r1Holder + : X9ECParametersHolder + { + private Sect409r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect409r1Holder(); + + private const int m = 409; + private const int k = 87; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.One; + BigInteger b = FromHex("0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F"); + byte[] S = Hex.Decode("4099B5A457F9D69F79213D094C4BCD4D4262210B"); + BigInteger n = FromHex("010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7" + + "0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect571k1 + */ + internal class Sect571k1Holder + : X9ECParametersHolder + { + private Sect571k1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect571k1Holder(); + + private const int m = 571; + private const int k1 = 2; + private const int k2 = 5; + private const int k3 = 10; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.Zero; + BigInteger b = BigInteger.One; + byte[] S = null; + BigInteger n = FromHex("020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001"); + BigInteger h = BigInteger.ValueOf(4); + + ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972" + + "0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + /* + * sect571r1 + */ + internal class Sect571r1Holder + : X9ECParametersHolder + { + private Sect571r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Sect571r1Holder(); + + private const int m = 571; + private const int k1 = 2; + private const int k2 = 5; + private const int k3 = 10; + + protected override X9ECParameters CreateParameters() + { + BigInteger a = BigInteger.One; + BigInteger b = FromHex("02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A"); + byte[] S = Hex.Decode("2AA058F73A0E33AB486B0F610410C53A7F132310"); + BigInteger n = FromHex("03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47"); + BigInteger h = BigInteger.ValueOf(2); + + ECCurve curve = new F2mCurve(m, k1, k2, k3, a, b, n, h); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19" + + "037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B")); + + return new X9ECParameters(curve, G, n, h, S); + } + } + + + private static readonly IDictionary objIds = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary curves = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary names = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + private static void DefineCurve( + string name, + DerObjectIdentifier oid, + X9ECParametersHolder holder) + { + objIds.Add(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name), oid); + names.Add(oid, name); + curves.Add(oid, holder); + } + + static SecNamedCurves() + { + DefineCurve("secp112r1", SecObjectIdentifiers.SecP112r1, Secp112r1Holder.Instance); + DefineCurve("secp112r2", SecObjectIdentifiers.SecP112r2, Secp112r2Holder.Instance); + DefineCurve("secp128r1", SecObjectIdentifiers.SecP128r1, Secp128r1Holder.Instance); + DefineCurve("secp128r2", SecObjectIdentifiers.SecP128r2, Secp128r2Holder.Instance); + DefineCurve("secp160k1", SecObjectIdentifiers.SecP160k1, Secp160k1Holder.Instance); + DefineCurve("secp160r1", SecObjectIdentifiers.SecP160r1, Secp160r1Holder.Instance); + DefineCurve("secp160r2", SecObjectIdentifiers.SecP160r2, Secp160r2Holder.Instance); + DefineCurve("secp192k1", SecObjectIdentifiers.SecP192k1, Secp192k1Holder.Instance); + DefineCurve("secp192r1", SecObjectIdentifiers.SecP192r1, Secp192r1Holder.Instance); + DefineCurve("secp224k1", SecObjectIdentifiers.SecP224k1, Secp224k1Holder.Instance); + DefineCurve("secp224r1", SecObjectIdentifiers.SecP224r1, Secp224r1Holder.Instance); + DefineCurve("secp256k1", SecObjectIdentifiers.SecP256k1, Secp256k1Holder.Instance); + DefineCurve("secp256r1", SecObjectIdentifiers.SecP256r1, Secp256r1Holder.Instance); + DefineCurve("secp384r1", SecObjectIdentifiers.SecP384r1, Secp384r1Holder.Instance); + DefineCurve("secp521r1", SecObjectIdentifiers.SecP521r1, Secp521r1Holder.Instance); + + DefineCurve("sect113r1", SecObjectIdentifiers.SecT113r1, Sect113r1Holder.Instance); + DefineCurve("sect113r2", SecObjectIdentifiers.SecT113r2, Sect113r2Holder.Instance); + DefineCurve("sect131r1", SecObjectIdentifiers.SecT131r1, Sect131r1Holder.Instance); + DefineCurve("sect131r2", SecObjectIdentifiers.SecT131r2, Sect131r2Holder.Instance); + DefineCurve("sect163k1", SecObjectIdentifiers.SecT163k1, Sect163k1Holder.Instance); + DefineCurve("sect163r1", SecObjectIdentifiers.SecT163r1, Sect163r1Holder.Instance); + DefineCurve("sect163r2", SecObjectIdentifiers.SecT163r2, Sect163r2Holder.Instance); + DefineCurve("sect193r1", SecObjectIdentifiers.SecT193r1, Sect193r1Holder.Instance); + DefineCurve("sect193r2", SecObjectIdentifiers.SecT193r2, Sect193r2Holder.Instance); + DefineCurve("sect233k1", SecObjectIdentifiers.SecT233k1, Sect233k1Holder.Instance); + DefineCurve("sect233r1", SecObjectIdentifiers.SecT233r1, Sect233r1Holder.Instance); + DefineCurve("sect239k1", SecObjectIdentifiers.SecT239k1, Sect239k1Holder.Instance); + DefineCurve("sect283k1", SecObjectIdentifiers.SecT283k1, Sect283k1Holder.Instance); + DefineCurve("sect283r1", SecObjectIdentifiers.SecT283r1, Sect283r1Holder.Instance); + DefineCurve("sect409k1", SecObjectIdentifiers.SecT409k1, Sect409k1Holder.Instance); + DefineCurve("sect409r1", SecObjectIdentifiers.SecT409r1, Sect409r1Holder.Instance); + DefineCurve("sect571k1", SecObjectIdentifiers.SecT571k1, Sect571k1Holder.Instance); + DefineCurve("sect571r1", SecObjectIdentifiers.SecT571r1, Sect571r1Holder.Instance); + } + + public static X9ECParameters GetByName( + string name) + { + DerObjectIdentifier oid = GetOid(name); + return oid == null ? null : GetByOid(oid); + } + + /** + * return the X9ECParameters object for the named curve represented by + * the passed in object identifier. Null if the curve isn't present. + * + * @param oid an object identifier representing a named curve, if present. + */ + public static X9ECParameters GetByOid( + DerObjectIdentifier oid) + { + X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid]; + return holder == null ? null : holder.Parameters; + } + + /** + * return the object identifier signified by the passed in name. Null + * if there is no object identifier associated with name. + * + * @return the object identifier associated with name, if present. + */ + public static DerObjectIdentifier GetOid( + string name) + { + return (DerObjectIdentifier)objIds[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name)]; + } + + /** + * return the named curve name represented by the given object identifier. + */ + public static string GetName( + DerObjectIdentifier oid) + { + return (string)names[oid]; + } + + /** + * returns an enumeration containing the name strings for curves + * contained in this structure. + */ + public static IEnumerable Names + { + get { return new EnumerableProxy(names.Values); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECNamedCurves.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECNamedCurves.cs.meta new file mode 100644 index 00000000..4db17a99 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECNamedCurves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aedfafe74a7ae674e921b71e86371006 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECObjectIdentifiers.cs new file mode 100644 index 00000000..2d9a37c2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECObjectIdentifiers.cs @@ -0,0 +1,56 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec +{ + public abstract class SecObjectIdentifiers + { + /** + * EllipticCurve OBJECT IDENTIFIER ::= { + * iso(1) identified-organization(3) certicom(132) curve(0) + * } + */ + public static readonly DerObjectIdentifier EllipticCurve = new DerObjectIdentifier("1.3.132.0"); + + public static readonly DerObjectIdentifier SecT163k1 = new DerObjectIdentifier(EllipticCurve + ".1"); + public static readonly DerObjectIdentifier SecT163r1 = new DerObjectIdentifier(EllipticCurve + ".2"); + public static readonly DerObjectIdentifier SecT239k1 = new DerObjectIdentifier(EllipticCurve + ".3"); + public static readonly DerObjectIdentifier SecT113r1 = new DerObjectIdentifier(EllipticCurve + ".4"); + public static readonly DerObjectIdentifier SecT113r2 = new DerObjectIdentifier(EllipticCurve + ".5"); + public static readonly DerObjectIdentifier SecP112r1 = new DerObjectIdentifier(EllipticCurve + ".6"); + public static readonly DerObjectIdentifier SecP112r2 = new DerObjectIdentifier(EllipticCurve + ".7"); + public static readonly DerObjectIdentifier SecP160r1 = new DerObjectIdentifier(EllipticCurve + ".8"); + public static readonly DerObjectIdentifier SecP160k1 = new DerObjectIdentifier(EllipticCurve + ".9"); + public static readonly DerObjectIdentifier SecP256k1 = new DerObjectIdentifier(EllipticCurve + ".10"); + public static readonly DerObjectIdentifier SecT163r2 = new DerObjectIdentifier(EllipticCurve + ".15"); + public static readonly DerObjectIdentifier SecT283k1 = new DerObjectIdentifier(EllipticCurve + ".16"); + public static readonly DerObjectIdentifier SecT283r1 = new DerObjectIdentifier(EllipticCurve + ".17"); + public static readonly DerObjectIdentifier SecT131r1 = new DerObjectIdentifier(EllipticCurve + ".22"); + public static readonly DerObjectIdentifier SecT131r2 = new DerObjectIdentifier(EllipticCurve + ".23"); + public static readonly DerObjectIdentifier SecT193r1 = new DerObjectIdentifier(EllipticCurve + ".24"); + public static readonly DerObjectIdentifier SecT193r2 = new DerObjectIdentifier(EllipticCurve + ".25"); + public static readonly DerObjectIdentifier SecT233k1 = new DerObjectIdentifier(EllipticCurve + ".26"); + public static readonly DerObjectIdentifier SecT233r1 = new DerObjectIdentifier(EllipticCurve + ".27"); + public static readonly DerObjectIdentifier SecP128r1 = new DerObjectIdentifier(EllipticCurve + ".28"); + public static readonly DerObjectIdentifier SecP128r2 = new DerObjectIdentifier(EllipticCurve + ".29"); + public static readonly DerObjectIdentifier SecP160r2 = new DerObjectIdentifier(EllipticCurve + ".30"); + public static readonly DerObjectIdentifier SecP192k1 = new DerObjectIdentifier(EllipticCurve + ".31"); + public static readonly DerObjectIdentifier SecP224k1 = new DerObjectIdentifier(EllipticCurve + ".32"); + public static readonly DerObjectIdentifier SecP224r1 = new DerObjectIdentifier(EllipticCurve + ".33"); + public static readonly DerObjectIdentifier SecP384r1 = new DerObjectIdentifier(EllipticCurve + ".34"); + public static readonly DerObjectIdentifier SecP521r1 = new DerObjectIdentifier(EllipticCurve + ".35"); + public static readonly DerObjectIdentifier SecT409k1 = new DerObjectIdentifier(EllipticCurve + ".36"); + public static readonly DerObjectIdentifier SecT409r1 = new DerObjectIdentifier(EllipticCurve + ".37"); + public static readonly DerObjectIdentifier SecT571k1 = new DerObjectIdentifier(EllipticCurve + ".38"); + public static readonly DerObjectIdentifier SecT571r1 = new DerObjectIdentifier(EllipticCurve + ".39"); + + public static readonly DerObjectIdentifier SecP192r1 = X9ObjectIdentifiers.Prime192v1; + public static readonly DerObjectIdentifier SecP256r1 = X9ObjectIdentifiers.Prime256v1; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECObjectIdentifiers.cs.meta new file mode 100644 index 00000000..5f01bb0e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/sec/SECObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 76a08db15fb9c8c4b9dd62f83a1de3fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime.meta new file mode 100644 index 00000000..8bcb7bd6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9e13e45a04503de4f9338df3df0bc63d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEAttributes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEAttributes.cs new file mode 100644 index 00000000..86b88ddf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEAttributes.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Smime +{ + public abstract class SmimeAttributes + { + public static readonly DerObjectIdentifier SmimeCapabilities = PkcsObjectIdentifiers.Pkcs9AtSmimeCapabilities; + public static readonly DerObjectIdentifier EncrypKeyPref = PkcsObjectIdentifiers.IdAAEncrypKeyPref; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEAttributes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEAttributes.cs.meta new file mode 100644 index 00000000..d3d18e59 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 618d879528bc1f34f88316ac7ef6f9e7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilities.cs new file mode 100644 index 00000000..ff471836 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilities.cs @@ -0,0 +1,138 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Smime +{ + /** + * Handler class for dealing with S/MIME Capabilities + */ + public class SmimeCapabilities + : Asn1Encodable + { + /** + * general preferences + */ + public static readonly DerObjectIdentifier PreferSignedData = PkcsObjectIdentifiers.PreferSignedData; + public static readonly DerObjectIdentifier CannotDecryptAny = PkcsObjectIdentifiers.CannotDecryptAny; + public static readonly DerObjectIdentifier SmimeCapabilitesVersions = PkcsObjectIdentifiers.SmimeCapabilitiesVersions; + + /** + * encryption algorithms preferences + */ + public static readonly DerObjectIdentifier Aes256Cbc = NistObjectIdentifiers.IdAes256Cbc; + public static readonly DerObjectIdentifier Aes192Cbc = NistObjectIdentifiers.IdAes192Cbc; + public static readonly DerObjectIdentifier Aes128Cbc = NistObjectIdentifiers.IdAes128Cbc; + public static readonly DerObjectIdentifier IdeaCbc = new DerObjectIdentifier("1.3.6.1.4.1.188.7.1.1.2"); + public static readonly DerObjectIdentifier Cast5Cbc = new DerObjectIdentifier("1.2.840.113533.7.66.10"); + public static readonly DerObjectIdentifier DesCbc = new DerObjectIdentifier("1.3.14.3.2.7"); + public static readonly DerObjectIdentifier DesEde3Cbc = PkcsObjectIdentifiers.DesEde3Cbc; + public static readonly DerObjectIdentifier RC2Cbc = PkcsObjectIdentifiers.RC2Cbc; + + private Asn1Sequence capabilities; + + /** + * return an Attr object from the given object. + * + * @param o the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static SmimeCapabilities GetInstance( + object obj) + { + if (obj == null || obj is SmimeCapabilities) + { + return (SmimeCapabilities) obj; + } + + if (obj is Asn1Sequence) + { + return new SmimeCapabilities((Asn1Sequence) obj); + } + + if (obj is AttributeX509) + { + return new SmimeCapabilities( + (Asn1Sequence)(((AttributeX509) obj).AttrValues[0])); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public SmimeCapabilities( + Asn1Sequence seq) + { + capabilities = seq; + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete("Use 'GetCapabilitiesForOid' instead")] + public ArrayList GetCapabilities( + DerObjectIdentifier capability) + { + ArrayList list = new ArrayList(); + DoGetCapabilitiesForOid(capability, list); + return list; + } +#endif + + /** + * returns an ArrayList with 0 or more objects of all the capabilities + * matching the passed in capability Oid. If the Oid passed is null the + * entire set is returned. + */ + public IList GetCapabilitiesForOid( + DerObjectIdentifier capability) + { + IList list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + DoGetCapabilitiesForOid(capability, list); + return list; + } + + private void DoGetCapabilitiesForOid(DerObjectIdentifier capability, IList list) + { + if (capability == null) + { + foreach (object o in capabilities) + { + SmimeCapability cap = SmimeCapability.GetInstance(o); + + list.Add(cap); + } + } + else + { + foreach (object o in capabilities) + { + SmimeCapability cap = SmimeCapability.GetInstance(o); + + if (capability.Equals(cap.CapabilityID)) + { + list.Add(cap); + } + } + } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * SMIMECapabilities ::= Sequence OF SMIMECapability
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return capabilities; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilities.cs.meta new file mode 100644 index 00000000..667a01e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ffd2e8259df59b9469711dc167c1a9d3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilitiesAttribute.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilitiesAttribute.cs new file mode 100644 index 00000000..02fca593 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilitiesAttribute.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Smime +{ + public class SmimeCapabilitiesAttribute + : AttributeX509 + { + public SmimeCapabilitiesAttribute( + SmimeCapabilityVector capabilities) + : base(SmimeAttributes.SmimeCapabilities, + new DerSet(new DerSequence(capabilities.ToAsn1EncodableVector()))) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilitiesAttribute.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilitiesAttribute.cs.meta new file mode 100644 index 00000000..b4ab5c0d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilitiesAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56df916a3b62f584dafc0167c35fe71c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapability.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapability.cs new file mode 100644 index 00000000..330b8fce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapability.cs @@ -0,0 +1,105 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Smime +{ + public class SmimeCapability + : Asn1Encodable + { + /** + * general preferences + */ + public static readonly DerObjectIdentifier PreferSignedData = PkcsObjectIdentifiers.PreferSignedData; + public static readonly DerObjectIdentifier CannotDecryptAny = PkcsObjectIdentifiers.CannotDecryptAny; + public static readonly DerObjectIdentifier SmimeCapabilitiesVersions = PkcsObjectIdentifiers.SmimeCapabilitiesVersions; + + /** + * encryption algorithms preferences + */ + public static readonly DerObjectIdentifier DesCbc = new DerObjectIdentifier("1.3.14.3.2.7"); + public static readonly DerObjectIdentifier DesEde3Cbc = PkcsObjectIdentifiers.DesEde3Cbc; + public static readonly DerObjectIdentifier RC2Cbc = PkcsObjectIdentifiers.RC2Cbc; + + private DerObjectIdentifier capabilityID; + private Asn1Object parameters; + + public SmimeCapability( + Asn1Sequence seq) + { + capabilityID = (DerObjectIdentifier) seq[0].ToAsn1Object(); + + if (seq.Count > 1) + { + parameters = seq[1].ToAsn1Object(); + } + } + + public SmimeCapability( + DerObjectIdentifier capabilityID, + Asn1Encodable parameters) + { + if (capabilityID == null) + throw new ArgumentNullException("capabilityID"); + + this.capabilityID = capabilityID; + + if (parameters != null) + { + this.parameters = parameters.ToAsn1Object(); + } + } + + public static SmimeCapability GetInstance( + object obj) + { + if (obj == null || obj is SmimeCapability) + { + return (SmimeCapability) obj; + } + + if (obj is Asn1Sequence) + { + return new SmimeCapability((Asn1Sequence) obj); + } + + throw new ArgumentException("Invalid SmimeCapability"); + } + + public DerObjectIdentifier CapabilityID + { + get { return capabilityID; } + } + + public Asn1Object Parameters + { + get { return parameters; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * SMIMECapability ::= Sequence {
+         *     capabilityID OBJECT IDENTIFIER,
+         *     parameters ANY DEFINED BY capabilityID OPTIONAL
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(capabilityID); + + if (parameters != null) + { + v.Add(parameters); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapability.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapability.cs.meta new file mode 100644 index 00000000..54eb55d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapability.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 793064d3349c4ab49839801723352783 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilityVector.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilityVector.cs new file mode 100644 index 00000000..789f7d4d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilityVector.cs @@ -0,0 +1,41 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Smime +{ + /** + * Handler for creating a vector S/MIME Capabilities + */ + public class SmimeCapabilityVector + { + private readonly Asn1EncodableVector capabilities = new Asn1EncodableVector(); + + public void AddCapability( + DerObjectIdentifier capability) + { + capabilities.Add(new DerSequence(capability)); + } + + public void AddCapability( + DerObjectIdentifier capability, + int value) + { + capabilities.Add(new DerSequence(capability, new DerInteger(value))); + } + + public void AddCapability( + DerObjectIdentifier capability, + Asn1Encodable parameters) + { + capabilities.Add(new DerSequence(capability, parameters)); + } + + public Asn1EncodableVector ToAsn1EncodableVector() + { + return capabilities; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilityVector.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilityVector.cs.meta new file mode 100644 index 00000000..e995b6d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMECapabilityVector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 276533a04a388f24b8e12af192913d72 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEEncryptionKeyPreferenceAttribute.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEEncryptionKeyPreferenceAttribute.cs new file mode 100644 index 00000000..acec063e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEEncryptionKeyPreferenceAttribute.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Smime +{ + /** + * The SmimeEncryptionKeyPreference object. + *
+     * SmimeEncryptionKeyPreference ::= CHOICE {
+     *     issuerAndSerialNumber   [0] IssuerAndSerialNumber,
+     *     receipentKeyId          [1] RecipientKeyIdentifier,
+     *     subjectAltKeyIdentifier [2] SubjectKeyIdentifier
+     * }
+     * 
+ */ + public class SmimeEncryptionKeyPreferenceAttribute + : AttributeX509 + { + public SmimeEncryptionKeyPreferenceAttribute( + IssuerAndSerialNumber issAndSer) + : base(SmimeAttributes.EncrypKeyPref, + new DerSet(new DerTaggedObject(false, 0, issAndSer))) + { + } + + public SmimeEncryptionKeyPreferenceAttribute( + RecipientKeyIdentifier rKeyID) + : base(SmimeAttributes.EncrypKeyPref, + new DerSet(new DerTaggedObject(false, 1, rKeyID))) + { + } + + /** + * @param sKeyId the subjectKeyIdentifier value (normally the X.509 one) + */ + public SmimeEncryptionKeyPreferenceAttribute( + Asn1OctetString sKeyID) + : base(SmimeAttributes.EncrypKeyPref, + new DerSet(new DerTaggedObject(false, 2, sKeyID))) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEEncryptionKeyPreferenceAttribute.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEEncryptionKeyPreferenceAttribute.cs.meta new file mode 100644 index 00000000..a695f4f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/smime/SMIMEEncryptionKeyPreferenceAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 943827e6b6fc4dc42867c76471818998 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust.meta new file mode 100644 index 00000000..4c3e0c37 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b40fe8af30f4d1546857f2347f88102a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTNamedCurves.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTNamedCurves.cs new file mode 100644 index 00000000..a02653d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTNamedCurves.cs @@ -0,0 +1,474 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust +{ + /** + * elliptic curves defined in "ECC Brainpool Standard Curves and Curve Generation" + * http://www.ecc-brainpool.org/download/draft_pkix_additional_ecc_dp.txt + */ + public class TeleTrusTNamedCurves + { + private static ECCurve ConfigureCurve(ECCurve curve) + { + return curve; + } + + internal class BrainpoolP160r1Holder + : X9ECParametersHolder + { + private BrainpoolP160r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP160r1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("E95E4A5F737059DC60DF5991D45029409E60FC09", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + new BigInteger("E95E4A5F737059DC60DFC7AD95B3D8139515620F", 16), // q + new BigInteger("340E7BE2A280EB74E2BE61BADA745D97E8F7C300", 16), // a + new BigInteger("1E589A8595423412134FAA2DBDEC95C8D8675E58", 16), // b + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("04BED5AF16EA3F6A4F62938C4631EB5AF7BDBCDBC31667CB477A1A8EC338F94741669C976316DA6321")), // G + n, h); + } + } + + internal class BrainpoolP160t1Holder + : X9ECParametersHolder + { + private BrainpoolP160t1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP160t1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("E95E4A5F737059DC60DF5991D45029409E60FC09", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + // new BigInteger("24DBFF5DEC9B986BBFE5295A29BFBAE45E0F5D0B", 16), // Z + new BigInteger("E95E4A5F737059DC60DFC7AD95B3D8139515620F", 16), // q + new BigInteger("E95E4A5F737059DC60DFC7AD95B3D8139515620C", 16), // a' + new BigInteger("7A556B6DAE535B7B51ED2C4D7DAA7A0B5C55F380", 16), // b' + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("04B199B13B9B34EFC1397E64BAEB05ACC265FF2378ADD6718B7C7C1961F0991B842443772152C9E0AD")), // G + n, h); + } + } + + internal class BrainpoolP192r1Holder + : X9ECParametersHolder + { + private BrainpoolP192r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP192r1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + new BigInteger("C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297", 16), // q + new BigInteger("6A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF", 16), // a + new BigInteger("469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9", 16), // b + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("04C0A0647EAAB6A48753B033C56CB0F0900A2F5C4853375FD614B690866ABD5BB88B5F4828C1490002E6773FA2FA299B8F")), // G + n, h); + } + } + + internal class BrainpoolP192t1Holder + : X9ECParametersHolder + { + private BrainpoolP192t1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP192t1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + //new BigInteger("1B6F5CC8DB4DC7AF19458A9CB80DC2295E5EB9C3732104CB") //Z + new BigInteger("C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297", 16), // q + new BigInteger("C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86294", 16), // a' + new BigInteger("13D56FFAEC78681E68F9DEB43B35BEC2FB68542E27897B79", 16), // b' + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("043AE9E58C82F63C30282E1FE7BBF43FA72C446AF6F4618129097E2C5667C2223A902AB5CA449D0084B7E5B3DE7CCC01C9")), // G' + n, h); + } + } + + internal class BrainpoolP224r1Holder + : X9ECParametersHolder + { + private BrainpoolP224r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP224r1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + new BigInteger("D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF", 16), // q + new BigInteger("68A5E62CA9CE6C1C299803A6C1530B514E182AD8B0042A59CAD29F43", 16), // a + new BigInteger("2580F63CCFE44138870713B1A92369E33E2135D266DBB372386C400B", 16), // b + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("040D9029AD2C7E5CF4340823B2A87DC68C9E4CE3174C1E6EFDEE12C07D58AA56F772C0726F24C6B89E4ECDAC24354B9E99CAA3F6D3761402CD")), // G + n, h); + } + } + + internal class BrainpoolP224t1Holder + : X9ECParametersHolder + { + private BrainpoolP224t1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP224t1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + //new BigInteger("2DF271E14427A346910CF7A2E6CFA7B3F484E5C2CCE1C8B730E28B3F") //Z + new BigInteger("D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF", 16), // q + new BigInteger("D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FC", 16), // a' + new BigInteger("4B337D934104CD7BEF271BF60CED1ED20DA14C08B3BB64F18A60888D", 16), // b' + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("046AB1E344CE25FF3896424E7FFE14762ECB49F8928AC0C76029B4D5800374E9F5143E568CD23F3F4D7C0D4B1E41C8CC0D1C6ABD5F1A46DB4C")), // G' + n, h); + } + } + + internal class BrainpoolP256r1Holder + : X9ECParametersHolder + { + private BrainpoolP256r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP256r1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + new BigInteger("A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", 16), // q + new BigInteger("7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", 16), // a + new BigInteger("26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", 16), // b + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("048BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997")), // G + n, h); + } + } + + internal class BrainpoolP256t1Holder + : X9ECParametersHolder + { + private BrainpoolP256t1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP256t1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + //new BigInteger("3E2D4BD9597B58639AE7AA669CAB9837CF5CF20A2C852D10F655668DFC150EF0") //Z + new BigInteger("A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", 16), // q + new BigInteger("A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5374", 16), // a' + new BigInteger("662C61C430D84EA4FE66A7733D0B76B7BF93EBC4AF2F49256AE58101FEE92B04", 16), // b' + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("04A3E8EB3CC1CFE7B7732213B23A656149AFA142C47AAFBC2B79A191562E1305F42D996C823439C56D7F7B22E14644417E69BCB6DE39D027001DABE8F35B25C9BE")), // G' + n, h); + } + } + + internal class BrainpoolP320r1Holder + : X9ECParametersHolder + { + private BrainpoolP320r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP320r1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + new BigInteger("D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27", 16), // q + new BigInteger("3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F492F375A97D860EB4", 16), // a + new BigInteger("520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD884539816F5EB4AC8FB1F1A6", 16), // b + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("0443BD7E9AFB53D8B85289BCC48EE5BFE6F20137D10A087EB6E7871E2A10A599C710AF8D0D39E2061114FDD05545EC1CC8AB4093247F77275E0743FFED117182EAA9C77877AAAC6AC7D35245D1692E8EE1")), // G + n, h); + } + } + + internal class BrainpoolP320t1Holder + : X9ECParametersHolder + { + private BrainpoolP320t1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP320t1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + //new BigInteger("15F75CAF668077F7E85B42EB01F0A81FF56ECD6191D55CB82B7D861458A18FEFC3E5AB7496F3C7B1") //Z + new BigInteger("D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27", 16), // q + new BigInteger("D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E24", 16), // a' + new BigInteger("A7F561E038EB1ED560B3D147DB782013064C19F27ED27C6780AAF77FB8A547CEB5B4FEF422340353", 16), // b' + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("04925BE9FB01AFC6FB4D3E7D4990010F813408AB106C4F09CB7EE07868CC136FFF3357F624A21BED5263BA3A7A27483EBF6671DBEF7ABB30EBEE084E58A0B077AD42A5A0989D1EE71B1B9BC0455FB0D2C3")), // G' + n, h); + } + } + + internal class BrainpoolP384r1Holder + : X9ECParametersHolder + { + private BrainpoolP384r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP384r1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + new BigInteger("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", 16), // q + new BigInteger("7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826", 16), // a + new BigInteger("4A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11", 16), // b + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("041D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315")), // G + n, h); + } + } + + internal class BrainpoolP384t1Holder + : X9ECParametersHolder + { + private BrainpoolP384t1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP384t1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + //new BigInteger("41DFE8DD399331F7166A66076734A89CD0D2BCDB7D068E44E1F378F41ECBAE97D2D63DBC87BCCDDCCC5DA39E8589291C") //Z + new BigInteger("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", 16), // q + new BigInteger("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC50", 16), // a' + new BigInteger("7F519EADA7BDA81BD826DBA647910F8C4B9346ED8CCDC64E4B1ABD11756DCE1D2074AA263B88805CED70355A33B471EE", 16), // b' + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("0418DE98B02DB9A306F2AFCD7235F72A819B80AB12EBD653172476FECD462AABFFC4FF191B946A5F54D8D0AA2F418808CC25AB056962D30651A114AFD2755AD336747F93475B7A1FCA3B88F2B6A208CCFE469408584DC2B2912675BF5B9E582928")), // G' + n, h); + } + } + + internal class BrainpoolP512r1Holder + : X9ECParametersHolder + { + private BrainpoolP512r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP512r1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + new BigInteger("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", 16), // q + new BigInteger("7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA", 16), // a + new BigInteger("3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723", 16), // b + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("0481AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F8227DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892")), // G + n, h); + } + } + + internal class BrainpoolP512t1Holder + : X9ECParametersHolder + { + private BrainpoolP512t1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new BrainpoolP512t1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", 16); + BigInteger h = new BigInteger("01", 16); + + ECCurve curve = ConfigureCurve(new FpCurve( + //new BigInteger("12EE58E6764838B69782136F0F2D3BA06E27695716054092E60A80BEDB212B64E585D90BCE13761F85C3F1D2A64E3BE8FEA2220F01EBA5EEB0F35DBD29D922AB") //Z + new BigInteger("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", 16), // q + new BigInteger("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F0", 16), // a' + new BigInteger("7CBBBCF9441CFAB76E1890E46884EAE321F70C0BCB4981527897504BEC3E36A62BCDFA2304976540F6450085F2DAE145C22553B465763689180EA2571867423E", 16), // b' + n, h)); + + return new X9ECParameters( + curve, + new X9ECPoint(curve, Hex.Decode("04640ECE5C12788717B9C1BA06CBC2A6FEBA85842458C56DDE9DB1758D39C0313D82BA51735CDB3EA499AA77A7D6943A64F7A3F25FE26F06B51BAA2696FA9035DA5B534BD595F5AF0FA2C892376C84ACE1BB4E3019B71634C01131159CAE03CEE9D9932184BEEF216BD71DF2DADF86A627306ECFF96DBB8BACE198B61E00F8B332")), // G' + n, h); + } + } + + + private static readonly IDictionary objIds = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary curves = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary names = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + private static void DefineCurve( + string name, + DerObjectIdentifier oid, + X9ECParametersHolder holder) + { + objIds.Add(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name), oid); + names.Add(oid, name); + curves.Add(oid, holder); + } + + static TeleTrusTNamedCurves() + { + DefineCurve("brainpoolP160r1", TeleTrusTObjectIdentifiers.BrainpoolP160R1, BrainpoolP160r1Holder.Instance); + DefineCurve("brainpoolP160t1", TeleTrusTObjectIdentifiers.BrainpoolP160T1, BrainpoolP160t1Holder.Instance); + DefineCurve("brainpoolP192r1", TeleTrusTObjectIdentifiers.BrainpoolP192R1, BrainpoolP192r1Holder.Instance); + DefineCurve("brainpoolP192t1", TeleTrusTObjectIdentifiers.BrainpoolP192T1, BrainpoolP192t1Holder.Instance); + DefineCurve("brainpoolP224r1", TeleTrusTObjectIdentifiers.BrainpoolP224R1, BrainpoolP224r1Holder.Instance); + DefineCurve("brainpoolP224t1", TeleTrusTObjectIdentifiers.BrainpoolP224T1, BrainpoolP224t1Holder.Instance); + DefineCurve("brainpoolP256r1", TeleTrusTObjectIdentifiers.BrainpoolP256R1, BrainpoolP256r1Holder.Instance); + DefineCurve("brainpoolP256t1", TeleTrusTObjectIdentifiers.BrainpoolP256T1, BrainpoolP256t1Holder.Instance); + DefineCurve("brainpoolP320r1", TeleTrusTObjectIdentifiers.BrainpoolP320R1, BrainpoolP320r1Holder.Instance); + DefineCurve("brainpoolP320t1", TeleTrusTObjectIdentifiers.BrainpoolP320T1, BrainpoolP320t1Holder.Instance); + DefineCurve("brainpoolP384r1", TeleTrusTObjectIdentifiers.BrainpoolP384R1, BrainpoolP384r1Holder.Instance); + DefineCurve("brainpoolP384t1", TeleTrusTObjectIdentifiers.BrainpoolP384T1, BrainpoolP384t1Holder.Instance); + DefineCurve("brainpoolP512r1", TeleTrusTObjectIdentifiers.BrainpoolP512R1, BrainpoolP512r1Holder.Instance); + DefineCurve("brainpoolP512t1", TeleTrusTObjectIdentifiers.BrainpoolP512T1, BrainpoolP512t1Holder.Instance); + } + + public static X9ECParameters GetByName( + string name) + { + DerObjectIdentifier oid = GetOid(name); + return oid == null ? null : GetByOid(oid); + } + + /** + * return the X9ECParameters object for the named curve represented by + * the passed in object identifier. Null if the curve isn't present. + * + * @param oid an object identifier representing a named curve, if present. + */ + public static X9ECParameters GetByOid( + DerObjectIdentifier oid) + { + X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid]; + return holder == null ? null : holder.Parameters; + } + + /** + * return the object identifier signified by the passed in name. Null + * if there is no object identifier associated with name. + * + * @return the object identifier associated with name, if present. + */ + public static DerObjectIdentifier GetOid( + string name) + { + return (DerObjectIdentifier)objIds[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name)]; + } + + /** + * return the named curve name represented by the given object identifier. + */ + public static string GetName( + DerObjectIdentifier oid) + { + return (string)names[oid]; + } + + /** + * returns an enumeration containing the name strings for curves + * contained in this structure. + */ + public static IEnumerable Names + { + get { return new EnumerableProxy(names.Values); } + } + + public static DerObjectIdentifier GetOid( + short curvesize, + bool twisted) + { + return GetOid("brainpoolP" + curvesize + (twisted ? "t" : "r") + "1"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTNamedCurves.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTNamedCurves.cs.meta new file mode 100644 index 00000000..19c11209 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTNamedCurves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0a21d207ece6f34bbc1b20fffaac190 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTObjectIdentifiers.cs new file mode 100644 index 00000000..9cd420f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTObjectIdentifiers.cs @@ -0,0 +1,49 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust +{ + public sealed class TeleTrusTObjectIdentifiers + { + private TeleTrusTObjectIdentifiers() + { + } + + public static readonly DerObjectIdentifier TeleTrusTAlgorithm = new DerObjectIdentifier("1.3.36.3"); + + public static readonly DerObjectIdentifier RipeMD160 = new DerObjectIdentifier(TeleTrusTAlgorithm + ".2.1"); + public static readonly DerObjectIdentifier RipeMD128 = new DerObjectIdentifier(TeleTrusTAlgorithm + ".2.2"); + public static readonly DerObjectIdentifier RipeMD256 = new DerObjectIdentifier(TeleTrusTAlgorithm + ".2.3"); + + public static readonly DerObjectIdentifier TeleTrusTRsaSignatureAlgorithm = new DerObjectIdentifier(TeleTrusTAlgorithm + ".3.1"); + + public static readonly DerObjectIdentifier RsaSignatureWithRipeMD160 = new DerObjectIdentifier(TeleTrusTRsaSignatureAlgorithm + ".2"); + public static readonly DerObjectIdentifier RsaSignatureWithRipeMD128 = new DerObjectIdentifier(TeleTrusTRsaSignatureAlgorithm + ".3"); + public static readonly DerObjectIdentifier RsaSignatureWithRipeMD256 = new DerObjectIdentifier(TeleTrusTRsaSignatureAlgorithm + ".4"); + + public static readonly DerObjectIdentifier ECSign = new DerObjectIdentifier(TeleTrusTAlgorithm + ".3.2"); + + public static readonly DerObjectIdentifier ECSignWithSha1 = new DerObjectIdentifier(ECSign + ".1"); + public static readonly DerObjectIdentifier ECSignWithRipeMD160 = new DerObjectIdentifier(ECSign + ".2"); + + public static readonly DerObjectIdentifier EccBrainpool = new DerObjectIdentifier(TeleTrusTAlgorithm + ".3.2.8"); + public static readonly DerObjectIdentifier EllipticCurve = new DerObjectIdentifier(EccBrainpool + ".1"); + public static readonly DerObjectIdentifier VersionOne = new DerObjectIdentifier(EllipticCurve + ".1"); + + public static readonly DerObjectIdentifier BrainpoolP160R1 = new DerObjectIdentifier(VersionOne + ".1"); + public static readonly DerObjectIdentifier BrainpoolP160T1 = new DerObjectIdentifier(VersionOne + ".2"); + public static readonly DerObjectIdentifier BrainpoolP192R1 = new DerObjectIdentifier(VersionOne + ".3"); + public static readonly DerObjectIdentifier BrainpoolP192T1 = new DerObjectIdentifier(VersionOne + ".4"); + public static readonly DerObjectIdentifier BrainpoolP224R1 = new DerObjectIdentifier(VersionOne + ".5"); + public static readonly DerObjectIdentifier BrainpoolP224T1 = new DerObjectIdentifier(VersionOne + ".6"); + public static readonly DerObjectIdentifier BrainpoolP256R1 = new DerObjectIdentifier(VersionOne + ".7"); + public static readonly DerObjectIdentifier BrainpoolP256T1 = new DerObjectIdentifier(VersionOne + ".8"); + public static readonly DerObjectIdentifier BrainpoolP320R1 = new DerObjectIdentifier(VersionOne + ".9"); + public static readonly DerObjectIdentifier BrainpoolP320T1 = new DerObjectIdentifier(VersionOne + ".10"); + public static readonly DerObjectIdentifier BrainpoolP384R1 = new DerObjectIdentifier(VersionOne + ".11"); + public static readonly DerObjectIdentifier BrainpoolP384T1 = new DerObjectIdentifier(VersionOne + ".12"); + public static readonly DerObjectIdentifier BrainpoolP512R1 = new DerObjectIdentifier(VersionOne + ".13"); + public static readonly DerObjectIdentifier BrainpoolP512T1 = new DerObjectIdentifier(VersionOne + ".14"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTObjectIdentifiers.cs.meta new file mode 100644 index 00000000..807ee86a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/teletrust/TeleTrusTObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2bcaf3493b261b3408acb0edd506fb5b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp.meta new file mode 100644 index 00000000..371b773c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3953c729f85a1e045892502d72f656f9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/Accuracy.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/Accuracy.cs new file mode 100644 index 00000000..5109875f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/Accuracy.cs @@ -0,0 +1,155 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp +{ + public class Accuracy + : Asn1Encodable + { + private readonly DerInteger seconds; + private readonly DerInteger millis; + private readonly DerInteger micros; + + // constants + protected const int MinMillis = 1; + protected const int MaxMillis = 999; + protected const int MinMicros = 1; + protected const int MaxMicros = 999; + + public Accuracy( + DerInteger seconds, + DerInteger millis, + DerInteger micros) + { + //Verifications + if (millis != null + && (millis.Value.IntValue < MinMillis + || millis.Value.IntValue > MaxMillis)) + { + throw new ArgumentException( + "Invalid millis field : not in (1..999)"); + } + + if (micros != null + && (micros.Value.IntValue < MinMicros + || micros.Value.IntValue > MaxMicros)) + { + throw new ArgumentException( + "Invalid micros field : not in (1..999)"); + } + + this.seconds = seconds; + this.millis = millis; + this.micros = micros; + } + + private Accuracy( + Asn1Sequence seq) + { + for (int i = 0; i < seq.Count; ++i) + { + // seconds + if (seq[i] is DerInteger) + { + seconds = (DerInteger) seq[i]; + } + else if (seq[i] is DerTaggedObject) + { + DerTaggedObject extra = (DerTaggedObject) seq[i]; + + switch (extra.TagNo) + { + case 0: + millis = DerInteger.GetInstance(extra, false); + if (millis.Value.IntValue < MinMillis + || millis.Value.IntValue > MaxMillis) + { + throw new ArgumentException( + "Invalid millis field : not in (1..999)."); + } + break; + case 1: + micros = DerInteger.GetInstance(extra, false); + if (micros.Value.IntValue < MinMicros + || micros.Value.IntValue > MaxMicros) + { + throw new ArgumentException( + "Invalid micros field : not in (1..999)."); + } + break; + default: + throw new ArgumentException("Invalig tag number"); + } + } + } + } + + public static Accuracy GetInstance( + object o) + { + if (o == null || o is Accuracy) + { + return (Accuracy) o; + } + + if (o is Asn1Sequence) + { + return new Accuracy((Asn1Sequence) o); + } + + throw new ArgumentException( + "Unknown object in 'Accuracy' factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + public DerInteger Seconds + { + get { return seconds; } + } + + public DerInteger Millis + { + get { return millis; } + } + + public DerInteger Micros + { + get { return micros; } + } + + /** + *
+		 * Accuracy ::= SEQUENCE {
+		 *             seconds        INTEGER              OPTIONAL,
+		 *             millis     [0] INTEGER  (1..999)    OPTIONAL,
+		 *             micros     [1] INTEGER  (1..999)    OPTIONAL
+		 *             }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (seconds != null) + { + v.Add(seconds); + } + + if (millis != null) + { + v.Add(new DerTaggedObject(false, 0, millis)); + } + + if (micros != null) + { + v.Add(new DerTaggedObject(false, 1, micros)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/Accuracy.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/Accuracy.cs.meta new file mode 100644 index 00000000..c4a84872 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/Accuracy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8961d826eed5f54ca3a63faccf46a7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/MessageImprint.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/MessageImprint.cs new file mode 100644 index 00000000..f0772b96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/MessageImprint.cs @@ -0,0 +1,79 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp +{ + public class MessageImprint + : Asn1Encodable + { + private readonly AlgorithmIdentifier hashAlgorithm; + private readonly byte[] hashedMessage; + + /** + * @param o + * @return a MessageImprint object. + */ + public static MessageImprint GetInstance( + object o) + { + if (o == null || o is MessageImprint) + { + return (MessageImprint) o; + } + + if (o is Asn1Sequence) + { + return new MessageImprint((Asn1Sequence) o); + } + + throw new ArgumentException( + "Unknown object in 'MessageImprint' factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + private MessageImprint( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + this.hashAlgorithm = AlgorithmIdentifier.GetInstance(seq[0]); + this.hashedMessage = Asn1OctetString.GetInstance(seq[1]).GetOctets(); + } + + public MessageImprint( + AlgorithmIdentifier hashAlgorithm, + byte[] hashedMessage) + { + this.hashAlgorithm = hashAlgorithm; + this.hashedMessage = hashedMessage; + } + + public AlgorithmIdentifier HashAlgorithm + { + get { return hashAlgorithm; } + } + + public byte[] GetHashedMessage() + { + return hashedMessage; + } + + /** + *
+		 *    MessageImprint ::= SEQUENCE  {
+		 *       hashAlgorithm                AlgorithmIdentifier,
+		 *       hashedMessage                OCTET STRING  }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(hashAlgorithm, new DerOctetString(hashedMessage)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/MessageImprint.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/MessageImprint.cs.meta new file mode 100644 index 00000000..fa90faf6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/MessageImprint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 835f6babba6da8b469b31289b68395ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TSTInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TSTInfo.cs new file mode 100644 index 00000000..65de2c4b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TSTInfo.cs @@ -0,0 +1,254 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp +{ + public class TstInfo + : Asn1Encodable + { + private readonly DerInteger version; + private readonly DerObjectIdentifier tsaPolicyId; + private readonly MessageImprint messageImprint; + private readonly DerInteger serialNumber; + private readonly DerGeneralizedTime genTime; + private readonly Accuracy accuracy; + private readonly DerBoolean ordering; + private readonly DerInteger nonce; + private readonly GeneralName tsa; + private readonly X509Extensions extensions; + + public static TstInfo GetInstance( + object o) + { + if (o == null || o is TstInfo) + { + return (TstInfo) o; + } + + if (o is Asn1Sequence) + { + return new TstInfo((Asn1Sequence) o); + } + + if (o is Asn1OctetString) + { + try + { + byte[] octets = ((Asn1OctetString)o).GetOctets(); + return GetInstance(Asn1Object.FromByteArray(octets)); + } + catch (IOException) + { + throw new ArgumentException( + "Bad object format in 'TstInfo' factory."); + } + } + + throw new ArgumentException( + "Unknown object in 'TstInfo' factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + private TstInfo( + Asn1Sequence seq) + { + IEnumerator e = seq.GetEnumerator(); + + // version + e.MoveNext(); + version = DerInteger.GetInstance(e.Current); + + // tsaPolicy + e.MoveNext(); + tsaPolicyId = DerObjectIdentifier.GetInstance(e.Current); + + // messageImprint + e.MoveNext(); + messageImprint = MessageImprint.GetInstance(e.Current); + + // serialNumber + e.MoveNext(); + serialNumber = DerInteger.GetInstance(e.Current); + + // genTime + e.MoveNext(); + genTime = DerGeneralizedTime.GetInstance(e.Current); + + // default for ordering + ordering = DerBoolean.False; + + while (e.MoveNext()) + { + Asn1Object o = (Asn1Object) e.Current; + + if (o is Asn1TaggedObject) + { + DerTaggedObject tagged = (DerTaggedObject) o; + + switch (tagged.TagNo) + { + case 0: + tsa = GeneralName.GetInstance(tagged, true); + break; + case 1: + extensions = X509Extensions.GetInstance(tagged, false); + break; + default: + throw new ArgumentException("Unknown tag value " + tagged.TagNo); + } + } + + if (o is DerSequence) + { + accuracy = Accuracy.GetInstance(o); + } + + if (o is DerBoolean) + { + ordering = DerBoolean.GetInstance(o); + } + + if (o is DerInteger) + { + nonce = DerInteger.GetInstance(o); + } + } + } + + public TstInfo( + DerObjectIdentifier tsaPolicyId, + MessageImprint messageImprint, + DerInteger serialNumber, + DerGeneralizedTime genTime, + Accuracy accuracy, + DerBoolean ordering, + DerInteger nonce, + GeneralName tsa, + X509Extensions extensions) + { + this.version = new DerInteger(1); + this.tsaPolicyId = tsaPolicyId; + this.messageImprint = messageImprint; + this.serialNumber = serialNumber; + this.genTime = genTime; + this.accuracy = accuracy; + this.ordering = ordering; + this.nonce = nonce; + this.tsa = tsa; + this.extensions = extensions; + } + + public DerInteger Version + { + get { return version; } + } + + public MessageImprint MessageImprint + { + get { return messageImprint; } + } + + public DerObjectIdentifier Policy + { + get { return tsaPolicyId; } + } + + public DerInteger SerialNumber + { + get { return serialNumber; } + } + + public Accuracy Accuracy + { + get { return accuracy; } + } + + public DerGeneralizedTime GenTime + { + get { return genTime; } + } + + public DerBoolean Ordering + { + get { return ordering; } + } + + public DerInteger Nonce + { + get { return nonce; } + } + + public GeneralName Tsa + { + get { return tsa; } + } + + public X509Extensions Extensions + { + get { return extensions; } + } + + /** + *
+		 *
+		 *     TstInfo ::= SEQUENCE  {
+		 *        version                      INTEGER  { v1(1) },
+		 *        policy                       TSAPolicyId,
+		 *        messageImprint               MessageImprint,
+		 *          -- MUST have the same value as the similar field in
+		 *          -- TimeStampReq
+		 *        serialNumber                 INTEGER,
+		 *         -- Time-Stamping users MUST be ready to accommodate integers
+		 *         -- up to 160 bits.
+		 *        genTime                      GeneralizedTime,
+		 *        accuracy                     Accuracy                 OPTIONAL,
+		 *        ordering                     BOOLEAN             DEFAULT FALSE,
+		 *        nonce                        INTEGER                  OPTIONAL,
+		 *          -- MUST be present if the similar field was present
+		 *          -- in TimeStampReq.  In that case it MUST have the same value.
+		 *        tsa                          [0] GeneralName          OPTIONAL,
+		 *        extensions                   [1] IMPLICIT Extensions   OPTIONAL  }
+		 *
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + version, tsaPolicyId, messageImprint, serialNumber, genTime); + + if (accuracy != null) + { + v.Add(accuracy); + } + + if (ordering != null && ordering.IsTrue) + { + v.Add(ordering); + } + + if (nonce != null) + { + v.Add(nonce); + } + + if (tsa != null) + { + v.Add(new DerTaggedObject(true, 0, tsa)); + } + + if (extensions != null) + { + v.Add(new DerTaggedObject(false, 1, extensions)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TSTInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TSTInfo.cs.meta new file mode 100644 index 00000000..4f68fe94 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TSTInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3322c001cd222c4098bc3985c447853 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampReq.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampReq.cs new file mode 100644 index 00000000..e6505392 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampReq.cs @@ -0,0 +1,169 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp +{ + public class TimeStampReq + : Asn1Encodable + { + private readonly DerInteger version; + private readonly MessageImprint messageImprint; + private readonly DerObjectIdentifier tsaPolicy; + private readonly DerInteger nonce; + private readonly DerBoolean certReq; + private readonly X509Extensions extensions; + + public static TimeStampReq GetInstance( + object o) + { + if (o == null || o is TimeStampReq) + { + return (TimeStampReq) o; + } + + if (o is Asn1Sequence) + { + return new TimeStampReq((Asn1Sequence) o); + } + + throw new ArgumentException( + "Unknown object in 'TimeStampReq' factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + private TimeStampReq( + Asn1Sequence seq) + { + int nbObjects = seq.Count; + int seqStart = 0; + + // version + version = DerInteger.GetInstance(seq[seqStart++]); + + // messageImprint + messageImprint = MessageImprint.GetInstance(seq[seqStart++]); + + for (int opt = seqStart; opt < nbObjects; opt++) + { + // tsaPolicy + if (seq[opt] is DerObjectIdentifier) + { + tsaPolicy = DerObjectIdentifier.GetInstance(seq[opt]); + } + // nonce + else if (seq[opt] is DerInteger) + { + nonce = DerInteger.GetInstance(seq[opt]); + } + // certReq + else if (seq[opt] is DerBoolean) + { + certReq = DerBoolean.GetInstance(seq[opt]); + } + // extensions + else if (seq[opt] is Asn1TaggedObject) + { + Asn1TaggedObject tagged = (Asn1TaggedObject) seq[opt]; + if (tagged.TagNo == 0) + { + extensions = X509Extensions.GetInstance(tagged, false); + } + } + } + } + + public TimeStampReq( + MessageImprint messageImprint, + DerObjectIdentifier tsaPolicy, + DerInteger nonce, + DerBoolean certReq, + X509Extensions extensions) + { + // default + this.version = new DerInteger(1); + + this.messageImprint = messageImprint; + this.tsaPolicy = tsaPolicy; + this.nonce = nonce; + this.certReq = certReq; + this.extensions = extensions; + } + + public DerInteger Version + { + get { return version; } + } + + public MessageImprint MessageImprint + { + get { return messageImprint; } + } + + public DerObjectIdentifier ReqPolicy + { + get { return tsaPolicy; } + } + + public DerInteger Nonce + { + get { return nonce; } + } + + public DerBoolean CertReq + { + get { return certReq; } + } + + public X509Extensions Extensions + { + get { return extensions; } + } + + /** + *
+		 * TimeStampReq ::= SEQUENCE  {
+		 *  version                      INTEGER  { v1(1) },
+		 *  messageImprint               MessageImprint,
+		 *    --a hash algorithm OID and the hash value of the data to be
+		 *    --time-stamped
+		 *  reqPolicy             TSAPolicyId              OPTIONAL,
+		 *  nonce                 INTEGER                  OPTIONAL,
+		 *  certReq               BOOLEAN                  DEFAULT FALSE,
+		 *  extensions            [0] IMPLICIT Extensions  OPTIONAL
+		 * }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + version, messageImprint); + + if (tsaPolicy != null) + { + v.Add(tsaPolicy); + } + + if (nonce != null) + { + v.Add(nonce); + } + + if (certReq != null && certReq.IsTrue) + { + v.Add(certReq); + } + + if (extensions != null) + { + v.Add(new DerTaggedObject(false, 0, extensions)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampReq.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampReq.cs.meta new file mode 100644 index 00000000..fa6aa908 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampReq.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31b5ae6dc42d4624cb6ccb943e16d0fd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampResp.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampResp.cs new file mode 100644 index 00000000..bc95e72b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampResp.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp +{ + public class TimeStampResp + : Asn1Encodable + { + private readonly PkiStatusInfo pkiStatusInfo; + private readonly ContentInfo timeStampToken; + + public static TimeStampResp GetInstance( + object o) + { + if (o == null || o is TimeStampResp) + { + return (TimeStampResp) o; + } + + if (o is Asn1Sequence) + { + return new TimeStampResp((Asn1Sequence) o); + } + + throw new ArgumentException( + "Unknown object in 'TimeStampResp' factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(o)); + } + + private TimeStampResp( + Asn1Sequence seq) + { + this.pkiStatusInfo = PkiStatusInfo.GetInstance(seq[0]); + + if (seq.Count > 1) + { + this.timeStampToken = ContentInfo.GetInstance(seq[1]); + } + } + + public TimeStampResp( + PkiStatusInfo pkiStatusInfo, + ContentInfo timeStampToken) + { + this.pkiStatusInfo = pkiStatusInfo; + this.timeStampToken = timeStampToken; + } + + public PkiStatusInfo Status + { + get { return pkiStatusInfo; } + } + + public ContentInfo TimeStampToken + { + get { return timeStampToken; } + } + + /** + *
+		 * TimeStampResp ::= SEQUENCE  {
+		 *   status                  PkiStatusInfo,
+		 *   timeStampToken          TimeStampToken     OPTIONAL  }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(pkiStatusInfo); + + if (timeStampToken != null) + { + v.Add(timeStampToken); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampResp.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampResp.cs.meta new file mode 100644 index 00000000..4f61b783 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/tsp/TimeStampResp.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9ec52bc1476daae4f87068811480b959 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua.meta new file mode 100644 index 00000000..5f435c4b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e39155a1305d6e64c8b52cff75fe8748 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua/UAObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua/UAObjectIdentifiers.cs new file mode 100644 index 00000000..8c6b082c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua/UAObjectIdentifiers.cs @@ -0,0 +1,111 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.UA +{ + /** + * Ukrainian object identifiers + *

+ * {iso(1) member-body(2) Ukraine(804) root(2) security(1) cryptography(1) pki(1)} + *

+ * { ... pki-alg(1) pki-alg-sym(3) Dstu4145WithGost34311(1) PB(1)} + *

+ * DSTU4145 in polynomial basis has 2 oids, one for little-endian representation and one for big-endian + */ + public abstract class UAObjectIdentifiers + { + /** Base OID: 1.2.804.2.1.1.1 */ + public static readonly DerObjectIdentifier UaOid = new DerObjectIdentifier("1.2.804.2.1.1.1"); + + /** DSTU4145 Little Endian presentation. OID: 1.2.804.2.1.1.1.1.3.1.1 */ + public static readonly DerObjectIdentifier dstu4145le = UaOid.Branch("1.3.1.1"); + /** DSTU4145 Big Endian presentation. OID: 1.2.804.2.1.1.1.1.3.1.1.1 */ + public static readonly DerObjectIdentifier dstu4145be = UaOid.Branch("1.3.1.1.1.1"); + + /** DSTU7564 256-bit digest presentation. */ + public static readonly DerObjectIdentifier dstu7564digest_256 = UaOid.Branch("1.2.2.1"); + /** DSTU7564 384-bit digest presentation. */ + public static readonly DerObjectIdentifier dstu7564digest_384 = UaOid.Branch("1.2.2.2"); + /** DSTU7564 512-bit digest presentation. */ + public static readonly DerObjectIdentifier dstu7564digest_512 = UaOid.Branch("1.2.2.3"); + + /** DSTU7564 256-bit mac presentation. */ + public static readonly DerObjectIdentifier dstu7564mac_256 = UaOid.Branch("1.2.2.4"); + /** DSTU7564 384-bit mac presentation. */ + public static readonly DerObjectIdentifier dstu7564mac_384 = UaOid.Branch("1.2.2.5"); + /** DSTU7564 512-bit mac presentation. */ + public static readonly DerObjectIdentifier dstu7564mac_512 = UaOid.Branch("1.2.2.6"); + + + /** DSTU7624 in ECB mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ecb_128 = UaOid.Branch("1.1.3.1.1"); + /** DSTU7624 in ECB mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ecb_256 = UaOid.Branch("1.1.3.1.2"); + /** DSTU7624 in ECB mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ecb_512 = UaOid.Branch("1.1.3.1.3"); + + /** DSTU7624 in CTR mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ctr_128 = UaOid.Branch("1.1.3.2.1"); + /** DSTU7624 in CTR mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ctr_256 = UaOid.Branch("1.1.3.2.2"); + /** DSTU7624 in CTR mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ctr_512 = UaOid.Branch("1.1.3.2.3"); + + /** DSTU7624 in CFB mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624cfb_128 = UaOid.Branch("1.1.3.3.1"); + /** DSTU7624 in CFB mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624cfb_256 = UaOid.Branch("1.1.3.3.2"); + /** DSTU7624 in CFB mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624cfb_512 = UaOid.Branch("1.1.3.3.3"); + + /** DSTU7624 in MAC mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624cmac_128 = UaOid.Branch("1.1.3.4.1"); + /** DSTU7624 in MAC mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624cmac_256 = UaOid.Branch("1.1.3.4.2"); + /** DSTU7624 in MAC mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624cmac_512 = UaOid.Branch("1.1.3.4.3"); + + /** DSTU7624 in CBC mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624cbc_128 = UaOid.Branch("1.1.3.5.1"); + /** DSTU7624 in CBC mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624cbc_256 = UaOid.Branch("1.1.3.5.2"); + /** DSTU7624 in CBC mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624cbc_512 = UaOid.Branch("1.1.3.5.3"); + + /** DSTU7624 in OFB mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ofb_128 = UaOid.Branch("1.1.3.6.1"); + /** DSTU7624 in OFB mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ofb_256 = UaOid.Branch("1.1.3.6.2"); + /** DSTU7624 in OFB mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ofb_512 = UaOid.Branch("1.1.3.6.3"); + + /** DSTU7624 in GMAC (GCM witout encryption) mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624gmac_128 = UaOid.Branch("1.1.3.7.1"); + /** DSTU7624 in GMAC (GCM witout encryption) mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624gmac_256 = UaOid.Branch("1.1.3.7.2"); + /** DSTU7624 in GMAC (GCM witout encryption) mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624gmac_512 = UaOid.Branch("1.1.3.7.3"); + + /** DSTU7624 in CCM mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ccm_128 = UaOid.Branch("1.1.3.8.1"); + /** DSTU7624 in CCM mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ccm_256 = UaOid.Branch("1.1.3.8.2"); + /** DSTU7624 in CCM mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624ccm_512 = UaOid.Branch("1.1.3.8.3"); + + /** DSTU7624 in XTS mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624xts_128 = UaOid.Branch("1.1.3.9.1"); + /** DSTU7624 in XTS mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624xts_256 = UaOid.Branch("1.1.3.9.2"); + /** DSTU7624 in XTS mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624xts_512 = UaOid.Branch("1.1.3.9.3"); + + /** DSTU7624 in key wrap (KW) mode with 128 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624kw_128 = UaOid.Branch("1.1.3.10.1"); + /** DSTU7624 in key wrap (KW) mode with 256 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624kw_256 = UaOid.Branch("1.1.3.10.2"); + /** DSTU7624 in key wrap (KW) mode with 512 bit block/key presentation */ + public static readonly DerObjectIdentifier dstu7624kw_512 = UaOid.Branch("1.1.3.10.3"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua/UAObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua/UAObjectIdentifiers.cs.meta new file mode 100644 index 00000000..3a0c35a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/ua/UAObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f7217807282a0840ad393555f9d08ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util.meta new file mode 100644 index 00000000..552c8d5e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3c52f2b6f7def7e48816d97f7186277b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/Asn1Dump.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/Asn1Dump.cs new file mode 100644 index 00000000..30c948b1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/Asn1Dump.cs @@ -0,0 +1,385 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities +{ + public sealed class Asn1Dump + { + private static readonly string NewLine = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + + private Asn1Dump() + { + } + + private const string Tab = " "; + private const int SampleSize = 32; + + /** + * dump a Der object as a formatted string with indentation + * + * @param obj the Asn1Object to be dumped out. + */ + private static void AsString( + string indent, + bool verbose, + Asn1Object obj, + StringBuilder buf) + { + if (obj is Asn1Sequence) + { + string tab = indent + Tab; + buf.Append(indent); + if (obj is BerSequence) + { + buf.Append("BER Sequence"); + } + else if (obj is DerSequence) + { + buf.Append("DER Sequence"); + } + else + { + buf.Append("Sequence"); + } + + buf.Append(NewLine); + + foreach (Asn1Encodable o in ((Asn1Sequence)obj)) + { + if (o == null || o is Asn1Null) + { + buf.Append(tab); + buf.Append("NULL"); + buf.Append(NewLine); + } + else + { + AsString(tab, verbose, o.ToAsn1Object(), buf); + } + } + } + else if (obj is DerTaggedObject) + { + string tab = indent + Tab; + buf.Append(indent); + if (obj is BerTaggedObject) + { + buf.Append("BER Tagged ["); + } + else + { + buf.Append("Tagged ["); + } + + DerTaggedObject o = (DerTaggedObject)obj; + + buf.Append(((int)o.TagNo).ToString()); + buf.Append(']'); + + if (!o.IsExplicit()) + { + buf.Append(" IMPLICIT "); + } + + buf.Append(NewLine); + + if (o.IsEmpty()) + { + buf.Append(tab); + buf.Append("EMPTY"); + buf.Append(NewLine); + } + else + { + AsString(tab, verbose, o.GetObject(), buf); + } + } + else if (obj is BerSet) + { + string tab = indent + Tab; + + buf.Append(indent); + buf.Append("BER Set"); + buf.Append(NewLine); + + foreach (Asn1Encodable o in ((Asn1Set)obj)) + { + if (o == null) + { + buf.Append(tab); + buf.Append("NULL"); + buf.Append(NewLine); + } + else + { + AsString(tab, verbose, o.ToAsn1Object(), buf); + } + } + } + else if (obj is DerSet) + { + string tab = indent + Tab; + + buf.Append(indent); + buf.Append("DER Set"); + buf.Append(NewLine); + + foreach (Asn1Encodable o in ((Asn1Set)obj)) + { + if (o == null) + { + buf.Append(tab); + buf.Append("NULL"); + buf.Append(NewLine); + } + else + { + AsString(tab, verbose, o.ToAsn1Object(), buf); + } + } + } + else if (obj is DerObjectIdentifier) + { + buf.Append(indent + "ObjectIdentifier(" + ((DerObjectIdentifier)obj).Id + ")" + NewLine); + } + else if (obj is DerBoolean) + { + buf.Append(indent + "Boolean(" + ((DerBoolean)obj).IsTrue + ")" + NewLine); + } + else if (obj is DerInteger) + { + buf.Append(indent + "Integer(" + ((DerInteger)obj).Value + ")" + NewLine); + } + else if (obj is BerOctetString) + { + byte[] octets = ((Asn1OctetString)obj).GetOctets(); + string extra = verbose ? dumpBinaryDataAsString(indent, octets) : ""; + buf.Append(indent + "BER Octet String" + "[" + octets.Length + "] " + extra + NewLine); + } + else if (obj is DerOctetString) + { + byte[] octets = ((Asn1OctetString)obj).GetOctets(); + string extra = verbose ? dumpBinaryDataAsString(indent, octets) : ""; + buf.Append(indent + "DER Octet String" + "[" + octets.Length + "] " + extra + NewLine); + } + else if (obj is DerBitString) + { + DerBitString bt = (DerBitString)obj; + byte[] bytes = bt.GetBytes(); + string extra = verbose ? dumpBinaryDataAsString(indent, bytes) : ""; + buf.Append(indent + "DER Bit String" + "[" + bytes.Length + ", " + bt.PadBits + "] " + extra + NewLine); + } + else if (obj is DerIA5String) + { + buf.Append(indent + "IA5String(" + ((DerIA5String)obj).GetString() + ") " + NewLine); + } + else if (obj is DerUtf8String) + { + buf.Append(indent + "UTF8String(" + ((DerUtf8String)obj).GetString() + ") " + NewLine); + } + else if (obj is DerPrintableString) + { + buf.Append(indent + "PrintableString(" + ((DerPrintableString)obj).GetString() + ") " + NewLine); + } + else if (obj is DerVisibleString) + { + buf.Append(indent + "VisibleString(" + ((DerVisibleString)obj).GetString() + ") " + NewLine); + } + else if (obj is DerBmpString) + { + buf.Append(indent + "BMPString(" + ((DerBmpString)obj).GetString() + ") " + NewLine); + } + else if (obj is DerT61String) + { + buf.Append(indent + "T61String(" + ((DerT61String)obj).GetString() + ") " + NewLine); + } + else if (obj is DerGraphicString) + { + buf.Append(indent + "GraphicString(" + ((DerGraphicString)obj).GetString() + ") " + NewLine); + } + else if (obj is DerVideotexString) + { + buf.Append(indent + "VideotexString(" + ((DerVideotexString)obj).GetString() + ") " + NewLine); + } + else if (obj is DerUtcTime) + { + buf.Append(indent + "UTCTime(" + ((DerUtcTime)obj).TimeString + ") " + NewLine); + } + else if (obj is DerGeneralizedTime) + { + buf.Append(indent + "GeneralizedTime(" + ((DerGeneralizedTime)obj).GetTime() + ") " + NewLine); + } + else if (obj is BerApplicationSpecific) + { + buf.Append(outputApplicationSpecific("BER", indent, verbose, (BerApplicationSpecific)obj)); + } + else if (obj is DerApplicationSpecific) + { + buf.Append(outputApplicationSpecific("DER", indent, verbose, (DerApplicationSpecific)obj)); + } + else if (obj is DerEnumerated) + { + DerEnumerated en = (DerEnumerated)obj; + buf.Append(indent + "DER Enumerated(" + en.Value + ")" + NewLine); + } + else if (obj is DerExternal) + { + DerExternal ext = (DerExternal)obj; + buf.Append(indent + "External " + NewLine); + string tab = indent + Tab; + + if (ext.DirectReference != null) + { + buf.Append(tab + "Direct Reference: " + ext.DirectReference.Id + NewLine); + } + if (ext.IndirectReference != null) + { + buf.Append(tab + "Indirect Reference: " + ext.IndirectReference.ToString() + NewLine); + } + if (ext.DataValueDescriptor != null) + { + AsString(tab, verbose, ext.DataValueDescriptor, buf); + } + buf.Append(tab + "Encoding: " + ext.Encoding + NewLine); + AsString(tab, verbose, ext.ExternalContent, buf); + } + else + { + buf.Append(indent + obj.ToString() + NewLine); + } + } + + private static string outputApplicationSpecific( + string type, + string indent, + bool verbose, + DerApplicationSpecific app) + { + StringBuilder buf = new StringBuilder(); + + if (app.IsConstructed()) + { + try + { + Asn1Sequence s = Asn1Sequence.GetInstance(app.GetObject(Asn1Tags.Sequence)); + buf.Append(indent + type + " ApplicationSpecific[" + app.ApplicationTag + "]" + NewLine); + foreach (Asn1Encodable ae in s) + { + AsString(indent + Tab, verbose, ae.ToAsn1Object(), buf); + } + } + catch (IOException e) + { + buf.Append(e); + } + return buf.ToString(); + } + + return indent + type + " ApplicationSpecific[" + app.ApplicationTag + "] (" + + Hex.ToHexString(app.GetContents()) + ")" + NewLine; + } + + [Obsolete("Use version accepting Asn1Encodable")] + public static string DumpAsString( + object obj) + { + if (obj is Asn1Encodable) + { + StringBuilder buf = new StringBuilder(); + AsString("", false, ((Asn1Encodable)obj).ToAsn1Object(), buf); + return buf.ToString(); + } + + return "unknown object type " + obj.ToString(); + } + + /** + * dump out a DER object as a formatted string, in non-verbose mode + * + * @param obj the Asn1Encodable to be dumped out. + * @return the resulting string. + */ + public static string DumpAsString( + Asn1Encodable obj) + { + return DumpAsString(obj, false); + } + + /** + * Dump out the object as a string + * + * @param obj the Asn1Encodable to be dumped out. + * @param verbose if true, dump out the contents of octet and bit strings. + * @return the resulting string. + */ + public static string DumpAsString( + Asn1Encodable obj, + bool verbose) + { + StringBuilder buf = new StringBuilder(); + AsString("", verbose, obj.ToAsn1Object(), buf); + return buf.ToString(); + } + + private static string dumpBinaryDataAsString(string indent, byte[] bytes) + { + indent += Tab; + + StringBuilder buf = new StringBuilder(NewLine); + + for (int i = 0; i < bytes.Length; i += SampleSize) + { + if (bytes.Length - i > SampleSize) + { + buf.Append(indent); + buf.Append(Hex.ToHexString(bytes, i, SampleSize)); + buf.Append(Tab); + buf.Append(calculateAscString(bytes, i, SampleSize)); + buf.Append(NewLine); + } + else + { + buf.Append(indent); + buf.Append(Hex.ToHexString(bytes, i, bytes.Length - i)); + for (int j = bytes.Length - i; j != SampleSize; j++) + { + buf.Append(" "); + } + buf.Append(Tab); + buf.Append(calculateAscString(bytes, i, bytes.Length - i)); + buf.Append(NewLine); + } + } + + return buf.ToString(); + } + + private static string calculateAscString( + byte[] bytes, + int off, + int len) + { + StringBuilder buf = new StringBuilder(); + + for (int i = off; i != off + len; i++) + { + char c = (char)bytes[i]; + if (c >= ' ' && c <= '~') + { + buf.Append(c); + } + } + + return buf.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/Asn1Dump.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/Asn1Dump.cs.meta new file mode 100644 index 00000000..9d9c5a57 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/Asn1Dump.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d11a496b7c22849429b50cb347c4836e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/FilterStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/FilterStream.cs new file mode 100644 index 00000000..419cca87 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/FilterStream.cs @@ -0,0 +1,87 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities +{ + [Obsolete("Use BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.FilterStream")] + public class FilterStream : Stream + { + [Obsolete("Use BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.FilterStream")] + public FilterStream(Stream s) + { + this.s = s; + } + public override bool CanRead + { + get { return s.CanRead; } + } + public override bool CanSeek + { + get { return s.CanSeek; } + } + public override bool CanWrite + { + get { return s.CanWrite; } + } + public override long Length + { + get { return s.Length; } + } + public override long Position + { + get { return s.Position; } + set { s.Position = value; } + } +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(s); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(s); + base.Close(); + } +#endif + public override void Flush() + { + s.Flush(); + } + public override long Seek(long offset, SeekOrigin origin) + { + return s.Seek(offset, origin); + } + public override void SetLength(long value) + { + s.SetLength(value); + } + public override int Read(byte[] buffer, int offset, int count) + { + return s.Read(buffer, offset, count); + } + public override int ReadByte() + { + return s.ReadByte(); + } + public override void Write(byte[] buffer, int offset, int count) + { + s.Write(buffer, offset, count); + } + public override void WriteByte(byte value) + { + s.WriteByte(value); + } + protected readonly Stream s; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/FilterStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/FilterStream.cs.meta new file mode 100644 index 00000000..7871a25e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/util/FilterStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ecc1ac8ab2a920c418f97b8619491c2a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500.meta new file mode 100644 index 00000000..2047b9e9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7ecc2a4f33b2c4248b350a81db15a2c3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500/DirectoryString.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500/DirectoryString.cs new file mode 100644 index 00000000..6535a931 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500/DirectoryString.cs @@ -0,0 +1,78 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500 +{ + public class DirectoryString + : Asn1Encodable, IAsn1Choice, IAsn1String + { + private readonly DerStringBase str; + + public static DirectoryString GetInstance(object obj) + { + if (obj == null || obj is DirectoryString) + return (DirectoryString) obj; + + if (obj is DerStringBase) + { + if (obj is DerT61String + || obj is DerPrintableString + || obj is DerUniversalString + || obj is DerUtf8String + || obj is DerBmpString) + { + return new DirectoryString((DerStringBase) obj); + } + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static DirectoryString GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + if (!isExplicit) + throw new ArgumentException("choice item must be explicitly tagged"); + + return GetInstance(obj.GetObject()); + } + + private DirectoryString( + DerStringBase str) + { + this.str = str; + } + + public DirectoryString( + string str) + { + this.str = new DerUtf8String(str); + } + + public string GetString() + { + return str.GetString(); + } + + /** + *

+		 *  DirectoryString ::= CHOICE {
+		 *    teletexString               TeletexString (SIZE (1..MAX)),
+		 *    printableString             PrintableString (SIZE (1..MAX)),
+		 *    universalString             UniversalString (SIZE (1..MAX)),
+		 *    utf8String                  UTF8String (SIZE (1..MAX)),
+		 *    bmpString                   BMPString (SIZE (1..MAX))  }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + return str.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500/DirectoryString.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500/DirectoryString.cs.meta new file mode 100644 index 00000000..2779da44 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x500/DirectoryString.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4076af4d9a9dbd43ad4ee25b177aaa2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509.meta new file mode 100644 index 00000000..a8647b30 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6326d041839c09a43bfda92c6aef7274 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AccessDescription.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AccessDescription.cs new file mode 100644 index 00000000..ccdd01a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AccessDescription.cs @@ -0,0 +1,89 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The AccessDescription object. + *
+	 * AccessDescription  ::=  SEQUENCE {
+	 *       accessMethod          OBJECT IDENTIFIER,
+	 *       accessLocation        GeneralName  }
+	 * 
+ */ + public class AccessDescription + : Asn1Encodable + { + public readonly static DerObjectIdentifier IdADCAIssuers = new DerObjectIdentifier("1.3.6.1.5.5.7.48.2"); + public readonly static DerObjectIdentifier IdADOcsp = new DerObjectIdentifier("1.3.6.1.5.5.7.48.1"); + + private readonly DerObjectIdentifier accessMethod; + private readonly GeneralName accessLocation; + + public static AccessDescription GetInstance( + object obj) + { + if (obj is AccessDescription) + return (AccessDescription) obj; + + if (obj is Asn1Sequence) + return new AccessDescription((Asn1Sequence) obj); + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private AccessDescription( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("wrong number of elements in sequence"); + + accessMethod = DerObjectIdentifier.GetInstance(seq[0]); + accessLocation = GeneralName.GetInstance(seq[1]); + } + + /** + * create an AccessDescription with the oid and location provided. + */ + public AccessDescription( + DerObjectIdentifier oid, + GeneralName location) + { + accessMethod = oid; + accessLocation = location; + } + + /** + * + * @return the access method. + */ + public DerObjectIdentifier AccessMethod + { + get { return accessMethod; } + } + + /** + * + * @return the access location + */ + public GeneralName AccessLocation + { + get { return accessLocation; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(accessMethod, accessLocation); + } + + public override string ToString() + { + return "AccessDescription: Oid(" + this.accessMethod.Id + ")"; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AccessDescription.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AccessDescription.cs.meta new file mode 100644 index 00000000..40b5b4d5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AccessDescription.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a289fcf7677caaf4dbdf264ebff8340a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AlgorithmIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AlgorithmIdentifier.cs new file mode 100644 index 00000000..e6129255 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AlgorithmIdentifier.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class AlgorithmIdentifier + : Asn1Encodable + { + private readonly DerObjectIdentifier algorithm; + private readonly Asn1Encodable parameters; + + public static AlgorithmIdentifier GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static AlgorithmIdentifier GetInstance( + object obj) + { + if (obj == null) + return null; + if (obj is AlgorithmIdentifier) + return (AlgorithmIdentifier)obj; + return new AlgorithmIdentifier(Asn1Sequence.GetInstance(obj)); + } + + public AlgorithmIdentifier( + DerObjectIdentifier algorithm) + { + this.algorithm = algorithm; + } + + [Obsolete("Use version taking a DerObjectIdentifier")] + public AlgorithmIdentifier( + string algorithm) + { + this.algorithm = new DerObjectIdentifier(algorithm); + } + + public AlgorithmIdentifier( + DerObjectIdentifier algorithm, + Asn1Encodable parameters) + { + this.algorithm = algorithm; + this.parameters = parameters; + } + + internal AlgorithmIdentifier( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 2) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + this.algorithm = DerObjectIdentifier.GetInstance(seq[0]); + this.parameters = seq.Count < 2 ? null : seq[1]; + } + + /// + /// Return the OID in the Algorithm entry of this identifier. + /// + public virtual DerObjectIdentifier Algorithm + { + get { return algorithm; } + } + + [Obsolete("Use 'Algorithm' property instead")] + public virtual DerObjectIdentifier ObjectID + { + get { return algorithm; } + } + + /// + /// Return the parameters structure in the Parameters entry of this identifier. + /// + public virtual Asn1Encodable Parameters + { + get { return parameters; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *      AlgorithmIdentifier ::= Sequence {
+         *                            algorithm OBJECT IDENTIFIER,
+         *                            parameters ANY DEFINED BY algorithm OPTIONAL }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(algorithm); + v.AddOptional(parameters); + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AlgorithmIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AlgorithmIdentifier.cs.meta new file mode 100644 index 00000000..2d2807ca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AlgorithmIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ca01d5013f07794b9fd040bfd8dc6b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertIssuer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertIssuer.cs new file mode 100644 index 00000000..60a068f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertIssuer.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class AttCertIssuer + : Asn1Encodable, IAsn1Choice + { + internal readonly Asn1Encodable obj; + internal readonly Asn1Object choiceObj; + + public static AttCertIssuer GetInstance( + object obj) + { + if (obj is AttCertIssuer) + { + return (AttCertIssuer)obj; + } + else if (obj is V2Form) + { + return new AttCertIssuer(V2Form.GetInstance(obj)); + } + else if (obj is GeneralNames) + { + return new AttCertIssuer((GeneralNames)obj); + } + else if (obj is Asn1TaggedObject) + { + return new AttCertIssuer(V2Form.GetInstance((Asn1TaggedObject)obj, false)); + } + else if (obj is Asn1Sequence) + { + return new AttCertIssuer(GeneralNames.GetInstance(obj)); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static AttCertIssuer GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(obj.GetObject()); // must be explictly tagged + } + + /// + /// Don't use this one if you are trying to be RFC 3281 compliant. + /// Use it for v1 attribute certificates only. + /// + /// Our GeneralNames structure + public AttCertIssuer( + GeneralNames names) + { + obj = names; + choiceObj = obj.ToAsn1Object(); + } + + public AttCertIssuer( + V2Form v2Form) + { + obj = v2Form; + choiceObj = new DerTaggedObject(false, 0, obj); + } + + public Asn1Encodable Issuer + { + get { return obj; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  AttCertIssuer ::= CHOICE {
+         *       v1Form   GeneralNames,  -- MUST NOT be used in this
+         *                               -- profile
+         *       v2Form   [0] V2Form     -- v2 only
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return choiceObj; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertIssuer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertIssuer.cs.meta new file mode 100644 index 00000000..b906b0c4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertIssuer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f409a35c3f3abe44d9a6df60abf74aa4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertValidityPeriod.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertValidityPeriod.cs new file mode 100644 index 00000000..a54321e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertValidityPeriod.cs @@ -0,0 +1,82 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class AttCertValidityPeriod + : Asn1Encodable + { + private readonly DerGeneralizedTime notBeforeTime; + private readonly DerGeneralizedTime notAfterTime; + + public static AttCertValidityPeriod GetInstance( + object obj) + { + if (obj is AttCertValidityPeriod || obj == null) + { + return (AttCertValidityPeriod) obj; + } + + if (obj is Asn1Sequence) + { + return new AttCertValidityPeriod((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static AttCertValidityPeriod GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + private AttCertValidityPeriod( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + notBeforeTime = DerGeneralizedTime.GetInstance(seq[0]); + notAfterTime = DerGeneralizedTime.GetInstance(seq[1]); + } + + public AttCertValidityPeriod( + DerGeneralizedTime notBeforeTime, + DerGeneralizedTime notAfterTime) + { + this.notBeforeTime = notBeforeTime; + this.notAfterTime = notAfterTime; + } + + public DerGeneralizedTime NotBeforeTime + { + get { return notBeforeTime; } + } + + public DerGeneralizedTime NotAfterTime + { + get { return notAfterTime; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  AttCertValidityPeriod  ::= Sequence {
+         *       notBeforeTime  GeneralizedTime,
+         *       notAfterTime   GeneralizedTime
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(notBeforeTime, notAfterTime); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertValidityPeriod.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertValidityPeriod.cs.meta new file mode 100644 index 00000000..9fdfea68 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttCertValidityPeriod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ded3eb9027f3df4298ed5c4d7734401 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Attribute.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Attribute.cs new file mode 100644 index 00000000..e175a49e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Attribute.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class AttributeX509 + : Asn1Encodable + { + private readonly DerObjectIdentifier attrType; + private readonly Asn1Set attrValues; + + /** + * return an Attr object from the given object. + * + * @param o the object we want converted. + * @exception ArgumentException if the object cannot be converted. + */ + public static AttributeX509 GetInstance( + object obj) + { + if (obj == null || obj is AttributeX509) + { + return (AttributeX509) obj; + } + + if (obj is Asn1Sequence) + { + return new AttributeX509((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private AttributeX509( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + attrType = DerObjectIdentifier.GetInstance(seq[0]); + attrValues = Asn1Set.GetInstance(seq[1]); + } + + public AttributeX509( + DerObjectIdentifier attrType, + Asn1Set attrValues) + { + this.attrType = attrType; + this.attrValues = attrValues; + } + + public DerObjectIdentifier AttrType + { + get { return attrType; } + } + + public Asn1Encodable[] GetAttributeValues() + { + return attrValues.ToArray(); + } + + public Asn1Set AttrValues + { + get { return attrValues; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * Attr ::= Sequence {
+         *     attrType OBJECT IDENTIFIER,
+         *     attrValues Set OF AttributeValue
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(attrType, attrValues); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Attribute.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Attribute.cs.meta new file mode 100644 index 00000000..b7e0c35f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Attribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6d51095bedbf8dd4ab263f1b3ae1e852 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificate.cs new file mode 100644 index 00000000..a65137d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificate.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class AttributeCertificate + : Asn1Encodable + { + private readonly AttributeCertificateInfo acinfo; + private readonly AlgorithmIdentifier signatureAlgorithm; + private readonly DerBitString signatureValue; + + /** + * @param obj + * @return + */ + public static AttributeCertificate GetInstance( + object obj) + { + if (obj is AttributeCertificate) + return (AttributeCertificate) obj; + + if (obj != null) + return new AttributeCertificate(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public AttributeCertificate( + AttributeCertificateInfo acinfo, + AlgorithmIdentifier signatureAlgorithm, + DerBitString signatureValue) + { + this.acinfo = acinfo; + this.signatureAlgorithm = signatureAlgorithm; + this.signatureValue = signatureValue; + } + + private AttributeCertificate( + Asn1Sequence seq) + { + if (seq.Count != 3) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + this.acinfo = AttributeCertificateInfo.GetInstance(seq[0]); + this.signatureAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]); + this.signatureValue = DerBitString.GetInstance(seq[2]); + } + + public AttributeCertificateInfo ACInfo + { + get { return acinfo; } + } + + public AlgorithmIdentifier SignatureAlgorithm + { + get { return signatureAlgorithm; } + } + + public DerBitString SignatureValue + { + get { return signatureValue; } + } + + public byte[] GetSignatureOctets() + { + return signatureValue.GetOctets(); + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  AttributeCertificate ::= Sequence {
+         *       acinfo               AttributeCertificateInfo,
+         *       signatureAlgorithm   AlgorithmIdentifier,
+         *       signatureValue       BIT STRING
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(acinfo, signatureAlgorithm, signatureValue); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificate.cs.meta new file mode 100644 index 00000000..2eb1f433 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6cbd2ac468cff674a9165158e8a053c7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificateInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificateInfo.cs new file mode 100644 index 00000000..d6455949 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificateInfo.cs @@ -0,0 +1,160 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class AttributeCertificateInfo + : Asn1Encodable + { + internal readonly DerInteger version; + internal readonly Holder holder; + internal readonly AttCertIssuer issuer; + internal readonly AlgorithmIdentifier signature; + internal readonly DerInteger serialNumber; + internal readonly AttCertValidityPeriod attrCertValidityPeriod; + internal readonly Asn1Sequence attributes; + internal readonly DerBitString issuerUniqueID; + internal readonly X509Extensions extensions; + + public static AttributeCertificateInfo GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + public static AttributeCertificateInfo GetInstance( + object obj) + { + if (obj is AttributeCertificateInfo) + { + return (AttributeCertificateInfo) obj; + } + + if (obj is Asn1Sequence) + { + return new AttributeCertificateInfo((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private AttributeCertificateInfo( + Asn1Sequence seq) + { + if (seq.Count < 7 || seq.Count > 9) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + this.version = DerInteger.GetInstance(seq[0]); + this.holder = Holder.GetInstance(seq[1]); + this.issuer = AttCertIssuer.GetInstance(seq[2]); + this.signature = AlgorithmIdentifier.GetInstance(seq[3]); + this.serialNumber = DerInteger.GetInstance(seq[4]); + this.attrCertValidityPeriod = AttCertValidityPeriod.GetInstance(seq[5]); + this.attributes = Asn1Sequence.GetInstance(seq[6]); + + for (int i = 7; i < seq.Count; i++) + { + Asn1Encodable obj = (Asn1Encodable) seq[i]; + + if (obj is DerBitString) + { + this.issuerUniqueID = DerBitString.GetInstance(seq[i]); + } + else if (obj is Asn1Sequence || obj is X509Extensions) + { + this.extensions = X509Extensions.GetInstance(seq[i]); + } + } + } + + public DerInteger Version + { + get { return version; } + } + + public Holder Holder + { + get { return holder; } + } + + public AttCertIssuer Issuer + { + get { return issuer; } + } + + public AlgorithmIdentifier Signature + { + get { return signature; } + } + + public DerInteger SerialNumber + { + get { return serialNumber; } + } + + public AttCertValidityPeriod AttrCertValidityPeriod + { + get { return attrCertValidityPeriod; } + } + + public Asn1Sequence Attributes + { + get { return attributes; } + } + + public DerBitString IssuerUniqueID + { + get { return issuerUniqueID; } + } + + public X509Extensions Extensions + { + get { return extensions; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  AttributeCertificateInfo ::= Sequence {
+         *       version              AttCertVersion -- version is v2,
+         *       holder               Holder,
+         *       issuer               AttCertIssuer,
+         *       signature            AlgorithmIdentifier,
+         *       serialNumber         CertificateSerialNumber,
+         *       attrCertValidityPeriod   AttCertValidityPeriod,
+         *       attributes           Sequence OF Attr,
+         *       issuerUniqueID       UniqueIdentifier OPTIONAL,
+         *       extensions           Extensions OPTIONAL
+         *  }
+         *
+         *  AttCertVersion ::= Integer { v2(1) }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + version, holder, issuer, signature, serialNumber, + attrCertValidityPeriod, attributes); + + if (issuerUniqueID != null) + { + v.Add(issuerUniqueID); + } + + if (extensions != null) + { + v.Add(extensions); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificateInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificateInfo.cs.meta new file mode 100644 index 00000000..e33165ce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeCertificateInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 63d26bd8566a0e444863a2c776d68b81 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeTable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeTable.cs new file mode 100644 index 00000000..9e877ad3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeTable.cs @@ -0,0 +1,77 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class AttributeTable + { + private readonly IDictionary attributes; + + public AttributeTable( + IDictionary attrs) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(attrs); + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete] + public AttributeTable( + Hashtable attrs) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(attrs); + } +#endif + + public AttributeTable( + Asn1EncodableVector v) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(v.Count); + + for (int i = 0; i != v.Count; i++) + { + AttributeX509 a = AttributeX509.GetInstance(v[i]); + + attributes.Add(a.AttrType, a); + } + } + + public AttributeTable( + Asn1Set s) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(s.Count); + + for (int i = 0; i != s.Count; i++) + { + AttributeX509 a = AttributeX509.GetInstance(s[i]); + + attributes.Add(a.AttrType, a); + } + } + + public AttributeX509 Get( + DerObjectIdentifier oid) + { + return (AttributeX509) attributes[oid]; + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete("Use 'ToDictionary' instead")] + public Hashtable ToHashtable() + { + return new Hashtable(attributes); + } +#endif + + public IDictionary ToDictionary() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(attributes); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeTable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeTable.cs.meta new file mode 100644 index 00000000..f80ffd11 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AttributeTable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 29d365c75d2a2cd4584d446081c01294 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityInformationAccess.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityInformationAccess.cs new file mode 100644 index 00000000..4bb561ec --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityInformationAccess.cs @@ -0,0 +1,102 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The AuthorityInformationAccess object. + *
+     * id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
+     *
+     * AuthorityInfoAccessSyntax  ::=
+     *      Sequence SIZE (1..MAX) OF AccessDescription
+     * AccessDescription  ::=  Sequence {
+     *       accessMethod          OBJECT IDENTIFIER,
+     *       accessLocation        GeneralName  }
+     *
+     * id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
+     * id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
+     * id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
+     * 
+ */ + public class AuthorityInformationAccess + : Asn1Encodable + { + private readonly AccessDescription[] descriptions; + + public static AuthorityInformationAccess GetInstance(object obj) + { + if (obj is AuthorityInformationAccess) + return (AuthorityInformationAccess)obj; + if (obj == null) + return null; + return new AuthorityInformationAccess(Asn1Sequence.GetInstance(obj)); + } + + private AuthorityInformationAccess( + Asn1Sequence seq) + { + if (seq.Count < 1) + throw new ArgumentException("sequence may not be empty"); + + this.descriptions = new AccessDescription[seq.Count]; + + for (int i = 0; i < seq.Count; ++i) + { + descriptions[i] = AccessDescription.GetInstance(seq[i]); + } + } + + public AuthorityInformationAccess( + AccessDescription description) + { + this.descriptions = new AccessDescription[]{ description }; + } + + /** + * create an AuthorityInformationAccess with the oid and location provided. + */ + public AuthorityInformationAccess(DerObjectIdentifier oid, GeneralName location) + : this(new AccessDescription(oid, location)) + { + } + + public AccessDescription[] GetAccessDescriptions() + { + return (AccessDescription[])descriptions.Clone(); + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(descriptions); + } + + public override string ToString() + { + //return "AuthorityInformationAccess: Oid(" + this.descriptions[0].AccessMethod.Id + ")"; + + StringBuilder buf = new StringBuilder(); + string sep = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + + buf.Append("AuthorityInformationAccess:"); + buf.Append(sep); + + foreach (AccessDescription description in descriptions) + { + buf.Append(" "); + buf.Append(description); + buf.Append(sep); + } + + return buf.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityInformationAccess.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityInformationAccess.cs.meta new file mode 100644 index 00000000..ceb59fd4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityInformationAccess.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1601bbf3e05b8d8448bf4eb122f4bb52 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityKeyIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityKeyIdentifier.cs new file mode 100644 index 00000000..f799a7c1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityKeyIdentifier.cs @@ -0,0 +1,215 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The AuthorityKeyIdentifier object. + *
+     * id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 }
+     *
+     *   AuthorityKeyIdentifier ::= Sequence {
+     *      keyIdentifier             [0] IMPLICIT KeyIdentifier           OPTIONAL,
+     *      authorityCertIssuer       [1] IMPLICIT GeneralNames            OPTIONAL,
+     *      authorityCertSerialNumber [2] IMPLICIT CertificateSerialNumber OPTIONAL  }
+     *
+     *   KeyIdentifier ::= OCTET STRING
+     * 
+ * + */ + public class AuthorityKeyIdentifier + : Asn1Encodable + { + internal readonly Asn1OctetString keyidentifier; + internal readonly GeneralNames certissuer; + internal readonly DerInteger certserno; + + public static AuthorityKeyIdentifier GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static AuthorityKeyIdentifier GetInstance( + object obj) + { + if (obj is AuthorityKeyIdentifier) + { + return (AuthorityKeyIdentifier) obj; + } + + if (obj is Asn1Sequence) + { + return new AuthorityKeyIdentifier((Asn1Sequence) obj); + } + + if (obj is X509Extension) + { + return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + protected internal AuthorityKeyIdentifier( + Asn1Sequence seq) + { + foreach (Asn1TaggedObject o in seq) + { + switch (o.TagNo) + { + case 0: + this.keyidentifier = Asn1OctetString.GetInstance(o, false); + break; + case 1: + this.certissuer = GeneralNames.GetInstance(o, false); + break; + case 2: + this.certserno = DerInteger.GetInstance(o, false); + break; + default: + throw new ArgumentException("illegal tag"); + } + } + } + + /** + * + * Calulates the keyidentifier using a SHA1 hash over the BIT STRING + * from SubjectPublicKeyInfo as defined in RFC2459. + * + * Example of making a AuthorityKeyIdentifier: + *
+	     *   SubjectPublicKeyInfo apki = new SubjectPublicKeyInfo((ASN1Sequence)new ASN1InputStream(
+		 *       publicKey.getEncoded()).readObject());
+         *   AuthorityKeyIdentifier aki = new AuthorityKeyIdentifier(apki);
+         * 
+ * + **/ + public AuthorityKeyIdentifier( + SubjectPublicKeyInfo spki) + { + IDigest digest = new Sha1Digest(); + byte[] resBuf = new byte[digest.GetDigestSize()]; + + byte[] bytes = spki.PublicKeyData.GetBytes(); + digest.BlockUpdate(bytes, 0, bytes.Length); + digest.DoFinal(resBuf, 0); + this.keyidentifier = new DerOctetString(resBuf); + } + + /** + * create an AuthorityKeyIdentifier with the GeneralNames tag and + * the serial number provided as well. + */ + public AuthorityKeyIdentifier( + SubjectPublicKeyInfo spki, + GeneralNames name, + BigInteger serialNumber) + { + IDigest digest = new Sha1Digest(); + byte[] resBuf = new byte[digest.GetDigestSize()]; + + byte[] bytes = spki.PublicKeyData.GetBytes(); + digest.BlockUpdate(bytes, 0, bytes.Length); + digest.DoFinal(resBuf, 0); + + this.keyidentifier = new DerOctetString(resBuf); + this.certissuer = name; + this.certserno = new DerInteger(serialNumber); + } + + /** + * create an AuthorityKeyIdentifier with the GeneralNames tag and + * the serial number provided. + */ + public AuthorityKeyIdentifier( + GeneralNames name, + BigInteger serialNumber) + { + this.keyidentifier = null; + this.certissuer = GeneralNames.GetInstance(name.ToAsn1Object()); + this.certserno = new DerInteger(serialNumber); + } + + /** + * create an AuthorityKeyIdentifier with a precomputed key identifier + */ + public AuthorityKeyIdentifier( + byte[] keyIdentifier) + { + this.keyidentifier = new DerOctetString(keyIdentifier); + this.certissuer = null; + this.certserno = null; + } + + /** + * create an AuthorityKeyIdentifier with a precomupted key identifier + * and the GeneralNames tag and the serial number provided as well. + */ + public AuthorityKeyIdentifier( + byte[] keyIdentifier, + GeneralNames name, + BigInteger serialNumber) + { + this.keyidentifier = new DerOctetString(keyIdentifier); + this.certissuer = GeneralNames.GetInstance(name.ToAsn1Object()); + this.certserno = new DerInteger(serialNumber); + } + + public byte[] GetKeyIdentifier() + { + return keyidentifier == null ? null : keyidentifier.GetOctets(); + } + + public GeneralNames AuthorityCertIssuer + { + get { return certissuer; } + } + + public BigInteger AuthorityCertSerialNumber + { + get { return certserno == null ? null : certserno.Value; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (keyidentifier != null) + { + v.Add(new DerTaggedObject(false, 0, keyidentifier)); + } + + if (certissuer != null) + { + v.Add(new DerTaggedObject(false, 1, certissuer)); + } + + if (certserno != null) + { + v.Add(new DerTaggedObject(false, 2, certserno)); + } + + return new DerSequence(v); + } + + public override string ToString() + { + return ("AuthorityKeyIdentifier: KeyID(" + this.keyidentifier.GetOctets() + ")"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityKeyIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityKeyIdentifier.cs.meta new file mode 100644 index 00000000..a2ac5b84 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/AuthorityKeyIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 092245cc8fba2f8429f6e2f39dc497a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/BasicConstraints.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/BasicConstraints.cs new file mode 100644 index 00000000..d71ef9c8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/BasicConstraints.cs @@ -0,0 +1,137 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class BasicConstraints + : Asn1Encodable + { + private readonly DerBoolean cA; + private readonly DerInteger pathLenConstraint; + + public static BasicConstraints GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static BasicConstraints GetInstance( + object obj) + { + if (obj == null || obj is BasicConstraints) + { + return (BasicConstraints) obj; + } + + if (obj is Asn1Sequence) + { + return new BasicConstraints((Asn1Sequence) obj); + } + + if (obj is X509Extension) + { + return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private BasicConstraints( + Asn1Sequence seq) + { + if (seq.Count > 0) + { + if (seq[0] is DerBoolean) + { + this.cA = DerBoolean.GetInstance(seq[0]); + } + else + { + this.pathLenConstraint = DerInteger.GetInstance(seq[0]); + } + + if (seq.Count > 1) + { + if (this.cA == null) + throw new ArgumentException("wrong sequence in constructor", "seq"); + + this.pathLenConstraint = DerInteger.GetInstance(seq[1]); + } + } + } + + public BasicConstraints( + bool cA) + { + if (cA) + { + this.cA = DerBoolean.True; + } + } + + /** + * create a cA=true object for the given path length constraint. + * + * @param pathLenConstraint + */ + public BasicConstraints( + int pathLenConstraint) + { + this.cA = DerBoolean.True; + this.pathLenConstraint = new DerInteger(pathLenConstraint); + } + + public bool IsCA() + { + return cA != null && cA.IsTrue; + } + + public BigInteger PathLenConstraint + { + get { return pathLenConstraint == null ? null : pathLenConstraint.Value; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * BasicConstraints := Sequence {
+         *    cA                  Boolean DEFAULT FALSE,
+         *    pathLenConstraint   Integer (0..MAX) OPTIONAL
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (cA != null) + { + v.Add(cA); + } + + if (pathLenConstraint != null) // yes some people actually do this when cA is false... + { + v.Add(pathLenConstraint); + } + + return new DerSequence(v); + } + + public override string ToString() + { + if (pathLenConstraint == null) + { + return "BasicConstraints: isCa(" + this.IsCA() + ")"; + } + + return "BasicConstraints: isCa(" + this.IsCA() + "), pathLenConstraint = " + pathLenConstraint.Value; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/BasicConstraints.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/BasicConstraints.cs.meta new file mode 100644 index 00000000..ec2c5a29 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/BasicConstraints.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d7502b6f25d26e42b47b45c612ce45c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLDistPoint.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLDistPoint.cs new file mode 100644 index 00000000..9f39ce80 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLDistPoint.cs @@ -0,0 +1,97 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class CrlDistPoint + : Asn1Encodable + { + internal readonly Asn1Sequence seq; + + public static CrlDistPoint GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static CrlDistPoint GetInstance( + object obj) + { + if (obj is CrlDistPoint || obj == null) + { + return (CrlDistPoint) obj; + } + + if (obj is Asn1Sequence) + { + return new CrlDistPoint((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private CrlDistPoint( + Asn1Sequence seq) + { + this.seq = seq; + } + + public CrlDistPoint( + DistributionPoint[] points) + { + seq = new DerSequence(points); + } + + /** + * Return the distribution points making up the sequence. + * + * @return DistributionPoint[] + */ + public DistributionPoint[] GetDistributionPoints() + { + DistributionPoint[] dp = new DistributionPoint[seq.Count]; + + for (int i = 0; i != seq.Count; ++i) + { + dp[i] = DistributionPoint.GetInstance(seq[i]); + } + + return dp; + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * CrlDistPoint ::= Sequence SIZE {1..MAX} OF DistributionPoint
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return seq; + } + + public override string ToString() + { + StringBuilder buf = new StringBuilder(); + string sep = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + + buf.Append("CRLDistPoint:"); + buf.Append(sep); + DistributionPoint[] dp = GetDistributionPoints(); + for (int i = 0; i != dp.Length; i++) + { + buf.Append(" "); + buf.Append(dp[i]); + buf.Append(sep); + } + return buf.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLDistPoint.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLDistPoint.cs.meta new file mode 100644 index 00000000..ec295a94 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLDistPoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 76f76b96a0c72084eb8684b7076c3b0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLNumber.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLNumber.cs new file mode 100644 index 00000000..d2192dfc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLNumber.cs @@ -0,0 +1,34 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The CRLNumber object. + *
+     * CRLNumber::= Integer(0..MAX)
+     * 
+ */ + public class CrlNumber + : DerInteger + { + public CrlNumber( + BigInteger number) + : base(number) + { + } + + public BigInteger Number + { + get { return PositiveValue; } + } + + public override string ToString() + { + return "CRLNumber: " + Number; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLNumber.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLNumber.cs.meta new file mode 100644 index 00000000..edcbbefa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLNumber.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71369486ad637924399ae4b4f3b0cdb8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLReason.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLReason.cs new file mode 100644 index 00000000..a208d45a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLReason.cs @@ -0,0 +1,65 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The CRLReason enumeration. + *
+     * CRLReason ::= Enumerated {
+     *  unspecified             (0),
+     *  keyCompromise           (1),
+     *  cACompromise            (2),
+     *  affiliationChanged      (3),
+     *  superseded              (4),
+     *  cessationOfOperation    (5),
+     *  certificateHold         (6),
+     *  removeFromCRL           (8),
+     *  privilegeWithdrawn      (9),
+     *  aACompromise           (10)
+     * }
+     * 
+ */ + public class CrlReason + : DerEnumerated + { + public const int Unspecified = 0; + public const int KeyCompromise = 1; + public const int CACompromise = 2; + public const int AffiliationChanged = 3; + public const int Superseded = 4; + public const int CessationOfOperation = 5; + public const int CertificateHold = 6; + // 7 -> Unknown + public const int RemoveFromCrl = 8; + public const int PrivilegeWithdrawn = 9; + public const int AACompromise = 10; + + private static readonly string[] ReasonString = new string[] + { + "Unspecified", "KeyCompromise", "CACompromise", "AffiliationChanged", + "Superseded", "CessationOfOperation", "CertificateHold", "Unknown", + "RemoveFromCrl", "PrivilegeWithdrawn", "AACompromise" + }; + + public CrlReason( + int reason) + : base(reason) + { + } + + public CrlReason( + DerEnumerated reason) + : base(reason.Value.IntValue) + { + } + + public override string ToString() + { + int reason = Value.IntValue; + string str = (reason < 0 || reason > 10) ? "Invalid" : ReasonString[reason]; + return "CrlReason: " + str; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLReason.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLReason.cs.meta new file mode 100644 index 00000000..b9b4f826 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CRLReason.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c68d2f8100a5066489c0646ae5387d53 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertPolicyId.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertPolicyId.cs new file mode 100644 index 00000000..a576aaa2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertPolicyId.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * CertPolicyId, used in the CertificatePolicies and PolicyMappings + * X509V3 Extensions. + * + *
+     *     CertPolicyId ::= OBJECT IDENTIFIER
+     * 
+ */ + public class CertPolicyID + : DerObjectIdentifier + { + public CertPolicyID( + string id) + : base(id) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertPolicyId.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertPolicyId.cs.meta new file mode 100644 index 00000000..4acc5972 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertPolicyId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f829275b09327e742be901d4f2ff5678 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificateList.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificateList.cs new file mode 100644 index 00000000..6d4b814b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificateList.cs @@ -0,0 +1,117 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * PKIX RFC-2459 + * + * The X.509 v2 CRL syntax is as follows. For signature calculation, + * the data that is to be signed is ASN.1 Der encoded. + * + *
+     * CertificateList  ::=  Sequence  {
+     *      tbsCertList          TbsCertList,
+     *      signatureAlgorithm   AlgorithmIdentifier,
+     *      signatureValue       BIT STRING  }
+     * 
+ */ + public class CertificateList + : Asn1Encodable + { + private readonly TbsCertificateList tbsCertList; + private readonly AlgorithmIdentifier sigAlgID; + private readonly DerBitString sig; + + public static CertificateList GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static CertificateList GetInstance( + object obj) + { + if (obj is CertificateList) + return (CertificateList) obj; + + if (obj != null) + return new CertificateList(Asn1Sequence.GetInstance(obj)); + + return null; + } + + private CertificateList( + Asn1Sequence seq) + { + if (seq.Count != 3) + throw new ArgumentException("sequence wrong size for CertificateList", "seq"); + + tbsCertList = TbsCertificateList.GetInstance(seq[0]); + sigAlgID = AlgorithmIdentifier.GetInstance(seq[1]); + sig = DerBitString.GetInstance(seq[2]); + } + + public TbsCertificateList TbsCertList + { + get { return tbsCertList; } + } + + public CrlEntry[] GetRevokedCertificates() + { + return tbsCertList.GetRevokedCertificates(); + } + + public IEnumerable GetRevokedCertificateEnumeration() + { + return tbsCertList.GetRevokedCertificateEnumeration(); + } + + public AlgorithmIdentifier SignatureAlgorithm + { + get { return sigAlgID; } + } + + public DerBitString Signature + { + get { return sig; } + } + + public byte[] GetSignatureOctets() + { + return sig.GetOctets(); + } + + public int Version + { + get { return tbsCertList.Version; } + } + + public X509Name Issuer + { + get { return tbsCertList.Issuer; } + } + + public Time ThisUpdate + { + get { return tbsCertList.ThisUpdate; } + } + + public Time NextUpdate + { + get { return tbsCertList.NextUpdate; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(tbsCertList, sigAlgID, sig); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificateList.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificateList.cs.meta new file mode 100644 index 00000000..44f82ba4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificateList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3e7c40fd85c424458bbf921ec3a90d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePair.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePair.cs new file mode 100644 index 00000000..c064b82c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePair.cs @@ -0,0 +1,166 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * This class helps to support crossCerfificatePairs in a LDAP directory + * according RFC 2587 + * + *
+	*     crossCertificatePairATTRIBUTE::={
+	*       WITH SYNTAX   CertificatePair
+	*       EQUALITY MATCHING RULE certificatePairExactMatch
+	*       ID joint-iso-ccitt(2) ds(5) attributeType(4) crossCertificatePair(40)}
+	* 
+ * + *
The forward elements of the crossCertificatePair attribute of a + * CA's directory entry shall be used to store all, except self-issued + * certificates issued to this CA. Optionally, the reverse elements of the + * crossCertificatePair attribute, of a CA's directory entry may contain a + * subset of certificates issued by this CA to other CAs. When both the forward + * and the reverse elements are present in a single attribute value, issuer name + * in one certificate shall match the subject name in the other and vice versa, + * and the subject public key in one certificate shall be capable of verifying + * the digital signature on the other certificate and vice versa. + * + * When a reverse element is present, the forward element value and the reverse + * element value need not be stored in the same attribute value; in other words, + * they can be stored in either a single attribute value or two attribute + * values.
+ * + *
+	*       CertificatePair ::= SEQUENCE {
+	*         forward		[0]	Certificate OPTIONAL,
+	*         reverse		[1]	Certificate OPTIONAL,
+	*         -- at least one of the pair shall be present -- }
+	* 
+ */ + public class CertificatePair + : Asn1Encodable + { + private X509CertificateStructure forward, reverse; + + public static CertificatePair GetInstance( + object obj) + { + if (obj == null || obj is CertificatePair) + { + return (CertificatePair) obj; + } + + if (obj is Asn1Sequence) + { + return new CertificatePair((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + *

+ * The sequence is of type CertificatePair: + *

+ *

+		*       CertificatePair ::= SEQUENCE {
+		*         forward		[0]	Certificate OPTIONAL,
+		*         reverse		[1]	Certificate OPTIONAL,
+		*         -- at least one of the pair shall be present -- }
+		* 
+ * + * @param seq The ASN.1 sequence. + */ + private CertificatePair( + Asn1Sequence seq) + { + if (seq.Count != 1 && seq.Count != 2) + { + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + } + + foreach (object obj in seq) + { + Asn1TaggedObject o = Asn1TaggedObject.GetInstance(obj); + if (o.TagNo == 0) + { + forward = X509CertificateStructure.GetInstance(o, true); + } + else if (o.TagNo == 1) + { + reverse = X509CertificateStructure.GetInstance(o, true); + } + else + { + throw new ArgumentException("Bad tag number: " + o.TagNo); + } + } + } + + /** + * Constructor from a given details. + * + * @param forward Certificates issued to this CA. + * @param reverse Certificates issued by this CA to other CAs. + */ + public CertificatePair( + X509CertificateStructure forward, + X509CertificateStructure reverse) + { + this.forward = forward; + this.reverse = reverse; + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*       CertificatePair ::= SEQUENCE {
+		*         forward		[0]	Certificate OPTIONAL,
+		*         reverse		[1]	Certificate OPTIONAL,
+		*         -- at least one of the pair shall be present -- }
+		* 
+ * + * @return a DERObject + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + + if (forward != null) + { + vec.Add(new DerTaggedObject(0, forward)); + } + + if (reverse != null) + { + vec.Add(new DerTaggedObject(1, reverse)); + } + + return new DerSequence(vec); + } + + /** + * @return Returns the forward. + */ + public X509CertificateStructure Forward + { + get { return forward; } + } + + /** + * @return Returns the reverse. + */ + public X509CertificateStructure Reverse + { + get { return reverse; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePair.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePair.cs.meta new file mode 100644 index 00000000..a7499e2a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePair.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4bac5cc073bdfcf45b1f1fb0763c43c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePolicies.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePolicies.cs new file mode 100644 index 00000000..03861a01 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePolicies.cs @@ -0,0 +1,85 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class CertificatePolicies + : Asn1Encodable + { + private readonly PolicyInformation[] policyInformation; + + public static CertificatePolicies GetInstance(object obj) + { + if (obj == null || obj is CertificatePolicies) + return (CertificatePolicies)obj; + + return new CertificatePolicies(Asn1Sequence.GetInstance(obj)); + } + + public static CertificatePolicies GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * Construct a CertificatePolicies object containing one PolicyInformation. + * + * @param name the name to be contained. + */ + public CertificatePolicies(PolicyInformation name) + { + this.policyInformation = new PolicyInformation[] { name }; + } + + public CertificatePolicies(PolicyInformation[] policyInformation) + { + this.policyInformation = policyInformation; + } + + private CertificatePolicies(Asn1Sequence seq) + { + this.policyInformation = new PolicyInformation[seq.Count]; + + for (int i = 0; i < seq.Count; ++i) + { + policyInformation[i] = PolicyInformation.GetInstance(seq[i]); + } + } + + public virtual PolicyInformation[] GetPolicyInformation() + { + return (PolicyInformation[])policyInformation.Clone(); + } + + /** + * Produce an object suitable for an ASN1OutputStream. + *
+         * CertificatePolicies ::= SEQUENCE SIZE {1..MAX} OF PolicyInformation
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(policyInformation); + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder("CertificatePolicies:"); + if (policyInformation != null && policyInformation.Length > 0) + { + sb.Append(' '); + sb.Append(policyInformation[0]); + for (int i = 1; i < policyInformation.Length; ++i) + { + sb.Append(", "); + sb.Append(policyInformation[i]); + } + } + return sb.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePolicies.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePolicies.cs.meta new file mode 100644 index 00000000..bf0f4c97 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/CertificatePolicies.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12b89f11cdff44c448bddabcf8134606 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DSAParameter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DSAParameter.cs new file mode 100644 index 00000000..42cfcf90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DSAParameter.cs @@ -0,0 +1,82 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class DsaParameter + : Asn1Encodable + { + internal readonly DerInteger p, q, g; + + public static DsaParameter GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static DsaParameter GetInstance( + object obj) + { + if(obj == null || obj is DsaParameter) + { + return (DsaParameter) obj; + } + + if(obj is Asn1Sequence) + { + return new DsaParameter((Asn1Sequence) obj); + } + + throw new ArgumentException("Invalid DsaParameter: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public DsaParameter( + BigInteger p, + BigInteger q, + BigInteger g) + { + this.p = new DerInteger(p); + this.q = new DerInteger(q); + this.g = new DerInteger(g); + } + + private DsaParameter( + Asn1Sequence seq) + { + if (seq.Count != 3) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.p = DerInteger.GetInstance(seq[0]); + this.q = DerInteger.GetInstance(seq[1]); + this.g = DerInteger.GetInstance(seq[2]); + } + + public BigInteger P + { + get { return p.PositiveValue; } + } + + public BigInteger Q + { + get { return q.PositiveValue; } + } + + public BigInteger G + { + get { return g.PositiveValue; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(p, q, g); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DSAParameter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DSAParameter.cs.meta new file mode 100644 index 00000000..c8d62cf1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DSAParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 670a21c8c431ee943b56aec700ffc433 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DigestInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DigestInfo.cs new file mode 100644 index 00000000..5fa86011 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DigestInfo.cs @@ -0,0 +1,82 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The DigestInfo object. + *
+     * DigestInfo::=Sequence{
+     *          digestAlgorithm  AlgorithmIdentifier,
+     *          digest OCTET STRING }
+     * 
+ */ + public class DigestInfo + : Asn1Encodable + { + private readonly byte[] digest; + private readonly AlgorithmIdentifier algID; + + public static DigestInfo GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static DigestInfo GetInstance( + object obj) + { + if (obj is DigestInfo) + { + return (DigestInfo) obj; + } + + if (obj is Asn1Sequence) + { + return new DigestInfo((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public DigestInfo( + AlgorithmIdentifier algID, + byte[] digest) + { + this.digest = digest; + this.algID = algID; + } + + private DigestInfo( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Wrong number of elements in sequence", "seq"); + + algID = AlgorithmIdentifier.GetInstance(seq[0]); + digest = Asn1OctetString.GetInstance(seq[1]).GetOctets(); + } + + public AlgorithmIdentifier AlgorithmID + { + get { return algID; } + } + + public byte[] GetDigest() + { + return digest; + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(algID, new DerOctetString(digest)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DigestInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DigestInfo.cs.meta new file mode 100644 index 00000000..59e65b5d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DigestInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bd2bf215172b1644bbeb087773fecc6a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DisplayText.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DisplayText.cs new file mode 100644 index 00000000..f5cebd29 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DisplayText.cs @@ -0,0 +1,178 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * DisplayText class, used in + * CertificatePolicies X509 V3 extensions (in policy qualifiers). + * + *

It stores a string in a chosen encoding. + *

+	 * DisplayText ::= CHOICE {
+	 *      ia5String        IA5String      (SIZE (1..200)),
+	 *      visibleString    VisibleString  (SIZE (1..200)),
+	 *      bmpString        BMPString      (SIZE (1..200)),
+	 *      utf8String       UTF8String     (SIZE (1..200)) }
+	 * 

+ * @see PolicyQualifierInfo + * @see PolicyInformation + */ + public class DisplayText + : Asn1Encodable, IAsn1Choice + { + /** + * Constant corresponding to ia5String encoding. + * + */ + public const int ContentTypeIA5String = 0; + /** + * Constant corresponding to bmpString encoding. + * + */ + public const int ContentTypeBmpString = 1; + /** + * Constant corresponding to utf8String encoding. + * + */ + public const int ContentTypeUtf8String = 2; + /** + * Constant corresponding to visibleString encoding. + * + */ + public const int ContentTypeVisibleString = 3; + /** + * Describe constant DisplayTextMaximumSize here. + * + */ + public const int DisplayTextMaximumSize = 200; + + internal readonly int contentType; + internal readonly IAsn1String contents; + + /** + * Creates a new DisplayText instance. + * + * @param type the desired encoding type for the text. + * @param text the text to store. Strings longer than 200 + * characters are truncated. + */ + public DisplayText( + int type, + string text) + { + if (text.Length > DisplayTextMaximumSize) + { + // RFC3280 limits these strings to 200 chars + // truncate the string + text = text.Substring(0, DisplayTextMaximumSize); + } + + contentType = type; + switch (type) + { + case ContentTypeIA5String: + contents = (IAsn1String)new DerIA5String (text); + break; + case ContentTypeUtf8String: + contents = (IAsn1String)new DerUtf8String(text); + break; + case ContentTypeVisibleString: + contents = (IAsn1String)new DerVisibleString(text); + break; + case ContentTypeBmpString: + contents = (IAsn1String)new DerBmpString(text); + break; + default: + contents = (IAsn1String)new DerUtf8String(text); + break; + } + } + +// /** +// * return true if the passed in string can be represented without +// * loss as a PrintableString, false otherwise. +// */ +// private bool CanBePrintable( +// string str) +// { +// for (int i = str.Length - 1; i >= 0; i--) +// { +// if (str[i] > 0x007f) +// { +// return false; +// } +// } +// +// return true; +// } + + /** + * Creates a new DisplayText instance. + * + * @param text the text to encapsulate. Strings longer than 200 + * characters are truncated. + */ + public DisplayText( + string text) + { + // by default use UTF8String + if (text.Length > DisplayTextMaximumSize) + { + text = text.Substring(0, DisplayTextMaximumSize); + } + + contentType = ContentTypeUtf8String; + contents = new DerUtf8String(text); + } + + /** + * Creates a new DisplayText instance. + *

Useful when reading back a DisplayText class + * from it's Asn1Encodable form.

+ * + * @param contents an Asn1Encodable instance. + */ + public DisplayText( + IAsn1String contents) + { + this.contents = contents; + } + + public static DisplayText GetInstance( + object obj) + { + if (obj is IAsn1String) + { + return new DisplayText((IAsn1String) obj); + } + + if (obj is DisplayText) + { + return (DisplayText) obj; + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public override Asn1Object ToAsn1Object() + { + return (Asn1Object) contents; + } + + /** + * Returns the stored string object. + * + * @return the stored text as a string. + */ + public string GetString() + { + return contents.GetString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DisplayText.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DisplayText.cs.meta new file mode 100644 index 00000000..cec534ac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DisplayText.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9ee75c757afa6a1419afa3acbd6a1dd8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPoint.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPoint.cs new file mode 100644 index 00000000..6b7ab2a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPoint.cs @@ -0,0 +1,165 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The DistributionPoint object. + *
+     * DistributionPoint ::= Sequence {
+     *      distributionPoint [0] DistributionPointName OPTIONAL,
+     *      reasons           [1] ReasonFlags OPTIONAL,
+     *      cRLIssuer         [2] GeneralNames OPTIONAL
+     * }
+     * 
+ */ + public class DistributionPoint + : Asn1Encodable + { + internal readonly DistributionPointName distributionPoint; + internal readonly ReasonFlags reasons; + internal readonly GeneralNames cRLIssuer; + + public static DistributionPoint GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static DistributionPoint GetInstance( + object obj) + { + if(obj == null || obj is DistributionPoint) + { + return (DistributionPoint) obj; + } + + if(obj is Asn1Sequence) + { + return new DistributionPoint((Asn1Sequence) obj); + } + + throw new ArgumentException("Invalid DistributionPoint: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + private DistributionPoint( + Asn1Sequence seq) + { + for (int i = 0; i != seq.Count; i++) + { + Asn1TaggedObject t = Asn1TaggedObject.GetInstance(seq[i]); + + switch (t.TagNo) + { + case 0: + distributionPoint = DistributionPointName.GetInstance(t, true); + break; + case 1: + reasons = new ReasonFlags(DerBitString.GetInstance(t, false)); + break; + case 2: + cRLIssuer = GeneralNames.GetInstance(t, false); + break; + } + } + } + + public DistributionPoint( + DistributionPointName distributionPointName, + ReasonFlags reasons, + GeneralNames crlIssuer) + { + this.distributionPoint = distributionPointName; + this.reasons = reasons; + this.cRLIssuer = crlIssuer; + } + + public DistributionPointName DistributionPointName + { + get { return distributionPoint; } + } + + public ReasonFlags Reasons + { + get { return reasons; } + } + + public GeneralNames CrlIssuer + { + get { return cRLIssuer; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (distributionPoint != null) + { + // + // as this is a CHOICE it must be explicitly tagged + // + v.Add(new DerTaggedObject(0, distributionPoint)); + } + + if (reasons != null) + { + v.Add(new DerTaggedObject(false, 1, reasons)); + } + + if (cRLIssuer != null) + { + v.Add(new DerTaggedObject(false, 2, cRLIssuer)); + } + + return new DerSequence(v); + } + + public override string ToString() + { + string sep = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + StringBuilder buf = new StringBuilder(); + buf.Append("DistributionPoint: ["); + buf.Append(sep); + if (distributionPoint != null) + { + appendObject(buf, sep, "distributionPoint", distributionPoint.ToString()); + } + if (reasons != null) + { + appendObject(buf, sep, "reasons", reasons.ToString()); + } + if (cRLIssuer != null) + { + appendObject(buf, sep, "cRLIssuer", cRLIssuer.ToString()); + } + buf.Append("]"); + buf.Append(sep); + return buf.ToString(); + } + + private void appendObject( + StringBuilder buf, + string sep, + string name, + string val) + { + string indent = " "; + + buf.Append(indent); + buf.Append(name); + buf.Append(":"); + buf.Append(sep); + buf.Append(indent); + buf.Append(indent); + buf.Append(val); + buf.Append(sep); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPoint.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPoint.cs.meta new file mode 100644 index 00000000..e052f087 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e72e206b525eea4fbefb336824b2b3a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPointName.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPointName.cs new file mode 100644 index 00000000..b1007509 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPointName.cs @@ -0,0 +1,134 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The DistributionPointName object. + *
+     * DistributionPointName ::= CHOICE {
+     *     fullName                 [0] GeneralNames,
+     *     nameRelativeToCRLIssuer  [1] RDN
+     * }
+     * 
+ */ + public class DistributionPointName + : Asn1Encodable, IAsn1Choice + { + internal readonly Asn1Encodable name; + internal readonly int type; + + public const int FullName = 0; + public const int NameRelativeToCrlIssuer = 1; + + public static DistributionPointName GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1TaggedObject.GetInstance(obj, true)); + } + + public static DistributionPointName GetInstance( + object obj) + { + if (obj == null || obj is DistributionPointName) + { + return (DistributionPointName) obj; + } + + if (obj is Asn1TaggedObject) + { + return new DistributionPointName((Asn1TaggedObject) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public DistributionPointName( + int type, + Asn1Encodable name) + { + this.type = type; + this.name = name; + } + + public DistributionPointName( + GeneralNames name) + : this(FullName, name) + { + } + + public int PointType + { + get { return type; } + } + + public Asn1Encodable Name + { + get { return name; } + } + + public DistributionPointName( + Asn1TaggedObject obj) + { + this.type = obj.TagNo; + + if (type == FullName) + { + this.name = GeneralNames.GetInstance(obj, false); + } + else + { + this.name = Asn1Set.GetInstance(obj, false); + } + } + + public override Asn1Object ToAsn1Object() + { + return new DerTaggedObject(false, type, name); + } + + public override string ToString() + { + string sep = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + StringBuilder buf = new StringBuilder(); + buf.Append("DistributionPointName: ["); + buf.Append(sep); + if (type == FullName) + { + appendObject(buf, sep, "fullName", name.ToString()); + } + else + { + appendObject(buf, sep, "nameRelativeToCRLIssuer", name.ToString()); + } + buf.Append("]"); + buf.Append(sep); + return buf.ToString(); + } + + private void appendObject( + StringBuilder buf, + string sep, + string name, + string val) + { + string indent = " "; + + buf.Append(indent); + buf.Append(name); + buf.Append(":"); + buf.Append(sep); + buf.Append(indent); + buf.Append(indent); + buf.Append(val); + buf.Append(sep); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPointName.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPointName.cs.meta new file mode 100644 index 00000000..e291cf76 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/DistributionPointName.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7447a6a6bf3d479479bc3c2ba4ea9617 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ExtendedKeyUsage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ExtendedKeyUsage.cs new file mode 100644 index 00000000..422d749f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ExtendedKeyUsage.cs @@ -0,0 +1,136 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The extendedKeyUsage object. + *
+     *      extendedKeyUsage ::= Sequence SIZE (1..MAX) OF KeyPurposeId
+     * 
+ */ + public class ExtendedKeyUsage + : Asn1Encodable + { + internal readonly IDictionary usageTable = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + internal readonly Asn1Sequence seq; + + public static ExtendedKeyUsage GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static ExtendedKeyUsage GetInstance( + object obj) + { + if (obj is ExtendedKeyUsage) + { + return (ExtendedKeyUsage) obj; + } + + if (obj is Asn1Sequence) + { + return new ExtendedKeyUsage((Asn1Sequence) obj); + } + + if (obj is X509Extension) + { + return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); + } + + throw new ArgumentException("Invalid ExtendedKeyUsage: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + private ExtendedKeyUsage( + Asn1Sequence seq) + { + this.seq = seq; + + foreach (object o in seq) + { + if (!(o is DerObjectIdentifier)) + throw new ArgumentException("Only DerObjectIdentifier instances allowed in ExtendedKeyUsage."); + + this.usageTable[o] = o; + } + } + + public ExtendedKeyUsage( + params KeyPurposeID[] usages) + { + this.seq = new DerSequence(usages); + + foreach (KeyPurposeID usage in usages) + { + this.usageTable[usage] = usage; + } + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete] + public ExtendedKeyUsage( + ArrayList usages) + : this((IEnumerable)usages) + { + } +#endif + + public ExtendedKeyUsage( + IEnumerable usages) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + foreach (object usage in usages) + { + Asn1Encodable o = KeyPurposeID.GetInstance(usage); + + v.Add(o); + this.usageTable[o] = o; + } + + this.seq = new DerSequence(v); + } + + public bool HasKeyPurposeId( + KeyPurposeID keyPurposeId) + { + return usageTable.Contains(keyPurposeId); + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete("Use 'GetAllUsages'")] + public ArrayList GetUsages() + { + return new ArrayList(usageTable.Values); + } +#endif + + /** + * Returns all extended key usages. + * The returned ArrayList contains DerObjectIdentifier instances. + * @return An ArrayList with all key purposes. + */ + public IList GetAllUsages() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(usageTable.Values); + } + + public int Count + { + get { return usageTable.Count; } + } + + public override Asn1Object ToAsn1Object() + { + return seq; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ExtendedKeyUsage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ExtendedKeyUsage.cs.meta new file mode 100644 index 00000000..83e61718 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ExtendedKeyUsage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2eb2d825f1d7b914cbf02056314ce462 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralName.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralName.cs new file mode 100644 index 00000000..becc88a2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralName.cs @@ -0,0 +1,423 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Globalization; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using NetUtils = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Net; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The GeneralName object. + *
+     * GeneralName ::= CHOICE {
+     *      otherName                       [0]     OtherName,
+     *      rfc822Name                      [1]     IA5String,
+     *      dNSName                         [2]     IA5String,
+     *      x400Address                     [3]     ORAddress,
+     *      directoryName                   [4]     Name,
+     *      ediPartyName                    [5]     EDIPartyName,
+     *      uniformResourceIdentifier       [6]     IA5String,
+     *      iPAddress                       [7]     OCTET STRING,
+     *      registeredID                    [8]     OBJECT IDENTIFIER}
+     *
+     * OtherName ::= Sequence {
+     *      type-id    OBJECT IDENTIFIER,
+     *      value      [0] EXPLICIT ANY DEFINED BY type-id }
+     *
+     * EDIPartyName ::= Sequence {
+     *      nameAssigner            [0]     DirectoryString OPTIONAL,
+     *      partyName               [1]     DirectoryString }
+     * 
+ */ + public class GeneralName + : Asn1Encodable, IAsn1Choice + { + public const int OtherName = 0; + public const int Rfc822Name = 1; + public const int DnsName = 2; + public const int X400Address = 3; + public const int DirectoryName = 4; + public const int EdiPartyName = 5; + public const int UniformResourceIdentifier = 6; + public const int IPAddress = 7; + public const int RegisteredID = 8; + + internal readonly Asn1Encodable obj; + internal readonly int tag; + + public GeneralName( + X509Name directoryName) + { + this.obj = directoryName; + this.tag = 4; + } + + /** + * When the subjectAltName extension contains an Internet mail address, + * the address MUST be included as an rfc822Name. The format of an + * rfc822Name is an "addr-spec" as defined in RFC 822 [RFC 822]. + * + * When the subjectAltName extension contains a domain name service + * label, the domain name MUST be stored in the dNSName (an IA5String). + * The name MUST be in the "preferred name syntax," as specified by RFC + * 1034 [RFC 1034]. + * + * When the subjectAltName extension contains a URI, the name MUST be + * stored in the uniformResourceIdentifier (an IA5String). The name MUST + * be a non-relative URL, and MUST follow the URL syntax and encoding + * rules specified in [RFC 1738]. The name must include both a scheme + * (e.g., "http" or "ftp") and a scheme-specific-part. The scheme- + * specific-part must include a fully qualified domain name or IP + * address as the host. + * + * When the subjectAltName extension contains a iPAddress, the address + * MUST be stored in the octet string in "network byte order," as + * specified in RFC 791 [RFC 791]. The least significant bit (LSB) of + * each octet is the LSB of the corresponding byte in the network + * address. For IP Version 4, as specified in RFC 791, the octet string + * MUST contain exactly four octets. For IP Version 6, as specified in + * RFC 1883, the octet string MUST contain exactly sixteen octets [RFC + * 1883]. + */ + public GeneralName( + Asn1Object name, + int tag) + { + this.obj = name; + this.tag = tag; + } + + public GeneralName( + int tag, + Asn1Encodable name) + { + this.obj = name; + this.tag = tag; + } + + /** + * Create a GeneralName for the given tag from the passed in string. + *

+ * This constructor can handle: + *

    + *
  • rfc822Name
  • + *
  • iPAddress
  • + *
  • directoryName
  • + *
  • dNSName
  • + *
  • uniformResourceIdentifier
  • + *
  • registeredID
  • + *
+ * For x400Address, otherName and ediPartyName there is no common string + * format defined. + *

+ * Note: A directory name can be encoded in different ways into a byte + * representation. Be aware of this if the byte representation is used for + * comparing results. + *

+ * + * @param tag tag number + * @param name string representation of name + * @throws ArgumentException if the string encoding is not correct or + * not supported. + */ + public GeneralName( + int tag, + string name) + { + this.tag = tag; + + if (tag == Rfc822Name || tag == DnsName || tag == UniformResourceIdentifier) + { + this.obj = new DerIA5String(name); + } + else if (tag == RegisteredID) + { + this.obj = new DerObjectIdentifier(name); + } + else if (tag == DirectoryName) + { + this.obj = new X509Name(name); + } + else if (tag == IPAddress) + { + byte[] enc = toGeneralNameEncoding(name); + if (enc == null) + throw new ArgumentException("IP Address is invalid", "name"); + + this.obj = new DerOctetString(enc); + } + else + { + throw new ArgumentException("can't process string for tag: " + tag, "tag"); + } + } + + public static GeneralName GetInstance( + object obj) + { + if (obj == null || obj is GeneralName) + { + return (GeneralName) obj; + } + + if (obj is Asn1TaggedObject) + { + Asn1TaggedObject tagObj = (Asn1TaggedObject) obj; + int tag = tagObj.TagNo; + + switch (tag) + { + case OtherName: + return new GeneralName(tag, Asn1Sequence.GetInstance(tagObj, false)); + case Rfc822Name: + return new GeneralName(tag, DerIA5String.GetInstance(tagObj, false)); + case DnsName: + return new GeneralName(tag, DerIA5String.GetInstance(tagObj, false)); + case X400Address: + throw new ArgumentException("unknown tag: " + tag); + case DirectoryName: + return new GeneralName(tag, X509Name.GetInstance(tagObj, true)); + case EdiPartyName: + return new GeneralName(tag, Asn1Sequence.GetInstance(tagObj, false)); + case UniformResourceIdentifier: + return new GeneralName(tag, DerIA5String.GetInstance(tagObj, false)); + case IPAddress: + return new GeneralName(tag, Asn1OctetString.GetInstance(tagObj, false)); + case RegisteredID: + return new GeneralName(tag, DerObjectIdentifier.GetInstance(tagObj, false)); + } + } + + if (obj is byte[]) + { + try + { + return GetInstance(Asn1Object.FromByteArray((byte[])obj)); + } + catch (IOException) + { + throw new ArgumentException("unable to parse encoded general name"); + } + } + + throw new ArgumentException("unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static GeneralName GetInstance( + Asn1TaggedObject tagObj, + bool explicitly) + { + return GetInstance(Asn1TaggedObject.GetInstance(tagObj, true)); + } + + public int TagNo + { + get { return tag; } + } + + public Asn1Encodable Name + { + get { return obj; } + } + + public override string ToString() + { + StringBuilder buf = new StringBuilder(); + buf.Append(tag); + buf.Append(": "); + + switch (tag) + { + case Rfc822Name: + case DnsName: + case UniformResourceIdentifier: + buf.Append(DerIA5String.GetInstance(obj).GetString()); + break; + case DirectoryName: + buf.Append(X509Name.GetInstance(obj).ToString()); + break; + default: + buf.Append(obj.ToString()); + break; + } + + return buf.ToString(); + } + + private byte[] toGeneralNameEncoding( + string ip) + { + if (NetUtils.IPAddress.IsValidIPv6WithNetmask(ip) || NetUtils.IPAddress.IsValidIPv6(ip)) + { + int slashIndex = ip.IndexOf('/'); + + if (slashIndex < 0) + { + byte[] addr = new byte[16]; + int[] parsedIp = parseIPv6(ip); + copyInts(parsedIp, addr, 0); + + return addr; + } + else + { + byte[] addr = new byte[32]; + int[] parsedIp = parseIPv6(ip.Substring(0, slashIndex)); + copyInts(parsedIp, addr, 0); + string mask = ip.Substring(slashIndex + 1); + if (mask.IndexOf(':') > 0) + { + parsedIp = parseIPv6(mask); + } + else + { + parsedIp = parseMask(mask); + } + copyInts(parsedIp, addr, 16); + + return addr; + } + } + else if (NetUtils.IPAddress.IsValidIPv4WithNetmask(ip) || NetUtils.IPAddress.IsValidIPv4(ip)) + { + int slashIndex = ip.IndexOf('/'); + + if (slashIndex < 0) + { + byte[] addr = new byte[4]; + + parseIPv4(ip, addr, 0); + + return addr; + } + else + { + byte[] addr = new byte[8]; + + parseIPv4(ip.Substring(0, slashIndex), addr, 0); + + string mask = ip.Substring(slashIndex + 1); + if (mask.IndexOf('.') > 0) + { + parseIPv4(mask, addr, 4); + } + else + { + parseIPv4Mask(mask, addr, 4); + } + + return addr; + } + } + + return null; + } + + private void parseIPv4Mask(string mask, byte[] addr, int offset) + { + int maskVal = Int32.Parse(mask); + + for (int i = 0; i != maskVal; i++) + { + addr[(i / 8) + offset] |= (byte)(1 << (i % 8)); + } + } + + private void parseIPv4(string ip, byte[] addr, int offset) + { + foreach (string token in ip.Split('.', '/')) + { + addr[offset++] = (byte)Int32.Parse(token); + } + } + + private int[] parseMask(string mask) + { + int[] res = new int[8]; + int maskVal = Int32.Parse(mask); + + for (int i = 0; i != maskVal; i++) + { + res[i / 16] |= 1 << (i % 16); + } + return res; + } + + private void copyInts(int[] parsedIp, byte[] addr, int offSet) + { + for (int i = 0; i != parsedIp.Length; i++) + { + addr[(i * 2) + offSet] = (byte)(parsedIp[i] >> 8); + addr[(i * 2 + 1) + offSet] = (byte)parsedIp[i]; + } + } + + private int[] parseIPv6(string ip) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(ip, "::")) + { + ip = ip.Substring(1); + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(ip, "::")) + { + ip = ip.Substring(0, ip.Length - 1); + } + + IEnumerator sEnum = ip.Split(':').GetEnumerator(); + + int index = 0; + int[] val = new int[8]; + + int doubleColon = -1; + + while (sEnum.MoveNext()) + { + string e = (string) sEnum.Current; + + if (e.Length == 0) + { + doubleColon = index; + val[index++] = 0; + } + else + { + if (e.IndexOf('.') < 0) + { + val[index++] = Int32.Parse(e, NumberStyles.AllowHexSpecifier); + } + else + { + string[] tokens = e.Split('.'); + + val[index++] = (Int32.Parse(tokens[0]) << 8) | Int32.Parse(tokens[1]); + val[index++] = (Int32.Parse(tokens[2]) << 8) | Int32.Parse(tokens[3]); + } + } + } + + if (index != val.Length) + { + Array.Copy(val, doubleColon, val, val.Length - (index - doubleColon), index - doubleColon); + for (int i = doubleColon; i != val.Length - (index - doubleColon); i++) + { + val[i] = 0; + } + } + + return val; + } + + public override Asn1Object ToAsn1Object() + { + // Explicitly tagged if DirectoryName + return new DerTaggedObject(tag == DirectoryName, tag, obj); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralName.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralName.cs.meta new file mode 100644 index 00000000..2ce0ce85 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralName.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f9fa15cc99df23488aa1a0f35bb278d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralNames.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralNames.cs new file mode 100644 index 00000000..c1c887ff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralNames.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class GeneralNames + : Asn1Encodable + { + private readonly GeneralName[] names; + + public static GeneralNames GetInstance( + object obj) + { + if (obj == null || obj is GeneralNames) + { + return (GeneralNames) obj; + } + + if (obj is Asn1Sequence) + { + return new GeneralNames((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static GeneralNames GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + /// Construct a GeneralNames object containing one GeneralName. + /// The name to be contained. + public GeneralNames( + GeneralName name) + { + names = new GeneralName[]{ name }; + } + + public GeneralNames( + GeneralName[] names) + { + this.names = (GeneralName[])names.Clone(); + } + + private GeneralNames( + Asn1Sequence seq) + { + this.names = new GeneralName[seq.Count]; + + for (int i = 0; i != seq.Count; i++) + { + names[i] = GeneralName.GetInstance(seq[i]); + } + } + + public GeneralName[] GetNames() + { + return (GeneralName[]) names.Clone(); + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+		 * GeneralNames ::= Sequence SIZE {1..MAX} OF GeneralName
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(names); + } + + public override string ToString() + { + StringBuilder buf = new StringBuilder(); + string sep = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + + buf.Append("GeneralNames:"); + buf.Append(sep); + + foreach (GeneralName name in names) + { + buf.Append(" "); + buf.Append(name); + buf.Append(sep); + } + + return buf.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralNames.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralNames.cs.meta new file mode 100644 index 00000000..e9140dd6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralNames.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f5291483fbf63c488fd9c2eb029e9bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralSubtree.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralSubtree.cs new file mode 100644 index 00000000..51348d9d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralSubtree.cs @@ -0,0 +1,193 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Class for containing a restriction object subtrees in NameConstraints. See + * RFC 3280. + * + *
+	 *
+	 *       GeneralSubtree ::= SEQUENCE
+	 *       {
+	 *         baseName                    GeneralName,
+	 *         minimum         [0]     BaseDistance DEFAULT 0,
+	 *         maximum         [1]     BaseDistance OPTIONAL
+	 *       }
+	 * 
+ * + * @see org.bouncycastle.asn1.x509.NameConstraints + * + */ + public class GeneralSubtree + : Asn1Encodable + { + private readonly GeneralName baseName; + private readonly DerInteger minimum; + private readonly DerInteger maximum; + + private GeneralSubtree( + Asn1Sequence seq) + { + baseName = GeneralName.GetInstance(seq[0]); + + switch (seq.Count) + { + case 1: + break; + case 2: + { + Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[1]); + switch (o.TagNo) + { + case 0: + minimum = DerInteger.GetInstance(o, false); + break; + case 1: + maximum = DerInteger.GetInstance(o, false); + break; + default: + throw new ArgumentException("Bad tag number: " + o.TagNo); + } + break; + } + case 3: + { + { + Asn1TaggedObject oMin = Asn1TaggedObject.GetInstance(seq[1]); + if (oMin.TagNo != 0) + throw new ArgumentException("Bad tag number for 'minimum': " + oMin.TagNo); + minimum = DerInteger.GetInstance(oMin, false); + } + + { + Asn1TaggedObject oMax = Asn1TaggedObject.GetInstance(seq[2]); + if (oMax.TagNo != 1) + throw new ArgumentException("Bad tag number for 'maximum': " + oMax.TagNo); + maximum = DerInteger.GetInstance(oMax, false); + } + + break; + } + default: + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + } + + /** + * Constructor from a given details. + * + * According RFC 3280, the minimum and maximum fields are not used with any + * name forms, thus minimum MUST be zero, and maximum MUST be absent. + *

+ * If minimum is null, zero is assumed, if + * maximum is null, maximum is absent.

+ * + * @param baseName + * A restriction. + * @param minimum + * Minimum + * + * @param maximum + * Maximum + */ + public GeneralSubtree( + GeneralName baseName, + BigInteger minimum, + BigInteger maximum) + { + this.baseName = baseName; + if (minimum != null) + { + this.minimum = new DerInteger(minimum); + } + if (maximum != null) + { + this.maximum = new DerInteger(maximum); + } + } + + public GeneralSubtree( + GeneralName baseName) + : this(baseName, null, null) + { + } + + public static GeneralSubtree GetInstance( + Asn1TaggedObject o, + bool isExplicit) + { + return new GeneralSubtree(Asn1Sequence.GetInstance(o, isExplicit)); + } + + public static GeneralSubtree GetInstance( + object obj) + { + if (obj == null) + { + return null; + } + + if (obj is GeneralSubtree) + { + return (GeneralSubtree) obj; + } + + return new GeneralSubtree(Asn1Sequence.GetInstance(obj)); + } + + public GeneralName Base + { + get { return baseName; } + } + + public BigInteger Minimum + { + get { return minimum == null ? BigInteger.Zero : minimum.Value; } + } + + public BigInteger Maximum + { + get { return maximum == null ? null : maximum.Value; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + * + * Returns: + * + *
+		 *       GeneralSubtree ::= SEQUENCE
+		 *       {
+		 *         baseName                    GeneralName,
+		 *         minimum         [0]     BaseDistance DEFAULT 0,
+		 *         maximum         [1]     BaseDistance OPTIONAL
+		 *       }
+		 * 
+ * + * @return a DERObject + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(baseName); + + if (minimum != null && minimum.Value.SignValue != 0) + { + v.Add(new DerTaggedObject(false, 0, minimum)); + } + + if (maximum != null) + { + v.Add(new DerTaggedObject(false, 1, maximum)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralSubtree.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralSubtree.cs.meta new file mode 100644 index 00000000..e28a73aa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/GeneralSubtree.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc8548e99749b9d48b6261e328373569 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Holder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Holder.cs new file mode 100644 index 00000000..c02240c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Holder.cs @@ -0,0 +1,263 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The Holder object. + *

+ * For an v2 attribute certificate this is: + * + *

+	 *            Holder ::= SEQUENCE {
+	 *                  baseCertificateID   [0] IssuerSerial OPTIONAL,
+	 *                           -- the issuer and serial number of
+	 *                           -- the holder's Public Key Certificate
+	 *                  entityName          [1] GeneralNames OPTIONAL,
+	 *                           -- the name of the claimant or role
+	 *                  objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
+	 *                           -- used to directly authenticate the holder,
+	 *                           -- for example, an executable
+	 *            }
+	 * 
+ *

+ *

+ * For an v1 attribute certificate this is: + * + *

+	 *         subject CHOICE {
+	 *          baseCertificateID [0] IssuerSerial,
+	 *          -- associated with a Public Key Certificate
+	 *          subjectName [1] GeneralNames },
+	 *          -- associated with a name
+	 * 
+ *

+ */ + public class Holder + : Asn1Encodable + { + internal readonly IssuerSerial baseCertificateID; + internal readonly GeneralNames entityName; + internal readonly ObjectDigestInfo objectDigestInfo; + private readonly int version; + + public static Holder GetInstance( + object obj) + { + if (obj is Holder) + { + return (Holder) obj; + } + + if (obj is Asn1Sequence) + { + return new Holder((Asn1Sequence) obj); + } + + if (obj is Asn1TaggedObject) + { + return new Holder((Asn1TaggedObject) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor for a holder for an v1 attribute certificate. + * + * @param tagObj The ASN.1 tagged holder object. + */ + public Holder( + Asn1TaggedObject tagObj) + { + switch (tagObj.TagNo) + { + case 0: + baseCertificateID = IssuerSerial.GetInstance(tagObj, false); + break; + case 1: + entityName = GeneralNames.GetInstance(tagObj, false); + break; + default: + throw new ArgumentException("unknown tag in Holder"); + } + + this.version = 0; + } + + /** + * Constructor for a holder for an v2 attribute certificate. * + * + * @param seq The ASN.1 sequence. + */ + private Holder( + Asn1Sequence seq) + { + if (seq.Count > 3) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + for (int i = 0; i != seq.Count; i++) + { + Asn1TaggedObject tObj = Asn1TaggedObject.GetInstance(seq[i]); + + switch (tObj.TagNo) + { + case 0: + baseCertificateID = IssuerSerial.GetInstance(tObj, false); + break; + case 1: + entityName = GeneralNames.GetInstance(tObj, false); + break; + case 2: + objectDigestInfo = ObjectDigestInfo.GetInstance(tObj, false); + break; + default: + throw new ArgumentException("unknown tag in Holder"); + } + } + + this.version = 1; + } + + public Holder( + IssuerSerial baseCertificateID) + : this(baseCertificateID, 1) + { + } + + /** + * Constructs a holder from a IssuerSerial. + * @param baseCertificateID The IssuerSerial. + * @param version The version of the attribute certificate. + */ + public Holder( + IssuerSerial baseCertificateID, + int version) + { + this.baseCertificateID = baseCertificateID; + this.version = version; + } + + /** + * Returns 1 for v2 attribute certificates or 0 for v1 attribute + * certificates. + * @return The version of the attribute certificate. + */ + public int Version + { + get { return version; } + } + + /** + * Constructs a holder with an entityName for v2 attribute certificates or + * with a subjectName for v1 attribute certificates. + * + * @param entityName The entity or subject name. + */ + public Holder( + GeneralNames entityName) + : this(entityName, 1) + { + } + + /** + * Constructs a holder with an entityName for v2 attribute certificates or + * with a subjectName for v1 attribute certificates. + * + * @param entityName The entity or subject name. + * @param version The version of the attribute certificate. + */ + public Holder( + GeneralNames entityName, + int version) + { + this.entityName = entityName; + this.version = version; + } + + /** + * Constructs a holder from an object digest info. + * + * @param objectDigestInfo The object digest info object. + */ + public Holder( + ObjectDigestInfo objectDigestInfo) + { + this.objectDigestInfo = objectDigestInfo; + this.version = 1; + } + + public IssuerSerial BaseCertificateID + { + get { return baseCertificateID; } + } + + /** + * Returns the entityName for an v2 attribute certificate or the subjectName + * for an v1 attribute certificate. + * + * @return The entityname or subjectname. + */ + public GeneralNames EntityName + { + get { return entityName; } + } + + public ObjectDigestInfo ObjectDigestInfo + { + get { return objectDigestInfo; } + } + + /** + * The Holder object. + *
+         *  Holder ::= Sequence {
+         *        baseCertificateID   [0] IssuerSerial OPTIONAL,
+         *                 -- the issuer and serial number of
+         *                 -- the holder's Public Key Certificate
+         *        entityName          [1] GeneralNames OPTIONAL,
+         *                 -- the name of the claimant or role
+         *        objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
+         *                 -- used to directly authenticate the holder,
+         *                 -- for example, an executable
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + if (version == 1) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (baseCertificateID != null) + { + v.Add(new DerTaggedObject(false, 0, baseCertificateID)); + } + + if (entityName != null) + { + v.Add(new DerTaggedObject(false, 1, entityName)); + } + + if (objectDigestInfo != null) + { + v.Add(new DerTaggedObject(false, 2, objectDigestInfo)); + } + + return new DerSequence(v); + } + + if (entityName != null) + { + return new DerTaggedObject(false, 1, entityName); + } + + return new DerTaggedObject(false, 0, baseCertificateID); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Holder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Holder.cs.meta new file mode 100644 index 00000000..64ecd73c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Holder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c9e8d3105c3fd874f887aff60be61f33 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IetfAttrSyntax.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IetfAttrSyntax.cs new file mode 100644 index 00000000..5d2d03eb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IetfAttrSyntax.cs @@ -0,0 +1,165 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Implementation of IetfAttrSyntax as specified by RFC3281. + */ + public class IetfAttrSyntax + : Asn1Encodable + { + public const int ValueOctets = 1; + public const int ValueOid = 2; + public const int ValueUtf8 = 3; + + internal readonly GeneralNames policyAuthority; + internal readonly Asn1EncodableVector values = new Asn1EncodableVector(); + + internal int valueChoice = -1; + + /** + * + */ + public IetfAttrSyntax( + Asn1Sequence seq) + { + int i = 0; + + if (seq[0] is Asn1TaggedObject) + { + policyAuthority = GeneralNames.GetInstance(((Asn1TaggedObject)seq[0]), false); + i++; + } + else if (seq.Count == 2) + { // VOMS fix + policyAuthority = GeneralNames.GetInstance(seq[0]); + i++; + } + + if (!(seq[i] is Asn1Sequence)) + { + throw new ArgumentException("Non-IetfAttrSyntax encoding"); + } + + seq = (Asn1Sequence) seq[i]; + + foreach (Asn1Object obj in seq) + { + int type; + + if (obj is DerObjectIdentifier) + { + type = ValueOid; + } + else if (obj is DerUtf8String) + { + type = ValueUtf8; + } + else if (obj is DerOctetString) + { + type = ValueOctets; + } + else + { + throw new ArgumentException("Bad value type encoding IetfAttrSyntax"); + } + + if (valueChoice < 0) + { + valueChoice = type; + } + + if (type != valueChoice) + { + throw new ArgumentException("Mix of value types in IetfAttrSyntax"); + } + + values.Add(obj); + } + } + + public GeneralNames PolicyAuthority + { + get { return policyAuthority; } + } + + public int ValueType + { + get { return valueChoice; } + } + + public object[] GetValues() + { + if (this.ValueType == ValueOctets) + { + Asn1OctetString[] tmp = new Asn1OctetString[values.Count]; + + for (int i = 0; i != tmp.Length; i++) + { + tmp[i] = (Asn1OctetString) values[i]; + } + + return tmp; + } + + if (this.ValueType == ValueOid) + { + DerObjectIdentifier[] tmp = new DerObjectIdentifier[values.Count]; + + for (int i = 0; i != tmp.Length; i++) + { + tmp[i] = (DerObjectIdentifier) values[i]; + } + + return tmp; + } + + { + DerUtf8String[] tmp = new DerUtf8String[values.Count]; + + for (int i = 0; i != tmp.Length; i++) + { + tmp[i] = (DerUtf8String) values[i]; + } + + return tmp; + } + } + + /** + * + *
+         *
+         *  IetfAttrSyntax ::= Sequence {
+         *    policyAuthority [0] GeneralNames OPTIONAL,
+         *    values Sequence OF CHOICE {
+         *      octets OCTET STRING,
+         *      oid OBJECT IDENTIFIER,
+         *      string UTF8String
+         *    }
+         *  }
+         *
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (policyAuthority != null) + { + v.Add(new DerTaggedObject(0, policyAuthority)); + } + + v.Add(new DerSequence(values)); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IetfAttrSyntax.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IetfAttrSyntax.cs.meta new file mode 100644 index 00000000..4950c8ad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IetfAttrSyntax.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be6b4b59a6ec29e45b85a8a741b98acf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuerSerial.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuerSerial.cs new file mode 100644 index 00000000..bcd4e1f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuerSerial.cs @@ -0,0 +1,104 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class IssuerSerial + : Asn1Encodable + { + internal readonly GeneralNames issuer; + internal readonly DerInteger serial; + internal readonly DerBitString issuerUid; + + public static IssuerSerial GetInstance( + object obj) + { + if (obj == null || obj is IssuerSerial) + { + return (IssuerSerial) obj; + } + + if (obj is Asn1Sequence) + { + return new IssuerSerial((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static IssuerSerial GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + private IssuerSerial( + Asn1Sequence seq) + { + if (seq.Count != 2 && seq.Count != 3) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + issuer = GeneralNames.GetInstance(seq[0]); + serial = DerInteger.GetInstance(seq[1]); + + if (seq.Count == 3) + { + issuerUid = DerBitString.GetInstance(seq[2]); + } + } + + public IssuerSerial( + GeneralNames issuer, + DerInteger serial) + { + this.issuer = issuer; + this.serial = serial; + } + + public GeneralNames Issuer + { + get { return issuer; } + } + + public DerInteger Serial + { + get { return serial; } + } + + public DerBitString IssuerUid + { + get { return issuerUid; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  IssuerSerial  ::=  Sequence {
+         *       issuer         GeneralNames,
+         *       serial         CertificateSerialNumber,
+         *       issuerUid      UniqueIdentifier OPTIONAL
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + issuer, serial); + + if (issuerUid != null) + { + v.Add(issuerUid); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuerSerial.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuerSerial.cs.meta new file mode 100644 index 00000000..58d95924 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuerSerial.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e8781dee073516046a951024b1e4f4f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuingDistributionPoint.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuingDistributionPoint.cs new file mode 100644 index 00000000..7acae10d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuingDistributionPoint.cs @@ -0,0 +1,251 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + *
+	 * IssuingDistributionPoint ::= SEQUENCE { 
+	 *   distributionPoint          [0] DistributionPointName OPTIONAL, 
+	 *   onlyContainsUserCerts      [1] BOOLEAN DEFAULT FALSE, 
+	 *   onlyContainsCACerts        [2] BOOLEAN DEFAULT FALSE, 
+	 *   onlySomeReasons            [3] ReasonFlags OPTIONAL, 
+	 *   indirectCRL                [4] BOOLEAN DEFAULT FALSE,
+	 *   onlyContainsAttributeCerts [5] BOOLEAN DEFAULT FALSE }
+	 * 
+ */ + public class IssuingDistributionPoint + : Asn1Encodable + { + private readonly DistributionPointName _distributionPoint; + private readonly bool _onlyContainsUserCerts; + private readonly bool _onlyContainsCACerts; + private readonly ReasonFlags _onlySomeReasons; + private readonly bool _indirectCRL; + private readonly bool _onlyContainsAttributeCerts; + + private readonly Asn1Sequence seq; + + public static IssuingDistributionPoint GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static IssuingDistributionPoint GetInstance( + object obj) + { + if (obj == null || obj is IssuingDistributionPoint) + { + return (IssuingDistributionPoint) obj; + } + + if (obj is Asn1Sequence) + { + return new IssuingDistributionPoint((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from given details. + * + * @param distributionPoint + * May contain an URI as pointer to most current CRL. + * @param onlyContainsUserCerts Covers revocation information for end certificates. + * @param onlyContainsCACerts Covers revocation information for CA certificates. + * + * @param onlySomeReasons + * Which revocation reasons does this point cover. + * @param indirectCRL + * If true then the CRL contains revocation + * information about certificates ssued by other CAs. + * @param onlyContainsAttributeCerts Covers revocation information for attribute certificates. + */ + public IssuingDistributionPoint( + DistributionPointName distributionPoint, + bool onlyContainsUserCerts, + bool onlyContainsCACerts, + ReasonFlags onlySomeReasons, + bool indirectCRL, + bool onlyContainsAttributeCerts) + { + this._distributionPoint = distributionPoint; + this._indirectCRL = indirectCRL; + this._onlyContainsAttributeCerts = onlyContainsAttributeCerts; + this._onlyContainsCACerts = onlyContainsCACerts; + this._onlyContainsUserCerts = onlyContainsUserCerts; + this._onlySomeReasons = onlySomeReasons; + + Asn1EncodableVector vec = new Asn1EncodableVector(); + if (distributionPoint != null) + { // CHOICE item so explicitly tagged + vec.Add(new DerTaggedObject(true, 0, distributionPoint)); + } + if (onlyContainsUserCerts) + { + vec.Add(new DerTaggedObject(false, 1, DerBoolean.True)); + } + if (onlyContainsCACerts) + { + vec.Add(new DerTaggedObject(false, 2, DerBoolean.True)); + } + if (onlySomeReasons != null) + { + vec.Add(new DerTaggedObject(false, 3, onlySomeReasons)); + } + if (indirectCRL) + { + vec.Add(new DerTaggedObject(false, 4, DerBoolean.True)); + } + if (onlyContainsAttributeCerts) + { + vec.Add(new DerTaggedObject(false, 5, DerBoolean.True)); + } + + seq = new DerSequence(vec); + } + + /** + * Constructor from Asn1Sequence + */ + private IssuingDistributionPoint( + Asn1Sequence seq) + { + this.seq = seq; + + for (int i = 0; i != seq.Count; i++) + { + Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[i]); + + switch (o.TagNo) + { + case 0: + // CHOICE so explicit + _distributionPoint = DistributionPointName.GetInstance(o, true); + break; + case 1: + _onlyContainsUserCerts = DerBoolean.GetInstance(o, false).IsTrue; + break; + case 2: + _onlyContainsCACerts = DerBoolean.GetInstance(o, false).IsTrue; + break; + case 3: + _onlySomeReasons = new ReasonFlags(ReasonFlags.GetInstance(o, false)); + break; + case 4: + _indirectCRL = DerBoolean.GetInstance(o, false).IsTrue; + break; + case 5: + _onlyContainsAttributeCerts = DerBoolean.GetInstance(o, false).IsTrue; + break; + default: + throw new ArgumentException("unknown tag in IssuingDistributionPoint"); + } + } + } + + public bool OnlyContainsUserCerts + { + get { return _onlyContainsUserCerts; } + } + + public bool OnlyContainsCACerts + { + get { return _onlyContainsCACerts; } + } + + public bool IsIndirectCrl + { + get { return _indirectCRL; } + } + + public bool OnlyContainsAttributeCerts + { + get { return _onlyContainsAttributeCerts; } + } + + /** + * @return Returns the distributionPoint. + */ + public DistributionPointName DistributionPoint + { + get { return _distributionPoint; } + } + + /** + * @return Returns the onlySomeReasons. + */ + public ReasonFlags OnlySomeReasons + { + get { return _onlySomeReasons; } + } + + public override Asn1Object ToAsn1Object() + { + return seq; + } + + public override string ToString() + { + string sep = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + StringBuilder buf = new StringBuilder(); + + buf.Append("IssuingDistributionPoint: ["); + buf.Append(sep); + if (_distributionPoint != null) + { + appendObject(buf, sep, "distributionPoint", _distributionPoint.ToString()); + } + if (_onlyContainsUserCerts) + { + appendObject(buf, sep, "onlyContainsUserCerts", _onlyContainsUserCerts.ToString()); + } + if (_onlyContainsCACerts) + { + appendObject(buf, sep, "onlyContainsCACerts", _onlyContainsCACerts.ToString()); + } + if (_onlySomeReasons != null) + { + appendObject(buf, sep, "onlySomeReasons", _onlySomeReasons.ToString()); + } + if (_onlyContainsAttributeCerts) + { + appendObject(buf, sep, "onlyContainsAttributeCerts", _onlyContainsAttributeCerts.ToString()); + } + if (_indirectCRL) + { + appendObject(buf, sep, "indirectCRL", _indirectCRL.ToString()); + } + buf.Append("]"); + buf.Append(sep); + return buf.ToString(); + } + + private void appendObject( + StringBuilder buf, + string sep, + string name, + string val) + { + string indent = " "; + + buf.Append(indent); + buf.Append(name); + buf.Append(":"); + buf.Append(sep); + buf.Append(indent); + buf.Append(indent); + buf.Append(val); + buf.Append(sep); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuingDistributionPoint.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuingDistributionPoint.cs.meta new file mode 100644 index 00000000..22fd455f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/IssuingDistributionPoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 294595b60094c3f47b8d0e7a74f0534d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyPurposeId.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyPurposeId.cs new file mode 100644 index 00000000..977d22bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyPurposeId.cs @@ -0,0 +1,42 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The KeyPurposeID object. + *
+     *     KeyPurposeID ::= OBJECT IDENTIFIER
+     * 
+ */ + public sealed class KeyPurposeID + : DerObjectIdentifier + { + private const string IdKP = "1.3.6.1.5.5.7.3"; + + private KeyPurposeID( + string id) + : base(id) + { + } + + public static readonly KeyPurposeID AnyExtendedKeyUsage = new KeyPurposeID(X509Extensions.ExtendedKeyUsage.Id + ".0"); + public static readonly KeyPurposeID IdKPServerAuth = new KeyPurposeID(IdKP + ".1"); + public static readonly KeyPurposeID IdKPClientAuth = new KeyPurposeID(IdKP + ".2"); + public static readonly KeyPurposeID IdKPCodeSigning = new KeyPurposeID(IdKP + ".3"); + public static readonly KeyPurposeID IdKPEmailProtection = new KeyPurposeID(IdKP + ".4"); + public static readonly KeyPurposeID IdKPIpsecEndSystem = new KeyPurposeID(IdKP + ".5"); + public static readonly KeyPurposeID IdKPIpsecTunnel = new KeyPurposeID(IdKP + ".6"); + public static readonly KeyPurposeID IdKPIpsecUser = new KeyPurposeID(IdKP + ".7"); + public static readonly KeyPurposeID IdKPTimeStamping = new KeyPurposeID(IdKP + ".8"); + public static readonly KeyPurposeID IdKPOcspSigning = new KeyPurposeID(IdKP + ".9"); + + // + // microsoft key purpose ids + // + public static readonly KeyPurposeID IdKPSmartCardLogon = new KeyPurposeID("1.3.6.1.4.1.311.20.2.2"); + + public static readonly KeyPurposeID IdKPMacAddress = new KeyPurposeID("1.3.6.1.1.1.1.22"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyPurposeId.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyPurposeId.cs.meta new file mode 100644 index 00000000..d6913f93 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyPurposeId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: faf30a7baf2f5f54f9c0ee4046ad1b4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyUsage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyUsage.cs new file mode 100644 index 00000000..8fdd4488 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyUsage.cs @@ -0,0 +1,82 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The KeyUsage object. + *
+     *    id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
+     *
+     *    KeyUsage ::= BIT STRING {
+     *         digitalSignature        (0),
+     *         nonRepudiation          (1),
+     *         keyEncipherment         (2),
+     *         dataEncipherment        (3),
+     *         keyAgreement            (4),
+     *         keyCertSign             (5),
+     *         cRLSign                 (6),
+     *         encipherOnly            (7),
+     *         decipherOnly            (8) }
+     * 
+ */ + public class KeyUsage + : DerBitString + { + public const int DigitalSignature = (1 << 7); + public const int NonRepudiation = (1 << 6); + public const int KeyEncipherment = (1 << 5); + public const int DataEncipherment = (1 << 4); + public const int KeyAgreement = (1 << 3); + public const int KeyCertSign = (1 << 2); + public const int CrlSign = (1 << 1); + public const int EncipherOnly = (1 << 0); + public const int DecipherOnly = (1 << 15); + + public static new KeyUsage GetInstance( + object obj) + { + if (obj is KeyUsage) + { + return (KeyUsage)obj; + } + + if (obj is X509Extension) + { + return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); + } + + return new KeyUsage(DerBitString.GetInstance(obj)); + } + + /** + * Basic constructor. + * + * @param usage - the bitwise OR of the Key Usage flags giving the + * allowed uses for the key. + * e.g. (KeyUsage.keyEncipherment | KeyUsage.dataEncipherment) + */ + public KeyUsage(int usage) + : base(usage) + { + } + + private KeyUsage( + DerBitString usage) + : base(usage.GetBytes(), usage.PadBits) + { + } + + public override string ToString() + { + byte[] data = GetBytes(); + if (data.Length == 1) + { + return "KeyUsage: 0x" + (data[0] & 0xff).ToString("X"); + } + + return "KeyUsage: 0x" + ((data[1] & 0xff) << 8 | (data[0] & 0xff)).ToString("X"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyUsage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyUsage.cs.meta new file mode 100644 index 00000000..3e1753f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/KeyUsage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4021a83960488554b81323fece140b47 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NameConstraints.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NameConstraints.cs new file mode 100644 index 00000000..0affacaa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NameConstraints.cs @@ -0,0 +1,124 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class NameConstraints + : Asn1Encodable + { + private Asn1Sequence permitted, excluded; + + public static NameConstraints GetInstance( + object obj) + { + if (obj == null || obj is NameConstraints) + { + return (NameConstraints) obj; + } + + if (obj is Asn1Sequence) + { + return new NameConstraints((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public NameConstraints( + Asn1Sequence seq) + { + foreach (Asn1TaggedObject o in seq) + { + switch (o.TagNo) + { + case 0: + permitted = Asn1Sequence.GetInstance(o, false); + break; + case 1: + excluded = Asn1Sequence.GetInstance(o, false); + break; + } + } + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + public NameConstraints( + ArrayList permitted, + ArrayList excluded) + : this((IList)permitted, (IList)excluded) + { + } +#endif + + /** + * Constructor from a given details. + * + *

permitted and excluded are Vectors of GeneralSubtree objects.

+ * + * @param permitted Permitted subtrees + * @param excluded Excluded subtrees + */ + public NameConstraints( + IList permitted, + IList excluded) + { + if (permitted != null) + { + this.permitted = CreateSequence(permitted); + } + + if (excluded != null) + { + this.excluded = CreateSequence(excluded); + } + } + + private DerSequence CreateSequence( + IList subtrees) + { + GeneralSubtree[] gsts = new GeneralSubtree[subtrees.Count]; + for (int i = 0; i < subtrees.Count; ++i) + { + gsts[i] = (GeneralSubtree)subtrees[i]; + } + return new DerSequence(gsts); + } + + public Asn1Sequence PermittedSubtrees + { + get { return permitted; } + } + + public Asn1Sequence ExcludedSubtrees + { + get { return excluded; } + } + + /* + * NameConstraints ::= SEQUENCE { permittedSubtrees [0] GeneralSubtrees + * OPTIONAL, excludedSubtrees [1] GeneralSubtrees OPTIONAL } + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (permitted != null) + { + v.Add(new DerTaggedObject(false, 0, permitted)); + } + + if (excluded != null) + { + v.Add(new DerTaggedObject(false, 1, excluded)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NameConstraints.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NameConstraints.cs.meta new file mode 100644 index 00000000..c6710750 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NameConstraints.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90f58613456a0f244bd469ff52a88379 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NoticeReference.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NoticeReference.cs new file mode 100644 index 00000000..38023d03 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NoticeReference.cs @@ -0,0 +1,147 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * NoticeReference class, used in + * CertificatePolicies X509 V3 extensions + * (in policy qualifiers). + * + *
+     *  NoticeReference ::= Sequence {
+     *      organization     DisplayText,
+     *      noticeNumbers    Sequence OF Integer }
+     *
+     * 
+ * + * @see PolicyQualifierInfo + * @see PolicyInformation + */ + public class NoticeReference + : Asn1Encodable + { + private readonly DisplayText organization; + private readonly Asn1Sequence noticeNumbers; + + private static Asn1EncodableVector ConvertVector(IList numbers) + { + Asn1EncodableVector av = new Asn1EncodableVector(); + + foreach (object o in numbers) + { + DerInteger di; + + if (o is BigInteger) + { + di = new DerInteger((BigInteger)o); + } + else if (o is int) + { + di = new DerInteger((int)o); + } + else + { + throw new ArgumentException(); + } + + av.Add(di); + } + return av; + } + + /** + * Creates a new NoticeReference instance. + * + * @param organization a String value + * @param numbers a Vector value + */ + public NoticeReference(string organization, IList numbers) + : this(organization, ConvertVector(numbers)) + { + } + + /** + * Creates a new NoticeReference instance. + * + * @param organization a String value + * @param noticeNumbers an ASN1EncodableVector value + */ + public NoticeReference(string organization, Asn1EncodableVector noticeNumbers) + : this(new DisplayText(organization), noticeNumbers) + { + } + + /** + * Creates a new NoticeReference instance. + * + * @param organization displayText + * @param noticeNumbers an ASN1EncodableVector value + */ + public NoticeReference(DisplayText organization, Asn1EncodableVector noticeNumbers) + { + this.organization = organization; + this.noticeNumbers = new DerSequence(noticeNumbers); + } + + /** + * Creates a new NoticeReference instance. + *

Useful for reconstructing a NoticeReference + * instance from its encodable/encoded form.

+ * + * @param as an Asn1Sequence value obtained from either + * calling @{link ToAsn1Object()} for a NoticeReference + * instance or from parsing it from a Der-encoded stream. + */ + private NoticeReference(Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + organization = DisplayText.GetInstance(seq[0]); + noticeNumbers = Asn1Sequence.GetInstance(seq[1]); + } + + public static NoticeReference GetInstance(object obj) + { + if (obj is NoticeReference) + return (NoticeReference)obj; + if (obj == null) + return null; + return new NoticeReference(Asn1Sequence.GetInstance(obj)); + } + + public virtual DisplayText Organization + { + get { return organization; } + } + + public virtual DerInteger[] GetNoticeNumbers() + { + DerInteger[] tmp = new DerInteger[noticeNumbers.Count]; + + for (int i = 0; i != noticeNumbers.Count; ++i) + { + tmp[i] = DerInteger.GetInstance(noticeNumbers[i]); + } + + return tmp; + } + + /** + * Describe ToAsn1Object method here. + * + * @return a Asn1Object value + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(organization, noticeNumbers); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NoticeReference.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NoticeReference.cs.meta new file mode 100644 index 00000000..1fa87523 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/NoticeReference.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b149789548ee9f4a8a817d529d868b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ObjectDigestInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ObjectDigestInfo.cs new file mode 100644 index 00000000..56c4c877 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ObjectDigestInfo.cs @@ -0,0 +1,183 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * ObjectDigestInfo ASN.1 structure used in v2 attribute certificates. + * + *
+	 *  
+	 *    ObjectDigestInfo ::= SEQUENCE {
+	 *         digestedObjectType  ENUMERATED {
+	 *                 publicKey            (0),
+	 *                 publicKeyCert        (1),
+	 *                 otherObjectTypes     (2) },
+	 *                         -- otherObjectTypes MUST NOT
+	 *                         -- be used in this profile
+	 *         otherObjectTypeID   OBJECT IDENTIFIER OPTIONAL,
+	 *         digestAlgorithm     AlgorithmIdentifier,
+	 *         objectDigest        BIT STRING
+	 *    }
+	 *   
+	 * 
+ * + */ + public class ObjectDigestInfo + : Asn1Encodable + { + /** + * The public key is hashed. + */ + public const int PublicKey = 0; + + /** + * The public key certificate is hashed. + */ + public const int PublicKeyCert = 1; + + /** + * An other object is hashed. + */ + public const int OtherObjectDigest = 2; + + internal readonly DerEnumerated digestedObjectType; + internal readonly DerObjectIdentifier otherObjectTypeID; + internal readonly AlgorithmIdentifier digestAlgorithm; + internal readonly DerBitString objectDigest; + + public static ObjectDigestInfo GetInstance( + object obj) + { + if (obj == null || obj is ObjectDigestInfo) + { + return (ObjectDigestInfo) obj; + } + + if (obj is Asn1Sequence) + { + return new ObjectDigestInfo((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public static ObjectDigestInfo GetInstance( + Asn1TaggedObject obj, + bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + /** + * Constructor from given details. + *

+ * If digestedObjectType is not {@link #publicKeyCert} or + * {@link #publicKey} otherObjectTypeID must be given, + * otherwise it is ignored.

+ * + * @param digestedObjectType The digest object type. + * @param otherObjectTypeID The object type ID for + * otherObjectDigest. + * @param digestAlgorithm The algorithm identifier for the hash. + * @param objectDigest The hash value. + */ + public ObjectDigestInfo( + int digestedObjectType, + string otherObjectTypeID, + AlgorithmIdentifier digestAlgorithm, + byte[] objectDigest) + { + this.digestedObjectType = new DerEnumerated(digestedObjectType); + + if (digestedObjectType == OtherObjectDigest) + { + this.otherObjectTypeID = new DerObjectIdentifier(otherObjectTypeID); + } + + this.digestAlgorithm = digestAlgorithm; + + this.objectDigest = new DerBitString(objectDigest); + } + + private ObjectDigestInfo( + Asn1Sequence seq) + { + if (seq.Count > 4 || seq.Count < 3) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + digestedObjectType = DerEnumerated.GetInstance(seq[0]); + + int offset = 0; + + if (seq.Count == 4) + { + otherObjectTypeID = DerObjectIdentifier.GetInstance(seq[1]); + offset++; + } + + digestAlgorithm = AlgorithmIdentifier.GetInstance(seq[1 + offset]); + objectDigest = DerBitString.GetInstance(seq[2 + offset]); + } + + public DerEnumerated DigestedObjectType + { + get { return digestedObjectType; } + } + + public DerObjectIdentifier OtherObjectTypeID + { + get { return otherObjectTypeID; } + } + + public AlgorithmIdentifier DigestAlgorithm + { + get { return digestAlgorithm; } + } + + public DerBitString ObjectDigest + { + get { return objectDigest; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + * + *
+		 *  
+		 *    ObjectDigestInfo ::= SEQUENCE {
+		 *         digestedObjectType  ENUMERATED {
+		 *                 publicKey            (0),
+		 *                 publicKeyCert        (1),
+		 *                 otherObjectTypes     (2) },
+		 *                         -- otherObjectTypes MUST NOT
+		 *                         -- be used in this profile
+		 *         otherObjectTypeID   OBJECT IDENTIFIER OPTIONAL,
+		 *         digestAlgorithm     AlgorithmIdentifier,
+		 *         objectDigest        BIT STRING
+		 *    }
+		 *   
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(digestedObjectType); + + if (otherObjectTypeID != null) + { + v.Add(otherObjectTypeID); + } + + v.Add(digestAlgorithm, objectDigest); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ObjectDigestInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ObjectDigestInfo.cs.meta new file mode 100644 index 00000000..7e452cc8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ObjectDigestInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 02207614e04f22b46a8c8d78f420c099 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyInformation.cs new file mode 100644 index 00000000..d5305bd6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyInformation.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class PolicyInformation + : Asn1Encodable + { + private readonly DerObjectIdentifier policyIdentifier; + private readonly Asn1Sequence policyQualifiers; + + private PolicyInformation( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 2) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + policyIdentifier = DerObjectIdentifier.GetInstance(seq[0]); + + if (seq.Count > 1) + { + policyQualifiers = Asn1Sequence.GetInstance(seq[1]); + } + } + + public PolicyInformation( + DerObjectIdentifier policyIdentifier) + { + this.policyIdentifier = policyIdentifier; + } + + public PolicyInformation( + DerObjectIdentifier policyIdentifier, + Asn1Sequence policyQualifiers) + { + this.policyIdentifier = policyIdentifier; + this.policyQualifiers = policyQualifiers; + } + + public static PolicyInformation GetInstance( + object obj) + { + if (obj == null || obj is PolicyInformation) + { + return (PolicyInformation) obj; + } + + return new PolicyInformation(Asn1Sequence.GetInstance(obj)); + } + + public DerObjectIdentifier PolicyIdentifier + { + get { return policyIdentifier; } + } + + public Asn1Sequence PolicyQualifiers + { + get { return policyQualifiers; } + } + + /* + * PolicyInformation ::= Sequence { + * policyIdentifier CertPolicyId, + * policyQualifiers Sequence SIZE (1..MAX) OF + * PolicyQualifierInfo OPTIONAL } + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(policyIdentifier); + + if (policyQualifiers != null) + { + v.Add(policyQualifiers); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyInformation.cs.meta new file mode 100644 index 00000000..ef6baceb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5abbcd4c5528f6a439fd91d7dae43128 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyMappings.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyMappings.cs new file mode 100644 index 00000000..85250f79 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyMappings.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * PolicyMappings V3 extension, described in RFC3280. + *
+	 *    PolicyMappings ::= Sequence SIZE (1..MAX) OF Sequence {
+	 *      issuerDomainPolicy      CertPolicyId,
+	 *      subjectDomainPolicy     CertPolicyId }
+	 * 
+ * + * @see RFC 3280, section 4.2.1.6 + */ + public class PolicyMappings + : Asn1Encodable + { + private readonly Asn1Sequence seq; + + /** + * Creates a new PolicyMappings instance. + * + * @param seq an Asn1Sequence constructed as specified + * in RFC 3280 + */ + public PolicyMappings( + Asn1Sequence seq) + { + this.seq = seq; + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + public PolicyMappings( + Hashtable mappings) + : this((IDictionary)mappings) + { + } +#endif + + /** + * Creates a new PolicyMappings instance. + * + * @param mappings a HashMap value that maps + * string oids + * to other string oids. + */ + public PolicyMappings( + IDictionary mappings) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + foreach (string idp in mappings.Keys) + { + string sdp = (string) mappings[idp]; + + v.Add( + new DerSequence( + new DerObjectIdentifier(idp), + new DerObjectIdentifier(sdp))); + } + + seq = new DerSequence(v); + } + + public override Asn1Object ToAsn1Object() + { + return seq; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyMappings.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyMappings.cs.meta new file mode 100644 index 00000000..b8e23ad9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyMappings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6882991b865f5b14ca16e8b9ab76a181 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierId.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierId.cs new file mode 100644 index 00000000..fad2803c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierId.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * PolicyQualifierId, used in the CertificatePolicies + * X509V3 extension. + * + *
+	 *    id-qt          OBJECT IDENTIFIER ::=  { id-pkix 2 }
+	 *    id-qt-cps      OBJECT IDENTIFIER ::=  { id-qt 1 }
+	 *    id-qt-unotice  OBJECT IDENTIFIER ::=  { id-qt 2 }
+	 *  PolicyQualifierId ::=
+	 *       OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
+	 * 
+ */ + public sealed class PolicyQualifierID : DerObjectIdentifier + { + private const string IdQt = "1.3.6.1.5.5.7.2"; + + private PolicyQualifierID( + string id) + : base(id) + { + } + + public static readonly PolicyQualifierID IdQtCps = new PolicyQualifierID(IdQt + ".1"); + public static readonly PolicyQualifierID IdQtUnotice = new PolicyQualifierID(IdQt + ".2"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierId.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierId.cs.meta new file mode 100644 index 00000000..af6be561 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17690092d4614f24dbdfb1fda0c9e085 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierInfo.cs new file mode 100644 index 00000000..001958c8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierInfo.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Policy qualifiers, used in the X509V3 CertificatePolicies + * extension. + * + *
+     *   PolicyQualifierInfo ::= Sequence {
+     *       policyQualifierId  PolicyQualifierId,
+     *       qualifier          ANY DEFINED BY policyQualifierId }
+     * 
+ */ + public class PolicyQualifierInfo + : Asn1Encodable + { + private readonly DerObjectIdentifier policyQualifierId; + private readonly Asn1Encodable qualifier; + + /** + * Creates a new PolicyQualifierInfo instance. + * + * @param policyQualifierId a PolicyQualifierId value + * @param qualifier the qualifier, defined by the above field. + */ + public PolicyQualifierInfo( + DerObjectIdentifier policyQualifierId, + Asn1Encodable qualifier) + { + this.policyQualifierId = policyQualifierId; + this.qualifier = qualifier; + } + + /** + * Creates a new PolicyQualifierInfo containing a + * cPSuri qualifier. + * + * @param cps the CPS (certification practice statement) uri as a + * string. + */ + public PolicyQualifierInfo( + string cps) + { + policyQualifierId = PolicyQualifierID.IdQtCps; + qualifier = new DerIA5String(cps); + } + + /** + * Creates a new PolicyQualifierInfo instance. + * + * @param as PolicyQualifierInfo X509 structure + * encoded as an Asn1Sequence. + */ + private PolicyQualifierInfo( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + policyQualifierId = DerObjectIdentifier.GetInstance(seq[0]); + qualifier = seq[1]; + } + + public static PolicyQualifierInfo GetInstance( + object obj) + { + if (obj is PolicyQualifierInfo) + return (PolicyQualifierInfo)obj; + if (obj == null) + return null; + return new PolicyQualifierInfo(Asn1Sequence.GetInstance(obj)); + } + + public virtual DerObjectIdentifier PolicyQualifierId + { + get { return policyQualifierId; } + } + + public virtual Asn1Encodable Qualifier + { + get { return qualifier; } + } + + /** + * Returns a Der-encodable representation of this instance. + * + * @return a Asn1Object value + */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(policyQualifierId, qualifier); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierInfo.cs.meta new file mode 100644 index 00000000..541d77e4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PolicyQualifierInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f452760c35c7b684396626dc773036ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PrivateKeyUsagePeriod.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PrivateKeyUsagePeriod.cs new file mode 100644 index 00000000..34a22ac3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PrivateKeyUsagePeriod.cs @@ -0,0 +1,88 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /// + ///
+	/// PrivateKeyUsagePeriod ::= SEQUENCE
+	/// {
+	/// notBefore       [0]     GeneralizedTime OPTIONAL,
+	/// notAfter        [1]     GeneralizedTime OPTIONAL }
+	/// 
+ ///
+ public class PrivateKeyUsagePeriod + : Asn1Encodable + { + public static PrivateKeyUsagePeriod GetInstance( + object obj) + { + if (obj is PrivateKeyUsagePeriod) + { + return (PrivateKeyUsagePeriod) obj; + } + + if (obj is Asn1Sequence) + { + return new PrivateKeyUsagePeriod((Asn1Sequence) obj); + } + + if (obj is X509Extension) + { + return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); + } + + throw new ArgumentException("unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private DerGeneralizedTime _notBefore, _notAfter; + + private PrivateKeyUsagePeriod( + Asn1Sequence seq) + { + foreach (Asn1TaggedObject tObj in seq) + { + if (tObj.TagNo == 0) + { + _notBefore = DerGeneralizedTime.GetInstance(tObj, false); + } + else if (tObj.TagNo == 1) + { + _notAfter = DerGeneralizedTime.GetInstance(tObj, false); + } + } + } + + public DerGeneralizedTime NotBefore + { + get { return _notBefore; } + } + + public DerGeneralizedTime NotAfter + { + get { return _notAfter; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (_notBefore != null) + { + v.Add(new DerTaggedObject(false, 0, _notBefore)); + } + + if (_notAfter != null) + { + v.Add(new DerTaggedObject(false, 1, _notAfter)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PrivateKeyUsagePeriod.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PrivateKeyUsagePeriod.cs.meta new file mode 100644 index 00000000..7fade4c1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/PrivateKeyUsagePeriod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 22c2678aa1fff7c40974a32519fe0930 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RSAPublicKeyStructure.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RSAPublicKeyStructure.cs new file mode 100644 index 00000000..6b450c4c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RSAPublicKeyStructure.cs @@ -0,0 +1,97 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class RsaPublicKeyStructure + : Asn1Encodable + { + private BigInteger modulus; + private BigInteger publicExponent; + + public static RsaPublicKeyStructure GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static RsaPublicKeyStructure GetInstance( + object obj) + { + if (obj == null || obj is RsaPublicKeyStructure) + { + return (RsaPublicKeyStructure) obj; + } + + if (obj is Asn1Sequence) + { + return new RsaPublicKeyStructure((Asn1Sequence) obj); + } + + throw new ArgumentException("Invalid RsaPublicKeyStructure: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public RsaPublicKeyStructure( + BigInteger modulus, + BigInteger publicExponent) + { + if (modulus == null) + throw new ArgumentNullException("modulus"); + if (publicExponent == null) + throw new ArgumentNullException("publicExponent"); + if (modulus.SignValue <= 0) + throw new ArgumentException("Not a valid RSA modulus", "modulus"); + if (publicExponent.SignValue <= 0) + throw new ArgumentException("Not a valid RSA public exponent", "publicExponent"); + + this.modulus = modulus; + this.publicExponent = publicExponent; + } + + private RsaPublicKeyStructure( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + // Note: we are accepting technically incorrect (i.e. negative) values here + modulus = DerInteger.GetInstance(seq[0]).PositiveValue; + publicExponent = DerInteger.GetInstance(seq[1]).PositiveValue; + } + + public BigInteger Modulus + { + get { return modulus; } + } + + public BigInteger PublicExponent + { + get { return publicExponent; } + } + + /** + * This outputs the key in Pkcs1v2 format. + *
+         *      RSAPublicKey ::= Sequence {
+         *                          modulus Integer, -- n
+         *                          publicExponent Integer, -- e
+         *                      }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence( + new DerInteger(Modulus), + new DerInteger(PublicExponent)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RSAPublicKeyStructure.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RSAPublicKeyStructure.cs.meta new file mode 100644 index 00000000..e47f17e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RSAPublicKeyStructure.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf27e7314c63a8242bc799931359c21d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ReasonFlags.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ReasonFlags.cs new file mode 100644 index 00000000..1ed629dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ReasonFlags.cs @@ -0,0 +1,49 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The ReasonFlags object. + *
+     * ReasonFlags ::= BIT STRING {
+     *    unused(0),
+     *    keyCompromise(1),
+     *    cACompromise(2),
+     *    affiliationChanged(3),
+     *    superseded(4),
+     *    cessationOfOperation(5),
+     *    certficateHold(6)
+     * }
+     * 
+ */ + public class ReasonFlags + : DerBitString + { + public const int Unused = (1 << 7); + public const int KeyCompromise = (1 << 6); + public const int CACompromise = (1 << 5); + public const int AffiliationChanged = (1 << 4); + public const int Superseded = (1 << 3); + public const int CessationOfOperation = (1 << 2); + public const int CertificateHold = (1 << 1); + public const int PrivilegeWithdrawn = (1 << 0); + public const int AACompromise = (1 << 15); + + /** + * @param reasons - the bitwise OR of the Key Reason flags giving the + * allowed uses for the key. + */ + public ReasonFlags(int reasons) + : base(reasons) + { + } + + public ReasonFlags( + DerBitString reasons) + : base(reasons.GetBytes(), reasons.PadBits) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ReasonFlags.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ReasonFlags.cs.meta new file mode 100644 index 00000000..9367e57f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/ReasonFlags.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f55944d463a02e419739037579f2686 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RoleSyntax.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RoleSyntax.cs new file mode 100644 index 00000000..94b3641e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RoleSyntax.cs @@ -0,0 +1,234 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Implementation of the RoleSyntax object as specified by the RFC3281. + * + *
+	* RoleSyntax ::= SEQUENCE {
+	*                 roleAuthority  [0] GeneralNames OPTIONAL,
+	*                 roleName       [1] GeneralName
+	*           }
+	* 
+ */ + public class RoleSyntax + : Asn1Encodable + { + private readonly GeneralNames roleAuthority; + private readonly GeneralName roleName; + + /** + * RoleSyntax factory method. + * @param obj the object used to construct an instance of + * RoleSyntax. It must be an instance of RoleSyntax + * or Asn1Sequence. + * @return the instance of RoleSyntax built from the + * supplied object. + * @throws java.lang.ArgumentException if the object passed + * to the factory is not an instance of RoleSyntax or + * Asn1Sequence. + */ + public static RoleSyntax GetInstance( + object obj) + { + if (obj is RoleSyntax) + return (RoleSyntax)obj; + + if (obj != null) + return new RoleSyntax(Asn1Sequence.GetInstance(obj)); + + return null; + } + + /** + * Constructor. + * @param roleAuthority the role authority of this RoleSyntax. + * @param roleName the role name of this RoleSyntax. + */ + public RoleSyntax( + GeneralNames roleAuthority, + GeneralName roleName) + { + if (roleName == null + || roleName.TagNo != GeneralName.UniformResourceIdentifier + || ((IAsn1String) roleName.Name).GetString().Equals("")) + { + throw new ArgumentException("the role name MUST be non empty and MUST " + + "use the URI option of GeneralName"); + } + + this.roleAuthority = roleAuthority; + this.roleName = roleName; + } + + /** + * Constructor. Invoking this constructor is the same as invoking + * new RoleSyntax(null, roleName). + * @param roleName the role name of this RoleSyntax. + */ + public RoleSyntax( + GeneralName roleName) + : this(null, roleName) + { + } + + /** + * Utility constructor. Takes a string argument representing + * the role name, builds a GeneralName to hold the role name + * and calls the constructor that takes a GeneralName. + * @param roleName + */ + public RoleSyntax( + string roleName) + : this(new GeneralName(GeneralName.UniformResourceIdentifier, + (roleName == null)? "": roleName)) + { + } + + /** + * Constructor that builds an instance of RoleSyntax by + * extracting the encoded elements from the Asn1Sequence + * object supplied. + * @param seq an instance of Asn1Sequence that holds + * the encoded elements used to build this RoleSyntax. + */ + private RoleSyntax( + Asn1Sequence seq) + { + if (seq.Count < 1 || seq.Count > 2) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + for (int i = 0; i != seq.Count; i++) + { + Asn1TaggedObject taggedObject = Asn1TaggedObject.GetInstance(seq[i]); + switch (taggedObject.TagNo) + { + case 0: + roleAuthority = GeneralNames.GetInstance(taggedObject, false); + break; + case 1: + roleName = GeneralName.GetInstance(taggedObject, true); + break; + default: + throw new ArgumentException("Unknown tag in RoleSyntax"); + } + } + } + + /** + * Gets the role authority of this RoleSyntax. + * @return an instance of GeneralNames holding the + * role authority of this RoleSyntax. + */ + public GeneralNames RoleAuthority + { + get { return this.roleAuthority; } + } + + /** + * Gets the role name of this RoleSyntax. + * @return an instance of GeneralName holding the + * role name of this RoleSyntax. + */ + public GeneralName RoleName + { + get { return this.roleName; } + } + + /** + * Gets the role name as a java.lang.string object. + * @return the role name of this RoleSyntax represented as a + * string object. + */ + public string GetRoleNameAsString() + { + return ((IAsn1String) this.roleName.Name).GetString(); + } + + /** + * Gets the role authority as a string[] object. + * @return the role authority of this RoleSyntax represented as a + * string[] array. + */ + public string[] GetRoleAuthorityAsString() + { + if (roleAuthority == null) + { + return new string[0]; + } + + GeneralName[] names = roleAuthority.GetNames(); + string[] namesString = new string[names.Length]; + for(int i = 0; i < names.Length; i++) + { + Asn1Encodable asn1Value = names[i].Name; + if (asn1Value is IAsn1String) + { + namesString[i] = ((IAsn1String) asn1Value).GetString(); + } + else + { + namesString[i] = asn1Value.ToString(); + } + } + + return namesString; + } + + /** + * Implementation of the method ToAsn1Object as + * required by the superclass ASN1Encodable. + * + *
+		* RoleSyntax ::= SEQUENCE {
+		*                 roleAuthority  [0] GeneralNames OPTIONAL,
+		*                 roleName       [1] GeneralName
+		*           }
+		* 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (this.roleAuthority != null) + { + v.Add(new DerTaggedObject(false, 0, roleAuthority)); + } + + v.Add(new DerTaggedObject(true, 1, roleName)); + + return new DerSequence(v); + } + + public override string ToString() + { + StringBuilder buff = new StringBuilder("Name: " + this.GetRoleNameAsString() + + " - Auth: "); + + if (this.roleAuthority == null || roleAuthority.GetNames().Length == 0) + { + buff.Append("N/A"); + } + else + { + string[] names = this.GetRoleAuthorityAsString(); + buff.Append('[').Append(names[0]); + for(int i = 1; i < names.Length; i++) + { + buff.Append(", ").Append(names[i]); + } + buff.Append(']'); + } + + return buff.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RoleSyntax.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RoleSyntax.cs.meta new file mode 100644 index 00000000..ca2fc568 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/RoleSyntax.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ff361cc4c49a0d41b7c348946274353 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectDirectoryAttributes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectDirectoryAttributes.cs new file mode 100644 index 00000000..5c6a31bb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectDirectoryAttributes.cs @@ -0,0 +1,146 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * This extension may contain further X.500 attributes of the subject. See also + * RFC 3039. + * + *
+	 *     SubjectDirectoryAttributes ::= Attributes
+	 *     Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
+	 *     Attribute ::= SEQUENCE
+	 *     {
+	 *       type AttributeType
+	 *       values SET OF AttributeValue
+	 *     }
+	 *
+	 *     AttributeType ::= OBJECT IDENTIFIER
+	 *     AttributeValue ::= ANY DEFINED BY AttributeType
+	 * 
+ * + * @see org.bouncycastle.asn1.x509.X509Name for AttributeType ObjectIdentifiers. + */ + public class SubjectDirectoryAttributes + : Asn1Encodable + { + private readonly IList attributes; + + public static SubjectDirectoryAttributes GetInstance( + object obj) + { + if (obj == null || obj is SubjectDirectoryAttributes) + { + return (SubjectDirectoryAttributes) obj; + } + + if (obj is Asn1Sequence) + { + return new SubjectDirectoryAttributes((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + * + * The sequence is of type SubjectDirectoryAttributes: + * + *
+		 *      SubjectDirectoryAttributes ::= Attributes
+		 *      Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
+		 *      Attribute ::= SEQUENCE
+		 *      {
+		 *        type AttributeType
+		 *        values SET OF AttributeValue
+		 *      }
+		 *
+		 *      AttributeType ::= OBJECT IDENTIFIER
+		 *      AttributeValue ::= ANY DEFINED BY AttributeType
+		 * 
+ * + * @param seq + * The ASN.1 sequence. + */ + private SubjectDirectoryAttributes( + Asn1Sequence seq) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + foreach (object o in seq) + { + Asn1Sequence s = Asn1Sequence.GetInstance(o); + attributes.Add(AttributeX509.GetInstance(s)); + } + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete] + public SubjectDirectoryAttributes( + ArrayList attributes) + : this((IList)attributes) + { + } +#endif + + /** + * Constructor from an ArrayList of attributes. + * + * The ArrayList consists of attributes of type {@link Attribute Attribute} + * + * @param attributes The attributes. + * + */ + public SubjectDirectoryAttributes( + IList attributes) + { + this.attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(attributes); + } + + /** + * Produce an object suitable for an Asn1OutputStream. + * + * Returns: + * + *
+		 *      SubjectDirectoryAttributes ::= Attributes
+		 *      Attributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
+		 *      Attribute ::= SEQUENCE
+		 *      {
+		 *        type AttributeType
+		 *        values SET OF AttributeValue
+		 *      }
+		 *
+		 *      AttributeType ::= OBJECT IDENTIFIER
+		 *      AttributeValue ::= ANY DEFINED BY AttributeType
+		 * 
+ * + * @return a DERObject + */ + public override Asn1Object ToAsn1Object() + { + AttributeX509[] v = new AttributeX509[attributes.Count]; + for (int i = 0; i < attributes.Count; ++i) + { + v[i] = (AttributeX509)attributes[i]; + } + return new DerSequence(v); + } + + /** + * @return Returns the attributes. + */ + public IEnumerable Attributes + { + get { return new EnumerableProxy(attributes); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectDirectoryAttributes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectDirectoryAttributes.cs.meta new file mode 100644 index 00000000..fb93f536 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectDirectoryAttributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 620383797bd814841818767fcb5e2ccb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectKeyIdentifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectKeyIdentifier.cs new file mode 100644 index 00000000..13c5ca36 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectKeyIdentifier.cs @@ -0,0 +1,146 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The SubjectKeyIdentifier object. + *
+     * SubjectKeyIdentifier::= OCTET STRING
+     * 
+ */ + public class SubjectKeyIdentifier + : Asn1Encodable + { + private readonly byte[] keyIdentifier; + + public static SubjectKeyIdentifier GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1OctetString.GetInstance(obj, explicitly)); + } + + public static SubjectKeyIdentifier GetInstance( + object obj) + { + if (obj is SubjectKeyIdentifier) + { + return (SubjectKeyIdentifier) obj; + } + + if (obj is SubjectPublicKeyInfo) + { + return new SubjectKeyIdentifier((SubjectPublicKeyInfo) obj); + } + + if (obj is Asn1OctetString) + { + return new SubjectKeyIdentifier((Asn1OctetString) obj); + } + + if (obj is X509Extension) + { + return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj)); + } + + throw new ArgumentException("Invalid SubjectKeyIdentifier: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + public SubjectKeyIdentifier( + byte[] keyID) + { + if (keyID == null) + throw new ArgumentNullException("keyID"); + + this.keyIdentifier = keyID; + } + + public SubjectKeyIdentifier( + Asn1OctetString keyID) + { + this.keyIdentifier = keyID.GetOctets(); + } + + /** + * Calculates the keyIdentifier using a SHA1 hash over the BIT STRING + * from SubjectPublicKeyInfo as defined in RFC3280. + * + * @param spki the subject public key info. + */ + public SubjectKeyIdentifier( + SubjectPublicKeyInfo spki) + { + this.keyIdentifier = GetDigest(spki); + } + + public byte[] GetKeyIdentifier() + { + return keyIdentifier; + } + + public override Asn1Object ToAsn1Object() + { + return new DerOctetString(keyIdentifier); + } + + /** + * Return a RFC 3280 type 1 key identifier. As in: + *
+		 * (1) The keyIdentifier is composed of the 160-bit SHA-1 hash of the
+		 * value of the BIT STRING subjectPublicKey (excluding the tag,
+		 * length, and number of unused bits).
+		 * 
+ * @param keyInfo the key info object containing the subjectPublicKey field. + * @return the key identifier. + */ + public static SubjectKeyIdentifier CreateSha1KeyIdentifier( + SubjectPublicKeyInfo keyInfo) + { + return new SubjectKeyIdentifier(keyInfo); + } + + /** + * Return a RFC 3280 type 2 key identifier. As in: + *
+		 * (2) The keyIdentifier is composed of a four bit type field with
+		 * the value 0100 followed by the least significant 60 bits of the
+		 * SHA-1 hash of the value of the BIT STRING subjectPublicKey.
+		 * 
+ * @param keyInfo the key info object containing the subjectPublicKey field. + * @return the key identifier. + */ + public static SubjectKeyIdentifier CreateTruncatedSha1KeyIdentifier( + SubjectPublicKeyInfo keyInfo) + { + byte[] dig = GetDigest(keyInfo); + byte[] id = new byte[8]; + + Array.Copy(dig, dig.Length - 8, id, 0, id.Length); + + id[0] &= 0x0f; + id[0] |= 0x40; + + return new SubjectKeyIdentifier(id); + } + + private static byte[] GetDigest( + SubjectPublicKeyInfo spki) + { + IDigest digest = new Sha1Digest(); + byte[] resBuf = new byte[digest.GetDigestSize()]; + + byte[] bytes = spki.PublicKeyData.GetBytes(); + digest.BlockUpdate(bytes, 0, bytes.Length); + digest.DoFinal(resBuf, 0); + return resBuf; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectKeyIdentifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectKeyIdentifier.cs.meta new file mode 100644 index 00000000..db7b7918 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectKeyIdentifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 628854a153b3cf44391f8dbc2892b462 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectPublicKeyInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectPublicKeyInfo.cs new file mode 100644 index 00000000..107b3010 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectPublicKeyInfo.cs @@ -0,0 +1,106 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The object that contains the public key stored in a certficate. + *

+ * The GetEncoded() method in the public keys in the JCE produces a DER + * encoded one of these.

+ */ + public class SubjectPublicKeyInfo + : Asn1Encodable + { + private readonly AlgorithmIdentifier algID; + private readonly DerBitString keyData; + + public static SubjectPublicKeyInfo GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static SubjectPublicKeyInfo GetInstance( + object obj) + { + if (obj is SubjectPublicKeyInfo) + return (SubjectPublicKeyInfo) obj; + + if (obj != null) + return new SubjectPublicKeyInfo(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public SubjectPublicKeyInfo( + AlgorithmIdentifier algID, + Asn1Encodable publicKey) + { + this.keyData = new DerBitString(publicKey); + this.algID = algID; + } + + public SubjectPublicKeyInfo( + AlgorithmIdentifier algID, + byte[] publicKey) + { + this.keyData = new DerBitString(publicKey); + this.algID = algID; + } + + private SubjectPublicKeyInfo( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.algID = AlgorithmIdentifier.GetInstance(seq[0]); + this.keyData = DerBitString.GetInstance(seq[1]); + } + + public AlgorithmIdentifier AlgorithmID + { + get { return algID; } + } + + /** + * for when the public key is an encoded object - if the bitstring + * can't be decoded this routine raises an IOException. + * + * @exception IOException - if the bit string doesn't represent a Der + * encoded object. + */ + public Asn1Object GetPublicKey() + { + return Asn1Object.FromByteArray(keyData.GetOctets()); + } + + /** + * for when the public key is raw bits... + */ + public DerBitString PublicKeyData + { + get { return keyData; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * SubjectPublicKeyInfo ::= Sequence {
+         *                          algorithm AlgorithmIdentifier,
+         *                          publicKey BIT STRING }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(algID, keyData); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectPublicKeyInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectPublicKeyInfo.cs.meta new file mode 100644 index 00000000..c37e77c5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/SubjectPublicKeyInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 541f1fea72adbd644a70264d4145b14f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertList.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertList.cs new file mode 100644 index 00000000..587416bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertList.cs @@ -0,0 +1,279 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class CrlEntry + : Asn1Encodable + { + internal Asn1Sequence seq; + internal DerInteger userCertificate; + internal Time revocationDate; + internal X509Extensions crlEntryExtensions; + + public CrlEntry( + Asn1Sequence seq) + { + if (seq.Count < 2 || seq.Count > 3) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + this.seq = seq; + + userCertificate = DerInteger.GetInstance(seq[0]); + revocationDate = Time.GetInstance(seq[1]); + } + + public DerInteger UserCertificate + { + get { return userCertificate; } + } + + public Time RevocationDate + { + get { return revocationDate; } + } + + public X509Extensions Extensions + { + get + { + if (crlEntryExtensions == null && seq.Count == 3) + { + crlEntryExtensions = X509Extensions.GetInstance(seq[2]); + } + + return crlEntryExtensions; + } + } + + public override Asn1Object ToAsn1Object() + { + return seq; + } + } + + /** + * PKIX RFC-2459 - TbsCertList object. + *
+     * TbsCertList  ::=  Sequence  {
+     *      version                 Version OPTIONAL,
+     *                                   -- if present, shall be v2
+     *      signature               AlgorithmIdentifier,
+     *      issuer                  Name,
+     *      thisUpdate              Time,
+     *      nextUpdate              Time OPTIONAL,
+     *      revokedCertificates     Sequence OF Sequence  {
+     *           userCertificate         CertificateSerialNumber,
+     *           revocationDate          Time,
+     *           crlEntryExtensions      Extensions OPTIONAL
+     *                                         -- if present, shall be v2
+     *                                }  OPTIONAL,
+     *      crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
+     *                                         -- if present, shall be v2
+     *                                }
+     * 
+ */ + public class TbsCertificateList + : Asn1Encodable + { + private class RevokedCertificatesEnumeration + : IEnumerable + { + private readonly IEnumerable en; + + internal RevokedCertificatesEnumeration( + IEnumerable en) + { + this.en = en; + } + + public IEnumerator GetEnumerator() + { + return new RevokedCertificatesEnumerator(en.GetEnumerator()); + } + + private class RevokedCertificatesEnumerator + : IEnumerator + { + private readonly IEnumerator e; + + internal RevokedCertificatesEnumerator( + IEnumerator e) + { + this.e = e; + } + + public bool MoveNext() + { + return e.MoveNext(); + } + + public void Reset() + { + e.Reset(); + } + + public object Current + { + get { return new CrlEntry(Asn1Sequence.GetInstance(e.Current)); } + } + } + } + + internal Asn1Sequence seq; + internal DerInteger version; + internal AlgorithmIdentifier signature; + internal X509Name issuer; + internal Time thisUpdate; + internal Time nextUpdate; + internal Asn1Sequence revokedCertificates; + internal X509Extensions crlExtensions; + + public static TbsCertificateList GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static TbsCertificateList GetInstance( + object obj) + { + TbsCertificateList list = obj as TbsCertificateList; + + if (obj == null || list != null) + { + return list; + } + + if (obj is Asn1Sequence) + { + return new TbsCertificateList((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + internal TbsCertificateList( + Asn1Sequence seq) + { + if (seq.Count < 3 || seq.Count > 7) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + int seqPos = 0; + + this.seq = seq; + + if (seq[seqPos] is DerInteger) + { + version = DerInteger.GetInstance(seq[seqPos++]); + } + else + { + version = new DerInteger(0); + } + + signature = AlgorithmIdentifier.GetInstance(seq[seqPos++]); + issuer = X509Name.GetInstance(seq[seqPos++]); + thisUpdate = Time.GetInstance(seq[seqPos++]); + + if (seqPos < seq.Count + && (seq[seqPos] is DerUtcTime + || seq[seqPos] is DerGeneralizedTime + || seq[seqPos] is Time)) + { + nextUpdate = Time.GetInstance(seq[seqPos++]); + } + + if (seqPos < seq.Count + && !(seq[seqPos] is DerTaggedObject)) + { + revokedCertificates = Asn1Sequence.GetInstance(seq[seqPos++]); + } + + if (seqPos < seq.Count + && seq[seqPos] is DerTaggedObject) + { + crlExtensions = X509Extensions.GetInstance(seq[seqPos]); + } + } + + public int Version + { + get { return version.Value.IntValue + 1; } + } + + public DerInteger VersionNumber + { + get { return version; } + } + + public AlgorithmIdentifier Signature + { + get { return signature; } + } + + public X509Name Issuer + { + get { return issuer; } + } + + public Time ThisUpdate + { + get { return thisUpdate; } + } + + public Time NextUpdate + { + get { return nextUpdate; } + } + + public CrlEntry[] GetRevokedCertificates() + { + if (revokedCertificates == null) + { + return new CrlEntry[0]; + } + + CrlEntry[] entries = new CrlEntry[revokedCertificates.Count]; + + for (int i = 0; i < entries.Length; i++) + { + entries[i] = new CrlEntry(Asn1Sequence.GetInstance(revokedCertificates[i])); + } + + return entries; + } + + public IEnumerable GetRevokedCertificateEnumeration() + { + if (revokedCertificates == null) + { + return EmptyEnumerable.Instance; + } + + return new RevokedCertificatesEnumeration(revokedCertificates); + } + + public X509Extensions Extensions + { + get { return crlExtensions; } + } + + public override Asn1Object ToAsn1Object() + { + return seq; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertList.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertList.cs.meta new file mode 100644 index 00000000..8d6d7253 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d6dd3b685770b5141ae5641c5efb878e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertificateStructure.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertificateStructure.cs new file mode 100644 index 00000000..1b4d9fb5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertificateStructure.cs @@ -0,0 +1,224 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The TbsCertificate object. + *
+     * TbsCertificate ::= Sequence {
+     *      version          [ 0 ]  Version DEFAULT v1(0),
+     *      serialNumber            CertificateSerialNumber,
+     *      signature               AlgorithmIdentifier,
+     *      issuer                  Name,
+     *      validity                Validity,
+     *      subject                 Name,
+     *      subjectPublicKeyInfo    SubjectPublicKeyInfo,
+     *      issuerUniqueID    [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
+     *      subjectUniqueID   [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
+     *      extensions        [ 3 ] Extensions OPTIONAL
+     *      }
+     * 
+ *

+ * Note: issuerUniqueID and subjectUniqueID are both deprecated by the IETF. This class + * will parse them, but you really shouldn't be creating new ones.

+ */ + public class TbsCertificateStructure + : Asn1Encodable + { + internal Asn1Sequence seq; + internal DerInteger version; + internal DerInteger serialNumber; + internal AlgorithmIdentifier signature; + internal X509Name issuer; + internal Time startDate, endDate; + internal X509Name subject; + internal SubjectPublicKeyInfo subjectPublicKeyInfo; + internal DerBitString issuerUniqueID; + internal DerBitString subjectUniqueID; + internal X509Extensions extensions; + + public static TbsCertificateStructure GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static TbsCertificateStructure GetInstance( + object obj) + { + if (obj is TbsCertificateStructure) + return (TbsCertificateStructure) obj; + + if (obj != null) + return new TbsCertificateStructure(Asn1Sequence.GetInstance(obj)); + + return null; + } + + internal TbsCertificateStructure( + Asn1Sequence seq) + { + int seqStart = 0; + + this.seq = seq; + + // + // some certficates don't include a version number - we assume v1 + // + if (seq[0] is DerTaggedObject) + { + version = DerInteger.GetInstance((Asn1TaggedObject)seq[0], true); + } + else + { + seqStart = -1; // field 0 is missing! + version = new DerInteger(0); + } + + bool isV1 = false; + bool isV2 = false; + + if (version.Value.Equals(BigInteger.Zero)) + { + isV1 = true; + } + else if (version.Value.Equals(BigInteger.One)) + { + isV2 = true; + } + else if (!version.Value.Equals(BigInteger.Two)) + { + throw new ArgumentException("version number not recognised"); + } + + serialNumber = DerInteger.GetInstance(seq[seqStart + 1]); + + signature = AlgorithmIdentifier.GetInstance(seq[seqStart + 2]); + issuer = X509Name.GetInstance(seq[seqStart + 3]); + + // + // before and after dates + // + Asn1Sequence dates = (Asn1Sequence)seq[seqStart + 4]; + + startDate = Time.GetInstance(dates[0]); + endDate = Time.GetInstance(dates[1]); + + subject = X509Name.GetInstance(seq[seqStart + 5]); + + // + // public key info. + // + subjectPublicKeyInfo = SubjectPublicKeyInfo.GetInstance(seq[seqStart + 6]); + + int extras = seq.Count - (seqStart + 6) - 1; + if (extras != 0 && isV1) + throw new ArgumentException("version 1 certificate contains extra data"); + + while (extras > 0) + { + DerTaggedObject extra = (DerTaggedObject)seq[seqStart + 6 + extras]; + + switch (extra.TagNo) + { + case 1: + { + issuerUniqueID = DerBitString.GetInstance(extra, false); + break; + } + case 2: + { + subjectUniqueID = DerBitString.GetInstance(extra, false); + break; + } + case 3: + { + if (isV2) + throw new ArgumentException("version 2 certificate cannot contain extensions"); + + extensions = X509Extensions.GetInstance(Asn1Sequence.GetInstance(extra, true)); + break; + } + default: + { + throw new ArgumentException("Unknown tag encountered in structure: " + extra.TagNo); + } + } + extras--; + } + } + + public int Version + { + get { return version.Value.IntValue + 1; } + } + + public DerInteger VersionNumber + { + get { return version; } + } + + public DerInteger SerialNumber + { + get { return serialNumber; } + } + + public AlgorithmIdentifier Signature + { + get { return signature; } + } + + public X509Name Issuer + { + get { return issuer; } + } + + public Time StartDate + { + get { return startDate; } + } + + public Time EndDate + { + get { return endDate; } + } + + public X509Name Subject + { + get { return subject; } + } + + public SubjectPublicKeyInfo SubjectPublicKeyInfo + { + get { return subjectPublicKeyInfo; } + } + + public DerBitString IssuerUniqueID + { + get { return issuerUniqueID; } + } + + public DerBitString SubjectUniqueID + { + get { return subjectUniqueID; } + } + + public X509Extensions Extensions + { + get { return extensions; } + } + + public override Asn1Object ToAsn1Object() + { + return seq; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertificateStructure.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertificateStructure.cs.meta new file mode 100644 index 00000000..d3edbb24 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TBSCertificateStructure.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebe58b240e863284fa86f16c303f818a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Target.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Target.cs new file mode 100644 index 00000000..b3e84cf1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Target.cs @@ -0,0 +1,145 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Target structure used in target information extension for attribute + * certificates from RFC 3281. + * + *
+	 *     Target  ::= CHOICE {
+	 *       targetName          [0] GeneralName,
+	 *       targetGroup         [1] GeneralName,
+	 *       targetCert          [2] TargetCert
+	 *     }
+	 * 
+ * + *

+ * The targetCert field is currently not supported and must not be used + * according to RFC 3281.

+ */ + public class Target + : Asn1Encodable, IAsn1Choice + { + public enum Choice + { + Name = 0, + Group = 1 + }; + + private readonly GeneralName targetName; + private readonly GeneralName targetGroup; + + /** + * Creates an instance of a Target from the given object. + *

+ * obj can be a Target or a {@link Asn1TaggedObject}

+ * + * @param obj The object. + * @return A Target instance. + * @throws ArgumentException if the given object cannot be + * interpreted as Target. + */ + public static Target GetInstance( + object obj) + { + if (obj is Target) + { + return (Target) obj; + } + + if (obj is Asn1TaggedObject) + { + return new Target((Asn1TaggedObject) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1TaggedObject. + * + * @param tagObj The tagged object. + * @throws ArgumentException if the encoding is wrong. + */ + private Target( + Asn1TaggedObject tagObj) + { + switch ((Choice) tagObj.TagNo) + { + case Choice.Name: // GeneralName is already a choice so explicit + targetName = GeneralName.GetInstance(tagObj, true); + break; + case Choice.Group: + targetGroup = GeneralName.GetInstance(tagObj, true); + break; + default: + throw new ArgumentException("unknown tag: " + tagObj.TagNo); + } + } + + /** + * Constructor from given details. + *

+ * Exactly one of the parameters must be not null.

+ * + * @param type the choice type to apply to the name. + * @param name the general name. + * @throws ArgumentException if type is invalid. + */ + public Target( + Choice type, + GeneralName name) + : this(new DerTaggedObject((int) type, name)) + { + } + + /** + * @return Returns the targetGroup. + */ + public virtual GeneralName TargetGroup + { + get { return targetGroup; } + } + + /** + * @return Returns the targetName. + */ + public virtual GeneralName TargetName + { + get { return targetName; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + * + * Returns: + * + *
+		 *     Target  ::= CHOICE {
+		 *       targetName          [0] GeneralName,
+		 *       targetGroup         [1] GeneralName,
+		 *       targetCert          [2] TargetCert
+		 *     }
+		 * 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + // GeneralName is a choice already so most be explicitly tagged + if (targetName != null) + { + return new DerTaggedObject(true, 0, targetName); + } + + return new DerTaggedObject(true, 1, targetGroup); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Target.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Target.cs.meta new file mode 100644 index 00000000..fe1c7fd1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Target.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b4ad4b705590a2048ab897084fba3cd8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TargetInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TargetInformation.cs new file mode 100644 index 00000000..3edd2c4a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TargetInformation.cs @@ -0,0 +1,129 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Target information extension for attributes certificates according to RFC + * 3281. + * + *
+	 *           SEQUENCE OF Targets
+	 * 
+ * + */ + public class TargetInformation + : Asn1Encodable + { + private readonly Asn1Sequence targets; + + /** + * Creates an instance of a TargetInformation from the given object. + *

+ * obj can be a TargetInformation or a {@link Asn1Sequence}

+ * + * @param obj The object. + * @return A TargetInformation instance. + * @throws ArgumentException if the given object cannot be interpreted as TargetInformation. + */ + public static TargetInformation GetInstance( + object obj) + { + if (obj is TargetInformation) + { + return (TargetInformation) obj; + } + + if (obj is Asn1Sequence) + { + return new TargetInformation((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from a Asn1Sequence. + * + * @param seq The Asn1Sequence. + * @throws ArgumentException if the sequence does not contain + * correctly encoded Targets elements. + */ + private TargetInformation( + Asn1Sequence targets) + { + this.targets = targets; + } + + /** + * Returns the targets in this target information extension. + *

+ * The ArrayList is cloned before it is returned.

+ * + * @return Returns the targets. + */ + public virtual Targets[] GetTargetsObjects() + { + Targets[] result = new Targets[targets.Count]; + + for (int i = 0; i < targets.Count; ++i) + { + result[i] = Targets.GetInstance(targets[i]); + } + + return result; + } + + /** + * Constructs a target information from a single targets element. + * According to RFC 3281 only one targets element must be produced. + * + * @param targets A Targets instance. + */ + public TargetInformation( + Targets targets) + { + this.targets = new DerSequence(targets); + } + + /** + * According to RFC 3281 only one targets element must be produced. If + * multiple targets are given they must be merged in + * into one targets element. + * + * @param targets An array with {@link Targets}. + */ + public TargetInformation( + Target[] targets) + : this(new Targets(targets)) + { + } + + /** + * Produce an object suitable for an Asn1OutputStream. + * + * Returns: + * + *
+		 *          SEQUENCE OF Targets
+		 * 
+ * + *

+ * According to RFC 3281 only one targets element must be produced. If + * multiple targets are given in the constructor they are merged into one + * targets element. If this was produced from a + * {@link BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Asn1Sequence} the encoding is kept.

+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + return targets; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TargetInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TargetInformation.cs.meta new file mode 100644 index 00000000..21670680 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/TargetInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0af01a9e7ae959438c7de9e59e9b10c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Targets.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Targets.cs new file mode 100644 index 00000000..3c4f9035 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Targets.cs @@ -0,0 +1,127 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Targets structure used in target information extension for attribute + * certificates from RFC 3281. + * + *
+	 *            Targets ::= SEQUENCE OF Target
+	 *           
+	 *            Target  ::= CHOICE {
+	 *              targetName          [0] GeneralName,
+	 *              targetGroup         [1] GeneralName,
+	 *              targetCert          [2] TargetCert
+	 *            }
+	 *           
+	 *            TargetCert  ::= SEQUENCE {
+	 *              targetCertificate    IssuerSerial,
+	 *              targetName           GeneralName OPTIONAL,
+	 *              certDigestInfo       ObjectDigestInfo OPTIONAL
+	 *            }
+	 * 
+ * + * @see org.bouncycastle.asn1.x509.Target + * @see org.bouncycastle.asn1.x509.TargetInformation + */ + public class Targets + : Asn1Encodable + { + private readonly Asn1Sequence targets; + + /** + * Creates an instance of a Targets from the given object. + *

+ * obj can be a Targets or a {@link Asn1Sequence}

+ * + * @param obj The object. + * @return A Targets instance. + * @throws ArgumentException if the given object cannot be interpreted as Target. + */ + public static Targets GetInstance( + object obj) + { + if (obj is Targets) + { + return (Targets) obj; + } + + if (obj is Asn1Sequence) + { + return new Targets((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + * + * @param targets The ASN.1 SEQUENCE. + * @throws ArgumentException if the contents of the sequence are + * invalid. + */ + private Targets( + Asn1Sequence targets) + { + this.targets = targets; + } + + /** + * Constructor from given targets. + *

+ * The ArrayList is copied.

+ * + * @param targets An ArrayList of {@link Target}s. + * @see Target + * @throws ArgumentException if the ArrayList contains not only Targets. + */ + public Targets( + Target[] targets) + { + this.targets = new DerSequence(targets); + } + + /** + * Returns the targets in an ArrayList. + *

+ * The ArrayList is cloned before it is returned.

+ * + * @return Returns the targets. + */ + public virtual Target[] GetTargets() + { + Target[] result = new Target[targets.Count]; + + for (int i = 0; i < targets.Count; ++i) + { + result[i] = Target.GetInstance(targets[i]); + } + + return result; + } + + /** + * Produce an object suitable for an Asn1OutputStream. + * + * Returns: + * + *
+		 *            Targets ::= SEQUENCE OF Target
+		 * 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + return targets; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Targets.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Targets.cs.meta new file mode 100644 index 00000000..a730be93 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Targets.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a25a5eb97af15846901b7b792706b8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Time.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Time.cs new file mode 100644 index 00000000..da84df14 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Time.cs @@ -0,0 +1,126 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Globalization; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class Time + : Asn1Encodable, IAsn1Choice + { + private readonly Asn1Object time; + + public static Time GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(obj.GetObject()); + } + + public Time( + Asn1Object time) + { + if (time == null) + throw new ArgumentNullException("time"); + if (!(time is DerUtcTime) && !(time is DerGeneralizedTime)) + throw new ArgumentException("unknown object passed to Time"); + + this.time = time; + } + + /** + * creates a time object from a given date - if the date is between 1950 + * and 2049 a UTCTime object is Generated, otherwise a GeneralizedTime + * is used. + */ + public Time( + DateTime date) + { +#if PORTABLE || NETFX_CORE + string d = date.ToUniversalTime().ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture) + "Z"; +#else + string d = date.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture) + "Z"; +#endif + + int year = int.Parse(d.Substring(0, 4)); + + if (year < 1950 || year > 2049) + { + time = new DerGeneralizedTime(d); + } + else + { + time = new DerUtcTime(d.Substring(2)); + } + } + + public static Time GetInstance( + object obj) + { + if (obj == null || obj is Time) + return (Time)obj; + if (obj is DerUtcTime) + return new Time((DerUtcTime)obj); + if (obj is DerGeneralizedTime) + return new Time((DerGeneralizedTime)obj); + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public string GetTime() + { + if (time is DerUtcTime) + { + return ((DerUtcTime) time).AdjustedTimeString; + } + + return ((DerGeneralizedTime) time).GetTime(); + } + + /// + /// Return our time as DateTime. + /// + /// A date time. + public DateTime ToDateTime() + { + try + { + if (time is DerUtcTime) + { + return ((DerUtcTime)time).ToAdjustedDateTime(); + } + else + { + return ((DerGeneralizedTime)time).ToDateTime(); + } + } + catch (FormatException e) + { + // this should never happen + throw new InvalidOperationException("invalid date string: " + e.Message); + } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * Time ::= CHOICE {
+         *             utcTime        UTCTime,
+         *             generalTime    GeneralizedTime }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return time; + } + + public override string ToString() + { + return GetTime(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Time.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Time.cs.meta new file mode 100644 index 00000000..9d92eb23 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/Time.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32375cfad4bb7a949954d9ef4def0986 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/UserNotice.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/UserNotice.cs new file mode 100644 index 00000000..cbd98887 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/UserNotice.cs @@ -0,0 +1,134 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * UserNotice class, used in + * CertificatePolicies X509 extensions (in policy + * qualifiers). + *
+     * UserNotice ::= Sequence {
+     *      noticeRef        NoticeReference OPTIONAL,
+     *      explicitText     DisplayText OPTIONAL}
+     *
+     * 
+ * + * @see PolicyQualifierId + * @see PolicyInformation + */ + public class UserNotice + : Asn1Encodable + { + private readonly NoticeReference noticeRef; + private readonly DisplayText explicitText; + + /** + * Creates a new UserNotice instance. + * + * @param noticeRef a NoticeReference value + * @param explicitText a DisplayText value + */ + public UserNotice( + NoticeReference noticeRef, + DisplayText explicitText) + { + this.noticeRef = noticeRef; + this.explicitText = explicitText; + } + + /** + * Creates a new UserNotice instance. + * + * @param noticeRef a NoticeReference value + * @param str the explicitText field as a string. + */ + public UserNotice( + NoticeReference noticeRef, + string str) + : this(noticeRef, new DisplayText(str)) + { + } + + /** + * Creates a new UserNotice instance. + *

Useful from reconstructing a UserNotice instance + * from its encodable/encoded form. + * + * @param as an ASN1Sequence value obtained from either + * calling @{link toASN1Object()} for a UserNotice + * instance or from parsing it from a DER-encoded stream.

+ */ + [Obsolete("Use GetInstance() instead")] + public UserNotice( + Asn1Sequence seq) + { + if (seq.Count == 2) + { + noticeRef = NoticeReference.GetInstance(seq[0]); + explicitText = DisplayText.GetInstance(seq[1]); + } + else if (seq.Count == 1) + { + if (seq[0].ToAsn1Object() is Asn1Sequence) + { + noticeRef = NoticeReference.GetInstance(seq[0]); + explicitText = null; + } + else + { + noticeRef = null; + explicitText = DisplayText.GetInstance(seq[0]); + } + } + else if (seq.Count == 0) + { + noticeRef = null; // neither field set! + explicitText = null; + } + else + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + } + + public static UserNotice GetInstance(object obj) + { + if (obj is UserNotice) + return (UserNotice)obj; + if (obj == null) + return null; + return new UserNotice(Asn1Sequence.GetInstance(obj)); + } + + public virtual NoticeReference NoticeRef + { + get { return noticeRef; } + } + + public virtual DisplayText ExplicitText + { + get { return explicitText; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector av = new Asn1EncodableVector(); + + if (noticeRef != null) + { + av.Add(noticeRef); + } + + if (explicitText != null) + { + av.Add(explicitText); + } + + return new DerSequence(av); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/UserNotice.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/UserNotice.cs.meta new file mode 100644 index 00000000..c052082e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/UserNotice.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1bacbf6042ecc245a3a8f24adb88d19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V1TBSCertificateGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V1TBSCertificateGenerator.cs new file mode 100644 index 00000000..20565c95 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V1TBSCertificateGenerator.cs @@ -0,0 +1,112 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Generator for Version 1 TbsCertificateStructures. + *
+     * TbsCertificate ::= Sequence {
+     *      version          [ 0 ]  Version DEFAULT v1(0),
+     *      serialNumber            CertificateSerialNumber,
+     *      signature               AlgorithmIdentifier,
+     *      issuer                  Name,
+     *      validity                Validity,
+     *      subject                 Name,
+     *      subjectPublicKeyInfo    SubjectPublicKeyInfo,
+     *      }
+     * 
+ * + */ + public class V1TbsCertificateGenerator + { + internal DerTaggedObject version = new DerTaggedObject(0, new DerInteger(0)); + internal DerInteger serialNumber; + internal AlgorithmIdentifier signature; + internal X509Name issuer; + internal Time startDate, endDate; + internal X509Name subject; + internal SubjectPublicKeyInfo subjectPublicKeyInfo; + + public V1TbsCertificateGenerator() + { + } + + public void SetSerialNumber( + DerInteger serialNumber) + { + this.serialNumber = serialNumber; + } + + public void SetSignature( + AlgorithmIdentifier signature) + { + this.signature = signature; + } + + public void SetIssuer( + X509Name issuer) + { + this.issuer = issuer; + } + + public void SetStartDate( + Time startDate) + { + this.startDate = startDate; + } + + public void SetStartDate( + DerUtcTime startDate) + { + this.startDate = new Time(startDate); + } + + public void SetEndDate( + Time endDate) + { + this.endDate = endDate; + } + + public void SetEndDate( + DerUtcTime endDate) + { + this.endDate = new Time(endDate); + } + + public void SetSubject( + X509Name subject) + { + this.subject = subject; + } + + public void SetSubjectPublicKeyInfo( + SubjectPublicKeyInfo pubKeyInfo) + { + this.subjectPublicKeyInfo = pubKeyInfo; + } + + public TbsCertificateStructure GenerateTbsCertificate() + { + if ((serialNumber == null) || (signature == null) + || (issuer == null) || (startDate == null) || (endDate == null) + || (subject == null) || (subjectPublicKeyInfo == null)) + { + throw new InvalidOperationException("not all mandatory fields set in V1 TBScertificate generator"); + } + + return new TbsCertificateStructure( + new DerSequence( + //version, - not required as default value + serialNumber, + signature, + issuer, + new DerSequence(startDate, endDate), // before and after dates + subject, + subjectPublicKeyInfo)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V1TBSCertificateGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V1TBSCertificateGenerator.cs.meta new file mode 100644 index 00000000..dc26aa10 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V1TBSCertificateGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3bf7b0d684835c0478c73f83d4d030b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2AttributeCertificateInfoGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2AttributeCertificateInfoGenerator.cs new file mode 100644 index 00000000..bd1afd0b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2AttributeCertificateInfoGenerator.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Generator for Version 2 AttributeCertificateInfo + *
+     * AttributeCertificateInfo ::= Sequence {
+     *       version              AttCertVersion -- version is v2,
+     *       holder               Holder,
+     *       issuer               AttCertIssuer,
+     *       signature            AlgorithmIdentifier,
+     *       serialNumber         CertificateSerialNumber,
+     *       attrCertValidityPeriod   AttCertValidityPeriod,
+     *       attributes           Sequence OF Attr,
+     *       issuerUniqueID       UniqueIdentifier OPTIONAL,
+     *       extensions           Extensions OPTIONAL
+     * }
+     * 
+ * + */ + public class V2AttributeCertificateInfoGenerator + { + internal DerInteger version; + internal Holder holder; + internal AttCertIssuer issuer; + internal AlgorithmIdentifier signature; + internal DerInteger serialNumber; +// internal AttCertValidityPeriod attrCertValidityPeriod; + internal Asn1EncodableVector attributes; + internal DerBitString issuerUniqueID; + internal X509Extensions extensions; + internal DerGeneralizedTime startDate, endDate; + + public V2AttributeCertificateInfoGenerator() + { + this.version = new DerInteger(1); + attributes = new Asn1EncodableVector(); + } + + public void SetHolder( + Holder holder) + { + this.holder = holder; + } + + public void AddAttribute( + string oid, + Asn1Encodable value) + { + attributes.Add(new AttributeX509(new DerObjectIdentifier(oid), new DerSet(value))); + } + + /** + * @param attribute + */ + public void AddAttribute(AttributeX509 attribute) + { + attributes.Add(attribute); + } + + public void SetSerialNumber( + DerInteger serialNumber) + { + this.serialNumber = serialNumber; + } + + public void SetSignature( + AlgorithmIdentifier signature) + { + this.signature = signature; + } + + public void SetIssuer( + AttCertIssuer issuer) + { + this.issuer = issuer; + } + + public void SetStartDate( + DerGeneralizedTime startDate) + { + this.startDate = startDate; + } + + public void SetEndDate( + DerGeneralizedTime endDate) + { + this.endDate = endDate; + } + + public void SetIssuerUniqueID( + DerBitString issuerUniqueID) + { + this.issuerUniqueID = issuerUniqueID; + } + + public void SetExtensions( + X509Extensions extensions) + { + this.extensions = extensions; + } + + public AttributeCertificateInfo GenerateAttributeCertificateInfo() + { + if ((serialNumber == null) || (signature == null) + || (issuer == null) || (startDate == null) || (endDate == null) + || (holder == null) || (attributes == null)) + { + throw new InvalidOperationException("not all mandatory fields set in V2 AttributeCertificateInfo generator"); + } + + Asn1EncodableVector v = new Asn1EncodableVector( + version, holder, issuer, signature, serialNumber); + + // + // before and after dates => AttCertValidityPeriod + // + v.Add(new AttCertValidityPeriod(startDate, endDate)); + + // Attributes + v.Add(new DerSequence(attributes)); + + if (issuerUniqueID != null) + { + v.Add(issuerUniqueID); + } + + if (extensions != null) + { + v.Add(extensions); + } + + return AttributeCertificateInfo.GetInstance(new DerSequence(v)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2AttributeCertificateInfoGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2AttributeCertificateInfoGenerator.cs.meta new file mode 100644 index 00000000..cc8c5375 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2AttributeCertificateInfoGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5bc1d69cea63ecc49ba5a62b9831c156 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2Form.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2Form.cs new file mode 100644 index 00000000..bdc55fbb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2Form.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class V2Form + : Asn1Encodable + { + internal GeneralNames issuerName; + internal IssuerSerial baseCertificateID; + internal ObjectDigestInfo objectDigestInfo; + + public static V2Form GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static V2Form GetInstance(object obj) + { + if (obj is V2Form) + return (V2Form)obj; + if (obj != null) + return new V2Form(Asn1Sequence.GetInstance(obj)); + return null; + } + + public V2Form(GeneralNames issuerName) + : this(issuerName, null, null) + { + } + + public V2Form(GeneralNames issuerName, IssuerSerial baseCertificateID) + : this(issuerName, baseCertificateID, null) + { + } + + public V2Form(GeneralNames issuerName, ObjectDigestInfo objectDigestInfo) + : this(issuerName, null, objectDigestInfo) + { + } + + public V2Form( + GeneralNames issuerName, + IssuerSerial baseCertificateID, + ObjectDigestInfo objectDigestInfo) + { + this.issuerName = issuerName; + this.baseCertificateID = baseCertificateID; + this.objectDigestInfo = objectDigestInfo; + } + + private V2Form( + Asn1Sequence seq) + { + if (seq.Count > 3) + { + throw new ArgumentException("Bad sequence size: " + seq.Count); + } + + int index = 0; + + if (!(seq[0] is Asn1TaggedObject)) + { + index++; + this.issuerName = GeneralNames.GetInstance(seq[0]); + } + + for (int i = index; i != seq.Count; i++) + { + Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[i]); + if (o.TagNo == 0) + { + baseCertificateID = IssuerSerial.GetInstance(o, false); + } + else if (o.TagNo == 1) + { + objectDigestInfo = ObjectDigestInfo.GetInstance(o, false); + } + else + { + throw new ArgumentException("Bad tag number: " + o.TagNo); + } + } + } + + public GeneralNames IssuerName + { + get { return issuerName; } + } + + public IssuerSerial BaseCertificateID + { + get { return baseCertificateID; } + } + + public ObjectDigestInfo ObjectDigestInfo + { + get { return objectDigestInfo; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  V2Form ::= Sequence {
+         *       issuerName            GeneralNames  OPTIONAL,
+         *       baseCertificateID     [0] IssuerSerial  OPTIONAL,
+         *       objectDigestInfo      [1] ObjectDigestInfo  OPTIONAL
+         *         -- issuerName MUST be present in this profile
+         *         -- baseCertificateID and objectDigestInfo MUST NOT
+         *         -- be present in this profile
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (issuerName != null) + { + v.Add(issuerName); + } + + if (baseCertificateID != null) + { + v.Add(new DerTaggedObject(false, 0, baseCertificateID)); + } + + if (objectDigestInfo != null) + { + v.Add(new DerTaggedObject(false, 1, objectDigestInfo)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2Form.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2Form.cs.meta new file mode 100644 index 00000000..cf2ef586 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2Form.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59132af610a2a0848981b0d69a466f9b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2TBSCertListGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2TBSCertListGenerator.cs new file mode 100644 index 00000000..70cdd368 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2TBSCertListGenerator.cs @@ -0,0 +1,205 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Generator for Version 2 TbsCertList structures. + *
+     *  TbsCertList  ::=  Sequence  {
+     *       version                 Version OPTIONAL,
+     *                                    -- if present, shall be v2
+     *       signature               AlgorithmIdentifier,
+     *       issuer                  Name,
+     *       thisUpdate              Time,
+     *       nextUpdate              Time OPTIONAL,
+     *       revokedCertificates     Sequence OF Sequence  {
+     *            userCertificate         CertificateSerialNumber,
+     *            revocationDate          Time,
+     *            crlEntryExtensions      Extensions OPTIONAL
+     *                                          -- if present, shall be v2
+     *                                 }  OPTIONAL,
+     *       crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
+     *                                          -- if present, shall be v2
+     *                                 }
+     * 
+ * + * Note: This class may be subject to change + */ + public class V2TbsCertListGenerator + { + private DerInteger version = new DerInteger(1); + private AlgorithmIdentifier signature; + private X509Name issuer; + private Time thisUpdate, nextUpdate; + private X509Extensions extensions; + private IList crlEntries; + + public V2TbsCertListGenerator() + { + } + + public void SetSignature( + AlgorithmIdentifier signature) + { + this.signature = signature; + } + + public void SetIssuer( + X509Name issuer) + { + this.issuer = issuer; + } + + public void SetThisUpdate( + DerUtcTime thisUpdate) + { + this.thisUpdate = new Time(thisUpdate); + } + + public void SetNextUpdate( + DerUtcTime nextUpdate) + { + this.nextUpdate = (nextUpdate != null) + ? new Time(nextUpdate) + : null; + } + + public void SetThisUpdate( + Time thisUpdate) + { + this.thisUpdate = thisUpdate; + } + + public void SetNextUpdate( + Time nextUpdate) + { + this.nextUpdate = nextUpdate; + } + + public void AddCrlEntry( + Asn1Sequence crlEntry) + { + if (crlEntries == null) + { + crlEntries = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + } + + crlEntries.Add(crlEntry); + } + + public void AddCrlEntry(DerInteger userCertificate, DerUtcTime revocationDate, int reason) + { + AddCrlEntry(userCertificate, new Time(revocationDate), reason); + } + + public void AddCrlEntry(DerInteger userCertificate, Time revocationDate, int reason) + { + AddCrlEntry(userCertificate, revocationDate, reason, null); + } + + public void AddCrlEntry(DerInteger userCertificate, Time revocationDate, int reason, + DerGeneralizedTime invalidityDate) + { + IList extOids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + IList extValues = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + if (reason != 0) + { + CrlReason crlReason = new CrlReason(reason); + + try + { + extOids.Add(X509Extensions.ReasonCode); + extValues.Add(new X509Extension(false, new DerOctetString(crlReason.GetEncoded()))); + } + catch (IOException e) + { + throw new ArgumentException("error encoding reason: " + e); + } + } + + if (invalidityDate != null) + { + try + { + extOids.Add(X509Extensions.InvalidityDate); + extValues.Add(new X509Extension(false, new DerOctetString(invalidityDate.GetEncoded()))); + } + catch (IOException e) + { + throw new ArgumentException("error encoding invalidityDate: " + e); + } + } + + if (extOids.Count != 0) + { + AddCrlEntry(userCertificate, revocationDate, new X509Extensions(extOids, extValues)); + } + else + { + AddCrlEntry(userCertificate, revocationDate, null); + } + } + + public void AddCrlEntry(DerInteger userCertificate, Time revocationDate, X509Extensions extensions) + { + Asn1EncodableVector v = new Asn1EncodableVector( + userCertificate, revocationDate); + + if (extensions != null) + { + v.Add(extensions); + } + + AddCrlEntry(new DerSequence(v)); + } + + public void SetExtensions( + X509Extensions extensions) + { + this.extensions = extensions; + } + + public TbsCertificateList GenerateTbsCertList() + { + if ((signature == null) || (issuer == null) || (thisUpdate == null)) + { + throw new InvalidOperationException("Not all mandatory fields set in V2 TbsCertList generator."); + } + + Asn1EncodableVector v = new Asn1EncodableVector( + version, signature, issuer, thisUpdate); + + if (nextUpdate != null) + { + v.Add(nextUpdate); + } + + // Add CRLEntries if they exist + if (crlEntries != null) + { + Asn1Sequence[] certs = new Asn1Sequence[crlEntries.Count]; + for (int i = 0; i < crlEntries.Count; ++i) + { + certs[i] = (Asn1Sequence)crlEntries[i]; + } + v.Add(new DerSequence(certs)); + } + + if (extensions != null) + { + v.Add(new DerTaggedObject(0, extensions)); + } + + return new TbsCertificateList(new DerSequence(v)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2TBSCertListGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2TBSCertListGenerator.cs.meta new file mode 100644 index 00000000..72b742b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V2TBSCertListGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c78e8b920c4cda4439f32c1d3ee8c8bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V3TBSCertificateGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V3TBSCertificateGenerator.cs new file mode 100644 index 00000000..0ef0a85a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V3TBSCertificateGenerator.cs @@ -0,0 +1,172 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * Generator for Version 3 TbsCertificateStructures. + *
+     * TbsCertificate ::= Sequence {
+     *      version          [ 0 ]  Version DEFAULT v1(0),
+     *      serialNumber            CertificateSerialNumber,
+     *      signature               AlgorithmIdentifier,
+     *      issuer                  Name,
+     *      validity                Validity,
+     *      subject                 Name,
+     *      subjectPublicKeyInfo    SubjectPublicKeyInfo,
+     *      issuerUniqueID    [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
+     *      subjectUniqueID   [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
+     *      extensions        [ 3 ] Extensions OPTIONAL
+     *      }
+     * 
+ * + */ + public class V3TbsCertificateGenerator + { + internal DerTaggedObject version = new DerTaggedObject(0, new DerInteger(2)); + internal DerInteger serialNumber; + internal AlgorithmIdentifier signature; + internal X509Name issuer; + internal Time startDate, endDate; + internal X509Name subject; + internal SubjectPublicKeyInfo subjectPublicKeyInfo; + internal X509Extensions extensions; + + private bool altNamePresentAndCritical; + private DerBitString issuerUniqueID; + private DerBitString subjectUniqueID; + + public V3TbsCertificateGenerator() + { + } + + public void SetSerialNumber( + DerInteger serialNumber) + { + this.serialNumber = serialNumber; + } + + public void SetSignature( + AlgorithmIdentifier signature) + { + this.signature = signature; + } + + public void SetIssuer( + X509Name issuer) + { + this.issuer = issuer; + } + + public void SetStartDate( + DerUtcTime startDate) + { + this.startDate = new Time(startDate); + } + + public void SetStartDate( + Time startDate) + { + this.startDate = startDate; + } + + public void SetEndDate( + DerUtcTime endDate) + { + this.endDate = new Time(endDate); + } + + public void SetEndDate( + Time endDate) + { + this.endDate = endDate; + } + + public void SetSubject( + X509Name subject) + { + this.subject = subject; + } + + public void SetIssuerUniqueID( + DerBitString uniqueID) + { + this.issuerUniqueID = uniqueID; + } + + public void SetSubjectUniqueID( + DerBitString uniqueID) + { + this.subjectUniqueID = uniqueID; + } + + public void SetSubjectPublicKeyInfo( + SubjectPublicKeyInfo pubKeyInfo) + { + this.subjectPublicKeyInfo = pubKeyInfo; + } + + public void SetExtensions( + X509Extensions extensions) + { + this.extensions = extensions; + + if (extensions != null) + { + X509Extension altName = extensions.GetExtension(X509Extensions.SubjectAlternativeName); + + if (altName != null && altName.IsCritical) + { + altNamePresentAndCritical = true; + } + } + } + + public TbsCertificateStructure GenerateTbsCertificate() + { + if ((serialNumber == null) || (signature == null) + || (issuer == null) || (startDate == null) || (endDate == null) + || (subject == null && !altNamePresentAndCritical) + || (subjectPublicKeyInfo == null)) + { + throw new InvalidOperationException("not all mandatory fields set in V3 TBScertificate generator"); + } + + DerSequence validity = new DerSequence(startDate, endDate); // before and after dates + + Asn1EncodableVector v = new Asn1EncodableVector( + version, serialNumber, signature, issuer, validity); + + if (subject != null) + { + v.Add(subject); + } + else + { + v.Add(DerSequence.Empty); + } + + v.Add(subjectPublicKeyInfo); + + if (issuerUniqueID != null) + { + v.Add(new DerTaggedObject(false, 1, issuerUniqueID)); + } + + if (subjectUniqueID != null) + { + v.Add(new DerTaggedObject(false, 2, subjectUniqueID)); + } + + if (extensions != null) + { + v.Add(new DerTaggedObject(3, extensions)); + } + + return new TbsCertificateStructure(new DerSequence(v)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V3TBSCertificateGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V3TBSCertificateGenerator.cs.meta new file mode 100644 index 00000000..f14d4d09 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/V3TBSCertificateGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e7cc7fb6ecbe8a439c121350604ca1c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Attributes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Attributes.cs new file mode 100644 index 00000000..2c51a254 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Attributes.cs @@ -0,0 +1,13 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class X509Attributes + { + public static readonly DerObjectIdentifier RoleSyntax = new DerObjectIdentifier("2.5.4.72"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Attributes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Attributes.cs.meta new file mode 100644 index 00000000..921a32b4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Attributes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b1f8646b5113813429054946ba591142 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509CertificateStructure.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509CertificateStructure.cs new file mode 100644 index 00000000..e088019f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509CertificateStructure.cs @@ -0,0 +1,136 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * an X509Certificate structure. + *
+     *  Certificate ::= Sequence {
+     *      tbsCertificate          TbsCertificate,
+     *      signatureAlgorithm      AlgorithmIdentifier,
+     *      signature               BIT STRING
+     *  }
+     * 
+ */ + public class X509CertificateStructure + : Asn1Encodable + { + private readonly TbsCertificateStructure tbsCert; + private readonly AlgorithmIdentifier sigAlgID; + private readonly DerBitString sig; + + public static X509CertificateStructure GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static X509CertificateStructure GetInstance( + object obj) + { + if (obj is X509CertificateStructure) + return (X509CertificateStructure)obj; + if (obj == null) + return null; + return new X509CertificateStructure(Asn1Sequence.GetInstance(obj)); + } + + public X509CertificateStructure( + TbsCertificateStructure tbsCert, + AlgorithmIdentifier sigAlgID, + DerBitString sig) + { + if (tbsCert == null) + throw new ArgumentNullException("tbsCert"); + if (sigAlgID == null) + throw new ArgumentNullException("sigAlgID"); + if (sig == null) + throw new ArgumentNullException("sig"); + + this.tbsCert = tbsCert; + this.sigAlgID = sigAlgID; + this.sig = sig; + } + + private X509CertificateStructure( + Asn1Sequence seq) + { + if (seq.Count != 3) + throw new ArgumentException("sequence wrong size for a certificate", "seq"); + + // + // correct x509 certficate + // + tbsCert = TbsCertificateStructure.GetInstance(seq[0]); + sigAlgID = AlgorithmIdentifier.GetInstance(seq[1]); + sig = DerBitString.GetInstance(seq[2]); + } + + public TbsCertificateStructure TbsCertificate + { + get { return tbsCert; } + } + + public int Version + { + get { return tbsCert.Version; } + } + + public DerInteger SerialNumber + { + get { return tbsCert.SerialNumber; } + } + + public X509Name Issuer + { + get { return tbsCert.Issuer; } + } + + public Time StartDate + { + get { return tbsCert.StartDate; } + } + + public Time EndDate + { + get { return tbsCert.EndDate; } + } + + public X509Name Subject + { + get { return tbsCert.Subject; } + } + + public SubjectPublicKeyInfo SubjectPublicKeyInfo + { + get { return tbsCert.SubjectPublicKeyInfo; } + } + + public AlgorithmIdentifier SignatureAlgorithm + { + get { return sigAlgID; } + } + + public DerBitString Signature + { + get { return sig; } + } + + public byte[] GetSignatureOctets() + { + return sig.GetOctets(); + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(tbsCert, sigAlgID, sig); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509CertificateStructure.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509CertificateStructure.cs.meta new file mode 100644 index 00000000..2eba51a8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509CertificateStructure.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07b8281eb25e0f54389db97a4909a94b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509DefaultEntryConverter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509DefaultEntryConverter.cs new file mode 100644 index 00000000..b8426992 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509DefaultEntryConverter.cs @@ -0,0 +1,67 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * The default converter for X509 DN entries when going from their + * string value to ASN.1 strings. + */ + public class X509DefaultEntryConverter + : X509NameEntryConverter + { + /** + * Apply default conversion for the given value depending on the oid + * and the character range of the value. + * + * @param oid the object identifier for the DN entry + * @param value the value associated with it + * @return the ASN.1 equivalent for the string value. + */ + public override Asn1Object GetConvertedValue( + DerObjectIdentifier oid, + string value) + { + if (value.Length != 0 && value[0] == '#') + { + try + { + return ConvertHexEncoded(value, 1); + } + catch (IOException) + { + throw new Exception("can't recode value for oid " + oid.Id); + } + } + + if (value.Length != 0 && value[0] == '\\') + { + value = value.Substring(1); + } + + if (oid.Equals(X509Name.EmailAddress) || oid.Equals(X509Name.DC)) + { + return new DerIA5String(value); + } + + if (oid.Equals(X509Name.DateOfBirth)) // accept time string as well as # (for compatibility) + { + return new DerGeneralizedTime(value); + } + + if (oid.Equals(X509Name.C) + || oid.Equals(X509Name.SerialNumber) + || oid.Equals(X509Name.DnQualifier) + || oid.Equals(X509Name.TelephoneNumber)) + { + return new DerPrintableString(value); + } + + return new DerUtf8String(value); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509DefaultEntryConverter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509DefaultEntryConverter.cs.meta new file mode 100644 index 00000000..94363571 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509DefaultEntryConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d2bf5c5a95b4e0d448438db02c8064bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extension.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extension.cs new file mode 100644 index 00000000..5ecb78f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extension.cs @@ -0,0 +1,83 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * an object for the elements in the X.509 V3 extension block. + */ + public class X509Extension + { + internal bool critical; + internal Asn1OctetString value; + + public X509Extension( + DerBoolean critical, + Asn1OctetString value) + { + if (critical == null) + { + throw new ArgumentNullException("critical"); + } + + this.critical = critical.IsTrue; + this.value = value; + } + + public X509Extension( + bool critical, + Asn1OctetString value) + { + this.critical = critical; + this.value = value; + } + + public bool IsCritical { get { return critical; } } + + public Asn1OctetString Value { get { return value; } } + + public Asn1Encodable GetParsedValue() + { + return ConvertValueToObject(this); + } + + public override int GetHashCode() + { + int vh = this.Value.GetHashCode(); + + return IsCritical ? vh : ~vh; + } + + public override bool Equals( + object obj) + { + X509Extension other = obj as X509Extension; + if (other == null) + { + return false; + } + + return Value.Equals(other.Value) && IsCritical == other.IsCritical; + } + + /// Convert the value of the passed in extension to an object. + /// The extension to parse. + /// The object the value string contains. + /// If conversion is not possible. + public static Asn1Object ConvertValueToObject( + X509Extension ext) + { + try + { + return Asn1Object.FromByteArray(ext.Value.GetOctets()); + } + catch (Exception e) + { + throw new ArgumentException("can't convert extension", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extension.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extension.cs.meta new file mode 100644 index 00000000..1c6643ce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extension.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bdf1efbea63a3c94781a5a0b7a673bb0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extensions.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extensions.cs new file mode 100644 index 00000000..4e654cf3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extensions.cs @@ -0,0 +1,463 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public class X509Extensions + : Asn1Encodable + { + /** + * Subject Directory Attributes + */ + public static readonly DerObjectIdentifier SubjectDirectoryAttributes = new DerObjectIdentifier("2.5.29.9"); + + /** + * Subject Key Identifier + */ + public static readonly DerObjectIdentifier SubjectKeyIdentifier = new DerObjectIdentifier("2.5.29.14"); + + /** + * Key Usage + */ + public static readonly DerObjectIdentifier KeyUsage = new DerObjectIdentifier("2.5.29.15"); + + /** + * Private Key Usage Period + */ + public static readonly DerObjectIdentifier PrivateKeyUsagePeriod = new DerObjectIdentifier("2.5.29.16"); + + /** + * Subject Alternative Name + */ + public static readonly DerObjectIdentifier SubjectAlternativeName = new DerObjectIdentifier("2.5.29.17"); + + /** + * Issuer Alternative Name + */ + public static readonly DerObjectIdentifier IssuerAlternativeName = new DerObjectIdentifier("2.5.29.18"); + + /** + * Basic Constraints + */ + public static readonly DerObjectIdentifier BasicConstraints = new DerObjectIdentifier("2.5.29.19"); + + /** + * CRL Number + */ + public static readonly DerObjectIdentifier CrlNumber = new DerObjectIdentifier("2.5.29.20"); + + /** + * Reason code + */ + public static readonly DerObjectIdentifier ReasonCode = new DerObjectIdentifier("2.5.29.21"); + + /** + * Hold Instruction Code + */ + public static readonly DerObjectIdentifier InstructionCode = new DerObjectIdentifier("2.5.29.23"); + + /** + * Invalidity Date + */ + public static readonly DerObjectIdentifier InvalidityDate = new DerObjectIdentifier("2.5.29.24"); + + /** + * Delta CRL indicator + */ + public static readonly DerObjectIdentifier DeltaCrlIndicator = new DerObjectIdentifier("2.5.29.27"); + + /** + * Issuing Distribution Point + */ + public static readonly DerObjectIdentifier IssuingDistributionPoint = new DerObjectIdentifier("2.5.29.28"); + + /** + * Certificate Issuer + */ + public static readonly DerObjectIdentifier CertificateIssuer = new DerObjectIdentifier("2.5.29.29"); + + /** + * Name Constraints + */ + public static readonly DerObjectIdentifier NameConstraints = new DerObjectIdentifier("2.5.29.30"); + + /** + * CRL Distribution Points + */ + public static readonly DerObjectIdentifier CrlDistributionPoints = new DerObjectIdentifier("2.5.29.31"); + + /** + * Certificate Policies + */ + public static readonly DerObjectIdentifier CertificatePolicies = new DerObjectIdentifier("2.5.29.32"); + + /** + * Policy Mappings + */ + public static readonly DerObjectIdentifier PolicyMappings = new DerObjectIdentifier("2.5.29.33"); + + /** + * Authority Key Identifier + */ + public static readonly DerObjectIdentifier AuthorityKeyIdentifier = new DerObjectIdentifier("2.5.29.35"); + + /** + * Policy Constraints + */ + public static readonly DerObjectIdentifier PolicyConstraints = new DerObjectIdentifier("2.5.29.36"); + + /** + * Extended Key Usage + */ + public static readonly DerObjectIdentifier ExtendedKeyUsage = new DerObjectIdentifier("2.5.29.37"); + + /** + * Freshest CRL + */ + public static readonly DerObjectIdentifier FreshestCrl = new DerObjectIdentifier("2.5.29.46"); + + /** + * Inhibit Any Policy + */ + public static readonly DerObjectIdentifier InhibitAnyPolicy = new DerObjectIdentifier("2.5.29.54"); + + /** + * Authority Info Access + */ + public static readonly DerObjectIdentifier AuthorityInfoAccess = new DerObjectIdentifier("1.3.6.1.5.5.7.1.1"); + + /** + * Subject Info Access + */ + public static readonly DerObjectIdentifier SubjectInfoAccess = new DerObjectIdentifier("1.3.6.1.5.5.7.1.11"); + + /** + * Logo Type + */ + public static readonly DerObjectIdentifier LogoType = new DerObjectIdentifier("1.3.6.1.5.5.7.1.12"); + + /** + * BiometricInfo + */ + public static readonly DerObjectIdentifier BiometricInfo = new DerObjectIdentifier("1.3.6.1.5.5.7.1.2"); + + /** + * QCStatements + */ + public static readonly DerObjectIdentifier QCStatements = new DerObjectIdentifier("1.3.6.1.5.5.7.1.3"); + + /** + * Audit identity extension in attribute certificates. + */ + public static readonly DerObjectIdentifier AuditIdentity = new DerObjectIdentifier("1.3.6.1.5.5.7.1.4"); + + /** + * NoRevAvail extension in attribute certificates. + */ + public static readonly DerObjectIdentifier NoRevAvail = new DerObjectIdentifier("2.5.29.56"); + + /** + * TargetInformation extension in attribute certificates. + */ + public static readonly DerObjectIdentifier TargetInformation = new DerObjectIdentifier("2.5.29.55"); + + /** + * Expired Certificates on CRL extension + */ + public static readonly DerObjectIdentifier ExpiredCertsOnCrl = new DerObjectIdentifier("2.5.29.60"); + + private readonly IDictionary extensions = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private readonly IList ordering; + + public static X509Extensions GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static X509Extensions GetInstance( + object obj) + { + if (obj == null || obj is X509Extensions) + { + return (X509Extensions) obj; + } + + if (obj is Asn1Sequence) + { + return new X509Extensions((Asn1Sequence) obj); + } + + if (obj is Asn1TaggedObject) + { + return GetInstance(((Asn1TaggedObject) obj).GetObject()); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + * + * the extensions are a list of constructed sequences, either with (Oid, OctetString) or (Oid, Boolean, OctetString) + */ + private X509Extensions( + Asn1Sequence seq) + { + this.ordering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + foreach (Asn1Encodable ae in seq) + { + Asn1Sequence s = Asn1Sequence.GetInstance(ae.ToAsn1Object()); + + if (s.Count < 2 || s.Count > 3) + throw new ArgumentException("Bad sequence size: " + s.Count); + + DerObjectIdentifier oid = DerObjectIdentifier.GetInstance(s[0].ToAsn1Object()); + + bool isCritical = s.Count == 3 + && DerBoolean.GetInstance(s[1].ToAsn1Object()).IsTrue; + + Asn1OctetString octets = Asn1OctetString.GetInstance(s[s.Count - 1].ToAsn1Object()); + + if (extensions.Contains(oid)) + throw new ArgumentException("repeated extension found: " + oid); + + extensions.Add(oid, new X509Extension(isCritical, octets)); + ordering.Add(oid); + } + } + + /** + * constructor from a table of extensions. + *

+ * it's is assumed the table contains Oid/string pairs.

+ */ + public X509Extensions( + IDictionary extensions) + : this(null, extensions) + { + } + + /** + * Constructor from a table of extensions with ordering. + *

+ * It's is assumed the table contains Oid/string pairs.

+ */ + public X509Extensions( + IList ordering, + IDictionary extensions) + { + if (ordering == null) + { + this.ordering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(extensions.Keys); + } + else + { + this.ordering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(ordering); + } + + foreach (DerObjectIdentifier oid in this.ordering) + { + this.extensions.Add(oid, (X509Extension)extensions[oid]); + } + } + + /** + * Constructor from two vectors + * + * @param objectIDs an ArrayList of the object identifiers. + * @param values an ArrayList of the extension values. + */ + public X509Extensions( + IList oids, + IList values) + { + this.ordering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(oids); + + int count = 0; + foreach (DerObjectIdentifier oid in this.ordering) + { + this.extensions.Add(oid, (X509Extension)values[count++]); + } + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + /** + * constructor from a table of extensions. + *

+ * it's is assumed the table contains Oid/string pairs.

+ */ + [Obsolete] + public X509Extensions( + Hashtable extensions) + : this(null, extensions) + { + } + + /** + * Constructor from a table of extensions with ordering. + *

+ * It's is assumed the table contains Oid/string pairs.

+ */ + [Obsolete] + public X509Extensions( + ArrayList ordering, + Hashtable extensions) + { + if (ordering == null) + { + this.ordering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(extensions.Keys); + } + else + { + this.ordering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(ordering); + } + + foreach (DerObjectIdentifier oid in this.ordering) + { + this.extensions.Add(oid, (X509Extension) extensions[oid]); + } + } + + /** + * Constructor from two vectors + * + * @param objectIDs an ArrayList of the object identifiers. + * @param values an ArrayList of the extension values. + */ + [Obsolete] + public X509Extensions( + ArrayList oids, + ArrayList values) + { + this.ordering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(oids); + + int count = 0; + foreach (DerObjectIdentifier oid in this.ordering) + { + this.extensions.Add(oid, (X509Extension) values[count++]); + } + } +#endif + + [Obsolete("Use ExtensionOids IEnumerable property")] + public IEnumerator Oids() + { + return ExtensionOids.GetEnumerator(); + } + + /** + * return an Enumeration of the extension field's object ids. + */ + public IEnumerable ExtensionOids + { + get { return new EnumerableProxy(ordering); } + } + + /** + * return the extension represented by the object identifier + * passed in. + * + * @return the extension if it's present, null otherwise. + */ + public X509Extension GetExtension( + DerObjectIdentifier oid) + { + return (X509Extension) extensions[oid]; + } + + /** + *
+		 *     Extensions        ::=   SEQUENCE SIZE (1..MAX) OF Extension
+		 *
+		 *     Extension         ::=   SEQUENCE {
+		 *        extnId            EXTENSION.&id ({ExtensionSet}),
+		 *        critical          BOOLEAN DEFAULT FALSE,
+		 *        extnValue         OCTET STRING }
+		 * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + + foreach (DerObjectIdentifier oid in ordering) + { + X509Extension ext = (X509Extension) extensions[oid]; + Asn1EncodableVector v = new Asn1EncodableVector(oid); + + if (ext.IsCritical) + { + v.Add(DerBoolean.True); + } + + v.Add(ext.Value); + + vec.Add(new DerSequence(v)); + } + + return new DerSequence(vec); + } + + public bool Equivalent( + X509Extensions other) + { + if (extensions.Count != other.extensions.Count) + return false; + + foreach (DerObjectIdentifier oid in extensions.Keys) + { + if (!extensions[oid].Equals(other.extensions[oid])) + return false; + } + + return true; + } + + public DerObjectIdentifier[] GetExtensionOids() + { + return ToOidArray(ordering); + } + + public DerObjectIdentifier[] GetNonCriticalExtensionOids() + { + return GetExtensionOids(false); + } + + public DerObjectIdentifier[] GetCriticalExtensionOids() + { + return GetExtensionOids(true); + } + + private DerObjectIdentifier[] GetExtensionOids(bool isCritical) + { + IList oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + foreach (DerObjectIdentifier oid in this.ordering) + { + X509Extension ext = (X509Extension)extensions[oid]; + if (ext.IsCritical == isCritical) + { + oids.Add(oid); + } + } + + return ToOidArray(oids); + } + + private static DerObjectIdentifier[] ToOidArray(IList oids) + { + DerObjectIdentifier[] oidArray = new DerObjectIdentifier[oids.Count]; + oids.CopyTo(oidArray, 0); + return oidArray; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extensions.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extensions.cs.meta new file mode 100644 index 00000000..3b11f40a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Extensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00b54aa58571c6e429b23126f5560710 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ExtensionsGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ExtensionsGenerator.cs new file mode 100644 index 00000000..675d7dc9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ExtensionsGenerator.cs @@ -0,0 +1,85 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /// Generator for X.509 extensions + public class X509ExtensionsGenerator + { + private IDictionary extensions = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private IList extOrdering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + /// Reset the generator + public void Reset() + { + extensions = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + extOrdering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + } + + /// + /// Add an extension with the given oid and the passed in value to be included + /// in the OCTET STRING associated with the extension. + /// + /// OID for the extension. + /// True if critical, false otherwise. + /// The ASN.1 object to be included in the extension. + public void AddExtension( + DerObjectIdentifier oid, + bool critical, + Asn1Encodable extValue) + { + byte[] encoded; + try + { + encoded = extValue.GetDerEncoded(); + } + catch (Exception e) + { + throw new ArgumentException("error encoding value: " + e); + } + + this.AddExtension(oid, critical, encoded); + } + + /// + /// Add an extension with the given oid and the passed in byte array to be wrapped + /// in the OCTET STRING associated with the extension. + /// + /// OID for the extension. + /// True if critical, false otherwise. + /// The byte array to be wrapped. + public void AddExtension( + DerObjectIdentifier oid, + bool critical, + byte[] extValue) + { + if (extensions.Contains(oid)) + { + throw new ArgumentException("extension " + oid + " already added"); + } + + extOrdering.Add(oid); + extensions.Add(oid, new X509Extension(critical, new DerOctetString(extValue))); + } + + /// Return true if there are no extension present in this generator. + /// True if empty, false otherwise + public bool IsEmpty + { + get { return extOrdering.Count < 1; } + } + + /// Generate an X509Extensions object based on the current state of the generator. + /// An X509Extensions object + public X509Extensions Generate() + { + return new X509Extensions(extOrdering, extensions); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ExtensionsGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ExtensionsGenerator.cs.meta new file mode 100644 index 00000000..e4a7e8a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ExtensionsGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17d0bf23e5bd4634286e5be7869c8ab4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Name.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Name.cs new file mode 100644 index 00000000..f43189af --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Name.cs @@ -0,0 +1,1086 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +#if SILVERLIGHT || PORTABLE || NETFX_CORE +using System.Collections.Generic; +#endif + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + *
+    *     RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
+    *
+    *     RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue
+    *
+    *     AttributeTypeAndValue ::= SEQUENCE {
+    *                                   type  OBJECT IDENTIFIER,
+    *                                   value ANY }
+    * 
+ */ + public class X509Name + : Asn1Encodable + { + /** + * country code - StringType(SIZE(2)) + */ + public static readonly DerObjectIdentifier C = new DerObjectIdentifier("2.5.4.6"); + + /** + * organization - StringType(SIZE(1..64)) + */ + public static readonly DerObjectIdentifier O = new DerObjectIdentifier("2.5.4.10"); + + /** + * organizational unit name - StringType(SIZE(1..64)) + */ + public static readonly DerObjectIdentifier OU = new DerObjectIdentifier("2.5.4.11"); + + /** + * Title + */ + public static readonly DerObjectIdentifier T = new DerObjectIdentifier("2.5.4.12"); + + /** + * common name - StringType(SIZE(1..64)) + */ + public static readonly DerObjectIdentifier CN = new DerObjectIdentifier("2.5.4.3"); + + /** + * street - StringType(SIZE(1..64)) + */ + public static readonly DerObjectIdentifier Street = new DerObjectIdentifier("2.5.4.9"); + + /** + * device serial number name - StringType(SIZE(1..64)) + */ + public static readonly DerObjectIdentifier SerialNumber = new DerObjectIdentifier("2.5.4.5"); + + /** + * locality name - StringType(SIZE(1..64)) + */ + public static readonly DerObjectIdentifier L = new DerObjectIdentifier("2.5.4.7"); + + /** + * state, or province name - StringType(SIZE(1..64)) + */ + public static readonly DerObjectIdentifier ST = new DerObjectIdentifier("2.5.4.8"); + + /** + * Naming attributes of type X520name + */ + public static readonly DerObjectIdentifier Surname = new DerObjectIdentifier("2.5.4.4"); + public static readonly DerObjectIdentifier GivenName = new DerObjectIdentifier("2.5.4.42"); + public static readonly DerObjectIdentifier Initials = new DerObjectIdentifier("2.5.4.43"); + public static readonly DerObjectIdentifier Generation = new DerObjectIdentifier("2.5.4.44"); + public static readonly DerObjectIdentifier UniqueIdentifier = new DerObjectIdentifier("2.5.4.45"); + + /** + * businessCategory - DirectoryString(SIZE(1..128) + */ + public static readonly DerObjectIdentifier BusinessCategory = new DerObjectIdentifier( + "2.5.4.15"); + + /** + * postalCode - DirectoryString(SIZE(1..40) + */ + public static readonly DerObjectIdentifier PostalCode = new DerObjectIdentifier( + "2.5.4.17"); + + /** + * dnQualifier - DirectoryString(SIZE(1..64) + */ + public static readonly DerObjectIdentifier DnQualifier = new DerObjectIdentifier( + "2.5.4.46"); + + /** + * RFC 3039 Pseudonym - DirectoryString(SIZE(1..64) + */ + public static readonly DerObjectIdentifier Pseudonym = new DerObjectIdentifier( + "2.5.4.65"); + + /** + * RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z + */ + public static readonly DerObjectIdentifier DateOfBirth = new DerObjectIdentifier( + "1.3.6.1.5.5.7.9.1"); + + /** + * RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128) + */ + public static readonly DerObjectIdentifier PlaceOfBirth = new DerObjectIdentifier( + "1.3.6.1.5.5.7.9.2"); + + /** + * RFC 3039 DateOfBirth - PrintableString (SIZE(1)) -- "M", "F", "m" or "f" + */ + public static readonly DerObjectIdentifier Gender = new DerObjectIdentifier( + "1.3.6.1.5.5.7.9.3"); + + /** + * RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 + * codes only + */ + public static readonly DerObjectIdentifier CountryOfCitizenship = new DerObjectIdentifier( + "1.3.6.1.5.5.7.9.4"); + + /** + * RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 + * codes only + */ + public static readonly DerObjectIdentifier CountryOfResidence = new DerObjectIdentifier( + "1.3.6.1.5.5.7.9.5"); + + /** + * ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64) + */ + public static readonly DerObjectIdentifier NameAtBirth = new DerObjectIdentifier("1.3.36.8.3.14"); + + /** + * RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF + * DirectoryString(SIZE(1..30)) + */ + public static readonly DerObjectIdentifier PostalAddress = new DerObjectIdentifier("2.5.4.16"); + + /** + * RFC 2256 dmdName + */ + public static readonly DerObjectIdentifier DmdName = new DerObjectIdentifier("2.5.4.54"); + + /** + * id-at-telephoneNumber + */ + public static readonly DerObjectIdentifier TelephoneNumber = X509ObjectIdentifiers.id_at_telephoneNumber; + + /** + * id-at-organizationIdentifier + */ + public static readonly DerObjectIdentifier OrganizationIdentifier = X509ObjectIdentifiers.id_at_organizationIdentifier; + + /** + * id-at-name + */ + public static readonly DerObjectIdentifier Name = X509ObjectIdentifiers.id_at_name; + + /** + * Email address (RSA PKCS#9 extension) - IA5String. + *

Note: if you're trying to be ultra orthodox, don't use this! It shouldn't be in here.

+ */ + public static readonly DerObjectIdentifier EmailAddress = PkcsObjectIdentifiers.Pkcs9AtEmailAddress; + + /** + * more from PKCS#9 + */ + public static readonly DerObjectIdentifier UnstructuredName = PkcsObjectIdentifiers.Pkcs9AtUnstructuredName; + public static readonly DerObjectIdentifier UnstructuredAddress = PkcsObjectIdentifiers.Pkcs9AtUnstructuredAddress; + + /** + * email address in Verisign certificates + */ + public static readonly DerObjectIdentifier E = EmailAddress; + + /* + * others... + */ + public static readonly DerObjectIdentifier DC = new DerObjectIdentifier("0.9.2342.19200300.100.1.25"); + + /** + * LDAP User id. + */ + public static readonly DerObjectIdentifier UID = new DerObjectIdentifier("0.9.2342.19200300.100.1.1"); + + /** + * determines whether or not strings should be processed and printed + * from back to front. + */ +// public static bool DefaultReverse = false; + public static bool DefaultReverse + { + get { return defaultReverse[0]; } + set { defaultReverse[0] = value; } + } + + private static readonly bool[] defaultReverse = { false }; + +#if SILVERLIGHT || PORTABLE || NETFX_CORE + /** + * default look up table translating OID values into their common symbols following + * the convention in RFC 2253 with a few extras + */ + public static readonly IDictionary DefaultSymbols = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + /** + * look up table translating OID values into their common symbols following the convention in RFC 2253 + */ + public static readonly IDictionary RFC2253Symbols = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + /** + * look up table translating OID values into their common symbols following the convention in RFC 1779 + * + */ + public static readonly IDictionary RFC1779Symbols = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + /** + * look up table translating common symbols into their OIDS. + */ + public static readonly IDictionary DefaultLookup = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); +#else + /** + * default look up table translating OID values into their common symbols following + * the convention in RFC 2253 with a few extras + */ + public static readonly Hashtable DefaultSymbols = new Hashtable(); + + /** + * look up table translating OID values into their common symbols following the convention in RFC 2253 + */ + public static readonly Hashtable RFC2253Symbols = new Hashtable(); + + /** + * look up table translating OID values into their common symbols following the convention in RFC 1779 + * + */ + public static readonly Hashtable RFC1779Symbols = new Hashtable(); + + /** + * look up table translating common symbols into their OIDS. + */ + public static readonly Hashtable DefaultLookup = new Hashtable(); +#endif + + static X509Name() + { + DefaultSymbols.Add(C, "C"); + DefaultSymbols.Add(O, "O"); + DefaultSymbols.Add(T, "T"); + DefaultSymbols.Add(OU, "OU"); + DefaultSymbols.Add(CN, "CN"); + DefaultSymbols.Add(L, "L"); + DefaultSymbols.Add(ST, "ST"); + DefaultSymbols.Add(SerialNumber, "SERIALNUMBER"); + DefaultSymbols.Add(EmailAddress, "E"); + DefaultSymbols.Add(DC, "DC"); + DefaultSymbols.Add(UID, "UID"); + DefaultSymbols.Add(Street, "STREET"); + DefaultSymbols.Add(Surname, "SURNAME"); + DefaultSymbols.Add(GivenName, "GIVENNAME"); + DefaultSymbols.Add(Initials, "INITIALS"); + DefaultSymbols.Add(Generation, "GENERATION"); + DefaultSymbols.Add(UnstructuredAddress, "unstructuredAddress"); + DefaultSymbols.Add(UnstructuredName, "unstructuredName"); + DefaultSymbols.Add(UniqueIdentifier, "UniqueIdentifier"); + DefaultSymbols.Add(DnQualifier, "DN"); + DefaultSymbols.Add(Pseudonym, "Pseudonym"); + DefaultSymbols.Add(PostalAddress, "PostalAddress"); + DefaultSymbols.Add(NameAtBirth, "NameAtBirth"); + DefaultSymbols.Add(CountryOfCitizenship, "CountryOfCitizenship"); + DefaultSymbols.Add(CountryOfResidence, "CountryOfResidence"); + DefaultSymbols.Add(Gender, "Gender"); + DefaultSymbols.Add(PlaceOfBirth, "PlaceOfBirth"); + DefaultSymbols.Add(DateOfBirth, "DateOfBirth"); + DefaultSymbols.Add(PostalCode, "PostalCode"); + DefaultSymbols.Add(BusinessCategory, "BusinessCategory"); + DefaultSymbols.Add(TelephoneNumber, "TelephoneNumber"); + + RFC2253Symbols.Add(C, "C"); + RFC2253Symbols.Add(O, "O"); + RFC2253Symbols.Add(OU, "OU"); + RFC2253Symbols.Add(CN, "CN"); + RFC2253Symbols.Add(L, "L"); + RFC2253Symbols.Add(ST, "ST"); + RFC2253Symbols.Add(Street, "STREET"); + RFC2253Symbols.Add(DC, "DC"); + RFC2253Symbols.Add(UID, "UID"); + + RFC1779Symbols.Add(C, "C"); + RFC1779Symbols.Add(O, "O"); + RFC1779Symbols.Add(OU, "OU"); + RFC1779Symbols.Add(CN, "CN"); + RFC1779Symbols.Add(L, "L"); + RFC1779Symbols.Add(ST, "ST"); + RFC1779Symbols.Add(Street, "STREET"); + + DefaultLookup.Add("c", C); + DefaultLookup.Add("o", O); + DefaultLookup.Add("t", T); + DefaultLookup.Add("ou", OU); + DefaultLookup.Add("cn", CN); + DefaultLookup.Add("l", L); + DefaultLookup.Add("st", ST); + DefaultLookup.Add("serialnumber", SerialNumber); + DefaultLookup.Add("street", Street); + DefaultLookup.Add("emailaddress", E); + DefaultLookup.Add("dc", DC); + DefaultLookup.Add("e", E); + DefaultLookup.Add("uid", UID); + DefaultLookup.Add("surname", Surname); + DefaultLookup.Add("givenname", GivenName); + DefaultLookup.Add("initials", Initials); + DefaultLookup.Add("generation", Generation); + DefaultLookup.Add("unstructuredaddress", UnstructuredAddress); + DefaultLookup.Add("unstructuredname", UnstructuredName); + DefaultLookup.Add("uniqueidentifier", UniqueIdentifier); + DefaultLookup.Add("dn", DnQualifier); + DefaultLookup.Add("pseudonym", Pseudonym); + DefaultLookup.Add("postaladdress", PostalAddress); + DefaultLookup.Add("nameofbirth", NameAtBirth); + DefaultLookup.Add("countryofcitizenship", CountryOfCitizenship); + DefaultLookup.Add("countryofresidence", CountryOfResidence); + DefaultLookup.Add("gender", Gender); + DefaultLookup.Add("placeofbirth", PlaceOfBirth); + DefaultLookup.Add("dateofbirth", DateOfBirth); + DefaultLookup.Add("postalcode", PostalCode); + DefaultLookup.Add("businesscategory", BusinessCategory); + DefaultLookup.Add("telephonenumber", TelephoneNumber); + } + + private readonly IList ordering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + private readonly X509NameEntryConverter converter; + + private IList values = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + private IList added = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + private Asn1Sequence seq; + + /** + * Return a X509Name based on the passed in tagged object. + * + * @param obj tag object holding name. + * @param explicitly true if explicitly tagged false otherwise. + * @return the X509Name + */ + public static X509Name GetInstance( + Asn1TaggedObject obj, + bool explicitly) + { + return GetInstance(Asn1Sequence.GetInstance(obj, explicitly)); + } + + public static X509Name GetInstance( + object obj) + { + if (obj == null || obj is X509Name) + return (X509Name)obj; + + if (obj != null) + return new X509Name(Asn1Sequence.GetInstance(obj)); + + throw new ArgumentException("null object in factory", "obj"); + } + + protected X509Name() + { + } + + /** + * Constructor from Asn1Sequence + * + * the principal will be a list of constructed sets, each containing an (OID, string) pair. + */ + protected X509Name( + Asn1Sequence seq) + { + this.seq = seq; + + foreach (Asn1Encodable asn1Obj in seq) + { + Asn1Set asn1Set = Asn1Set.GetInstance(asn1Obj.ToAsn1Object()); + + for (int i = 0; i < asn1Set.Count; i++) + { + Asn1Sequence s = Asn1Sequence.GetInstance(asn1Set[i].ToAsn1Object()); + + if (s.Count != 2) + throw new ArgumentException("badly sized pair"); + + ordering.Add(DerObjectIdentifier.GetInstance(s[0].ToAsn1Object())); + + Asn1Object derValue = s[1].ToAsn1Object(); + if (derValue is IAsn1String && !(derValue is DerUniversalString)) + { + string v = ((IAsn1String)derValue).GetString(); + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(v, "#")) + { + v = "\\" + v; + } + + values.Add(v); + } + else + { + values.Add("#" + Hex.ToHexString(derValue.GetEncoded())); + } + + added.Add(i != 0); + } + } + } + + /** + * Constructor from a table of attributes with ordering. + *

+ * it's is assumed the table contains OID/string pairs, and the contents + * of the table are copied into an internal table as part of the + * construction process. The ordering ArrayList should contain the OIDs + * in the order they are meant to be encoded or printed in ToString.

+ */ + public X509Name( + IList ordering, + IDictionary attributes) + : this(ordering, attributes, new X509DefaultEntryConverter()) + { + } + + /** + * Constructor from a table of attributes with ordering. + *

+ * it's is assumed the table contains OID/string pairs, and the contents + * of the table are copied into an internal table as part of the + * construction process. The ordering ArrayList should contain the OIDs + * in the order they are meant to be encoded or printed in ToString.

+ *

+ * The passed in converter will be used to convert the strings into their + * ASN.1 counterparts.

+ */ + public X509Name( + IList ordering, + IDictionary attributes, + X509NameEntryConverter converter) + { + this.converter = converter; + + foreach (DerObjectIdentifier oid in ordering) + { + object attribute = attributes[oid]; + if (attribute == null) + { + throw new ArgumentException("No attribute for object id - " + oid + " - passed to distinguished name"); + } + + this.ordering.Add(oid); + this.added.Add(false); + this.values.Add(attribute); // copy the hash table + } + } + + /** + * Takes two vectors one of the oids and the other of the values. + */ + public X509Name( + IList oids, + IList values) + : this(oids, values, new X509DefaultEntryConverter()) + { + } + + /** + * Takes two vectors one of the oids and the other of the values. + *

+ * The passed in converter will be used to convert the strings into their + * ASN.1 counterparts.

+ */ + public X509Name( + IList oids, + IList values, + X509NameEntryConverter converter) + { + this.converter = converter; + + if (oids.Count != values.Count) + { + throw new ArgumentException("'oids' must be same length as 'values'."); + } + + for (int i = 0; i < oids.Count; i++) + { + this.ordering.Add(oids[i]); + this.values.Add(values[i]); + this.added.Add(false); + } + } + + /** + * Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + * some such, converting it into an ordered set of name attributes. + */ + public X509Name( + string dirName) + : this(DefaultReverse, (IDictionary)DefaultLookup, dirName) + { + } + + /** + * Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + * some such, converting it into an ordered set of name attributes with each + * string value being converted to its associated ASN.1 type using the passed + * in converter. + */ + public X509Name( + string dirName, + X509NameEntryConverter converter) + : this(DefaultReverse, DefaultLookup, dirName, converter) + { + } + + /** + * Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + * some such, converting it into an ordered set of name attributes. If reverse + * is true, create the encoded version of the sequence starting from the + * last element in the string. + */ + public X509Name( + bool reverse, + string dirName) + : this(reverse, (IDictionary)DefaultLookup, dirName) + { + } + + /** + * Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + * some such, converting it into an ordered set of name attributes with each + * string value being converted to its associated ASN.1 type using the passed + * in converter. If reverse is true the ASN.1 sequence representing the DN will + * be built by starting at the end of the string, rather than the start. + */ + public X509Name( + bool reverse, + string dirName, + X509NameEntryConverter converter) + : this(reverse, DefaultLookup, dirName, converter) + { + } + + /** + * Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + * some such, converting it into an ordered set of name attributes. lookUp + * should provide a table of lookups, indexed by lowercase only strings and + * yielding a DerObjectIdentifier, other than that OID. and numeric oids + * will be processed automatically. + *
+ * If reverse is true, create the encoded version of the sequence + * starting from the last element in the string. + * @param reverse true if we should start scanning from the end (RFC 2553). + * @param lookUp table of names and their oids. + * @param dirName the X.500 string to be parsed. + */ + public X509Name( + bool reverse, + IDictionary lookUp, + string dirName) + : this(reverse, lookUp, dirName, new X509DefaultEntryConverter()) + { + } + + private DerObjectIdentifier DecodeOid( + string name, + IDictionary lookUp) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name), "OID.")) + { + return new DerObjectIdentifier(name.Substring(4)); + } + else if (name[0] >= '0' && name[0] <= '9') + { + return new DerObjectIdentifier(name); + } + + DerObjectIdentifier oid = (DerObjectIdentifier)lookUp[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToLowerInvariant(name)]; + if (oid == null) + { + throw new ArgumentException("Unknown object id - " + name + " - passed to distinguished name"); + } + + return oid; + } + + /** + * Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or + * some such, converting it into an ordered set of name attributes. lookUp + * should provide a table of lookups, indexed by lowercase only strings and + * yielding a DerObjectIdentifier, other than that OID. and numeric oids + * will be processed automatically. The passed in converter is used to convert the + * string values to the right of each equals sign to their ASN.1 counterparts. + *
+ * @param reverse true if we should start scanning from the end, false otherwise. + * @param lookUp table of names and oids. + * @param dirName the string dirName + * @param converter the converter to convert string values into their ASN.1 equivalents + */ + public X509Name( + bool reverse, + IDictionary lookUp, + string dirName, + X509NameEntryConverter converter) + { + this.converter = converter; + X509NameTokenizer nTok = new X509NameTokenizer(dirName); + + while (nTok.HasMoreTokens()) + { + string token = nTok.NextToken(); + int index = token.IndexOf('='); + + if (index == -1) + { + throw new ArgumentException("badly formated directory string"); + } + + string name = token.Substring(0, index); + string value = token.Substring(index + 1); + DerObjectIdentifier oid = DecodeOid(name, lookUp); + + if (value.IndexOf('+') > 0) + { + X509NameTokenizer vTok = new X509NameTokenizer(value, '+'); + string v = vTok.NextToken(); + + this.ordering.Add(oid); + this.values.Add(v); + this.added.Add(false); + + while (vTok.HasMoreTokens()) + { + string sv = vTok.NextToken(); + int ndx = sv.IndexOf('='); + + string nm = sv.Substring(0, ndx); + string vl = sv.Substring(ndx + 1); + this.ordering.Add(DecodeOid(nm, lookUp)); + this.values.Add(vl); + this.added.Add(true); + } + } + else + { + this.ordering.Add(oid); + this.values.Add(value); + this.added.Add(false); + } + } + + if (reverse) + { +// this.ordering.Reverse(); +// this.values.Reverse(); +// this.added.Reverse(); + IList o = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + IList v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + IList a = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + int count = 1; + + for (int i = 0; i < this.ordering.Count; i++) + { + if (!((bool) this.added[i])) + { + count = 0; + } + + int index = count++; + + o.Insert(index, this.ordering[i]); + v.Insert(index, this.values[i]); + a.Insert(index, this.added[i]); + } + + this.ordering = o; + this.values = v; + this.added = a; + } + } + + /** + * return an IList of the oids in the name, in the order they were found. + */ + public IList GetOidList() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(ordering); + } + + /** + * return an IList of the values found in the name, in the order they + * were found. + */ + public IList GetValueList() + { + return GetValueList(null); + } + + /** + * return an IList of the values found in the name, in the order they + * were found, with the DN label corresponding to passed in oid. + */ + public IList GetValueList(DerObjectIdentifier oid) + { + IList v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + for (int i = 0; i != values.Count; i++) + { + if (null == oid || oid.Equals(ordering[i])) + { + string val = (string)values[i]; + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(val, "\\#")) + { + val = val.Substring(1); + } + + v.Add(val); + } + } + return v; + } + + public override Asn1Object ToAsn1Object() + { + if (seq == null) + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + Asn1EncodableVector sVec = new Asn1EncodableVector(); + DerObjectIdentifier lstOid = null; + + for (int i = 0; i != ordering.Count; i++) + { + DerObjectIdentifier oid = (DerObjectIdentifier)ordering[i]; + string str = (string)values[i]; + + if (lstOid == null + || ((bool)this.added[i])) + { + } + else + { + vec.Add(new DerSet(sVec)); + sVec = new Asn1EncodableVector(); + } + + sVec.Add( + new DerSequence( + oid, + converter.GetConvertedValue(oid, str))); + + lstOid = oid; + } + + vec.Add(new DerSet(sVec)); + + seq = new DerSequence(vec); + } + + return seq; + } + + /// The X509Name object to test equivalency against. + /// If true, the order of elements must be the same, + /// as well as the values associated with each element. + public bool Equivalent( + X509Name other, + bool inOrder) + { + if (!inOrder) + return this.Equivalent(other); + + if (other == null) + return false; + + if (other == this) + return true; + + int orderingSize = ordering.Count; + + if (orderingSize != other.ordering.Count) + return false; + + for (int i = 0; i < orderingSize; i++) + { + DerObjectIdentifier oid = (DerObjectIdentifier) ordering[i]; + DerObjectIdentifier oOid = (DerObjectIdentifier) other.ordering[i]; + + if (!oid.Equals(oOid)) + return false; + + string val = (string) values[i]; + string oVal = (string) other.values[i]; + + if (!equivalentStrings(val, oVal)) + return false; + } + + return true; + } + + /** + * test for equivalence - note: case is ignored. + */ + public bool Equivalent( + X509Name other) + { + if (other == null) + return false; + + if (other == this) + return true; + + int orderingSize = ordering.Count; + + if (orderingSize != other.ordering.Count) + { + return false; + } + + bool[] indexes = new bool[orderingSize]; + int start, end, delta; + + if (ordering[0].Equals(other.ordering[0])) // guess forward + { + start = 0; + end = orderingSize; + delta = 1; + } + else // guess reversed - most common problem + { + start = orderingSize - 1; + end = -1; + delta = -1; + } + + for (int i = start; i != end; i += delta) + { + bool found = false; + DerObjectIdentifier oid = (DerObjectIdentifier)ordering[i]; + string value = (string)values[i]; + + for (int j = 0; j < orderingSize; j++) + { + if (indexes[j]) + { + continue; + } + + DerObjectIdentifier oOid = (DerObjectIdentifier)other.ordering[j]; + + if (oid.Equals(oOid)) + { + string oValue = (string)other.values[j]; + + if (equivalentStrings(value, oValue)) + { + indexes[j] = true; + found = true; + break; + } + } + } + + if (!found) + { + return false; + } + } + + return true; + } + + private static bool equivalentStrings( + string s1, + string s2) + { + string v1 = canonicalize(s1); + string v2 = canonicalize(s2); + + if (!v1.Equals(v2)) + { + v1 = stripInternalSpaces(v1); + v2 = stripInternalSpaces(v2); + + if (!v1.Equals(v2)) + { + return false; + } + } + + return true; + } + + private static string canonicalize( + string s) + { + string v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToLowerInvariant(s).Trim(); + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(v, "#")) + { + Asn1Object obj = decodeObject(v); + + if (obj is IAsn1String) + { + v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToLowerInvariant(((IAsn1String)obj).GetString()).Trim(); + } + } + + return v; + } + + private static Asn1Object decodeObject( + string v) + { + try + { + return Asn1Object.FromByteArray(Hex.Decode(v.Substring(1))); + } + catch (IOException e) + { + throw new InvalidOperationException("unknown encoding in name: " + e.Message, e); + } + } + + private static string stripInternalSpaces( + string str) + { + StringBuilder res = new StringBuilder(); + + if (str.Length != 0) + { + char c1 = str[0]; + + res.Append(c1); + + for (int k = 1; k < str.Length; k++) + { + char c2 = str[k]; + if (!(c1 == ' ' && c2 == ' ')) + { + res.Append(c2); + } + c1 = c2; + } + } + + return res.ToString(); + } + + private void AppendValue( + StringBuilder buf, + IDictionary oidSymbols, + DerObjectIdentifier oid, + string val) + { + string sym = (string)oidSymbols[oid]; + + if (sym != null) + { + buf.Append(sym); + } + else + { + buf.Append(oid.Id); + } + + buf.Append('='); + + int index = buf.Length; + + buf.Append(val); + + int end = buf.Length; + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(val, "\\#")) + { + index += 2; + } + + while (index != end) + { + if ((buf[index] == ',') + || (buf[index] == '"') + || (buf[index] == '\\') + || (buf[index] == '+') + || (buf[index] == '=') + || (buf[index] == '<') + || (buf[index] == '>') + || (buf[index] == ';')) + { + buf.Insert(index++, "\\"); + end++; + } + + index++; + } + } + + /** + * convert the structure to a string - if reverse is true the + * oids and values are listed out starting with the last element + * in the sequence (ala RFC 2253), otherwise the string will begin + * with the first element of the structure. If no string definition + * for the oid is found in oidSymbols the string value of the oid is + * added. Two standard symbol tables are provided DefaultSymbols, and + * RFC2253Symbols as part of this class. + * + * @param reverse if true start at the end of the sequence and work back. + * @param oidSymbols look up table strings for oids. + */ + public string ToString( + bool reverse, + IDictionary oidSymbols) + { +#if SILVERLIGHT || PORTABLE || NETFX_CORE + List components = new List(); +#else + ArrayList components = new ArrayList(); +#endif + + StringBuilder ava = null; + + for (int i = 0; i < ordering.Count; i++) + { + if ((bool) added[i]) + { + ava.Append('+'); + AppendValue(ava, oidSymbols, + (DerObjectIdentifier)ordering[i], + (string)values[i]); + } + else + { + ava = new StringBuilder(); + AppendValue(ava, oidSymbols, + (DerObjectIdentifier)ordering[i], + (string)values[i]); + components.Add(ava); + } + } + + if (reverse) + { + components.Reverse(); + } + + StringBuilder buf = new StringBuilder(); + + if (components.Count > 0) + { + buf.Append(components[0].ToString()); + + for (int i = 1; i < components.Count; ++i) + { + buf.Append(','); + buf.Append(components[i].ToString()); + } + } + + return buf.ToString(); + } + + public override string ToString() + { + return ToString(DefaultReverse, (IDictionary)DefaultSymbols); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Name.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Name.cs.meta new file mode 100644 index 00000000..e65200e0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509Name.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c09a00533763e16488d5e052d2be7956 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameEntryConverter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameEntryConverter.cs new file mode 100644 index 00000000..343240b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameEntryConverter.cs @@ -0,0 +1,93 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Globalization; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * It turns out that the number of standard ways the fields in a DN should be + * encoded into their ASN.1 counterparts is rapidly approaching the + * number of machines on the internet. By default the X509Name class + * will produce UTF8Strings in line with the current recommendations (RFC 3280). + *

+ * An example of an encoder look like below: + *

+     * public class X509DirEntryConverter
+     *     : X509NameEntryConverter
+     * {
+     *     public Asn1Object GetConvertedValue(
+     *         DerObjectIdentifier  oid,
+     *         string               value)
+     *     {
+     *         if (str.Length() != 0 && str.charAt(0) == '#')
+     *         {
+     *             return ConvertHexEncoded(str, 1);
+     *         }
+     *         if (oid.Equals(EmailAddress))
+     *         {
+     *             return new DerIA5String(str);
+     *         }
+     *         else if (CanBePrintable(str))
+     *         {
+     *             return new DerPrintableString(str);
+     *         }
+     *         else if (CanBeUTF8(str))
+     *         {
+     *             return new DerUtf8String(str);
+     *         }
+     *         else
+     *         {
+     *             return new DerBmpString(str);
+     *         }
+     *     }
+     * }
+	 * 
+ *

+ */ + public abstract class X509NameEntryConverter + { + /** + * Convert an inline encoded hex string rendition of an ASN.1 + * object back into its corresponding ASN.1 object. + * + * @param str the hex encoded object + * @param off the index at which the encoding starts + * @return the decoded object + */ + protected Asn1Object ConvertHexEncoded( + string hexString, + int offset) + { + string str = hexString.Substring(offset); + + return Asn1Object.FromByteArray(Hex.Decode(str)); + } + + /** + * return true if the passed in string can be represented without + * loss as a PrintableString, false otherwise. + */ + protected bool CanBePrintable( + string str) + { + return DerPrintableString.IsPrintableString(str); + } + + /** + * Convert the passed in string value into the appropriate ASN.1 + * encoded object. + * + * @param oid the oid associated with the value in the DN. + * @param value the value of the particular DN component. + * @return the ASN.1 equivalent for the value. + */ + public abstract Asn1Object GetConvertedValue(DerObjectIdentifier oid, string value); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameEntryConverter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameEntryConverter.cs.meta new file mode 100644 index 00000000..5973d2a3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameEntryConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aa46b029d85419b43a5a45f6463a31d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameTokenizer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameTokenizer.cs new file mode 100644 index 00000000..14845cc2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameTokenizer.cs @@ -0,0 +1,108 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + /** + * class for breaking up an X500 Name into it's component tokens, ala + * java.util.StringTokenizer. We need this class as some of the + * lightweight Java environment don't support classes like + * StringTokenizer. + */ + public class X509NameTokenizer + { + private string value; + private int index; + private char separator; + private StringBuilder buffer = new StringBuilder(); + + public X509NameTokenizer( + string oid) + : this(oid, ',') + { + } + + public X509NameTokenizer( + string oid, + char separator) + { + this.value = oid; + this.index = -1; + this.separator = separator; + } + + public bool HasMoreTokens() + { + return index != value.Length; + } + + public string NextToken() + { + if (index == value.Length) + { + return null; + } + + int end = index + 1; + bool quoted = false; + bool escaped = false; + + buffer.Remove(0, buffer.Length); + + while (end != value.Length) + { + char c = value[end]; + + if (c == '"') + { + if (!escaped) + { + quoted = !quoted; + } + else + { + buffer.Append(c); + escaped = false; + } + } + else + { + if (escaped || quoted) + { + if (c == '#' && buffer[buffer.Length - 1] == '=') + { + buffer.Append('\\'); + } + else if (c == '+' && separator != '+') + { + buffer.Append('\\'); + } + buffer.Append(c); + escaped = false; + } + else if (c == '\\') + { + escaped = true; + } + else if (c == separator) + { + break; + } + else + { + buffer.Append(c); + } + } + + end++; + } + + index = end; + + return buffer.ToString().Trim(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameTokenizer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameTokenizer.cs.meta new file mode 100644 index 00000000..bead510e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509NameTokenizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8316e96f8ca1af14783eb899e5e15cbd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ObjectIdentifiers.cs new file mode 100644 index 00000000..fa087f0b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ObjectIdentifiers.cs @@ -0,0 +1,65 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509 +{ + public abstract class X509ObjectIdentifiers + { + // + // base id + // + internal const string ID = "2.5.4"; + + public static readonly DerObjectIdentifier CommonName = new DerObjectIdentifier(ID + ".3"); + public static readonly DerObjectIdentifier CountryName = new DerObjectIdentifier(ID + ".6"); + public static readonly DerObjectIdentifier LocalityName = new DerObjectIdentifier(ID + ".7"); + public static readonly DerObjectIdentifier StateOrProvinceName = new DerObjectIdentifier(ID + ".8"); + public static readonly DerObjectIdentifier Organization = new DerObjectIdentifier(ID + ".10"); + public static readonly DerObjectIdentifier OrganizationalUnitName = new DerObjectIdentifier(ID + ".11"); + + public static readonly DerObjectIdentifier id_at_telephoneNumber = new DerObjectIdentifier(ID + ".20"); + public static readonly DerObjectIdentifier id_at_name = new DerObjectIdentifier(ID + ".41"); + + public static readonly DerObjectIdentifier id_at_organizationIdentifier = new DerObjectIdentifier("2.5.4.97"); + + // id-SHA1 OBJECT IDENTIFIER ::= + // {iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 26 } // + public static readonly DerObjectIdentifier IdSha1 = new DerObjectIdentifier("1.3.14.3.2.26"); + + // + // ripemd160 OBJECT IDENTIFIER ::= + // {iso(1) identified-organization(3) TeleTrust(36) algorithm(3) hashAlgorithm(2) RipeMD-160(1)} + // + public static readonly DerObjectIdentifier RipeMD160 = new DerObjectIdentifier("1.3.36.3.2.1"); + + // + // ripemd160WithRSAEncryption OBJECT IDENTIFIER ::= + // {iso(1) identified-organization(3) TeleTrust(36) algorithm(3) signatureAlgorithm(3) rsaSignature(1) rsaSignatureWithripemd160(2) } + // + public static readonly DerObjectIdentifier RipeMD160WithRsaEncryption = new DerObjectIdentifier("1.3.36.3.3.1.2"); + + public static readonly DerObjectIdentifier IdEARsa = new DerObjectIdentifier("2.5.8.1.1"); + + // id-pkix + public static readonly DerObjectIdentifier IdPkix = new DerObjectIdentifier("1.3.6.1.5.5.7"); + + // + // private internet extensions + // + public static readonly DerObjectIdentifier IdPE = new DerObjectIdentifier(IdPkix + ".1"); + + // + // authority information access + // + public static readonly DerObjectIdentifier IdAD = new DerObjectIdentifier(IdPkix + ".48"); + public static readonly DerObjectIdentifier IdADCAIssuers = new DerObjectIdentifier(IdAD + ".2"); + public static readonly DerObjectIdentifier IdADOcsp = new DerObjectIdentifier(IdAD + ".1"); + + // + // OID for ocsp and crl uri in AuthorityInformationAccess extension + // + public static readonly DerObjectIdentifier OcspAccessMethod = IdADOcsp; + public static readonly DerObjectIdentifier CrlAccessMethod = IdADCAIssuers; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ObjectIdentifiers.cs.meta new file mode 100644 index 00000000..1a870b40 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/X509ObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 87dba2439330ae349ae823c87363e667 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified.meta new file mode 100644 index 00000000..bb32d8b1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 68fd4e2cc85f3ec41b06a3e300f2e110 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/BiometricData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/BiometricData.cs new file mode 100644 index 00000000..257a485e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/BiometricData.cs @@ -0,0 +1,114 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified +{ + /** + * The BiometricData object. + *
+    * BiometricData  ::=  SEQUENCE {
+    *       typeOfBiometricData  TypeOfBiometricData,
+    *       hashAlgorithm        AlgorithmIdentifier,
+    *       biometricDataHash    OCTET STRING,
+    *       sourceDataUri        IA5String OPTIONAL  }
+    * 
+ */ + public class BiometricData + : Asn1Encodable + { + private readonly TypeOfBiometricData typeOfBiometricData; + private readonly AlgorithmIdentifier hashAlgorithm; + private readonly Asn1OctetString biometricDataHash; + private readonly DerIA5String sourceDataUri; + + public static BiometricData GetInstance( + object obj) + { + if (obj == null || obj is BiometricData) + { + return (BiometricData)obj; + } + + if (obj is Asn1Sequence) + { + return new BiometricData(Asn1Sequence.GetInstance(obj)); + } + + throw new ArgumentException("unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private BiometricData( + Asn1Sequence seq) + { + typeOfBiometricData = TypeOfBiometricData.GetInstance(seq[0]); + hashAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]); + biometricDataHash = Asn1OctetString.GetInstance(seq[2]); + + if (seq.Count > 3) + { + sourceDataUri = DerIA5String.GetInstance(seq[3]); + } + } + + public BiometricData( + TypeOfBiometricData typeOfBiometricData, + AlgorithmIdentifier hashAlgorithm, + Asn1OctetString biometricDataHash, + DerIA5String sourceDataUri) + { + this.typeOfBiometricData = typeOfBiometricData; + this.hashAlgorithm = hashAlgorithm; + this.biometricDataHash = biometricDataHash; + this.sourceDataUri = sourceDataUri; + } + + public BiometricData( + TypeOfBiometricData typeOfBiometricData, + AlgorithmIdentifier hashAlgorithm, + Asn1OctetString biometricDataHash) + { + this.typeOfBiometricData = typeOfBiometricData; + this.hashAlgorithm = hashAlgorithm; + this.biometricDataHash = biometricDataHash; + this.sourceDataUri = null; + } + + public TypeOfBiometricData TypeOfBiometricData + { + get { return typeOfBiometricData; } + } + + public AlgorithmIdentifier HashAlgorithm + { + get { return hashAlgorithm; } + } + + public Asn1OctetString BiometricDataHash + { + get { return biometricDataHash; } + } + + public DerIA5String SourceDataUri + { + get { return sourceDataUri; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector seq = new Asn1EncodableVector( + typeOfBiometricData, hashAlgorithm, biometricDataHash); + + if (sourceDataUri != null) + { + seq.Add(sourceDataUri); + } + + return new DerSequence(seq); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/BiometricData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/BiometricData.cs.meta new file mode 100644 index 00000000..af9e4954 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/BiometricData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 721e9c5bde578064b8496eba5663908c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/ETSIQCObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/ETSIQCObjectIdentifiers.cs new file mode 100644 index 00000000..ae540d97 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/ETSIQCObjectIdentifiers.cs @@ -0,0 +1,23 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified +{ + public abstract class EtsiQCObjectIdentifiers + { + // + // base id + // + public static readonly DerObjectIdentifier IdEtsiQcs = new DerObjectIdentifier("0.4.0.1862.1"); + + public static readonly DerObjectIdentifier IdEtsiQcsQcCompliance = new DerObjectIdentifier(IdEtsiQcs+".1"); + public static readonly DerObjectIdentifier IdEtsiQcsLimitValue = new DerObjectIdentifier(IdEtsiQcs+".2"); + public static readonly DerObjectIdentifier IdEtsiQcsRetentionPeriod = new DerObjectIdentifier(IdEtsiQcs+".3"); + public static readonly DerObjectIdentifier IdEtsiQcsQcSscd = new DerObjectIdentifier(IdEtsiQcs+".4"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/ETSIQCObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/ETSIQCObjectIdentifiers.cs.meta new file mode 100644 index 00000000..1b7a19e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/ETSIQCObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 45890795e82fa12498d9300923cf47e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/Iso4217CurrencyCode.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/Iso4217CurrencyCode.cs new file mode 100644 index 00000000..3e389bb0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/Iso4217CurrencyCode.cs @@ -0,0 +1,88 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified +{ + /** + * The Iso4217CurrencyCode object. + *
+    * Iso4217CurrencyCode  ::=  CHOICE {
+    *       alphabetic              PrintableString (SIZE 3), --Recommended
+    *       numeric              INTEGER (1..999) }
+    * -- Alphabetic or numeric currency code as defined in ISO 4217
+    * -- It is recommended that the Alphabetic form is used
+    * 
+ */ + public class Iso4217CurrencyCode + : Asn1Encodable, IAsn1Choice + { + internal const int AlphabeticMaxSize = 3; + internal const int NumericMinSize = 1; + internal const int NumericMaxSize = 999; + + internal Asn1Encodable obj; +// internal int numeric; + + public static Iso4217CurrencyCode GetInstance( + object obj) + { + if (obj == null || obj is Iso4217CurrencyCode) + { + return (Iso4217CurrencyCode) obj; + } + + if (obj is DerInteger) + { + DerInteger numericobj = DerInteger.GetInstance(obj); + int numeric = numericobj.Value.IntValue; + return new Iso4217CurrencyCode(numeric); + } + + if (obj is DerPrintableString) + { + DerPrintableString alphabetic = DerPrintableString.GetInstance(obj); + return new Iso4217CurrencyCode(alphabetic.GetString()); + } + + throw new ArgumentException("unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public Iso4217CurrencyCode( + int numeric) + { + if (numeric > NumericMaxSize || numeric < NumericMinSize) + { + throw new ArgumentException("wrong size in numeric code : not in (" + NumericMinSize + ".." + NumericMaxSize + ")"); + } + + obj = new DerInteger(numeric); + } + + public Iso4217CurrencyCode( + string alphabetic) + { + if (alphabetic.Length > AlphabeticMaxSize) + { + throw new ArgumentException("wrong size in alphabetic code : max size is " + AlphabeticMaxSize); + } + + obj = new DerPrintableString(alphabetic); + } + + public bool IsAlphabetic { get { return obj is DerPrintableString; } } + + public string Alphabetic { get { return ((DerPrintableString) obj).GetString(); } } + + public int Numeric { get { return ((DerInteger)obj).Value.IntValue; } } + + public override Asn1Object ToAsn1Object() + { + return obj.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/Iso4217CurrencyCode.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/Iso4217CurrencyCode.cs.meta new file mode 100644 index 00000000..6f654ebe --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/Iso4217CurrencyCode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c7ad8cb705970a4409c018bb003ee423 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/MonetaryValue.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/MonetaryValue.cs new file mode 100644 index 00000000..9ce3b118 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/MonetaryValue.cs @@ -0,0 +1,87 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified +{ + /** + * The MonetaryValue object. + *
+    * MonetaryValue  ::=  SEQUENCE {
+    *       currency              Iso4217CurrencyCode,
+    *       amount               INTEGER,
+    *       exponent             INTEGER }
+    * -- value = amount * 10^exponent
+    * 
+ */ + public class MonetaryValue + : Asn1Encodable + { + internal Iso4217CurrencyCode currency; + internal DerInteger amount; + internal DerInteger exponent; + + public static MonetaryValue GetInstance( + object obj) + { + if (obj == null || obj is MonetaryValue) + { + return (MonetaryValue) obj; + } + + if (obj is Asn1Sequence) + { + return new MonetaryValue(Asn1Sequence.GetInstance(obj)); + } + + throw new ArgumentException("unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private MonetaryValue( + Asn1Sequence seq) + { + if (seq.Count != 3) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + currency = Iso4217CurrencyCode.GetInstance(seq[0]); + amount = DerInteger.GetInstance(seq[1]); + exponent = DerInteger.GetInstance(seq[2]); + } + + public MonetaryValue( + Iso4217CurrencyCode currency, + int amount, + int exponent) + { + this.currency = currency; + this.amount = new DerInteger(amount); + this.exponent = new DerInteger(exponent); + } + + public Iso4217CurrencyCode Currency + { + get { return currency; } + } + + public BigInteger Amount + { + get { return amount.Value; } + } + + public BigInteger Exponent + { + get { return exponent.Value; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(currency, amount, exponent); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/MonetaryValue.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/MonetaryValue.cs.meta new file mode 100644 index 00000000..77c679d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/MonetaryValue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 572832cf90fe82e428395e90960b2d1a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/QCStatement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/QCStatement.cs new file mode 100644 index 00000000..785c2f8e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/QCStatement.cs @@ -0,0 +1,88 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified +{ + /** + * The QCStatement object. + *
+    * QCStatement ::= SEQUENCE {
+    *   statementId        OBJECT IDENTIFIER,
+    *   statementInfo      ANY DEFINED BY statementId OPTIONAL}
+    * 
+ */ + public class QCStatement + : Asn1Encodable + { + private readonly DerObjectIdentifier qcStatementId; + private readonly Asn1Encodable qcStatementInfo; + + public static QCStatement GetInstance( + object obj) + { + if (obj == null || obj is QCStatement) + { + return (QCStatement) obj; + } + + if (obj is Asn1Sequence) + { + return new QCStatement(Asn1Sequence.GetInstance(obj)); + } + + throw new ArgumentException("unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + private QCStatement( + Asn1Sequence seq) + { + qcStatementId = DerObjectIdentifier.GetInstance(seq[0]); + + if (seq.Count > 1) + { + qcStatementInfo = seq[1]; + } + } + + public QCStatement( + DerObjectIdentifier qcStatementId) + { + this.qcStatementId = qcStatementId; + } + + public QCStatement( + DerObjectIdentifier qcStatementId, + Asn1Encodable qcStatementInfo) + { + this.qcStatementId = qcStatementId; + this.qcStatementInfo = qcStatementInfo; + } + + public DerObjectIdentifier StatementId + { + get { return qcStatementId; } + } + + public Asn1Encodable StatementInfo + { + get { return qcStatementInfo; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector seq = new Asn1EncodableVector(qcStatementId); + + if (qcStatementInfo != null) + { + seq.Add(qcStatementInfo); + } + + return new DerSequence(seq); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/QCStatement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/QCStatement.cs.meta new file mode 100644 index 00000000..c6e3d67d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/QCStatement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4aceafd3bd955db4e81caf7ea1fb66ef +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/RFC3739QCObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/RFC3739QCObjectIdentifiers.cs new file mode 100644 index 00000000..8f8b1714 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/RFC3739QCObjectIdentifiers.cs @@ -0,0 +1,25 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified +{ + public sealed class Rfc3739QCObjectIdentifiers + { + private Rfc3739QCObjectIdentifiers() + { + } + + // + // base id + // + public static readonly DerObjectIdentifier IdQcs = new DerObjectIdentifier("1.3.6.1.5.5.7.11"); + + public static readonly DerObjectIdentifier IdQcsPkixQCSyntaxV1 = new DerObjectIdentifier(IdQcs+".1"); + public static readonly DerObjectIdentifier IdQcsPkixQCSyntaxV2 = new DerObjectIdentifier(IdQcs+".2"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/RFC3739QCObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/RFC3739QCObjectIdentifiers.cs.meta new file mode 100644 index 00000000..df86364b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/RFC3739QCObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b81cf09f566e2fa4796ceaff9334bdf9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/SemanticsInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/SemanticsInformation.cs new file mode 100644 index 00000000..06389011 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/SemanticsInformation.cs @@ -0,0 +1,128 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified +{ + /** + * The SemanticsInformation object. + *
+    *       SemanticsInformation ::= SEQUENCE {
+    *         semanticsIdentifier        OBJECT IDENTIFIER   OPTIONAL,
+    *         nameRegistrationAuthorities NameRegistrationAuthorities
+    *                                                         OPTIONAL }
+    *         (WITH COMPONENTS {..., semanticsIdentifier PRESENT}|
+    *          WITH COMPONENTS {..., nameRegistrationAuthorities PRESENT})
+    *
+    *     NameRegistrationAuthorities ::=  SEQUENCE SIZE (1..MAX) OF
+    *         GeneralName
+    * 
+ */ + public class SemanticsInformation + : Asn1Encodable + { + private readonly DerObjectIdentifier semanticsIdentifier; + private readonly GeneralName[] nameRegistrationAuthorities; + + public static SemanticsInformation GetInstance( + object obj) + { + if (obj == null || obj is SemanticsInformation) + { + return (SemanticsInformation) obj; + } + + if (obj is Asn1Sequence) + { + return new SemanticsInformation(Asn1Sequence.GetInstance(obj)); + } + + throw new ArgumentException("unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public SemanticsInformation( + Asn1Sequence seq) + { + if (seq.Count < 1) + { + throw new ArgumentException("no objects in SemanticsInformation"); + } + + IEnumerator e = seq.GetEnumerator(); + e.MoveNext(); + object obj = e.Current; + if (obj is DerObjectIdentifier) + { + semanticsIdentifier = DerObjectIdentifier.GetInstance(obj); + if (e.MoveNext()) + { + obj = e.Current; + } + else + { + obj = null; + } + } + + if (obj != null) + { + Asn1Sequence generalNameSeq = Asn1Sequence.GetInstance(obj ); + nameRegistrationAuthorities = new GeneralName[generalNameSeq.Count]; + for (int i= 0; i < generalNameSeq.Count; i++) + { + nameRegistrationAuthorities[i] = GeneralName.GetInstance(generalNameSeq[i]); + } + } + } + + public SemanticsInformation( + DerObjectIdentifier semanticsIdentifier, + GeneralName[] generalNames) + { + this.semanticsIdentifier = semanticsIdentifier; + this.nameRegistrationAuthorities = generalNames; + } + + public SemanticsInformation( + DerObjectIdentifier semanticsIdentifier) + { + this.semanticsIdentifier = semanticsIdentifier; + } + + public SemanticsInformation( + GeneralName[] generalNames) + { + this.nameRegistrationAuthorities = generalNames; + } + + public DerObjectIdentifier SemanticsIdentifier { get { return semanticsIdentifier; } } + + public GeneralName[] GetNameRegistrationAuthorities() + { + return nameRegistrationAuthorities; + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector seq = new Asn1EncodableVector(); + + if (this.semanticsIdentifier != null) + { + seq.Add(semanticsIdentifier); + } + + if (this.nameRegistrationAuthorities != null) + { + seq.Add(new DerSequence(nameRegistrationAuthorities)); + } + + return new DerSequence(seq); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/SemanticsInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/SemanticsInformation.cs.meta new file mode 100644 index 00000000..139e93f3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/SemanticsInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 77db5a18fcace884c8d9922282917667 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/TypeOfBiometricData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/TypeOfBiometricData.cs new file mode 100644 index 00000000..74be50bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/TypeOfBiometricData.cs @@ -0,0 +1,95 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.Qualified +{ + /** + * The TypeOfBiometricData object. + *
+    * TypeOfBiometricData ::= CHOICE {
+    *   predefinedBiometricType   PredefinedBiometricType,
+    *   biometricDataOid          OBJECT IDENTIFIER }
+    *
+    * PredefinedBiometricType ::= INTEGER {
+    *   picture(0),handwritten-signature(1)}
+    *   (picture|handwritten-signature)
+    * 
+ */ + public class TypeOfBiometricData + : Asn1Encodable, IAsn1Choice + { + public const int Picture = 0; + public const int HandwrittenSignature = 1; + + internal Asn1Encodable obj; + + public static TypeOfBiometricData GetInstance( + object obj) + { + if (obj == null || obj is TypeOfBiometricData) + { + return (TypeOfBiometricData) obj; + } + + if (obj is DerInteger) + { + DerInteger predefinedBiometricTypeObj = DerInteger.GetInstance(obj); + int predefinedBiometricType = predefinedBiometricTypeObj.Value.IntValue; + + return new TypeOfBiometricData(predefinedBiometricType); + } + + if (obj is DerObjectIdentifier) + { + DerObjectIdentifier BiometricDataOid = DerObjectIdentifier.GetInstance(obj); + return new TypeOfBiometricData(BiometricDataOid); + } + + throw new ArgumentException("unknown object in GetInstance: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public TypeOfBiometricData( + int predefinedBiometricType) + { + if (predefinedBiometricType == Picture || predefinedBiometricType == HandwrittenSignature) + { + obj = new DerInteger(predefinedBiometricType); + } + else + { + throw new ArgumentException("unknow PredefinedBiometricType : " + predefinedBiometricType); + } + } + + public TypeOfBiometricData( + DerObjectIdentifier biometricDataOid) + { + obj = biometricDataOid; + } + + public bool IsPredefined + { + get { return obj is DerInteger; } + } + + public int PredefinedBiometricType + { + get { return ((DerInteger) obj).Value.IntValue; } + } + + public DerObjectIdentifier BiometricDataOid + { + get { return (DerObjectIdentifier) obj; } + } + + public override Asn1Object ToAsn1Object() + { + return obj.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/TypeOfBiometricData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/TypeOfBiometricData.cs.meta new file mode 100644 index 00000000..b0a506b8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/qualified/TypeOfBiometricData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37387a2cf0365b54a8af39207988ed89 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi.meta new file mode 100644 index 00000000..4c3fc209 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1db0f3ad39d2daf45acf71cf68fbe8b3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/NameOrPseudonym.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/NameOrPseudonym.cs new file mode 100644 index 00000000..f8e46f95 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/NameOrPseudonym.cs @@ -0,0 +1,182 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.SigI +{ + /** + * Structure for a name or pseudonym. + * + *
+	*       NameOrPseudonym ::= CHOICE {
+	*     	   surAndGivenName SEQUENCE {
+	*     	     surName DirectoryString,
+	*     	     givenName SEQUENCE OF DirectoryString 
+	*         },
+	*     	   pseudonym DirectoryString 
+	*       }
+	* 
+ * + * @see org.bouncycastle.asn1.x509.sigi.PersonalData + * + */ + public class NameOrPseudonym + : Asn1Encodable, IAsn1Choice + { + private readonly DirectoryString pseudonym; + private readonly DirectoryString surname; + private readonly Asn1Sequence givenName; + + public static NameOrPseudonym GetInstance( + object obj) + { + if (obj == null || obj is NameOrPseudonym) + { + return (NameOrPseudonym)obj; + } + + if (obj is IAsn1String) + { + return new NameOrPseudonym(DirectoryString.GetInstance(obj)); + } + + if (obj is Asn1Sequence) + { + return new NameOrPseudonym((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from DERString. + *

+ * The sequence is of type NameOrPseudonym: + *

+ *

+		*       NameOrPseudonym ::= CHOICE {
+		*     	   surAndGivenName SEQUENCE {
+		*     	     surName DirectoryString,
+		*     	     givenName SEQUENCE OF DirectoryString
+		*         },
+		*     	   pseudonym DirectoryString
+		*       }
+		* 
+ * @param pseudonym pseudonym value to use. + */ + public NameOrPseudonym( + DirectoryString pseudonym) + { + this.pseudonym = pseudonym; + } + + /** + * Constructor from Asn1Sequence. + *

+ * The sequence is of type NameOrPseudonym: + *

+ *

+		*       NameOrPseudonym ::= CHOICE {
+		*     	   surAndGivenName SEQUENCE {
+		*     	     surName DirectoryString,
+		*     	     givenName SEQUENCE OF DirectoryString
+		*         },
+		*     	   pseudonym DirectoryString
+		*       }
+		* 
+ * + * @param seq The ASN.1 sequence. + */ + private NameOrPseudonym( + Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + if (!(seq[0] is IAsn1String)) + throw new ArgumentException("Bad object encountered: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(seq[0])); + + surname = DirectoryString.GetInstance(seq[0]); + givenName = Asn1Sequence.GetInstance(seq[1]); + } + + /** + * Constructor from a given details. + * + * @param pseudonym The pseudonym. + */ + public NameOrPseudonym( + string pseudonym) + : this(new DirectoryString(pseudonym)) + { + } + + /** + * Constructor from a given details. + * + * @param surname The surname. + * @param givenName A sequence of directory strings making up the givenName + */ + public NameOrPseudonym( + DirectoryString surname, + Asn1Sequence givenName) + { + this.surname = surname; + this.givenName = givenName; + } + + public DirectoryString Pseudonym + { + get { return pseudonym; } + } + + public DirectoryString Surname + { + get { return surname; } + } + + public DirectoryString[] GetGivenName() + { + DirectoryString[] items = new DirectoryString[givenName.Count]; + int count = 0; + foreach (object o in givenName) + { + items[count++] = DirectoryString.GetInstance(o); + } + return items; + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*       NameOrPseudonym ::= CHOICE {
+		*     	   surAndGivenName SEQUENCE {
+		*     	     surName DirectoryString,
+		*     	     givenName SEQUENCE OF DirectoryString
+		*         },
+		*     	   pseudonym DirectoryString
+		*       }
+		* 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + if (pseudonym != null) + { + return pseudonym.ToAsn1Object(); + } + + return new DerSequence(surname, givenName); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/NameOrPseudonym.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/NameOrPseudonym.cs.meta new file mode 100644 index 00000000..f097b0fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/NameOrPseudonym.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d60c5ad72d35fec4cb24d9ba1b1cab75 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/PersonalData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/PersonalData.cs new file mode 100644 index 00000000..239afcb9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/PersonalData.cs @@ -0,0 +1,215 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.SigI +{ + /** + * Contains personal data for the otherName field in the subjectAltNames + * extension. + *

+ *

+	*     PersonalData ::= SEQUENCE {
+	*       nameOrPseudonym NameOrPseudonym,
+	*       nameDistinguisher [0] INTEGER OPTIONAL,
+	*       dateOfBirth [1] GeneralizedTime OPTIONAL,
+	*       placeOfBirth [2] DirectoryString OPTIONAL,
+	*       gender [3] PrintableString OPTIONAL,
+	*       postalAddress [4] DirectoryString OPTIONAL
+	*       }
+	* 
+ * + * @see org.bouncycastle.asn1.x509.sigi.NameOrPseudonym + * @see org.bouncycastle.asn1.x509.sigi.SigIObjectIdentifiers + */ + public class PersonalData + : Asn1Encodable + { + private readonly NameOrPseudonym nameOrPseudonym; + private readonly BigInteger nameDistinguisher; + private readonly DerGeneralizedTime dateOfBirth; + private readonly DirectoryString placeOfBirth; + private readonly string gender; + private readonly DirectoryString postalAddress; + + public static PersonalData GetInstance( + object obj) + { + if (obj == null || obj is PersonalData) + { + return (PersonalData) obj; + } + + if (obj is Asn1Sequence) + { + return new PersonalData((Asn1Sequence) obj); + } + + throw new ArgumentException("unknown object in factory: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + /** + * Constructor from Asn1Sequence. + *

+ * The sequence is of type NameOrPseudonym: + *

+ *

+		*     PersonalData ::= SEQUENCE {
+		*       nameOrPseudonym NameOrPseudonym,
+		*       nameDistinguisher [0] INTEGER OPTIONAL,
+		*       dateOfBirth [1] GeneralizedTime OPTIONAL,
+		*       placeOfBirth [2] DirectoryString OPTIONAL,
+		*       gender [3] PrintableString OPTIONAL,
+		*       postalAddress [4] DirectoryString OPTIONAL
+		*       }
+		* 
+ * + * @param seq The ASN.1 sequence. + */ + private PersonalData( + Asn1Sequence seq) + { + if (seq.Count < 1) + throw new ArgumentException("Bad sequence size: " + seq.Count); + + IEnumerator e = seq.GetEnumerator(); + e.MoveNext(); + + nameOrPseudonym = NameOrPseudonym.GetInstance(e.Current); + + while (e.MoveNext()) + { + Asn1TaggedObject o = Asn1TaggedObject.GetInstance(e.Current); + int tag = o.TagNo; + switch (tag) + { + case 0: + nameDistinguisher = DerInteger.GetInstance(o, false).Value; + break; + case 1: + dateOfBirth = DerGeneralizedTime.GetInstance(o, false); + break; + case 2: + placeOfBirth = DirectoryString.GetInstance(o, true); + break; + case 3: + gender = DerPrintableString.GetInstance(o, false).GetString(); + break; + case 4: + postalAddress = DirectoryString.GetInstance(o, true); + break; + default: + throw new ArgumentException("Bad tag number: " + o.TagNo); + } + } + } + + /** + * Constructor from a given details. + * + * @param nameOrPseudonym Name or pseudonym. + * @param nameDistinguisher Name distinguisher. + * @param dateOfBirth Date of birth. + * @param placeOfBirth Place of birth. + * @param gender Gender. + * @param postalAddress Postal Address. + */ + public PersonalData( + NameOrPseudonym nameOrPseudonym, + BigInteger nameDistinguisher, + DerGeneralizedTime dateOfBirth, + DirectoryString placeOfBirth, + string gender, + DirectoryString postalAddress) + { + this.nameOrPseudonym = nameOrPseudonym; + this.dateOfBirth = dateOfBirth; + this.gender = gender; + this.nameDistinguisher = nameDistinguisher; + this.postalAddress = postalAddress; + this.placeOfBirth = placeOfBirth; + } + + public NameOrPseudonym NameOrPseudonym + { + get { return nameOrPseudonym; } + } + + public BigInteger NameDistinguisher + { + get { return nameDistinguisher; } + } + + public DerGeneralizedTime DateOfBirth + { + get { return dateOfBirth; } + } + + public DirectoryString PlaceOfBirth + { + get { return placeOfBirth; } + } + + public string Gender + { + get { return gender; } + } + + public DirectoryString PostalAddress + { + get { return postalAddress; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *

+ * Returns: + *

+ *

+		*     PersonalData ::= SEQUENCE {
+		*       nameOrPseudonym NameOrPseudonym,
+		*       nameDistinguisher [0] INTEGER OPTIONAL,
+		*       dateOfBirth [1] GeneralizedTime OPTIONAL,
+		*       placeOfBirth [2] DirectoryString OPTIONAL,
+		*       gender [3] PrintableString OPTIONAL,
+		*       postalAddress [4] DirectoryString OPTIONAL
+		*       }
+		* 
+ * + * @return an Asn1Object + */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + vec.Add(nameOrPseudonym); + if (nameDistinguisher != null) + { + vec.Add(new DerTaggedObject(false, 0, new DerInteger(nameDistinguisher))); + } + if (dateOfBirth != null) + { + vec.Add(new DerTaggedObject(false, 1, dateOfBirth)); + } + if (placeOfBirth != null) + { + vec.Add(new DerTaggedObject(true, 2, placeOfBirth)); + } + if (gender != null) + { + vec.Add(new DerTaggedObject(false, 3, new DerPrintableString(gender, true))); + } + if (postalAddress != null) + { + vec.Add(new DerTaggedObject(true, 4, postalAddress)); + } + return new DerSequence(vec); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/PersonalData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/PersonalData.cs.meta new file mode 100644 index 00000000..3c5fcf94 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/PersonalData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3cd249d30275a3846b1b34b4d05daed6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/SigIObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/SigIObjectIdentifiers.cs new file mode 100644 index 00000000..e5bca699 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/SigIObjectIdentifiers.cs @@ -0,0 +1,53 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.SigI +{ + /** + * Object Identifiers of SigI specifciation (German Signature Law + * Interoperability specification). + */ + public sealed class SigIObjectIdentifiers + { + private SigIObjectIdentifiers() + { + } + + public readonly static DerObjectIdentifier IdSigI = new DerObjectIdentifier("1.3.36.8"); + + /** + * Key purpose IDs for German SigI (Signature Interoperability + * Specification) + */ + public readonly static DerObjectIdentifier IdSigIKP = new DerObjectIdentifier(IdSigI + ".2"); + + /** + * Certificate policy IDs for German SigI (Signature Interoperability + * Specification) + */ + public readonly static DerObjectIdentifier IdSigICP = new DerObjectIdentifier(IdSigI + ".1"); + + /** + * Other Name IDs for German SigI (Signature Interoperability Specification) + */ + public readonly static DerObjectIdentifier IdSigION = new DerObjectIdentifier(IdSigI + ".4"); + + /** + * To be used for for the generation of directory service certificates. + */ + public static readonly DerObjectIdentifier IdSigIKPDirectoryService = new DerObjectIdentifier(IdSigIKP + ".1"); + + /** + * ID for PersonalData + */ + public static readonly DerObjectIdentifier IdSigIONPersonalData = new DerObjectIdentifier(IdSigION + ".1"); + + /** + * Certificate is conform to german signature law. + */ + public static readonly DerObjectIdentifier IdSigICPSigConform = new DerObjectIdentifier(IdSigICP + ".1"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/SigIObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/SigIObjectIdentifiers.cs.meta new file mode 100644 index 00000000..d985b336 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x509/sigi/SigIObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b37581af504a5348a00614a61953890 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9.meta new file mode 100644 index 00000000..a74992ad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76282f28a92d5d448879417bd0de6c37 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHDomainParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHDomainParameters.cs new file mode 100644 index 00000000..659d5d55 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHDomainParameters.cs @@ -0,0 +1,122 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + public class DHDomainParameters + : Asn1Encodable + { + private readonly DerInteger p, g, q, j; + private readonly DHValidationParms validationParms; + + public static DHDomainParameters GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + public static DHDomainParameters GetInstance(object obj) + { + if (obj == null || obj is DHDomainParameters) + return (DHDomainParameters)obj; + + if (obj is Asn1Sequence) + return new DHDomainParameters((Asn1Sequence)obj); + + throw new ArgumentException("Invalid DHDomainParameters: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public DHDomainParameters(DerInteger p, DerInteger g, DerInteger q, DerInteger j, + DHValidationParms validationParms) + { + if (p == null) + throw new ArgumentNullException("p"); + if (g == null) + throw new ArgumentNullException("g"); + if (q == null) + throw new ArgumentNullException("q"); + + this.p = p; + this.g = g; + this.q = q; + this.j = j; + this.validationParms = validationParms; + } + + private DHDomainParameters(Asn1Sequence seq) + { + if (seq.Count < 3 || seq.Count > 5) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + IEnumerator e = seq.GetEnumerator(); + this.p = DerInteger.GetInstance(GetNext(e)); + this.g = DerInteger.GetInstance(GetNext(e)); + this.q = DerInteger.GetInstance(GetNext(e)); + + Asn1Encodable next = GetNext(e); + + if (next != null && next is DerInteger) + { + this.j = DerInteger.GetInstance(next); + next = GetNext(e); + } + + if (next != null) + { + this.validationParms = DHValidationParms.GetInstance(next.ToAsn1Object()); + } + } + + private static Asn1Encodable GetNext(IEnumerator e) + { + return e.MoveNext() ? (Asn1Encodable)e.Current : null; + } + + public DerInteger P + { + get { return this.p; } + } + + public DerInteger G + { + get { return this.g; } + } + + public DerInteger Q + { + get { return this.q; } + } + + public DerInteger J + { + get { return this.j; } + } + + public DHValidationParms ValidationParms + { + get { return this.validationParms; } + } + + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(p, g, q); + + if (this.j != null) + { + v.Add(this.j); + } + + if (this.validationParms != null) + { + v.Add(this.validationParms); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHDomainParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHDomainParameters.cs.meta new file mode 100644 index 00000000..9947a5ef --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHDomainParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37ebcba642487dd429a8bf7303793ea7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHPublicKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHPublicKey.cs new file mode 100644 index 00000000..3009c80c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHPublicKey.cs @@ -0,0 +1,50 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + public class DHPublicKey + : Asn1Encodable + { + private readonly DerInteger y; + + public static DHPublicKey GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(DerInteger.GetInstance(obj, isExplicit)); + } + + public static DHPublicKey GetInstance(object obj) + { + if (obj == null || obj is DHPublicKey) + return (DHPublicKey)obj; + + if (obj is DerInteger) + return new DHPublicKey((DerInteger)obj); + + throw new ArgumentException("Invalid DHPublicKey: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public DHPublicKey(DerInteger y) + { + if (y == null) + throw new ArgumentNullException("y"); + + this.y = y; + } + + public DerInteger Y + { + get { return this.y; } + } + + public override Asn1Object ToAsn1Object() + { + return this.y; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHPublicKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHPublicKey.cs.meta new file mode 100644 index 00000000..d29a773b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHPublicKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b171cae4a7bfd74dafae201bbd43958 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHValidationParms.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHValidationParms.cs new file mode 100644 index 00000000..46e6123a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHValidationParms.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + public class DHValidationParms + : Asn1Encodable + { + private readonly DerBitString seed; + private readonly DerInteger pgenCounter; + + public static DHValidationParms GetInstance(Asn1TaggedObject obj, bool isExplicit) + { + return GetInstance(Asn1Sequence.GetInstance(obj, isExplicit)); + } + + public static DHValidationParms GetInstance(object obj) + { + if (obj == null || obj is DHDomainParameters) + return (DHValidationParms)obj; + + if (obj is Asn1Sequence) + return new DHValidationParms((Asn1Sequence)obj); + + throw new ArgumentException("Invalid DHValidationParms: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj), "obj"); + } + + public DHValidationParms(DerBitString seed, DerInteger pgenCounter) + { + if (seed == null) + throw new ArgumentNullException("seed"); + if (pgenCounter == null) + throw new ArgumentNullException("pgenCounter"); + + this.seed = seed; + this.pgenCounter = pgenCounter; + } + + private DHValidationParms(Asn1Sequence seq) + { + if (seq.Count != 2) + throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); + + this.seed = DerBitString.GetInstance(seq[0]); + this.pgenCounter = DerInteger.GetInstance(seq[1]); + } + + public DerBitString Seed + { + get { return this.seed; } + } + + public DerInteger PgenCounter + { + get { return this.pgenCounter; } + } + + public override Asn1Object ToAsn1Object() + { + return new DerSequence(seed, pgenCounter); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHValidationParms.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHValidationParms.cs.meta new file mode 100644 index 00000000..381ca351 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/DHValidationParms.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4c6fa04a900b7794bb04300863773f6a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/ECNamedCurveTable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/ECNamedCurveTable.cs new file mode 100644 index 00000000..7caa114f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/ECNamedCurveTable.cs @@ -0,0 +1,190 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Anssi; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + /** + * A general class that reads all X9.62 style EC curve tables. + */ + public class ECNamedCurveTable + { + /** + * return a X9ECParameters object representing the passed in named + * curve. The routine returns null if the curve is not present. + * + * @param name the name of the curve requested + * @return an X9ECParameters object or null if the curve is not available. + */ + public static X9ECParameters GetByName(string name) + { + X9ECParameters ecP = X962NamedCurves.GetByName(name); + if (ecP == null) + { + ecP = SecNamedCurves.GetByName(name); + } + if (ecP == null) + { + ecP = NistNamedCurves.GetByName(name); + } + if (ecP == null) + { + ecP = TeleTrusTNamedCurves.GetByName(name); + } + if (ecP == null) + { + ecP = AnssiNamedCurves.GetByName(name); + } + if (ecP == null) + { + ecP = FromDomainParameters(ECGost3410NamedCurves.GetByName(name)); + } + if (ecP == null) + { + ecP = GMNamedCurves.GetByName(name); + } + return ecP; + } + + public static string GetName(DerObjectIdentifier oid) + { + string name = X962NamedCurves.GetName(oid); + if (name == null) + { + name = SecNamedCurves.GetName(oid); + } + if (name == null) + { + name = NistNamedCurves.GetName(oid); + } + if (name == null) + { + name = TeleTrusTNamedCurves.GetName(oid); + } + if (name == null) + { + name = AnssiNamedCurves.GetName(oid); + } + if (name == null) + { + name = ECGost3410NamedCurves.GetName(oid); + } + if (name == null) + { + name = GMNamedCurves.GetName(oid); + } + return name; + } + + /** + * return the object identifier signified by the passed in name. Null + * if there is no object identifier associated with name. + * + * @return the object identifier associated with name, if present. + */ + public static DerObjectIdentifier GetOid(string name) + { + DerObjectIdentifier oid = X962NamedCurves.GetOid(name); + if (oid == null) + { + oid = SecNamedCurves.GetOid(name); + } + if (oid == null) + { + oid = NistNamedCurves.GetOid(name); + } + if (oid == null) + { + oid = TeleTrusTNamedCurves.GetOid(name); + } + if (oid == null) + { + oid = AnssiNamedCurves.GetOid(name); + } + if (oid == null) + { + oid = ECGost3410NamedCurves.GetOid(name); + } + if (oid == null) + { + oid = GMNamedCurves.GetOid(name); + } + return oid; + } + + /** + * return a X9ECParameters object representing the passed in named + * curve. + * + * @param oid the object id of the curve requested + * @return an X9ECParameters object or null if the curve is not available. + */ + public static X9ECParameters GetByOid(DerObjectIdentifier oid) + { + X9ECParameters ecP = X962NamedCurves.GetByOid(oid); + if (ecP == null) + { + ecP = SecNamedCurves.GetByOid(oid); + } + + // NOTE: All the NIST curves are currently from SEC, so no point in redundant OID lookup + + if (ecP == null) + { + ecP = TeleTrusTNamedCurves.GetByOid(oid); + } + if (ecP == null) + { + ecP = AnssiNamedCurves.GetByOid(oid); + } + if (ecP == null) + { + ecP = FromDomainParameters(ECGost3410NamedCurves.GetByOid(oid)); + } + if (ecP == null) + { + ecP = GMNamedCurves.GetByOid(oid); + } + return ecP; + } + + /** + * return an enumeration of the names of the available curves. + * + * @return an enumeration of the names of the available curves. + */ + public static IEnumerable Names + { + get + { + IList v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + CollectionUtilities.AddRange(v, X962NamedCurves.Names); + CollectionUtilities.AddRange(v, SecNamedCurves.Names); + CollectionUtilities.AddRange(v, NistNamedCurves.Names); + CollectionUtilities.AddRange(v, TeleTrusTNamedCurves.Names); + CollectionUtilities.AddRange(v, AnssiNamedCurves.Names); + CollectionUtilities.AddRange(v, ECGost3410NamedCurves.Names); + CollectionUtilities.AddRange(v, GMNamedCurves.Names); + return v; + } + } + + private static X9ECParameters FromDomainParameters(ECDomainParameters dp) + { + return dp == null ? null : new X9ECParameters(dp.Curve, dp.G, dp.N, dp.H, dp.GetSeed()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/ECNamedCurveTable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/ECNamedCurveTable.cs.meta new file mode 100644 index 00000000..3b91f7e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/ECNamedCurveTable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9997102bd93d26b4383c8a708d2109ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/KeySpecificInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/KeySpecificInfo.cs new file mode 100644 index 00000000..2b47a586 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/KeySpecificInfo.cs @@ -0,0 +1,62 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + /** + * ASN.1 def for Diffie-Hellman key exchange KeySpecificInfo structure. See + * RFC 2631, or X9.42, for further details. + */ + public class KeySpecificInfo + : Asn1Encodable + { + private DerObjectIdentifier algorithm; + private Asn1OctetString counter; + + public KeySpecificInfo( + DerObjectIdentifier algorithm, + Asn1OctetString counter) + { + this.algorithm = algorithm; + this.counter = counter; + } + + public KeySpecificInfo( + Asn1Sequence seq) + { + IEnumerator e = seq.GetEnumerator(); + + e.MoveNext(); + algorithm = (DerObjectIdentifier)e.Current; + e.MoveNext(); + counter = (Asn1OctetString)e.Current; + } + + public DerObjectIdentifier Algorithm + { + get { return algorithm; } + } + + public Asn1OctetString Counter + { + get { return counter; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  KeySpecificInfo ::= Sequence {
+         *      algorithm OBJECT IDENTIFIER,
+         *      counter OCTET STRING SIZE (4..4)
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(algorithm, counter); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/KeySpecificInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/KeySpecificInfo.cs.meta new file mode 100644 index 00000000..dce06a91 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/KeySpecificInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6eb5dc76eeec5954fbd7be805a90f5c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/OtherInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/OtherInfo.cs new file mode 100644 index 00000000..6c235206 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/OtherInfo.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + /** + * ANS.1 def for Diffie-Hellman key exchange OtherInfo structure. See + * RFC 2631, or X9.42, for further details. + */ + public class OtherInfo + : Asn1Encodable + { + private KeySpecificInfo keyInfo; + private Asn1OctetString partyAInfo; + private Asn1OctetString suppPubInfo; + + public OtherInfo( + KeySpecificInfo keyInfo, + Asn1OctetString partyAInfo, + Asn1OctetString suppPubInfo) + { + this.keyInfo = keyInfo; + this.partyAInfo = partyAInfo; + this.suppPubInfo = suppPubInfo; + } + + public OtherInfo( + Asn1Sequence seq) + { + IEnumerator e = seq.GetEnumerator(); + + e.MoveNext(); + keyInfo = new KeySpecificInfo((Asn1Sequence) e.Current); + + while (e.MoveNext()) + { + DerTaggedObject o = (DerTaggedObject) e.Current; + + if (o.TagNo == 0) + { + partyAInfo = (Asn1OctetString) o.GetObject(); + } + else if ((int) o.TagNo == 2) + { + suppPubInfo = (Asn1OctetString) o.GetObject(); + } + } + } + + public KeySpecificInfo KeyInfo + { + get { return keyInfo; } + } + + public Asn1OctetString PartyAInfo + { + get { return partyAInfo; } + } + + public Asn1OctetString SuppPubInfo + { + get { return suppPubInfo; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  OtherInfo ::= Sequence {
+         *      keyInfo KeySpecificInfo,
+         *      partyAInfo [0] OCTET STRING OPTIONAL,
+         *      suppPubInfo [2] OCTET STRING
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(keyInfo); + + if (partyAInfo != null) + { + v.Add(new DerTaggedObject(0, partyAInfo)); + } + + v.Add(new DerTaggedObject(2, suppPubInfo)); + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/OtherInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/OtherInfo.cs.meta new file mode 100644 index 00000000..44ce9fe2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/OtherInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cc4394b3d9564514f9ef4298729b5053 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962NamedCurves.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962NamedCurves.cs new file mode 100644 index 00000000..e6e8d27c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962NamedCurves.cs @@ -0,0 +1,755 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + /** + * table of the current named curves defined in X.962 EC-DSA. + */ + public sealed class X962NamedCurves + { + private X962NamedCurves() + { + } + + internal class Prime192v1Holder + : X9ECParametersHolder + { + private Prime192v1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Prime192v1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("ffffffffffffffffffffffff99def836146bc9b1b4d22831", 16); + BigInteger h = BigInteger.One; + + ECCurve cFp192v1 = new FpCurve( + new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", 16), + new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16), + new BigInteger("64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", 16), + n, h); + + return new X9ECParameters( + cFp192v1, + new X9ECPoint(cFp192v1, + Hex.Decode("03188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012")), + n, h, + Hex.Decode("3045AE6FC8422f64ED579528D38120EAE12196D5")); + } + } + + internal class Prime192v2Holder + : X9ECParametersHolder + { + private Prime192v2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Prime192v2Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("fffffffffffffffffffffffe5fb1a724dc80418648d8dd31", 16); + BigInteger h = BigInteger.One; + + ECCurve cFp192v2 = new FpCurve( + new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", 16), + new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16), + new BigInteger("cc22d6dfb95c6b25e49c0d6364a4e5980c393aa21668d953", 16), + n, h); + + return new X9ECParameters( + cFp192v2, + new X9ECPoint(cFp192v2, + Hex.Decode("03eea2bae7e1497842f2de7769cfe9c989c072ad696f48034a")), + n, h, + Hex.Decode("31a92ee2029fd10d901b113e990710f0d21ac6b6")); + } + } + + internal class Prime192v3Holder + : X9ECParametersHolder + { + private Prime192v3Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Prime192v3Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("ffffffffffffffffffffffff7a62d031c83f4294f640ec13", 16); + BigInteger h = BigInteger.One; + + ECCurve cFp192v3 = new FpCurve( + new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", 16), + new BigInteger("fffffffffffffffffffffffffffffffefffffffffffffffc", 16), + new BigInteger("22123dc2395a05caa7423daeccc94760a7d462256bd56916", 16), + n, h); + + return new X9ECParameters( + cFp192v3, + new X9ECPoint(cFp192v3, + Hex.Decode("027d29778100c65a1da1783716588dce2b8b4aee8e228f1896")), + n, h, + Hex.Decode("c469684435deb378c4b65ca9591e2a5763059a2e")); + } + } + + internal class Prime239v1Holder + : X9ECParametersHolder + { + private Prime239v1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Prime239v1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("7fffffffffffffffffffffff7fffff9e5e9a9f5d9071fbd1522688909d0b", 16); + BigInteger h = BigInteger.One; + + ECCurve cFp239v1 = new FpCurve( + new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), + new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), + new BigInteger("6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", 16), + n, h); + + return new X9ECParameters( + cFp239v1, + new X9ECPoint(cFp239v1, + Hex.Decode("020ffa963cdca8816ccc33b8642bedf905c3d358573d3f27fbbd3b3cb9aaaf")), + n, h, + Hex.Decode("e43bb460f0b80cc0c0b075798e948060f8321b7d")); + } + } + + internal class Prime239v2Holder + : X9ECParametersHolder + { + private Prime239v2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Prime239v2Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("7fffffffffffffffffffffff800000cfa7e8594377d414c03821bc582063", 16); + BigInteger h = BigInteger.One; + + ECCurve cFp239v2 = new FpCurve( + new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), + new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), + new BigInteger("617fab6832576cbbfed50d99f0249c3fee58b94ba0038c7ae84c8c832f2c", 16), + n, h); + + return new X9ECParameters( + cFp239v2, + new X9ECPoint(cFp239v2, + Hex.Decode("0238af09d98727705120c921bb5e9e26296a3cdcf2f35757a0eafd87b830e7")), + n, h, + Hex.Decode("e8b4011604095303ca3b8099982be09fcb9ae616")); + } + } + + internal class Prime239v3Holder + : X9ECParametersHolder + { + private Prime239v3Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Prime239v3Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("7fffffffffffffffffffffff7fffff975deb41b3a6057c3c432146526551", 16); + BigInteger h = BigInteger.One; + + ECCurve cFp239v3 = new FpCurve( + new BigInteger("883423532389192164791648750360308885314476597252960362792450860609699839"), + new BigInteger("7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", 16), + new BigInteger("255705fa2a306654b1f4cb03d6a750a30c250102d4988717d9ba15ab6d3e", 16), + n, h); + + return new X9ECParameters( + cFp239v3, + new X9ECPoint(cFp239v3, + Hex.Decode("036768ae8e18bb92cfcf005c949aa2c6d94853d0e660bbf854b1c9505fe95a")), + n, h, + Hex.Decode("7d7374168ffe3471b60a857686a19475d3bfa2ff")); + } + } + + internal class Prime256v1Holder + : X9ECParametersHolder + { + private Prime256v1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new Prime256v1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", 16); + BigInteger h = BigInteger.One; + + ECCurve cFp256v1 = new FpCurve( + new BigInteger("115792089210356248762697446949407573530086143415290314195533631308867097853951"), + new BigInteger("ffffffff00000001000000000000000000000000fffffffffffffffffffffffc", 16), + new BigInteger("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", 16), + n, h); + + return new X9ECParameters( + cFp256v1, + new X9ECPoint(cFp256v1, + Hex.Decode("036b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296")), + n, h, + Hex.Decode("c49d360886e704936a6678e1139d26b7819f7e90")); + } + } + + /* + * F2m Curves + */ + internal class C2pnb163v1Holder + : X9ECParametersHolder + { + private C2pnb163v1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2pnb163v1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("0400000000000000000001E60FC8821CC74DAEAFC1", 16); + BigInteger h = BigInteger.Two; + + ECCurve c2m163v1 = new F2mCurve( + 163, + 1, 2, 8, + new BigInteger("072546B5435234A422E0789675F432C89435DE5242", 16), + new BigInteger("00C9517D06D5240D3CFF38C74B20B6CD4D6F9DD4D9", 16), + n, h); + + return new X9ECParameters( + c2m163v1, + new X9ECPoint(c2m163v1, + Hex.Decode("0307AF69989546103D79329FCC3D74880F33BBE803CB")), + n, h, + Hex.Decode("D2C0FB15760860DEF1EEF4D696E6768756151754")); + } + } + + internal class C2pnb163v2Holder + : X9ECParametersHolder + { + private C2pnb163v2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2pnb163v2Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("03FFFFFFFFFFFFFFFFFFFDF64DE1151ADBB78F10A7", 16); + BigInteger h = BigInteger.Two; + + ECCurve c2m163v2 = new F2mCurve( + 163, + 1, 2, 8, + new BigInteger("0108B39E77C4B108BED981ED0E890E117C511CF072", 16), + new BigInteger("0667ACEB38AF4E488C407433FFAE4F1C811638DF20", 16), + n, h); + + return new X9ECParameters( + c2m163v2, + new X9ECPoint(c2m163v2, + Hex.Decode("030024266E4EB5106D0A964D92C4860E2671DB9B6CC5")), + n, h, + null); + } + } + + internal class C2pnb163v3Holder + : X9ECParametersHolder + { + private C2pnb163v3Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2pnb163v3Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("03FFFFFFFFFFFFFFFFFFFE1AEE140F110AFF961309", 16); + BigInteger h = BigInteger.Two; + + ECCurve c2m163v3 = new F2mCurve( + 163, + 1, 2, 8, + new BigInteger("07A526C63D3E25A256A007699F5447E32AE456B50E", 16), + new BigInteger("03F7061798EB99E238FD6F1BF95B48FEEB4854252B", 16), + n, h); + + return new X9ECParameters( + c2m163v3, + new X9ECPoint(c2m163v3, Hex.Decode("0202F9F87B7C574D0BDECF8A22E6524775F98CDEBDCB")), + n, h, + null); + } + } + + internal class C2pnb176w1Holder + : X9ECParametersHolder + { + private C2pnb176w1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2pnb176w1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("010092537397ECA4F6145799D62B0A19CE06FE26AD", 16); + BigInteger h = BigInteger.ValueOf(0xFF6E); + + ECCurve c2m176w1 = new F2mCurve( + 176, + 1, 2, 43, + new BigInteger("00E4E6DB2995065C407D9D39B8D0967B96704BA8E9C90B", 16), + new BigInteger("005DDA470ABE6414DE8EC133AE28E9BBD7FCEC0AE0FFF2", 16), + n, h); + + return new X9ECParameters( + c2m176w1, + new X9ECPoint(c2m176w1, + Hex.Decode("038D16C2866798B600F9F08BB4A8E860F3298CE04A5798")), + n, h, + null); + } + } + + internal class C2tnb191v1Holder + : X9ECParametersHolder + { + private C2tnb191v1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2tnb191v1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("40000000000000000000000004A20E90C39067C893BBB9A5", 16); + BigInteger h = BigInteger.Two; + + ECCurve c2m191v1 = new F2mCurve( + 191, + 9, + new BigInteger("2866537B676752636A68F56554E12640276B649EF7526267", 16), + new BigInteger("2E45EF571F00786F67B0081B9495A3D95462F5DE0AA185EC", 16), + n, h); + + return new X9ECParameters( + c2m191v1, + new X9ECPoint(c2m191v1, + Hex.Decode("0236B3DAF8A23206F9C4F299D7B21A9C369137F2C84AE1AA0D")), + n, h, + Hex.Decode("4E13CA542744D696E67687561517552F279A8C84")); + } + } + + internal class C2tnb191v2Holder + : X9ECParametersHolder + { + private C2tnb191v2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2tnb191v2Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("20000000000000000000000050508CB89F652824E06B8173", 16); + BigInteger h = BigInteger.ValueOf(4); + + ECCurve c2m191v2 = new F2mCurve( + 191, + 9, + new BigInteger("401028774D7777C7B7666D1366EA432071274F89FF01E718", 16), + new BigInteger("0620048D28BCBD03B6249C99182B7C8CD19700C362C46A01", 16), + n, h); + + return new X9ECParameters( + c2m191v2, + new X9ECPoint(c2m191v2, + Hex.Decode("023809B2B7CC1B28CC5A87926AAD83FD28789E81E2C9E3BF10")), + n, h, + null); + } + } + + internal class C2tnb191v3Holder + : X9ECParametersHolder + { + private C2tnb191v3Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2tnb191v3Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("155555555555555555555555610C0B196812BFB6288A3EA3", 16); + BigInteger h = BigInteger.ValueOf(6); + + ECCurve c2m191v3 = new F2mCurve( + 191, + 9, + new BigInteger("6C01074756099122221056911C77D77E77A777E7E7E77FCB", 16), + new BigInteger("71FE1AF926CF847989EFEF8DB459F66394D90F32AD3F15E8", 16), + n, h); + + return new X9ECParameters( + c2m191v3, + new X9ECPoint(c2m191v3, + Hex.Decode("03375D4CE24FDE434489DE8746E71786015009E66E38A926DD")), + n, h, + null); + } + } + + internal class C2pnb208w1Holder + : X9ECParametersHolder + { + private C2pnb208w1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2pnb208w1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("0101BAF95C9723C57B6C21DA2EFF2D5ED588BDD5717E212F9D", 16); + BigInteger h = BigInteger.ValueOf(0xFE48); + + ECCurve c2m208w1 = new F2mCurve( + 208, + 1, 2, 83, + new BigInteger("0", 16), + new BigInteger("00C8619ED45A62E6212E1160349E2BFA844439FAFC2A3FD1638F9E", 16), + n, h); + + return new X9ECParameters( + c2m208w1, + new X9ECPoint(c2m208w1, + Hex.Decode("0289FDFBE4ABE193DF9559ECF07AC0CE78554E2784EB8C1ED1A57A")), + n, h, + null); + } + } + + internal class C2tnb239v1Holder + : X9ECParametersHolder + { + private C2tnb239v1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2tnb239v1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("2000000000000000000000000000000F4D42FFE1492A4993F1CAD666E447", 16); + BigInteger h = BigInteger.ValueOf(4); + + ECCurve c2m239v1 = new F2mCurve( + 239, + 36, + new BigInteger("32010857077C5431123A46B808906756F543423E8D27877578125778AC76", 16), + new BigInteger("790408F2EEDAF392B012EDEFB3392F30F4327C0CA3F31FC383C422AA8C16", 16), + n, h); + + return new X9ECParameters( + c2m239v1, + new X9ECPoint(c2m239v1, + Hex.Decode("0257927098FA932E7C0A96D3FD5B706EF7E5F5C156E16B7E7C86038552E91D")), + n, h, + null); + } + } + + internal class C2tnb239v2Holder + : X9ECParametersHolder + { + private C2tnb239v2Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2tnb239v2Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("1555555555555555555555555555553C6F2885259C31E3FCDF154624522D", 16); + BigInteger h = BigInteger.ValueOf(6); + + ECCurve c2m239v2 = new F2mCurve( + 239, + 36, + new BigInteger("4230017757A767FAE42398569B746325D45313AF0766266479B75654E65F", 16), + new BigInteger("5037EA654196CFF0CD82B2C14A2FCF2E3FF8775285B545722F03EACDB74B", 16), + n, h); + + return new X9ECParameters( + c2m239v2, + new X9ECPoint(c2m239v2, + Hex.Decode("0228F9D04E900069C8DC47A08534FE76D2B900B7D7EF31F5709F200C4CA205")), + n, h, + null); + } + } + + internal class C2tnb239v3Holder + : X9ECParametersHolder + { + private C2tnb239v3Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2tnb239v3Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCAC4912D2D9DF903EF9888B8A0E4CFF", 16); + BigInteger h = BigInteger.ValueOf(10); + + ECCurve c2m239v3 = new F2mCurve( + 239, + 36, + new BigInteger("01238774666A67766D6676F778E676B66999176666E687666D8766C66A9F", 16), + new BigInteger("6A941977BA9F6A435199ACFC51067ED587F519C5ECB541B8E44111DE1D40", 16), + n, h); + + return new X9ECParameters( + c2m239v3, + new X9ECPoint(c2m239v3, + Hex.Decode("0370F6E9D04D289C4E89913CE3530BFDE903977D42B146D539BF1BDE4E9C92")), + n, h, + null); + } + } + + internal class C2pnb272w1Holder + : X9ECParametersHolder + { + private C2pnb272w1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2pnb272w1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("0100FAF51354E0E39E4892DF6E319C72C8161603FA45AA7B998A167B8F1E629521", 16); + BigInteger h = BigInteger.ValueOf(0xFF06); + + ECCurve c2m272w1 = new F2mCurve( + 272, + 1, 3, 56, + new BigInteger("0091A091F03B5FBA4AB2CCF49C4EDD220FB028712D42BE752B2C40094DBACDB586FB20", 16), + new BigInteger("7167EFC92BB2E3CE7C8AAAFF34E12A9C557003D7C73A6FAF003F99F6CC8482E540F7", 16), + n, h); + + return new X9ECParameters( + c2m272w1, + new X9ECPoint(c2m272w1, + Hex.Decode("026108BABB2CEEBCF787058A056CBE0CFE622D7723A289E08A07AE13EF0D10D171DD8D")), + n, h, + null); + } + } + + internal class C2pnb304w1Holder + : X9ECParametersHolder + { + private C2pnb304w1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2pnb304w1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("0101D556572AABAC800101D556572AABAC8001022D5C91DD173F8FB561DA6899164443051D", 16); + BigInteger h = BigInteger.ValueOf(0xFE2E); + + ECCurve c2m304w1 = new F2mCurve( + 304, + 1, 2, 11, + new BigInteger("00FD0D693149A118F651E6DCE6802085377E5F882D1B510B44160074C1288078365A0396C8E681", 16), + new BigInteger("00BDDB97E555A50A908E43B01C798EA5DAA6788F1EA2794EFCF57166B8C14039601E55827340BE", 16), + n, h); + + return new X9ECParameters( + c2m304w1, + new X9ECPoint(c2m304w1, + Hex.Decode("02197B07845E9BE2D96ADB0F5F3C7F2CFFBD7A3EB8B6FEC35C7FD67F26DDF6285A644F740A2614")), + n, h, + null); + } + } + + internal class C2tnb359v1Holder + : X9ECParametersHolder + { + private C2tnb359v1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2tnb359v1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("01AF286BCA1AF286BCA1AF286BCA1AF286BCA1AF286BC9FB8F6B85C556892C20A7EB964FE7719E74F490758D3B", 16); + BigInteger h = BigInteger.ValueOf(0x4C); + + ECCurve c2m359v1 = new F2mCurve( + 359, + 68, + new BigInteger("5667676A654B20754F356EA92017D946567C46675556F19556A04616B567D223A5E05656FB549016A96656A557", 16), + new BigInteger("2472E2D0197C49363F1FE7F5B6DB075D52B6947D135D8CA445805D39BC345626089687742B6329E70680231988", 16), + n, h); + + return new X9ECParameters( + c2m359v1, + new X9ECPoint(c2m359v1, + Hex.Decode("033C258EF3047767E7EDE0F1FDAA79DAEE3841366A132E163ACED4ED2401DF9C6BDCDE98E8E707C07A2239B1B097")), + n, h, + null); + } + } + + internal class C2pnb368w1Holder + : X9ECParametersHolder + { + private C2pnb368w1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2pnb368w1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("010090512DA9AF72B08349D98A5DD4C7B0532ECA51CE03E2D10F3B7AC579BD87E909AE40A6F131E9CFCE5BD967", 16); + BigInteger h = BigInteger.ValueOf(0xFF70); + + ECCurve c2m368w1 = new F2mCurve( + 368, + 1, 2, 85, + new BigInteger("00E0D2EE25095206F5E2A4F9ED229F1F256E79A0E2B455970D8D0D865BD94778C576D62F0AB7519CCD2A1A906AE30D", 16), + new BigInteger("00FC1217D4320A90452C760A58EDCD30C8DD069B3C34453837A34ED50CB54917E1C2112D84D164F444F8F74786046A", 16), + n, h); + + return new X9ECParameters( + c2m368w1, + new X9ECPoint(c2m368w1, + Hex.Decode("021085E2755381DCCCE3C1557AFA10C2F0C0C2825646C5B34A394CBCFA8BC16B22E7E789E927BE216F02E1FB136A5F")), + n, h, + null); + } + } + + internal class C2tnb431r1Holder + : X9ECParametersHolder + { + private C2tnb431r1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new C2tnb431r1Holder(); + + protected override X9ECParameters CreateParameters() + { + BigInteger n = new BigInteger("0340340340340340340340340340340340340340340340340340340323C313FAB50589703B5EC68D3587FEC60D161CC149C1AD4A91", 16); + BigInteger h = BigInteger.ValueOf(0x2760); + + ECCurve c2m431r1 = new F2mCurve( + 431, + 120, + new BigInteger("1A827EF00DD6FC0E234CAF046C6A5D8A85395B236CC4AD2CF32A0CADBDC9DDF620B0EB9906D0957F6C6FEACD615468DF104DE296CD8F", 16), + new BigInteger("10D9B4A3D9047D8B154359ABFB1B7F5485B04CEB868237DDC9DEDA982A679A5A919B626D4E50A8DD731B107A9962381FB5D807BF2618", 16), + n, h); + + return new X9ECParameters( + c2m431r1, + new X9ECPoint(c2m431r1, + Hex.Decode("02120FC05D3C67A99DE161D2F4092622FECA701BE4F50F4758714E8A87BBF2A658EF8C21E7C5EFE965361F6C2999C0C247B0DBD70CE6B7")), + n, h, + null); + } + } + + private static readonly IDictionary objIds = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary curves = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary names = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + private static void DefineCurve( + string name, + DerObjectIdentifier oid, + X9ECParametersHolder holder) + { + objIds.Add(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name), oid); + names.Add(oid, name); + curves.Add(oid, holder); + } + + static X962NamedCurves() + { + DefineCurve("prime192v1", X9ObjectIdentifiers.Prime192v1, Prime192v1Holder.Instance); + DefineCurve("prime192v2", X9ObjectIdentifiers.Prime192v2, Prime192v2Holder.Instance); + DefineCurve("prime192v3", X9ObjectIdentifiers.Prime192v3, Prime192v3Holder.Instance); + DefineCurve("prime239v1", X9ObjectIdentifiers.Prime239v1, Prime239v1Holder.Instance); + DefineCurve("prime239v2", X9ObjectIdentifiers.Prime239v2, Prime239v2Holder.Instance); + DefineCurve("prime239v3", X9ObjectIdentifiers.Prime239v3, Prime239v3Holder.Instance); + DefineCurve("prime256v1", X9ObjectIdentifiers.Prime256v1, Prime256v1Holder.Instance); + DefineCurve("c2pnb163v1", X9ObjectIdentifiers.C2Pnb163v1, C2pnb163v1Holder.Instance); + DefineCurve("c2pnb163v2", X9ObjectIdentifiers.C2Pnb163v2, C2pnb163v2Holder.Instance); + DefineCurve("c2pnb163v3", X9ObjectIdentifiers.C2Pnb163v3, C2pnb163v3Holder.Instance); + DefineCurve("c2pnb176w1", X9ObjectIdentifiers.C2Pnb176w1, C2pnb176w1Holder.Instance); + DefineCurve("c2tnb191v1", X9ObjectIdentifiers.C2Tnb191v1, C2tnb191v1Holder.Instance); + DefineCurve("c2tnb191v2", X9ObjectIdentifiers.C2Tnb191v2, C2tnb191v2Holder.Instance); + DefineCurve("c2tnb191v3", X9ObjectIdentifiers.C2Tnb191v3, C2tnb191v3Holder.Instance); + DefineCurve("c2pnb208w1", X9ObjectIdentifiers.C2Pnb208w1, C2pnb208w1Holder.Instance); + DefineCurve("c2tnb239v1", X9ObjectIdentifiers.C2Tnb239v1, C2tnb239v1Holder.Instance); + DefineCurve("c2tnb239v2", X9ObjectIdentifiers.C2Tnb239v2, C2tnb239v2Holder.Instance); + DefineCurve("c2tnb239v3", X9ObjectIdentifiers.C2Tnb239v3, C2tnb239v3Holder.Instance); + DefineCurve("c2pnb272w1", X9ObjectIdentifiers.C2Pnb272w1, C2pnb272w1Holder.Instance); + DefineCurve("c2pnb304w1", X9ObjectIdentifiers.C2Pnb304w1, C2pnb304w1Holder.Instance); + DefineCurve("c2tnb359v1", X9ObjectIdentifiers.C2Tnb359v1, C2tnb359v1Holder.Instance); + DefineCurve("c2pnb368w1", X9ObjectIdentifiers.C2Pnb368w1, C2pnb368w1Holder.Instance); + DefineCurve("c2tnb431r1", X9ObjectIdentifiers.C2Tnb431r1, C2tnb431r1Holder.Instance); + } + + public static X9ECParameters GetByName( + string name) + { + DerObjectIdentifier oid = GetOid(name); + return oid == null ? null : GetByOid(oid); + } + + /** + * return the X9ECParameters object for the named curve represented by + * the passed in object identifier. Null if the curve isn't present. + * + * @param oid an object identifier representing a named curve, if present. + */ + public static X9ECParameters GetByOid( + DerObjectIdentifier oid) + { + X9ECParametersHolder holder = (X9ECParametersHolder)curves[oid]; + return holder == null ? null : holder.Parameters; + } + + /** + * return the object identifier signified by the passed in name. Null + * if there is no object identifier associated with name. + * + * @return the object identifier associated with name, if present. + */ + public static DerObjectIdentifier GetOid( + string name) + { + return (DerObjectIdentifier)objIds[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name)]; + } + + /** + * return the named curve name represented by the given object identifier. + */ + public static string GetName( + DerObjectIdentifier oid) + { + return (string)names[oid]; + } + + /** + * returns an enumeration containing the name strings for curves + * contained in this structure. + */ + public static IEnumerable Names + { + get { return new EnumerableProxy(names.Values); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962NamedCurves.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962NamedCurves.cs.meta new file mode 100644 index 00000000..21995116 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962NamedCurves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7cc30986b054f343b703754ae6cf47d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962Parameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962Parameters.cs new file mode 100644 index 00000000..5009447e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962Parameters.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + public class X962Parameters + : Asn1Encodable, IAsn1Choice + { + private readonly Asn1Object _params; + + public static X962Parameters GetInstance( + object obj) + { + if (obj == null || obj is X962Parameters) + { + return (X962Parameters)obj; + } + + if (obj is Asn1Object) + { + return new X962Parameters((Asn1Object)obj); + } + + if (obj is byte[]) + { + try + { + return new X962Parameters(Asn1Object.FromByteArray((byte[])obj)); + } + catch (Exception e) + { + throw new ArgumentException("unable to parse encoded data: " + e.Message, e); + } + } + + throw new ArgumentException("unknown object in getInstance()"); + } + + public X962Parameters( + X9ECParameters ecParameters) + { + this._params = ecParameters.ToAsn1Object(); + } + + public X962Parameters( + DerObjectIdentifier namedCurve) + { + this._params = namedCurve; + } + + public X962Parameters( + Asn1Object obj) + { + this._params = obj; + } + + public bool IsNamedCurve + { + get { return (_params is DerObjectIdentifier); } + } + + public bool IsImplicitlyCA + { + get { return (_params is Asn1Null); } + } + + public Asn1Object Parameters + { + get { return _params; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         * Parameters ::= CHOICE {
+         *    ecParameters ECParameters,
+         *    namedCurve   CURVES.&id({CurveNames}),
+         *    implicitlyCA Null
+         * }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return _params; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962Parameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962Parameters.cs.meta new file mode 100644 index 00000000..7cf2549a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X962Parameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 61bfd513d3b6d3440aa9b03f5abe13b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9Curve.cs new file mode 100644 index 00000000..5b3fe059 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9Curve.cs @@ -0,0 +1,160 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + /** + * ASN.1 def for Elliptic-Curve Curve structure. See + * X9.62, for further details. + */ + public class X9Curve + : Asn1Encodable + { + private readonly ECCurve curve; + private readonly byte[] seed; + private readonly DerObjectIdentifier fieldIdentifier; + + public X9Curve( + ECCurve curve) + : this(curve, null) + { + } + + public X9Curve( + ECCurve curve, + byte[] seed) + { + if (curve == null) + throw new ArgumentNullException("curve"); + + this.curve = curve; + this.seed = Arrays.Clone(seed); + + if (ECAlgorithms.IsFpCurve(curve)) + { + this.fieldIdentifier = X9ObjectIdentifiers.PrimeField; + } + else if (ECAlgorithms.IsF2mCurve(curve)) + { + this.fieldIdentifier = X9ObjectIdentifiers.CharacteristicTwoField; + } + else + { + throw new ArgumentException("This type of ECCurve is not implemented"); + } + } + + [Obsolete("Use constructor including order/cofactor")] + public X9Curve( + X9FieldID fieldID, + Asn1Sequence seq) + : this(fieldID, null, null, seq) + { + } + + public X9Curve( + X9FieldID fieldID, + BigInteger order, + BigInteger cofactor, + Asn1Sequence seq) + { + if (fieldID == null) + throw new ArgumentNullException("fieldID"); + if (seq == null) + throw new ArgumentNullException("seq"); + + this.fieldIdentifier = fieldID.Identifier; + + if (fieldIdentifier.Equals(X9ObjectIdentifiers.PrimeField)) + { + BigInteger p = ((DerInteger)fieldID.Parameters).Value; + BigInteger A = new BigInteger(1, Asn1OctetString.GetInstance(seq[0]).GetOctets()); + BigInteger B = new BigInteger(1, Asn1OctetString.GetInstance(seq[1]).GetOctets()); + curve = new FpCurve(p, A, B, order, cofactor); + } + else if (fieldIdentifier.Equals(X9ObjectIdentifiers.CharacteristicTwoField)) + { + // Characteristic two field + DerSequence parameters = (DerSequence)fieldID.Parameters; + int m = ((DerInteger)parameters[0]).Value.IntValue; + DerObjectIdentifier representation + = (DerObjectIdentifier)parameters[1]; + + int k1 = 0; + int k2 = 0; + int k3 = 0; + if (representation.Equals(X9ObjectIdentifiers.TPBasis)) + { + // Trinomial basis representation + k1 = ((DerInteger)parameters[2]).Value.IntValue; + } + else + { + // Pentanomial basis representation + DerSequence pentanomial = (DerSequence) parameters[2]; + k1 = ((DerInteger) pentanomial[0]).Value.IntValue; + k2 = ((DerInteger) pentanomial[1]).Value.IntValue; + k3 = ((DerInteger) pentanomial[2]).Value.IntValue; + } + BigInteger A = new BigInteger(1, Asn1OctetString.GetInstance(seq[0]).GetOctets()); + BigInteger B = new BigInteger(1, Asn1OctetString.GetInstance(seq[1]).GetOctets()); + curve = new F2mCurve(m, k1, k2, k3, A, B, order, cofactor); + } + else + { + throw new ArgumentException("This type of ECCurve is not implemented"); + } + + if (seq.Count == 3) + { + seed = ((DerBitString)seq[2]).GetBytes(); + } + } + + public ECCurve Curve + { + get { return curve; } + } + + public byte[] GetSeed() + { + return Arrays.Clone(seed); + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  Curve ::= Sequence {
+         *      a               FieldElement,
+         *      b               FieldElement,
+         *      seed            BIT STRING      OPTIONAL
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + if (fieldIdentifier.Equals(X9ObjectIdentifiers.PrimeField) + || fieldIdentifier.Equals(X9ObjectIdentifiers.CharacteristicTwoField)) + { + v.Add(new X9FieldElement(curve.A).ToAsn1Object()); + v.Add(new X9FieldElement(curve.B).ToAsn1Object()); + } + + if (seed != null) + { + v.Add(new DerBitString(seed)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9Curve.cs.meta new file mode 100644 index 00000000..d214031a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f72ea46afaacfe4bbf9bb8fbff91598 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParameters.cs new file mode 100644 index 00000000..ea906171 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParameters.cs @@ -0,0 +1,234 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + /** + * ASN.1 def for Elliptic-Curve ECParameters structure. See + * X9.62, for further details. + */ + public class X9ECParameters + : Asn1Encodable + { + private X9FieldID fieldID; + private ECCurve curve; + private X9ECPoint g; + private BigInteger n; + private BigInteger h; + private byte[] seed; + + public static X9ECParameters GetInstance(Object obj) + { + if (obj is X9ECParameters) + return (X9ECParameters)obj; + + if (obj != null) + return new X9ECParameters(Asn1Sequence.GetInstance(obj)); + + return null; + } + + public X9ECParameters( + Asn1Sequence seq) + { + if (!(seq[0] is DerInteger) + || !((DerInteger)seq[0]).Value.Equals(BigInteger.One)) + { + throw new ArgumentException("bad version in X9ECParameters"); + } + + this.n = ((DerInteger)seq[4]).Value; + + if (seq.Count == 6) + { + this.h = ((DerInteger)seq[5]).Value; + } + + X9Curve x9c = new X9Curve( + X9FieldID.GetInstance(seq[1]), n, h, + Asn1Sequence.GetInstance(seq[2])); + + this.curve = x9c.Curve; + object p = seq[3]; + + if (p is X9ECPoint) + { + this.g = (X9ECPoint)p; + } + else + { + this.g = new X9ECPoint(curve, (Asn1OctetString)p); + } + + this.seed = x9c.GetSeed(); + } + + public X9ECParameters( + ECCurve curve, + ECPoint g, + BigInteger n) + : this(curve, g, n, null, null) + { + } + + public X9ECParameters( + ECCurve curve, + X9ECPoint g, + BigInteger n, + BigInteger h) + : this(curve, g, n, h, null) + { + } + + public X9ECParameters( + ECCurve curve, + ECPoint g, + BigInteger n, + BigInteger h) + : this(curve, g, n, h, null) + { + } + + public X9ECParameters( + ECCurve curve, + ECPoint g, + BigInteger n, + BigInteger h, + byte[] seed) + : this(curve, new X9ECPoint(g), n, h, seed) + { + } + + public X9ECParameters( + ECCurve curve, + X9ECPoint g, + BigInteger n, + BigInteger h, + byte[] seed) + { + this.curve = curve; + this.g = g; + this.n = n; + this.h = h; + this.seed = seed; + + if (ECAlgorithms.IsFpCurve(curve)) + { + this.fieldID = new X9FieldID(curve.Field.Characteristic); + } + else if (ECAlgorithms.IsF2mCurve(curve)) + { + IPolynomialExtensionField field = (IPolynomialExtensionField)curve.Field; + int[] exponents = field.MinimalPolynomial.GetExponentsPresent(); + if (exponents.Length == 3) + { + this.fieldID = new X9FieldID(exponents[2], exponents[1]); + } + else if (exponents.Length == 5) + { + this.fieldID = new X9FieldID(exponents[4], exponents[1], exponents[2], exponents[3]); + } + else + { + throw new ArgumentException("Only trinomial and pentomial curves are supported"); + } + } + else + { + throw new ArgumentException("'curve' is of an unsupported type"); + } + } + + public ECCurve Curve + { + get { return curve; } + } + + public ECPoint G + { + get { return g.Point; } + } + + public BigInteger N + { + get { return n; } + } + + public BigInteger H + { + get { return h; } + } + + public byte[] GetSeed() + { + return seed; + } + + /** + * Return the ASN.1 entry representing the Curve. + * + * @return the X9Curve for the curve in these parameters. + */ + public X9Curve CurveEntry + { + get { return new X9Curve(curve, seed); } + } + + /** + * Return the ASN.1 entry representing the FieldID. + * + * @return the X9FieldID for the FieldID in these parameters. + */ + public X9FieldID FieldIDEntry + { + get { return fieldID; } + } + + /** + * Return the ASN.1 entry representing the base point G. + * + * @return the X9ECPoint for the base point in these parameters. + */ + public X9ECPoint BaseEntry + { + get { return g; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  ECParameters ::= Sequence {
+         *      version         Integer { ecpVer1(1) } (ecpVer1),
+         *      fieldID         FieldID {{FieldTypes}},
+         *      curve           X9Curve,
+         *      base            X9ECPoint,
+         *      order           Integer,
+         *      cofactor        Integer OPTIONAL
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + Asn1EncodableVector v = new Asn1EncodableVector( + new DerInteger(BigInteger.One), + fieldID, + new X9Curve(curve, seed), + g, + new DerInteger(n)); + + if (h != null) + { + v.Add(new DerInteger(h)); + } + + return new DerSequence(v); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParameters.cs.meta new file mode 100644 index 00000000..88dd2e8c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68de537605868744dbde9c6576be1805 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParametersHolder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParametersHolder.cs new file mode 100644 index 00000000..5dba6b5e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParametersHolder.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + public abstract class X9ECParametersHolder + { + private X9ECParameters parameters; + + public X9ECParameters Parameters + { + get + { + lock (this) + { + if (parameters == null) + { + parameters = CreateParameters(); + } + + return parameters; + } + } + } + + protected abstract X9ECParameters CreateParameters(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParametersHolder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParametersHolder.cs.meta new file mode 100644 index 00000000..8ca72799 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECParametersHolder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2433893a590e27d438b5bc45cba65e36 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECPoint.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECPoint.cs new file mode 100644 index 00000000..7ccb21ce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECPoint.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + /** + * class for describing an ECPoint as a Der object. + */ + public class X9ECPoint + : Asn1Encodable + { + private readonly Asn1OctetString encoding; + + private ECCurve c; + private ECPoint p; + + public X9ECPoint(ECPoint p) + : this(p, false) + { + } + + public X9ECPoint(ECPoint p, bool compressed) + { + this.p = p.Normalize(); + this.encoding = new DerOctetString(p.GetEncoded(compressed)); + } + + public X9ECPoint(ECCurve c, byte[] encoding) + { + this.c = c; + this.encoding = new DerOctetString(Arrays.Clone(encoding)); + } + + public X9ECPoint(ECCurve c, Asn1OctetString s) + : this(c, s.GetOctets()) + { + } + + public byte[] GetPointEncoding() + { + return Arrays.Clone(encoding.GetOctets()); + } + + public ECPoint Point + { + get + { + if (p == null) + { + p = c.DecodePoint(encoding.GetOctets()).Normalize(); + } + + return p; + } + } + + public bool IsPointCompressed + { + get + { + byte[] octets = encoding.GetOctets(); + return octets != null && octets.Length > 0 && (octets[0] == 2 || octets[0] == 3); + } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  ECPoint ::= OCTET STRING
+         * 
+ *

+ * Octet string produced using ECPoint.GetEncoded().

+ */ + public override Asn1Object ToAsn1Object() + { + return encoding; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECPoint.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECPoint.cs.meta new file mode 100644 index 00000000..1fdf979e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ECPoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7836651622621b946bda8dac7d8d97e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldElement.cs new file mode 100644 index 00000000..e99c877f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldElement.cs @@ -0,0 +1,75 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + /** + * Class for processing an ECFieldElement as a DER object. + */ + public class X9FieldElement + : Asn1Encodable + { + private ECFieldElement f; + + public X9FieldElement( + ECFieldElement f) + { + this.f = f; + } + + [Obsolete("Will be removed")] + public X9FieldElement( + BigInteger p, + Asn1OctetString s) + : this(new FpFieldElement(p, new BigInteger(1, s.GetOctets()))) + { + } + + [Obsolete("Will be removed")] + public X9FieldElement( + int m, + int k1, + int k2, + int k3, + Asn1OctetString s) + : this(new F2mFieldElement(m, k1, k2, k3, new BigInteger(1, s.GetOctets()))) + { + } + + public ECFieldElement Value + { + get { return f; } + } + + /** + * Produce an object suitable for an Asn1OutputStream. + *
+         *  FieldElement ::= OCTET STRING
+         * 
+ *

+ *

    + *
  1. if q is an odd prime then the field element is + * processed as an Integer and converted to an octet string + * according to x 9.62 4.3.1.
  2. + *
  3. if q is 2m then the bit string + * contained in the field element is converted into an octet + * string with the same ordering padded at the front if necessary. + *
  4. + *
+ *

+ */ + public override Asn1Object ToAsn1Object() + { + int byteCount = X9IntegerConverter.GetByteLength(f); + byte[] paddedBigInteger = X9IntegerConverter.IntegerToBytes(f.ToBigInteger(), byteCount); + + return new DerOctetString(paddedBigInteger); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldElement.cs.meta new file mode 100644 index 00000000..1902c9bd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f9abf4b8380cc5f4fae08ae4356c3729 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldID.cs new file mode 100644 index 00000000..d58dc5c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldID.cs @@ -0,0 +1,136 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + /** + * ASN.1 def for Elliptic-Curve Field ID structure. See + * X9.62, for further details. + */ + public class X9FieldID + : Asn1Encodable + { + private readonly DerObjectIdentifier id; + private readonly Asn1Object parameters; + + /** + * Constructor for elliptic curves over prime fields + * F2. + * @param primeP The prime p defining the prime field. + */ + public X9FieldID( + BigInteger primeP) + { + this.id = X9ObjectIdentifiers.PrimeField; + this.parameters = new DerInteger(primeP); + } + + /** + * Constructor for elliptic curves over binary fields + * F2m. + * @param m The exponent m of + * F2m. + * @param k1 The integer k1 where xm + + * xk1 + 1 + * represents the reduction polynomial f(z). + */ + public X9FieldID(int m, int k1) + : this(m, k1, 0, 0) + { + } + + /** + * Constructor for elliptic curves over binary fields + * F2m. + * @param m The exponent m of + * F2m. + * @param k1 The integer k1 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param k2 The integer k2 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param k3 The integer k3 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z).. + */ + public X9FieldID( + int m, + int k1, + int k2, + int k3) + { + this.id = X9ObjectIdentifiers.CharacteristicTwoField; + + Asn1EncodableVector fieldIdParams = new Asn1EncodableVector(new DerInteger(m)); + + if (k2 == 0) + { + if (k3 != 0) + throw new ArgumentException("inconsistent k values"); + + fieldIdParams.Add( + X9ObjectIdentifiers.TPBasis, + new DerInteger(k1)); + } + else + { + if (k2 <= k1 || k3 <= k2) + throw new ArgumentException("inconsistent k values"); + + fieldIdParams.Add( + X9ObjectIdentifiers.PPBasis, + new DerSequence( + new DerInteger(k1), + new DerInteger(k2), + new DerInteger(k3))); + } + + this.parameters = new DerSequence(fieldIdParams); + } + + private X9FieldID(Asn1Sequence seq) + { + this.id = DerObjectIdentifier.GetInstance(seq[0]); + this.parameters = seq[1].ToAsn1Object(); + } + + public static X9FieldID GetInstance(object obj) + { + if (obj is X9FieldID) + return (X9FieldID)obj; + if (obj == null) + return null; + return new X9FieldID(Asn1Sequence.GetInstance(obj)); + } + + public DerObjectIdentifier Identifier + { + get { return id; } + } + + public Asn1Object Parameters + { + get { return parameters; } + } + + /** + * Produce a Der encoding of the following structure. + *
+         *  FieldID ::= Sequence {
+         *      fieldType       FIELD-ID.&id({IOSet}),
+         *      parameters      FIELD-ID.&Type({IOSet}{@fieldType})
+         *  }
+         * 
+ */ + public override Asn1Object ToAsn1Object() + { + return new DerSequence(id, parameters); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldID.cs.meta new file mode 100644 index 00000000..a1dba1e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9FieldID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6662fe1cbc846fc4ea6de22585a73840 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9IntegerConverter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9IntegerConverter.cs new file mode 100644 index 00000000..2a44d50f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9IntegerConverter.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + public abstract class X9IntegerConverter + { + public static int GetByteLength(ECFieldElement fe) + { + return (fe.FieldSize + 7) / 8; + } + + public static int GetByteLength(ECCurve c) + { + return (c.FieldSize + 7) / 8; + } + + public static byte[] IntegerToBytes(BigInteger s, int qLength) + { + byte[] bytes = s.ToByteArrayUnsigned(); + + if (qLength < bytes.Length) + { + byte[] tmp = new byte[qLength]; + Array.Copy(bytes, bytes.Length - tmp.Length, tmp, 0, tmp.Length); + return tmp; + } + else if (qLength > bytes.Length) + { + byte[] tmp = new byte[qLength]; + Array.Copy(bytes, 0, tmp, tmp.Length - bytes.Length, bytes.Length); + return tmp; + } + + return bytes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9IntegerConverter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9IntegerConverter.cs.meta new file mode 100644 index 00000000..93be4560 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9IntegerConverter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f767dcd9b1855b447b6bb009b1a39508 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ObjectIdentifiers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ObjectIdentifiers.cs new file mode 100644 index 00000000..759aa1f8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ObjectIdentifiers.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9 +{ + public abstract class X9ObjectIdentifiers + { + // + // X9.62 + // + // ansi-X9-62 OBJECT IDENTIFIER ::= { iso(1) member-body(2) + // us(840) ansi-x962(10045) } + // + + internal const string AnsiX962 = "1.2.840.10045"; + + public static readonly DerObjectIdentifier ansi_X9_62 = new DerObjectIdentifier(AnsiX962); + + public static readonly DerObjectIdentifier IdFieldType = ansi_X9_62.Branch("1"); + + public static readonly DerObjectIdentifier PrimeField = IdFieldType.Branch("1"); + public static readonly DerObjectIdentifier CharacteristicTwoField = IdFieldType.Branch("2"); + + public static readonly DerObjectIdentifier GNBasis = CharacteristicTwoField.Branch("3.1"); + public static readonly DerObjectIdentifier TPBasis = CharacteristicTwoField.Branch("3.2"); + public static readonly DerObjectIdentifier PPBasis = CharacteristicTwoField.Branch("3.3"); + + [Obsolete("Use 'id_ecSigType' instead")] + public const string IdECSigType = AnsiX962 + ".4"; + public static readonly DerObjectIdentifier id_ecSigType = ansi_X9_62.Branch("4"); + + public static readonly DerObjectIdentifier ECDsaWithSha1 = id_ecSigType.Branch("1"); + + [Obsolete("Use 'id_publicKeyType' instead")] + public const string IdPublicKeyType = AnsiX962 + ".2"; + public static readonly DerObjectIdentifier id_publicKeyType = ansi_X9_62.Branch("2"); + + public static readonly DerObjectIdentifier IdECPublicKey = id_publicKeyType.Branch("1"); + + public static readonly DerObjectIdentifier ECDsaWithSha2 = id_ecSigType.Branch("3"); + + public static readonly DerObjectIdentifier ECDsaWithSha224 = ECDsaWithSha2.Branch("1"); + public static readonly DerObjectIdentifier ECDsaWithSha256 = ECDsaWithSha2.Branch("2"); + public static readonly DerObjectIdentifier ECDsaWithSha384 = ECDsaWithSha2.Branch("3"); + public static readonly DerObjectIdentifier ECDsaWithSha512 = ECDsaWithSha2.Branch("4"); + + + // + // named curves + // + public static readonly DerObjectIdentifier EllipticCurve = ansi_X9_62.Branch("3"); + + // + // Two Curves + // + public static readonly DerObjectIdentifier CTwoCurve = EllipticCurve.Branch("0"); + + public static readonly DerObjectIdentifier C2Pnb163v1 = CTwoCurve.Branch("1"); + public static readonly DerObjectIdentifier C2Pnb163v2 = CTwoCurve.Branch("2"); + public static readonly DerObjectIdentifier C2Pnb163v3 = CTwoCurve.Branch("3"); + public static readonly DerObjectIdentifier C2Pnb176w1 = CTwoCurve.Branch("4"); + public static readonly DerObjectIdentifier C2Tnb191v1 = CTwoCurve.Branch("5"); + public static readonly DerObjectIdentifier C2Tnb191v2 = CTwoCurve.Branch("6"); + public static readonly DerObjectIdentifier C2Tnb191v3 = CTwoCurve.Branch("7"); + public static readonly DerObjectIdentifier C2Onb191v4 = CTwoCurve.Branch("8"); + public static readonly DerObjectIdentifier C2Onb191v5 = CTwoCurve.Branch("9"); + public static readonly DerObjectIdentifier C2Pnb208w1 = CTwoCurve.Branch("10"); + public static readonly DerObjectIdentifier C2Tnb239v1 = CTwoCurve.Branch("11"); + public static readonly DerObjectIdentifier C2Tnb239v2 = CTwoCurve.Branch("12"); + public static readonly DerObjectIdentifier C2Tnb239v3 = CTwoCurve.Branch("13"); + public static readonly DerObjectIdentifier C2Onb239v4 = CTwoCurve.Branch("14"); + public static readonly DerObjectIdentifier C2Onb239v5 = CTwoCurve.Branch("15"); + public static readonly DerObjectIdentifier C2Pnb272w1 = CTwoCurve.Branch("16"); + public static readonly DerObjectIdentifier C2Pnb304w1 = CTwoCurve.Branch("17"); + public static readonly DerObjectIdentifier C2Tnb359v1 = CTwoCurve.Branch("18"); + public static readonly DerObjectIdentifier C2Pnb368w1 = CTwoCurve.Branch("19"); + public static readonly DerObjectIdentifier C2Tnb431r1 = CTwoCurve.Branch("20"); + + // + // Prime + // + public static readonly DerObjectIdentifier PrimeCurve = EllipticCurve.Branch("1"); + + public static readonly DerObjectIdentifier Prime192v1 = PrimeCurve.Branch("1"); + public static readonly DerObjectIdentifier Prime192v2 = PrimeCurve.Branch("2"); + public static readonly DerObjectIdentifier Prime192v3 = PrimeCurve.Branch("3"); + public static readonly DerObjectIdentifier Prime239v1 = PrimeCurve.Branch("4"); + public static readonly DerObjectIdentifier Prime239v2 = PrimeCurve.Branch("5"); + public static readonly DerObjectIdentifier Prime239v3 = PrimeCurve.Branch("6"); + public static readonly DerObjectIdentifier Prime256v1 = PrimeCurve.Branch("7"); + + // + // DSA + // + // dsapublicnumber OBJECT IDENTIFIER ::= { iso(1) member-body(2) + // us(840) ansi-x957(10040) number-type(4) 1 } + public static readonly DerObjectIdentifier IdDsa = new DerObjectIdentifier("1.2.840.10040.4.1"); + + /** + * id-dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) + * us(840) x9-57 (10040) x9cm(4) 3 } + */ + public static readonly DerObjectIdentifier IdDsaWithSha1 = new DerObjectIdentifier("1.2.840.10040.4.3"); + + /** + * X9.63 + */ + public static readonly DerObjectIdentifier X9x63Scheme = new DerObjectIdentifier("1.3.133.16.840.63.0"); + public static readonly DerObjectIdentifier DHSinglePassStdDHSha1KdfScheme = X9x63Scheme.Branch("2"); + public static readonly DerObjectIdentifier DHSinglePassCofactorDHSha1KdfScheme = X9x63Scheme.Branch("3"); + public static readonly DerObjectIdentifier MqvSinglePassSha1KdfScheme = X9x63Scheme.Branch("16"); + + /** + * X9.42 + */ + + public static readonly DerObjectIdentifier ansi_x9_42 = new DerObjectIdentifier("1.2.840.10046"); + + // + // Diffie-Hellman + // + // dhpublicnumber OBJECT IDENTIFIER ::= { iso(1) member-body(2) + // us(840) ansi-x942(10046) number-type(2) 1 } + // + public static readonly DerObjectIdentifier DHPublicNumber = ansi_x9_42.Branch("2.1"); + + public static readonly DerObjectIdentifier X9x42Schemes = ansi_x9_42.Branch("2.3"); + + public static readonly DerObjectIdentifier DHStatic = X9x42Schemes.Branch("1"); + public static readonly DerObjectIdentifier DHEphem = X9x42Schemes.Branch("2"); + public static readonly DerObjectIdentifier DHOneFlow = X9x42Schemes.Branch("3"); + public static readonly DerObjectIdentifier DHHybrid1 = X9x42Schemes.Branch("4"); + public static readonly DerObjectIdentifier DHHybrid2 = X9x42Schemes.Branch("5"); + public static readonly DerObjectIdentifier DHHybridOneFlow = X9x42Schemes.Branch("6"); + public static readonly DerObjectIdentifier Mqv2 = X9x42Schemes.Branch("7"); + public static readonly DerObjectIdentifier Mqv1 = X9x42Schemes.Branch("8"); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ObjectIdentifiers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ObjectIdentifiers.cs.meta new file mode 100644 index 00000000..d0d8ceb7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/asn1/x9/X9ObjectIdentifiers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3dd6e9b31ef0ab041a24e2053602a746 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms.meta new file mode 100644 index 00000000..a3ed2cba --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: f144c257e1a71424f951705ca53cd339 +folderAsset: yes +timeCreated: 1547039641 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/BaseDigestCalculator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/BaseDigestCalculator.cs new file mode 100644 index 00000000..8ef4f375 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/BaseDigestCalculator.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal class BaseDigestCalculator + : IDigestCalculator + { + private readonly byte[] digest; + + internal BaseDigestCalculator( + byte[] digest) + { + this.digest = digest; + } + + public byte[] GetDigest() + { + return Arrays.Clone(digest); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/BaseDigestCalculator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/BaseDigestCalculator.cs.meta new file mode 100644 index 00000000..083540b4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/BaseDigestCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 52a4d50de29f4804b93120269066e5c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerationException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerationException.cs new file mode 100644 index 00000000..2aae9bd6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerationException.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CmsAttributeTableGenerationException + : CmsException + { + public CmsAttributeTableGenerationException() + { + } + + public CmsAttributeTableGenerationException( + string name) + : base(name) + { + } + + public CmsAttributeTableGenerationException( + string name, + Exception e) + : base(name, e) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerationException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerationException.cs.meta new file mode 100644 index 00000000..f8173df7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerationException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 95031575dd3091648956fd5b88a549f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerator.cs new file mode 100644 index 00000000..55132365 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerator.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /// + /// The 'Signature' parameter is only available when generating unsigned attributes. + /// + public enum CmsAttributeTableParameter + { +// const string ContentType = "contentType"; +// const string Digest = "digest"; +// const string Signature = "encryptedDigest"; +// const string DigestAlgorithmIdentifier = "digestAlgID"; + + ContentType, Digest, Signature, DigestAlgorithmIdentifier + } + + public interface CmsAttributeTableGenerator + { + AttributeTable GetAttributes(IDictionary parameters); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerator.cs.meta new file mode 100644 index 00000000..e220f7dd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAttributeTableGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d18c7fc2e70c2c4dbabd5bf8cadd733 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedData.cs new file mode 100644 index 00000000..a6830c90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedData.cs @@ -0,0 +1,116 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * containing class for an CMS AuthEnveloped Data object + */ + internal class CmsAuthEnvelopedData + { + internal RecipientInformationStore recipientInfoStore; + internal ContentInfo contentInfo; + + private OriginatorInfo originator; + private AlgorithmIdentifier authEncAlg; + private Asn1Set authAttrs; + private byte[] mac; + private Asn1Set unauthAttrs; + + public CmsAuthEnvelopedData( + byte[] authEnvData) + : this(CmsUtilities.ReadContentInfo(authEnvData)) + { + } + + public CmsAuthEnvelopedData( + Stream authEnvData) + : this(CmsUtilities.ReadContentInfo(authEnvData)) + { + } + + public CmsAuthEnvelopedData( + ContentInfo contentInfo) + { + this.contentInfo = contentInfo; + + AuthEnvelopedData authEnvData = AuthEnvelopedData.GetInstance(contentInfo.Content); + + this.originator = authEnvData.OriginatorInfo; + + // + // read the recipients + // + Asn1Set recipientInfos = authEnvData.RecipientInfos; + + // + // read the auth-encrypted content info + // + EncryptedContentInfo authEncInfo = authEnvData.AuthEncryptedContentInfo; + this.authEncAlg = authEncInfo.ContentEncryptionAlgorithm; + CmsSecureReadable secureReadable = new AuthEnvelopedSecureReadable(this); + + // + // build the RecipientInformationStore + // + this.recipientInfoStore = CmsEnvelopedHelper.BuildRecipientInformationStore( + recipientInfos, secureReadable); + + // FIXME These need to be passed to the AEAD cipher as AAD (Additional Authenticated Data) + this.authAttrs = authEnvData.AuthAttrs; + this.mac = authEnvData.Mac.GetOctets(); + this.unauthAttrs = authEnvData.UnauthAttrs; + } + + private class AuthEnvelopedSecureReadable : CmsSecureReadable + { + private readonly CmsAuthEnvelopedData parent; + + internal AuthEnvelopedSecureReadable(CmsAuthEnvelopedData parent) + { + this.parent = parent; + } + + public AlgorithmIdentifier Algorithm + { + get { return parent.authEncAlg; } + } + + public object CryptoObject + { + get { return null; } + } + + public CmsReadable GetReadable(KeyParameter key) + { + // TODO Create AEAD cipher instance to decrypt and calculate tag ( MAC) + throw new CmsException("AuthEnveloped data decryption not yet implemented"); + +// RFC 5084 ASN.1 Module +// -- Parameters for AlgorithmIdentifier +// +// CCMParameters ::= SEQUENCE { +// aes-nonce OCTET STRING (SIZE(7..13)), +// aes-ICVlen AES-CCM-ICVlen DEFAULT 12 } +// +// AES-CCM-ICVlen ::= INTEGER (4 | 6 | 8 | 10 | 12 | 14 | 16) +// +// GCMParameters ::= SEQUENCE { +// aes-nonce OCTET STRING, -- recommended size is 12 octets +// aes-ICVlen AES-GCM-ICVlen DEFAULT 12 } +// +// AES-GCM-ICVlen ::= INTEGER (12 | 13 | 14 | 15 | 16) + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedData.cs.meta new file mode 100644 index 00000000..532a7767 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7e3eb7a43c43e7c42aa4f8d9bd6ed4cd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedGenerator.cs new file mode 100644 index 00000000..1118ab17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedGenerator.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal class CmsAuthEnvelopedGenerator + { + public static readonly string Aes128Ccm = NistObjectIdentifiers.IdAes128Ccm.Id; + public static readonly string Aes192Ccm = NistObjectIdentifiers.IdAes192Ccm.Id; + public static readonly string Aes256Ccm = NistObjectIdentifiers.IdAes256Ccm.Id; + public static readonly string Aes128Gcm = NistObjectIdentifiers.IdAes128Gcm.Id; + public static readonly string Aes192Gcm = NistObjectIdentifiers.IdAes192Gcm.Id; + public static readonly string Aes256Gcm = NistObjectIdentifiers.IdAes256Gcm.Id; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedGenerator.cs.meta new file mode 100644 index 00000000..af7cbbff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthEnvelopedGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f95ee1f852b380e43ba55cdb0bad8129 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedData.cs new file mode 100644 index 00000000..873d9740 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedData.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * containing class for an CMS Authenticated Data object + */ + public class CmsAuthenticatedData + { + internal RecipientInformationStore recipientInfoStore; + internal ContentInfo contentInfo; + + private AlgorithmIdentifier macAlg; + private Asn1Set authAttrs; + private Asn1Set unauthAttrs; + private byte[] mac; + + public CmsAuthenticatedData( + byte[] authData) + : this(CmsUtilities.ReadContentInfo(authData)) + { + } + + public CmsAuthenticatedData( + Stream authData) + : this(CmsUtilities.ReadContentInfo(authData)) + { + } + + public CmsAuthenticatedData( + ContentInfo contentInfo) + { + this.contentInfo = contentInfo; + + AuthenticatedData authData = AuthenticatedData.GetInstance(contentInfo.Content); + + // + // read the recipients + // + Asn1Set recipientInfos = authData.RecipientInfos; + + this.macAlg = authData.MacAlgorithm; + + // + // read the authenticated content info + // + ContentInfo encInfo = authData.EncapsulatedContentInfo; + CmsReadable readable = new CmsProcessableByteArray( + Asn1OctetString.GetInstance(encInfo.Content).GetOctets()); + CmsSecureReadable secureReadable = new CmsEnvelopedHelper.CmsAuthenticatedSecureReadable( + this.macAlg, readable); + + // + // build the RecipientInformationStore + // + this.recipientInfoStore = CmsEnvelopedHelper.BuildRecipientInformationStore( + recipientInfos, secureReadable); + + this.authAttrs = authData.AuthAttrs; + this.mac = authData.Mac.GetOctets(); + this.unauthAttrs = authData.UnauthAttrs; + } + + public byte[] GetMac() + { + return Arrays.Clone(mac); + } + + public AlgorithmIdentifier MacAlgorithmID + { + get { return macAlg; } + } + + /** + * return the object identifier for the content MAC algorithm. + */ + public string MacAlgOid + { + get { return macAlg.Algorithm.Id; } + } + + /** + * return a store of the intended recipients for this message + */ + public RecipientInformationStore GetRecipientInfos() + { + return recipientInfoStore; + } + + /** + * return the ContentInfo + */ + public ContentInfo ContentInfo + { + get { return contentInfo; } + } + + /** + * return a table of the digested attributes indexed by + * the OID of the attribute. + */ + public Asn1.Cms.AttributeTable GetAuthAttrs() + { + if (authAttrs == null) + return null; + + return new Asn1.Cms.AttributeTable(authAttrs); + } + + /** + * return a table of the undigested attributes indexed by + * the OID of the attribute. + */ + public Asn1.Cms.AttributeTable GetUnauthAttrs() + { + if (unauthAttrs == null) + return null; + + return new Asn1.Cms.AttributeTable(unauthAttrs); + } + + /** + * return the ASN.1 encoded representation of this object. + */ + public byte[] GetEncoded() + { + return contentInfo.GetEncoded(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedData.cs.meta new file mode 100644 index 00000000..9f6aa5f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e4e8925a09aa9741ad59f650cda261e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataGenerator.cs new file mode 100644 index 00000000..4cb7d543 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataGenerator.cs @@ -0,0 +1,160 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * General class for generating a CMS authenticated-data message. + * + * A simple example of usage. + * + *
+	 *      CMSAuthenticatedDataGenerator  fact = new CMSAuthenticatedDataGenerator();
+	 *
+	 *      fact.addKeyTransRecipient(cert);
+	 *
+	 *      CMSAuthenticatedData         data = fact.generate(content, algorithm, "BC");
+	 * 
+ */ + public class CmsAuthenticatedDataGenerator + : CmsAuthenticatedGenerator + { + /** + * base constructor + */ + public CmsAuthenticatedDataGenerator() + { + } + + /** + * constructor allowing specific source of randomness + * @param rand instance of SecureRandom to use + */ + public CmsAuthenticatedDataGenerator( + SecureRandom rand) + : base(rand) + { + } + + /** + * generate an enveloped object that contains an CMS Enveloped Data + * object using the given provider and the passed in key generator. + */ + private CmsAuthenticatedData Generate( + CmsProcessable content, + string macOid, + CipherKeyGenerator keyGen) + { + AlgorithmIdentifier macAlgId; + KeyParameter encKey; + Asn1OctetString encContent; + Asn1OctetString macResult; + + try + { + // FIXME Will this work for macs? + byte[] encKeyBytes = keyGen.GenerateKey(); + encKey = ParameterUtilities.CreateKeyParameter(macOid, encKeyBytes); + + Asn1Encodable asn1Params = GenerateAsn1Parameters(macOid, encKeyBytes); + + ICipherParameters cipherParameters; + macAlgId = GetAlgorithmIdentifier( + macOid, encKey, asn1Params, out cipherParameters); + + IMac mac = MacUtilities.GetMac(macOid); + // TODO Confirm no ParametersWithRandom needed + // FIXME Only passing key at the moment +// mac.Init(cipherParameters); + mac.Init(encKey); + + MemoryStream bOut = new MemoryStream(); + Stream mOut = new TeeOutputStream(bOut, new MacSink(mac)); + + content.Write(mOut); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(mOut); + + encContent = new BerOctetString(bOut.ToArray()); + + byte[] macOctets = MacUtilities.DoFinal(mac); + macResult = new DerOctetString(macOctets); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } + catch (IOException e) + { + throw new CmsException("exception decoding algorithm parameters.", e); + } + + Asn1EncodableVector recipientInfos = new Asn1EncodableVector(); + + foreach (RecipientInfoGenerator rig in recipientInfoGenerators) + { + try + { + recipientInfos.Add(rig.Generate(encKey, rand)); + } + catch (InvalidKeyException e) + { + throw new CmsException("key inappropriate for algorithm.", e); + } + catch (GeneralSecurityException e) + { + throw new CmsException("error making encrypted content.", e); + } + } + + ContentInfo eci = new ContentInfo(CmsObjectIdentifiers.Data, encContent); + + ContentInfo contentInfo = new ContentInfo( + CmsObjectIdentifiers.AuthenticatedData, + new AuthenticatedData(null, new DerSet(recipientInfos), macAlgId, null, eci, null, macResult, null)); + + return new CmsAuthenticatedData(contentInfo); + } + + /** + * generate an authenticated object that contains an CMS Authenticated Data object + */ + public CmsAuthenticatedData Generate( + CmsProcessable content, + string encryptionOid) + { + try + { + // FIXME Will this work for macs? + CipherKeyGenerator keyGen = GeneratorUtilities.GetKeyGenerator(encryptionOid); + + keyGen.Init(new KeyGenerationParameters(rand, keyGen.DefaultStrength)); + + return Generate(content, encryptionOid, keyGen); + } + catch (SecurityUtilityException e) + { + throw new CmsException("can't find key generation algorithm.", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataGenerator.cs.meta new file mode 100644 index 00000000..b9390d76 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a8b41fa9a2f17b45ba2fd190514a66c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataParser.cs new file mode 100644 index 00000000..6198e343 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataParser.cs @@ -0,0 +1,218 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * Parsing class for an CMS Authenticated Data object from an input stream. + *

+ * Note: that because we are in a streaming mode only one recipient can be tried and it is important + * that the methods on the parser are called in the appropriate order. + *

+ *

+ * Example of use - assuming the first recipient matches the private key we have. + *

+	*      CMSAuthenticatedDataParser     ad = new CMSAuthenticatedDataParser(inputStream);
+	*
+	*      RecipientInformationStore  recipients = ad.getRecipientInfos();
+	*
+	*      Collection  c = recipients.getRecipients();
+	*      Iterator    it = c.iterator();
+	*
+	*      if (it.hasNext())
+	*      {
+	*          RecipientInformation   recipient = (RecipientInformation)it.next();
+	*
+	*          CMSTypedStream recData = recipient.getContentStream(privateKey, "BC");
+	*
+	*          processDataStream(recData.getContentStream());
+	*
+	*          if (!Arrays.equals(ad.getMac(), recipient.getMac())
+	*          {
+	*              System.err.println("Data corrupted!!!!");
+	*          }
+	*      }
+	*  
+ * Note: this class does not introduce buffering - if you are processing large files you should create + * the parser with: + *
+	*          CMSAuthenticatedDataParser     ep = new CMSAuthenticatedDataParser(new BufferedInputStream(inputStream, bufSize));
+	*  
+ * where bufSize is a suitably large buffer size. + *

+ */ + public class CmsAuthenticatedDataParser + : CmsContentInfoParser + { + internal RecipientInformationStore _recipientInfoStore; + internal AuthenticatedDataParser authData; + + private AlgorithmIdentifier macAlg; + private byte[] mac; + private Asn1.Cms.AttributeTable authAttrs; + private Asn1.Cms.AttributeTable unauthAttrs; + + private bool authAttrNotRead; + private bool unauthAttrNotRead; + + public CmsAuthenticatedDataParser( + byte[] envelopedData) + : this(new MemoryStream(envelopedData, false)) + { + } + + public CmsAuthenticatedDataParser( + Stream envelopedData) + : base(envelopedData) + { + this.authAttrNotRead = true; + this.authData = new AuthenticatedDataParser( + (Asn1SequenceParser)contentInfo.GetContent(Asn1Tags.Sequence)); + + // TODO Validate version? + //DerInteger version = this.authData.getVersion(); + + // + // read the recipients + // + Asn1Set recipientInfos = Asn1Set.GetInstance(authData.GetRecipientInfos().ToAsn1Object()); + + this.macAlg = authData.GetMacAlgorithm(); + + // + // read the authenticated content info + // + ContentInfoParser data = authData.GetEnapsulatedContentInfo(); + CmsReadable readable = new CmsProcessableInputStream( + ((Asn1OctetStringParser)data.GetContent(Asn1Tags.OctetString)).GetOctetStream()); + CmsSecureReadable secureReadable = new CmsEnvelopedHelper.CmsAuthenticatedSecureReadable( + this.macAlg, readable); + + // + // build the RecipientInformationStore + // + this._recipientInfoStore = CmsEnvelopedHelper.BuildRecipientInformationStore( + recipientInfos, secureReadable); + } + + public AlgorithmIdentifier MacAlgorithmID + { + get { return macAlg; } + } + + /** + * return the object identifier for the mac algorithm. + */ + public string MacAlgOid + { + get { return macAlg.Algorithm.Id; } + } + + + /** + * return the ASN.1 encoded encryption algorithm parameters, or null if + * there aren't any. + */ + public Asn1Object MacAlgParams + { + get + { + Asn1Encodable ae = macAlg.Parameters; + + return ae == null ? null : ae.ToAsn1Object(); + } + } + + /** + * return a store of the intended recipients for this message + */ + public RecipientInformationStore GetRecipientInfos() + { + return _recipientInfoStore; + } + + public byte[] GetMac() + { + if (mac == null) + { + GetAuthAttrs(); + mac = authData.GetMac().GetOctets(); + } + return Arrays.Clone(mac); + } + + /** + * return a table of the unauthenticated attributes indexed by + * the OID of the attribute. + * @exception java.io.IOException + */ + public Asn1.Cms.AttributeTable GetAuthAttrs() + { + if (authAttrs == null && authAttrNotRead) + { + Asn1SetParser s = authData.GetAuthAttrs(); + + authAttrNotRead = false; + + if (s != null) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + IAsn1Convertible o; + while ((o = s.ReadObject()) != null) + { + Asn1SequenceParser seq = (Asn1SequenceParser)o; + + v.Add(seq.ToAsn1Object()); + } + + authAttrs = new Asn1.Cms.AttributeTable(new DerSet(v)); + } + } + + return authAttrs; + } + + /** + * return a table of the unauthenticated attributes indexed by + * the OID of the attribute. + * @exception java.io.IOException + */ + public Asn1.Cms.AttributeTable GetUnauthAttrs() + { + if (unauthAttrs == null && unauthAttrNotRead) + { + Asn1SetParser s = authData.GetUnauthAttrs(); + + unauthAttrNotRead = false; + + if (s != null) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + IAsn1Convertible o; + while ((o = s.ReadObject()) != null) + { + Asn1SequenceParser seq = (Asn1SequenceParser)o; + + v.Add(seq.ToAsn1Object()); + } + + unauthAttrs = new Asn1.Cms.AttributeTable(new DerSet(v)); + } + } + + return unauthAttrs; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataParser.cs.meta new file mode 100644 index 00000000..d46dd700 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 08feb4ccaf441894b9a5692041fb9168 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataStreamGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataStreamGenerator.cs new file mode 100644 index 00000000..7d13e8f0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataStreamGenerator.cs @@ -0,0 +1,301 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * General class for generating a CMS authenticated-data message stream. + *

+ * A simple example of usage. + *

+	*      CMSAuthenticatedDataStreamGenerator edGen = new CMSAuthenticatedDataStreamGenerator();
+	*
+	*      edGen.addKeyTransRecipient(cert);
+	*
+	*      ByteArrayOutputStream  bOut = new ByteArrayOutputStream();
+	*
+	*      OutputStream out = edGen.open(
+	*                              bOut, CMSAuthenticatedDataGenerator.AES128_CBC, "BC");*
+	*      out.write(data);
+	*
+	*      out.close();
+	* 
+ *

+ */ + public class CmsAuthenticatedDataStreamGenerator + : CmsAuthenticatedGenerator + { + // TODO Add support +// private object _originatorInfo = null; +// private object _unprotectedAttributes = null; + private int _bufferSize; + private bool _berEncodeRecipientSet; + + /** + * base constructor + */ + public CmsAuthenticatedDataStreamGenerator() + { + } + + /** + * constructor allowing specific source of randomness + * @param rand instance of SecureRandom to use + */ + public CmsAuthenticatedDataStreamGenerator( + SecureRandom rand) + : base(rand) + { + } + + /** + * Set the underlying string size for encapsulated data + * + * @param bufferSize length of octet strings to buffer the data. + */ + public void SetBufferSize( + int bufferSize) + { + _bufferSize = bufferSize; + } + + /** + * Use a BER Set to store the recipient information + */ + public void SetBerEncodeRecipients( + bool berEncodeRecipientSet) + { + _berEncodeRecipientSet = berEncodeRecipientSet; + } + + /** + * generate an enveloped object that contains an CMS Enveloped Data + * object using the given provider and the passed in key generator. + * @throws java.io.IOException + */ + private Stream Open( + Stream outStr, + string macOid, + CipherKeyGenerator keyGen) + { + // FIXME Will this work for macs? + byte[] encKeyBytes = keyGen.GenerateKey(); + KeyParameter encKey = ParameterUtilities.CreateKeyParameter(macOid, encKeyBytes); + + Asn1Encodable asn1Params = GenerateAsn1Parameters(macOid, encKeyBytes); + + ICipherParameters cipherParameters; + AlgorithmIdentifier macAlgId = GetAlgorithmIdentifier( + macOid, encKey, asn1Params, out cipherParameters); + + Asn1EncodableVector recipientInfos = new Asn1EncodableVector(); + + foreach (RecipientInfoGenerator rig in recipientInfoGenerators) + { + try + { + recipientInfos.Add(rig.Generate(encKey, rand)); + } + catch (InvalidKeyException e) + { + throw new CmsException("key inappropriate for algorithm.", e); + } + catch (GeneralSecurityException e) + { + throw new CmsException("error making encrypted content.", e); + } + } + + // FIXME Only passing key at the moment +// return Open(outStr, macAlgId, cipherParameters, recipientInfos); + return Open(outStr, macAlgId, encKey, recipientInfos); + } + + protected Stream Open( + Stream outStr, + AlgorithmIdentifier macAlgId, + ICipherParameters cipherParameters, + Asn1EncodableVector recipientInfos) + { + try + { + // + // ContentInfo + // + BerSequenceGenerator cGen = new BerSequenceGenerator(outStr); + + cGen.AddObject(CmsObjectIdentifiers.AuthenticatedData); + + // + // Authenticated Data + // + BerSequenceGenerator authGen = new BerSequenceGenerator( + cGen.GetRawOutputStream(), 0, true); + + authGen.AddObject(new DerInteger(AuthenticatedData.CalculateVersion(null))); + + Stream authRaw = authGen.GetRawOutputStream(); + Asn1Generator recipGen = _berEncodeRecipientSet + ? (Asn1Generator) new BerSetGenerator(authRaw) + : new DerSetGenerator(authRaw); + + foreach (Asn1Encodable ae in recipientInfos) + { + recipGen.AddObject(ae); + } + + recipGen.Close(); + + authGen.AddObject(macAlgId); + + BerSequenceGenerator eiGen = new BerSequenceGenerator(authRaw); + eiGen.AddObject(CmsObjectIdentifiers.Data); + + Stream octetOutputStream = CmsUtilities.CreateBerOctetOutputStream( + eiGen.GetRawOutputStream(), 0, false, _bufferSize); + + IMac mac = MacUtilities.GetMac(macAlgId.Algorithm); + // TODO Confirm no ParametersWithRandom needed + mac.Init(cipherParameters); + Stream mOut = new TeeOutputStream(octetOutputStream, new MacSink(mac)); + + return new CmsAuthenticatedDataOutputStream(mOut, mac, cGen, authGen, eiGen); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } + catch (IOException e) + { + throw new CmsException("exception decoding algorithm parameters.", e); + } + } + + /** + * generate an enveloped object that contains an CMS Enveloped Data object + */ + public Stream Open( + Stream outStr, + string encryptionOid) + { + CipherKeyGenerator keyGen = GeneratorUtilities.GetKeyGenerator(encryptionOid); + + keyGen.Init(new KeyGenerationParameters(rand, keyGen.DefaultStrength)); + + return Open(outStr, encryptionOid, keyGen); + } + + /** + * generate an enveloped object that contains an CMS Enveloped Data object + */ + public Stream Open( + Stream outStr, + string encryptionOid, + int keySize) + { + CipherKeyGenerator keyGen = GeneratorUtilities.GetKeyGenerator(encryptionOid); + + keyGen.Init(new KeyGenerationParameters(rand, keySize)); + + return Open(outStr, encryptionOid, keyGen); + } + + private class CmsAuthenticatedDataOutputStream + : BaseOutputStream + { + private readonly Stream macStream; + private readonly IMac mac; + private readonly BerSequenceGenerator cGen; + private readonly BerSequenceGenerator authGen; + private readonly BerSequenceGenerator eiGen; + + public CmsAuthenticatedDataOutputStream( + Stream macStream, + IMac mac, + BerSequenceGenerator cGen, + BerSequenceGenerator authGen, + BerSequenceGenerator eiGen) + { + this.macStream = macStream; + this.mac = mac; + this.cGen = cGen; + this.authGen = authGen; + this.eiGen = eiGen; + } + + public override void WriteByte( + byte b) + { + macStream.WriteByte(b); + } + + public override void Write( + byte[] bytes, + int off, + int len) + { + macStream.Write(bytes, off, len); + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(macStream); + + // TODO Parent context(s) should really be be closed explicitly + + eiGen.Close(); + + // [TODO] auth attributes go here + byte[] macOctets = MacUtilities.DoFinal(mac); + authGen.AddObject(new DerOctetString(macOctets)); + // [TODO] unauth attributes go here + + authGen.Close(); + cGen.Close(); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(macStream); + + // TODO Parent context(s) should really be be closed explicitly + + eiGen.Close(); + + // [TODO] auth attributes go here + byte[] macOctets = MacUtilities.DoFinal(mac); + authGen.AddObject(new DerOctetString(macOctets)); + // [TODO] unauth attributes go here + + authGen.Close(); + cGen.Close(); + base.Close(); + } +#endif + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataStreamGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataStreamGenerator.cs.meta new file mode 100644 index 00000000..3bb3114c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedDataStreamGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c74bee6672ed33d4484fbb4d444253e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedGenerator.cs new file mode 100644 index 00000000..e8a8e3ac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedGenerator.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class CmsAuthenticatedGenerator + : CmsEnvelopedGenerator + { + /** + * base constructor + */ + public CmsAuthenticatedGenerator() + { + } + + /** + * constructor allowing specific source of randomness + * + * @param rand instance of SecureRandom to use + */ + public CmsAuthenticatedGenerator( + SecureRandom rand) + : base(rand) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedGenerator.cs.meta new file mode 100644 index 00000000..5f0fa32c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSAuthenticatedGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37764ed0474059d4cb0346705d807def +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedData.cs new file mode 100644 index 00000000..c97ad667 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedData.cs @@ -0,0 +1,112 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * containing class for an CMS Compressed Data object + */ + public class CmsCompressedData + { + internal ContentInfo contentInfo; + + public CmsCompressedData( + byte[] compressedData) + : this(CmsUtilities.ReadContentInfo(compressedData)) + { + } + + public CmsCompressedData( + Stream compressedDataStream) + : this(CmsUtilities.ReadContentInfo(compressedDataStream)) + { + } + + public CmsCompressedData( + ContentInfo contentInfo) + { + this.contentInfo = contentInfo; + } + + /** + * Return the uncompressed content. + * + * @return the uncompressed content + * @throws CmsException if there is an exception uncompressing the data. + */ + public byte[] GetContent() + { + CompressedData comData = CompressedData.GetInstance(contentInfo.Content); + ContentInfo content = comData.EncapContentInfo; + + Asn1OctetString bytes = (Asn1OctetString) content.Content; + ZInputStream zIn = new ZInputStream(bytes.GetOctetStream()); + + try + { + return CmsUtilities.StreamToByteArray(zIn); + } + catch (IOException e) + { + throw new CmsException("exception reading compressed stream.", e); + } + finally + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(zIn); + } + } + + /** + * Return the uncompressed content, throwing an exception if the data size + * is greater than the passed in limit. If the content is exceeded getCause() + * on the CMSException will contain a StreamOverflowException + * + * @param limit maximum number of bytes to read + * @return the content read + * @throws CMSException if there is an exception uncompressing the data. + */ + public byte[] GetContent(int limit) + { + CompressedData comData = CompressedData.GetInstance(contentInfo.Content); + ContentInfo content = comData.EncapContentInfo; + + Asn1OctetString bytes = (Asn1OctetString)content.Content; + + ZInputStream zIn = new ZInputStream(new MemoryStream(bytes.GetOctets(), false)); + + try + { + return CmsUtilities.StreamToByteArray(zIn, limit); + } + catch (IOException e) + { + throw new CmsException("exception reading compressed stream.", e); + } + } + + /** + * return the ContentInfo + */ + public ContentInfo ContentInfo + { + get { return contentInfo; } + } + + /** + * return the ASN.1 encoded representation of this object. + */ + public byte[] GetEncoded() + { + return contentInfo.GetEncoded(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedData.cs.meta new file mode 100644 index 00000000..440d689e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4cbc55acb9953154086972e91a119005 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataGenerator.cs new file mode 100644 index 00000000..0ed4a4fd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataGenerator.cs @@ -0,0 +1,71 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * General class for generating a compressed CMS message. + *

+ * A simple example of usage.

+ *

+ *

+    *      CMSCompressedDataGenerator fact = new CMSCompressedDataGenerator();
+    *      CMSCompressedData data = fact.Generate(content, algorithm);
+    * 
+ *

+ */ + public class CmsCompressedDataGenerator + { + public const string ZLib = "1.2.840.113549.1.9.16.3.8"; + + public CmsCompressedDataGenerator() + { + } + + /** + * Generate an object that contains an CMS Compressed Data + */ + public CmsCompressedData Generate( + CmsProcessable content, + string compressionOid) + { + AlgorithmIdentifier comAlgId; + Asn1OctetString comOcts; + + try + { + MemoryStream bOut = new MemoryStream(); + ZOutputStream zOut = new ZOutputStream(bOut, JZlib.Z_DEFAULT_COMPRESSION); + + content.Write(zOut); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(zOut); + + comAlgId = new AlgorithmIdentifier(new DerObjectIdentifier(compressionOid)); + comOcts = new BerOctetString(bOut.ToArray()); + } + catch (IOException e) + { + throw new CmsException("exception encoding data.", e); + } + + ContentInfo comContent = new ContentInfo(CmsObjectIdentifiers.Data, comOcts); + ContentInfo contentInfo = new ContentInfo( + CmsObjectIdentifiers.CompressedData, + new CompressedData(comAlgId, comContent)); + + return new CmsCompressedData(contentInfo); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataGenerator.cs.meta new file mode 100644 index 00000000..4ebd32f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7769c99d12beb884b8c70fd13c920cbf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataParser.cs new file mode 100644 index 00000000..a44d9109 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataParser.cs @@ -0,0 +1,61 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * Class for reading a CMS Compressed Data stream. + *
+    *     CMSCompressedDataParser cp = new CMSCompressedDataParser(inputStream);
+    *
+    *     process(cp.GetContent().GetContentStream());
+    * 
+ * Note: this class does not introduce buffering - if you are processing large files you should create + * the parser with: + *
+    *      CMSCompressedDataParser     ep = new CMSCompressedDataParser(new BufferedInputStream(inputStream, bufSize));
+    *  
+ * where bufSize is a suitably large buffer size. + */ + public class CmsCompressedDataParser + : CmsContentInfoParser + { + public CmsCompressedDataParser( + byte[] compressedData) + : this(new MemoryStream(compressedData, false)) + { + } + + public CmsCompressedDataParser( + Stream compressedData) + : base(compressedData) + { + } + + public CmsTypedStream GetContent() + { + try + { + CompressedDataParser comData = new CompressedDataParser((Asn1SequenceParser)this.contentInfo.GetContent(Asn1Tags.Sequence)); + ContentInfoParser content = comData.GetEncapContentInfo(); + + Asn1OctetStringParser bytes = (Asn1OctetStringParser)content.GetContent(Asn1Tags.OctetString); + + return new CmsTypedStream(content.ContentType.ToString(), new ZInputStream(bytes.GetOctetStream())); + } + catch (IOException e) + { + throw new CmsException("IOException reading compressed content.", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataParser.cs.meta new file mode 100644 index 00000000..d1f5559d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 622eaf613f9bfed4bad33078ade6c789 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataStreamGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataStreamGenerator.cs new file mode 100644 index 00000000..d55df66e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataStreamGenerator.cs @@ -0,0 +1,162 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * General class for generating a compressed CMS message stream. + *

+ * A simple example of usage. + *

+ *
+	*      CMSCompressedDataStreamGenerator gen = new CMSCompressedDataStreamGenerator();
+	*
+	*      Stream cOut = gen.Open(outputStream, CMSCompressedDataStreamGenerator.ZLIB);
+	*
+	*      cOut.Write(data);
+	*
+	*      cOut.Close();
+	* 
+ */ + public class CmsCompressedDataStreamGenerator + { + public const string ZLib = "1.2.840.113549.1.9.16.3.8"; + + private int _bufferSize; + + /** + * base constructor + */ + public CmsCompressedDataStreamGenerator() + { + } + + /** + * Set the underlying string size for encapsulated data + * + * @param bufferSize length of octet strings to buffer the data. + */ + public void SetBufferSize( + int bufferSize) + { + _bufferSize = bufferSize; + } + + public Stream Open( + Stream outStream, + string compressionOID) + { + return Open(outStream, CmsObjectIdentifiers.Data.Id, compressionOID); + } + + public Stream Open( + Stream outStream, + string contentOID, + string compressionOID) + { + BerSequenceGenerator sGen = new BerSequenceGenerator(outStream); + + sGen.AddObject(CmsObjectIdentifiers.CompressedData); + + // + // Compressed Data + // + BerSequenceGenerator cGen = new BerSequenceGenerator( + sGen.GetRawOutputStream(), 0, true); + + // CMSVersion + cGen.AddObject(new DerInteger(0)); + + // CompressionAlgorithmIdentifier + cGen.AddObject(new AlgorithmIdentifier(new DerObjectIdentifier(ZLib))); + + // + // Encapsulated ContentInfo + // + BerSequenceGenerator eiGen = new BerSequenceGenerator(cGen.GetRawOutputStream()); + + eiGen.AddObject(new DerObjectIdentifier(contentOID)); + + Stream octetStream = CmsUtilities.CreateBerOctetOutputStream( + eiGen.GetRawOutputStream(), 0, true, _bufferSize); + + return new CmsCompressedOutputStream( + new ZOutputStream(octetStream, JZlib.Z_DEFAULT_COMPRESSION), sGen, cGen, eiGen); + } + + private class CmsCompressedOutputStream + : BaseOutputStream + { + private ZOutputStream _out; + private BerSequenceGenerator _sGen; + private BerSequenceGenerator _cGen; + private BerSequenceGenerator _eiGen; + + internal CmsCompressedOutputStream( + ZOutputStream outStream, + BerSequenceGenerator sGen, + BerSequenceGenerator cGen, + BerSequenceGenerator eiGen) + { + _out = outStream; + _sGen = sGen; + _cGen = cGen; + _eiGen = eiGen; + } + + public override void WriteByte( + byte b) + { + _out.WriteByte(b); + } + + public override void Write( + byte[] bytes, + int off, + int len) + { + _out.Write(bytes, off, len); + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(_out); + + // TODO Parent context(s) should really be be closed explicitly + + _eiGen.Close(); + _cGen.Close(); + _sGen.Close(); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(_out); + + // TODO Parent context(s) should really be be closed explicitly + + _eiGen.Close(); + _cGen.Close(); + _sGen.Close(); + base.Close(); + } +#endif + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataStreamGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataStreamGenerator.cs.meta new file mode 100644 index 00000000..4f78c932 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSCompressedDataStreamGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d91ec399f12b551429fc03e870166006 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSContentInfoParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSContentInfoParser.cs new file mode 100644 index 00000000..3357048b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSContentInfoParser.cs @@ -0,0 +1,52 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class CmsContentInfoParser + { + protected ContentInfoParser contentInfo; + protected Stream data; + + protected CmsContentInfoParser( + Stream data) + { + if (data == null) + throw new ArgumentNullException("data"); + + this.data = data; + + try + { + Asn1StreamParser inStream = new Asn1StreamParser(data); + + this.contentInfo = new ContentInfoParser((Asn1SequenceParser)inStream.ReadObject()); + } + catch (IOException e) + { + throw new CmsException("IOException reading content.", e); + } + catch (InvalidCastException e) + { + throw new CmsException("Unexpected object reading content.", e); + } + } + + /** + * Close the underlying data stream. + * @throws IOException if the close fails. + */ + public void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(this.data); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSContentInfoParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSContentInfoParser.cs.meta new file mode 100644 index 00000000..840b2f57 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSContentInfoParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e4a4f23cbc361fd44aea8365372784a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedData.cs new file mode 100644 index 00000000..cf9570ba --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedData.cs @@ -0,0 +1,119 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * containing class for an CMS Enveloped Data object + */ + public class CmsEnvelopedData + { + internal RecipientInformationStore recipientInfoStore; + internal ContentInfo contentInfo; + + private AlgorithmIdentifier encAlg; + private Asn1Set unprotectedAttributes; + + public CmsEnvelopedData( + byte[] envelopedData) + : this(CmsUtilities.ReadContentInfo(envelopedData)) + { + } + + public CmsEnvelopedData( + Stream envelopedData) + : this(CmsUtilities.ReadContentInfo(envelopedData)) + { + } + + public CmsEnvelopedData( + ContentInfo contentInfo) + { + this.contentInfo = contentInfo; + + EnvelopedData envData = EnvelopedData.GetInstance(contentInfo.Content); + + // + // read the recipients + // + Asn1Set recipientInfos = envData.RecipientInfos; + + // + // read the encrypted content info + // + EncryptedContentInfo encInfo = envData.EncryptedContentInfo; + this.encAlg = encInfo.ContentEncryptionAlgorithm; + CmsReadable readable = new CmsProcessableByteArray(encInfo.EncryptedContent.GetOctets()); + CmsSecureReadable secureReadable = new CmsEnvelopedHelper.CmsEnvelopedSecureReadable( + this.encAlg, readable); + + // + // build the RecipientInformationStore + // + this.recipientInfoStore = CmsEnvelopedHelper.BuildRecipientInformationStore( + recipientInfos, secureReadable); + + this.unprotectedAttributes = envData.UnprotectedAttrs; + } + + public AlgorithmIdentifier EncryptionAlgorithmID + { + get { return encAlg; } + } + + /** + * return the object identifier for the content encryption algorithm. + */ + public string EncryptionAlgOid + { + get { return encAlg.Algorithm.Id; } + } + + /** + * return a store of the intended recipients for this message + */ + public RecipientInformationStore GetRecipientInfos() + { + return recipientInfoStore; + } + + /** + * return the ContentInfo + */ + public ContentInfo ContentInfo + { + get { return contentInfo; } + } + + /** + * return a table of the unprotected attributes indexed by + * the OID of the attribute. + */ + public Asn1.Cms.AttributeTable GetUnprotectedAttributes() + { + if (unprotectedAttributes == null) + return null; + + return new Asn1.Cms.AttributeTable(unprotectedAttributes); + } + + /** + * return the ASN.1 encoded representation of this object. + */ + public byte[] GetEncoded() + { + return contentInfo.GetEncoded(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedData.cs.meta new file mode 100644 index 00000000..68ffdfb2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ea637f918b56de47aab71d1b268782a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataGenerator.cs new file mode 100644 index 00000000..992b44a3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataGenerator.cs @@ -0,0 +1,182 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /// + /// General class for generating a CMS enveloped-data message. + /// + /// A simple example of usage. + /// + ///
+    ///      CmsEnvelopedDataGenerator  fact = new CmsEnvelopedDataGenerator();
+    ///
+    ///      fact.AddKeyTransRecipient(cert);
+    ///
+    ///      CmsEnvelopedData         data = fact.Generate(content, algorithm);
+    /// 
+ ///
+ public class CmsEnvelopedDataGenerator + : CmsEnvelopedGenerator + { + public CmsEnvelopedDataGenerator() + { + } + + /// Constructor allowing specific source of randomness + /// Instance of SecureRandom to use. + public CmsEnvelopedDataGenerator( + SecureRandom rand) + : base(rand) + { + } + + /// + /// Generate an enveloped object that contains a CMS Enveloped Data + /// object using the passed in key generator. + /// + private CmsEnvelopedData Generate( + CmsProcessable content, + string encryptionOid, + CipherKeyGenerator keyGen) + { + AlgorithmIdentifier encAlgId = null; + KeyParameter encKey; + Asn1OctetString encContent; + + try + { + byte[] encKeyBytes = keyGen.GenerateKey(); + encKey = ParameterUtilities.CreateKeyParameter(encryptionOid, encKeyBytes); + + Asn1Encodable asn1Params = GenerateAsn1Parameters(encryptionOid, encKeyBytes); + + ICipherParameters cipherParameters; + encAlgId = GetAlgorithmIdentifier( + encryptionOid, encKey, asn1Params, out cipherParameters); + + IBufferedCipher cipher = CipherUtilities.GetCipher(encryptionOid); + cipher.Init(true, new ParametersWithRandom(cipherParameters, rand)); + + MemoryStream bOut = new MemoryStream(); + CipherStream cOut = new CipherStream(bOut, null, cipher); + + content.Write(cOut); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(cOut); + + encContent = new BerOctetString(bOut.ToArray()); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } + catch (IOException e) + { + throw new CmsException("exception decoding algorithm parameters.", e); + } + + + Asn1EncodableVector recipientInfos = new Asn1EncodableVector(); + + foreach (RecipientInfoGenerator rig in recipientInfoGenerators) + { + try + { + recipientInfos.Add(rig.Generate(encKey, rand)); + } + catch (InvalidKeyException e) + { + throw new CmsException("key inappropriate for algorithm.", e); + } + catch (GeneralSecurityException e) + { + throw new CmsException("error making encrypted content.", e); + } + } + + EncryptedContentInfo eci = new EncryptedContentInfo( + CmsObjectIdentifiers.Data, + encAlgId, + encContent); + + Asn1Set unprotectedAttrSet = null; + if (unprotectedAttributeGenerator != null) + { + Asn1.Cms.AttributeTable attrTable = unprotectedAttributeGenerator.GetAttributes(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable()); + + unprotectedAttrSet = new BerSet(attrTable.ToAsn1EncodableVector()); + } + + ContentInfo contentInfo = new ContentInfo( + CmsObjectIdentifiers.EnvelopedData, + new EnvelopedData(null, new DerSet(recipientInfos), eci, unprotectedAttrSet)); + + return new CmsEnvelopedData(contentInfo); + } + + /// Generate an enveloped object that contains an CMS Enveloped Data object. + public CmsEnvelopedData Generate( + CmsProcessable content, + string encryptionOid) + { + try + { + CipherKeyGenerator keyGen = GeneratorUtilities.GetKeyGenerator(encryptionOid); + + keyGen.Init(new KeyGenerationParameters(rand, keyGen.DefaultStrength)); + + return Generate(content, encryptionOid, keyGen); + } + catch (SecurityUtilityException e) + { + throw new CmsException("can't find key generation algorithm.", e); + } + } + + /// Generate an enveloped object that contains an CMS Enveloped Data object. + public CmsEnvelopedData Generate( + CmsProcessable content, + string encryptionOid, + int keySize) + { + try + { + CipherKeyGenerator keyGen = GeneratorUtilities.GetKeyGenerator(encryptionOid); + + keyGen.Init(new KeyGenerationParameters(rand, keySize)); + + return Generate(content, encryptionOid, keyGen); + } + catch (SecurityUtilityException e) + { + throw new CmsException("can't find key generation algorithm.", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataGenerator.cs.meta new file mode 100644 index 00000000..acbbe221 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aa4d4e34c5881f74ca33adf98582b07c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataParser.cs new file mode 100644 index 00000000..57fcc7bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataParser.cs @@ -0,0 +1,165 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * Parsing class for an CMS Enveloped Data object from an input stream. + *

+ * Note: that because we are in a streaming mode only one recipient can be tried and it is important + * that the methods on the parser are called in the appropriate order. + *

+ *

+ * Example of use - assuming the first recipient matches the private key we have. + *

+	*      CmsEnvelopedDataParser     ep = new CmsEnvelopedDataParser(inputStream);
+	*
+	*      RecipientInformationStore  recipients = ep.GetRecipientInfos();
+	*
+	*      Collection  c = recipients.getRecipients();
+	*      Iterator    it = c.iterator();
+	*
+	*      if (it.hasNext())
+	*      {
+	*          RecipientInformation   recipient = (RecipientInformation)it.next();
+	*
+	*          CMSTypedStream recData = recipient.getContentStream(privateKey);
+	*
+	*          processDataStream(recData.getContentStream());
+	*      }
+	*  
+ * Note: this class does not introduce buffering - if you are processing large files you should create + * the parser with: + *
+	*          CmsEnvelopedDataParser     ep = new CmsEnvelopedDataParser(new BufferedInputStream(inputStream, bufSize));
+	*  
+ * where bufSize is a suitably large buffer size. + *

+ */ + public class CmsEnvelopedDataParser + : CmsContentInfoParser + { + internal RecipientInformationStore recipientInfoStore; + internal EnvelopedDataParser envelopedData; + + private AlgorithmIdentifier _encAlg; + private Asn1.Cms.AttributeTable _unprotectedAttributes; + private bool _attrNotRead; + + public CmsEnvelopedDataParser( + byte[] envelopedData) + : this(new MemoryStream(envelopedData, false)) + { + } + + public CmsEnvelopedDataParser( + Stream envelopedData) + : base(envelopedData) + { + this._attrNotRead = true; + this.envelopedData = new EnvelopedDataParser( + (Asn1SequenceParser)this.contentInfo.GetContent(Asn1Tags.Sequence)); + + // TODO Validate version? + //DerInteger version = this.envelopedData.Version; + + // + // read the recipients + // + Asn1Set recipientInfos = Asn1Set.GetInstance(this.envelopedData.GetRecipientInfos().ToAsn1Object()); + + // + // read the encrypted content info + // + EncryptedContentInfoParser encInfo = this.envelopedData.GetEncryptedContentInfo(); + this._encAlg = encInfo.ContentEncryptionAlgorithm; + CmsReadable readable = new CmsProcessableInputStream( + ((Asn1OctetStringParser)encInfo.GetEncryptedContent(Asn1Tags.OctetString)).GetOctetStream()); + CmsSecureReadable secureReadable = new CmsEnvelopedHelper.CmsEnvelopedSecureReadable( + this._encAlg, readable); + + // + // build the RecipientInformationStore + // + this.recipientInfoStore = CmsEnvelopedHelper.BuildRecipientInformationStore( + recipientInfos, secureReadable); + } + + public AlgorithmIdentifier EncryptionAlgorithmID + { + get { return _encAlg; } + } + + /** + * return the object identifier for the content encryption algorithm. + */ + public string EncryptionAlgOid + { + get { return _encAlg.Algorithm.Id; } + } + + /** + * return the ASN.1 encoded encryption algorithm parameters, or null if + * there aren't any. + */ + public Asn1Object EncryptionAlgParams + { + get + { + Asn1Encodable ae = _encAlg.Parameters; + + return ae == null ? null : ae.ToAsn1Object(); + } + } + + /** + * return a store of the intended recipients for this message + */ + public RecipientInformationStore GetRecipientInfos() + { + return this.recipientInfoStore; + } + + /** + * return a table of the unprotected attributes indexed by + * the OID of the attribute. + * @throws IOException + */ + public Asn1.Cms.AttributeTable GetUnprotectedAttributes() + { + if (_unprotectedAttributes == null && _attrNotRead) + { + Asn1SetParser asn1Set = this.envelopedData.GetUnprotectedAttrs(); + + _attrNotRead = false; + + if (asn1Set != null) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + IAsn1Convertible o; + + while ((o = asn1Set.ReadObject()) != null) + { + Asn1SequenceParser seq = (Asn1SequenceParser)o; + + v.Add(seq.ToAsn1Object()); + } + + _unprotectedAttributes = new Asn1.Cms.AttributeTable(new DerSet(v)); + } + } + + return _unprotectedAttributes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataParser.cs.meta new file mode 100644 index 00000000..a65843f8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2454ef1eaa70ad84aaf4aaba68576105 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataStreamGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataStreamGenerator.cs new file mode 100644 index 00000000..7b82027e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataStreamGenerator.cs @@ -0,0 +1,312 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * General class for generating a CMS enveloped-data message stream. + *

+ * A simple example of usage. + *

+	*      CmsEnvelopedDataStreamGenerator edGen = new CmsEnvelopedDataStreamGenerator();
+	*
+	*      edGen.AddKeyTransRecipient(cert);
+	*
+	*      MemoryStream  bOut = new MemoryStream();
+	*
+	*      Stream out = edGen.Open(
+	*                              bOut, CMSEnvelopedDataGenerator.AES128_CBC);*
+	*      out.Write(data);
+	*
+	*      out.Close();
+	* 
+ *

+ */ + public class CmsEnvelopedDataStreamGenerator + : CmsEnvelopedGenerator + { + private object _originatorInfo = null; + private object _unprotectedAttributes = null; + private int _bufferSize; + private bool _berEncodeRecipientSet; + + public CmsEnvelopedDataStreamGenerator() + { + } + + /// Constructor allowing specific source of randomness + /// Instance of SecureRandom to use. + public CmsEnvelopedDataStreamGenerator( + SecureRandom rand) + : base(rand) + { + } + + /// Set the underlying string size for encapsulated data. + /// Length of octet strings to buffer the data. + public void SetBufferSize( + int bufferSize) + { + _bufferSize = bufferSize; + } + + /// Use a BER Set to store the recipient information. + public void SetBerEncodeRecipients( + bool berEncodeRecipientSet) + { + _berEncodeRecipientSet = berEncodeRecipientSet; + } + + private DerInteger Version + { + get + { + int version = (_originatorInfo != null || _unprotectedAttributes != null) + ? 2 + : 0; + + return new DerInteger(version); + } + } + + /// + /// Generate an enveloped object that contains an CMS Enveloped Data + /// object using the passed in key generator. + /// + private Stream Open( + Stream outStream, + string encryptionOid, + CipherKeyGenerator keyGen) + { + byte[] encKeyBytes = keyGen.GenerateKey(); + KeyParameter encKey = ParameterUtilities.CreateKeyParameter(encryptionOid, encKeyBytes); + + Asn1Encodable asn1Params = GenerateAsn1Parameters(encryptionOid, encKeyBytes); + + ICipherParameters cipherParameters; + AlgorithmIdentifier encAlgID = GetAlgorithmIdentifier( + encryptionOid, encKey, asn1Params, out cipherParameters); + + Asn1EncodableVector recipientInfos = new Asn1EncodableVector(); + + foreach (RecipientInfoGenerator rig in recipientInfoGenerators) + { + try + { + recipientInfos.Add(rig.Generate(encKey, rand)); + } + catch (InvalidKeyException e) + { + throw new CmsException("key inappropriate for algorithm.", e); + } + catch (GeneralSecurityException e) + { + throw new CmsException("error making encrypted content.", e); + } + } + + return Open(outStream, encAlgID, cipherParameters, recipientInfos); + } + + private Stream Open( + Stream outStream, + AlgorithmIdentifier encAlgID, + ICipherParameters cipherParameters, + Asn1EncodableVector recipientInfos) + { + try + { + // + // ContentInfo + // + BerSequenceGenerator cGen = new BerSequenceGenerator(outStream); + + cGen.AddObject(CmsObjectIdentifiers.EnvelopedData); + + // + // Encrypted Data + // + BerSequenceGenerator envGen = new BerSequenceGenerator( + cGen.GetRawOutputStream(), 0, true); + + envGen.AddObject(this.Version); + + Stream envRaw = envGen.GetRawOutputStream(); + Asn1Generator recipGen = _berEncodeRecipientSet + ? (Asn1Generator) new BerSetGenerator(envRaw) + : new DerSetGenerator(envRaw); + + foreach (Asn1Encodable ae in recipientInfos) + { + recipGen.AddObject(ae); + } + + recipGen.Close(); + + BerSequenceGenerator eiGen = new BerSequenceGenerator(envRaw); + eiGen.AddObject(CmsObjectIdentifiers.Data); + eiGen.AddObject(encAlgID); + + Stream octetOutputStream = CmsUtilities.CreateBerOctetOutputStream( + eiGen.GetRawOutputStream(), 0, false, _bufferSize); + + IBufferedCipher cipher = CipherUtilities.GetCipher(encAlgID.Algorithm); + cipher.Init(true, new ParametersWithRandom(cipherParameters, rand)); + CipherStream cOut = new CipherStream(octetOutputStream, null, cipher); + + return new CmsEnvelopedDataOutputStream(this, cOut, cGen, envGen, eiGen); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } + catch (IOException e) + { + throw new CmsException("exception decoding algorithm parameters.", e); + } + } + + /** + * generate an enveloped object that contains an CMS Enveloped Data object + * @throws IOException + */ + public Stream Open( + Stream outStream, + string encryptionOid) + { + CipherKeyGenerator keyGen = GeneratorUtilities.GetKeyGenerator(encryptionOid); + + keyGen.Init(new KeyGenerationParameters(rand, keyGen.DefaultStrength)); + + return Open(outStream, encryptionOid, keyGen); + } + + /** + * generate an enveloped object that contains an CMS Enveloped Data object + * @throws IOException + */ + public Stream Open( + Stream outStream, + string encryptionOid, + int keySize) + { + CipherKeyGenerator keyGen = GeneratorUtilities.GetKeyGenerator(encryptionOid); + + keyGen.Init(new KeyGenerationParameters(rand, keySize)); + + return Open(outStream, encryptionOid, keyGen); + } + + private class CmsEnvelopedDataOutputStream + : BaseOutputStream + { + private readonly CmsEnvelopedGenerator _outer; + + private readonly CipherStream _out; + private readonly BerSequenceGenerator _cGen; + private readonly BerSequenceGenerator _envGen; + private readonly BerSequenceGenerator _eiGen; + + public CmsEnvelopedDataOutputStream( + CmsEnvelopedGenerator outer, + CipherStream outStream, + BerSequenceGenerator cGen, + BerSequenceGenerator envGen, + BerSequenceGenerator eiGen) + { + _outer = outer; + _out = outStream; + _cGen = cGen; + _envGen = envGen; + _eiGen = eiGen; + } + + public override void WriteByte( + byte b) + { + _out.WriteByte(b); + } + + public override void Write( + byte[] bytes, + int off, + int len) + { + _out.Write(bytes, off, len); + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(_out); + + // TODO Parent context(s) should really be closed explicitly + + _eiGen.Close(); + + if (_outer.unprotectedAttributeGenerator != null) + { + Asn1.Cms.AttributeTable attrTable = _outer.unprotectedAttributeGenerator.GetAttributes(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable()); + + Asn1Set unprotectedAttrs = new BerSet(attrTable.ToAsn1EncodableVector()); + + _envGen.AddObject(new DerTaggedObject(false, 1, unprotectedAttrs)); + } + + _envGen.Close(); + _cGen.Close(); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(_out); + + // TODO Parent context(s) should really be closed explicitly + + _eiGen.Close(); + + if (_outer.unprotectedAttributeGenerator != null) + { + Asn1.Cms.AttributeTable attrTable = _outer.unprotectedAttributeGenerator.GetAttributes(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable()); + + Asn1Set unprotectedAttrs = new BerSet(attrTable.ToAsn1EncodableVector()); + + _envGen.AddObject(new DerTaggedObject(false, 1, unprotectedAttrs)); + } + + _envGen.Close(); + _cGen.Close(); + base.Close(); + } +#endif + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataStreamGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataStreamGenerator.cs.meta new file mode 100644 index 00000000..fe767e9f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedDataStreamGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 505dd39c923b320418fae1526255c484 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedGenerator.cs new file mode 100644 index 00000000..efbb430c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedGenerator.cs @@ -0,0 +1,335 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Kisa; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ntt; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * General class for generating a CMS enveloped-data message. + * + * A simple example of usage. + * + *
+	*      CMSEnvelopedDataGenerator  fact = new CMSEnvelopedDataGenerator();
+	*
+	*      fact.addKeyTransRecipient(cert);
+	*
+	*      CMSEnvelopedData         data = fact.generate(content, algorithm, "BC");
+	* 
+ */ + public class CmsEnvelopedGenerator + { + // Note: These tables are complementary: If rc2Table[i]==j, then rc2Ekb[j]==i + internal static readonly short[] rc2Table = + { + 0xbd, 0x56, 0xea, 0xf2, 0xa2, 0xf1, 0xac, 0x2a, 0xb0, 0x93, 0xd1, 0x9c, 0x1b, 0x33, 0xfd, 0xd0, + 0x30, 0x04, 0xb6, 0xdc, 0x7d, 0xdf, 0x32, 0x4b, 0xf7, 0xcb, 0x45, 0x9b, 0x31, 0xbb, 0x21, 0x5a, + 0x41, 0x9f, 0xe1, 0xd9, 0x4a, 0x4d, 0x9e, 0xda, 0xa0, 0x68, 0x2c, 0xc3, 0x27, 0x5f, 0x80, 0x36, + 0x3e, 0xee, 0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6, 0xae, 0x2e, 0xdd, 0x76, 0x5c, 0x2f, + 0xa7, 0x1c, 0xc9, 0x09, 0x69, 0x9a, 0x83, 0xcf, 0x29, 0x39, 0xb9, 0xe9, 0x4c, 0xff, 0x43, 0xab + }; + +// internal static readonly short[] rc2Ekb = +// { +// 0x5d, 0xbe, 0x9b, 0x8b, 0x11, 0x99, 0x6e, 0x4d, 0x59, 0xf3, 0x85, 0xa6, 0x3f, 0xb7, 0x83, 0xc5, +// 0xe4, 0x73, 0x6b, 0x3a, 0x68, 0x5a, 0xc0, 0x47, 0xa0, 0x64, 0x34, 0x0c, 0xf1, 0xd0, 0x52, 0xa5, +// 0xb9, 0x1e, 0x96, 0x43, 0x41, 0xd8, 0xd4, 0x2c, 0xdb, 0xf8, 0x07, 0x77, 0x2a, 0xca, 0xeb, 0xef, +// 0x10, 0x1c, 0x16, 0x0d, 0x38, 0x72, 0x2f, 0x89, 0xc1, 0xf9, 0x80, 0xc4, 0x6d, 0xae, 0x30, 0x3d, +// 0xce, 0x20, 0x63, 0xfe, 0xe6, 0x1a, 0xc7, 0xb8, 0x50, 0xe8, 0x24, 0x17, 0xfc, 0x25, 0x6f, 0xbb, +// 0x6a, 0xa3, 0x44, 0x53, 0xd9, 0xa2, 0x01, 0xab, 0xbc, 0xb6, 0x1f, 0x98, 0xee, 0x9a, 0xa7, 0x2d, +// 0x4f, 0x9e, 0x8e, 0xac, 0xe0, 0xc6, 0x49, 0x46, 0x29, 0xf4, 0x94, 0x8a, 0xaf, 0xe1, 0x5b, 0xc3, +// 0xb3, 0x7b, 0x57, 0xd1, 0x7c, 0x9c, 0xed, 0x87, 0x40, 0x8c, 0xe2, 0xcb, 0x93, 0x14, 0xc9, 0x61, +// 0x2e, 0xe5, 0xcc, 0xf6, 0x5e, 0xa8, 0x5c, 0xd6, 0x75, 0x8d, 0x62, 0x95, 0x58, 0x69, 0x76, 0xa1, +// 0x4a, 0xb5, 0x55, 0x09, 0x78, 0x33, 0x82, 0xd7, 0xdd, 0x79, 0xf5, 0x1b, 0x0b, 0xde, 0x26, 0x21, +// 0x28, 0x74, 0x04, 0x97, 0x56, 0xdf, 0x3c, 0xf0, 0x37, 0x39, 0xdc, 0xff, 0x06, 0xa4, 0xea, 0x42, +// 0x08, 0xda, 0xb4, 0x71, 0xb0, 0xcf, 0x12, 0x7a, 0x4e, 0xfa, 0x6c, 0x1d, 0x84, 0x00, 0xc8, 0x7f, +// 0x91, 0x45, 0xaa, 0x2b, 0xc2, 0xb1, 0x8f, 0xd5, 0xba, 0xf2, 0xad, 0x19, 0xb2, 0x67, 0x36, 0xf7, +// 0x0f, 0x0a, 0x92, 0x7d, 0xe3, 0x9d, 0xe9, 0x90, 0x3e, 0x23, 0x27, 0x66, 0x13, 0xec, 0x81, 0x15, +// 0xbd, 0x22, 0xbf, 0x9f, 0x7e, 0xa9, 0x51, 0x4b, 0x4c, 0xfb, 0x02, 0xd3, 0x70, 0x86, 0x31, 0xe7, +// 0x3b, 0x05, 0x03, 0x54, 0x60, 0x48, 0x65, 0x18, 0xd2, 0xcd, 0x5f, 0x32, 0x88, 0x0e, 0x35, 0xfd +// }; + + + // TODO Create named constants for all of these + public static readonly string DesEde3Cbc = PkcsObjectIdentifiers.DesEde3Cbc.Id; + public static readonly string RC2Cbc = PkcsObjectIdentifiers.RC2Cbc.Id; + public const string IdeaCbc = "1.3.6.1.4.1.188.7.1.1.2"; + public const string Cast5Cbc = "1.2.840.113533.7.66.10"; + public static readonly string Aes128Cbc = NistObjectIdentifiers.IdAes128Cbc.Id; + public static readonly string Aes192Cbc = NistObjectIdentifiers.IdAes192Cbc.Id; + public static readonly string Aes256Cbc = NistObjectIdentifiers.IdAes256Cbc.Id; + public static readonly string Camellia128Cbc = NttObjectIdentifiers.IdCamellia128Cbc.Id; + public static readonly string Camellia192Cbc = NttObjectIdentifiers.IdCamellia192Cbc.Id; + public static readonly string Camellia256Cbc = NttObjectIdentifiers.IdCamellia256Cbc.Id; + public static readonly string SeedCbc = KisaObjectIdentifiers.IdSeedCbc.Id; + + public static readonly string DesEde3Wrap = PkcsObjectIdentifiers.IdAlgCms3DesWrap.Id; + public static readonly string Aes128Wrap = NistObjectIdentifiers.IdAes128Wrap.Id; + public static readonly string Aes192Wrap = NistObjectIdentifiers.IdAes192Wrap.Id; + public static readonly string Aes256Wrap = NistObjectIdentifiers.IdAes256Wrap.Id; + public static readonly string Camellia128Wrap = NttObjectIdentifiers.IdCamellia128Wrap.Id; + public static readonly string Camellia192Wrap = NttObjectIdentifiers.IdCamellia192Wrap.Id; + public static readonly string Camellia256Wrap = NttObjectIdentifiers.IdCamellia256Wrap.Id; + public static readonly string SeedWrap = KisaObjectIdentifiers.IdNpkiAppCmsSeedWrap.Id; + + public static readonly string ECDHSha1Kdf = X9ObjectIdentifiers.DHSinglePassStdDHSha1KdfScheme.Id; + public static readonly string ECMqvSha1Kdf = X9ObjectIdentifiers.MqvSinglePassSha1KdfScheme.Id; + + internal readonly IList recipientInfoGenerators = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + internal readonly SecureRandom rand; + + internal CmsAttributeTableGenerator unprotectedAttributeGenerator = null; + + public CmsEnvelopedGenerator() + : this(new SecureRandom()) + { + } + + /// Constructor allowing specific source of randomness + /// Instance of SecureRandom to use. + public CmsEnvelopedGenerator( + SecureRandom rand) + { + this.rand = rand; + } + + public CmsAttributeTableGenerator UnprotectedAttributeGenerator + { + get { return this.unprotectedAttributeGenerator; } + set { this.unprotectedAttributeGenerator = value; } + } + + /** + * add a recipient. + * + * @param cert recipient's public key certificate + * @exception ArgumentException if there is a problem with the certificate + */ + public void AddKeyTransRecipient( + X509Certificate cert) + { + KeyTransRecipientInfoGenerator ktrig = new KeyTransRecipientInfoGenerator(); + ktrig.RecipientCert = cert; + + recipientInfoGenerators.Add(ktrig); + } + + /** + * add a recipient + * + * @param key the public key used by the recipient + * @param subKeyId the identifier for the recipient's public key + * @exception ArgumentException if there is a problem with the key + */ + public void AddKeyTransRecipient( + AsymmetricKeyParameter pubKey, + byte[] subKeyId) + { + KeyTransRecipientInfoGenerator ktrig = new KeyTransRecipientInfoGenerator(); + ktrig.RecipientPublicKey = pubKey; + ktrig.SubjectKeyIdentifier = new DerOctetString(subKeyId); + + recipientInfoGenerators.Add(ktrig); + } + + /** + * add a KEK recipient. + * @param key the secret key to use for wrapping + * @param keyIdentifier the byte string that identifies the key + */ + public void AddKekRecipient( + string keyAlgorithm, // TODO Remove need for this parameter + KeyParameter key, + byte[] keyIdentifier) + { + AddKekRecipient(keyAlgorithm, key, new KekIdentifier(keyIdentifier, null, null)); + } + + /** + * add a KEK recipient. + * @param key the secret key to use for wrapping + * @param keyIdentifier the byte string that identifies the key + */ + public void AddKekRecipient( + string keyAlgorithm, // TODO Remove need for this parameter + KeyParameter key, + KekIdentifier kekIdentifier) + { + KekRecipientInfoGenerator kekrig = new KekRecipientInfoGenerator(); + kekrig.KekIdentifier = kekIdentifier; + kekrig.KeyEncryptionKeyOID = keyAlgorithm; + kekrig.KeyEncryptionKey = key; + + recipientInfoGenerators.Add(kekrig); + } + + public void AddPasswordRecipient( + CmsPbeKey pbeKey, + string kekAlgorithmOid) + { + Pbkdf2Params p = new Pbkdf2Params(pbeKey.Salt, pbeKey.IterationCount); + + PasswordRecipientInfoGenerator prig = new PasswordRecipientInfoGenerator(); + prig.KeyDerivationAlgorithm = new AlgorithmIdentifier(PkcsObjectIdentifiers.IdPbkdf2, p); + prig.KeyEncryptionKeyOID = kekAlgorithmOid; + prig.KeyEncryptionKey = pbeKey.GetEncoded(kekAlgorithmOid); + + recipientInfoGenerators.Add(prig); + } + + /** + * Add a key agreement based recipient. + * + * @param agreementAlgorithm key agreement algorithm to use. + * @param senderPrivateKey private key to initialise sender side of agreement with. + * @param senderPublicKey sender public key to include with message. + * @param recipientCert recipient's public key certificate. + * @param cekWrapAlgorithm OID for key wrapping algorithm to use. + * @exception SecurityUtilityException if the algorithm requested cannot be found + * @exception InvalidKeyException if the keys are inappropriate for the algorithm specified + */ + public void AddKeyAgreementRecipient( + string agreementAlgorithm, + AsymmetricKeyParameter senderPrivateKey, + AsymmetricKeyParameter senderPublicKey, + X509Certificate recipientCert, + string cekWrapAlgorithm) + { + IList recipientCerts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(1); + recipientCerts.Add(recipientCert); + + AddKeyAgreementRecipients(agreementAlgorithm, senderPrivateKey, senderPublicKey, + recipientCerts, cekWrapAlgorithm); + } + + /** + * Add multiple key agreement based recipients (sharing a single KeyAgreeRecipientInfo structure). + * + * @param agreementAlgorithm key agreement algorithm to use. + * @param senderPrivateKey private key to initialise sender side of agreement with. + * @param senderPublicKey sender public key to include with message. + * @param recipientCerts recipients' public key certificates. + * @param cekWrapAlgorithm OID for key wrapping algorithm to use. + * @exception SecurityUtilityException if the algorithm requested cannot be found + * @exception InvalidKeyException if the keys are inappropriate for the algorithm specified + */ + public void AddKeyAgreementRecipients( + string agreementAlgorithm, + AsymmetricKeyParameter senderPrivateKey, + AsymmetricKeyParameter senderPublicKey, + ICollection recipientCerts, + string cekWrapAlgorithm) + { + if (!senderPrivateKey.IsPrivate) + throw new ArgumentException("Expected private key", "senderPrivateKey"); + if (senderPublicKey.IsPrivate) + throw new ArgumentException("Expected public key", "senderPublicKey"); + + /* TODO + * "a recipient X.509 version 3 certificate that contains a key usage extension MUST + * assert the keyAgreement bit." + */ + + KeyAgreeRecipientInfoGenerator karig = new KeyAgreeRecipientInfoGenerator(); + karig.KeyAgreementOID = new DerObjectIdentifier(agreementAlgorithm); + karig.KeyEncryptionOID = new DerObjectIdentifier(cekWrapAlgorithm); + karig.RecipientCerts = recipientCerts; + karig.SenderKeyPair = new AsymmetricCipherKeyPair(senderPublicKey, senderPrivateKey); + + recipientInfoGenerators.Add(karig); + } + + protected internal virtual AlgorithmIdentifier GetAlgorithmIdentifier( + string encryptionOid, + KeyParameter encKey, + Asn1Encodable asn1Params, + out ICipherParameters cipherParameters) + { + Asn1Object asn1Object; + if (asn1Params != null) + { + asn1Object = asn1Params.ToAsn1Object(); + cipherParameters = ParameterUtilities.GetCipherParameters( + encryptionOid, encKey, asn1Object); + } + else + { + asn1Object = DerNull.Instance; + cipherParameters = encKey; + } + + return new AlgorithmIdentifier( + new DerObjectIdentifier(encryptionOid), + asn1Object); + } + + protected internal virtual Asn1Encodable GenerateAsn1Parameters( + string encryptionOid, + byte[] encKeyBytes) + { + Asn1Encodable asn1Params = null; + + try + { + if (encryptionOid.Equals(RC2Cbc)) + { + byte[] iv = new byte[8]; + rand.NextBytes(iv); + + // TODO Is this detailed repeat of Java version really necessary? + int effKeyBits = encKeyBytes.Length * 8; + int parameterVersion; + + if (effKeyBits < 256) + { + parameterVersion = rc2Table[effKeyBits]; + } + else + { + parameterVersion = effKeyBits; + } + + asn1Params = new RC2CbcParameter(parameterVersion, iv); + } + else + { + asn1Params = ParameterUtilities.GenerateParameters(encryptionOid, rand); + } + } + catch (SecurityUtilityException) + { + // No problem... no parameters generated + } + + return asn1Params; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedGenerator.cs.meta new file mode 100644 index 00000000..7352f9bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7479720d2a2d32e4688e44695282bcbe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedHelper.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedHelper.cs new file mode 100644 index 00000000..837667ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedHelper.cs @@ -0,0 +1,315 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + class CmsEnvelopedHelper + { + internal static readonly CmsEnvelopedHelper Instance = new CmsEnvelopedHelper(); + + private static readonly IDictionary KeySizes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary BaseCipherNames = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static CmsEnvelopedHelper() + { + KeySizes.Add(CmsEnvelopedGenerator.DesEde3Cbc, 192); + KeySizes.Add(CmsEnvelopedGenerator.Aes128Cbc, 128); + KeySizes.Add(CmsEnvelopedGenerator.Aes192Cbc, 192); + KeySizes.Add(CmsEnvelopedGenerator.Aes256Cbc, 256); + + BaseCipherNames.Add(CmsEnvelopedGenerator.DesEde3Cbc, "DESEDE"); + BaseCipherNames.Add(CmsEnvelopedGenerator.Aes128Cbc, "AES"); + BaseCipherNames.Add(CmsEnvelopedGenerator.Aes192Cbc, "AES"); + BaseCipherNames.Add(CmsEnvelopedGenerator.Aes256Cbc, "AES"); + } + + private string GetAsymmetricEncryptionAlgName( + string encryptionAlgOid) + { + if (Asn1.Pkcs.PkcsObjectIdentifiers.RsaEncryption.Id.Equals(encryptionAlgOid)) + { + return "RSA/ECB/PKCS1Padding"; + } + + return encryptionAlgOid; + } + + internal IBufferedCipher CreateAsymmetricCipher( + string encryptionOid) + { + string asymName = GetAsymmetricEncryptionAlgName(encryptionOid); + if (!asymName.Equals(encryptionOid)) + { + try + { + return CipherUtilities.GetCipher(asymName); + } + catch (SecurityUtilityException) + { + // Ignore + } + } + return CipherUtilities.GetCipher(encryptionOid); + } + + internal IWrapper CreateWrapper( + string encryptionOid) + { + try + { + return WrapperUtilities.GetWrapper(encryptionOid); + } + catch (SecurityUtilityException) + { + return WrapperUtilities.GetWrapper(GetAsymmetricEncryptionAlgName(encryptionOid)); + } + } + + internal string GetRfc3211WrapperName( + string oid) + { + if (oid == null) + throw new ArgumentNullException("oid"); + + string alg = (string) BaseCipherNames[oid]; + + if (alg == null) + throw new ArgumentException("no name for " + oid, "oid"); + + return alg + "RFC3211Wrap"; + } + + internal int GetKeySize( + string oid) + { + if (!KeySizes.Contains(oid)) + { + throw new ArgumentException("no keysize for " + oid, "oid"); + } + + return (int) KeySizes[oid]; + } + + internal static RecipientInformationStore BuildRecipientInformationStore( + Asn1Set recipientInfos, CmsSecureReadable secureReadable) + { + IList infos = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + for (int i = 0; i != recipientInfos.Count; i++) + { + RecipientInfo info = RecipientInfo.GetInstance(recipientInfos[i]); + + ReadRecipientInfo(infos, info, secureReadable); + } + return new RecipientInformationStore(infos); + } + + private static void ReadRecipientInfo( + IList infos, RecipientInfo info, CmsSecureReadable secureReadable) + { + Asn1Encodable recipInfo = info.Info; + if (recipInfo is KeyTransRecipientInfo) + { + infos.Add(new KeyTransRecipientInformation((KeyTransRecipientInfo)recipInfo, secureReadable)); + } + else if (recipInfo is KekRecipientInfo) + { + infos.Add(new KekRecipientInformation((KekRecipientInfo)recipInfo, secureReadable)); + } + else if (recipInfo is KeyAgreeRecipientInfo) + { + KeyAgreeRecipientInformation.ReadRecipientInfo(infos, (KeyAgreeRecipientInfo)recipInfo, secureReadable); + } + else if (recipInfo is PasswordRecipientInfo) + { + infos.Add(new PasswordRecipientInformation((PasswordRecipientInfo)recipInfo, secureReadable)); + } + } + + internal class CmsAuthenticatedSecureReadable : CmsSecureReadable + { + private AlgorithmIdentifier algorithm; + private IMac mac; + private CmsReadable readable; + + internal CmsAuthenticatedSecureReadable(AlgorithmIdentifier algorithm, CmsReadable readable) + { + this.algorithm = algorithm; + this.readable = readable; + } + + public AlgorithmIdentifier Algorithm + { + get { return this.algorithm; } + } + + public object CryptoObject + { + get { return this.mac; } + } + + public CmsReadable GetReadable(KeyParameter sKey) + { + string macAlg = this.algorithm.Algorithm.Id; +// Asn1Object sParams = this.algorithm.Parameters.ToAsn1Object(); + + try + { + this.mac = MacUtilities.GetMac(macAlg); + + // FIXME Support for MAC algorithm parameters similar to cipher parameters +// ASN1Object sParams = (ASN1Object)macAlg.getParameters(); +// +// if (sParams != null && !(sParams instanceof ASN1Null)) +// { +// AlgorithmParameters params = CMSEnvelopedHelper.INSTANCE.createAlgorithmParameters(macAlg.getObjectId().getId(), provider); +// +// params.init(sParams.getEncoded(), "ASN.1"); +// +// mac.init(sKey, params.getParameterSpec(IvParameterSpec.class)); +// } +// else + { + mac.Init(sKey); + } + +// Asn1Object asn1Params = asn1Enc == null ? null : asn1Enc.ToAsn1Object(); +// +// ICipherParameters cipherParameters = sKey; +// +// if (asn1Params != null && !(asn1Params is Asn1Null)) +// { +// cipherParameters = ParameterUtilities.GetCipherParameters( +// macAlg.Algorithm, cipherParameters, asn1Params); +// } +// else +// { +// string alg = macAlg.Algorithm.Id; +// if (alg.Equals(CmsEnvelopedDataGenerator.DesEde3Cbc) +// || alg.Equals(CmsEnvelopedDataGenerator.IdeaCbc) +// || alg.Equals(CmsEnvelopedDataGenerator.Cast5Cbc)) +// { +// cipherParameters = new ParametersWithIV(cipherParameters, new byte[8]); +// } +// } +// +// mac.Init(cipherParameters); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } + catch (IOException e) + { + throw new CmsException("error decoding algorithm parameters.", e); + } + + try + { + return new CmsProcessableInputStream( + new TeeInputStream( + readable.GetInputStream(), + new MacSink(this.mac))); + } + catch (IOException e) + { + throw new CmsException("error reading content.", e); + } + } + } + + internal class CmsEnvelopedSecureReadable : CmsSecureReadable + { + private AlgorithmIdentifier algorithm; + private IBufferedCipher cipher; + private CmsReadable readable; + + internal CmsEnvelopedSecureReadable(AlgorithmIdentifier algorithm, CmsReadable readable) + { + this.algorithm = algorithm; + this.readable = readable; + } + + public AlgorithmIdentifier Algorithm + { + get { return this.algorithm; } + } + + public object CryptoObject + { + get { return this.cipher; } + } + + public CmsReadable GetReadable(KeyParameter sKey) + { + try + { + this.cipher = CipherUtilities.GetCipher(this.algorithm.Algorithm); + + Asn1Encodable asn1Enc = this.algorithm.Parameters; + Asn1Object asn1Params = asn1Enc == null ? null : asn1Enc.ToAsn1Object(); + + ICipherParameters cipherParameters = sKey; + + if (asn1Params != null && !(asn1Params is Asn1Null)) + { + cipherParameters = ParameterUtilities.GetCipherParameters( + this.algorithm.Algorithm, cipherParameters, asn1Params); + } + else + { + string alg = this.algorithm.Algorithm.Id; + if (alg.Equals(CmsEnvelopedDataGenerator.DesEde3Cbc) + || alg.Equals(CmsEnvelopedDataGenerator.IdeaCbc) + || alg.Equals(CmsEnvelopedDataGenerator.Cast5Cbc)) + { + cipherParameters = new ParametersWithIV(cipherParameters, new byte[8]); + } + } + + cipher.Init(false, cipherParameters); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } + catch (IOException e) + { + throw new CmsException("error decoding algorithm parameters.", e); + } + + try + { + return new CmsProcessableInputStream( + new CipherStream(readable.GetInputStream(), cipher, null)); + } + catch (IOException e) + { + throw new CmsException("error reading content.", e); + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedHelper.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedHelper.cs.meta new file mode 100644 index 00000000..ab985b9c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSEnvelopedHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8aff90e61ecf2b749995884c8d10148a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSException.cs new file mode 100644 index 00000000..72d1dedc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSException.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CmsException + : Exception + { + public CmsException() + { + } + + public CmsException( + string msg) + : base(msg) + { + } + + public CmsException( + string msg, + Exception e) + : base(msg, e) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSException.cs.meta new file mode 100644 index 00000000..1a7c654c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f90877e942bf2e4d98c1908021bf6d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSPBEKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSPBEKey.cs new file mode 100644 index 00000000..8a767809 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSPBEKey.cs @@ -0,0 +1,113 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +//import javax.crypto.interfaces.PBEKey; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public abstract class CmsPbeKey + // TODO Create an equivalent interface somewhere? + // : PBEKey + : ICipherParameters + { + internal readonly char[] password; + internal readonly byte[] salt; + internal readonly int iterationCount; + + [Obsolete("Use version taking 'char[]' instead")] + public CmsPbeKey( + string password, + byte[] salt, + int iterationCount) + : this(password.ToCharArray(), salt, iterationCount) + { + } + + [Obsolete("Use version taking 'char[]' instead")] + public CmsPbeKey( + string password, + AlgorithmIdentifier keyDerivationAlgorithm) + : this(password.ToCharArray(), keyDerivationAlgorithm) + { + } + + public CmsPbeKey( + char[] password, + byte[] salt, + int iterationCount) + { + this.password = (char[])password.Clone(); + this.salt = Arrays.Clone(salt); + this.iterationCount = iterationCount; + } + + public CmsPbeKey( + char[] password, + AlgorithmIdentifier keyDerivationAlgorithm) + { + if (!keyDerivationAlgorithm.Algorithm.Equals(PkcsObjectIdentifiers.IdPbkdf2)) + throw new ArgumentException("Unsupported key derivation algorithm: " + + keyDerivationAlgorithm.Algorithm); + + Pbkdf2Params kdfParams = Pbkdf2Params.GetInstance( + keyDerivationAlgorithm.Parameters.ToAsn1Object()); + + this.password = (char[])password.Clone(); + this.salt = kdfParams.GetSalt(); + this.iterationCount = kdfParams.IterationCount.IntValue; + } + + ~CmsPbeKey() + { + Array.Clear(this.password, 0, this.password.Length); + } + + [Obsolete("Will be removed")] + public string Password + { + get { return new string(password); } + } + + public byte[] Salt + { + get { return Arrays.Clone(salt); } + } + + [Obsolete("Use 'Salt' property instead")] + public byte[] GetSalt() + { + return Salt; + } + + public int IterationCount + { + get { return iterationCount; } + } + + public string Algorithm + { + get { return "PKCS5S2"; } + } + + public string Format + { + get { return "RAW"; } + } + + public byte[] GetEncoded() + { + return null; + } + + internal abstract KeyParameter GetEncoded(string algorithmOid); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSPBEKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSPBEKey.cs.meta new file mode 100644 index 00000000..90762536 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSPBEKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d60637ca80b5e34f9547fc0de7e2600 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessable.cs new file mode 100644 index 00000000..a281503b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessable.cs @@ -0,0 +1,23 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public interface CmsProcessable + { + /// + /// Generic routine to copy out the data we want processed. + /// + /// + /// This routine may be called multiple times. + /// + void Write(Stream outStream); + + [Obsolete] + object GetContent(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessable.cs.meta new file mode 100644 index 00000000..72130710 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc71b700fdd90dd48a259bb7a12d52b8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableByteArray.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableByteArray.cs new file mode 100644 index 00000000..3ae4bb52 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableByteArray.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * a holding class for a byte array of data to be processed. + */ + public class CmsProcessableByteArray + : CmsProcessable, CmsReadable + { + private readonly byte[] bytes; + + public CmsProcessableByteArray(byte[] bytes) + { + this.bytes = bytes; + } + + public virtual Stream GetInputStream() + { + return new MemoryStream(bytes, false); + } + + public virtual void Write(Stream zOut) + { + zOut.Write(bytes, 0, bytes.Length); + } + + /// A clone of the byte array + [Obsolete] + public virtual object GetContent() + { + return bytes.Clone(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableByteArray.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableByteArray.cs.meta new file mode 100644 index 00000000..6e07591b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableByteArray.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d84ec454eb730c64480bf4b1467ebf9d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableFile.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableFile.cs new file mode 100644 index 00000000..a6748888 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableFile.cs @@ -0,0 +1,56 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if !PORTABLE || NETFX_CORE || DOTNET +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * a holding class for a file of data to be processed. + */ + public class CmsProcessableFile + : CmsProcessable, CmsReadable + { + private const int DefaultBufSize = 32 * 1024; + + private readonly FileInfo _file; + private readonly int _bufSize; + + public CmsProcessableFile(FileInfo file) + : this(file, DefaultBufSize) + { + } + + public CmsProcessableFile(FileInfo file, int bufSize) + { + _file = file; + _bufSize = bufSize; + } + + public virtual Stream GetInputStream() + { + return new FileStream(_file.FullName, FileMode.Open, FileAccess.Read, FileShare.Read, _bufSize); + } + + public virtual void Write(Stream zOut) + { + Stream inStr = GetInputStream(); + Streams.PipeAll(inStr, zOut); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(inStr); + } + + /// The file handle + [Obsolete] + public virtual object GetContent() + { + return _file; + } + } +} +#endif +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableFile.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableFile.cs.meta new file mode 100644 index 00000000..b9935c35 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableFile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee6794dc9ed9a21498c15a4d0ade7433 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableInputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableInputStream.cs new file mode 100644 index 00000000..702b2dd8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableInputStream.cs @@ -0,0 +1,57 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class CmsProcessableInputStream + : CmsProcessable, CmsReadable + { + private readonly Stream input; + + private bool used = false; + + public CmsProcessableInputStream(Stream input) + { + this.input = input; + } + + public virtual Stream GetInputStream() + { + CheckSingleUsage(); + + return input; + } + + public virtual void Write(Stream output) + { + CheckSingleUsage(); + + Streams.PipeAll(input, output); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(input); + } + + [Obsolete] + public virtual object GetContent() + { + return GetInputStream(); + } + + protected virtual void CheckSingleUsage() + { + lock (this) + { + if (used) + throw new InvalidOperationException("CmsProcessableInputStream can only be used once"); + + used = true; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableInputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableInputStream.cs.meta new file mode 100644 index 00000000..332e3d4f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSProcessableInputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aa606174dc043f747972f4383debbfc4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSReadable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSReadable.cs new file mode 100644 index 00000000..da18c1e4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSReadable.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public interface CmsReadable + { + Stream GetInputStream(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSReadable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSReadable.cs.meta new file mode 100644 index 00000000..47b2cff2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSReadable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0789b9aa682aeb342978fa21c8d81f43 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSecureReadable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSecureReadable.cs new file mode 100644 index 00000000..d163d06c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSecureReadable.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal interface CmsSecureReadable + { + AlgorithmIdentifier Algorithm { get; } + object CryptoObject { get; } + CmsReadable GetReadable(KeyParameter key); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSecureReadable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSecureReadable.cs.meta new file mode 100644 index 00000000..d7325c28 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSecureReadable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cacf6c4fdf0cc0a4e9a92dfebfbe7424 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedData.cs new file mode 100644 index 00000000..5bb2f457 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedData.cs @@ -0,0 +1,429 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * general class for handling a pkcs7-signature message. + * + * A simple example of usage - note, in the example below the validity of + * the certificate isn't verified, just the fact that one of the certs + * matches the given signer... + * + *
+	*  IX509Store              certs = s.GetCertificates();
+	*  SignerInformationStore  signers = s.GetSignerInfos();
+	*
+	*  foreach (SignerInformation signer in signers.GetSigners())
+	*  {
+	*      ArrayList       certList = new ArrayList(certs.GetMatches(signer.SignerID));
+	*      X509Certificate cert = (X509Certificate) certList[0];
+	*
+	*      if (signer.Verify(cert.GetPublicKey()))
+	*      {
+	*          verified++;
+	*      }
+	*  }
+	* 
+ */ + public class CmsSignedData + { + private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance; + + private readonly CmsProcessable signedContent; + private SignedData signedData; + private ContentInfo contentInfo; + private SignerInformationStore signerInfoStore; + private IX509Store attrCertStore; + private IX509Store certificateStore; + private IX509Store crlStore; + private IDictionary hashes; + + private CmsSignedData( + CmsSignedData c) + { + this.signedData = c.signedData; + this.contentInfo = c.contentInfo; + this.signedContent = c.signedContent; + this.signerInfoStore = c.signerInfoStore; + } + + public CmsSignedData( + byte[] sigBlock) + : this(CmsUtilities.ReadContentInfo(new MemoryStream(sigBlock, false))) + { + } + + public CmsSignedData( + CmsProcessable signedContent, + byte[] sigBlock) + : this(signedContent, CmsUtilities.ReadContentInfo(new MemoryStream(sigBlock, false))) + { + } + + /** + * Content with detached signature, digests precomputed + * + * @param hashes a map of precomputed digests for content indexed by name of hash. + * @param sigBlock the signature object. + */ + public CmsSignedData( + IDictionary hashes, + byte[] sigBlock) + : this(hashes, CmsUtilities.ReadContentInfo(sigBlock)) + { + } + + /** + * base constructor - content with detached signature. + * + * @param signedContent the content that was signed. + * @param sigData the signature object. + */ + public CmsSignedData( + CmsProcessable signedContent, + Stream sigData) + : this(signedContent, CmsUtilities.ReadContentInfo(sigData)) + { + } + + /** + * base constructor - with encapsulated content + */ + public CmsSignedData( + Stream sigData) + : this(CmsUtilities.ReadContentInfo(sigData)) + { + } + + public CmsSignedData( + CmsProcessable signedContent, + ContentInfo sigData) + { + this.signedContent = signedContent; + this.contentInfo = sigData; + this.signedData = SignedData.GetInstance(contentInfo.Content); + } + + public CmsSignedData( + IDictionary hashes, + ContentInfo sigData) + { + this.hashes = hashes; + this.contentInfo = sigData; + this.signedData = SignedData.GetInstance(contentInfo.Content); + } + + public CmsSignedData( + ContentInfo sigData) + { + this.contentInfo = sigData; + this.signedData = SignedData.GetInstance(contentInfo.Content); + + // + // this can happen if the signed message is sent simply to send a + // certificate chain. + // + if (signedData.EncapContentInfo.Content != null) + { + this.signedContent = new CmsProcessableByteArray( + ((Asn1OctetString)(signedData.EncapContentInfo.Content)).GetOctets()); + } +// else +// { +// this.signedContent = null; +// } + } + + /// Return the version number for this object. + public int Version + { + get { return signedData.Version.Value.IntValue; } + } + + /** + * return the collection of signers that are associated with the + * signatures for the message. + */ + public SignerInformationStore GetSignerInfos() + { + if (signerInfoStore == null) + { + IList signerInfos = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + Asn1Set s = signedData.SignerInfos; + + foreach (object obj in s) + { + SignerInfo info = SignerInfo.GetInstance(obj); + DerObjectIdentifier contentType = signedData.EncapContentInfo.ContentType; + + if (hashes == null) + { + signerInfos.Add(new SignerInformation(info, contentType, signedContent, null)); + } + else + { + byte[] hash = (byte[])hashes[info.DigestAlgorithm.Algorithm.Id]; + + signerInfos.Add(new SignerInformation(info, contentType, null, new BaseDigestCalculator(hash))); + } + } + + signerInfoStore = new SignerInformationStore(signerInfos); + } + + return signerInfoStore; + } + + /** + * return a X509Store containing the attribute certificates, if any, contained + * in this message. + * + * @param type type of store to create + * @return a store of attribute certificates + * @exception NoSuchStoreException if the store type isn't available. + * @exception CmsException if a general exception prevents creation of the X509Store + */ + public IX509Store GetAttributeCertificates( + string type) + { + if (attrCertStore == null) + { + attrCertStore = Helper.CreateAttributeStore(type, signedData.Certificates); + } + + return attrCertStore; + } + + /** + * return a X509Store containing the public key certificates, if any, contained + * in this message. + * + * @param type type of store to create + * @return a store of public key certificates + * @exception NoSuchStoreException if the store type isn't available. + * @exception CmsException if a general exception prevents creation of the X509Store + */ + public IX509Store GetCertificates( + string type) + { + if (certificateStore == null) + { + certificateStore = Helper.CreateCertificateStore(type, signedData.Certificates); + } + + return certificateStore; + } + + /** + * return a X509Store containing CRLs, if any, contained + * in this message. + * + * @param type type of store to create + * @return a store of CRLs + * @exception NoSuchStoreException if the store type isn't available. + * @exception CmsException if a general exception prevents creation of the X509Store + */ + public IX509Store GetCrls( + string type) + { + if (crlStore == null) + { + crlStore = Helper.CreateCrlStore(type, signedData.CRLs); + } + + return crlStore; + } + + [Obsolete("Use 'SignedContentType' property instead.")] + public string SignedContentTypeOid + { + get { return signedData.EncapContentInfo.ContentType.Id; } + } + + /// + /// Return the DerObjectIdentifier associated with the encapsulated + /// content info structure carried in the signed data. + /// + public DerObjectIdentifier SignedContentType + { + get { return signedData.EncapContentInfo.ContentType; } + } + + public CmsProcessable SignedContent + { + get { return signedContent; } + } + + /** + * return the ContentInfo + */ + public ContentInfo ContentInfo + { + get { return contentInfo; } + } + + /** + * return the ASN.1 encoded representation of this object. + */ + public byte[] GetEncoded() + { + return contentInfo.GetEncoded(); + } + + /** + * Replace the signerinformation store associated with this + * CmsSignedData object with the new one passed in. You would + * probably only want to do this if you wanted to change the unsigned + * attributes associated with a signer, or perhaps delete one. + * + * @param signedData the signed data object to be used as a base. + * @param signerInformationStore the new signer information store to use. + * @return a new signed data object. + */ + public static CmsSignedData ReplaceSigners( + CmsSignedData signedData, + SignerInformationStore signerInformationStore) + { + // + // copy + // + CmsSignedData cms = new CmsSignedData(signedData); + + // + // replace the store + // + cms.signerInfoStore = signerInformationStore; + + // + // replace the signers in the SignedData object + // + Asn1EncodableVector digestAlgs = new Asn1EncodableVector(); + Asn1EncodableVector vec = new Asn1EncodableVector(); + + foreach (SignerInformation signer in signerInformationStore.GetSigners()) + { + digestAlgs.Add(Helper.FixAlgID(signer.DigestAlgorithmID)); + vec.Add(signer.ToSignerInfo()); + } + + Asn1Set digests = new DerSet(digestAlgs); + Asn1Set signers = new DerSet(vec); + Asn1Sequence sD = (Asn1Sequence)signedData.signedData.ToAsn1Object(); + + // + // signers are the last item in the sequence. + // + vec = new Asn1EncodableVector( + sD[0], // version + digests); + + for (int i = 2; i != sD.Count - 1; i++) + { + vec.Add(sD[i]); + } + + vec.Add(signers); + + cms.signedData = SignedData.GetInstance(new BerSequence(vec)); + + // + // replace the contentInfo with the new one + // + cms.contentInfo = new ContentInfo(cms.contentInfo.ContentType, cms.signedData); + + return cms; + } + + /** + * Replace the certificate and CRL information associated with this + * CmsSignedData object with the new one passed in. + * + * @param signedData the signed data object to be used as a base. + * @param x509Certs the new certificates to be used. + * @param x509Crls the new CRLs to be used. + * @return a new signed data object. + * @exception CmsException if there is an error processing the stores + */ + public static CmsSignedData ReplaceCertificatesAndCrls( + CmsSignedData signedData, + IX509Store x509Certs, + IX509Store x509Crls, + IX509Store x509AttrCerts) + { + if (x509AttrCerts != null) + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("Currently can't replace attribute certificates"); + + // + // copy + // + CmsSignedData cms = new CmsSignedData(signedData); + + // + // replace the certs and crls in the SignedData object + // + Asn1Set certs = null; + try + { + Asn1Set asn1Set = CmsUtilities.CreateBerSetFromList( + CmsUtilities.GetCertificatesFromStore(x509Certs)); + + if (asn1Set.Count != 0) + { + certs = asn1Set; + } + } + catch (X509StoreException e) + { + throw new CmsException("error getting certificates from store", e); + } + + Asn1Set crls = null; + try + { + Asn1Set asn1Set = CmsUtilities.CreateBerSetFromList( + CmsUtilities.GetCrlsFromStore(x509Crls)); + + if (asn1Set.Count != 0) + { + crls = asn1Set; + } + } + catch (X509StoreException e) + { + throw new CmsException("error getting CRLs from store", e); + } + + // + // replace the CMS structure. + // + SignedData old = signedData.signedData; + cms.signedData = new SignedData( + old.DigestAlgorithms, + old.EncapContentInfo, + certs, + crls, + old.SignerInfos); + + // + // replace the contentInfo with the new one + // + cms.contentInfo = new ContentInfo(cms.contentInfo.ContentType, cms.signedData); + + return cms; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedData.cs.meta new file mode 100644 index 00000000..fe63dbf6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c43e6a93201d37548a399de669fafeea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataGenerator.cs new file mode 100644 index 00000000..43e8c945 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataGenerator.cs @@ -0,0 +1,594 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * general class for generating a pkcs7-signature message. + *

+ * A simple example of usage. + * + *

+     *      IX509Store certs...
+     *      IX509Store crls...
+     *      CmsSignedDataGenerator gen = new CmsSignedDataGenerator();
+     *
+     *      gen.AddSigner(privKey, cert, CmsSignedGenerator.DigestSha1);
+     *      gen.AddCertificates(certs);
+     *      gen.AddCrls(crls);
+     *
+     *      CmsSignedData data = gen.Generate(content);
+     * 
+ *

+ */ + public class CmsSignedDataGenerator + : CmsSignedGenerator + { + private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance; + + private readonly IList signerInfs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + private class SignerInf + { + private readonly CmsSignedGenerator outer; + + private readonly ISignatureFactory sigCalc; + private readonly SignerIdentifier signerIdentifier; + private readonly string digestOID; + private readonly string encOID; + private readonly CmsAttributeTableGenerator sAttr; + private readonly CmsAttributeTableGenerator unsAttr; + private readonly Asn1.Cms.AttributeTable baseSignedTable; + + internal SignerInf( + CmsSignedGenerator outer, + AsymmetricKeyParameter key, + SignerIdentifier signerIdentifier, + string digestOID, + string encOID, + CmsAttributeTableGenerator sAttr, + CmsAttributeTableGenerator unsAttr, + Asn1.Cms.AttributeTable baseSignedTable) + { + string digestName = Helper.GetDigestAlgName(digestOID); + + string signatureName = digestName + "with" + Helper.GetEncryptionAlgName(encOID); + + this.outer = outer; + this.sigCalc = new Asn1SignatureFactory(signatureName, key); + this.signerIdentifier = signerIdentifier; + this.digestOID = digestOID; + this.encOID = encOID; + this.sAttr = sAttr; + this.unsAttr = unsAttr; + this.baseSignedTable = baseSignedTable; + } + + internal SignerInf( + CmsSignedGenerator outer, + ISignatureFactory sigCalc, + SignerIdentifier signerIdentifier, + CmsAttributeTableGenerator sAttr, + CmsAttributeTableGenerator unsAttr, + Asn1.Cms.AttributeTable baseSignedTable) + { + this.outer = outer; + this.sigCalc = sigCalc; + this.signerIdentifier = signerIdentifier; + this.digestOID = new DefaultDigestAlgorithmIdentifierFinder().find((AlgorithmIdentifier)sigCalc.AlgorithmDetails).Algorithm.Id; + this.encOID = ((AlgorithmIdentifier)sigCalc.AlgorithmDetails).Algorithm.Id; + this.sAttr = sAttr; + this.unsAttr = unsAttr; + this.baseSignedTable = baseSignedTable; + } + + internal AlgorithmIdentifier DigestAlgorithmID + { + get { return new AlgorithmIdentifier(new DerObjectIdentifier(digestOID), DerNull.Instance); } + } + + internal CmsAttributeTableGenerator SignedAttributes + { + get { return sAttr; } + } + + internal CmsAttributeTableGenerator UnsignedAttributes + { + get { return unsAttr; } + } + + internal SignerInfo ToSignerInfo( + DerObjectIdentifier contentType, + CmsProcessable content, + SecureRandom random) + { + AlgorithmIdentifier digAlgId = DigestAlgorithmID; + string digestName = Helper.GetDigestAlgName(digestOID); + + string signatureName = digestName + "with" + Helper.GetEncryptionAlgName(encOID); + + byte[] hash; + if (outer._digests.Contains(digestOID)) + { + hash = (byte[])outer._digests[digestOID]; + } + else + { + IDigest dig = Helper.GetDigestInstance(digestName); + if (content != null) + { + content.Write(new DigestSink(dig)); + } + hash = DigestUtilities.DoFinal(dig); + outer._digests.Add(digestOID, hash.Clone()); + } + + IStreamCalculator calculator = sigCalc.CreateCalculator(); + +#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE + Stream sigStr = calculator.Stream; +#else + Stream sigStr = new BufferedStream(calculator.Stream); +#endif + + Asn1Set signedAttr = null; + if (sAttr != null) + { + IDictionary parameters = outer.GetBaseParameters(contentType, digAlgId, hash); + +// Asn1.Cms.AttributeTable signed = sAttr.GetAttributes(Collections.unmodifiableMap(parameters)); + Asn1.Cms.AttributeTable signed = sAttr.GetAttributes(parameters); + + if (contentType == null) //counter signature + { + if (signed != null && signed[CmsAttributes.ContentType] != null) + { + IDictionary tmpSigned = signed.ToDictionary(); + tmpSigned.Remove(CmsAttributes.ContentType); + signed = new Asn1.Cms.AttributeTable(tmpSigned); + } + } + + // TODO Validate proposed signed attributes + + signedAttr = outer.GetAttributeSet(signed); + + // sig must be composed from the DER encoding. + new DerOutputStream(sigStr).WriteObject(signedAttr); + } + else if (content != null) + { + // TODO Use raw signature of the hash value instead + content.Write(sigStr); + } + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(sigStr); + byte[] sigBytes = ((IBlockResult)calculator.GetResult()).Collect(); + + Asn1Set unsignedAttr = null; + if (unsAttr != null) + { + IDictionary baseParameters = outer.GetBaseParameters(contentType, digAlgId, hash); + baseParameters[CmsAttributeTableParameter.Signature] = sigBytes.Clone(); + +// Asn1.Cms.AttributeTable unsigned = unsAttr.GetAttributes(Collections.unmodifiableMap(baseParameters)); + Asn1.Cms.AttributeTable unsigned = unsAttr.GetAttributes(baseParameters); + + // TODO Validate proposed unsigned attributes + + unsignedAttr = outer.GetAttributeSet(unsigned); + } + + // TODO[RSAPSS] Need the ability to specify non-default parameters + Asn1Encodable sigX509Parameters = SignerUtilities.GetDefaultX509Parameters(signatureName); + AlgorithmIdentifier encAlgId = Helper.GetEncAlgorithmIdentifier( + new DerObjectIdentifier(encOID), sigX509Parameters); + + return new SignerInfo(signerIdentifier, digAlgId, + signedAttr, encAlgId, new DerOctetString(sigBytes), unsignedAttr); + } + } + + public CmsSignedDataGenerator() + { + } + + /// Constructor allowing specific source of randomness + /// Instance of SecureRandom to use. + public CmsSignedDataGenerator( + SecureRandom rand) + : base(rand) + { + } + + /** + * add a signer - no attributes other than the default ones will be + * provided here. + * + * @param key signing key to use + * @param cert certificate containing corresponding public key + * @param digestOID digest algorithm OID + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string digestOID) + { + AddSigner(privateKey, cert, Helper.GetEncOid(privateKey, digestOID), digestOID); + } + + /** + * add a signer, specifying the digest encryption algorithm to use - no attributes other than the default ones will be + * provided here. + * + * @param key signing key to use + * @param cert certificate containing corresponding public key + * @param encryptionOID digest encryption algorithm OID + * @param digestOID digest algorithm OID + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string encryptionOID, + string digestOID) + { + doAddSigner(privateKey, GetSignerIdentifier(cert), encryptionOID, digestOID, + new DefaultSignedAttributeTableGenerator(), null, null); + } + + /** + * add a signer - no attributes other than the default ones will be + * provided here. + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string digestOID) + { + AddSigner(privateKey, subjectKeyID, Helper.GetEncOid(privateKey, digestOID), digestOID); + } + + /** + * add a signer, specifying the digest encryption algorithm to use - no attributes other than the default ones will be + * provided here. + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string encryptionOID, + string digestOID) + { + doAddSigner(privateKey, GetSignerIdentifier(subjectKeyID), encryptionOID, digestOID, + new DefaultSignedAttributeTableGenerator(), null, null); + } + + /** + * add a signer with extra signed/unsigned attributes. + * + * @param key signing key to use + * @param cert certificate containing corresponding public key + * @param digestOID digest algorithm OID + * @param signedAttr table of attributes to be included in signature + * @param unsignedAttr table of attributes to be included as unsigned + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string digestOID, + Asn1.Cms.AttributeTable signedAttr, + Asn1.Cms.AttributeTable unsignedAttr) + { + AddSigner(privateKey, cert, Helper.GetEncOid(privateKey, digestOID), digestOID, + signedAttr, unsignedAttr); + } + + /** + * add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes. + * + * @param key signing key to use + * @param cert certificate containing corresponding public key + * @param encryptionOID digest encryption algorithm OID + * @param digestOID digest algorithm OID + * @param signedAttr table of attributes to be included in signature + * @param unsignedAttr table of attributes to be included as unsigned + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string encryptionOID, + string digestOID, + Asn1.Cms.AttributeTable signedAttr, + Asn1.Cms.AttributeTable unsignedAttr) + { + doAddSigner(privateKey, GetSignerIdentifier(cert), encryptionOID, digestOID, + new DefaultSignedAttributeTableGenerator(signedAttr), + new SimpleAttributeTableGenerator(unsignedAttr), + signedAttr); + } + + /** + * add a signer with extra signed/unsigned attributes. + * + * @param key signing key to use + * @param subjectKeyID subjectKeyID of corresponding public key + * @param digestOID digest algorithm OID + * @param signedAttr table of attributes to be included in signature + * @param unsignedAttr table of attributes to be included as unsigned + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string digestOID, + Asn1.Cms.AttributeTable signedAttr, + Asn1.Cms.AttributeTable unsignedAttr) + { + AddSigner(privateKey, subjectKeyID, Helper.GetEncOid(privateKey, digestOID), digestOID, + signedAttr, unsignedAttr); + } + + /** + * add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes. + * + * @param key signing key to use + * @param subjectKeyID subjectKeyID of corresponding public key + * @param encryptionOID digest encryption algorithm OID + * @param digestOID digest algorithm OID + * @param signedAttr table of attributes to be included in signature + * @param unsignedAttr table of attributes to be included as unsigned + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string encryptionOID, + string digestOID, + Asn1.Cms.AttributeTable signedAttr, + Asn1.Cms.AttributeTable unsignedAttr) + { + doAddSigner(privateKey, GetSignerIdentifier(subjectKeyID), encryptionOID, digestOID, + new DefaultSignedAttributeTableGenerator(signedAttr), + new SimpleAttributeTableGenerator(unsignedAttr), + signedAttr); + } + + /** + * add a signer with extra signed/unsigned attributes based on generators. + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string digestOID, + CmsAttributeTableGenerator signedAttrGen, + CmsAttributeTableGenerator unsignedAttrGen) + { + AddSigner(privateKey, cert, Helper.GetEncOid(privateKey, digestOID), digestOID, + signedAttrGen, unsignedAttrGen); + } + + /** + * add a signer, specifying the digest encryption algorithm, with extra signed/unsigned attributes based on generators. + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string encryptionOID, + string digestOID, + CmsAttributeTableGenerator signedAttrGen, + CmsAttributeTableGenerator unsignedAttrGen) + { + doAddSigner(privateKey, GetSignerIdentifier(cert), encryptionOID, digestOID, signedAttrGen, + unsignedAttrGen, null); + } + + /** + * add a signer with extra signed/unsigned attributes based on generators. + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string digestOID, + CmsAttributeTableGenerator signedAttrGen, + CmsAttributeTableGenerator unsignedAttrGen) + { + AddSigner(privateKey, subjectKeyID, Helper.GetEncOid(privateKey, digestOID), digestOID, + signedAttrGen, unsignedAttrGen); + } + + /** + * add a signer, including digest encryption algorithm, with extra signed/unsigned attributes based on generators. + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string encryptionOID, + string digestOID, + CmsAttributeTableGenerator signedAttrGen, + CmsAttributeTableGenerator unsignedAttrGen) + { + doAddSigner(privateKey, GetSignerIdentifier(subjectKeyID), encryptionOID, digestOID, + signedAttrGen, unsignedAttrGen, null); + } + + public void AddSignerInfoGenerator(SignerInfoGenerator signerInfoGenerator) + { + signerInfs.Add(new SignerInf(this, signerInfoGenerator.contentSigner, signerInfoGenerator.sigId, + signerInfoGenerator.signedGen, signerInfoGenerator.unsignedGen, null)); + } + + private void doAddSigner( + AsymmetricKeyParameter privateKey, + SignerIdentifier signerIdentifier, + string encryptionOID, + string digestOID, + CmsAttributeTableGenerator signedAttrGen, + CmsAttributeTableGenerator unsignedAttrGen, + Asn1.Cms.AttributeTable baseSignedTable) + { + signerInfs.Add(new SignerInf(this, privateKey, signerIdentifier, digestOID, encryptionOID, + signedAttrGen, unsignedAttrGen, baseSignedTable)); + } + + /** + * generate a signed object that for a CMS Signed Data object + */ + public CmsSignedData Generate( + CmsProcessable content) + { + return Generate(content, false); + } + + /** + * generate a signed object that for a CMS Signed Data + * object - if encapsulate is true a copy + * of the message will be included in the signature. The content type + * is set according to the OID represented by the string signedContentType. + */ + public CmsSignedData Generate( + string signedContentType, + // FIXME Avoid accessing more than once to support CmsProcessableInputStream + CmsProcessable content, + bool encapsulate) + { + Asn1EncodableVector digestAlgs = new Asn1EncodableVector(); + Asn1EncodableVector signerInfos = new Asn1EncodableVector(); + + _digests.Clear(); // clear the current preserved digest state + + // + // add the precalculated SignerInfo objects. + // + foreach (SignerInformation signer in _signers) + { + digestAlgs.Add(Helper.FixAlgID(signer.DigestAlgorithmID)); + + // TODO Verify the content type and calculated digest match the precalculated SignerInfo + signerInfos.Add(signer.ToSignerInfo()); + } + + // + // add the SignerInfo objects + // + bool isCounterSignature = (signedContentType == null); + + DerObjectIdentifier contentTypeOid = isCounterSignature + ? null + : new DerObjectIdentifier(signedContentType); + + foreach (SignerInf signer in signerInfs) + { + try + { + digestAlgs.Add(signer.DigestAlgorithmID); + signerInfos.Add(signer.ToSignerInfo(contentTypeOid, content, rand)); + } + catch (IOException e) + { + throw new CmsException("encoding error.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key inappropriate for signature.", e); + } + catch (SignatureException e) + { + throw new CmsException("error creating signature.", e); + } + catch (CertificateEncodingException e) + { + throw new CmsException("error creating sid.", e); + } + } + + Asn1Set certificates = null; + + if (_certs.Count != 0) + { + certificates = UseDerForCerts + ? CmsUtilities.CreateDerSetFromList(_certs) + : CmsUtilities.CreateBerSetFromList(_certs); + } + + Asn1Set certrevlist = null; + + if (_crls.Count != 0) + { + certrevlist = UseDerForCrls + ? CmsUtilities.CreateDerSetFromList(_crls) + : CmsUtilities.CreateBerSetFromList(_crls); + } + + Asn1OctetString octs = null; + if (encapsulate) + { + MemoryStream bOut = new MemoryStream(); + if (content != null) + { + try + { + content.Write(bOut); + } + catch (IOException e) + { + throw new CmsException("encapsulation error.", e); + } + } + octs = new BerOctetString(bOut.ToArray()); + } + + ContentInfo encInfo = new ContentInfo(contentTypeOid, octs); + + SignedData sd = new SignedData( + new DerSet(digestAlgs), + encInfo, + certificates, + certrevlist, + new DerSet(signerInfos)); + + ContentInfo contentInfo = new ContentInfo(CmsObjectIdentifiers.SignedData, sd); + + return new CmsSignedData(content, contentInfo); + } + + /** + * generate a signed object that for a CMS Signed Data + * object - if encapsulate is true a copy + * of the message will be included in the signature with the + * default content type "data". + */ + public CmsSignedData Generate( + CmsProcessable content, + bool encapsulate) + { + return this.Generate(Data, content, encapsulate); + } + + /** + * generate a set of one or more SignerInformation objects representing counter signatures on + * the passed in SignerInformation object. + * + * @param signer the signer to be countersigned + * @param sigProvider the provider to be used for counter signing. + * @return a store containing the signers. + */ + public SignerInformationStore GenerateCounterSigners( + SignerInformation signer) + { + return this.Generate(null, new CmsProcessableByteArray(signer.GetSignature()), false).GetSignerInfos(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataGenerator.cs.meta new file mode 100644 index 00000000..4c34f1eb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 027a8f21814c46547a37d4ef8abcb9f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataParser.cs new file mode 100644 index 00000000..e1df8efb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataParser.cs @@ -0,0 +1,454 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * Parsing class for an CMS Signed Data object from an input stream. + *

+ * Note: that because we are in a streaming mode only one signer can be tried and it is important + * that the methods on the parser are called in the appropriate order. + *

+ *

+ * A simple example of usage for an encapsulated signature. + *

+ *

+ * Two notes: first, in the example below the validity of + * the certificate isn't verified, just the fact that one of the certs + * matches the given signer, and, second, because we are in a streaming + * mode the order of the operations is important. + *

+ *
+	*      CmsSignedDataParser     sp = new CmsSignedDataParser(encapSigData);
+	*
+	*      sp.GetSignedContent().Drain();
+	*
+	*      IX509Store              certs = sp.GetCertificates();
+	*      SignerInformationStore  signers = sp.GetSignerInfos();
+	*
+	*      foreach (SignerInformation signer in signers.GetSigners())
+	*      {
+	*          ArrayList       certList = new ArrayList(certs.GetMatches(signer.SignerID));
+	*          X509Certificate cert = (X509Certificate) certList[0];
+	*
+	*          Console.WriteLine("verify returns: " + signer.Verify(cert));
+	*      }
+	* 
+ * Note also: this class does not introduce buffering - if you are processing large files you should create + * the parser with: + *
+	*          CmsSignedDataParser     ep = new CmsSignedDataParser(new BufferedInputStream(encapSigData, bufSize));
+	*  
+ * where bufSize is a suitably large buffer size. + */ + public class CmsSignedDataParser + : CmsContentInfoParser + { + private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance; + + private SignedDataParser _signedData; + private DerObjectIdentifier _signedContentType; + private CmsTypedStream _signedContent; + private IDictionary _digests; + private ISet _digestOids; + + private SignerInformationStore _signerInfoStore; + private Asn1Set _certSet, _crlSet; + private bool _isCertCrlParsed; + private IX509Store _attributeStore; + private IX509Store _certificateStore; + private IX509Store _crlStore; + + public CmsSignedDataParser( + byte[] sigBlock) + : this(new MemoryStream(sigBlock, false)) + { + } + + public CmsSignedDataParser( + CmsTypedStream signedContent, + byte[] sigBlock) + : this(signedContent, new MemoryStream(sigBlock, false)) + { + } + + /** + * base constructor - with encapsulated content + */ + public CmsSignedDataParser( + Stream sigData) + : this(null, sigData) + { + } + + /** + * base constructor + * + * @param signedContent the content that was signed. + * @param sigData the signature object. + */ + public CmsSignedDataParser( + CmsTypedStream signedContent, + Stream sigData) + : base(sigData) + { + try + { + this._signedContent = signedContent; + this._signedData = SignedDataParser.GetInstance(this.contentInfo.GetContent(Asn1Tags.Sequence)); + this._digests = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + this._digestOids = new HashSet(); + + Asn1SetParser digAlgs = _signedData.GetDigestAlgorithms(); + IAsn1Convertible o; + + while ((o = digAlgs.ReadObject()) != null) + { + AlgorithmIdentifier id = AlgorithmIdentifier.GetInstance(o.ToAsn1Object()); + + try + { + string digestOid = id.Algorithm.Id; + string digestName = Helper.GetDigestAlgName(digestOid); + + if (!this._digests.Contains(digestName)) + { + this._digests[digestName] = Helper.GetDigestInstance(digestName); + this._digestOids.Add(digestOid); + } + } + catch (SecurityUtilityException) + { + // TODO Should do something other than ignore it + } + } + + // + // If the message is simply a certificate chain message GetContent() may return null. + // + ContentInfoParser cont = _signedData.GetEncapContentInfo(); + Asn1OctetStringParser octs = (Asn1OctetStringParser) + cont.GetContent(Asn1Tags.OctetString); + + if (octs != null) + { + CmsTypedStream ctStr = new CmsTypedStream( + cont.ContentType.Id, octs.GetOctetStream()); + + if (_signedContent == null) + { + this._signedContent = ctStr; + } + else + { + // + // content passed in, need to read past empty encapsulated content info object if present + // + ctStr.Drain(); + } + } + + _signedContentType = _signedContent == null + ? cont.ContentType + : new DerObjectIdentifier(_signedContent.ContentType); + } + catch (IOException e) + { + throw new CmsException("io exception: " + e.Message, e); + } + } + + /** + * Return the version number for the SignedData object + * + * @return the version number + */ + public int Version + { + get { return _signedData.Version.Value.IntValue; } + } + + public ISet DigestOids + { + get { return new HashSet(_digestOids); } + } + + /** + * return the collection of signers that are associated with the + * signatures for the message. + * @throws CmsException + */ + public SignerInformationStore GetSignerInfos() + { + if (_signerInfoStore == null) + { + PopulateCertCrlSets(); + + IList signerInfos = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + IDictionary hashes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + foreach (object digestKey in _digests.Keys) + { + hashes[digestKey] = DigestUtilities.DoFinal( + (IDigest)_digests[digestKey]); + } + + try + { + Asn1SetParser s = _signedData.GetSignerInfos(); + IAsn1Convertible o; + + while ((o = s.ReadObject()) != null) + { + SignerInfo info = SignerInfo.GetInstance(o.ToAsn1Object()); + string digestName = Helper.GetDigestAlgName( + info.DigestAlgorithm.Algorithm.Id); + + byte[] hash = (byte[]) hashes[digestName]; + + signerInfos.Add(new SignerInformation(info, _signedContentType, null, new BaseDigestCalculator(hash))); + } + } + catch (IOException e) + { + throw new CmsException("io exception: " + e.Message, e); + } + + _signerInfoStore = new SignerInformationStore(signerInfos); + } + + return _signerInfoStore; + } + + /** + * return a X509Store containing the attribute certificates, if any, contained + * in this message. + * + * @param type type of store to create + * @return a store of attribute certificates + * @exception org.bouncycastle.x509.NoSuchStoreException if the store type isn't available. + * @exception CmsException if a general exception prevents creation of the X509Store + */ + public IX509Store GetAttributeCertificates( + string type) + { + if (_attributeStore == null) + { + PopulateCertCrlSets(); + + _attributeStore = Helper.CreateAttributeStore(type, _certSet); + } + + return _attributeStore; + } + + /** + * return a X509Store containing the public key certificates, if any, contained + * in this message. + * + * @param type type of store to create + * @return a store of public key certificates + * @exception NoSuchStoreException if the store type isn't available. + * @exception CmsException if a general exception prevents creation of the X509Store + */ + public IX509Store GetCertificates( + string type) + { + if (_certificateStore == null) + { + PopulateCertCrlSets(); + + _certificateStore = Helper.CreateCertificateStore(type, _certSet); + } + + return _certificateStore; + } + + /** + * return a X509Store containing CRLs, if any, contained + * in this message. + * + * @param type type of store to create + * @return a store of CRLs + * @exception NoSuchStoreException if the store type isn't available. + * @exception CmsException if a general exception prevents creation of the X509Store + */ + public IX509Store GetCrls( + string type) + { + if (_crlStore == null) + { + PopulateCertCrlSets(); + + _crlStore = Helper.CreateCrlStore(type, _crlSet); + } + + return _crlStore; + } + + private void PopulateCertCrlSets() + { + if (_isCertCrlParsed) + return; + + _isCertCrlParsed = true; + + try + { + // care! Streaming - Must process the GetCertificates() result before calling GetCrls() + _certSet = GetAsn1Set(_signedData.GetCertificates()); + _crlSet = GetAsn1Set(_signedData.GetCrls()); + } + catch (IOException e) + { + throw new CmsException("problem parsing cert/crl sets", e); + } + } + + /// + /// Return the DerObjectIdentifier associated with the encapsulated + /// content info structure carried in the signed data. + /// + public DerObjectIdentifier SignedContentType + { + get { return _signedContentType; } + } + + public CmsTypedStream GetSignedContent() + { + if (_signedContent == null) + { + return null; + } + + Stream digStream = _signedContent.ContentStream; + + foreach (IDigest digest in _digests.Values) + { + digStream = new DigestStream(digStream, digest, null); + } + + return new CmsTypedStream(_signedContent.ContentType, digStream); + } + + /** + * Replace the signerinformation store associated with the passed + * in message contained in the stream original with the new one passed in. + * You would probably only want to do this if you wanted to change the unsigned + * attributes associated with a signer, or perhaps delete one. + *

+ * The output stream is returned unclosed. + *

+ * @param original the signed data stream to be used as a base. + * @param signerInformationStore the new signer information store to use. + * @param out the stream to Write the new signed data object to. + * @return out. + */ + public static Stream ReplaceSigners( + Stream original, + SignerInformationStore signerInformationStore, + Stream outStr) + { + // NB: SecureRandom would be ignored since using existing signatures only + CmsSignedDataStreamGenerator gen = new CmsSignedDataStreamGenerator(); + CmsSignedDataParser parser = new CmsSignedDataParser(original); + +// gen.AddDigests(parser.DigestOids); + gen.AddSigners(signerInformationStore); + + CmsTypedStream signedContent = parser.GetSignedContent(); + bool encapsulate = (signedContent != null); + Stream contentOut = gen.Open(outStr, parser.SignedContentType.Id, encapsulate); + if (encapsulate) + { + Streams.PipeAll(signedContent.ContentStream, contentOut); + } + + gen.AddAttributeCertificates(parser.GetAttributeCertificates("Collection")); + gen.AddCertificates(parser.GetCertificates("Collection")); + gen.AddCrls(parser.GetCrls("Collection")); + +// gen.AddSigners(parser.GetSignerInfos()); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(contentOut); + + return outStr; + } + + /** + * Replace the certificate and CRL information associated with this + * CMSSignedData object with the new one passed in. + *

+ * The output stream is returned unclosed. + *

+ * @param original the signed data stream to be used as a base. + * @param certsAndCrls the new certificates and CRLs to be used. + * @param out the stream to Write the new signed data object to. + * @return out. + * @exception CmsException if there is an error processing the CertStore + */ + public static Stream ReplaceCertificatesAndCrls( + Stream original, + IX509Store x509Certs, + IX509Store x509Crls, + IX509Store x509AttrCerts, + Stream outStr) + { + // NB: SecureRandom would be ignored since using existing signatures only + CmsSignedDataStreamGenerator gen = new CmsSignedDataStreamGenerator(); + CmsSignedDataParser parser = new CmsSignedDataParser(original); + + gen.AddDigests(parser.DigestOids); + + CmsTypedStream signedContent = parser.GetSignedContent(); + bool encapsulate = (signedContent != null); + Stream contentOut = gen.Open(outStr, parser.SignedContentType.Id, encapsulate); + if (encapsulate) + { + Streams.PipeAll(signedContent.ContentStream, contentOut); + } + +// gen.AddAttributeCertificates(parser.GetAttributeCertificates("Collection")); +// gen.AddCertificates(parser.GetCertificates("Collection")); +// gen.AddCrls(parser.GetCrls("Collection")); + if (x509AttrCerts != null) + gen.AddAttributeCertificates(x509AttrCerts); + if (x509Certs != null) + gen.AddCertificates(x509Certs); + if (x509Crls != null) + gen.AddCrls(x509Crls); + + gen.AddSigners(parser.GetSignerInfos()); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(contentOut); + + return outStr; + } + + private static Asn1Set GetAsn1Set( + Asn1SetParser asn1SetParser) + { + return asn1SetParser == null + ? null + : Asn1Set.GetInstance(asn1SetParser.ToAsn1Object()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataParser.cs.meta new file mode 100644 index 00000000..e3f0287c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ccc5588045627642964cdaa1b1fddcf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataStreamGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataStreamGenerator.cs new file mode 100644 index 00000000..e8c0cd12 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataStreamGenerator.cs @@ -0,0 +1,937 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Diagnostics; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * General class for generating a pkcs7-signature message stream. + *

+ * A simple example of usage. + *

+ *
+    *      IX509Store                   certs...
+    *      CmsSignedDataStreamGenerator gen = new CmsSignedDataStreamGenerator();
+    *
+    *      gen.AddSigner(privateKey, cert, CmsSignedDataStreamGenerator.DIGEST_SHA1);
+    *
+    *      gen.AddCertificates(certs);
+    *
+    *      Stream sigOut = gen.Open(bOut);
+    *
+    *      sigOut.Write(Encoding.UTF8.GetBytes("Hello World!"));
+    *
+    *      sigOut.Close();
+    * 
+ */ + public class CmsSignedDataStreamGenerator + : CmsSignedGenerator + { + private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance; + + private readonly IList _signerInfs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + private readonly ISet _messageDigestOids = new HashSet(); + private readonly IDictionary _messageDigests = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private readonly IDictionary _messageHashes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private bool _messageDigestsLocked; + private int _bufferSize; + + private class DigestAndSignerInfoGeneratorHolder + { + internal readonly ISignerInfoGenerator signerInf; + internal readonly string digestOID; + + internal DigestAndSignerInfoGeneratorHolder(ISignerInfoGenerator signerInf, String digestOID) + { + this.signerInf = signerInf; + this.digestOID = digestOID; + } + + internal AlgorithmIdentifier DigestAlgorithm + { + get { return new AlgorithmIdentifier(new DerObjectIdentifier(this.digestOID), DerNull.Instance); } + } + } + + private class SignerInfoGeneratorImpl : ISignerInfoGenerator + { + private readonly CmsSignedDataStreamGenerator outer; + + private readonly SignerIdentifier _signerIdentifier; + private readonly string _digestOID; + private readonly string _encOID; + private readonly CmsAttributeTableGenerator _sAttr; + private readonly CmsAttributeTableGenerator _unsAttr; + private readonly string _encName; + private readonly ISigner _sig; + + internal SignerInfoGeneratorImpl( + CmsSignedDataStreamGenerator outer, + AsymmetricKeyParameter key, + SignerIdentifier signerIdentifier, + string digestOID, + string encOID, + CmsAttributeTableGenerator sAttr, + CmsAttributeTableGenerator unsAttr) + { + this.outer = outer; + + _signerIdentifier = signerIdentifier; + _digestOID = digestOID; + _encOID = encOID; + _sAttr = sAttr; + _unsAttr = unsAttr; + _encName = Helper.GetEncryptionAlgName(_encOID); + + string digestName = Helper.GetDigestAlgName(_digestOID); + string signatureName = digestName + "with" + _encName; + + if (_sAttr != null) + { + _sig = Helper.GetSignatureInstance(signatureName); + } + else + { + // Note: Need to use raw signatures here since we have already calculated the digest + if (_encName.Equals("RSA")) + { + _sig = Helper.GetSignatureInstance("RSA"); + } + else if (_encName.Equals("DSA")) + { + _sig = Helper.GetSignatureInstance("NONEwithDSA"); + } + // TODO Add support for raw PSS +// else if (_encName.equals("RSAandMGF1")) +// { +// _sig = CMSSignedHelper.INSTANCE.getSignatureInstance("NONEWITHRSAPSS", _sigProvider); +// try +// { +// // Init the params this way to avoid having a 'raw' version of each PSS algorithm +// Signature sig2 = CMSSignedHelper.INSTANCE.getSignatureInstance(signatureName, _sigProvider); +// PSSParameterSpec spec = (PSSParameterSpec)sig2.getParameters().getParameterSpec(PSSParameterSpec.class); +// _sig.setParameter(spec); +// } +// catch (Exception e) +// { +// throw new SignatureException("algorithm: " + _encName + " could not be configured."); +// } +// } + else + { + throw new SignatureException("algorithm: " + _encName + " not supported in base signatures."); + } + } + + _sig.Init(true, new ParametersWithRandom(key, outer.rand)); + } + + public SignerInfo Generate(DerObjectIdentifier contentType, AlgorithmIdentifier digestAlgorithm, + byte[] calculatedDigest) + { + try + { + string digestName = Helper.GetDigestAlgName(_digestOID); + string signatureName = digestName + "with" + _encName; + +// AlgorithmIdentifier digAlgId = DigestAlgorithmID; +// +// byte[] hash = (byte[])outer._messageHashes[Helper.GetDigestAlgName(this._digestOID)]; +// outer._digests[_digestOID] = hash.Clone(); + + byte[] bytesToSign = calculatedDigest; + + /* RFC 3852 5.4 + * The result of the message digest calculation process depends on + * whether the signedAttrs field is present. When the field is absent, + * the result is just the message digest of the content as described + * + * above. When the field is present, however, the result is the message + * digest of the complete DER encoding of the SignedAttrs value + * contained in the signedAttrs field. + */ + Asn1Set signedAttr = null; + if (_sAttr != null) + { + IDictionary parameters = outer.GetBaseParameters(contentType, digestAlgorithm, calculatedDigest); + +// Asn1.Cms.AttributeTable signed = _sAttr.GetAttributes(Collections.unmodifiableMap(parameters)); + Asn1.Cms.AttributeTable signed = _sAttr.GetAttributes(parameters); + + if (contentType == null) //counter signature + { + if (signed != null && signed[CmsAttributes.ContentType] != null) + { + IDictionary tmpSigned = signed.ToDictionary(); + tmpSigned.Remove(CmsAttributes.ContentType); + signed = new Asn1.Cms.AttributeTable(tmpSigned); + } + } + + signedAttr = outer.GetAttributeSet(signed); + + // sig must be composed from the DER encoding. + bytesToSign = signedAttr.GetEncoded(Asn1Encodable.Der); + } + else + { + // Note: Need to use raw signatures here since we have already calculated the digest + if (_encName.Equals("RSA")) + { + DigestInfo dInfo = new DigestInfo(digestAlgorithm, calculatedDigest); + bytesToSign = dInfo.GetEncoded(Asn1Encodable.Der); + } + } + + _sig.BlockUpdate(bytesToSign, 0, bytesToSign.Length); + byte[] sigBytes = _sig.GenerateSignature(); + + Asn1Set unsignedAttr = null; + if (_unsAttr != null) + { + IDictionary parameters = outer.GetBaseParameters( + contentType, digestAlgorithm, calculatedDigest); + parameters[CmsAttributeTableParameter.Signature] = sigBytes.Clone(); + +// Asn1.Cms.AttributeTable unsigned = _unsAttr.getAttributes(Collections.unmodifiableMap(parameters)); + Asn1.Cms.AttributeTable unsigned = _unsAttr.GetAttributes(parameters); + + unsignedAttr = outer.GetAttributeSet(unsigned); + } + + // TODO[RSAPSS] Need the ability to specify non-default parameters + Asn1Encodable sigX509Parameters = SignerUtilities.GetDefaultX509Parameters(signatureName); + AlgorithmIdentifier digestEncryptionAlgorithm = Helper.GetEncAlgorithmIdentifier( + new DerObjectIdentifier(_encOID), sigX509Parameters); + + return new SignerInfo(_signerIdentifier, digestAlgorithm, + signedAttr, digestEncryptionAlgorithm, new DerOctetString(sigBytes), unsignedAttr); + } + catch (IOException e) + { + throw new CmsStreamException("encoding error.", e); + } + catch (SignatureException e) + { + throw new CmsStreamException("error creating signature.", e); + } + } + } + + public CmsSignedDataStreamGenerator() + { + } + + /// Constructor allowing specific source of randomness + /// Instance of SecureRandom to use. + public CmsSignedDataStreamGenerator( + SecureRandom rand) + : base(rand) + { + } + + /** + * Set the underlying string size for encapsulated data + * + * @param bufferSize length of octet strings to buffer the data. + */ + public void SetBufferSize( + int bufferSize) + { + _bufferSize = bufferSize; + } + + public void AddDigests( + params string[] digestOids) + { + AddDigests((IEnumerable) digestOids); + } + + public void AddDigests( + IEnumerable digestOids) + { + foreach (string digestOid in digestOids) + { + ConfigureDigest(digestOid); + } + } + + /** + * add a signer - no attributes other than the default ones will be + * provided here. + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string digestOid) + { + AddSigner(privateKey, cert, digestOid, + new DefaultSignedAttributeTableGenerator(), null); + } + + /** + * add a signer, specifying the digest encryption algorithm - no attributes other than the default ones will be + * provided here. + * @throws NoSuchProviderException + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string encryptionOid, + string digestOid) + { + AddSigner(privateKey, cert, encryptionOid, digestOid, + new DefaultSignedAttributeTableGenerator(), + (CmsAttributeTableGenerator)null); + } + + /** + * add a signer with extra signed/unsigned attributes. + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string digestOid, + Asn1.Cms.AttributeTable signedAttr, + Asn1.Cms.AttributeTable unsignedAttr) + { + AddSigner(privateKey, cert, digestOid, + new DefaultSignedAttributeTableGenerator(signedAttr), + new SimpleAttributeTableGenerator(unsignedAttr)); + } + + /** + * add a signer with extra signed/unsigned attributes - specifying digest + * encryption algorithm. + * @throws NoSuchProviderException + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string encryptionOid, + string digestOid, + Asn1.Cms.AttributeTable signedAttr, + Asn1.Cms.AttributeTable unsignedAttr) + { + AddSigner(privateKey, cert, encryptionOid, digestOid, + new DefaultSignedAttributeTableGenerator(signedAttr), + new SimpleAttributeTableGenerator(unsignedAttr)); + } + + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string digestOid, + CmsAttributeTableGenerator signedAttrGenerator, + CmsAttributeTableGenerator unsignedAttrGenerator) + { + AddSigner(privateKey, cert, Helper.GetEncOid(privateKey, digestOid), digestOid, + signedAttrGenerator, unsignedAttrGenerator); + } + + public void AddSigner( + AsymmetricKeyParameter privateKey, + X509Certificate cert, + string encryptionOid, + string digestOid, + CmsAttributeTableGenerator signedAttrGenerator, + CmsAttributeTableGenerator unsignedAttrGenerator) + { + DoAddSigner(privateKey, GetSignerIdentifier(cert), encryptionOid, digestOid, + signedAttrGenerator, unsignedAttrGenerator); + } + + /** + * add a signer - no attributes other than the default ones will be + * provided here. + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string digestOid) + { + AddSigner(privateKey, subjectKeyID, digestOid, new DefaultSignedAttributeTableGenerator(), + (CmsAttributeTableGenerator)null); + } + + /** + * add a signer - no attributes other than the default ones will be + * provided here. + * @throws NoSuchProviderException + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string encryptionOid, + string digestOid) + { + AddSigner(privateKey, subjectKeyID, encryptionOid, digestOid, + new DefaultSignedAttributeTableGenerator(), + (CmsAttributeTableGenerator)null); + } + + /** + * add a signer with extra signed/unsigned attributes. + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string digestOid, + Asn1.Cms.AttributeTable signedAttr, + Asn1.Cms.AttributeTable unsignedAttr) + { + AddSigner(privateKey, subjectKeyID, digestOid, + new DefaultSignedAttributeTableGenerator(signedAttr), + new SimpleAttributeTableGenerator(unsignedAttr)); + } + + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string digestOid, + CmsAttributeTableGenerator signedAttrGenerator, + CmsAttributeTableGenerator unsignedAttrGenerator) + { + AddSigner(privateKey, subjectKeyID, Helper.GetEncOid(privateKey, digestOid), + digestOid, signedAttrGenerator, unsignedAttrGenerator); + } + + public void AddSigner( + AsymmetricKeyParameter privateKey, + byte[] subjectKeyID, + string encryptionOid, + string digestOid, + CmsAttributeTableGenerator signedAttrGenerator, + CmsAttributeTableGenerator unsignedAttrGenerator) + { + DoAddSigner(privateKey, GetSignerIdentifier(subjectKeyID), encryptionOid, digestOid, + signedAttrGenerator, unsignedAttrGenerator); + } + + private void DoAddSigner( + AsymmetricKeyParameter privateKey, + SignerIdentifier signerIdentifier, + string encryptionOid, + string digestOid, + CmsAttributeTableGenerator signedAttrGenerator, + CmsAttributeTableGenerator unsignedAttrGenerator) + { + ConfigureDigest(digestOid); + + SignerInfoGeneratorImpl signerInf = new SignerInfoGeneratorImpl(this, privateKey, + signerIdentifier, digestOid, encryptionOid, signedAttrGenerator, unsignedAttrGenerator); + + _signerInfs.Add(new DigestAndSignerInfoGeneratorHolder(signerInf, digestOid)); + } + + internal override void AddSignerCallback( + SignerInformation si) + { + // FIXME If there were parameters in si.DigestAlgorithmID.Parameters, they are lost + // NB: Would need to call FixAlgID on the DigestAlgorithmID + + // For precalculated signers, just need to register the algorithm, not configure a digest + RegisterDigestOid(si.DigestAlgorithmID.Algorithm.Id); + } + + /** + * generate a signed object that for a CMS Signed Data object + */ + public Stream Open( + Stream outStream) + { + return Open(outStream, false); + } + + /** + * generate a signed object that for a CMS Signed Data + * object - if encapsulate is true a copy + * of the message will be included in the signature with the + * default content type "data". + */ + public Stream Open( + Stream outStream, + bool encapsulate) + { + return Open(outStream, Data, encapsulate); + } + + /** + * generate a signed object that for a CMS Signed Data + * object using the given provider - if encapsulate is true a copy + * of the message will be included in the signature with the + * default content type "data". If dataOutputStream is non null the data + * being signed will be written to the stream as it is processed. + * @param out stream the CMS object is to be written to. + * @param encapsulate true if data should be encapsulated. + * @param dataOutputStream output stream to copy the data being signed to. + */ + public Stream Open( + Stream outStream, + bool encapsulate, + Stream dataOutputStream) + { + return Open(outStream, Data, encapsulate, dataOutputStream); + } + + /** + * generate a signed object that for a CMS Signed Data + * object - if encapsulate is true a copy + * of the message will be included in the signature. The content type + * is set according to the OID represented by the string signedContentType. + */ + public Stream Open( + Stream outStream, + string signedContentType, + bool encapsulate) + { + return Open(outStream, signedContentType, encapsulate, null); + } + + /** + * generate a signed object that for a CMS Signed Data + * object using the given provider - if encapsulate is true a copy + * of the message will be included in the signature. The content type + * is set according to the OID represented by the string signedContentType. + * @param out stream the CMS object is to be written to. + * @param signedContentType OID for data to be signed. + * @param encapsulate true if data should be encapsulated. + * @param dataOutputStream output stream to copy the data being signed to. + */ + public Stream Open( + Stream outStream, + string signedContentType, + bool encapsulate, + Stream dataOutputStream) + { + if (outStream == null) + throw new ArgumentNullException("outStream"); + if (!outStream.CanWrite) + throw new ArgumentException("Expected writeable stream", "outStream"); + if (dataOutputStream != null && !dataOutputStream.CanWrite) + throw new ArgumentException("Expected writeable stream", "dataOutputStream"); + + _messageDigestsLocked = true; + + // + // ContentInfo + // + BerSequenceGenerator sGen = new BerSequenceGenerator(outStream); + + sGen.AddObject(CmsObjectIdentifiers.SignedData); + + // + // Signed Data + // + BerSequenceGenerator sigGen = new BerSequenceGenerator( + sGen.GetRawOutputStream(), 0, true); + + bool isCounterSignature = (signedContentType == null); + + DerObjectIdentifier contentTypeOid = isCounterSignature + ? null + : new DerObjectIdentifier(signedContentType); + + sigGen.AddObject(CalculateVersion(contentTypeOid)); + + Asn1EncodableVector digestAlgs = new Asn1EncodableVector(); + + foreach (string digestOid in _messageDigestOids) + { + digestAlgs.Add( + new AlgorithmIdentifier(new DerObjectIdentifier(digestOid), DerNull.Instance)); + } + + { + byte[] tmp = new DerSet(digestAlgs).GetEncoded(); + sigGen.GetRawOutputStream().Write(tmp, 0, tmp.Length); + } + + BerSequenceGenerator eiGen = new BerSequenceGenerator(sigGen.GetRawOutputStream()); + eiGen.AddObject(contentTypeOid); + + // If encapsulating, add the data as an octet string in the sequence + Stream encapStream = encapsulate + ? CmsUtilities.CreateBerOctetOutputStream(eiGen.GetRawOutputStream(), 0, true, _bufferSize) + : null; + + // Also send the data to 'dataOutputStream' if necessary + Stream teeStream = GetSafeTeeOutputStream(dataOutputStream, encapStream); + + // Let all the digests see the data as it is written + Stream digStream = AttachDigestsToOutputStream(_messageDigests.Values, teeStream); + + return new CmsSignedDataOutputStream(this, digStream, signedContentType, sGen, sigGen, eiGen); + } + + private void RegisterDigestOid( + string digestOid) + { + if (_messageDigestsLocked) + { + if (!_messageDigestOids.Contains(digestOid)) + throw new InvalidOperationException("Cannot register new digest OIDs after the data stream is opened"); + } + else + { + _messageDigestOids.Add(digestOid); + } + } + + private void ConfigureDigest( + string digestOid) + { + RegisterDigestOid(digestOid); + + string digestName = Helper.GetDigestAlgName(digestOid); + IDigest dig = (IDigest)_messageDigests[digestName]; + if (dig == null) + { + if (_messageDigestsLocked) + throw new InvalidOperationException("Cannot configure new digests after the data stream is opened"); + + dig = Helper.GetDigestInstance(digestName); + _messageDigests[digestName] = dig; + } + } + + // TODO Make public? + internal void Generate( + Stream outStream, + string eContentType, + bool encapsulate, + Stream dataOutputStream, + CmsProcessable content) + { + Stream signedOut = Open(outStream, eContentType, encapsulate, dataOutputStream); + if (content != null) + { + content.Write(signedOut); + } + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(signedOut); + } + + // RFC3852, section 5.1: + // IF ((certificates is present) AND + // (any certificates with a type of other are present)) OR + // ((crls is present) AND + // (any crls with a type of other are present)) + // THEN version MUST be 5 + // ELSE + // IF (certificates is present) AND + // (any version 2 attribute certificates are present) + // THEN version MUST be 4 + // ELSE + // IF ((certificates is present) AND + // (any version 1 attribute certificates are present)) OR + // (any SignerInfo structures are version 3) OR + // (encapContentInfo eContentType is other than id-data) + // THEN version MUST be 3 + // ELSE version MUST be 1 + // + private DerInteger CalculateVersion( + DerObjectIdentifier contentOid) + { + bool otherCert = false; + bool otherCrl = false; + bool attrCertV1Found = false; + bool attrCertV2Found = false; + + if (_certs != null) + { + foreach (object obj in _certs) + { + if (obj is Asn1TaggedObject) + { + Asn1TaggedObject tagged = (Asn1TaggedObject) obj; + + if (tagged.TagNo == 1) + { + attrCertV1Found = true; + } + else if (tagged.TagNo == 2) + { + attrCertV2Found = true; + } + else if (tagged.TagNo == 3) + { + otherCert = true; + break; + } + } + } + } + + if (otherCert) + { + return new DerInteger(5); + } + + if (_crls != null) + { + foreach (object obj in _crls) + { + if (obj is Asn1TaggedObject) + { + otherCrl = true; + break; + } + } + } + + if (otherCrl) + { + return new DerInteger(5); + } + + if (attrCertV2Found) + { + return new DerInteger(4); + } + + if (attrCertV1Found || !CmsObjectIdentifiers.Data.Equals(contentOid) || CheckForVersion3(_signers)) + { + return new DerInteger(3); + } + + return new DerInteger(1); + } + + private bool CheckForVersion3( + IList signerInfos) + { + foreach (SignerInformation si in signerInfos) + { + SignerInfo s = SignerInfo.GetInstance(si.ToSignerInfo()); + + if (s.Version.Value.IntValue == 3) + { + return true; + } + } + + return false; + } + + private static Stream AttachDigestsToOutputStream(ICollection digests, Stream s) + { + Stream result = s; + foreach (IDigest digest in digests) + { + result = GetSafeTeeOutputStream(result, new DigestSink(digest)); + } + return result; + } + + private static Stream GetSafeOutputStream(Stream s) + { + if (s == null) + return new NullOutputStream(); + return s; + } + + private static Stream GetSafeTeeOutputStream(Stream s1, Stream s2) + { + if (s1 == null) + return GetSafeOutputStream(s2); + if (s2 == null) + return GetSafeOutputStream(s1); + return new TeeOutputStream(s1, s2); + } + + private class CmsSignedDataOutputStream + : BaseOutputStream + { + private readonly CmsSignedDataStreamGenerator outer; + + private Stream _out; + private DerObjectIdentifier _contentOID; + private BerSequenceGenerator _sGen; + private BerSequenceGenerator _sigGen; + private BerSequenceGenerator _eiGen; + + public CmsSignedDataOutputStream( + CmsSignedDataStreamGenerator outer, + Stream outStream, + string contentOID, + BerSequenceGenerator sGen, + BerSequenceGenerator sigGen, + BerSequenceGenerator eiGen) + { + this.outer = outer; + + _out = outStream; + _contentOID = new DerObjectIdentifier(contentOID); + _sGen = sGen; + _sigGen = sigGen; + _eiGen = eiGen; + } + + public override void WriteByte( + byte b) + { + _out.WriteByte(b); + } + + public override void Write( + byte[] bytes, + int off, + int len) + { + _out.Write(bytes, off, len); + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + DoClose(); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + DoClose(); + base.Close(); + } +#endif + + private void DoClose() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(_out); + + // TODO Parent context(s) should really be be closed explicitly + + _eiGen.Close(); + + outer._digests.Clear(); // clear the current preserved digest state + + if (outer._certs.Count > 0) + { + Asn1Set certs = outer.UseDerForCerts + ? CmsUtilities.CreateDerSetFromList(outer._certs) + : CmsUtilities.CreateBerSetFromList(outer._certs); + + WriteToGenerator(_sigGen, new BerTaggedObject(false, 0, certs)); + } + + if (outer._crls.Count > 0) + { + Asn1Set crls = outer.UseDerForCrls + ? CmsUtilities.CreateDerSetFromList(outer._crls) + : CmsUtilities.CreateBerSetFromList(outer._crls); + + WriteToGenerator(_sigGen, new BerTaggedObject(false, 1, crls)); + } + + // + // Calculate the digest hashes + // + foreach (DictionaryEntry de in outer._messageDigests) + { + outer._messageHashes.Add(de.Key, DigestUtilities.DoFinal((IDigest)de.Value)); + } + + // TODO If the digest OIDs for precalculated signers weren't mixed in with + // the others, we could fill in outer._digests here, instead of SignerInfoGenerator.Generate + + // + // collect all the SignerInfo objects + // + Asn1EncodableVector signerInfos = new Asn1EncodableVector(); + + // + // add the generated SignerInfo objects + // + { + foreach (DigestAndSignerInfoGeneratorHolder holder in outer._signerInfs) + { + AlgorithmIdentifier digestAlgorithm = holder.DigestAlgorithm; + + byte[] calculatedDigest = (byte[])outer._messageHashes[ + Helper.GetDigestAlgName(holder.digestOID)]; + outer._digests[holder.digestOID] = calculatedDigest.Clone(); + + signerInfos.Add(holder.signerInf.Generate(_contentOID, digestAlgorithm, calculatedDigest)); + } + } + + // + // add the precalculated SignerInfo objects. + // + { + foreach (SignerInformation signer in outer._signers) + { + // TODO Verify the content type and calculated digest match the precalculated SignerInfo +// if (!signer.ContentType.Equals(_contentOID)) +// { +// // TODO The precalculated content type did not match - error? +// } +// +// byte[] calculatedDigest = (byte[])outer._digests[signer.DigestAlgOid]; +// if (calculatedDigest == null) +// { +// // TODO We can't confirm this digest because we didn't calculate it - error? +// } +// else +// { +// if (!Arrays.AreEqual(signer.GetContentDigest(), calculatedDigest)) +// { +// // TODO The precalculated digest did not match - error? +// } +// } + + signerInfos.Add(signer.ToSignerInfo()); + } + } + + WriteToGenerator(_sigGen, new DerSet(signerInfos)); + + _sigGen.Close(); + _sGen.Close(); + } + + private static void WriteToGenerator( + Asn1Generator ag, + Asn1Encodable ae) + { + byte[] encoded = ae.GetEncoded(); + ag.GetRawOutputStream().Write(encoded, 0, encoded.Length); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataStreamGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataStreamGenerator.cs.meta new file mode 100644 index 00000000..088a416a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedDataStreamGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7609ff86af1d8cc4599341b4d5d36229 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedGenerator.cs new file mode 100644 index 00000000..dce67f30 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedGenerator.cs @@ -0,0 +1,287 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class DefaultDigestAlgorithmIdentifierFinder + { + private static readonly IDictionary digestOids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary digestNameToOids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static DefaultDigestAlgorithmIdentifierFinder() + { + // + // digests + // + digestOids.Add(OiwObjectIdentifiers.MD4WithRsaEncryption, PkcsObjectIdentifiers.MD4); + digestOids.Add(OiwObjectIdentifiers.MD4WithRsa, PkcsObjectIdentifiers.MD4); + digestOids.Add(OiwObjectIdentifiers.MD5WithRsa, PkcsObjectIdentifiers.MD5); + digestOids.Add(OiwObjectIdentifiers.Sha1WithRsa, OiwObjectIdentifiers.IdSha1); + digestOids.Add(OiwObjectIdentifiers.DsaWithSha1, OiwObjectIdentifiers.IdSha1); + + digestOids.Add(PkcsObjectIdentifiers.Sha224WithRsaEncryption, NistObjectIdentifiers.IdSha224); + digestOids.Add(PkcsObjectIdentifiers.Sha256WithRsaEncryption, NistObjectIdentifiers.IdSha256); + digestOids.Add(PkcsObjectIdentifiers.Sha384WithRsaEncryption, NistObjectIdentifiers.IdSha384); + digestOids.Add(PkcsObjectIdentifiers.Sha512WithRsaEncryption, NistObjectIdentifiers.IdSha512); + digestOids.Add(PkcsObjectIdentifiers.MD2WithRsaEncryption, PkcsObjectIdentifiers.MD2); + digestOids.Add(PkcsObjectIdentifiers.MD4WithRsaEncryption, PkcsObjectIdentifiers.MD4); + digestOids.Add(PkcsObjectIdentifiers.MD5WithRsaEncryption, PkcsObjectIdentifiers.MD5); + digestOids.Add(PkcsObjectIdentifiers.Sha1WithRsaEncryption, OiwObjectIdentifiers.IdSha1); + + digestOids.Add(X9ObjectIdentifiers.ECDsaWithSha1, OiwObjectIdentifiers.IdSha1); + digestOids.Add(X9ObjectIdentifiers.ECDsaWithSha224, NistObjectIdentifiers.IdSha224); + digestOids.Add(X9ObjectIdentifiers.ECDsaWithSha256, NistObjectIdentifiers.IdSha256); + digestOids.Add(X9ObjectIdentifiers.ECDsaWithSha384, NistObjectIdentifiers.IdSha384); + digestOids.Add(X9ObjectIdentifiers.ECDsaWithSha512, NistObjectIdentifiers.IdSha512); + digestOids.Add(X9ObjectIdentifiers.IdDsaWithSha1, OiwObjectIdentifiers.IdSha1); + + digestOids.Add(NistObjectIdentifiers.DsaWithSha224, NistObjectIdentifiers.IdSha224); + digestOids.Add(NistObjectIdentifiers.DsaWithSha256, NistObjectIdentifiers.IdSha256); + digestOids.Add(NistObjectIdentifiers.DsaWithSha384, NistObjectIdentifiers.IdSha384); + digestOids.Add(NistObjectIdentifiers.DsaWithSha512, NistObjectIdentifiers.IdSha512); + + digestOids.Add(TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128, TeleTrusTObjectIdentifiers.RipeMD128); + digestOids.Add(TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160, TeleTrusTObjectIdentifiers.RipeMD160); + digestOids.Add(TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256, TeleTrusTObjectIdentifiers.RipeMD256); + + digestOids.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94, CryptoProObjectIdentifiers.GostR3411); + digestOids.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001, CryptoProObjectIdentifiers.GostR3411); + + digestNameToOids.Add("SHA-1", OiwObjectIdentifiers.IdSha1); + digestNameToOids.Add("SHA-224", NistObjectIdentifiers.IdSha224); + digestNameToOids.Add("SHA-256", NistObjectIdentifiers.IdSha256); + digestNameToOids.Add("SHA-384", NistObjectIdentifiers.IdSha384); + digestNameToOids.Add("SHA-512", NistObjectIdentifiers.IdSha512); + + digestNameToOids.Add("SHA1", OiwObjectIdentifiers.IdSha1); + digestNameToOids.Add("SHA224", NistObjectIdentifiers.IdSha224); + digestNameToOids.Add("SHA256", NistObjectIdentifiers.IdSha256); + digestNameToOids.Add("SHA384", NistObjectIdentifiers.IdSha384); + digestNameToOids.Add("SHA512", NistObjectIdentifiers.IdSha512); + + digestNameToOids.Add("SHA3-224", NistObjectIdentifiers.IdSha3_224); + digestNameToOids.Add("SHA3-256", NistObjectIdentifiers.IdSha3_256); + digestNameToOids.Add("SHA3-384", NistObjectIdentifiers.IdSha3_384); + digestNameToOids.Add("SHA3-512", NistObjectIdentifiers.IdSha3_512); + + digestNameToOids.Add("SHAKE-128", NistObjectIdentifiers.IdShake128); + digestNameToOids.Add("SHAKE-256", NistObjectIdentifiers.IdShake256); + + digestNameToOids.Add("GOST3411", CryptoProObjectIdentifiers.GostR3411); + + digestNameToOids.Add("MD2", PkcsObjectIdentifiers.MD2); + digestNameToOids.Add("MD4", PkcsObjectIdentifiers.MD4); + digestNameToOids.Add("MD5", PkcsObjectIdentifiers.MD5); + + digestNameToOids.Add("RIPEMD128", TeleTrusTObjectIdentifiers.RipeMD128); + digestNameToOids.Add("RIPEMD160", TeleTrusTObjectIdentifiers.RipeMD160); + digestNameToOids.Add("RIPEMD256", TeleTrusTObjectIdentifiers.RipeMD256); + } + + public AlgorithmIdentifier find(AlgorithmIdentifier sigAlgId) + { + AlgorithmIdentifier digAlgId; + + if (sigAlgId.Algorithm.Equals(PkcsObjectIdentifiers.IdRsassaPss)) + { + digAlgId = RsassaPssParameters.GetInstance(sigAlgId.Parameters).HashAlgorithm; + } + else + { + digAlgId = new AlgorithmIdentifier((DerObjectIdentifier)digestOids[sigAlgId.Algorithm], DerNull.Instance); + } + + return digAlgId; + } + + public AlgorithmIdentifier find(String digAlgName) + { + return new AlgorithmIdentifier((DerObjectIdentifier)digestNameToOids[digAlgName], DerNull.Instance); + } + } + + public class CmsSignedGenerator + { + /** + * Default type for the signed data. + */ + public static readonly string Data = CmsObjectIdentifiers.Data.Id; + + public static readonly string DigestSha1 = OiwObjectIdentifiers.IdSha1.Id; + public static readonly string DigestSha224 = NistObjectIdentifiers.IdSha224.Id; + public static readonly string DigestSha256 = NistObjectIdentifiers.IdSha256.Id; + public static readonly string DigestSha384 = NistObjectIdentifiers.IdSha384.Id; + public static readonly string DigestSha512 = NistObjectIdentifiers.IdSha512.Id; + public static readonly string DigestMD5 = PkcsObjectIdentifiers.MD5.Id; + public static readonly string DigestGost3411 = CryptoProObjectIdentifiers.GostR3411.Id; + public static readonly string DigestRipeMD128 = TeleTrusTObjectIdentifiers.RipeMD128.Id; + public static readonly string DigestRipeMD160 = TeleTrusTObjectIdentifiers.RipeMD160.Id; + public static readonly string DigestRipeMD256 = TeleTrusTObjectIdentifiers.RipeMD256.Id; + + public static readonly string EncryptionRsa = PkcsObjectIdentifiers.RsaEncryption.Id; + public static readonly string EncryptionDsa = X9ObjectIdentifiers.IdDsaWithSha1.Id; + public static readonly string EncryptionECDsa = X9ObjectIdentifiers.ECDsaWithSha1.Id; + public static readonly string EncryptionRsaPss = PkcsObjectIdentifiers.IdRsassaPss.Id; + public static readonly string EncryptionGost3410 = CryptoProObjectIdentifiers.GostR3410x94.Id; + public static readonly string EncryptionECGost3410 = CryptoProObjectIdentifiers.GostR3410x2001.Id; + + internal IList _certs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + internal IList _crls = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + internal IList _signers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + internal IDictionary _digests = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + internal bool _useDerForCerts = false; + internal bool _useDerForCrls = false; + + protected readonly SecureRandom rand; + + protected CmsSignedGenerator() + : this(new SecureRandom()) + { + } + + /// Constructor allowing specific source of randomness + /// Instance of SecureRandom to use. + protected CmsSignedGenerator( + SecureRandom rand) + { + this.rand = rand; + } + + internal protected virtual IDictionary GetBaseParameters( + DerObjectIdentifier contentType, + AlgorithmIdentifier digAlgId, + byte[] hash) + { + IDictionary param = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + if (contentType != null) + { + param[CmsAttributeTableParameter.ContentType] = contentType; + } + + param[CmsAttributeTableParameter.DigestAlgorithmIdentifier] = digAlgId; + param[CmsAttributeTableParameter.Digest] = hash.Clone(); + + return param; + } + + internal protected virtual Asn1Set GetAttributeSet( + Asn1.Cms.AttributeTable attr) + { + return attr == null + ? null + : new DerSet(attr.ToAsn1EncodableVector()); + } + + public void AddCertificates( + IX509Store certStore) + { + CollectionUtilities.AddRange(_certs, CmsUtilities.GetCertificatesFromStore(certStore)); + } + + public void AddCrls( + IX509Store crlStore) + { + CollectionUtilities.AddRange(_crls, CmsUtilities.GetCrlsFromStore(crlStore)); + } + + /** + * Add the attribute certificates contained in the passed in store to the + * generator. + * + * @param store a store of Version 2 attribute certificates + * @throws CmsException if an error occurse processing the store. + */ + public void AddAttributeCertificates( + IX509Store store) + { + try + { + foreach (IX509AttributeCertificate attrCert in store.GetMatches(null)) + { + _certs.Add(new DerTaggedObject(false, 2, + AttributeCertificate.GetInstance(Asn1Object.FromByteArray(attrCert.GetEncoded())))); + } + } + catch (Exception e) + { + throw new CmsException("error processing attribute certs", e); + } + } + + /** + * Add a store of precalculated signers to the generator. + * + * @param signerStore store of signers + */ + public void AddSigners( + SignerInformationStore signerStore) + { + foreach (SignerInformation o in signerStore.GetSigners()) + { + _signers.Add(o); + AddSignerCallback(o); + } + } + + /** + * Return a map of oids and byte arrays representing the digests calculated on the content during + * the last generate. + * + * @return a map of oids (as String objects) and byte[] representing digests. + */ + public IDictionary GetGeneratedDigests() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(_digests); + } + + public bool UseDerForCerts + { + get { return _useDerForCerts; } + set { this._useDerForCerts = value; } + } + + public bool UseDerForCrls + { + get { return _useDerForCrls; } + set { this._useDerForCrls = value; } + } + + internal virtual void AddSignerCallback( + SignerInformation si) + { + } + + internal static SignerIdentifier GetSignerIdentifier(X509Certificate cert) + { + return new SignerIdentifier(CmsUtilities.GetIssuerAndSerialNumber(cert)); + } + + internal static SignerIdentifier GetSignerIdentifier(byte[] subjectKeyIdentifier) + { + return new SignerIdentifier(new DerOctetString(subjectKeyIdentifier)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedGenerator.cs.meta new file mode 100644 index 00000000..50cecdfc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 005c41845e2bb2c44b19515d790e39e7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedHelper.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedHelper.cs new file mode 100644 index 00000000..a48edd4d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedHelper.cs @@ -0,0 +1,430 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Eac; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Iana; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal class CmsSignedHelper + { + internal static readonly CmsSignedHelper Instance = new CmsSignedHelper(); + + private static readonly string EncryptionECDsaWithSha1 = X9ObjectIdentifiers.ECDsaWithSha1.Id; + private static readonly string EncryptionECDsaWithSha224 = X9ObjectIdentifiers.ECDsaWithSha224.Id; + private static readonly string EncryptionECDsaWithSha256 = X9ObjectIdentifiers.ECDsaWithSha256.Id; + private static readonly string EncryptionECDsaWithSha384 = X9ObjectIdentifiers.ECDsaWithSha384.Id; + private static readonly string EncryptionECDsaWithSha512 = X9ObjectIdentifiers.ECDsaWithSha512.Id; + + private static readonly IDictionary encryptionAlgs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary digestAlgs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary digestAliases = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + private static readonly ISet noParams = new HashSet(); + private static readonly IDictionary ecAlgorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + private static void AddEntries(DerObjectIdentifier oid, string digest, string encryption) + { + string alias = oid.Id; + digestAlgs.Add(alias, digest); + encryptionAlgs.Add(alias, encryption); + } + + static CmsSignedHelper() + { + AddEntries(NistObjectIdentifiers.DsaWithSha224, "SHA224", "DSA"); + AddEntries(NistObjectIdentifiers.DsaWithSha256, "SHA256", "DSA"); + AddEntries(NistObjectIdentifiers.DsaWithSha384, "SHA384", "DSA"); + AddEntries(NistObjectIdentifiers.DsaWithSha512, "SHA512", "DSA"); + AddEntries(OiwObjectIdentifiers.DsaWithSha1, "SHA1", "DSA"); + AddEntries(OiwObjectIdentifiers.MD4WithRsa, "MD4", "RSA"); + AddEntries(OiwObjectIdentifiers.MD4WithRsaEncryption, "MD4", "RSA"); + AddEntries(OiwObjectIdentifiers.MD5WithRsa, "MD5", "RSA"); + AddEntries(OiwObjectIdentifiers.Sha1WithRsa, "SHA1", "RSA"); + AddEntries(PkcsObjectIdentifiers.MD2WithRsaEncryption, "MD2", "RSA"); + AddEntries(PkcsObjectIdentifiers.MD4WithRsaEncryption, "MD4", "RSA"); + AddEntries(PkcsObjectIdentifiers.MD5WithRsaEncryption, "MD5", "RSA"); + AddEntries(PkcsObjectIdentifiers.Sha1WithRsaEncryption, "SHA1", "RSA"); + AddEntries(PkcsObjectIdentifiers.Sha224WithRsaEncryption, "SHA224", "RSA"); + AddEntries(PkcsObjectIdentifiers.Sha256WithRsaEncryption, "SHA256", "RSA"); + AddEntries(PkcsObjectIdentifiers.Sha384WithRsaEncryption, "SHA384", "RSA"); + AddEntries(PkcsObjectIdentifiers.Sha512WithRsaEncryption, "SHA512", "RSA"); + AddEntries(X9ObjectIdentifiers.ECDsaWithSha1, "SHA1", "ECDSA"); + AddEntries(X9ObjectIdentifiers.ECDsaWithSha224, "SHA224", "ECDSA"); + AddEntries(X9ObjectIdentifiers.ECDsaWithSha256, "SHA256", "ECDSA"); + AddEntries(X9ObjectIdentifiers.ECDsaWithSha384, "SHA384", "ECDSA"); + AddEntries(X9ObjectIdentifiers.ECDsaWithSha512, "SHA512", "ECDSA"); + AddEntries(X9ObjectIdentifiers.IdDsaWithSha1, "SHA1", "DSA"); + AddEntries(EacObjectIdentifiers.id_TA_ECDSA_SHA_1, "SHA1", "ECDSA"); + AddEntries(EacObjectIdentifiers.id_TA_ECDSA_SHA_224, "SHA224", "ECDSA"); + AddEntries(EacObjectIdentifiers.id_TA_ECDSA_SHA_256, "SHA256", "ECDSA"); + AddEntries(EacObjectIdentifiers.id_TA_ECDSA_SHA_384, "SHA384", "ECDSA"); + AddEntries(EacObjectIdentifiers.id_TA_ECDSA_SHA_512, "SHA512", "ECDSA"); + AddEntries(EacObjectIdentifiers.id_TA_RSA_v1_5_SHA_1, "SHA1", "RSA"); + AddEntries(EacObjectIdentifiers.id_TA_RSA_v1_5_SHA_256, "SHA256", "RSA"); + AddEntries(EacObjectIdentifiers.id_TA_RSA_PSS_SHA_1, "SHA1", "RSAandMGF1"); + AddEntries(EacObjectIdentifiers.id_TA_RSA_PSS_SHA_256, "SHA256", "RSAandMGF1"); + + encryptionAlgs.Add(X9ObjectIdentifiers.IdDsa.Id, "DSA"); + encryptionAlgs.Add(PkcsObjectIdentifiers.RsaEncryption.Id, "RSA"); + encryptionAlgs.Add(TeleTrusTObjectIdentifiers.TeleTrusTRsaSignatureAlgorithm, "RSA"); + encryptionAlgs.Add(X509ObjectIdentifiers.IdEARsa.Id, "RSA"); + encryptionAlgs.Add(CmsSignedGenerator.EncryptionRsaPss, "RSAandMGF1"); + encryptionAlgs.Add(CryptoProObjectIdentifiers.GostR3410x94.Id, "GOST3410"); + encryptionAlgs.Add(CryptoProObjectIdentifiers.GostR3410x2001.Id, "ECGOST3410"); + encryptionAlgs.Add("1.3.6.1.4.1.5849.1.6.2", "ECGOST3410"); + encryptionAlgs.Add("1.3.6.1.4.1.5849.1.1.5", "GOST3410"); + + digestAlgs.Add(PkcsObjectIdentifiers.MD2.Id, "MD2"); + digestAlgs.Add(PkcsObjectIdentifiers.MD4.Id, "MD4"); + digestAlgs.Add(PkcsObjectIdentifiers.MD5.Id, "MD5"); + digestAlgs.Add(OiwObjectIdentifiers.IdSha1.Id, "SHA1"); + digestAlgs.Add(NistObjectIdentifiers.IdSha224.Id, "SHA224"); + digestAlgs.Add(NistObjectIdentifiers.IdSha256.Id, "SHA256"); + digestAlgs.Add(NistObjectIdentifiers.IdSha384.Id, "SHA384"); + digestAlgs.Add(NistObjectIdentifiers.IdSha512.Id, "SHA512"); + digestAlgs.Add(TeleTrusTObjectIdentifiers.RipeMD128.Id, "RIPEMD128"); + digestAlgs.Add(TeleTrusTObjectIdentifiers.RipeMD160.Id, "RIPEMD160"); + digestAlgs.Add(TeleTrusTObjectIdentifiers.RipeMD256.Id, "RIPEMD256"); + digestAlgs.Add(CryptoProObjectIdentifiers.GostR3411.Id, "GOST3411"); + digestAlgs.Add("1.3.6.1.4.1.5849.1.2.1", "GOST3411"); + + digestAliases.Add("SHA1", new string[] { "SHA-1" }); + digestAliases.Add("SHA224", new string[] { "SHA-224" }); + digestAliases.Add("SHA256", new string[] { "SHA-256" }); + digestAliases.Add("SHA384", new string[] { "SHA-384" }); + digestAliases.Add("SHA512", new string[] { "SHA-512" }); + + noParams.Add(CmsSignedGenerator.EncryptionDsa); + // noParams.Add(EncryptionECDsa); + noParams.Add(EncryptionECDsaWithSha1); + noParams.Add(EncryptionECDsaWithSha224); + noParams.Add(EncryptionECDsaWithSha256); + noParams.Add(EncryptionECDsaWithSha384); + noParams.Add(EncryptionECDsaWithSha512); + + ecAlgorithms.Add(CmsSignedGenerator.DigestSha1, EncryptionECDsaWithSha1); + ecAlgorithms.Add(CmsSignedGenerator.DigestSha224, EncryptionECDsaWithSha224); + ecAlgorithms.Add(CmsSignedGenerator.DigestSha256, EncryptionECDsaWithSha256); + ecAlgorithms.Add(CmsSignedGenerator.DigestSha384, EncryptionECDsaWithSha384); + ecAlgorithms.Add(CmsSignedGenerator.DigestSha512, EncryptionECDsaWithSha512); + } + + /** + * Return the digest algorithm using one of the standard JCA string + * representations rather than the algorithm identifier (if possible). + */ + internal string GetDigestAlgName( + string digestAlgOid) + { + string algName = (string)digestAlgs[digestAlgOid]; + + if (algName != null) + { + return algName; + } + + return digestAlgOid; + } + + internal AlgorithmIdentifier GetEncAlgorithmIdentifier( + DerObjectIdentifier encOid, + Asn1Encodable sigX509Parameters) + { + if (noParams.Contains(encOid.Id)) + { + return new AlgorithmIdentifier(encOid); + } + + return new AlgorithmIdentifier(encOid, sigX509Parameters); + } + + internal string[] GetDigestAliases( + string algName) + { + string[] aliases = (string[]) digestAliases[algName]; + + return aliases == null ? new String[0] : (string[]) aliases.Clone(); + } + + /** + * Return the digest encryption algorithm using one of the standard + * JCA string representations rather than the algorithm identifier (if + * possible). + */ + internal string GetEncryptionAlgName( + string encryptionAlgOid) + { + string algName = (string) encryptionAlgs[encryptionAlgOid]; + + if (algName != null) + { + return algName; + } + + return encryptionAlgOid; + } + + internal IDigest GetDigestInstance( + string algorithm) + { + try + { + return DigestUtilities.GetDigest(algorithm); + } + catch (SecurityUtilityException e) + { + // This is probably superfluous on C#, since no provider infrastructure, + // assuming DigestUtilities already knows all the aliases + foreach (string alias in GetDigestAliases(algorithm)) + { + try { return DigestUtilities.GetDigest(alias); } + catch (SecurityUtilityException) {} + } + throw e; + } + } + + internal ISigner GetSignatureInstance( + string algorithm) + { + return SignerUtilities.GetSigner(algorithm); + } + + internal IX509Store CreateAttributeStore( + string type, + Asn1Set certSet) + { + IList certs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + if (certSet != null) + { + foreach (Asn1Encodable ae in certSet) + { + try + { + Asn1Object obj = ae.ToAsn1Object(); + + if (obj is Asn1TaggedObject) + { + Asn1TaggedObject tagged = (Asn1TaggedObject)obj; + + if (tagged.TagNo == 2) + { + certs.Add( + new X509V2AttributeCertificate( + Asn1Sequence.GetInstance(tagged, false).GetEncoded())); + } + } + } + catch (Exception ex) + { + throw new CmsException("can't re-encode attribute certificate!", ex); + } + } + } + + try + { + return X509StoreFactory.Create( + "AttributeCertificate/" + type, + new X509CollectionStoreParameters(certs)); + } + catch (ArgumentException e) + { + throw new CmsException("can't setup the X509Store", e); + } + } + + internal IX509Store CreateCertificateStore( + string type, + Asn1Set certSet) + { + IList certs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + if (certSet != null) + { + AddCertsFromSet(certs, certSet); + } + + try + { + return X509StoreFactory.Create( + "Certificate/" + type, + new X509CollectionStoreParameters(certs)); + } + catch (ArgumentException e) + { + throw new CmsException("can't setup the X509Store", e); + } + } + + internal IX509Store CreateCrlStore( + string type, + Asn1Set crlSet) + { + IList crls = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + if (crlSet != null) + { + AddCrlsFromSet(crls, crlSet); + } + + try + { + return X509StoreFactory.Create( + "CRL/" + type, + new X509CollectionStoreParameters(crls)); + } + catch (ArgumentException e) + { + throw new CmsException("can't setup the X509Store", e); + } + } + + private void AddCertsFromSet( + IList certs, + Asn1Set certSet) + { + X509CertificateParser cf = new X509CertificateParser(); + + foreach (Asn1Encodable ae in certSet) + { + try + { + Asn1Object obj = ae.ToAsn1Object(); + + if (obj is Asn1Sequence) + { + // TODO Build certificate directly from sequence? + certs.Add(cf.ReadCertificate(obj.GetEncoded())); + } + } + catch (Exception ex) + { + throw new CmsException("can't re-encode certificate!", ex); + } + } + } + + private void AddCrlsFromSet( + IList crls, + Asn1Set crlSet) + { + X509CrlParser cf = new X509CrlParser(); + + foreach (Asn1Encodable ae in crlSet) + { + try + { + // TODO Build CRL directly from ae.ToAsn1Object()? + crls.Add(cf.ReadCrl(ae.GetEncoded())); + } + catch (Exception ex) + { + throw new CmsException("can't re-encode CRL!", ex); + } + } + } + + internal AlgorithmIdentifier FixAlgID( + AlgorithmIdentifier algId) + { + if (algId.Parameters == null) + return new AlgorithmIdentifier(algId.Algorithm, DerNull.Instance); + + return algId; + } + + internal string GetEncOid( + AsymmetricKeyParameter key, + string digestOID) + { + string encOID = null; + + if (key is RsaKeyParameters) + { + if (!((RsaKeyParameters)key).IsPrivate) + throw new ArgumentException("Expected RSA private key"); + + encOID = CmsSignedGenerator.EncryptionRsa; + } + else if (key is DsaPrivateKeyParameters) + { + if (digestOID.Equals(CmsSignedGenerator.DigestSha1)) + { + encOID = CmsSignedGenerator.EncryptionDsa; + } + else if (digestOID.Equals(CmsSignedGenerator.DigestSha224)) + { + encOID = NistObjectIdentifiers.DsaWithSha224.Id; + } + else if (digestOID.Equals(CmsSignedGenerator.DigestSha256)) + { + encOID = NistObjectIdentifiers.DsaWithSha256.Id; + } + else if (digestOID.Equals(CmsSignedGenerator.DigestSha384)) + { + encOID = NistObjectIdentifiers.DsaWithSha384.Id; + } + else if (digestOID.Equals(CmsSignedGenerator.DigestSha512)) + { + encOID = NistObjectIdentifiers.DsaWithSha512.Id; + } + else + { + throw new ArgumentException("can't mix DSA with anything but SHA1/SHA2"); + } + } + else if (key is ECPrivateKeyParameters) + { + ECPrivateKeyParameters ecPrivKey = (ECPrivateKeyParameters)key; + string algName = ecPrivKey.AlgorithmName; + + if (algName == "ECGOST3410") + { + encOID = CmsSignedGenerator.EncryptionECGost3410; + } + else + { + // TODO Should we insist on algName being one of "EC" or "ECDSA", as Java does? + encOID = (string)ecAlgorithms[digestOID]; + + if (encOID == null) + throw new ArgumentException("can't mix ECDSA with anything but SHA family digests"); + } + } + else if (key is Gost3410PrivateKeyParameters) + { + encOID = CmsSignedGenerator.EncryptionGost3410; + } + else + { + throw new ArgumentException("Unknown algorithm in CmsSignedGenerator.GetEncOid"); + } + + return encOID; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedHelper.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedHelper.cs.meta new file mode 100644 index 00000000..0f4d986b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSSignedHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f0f0baf6a26286f41b9a981fa79313a2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSStreamException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSStreamException.cs new file mode 100644 index 00000000..ef719d3a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSStreamException.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CmsStreamException + : IOException + { + public CmsStreamException() + { + } + + public CmsStreamException( + string name) + : base(name) + { + } + + public CmsStreamException( + string name, + Exception e) + : base(name, e) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSStreamException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSStreamException.cs.meta new file mode 100644 index 00000000..811e76dd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSStreamException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 65c03251f868f0c4eacde295bcfa8a55 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSTypedStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSTypedStream.cs new file mode 100644 index 00000000..c8b0529c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSTypedStream.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class CmsTypedStream + { + private const int BufferSize = 32 * 1024; + + private readonly string _oid; + private readonly Stream _in; + + public CmsTypedStream( + Stream inStream) + : this(PkcsObjectIdentifiers.Data.Id, inStream, BufferSize) + { + } + + public CmsTypedStream( + string oid, + Stream inStream) + : this(oid, inStream, BufferSize) + { + } + + public CmsTypedStream( + string oid, + Stream inStream, + int bufSize) + { + _oid = oid; +#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE + _in = new FullReaderStream(inStream); +#else + _in = new FullReaderStream(new BufferedStream(inStream, bufSize)); +#endif + } + + public string ContentType + { + get { return _oid; } + } + + public Stream ContentStream + { + get { return _in; } + } + + public void Drain() + { + Streams.Drain(_in); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(_in); + } + + private class FullReaderStream : FilterStream + { + internal FullReaderStream(Stream input) + : base(input) + { + } + + public override int Read(byte[] buf, int off, int len) + { + return Streams.ReadFully(base.s, buf, off, len); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSTypedStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSTypedStream.cs.meta new file mode 100644 index 00000000..0c621f89 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSTypedStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7cb2eb2d53bfddc48ada720945f16136 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSUtils.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSUtils.cs new file mode 100644 index 00000000..b1a2b937 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSUtils.cs @@ -0,0 +1,190 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal class CmsUtilities + { + // TODO Is there a .NET equivalent to this? +// private static readonly Runtime RUNTIME = Runtime.getRuntime(); + + internal static int MaximumMemory + { + get + { + // TODO Is there a .NET equivalent to this? + long maxMem = int.MaxValue;//RUNTIME.maxMemory(); + + if (maxMem > int.MaxValue) + { + return int.MaxValue; + } + + return (int)maxMem; + } + } + + internal static ContentInfo ReadContentInfo( + byte[] input) + { + // enforce limit checking as from a byte array + return ReadContentInfo(new Asn1InputStream(input)); + } + + internal static ContentInfo ReadContentInfo( + Stream input) + { + // enforce some limit checking + return ReadContentInfo(new Asn1InputStream(input, MaximumMemory)); + } + + private static ContentInfo ReadContentInfo( + Asn1InputStream aIn) + { + try + { + return ContentInfo.GetInstance(aIn.ReadObject()); + } + catch (IOException e) + { + throw new CmsException("IOException reading content.", e); + } + catch (InvalidCastException e) + { + throw new CmsException("Malformed content.", e); + } + catch (ArgumentException e) + { + throw new CmsException("Malformed content.", e); + } + } + + public static byte[] StreamToByteArray( + Stream inStream) + { + return Streams.ReadAll(inStream); + } + + public static byte[] StreamToByteArray( + Stream inStream, + int limit) + { + return Streams.ReadAllLimited(inStream, limit); + } + + public static IList GetCertificatesFromStore( + IX509Store certStore) + { + try + { + IList certs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + if (certStore != null) + { + foreach (X509Certificate c in certStore.GetMatches(null)) + { + certs.Add( + X509CertificateStructure.GetInstance( + Asn1Object.FromByteArray(c.GetEncoded()))); + } + } + + return certs; + } + catch (CertificateEncodingException e) + { + throw new CmsException("error encoding certs", e); + } + catch (Exception e) + { + throw new CmsException("error processing certs", e); + } + } + + public static IList GetCrlsFromStore( + IX509Store crlStore) + { + try + { + IList crls = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + if (crlStore != null) + { + foreach (X509Crl c in crlStore.GetMatches(null)) + { + crls.Add( + CertificateList.GetInstance( + Asn1Object.FromByteArray(c.GetEncoded()))); + } + } + + return crls; + } + catch (CrlException e) + { + throw new CmsException("error encoding crls", e); + } + catch (Exception e) + { + throw new CmsException("error processing crls", e); + } + } + + public static Asn1Set CreateBerSetFromList( + IList berObjects) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + foreach (Asn1Encodable ae in berObjects) + { + v.Add(ae); + } + + return new BerSet(v); + } + + public static Asn1Set CreateDerSetFromList( + IList derObjects) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + foreach (Asn1Encodable ae in derObjects) + { + v.Add(ae); + } + + return new DerSet(v); + } + + internal static Stream CreateBerOctetOutputStream(Stream s, int tagNo, bool isExplicit, int bufferSize) + { + BerOctetStringGenerator octGen = new BerOctetStringGenerator(s, tagNo, isExplicit); + return octGen.GetOctetOutputStream(bufferSize); + } + + internal static TbsCertificateStructure GetTbsCertificateStructure(X509Certificate cert) + { + return TbsCertificateStructure.GetInstance(Asn1Object.FromByteArray(cert.GetTbsCertificate())); + } + + internal static IssuerAndSerialNumber GetIssuerAndSerialNumber(X509Certificate cert) + { + TbsCertificateStructure tbsCert = GetTbsCertificateStructure(cert); + return new IssuerAndSerialNumber(tbsCert.Issuer, tbsCert.SerialNumber.Value); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSUtils.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSUtils.cs.meta new file mode 100644 index 00000000..10f2e314 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CMSUtils.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67354a24f57564445b672cc8ecb0d55a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CounterSignatureDigestCalculator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CounterSignatureDigestCalculator.cs new file mode 100644 index 00000000..4f8611ee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CounterSignatureDigestCalculator.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal class CounterSignatureDigestCalculator + : IDigestCalculator + { + private readonly string alg; + private readonly byte[] data; + + internal CounterSignatureDigestCalculator( + string alg, + byte[] data) + { + this.alg = alg; + this.data = data; + } + + public byte[] GetDigest() + { + IDigest digest = CmsSignedHelper.Instance.GetDigestInstance(alg); + return DigestUtilities.DoFinal(digest, data); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CounterSignatureDigestCalculator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CounterSignatureDigestCalculator.cs.meta new file mode 100644 index 00000000..b2cde11b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/CounterSignatureDigestCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0dc404fbdaec35e45ba416368a1f3d44 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultAuthenticatedAttributeTableGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultAuthenticatedAttributeTableGenerator.cs new file mode 100644 index 00000000..b588bdee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultAuthenticatedAttributeTableGenerator.cs @@ -0,0 +1,94 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * Default authenticated attributes generator. + */ + public class DefaultAuthenticatedAttributeTableGenerator + : CmsAttributeTableGenerator + { + private readonly IDictionary table; + + /** + * Initialise to use all defaults + */ + public DefaultAuthenticatedAttributeTableGenerator() + { + table = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + } + + /** + * Initialise with some extra attributes or overrides. + * + * @param attributeTable initial attribute table to use. + */ + public DefaultAuthenticatedAttributeTableGenerator( + AttributeTable attributeTable) + { + if (attributeTable != null) + { + table = attributeTable.ToDictionary(); + } + else + { + table = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + } + } + + /** + * Create a standard attribute table from the passed in parameters - this will + * normally include contentType and messageDigest. If the constructor + * using an AttributeTable was used, entries in it for contentType and + * messageDigest will override the generated ones. + * + * @param parameters source parameters for table generation. + * + * @return a filled in IDictionary of attributes. + */ + protected virtual IDictionary CreateStandardAttributeTable( + IDictionary parameters) + { + IDictionary std = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(table); + + if (!std.Contains(CmsAttributes.ContentType)) + { + DerObjectIdentifier contentType = (DerObjectIdentifier) + parameters[CmsAttributeTableParameter.ContentType]; + Asn1.Cms.Attribute attr = new Asn1.Cms.Attribute(CmsAttributes.ContentType, + new DerSet(contentType)); + std[attr.AttrType] = attr; + } + + if (!std.Contains(CmsAttributes.MessageDigest)) + { + byte[] messageDigest = (byte[])parameters[CmsAttributeTableParameter.Digest]; + Asn1.Cms.Attribute attr = new Asn1.Cms.Attribute(CmsAttributes.MessageDigest, + new DerSet(new DerOctetString(messageDigest))); + std[attr.AttrType] = attr; + } + + return std; + } + + /** + * @param parameters source parameters + * @return the populated attribute table + */ + public virtual AttributeTable GetAttributes( + IDictionary parameters) + { + IDictionary table = CreateStandardAttributeTable(parameters); + return new AttributeTable(table); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultAuthenticatedAttributeTableGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultAuthenticatedAttributeTableGenerator.cs.meta new file mode 100644 index 00000000..330e0fdd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultAuthenticatedAttributeTableGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ff46025627cc3f4db1238e4c51595a1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultSignedAttributeTableGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultSignedAttributeTableGenerator.cs new file mode 100644 index 00000000..44a4f04f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultSignedAttributeTableGenerator.cs @@ -0,0 +1,128 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * Default signed attributes generator. + */ + public class DefaultSignedAttributeTableGenerator + : CmsAttributeTableGenerator + { + private readonly IDictionary table; + + /** + * Initialise to use all defaults + */ + public DefaultSignedAttributeTableGenerator() + { + table = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + } + + /** + * Initialise with some extra attributes or overrides. + * + * @param attributeTable initial attribute table to use. + */ + public DefaultSignedAttributeTableGenerator( + AttributeTable attributeTable) + { + if (attributeTable != null) + { + table = attributeTable.ToDictionary(); + } + else + { + table = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + } + } + +#if SILVERLIGHT || PORTABLE || NETFX_CORE + /** + * Create a standard attribute table from the passed in parameters - this will + * normally include contentType, signingTime, and messageDigest. If the constructor + * using an AttributeTable was used, entries in it for contentType, signingTime, and + * messageDigest will override the generated ones. + * + * @param parameters source parameters for table generation. + * + * @return a filled in Hashtable of attributes. + */ + protected virtual IDictionary createStandardAttributeTable( + IDictionary parameters) + { + IDictionary std = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(table); + DoCreateStandardAttributeTable(parameters, std); + return std; + } +#else + /** + * Create a standard attribute table from the passed in parameters - this will + * normally include contentType, signingTime, and messageDigest. If the constructor + * using an AttributeTable was used, entries in it for contentType, signingTime, and + * messageDigest will override the generated ones. + * + * @param parameters source parameters for table generation. + * + * @return a filled in Hashtable of attributes. + */ + protected virtual Hashtable createStandardAttributeTable( + IDictionary parameters) + { + Hashtable std = new Hashtable(table); + DoCreateStandardAttributeTable(parameters, std); + return std; + } +#endif + + private void DoCreateStandardAttributeTable(IDictionary parameters, IDictionary std) + { + // contentType will be absent if we're trying to generate a counter signature. + if (parameters.Contains(CmsAttributeTableParameter.ContentType)) + { + if (!std.Contains(CmsAttributes.ContentType)) + { + DerObjectIdentifier contentType = (DerObjectIdentifier) + parameters[CmsAttributeTableParameter.ContentType]; + Asn1.Cms.Attribute attr = new Asn1.Cms.Attribute(CmsAttributes.ContentType, + new DerSet(contentType)); + std[attr.AttrType] = attr; + } + } + + if (!std.Contains(CmsAttributes.SigningTime)) + { + Asn1.Cms.Attribute attr = new Asn1.Cms.Attribute(CmsAttributes.SigningTime, + new DerSet(new Time(DateTime.UtcNow))); + std[attr.AttrType] = attr; + } + + if (!std.Contains(CmsAttributes.MessageDigest)) + { + byte[] messageDigest = (byte[])parameters[CmsAttributeTableParameter.Digest]; + Asn1.Cms.Attribute attr = new Asn1.Cms.Attribute(CmsAttributes.MessageDigest, + new DerSet(new DerOctetString(messageDigest))); + std[attr.AttrType] = attr; + } + } + + /** + * @param parameters source parameters + * @return the populated attribute table + */ + public virtual AttributeTable GetAttributes( + IDictionary parameters) + { + IDictionary table = createStandardAttributeTable(parameters); + return new AttributeTable(table); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultSignedAttributeTableGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultSignedAttributeTableGenerator.cs.meta new file mode 100644 index 00000000..a5f366d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/DefaultSignedAttributeTableGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0436e2d77a8dae845a14d9535027953c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/IDigestCalculator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/IDigestCalculator.cs new file mode 100644 index 00000000..e88c7e41 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/IDigestCalculator.cs @@ -0,0 +1,13 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal interface IDigestCalculator + { + byte[] GetDigest(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/IDigestCalculator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/IDigestCalculator.cs.meta new file mode 100644 index 00000000..7c94d2a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/IDigestCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d9dc3e4ade64ee40b172d9d67f0830c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInfoGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInfoGenerator.cs new file mode 100644 index 00000000..703f62f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInfoGenerator.cs @@ -0,0 +1,142 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Kisa; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ntt; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal class KekRecipientInfoGenerator : RecipientInfoGenerator + { + private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance; + + private KeyParameter keyEncryptionKey; + // TODO Can get this from keyEncryptionKey? + private string keyEncryptionKeyOID; + private KekIdentifier kekIdentifier; + + // Derived + private AlgorithmIdentifier keyEncryptionAlgorithm; + + internal KekRecipientInfoGenerator() + { + } + + internal KekIdentifier KekIdentifier + { + set { this.kekIdentifier = value; } + } + + internal KeyParameter KeyEncryptionKey + { + set + { + this.keyEncryptionKey = value; + this.keyEncryptionAlgorithm = DetermineKeyEncAlg(keyEncryptionKeyOID, keyEncryptionKey); + } + } + + internal string KeyEncryptionKeyOID + { + set { this.keyEncryptionKeyOID = value; } + } + + public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random) + { + byte[] keyBytes = contentEncryptionKey.GetKey(); + + IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionAlgorithm.Algorithm.Id); + keyWrapper.Init(true, new ParametersWithRandom(keyEncryptionKey, random)); + Asn1OctetString encryptedKey = new DerOctetString( + keyWrapper.Wrap(keyBytes, 0, keyBytes.Length)); + + return new RecipientInfo(new KekRecipientInfo(kekIdentifier, keyEncryptionAlgorithm, encryptedKey)); + } + + private static AlgorithmIdentifier DetermineKeyEncAlg( + string algorithm, KeyParameter key) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(algorithm, "DES")) + { + return new AlgorithmIdentifier( + PkcsObjectIdentifiers.IdAlgCms3DesWrap, + DerNull.Instance); + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(algorithm, "RC2")) + { + return new AlgorithmIdentifier( + PkcsObjectIdentifiers.IdAlgCmsRC2Wrap, + new DerInteger(58)); + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(algorithm, "AES")) + { + int length = key.GetKey().Length * 8; + DerObjectIdentifier wrapOid; + + if (length == 128) + { + wrapOid = NistObjectIdentifiers.IdAes128Wrap; + } + else if (length == 192) + { + wrapOid = NistObjectIdentifiers.IdAes192Wrap; + } + else if (length == 256) + { + wrapOid = NistObjectIdentifiers.IdAes256Wrap; + } + else + { + throw new ArgumentException("illegal keysize in AES"); + } + + return new AlgorithmIdentifier(wrapOid); // parameters absent + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(algorithm, "SEED")) + { + // parameters absent + return new AlgorithmIdentifier(KisaObjectIdentifiers.IdNpkiAppCmsSeedWrap); + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(algorithm, "CAMELLIA")) + { + int length = key.GetKey().Length * 8; + DerObjectIdentifier wrapOid; + + if (length == 128) + { + wrapOid = NttObjectIdentifiers.IdCamellia128Wrap; + } + else if (length == 192) + { + wrapOid = NttObjectIdentifiers.IdCamellia192Wrap; + } + else if (length == 256) + { + wrapOid = NttObjectIdentifiers.IdCamellia256Wrap; + } + else + { + throw new ArgumentException("illegal keysize in Camellia"); + } + + return new AlgorithmIdentifier(wrapOid); // parameters must be absent + } + else + { + throw new ArgumentException("unknown algorithm"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInfoGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInfoGenerator.cs.meta new file mode 100644 index 00000000..e0fa9ab1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInfoGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 764accd23d3d15147a4cf8f10a88f687 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInformation.cs new file mode 100644 index 00000000..efe706a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInformation.cs @@ -0,0 +1,66 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * the RecipientInfo class for a recipient who has been sent a message + * encrypted using a secret key known to the other side. + */ + public class KekRecipientInformation + : RecipientInformation + { + private KekRecipientInfo info; + + internal KekRecipientInformation( + KekRecipientInfo info, + CmsSecureReadable secureReadable) + : base(info.KeyEncryptionAlgorithm, secureReadable) + { + this.info = info; + this.rid = new RecipientID(); + + KekIdentifier kekId = info.KekID; + + rid.KeyIdentifier = kekId.KeyIdentifier.GetOctets(); + } + + /** + * decrypt the content and return an input stream. + */ + public override CmsTypedStream GetContentStream( + ICipherParameters key) + { + try + { + byte[] encryptedKey = info.EncryptedKey.GetOctets(); + IWrapper keyWrapper = WrapperUtilities.GetWrapper(keyEncAlg.Algorithm.Id); + + keyWrapper.Init(false, key); + + KeyParameter sKey = ParameterUtilities.CreateKeyParameter( + GetContentAlgorithmName(), keyWrapper.Unwrap(encryptedKey, 0, encryptedKey.Length)); + + return GetContentFromSessionKey(sKey); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInformation.cs.meta new file mode 100644 index 00000000..93dfbc92 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KEKRecipientInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a668dd24874b8c047b20f583f86df772 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInfoGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInfoGenerator.cs new file mode 100644 index 00000000..614ca5ba --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInfoGenerator.cs @@ -0,0 +1,175 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Ecc; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal class KeyAgreeRecipientInfoGenerator : RecipientInfoGenerator + { + private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance; + + private DerObjectIdentifier keyAgreementOID; + private DerObjectIdentifier keyEncryptionOID; + private IList recipientCerts; + private AsymmetricCipherKeyPair senderKeyPair; + + internal KeyAgreeRecipientInfoGenerator() + { + } + + internal DerObjectIdentifier KeyAgreementOID + { + set { this.keyAgreementOID = value; } + } + + internal DerObjectIdentifier KeyEncryptionOID + { + set { this.keyEncryptionOID = value; } + } + + internal ICollection RecipientCerts + { + set { this.recipientCerts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(value); } + } + + internal AsymmetricCipherKeyPair SenderKeyPair + { + set { this.senderKeyPair = value; } + } + + public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random) + { + byte[] keyBytes = contentEncryptionKey.GetKey(); + + AsymmetricKeyParameter senderPublicKey = senderKeyPair.Public; + ICipherParameters senderPrivateParams = senderKeyPair.Private; + + + OriginatorIdentifierOrKey originator; + try + { + originator = new OriginatorIdentifierOrKey( + CreateOriginatorPublicKey(senderPublicKey)); + } + catch (IOException e) + { + throw new InvalidKeyException("cannot extract originator public key: " + e); + } + + + Asn1OctetString ukm = null; + if (keyAgreementOID.Id.Equals(CmsEnvelopedGenerator.ECMqvSha1Kdf)) + { + try + { + IAsymmetricCipherKeyPairGenerator ephemKPG = + GeneratorUtilities.GetKeyPairGenerator(keyAgreementOID); + ephemKPG.Init( + ((ECPublicKeyParameters)senderPublicKey).CreateKeyGenerationParameters(random)); + + AsymmetricCipherKeyPair ephemKP = ephemKPG.GenerateKeyPair(); + + ukm = new DerOctetString( + new MQVuserKeyingMaterial( + CreateOriginatorPublicKey(ephemKP.Public), null)); + + senderPrivateParams = new MqvPrivateParameters( + (ECPrivateKeyParameters)senderPrivateParams, + (ECPrivateKeyParameters)ephemKP.Private, + (ECPublicKeyParameters)ephemKP.Public); + } + catch (IOException e) + { + throw new InvalidKeyException("cannot extract MQV ephemeral public key: " + e); + } + catch (SecurityUtilityException e) + { + throw new InvalidKeyException("cannot determine MQV ephemeral key pair parameters from public key: " + e); + } + } + + + DerSequence paramSeq = new DerSequence( + keyEncryptionOID, + DerNull.Instance); + AlgorithmIdentifier keyEncAlg = new AlgorithmIdentifier(keyAgreementOID, paramSeq); + + + Asn1EncodableVector recipientEncryptedKeys = new Asn1EncodableVector(); + foreach (X509Certificate recipientCert in recipientCerts) + { + TbsCertificateStructure tbsCert; + try + { + tbsCert = TbsCertificateStructure.GetInstance( + Asn1Object.FromByteArray(recipientCert.GetTbsCertificate())); + } + catch (Exception) + { + throw new ArgumentException("can't extract TBS structure from certificate"); + } + + // TODO Should there be a SubjectKeyIdentifier-based alternative? + IssuerAndSerialNumber issuerSerial = new IssuerAndSerialNumber( + tbsCert.Issuer, tbsCert.SerialNumber.Value); + KeyAgreeRecipientIdentifier karid = new KeyAgreeRecipientIdentifier(issuerSerial); + + ICipherParameters recipientPublicParams = recipientCert.GetPublicKey(); + if (keyAgreementOID.Id.Equals(CmsEnvelopedGenerator.ECMqvSha1Kdf)) + { + recipientPublicParams = new MqvPublicParameters( + (ECPublicKeyParameters)recipientPublicParams, + (ECPublicKeyParameters)recipientPublicParams); + } + + // Use key agreement to choose a wrap key for this recipient + IBasicAgreement keyAgreement = AgreementUtilities.GetBasicAgreementWithKdf( + keyAgreementOID, keyEncryptionOID.Id); + keyAgreement.Init(new ParametersWithRandom(senderPrivateParams, random)); + BigInteger agreedValue = keyAgreement.CalculateAgreement(recipientPublicParams); + + int keyEncryptionKeySize = GeneratorUtilities.GetDefaultKeySize(keyEncryptionOID) / 8; + byte[] keyEncryptionKeyBytes = X9IntegerConverter.IntegerToBytes(agreedValue, keyEncryptionKeySize); + KeyParameter keyEncryptionKey = ParameterUtilities.CreateKeyParameter( + keyEncryptionOID, keyEncryptionKeyBytes); + + // Wrap the content encryption key with the agreement key + IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionOID.Id); + keyWrapper.Init(true, new ParametersWithRandom(keyEncryptionKey, random)); + byte[] encryptedKeyBytes = keyWrapper.Wrap(keyBytes, 0, keyBytes.Length); + + Asn1OctetString encryptedKey = new DerOctetString(encryptedKeyBytes); + + recipientEncryptedKeys.Add(new RecipientEncryptedKey(karid, encryptedKey)); + } + + return new RecipientInfo(new KeyAgreeRecipientInfo(originator, ukm, keyEncAlg, + new DerSequence(recipientEncryptedKeys))); + } + + private static OriginatorPublicKey CreateOriginatorPublicKey( + AsymmetricKeyParameter publicKey) + { + SubjectPublicKeyInfo spki = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey); + return new OriginatorPublicKey( + new AlgorithmIdentifier(spki.AlgorithmID.Algorithm, DerNull.Instance), + spki.PublicKeyData.GetBytes()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInfoGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInfoGenerator.cs.meta new file mode 100644 index 00000000..ced2b2fe --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInfoGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 123a2fced714ba64db37e4e782038e10 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInformation.cs new file mode 100644 index 00000000..b6106e48 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInformation.cs @@ -0,0 +1,230 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms.Ecc; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * the RecipientInfo class for a recipient who has been sent a message + * encrypted using key agreement. + */ + public class KeyAgreeRecipientInformation + : RecipientInformation + { + private KeyAgreeRecipientInfo info; + private Asn1OctetString encryptedKey; + + internal static void ReadRecipientInfo(IList infos, KeyAgreeRecipientInfo info, + CmsSecureReadable secureReadable) + { + try + { + foreach (Asn1Encodable rek in info.RecipientEncryptedKeys) + { + RecipientEncryptedKey id = RecipientEncryptedKey.GetInstance(rek.ToAsn1Object()); + + RecipientID rid = new RecipientID(); + + Asn1.Cms.KeyAgreeRecipientIdentifier karid = id.Identifier; + + Asn1.Cms.IssuerAndSerialNumber iAndSN = karid.IssuerAndSerialNumber; + if (iAndSN != null) + { + rid.Issuer = iAndSN.Name; + rid.SerialNumber = iAndSN.SerialNumber.Value; + } + else + { + Asn1.Cms.RecipientKeyIdentifier rKeyID = karid.RKeyID; + + // Note: 'date' and 'other' fields of RecipientKeyIdentifier appear to be only informational + + rid.SubjectKeyIdentifier = rKeyID.SubjectKeyIdentifier.GetOctets(); + } + + infos.Add(new KeyAgreeRecipientInformation(info, rid, id.EncryptedKey, + secureReadable)); + } + } + catch (IOException e) + { + throw new ArgumentException("invalid rid in KeyAgreeRecipientInformation", e); + } + } + + internal KeyAgreeRecipientInformation( + KeyAgreeRecipientInfo info, + RecipientID rid, + Asn1OctetString encryptedKey, + CmsSecureReadable secureReadable) + : base(info.KeyEncryptionAlgorithm, secureReadable) + { + this.info = info; + this.rid = rid; + this.encryptedKey = encryptedKey; + } + + private AsymmetricKeyParameter GetSenderPublicKey( + AsymmetricKeyParameter receiverPrivateKey, + OriginatorIdentifierOrKey originator) + { + OriginatorPublicKey opk = originator.OriginatorPublicKey; + if (opk != null) + { + return GetPublicKeyFromOriginatorPublicKey(receiverPrivateKey, opk); + } + + OriginatorID origID = new OriginatorID(); + + Asn1.Cms.IssuerAndSerialNumber iAndSN = originator.IssuerAndSerialNumber; + if (iAndSN != null) + { + origID.Issuer = iAndSN.Name; + origID.SerialNumber = iAndSN.SerialNumber.Value; + } + else + { + SubjectKeyIdentifier ski = originator.SubjectKeyIdentifier; + + origID.SubjectKeyIdentifier = ski.GetKeyIdentifier(); + } + + return GetPublicKeyFromOriginatorID(origID); + } + + private AsymmetricKeyParameter GetPublicKeyFromOriginatorPublicKey( + AsymmetricKeyParameter receiverPrivateKey, + OriginatorPublicKey originatorPublicKey) + { + PrivateKeyInfo privInfo = PrivateKeyInfoFactory.CreatePrivateKeyInfo(receiverPrivateKey); + SubjectPublicKeyInfo pubInfo = new SubjectPublicKeyInfo( + privInfo.PrivateKeyAlgorithm, + originatorPublicKey.PublicKey.GetBytes()); + return PublicKeyFactory.CreateKey(pubInfo); + } + + private AsymmetricKeyParameter GetPublicKeyFromOriginatorID( + OriginatorID origID) + { + // TODO Support all alternatives for OriginatorIdentifierOrKey + // see RFC 3852 6.2.2 + throw new CmsException("No support for 'originator' as IssuerAndSerialNumber or SubjectKeyIdentifier"); + } + + private KeyParameter CalculateAgreedWrapKey( + string wrapAlg, + AsymmetricKeyParameter senderPublicKey, + AsymmetricKeyParameter receiverPrivateKey) + { + DerObjectIdentifier agreeAlgID = keyEncAlg.Algorithm; + + ICipherParameters senderPublicParams = senderPublicKey; + ICipherParameters receiverPrivateParams = receiverPrivateKey; + + if (agreeAlgID.Id.Equals(CmsEnvelopedGenerator.ECMqvSha1Kdf)) + { + byte[] ukmEncoding = info.UserKeyingMaterial.GetOctets(); + MQVuserKeyingMaterial ukm = MQVuserKeyingMaterial.GetInstance( + Asn1Object.FromByteArray(ukmEncoding)); + + AsymmetricKeyParameter ephemeralKey = GetPublicKeyFromOriginatorPublicKey( + receiverPrivateKey, ukm.EphemeralPublicKey); + + senderPublicParams = new MqvPublicParameters( + (ECPublicKeyParameters)senderPublicParams, + (ECPublicKeyParameters)ephemeralKey); + receiverPrivateParams = new MqvPrivateParameters( + (ECPrivateKeyParameters)receiverPrivateParams, + (ECPrivateKeyParameters)receiverPrivateParams); + } + + IBasicAgreement agreement = AgreementUtilities.GetBasicAgreementWithKdf( + agreeAlgID, wrapAlg); + agreement.Init(receiverPrivateParams); + BigInteger agreedValue = agreement.CalculateAgreement(senderPublicParams); + + int wrapKeySize = GeneratorUtilities.GetDefaultKeySize(wrapAlg) / 8; + byte[] wrapKeyBytes = X9IntegerConverter.IntegerToBytes(agreedValue, wrapKeySize); + return ParameterUtilities.CreateKeyParameter(wrapAlg, wrapKeyBytes); + } + + private KeyParameter UnwrapSessionKey( + string wrapAlg, + KeyParameter agreedKey) + { + byte[] encKeyOctets = encryptedKey.GetOctets(); + + IWrapper keyCipher = WrapperUtilities.GetWrapper(wrapAlg); + keyCipher.Init(false, agreedKey); + byte[] sKeyBytes = keyCipher.Unwrap(encKeyOctets, 0, encKeyOctets.Length); + return ParameterUtilities.CreateKeyParameter(GetContentAlgorithmName(), sKeyBytes); + } + + internal KeyParameter GetSessionKey( + AsymmetricKeyParameter receiverPrivateKey) + { + try + { + string wrapAlg = DerObjectIdentifier.GetInstance( + Asn1Sequence.GetInstance(keyEncAlg.Parameters)[0]).Id; + + AsymmetricKeyParameter senderPublicKey = GetSenderPublicKey( + receiverPrivateKey, info.Originator); + + KeyParameter agreedWrapKey = CalculateAgreedWrapKey(wrapAlg, + senderPublicKey, receiverPrivateKey); + + return UnwrapSessionKey(wrapAlg, agreedWrapKey); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } + catch (Exception e) + { + throw new CmsException("originator key invalid.", e); + } + } + + /** + * decrypt the content and return an input stream. + */ + public override CmsTypedStream GetContentStream( + ICipherParameters key) + { + if (!(key is AsymmetricKeyParameter)) + throw new ArgumentException("KeyAgreement requires asymmetric key", "key"); + + AsymmetricKeyParameter receiverPrivateKey = (AsymmetricKeyParameter) key; + + if (!receiverPrivateKey.IsPrivate) + throw new ArgumentException("Expected private key", "key"); + + KeyParameter sKey = GetSessionKey(receiverPrivateKey); + + return GetContentFromSessionKey(sKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInformation.cs.meta new file mode 100644 index 00000000..2afa8460 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyAgreeRecipientInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 16d9a42147799fc408b9bb9ff87d2d6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInfoGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInfoGenerator.cs new file mode 100644 index 00000000..2a52ae38 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInfoGenerator.cs @@ -0,0 +1,91 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal class KeyTransRecipientInfoGenerator : RecipientInfoGenerator + { + private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance; + + private TbsCertificateStructure recipientTbsCert; + private AsymmetricKeyParameter recipientPublicKey; + private Asn1OctetString subjectKeyIdentifier; + + // Derived fields + private SubjectPublicKeyInfo info; + + internal KeyTransRecipientInfoGenerator() + { + } + + internal X509Certificate RecipientCert + { + set + { + this.recipientTbsCert = CmsUtilities.GetTbsCertificateStructure(value); + this.recipientPublicKey = value.GetPublicKey(); + this.info = recipientTbsCert.SubjectPublicKeyInfo; + } + } + + internal AsymmetricKeyParameter RecipientPublicKey + { + set + { + this.recipientPublicKey = value; + + try + { + info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo( + recipientPublicKey); + } + catch (IOException) + { + throw new ArgumentException("can't extract key algorithm from this key"); + } + } + } + + internal Asn1OctetString SubjectKeyIdentifier + { + set { this.subjectKeyIdentifier = value; } + } + + public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random) + { + byte[] keyBytes = contentEncryptionKey.GetKey(); + AlgorithmIdentifier keyEncryptionAlgorithm = info.AlgorithmID; + + IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionAlgorithm.Algorithm.Id); + keyWrapper.Init(true, new ParametersWithRandom(recipientPublicKey, random)); + byte[] encryptedKeyBytes = keyWrapper.Wrap(keyBytes, 0, keyBytes.Length); + + RecipientIdentifier recipId; + if (recipientTbsCert != null) + { + IssuerAndSerialNumber issuerAndSerial = new IssuerAndSerialNumber( + recipientTbsCert.Issuer, recipientTbsCert.SerialNumber.Value); + recipId = new RecipientIdentifier(issuerAndSerial); + } + else + { + recipId = new RecipientIdentifier(subjectKeyIdentifier); + } + + return new RecipientInfo(new KeyTransRecipientInfo(recipId, keyEncryptionAlgorithm, + new DerOctetString(encryptedKeyBytes))); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInfoGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInfoGenerator.cs.meta new file mode 100644 index 00000000..eed2c815 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInfoGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 62cf515f439ab014faae9f84218999b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInformation.cs new file mode 100644 index 00000000..9c0b4231 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInformation.cs @@ -0,0 +1,117 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using Asn1Pkcs = BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * the KeyTransRecipientInformation class for a recipient who has been sent a secret + * key encrypted using their public key that needs to be used to + * extract the message. + */ + public class KeyTransRecipientInformation + : RecipientInformation + { + private KeyTransRecipientInfo info; + + internal KeyTransRecipientInformation( + KeyTransRecipientInfo info, + CmsSecureReadable secureReadable) + : base(info.KeyEncryptionAlgorithm, secureReadable) + { + this.info = info; + this.rid = new RecipientID(); + + RecipientIdentifier r = info.RecipientIdentifier; + + try + { + if (r.IsTagged) + { + Asn1OctetString octs = Asn1OctetString.GetInstance(r.ID); + + rid.SubjectKeyIdentifier = octs.GetOctets(); + } + else + { + IssuerAndSerialNumber iAnds = IssuerAndSerialNumber.GetInstance(r.ID); + + rid.Issuer = iAnds.Name; + rid.SerialNumber = iAnds.SerialNumber.Value; + } + } + catch (IOException) + { + throw new ArgumentException("invalid rid in KeyTransRecipientInformation"); + } + } + + private string GetExchangeEncryptionAlgorithmName( + DerObjectIdentifier oid) + { + if (Asn1Pkcs.PkcsObjectIdentifiers.RsaEncryption.Equals(oid)) + { + return "RSA//PKCS1Padding"; + } + + return oid.Id; + } + + internal KeyParameter UnwrapKey(ICipherParameters key) + { + byte[] encryptedKey = info.EncryptedKey.GetOctets(); + string keyExchangeAlgorithm = GetExchangeEncryptionAlgorithmName(keyEncAlg.Algorithm); + + try + { + IWrapper keyWrapper = WrapperUtilities.GetWrapper(keyExchangeAlgorithm); + keyWrapper.Init(false, key); + + // FIXME Support for MAC algorithm parameters similar to cipher parameters + return ParameterUtilities.CreateKeyParameter( + GetContentAlgorithmName(), keyWrapper.Unwrap(encryptedKey, 0, encryptedKey.Length)); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } +// catch (IllegalBlockSizeException e) + catch (DataLengthException e) + { + throw new CmsException("illegal blocksize in message.", e); + } +// catch (BadPaddingException e) + catch (InvalidCipherTextException e) + { + throw new CmsException("bad padding in message.", e); + } + } + + /** + * decrypt the content and return it as a byte array. + */ + public override CmsTypedStream GetContentStream( + ICipherParameters key) + { + KeyParameter sKey = UnwrapKey(key); + + return GetContentFromSessionKey(sKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInformation.cs.meta new file mode 100644 index 00000000..216db4ba --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/KeyTransRecipientInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0e4c1fe9df46304aad8da6377a731b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorId.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorId.cs new file mode 100644 index 00000000..ff3f0b01 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorId.cs @@ -0,0 +1,55 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * a basic index for an originator. + */ + public class OriginatorID + : X509CertStoreSelector + { + public override int GetHashCode() + { + int code = Arrays.GetHashCode(this.SubjectKeyIdentifier); + + BigInteger serialNumber = this.SerialNumber; + if (serialNumber != null) + { + code ^= serialNumber.GetHashCode(); + } + + X509Name issuer = this.Issuer; + if (issuer != null) + { + code ^= issuer.GetHashCode(); + } + + return code; + } + + public override bool Equals( + object obj) + { + if (obj == this) + return false; + + OriginatorID id = obj as OriginatorID; + + if (id == null) + return false; + + return Arrays.AreEqual(SubjectKeyIdentifier, id.SubjectKeyIdentifier) + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(SerialNumber, id.SerialNumber) + && IssuersMatch(Issuer, id.Issuer); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorId.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorId.cs.meta new file mode 100644 index 00000000..c46a4e76 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 88730f33bf66f0a448ad35da8082b31d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInfoGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInfoGenerator.cs new file mode 100644 index 00000000..6fcd7150 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInfoGenerator.cs @@ -0,0 +1,46 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class OriginatorInfoGenerator + { + private readonly IList origCerts; + private readonly IList origCrls; + + public OriginatorInfoGenerator(X509Certificate origCert) + { + this.origCerts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(1); + this.origCrls = null; + origCerts.Add(origCert.CertificateStructure); + } + + public OriginatorInfoGenerator(IX509Store origCerts) + : this(origCerts, null) + { + } + + public OriginatorInfoGenerator(IX509Store origCerts, IX509Store origCrls) + { + this.origCerts = CmsUtilities.GetCertificatesFromStore(origCerts); + this.origCrls = origCrls == null ? null : CmsUtilities.GetCrlsFromStore(origCrls); + } + + public virtual OriginatorInfo Generate() + { + Asn1Set certSet = CmsUtilities.CreateDerSetFromList(origCerts); + Asn1Set crlSet = origCrls == null ? null : CmsUtilities.CreateDerSetFromList(origCrls); + return new OriginatorInfo(certSet, crlSet); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInfoGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInfoGenerator.cs.meta new file mode 100644 index 00000000..e55cac03 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInfoGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2dbdf7ea09dde0419cae93bf8aecc19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInformation.cs new file mode 100644 index 00000000..d122b6ec --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInformation.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class OriginatorInformation + { + private readonly OriginatorInfo originatorInfo; + + internal OriginatorInformation(OriginatorInfo originatorInfo) + { + this.originatorInfo = originatorInfo; + } + + /** + * Return the certificates stored in the underlying OriginatorInfo object. + * + * @return a Store of X509CertificateHolder objects. + */ + public virtual IX509Store GetCertificates() + { + Asn1Set certSet = originatorInfo.Certificates; + + if (certSet != null) + { + IList certList = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(certSet.Count); + + foreach (Asn1Encodable enc in certSet) + { + Asn1Object obj = enc.ToAsn1Object(); + if (obj is Asn1Sequence) + { + certList.Add(new X509Certificate(X509CertificateStructure.GetInstance(obj))); + } + } + + return X509StoreFactory.Create( + "Certificate/Collection", + new X509CollectionStoreParameters(certList)); + } + + return X509StoreFactory.Create( + "Certificate/Collection", + new X509CollectionStoreParameters(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList())); + } + + /** + * Return the CRLs stored in the underlying OriginatorInfo object. + * + * @return a Store of X509CRLHolder objects. + */ + public virtual IX509Store GetCrls() + { + Asn1Set crlSet = originatorInfo.Certificates; + + if (crlSet != null) + { + IList crlList = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(crlSet.Count); + + foreach (Asn1Encodable enc in crlSet) + { + Asn1Object obj = enc.ToAsn1Object(); + if (obj is Asn1Sequence) + { + crlList.Add(new X509Crl(CertificateList.GetInstance(obj))); + } + } + + return X509StoreFactory.Create( + "CRL/Collection", + new X509CollectionStoreParameters(crlList)); + } + + return X509StoreFactory.Create( + "CRL/Collection", + new X509CollectionStoreParameters(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList())); + } + + /** + * Return the underlying ASN.1 object defining this SignerInformation object. + * + * @return a OriginatorInfo. + */ + public virtual OriginatorInfo ToAsn1Structure() + { + return originatorInfo; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInformation.cs.meta new file mode 100644 index 00000000..57ecb390 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/OriginatorInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0274e45e4aa4c948bc4607426c487bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2PBEKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2PBEKey.cs new file mode 100644 index 00000000..12986779 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2PBEKey.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /// + /// PKCS5 scheme-2 - password converted to bytes assuming ASCII. + /// + public class Pkcs5Scheme2PbeKey + : CmsPbeKey + { + [Obsolete("Use version taking 'char[]' instead")] + public Pkcs5Scheme2PbeKey( + string password, + byte[] salt, + int iterationCount) + : this(password.ToCharArray(), salt, iterationCount) + { + } + + [Obsolete("Use version taking 'char[]' instead")] + public Pkcs5Scheme2PbeKey( + string password, + AlgorithmIdentifier keyDerivationAlgorithm) + : this(password.ToCharArray(), keyDerivationAlgorithm) + { + } + + public Pkcs5Scheme2PbeKey( + char[] password, + byte[] salt, + int iterationCount) + : base(password, salt, iterationCount) + { + } + + public Pkcs5Scheme2PbeKey( + char[] password, + AlgorithmIdentifier keyDerivationAlgorithm) + : base(password, keyDerivationAlgorithm) + { + } + + internal override KeyParameter GetEncoded( + string algorithmOid) + { + Pkcs5S2ParametersGenerator gen = new Pkcs5S2ParametersGenerator(); + + gen.Init( + PbeParametersGenerator.Pkcs5PasswordToBytes(password), + salt, + iterationCount); + + return (KeyParameter) gen.GenerateDerivedParameters( + algorithmOid, + CmsEnvelopedHelper.Instance.GetKeySize(algorithmOid)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2PBEKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2PBEKey.cs.meta new file mode 100644 index 00000000..12b7fb47 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2PBEKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff95842945d4c9b43a55fdf3135fe940 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2UTF8PBEKey.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2UTF8PBEKey.cs new file mode 100644 index 00000000..ecbeb8b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2UTF8PBEKey.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * PKCS5 scheme-2 - password converted to bytes using UTF-8. + */ + public class Pkcs5Scheme2Utf8PbeKey + : CmsPbeKey + { + [Obsolete("Use version taking 'char[]' instead")] + public Pkcs5Scheme2Utf8PbeKey( + string password, + byte[] salt, + int iterationCount) + : this(password.ToCharArray(), salt, iterationCount) + { + } + + [Obsolete("Use version taking 'char[]' instead")] + public Pkcs5Scheme2Utf8PbeKey( + string password, + AlgorithmIdentifier keyDerivationAlgorithm) + : this(password.ToCharArray(), keyDerivationAlgorithm) + { + } + + public Pkcs5Scheme2Utf8PbeKey( + char[] password, + byte[] salt, + int iterationCount) + : base(password, salt, iterationCount) + { + } + + public Pkcs5Scheme2Utf8PbeKey( + char[] password, + AlgorithmIdentifier keyDerivationAlgorithm) + : base(password, keyDerivationAlgorithm) + { + } + + internal override KeyParameter GetEncoded( + string algorithmOid) + { + Pkcs5S2ParametersGenerator gen = new Pkcs5S2ParametersGenerator(); + + gen.Init( + PbeParametersGenerator.Pkcs5PasswordToUtf8Bytes(password), + salt, + iterationCount); + + return (KeyParameter) gen.GenerateDerivedParameters( + algorithmOid, + CmsEnvelopedHelper.Instance.GetKeySize(algorithmOid)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2UTF8PBEKey.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2UTF8PBEKey.cs.meta new file mode 100644 index 00000000..a69f6ec5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PKCS5Scheme2UTF8PBEKey.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9efe8084cdcc5b94abb2f637c28bbbb4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInfoGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInfoGenerator.cs new file mode 100644 index 00000000..5f5dcb7a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInfoGenerator.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal class PasswordRecipientInfoGenerator : RecipientInfoGenerator + { + private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance; + + private AlgorithmIdentifier keyDerivationAlgorithm; + private KeyParameter keyEncryptionKey; + // TODO Can get this from keyEncryptionKey? + private string keyEncryptionKeyOID; + + internal PasswordRecipientInfoGenerator() + { + } + + internal AlgorithmIdentifier KeyDerivationAlgorithm + { + set { this.keyDerivationAlgorithm = value; } + } + + internal KeyParameter KeyEncryptionKey + { + set { this.keyEncryptionKey = value; } + } + + internal string KeyEncryptionKeyOID + { + set { this.keyEncryptionKeyOID = value; } + } + + public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random) + { + byte[] keyBytes = contentEncryptionKey.GetKey(); + + string rfc3211WrapperName = Helper.GetRfc3211WrapperName(keyEncryptionKeyOID); + IWrapper keyWrapper = Helper.CreateWrapper(rfc3211WrapperName); + + // Note: In Java build, the IV is automatically generated in JCE layer + int ivLength = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(rfc3211WrapperName, "DESEDE") ? 8 : 16; + byte[] iv = new byte[ivLength]; + random.NextBytes(iv); + + ICipherParameters parameters = new ParametersWithIV(keyEncryptionKey, iv); + keyWrapper.Init(true, new ParametersWithRandom(parameters, random)); + Asn1OctetString encryptedKey = new DerOctetString( + keyWrapper.Wrap(keyBytes, 0, keyBytes.Length)); + + DerSequence seq = new DerSequence( + new DerObjectIdentifier(keyEncryptionKeyOID), + new DerOctetString(iv)); + + AlgorithmIdentifier keyEncryptionAlgorithm = new AlgorithmIdentifier( + PkcsObjectIdentifiers.IdAlgPwriKek, seq); + + return new RecipientInfo(new PasswordRecipientInfo( + keyDerivationAlgorithm, keyEncryptionAlgorithm, encryptedKey)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInfoGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInfoGenerator.cs.meta new file mode 100644 index 00000000..204ad244 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInfoGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0797ef17dd9a6674e99ef08509e4fae2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInformation.cs new file mode 100644 index 00000000..4aa58f08 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInformation.cs @@ -0,0 +1,83 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * the RecipientInfo class for a recipient who has been sent a message + * encrypted using a password. + */ + public class PasswordRecipientInformation + : RecipientInformation + { + private readonly PasswordRecipientInfo info; + + internal PasswordRecipientInformation( + PasswordRecipientInfo info, + CmsSecureReadable secureReadable) + : base(info.KeyEncryptionAlgorithm, secureReadable) + { + this.info = info; + this.rid = new RecipientID(); + } + + /** + * return the object identifier for the key derivation algorithm, or null + * if there is none present. + * + * @return OID for key derivation algorithm, if present. + */ + public virtual AlgorithmIdentifier KeyDerivationAlgorithm + { + get { return info.KeyDerivationAlgorithm; } + } + + /** + * decrypt the content and return an input stream. + */ + public override CmsTypedStream GetContentStream( + ICipherParameters key) + { + try + { + AlgorithmIdentifier kekAlg = AlgorithmIdentifier.GetInstance(info.KeyEncryptionAlgorithm); + Asn1Sequence kekAlgParams = (Asn1Sequence)kekAlg.Parameters; + byte[] encryptedKey = info.EncryptedKey.GetOctets(); + string kekAlgName = DerObjectIdentifier.GetInstance(kekAlgParams[0]).Id; + string cName = CmsEnvelopedHelper.Instance.GetRfc3211WrapperName(kekAlgName); + IWrapper keyWrapper = WrapperUtilities.GetWrapper(cName); + + byte[] iv = Asn1OctetString.GetInstance(kekAlgParams[1]).GetOctets(); + + ICipherParameters parameters = ((CmsPbeKey)key).GetEncoded(kekAlgName); + parameters = new ParametersWithIV(parameters, iv); + + keyWrapper.Init(false, parameters); + + KeyParameter sKey = ParameterUtilities.CreateKeyParameter( + GetContentAlgorithmName(), keyWrapper.Unwrap(encryptedKey, 0, encryptedKey.Length)); + + return GetContentFromSessionKey(sKey); + } + catch (SecurityUtilityException e) + { + throw new CmsException("couldn't create cipher.", e); + } + catch (InvalidKeyException e) + { + throw new CmsException("key invalid in message.", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInformation.cs.meta new file mode 100644 index 00000000..7f74e026 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/PasswordRecipientInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59db2f4f7992797448e438347160b5d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientId.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientId.cs new file mode 100644 index 00000000..7a1a9505 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientId.cs @@ -0,0 +1,62 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class RecipientID + : X509CertStoreSelector + { + private byte[] keyIdentifier; + + public byte[] KeyIdentifier + { + get { return Arrays.Clone(keyIdentifier); } + set { keyIdentifier = Arrays.Clone(value); } + } + + public override int GetHashCode() + { + int code = Arrays.GetHashCode(keyIdentifier) + ^ Arrays.GetHashCode(this.SubjectKeyIdentifier); + + BigInteger serialNumber = this.SerialNumber; + if (serialNumber != null) + { + code ^= serialNumber.GetHashCode(); + } + + X509Name issuer = this.Issuer; + if (issuer != null) + { + code ^= issuer.GetHashCode(); + } + + return code; + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + RecipientID id = obj as RecipientID; + + if (id == null) + return false; + + return Arrays.AreEqual(keyIdentifier, id.keyIdentifier) + && Arrays.AreEqual(SubjectKeyIdentifier, id.SubjectKeyIdentifier) + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(SerialNumber, id.SerialNumber) + && IssuersMatch(Issuer, id.Issuer); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientId.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientId.cs.meta new file mode 100644 index 00000000..a3e5b777 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d8f726b35dc2ff4a82eedd642b0f48a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInfoGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInfoGenerator.cs new file mode 100644 index 00000000..b5ce25e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInfoGenerator.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + interface RecipientInfoGenerator + { + /// + /// Generate a RecipientInfo object for the given key. + /// + /// + /// A + /// + /// + /// A + /// + /// + /// A + /// + /// + RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInfoGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInfoGenerator.cs.meta new file mode 100644 index 00000000..5266110e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInfoGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98552255b0d43084da588633f2b167e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformation.cs new file mode 100644 index 00000000..af116d45 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformation.cs @@ -0,0 +1,130 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public abstract class RecipientInformation + { + internal RecipientID rid = new RecipientID(); + internal AlgorithmIdentifier keyEncAlg; + internal CmsSecureReadable secureReadable; + + private byte[] resultMac; + + internal RecipientInformation( + AlgorithmIdentifier keyEncAlg, + CmsSecureReadable secureReadable) + { + this.keyEncAlg = keyEncAlg; + this.secureReadable = secureReadable; + } + + internal string GetContentAlgorithmName() + { + AlgorithmIdentifier algorithm = secureReadable.Algorithm; +// return CmsEnvelopedHelper.Instance.GetSymmetricCipherName(algorithm.Algorithm.Id); + return algorithm.Algorithm.Id; + } + + public RecipientID RecipientID + { + get { return rid; } + } + + public AlgorithmIdentifier KeyEncryptionAlgorithmID + { + get { return keyEncAlg; } + } + + /** + * return the object identifier for the key encryption algorithm. + * + * @return OID for key encryption algorithm. + */ + public string KeyEncryptionAlgOid + { + get { return keyEncAlg.Algorithm.Id; } + } + + /** + * return the ASN.1 encoded key encryption algorithm parameters, or null if + * there aren't any. + * + * @return ASN.1 encoding of key encryption algorithm parameters. + */ + public Asn1Object KeyEncryptionAlgParams + { + get + { + Asn1Encodable ae = keyEncAlg.Parameters; + + return ae == null ? null : ae.ToAsn1Object(); + } + } + + internal CmsTypedStream GetContentFromSessionKey( + KeyParameter sKey) + { + CmsReadable readable = secureReadable.GetReadable(sKey); + + try + { + return new CmsTypedStream(readable.GetInputStream()); + } + catch (IOException e) + { + throw new CmsException("error getting .", e); + } + } + + public byte[] GetContent( + ICipherParameters key) + { + try + { + return CmsUtilities.StreamToByteArray(GetContentStream(key).ContentStream); + } + catch (IOException e) + { + throw new Exception("unable to parse internal stream: " + e); + } + } + + /** + * Return the MAC calculated for the content stream. Note: this call is only meaningful once all + * the content has been read. + * + * @return byte array containing the mac. + */ + public byte[] GetMac() + { + if (resultMac == null) + { + object cryptoObject = secureReadable.CryptoObject; + if (cryptoObject is IMac) + { + resultMac = MacUtilities.DoFinal((IMac)cryptoObject); + } + } + + return Arrays.Clone(resultMac); + } + + public abstract CmsTypedStream GetContentStream(ICipherParameters key); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformation.cs.meta new file mode 100644 index 00000000..2cb5fd11 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b09bd29817789f64585d8d5fd9c5bc31 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformationStore.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformationStore.cs new file mode 100644 index 00000000..e067b7c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformationStore.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class RecipientInformationStore + { + private readonly IList all; //ArrayList[RecipientInformation] + private readonly IDictionary table = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); // Hashtable[RecipientID, ArrayList[RecipientInformation]] + + public RecipientInformationStore( + ICollection recipientInfos) + { + foreach (RecipientInformation recipientInformation in recipientInfos) + { + RecipientID rid = recipientInformation.RecipientID; + IList list = (IList)table[rid]; + + if (list == null) + { + table[rid] = list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(1); + } + + list.Add(recipientInformation); + } + + this.all = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(recipientInfos); + } + + public RecipientInformation this[RecipientID selector] + { + get { return GetFirstRecipient(selector); } + } + + /** + * Return the first RecipientInformation object that matches the + * passed in selector. Null if there are no matches. + * + * @param selector to identify a recipient + * @return a single RecipientInformation object. Null if none matches. + */ + public RecipientInformation GetFirstRecipient( + RecipientID selector) + { + IList list = (IList) table[selector]; + + return list == null ? null : (RecipientInformation) list[0]; + } + + /** + * Return the number of recipients in the collection. + * + * @return number of recipients identified. + */ + public int Count + { + get { return all.Count; } + } + + /** + * Return all recipients in the collection + * + * @return a collection of recipients. + */ + public ICollection GetRecipients() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(all); + } + + /** + * Return possible empty collection with recipients matching the passed in RecipientID + * + * @param selector a recipient id to select against. + * @return a collection of RecipientInformation objects. + */ + public ICollection GetRecipients( + RecipientID selector) + { + IList list = (IList)table[selector]; + + return list == null ? BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList() : BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(list); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformationStore.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformationStore.cs.meta new file mode 100644 index 00000000..4010dbe7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/RecipientInformationStore.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b264e8d3e47b2984cbe5e32516b48789 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerId.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerId.cs new file mode 100644 index 00000000..f707a240 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerId.cs @@ -0,0 +1,55 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * a basic index for a signer. + */ + public class SignerID + : X509CertStoreSelector + { + public override int GetHashCode() + { + int code = Arrays.GetHashCode(this.SubjectKeyIdentifier); + + BigInteger serialNumber = this.SerialNumber; + if (serialNumber != null) + { + code ^= serialNumber.GetHashCode(); + } + + X509Name issuer = this.Issuer; + if (issuer != null) + { + code ^= issuer.GetHashCode(); + } + + return code; + } + + public override bool Equals( + object obj) + { + if (obj == this) + return false; + + SignerID id = obj as SignerID; + + if (id == null) + return false; + + return Arrays.AreEqual(SubjectKeyIdentifier, id.SubjectKeyIdentifier) + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(SerialNumber, id.SerialNumber) + && IssuersMatch(Issuer, id.Issuer); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerId.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerId.cs.meta new file mode 100644 index 00000000..2f99c90f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerId.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 301fe279a448eb44e9877141e50d0d51 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInfoGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInfoGenerator.cs new file mode 100644 index 00000000..9e6a34de --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInfoGenerator.cs @@ -0,0 +1,170 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + internal interface ISignerInfoGenerator + { + SignerInfo Generate(DerObjectIdentifier contentType, AlgorithmIdentifier digestAlgorithm, + byte[] calculatedDigest); + } + + public class SignerInfoGenerator + { + internal X509Certificate certificate; + internal ISignatureFactory contentSigner; + internal SignerIdentifier sigId; + internal CmsAttributeTableGenerator signedGen; + internal CmsAttributeTableGenerator unsignedGen; + private bool isDirectSignature; + + internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory): this(sigId, signerFactory, false) + { + + } + + internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory signerFactory, bool isDirectSignature) + { + this.sigId = sigId; + this.contentSigner = signerFactory; + this.isDirectSignature = isDirectSignature; + if (this.isDirectSignature) + { + this.signedGen = null; + this.unsignedGen = null; + } + else + { + this.signedGen = new DefaultSignedAttributeTableGenerator(); + this.unsignedGen = null; + } + } + + internal SignerInfoGenerator(SignerIdentifier sigId, ISignatureFactory contentSigner, CmsAttributeTableGenerator signedGen, CmsAttributeTableGenerator unsignedGen) + { + this.sigId = sigId; + this.contentSigner = contentSigner; + this.signedGen = signedGen; + this.unsignedGen = unsignedGen; + this.isDirectSignature = false; + } + + internal void setAssociatedCertificate(X509Certificate certificate) + { + this.certificate = certificate; + } + } + + public class SignerInfoGeneratorBuilder + { + private bool directSignature; + private CmsAttributeTableGenerator signedGen; + private CmsAttributeTableGenerator unsignedGen; + + public SignerInfoGeneratorBuilder() + { + } + + /** + * If the passed in flag is true, the signer signature will be based on the data, not + * a collection of signed attributes, and no signed attributes will be included. + * + * @return the builder object + */ + public SignerInfoGeneratorBuilder SetDirectSignature(bool hasNoSignedAttributes) + { + this.directSignature = hasNoSignedAttributes; + + return this; + } + + /** + * Provide a custom signed attribute generator. + * + * @param signedGen a generator of signed attributes. + * @return the builder object + */ + public SignerInfoGeneratorBuilder WithSignedAttributeGenerator(CmsAttributeTableGenerator signedGen) + { + this.signedGen = signedGen; + + return this; + } + + /** + * Provide a generator of unsigned attributes. + * + * @param unsignedGen a generator for signed attributes. + * @return the builder object + */ + public SignerInfoGeneratorBuilder WithUnsignedAttributeGenerator(CmsAttributeTableGenerator unsignedGen) + { + this.unsignedGen = unsignedGen; + + return this; + } + + /** + * Build a generator with the passed in X.509 certificate issuer and serial number as the signerIdentifier. + * + * @param contentSigner operator for generating the final signature in the SignerInfo with. + * @param certificate X.509 certificate related to the contentSigner. + * @return a SignerInfoGenerator + * @throws OperatorCreationException if the generator cannot be built. + */ + public SignerInfoGenerator Build(ISignatureFactory contentSigner, X509Certificate certificate) + { + SignerIdentifier sigId = new SignerIdentifier(new IssuerAndSerialNumber(certificate.IssuerDN, new DerInteger(certificate.SerialNumber))); + + SignerInfoGenerator sigInfoGen = CreateGenerator(contentSigner, sigId); + + sigInfoGen.setAssociatedCertificate(certificate); + + return sigInfoGen; + } + + /** + * Build a generator with the passed in subjectKeyIdentifier as the signerIdentifier. If used you should + * try to follow the calculation described in RFC 5280 section 4.2.1.2. + * + * @param signerFactory operator factory for generating the final signature in the SignerInfo with. + * @param subjectKeyIdentifier key identifier to identify the public key for verifying the signature. + * @return a SignerInfoGenerator + */ + public SignerInfoGenerator Build(ISignatureFactory signerFactory, byte[] subjectKeyIdentifier) + { + SignerIdentifier sigId = new SignerIdentifier(new DerOctetString(subjectKeyIdentifier)); + + return CreateGenerator(signerFactory, sigId); + } + + private SignerInfoGenerator CreateGenerator(ISignatureFactory contentSigner, SignerIdentifier sigId) + { + if (directSignature) + { + return new SignerInfoGenerator(sigId, contentSigner, true); + } + + if (signedGen != null || unsignedGen != null) + { + if (signedGen == null) + { + signedGen = new DefaultSignedAttributeTableGenerator(); + } + + return new SignerInfoGenerator(sigId, contentSigner, signedGen, unsignedGen); + } + + return new SignerInfoGenerator(sigId, contentSigner); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInfoGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInfoGenerator.cs.meta new file mode 100644 index 00000000..c63cc452 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInfoGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 432e7e0fd04f285448faeb0b827ea82e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformation.cs new file mode 100644 index 00000000..fef7dd68 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformation.cs @@ -0,0 +1,797 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Diagnostics; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * an expanded SignerInfo block from a CMS Signed message + */ + public class SignerInformation + { + private static readonly CmsSignedHelper Helper = CmsSignedHelper.Instance; + + private SignerID sid; + private SignerInfo info; + private AlgorithmIdentifier digestAlgorithm; + private AlgorithmIdentifier encryptionAlgorithm; + private readonly Asn1Set signedAttributeSet; + private readonly Asn1Set unsignedAttributeSet; + private CmsProcessable content; + private byte[] signature; + private DerObjectIdentifier contentType; + private IDigestCalculator digestCalculator; + private byte[] resultDigest; + + // Derived + private Asn1.Cms.AttributeTable signedAttributeTable; + private Asn1.Cms.AttributeTable unsignedAttributeTable; + private readonly bool isCounterSignature; + + internal SignerInformation( + SignerInfo info, + DerObjectIdentifier contentType, + CmsProcessable content, + IDigestCalculator digestCalculator) + { + this.info = info; + this.sid = new SignerID(); + this.contentType = contentType; + this.isCounterSignature = contentType == null; + + try + { + SignerIdentifier s = info.SignerID; + + if (s.IsTagged) + { + Asn1OctetString octs = Asn1OctetString.GetInstance(s.ID); + + sid.SubjectKeyIdentifier = octs.GetEncoded(); + } + else + { + Asn1.Cms.IssuerAndSerialNumber iAnds = + Asn1.Cms.IssuerAndSerialNumber.GetInstance(s.ID); + + sid.Issuer = iAnds.Name; + sid.SerialNumber = iAnds.SerialNumber.Value; + } + } + catch (IOException) + { + throw new ArgumentException("invalid sid in SignerInfo"); + } + + this.digestAlgorithm = info.DigestAlgorithm; + this.signedAttributeSet = info.AuthenticatedAttributes; + this.unsignedAttributeSet = info.UnauthenticatedAttributes; + this.encryptionAlgorithm = info.DigestEncryptionAlgorithm; + this.signature = info.EncryptedDigest.GetOctets(); + + this.content = content; + this.digestCalculator = digestCalculator; + } + + /** + * Protected constructor. In some cases clients have their own idea about how to encode + * the signed attributes and calculate the signature. This constructor is to allow developers + * to deal with that by extending off the class and overridng methods like getSignedAttributes(). + * + * @param baseInfo the SignerInformation to base this one on. + */ + protected SignerInformation(SignerInformation baseInfo) + { + this.info = baseInfo.info; + this.contentType = baseInfo.contentType; + this.isCounterSignature = baseInfo.IsCounterSignature; + this.sid = baseInfo.SignerID; + this.digestAlgorithm = info.DigestAlgorithm; + this.signedAttributeSet = info.AuthenticatedAttributes; + this.unsignedAttributeSet = info.UnauthenticatedAttributes; + this.encryptionAlgorithm = info.DigestEncryptionAlgorithm; + this.signature = info.EncryptedDigest.GetOctets(); + this.content = baseInfo.content; + this.resultDigest = baseInfo.resultDigest; + this.signedAttributeTable = baseInfo.signedAttributeTable; + this.unsignedAttributeTable = baseInfo.unsignedAttributeTable; + } + + public bool IsCounterSignature + { + get { return isCounterSignature; } + } + + public DerObjectIdentifier ContentType + { + get { return contentType; } + } + + public SignerID SignerID + { + get { return sid; } + } + + /** + * return the version number for this objects underlying SignerInfo structure. + */ + public int Version + { + get { return info.Version.Value.IntValue; } + } + + public AlgorithmIdentifier DigestAlgorithmID + { + get { return digestAlgorithm; } + } + + /** + * return the object identifier for the signature. + */ + public string DigestAlgOid + { + get { return digestAlgorithm.Algorithm.Id; } + } + + /** + * return the signature parameters, or null if there aren't any. + */ + public Asn1Object DigestAlgParams + { + get + { + Asn1Encodable ae = digestAlgorithm.Parameters; + + return ae == null ? null : ae.ToAsn1Object(); + } + } + + /** + * return the content digest that was calculated during verification. + */ + public byte[] GetContentDigest() + { + if (resultDigest == null) + { + throw new InvalidOperationException("method can only be called after verify."); + } + + return (byte[])resultDigest.Clone(); + } + + public AlgorithmIdentifier EncryptionAlgorithmID + { + get { return encryptionAlgorithm; } + } + + /** + * return the object identifier for the signature. + */ + public string EncryptionAlgOid + { + get { return encryptionAlgorithm.Algorithm.Id; } + } + + /** + * return the signature/encryption algorithm parameters, or null if + * there aren't any. + */ + public Asn1Object EncryptionAlgParams + { + get + { + Asn1Encodable ae = encryptionAlgorithm.Parameters; + + return ae == null ? null : ae.ToAsn1Object(); + } + } + + /** + * return a table of the signed attributes - indexed by + * the OID of the attribute. + */ + public Asn1.Cms.AttributeTable SignedAttributes + { + get + { + if (signedAttributeSet != null && signedAttributeTable == null) + { + signedAttributeTable = new Asn1.Cms.AttributeTable(signedAttributeSet); + } + return signedAttributeTable; + } + } + + /** + * return a table of the unsigned attributes indexed by + * the OID of the attribute. + */ + public Asn1.Cms.AttributeTable UnsignedAttributes + { + get + { + if (unsignedAttributeSet != null && unsignedAttributeTable == null) + { + unsignedAttributeTable = new Asn1.Cms.AttributeTable(unsignedAttributeSet); + } + return unsignedAttributeTable; + } + } + + /** + * return the encoded signature + */ + public byte[] GetSignature() + { + return (byte[]) signature.Clone(); + } + + /** + * Return a SignerInformationStore containing the counter signatures attached to this + * signer. If no counter signatures are present an empty store is returned. + */ + public SignerInformationStore GetCounterSignatures() + { + // TODO There are several checks implied by the RFC3852 comments that are missing + + /* + The countersignature attribute MUST be an unsigned attribute; it MUST + NOT be a signed attribute, an authenticated attribute, an + unauthenticated attribute, or an unprotected attribute. + */ + Asn1.Cms.AttributeTable unsignedAttributeTable = UnsignedAttributes; + if (unsignedAttributeTable == null) + { + return new SignerInformationStore(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(0)); + } + + IList counterSignatures = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + /* + The UnsignedAttributes syntax is defined as a SET OF Attributes. The + UnsignedAttributes in a signerInfo may include multiple instances of + the countersignature attribute. + */ + Asn1EncodableVector allCSAttrs = unsignedAttributeTable.GetAll(CmsAttributes.CounterSignature); + + foreach (Asn1.Cms.Attribute counterSignatureAttribute in allCSAttrs) + { + /* + A countersignature attribute can have multiple attribute values. The + syntax is defined as a SET OF AttributeValue, and there MUST be one + or more instances of AttributeValue present. + */ + Asn1Set values = counterSignatureAttribute.AttrValues; + if (values.Count < 1) + { + // TODO Throw an appropriate exception? + } + + foreach (Asn1Encodable asn1Obj in values) + { + /* + Countersignature values have the same meaning as SignerInfo values + for ordinary signatures, except that: + + 1. The signedAttributes field MUST NOT contain a content-type + attribute; there is no content type for countersignatures. + + 2. The signedAttributes field MUST contain a message-digest + attribute if it contains any other attributes. + + 3. The input to the message-digesting process is the contents + octets of the DER encoding of the signatureValue field of the + SignerInfo value with which the attribute is associated. + */ + SignerInfo si = SignerInfo.GetInstance(asn1Obj.ToAsn1Object()); + + string digestName = CmsSignedHelper.Instance.GetDigestAlgName(si.DigestAlgorithm.Algorithm.Id); + + counterSignatures.Add(new SignerInformation(si, null, null, new CounterSignatureDigestCalculator(digestName, GetSignature()))); + } + } + + return new SignerInformationStore(counterSignatures); + } + + /** + * return the DER encoding of the signed attributes. + * @throws IOException if an encoding error occurs. + */ + public byte[] GetEncodedSignedAttributes() + { + return signedAttributeSet == null + ? null + : signedAttributeSet.GetEncoded(Asn1Encodable.Der); + } + + private bool DoVerify( + AsymmetricKeyParameter key) + { + string digestName = Helper.GetDigestAlgName(this.DigestAlgOid); + IDigest digest = Helper.GetDigestInstance(digestName); + + DerObjectIdentifier sigAlgOid = this.encryptionAlgorithm.Algorithm; + Asn1Encodable sigParams = this.encryptionAlgorithm.Parameters; + ISigner sig; + + if (sigAlgOid.Equals(Asn1.Pkcs.PkcsObjectIdentifiers.IdRsassaPss)) + { + // RFC 4056 2.2 + // When the id-RSASSA-PSS algorithm identifier is used for a signature, + // the AlgorithmIdentifier parameters field MUST contain RSASSA-PSS-params. + if (sigParams == null) + throw new CmsException("RSASSA-PSS signature must specify algorithm parameters"); + + try + { + // TODO Provide abstract configuration mechanism + // (via alternate SignerUtilities.GetSigner method taking ASN.1 params) + + Asn1.Pkcs.RsassaPssParameters pss = Asn1.Pkcs.RsassaPssParameters.GetInstance( + sigParams.ToAsn1Object()); + + if (!pss.HashAlgorithm.Algorithm.Equals(this.digestAlgorithm.Algorithm)) + throw new CmsException("RSASSA-PSS signature parameters specified incorrect hash algorithm"); + if (!pss.MaskGenAlgorithm.Algorithm.Equals(Asn1.Pkcs.PkcsObjectIdentifiers.IdMgf1)) + throw new CmsException("RSASSA-PSS signature parameters specified unknown MGF"); + + IDigest pssDigest = DigestUtilities.GetDigest(pss.HashAlgorithm.Algorithm); + int saltLength = pss.SaltLength.Value.IntValue; + byte trailerField = (byte) pss.TrailerField.Value.IntValue; + + // RFC 4055 3.1 + // The value MUST be 1, which represents the trailer field with hexadecimal value 0xBC + if (trailerField != 1) + throw new CmsException("RSASSA-PSS signature parameters must have trailerField of 1"); + + sig = new PssSigner(new RsaBlindedEngine(), pssDigest, saltLength); + } + catch (Exception e) + { + throw new CmsException("failed to set RSASSA-PSS signature parameters", e); + } + } + else + { + // TODO Probably too strong a check at the moment +// if (sigParams != null) +// throw new CmsException("unrecognised signature parameters provided"); + + string signatureName = digestName + "with" + Helper.GetEncryptionAlgName(this.EncryptionAlgOid); + + sig = Helper.GetSignatureInstance(signatureName); + + //sig = Helper.GetSignatureInstance(this.EncryptionAlgOid); + //sig = SignerUtilities.GetSigner(sigAlgOid); + } + + try + { + if (digestCalculator != null) + { + resultDigest = digestCalculator.GetDigest(); + } + else + { + if (content != null) + { + content.Write(new DigestSink(digest)); + } + else if (signedAttributeSet == null) + { + // TODO Get rid of this exception and just treat content==null as empty not missing? + throw new CmsException("data not encapsulated in signature - use detached constructor."); + } + + resultDigest = DigestUtilities.DoFinal(digest); + } + } + catch (IOException e) + { + throw new CmsException("can't process mime object to create signature.", e); + } + + // RFC 3852 11.1 Check the content-type attribute is correct + { + Asn1Object validContentType = GetSingleValuedSignedAttribute( + CmsAttributes.ContentType, "content-type"); + if (validContentType == null) + { + if (!isCounterSignature && signedAttributeSet != null) + throw new CmsException("The content-type attribute type MUST be present whenever signed attributes are present in signed-data"); + } + else + { + if (isCounterSignature) + throw new CmsException("[For counter signatures,] the signedAttributes field MUST NOT contain a content-type attribute"); + + if (!(validContentType is DerObjectIdentifier)) + throw new CmsException("content-type attribute value not of ASN.1 type 'OBJECT IDENTIFIER'"); + + DerObjectIdentifier signedContentType = (DerObjectIdentifier)validContentType; + + if (!signedContentType.Equals(contentType)) + throw new CmsException("content-type attribute value does not match eContentType"); + } + } + + // RFC 3852 11.2 Check the message-digest attribute is correct + { + Asn1Object validMessageDigest = GetSingleValuedSignedAttribute( + CmsAttributes.MessageDigest, "message-digest"); + if (validMessageDigest == null) + { + if (signedAttributeSet != null) + throw new CmsException("the message-digest signed attribute type MUST be present when there are any signed attributes present"); + } + else + { + if (!(validMessageDigest is Asn1OctetString)) + { + throw new CmsException("message-digest attribute value not of ASN.1 type 'OCTET STRING'"); + } + + Asn1OctetString signedMessageDigest = (Asn1OctetString)validMessageDigest; + + if (!Arrays.AreEqual(resultDigest, signedMessageDigest.GetOctets())) + throw new CmsException("message-digest attribute value does not match calculated value"); + } + } + + // RFC 3852 11.4 Validate countersignature attribute(s) + { + Asn1.Cms.AttributeTable signedAttrTable = this.SignedAttributes; + if (signedAttrTable != null + && signedAttrTable.GetAll(CmsAttributes.CounterSignature).Count > 0) + { + throw new CmsException("A countersignature attribute MUST NOT be a signed attribute"); + } + + Asn1.Cms.AttributeTable unsignedAttrTable = this.UnsignedAttributes; + if (unsignedAttrTable != null) + { + foreach (Asn1.Cms.Attribute csAttr in unsignedAttrTable.GetAll(CmsAttributes.CounterSignature)) + { + if (csAttr.AttrValues.Count < 1) + throw new CmsException("A countersignature attribute MUST contain at least one AttributeValue"); + + // Note: We don't recursively validate the countersignature value + } + } + } + + try + { + sig.Init(false, key); + + if (signedAttributeSet == null) + { + if (digestCalculator != null) + { + // need to decrypt signature and check message bytes + return VerifyDigest(resultDigest, key, this.GetSignature()); + } + else if (content != null) + { + try + { + // TODO Use raw signature of the hash value instead + content.Write(new SignerSink(sig)); + } + catch (SignatureException e) + { + throw new CmsStreamException("signature problem: " + e); + } + } + } + else + { + byte[] tmp = this.GetEncodedSignedAttributes(); + sig.BlockUpdate(tmp, 0, tmp.Length); + } + + return sig.VerifySignature(this.GetSignature()); + } + catch (InvalidKeyException e) + { + throw new CmsException("key not appropriate to signature in message.", e); + } + catch (IOException e) + { + throw new CmsException("can't process mime object to create signature.", e); + } + catch (SignatureException e) + { + throw new CmsException("invalid signature format in message: " + e.Message, e); + } + } + + private bool IsNull( + Asn1Encodable o) + { + return (o is Asn1Null) || (o == null); + } + + private DigestInfo DerDecode( + byte[] encoding) + { + if (encoding[0] != (int)(Asn1Tags.Constructed | Asn1Tags.Sequence)) + { + throw new IOException("not a digest info object"); + } + + DigestInfo digInfo = DigestInfo.GetInstance(Asn1Object.FromByteArray(encoding)); + + // length check to avoid Bleichenbacher vulnerability + + if (digInfo.GetEncoded().Length != encoding.Length) + { + throw new CmsException("malformed RSA signature"); + } + + return digInfo; + } + + private bool VerifyDigest( + byte[] digest, + AsymmetricKeyParameter key, + byte[] signature) + { + string algorithm = Helper.GetEncryptionAlgName(this.EncryptionAlgOid); + + try + { + if (algorithm.Equals("RSA")) + { + IBufferedCipher c = CmsEnvelopedHelper.Instance.CreateAsymmetricCipher("RSA/ECB/PKCS1Padding"); + + c.Init(false, key); + + byte[] decrypt = c.DoFinal(signature); + + DigestInfo digInfo = DerDecode(decrypt); + + if (!digInfo.AlgorithmID.Algorithm.Equals(digestAlgorithm.Algorithm)) + { + return false; + } + + if (!IsNull(digInfo.AlgorithmID.Parameters)) + { + return false; + } + + byte[] sigHash = digInfo.GetDigest(); + + return Arrays.ConstantTimeAreEqual(digest, sigHash); + } + else if (algorithm.Equals("DSA")) + { + ISigner sig = SignerUtilities.GetSigner("NONEwithDSA"); + + sig.Init(false, key); + + sig.BlockUpdate(digest, 0, digest.Length); + + return sig.VerifySignature(signature); + } + else + { + throw new CmsException("algorithm: " + algorithm + " not supported in base signatures."); + } + } + catch (SecurityUtilityException e) + { + throw e; + } + catch (GeneralSecurityException e) + { + throw new CmsException("Exception processing signature: " + e, e); + } + catch (IOException e) + { + throw new CmsException("Exception decoding signature: " + e, e); + } + } + + /** + * verify that the given public key successfully handles and confirms the + * signature associated with this signer. + */ + public bool Verify( + AsymmetricKeyParameter pubKey) + { + if (pubKey.IsPrivate) + throw new ArgumentException("Expected public key", "pubKey"); + + // Optional, but still need to validate if present + GetSigningTime(); + + return DoVerify(pubKey); + } + + /** + * verify that the given certificate successfully handles and confirms + * the signature associated with this signer and, if a signingTime + * attribute is available, that the certificate was valid at the time the + * signature was generated. + */ + public bool Verify( + X509Certificate cert) + { + Asn1.Cms.Time signingTime = GetSigningTime(); + if (signingTime != null) + { + cert.CheckValidity(signingTime.Date); + } + + return DoVerify(cert.GetPublicKey()); + } + + /** + * Return the base ASN.1 CMS structure that this object contains. + * + * @return an object containing a CMS SignerInfo structure. + */ + public SignerInfo ToSignerInfo() + { + return info; + } + + private Asn1Object GetSingleValuedSignedAttribute( + DerObjectIdentifier attrOID, string printableName) + { + + Asn1.Cms.AttributeTable unsignedAttrTable = this.UnsignedAttributes; + if (unsignedAttrTable != null + && unsignedAttrTable.GetAll(attrOID).Count > 0) + { + throw new CmsException("The " + printableName + + " attribute MUST NOT be an unsigned attribute"); + } + + Asn1.Cms.AttributeTable signedAttrTable = this.SignedAttributes; + if (signedAttrTable == null) + { + return null; + } + + Asn1EncodableVector v = signedAttrTable.GetAll(attrOID); + switch (v.Count) + { + case 0: + return null; + case 1: + Asn1.Cms.Attribute t = (Asn1.Cms.Attribute) v[0]; + Asn1Set attrValues = t.AttrValues; + + if (attrValues.Count != 1) + throw new CmsException("A " + printableName + + " attribute MUST have a single attribute value"); + + return attrValues[0].ToAsn1Object(); + default: + throw new CmsException("The SignedAttributes in a signerInfo MUST NOT include multiple instances of the " + + printableName + " attribute"); + } + } + + private Asn1.Cms.Time GetSigningTime() + { + Asn1Object validSigningTime = GetSingleValuedSignedAttribute( + CmsAttributes.SigningTime, "signing-time"); + + if (validSigningTime == null) + return null; + + try + { + return Asn1.Cms.Time.GetInstance(validSigningTime); + } + catch (ArgumentException) + { + throw new CmsException("signing-time attribute value not a valid 'Time' structure"); + } + } + + /** + * Return a signer information object with the passed in unsigned + * attributes replacing the ones that are current associated with + * the object passed in. + * + * @param signerInformation the signerInfo to be used as the basis. + * @param unsignedAttributes the unsigned attributes to add. + * @return a copy of the original SignerInformationObject with the changed attributes. + */ + public static SignerInformation ReplaceUnsignedAttributes( + SignerInformation signerInformation, + Asn1.Cms.AttributeTable unsignedAttributes) + { + SignerInfo sInfo = signerInformation.info; + Asn1Set unsignedAttr = null; + + if (unsignedAttributes != null) + { + unsignedAttr = new DerSet(unsignedAttributes.ToAsn1EncodableVector()); + } + + return new SignerInformation( + new SignerInfo( + sInfo.SignerID, + sInfo.DigestAlgorithm, + sInfo.AuthenticatedAttributes, + sInfo.DigestEncryptionAlgorithm, + sInfo.EncryptedDigest, + unsignedAttr), + signerInformation.contentType, + signerInformation.content, + null); + } + + /** + * Return a signer information object with passed in SignerInformationStore representing counter + * signatures attached as an unsigned attribute. + * + * @param signerInformation the signerInfo to be used as the basis. + * @param counterSigners signer info objects carrying counter signature. + * @return a copy of the original SignerInformationObject with the changed attributes. + */ + public static SignerInformation AddCounterSigners( + SignerInformation signerInformation, + SignerInformationStore counterSigners) + { + // TODO Perform checks from RFC 3852 11.4 + + SignerInfo sInfo = signerInformation.info; + Asn1.Cms.AttributeTable unsignedAttr = signerInformation.UnsignedAttributes; + Asn1EncodableVector v; + + if (unsignedAttr != null) + { + v = unsignedAttr.ToAsn1EncodableVector(); + } + else + { + v = new Asn1EncodableVector(); + } + + Asn1EncodableVector sigs = new Asn1EncodableVector(); + + foreach (SignerInformation sigInf in counterSigners.GetSigners()) + { + sigs.Add(sigInf.ToSignerInfo()); + } + + v.Add(new Asn1.Cms.Attribute(CmsAttributes.CounterSignature, new DerSet(sigs))); + + return new SignerInformation( + new SignerInfo( + sInfo.SignerID, + sInfo.DigestAlgorithm, + sInfo.AuthenticatedAttributes, + sInfo.DigestEncryptionAlgorithm, + sInfo.EncryptedDigest, + new DerSet(v)), + signerInformation.contentType, + signerInformation.content, + null); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformation.cs.meta new file mode 100644 index 00000000..c3002560 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformation.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfd117ab49ca573488f189430fec731e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformationStore.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformationStore.cs new file mode 100644 index 00000000..6e45fb67 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformationStore.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + public class SignerInformationStore + { + private readonly IList all; //ArrayList[SignerInformation] + private readonly IDictionary table = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); // Hashtable[SignerID, ArrayList[SignerInformation]] + + /** + * Create a store containing a single SignerInformation object. + * + * @param signerInfo the signer information to contain. + */ + public SignerInformationStore( + SignerInformation signerInfo) + { + this.all = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(1); + this.all.Add(signerInfo); + + SignerID sid = signerInfo.SignerID; + + table[sid] = all; + } + + /** + * Create a store containing a collection of SignerInformation objects. + * + * @param signerInfos a collection signer information objects to contain. + */ + public SignerInformationStore( + ICollection signerInfos) + { + foreach (SignerInformation signer in signerInfos) + { + SignerID sid = signer.SignerID; + IList list = (IList)table[sid]; + + if (list == null) + { + table[sid] = list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(1); + } + + list.Add(signer); + } + + this.all = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(signerInfos); + } + + /** + * Return the first SignerInformation object that matches the + * passed in selector. Null if there are no matches. + * + * @param selector to identify a signer + * @return a single SignerInformation object. Null if none matches. + */ + public SignerInformation GetFirstSigner( + SignerID selector) + { + IList list = (IList) table[selector]; + + return list == null ? null : (SignerInformation) list[0]; + } + + /// The number of signers in the collection. + public int Count + { + get { return all.Count; } + } + + /// An ICollection of all signers in the collection + public ICollection GetSigners() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(all); + } + + /** + * Return possible empty collection with signers matching the passed in SignerID + * + * @param selector a signer id to select against. + * @return a collection of SignerInformation objects. + */ + public ICollection GetSigners( + SignerID selector) + { + IList list = (IList) table[selector]; + + return list == null ? BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList() : BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(list); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformationStore.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformationStore.cs.meta new file mode 100644 index 00000000..5f2fd7a0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SignerInformationStore.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7833ac1bdca67e48b219183aab7cebe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SimpleAttributeTableGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SimpleAttributeTableGenerator.cs new file mode 100644 index 00000000..8d846ac6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SimpleAttributeTableGenerator.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Cms +{ + /** + * Basic generator that just returns a preconstructed attribute table + */ + public class SimpleAttributeTableGenerator + : CmsAttributeTableGenerator + { + private readonly AttributeTable attributes; + + public SimpleAttributeTableGenerator( + AttributeTable attributes) + { + this.attributes = attributes; + } + + public virtual AttributeTable GetAttributes( + IDictionary parameters) + { + return attributes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SimpleAttributeTableGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SimpleAttributeTableGenerator.cs.meta new file mode 100644 index 00000000..1501fae4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/cms/SimpleAttributeTableGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 373dc7b36a67c43448524ed163119b9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto.meta new file mode 100644 index 00000000..beffab3b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 65f5702f015c2304e9152f0d0a52eb2f +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricCipherKeyPair.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricCipherKeyPair.cs new file mode 100644 index 00000000..6c2b79d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricCipherKeyPair.cs @@ -0,0 +1,56 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * a holding class for public/private parameter pairs. + */ + public class AsymmetricCipherKeyPair + { + private readonly AsymmetricKeyParameter publicParameter; + private readonly AsymmetricKeyParameter privateParameter; + + /** + * basic constructor. + * + * @param publicParam a public key parameters object. + * @param privateParam the corresponding private key parameters. + */ + public AsymmetricCipherKeyPair( + AsymmetricKeyParameter publicParameter, + AsymmetricKeyParameter privateParameter) + { + if (publicParameter.IsPrivate) + throw new ArgumentException("Expected a public key", "publicParameter"); + if (!privateParameter.IsPrivate) + throw new ArgumentException("Expected a private key", "privateParameter"); + + this.publicParameter = publicParameter; + this.privateParameter = privateParameter; + } + + /** + * return the public key parameters. + * + * @return the public key parameters. + */ + public AsymmetricKeyParameter Public + { + get { return publicParameter; } + } + + /** + * return the private key parameters. + * + * @return the private key parameters. + */ + public AsymmetricKeyParameter Private + { + get { return privateParameter; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricCipherKeyPair.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricCipherKeyPair.cs.meta new file mode 100644 index 00000000..6028e8c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricCipherKeyPair.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eef9b100979b64f49a4f37506e85cbea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricKeyParameter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricKeyParameter.cs new file mode 100644 index 00000000..b5313dd3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricKeyParameter.cs @@ -0,0 +1,51 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + public abstract class AsymmetricKeyParameter + : ICipherParameters + { + private readonly bool privateKey; + + protected AsymmetricKeyParameter( + bool privateKey) + { + this.privateKey = privateKey; + } + + public bool IsPrivate + { + get { return privateKey; } + } + + public override bool Equals( + object obj) + { + AsymmetricKeyParameter other = obj as AsymmetricKeyParameter; + + if (other == null) + { + return false; + } + + return Equals(other); + } + + protected bool Equals( + AsymmetricKeyParameter other) + { + return privateKey == other.privateKey; + } + + public override int GetHashCode() + { + return privateKey.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricKeyParameter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricKeyParameter.cs.meta new file mode 100644 index 00000000..f05ee328 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/AsymmetricKeyParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a345564cb9c4fb64eb3b18227bc3bc11 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAeadBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAeadBlockCipher.cs new file mode 100644 index 00000000..8488bae5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAeadBlockCipher.cs @@ -0,0 +1,251 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * The AEAD block ciphers already handle buffering internally, so this class + * just takes care of implementing IBufferedCipher methods. + */ + public class BufferedAeadBlockCipher + : BufferedCipherBase + { + private readonly IAeadBlockCipher cipher; + + public BufferedAeadBlockCipher( + IAeadBlockCipher cipher) + { + if (cipher == null) + throw new ArgumentNullException("cipher"); + + this.cipher = cipher; + } + + public override string AlgorithmName + { + get { return cipher.AlgorithmName; } + } + + /** + * initialise the cipher. + * + * @param forEncryption if true the cipher is initialised for + * encryption, if false for decryption. + * @param param the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public override void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (parameters is ParametersWithRandom) + { + parameters = ((ParametersWithRandom) parameters).Parameters; + } + + cipher.Init(forEncryption, parameters); + } + + /** + * return the blocksize for the underlying cipher. + * + * @return the blocksize for the underlying cipher. + */ + public override int GetBlockSize() + { + return cipher.GetBlockSize(); + } + + /** + * return the size of the output buffer required for an update + * an input of len bytes. + * + * @param len the length of the input. + * @return the space required to accommodate a call to update + * with len bytes of input. + */ + public override int GetUpdateOutputSize( + int length) + { + return cipher.GetUpdateOutputSize(length); + } + + /** + * return the size of the output buffer required for an update plus a + * doFinal with an input of len bytes. + * + * @param len the length of the input. + * @return the space required to accommodate a call to update and doFinal + * with len bytes of input. + */ + public override int GetOutputSize( + int length) + { + return cipher.GetOutputSize(length); + } + + /** + * process a single byte, producing an output block if necessary. + * + * @param in the input byte. + * @param out the space for any output that might be produced. + * @param outOff the offset from which the output will be copied. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there isn't enough space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + */ + public override int ProcessByte( + byte input, + byte[] output, + int outOff) + { + return cipher.ProcessByte(input, output, outOff); + } + + public override byte[] ProcessByte( + byte input) + { + int outLength = GetUpdateOutputSize(1); + + byte[] outBytes = outLength > 0 ? new byte[outLength] : null; + + int pos = ProcessByte(input, outBytes, 0); + + if (outLength > 0 && pos < outLength) + { + byte[] tmp = new byte[pos]; + Array.Copy(outBytes, 0, tmp, 0, pos); + outBytes = tmp; + } + + return outBytes; + } + + public override byte[] ProcessBytes( + byte[] input, + int inOff, + int length) + { + if (input == null) + throw new ArgumentNullException("input"); + if (length < 1) + return null; + + int outLength = GetUpdateOutputSize(length); + + byte[] outBytes = outLength > 0 ? new byte[outLength] : null; + + int pos = ProcessBytes(input, inOff, length, outBytes, 0); + + if (outLength > 0 && pos < outLength) + { + byte[] tmp = new byte[pos]; + Array.Copy(outBytes, 0, tmp, 0, pos); + outBytes = tmp; + } + + return outBytes; + } + + /** + * process an array of bytes, producing output if necessary. + * + * @param in the input byte array. + * @param inOff the offset at which the input data starts. + * @param len the number of bytes to be copied out of the input array. + * @param out the space for any output that might be produced. + * @param outOff the offset from which the output will be copied. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there isn't enough space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + */ + public override int ProcessBytes( + byte[] input, + int inOff, + int length, + byte[] output, + int outOff) + { + return cipher.ProcessBytes(input, inOff, length, output, outOff); + } + + public override byte[] DoFinal() + { + byte[] outBytes = new byte[GetOutputSize(0)]; + + int pos = DoFinal(outBytes, 0); + + if (pos < outBytes.Length) + { + byte[] tmp = new byte[pos]; + Array.Copy(outBytes, 0, tmp, 0, pos); + outBytes = tmp; + } + + return outBytes; + } + + public override byte[] DoFinal( + byte[] input, + int inOff, + int inLen) + { + if (input == null) + throw new ArgumentNullException("input"); + + byte[] outBytes = new byte[GetOutputSize(inLen)]; + + int pos = (inLen > 0) + ? ProcessBytes(input, inOff, inLen, outBytes, 0) + : 0; + + pos += DoFinal(outBytes, pos); + + if (pos < outBytes.Length) + { + byte[] tmp = new byte[pos]; + Array.Copy(outBytes, 0, tmp, 0, pos); + outBytes = tmp; + } + + return outBytes; + } + + /** + * Process the last block in the buffer. + * + * @param out the array the block currently being held is copied into. + * @param outOff the offset at which the copying starts. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there is insufficient space in out for + * the output, or the input is not block size aligned and should be. + * @exception InvalidOperationException if the underlying cipher is not + * initialised. + * @exception InvalidCipherTextException if padding is expected and not found. + * @exception DataLengthException if the input is not block size + * aligned. + */ + public override int DoFinal( + byte[] output, + int outOff) + { + return cipher.DoFinal(output, outOff); + } + + /** + * Reset the buffer and cipher. After resetting the object is in the same + * state as it was after the last init (if there was one). + */ + public override void Reset() + { + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAeadBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAeadBlockCipher.cs.meta new file mode 100644 index 00000000..faf3ebcb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAeadBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7341cef11d2e8f24e844590b6747bf16 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAsymmetricBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAsymmetricBlockCipher.cs new file mode 100644 index 00000000..1ea38863 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAsymmetricBlockCipher.cs @@ -0,0 +1,156 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * a buffer wrapper for an asymmetric block cipher, allowing input + * to be accumulated in a piecemeal fashion until final processing. + */ + public class BufferedAsymmetricBlockCipher + : BufferedCipherBase + { + private readonly IAsymmetricBlockCipher cipher; + + private byte[] buffer; + private int bufOff; + + /** + * base constructor. + * + * @param cipher the cipher this buffering object wraps. + */ + public BufferedAsymmetricBlockCipher( + IAsymmetricBlockCipher cipher) + { + this.cipher = cipher; + } + + /** + * return the amount of data sitting in the buffer. + * + * @return the amount of data sitting in the buffer. + */ + internal int GetBufferPosition() + { + return bufOff; + } + + public override string AlgorithmName + { + get { return cipher.AlgorithmName; } + } + + public override int GetBlockSize() + { + return cipher.GetInputBlockSize(); + } + + public override int GetOutputSize( + int length) + { + return cipher.GetOutputBlockSize(); + } + + public override int GetUpdateOutputSize( + int length) + { + return 0; + } + + /** + * initialise the buffer and the underlying cipher. + * + * @param forEncryption if true the cipher is initialised for + * encryption, if false for decryption. + * @param param the key and other data required by the cipher. + */ + public override void Init( + bool forEncryption, + ICipherParameters parameters) + { + Reset(); + + cipher.Init(forEncryption, parameters); + + // + // we allow for an extra byte where people are using their own padding + // mechanisms on a raw cipher. + // + this.buffer = new byte[cipher.GetInputBlockSize() + (forEncryption ? 1 : 0)]; + this.bufOff = 0; + } + + public override byte[] ProcessByte( + byte input) + { + if (bufOff >= buffer.Length) + throw new DataLengthException("attempt to process message to long for cipher"); + + buffer[bufOff++] = input; + return null; + } + + public override byte[] ProcessBytes( + byte[] input, + int inOff, + int length) + { + if (length < 1) + return null; + + if (input == null) + throw new ArgumentNullException("input"); + if (bufOff + length > buffer.Length) + throw new DataLengthException("attempt to process message to long for cipher"); + + Array.Copy(input, inOff, buffer, bufOff, length); + bufOff += length; + return null; + } + + /** + * process the contents of the buffer using the underlying + * cipher. + * + * @return the result of the encryption/decryption process on the + * buffer. + * @exception InvalidCipherTextException if we are given a garbage block. + */ + public override byte[] DoFinal() + { + byte[] outBytes = bufOff > 0 + ? cipher.ProcessBlock(buffer, 0, bufOff) + : EmptyBuffer; + + Reset(); + + return outBytes; + } + + public override byte[] DoFinal( + byte[] input, + int inOff, + int length) + { + ProcessBytes(input, inOff, length); + return DoFinal(); + } + + /// Reset the buffer + public override void Reset() + { + if (buffer != null) + { + Array.Clear(buffer, 0, buffer.Length); + bufOff = 0; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAsymmetricBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAsymmetricBlockCipher.cs.meta new file mode 100644 index 00000000..eac7104d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedAsymmetricBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f143b86b595928a4ba2e043ae553d1ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedBlockCipher.cs new file mode 100644 index 00000000..fcf48d29 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedBlockCipher.cs @@ -0,0 +1,371 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * A wrapper class that allows block ciphers to be used to process data in + * a piecemeal fashion. The BufferedBlockCipher outputs a block only when the + * buffer is full and more data is being added, or on a doFinal. + *

+ * Note: in the case where the underlying cipher is either a CFB cipher or an + * OFB one the last block may not be a multiple of the block size. + *

+ */ + public class BufferedBlockCipher + : BufferedCipherBase + { + internal byte[] buf; + internal int bufOff; + internal bool forEncryption; + internal IBlockCipher cipher; + + /** + * constructor for subclasses + */ + protected BufferedBlockCipher() + { + } + + /** + * Create a buffered block cipher without padding. + * + * @param cipher the underlying block cipher this buffering object wraps. + * false otherwise. + */ + public BufferedBlockCipher( + IBlockCipher cipher) + { + if (cipher == null) + throw new ArgumentNullException("cipher"); + + this.cipher = cipher; + buf = new byte[cipher.GetBlockSize()]; + bufOff = 0; + } + + public override string AlgorithmName + { + get { return cipher.AlgorithmName; } + } + + /** + * initialise the cipher. + * + * @param forEncryption if true the cipher is initialised for + * encryption, if false for decryption. + * @param param the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + // Note: This doubles as the Init in the event that this cipher is being used as an IWrapper + public override void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.forEncryption = forEncryption; + + ParametersWithRandom pwr = parameters as ParametersWithRandom; + if (pwr != null) + parameters = pwr.Parameters; + + Reset(); + + cipher.Init(forEncryption, parameters); + } + + /** + * return the blocksize for the underlying cipher. + * + * @return the blocksize for the underlying cipher. + */ + public override int GetBlockSize() + { + return cipher.GetBlockSize(); + } + + /** + * return the size of the output buffer required for an update + * an input of len bytes. + * + * @param len the length of the input. + * @return the space required to accommodate a call to update + * with len bytes of input. + */ + public override int GetUpdateOutputSize( + int length) + { + int total = length + bufOff; + int leftOver = total % buf.Length; + return total - leftOver; + } + + /** + * return the size of the output buffer required for an update plus a + * doFinal with an input of len bytes. + * + * @param len the length of the input. + * @return the space required to accommodate a call to update and doFinal + * with len bytes of input. + */ + public override int GetOutputSize( + int length) + { + // Note: Can assume IsPartialBlockOkay is true for purposes of this calculation + return length + bufOff; + } + + /** + * process a single byte, producing an output block if necessary. + * + * @param in the input byte. + * @param out the space for any output that might be produced. + * @param outOff the offset from which the output will be copied. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there isn't enough space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + */ + public override int ProcessByte( + byte input, + byte[] output, + int outOff) + { + buf[bufOff++] = input; + + if (bufOff == buf.Length) + { + if ((outOff + buf.Length) > output.Length) + throw new DataLengthException("output buffer too short"); + + bufOff = 0; + return cipher.ProcessBlock(buf, 0, output, outOff); + } + + return 0; + } + + public override byte[] ProcessByte( + byte input) + { + int outLength = GetUpdateOutputSize(1); + + byte[] outBytes = outLength > 0 ? new byte[outLength] : null; + + int pos = ProcessByte(input, outBytes, 0); + + if (outLength > 0 && pos < outLength) + { + byte[] tmp = new byte[pos]; + Array.Copy(outBytes, 0, tmp, 0, pos); + outBytes = tmp; + } + + return outBytes; + } + + public override byte[] ProcessBytes( + byte[] input, + int inOff, + int length) + { + if (input == null) + throw new ArgumentNullException("input"); + if (length < 1) + return null; + + int outLength = GetUpdateOutputSize(length); + + byte[] outBytes = outLength > 0 ? new byte[outLength] : null; + + int pos = ProcessBytes(input, inOff, length, outBytes, 0); + + if (outLength > 0 && pos < outLength) + { + byte[] tmp = new byte[pos]; + Array.Copy(outBytes, 0, tmp, 0, pos); + outBytes = tmp; + } + + return outBytes; + } + + /** + * process an array of bytes, producing output if necessary. + * + * @param in the input byte array. + * @param inOff the offset at which the input data starts. + * @param len the number of bytes to be copied out of the input array. + * @param out the space for any output that might be produced. + * @param outOff the offset from which the output will be copied. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there isn't enough space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + */ + public override int ProcessBytes( + byte[] input, + int inOff, + int length, + byte[] output, + int outOff) + { + if (length < 1) + { + if (length < 0) + throw new ArgumentException("Can't have a negative input length!"); + + return 0; + } + + int blockSize = GetBlockSize(); + int outLength = GetUpdateOutputSize(length); + + if (outLength > 0) + { + Check.OutputLength(output, outOff, outLength, "output buffer too short"); + } + + int resultLen = 0; + int gapLen = buf.Length - bufOff; + if (length > gapLen) + { + Array.Copy(input, inOff, buf, bufOff, gapLen); + resultLen += cipher.ProcessBlock(buf, 0, output, outOff); + bufOff = 0; + length -= gapLen; + inOff += gapLen; + while (length > buf.Length) + { + resultLen += cipher.ProcessBlock(input, inOff, output, outOff + resultLen); + length -= blockSize; + inOff += blockSize; + } + } + Array.Copy(input, inOff, buf, bufOff, length); + bufOff += length; + if (bufOff == buf.Length) + { + resultLen += cipher.ProcessBlock(buf, 0, output, outOff + resultLen); + bufOff = 0; + } + return resultLen; + } + + public override byte[] DoFinal() + { + byte[] outBytes = EmptyBuffer; + + int length = GetOutputSize(0); + if (length > 0) + { + outBytes = new byte[length]; + + int pos = DoFinal(outBytes, 0); + if (pos < outBytes.Length) + { + byte[] tmp = new byte[pos]; + Array.Copy(outBytes, 0, tmp, 0, pos); + outBytes = tmp; + } + } + else + { + Reset(); + } + + return outBytes; + } + + public override byte[] DoFinal( + byte[] input, + int inOff, + int inLen) + { + if (input == null) + throw new ArgumentNullException("input"); + + int length = GetOutputSize(inLen); + + byte[] outBytes = EmptyBuffer; + + if (length > 0) + { + outBytes = new byte[length]; + + int pos = (inLen > 0) + ? ProcessBytes(input, inOff, inLen, outBytes, 0) + : 0; + + pos += DoFinal(outBytes, pos); + + if (pos < outBytes.Length) + { + byte[] tmp = new byte[pos]; + Array.Copy(outBytes, 0, tmp, 0, pos); + outBytes = tmp; + } + } + else + { + Reset(); + } + + return outBytes; + } + + /** + * Process the last block in the buffer. + * + * @param out the array the block currently being held is copied into. + * @param outOff the offset at which the copying starts. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there is insufficient space in out for + * the output, or the input is not block size aligned and should be. + * @exception InvalidOperationException if the underlying cipher is not + * initialised. + * @exception InvalidCipherTextException if padding is expected and not found. + * @exception DataLengthException if the input is not block size + * aligned. + */ + public override int DoFinal( + byte[] output, + int outOff) + { + try + { + if (bufOff != 0) + { + Check.DataLength(!cipher.IsPartialBlockOkay, "data not block size aligned"); + Check.OutputLength(output, outOff, bufOff, "output buffer too short for DoFinal()"); + + // NB: Can't copy directly, or we may write too much output + cipher.ProcessBlock(buf, 0, buf, 0); + Array.Copy(buf, 0, output, outOff, bufOff); + } + + return bufOff; + } + finally + { + Reset(); + } + } + + /** + * Reset the buffer and cipher. After resetting the object is in the same + * state as it was after the last init (if there was one). + */ + public override void Reset() + { + Array.Clear(buf, 0, buf.Length); + bufOff = 0; + + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedBlockCipher.cs.meta new file mode 100644 index 00000000..0ed241ac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e161ee652f7d84c49abc183b5ef37846 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedCipherBase.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedCipherBase.cs new file mode 100644 index 00000000..7476ab40 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedCipherBase.cs @@ -0,0 +1,117 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + public abstract class BufferedCipherBase + : IBufferedCipher + { + protected static readonly byte[] EmptyBuffer = new byte[0]; + + public abstract string AlgorithmName { get; } + + public abstract void Init(bool forEncryption, ICipherParameters parameters); + + public abstract int GetBlockSize(); + + public abstract int GetOutputSize(int inputLen); + public abstract int GetUpdateOutputSize(int inputLen); + + public abstract byte[] ProcessByte(byte input); + + public virtual int ProcessByte( + byte input, + byte[] output, + int outOff) + { + byte[] outBytes = ProcessByte(input); + if (outBytes == null) + return 0; + if (outOff + outBytes.Length > output.Length) + throw new DataLengthException("output buffer too short"); + outBytes.CopyTo(output, outOff); + return outBytes.Length; + } + + public virtual byte[] ProcessBytes( + byte[] input) + { + return ProcessBytes(input, 0, input.Length); + } + + public abstract byte[] ProcessBytes(byte[] input, int inOff, int length); + + public virtual int ProcessBytes( + byte[] input, + byte[] output, + int outOff) + { + return ProcessBytes(input, 0, input.Length, output, outOff); + } + + public virtual int ProcessBytes( + byte[] input, + int inOff, + int length, + byte[] output, + int outOff) + { + byte[] outBytes = ProcessBytes(input, inOff, length); + if (outBytes == null) + return 0; + if (outOff + outBytes.Length > output.Length) + throw new DataLengthException("output buffer too short"); + outBytes.CopyTo(output, outOff); + return outBytes.Length; + } + + public abstract byte[] DoFinal(); + + public virtual byte[] DoFinal( + byte[] input) + { + return DoFinal(input, 0, input.Length); + } + + public abstract byte[] DoFinal( + byte[] input, + int inOff, + int length); + + public virtual int DoFinal( + byte[] output, + int outOff) + { + byte[] outBytes = DoFinal(); + if (outOff + outBytes.Length > output.Length) + throw new DataLengthException("output buffer too short"); + outBytes.CopyTo(output, outOff); + return outBytes.Length; + } + + public virtual int DoFinal( + byte[] input, + byte[] output, + int outOff) + { + return DoFinal(input, 0, input.Length, output, outOff); + } + + public virtual int DoFinal( + byte[] input, + int inOff, + int length, + byte[] output, + int outOff) + { + int len = ProcessBytes(input, inOff, length, output, outOff); + len += DoFinal(output, outOff + len); + return len; + } + + public abstract void Reset(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedCipherBase.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedCipherBase.cs.meta new file mode 100644 index 00000000..b1ea27b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedCipherBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c014e96623bd48488c402407e71df96 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedIesCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedIesCipher.cs new file mode 100644 index 00000000..855841a8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedIesCipher.cs @@ -0,0 +1,117 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + public class BufferedIesCipher + : BufferedCipherBase + { + private readonly IesEngine engine; + private bool forEncryption; + private MemoryStream buffer = new MemoryStream(); + + public BufferedIesCipher( + IesEngine engine) + { + if (engine == null) + throw new ArgumentNullException("engine"); + + this.engine = engine; + } + + public override string AlgorithmName + { + // TODO Create IESEngine.AlgorithmName + get { return "IES"; } + } + + public override void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.forEncryption = forEncryption; + + // TODO + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("IES"); + } + + public override int GetBlockSize() + { + return 0; + } + + public override int GetOutputSize( + int inputLen) + { + if (engine == null) + throw new InvalidOperationException("cipher not initialised"); + + int baseLen = inputLen + (int) buffer.Length; + return forEncryption + ? baseLen + 20 + : baseLen - 20; + } + + public override int GetUpdateOutputSize( + int inputLen) + { + return 0; + } + + public override byte[] ProcessByte( + byte input) + { + buffer.WriteByte(input); + return null; + } + + public override byte[] ProcessBytes( + byte[] input, + int inOff, + int length) + { + if (input == null) + throw new ArgumentNullException("input"); + if (inOff < 0) + throw new ArgumentException("inOff"); + if (length < 0) + throw new ArgumentException("length"); + if (inOff + length > input.Length) + throw new ArgumentException("invalid offset/length specified for input array"); + + buffer.Write(input, inOff, length); + return null; + } + + public override byte[] DoFinal() + { + byte[] buf = buffer.ToArray(); + + Reset(); + + return engine.ProcessBlock(buf, 0, buf.Length); + } + + public override byte[] DoFinal( + byte[] input, + int inOff, + int length) + { + ProcessBytes(input, inOff, length); + return DoFinal(); + } + + public override void Reset() + { + buffer.SetLength(0); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedIesCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedIesCipher.cs.meta new file mode 100644 index 00000000..0951783f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedIesCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b73c34a06bcbdb3449c9b9221fc8a9c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedStreamCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedStreamCipher.cs new file mode 100644 index 00000000..20bc603d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedStreamCipher.cs @@ -0,0 +1,135 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + public class BufferedStreamCipher + : BufferedCipherBase + { + private readonly IStreamCipher cipher; + + public BufferedStreamCipher( + IStreamCipher cipher) + { + if (cipher == null) + throw new ArgumentNullException("cipher"); + + this.cipher = cipher; + } + + public override string AlgorithmName + { + get { return cipher.AlgorithmName; } + } + + public override void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (parameters is ParametersWithRandom) + { + parameters = ((ParametersWithRandom) parameters).Parameters; + } + + cipher.Init(forEncryption, parameters); + } + + public override int GetBlockSize() + { + return 0; + } + + public override int GetOutputSize( + int inputLen) + { + return inputLen; + } + + public override int GetUpdateOutputSize( + int inputLen) + { + return inputLen; + } + + public override byte[] ProcessByte( + byte input) + { + return new byte[]{ cipher.ReturnByte(input) }; + } + + public override int ProcessByte( + byte input, + byte[] output, + int outOff) + { + if (outOff >= output.Length) + throw new DataLengthException("output buffer too short"); + + output[outOff] = cipher.ReturnByte(input); + return 1; + } + + public override byte[] ProcessBytes( + byte[] input, + int inOff, + int length) + { + if (length < 1) + return null; + + byte[] output = new byte[length]; + cipher.ProcessBytes(input, inOff, length, output, 0); + return output; + } + + public override int ProcessBytes( + byte[] input, + int inOff, + int length, + byte[] output, + int outOff) + { + if (length < 1) + return 0; + + if (length > 0) + { + cipher.ProcessBytes(input, inOff, length, output, outOff); + } + + return length; + } + + public override byte[] DoFinal() + { + Reset(); + + return EmptyBuffer; + } + + public override byte[] DoFinal( + byte[] input, + int inOff, + int length) + { + if (length < 1) + return EmptyBuffer; + + byte[] output = ProcessBytes(input, inOff, length); + + Reset(); + + return output; + } + + public override void Reset() + { + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedStreamCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedStreamCipher.cs.meta new file mode 100644 index 00000000..e0f41bc2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/BufferedStreamCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f552bd4118a37e46b3c3e8b94df1660 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/Check.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/Check.cs new file mode 100644 index 00000000..53024c1a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/Check.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + internal class Check + { + internal static void DataLength(bool condition, string msg) + { + if (condition) + throw new DataLengthException(msg); + } + + internal static void DataLength(byte[] buf, int off, int len, string msg) + { + if (off + len > buf.Length) + throw new DataLengthException(msg); + } + + internal static void OutputLength(byte[] buf, int off, int len, string msg) + { + if (off + len > buf.Length) + throw new OutputLengthException(msg); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/Check.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/Check.cs.meta new file mode 100644 index 00000000..30f8a3d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/Check.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6dd41045620467949adfc127f66c0e85 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CipherKeyGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CipherKeyGenerator.cs new file mode 100644 index 00000000..87e01e64 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CipherKeyGenerator.cs @@ -0,0 +1,87 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * The base class for symmetric, or secret, cipher key generators. + */ + public class CipherKeyGenerator + { + protected internal SecureRandom random; + protected internal int strength; + private bool uninitialised = true; + private int defaultStrength; + + public CipherKeyGenerator() + { + } + + internal CipherKeyGenerator( + int defaultStrength) + { + if (defaultStrength < 1) + throw new ArgumentException("strength must be a positive value", "defaultStrength"); + + this.defaultStrength = defaultStrength; + } + + public int DefaultStrength + { + get { return defaultStrength; } + } + + /** + * initialise the key generator. + * + * @param param the parameters to be used for key generation + */ + public void Init( + KeyGenerationParameters parameters) + { + if (parameters == null) + throw new ArgumentNullException("parameters"); + + this.uninitialised = false; + + engineInit(parameters); + } + + protected virtual void engineInit( + KeyGenerationParameters parameters) + { + this.random = parameters.Random; + this.strength = (parameters.Strength + 7) / 8; + } + + /** + * Generate a secret key. + * + * @return a byte array containing the key value. + */ + public byte[] GenerateKey() + { + if (uninitialised) + { + if (defaultStrength < 1) + throw new InvalidOperationException("Generator has not been initialised"); + + uninitialised = false; + + engineInit(new KeyGenerationParameters(new SecureRandom(), defaultStrength)); + } + + return engineGenerateKey(); + } + + protected virtual byte[] engineGenerateKey() + { + return SecureRandom.GetNextBytes(random, strength); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CipherKeyGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CipherKeyGenerator.cs.meta new file mode 100644 index 00000000..f465116f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CipherKeyGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 83b99673c89b7be4491f695d8e374d3c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CryptoException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CryptoException.cs new file mode 100644 index 00000000..96068045 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CryptoException.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CryptoException + : Exception + { + public CryptoException() + { + } + + public CryptoException( + string message) + : base(message) + { + } + + public CryptoException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CryptoException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CryptoException.cs.meta new file mode 100644 index 00000000..25a38b6e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/CryptoException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd38a0fa65d30fc4eae48fa3319f9645 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/DataLengthException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/DataLengthException.cs new file mode 100644 index 00000000..6fecb954 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/DataLengthException.cs @@ -0,0 +1,46 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * this exception is thrown if a buffer that is meant to have output + * copied into it turns out to be too short, or if we've been given + * insufficient input. In general this exception will Get thrown rather + * than an ArrayOutOfBounds exception. + */ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class DataLengthException + : CryptoException + { + /** + * base constructor. + */ + public DataLengthException() + { + } + + /** + * create a DataLengthException with the given message. + * + * @param message the message to be carried with the exception. + */ + public DataLengthException( + string message) + : base(message) + { + } + + public DataLengthException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/DataLengthException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/DataLengthException.cs.meta new file mode 100644 index 00000000..4fe44ff1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/DataLengthException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 34a508389e47f4745921ea8106b00645 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricBlockCipher.cs new file mode 100644 index 00000000..8fba447e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricBlockCipher.cs @@ -0,0 +1,34 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// Base interface for a public/private key block cipher. + public interface IAsymmetricBlockCipher + { + /// The name of the algorithm this cipher implements. + string AlgorithmName { get; } + + /// Initialise the cipher. + /// Initialise for encryption if true, for decryption if false. + /// The key or other data required by the cipher. + void Init(bool forEncryption, ICipherParameters parameters); + + /// The maximum size, in bytes, an input block may be. + int GetInputBlockSize(); + + /// The maximum size, in bytes, an output block will be. + int GetOutputBlockSize(); + + /// Process a block. + /// The input buffer. + /// The offset into inBuf that the input block begins. + /// The length of the input block. + /// Input decrypts improperly. + /// Input is too large for the cipher. + byte[] ProcessBlock(byte[] inBuf, int inOff, int inLen); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricBlockCipher.cs.meta new file mode 100644 index 00000000..88685e0a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6abbe02392e03f543a957ac413172bd3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricCipherKeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricCipherKeyPairGenerator.cs new file mode 100644 index 00000000..a67c7dc8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricCipherKeyPairGenerator.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * interface that a public/private key pair generator should conform to. + */ + public interface IAsymmetricCipherKeyPairGenerator + { + /** + * intialise the key pair generator. + * + * @param the parameters the key pair is to be initialised with. + */ + void Init(KeyGenerationParameters parameters); + + /** + * return an AsymmetricCipherKeyPair containing the Generated keys. + * + * @return an AsymmetricCipherKeyPair containing the Generated keys. + */ + AsymmetricCipherKeyPair GenerateKeyPair(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricCipherKeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricCipherKeyPairGenerator.cs.meta new file mode 100644 index 00000000..736a0567 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IAsymmetricCipherKeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: af1fbd88542b90240bb580ea2247b4cf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBasicAgreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBasicAgreement.cs new file mode 100644 index 00000000..e46733b8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBasicAgreement.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * The basic interface that basic Diffie-Hellman implementations + * conforms to. + */ + public interface IBasicAgreement + { + /** + * initialise the agreement engine. + */ + void Init(ICipherParameters parameters); + + /** + * return the field size for the agreement algorithm in bytes. + */ + int GetFieldSize(); + + /** + * given a public key from a given party calculate the next + * message in the agreement sequence. + */ + BigInteger CalculateAgreement(ICipherParameters pubKey); + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBasicAgreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBasicAgreement.cs.meta new file mode 100644 index 00000000..f248610b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBasicAgreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd9d504c0c209eb4ab0ba46c3f015a85 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockCipher.cs new file mode 100644 index 00000000..ca98a4a8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockCipher.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// Base interface for a symmetric key block cipher. + public interface IBlockCipher + { + /// The name of the algorithm this cipher implements. + string AlgorithmName { get; } + + /// Initialise the cipher. + /// Initialise for encryption if true, for decryption if false. + /// The key or other data required by the cipher. + void Init(bool forEncryption, ICipherParameters parameters); + + /// The block size for this cipher, in bytes. + int GetBlockSize(); + + /// Indicates whether this cipher can handle partial blocks. + bool IsPartialBlockOkay { get; } + + /// Process a block. + /// The input buffer. + /// The offset into inBuf that the input block begins. + /// The output buffer. + /// The offset into outBuf to write the output block. + /// If input block is wrong size, or outBuf too small. + /// The number of bytes processed and produced. + int ProcessBlock(byte[] inBuf, int inOff, byte[] outBuf, int outOff); + + /// + /// Reset the cipher to the same state as it was after the last init (if there was one). + /// + void Reset(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockCipher.cs.meta new file mode 100644 index 00000000..1fbd3c75 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4935d5699e88bf6459028d927973e8af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockResult.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockResult.cs new file mode 100644 index 00000000..d003e0e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockResult.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// Operators that reduce their input to a single block return an object + /// of this type. + /// + public interface IBlockResult + { + /// + /// Return the final result of the operation. + /// + /// A block of bytes, representing the result of an operation. + byte[] Collect(); + + /// + /// Store the final result of the operation by copying it into the destination array. + /// + /// The number of bytes copied into destination. + /// The byte array to copy the result into. + /// The offset into destination to start copying the result at. + int Collect(byte[] destination, int offset); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockResult.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockResult.cs.meta new file mode 100644 index 00000000..e6b803d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBlockResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ffde966c8f3b9c4282b23834e282a0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBufferedCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBufferedCipher.cs new file mode 100644 index 00000000..29d09e81 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBufferedCipher.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// Block cipher engines are expected to conform to this interface. + public interface IBufferedCipher + { + /// The name of the algorithm this cipher implements. + string AlgorithmName { get; } + + /// Initialise the cipher. + /// If true the cipher is initialised for encryption, + /// if false for decryption. + /// The key and other data required by the cipher. + void Init(bool forEncryption, ICipherParameters parameters); + + int GetBlockSize(); + + int GetOutputSize(int inputLen); + + int GetUpdateOutputSize(int inputLen); + + byte[] ProcessByte(byte input); + int ProcessByte(byte input, byte[] output, int outOff); + + byte[] ProcessBytes(byte[] input); + byte[] ProcessBytes(byte[] input, int inOff, int length); + int ProcessBytes(byte[] input, byte[] output, int outOff); + int ProcessBytes(byte[] input, int inOff, int length, byte[] output, int outOff); + + byte[] DoFinal(); + byte[] DoFinal(byte[] input); + byte[] DoFinal(byte[] input, int inOff, int length); + int DoFinal(byte[] output, int outOff); + int DoFinal(byte[] input, byte[] output, int outOff); + int DoFinal(byte[] input, int inOff, int length, byte[] output, int outOff); + + /// + /// Reset the cipher. After resetting the cipher is in the same state + /// as it was after the last init (if there was one). + /// + void Reset(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBufferedCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBufferedCipher.cs.meta new file mode 100644 index 00000000..34fb872b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IBufferedCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8a92034d413bfc40b6680d876d7f8b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ICipherParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ICipherParameters.cs new file mode 100644 index 00000000..7768de10 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ICipherParameters.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * all parameter classes implement this. + */ + public interface ICipherParameters + { + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ICipherParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ICipherParameters.cs.meta new file mode 100644 index 00000000..610be997 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ICipherParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48f7fda0d1eff294e9c36d8da4c5b237 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDSA.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDSA.cs new file mode 100644 index 00000000..7966c06d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDSA.cs @@ -0,0 +1,45 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * interface for classes implementing the Digital Signature Algorithm + */ + public interface IDsa + { + string AlgorithmName { get; } + + /** + * initialise the signer for signature generation or signature + * verification. + * + * @param forSigning true if we are generating a signature, false + * otherwise. + * @param param key parameters for signature generation. + */ + void Init(bool forSigning, ICipherParameters parameters); + + /** + * sign the passed in message (usually the output of a hash function). + * + * @param message the message to be signed. + * @return two big integers representing the r and s values respectively. + */ + BigInteger[] GenerateSignature(byte[] message); + + /** + * verify the message message against the signature values r and s. + * + * @param message the message that was supposed to have been signed. + * @param r the r signature value. + * @param s the s signature value. + */ + bool VerifySignature(byte[] message, BigInteger r, BigInteger s); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDSA.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDSA.cs.meta new file mode 100644 index 00000000..312883bb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDSA.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8cc954fc8fc070a45955c5a315ebc07a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationFunction.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationFunction.cs new file mode 100644 index 00000000..dda4764c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationFunction.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * base interface for general purpose byte derivation functions. + */ + public interface IDerivationFunction + { + void Init(IDerivationParameters parameters); + + /** + * return the message digest used as the basis for the function + */ + IDigest Digest + { + get; + } + + int GenerateBytes(byte[] output, int outOff, int length); + //throws DataLengthException, ArgumentException; + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationFunction.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationFunction.cs.meta new file mode 100644 index 00000000..10f91f5a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationFunction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4485e5cea1db5dc4ebed2d30a3bfa672 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationParameters.cs new file mode 100644 index 00000000..4d659639 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationParameters.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * Parameters for key/byte stream derivation classes + */ + public interface IDerivationParameters + { + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationParameters.cs.meta new file mode 100644 index 00000000..c1eee885 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDerivationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea9b134ee70b91b42b1ad2b5bf68204c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDigest.cs new file mode 100644 index 00000000..db4d58c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDigest.cs @@ -0,0 +1,65 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * interface that a message digest conforms to. + */ + public interface IDigest + { + /** + * return the algorithm name + * + * @return the algorithm name + */ + string AlgorithmName { get; } + + /** + * return the size, in bytes, of the digest produced by this message digest. + * + * @return the size, in bytes, of the digest produced by this message digest. + */ + int GetDigestSize(); + + /** + * return the size, in bytes, of the internal buffer used by this digest. + * + * @return the size, in bytes, of the internal buffer used by this digest. + */ + int GetByteLength(); + + /** + * update the message digest with a single byte. + * + * @param inByte the input byte to be entered. + */ + void Update(byte input); + + /** + * update the message digest with a block of bytes. + * + * @param input the byte array containing the data. + * @param inOff the offset into the byte array where the data starts. + * @param len the length of the data. + */ + void BlockUpdate(byte[] input, int inOff, int length); + + /** + * Close the digest, producing the final digest value. The doFinal + * call leaves the digest reset. + * + * @param output the array the digest is to be copied into. + * @param outOff the offset into the out array the digest is to start at. + */ + int DoFinal(byte[] output, int outOff); + + /** + * reset the digest back to it's initial state. + */ + void Reset(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDigest.cs.meta new file mode 100644 index 00000000..819ccdc8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 232948e340c96d0439b8c002b2ab0ec9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDsaExt.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDsaExt.cs new file mode 100644 index 00000000..01f936e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDsaExt.cs @@ -0,0 +1,21 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// An "extended" interface for classes implementing DSA-style algorithms, that provides access + /// to the group order. + /// + public interface IDsaExt + : IDsa + { + /// The order of the group that the r, s values in signatures belong to. + BigInteger Order { get; } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDsaExt.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDsaExt.cs.meta new file mode 100644 index 00000000..ff629af7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IDsaExt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9976406cf62ec74429d860be2fec2ec0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySource.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySource.cs new file mode 100644 index 00000000..cfe0f696 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySource.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// Base interface describing an entropy source for a DRBG. + /// + public interface IEntropySource + { + /// + /// Return whether or not this entropy source is regarded as prediction resistant. + /// + /// true if this instance is prediction resistant; otherwise, false. + bool IsPredictionResistant { get; } + + /// + /// Return a byte array of entropy. + /// + /// The entropy bytes. + byte[] GetEntropy(); + + /// + /// Return the number of bits of entropy this source can produce. + /// + /// The size, in bits, of the return value of getEntropy. + int EntropySize { get; } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySource.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySource.cs.meta new file mode 100644 index 00000000..26f3565d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b41ded217d64e9d4a88e5a4f45785906 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySourceProvider.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySourceProvider.cs new file mode 100644 index 00000000..f1e7c1bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySourceProvider.cs @@ -0,0 +1,21 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// Base interface describing a provider of entropy sources. + /// + public interface IEntropySourceProvider + { + /// + /// Return an entropy source providing a block of entropy. + /// + /// The size of the block of entropy required. + /// An entropy source providing bitsRequired blocks of entropy. + IEntropySource Get(int bitsRequired); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySourceProvider.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySourceProvider.cs.meta new file mode 100644 index 00000000..6c118104 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IEntropySourceProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4e94522d8beb6942a87bb520c8bcbe1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IMac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IMac.cs new file mode 100644 index 00000000..e4810e17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IMac.cs @@ -0,0 +1,73 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * The base interface for implementations of message authentication codes (MACs). + */ + public interface IMac + { + /** + * Initialise the MAC. + * + * @param param the key and other data required by the MAC. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + void Init(ICipherParameters parameters); + + /** + * Return the name of the algorithm the MAC implements. + * + * @return the name of the algorithm the MAC implements. + */ + string AlgorithmName { get; } + + /** + * Return the block size for this MAC (in bytes). + * + * @return the block size for this MAC in bytes. + */ + int GetMacSize(); + + /** + * add a single byte to the mac for processing. + * + * @param in the byte to be processed. + * @exception InvalidOperationException if the MAC is not initialised. + */ + void Update(byte input); + + /** + * @param in the array containing the input. + * @param inOff the index in the array the data begins at. + * @param len the length of the input starting at inOff. + * @exception InvalidOperationException if the MAC is not initialised. + * @exception DataLengthException if there isn't enough data in in. + */ + void BlockUpdate(byte[] input, int inOff, int len); + + /** + * Compute the final stage of the MAC writing the output to the out + * parameter. + *

+ * doFinal leaves the MAC in the same state it was after the last init. + *

+ * @param out the array the MAC is to be output to. + * @param outOff the offset into the out buffer the output is to start at. + * @exception DataLengthException if there isn't enough space in out. + * @exception InvalidOperationException if the MAC is not initialised. + */ + int DoFinal(byte[] output, int outOff); + + /** + * Reset the MAC. At the end of resetting the MAC should be in the + * in the same state it was after the last init (if there was one). + */ + void Reset(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IMac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IMac.cs.meta new file mode 100644 index 00000000..f0fc5d77 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 06c6c4ff752285d4181fc6f0f7a3bbc1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRawAgreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRawAgreement.cs new file mode 100644 index 00000000..91146e0b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRawAgreement.cs @@ -0,0 +1,17 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + public interface IRawAgreement + { + void Init(ICipherParameters parameters); + + int AgreementSize { get; } + + void CalculateAgreement(ICipherParameters publicKey, byte[] buf, int off); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRawAgreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRawAgreement.cs.meta new file mode 100644 index 00000000..13cc19ab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRawAgreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4955c6838f252e4cba62fb0ee5dc679 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRsa.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRsa.cs new file mode 100644 index 00000000..8d9d1ce4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRsa.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + public interface IRsa + { + void Init(bool forEncryption, ICipherParameters parameters); + int GetInputBlockSize(); + int GetOutputBlockSize(); + BigInteger ConvertInput(byte[] buf, int off, int len); + BigInteger ProcessBlock(BigInteger input); + byte[] ConvertOutput(BigInteger result); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRsa.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRsa.cs.meta new file mode 100644 index 00000000..6bc536e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IRsa.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bfae5f5df323ffa4d878ad34f7914052 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignatureFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignatureFactory.cs new file mode 100644 index 00000000..95dba2e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignatureFactory.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// Base interface for operators that serve as stream-based signature calculators. + /// + public interface ISignatureFactory + { + /// The algorithm details object for this calculator. + Object AlgorithmDetails { get ; } + + /// + /// Create a stream calculator for this signature calculator. The stream + /// calculator is used for the actual operation of entering the data to be signed + /// and producing the signature block. + /// + /// A calculator producing an IBlockResult with a signature in it. + IStreamCalculator CreateCalculator(); + } +} + + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignatureFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignatureFactory.cs.meta new file mode 100644 index 00000000..5c1be3ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignatureFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b932d94d8fe22545b8c91109d2bf521 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISigner.cs new file mode 100644 index 00000000..0d50cefb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISigner.cs @@ -0,0 +1,54 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable + +using System; +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + public interface ISigner + { + /** + * Return the name of the algorithm the signer implements. + * + * @return the name of the algorithm the signer implements. + */ + string AlgorithmName { get; } + + /** + * Initialise the signer for signing or verification. + * + * @param forSigning true if for signing, false otherwise + * @param param necessary parameters. + */ + void Init(bool forSigning, ICipherParameters parameters); + + /** + * update the internal digest with the byte b + */ + void Update(byte input); + + /** + * update the internal digest with the byte array in + */ + void BlockUpdate(byte[] input, int inOff, int length); + + /** + * Generate a signature for the message we've been loaded with using + * the key we were initialised with. + */ + byte[] GenerateSignature(); + /** + * return true if the internal state represents the signature described + * in the passed in array. + */ + bool VerifySignature(byte[] signature); + + /** + * reset the internal state + */ + void Reset(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISigner.cs.meta new file mode 100644 index 00000000..cbe2da52 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3bcb10b760d17945bfcb44c2b23d5a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignerWithRecovery.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignerWithRecovery.cs new file mode 100644 index 00000000..5c26f8d8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignerWithRecovery.cs @@ -0,0 +1,41 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * Signer with message recovery. + */ + public interface ISignerWithRecovery + : ISigner + { + /** + * Returns true if the signer has recovered the full message as + * part of signature verification. + * + * @return true if full message recovered. + */ + bool HasFullMessage(); + + /** + * Returns a reference to what message was recovered (if any). + * + * @return full/partial message, null if nothing. + */ + byte[] GetRecoveredMessage(); + + /** + * Perform an update with the recovered message before adding any other data. This must + * be the first update method called, and calling it will result in the signer assuming + * that further calls to update will include message content past what is recoverable. + * + * @param signature the signature that we are in the process of verifying. + * @throws IllegalStateException + */ + void UpdateWithRecoveredMessage(byte[] signature); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignerWithRecovery.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignerWithRecovery.cs.meta new file mode 100644 index 00000000..dc03b037 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ISignerWithRecovery.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e65905090a3ed6d4d8a088adeef895f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCalculator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCalculator.cs new file mode 100644 index 00000000..21966844 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCalculator.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// Base interface for cryptographic operations such as Hashes, MACs, and Signatures which reduce a stream of data + /// to a single value. + /// + public interface IStreamCalculator + { + /// Return a "sink" stream which only exists to update the implementing object. + /// A stream to write to in order to update the implementing object. + Stream Stream { get; } + + /// + /// Return the result of processing the stream. This value is only available once the stream + /// has been closed. + /// + /// The result of processing the stream. + Object GetResult(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCalculator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCalculator.cs.meta new file mode 100644 index 00000000..7aa32294 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71c66ead22110194abc4b7138f2fa247 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCipher.cs new file mode 100644 index 00000000..56017185 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCipher.cs @@ -0,0 +1,49 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// The interface stream ciphers conform to. + public interface IStreamCipher + { + /// The name of the algorithm this cipher implements. + string AlgorithmName { get; } + + /// Initialise the cipher. + /// If true the cipher is initialised for encryption, + /// if false for decryption. + /// The key and other data required by the cipher. + /// + /// If the parameters argument is inappropriate. + /// + void Init(bool forEncryption, ICipherParameters parameters); + + /// encrypt/decrypt a single byte returning the result. + /// the byte to be processed. + /// the result of processing the input byte. + byte ReturnByte(byte input); + + /// + /// Process a block of bytes from input putting the result into output. + /// + /// The input byte array. + /// + /// The offset into input where the data to be processed starts. + /// + /// The number of bytes to be processed. + /// The output buffer the processed bytes go into. + /// + /// The offset into output the processed data starts at. + /// + /// If the output buffer is too small. + void ProcessBytes(byte[] input, int inOff, int length, byte[] output, int outOff); + + /// + /// Reset the cipher to the same state as it was after the last init (if there was one). + /// + void Reset(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCipher.cs.meta new file mode 100644 index 00000000..be0d38cb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IStreamCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef95f78d58f8f2848a0600acae2dbde9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifier.cs new file mode 100644 index 00000000..255204a8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifier.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// Operators that reduce their input to the validation of a signature produce this type. + /// + public interface IVerifier + { + /// + /// Return true if the passed in data matches what is expected by the verification result. + /// + /// The bytes representing the signature. + /// true if the signature verifies, false otherwise. + bool IsVerified(byte[] data); + + /// + /// Return true if the length bytes from off in the source array match the signature + /// expected by the verification result. + /// + /// Byte array containing the signature. + /// The offset into the source array where the signature starts. + /// The number of bytes in source making up the signature. + /// true if the signature verifies, false otherwise. + bool IsVerified(byte[] source, int off, int length); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifier.cs.meta new file mode 100644 index 00000000..d3a1ccc2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9b2937c1d75e3a4a853544b58c02a98 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactory.cs new file mode 100644 index 00000000..dc40f7db --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactory.cs @@ -0,0 +1,25 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// Base interface for operators that serve as stream-based signature verifiers. + /// + public interface IVerifierFactory + { + /// The algorithm details object for this verifier. + Object AlgorithmDetails { get ; } + + /// + /// Create a stream calculator for this verifier. The stream + /// calculator is used for the actual operation of entering the data to be verified + /// and producing a result which can be used to verify the original signature. + /// + /// A calculator producing an IVerifier which can verify the signature. + IStreamCalculator CreateCalculator(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactory.cs.meta new file mode 100644 index 00000000..d90f7e97 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2bb89900480afd44dbd6fd6f123f4197 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactoryProvider.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactoryProvider.cs new file mode 100644 index 00000000..63133f96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactoryProvider.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// Base interface for a provider to support the dynamic creation of signature verifiers. + /// + public interface IVerifierFactoryProvider + { + /// + /// Return a signature verfier for signature algorithm described in the passed in algorithm details object. + /// + /// The details of the signature algorithm verification is required for. + /// A new signature verifier. + IVerifierFactory CreateVerifierFactory (Object algorithmDetails); + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactoryProvider.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactoryProvider.cs.meta new file mode 100644 index 00000000..71232a9a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IVerifierFactoryProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9d25c82ed85117949850d76a12de1304 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IWrapper.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IWrapper.cs new file mode 100644 index 00000000..4bf5a156 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IWrapper.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + public interface IWrapper + { + /// The name of the algorithm this cipher implements. + string AlgorithmName { get; } + + void Init(bool forWrapping, ICipherParameters parameters); + + byte[] Wrap(byte[] input, int inOff, int length); + + byte[] Unwrap(byte[] input, int inOff, int length); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IWrapper.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IWrapper.cs.meta new file mode 100644 index 00000000..5b8285a0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IWrapper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9e6dd993ef516c2419ecc5849e22d756 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IXof.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IXof.cs new file mode 100644 index 00000000..88fe9a02 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IXof.cs @@ -0,0 +1,35 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// With FIPS PUB 202 a new kind of message digest was announced which supported extendable output, or variable digest sizes. + /// This interface provides the extra method required to support variable output on a digest implementation. + /// + public interface IXof + : IDigest + { + /// + /// Output the results of the final calculation for this digest to outLen number of bytes. + /// + /// output array to write the output bytes to. + /// offset to start writing the bytes at. + /// the number of output bytes requested. + /// the number of bytes written + int DoFinal(byte[] output, int outOff, int outLen); + + /// + /// Start outputting the results of the final calculation for this digest. Unlike DoFinal, this method + /// will continue producing output until the Xof is explicitly reset, or signals otherwise. + /// + /// output array to write the output bytes to. + /// offset to start writing the bytes at. + /// the number of output bytes requested. + /// the number of bytes written + int DoOutput(byte[] output, int outOff, int outLen); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IXof.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IXof.cs.meta new file mode 100644 index 00000000..b7e4cdfd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/IXof.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0dc703e606f9afc47a3e7859c663a442 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/InvalidCipherTextException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/InvalidCipherTextException.cs new file mode 100644 index 00000000..a89918a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/InvalidCipherTextException.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * this exception is thrown whenever we find something we don't expect in a + * message. + */ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class InvalidCipherTextException + : CryptoException + { + /** + * base constructor. + */ + public InvalidCipherTextException() + { + } + + /** + * create a InvalidCipherTextException with the given message. + * + * @param message the message to be carried with the exception. + */ + public InvalidCipherTextException( + string message) + : base(message) + { + } + + public InvalidCipherTextException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/InvalidCipherTextException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/InvalidCipherTextException.cs.meta new file mode 100644 index 00000000..87322c1e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/InvalidCipherTextException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8853d9e74bb4d214ca464e63632d1f0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/KeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/KeyGenerationParameters.cs new file mode 100644 index 00000000..3c920c16 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/KeyGenerationParameters.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * The base class for parameters to key generators. + */ + public class KeyGenerationParameters + { + private SecureRandom random; + private int strength; + + /** + * initialise the generator with a source of randomness + * and a strength (in bits). + * + * @param random the random byte source. + * @param strength the size, in bits, of the keys we want to produce. + */ + public KeyGenerationParameters( + SecureRandom random, + int strength) + { + if (random == null) + throw new ArgumentNullException("random"); + if (strength < 1) + throw new ArgumentException("strength must be a positive value", "strength"); + + this.random = random; + this.strength = strength; + } + + /** + * return the random source associated with this + * generator. + * + * @return the generators random source. + */ + public SecureRandom Random + { + get { return random; } + } + + /** + * return the bit strength for keys produced by this generator, + * + * @return the strength of the keys this generator produces (in bits). + */ + public int Strength + { + get { return strength; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/KeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/KeyGenerationParameters.cs.meta new file mode 100644 index 00000000..61d375d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/KeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 04045d0d5f207b6429614236fbee6859 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/MaxBytesExceededException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/MaxBytesExceededException.cs new file mode 100644 index 00000000..d09caf62 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/MaxBytesExceededException.cs @@ -0,0 +1,36 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /// + /// This exception is thrown whenever a cipher requires a change of key, iv + /// or similar after x amount of bytes enciphered + /// +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class MaxBytesExceededException + : CryptoException + { + public MaxBytesExceededException() + { + } + + public MaxBytesExceededException( + string message) + : base(message) + { + } + + public MaxBytesExceededException( + string message, + Exception e) + : base(message, e) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/MaxBytesExceededException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/MaxBytesExceededException.cs.meta new file mode 100644 index 00000000..e094f03f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/MaxBytesExceededException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 92610e3167822424cbf998e12a4d959a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/OutputLengthException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/OutputLengthException.cs new file mode 100644 index 00000000..6fa64ed5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/OutputLengthException.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class OutputLengthException + : DataLengthException + { + public OutputLengthException() + { + } + + public OutputLengthException( + string message) + : base(message) + { + } + + public OutputLengthException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/OutputLengthException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/OutputLengthException.cs.meta new file mode 100644 index 00000000..7085e8c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/OutputLengthException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aeef960a80a930f47af2e7599623e501 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/PbeParametersGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/PbeParametersGenerator.cs new file mode 100644 index 00000000..ddf81148 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/PbeParametersGenerator.cs @@ -0,0 +1,206 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * super class for all Password Based Encyrption (Pbe) parameter generator classes. + */ + public abstract class PbeParametersGenerator + { + protected byte[] mPassword; + protected byte[] mSalt; + protected int mIterationCount; + + /** + * base constructor. + */ + protected PbeParametersGenerator() + { + } + + /** + * initialise the Pbe generator. + * + * @param password the password converted into bytes (see below). + * @param salt the salt to be mixed with the password. + * @param iterationCount the number of iterations the "mixing" function + * is to be applied for. + */ + public virtual void Init( + byte[] password, + byte[] salt, + int iterationCount) + { + if (password == null) + throw new ArgumentNullException("password"); + if (salt == null) + throw new ArgumentNullException("salt"); + + this.mPassword = Arrays.Clone(password); + this.mSalt = Arrays.Clone(salt); + this.mIterationCount = iterationCount; + } + + public virtual byte[] Password + { + get { return Arrays.Clone(mPassword); } + } + + /** + * return the password byte array. + * + * @return the password byte array. + */ + [Obsolete("Use 'Password' property")] + public byte[] GetPassword() + { + return Password; + } + + public virtual byte[] Salt + { + get { return Arrays.Clone(mSalt); } + } + + /** + * return the salt byte array. + * + * @return the salt byte array. + */ + [Obsolete("Use 'Salt' property")] + public byte[] GetSalt() + { + return Salt; + } + + /** + * return the iteration count. + * + * @return the iteration count. + */ + public virtual int IterationCount + { + get { return mIterationCount; } + } + + /** + * Generate derived parameters for a key of length keySize. + * + * @param keySize the length, in bits, of the key required. + * @return a parameters object representing a key. + */ + [Obsolete("Use version with 'algorithm' parameter")] + public abstract ICipherParameters GenerateDerivedParameters(int keySize); + public abstract ICipherParameters GenerateDerivedParameters(string algorithm, int keySize); + + /** + * Generate derived parameters for a key of length keySize, and + * an initialisation vector (IV) of length ivSize. + * + * @param keySize the length, in bits, of the key required. + * @param ivSize the length, in bits, of the iv required. + * @return a parameters object representing a key and an IV. + */ + [Obsolete("Use version with 'algorithm' parameter")] + public abstract ICipherParameters GenerateDerivedParameters(int keySize, int ivSize); + public abstract ICipherParameters GenerateDerivedParameters(string algorithm, int keySize, int ivSize); + + /** + * Generate derived parameters for a key of length keySize, specifically + * for use with a MAC. + * + * @param keySize the length, in bits, of the key required. + * @return a parameters object representing a key. + */ + public abstract ICipherParameters GenerateDerivedMacParameters(int keySize); + + /** + * converts a password to a byte array according to the scheme in + * Pkcs5 (ascii, no padding) + * + * @param password a character array representing the password. + * @return a byte array representing the password. + */ + public static byte[] Pkcs5PasswordToBytes( + char[] password) + { + if (password == null) + return new byte[0]; + + return Strings.ToByteArray(password); + } + + [Obsolete("Use version taking 'char[]' instead")] + public static byte[] Pkcs5PasswordToBytes( + string password) + { + if (password == null) + return new byte[0]; + + return Strings.ToByteArray(password); + } + + /** + * converts a password to a byte array according to the scheme in + * PKCS5 (UTF-8, no padding) + * + * @param password a character array representing the password. + * @return a byte array representing the password. + */ + public static byte[] Pkcs5PasswordToUtf8Bytes( + char[] password) + { + if (password == null) + return new byte[0]; + + return Encoding.UTF8.GetBytes(password); + } + + [Obsolete("Use version taking 'char[]' instead")] + public static byte[] Pkcs5PasswordToUtf8Bytes( + string password) + { + if (password == null) + return new byte[0]; + + return Encoding.UTF8.GetBytes(password); + } + + /** + * converts a password to a byte array according to the scheme in + * Pkcs12 (unicode, big endian, 2 zero pad bytes at the end). + * + * @param password a character array representing the password. + * @return a byte array representing the password. + */ + public static byte[] Pkcs12PasswordToBytes( + char[] password) + { + return Pkcs12PasswordToBytes(password, false); + } + + public static byte[] Pkcs12PasswordToBytes( + char[] password, + bool wrongPkcs12Zero) + { + if (password == null || password.Length < 1) + { + return new byte[wrongPkcs12Zero ? 2 : 0]; + } + + // +1 for extra 2 pad bytes. + byte[] bytes = new byte[(password.Length + 1) * 2]; + + Encoding.BigEndianUnicode.GetBytes(password, 0, password.Length, bytes, 0); + + return bytes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/PbeParametersGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/PbeParametersGenerator.cs.meta new file mode 100644 index 00000000..493df6f5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/PbeParametersGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e8e08c20f9235643b9bc29aa415dfab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/StreamBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/StreamBlockCipher.cs new file mode 100644 index 00000000..fb40d160 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/StreamBlockCipher.cs @@ -0,0 +1,113 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto +{ + /** + * a wrapper for block ciphers with a single byte block size, so that they + * can be treated like stream ciphers. + */ + public class StreamBlockCipher + : IStreamCipher + { + private readonly IBlockCipher cipher; + private readonly byte[] oneByte = new byte[1]; + + /** + * basic constructor. + * + * @param cipher the block cipher to be wrapped. + * @exception ArgumentException if the cipher has a block size other than + * one. + */ + public StreamBlockCipher( + IBlockCipher cipher) + { + if (cipher == null) + throw new ArgumentNullException("cipher"); + if (cipher.GetBlockSize() != 1) + throw new ArgumentException("block cipher block size != 1.", "cipher"); + + this.cipher = cipher; + } + + /** + * initialise the underlying cipher. + * + * @param forEncryption true if we are setting up for encryption, false otherwise. + * @param param the necessary parameters for the underlying cipher to be initialised. + */ + public void Init( + bool forEncryption, + ICipherParameters parameters) + { + cipher.Init(forEncryption, parameters); + } + + /** + * return the name of the algorithm we are wrapping. + * + * @return the name of the algorithm we are wrapping. + */ + public string AlgorithmName + { + get { return cipher.AlgorithmName; } + } + + /** + * encrypt/decrypt a single byte returning the result. + * + * @param in the byte to be processed. + * @return the result of processing the input byte. + */ + public byte ReturnByte( + byte input) + { + oneByte[0] = input; + + cipher.ProcessBlock(oneByte, 0, oneByte, 0); + + return oneByte[0]; + } + + /** + * process a block of bytes from in putting the result into out. + * + * @param in the input byte array. + * @param inOff the offset into the in array where the data to be processed starts. + * @param len the number of bytes to be processed. + * @param out the output buffer the processed bytes go into. + * @param outOff the offset into the output byte array the processed data stars at. + * @exception DataLengthException if the output buffer is too small. + */ + public void ProcessBytes( + byte[] input, + int inOff, + int length, + byte[] output, + int outOff) + { + if (outOff + length > output.Length) + throw new DataLengthException("output buffer too small in ProcessBytes()"); + + for (int i = 0; i != length; i++) + { + cipher.ProcessBlock(input, inOff + i, output, outOff + i); + } + } + + /** + * reset the underlying cipher. This leaves it in the same state + * it was at after the last init (if there was one). + */ + public void Reset() + { + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/StreamBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/StreamBlockCipher.cs.meta new file mode 100644 index 00000000..ed4f36bd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/StreamBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01d635ad1339b4c4a83239af73f165d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement.meta new file mode 100644 index 00000000..816c289f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2bc69c4ab864f9b47b55d5556201d098 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHAgreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHAgreement.cs new file mode 100644 index 00000000..cbf7bfa2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHAgreement.cs @@ -0,0 +1,103 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + /** + * a Diffie-Hellman key exchange engine. + *

+ * note: This uses MTI/A0 key agreement in order to make the key agreement + * secure against passive attacks. If you're doing Diffie-Hellman and both + * parties have long term public keys you should look at using this. For + * further information have a look at RFC 2631.

+ *

+ * It's possible to extend this to more than two parties as well, for the moment + * that is left as an exercise for the reader.

+ */ + public class DHAgreement + { + private DHPrivateKeyParameters key; + private DHParameters dhParams; + private BigInteger privateValue; + private SecureRandom random; + + public void Init( + ICipherParameters parameters) + { + AsymmetricKeyParameter kParam; + if (parameters is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)parameters; + + this.random = rParam.Random; + kParam = (AsymmetricKeyParameter)rParam.Parameters; + } + else + { + this.random = new SecureRandom(); + kParam = (AsymmetricKeyParameter)parameters; + } + + if (!(kParam is DHPrivateKeyParameters)) + { + throw new ArgumentException("DHEngine expects DHPrivateKeyParameters"); + } + + this.key = (DHPrivateKeyParameters)kParam; + this.dhParams = key.Parameters; + } + + /** + * calculate our initial message. + */ + public BigInteger CalculateMessage() + { + DHKeyPairGenerator dhGen = new DHKeyPairGenerator(); + dhGen.Init(new DHKeyGenerationParameters(random, dhParams)); + AsymmetricCipherKeyPair dhPair = dhGen.GenerateKeyPair(); + + this.privateValue = ((DHPrivateKeyParameters)dhPair.Private).X; + + return ((DHPublicKeyParameters)dhPair.Public).Y; + } + + /** + * given a message from a given party and the corresponding public key + * calculate the next message in the agreement sequence. In this case + * this will represent the shared secret. + */ + public BigInteger CalculateAgreement( + DHPublicKeyParameters pub, + BigInteger message) + { + if (pub == null) + throw new ArgumentNullException("pub"); + if (message == null) + throw new ArgumentNullException("message"); + + if (!pub.Parameters.Equals(dhParams)) + throw new ArgumentException("Diffie-Hellman public key has wrong parameters."); + + BigInteger p = dhParams.P; + + BigInteger peerY = pub.Y; + if (peerY == null || peerY.CompareTo(BigInteger.One) <= 0 || peerY.CompareTo(p.Subtract(BigInteger.One)) >= 0) + throw new ArgumentException("Diffie-Hellman public key is weak"); + + BigInteger result = peerY.ModPow(privateValue, p); + if (result.Equals(BigInteger.One)) + throw new InvalidOperationException("Shared key can't be 1"); + + return message.ModPow(key.X, p).Multiply(result).Mod(p); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHAgreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHAgreement.cs.meta new file mode 100644 index 00000000..f7d4a73a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHAgreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43b4c5b9cdeee0a4ea13e8d2efdb7a4a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHBasicAgreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHBasicAgreement.cs new file mode 100644 index 00000000..63be8574 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHBasicAgreement.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + /** + * a Diffie-Hellman key agreement class. + *

+ * note: This is only the basic algorithm, it doesn't take advantage of + * long term public keys if they are available. See the DHAgreement class + * for a "better" implementation.

+ */ + public class DHBasicAgreement + : IBasicAgreement + { + private DHPrivateKeyParameters key; + private DHParameters dhParams; + + public virtual void Init( + ICipherParameters parameters) + { + if (parameters is ParametersWithRandom) + { + parameters = ((ParametersWithRandom) parameters).Parameters; + } + + if (!(parameters is DHPrivateKeyParameters)) + { + throw new ArgumentException("DHEngine expects DHPrivateKeyParameters"); + } + + this.key = (DHPrivateKeyParameters) parameters; + this.dhParams = key.Parameters; + } + + public virtual int GetFieldSize() + { + return (key.Parameters.P.BitLength + 7) / 8; + } + + /** + * given a short term public key from a given party calculate the next + * message in the agreement sequence. + */ + public virtual BigInteger CalculateAgreement( + ICipherParameters pubKey) + { + if (this.key == null) + throw new InvalidOperationException("Agreement algorithm not initialised"); + + DHPublicKeyParameters pub = (DHPublicKeyParameters)pubKey; + + if (!pub.Parameters.Equals(dhParams)) + throw new ArgumentException("Diffie-Hellman public key has wrong parameters."); + + BigInteger p = dhParams.P; + + BigInteger peerY = pub.Y; + if (peerY == null || peerY.CompareTo(BigInteger.One) <= 0 || peerY.CompareTo(p.Subtract(BigInteger.One)) >= 0) + throw new ArgumentException("Diffie-Hellman public key is weak"); + + BigInteger result = peerY.ModPow(key.X, p); + if (result.Equals(BigInteger.One)) + throw new InvalidOperationException("Shared key can't be 1"); + + return result; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHBasicAgreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHBasicAgreement.cs.meta new file mode 100644 index 00000000..9ec23b82 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHBasicAgreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 784404322f00cbf4d8deb0ae525835dc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHStandardGroups.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHStandardGroups.cs new file mode 100644 index 00000000..ba184926 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHStandardGroups.cs @@ -0,0 +1,311 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + /// Standard Diffie-Hellman groups from various IETF specifications. + public class DHStandardGroups + { + private static BigInteger FromHex(string hex) + { + return new BigInteger(1, Hex.Decode(hex)); + } + + private static DHParameters FromPG(string hexP, string hexG) + { + return new DHParameters(FromHex(hexP), FromHex(hexG)); + } + + private static DHParameters FromPGQ(string hexP, string hexG, string hexQ) + { + return new DHParameters(FromHex(hexP), FromHex(hexG), FromHex(hexQ)); + } + + private static DHParameters Rfc7919Parameters(string hexP, int l) + { + // NOTE: All the groups in RFC 7919 use safe primes, i.e. q = (p-1)/2, and generator g = 2 + BigInteger p = FromHex(hexP); + return new DHParameters(p, BigInteger.Two, p.ShiftRight(1), l); + } + + /* + * RFC 2409 + */ + private static readonly string rfc2409_768_p = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + + "E485B576625E7EC6F44C42E9A63A3620FFFFFFFFFFFFFFFF"; + private static readonly string rfc2409_768_g = "02"; + public static readonly DHParameters rfc2409_768 = FromPG(rfc2409_768_p, rfc2409_768_g); + + private static readonly string rfc2409_1024_p = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381" + + "FFFFFFFFFFFFFFFF"; + private static readonly string rfc2409_1024_g = "02"; + public static readonly DHParameters rfc2409_1024 = FromPG(rfc2409_1024_p, rfc2409_1024_g); + + /* + * RFC 3526 + */ + private static readonly string rfc3526_1536_p = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA237327FFFFFFFFFFFFFFFF"; + private static readonly string rfc3526_1536_g = "02"; + public static readonly DHParameters rfc3526_1536 = FromPG(rfc3526_1536_p, rfc3526_1536_g); + + private static readonly string rfc3526_2048_p = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AACAA68FFFFFFFFFFFFFFFF"; + private static readonly string rfc3526_2048_g = "02"; + public static readonly DHParameters rfc3526_2048 = FromPG(rfc3526_2048_p, rfc3526_2048_g); + + private static readonly string rfc3526_3072_p = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + + "43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF"; + private static readonly string rfc3526_3072_g = "02"; + public static readonly DHParameters rfc3526_3072 = FromPG(rfc3526_3072_p, rfc3526_3072_g); + + private static readonly string rfc3526_4096_p = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + + "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" + "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" + + "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" + "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" + + "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" + "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199" + + "FFFFFFFFFFFFFFFF"; + private static readonly string rfc3526_4096_g = "02"; + public static readonly DHParameters rfc3526_4096 = FromPG(rfc3526_4096_p, rfc3526_4096_g); + + private static readonly string rfc3526_6144_p = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" + + "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" + + "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9" + + "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" + + "49286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8" + + "FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C" + + "180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718" + + "3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D" + + "04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7D" + + "B3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D226" + + "1AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFC" + + "E0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B26" + + "99C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB" + + "04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2" + + "233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127" + + "D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BDF8FF9406" + + "AD9E530EE5DB382F413001AEB06A53ED9027D831179727B0865A8918" + + "DA3EDBEBCF9B14ED44CE6CBACED4BB1BDB7F1447E6CC254B33205151" + + "2BD7AF426FB8F401378CD2BF5983CA01C64B92ECF032EA15D1721D03" + + "F482D7CE6E74FEF6D55E702F46980C82B5A84031900B1C9E59E7C97F" + + "BEC7E8F323A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE32806A1D58B" + + "B7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55CDA56C9EC2EF29632" + + "387FE8D76E3C0468043E8F663F4860EE12BF2D5B0B7474D6E694F91E" + + "6DCC4024FFFFFFFFFFFFFFFF"; + private static readonly string rfc3526_6144_g = "02"; + public static readonly DHParameters rfc3526_6144 = FromPG(rfc3526_6144_p, rfc3526_6144_g); + + private static readonly string rfc3526_8192_p = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" + + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" + + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" + + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" + "83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" + + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" + + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" + "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" + + "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" + + "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" + "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" + + "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" + "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" + + "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" + "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BD" + "F8FF9406AD9E530EE5DB382F413001AEB06A53ED9027D831" + + "179727B0865A8918DA3EDBEBCF9B14ED44CE6CBACED4BB1B" + "DB7F1447E6CC254B332051512BD7AF426FB8F401378CD2BF" + + "5983CA01C64B92ECF032EA15D1721D03F482D7CE6E74FEF6" + "D55E702F46980C82B5A84031900B1C9E59E7C97FBEC7E8F3" + + "23A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE328" + + "06A1D58BB7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55C" + "DA56C9EC2EF29632387FE8D76E3C0468043E8F663F4860EE" + + "12BF2D5B0B7474D6E694F91E6DBE115974A3926F12FEE5E4" + "38777CB6A932DF8CD8BEC4D073B931BA3BC832B68D9DD300" + + "741FA7BF8AFC47ED2576F6936BA424663AAB639C5AE4F568" + "3423B4742BF1C978238F16CBE39D652DE3FDB8BEFC848AD9" + + "22222E04A4037C0713EB57A81A23F0C73473FC646CEA306B" + "4BCBC8862F8385DDFA9D4B7FA2C087E879683303ED5BDD3A" + + "062B3CF5B3A278A66D2A13F83F44F82DDF310EE074AB6A36" + "4597E899A0255DC164F31CC50846851DF9AB48195DED7EA1" + + "B1D510BD7EE74D73FAF36BC31ECFA268359046F4EB879F92" + "4009438B481C6CD7889A002ED5EE382BC9190DA6FC026E47" + + "9558E4475677E9AA9E3050E2765694DFC81F56E880B96E71" + "60C980DD98EDD3DFFFFFFFFFFFFFFFFF"; + private static readonly string rfc3526_8192_g = "02"; + public static readonly DHParameters rfc3526_8192 = FromPG(rfc3526_8192_p, rfc3526_8192_g); + + /* + * RFC 4306 + */ + public static readonly DHParameters rfc4306_768 = rfc2409_768; + public static readonly DHParameters rfc4306_1024 = rfc2409_1024; + + /* + * RFC 5114 + */ + private static readonly string rfc5114_1024_160_p = "B10B8F96A080E01DDE92DE5EAE5D54EC52C99FBCFB06A3C6" + + "9A6A9DCA52D23B616073E28675A23D189838EF1E2EE652C0" + "13ECB4AEA906112324975C3CD49B83BFACCBDD7D90C4BD70" + + "98488E9C219A73724EFFD6FAE5644738FAA31A4FF55BCCC0" + "A151AF5F0DC8B4BD45BF37DF365C1A65E68CFDA76D4DA708" + + "DF1FB2BC2E4A4371"; + private static readonly string rfc5114_1024_160_g = "A4D1CBD5C3FD34126765A442EFB99905F8104DD258AC507F" + + "D6406CFF14266D31266FEA1E5C41564B777E690F5504F213" + "160217B4B01B886A5E91547F9E2749F4D7FBD7D3B9A92EE1" + + "909D0D2263F80A76A6A24C087A091F531DBF0A0169B6A28A" + "D662A4D18E73AFA32D779D5918D08BC8858F4DCEF97C2A24" + + "855E6EEB22B3B2E5"; + private static readonly string rfc5114_1024_160_q = "F518AA8781A8DF278ABA4E7D64B7CB9D49462353"; + + /// + /// Existence of a "hidden SNFS" backdoor cannot be ruled out. see https://eprint.iacr.org/2016/961.pdf . + /// + [Obsolete("Existence of a 'hidden SNFS' backdoor cannot be ruled out.")] + public static readonly DHParameters rfc5114_1024_160 = FromPGQ(rfc5114_1024_160_p, rfc5114_1024_160_g, + rfc5114_1024_160_q); + + private static readonly string rfc5114_2048_224_p = "AD107E1E9123A9D0D660FAA79559C51FA20D64E5683B9FD1" + + "B54B1597B61D0A75E6FA141DF95A56DBAF9A3C407BA1DF15" + "EB3D688A309C180E1DE6B85A1274A0A66D3F8152AD6AC212" + + "9037C9EDEFDA4DF8D91E8FEF55B7394B7AD5B7D0B6C12207" + "C9F98D11ED34DBF6C6BA0B2C8BBC27BE6A00E0A0B9C49708" + + "B3BF8A317091883681286130BC8985DB1602E714415D9330" + "278273C7DE31EFDC7310F7121FD5A07415987D9ADC0A486D" + + "CDF93ACC44328387315D75E198C641A480CD86A1B9E587E8" + "BE60E69CC928B2B9C52172E413042E9B23F10B0E16E79763" + + "C9B53DCF4BA80A29E3FB73C16B8E75B97EF363E2FFA31F71" + "CF9DE5384E71B81C0AC4DFFE0C10E64F"; + private static readonly string rfc5114_2048_224_g = "AC4032EF4F2D9AE39DF30B5C8FFDAC506CDEBE7B89998CAF" + + "74866A08CFE4FFE3A6824A4E10B9A6F0DD921F01A70C4AFA" + "AB739D7700C29F52C57DB17C620A8652BE5E9001A8D66AD7" + + "C17669101999024AF4D027275AC1348BB8A762D0521BC98A" + "E247150422EA1ED409939D54DA7460CDB5F6C6B250717CBE" + + "F180EB34118E98D119529A45D6F834566E3025E316A330EF" + "BB77A86F0C1AB15B051AE3D428C8F8ACB70A8137150B8EEB" + + "10E183EDD19963DDD9E263E4770589EF6AA21E7F5F2FF381" + "B539CCE3409D13CD566AFBB48D6C019181E1BCFE94B30269" + + "EDFE72FE9B6AA4BD7B5A0F1C71CFFF4C19C418E1F6EC0179" + "81BC087F2A7065B384B890D3191F2BFA"; + private static readonly string rfc5114_2048_224_q = "801C0D34C58D93FE997177101F80535A4738CEBCBF389A99B36371EB"; + + /// + /// Existence of a "hidden SNFS" backdoor cannot be ruled out. see https://eprint.iacr.org/2016/961.pdf . + /// + [Obsolete("Existence of a 'hidden SNFS' backdoor cannot be ruled out.")] + public static readonly DHParameters rfc5114_2048_224 = FromPGQ(rfc5114_2048_224_p, rfc5114_2048_224_g, + rfc5114_2048_224_q); + + private static readonly string rfc5114_2048_256_p = "87A8E61DB4B6663CFFBBD19C651959998CEEF608660DD0F2" + + "5D2CEED4435E3B00E00DF8F1D61957D4FAF7DF4561B2AA30" + "16C3D91134096FAA3BF4296D830E9A7C209E0C6497517ABD" + + "5A8A9D306BCF67ED91F9E6725B4758C022E0B1EF4275BF7B" + "6C5BFC11D45F9088B941F54EB1E59BB8BC39A0BF12307F5C" + + "4FDB70C581B23F76B63ACAE1CAA6B7902D52526735488A0E" + "F13C6D9A51BFA4AB3AD8347796524D8EF6A167B5A41825D9" + + "67E144E5140564251CCACB83E6B486F6B3CA3F7971506026" + "C0B857F689962856DED4010ABD0BE621C3A3960A54E710C3" + + "75F26375D7014103A4B54330C198AF126116D2276E11715F" + "693877FAD7EF09CADB094AE91E1A1597"; + private static readonly string rfc5114_2048_256_g = "3FB32C9B73134D0B2E77506660EDBD484CA7B18F21EF2054" + + "07F4793A1A0BA12510DBC15077BE463FFF4FED4AAC0BB555" + "BE3A6C1B0C6B47B1BC3773BF7E8C6F62901228F8C28CBB18" + + "A55AE31341000A650196F931C77A57F2DDF463E5E9EC144B" + "777DE62AAAB8A8628AC376D282D6ED3864E67982428EBC83" + + "1D14348F6F2F9193B5045AF2767164E1DFC967C1FB3F2E55" + "A4BD1BFFE83B9C80D052B985D182EA0ADB2A3B7313D3FE14" + + "C8484B1E052588B9B7D2BBD2DF016199ECD06E1557CD0915" + "B3353BBB64E0EC377FD028370DF92B52C7891428CDC67EB6" + + "184B523D1DB246C32F63078490F00EF8D647D148D4795451" + "5E2327CFEF98C582664B4C0F6CC41659"; + private static readonly string rfc5114_2048_256_q = "8CF83642A709A097B447997640129DA299B1A47D1EB3750B" + + "A308B0FE64F5FBD3"; + + /// + /// Existence of a "hidden SNFS" backdoor cannot be ruled out. see https://eprint.iacr.org/2016/961.pdf . + /// + [Obsolete("Existence of a 'hidden SNFS' backdoor cannot be ruled out.")] + public static readonly DHParameters rfc5114_2048_256 = FromPGQ(rfc5114_2048_256_p, rfc5114_2048_256_g, + rfc5114_2048_256_q); + + /* + * RFC 5996 + */ + public static readonly DHParameters rfc5996_768 = rfc4306_768; + public static readonly DHParameters rfc5996_1024 = rfc4306_1024; + + /* + * RFC 7919 + */ + private static readonly string rfc7919_ffdhe2048_p = "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + "886B423861285C97FFFFFFFFFFFFFFFF"; + public static readonly DHParameters rfc7919_ffdhe2048 = Rfc7919Parameters(rfc7919_ffdhe2048_p, 225); + + private static readonly string rfc7919_ffdhe3072_p = "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B66C62E37FFFFFFFFFFFFFFFF"; + public static readonly DHParameters rfc7919_ffdhe3072 = Rfc7919Parameters(rfc7919_ffdhe3072_p, 275); + + private static readonly string rfc7919_ffdhe4096_p = "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B669E1EF16E6F52C3164DF4FB" + "7930E9E4E58857B6AC7D5F42D69F6D187763CF1D55034004" + + "87F55BA57E31CC7A7135C886EFB4318AED6A1E012D9E6832" + "A907600A918130C46DC778F971AD0038092999A333CB8B7A" + + "1A1DB93D7140003C2A4ECEA9F98D0ACC0A8291CDCEC97DCF" + "8EC9B55A7F88A46B4DB5A851F44182E1C68A007E5E655F6A" + + "FFFFFFFFFFFFFFFF"; + public static readonly DHParameters rfc7919_ffdhe4096 = Rfc7919Parameters(rfc7919_ffdhe4096_p, 325); + + private static readonly string rfc7919_ffdhe6144_p = "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B669E1EF16E6F52C3164DF4FB" + "7930E9E4E58857B6AC7D5F42D69F6D187763CF1D55034004" + + "87F55BA57E31CC7A7135C886EFB4318AED6A1E012D9E6832" + "A907600A918130C46DC778F971AD0038092999A333CB8B7A" + + "1A1DB93D7140003C2A4ECEA9F98D0ACC0A8291CDCEC97DCF" + "8EC9B55A7F88A46B4DB5A851F44182E1C68A007E5E0DD902" + + "0BFD64B645036C7A4E677D2C38532A3A23BA4442CAF53EA6" + "3BB454329B7624C8917BDD64B1C0FD4CB38E8C334C701C3A" + + "CDAD0657FCCFEC719B1F5C3E4E46041F388147FB4CFDB477" + "A52471F7A9A96910B855322EDB6340D8A00EF092350511E3" + + "0ABEC1FFF9E3A26E7FB29F8C183023C3587E38DA0077D9B4" + "763E4E4B94B2BBC194C6651E77CAF992EEAAC0232A281BF6" + + "B3A739C1226116820AE8DB5847A67CBEF9C9091B462D538C" + "D72B03746AE77F5E62292C311562A846505DC82DB854338A" + + "E49F5235C95B91178CCF2DD5CACEF403EC9D1810C6272B04" + "5B3B71F9DC6B80D63FDD4A8E9ADB1E6962A69526D43161C1" + + "A41D570D7938DAD4A40E329CD0E40E65FFFFFFFFFFFFFFFF"; + public static readonly DHParameters rfc7919_ffdhe6144 = Rfc7919Parameters(rfc7919_ffdhe6144_p, 375); + + private static readonly string rfc7919_ffdhe8192_p = "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B669E1EF16E6F52C3164DF4FB" + "7930E9E4E58857B6AC7D5F42D69F6D187763CF1D55034004" + + "87F55BA57E31CC7A7135C886EFB4318AED6A1E012D9E6832" + "A907600A918130C46DC778F971AD0038092999A333CB8B7A" + + "1A1DB93D7140003C2A4ECEA9F98D0ACC0A8291CDCEC97DCF" + "8EC9B55A7F88A46B4DB5A851F44182E1C68A007E5E0DD902" + + "0BFD64B645036C7A4E677D2C38532A3A23BA4442CAF53EA6" + "3BB454329B7624C8917BDD64B1C0FD4CB38E8C334C701C3A" + + "CDAD0657FCCFEC719B1F5C3E4E46041F388147FB4CFDB477" + "A52471F7A9A96910B855322EDB6340D8A00EF092350511E3" + + "0ABEC1FFF9E3A26E7FB29F8C183023C3587E38DA0077D9B4" + "763E4E4B94B2BBC194C6651E77CAF992EEAAC0232A281BF6" + + "B3A739C1226116820AE8DB5847A67CBEF9C9091B462D538C" + "D72B03746AE77F5E62292C311562A846505DC82DB854338A" + + "E49F5235C95B91178CCF2DD5CACEF403EC9D1810C6272B04" + "5B3B71F9DC6B80D63FDD4A8E9ADB1E6962A69526D43161C1" + + "A41D570D7938DAD4A40E329CCFF46AAA36AD004CF600C838" + "1E425A31D951AE64FDB23FCEC9509D43687FEB69EDD1CC5E" + + "0B8CC3BDF64B10EF86B63142A3AB8829555B2F747C932665" + "CB2C0F1CC01BD70229388839D2AF05E454504AC78B758282" + + "2846C0BA35C35F5C59160CC046FD8251541FC68C9C86B022" + "BB7099876A460E7451A8A93109703FEE1C217E6C3826E52C" + + "51AA691E0E423CFC99E9E31650C1217B624816CDAD9A95F9" + "D5B8019488D9C0A0A1FE3075A577E23183F81D4A3F2FA457" + + "1EFC8CE0BA8A4FE8B6855DFE72B0A66EDED2FBABFBE58A30" + "FAFABE1C5D71A87E2F741EF8C1FE86FEA6BBFDE530677F0D" + + "97D11D49F7A8443D0822E506A9F4614E011E2A94838FF88C" + "D68C8BB7C5C6424CFFFFFFFFFFFFFFFF"; + public static readonly DHParameters rfc7919_ffdhe8192 = Rfc7919Parameters(rfc7919_ffdhe8192_p, 400); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHStandardGroups.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHStandardGroups.cs.meta new file mode 100644 index 00000000..ad73ed30 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/DHStandardGroups.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70ce942152c050a419149690a08eec59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHBasicAgreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHBasicAgreement.cs new file mode 100644 index 00000000..7fd1f7fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHBasicAgreement.cs @@ -0,0 +1,78 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + /** + * P1363 7.2.1 ECSVDP-DH + * + * ECSVDP-DH is Elliptic Curve Secret Value Derivation Primitive, + * Diffie-Hellman version. It is based on the work of [DH76], [Mil86], + * and [Kob87]. This primitive derives a shared secret value from one + * party's private key and another party's public key, where both have + * the same set of EC domain parameters. If two parties correctly + * execute this primitive, they will produce the same output. This + * primitive can be invoked by a scheme to derive a shared secret key; + * specifically, it may be used with the schemes ECKAS-DH1 and + * DL/ECKAS-DH2. It assumes that the input keys are valid (see also + * Section 7.2.2). + */ + public class ECDHBasicAgreement + : IBasicAgreement + { + protected internal ECPrivateKeyParameters privKey; + + public virtual void Init( + ICipherParameters parameters) + { + if (parameters is ParametersWithRandom) + { + parameters = ((ParametersWithRandom)parameters).Parameters; + } + + this.privKey = (ECPrivateKeyParameters)parameters; + } + + public virtual int GetFieldSize() + { + return (privKey.Parameters.Curve.FieldSize + 7) / 8; + } + + public virtual BigInteger CalculateAgreement( + ICipherParameters pubKey) + { + ECPublicKeyParameters pub = (ECPublicKeyParameters)pubKey; + ECDomainParameters dp = privKey.Parameters; + if (!dp.Equals(pub.Parameters)) + throw new InvalidOperationException("ECDH public key has wrong domain parameters"); + + BigInteger d = privKey.D; + + // Always perform calculations on the exact curve specified by our private key's parameters + ECPoint Q = ECAlgorithms.CleanPoint(dp.Curve, pub.Q); + if (Q.IsInfinity) + throw new InvalidOperationException("Infinity is not a valid public key for ECDH"); + + BigInteger h = dp.H; + if (!h.Equals(BigInteger.One)) + { + d = dp.HInv.Multiply(d).Mod(dp.N); + Q = ECAlgorithms.ReferenceMultiply(Q, h); + } + + ECPoint P = Q.Multiply(d).Normalize(); + if (P.IsInfinity) + throw new InvalidOperationException("Infinity is not a valid agreement value for ECDH"); + + return P.AffineXCoord.ToBigInteger(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHBasicAgreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHBasicAgreement.cs.meta new file mode 100644 index 00000000..cdce6536 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHBasicAgreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 113c4d3158892b44b9ffa9a028ad0762 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHCBasicAgreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHCBasicAgreement.cs new file mode 100644 index 00000000..947b8ae6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHCBasicAgreement.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + /** + * P1363 7.2.2 ECSVDP-DHC + * + * ECSVDP-DHC is Elliptic Curve Secret Value Derivation Primitive, + * Diffie-Hellman version with cofactor multiplication. It is based on + * the work of [DH76], [Mil86], [Kob87], [LMQ98] and [Kal98a]. This + * primitive derives a shared secret value from one party's private key + * and another party's public key, where both have the same set of EC + * domain parameters. If two parties correctly execute this primitive, + * they will produce the same output. This primitive can be invoked by a + * scheme to derive a shared secret key; specifically, it may be used + * with the schemes ECKAS-DH1 and DL/ECKAS-DH2. It does not assume the + * validity of the input public key (see also Section 7.2.1). + *

+ * Note: As stated P1363 compatibility mode with ECDH can be preset, and + * in this case the implementation doesn't have a ECDH compatibility mode + * (if you want that just use ECDHBasicAgreement and note they both implement + * BasicAgreement!).

+ */ + public class ECDHCBasicAgreement + : IBasicAgreement + { + private ECPrivateKeyParameters privKey; + + public virtual void Init( + ICipherParameters parameters) + { + if (parameters is ParametersWithRandom) + { + parameters = ((ParametersWithRandom) parameters).Parameters; + } + + this.privKey = (ECPrivateKeyParameters)parameters; + } + + public virtual int GetFieldSize() + { + return (privKey.Parameters.Curve.FieldSize + 7) / 8; + } + + public virtual BigInteger CalculateAgreement( + ICipherParameters pubKey) + { + ECPublicKeyParameters pub = (ECPublicKeyParameters)pubKey; + ECDomainParameters dp = privKey.Parameters; + if (!dp.Equals(pub.Parameters)) + throw new InvalidOperationException("ECDHC public key has wrong domain parameters"); + + BigInteger hd = dp.H.Multiply(privKey.D).Mod(dp.N); + + // Always perform calculations on the exact curve specified by our private key's parameters + ECPoint pubPoint = ECAlgorithms.CleanPoint(dp.Curve, pub.Q); + if (pubPoint.IsInfinity) + throw new InvalidOperationException("Infinity is not a valid public key for ECDHC"); + + ECPoint P = pubPoint.Multiply(hd).Normalize(); + if (P.IsInfinity) + throw new InvalidOperationException("Infinity is not a valid agreement value for ECDHC"); + + return P.AffineXCoord.ToBigInteger(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHCBasicAgreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHCBasicAgreement.cs.meta new file mode 100644 index 00000000..228181b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHCBasicAgreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0263cf715bcf72c4ab328faf462a207b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHWithKdfBasicAgreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHWithKdfBasicAgreement.cs new file mode 100644 index 00000000..a1e15339 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHWithKdfBasicAgreement.cs @@ -0,0 +1,67 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Kdf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + public class ECDHWithKdfBasicAgreement + : ECDHBasicAgreement + { + private readonly string algorithm; + private readonly IDerivationFunction kdf; + + public ECDHWithKdfBasicAgreement( + string algorithm, + IDerivationFunction kdf) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + if (kdf == null) + throw new ArgumentNullException("kdf"); + + this.algorithm = algorithm; + this.kdf = kdf; + } + + public override BigInteger CalculateAgreement( + ICipherParameters pubKey) + { + // Note that the ec.KeyAgreement class in JCE only uses kdf in one + // of the engineGenerateSecret methods. + + BigInteger result = base.CalculateAgreement(pubKey); + + int keySize = GeneratorUtilities.GetDefaultKeySize(algorithm); + + DHKdfParameters dhKdfParams = new DHKdfParameters( + new DerObjectIdentifier(algorithm), + keySize, + BigIntToBytes(result)); + + kdf.Init(dhKdfParams); + + byte[] keyBytes = new byte[keySize / 8]; + kdf.GenerateBytes(keyBytes, 0, keyBytes.Length); + + return new BigInteger(1, keyBytes); + } + + private byte[] BigIntToBytes(BigInteger r) + { + int byteLength = X9IntegerConverter.GetByteLength(privKey.Parameters.Curve); + return X9IntegerConverter.IntegerToBytes(r, byteLength); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHWithKdfBasicAgreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHWithKdfBasicAgreement.cs.meta new file mode 100644 index 00000000..0c02a22d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECDHWithKdfBasicAgreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7bbcd424d33a48544b430a90ee0e859d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvBasicAgreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvBasicAgreement.cs new file mode 100644 index 00000000..09229b6f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvBasicAgreement.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + public class ECMqvBasicAgreement + : IBasicAgreement + { + protected internal MqvPrivateParameters privParams; + + public virtual void Init( + ICipherParameters parameters) + { + if (parameters is ParametersWithRandom) + { + parameters = ((ParametersWithRandom)parameters).Parameters; + } + + this.privParams = (MqvPrivateParameters)parameters; + } + + public virtual int GetFieldSize() + { + return (privParams.StaticPrivateKey.Parameters.Curve.FieldSize + 7) / 8; + } + + public virtual BigInteger CalculateAgreement( + ICipherParameters pubKey) + { + MqvPublicParameters pubParams = (MqvPublicParameters)pubKey; + + ECPrivateKeyParameters staticPrivateKey = privParams.StaticPrivateKey; + ECDomainParameters parameters = staticPrivateKey.Parameters; + + if (!parameters.Equals(pubParams.StaticPublicKey.Parameters)) + throw new InvalidOperationException("ECMQV public key components have wrong domain parameters"); + + ECPoint agreement = CalculateMqvAgreement(parameters, staticPrivateKey, + privParams.EphemeralPrivateKey, privParams.EphemeralPublicKey, + pubParams.StaticPublicKey, pubParams.EphemeralPublicKey).Normalize(); + + if (agreement.IsInfinity) + throw new InvalidOperationException("Infinity is not a valid agreement value for MQV"); + + return agreement.AffineXCoord.ToBigInteger(); + } + + // The ECMQV Primitive as described in SEC-1, 3.4 + private static ECPoint CalculateMqvAgreement( + ECDomainParameters parameters, + ECPrivateKeyParameters d1U, + ECPrivateKeyParameters d2U, + ECPublicKeyParameters Q2U, + ECPublicKeyParameters Q1V, + ECPublicKeyParameters Q2V) + { + BigInteger n = parameters.N; + int e = (n.BitLength + 1) / 2; + BigInteger powE = BigInteger.One.ShiftLeft(e); + + ECCurve curve = parameters.Curve; + + ECPoint q2u = ECAlgorithms.CleanPoint(curve, Q2U.Q); + ECPoint q1v = ECAlgorithms.CleanPoint(curve, Q1V.Q); + ECPoint q2v = ECAlgorithms.CleanPoint(curve, Q2V.Q); + + BigInteger x = q2u.AffineXCoord.ToBigInteger(); + BigInteger xBar = x.Mod(powE); + BigInteger Q2UBar = xBar.SetBit(e); + BigInteger s = d1U.D.Multiply(Q2UBar).Add(d2U.D).Mod(n); + + BigInteger xPrime = q2v.AffineXCoord.ToBigInteger(); + BigInteger xPrimeBar = xPrime.Mod(powE); + BigInteger Q2VBar = xPrimeBar.SetBit(e); + + BigInteger hs = parameters.H.Multiply(s).Mod(n); + + return ECAlgorithms.SumOfTwoMultiplies( + q1v, Q2VBar.Multiply(hs).Mod(n), q2v, hs); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvBasicAgreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvBasicAgreement.cs.meta new file mode 100644 index 00000000..e41cd1a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvBasicAgreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7e49c61c5cba8d548ad042204e8f501b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvWithKdfBasicAgreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvWithKdfBasicAgreement.cs new file mode 100644 index 00000000..fc5f4736 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvWithKdfBasicAgreement.cs @@ -0,0 +1,67 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Kdf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + public class ECMqvWithKdfBasicAgreement + : ECMqvBasicAgreement + { + private readonly string algorithm; + private readonly IDerivationFunction kdf; + + public ECMqvWithKdfBasicAgreement( + string algorithm, + IDerivationFunction kdf) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + if (kdf == null) + throw new ArgumentNullException("kdf"); + + this.algorithm = algorithm; + this.kdf = kdf; + } + + public override BigInteger CalculateAgreement( + ICipherParameters pubKey) + { + // Note that the ec.KeyAgreement class in JCE only uses kdf in one + // of the engineGenerateSecret methods. + + BigInteger result = base.CalculateAgreement(pubKey); + + int keySize = GeneratorUtilities.GetDefaultKeySize(algorithm); + + DHKdfParameters dhKdfParams = new DHKdfParameters( + new DerObjectIdentifier(algorithm), + keySize, + BigIntToBytes(result)); + + kdf.Init(dhKdfParams); + + byte[] keyBytes = new byte[keySize / 8]; + kdf.GenerateBytes(keyBytes, 0, keyBytes.Length); + + return new BigInteger(1, keyBytes); + } + + private byte[] BigIntToBytes(BigInteger r) + { + int byteLength = X9IntegerConverter.GetByteLength(privParams.StaticPrivateKey.Parameters.Curve); + return X9IntegerConverter.IntegerToBytes(r, byteLength); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvWithKdfBasicAgreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvWithKdfBasicAgreement.cs.meta new file mode 100644 index 00000000..cfb571a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/ECMqvWithKdfBasicAgreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67f980d3d0ee56d4f912ba8597340259 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/SM2KeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/SM2KeyExchange.cs new file mode 100644 index 00000000..02575c99 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/SM2KeyExchange.cs @@ -0,0 +1,278 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + /// + /// SM2 Key Exchange protocol - based on https://tools.ietf.org/html/draft-shen-sm2-ecdsa-02 + /// + public class SM2KeyExchange + { + private readonly IDigest mDigest; + + private byte[] mUserID; + private ECPrivateKeyParameters mStaticKey; + private ECPoint mStaticPubPoint; + private ECPoint mEphemeralPubPoint; + private ECDomainParameters mECParams; + private int mW; + private ECPrivateKeyParameters mEphemeralKey; + private bool mInitiator; + + public SM2KeyExchange() + : this(new SM3Digest()) + { + } + + public SM2KeyExchange(IDigest digest) + { + this.mDigest = digest; + } + + public virtual void Init(ICipherParameters privParam) + { + SM2KeyExchangePrivateParameters baseParam; + + if (privParam is ParametersWithID) + { + baseParam = (SM2KeyExchangePrivateParameters)((ParametersWithID)privParam).Parameters; + mUserID = ((ParametersWithID)privParam).GetID(); + } + else + { + baseParam = (SM2KeyExchangePrivateParameters)privParam; + mUserID = new byte[0]; + } + + mInitiator = baseParam.IsInitiator; + mStaticKey = baseParam.StaticPrivateKey; + mEphemeralKey = baseParam.EphemeralPrivateKey; + mECParams = mStaticKey.Parameters; + mStaticPubPoint = baseParam.StaticPublicPoint; + mEphemeralPubPoint = baseParam.EphemeralPublicPoint; + mW = mECParams.Curve.FieldSize / 2 - 1; + } + + public virtual byte[] CalculateKey(int kLen, ICipherParameters pubParam) + { + SM2KeyExchangePublicParameters otherPub; + byte[] otherUserID; + + if (pubParam is ParametersWithID) + { + otherPub = (SM2KeyExchangePublicParameters)((ParametersWithID)pubParam).Parameters; + otherUserID = ((ParametersWithID)pubParam).GetID(); + } + else + { + otherPub = (SM2KeyExchangePublicParameters)pubParam; + otherUserID = new byte[0]; + } + + byte[] za = GetZ(mDigest, mUserID, mStaticPubPoint); + byte[] zb = GetZ(mDigest, otherUserID, otherPub.StaticPublicKey.Q); + + ECPoint U = CalculateU(otherPub); + + byte[] rv; + if (mInitiator) + { + rv = Kdf(U, za, zb, kLen); + } + else + { + rv = Kdf(U, zb, za, kLen); + } + + return rv; + } + + public virtual byte[][] CalculateKeyWithConfirmation(int kLen, byte[] confirmationTag, ICipherParameters pubParam) + { + SM2KeyExchangePublicParameters otherPub; + byte[] otherUserID; + + if (pubParam is ParametersWithID) + { + otherPub = (SM2KeyExchangePublicParameters)((ParametersWithID)pubParam).Parameters; + otherUserID = ((ParametersWithID)pubParam).GetID(); + } + else + { + otherPub = (SM2KeyExchangePublicParameters)pubParam; + otherUserID = new byte[0]; + } + + if (mInitiator && confirmationTag == null) + throw new ArgumentException("if initiating, confirmationTag must be set"); + + byte[] za = GetZ(mDigest, mUserID, mStaticPubPoint); + byte[] zb = GetZ(mDigest, otherUserID, otherPub.StaticPublicKey.Q); + + ECPoint U = CalculateU(otherPub); + + byte[] rv; + if (mInitiator) + { + rv = Kdf(U, za, zb, kLen); + + byte[] inner = CalculateInnerHash(mDigest, U, za, zb, mEphemeralPubPoint, otherPub.EphemeralPublicKey.Q); + + byte[] s1 = S1(mDigest, U, inner); + + if (!Arrays.ConstantTimeAreEqual(s1, confirmationTag)) + throw new InvalidOperationException("confirmation tag mismatch"); + + return new byte[][] { rv, S2(mDigest, U, inner)}; + } + else + { + rv = Kdf(U, zb, za, kLen); + + byte[] inner = CalculateInnerHash(mDigest, U, zb, za, otherPub.EphemeralPublicKey.Q, mEphemeralPubPoint); + + return new byte[][] { rv, S1(mDigest, U, inner), S2(mDigest, U, inner) }; + } + } + + protected virtual ECPoint CalculateU(SM2KeyExchangePublicParameters otherPub) + { + ECDomainParameters dp = mStaticKey.Parameters; + + ECPoint p1 = ECAlgorithms.CleanPoint(dp.Curve, otherPub.StaticPublicKey.Q); + ECPoint p2 = ECAlgorithms.CleanPoint(dp.Curve, otherPub.EphemeralPublicKey.Q); + + BigInteger x1 = Reduce(mEphemeralPubPoint.AffineXCoord.ToBigInteger()); + BigInteger x2 = Reduce(p2.AffineXCoord.ToBigInteger()); + BigInteger tA = mStaticKey.D.Add(x1.Multiply(mEphemeralKey.D)); + BigInteger k1 = mECParams.H.Multiply(tA).Mod(mECParams.N); + BigInteger k2 = k1.Multiply(x2).Mod(mECParams.N); + + return ECAlgorithms.SumOfTwoMultiplies(p1, k1, p2, k2).Normalize(); + } + + protected virtual byte[] Kdf(ECPoint u, byte[] za, byte[] zb, int klen) + { + int digestSize = mDigest.GetDigestSize(); + byte[] buf = new byte[System.Math.Max(4, digestSize)]; + byte[] rv = new byte[(klen + 7) / 8]; + int off = 0; + + IMemoable memo = mDigest as IMemoable; + IMemoable copy = null; + + if (memo != null) + { + AddFieldElement(mDigest, u.AffineXCoord); + AddFieldElement(mDigest, u.AffineYCoord); + mDigest.BlockUpdate(za, 0, za.Length); + mDigest.BlockUpdate(zb, 0, zb.Length); + copy = memo.Copy(); + } + + uint ct = 0; + + while (off < rv.Length) + { + if (memo != null) + { + memo.Reset(copy); + } + else + { + AddFieldElement(mDigest, u.AffineXCoord); + AddFieldElement(mDigest, u.AffineYCoord); + mDigest.BlockUpdate(za, 0, za.Length); + mDigest.BlockUpdate(zb, 0, zb.Length); + } + + Pack.UInt32_To_BE(++ct, buf, 0); + mDigest.BlockUpdate(buf, 0, 4); + mDigest.DoFinal(buf, 0); + + int copyLen = System.Math.Min(digestSize, rv.Length - off); + Array.Copy(buf, 0, rv, off, copyLen); + off += copyLen; + } + + return rv; + } + + //x1~=2^w+(x1 AND (2^w-1)) + private BigInteger Reduce(BigInteger x) + { + return x.And(BigInteger.One.ShiftLeft(mW).Subtract(BigInteger.One)).SetBit(mW); + } + + private byte[] S1(IDigest digest, ECPoint u, byte[] inner) + { + digest.Update((byte)0x02); + AddFieldElement(digest, u.AffineYCoord); + digest.BlockUpdate(inner, 0, inner.Length); + + return DigestUtilities.DoFinal(digest); + } + + private byte[] CalculateInnerHash(IDigest digest, ECPoint u, byte[] za, byte[] zb, ECPoint p1, ECPoint p2) + { + AddFieldElement(digest, u.AffineXCoord); + digest.BlockUpdate(za, 0, za.Length); + digest.BlockUpdate(zb, 0, zb.Length); + AddFieldElement(digest, p1.AffineXCoord); + AddFieldElement(digest, p1.AffineYCoord); + AddFieldElement(digest, p2.AffineXCoord); + AddFieldElement(digest, p2.AffineYCoord); + + return DigestUtilities.DoFinal(digest); + } + + private byte[] S2(IDigest digest, ECPoint u, byte[] inner) + { + digest.Update((byte)0x03); + AddFieldElement(digest, u.AffineYCoord); + digest.BlockUpdate(inner, 0, inner.Length); + + return DigestUtilities.DoFinal(digest); + } + + private byte[] GetZ(IDigest digest, byte[] userID, ECPoint pubPoint) + { + AddUserID(digest, userID); + + AddFieldElement(digest, mECParams.Curve.A); + AddFieldElement(digest, mECParams.Curve.B); + AddFieldElement(digest, mECParams.G.AffineXCoord); + AddFieldElement(digest, mECParams.G.AffineYCoord); + AddFieldElement(digest, pubPoint.AffineXCoord); + AddFieldElement(digest, pubPoint.AffineYCoord); + + return DigestUtilities.DoFinal(digest); + } + + private void AddUserID(IDigest digest, byte[] userID) + { + uint len = (uint)(userID.Length * 8); + + digest.Update((byte)(len >> 8)); + digest.Update((byte)len); + digest.BlockUpdate(userID, 0, userID.Length); + } + + private void AddFieldElement(IDigest digest, ECFieldElement v) + { + byte[] p = v.GetEncoded(); + digest.BlockUpdate(p, 0, p.Length); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/SM2KeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/SM2KeyExchange.cs.meta new file mode 100644 index 00000000..77951387 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/SM2KeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c65b4245b6212194cb13060a735041cf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X25519Agreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X25519Agreement.cs new file mode 100644 index 00000000..46aa12cd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X25519Agreement.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + public sealed class X25519Agreement + : IRawAgreement + { + private X25519PrivateKeyParameters privateKey; + + public void Init(ICipherParameters parameters) + { + this.privateKey = (X25519PrivateKeyParameters)parameters; + } + + public int AgreementSize + { + get { return X25519PrivateKeyParameters.SecretSize; } + } + + public void CalculateAgreement(ICipherParameters publicKey, byte[] buf, int off) + { + privateKey.GenerateSecret((X25519PublicKeyParameters)publicKey, buf, off); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X25519Agreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X25519Agreement.cs.meta new file mode 100644 index 00000000..defe92d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X25519Agreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8af8db1542a849649a3f82494db76443 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X448Agreement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X448Agreement.cs new file mode 100644 index 00000000..ffb70b63 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X448Agreement.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement +{ + public sealed class X448Agreement + : IRawAgreement + { + private X448PrivateKeyParameters privateKey; + + public void Init(ICipherParameters parameters) + { + this.privateKey = (X448PrivateKeyParameters)parameters; + } + + public int AgreementSize + { + get { return X448PrivateKeyParameters.SecretSize; } + } + + public void CalculateAgreement(ICipherParameters publicKey, byte[] buf, int off) + { + privateKey.GenerateSecret((X448PublicKeyParameters)publicKey, buf, off); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X448Agreement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X448Agreement.cs.meta new file mode 100644 index 00000000..66e115a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/X448Agreement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ddbf1a879e5a42342899c3c269e0297d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake.meta new file mode 100644 index 00000000..617179cf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97ce8e71bc258e84e8329127d33eb89e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeParticipant.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeParticipant.cs new file mode 100644 index 00000000..f47d82c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeParticipant.cs @@ -0,0 +1,460 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake +{ + /// + /// A participant in a Password Authenticated Key Exchange by Juggling (J-PAKE) exchange. + /// + /// The J-PAKE exchange is defined by Feng Hao and Peter Ryan in the paper + /// + /// "Password Authenticated Key Exchange by Juggling, 2008." + /// + /// The J-PAKE protocol is symmetric. + /// There is no notion of a client or server, but rather just two participants. + /// An instance of JPakeParticipant represents one participant, and + /// is the primary interface for executing the exchange. + /// + /// To execute an exchange, construct a JPakeParticipant on each end, + /// and call the following 7 methods + /// (once and only once, in the given order, for each participant, sending messages between them as described): + /// + /// CreateRound1PayloadToSend() - and send the payload to the other participant + /// ValidateRound1PayloadReceived(JPakeRound1Payload) - use the payload received from the other participant + /// CreateRound2PayloadToSend() - and send the payload to the other participant + /// ValidateRound2PayloadReceived(JPakeRound2Payload) - use the payload received from the other participant + /// CalculateKeyingMaterial() + /// CreateRound3PayloadToSend(BigInteger) - and send the payload to the other participant + /// ValidateRound3PayloadReceived(JPakeRound3Payload, BigInteger) - use the payload received from the other participant + /// + /// Each side should derive a session key from the keying material returned by CalculateKeyingMaterial(). + /// The caller is responsible for deriving the session key using a secure key derivation function (KDF). + /// + /// Round 3 is an optional key confirmation process. + /// If you do not execute round 3, then there is no assurance that both participants are using the same key. + /// (i.e. if the participants used different passwords, then their session keys will differ.) + /// + /// If the round 3 validation succeeds, then the keys are guaranteed to be the same on both sides. + /// + /// The symmetric design can easily support the asymmetric cases when one party initiates the communication. + /// e.g. Sometimes the round1 payload and round2 payload may be sent in one pass. + /// Also, in some cases, the key confirmation payload can be sent together with the round2 payload. + /// These are the trivial techniques to optimize the communication. + /// + /// The key confirmation process is implemented as specified in + /// NIST SP 800-56A Revision 1, + /// Section 8.2 Unilateral Key Confirmation for Key Agreement Schemes. + /// + /// This class is stateful and NOT threadsafe. + /// Each instance should only be used for ONE complete J-PAKE exchange + /// (i.e. a new JPakeParticipant should be constructed for each new J-PAKE exchange). + /// + public class JPakeParticipant + { + // Possible internal states. Used for state checking. + public static readonly int STATE_INITIALIZED = 0; + public static readonly int STATE_ROUND_1_CREATED = 10; + public static readonly int STATE_ROUND_1_VALIDATED = 20; + public static readonly int STATE_ROUND_2_CREATED = 30; + public static readonly int STATE_ROUND_2_VALIDATED = 40; + public static readonly int STATE_KEY_CALCULATED = 50; + public static readonly int STATE_ROUND_3_CREATED = 60; + public static readonly int STATE_ROUND_3_VALIDATED = 70; + + // Unique identifier of this participant. + // The two participants in the exchange must NOT share the same id. + private string participantId; + + // Shared secret. This only contains the secret between construction + // and the call to CalculateKeyingMaterial(). + // + // i.e. When CalculateKeyingMaterial() is called, this buffer overwritten with 0's, + // and the field is set to null. + private char[] password; + + // Digest to use during calculations. + private IDigest digest; + + // Source of secure random data. + private readonly SecureRandom random; + + private readonly BigInteger p; + private readonly BigInteger q; + private readonly BigInteger g; + + // The participantId of the other participant in this exchange. + private string partnerParticipantId; + + // Alice's x1 or Bob's x3. + private BigInteger x1; + // Alice's x2 or Bob's x4. + private BigInteger x2; + // Alice's g^x1 or Bob's g^x3. + private BigInteger gx1; + // Alice's g^x2 or Bob's g^x4. + private BigInteger gx2; + // Alice's g^x3 or Bob's g^x1. + private BigInteger gx3; + // Alice's g^x4 or Bob's g^x2. + private BigInteger gx4; + // Alice's B or Bob's A. + private BigInteger b; + + // The current state. + // See the STATE_* constants for possible values. + private int state; + + /// + /// Convenience constructor for a new JPakeParticipant that uses + /// the JPakePrimeOrderGroups#NIST_3072 prime order group, + /// a SHA-256 digest, and a default SecureRandom implementation. + /// + /// After construction, the State state will be STATE_INITIALIZED. + /// + /// Throws NullReferenceException if any argument is null. Throws + /// ArgumentException if password is empty. + /// + /// Unique identifier of this participant. + /// The two participants in the exchange must NOT share the same id. + /// Shared secret. + /// A defensive copy of this array is made (and cleared once CalculateKeyingMaterial() is called). + /// Caller should clear the input password as soon as possible. + public JPakeParticipant(string participantId, char[] password) + : this(participantId, password, JPakePrimeOrderGroups.NIST_3072) { } + + /// + /// Convenience constructor for a new JPakeParticipant that uses + /// a SHA-256 digest, and a default SecureRandom implementation. + /// + /// After construction, the State state will be STATE_INITIALIZED. + /// + /// Throws NullReferenceException if any argument is null. Throws + /// ArgumentException if password is empty. + /// + /// Unique identifier of this participant. + /// The two participants in the exchange must NOT share the same id. + /// Shared secret. + /// A defensive copy of this array is made (and cleared once CalculateKeyingMaterial() is called). + /// Caller should clear the input password as soon as possible. + /// Prime order group. See JPakePrimeOrderGroups for standard groups. + public JPakeParticipant(string participantId, char[] password, JPakePrimeOrderGroup group) + : this(participantId, password, group, new Sha256Digest(), new SecureRandom()) { } + + + /// + /// Constructor for a new JPakeParticipant. + /// + /// After construction, the State state will be STATE_INITIALIZED. + /// + /// Throws NullReferenceException if any argument is null. Throws + /// ArgumentException if password is empty. + /// + /// Unique identifier of this participant. + /// The two participants in the exchange must NOT share the same id. + /// Shared secret. + /// A defensive copy of this array is made (and cleared once CalculateKeyingMaterial() is called). + /// Caller should clear the input password as soon as possible. + /// Prime order group. See JPakePrimeOrderGroups for standard groups. + /// Digest to use during zero knowledge proofs and key confirmation + /// (SHA-256 or stronger preferred). + /// Source of secure random data for x1 and x2, and for the zero knowledge proofs. + public JPakeParticipant(string participantId, char[] password, JPakePrimeOrderGroup group, IDigest digest, SecureRandom random) + { + JPakeUtilities.ValidateNotNull(participantId, "participantId"); + JPakeUtilities.ValidateNotNull(password, "password"); + JPakeUtilities.ValidateNotNull(group, "p"); + JPakeUtilities.ValidateNotNull(digest, "digest"); + JPakeUtilities.ValidateNotNull(random, "random"); + + if (password.Length == 0) + { + throw new ArgumentException("Password must not be empty."); + } + + this.participantId = participantId; + + // Create a defensive copy so as to fully encapsulate the password. + // + // This array will contain the password for the lifetime of this + // participant BEFORE CalculateKeyingMaterial() is called. + // + // i.e. When CalculateKeyingMaterial() is called, the array will be cleared + // in order to remove the password from memory. + // + // The caller is responsible for clearing the original password array + // given as input to this constructor. + this.password = new char[password.Length]; + Array.Copy(password, this.password, password.Length); + + this.p = group.P; + this.q = group.Q; + this.g = group.G; + + this.digest = digest; + this.random = random; + + this.state = STATE_INITIALIZED; + } + + /// + /// Gets the current state of this participant. + /// See the STATE_* constants for possible values. + /// + public virtual int State + { + get { return state; } + } + + + /// + /// Creates and returns the payload to send to the other participant during round 1. + /// + /// After execution, the State state} will be STATE_ROUND_1_CREATED}. + /// + public virtual JPakeRound1Payload CreateRound1PayloadToSend() + { + if (this.state >= STATE_ROUND_1_CREATED) + throw new InvalidOperationException("Round 1 payload already created for " + this.participantId); + + this.x1 = JPakeUtilities.GenerateX1(q, random); + this.x2 = JPakeUtilities.GenerateX2(q, random); + + this.gx1 = JPakeUtilities.CalculateGx(p, g, x1); + this.gx2 = JPakeUtilities.CalculateGx(p, g, x2); + BigInteger[] knowledgeProofForX1 = JPakeUtilities.CalculateZeroKnowledgeProof(p, q, g, gx1, x1, participantId, digest, random); + BigInteger[] knowledgeProofForX2 = JPakeUtilities.CalculateZeroKnowledgeProof(p, q, g, gx2, x2, participantId, digest, random); + + this.state = STATE_ROUND_1_CREATED; + + return new JPakeRound1Payload(participantId, gx1, gx2, knowledgeProofForX1, knowledgeProofForX2); + } + + /// + /// Validates the payload received from the other participant during round 1. + /// + /// Must be called prior to CreateRound2PayloadToSend(). + /// + /// After execution, the State state will be STATE_ROUND_1_VALIDATED. + /// + /// Throws CryptoException if validation fails. Throws InvalidOperationException + /// if called multiple times. + /// + public virtual void ValidateRound1PayloadReceived(JPakeRound1Payload round1PayloadReceived) + { + if (this.state >= STATE_ROUND_1_VALIDATED) + throw new InvalidOperationException("Validation already attempted for round 1 payload for " + this.participantId); + + this.partnerParticipantId = round1PayloadReceived.ParticipantId; + this.gx3 = round1PayloadReceived.Gx1; + this.gx4 = round1PayloadReceived.Gx2; + + BigInteger[] knowledgeProofForX3 = round1PayloadReceived.KnowledgeProofForX1; + BigInteger[] knowledgeProofForX4 = round1PayloadReceived.KnowledgeProofForX2; + + JPakeUtilities.ValidateParticipantIdsDiffer(participantId, round1PayloadReceived.ParticipantId); + JPakeUtilities.ValidateGx4(gx4); + JPakeUtilities.ValidateZeroKnowledgeProof(p, q, g, gx3, knowledgeProofForX3, round1PayloadReceived.ParticipantId, digest); + JPakeUtilities.ValidateZeroKnowledgeProof(p, q, g, gx4, knowledgeProofForX4, round1PayloadReceived.ParticipantId, digest); + this.state = STATE_ROUND_1_VALIDATED; + } + + /// + /// Creates and returns the payload to send to the other participant during round 2. + /// + /// ValidateRound1PayloadReceived(JPakeRound1Payload) must be called prior to this method. + /// + /// After execution, the State state will be STATE_ROUND_2_CREATED. + /// + /// Throws InvalidOperationException if called prior to ValidateRound1PayloadReceived(JPakeRound1Payload), or multiple times + /// + public virtual JPakeRound2Payload CreateRound2PayloadToSend() + { + if (this.state >= STATE_ROUND_2_CREATED) + throw new InvalidOperationException("Round 2 payload already created for " + this.participantId); + if (this.state < STATE_ROUND_1_VALIDATED) + throw new InvalidOperationException("Round 1 payload must be validated prior to creating round 2 payload for " + this.participantId); + + BigInteger gA = JPakeUtilities.CalculateGA(p, gx1, gx3, gx4); + BigInteger s = JPakeUtilities.CalculateS(password); + BigInteger x2s = JPakeUtilities.CalculateX2s(q, x2, s); + BigInteger A = JPakeUtilities.CalculateA(p, q, gA, x2s); + BigInteger[] knowledgeProofForX2s = JPakeUtilities.CalculateZeroKnowledgeProof(p, q, gA, A, x2s, participantId, digest, random); + + this.state = STATE_ROUND_2_CREATED; + + return new JPakeRound2Payload(participantId, A, knowledgeProofForX2s); + } + + /// + /// Validates the payload received from the other participant during round 2. + /// Note that this DOES NOT detect a non-common password. + /// The only indication of a non-common password is through derivation + /// of different keys (which can be detected explicitly by executing round 3 and round 4) + /// + /// Must be called prior to CalculateKeyingMaterial(). + /// + /// After execution, the State state will be STATE_ROUND_2_VALIDATED. + /// + /// Throws CryptoException if validation fails. Throws + /// InvalidOperationException if called prior to ValidateRound1PayloadReceived(JPakeRound1Payload), or multiple times + /// + public virtual void ValidateRound2PayloadReceived(JPakeRound2Payload round2PayloadReceived) + { + if (this.state >= STATE_ROUND_2_VALIDATED) + throw new InvalidOperationException("Validation already attempted for round 2 payload for " + this.participantId); + if (this.state < STATE_ROUND_1_VALIDATED) + throw new InvalidOperationException("Round 1 payload must be validated prior to validation round 2 payload for " + this.participantId); + + BigInteger gB = JPakeUtilities.CalculateGA(p, gx3, gx1, gx2); + this.b = round2PayloadReceived.A; + BigInteger[] knowledgeProofForX4s = round2PayloadReceived.KnowledgeProofForX2s; + + JPakeUtilities.ValidateParticipantIdsDiffer(participantId, round2PayloadReceived.ParticipantId); + JPakeUtilities.ValidateParticipantIdsEqual(this.partnerParticipantId, round2PayloadReceived.ParticipantId); + JPakeUtilities.ValidateGa(gB); + JPakeUtilities.ValidateZeroKnowledgeProof(p, q, gB, b, knowledgeProofForX4s, round2PayloadReceived.ParticipantId, digest); + + this.state = STATE_ROUND_2_VALIDATED; + } + + /// + /// Calculates and returns the key material. + /// A session key must be derived from this key material using a secure key derivation function (KDF). + /// The KDF used to derive the key is handled externally (i.e. not by JPakeParticipant). + /// + /// The keying material will be identical for each participant if and only if + /// each participant's password is the same. i.e. If the participants do not + /// share the same password, then each participant will derive a different key. + /// Therefore, if you immediately start using a key derived from + /// the keying material, then you must handle detection of incorrect keys. + /// If you want to handle this detection explicitly, you can optionally perform + /// rounds 3 and 4. See JPakeParticipant for details on how to execute + /// rounds 3 and 4. + /// + /// The keying material will be in the range [0, p-1]. + /// + /// ValidateRound2PayloadReceived(JPakeRound2Payload) must be called prior to this method. + /// + /// As a side effect, the internal password array is cleared, since it is no longer needed. + /// + /// After execution, the State state will be STATE_KEY_CALCULATED. + /// + /// Throws InvalidOperationException if called prior to ValidateRound2PayloadReceived(JPakeRound2Payload), + /// or if called multiple times. + /// + public virtual BigInteger CalculateKeyingMaterial() + { + if (this.state >= STATE_KEY_CALCULATED) + throw new InvalidOperationException("Key already calculated for " + participantId); + if (this.state < STATE_ROUND_2_VALIDATED) + throw new InvalidOperationException("Round 2 payload must be validated prior to creating key for " + participantId); + + BigInteger s = JPakeUtilities.CalculateS(password); + + // Clear the password array from memory, since we don't need it anymore. + // Also set the field to null as a flag to indicate that the key has already been calculated. + Array.Clear(password, 0, password.Length); + this.password = null; + + BigInteger keyingMaterial = JPakeUtilities.CalculateKeyingMaterial(p, q, gx4, x2, s, b); + + // Clear the ephemeral private key fields as well. + // Note that we're relying on the garbage collector to do its job to clean these up. + // The old objects will hang around in memory until the garbage collector destroys them. + // + // If the ephemeral private keys x1 and x2 are leaked, + // the attacker might be able to brute-force the password. + this.x1 = null; + this.x2 = null; + this.b = null; + + // Do not clear gx* yet, since those are needed by round 3. + + this.state = STATE_KEY_CALCULATED; + + return keyingMaterial; + } + + /// + /// Creates and returns the payload to send to the other participant during round 3. + /// + /// See JPakeParticipant for more details on round 3. + /// + /// After execution, the State state} will be STATE_ROUND_3_CREATED. + /// Throws InvalidOperationException if called prior to CalculateKeyingMaterial, or multiple + /// times. + /// + /// The keying material as returned from CalculateKeyingMaterial(). + public virtual JPakeRound3Payload CreateRound3PayloadToSend(BigInteger keyingMaterial) + { + if (this.state >= STATE_ROUND_3_CREATED) + throw new InvalidOperationException("Round 3 payload already created for " + this.participantId); + if (this.state < STATE_KEY_CALCULATED) + throw new InvalidOperationException("Keying material must be calculated prior to creating round 3 payload for " + this.participantId); + + BigInteger macTag = JPakeUtilities.CalculateMacTag( + this.participantId, + this.partnerParticipantId, + this.gx1, + this.gx2, + this.gx3, + this.gx4, + keyingMaterial, + this.digest); + + this.state = STATE_ROUND_3_CREATED; + + return new JPakeRound3Payload(participantId, macTag); + } + + /// + /// Validates the payload received from the other participant during round 3. + /// + /// See JPakeParticipant for more details on round 3. + /// + /// After execution, the State state will be STATE_ROUND_3_VALIDATED. + /// + /// Throws CryptoException if validation fails. Throws InvalidOperationException if called prior to + /// CalculateKeyingMaterial or multiple times + /// + /// The round 3 payload received from the other participant. + /// The keying material as returned from CalculateKeyingMaterial(). + public virtual void ValidateRound3PayloadReceived(JPakeRound3Payload round3PayloadReceived, BigInteger keyingMaterial) + { + if (this.state >= STATE_ROUND_3_VALIDATED) + throw new InvalidOperationException("Validation already attempted for round 3 payload for " + this.participantId); + if (this.state < STATE_KEY_CALCULATED) + throw new InvalidOperationException("Keying material must be calculated prior to validating round 3 payload for " + this.participantId); + + JPakeUtilities.ValidateParticipantIdsDiffer(participantId, round3PayloadReceived.ParticipantId); + JPakeUtilities.ValidateParticipantIdsEqual(this.partnerParticipantId, round3PayloadReceived.ParticipantId); + + JPakeUtilities.ValidateMacTag( + this.participantId, + this.partnerParticipantId, + this.gx1, + this.gx2, + this.gx3, + this.gx4, + keyingMaterial, + this.digest, + round3PayloadReceived.MacTag); + + // Clear the rest of the fields. + this.gx1 = null; + this.gx2 = null; + this.gx3 = null; + this.gx4 = null; + + this.state = STATE_ROUND_3_VALIDATED; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeParticipant.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeParticipant.cs.meta new file mode 100644 index 00000000..6e8d86e3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeParticipant.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a86105cd9524ff40925c8a6fa7cb124 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroup.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroup.cs new file mode 100644 index 00000000..42107e13 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroup.cs @@ -0,0 +1,107 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake +{ + /// + /// A pre-computed prime order group for use during a J-PAKE exchange. + /// + /// Typically a Schnorr group is used. In general, J-PAKE can use any prime order group + /// that is suitable for public key cryptography, including elliptic curve cryptography. + /// + /// See JPakePrimeOrderGroups for convenient standard groups. + /// + /// NIST publishes + /// many groups that can be used for the desired level of security. + /// + public class JPakePrimeOrderGroup + { + private readonly BigInteger p; + private readonly BigInteger q; + private readonly BigInteger g; + + /// + /// Constructs a new JPakePrimeOrderGroup. + /// + /// In general, you should use one of the pre-approved groups from + /// JPakePrimeOrderGroups, rather than manually constructing one. + /// + /// The following basic checks are performed: + /// + /// p-1 must be evenly divisible by q + /// g must be in [2, p-1] + /// g^q mod p must equal 1 + /// p must be prime (within reasonably certainty) + /// q must be prime (within reasonably certainty) + /// + /// The prime checks are performed using BigInteger#isProbablePrime(int), + /// and are therefore subject to the same probability guarantees. + /// + /// These checks prevent trivial mistakes. + /// However, due to the small uncertainties if p and q are not prime, + /// advanced attacks are not prevented. + /// Use it at your own risk. + /// + /// Throws NullReferenceException if any argument is null. Throws + /// InvalidOperationException is any of the above validations fail. + /// + public JPakePrimeOrderGroup(BigInteger p, BigInteger q, BigInteger g) + : this(p, q, g, false) + { + // Don't skip the checks on user-specified groups. + } + + /// + /// Constructor used by the pre-approved groups in JPakePrimeOrderGroups. + /// These pre-approved groups can avoid the expensive checks. + /// User-specified groups should not use this constructor. + /// + public JPakePrimeOrderGroup(BigInteger p, BigInteger q, BigInteger g, bool skipChecks) + { + JPakeUtilities.ValidateNotNull(p, "p"); + JPakeUtilities.ValidateNotNull(q, "q"); + JPakeUtilities.ValidateNotNull(g, "g"); + + if (!skipChecks) + { + if (!p.Subtract(JPakeUtilities.One).Mod(q).Equals(JPakeUtilities.Zero)) + throw new ArgumentException("p-1 must be evenly divisible by q"); + if (g.CompareTo(BigInteger.Two) == -1 || g.CompareTo(p.Subtract(JPakeUtilities.One)) == 1) + throw new ArgumentException("g must be in [2, p-1]"); + if (!g.ModPow(q, p).Equals(JPakeUtilities.One)) + throw new ArgumentException("g^q mod p must equal 1"); + + // Note these checks do not guarantee that p and q are prime. + // We just have reasonable certainty that they are prime. + if (!p.IsProbablePrime(20)) + throw new ArgumentException("p must be prime"); + if (!q.IsProbablePrime(20)) + throw new ArgumentException("q must be prime"); + } + + this.p = p; + this.q = q; + this.g = g; + } + + public virtual BigInteger P + { + get { return p; } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public virtual BigInteger G + { + get { return g; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroup.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroup.cs.meta new file mode 100644 index 00000000..5f78d44a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 815a3d26dbbb4e047a319b26542acdb1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroups.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroups.cs new file mode 100644 index 00000000..1d1a92f2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroups.cs @@ -0,0 +1,112 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake +{ + /// + /// Standard pre-computed prime order groups for use by J-PAKE. + /// (J-PAKE can use pre-computed prime order groups, same as DSA and Diffie-Hellman.) + ///

+ /// This class contains some convenient constants for use as input for + /// constructing {@link JPAKEParticipant}s. + ///

+ /// The prime order groups below are taken from Sun's JDK JavaDoc (docs/guide/security/CryptoSpec.html#AppB), + /// and from the prime order groups + /// published by NIST. + ///

+ public class JPakePrimeOrderGroups + { + /// + /// From Sun's JDK JavaDoc (docs/guide/security/CryptoSpec.html#AppB) + /// 1024-bit p, 160-bit q and 1024-bit g for 80-bit security. + /// + public static readonly JPakePrimeOrderGroup SUN_JCE_1024 = new JPakePrimeOrderGroup( + // p + new BigInteger( + "fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669" + + "455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b7" + + "6b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb" + + "83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c7", 16), + // q + new BigInteger("9760508f15230bccb292b982a2eb840bf0581cf5", 16), + // g + new BigInteger( + "f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d078267" + + "5159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e1" + + "3c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243b" + + "cca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a", 16), + true + ); + + /// + /// From NIST. + /// 2048-bit p, 224-bit q and 2048-bit g for 112-bit security. + /// + public static readonly JPakePrimeOrderGroup NIST_2048 = new JPakePrimeOrderGroup( + // p + new BigInteger( + "C196BA05AC29E1F9C3C72D56DFFC6154A033F1477AC88EC37F09BE6C5BB95F51" + + "C296DD20D1A28A067CCC4D4316A4BD1DCA55ED1066D438C35AEBAABF57E7DAE4" + + "28782A95ECA1C143DB701FD48533A3C18F0FE23557EA7AE619ECACC7E0B51652" + + "A8776D02A425567DED36EABD90CA33A1E8D988F0BBB92D02D1D20290113BB562" + + "CE1FC856EEB7CDD92D33EEA6F410859B179E7E789A8F75F645FAE2E136D252BF" + + "FAFF89528945C1ABE705A38DBC2D364AADE99BE0D0AAD82E5320121496DC65B3" + + "930E38047294FF877831A16D5228418DE8AB275D7D75651CEFED65F78AFC3EA7" + + "FE4D79B35F62A0402A1117599ADAC7B269A59F353CF450E6982D3B1702D9CA83", 16), + // q + new BigInteger("90EAF4D1AF0708B1B612FF35E0A2997EB9E9D263C9CE659528945C0D", 16), + // g + new BigInteger( + "A59A749A11242C58C894E9E5A91804E8FA0AC64B56288F8D47D51B1EDC4D6544" + + "4FECA0111D78F35FC9FDD4CB1F1B79A3BA9CBEE83A3F811012503C8117F98E50" + + "48B089E387AF6949BF8784EBD9EF45876F2E6A5A495BE64B6E770409494B7FEE" + + "1DBB1E4B2BC2A53D4F893D418B7159592E4FFFDF6969E91D770DAEBD0B5CB14C" + + "00AD68EC7DC1E5745EA55C706C4A1C5C88964E34D09DEB753AD418C1AD0F4FDF" + + "D049A955E5D78491C0B7A2F1575A008CCD727AB376DB6E695515B05BD412F5B8" + + "C2F4C77EE10DA48ABD53F5DD498927EE7B692BBBCDA2FB23A516C5B4533D7398" + + "0B2A3B60E384ED200AE21B40D273651AD6060C13D97FD69AA13C5611A51B9085", 16), + true + ); + + /// + /// From NIST. + /// 3072-bit p, 256-bit q and 3072-bit g for 128-bit security. + /// + public static readonly JPakePrimeOrderGroup NIST_3072 = new JPakePrimeOrderGroup( + // p + new BigInteger( + "90066455B5CFC38F9CAA4A48B4281F292C260FEEF01FD61037E56258A7795A1C" + + "7AD46076982CE6BB956936C6AB4DCFE05E6784586940CA544B9B2140E1EB523F" + + "009D20A7E7880E4E5BFA690F1B9004A27811CD9904AF70420EEFD6EA11EF7DA1" + + "29F58835FF56B89FAA637BC9AC2EFAAB903402229F491D8D3485261CD068699B" + + "6BA58A1DDBBEF6DB51E8FE34E8A78E542D7BA351C21EA8D8F1D29F5D5D159394" + + "87E27F4416B0CA632C59EFD1B1EB66511A5A0FBF615B766C5862D0BD8A3FE7A0" + + "E0DA0FB2FE1FCB19E8F9996A8EA0FCCDE538175238FC8B0EE6F29AF7F642773E" + + "BE8CD5402415A01451A840476B2FCEB0E388D30D4B376C37FE401C2A2C2F941D" + + "AD179C540C1C8CE030D460C4D983BE9AB0B20F69144C1AE13F9383EA1C08504F" + + "B0BF321503EFE43488310DD8DC77EC5B8349B8BFE97C2C560EA878DE87C11E3D" + + "597F1FEA742D73EEC7F37BE43949EF1A0D15C3F3E3FC0A8335617055AC91328E" + + "C22B50FC15B941D3D1624CD88BC25F3E941FDDC6200689581BFEC416B4B2CB73", 16), + // q + new BigInteger("CFA0478A54717B08CE64805B76E5B14249A77A4838469DF7F7DC987EFCCFB11D", 16), + // g + new BigInteger( + "5E5CBA992E0A680D885EB903AEA78E4A45A469103D448EDE3B7ACCC54D521E37" + + "F84A4BDD5B06B0970CC2D2BBB715F7B82846F9A0C393914C792E6A923E2117AB" + + "805276A975AADB5261D91673EA9AAFFEECBFA6183DFCB5D3B7332AA19275AFA1" + + "F8EC0B60FB6F66CC23AE4870791D5982AAD1AA9485FD8F4A60126FEB2CF05DB8" + + "A7F0F09B3397F3937F2E90B9E5B9C9B6EFEF642BC48351C46FB171B9BFA9EF17" + + "A961CE96C7E7A7CC3D3D03DFAD1078BA21DA425198F07D2481622BCE45969D9C" + + "4D6063D72AB7A0F08B2F49A7CC6AF335E08C4720E31476B67299E231F8BD90B3" + + "9AC3AE3BE0C6B6CACEF8289A2E2873D58E51E029CAFBD55E6841489AB66B5B4B" + + "9BA6E2F784660896AFF387D92844CCB8B69475496DE19DA2E58259B090489AC8" + + "E62363CDF82CFD8EF2A427ABCD65750B506F56DDE3B988567A88126B914D7828" + + "E2B63A6D7ED0747EC59E0E0A23CE7D8A74C1D2C2A7AFB6A29799620F00E11C33" + + "787F7DED3B30E1A22D09F1FBDA1ABBBFBF25CAE05A13F812E34563F99410E73B", 16), + true + ); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroups.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroups.cs.meta new file mode 100644 index 00000000..fac13fdf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakePrimeOrderGroups.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13d01b3239aa0c7408aecd78c5976f60 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound1Payload.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound1Payload.cs new file mode 100644 index 00000000..38c31fba --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound1Payload.cs @@ -0,0 +1,105 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake +{ + /// + /// The payload sent/received during the first round of a J-PAKE exchange. + /// + /// Each JPAKEParticipant creates and sends an instance of this payload to + /// the other. The payload to send should be created via + /// JPAKEParticipant.CreateRound1PayloadToSend(). + /// + /// Each participant must also validate the payload received from the other. + /// The received payload should be validated via + /// JPAKEParticipant.ValidateRound1PayloadReceived(JPakeRound1Payload). + /// + public class JPakeRound1Payload + { + /// + /// The id of the JPAKEParticipant who created/sent this payload. + /// + private readonly string participantId; + + /// + /// The value of g^x1 + /// + private readonly BigInteger gx1; + + /// + /// The value of g^x2 + /// + private readonly BigInteger gx2; + + /// + /// The zero knowledge proof for x1. + /// + /// This is a two element array, containing {g^v, r} for x1. + /// + private readonly BigInteger[] knowledgeProofForX1; + + /// + /// The zero knowledge proof for x2. + /// + /// This is a two element array, containing {g^v, r} for x2. + /// + private readonly BigInteger[] knowledgeProofForX2; + + public JPakeRound1Payload(string participantId, BigInteger gx1, BigInteger gx2, BigInteger[] knowledgeProofForX1, BigInteger[] knowledgeProofForX2) + { + JPakeUtilities.ValidateNotNull(participantId, "participantId"); + JPakeUtilities.ValidateNotNull(gx1, "gx1"); + JPakeUtilities.ValidateNotNull(gx2, "gx2"); + JPakeUtilities.ValidateNotNull(knowledgeProofForX1, "knowledgeProofForX1"); + JPakeUtilities.ValidateNotNull(knowledgeProofForX2, "knowledgeProofForX2"); + + this.participantId = participantId; + this.gx1 = gx1; + this.gx2 = gx2; + this.knowledgeProofForX1 = new BigInteger[knowledgeProofForX1.Length]; + Array.Copy(knowledgeProofForX1, this.knowledgeProofForX1, knowledgeProofForX1.Length); + this.knowledgeProofForX2 = new BigInteger[knowledgeProofForX2.Length]; + Array.Copy(knowledgeProofForX2, this.knowledgeProofForX2, knowledgeProofForX2.Length); + } + + public virtual string ParticipantId + { + get { return participantId; } + } + + public virtual BigInteger Gx1 + { + get { return gx1; } + } + + public virtual BigInteger Gx2 + { + get { return gx2; } + } + + public virtual BigInteger[] KnowledgeProofForX1 + { + get + { + BigInteger[] kp = new BigInteger[knowledgeProofForX1.Length]; + Array.Copy(knowledgeProofForX1, kp, knowledgeProofForX1.Length); + return kp; + } + } + + public virtual BigInteger[] KnowledgeProofForX2 + { + get + { + BigInteger[] kp = new BigInteger[knowledgeProofForX2.Length]; + Array.Copy(knowledgeProofForX2, kp, knowledgeProofForX2.Length); + return kp; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound1Payload.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound1Payload.cs.meta new file mode 100644 index 00000000..4bd2b84d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound1Payload.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7fc56df6fc654ef4bb43c5563964146f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound2Payload.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound2Payload.cs new file mode 100644 index 00000000..5e900653 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound2Payload.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake +{ + /// + /// The payload sent/received during the second round of a J-PAKE exchange. + /// + /// Each JPAKEParticipant creates and sends an instance + /// of this payload to the other JPAKEParticipant. + /// The payload to send should be created via + /// JPAKEParticipant#createRound2PayloadToSend() + /// + /// Each JPAKEParticipant must also validate the payload + /// received from the other JPAKEParticipant. + /// The received payload should be validated via + /// JPAKEParticipant#validateRound2PayloadReceived(JPakeRound2Payload) + /// + public class JPakeRound2Payload + { + /// + /// The id of the JPAKEParticipant who created/sent this payload. + /// + private readonly string participantId; + + /// + /// The value of A, as computed during round 2. + /// + private readonly BigInteger a; + + /// + /// The zero knowledge proof for x2 * s. + /// + /// This is a two element array, containing {g^v, r} for x2 * s. + /// + private readonly BigInteger[] knowledgeProofForX2s; + + public JPakeRound2Payload(string participantId, BigInteger a, BigInteger[] knowledgeProofForX2s) + { + JPakeUtilities.ValidateNotNull(participantId, "participantId"); + JPakeUtilities.ValidateNotNull(a, "a"); + JPakeUtilities.ValidateNotNull(knowledgeProofForX2s, "knowledgeProofForX2s"); + + this.participantId = participantId; + this.a = a; + this.knowledgeProofForX2s = new BigInteger[knowledgeProofForX2s.Length]; + knowledgeProofForX2s.CopyTo(this.knowledgeProofForX2s, 0); + } + + public virtual string ParticipantId + { + get { return participantId; } + } + + public virtual BigInteger A + { + get { return a; } + } + + public virtual BigInteger[] KnowledgeProofForX2s + { + get + { + BigInteger[] kp = new BigInteger[knowledgeProofForX2s.Length]; + Array.Copy(knowledgeProofForX2s, kp, knowledgeProofForX2s.Length); + return kp; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound2Payload.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound2Payload.cs.meta new file mode 100644 index 00000000..f5e1f9a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound2Payload.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1d38ef449df8e44a932211b157b405c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound3Payload.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound3Payload.cs new file mode 100644 index 00000000..e98a53a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound3Payload.cs @@ -0,0 +1,55 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake +{ + /// + /// The payload sent/received during the optional third round of a J-PAKE exchange, + /// which is for explicit key confirmation. + /// + /// Each JPAKEParticipant creates and sends an instance + /// of this payload to the other JPAKEParticipant. + /// The payload to send should be created via + /// JPAKEParticipant#createRound3PayloadToSend(BigInteger) + /// + /// Eeach JPAKEParticipant must also validate the payload + /// received from the other JPAKEParticipant. + /// The received payload should be validated via + /// JPAKEParticipant#validateRound3PayloadReceived(JPakeRound3Payload, BigInteger) + /// + public class JPakeRound3Payload + { + /// + /// The id of the {@link JPAKEParticipant} who created/sent this payload. + /// + private readonly string participantId; + + /// + /// The value of MacTag, as computed by round 3. + /// + /// See JPAKEUtil#calculateMacTag(string, string, BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, org.bouncycastle.crypto.Digest) + /// + private readonly BigInteger macTag; + + public JPakeRound3Payload(string participantId, BigInteger magTag) + { + this.participantId = participantId; + this.macTag = magTag; + } + + public virtual string ParticipantId + { + get { return participantId; } + } + + public virtual BigInteger MacTag + { + get { return macTag; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound3Payload.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound3Payload.cs.meta new file mode 100644 index 00000000..b7fb8040 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeRound3Payload.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 569e3cdfa1c67e04090ea2d99c91f427 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeUtilities.cs new file mode 100644 index 00000000..d2c84c31 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeUtilities.cs @@ -0,0 +1,394 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.JPake +{ + /// + /// Primitives needed for a J-PAKE exchange. + /// + /// The recommended way to perform a J-PAKE exchange is by using + /// two JPAKEParticipants. Internally, those participants + /// call these primitive operations in JPakeUtilities. + /// + /// The primitives, however, can be used without a JPAKEParticipant if needed. + /// + public abstract class JPakeUtilities + { + public static readonly BigInteger Zero = BigInteger.Zero; + public static readonly BigInteger One = BigInteger.One; + + /// + /// Return a value that can be used as x1 or x3 during round 1. + /// The returned value is a random value in the range [0, q-1]. + /// + public static BigInteger GenerateX1(BigInteger q, SecureRandom random) + { + BigInteger min = Zero; + BigInteger max = q.Subtract(One); + return BigIntegers.CreateRandomInRange(min, max, random); + } + + /// + /// Return a value that can be used as x2 or x4 during round 1. + /// The returned value is a random value in the range [1, q-1]. + /// + public static BigInteger GenerateX2(BigInteger q, SecureRandom random) + { + BigInteger min = One; + BigInteger max = q.Subtract(One); + return BigIntegers.CreateRandomInRange(min, max, random); + } + + /// + /// Converts the given password to a BigInteger + /// for use in arithmetic calculations. + /// + public static BigInteger CalculateS(char[] password) + { + return new BigInteger(Encoding.UTF8.GetBytes(password)); + } + + /// + /// Calculate g^x mod p as done in round 1. + /// + public static BigInteger CalculateGx(BigInteger p, BigInteger g, BigInteger x) + { + return g.ModPow(x, p); + } + + /// + /// Calculate ga as done in round 2. + /// + public static BigInteger CalculateGA(BigInteger p, BigInteger gx1, BigInteger gx3, BigInteger gx4) + { + // ga = g^(x1+x3+x4) = g^x1 * g^x3 * g^x4 + return gx1.Multiply(gx3).Multiply(gx4).Mod(p); + } + + /// + /// Calculate x2 * s as done in round 2. + /// + public static BigInteger CalculateX2s(BigInteger q, BigInteger x2, BigInteger s) + { + return x2.Multiply(s).Mod(q); + } + + /// + /// Calculate A as done in round 2. + /// + public static BigInteger CalculateA(BigInteger p, BigInteger q, BigInteger gA, BigInteger x2s) + { + // A = ga^(x*s) + return gA.ModPow(x2s, p); + } + + /// + /// Calculate a zero knowledge proof of x using Schnorr's signature. + /// The returned array has two elements {g^v, r = v-x*h} for x. + /// + public static BigInteger[] CalculateZeroKnowledgeProof(BigInteger p, BigInteger q, BigInteger g, + BigInteger gx, BigInteger x, string participantId, IDigest digest, SecureRandom random) + { + /* Generate a random v, and compute g^v */ + BigInteger vMin = Zero; + BigInteger vMax = q.Subtract(One); + BigInteger v = BigIntegers.CreateRandomInRange(vMin, vMax, random); + + BigInteger gv = g.ModPow(v, p); + BigInteger h = CalculateHashForZeroKnowledgeProof(g, gv, gx, participantId, digest); // h + + return new BigInteger[] + { + gv, + v.Subtract(x.Multiply(h)).Mod(q) // r = v-x*h + }; + } + + private static BigInteger CalculateHashForZeroKnowledgeProof(BigInteger g, BigInteger gr, BigInteger gx, + string participantId, IDigest digest) + { + digest.Reset(); + + UpdateDigestIncludingSize(digest, g); + + UpdateDigestIncludingSize(digest, gr); + + UpdateDigestIncludingSize(digest, gx); + + UpdateDigestIncludingSize(digest, participantId); + + byte[] output = DigestUtilities.DoFinal(digest); + + return new BigInteger(output); + } + + /// + /// Validates that g^x4 is not 1. + /// throws CryptoException if g^x4 is 1 + /// + public static void ValidateGx4(BigInteger gx4) + { + if (gx4.Equals(One)) + throw new CryptoException("g^x validation failed. g^x should not be 1."); + } + + /// + /// Validates that ga is not 1. + /// + /// As described by Feng Hao... + /// Alice could simply check ga != 1 to ensure it is a generator. + /// In fact, as we will explain in Section 3, (x1 + x3 + x4 ) is random over Zq even in the face of active attacks. + /// Hence, the probability for ga = 1 is extremely small - on the order of 2^160 for 160-bit q. + /// + /// throws CryptoException if ga is 1 + /// + public static void ValidateGa(BigInteger ga) + { + if (ga.Equals(One)) + throw new CryptoException("ga is equal to 1. It should not be. The chances of this happening are on the order of 2^160 for a 160-bit q. Try again."); + } + + /// + /// Validates the zero knowledge proof (generated by + /// calculateZeroKnowledgeProof(BigInteger, BigInteger, BigInteger, BigInteger, BigInteger, string, Digest, SecureRandom) + /// is correct. + /// + /// throws CryptoException if the zero knowledge proof is not correct + /// + public static void ValidateZeroKnowledgeProof(BigInteger p, BigInteger q, BigInteger g, + BigInteger gx, BigInteger[] zeroKnowledgeProof, string participantId, IDigest digest) + { + /* sig={g^v,r} */ + BigInteger gv = zeroKnowledgeProof[0]; + BigInteger r = zeroKnowledgeProof[1]; + + BigInteger h = CalculateHashForZeroKnowledgeProof(g, gv, gx, participantId, digest); + if (!(gx.CompareTo(Zero) == 1 && // g^x > 0 + gx.CompareTo(p) == -1 && // g^x < p + gx.ModPow(q, p).CompareTo(One) == 0 && // g^x^q mod q = 1 + /* + * Below, I took a straightforward way to compute g^r * g^x^h, + * which needs 2 exp. Using a simultaneous computation technique + * would only need 1 exp. + */ + g.ModPow(r, p).Multiply(gx.ModPow(h, p)).Mod(p).CompareTo(gv) == 0)) // g^v=g^r * g^x^h + { + throw new CryptoException("Zero-knowledge proof validation failed"); + } + } + + /// + /// Calculates the keying material, which can be done after round 2 has completed. + /// A session key must be derived from this key material using a secure key derivation function (KDF). + /// The KDF used to derive the key is handled externally (i.e. not by JPAKEParticipant). + /// + /// KeyingMaterial = (B/g^{x2*x4*s})^x2 + /// + public static BigInteger CalculateKeyingMaterial(BigInteger p, BigInteger q, + BigInteger gx4, BigInteger x2, BigInteger s, BigInteger B) + { + return gx4.ModPow(x2.Multiply(s).Negate().Mod(q), p).Multiply(B).ModPow(x2, p); + } + + /// + /// Validates that the given participant ids are not equal. + /// (For the J-PAKE exchange, each participant must use a unique id.) + /// + /// Throws CryptoException if the participantId strings are equal. + /// + public static void ValidateParticipantIdsDiffer(string participantId1, string participantId2) + { + if (participantId1.Equals(participantId2)) + { + throw new CryptoException( + "Both participants are using the same participantId (" + + participantId1 + + "). This is not allowed. " + + "Each participant must use a unique participantId."); + } + } + + /// + /// Validates that the given participant ids are equal. + /// This is used to ensure that the payloads received from + /// each round all come from the same participant. + /// + public static void ValidateParticipantIdsEqual(string expectedParticipantId, string actualParticipantId) + { + if (!expectedParticipantId.Equals(actualParticipantId)) + { + throw new CryptoException( + "Received payload from incorrect partner (" + + actualParticipantId + + "). Expected to receive payload from " + + expectedParticipantId + + "."); + } + } + + /// + /// Validates that the given object is not null. + /// throws NullReferenceException if the object is null. + /// + /// object in question + /// name of the object (to be used in exception message) + public static void ValidateNotNull(object obj, string description) + { + if (obj == null) + throw new ArgumentNullException(description); + } + + /// + /// Calculates the MacTag (to be used for key confirmation), as defined by + /// NIST SP 800-56A Revision 1, + /// Section 8.2 Unilateral Key Confirmation for Key Agreement Schemes. + /// + /// MacTag = HMAC(MacKey, MacLen, MacData) + /// MacKey = H(K || "JPAKE_KC") + /// MacData = "KC_1_U" || participantId || partnerParticipantId || gx1 || gx2 || gx3 || gx4 + /// + /// Note that both participants use "KC_1_U" because the sender of the round 3 message + /// is always the initiator for key confirmation. + /// + /// HMAC = {@link HMac} used with the given {@link Digest} + /// H = The given {@link Digest} + /// MacLen = length of MacTag + /// + public static BigInteger CalculateMacTag(string participantId, string partnerParticipantId, + BigInteger gx1, BigInteger gx2, BigInteger gx3, BigInteger gx4, BigInteger keyingMaterial, IDigest digest) + { + byte[] macKey = CalculateMacKey(keyingMaterial, digest); + + HMac mac = new HMac(digest); + mac.Init(new KeyParameter(macKey)); + Arrays.Fill(macKey, (byte)0); + + /* + * MacData = "KC_1_U" || participantId_Alice || participantId_Bob || gx1 || gx2 || gx3 || gx4. + */ + UpdateMac(mac, "KC_1_U"); + UpdateMac(mac, participantId); + UpdateMac(mac, partnerParticipantId); + UpdateMac(mac, gx1); + UpdateMac(mac, gx2); + UpdateMac(mac, gx3); + UpdateMac(mac, gx4); + + byte[] macOutput = MacUtilities.DoFinal(mac); + + return new BigInteger(macOutput); + } + + /// + /// Calculates the MacKey (i.e. the key to use when calculating the MagTag for key confirmation). + /// + /// MacKey = H(K || "JPAKE_KC") + /// + private static byte[] CalculateMacKey(BigInteger keyingMaterial, IDigest digest) + { + digest.Reset(); + + UpdateDigest(digest, keyingMaterial); + /* + * This constant is used to ensure that the macKey is NOT the same as the derived key. + */ + UpdateDigest(digest, "JPAKE_KC"); + + return DigestUtilities.DoFinal(digest); + } + + /// + /// Validates the MacTag received from the partner participant. + /// + /// throws CryptoException if the participantId strings are equal. + /// + public static void ValidateMacTag(string participantId, string partnerParticipantId, + BigInteger gx1, BigInteger gx2, BigInteger gx3, BigInteger gx4, + BigInteger keyingMaterial, IDigest digest, BigInteger partnerMacTag) + { + /* + * Calculate the expected MacTag using the parameters as the partner + * would have used when the partner called calculateMacTag. + * + * i.e. basically all the parameters are reversed. + * participantId <-> partnerParticipantId + * x1 <-> x3 + * x2 <-> x4 + */ + BigInteger expectedMacTag = CalculateMacTag(partnerParticipantId, participantId, gx3, gx4, gx1, gx2, keyingMaterial, digest); + + if (!expectedMacTag.Equals(partnerMacTag)) + { + throw new CryptoException( + "Partner MacTag validation failed. " + + "Therefore, the password, MAC, or digest algorithm of each participant does not match."); + } + } + + private static void UpdateDigest(IDigest digest, BigInteger bigInteger) + { + UpdateDigest(digest, BigIntegers.AsUnsignedByteArray(bigInteger)); + } + + private static void UpdateDigest(IDigest digest, string str) + { + UpdateDigest(digest, Encoding.UTF8.GetBytes(str)); + } + + private static void UpdateDigest(IDigest digest, byte[] bytes) + { + digest.BlockUpdate(bytes, 0, bytes.Length); + Arrays.Fill(bytes, (byte)0); + } + + private static void UpdateDigestIncludingSize(IDigest digest, BigInteger bigInteger) + { + UpdateDigestIncludingSize(digest, BigIntegers.AsUnsignedByteArray(bigInteger)); + } + + private static void UpdateDigestIncludingSize(IDigest digest, string str) + { + UpdateDigestIncludingSize(digest, Encoding.UTF8.GetBytes(str)); + } + + private static void UpdateDigestIncludingSize(IDigest digest, byte[] bytes) + { + digest.BlockUpdate(IntToByteArray(bytes.Length), 0, 4); + digest.BlockUpdate(bytes, 0, bytes.Length); + Arrays.Fill(bytes, (byte)0); + } + + private static void UpdateMac(IMac mac, BigInteger bigInteger) + { + UpdateMac(mac, BigIntegers.AsUnsignedByteArray(bigInteger)); + } + + private static void UpdateMac(IMac mac, string str) + { + UpdateMac(mac, Encoding.UTF8.GetBytes(str)); + } + + private static void UpdateMac(IMac mac, byte[] bytes) + { + mac.BlockUpdate(bytes, 0, bytes.Length); + Arrays.Fill(bytes, (byte)0); + } + + private static byte[] IntToByteArray(int value) + { + return Pack.UInt32_To_BE((uint)value); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeUtilities.cs.meta new file mode 100644 index 00000000..2efcff6a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/jpake/JPakeUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: be8c03db27c054b4dbee7970d93bba33 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf.meta new file mode 100644 index 00000000..22b27a38 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46e2b05f22025dd47b5d1c86ce8f0c93 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ConcatenationKdfGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ConcatenationKdfGenerator.cs new file mode 100644 index 00000000..33475567 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ConcatenationKdfGenerator.cs @@ -0,0 +1,104 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Kdf +{ + /** + * Generator for Concatenation Key Derivation Function defined in NIST SP 800-56A, Sect 5.8.1 + */ + public class ConcatenationKdfGenerator + : IDerivationFunction + { + private readonly IDigest mDigest; + + private byte[] mShared; + private byte[] mOtherInfo; + private int mHLen; + + /** + * @param digest the digest to be used as the source of generated bytes + */ + public ConcatenationKdfGenerator(IDigest digest) + { + this.mDigest = digest; + this.mHLen = digest.GetDigestSize(); + } + + public virtual void Init(IDerivationParameters param) + { + if (!(param is KdfParameters)) + throw new ArgumentException("KDF parameters required for ConcatenationKdfGenerator"); + + KdfParameters p = (KdfParameters)param; + + mShared = p.GetSharedSecret(); + mOtherInfo = p.GetIV(); + } + + /** + * return the underlying digest. + */ + public virtual IDigest Digest + { + get { return mDigest; } + } + + /** + * fill len bytes of the output buffer with bytes generated from + * the derivation function. + * + * @throws DataLengthException if the out buffer is too small. + */ + public virtual int GenerateBytes(byte[] outBytes, int outOff, int len) + { + if ((outBytes.Length - len) < outOff) + throw new DataLengthException("output buffer too small"); + + byte[] hashBuf = new byte[mHLen]; + byte[] C = new byte[4]; + uint counter = 1; + int outputLen = 0; + + mDigest.Reset(); + + if (len > mHLen) + { + do + { + Pack.UInt32_To_BE(counter, C); + + mDigest.BlockUpdate(C, 0, C.Length); + mDigest.BlockUpdate(mShared, 0, mShared.Length); + mDigest.BlockUpdate(mOtherInfo, 0, mOtherInfo.Length); + + mDigest.DoFinal(hashBuf, 0); + + Array.Copy(hashBuf, 0, outBytes, outOff + outputLen, mHLen); + outputLen += mHLen; + } + while ((counter++) < (len / mHLen)); + } + + if (outputLen < len) + { + Pack.UInt32_To_BE(counter, C); + + mDigest.BlockUpdate(C, 0, C.Length); + mDigest.BlockUpdate(mShared, 0, mShared.Length); + mDigest.BlockUpdate(mOtherInfo, 0, mOtherInfo.Length); + + mDigest.DoFinal(hashBuf, 0); + + Array.Copy(hashBuf, 0, outBytes, outOff + outputLen, len - outputLen); + } + + return len; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ConcatenationKdfGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ConcatenationKdfGenerator.cs.meta new file mode 100644 index 00000000..f82a3a96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ConcatenationKdfGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2968651d26eab974fbac139e56e083ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKdfParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKdfParameters.cs new file mode 100644 index 00000000..3bde996a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKdfParameters.cs @@ -0,0 +1,61 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Kdf +{ + public class DHKdfParameters + : IDerivationParameters + { + private readonly DerObjectIdentifier algorithm; + private readonly int keySize; + private readonly byte[] z; + private readonly byte[] extraInfo; + + public DHKdfParameters( + DerObjectIdentifier algorithm, + int keySize, + byte[] z) + : this(algorithm, keySize, z, null) + { + } + + public DHKdfParameters( + DerObjectIdentifier algorithm, + int keySize, + byte[] z, + byte[] extraInfo) + { + this.algorithm = algorithm; + this.keySize = keySize; + this.z = z; // TODO Clone? + this.extraInfo = extraInfo; + } + + public DerObjectIdentifier Algorithm + { + get { return algorithm; } + } + + public int KeySize + { + get { return keySize; } + } + + public byte[] GetZ() + { + // TODO Clone? + return z; + } + + public byte[] GetExtraInfo() + { + // TODO Clone? + return extraInfo; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKdfParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKdfParameters.cs.meta new file mode 100644 index 00000000..1b10be0d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKdfParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 37821fa6280a2bf4a96d3dc5f096c6ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKekGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKekGenerator.cs new file mode 100644 index 00000000..3d929667 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKekGenerator.cs @@ -0,0 +1,116 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Kdf +{ + /** + * RFC 2631 Diffie-hellman KEK derivation function. + */ + public class DHKekGenerator + : IDerivationFunction + { + private readonly IDigest digest; + + private DerObjectIdentifier algorithm; + private int keySize; + private byte[] z; + private byte[] partyAInfo; + + public DHKekGenerator(IDigest digest) + { + this.digest = digest; + } + + public virtual void Init(IDerivationParameters param) + { + DHKdfParameters parameters = (DHKdfParameters)param; + + this.algorithm = parameters.Algorithm; + this.keySize = parameters.KeySize; + this.z = parameters.GetZ(); // TODO Clone? + this.partyAInfo = parameters.GetExtraInfo(); // TODO Clone? + } + + public virtual IDigest Digest + { + get { return digest; } + } + + public virtual int GenerateBytes(byte[] outBytes, int outOff, int len) + { + if ((outBytes.Length - len) < outOff) + { + throw new DataLengthException("output buffer too small"); + } + + long oBytes = len; + int outLen = digest.GetDigestSize(); + + // + // this is at odds with the standard implementation, the + // maximum value should be hBits * (2^32 - 1) where hBits + // is the digest output size in bits. We can't have an + // array with a long index at the moment... + // + if (oBytes > ((2L << 32) - 1)) + { + throw new ArgumentException("Output length too large"); + } + + int cThreshold = (int)((oBytes + outLen - 1) / outLen); + + byte[] dig = new byte[digest.GetDigestSize()]; + + uint counter = 1; + + for (int i = 0; i < cThreshold; i++) + { + digest.BlockUpdate(z, 0, z.Length); + + // KeySpecificInfo + DerSequence keyInfo = new DerSequence( + algorithm, + new DerOctetString(Pack.UInt32_To_BE(counter))); + + // OtherInfo + Asn1EncodableVector v1 = new Asn1EncodableVector(keyInfo); + + if (partyAInfo != null) + { + v1.Add(new DerTaggedObject(true, 0, new DerOctetString(partyAInfo))); + } + + v1.Add(new DerTaggedObject(true, 2, new DerOctetString(Pack.UInt32_To_BE((uint)keySize)))); + + byte[] other = new DerSequence(v1).GetDerEncoded(); + + digest.BlockUpdate(other, 0, other.Length); + + digest.DoFinal(dig, 0); + + if (len > outLen) + { + Array.Copy(dig, 0, outBytes, outOff, outLen); + outOff += outLen; + len -= outLen; + } + else + { + Array.Copy(dig, 0, outBytes, outOff, len); + } + + counter++; + } + + digest.Reset(); + + return (int)oBytes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKekGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKekGenerator.cs.meta new file mode 100644 index 00000000..1549ad03 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/DHKekGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 15d1d1044377c8349b064a27a6649808 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ECDHKekGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ECDHKekGenerator.cs new file mode 100644 index 00000000..14d5159d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ECDHKekGenerator.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Kdf +{ + /** + * X9.63 based key derivation function for ECDH CMS. + */ + public class ECDHKekGenerator + : IDerivationFunction + { + private readonly IDerivationFunction kdf; + + private DerObjectIdentifier algorithm; + private int keySize; + private byte[] z; + + public ECDHKekGenerator(IDigest digest) + { + this.kdf = new Kdf2BytesGenerator(digest); + } + + public virtual void Init(IDerivationParameters param) + { + DHKdfParameters parameters = (DHKdfParameters)param; + + this.algorithm = parameters.Algorithm; + this.keySize = parameters.KeySize; + this.z = parameters.GetZ(); // TODO Clone? + } + + public virtual IDigest Digest + { + get { return kdf.Digest; } + } + + public virtual int GenerateBytes(byte[] outBytes, int outOff, int len) + { + // TODO Create an ASN.1 class for this (RFC3278) + // ECC-CMS-SharedInfo + DerSequence s = new DerSequence( + new AlgorithmIdentifier(algorithm, DerNull.Instance), + new DerTaggedObject(true, 2, new DerOctetString(Pack.UInt32_To_BE((uint)keySize)))); + + kdf.Init(new KdfParameters(z, s.GetDerEncoded())); + + return kdf.GenerateBytes(outBytes, outOff, len); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ECDHKekGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ECDHKekGenerator.cs.meta new file mode 100644 index 00000000..7806536b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/kdf/ECDHKekGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1cfab31e18f7d80498fe6cee2a7e4955 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp.meta new file mode 100644 index 00000000..07781139 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b6aacc3094b914340b5c92347295dc21 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Client.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Client.cs new file mode 100644 index 00000000..a060206e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Client.cs @@ -0,0 +1,168 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Srp +{ + /** + * Implements the client side SRP-6a protocol. Note that this class is stateful, and therefore NOT threadsafe. + * This implementation of SRP is based on the optimized message sequence put forth by Thomas Wu in the paper + * "SRP-6: Improvements and Refinements to the Secure Remote Password Protocol, 2002" + */ + public class Srp6Client + { + protected BigInteger N; + protected BigInteger g; + + protected BigInteger privA; + protected BigInteger pubA; + + protected BigInteger B; + + protected BigInteger x; + protected BigInteger u; + protected BigInteger S; + + protected BigInteger M1; + protected BigInteger M2; + protected BigInteger Key; + + protected IDigest digest; + protected SecureRandom random; + + public Srp6Client() + { + } + + /** + * Initialises the client to begin new authentication attempt + * @param N The safe prime associated with the client's verifier + * @param g The group parameter associated with the client's verifier + * @param digest The digest algorithm associated with the client's verifier + * @param random For key generation + */ + public virtual void Init(BigInteger N, BigInteger g, IDigest digest, SecureRandom random) + { + this.N = N; + this.g = g; + this.digest = digest; + this.random = random; + } + + public virtual void Init(Srp6GroupParameters group, IDigest digest, SecureRandom random) + { + Init(group.N, group.G, digest, random); + } + + /** + * Generates client's credentials given the client's salt, identity and password + * @param salt The salt used in the client's verifier. + * @param identity The user's identity (eg. username) + * @param password The user's password + * @return Client's public value to send to server + */ + public virtual BigInteger GenerateClientCredentials(byte[] salt, byte[] identity, byte[] password) + { + this.x = Srp6Utilities.CalculateX(digest, N, salt, identity, password); + this.privA = SelectPrivateValue(); + this.pubA = g.ModPow(privA, N); + + return pubA; + } + + /** + * Generates client's verification message given the server's credentials + * @param serverB The server's credentials + * @return Client's verification message for the server + * @throws CryptoException If server's credentials are invalid + */ + public virtual BigInteger CalculateSecret(BigInteger serverB) + { + this.B = Srp6Utilities.ValidatePublicValue(N, serverB); + this.u = Srp6Utilities.CalculateU(digest, N, pubA, B); + this.S = CalculateS(); + + return S; + } + + protected virtual BigInteger SelectPrivateValue() + { + return Srp6Utilities.GeneratePrivateValue(digest, N, g, random); + } + + private BigInteger CalculateS() + { + BigInteger k = Srp6Utilities.CalculateK(digest, N, g); + BigInteger exp = u.Multiply(x).Add(privA); + BigInteger tmp = g.ModPow(x, N).Multiply(k).Mod(N); + return B.Subtract(tmp).Mod(N).ModPow(exp, N); + } + + /** + * Computes the client evidence message M1 using the previously received values. + * To be called after calculating the secret S. + * @return M1: the client side generated evidence message + * @throws CryptoException + */ + public virtual BigInteger CalculateClientEvidenceMessage() + { + // Verify pre-requirements + if (this.pubA == null || this.B == null || this.S == null) + { + throw new CryptoException("Impossible to compute M1: " + + "some data are missing from the previous operations (A,B,S)"); + } + // compute the client evidence message 'M1' + this.M1 = Srp6Utilities.CalculateM1(digest, N, pubA, B, S); + return M1; + } + + /** Authenticates the server evidence message M2 received and saves it only if correct. + * @param M2: the server side generated evidence message + * @return A boolean indicating if the server message M2 was the expected one. + * @throws CryptoException + */ + public virtual bool VerifyServerEvidenceMessage(BigInteger serverM2) + { + // Verify pre-requirements + if (this.pubA == null || this.M1 == null || this.S == null) + { + throw new CryptoException("Impossible to compute and verify M2: " + + "some data are missing from the previous operations (A,M1,S)"); + } + + // Compute the own server evidence message 'M2' + BigInteger computedM2 = Srp6Utilities.CalculateM2(digest, N, pubA, M1, S); + if (computedM2.Equals(serverM2)) + { + this.M2 = serverM2; + return true; + } + return false; + } + + /** + * Computes the final session key as a result of the SRP successful mutual authentication + * To be called after verifying the server evidence message M2. + * @return Key: the mutually authenticated symmetric session key + * @throws CryptoException + */ + public virtual BigInteger CalculateSessionKey() + { + // Verify pre-requirements (here we enforce a previous calculation of M1 and M2) + if (this.S == null || this.M1 == null || this.M2 == null) + { + throw new CryptoException("Impossible to compute Key: " + + "some data are missing from the previous operations (S,M1,M2)"); + } + this.Key = Srp6Utilities.CalculateKey(digest, N, S); + return Key; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Client.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Client.cs.meta new file mode 100644 index 00000000..4bc10502 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Client.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c97144c9d901452429331664aae38f7b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Server.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Server.cs new file mode 100644 index 00000000..905766fd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Server.cs @@ -0,0 +1,167 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Srp +{ + /** + * Implements the server side SRP-6a protocol. Note that this class is stateful, and therefore NOT threadsafe. + * This implementation of SRP is based on the optimized message sequence put forth by Thomas Wu in the paper + * "SRP-6: Improvements and Refinements to the Secure Remote Password Protocol, 2002" + */ + public class Srp6Server + { + protected BigInteger N; + protected BigInteger g; + protected BigInteger v; + + protected SecureRandom random; + protected IDigest digest; + + protected BigInteger A; + + protected BigInteger privB; + protected BigInteger pubB; + + protected BigInteger u; + protected BigInteger S; + protected BigInteger M1; + protected BigInteger M2; + protected BigInteger Key; + + public Srp6Server() + { + } + + /** + * Initialises the server to accept a new client authentication attempt + * @param N The safe prime associated with the client's verifier + * @param g The group parameter associated with the client's verifier + * @param v The client's verifier + * @param digest The digest algorithm associated with the client's verifier + * @param random For key generation + */ + public virtual void Init(BigInteger N, BigInteger g, BigInteger v, IDigest digest, SecureRandom random) + { + this.N = N; + this.g = g; + this.v = v; + + this.random = random; + this.digest = digest; + } + + public virtual void Init(Srp6GroupParameters group, BigInteger v, IDigest digest, SecureRandom random) + { + Init(group.N, group.G, v, digest, random); + } + + /** + * Generates the server's credentials that are to be sent to the client. + * @return The server's public value to the client + */ + public virtual BigInteger GenerateServerCredentials() + { + BigInteger k = Srp6Utilities.CalculateK(digest, N, g); + this.privB = SelectPrivateValue(); + this.pubB = k.Multiply(v).Mod(N).Add(g.ModPow(privB, N)).Mod(N); + + return pubB; + } + + /** + * Processes the client's credentials. If valid the shared secret is generated and returned. + * @param clientA The client's credentials + * @return A shared secret BigInteger + * @throws CryptoException If client's credentials are invalid + */ + public virtual BigInteger CalculateSecret(BigInteger clientA) + { + this.A = Srp6Utilities.ValidatePublicValue(N, clientA); + this.u = Srp6Utilities.CalculateU(digest, N, A, pubB); + this.S = CalculateS(); + + return S; + } + + protected virtual BigInteger SelectPrivateValue() + { + return Srp6Utilities.GeneratePrivateValue(digest, N, g, random); + } + + private BigInteger CalculateS() + { + return v.ModPow(u, N).Multiply(A).Mod(N).ModPow(privB, N); + } + + /** + * Authenticates the received client evidence message M1 and saves it only if correct. + * To be called after calculating the secret S. + * @param M1: the client side generated evidence message + * @return A boolean indicating if the client message M1 was the expected one. + * @throws CryptoException + */ + public virtual bool VerifyClientEvidenceMessage(BigInteger clientM1) + { + // Verify pre-requirements + if (this.A == null || this.pubB == null || this.S == null) + { + throw new CryptoException("Impossible to compute and verify M1: " + + "some data are missing from the previous operations (A,B,S)"); + } + + // Compute the own client evidence message 'M1' + BigInteger computedM1 = Srp6Utilities.CalculateM1(digest, N, A, pubB, S); + if (computedM1.Equals(clientM1)) + { + this.M1 = clientM1; + return true; + } + return false; + } + + /** + * Computes the server evidence message M2 using the previously verified values. + * To be called after successfully verifying the client evidence message M1. + * @return M2: the server side generated evidence message + * @throws CryptoException + */ + public virtual BigInteger CalculateServerEvidenceMessage() + { + // Verify pre-requirements + if (this.A == null || this.M1 == null || this.S == null) + { + throw new CryptoException("Impossible to compute M2: " + + "some data are missing from the previous operations (A,M1,S)"); + } + + // Compute the server evidence message 'M2' + this.M2 = Srp6Utilities.CalculateM2(digest, N, A, M1, S); + return M2; + } + + /** + * Computes the final session key as a result of the SRP successful mutual authentication + * To be called after calculating the server evidence message M2. + * @return Key: the mutual authenticated symmetric session key + * @throws CryptoException + */ + public virtual BigInteger CalculateSessionKey() + { + // Verify pre-requirements + if (this.S == null || this.M1 == null || this.M2 == null) + { + throw new CryptoException("Impossible to compute Key: " + + "some data are missing from the previous operations (S,M1,M2)"); + } + this.Key = Srp6Utilities.CalculateKey(digest, N, S); + return Key; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Server.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Server.cs.meta new file mode 100644 index 00000000..851efd2a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Server.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 036c95a84f457134c94137d3f36c6603 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6StandardGroups.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6StandardGroups.cs new file mode 100644 index 00000000..0e6e4207 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6StandardGroups.cs @@ -0,0 +1,163 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Srp +{ + public class Srp6StandardGroups + { + private static BigInteger FromHex(string hex) + { + return new BigInteger(1, Hex.Decode(hex)); + } + + private static Srp6GroupParameters FromNG(string hexN, string hexG) + { + return new Srp6GroupParameters(FromHex(hexN), FromHex(hexG)); + } + + /* + * RFC 5054 + */ + private const string rfc5054_1024_N = "EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C" + + "9C256576D674DF7496EA81D3383B4813D692C6E0E0D5D8E250B98BE4" + + "8E495C1D6089DAD15DC7D7B46154D6B6CE8EF4AD69B15D4982559B29" + + "7BCF1885C529F566660E57EC68EDBC3C05726CC02FD4CBF4976EAA9A" + "FD5138FE8376435B9FC61D2FC0EB06E3"; + private const string rfc5054_1024_g = "02"; + public static readonly Srp6GroupParameters rfc5054_1024 = FromNG(rfc5054_1024_N, rfc5054_1024_g); + + private const string rfc5054_1536_N = "9DEF3CAFB939277AB1F12A8617A47BBBDBA51DF499AC4C80BEEEA961" + + "4B19CC4D5F4F5F556E27CBDE51C6A94BE4607A291558903BA0D0F843" + + "80B655BB9A22E8DCDF028A7CEC67F0D08134B1C8B97989149B609E0B" + + "E3BAB63D47548381DBC5B1FC764E3F4B53DD9DA1158BFD3E2B9C8CF5" + + "6EDF019539349627DB2FD53D24B7C48665772E437D6C7F8CE442734A" + + "F7CCB7AE837C264AE3A9BEB87F8A2FE9B8B5292E5A021FFF5E91479E" + + "8CE7A28C2442C6F315180F93499A234DCF76E3FED135F9BB"; + private const string rfc5054_1536_g = "02"; + public static readonly Srp6GroupParameters rfc5054_1536 = FromNG(rfc5054_1536_N, rfc5054_1536_g); + + private const string rfc5054_2048_N = "AC6BDB41324A9A9BF166DE5E1389582FAF72B6651987EE07FC319294" + + "3DB56050A37329CBB4A099ED8193E0757767A13DD52312AB4B03310D" + + "CD7F48A9DA04FD50E8083969EDB767B0CF6095179A163AB3661A05FB" + + "D5FAAAE82918A9962F0B93B855F97993EC975EEAA80D740ADBF4FF74" + + "7359D041D5C33EA71D281E446B14773BCA97B43A23FB801676BD207A" + + "436C6481F1D2B9078717461A5B9D32E688F87748544523B524B0D57D" + + "5EA77A2775D2ECFA032CFBDBF52FB3786160279004E57AE6AF874E73" + + "03CE53299CCC041C7BC308D82A5698F3A8D0C38271AE35F8E9DBFBB6" + + "94B5C803D89F7AE435DE236D525F54759B65E372FCD68EF20FA7111F" + "9E4AFF73"; + private const string rfc5054_2048_g = "02"; + public static readonly Srp6GroupParameters rfc5054_2048 = FromNG(rfc5054_2048_N, rfc5054_2048_g); + + private const string rfc5054_3072_N = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" + + "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" + + "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9" + + "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" + + "49286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8" + + "FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C" + + "180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718" + + "3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D" + + "04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7D" + + "B3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D226" + + "1AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFC" + "E0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF"; + private const string rfc5054_3072_g = "05"; + public static readonly Srp6GroupParameters rfc5054_3072 = FromNG(rfc5054_3072_N, rfc5054_3072_g); + + private const string rfc5054_4096_N = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" + + "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" + + "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9" + + "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" + + "49286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8" + + "FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C" + + "180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718" + + "3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D" + + "04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7D" + + "B3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D226" + + "1AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFC" + + "E0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B26" + + "99C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB" + + "04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2" + + "233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127" + + "D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199" + "FFFFFFFFFFFFFFFF"; + private const string rfc5054_4096_g = "05"; + public static readonly Srp6GroupParameters rfc5054_4096 = FromNG(rfc5054_4096_N, rfc5054_4096_g); + + private const string rfc5054_6144_N = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" + + "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" + + "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9" + + "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" + + "49286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8" + + "FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C" + + "180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718" + + "3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D" + + "04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7D" + + "B3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D226" + + "1AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFC" + + "E0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B26" + + "99C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB" + + "04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2" + + "233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127" + + "D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BDF8FF9406" + + "AD9E530EE5DB382F413001AEB06A53ED9027D831179727B0865A8918" + + "DA3EDBEBCF9B14ED44CE6CBACED4BB1BDB7F1447E6CC254B33205151" + + "2BD7AF426FB8F401378CD2BF5983CA01C64B92ECF032EA15D1721D03" + + "F482D7CE6E74FEF6D55E702F46980C82B5A84031900B1C9E59E7C97F" + + "BEC7E8F323A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE32806A1D58B" + + "B7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55CDA56C9EC2EF29632" + + "387FE8D76E3C0468043E8F663F4860EE12BF2D5B0B7474D6E694F91E" + "6DCC4024FFFFFFFFFFFFFFFF"; + private const string rfc5054_6144_g = "05"; + public static readonly Srp6GroupParameters rfc5054_6144 = FromNG(rfc5054_6144_N, rfc5054_6144_g); + + private const string rfc5054_8192_N = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08" + + "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B" + + "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9" + + "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6" + + "49286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8" + + "FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D" + + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C" + + "180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718" + + "3995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D" + + "04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7D" + + "B3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D226" + + "1AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200C" + + "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFC" + + "E0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B26" + + "99C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB" + + "04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2" + + "233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127" + + "D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934028492" + + "36C3FAB4D27C7026C1D4DCB2602646DEC9751E763DBA37BDF8FF9406" + + "AD9E530EE5DB382F413001AEB06A53ED9027D831179727B0865A8918" + + "DA3EDBEBCF9B14ED44CE6CBACED4BB1BDB7F1447E6CC254B33205151" + + "2BD7AF426FB8F401378CD2BF5983CA01C64B92ECF032EA15D1721D03" + + "F482D7CE6E74FEF6D55E702F46980C82B5A84031900B1C9E59E7C97F" + + "BEC7E8F323A97A7E36CC88BE0F1D45B7FF585AC54BD407B22B4154AA" + + "CC8F6D7EBF48E1D814CC5ED20F8037E0A79715EEF29BE32806A1D58B" + + "B7C5DA76F550AA3D8A1FBFF0EB19CCB1A313D55CDA56C9EC2EF29632" + + "387FE8D76E3C0468043E8F663F4860EE12BF2D5B0B7474D6E694F91E" + + "6DBE115974A3926F12FEE5E438777CB6A932DF8CD8BEC4D073B931BA" + + "3BC832B68D9DD300741FA7BF8AFC47ED2576F6936BA424663AAB639C" + + "5AE4F5683423B4742BF1C978238F16CBE39D652DE3FDB8BEFC848AD9" + + "22222E04A4037C0713EB57A81A23F0C73473FC646CEA306B4BCBC886" + + "2F8385DDFA9D4B7FA2C087E879683303ED5BDD3A062B3CF5B3A278A6" + + "6D2A13F83F44F82DDF310EE074AB6A364597E899A0255DC164F31CC5" + + "0846851DF9AB48195DED7EA1B1D510BD7EE74D73FAF36BC31ECFA268" + + "359046F4EB879F924009438B481C6CD7889A002ED5EE382BC9190DA6" + + "FC026E479558E4475677E9AA9E3050E2765694DFC81F56E880B96E71" + "60C980DD98EDD3DFFFFFFFFFFFFFFFFF"; + private const string rfc5054_8192_g = "13"; + public static readonly Srp6GroupParameters rfc5054_8192 = FromNG(rfc5054_8192_N, rfc5054_8192_g); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6StandardGroups.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6StandardGroups.cs.meta new file mode 100644 index 00000000..d68e5d37 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6StandardGroups.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 031c325c69c0dde4090a9a0a0fc4ac5e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Utilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Utilities.cs new file mode 100644 index 00000000..52941e96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Utilities.cs @@ -0,0 +1,157 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Srp +{ + public class Srp6Utilities + { + public static BigInteger CalculateK(IDigest digest, BigInteger N, BigInteger g) + { + return HashPaddedPair(digest, N, N, g); + } + + public static BigInteger CalculateU(IDigest digest, BigInteger N, BigInteger A, BigInteger B) + { + return HashPaddedPair(digest, N, A, B); + } + + public static BigInteger CalculateX(IDigest digest, BigInteger N, byte[] salt, byte[] identity, byte[] password) + { + byte[] output = new byte[digest.GetDigestSize()]; + + digest.BlockUpdate(identity, 0, identity.Length); + digest.Update((byte)':'); + digest.BlockUpdate(password, 0, password.Length); + digest.DoFinal(output, 0); + + digest.BlockUpdate(salt, 0, salt.Length); + digest.BlockUpdate(output, 0, output.Length); + digest.DoFinal(output, 0); + + return new BigInteger(1, output); + } + + public static BigInteger GeneratePrivateValue(IDigest digest, BigInteger N, BigInteger g, SecureRandom random) + { + int minBits = System.Math.Min(256, N.BitLength / 2); + BigInteger min = BigInteger.One.ShiftLeft(minBits - 1); + BigInteger max = N.Subtract(BigInteger.One); + + return BigIntegers.CreateRandomInRange(min, max, random); + } + + public static BigInteger ValidatePublicValue(BigInteger N, BigInteger val) + { + val = val.Mod(N); + + // Check that val % N != 0 + if (val.Equals(BigInteger.Zero)) + throw new CryptoException("Invalid public value: 0"); + + return val; + } + + /** + * Computes the client evidence message (M1) according to the standard routine: + * M1 = H( A | B | S ) + * @param digest The Digest used as the hashing function H + * @param N Modulus used to get the pad length + * @param A The public client value + * @param B The public server value + * @param S The secret calculated by both sides + * @return M1 The calculated client evidence message + */ + public static BigInteger CalculateM1(IDigest digest, BigInteger N, BigInteger A, BigInteger B, BigInteger S) + { + BigInteger M1 = HashPaddedTriplet(digest, N, A, B, S); + return M1; + } + + /** + * Computes the server evidence message (M2) according to the standard routine: + * M2 = H( A | M1 | S ) + * @param digest The Digest used as the hashing function H + * @param N Modulus used to get the pad length + * @param A The public client value + * @param M1 The client evidence message + * @param S The secret calculated by both sides + * @return M2 The calculated server evidence message + */ + public static BigInteger CalculateM2(IDigest digest, BigInteger N, BigInteger A, BigInteger M1, BigInteger S) + { + BigInteger M2 = HashPaddedTriplet(digest, N, A, M1, S); + return M2; + } + + /** + * Computes the final Key according to the standard routine: Key = H(S) + * @param digest The Digest used as the hashing function H + * @param N Modulus used to get the pad length + * @param S The secret calculated by both sides + * @return + */ + public static BigInteger CalculateKey(IDigest digest, BigInteger N, BigInteger S) + { + int padLength = (N.BitLength + 7) / 8; + byte[] _S = GetPadded(S, padLength); + digest.BlockUpdate(_S, 0, _S.Length); + + byte[] output = new byte[digest.GetDigestSize()]; + digest.DoFinal(output, 0); + return new BigInteger(1, output); + } + + private static BigInteger HashPaddedTriplet(IDigest digest, BigInteger N, BigInteger n1, BigInteger n2, BigInteger n3) + { + int padLength = (N.BitLength + 7) / 8; + + byte[] n1_bytes = GetPadded(n1, padLength); + byte[] n2_bytes = GetPadded(n2, padLength); + byte[] n3_bytes = GetPadded(n3, padLength); + + digest.BlockUpdate(n1_bytes, 0, n1_bytes.Length); + digest.BlockUpdate(n2_bytes, 0, n2_bytes.Length); + digest.BlockUpdate(n3_bytes, 0, n3_bytes.Length); + + byte[] output = new byte[digest.GetDigestSize()]; + digest.DoFinal(output, 0); + + return new BigInteger(1, output); + } + + private static BigInteger HashPaddedPair(IDigest digest, BigInteger N, BigInteger n1, BigInteger n2) + { + int padLength = (N.BitLength + 7) / 8; + + byte[] n1_bytes = GetPadded(n1, padLength); + byte[] n2_bytes = GetPadded(n2, padLength); + + digest.BlockUpdate(n1_bytes, 0, n1_bytes.Length); + digest.BlockUpdate(n2_bytes, 0, n2_bytes.Length); + + byte[] output = new byte[digest.GetDigestSize()]; + digest.DoFinal(output, 0); + + return new BigInteger(1, output); + } + + private static byte[] GetPadded(BigInteger n, int length) + { + byte[] bs = BigIntegers.AsUnsignedByteArray(n); + if (bs.Length < length) + { + byte[] tmp = new byte[length]; + Array.Copy(bs, 0, tmp, length - bs.Length, bs.Length); + bs = tmp; + } + return bs; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Utilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Utilities.cs.meta new file mode 100644 index 00000000..5eca1e59 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6Utilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f2d639deca700ab4ebd379e19bf15295 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6VerifierGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6VerifierGenerator.cs new file mode 100644 index 00000000..f3eef55d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6VerifierGenerator.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Srp +{ + /** + * Generates new SRP verifier for user + */ + public class Srp6VerifierGenerator + { + protected BigInteger N; + protected BigInteger g; + protected IDigest digest; + + public Srp6VerifierGenerator() + { + } + + /** + * Initialises generator to create new verifiers + * @param N The safe prime to use (see DHParametersGenerator) + * @param g The group parameter to use (see DHParametersGenerator) + * @param digest The digest to use. The same digest type will need to be used later for the actual authentication + * attempt. Also note that the final session key size is dependent on the chosen digest. + */ + public virtual void Init(BigInteger N, BigInteger g, IDigest digest) + { + this.N = N; + this.g = g; + this.digest = digest; + } + + public virtual void Init(Srp6GroupParameters group, IDigest digest) + { + Init(group.N, group.G, digest); + } + + /** + * Creates a new SRP verifier + * @param salt The salt to use, generally should be large and random + * @param identity The user's identifying information (eg. username) + * @param password The user's password + * @return A new verifier for use in future SRP authentication + */ + public virtual BigInteger GenerateVerifier(byte[] salt, byte[] identity, byte[] password) + { + BigInteger x = Srp6Utilities.CalculateX(digest, N, salt, identity, password); + + return g.ModPow(x, N); + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6VerifierGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6VerifierGenerator.cs.meta new file mode 100644 index 00000000..027da287 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/agreement/srp/SRP6VerifierGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e48df3dca5d9954b9cad7406b784e1b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests.meta new file mode 100644 index 00000000..07abf1fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e980ab0e11551042aa0a47cac1b3062 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2bDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2bDigest.cs new file mode 100644 index 00000000..07c5717a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2bDigest.cs @@ -0,0 +1,535 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /* The BLAKE2 cryptographic hash function was designed by Jean- + Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn, and Christian + Winnerlein. + + Reference Implementation and Description can be found at: https://blake2.net/ + Internet Draft: https://tools.ietf.org/html/draft-saarinen-blake2-02 + + This implementation does not support the Tree Hashing Mode. + + For unkeyed hashing, developers adapting BLAKE2 to ASN.1 - based + message formats SHOULD use the OID tree at x = 1.3.6.1.4.1.1722.12.2. + + Algorithm | Target | Collision | Hash | Hash ASN.1 | + Identifier | Arch | Security | nn | OID Suffix | + ---------------+--------+-----------+------+------------+ + id-blake2b160 | 64-bit | 2**80 | 20 | x.1.20 | + id-blake2b256 | 64-bit | 2**128 | 32 | x.1.32 | + id-blake2b384 | 64-bit | 2**192 | 48 | x.1.48 | + id-blake2b512 | 64-bit | 2**256 | 64 | x.1.64 | + ---------------+--------+-----------+------+------------+ + */ + + /** + * Implementation of the cryptographic hash function Blakbe2b. + *

+ * Blake2b offers a built-in keying mechanism to be used directly + * for authentication ("Prefix-MAC") rather than a HMAC construction. + *

+ * Blake2b offers a built-in support for a salt for randomized hashing + * and a personal string for defining a unique hash function for each application. + *

+ * BLAKE2b is optimized for 64-bit platforms and produces digests of any size + * between 1 and 64 bytes. + */ + public class Blake2bDigest + : IDigest + { + // Blake2b Initialization Vector: + private static readonly ulong[] blake2b_IV = + // Produced from the square root of primes 2, 3, 5, 7, 11, 13, 17, 19. + // The same as SHA-512 IV. + { + 0x6a09e667f3bcc908UL, 0xbb67ae8584caa73bUL, 0x3c6ef372fe94f82bUL, + 0xa54ff53a5f1d36f1UL, 0x510e527fade682d1UL, 0x9b05688c2b3e6c1fUL, + 0x1f83d9abfb41bd6bUL, 0x5be0cd19137e2179UL + }; + + // Message word permutations: + private static readonly byte[,] blake2b_sigma = + { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, + { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, + { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, + { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, + { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, + { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, + { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, + { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, + { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } + }; + + private const int ROUNDS = 12; // to use for Catenas H' + private const int BLOCK_LENGTH_BYTES = 128;// bytes + + // General parameters: + private int digestLength = 64; // 1- 64 bytes + private int keyLength = 0; // 0 - 64 bytes for keyed hashing for MAC + private byte[] salt = null;// new byte[16]; + private byte[] personalization = null;// new byte[16]; + + // the key + private byte[] key = null; + + // Tree hashing parameters: + // Because this class does not implement the Tree Hashing Mode, + // these parameters can be treated as constants (see init() function) + /* + * private int fanout = 1; // 0-255 private int depth = 1; // 1 - 255 + * private int leafLength= 0; private long nodeOffset = 0L; private int + * nodeDepth = 0; private int innerHashLength = 0; + */ + + // whenever this buffer overflows, it will be processed + // in the Compress() function. + // For performance issues, long messages will not use this buffer. + private byte[] buffer = null;// new byte[BLOCK_LENGTH_BYTES]; + // Position of last inserted byte: + private int bufferPos = 0;// a value from 0 up to 128 + + private ulong[] internalState = new ulong[16]; // In the Blake2b paper it is + // called: v + private ulong[] chainValue = null; // state vector, in the Blake2b paper it + // is called: h + + private ulong t0 = 0UL; // holds last significant bits, counter (counts bytes) + private ulong t1 = 0UL; // counter: Length up to 2^128 are supported + private ulong f0 = 0UL; // finalization flag, for last block: ~0L + + // For Tree Hashing Mode, not used here: + // private long f1 = 0L; // finalization flag, for last node: ~0L + + public Blake2bDigest() + : this(512) + { + } + + public Blake2bDigest(Blake2bDigest digest) + { + this.bufferPos = digest.bufferPos; + this.buffer = Arrays.Clone(digest.buffer); + this.keyLength = digest.keyLength; + this.key = Arrays.Clone(digest.key); + this.digestLength = digest.digestLength; + this.chainValue = Arrays.Clone(digest.chainValue); + this.personalization = Arrays.Clone(digest.personalization); + this.salt = Arrays.Clone(digest.salt); + this.t0 = digest.t0; + this.t1 = digest.t1; + this.f0 = digest.f0; + } + + /** + * Basic sized constructor - size in bits. + * + * @param digestSize size of the digest in bits + */ + public Blake2bDigest(int digestSize) + { + if (digestSize < 8 || digestSize > 512 || digestSize % 8 != 0) + throw new ArgumentException("BLAKE2b digest bit length must be a multiple of 8 and not greater than 512"); + + buffer = new byte[BLOCK_LENGTH_BYTES]; + keyLength = 0; + this.digestLength = digestSize / 8; + Init(); + } + + /** + * Blake2b for authentication ("Prefix-MAC mode"). + * After calling the doFinal() method, the key will + * remain to be used for further computations of + * this instance. + * The key can be overwritten using the clearKey() method. + * + * @param key A key up to 64 bytes or null + */ + public Blake2bDigest(byte[] key) + { + buffer = new byte[BLOCK_LENGTH_BYTES]; + if (key != null) + { + this.key = new byte[key.Length]; + Array.Copy(key, 0, this.key, 0, key.Length); + + if (key.Length > 64) + throw new ArgumentException("Keys > 64 are not supported"); + + keyLength = key.Length; + Array.Copy(key, 0, buffer, 0, key.Length); + bufferPos = BLOCK_LENGTH_BYTES; // zero padding + } + digestLength = 64; + Init(); + } + + /** + * Blake2b with key, required digest length (in bytes), salt and personalization. + * After calling the doFinal() method, the key, the salt and the personal string + * will remain and might be used for further computations with this instance. + * The key can be overwritten using the clearKey() method, the salt (pepper) + * can be overwritten using the clearSalt() method. + * + * @param key A key up to 64 bytes or null + * @param digestLength from 1 up to 64 bytes + * @param salt 16 bytes or null + * @param personalization 16 bytes or null + */ + public Blake2bDigest(byte[] key, int digestLength, byte[] salt, byte[] personalization) + { + if (digestLength < 1 || digestLength > 64) + throw new ArgumentException("Invalid digest length (required: 1 - 64)"); + + this.digestLength = digestLength; + this.buffer = new byte[BLOCK_LENGTH_BYTES]; + + if (salt != null) + { + if (salt.Length != 16) + throw new ArgumentException("salt length must be exactly 16 bytes"); + + this.salt = new byte[16]; + Array.Copy(salt, 0, this.salt, 0, salt.Length); + } + if (personalization != null) + { + if (personalization.Length != 16) + throw new ArgumentException("personalization length must be exactly 16 bytes"); + + this.personalization = new byte[16]; + Array.Copy(personalization, 0, this.personalization, 0, personalization.Length); + } + if (key != null) + { + if (key.Length > 64) + throw new ArgumentException("Keys > 64 are not supported"); + + this.key = new byte[key.Length]; + Array.Copy(key, 0, this.key, 0, key.Length); + + keyLength = key.Length; + Array.Copy(key, 0, buffer, 0, key.Length); + bufferPos = BLOCK_LENGTH_BYTES; // zero padding + } + Init(); + } + + // initialize chainValue + private void Init() + { + if (chainValue == null) + { + chainValue = new ulong[8]; + + chainValue[0] = blake2b_IV[0] ^ (ulong)(digestLength | (keyLength << 8) | 0x1010000); + + // 0x1010000 = ((fanout << 16) | (depth << 24) | (leafLength << + // 32)); + // with fanout = 1; depth = 0; leafLength = 0; + chainValue[1] = blake2b_IV[1];// ^ nodeOffset; with nodeOffset = 0; + chainValue[2] = blake2b_IV[2];// ^ ( nodeDepth | (innerHashLength << 8) ); + // with nodeDepth = 0; innerHashLength = 0; + + chainValue[3] = blake2b_IV[3]; + + chainValue[4] = blake2b_IV[4]; + chainValue[5] = blake2b_IV[5]; + if (salt != null) + { + chainValue[4] ^= Pack.LE_To_UInt64(salt, 0); + chainValue[5] ^= Pack.LE_To_UInt64(salt, 8); + } + + chainValue[6] = blake2b_IV[6]; + chainValue[7] = blake2b_IV[7]; + if (personalization != null) + { + chainValue[6] ^= Pack.LE_To_UInt64(personalization, 0); + chainValue[7] ^= Pack.LE_To_UInt64(personalization, 8); + } + } + } + + private void InitializeInternalState() + { + // initialize v: + Array.Copy(chainValue, 0, internalState, 0, chainValue.Length); + Array.Copy(blake2b_IV, 0, internalState, chainValue.Length, 4); + internalState[12] = t0 ^ blake2b_IV[4]; + internalState[13] = t1 ^ blake2b_IV[5]; + internalState[14] = f0 ^ blake2b_IV[6]; + internalState[15] = blake2b_IV[7];// ^ f1 with f1 = 0 + } + + /** + * update the message digest with a single byte. + * + * @param b the input byte to be entered. + */ + public virtual void Update(byte b) + { + int remainingLength = 0; // left bytes of buffer + + // process the buffer if full else add to buffer: + remainingLength = BLOCK_LENGTH_BYTES - bufferPos; + if (remainingLength == 0) + { // full buffer + t0 += BLOCK_LENGTH_BYTES; + if (t0 == 0) + { // if message > 2^64 + t1++; + } + Compress(buffer, 0); + Array.Clear(buffer, 0, buffer.Length);// clear buffer + buffer[0] = b; + bufferPos = 1; + } + else + { + buffer[bufferPos] = b; + bufferPos++; + return; + } + } + + /** + * update the message digest with a block of bytes. + * + * @param message the byte array containing the data. + * @param offset the offset into the byte array where the data starts. + * @param len the length of the data. + */ + public virtual void BlockUpdate(byte[] message, int offset, int len) + { + if (message == null || len == 0) + return; + + int remainingLength = 0; // left bytes of buffer + + if (bufferPos != 0) + { // commenced, incomplete buffer + + // complete the buffer: + remainingLength = BLOCK_LENGTH_BYTES - bufferPos; + if (remainingLength < len) + { // full buffer + at least 1 byte + Array.Copy(message, offset, buffer, bufferPos, + remainingLength); + t0 += BLOCK_LENGTH_BYTES; + if (t0 == 0) + { // if message > 2^64 + t1++; + } + Compress(buffer, 0); + bufferPos = 0; + Array.Clear(buffer, 0, buffer.Length);// clear buffer + } + else + { + Array.Copy(message, offset, buffer, bufferPos, len); + bufferPos += len; + return; + } + } + + // process blocks except last block (also if last block is full) + int messagePos; + int blockWiseLastPos = offset + len - BLOCK_LENGTH_BYTES; + for (messagePos = offset + remainingLength; messagePos < blockWiseLastPos; messagePos += BLOCK_LENGTH_BYTES) + { // block wise 128 bytes + // without buffer: + t0 += BLOCK_LENGTH_BYTES; + if (t0 == 0) + { + t1++; + } + Compress(message, messagePos); + } + + // fill the buffer with left bytes, this might be a full block + Array.Copy(message, messagePos, buffer, 0, offset + len + - messagePos); + bufferPos += offset + len - messagePos; + } + + /** + * close the digest, producing the final digest value. The doFinal + * call leaves the digest reset. + * Key, salt and personal string remain. + * + * @param out the array the digest is to be copied into. + * @param outOffset the offset into the out array the digest is to start at. + */ + public virtual int DoFinal(byte[] output, int outOffset) + { + f0 = 0xFFFFFFFFFFFFFFFFUL; + t0 += (ulong)bufferPos; + if (bufferPos > 0 && t0 == 0) + { + t1++; + } + Compress(buffer, 0); + Array.Clear(buffer, 0, buffer.Length);// Holds eventually the key if input is null + Array.Clear(internalState, 0, internalState.Length); + + for (int i = 0; i < chainValue.Length && (i * 8 < digestLength); i++) + { + byte[] bytes = Pack.UInt64_To_LE(chainValue[i]); + + if (i * 8 < digestLength - 8) + { + Array.Copy(bytes, 0, output, outOffset + i * 8, 8); + } + else + { + Array.Copy(bytes, 0, output, outOffset + i * 8, digestLength - (i * 8)); + } + } + + Array.Clear(chainValue, 0, chainValue.Length); + + Reset(); + + return digestLength; + } + + /** + * Reset the digest back to it's initial state. + * The key, the salt and the personal string will + * remain for further computations. + */ + public virtual void Reset() + { + bufferPos = 0; + f0 = 0L; + t0 = 0L; + t1 = 0L; + chainValue = null; + Array.Clear(buffer, 0, buffer.Length); + if (key != null) + { + Array.Copy(key, 0, buffer, 0, key.Length); + bufferPos = BLOCK_LENGTH_BYTES; // zero padding + } + Init(); + } + + private void Compress(byte[] message, int messagePos) + { + InitializeInternalState(); + + ulong[] m = new ulong[16]; + for (int j = 0; j < 16; j++) + { + m[j] = Pack.LE_To_UInt64(message, messagePos + j * 8); + } + + for (int round = 0; round < ROUNDS; round++) + { + // G apply to columns of internalState:m[blake2b_sigma[round][2 * blockPos]] /+1 + G(m[blake2b_sigma[round,0]], m[blake2b_sigma[round,1]], 0, 4, 8, 12); + G(m[blake2b_sigma[round,2]], m[blake2b_sigma[round,3]], 1, 5, 9, 13); + G(m[blake2b_sigma[round,4]], m[blake2b_sigma[round,5]], 2, 6, 10, 14); + G(m[blake2b_sigma[round,6]], m[blake2b_sigma[round,7]], 3, 7, 11, 15); + // G apply to diagonals of internalState: + G(m[blake2b_sigma[round,8]], m[blake2b_sigma[round,9]], 0, 5, 10, 15); + G(m[blake2b_sigma[round,10]], m[blake2b_sigma[round,11]], 1, 6, 11, 12); + G(m[blake2b_sigma[round,12]], m[blake2b_sigma[round,13]], 2, 7, 8, 13); + G(m[blake2b_sigma[round,14]], m[blake2b_sigma[round,15]], 3, 4, 9, 14); + } + + // update chain values: + for (int offset = 0; offset < chainValue.Length; offset++) + { + chainValue[offset] = chainValue[offset] ^ internalState[offset] ^ internalState[offset + 8]; + } + } + + private void G(ulong m1, ulong m2, int posA, int posB, int posC, int posD) + { + internalState[posA] = internalState[posA] + internalState[posB] + m1; + internalState[posD] = Rotr64(internalState[posD] ^ internalState[posA], 32); + internalState[posC] = internalState[posC] + internalState[posD]; + internalState[posB] = Rotr64(internalState[posB] ^ internalState[posC], 24); // replaces 25 of BLAKE + internalState[posA] = internalState[posA] + internalState[posB] + m2; + internalState[posD] = Rotr64(internalState[posD] ^ internalState[posA], 16); + internalState[posC] = internalState[posC] + internalState[posD]; + internalState[posB] = Rotr64(internalState[posB] ^ internalState[posC], 63); // replaces 11 of BLAKE + } + + private static ulong Rotr64(ulong x, int rot) + { + return x >> rot | x << -rot; + } + + /** + * return the algorithm name + * + * @return the algorithm name + */ + public virtual string AlgorithmName + { + get { return "BLAKE2b"; } + } + + /** + * return the size, in bytes, of the digest produced by this message digest. + * + * @return the size, in bytes, of the digest produced by this message digest. + */ + public virtual int GetDigestSize() + { + return digestLength; + } + + /** + * Return the size in bytes of the internal buffer the digest applies it's compression + * function to. + * + * @return byte length of the digests internal buffer. + */ + public virtual int GetByteLength() + { + return BLOCK_LENGTH_BYTES; + } + + /** + * Overwrite the key + * if it is no longer used (zeroization) + */ + public virtual void ClearKey() + { + if (key != null) + { + Array.Clear(key, 0, key.Length); + Array.Clear(buffer, 0, buffer.Length); + } + } + + /** + * Overwrite the salt (pepper) if it + * is secret and no longer used (zeroization) + */ + public virtual void ClearSalt() + { + if (salt != null) + { + Array.Clear(salt, 0, salt.Length); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2bDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2bDigest.cs.meta new file mode 100644 index 00000000..d6d97211 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2bDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a1380ac762da4394197da48540465160 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2sDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2sDigest.cs new file mode 100644 index 00000000..fb94488d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2sDigest.cs @@ -0,0 +1,555 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /* + The BLAKE2 cryptographic hash function was designed by Jean- + Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn, and Christian + Winnerlein. + + Reference Implementation and Description can be found at: https://blake2.net/ + RFC: https://tools.ietf.org/html/rfc7693 + + This implementation does not support the Tree Hashing Mode. + + For unkeyed hashing, developers adapting BLAKE2 to ASN.1 - based + message formats SHOULD use the OID tree at x = 1.3.6.1.4.1.1722.12.2. + + Algorithm | Target | Collision | Hash | Hash ASN.1 | + Identifier | Arch | Security | nn | OID Suffix | + ---------------+--------+-----------+------+------------+ + id-blake2s128 | 32-bit | 2**64 | 16 | x.2.4 | + id-blake2s160 | 32-bit | 2**80 | 20 | x.2.5 | + id-blake2s224 | 32-bit | 2**112 | 28 | x.2.7 | + id-blake2s256 | 32-bit | 2**128 | 32 | x.2.8 | + ---------------+--------+-----------+------+------------+ + */ + + /** + * Implementation of the cryptographic hash function BLAKE2s. + *

+ * BLAKE2s offers a built-in keying mechanism to be used directly + * for authentication ("Prefix-MAC") rather than a HMAC construction. + *

+ * BLAKE2s offers a built-in support for a salt for randomized hashing + * and a personal string for defining a unique hash function for each application. + *

+ * BLAKE2s is optimized for 32-bit platforms and produces digests of any size + * between 1 and 32 bytes. + */ + public class Blake2sDigest + : IDigest + { + /** + * BLAKE2s Initialization Vector + **/ + private static readonly uint[] blake2s_IV = + // Produced from the square root of primes 2, 3, 5, 7, 11, 13, 17, 19. + // The same as SHA-256 IV. + { + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, + 0xa54ff53a, 0x510e527f, 0x9b05688c, + 0x1f83d9ab, 0x5be0cd19 + }; + + /** + * Message word permutations + **/ + private static readonly byte[,] blake2s_sigma = + { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, + { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, + { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, + { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, + { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, + { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, + { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, + { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, + { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 } + }; + + private const int ROUNDS = 10; // to use for Catenas H' + private const int BLOCK_LENGTH_BYTES = 64;// bytes + + // General parameters: + private int digestLength = 32; // 1- 32 bytes + private int keyLength = 0; // 0 - 32 bytes for keyed hashing for MAC + private byte[] salt = null; + private byte[] personalization = null; + private byte[] key = null; + + // Tree hashing parameters: + // Because this class does not implement the Tree Hashing Mode, + // these parameters can be treated as constants (see Init() function) + /* + * private int fanout = 1; // 0-255 + * private int depth = 1; // 1 - 255 + * private int leafLength= 0; + * private long nodeOffset = 0L; + * private int nodeDepth = 0; + * private int innerHashLength = 0; + */ + + /** + * Whenever this buffer overflows, it will be processed in the Compress() + * function. For performance issues, long messages will not use this buffer. + */ + private byte[] buffer = null; + /** + * Position of last inserted byte + **/ + private int bufferPos = 0;// a value from 0 up to BLOCK_LENGTH_BYTES + + /** + * Internal state, in the BLAKE2 paper it is called v + **/ + private uint[] internalState = new uint[16]; + /** + * State vector, in the BLAKE2 paper it is called h + **/ + private uint[] chainValue = null; + + // counter (counts bytes): Length up to 2^64 are supported + /** + * holds least significant bits of counter + **/ + private uint t0 = 0; + /** + * holds most significant bits of counter + **/ + private uint t1 = 0; + /** + * finalization flag, for last block: ~0 + **/ + private uint f0 = 0; + + // For Tree Hashing Mode, not used here: + // private long f1 = 0L; // finalization flag, for last node: ~0L + + /** + * BLAKE2s-256 for hashing. + */ + public Blake2sDigest() + : this(256) + { + } + + public Blake2sDigest(Blake2sDigest digest) + { + this.bufferPos = digest.bufferPos; + this.buffer = Arrays.Clone(digest.buffer); + this.keyLength = digest.keyLength; + this.key = Arrays.Clone(digest.key); + this.digestLength = digest.digestLength; + this.chainValue = Arrays.Clone(digest.chainValue); + this.personalization = Arrays.Clone(digest.personalization); + } + + /** + * BLAKE2s for hashing. + * + * @param digestBits the desired digest length in bits. Must be a multiple of 8 and less than 256. + */ + public Blake2sDigest(int digestBits) + { + if (digestBits < 8 || digestBits > 256 || digestBits % 8 != 0) + throw new ArgumentException("BLAKE2s digest bit length must be a multiple of 8 and not greater than 256"); + + buffer = new byte[BLOCK_LENGTH_BYTES]; + keyLength = 0; + digestLength = digestBits / 8; + Init(); + } + + /** + * BLAKE2s for authentication ("Prefix-MAC mode"). + *

+ * After calling the doFinal() method, the key will remain to be used for + * further computations of this instance. The key can be overwritten using + * the clearKey() method. + * + * @param key a key up to 32 bytes or null + */ + public Blake2sDigest(byte[] key) + { + buffer = new byte[BLOCK_LENGTH_BYTES]; + if (key != null) + { + if (key.Length > 32) + throw new ArgumentException("Keys > 32 are not supported"); + + this.key = new byte[key.Length]; + Array.Copy(key, 0, this.key, 0, key.Length); + + keyLength = key.Length; + Array.Copy(key, 0, buffer, 0, key.Length); + bufferPos = BLOCK_LENGTH_BYTES; // zero padding + } + digestLength = 32; + Init(); + } + + /** + * BLAKE2s with key, required digest length, salt and personalization. + *

+ * After calling the doFinal() method, the key, the salt and the personal + * string will remain and might be used for further computations with this + * instance. The key can be overwritten using the clearKey() method, the + * salt (pepper) can be overwritten using the clearSalt() method. + * + * @param key a key up to 32 bytes or null + * @param digestBytes from 1 up to 32 bytes + * @param salt 8 bytes or null + * @param personalization 8 bytes or null + */ + public Blake2sDigest(byte[] key, int digestBytes, byte[] salt, + byte[] personalization) + { + if (digestBytes < 1 || digestBytes > 32) + throw new ArgumentException("Invalid digest length (required: 1 - 32)"); + + this.digestLength = digestBytes; + this.buffer = new byte[BLOCK_LENGTH_BYTES]; + + if (salt != null) + { + if (salt.Length != 8) + throw new ArgumentException("Salt length must be exactly 8 bytes"); + + this.salt = new byte[8]; + Array.Copy(salt, 0, this.salt, 0, salt.Length); + } + if (personalization != null) + { + if (personalization.Length != 8) + throw new ArgumentException("Personalization length must be exactly 8 bytes"); + + this.personalization = new byte[8]; + Array.Copy(personalization, 0, this.personalization, 0, personalization.Length); + } + if (key != null) + { + if (key.Length > 32) + throw new ArgumentException("Keys > 32 bytes are not supported"); + + this.key = new byte[key.Length]; + Array.Copy(key, 0, this.key, 0, key.Length); + + keyLength = key.Length; + Array.Copy(key, 0, buffer, 0, key.Length); + bufferPos = BLOCK_LENGTH_BYTES; // zero padding + } + Init(); + } + + // initialize chainValue + private void Init() + { + if (chainValue == null) + { + chainValue = new uint[8]; + + chainValue[0] = blake2s_IV[0] ^ (uint)(digestLength | (keyLength << 8) | 0x1010000); + // 0x1010000 = ((fanout << 16) | (depth << 24)); + // with fanout = 1; depth = 0; + chainValue[1] = blake2s_IV[1];// ^ leafLength; with leafLength = 0; + chainValue[2] = blake2s_IV[2];// ^ nodeOffset; with nodeOffset = 0; + chainValue[3] = blake2s_IV[3];// ^ ( (nodeOffset << 32) | (nodeDepth << 16) | (innerHashLength << 24) ); + // with nodeDepth = 0; innerHashLength = 0; + + chainValue[4] = blake2s_IV[4]; + chainValue[5] = blake2s_IV[5]; + if (salt != null) + { + chainValue[4] ^= Pack.LE_To_UInt32(salt, 0); + chainValue[5] ^= Pack.LE_To_UInt32(salt, 4); + } + + chainValue[6] = blake2s_IV[6]; + chainValue[7] = blake2s_IV[7]; + if (personalization != null) + { + chainValue[6] ^= Pack.LE_To_UInt32(personalization, 0); + chainValue[7] ^= Pack.LE_To_UInt32(personalization, 4); + } + } + } + + private void InitializeInternalState() + { + // initialize v: + Array.Copy(chainValue, 0, internalState, 0, chainValue.Length); + Array.Copy(blake2s_IV, 0, internalState, chainValue.Length, 4); + internalState[12] = t0 ^ blake2s_IV[4]; + internalState[13] = t1 ^ blake2s_IV[5]; + internalState[14] = f0 ^ blake2s_IV[6]; + internalState[15] = blake2s_IV[7];// ^ f1 with f1 = 0 + } + + /** + * Update the message digest with a single byte. + * + * @param b the input byte to be entered. + */ + public virtual void Update(byte b) + { + int remainingLength; // left bytes of buffer + + // process the buffer if full else add to buffer: + remainingLength = BLOCK_LENGTH_BYTES - bufferPos; + if (remainingLength == 0) + { // full buffer + t0 += BLOCK_LENGTH_BYTES; + if (t0 == 0) + { // if message > 2^32 + t1++; + } + Compress(buffer, 0); + Array.Clear(buffer, 0, buffer.Length);// clear buffer + buffer[0] = b; + bufferPos = 1; + } + else + { + buffer[bufferPos] = b; + bufferPos++; + } + } + + /** + * Update the message digest with a block of bytes. + * + * @param message the byte array containing the data. + * @param offset the offset into the byte array where the data starts. + * @param len the length of the data. + */ + public virtual void BlockUpdate(byte[] message, int offset, int len) + { + if (message == null || len == 0) + return; + + int remainingLength = 0; // left bytes of buffer + + if (bufferPos != 0) + { // commenced, incomplete buffer + + // complete the buffer: + remainingLength = BLOCK_LENGTH_BYTES - bufferPos; + if (remainingLength < len) + { // full buffer + at least 1 byte + Array.Copy(message, offset, buffer, bufferPos, remainingLength); + t0 += BLOCK_LENGTH_BYTES; + if (t0 == 0) + { // if message > 2^32 + t1++; + } + Compress(buffer, 0); + bufferPos = 0; + Array.Clear(buffer, 0, buffer.Length);// clear buffer + } + else + { + Array.Copy(message, offset, buffer, bufferPos, len); + bufferPos += len; + return; + } + } + + // process blocks except last block (also if last block is full) + int messagePos; + int blockWiseLastPos = offset + len - BLOCK_LENGTH_BYTES; + for (messagePos = offset + remainingLength; + messagePos < blockWiseLastPos; + messagePos += BLOCK_LENGTH_BYTES) + { // block wise 64 bytes + // without buffer: + t0 += BLOCK_LENGTH_BYTES; + if (t0 == 0) + { + t1++; + } + Compress(message, messagePos); + } + + // fill the buffer with left bytes, this might be a full block + Array.Copy(message, messagePos, buffer, 0, offset + len + - messagePos); + bufferPos += offset + len - messagePos; + } + + /** + * Close the digest, producing the final digest value. The doFinal() call + * leaves the digest reset. Key, salt and personal string remain. + * + * @param out the array the digest is to be copied into. + * @param outOffset the offset into the out array the digest is to start at. + */ + public virtual int DoFinal(byte[] output, int outOffset) + { + f0 = 0xFFFFFFFFU; + t0 += (uint)bufferPos; + // bufferPos may be < 64, so (t0 == 0) does not work + // for 2^32 < message length > 2^32 - 63 + if ((t0 < 0) && (bufferPos > -t0)) + { + t1++; + } + Compress(buffer, 0); + Array.Clear(buffer, 0, buffer.Length);// Holds eventually the key if input is null + Array.Clear(internalState, 0, internalState.Length); + + for (int i = 0; i < chainValue.Length && (i * 4 < digestLength); i++) + { + byte[] bytes = Pack.UInt32_To_LE(chainValue[i]); + + if (i * 4 < digestLength - 4) + { + Array.Copy(bytes, 0, output, outOffset + i * 4, 4); + } + else + { + Array.Copy(bytes, 0, output, outOffset + i * 4, digestLength - (i * 4)); + } + } + + Array.Clear(chainValue, 0, chainValue.Length); + + Reset(); + + return digestLength; + } + + /** + * Reset the digest back to its initial state. The key, the salt and the + * personal string will remain for further computations. + */ + public virtual void Reset() + { + bufferPos = 0; + f0 = 0; + t0 = 0; + t1 = 0; + chainValue = null; + Array.Clear(buffer, 0, buffer.Length); + if (key != null) + { + Array.Copy(key, 0, buffer, 0, key.Length); + bufferPos = BLOCK_LENGTH_BYTES; // zero padding + } + Init(); + } + + private void Compress(byte[] message, int messagePos) + { + InitializeInternalState(); + + uint[] m = new uint[16]; + for (int j = 0; j < 16; j++) + { + m[j] = Pack.LE_To_UInt32(message, messagePos + j * 4); + } + + for (int round = 0; round < ROUNDS; round++) + { + + // G apply to columns of internalState:m[blake2s_sigma[round][2 * + // blockPos]] /+1 + G(m[blake2s_sigma[round,0]], m[blake2s_sigma[round,1]], 0, 4, 8, 12); + G(m[blake2s_sigma[round,2]], m[blake2s_sigma[round,3]], 1, 5, 9, 13); + G(m[blake2s_sigma[round,4]], m[blake2s_sigma[round,5]], 2, 6, 10, 14); + G(m[blake2s_sigma[round,6]], m[blake2s_sigma[round,7]], 3, 7, 11, 15); + // G apply to diagonals of internalState: + G(m[blake2s_sigma[round,8]], m[blake2s_sigma[round,9]], 0, 5, 10, 15); + G(m[blake2s_sigma[round,10]], m[blake2s_sigma[round,11]], 1, 6, 11, 12); + G(m[blake2s_sigma[round,12]], m[blake2s_sigma[round,13]], 2, 7, 8, 13); + G(m[blake2s_sigma[round,14]], m[blake2s_sigma[round,15]], 3, 4, 9, 14); + } + + // update chain values: + for (int offset = 0; offset < chainValue.Length; offset++) + { + chainValue[offset] = chainValue[offset] ^ internalState[offset] ^ internalState[offset + 8]; + } + } + + private void G(uint m1, uint m2, int posA, int posB, int posC, int posD) + { + internalState[posA] = internalState[posA] + internalState[posB] + m1; + internalState[posD] = rotr32(internalState[posD] ^ internalState[posA], 16); + internalState[posC] = internalState[posC] + internalState[posD]; + internalState[posB] = rotr32(internalState[posB] ^ internalState[posC], 12); + internalState[posA] = internalState[posA] + internalState[posB] + m2; + internalState[posD] = rotr32(internalState[posD] ^ internalState[posA], 8); + internalState[posC] = internalState[posC] + internalState[posD]; + internalState[posB] = rotr32(internalState[posB] ^ internalState[posC], 7); + } + + private uint rotr32(uint x, int rot) + { + return x >> rot | x << -rot; + } + + /** + * Return the algorithm name. + * + * @return the algorithm name + */ + public virtual string AlgorithmName + { + get { return "BLAKE2s"; } + } + + /** + * Return the size in bytes of the digest produced by this message digest. + * + * @return the size in bytes of the digest produced by this message digest. + */ + public virtual int GetDigestSize() + { + return digestLength; + } + + /** + * Return the size in bytes of the internal buffer the digest applies its + * compression function to. + * + * @return byte length of the digest's internal buffer. + */ + public virtual int GetByteLength() + { + return BLOCK_LENGTH_BYTES; + } + + /** + * Overwrite the key if it is no longer used (zeroization). + */ + public virtual void ClearKey() + { + if (key != null) + { + Array.Clear(key, 0, key.Length); + Array.Clear(buffer, 0, buffer.Length); + } + } + + /** + * Overwrite the salt (pepper) if it is secret and no longer used + * (zeroization). + */ + public virtual void ClearSalt() + { + if (salt != null) + { + Array.Clear(salt, 0, salt.Length); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2sDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2sDigest.cs.meta new file mode 100644 index 00000000..52b4c800 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Blake2sDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1534bbcd31a51bd478d6266c448de7fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/DSTU7564Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/DSTU7564Digest.cs new file mode 100644 index 00000000..72e73537 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/DSTU7564Digest.cs @@ -0,0 +1,534 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * implementation of Ukrainian DSTU 7564 hash function + */ + public class Dstu7564Digest + : IDigest, IMemoable + { + private const int NB_512 = 8; //Number of 8-byte words in state for <=256-bit hash code. + private const int NB_1024 = 16; //Number of 8-byte words in state for <=512-bit hash code. + + private const int NR_512 = 10; //Number of rounds for 512-bit state. + private const int NR_1024 = 14; //Number of rounds for 1024-bit state. + + private int hashSize; + private int blockSize; + + private int columns; + private int rounds; + + private ulong[] state; + private ulong[] tempState1; + private ulong[] tempState2; + + // TODO Guard against 'inputBlocks' overflow (2^64 blocks) + private ulong inputBlocks; + private int bufOff; + private byte[] buf; + + public Dstu7564Digest(Dstu7564Digest digest) + { + CopyIn(digest); + } + + private void CopyIn(Dstu7564Digest digest) + { + this.hashSize = digest.hashSize; + this.blockSize = digest.blockSize; + + this.rounds = digest.rounds; + if (columns > 0 && columns == digest.columns) + { + Array.Copy(digest.state, 0, state, 0, columns); + Array.Copy(digest.buf, 0, buf, 0, blockSize); + } + else + { + this.columns = digest.columns; + this.state = Arrays.Clone(digest.state); + this.tempState1 = new ulong[columns]; + this.tempState2 = new ulong[columns]; + this.buf = Arrays.Clone(digest.buf); + } + + this.inputBlocks = digest.inputBlocks; + this.bufOff = digest.bufOff; + } + + public Dstu7564Digest(int hashSizeBits) + { + if (hashSizeBits == 256 || hashSizeBits == 384 || hashSizeBits == 512) + { + this.hashSize = hashSizeBits / 8; + } + else + { + throw new ArgumentException("Hash size is not recommended. Use 256/384/512 instead"); + } + + if (hashSizeBits > 256) + { + this.columns = NB_1024; + this.rounds = NR_1024; + } + else + { + this.columns = NB_512; + this.rounds = NR_512; + } + + this.blockSize = columns << 3; + + this.state = new ulong[columns]; + this.state[0] = (ulong)blockSize; + + this.tempState1 = new ulong[columns]; + this.tempState2 = new ulong[columns]; + + this.buf = new byte[blockSize]; + } + + public virtual string AlgorithmName + { + get { return "DSTU7564"; } + } + + public virtual int GetDigestSize() + { + return hashSize; + } + + public virtual int GetByteLength() + { + return blockSize; + } + + public virtual void Update(byte input) + { + buf[bufOff++] = input; + if (bufOff == blockSize) + { + ProcessBlock(buf, 0); + bufOff = 0; + ++inputBlocks; + } + } + + public virtual void BlockUpdate(byte[] input, int inOff, int length) + { + while (bufOff != 0 && length > 0) + { + Update(input[inOff++]); + --length; + } + + if (length > 0) + { + while (length >= blockSize) + { + ProcessBlock(input, inOff); + inOff += blockSize; + length -= blockSize; + ++inputBlocks; + } + + while (length > 0) + { + Update(input[inOff++]); + --length; + } + } + } + + public virtual int DoFinal(byte[] output, int outOff) + { + // Apply padding: terminator byte and 96-bit length field + { + int inputBytes = bufOff; + buf[bufOff++] = (byte)0x80; + + int lenPos = blockSize - 12; + if (bufOff > lenPos) + { + while (bufOff < blockSize) + { + buf[bufOff++] = 0; + } + bufOff = 0; + ProcessBlock(buf, 0); + } + + while (bufOff < lenPos) + { + buf[bufOff++] = 0; + } + + ulong c = ((inputBlocks & 0xFFFFFFFFUL) * (ulong)blockSize + (uint)inputBytes) << 3; + Pack.UInt32_To_LE((uint)c, buf, bufOff); + bufOff += 4; + c >>= 32; + c += ((inputBlocks >> 32) * (ulong)blockSize) << 3; + Pack.UInt64_To_LE(c, buf, bufOff); + // bufOff += 8; + ProcessBlock(buf, 0); + } + + { + Array.Copy(state, 0, tempState1, 0, columns); + + P(tempState1); + + for (int col = 0; col < columns; ++col) + { + state[col] ^= tempState1[col]; + } + } + + int neededColumns = hashSize / 8; + for (int col = columns - neededColumns; col < columns; ++col) + { + Pack.UInt64_To_LE(state[col], output, outOff); + outOff += 8; + } + + Reset(); + + return hashSize; + } + + public virtual void Reset() + { + Array.Clear(state, 0, state.Length); + state[0] = (ulong)blockSize; + + inputBlocks = 0; + bufOff = 0; + } + + protected virtual void ProcessBlock(byte[] input, int inOff) + { + int pos = inOff; + for (int col = 0; col < columns; ++col) + { + ulong word = Pack.LE_To_UInt64(input, pos); + pos += 8; + + tempState1[col] = state[col] ^ word; + tempState2[col] = word; + } + + P(tempState1); + Q(tempState2); + + for (int col = 0; col < columns; ++col) + { + state[col] ^= tempState1[col] ^ tempState2[col]; + } + } + + private void P(ulong[] s) + { + for (int round = 0; round < rounds; ++round) + { + ulong rc = (ulong)round; + + /* AddRoundConstants */ + for (int col = 0; col < columns; ++col) + { + s[col] ^= rc; + rc += 0x10L; + } + + ShiftRows(s); + SubBytes(s); + MixColumns(s); + } + } + + private void Q(ulong[] s) + { + for (int round = 0; round < rounds; ++round) + { + /* AddRoundConstantsQ */ + ulong rc = ((ulong)(((columns - 1) << 4) ^ round) << 56) | 0x00F0F0F0F0F0F0F3UL; + + for (int col = 0; col < columns; ++col) + { + s[col] += rc; + rc -= 0x1000000000000000L; + } + + ShiftRows(s); + SubBytes(s); + MixColumns(s); + } + } + + private static ulong MixColumn(ulong c) + { + //// Calculate column multiplied by powers of 'x' + //ulong x0 = c; + //ulong x1 = ((x0 & 0x7F7F7F7F7F7F7F7FUL) << 1) ^ (((x0 & 0x8080808080808080UL) >> 7) * 0x1DUL); + //ulong x2 = ((x1 & 0x7F7F7F7F7F7F7F7FUL) << 1) ^ (((x1 & 0x8080808080808080UL) >> 7) * 0x1DUL); + //ulong x3 = ((x2 & 0x7F7F7F7F7F7F7F7FUL) << 1) ^ (((x2 & 0x8080808080808080UL) >> 7) * 0x1DUL); + + //// Calculate products with circulant matrix from (0x01, 0x01, 0x05, 0x01, 0x08, 0x06, 0x07, 0x04) + //ulong m0 = x0; + //ulong m1 = x0; + //ulong m2 = x0 ^ x2; + //ulong m3 = x0; + //ulong m4 = x3; + //ulong m5 = x1 ^ x2; + //ulong m6 = x0 ^ x1 ^ x2; + //ulong m7 = x2; + + //// Assemble the rotated products + //return m0 + // ^ Rotate(8, m1) + // ^ Rotate(16, m2) + // ^ Rotate(24, m3) + // ^ Rotate(32, m4) + // ^ Rotate(40, m5) + // ^ Rotate(48, m6) + // ^ Rotate(56, m7); + + // Multiply elements by 'x' + ulong x1 = ((c & 0x7F7F7F7F7F7F7F7FUL) << 1) ^ (((c & 0x8080808080808080UL) >> 7) * 0x1DUL); + ulong u, v; + + u = Rotate(8, c) ^ c; + u ^= Rotate(16, u); + u ^= Rotate(48, c); + + v = u ^ c ^ x1; + + // Multiply elements by 'x^2' + v = ((v & 0x3F3F3F3F3F3F3F3FUL) << 2) ^ (((v & 0x8080808080808080UL) >> 6) * 0x1DUL) ^ (((v & 0x4040404040404040UL) >> 6) * 0x1DUL); + + return u ^ Rotate(32, v) ^ Rotate(40, x1) ^ Rotate(48, x1); + } + + private void MixColumns(ulong[] s) + { + for (int col = 0; col < columns; ++col) + { + s[col] = MixColumn(s[col]); + } + } + + private static ulong Rotate(int n, ulong x) + { + return (x >> n) | (x << -n); + } + + private void ShiftRows(ulong[] s) + { + switch (columns) + { + case NB_512: + { + ulong c0 = s[0], c1 = s[1], c2 = s[2], c3 = s[3]; + ulong c4 = s[4], c5 = s[5], c6 = s[6], c7 = s[7]; + ulong d; + + d = (c0 ^ c4) & 0xFFFFFFFF00000000UL; c0 ^= d; c4 ^= d; + d = (c1 ^ c5) & 0x00FFFFFFFF000000UL; c1 ^= d; c5 ^= d; + d = (c2 ^ c6) & 0x0000FFFFFFFF0000UL; c2 ^= d; c6 ^= d; + d = (c3 ^ c7) & 0x000000FFFFFFFF00UL; c3 ^= d; c7 ^= d; + + d = (c0 ^ c2) & 0xFFFF0000FFFF0000UL; c0 ^= d; c2 ^= d; + d = (c1 ^ c3) & 0x00FFFF0000FFFF00UL; c1 ^= d; c3 ^= d; + d = (c4 ^ c6) & 0xFFFF0000FFFF0000UL; c4 ^= d; c6 ^= d; + d = (c5 ^ c7) & 0x00FFFF0000FFFF00UL; c5 ^= d; c7 ^= d; + + d = (c0 ^ c1) & 0xFF00FF00FF00FF00UL; c0 ^= d; c1 ^= d; + d = (c2 ^ c3) & 0xFF00FF00FF00FF00UL; c2 ^= d; c3 ^= d; + d = (c4 ^ c5) & 0xFF00FF00FF00FF00UL; c4 ^= d; c5 ^= d; + d = (c6 ^ c7) & 0xFF00FF00FF00FF00UL; c6 ^= d; c7 ^= d; + + s[0] = c0; s[1] = c1; s[2] = c2; s[3] = c3; + s[4] = c4; s[5] = c5; s[6] = c6; s[7] = c7; + break; + } + case NB_1024: + { + ulong c00 = s[0], c01 = s[1], c02 = s[2], c03 = s[3]; + ulong c04 = s[4], c05 = s[5], c06 = s[6], c07 = s[7]; + ulong c08 = s[8], c09 = s[9], c10 = s[10], c11 = s[11]; + ulong c12 = s[12], c13 = s[13], c14 = s[14], c15 = s[15]; + ulong d; + + // NOTE: Row 7 is shifted by 11 + + d = (c00 ^ c08) & 0xFF00000000000000UL; c00 ^= d; c08 ^= d; + d = (c01 ^ c09) & 0xFF00000000000000UL; c01 ^= d; c09 ^= d; + d = (c02 ^ c10) & 0xFFFF000000000000UL; c02 ^= d; c10 ^= d; + d = (c03 ^ c11) & 0xFFFFFF0000000000UL; c03 ^= d; c11 ^= d; + d = (c04 ^ c12) & 0xFFFFFFFF00000000UL; c04 ^= d; c12 ^= d; + d = (c05 ^ c13) & 0x00FFFFFFFF000000UL; c05 ^= d; c13 ^= d; + d = (c06 ^ c14) & 0x00FFFFFFFFFF0000UL; c06 ^= d; c14 ^= d; + d = (c07 ^ c15) & 0x00FFFFFFFFFFFF00UL; c07 ^= d; c15 ^= d; + + d = (c00 ^ c04) & 0x00FFFFFF00000000UL; c00 ^= d; c04 ^= d; + d = (c01 ^ c05) & 0xFFFFFFFFFF000000UL; c01 ^= d; c05 ^= d; + d = (c02 ^ c06) & 0xFF00FFFFFFFF0000UL; c02 ^= d; c06 ^= d; + d = (c03 ^ c07) & 0xFF0000FFFFFFFF00UL; c03 ^= d; c07 ^= d; + d = (c08 ^ c12) & 0x00FFFFFF00000000UL; c08 ^= d; c12 ^= d; + d = (c09 ^ c13) & 0xFFFFFFFFFF000000UL; c09 ^= d; c13 ^= d; + d = (c10 ^ c14) & 0xFF00FFFFFFFF0000UL; c10 ^= d; c14 ^= d; + d = (c11 ^ c15) & 0xFF0000FFFFFFFF00UL; c11 ^= d; c15 ^= d; + + d = (c00 ^ c02) & 0xFFFF0000FFFF0000UL; c00 ^= d; c02 ^= d; + d = (c01 ^ c03) & 0x00FFFF0000FFFF00UL; c01 ^= d; c03 ^= d; + d = (c04 ^ c06) & 0xFFFF0000FFFF0000UL; c04 ^= d; c06 ^= d; + d = (c05 ^ c07) & 0x00FFFF0000FFFF00UL; c05 ^= d; c07 ^= d; + d = (c08 ^ c10) & 0xFFFF0000FFFF0000UL; c08 ^= d; c10 ^= d; + d = (c09 ^ c11) & 0x00FFFF0000FFFF00UL; c09 ^= d; c11 ^= d; + d = (c12 ^ c14) & 0xFFFF0000FFFF0000UL; c12 ^= d; c14 ^= d; + d = (c13 ^ c15) & 0x00FFFF0000FFFF00UL; c13 ^= d; c15 ^= d; + + d = (c00 ^ c01) & 0xFF00FF00FF00FF00UL; c00 ^= d; c01 ^= d; + d = (c02 ^ c03) & 0xFF00FF00FF00FF00UL; c02 ^= d; c03 ^= d; + d = (c04 ^ c05) & 0xFF00FF00FF00FF00UL; c04 ^= d; c05 ^= d; + d = (c06 ^ c07) & 0xFF00FF00FF00FF00UL; c06 ^= d; c07 ^= d; + d = (c08 ^ c09) & 0xFF00FF00FF00FF00UL; c08 ^= d; c09 ^= d; + d = (c10 ^ c11) & 0xFF00FF00FF00FF00UL; c10 ^= d; c11 ^= d; + d = (c12 ^ c13) & 0xFF00FF00FF00FF00UL; c12 ^= d; c13 ^= d; + d = (c14 ^ c15) & 0xFF00FF00FF00FF00UL; c14 ^= d; c15 ^= d; + + s[0] = c00; s[1] = c01; s[2] = c02; s[3] = c03; + s[4] = c04; s[5] = c05; s[6] = c06; s[7] = c07; + s[8] = c08; s[9] = c09; s[10] = c10; s[11] = c11; + s[12] = c12; s[13] = c13; s[14] = c14; s[15] = c15; + break; + } + default: + { + throw new InvalidOperationException("unsupported state size: only 512/1024 are allowed"); + } + } + } + + private void SubBytes(ulong[] s) + { + for (int i = 0; i < columns; ++i) + { + ulong u = s[i]; + uint lo = (uint)u, hi = (uint)(u >> 32); + byte t0 = S0[lo & 0xFF]; + byte t1 = S1[(lo >> 8) & 0xFF]; + byte t2 = S2[(lo >> 16) & 0xFF]; + byte t3 = S3[lo >> 24]; + lo = (uint)t0 | ((uint)t1 << 8) | ((uint)t2 << 16) | ((uint)t3 << 24); + byte t4 = S0[hi & 0xFF]; + byte t5 = S1[(hi >> 8) & 0xFF]; + byte t6 = S2[(hi >> 16) & 0xFF]; + byte t7 = S3[hi >> 24]; + hi = (uint)t4 | ((uint)t5 << 8) | ((uint)t6 << 16) | ((uint)t7 << 24); + s[i] = (ulong)lo | ((ulong)hi << 32); + } + } + + private static readonly byte[] S0 = new byte[] { + 0xa8, 0x43, 0x5f, 0x06, 0x6b, 0x75, 0x6c, 0x59, 0x71, 0xdf, 0x87, 0x95, 0x17, 0xf0, 0xd8, 0x09, + 0x6d, 0xf3, 0x1d, 0xcb, 0xc9, 0x4d, 0x2c, 0xaf, 0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, 0x82, + 0xf7, 0xea, 0x0a, 0x0d, 0x7e, 0xf8, 0x50, 0x1a, 0xc4, 0x07, 0x57, 0xb8, 0x3c, 0x62, 0xe3, 0xc8, + 0xac, 0x52, 0x64, 0x10, 0xd0, 0xd9, 0x13, 0x0c, 0x12, 0x29, 0x51, 0xb9, 0xcf, 0xd6, 0x73, 0x8d, + 0x81, 0x54, 0xc0, 0xed, 0x4e, 0x44, 0xa7, 0x2a, 0x85, 0x25, 0xe6, 0xca, 0x7c, 0x8b, 0x56, 0x80 + }; + + private static readonly byte[] S1 = new byte[] { + 0xce, 0xbb, 0xeb, 0x92, 0xea, 0xcb, 0x13, 0xc1, 0xe9, 0x3a, 0xd6, 0xb2, 0xd2, 0x90, 0x17, 0xf8, + 0x42, 0x15, 0x56, 0xb4, 0x65, 0x1c, 0x88, 0x43, 0xc5, 0x5c, 0x36, 0xba, 0xf5, 0x57, 0x67, 0x8d, + 0x31, 0xf6, 0x64, 0x58, 0x9e, 0xf4, 0x22, 0xaa, 0x75, 0x0f, 0x02, 0xb1, 0xdf, 0x6d, 0x73, 0x4d, + 0x7c, 0x26, 0x2e, 0xf7, 0x08, 0x5d, 0x44, 0x3e, 0x9f, 0x14, 0xc8, 0xae, 0x54, 0x10, 0xd8, 0xbc, + 0x1a, 0x6b, 0x69, 0xf3, 0xbd, 0x33, 0xab, 0xfa, 0xd1, 0x9b, 0x68, 0x4e, 0x16, 0x95, 0x91, 0xee, + 0x4c, 0x63, 0x8e, 0x5b, 0xcc, 0x3c, 0x19, 0xa1, 0x81, 0x49, 0x7b, 0xd9, 0x6f, 0x37, 0x60, 0xca, + 0xe7, 0x2b, 0x48, 0xfd, 0x96, 0x45, 0xfc, 0x41, 0x12, 0x0d, 0x79, 0xe5, 0x89, 0x8c, 0xe3, 0x20, + 0x30, 0xdc, 0xb7, 0x6c, 0x4a, 0xb5, 0x3f, 0x97, 0xd4, 0x62, 0x2d, 0x06, 0xa4, 0xa5, 0x83, 0x5f, + 0x2a, 0xda, 0xc9, 0x00, 0x7e, 0xa2, 0x55, 0xbf, 0x11, 0xd5, 0x9c, 0xcf, 0x0e, 0x0a, 0x3d, 0x51, + 0x7d, 0x93, 0x1b, 0xfe, 0xc4, 0x47, 0x09, 0x86, 0x0b, 0x8f, 0x9d, 0x6a, 0x07, 0xb9, 0xb0, 0x98, + 0x18, 0x32, 0x71, 0x4b, 0xef, 0x3b, 0x70, 0xa0, 0xe4, 0x40, 0xff, 0xc3, 0xa9, 0xe6, 0x78, 0xf9, + 0x8b, 0x46, 0x80, 0x1e, 0x38, 0xe1, 0xb8, 0xa8, 0xe0, 0x0c, 0x23, 0x76, 0x1d, 0x25, 0x24, 0x05, + 0xf1, 0x6e, 0x94, 0x28, 0x9a, 0x84, 0xe8, 0xa3, 0x4f, 0x77, 0xd3, 0x85, 0xe2, 0x52, 0xf2, 0x82, + 0x50, 0x7a, 0x2f, 0x74, 0x53, 0xb3, 0x61, 0xaf, 0x39, 0x35, 0xde, 0xcd, 0x1f, 0x99, 0xac, 0xad, + 0x72, 0x2c, 0xdd, 0xd0, 0x87, 0xbe, 0x5e, 0xa6, 0xec, 0x04, 0xc6, 0x03, 0x34, 0xfb, 0xdb, 0x59, + 0xb6, 0xc2, 0x01, 0xf0, 0x5a, 0xed, 0xa7, 0x66, 0x21, 0x7f, 0x8a, 0x27, 0xc7, 0xc0, 0x29, 0xd7 + }; + + private static readonly byte[] S2 = new byte[] { + 0x93, 0xd9, 0x9a, 0xb5, 0x98, 0x22, 0x45, 0xfc, 0xba, 0x6a, 0xdf, 0x02, 0x9f, 0xdc, 0x51, 0x59, + 0x4a, 0x17, 0x2b, 0xc2, 0x94, 0xf4, 0xbb, 0xa3, 0x62, 0xe4, 0x71, 0xd4, 0xcd, 0x70, 0x16, 0xe1, + 0x49, 0x3c, 0xc0, 0xd8, 0x5c, 0x9b, 0xad, 0x85, 0x53, 0xa1, 0x7a, 0xc8, 0x2d, 0xe0, 0xd1, 0x72, + 0xa6, 0x2c, 0xc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xa7, 0xe7, 0x61, 0x5a, 0x06, 0x46, 0x44, + 0x42, 0x04, 0xa0, 0xdb, 0x39, 0x86, 0x54, 0xaa, 0x8c, 0x34, 0x21, 0x8b, 0xf8, 0x0c, 0x74, 0x67 + }; + + private static readonly byte[] S3 = new byte[] { + 0x68, 0x8d, 0xca, 0x4d, 0x73, 0x4b, 0x4e, 0x2a, 0xd4, 0x52, 0x26, 0xb3, 0x54, 0x1e, 0x19, 0x1f, + 0x22, 0x03, 0x46, 0x3d, 0x2d, 0x4a, 0x53, 0x83, 0x13, 0x8a, 0xb7, 0xd5, 0x25, 0x79, 0xf5, 0xbd, + 0x58, 0x2f, 0x0d, 0x02, 0xed, 0x51, 0x9e, 0x11, 0xf2, 0x3e, 0x55, 0x5e, 0xd1, 0x16, 0x3c, 0x66, + 0x70, 0x5d, 0xf3, 0x45, 0x40, 0xcc, 0xe8, 0x94, 0x56, 0x08, 0xce, 0x1a, 0x3a, 0xd2, 0xe1, 0xdf, + 0xb5, 0x38, 0x6e, 0x0e, 0xe5, 0xf4, 0xf9, 0x86, 0xe9, 0x4f, 0xd6, 0x85, 0x23, 0xcf, 0x32, 0x99, + 0x31, 0x14, 0xae, 0xee, 0xc8, 0x48, 0xd3, 0x30, 0xa1, 0x92, 0x41, 0xb1, 0x18, 0xc4, 0x2c, 0x71, + 0x72, 0x44, 0x15, 0xfd, 0x37, 0xbe, 0x5f, 0xaa, 0x9b, 0x88, 0xd8, 0xab, 0x89, 0x9c, 0xfa, 0x60, + 0xea, 0xbc, 0x62, 0x0c, 0x24, 0xa6, 0xa8, 0xec, 0x67, 0x20, 0xdb, 0x7c, 0x28, 0xdd, 0xac, 0x5b, + 0x34, 0x7e, 0x10, 0xf1, 0x7b, 0x8f, 0x63, 0xa0, 0x05, 0x9a, 0x43, 0x77, 0x21, 0xbf, 0x27, 0x09, + 0xc3, 0x9f, 0xb6, 0xd7, 0x29, 0xc2, 0xeb, 0xc0, 0xa4, 0x8b, 0x8c, 0x1d, 0xfb, 0xff, 0xc1, 0xb2, + 0x97, 0x2e, 0xf8, 0x65, 0xf6, 0x75, 0x07, 0x04, 0x49, 0x33, 0xe4, 0xd9, 0xb9, 0xd0, 0x42, 0xc7, + 0x6c, 0x90, 0x00, 0x8e, 0x6f, 0x50, 0x01, 0xc5, 0xda, 0x47, 0x3f, 0xcd, 0x69, 0xa2, 0xe2, 0x7a, + 0xa7, 0xc6, 0x93, 0x0f, 0x0a, 0x06, 0xe6, 0x2b, 0x96, 0xa3, 0x1c, 0xaf, 0x6a, 0x12, 0x84, 0x39, + 0xe7, 0xb0, 0x82, 0xf7, 0xfe, 0x9d, 0x87, 0x5c, 0x81, 0x35, 0xde, 0xb4, 0xa5, 0xfc, 0x80, 0xef, + 0xcb, 0xbb, 0x6b, 0x76, 0xba, 0x5a, 0x7d, 0x78, 0x0b, 0x95, 0xe3, 0xad, 0x74, 0x98, 0x3b, 0x36, + 0x64, 0x6d, 0xdc, 0xf0, 0x59, 0xa9, 0x4c, 0x17, 0x7f, 0x91, 0xb8, 0xc9, 0x57, 0x1b, 0xe0, 0x61 + }; + + public virtual IMemoable Copy() + { + return new Dstu7564Digest(this); + } + + public virtual void Reset(IMemoable other) + { + Dstu7564Digest d = (Dstu7564Digest)other; + + CopyIn(d); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/DSTU7564Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/DSTU7564Digest.cs.meta new file mode 100644 index 00000000..7e611beb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/DSTU7564Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 22476189e4ad78840b59be0858fa97af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411Digest.cs new file mode 100644 index 00000000..942bb88a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411Digest.cs @@ -0,0 +1,360 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * implementation of GOST R 34.11-94 + */ + public class Gost3411Digest + : IDigest, IMemoable + { + private const int DIGEST_LENGTH = 32; + + private byte[] H = new byte[32], L = new byte[32], + M = new byte[32], Sum = new byte[32]; + private byte[][] C = MakeC(); + + private byte[] xBuf = new byte[32]; + private int xBufOff; + private ulong byteCount; + + private readonly IBlockCipher cipher = new Gost28147Engine(); + private byte[] sBox; + + private static byte[][] MakeC() + { + byte[][] c = new byte[4][]; + for (int i = 0; i < 4; ++i) + { + c[i] = new byte[32]; + } + return c; + } + + /** + * Standard constructor + */ + public Gost3411Digest() + { + sBox = Gost28147Engine.GetSBox("D-A"); + cipher.Init(true, new ParametersWithSBox(null, sBox)); + + Reset(); + } + + /** + * Constructor to allow use of a particular sbox with GOST28147 + * @see GOST28147Engine#getSBox(String) + */ + public Gost3411Digest(byte[] sBoxParam) + { + sBox = Arrays.Clone(sBoxParam); + cipher.Init(true, new ParametersWithSBox(null, sBox)); + + Reset(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public Gost3411Digest(Gost3411Digest t) + { + Reset(t); + } + + public string AlgorithmName + { + get { return "Gost3411"; } + } + + public int GetDigestSize() + { + return DIGEST_LENGTH; + } + + public void Update( + byte input) + { + xBuf[xBufOff++] = input; + if (xBufOff == xBuf.Length) + { + sumByteArray(xBuf); // calc sum M + processBlock(xBuf, 0); + xBufOff = 0; + } + byteCount++; + } + + public void BlockUpdate( + byte[] input, + int inOff, + int length) + { + while ((xBufOff != 0) && (length > 0)) + { + Update(input[inOff]); + inOff++; + length--; + } + + while (length > xBuf.Length) + { + Array.Copy(input, inOff, xBuf, 0, xBuf.Length); + + sumByteArray(xBuf); // calc sum M + processBlock(xBuf, 0); + inOff += xBuf.Length; + length -= xBuf.Length; + byteCount += (uint)xBuf.Length; + } + + // load in the remainder. + while (length > 0) + { + Update(input[inOff]); + inOff++; + length--; + } + } + + // (i + 1 + 4(k - 1)) = 8i + k i = 0-3, k = 1-8 + private byte[] K = new byte[32]; + + private byte[] P(byte[] input) + { + int fourK = 0; + for(int k = 0; k < 8; k++) + { + K[fourK++] = input[k]; + K[fourK++] = input[8 + k]; + K[fourK++] = input[16 + k]; + K[fourK++] = input[24 + k]; + } + + return K; + } + + //A (x) = (x0 ^ x1) || x3 || x2 || x1 + byte[] a = new byte[8]; + private byte[] A(byte[] input) + { + for(int j=0; j<8; j++) + { + a[j]=(byte)(input[j] ^ input[j+8]); + } + + Array.Copy(input, 8, input, 0, 24); + Array.Copy(a, 0, input, 24, 8); + + return input; + } + + //Encrypt function, ECB mode + private void E(byte[] key, byte[] s, int sOff, byte[] input, int inOff) + { + cipher.Init(true, new KeyParameter(key)); + + cipher.ProcessBlock(input, inOff, s, sOff); + } + + // (in:) n16||..||n1 ==> (out:) n1^n2^n3^n4^n13^n16||n16||..||n2 + internal short[] wS = new short[16], w_S = new short[16]; + + private void fw(byte[] input) + { + cpyBytesToShort(input, wS); + w_S[15] = (short)(wS[0] ^ wS[1] ^ wS[2] ^ wS[3] ^ wS[12] ^ wS[15]); + Array.Copy(wS, 1, w_S, 0, 15); + cpyShortToBytes(w_S, input); + } + + // block processing + internal byte[] S = new byte[32], U = new byte[32], V = new byte[32], W = new byte[32]; + + private void processBlock(byte[] input, int inOff) + { + Array.Copy(input, inOff, M, 0, 32); + + //key step 1 + + // H = h3 || h2 || h1 || h0 + // S = s3 || s2 || s1 || s0 + H.CopyTo(U, 0); + M.CopyTo(V, 0); + for (int j=0; j<32; j++) + { + W[j] = (byte)(U[j]^V[j]); + } + // Encrypt gost28147-ECB + E(P(W), S, 0, H, 0); // s0 = EK0 [h0] + + //keys step 2,3,4 + for (int i=1; i<4; i++) + { + byte[] tmpA = A(U); + for (int j=0; j<32; j++) + { + U[j] = (byte)(tmpA[j] ^ C[i][j]); + } + V = A(A(V)); + for (int j=0; j<32; j++) + { + W[j] = (byte)(U[j]^V[j]); + } + // Encrypt gost28147-ECB + E(P(W), S, i * 8, H, i * 8); // si = EKi [hi] + } + + // x(M, H) = y61(H^y(M^y12(S))) + for(int n = 0; n < 12; n++) + { + fw(S); + } + for(int n = 0; n < 32; n++) + { + S[n] = (byte)(S[n] ^ M[n]); + } + + fw(S); + + for(int n = 0; n < 32; n++) + { + S[n] = (byte)(H[n] ^ S[n]); + } + for(int n = 0; n < 61; n++) + { + fw(S); + } + Array.Copy(S, 0, H, 0, H.Length); + } + + private void finish() + { + ulong bitCount = byteCount * 8; + Pack.UInt64_To_LE(bitCount, L); + + while (xBufOff != 0) + { + Update((byte)0); + } + + processBlock(L, 0); + processBlock(Sum, 0); + } + + public int DoFinal( + byte[] output, + int outOff) + { + finish(); + + H.CopyTo(output, outOff); + + Reset(); + + return DIGEST_LENGTH; + } + + /** + * reset the chaining variables to the IV values. + */ + private static readonly byte[] C2 = { + 0x00,(byte)0xFF,0x00,(byte)0xFF,0x00,(byte)0xFF,0x00,(byte)0xFF, + (byte)0xFF,0x00,(byte)0xFF,0x00,(byte)0xFF,0x00,(byte)0xFF,0x00, + 0x00,(byte)0xFF,(byte)0xFF,0x00,(byte)0xFF,0x00,0x00,(byte)0xFF, + (byte)0xFF,0x00,0x00,0x00,(byte)0xFF,(byte)0xFF,0x00,(byte)0xFF + }; + + public void Reset() + { + byteCount = 0; + xBufOff = 0; + + Array.Clear(H, 0, H.Length); + Array.Clear(L, 0, L.Length); + Array.Clear(M, 0, M.Length); + Array.Clear(C[1], 0, C[1].Length); // real index C = +1 because index array with 0. + Array.Clear(C[3], 0, C[3].Length); + Array.Clear(Sum, 0, Sum.Length); + Array.Clear(xBuf, 0, xBuf.Length); + + C2.CopyTo(C[2], 0); + } + + // 256 bitsblock modul -> (Sum + a mod (2^256)) + private void sumByteArray( + byte[] input) + { + int carry = 0; + + for (int i = 0; i != Sum.Length; i++) + { + int sum = (Sum[i] & 0xff) + (input[i] & 0xff) + carry; + + Sum[i] = (byte)sum; + + carry = sum >> 8; + } + } + + private static void cpyBytesToShort(byte[] S, short[] wS) + { + for(int i = 0; i < S.Length / 2; i++) + { + wS[i] = (short)(((S[i*2+1]<<8)&0xFF00)|(S[i*2]&0xFF)); + } + } + + private static void cpyShortToBytes(short[] wS, byte[] S) + { + for(int i=0; i> 8); + S[i*2] = (byte)wS[i]; + } + } + + public int GetByteLength() + { + return 32; + } + + public IMemoable Copy() + { + return new Gost3411Digest(this); + } + + public void Reset(IMemoable other) + { + Gost3411Digest t = (Gost3411Digest)other; + + this.sBox = t.sBox; + cipher.Init(true, new ParametersWithSBox(null, sBox)); + + Reset(); + + Array.Copy(t.H, 0, this.H, 0, t.H.Length); + Array.Copy(t.L, 0, this.L, 0, t.L.Length); + Array.Copy(t.M, 0, this.M, 0, t.M.Length); + Array.Copy(t.Sum, 0, this.Sum, 0, t.Sum.Length); + Array.Copy(t.C[1], 0, this.C[1], 0, t.C[1].Length); + Array.Copy(t.C[2], 0, this.C[2], 0, t.C[2].Length); + Array.Copy(t.C[3], 0, this.C[3], 0, t.C[3].Length); + Array.Copy(t.xBuf, 0, this.xBuf, 0, t.xBuf.Length); + + this.xBufOff = t.xBufOff; + this.byteCount = t.byteCount; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411Digest.cs.meta new file mode 100644 index 00000000..3f86fdcc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 64f3ba3752b08254c9377349d44de349 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012Digest.cs new file mode 100644 index 00000000..b6771bfb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012Digest.cs @@ -0,0 +1,1040 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + public abstract class GOST3411_2012Digest:IDigest,IMemoable + { + private readonly byte[] IV = new byte[64]; + private readonly byte[] N = new byte[64]; + private readonly byte[] Sigma = new byte[64]; + private readonly byte[] Ki = new byte[64]; + private readonly byte[] m = new byte[64]; + private readonly byte[] h = new byte[64]; + + // Temporary buffers + private readonly byte[] tmp = new byte[64]; + private readonly byte[] block = new byte[64]; + + private int bOff = 64; + + protected GOST3411_2012Digest(byte[] IV) + { + System.Array.Copy(IV,this.IV,64); + System.Array.Copy(IV, h, 64); + } + + public abstract string AlgorithmName { get; } + + public abstract IMemoable Copy(); + + public virtual int DoFinal(byte[] output, int outOff) + { + int lenM = 64 - bOff; + + // At this point it is certain that lenM is smaller than 64 + for (int i = 0; i != 64 - lenM; i++) + { + m[i] = 0; + } + + m[63 - lenM] = 1; + + if (bOff != 64) + { + System.Array.Copy(block, bOff, m, 64 - lenM, lenM); + } + + g_N(h, N, m); + addMod512(N, lenM * 8); + addMod512(Sigma, m); + g_N(h, Zero, N); + g_N(h, Zero, Sigma); + + reverse(h, tmp); + + Array.Copy(tmp, 0, output, outOff, 64); + + Reset(); + return 64; + } + + public int GetByteLength() + { + return 64; + } + + public abstract int GetDigestSize(); + + + public void Reset() + { + bOff = 64; + Arrays.Fill(N, (byte)0); + Arrays.Fill(Sigma, (byte)0); + System.Array.Copy(IV, 0, h, 0, 64); + Arrays.Fill(block, (byte)0); + } + + public void Reset(IMemoable other) + { + GOST3411_2012Digest o = (GOST3411_2012Digest)other; + + System.Array.Copy(o.IV, 0, this.IV, 0, 64); + System.Array.Copy(o.N, 0, this.N, 0, 64); + System.Array.Copy(o.Sigma, 0, this.Sigma, 0, 64); + System.Array.Copy(o.Ki, 0, this.Ki, 0, 64); + System.Array.Copy(o.m, 0, this.m, 0, 64); + System.Array.Copy(o.h, 0, this.h, 0, 64); + + System.Array.Copy(o.block, 0, this.block, 0, 64); + this.bOff = o.bOff; + } + + public void Update(byte input) + { + block[--bOff] = input; + if (bOff == 0) + { + g_N(h, N, block); + addMod512(N, 512); + addMod512(Sigma, block); + bOff = 64; + } + } + + + public void BlockUpdate(byte[] input, int inOff, int len) + { + while (bOff != 64 && len > 0) + { + Update(input[inOff++]); + len--; + } + while (len >= 64) + { + System.Array.Copy(input, inOff, tmp, 0, 64); + reverse(tmp, block); + g_N(h, N, block); + addMod512(N, 512); + addMod512(Sigma, block); + + len -= 64; + inOff += 64; + } + while (len > 0) + { + Update(input[inOff++]); + len--; + } + } + + + + + private void F(byte[] V) + { + ulong[] res = new ulong[8]; + ulong r; + + r = 0; + r ^= T[0][(V[56] & 0xFF)]; + r ^= T[1][(V[48] & 0xFF)]; + r ^= T[2][(V[40] & 0xFF)]; + r ^= T[3][(V[32] & 0xFF)]; + r ^= T[4][(V[24] & 0xFF)]; + r ^= T[5][(V[16] & 0xFF)]; + r ^= T[6][(V[8] & 0xFF)]; + r ^= T[7][(V[0] & 0xFF)]; + res[0] = r; + + r = 0; + r ^= T[0][(V[57] & 0xFF)]; + r ^= T[1][(V[49] & 0xFF)]; + r ^= T[2][(V[41] & 0xFF)]; + r ^= T[3][(V[33] & 0xFF)]; + r ^= T[4][(V[25] & 0xFF)]; + r ^= T[5][(V[17] & 0xFF)]; + r ^= T[6][(V[9] & 0xFF)]; + r ^= T[7][(V[1] & 0xFF)]; + res[1] = r; + + r = 0; + r ^= T[0][(V[58] & 0xFF)]; + r ^= T[1][(V[50] & 0xFF)]; + r ^= T[2][(V[42] & 0xFF)]; + r ^= T[3][(V[34] & 0xFF)]; + r ^= T[4][(V[26] & 0xFF)]; + r ^= T[5][(V[18] & 0xFF)]; + r ^= T[6][(V[10] & 0xFF)]; + r ^= T[7][(V[2] & 0xFF)]; + res[2] = r; + + r = 0; + r ^= T[0][(V[59] & 0xFF)]; + r ^= T[1][(V[51] & 0xFF)]; + r ^= T[2][(V[43] & 0xFF)]; + r ^= T[3][(V[35] & 0xFF)]; + r ^= T[4][(V[27] & 0xFF)]; + r ^= T[5][(V[19] & 0xFF)]; + r ^= T[6][(V[11] & 0xFF)]; + r ^= T[7][(V[3] & 0xFF)]; + res[3] = r; + + r = 0; + r ^= T[0][(V[60] & 0xFF)]; + r ^= T[1][(V[52] & 0xFF)]; + r ^= T[2][(V[44] & 0xFF)]; + r ^= T[3][(V[36] & 0xFF)]; + r ^= T[4][(V[28] & 0xFF)]; + r ^= T[5][(V[20] & 0xFF)]; + r ^= T[6][(V[12] & 0xFF)]; + r ^= T[7][(V[4] & 0xFF)]; + res[4] = r; + + r = 0; + r ^= T[0][(V[61] & 0xFF)]; + r ^= T[1][(V[53] & 0xFF)]; + r ^= T[2][(V[45] & 0xFF)]; + r ^= T[3][(V[37] & 0xFF)]; + r ^= T[4][(V[29] & 0xFF)]; + r ^= T[5][(V[21] & 0xFF)]; + r ^= T[6][(V[13] & 0xFF)]; + r ^= T[7][(V[5] & 0xFF)]; + res[5] = r; + + r = 0; + r ^= T[0][(V[62] & 0xFF)]; + r ^= T[1][(V[54] & 0xFF)]; + r ^= T[2][(V[46] & 0xFF)]; + r ^= T[3][(V[38] & 0xFF)]; + r ^= T[4][(V[30] & 0xFF)]; + r ^= T[5][(V[22] & 0xFF)]; + r ^= T[6][(V[14] & 0xFF)]; + r ^= T[7][(V[6] & 0xFF)]; + res[6] = r; + + r = 0; + r ^= T[0][(V[63] & 0xFF)]; + r ^= T[1][(V[55] & 0xFF)]; + r ^= T[2][(V[47] & 0xFF)]; + r ^= T[3][(V[39] & 0xFF)]; + r ^= T[4][(V[31] & 0xFF)]; + r ^= T[5][(V[23] & 0xFF)]; + r ^= T[6][(V[15] & 0xFF)]; + r ^= T[7][(V[7] & 0xFF)]; + res[7] = r; + + r = res[0]; + V[7] = (byte)(r >> 56); + V[6] = (byte)(r >> 48); + V[5] = (byte)(r >> 40); + V[4] = (byte)(r >> 32); + V[3] = (byte)(r >> 24); + V[2] = (byte)(r >> 16); + V[1] = (byte)(r >> 8); + V[0] = (byte)(r); + + r = res[1]; + V[15] = (byte)(r >> 56); + V[14] = (byte)(r >> 48); + V[13] = (byte)(r >> 40); + V[12] = (byte)(r >> 32); + V[11] = (byte)(r >> 24); + V[10] = (byte)(r >> 16); + V[9] = (byte)(r >> 8); + V[8] = (byte)(r); + + r = res[2]; + V[23] = (byte)(r >> 56); + V[22] = (byte)(r >> 48); + V[21] = (byte)(r >> 40); + V[20] = (byte)(r >> 32); + V[19] = (byte)(r >> 24); + V[18] = (byte)(r >> 16); + V[17] = (byte)(r >> 8); + V[16] = (byte)(r); + + r = res[3]; + V[31] = (byte)(r >> 56); + V[30] = (byte)(r >> 48); + V[29] = (byte)(r >> 40); + V[28] = (byte)(r >> 32); + V[27] = (byte)(r >> 24); + V[26] = (byte)(r >> 16); + V[25] = (byte)(r >> 8); + V[24] = (byte)(r); + + r = res[4]; + V[39] = (byte)(r >> 56); + V[38] = (byte)(r >> 48); + V[37] = (byte)(r >> 40); + V[36] = (byte)(r >> 32); + V[35] = (byte)(r >> 24); + V[34] = (byte)(r >> 16); + V[33] = (byte)(r >> 8); + V[32] = (byte)(r); + + r = res[5]; + V[47] = (byte)(r >> 56); + V[46] = (byte)(r >> 48); + V[45] = (byte)(r >> 40); + V[44] = (byte)(r >> 32); + V[43] = (byte)(r >> 24); + V[42] = (byte)(r >> 16); + V[41] = (byte)(r >> 8); + V[40] = (byte)(r); + + r = res[6]; + V[55] = (byte)(r >> 56); + V[54] = (byte)(r >> 48); + V[53] = (byte)(r >> 40); + V[52] = (byte)(r >> 32); + V[51] = (byte)(r >> 24); + V[50] = (byte)(r >> 16); + V[49] = (byte)(r >> 8); + V[48] = (byte)(r); + + r = res[7]; + V[63] = (byte)(r >> 56); + V[62] = (byte)(r >> 48); + V[61] = (byte)(r >> 40); + V[60] = (byte)(r >> 32); + V[59] = (byte)(r >> 24); + V[58] = (byte)(r >> 16); + V[57] = (byte)(r >> 8); + V[56] = (byte)(r); + } + + private void xor512(byte[] A, byte[] B) + { + for (int i = 0; i < 64; ++i) + { + A[i] ^= B[i]; + } + } + + private void E(byte[] K, byte[] m) + { + System.Array.Copy(K, 0, Ki, 0, 64); + xor512(K, m); + F(K); + for (int i = 0; i < 11; ++i) + { + xor512(Ki, C[i]); + F(Ki); + xor512(K, Ki); + F(K); + } + xor512(Ki, C[11]); + F(Ki); + xor512(K, Ki); + } + + private void g_N(byte[] h, byte[] N, byte[] m) + { + System.Array.Copy(h, 0, tmp, 0, 64); + + xor512(h, N); + F(h); + + E(h, m); + xor512(h, tmp); + xor512(h, m); + } + + private void addMod512(byte[] A, int num) + { + int c; + c = (A[63] & 0xFF) + (num & 0xFF); + A[63] = (byte)c; + + c = (A[62] & 0xFF) + ((num >> 8) & 0xFF) + (c >> 8); + A[62] = (byte)c; + + for (int i = 61; (i >= 0) && (c > 0); --i) + { + c = (A[i] & 0xFF) + (c >> 8); + A[i] = (byte)c; + } + } + + private void addMod512(byte[] A, byte[] B) + { + for (int c = 0, i = 63; i >= 0; --i) + { + c = (A[i] & 0xFF) + (B[i] & 0xFF) + (c >> 8); + A[i] = (byte)c; + } + } + + private void reverse(byte[] src, byte[] dst) + { + int len = src.Length; + for (int i = 0; i < len; i++) + { + dst[len - 1 - i] = src[i]; + } + } + + private static readonly byte[][] C = new byte[][]{ new byte[]{ + (byte)0xb1, (byte)0x08, (byte)0x5b, (byte)0xda, (byte)0x1e, (byte)0xca, (byte)0xda, (byte)0xe9, + (byte)0xeb, (byte)0xcb, (byte)0x2f, (byte)0x81, (byte)0xc0, (byte)0x65, (byte)0x7c, (byte)0x1f, + (byte)0x2f, (byte)0x6a, (byte)0x76, (byte)0x43, (byte)0x2e, (byte)0x45, (byte)0xd0, (byte)0x16, + (byte)0x71, (byte)0x4e, (byte)0xb8, (byte)0x8d, (byte)0x75, (byte)0x85, (byte)0xc4, (byte)0xfc, + (byte)0x4b, (byte)0x7c, (byte)0xe0, (byte)0x91, (byte)0x92, (byte)0x67, (byte)0x69, (byte)0x01, + (byte)0xa2, (byte)0x42, (byte)0x2a, (byte)0x08, (byte)0xa4, (byte)0x60, (byte)0xd3, (byte)0x15, + (byte)0x05, (byte)0x76, (byte)0x74, (byte)0x36, (byte)0xcc, (byte)0x74, (byte)0x4d, (byte)0x23, + (byte)0xdd, (byte)0x80, (byte)0x65, (byte)0x59, (byte)0xf2, (byte)0xa6, (byte)0x45, (byte)0x07}, + + new byte[]{ + (byte)0x6f, (byte)0xa3, (byte)0xb5, (byte)0x8a, (byte)0xa9, (byte)0x9d, (byte)0x2f, (byte)0x1a, + (byte)0x4f, (byte)0xe3, (byte)0x9d, (byte)0x46, (byte)0x0f, (byte)0x70, (byte)0xb5, (byte)0xd7, + (byte)0xf3, (byte)0xfe, (byte)0xea, (byte)0x72, (byte)0x0a, (byte)0x23, (byte)0x2b, (byte)0x98, + (byte)0x61, (byte)0xd5, (byte)0x5e, (byte)0x0f, (byte)0x16, (byte)0xb5, (byte)0x01, (byte)0x31, + (byte)0x9a, (byte)0xb5, (byte)0x17, (byte)0x6b, (byte)0x12, (byte)0xd6, (byte)0x99, (byte)0x58, + (byte)0x5c, (byte)0xb5, (byte)0x61, (byte)0xc2, (byte)0xdb, (byte)0x0a, (byte)0xa7, (byte)0xca, + (byte)0x55, (byte)0xdd, (byte)0xa2, (byte)0x1b, (byte)0xd7, (byte)0xcb, (byte)0xcd, (byte)0x56, + (byte)0xe6, (byte)0x79, (byte)0x04, (byte)0x70, (byte)0x21, (byte)0xb1, (byte)0x9b, (byte)0xb7}, + new byte[]{ + (byte)0xf5, (byte)0x74, (byte)0xdc, (byte)0xac, (byte)0x2b, (byte)0xce, (byte)0x2f, (byte)0xc7, + (byte)0x0a, (byte)0x39, (byte)0xfc, (byte)0x28, (byte)0x6a, (byte)0x3d, (byte)0x84, (byte)0x35, + (byte)0x06, (byte)0xf1, (byte)0x5e, (byte)0x5f, (byte)0x52, (byte)0x9c, (byte)0x1f, (byte)0x8b, + (byte)0xf2, (byte)0xea, (byte)0x75, (byte)0x14, (byte)0xb1, (byte)0x29, (byte)0x7b, (byte)0x7b, + (byte)0xd3, (byte)0xe2, (byte)0x0f, (byte)0xe4, (byte)0x90, (byte)0x35, (byte)0x9e, (byte)0xb1, + (byte)0xc1, (byte)0xc9, (byte)0x3a, (byte)0x37, (byte)0x60, (byte)0x62, (byte)0xdb, (byte)0x09, + (byte)0xc2, (byte)0xb6, (byte)0xf4, (byte)0x43, (byte)0x86, (byte)0x7a, (byte)0xdb, (byte)0x31, + (byte)0x99, (byte)0x1e, (byte)0x96, (byte)0xf5, (byte)0x0a, (byte)0xba, (byte)0x0a, (byte)0xb2}, + new byte[]{ + (byte)0xef, (byte)0x1f, (byte)0xdf, (byte)0xb3, (byte)0xe8, (byte)0x15, (byte)0x66, (byte)0xd2, + (byte)0xf9, (byte)0x48, (byte)0xe1, (byte)0xa0, (byte)0x5d, (byte)0x71, (byte)0xe4, (byte)0xdd, + (byte)0x48, (byte)0x8e, (byte)0x85, (byte)0x7e, (byte)0x33, (byte)0x5c, (byte)0x3c, (byte)0x7d, + (byte)0x9d, (byte)0x72, (byte)0x1c, (byte)0xad, (byte)0x68, (byte)0x5e, (byte)0x35, (byte)0x3f, + (byte)0xa9, (byte)0xd7, (byte)0x2c, (byte)0x82, (byte)0xed, (byte)0x03, (byte)0xd6, (byte)0x75, + (byte)0xd8, (byte)0xb7, (byte)0x13, (byte)0x33, (byte)0x93, (byte)0x52, (byte)0x03, (byte)0xbe, + (byte)0x34, (byte)0x53, (byte)0xea, (byte)0xa1, (byte)0x93, (byte)0xe8, (byte)0x37, (byte)0xf1, + (byte)0x22, (byte)0x0c, (byte)0xbe, (byte)0xbc, (byte)0x84, (byte)0xe3, (byte)0xd1, (byte)0x2e}, + new byte[] { + (byte)0x4b, (byte)0xea, (byte)0x6b, (byte)0xac, (byte)0xad, (byte)0x47, (byte)0x47, (byte)0x99, + (byte)0x9a, (byte)0x3f, (byte)0x41, (byte)0x0c, (byte)0x6c, (byte)0xa9, (byte)0x23, (byte)0x63, + (byte)0x7f, (byte)0x15, (byte)0x1c, (byte)0x1f, (byte)0x16, (byte)0x86, (byte)0x10, (byte)0x4a, + (byte)0x35, (byte)0x9e, (byte)0x35, (byte)0xd7, (byte)0x80, (byte)0x0f, (byte)0xff, (byte)0xbd, + (byte)0xbf, (byte)0xcd, (byte)0x17, (byte)0x47, (byte)0x25, (byte)0x3a, (byte)0xf5, (byte)0xa3, + (byte)0xdf, (byte)0xff, (byte)0x00, (byte)0xb7, (byte)0x23, (byte)0x27, (byte)0x1a, (byte)0x16, + (byte)0x7a, (byte)0x56, (byte)0xa2, (byte)0x7e, (byte)0xa9, (byte)0xea, (byte)0x63, (byte)0xf5, + (byte)0x60, (byte)0x17, (byte)0x58, (byte)0xfd, (byte)0x7c, (byte)0x6c, (byte)0xfe, (byte)0x57}, + new byte[]{ + (byte)0xae, (byte)0x4f, (byte)0xae, (byte)0xae, (byte)0x1d, (byte)0x3a, (byte)0xd3, (byte)0xd9, + (byte)0x6f, (byte)0xa4, (byte)0xc3, (byte)0x3b, (byte)0x7a, (byte)0x30, (byte)0x39, (byte)0xc0, + (byte)0x2d, (byte)0x66, (byte)0xc4, (byte)0xf9, (byte)0x51, (byte)0x42, (byte)0xa4, (byte)0x6c, + (byte)0x18, (byte)0x7f, (byte)0x9a, (byte)0xb4, (byte)0x9a, (byte)0xf0, (byte)0x8e, (byte)0xc6, + (byte)0xcf, (byte)0xfa, (byte)0xa6, (byte)0xb7, (byte)0x1c, (byte)0x9a, (byte)0xb7, (byte)0xb4, + (byte)0x0a, (byte)0xf2, (byte)0x1f, (byte)0x66, (byte)0xc2, (byte)0xbe, (byte)0xc6, (byte)0xb6, + (byte)0xbf, (byte)0x71, (byte)0xc5, (byte)0x72, (byte)0x36, (byte)0x90, (byte)0x4f, (byte)0x35, + (byte)0xfa, (byte)0x68, (byte)0x40, (byte)0x7a, (byte)0x46, (byte)0x64, (byte)0x7d, (byte)0x6e}, + new byte[] { + (byte)0xf4, (byte)0xc7, (byte)0x0e, (byte)0x16, (byte)0xee, (byte)0xaa, (byte)0xc5, (byte)0xec, + (byte)0x51, (byte)0xac, (byte)0x86, (byte)0xfe, (byte)0xbf, (byte)0x24, (byte)0x09, (byte)0x54, + (byte)0x39, (byte)0x9e, (byte)0xc6, (byte)0xc7, (byte)0xe6, (byte)0xbf, (byte)0x87, (byte)0xc9, + (byte)0xd3, (byte)0x47, (byte)0x3e, (byte)0x33, (byte)0x19, (byte)0x7a, (byte)0x93, (byte)0xc9, + (byte)0x09, (byte)0x92, (byte)0xab, (byte)0xc5, (byte)0x2d, (byte)0x82, (byte)0x2c, (byte)0x37, + (byte)0x06, (byte)0x47, (byte)0x69, (byte)0x83, (byte)0x28, (byte)0x4a, (byte)0x05, (byte)0x04, + (byte)0x35, (byte)0x17, (byte)0x45, (byte)0x4c, (byte)0xa2, (byte)0x3c, (byte)0x4a, (byte)0xf3, + (byte)0x88, (byte)0x86, (byte)0x56, (byte)0x4d, (byte)0x3a, (byte)0x14, (byte)0xd4, (byte)0x93}, + new byte[] { + (byte)0x9b, (byte)0x1f, (byte)0x5b, (byte)0x42, (byte)0x4d, (byte)0x93, (byte)0xc9, (byte)0xa7, + (byte)0x03, (byte)0xe7, (byte)0xaa, (byte)0x02, (byte)0x0c, (byte)0x6e, (byte)0x41, (byte)0x41, + (byte)0x4e, (byte)0xb7, (byte)0xf8, (byte)0x71, (byte)0x9c, (byte)0x36, (byte)0xde, (byte)0x1e, + (byte)0x89, (byte)0xb4, (byte)0x44, (byte)0x3b, (byte)0x4d, (byte)0xdb, (byte)0xc4, (byte)0x9a, + (byte)0xf4, (byte)0x89, (byte)0x2b, (byte)0xcb, (byte)0x92, (byte)0x9b, (byte)0x06, (byte)0x90, + (byte)0x69, (byte)0xd1, (byte)0x8d, (byte)0x2b, (byte)0xd1, (byte)0xa5, (byte)0xc4, (byte)0x2f, + (byte)0x36, (byte)0xac, (byte)0xc2, (byte)0x35, (byte)0x59, (byte)0x51, (byte)0xa8, (byte)0xd9, + (byte)0xa4, (byte)0x7f, (byte)0x0d, (byte)0xd4, (byte)0xbf, (byte)0x02, (byte)0xe7, (byte)0x1e}, + new byte[]{ + (byte)0x37, (byte)0x8f, (byte)0x5a, (byte)0x54, (byte)0x16, (byte)0x31, (byte)0x22, (byte)0x9b, + (byte)0x94, (byte)0x4c, (byte)0x9a, (byte)0xd8, (byte)0xec, (byte)0x16, (byte)0x5f, (byte)0xde, + (byte)0x3a, (byte)0x7d, (byte)0x3a, (byte)0x1b, (byte)0x25, (byte)0x89, (byte)0x42, (byte)0x24, + (byte)0x3c, (byte)0xd9, (byte)0x55, (byte)0xb7, (byte)0xe0, (byte)0x0d, (byte)0x09, (byte)0x84, + (byte)0x80, (byte)0x0a, (byte)0x44, (byte)0x0b, (byte)0xdb, (byte)0xb2, (byte)0xce, (byte)0xb1, + (byte)0x7b, (byte)0x2b, (byte)0x8a, (byte)0x9a, (byte)0xa6, (byte)0x07, (byte)0x9c, (byte)0x54, + (byte)0x0e, (byte)0x38, (byte)0xdc, (byte)0x92, (byte)0xcb, (byte)0x1f, (byte)0x2a, (byte)0x60, + (byte)0x72, (byte)0x61, (byte)0x44, (byte)0x51, (byte)0x83, (byte)0x23, (byte)0x5a, (byte)0xdb}, + new byte[] { + (byte)0xab, (byte)0xbe, (byte)0xde, (byte)0xa6, (byte)0x80, (byte)0x05, (byte)0x6f, (byte)0x52, + (byte)0x38, (byte)0x2a, (byte)0xe5, (byte)0x48, (byte)0xb2, (byte)0xe4, (byte)0xf3, (byte)0xf3, + (byte)0x89, (byte)0x41, (byte)0xe7, (byte)0x1c, (byte)0xff, (byte)0x8a, (byte)0x78, (byte)0xdb, + (byte)0x1f, (byte)0xff, (byte)0xe1, (byte)0x8a, (byte)0x1b, (byte)0x33, (byte)0x61, (byte)0x03, + (byte)0x9f, (byte)0xe7, (byte)0x67, (byte)0x02, (byte)0xaf, (byte)0x69, (byte)0x33, (byte)0x4b, + (byte)0x7a, (byte)0x1e, (byte)0x6c, (byte)0x30, (byte)0x3b, (byte)0x76, (byte)0x52, (byte)0xf4, + (byte)0x36, (byte)0x98, (byte)0xfa, (byte)0xd1, (byte)0x15, (byte)0x3b, (byte)0xb6, (byte)0xc3, + (byte)0x74, (byte)0xb4, (byte)0xc7, (byte)0xfb, (byte)0x98, (byte)0x45, (byte)0x9c, (byte)0xed}, + new byte[] { + (byte)0x7b, (byte)0xcd, (byte)0x9e, (byte)0xd0, (byte)0xef, (byte)0xc8, (byte)0x89, (byte)0xfb, + (byte)0x30, (byte)0x02, (byte)0xc6, (byte)0xcd, (byte)0x63, (byte)0x5a, (byte)0xfe, (byte)0x94, + (byte)0xd8, (byte)0xfa, (byte)0x6b, (byte)0xbb, (byte)0xeb, (byte)0xab, (byte)0x07, (byte)0x61, + (byte)0x20, (byte)0x01, (byte)0x80, (byte)0x21, (byte)0x14, (byte)0x84, (byte)0x66, (byte)0x79, + (byte)0x8a, (byte)0x1d, (byte)0x71, (byte)0xef, (byte)0xea, (byte)0x48, (byte)0xb9, (byte)0xca, + (byte)0xef, (byte)0xba, (byte)0xcd, (byte)0x1d, (byte)0x7d, (byte)0x47, (byte)0x6e, (byte)0x98, + (byte)0xde, (byte)0xa2, (byte)0x59, (byte)0x4a, (byte)0xc0, (byte)0x6f, (byte)0xd8, (byte)0x5d, + (byte)0x6b, (byte)0xca, (byte)0xa4, (byte)0xcd, (byte)0x81, (byte)0xf3, (byte)0x2d, (byte)0x1b}, + new byte[] { + (byte)0x37, (byte)0x8e, (byte)0xe7, (byte)0x67, (byte)0xf1, (byte)0x16, (byte)0x31, (byte)0xba, + (byte)0xd2, (byte)0x13, (byte)0x80, (byte)0xb0, (byte)0x04, (byte)0x49, (byte)0xb1, (byte)0x7a, + (byte)0xcd, (byte)0xa4, (byte)0x3c, (byte)0x32, (byte)0xbc, (byte)0xdf, (byte)0x1d, (byte)0x77, + (byte)0xf8, (byte)0x20, (byte)0x12, (byte)0xd4, (byte)0x30, (byte)0x21, (byte)0x9f, (byte)0x9b, + (byte)0x5d, (byte)0x80, (byte)0xef, (byte)0x9d, (byte)0x18, (byte)0x91, (byte)0xcc, (byte)0x86, + (byte)0xe7, (byte)0x1d, (byte)0xa4, (byte)0xaa, (byte)0x88, (byte)0xe1, (byte)0x28, (byte)0x52, + (byte)0xfa, (byte)0xf4, (byte)0x17, (byte)0xd5, (byte)0xd9, (byte)0xb2, (byte)0x1b, (byte)0x99, + (byte)0x48, (byte)0xbc, (byte)0x92, (byte)0x4a, (byte)0xf1, (byte)0x1b, (byte)0xd7, (byte)0x20} + }; + + private static readonly byte[] Zero = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + private readonly static ulong[][] T = { + new ulong[] { + 0xE6F87E5C5B711FD0L, 0x258377800924FA16L, 0xC849E07E852EA4A8L, 0x5B4686A18F06C16AL, + 0x0B32E9A2D77B416EL, 0xABDA37A467815C66L, 0xF61796A81A686676L, 0xF5DC0B706391954BL, + 0x4862F38DB7E64BF1L, 0xFF5C629A68BD85C5L, 0xCB827DA6FCD75795L, 0x66D36DAF69B9F089L, + 0x356C9F74483D83B0L, 0x7CBCECB1238C99A1L, 0x36A702AC31C4708DL, 0x9EB6A8D02FBCDFD6L, + 0x8B19FA51E5B3AE37L, 0x9CCFB5408A127D0BL, 0xBC0C78B508208F5AL, 0xE533E3842288ECEDL, + 0xCEC2C7D377C15FD2L, 0xEC7817B6505D0F5EL, 0xB94CC2C08336871DL, 0x8C205DB4CB0B04ADL, + 0x763C855B28A0892FL, 0x588D1B79F6FF3257L, 0x3FECF69E4311933EL, 0x0FC0D39F803A18C9L, + 0xEE010A26F5F3AD83L, 0x10EFE8F4411979A6L, 0x5DCDA10C7DE93A10L, 0x4A1BEE1D1248E92CL, + 0x53BFF2DB21847339L, 0xB4F50CCFA6A23D09L, 0x5FB4BC9CD84798CDL, 0xE88A2D8B071C56F9L, + 0x7F7771695A756A9CL, 0xC5F02E71A0BA1EBCL, 0xA663F9AB4215E672L, 0x2EB19E22DE5FBB78L, + 0x0DB9CE0F2594BA14L, 0x82520E6397664D84L, 0x2F031E6A0208EA98L, 0x5C7F2144A1BE6BF0L, + 0x7A37CB1CD16362DBL, 0x83E08E2B4B311C64L, 0xCF70479BAB960E32L, 0x856BA986B9DEE71EL, + 0xB5478C877AF56CE9L, 0xB8FE42885F61D6FDL, 0x1BDD0156966238C8L, 0x622157923EF8A92EL, + 0xFC97FF42114476F8L, 0x9D7D350856452CEBL, 0x4C90C9B0E0A71256L, 0x2308502DFBCB016CL, + 0x2D7A03FAA7A64845L, 0xF46E8B38BFC6C4ABL, 0xBDBEF8FDD477DEBAL, 0x3AAC4CEBC8079B79L, + 0xF09CB105E8879D0CL, 0x27FA6A10AC8A58CBL, 0x8960E7C1401D0CEAL, 0x1A6F811E4A356928L, + 0x90C4FB0773D196FFL, 0x43501A2F609D0A9FL, 0xF7A516E0C63F3796L, 0x1CE4A6B3B8DA9252L, + 0x1324752C38E08A9BL, 0xA5A864733BEC154FL, 0x2BF124575549B33FL, 0xD766DB15440DC5C7L, + 0xA7D179E39E42B792L, 0xDADF151A61997FD3L, 0x86A0345EC0271423L, 0x38D5517B6DA939A4L, + 0x6518F077104003B4L, 0x02791D90A5AEA2DDL, 0x88D267899C4A5D0AL, 0x930F66DF0A2865C2L, + 0x4EE9D4204509B08BL, 0x325538916685292AL, 0x412907BFC533A842L, 0xB27E2B62544DC673L, + 0x6C5304456295E007L, 0x5AF406E95351908AL, 0x1F2F3B6BC123616FL, 0xC37B09DC5255E5C6L, + 0x3967D133B1FE6844L, 0x298839C7F0E711E2L, 0x409B87F71964F9A2L, 0xE938ADC3DB4B0719L, + 0x0C0B4E47F9C3EBF4L, 0x5534D576D36B8843L, 0x4610A05AEB8B02D8L, 0x20C3CDF58232F251L, + 0x6DE1840DBEC2B1E7L, 0xA0E8DE06B0FA1D08L, 0x7B854B540D34333BL, 0x42E29A67BCCA5B7FL, + 0xD8A6088AC437DD0EL, 0xC63BB3A9D943ED81L, 0x21714DBD5E65A3B1L, 0x6761EDE7B5EEA169L, + 0x2431F7C8D573ABF6L, 0xD51FC685E1A3671AL, 0x5E063CD40410C92DL, 0x283AB98F2CB04002L, + 0x8FEBC06CB2F2F790L, 0x17D64F116FA1D33CL, 0xE07359F1A99EE4AAL, 0x784ED68C74CDC006L, + 0x6E2A19D5C73B42DAL, 0x8712B4161C7045C3L, 0x371582E4ED93216DL, 0xACE390414939F6FCL, + 0x7EC5F12186223B7CL, 0xC0B094042BAC16FBL, 0xF9D745379A527EBFL, 0x737C3F2EA3B68168L, + 0x33E7B8D9BAD278CAL, 0xA9A32A34C22FFEBBL, 0xE48163CCFEDFBD0DL, 0x8E5940246EA5A670L, + 0x51C6EF4B842AD1E4L, 0x22BAD065279C508CL, 0xD91488C218608CEEL, 0x319EA5491F7CDA17L, + 0xD394E128134C9C60L, 0x094BF43272D5E3B3L, 0x9BF612A5A4AAD791L, 0xCCBBDA43D26FFD0FL, + 0x34DE1F3C946AD250L, 0x4F5B5468995EE16BL, 0xDF9FAF6FEA8F7794L, 0x2648EA5870DD092BL, + 0xBFC7E56D71D97C67L, 0xDDE6B2FF4F21D549L, 0x3C276B463AE86003L, 0x91767B4FAF86C71FL, + 0x68A13E7835D4B9A0L, 0xB68C115F030C9FD4L, 0x141DD2C916582001L, 0x983D8F7DDD5324ACL, + 0x64AA703FCC175254L, 0xC2C989948E02B426L, 0x3E5E76D69F46C2DEL, 0x50746F03587D8004L, + 0x45DB3D829272F1E5L, 0x60584A029B560BF3L, 0xFBAE58A73FFCDC62L, 0xA15A5E4E6CAD4CE8L, + 0x4BA96E55CE1FB8CCL, 0x08F9747AAE82B253L, 0xC102144CF7FB471BL, 0x9F042898F3EB8E36L, + 0x068B27ADF2EFFB7AL, 0xEDCA97FE8C0A5EBEL, 0x778E0513F4F7D8CFL, 0x302C2501C32B8BF7L, + 0x8D92DDFC175C554DL, 0xF865C57F46052F5FL, 0xEAF3301BA2B2F424L, 0xAA68B7ECBBD60D86L, + 0x998F0F350104754CL, 0x0000000000000000L, 0xF12E314D34D0CCECL, 0x710522BE061823B5L, + 0xAF280D9930C005C1L, 0x97FD5CE25D693C65L, 0x19A41CC633CC9A15L, 0x95844172F8C79EB8L, + 0xDC5432B7937684A9L, 0x9436C13A2490CF58L, 0x802B13F332C8EF59L, 0xC442AE397CED4F5CL, + 0xFA1CD8EFE3AB8D82L, 0xF2E5AC954D293FD1L, 0x6AD823E8907A1B7DL, 0x4D2249F83CF043B6L, + 0x03CB9DD879F9F33DL, 0xDE2D2F2736D82674L, 0x2A43A41F891EE2DFL, 0x6F98999D1B6C133AL, + 0xD4AD46CD3DF436FAL, 0xBB35DF50269825C0L, 0x964FDCAA813E6D85L, 0xEB41B0537EE5A5C4L, + 0x0540BA758B160847L, 0xA41AE43BE7BB44AFL, 0xE3B8C429D0671797L, 0x819993BBEE9FBEB9L, + 0xAE9A8DD1EC975421L, 0xF3572CDD917E6E31L, 0x6393D7DAE2AFF8CEL, 0x47A2201237DC5338L, + 0xA32343DEC903EE35L, 0x79FC56C4A89A91E6L, 0x01B28048DC5751E0L, 0x1296F564E4B7DB7BL, + 0x75F7188351597A12L, 0xDB6D9552BDCE2E33L, 0x1E9DBB231D74308FL, 0x520D7293FDD322D9L, + 0xE20A44610C304677L, 0xFEEEE2D2B4EAD425L, 0xCA30FDEE20800675L, 0x61EACA4A47015A13L, + 0xE74AFE1487264E30L, 0x2CC883B27BF119A5L, 0x1664CF59B3F682DCL, 0xA811AA7C1E78AF5BL, + 0x1D5626FB648DC3B2L, 0xB73E9117DF5BCE34L, 0xD05F7CF06AB56F5DL, 0xFD257F0ACD132718L, + 0x574DC8E676C52A9EL, 0x0739A7E52EB8AA9AL, 0x5486553E0F3CD9A3L, 0x56FF48AEAA927B7EL, + 0xBE756525AD8E2D87L, 0x7D0E6CF9FFDBC841L, 0x3B1ECCA31450CA99L, 0x6913BE30E983E840L, + 0xAD511009956EA71CL, 0xB1B5B6BA2DB4354EL, 0x4469BDCA4E25A005L, 0x15AF5281CA0F71E1L, + 0x744598CB8D0E2BF2L, 0x593F9B312AA863B7L, 0xEFB38A6E29A4FC63L, 0x6B6AA3A04C2D4A9DL, + 0x3D95EB0EE6BF31E3L, 0xA291C3961554BFD5L, 0x18169C8EEF9BCBF5L, 0x115D68BC9D4E2846L, + 0xBA875F18FACF7420L, 0xD1EDFCB8B6E23EBDL, 0xB00736F2F1E364AEL, 0x84D929CE6589B6FEL, + 0x70B7A2F6DA4F7255L, 0x0E7253D75C6D4929L, 0x04F23A3D574159A7L, 0x0A8069EA0B2C108EL, + 0x49D073C56BB11A11L, 0x8AAB7A1939E4FFD7L, 0xCD095A0B0E38ACEFL, 0xC9FB60365979F548L, + 0x92BDE697D67F3422L, 0xC78933E10514BC61L, 0xE1C1D9B975C9B54AL, 0xD2266160CF1BCD80L, + 0x9A4492ED78FD8671L, 0xB3CCAB2A881A9793L, 0x72CEBF667FE1D088L, 0xD6D45B5D985A9427L + }, + new ulong[]{ + 0xC811A8058C3F55DEL, 0x65F5B43196B50619L, 0xF74F96B1D6706E43L, 0x859D1E8BCB43D336L, + 0x5AAB8A85CCFA3D84L, 0xF9C7BF99C295FCFDL, 0xA21FD5A1DE4B630FL, 0xCDB3EF763B8B456DL, + 0x803F59F87CF7C385L, 0xB27C73BE5F31913CL, 0x98E3AC6633B04821L, 0xBF61674C26B8F818L, + 0x0FFBC995C4C130C8L, 0xAAA0862010761A98L, 0x6057F342210116AAL, 0xF63C760C0654CC35L, + 0x2DDB45CC667D9042L, 0xBCF45A964BD40382L, 0x68E8A0C3EF3C6F3DL, 0xA7BD92D269FF73BCL, + 0x290AE20201ED2287L, 0xB7DE34CDE885818FL, 0xD901EEA7DD61059BL, 0xD6FA273219A03553L, + 0xD56F1AE874CCCEC9L, 0xEA31245C2E83F554L, 0x7034555DA07BE499L, 0xCE26D2AC56E7BEF7L, + 0xFD161857A5054E38L, 0x6A0E7DA4527436D1L, 0x5BD86A381CDE9FF2L, 0xCAF7756231770C32L, + 0xB09AAED9E279C8D0L, 0x5DEF1091C60674DBL, 0x111046A2515E5045L, 0x23536CE4729802FCL, + 0xC50CBCF7F5B63CFAL, 0x73A16887CD171F03L, 0x7D2941AFD9F28DBDL, 0x3F5E3EB45A4F3B9DL, + 0x84EEFE361B677140L, 0x3DB8E3D3E7076271L, 0x1A3A28F9F20FD248L, 0x7EBC7C75B49E7627L, + 0x74E5F293C7EB565CL, 0x18DCF59E4F478BA4L, 0x0C6EF44FA9ADCB52L, 0xC699812D98DAC760L, + 0x788B06DC6E469D0EL, 0xFC65F8EA7521EC4EL, 0x30A5F7219E8E0B55L, 0x2BEC3F65BCA57B6BL, + 0xDDD04969BAF1B75EL, 0x99904CDBE394EA57L, 0x14B201D1E6EA40F6L, 0xBBB0C08241284ADDL, + 0x50F20463BF8F1DFFL, 0xE8D7F93B93CBACB8L, 0x4D8CB68E477C86E8L, 0xC1DD1B3992268E3FL, + 0x7C5AA11209D62FCBL, 0x2F3D98ABDB35C9AEL, 0x671369562BFD5FF5L, 0x15C1E16C36CEE280L, + 0x1D7EB2EDF8F39B17L, 0xDA94D37DB00DFE01L, 0x877BC3EC760B8ADAL, 0xCB8495DFE153AE44L, + 0x05A24773B7B410B3L, 0x12857B783C32ABDFL, 0x8EB770D06812513BL, 0x536739B9D2E3E665L, + 0x584D57E271B26468L, 0xD789C78FC9849725L, 0xA935BBFA7D1AE102L, 0x8B1537A3DFA64188L, + 0xD0CD5D9BC378DE7AL, 0x4AC82C9A4D80CFB7L, 0x42777F1B83BDB620L, 0x72D2883A1D33BD75L, + 0x5E7A2D4BAB6A8F41L, 0xF4DAAB6BBB1C95D9L, 0x905CFFE7FD8D31B6L, 0x83AA6422119B381FL, + 0xC0AEFB8442022C49L, 0xA0F908C663033AE3L, 0xA428AF0804938826L, 0xADE41C341A8A53C7L, + 0xAE7121EE77E6A85DL, 0xC47F5C4A25929E8CL, 0xB538E9AA55CDD863L, 0x06377AA9DAD8EB29L, + 0xA18AE87BB3279895L, 0x6EDFDA6A35E48414L, 0x6B7D9D19825094A7L, 0xD41CFA55A4E86CBFL, + 0xE5CAEDC9EA42C59CL, 0xA36C351C0E6FC179L, 0x5181E4DE6FABBF89L, 0xFFF0C530184D17D4L, + 0x9D41EB1584045892L, 0x1C0D525028D73961L, 0xF178EC180CA8856AL, 0x9A0571018EF811CDL, + 0x4091A27C3EF5EFCCL, 0x19AF15239F6329D2L, 0x347450EFF91EB990L, 0xE11B4A078DD27759L, + 0xB9561DE5FC601331L, 0x912F1F5A2DA993C0L, 0x1654DCB65BA2191AL, 0x3E2DDE098A6B99EBL, + 0x8A66D71E0F82E3FEL, 0x8C51ADB7D55A08D7L, 0x4533E50F8941FF7FL, 0x02E6DD67BD4859ECL, + 0xE068AABA5DF6D52FL, 0xC24826E3FF4A75A5L, 0x6C39070D88ACDDF8L, 0x6486548C4691A46FL, + 0xD1BEBD26135C7C0CL, 0xB30F93038F15334AL, 0x82D9849FC1BF9A69L, 0x9C320BA85420FAE4L, + 0xFA528243AFF90767L, 0x9ED4D6CFE968A308L, 0xB825FD582C44B147L, 0x9B7691BC5EDCB3BBL, + 0xC7EA619048FE6516L, 0x1063A61F817AF233L, 0x47D538683409A693L, 0x63C2CE984C6DED30L, + 0x2A9FDFD86C81D91DL, 0x7B1E3B06032A6694L, 0x666089EBFBD9FD83L, 0x0A598EE67375207BL, + 0x07449A140AFC495FL, 0x2CA8A571B6593234L, 0x1F986F8A45BBC2FBL, 0x381AA4A050B372C2L, + 0x5423A3ADD81FAF3AL, 0x17273C0B8B86BB6CL, 0xFE83258DC869B5A2L, 0x287902BFD1C980F1L, + 0xF5A94BD66B3837AFL, 0x88800A79B2CABA12L, 0x55504310083B0D4CL, 0xDF36940E07B9EEB2L, + 0x04D1A7CE6790B2C5L, 0x612413FFF125B4DCL, 0x26F12B97C52C124FL, 0x86082351A62F28ACL, + 0xEF93632F9937E5E7L, 0x3507B052293A1BE6L, 0xE72C30AE570A9C70L, 0xD3586041AE1425E0L, + 0xDE4574B3D79D4CC4L, 0x92BA228040C5685AL, 0xF00B0CA5DC8C271CL, 0xBE1287F1F69C5A6EL, + 0xF39E317FB1E0DC86L, 0x495D114020EC342DL, 0x699B407E3F18CD4BL, 0xDCA3A9D46AD51528L, + 0x0D1D14F279896924L, 0x0000000000000000L, 0x593EB75FA196C61EL, 0x2E4E78160B116BD8L, + 0x6D4AE7B058887F8EL, 0xE65FD013872E3E06L, 0x7A6DDBBBD30EC4E2L, 0xAC97FC89CAAEF1B1L, + 0x09CCB33C1E19DBE1L, 0x89F3EAC462EE1864L, 0x7770CF49AA87ADC6L, 0x56C57ECA6557F6D6L, + 0x03953DDA6D6CFB9AL, 0x36928D884456E07CL, 0x1EEB8F37959F608DL, 0x31D6179C4EAAA923L, + 0x6FAC3AD7E5C02662L, 0x43049FA653991456L, 0xABD3669DC052B8EEL, 0xAF02C153A7C20A2BL, + 0x3CCB036E3723C007L, 0x93C9C23D90E1CA2CL, 0xC33BC65E2F6ED7D3L, 0x4CFF56339758249EL, + 0xB1E94E64325D6AA6L, 0x37E16D359472420AL, 0x79F8E661BE623F78L, 0x5214D90402C74413L, + 0x482EF1FDF0C8965BL, 0x13F69BC5EC1609A9L, 0x0E88292814E592BEL, 0x4E198B542A107D72L, + 0xCCC00FCBEBAFE71BL, 0x1B49C844222B703EL, 0x2564164DA840E9D5L, 0x20C6513E1FF4F966L, + 0xBAC3203F910CE8ABL, 0xF2EDD1C261C47EF0L, 0x814CB945ACD361F3L, 0x95FEB8944A392105L, + 0x5C9CF02C1622D6ADL, 0x971865F3F77178E9L, 0xBD87BA2B9BF0A1F4L, 0x444005B259655D09L, + 0xED75BE48247FBC0BL, 0x7596122E17CFF42AL, 0xB44B091785E97A15L, 0x966B854E2755DA9FL, + 0xEEE0839249134791L, 0x32432A4623C652B9L, 0xA8465B47AD3E4374L, 0xF8B45F2412B15E8BL, + 0x2417F6F078644BA3L, 0xFB2162FE7FDDA511L, 0x4BBBCC279DA46DC1L, 0x0173E0BDD024A276L, + 0x22208C59A2BCA08AL, 0x8FC4906DB836F34DL, 0xE4B90D743A6667EAL, 0x7147B5E0705F46EFL, + 0x2782CB2A1508B039L, 0xEC065EF5F45B1E7DL, 0x21B5B183CFD05B10L, 0xDBE733C060295C77L, + 0x9FA73672394C017EL, 0xCF55321186C31C81L, 0xD8720E1A0D45A7EDL, 0x3B8F997A3DDF8958L, + 0x3AFC79C7EDFB2B2EL, 0xE9A4198643EF0ECEL, 0x5F09CDF67B4E2D37L, 0x4F6A6BE9FA34DF04L, + 0xB6ADD47038A123F9L, 0x8D224D0A057EAAA1L, 0xC96248B85C1BF7A8L, 0xE3FD9760309A2EB5L, + 0x0B2A6E5BA351820DL, 0xEB42C4E1FEA75722L, 0x948D58299A1D8373L, 0x7FCF9CC864BAD451L, + 0xA55B4FB5D4B72A50L, 0x08BF5381CE3D7997L, 0x46A6D8D5E42D04E5L, 0xD22B80FC7E308796L, + 0x57B69E77B57354A0L, 0x3969441D8097D0B4L, 0x3330CAFBF3E2F0CFL, 0xE28E77DDE0BE8CC3L, + 0x62B12E259C494F46L, 0xA6CE726FB9DBD1CAL, 0x41E242C1EED14DBAL, 0x76032FF47AA30FB0L + }, + new ulong[]{ + 0x45B268A93ACDE4CCL, 0xAF7F0BE884549D08L, 0x048354B3C1468263L, 0x925435C2C80EFED2L, + 0xEE4E37F27FDFFBA7L, 0x167A33920C60F14DL, 0xFB123B52EA03E584L, 0x4A0CAB53FDBB9007L, + 0x9DEAF6380F788A19L, 0xCB48EC558F0CB32AL, 0xB59DC4B2D6FEF7E0L, 0xDCDBCA22F4F3ECB6L, + 0x11DF5813549A9C40L, 0xE33FDEDF568ACED3L, 0xA0C1C8124322E9C3L, 0x07A56B8158FA6D0DL, + 0x77279579B1E1F3DDL, 0xD9B18B74422AC004L, 0xB8EC2D9FFFABC294L, 0xF4ACF8A82D75914FL, + 0x7BBF69B1EF2B6878L, 0xC4F62FAF487AC7E1L, 0x76CE809CC67E5D0CL, 0x6711D88F92E4C14CL, + 0x627B99D9243DEDFEL, 0x234AA5C3DFB68B51L, 0x909B1F15262DBF6DL, 0x4F66EA054B62BCB5L, + 0x1AE2CF5A52AA6AE8L, 0xBEA053FBD0CE0148L, 0xED6808C0E66314C9L, 0x43FE16CD15A82710L, + 0xCD049231A06970F6L, 0xE7BC8A6C97CC4CB0L, 0x337CE835FCB3B9C0L, 0x65DEF2587CC780F3L, + 0x52214EDE4132BB50L, 0x95F15E4390F493DFL, 0x870839625DD2E0F1L, 0x41313C1AFB8B66AFL, + 0x91720AF051B211BCL, 0x477D427ED4EEA573L, 0x2E3B4CEEF6E3BE25L, 0x82627834EB0BCC43L, + 0x9C03E3DD78E724C8L, 0x2877328AD9867DF9L, 0x14B51945E243B0F2L, 0x574B0F88F7EB97E2L, + 0x88B6FA989AA4943AL, 0x19C4F068CB168586L, 0x50EE6409AF11FAEFL, 0x7DF317D5C04EABA4L, + 0x7A567C5498B4C6A9L, 0xB6BBFB804F42188EL, 0x3CC22BCF3BC5CD0BL, 0xD04336EAAA397713L, + 0xF02FAC1BEC33132CL, 0x2506DBA7F0D3488DL, 0xD7E65D6BF2C31A1EL, 0x5EB9B2161FF820F5L, + 0x842E0650C46E0F9FL, 0x716BEB1D9E843001L, 0xA933758CAB315ED4L, 0x3FE414FDA2792265L, + 0x27C9F1701EF00932L, 0x73A4C1CA70A771BEL, 0x94184BA6E76B3D0EL, 0x40D829FF8C14C87EL, + 0x0FBEC3FAC77674CBL, 0x3616A9634A6A9572L, 0x8F139119C25EF937L, 0xF545ED4D5AEA3F9EL, + 0xE802499650BA387BL, 0x6437E7BD0B582E22L, 0xE6559F89E053E261L, 0x80AD52E305288DFCL, + 0x6DC55A23E34B9935L, 0xDE14E0F51AD0AD09L, 0xC6390578A659865EL, 0x96D7617109487CB1L, + 0xE2D6CB3A21156002L, 0x01E915E5779FAED1L, 0xADB0213F6A77DCB7L, 0x9880B76EB9A1A6ABL, + 0x5D9F8D248644CF9BL, 0xFD5E4536C5662658L, 0xF1C6B9FE9BACBDFDL, 0xEACD6341BE9979C4L, + 0xEFA7221708405576L, 0x510771ECD88E543EL, 0xC2BA51CB671F043DL, 0x0AD482AC71AF5879L, + 0xFE787A045CDAC936L, 0xB238AF338E049AEDL, 0xBD866CC94972EE26L, 0x615DA6EBBD810290L, + 0x3295FDD08B2C1711L, 0xF834046073BF0AEAL, 0xF3099329758FFC42L, 0x1CAEB13E7DCFA934L, + 0xBA2307481188832BL, 0x24EFCE42874CE65CL, 0x0E57D61FB0E9DA1AL, 0xB3D1BAD6F99B343CL, + 0xC0757B1C893C4582L, 0x2B510DB8403A9297L, 0x5C7698C1F1DB614AL, 0x3E0D0118D5E68CB4L, + 0xD60F488E855CB4CFL, 0xAE961E0DF3CB33D9L, 0x3A8E55AB14A00ED7L, 0x42170328623789C1L, + 0x838B6DD19C946292L, 0x895FEF7DED3B3AEBL, 0xCFCBB8E64E4A3149L, 0x064C7E642F65C3DCL, + 0x3D2B3E2A4C5A63DAL, 0x5BD3F340A9210C47L, 0xB474D157A1615931L, 0xAC5934DA1DE87266L, + 0x6EE365117AF7765BL, 0xC86ED36716B05C44L, 0x9BA6885C201D49C5L, 0xB905387A88346C45L, + 0x131072C4BAB9DDFFL, 0xBF49461EA751AF99L, 0xD52977BC1CE05BA1L, 0xB0F785E46027DB52L, + 0x546D30BA6E57788CL, 0x305AD707650F56AEL, 0xC987C682612FF295L, 0xA5AB8944F5FBC571L, + 0x7ED528E759F244CAL, 0x8DDCBBCE2C7DB888L, 0xAA154ABE328DB1BAL, 0x1E619BE993ECE88BL, + 0x09F2BD9EE813B717L, 0x7401AA4B285D1CB3L, 0x21858F143195CAEEL, 0x48C381841398D1B8L, + 0xFCB750D3B2F98889L, 0x39A86A998D1CE1B9L, 0x1F888E0CE473465AL, 0x7899568376978716L, + 0x02CF2AD7EE2341BFL, 0x85C713B5B3F1A14EL, 0xFF916FE12B4567E7L, 0x7C1A0230B7D10575L, + 0x0C98FCC85ECA9BA5L, 0xA3E7F720DA9E06ADL, 0x6A6031A2BBB1F438L, 0x973E74947ED7D260L, + 0x2CF4663918C0FF9AL, 0x5F50A7F368678E24L, 0x34D983B4A449D4CDL, 0x68AF1B755592B587L, + 0x7F3C3D022E6DEA1BL, 0xABFC5F5B45121F6BL, 0x0D71E92D29553574L, 0xDFFDF5106D4F03D8L, + 0x081BA87B9F8C19C6L, 0xDB7EA1A3AC0981BBL, 0xBBCA12AD66172DFAL, 0x79704366010829C7L, + 0x179326777BFF5F9CL, 0x0000000000000000L, 0xEB2476A4C906D715L, 0x724DD42F0738DF6FL, + 0xB752EE6538DDB65FL, 0x37FFBC863DF53BA3L, 0x8EFA84FCB5C157E6L, 0xE9EB5C73272596AAL, + 0x1B0BDABF2535C439L, 0x86E12C872A4D4E20L, 0x9969A28BCE3E087AL, 0xFAFB2EB79D9C4B55L, + 0x056A4156B6D92CB2L, 0x5A3AE6A5DEBEA296L, 0x22A3B026A8292580L, 0x53C85B3B36AD1581L, + 0xB11E900117B87583L, 0xC51F3A4A3FE56930L, 0xE019E1EDCF3621BDL, 0xEC811D2591FCBA18L, + 0x445B7D4C4D524A1DL, 0xA8DA6069DCAEF005L, 0x58F5CC72309DE329L, 0xD4C062596B7FF570L, + 0xCE22AD0339D59F98L, 0x591CD99747024DF8L, 0x8B90C5AA03187B54L, 0xF663D27FC356D0F0L, + 0xD8589E9135B56ED5L, 0x35309651D3D67A1CL, 0x12F96721CD26732EL, 0xD28C1C3D441A36ACL, + 0x492A946164077F69L, 0x2D1D73DC6F5F514BL, 0x6F0A70F40D68D88AL, 0x60B4B30ECA1EAC41L, + 0xD36509D83385987DL, 0x0B3D97490630F6A8L, 0x9ECCC90A96C46577L, 0xA20EE2C5AD01A87CL, + 0xE49AB55E0E70A3DEL, 0xA4429CA182646BA0L, 0xDA97B446DB962F6AL, 0xCCED87D4D7F6DE27L, + 0x2AB8185D37A53C46L, 0x9F25DCEFE15BCBA6L, 0xC19C6EF9FEA3EB53L, 0xA764A3931BD884CEL, + 0x2FD2590B817C10F4L, 0x56A21A6D80743933L, 0xE573A0BB79EF0D0FL, 0x155C0CA095DC1E23L, + 0x6C2C4FC694D437E4L, 0x10364DF623053291L, 0xDD32DFC7836C4267L, 0x03263F3299BCEF6EL, + 0x66F8CD6AE57B6F9DL, 0x8C35AE2B5BE21659L, 0x31B3C2E21290F87FL, 0x93BD2027BF915003L, + 0x69460E90220D1B56L, 0x299E276FAE19D328L, 0x63928C3C53A2432FL, 0x7082FEF8E91B9ED0L, + 0xBC6F792C3EED40F7L, 0x4C40D537D2DE53DBL, 0x75E8BFAE5FC2B262L, 0x4DA9C0D2A541FD0AL, + 0x4E8FFFE03CFD1264L, 0x2620E495696FA7E3L, 0xE1F0F408B8A98F6CL, 0xD1AA230FDDA6D9C2L, + 0xC7D0109DD1C6288FL, 0x8A79D04F7487D585L, 0x4694579BA3710BA2L, 0x38417F7CFA834F68L, + 0x1D47A4DB0A5007E5L, 0x206C9AF1460A643FL, 0xA128DDF734BD4712L, 0x8144470672B7232DL, + 0xF2E086CC02105293L, 0x182DE58DBC892B57L, 0xCAA1F9B0F8931DFBL, 0x6B892447CC2E5AE9L, + 0xF9DD11850420A43BL, 0x4BE5BEB68A243ED6L, 0x5584255F19C8D65DL, 0x3B67404E633FA006L, + 0xA68DB6766C472A1FL, 0xF78AC79AB4C97E21L, 0xC353442E1080AAECL, 0x9A4F9DB95782E714L + }, + new ulong[] { + 0x05BA7BC82C9B3220L, 0x31A54665F8B65E4FL, 0xB1B651F77547F4D4L, 0x8BFA0D857BA46682L, + 0x85A96C5AA16A98BBL, 0x990FAEF908EB79C9L, 0xA15E37A247F4A62DL, 0x76857DCD5D27741EL, + 0xF8C50B800A1820BCL, 0xBE65DCB201F7A2B4L, 0x666D1B986F9426E7L, 0x4CC921BF53C4E648L, + 0x95410A0F93D9CA42L, 0x20CDCCAA647BA4EFL, 0x429A4060890A1871L, 0x0C4EA4F69B32B38BL, + 0xCCDA362DDE354CD3L, 0x96DC23BC7C5B2FA9L, 0xC309BB68AA851AB3L, 0xD26131A73648E013L, + 0x021DC52941FC4DB2L, 0xCD5ADAB7704BE48AL, 0xA77965D984ED71E6L, 0x32386FD61734BBA4L, + 0xE82D6DD538AB7245L, 0x5C2147EA6177B4B1L, 0x5DA1AB70CF091CE8L, 0xAC907FCE72B8BDFFL, + 0x57C85DFD972278A8L, 0xA4E44C6A6B6F940DL, 0x3851995B4F1FDFE4L, 0x62578CCAED71BC9EL, + 0xD9882BB0C01D2C0AL, 0x917B9D5D113C503BL, 0xA2C31E11A87643C6L, 0xE463C923A399C1CEL, + 0xF71686C57EA876DCL, 0x87B4A973E096D509L, 0xAF0D567D9D3A5814L, 0xB40C2A3F59DCC6F4L, + 0x3602F88495D121DDL, 0xD3E1DD3D9836484AL, 0xF945E71AA46688E5L, 0x7518547EB2A591F5L, + 0x9366587450C01D89L, 0x9EA81018658C065BL, 0x4F54080CBC4603A3L, 0x2D0384C65137BF3DL, + 0xDC325078EC861E2AL, 0xEA30A8FC79573FF7L, 0x214D2030CA050CB6L, 0x65F0322B8016C30CL, + 0x69BE96DD1B247087L, 0xDB95EE9981E161B8L, 0xD1FC1814D9CA05F8L, 0x820ED2BBCC0DE729L, + 0x63D76050430F14C7L, 0x3BCCB0E8A09D3A0FL, 0x8E40764D573F54A2L, 0x39D175C1E16177BDL, + 0x12F5A37C734F1F4BL, 0xAB37C12F1FDFC26DL, 0x5648B167395CD0F1L, 0x6C04ED1537BF42A7L, + 0xED97161D14304065L, 0x7D6C67DAAB72B807L, 0xEC17FA87BA4EE83CL, 0xDFAF79CB0304FBC1L, + 0x733F060571BC463EL, 0x78D61C1287E98A27L, 0xD07CF48E77B4ADA1L, 0xB9C262536C90DD26L, + 0xE2449B5860801605L, 0x8FC09AD7F941FCFBL, 0xFAD8CEA94BE46D0EL, 0xA343F28B0608EB9FL, + 0x9B126BD04917347BL, 0x9A92874AE7699C22L, 0x1B017C42C4E69EE0L, 0x3A4C5C720EE39256L, + 0x4B6E9F5E3EA399DAL, 0x6BA353F45AD83D35L, 0xE7FEE0904C1B2425L, 0x22D009832587E95DL, + 0x842980C00F1430E2L, 0xC6B3C0A0861E2893L, 0x087433A419D729F2L, 0x341F3DADD42D6C6FL, + 0xEE0A3FAEFBB2A58EL, 0x4AEE73C490DD3183L, 0xAAB72DB5B1A16A34L, 0xA92A04065E238FDFL, + 0x7B4B35A1686B6FCCL, 0x6A23BF6EF4A6956CL, 0x191CB96B851AD352L, 0x55D598D4D6DE351AL, + 0xC9604DE5F2AE7EF3L, 0x1CA6C2A3A981E172L, 0xDE2F9551AD7A5398L, 0x3025AAFF56C8F616L, + 0x15521D9D1E2860D9L, 0x506FE31CFA45073AL, 0x189C55F12B647B0BL, 0x0180EC9AAE7EA859L, + 0x7CEC8B40050C105EL, 0x2350E5198BF94104L, 0xEF8AD33455CC0DD7L, 0x07A7BEE16D677F92L, + 0xE5E325B90DE76997L, 0x5A061591A26E637AL, 0xB611EF1618208B46L, 0x09F4DF3EB7A981ABL, + 0x1EBB078AE87DACC0L, 0xB791038CB65E231FL, 0x0FD38D4574B05660L, 0x67EDF702C1EA8EBEL, + 0xBA5F4BE0831238CDL, 0xE3C477C2CEFEBE5CL, 0x0DCE486C354C1BD2L, 0x8C5DB36416C31910L, + 0x26EA9ED1A7627324L, 0x039D29B3EF82E5EBL, 0x9F28FC82CBF2AE02L, 0xA8AAE89CF05D2786L, + 0x431AACFA2774B028L, 0xCF471F9E31B7A938L, 0x581BD0B8E3922EC8L, 0xBC78199B400BEF06L, + 0x90FB71C7BF42F862L, 0x1F3BEB1046030499L, 0x683E7A47B55AD8DEL, 0x988F4263A695D190L, + 0xD808C72A6E638453L, 0x0627527BC319D7CBL, 0xEBB04466D72997AEL, 0xE67E0C0AE2658C7CL, + 0x14D2F107B056C880L, 0x7122C32C30400B8CL, 0x8A7AE11FD5DACEDBL, 0xA0DEDB38E98A0E74L, + 0xAD109354DCC615A6L, 0x0BE91A17F655CC19L, 0x8DDD5FFEB8BDB149L, 0xBFE53028AF890AEDL, + 0xD65BA6F5B4AD7A6AL, 0x7956F0882997227EL, 0x10E8665532B352F9L, 0x0E5361DFDACEFE39L, + 0xCEC7F3049FC90161L, 0xFF62B561677F5F2EL, 0x975CCF26D22587F0L, 0x51EF0F86543BAF63L, + 0x2F1E41EF10CBF28FL, 0x52722635BBB94A88L, 0xAE8DBAE73344F04DL, 0x410769D36688FD9AL, + 0xB3AB94DE34BBB966L, 0x801317928DF1AA9BL, 0xA564A0F0C5113C54L, 0xF131D4BEBDB1A117L, + 0x7F71A2F3EA8EF5B5L, 0x40878549C8F655C3L, 0x7EF14E6944F05DECL, 0xD44663DCF55137D8L, + 0xF2ACFD0D523344FCL, 0x0000000000000000L, 0x5FBC6E598EF5515AL, 0x16CF342EF1AA8532L, + 0xB036BD6DDB395C8DL, 0x13754FE6DD31B712L, 0xBBDFA77A2D6C9094L, 0x89E7C8AC3A582B30L, + 0x3C6B0E09CDFA459DL, 0xC4AE0589C7E26521L, 0x49735A777F5FD468L, 0xCAFD64561D2C9B18L, + 0xDA1502032F9FC9E1L, 0x8867243694268369L, 0x3782141E3BAF8984L, 0x9CB5D53124704BE9L, + 0xD7DB4A6F1AD3D233L, 0xA6F989432A93D9BFL, 0x9D3539AB8A0EE3B0L, 0x53F2CAAF15C7E2D1L, + 0x6E19283C76430F15L, 0x3DEBE2936384EDC4L, 0x5E3C82C3208BF903L, 0x33B8834CB94A13FDL, + 0x6470DEB12E686B55L, 0x359FD1377A53C436L, 0x61CAA57902F35975L, 0x043A975282E59A79L, + 0xFD7F70482683129CL, 0xC52EE913699CCD78L, 0x28B9FF0E7DAC8D1DL, 0x5455744E78A09D43L, + 0xCB7D88CCB3523341L, 0x44BD121B4A13CFBAL, 0x4D49CD25FDBA4E11L, 0x3E76CB208C06082FL, + 0x3FF627BA2278A076L, 0xC28957F204FBB2EAL, 0x453DFE81E46D67E3L, 0x94C1E6953DA7621BL, + 0x2C83685CFF491764L, 0xF32C1197FC4DECA5L, 0x2B24D6BD922E68F6L, 0xB22B78449AC5113FL, + 0x48F3B6EDD1217C31L, 0x2E9EAD75BEB55AD6L, 0x174FD8B45FD42D6BL, 0x4ED4E4961238ABFAL, + 0x92E6B4EEFEBEB5D0L, 0x46A0D7320BEF8208L, 0x47203BA8A5912A51L, 0x24F75BF8E69E3E96L, + 0xF0B1382413CF094EL, 0xFEE259FBC901F777L, 0x276A724B091CDB7DL, 0xBDF8F501EE75475FL, + 0x599B3C224DEC8691L, 0x6D84018F99C1EAFEL, 0x7498B8E41CDB39ACL, 0xE0595E71217C5BB7L, + 0x2AA43A273C50C0AFL, 0xF50B43EC3F543B6EL, 0x838E3E2162734F70L, 0xC09492DB4507FF58L, + 0x72BFEA9FDFC2EE67L, 0x11688ACF9CCDFAA0L, 0x1A8190D86A9836B9L, 0x7ACBD93BC615C795L, + 0xC7332C3A286080CAL, 0x863445E94EE87D50L, 0xF6966A5FD0D6DE85L, 0xE9AD814F96D5DA1CL, + 0x70A22FB69E3EA3D5L, 0x0A69F68D582B6440L, 0xB8428EC9C2EE757FL, 0x604A49E3AC8DF12CL, + 0x5B86F90B0C10CB23L, 0xE1D9B2EB8F02F3EEL, 0x29391394D3D22544L, 0xC8E0A17F5CD0D6AAL, + 0xB58CC6A5F7A26EADL, 0x8193FB08238F02C2L, 0xD5C68F465B2F9F81L, 0xFCFF9CD288FDBAC5L, + 0x77059157F359DC47L, 0x1D262E3907FF492BL, 0xFB582233E59AC557L, 0xDDB2BCE242F8B673L, + 0x2577B76248E096CFL, 0x6F99C4A6D83DA74CL, 0xC1147E41EB795701L, 0xF48BAF76912A9337L + }, + new ulong[] { + 0x3EF29D249B2C0A19L, 0xE9E16322B6F8622FL, 0x5536994047757F7AL, 0x9F4D56D5A47B0B33L, + 0x822567466AA1174CL, 0xB8F5057DEB082FB2L, 0xCC48C10BF4475F53L, 0x373088D4275DEC3AL, + 0x968F4325180AED10L, 0x173D232CF7016151L, 0xAE4ED09F946FCC13L, 0xFD4B4741C4539873L, + 0x1B5B3F0DD9933765L, 0x2FFCB0967B644052L, 0xE02376D20A89840CL, 0xA3AE3A70329B18D7L, + 0x419CBD2335DE8526L, 0xFAFEBF115B7C3199L, 0x0397074F85AA9B0DL, 0xC58AD4FB4836B970L, + 0xBEC60BE3FC4104A8L, 0x1EFF36DC4B708772L, 0x131FDC33ED8453B6L, 0x0844E33E341764D3L, + 0x0FF11B6EAB38CD39L, 0x64351F0A7761B85AL, 0x3B5694F509CFBA0EL, 0x30857084B87245D0L, + 0x47AFB3BD2297AE3CL, 0xF2BA5C2F6F6B554AL, 0x74BDC4761F4F70E1L, 0xCFDFC64471EDC45EL, + 0xE610784C1DC0AF16L, 0x7ACA29D63C113F28L, 0x2DED411776A859AFL, 0xAC5F211E99A3D5EEL, + 0xD484F949A87EF33BL, 0x3CE36CA596E013E4L, 0xD120F0983A9D432CL, 0x6BC40464DC597563L, + 0x69D5F5E5D1956C9EL, 0x9AE95F043698BB24L, 0xC9ECC8DA66A4EF44L, 0xD69508C8A5B2EAC6L, + 0xC40C2235C0503B80L, 0x38C193BA8C652103L, 0x1CEEC75D46BC9E8FL, 0xD331011937515AD1L, + 0xD8E2E56886ECA50FL, 0xB137108D5779C991L, 0x709F3B6905CA4206L, 0x4FEB50831680CAEFL, + 0xEC456AF3241BD238L, 0x58D673AFE181ABBEL, 0x242F54E7CAD9BF8CL, 0x0211F1810DCC19FDL, + 0x90BC4DBB0F43C60AL, 0x9518446A9DA0761DL, 0xA1BFCBF13F57012AL, 0x2BDE4F8961E172B5L, + 0x27B853A84F732481L, 0xB0B1E643DF1F4B61L, 0x18CC38425C39AC68L, 0xD2B7F7D7BF37D821L, + 0x3103864A3014C720L, 0x14AA246372ABFA5CL, 0x6E600DB54EBAC574L, 0x394765740403A3F3L, + 0x09C215F0BC71E623L, 0x2A58B947E987F045L, 0x7B4CDF18B477BDD8L, 0x9709B5EB906C6FE0L, + 0x73083C268060D90BL, 0xFEDC400E41F9037EL, 0x284948C6E44BE9B8L, 0x728ECAE808065BFBL, + 0x06330E9E17492B1AL, 0x5950856169E7294EL, 0xBAE4F4FCE6C4364FL, 0xCA7BCF95E30E7449L, + 0x7D7FD186A33E96C2L, 0x52836110D85AD690L, 0x4DFAA1021B4CD312L, 0x913ABB75872544FAL, + 0xDD46ECB9140F1518L, 0x3D659A6B1E869114L, 0xC23F2CABD719109AL, 0xD713FE062DD46836L, + 0xD0A60656B2FBC1DCL, 0x221C5A79DD909496L, 0xEFD26DBCA1B14935L, 0x0E77EDA0235E4FC9L, + 0xCBFD395B6B68F6B9L, 0x0DE0EAEFA6F4D4C4L, 0x0422FF1F1A8532E7L, 0xF969B85EDED6AA94L, + 0x7F6E2007AEF28F3FL, 0x3AD0623B81A938FEL, 0x6624EE8B7AADA1A7L, 0xB682E8DDC856607BL, + 0xA78CC56F281E2A30L, 0xC79B257A45FAA08DL, 0x5B4174E0642B30B3L, 0x5F638BFF7EAE0254L, + 0x4BC9AF9C0C05F808L, 0xCE59308AF98B46AEL, 0x8FC58DA9CC55C388L, 0x803496C7676D0EB1L, + 0xF33CAAE1E70DD7BAL, 0xBB6202326EA2B4BFL, 0xD5020F87201871CBL, 0x9D5CA754A9B712CEL, + 0x841669D87DE83C56L, 0x8A6184785EB6739FL, 0x420BBA6CB0741E2BL, 0xF12D5B60EAC1CE47L, + 0x76AC35F71283691CL, 0x2C6BB7D9FECEDB5FL, 0xFCCDB18F4C351A83L, 0x1F79C012C3160582L, + 0xF0ABADAE62A74CB7L, 0xE1A5801C82EF06FCL, 0x67A21845F2CB2357L, 0x5114665F5DF04D9DL, + 0xBF40FD2D74278658L, 0xA0393D3FB73183DAL, 0x05A409D192E3B017L, 0xA9FB28CF0B4065F9L, + 0x25A9A22942BF3D7CL, 0xDB75E22703463E02L, 0xB326E10C5AB5D06CL, 0xE7968E8295A62DE6L, + 0xB973F3B3636EAD42L, 0xDF571D3819C30CE5L, 0xEE549B7229D7CBC5L, 0x12992AFD65E2D146L, + 0xF8EF4E9056B02864L, 0xB7041E134030E28BL, 0xC02EDD2ADAD50967L, 0x932B4AF48AE95D07L, + 0x6FE6FB7BC6DC4784L, 0x239AACB755F61666L, 0x401A4BEDBDB807D6L, 0x485EA8D389AF6305L, + 0xA41BC220ADB4B13DL, 0x753B32B89729F211L, 0x997E584BB3322029L, 0x1D683193CEDA1C7FL, + 0xFF5AB6C0C99F818EL, 0x16BBD5E27F67E3A1L, 0xA59D34EE25D233CDL, 0x98F8AE853B54A2D9L, + 0x6DF70AFACB105E79L, 0x795D2E99B9BBA425L, 0x8E437B6744334178L, 0x0186F6CE886682F0L, + 0xEBF092A3BB347BD2L, 0xBCD7FA62F18D1D55L, 0xADD9D7D011C5571EL, 0x0BD3E471B1BDFFDEL, + 0xAA6C2F808EEAFEF4L, 0x5EE57D31F6C880A4L, 0xF50FA47FF044FCA0L, 0x1ADDC9C351F5B595L, + 0xEA76646D3352F922L, 0x0000000000000000L, 0x85909F16F58EBEA6L, 0x46294573AAF12CCCL, + 0x0A5512BF39DB7D2EL, 0x78DBD85731DD26D5L, 0x29CFBE086C2D6B48L, 0x218B5D36583A0F9BL, + 0x152CD2ADFACD78ACL, 0x83A39188E2C795BCL, 0xC3B9DA655F7F926AL, 0x9ECBA01B2C1D89C3L, + 0x07B5F8509F2FA9EAL, 0x7EE8D6C926940DCFL, 0x36B67E1AAF3B6ECAL, 0x86079859702425ABL, + 0xFB7849DFD31AB369L, 0x4C7C57CC932A51E2L, 0xD96413A60E8A27FFL, 0x263EA566C715A671L, + 0x6C71FC344376DC89L, 0x4A4F595284637AF8L, 0xDAF314E98B20BCF2L, 0x572768C14AB96687L, + 0x1088DB7C682EC8BBL, 0x887075F9537A6A62L, 0x2E7A4658F302C2A2L, 0x619116DBE582084DL, + 0xA87DDE018326E709L, 0xDCC01A779C6997E8L, 0xEDC39C3DAC7D50C8L, 0xA60A33A1A078A8C0L, + 0xC1A82BE452B38B97L, 0x3F746BEA134A88E9L, 0xA228CCBEBAFD9A27L, 0xABEAD94E068C7C04L, + 0xF48952B178227E50L, 0x5CF48CB0FB049959L, 0x6017E0156DE48ABDL, 0x4438B4F2A73D3531L, + 0x8C528AE649FF5885L, 0xB515EF924DFCFB76L, 0x0C661C212E925634L, 0xB493195CC59A7986L, + 0x9CDA519A21D1903EL, 0x32948105B5BE5C2DL, 0x194ACE8CD45F2E98L, 0x438D4CA238129CDBL, + 0x9B6FA9CABEFE39D4L, 0x81B26009EF0B8C41L, 0xDED1EBF691A58E15L, 0x4E6DA64D9EE6481FL, + 0x54B06F8ECF13FD8AL, 0x49D85E1D01C9E1F5L, 0xAFC826511C094EE3L, 0xF698A33075EE67ADL, + 0x5AC7822EEC4DB243L, 0x8DD47C28C199DA75L, 0x89F68337DB1CE892L, 0xCDCE37C57C21DDA3L, + 0x530597DE503C5460L, 0x6A42F2AA543FF793L, 0x5D727A7E73621BA9L, 0xE232875307459DF1L, + 0x56A19E0FC2DFE477L, 0xC61DD3B4CD9C227DL, 0xE5877F03986A341BL, 0x949EB2A415C6F4EDL, + 0x6206119460289340L, 0x6380E75AE84E11B0L, 0x8BE772B6D6D0F16FL, 0x50929091D596CF6DL, + 0xE86795EC3E9EE0DFL, 0x7CF927482B581432L, 0xC86A3E14EEC26DB4L, 0x7119CDA78DACC0F6L, + 0xE40189CD100CB6EBL, 0x92ADBC3A028FDFF7L, 0xB2A017C2D2D3529CL, 0x200DABF8D05C8D6BL, + 0x34A78F9BA2F77737L, 0xE3B4719D8F231F01L, 0x45BE423C2F5BB7C1L, 0xF71E55FEFD88E55DL, + 0x6853032B59F3EE6EL, 0x65B3E9C4FF073AAAL, 0x772AC3399AE5EBECL, 0x87816E97F842A75BL, + 0x110E2DB2E0484A4BL, 0x331277CB3DD8DEDDL, 0xBD510CAC79EB9FA5L, 0x352179552A91F5C7L + }, + new ulong[] { + 0x8AB0A96846E06A6DL, 0x43C7E80B4BF0B33AL, 0x08C9B3546B161EE5L, 0x39F1C235EBA990BEL, + 0xC1BEF2376606C7B2L, 0x2C209233614569AAL, 0xEB01523B6FC3289AL, 0x946953AB935ACEDDL, + 0x272838F63E13340EL, 0x8B0455ECA12BA052L, 0x77A1B2C4978FF8A2L, 0xA55122CA13E54086L, + 0x2276135862D3F1CDL, 0xDB8DDFDE08B76CFEL, 0x5D1E12C89E4A178AL, 0x0E56816B03969867L, + 0xEE5F79953303ED59L, 0xAFED748BAB78D71DL, 0x6D929F2DF93E53EEL, 0xF5D8A8F8BA798C2AL, + 0xF619B1698E39CF6BL, 0x95DDAF2F749104E2L, 0xEC2A9C80E0886427L, 0xCE5C8FD8825B95EAL, + 0xC4E0D9993AC60271L, 0x4699C3A5173076F9L, 0x3D1B151F50A29F42L, 0x9ED505EA2BC75946L, + 0x34665ACFDC7F4B98L, 0x61B1FB53292342F7L, 0xC721C0080E864130L, 0x8693CD1696FD7B74L, + 0x872731927136B14BL, 0xD3446C8A63A1721BL, 0x669A35E8A6680E4AL, 0xCAB658F239509A16L, + 0xA4E5DE4EF42E8AB9L, 0x37A7435EE83F08D9L, 0x134E6239E26C7F96L, 0x82791A3C2DF67488L, + 0x3F6EF00A8329163CL, 0x8E5A7E42FDEB6591L, 0x5CAAEE4C7981DDB5L, 0x19F234785AF1E80DL, + 0x255DDDE3ED98BD70L, 0x50898A32A99CCCACL, 0x28CA4519DA4E6656L, 0xAE59880F4CB31D22L, + 0x0D9798FA37D6DB26L, 0x32F968F0B4FFCD1AL, 0xA00F09644F258545L, 0xFA3AD5175E24DE72L, + 0xF46C547C5DB24615L, 0x713E80FBFF0F7E20L, 0x7843CF2B73D2AAFAL, 0xBD17EA36AEDF62B4L, + 0xFD111BACD16F92CFL, 0x4ABAA7DBC72D67E0L, 0xB3416B5DAD49FAD3L, 0xBCA316B24914A88BL, + 0x15D150068AECF914L, 0xE27C1DEBE31EFC40L, 0x4FE48C759BEDA223L, 0x7EDCFD141B522C78L, + 0x4E5070F17C26681CL, 0xE696CAC15815F3BCL, 0x35D2A64B3BB481A7L, 0x800CFF29FE7DFDF6L, + 0x1ED9FAC3D5BAA4B0L, 0x6C2663A91EF599D1L, 0x03C1199134404341L, 0xF7AD4DED69F20554L, + 0xCD9D9649B61BD6ABL, 0xC8C3BDE7EADB1368L, 0xD131899FB02AFB65L, 0x1D18E352E1FAE7F1L, + 0xDA39235AEF7CA6C1L, 0xA1BBF5E0A8EE4F7AL, 0x91377805CF9A0B1EL, 0x3138716180BF8E5BL, + 0xD9F83ACBDB3CE580L, 0x0275E515D38B897EL, 0x472D3F21F0FBBCC6L, 0x2D946EB7868EA395L, + 0xBA3C248D21942E09L, 0xE7223645BFDE3983L, 0xFF64FEB902E41BB1L, 0xC97741630D10D957L, + 0xC3CB1722B58D4ECCL, 0xA27AEC719CAE0C3BL, 0x99FECB51A48C15FBL, 0x1465AC826D27332BL, + 0xE1BD047AD75EBF01L, 0x79F733AF941960C5L, 0x672EC96C41A3C475L, 0xC27FEBA6524684F3L, + 0x64EFD0FD75E38734L, 0xED9E60040743AE18L, 0xFB8E2993B9EF144DL, 0x38453EB10C625A81L, + 0x6978480742355C12L, 0x48CF42CE14A6EE9EL, 0x1CAC1FD606312DCEL, 0x7B82D6BA4792E9BBL, + 0x9D141C7B1F871A07L, 0x5616B80DC11C4A2EL, 0xB849C198F21FA777L, 0x7CA91801C8D9A506L, + 0xB1348E487EC273ADL, 0x41B20D1E987B3A44L, 0x7460AB55A3CFBBE3L, 0x84E628034576F20AL, + 0x1B87D16D897A6173L, 0x0FE27DEFE45D5258L, 0x83CDE6B8CA3DBEB7L, 0x0C23647ED01D1119L, + 0x7A362A3EA0592384L, 0xB61F40F3F1893F10L, 0x75D457D1440471DCL, 0x4558DA34237035B8L, + 0xDCA6116587FC2043L, 0x8D9B67D3C9AB26D0L, 0x2B0B5C88EE0E2517L, 0x6FE77A382AB5DA90L, + 0x269CC472D9D8FE31L, 0x63C41E46FAA8CB89L, 0xB7ABBC771642F52FL, 0x7D1DE4852F126F39L, + 0xA8C6BA3024339BA0L, 0x600507D7CEE888C8L, 0x8FEE82C61A20AFAEL, 0x57A2448926D78011L, + 0xFCA5E72836A458F0L, 0x072BCEBB8F4B4CBDL, 0x497BBE4AF36D24A1L, 0x3CAFE99BB769557DL, + 0x12FA9EBD05A7B5A9L, 0xE8C04BAA5B836BDBL, 0x4273148FAC3B7905L, 0x908384812851C121L, + 0xE557D3506C55B0FDL, 0x72FF996ACB4F3D61L, 0x3EDA0C8E64E2DC03L, 0xF0868356E6B949E9L, + 0x04EAD72ABB0B0FFCL, 0x17A4B5135967706AL, 0xE3C8E16F04D5367FL, 0xF84F30028DAF570CL, + 0x1846C8FCBD3A2232L, 0x5B8120F7F6CA9108L, 0xD46FA231ECEA3EA6L, 0x334D947453340725L, + 0x58403966C28AD249L, 0xBED6F3A79A9F21F5L, 0x68CCB483A5FE962DL, 0xD085751B57E1315AL, + 0xFED0023DE52FD18EL, 0x4B0E5B5F20E6ADDFL, 0x1A332DE96EB1AB4CL, 0xA3CE10F57B65C604L, + 0x108F7BA8D62C3CD7L, 0xAB07A3A11073D8E1L, 0x6B0DAD1291BED56CL, 0xF2F366433532C097L, + 0x2E557726B2CEE0D4L, 0x0000000000000000L, 0xCB02A476DE9B5029L, 0xE4E32FD48B9E7AC2L, + 0x734B65EE2C84F75EL, 0x6E5386BCCD7E10AFL, 0x01B4FC84E7CBCA3FL, 0xCFE8735C65905FD5L, + 0x3613BFDA0FF4C2E6L, 0x113B872C31E7F6E8L, 0x2FE18BA255052AEBL, 0xE974B72EBC48A1E4L, + 0x0ABC5641B89D979BL, 0xB46AA5E62202B66EL, 0x44EC26B0C4BBFF87L, 0xA6903B5B27A503C7L, + 0x7F680190FC99E647L, 0x97A84A3AA71A8D9CL, 0xDD12EDE16037EA7CL, 0xC554251DDD0DC84EL, + 0x88C54C7D956BE313L, 0x4D91696048662B5DL, 0xB08072CC9909B992L, 0xB5DE5962C5C97C51L, + 0x81B803AD19B637C9L, 0xB2F597D94A8230ECL, 0x0B08AAC55F565DA4L, 0xF1327FD2017283D6L, + 0xAD98919E78F35E63L, 0x6AB9519676751F53L, 0x24E921670A53774FL, 0xB9FD3D1C15D46D48L, + 0x92F66194FBDA485FL, 0x5A35DC7311015B37L, 0xDED3F4705477A93DL, 0xC00A0EB381CD0D8DL, + 0xBB88D809C65FE436L, 0x16104997BEACBA55L, 0x21B70AC95693B28CL, 0x59F4C5E225411876L, + 0xD5DB5EB50B21F499L, 0x55D7A19CF55C096FL, 0xA97246B4C3F8519FL, 0x8552D487A2BD3835L, + 0x54635D181297C350L, 0x23C2EFDC85183BF2L, 0x9F61F96ECC0C9379L, 0x534893A39DDC8FEDL, + 0x5EDF0B59AA0A54CBL, 0xAC2C6D1A9F38945CL, 0xD7AEBBA0D8AA7DE7L, 0x2ABFA00C09C5EF28L, + 0xD84CC64F3CF72FBFL, 0x2003F64DB15878B3L, 0xA724C7DFC06EC9F8L, 0x069F323F68808682L, + 0xCC296ACD51D01C94L, 0x055E2BAE5CC0C5C3L, 0x6270E2C21D6301B6L, 0x3B842720382219C0L, + 0xD2F0900E846AB824L, 0x52FC6F277A1745D2L, 0xC6953C8CE94D8B0FL, 0xE009F8FE3095753EL, + 0x655B2C7992284D0BL, 0x984A37D54347DFC4L, 0xEAB5AEBF8808E2A5L, 0x9A3FD2C090CC56BAL, + 0x9CA0E0FFF84CD038L, 0x4C2595E4AFADE162L, 0xDF6708F4B3BC6302L, 0xBF620F237D54EBCAL, + 0x93429D101C118260L, 0x097D4FD08CDDD4DAL, 0x8C2F9B572E60ECEFL, 0x708A7C7F18C4B41FL, + 0x3A30DBA4DFE9D3FFL, 0x4006F19A7FB0F07BL, 0x5F6BF7DD4DC19EF4L, 0x1F6D064732716E8FL, + 0xF9FBCC866A649D33L, 0x308C8DE567744464L, 0x8971B0F972A0292CL, 0xD61A47243F61B7D8L, + 0xEFEB8511D4C82766L, 0x961CB6BE40D147A3L, 0xAAB35F25F7B812DEL, 0x76154E407044329DL, + 0x513D76B64E570693L, 0xF3479AC7D2F90AA8L, 0x9B8B2E4477079C85L, 0x297EB99D3D85AC69L + }, + new ulong[] { + 0x7E37E62DFC7D40C3L, 0x776F25A4EE939E5BL, 0xE045C850DD8FB5ADL, 0x86ED5BA711FF1952L, + 0xE91D0BD9CF616B35L, 0x37E0AB256E408FFBL, 0x9607F6C031025A7AL, 0x0B02F5E116D23C9DL, + 0xF3D8486BFB50650CL, 0x621CFF27C40875F5L, 0x7D40CB71FA5FD34AL, 0x6DAA6616DAA29062L, + 0x9F5F354923EC84E2L, 0xEC847C3DC507C3B3L, 0x025A3668043CE205L, 0xA8BF9E6C4DAC0B19L, + 0xFA808BE2E9BEBB94L, 0xB5B99C5277C74FA3L, 0x78D9BC95F0397BCCL, 0xE332E50CDBAD2624L, + 0xC74FCE129332797EL, 0x1729ECEB2EA709ABL, 0xC2D6B9F69954D1F8L, 0x5D898CBFBAB8551AL, + 0x859A76FB17DD8ADBL, 0x1BE85886362F7FB5L, 0xF6413F8FF136CD8AL, 0xD3110FA5BBB7E35CL, + 0x0A2FEED514CC4D11L, 0xE83010EDCD7F1AB9L, 0xA1E75DE55F42D581L, 0xEEDE4A55C13B21B6L, + 0xF2F5535FF94E1480L, 0x0CC1B46D1888761EL, 0xBCE15FDB6529913BL, 0x2D25E8975A7181C2L, + 0x71817F1CE2D7A554L, 0x2E52C5CB5C53124BL, 0xF9F7A6BEEF9C281DL, 0x9E722E7D21F2F56EL, + 0xCE170D9B81DCA7E6L, 0x0E9B82051CB4941BL, 0x1E712F623C49D733L, 0x21E45CFA42F9F7DCL, + 0xCB8E7A7F8BBA0F60L, 0x8E98831A010FB646L, 0x474CCF0D8E895B23L, 0xA99285584FB27A95L, + 0x8CC2B57205335443L, 0x42D5B8E984EFF3A5L, 0x012D1B34021E718CL, 0x57A6626AAE74180BL, + 0xFF19FC06E3D81312L, 0x35BA9D4D6A7C6DFEL, 0xC9D44C178F86ED65L, 0x506523E6A02E5288L, + 0x03772D5C06229389L, 0x8B01F4FE0B691EC0L, 0xF8DABD8AED825991L, 0x4C4E3AEC985B67BEL, + 0xB10DF0827FBF96A9L, 0x6A69279AD4F8DAE1L, 0xE78689DCD3D5FF2EL, 0x812E1A2B1FA553D1L, + 0xFBAD90D6EBA0CA18L, 0x1AC543B234310E39L, 0x1604F7DF2CB97827L, 0xA6241C6951189F02L, + 0x753513CCEAAF7C5EL, 0x64F2A59FC84C4EFAL, 0x247D2B1E489F5F5AL, 0xDB64D718AB474C48L, + 0x79F4A7A1F2270A40L, 0x1573DA832A9BEBAEL, 0x3497867968621C72L, 0x514838D2A2302304L, + 0xF0AF6537FD72F685L, 0x1D06023E3A6B44BAL, 0x678588C3CE6EDD73L, 0x66A893F7CC70ACFFL, + 0xD4D24E29B5EDA9DFL, 0x3856321470EA6A6CL, 0x07C3418C0E5A4A83L, 0x2BCBB22F5635BACDL, + 0x04B46CD00878D90AL, 0x06EE5AB80C443B0FL, 0x3B211F4876C8F9E5L, 0x0958C38912EEDE98L, + 0xD14B39CDBF8B0159L, 0x397B292072F41BE0L, 0x87C0409313E168DEL, 0xAD26E98847CAA39FL, + 0x4E140C849C6785BBL, 0xD5FF551DB7F3D853L, 0xA0CA46D15D5CA40DL, 0xCD6020C787FE346FL, + 0x84B76DCF15C3FB57L, 0xDEFDA0FCA121E4CEL, 0x4B8D7B6096012D3DL, 0x9AC642AD298A2C64L, + 0x0875D8BD10F0AF14L, 0xB357C6EA7B8374ACL, 0x4D6321D89A451632L, 0xEDA96709C719B23FL, + 0xF76C24BBF328BC06L, 0xC662D526912C08F2L, 0x3CE25EC47892B366L, 0xB978283F6F4F39BDL, + 0xC08C8F9E9D6833FDL, 0x4F3917B09E79F437L, 0x593DE06FB2C08C10L, 0xD6887841B1D14BDAL, + 0x19B26EEE32139DB0L, 0xB494876675D93E2FL, 0x825937771987C058L, 0x90E9AC783D466175L, + 0xF1827E03FF6C8709L, 0x945DC0A8353EB87FL, 0x4516F9658AB5B926L, 0x3F9573987EB020EFL, + 0xB855330B6D514831L, 0x2AE6A91B542BCB41L, 0x6331E413C6160479L, 0x408F8E8180D311A0L, + 0xEFF35161C325503AL, 0xD06622F9BD9570D5L, 0x8876D9A20D4B8D49L, 0xA5533135573A0C8BL, + 0xE168D364DF91C421L, 0xF41B09E7F50A2F8FL, 0x12B09B0F24C1A12DL, 0xDA49CC2CA9593DC4L, + 0x1F5C34563E57A6BFL, 0x54D14F36A8568B82L, 0xAF7CDFE043F6419AL, 0xEA6A2685C943F8BCL, + 0xE5DCBFB4D7E91D2BL, 0xB27ADDDE799D0520L, 0x6B443CAED6E6AB6DL, 0x7BAE91C9F61BE845L, + 0x3EB868AC7CAE5163L, 0x11C7B65322E332A4L, 0xD23C1491B9A992D0L, 0x8FB5982E0311C7CAL, + 0x70AC6428E0C9D4D8L, 0x895BC2960F55FCC5L, 0x76423E90EC8DEFD7L, 0x6FF0507EDE9E7267L, + 0x3DCF45F07A8CC2EAL, 0x4AA06054941F5CB1L, 0x5810FB5BB0DEFD9CL, 0x5EFEA1E3BC9AC693L, + 0x6EDD4B4ADC8003EBL, 0x741808F8E8B10DD2L, 0x145EC1B728859A22L, 0x28BC9F7350172944L, + 0x270A06424EBDCCD3L, 0x972AEDF4331C2BF6L, 0x059977E40A66A886L, 0x2550302A4A812ED6L, + 0xDD8A8DA0A7037747L, 0xC515F87A970E9B7BL, 0x3023EAA9601AC578L, 0xB7E3AA3A73FBADA6L, + 0x0FB699311EAAE597L, 0x0000000000000000L, 0x310EF19D6204B4F4L, 0x229371A644DB6455L, + 0x0DECAF591A960792L, 0x5CA4978BB8A62496L, 0x1C2B190A38753536L, 0x41A295B582CD602CL, + 0x3279DCC16426277DL, 0xC1A194AA9F764271L, 0x139D803B26DFD0A1L, 0xAE51C4D441E83016L, + 0xD813FA44AD65DFC1L, 0xAC0BF2BC45D4D213L, 0x23BE6A9246C515D9L, 0x49D74D08923DCF38L, + 0x9D05032127D066E7L, 0x2F7FDEFF5E4D63C7L, 0xA47E2A0155247D07L, 0x99B16FF12FA8BFEDL, + 0x4661D4398C972AAFL, 0xDFD0BBC8A33F9542L, 0xDCA79694A51D06CBL, 0xB020EBB67DA1E725L, + 0xBA0F0563696DAA34L, 0xE4F1A480D5F76CA7L, 0xC438E34E9510EAF7L, 0x939E81243B64F2FCL, + 0x8DEFAE46072D25CFL, 0x2C08F3A3586FF04EL, 0xD7A56375B3CF3A56L, 0x20C947CE40E78650L, + 0x43F8A3DD86F18229L, 0x568B795EAC6A6987L, 0x8003011F1DBB225DL, 0xF53612D3F7145E03L, + 0x189F75DA300DEC3CL, 0x9570DB9C3720C9F3L, 0xBB221E576B73DBB8L, 0x72F65240E4F536DDL, + 0x443BE25188ABC8AAL, 0xE21FFE38D9B357A8L, 0xFD43CA6EE7E4F117L, 0xCAA3614B89A47EECL, + 0xFE34E732E1C6629EL, 0x83742C431B99B1D4L, 0xCF3A16AF83C2D66AL, 0xAAE5A8044990E91CL, + 0x26271D764CA3BD5FL, 0x91C4B74C3F5810F9L, 0x7C6DD045F841A2C6L, 0x7F1AFD19FE63314FL, + 0xC8F957238D989CE9L, 0xA709075D5306EE8EL, 0x55FC5402AA48FA0EL, 0x48FA563C9023BEB4L, + 0x65DFBEABCA523F76L, 0x6C877D22D8BCE1EEL, 0xCC4D3BF385E045E3L, 0xBEBB69B36115733EL, + 0x10EAAD6720FD4328L, 0xB6CEB10E71E5DC2AL, 0xBDCC44EF6737E0B7L, 0x523F158EA412B08DL, + 0x989C74C52DB6CE61L, 0x9BEB59992B945DE8L, 0x8A2CEFCA09776F4CL, 0xA3BD6B8D5B7E3784L, + 0xEB473DB1CB5D8930L, 0xC3FBA2C29B4AA074L, 0x9C28181525CE176BL, 0x683311F2D0C438E4L, + 0x5FD3BAD7BE84B71FL, 0xFC6ED15AE5FA809BL, 0x36CDB0116C5EFE77L, 0x29918447520958C8L, + 0xA29070B959604608L, 0x53120EBAA60CC101L, 0x3A0C047C74D68869L, 0x691E0AC6D2DA4968L, + 0x73DB4974E6EB4751L, 0x7A838AFDF40599C9L, 0x5A4ACD33B4E21F99L, 0x6046C94FC03497F0L, + 0xE6AB92E8D1CB8EA2L, 0x3354C7F5663856F1L, 0xD93EE170AF7BAE4DL, 0x616BD27BC22AE67CL, + 0x92B39A10397A8370L, 0xABC8B3304B8E9890L, 0xBF967287630B02B2L, 0x5B67D607B6FC6E15L + }, + new ulong[] { + 0xD031C397CE553FE6L, 0x16BA5B01B006B525L, 0xA89BADE6296E70C8L, 0x6A1F525D77D3435BL, + 0x6E103570573DFA0BL, 0x660EFB2A17FC95ABL, 0x76327A9E97634BF6L, 0x4BAD9D6462458BF5L, + 0xF1830CAEDBC3F748L, 0xC5C8F542669131FFL, 0x95044A1CDC48B0CBL, 0x892962DF3CF8B866L, + 0xB0B9E208E930C135L, 0xA14FB3F0611A767CL, 0x8D2605F21C160136L, 0xD6B71922FECC549EL, + 0x37089438A5907D8BL, 0x0B5DA38E5803D49CL, 0x5A5BCC9CEA6F3CBCL, 0xEDAE246D3B73FFE5L, + 0xD2B87E0FDE22EDCEL, 0x5E54ABB1CA8185ECL, 0x1DE7F88FE80561B9L, 0xAD5E1A870135A08CL, + 0x2F2ADBD665CECC76L, 0x5780B5A782F58358L, 0x3EDC8A2EEDE47B3FL, 0xC9D95C3506BEE70FL, + 0x83BE111D6C4E05EEL, 0xA603B90959367410L, 0x103C81B4809FDE5DL, 0x2C69B6027D0C774AL, + 0x399080D7D5C87953L, 0x09D41E16487406B4L, 0xCDD63B1826505E5FL, 0xF99DC2F49B0298E8L, + 0x9CD0540A943CB67FL, 0xBCA84B7F891F17C5L, 0x723D1DB3B78DF2A6L, 0x78AA6E71E73B4F2EL, + 0x1433E699A071670DL, 0x84F21BE454620782L, 0x98DF3327B4D20F2FL, 0xF049DCE2D3769E5CL, + 0xDB6C60199656EB7AL, 0x648746B2078B4783L, 0x32CD23598DCBADCFL, 0x1EA4955BF0C7DA85L, + 0xE9A143401B9D46B5L, 0xFD92A5D9BBEC21B8L, 0xC8138C790E0B8E1BL, 0x2EE00B9A6D7BA562L, + 0xF85712B893B7F1FCL, 0xEB28FED80BEA949DL, 0x564A65EB8A40EA4CL, 0x6C9988E8474A2823L, + 0x4535898B121D8F2DL, 0xABD8C03231ACCBF4L, 0xBA2E91CAB9867CBDL, 0x7960BE3DEF8E263AL, + 0x0C11A977602FD6F0L, 0xCB50E1AD16C93527L, 0xEAE22E94035FFD89L, 0x2866D12F5DE2CE1AL, + 0xFF1B1841AB9BF390L, 0x9F9339DE8CFE0D43L, 0x964727C8C48A0BF7L, 0x524502C6AAAE531CL, + 0x9B9C5EF3AC10B413L, 0x4FA2FA4942AB32A5L, 0x3F165A62E551122BL, 0xC74148DA76E6E3D7L, + 0x924840E5E464B2A7L, 0xD372AE43D69784DAL, 0x233B72A105E11A86L, 0xA48A04914941A638L, + 0xB4B68525C9DE7865L, 0xDDEABAACA6CF8002L, 0x0A9773C250B6BD88L, 0xC284FFBB5EBD3393L, + 0x8BA0DF472C8F6A4EL, 0x2AEF6CB74D951C32L, 0x427983722A318D41L, 0x73F7CDFFBF389BB2L, + 0x074C0AF9382C026CL, 0x8A6A0F0B243A035AL, 0x6FDAE53C5F88931FL, 0xC68B98967E538AC3L, + 0x44FF59C71AA8E639L, 0xE2FCE0CE439E9229L, 0xA20CDE2479D8CD40L, 0x19E89FA2C8EBD8E9L, + 0xF446BBCFF398270CL, 0x43B3533E2284E455L, 0xD82F0DCD8E945046L, 0x51066F12B26CE820L, + 0xE73957AF6BC5426DL, 0x081ECE5A40C16FA0L, 0x3B193D4FC5BFAB7BL, 0x7FE66488DF174D42L, + 0x0E9814EF705804D8L, 0x8137AC857C39D7C6L, 0xB1733244E185A821L, 0x695C3F896F11F867L, + 0xF6CF0657E3EFF524L, 0x1AABF276D02963D5L, 0x2DA3664E75B91E5EL, 0x0289BD981077D228L, + 0x90C1FD7DF413608FL, 0x3C5537B6FD93A917L, 0xAA12107E3919A2E0L, 0x0686DAB530996B78L, + 0xDAA6B0559EE3826EL, 0xC34E2FF756085A87L, 0x6D5358A44FFF4137L, 0xFC587595B35948ACL, + 0x7CA5095CC7D5F67EL, 0xFB147F6C8B754AC0L, 0xBFEB26AB91DDACF9L, 0x6896EFC567A49173L, + 0xCA9A31E11E7C5C33L, 0xBBE44186B13315A9L, 0x0DDB793B689ABFE4L, 0x70B4A02BA7FA208EL, + 0xE47A3A7B7307F951L, 0x8CECD5BE14A36822L, 0xEEED49B923B144D9L, 0x17708B4DB8B3DC31L, + 0x6088219F2765FED3L, 0xB3FA8FDCF1F27A09L, 0x910B2D31FCA6099BL, 0x0F52C4A378ED6DCCL, + 0x50CCBF5EBAD98134L, 0x6BD582117F662A4FL, 0x94CE9A50D4FDD9DFL, 0x2B25BCFB45207526L, + 0x67C42B661F49FCBFL, 0x492420FC723259DDL, 0x03436DD418C2BB3CL, 0x1F6E4517F872B391L, + 0xA08563BC69AF1F68L, 0xD43EA4BAEEBB86B6L, 0x01CAD04C08B56914L, 0xAC94CACB0980C998L, + 0x54C3D8739A373864L, 0x26FEC5C02DBACAC2L, 0xDEA9D778BE0D3B3EL, 0x040F672D20EEB950L, + 0xE5B0EA377BB29045L, 0xF30AB136CBB42560L, 0x62019C0737122CFBL, 0xE86B930C13282FA1L, + 0xCC1CEB542EE5374BL, 0x538FD28AA21B3A08L, 0x1B61223AD89C0AC1L, 0x36C24474AD25149FL, + 0x7A23D3E9F74C9D06L, 0xBE21F6E79968C5EDL, 0xCF5F868036278C77L, 0xF705D61BEB5A9C30L, + 0x4D2B47D152DCE08DL, 0x5F9E7BFDC234ECF8L, 0x247778583DCD18EAL, 0x867BA67C4415D5AAL, + 0x4CE1979D5A698999L, 0x0000000000000000L, 0xEC64F42133C696F1L, 0xB57C5569C16B1171L, + 0xC1C7926F467F88AFL, 0x654D96FE0F3E2E97L, 0x15F936D5A8C40E19L, 0xB8A72C52A9F1AE95L, + 0xA9517DAA21DB19DCL, 0x58D27104FA18EE94L, 0x5918A148F2AD8780L, 0x5CDD1629DAF657C4L, + 0x8274C15164FB6CFAL, 0xD1FB13DBC6E056F2L, 0x7D6FD910CF609F6AL, 0xB63F38BDD9A9AA4DL, + 0x3D9FE7FAF526C003L, 0x74BBC706871499DEL, 0xDF630734B6B8522AL, 0x3AD3ED03CD0AC26FL, + 0xFADEAF2083C023D4L, 0xC00D42234ECAE1BBL, 0x8538CBA85CD76E96L, 0xC402250E6E2458EBL, + 0x47BC3413026A5D05L, 0xAFD7A71F114272A4L, 0x978DF784CC3F62E3L, 0xB96DFC1EA144C781L, + 0x21B2CF391596C8AEL, 0x318E4E8D950916F3L, 0xCE9556CC3E92E563L, 0x385A509BDD7D1047L, + 0x358129A0B5E7AFA3L, 0xE6F387E363702B79L, 0xE0755D5653E94001L, 0x7BE903A5FFF9F412L, + 0x12B53C2C90E80C75L, 0x3307F315857EC4DBL, 0x8FAFB86A0C61D31EL, 0xD9E5DD8186213952L, + 0x77F8AAD29FD622E2L, 0x25BDA814357871FEL, 0x7571174A8FA1F0CAL, 0x137FEC60985D6561L, + 0x30449EC19DBC7FE7L, 0xA540D4DD41F4CF2CL, 0xDC206AE0AE7AE916L, 0x5B911CD0E2DA55A8L, + 0xB2305F90F947131DL, 0x344BF9ECBD52C6B7L, 0x5D17C665D2433ED0L, 0x18224FEEC05EB1FDL, + 0x9E59E992844B6457L, 0x9A568EBFA4A5DD07L, 0xA3C60E68716DA454L, 0x7E2CB4C4D7A22456L, + 0x87B176304CA0BCBEL, 0x413AEEA632F3367DL, 0x9915E36BBC67663BL, 0x40F03EEA3A465F69L, + 0x1C2D28C3E0B008ADL, 0x4E682A054A1E5BB1L, 0x05C5B761285BD044L, 0xE1BF8D1A5B5C2915L, + 0xF2C0617AC3014C74L, 0xB7F5E8F1D11CC359L, 0x63CB4C4B3FA745EFL, 0x9D1A84469C89DF6BL, + 0xE33630824B2BFB3DL, 0xD5F474F6E60EEFA2L, 0xF58C6B83FB2D4E18L, 0x4676E45F0ADF3411L, + 0x20781F751D23A1BAL, 0xBD629B3381AA7ED1L, 0xAE1D775319F71BB0L, 0xFED1C80DA32E9A84L, + 0x5509083F92825170L, 0x29AC01635557A70EL, 0xA7C9694551831D04L, 0x8E65682604D4BA0AL, + 0x11F651F8882AB749L, 0xD77DC96EF6793D8AL, 0xEF2799F52B042DCDL, 0x48EEF0B07A8730C9L, + 0x22F1A2ED0D547392L, 0x6142F1D32FD097C7L, 0x4A674D286AF0E2E1L, 0x80FD7CC9748CBED2L, + 0x717E7067AF4F499AL, 0x938290A9ECD1DBB3L, 0x88E3B293344DD172L, 0x2734158C250FA3D6L + } + }; + + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012Digest.cs.meta new file mode 100644 index 00000000..1813c201 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f546987568a9514fb04c9befbf82d04 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_256Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_256Digest.cs new file mode 100644 index 00000000..9b5747f4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_256Digest.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + public class GOST3411_2012_256Digest : GOST3411_2012Digest + { + private readonly static byte[] IV = { + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 + }; + + public override string AlgorithmName + { + get { return "GOST3411-2012-256"; } + } + + public GOST3411_2012_256Digest() : base(IV) + { + + } + + public GOST3411_2012_256Digest(GOST3411_2012_256Digest other) : base(IV) + { + Reset(other); + } + + public override int GetDigestSize() + { + return 32; + } + + public override int DoFinal(byte[] output, int outOff) + { + byte[] result = new byte[64]; + base.DoFinal(result, 0); + + Array.Copy(result, 32, output, outOff, 32); + + return 32; + } + + public override IMemoable Copy() + { + return new GOST3411_2012_256Digest(this); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_256Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_256Digest.cs.meta new file mode 100644 index 00000000..46847c0c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_256Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 08510068b679edc44943819ee016267d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_512Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_512Digest.cs new file mode 100644 index 00000000..7e990774 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_512Digest.cs @@ -0,0 +1,47 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + public class GOST3411_2012_512Digest:GOST3411_2012Digest + { + private readonly static byte[] IV = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + public override string AlgorithmName + { + get { return "GOST3411-2012-512"; } + } + + public GOST3411_2012_512Digest():base(IV) + { + } + + public GOST3411_2012_512Digest(GOST3411_2012_512Digest other) : base(IV) + { + Reset(other); + } + + public override int GetDigestSize() + { + return 64; + } + + public override IMemoable Copy() + { + return new GOST3411_2012_512Digest(this); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_512Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_512Digest.cs.meta new file mode 100644 index 00000000..0daaa120 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GOST3411_2012_512Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 172c217a7fbd94c47b30653edce69b2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GeneralDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GeneralDigest.cs new file mode 100644 index 00000000..4f644b77 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GeneralDigest.cs @@ -0,0 +1,137 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * base implementation of MD4 family style digest as outlined in + * "Handbook of Applied Cryptography", pages 344 - 347. + */ + public abstract class GeneralDigest + : IDigest, IMemoable + { + private const int BYTE_LENGTH = 64; + + private byte[] xBuf; + private int xBufOff; + + private long byteCount; + + internal GeneralDigest() + { + xBuf = new byte[4]; + } + + internal GeneralDigest(GeneralDigest t) + { + xBuf = new byte[t.xBuf.Length]; + CopyIn(t); + } + + protected void CopyIn(GeneralDigest t) + { + Array.Copy(t.xBuf, 0, xBuf, 0, t.xBuf.Length); + + xBufOff = t.xBufOff; + byteCount = t.byteCount; + } + + public void Update(byte input) + { + xBuf[xBufOff++] = input; + + if (xBufOff == xBuf.Length) + { + ProcessWord(xBuf, 0); + xBufOff = 0; + } + + byteCount++; + } + + public void BlockUpdate( + byte[] input, + int inOff, + int length) + { + length = System.Math.Max(0, length); + + // + // fill the current word + // + int i = 0; + if (xBufOff != 0) + { + while (i < length) + { + xBuf[xBufOff++] = input[inOff + i++]; + if (xBufOff == 4) + { + ProcessWord(xBuf, 0); + xBufOff = 0; + break; + } + } + } + + // + // process whole words. + // + int limit = ((length - i) & ~3) + i; + for (; i < limit; i += 4) + { + ProcessWord(input, inOff + i); + } + + // + // load in the remainder. + // + while (i < length) + { + xBuf[xBufOff++] = input[inOff + i++]; + } + + byteCount += length; + } + + public void Finish() + { + long bitLength = (byteCount << 3); + + // + // add the pad bytes. + // + Update((byte)128); + + while (xBufOff != 0) Update((byte)0); + ProcessLength(bitLength); + ProcessBlock(); + } + + public virtual void Reset() + { + byteCount = 0; + xBufOff = 0; + Array.Clear(xBuf, 0, xBuf.Length); + } + + public int GetByteLength() + { + return BYTE_LENGTH; + } + + internal abstract void ProcessWord(byte[] input, int inOff); + internal abstract void ProcessLength(long bitLength); + internal abstract void ProcessBlock(); + public abstract string AlgorithmName { get; } + public abstract int GetDigestSize(); + public abstract int DoFinal(byte[] output, int outOff); + public abstract IMemoable Copy(); + public abstract void Reset(IMemoable t); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GeneralDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GeneralDigest.cs.meta new file mode 100644 index 00000000..69d34ad6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/GeneralDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 86264b6205260ac4f9c649821fb106eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/KeccakDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/KeccakDigest.cs new file mode 100644 index 00000000..94ff8e0b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/KeccakDigest.cs @@ -0,0 +1,409 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + ///

+ /// Implementation of Keccak based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ + /// + /// + /// Following the naming conventions used in the C source code to enable easy review of the implementation. + /// + public class KeccakDigest + : IDigest, IMemoable + { + private static readonly ulong[] KeccakRoundConstants = new ulong[]{ + 0x0000000000000001UL, 0x0000000000008082UL, 0x800000000000808aUL, 0x8000000080008000UL, + 0x000000000000808bUL, 0x0000000080000001UL, 0x8000000080008081UL, 0x8000000000008009UL, + 0x000000000000008aUL, 0x0000000000000088UL, 0x0000000080008009UL, 0x000000008000000aUL, + 0x000000008000808bUL, 0x800000000000008bUL, 0x8000000000008089UL, 0x8000000000008003UL, + 0x8000000000008002UL, 0x8000000000000080UL, 0x000000000000800aUL, 0x800000008000000aUL, + 0x8000000080008081UL, 0x8000000000008080UL, 0x0000000080000001UL, 0x8000000080008008UL + }; + + private ulong[] state = new ulong[25]; + protected byte[] dataQueue = new byte[192]; + protected int rate; + protected int bitsInQueue; + protected int fixedOutputLength; + protected bool squeezing; + + public KeccakDigest() + : this(288) + { + } + + public KeccakDigest(int bitLength) + { + Init(bitLength); + } + + public KeccakDigest(KeccakDigest source) + { + CopyIn(source); + } + + private void CopyIn(KeccakDigest source) + { + Array.Copy(source.state, 0, this.state, 0, source.state.Length); + Array.Copy(source.dataQueue, 0, this.dataQueue, 0, source.dataQueue.Length); + this.rate = source.rate; + this.bitsInQueue = source.bitsInQueue; + this.fixedOutputLength = source.fixedOutputLength; + this.squeezing = source.squeezing; + } + + public virtual string AlgorithmName + { + get { return "Keccak-" + fixedOutputLength; } + } + + public virtual int GetDigestSize() + { + return fixedOutputLength >> 3; + } + + public virtual void Update(byte input) + { + Absorb(new byte[]{ input }, 0, 1); + } + + public virtual void BlockUpdate(byte[] input, int inOff, int len) + { + Absorb(input, inOff, len); + } + + public virtual int DoFinal(byte[] output, int outOff) + { + Squeeze(output, outOff, fixedOutputLength); + + Reset(); + + return GetDigestSize(); + } + + /* + * TODO Possible API change to support partial-byte suffixes. + */ + protected virtual int DoFinal(byte[] output, int outOff, byte partialByte, int partialBits) + { + if (partialBits > 0) + { + AbsorbBits(partialByte, partialBits); + } + + Squeeze(output, outOff, fixedOutputLength); + + Reset(); + + return GetDigestSize(); + } + + public virtual void Reset() + { + Init(fixedOutputLength); + } + + /** + * Return the size of block that the compression function is applied to in bytes. + * + * @return internal byte length of a block. + */ + public virtual int GetByteLength() + { + return rate >> 3; + } + + private void Init(int bitLength) + { + switch (bitLength) + { + case 128: + case 224: + case 256: + case 288: + case 384: + case 512: + InitSponge(1600 - (bitLength << 1)); + break; + default: + throw new ArgumentException("must be one of 128, 224, 256, 288, 384, or 512.", "bitLength"); + } + } + + private void InitSponge(int rate) + { + if (rate <= 0 || rate >= 1600 || (rate & 63) != 0) + throw new InvalidOperationException("invalid rate value"); + + this.rate = rate; + Array.Clear(state, 0, state.Length); + Arrays.Fill(this.dataQueue, (byte)0); + this.bitsInQueue = 0; + this.squeezing = false; + this.fixedOutputLength = (1600 - rate) >> 1; + } + + protected void Absorb(byte[] data, int off, int len) + { + if ((bitsInQueue & 7) != 0) + throw new InvalidOperationException("attempt to absorb with odd length queue"); + if (squeezing) + throw new InvalidOperationException("attempt to absorb while squeezing"); + + int bytesInQueue = bitsInQueue >> 3; + int rateBytes = rate >> 3; + + int count = 0; + while (count < len) + { + if (bytesInQueue == 0 && count <= (len - rateBytes)) + { + do + { + KeccakAbsorb(data, off + count); + count += rateBytes; + } + while (count <= (len - rateBytes)); + } + else + { + int partialBlock = System.Math.Min(rateBytes - bytesInQueue, len - count); + Array.Copy(data, off + count, dataQueue, bytesInQueue, partialBlock); + + bytesInQueue += partialBlock; + count += partialBlock; + + if (bytesInQueue == rateBytes) + { + KeccakAbsorb(dataQueue, 0); + bytesInQueue = 0; + } + } + } + + bitsInQueue = bytesInQueue << 3; + } + + protected void AbsorbBits(int data, int bits) + { + if (bits < 1 || bits > 7) + throw new ArgumentException("must be in the range 1 to 7", "bits"); + if ((bitsInQueue & 7) != 0) + throw new InvalidOperationException("attempt to absorb with odd length queue"); + if (squeezing) + throw new InvalidOperationException("attempt to absorb while squeezing"); + + int mask = (1 << bits) - 1; + dataQueue[bitsInQueue >> 3] = (byte)(data & mask); + + // NOTE: After this, bitsInQueue is no longer a multiple of 8, so no more absorbs will work + bitsInQueue += bits; + } + + private void PadAndSwitchToSqueezingPhase() + { + Debug.Assert(bitsInQueue < rate); + + dataQueue[bitsInQueue >> 3] |= (byte)(1U << (bitsInQueue & 7)); + + if (++bitsInQueue == rate) + { + KeccakAbsorb(dataQueue, 0); + bitsInQueue = 0; + } + + { + int full = bitsInQueue >> 6, partial = bitsInQueue & 63; + int off = 0; + for (int i = 0; i < full; ++i) + { + state[i] ^= Pack.LE_To_UInt64(dataQueue, off); + off += 8; + } + if (partial > 0) + { + ulong mask = (1UL << partial) - 1UL; + state[full] ^= Pack.LE_To_UInt64(dataQueue, off) & mask; + } + state[(rate - 1) >> 6] ^= (1UL << 63); + } + + KeccakPermutation(); + + KeccakExtract(); + bitsInQueue = rate; + + squeezing = true; + } + + protected void Squeeze(byte[] output, int offset, long outputLength) + { + if (!squeezing) + { + PadAndSwitchToSqueezingPhase(); + } + if ((outputLength & 7L) != 0L) + throw new InvalidOperationException("outputLength not a multiple of 8"); + + long i = 0; + while (i < outputLength) + { + if (bitsInQueue == 0) + { + KeccakPermutation(); + KeccakExtract(); + bitsInQueue = rate; + } + int partialBlock = (int)System.Math.Min((long)bitsInQueue, outputLength - i); + Array.Copy(dataQueue, (rate - bitsInQueue) >> 3, output, offset + (int)(i >> 3), partialBlock >> 3); + bitsInQueue -= partialBlock; + i += partialBlock; + } + } + + private void KeccakAbsorb(byte[] data, int off) + { + int count = rate >> 6; + for (int i = 0; i < count; ++i) + { + state[i] ^= Pack.LE_To_UInt64(data, off); + off += 8; + } + + KeccakPermutation(); + } + + private void KeccakExtract() + { + Pack.UInt64_To_LE(state, 0, rate >> 6, dataQueue, 0); + } + + private void KeccakPermutation() + { + ulong[] A = state; + + ulong a00 = A[ 0], a01 = A[ 1], a02 = A[ 2], a03 = A[ 3], a04 = A[ 4]; + ulong a05 = A[ 5], a06 = A[ 6], a07 = A[ 7], a08 = A[ 8], a09 = A[ 9]; + ulong a10 = A[10], a11 = A[11], a12 = A[12], a13 = A[13], a14 = A[14]; + ulong a15 = A[15], a16 = A[16], a17 = A[17], a18 = A[18], a19 = A[19]; + ulong a20 = A[20], a21 = A[21], a22 = A[22], a23 = A[23], a24 = A[24]; + + for (int i = 0; i < 24; i++) + { + // theta + ulong c0 = a00 ^ a05 ^ a10 ^ a15 ^ a20; + ulong c1 = a01 ^ a06 ^ a11 ^ a16 ^ a21; + ulong c2 = a02 ^ a07 ^ a12 ^ a17 ^ a22; + ulong c3 = a03 ^ a08 ^ a13 ^ a18 ^ a23; + ulong c4 = a04 ^ a09 ^ a14 ^ a19 ^ a24; + + ulong d1 = (c1 << 1 | c1 >> -1) ^ c4; + ulong d2 = (c2 << 1 | c2 >> -1) ^ c0; + ulong d3 = (c3 << 1 | c3 >> -1) ^ c1; + ulong d4 = (c4 << 1 | c4 >> -1) ^ c2; + ulong d0 = (c0 << 1 | c0 >> -1) ^ c3; + + a00 ^= d1; a05 ^= d1; a10 ^= d1; a15 ^= d1; a20 ^= d1; + a01 ^= d2; a06 ^= d2; a11 ^= d2; a16 ^= d2; a21 ^= d2; + a02 ^= d3; a07 ^= d3; a12 ^= d3; a17 ^= d3; a22 ^= d3; + a03 ^= d4; a08 ^= d4; a13 ^= d4; a18 ^= d4; a23 ^= d4; + a04 ^= d0; a09 ^= d0; a14 ^= d0; a19 ^= d0; a24 ^= d0; + + // rho/pi + c1 = a01 << 1 | a01 >> 63; + a01 = a06 << 44 | a06 >> 20; + a06 = a09 << 20 | a09 >> 44; + a09 = a22 << 61 | a22 >> 3; + a22 = a14 << 39 | a14 >> 25; + a14 = a20 << 18 | a20 >> 46; + a20 = a02 << 62 | a02 >> 2; + a02 = a12 << 43 | a12 >> 21; + a12 = a13 << 25 | a13 >> 39; + a13 = a19 << 8 | a19 >> 56; + a19 = a23 << 56 | a23 >> 8; + a23 = a15 << 41 | a15 >> 23; + a15 = a04 << 27 | a04 >> 37; + a04 = a24 << 14 | a24 >> 50; + a24 = a21 << 2 | a21 >> 62; + a21 = a08 << 55 | a08 >> 9; + a08 = a16 << 45 | a16 >> 19; + a16 = a05 << 36 | a05 >> 28; + a05 = a03 << 28 | a03 >> 36; + a03 = a18 << 21 | a18 >> 43; + a18 = a17 << 15 | a17 >> 49; + a17 = a11 << 10 | a11 >> 54; + a11 = a07 << 6 | a07 >> 58; + a07 = a10 << 3 | a10 >> 61; + a10 = c1; + + // chi + c0 = a00 ^ (~a01 & a02); + c1 = a01 ^ (~a02 & a03); + a02 ^= ~a03 & a04; + a03 ^= ~a04 & a00; + a04 ^= ~a00 & a01; + a00 = c0; + a01 = c1; + + c0 = a05 ^ (~a06 & a07); + c1 = a06 ^ (~a07 & a08); + a07 ^= ~a08 & a09; + a08 ^= ~a09 & a05; + a09 ^= ~a05 & a06; + a05 = c0; + a06 = c1; + + c0 = a10 ^ (~a11 & a12); + c1 = a11 ^ (~a12 & a13); + a12 ^= ~a13 & a14; + a13 ^= ~a14 & a10; + a14 ^= ~a10 & a11; + a10 = c0; + a11 = c1; + + c0 = a15 ^ (~a16 & a17); + c1 = a16 ^ (~a17 & a18); + a17 ^= ~a18 & a19; + a18 ^= ~a19 & a15; + a19 ^= ~a15 & a16; + a15 = c0; + a16 = c1; + + c0 = a20 ^ (~a21 & a22); + c1 = a21 ^ (~a22 & a23); + a22 ^= ~a23 & a24; + a23 ^= ~a24 & a20; + a24 ^= ~a20 & a21; + a20 = c0; + a21 = c1; + + // iota + a00 ^= KeccakRoundConstants[i]; + } + + A[ 0] = a00; A[ 1] = a01; A[ 2] = a02; A[ 3] = a03; A[ 4] = a04; + A[ 5] = a05; A[ 6] = a06; A[ 7] = a07; A[ 8] = a08; A[ 9] = a09; + A[10] = a10; A[11] = a11; A[12] = a12; A[13] = a13; A[14] = a14; + A[15] = a15; A[16] = a16; A[17] = a17; A[18] = a18; A[19] = a19; + A[20] = a20; A[21] = a21; A[22] = a22; A[23] = a23; A[24] = a24; + } + + public virtual IMemoable Copy() + { + return new KeccakDigest(this); + } + + public virtual void Reset(IMemoable other) + { + CopyIn((KeccakDigest)other); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/KeccakDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/KeccakDigest.cs.meta new file mode 100644 index 00000000..442bab93 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/KeccakDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ec6fde84d97edb44288b899e7b6b5d8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/LongDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/LongDigest.cs new file mode 100644 index 00000000..a66d61b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/LongDigest.cs @@ -0,0 +1,359 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * Base class for SHA-384 and SHA-512. + */ + public abstract class LongDigest + : IDigest, IMemoable + { + private int MyByteLength = 128; + + private byte[] xBuf; + private int xBufOff; + + private long byteCount1; + private long byteCount2; + + internal ulong H1, H2, H3, H4, H5, H6, H7, H8; + + private ulong[] W = new ulong[80]; + private int wOff; + + /** + * Constructor for variable length word + */ + internal LongDigest() + { + xBuf = new byte[8]; + + Reset(); + } + + /** + * Copy constructor. We are using copy constructors in place + * of the object.Clone() interface as this interface is not + * supported by J2ME. + */ + internal LongDigest( + LongDigest t) + { + xBuf = new byte[t.xBuf.Length]; + + CopyIn(t); + } + + protected void CopyIn(LongDigest t) + { + Array.Copy(t.xBuf, 0, xBuf, 0, t.xBuf.Length); + + xBufOff = t.xBufOff; + byteCount1 = t.byteCount1; + byteCount2 = t.byteCount2; + + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + H4 = t.H4; + H5 = t.H5; + H6 = t.H6; + H7 = t.H7; + H8 = t.H8; + + Array.Copy(t.W, 0, W, 0, t.W.Length); + wOff = t.wOff; + } + + public void Update( + byte input) + { + xBuf[xBufOff++] = input; + + if (xBufOff == xBuf.Length) + { + ProcessWord(xBuf, 0); + xBufOff = 0; + } + + byteCount1++; + } + + public void BlockUpdate( + byte[] input, + int inOff, + int length) + { + // + // fill the current word + // + while ((xBufOff != 0) && (length > 0)) + { + Update(input[inOff]); + + inOff++; + length--; + } + + // + // process whole words. + // + while (length > xBuf.Length) + { + ProcessWord(input, inOff); + + inOff += xBuf.Length; + length -= xBuf.Length; + byteCount1 += xBuf.Length; + } + + // + // load in the remainder. + // + while (length > 0) + { + Update(input[inOff]); + + inOff++; + length--; + } + } + + public void Finish() + { + AdjustByteCounts(); + + long lowBitLength = byteCount1 << 3; + long hiBitLength = byteCount2; + + // + // add the pad bytes. + // + Update((byte)128); + + while (xBufOff != 0) + { + Update((byte)0); + } + + ProcessLength(lowBitLength, hiBitLength); + + ProcessBlock(); + } + + public virtual void Reset() + { + byteCount1 = 0; + byteCount2 = 0; + + xBufOff = 0; + for ( int i = 0; i < xBuf.Length; i++ ) + { + xBuf[i] = 0; + } + + wOff = 0; + Array.Clear(W, 0, W.Length); + } + + internal void ProcessWord( + byte[] input, + int inOff) + { + W[wOff] = Pack.BE_To_UInt64(input, inOff); + + if (++wOff == 16) + { + ProcessBlock(); + } + } + + /** + * adjust the byte counts so that byteCount2 represents the + * upper long (less 3 bits) word of the byte count. + */ + private void AdjustByteCounts() + { + if (byteCount1 > 0x1fffffffffffffffL) + { + byteCount2 += (long) ((ulong) byteCount1 >> 61); + byteCount1 &= 0x1fffffffffffffffL; + } + } + + internal void ProcessLength( + long lowW, + long hiW) + { + if (wOff > 14) + { + ProcessBlock(); + } + + W[14] = (ulong)hiW; + W[15] = (ulong)lowW; + } + + internal void ProcessBlock() + { + AdjustByteCounts(); + + // + // expand 16 word block into 80 word blocks. + // + for (int ti = 16; ti <= 79; ++ti) + { + W[ti] = Sigma1(W[ti - 2]) + W[ti - 7] + Sigma0(W[ti - 15]) + W[ti - 16]; + } + + // + // set up working variables. + // + ulong a = H1; + ulong b = H2; + ulong c = H3; + ulong d = H4; + ulong e = H5; + ulong f = H6; + ulong g = H7; + ulong h = H8; + + int t = 0; + for(int i = 0; i < 10; i ++) + { + // t = 8 * i + h += Sum1(e) + Ch(e, f, g) + K[t] + W[t++]; + d += h; + h += Sum0(a) + Maj(a, b, c); + + // t = 8 * i + 1 + g += Sum1(d) + Ch(d, e, f) + K[t] + W[t++]; + c += g; + g += Sum0(h) + Maj(h, a, b); + + // t = 8 * i + 2 + f += Sum1(c) + Ch(c, d, e) + K[t] + W[t++]; + b += f; + f += Sum0(g) + Maj(g, h, a); + + // t = 8 * i + 3 + e += Sum1(b) + Ch(b, c, d) + K[t] + W[t++]; + a += e; + e += Sum0(f) + Maj(f, g, h); + + // t = 8 * i + 4 + d += Sum1(a) + Ch(a, b, c) + K[t] + W[t++]; + h += d; + d += Sum0(e) + Maj(e, f, g); + + // t = 8 * i + 5 + c += Sum1(h) + Ch(h, a, b) + K[t] + W[t++]; + g += c; + c += Sum0(d) + Maj(d, e, f); + + // t = 8 * i + 6 + b += Sum1(g) + Ch(g, h, a) + K[t] + W[t++]; + f += b; + b += Sum0(c) + Maj(c, d, e); + + // t = 8 * i + 7 + a += Sum1(f) + Ch(f, g, h) + K[t] + W[t++]; + e += a; + a += Sum0(b) + Maj(b, c, d); + } + + H1 += a; + H2 += b; + H3 += c; + H4 += d; + H5 += e; + H6 += f; + H7 += g; + H8 += h; + + // + // reset the offset and clean out the word buffer. + // + wOff = 0; + Array.Clear(W, 0, 16); + } + + /* SHA-384 and SHA-512 functions (as for SHA-256 but for longs) */ + private static ulong Ch(ulong x, ulong y, ulong z) + { + return (x & y) ^ (~x & z); + } + + private static ulong Maj(ulong x, ulong y, ulong z) + { + return (x & y) ^ (x & z) ^ (y & z); + } + + private static ulong Sum0(ulong x) + { + return ((x << 36) | (x >> 28)) ^ ((x << 30) | (x >> 34)) ^ ((x << 25) | (x >> 39)); + } + + private static ulong Sum1(ulong x) + { + return ((x << 50) | (x >> 14)) ^ ((x << 46) | (x >> 18)) ^ ((x << 23) | (x >> 41)); + } + + private static ulong Sigma0(ulong x) + { + return ((x << 63) | (x >> 1)) ^ ((x << 56) | (x >> 8)) ^ (x >> 7); + } + + private static ulong Sigma1(ulong x) + { + return ((x << 45) | (x >> 19)) ^ ((x << 3) | (x >> 61)) ^ (x >> 6); + } + + /* SHA-384 and SHA-512 Constants + * (represent the first 64 bits of the fractional parts of the + * cube roots of the first sixty-four prime numbers) + */ + internal static readonly ulong[] K = + { + 0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc, + 0x3956c25bf348b538, 0x59f111f1b605d019, 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, + 0xd807aa98a3030242, 0x12835b0145706fbe, 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2, + 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235, 0xc19bf174cf692694, + 0xe49b69c19ef14ad2, 0xefbe4786384f25e3, 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65, + 0x2de92c6f592b0275, 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5, + 0x983e5152ee66dfab, 0xa831c66d2db43210, 0xb00327c898fb213f, 0xbf597fc7beef0ee4, + 0xc6e00bf33da88fc2, 0xd5a79147930aa725, 0x06ca6351e003826f, 0x142929670a0e6e70, + 0x27b70a8546d22ffc, 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed, 0x53380d139d95b3df, + 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6, 0x92722c851482353b, + 0xa2bfe8a14cf10364, 0xa81a664bbc423001, 0xc24b8b70d0f89791, 0xc76c51a30654be30, + 0xd192e819d6ef5218, 0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8, + 0x19a4c116b8d2d0c8, 0x1e376c085141ab53, 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8, + 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb, 0x5b9cca4f7763e373, 0x682e6ff3d6b2b8a3, + 0x748f82ee5defb2fc, 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec, + 0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915, 0xc67178f2e372532b, + 0xca273eceea26619c, 0xd186b8c721c0c207, 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, + 0x06f067aa72176fba, 0x0a637dc5a2c898a6, 0x113f9804bef90dae, 0x1b710b35131c471b, + 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c, + 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 + }; + + public int GetByteLength() + { + return MyByteLength; + } + + public abstract string AlgorithmName { get; } + public abstract int GetDigestSize(); + public abstract int DoFinal(byte[] output, int outOff); + public abstract IMemoable Copy(); + public abstract void Reset(IMemoable t); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/LongDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/LongDigest.cs.meta new file mode 100644 index 00000000..65ac6f29 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/LongDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4c09e9ec58127294abaecdc2d14b88e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD2Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD2Digest.cs new file mode 100644 index 00000000..f8e528b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD2Digest.cs @@ -0,0 +1,273 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + + /** + * implementation of MD2 + * as outlined in RFC1319 by B.Kaliski from RSA Laboratories April 1992 + */ + public class MD2Digest + : IDigest, IMemoable + { + private const int DigestLength = 16; + private const int BYTE_LENGTH = 16; + + /* X buffer */ + private byte[] X = new byte[48]; + private int xOff; + + /* M buffer */ + + private byte[] M = new byte[16]; + private int mOff; + + /* check sum */ + + private byte[] C = new byte[16]; + private int COff; + + public MD2Digest() + { + Reset(); + } + + public MD2Digest(MD2Digest t) + { + CopyIn(t); + } + + private void CopyIn(MD2Digest t) + { + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + Array.Copy(t.M, 0, M, 0, t.M.Length); + mOff = t.mOff; + Array.Copy(t.C, 0, C, 0, t.C.Length); + COff = t.COff; + } + + /** + * return the algorithm name + * + * @return the algorithm name + */ + public string AlgorithmName + { + get { return "MD2"; } + } + + public int GetDigestSize() + { + return DigestLength; + } + + public int GetByteLength() + { + return BYTE_LENGTH; + } + + /** + * Close the digest, producing the final digest value. The doFinal + * call leaves the digest reset. + * + * @param out the array the digest is to be copied into. + * @param outOff the offset into the out array the digest is to start at. + */ + public int DoFinal(byte[] output, int outOff) + { + // add padding + byte paddingByte = (byte)(M.Length - mOff); + for (int i=mOff;i 0)) + { + Update(input[inOff]); + inOff++; + length--; + } + + // + // process whole words. + // + while (length > 16) + { + Array.Copy(input,inOff,M,0,16); + ProcessChecksum(M); + ProcessBlock(M); + length -= 16; + inOff += 16; + } + + // + // load in the remainder. + // + while (length > 0) + { + Update(input[inOff]); + inOff++; + length--; + } + } + + internal void ProcessChecksum(byte[] m) + { + int L = C[15]; + for (int i=0;i<16;i++) + { + C[i] ^= S[(m[i] ^ L) & 0xff]; + L = C[i]; + } + } + internal void ProcessBlock(byte[] m) + { + for (int i=0;i<16;i++) + { + X[i+16] = m[i]; + X[i+32] = (byte)(m[i] ^ X[i]); + } + // encrypt block + int t = 0; + + for (int j=0;j<18;j++) + { + for (int k=0;k<48;k++) + { + t = X[k] ^= S[t]; + t = t & 0xff; + } + t = (t + j)%256; + } + } + + + + // 256-byte random permutation constructed from the digits of PI + private static readonly byte[] S = { + (byte)41,(byte)46,(byte)67,(byte)201,(byte)162,(byte)216,(byte)124, + (byte)1,(byte)61,(byte)54,(byte)84,(byte)161,(byte)236,(byte)240, + (byte)6,(byte)19,(byte)98,(byte)167,(byte)5,(byte)243,(byte)192, + (byte)199,(byte)115,(byte)140,(byte)152,(byte)147,(byte)43,(byte)217, + (byte)188,(byte)76,(byte)130,(byte)202,(byte)30,(byte)155,(byte)87, + (byte)60,(byte)253,(byte)212,(byte)224,(byte)22,(byte)103,(byte)66, + (byte)111,(byte)24,(byte)138,(byte)23,(byte)229,(byte)18,(byte)190, + (byte)78,(byte)196,(byte)214,(byte)218,(byte)158,(byte)222,(byte)73, + (byte)160,(byte)251,(byte)245,(byte)142,(byte)187,(byte)47,(byte)238, + (byte)122,(byte)169,(byte)104,(byte)121,(byte)145,(byte)21,(byte)178, + (byte)7,(byte)63,(byte)148,(byte)194,(byte)16,(byte)137,(byte)11, + (byte)34,(byte)95,(byte)33,(byte)128,(byte)127,(byte)93,(byte)154, + (byte)90,(byte)144,(byte)50,(byte)39,(byte)53,(byte)62,(byte)204, + (byte)231,(byte)191,(byte)247,(byte)151,(byte)3,(byte)255,(byte)25, + (byte)48,(byte)179,(byte)72,(byte)165,(byte)181,(byte)209,(byte)215, + (byte)94,(byte)146,(byte)42,(byte)172,(byte)86,(byte)170,(byte)198, + (byte)79,(byte)184,(byte)56,(byte)210,(byte)150,(byte)164,(byte)125, + (byte)182,(byte)118,(byte)252,(byte)107,(byte)226,(byte)156,(byte)116, + (byte)4,(byte)241,(byte)69,(byte)157,(byte)112,(byte)89,(byte)100, + (byte)113,(byte)135,(byte)32,(byte)134,(byte)91,(byte)207,(byte)101, + (byte)230,(byte)45,(byte)168,(byte)2,(byte)27,(byte)96,(byte)37, + (byte)173,(byte)174,(byte)176,(byte)185,(byte)246,(byte)28,(byte)70, + (byte)97,(byte)105,(byte)52,(byte)64,(byte)126,(byte)15,(byte)85, + (byte)71,(byte)163,(byte)35,(byte)221,(byte)81,(byte)175,(byte)58, + (byte)195,(byte)92,(byte)249,(byte)206,(byte)186,(byte)197,(byte)234, + (byte)38,(byte)44,(byte)83,(byte)13,(byte)110,(byte)133,(byte)40, + (byte)132, 9,(byte)211,(byte)223,(byte)205,(byte)244,(byte)65, + (byte)129,(byte)77,(byte)82,(byte)106,(byte)220,(byte)55,(byte)200, + (byte)108,(byte)193,(byte)171,(byte)250,(byte)36,(byte)225,(byte)123, + (byte)8,(byte)12,(byte)189,(byte)177,(byte)74,(byte)120,(byte)136, + (byte)149,(byte)139,(byte)227,(byte)99,(byte)232,(byte)109,(byte)233, + (byte)203,(byte)213,(byte)254,(byte)59,(byte)0,(byte)29,(byte)57, + (byte)242,(byte)239,(byte)183,(byte)14,(byte)102,(byte)88,(byte)208, + (byte)228,(byte)166,(byte)119,(byte)114,(byte)248,(byte)235,(byte)117, + (byte)75,(byte)10,(byte)49,(byte)68,(byte)80,(byte)180,(byte)143, + (byte)237,(byte)31,(byte)26,(byte)219,(byte)153,(byte)141,(byte)51, + (byte)159,(byte)17,(byte)131,(byte)20 + }; + + public IMemoable Copy() + { + return new MD2Digest(this); + } + + public void Reset(IMemoable other) + { + MD2Digest d = (MD2Digest)other; + + CopyIn(d); + } + + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD2Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD2Digest.cs.meta new file mode 100644 index 00000000..205bc446 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD2Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 148e9d8b628e3e942995c6a5620f1b56 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD4Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD4Digest.cs new file mode 100644 index 00000000..9ea8dda9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD4Digest.cs @@ -0,0 +1,296 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * implementation of MD4 as RFC 1320 by R. Rivest, MIT Laboratory for + * Computer Science and RSA Data Security, Inc. + *

+ * NOTE: This algorithm is only included for backwards compatibility + * with legacy applications, it's not secure, don't use it for anything new!

+ */ + public class MD4Digest + : GeneralDigest + { + private const int DigestLength = 16; + + private int H1, H2, H3, H4; // IV's + + private int[] X = new int[16]; + private int xOff; + + /** + * Standard constructor + */ + public MD4Digest() + { + Reset(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public MD4Digest(MD4Digest t) : base(t) + { + CopyIn(t); + } + + private void CopyIn(MD4Digest t) + { + base.CopyIn(t); + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + H4 = t.H4; + + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + } + + public override string AlgorithmName + { + get { return "MD4"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + internal override void ProcessWord( + byte[] input, + int inOff) + { + X[xOff++] = (input[inOff] & 0xff) | ((input[inOff + 1] & 0xff) << 8) + | ((input[inOff + 2] & 0xff) << 16) | ((input[inOff + 3] & 0xff) << 24); + + if (xOff == 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength( + long bitLength) + { + if (xOff > 14) + { + ProcessBlock(); + } + + X[14] = (int)(bitLength & 0xffffffff); + X[15] = (int)((ulong) bitLength >> 32); + } + + private void UnpackWord( + int word, + byte[] outBytes, + int outOff) + { + outBytes[outOff] = (byte)word; + outBytes[outOff + 1] = (byte)((uint) word >> 8); + outBytes[outOff + 2] = (byte)((uint) word >> 16); + outBytes[outOff + 3] = (byte)((uint) word >> 24); + } + + public override int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + UnpackWord(H1, output, outOff); + UnpackWord(H2, output, outOff + 4); + UnpackWord(H3, output, outOff + 8); + UnpackWord(H4, output, outOff + 12); + + Reset(); + + return DigestLength; + } + + /** + * reset the chaining variables to the IV values. + */ + public override void Reset() + { + base.Reset(); + + H1 = unchecked((int) 0x67452301); + H2 = unchecked((int) 0xefcdab89); + H3 = unchecked((int) 0x98badcfe); + H4 = unchecked((int) 0x10325476); + + xOff = 0; + + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + // + // round 1 left rotates + // + private const int S11 = 3; + private const int S12 = 7; + private const int S13 = 11; + private const int S14 = 19; + + // + // round 2 left rotates + // + private const int S21 = 3; + private const int S22 = 5; + private const int S23 = 9; + private const int S24 = 13; + + // + // round 3 left rotates + // + private const int S31 = 3; + private const int S32 = 9; + private const int S33 = 11; + private const int S34 = 15; + + /* + * rotate int x left n bits. + */ + private int RotateLeft( + int x, + int n) + { + return (x << n) | (int) ((uint) x >> (32 - n)); + } + + /* + * F, G, H and I are the basic MD4 functions. + */ + private int F( + int u, + int v, + int w) + { + return (u & v) | (~u & w); + } + + private int G( + int u, + int v, + int w) + { + return (u & v) | (u & w) | (v & w); + } + + private int H( + int u, + int v, + int w) + { + return u ^ v ^ w; + } + + internal override void ProcessBlock() + { + int a = H1; + int b = H2; + int c = H3; + int d = H4; + + // + // Round 1 - F cycle, 16 times. + // + a = RotateLeft((a + F(b, c, d) + X[ 0]), S11); + d = RotateLeft((d + F(a, b, c) + X[ 1]), S12); + c = RotateLeft((c + F(d, a, b) + X[ 2]), S13); + b = RotateLeft((b + F(c, d, a) + X[ 3]), S14); + a = RotateLeft((a + F(b, c, d) + X[ 4]), S11); + d = RotateLeft((d + F(a, b, c) + X[ 5]), S12); + c = RotateLeft((c + F(d, a, b) + X[ 6]), S13); + b = RotateLeft((b + F(c, d, a) + X[ 7]), S14); + a = RotateLeft((a + F(b, c, d) + X[ 8]), S11); + d = RotateLeft((d + F(a, b, c) + X[ 9]), S12); + c = RotateLeft((c + F(d, a, b) + X[10]), S13); + b = RotateLeft((b + F(c, d, a) + X[11]), S14); + a = RotateLeft((a + F(b, c, d) + X[12]), S11); + d = RotateLeft((d + F(a, b, c) + X[13]), S12); + c = RotateLeft((c + F(d, a, b) + X[14]), S13); + b = RotateLeft((b + F(c, d, a) + X[15]), S14); + + // + // Round 2 - G cycle, 16 times. + // + a = RotateLeft((a + G(b, c, d) + X[ 0] + 0x5a827999), S21); + d = RotateLeft((d + G(a, b, c) + X[ 4] + 0x5a827999), S22); + c = RotateLeft((c + G(d, a, b) + X[ 8] + 0x5a827999), S23); + b = RotateLeft((b + G(c, d, a) + X[12] + 0x5a827999), S24); + a = RotateLeft((a + G(b, c, d) + X[ 1] + 0x5a827999), S21); + d = RotateLeft((d + G(a, b, c) + X[ 5] + 0x5a827999), S22); + c = RotateLeft((c + G(d, a, b) + X[ 9] + 0x5a827999), S23); + b = RotateLeft((b + G(c, d, a) + X[13] + 0x5a827999), S24); + a = RotateLeft((a + G(b, c, d) + X[ 2] + 0x5a827999), S21); + d = RotateLeft((d + G(a, b, c) + X[ 6] + 0x5a827999), S22); + c = RotateLeft((c + G(d, a, b) + X[10] + 0x5a827999), S23); + b = RotateLeft((b + G(c, d, a) + X[14] + 0x5a827999), S24); + a = RotateLeft((a + G(b, c, d) + X[ 3] + 0x5a827999), S21); + d = RotateLeft((d + G(a, b, c) + X[ 7] + 0x5a827999), S22); + c = RotateLeft((c + G(d, a, b) + X[11] + 0x5a827999), S23); + b = RotateLeft((b + G(c, d, a) + X[15] + 0x5a827999), S24); + + // + // Round 3 - H cycle, 16 times. + // + a = RotateLeft((a + H(b, c, d) + X[ 0] + 0x6ed9eba1), S31); + d = RotateLeft((d + H(a, b, c) + X[ 8] + 0x6ed9eba1), S32); + c = RotateLeft((c + H(d, a, b) + X[ 4] + 0x6ed9eba1), S33); + b = RotateLeft((b + H(c, d, a) + X[12] + 0x6ed9eba1), S34); + a = RotateLeft((a + H(b, c, d) + X[ 2] + 0x6ed9eba1), S31); + d = RotateLeft((d + H(a, b, c) + X[10] + 0x6ed9eba1), S32); + c = RotateLeft((c + H(d, a, b) + X[ 6] + 0x6ed9eba1), S33); + b = RotateLeft((b + H(c, d, a) + X[14] + 0x6ed9eba1), S34); + a = RotateLeft((a + H(b, c, d) + X[ 1] + 0x6ed9eba1), S31); + d = RotateLeft((d + H(a, b, c) + X[ 9] + 0x6ed9eba1), S32); + c = RotateLeft((c + H(d, a, b) + X[ 5] + 0x6ed9eba1), S33); + b = RotateLeft((b + H(c, d, a) + X[13] + 0x6ed9eba1), S34); + a = RotateLeft((a + H(b, c, d) + X[ 3] + 0x6ed9eba1), S31); + d = RotateLeft((d + H(a, b, c) + X[11] + 0x6ed9eba1), S32); + c = RotateLeft((c + H(d, a, b) + X[ 7] + 0x6ed9eba1), S33); + b = RotateLeft((b + H(c, d, a) + X[15] + 0x6ed9eba1), S34); + + H1 += a; + H2 += b; + H3 += c; + H4 += d; + + // + // reset the offset and clean out the word buffer. + // + xOff = 0; + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + public override IMemoable Copy() + { + return new MD4Digest(this); + } + + public override void Reset(IMemoable other) + { + MD4Digest d = (MD4Digest)other; + + CopyIn(d); + } + + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD4Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD4Digest.cs.meta new file mode 100644 index 00000000..6dbe7269 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD4Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c00e2d62bb704374caa7eae8a01a61c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD5Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD5Digest.cs new file mode 100644 index 00000000..39301790 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD5Digest.cs @@ -0,0 +1,317 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * implementation of MD5 as outlined in "Handbook of Applied Cryptography", pages 346 - 347. + */ + public class MD5Digest + : GeneralDigest + { + private const int DigestLength = 16; + + private uint H1, H2, H3, H4; // IV's + + private uint[] X = new uint[16]; + private int xOff; + + public MD5Digest() + { + Reset(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public MD5Digest(MD5Digest t) + : base(t) + { + CopyIn(t); + } + + private void CopyIn(MD5Digest t) + { + base.CopyIn(t); + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + H4 = t.H4; + + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + } + + public override string AlgorithmName + { + get { return "MD5"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + internal override void ProcessWord( + byte[] input, + int inOff) + { + X[xOff] = Pack.LE_To_UInt32(input, inOff); + + if (++xOff == 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength( + long bitLength) + { + if (xOff > 14) + { + if (xOff == 15) + X[15] = 0; + + ProcessBlock(); + } + + for (int i = xOff; i < 14; ++i) + { + X[i] = 0; + } + + X[14] = (uint)((ulong)bitLength); + X[15] = (uint)((ulong)bitLength >> 32); + } + + public override int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + Pack.UInt32_To_LE(H1, output, outOff); + Pack.UInt32_To_LE(H2, output, outOff + 4); + Pack.UInt32_To_LE(H3, output, outOff + 8); + Pack.UInt32_To_LE(H4, output, outOff + 12); + + Reset(); + + return DigestLength; + } + + /** + * reset the chaining variables to the IV values. + */ + public override void Reset() + { + base.Reset(); + + H1 = 0x67452301; + H2 = 0xefcdab89; + H3 = 0x98badcfe; + H4 = 0x10325476; + + xOff = 0; + + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + // + // round 1 left rotates + // + private static readonly int S11 = 7; + private static readonly int S12 = 12; + private static readonly int S13 = 17; + private static readonly int S14 = 22; + + // + // round 2 left rotates + // + private static readonly int S21 = 5; + private static readonly int S22 = 9; + private static readonly int S23 = 14; + private static readonly int S24 = 20; + + // + // round 3 left rotates + // + private static readonly int S31 = 4; + private static readonly int S32 = 11; + private static readonly int S33 = 16; + private static readonly int S34 = 23; + + // + // round 4 left rotates + // + private static readonly int S41 = 6; + private static readonly int S42 = 10; + private static readonly int S43 = 15; + private static readonly int S44 = 21; + + /* + * rotate int x left n bits. + */ + private static uint RotateLeft( + uint x, + int n) + { + return (x << n) | (x >> (32 - n)); + } + + /* + * F, G, H and I are the basic MD5 functions. + */ + private static uint F( + uint u, + uint v, + uint w) + { + return (u & v) | (~u & w); + } + + private static uint G( + uint u, + uint v, + uint w) + { + return (u & w) | (v & ~w); + } + + private static uint H( + uint u, + uint v, + uint w) + { + return u ^ v ^ w; + } + + private static uint K( + uint u, + uint v, + uint w) + { + return v ^ (u | ~w); + } + + internal override void ProcessBlock() + { + uint a = H1; + uint b = H2; + uint c = H3; + uint d = H4; + + // + // Round 1 - F cycle, 16 times. + // + a = RotateLeft((a + F(b, c, d) + X[0] + 0xd76aa478), S11) + b; + d = RotateLeft((d + F(a, b, c) + X[1] + 0xe8c7b756), S12) + a; + c = RotateLeft((c + F(d, a, b) + X[2] + 0x242070db), S13) + d; + b = RotateLeft((b + F(c, d, a) + X[3] + 0xc1bdceee), S14) + c; + a = RotateLeft((a + F(b, c, d) + X[4] + 0xf57c0faf), S11) + b; + d = RotateLeft((d + F(a, b, c) + X[5] + 0x4787c62a), S12) + a; + c = RotateLeft((c + F(d, a, b) + X[6] + 0xa8304613), S13) + d; + b = RotateLeft((b + F(c, d, a) + X[7] + 0xfd469501), S14) + c; + a = RotateLeft((a + F(b, c, d) + X[8] + 0x698098d8), S11) + b; + d = RotateLeft((d + F(a, b, c) + X[9] + 0x8b44f7af), S12) + a; + c = RotateLeft((c + F(d, a, b) + X[10] + 0xffff5bb1), S13) + d; + b = RotateLeft((b + F(c, d, a) + X[11] + 0x895cd7be), S14) + c; + a = RotateLeft((a + F(b, c, d) + X[12] + 0x6b901122), S11) + b; + d = RotateLeft((d + F(a, b, c) + X[13] + 0xfd987193), S12) + a; + c = RotateLeft((c + F(d, a, b) + X[14] + 0xa679438e), S13) + d; + b = RotateLeft((b + F(c, d, a) + X[15] + 0x49b40821), S14) + c; + + // + // Round 2 - G cycle, 16 times. + // + a = RotateLeft((a + G(b, c, d) + X[1] + 0xf61e2562), S21) + b; + d = RotateLeft((d + G(a, b, c) + X[6] + 0xc040b340), S22) + a; + c = RotateLeft((c + G(d, a, b) + X[11] + 0x265e5a51), S23) + d; + b = RotateLeft((b + G(c, d, a) + X[0] + 0xe9b6c7aa), S24) + c; + a = RotateLeft((a + G(b, c, d) + X[5] + 0xd62f105d), S21) + b; + d = RotateLeft((d + G(a, b, c) + X[10] + 0x02441453), S22) + a; + c = RotateLeft((c + G(d, a, b) + X[15] + 0xd8a1e681), S23) + d; + b = RotateLeft((b + G(c, d, a) + X[4] + 0xe7d3fbc8), S24) + c; + a = RotateLeft((a + G(b, c, d) + X[9] + 0x21e1cde6), S21) + b; + d = RotateLeft((d + G(a, b, c) + X[14] + 0xc33707d6), S22) + a; + c = RotateLeft((c + G(d, a, b) + X[3] + 0xf4d50d87), S23) + d; + b = RotateLeft((b + G(c, d, a) + X[8] + 0x455a14ed), S24) + c; + a = RotateLeft((a + G(b, c, d) + X[13] + 0xa9e3e905), S21) + b; + d = RotateLeft((d + G(a, b, c) + X[2] + 0xfcefa3f8), S22) + a; + c = RotateLeft((c + G(d, a, b) + X[7] + 0x676f02d9), S23) + d; + b = RotateLeft((b + G(c, d, a) + X[12] + 0x8d2a4c8a), S24) + c; + + // + // Round 3 - H cycle, 16 times. + // + a = RotateLeft((a + H(b, c, d) + X[5] + 0xfffa3942), S31) + b; + d = RotateLeft((d + H(a, b, c) + X[8] + 0x8771f681), S32) + a; + c = RotateLeft((c + H(d, a, b) + X[11] + 0x6d9d6122), S33) + d; + b = RotateLeft((b + H(c, d, a) + X[14] + 0xfde5380c), S34) + c; + a = RotateLeft((a + H(b, c, d) + X[1] + 0xa4beea44), S31) + b; + d = RotateLeft((d + H(a, b, c) + X[4] + 0x4bdecfa9), S32) + a; + c = RotateLeft((c + H(d, a, b) + X[7] + 0xf6bb4b60), S33) + d; + b = RotateLeft((b + H(c, d, a) + X[10] + 0xbebfbc70), S34) + c; + a = RotateLeft((a + H(b, c, d) + X[13] + 0x289b7ec6), S31) + b; + d = RotateLeft((d + H(a, b, c) + X[0] + 0xeaa127fa), S32) + a; + c = RotateLeft((c + H(d, a, b) + X[3] + 0xd4ef3085), S33) + d; + b = RotateLeft((b + H(c, d, a) + X[6] + 0x04881d05), S34) + c; + a = RotateLeft((a + H(b, c, d) + X[9] + 0xd9d4d039), S31) + b; + d = RotateLeft((d + H(a, b, c) + X[12] + 0xe6db99e5), S32) + a; + c = RotateLeft((c + H(d, a, b) + X[15] + 0x1fa27cf8), S33) + d; + b = RotateLeft((b + H(c, d, a) + X[2] + 0xc4ac5665), S34) + c; + + // + // Round 4 - K cycle, 16 times. + // + a = RotateLeft((a + K(b, c, d) + X[0] + 0xf4292244), S41) + b; + d = RotateLeft((d + K(a, b, c) + X[7] + 0x432aff97), S42) + a; + c = RotateLeft((c + K(d, a, b) + X[14] + 0xab9423a7), S43) + d; + b = RotateLeft((b + K(c, d, a) + X[5] + 0xfc93a039), S44) + c; + a = RotateLeft((a + K(b, c, d) + X[12] + 0x655b59c3), S41) + b; + d = RotateLeft((d + K(a, b, c) + X[3] + 0x8f0ccc92), S42) + a; + c = RotateLeft((c + K(d, a, b) + X[10] + 0xffeff47d), S43) + d; + b = RotateLeft((b + K(c, d, a) + X[1] + 0x85845dd1), S44) + c; + a = RotateLeft((a + K(b, c, d) + X[8] + 0x6fa87e4f), S41) + b; + d = RotateLeft((d + K(a, b, c) + X[15] + 0xfe2ce6e0), S42) + a; + c = RotateLeft((c + K(d, a, b) + X[6] + 0xa3014314), S43) + d; + b = RotateLeft((b + K(c, d, a) + X[13] + 0x4e0811a1), S44) + c; + a = RotateLeft((a + K(b, c, d) + X[4] + 0xf7537e82), S41) + b; + d = RotateLeft((d + K(a, b, c) + X[11] + 0xbd3af235), S42) + a; + c = RotateLeft((c + K(d, a, b) + X[2] + 0x2ad7d2bb), S43) + d; + b = RotateLeft((b + K(c, d, a) + X[9] + 0xeb86d391), S44) + c; + + H1 += a; + H2 += b; + H3 += c; + H4 += d; + + xOff = 0; + } + + public override IMemoable Copy() + { + return new MD5Digest(this); + } + + public override void Reset(IMemoable other) + { + MD5Digest d = (MD5Digest)other; + + CopyIn(d); + } + + } + +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD5Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD5Digest.cs.meta new file mode 100644 index 00000000..22396e6f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/MD5Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46ef6a4addc052240b7194ef4a92d2c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NonMemoableDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NonMemoableDigest.cs new file mode 100644 index 00000000..97170fa6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NonMemoableDigest.cs @@ -0,0 +1,66 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * Wrapper removes exposure to the IMemoable interface on an IDigest implementation. + */ + public class NonMemoableDigest + : IDigest + { + protected readonly IDigest mBaseDigest; + + /** + * Base constructor. + * + * @param baseDigest underlying digest to use. + * @exception IllegalArgumentException if baseDigest is null + */ + public NonMemoableDigest(IDigest baseDigest) + { + if (baseDigest == null) + throw new ArgumentNullException("baseDigest"); + + this.mBaseDigest = baseDigest; + } + + public virtual string AlgorithmName + { + get { return mBaseDigest.AlgorithmName; } + } + + public virtual int GetDigestSize() + { + return mBaseDigest.GetDigestSize(); + } + + public virtual void Update(byte input) + { + mBaseDigest.Update(input); + } + + public virtual void BlockUpdate(byte[] input, int inOff, int len) + { + mBaseDigest.BlockUpdate(input, inOff, len); + } + + public virtual int DoFinal(byte[] output, int outOff) + { + return mBaseDigest.DoFinal(output, outOff); + } + + public virtual void Reset() + { + mBaseDigest.Reset(); + } + + public virtual int GetByteLength() + { + return mBaseDigest.GetByteLength(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NonMemoableDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NonMemoableDigest.cs.meta new file mode 100644 index 00000000..1708d173 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NonMemoableDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71b1ef56ae67fac44857a3cd26f9d4fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NullDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NullDigest.cs new file mode 100644 index 00000000..241f3d06 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NullDigest.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + public class NullDigest : IDigest + { + private readonly MemoryStream bOut = new MemoryStream(); + + public string AlgorithmName + { + get { return "NULL"; } + } + + public int GetByteLength() + { + // TODO Is this okay? + return 0; + } + + public int GetDigestSize() + { + return (int)bOut.Length; + } + + public void Update(byte b) + { + bOut.WriteByte(b); + } + + public void BlockUpdate(byte[] inBytes, int inOff, int len) + { + bOut.Write(inBytes, inOff, len); + } + + public int DoFinal(byte[] outBytes, int outOff) + { + try + { + return Streams.WriteBufTo(bOut, outBytes, outOff); + } + finally + { + Reset(); + } + } + + public void Reset() + { + bOut.SetLength(0); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NullDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NullDigest.cs.meta new file mode 100644 index 00000000..a484b12d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/NullDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e4ba894a25f89ad4485499b6efb1cd37 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD128Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD128Digest.cs new file mode 100644 index 00000000..c209c0cc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD128Digest.cs @@ -0,0 +1,488 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * implementation of RipeMD128 + */ + public class RipeMD128Digest + : GeneralDigest + { + private const int DigestLength = 16; + + private int H0, H1, H2, H3; // IV's + + private int[] X = new int[16]; + private int xOff; + + /** + * Standard constructor + */ + public RipeMD128Digest() + { + Reset(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public RipeMD128Digest(RipeMD128Digest t) : base(t) + { + CopyIn(t); + } + + private void CopyIn(RipeMD128Digest t) + { + base.CopyIn(t); + + H0 = t.H0; + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + } + + public override string AlgorithmName + { + get { return "RIPEMD128"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + internal override void ProcessWord( + byte[] input, + int inOff) + { + X[xOff++] = (input[inOff] & 0xff) | ((input[inOff + 1] & 0xff) << 8) + | ((input[inOff + 2] & 0xff) << 16) | ((input[inOff + 3] & 0xff) << 24); + + if (xOff == 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength( + long bitLength) + { + if (xOff > 14) + { + ProcessBlock(); + } + + X[14] = (int)(bitLength & 0xffffffff); + X[15] = (int)((ulong) bitLength >> 32); + } + + private void UnpackWord( + int word, + byte[] outBytes, + int outOff) + { + outBytes[outOff] = (byte)word; + outBytes[outOff + 1] = (byte)((uint) word >> 8); + outBytes[outOff + 2] = (byte)((uint) word >> 16); + outBytes[outOff + 3] = (byte)((uint) word >> 24); + } + + public override int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + UnpackWord(H0, output, outOff); + UnpackWord(H1, output, outOff + 4); + UnpackWord(H2, output, outOff + 8); + UnpackWord(H3, output, outOff + 12); + + Reset(); + + return DigestLength; + } + + /** + * reset the chaining variables to the IV values. + */ + public override void Reset() + { + base.Reset(); + + H0 = unchecked((int) 0x67452301); + H1 = unchecked((int) 0xefcdab89); + H2 = unchecked((int) 0x98badcfe); + H3 = unchecked((int) 0x10325476); + + xOff = 0; + + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + /* + * rotate int x left n bits. + */ + private int RL( + int x, + int n) + { + return (x << n) | (int) ((uint) x >> (32 - n)); + } + + /* + * f1,f2,f3,f4 are the basic RipeMD128 functions. + */ + + /* + * F + */ + private int F1( + int x, + int y, + int z) + { + return x ^ y ^ z; + } + + /* + * G + */ + private int F2( + int x, + int y, + int z) + { + return (x & y) | (~x & z); + } + + /* + * H + */ + private int F3( + int x, + int y, + int z) + { + return (x | ~y) ^ z; + } + + /* + * I + */ + private int F4( + int x, + int y, + int z) + { + return (x & z) | (y & ~z); + } + + private int F1( + int a, + int b, + int c, + int d, + int x, + int s) + { + return RL(a + F1(b, c, d) + x, s); + } + + private int F2( + int a, + int b, + int c, + int d, + int x, + int s) + { + return RL(a + F2(b, c, d) + x + unchecked((int) 0x5a827999), s); + } + + private int F3( + int a, + int b, + int c, + int d, + int x, + int s) + { + return RL(a + F3(b, c, d) + x + unchecked((int) 0x6ed9eba1), s); + } + + private int F4( + int a, + int b, + int c, + int d, + int x, + int s) + { + return RL(a + F4(b, c, d) + x + unchecked((int) 0x8f1bbcdc), s); + } + + private int FF1( + int a, + int b, + int c, + int d, + int x, + int s) + { + return RL(a + F1(b, c, d) + x, s); + } + + private int FF2( + int a, + int b, + int c, + int d, + int x, + int s) + { + return RL(a + F2(b, c, d) + x + unchecked((int) 0x6d703ef3), s); + } + + private int FF3( + int a, + int b, + int c, + int d, + int x, + int s) + { + return RL(a + F3(b, c, d) + x + unchecked((int) 0x5c4dd124), s); + } + + private int FF4( + int a, + int b, + int c, + int d, + int x, + int s) + { + return RL(a + F4(b, c, d) + x + unchecked((int) 0x50a28be6), s); + } + + internal override void ProcessBlock() + { + int a, aa; + int b, bb; + int c, cc; + int d, dd; + + a = aa = H0; + b = bb = H1; + c = cc = H2; + d = dd = H3; + + // + // Round 1 + // + a = F1(a, b, c, d, X[ 0], 11); + d = F1(d, a, b, c, X[ 1], 14); + c = F1(c, d, a, b, X[ 2], 15); + b = F1(b, c, d, a, X[ 3], 12); + a = F1(a, b, c, d, X[ 4], 5); + d = F1(d, a, b, c, X[ 5], 8); + c = F1(c, d, a, b, X[ 6], 7); + b = F1(b, c, d, a, X[ 7], 9); + a = F1(a, b, c, d, X[ 8], 11); + d = F1(d, a, b, c, X[ 9], 13); + c = F1(c, d, a, b, X[10], 14); + b = F1(b, c, d, a, X[11], 15); + a = F1(a, b, c, d, X[12], 6); + d = F1(d, a, b, c, X[13], 7); + c = F1(c, d, a, b, X[14], 9); + b = F1(b, c, d, a, X[15], 8); + + // + // Round 2 + // + a = F2(a, b, c, d, X[ 7], 7); + d = F2(d, a, b, c, X[ 4], 6); + c = F2(c, d, a, b, X[13], 8); + b = F2(b, c, d, a, X[ 1], 13); + a = F2(a, b, c, d, X[10], 11); + d = F2(d, a, b, c, X[ 6], 9); + c = F2(c, d, a, b, X[15], 7); + b = F2(b, c, d, a, X[ 3], 15); + a = F2(a, b, c, d, X[12], 7); + d = F2(d, a, b, c, X[ 0], 12); + c = F2(c, d, a, b, X[ 9], 15); + b = F2(b, c, d, a, X[ 5], 9); + a = F2(a, b, c, d, X[ 2], 11); + d = F2(d, a, b, c, X[14], 7); + c = F2(c, d, a, b, X[11], 13); + b = F2(b, c, d, a, X[ 8], 12); + + // + // Round 3 + // + a = F3(a, b, c, d, X[ 3], 11); + d = F3(d, a, b, c, X[10], 13); + c = F3(c, d, a, b, X[14], 6); + b = F3(b, c, d, a, X[ 4], 7); + a = F3(a, b, c, d, X[ 9], 14); + d = F3(d, a, b, c, X[15], 9); + c = F3(c, d, a, b, X[ 8], 13); + b = F3(b, c, d, a, X[ 1], 15); + a = F3(a, b, c, d, X[ 2], 14); + d = F3(d, a, b, c, X[ 7], 8); + c = F3(c, d, a, b, X[ 0], 13); + b = F3(b, c, d, a, X[ 6], 6); + a = F3(a, b, c, d, X[13], 5); + d = F3(d, a, b, c, X[11], 12); + c = F3(c, d, a, b, X[ 5], 7); + b = F3(b, c, d, a, X[12], 5); + + // + // Round 4 + // + a = F4(a, b, c, d, X[ 1], 11); + d = F4(d, a, b, c, X[ 9], 12); + c = F4(c, d, a, b, X[11], 14); + b = F4(b, c, d, a, X[10], 15); + a = F4(a, b, c, d, X[ 0], 14); + d = F4(d, a, b, c, X[ 8], 15); + c = F4(c, d, a, b, X[12], 9); + b = F4(b, c, d, a, X[ 4], 8); + a = F4(a, b, c, d, X[13], 9); + d = F4(d, a, b, c, X[ 3], 14); + c = F4(c, d, a, b, X[ 7], 5); + b = F4(b, c, d, a, X[15], 6); + a = F4(a, b, c, d, X[14], 8); + d = F4(d, a, b, c, X[ 5], 6); + c = F4(c, d, a, b, X[ 6], 5); + b = F4(b, c, d, a, X[ 2], 12); + + // + // Parallel round 1 + // + aa = FF4(aa, bb, cc, dd, X[ 5], 8); + dd = FF4(dd, aa, bb, cc, X[14], 9); + cc = FF4(cc, dd, aa, bb, X[ 7], 9); + bb = FF4(bb, cc, dd, aa, X[ 0], 11); + aa = FF4(aa, bb, cc, dd, X[ 9], 13); + dd = FF4(dd, aa, bb, cc, X[ 2], 15); + cc = FF4(cc, dd, aa, bb, X[11], 15); + bb = FF4(bb, cc, dd, aa, X[ 4], 5); + aa = FF4(aa, bb, cc, dd, X[13], 7); + dd = FF4(dd, aa, bb, cc, X[ 6], 7); + cc = FF4(cc, dd, aa, bb, X[15], 8); + bb = FF4(bb, cc, dd, aa, X[ 8], 11); + aa = FF4(aa, bb, cc, dd, X[ 1], 14); + dd = FF4(dd, aa, bb, cc, X[10], 14); + cc = FF4(cc, dd, aa, bb, X[ 3], 12); + bb = FF4(bb, cc, dd, aa, X[12], 6); + + // + // Parallel round 2 + // + aa = FF3(aa, bb, cc, dd, X[ 6], 9); + dd = FF3(dd, aa, bb, cc, X[11], 13); + cc = FF3(cc, dd, aa, bb, X[ 3], 15); + bb = FF3(bb, cc, dd, aa, X[ 7], 7); + aa = FF3(aa, bb, cc, dd, X[ 0], 12); + dd = FF3(dd, aa, bb, cc, X[13], 8); + cc = FF3(cc, dd, aa, bb, X[ 5], 9); + bb = FF3(bb, cc, dd, aa, X[10], 11); + aa = FF3(aa, bb, cc, dd, X[14], 7); + dd = FF3(dd, aa, bb, cc, X[15], 7); + cc = FF3(cc, dd, aa, bb, X[ 8], 12); + bb = FF3(bb, cc, dd, aa, X[12], 7); + aa = FF3(aa, bb, cc, dd, X[ 4], 6); + dd = FF3(dd, aa, bb, cc, X[ 9], 15); + cc = FF3(cc, dd, aa, bb, X[ 1], 13); + bb = FF3(bb, cc, dd, aa, X[ 2], 11); + + // + // Parallel round 3 + // + aa = FF2(aa, bb, cc, dd, X[15], 9); + dd = FF2(dd, aa, bb, cc, X[ 5], 7); + cc = FF2(cc, dd, aa, bb, X[ 1], 15); + bb = FF2(bb, cc, dd, aa, X[ 3], 11); + aa = FF2(aa, bb, cc, dd, X[ 7], 8); + dd = FF2(dd, aa, bb, cc, X[14], 6); + cc = FF2(cc, dd, aa, bb, X[ 6], 6); + bb = FF2(bb, cc, dd, aa, X[ 9], 14); + aa = FF2(aa, bb, cc, dd, X[11], 12); + dd = FF2(dd, aa, bb, cc, X[ 8], 13); + cc = FF2(cc, dd, aa, bb, X[12], 5); + bb = FF2(bb, cc, dd, aa, X[ 2], 14); + aa = FF2(aa, bb, cc, dd, X[10], 13); + dd = FF2(dd, aa, bb, cc, X[ 0], 13); + cc = FF2(cc, dd, aa, bb, X[ 4], 7); + bb = FF2(bb, cc, dd, aa, X[13], 5); + + // + // Parallel round 4 + // + aa = FF1(aa, bb, cc, dd, X[ 8], 15); + dd = FF1(dd, aa, bb, cc, X[ 6], 5); + cc = FF1(cc, dd, aa, bb, X[ 4], 8); + bb = FF1(bb, cc, dd, aa, X[ 1], 11); + aa = FF1(aa, bb, cc, dd, X[ 3], 14); + dd = FF1(dd, aa, bb, cc, X[11], 14); + cc = FF1(cc, dd, aa, bb, X[15], 6); + bb = FF1(bb, cc, dd, aa, X[ 0], 14); + aa = FF1(aa, bb, cc, dd, X[ 5], 6); + dd = FF1(dd, aa, bb, cc, X[12], 9); + cc = FF1(cc, dd, aa, bb, X[ 2], 12); + bb = FF1(bb, cc, dd, aa, X[13], 9); + aa = FF1(aa, bb, cc, dd, X[ 9], 12); + dd = FF1(dd, aa, bb, cc, X[ 7], 5); + cc = FF1(cc, dd, aa, bb, X[10], 15); + bb = FF1(bb, cc, dd, aa, X[14], 8); + + dd += c + H1; // final result for H0 + + // + // combine the results + // + H1 = H2 + d + aa; + H2 = H3 + a + bb; + H3 = H0 + b + cc; + H0 = dd; + + // + // reset the offset and clean out the word buffer. + // + xOff = 0; + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + public override IMemoable Copy() + { + return new RipeMD128Digest(this); + } + + public override void Reset(IMemoable other) + { + RipeMD128Digest d = (RipeMD128Digest)other; + + CopyIn(d); + } + + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD128Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD128Digest.cs.meta new file mode 100644 index 00000000..444d6f0a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD128Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19005e1814c7f154599f0788dfc18e96 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD160Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD160Digest.cs new file mode 100644 index 00000000..d75893c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD160Digest.cs @@ -0,0 +1,449 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * implementation of RipeMD see, + * http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html + */ + public class RipeMD160Digest + : GeneralDigest + { + private const int DigestLength = 20; + + private int H0, H1, H2, H3, H4; // IV's + + private int[] X = new int[16]; + private int xOff; + + /** + * Standard constructor + */ + public RipeMD160Digest() + { + Reset(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public RipeMD160Digest(RipeMD160Digest t) : base(t) + { + CopyIn(t); + } + + private void CopyIn(RipeMD160Digest t) + { + base.CopyIn(t); + + H0 = t.H0; + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + H4 = t.H4; + + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + } + + public override string AlgorithmName + { + get { return "RIPEMD160"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + internal override void ProcessWord( + byte[] input, + int inOff) + { + X[xOff++] = (input[inOff] & 0xff) | ((input[inOff + 1] & 0xff) << 8) + | ((input[inOff + 2] & 0xff) << 16) | ((input[inOff + 3] & 0xff) << 24); + + if (xOff == 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength( + long bitLength) + { + if (xOff > 14) + { + ProcessBlock(); + } + + X[14] = (int)(bitLength & 0xffffffff); + X[15] = (int)((ulong) bitLength >> 32); + } + + private void UnpackWord( + int word, + byte[] outBytes, + int outOff) + { + outBytes[outOff] = (byte)word; + outBytes[outOff + 1] = (byte)((uint) word >> 8); + outBytes[outOff + 2] = (byte)((uint) word >> 16); + outBytes[outOff + 3] = (byte)((uint) word >> 24); + } + + public override int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + UnpackWord(H0, output, outOff); + UnpackWord(H1, output, outOff + 4); + UnpackWord(H2, output, outOff + 8); + UnpackWord(H3, output, outOff + 12); + UnpackWord(H4, output, outOff + 16); + + Reset(); + + return DigestLength; + } + + /** + * reset the chaining variables to the IV values. + */ + public override void Reset() + { + base.Reset(); + + H0 = unchecked((int) 0x67452301); + H1 = unchecked((int) 0xefcdab89); + H2 = unchecked((int) 0x98badcfe); + H3 = unchecked((int) 0x10325476); + H4 = unchecked((int) 0xc3d2e1f0); + + xOff = 0; + + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + /* + * rotate int x left n bits. + */ + private int RL( + int x, + int n) + { + return (x << n) | (int) ((uint) x >> (32 - n)); + } + + /* + * f1,f2,f3,f4,f5 are the basic RipeMD160 functions. + */ + + /* + * rounds 0-15 + */ + private int F1( + int x, + int y, + int z) + { + return x ^ y ^ z; + } + + /* + * rounds 16-31 + */ + private int F2( + int x, + int y, + int z) + { + return (x & y) | (~x & z); + } + + /* + * rounds 32-47 + */ + private int F3( + int x, + int y, + int z) + { + return (x | ~y) ^ z; + } + + /* + * rounds 48-63 + */ + private int F4( + int x, + int y, + int z) + { + return (x & z) | (y & ~z); + } + + /* + * rounds 64-79 + */ + private int F5( + int x, + int y, + int z) + { + return x ^ (y | ~z); + } + + internal override void ProcessBlock() + { + int a, aa; + int b, bb; + int c, cc; + int d, dd; + int e, ee; + + a = aa = H0; + b = bb = H1; + c = cc = H2; + d = dd = H3; + e = ee = H4; + + // + // Rounds 1 - 16 + // + // left + a = RL(a + F1(b,c,d) + X[ 0], 11) + e; c = RL(c, 10); + e = RL(e + F1(a,b,c) + X[ 1], 14) + d; b = RL(b, 10); + d = RL(d + F1(e,a,b) + X[ 2], 15) + c; a = RL(a, 10); + c = RL(c + F1(d,e,a) + X[ 3], 12) + b; e = RL(e, 10); + b = RL(b + F1(c,d,e) + X[ 4], 5) + a; d = RL(d, 10); + a = RL(a + F1(b,c,d) + X[ 5], 8) + e; c = RL(c, 10); + e = RL(e + F1(a,b,c) + X[ 6], 7) + d; b = RL(b, 10); + d = RL(d + F1(e,a,b) + X[ 7], 9) + c; a = RL(a, 10); + c = RL(c + F1(d,e,a) + X[ 8], 11) + b; e = RL(e, 10); + b = RL(b + F1(c,d,e) + X[ 9], 13) + a; d = RL(d, 10); + a = RL(a + F1(b,c,d) + X[10], 14) + e; c = RL(c, 10); + e = RL(e + F1(a,b,c) + X[11], 15) + d; b = RL(b, 10); + d = RL(d + F1(e,a,b) + X[12], 6) + c; a = RL(a, 10); + c = RL(c + F1(d,e,a) + X[13], 7) + b; e = RL(e, 10); + b = RL(b + F1(c,d,e) + X[14], 9) + a; d = RL(d, 10); + a = RL(a + F1(b,c,d) + X[15], 8) + e; c = RL(c, 10); + + // right + aa = RL(aa + F5(bb,cc,dd) + X[ 5] + unchecked((int) 0x50a28be6), 8) + ee; cc = RL(cc, 10); + ee = RL(ee + F5(aa,bb,cc) + X[14] + unchecked((int) 0x50a28be6), 9) + dd; bb = RL(bb, 10); + dd = RL(dd + F5(ee,aa,bb) + X[ 7] + unchecked((int) 0x50a28be6), 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F5(dd,ee,aa) + X[ 0] + unchecked((int) 0x50a28be6), 11) + bb; ee = RL(ee, 10); + bb = RL(bb + F5(cc,dd,ee) + X[ 9] + unchecked((int) 0x50a28be6), 13) + aa; dd = RL(dd, 10); + aa = RL(aa + F5(bb,cc,dd) + X[ 2] + unchecked((int) 0x50a28be6), 15) + ee; cc = RL(cc, 10); + ee = RL(ee + F5(aa,bb,cc) + X[11] + unchecked((int) 0x50a28be6), 15) + dd; bb = RL(bb, 10); + dd = RL(dd + F5(ee,aa,bb) + X[ 4] + unchecked((int) 0x50a28be6), 5) + cc; aa = RL(aa, 10); + cc = RL(cc + F5(dd,ee,aa) + X[13] + unchecked((int) 0x50a28be6), 7) + bb; ee = RL(ee, 10); + bb = RL(bb + F5(cc,dd,ee) + X[ 6] + unchecked((int) 0x50a28be6), 7) + aa; dd = RL(dd, 10); + aa = RL(aa + F5(bb,cc,dd) + X[15] + unchecked((int) 0x50a28be6), 8) + ee; cc = RL(cc, 10); + ee = RL(ee + F5(aa,bb,cc) + X[ 8] + unchecked((int) 0x50a28be6), 11) + dd; bb = RL(bb, 10); + dd = RL(dd + F5(ee,aa,bb) + X[ 1] + unchecked((int) 0x50a28be6), 14) + cc; aa = RL(aa, 10); + cc = RL(cc + F5(dd,ee,aa) + X[10] + unchecked((int) 0x50a28be6), 14) + bb; ee = RL(ee, 10); + bb = RL(bb + F5(cc,dd,ee) + X[ 3] + unchecked((int) 0x50a28be6), 12) + aa; dd = RL(dd, 10); + aa = RL(aa + F5(bb,cc,dd) + X[12] + unchecked((int) 0x50a28be6), 6) + ee; cc = RL(cc, 10); + + // + // Rounds 16-31 + // + // left + e = RL(e + F2(a,b,c) + X[ 7] + unchecked((int) 0x5a827999), 7) + d; b = RL(b, 10); + d = RL(d + F2(e,a,b) + X[ 4] + unchecked((int) 0x5a827999), 6) + c; a = RL(a, 10); + c = RL(c + F2(d,e,a) + X[13] + unchecked((int) 0x5a827999), 8) + b; e = RL(e, 10); + b = RL(b + F2(c,d,e) + X[ 1] + unchecked((int) 0x5a827999), 13) + a; d = RL(d, 10); + a = RL(a + F2(b,c,d) + X[10] + unchecked((int) 0x5a827999), 11) + e; c = RL(c, 10); + e = RL(e + F2(a,b,c) + X[ 6] + unchecked((int) 0x5a827999), 9) + d; b = RL(b, 10); + d = RL(d + F2(e,a,b) + X[15] + unchecked((int) 0x5a827999), 7) + c; a = RL(a, 10); + c = RL(c + F2(d,e,a) + X[ 3] + unchecked((int) 0x5a827999), 15) + b; e = RL(e, 10); + b = RL(b + F2(c,d,e) + X[12] + unchecked((int) 0x5a827999), 7) + a; d = RL(d, 10); + a = RL(a + F2(b,c,d) + X[ 0] + unchecked((int) 0x5a827999), 12) + e; c = RL(c, 10); + e = RL(e + F2(a,b,c) + X[ 9] + unchecked((int) 0x5a827999), 15) + d; b = RL(b, 10); + d = RL(d + F2(e,a,b) + X[ 5] + unchecked((int) 0x5a827999), 9) + c; a = RL(a, 10); + c = RL(c + F2(d,e,a) + X[ 2] + unchecked((int) 0x5a827999), 11) + b; e = RL(e, 10); + b = RL(b + F2(c,d,e) + X[14] + unchecked((int) 0x5a827999), 7) + a; d = RL(d, 10); + a = RL(a + F2(b,c,d) + X[11] + unchecked((int) 0x5a827999), 13) + e; c = RL(c, 10); + e = RL(e + F2(a,b,c) + X[ 8] + unchecked((int) 0x5a827999), 12) + d; b = RL(b, 10); + + // right + ee = RL(ee + F4(aa,bb,cc) + X[ 6] + unchecked((int) 0x5c4dd124), 9) + dd; bb = RL(bb, 10); + dd = RL(dd + F4(ee,aa,bb) + X[11] + unchecked((int) 0x5c4dd124), 13) + cc; aa = RL(aa, 10); + cc = RL(cc + F4(dd,ee,aa) + X[ 3] + unchecked((int) 0x5c4dd124), 15) + bb; ee = RL(ee, 10); + bb = RL(bb + F4(cc,dd,ee) + X[ 7] + unchecked((int) 0x5c4dd124), 7) + aa; dd = RL(dd, 10); + aa = RL(aa + F4(bb,cc,dd) + X[ 0] + unchecked((int) 0x5c4dd124), 12) + ee; cc = RL(cc, 10); + ee = RL(ee + F4(aa,bb,cc) + X[13] + unchecked((int) 0x5c4dd124), 8) + dd; bb = RL(bb, 10); + dd = RL(dd + F4(ee,aa,bb) + X[ 5] + unchecked((int) 0x5c4dd124), 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F4(dd,ee,aa) + X[10] + unchecked((int) 0x5c4dd124), 11) + bb; ee = RL(ee, 10); + bb = RL(bb + F4(cc,dd,ee) + X[14] + unchecked((int) 0x5c4dd124), 7) + aa; dd = RL(dd, 10); + aa = RL(aa + F4(bb,cc,dd) + X[15] + unchecked((int) 0x5c4dd124), 7) + ee; cc = RL(cc, 10); + ee = RL(ee + F4(aa,bb,cc) + X[ 8] + unchecked((int) 0x5c4dd124), 12) + dd; bb = RL(bb, 10); + dd = RL(dd + F4(ee,aa,bb) + X[12] + unchecked((int) 0x5c4dd124), 7) + cc; aa = RL(aa, 10); + cc = RL(cc + F4(dd,ee,aa) + X[ 4] + unchecked((int) 0x5c4dd124), 6) + bb; ee = RL(ee, 10); + bb = RL(bb + F4(cc,dd,ee) + X[ 9] + unchecked((int) 0x5c4dd124), 15) + aa; dd = RL(dd, 10); + aa = RL(aa + F4(bb,cc,dd) + X[ 1] + unchecked((int) 0x5c4dd124), 13) + ee; cc = RL(cc, 10); + ee = RL(ee + F4(aa,bb,cc) + X[ 2] + unchecked((int) 0x5c4dd124), 11) + dd; bb = RL(bb, 10); + + // + // Rounds 32-47 + // + // left + d = RL(d + F3(e,a,b) + X[ 3] + unchecked((int) 0x6ed9eba1), 11) + c; a = RL(a, 10); + c = RL(c + F3(d,e,a) + X[10] + unchecked((int) 0x6ed9eba1), 13) + b; e = RL(e, 10); + b = RL(b + F3(c,d,e) + X[14] + unchecked((int) 0x6ed9eba1), 6) + a; d = RL(d, 10); + a = RL(a + F3(b,c,d) + X[ 4] + unchecked((int) 0x6ed9eba1), 7) + e; c = RL(c, 10); + e = RL(e + F3(a,b,c) + X[ 9] + unchecked((int) 0x6ed9eba1), 14) + d; b = RL(b, 10); + d = RL(d + F3(e,a,b) + X[15] + unchecked((int) 0x6ed9eba1), 9) + c; a = RL(a, 10); + c = RL(c + F3(d,e,a) + X[ 8] + unchecked((int) 0x6ed9eba1), 13) + b; e = RL(e, 10); + b = RL(b + F3(c,d,e) + X[ 1] + unchecked((int) 0x6ed9eba1), 15) + a; d = RL(d, 10); + a = RL(a + F3(b,c,d) + X[ 2] + unchecked((int) 0x6ed9eba1), 14) + e; c = RL(c, 10); + e = RL(e + F3(a,b,c) + X[ 7] + unchecked((int) 0x6ed9eba1), 8) + d; b = RL(b, 10); + d = RL(d + F3(e,a,b) + X[ 0] + unchecked((int) 0x6ed9eba1), 13) + c; a = RL(a, 10); + c = RL(c + F3(d,e,a) + X[ 6] + unchecked((int) 0x6ed9eba1), 6) + b; e = RL(e, 10); + b = RL(b + F3(c,d,e) + X[13] + unchecked((int) 0x6ed9eba1), 5) + a; d = RL(d, 10); + a = RL(a + F3(b,c,d) + X[11] + unchecked((int) 0x6ed9eba1), 12) + e; c = RL(c, 10); + e = RL(e + F3(a,b,c) + X[ 5] + unchecked((int) 0x6ed9eba1), 7) + d; b = RL(b, 10); + d = RL(d + F3(e,a,b) + X[12] + unchecked((int) 0x6ed9eba1), 5) + c; a = RL(a, 10); + + // right + dd = RL(dd + F3(ee,aa,bb) + X[15] + unchecked((int) 0x6d703ef3), 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F3(dd,ee,aa) + X[ 5] + unchecked((int) 0x6d703ef3), 7) + bb; ee = RL(ee, 10); + bb = RL(bb + F3(cc,dd,ee) + X[ 1] + unchecked((int) 0x6d703ef3), 15) + aa; dd = RL(dd, 10); + aa = RL(aa + F3(bb,cc,dd) + X[ 3] + unchecked((int) 0x6d703ef3), 11) + ee; cc = RL(cc, 10); + ee = RL(ee + F3(aa,bb,cc) + X[ 7] + unchecked((int) 0x6d703ef3), 8) + dd; bb = RL(bb, 10); + dd = RL(dd + F3(ee,aa,bb) + X[14] + unchecked((int) 0x6d703ef3), 6) + cc; aa = RL(aa, 10); + cc = RL(cc + F3(dd,ee,aa) + X[ 6] + unchecked((int) 0x6d703ef3), 6) + bb; ee = RL(ee, 10); + bb = RL(bb + F3(cc,dd,ee) + X[ 9] + unchecked((int) 0x6d703ef3), 14) + aa; dd = RL(dd, 10); + aa = RL(aa + F3(bb,cc,dd) + X[11] + unchecked((int) 0x6d703ef3), 12) + ee; cc = RL(cc, 10); + ee = RL(ee + F3(aa,bb,cc) + X[ 8] + unchecked((int) 0x6d703ef3), 13) + dd; bb = RL(bb, 10); + dd = RL(dd + F3(ee,aa,bb) + X[12] + unchecked((int) 0x6d703ef3), 5) + cc; aa = RL(aa, 10); + cc = RL(cc + F3(dd,ee,aa) + X[ 2] + unchecked((int) 0x6d703ef3), 14) + bb; ee = RL(ee, 10); + bb = RL(bb + F3(cc,dd,ee) + X[10] + unchecked((int) 0x6d703ef3), 13) + aa; dd = RL(dd, 10); + aa = RL(aa + F3(bb,cc,dd) + X[ 0] + unchecked((int) 0x6d703ef3), 13) + ee; cc = RL(cc, 10); + ee = RL(ee + F3(aa,bb,cc) + X[ 4] + unchecked((int) 0x6d703ef3), 7) + dd; bb = RL(bb, 10); + dd = RL(dd + F3(ee,aa,bb) + X[13] + unchecked((int) 0x6d703ef3), 5) + cc; aa = RL(aa, 10); + + // + // Rounds 48-63 + // + // left + c = RL(c + F4(d,e,a) + X[ 1] + unchecked((int) 0x8f1bbcdc), 11) + b; e = RL(e, 10); + b = RL(b + F4(c,d,e) + X[ 9] + unchecked((int) 0x8f1bbcdc), 12) + a; d = RL(d, 10); + a = RL(a + F4(b,c,d) + X[11] + unchecked((int) 0x8f1bbcdc), 14) + e; c = RL(c, 10); + e = RL(e + F4(a,b,c) + X[10] + unchecked((int) 0x8f1bbcdc), 15) + d; b = RL(b, 10); + d = RL(d + F4(e,a,b) + X[ 0] + unchecked((int) 0x8f1bbcdc), 14) + c; a = RL(a, 10); + c = RL(c + F4(d,e,a) + X[ 8] + unchecked((int) 0x8f1bbcdc), 15) + b; e = RL(e, 10); + b = RL(b + F4(c,d,e) + X[12] + unchecked((int) 0x8f1bbcdc), 9) + a; d = RL(d, 10); + a = RL(a + F4(b,c,d) + X[ 4] + unchecked((int) 0x8f1bbcdc), 8) + e; c = RL(c, 10); + e = RL(e + F4(a,b,c) + X[13] + unchecked((int) 0x8f1bbcdc), 9) + d; b = RL(b, 10); + d = RL(d + F4(e,a,b) + X[ 3] + unchecked((int) 0x8f1bbcdc), 14) + c; a = RL(a, 10); + c = RL(c + F4(d,e,a) + X[ 7] + unchecked((int) 0x8f1bbcdc), 5) + b; e = RL(e, 10); + b = RL(b + F4(c,d,e) + X[15] + unchecked((int) 0x8f1bbcdc), 6) + a; d = RL(d, 10); + a = RL(a + F4(b,c,d) + X[14] + unchecked((int) 0x8f1bbcdc), 8) + e; c = RL(c, 10); + e = RL(e + F4(a,b,c) + X[ 5] + unchecked((int) 0x8f1bbcdc), 6) + d; b = RL(b, 10); + d = RL(d + F4(e,a,b) + X[ 6] + unchecked((int) 0x8f1bbcdc), 5) + c; a = RL(a, 10); + c = RL(c + F4(d,e,a) + X[ 2] + unchecked((int) 0x8f1bbcdc), 12) + b; e = RL(e, 10); + + // right + cc = RL(cc + F2(dd,ee,aa) + X[ 8] + unchecked((int) 0x7a6d76e9), 15) + bb; ee = RL(ee, 10); + bb = RL(bb + F2(cc,dd,ee) + X[ 6] + unchecked((int) 0x7a6d76e9), 5) + aa; dd = RL(dd, 10); + aa = RL(aa + F2(bb,cc,dd) + X[ 4] + unchecked((int) 0x7a6d76e9), 8) + ee; cc = RL(cc, 10); + ee = RL(ee + F2(aa,bb,cc) + X[ 1] + unchecked((int) 0x7a6d76e9), 11) + dd; bb = RL(bb, 10); + dd = RL(dd + F2(ee,aa,bb) + X[ 3] + unchecked((int) 0x7a6d76e9), 14) + cc; aa = RL(aa, 10); + cc = RL(cc + F2(dd,ee,aa) + X[11] + unchecked((int) 0x7a6d76e9), 14) + bb; ee = RL(ee, 10); + bb = RL(bb + F2(cc,dd,ee) + X[15] + unchecked((int) 0x7a6d76e9), 6) + aa; dd = RL(dd, 10); + aa = RL(aa + F2(bb,cc,dd) + X[ 0] + unchecked((int) 0x7a6d76e9), 14) + ee; cc = RL(cc, 10); + ee = RL(ee + F2(aa,bb,cc) + X[ 5] + unchecked((int) 0x7a6d76e9), 6) + dd; bb = RL(bb, 10); + dd = RL(dd + F2(ee,aa,bb) + X[12] + unchecked((int) 0x7a6d76e9), 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F2(dd,ee,aa) + X[ 2] + unchecked((int) 0x7a6d76e9), 12) + bb; ee = RL(ee, 10); + bb = RL(bb + F2(cc,dd,ee) + X[13] + unchecked((int) 0x7a6d76e9), 9) + aa; dd = RL(dd, 10); + aa = RL(aa + F2(bb,cc,dd) + X[ 9] + unchecked((int) 0x7a6d76e9), 12) + ee; cc = RL(cc, 10); + ee = RL(ee + F2(aa,bb,cc) + X[ 7] + unchecked((int) 0x7a6d76e9), 5) + dd; bb = RL(bb, 10); + dd = RL(dd + F2(ee,aa,bb) + X[10] + unchecked((int) 0x7a6d76e9), 15) + cc; aa = RL(aa, 10); + cc = RL(cc + F2(dd,ee,aa) + X[14] + unchecked((int) 0x7a6d76e9), 8) + bb; ee = RL(ee, 10); + + // + // Rounds 64-79 + // + // left + b = RL(b + F5(c,d,e) + X[ 4] + unchecked((int) 0xa953fd4e), 9) + a; d = RL(d, 10); + a = RL(a + F5(b,c,d) + X[ 0] + unchecked((int) 0xa953fd4e), 15) + e; c = RL(c, 10); + e = RL(e + F5(a,b,c) + X[ 5] + unchecked((int) 0xa953fd4e), 5) + d; b = RL(b, 10); + d = RL(d + F5(e,a,b) + X[ 9] + unchecked((int) 0xa953fd4e), 11) + c; a = RL(a, 10); + c = RL(c + F5(d,e,a) + X[ 7] + unchecked((int) 0xa953fd4e), 6) + b; e = RL(e, 10); + b = RL(b + F5(c,d,e) + X[12] + unchecked((int) 0xa953fd4e), 8) + a; d = RL(d, 10); + a = RL(a + F5(b,c,d) + X[ 2] + unchecked((int) 0xa953fd4e), 13) + e; c = RL(c, 10); + e = RL(e + F5(a,b,c) + X[10] + unchecked((int) 0xa953fd4e), 12) + d; b = RL(b, 10); + d = RL(d + F5(e,a,b) + X[14] + unchecked((int) 0xa953fd4e), 5) + c; a = RL(a, 10); + c = RL(c + F5(d,e,a) + X[ 1] + unchecked((int) 0xa953fd4e), 12) + b; e = RL(e, 10); + b = RL(b + F5(c,d,e) + X[ 3] + unchecked((int) 0xa953fd4e), 13) + a; d = RL(d, 10); + a = RL(a + F5(b,c,d) + X[ 8] + unchecked((int) 0xa953fd4e), 14) + e; c = RL(c, 10); + e = RL(e + F5(a,b,c) + X[11] + unchecked((int) 0xa953fd4e), 11) + d; b = RL(b, 10); + d = RL(d + F5(e,a,b) + X[ 6] + unchecked((int) 0xa953fd4e), 8) + c; a = RL(a, 10); + c = RL(c + F5(d,e,a) + X[15] + unchecked((int) 0xa953fd4e), 5) + b; e = RL(e, 10); + b = RL(b + F5(c,d,e) + X[13] + unchecked((int) 0xa953fd4e), 6) + a; d = RL(d, 10); + + // right + bb = RL(bb + F1(cc,dd,ee) + X[12], 8) + aa; dd = RL(dd, 10); + aa = RL(aa + F1(bb,cc,dd) + X[15], 5) + ee; cc = RL(cc, 10); + ee = RL(ee + F1(aa,bb,cc) + X[10], 12) + dd; bb = RL(bb, 10); + dd = RL(dd + F1(ee,aa,bb) + X[ 4], 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F1(dd,ee,aa) + X[ 1], 12) + bb; ee = RL(ee, 10); + bb = RL(bb + F1(cc,dd,ee) + X[ 5], 5) + aa; dd = RL(dd, 10); + aa = RL(aa + F1(bb,cc,dd) + X[ 8], 14) + ee; cc = RL(cc, 10); + ee = RL(ee + F1(aa,bb,cc) + X[ 7], 6) + dd; bb = RL(bb, 10); + dd = RL(dd + F1(ee,aa,bb) + X[ 6], 8) + cc; aa = RL(aa, 10); + cc = RL(cc + F1(dd,ee,aa) + X[ 2], 13) + bb; ee = RL(ee, 10); + bb = RL(bb + F1(cc,dd,ee) + X[13], 6) + aa; dd = RL(dd, 10); + aa = RL(aa + F1(bb,cc,dd) + X[14], 5) + ee; cc = RL(cc, 10); + ee = RL(ee + F1(aa,bb,cc) + X[ 0], 15) + dd; bb = RL(bb, 10); + dd = RL(dd + F1(ee,aa,bb) + X[ 3], 13) + cc; aa = RL(aa, 10); + cc = RL(cc + F1(dd,ee,aa) + X[ 9], 11) + bb; ee = RL(ee, 10); + bb = RL(bb + F1(cc,dd,ee) + X[11], 11) + aa; dd = RL(dd, 10); + + dd += c + H1; + H1 = H2 + d + ee; + H2 = H3 + e + aa; + H3 = H4 + a + bb; + H4 = H0 + b + cc; + H0 = dd; + + // + // reset the offset and clean out the word buffer. + // + xOff = 0; + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + public override IMemoable Copy() + { + return new RipeMD160Digest(this); + } + + public override void Reset(IMemoable other) + { + RipeMD160Digest d = (RipeMD160Digest)other; + + CopyIn(d); + } + + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD160Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD160Digest.cs.meta new file mode 100644 index 00000000..af408417 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD160Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 588720ec33ec63143abd90df75fee16e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD256Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD256Digest.cs new file mode 100644 index 00000000..8ecadd56 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD256Digest.cs @@ -0,0 +1,434 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /// + ///

Implementation of RipeMD256.

+ ///

Note: this algorithm offers the same level of security as RipeMD128.

+ ///
+ public class RipeMD256Digest + : GeneralDigest + { + public override string AlgorithmName + { + get { return "RIPEMD256"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + private const int DigestLength = 32; + + private int H0, H1, H2, H3, H4, H5, H6, H7; // IV's + + private int[] X = new int[16]; + private int xOff; + + /// Standard constructor + public RipeMD256Digest() + { + Reset(); + } + + /// Copy constructor. This will copy the state of the provided + /// message digest. + /// + public RipeMD256Digest(RipeMD256Digest t):base(t) + { + CopyIn(t); + } + + private void CopyIn(RipeMD256Digest t) + { + base.CopyIn(t); + + H0 = t.H0; + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + H4 = t.H4; + H5 = t.H5; + H6 = t.H6; + H7 = t.H7; + + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + } + + internal override void ProcessWord( + byte[] input, + int inOff) + { + X[xOff++] = (input[inOff] & 0xff) | ((input[inOff + 1] & 0xff) << 8) + | ((input[inOff + 2] & 0xff) << 16) | ((input[inOff + 3] & 0xff) << 24); + + if (xOff == 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength( + long bitLength) + { + if (xOff > 14) + { + ProcessBlock(); + } + + X[14] = (int)(bitLength & 0xffffffff); + X[15] = (int)((ulong)bitLength >> 32); + } + + private void UnpackWord( + int word, + byte[] outBytes, + int outOff) + { + outBytes[outOff] = (byte)(uint)word; + outBytes[outOff + 1] = (byte)((uint)word >> 8); + outBytes[outOff + 2] = (byte)((uint)word >> 16); + outBytes[outOff + 3] = (byte)((uint)word >> 24); + } + + public override int DoFinal(byte[] output, int outOff) + { + Finish(); + + UnpackWord(H0, output, outOff); + UnpackWord(H1, output, outOff + 4); + UnpackWord(H2, output, outOff + 8); + UnpackWord(H3, output, outOff + 12); + UnpackWord(H4, output, outOff + 16); + UnpackWord(H5, output, outOff + 20); + UnpackWord(H6, output, outOff + 24); + UnpackWord(H7, output, outOff + 28); + + Reset(); + + return DigestLength; + } + + /// reset the chaining variables to the IV values. + public override void Reset() + { + base.Reset(); + + H0 = unchecked((int)0x67452301); + H1 = unchecked((int)0xefcdab89); + H2 = unchecked((int)0x98badcfe); + H3 = unchecked((int)0x10325476); + H4 = unchecked((int)0x76543210); + H5 = unchecked((int)0xFEDCBA98); + H6 = unchecked((int)0x89ABCDEF); + H7 = unchecked((int)0x01234567); + + xOff = 0; + + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + /* + * rotate int x left n bits. + */ + private int RL( + int x, + int n) + { + return (x << n) | (int)((uint)x >> (32 - n)); + } + + /* + * f1,f2,f3,f4 are the basic RipeMD128 functions. + */ + + /* + * F + */ + private int F1(int x, int y, int z) + { + return x ^ y ^ z; + } + + /* + * G + */ + private int F2(int x, int y, int z) + { + return (x & y) | (~ x & z); + } + + /* + * H + */ + private int F3(int x, int y, int z) + { + return (x | ~ y) ^ z; + } + + /* + * I + */ + private int F4(int x, int y, int z) + { + return (x & z) | (y & ~ z); + } + + private int F1(int a, int b, int c, int d, int x, int s) + { + return RL(a + F1(b, c, d) + x, s); + } + + private int F2(int a, int b, int c, int d, int x, int s) + { + return RL(a + F2(b, c, d) + x + unchecked((int)0x5a827999), s); + } + + private int F3(int a, int b, int c, int d, int x, int s) + { + return RL(a + F3(b, c, d) + x + unchecked((int)0x6ed9eba1), s); + } + + private int F4(int a, int b, int c, int d, int x, int s) + { + return RL(a + F4(b, c, d) + x + unchecked((int)0x8f1bbcdc), s); + } + + private int FF1(int a, int b, int c, int d, int x, int s) + { + return RL(a + F1(b, c, d) + x, s); + } + + private int FF2(int a, int b, int c, int d, int x, int s) + { + return RL(a + F2(b, c, d) + x + unchecked((int)0x6d703ef3), s); + } + + private int FF3(int a, int b, int c, int d, int x, int s) + { + return RL(a + F3(b, c, d) + x + unchecked((int)0x5c4dd124), s); + } + + private int FF4(int a, int b, int c, int d, int x, int s) + { + return RL(a + F4(b, c, d) + x + unchecked((int)0x50a28be6), s); + } + + internal override void ProcessBlock() + { + int a, aa; + int b, bb; + int c, cc; + int d, dd; + int t; + + a = H0; + b = H1; + c = H2; + d = H3; + aa = H4; + bb = H5; + cc = H6; + dd = H7; + + // + // Round 1 + // + + a = F1(a, b, c, d, X[0], 11); + d = F1(d, a, b, c, X[1], 14); + c = F1(c, d, a, b, X[2], 15); + b = F1(b, c, d, a, X[3], 12); + a = F1(a, b, c, d, X[4], 5); + d = F1(d, a, b, c, X[5], 8); + c = F1(c, d, a, b, X[6], 7); + b = F1(b, c, d, a, X[7], 9); + a = F1(a, b, c, d, X[8], 11); + d = F1(d, a, b, c, X[9], 13); + c = F1(c, d, a, b, X[10], 14); + b = F1(b, c, d, a, X[11], 15); + a = F1(a, b, c, d, X[12], 6); + d = F1(d, a, b, c, X[13], 7); + c = F1(c, d, a, b, X[14], 9); + b = F1(b, c, d, a, X[15], 8); + + aa = FF4(aa, bb, cc, dd, X[5], 8); + dd = FF4(dd, aa, bb, cc, X[14], 9); + cc = FF4(cc, dd, aa, bb, X[7], 9); + bb = FF4(bb, cc, dd, aa, X[0], 11); + aa = FF4(aa, bb, cc, dd, X[9], 13); + dd = FF4(dd, aa, bb, cc, X[2], 15); + cc = FF4(cc, dd, aa, bb, X[11], 15); + bb = FF4(bb, cc, dd, aa, X[4], 5); + aa = FF4(aa, bb, cc, dd, X[13], 7); + dd = FF4(dd, aa, bb, cc, X[6], 7); + cc = FF4(cc, dd, aa, bb, X[15], 8); + bb = FF4(bb, cc, dd, aa, X[8], 11); + aa = FF4(aa, bb, cc, dd, X[1], 14); + dd = FF4(dd, aa, bb, cc, X[10], 14); + cc = FF4(cc, dd, aa, bb, X[3], 12); + bb = FF4(bb, cc, dd, aa, X[12], 6); + + t = a; a = aa; aa = t; + + // + // Round 2 + // + a = F2(a, b, c, d, X[7], 7); + d = F2(d, a, b, c, X[4], 6); + c = F2(c, d, a, b, X[13], 8); + b = F2(b, c, d, a, X[1], 13); + a = F2(a, b, c, d, X[10], 11); + d = F2(d, a, b, c, X[6], 9); + c = F2(c, d, a, b, X[15], 7); + b = F2(b, c, d, a, X[3], 15); + a = F2(a, b, c, d, X[12], 7); + d = F2(d, a, b, c, X[0], 12); + c = F2(c, d, a, b, X[9], 15); + b = F2(b, c, d, a, X[5], 9); + a = F2(a, b, c, d, X[2], 11); + d = F2(d, a, b, c, X[14], 7); + c = F2(c, d, a, b, X[11], 13); + b = F2(b, c, d, a, X[8], 12); + + aa = FF3(aa, bb, cc, dd, X[6], 9); + dd = FF3(dd, aa, bb, cc, X[11], 13); + cc = FF3(cc, dd, aa, bb, X[3], 15); + bb = FF3(bb, cc, dd, aa, X[7], 7); + aa = FF3(aa, bb, cc, dd, X[0], 12); + dd = FF3(dd, aa, bb, cc, X[13], 8); + cc = FF3(cc, dd, aa, bb, X[5], 9); + bb = FF3(bb, cc, dd, aa, X[10], 11); + aa = FF3(aa, bb, cc, dd, X[14], 7); + dd = FF3(dd, aa, bb, cc, X[15], 7); + cc = FF3(cc, dd, aa, bb, X[8], 12); + bb = FF3(bb, cc, dd, aa, X[12], 7); + aa = FF3(aa, bb, cc, dd, X[4], 6); + dd = FF3(dd, aa, bb, cc, X[9], 15); + cc = FF3(cc, dd, aa, bb, X[1], 13); + bb = FF3(bb, cc, dd, aa, X[2], 11); + + t = b; b = bb; bb = t; + + // + // Round 3 + // + a = F3(a, b, c, d, X[3], 11); + d = F3(d, a, b, c, X[10], 13); + c = F3(c, d, a, b, X[14], 6); + b = F3(b, c, d, a, X[4], 7); + a = F3(a, b, c, d, X[9], 14); + d = F3(d, a, b, c, X[15], 9); + c = F3(c, d, a, b, X[8], 13); + b = F3(b, c, d, a, X[1], 15); + a = F3(a, b, c, d, X[2], 14); + d = F3(d, a, b, c, X[7], 8); + c = F3(c, d, a, b, X[0], 13); + b = F3(b, c, d, a, X[6], 6); + a = F3(a, b, c, d, X[13], 5); + d = F3(d, a, b, c, X[11], 12); + c = F3(c, d, a, b, X[5], 7); + b = F3(b, c, d, a, X[12], 5); + + aa = FF2(aa, bb, cc, dd, X[15], 9); + dd = FF2(dd, aa, bb, cc, X[5], 7); + cc = FF2(cc, dd, aa, bb, X[1], 15); + bb = FF2(bb, cc, dd, aa, X[3], 11); + aa = FF2(aa, bb, cc, dd, X[7], 8); + dd = FF2(dd, aa, bb, cc, X[14], 6); + cc = FF2(cc, dd, aa, bb, X[6], 6); + bb = FF2(bb, cc, dd, aa, X[9], 14); + aa = FF2(aa, bb, cc, dd, X[11], 12); + dd = FF2(dd, aa, bb, cc, X[8], 13); + cc = FF2(cc, dd, aa, bb, X[12], 5); + bb = FF2(bb, cc, dd, aa, X[2], 14); + aa = FF2(aa, bb, cc, dd, X[10], 13); + dd = FF2(dd, aa, bb, cc, X[0], 13); + cc = FF2(cc, dd, aa, bb, X[4], 7); + bb = FF2(bb, cc, dd, aa, X[13], 5); + + t = c; c = cc; cc = t; + + // + // Round 4 + // + a = F4(a, b, c, d, X[1], 11); + d = F4(d, a, b, c, X[9], 12); + c = F4(c, d, a, b, X[11], 14); + b = F4(b, c, d, a, X[10], 15); + a = F4(a, b, c, d, X[0], 14); + d = F4(d, a, b, c, X[8], 15); + c = F4(c, d, a, b, X[12], 9); + b = F4(b, c, d, a, X[4], 8); + a = F4(a, b, c, d, X[13], 9); + d = F4(d, a, b, c, X[3], 14); + c = F4(c, d, a, b, X[7], 5); + b = F4(b, c, d, a, X[15], 6); + a = F4(a, b, c, d, X[14], 8); + d = F4(d, a, b, c, X[5], 6); + c = F4(c, d, a, b, X[6], 5); + b = F4(b, c, d, a, X[2], 12); + + aa = FF1(aa, bb, cc, dd, X[8], 15); + dd = FF1(dd, aa, bb, cc, X[6], 5); + cc = FF1(cc, dd, aa, bb, X[4], 8); + bb = FF1(bb, cc, dd, aa, X[1], 11); + aa = FF1(aa, bb, cc, dd, X[3], 14); + dd = FF1(dd, aa, bb, cc, X[11], 14); + cc = FF1(cc, dd, aa, bb, X[15], 6); + bb = FF1(bb, cc, dd, aa, X[0], 14); + aa = FF1(aa, bb, cc, dd, X[5], 6); + dd = FF1(dd, aa, bb, cc, X[12], 9); + cc = FF1(cc, dd, aa, bb, X[2], 12); + bb = FF1(bb, cc, dd, aa, X[13], 9); + aa = FF1(aa, bb, cc, dd, X[9], 12); + dd = FF1(dd, aa, bb, cc, X[7], 5); + cc = FF1(cc, dd, aa, bb, X[10], 15); + bb = FF1(bb, cc, dd, aa, X[14], 8); + + t = d; d = dd; dd = t; + + H0 += a; + H1 += b; + H2 += c; + H3 += d; + H4 += aa; + H5 += bb; + H6 += cc; + H7 += dd; + + // + // reset the offset and clean out the word buffer. + // + xOff = 0; + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + public override IMemoable Copy() + { + return new RipeMD256Digest(this); + } + + public override void Reset(IMemoable other) + { + RipeMD256Digest d = (RipeMD256Digest)other; + + CopyIn(d); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD256Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD256Digest.cs.meta new file mode 100644 index 00000000..ed6da8c2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD256Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf8ef59bb0f190a478b67b9040e142f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD320Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD320Digest.cs new file mode 100644 index 00000000..ebe9c478 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD320Digest.cs @@ -0,0 +1,463 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /// + ///

Implementation of RipeMD 320.

+ ///

Note: this algorithm offers the same level of security as RipeMD160.

+ ///
+ public class RipeMD320Digest + : GeneralDigest + { + public override string AlgorithmName + { + get { return "RIPEMD320"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + private const int DigestLength = 40; + + private int H0, H1, H2, H3, H4, H5, H6, H7, H8, H9; // IV's + + private int[] X = new int[16]; + private int xOff; + + /// Standard constructor + public RipeMD320Digest() + { + Reset(); + } + + /// Copy constructor. This will copy the state of the provided + /// message digest. + /// + public RipeMD320Digest(RipeMD320Digest t) + : base(t) + { + CopyIn(t); + } + + private void CopyIn(RipeMD320Digest t) + { + base.CopyIn(t); + + H0 = t.H0; + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + H4 = t.H4; + H5 = t.H5; + H6 = t.H6; + H7 = t.H7; + H8 = t.H8; + H9 = t.H9; + + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + } + + internal override void ProcessWord( + byte[] input, + int inOff) + { + X[xOff++] = (input[inOff] & 0xff) | ((input[inOff + 1] & 0xff) << 8) + | ((input[inOff + 2] & 0xff) << 16) | ((input[inOff + 3] & 0xff) << 24); + + if (xOff == 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength( + long bitLength) + { + if (xOff > 14) + { + ProcessBlock(); + } + + X[14] = (int)(bitLength & 0xffffffff); + X[15] = (int)((ulong)bitLength >> 32); + } + + private void UnpackWord( + int word, + byte[] outBytes, + int outOff) + { + outBytes[outOff] = (byte)word; + outBytes[outOff + 1] = (byte)((uint)word >> 8); + outBytes[outOff + 2] = (byte)((uint)word >> 16); + outBytes[outOff + 3] = (byte)((uint)word >> 24); + } + + public override int DoFinal(byte[] output, int outOff) + { + Finish(); + + UnpackWord(H0, output, outOff); + UnpackWord(H1, output, outOff + 4); + UnpackWord(H2, output, outOff + 8); + UnpackWord(H3, output, outOff + 12); + UnpackWord(H4, output, outOff + 16); + UnpackWord(H5, output, outOff + 20); + UnpackWord(H6, output, outOff + 24); + UnpackWord(H7, output, outOff + 28); + UnpackWord(H8, output, outOff + 32); + UnpackWord(H9, output, outOff + 36); + + Reset(); + + return DigestLength; + } + + /// reset the chaining variables to the IV values. + public override void Reset() + { + base.Reset(); + + H0 = unchecked((int) 0x67452301); + H1 = unchecked((int) 0xefcdab89); + H2 = unchecked((int) 0x98badcfe); + H3 = unchecked((int) 0x10325476); + H4 = unchecked((int) 0xc3d2e1f0); + H5 = unchecked((int) 0x76543210); + H6 = unchecked((int) 0xFEDCBA98); + H7 = unchecked((int) 0x89ABCDEF); + H8 = unchecked((int) 0x01234567); + H9 = unchecked((int) 0x3C2D1E0F); + + xOff = 0; + + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + /* + * rotate int x left n bits. + */ + private int RL( + int x, + int n) + { + return (x << n) | (int)(((uint)x) >> (32 - n)); + } + + /* + * f1,f2,f3,f4,f5 are the basic RipeMD160 functions. + */ + + /* + * rounds 0-15 + */ + private int F1(int x, int y, int z) + { + return x ^ y ^ z; + } + + /* + * rounds 16-31 + */ + private int F2(int x, int y, int z) + { + return (x & y) | (~ x & z); + } + + /* + * rounds 32-47 + */ + private int F3(int x, int y, int z) + { + return (x | ~ y) ^ z; + } + + /* + * rounds 48-63 + */ + private int F4(int x, int y, int z) + { + return (x & z) | (y & ~ z); + } + + /* + * rounds 64-79 + */ + private int F5(int x, int y, int z) + { + return x ^ (y | ~z); + } + + internal override void ProcessBlock() + { + int a, aa; + int b, bb; + int c, cc; + int d, dd; + int e, ee; + int t; + + a = H0; + b = H1; + c = H2; + d = H3; + e = H4; + aa = H5; + bb = H6; + cc = H7; + dd = H8; + ee = H9; + + // + // Rounds 1 - 16 + // + // left + a = RL(a + F1(b, c, d) + X[0], 11) + e; c = RL(c, 10); + e = RL(e + F1(a, b, c) + X[1], 14) + d; b = RL(b, 10); + d = RL(d + F1(e, a, b) + X[2], 15) + c; a = RL(a, 10); + c = RL(c + F1(d, e, a) + X[3], 12) + b; e = RL(e, 10); + b = RL(b + F1(c, d, e) + X[4], 5) + a; d = RL(d, 10); + a = RL(a + F1(b, c, d) + X[5], 8) + e; c = RL(c, 10); + e = RL(e + F1(a, b, c) + X[6], 7) + d; b = RL(b, 10); + d = RL(d + F1(e, a, b) + X[7], 9) + c; a = RL(a, 10); + c = RL(c + F1(d, e, a) + X[8], 11) + b; e = RL(e, 10); + b = RL(b + F1(c, d, e) + X[9], 13) + a; d = RL(d, 10); + a = RL(a + F1(b, c, d) + X[10], 14) + e; c = RL(c, 10); + e = RL(e + F1(a, b, c) + X[11], 15) + d; b = RL(b, 10); + d = RL(d + F1(e, a, b) + X[12], 6) + c; a = RL(a, 10); + c = RL(c + F1(d, e, a) + X[13], 7) + b; e = RL(e, 10); + b = RL(b + F1(c, d, e) + X[14], 9) + a; d = RL(d, 10); + a = RL(a + F1(b, c, d) + X[15], 8) + e; c = RL(c, 10); + + // right + aa = RL(aa + F5(bb, cc, dd) + X[5] + unchecked((int)0x50a28be6), 8) + ee; cc = RL(cc, 10); + ee = RL(ee + F5(aa, bb, cc) + X[14] + unchecked((int)0x50a28be6), 9) + dd; bb = RL(bb, 10); + dd = RL(dd + F5(ee, aa, bb) + X[7] + unchecked((int)0x50a28be6), 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F5(dd, ee, aa) + X[0] + unchecked((int)0x50a28be6), 11) + bb; ee = RL(ee, 10); + bb = RL(bb + F5(cc, dd, ee) + X[9] + unchecked((int)0x50a28be6), 13) + aa; dd = RL(dd, 10); + aa = RL(aa + F5(bb, cc, dd) + X[2] + unchecked((int)0x50a28be6), 15) + ee; cc = RL(cc, 10); + ee = RL(ee + F5(aa, bb, cc) + X[11] + unchecked((int)0x50a28be6), 15) + dd; bb = RL(bb, 10); + dd = RL(dd + F5(ee, aa, bb) + X[4] + unchecked((int)0x50a28be6), 5) + cc; aa = RL(aa, 10); + cc = RL(cc + F5(dd, ee, aa) + X[13] + unchecked((int)0x50a28be6), 7) + bb; ee = RL(ee, 10); + bb = RL(bb + F5(cc, dd, ee) + X[6] + unchecked((int)0x50a28be6), 7) + aa; dd = RL(dd, 10); + aa = RL(aa + F5(bb, cc, dd) + X[15] + unchecked((int)0x50a28be6), 8) + ee; cc = RL(cc, 10); + ee = RL(ee + F5(aa, bb, cc) + X[8] + unchecked((int)0x50a28be6), 11) + dd; bb = RL(bb, 10); + dd = RL(dd + F5(ee, aa, bb) + X[1] + unchecked((int)0x50a28be6), 14) + cc; aa = RL(aa, 10); + cc = RL(cc + F5(dd, ee, aa) + X[10] + unchecked((int)0x50a28be6), 14) + bb; ee = RL(ee, 10); + bb = RL(bb + F5(cc, dd, ee) + X[3] + unchecked((int)0x50a28be6), 12) + aa; dd = RL(dd, 10); + aa = RL(aa + F5(bb, cc, dd) + X[12] + unchecked((int)0x50a28be6), 6) + ee; cc = RL(cc, 10); + + t = a; a = aa; aa = t; + // + // Rounds 16-31 + // + // left + e = RL(e + F2(a, b, c) + X[7] + unchecked((int)0x5a827999), 7) + d; b = RL(b, 10); + d = RL(d + F2(e, a, b) + X[4] + unchecked((int)0x5a827999), 6) + c; a = RL(a, 10); + c = RL(c + F2(d, e, a) + X[13] + unchecked((int)0x5a827999), 8) + b; e = RL(e, 10); + b = RL(b + F2(c, d, e) + X[1] + unchecked((int)0x5a827999), 13) + a; d = RL(d, 10); + a = RL(a + F2(b, c, d) + X[10] + unchecked((int)0x5a827999), 11) + e; c = RL(c, 10); + e = RL(e + F2(a, b, c) + X[6] + unchecked((int)0x5a827999), 9) + d; b = RL(b, 10); + d = RL(d + F2(e, a, b) + X[15] + unchecked((int)0x5a827999), 7) + c; a = RL(a, 10); + c = RL(c + F2(d, e, a) + X[3] + unchecked((int)0x5a827999), 15) + b; e = RL(e, 10); + b = RL(b + F2(c, d, e) + X[12] + unchecked((int)0x5a827999), 7) + a; d = RL(d, 10); + a = RL(a + F2(b, c, d) + X[0] + unchecked((int)0x5a827999), 12) + e; c = RL(c, 10); + e = RL(e + F2(a, b, c) + X[9] + unchecked((int)0x5a827999), 15) + d; b = RL(b, 10); + d = RL(d + F2(e, a, b) + X[5] + unchecked((int)0x5a827999), 9) + c; a = RL(a, 10); + c = RL(c + F2(d, e, a) + X[2] + unchecked((int)0x5a827999), 11) + b; e = RL(e, 10); + b = RL(b + F2(c, d, e) + X[14] + unchecked((int)0x5a827999), 7) + a; d = RL(d, 10); + a = RL(a + F2(b, c, d) + X[11] + unchecked((int)0x5a827999), 13) + e; c = RL(c, 10); + e = RL(e + F2(a, b, c) + X[8] + unchecked((int)0x5a827999), 12) + d; b = RL(b, 10); + + // right + ee = RL(ee + F4(aa, bb, cc) + X[6] + unchecked((int)0x5c4dd124), 9) + dd; bb = RL(bb, 10); + dd = RL(dd + F4(ee, aa, bb) + X[11] + unchecked((int)0x5c4dd124), 13) + cc; aa = RL(aa, 10); + cc = RL(cc + F4(dd, ee, aa) + X[3] + unchecked((int)0x5c4dd124), 15) + bb; ee = RL(ee, 10); + bb = RL(bb + F4(cc, dd, ee) + X[7] + unchecked((int)0x5c4dd124), 7) + aa; dd = RL(dd, 10); + aa = RL(aa + F4(bb, cc, dd) + X[0] + unchecked((int)0x5c4dd124), 12) + ee; cc = RL(cc, 10); + ee = RL(ee + F4(aa, bb, cc) + X[13] + unchecked((int)0x5c4dd124), 8) + dd; bb = RL(bb, 10); + dd = RL(dd + F4(ee, aa, bb) + X[5] + unchecked((int)0x5c4dd124), 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F4(dd, ee, aa) + X[10] + unchecked((int)0x5c4dd124), 11) + bb; ee = RL(ee, 10); + bb = RL(bb + F4(cc, dd, ee) + X[14] + unchecked((int)0x5c4dd124), 7) + aa; dd = RL(dd, 10); + aa = RL(aa + F4(bb, cc, dd) + X[15] + unchecked((int)0x5c4dd124), 7) + ee; cc = RL(cc, 10); + ee = RL(ee + F4(aa, bb, cc) + X[8] + unchecked((int)0x5c4dd124), 12) + dd; bb = RL(bb, 10); + dd = RL(dd + F4(ee, aa, bb) + X[12] + unchecked((int)0x5c4dd124), 7) + cc; aa = RL(aa, 10); + cc = RL(cc + F4(dd, ee, aa) + X[4] + unchecked((int)0x5c4dd124), 6) + bb; ee = RL(ee, 10); + bb = RL(bb + F4(cc, dd, ee) + X[9] + unchecked((int)0x5c4dd124), 15) + aa; dd = RL(dd, 10); + aa = RL(aa + F4(bb, cc, dd) + X[1] + unchecked((int)0x5c4dd124), 13) + ee; cc = RL(cc, 10); + ee = RL(ee + F4(aa, bb, cc) + X[2] + unchecked((int)0x5c4dd124), 11) + dd; bb = RL(bb, 10); + + t = b; b = bb; bb = t; + + // + // Rounds 32-47 + // + // left + d = RL(d + F3(e, a, b) + X[3] + unchecked((int)0x6ed9eba1), 11) + c; a = RL(a, 10); + c = RL(c + F3(d, e, a) + X[10] + unchecked((int)0x6ed9eba1), 13) + b; e = RL(e, 10); + b = RL(b + F3(c, d, e) + X[14] + unchecked((int)0x6ed9eba1), 6) + a; d = RL(d, 10); + a = RL(a + F3(b, c, d) + X[4] + unchecked((int)0x6ed9eba1), 7) + e; c = RL(c, 10); + e = RL(e + F3(a, b, c) + X[9] + unchecked((int)0x6ed9eba1), 14) + d; b = RL(b, 10); + d = RL(d + F3(e, a, b) + X[15] + unchecked((int)0x6ed9eba1), 9) + c; a = RL(a, 10); + c = RL(c + F3(d, e, a) + X[8] + unchecked((int)0x6ed9eba1), 13) + b; e = RL(e, 10); + b = RL(b + F3(c, d, e) + X[1] + unchecked((int)0x6ed9eba1), 15) + a; d = RL(d, 10); + a = RL(a + F3(b, c, d) + X[2] + unchecked((int)0x6ed9eba1), 14) + e; c = RL(c, 10); + e = RL(e + F3(a, b, c) + X[7] + unchecked((int)0x6ed9eba1), 8) + d; b = RL(b, 10); + d = RL(d + F3(e, a, b) + X[0] + unchecked((int)0x6ed9eba1), 13) + c; a = RL(a, 10); + c = RL(c + F3(d, e, a) + X[6] + unchecked((int)0x6ed9eba1), 6) + b; e = RL(e, 10); + b = RL(b + F3(c, d, e) + X[13] + unchecked((int)0x6ed9eba1), 5) + a; d = RL(d, 10); + a = RL(a + F3(b, c, d) + X[11] + unchecked((int)0x6ed9eba1), 12) + e; c = RL(c, 10); + e = RL(e + F3(a, b, c) + X[5] + unchecked((int)0x6ed9eba1), 7) + d; b = RL(b, 10); + d = RL(d + F3(e, a, b) + X[12] + unchecked((int)0x6ed9eba1), 5) + c; a = RL(a, 10); + + // right + dd = RL(dd + F3(ee, aa, bb) + X[15] + unchecked((int)0x6d703ef3), 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F3(dd, ee, aa) + X[5] + unchecked((int)0x6d703ef3), 7) + bb; ee = RL(ee, 10); + bb = RL(bb + F3(cc, dd, ee) + X[1] + unchecked((int)0x6d703ef3), 15) + aa; dd = RL(dd, 10); + aa = RL(aa + F3(bb, cc, dd) + X[3] + unchecked((int)0x6d703ef3), 11) + ee; cc = RL(cc, 10); + ee = RL(ee + F3(aa, bb, cc) + X[7] + unchecked((int)0x6d703ef3), 8) + dd; bb = RL(bb, 10); + dd = RL(dd + F3(ee, aa, bb) + X[14] + unchecked((int)0x6d703ef3), 6) + cc; aa = RL(aa, 10); + cc = RL(cc + F3(dd, ee, aa) + X[6] + unchecked((int)0x6d703ef3), 6) + bb; ee = RL(ee, 10); + bb = RL(bb + F3(cc, dd, ee) + X[9] + unchecked((int)0x6d703ef3), 14) + aa; dd = RL(dd, 10); + aa = RL(aa + F3(bb, cc, dd) + X[11] + unchecked((int)0x6d703ef3), 12) + ee; cc = RL(cc, 10); + ee = RL(ee + F3(aa, bb, cc) + X[8] + unchecked((int)0x6d703ef3), 13) + dd; bb = RL(bb, 10); + dd = RL(dd + F3(ee, aa, bb) + X[12] + unchecked((int)0x6d703ef3), 5) + cc; aa = RL(aa, 10); + cc = RL(cc + F3(dd, ee, aa) + X[2] + unchecked((int)0x6d703ef3), 14) + bb; ee = RL(ee, 10); + bb = RL(bb + F3(cc, dd, ee) + X[10] + unchecked((int)0x6d703ef3), 13) + aa; dd = RL(dd, 10); + aa = RL(aa + F3(bb, cc, dd) + X[0] + unchecked((int)0x6d703ef3), 13) + ee; cc = RL(cc, 10); + ee = RL(ee + F3(aa, bb, cc) + X[4] + unchecked((int)0x6d703ef3), 7) + dd; bb = RL(bb, 10); + dd = RL(dd + F3(ee, aa, bb) + X[13] + unchecked((int)0x6d703ef3), 5) + cc; aa = RL(aa, 10); + + t = c; c = cc; cc = t; + + // + // Rounds 48-63 + // + // left + c = RL(c + F4(d, e, a) + X[1] + unchecked((int)0x8f1bbcdc), 11) + b; e = RL(e, 10); + b = RL(b + F4(c, d, e) + X[9] + unchecked((int)0x8f1bbcdc), 12) + a; d = RL(d, 10); + a = RL(a + F4(b, c, d) + X[11] + unchecked((int)0x8f1bbcdc), 14) + e; c = RL(c, 10); + e = RL(e + F4(a, b, c) + X[10] + unchecked((int)0x8f1bbcdc), 15) + d; b = RL(b, 10); + d = RL(d + F4(e, a, b) + X[0] + unchecked((int)0x8f1bbcdc), 14) + c; a = RL(a, 10); + c = RL(c + F4(d, e, a) + X[8] + unchecked((int)0x8f1bbcdc), 15) + b; e = RL(e, 10); + b = RL(b + F4(c, d, e) + X[12] + unchecked((int)0x8f1bbcdc), 9) + a; d = RL(d, 10); + a = RL(a + F4(b, c, d) + X[4] + unchecked((int)0x8f1bbcdc), 8) + e; c = RL(c, 10); + e = RL(e + F4(a, b, c) + X[13] + unchecked((int)0x8f1bbcdc), 9) + d; b = RL(b, 10); + d = RL(d + F4(e, a, b) + X[3] + unchecked((int)0x8f1bbcdc), 14) + c; a = RL(a, 10); + c = RL(c + F4(d, e, a) + X[7] + unchecked((int)0x8f1bbcdc), 5) + b; e = RL(e, 10); + b = RL(b + F4(c, d, e) + X[15] + unchecked((int)0x8f1bbcdc), 6) + a; d = RL(d, 10); + a = RL(a + F4(b, c, d) + X[14] + unchecked((int)0x8f1bbcdc), 8) + e; c = RL(c, 10); + e = RL(e + F4(a, b, c) + X[5] + unchecked((int)0x8f1bbcdc), 6) + d; b = RL(b, 10); + d = RL(d + F4(e, a, b) + X[6] + unchecked((int)0x8f1bbcdc), 5) + c; a = RL(a, 10); + c = RL(c + F4(d, e, a) + X[2] + unchecked((int)0x8f1bbcdc), 12) + b; e = RL(e, 10); + + // right + cc = RL(cc + F2(dd, ee, aa) + X[8] + unchecked((int)0x7a6d76e9), 15) + bb; ee = RL(ee, 10); + bb = RL(bb + F2(cc, dd, ee) + X[6] + unchecked((int)0x7a6d76e9), 5) + aa; dd = RL(dd, 10); + aa = RL(aa + F2(bb, cc, dd) + X[4] + unchecked((int)0x7a6d76e9), 8) + ee; cc = RL(cc, 10); + ee = RL(ee + F2(aa, bb, cc) + X[1] + unchecked((int)0x7a6d76e9), 11) + dd; bb = RL(bb, 10); + dd = RL(dd + F2(ee, aa, bb) + X[3] + unchecked((int)0x7a6d76e9), 14) + cc; aa = RL(aa, 10); + cc = RL(cc + F2(dd, ee, aa) + X[11] + unchecked((int)0x7a6d76e9), 14) + bb; ee = RL(ee, 10); + bb = RL(bb + F2(cc, dd, ee) + X[15] + unchecked((int)0x7a6d76e9), 6) + aa; dd = RL(dd, 10); + aa = RL(aa + F2(bb, cc, dd) + X[0] + unchecked((int)0x7a6d76e9), 14) + ee; cc = RL(cc, 10); + ee = RL(ee + F2(aa, bb, cc) + X[5] + unchecked((int)0x7a6d76e9), 6) + dd; bb = RL(bb, 10); + dd = RL(dd + F2(ee, aa, bb) + X[12] + unchecked((int)0x7a6d76e9), 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F2(dd, ee, aa) + X[2] + unchecked((int)0x7a6d76e9), 12) + bb; ee = RL(ee, 10); + bb = RL(bb + F2(cc, dd, ee) + X[13] + unchecked((int)0x7a6d76e9), 9) + aa; dd = RL(dd, 10); + aa = RL(aa + F2(bb, cc, dd) + X[9] + unchecked((int)0x7a6d76e9), 12) + ee; cc = RL(cc, 10); + ee = RL(ee + F2(aa, bb, cc) + X[7] + unchecked((int)0x7a6d76e9), 5) + dd; bb = RL(bb, 10); + dd = RL(dd + F2(ee, aa, bb) + X[10] + unchecked((int)0x7a6d76e9), 15) + cc; aa = RL(aa, 10); + cc = RL(cc + F2(dd, ee, aa) + X[14] + unchecked((int)0x7a6d76e9), 8) + bb; ee = RL(ee, 10); + + t = d; d = dd; dd = t; + + // + // Rounds 64-79 + // + // left + b = RL(b + F5(c, d, e) + X[4] + unchecked((int)0xa953fd4e), 9) + a; d = RL(d, 10); + a = RL(a + F5(b, c, d) + X[0] + unchecked((int)0xa953fd4e), 15) + e; c = RL(c, 10); + e = RL(e + F5(a, b, c) + X[5] + unchecked((int)0xa953fd4e), 5) + d; b = RL(b, 10); + d = RL(d + F5(e, a, b) + X[9] + unchecked((int)0xa953fd4e), 11) + c; a = RL(a, 10); + c = RL(c + F5(d, e, a) + X[7] + unchecked((int)0xa953fd4e), 6) + b; e = RL(e, 10); + b = RL(b + F5(c, d, e) + X[12] + unchecked((int)0xa953fd4e), 8) + a; d = RL(d, 10); + a = RL(a + F5(b, c, d) + X[2] + unchecked((int)0xa953fd4e), 13) + e; c = RL(c, 10); + e = RL(e + F5(a, b, c) + X[10] + unchecked((int)0xa953fd4e), 12) + d; b = RL(b, 10); + d = RL(d + F5(e, a, b) + X[14] + unchecked((int)0xa953fd4e), 5) + c; a = RL(a, 10); + c = RL(c + F5(d, e, a) + X[1] + unchecked((int)0xa953fd4e), 12) + b; e = RL(e, 10); + b = RL(b + F5(c, d, e) + X[3] + unchecked((int)0xa953fd4e), 13) + a; d = RL(d, 10); + a = RL(a + F5(b, c, d) + X[8] + unchecked((int)0xa953fd4e), 14) + e; c = RL(c, 10); + e = RL(e + F5(a, b, c) + X[11] + unchecked((int)0xa953fd4e), 11) + d; b = RL(b, 10); + d = RL(d + F5(e, a, b) + X[6] + unchecked((int)0xa953fd4e), 8) + c; a = RL(a, 10); + c = RL(c + F5(d, e, a) + X[15] + unchecked((int)0xa953fd4e), 5) + b; e = RL(e, 10); + b = RL(b + F5(c, d, e) + X[13] + unchecked((int)0xa953fd4e), 6) + a; d = RL(d, 10); + + // right + bb = RL(bb + F1(cc, dd, ee) + X[12], 8) + aa; dd = RL(dd, 10); + aa = RL(aa + F1(bb, cc, dd) + X[15], 5) + ee; cc = RL(cc, 10); + ee = RL(ee + F1(aa, bb, cc) + X[10], 12) + dd; bb = RL(bb, 10); + dd = RL(dd + F1(ee, aa, bb) + X[4], 9) + cc; aa = RL(aa, 10); + cc = RL(cc + F1(dd, ee, aa) + X[1], 12) + bb; ee = RL(ee, 10); + bb = RL(bb + F1(cc, dd, ee) + X[5], 5) + aa; dd = RL(dd, 10); + aa = RL(aa + F1(bb, cc, dd) + X[8], 14) + ee; cc = RL(cc, 10); + ee = RL(ee + F1(aa, bb, cc) + X[7], 6) + dd; bb = RL(bb, 10); + dd = RL(dd + F1(ee, aa, bb) + X[6], 8) + cc; aa = RL(aa, 10); + cc = RL(cc + F1(dd, ee, aa) + X[2], 13) + bb; ee = RL(ee, 10); + bb = RL(bb + F1(cc, dd, ee) + X[13], 6) + aa; dd = RL(dd, 10); + aa = RL(aa + F1(bb, cc, dd) + X[14], 5) + ee; cc = RL(cc, 10); + ee = RL(ee + F1(aa, bb, cc) + X[0], 15) + dd; bb = RL(bb, 10); + dd = RL(dd + F1(ee, aa, bb) + X[3], 13) + cc; aa = RL(aa, 10); + cc = RL(cc + F1(dd, ee, aa) + X[9], 11) + bb; ee = RL(ee, 10); + bb = RL(bb + F1(cc, dd, ee) + X[11], 11) + aa; dd = RL(dd, 10); + + // + // do (e, ee) swap as part of assignment. + // + + H0 += a; + H1 += b; + H2 += c; + H3 += d; + H4 += ee; + H5 += aa; + H6 += bb; + H7 += cc; + H8 += dd; + H9 += e; + + // + // reset the offset and clean out the word buffer. + // + xOff = 0; + for (int i = 0; i != X.Length; i++) + { + X[i] = 0; + } + } + + public override IMemoable Copy() + { + return new RipeMD320Digest(this); + } + + public override void Reset(IMemoable other) + { + RipeMD320Digest d = (RipeMD320Digest)other; + + CopyIn(d); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD320Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD320Digest.cs.meta new file mode 100644 index 00000000..af7eb410 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/RipeMD320Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d7606c4169527a4bb35054b933733a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SHA3Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SHA3Digest.cs new file mode 100644 index 00000000..671168e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SHA3Digest.cs @@ -0,0 +1,89 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /// + /// Implementation of SHA-3 based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ + /// + /// + /// Following the naming conventions used in the C source code to enable easy review of the implementation. + /// + public class Sha3Digest + : KeccakDigest + { + private static int CheckBitLength(int bitLength) + { + switch (bitLength) + { + case 224: + case 256: + case 384: + case 512: + return bitLength; + default: + throw new ArgumentException(bitLength + " not supported for SHA-3", "bitLength"); + } + } + + public Sha3Digest() + : this(256) + { + } + + public Sha3Digest(int bitLength) + : base(CheckBitLength(bitLength)) + { + } + + public Sha3Digest(Sha3Digest source) + : base(source) + { + } + + public override string AlgorithmName + { + get { return "SHA3-" + fixedOutputLength; } + } + + public override int DoFinal(byte[] output, int outOff) + { + AbsorbBits(0x02, 2); + + return base.DoFinal(output, outOff); + } + + /* + * TODO Possible API change to support partial-byte suffixes. + */ + protected override int DoFinal(byte[] output, int outOff, byte partialByte, int partialBits) + { + if (partialBits < 0 || partialBits > 7) + throw new ArgumentException("must be in the range [0,7]", "partialBits"); + + int finalInput = (partialByte & ((1 << partialBits) - 1)) | (0x02 << partialBits); + Debug.Assert(finalInput >= 0); + int finalBits = partialBits + 2; + + if (finalBits >= 8) + { + Absorb(new byte[]{ (byte)finalInput }, 0, 1); + finalBits -= 8; + finalInput >>= 8; + } + + return base.DoFinal(output, outOff, (byte)finalInput, finalBits); + } + + public override IMemoable Copy() + { + return new Sha3Digest(this); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SHA3Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SHA3Digest.cs.meta new file mode 100644 index 00000000..3f12c8df --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SHA3Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 21c525f413c2cbb458589e2c761f3c7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SM3Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SM3Digest.cs new file mode 100644 index 00000000..c20c6b81 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SM3Digest.cs @@ -0,0 +1,324 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + + /// + /// Implementation of Chinese SM3 digest as described at + /// http://tools.ietf.org/html/draft-shen-sm3-hash-00 + /// and at .... ( Chinese PDF ) + /// + /// + /// The specification says "process a bit stream", + /// but this is written to process bytes in blocks of 4, + /// meaning this will process 32-bit word groups. + /// But so do also most other digest specifications, + /// including the SHA-256 which was a origin for + /// this specification. + /// + public class SM3Digest + : GeneralDigest + { + private const int DIGEST_LENGTH = 32; // bytes + private const int BLOCK_SIZE = 64 / 4; // of 32 bit ints (16 ints) + + private uint[] V = new uint[DIGEST_LENGTH / 4]; // in 32 bit ints (8 ints) + private uint[] inwords = new uint[BLOCK_SIZE]; + private int xOff; + + // Work-bufs used within processBlock() + private uint[] W = new uint[68]; + + // Round constant T for processBlock() which is 32 bit integer rolled left up to (63 MOD 32) bit positions. + private static readonly uint[] T = new uint[64]; + + static SM3Digest() + { + for (int i = 0; i < 16; ++i) + { + uint t = 0x79CC4519; + T[i] = (t << i) | (t >> (32 - i)); + } + for (int i = 16; i < 64; ++i) + { + int n = i % 32; + uint t = 0x7A879D8A; + T[i] = (t << n) | (t >> (32 - n)); + } + } + + + /// + /// Standard constructor + /// + public SM3Digest() + { + Reset(); + } + + /// + /// Copy constructor. This will copy the state of the provided + /// message digest. + /// + public SM3Digest(SM3Digest t) + : base(t) + { + CopyIn(t); + } + + private void CopyIn(SM3Digest t) + { + Array.Copy(t.V, 0, this.V, 0, this.V.Length); + Array.Copy(t.inwords, 0, this.inwords, 0, this.inwords.Length); + xOff = t.xOff; + } + + public override string AlgorithmName + { + get { return "SM3"; } + } + + public override int GetDigestSize() + { + return DIGEST_LENGTH; + } + + public override IMemoable Copy() + { + return new SM3Digest(this); + } + + public override void Reset(IMemoable other) + { + SM3Digest d = (SM3Digest)other; + + base.CopyIn(d); + CopyIn(d); + } + + /// + /// reset the chaining variables + /// + public override void Reset() + { + base.Reset(); + + this.V[0] = 0x7380166F; + this.V[1] = 0x4914B2B9; + this.V[2] = 0x172442D7; + this.V[3] = 0xDA8A0600; + this.V[4] = 0xA96F30BC; + this.V[5] = 0x163138AA; + this.V[6] = 0xE38DEE4D; + this.V[7] = 0xB0FB0E4E; + + this.xOff = 0; + } + + + public override int DoFinal(byte[] output, int outOff) + { + Finish(); + + Pack.UInt32_To_BE(V, output, outOff); + + Reset(); + + return DIGEST_LENGTH; + } + + + internal override void ProcessWord(byte[] input, + int inOff) + { + uint n = Pack.BE_To_UInt32(input, inOff); + this.inwords[this.xOff] = n; + ++this.xOff; + + if (this.xOff >= 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength(long bitLength) + { + if (this.xOff > (BLOCK_SIZE - 2)) + { + // xOff == 15 --> can't fit the 64 bit length field at tail.. + this.inwords[this.xOff] = 0; // fill with zero + ++this.xOff; + + ProcessBlock(); + } + // Fill with zero words, until reach 2nd to last slot + while (this.xOff < (BLOCK_SIZE - 2)) + { + this.inwords[this.xOff] = 0; + ++this.xOff; + } + + // Store input data length in BITS + this.inwords[this.xOff++] = (uint)(bitLength >> 32); + this.inwords[this.xOff++] = (uint)(bitLength); + } + + /* + + 3.4.2. Constants + + + Tj = 79cc4519 when 0 < = j < = 15 + Tj = 7a879d8a when 16 < = j < = 63 + + 3.4.3. Boolean function + + + FFj(X;Y;Z) = X XOR Y XOR Z when 0 < = j < = 15 + = (X AND Y) OR (X AND Z) OR (Y AND Z) when 16 < = j < = 63 + + GGj(X;Y;Z) = X XOR Y XOR Z when 0 < = j < = 15 + = (X AND Y) OR (NOT X AND Z) when 16 < = j < = 63 + + The X, Y, Z in the fomular are words!GBP + + 3.4.4. Permutation function + + + P0(X) = X XOR (X <<< 9) XOR (X <<< 17) ## ROLL, not SHIFT + P1(X) = X XOR (X <<< 15) XOR (X <<< 23) ## ROLL, not SHIFT + + The X in the fomular are a word. + + ---------- + + Each ROLL converted to Java expression: + + ROLL 9 : ((x << 9) | (x >> (32-9)))) + ROLL 17 : ((x << 17) | (x >> (32-17))) + ROLL 15 : ((x << 15) | (x >> (32-15))) + ROLL 23 : ((x << 23) | (x >> (32-23))) + + */ + + private uint P0(uint x) + { + uint r9 = ((x << 9) | (x >> (32 - 9))); + uint r17 = ((x << 17) | (x >> (32 - 17))); + return (x ^ r9 ^ r17); + } + + private uint P1(uint x) + { + uint r15 = ((x << 15) | (x >> (32 - 15))); + uint r23 = ((x << 23) | (x >> (32 - 23))); + return (x ^ r15 ^ r23); + } + + private uint FF0(uint x, uint y, uint z) + { + return (x ^ y ^ z); + } + + private uint FF1(uint x, uint y, uint z) + { + return ((x & y) | (x & z) | (y & z)); + } + + private uint GG0(uint x, uint y, uint z) + { + return (x ^ y ^ z); + } + + private uint GG1(uint x, uint y, uint z) + { + return ((x & y) | ((~x) & z)); + } + + + internal override void ProcessBlock() + { + for (int j = 0; j < 16; ++j) + { + this.W[j] = this.inwords[j]; + } + for (int j = 16; j < 68; ++j) + { + uint wj3 = this.W[j - 3]; + uint r15 = ((wj3 << 15) | (wj3 >> (32 - 15))); + uint wj13 = this.W[j - 13]; + uint r7 = ((wj13 << 7) | (wj13 >> (32 - 7))); + this.W[j] = P1(this.W[j - 16] ^ this.W[j - 9] ^ r15) ^ r7 ^ this.W[j - 6]; + } + + uint A = this.V[0]; + uint B = this.V[1]; + uint C = this.V[2]; + uint D = this.V[3]; + uint E = this.V[4]; + uint F = this.V[5]; + uint G = this.V[6]; + uint H = this.V[7]; + + + for (int j = 0; j < 16; ++j) + { + uint a12 = ((A << 12) | (A >> (32 - 12))); + uint s1_ = a12 + E + T[j]; + uint SS1 = ((s1_ << 7) | (s1_ >> (32 - 7))); + uint SS2 = SS1 ^ a12; + uint Wj = W[j]; + uint W1j = Wj ^ W[j + 4]; + uint TT1 = FF0(A, B, C) + D + SS2 + W1j; + uint TT2 = GG0(E, F, G) + H + SS1 + Wj; + D = C; + C = ((B << 9) | (B >> (32 - 9))); + B = A; + A = TT1; + H = G; + G = ((F << 19) | (F >> (32 - 19))); + F = E; + E = P0(TT2); + } + + // Different FF,GG functions on rounds 16..63 + for (int j = 16; j < 64; ++j) + { + uint a12 = ((A << 12) | (A >> (32 - 12))); + uint s1_ = a12 + E + T[j]; + uint SS1 = ((s1_ << 7) | (s1_ >> (32 - 7))); + uint SS2 = SS1 ^ a12; + uint Wj = W[j]; + uint W1j = Wj ^ W[j + 4]; + uint TT1 = FF1(A, B, C) + D + SS2 + W1j; + uint TT2 = GG1(E, F, G) + H + SS1 + Wj; + D = C; + C = ((B << 9) | (B >> (32 - 9))); + B = A; + A = TT1; + H = G; + G = ((F << 19) | (F >> (32 - 19))); + F = E; + E = P0(TT2); + } + + this.V[0] ^= A; + this.V[1] ^= B; + this.V[2] ^= C; + this.V[3] ^= D; + this.V[4] ^= E; + this.V[5] ^= F; + this.V[6] ^= G; + this.V[7] ^= H; + + this.xOff = 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SM3Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SM3Digest.cs.meta new file mode 100644 index 00000000..803b7538 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SM3Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3d6e7485ae18a344c947334b9afc7a39 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha1Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha1Digest.cs new file mode 100644 index 00000000..b2181826 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha1Digest.cs @@ -0,0 +1,288 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + + /** + * implementation of SHA-1 as outlined in "Handbook of Applied Cryptography", pages 346 - 349. + * + * It is interesting to ponder why the, apart from the extra IV, the other difference here from MD5 + * is the "endianness" of the word processing! + */ + public class Sha1Digest + : GeneralDigest + { + private const int DigestLength = 20; + + private uint H1, H2, H3, H4, H5; + + private uint[] X = new uint[80]; + private int xOff; + + public Sha1Digest() + { + Reset(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public Sha1Digest(Sha1Digest t) + : base(t) + { + CopyIn(t); + } + + private void CopyIn(Sha1Digest t) + { + base.CopyIn(t); + + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + H4 = t.H4; + H5 = t.H5; + + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + } + + public override string AlgorithmName + { + get { return "SHA-1"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + internal override void ProcessWord( + byte[] input, + int inOff) + { + X[xOff] = Pack.BE_To_UInt32(input, inOff); + + if (++xOff == 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength(long bitLength) + { + if (xOff > 14) + { + ProcessBlock(); + } + + X[14] = (uint)((ulong)bitLength >> 32); + X[15] = (uint)((ulong)bitLength); + } + + public override int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + Pack.UInt32_To_BE(H1, output, outOff); + Pack.UInt32_To_BE(H2, output, outOff + 4); + Pack.UInt32_To_BE(H3, output, outOff + 8); + Pack.UInt32_To_BE(H4, output, outOff + 12); + Pack.UInt32_To_BE(H5, output, outOff + 16); + + Reset(); + + return DigestLength; + } + + /** + * reset the chaining variables + */ + public override void Reset() + { + base.Reset(); + + H1 = 0x67452301; + H2 = 0xefcdab89; + H3 = 0x98badcfe; + H4 = 0x10325476; + H5 = 0xc3d2e1f0; + + xOff = 0; + Array.Clear(X, 0, X.Length); + } + + // + // Additive constants + // + private const uint Y1 = 0x5a827999; + private const uint Y2 = 0x6ed9eba1; + private const uint Y3 = 0x8f1bbcdc; + private const uint Y4 = 0xca62c1d6; + + private static uint F(uint u, uint v, uint w) + { + return (u & v) | (~u & w); + } + + private static uint H(uint u, uint v, uint w) + { + return u ^ v ^ w; + } + + private static uint G(uint u, uint v, uint w) + { + return (u & v) | (u & w) | (v & w); + } + + internal override void ProcessBlock() + { + // + // expand 16 word block into 80 word block. + // + for (int i = 16; i < 80; i++) + { + uint t = X[i - 3] ^ X[i - 8] ^ X[i - 14] ^ X[i - 16]; + X[i] = t << 1 | t >> 31; + } + + // + // set up working variables. + // + uint A = H1; + uint B = H2; + uint C = H3; + uint D = H4; + uint E = H5; + + // + // round 1 + // + int idx = 0; + + for (int j = 0; j < 4; j++) + { + // E = rotateLeft(A, 5) + F(B, C, D) + E + X[idx++] + Y1 + // B = rotateLeft(B, 30) + E += (A << 5 | (A >> 27)) + F(B, C, D) + X[idx++] + Y1; + B = B << 30 | (B >> 2); + + D += (E << 5 | (E >> 27)) + F(A, B, C) + X[idx++] + Y1; + A = A << 30 | (A >> 2); + + C += (D << 5 | (D >> 27)) + F(E, A, B) + X[idx++] + Y1; + E = E << 30 | (E >> 2); + + B += (C << 5 | (C >> 27)) + F(D, E, A) + X[idx++] + Y1; + D = D << 30 | (D >> 2); + + A += (B << 5 | (B >> 27)) + F(C, D, E) + X[idx++] + Y1; + C = C << 30 | (C >> 2); + } + + // + // round 2 + // + for (int j = 0; j < 4; j++) + { + // E = rotateLeft(A, 5) + H(B, C, D) + E + X[idx++] + Y2 + // B = rotateLeft(B, 30) + E += (A << 5 | (A >> 27)) + H(B, C, D) + X[idx++] + Y2; + B = B << 30 | (B >> 2); + + D += (E << 5 | (E >> 27)) + H(A, B, C) + X[idx++] + Y2; + A = A << 30 | (A >> 2); + + C += (D << 5 | (D >> 27)) + H(E, A, B) + X[idx++] + Y2; + E = E << 30 | (E >> 2); + + B += (C << 5 | (C >> 27)) + H(D, E, A) + X[idx++] + Y2; + D = D << 30 | (D >> 2); + + A += (B << 5 | (B >> 27)) + H(C, D, E) + X[idx++] + Y2; + C = C << 30 | (C >> 2); + } + + // + // round 3 + // + for (int j = 0; j < 4; j++) + { + // E = rotateLeft(A, 5) + G(B, C, D) + E + X[idx++] + Y3 + // B = rotateLeft(B, 30) + E += (A << 5 | (A >> 27)) + G(B, C, D) + X[idx++] + Y3; + B = B << 30 | (B >> 2); + + D += (E << 5 | (E >> 27)) + G(A, B, C) + X[idx++] + Y3; + A = A << 30 | (A >> 2); + + C += (D << 5 | (D >> 27)) + G(E, A, B) + X[idx++] + Y3; + E = E << 30 | (E >> 2); + + B += (C << 5 | (C >> 27)) + G(D, E, A) + X[idx++] + Y3; + D = D << 30 | (D >> 2); + + A += (B << 5 | (B >> 27)) + G(C, D, E) + X[idx++] + Y3; + C = C << 30 | (C >> 2); + } + + // + // round 4 + // + for (int j = 0; j < 4; j++) + { + // E = rotateLeft(A, 5) + H(B, C, D) + E + X[idx++] + Y4 + // B = rotateLeft(B, 30) + E += (A << 5 | (A >> 27)) + H(B, C, D) + X[idx++] + Y4; + B = B << 30 | (B >> 2); + + D += (E << 5 | (E >> 27)) + H(A, B, C) + X[idx++] + Y4; + A = A << 30 | (A >> 2); + + C += (D << 5 | (D >> 27)) + H(E, A, B) + X[idx++] + Y4; + E = E << 30 | (E >> 2); + + B += (C << 5 | (C >> 27)) + H(D, E, A) + X[idx++] + Y4; + D = D << 30 | (D >> 2); + + A += (B << 5 | (B >> 27)) + H(C, D, E) + X[idx++] + Y4; + C = C << 30 | (C >> 2); + } + + H1 += A; + H2 += B; + H3 += C; + H4 += D; + H5 += E; + + // + // reset start of the buffer. + // + xOff = 0; + Array.Clear(X, 0, 16); + } + + public override IMemoable Copy() + { + return new Sha1Digest(this); + } + + public override void Reset(IMemoable other) + { + Sha1Digest d = (Sha1Digest)other; + + CopyIn(d); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha1Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha1Digest.cs.meta new file mode 100644 index 00000000..d081d791 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha1Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ef8d80a00e8bb34093e8e8925dcd039 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha224Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha224Digest.cs new file mode 100644 index 00000000..647f0634 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha224Digest.cs @@ -0,0 +1,293 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * SHA-224 as described in RFC 3874 + *
+     *         block  word  digest
+     * SHA-1   512    32    160
+     * SHA-224 512    32    224
+     * SHA-256 512    32    256
+     * SHA-384 1024   64    384
+     * SHA-512 1024   64    512
+     * 
+ */ + public class Sha224Digest + : GeneralDigest + { + private const int DigestLength = 28; + + private uint H1, H2, H3, H4, H5, H6, H7, H8; + + private uint[] X = new uint[64]; + private int xOff; + + /** + * Standard constructor + */ + public Sha224Digest() + { + Reset(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public Sha224Digest( + Sha224Digest t) + : base(t) + { + CopyIn(t); + } + + private void CopyIn(Sha224Digest t) + { + base.CopyIn(t); + + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + H4 = t.H4; + H5 = t.H5; + H6 = t.H6; + H7 = t.H7; + H8 = t.H8; + + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + } + + public override string AlgorithmName + { + get { return "SHA-224"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + internal override void ProcessWord( + byte[] input, + int inOff) + { + X[xOff] = Pack.BE_To_UInt32(input, inOff); + + if (++xOff == 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength( + long bitLength) + { + if (xOff > 14) + { + ProcessBlock(); + } + + X[14] = (uint)((ulong)bitLength >> 32); + X[15] = (uint)((ulong)bitLength); + } + + public override int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + Pack.UInt32_To_BE(H1, output, outOff); + Pack.UInt32_To_BE(H2, output, outOff + 4); + Pack.UInt32_To_BE(H3, output, outOff + 8); + Pack.UInt32_To_BE(H4, output, outOff + 12); + Pack.UInt32_To_BE(H5, output, outOff + 16); + Pack.UInt32_To_BE(H6, output, outOff + 20); + Pack.UInt32_To_BE(H7, output, outOff + 24); + + Reset(); + + return DigestLength; + } + + /** + * reset the chaining variables + */ + public override void Reset() + { + base.Reset(); + + /* SHA-224 initial hash value + */ + H1 = 0xc1059ed8; + H2 = 0x367cd507; + H3 = 0x3070dd17; + H4 = 0xf70e5939; + H5 = 0xffc00b31; + H6 = 0x68581511; + H7 = 0x64f98fa7; + H8 = 0xbefa4fa4; + + xOff = 0; + Array.Clear(X, 0, X.Length); + } + + internal override void ProcessBlock() + { + // + // expand 16 word block into 64 word blocks. + // + for (int ti = 16; ti <= 63; ti++) + { + X[ti] = Theta1(X[ti - 2]) + X[ti - 7] + Theta0(X[ti - 15]) + X[ti - 16]; + } + + // + // set up working variables. + // + uint a = H1; + uint b = H2; + uint c = H3; + uint d = H4; + uint e = H5; + uint f = H6; + uint g = H7; + uint h = H8; + + int t = 0; + for(int i = 0; i < 8; i ++) + { + // t = 8 * i + h += Sum1(e) + Ch(e, f, g) + K[t] + X[t]; + d += h; + h += Sum0(a) + Maj(a, b, c); + ++t; + + // t = 8 * i + 1 + g += Sum1(d) + Ch(d, e, f) + K[t] + X[t]; + c += g; + g += Sum0(h) + Maj(h, a, b); + ++t; + + // t = 8 * i + 2 + f += Sum1(c) + Ch(c, d, e) + K[t] + X[t]; + b += f; + f += Sum0(g) + Maj(g, h, a); + ++t; + + // t = 8 * i + 3 + e += Sum1(b) + Ch(b, c, d) + K[t] + X[t]; + a += e; + e += Sum0(f) + Maj(f, g, h); + ++t; + + // t = 8 * i + 4 + d += Sum1(a) + Ch(a, b, c) + K[t] + X[t]; + h += d; + d += Sum0(e) + Maj(e, f, g); + ++t; + + // t = 8 * i + 5 + c += Sum1(h) + Ch(h, a, b) + K[t] + X[t]; + g += c; + c += Sum0(d) + Maj(d, e, f); + ++t; + + // t = 8 * i + 6 + b += Sum1(g) + Ch(g, h, a) + K[t] + X[t]; + f += b; + b += Sum0(c) + Maj(c, d, e); + ++t; + + // t = 8 * i + 7 + a += Sum1(f) + Ch(f, g, h) + K[t] + X[t]; + e += a; + a += Sum0(b) + Maj(b, c, d); + ++t; + } + + H1 += a; + H2 += b; + H3 += c; + H4 += d; + H5 += e; + H6 += f; + H7 += g; + H8 += h; + + // + // reset the offset and clean out the word buffer. + // + xOff = 0; + Array.Clear(X, 0, 16); + } + + /* SHA-224 functions */ + private static uint Ch(uint x, uint y, uint z) + { + return (x & y) ^ (~x & z); + } + + private static uint Maj(uint x, uint y, uint z) + { + return (x & y) ^ (x & z) ^ (y & z); + } + + private static uint Sum0(uint x) + { + return ((x >> 2) | (x << 30)) ^ ((x >> 13) | (x << 19)) ^ ((x >> 22) | (x << 10)); + } + + private static uint Sum1(uint x) + { + return ((x >> 6) | (x << 26)) ^ ((x >> 11) | (x << 21)) ^ ((x >> 25) | (x << 7)); + } + + private static uint Theta0(uint x) + { + return ((x >> 7) | (x << 25)) ^ ((x >> 18) | (x << 14)) ^ (x >> 3); + } + + private static uint Theta1(uint x) + { + return ((x >> 17) | (x << 15)) ^ ((x >> 19) | (x << 13)) ^ (x >> 10); + } + + /* SHA-224 Constants + * (represent the first 32 bits of the fractional parts of the + * cube roots of the first sixty-four prime numbers) + */ + internal static readonly uint[] K = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 + }; + + public override IMemoable Copy() + { + return new Sha224Digest(this); + } + + public override void Reset(IMemoable other) + { + Sha224Digest d = (Sha224Digest)other; + + CopyIn(d); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha224Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha224Digest.cs.meta new file mode 100644 index 00000000..fb39805a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha224Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 030ee55485af2ee4985a31227e05de47 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha256Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha256Digest.cs new file mode 100644 index 00000000..3b148e7e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha256Digest.cs @@ -0,0 +1,334 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * Draft FIPS 180-2 implementation of SHA-256. Note: As this is + * based on a draft this implementation is subject to change. + * + *
+    *         block  word  digest
+    * SHA-1   512    32    160
+    * SHA-256 512    32    256
+    * SHA-384 1024   64    384
+    * SHA-512 1024   64    512
+    * 
+ */ + public class Sha256Digest + : GeneralDigest + { + private const int DigestLength = 32; + + private uint H1, H2, H3, H4, H5, H6, H7, H8; + private uint[] X = new uint[64]; + private int xOff; + + public Sha256Digest() + { + initHs(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public Sha256Digest(Sha256Digest t) : base(t) + { + CopyIn(t); + } + + private void CopyIn(Sha256Digest t) + { + base.CopyIn(t); + + H1 = t.H1; + H2 = t.H2; + H3 = t.H3; + H4 = t.H4; + H5 = t.H5; + H6 = t.H6; + H7 = t.H7; + H8 = t.H8; + + Array.Copy(t.X, 0, X, 0, t.X.Length); + xOff = t.xOff; + } + + public override string AlgorithmName + { + get { return "SHA-256"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + internal override void ProcessWord( + byte[] input, + int inOff) + { + X[xOff] = Pack.BE_To_UInt32(input, inOff); + + if (++xOff == 16) + { + ProcessBlock(); + } + } + + internal override void ProcessLength( + long bitLength) + { + if (xOff > 14) + { + ProcessBlock(); + } + + X[14] = (uint)((ulong)bitLength >> 32); + X[15] = (uint)((ulong)bitLength); + } + + public override int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + Pack.UInt32_To_BE((uint)H1, output, outOff); + Pack.UInt32_To_BE((uint)H2, output, outOff + 4); + Pack.UInt32_To_BE((uint)H3, output, outOff + 8); + Pack.UInt32_To_BE((uint)H4, output, outOff + 12); + Pack.UInt32_To_BE((uint)H5, output, outOff + 16); + Pack.UInt32_To_BE((uint)H6, output, outOff + 20); + Pack.UInt32_To_BE((uint)H7, output, outOff + 24); + Pack.UInt32_To_BE((uint)H8, output, outOff + 28); + + Reset(); + + return DigestLength; + } + + /** + * reset the chaining variables + */ + public override void Reset() + { + base.Reset(); + + initHs(); + + xOff = 0; + Array.Clear(X, 0, X.Length); + } + + private void initHs() + { + /* SHA-256 initial hash value + * The first 32 bits of the fractional parts of the square roots + * of the first eight prime numbers + */ + H1 = 0x6a09e667; + H2 = 0xbb67ae85; + H3 = 0x3c6ef372; + H4 = 0xa54ff53a; + H5 = 0x510e527f; + H6 = 0x9b05688c; + H7 = 0x1f83d9ab; + H8 = 0x5be0cd19; + } + + internal override void ProcessBlock() + { + // + // expand 16 word block into 64 word blocks. + // + for (int ti = 16; ti <= 63; ti++) + { + X[ti] = Theta1(X[ti - 2]) + X[ti - 7] + Theta0(X[ti - 15]) + X[ti - 16]; + } + + // + // set up working variables. + // + uint a = H1; + uint b = H2; + uint c = H3; + uint d = H4; + uint e = H5; + uint f = H6; + uint g = H7; + uint h = H8; + + int t = 0; + for(int i = 0; i < 8; ++i) + { + // t = 8 * i + h += Sum1Ch(e, f, g) + K[t] + X[t]; + d += h; + h += Sum0Maj(a, b, c); + ++t; + + // t = 8 * i + 1 + g += Sum1Ch(d, e, f) + K[t] + X[t]; + c += g; + g += Sum0Maj(h, a, b); + ++t; + + // t = 8 * i + 2 + f += Sum1Ch(c, d, e) + K[t] + X[t]; + b += f; + f += Sum0Maj(g, h, a); + ++t; + + // t = 8 * i + 3 + e += Sum1Ch(b, c, d) + K[t] + X[t]; + a += e; + e += Sum0Maj(f, g, h); + ++t; + + // t = 8 * i + 4 + d += Sum1Ch(a, b, c) + K[t] + X[t]; + h += d; + d += Sum0Maj(e, f, g); + ++t; + + // t = 8 * i + 5 + c += Sum1Ch(h, a, b) + K[t] + X[t]; + g += c; + c += Sum0Maj(d, e, f); + ++t; + + // t = 8 * i + 6 + b += Sum1Ch(g, h, a) + K[t] + X[t]; + f += b; + b += Sum0Maj(c, d, e); + ++t; + + // t = 8 * i + 7 + a += Sum1Ch(f, g, h) + K[t] + X[t]; + e += a; + a += Sum0Maj(b, c, d); + ++t; + } + + H1 += a; + H2 += b; + H3 += c; + H4 += d; + H5 += e; + H6 += f; + H7 += g; + H8 += h; + + // + // reset the offset and clean out the word buffer. + // + xOff = 0; + Array.Clear(X, 0, 16); + } + + private static uint Sum1Ch( + uint x, + uint y, + uint z) + { +// return Sum1(x) + Ch(x, y, z); + return (((x >> 6) | (x << 26)) ^ ((x >> 11) | (x << 21)) ^ ((x >> 25) | (x << 7))) + + ((x & y) ^ ((~x) & z)); + } + + private static uint Sum0Maj( + uint x, + uint y, + uint z) + { +// return Sum0(x) + Maj(x, y, z); + return (((x >> 2) | (x << 30)) ^ ((x >> 13) | (x << 19)) ^ ((x >> 22) | (x << 10))) + + ((x & y) ^ (x & z) ^ (y & z)); + } + +// /* SHA-256 functions */ +// private static uint Ch( +// uint x, +// uint y, +// uint z) +// { +// return ((x & y) ^ ((~x) & z)); +// } +// +// private static uint Maj( +// uint x, +// uint y, +// uint z) +// { +// return ((x & y) ^ (x & z) ^ (y & z)); +// } +// +// private static uint Sum0( +// uint x) +// { +// return ((x >> 2) | (x << 30)) ^ ((x >> 13) | (x << 19)) ^ ((x >> 22) | (x << 10)); +// } +// +// private static uint Sum1( +// uint x) +// { +// return ((x >> 6) | (x << 26)) ^ ((x >> 11) | (x << 21)) ^ ((x >> 25) | (x << 7)); +// } + + private static uint Theta0( + uint x) + { + return ((x >> 7) | (x << 25)) ^ ((x >> 18) | (x << 14)) ^ (x >> 3); + } + + private static uint Theta1( + uint x) + { + return ((x >> 17) | (x << 15)) ^ ((x >> 19) | (x << 13)) ^ (x >> 10); + } + + /* SHA-256 Constants + * (represent the first 32 bits of the fractional parts of the + * cube roots of the first sixty-four prime numbers) + */ + private static readonly uint[] K = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 + }; + + public override IMemoable Copy() + { + return new Sha256Digest(this); + } + + public override void Reset(IMemoable other) + { + Sha256Digest d = (Sha256Digest)other; + + CopyIn(d); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha256Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha256Digest.cs.meta new file mode 100644 index 00000000..ba70f34e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha256Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1c1f505a2c38e354a832ffbf8fbcbd63 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha384Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha384Digest.cs new file mode 100644 index 00000000..072ca3af --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha384Digest.cs @@ -0,0 +1,105 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * Draft FIPS 180-2 implementation of SHA-384. Note: As this is + * based on a draft this implementation is subject to change. + * + *
+     *         block  word  digest
+     * SHA-1   512    32    160
+     * SHA-256 512    32    256
+     * SHA-384 1024   64    384
+     * SHA-512 1024   64    512
+     * 
+ */ + public class Sha384Digest + : LongDigest + { + private const int DigestLength = 48; + + public Sha384Digest() + { + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public Sha384Digest( + Sha384Digest t) + : base(t) + { + } + + public override string AlgorithmName + { + get { return "SHA-384"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + public override int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + Pack.UInt64_To_BE(H1, output, outOff); + Pack.UInt64_To_BE(H2, output, outOff + 8); + Pack.UInt64_To_BE(H3, output, outOff + 16); + Pack.UInt64_To_BE(H4, output, outOff + 24); + Pack.UInt64_To_BE(H5, output, outOff + 32); + Pack.UInt64_To_BE(H6, output, outOff + 40); + + Reset(); + + return DigestLength; + } + + /** + * reset the chaining variables + */ + public override void Reset() + { + base.Reset(); + + /* SHA-384 initial hash value + * The first 64 bits of the fractional parts of the square roots + * of the 9th through 16th prime numbers + */ + H1 = 0xcbbb9d5dc1059ed8; + H2 = 0x629a292a367cd507; + H3 = 0x9159015a3070dd17; + H4 = 0x152fecd8f70e5939; + H5 = 0x67332667ffc00b31; + H6 = 0x8eb44a8768581511; + H7 = 0xdb0c2e0d64f98fa7; + H8 = 0x47b5481dbefa4fa4; + } + + public override IMemoable Copy() + { + return new Sha384Digest(this); + } + + public override void Reset(IMemoable other) + { + Sha384Digest d = (Sha384Digest)other; + + CopyIn(d); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha384Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha384Digest.cs.meta new file mode 100644 index 00000000..d4a0fdfe --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha384Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 202b9c65c2b4bf3429962b5c945902a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512Digest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512Digest.cs new file mode 100644 index 00000000..a52322ef --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512Digest.cs @@ -0,0 +1,108 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * Draft FIPS 180-2 implementation of SHA-512. Note: As this is + * based on a draft this implementation is subject to change. + * + *
+     *         block  word  digest
+     * SHA-1   512    32    160
+     * SHA-256 512    32    256
+     * SHA-384 1024   64    384
+     * SHA-512 1024   64    512
+     * 
+ */ + public class Sha512Digest + : LongDigest + { + private const int DigestLength = 64; + + public Sha512Digest() + { + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public Sha512Digest( + Sha512Digest t) + : base(t) + { + } + + public override string AlgorithmName + { + get { return "SHA-512"; } + } + + public override int GetDigestSize() + { + return DigestLength; + } + + public override int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + Pack.UInt64_To_BE(H1, output, outOff); + Pack.UInt64_To_BE(H2, output, outOff + 8); + Pack.UInt64_To_BE(H3, output, outOff + 16); + Pack.UInt64_To_BE(H4, output, outOff + 24); + Pack.UInt64_To_BE(H5, output, outOff + 32); + Pack.UInt64_To_BE(H6, output, outOff + 40); + Pack.UInt64_To_BE(H7, output, outOff + 48); + Pack.UInt64_To_BE(H8, output, outOff + 56); + + Reset(); + + return DigestLength; + + } + + /** + * reset the chaining variables + */ + public override void Reset() + { + base.Reset(); + + /* SHA-512 initial hash value + * The first 64 bits of the fractional parts of the square roots + * of the first eight prime numbers + */ + H1 = 0x6a09e667f3bcc908; + H2 = 0xbb67ae8584caa73b; + H3 = 0x3c6ef372fe94f82b; + H4 = 0xa54ff53a5f1d36f1; + H5 = 0x510e527fade682d1; + H6 = 0x9b05688c2b3e6c1f; + H7 = 0x1f83d9abfb41bd6b; + H8 = 0x5be0cd19137e2179; + } + + public override IMemoable Copy() + { + return new Sha512Digest(this); + } + + public override void Reset(IMemoable other) + { + Sha512Digest d = (Sha512Digest)other; + + CopyIn(d); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512Digest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512Digest.cs.meta new file mode 100644 index 00000000..821af2ff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512Digest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4adbb7dfd7c2c4f41ba95f6affb474dc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512tDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512tDigest.cs new file mode 100644 index 00000000..f3f28cc1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512tDigest.cs @@ -0,0 +1,204 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * FIPS 180-4 implementation of SHA-512/t + */ + public class Sha512tDigest + : LongDigest + { + private const ulong A5 = 0xa5a5a5a5a5a5a5a5UL; + + private readonly int digestLength; + + private ulong H1t, H2t, H3t, H4t, H5t, H6t, H7t, H8t; + + /** + * Standard constructor + */ + public Sha512tDigest(int bitLength) + { + if (bitLength >= 512) + throw new ArgumentException("cannot be >= 512", "bitLength"); + if (bitLength % 8 != 0) + throw new ArgumentException("needs to be a multiple of 8", "bitLength"); + if (bitLength == 384) + throw new ArgumentException("cannot be 384 use SHA384 instead", "bitLength"); + + this.digestLength = bitLength / 8; + + tIvGenerate(digestLength * 8); + + Reset(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public Sha512tDigest(Sha512tDigest t) + : base(t) + { + this.digestLength = t.digestLength; + + Reset(t); + } + + public override string AlgorithmName + { + get { return "SHA-512/" + (digestLength * 8); } + } + + public override int GetDigestSize() + { + return digestLength; + } + + public override int DoFinal(byte[] output, int outOff) + { + Finish(); + + UInt64_To_BE(H1, output, outOff, digestLength); + UInt64_To_BE(H2, output, outOff + 8, digestLength - 8); + UInt64_To_BE(H3, output, outOff + 16, digestLength - 16); + UInt64_To_BE(H4, output, outOff + 24, digestLength - 24); + UInt64_To_BE(H5, output, outOff + 32, digestLength - 32); + UInt64_To_BE(H6, output, outOff + 40, digestLength - 40); + UInt64_To_BE(H7, output, outOff + 48, digestLength - 48); + UInt64_To_BE(H8, output, outOff + 56, digestLength - 56); + + Reset(); + + return digestLength; + } + + /** + * reset the chaining variables + */ + public override void Reset() + { + base.Reset(); + + /* + * initial hash values use the iv generation algorithm for t. + */ + H1 = H1t; + H2 = H2t; + H3 = H3t; + H4 = H4t; + H5 = H5t; + H6 = H6t; + H7 = H7t; + H8 = H8t; + } + + private void tIvGenerate(int bitLength) + { + H1 = 0x6a09e667f3bcc908UL ^ A5; + H2 = 0xbb67ae8584caa73bUL ^ A5; + H3 = 0x3c6ef372fe94f82bUL ^ A5; + H4 = 0xa54ff53a5f1d36f1UL ^ A5; + H5 = 0x510e527fade682d1UL ^ A5; + H6 = 0x9b05688c2b3e6c1fUL ^ A5; + H7 = 0x1f83d9abfb41bd6bUL ^ A5; + H8 = 0x5be0cd19137e2179UL ^ A5; + + Update(0x53); + Update(0x48); + Update(0x41); + Update(0x2D); + Update(0x35); + Update(0x31); + Update(0x32); + Update(0x2F); + + if (bitLength > 100) + { + Update((byte)(bitLength / 100 + 0x30)); + bitLength = bitLength % 100; + Update((byte)(bitLength / 10 + 0x30)); + bitLength = bitLength % 10; + Update((byte)(bitLength + 0x30)); + } + else if (bitLength > 10) + { + Update((byte)(bitLength / 10 + 0x30)); + bitLength = bitLength % 10; + Update((byte)(bitLength + 0x30)); + } + else + { + Update((byte)(bitLength + 0x30)); + } + + Finish(); + + H1t = H1; + H2t = H2; + H3t = H3; + H4t = H4; + H5t = H5; + H6t = H6; + H7t = H7; + H8t = H8; + } + + private static void UInt64_To_BE(ulong n, byte[] bs, int off, int max) + { + if (max > 0) + { + UInt32_To_BE((uint)(n >> 32), bs, off, max); + + if (max > 4) + { + UInt32_To_BE((uint)n, bs, off + 4, max - 4); + } + } + } + + private static void UInt32_To_BE(uint n, byte[] bs, int off, int max) + { + int num = System.Math.Min(4, max); + while (--num >= 0) + { + int shift = 8 * (3 - num); + bs[off + num] = (byte)(n >> shift); + } + } + + public override IMemoable Copy() + { + return new Sha512tDigest(this); + } + + public override void Reset(IMemoable other) + { + Sha512tDigest t = (Sha512tDigest)other; + + if (this.digestLength != t.digestLength) + { + throw new MemoableResetException("digestLength inappropriate in other"); + } + + base.CopyIn(t); + + this.H1t = t.H1t; + this.H2t = t.H2t; + this.H3t = t.H3t; + this.H4t = t.H4t; + this.H5t = t.H5t; + this.H6t = t.H6t; + this.H7t = t.H7t; + this.H8t = t.H8t; + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512tDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512tDigest.cs.meta new file mode 100644 index 00000000..739d908c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/Sha512tDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71193c0a7b8cb1d49939d290bb0b4004 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShakeDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShakeDigest.cs new file mode 100644 index 00000000..f23155a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShakeDigest.cs @@ -0,0 +1,123 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /// + /// Implementation of SHAKE based on following KeccakNISTInterface.c from http://keccak.noekeon.org/ + /// + /// + /// Following the naming conventions used in the C source code to enable easy review of the implementation. + /// + public class ShakeDigest + : KeccakDigest, IXof + { + private static int CheckBitLength(int bitLength) + { + switch (bitLength) + { + case 128: + case 256: + return bitLength; + default: + throw new ArgumentException(bitLength + " not supported for SHAKE", "bitLength"); + } + } + + public ShakeDigest() + : this(128) + { + } + + public ShakeDigest(int bitLength) + : base(CheckBitLength(bitLength)) + { + } + + public ShakeDigest(ShakeDigest source) + : base(source) + { + } + + public override string AlgorithmName + { + get { return "SHAKE" + fixedOutputLength; } + } + + public override int DoFinal(byte[] output, int outOff) + { + return DoFinal(output, outOff, GetDigestSize()); + } + + public virtual int DoFinal(byte[] output, int outOff, int outLen) + { + DoOutput(output, outOff, outLen); + + Reset(); + + return outLen; + } + + public virtual int DoOutput(byte[] output, int outOff, int outLen) + { + if (!squeezing) + { + AbsorbBits(0x0F, 4); + } + + Squeeze(output, outOff, (long)outLen << 3); + + return outLen; + } + + /* + * TODO Possible API change to support partial-byte suffixes. + */ + protected override int DoFinal(byte[] output, int outOff, byte partialByte, int partialBits) + { + return DoFinal(output, outOff, GetDigestSize(), partialByte, partialBits); + } + + /* + * TODO Possible API change to support partial-byte suffixes. + */ + protected virtual int DoFinal(byte[] output, int outOff, int outLen, byte partialByte, int partialBits) + { + if (partialBits < 0 || partialBits > 7) + throw new ArgumentException("must be in the range [0,7]", "partialBits"); + + int finalInput = (partialByte & ((1 << partialBits) - 1)) | (0x0F << partialBits); + Debug.Assert(finalInput >= 0); + int finalBits = partialBits + 4; + + if (finalBits >= 8) + { + Absorb(new byte[]{ (byte)finalInput }, 0, 1); + finalBits -= 8; + finalInput >>= 8; + } + + if (finalBits > 0) + { + AbsorbBits(finalInput, finalBits); + } + + Squeeze(output, outOff, (long)outLen << 3); + + Reset(); + + return outLen; + } + + public override IMemoable Copy() + { + return new ShakeDigest(this); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShakeDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShakeDigest.cs.meta new file mode 100644 index 00000000..ea8a28d5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShakeDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eaf2e157553c41e44be2794678a8fc53 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShortenedDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShortenedDigest.cs new file mode 100644 index 00000000..f23d7913 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShortenedDigest.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * Wrapper class that reduces the output length of a particular digest to + * only the first n bytes of the digest function. + */ + public class ShortenedDigest + : IDigest + { + private IDigest baseDigest; + private int length; + + /** + * Base constructor. + * + * @param baseDigest underlying digest to use. + * @param length length in bytes of the output of doFinal. + * @exception ArgumentException if baseDigest is null, or length is greater than baseDigest.GetDigestSize(). + */ + public ShortenedDigest( + IDigest baseDigest, + int length) + { + if (baseDigest == null) + { + throw new ArgumentNullException("baseDigest"); + } + + if (length > baseDigest.GetDigestSize()) + { + throw new ArgumentException("baseDigest output not large enough to support length"); + } + + this.baseDigest = baseDigest; + this.length = length; + } + + public string AlgorithmName + { + get { return baseDigest.AlgorithmName + "(" + length * 8 + ")"; } + } + + public int GetDigestSize() + { + return length; + } + + public void Update(byte input) + { + baseDigest.Update(input); + } + + public void BlockUpdate(byte[] input, int inOff, int length) + { + baseDigest.BlockUpdate(input, inOff, length); + } + + public int DoFinal(byte[] output, int outOff) + { + byte[] tmp = new byte[baseDigest.GetDigestSize()]; + + baseDigest.DoFinal(tmp, 0); + + Array.Copy(tmp, 0, output, outOff, length); + + return length; + } + + public void Reset() + { + baseDigest.Reset(); + } + + public int GetByteLength() + { + return baseDigest.GetByteLength(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShortenedDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShortenedDigest.cs.meta new file mode 100644 index 00000000..c603c94f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/ShortenedDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ea482868e0969942b9f9d454a43ae66 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinDigest.cs new file mode 100644 index 00000000..b77f6905 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinDigest.cs @@ -0,0 +1,121 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + + /// + /// Implementation of the Skein parameterised hash function in 256, 512 and 1024 bit block sizes, + /// based on the Threefish tweakable block cipher. + /// + /// + /// This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 + /// competition in October 2010. + ///

+ /// Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + /// Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. + /// + /// + /// + public class SkeinDigest + : IDigest, IMemoable + { + ///

+ /// 256 bit block size - Skein-256 + /// + public const int SKEIN_256 = SkeinEngine.SKEIN_256; + /// + /// 512 bit block size - Skein-512 + /// + public const int SKEIN_512 = SkeinEngine.SKEIN_512; + /// + /// 1024 bit block size - Skein-1024 + /// + public const int SKEIN_1024 = SkeinEngine.SKEIN_1024; + + private readonly SkeinEngine engine; + + /// + /// Constructs a Skein digest with an internal state size and output size. + /// + /// the internal state size in bits - one of or + /// . + /// the output/digest size to produce in bits, which must be an integral number of + /// bytes. + public SkeinDigest(int stateSizeBits, int digestSizeBits) + { + this.engine = new SkeinEngine(stateSizeBits, digestSizeBits); + Init(null); + } + + public SkeinDigest(SkeinDigest digest) + { + this.engine = new SkeinEngine(digest.engine); + } + + public void Reset(IMemoable other) + { + SkeinDigest d = (SkeinDigest)other; + engine.Reset(d.engine); + } + + public IMemoable Copy() + { + return new SkeinDigest(this); + } + + public String AlgorithmName + { + get { return "Skein-" + (engine.BlockSize * 8) + "-" + (engine.OutputSize * 8); } + } + + public int GetDigestSize() + { + return engine.OutputSize; + } + + public int GetByteLength() + { + return engine.BlockSize; + } + + /// + /// Optionally initialises the Skein digest with the provided parameters. + /// + /// See for details on the parameterisation of the Skein hash function. + /// the parameters to apply to this engine, or null to use no parameters. + public void Init(SkeinParameters parameters) + { + engine.Init(parameters); + } + + public void Reset() + { + engine.Reset(); + } + + public void Update(byte inByte) + { + engine.Update(inByte); + } + + public void BlockUpdate(byte[] inBytes, int inOff, int len) + { + engine.Update(inBytes, inOff, len); + } + + public int DoFinal(byte[] outBytes, int outOff) + { + return engine.DoFinal(outBytes, outOff); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinDigest.cs.meta new file mode 100644 index 00000000..659ccfa2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 77b034e30a6e8f3459f3c17cd88e13b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinEngine.cs new file mode 100644 index 00000000..d39633c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinEngine.cs @@ -0,0 +1,808 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + + /// + /// Implementation of the Skein family of parameterised hash functions in 256, 512 and 1024 bit block + /// sizes, based on the Threefish tweakable block cipher. + /// + /// + /// This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 + /// competition in October 2010. + ///

+ /// Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + /// Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. + ///

+ /// This implementation is the basis for and , implementing the + /// parameter based configuration system that allows Skein to be adapted to multiple applications.
+ /// Initialising the engine with allows standard and arbitrary parameters to + /// be applied during the Skein hash function. + ///

+ /// Implemented: + ///

    + ///
  • 256, 512 and 1024 bit internal states.
  • + ///
  • Full 96 bit input length.
  • + ///
  • Parameters defined in the Skein specification, and arbitrary other pre and post message + /// parameters.
  • + ///
  • Arbitrary output size in 1 byte intervals.
  • + ///
+ ///

+ /// Not implemented: + ///

    + ///
  • Sub-byte length input (bit padding).
  • + ///
  • Tree hashing.
  • + ///
+ ///
+ /// + public class SkeinEngine + : IMemoable + { + /// + /// 256 bit block size - Skein-256 + /// + public const int SKEIN_256 = ThreefishEngine.BLOCKSIZE_256; + /// + /// 512 bit block size - Skein-512 + /// + public const int SKEIN_512 = ThreefishEngine.BLOCKSIZE_512; + /// + /// 1024 bit block size - Skein-1024 + /// + public const int SKEIN_1024 = ThreefishEngine.BLOCKSIZE_1024; + + // Minimal at present, but more complex when tree hashing is implemented + private class Configuration + { + private byte[] bytes = new byte[32]; + + public Configuration(long outputSizeBits) + { + // 0..3 = ASCII SHA3 + bytes[0] = (byte)'S'; + bytes[1] = (byte)'H'; + bytes[2] = (byte)'A'; + bytes[3] = (byte)'3'; + + // 4..5 = version number in LSB order + bytes[4] = 1; + bytes[5] = 0; + + // 8..15 = output length + ThreefishEngine.WordToBytes((ulong)outputSizeBits, bytes, 8); + } + + public byte[] Bytes + { + get { return bytes; } + } + + } + + public class Parameter + { + private int type; + private byte[] value; + + public Parameter(int type, byte[] value) + { + this.type = type; + this.value = value; + } + + public int Type + { + get { return type; } + } + + public byte[] Value + { + get { return value; } + } + + } + + /** + * The parameter type for the Skein key. + */ + private const int PARAM_TYPE_KEY = 0; + + /** + * The parameter type for the Skein configuration block. + */ + private const int PARAM_TYPE_CONFIG = 4; + + /** + * The parameter type for the message. + */ + private const int PARAM_TYPE_MESSAGE = 48; + + /** + * The parameter type for the output transformation. + */ + private const int PARAM_TYPE_OUTPUT = 63; + + /** + * Precalculated UBI(CFG) states for common state/output combinations without key or other + * pre-message params. + */ + private static readonly IDictionary INITIAL_STATES = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static SkeinEngine() + { + // From Appendix C of the Skein 1.3 NIST submission + InitialState(SKEIN_256, 128, new ulong[]{ + 0xe1111906964d7260UL, + 0x883daaa77c8d811cUL, + 0x10080df491960f7aUL, + 0xccf7dde5b45bc1c2UL}); + + InitialState(SKEIN_256, 160, new ulong[]{ + 0x1420231472825e98UL, + 0x2ac4e9a25a77e590UL, + 0xd47a58568838d63eUL, + 0x2dd2e4968586ab7dUL}); + + InitialState(SKEIN_256, 224, new ulong[]{ + 0xc6098a8c9ae5ea0bUL, + 0x876d568608c5191cUL, + 0x99cb88d7d7f53884UL, + 0x384bddb1aeddb5deUL}); + + InitialState(SKEIN_256, 256, new ulong[]{ + 0xfc9da860d048b449UL, + 0x2fca66479fa7d833UL, + 0xb33bc3896656840fUL, + 0x6a54e920fde8da69UL}); + + InitialState(SKEIN_512, 128, new ulong[]{ + 0xa8bc7bf36fbf9f52UL, + 0x1e9872cebd1af0aaUL, + 0x309b1790b32190d3UL, + 0xbcfbb8543f94805cUL, + 0x0da61bcd6e31b11bUL, + 0x1a18ebead46a32e3UL, + 0xa2cc5b18ce84aa82UL, + 0x6982ab289d46982dUL}); + + InitialState(SKEIN_512, 160, new ulong[]{ + 0x28b81a2ae013bd91UL, + 0xc2f11668b5bdf78fUL, + 0x1760d8f3f6a56f12UL, + 0x4fb747588239904fUL, + 0x21ede07f7eaf5056UL, + 0xd908922e63ed70b8UL, + 0xb8ec76ffeccb52faUL, + 0x01a47bb8a3f27a6eUL}); + + InitialState(SKEIN_512, 224, new ulong[]{ + 0xccd0616248677224UL, + 0xcba65cf3a92339efUL, + 0x8ccd69d652ff4b64UL, + 0x398aed7b3ab890b4UL, + 0x0f59d1b1457d2bd0UL, + 0x6776fe6575d4eb3dUL, + 0x99fbc70e997413e9UL, + 0x9e2cfccfe1c41ef7UL}); + + InitialState(SKEIN_512, 384, new ulong[]{ + 0xa3f6c6bf3a75ef5fUL, + 0xb0fef9ccfd84faa4UL, + 0x9d77dd663d770cfeUL, + 0xd798cbf3b468fddaUL, + 0x1bc4a6668a0e4465UL, + 0x7ed7d434e5807407UL, + 0x548fc1acd4ec44d6UL, + 0x266e17546aa18ff8UL}); + + InitialState(SKEIN_512, 512, new ulong[]{ + 0x4903adff749c51ceUL, + 0x0d95de399746df03UL, + 0x8fd1934127c79bceUL, + 0x9a255629ff352cb1UL, + 0x5db62599df6ca7b0UL, + 0xeabe394ca9d5c3f4UL, + 0x991112c71a75b523UL, + 0xae18a40b660fcc33UL}); + } + + private static void InitialState(int blockSize, int outputSize, ulong[] state) + { + INITIAL_STATES.Add(VariantIdentifier(blockSize / 8, outputSize / 8), state); + } + + private static int VariantIdentifier(int blockSizeBytes, int outputSizeBytes) + { + return (outputSizeBytes << 16) | blockSizeBytes; + } + + private class UbiTweak + { + /** + * Point at which position might overflow long, so switch to add with carry logic + */ + private const ulong LOW_RANGE = UInt64.MaxValue - UInt32.MaxValue; + + /** + * Bit 127 = final + */ + private const ulong T1_FINAL = 1UL << 63; + + /** + * Bit 126 = first + */ + private const ulong T1_FIRST = 1UL << 62; + + /** + * UBI uses a 128 bit tweak + */ + private ulong[] tweak = new ulong[2]; + + /** + * Whether 64 bit position exceeded + */ + private bool extendedPosition; + + public UbiTweak() + { + Reset(); + } + + public void Reset(UbiTweak tweak) + { + this.tweak = Arrays.Clone(tweak.tweak, this.tweak); + this.extendedPosition = tweak.extendedPosition; + } + + public void Reset() + { + tweak[0] = 0; + tweak[1] = 0; + extendedPosition = false; + First = true; + } + + public uint Type + { + get + { + return (uint)((tweak[1] >> 56) & 0x3FUL); + } + + set + { + // Bits 120..125 = type + tweak[1] = (tweak[1] & 0xFFFFFFC000000000UL) | ((value & 0x3FUL) << 56); + } + } + + public bool First + { + get + { + return ((tweak[1] & T1_FIRST) != 0); + } + set + { + if (value) + { + tweak[1] |= T1_FIRST; + } + else + { + tweak[1] &= ~T1_FIRST; + } + } + } + + public bool Final + { + get + { + return ((tweak[1] & T1_FINAL) != 0); + } + set + { + if (value) + { + tweak[1] |= T1_FINAL; + } + else + { + tweak[1] &= ~T1_FINAL; + } + } + } + + /** + * Advances the position in the tweak by the specified value. + */ + public void AdvancePosition(int advance) + { + // Bits 0..95 = position + if (extendedPosition) + { + ulong[] parts = new ulong[3]; + parts[0] = tweak[0] & 0xFFFFFFFFUL; + parts[1] = (tweak[0] >> 32) & 0xFFFFFFFFUL; + parts[2] = tweak[1] & 0xFFFFFFFFUL; + + ulong carry = (ulong)advance; + for (int i = 0; i < parts.Length; i++) + { + carry += parts[i]; + parts[i] = carry; + carry >>= 32; + } + tweak[0] = ((parts[1] & 0xFFFFFFFFUL) << 32) | (parts[0] & 0xFFFFFFFFUL); + tweak[1] = (tweak[1] & 0xFFFFFFFF00000000UL) | (parts[2] & 0xFFFFFFFFUL); + } + else + { + ulong position = tweak[0]; + position += (uint)advance; + tweak[0] = position; + if (position > LOW_RANGE) + { + extendedPosition = true; + } + } + } + + public ulong[] GetWords() + { + return tweak; + } + + public override string ToString() + { + return Type + " first: " + First + ", final: " + Final; + } + + } + + /** + * The Unique Block Iteration chaining mode. + */ + // TODO: This might be better as methods... + private class UBI + { + private readonly UbiTweak tweak = new UbiTweak(); + + private readonly SkeinEngine engine; + + /** + * Buffer for the current block of message data + */ + private byte[] currentBlock; + + /** + * Offset into the current message block + */ + private int currentOffset; + + /** + * Buffer for message words for feedback into encrypted block + */ + private ulong[] message; + + public UBI(SkeinEngine engine, int blockSize) + { + this.engine = engine; + currentBlock = new byte[blockSize]; + message = new ulong[currentBlock.Length / 8]; + } + + public void Reset(UBI ubi) + { + currentBlock = Arrays.Clone(ubi.currentBlock, currentBlock); + currentOffset = ubi.currentOffset; + message = Arrays.Clone(ubi.message, this.message); + tweak.Reset(ubi.tweak); + } + + public void Reset(int type) + { + tweak.Reset(); + tweak.Type = (uint)type; + currentOffset = 0; + } + + public void Update(byte[] value, int offset, int len, ulong[] output) + { + /* + * Buffer complete blocks for the underlying Threefish cipher, only flushing when there + * are subsequent bytes (last block must be processed in doFinal() with final=true set). + */ + int copied = 0; + while (len > copied) + { + if (currentOffset == currentBlock.Length) + { + ProcessBlock(output); + tweak.First = false; + currentOffset = 0; + } + + int toCopy = System.Math.Min((len - copied), currentBlock.Length - currentOffset); + Array.Copy(value, offset + copied, currentBlock, currentOffset, toCopy); + copied += toCopy; + currentOffset += toCopy; + tweak.AdvancePosition(toCopy); + } + } + + private void ProcessBlock(ulong[] output) + { + engine.threefish.Init(true, engine.chain, tweak.GetWords()); + for (int i = 0; i < message.Length; i++) + { + message[i] = ThreefishEngine.BytesToWord(currentBlock, i * 8); + } + + engine.threefish.ProcessBlock(message, output); + + for (int i = 0; i < output.Length; i++) + { + output[i] ^= message[i]; + } + } + + public void DoFinal(ulong[] output) + { + // Pad remainder of current block with zeroes + for (int i = currentOffset; i < currentBlock.Length; i++) + { + currentBlock[i] = 0; + } + + tweak.Final = true; + ProcessBlock(output); + } + + } + + /** + * Underlying Threefish tweakable block cipher + */ + private readonly ThreefishEngine threefish; + + /** + * Size of the digest output, in bytes + */ + private readonly int outputSizeBytes; + + /** + * The current chaining/state value + */ + private ulong[] chain; + + /** + * The initial state value + */ + private ulong[] initialState; + + /** + * The (optional) key parameter + */ + private byte[] key; + + /** + * Parameters to apply prior to the message + */ + private Parameter[] preMessageParameters; + + /** + * Parameters to apply after the message, but prior to output + */ + private Parameter[] postMessageParameters; + + /** + * The current UBI operation + */ + private readonly UBI ubi; + + /** + * Buffer for single byte update method + */ + private readonly byte[] singleByte = new byte[1]; + + /// + /// Constructs a Skein digest with an internal state size and output size. + /// + /// the internal state size in bits - one of or + /// . + /// the output/digest size to produce in bits, which must be an integral number of + /// bytes. + public SkeinEngine(int blockSizeBits, int outputSizeBits) + { + if (outputSizeBits % 8 != 0) + { + throw new ArgumentException("Output size must be a multiple of 8 bits. :" + outputSizeBits); + } + // TODO: Prevent digest sizes > block size? + this.outputSizeBytes = outputSizeBits / 8; + + this.threefish = new ThreefishEngine(blockSizeBits); + this.ubi = new UBI(this,threefish.GetBlockSize()); + } + + /// + /// Creates a SkeinEngine as an exact copy of an existing instance. + /// + public SkeinEngine(SkeinEngine engine) + : this(engine.BlockSize * 8, engine.OutputSize * 8) + { + CopyIn(engine); + } + + private void CopyIn(SkeinEngine engine) + { + this.ubi.Reset(engine.ubi); + this.chain = Arrays.Clone(engine.chain, this.chain); + this.initialState = Arrays.Clone(engine.initialState, this.initialState); + this.key = Arrays.Clone(engine.key, this.key); + this.preMessageParameters = Clone(engine.preMessageParameters, this.preMessageParameters); + this.postMessageParameters = Clone(engine.postMessageParameters, this.postMessageParameters); + } + + private static Parameter[] Clone(Parameter[] data, Parameter[] existing) + { + if (data == null) + { + return null; + } + if ((existing == null) || (existing.Length != data.Length)) + { + existing = new Parameter[data.Length]; + } + Array.Copy(data, 0, existing, 0, existing.Length); + return existing; + } + + public IMemoable Copy() + { + return new SkeinEngine(this); + } + + public void Reset(IMemoable other) + { + SkeinEngine s = (SkeinEngine)other; + if ((BlockSize != s.BlockSize) || (outputSizeBytes != s.outputSizeBytes)) + { + throw new MemoableResetException("Incompatible parameters in provided SkeinEngine."); + } + CopyIn(s); + } + + public int OutputSize + { + get { return outputSizeBytes; } + } + + public int BlockSize + { + get { return threefish.GetBlockSize (); } + } + + /// + /// Initialises the Skein engine with the provided parameters. See for + /// details on the parameterisation of the Skein hash function. + /// + /// the parameters to apply to this engine, or null to use no parameters. + public void Init(SkeinParameters parameters) + { + this.chain = null; + this.key = null; + this.preMessageParameters = null; + this.postMessageParameters = null; + + if (parameters != null) + { + byte[] key = parameters.GetKey(); + if (key.Length < 16) + { + throw new ArgumentException("Skein key must be at least 128 bits."); + } + InitParams(parameters.GetParameters()); + } + CreateInitialState(); + + // Initialise message block + UbiInit(PARAM_TYPE_MESSAGE); + } + + private void InitParams(IDictionary parameters) + { + IEnumerator keys = parameters.Keys.GetEnumerator(); + IList pre = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + IList post = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + while (keys.MoveNext()) + { + int type = (int)keys.Current; + byte[] value = (byte[])parameters[type]; + + if (type == PARAM_TYPE_KEY) + { + this.key = value; + } + else if (type < PARAM_TYPE_MESSAGE) + { + pre.Add(new Parameter(type, value)); + } + else + { + post.Add(new Parameter(type, value)); + } + } + preMessageParameters = new Parameter[pre.Count]; + pre.CopyTo(preMessageParameters, 0); + Array.Sort(preMessageParameters); + + postMessageParameters = new Parameter[post.Count]; + post.CopyTo(postMessageParameters, 0); + Array.Sort(postMessageParameters); + } + + /** + * Calculate the initial (pre message block) chaining state. + */ + private void CreateInitialState() + { + ulong[] precalc = (ulong[])INITIAL_STATES[VariantIdentifier(BlockSize, OutputSize)]; + if ((key == null) && (precalc != null)) + { + // Precalculated UBI(CFG) + chain = Arrays.Clone(precalc); + } + else + { + // Blank initial state + chain = new ulong[BlockSize / 8]; + + // Process key block + if (key != null) + { + UbiComplete(SkeinParameters.PARAM_TYPE_KEY, key); + } + + // Process configuration block + UbiComplete(PARAM_TYPE_CONFIG, new Configuration(outputSizeBytes * 8).Bytes); + } + + // Process additional pre-message parameters + if (preMessageParameters != null) + { + for (int i = 0; i < preMessageParameters.Length; i++) + { + Parameter param = preMessageParameters[i]; + UbiComplete(param.Type, param.Value); + } + } + initialState = Arrays.Clone(chain); + } + + /// + /// Reset the engine to the initial state (with the key and any pre-message parameters , ready to + /// accept message input. + /// + public void Reset() + { + Array.Copy(initialState, 0, chain, 0, chain.Length); + + UbiInit(PARAM_TYPE_MESSAGE); + } + + private void UbiComplete(int type, byte[] value) + { + UbiInit(type); + this.ubi.Update(value, 0, value.Length, chain); + UbiFinal(); + } + + private void UbiInit(int type) + { + this.ubi.Reset(type); + } + + private void UbiFinal() + { + ubi.DoFinal(chain); + } + + private void CheckInitialised() + { + if (this.ubi == null) + { + throw new ArgumentException("Skein engine is not initialised."); + } + } + + public void Update(byte inByte) + { + singleByte[0] = inByte; + Update(singleByte, 0, 1); + } + + public void Update(byte[] inBytes, int inOff, int len) + { + CheckInitialised(); + ubi.Update(inBytes, inOff, len, chain); + } + + public int DoFinal(byte[] outBytes, int outOff) + { + CheckInitialised(); + if (outBytes.Length < (outOff + outputSizeBytes)) + { + throw new DataLengthException("Output buffer is too short to hold output"); + } + + // Finalise message block + UbiFinal(); + + // Process additional post-message parameters + if (postMessageParameters != null) + { + for (int i = 0; i < postMessageParameters.Length; i++) + { + Parameter param = postMessageParameters[i]; + UbiComplete(param.Type, param.Value); + } + } + + // Perform the output transform + int blockSize = BlockSize; + int blocksRequired = ((outputSizeBytes + blockSize - 1) / blockSize); + for (int i = 0; i < blocksRequired; i++) + { + int toWrite = System.Math.Min(blockSize, outputSizeBytes - (i * blockSize)); + Output((ulong)i, outBytes, outOff + (i * blockSize), toWrite); + } + + Reset(); + + return outputSizeBytes; + } + + private void Output(ulong outputSequence, byte[] outBytes, int outOff, int outputBytes) + { + byte[] currentBytes = new byte[8]; + ThreefishEngine.WordToBytes(outputSequence, currentBytes, 0); + + // Output is a sequence of UBI invocations all of which use and preserve the pre-output + // state + ulong[] outputWords = new ulong[chain.Length]; + UbiInit(PARAM_TYPE_OUTPUT); + this.ubi.Update(currentBytes, 0, currentBytes.Length, outputWords); + ubi.DoFinal(outputWords); + + int wordsRequired = ((outputBytes + 8 - 1) / 8); + for (int i = 0; i < wordsRequired; i++) + { + int toWrite = System.Math.Min(8, outputBytes - (i * 8)); + if (toWrite == 8) + { + ThreefishEngine.WordToBytes(outputWords[i], outBytes, outOff + (i * 8)); + } + else + { + ThreefishEngine.WordToBytes(outputWords[i], currentBytes, 0); + Array.Copy(currentBytes, 0, outBytes, outOff + (i * 8), toWrite); + } + } + } + + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinEngine.cs.meta new file mode 100644 index 00000000..8f064ca7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/SkeinEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e565ca2c8b5ee54ebf0856d25fc2b8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/TigerDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/TigerDigest.cs new file mode 100644 index 00000000..a3b2160c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/TigerDigest.cs @@ -0,0 +1,887 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * implementation of Tiger based on: + * + * http://www.cs.technion.ac.il/~biham/Reports/Tiger + */ + public class TigerDigest + : IDigest, IMemoable + { + private const int MyByteLength = 64; + + /* + * S-Boxes. + */ + private static readonly long[] t1 = { + unchecked((long) 0x02AAB17CF7E90C5EL) /* 0 */, unchecked((long) 0xAC424B03E243A8ECL) /* 1 */, + unchecked((long) 0x72CD5BE30DD5FCD3L) /* 2 */, unchecked((long) 0x6D019B93F6F97F3AL) /* 3 */, + unchecked((long) 0xCD9978FFD21F9193L) /* 4 */, unchecked((long) 0x7573A1C9708029E2L) /* 5 */, + unchecked((long) 0xB164326B922A83C3L) /* 6 */, unchecked((long) 0x46883EEE04915870L) /* 7 */, + unchecked((long) 0xEAACE3057103ECE6L) /* 8 */, unchecked((long) 0xC54169B808A3535CL) /* 9 */, + unchecked((long) 0x4CE754918DDEC47CL) /* 10 */, unchecked((long) 0x0AA2F4DFDC0DF40CL) /* 11 */, + unchecked((long) 0x10B76F18A74DBEFAL) /* 12 */, unchecked((long) 0xC6CCB6235AD1AB6AL) /* 13 */, + unchecked((long) 0x13726121572FE2FFL) /* 14 */, unchecked((long) 0x1A488C6F199D921EL) /* 15 */, + unchecked((long) 0x4BC9F9F4DA0007CAL) /* 16 */, unchecked((long) 0x26F5E6F6E85241C7L) /* 17 */, + unchecked((long) 0x859079DBEA5947B6L) /* 18 */, unchecked((long) 0x4F1885C5C99E8C92L) /* 19 */, + unchecked((long) 0xD78E761EA96F864BL) /* 20 */, unchecked((long) 0x8E36428C52B5C17DL) /* 21 */, + unchecked((long) 0x69CF6827373063C1L) /* 22 */, unchecked((long) 0xB607C93D9BB4C56EL) /* 23 */, + unchecked((long) 0x7D820E760E76B5EAL) /* 24 */, unchecked((long) 0x645C9CC6F07FDC42L) /* 25 */, + unchecked((long) 0xBF38A078243342E0L) /* 26 */, unchecked((long) 0x5F6B343C9D2E7D04L) /* 27 */, + unchecked((long) 0xF2C28AEB600B0EC6L) /* 28 */, unchecked((long) 0x6C0ED85F7254BCACL) /* 29 */, + unchecked((long) 0x71592281A4DB4FE5L) /* 30 */, unchecked((long) 0x1967FA69CE0FED9FL) /* 31 */, + unchecked((long) 0xFD5293F8B96545DBL) /* 32 */, unchecked((long) 0xC879E9D7F2A7600BL) /* 33 */, + unchecked((long) 0x860248920193194EL) /* 34 */, unchecked((long) 0xA4F9533B2D9CC0B3L) /* 35 */, + unchecked((long) 0x9053836C15957613L) /* 36 */, unchecked((long) 0xDB6DCF8AFC357BF1L) /* 37 */, + unchecked((long) 0x18BEEA7A7A370F57L) /* 38 */, unchecked((long) 0x037117CA50B99066L) /* 39 */, + unchecked((long) 0x6AB30A9774424A35L) /* 40 */, unchecked((long) 0xF4E92F02E325249BL) /* 41 */, + unchecked((long) 0x7739DB07061CCAE1L) /* 42 */, unchecked((long) 0xD8F3B49CECA42A05L) /* 43 */, + unchecked((long) 0xBD56BE3F51382F73L) /* 44 */, unchecked((long) 0x45FAED5843B0BB28L) /* 45 */, + unchecked((long) 0x1C813D5C11BF1F83L) /* 46 */, unchecked((long) 0x8AF0E4B6D75FA169L) /* 47 */, + unchecked((long) 0x33EE18A487AD9999L) /* 48 */, unchecked((long) 0x3C26E8EAB1C94410L) /* 49 */, + unchecked((long) 0xB510102BC0A822F9L) /* 50 */, unchecked((long) 0x141EEF310CE6123BL) /* 51 */, + unchecked((long) 0xFC65B90059DDB154L) /* 52 */, unchecked((long) 0xE0158640C5E0E607L) /* 53 */, + unchecked((long) 0x884E079826C3A3CFL) /* 54 */, unchecked((long) 0x930D0D9523C535FDL) /* 55 */, + unchecked((long) 0x35638D754E9A2B00L) /* 56 */, unchecked((long) 0x4085FCCF40469DD5L) /* 57 */, + unchecked((long) 0xC4B17AD28BE23A4CL) /* 58 */, unchecked((long) 0xCAB2F0FC6A3E6A2EL) /* 59 */, + unchecked((long) 0x2860971A6B943FCDL) /* 60 */, unchecked((long) 0x3DDE6EE212E30446L) /* 61 */, + unchecked((long) 0x6222F32AE01765AEL) /* 62 */, unchecked((long) 0x5D550BB5478308FEL) /* 63 */, + unchecked((long) 0xA9EFA98DA0EDA22AL) /* 64 */, unchecked((long) 0xC351A71686C40DA7L) /* 65 */, + unchecked((long) 0x1105586D9C867C84L) /* 66 */, unchecked((long) 0xDCFFEE85FDA22853L) /* 67 */, + unchecked((long) 0xCCFBD0262C5EEF76L) /* 68 */, unchecked((long) 0xBAF294CB8990D201L) /* 69 */, + unchecked((long) 0xE69464F52AFAD975L) /* 70 */, unchecked((long) 0x94B013AFDF133E14L) /* 71 */, + unchecked((long) 0x06A7D1A32823C958L) /* 72 */, unchecked((long) 0x6F95FE5130F61119L) /* 73 */, + unchecked((long) 0xD92AB34E462C06C0L) /* 74 */, unchecked((long) 0xED7BDE33887C71D2L) /* 75 */, + unchecked((long) 0x79746D6E6518393EL) /* 76 */, unchecked((long) 0x5BA419385D713329L) /* 77 */, + unchecked((long) 0x7C1BA6B948A97564L) /* 78 */, unchecked((long) 0x31987C197BFDAC67L) /* 79 */, + unchecked((long) 0xDE6C23C44B053D02L) /* 80 */, unchecked((long) 0x581C49FED002D64DL) /* 81 */, + unchecked((long) 0xDD474D6338261571L) /* 82 */, unchecked((long) 0xAA4546C3E473D062L) /* 83 */, + unchecked((long) 0x928FCE349455F860L) /* 84 */, unchecked((long) 0x48161BBACAAB94D9L) /* 85 */, + unchecked((long) 0x63912430770E6F68L) /* 86 */, unchecked((long) 0x6EC8A5E602C6641CL) /* 87 */, + unchecked((long) 0x87282515337DDD2BL) /* 88 */, unchecked((long) 0x2CDA6B42034B701BL) /* 89 */, + unchecked((long) 0xB03D37C181CB096DL) /* 90 */, unchecked((long) 0xE108438266C71C6FL) /* 91 */, + unchecked((long) 0x2B3180C7EB51B255L) /* 92 */, unchecked((long) 0xDF92B82F96C08BBCL) /* 93 */, + unchecked((long) 0x5C68C8C0A632F3BAL) /* 94 */, unchecked((long) 0x5504CC861C3D0556L) /* 95 */, + unchecked((long) 0xABBFA4E55FB26B8FL) /* 96 */, unchecked((long) 0x41848B0AB3BACEB4L) /* 97 */, + unchecked((long) 0xB334A273AA445D32L) /* 98 */, unchecked((long) 0xBCA696F0A85AD881L) /* 99 */, + unchecked((long) 0x24F6EC65B528D56CL) /* 100 */, unchecked((long) 0x0CE1512E90F4524AL) /* 101 */, + unchecked((long) 0x4E9DD79D5506D35AL) /* 102 */, unchecked((long) 0x258905FAC6CE9779L) /* 103 */, + unchecked((long) 0x2019295B3E109B33L) /* 104 */, unchecked((long) 0xF8A9478B73A054CCL) /* 105 */, + unchecked((long) 0x2924F2F934417EB0L) /* 106 */, unchecked((long) 0x3993357D536D1BC4L) /* 107 */, + unchecked((long) 0x38A81AC21DB6FF8BL) /* 108 */, unchecked((long) 0x47C4FBF17D6016BFL) /* 109 */, + unchecked((long) 0x1E0FAADD7667E3F5L) /* 110 */, unchecked((long) 0x7ABCFF62938BEB96L) /* 111 */, + unchecked((long) 0xA78DAD948FC179C9L) /* 112 */, unchecked((long) 0x8F1F98B72911E50DL) /* 113 */, + unchecked((long) 0x61E48EAE27121A91L) /* 114 */, unchecked((long) 0x4D62F7AD31859808L) /* 115 */, + unchecked((long) 0xECEBA345EF5CEAEBL) /* 116 */, unchecked((long) 0xF5CEB25EBC9684CEL) /* 117 */, + unchecked((long) 0xF633E20CB7F76221L) /* 118 */, unchecked((long) 0xA32CDF06AB8293E4L) /* 119 */, + unchecked((long) 0x985A202CA5EE2CA4L) /* 120 */, unchecked((long) 0xCF0B8447CC8A8FB1L) /* 121 */, + unchecked((long) 0x9F765244979859A3L) /* 122 */, unchecked((long) 0xA8D516B1A1240017L) /* 123 */, + unchecked((long) 0x0BD7BA3EBB5DC726L) /* 124 */, unchecked((long) 0xE54BCA55B86ADB39L) /* 125 */, + unchecked((long) 0x1D7A3AFD6C478063L) /* 126 */, unchecked((long) 0x519EC608E7669EDDL) /* 127 */, + unchecked((long) 0x0E5715A2D149AA23L) /* 128 */, unchecked((long) 0x177D4571848FF194L) /* 129 */, + unchecked((long) 0xEEB55F3241014C22L) /* 130 */, unchecked((long) 0x0F5E5CA13A6E2EC2L) /* 131 */, + unchecked((long) 0x8029927B75F5C361L) /* 132 */, unchecked((long) 0xAD139FABC3D6E436L) /* 133 */, + unchecked((long) 0x0D5DF1A94CCF402FL) /* 134 */, unchecked((long) 0x3E8BD948BEA5DFC8L) /* 135 */, + unchecked((long) 0xA5A0D357BD3FF77EL) /* 136 */, unchecked((long) 0xA2D12E251F74F645L) /* 137 */, + unchecked((long) 0x66FD9E525E81A082L) /* 138 */, unchecked((long) 0x2E0C90CE7F687A49L) /* 139 */, + unchecked((long) 0xC2E8BCBEBA973BC5L) /* 140 */, unchecked((long) 0x000001BCE509745FL) /* 141 */, + unchecked((long) 0x423777BBE6DAB3D6L) /* 142 */, unchecked((long) 0xD1661C7EAEF06EB5L) /* 143 */, + unchecked((long) 0xA1781F354DAACFD8L) /* 144 */, unchecked((long) 0x2D11284A2B16AFFCL) /* 145 */, + unchecked((long) 0xF1FC4F67FA891D1FL) /* 146 */, unchecked((long) 0x73ECC25DCB920ADAL) /* 147 */, + unchecked((long) 0xAE610C22C2A12651L) /* 148 */, unchecked((long) 0x96E0A810D356B78AL) /* 149 */, + unchecked((long) 0x5A9A381F2FE7870FL) /* 150 */, unchecked((long) 0xD5AD62EDE94E5530L) /* 151 */, + unchecked((long) 0xD225E5E8368D1427L) /* 152 */, unchecked((long) 0x65977B70C7AF4631L) /* 153 */, + unchecked((long) 0x99F889B2DE39D74FL) /* 154 */, unchecked((long) 0x233F30BF54E1D143L) /* 155 */, + unchecked((long) 0x9A9675D3D9A63C97L) /* 156 */, unchecked((long) 0x5470554FF334F9A8L) /* 157 */, + unchecked((long) 0x166ACB744A4F5688L) /* 158 */, unchecked((long) 0x70C74CAAB2E4AEADL) /* 159 */, + unchecked((long) 0xF0D091646F294D12L) /* 160 */, unchecked((long) 0x57B82A89684031D1L) /* 161 */, + unchecked((long) 0xEFD95A5A61BE0B6BL) /* 162 */, unchecked((long) 0x2FBD12E969F2F29AL) /* 163 */, + unchecked((long) 0x9BD37013FEFF9FE8L) /* 164 */, unchecked((long) 0x3F9B0404D6085A06L) /* 165 */, + unchecked((long) 0x4940C1F3166CFE15L) /* 166 */, unchecked((long) 0x09542C4DCDF3DEFBL) /* 167 */, + unchecked((long) 0xB4C5218385CD5CE3L) /* 168 */, unchecked((long) 0xC935B7DC4462A641L) /* 169 */, + unchecked((long) 0x3417F8A68ED3B63FL) /* 170 */, unchecked((long) 0xB80959295B215B40L) /* 171 */, + unchecked((long) 0xF99CDAEF3B8C8572L) /* 172 */, unchecked((long) 0x018C0614F8FCB95DL) /* 173 */, + unchecked((long) 0x1B14ACCD1A3ACDF3L) /* 174 */, unchecked((long) 0x84D471F200BB732DL) /* 175 */, + unchecked((long) 0xC1A3110E95E8DA16L) /* 176 */, unchecked((long) 0x430A7220BF1A82B8L) /* 177 */, + unchecked((long) 0xB77E090D39DF210EL) /* 178 */, unchecked((long) 0x5EF4BD9F3CD05E9DL) /* 179 */, + unchecked((long) 0x9D4FF6DA7E57A444L) /* 180 */, unchecked((long) 0xDA1D60E183D4A5F8L) /* 181 */, + unchecked((long) 0xB287C38417998E47L) /* 182 */, unchecked((long) 0xFE3EDC121BB31886L) /* 183 */, + unchecked((long) 0xC7FE3CCC980CCBEFL) /* 184 */, unchecked((long) 0xE46FB590189BFD03L) /* 185 */, + unchecked((long) 0x3732FD469A4C57DCL) /* 186 */, unchecked((long) 0x7EF700A07CF1AD65L) /* 187 */, + unchecked((long) 0x59C64468A31D8859L) /* 188 */, unchecked((long) 0x762FB0B4D45B61F6L) /* 189 */, + unchecked((long) 0x155BAED099047718L) /* 190 */, unchecked((long) 0x68755E4C3D50BAA6L) /* 191 */, + unchecked((long) 0xE9214E7F22D8B4DFL) /* 192 */, unchecked((long) 0x2ADDBF532EAC95F4L) /* 193 */, + unchecked((long) 0x32AE3909B4BD0109L) /* 194 */, unchecked((long) 0x834DF537B08E3450L) /* 195 */, + unchecked((long) 0xFA209DA84220728DL) /* 196 */, unchecked((long) 0x9E691D9B9EFE23F7L) /* 197 */, + unchecked((long) 0x0446D288C4AE8D7FL) /* 198 */, unchecked((long) 0x7B4CC524E169785BL) /* 199 */, + unchecked((long) 0x21D87F0135CA1385L) /* 200 */, unchecked((long) 0xCEBB400F137B8AA5L) /* 201 */, + unchecked((long) 0x272E2B66580796BEL) /* 202 */, unchecked((long) 0x3612264125C2B0DEL) /* 203 */, + unchecked((long) 0x057702BDAD1EFBB2L) /* 204 */, unchecked((long) 0xD4BABB8EACF84BE9L) /* 205 */, + unchecked((long) 0x91583139641BC67BL) /* 206 */, unchecked((long) 0x8BDC2DE08036E024L) /* 207 */, + unchecked((long) 0x603C8156F49F68EDL) /* 208 */, unchecked((long) 0xF7D236F7DBEF5111L) /* 209 */, + unchecked((long) 0x9727C4598AD21E80L) /* 210 */, unchecked((long) 0xA08A0896670A5FD7L) /* 211 */, + unchecked((long) 0xCB4A8F4309EBA9CBL) /* 212 */, unchecked((long) 0x81AF564B0F7036A1L) /* 213 */, + unchecked((long) 0xC0B99AA778199ABDL) /* 214 */, unchecked((long) 0x959F1EC83FC8E952L) /* 215 */, + unchecked((long) 0x8C505077794A81B9L) /* 216 */, unchecked((long) 0x3ACAAF8F056338F0L) /* 217 */, + unchecked((long) 0x07B43F50627A6778L) /* 218 */, unchecked((long) 0x4A44AB49F5ECCC77L) /* 219 */, + unchecked((long) 0x3BC3D6E4B679EE98L) /* 220 */, unchecked((long) 0x9CC0D4D1CF14108CL) /* 221 */, + unchecked((long) 0x4406C00B206BC8A0L) /* 222 */, unchecked((long) 0x82A18854C8D72D89L) /* 223 */, + unchecked((long) 0x67E366B35C3C432CL) /* 224 */, unchecked((long) 0xB923DD61102B37F2L) /* 225 */, + unchecked((long) 0x56AB2779D884271DL) /* 226 */, unchecked((long) 0xBE83E1B0FF1525AFL) /* 227 */, + unchecked((long) 0xFB7C65D4217E49A9L) /* 228 */, unchecked((long) 0x6BDBE0E76D48E7D4L) /* 229 */, + unchecked((long) 0x08DF828745D9179EL) /* 230 */, unchecked((long) 0x22EA6A9ADD53BD34L) /* 231 */, + unchecked((long) 0xE36E141C5622200AL) /* 232 */, unchecked((long) 0x7F805D1B8CB750EEL) /* 233 */, + unchecked((long) 0xAFE5C7A59F58E837L) /* 234 */, unchecked((long) 0xE27F996A4FB1C23CL) /* 235 */, + unchecked((long) 0xD3867DFB0775F0D0L) /* 236 */, unchecked((long) 0xD0E673DE6E88891AL) /* 237 */, + unchecked((long) 0x123AEB9EAFB86C25L) /* 238 */, unchecked((long) 0x30F1D5D5C145B895L) /* 239 */, + unchecked((long) 0xBB434A2DEE7269E7L) /* 240 */, unchecked((long) 0x78CB67ECF931FA38L) /* 241 */, + unchecked((long) 0xF33B0372323BBF9CL) /* 242 */, unchecked((long) 0x52D66336FB279C74L) /* 243 */, + unchecked((long) 0x505F33AC0AFB4EAAL) /* 244 */, unchecked((long) 0xE8A5CD99A2CCE187L) /* 245 */, + unchecked((long) 0x534974801E2D30BBL) /* 246 */, unchecked((long) 0x8D2D5711D5876D90L) /* 247 */, + unchecked((long) 0x1F1A412891BC038EL) /* 248 */, unchecked((long) 0xD6E2E71D82E56648L) /* 249 */, + unchecked((long) 0x74036C3A497732B7L) /* 250 */, unchecked((long) 0x89B67ED96361F5ABL) /* 251 */, + unchecked((long) 0xFFED95D8F1EA02A2L) /* 252 */, unchecked((long) 0xE72B3BD61464D43DL) /* 253 */, + unchecked((long) 0xA6300F170BDC4820L) /* 254 */, unchecked((long) 0xEBC18760ED78A77AL) /* 255 */, + }; + + private static readonly long[] t2 = { + unchecked((long) 0xE6A6BE5A05A12138L) /* 256 */, unchecked((long) 0xB5A122A5B4F87C98L) /* 257 */, + unchecked((long) 0x563C6089140B6990L) /* 258 */, unchecked((long) 0x4C46CB2E391F5DD5L) /* 259 */, + unchecked((long) 0xD932ADDBC9B79434L) /* 260 */, unchecked((long) 0x08EA70E42015AFF5L) /* 261 */, + unchecked((long) 0xD765A6673E478CF1L) /* 262 */, unchecked((long) 0xC4FB757EAB278D99L) /* 263 */, + unchecked((long) 0xDF11C6862D6E0692L) /* 264 */, unchecked((long) 0xDDEB84F10D7F3B16L) /* 265 */, + unchecked((long) 0x6F2EF604A665EA04L) /* 266 */, unchecked((long) 0x4A8E0F0FF0E0DFB3L) /* 267 */, + unchecked((long) 0xA5EDEEF83DBCBA51L) /* 268 */, unchecked((long) 0xFC4F0A2A0EA4371EL) /* 269 */, + unchecked((long) 0xE83E1DA85CB38429L) /* 270 */, unchecked((long) 0xDC8FF882BA1B1CE2L) /* 271 */, + unchecked((long) 0xCD45505E8353E80DL) /* 272 */, unchecked((long) 0x18D19A00D4DB0717L) /* 273 */, + unchecked((long) 0x34A0CFEDA5F38101L) /* 274 */, unchecked((long) 0x0BE77E518887CAF2L) /* 275 */, + unchecked((long) 0x1E341438B3C45136L) /* 276 */, unchecked((long) 0xE05797F49089CCF9L) /* 277 */, + unchecked((long) 0xFFD23F9DF2591D14L) /* 278 */, unchecked((long) 0x543DDA228595C5CDL) /* 279 */, + unchecked((long) 0x661F81FD99052A33L) /* 280 */, unchecked((long) 0x8736E641DB0F7B76L) /* 281 */, + unchecked((long) 0x15227725418E5307L) /* 282 */, unchecked((long) 0xE25F7F46162EB2FAL) /* 283 */, + unchecked((long) 0x48A8B2126C13D9FEL) /* 284 */, unchecked((long) 0xAFDC541792E76EEAL) /* 285 */, + unchecked((long) 0x03D912BFC6D1898FL) /* 286 */, unchecked((long) 0x31B1AAFA1B83F51BL) /* 287 */, + unchecked((long) 0xF1AC2796E42AB7D9L) /* 288 */, unchecked((long) 0x40A3A7D7FCD2EBACL) /* 289 */, + unchecked((long) 0x1056136D0AFBBCC5L) /* 290 */, unchecked((long) 0x7889E1DD9A6D0C85L) /* 291 */, + unchecked((long) 0xD33525782A7974AAL) /* 292 */, unchecked((long) 0xA7E25D09078AC09BL) /* 293 */, + unchecked((long) 0xBD4138B3EAC6EDD0L) /* 294 */, unchecked((long) 0x920ABFBE71EB9E70L) /* 295 */, + unchecked((long) 0xA2A5D0F54FC2625CL) /* 296 */, unchecked((long) 0xC054E36B0B1290A3L) /* 297 */, + unchecked((long) 0xF6DD59FF62FE932BL) /* 298 */, unchecked((long) 0x3537354511A8AC7DL) /* 299 */, + unchecked((long) 0xCA845E9172FADCD4L) /* 300 */, unchecked((long) 0x84F82B60329D20DCL) /* 301 */, + unchecked((long) 0x79C62CE1CD672F18L) /* 302 */, unchecked((long) 0x8B09A2ADD124642CL) /* 303 */, + unchecked((long) 0xD0C1E96A19D9E726L) /* 304 */, unchecked((long) 0x5A786A9B4BA9500CL) /* 305 */, + unchecked((long) 0x0E020336634C43F3L) /* 306 */, unchecked((long) 0xC17B474AEB66D822L) /* 307 */, + unchecked((long) 0x6A731AE3EC9BAAC2L) /* 308 */, unchecked((long) 0x8226667AE0840258L) /* 309 */, + unchecked((long) 0x67D4567691CAECA5L) /* 310 */, unchecked((long) 0x1D94155C4875ADB5L) /* 311 */, + unchecked((long) 0x6D00FD985B813FDFL) /* 312 */, unchecked((long) 0x51286EFCB774CD06L) /* 313 */, + unchecked((long) 0x5E8834471FA744AFL) /* 314 */, unchecked((long) 0xF72CA0AEE761AE2EL) /* 315 */, + unchecked((long) 0xBE40E4CDAEE8E09AL) /* 316 */, unchecked((long) 0xE9970BBB5118F665L) /* 317 */, + unchecked((long) 0x726E4BEB33DF1964L) /* 318 */, unchecked((long) 0x703B000729199762L) /* 319 */, + unchecked((long) 0x4631D816F5EF30A7L) /* 320 */, unchecked((long) 0xB880B5B51504A6BEL) /* 321 */, + unchecked((long) 0x641793C37ED84B6CL) /* 322 */, unchecked((long) 0x7B21ED77F6E97D96L) /* 323 */, + unchecked((long) 0x776306312EF96B73L) /* 324 */, unchecked((long) 0xAE528948E86FF3F4L) /* 325 */, + unchecked((long) 0x53DBD7F286A3F8F8L) /* 326 */, unchecked((long) 0x16CADCE74CFC1063L) /* 327 */, + unchecked((long) 0x005C19BDFA52C6DDL) /* 328 */, unchecked((long) 0x68868F5D64D46AD3L) /* 329 */, + unchecked((long) 0x3A9D512CCF1E186AL) /* 330 */, unchecked((long) 0x367E62C2385660AEL) /* 331 */, + unchecked((long) 0xE359E7EA77DCB1D7L) /* 332 */, unchecked((long) 0x526C0773749ABE6EL) /* 333 */, + unchecked((long) 0x735AE5F9D09F734BL) /* 334 */, unchecked((long) 0x493FC7CC8A558BA8L) /* 335 */, + unchecked((long) 0xB0B9C1533041AB45L) /* 336 */, unchecked((long) 0x321958BA470A59BDL) /* 337 */, + unchecked((long) 0x852DB00B5F46C393L) /* 338 */, unchecked((long) 0x91209B2BD336B0E5L) /* 339 */, + unchecked((long) 0x6E604F7D659EF19FL) /* 340 */, unchecked((long) 0xB99A8AE2782CCB24L) /* 341 */, + unchecked((long) 0xCCF52AB6C814C4C7L) /* 342 */, unchecked((long) 0x4727D9AFBE11727BL) /* 343 */, + unchecked((long) 0x7E950D0C0121B34DL) /* 344 */, unchecked((long) 0x756F435670AD471FL) /* 345 */, + unchecked((long) 0xF5ADD442615A6849L) /* 346 */, unchecked((long) 0x4E87E09980B9957AL) /* 347 */, + unchecked((long) 0x2ACFA1DF50AEE355L) /* 348 */, unchecked((long) 0xD898263AFD2FD556L) /* 349 */, + unchecked((long) 0xC8F4924DD80C8FD6L) /* 350 */, unchecked((long) 0xCF99CA3D754A173AL) /* 351 */, + unchecked((long) 0xFE477BACAF91BF3CL) /* 352 */, unchecked((long) 0xED5371F6D690C12DL) /* 353 */, + unchecked((long) 0x831A5C285E687094L) /* 354 */, unchecked((long) 0xC5D3C90A3708A0A4L) /* 355 */, + unchecked((long) 0x0F7F903717D06580L) /* 356 */, unchecked((long) 0x19F9BB13B8FDF27FL) /* 357 */, + unchecked((long) 0xB1BD6F1B4D502843L) /* 358 */, unchecked((long) 0x1C761BA38FFF4012L) /* 359 */, + unchecked((long) 0x0D1530C4E2E21F3BL) /* 360 */, unchecked((long) 0x8943CE69A7372C8AL) /* 361 */, + unchecked((long) 0xE5184E11FEB5CE66L) /* 362 */, unchecked((long) 0x618BDB80BD736621L) /* 363 */, + unchecked((long) 0x7D29BAD68B574D0BL) /* 364 */, unchecked((long) 0x81BB613E25E6FE5BL) /* 365 */, + unchecked((long) 0x071C9C10BC07913FL) /* 366 */, unchecked((long) 0xC7BEEB7909AC2D97L) /* 367 */, + unchecked((long) 0xC3E58D353BC5D757L) /* 368 */, unchecked((long) 0xEB017892F38F61E8L) /* 369 */, + unchecked((long) 0xD4EFFB9C9B1CC21AL) /* 370 */, unchecked((long) 0x99727D26F494F7ABL) /* 371 */, + unchecked((long) 0xA3E063A2956B3E03L) /* 372 */, unchecked((long) 0x9D4A8B9A4AA09C30L) /* 373 */, + unchecked((long) 0x3F6AB7D500090FB4L) /* 374 */, unchecked((long) 0x9CC0F2A057268AC0L) /* 375 */, + unchecked((long) 0x3DEE9D2DEDBF42D1L) /* 376 */, unchecked((long) 0x330F49C87960A972L) /* 377 */, + unchecked((long) 0xC6B2720287421B41L) /* 378 */, unchecked((long) 0x0AC59EC07C00369CL) /* 379 */, + unchecked((long) 0xEF4EAC49CB353425L) /* 380 */, unchecked((long) 0xF450244EEF0129D8L) /* 381 */, + unchecked((long) 0x8ACC46E5CAF4DEB6L) /* 382 */, unchecked((long) 0x2FFEAB63989263F7L) /* 383 */, + unchecked((long) 0x8F7CB9FE5D7A4578L) /* 384 */, unchecked((long) 0x5BD8F7644E634635L) /* 385 */, + unchecked((long) 0x427A7315BF2DC900L) /* 386 */, unchecked((long) 0x17D0C4AA2125261CL) /* 387 */, + unchecked((long) 0x3992486C93518E50L) /* 388 */, unchecked((long) 0xB4CBFEE0A2D7D4C3L) /* 389 */, + unchecked((long) 0x7C75D6202C5DDD8DL) /* 390 */, unchecked((long) 0xDBC295D8E35B6C61L) /* 391 */, + unchecked((long) 0x60B369D302032B19L) /* 392 */, unchecked((long) 0xCE42685FDCE44132L) /* 393 */, + unchecked((long) 0x06F3DDB9DDF65610L) /* 394 */, unchecked((long) 0x8EA4D21DB5E148F0L) /* 395 */, + unchecked((long) 0x20B0FCE62FCD496FL) /* 396 */, unchecked((long) 0x2C1B912358B0EE31L) /* 397 */, + unchecked((long) 0xB28317B818F5A308L) /* 398 */, unchecked((long) 0xA89C1E189CA6D2CFL) /* 399 */, + unchecked((long) 0x0C6B18576AAADBC8L) /* 400 */, unchecked((long) 0xB65DEAA91299FAE3L) /* 401 */, + unchecked((long) 0xFB2B794B7F1027E7L) /* 402 */, unchecked((long) 0x04E4317F443B5BEBL) /* 403 */, + unchecked((long) 0x4B852D325939D0A6L) /* 404 */, unchecked((long) 0xD5AE6BEEFB207FFCL) /* 405 */, + unchecked((long) 0x309682B281C7D374L) /* 406 */, unchecked((long) 0xBAE309A194C3B475L) /* 407 */, + unchecked((long) 0x8CC3F97B13B49F05L) /* 408 */, unchecked((long) 0x98A9422FF8293967L) /* 409 */, + unchecked((long) 0x244B16B01076FF7CL) /* 410 */, unchecked((long) 0xF8BF571C663D67EEL) /* 411 */, + unchecked((long) 0x1F0D6758EEE30DA1L) /* 412 */, unchecked((long) 0xC9B611D97ADEB9B7L) /* 413 */, + unchecked((long) 0xB7AFD5887B6C57A2L) /* 414 */, unchecked((long) 0x6290AE846B984FE1L) /* 415 */, + unchecked((long) 0x94DF4CDEACC1A5FDL) /* 416 */, unchecked((long) 0x058A5BD1C5483AFFL) /* 417 */, + unchecked((long) 0x63166CC142BA3C37L) /* 418 */, unchecked((long) 0x8DB8526EB2F76F40L) /* 419 */, + unchecked((long) 0xE10880036F0D6D4EL) /* 420 */, unchecked((long) 0x9E0523C9971D311DL) /* 421 */, + unchecked((long) 0x45EC2824CC7CD691L) /* 422 */, unchecked((long) 0x575B8359E62382C9L) /* 423 */, + unchecked((long) 0xFA9E400DC4889995L) /* 424 */, unchecked((long) 0xD1823ECB45721568L) /* 425 */, + unchecked((long) 0xDAFD983B8206082FL) /* 426 */, unchecked((long) 0xAA7D29082386A8CBL) /* 427 */, + unchecked((long) 0x269FCD4403B87588L) /* 428 */, unchecked((long) 0x1B91F5F728BDD1E0L) /* 429 */, + unchecked((long) 0xE4669F39040201F6L) /* 430 */, unchecked((long) 0x7A1D7C218CF04ADEL) /* 431 */, + unchecked((long) 0x65623C29D79CE5CEL) /* 432 */, unchecked((long) 0x2368449096C00BB1L) /* 433 */, + unchecked((long) 0xAB9BF1879DA503BAL) /* 434 */, unchecked((long) 0xBC23ECB1A458058EL) /* 435 */, + unchecked((long) 0x9A58DF01BB401ECCL) /* 436 */, unchecked((long) 0xA070E868A85F143DL) /* 437 */, + unchecked((long) 0x4FF188307DF2239EL) /* 438 */, unchecked((long) 0x14D565B41A641183L) /* 439 */, + unchecked((long) 0xEE13337452701602L) /* 440 */, unchecked((long) 0x950E3DCF3F285E09L) /* 441 */, + unchecked((long) 0x59930254B9C80953L) /* 442 */, unchecked((long) 0x3BF299408930DA6DL) /* 443 */, + unchecked((long) 0xA955943F53691387L) /* 444 */, unchecked((long) 0xA15EDECAA9CB8784L) /* 445 */, + unchecked((long) 0x29142127352BE9A0L) /* 446 */, unchecked((long) 0x76F0371FFF4E7AFBL) /* 447 */, + unchecked((long) 0x0239F450274F2228L) /* 448 */, unchecked((long) 0xBB073AF01D5E868BL) /* 449 */, + unchecked((long) 0xBFC80571C10E96C1L) /* 450 */, unchecked((long) 0xD267088568222E23L) /* 451 */, + unchecked((long) 0x9671A3D48E80B5B0L) /* 452 */, unchecked((long) 0x55B5D38AE193BB81L) /* 453 */, + unchecked((long) 0x693AE2D0A18B04B8L) /* 454 */, unchecked((long) 0x5C48B4ECADD5335FL) /* 455 */, + unchecked((long) 0xFD743B194916A1CAL) /* 456 */, unchecked((long) 0x2577018134BE98C4L) /* 457 */, + unchecked((long) 0xE77987E83C54A4ADL) /* 458 */, unchecked((long) 0x28E11014DA33E1B9L) /* 459 */, + unchecked((long) 0x270CC59E226AA213L) /* 460 */, unchecked((long) 0x71495F756D1A5F60L) /* 461 */, + unchecked((long) 0x9BE853FB60AFEF77L) /* 462 */, unchecked((long) 0xADC786A7F7443DBFL) /* 463 */, + unchecked((long) 0x0904456173B29A82L) /* 464 */, unchecked((long) 0x58BC7A66C232BD5EL) /* 465 */, + unchecked((long) 0xF306558C673AC8B2L) /* 466 */, unchecked((long) 0x41F639C6B6C9772AL) /* 467 */, + unchecked((long) 0x216DEFE99FDA35DAL) /* 468 */, unchecked((long) 0x11640CC71C7BE615L) /* 469 */, + unchecked((long) 0x93C43694565C5527L) /* 470 */, unchecked((long) 0xEA038E6246777839L) /* 471 */, + unchecked((long) 0xF9ABF3CE5A3E2469L) /* 472 */, unchecked((long) 0x741E768D0FD312D2L) /* 473 */, + unchecked((long) 0x0144B883CED652C6L) /* 474 */, unchecked((long) 0xC20B5A5BA33F8552L) /* 475 */, + unchecked((long) 0x1AE69633C3435A9DL) /* 476 */, unchecked((long) 0x97A28CA4088CFDECL) /* 477 */, + unchecked((long) 0x8824A43C1E96F420L) /* 478 */, unchecked((long) 0x37612FA66EEEA746L) /* 479 */, + unchecked((long) 0x6B4CB165F9CF0E5AL) /* 480 */, unchecked((long) 0x43AA1C06A0ABFB4AL) /* 481 */, + unchecked((long) 0x7F4DC26FF162796BL) /* 482 */, unchecked((long) 0x6CBACC8E54ED9B0FL) /* 483 */, + unchecked((long) 0xA6B7FFEFD2BB253EL) /* 484 */, unchecked((long) 0x2E25BC95B0A29D4FL) /* 485 */, + unchecked((long) 0x86D6A58BDEF1388CL) /* 486 */, unchecked((long) 0xDED74AC576B6F054L) /* 487 */, + unchecked((long) 0x8030BDBC2B45805DL) /* 488 */, unchecked((long) 0x3C81AF70E94D9289L) /* 489 */, + unchecked((long) 0x3EFF6DDA9E3100DBL) /* 490 */, unchecked((long) 0xB38DC39FDFCC8847L) /* 491 */, + unchecked((long) 0x123885528D17B87EL) /* 492 */, unchecked((long) 0xF2DA0ED240B1B642L) /* 493 */, + unchecked((long) 0x44CEFADCD54BF9A9L) /* 494 */, unchecked((long) 0x1312200E433C7EE6L) /* 495 */, + unchecked((long) 0x9FFCC84F3A78C748L) /* 496 */, unchecked((long) 0xF0CD1F72248576BBL) /* 497 */, + unchecked((long) 0xEC6974053638CFE4L) /* 498 */, unchecked((long) 0x2BA7B67C0CEC4E4CL) /* 499 */, + unchecked((long) 0xAC2F4DF3E5CE32EDL) /* 500 */, unchecked((long) 0xCB33D14326EA4C11L) /* 501 */, + unchecked((long) 0xA4E9044CC77E58BCL) /* 502 */, unchecked((long) 0x5F513293D934FCEFL) /* 503 */, + unchecked((long) 0x5DC9645506E55444L) /* 504 */, unchecked((long) 0x50DE418F317DE40AL) /* 505 */, + unchecked((long) 0x388CB31A69DDE259L) /* 506 */, unchecked((long) 0x2DB4A83455820A86L) /* 507 */, + unchecked((long) 0x9010A91E84711AE9L) /* 508 */, unchecked((long) 0x4DF7F0B7B1498371L) /* 509 */, + unchecked((long) 0xD62A2EABC0977179L) /* 510 */, unchecked((long) 0x22FAC097AA8D5C0EL) /* 511 */, + }; + + private static readonly long[] t3 = { + unchecked((long) 0xF49FCC2FF1DAF39BL) /* 512 */, unchecked((long) 0x487FD5C66FF29281L) /* 513 */, + unchecked((long) 0xE8A30667FCDCA83FL) /* 514 */, unchecked((long) 0x2C9B4BE3D2FCCE63L) /* 515 */, + unchecked((long) 0xDA3FF74B93FBBBC2L) /* 516 */, unchecked((long) 0x2FA165D2FE70BA66L) /* 517 */, + unchecked((long) 0xA103E279970E93D4L) /* 518 */, unchecked((long) 0xBECDEC77B0E45E71L) /* 519 */, + unchecked((long) 0xCFB41E723985E497L) /* 520 */, unchecked((long) 0xB70AAA025EF75017L) /* 521 */, + unchecked((long) 0xD42309F03840B8E0L) /* 522 */, unchecked((long) 0x8EFC1AD035898579L) /* 523 */, + unchecked((long) 0x96C6920BE2B2ABC5L) /* 524 */, unchecked((long) 0x66AF4163375A9172L) /* 525 */, + unchecked((long) 0x2174ABDCCA7127FBL) /* 526 */, unchecked((long) 0xB33CCEA64A72FF41L) /* 527 */, + unchecked((long) 0xF04A4933083066A5L) /* 528 */, unchecked((long) 0x8D970ACDD7289AF5L) /* 529 */, + unchecked((long) 0x8F96E8E031C8C25EL) /* 530 */, unchecked((long) 0xF3FEC02276875D47L) /* 531 */, + unchecked((long) 0xEC7BF310056190DDL) /* 532 */, unchecked((long) 0xF5ADB0AEBB0F1491L) /* 533 */, + unchecked((long) 0x9B50F8850FD58892L) /* 534 */, unchecked((long) 0x4975488358B74DE8L) /* 535 */, + unchecked((long) 0xA3354FF691531C61L) /* 536 */, unchecked((long) 0x0702BBE481D2C6EEL) /* 537 */, + unchecked((long) 0x89FB24057DEDED98L) /* 538 */, unchecked((long) 0xAC3075138596E902L) /* 539 */, + unchecked((long) 0x1D2D3580172772EDL) /* 540 */, unchecked((long) 0xEB738FC28E6BC30DL) /* 541 */, + unchecked((long) 0x5854EF8F63044326L) /* 542 */, unchecked((long) 0x9E5C52325ADD3BBEL) /* 543 */, + unchecked((long) 0x90AA53CF325C4623L) /* 544 */, unchecked((long) 0xC1D24D51349DD067L) /* 545 */, + unchecked((long) 0x2051CFEEA69EA624L) /* 546 */, unchecked((long) 0x13220F0A862E7E4FL) /* 547 */, + unchecked((long) 0xCE39399404E04864L) /* 548 */, unchecked((long) 0xD9C42CA47086FCB7L) /* 549 */, + unchecked((long) 0x685AD2238A03E7CCL) /* 550 */, unchecked((long) 0x066484B2AB2FF1DBL) /* 551 */, + unchecked((long) 0xFE9D5D70EFBF79ECL) /* 552 */, unchecked((long) 0x5B13B9DD9C481854L) /* 553 */, + unchecked((long) 0x15F0D475ED1509ADL) /* 554 */, unchecked((long) 0x0BEBCD060EC79851L) /* 555 */, + unchecked((long) 0xD58C6791183AB7F8L) /* 556 */, unchecked((long) 0xD1187C5052F3EEE4L) /* 557 */, + unchecked((long) 0xC95D1192E54E82FFL) /* 558 */, unchecked((long) 0x86EEA14CB9AC6CA2L) /* 559 */, + unchecked((long) 0x3485BEB153677D5DL) /* 560 */, unchecked((long) 0xDD191D781F8C492AL) /* 561 */, + unchecked((long) 0xF60866BAA784EBF9L) /* 562 */, unchecked((long) 0x518F643BA2D08C74L) /* 563 */, + unchecked((long) 0x8852E956E1087C22L) /* 564 */, unchecked((long) 0xA768CB8DC410AE8DL) /* 565 */, + unchecked((long) 0x38047726BFEC8E1AL) /* 566 */, unchecked((long) 0xA67738B4CD3B45AAL) /* 567 */, + unchecked((long) 0xAD16691CEC0DDE19L) /* 568 */, unchecked((long) 0xC6D4319380462E07L) /* 569 */, + unchecked((long) 0xC5A5876D0BA61938L) /* 570 */, unchecked((long) 0x16B9FA1FA58FD840L) /* 571 */, + unchecked((long) 0x188AB1173CA74F18L) /* 572 */, unchecked((long) 0xABDA2F98C99C021FL) /* 573 */, + unchecked((long) 0x3E0580AB134AE816L) /* 574 */, unchecked((long) 0x5F3B05B773645ABBL) /* 575 */, + unchecked((long) 0x2501A2BE5575F2F6L) /* 576 */, unchecked((long) 0x1B2F74004E7E8BA9L) /* 577 */, + unchecked((long) 0x1CD7580371E8D953L) /* 578 */, unchecked((long) 0x7F6ED89562764E30L) /* 579 */, + unchecked((long) 0xB15926FF596F003DL) /* 580 */, unchecked((long) 0x9F65293DA8C5D6B9L) /* 581 */, + unchecked((long) 0x6ECEF04DD690F84CL) /* 582 */, unchecked((long) 0x4782275FFF33AF88L) /* 583 */, + unchecked((long) 0xE41433083F820801L) /* 584 */, unchecked((long) 0xFD0DFE409A1AF9B5L) /* 585 */, + unchecked((long) 0x4325A3342CDB396BL) /* 586 */, unchecked((long) 0x8AE77E62B301B252L) /* 587 */, + unchecked((long) 0xC36F9E9F6655615AL) /* 588 */, unchecked((long) 0x85455A2D92D32C09L) /* 589 */, + unchecked((long) 0xF2C7DEA949477485L) /* 590 */, unchecked((long) 0x63CFB4C133A39EBAL) /* 591 */, + unchecked((long) 0x83B040CC6EBC5462L) /* 592 */, unchecked((long) 0x3B9454C8FDB326B0L) /* 593 */, + unchecked((long) 0x56F56A9E87FFD78CL) /* 594 */, unchecked((long) 0x2DC2940D99F42BC6L) /* 595 */, + unchecked((long) 0x98F7DF096B096E2DL) /* 596 */, unchecked((long) 0x19A6E01E3AD852BFL) /* 597 */, + unchecked((long) 0x42A99CCBDBD4B40BL) /* 598 */, unchecked((long) 0xA59998AF45E9C559L) /* 599 */, + unchecked((long) 0x366295E807D93186L) /* 600 */, unchecked((long) 0x6B48181BFAA1F773L) /* 601 */, + unchecked((long) 0x1FEC57E2157A0A1DL) /* 602 */, unchecked((long) 0x4667446AF6201AD5L) /* 603 */, + unchecked((long) 0xE615EBCACFB0F075L) /* 604 */, unchecked((long) 0xB8F31F4F68290778L) /* 605 */, + unchecked((long) 0x22713ED6CE22D11EL) /* 606 */, unchecked((long) 0x3057C1A72EC3C93BL) /* 607 */, + unchecked((long) 0xCB46ACC37C3F1F2FL) /* 608 */, unchecked((long) 0xDBB893FD02AAF50EL) /* 609 */, + unchecked((long) 0x331FD92E600B9FCFL) /* 610 */, unchecked((long) 0xA498F96148EA3AD6L) /* 611 */, + unchecked((long) 0xA8D8426E8B6A83EAL) /* 612 */, unchecked((long) 0xA089B274B7735CDCL) /* 613 */, + unchecked((long) 0x87F6B3731E524A11L) /* 614 */, unchecked((long) 0x118808E5CBC96749L) /* 615 */, + unchecked((long) 0x9906E4C7B19BD394L) /* 616 */, unchecked((long) 0xAFED7F7E9B24A20CL) /* 617 */, + unchecked((long) 0x6509EADEEB3644A7L) /* 618 */, unchecked((long) 0x6C1EF1D3E8EF0EDEL) /* 619 */, + unchecked((long) 0xB9C97D43E9798FB4L) /* 620 */, unchecked((long) 0xA2F2D784740C28A3L) /* 621 */, + unchecked((long) 0x7B8496476197566FL) /* 622 */, unchecked((long) 0x7A5BE3E6B65F069DL) /* 623 */, + unchecked((long) 0xF96330ED78BE6F10L) /* 624 */, unchecked((long) 0xEEE60DE77A076A15L) /* 625 */, + unchecked((long) 0x2B4BEE4AA08B9BD0L) /* 626 */, unchecked((long) 0x6A56A63EC7B8894EL) /* 627 */, + unchecked((long) 0x02121359BA34FEF4L) /* 628 */, unchecked((long) 0x4CBF99F8283703FCL) /* 629 */, + unchecked((long) 0x398071350CAF30C8L) /* 630 */, unchecked((long) 0xD0A77A89F017687AL) /* 631 */, + unchecked((long) 0xF1C1A9EB9E423569L) /* 632 */, unchecked((long) 0x8C7976282DEE8199L) /* 633 */, + unchecked((long) 0x5D1737A5DD1F7ABDL) /* 634 */, unchecked((long) 0x4F53433C09A9FA80L) /* 635 */, + unchecked((long) 0xFA8B0C53DF7CA1D9L) /* 636 */, unchecked((long) 0x3FD9DCBC886CCB77L) /* 637 */, + unchecked((long) 0xC040917CA91B4720L) /* 638 */, unchecked((long) 0x7DD00142F9D1DCDFL) /* 639 */, + unchecked((long) 0x8476FC1D4F387B58L) /* 640 */, unchecked((long) 0x23F8E7C5F3316503L) /* 641 */, + unchecked((long) 0x032A2244E7E37339L) /* 642 */, unchecked((long) 0x5C87A5D750F5A74BL) /* 643 */, + unchecked((long) 0x082B4CC43698992EL) /* 644 */, unchecked((long) 0xDF917BECB858F63CL) /* 645 */, + unchecked((long) 0x3270B8FC5BF86DDAL) /* 646 */, unchecked((long) 0x10AE72BB29B5DD76L) /* 647 */, + unchecked((long) 0x576AC94E7700362BL) /* 648 */, unchecked((long) 0x1AD112DAC61EFB8FL) /* 649 */, + unchecked((long) 0x691BC30EC5FAA427L) /* 650 */, unchecked((long) 0xFF246311CC327143L) /* 651 */, + unchecked((long) 0x3142368E30E53206L) /* 652 */, unchecked((long) 0x71380E31E02CA396L) /* 653 */, + unchecked((long) 0x958D5C960AAD76F1L) /* 654 */, unchecked((long) 0xF8D6F430C16DA536L) /* 655 */, + unchecked((long) 0xC8FFD13F1BE7E1D2L) /* 656 */, unchecked((long) 0x7578AE66004DDBE1L) /* 657 */, + unchecked((long) 0x05833F01067BE646L) /* 658 */, unchecked((long) 0xBB34B5AD3BFE586DL) /* 659 */, + unchecked((long) 0x095F34C9A12B97F0L) /* 660 */, unchecked((long) 0x247AB64525D60CA8L) /* 661 */, + unchecked((long) 0xDCDBC6F3017477D1L) /* 662 */, unchecked((long) 0x4A2E14D4DECAD24DL) /* 663 */, + unchecked((long) 0xBDB5E6D9BE0A1EEBL) /* 664 */, unchecked((long) 0x2A7E70F7794301ABL) /* 665 */, + unchecked((long) 0xDEF42D8A270540FDL) /* 666 */, unchecked((long) 0x01078EC0A34C22C1L) /* 667 */, + unchecked((long) 0xE5DE511AF4C16387L) /* 668 */, unchecked((long) 0x7EBB3A52BD9A330AL) /* 669 */, + unchecked((long) 0x77697857AA7D6435L) /* 670 */, unchecked((long) 0x004E831603AE4C32L) /* 671 */, + unchecked((long) 0xE7A21020AD78E312L) /* 672 */, unchecked((long) 0x9D41A70C6AB420F2L) /* 673 */, + unchecked((long) 0x28E06C18EA1141E6L) /* 674 */, unchecked((long) 0xD2B28CBD984F6B28L) /* 675 */, + unchecked((long) 0x26B75F6C446E9D83L) /* 676 */, unchecked((long) 0xBA47568C4D418D7FL) /* 677 */, + unchecked((long) 0xD80BADBFE6183D8EL) /* 678 */, unchecked((long) 0x0E206D7F5F166044L) /* 679 */, + unchecked((long) 0xE258A43911CBCA3EL) /* 680 */, unchecked((long) 0x723A1746B21DC0BCL) /* 681 */, + unchecked((long) 0xC7CAA854F5D7CDD3L) /* 682 */, unchecked((long) 0x7CAC32883D261D9CL) /* 683 */, + unchecked((long) 0x7690C26423BA942CL) /* 684 */, unchecked((long) 0x17E55524478042B8L) /* 685 */, + unchecked((long) 0xE0BE477656A2389FL) /* 686 */, unchecked((long) 0x4D289B5E67AB2DA0L) /* 687 */, + unchecked((long) 0x44862B9C8FBBFD31L) /* 688 */, unchecked((long) 0xB47CC8049D141365L) /* 689 */, + unchecked((long) 0x822C1B362B91C793L) /* 690 */, unchecked((long) 0x4EB14655FB13DFD8L) /* 691 */, + unchecked((long) 0x1ECBBA0714E2A97BL) /* 692 */, unchecked((long) 0x6143459D5CDE5F14L) /* 693 */, + unchecked((long) 0x53A8FBF1D5F0AC89L) /* 694 */, unchecked((long) 0x97EA04D81C5E5B00L) /* 695 */, + unchecked((long) 0x622181A8D4FDB3F3L) /* 696 */, unchecked((long) 0xE9BCD341572A1208L) /* 697 */, + unchecked((long) 0x1411258643CCE58AL) /* 698 */, unchecked((long) 0x9144C5FEA4C6E0A4L) /* 699 */, + unchecked((long) 0x0D33D06565CF620FL) /* 700 */, unchecked((long) 0x54A48D489F219CA1L) /* 701 */, + unchecked((long) 0xC43E5EAC6D63C821L) /* 702 */, unchecked((long) 0xA9728B3A72770DAFL) /* 703 */, + unchecked((long) 0xD7934E7B20DF87EFL) /* 704 */, unchecked((long) 0xE35503B61A3E86E5L) /* 705 */, + unchecked((long) 0xCAE321FBC819D504L) /* 706 */, unchecked((long) 0x129A50B3AC60BFA6L) /* 707 */, + unchecked((long) 0xCD5E68EA7E9FB6C3L) /* 708 */, unchecked((long) 0xB01C90199483B1C7L) /* 709 */, + unchecked((long) 0x3DE93CD5C295376CL) /* 710 */, unchecked((long) 0xAED52EDF2AB9AD13L) /* 711 */, + unchecked((long) 0x2E60F512C0A07884L) /* 712 */, unchecked((long) 0xBC3D86A3E36210C9L) /* 713 */, + unchecked((long) 0x35269D9B163951CEL) /* 714 */, unchecked((long) 0x0C7D6E2AD0CDB5FAL) /* 715 */, + unchecked((long) 0x59E86297D87F5733L) /* 716 */, unchecked((long) 0x298EF221898DB0E7L) /* 717 */, + unchecked((long) 0x55000029D1A5AA7EL) /* 718 */, unchecked((long) 0x8BC08AE1B5061B45L) /* 719 */, + unchecked((long) 0xC2C31C2B6C92703AL) /* 720 */, unchecked((long) 0x94CC596BAF25EF42L) /* 721 */, + unchecked((long) 0x0A1D73DB22540456L) /* 722 */, unchecked((long) 0x04B6A0F9D9C4179AL) /* 723 */, + unchecked((long) 0xEFFDAFA2AE3D3C60L) /* 724 */, unchecked((long) 0xF7C8075BB49496C4L) /* 725 */, + unchecked((long) 0x9CC5C7141D1CD4E3L) /* 726 */, unchecked((long) 0x78BD1638218E5534L) /* 727 */, + unchecked((long) 0xB2F11568F850246AL) /* 728 */, unchecked((long) 0xEDFABCFA9502BC29L) /* 729 */, + unchecked((long) 0x796CE5F2DA23051BL) /* 730 */, unchecked((long) 0xAAE128B0DC93537CL) /* 731 */, + unchecked((long) 0x3A493DA0EE4B29AEL) /* 732 */, unchecked((long) 0xB5DF6B2C416895D7L) /* 733 */, + unchecked((long) 0xFCABBD25122D7F37L) /* 734 */, unchecked((long) 0x70810B58105DC4B1L) /* 735 */, + unchecked((long) 0xE10FDD37F7882A90L) /* 736 */, unchecked((long) 0x524DCAB5518A3F5CL) /* 737 */, + unchecked((long) 0x3C9E85878451255BL) /* 738 */, unchecked((long) 0x4029828119BD34E2L) /* 739 */, + unchecked((long) 0x74A05B6F5D3CECCBL) /* 740 */, unchecked((long) 0xB610021542E13ECAL) /* 741 */, + unchecked((long) 0x0FF979D12F59E2ACL) /* 742 */, unchecked((long) 0x6037DA27E4F9CC50L) /* 743 */, + unchecked((long) 0x5E92975A0DF1847DL) /* 744 */, unchecked((long) 0xD66DE190D3E623FEL) /* 745 */, + unchecked((long) 0x5032D6B87B568048L) /* 746 */, unchecked((long) 0x9A36B7CE8235216EL) /* 747 */, + unchecked((long) 0x80272A7A24F64B4AL) /* 748 */, unchecked((long) 0x93EFED8B8C6916F7L) /* 749 */, + unchecked((long) 0x37DDBFF44CCE1555L) /* 750 */, unchecked((long) 0x4B95DB5D4B99BD25L) /* 751 */, + unchecked((long) 0x92D3FDA169812FC0L) /* 752 */, unchecked((long) 0xFB1A4A9A90660BB6L) /* 753 */, + unchecked((long) 0x730C196946A4B9B2L) /* 754 */, unchecked((long) 0x81E289AA7F49DA68L) /* 755 */, + unchecked((long) 0x64669A0F83B1A05FL) /* 756 */, unchecked((long) 0x27B3FF7D9644F48BL) /* 757 */, + unchecked((long) 0xCC6B615C8DB675B3L) /* 758 */, unchecked((long) 0x674F20B9BCEBBE95L) /* 759 */, + unchecked((long) 0x6F31238275655982L) /* 760 */, unchecked((long) 0x5AE488713E45CF05L) /* 761 */, + unchecked((long) 0xBF619F9954C21157L) /* 762 */, unchecked((long) 0xEABAC46040A8EAE9L) /* 763 */, + unchecked((long) 0x454C6FE9F2C0C1CDL) /* 764 */, unchecked((long) 0x419CF6496412691CL) /* 765 */, + unchecked((long) 0xD3DC3BEF265B0F70L) /* 766 */, unchecked((long) 0x6D0E60F5C3578A9EL) /* 767 */, + }; + + private static readonly long[] t4 = { + unchecked((long) 0x5B0E608526323C55L) /* 768 */, unchecked((long) 0x1A46C1A9FA1B59F5L) /* 769 */, + unchecked((long) 0xA9E245A17C4C8FFAL) /* 770 */, unchecked((long) 0x65CA5159DB2955D7L) /* 771 */, + unchecked((long) 0x05DB0A76CE35AFC2L) /* 772 */, unchecked((long) 0x81EAC77EA9113D45L) /* 773 */, + unchecked((long) 0x528EF88AB6AC0A0DL) /* 774 */, unchecked((long) 0xA09EA253597BE3FFL) /* 775 */, + unchecked((long) 0x430DDFB3AC48CD56L) /* 776 */, unchecked((long) 0xC4B3A67AF45CE46FL) /* 777 */, + unchecked((long) 0x4ECECFD8FBE2D05EL) /* 778 */, unchecked((long) 0x3EF56F10B39935F0L) /* 779 */, + unchecked((long) 0x0B22D6829CD619C6L) /* 780 */, unchecked((long) 0x17FD460A74DF2069L) /* 781 */, + unchecked((long) 0x6CF8CC8E8510ED40L) /* 782 */, unchecked((long) 0xD6C824BF3A6ECAA7L) /* 783 */, + unchecked((long) 0x61243D581A817049L) /* 784 */, unchecked((long) 0x048BACB6BBC163A2L) /* 785 */, + unchecked((long) 0xD9A38AC27D44CC32L) /* 786 */, unchecked((long) 0x7FDDFF5BAAF410ABL) /* 787 */, + unchecked((long) 0xAD6D495AA804824BL) /* 788 */, unchecked((long) 0xE1A6A74F2D8C9F94L) /* 789 */, + unchecked((long) 0xD4F7851235DEE8E3L) /* 790 */, unchecked((long) 0xFD4B7F886540D893L) /* 791 */, + unchecked((long) 0x247C20042AA4BFDAL) /* 792 */, unchecked((long) 0x096EA1C517D1327CL) /* 793 */, + unchecked((long) 0xD56966B4361A6685L) /* 794 */, unchecked((long) 0x277DA5C31221057DL) /* 795 */, + unchecked((long) 0x94D59893A43ACFF7L) /* 796 */, unchecked((long) 0x64F0C51CCDC02281L) /* 797 */, + unchecked((long) 0x3D33BCC4FF6189DBL) /* 798 */, unchecked((long) 0xE005CB184CE66AF1L) /* 799 */, + unchecked((long) 0xFF5CCD1D1DB99BEAL) /* 800 */, unchecked((long) 0xB0B854A7FE42980FL) /* 801 */, + unchecked((long) 0x7BD46A6A718D4B9FL) /* 802 */, unchecked((long) 0xD10FA8CC22A5FD8CL) /* 803 */, + unchecked((long) 0xD31484952BE4BD31L) /* 804 */, unchecked((long) 0xC7FA975FCB243847L) /* 805 */, + unchecked((long) 0x4886ED1E5846C407L) /* 806 */, unchecked((long) 0x28CDDB791EB70B04L) /* 807 */, + unchecked((long) 0xC2B00BE2F573417FL) /* 808 */, unchecked((long) 0x5C9590452180F877L) /* 809 */, + unchecked((long) 0x7A6BDDFFF370EB00L) /* 810 */, unchecked((long) 0xCE509E38D6D9D6A4L) /* 811 */, + unchecked((long) 0xEBEB0F00647FA702L) /* 812 */, unchecked((long) 0x1DCC06CF76606F06L) /* 813 */, + unchecked((long) 0xE4D9F28BA286FF0AL) /* 814 */, unchecked((long) 0xD85A305DC918C262L) /* 815 */, + unchecked((long) 0x475B1D8732225F54L) /* 816 */, unchecked((long) 0x2D4FB51668CCB5FEL) /* 817 */, + unchecked((long) 0xA679B9D9D72BBA20L) /* 818 */, unchecked((long) 0x53841C0D912D43A5L) /* 819 */, + unchecked((long) 0x3B7EAA48BF12A4E8L) /* 820 */, unchecked((long) 0x781E0E47F22F1DDFL) /* 821 */, + unchecked((long) 0xEFF20CE60AB50973L) /* 822 */, unchecked((long) 0x20D261D19DFFB742L) /* 823 */, + unchecked((long) 0x16A12B03062A2E39L) /* 824 */, unchecked((long) 0x1960EB2239650495L) /* 825 */, + unchecked((long) 0x251C16FED50EB8B8L) /* 826 */, unchecked((long) 0x9AC0C330F826016EL) /* 827 */, + unchecked((long) 0xED152665953E7671L) /* 828 */, unchecked((long) 0x02D63194A6369570L) /* 829 */, + unchecked((long) 0x5074F08394B1C987L) /* 830 */, unchecked((long) 0x70BA598C90B25CE1L) /* 831 */, + unchecked((long) 0x794A15810B9742F6L) /* 832 */, unchecked((long) 0x0D5925E9FCAF8C6CL) /* 833 */, + unchecked((long) 0x3067716CD868744EL) /* 834 */, unchecked((long) 0x910AB077E8D7731BL) /* 835 */, + unchecked((long) 0x6A61BBDB5AC42F61L) /* 836 */, unchecked((long) 0x93513EFBF0851567L) /* 837 */, + unchecked((long) 0xF494724B9E83E9D5L) /* 838 */, unchecked((long) 0xE887E1985C09648DL) /* 839 */, + unchecked((long) 0x34B1D3C675370CFDL) /* 840 */, unchecked((long) 0xDC35E433BC0D255DL) /* 841 */, + unchecked((long) 0xD0AAB84234131BE0L) /* 842 */, unchecked((long) 0x08042A50B48B7EAFL) /* 843 */, + unchecked((long) 0x9997C4EE44A3AB35L) /* 844 */, unchecked((long) 0x829A7B49201799D0L) /* 845 */, + unchecked((long) 0x263B8307B7C54441L) /* 846 */, unchecked((long) 0x752F95F4FD6A6CA6L) /* 847 */, + unchecked((long) 0x927217402C08C6E5L) /* 848 */, unchecked((long) 0x2A8AB754A795D9EEL) /* 849 */, + unchecked((long) 0xA442F7552F72943DL) /* 850 */, unchecked((long) 0x2C31334E19781208L) /* 851 */, + unchecked((long) 0x4FA98D7CEAEE6291L) /* 852 */, unchecked((long) 0x55C3862F665DB309L) /* 853 */, + unchecked((long) 0xBD0610175D53B1F3L) /* 854 */, unchecked((long) 0x46FE6CB840413F27L) /* 855 */, + unchecked((long) 0x3FE03792DF0CFA59L) /* 856 */, unchecked((long) 0xCFE700372EB85E8FL) /* 857 */, + unchecked((long) 0xA7BE29E7ADBCE118L) /* 858 */, unchecked((long) 0xE544EE5CDE8431DDL) /* 859 */, + unchecked((long) 0x8A781B1B41F1873EL) /* 860 */, unchecked((long) 0xA5C94C78A0D2F0E7L) /* 861 */, + unchecked((long) 0x39412E2877B60728L) /* 862 */, unchecked((long) 0xA1265EF3AFC9A62CL) /* 863 */, + unchecked((long) 0xBCC2770C6A2506C5L) /* 864 */, unchecked((long) 0x3AB66DD5DCE1CE12L) /* 865 */, + unchecked((long) 0xE65499D04A675B37L) /* 866 */, unchecked((long) 0x7D8F523481BFD216L) /* 867 */, + unchecked((long) 0x0F6F64FCEC15F389L) /* 868 */, unchecked((long) 0x74EFBE618B5B13C8L) /* 869 */, + unchecked((long) 0xACDC82B714273E1DL) /* 870 */, unchecked((long) 0xDD40BFE003199D17L) /* 871 */, + unchecked((long) 0x37E99257E7E061F8L) /* 872 */, unchecked((long) 0xFA52626904775AAAL) /* 873 */, + unchecked((long) 0x8BBBF63A463D56F9L) /* 874 */, unchecked((long) 0xF0013F1543A26E64L) /* 875 */, + unchecked((long) 0xA8307E9F879EC898L) /* 876 */, unchecked((long) 0xCC4C27A4150177CCL) /* 877 */, + unchecked((long) 0x1B432F2CCA1D3348L) /* 878 */, unchecked((long) 0xDE1D1F8F9F6FA013L) /* 879 */, + unchecked((long) 0x606602A047A7DDD6L) /* 880 */, unchecked((long) 0xD237AB64CC1CB2C7L) /* 881 */, + unchecked((long) 0x9B938E7225FCD1D3L) /* 882 */, unchecked((long) 0xEC4E03708E0FF476L) /* 883 */, + unchecked((long) 0xFEB2FBDA3D03C12DL) /* 884 */, unchecked((long) 0xAE0BCED2EE43889AL) /* 885 */, + unchecked((long) 0x22CB8923EBFB4F43L) /* 886 */, unchecked((long) 0x69360D013CF7396DL) /* 887 */, + unchecked((long) 0x855E3602D2D4E022L) /* 888 */, unchecked((long) 0x073805BAD01F784CL) /* 889 */, + unchecked((long) 0x33E17A133852F546L) /* 890 */, unchecked((long) 0xDF4874058AC7B638L) /* 891 */, + unchecked((long) 0xBA92B29C678AA14AL) /* 892 */, unchecked((long) 0x0CE89FC76CFAADCDL) /* 893 */, + unchecked((long) 0x5F9D4E0908339E34L) /* 894 */, unchecked((long) 0xF1AFE9291F5923B9L) /* 895 */, + unchecked((long) 0x6E3480F60F4A265FL) /* 896 */, unchecked((long) 0xEEBF3A2AB29B841CL) /* 897 */, + unchecked((long) 0xE21938A88F91B4ADL) /* 898 */, unchecked((long) 0x57DFEFF845C6D3C3L) /* 899 */, + unchecked((long) 0x2F006B0BF62CAAF2L) /* 900 */, unchecked((long) 0x62F479EF6F75EE78L) /* 901 */, + unchecked((long) 0x11A55AD41C8916A9L) /* 902 */, unchecked((long) 0xF229D29084FED453L) /* 903 */, + unchecked((long) 0x42F1C27B16B000E6L) /* 904 */, unchecked((long) 0x2B1F76749823C074L) /* 905 */, + unchecked((long) 0x4B76ECA3C2745360L) /* 906 */, unchecked((long) 0x8C98F463B91691BDL) /* 907 */, + unchecked((long) 0x14BCC93CF1ADE66AL) /* 908 */, unchecked((long) 0x8885213E6D458397L) /* 909 */, + unchecked((long) 0x8E177DF0274D4711L) /* 910 */, unchecked((long) 0xB49B73B5503F2951L) /* 911 */, + unchecked((long) 0x10168168C3F96B6BL) /* 912 */, unchecked((long) 0x0E3D963B63CAB0AEL) /* 913 */, + unchecked((long) 0x8DFC4B5655A1DB14L) /* 914 */, unchecked((long) 0xF789F1356E14DE5CL) /* 915 */, + unchecked((long) 0x683E68AF4E51DAC1L) /* 916 */, unchecked((long) 0xC9A84F9D8D4B0FD9L) /* 917 */, + unchecked((long) 0x3691E03F52A0F9D1L) /* 918 */, unchecked((long) 0x5ED86E46E1878E80L) /* 919 */, + unchecked((long) 0x3C711A0E99D07150L) /* 920 */, unchecked((long) 0x5A0865B20C4E9310L) /* 921 */, + unchecked((long) 0x56FBFC1FE4F0682EL) /* 922 */, unchecked((long) 0xEA8D5DE3105EDF9BL) /* 923 */, + unchecked((long) 0x71ABFDB12379187AL) /* 924 */, unchecked((long) 0x2EB99DE1BEE77B9CL) /* 925 */, + unchecked((long) 0x21ECC0EA33CF4523L) /* 926 */, unchecked((long) 0x59A4D7521805C7A1L) /* 927 */, + unchecked((long) 0x3896F5EB56AE7C72L) /* 928 */, unchecked((long) 0xAA638F3DB18F75DCL) /* 929 */, + unchecked((long) 0x9F39358DABE9808EL) /* 930 */, unchecked((long) 0xB7DEFA91C00B72ACL) /* 931 */, + unchecked((long) 0x6B5541FD62492D92L) /* 932 */, unchecked((long) 0x6DC6DEE8F92E4D5BL) /* 933 */, + unchecked((long) 0x353F57ABC4BEEA7EL) /* 934 */, unchecked((long) 0x735769D6DA5690CEL) /* 935 */, + unchecked((long) 0x0A234AA642391484L) /* 936 */, unchecked((long) 0xF6F9508028F80D9DL) /* 937 */, + unchecked((long) 0xB8E319A27AB3F215L) /* 938 */, unchecked((long) 0x31AD9C1151341A4DL) /* 939 */, + unchecked((long) 0x773C22A57BEF5805L) /* 940 */, unchecked((long) 0x45C7561A07968633L) /* 941 */, + unchecked((long) 0xF913DA9E249DBE36L) /* 942 */, unchecked((long) 0xDA652D9B78A64C68L) /* 943 */, + unchecked((long) 0x4C27A97F3BC334EFL) /* 944 */, unchecked((long) 0x76621220E66B17F4L) /* 945 */, + unchecked((long) 0x967743899ACD7D0BL) /* 946 */, unchecked((long) 0xF3EE5BCAE0ED6782L) /* 947 */, + unchecked((long) 0x409F753600C879FCL) /* 948 */, unchecked((long) 0x06D09A39B5926DB6L) /* 949 */, + unchecked((long) 0x6F83AEB0317AC588L) /* 950 */, unchecked((long) 0x01E6CA4A86381F21L) /* 951 */, + unchecked((long) 0x66FF3462D19F3025L) /* 952 */, unchecked((long) 0x72207C24DDFD3BFBL) /* 953 */, + unchecked((long) 0x4AF6B6D3E2ECE2EBL) /* 954 */, unchecked((long) 0x9C994DBEC7EA08DEL) /* 955 */, + unchecked((long) 0x49ACE597B09A8BC4L) /* 956 */, unchecked((long) 0xB38C4766CF0797BAL) /* 957 */, + unchecked((long) 0x131B9373C57C2A75L) /* 958 */, unchecked((long) 0xB1822CCE61931E58L) /* 959 */, + unchecked((long) 0x9D7555B909BA1C0CL) /* 960 */, unchecked((long) 0x127FAFDD937D11D2L) /* 961 */, + unchecked((long) 0x29DA3BADC66D92E4L) /* 962 */, unchecked((long) 0xA2C1D57154C2ECBCL) /* 963 */, + unchecked((long) 0x58C5134D82F6FE24L) /* 964 */, unchecked((long) 0x1C3AE3515B62274FL) /* 965 */, + unchecked((long) 0xE907C82E01CB8126L) /* 966 */, unchecked((long) 0xF8ED091913E37FCBL) /* 967 */, + unchecked((long) 0x3249D8F9C80046C9L) /* 968 */, unchecked((long) 0x80CF9BEDE388FB63L) /* 969 */, + unchecked((long) 0x1881539A116CF19EL) /* 970 */, unchecked((long) 0x5103F3F76BD52457L) /* 971 */, + unchecked((long) 0x15B7E6F5AE47F7A8L) /* 972 */, unchecked((long) 0xDBD7C6DED47E9CCFL) /* 973 */, + unchecked((long) 0x44E55C410228BB1AL) /* 974 */, unchecked((long) 0xB647D4255EDB4E99L) /* 975 */, + unchecked((long) 0x5D11882BB8AAFC30L) /* 976 */, unchecked((long) 0xF5098BBB29D3212AL) /* 977 */, + unchecked((long) 0x8FB5EA14E90296B3L) /* 978 */, unchecked((long) 0x677B942157DD025AL) /* 979 */, + unchecked((long) 0xFB58E7C0A390ACB5L) /* 980 */, unchecked((long) 0x89D3674C83BD4A01L) /* 981 */, + unchecked((long) 0x9E2DA4DF4BF3B93BL) /* 982 */, unchecked((long) 0xFCC41E328CAB4829L) /* 983 */, + unchecked((long) 0x03F38C96BA582C52L) /* 984 */, unchecked((long) 0xCAD1BDBD7FD85DB2L) /* 985 */, + unchecked((long) 0xBBB442C16082AE83L) /* 986 */, unchecked((long) 0xB95FE86BA5DA9AB0L) /* 987 */, + unchecked((long) 0xB22E04673771A93FL) /* 988 */, unchecked((long) 0x845358C9493152D8L) /* 989 */, + unchecked((long) 0xBE2A488697B4541EL) /* 990 */, unchecked((long) 0x95A2DC2DD38E6966L) /* 991 */, + unchecked((long) 0xC02C11AC923C852BL) /* 992 */, unchecked((long) 0x2388B1990DF2A87BL) /* 993 */, + unchecked((long) 0x7C8008FA1B4F37BEL) /* 994 */, unchecked((long) 0x1F70D0C84D54E503L) /* 995 */, + unchecked((long) 0x5490ADEC7ECE57D4L) /* 996 */, unchecked((long) 0x002B3C27D9063A3AL) /* 997 */, + unchecked((long) 0x7EAEA3848030A2BFL) /* 998 */, unchecked((long) 0xC602326DED2003C0L) /* 999 */, + unchecked((long) 0x83A7287D69A94086L) /* 1000 */, unchecked((long) 0xC57A5FCB30F57A8AL) /* 1001 */, + unchecked((long) 0xB56844E479EBE779L) /* 1002 */, unchecked((long) 0xA373B40F05DCBCE9L) /* 1003 */, + unchecked((long) 0xD71A786E88570EE2L) /* 1004 */, unchecked((long) 0x879CBACDBDE8F6A0L) /* 1005 */, + unchecked((long) 0x976AD1BCC164A32FL) /* 1006 */, unchecked((long) 0xAB21E25E9666D78BL) /* 1007 */, + unchecked((long) 0x901063AAE5E5C33CL) /* 1008 */, unchecked((long) 0x9818B34448698D90L) /* 1009 */, + unchecked((long) 0xE36487AE3E1E8ABBL) /* 1010 */, unchecked((long) 0xAFBDF931893BDCB4L) /* 1011 */, + unchecked((long) 0x6345A0DC5FBBD519L) /* 1012 */, unchecked((long) 0x8628FE269B9465CAL) /* 1013 */, + unchecked((long) 0x1E5D01603F9C51ECL) /* 1014 */, unchecked((long) 0x4DE44006A15049B7L) /* 1015 */, + unchecked((long) 0xBF6C70E5F776CBB1L) /* 1016 */, unchecked((long) 0x411218F2EF552BEDL) /* 1017 */, + unchecked((long) 0xCB0C0708705A36A3L) /* 1018 */, unchecked((long) 0xE74D14754F986044L) /* 1019 */, + unchecked((long) 0xCD56D9430EA8280EL) /* 1020 */, unchecked((long) 0xC12591D7535F5065L) /* 1021 */, + unchecked((long) 0xC83223F1720AEF96L) /* 1022 */, unchecked((long) 0xC3A0396F7363A51FL) /* 1023 */ + }; + + private const int DigestLength = 24; + + // + // registers + // + private long a, b, c; + private long byteCount; + + // + // buffers + // + private byte[] Buffer = new byte[8]; + private int bOff; + + private long[] x = new long[8]; + private int xOff; + + /** + * Standard constructor + */ + public TigerDigest() + { + Reset(); + } + + /** + * Copy constructor. This will copy the state of the provided + * message digest. + */ + public TigerDigest(TigerDigest t) + { + Reset(t); + } + + public string AlgorithmName + { + get { return "Tiger"; } + } + + public int GetDigestSize() + { + return DigestLength; + } + + public int GetByteLength() + { + return MyByteLength; + } + + private void ProcessWord( + byte[] b, + int off) + { + x[xOff++] = ((long)(b[off + 7] & 0xff) << 56) + | ((long)(b[off + 6] & 0xff) << 48) + | ((long)(b[off + 5] & 0xff) << 40) + | ((long)(b[off + 4] & 0xff) << 32) + | ((long)(b[off + 3] & 0xff) << 24) + | ((long)(b[off + 2] & 0xff) << 16) + | ((long)(b[off + 1] & 0xff) << 8) + | ((uint)(b[off + 0] & 0xff)); + + if (xOff == x.Length) + { + ProcessBlock(); + } + + bOff = 0; + } + + public void Update( + byte input) + { + Buffer[bOff++] = input; + + if (bOff == Buffer.Length) + { + ProcessWord(Buffer, 0); + } + + byteCount++; + } + + public void BlockUpdate( + byte[] input, + int inOff, + int length) + { + // + // fill the current word + // + while ((bOff != 0) && (length > 0)) + { + Update(input[inOff]); + + inOff++; + length--; + } + + // + // process whole words. + // + while (length > 8) + { + ProcessWord(input, inOff); + + inOff += 8; + length -= 8; + byteCount += 8; + } + + // + // load in the remainder. + // + while (length > 0) + { + Update(input[inOff]); + + inOff++; + length--; + } + } + + private void RoundABC( + long x, + long mul) + { + c ^= x ; + a -= t1[(int)c & 0xff] ^ t2[(int)(c >> 16) & 0xff] + ^ t3[(int)(c >> 32) & 0xff] ^ t4[(int)(c >> 48) & 0xff]; + b += t4[(int)(c >> 8) & 0xff] ^ t3[(int)(c >> 24) & 0xff] + ^ t2[(int)(c >> 40) & 0xff] ^ t1[(int)(c >> 56) & 0xff]; + b *= mul; + } + + private void RoundBCA( + long x, + long mul) + { + a ^= x ; + b -= t1[(int)a & 0xff] ^ t2[(int)(a >> 16) & 0xff] + ^ t3[(int)(a >> 32) & 0xff] ^ t4[(int)(a >> 48) & 0xff]; + c += t4[(int)(a >> 8) & 0xff] ^ t3[(int)(a >> 24) & 0xff] + ^ t2[(int)(a >> 40) & 0xff] ^ t1[(int)(a >> 56) & 0xff]; + c *= mul; + } + + private void RoundCAB( + long x, + long mul) + { + b ^= x ; + c -= t1[(int)b & 0xff] ^ t2[(int)(b >> 16) & 0xff] + ^ t3[(int)(b >> 32) & 0xff] ^ t4[(int)(b >> 48) & 0xff]; + a += t4[(int)(b >> 8) & 0xff] ^ t3[(int)(b >> 24) & 0xff] + ^ t2[(int)(b >> 40) & 0xff] ^ t1[(int)(b >> 56) & 0xff]; + a *= mul; + } + + private void KeySchedule() + { + x[0] -= x[7] ^ unchecked ((long) 0xA5A5A5A5A5A5A5A5L); + x[1] ^= x[0]; + x[2] += x[1]; + x[3] -= x[2] ^ ((~x[1]) << 19); + x[4] ^= x[3]; + x[5] += x[4]; + x[6] -= x[5] ^ (long) ((ulong) (~x[4]) >> 23); + x[7] ^= x[6]; + x[0] += x[7]; + x[1] -= x[0] ^ ((~x[7]) << 19); + x[2] ^= x[1]; + x[3] += x[2]; + x[4] -= x[3] ^ (long) ((ulong) (~x[2]) >> 23); + x[5] ^= x[4]; + x[6] += x[5]; + x[7] -= x[6] ^ 0x0123456789ABCDEFL; + } + + private void ProcessBlock() + { + // + // save abc + // + long aa = a; + long bb = b; + long cc = c; + + // + // rounds and schedule + // + RoundABC(x[0], 5); + RoundBCA(x[1], 5); + RoundCAB(x[2], 5); + RoundABC(x[3], 5); + RoundBCA(x[4], 5); + RoundCAB(x[5], 5); + RoundABC(x[6], 5); + RoundBCA(x[7], 5); + + KeySchedule(); + + RoundCAB(x[0], 7); + RoundABC(x[1], 7); + RoundBCA(x[2], 7); + RoundCAB(x[3], 7); + RoundABC(x[4], 7); + RoundBCA(x[5], 7); + RoundCAB(x[6], 7); + RoundABC(x[7], 7); + + KeySchedule(); + + RoundBCA(x[0], 9); + RoundCAB(x[1], 9); + RoundABC(x[2], 9); + RoundBCA(x[3], 9); + RoundCAB(x[4], 9); + RoundABC(x[5], 9); + RoundBCA(x[6], 9); + RoundCAB(x[7], 9); + + // + // feed forward + // + a ^= aa; + b -= bb; + c += cc; + + // + // clear the x buffer + // + xOff = 0; + for (int i = 0; i != x.Length; i++) + { + x[i] = 0; + } + } + + private void UnpackWord( + long r, + byte[] output, + int outOff) + { + output[outOff + 7] = (byte)(r >> 56); + output[outOff + 6] = (byte)(r >> 48); + output[outOff + 5] = (byte)(r >> 40); + output[outOff + 4] = (byte)(r >> 32); + output[outOff + 3] = (byte)(r >> 24); + output[outOff + 2] = (byte)(r >> 16); + output[outOff + 1] = (byte)(r >> 8); + output[outOff] = (byte)r; + } + + private void ProcessLength( + long bitLength) + { + x[7] = bitLength; + } + + private void Finish() + { + long bitLength = (byteCount << 3); + + Update((byte)0x01); + + while (bOff != 0) + { + Update((byte)0); + } + + ProcessLength(bitLength); + + ProcessBlock(); + } + + public int DoFinal( + byte[] output, + int outOff) + { + Finish(); + + UnpackWord(a, output, outOff); + UnpackWord(b, output, outOff + 8); + UnpackWord(c, output, outOff + 16); + + Reset(); + + return DigestLength; + } + + /** + * reset the chaining variables + */ + public void Reset() + { + a = unchecked((long) 0x0123456789ABCDEFL); + b = unchecked((long) 0xFEDCBA9876543210L); + c = unchecked((long) 0xF096A5B4C3B2E187L); + + xOff = 0; + for (int i = 0; i != x.Length; i++) + { + x[i] = 0; + } + + bOff = 0; + for (int i = 0; i != Buffer.Length; i++) + { + Buffer[i] = 0; + } + + byteCount = 0; + } + + public IMemoable Copy() + { + return new TigerDigest(this); + } + + public void Reset(IMemoable other) + { + TigerDigest t = (TigerDigest)other; + + a = t.a; + b = t.b; + c = t.c; + + Array.Copy(t.x, 0, x, 0, t.x.Length); + xOff = t.xOff; + + Array.Copy(t.Buffer, 0, Buffer, 0, t.Buffer.Length); + bOff = t.bOff; + + byteCount = t.byteCount; + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/TigerDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/TigerDigest.cs.meta new file mode 100644 index 00000000..f657cd97 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/TigerDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 57fcb6394b1838042a143a9847924a08 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/WhirlpoolDigest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/WhirlpoolDigest.cs new file mode 100644 index 00000000..cac00ced --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/WhirlpoolDigest.cs @@ -0,0 +1,417 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests +{ + /** + * Implementation of WhirlpoolDigest, based on Java source published by Barreto + * and Rijmen. + * + */ + public sealed class WhirlpoolDigest + : IDigest, IMemoable + { + private const int BYTE_LENGTH = 64; + + private const int DIGEST_LENGTH_BYTES = 512 / 8; + private const int ROUNDS = 10; + private const int REDUCTION_POLYNOMIAL = 0x011d; // 2^8 + 2^4 + 2^3 + 2 + 1; + + private static readonly int[] SBOX = + { + 0x18, 0x23, 0xc6, 0xe8, 0x87, 0xb8, 0x01, 0x4f, 0x36, 0xa6, 0xd2, 0xf5, 0x79, 0x6f, 0x91, 0x52, + 0x60, 0xbc, 0x9b, 0x8e, 0xa3, 0x0c, 0x7b, 0x35, 0x1d, 0xe0, 0xd7, 0xc2, 0x2e, 0x4b, 0xfe, 0x57, + 0x15, 0x77, 0x37, 0xe5, 0x9f, 0xf0, 0x4a, 0xda, 0x58, 0xc9, 0x29, 0x0a, 0xb1, 0xa0, 0x6b, 0x85, + 0xbd, 0x5d, 0x10, 0xf4, 0xcb, 0x3e, 0x05, 0x67, 0xe4, 0x27, 0x41, 0x8b, 0xa7, 0x7d, 0x95, 0xd8, + 0xfb, 0xee, 0x7c, 0x66, 0xdd, 0x17, 0x47, 0x9e, 0xca, 0x2d, 0xbf, 0x07, 0xad, 0x5a, 0x83, 0x33, + 0x63, 0x02, 0xaa, 0x71, 0xc8, 0x19, 0x49, 0xd9, 0xf2, 0xe3, 0x5b, 0x88, 0x9a, 0x26, 0x32, 0xb0, + 0xe9, 0x0f, 0xd5, 0x80, 0xbe, 0xcd, 0x34, 0x48, 0xff, 0x7a, 0x90, 0x5f, 0x20, 0x68, 0x1a, 0xae, + 0xb4, 0x54, 0x93, 0x22, 0x64, 0xf1, 0x73, 0x12, 0x40, 0x08, 0xc3, 0xec, 0xdb, 0xa1, 0x8d, 0x3d, + 0x97, 0x00, 0xcf, 0x2b, 0x76, 0x82, 0xd6, 0x1b, 0xb5, 0xaf, 0x6a, 0x50, 0x45, 0xf3, 0x30, 0xef, + 0x3f, 0x55, 0xa2, 0xea, 0x65, 0xba, 0x2f, 0xc0, 0xde, 0x1c, 0xfd, 0x4d, 0x92, 0x75, 0x06, 0x8a, + 0xb2, 0xe6, 0x0e, 0x1f, 0x62, 0xd4, 0xa8, 0x96, 0xf9, 0xc5, 0x25, 0x59, 0x84, 0x72, 0x39, 0x4c, + 0x5e, 0x78, 0x38, 0x8c, 0xd1, 0xa5, 0xe2, 0x61, 0xb3, 0x21, 0x9c, 0x1e, 0x43, 0xc7, 0xfc, 0x04, + 0x51, 0x99, 0x6d, 0x0d, 0xfa, 0xdf, 0x7e, 0x24, 0x3b, 0xab, 0xce, 0x11, 0x8f, 0x4e, 0xb7, 0xeb, + 0x3c, 0x81, 0x94, 0xf7, 0xb9, 0x13, 0x2c, 0xd3, 0xe7, 0x6e, 0xc4, 0x03, 0x56, 0x44, 0x7f, 0xa9, + 0x2a, 0xbb, 0xc1, 0x53, 0xdc, 0x0b, 0x9d, 0x6c, 0x31, 0x74, 0xf6, 0x46, 0xac, 0x89, 0x14, 0xe1, + 0x16, 0x3a, 0x69, 0x09, 0x70, 0xb6, 0xd0, 0xed, 0xcc, 0x42, 0x98, 0xa4, 0x28, 0x5c, 0xf8, 0x86 + }; + + private static readonly long[] C0 = new long[256]; + private static readonly long[] C1 = new long[256]; + private static readonly long[] C2 = new long[256]; + private static readonly long[] C3 = new long[256]; + private static readonly long[] C4 = new long[256]; + private static readonly long[] C5 = new long[256]; + private static readonly long[] C6 = new long[256]; + private static readonly long[] C7 = new long[256]; + + private readonly long[] _rc = new long[ROUNDS + 1]; + + /* + * increment() can be implemented in this way using 2 arrays or + * by having some temporary variables that are used to set the + * value provided by EIGHT[i] and carry within the loop. + * + * not having done any timing, this seems likely to be faster + * at the slight expense of 32*(sizeof short) bytes + */ + private static readonly short[] EIGHT = new short[BITCOUNT_ARRAY_SIZE]; + + static WhirlpoolDigest() + { + EIGHT[BITCOUNT_ARRAY_SIZE - 1] = 8; + + for (int i = 0; i < 256; i++) + { + int v1 = SBOX[i]; + int v2 = maskWithReductionPolynomial(v1 << 1); + int v4 = maskWithReductionPolynomial(v2 << 1); + int v5 = v4 ^ v1; + int v8 = maskWithReductionPolynomial(v4 << 1); + int v9 = v8 ^ v1; + + C0[i] = packIntoLong(v1, v1, v4, v1, v8, v5, v2, v9); + C1[i] = packIntoLong(v9, v1, v1, v4, v1, v8, v5, v2); + C2[i] = packIntoLong(v2, v9, v1, v1, v4, v1, v8, v5); + C3[i] = packIntoLong(v5, v2, v9, v1, v1, v4, v1, v8); + C4[i] = packIntoLong(v8, v5, v2, v9, v1, v1, v4, v1); + C5[i] = packIntoLong(v1, v8, v5, v2, v9, v1, v1, v4); + C6[i] = packIntoLong(v4, v1, v8, v5, v2, v9, v1, v1); + C7[i] = packIntoLong(v1, v4, v1, v8, v5, v2, v9, v1); + } + } + + public WhirlpoolDigest() + { + _rc[0] = 0L; + for (int r = 1; r <= ROUNDS; r++) + { + int i = 8 * (r - 1); + _rc[r] = (long)((ulong)C0[i] & 0xff00000000000000L) ^ + (C1[i + 1] & (long) 0x00ff000000000000L) ^ + (C2[i + 2] & (long) 0x0000ff0000000000L) ^ + (C3[i + 3] & (long) 0x000000ff00000000L) ^ + (C4[i + 4] & (long) 0x00000000ff000000L) ^ + (C5[i + 5] & (long) 0x0000000000ff0000L) ^ + (C6[i + 6] & (long) 0x000000000000ff00L) ^ + (C7[i + 7] & (long) 0x00000000000000ffL); + } + } + + private static long packIntoLong(int b7, int b6, int b5, int b4, int b3, int b2, int b1, int b0) + { + return + ((long)b7 << 56) ^ + ((long)b6 << 48) ^ + ((long)b5 << 40) ^ + ((long)b4 << 32) ^ + ((long)b3 << 24) ^ + ((long)b2 << 16) ^ + ((long)b1 << 8) ^ + b0; + } + + /* + * int's are used to prevent sign extension. The values that are really being used are + * actually just 0..255 + */ + private static int maskWithReductionPolynomial(int input) + { + int rv = input; + if (rv >= 0x100L) // high bit set + { + rv ^= REDUCTION_POLYNOMIAL; // reduced by the polynomial + } + return rv; + } + + // --------------------------------------------------------------------------------------// + + // -- buffer information -- + private const int BITCOUNT_ARRAY_SIZE = 32; + private byte[] _buffer = new byte[64]; + private int _bufferPos; + private short[] _bitCount = new short[BITCOUNT_ARRAY_SIZE]; + + // -- internal hash state -- + private long[] _hash = new long[8]; + private long[] _K = new long[8]; // the round key + private long[] _L = new long[8]; + private long[] _block = new long[8]; // mu (buffer) + private long[] _state = new long[8]; // the current "cipher" state + + + + /** + * Copy constructor. This will copy the state of the provided message + * digest. + */ + public WhirlpoolDigest(WhirlpoolDigest originalDigest) + { + Reset(originalDigest); + } + + public string AlgorithmName + { + get { return "Whirlpool"; } + } + + public int GetDigestSize() + { + return DIGEST_LENGTH_BYTES; + } + + public int DoFinal(byte[] output, int outOff) + { + // sets output[outOff] .. output[outOff+DIGEST_LENGTH_BYTES] + finish(); + + for (int i = 0; i < 8; i++) + { + convertLongToByteArray(_hash[i], output, outOff + (i * 8)); + } + + Reset(); + + return GetDigestSize(); + } + + /** + * Reset the chaining variables + */ + public void Reset() + { + // set variables to null, blank, whatever + _bufferPos = 0; + Array.Clear(_bitCount, 0, _bitCount.Length); + Array.Clear(_buffer, 0, _buffer.Length); + Array.Clear(_hash, 0, _hash.Length); + Array.Clear(_K, 0, _K.Length); + Array.Clear(_L, 0, _L.Length); + Array.Clear(_block, 0, _block.Length); + Array.Clear(_state, 0, _state.Length); + } + + // this takes a buffer of information and fills the block + private void processFilledBuffer() + { + // copies into the block... + for (int i = 0; i < _state.Length; i++) + { + _block[i] = bytesToLongFromBuffer(_buffer, i * 8); + } + processBlock(); + _bufferPos = 0; + Array.Clear(_buffer, 0, _buffer.Length); + } + + private static long bytesToLongFromBuffer(byte[] buffer, int startPos) + { + long rv = (((buffer[startPos + 0] & 0xffL) << 56) | + ((buffer[startPos + 1] & 0xffL) << 48) | + ((buffer[startPos + 2] & 0xffL) << 40) | + ((buffer[startPos + 3] & 0xffL) << 32) | + ((buffer[startPos + 4] & 0xffL) << 24) | + ((buffer[startPos + 5] & 0xffL) << 16) | + ((buffer[startPos + 6] & 0xffL) << 8) | + ((buffer[startPos + 7]) & 0xffL)); + + return rv; + } + + private static void convertLongToByteArray(long inputLong, byte[] outputArray, int offSet) + { + for (int i = 0; i < 8; i++) + { + outputArray[offSet + i] = (byte)((inputLong >> (56 - (i * 8))) & 0xff); + } + } + + private void processBlock() + { + // buffer contents have been transferred to the _block[] array via + // processFilledBuffer + + // compute and apply K^0 + for (int i = 0; i < 8; i++) + { + _state[i] = _block[i] ^ (_K[i] = _hash[i]); + } + + // iterate over the rounds + for (int round = 1; round <= ROUNDS; round++) + { + for (int i = 0; i < 8; i++) + { + _L[i] = 0; + _L[i] ^= C0[(int)(_K[(i - 0) & 7] >> 56) & 0xff]; + _L[i] ^= C1[(int)(_K[(i - 1) & 7] >> 48) & 0xff]; + _L[i] ^= C2[(int)(_K[(i - 2) & 7] >> 40) & 0xff]; + _L[i] ^= C3[(int)(_K[(i - 3) & 7] >> 32) & 0xff]; + _L[i] ^= C4[(int)(_K[(i - 4) & 7] >> 24) & 0xff]; + _L[i] ^= C5[(int)(_K[(i - 5) & 7] >> 16) & 0xff]; + _L[i] ^= C6[(int)(_K[(i - 6) & 7] >> 8) & 0xff]; + _L[i] ^= C7[(int)(_K[(i - 7) & 7]) & 0xff]; + } + + Array.Copy(_L, 0, _K, 0, _K.Length); + + _K[0] ^= _rc[round]; + + // apply the round transformation + for (int i = 0; i < 8; i++) + { + _L[i] = _K[i]; + + _L[i] ^= C0[(int)(_state[(i - 0) & 7] >> 56) & 0xff]; + _L[i] ^= C1[(int)(_state[(i - 1) & 7] >> 48) & 0xff]; + _L[i] ^= C2[(int)(_state[(i - 2) & 7] >> 40) & 0xff]; + _L[i] ^= C3[(int)(_state[(i - 3) & 7] >> 32) & 0xff]; + _L[i] ^= C4[(int)(_state[(i - 4) & 7] >> 24) & 0xff]; + _L[i] ^= C5[(int)(_state[(i - 5) & 7] >> 16) & 0xff]; + _L[i] ^= C6[(int)(_state[(i - 6) & 7] >> 8) & 0xff]; + _L[i] ^= C7[(int)(_state[(i - 7) & 7]) & 0xff]; + } + + // save the current state + Array.Copy(_L, 0, _state, 0, _state.Length); + } + + // apply Miuaguchi-Preneel compression + for (int i = 0; i < 8; i++) + { + _hash[i] ^= _state[i] ^ _block[i]; + } + + } + + public void Update(byte input) + { + _buffer[_bufferPos] = input; + + //Console.WriteLine("adding to buffer = "+_buffer[_bufferPos]); + + ++_bufferPos; + + if (_bufferPos == _buffer.Length) + { + processFilledBuffer(); + } + + increment(); + } + + private void increment() + { + int carry = 0; + for (int i = _bitCount.Length - 1; i >= 0; i--) + { + int sum = (_bitCount[i] & 0xff) + EIGHT[i] + carry; + + carry = sum >> 8; + _bitCount[i] = (short)(sum & 0xff); + } + } + + public void BlockUpdate(byte[] input, int inOff, int length) + { + while (length > 0) + { + Update(input[inOff]); + ++inOff; + --length; + } + + } + + private void finish() + { + /* + * this makes a copy of the current bit length. at the expense of an + * object creation of 32 bytes rather than providing a _stopCounting + * boolean which was the alternative I could think of. + */ + byte[] bitLength = copyBitLength(); + + _buffer[_bufferPos++] |= 0x80; + + if (_bufferPos == _buffer.Length) + { + processFilledBuffer(); + } + + /* + * Final block contains + * [ ... data .... ][0][0][0][ length ] + * + * if [ length ] cannot fit. Need to create a new block. + */ + if (_bufferPos > 32) + { + while (_bufferPos != 0) + { + Update((byte)0); + } + } + + while (_bufferPos <= 32) + { + Update((byte)0); + } + + // copy the length information to the final 32 bytes of the + // 64 byte block.... + Array.Copy(bitLength, 0, _buffer, 32, bitLength.Length); + + processFilledBuffer(); + } + + private byte[] copyBitLength() + { + byte[] rv = new byte[BITCOUNT_ARRAY_SIZE]; + for (int i = 0; i < rv.Length; i++) + { + rv[i] = (byte)(_bitCount[i] & 0xff); + } + return rv; + } + + public int GetByteLength() + { + return BYTE_LENGTH; + } + + public IMemoable Copy() + { + return new WhirlpoolDigest(this); + } + + public void Reset(IMemoable other) + { + WhirlpoolDigest originalDigest = (WhirlpoolDigest)other; + + Array.Copy(originalDigest._rc, 0, _rc, 0, _rc.Length); + + Array.Copy(originalDigest._buffer, 0, _buffer, 0, _buffer.Length); + + this._bufferPos = originalDigest._bufferPos; + Array.Copy(originalDigest._bitCount, 0, _bitCount, 0, _bitCount.Length); + + // -- internal hash state -- + Array.Copy(originalDigest._hash, 0, _hash, 0, _hash.Length); + Array.Copy(originalDigest._K, 0, _K, 0, _K.Length); + Array.Copy(originalDigest._L, 0, _L, 0, _L.Length); + Array.Copy(originalDigest._block, 0, _block, 0, _block.Length); + Array.Copy(originalDigest._state, 0, _state, 0, _state.Length); + } + + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/WhirlpoolDigest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/WhirlpoolDigest.cs.meta new file mode 100644 index 00000000..857660a0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/digests/WhirlpoolDigest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c1514667bb945848a2337e88af6340c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec.meta new file mode 100644 index 00000000..219a8fd0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e0048515318c6fb408c1cc5edd0586a2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec/CustomNamedCurves.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec/CustomNamedCurves.cs new file mode 100644 index 00000000..f6faf263 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec/CustomNamedCurves.cs @@ -0,0 +1,917 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Djb; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.GM; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.EC +{ + public sealed class CustomNamedCurves + { + private CustomNamedCurves() + { + } + + private static BigInteger FromHex(string hex) + { + return new BigInteger(1, Hex.Decode(hex)); + } + + private static ECCurve ConfigureCurve(ECCurve curve) + { + return curve; + } + + private static ECCurve ConfigureCurveGlv(ECCurve c, GlvTypeBParameters p) + { + return c.Configure().SetEndomorphism(new GlvTypeBEndomorphism(c, p)).Create(); + } + + /* + * curve25519 + */ + internal class Curve25519Holder + : X9ECParametersHolder + { + private Curve25519Holder() { } + + internal static readonly X9ECParametersHolder Instance = new Curve25519Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + ECCurve curve = ConfigureCurve(new Curve25519()); + + /* + * NOTE: Curve25519 was specified in Montgomery form. Rewriting in Weierstrass form + * involves substitution of variables, so the base-point x coordinate is 9 + (486662 / 3). + * + * The Curve25519 paper doesn't say which of the two possible y values the base + * point has. The choice here is guided by language in the Ed25519 paper. + * + * (The other possible y value is 5F51E65E475F794B1FE122D388B72EB36DC2B28192839E4DD6163A5D81312C14) + */ + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD245A" + + "20AE19A1B8A086B4E01EDD2C7748D14C923D4D7E6D7C61B229E9C5A27ECED3D9")); + + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + /* + * secp128r1 + */ + internal class SecP128R1Holder + : X9ECParametersHolder + { + private SecP128R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP128R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("000E0D4D696E6768756151750CC03A4473D03679"); + ECCurve curve = ConfigureCurve(new SecP128R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "161FF7528B899B2D0C28607CA52C5B86" + + "CF5AC8395BAFEB13C02DA292DDED7A83")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * secp160k1 + */ + internal class SecP160K1Holder + : X9ECParametersHolder + { + private SecP160K1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP160K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + GlvTypeBParameters glv = new GlvTypeBParameters( + new BigInteger("9ba48cba5ebcb9b6bd33b92830b2a2e0e192f10a", 16), + new BigInteger("c39c6c3b3a36d7701b9c71a1f5804ae5d0003f4", 16), + new BigInteger[]{ + new BigInteger("9162fbe73984472a0a9e", 16), + new BigInteger("-96341f1138933bc2f505", 16) }, + new BigInteger[]{ + new BigInteger("127971af8721782ecffa3", 16), + new BigInteger("9162fbe73984472a0a9e", 16) }, + new BigInteger("9162fbe73984472a0a9d0590", 16), + new BigInteger("96341f1138933bc2f503fd44", 16), + 176); + ECCurve curve = ConfigureCurveGlv(new SecP160K1Curve(), glv); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB" + + "938CF935318FDCED6BC28286531733C3F03C4FEE")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * secp160r1 + */ + internal class SecP160R1Holder + : X9ECParametersHolder + { + private SecP160R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP160R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("1053CDE42C14D696E67687561517533BF3F83345"); + ECCurve curve = ConfigureCurve(new SecP160R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "4A96B5688EF573284664698968C38BB913CBFC82" + + "23A628553168947D59DCC912042351377AC5FB32")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * secp160r2 + */ + internal class SecP160R2Holder + : X9ECParametersHolder + { + private SecP160R2Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP160R2Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("B99B99B099B323E02709A4D696E6768756151751"); + ECCurve curve = ConfigureCurve(new SecP160R2Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "52DCB034293A117E1F4FF11B30F7199D3144CE6D" + + "FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * secp192k1 + */ + internal class SecP192K1Holder + : X9ECParametersHolder + { + private SecP192K1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP192K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + GlvTypeBParameters glv = new GlvTypeBParameters( + new BigInteger("bb85691939b869c1d087f601554b96b80cb4f55b35f433c2", 16), + new BigInteger("3d84f26c12238d7b4f3d516613c1759033b1a5800175d0b1", 16), + new BigInteger[]{ + new BigInteger("71169be7330b3038edb025f1", 16), + new BigInteger("-b3fb3400dec5c4adceb8655c", 16) }, + new BigInteger[]{ + new BigInteger("12511cfe811d0f4e6bc688b4d", 16), + new BigInteger("71169be7330b3038edb025f1", 16) }, + new BigInteger("71169be7330b3038edb025f1d0f9", 16), + new BigInteger("b3fb3400dec5c4adceb8655d4c94", 16), + 208); + ECCurve curve = ConfigureCurveGlv(new SecP192K1Curve(), glv); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D" + + "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + /* + * secp192r1 + */ + internal class SecP192R1Holder + : X9ECParametersHolder + { + private SecP192R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP192R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("3045AE6FC8422F64ED579528D38120EAE12196D5"); + ECCurve curve = ConfigureCurve(new SecP192R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012" + + "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + /* + * secp224k1 + */ + internal class SecP224K1Holder + : X9ECParametersHolder + { + private SecP224K1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP224K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + GlvTypeBParameters glv = new GlvTypeBParameters( + new BigInteger("fe0e87005b4e83761908c5131d552a850b3f58b749c37cf5b84d6768", 16), + new BigInteger("60dcd2104c4cbc0be6eeefc2bdd610739ec34e317f9b33046c9e4788", 16), + new BigInteger[]{ + new BigInteger("6b8cf07d4ca75c88957d9d670591", 16), + new BigInteger("-b8adf1378a6eb73409fa6c9c637d", 16) }, + new BigInteger[]{ + new BigInteger("1243ae1b4d71613bc9f780a03690e", 16), + new BigInteger("6b8cf07d4ca75c88957d9d670591", 16) }, + new BigInteger("6b8cf07d4ca75c88957d9d67059037a4", 16), + new BigInteger("b8adf1378a6eb73409fa6c9c637ba7f5", 16), + 240); + ECCurve curve = ConfigureCurveGlv(new SecP224K1Curve(), glv); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C" + + "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + /* + * secp224r1 + */ + internal class SecP224R1Holder + : X9ECParametersHolder + { + private SecP224R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP224R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5"); + ECCurve curve = ConfigureCurve(new SecP224R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21" + + "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + /* + * secp256k1 + */ + internal class SecP256K1Holder + : X9ECParametersHolder + { + private SecP256K1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new SecP256K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + GlvTypeBParameters glv = new GlvTypeBParameters( + new BigInteger("7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee", 16), + new BigInteger("5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72", 16), + new BigInteger[]{ + new BigInteger("3086d221a7d46bcde86c90e49284eb15", 16), + new BigInteger("-e4437ed6010e88286f547fa90abfe4c3", 16) }, + new BigInteger[]{ + new BigInteger("114ca50f7a8e2f3f657c1108d9d44cfd8", 16), + new BigInteger("3086d221a7d46bcde86c90e49284eb15", 16) }, + new BigInteger("3086d221a7d46bcde86c90e49284eb153dab", 16), + new BigInteger("e4437ed6010e88286f547fa90abfe4c42212", 16), + 272); + ECCurve curve = ConfigureCurveGlv(new SecP256K1Curve(), glv); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798" + + "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + /* + * secp256r1 + */ + internal class SecP256R1Holder + : X9ECParametersHolder + { + private SecP256R1Holder() {} + + internal static readonly X9ECParametersHolder Instance = new SecP256R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("C49D360886E704936A6678E1139D26B7819F7E90"); + ECCurve curve = ConfigureCurve(new SecP256R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296" + + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + /* + * secp384r1 + */ + internal class SecP384R1Holder + : X9ECParametersHolder + { + private SecP384R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP384R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("A335926AA319A27A1D00896A6773A4827ACDAC73"); + ECCurve curve = ConfigureCurve(new SecP384R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7" + + "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + /* + * secp521r1 + */ + internal class SecP521R1Holder + : X9ECParametersHolder + { + private SecP521R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecP521R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("D09E8800291CB85396CC6717393284AAA0DA64BA"); + ECCurve curve = ConfigureCurve(new SecP521R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66" + + "011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + /* + * sect113r1 + */ + internal class SecT113R1Holder + : X9ECParametersHolder + { + private SecT113R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT113R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("10E723AB14D696E6768756151756FEBF8FCB49A9"); + ECCurve curve = ConfigureCurve(new SecT113R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "009D73616F35F4AB1407D73562C10F" + + "00A52830277958EE84D1315ED31886")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect113r2 + */ + internal class SecT113R2Holder + : X9ECParametersHolder + { + private SecT113R2Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT113R2Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("10C0FB15760860DEF1EEF4D696E676875615175D"); + ECCurve curve = ConfigureCurve(new SecT113R2Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "01A57A6A7B26CA5EF52FCDB8164797" + + "00B3ADC94ED1FE674C06E695BABA1D")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect131r1 + */ + internal class SecT131R1Holder + : X9ECParametersHolder + { + private SecT131R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT131R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("4D696E676875615175985BD3ADBADA21B43A97E2"); + ECCurve curve = ConfigureCurve(new SecT131R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0081BAF91FDF9833C40F9C181343638399" + + "078C6E7EA38C001F73C8134B1B4EF9E150")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect131r2 + */ + internal class SecT131R2Holder + : X9ECParametersHolder + { + private SecT131R2Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT131R2Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("985BD3ADBAD4D696E676875615175A21B43A97E3"); + ECCurve curve = ConfigureCurve(new SecT131R2Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0356DCD8F2F95031AD652D23951BB366A8" + + "0648F06D867940A5366D9E265DE9EB240F")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect163k1 + */ + internal class SecT163K1Holder + : X9ECParametersHolder + { + private SecT163K1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT163K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + ECCurve curve = ConfigureCurve(new SecT163K1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8" + + "0289070FB05D38FF58321F2E800536D538CCDAA3D9")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect163r1 + */ + internal class SecT163R1Holder + : X9ECParametersHolder + { + private SecT163R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT163R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("24B7B137C8A14D696E6768756151756FD0DA2E5C"); + ECCurve curve = ConfigureCurve(new SecT163R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0369979697AB43897789566789567F787A7876A654" + + "00435EDB42EFAFB2989D51FEFCE3C80988F41FF883")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect163r2 + */ + internal class SecT163R2Holder + : X9ECParametersHolder + { + private SecT163R2Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT163R2Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("85E25BFE5C86226CDB12016F7553F9D0E693A268"); + ECCurve curve = ConfigureCurve(new SecT163R2Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "03F0EBA16286A2D57EA0991168D4994637E8343E36" + + "00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect193r1 + */ + internal class SecT193R1Holder + : X9ECParametersHolder + { + private SecT193R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT193R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("103FAEC74D696E676875615175777FC5B191EF30"); + ECCurve curve = ConfigureCurve(new SecT193R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1" + + "0025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect193r2 + */ + internal class SecT193R2Holder + : X9ECParametersHolder + { + private SecT193R2Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT193R2Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("10B7B4D696E676875615175137C8A16FD0DA2211"); + ECCurve curve = ConfigureCurve(new SecT193R2Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F" + + "01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect233k1 + */ + internal class SecT233K1Holder + : X9ECParametersHolder + { + private SecT233K1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT233K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + ECCurve curve = ConfigureCurve(new SecT233K1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126" + + "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect233r1 + */ + internal class SecT233R1Holder + : X9ECParametersHolder + { + private SecT233R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT233R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("74D59FF07F6B413D0EA14B344B20A2DB049B50C3"); + ECCurve curve = ConfigureCurve(new SecT233R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B" + + "01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect239k1 + */ + internal class SecT239K1Holder + : X9ECParametersHolder + { + private SecT239K1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT239K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + ECCurve curve = ConfigureCurve(new SecT239K1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC" + + "76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect283k1 + */ + internal class SecT283K1Holder + : X9ECParametersHolder + { + private SecT283K1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT283K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + ECCurve curve = ConfigureCurve(new SecT283K1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836" + + "01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect283r1 + */ + internal class SecT283R1Holder + : X9ECParametersHolder + { + private SecT283R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT283R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("77E2B07370EB0F832A6DD5B62DFC88CD06BB84BE"); + ECCurve curve = ConfigureCurve(new SecT283R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053" + + "03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect409k1 + */ + internal class SecT409K1Holder + : X9ECParametersHolder + { + private SecT409K1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT409K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + ECCurve curve = ConfigureCurve(new SecT409K1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746" + + "01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect409r1 + */ + internal class SecT409R1Holder + : X9ECParametersHolder + { + private SecT409R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT409R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("4099B5A457F9D69F79213D094C4BCD4D4262210B"); + ECCurve curve = ConfigureCurve(new SecT409R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7" + + "0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect571k1 + */ + internal class SecT571K1Holder + : X9ECParametersHolder + { + private SecT571K1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT571K1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + ECCurve curve = ConfigureCurve(new SecT571K1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972" + + "0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sect571r1 + */ + internal class SecT571R1Holder + : X9ECParametersHolder + { + private SecT571R1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SecT571R1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = Hex.Decode("2AA058F73A0E33AB486B0F610410C53A7F132310"); + ECCurve curve = ConfigureCurve(new SecT571R1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19" + + "037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + }; + + /* + * sm2p256v1 + */ + internal class SM2P256V1Holder + : X9ECParametersHolder + { + private SM2P256V1Holder() { } + + internal static readonly X9ECParametersHolder Instance = new SM2P256V1Holder(); + + protected override X9ECParameters CreateParameters() + { + byte[] S = null; + ECCurve curve = ConfigureCurve(new SM2P256V1Curve()); + X9ECPoint G = new X9ECPoint(curve, Hex.Decode("04" + + "32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7" + + "BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0")); + return new X9ECParameters(curve, G, curve.Order, curve.Cofactor, S); + } + } + + + private static readonly IDictionary nameToCurve = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary nameToOid = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary oidToCurve = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary oidToName = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IList names = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + private static void DefineCurve(string name, X9ECParametersHolder holder) + { + names.Add(name); + name = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name); + nameToCurve.Add(name, holder); + } + + private static void DefineCurveWithOid(string name, DerObjectIdentifier oid, X9ECParametersHolder holder) + { + names.Add(name); + oidToName.Add(oid, name); + oidToCurve.Add(oid, holder); + name = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name); + nameToOid.Add(name, oid); + nameToCurve.Add(name, holder); + } + + private static void DefineCurveAlias(string name, DerObjectIdentifier oid) + { + object curve = oidToCurve[oid]; + if (curve == null) + throw new InvalidOperationException(); + + name = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name); + nameToOid.Add(name, oid); + nameToCurve.Add(name, curve); + } + + static CustomNamedCurves() + { + DefineCurve("curve25519", Curve25519Holder.Instance); + + //DefineCurveWithOid("secp112r1", SecObjectIdentifiers.SecP112r1, SecP112R1Holder.Instance); + //DefineCurveWithOid("secp112r2", SecObjectIdentifiers.SecP112r2, SecP112R2Holder.Instance); + DefineCurveWithOid("secp128r1", SecObjectIdentifiers.SecP128r1, SecP128R1Holder.Instance); + //DefineCurveWithOid("secp128r2", SecObjectIdentifiers.SecP128r2, SecP128R2Holder.Instance); + DefineCurveWithOid("secp160k1", SecObjectIdentifiers.SecP160k1, SecP160K1Holder.Instance); + DefineCurveWithOid("secp160r1", SecObjectIdentifiers.SecP160r1, SecP160R1Holder.Instance); + DefineCurveWithOid("secp160r2", SecObjectIdentifiers.SecP160r2, SecP160R2Holder.Instance); + DefineCurveWithOid("secp192k1", SecObjectIdentifiers.SecP192k1, SecP192K1Holder.Instance); + DefineCurveWithOid("secp192r1", SecObjectIdentifiers.SecP192r1, SecP192R1Holder.Instance); + DefineCurveWithOid("secp224k1", SecObjectIdentifiers.SecP224k1, SecP224K1Holder.Instance); + DefineCurveWithOid("secp224r1", SecObjectIdentifiers.SecP224r1, SecP224R1Holder.Instance); + DefineCurveWithOid("secp256k1", SecObjectIdentifiers.SecP256k1, SecP256K1Holder.Instance); + DefineCurveWithOid("secp256r1", SecObjectIdentifiers.SecP256r1, SecP256R1Holder.Instance); + DefineCurveWithOid("secp384r1", SecObjectIdentifiers.SecP384r1, SecP384R1Holder.Instance); + DefineCurveWithOid("secp521r1", SecObjectIdentifiers.SecP521r1, SecP521R1Holder.Instance); + + DefineCurveWithOid("sect113r1", SecObjectIdentifiers.SecT113r1, SecT113R1Holder.Instance); + DefineCurveWithOid("sect113r2", SecObjectIdentifiers.SecT113r2, SecT113R2Holder.Instance); + DefineCurveWithOid("sect131r1", SecObjectIdentifiers.SecT131r1, SecT131R1Holder.Instance); + DefineCurveWithOid("sect131r2", SecObjectIdentifiers.SecT131r2, SecT131R2Holder.Instance); + DefineCurveWithOid("sect163k1", SecObjectIdentifiers.SecT163k1, SecT163K1Holder.Instance); + DefineCurveWithOid("sect163r1", SecObjectIdentifiers.SecT163r1, SecT163R1Holder.Instance); + DefineCurveWithOid("sect163r2", SecObjectIdentifiers.SecT163r2, SecT163R2Holder.Instance); + DefineCurveWithOid("sect193r1", SecObjectIdentifiers.SecT193r1, SecT193R1Holder.Instance); + DefineCurveWithOid("sect193r2", SecObjectIdentifiers.SecT193r2, SecT193R2Holder.Instance); + DefineCurveWithOid("sect233k1", SecObjectIdentifiers.SecT233k1, SecT233K1Holder.Instance); + DefineCurveWithOid("sect233r1", SecObjectIdentifiers.SecT233r1, SecT233R1Holder.Instance); + DefineCurveWithOid("sect239k1", SecObjectIdentifiers.SecT239k1, SecT239K1Holder.Instance); + DefineCurveWithOid("sect283k1", SecObjectIdentifiers.SecT283k1, SecT283K1Holder.Instance); + DefineCurveWithOid("sect283r1", SecObjectIdentifiers.SecT283r1, SecT283R1Holder.Instance); + DefineCurveWithOid("sect409k1", SecObjectIdentifiers.SecT409k1, SecT409K1Holder.Instance); + DefineCurveWithOid("sect409r1", SecObjectIdentifiers.SecT409r1, SecT409R1Holder.Instance); + DefineCurveWithOid("sect571k1", SecObjectIdentifiers.SecT571k1, SecT571K1Holder.Instance); + DefineCurveWithOid("sect571r1", SecObjectIdentifiers.SecT571r1, SecT571R1Holder.Instance); + + DefineCurveWithOid("sm2p256v1", GMObjectIdentifiers.sm2p256v1, SM2P256V1Holder.Instance); + + DefineCurveAlias("B-163", SecObjectIdentifiers.SecT163r2); + DefineCurveAlias("B-233", SecObjectIdentifiers.SecT233r1); + DefineCurveAlias("B-283", SecObjectIdentifiers.SecT283r1); + DefineCurveAlias("B-409", SecObjectIdentifiers.SecT409r1); + DefineCurveAlias("B-571", SecObjectIdentifiers.SecT571r1); + + DefineCurveAlias("K-163", SecObjectIdentifiers.SecT163k1); + DefineCurveAlias("K-233", SecObjectIdentifiers.SecT233k1); + DefineCurveAlias("K-283", SecObjectIdentifiers.SecT283k1); + DefineCurveAlias("K-409", SecObjectIdentifiers.SecT409k1); + DefineCurveAlias("K-571", SecObjectIdentifiers.SecT571k1); + + DefineCurveAlias("P-192", SecObjectIdentifiers.SecP192r1); + DefineCurveAlias("P-224", SecObjectIdentifiers.SecP224r1); + DefineCurveAlias("P-256", SecObjectIdentifiers.SecP256r1); + DefineCurveAlias("P-384", SecObjectIdentifiers.SecP384r1); + DefineCurveAlias("P-521", SecObjectIdentifiers.SecP521r1); + } + + public static X9ECParameters GetByName(string name) + { + X9ECParametersHolder holder = (X9ECParametersHolder)nameToCurve[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name)]; + return holder == null ? null : holder.Parameters; + } + + /** + * return the X9ECParameters object for the named curve represented by + * the passed in object identifier. Null if the curve isn't present. + * + * @param oid an object identifier representing a named curve, if present. + */ + public static X9ECParameters GetByOid(DerObjectIdentifier oid) + { + X9ECParametersHolder holder = (X9ECParametersHolder)oidToCurve[oid]; + return holder == null ? null : holder.Parameters; + } + + /** + * return the object identifier signified by the passed in name. Null + * if there is no object identifier associated with name. + * + * @return the object identifier associated with name, if present. + */ + public static DerObjectIdentifier GetOid(string name) + { + return (DerObjectIdentifier)nameToOid[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(name)]; + } + + /** + * return the named curve name represented by the given object identifier. + */ + public static string GetName(DerObjectIdentifier oid) + { + return (string)oidToName[oid]; + } + + /** + * returns an enumeration containing the name strings for curves + * contained in this structure. + */ + public static IEnumerable Names + { + get { return new EnumerableProxy(names); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec/CustomNamedCurves.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec/CustomNamedCurves.cs.meta new file mode 100644 index 00000000..594561de --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/ec/CustomNamedCurves.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32ffbd2c58332be4cb98527094e5ea00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings.meta new file mode 100644 index 00000000..b5d5a6e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 35397ea2ff7827c429fbd3f646b14705 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/ISO9796d1Encoding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/ISO9796d1Encoding.cs new file mode 100644 index 00000000..93e25e75 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/ISO9796d1Encoding.cs @@ -0,0 +1,277 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings +{ + /** + * ISO 9796-1 padding. Note in the light of recent results you should + * only use this with RSA (rather than the "simpler" Rabin keys) and you + * should never use it with anything other than a hash (ie. even if the + * message is small don't sign the message, sign it's hash) or some "random" + * value. See your favorite search engine for details. + */ + public class ISO9796d1Encoding + : IAsymmetricBlockCipher + { + private static readonly BigInteger Sixteen = BigInteger.ValueOf(16); + private static readonly BigInteger Six = BigInteger.ValueOf(6); + + private static readonly byte[] shadows = { 0xe, 0x3, 0x5, 0x8, 0x9, 0x4, 0x2, 0xf, + 0x0, 0xd, 0xb, 0x6, 0x7, 0xa, 0xc, 0x1 }; + private static readonly byte[] inverse = { 0x8, 0xf, 0x6, 0x1, 0x5, 0x2, 0xb, 0xc, + 0x3, 0x4, 0xd, 0xa, 0xe, 0x9, 0x0, 0x7 }; + + private readonly IAsymmetricBlockCipher engine; + private bool forEncryption; + private int bitSize; + private int padBits = 0; + private BigInteger modulus; + + public ISO9796d1Encoding( + IAsymmetricBlockCipher cipher) + { + this.engine = cipher; + } + + public string AlgorithmName + { + get { return engine.AlgorithmName + "/ISO9796-1Padding"; } + } + + public IAsymmetricBlockCipher GetUnderlyingCipher() + { + return engine; + } + + public void Init( + bool forEncryption, + ICipherParameters parameters) + { + RsaKeyParameters kParam; + if (parameters is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)parameters; + kParam = (RsaKeyParameters)rParam.Parameters; + } + else + { + kParam = (RsaKeyParameters)parameters; + } + + engine.Init(forEncryption, parameters); + + modulus = kParam.Modulus; + bitSize = modulus.BitLength; + + this.forEncryption = forEncryption; + } + + /** + * return the input block size. The largest message we can process + * is (key_size_in_bits + 3)/16, which in our world comes to + * key_size_in_bytes / 2. + */ + public int GetInputBlockSize() + { + int baseBlockSize = engine.GetInputBlockSize(); + + if (forEncryption) + { + return (baseBlockSize + 1) / 2; + } + else + { + return baseBlockSize; + } + } + + /** + * return the maximum possible size for the output. + */ + public int GetOutputBlockSize() + { + int baseBlockSize = engine.GetOutputBlockSize(); + + if (forEncryption) + { + return baseBlockSize; + } + else + { + return (baseBlockSize + 1) / 2; + } + } + + /** + * set the number of bits in the next message to be treated as + * pad bits. + */ + public void SetPadBits( + int padBits) + { + if (padBits > 7) + { + throw new ArgumentException("padBits > 7"); + } + + this.padBits = padBits; + } + + /** + * retrieve the number of pad bits in the last decoded message. + */ + public int GetPadBits() + { + return padBits; + } + + public byte[] ProcessBlock( + byte[] input, + int inOff, + int length) + { + if (forEncryption) + { + return EncodeBlock(input, inOff, length); + } + else + { + return DecodeBlock(input, inOff, length); + } + } + + private byte[] EncodeBlock( + byte[] input, + int inOff, + int inLen) + { + byte[] block = new byte[(bitSize + 7) / 8]; + int r = padBits + 1; + int z = inLen; + int t = (bitSize + 13) / 16; + + for (int i = 0; i < t; i += z) + { + if (i > t - z) + { + Array.Copy(input, inOff + inLen - (t - i), + block, block.Length - t, t - i); + } + else + { + Array.Copy(input, inOff, block, block.Length - (i + z), z); + } + } + + for (int i = block.Length - 2 * t; i != block.Length; i += 2) + { + byte val = block[block.Length - t + i / 2]; + + block[i] = (byte)((shadows[(uint) (val & 0xff) >> 4] << 4) + | shadows[val & 0x0f]); + block[i + 1] = val; + } + + block[block.Length - 2 * z] ^= (byte) r; + block[block.Length - 1] = (byte)((block[block.Length - 1] << 4) | 0x06); + + int maxBit = (8 - (bitSize - 1) % 8); + int offSet = 0; + + if (maxBit != 8) + { + block[0] &= (byte) ((ushort) 0xff >> maxBit); + block[0] |= (byte) ((ushort) 0x80 >> maxBit); + } + else + { + block[0] = 0x00; + block[1] |= 0x80; + offSet = 1; + } + + return engine.ProcessBlock(block, offSet, block.Length - offSet); + } + + /** + * @exception InvalidCipherTextException if the decrypted block is not a valid ISO 9796 bit string + */ + private byte[] DecodeBlock( + byte[] input, + int inOff, + int inLen) + { + byte[] block = engine.ProcessBlock(input, inOff, inLen); + int r = 1; + int t = (bitSize + 13) / 16; + + BigInteger iS = new BigInteger(1, block); + BigInteger iR; + if (iS.Mod(Sixteen).Equals(Six)) + { + iR = iS; + } + else + { + iR = modulus.Subtract(iS); + + if (!iR.Mod(Sixteen).Equals(Six)) + throw new InvalidCipherTextException("resulting integer iS or (modulus - iS) is not congruent to 6 mod 16"); + } + + block = iR.ToByteArrayUnsigned(); + + if ((block[block.Length - 1] & 0x0f) != 0x6) + throw new InvalidCipherTextException("invalid forcing byte in block"); + + block[block.Length - 1] = + (byte)(((ushort)(block[block.Length - 1] & 0xff) >> 4) + | ((inverse[(block[block.Length - 2] & 0xff) >> 4]) << 4)); + + block[0] = (byte)((shadows[(uint) (block[1] & 0xff) >> 4] << 4) + | shadows[block[1] & 0x0f]); + + bool boundaryFound = false; + int boundary = 0; + + for (int i = block.Length - 1; i >= block.Length - 2 * t; i -= 2) + { + int val = ((shadows[(uint) (block[i] & 0xff) >> 4] << 4) + | shadows[block[i] & 0x0f]); + + if (((block[i - 1] ^ val) & 0xff) != 0) + { + if (!boundaryFound) + { + boundaryFound = true; + r = (block[i - 1] ^ val) & 0xff; + boundary = i - 1; + } + else + { + throw new InvalidCipherTextException("invalid tsums in block"); + } + } + } + + block[boundary] = 0; + + byte[] nblock = new byte[(block.Length - boundary) / 2]; + + for (int i = 0; i < nblock.Length; i++) + { + nblock[i] = block[2 * i + boundary + 1]; + } + + padBits = r - 1; + + return nblock; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/ISO9796d1Encoding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/ISO9796d1Encoding.cs.meta new file mode 100644 index 00000000..961a3337 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/ISO9796d1Encoding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a70193810adfc84bb1c2b7d0cfbdda8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/OaepEncoding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/OaepEncoding.cs new file mode 100644 index 00000000..ea641eb8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/OaepEncoding.cs @@ -0,0 +1,356 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings +{ + /** + * Optimal Asymmetric Encryption Padding (OAEP) - see PKCS 1 V 2. + */ + public class OaepEncoding + : IAsymmetricBlockCipher + { + private byte[] defHash; + private IDigest mgf1Hash; + + private IAsymmetricBlockCipher engine; + private SecureRandom random; + private bool forEncryption; + + public OaepEncoding( + IAsymmetricBlockCipher cipher) + : this(cipher, new Sha1Digest(), null) + { + } + + public OaepEncoding( + IAsymmetricBlockCipher cipher, + IDigest hash) + : this(cipher, hash, null) + { + } + + public OaepEncoding( + IAsymmetricBlockCipher cipher, + IDigest hash, + byte[] encodingParams) + : this(cipher, hash, hash, encodingParams) + { + } + + public OaepEncoding( + IAsymmetricBlockCipher cipher, + IDigest hash, + IDigest mgf1Hash, + byte[] encodingParams) + { + this.engine = cipher; + this.mgf1Hash = mgf1Hash; + this.defHash = new byte[hash.GetDigestSize()]; + + hash.Reset(); + + if (encodingParams != null) + { + hash.BlockUpdate(encodingParams, 0, encodingParams.Length); + } + + hash.DoFinal(defHash, 0); + } + + public IAsymmetricBlockCipher GetUnderlyingCipher() + { + return engine; + } + + public string AlgorithmName + { + get { return engine.AlgorithmName + "/OAEPPadding"; } + } + + public void Init( + bool forEncryption, + ICipherParameters param) + { + if (param is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)param; + this.random = rParam.Random; + } + else + { + this.random = new SecureRandom(); + } + + engine.Init(forEncryption, param); + + this.forEncryption = forEncryption; + } + + public int GetInputBlockSize() + { + int baseBlockSize = engine.GetInputBlockSize(); + + if (forEncryption) + { + return baseBlockSize - 1 - 2 * defHash.Length; + } + else + { + return baseBlockSize; + } + } + + public int GetOutputBlockSize() + { + int baseBlockSize = engine.GetOutputBlockSize(); + + if (forEncryption) + { + return baseBlockSize; + } + else + { + return baseBlockSize - 1 - 2 * defHash.Length; + } + } + + public byte[] ProcessBlock( + byte[] inBytes, + int inOff, + int inLen) + { + if (forEncryption) + { + return EncodeBlock(inBytes, inOff, inLen); + } + else + { + return DecodeBlock(inBytes, inOff, inLen); + } + } + + private byte[] EncodeBlock( + byte[] inBytes, + int inOff, + int inLen) + { + Check.DataLength(inLen > GetInputBlockSize(), "input data too long"); + + byte[] block = new byte[GetInputBlockSize() + 1 + 2 * defHash.Length]; + + // + // copy in the message + // + Array.Copy(inBytes, inOff, block, block.Length - inLen, inLen); + + // + // add sentinel + // + block[block.Length - inLen - 1] = 0x01; + + // + // as the block is already zeroed - there's no need to add PS (the >= 0 pad of 0) + // + + // + // add the hash of the encoding params. + // + Array.Copy(defHash, 0, block, defHash.Length, defHash.Length); + + // + // generate the seed. + // + byte[] seed = SecureRandom.GetNextBytes(random, defHash.Length); + + // + // mask the message block. + // + byte[] mask = maskGeneratorFunction1(seed, 0, seed.Length, block.Length - defHash.Length); + + for (int i = defHash.Length; i != block.Length; i++) + { + block[i] ^= mask[i - defHash.Length]; + } + + // + // add in the seed + // + Array.Copy(seed, 0, block, 0, defHash.Length); + + // + // mask the seed. + // + mask = maskGeneratorFunction1( + block, defHash.Length, block.Length - defHash.Length, defHash.Length); + + for (int i = 0; i != defHash.Length; i++) + { + block[i] ^= mask[i]; + } + + return engine.ProcessBlock(block, 0, block.Length); + } + + /** + * @exception InvalidCipherTextException if the decrypted block turns out to + * be badly formatted. + */ + private byte[] DecodeBlock( + byte[] inBytes, + int inOff, + int inLen) + { + byte[] data = engine.ProcessBlock(inBytes, inOff, inLen); + byte[] block = new byte[engine.GetOutputBlockSize()]; + + // + // as we may have zeros in our leading bytes for the block we produced + // on encryption, we need to make sure our decrypted block comes back + // the same size. + // + bool wrongData = (block.Length < (2 * defHash.Length) + 1); + + if (data.Length <= block.Length) + { + Array.Copy(data, 0, block, block.Length - data.Length, data.Length); + } + else + { + Array.Copy(data, 0, block, 0, block.Length); + wrongData = true; + } + + // + // unmask the seed. + // + byte[] mask = maskGeneratorFunction1( + block, defHash.Length, block.Length - defHash.Length, defHash.Length); + + for (int i = 0; i != defHash.Length; i++) + { + block[i] ^= mask[i]; + } + + // + // unmask the message block. + // + mask = maskGeneratorFunction1(block, 0, defHash.Length, block.Length - defHash.Length); + + for (int i = defHash.Length; i != block.Length; i++) + { + block[i] ^= mask[i - defHash.Length]; + } + + // + // check the hash of the encoding params. + // long check to try to avoid this been a source of a timing attack. + // + bool defHashWrong = false; + + for (int i = 0; i != defHash.Length; i++) + { + if (defHash[i] != block[defHash.Length + i]) + { + defHashWrong = true; + } + } + + // + // find the data block + // + int start = block.Length; + + for (int index = 2 * defHash.Length; index != block.Length; index++) + { + if (block[index] != 0 & start == block.Length) + { + start = index; + } + } + + bool dataStartWrong = (start > (block.Length - 1) | block[start] != 1); + + start++; + + if (defHashWrong | wrongData | dataStartWrong) + { + Arrays.Fill(block, 0); + throw new InvalidCipherTextException("data wrong"); + } + + // + // extract the data block + // + byte[] output = new byte[block.Length - start]; + + Array.Copy(block, start, output, 0, output.Length); + + return output; + } + + /** + * int to octet string. + */ + private void ItoOSP( + int i, + byte[] sp) + { + sp[0] = (byte)((uint)i >> 24); + sp[1] = (byte)((uint)i >> 16); + sp[2] = (byte)((uint)i >> 8); + sp[3] = (byte)((uint)i >> 0); + } + + /** + * mask generator function, as described in PKCS1v2. + */ + private byte[] maskGeneratorFunction1( + byte[] Z, + int zOff, + int zLen, + int length) + { + byte[] mask = new byte[length]; + byte[] hashBuf = new byte[mgf1Hash.GetDigestSize()]; + byte[] C = new byte[4]; + int counter = 0; + + mgf1Hash.Reset(); + + while (counter < (length / hashBuf.Length)) + { + ItoOSP(counter, C); + + mgf1Hash.BlockUpdate(Z, zOff, zLen); + mgf1Hash.BlockUpdate(C, 0, C.Length); + mgf1Hash.DoFinal(hashBuf, 0); + + Array.Copy(hashBuf, 0, mask, counter * hashBuf.Length, hashBuf.Length); + + counter++; + } + + if ((counter * hashBuf.Length) < length) + { + ItoOSP(counter, C); + + mgf1Hash.BlockUpdate(Z, zOff, zLen); + mgf1Hash.BlockUpdate(C, 0, C.Length); + mgf1Hash.DoFinal(hashBuf, 0); + + Array.Copy(hashBuf, 0, mask, counter * hashBuf.Length, mask.Length - (counter * hashBuf.Length)); + } + + return mask; + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/OaepEncoding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/OaepEncoding.cs.meta new file mode 100644 index 00000000..741136c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/OaepEncoding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 60f0db7343141334d896810ce58bf1bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/Pkcs1Encoding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/Pkcs1Encoding.cs new file mode 100644 index 00000000..b9ee367c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/Pkcs1Encoding.cs @@ -0,0 +1,388 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings +{ + /** + * this does your basic Pkcs 1 v1.5 padding - whether or not you should be using this + * depends on your application - see Pkcs1 Version 2 for details. + */ + public class Pkcs1Encoding + : IAsymmetricBlockCipher + { + /** + * some providers fail to include the leading zero in PKCS1 encoded blocks. If you need to + * work with one of these set the system property BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs1.Strict to false. + */ + public const string StrictLengthEnabledProperty = "BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs1.Strict"; + + private const int HeaderLength = 10; + + /** + * The same effect can be achieved by setting the static property directly + *

+ * The static property is checked during construction of the encoding object, it is set to + * true by default. + *

+ */ + public static bool StrictLengthEnabled + { + get { return strictLengthEnabled[0]; } + set { strictLengthEnabled[0] = value; } + } + + private static readonly bool[] strictLengthEnabled; + + static Pkcs1Encoding() + { + string strictProperty = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetEnvironmentVariable(StrictLengthEnabledProperty); + + strictLengthEnabled = new bool[]{ strictProperty == null || strictProperty.Equals("true")}; + } + + + private SecureRandom random; + private IAsymmetricBlockCipher engine; + private bool forEncryption; + private bool forPrivateKey; + private bool useStrictLength; + private int pLen = -1; + private byte[] fallback = null; + private byte[] blockBuffer = null; + + /** + * Basic constructor. + * + * @param cipher + */ + public Pkcs1Encoding( + IAsymmetricBlockCipher cipher) + { + this.engine = cipher; + this.useStrictLength = StrictLengthEnabled; + } + + /** + * Constructor for decryption with a fixed plaintext length. + * + * @param cipher The cipher to use for cryptographic operation. + * @param pLen Length of the expected plaintext. + */ + public Pkcs1Encoding(IAsymmetricBlockCipher cipher, int pLen) + { + this.engine = cipher; + this.useStrictLength = StrictLengthEnabled; + this.pLen = pLen; + } + + /** + * Constructor for decryption with a fixed plaintext length and a fallback + * value that is returned, if the padding is incorrect. + * + * @param cipher + * The cipher to use for cryptographic operation. + * @param fallback + * The fallback value, we don't to a arraycopy here. + */ + public Pkcs1Encoding(IAsymmetricBlockCipher cipher, byte[] fallback) + { + this.engine = cipher; + this.useStrictLength = StrictLengthEnabled; + this.fallback = fallback; + this.pLen = fallback.Length; + } + + public IAsymmetricBlockCipher GetUnderlyingCipher() + { + return engine; + } + + public string AlgorithmName + { + get { return engine.AlgorithmName + "/PKCS1Padding"; } + } + + public void Init(bool forEncryption, ICipherParameters parameters) + { + AsymmetricKeyParameter kParam; + if (parameters is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)parameters; + + this.random = rParam.Random; + kParam = (AsymmetricKeyParameter)rParam.Parameters; + } + else + { + this.random = new SecureRandom(); + kParam = (AsymmetricKeyParameter)parameters; + } + + engine.Init(forEncryption, parameters); + + this.forPrivateKey = kParam.IsPrivate; + this.forEncryption = forEncryption; + this.blockBuffer = new byte[engine.GetOutputBlockSize()]; + + if (pLen > 0 && fallback == null && random == null) + throw new ArgumentException("encoder requires random"); + } + + public int GetInputBlockSize() + { + int baseBlockSize = engine.GetInputBlockSize(); + + return forEncryption + ? baseBlockSize - HeaderLength + : baseBlockSize; + } + + public int GetOutputBlockSize() + { + int baseBlockSize = engine.GetOutputBlockSize(); + + return forEncryption + ? baseBlockSize + : baseBlockSize - HeaderLength; + } + + public byte[] ProcessBlock( + byte[] input, + int inOff, + int length) + { + return forEncryption + ? EncodeBlock(input, inOff, length) + : DecodeBlock(input, inOff, length); + } + + private byte[] EncodeBlock( + byte[] input, + int inOff, + int inLen) + { + if (inLen > GetInputBlockSize()) + throw new ArgumentException("input data too large", "inLen"); + + byte[] block = new byte[engine.GetInputBlockSize()]; + + if (forPrivateKey) + { + block[0] = 0x01; // type code 1 + + for (int i = 1; i != block.Length - inLen - 1; i++) + { + block[i] = (byte)0xFF; + } + } + else + { + random.NextBytes(block); // random fill + + block[0] = 0x02; // type code 2 + + // + // a zero byte marks the end of the padding, so all + // the pad bytes must be non-zero. + // + for (int i = 1; i != block.Length - inLen - 1; i++) + { + while (block[i] == 0) + { + block[i] = (byte)random.NextInt(); + } + } + } + + block[block.Length - inLen - 1] = 0x00; // mark the end of the padding + Array.Copy(input, inOff, block, block.Length - inLen, inLen); + + return engine.ProcessBlock(block, 0, block.Length); + } + + /** + * Checks if the argument is a correctly PKCS#1.5 encoded Plaintext + * for encryption. + * + * @param encoded The Plaintext. + * @param pLen Expected length of the plaintext. + * @return Either 0, if the encoding is correct, or -1, if it is incorrect. + */ + private static int CheckPkcs1Encoding(byte[] encoded, int pLen) + { + int correct = 0; + /* + * Check if the first two bytes are 0 2 + */ + correct |= (encoded[0] ^ 2); + + /* + * Now the padding check, check for no 0 byte in the padding + */ + int plen = encoded.Length - ( + pLen /* Lenght of the PMS */ + + 1 /* Final 0-byte before PMS */ + ); + + for (int i = 1; i < plen; i++) + { + int tmp = encoded[i]; + tmp |= tmp >> 1; + tmp |= tmp >> 2; + tmp |= tmp >> 4; + correct |= (tmp & 1) - 1; + } + + /* + * Make sure the padding ends with a 0 byte. + */ + correct |= encoded[encoded.Length - (pLen + 1)]; + + /* + * Return 0 or 1, depending on the result. + */ + correct |= correct >> 1; + correct |= correct >> 2; + correct |= correct >> 4; + return ~((correct & 1) - 1); + } + + /** + * Decode PKCS#1.5 encoding, and return a random value if the padding is not correct. + * + * @param in The encrypted block. + * @param inOff Offset in the encrypted block. + * @param inLen Length of the encrypted block. + * @param pLen Length of the desired output. + * @return The plaintext without padding, or a random value if the padding was incorrect. + * @throws InvalidCipherTextException + */ + private byte[] DecodeBlockOrRandom(byte[] input, int inOff, int inLen) + { + if (!forPrivateKey) + throw new InvalidCipherTextException("sorry, this method is only for decryption, not for signing"); + + byte[] block = engine.ProcessBlock(input, inOff, inLen); + byte[] random; + if (this.fallback == null) + { + random = new byte[this.pLen]; + this.random.NextBytes(random); + } + else + { + random = fallback; + } + + byte[] data = (useStrictLength & (block.Length != engine.GetOutputBlockSize())) ? blockBuffer : block; + + /* + * Check the padding. + */ + int correct = CheckPkcs1Encoding(data, this.pLen); + + /* + * Now, to a constant time constant memory copy of the decrypted value + * or the random value, depending on the validity of the padding. + */ + byte[] result = new byte[this.pLen]; + for (int i = 0; i < this.pLen; i++) + { + result[i] = (byte)((data[i + (data.Length - pLen)] & (~correct)) | (random[i] & correct)); + } + + Arrays.Fill(data, 0); + + return result; + } + + /** + * @exception InvalidCipherTextException if the decrypted block is not in Pkcs1 format. + */ + private byte[] DecodeBlock( + byte[] input, + int inOff, + int inLen) + { + /* + * If the length of the expected plaintext is known, we use a constant-time decryption. + * If the decryption fails, we return a random value. + */ + if (this.pLen != -1) + { + return this.DecodeBlockOrRandom(input, inOff, inLen); + } + + byte[] block = engine.ProcessBlock(input, inOff, inLen); + bool incorrectLength = (useStrictLength & (block.Length != engine.GetOutputBlockSize())); + + byte[] data; + if (block.Length < GetOutputBlockSize()) + { + data = blockBuffer; + } + else + { + data = block; + } + + byte expectedType = (byte)(forPrivateKey ? 2 : 1); + byte type = data[0]; + + bool badType = (type != expectedType); + + // + // find and extract the message block. + // + int start = FindStart(type, data); + + start++; // data should start at the next byte + + if (badType | (start < HeaderLength)) + { + Arrays.Fill(data, 0); + throw new InvalidCipherTextException("block incorrect"); + } + + // if we get this far, it's likely to be a genuine encoding error + if (incorrectLength) + { + Arrays.Fill(data, 0); + throw new InvalidCipherTextException("block incorrect size"); + } + + byte[] result = new byte[data.Length - start]; + + Array.Copy(data, start, result, 0, result.Length); + + return result; + } + + private int FindStart(byte type, byte[] block) + { + int start = -1; + bool padErr = false; + + for (int i = 1; i != block.Length; i++) + { + byte pad = block[i]; + + if (pad == 0 & start < 0) + { + start = i; + } + padErr |= ((type == 1) & (start < 0) & (pad != (byte)0xff)); + } + + return padErr ? -1 : start; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/Pkcs1Encoding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/Pkcs1Encoding.cs.meta new file mode 100644 index 00000000..17ace7b4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/encodings/Pkcs1Encoding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b1316d7c7c9dbc42b6ed758a5b1e70e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines.meta new file mode 100644 index 00000000..88ed5db0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7b265757931cf134392d9b1ab2925c86 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesEngine.cs new file mode 100644 index 00000000..0fbcb21c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesEngine.cs @@ -0,0 +1,614 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * an implementation of the AES (Rijndael), from FIPS-197. + *

+ * For further details see: http://csrc.nist.gov/encryption/aes/. + * + * This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at + * http://fp.gladman.plus.com/cryptography_technology/rijndael/ + * + * There are three levels of tradeoff of speed vs memory + * Because java has no preprocessor, they are written as three separate classes from which to choose + * + * The fastest uses 8Kbytes of static tables to precompute round calculations, 4 256 word tables for encryption + * and 4 for decryption. + * + * The middle performance version uses only one 256 word table for each, for a total of 2Kbytes, + * adding 12 rotate operations per round to compute the values contained in the other tables from + * the contents of the first. + * + * The slowest version uses no static tables at all and computes the values in each round. + *

+ *

+ * This file contains the middle performance version with 2Kbytes of static tables for round precomputation. + *

+ */ + public class AesEngine + : IBlockCipher + { + // The S box + private static readonly byte[] S = + { + 99, 124, 119, 123, 242, 107, 111, 197, + 48, 1, 103, 43, 254, 215, 171, 118, + 202, 130, 201, 125, 250, 89, 71, 240, + 173, 212, 162, 175, 156, 164, 114, 192, + 183, 253, 147, 38, 54, 63, 247, 204, + 52, 165, 229, 241, 113, 216, 49, 21, + 4, 199, 35, 195, 24, 150, 5, 154, + 7, 18, 128, 226, 235, 39, 178, 117, + 9, 131, 44, 26, 27, 110, 90, 160, + 82, 59, 214, 179, 41, 227, 47, 132, + 83, 209, 0, 237, 32, 252, 177, 91, + 106, 203, 190, 57, 74, 76, 88, 207, + 208, 239, 170, 251, 67, 77, 51, 133, + 69, 249, 2, 127, 80, 60, 159, 168, + 81, 163, 64, 143, 146, 157, 56, 245, + 188, 182, 218, 33, 16, 255, 243, 210, + 205, 12, 19, 236, 95, 151, 68, 23, + 196, 167, 126, 61, 100, 93, 25, 115, + 96, 129, 79, 220, 34, 42, 144, 136, + 70, 238, 184, 20, 222, 94, 11, 219, + 224, 50, 58, 10, 73, 6, 36, 92, + 194, 211, 172, 98, 145, 149, 228, 121, + 231, 200, 55, 109, 141, 213, 78, 169, + 108, 86, 244, 234, 101, 122, 174, 8, + 186, 120, 37, 46, 28, 166, 180, 198, + 232, 221, 116, 31, 75, 189, 139, 138, + 112, 62, 181, 102, 72, 3, 246, 14, + 97, 53, 87, 185, 134, 193, 29, 158, + 225, 248, 152, 17, 105, 217, 142, 148, + 155, 30, 135, 233, 206, 85, 40, 223, + 140, 161, 137, 13, 191, 230, 66, 104, + 65, 153, 45, 15, 176, 84, 187, 22, + }; + + // The inverse S-box + private static readonly byte[] Si = + { + 82, 9, 106, 213, 48, 54, 165, 56, + 191, 64, 163, 158, 129, 243, 215, 251, + 124, 227, 57, 130, 155, 47, 255, 135, + 52, 142, 67, 68, 196, 222, 233, 203, + 84, 123, 148, 50, 166, 194, 35, 61, + 238, 76, 149, 11, 66, 250, 195, 78, + 8, 46, 161, 102, 40, 217, 36, 178, + 118, 91, 162, 73, 109, 139, 209, 37, + 114, 248, 246, 100, 134, 104, 152, 22, + 212, 164, 92, 204, 93, 101, 182, 146, + 108, 112, 72, 80, 253, 237, 185, 218, + 94, 21, 70, 87, 167, 141, 157, 132, + 144, 216, 171, 0, 140, 188, 211, 10, + 247, 228, 88, 5, 184, 179, 69, 6, + 208, 44, 30, 143, 202, 63, 15, 2, + 193, 175, 189, 3, 1, 19, 138, 107, + 58, 145, 17, 65, 79, 103, 220, 234, + 151, 242, 207, 206, 240, 180, 230, 115, + 150, 172, 116, 34, 231, 173, 53, 133, + 226, 249, 55, 232, 28, 117, 223, 110, + 71, 241, 26, 113, 29, 41, 197, 137, + 111, 183, 98, 14, 170, 24, 190, 27, + 252, 86, 62, 75, 198, 210, 121, 32, + 154, 219, 192, 254, 120, 205, 90, 244, + 31, 221, 168, 51, 136, 7, 199, 49, + 177, 18, 16, 89, 39, 128, 236, 95, + 96, 81, 127, 169, 25, 181, 74, 13, + 45, 229, 122, 159, 147, 201, 156, 239, + 160, 224, 59, 77, 174, 42, 245, 176, + 200, 235, 187, 60, 131, 83, 153, 97, + 23, 43, 4, 126, 186, 119, 214, 38, + 225, 105, 20, 99, 85, 33, 12, 125, + }; + + // vector used in calculating key schedule (powers of x in GF(256)) + private static readonly byte[] rcon = + { + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, + 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 + }; + + // precomputation tables of calculations for rounds + private static readonly uint[] T0 = + { + 0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6, 0x0df2f2ff, + 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591, 0x50303060, 0x03010102, + 0xa96767ce, 0x7d2b2b56, 0x19fefee7, 0x62d7d7b5, 0xe6abab4d, + 0x9a7676ec, 0x45caca8f, 0x9d82821f, 0x40c9c989, 0x877d7dfa, + 0x15fafaef, 0xeb5959b2, 0xc947478e, 0x0bf0f0fb, 0xecadad41, + 0x67d4d4b3, 0xfda2a25f, 0xeaafaf45, 0xbf9c9c23, 0xf7a4a453, + 0x967272e4, 0x5bc0c09b, 0xc2b7b775, 0x1cfdfde1, 0xae93933d, + 0x6a26264c, 0x5a36366c, 0x413f3f7e, 0x02f7f7f5, 0x4fcccc83, + 0x5c343468, 0xf4a5a551, 0x34e5e5d1, 0x08f1f1f9, 0x937171e2, + 0x73d8d8ab, 0x53313162, 0x3f15152a, 0x0c040408, 0x52c7c795, + 0x65232346, 0x5ec3c39d, 0x28181830, 0xa1969637, 0x0f05050a, + 0xb59a9a2f, 0x0907070e, 0x36121224, 0x9b80801b, 0x3de2e2df, + 0x26ebebcd, 0x6927274e, 0xcdb2b27f, 0x9f7575ea, 0x1b090912, + 0x9e83831d, 0x742c2c58, 0x2e1a1a34, 0x2d1b1b36, 0xb26e6edc, + 0xee5a5ab4, 0xfba0a05b, 0xf65252a4, 0x4d3b3b76, 0x61d6d6b7, + 0xceb3b37d, 0x7b292952, 0x3ee3e3dd, 0x712f2f5e, 0x97848413, + 0xf55353a6, 0x68d1d1b9, 0x00000000, 0x2cededc1, 0x60202040, + 0x1ffcfce3, 0xc8b1b179, 0xed5b5bb6, 0xbe6a6ad4, 0x46cbcb8d, + 0xd9bebe67, 0x4b393972, 0xde4a4a94, 0xd44c4c98, 0xe85858b0, + 0x4acfcf85, 0x6bd0d0bb, 0x2aefefc5, 0xe5aaaa4f, 0x16fbfbed, + 0xc5434386, 0xd74d4d9a, 0x55333366, 0x94858511, 0xcf45458a, + 0x10f9f9e9, 0x06020204, 0x817f7ffe, 0xf05050a0, 0x443c3c78, + 0xba9f9f25, 0xe3a8a84b, 0xf35151a2, 0xfea3a35d, 0xc0404080, + 0x8a8f8f05, 0xad92923f, 0xbc9d9d21, 0x48383870, 0x04f5f5f1, + 0xdfbcbc63, 0xc1b6b677, 0x75dadaaf, 0x63212142, 0x30101020, + 0x1affffe5, 0x0ef3f3fd, 0x6dd2d2bf, 0x4ccdcd81, 0x140c0c18, + 0x35131326, 0x2fececc3, 0xe15f5fbe, 0xa2979735, 0xcc444488, + 0x3917172e, 0x57c4c493, 0xf2a7a755, 0x827e7efc, 0x473d3d7a, + 0xac6464c8, 0xe75d5dba, 0x2b191932, 0x957373e6, 0xa06060c0, + 0x98818119, 0xd14f4f9e, 0x7fdcdca3, 0x66222244, 0x7e2a2a54, + 0xab90903b, 0x8388880b, 0xca46468c, 0x29eeeec7, 0xd3b8b86b, + 0x3c141428, 0x79dedea7, 0xe25e5ebc, 0x1d0b0b16, 0x76dbdbad, + 0x3be0e0db, 0x56323264, 0x4e3a3a74, 0x1e0a0a14, 0xdb494992, + 0x0a06060c, 0x6c242448, 0xe45c5cb8, 0x5dc2c29f, 0x6ed3d3bd, + 0xefacac43, 0xa66262c4, 0xa8919139, 0xa4959531, 0x37e4e4d3, + 0x8b7979f2, 0x32e7e7d5, 0x43c8c88b, 0x5937376e, 0xb76d6dda, + 0x8c8d8d01, 0x64d5d5b1, 0xd24e4e9c, 0xe0a9a949, 0xb46c6cd8, + 0xfa5656ac, 0x07f4f4f3, 0x25eaeacf, 0xaf6565ca, 0x8e7a7af4, + 0xe9aeae47, 0x18080810, 0xd5baba6f, 0x887878f0, 0x6f25254a, + 0x722e2e5c, 0x241c1c38, 0xf1a6a657, 0xc7b4b473, 0x51c6c697, + 0x23e8e8cb, 0x7cdddda1, 0x9c7474e8, 0x211f1f3e, 0xdd4b4b96, + 0xdcbdbd61, 0x868b8b0d, 0x858a8a0f, 0x907070e0, 0x423e3e7c, + 0xc4b5b571, 0xaa6666cc, 0xd8484890, 0x05030306, 0x01f6f6f7, + 0x120e0e1c, 0xa36161c2, 0x5f35356a, 0xf95757ae, 0xd0b9b969, + 0x91868617, 0x58c1c199, 0x271d1d3a, 0xb99e9e27, 0x38e1e1d9, + 0x13f8f8eb, 0xb398982b, 0x33111122, 0xbb6969d2, 0x70d9d9a9, + 0x898e8e07, 0xa7949433, 0xb69b9b2d, 0x221e1e3c, 0x92878715, + 0x20e9e9c9, 0x49cece87, 0xff5555aa, 0x78282850, 0x7adfdfa5, + 0x8f8c8c03, 0xf8a1a159, 0x80898909, 0x170d0d1a, 0xdabfbf65, + 0x31e6e6d7, 0xc6424284, 0xb86868d0, 0xc3414182, 0xb0999929, + 0x772d2d5a, 0x110f0f1e, 0xcbb0b07b, 0xfc5454a8, 0xd6bbbb6d, + 0x3a16162c + }; + + private static readonly uint[] Tinv0 = + { + 0x50a7f451, 0x5365417e, 0xc3a4171a, 0x965e273a, 0xcb6bab3b, + 0xf1459d1f, 0xab58faac, 0x9303e34b, 0x55fa3020, 0xf66d76ad, + 0x9176cc88, 0x254c02f5, 0xfcd7e54f, 0xd7cb2ac5, 0x80443526, + 0x8fa362b5, 0x495ab1de, 0x671bba25, 0x980eea45, 0xe1c0fe5d, + 0x02752fc3, 0x12f04c81, 0xa397468d, 0xc6f9d36b, 0xe75f8f03, + 0x959c9215, 0xeb7a6dbf, 0xda595295, 0x2d83bed4, 0xd3217458, + 0x2969e049, 0x44c8c98e, 0x6a89c275, 0x78798ef4, 0x6b3e5899, + 0xdd71b927, 0xb64fe1be, 0x17ad88f0, 0x66ac20c9, 0xb43ace7d, + 0x184adf63, 0x82311ae5, 0x60335197, 0x457f5362, 0xe07764b1, + 0x84ae6bbb, 0x1ca081fe, 0x942b08f9, 0x58684870, 0x19fd458f, + 0x876cde94, 0xb7f87b52, 0x23d373ab, 0xe2024b72, 0x578f1fe3, + 0x2aab5566, 0x0728ebb2, 0x03c2b52f, 0x9a7bc586, 0xa50837d3, + 0xf2872830, 0xb2a5bf23, 0xba6a0302, 0x5c8216ed, 0x2b1ccf8a, + 0x92b479a7, 0xf0f207f3, 0xa1e2694e, 0xcdf4da65, 0xd5be0506, + 0x1f6234d1, 0x8afea6c4, 0x9d532e34, 0xa055f3a2, 0x32e18a05, + 0x75ebf6a4, 0x39ec830b, 0xaaef6040, 0x069f715e, 0x51106ebd, + 0xf98a213e, 0x3d06dd96, 0xae053edd, 0x46bde64d, 0xb58d5491, + 0x055dc471, 0x6fd40604, 0xff155060, 0x24fb9819, 0x97e9bdd6, + 0xcc434089, 0x779ed967, 0xbd42e8b0, 0x888b8907, 0x385b19e7, + 0xdbeec879, 0x470a7ca1, 0xe90f427c, 0xc91e84f8, 0x00000000, + 0x83868009, 0x48ed2b32, 0xac70111e, 0x4e725a6c, 0xfbff0efd, + 0x5638850f, 0x1ed5ae3d, 0x27392d36, 0x64d90f0a, 0x21a65c68, + 0xd1545b9b, 0x3a2e3624, 0xb1670a0c, 0x0fe75793, 0xd296eeb4, + 0x9e919b1b, 0x4fc5c080, 0xa220dc61, 0x694b775a, 0x161a121c, + 0x0aba93e2, 0xe52aa0c0, 0x43e0223c, 0x1d171b12, 0x0b0d090e, + 0xadc78bf2, 0xb9a8b62d, 0xc8a91e14, 0x8519f157, 0x4c0775af, + 0xbbdd99ee, 0xfd607fa3, 0x9f2601f7, 0xbcf5725c, 0xc53b6644, + 0x347efb5b, 0x7629438b, 0xdcc623cb, 0x68fcedb6, 0x63f1e4b8, + 0xcadc31d7, 0x10856342, 0x40229713, 0x2011c684, 0x7d244a85, + 0xf83dbbd2, 0x1132f9ae, 0x6da129c7, 0x4b2f9e1d, 0xf330b2dc, + 0xec52860d, 0xd0e3c177, 0x6c16b32b, 0x99b970a9, 0xfa489411, + 0x2264e947, 0xc48cfca8, 0x1a3ff0a0, 0xd82c7d56, 0xef903322, + 0xc74e4987, 0xc1d138d9, 0xfea2ca8c, 0x360bd498, 0xcf81f5a6, + 0x28de7aa5, 0x268eb7da, 0xa4bfad3f, 0xe49d3a2c, 0x0d927850, + 0x9bcc5f6a, 0x62467e54, 0xc2138df6, 0xe8b8d890, 0x5ef7392e, + 0xf5afc382, 0xbe805d9f, 0x7c93d069, 0xa92dd56f, 0xb31225cf, + 0x3b99acc8, 0xa77d1810, 0x6e639ce8, 0x7bbb3bdb, 0x097826cd, + 0xf418596e, 0x01b79aec, 0xa89a4f83, 0x656e95e6, 0x7ee6ffaa, + 0x08cfbc21, 0xe6e815ef, 0xd99be7ba, 0xce366f4a, 0xd4099fea, + 0xd67cb029, 0xafb2a431, 0x31233f2a, 0x3094a5c6, 0xc066a235, + 0x37bc4e74, 0xa6ca82fc, 0xb0d090e0, 0x15d8a733, 0x4a9804f1, + 0xf7daec41, 0x0e50cd7f, 0x2ff69117, 0x8dd64d76, 0x4db0ef43, + 0x544daacc, 0xdf0496e4, 0xe3b5d19e, 0x1b886a4c, 0xb81f2cc1, + 0x7f516546, 0x04ea5e9d, 0x5d358c01, 0x737487fa, 0x2e410bfb, + 0x5a1d67b3, 0x52d2db92, 0x335610e9, 0x1347d66d, 0x8c61d79a, + 0x7a0ca137, 0x8e14f859, 0x893c13eb, 0xee27a9ce, 0x35c961b7, + 0xede51ce1, 0x3cb1477a, 0x59dfd29c, 0x3f73f255, 0x79ce1418, + 0xbf37c773, 0xeacdf753, 0x5baafd5f, 0x146f3ddf, 0x86db4478, + 0x81f3afca, 0x3ec468b9, 0x2c342438, 0x5f40a3c2, 0x72c31d16, + 0x0c25e2bc, 0x8b493c28, 0x41950dff, 0x7101a839, 0xdeb30c08, + 0x9ce4b4d8, 0x90c15664, 0x6184cb7b, 0x70b632d5, 0x745c6c48, + 0x4257b8d0 + }; + + private static uint Shift(uint r, int shift) + { + return (r >> shift) | (r << (32 - shift)); + } + + /* multiply four bytes in GF(2^8) by 'x' {02} in parallel */ + + private const uint m1 = 0x80808080; + private const uint m2 = 0x7f7f7f7f; + private const uint m3 = 0x0000001b; + private const uint m4 = 0xC0C0C0C0; + private const uint m5 = 0x3f3f3f3f; + + private static uint FFmulX(uint x) + { + return ((x & m2) << 1) ^ (((x & m1) >> 7) * m3); + } + + private static uint FFmulX2(uint x) + { + uint t0 = (x & m5) << 2; + uint t1 = (x & m4); + t1 ^= (t1 >> 1); + return t0 ^ (t1 >> 2) ^ (t1 >> 5); + } + + /* + The following defines provide alternative definitions of FFmulX that might + give improved performance if a fast 32-bit multiply is not available. + + private int FFmulX(int x) { int u = x & m1; u |= (u >> 1); return ((x & m2) << 1) ^ ((u >>> 3) | (u >>> 6)); } + private static final int m4 = 0x1b1b1b1b; + private int FFmulX(int x) { int u = x & m1; return ((x & m2) << 1) ^ ((u - (u >>> 7)) & m4); } + + */ + + private static uint Inv_Mcol(uint x) + { + uint t0, t1; + t0 = x; + t1 = t0 ^ Shift(t0, 8); + t0 ^= FFmulX(t1); + t1 ^= FFmulX2(t0); + t0 ^= t1 ^ Shift(t1, 16); + return t0; + } + + private static uint SubWord(uint x) + { + return (uint)S[x&255] + | (((uint)S[(x>>8)&255]) << 8) + | (((uint)S[(x>>16)&255]) << 16) + | (((uint)S[(x>>24)&255]) << 24); + } + + /** + * Calculate the necessary round keys + * The number of calculations depends on key size and block size + * AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits + * This code is written assuming those are the only possible values + */ + private uint[][] GenerateWorkingKey(byte[] key, bool forEncryption) + { + int keyLen = key.Length; + if (keyLen < 16 || keyLen > 32 || (keyLen & 7) != 0) + throw new ArgumentException("Key length not 128/192/256 bits."); + + int KC = keyLen >> 2; + this.ROUNDS = KC + 6; // This is not always true for the generalized Rijndael that allows larger block sizes + + uint[][] W = new uint[ROUNDS + 1][]; // 4 words in a block + for (int i = 0; i <= ROUNDS; ++i) + { + W[i] = new uint[4]; + } + + switch (KC) + { + case 4: + { + uint t0 = Pack.LE_To_UInt32(key, 0); W[0][0] = t0; + uint t1 = Pack.LE_To_UInt32(key, 4); W[0][1] = t1; + uint t2 = Pack.LE_To_UInt32(key, 8); W[0][2] = t2; + uint t3 = Pack.LE_To_UInt32(key, 12); W[0][3] = t3; + + for (int i = 1; i <= 10; ++i) + { + uint u = SubWord(Shift(t3, 8)) ^ rcon[i - 1]; + t0 ^= u; W[i][0] = t0; + t1 ^= t0; W[i][1] = t1; + t2 ^= t1; W[i][2] = t2; + t3 ^= t2; W[i][3] = t3; + } + + break; + } + case 6: + { + uint t0 = Pack.LE_To_UInt32(key, 0); W[0][0] = t0; + uint t1 = Pack.LE_To_UInt32(key, 4); W[0][1] = t1; + uint t2 = Pack.LE_To_UInt32(key, 8); W[0][2] = t2; + uint t3 = Pack.LE_To_UInt32(key, 12); W[0][3] = t3; + uint t4 = Pack.LE_To_UInt32(key, 16); W[1][0] = t4; + uint t5 = Pack.LE_To_UInt32(key, 20); W[1][1] = t5; + + uint rcon = 1; + uint u = SubWord(Shift(t5, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[1][2] = t0; + t1 ^= t0; W[1][3] = t1; + t2 ^= t1; W[2][0] = t2; + t3 ^= t2; W[2][1] = t3; + t4 ^= t3; W[2][2] = t4; + t5 ^= t4; W[2][3] = t5; + + for (int i = 3; i < 12; i += 3) + { + u = SubWord(Shift(t5, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[i ][0] = t0; + t1 ^= t0; W[i ][1] = t1; + t2 ^= t1; W[i ][2] = t2; + t3 ^= t2; W[i ][3] = t3; + t4 ^= t3; W[i + 1][0] = t4; + t5 ^= t4; W[i + 1][1] = t5; + u = SubWord(Shift(t5, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[i + 1][2] = t0; + t1 ^= t0; W[i + 1][3] = t1; + t2 ^= t1; W[i + 2][0] = t2; + t3 ^= t2; W[i + 2][1] = t3; + t4 ^= t3; W[i + 2][2] = t4; + t5 ^= t4; W[i + 2][3] = t5; + } + + u = SubWord(Shift(t5, 8)) ^ rcon; + t0 ^= u; W[12][0] = t0; + t1 ^= t0; W[12][1] = t1; + t2 ^= t1; W[12][2] = t2; + t3 ^= t2; W[12][3] = t3; + + break; + } + case 8: + { + uint t0 = Pack.LE_To_UInt32(key, 0); W[0][0] = t0; + uint t1 = Pack.LE_To_UInt32(key, 4); W[0][1] = t1; + uint t2 = Pack.LE_To_UInt32(key, 8); W[0][2] = t2; + uint t3 = Pack.LE_To_UInt32(key, 12); W[0][3] = t3; + uint t4 = Pack.LE_To_UInt32(key, 16); W[1][0] = t4; + uint t5 = Pack.LE_To_UInt32(key, 20); W[1][1] = t5; + uint t6 = Pack.LE_To_UInt32(key, 24); W[1][2] = t6; + uint t7 = Pack.LE_To_UInt32(key, 28); W[1][3] = t7; + + uint u, rcon = 1; + + for (int i = 2; i < 14; i += 2) + { + u = SubWord(Shift(t7, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[i ][0] = t0; + t1 ^= t0; W[i ][1] = t1; + t2 ^= t1; W[i ][2] = t2; + t3 ^= t2; W[i ][3] = t3; + u = SubWord(t3); + t4 ^= u; W[i + 1][0] = t4; + t5 ^= t4; W[i + 1][1] = t5; + t6 ^= t5; W[i + 1][2] = t6; + t7 ^= t6; W[i + 1][3] = t7; + } + + u = SubWord(Shift(t7, 8)) ^ rcon; + t0 ^= u; W[14][0] = t0; + t1 ^= t0; W[14][1] = t1; + t2 ^= t1; W[14][2] = t2; + t3 ^= t2; W[14][3] = t3; + + break; + } + default: + { + throw new InvalidOperationException("Should never get here"); + } + } + + if (!forEncryption) + { + for (int j = 1; j < ROUNDS; j++) + { + uint[] w = W[j]; + for (int i = 0; i < 4; i++) + { + w[i] = Inv_Mcol(w[i]); + } + } + } + + return W; + } + + private int ROUNDS; + private uint[][] WorkingKey; + private uint C0, C1, C2, C3; + private bool forEncryption; + + private byte[] s; + + private const int BLOCK_SIZE = 16; + + /** + * default constructor - 128 bit block size. + */ + public AesEngine() + { + } + + /** + * initialise an AES cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + KeyParameter keyParameter = parameters as KeyParameter; + + if (keyParameter == null) + throw new ArgumentException("invalid parameter passed to AES init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + WorkingKey = GenerateWorkingKey(keyParameter.GetKey(), forEncryption); + + this.forEncryption = forEncryption; + this.s = Arrays.Clone(forEncryption ? S : Si); + } + + public virtual string AlgorithmName + { + get { return "AES"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (WorkingKey == null) + throw new InvalidOperationException("AES engine not initialised"); + + Check.DataLength(input, inOff, 16, "input buffer too short"); + Check.OutputLength(output, outOff, 16, "output buffer too short"); + + UnPackBlock(input, inOff); + + if (forEncryption) + { + EncryptBlock(WorkingKey); + } + else + { + DecryptBlock(WorkingKey); + } + + PackBlock(output, outOff); + + return BLOCK_SIZE; + } + + public virtual void Reset() + { + } + + private void UnPackBlock( + byte[] bytes, + int off) + { + C0 = Pack.LE_To_UInt32(bytes, off); + C1 = Pack.LE_To_UInt32(bytes, off + 4); + C2 = Pack.LE_To_UInt32(bytes, off + 8); + C3 = Pack.LE_To_UInt32(bytes, off + 12); + } + + private void PackBlock( + byte[] bytes, + int off) + { + Pack.UInt32_To_LE(C0, bytes, off); + Pack.UInt32_To_LE(C1, bytes, off + 4); + Pack.UInt32_To_LE(C2, bytes, off + 8); + Pack.UInt32_To_LE(C3, bytes, off + 12); + } + + private void EncryptBlock(uint[][] KW) + { + uint[] kw = KW[0]; + uint t0 = this.C0 ^ kw[0]; + uint t1 = this.C1 ^ kw[1]; + uint t2 = this.C2 ^ kw[2]; + + uint r0, r1, r2, r3 = this.C3 ^ kw[3]; + int r = 1; + while (r < ROUNDS - 1) + { + kw = KW[r++]; + r0 = T0[t0 & 255] ^ Shift(T0[(t1 >> 8) & 255], 24) ^ Shift(T0[(t2 >> 16) & 255], 16) ^ Shift(T0[(r3 >> 24) & 255], 8) ^ kw[0]; + r1 = T0[t1 & 255] ^ Shift(T0[(t2 >> 8) & 255], 24) ^ Shift(T0[(r3 >> 16) & 255], 16) ^ Shift(T0[(t0 >> 24) & 255], 8) ^ kw[1]; + r2 = T0[t2 & 255] ^ Shift(T0[(r3 >> 8) & 255], 24) ^ Shift(T0[(t0 >> 16) & 255], 16) ^ Shift(T0[(t1 >> 24) & 255], 8) ^ kw[2]; + r3 = T0[r3 & 255] ^ Shift(T0[(t0 >> 8) & 255], 24) ^ Shift(T0[(t1 >> 16) & 255], 16) ^ Shift(T0[(t2 >> 24) & 255], 8) ^ kw[3]; + kw = KW[r++]; + t0 = T0[r0 & 255] ^ Shift(T0[(r1 >> 8) & 255], 24) ^ Shift(T0[(r2 >> 16) & 255], 16) ^ Shift(T0[(r3 >> 24) & 255], 8) ^ kw[0]; + t1 = T0[r1 & 255] ^ Shift(T0[(r2 >> 8) & 255], 24) ^ Shift(T0[(r3 >> 16) & 255], 16) ^ Shift(T0[(r0 >> 24) & 255], 8) ^ kw[1]; + t2 = T0[r2 & 255] ^ Shift(T0[(r3 >> 8) & 255], 24) ^ Shift(T0[(r0 >> 16) & 255], 16) ^ Shift(T0[(r1 >> 24) & 255], 8) ^ kw[2]; + r3 = T0[r3 & 255] ^ Shift(T0[(r0 >> 8) & 255], 24) ^ Shift(T0[(r1 >> 16) & 255], 16) ^ Shift(T0[(r2 >> 24) & 255], 8) ^ kw[3]; + } + + kw = KW[r++]; + r0 = T0[t0 & 255] ^ Shift(T0[(t1 >> 8) & 255], 24) ^ Shift(T0[(t2 >> 16) & 255], 16) ^ Shift(T0[(r3 >> 24) & 255], 8) ^ kw[0]; + r1 = T0[t1 & 255] ^ Shift(T0[(t2 >> 8) & 255], 24) ^ Shift(T0[(r3 >> 16) & 255], 16) ^ Shift(T0[(t0 >> 24) & 255], 8) ^ kw[1]; + r2 = T0[t2 & 255] ^ Shift(T0[(r3 >> 8) & 255], 24) ^ Shift(T0[(t0 >> 16) & 255], 16) ^ Shift(T0[(t1 >> 24) & 255], 8) ^ kw[2]; + r3 = T0[r3 & 255] ^ Shift(T0[(t0 >> 8) & 255], 24) ^ Shift(T0[(t1 >> 16) & 255], 16) ^ Shift(T0[(t2 >> 24) & 255], 8) ^ kw[3]; + + // the final round's table is a simple function of S so we don't use a whole other four tables for it + + kw = KW[r]; + this.C0 = (uint)S[r0 & 255] ^ (((uint)S[(r1 >> 8) & 255]) << 8) ^ (((uint)s[(r2 >> 16) & 255]) << 16) ^ (((uint)s[(r3 >> 24) & 255]) << 24) ^ kw[0]; + this.C1 = (uint)s[r1 & 255] ^ (((uint)S[(r2 >> 8) & 255]) << 8) ^ (((uint)S[(r3 >> 16) & 255]) << 16) ^ (((uint)s[(r0 >> 24) & 255]) << 24) ^ kw[1]; + this.C2 = (uint)s[r2 & 255] ^ (((uint)S[(r3 >> 8) & 255]) << 8) ^ (((uint)S[(r0 >> 16) & 255]) << 16) ^ (((uint)S[(r1 >> 24) & 255]) << 24) ^ kw[2]; + this.C3 = (uint)s[r3 & 255] ^ (((uint)s[(r0 >> 8) & 255]) << 8) ^ (((uint)s[(r1 >> 16) & 255]) << 16) ^ (((uint)S[(r2 >> 24) & 255]) << 24) ^ kw[3]; + } + + private void DecryptBlock(uint[][] KW) + { + uint[] kw = KW[ROUNDS]; + uint t0 = this.C0 ^ kw[0]; + uint t1 = this.C1 ^ kw[1]; + uint t2 = this.C2 ^ kw[2]; + + uint r0, r1, r2, r3 = this.C3 ^ kw[3]; + int r = ROUNDS - 1; + while (r > 1) + { + kw = KW[r--]; + r0 = Tinv0[t0 & 255] ^ Shift(Tinv0[(r3 >> 8) & 255], 24) ^ Shift(Tinv0[(t2 >> 16) & 255], 16) ^ Shift(Tinv0[(t1 >> 24) & 255], 8) ^ kw[0]; + r1 = Tinv0[t1 & 255] ^ Shift(Tinv0[(t0 >> 8) & 255], 24) ^ Shift(Tinv0[(r3 >> 16) & 255], 16) ^ Shift(Tinv0[(t2 >> 24) & 255], 8) ^ kw[1]; + r2 = Tinv0[t2 & 255] ^ Shift(Tinv0[(t1 >> 8) & 255], 24) ^ Shift(Tinv0[(t0 >> 16) & 255], 16) ^ Shift(Tinv0[(r3 >> 24) & 255], 8) ^ kw[2]; + r3 = Tinv0[r3 & 255] ^ Shift(Tinv0[(t2 >> 8) & 255], 24) ^ Shift(Tinv0[(t1 >> 16) & 255], 16) ^ Shift(Tinv0[(t0 >> 24) & 255], 8) ^ kw[3]; + kw = KW[r--]; + t0 = Tinv0[r0 & 255] ^ Shift(Tinv0[(r3 >> 8) & 255], 24) ^ Shift(Tinv0[(r2 >> 16) & 255], 16) ^ Shift(Tinv0[(r1 >> 24) & 255], 8) ^ kw[0]; + t1 = Tinv0[r1 & 255] ^ Shift(Tinv0[(r0 >> 8) & 255], 24) ^ Shift(Tinv0[(r3 >> 16) & 255], 16) ^ Shift(Tinv0[(r2 >> 24) & 255], 8) ^ kw[1]; + t2 = Tinv0[r2 & 255] ^ Shift(Tinv0[(r1 >> 8) & 255], 24) ^ Shift(Tinv0[(r0 >> 16) & 255], 16) ^ Shift(Tinv0[(r3 >> 24) & 255], 8) ^ kw[2]; + r3 = Tinv0[r3 & 255] ^ Shift(Tinv0[(r2 >> 8) & 255], 24) ^ Shift(Tinv0[(r1 >> 16) & 255], 16) ^ Shift(Tinv0[(r0 >> 24) & 255], 8) ^ kw[3]; + } + + kw = KW[1]; + r0 = Tinv0[t0 & 255] ^ Shift(Tinv0[(r3 >> 8) & 255], 24) ^ Shift(Tinv0[(t2 >> 16) & 255], 16) ^ Shift(Tinv0[(t1 >> 24) & 255], 8) ^ kw[0]; + r1 = Tinv0[t1 & 255] ^ Shift(Tinv0[(t0 >> 8) & 255], 24) ^ Shift(Tinv0[(r3 >> 16) & 255], 16) ^ Shift(Tinv0[(t2 >> 24) & 255], 8) ^ kw[1]; + r2 = Tinv0[t2 & 255] ^ Shift(Tinv0[(t1 >> 8) & 255], 24) ^ Shift(Tinv0[(t0 >> 16) & 255], 16) ^ Shift(Tinv0[(r3 >> 24) & 255], 8) ^ kw[2]; + r3 = Tinv0[r3 & 255] ^ Shift(Tinv0[(t2 >> 8) & 255], 24) ^ Shift(Tinv0[(t1 >> 16) & 255], 16) ^ Shift(Tinv0[(t0 >> 24) & 255], 8) ^ kw[3]; + + // the final round's table is a simple function of Si so we don't use a whole other four tables for it + + kw = KW[0]; + this.C0 = (uint)Si[r0 & 255] ^ (((uint)s[(r3 >> 8) & 255]) << 8) ^ (((uint)s[(r2 >> 16) & 255]) << 16) ^ (((uint)Si[(r1 >> 24) & 255]) << 24) ^ kw[0]; + this.C1 = (uint)s[r1 & 255] ^ (((uint)s[(r0 >> 8) & 255]) << 8) ^ (((uint)Si[(r3 >> 16) & 255]) << 16) ^ (((uint)s[(r2 >> 24) & 255]) << 24) ^ kw[1]; + this.C2 = (uint)s[r2 & 255] ^ (((uint)Si[(r1 >> 8) & 255]) << 8) ^ (((uint)Si[(r0 >> 16) & 255]) << 16) ^ (((uint)s[(r3 >> 24) & 255]) << 24) ^ kw[2]; + this.C3 = (uint)Si[r3 & 255] ^ (((uint)s[(r2 >> 8) & 255]) << 8) ^ (((uint)s[(r1 >> 16) & 255]) << 16) ^ (((uint)s[(r0 >> 24) & 255]) << 24) ^ kw[3]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesEngine.cs.meta new file mode 100644 index 00000000..1d6df923 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c62f38dc79ccd334b9e0b7c898f109cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesFastEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesFastEngine.cs new file mode 100644 index 00000000..cfc58eca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesFastEngine.cs @@ -0,0 +1,952 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * an implementation of the AES (Rijndael)), from FIPS-197. + *

+ * For further details see: http://csrc.nist.gov/encryption/aes/. + * + * This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at + * http://fp.gladman.plus.com/cryptography_technology/rijndael/ + * + * There are three levels of tradeoff of speed vs memory + * Because java has no preprocessor), they are written as three separate classes from which to choose + * + * The fastest uses 8Kbytes of static tables to precompute round calculations), 4 256 word tables for encryption + * and 4 for decryption. + * + * The middle performance version uses only one 256 word table for each), for a total of 2Kbytes), + * adding 12 rotate operations per round to compute the values contained in the other tables from + * the contents of the first + * + * The slowest version uses no static tables at all and computes the values in each round + *

+ *

+ * This file contains the fast version with 8Kbytes of static tables for round precomputation + *

+ */ + /// + /// Unfortunately this class has a few side channel issues. + /// In an environment where encryption/decryption may be closely observed it should not be used. + /// + [Obsolete("Use AesEngine instead")] + public class AesFastEngine + : IBlockCipher + { + // The S box + private static readonly byte[] S = + { + 99, 124, 119, 123, 242, 107, 111, 197, + 48, 1, 103, 43, 254, 215, 171, 118, + 202, 130, 201, 125, 250, 89, 71, 240, + 173, 212, 162, 175, 156, 164, 114, 192, + 183, 253, 147, 38, 54, 63, 247, 204, + 52, 165, 229, 241, 113, 216, 49, 21, + 4, 199, 35, 195, 24, 150, 5, 154, + 7, 18, 128, 226, 235, 39, 178, 117, + 9, 131, 44, 26, 27, 110, 90, 160, + 82, 59, 214, 179, 41, 227, 47, 132, + 83, 209, 0, 237, 32, 252, 177, 91, + 106, 203, 190, 57, 74, 76, 88, 207, + 208, 239, 170, 251, 67, 77, 51, 133, + 69, 249, 2, 127, 80, 60, 159, 168, + 81, 163, 64, 143, 146, 157, 56, 245, + 188, 182, 218, 33, 16, 255, 243, 210, + 205, 12, 19, 236, 95, 151, 68, 23, + 196, 167, 126, 61, 100, 93, 25, 115, + 96, 129, 79, 220, 34, 42, 144, 136, + 70, 238, 184, 20, 222, 94, 11, 219, + 224, 50, 58, 10, 73, 6, 36, 92, + 194, 211, 172, 98, 145, 149, 228, 121, + 231, 200, 55, 109, 141, 213, 78, 169, + 108, 86, 244, 234, 101, 122, 174, 8, + 186, 120, 37, 46, 28, 166, 180, 198, + 232, 221, 116, 31, 75, 189, 139, 138, + 112, 62, 181, 102, 72, 3, 246, 14, + 97, 53, 87, 185, 134, 193, 29, 158, + 225, 248, 152, 17, 105, 217, 142, 148, + 155, 30, 135, 233, 206, 85, 40, 223, + 140, 161, 137, 13, 191, 230, 66, 104, + 65, 153, 45, 15, 176, 84, 187, 22, + }; + + // The inverse S-box + private static readonly byte[] Si = + { + 82, 9, 106, 213, 48, 54, 165, 56, + 191, 64, 163, 158, 129, 243, 215, 251, + 124, 227, 57, 130, 155, 47, 255, 135, + 52, 142, 67, 68, 196, 222, 233, 203, + 84, 123, 148, 50, 166, 194, 35, 61, + 238, 76, 149, 11, 66, 250, 195, 78, + 8, 46, 161, 102, 40, 217, 36, 178, + 118, 91, 162, 73, 109, 139, 209, 37, + 114, 248, 246, 100, 134, 104, 152, 22, + 212, 164, 92, 204, 93, 101, 182, 146, + 108, 112, 72, 80, 253, 237, 185, 218, + 94, 21, 70, 87, 167, 141, 157, 132, + 144, 216, 171, 0, 140, 188, 211, 10, + 247, 228, 88, 5, 184, 179, 69, 6, + 208, 44, 30, 143, 202, 63, 15, 2, + 193, 175, 189, 3, 1, 19, 138, 107, + 58, 145, 17, 65, 79, 103, 220, 234, + 151, 242, 207, 206, 240, 180, 230, 115, + 150, 172, 116, 34, 231, 173, 53, 133, + 226, 249, 55, 232, 28, 117, 223, 110, + 71, 241, 26, 113, 29, 41, 197, 137, + 111, 183, 98, 14, 170, 24, 190, 27, + 252, 86, 62, 75, 198, 210, 121, 32, + 154, 219, 192, 254, 120, 205, 90, 244, + 31, 221, 168, 51, 136, 7, 199, 49, + 177, 18, 16, 89, 39, 128, 236, 95, + 96, 81, 127, 169, 25, 181, 74, 13, + 45, 229, 122, 159, 147, 201, 156, 239, + 160, 224, 59, 77, 174, 42, 245, 176, + 200, 235, 187, 60, 131, 83, 153, 97, + 23, 43, 4, 126, 186, 119, 214, 38, + 225, 105, 20, 99, 85, 33, 12, 125, + }; + + // vector used in calculating key schedule (powers of x in GF(256)) + private static readonly byte[] rcon = + { + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, + 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 + }; + + // precomputation tables of calculations for rounds + private static readonly uint[] T0 = + { + 0xa56363c6, 0x847c7cf8, 0x997777ee, 0x8d7b7bf6, 0x0df2f2ff, + 0xbd6b6bd6, 0xb16f6fde, 0x54c5c591, 0x50303060, 0x03010102, + 0xa96767ce, 0x7d2b2b56, 0x19fefee7, 0x62d7d7b5, 0xe6abab4d, + 0x9a7676ec, 0x45caca8f, 0x9d82821f, 0x40c9c989, 0x877d7dfa, + 0x15fafaef, 0xeb5959b2, 0xc947478e, 0x0bf0f0fb, 0xecadad41, + 0x67d4d4b3, 0xfda2a25f, 0xeaafaf45, 0xbf9c9c23, 0xf7a4a453, + 0x967272e4, 0x5bc0c09b, 0xc2b7b775, 0x1cfdfde1, 0xae93933d, + 0x6a26264c, 0x5a36366c, 0x413f3f7e, 0x02f7f7f5, 0x4fcccc83, + 0x5c343468, 0xf4a5a551, 0x34e5e5d1, 0x08f1f1f9, 0x937171e2, + 0x73d8d8ab, 0x53313162, 0x3f15152a, 0x0c040408, 0x52c7c795, + 0x65232346, 0x5ec3c39d, 0x28181830, 0xa1969637, 0x0f05050a, + 0xb59a9a2f, 0x0907070e, 0x36121224, 0x9b80801b, 0x3de2e2df, + 0x26ebebcd, 0x6927274e, 0xcdb2b27f, 0x9f7575ea, 0x1b090912, + 0x9e83831d, 0x742c2c58, 0x2e1a1a34, 0x2d1b1b36, 0xb26e6edc, + 0xee5a5ab4, 0xfba0a05b, 0xf65252a4, 0x4d3b3b76, 0x61d6d6b7, + 0xceb3b37d, 0x7b292952, 0x3ee3e3dd, 0x712f2f5e, 0x97848413, + 0xf55353a6, 0x68d1d1b9, 0x00000000, 0x2cededc1, 0x60202040, + 0x1ffcfce3, 0xc8b1b179, 0xed5b5bb6, 0xbe6a6ad4, 0x46cbcb8d, + 0xd9bebe67, 0x4b393972, 0xde4a4a94, 0xd44c4c98, 0xe85858b0, + 0x4acfcf85, 0x6bd0d0bb, 0x2aefefc5, 0xe5aaaa4f, 0x16fbfbed, + 0xc5434386, 0xd74d4d9a, 0x55333366, 0x94858511, 0xcf45458a, + 0x10f9f9e9, 0x06020204, 0x817f7ffe, 0xf05050a0, 0x443c3c78, + 0xba9f9f25, 0xe3a8a84b, 0xf35151a2, 0xfea3a35d, 0xc0404080, + 0x8a8f8f05, 0xad92923f, 0xbc9d9d21, 0x48383870, 0x04f5f5f1, + 0xdfbcbc63, 0xc1b6b677, 0x75dadaaf, 0x63212142, 0x30101020, + 0x1affffe5, 0x0ef3f3fd, 0x6dd2d2bf, 0x4ccdcd81, 0x140c0c18, + 0x35131326, 0x2fececc3, 0xe15f5fbe, 0xa2979735, 0xcc444488, + 0x3917172e, 0x57c4c493, 0xf2a7a755, 0x827e7efc, 0x473d3d7a, + 0xac6464c8, 0xe75d5dba, 0x2b191932, 0x957373e6, 0xa06060c0, + 0x98818119, 0xd14f4f9e, 0x7fdcdca3, 0x66222244, 0x7e2a2a54, + 0xab90903b, 0x8388880b, 0xca46468c, 0x29eeeec7, 0xd3b8b86b, + 0x3c141428, 0x79dedea7, 0xe25e5ebc, 0x1d0b0b16, 0x76dbdbad, + 0x3be0e0db, 0x56323264, 0x4e3a3a74, 0x1e0a0a14, 0xdb494992, + 0x0a06060c, 0x6c242448, 0xe45c5cb8, 0x5dc2c29f, 0x6ed3d3bd, + 0xefacac43, 0xa66262c4, 0xa8919139, 0xa4959531, 0x37e4e4d3, + 0x8b7979f2, 0x32e7e7d5, 0x43c8c88b, 0x5937376e, 0xb76d6dda, + 0x8c8d8d01, 0x64d5d5b1, 0xd24e4e9c, 0xe0a9a949, 0xb46c6cd8, + 0xfa5656ac, 0x07f4f4f3, 0x25eaeacf, 0xaf6565ca, 0x8e7a7af4, + 0xe9aeae47, 0x18080810, 0xd5baba6f, 0x887878f0, 0x6f25254a, + 0x722e2e5c, 0x241c1c38, 0xf1a6a657, 0xc7b4b473, 0x51c6c697, + 0x23e8e8cb, 0x7cdddda1, 0x9c7474e8, 0x211f1f3e, 0xdd4b4b96, + 0xdcbdbd61, 0x868b8b0d, 0x858a8a0f, 0x907070e0, 0x423e3e7c, + 0xc4b5b571, 0xaa6666cc, 0xd8484890, 0x05030306, 0x01f6f6f7, + 0x120e0e1c, 0xa36161c2, 0x5f35356a, 0xf95757ae, 0xd0b9b969, + 0x91868617, 0x58c1c199, 0x271d1d3a, 0xb99e9e27, 0x38e1e1d9, + 0x13f8f8eb, 0xb398982b, 0x33111122, 0xbb6969d2, 0x70d9d9a9, + 0x898e8e07, 0xa7949433, 0xb69b9b2d, 0x221e1e3c, 0x92878715, + 0x20e9e9c9, 0x49cece87, 0xff5555aa, 0x78282850, 0x7adfdfa5, + 0x8f8c8c03, 0xf8a1a159, 0x80898909, 0x170d0d1a, 0xdabfbf65, + 0x31e6e6d7, 0xc6424284, 0xb86868d0, 0xc3414182, 0xb0999929, + 0x772d2d5a, 0x110f0f1e, 0xcbb0b07b, 0xfc5454a8, 0xd6bbbb6d, + 0x3a16162c + }; + + private static readonly uint[] T1 = + { + 0x6363c6a5, 0x7c7cf884, 0x7777ee99, 0x7b7bf68d, 0xf2f2ff0d, + 0x6b6bd6bd, 0x6f6fdeb1, 0xc5c59154, 0x30306050, 0x01010203, + 0x6767cea9, 0x2b2b567d, 0xfefee719, 0xd7d7b562, 0xabab4de6, + 0x7676ec9a, 0xcaca8f45, 0x82821f9d, 0xc9c98940, 0x7d7dfa87, + 0xfafaef15, 0x5959b2eb, 0x47478ec9, 0xf0f0fb0b, 0xadad41ec, + 0xd4d4b367, 0xa2a25ffd, 0xafaf45ea, 0x9c9c23bf, 0xa4a453f7, + 0x7272e496, 0xc0c09b5b, 0xb7b775c2, 0xfdfde11c, 0x93933dae, + 0x26264c6a, 0x36366c5a, 0x3f3f7e41, 0xf7f7f502, 0xcccc834f, + 0x3434685c, 0xa5a551f4, 0xe5e5d134, 0xf1f1f908, 0x7171e293, + 0xd8d8ab73, 0x31316253, 0x15152a3f, 0x0404080c, 0xc7c79552, + 0x23234665, 0xc3c39d5e, 0x18183028, 0x969637a1, 0x05050a0f, + 0x9a9a2fb5, 0x07070e09, 0x12122436, 0x80801b9b, 0xe2e2df3d, + 0xebebcd26, 0x27274e69, 0xb2b27fcd, 0x7575ea9f, 0x0909121b, + 0x83831d9e, 0x2c2c5874, 0x1a1a342e, 0x1b1b362d, 0x6e6edcb2, + 0x5a5ab4ee, 0xa0a05bfb, 0x5252a4f6, 0x3b3b764d, 0xd6d6b761, + 0xb3b37dce, 0x2929527b, 0xe3e3dd3e, 0x2f2f5e71, 0x84841397, + 0x5353a6f5, 0xd1d1b968, 0x00000000, 0xededc12c, 0x20204060, + 0xfcfce31f, 0xb1b179c8, 0x5b5bb6ed, 0x6a6ad4be, 0xcbcb8d46, + 0xbebe67d9, 0x3939724b, 0x4a4a94de, 0x4c4c98d4, 0x5858b0e8, + 0xcfcf854a, 0xd0d0bb6b, 0xefefc52a, 0xaaaa4fe5, 0xfbfbed16, + 0x434386c5, 0x4d4d9ad7, 0x33336655, 0x85851194, 0x45458acf, + 0xf9f9e910, 0x02020406, 0x7f7ffe81, 0x5050a0f0, 0x3c3c7844, + 0x9f9f25ba, 0xa8a84be3, 0x5151a2f3, 0xa3a35dfe, 0x404080c0, + 0x8f8f058a, 0x92923fad, 0x9d9d21bc, 0x38387048, 0xf5f5f104, + 0xbcbc63df, 0xb6b677c1, 0xdadaaf75, 0x21214263, 0x10102030, + 0xffffe51a, 0xf3f3fd0e, 0xd2d2bf6d, 0xcdcd814c, 0x0c0c1814, + 0x13132635, 0xececc32f, 0x5f5fbee1, 0x979735a2, 0x444488cc, + 0x17172e39, 0xc4c49357, 0xa7a755f2, 0x7e7efc82, 0x3d3d7a47, + 0x6464c8ac, 0x5d5dbae7, 0x1919322b, 0x7373e695, 0x6060c0a0, + 0x81811998, 0x4f4f9ed1, 0xdcdca37f, 0x22224466, 0x2a2a547e, + 0x90903bab, 0x88880b83, 0x46468cca, 0xeeeec729, 0xb8b86bd3, + 0x1414283c, 0xdedea779, 0x5e5ebce2, 0x0b0b161d, 0xdbdbad76, + 0xe0e0db3b, 0x32326456, 0x3a3a744e, 0x0a0a141e, 0x494992db, + 0x06060c0a, 0x2424486c, 0x5c5cb8e4, 0xc2c29f5d, 0xd3d3bd6e, + 0xacac43ef, 0x6262c4a6, 0x919139a8, 0x959531a4, 0xe4e4d337, + 0x7979f28b, 0xe7e7d532, 0xc8c88b43, 0x37376e59, 0x6d6ddab7, + 0x8d8d018c, 0xd5d5b164, 0x4e4e9cd2, 0xa9a949e0, 0x6c6cd8b4, + 0x5656acfa, 0xf4f4f307, 0xeaeacf25, 0x6565caaf, 0x7a7af48e, + 0xaeae47e9, 0x08081018, 0xbaba6fd5, 0x7878f088, 0x25254a6f, + 0x2e2e5c72, 0x1c1c3824, 0xa6a657f1, 0xb4b473c7, 0xc6c69751, + 0xe8e8cb23, 0xdddda17c, 0x7474e89c, 0x1f1f3e21, 0x4b4b96dd, + 0xbdbd61dc, 0x8b8b0d86, 0x8a8a0f85, 0x7070e090, 0x3e3e7c42, + 0xb5b571c4, 0x6666ccaa, 0x484890d8, 0x03030605, 0xf6f6f701, + 0x0e0e1c12, 0x6161c2a3, 0x35356a5f, 0x5757aef9, 0xb9b969d0, + 0x86861791, 0xc1c19958, 0x1d1d3a27, 0x9e9e27b9, 0xe1e1d938, + 0xf8f8eb13, 0x98982bb3, 0x11112233, 0x6969d2bb, 0xd9d9a970, + 0x8e8e0789, 0x949433a7, 0x9b9b2db6, 0x1e1e3c22, 0x87871592, + 0xe9e9c920, 0xcece8749, 0x5555aaff, 0x28285078, 0xdfdfa57a, + 0x8c8c038f, 0xa1a159f8, 0x89890980, 0x0d0d1a17, 0xbfbf65da, + 0xe6e6d731, 0x424284c6, 0x6868d0b8, 0x414182c3, 0x999929b0, + 0x2d2d5a77, 0x0f0f1e11, 0xb0b07bcb, 0x5454a8fc, 0xbbbb6dd6, + 0x16162c3a + }; + + private static readonly uint[] T2 = + { + 0x63c6a563, 0x7cf8847c, 0x77ee9977, 0x7bf68d7b, 0xf2ff0df2, + 0x6bd6bd6b, 0x6fdeb16f, 0xc59154c5, 0x30605030, 0x01020301, + 0x67cea967, 0x2b567d2b, 0xfee719fe, 0xd7b562d7, 0xab4de6ab, + 0x76ec9a76, 0xca8f45ca, 0x821f9d82, 0xc98940c9, 0x7dfa877d, + 0xfaef15fa, 0x59b2eb59, 0x478ec947, 0xf0fb0bf0, 0xad41ecad, + 0xd4b367d4, 0xa25ffda2, 0xaf45eaaf, 0x9c23bf9c, 0xa453f7a4, + 0x72e49672, 0xc09b5bc0, 0xb775c2b7, 0xfde11cfd, 0x933dae93, + 0x264c6a26, 0x366c5a36, 0x3f7e413f, 0xf7f502f7, 0xcc834fcc, + 0x34685c34, 0xa551f4a5, 0xe5d134e5, 0xf1f908f1, 0x71e29371, + 0xd8ab73d8, 0x31625331, 0x152a3f15, 0x04080c04, 0xc79552c7, + 0x23466523, 0xc39d5ec3, 0x18302818, 0x9637a196, 0x050a0f05, + 0x9a2fb59a, 0x070e0907, 0x12243612, 0x801b9b80, 0xe2df3de2, + 0xebcd26eb, 0x274e6927, 0xb27fcdb2, 0x75ea9f75, 0x09121b09, + 0x831d9e83, 0x2c58742c, 0x1a342e1a, 0x1b362d1b, 0x6edcb26e, + 0x5ab4ee5a, 0xa05bfba0, 0x52a4f652, 0x3b764d3b, 0xd6b761d6, + 0xb37dceb3, 0x29527b29, 0xe3dd3ee3, 0x2f5e712f, 0x84139784, + 0x53a6f553, 0xd1b968d1, 0x00000000, 0xedc12ced, 0x20406020, + 0xfce31ffc, 0xb179c8b1, 0x5bb6ed5b, 0x6ad4be6a, 0xcb8d46cb, + 0xbe67d9be, 0x39724b39, 0x4a94de4a, 0x4c98d44c, 0x58b0e858, + 0xcf854acf, 0xd0bb6bd0, 0xefc52aef, 0xaa4fe5aa, 0xfbed16fb, + 0x4386c543, 0x4d9ad74d, 0x33665533, 0x85119485, 0x458acf45, + 0xf9e910f9, 0x02040602, 0x7ffe817f, 0x50a0f050, 0x3c78443c, + 0x9f25ba9f, 0xa84be3a8, 0x51a2f351, 0xa35dfea3, 0x4080c040, + 0x8f058a8f, 0x923fad92, 0x9d21bc9d, 0x38704838, 0xf5f104f5, + 0xbc63dfbc, 0xb677c1b6, 0xdaaf75da, 0x21426321, 0x10203010, + 0xffe51aff, 0xf3fd0ef3, 0xd2bf6dd2, 0xcd814ccd, 0x0c18140c, + 0x13263513, 0xecc32fec, 0x5fbee15f, 0x9735a297, 0x4488cc44, + 0x172e3917, 0xc49357c4, 0xa755f2a7, 0x7efc827e, 0x3d7a473d, + 0x64c8ac64, 0x5dbae75d, 0x19322b19, 0x73e69573, 0x60c0a060, + 0x81199881, 0x4f9ed14f, 0xdca37fdc, 0x22446622, 0x2a547e2a, + 0x903bab90, 0x880b8388, 0x468cca46, 0xeec729ee, 0xb86bd3b8, + 0x14283c14, 0xdea779de, 0x5ebce25e, 0x0b161d0b, 0xdbad76db, + 0xe0db3be0, 0x32645632, 0x3a744e3a, 0x0a141e0a, 0x4992db49, + 0x060c0a06, 0x24486c24, 0x5cb8e45c, 0xc29f5dc2, 0xd3bd6ed3, + 0xac43efac, 0x62c4a662, 0x9139a891, 0x9531a495, 0xe4d337e4, + 0x79f28b79, 0xe7d532e7, 0xc88b43c8, 0x376e5937, 0x6ddab76d, + 0x8d018c8d, 0xd5b164d5, 0x4e9cd24e, 0xa949e0a9, 0x6cd8b46c, + 0x56acfa56, 0xf4f307f4, 0xeacf25ea, 0x65caaf65, 0x7af48e7a, + 0xae47e9ae, 0x08101808, 0xba6fd5ba, 0x78f08878, 0x254a6f25, + 0x2e5c722e, 0x1c38241c, 0xa657f1a6, 0xb473c7b4, 0xc69751c6, + 0xe8cb23e8, 0xdda17cdd, 0x74e89c74, 0x1f3e211f, 0x4b96dd4b, + 0xbd61dcbd, 0x8b0d868b, 0x8a0f858a, 0x70e09070, 0x3e7c423e, + 0xb571c4b5, 0x66ccaa66, 0x4890d848, 0x03060503, 0xf6f701f6, + 0x0e1c120e, 0x61c2a361, 0x356a5f35, 0x57aef957, 0xb969d0b9, + 0x86179186, 0xc19958c1, 0x1d3a271d, 0x9e27b99e, 0xe1d938e1, + 0xf8eb13f8, 0x982bb398, 0x11223311, 0x69d2bb69, 0xd9a970d9, + 0x8e07898e, 0x9433a794, 0x9b2db69b, 0x1e3c221e, 0x87159287, + 0xe9c920e9, 0xce8749ce, 0x55aaff55, 0x28507828, 0xdfa57adf, + 0x8c038f8c, 0xa159f8a1, 0x89098089, 0x0d1a170d, 0xbf65dabf, + 0xe6d731e6, 0x4284c642, 0x68d0b868, 0x4182c341, 0x9929b099, + 0x2d5a772d, 0x0f1e110f, 0xb07bcbb0, 0x54a8fc54, 0xbb6dd6bb, + 0x162c3a16 + }; + + private static readonly uint[] T3 = + { + 0xc6a56363, 0xf8847c7c, 0xee997777, 0xf68d7b7b, 0xff0df2f2, + 0xd6bd6b6b, 0xdeb16f6f, 0x9154c5c5, 0x60503030, 0x02030101, + 0xcea96767, 0x567d2b2b, 0xe719fefe, 0xb562d7d7, 0x4de6abab, + 0xec9a7676, 0x8f45caca, 0x1f9d8282, 0x8940c9c9, 0xfa877d7d, + 0xef15fafa, 0xb2eb5959, 0x8ec94747, 0xfb0bf0f0, 0x41ecadad, + 0xb367d4d4, 0x5ffda2a2, 0x45eaafaf, 0x23bf9c9c, 0x53f7a4a4, + 0xe4967272, 0x9b5bc0c0, 0x75c2b7b7, 0xe11cfdfd, 0x3dae9393, + 0x4c6a2626, 0x6c5a3636, 0x7e413f3f, 0xf502f7f7, 0x834fcccc, + 0x685c3434, 0x51f4a5a5, 0xd134e5e5, 0xf908f1f1, 0xe2937171, + 0xab73d8d8, 0x62533131, 0x2a3f1515, 0x080c0404, 0x9552c7c7, + 0x46652323, 0x9d5ec3c3, 0x30281818, 0x37a19696, 0x0a0f0505, + 0x2fb59a9a, 0x0e090707, 0x24361212, 0x1b9b8080, 0xdf3de2e2, + 0xcd26ebeb, 0x4e692727, 0x7fcdb2b2, 0xea9f7575, 0x121b0909, + 0x1d9e8383, 0x58742c2c, 0x342e1a1a, 0x362d1b1b, 0xdcb26e6e, + 0xb4ee5a5a, 0x5bfba0a0, 0xa4f65252, 0x764d3b3b, 0xb761d6d6, + 0x7dceb3b3, 0x527b2929, 0xdd3ee3e3, 0x5e712f2f, 0x13978484, + 0xa6f55353, 0xb968d1d1, 0x00000000, 0xc12ceded, 0x40602020, + 0xe31ffcfc, 0x79c8b1b1, 0xb6ed5b5b, 0xd4be6a6a, 0x8d46cbcb, + 0x67d9bebe, 0x724b3939, 0x94de4a4a, 0x98d44c4c, 0xb0e85858, + 0x854acfcf, 0xbb6bd0d0, 0xc52aefef, 0x4fe5aaaa, 0xed16fbfb, + 0x86c54343, 0x9ad74d4d, 0x66553333, 0x11948585, 0x8acf4545, + 0xe910f9f9, 0x04060202, 0xfe817f7f, 0xa0f05050, 0x78443c3c, + 0x25ba9f9f, 0x4be3a8a8, 0xa2f35151, 0x5dfea3a3, 0x80c04040, + 0x058a8f8f, 0x3fad9292, 0x21bc9d9d, 0x70483838, 0xf104f5f5, + 0x63dfbcbc, 0x77c1b6b6, 0xaf75dada, 0x42632121, 0x20301010, + 0xe51affff, 0xfd0ef3f3, 0xbf6dd2d2, 0x814ccdcd, 0x18140c0c, + 0x26351313, 0xc32fecec, 0xbee15f5f, 0x35a29797, 0x88cc4444, + 0x2e391717, 0x9357c4c4, 0x55f2a7a7, 0xfc827e7e, 0x7a473d3d, + 0xc8ac6464, 0xbae75d5d, 0x322b1919, 0xe6957373, 0xc0a06060, + 0x19988181, 0x9ed14f4f, 0xa37fdcdc, 0x44662222, 0x547e2a2a, + 0x3bab9090, 0x0b838888, 0x8cca4646, 0xc729eeee, 0x6bd3b8b8, + 0x283c1414, 0xa779dede, 0xbce25e5e, 0x161d0b0b, 0xad76dbdb, + 0xdb3be0e0, 0x64563232, 0x744e3a3a, 0x141e0a0a, 0x92db4949, + 0x0c0a0606, 0x486c2424, 0xb8e45c5c, 0x9f5dc2c2, 0xbd6ed3d3, + 0x43efacac, 0xc4a66262, 0x39a89191, 0x31a49595, 0xd337e4e4, + 0xf28b7979, 0xd532e7e7, 0x8b43c8c8, 0x6e593737, 0xdab76d6d, + 0x018c8d8d, 0xb164d5d5, 0x9cd24e4e, 0x49e0a9a9, 0xd8b46c6c, + 0xacfa5656, 0xf307f4f4, 0xcf25eaea, 0xcaaf6565, 0xf48e7a7a, + 0x47e9aeae, 0x10180808, 0x6fd5baba, 0xf0887878, 0x4a6f2525, + 0x5c722e2e, 0x38241c1c, 0x57f1a6a6, 0x73c7b4b4, 0x9751c6c6, + 0xcb23e8e8, 0xa17cdddd, 0xe89c7474, 0x3e211f1f, 0x96dd4b4b, + 0x61dcbdbd, 0x0d868b8b, 0x0f858a8a, 0xe0907070, 0x7c423e3e, + 0x71c4b5b5, 0xccaa6666, 0x90d84848, 0x06050303, 0xf701f6f6, + 0x1c120e0e, 0xc2a36161, 0x6a5f3535, 0xaef95757, 0x69d0b9b9, + 0x17918686, 0x9958c1c1, 0x3a271d1d, 0x27b99e9e, 0xd938e1e1, + 0xeb13f8f8, 0x2bb39898, 0x22331111, 0xd2bb6969, 0xa970d9d9, + 0x07898e8e, 0x33a79494, 0x2db69b9b, 0x3c221e1e, 0x15928787, + 0xc920e9e9, 0x8749cece, 0xaaff5555, 0x50782828, 0xa57adfdf, + 0x038f8c8c, 0x59f8a1a1, 0x09808989, 0x1a170d0d, 0x65dabfbf, + 0xd731e6e6, 0x84c64242, 0xd0b86868, 0x82c34141, 0x29b09999, + 0x5a772d2d, 0x1e110f0f, 0x7bcbb0b0, 0xa8fc5454, 0x6dd6bbbb, + 0x2c3a1616 + }; + + private static readonly uint[] Tinv0 = + { + 0x50a7f451, 0x5365417e, 0xc3a4171a, 0x965e273a, 0xcb6bab3b, + 0xf1459d1f, 0xab58faac, 0x9303e34b, 0x55fa3020, 0xf66d76ad, + 0x9176cc88, 0x254c02f5, 0xfcd7e54f, 0xd7cb2ac5, 0x80443526, + 0x8fa362b5, 0x495ab1de, 0x671bba25, 0x980eea45, 0xe1c0fe5d, + 0x02752fc3, 0x12f04c81, 0xa397468d, 0xc6f9d36b, 0xe75f8f03, + 0x959c9215, 0xeb7a6dbf, 0xda595295, 0x2d83bed4, 0xd3217458, + 0x2969e049, 0x44c8c98e, 0x6a89c275, 0x78798ef4, 0x6b3e5899, + 0xdd71b927, 0xb64fe1be, 0x17ad88f0, 0x66ac20c9, 0xb43ace7d, + 0x184adf63, 0x82311ae5, 0x60335197, 0x457f5362, 0xe07764b1, + 0x84ae6bbb, 0x1ca081fe, 0x942b08f9, 0x58684870, 0x19fd458f, + 0x876cde94, 0xb7f87b52, 0x23d373ab, 0xe2024b72, 0x578f1fe3, + 0x2aab5566, 0x0728ebb2, 0x03c2b52f, 0x9a7bc586, 0xa50837d3, + 0xf2872830, 0xb2a5bf23, 0xba6a0302, 0x5c8216ed, 0x2b1ccf8a, + 0x92b479a7, 0xf0f207f3, 0xa1e2694e, 0xcdf4da65, 0xd5be0506, + 0x1f6234d1, 0x8afea6c4, 0x9d532e34, 0xa055f3a2, 0x32e18a05, + 0x75ebf6a4, 0x39ec830b, 0xaaef6040, 0x069f715e, 0x51106ebd, + 0xf98a213e, 0x3d06dd96, 0xae053edd, 0x46bde64d, 0xb58d5491, + 0x055dc471, 0x6fd40604, 0xff155060, 0x24fb9819, 0x97e9bdd6, + 0xcc434089, 0x779ed967, 0xbd42e8b0, 0x888b8907, 0x385b19e7, + 0xdbeec879, 0x470a7ca1, 0xe90f427c, 0xc91e84f8, 0x00000000, + 0x83868009, 0x48ed2b32, 0xac70111e, 0x4e725a6c, 0xfbff0efd, + 0x5638850f, 0x1ed5ae3d, 0x27392d36, 0x64d90f0a, 0x21a65c68, + 0xd1545b9b, 0x3a2e3624, 0xb1670a0c, 0x0fe75793, 0xd296eeb4, + 0x9e919b1b, 0x4fc5c080, 0xa220dc61, 0x694b775a, 0x161a121c, + 0x0aba93e2, 0xe52aa0c0, 0x43e0223c, 0x1d171b12, 0x0b0d090e, + 0xadc78bf2, 0xb9a8b62d, 0xc8a91e14, 0x8519f157, 0x4c0775af, + 0xbbdd99ee, 0xfd607fa3, 0x9f2601f7, 0xbcf5725c, 0xc53b6644, + 0x347efb5b, 0x7629438b, 0xdcc623cb, 0x68fcedb6, 0x63f1e4b8, + 0xcadc31d7, 0x10856342, 0x40229713, 0x2011c684, 0x7d244a85, + 0xf83dbbd2, 0x1132f9ae, 0x6da129c7, 0x4b2f9e1d, 0xf330b2dc, + 0xec52860d, 0xd0e3c177, 0x6c16b32b, 0x99b970a9, 0xfa489411, + 0x2264e947, 0xc48cfca8, 0x1a3ff0a0, 0xd82c7d56, 0xef903322, + 0xc74e4987, 0xc1d138d9, 0xfea2ca8c, 0x360bd498, 0xcf81f5a6, + 0x28de7aa5, 0x268eb7da, 0xa4bfad3f, 0xe49d3a2c, 0x0d927850, + 0x9bcc5f6a, 0x62467e54, 0xc2138df6, 0xe8b8d890, 0x5ef7392e, + 0xf5afc382, 0xbe805d9f, 0x7c93d069, 0xa92dd56f, 0xb31225cf, + 0x3b99acc8, 0xa77d1810, 0x6e639ce8, 0x7bbb3bdb, 0x097826cd, + 0xf418596e, 0x01b79aec, 0xa89a4f83, 0x656e95e6, 0x7ee6ffaa, + 0x08cfbc21, 0xe6e815ef, 0xd99be7ba, 0xce366f4a, 0xd4099fea, + 0xd67cb029, 0xafb2a431, 0x31233f2a, 0x3094a5c6, 0xc066a235, + 0x37bc4e74, 0xa6ca82fc, 0xb0d090e0, 0x15d8a733, 0x4a9804f1, + 0xf7daec41, 0x0e50cd7f, 0x2ff69117, 0x8dd64d76, 0x4db0ef43, + 0x544daacc, 0xdf0496e4, 0xe3b5d19e, 0x1b886a4c, 0xb81f2cc1, + 0x7f516546, 0x04ea5e9d, 0x5d358c01, 0x737487fa, 0x2e410bfb, + 0x5a1d67b3, 0x52d2db92, 0x335610e9, 0x1347d66d, 0x8c61d79a, + 0x7a0ca137, 0x8e14f859, 0x893c13eb, 0xee27a9ce, 0x35c961b7, + 0xede51ce1, 0x3cb1477a, 0x59dfd29c, 0x3f73f255, 0x79ce1418, + 0xbf37c773, 0xeacdf753, 0x5baafd5f, 0x146f3ddf, 0x86db4478, + 0x81f3afca, 0x3ec468b9, 0x2c342438, 0x5f40a3c2, 0x72c31d16, + 0x0c25e2bc, 0x8b493c28, 0x41950dff, 0x7101a839, 0xdeb30c08, + 0x9ce4b4d8, 0x90c15664, 0x6184cb7b, 0x70b632d5, 0x745c6c48, + 0x4257b8d0 + }; + + private static readonly uint[] Tinv1 = + { + 0xa7f45150, 0x65417e53, 0xa4171ac3, 0x5e273a96, 0x6bab3bcb, + 0x459d1ff1, 0x58faacab, 0x03e34b93, 0xfa302055, 0x6d76adf6, + 0x76cc8891, 0x4c02f525, 0xd7e54ffc, 0xcb2ac5d7, 0x44352680, + 0xa362b58f, 0x5ab1de49, 0x1bba2567, 0x0eea4598, 0xc0fe5de1, + 0x752fc302, 0xf04c8112, 0x97468da3, 0xf9d36bc6, 0x5f8f03e7, + 0x9c921595, 0x7a6dbfeb, 0x595295da, 0x83bed42d, 0x217458d3, + 0x69e04929, 0xc8c98e44, 0x89c2756a, 0x798ef478, 0x3e58996b, + 0x71b927dd, 0x4fe1beb6, 0xad88f017, 0xac20c966, 0x3ace7db4, + 0x4adf6318, 0x311ae582, 0x33519760, 0x7f536245, 0x7764b1e0, + 0xae6bbb84, 0xa081fe1c, 0x2b08f994, 0x68487058, 0xfd458f19, + 0x6cde9487, 0xf87b52b7, 0xd373ab23, 0x024b72e2, 0x8f1fe357, + 0xab55662a, 0x28ebb207, 0xc2b52f03, 0x7bc5869a, 0x0837d3a5, + 0x872830f2, 0xa5bf23b2, 0x6a0302ba, 0x8216ed5c, 0x1ccf8a2b, + 0xb479a792, 0xf207f3f0, 0xe2694ea1, 0xf4da65cd, 0xbe0506d5, + 0x6234d11f, 0xfea6c48a, 0x532e349d, 0x55f3a2a0, 0xe18a0532, + 0xebf6a475, 0xec830b39, 0xef6040aa, 0x9f715e06, 0x106ebd51, + 0x8a213ef9, 0x06dd963d, 0x053eddae, 0xbde64d46, 0x8d5491b5, + 0x5dc47105, 0xd406046f, 0x155060ff, 0xfb981924, 0xe9bdd697, + 0x434089cc, 0x9ed96777, 0x42e8b0bd, 0x8b890788, 0x5b19e738, + 0xeec879db, 0x0a7ca147, 0x0f427ce9, 0x1e84f8c9, 0x00000000, + 0x86800983, 0xed2b3248, 0x70111eac, 0x725a6c4e, 0xff0efdfb, + 0x38850f56, 0xd5ae3d1e, 0x392d3627, 0xd90f0a64, 0xa65c6821, + 0x545b9bd1, 0x2e36243a, 0x670a0cb1, 0xe757930f, 0x96eeb4d2, + 0x919b1b9e, 0xc5c0804f, 0x20dc61a2, 0x4b775a69, 0x1a121c16, + 0xba93e20a, 0x2aa0c0e5, 0xe0223c43, 0x171b121d, 0x0d090e0b, + 0xc78bf2ad, 0xa8b62db9, 0xa91e14c8, 0x19f15785, 0x0775af4c, + 0xdd99eebb, 0x607fa3fd, 0x2601f79f, 0xf5725cbc, 0x3b6644c5, + 0x7efb5b34, 0x29438b76, 0xc623cbdc, 0xfcedb668, 0xf1e4b863, + 0xdc31d7ca, 0x85634210, 0x22971340, 0x11c68420, 0x244a857d, + 0x3dbbd2f8, 0x32f9ae11, 0xa129c76d, 0x2f9e1d4b, 0x30b2dcf3, + 0x52860dec, 0xe3c177d0, 0x16b32b6c, 0xb970a999, 0x489411fa, + 0x64e94722, 0x8cfca8c4, 0x3ff0a01a, 0x2c7d56d8, 0x903322ef, + 0x4e4987c7, 0xd138d9c1, 0xa2ca8cfe, 0x0bd49836, 0x81f5a6cf, + 0xde7aa528, 0x8eb7da26, 0xbfad3fa4, 0x9d3a2ce4, 0x9278500d, + 0xcc5f6a9b, 0x467e5462, 0x138df6c2, 0xb8d890e8, 0xf7392e5e, + 0xafc382f5, 0x805d9fbe, 0x93d0697c, 0x2dd56fa9, 0x1225cfb3, + 0x99acc83b, 0x7d1810a7, 0x639ce86e, 0xbb3bdb7b, 0x7826cd09, + 0x18596ef4, 0xb79aec01, 0x9a4f83a8, 0x6e95e665, 0xe6ffaa7e, + 0xcfbc2108, 0xe815efe6, 0x9be7bad9, 0x366f4ace, 0x099fead4, + 0x7cb029d6, 0xb2a431af, 0x233f2a31, 0x94a5c630, 0x66a235c0, + 0xbc4e7437, 0xca82fca6, 0xd090e0b0, 0xd8a73315, 0x9804f14a, + 0xdaec41f7, 0x50cd7f0e, 0xf691172f, 0xd64d768d, 0xb0ef434d, + 0x4daacc54, 0x0496e4df, 0xb5d19ee3, 0x886a4c1b, 0x1f2cc1b8, + 0x5165467f, 0xea5e9d04, 0x358c015d, 0x7487fa73, 0x410bfb2e, + 0x1d67b35a, 0xd2db9252, 0x5610e933, 0x47d66d13, 0x61d79a8c, + 0x0ca1377a, 0x14f8598e, 0x3c13eb89, 0x27a9ceee, 0xc961b735, + 0xe51ce1ed, 0xb1477a3c, 0xdfd29c59, 0x73f2553f, 0xce141879, + 0x37c773bf, 0xcdf753ea, 0xaafd5f5b, 0x6f3ddf14, 0xdb447886, + 0xf3afca81, 0xc468b93e, 0x3424382c, 0x40a3c25f, 0xc31d1672, + 0x25e2bc0c, 0x493c288b, 0x950dff41, 0x01a83971, 0xb30c08de, + 0xe4b4d89c, 0xc1566490, 0x84cb7b61, 0xb632d570, 0x5c6c4874, + 0x57b8d042 + }; + + private static readonly uint[] Tinv2 = + { + 0xf45150a7, 0x417e5365, 0x171ac3a4, 0x273a965e, 0xab3bcb6b, + 0x9d1ff145, 0xfaacab58, 0xe34b9303, 0x302055fa, 0x76adf66d, + 0xcc889176, 0x02f5254c, 0xe54ffcd7, 0x2ac5d7cb, 0x35268044, + 0x62b58fa3, 0xb1de495a, 0xba25671b, 0xea45980e, 0xfe5de1c0, + 0x2fc30275, 0x4c8112f0, 0x468da397, 0xd36bc6f9, 0x8f03e75f, + 0x9215959c, 0x6dbfeb7a, 0x5295da59, 0xbed42d83, 0x7458d321, + 0xe0492969, 0xc98e44c8, 0xc2756a89, 0x8ef47879, 0x58996b3e, + 0xb927dd71, 0xe1beb64f, 0x88f017ad, 0x20c966ac, 0xce7db43a, + 0xdf63184a, 0x1ae58231, 0x51976033, 0x5362457f, 0x64b1e077, + 0x6bbb84ae, 0x81fe1ca0, 0x08f9942b, 0x48705868, 0x458f19fd, + 0xde94876c, 0x7b52b7f8, 0x73ab23d3, 0x4b72e202, 0x1fe3578f, + 0x55662aab, 0xebb20728, 0xb52f03c2, 0xc5869a7b, 0x37d3a508, + 0x2830f287, 0xbf23b2a5, 0x0302ba6a, 0x16ed5c82, 0xcf8a2b1c, + 0x79a792b4, 0x07f3f0f2, 0x694ea1e2, 0xda65cdf4, 0x0506d5be, + 0x34d11f62, 0xa6c48afe, 0x2e349d53, 0xf3a2a055, 0x8a0532e1, + 0xf6a475eb, 0x830b39ec, 0x6040aaef, 0x715e069f, 0x6ebd5110, + 0x213ef98a, 0xdd963d06, 0x3eddae05, 0xe64d46bd, 0x5491b58d, + 0xc471055d, 0x06046fd4, 0x5060ff15, 0x981924fb, 0xbdd697e9, + 0x4089cc43, 0xd967779e, 0xe8b0bd42, 0x8907888b, 0x19e7385b, + 0xc879dbee, 0x7ca1470a, 0x427ce90f, 0x84f8c91e, 0x00000000, + 0x80098386, 0x2b3248ed, 0x111eac70, 0x5a6c4e72, 0x0efdfbff, + 0x850f5638, 0xae3d1ed5, 0x2d362739, 0x0f0a64d9, 0x5c6821a6, + 0x5b9bd154, 0x36243a2e, 0x0a0cb167, 0x57930fe7, 0xeeb4d296, + 0x9b1b9e91, 0xc0804fc5, 0xdc61a220, 0x775a694b, 0x121c161a, + 0x93e20aba, 0xa0c0e52a, 0x223c43e0, 0x1b121d17, 0x090e0b0d, + 0x8bf2adc7, 0xb62db9a8, 0x1e14c8a9, 0xf1578519, 0x75af4c07, + 0x99eebbdd, 0x7fa3fd60, 0x01f79f26, 0x725cbcf5, 0x6644c53b, + 0xfb5b347e, 0x438b7629, 0x23cbdcc6, 0xedb668fc, 0xe4b863f1, + 0x31d7cadc, 0x63421085, 0x97134022, 0xc6842011, 0x4a857d24, + 0xbbd2f83d, 0xf9ae1132, 0x29c76da1, 0x9e1d4b2f, 0xb2dcf330, + 0x860dec52, 0xc177d0e3, 0xb32b6c16, 0x70a999b9, 0x9411fa48, + 0xe9472264, 0xfca8c48c, 0xf0a01a3f, 0x7d56d82c, 0x3322ef90, + 0x4987c74e, 0x38d9c1d1, 0xca8cfea2, 0xd498360b, 0xf5a6cf81, + 0x7aa528de, 0xb7da268e, 0xad3fa4bf, 0x3a2ce49d, 0x78500d92, + 0x5f6a9bcc, 0x7e546246, 0x8df6c213, 0xd890e8b8, 0x392e5ef7, + 0xc382f5af, 0x5d9fbe80, 0xd0697c93, 0xd56fa92d, 0x25cfb312, + 0xacc83b99, 0x1810a77d, 0x9ce86e63, 0x3bdb7bbb, 0x26cd0978, + 0x596ef418, 0x9aec01b7, 0x4f83a89a, 0x95e6656e, 0xffaa7ee6, + 0xbc2108cf, 0x15efe6e8, 0xe7bad99b, 0x6f4ace36, 0x9fead409, + 0xb029d67c, 0xa431afb2, 0x3f2a3123, 0xa5c63094, 0xa235c066, + 0x4e7437bc, 0x82fca6ca, 0x90e0b0d0, 0xa73315d8, 0x04f14a98, + 0xec41f7da, 0xcd7f0e50, 0x91172ff6, 0x4d768dd6, 0xef434db0, + 0xaacc544d, 0x96e4df04, 0xd19ee3b5, 0x6a4c1b88, 0x2cc1b81f, + 0x65467f51, 0x5e9d04ea, 0x8c015d35, 0x87fa7374, 0x0bfb2e41, + 0x67b35a1d, 0xdb9252d2, 0x10e93356, 0xd66d1347, 0xd79a8c61, + 0xa1377a0c, 0xf8598e14, 0x13eb893c, 0xa9ceee27, 0x61b735c9, + 0x1ce1ede5, 0x477a3cb1, 0xd29c59df, 0xf2553f73, 0x141879ce, + 0xc773bf37, 0xf753eacd, 0xfd5f5baa, 0x3ddf146f, 0x447886db, + 0xafca81f3, 0x68b93ec4, 0x24382c34, 0xa3c25f40, 0x1d1672c3, + 0xe2bc0c25, 0x3c288b49, 0x0dff4195, 0xa8397101, 0x0c08deb3, + 0xb4d89ce4, 0x566490c1, 0xcb7b6184, 0x32d570b6, 0x6c48745c, + 0xb8d04257 + }; + + private static readonly uint[] Tinv3 = + { + 0x5150a7f4, 0x7e536541, 0x1ac3a417, 0x3a965e27, 0x3bcb6bab, + 0x1ff1459d, 0xacab58fa, 0x4b9303e3, 0x2055fa30, 0xadf66d76, + 0x889176cc, 0xf5254c02, 0x4ffcd7e5, 0xc5d7cb2a, 0x26804435, + 0xb58fa362, 0xde495ab1, 0x25671bba, 0x45980eea, 0x5de1c0fe, + 0xc302752f, 0x8112f04c, 0x8da39746, 0x6bc6f9d3, 0x03e75f8f, + 0x15959c92, 0xbfeb7a6d, 0x95da5952, 0xd42d83be, 0x58d32174, + 0x492969e0, 0x8e44c8c9, 0x756a89c2, 0xf478798e, 0x996b3e58, + 0x27dd71b9, 0xbeb64fe1, 0xf017ad88, 0xc966ac20, 0x7db43ace, + 0x63184adf, 0xe582311a, 0x97603351, 0x62457f53, 0xb1e07764, + 0xbb84ae6b, 0xfe1ca081, 0xf9942b08, 0x70586848, 0x8f19fd45, + 0x94876cde, 0x52b7f87b, 0xab23d373, 0x72e2024b, 0xe3578f1f, + 0x662aab55, 0xb20728eb, 0x2f03c2b5, 0x869a7bc5, 0xd3a50837, + 0x30f28728, 0x23b2a5bf, 0x02ba6a03, 0xed5c8216, 0x8a2b1ccf, + 0xa792b479, 0xf3f0f207, 0x4ea1e269, 0x65cdf4da, 0x06d5be05, + 0xd11f6234, 0xc48afea6, 0x349d532e, 0xa2a055f3, 0x0532e18a, + 0xa475ebf6, 0x0b39ec83, 0x40aaef60, 0x5e069f71, 0xbd51106e, + 0x3ef98a21, 0x963d06dd, 0xddae053e, 0x4d46bde6, 0x91b58d54, + 0x71055dc4, 0x046fd406, 0x60ff1550, 0x1924fb98, 0xd697e9bd, + 0x89cc4340, 0x67779ed9, 0xb0bd42e8, 0x07888b89, 0xe7385b19, + 0x79dbeec8, 0xa1470a7c, 0x7ce90f42, 0xf8c91e84, 0x00000000, + 0x09838680, 0x3248ed2b, 0x1eac7011, 0x6c4e725a, 0xfdfbff0e, + 0x0f563885, 0x3d1ed5ae, 0x3627392d, 0x0a64d90f, 0x6821a65c, + 0x9bd1545b, 0x243a2e36, 0x0cb1670a, 0x930fe757, 0xb4d296ee, + 0x1b9e919b, 0x804fc5c0, 0x61a220dc, 0x5a694b77, 0x1c161a12, + 0xe20aba93, 0xc0e52aa0, 0x3c43e022, 0x121d171b, 0x0e0b0d09, + 0xf2adc78b, 0x2db9a8b6, 0x14c8a91e, 0x578519f1, 0xaf4c0775, + 0xeebbdd99, 0xa3fd607f, 0xf79f2601, 0x5cbcf572, 0x44c53b66, + 0x5b347efb, 0x8b762943, 0xcbdcc623, 0xb668fced, 0xb863f1e4, + 0xd7cadc31, 0x42108563, 0x13402297, 0x842011c6, 0x857d244a, + 0xd2f83dbb, 0xae1132f9, 0xc76da129, 0x1d4b2f9e, 0xdcf330b2, + 0x0dec5286, 0x77d0e3c1, 0x2b6c16b3, 0xa999b970, 0x11fa4894, + 0x472264e9, 0xa8c48cfc, 0xa01a3ff0, 0x56d82c7d, 0x22ef9033, + 0x87c74e49, 0xd9c1d138, 0x8cfea2ca, 0x98360bd4, 0xa6cf81f5, + 0xa528de7a, 0xda268eb7, 0x3fa4bfad, 0x2ce49d3a, 0x500d9278, + 0x6a9bcc5f, 0x5462467e, 0xf6c2138d, 0x90e8b8d8, 0x2e5ef739, + 0x82f5afc3, 0x9fbe805d, 0x697c93d0, 0x6fa92dd5, 0xcfb31225, + 0xc83b99ac, 0x10a77d18, 0xe86e639c, 0xdb7bbb3b, 0xcd097826, + 0x6ef41859, 0xec01b79a, 0x83a89a4f, 0xe6656e95, 0xaa7ee6ff, + 0x2108cfbc, 0xefe6e815, 0xbad99be7, 0x4ace366f, 0xead4099f, + 0x29d67cb0, 0x31afb2a4, 0x2a31233f, 0xc63094a5, 0x35c066a2, + 0x7437bc4e, 0xfca6ca82, 0xe0b0d090, 0x3315d8a7, 0xf14a9804, + 0x41f7daec, 0x7f0e50cd, 0x172ff691, 0x768dd64d, 0x434db0ef, + 0xcc544daa, 0xe4df0496, 0x9ee3b5d1, 0x4c1b886a, 0xc1b81f2c, + 0x467f5165, 0x9d04ea5e, 0x015d358c, 0xfa737487, 0xfb2e410b, + 0xb35a1d67, 0x9252d2db, 0xe9335610, 0x6d1347d6, 0x9a8c61d7, + 0x377a0ca1, 0x598e14f8, 0xeb893c13, 0xceee27a9, 0xb735c961, + 0xe1ede51c, 0x7a3cb147, 0x9c59dfd2, 0x553f73f2, 0x1879ce14, + 0x73bf37c7, 0x53eacdf7, 0x5f5baafd, 0xdf146f3d, 0x7886db44, + 0xca81f3af, 0xb93ec468, 0x382c3424, 0xc25f40a3, 0x1672c31d, + 0xbc0c25e2, 0x288b493c, 0xff41950d, 0x397101a8, 0x08deb30c, + 0xd89ce4b4, 0x6490c156, 0x7b6184cb, 0xd570b632, 0x48745c6c, + 0xd04257b8 + }; + + private static uint Shift(uint r, int shift) + { + return (r >> shift) | (r << (32 - shift)); + } + + /* multiply four bytes in GF(2^8) by 'x' {02} in parallel */ + + private const uint m1 = 0x80808080; + private const uint m2 = 0x7f7f7f7f; + private const uint m3 = 0x0000001b; + private const uint m4 = 0xC0C0C0C0; + private const uint m5 = 0x3f3f3f3f; + + private static uint FFmulX(uint x) + { + return ((x & m2) << 1) ^ (((x & m1) >> 7) * m3); + } + + private static uint FFmulX2(uint x) + { + uint t0 = (x & m5) << 2; + uint t1 = (x & m4); + t1 ^= (t1 >> 1); + return t0 ^ (t1 >> 2) ^ (t1 >> 5); + } + + /* + The following defines provide alternative definitions of FFmulX that might + give improved performance if a fast 32-bit multiply is not available. + + private int FFmulX(int x) { int u = x & m1; u |= (u >> 1); return ((x & m2) << 1) ^ ((u >>> 3) | (u >>> 6)); } + private static final int m4 = 0x1b1b1b1b; + private int FFmulX(int x) { int u = x & m1; return ((x & m2) << 1) ^ ((u - (u >>> 7)) & m4); } + + */ + + private static uint Inv_Mcol(uint x) + { + uint t0, t1; + t0 = x; + t1 = t0 ^ Shift(t0, 8); + t0 ^= FFmulX(t1); + t1 ^= FFmulX2(t0); + t0 ^= t1 ^ Shift(t1, 16); + return t0; + } + + private static uint SubWord(uint x) + { + return (uint)S[x&255] + | (((uint)S[(x>>8)&255]) << 8) + | (((uint)S[(x>>16)&255]) << 16) + | (((uint)S[(x>>24)&255]) << 24); + } + + /** + * Calculate the necessary round keys + * The number of calculations depends on key size and block size + * AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits + * This code is written assuming those are the only possible values + */ + private uint[][] GenerateWorkingKey(byte[] key, bool forEncryption) + { + int keyLen = key.Length; + if (keyLen < 16 || keyLen > 32 || (keyLen & 7) != 0) + throw new ArgumentException("Key length not 128/192/256 bits."); + + int KC = keyLen >> 2; + this.ROUNDS = KC + 6; // This is not always true for the generalized Rijndael that allows larger block sizes + + uint[][] W = new uint[ROUNDS + 1][]; // 4 words in a block + for (int i = 0; i <= ROUNDS; ++i) + { + W[i] = new uint[4]; + } + + switch (KC) + { + case 4: + { + uint t0 = Pack.LE_To_UInt32(key, 0); W[0][0] = t0; + uint t1 = Pack.LE_To_UInt32(key, 4); W[0][1] = t1; + uint t2 = Pack.LE_To_UInt32(key, 8); W[0][2] = t2; + uint t3 = Pack.LE_To_UInt32(key, 12); W[0][3] = t3; + + for (int i = 1; i <= 10; ++i) + { + uint u = SubWord(Shift(t3, 8)) ^ rcon[i - 1]; + t0 ^= u; W[i][0] = t0; + t1 ^= t0; W[i][1] = t1; + t2 ^= t1; W[i][2] = t2; + t3 ^= t2; W[i][3] = t3; + } + + break; + } + case 6: + { + uint t0 = Pack.LE_To_UInt32(key, 0); W[0][0] = t0; + uint t1 = Pack.LE_To_UInt32(key, 4); W[0][1] = t1; + uint t2 = Pack.LE_To_UInt32(key, 8); W[0][2] = t2; + uint t3 = Pack.LE_To_UInt32(key, 12); W[0][3] = t3; + uint t4 = Pack.LE_To_UInt32(key, 16); W[1][0] = t4; + uint t5 = Pack.LE_To_UInt32(key, 20); W[1][1] = t5; + + uint rcon = 1; + uint u = SubWord(Shift(t5, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[1][2] = t0; + t1 ^= t0; W[1][3] = t1; + t2 ^= t1; W[2][0] = t2; + t3 ^= t2; W[2][1] = t3; + t4 ^= t3; W[2][2] = t4; + t5 ^= t4; W[2][3] = t5; + + for (int i = 3; i < 12; i += 3) + { + u = SubWord(Shift(t5, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[i ][0] = t0; + t1 ^= t0; W[i ][1] = t1; + t2 ^= t1; W[i ][2] = t2; + t3 ^= t2; W[i ][3] = t3; + t4 ^= t3; W[i + 1][0] = t4; + t5 ^= t4; W[i + 1][1] = t5; + u = SubWord(Shift(t5, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[i + 1][2] = t0; + t1 ^= t0; W[i + 1][3] = t1; + t2 ^= t1; W[i + 2][0] = t2; + t3 ^= t2; W[i + 2][1] = t3; + t4 ^= t3; W[i + 2][2] = t4; + t5 ^= t4; W[i + 2][3] = t5; + } + + u = SubWord(Shift(t5, 8)) ^ rcon; + t0 ^= u; W[12][0] = t0; + t1 ^= t0; W[12][1] = t1; + t2 ^= t1; W[12][2] = t2; + t3 ^= t2; W[12][3] = t3; + + break; + } + case 8: + { + uint t0 = Pack.LE_To_UInt32(key, 0); W[0][0] = t0; + uint t1 = Pack.LE_To_UInt32(key, 4); W[0][1] = t1; + uint t2 = Pack.LE_To_UInt32(key, 8); W[0][2] = t2; + uint t3 = Pack.LE_To_UInt32(key, 12); W[0][3] = t3; + uint t4 = Pack.LE_To_UInt32(key, 16); W[1][0] = t4; + uint t5 = Pack.LE_To_UInt32(key, 20); W[1][1] = t5; + uint t6 = Pack.LE_To_UInt32(key, 24); W[1][2] = t6; + uint t7 = Pack.LE_To_UInt32(key, 28); W[1][3] = t7; + + uint u, rcon = 1; + + for (int i = 2; i < 14; i += 2) + { + u = SubWord(Shift(t7, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[i ][0] = t0; + t1 ^= t0; W[i ][1] = t1; + t2 ^= t1; W[i ][2] = t2; + t3 ^= t2; W[i ][3] = t3; + u = SubWord(t3); + t4 ^= u; W[i + 1][0] = t4; + t5 ^= t4; W[i + 1][1] = t5; + t6 ^= t5; W[i + 1][2] = t6; + t7 ^= t6; W[i + 1][3] = t7; + } + + u = SubWord(Shift(t7, 8)) ^ rcon; + t0 ^= u; W[14][0] = t0; + t1 ^= t0; W[14][1] = t1; + t2 ^= t1; W[14][2] = t2; + t3 ^= t2; W[14][3] = t3; + + break; + } + default: + { + throw new InvalidOperationException("Should never get here"); + } + } + + if (!forEncryption) + { + for (int j = 1; j < ROUNDS; j++) + { + uint[] w = W[j]; + for (int i = 0; i < 4; i++) + { + w[i] = Inv_Mcol(w[i]); + } + } + } + + return W; + } + + private int ROUNDS; + private uint[][] WorkingKey; + private uint C0, C1, C2, C3; + private bool forEncryption; + + private const int BLOCK_SIZE = 16; + + /** + * default constructor - 128 bit block size. + */ + public AesFastEngine() + { + } + + /** + * initialise an AES cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + KeyParameter keyParameter = parameters as KeyParameter; + + if (keyParameter == null) + throw new ArgumentException("invalid parameter passed to AES init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + WorkingKey = GenerateWorkingKey(keyParameter.GetKey(), forEncryption); + + this.forEncryption = forEncryption; + } + + public virtual string AlgorithmName + { + get { return "AES"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (WorkingKey == null) + throw new InvalidOperationException("AES engine not initialised"); + + Check.DataLength(input, inOff, 16, "input buffer too short"); + Check.OutputLength(output, outOff, 16, "output buffer too short"); + + UnPackBlock(input, inOff); + + if (forEncryption) + { + EncryptBlock(WorkingKey); + } + else + { + DecryptBlock(WorkingKey); + } + + PackBlock(output, outOff); + + return BLOCK_SIZE; + } + + public virtual void Reset() + { + } + + private void UnPackBlock( + byte[] bytes, + int off) + { + C0 = Pack.LE_To_UInt32(bytes, off); + C1 = Pack.LE_To_UInt32(bytes, off + 4); + C2 = Pack.LE_To_UInt32(bytes, off + 8); + C3 = Pack.LE_To_UInt32(bytes, off + 12); + } + + private void PackBlock( + byte[] bytes, + int off) + { + Pack.UInt32_To_LE(C0, bytes, off); + Pack.UInt32_To_LE(C1, bytes, off + 4); + Pack.UInt32_To_LE(C2, bytes, off + 8); + Pack.UInt32_To_LE(C3, bytes, off + 12); + } + + private void EncryptBlock(uint[][] KW) + { + uint[] kw = KW[0]; + uint t0 = this.C0 ^ kw[0]; + uint t1 = this.C1 ^ kw[1]; + uint t2 = this.C2 ^ kw[2]; + + uint r0, r1, r2, r3 = this.C3 ^ kw[3]; + int r = 1; + while (r < ROUNDS - 1) + { + kw = KW[r++]; + r0 = T0[t0 & 255] ^ T1[(t1 >> 8) & 255] ^ T2[(t2 >> 16) & 255] ^ T3[r3 >> 24] ^ kw[0]; + r1 = T0[t1 & 255] ^ T1[(t2 >> 8) & 255] ^ T2[(r3 >> 16) & 255] ^ T3[t0 >> 24] ^ kw[1]; + r2 = T0[t2 & 255] ^ T1[(r3 >> 8) & 255] ^ T2[(t0 >> 16) & 255] ^ T3[t1 >> 24] ^ kw[2]; + r3 = T0[r3 & 255] ^ T1[(t0 >> 8) & 255] ^ T2[(t1 >> 16) & 255] ^ T3[t2 >> 24] ^ kw[3]; + kw = KW[r++]; + t0 = T0[r0 & 255] ^ T1[(r1 >> 8) & 255] ^ T2[(r2 >> 16) & 255] ^ T3[r3 >> 24] ^ kw[0]; + t1 = T0[r1 & 255] ^ T1[(r2 >> 8) & 255] ^ T2[(r3 >> 16) & 255] ^ T3[r0 >> 24] ^ kw[1]; + t2 = T0[r2 & 255] ^ T1[(r3 >> 8) & 255] ^ T2[(r0 >> 16) & 255] ^ T3[r1 >> 24] ^ kw[2]; + r3 = T0[r3 & 255] ^ T1[(r0 >> 8) & 255] ^ T2[(r1 >> 16) & 255] ^ T3[r2 >> 24] ^ kw[3]; + } + + kw = KW[r++]; + r0 = T0[t0 & 255] ^ T1[(t1 >> 8) & 255] ^ T2[(t2 >> 16) & 255] ^ T3[r3 >> 24] ^ kw[0]; + r1 = T0[t1 & 255] ^ T1[(t2 >> 8) & 255] ^ T2[(r3 >> 16) & 255] ^ T3[t0 >> 24] ^ kw[1]; + r2 = T0[t2 & 255] ^ T1[(r3 >> 8) & 255] ^ T2[(t0 >> 16) & 255] ^ T3[t1 >> 24] ^ kw[2]; + r3 = T0[r3 & 255] ^ T1[(t0 >> 8) & 255] ^ T2[(t1 >> 16) & 255] ^ T3[t2 >> 24] ^ kw[3]; + + // the final round's table is a simple function of S so we don't use a whole other four tables for it + + kw = KW[r]; + this.C0 = (uint)S[r0 & 255] ^ (((uint)S[(r1 >> 8) & 255]) << 8) ^ (((uint)S[(r2 >> 16) & 255]) << 16) ^ (((uint)S[r3 >> 24]) << 24) ^ kw[0]; + this.C1 = (uint)S[r1 & 255] ^ (((uint)S[(r2 >> 8) & 255]) << 8) ^ (((uint)S[(r3 >> 16) & 255]) << 16) ^ (((uint)S[r0 >> 24]) << 24) ^ kw[1]; + this.C2 = (uint)S[r2 & 255] ^ (((uint)S[(r3 >> 8) & 255]) << 8) ^ (((uint)S[(r0 >> 16) & 255]) << 16) ^ (((uint)S[r1 >> 24]) << 24) ^ kw[2]; + this.C3 = (uint)S[r3 & 255] ^ (((uint)S[(r0 >> 8) & 255]) << 8) ^ (((uint)S[(r1 >> 16) & 255]) << 16) ^ (((uint)S[r2 >> 24]) << 24) ^ kw[3]; + } + + private void DecryptBlock(uint[][] KW) + { + uint[] kw = KW[ROUNDS]; + uint t0 = this.C0 ^ kw[0]; + uint t1 = this.C1 ^ kw[1]; + uint t2 = this.C2 ^ kw[2]; + + uint r0, r1, r2, r3 = this.C3 ^ kw[3]; + int r = ROUNDS - 1; + while (r > 1) + { + kw = KW[r--]; + r0 = Tinv0[t0 & 255] ^ Tinv1[(r3 >> 8) & 255] ^ Tinv2[(t2 >> 16) & 255] ^ Tinv3[t1 >> 24] ^ kw[0]; + r1 = Tinv0[t1 & 255] ^ Tinv1[(t0 >> 8) & 255] ^ Tinv2[(r3 >> 16) & 255] ^ Tinv3[t2 >> 24] ^ kw[1]; + r2 = Tinv0[t2 & 255] ^ Tinv1[(t1 >> 8) & 255] ^ Tinv2[(t0 >> 16) & 255] ^ Tinv3[r3 >> 24] ^ kw[2]; + r3 = Tinv0[r3 & 255] ^ Tinv1[(t2 >> 8) & 255] ^ Tinv2[(t1 >> 16) & 255] ^ Tinv3[t0 >> 24] ^ kw[3]; + kw = KW[r--]; + t0 = Tinv0[r0 & 255] ^ Tinv1[(r3 >> 8) & 255] ^ Tinv2[(r2 >> 16) & 255] ^ Tinv3[r1 >> 24] ^ kw[0]; + t1 = Tinv0[r1 & 255] ^ Tinv1[(r0 >> 8) & 255] ^ Tinv2[(r3 >> 16) & 255] ^ Tinv3[r2 >> 24] ^ kw[1]; + t2 = Tinv0[r2 & 255] ^ Tinv1[(r1 >> 8) & 255] ^ Tinv2[(r0 >> 16) & 255] ^ Tinv3[r3 >> 24] ^ kw[2]; + r3 = Tinv0[r3 & 255] ^ Tinv1[(r2 >> 8) & 255] ^ Tinv2[(r1 >> 16) & 255] ^ Tinv3[r0 >> 24] ^ kw[3]; + } + + kw = KW[1]; + r0 = Tinv0[t0 & 255] ^ Tinv1[(r3 >> 8) & 255] ^ Tinv2[(t2 >> 16) & 255] ^ Tinv3[t1 >> 24] ^ kw[0]; + r1 = Tinv0[t1 & 255] ^ Tinv1[(t0 >> 8) & 255] ^ Tinv2[(r3 >> 16) & 255] ^ Tinv3[t2 >> 24] ^ kw[1]; + r2 = Tinv0[t2 & 255] ^ Tinv1[(t1 >> 8) & 255] ^ Tinv2[(t0 >> 16) & 255] ^ Tinv3[r3 >> 24] ^ kw[2]; + r3 = Tinv0[r3 & 255] ^ Tinv1[(t2 >> 8) & 255] ^ Tinv2[(t1 >> 16) & 255] ^ Tinv3[t0 >> 24] ^ kw[3]; + + // the final round's table is a simple function of Si so we don't use a whole other four tables for it + + kw = KW[0]; + this.C0 = (uint)Si[r0 & 255] ^ (((uint)Si[(r3 >> 8) & 255]) << 8) ^ (((uint)Si[(r2 >> 16) & 255]) << 16) ^ (((uint)Si[r1 >> 24]) << 24) ^ kw[0]; + this.C1 = (uint)Si[r1 & 255] ^ (((uint)Si[(r0 >> 8) & 255]) << 8) ^ (((uint)Si[(r3 >> 16) & 255]) << 16) ^ (((uint)Si[r2 >> 24]) << 24) ^ kw[1]; + this.C2 = (uint)Si[r2 & 255] ^ (((uint)Si[(r1 >> 8) & 255]) << 8) ^ (((uint)Si[(r0 >> 16) & 255]) << 16) ^ (((uint)Si[r3 >> 24]) << 24) ^ kw[2]; + this.C3 = (uint)Si[r3 & 255] ^ (((uint)Si[(r2 >> 8) & 255]) << 8) ^ (((uint)Si[(r1 >> 16) & 255]) << 16) ^ (((uint)Si[r0 >> 24]) << 24) ^ kw[3]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesFastEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesFastEngine.cs.meta new file mode 100644 index 00000000..091b19fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesFastEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05eb307d46de52e42a911fd8244278df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesLightEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesLightEngine.cs new file mode 100644 index 00000000..2f4a373d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesLightEngine.cs @@ -0,0 +1,508 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * an implementation of the AES (Rijndael), from FIPS-197. + *

+ * For further details see: http://csrc.nist.gov/encryption/aes/. + * + * This implementation is based on optimizations from Dr. Brian Gladman's paper and C code at + * http://fp.gladman.plus.com/cryptography_technology/rijndael/ + * + * There are three levels of tradeoff of speed vs memory + * Because java has no preprocessor, they are written as three separate classes from which to choose + * + * The fastest uses 8Kbytes of static tables to precompute round calculations, 4 256 word tables for encryption + * and 4 for decryption. + * + * The middle performance version uses only one 256 word table for each, for a total of 2Kbytes, + * adding 12 rotate operations per round to compute the values contained in the other tables from + * the contents of the first + * + * The slowest version uses no static tables at all and computes the values + * in each round. + *

+ *

+ * This file contains the slowest performance version with no static tables + * for round precomputation, but it has the smallest foot print. + *

+ */ + public class AesLightEngine + : IBlockCipher + { + // The S box + private static readonly byte[] S = + { + 99, 124, 119, 123, 242, 107, 111, 197, + 48, 1, 103, 43, 254, 215, 171, 118, + 202, 130, 201, 125, 250, 89, 71, 240, + 173, 212, 162, 175, 156, 164, 114, 192, + 183, 253, 147, 38, 54, 63, 247, 204, + 52, 165, 229, 241, 113, 216, 49, 21, + 4, 199, 35, 195, 24, 150, 5, 154, + 7, 18, 128, 226, 235, 39, 178, 117, + 9, 131, 44, 26, 27, 110, 90, 160, + 82, 59, 214, 179, 41, 227, 47, 132, + 83, 209, 0, 237, 32, 252, 177, 91, + 106, 203, 190, 57, 74, 76, 88, 207, + 208, 239, 170, 251, 67, 77, 51, 133, + 69, 249, 2, 127, 80, 60, 159, 168, + 81, 163, 64, 143, 146, 157, 56, 245, + 188, 182, 218, 33, 16, 255, 243, 210, + 205, 12, 19, 236, 95, 151, 68, 23, + 196, 167, 126, 61, 100, 93, 25, 115, + 96, 129, 79, 220, 34, 42, 144, 136, + 70, 238, 184, 20, 222, 94, 11, 219, + 224, 50, 58, 10, 73, 6, 36, 92, + 194, 211, 172, 98, 145, 149, 228, 121, + 231, 200, 55, 109, 141, 213, 78, 169, + 108, 86, 244, 234, 101, 122, 174, 8, + 186, 120, 37, 46, 28, 166, 180, 198, + 232, 221, 116, 31, 75, 189, 139, 138, + 112, 62, 181, 102, 72, 3, 246, 14, + 97, 53, 87, 185, 134, 193, 29, 158, + 225, 248, 152, 17, 105, 217, 142, 148, + 155, 30, 135, 233, 206, 85, 40, 223, + 140, 161, 137, 13, 191, 230, 66, 104, + 65, 153, 45, 15, 176, 84, 187, 22, + }; + + // The inverse S-box + private static readonly byte[] Si = + { + 82, 9, 106, 213, 48, 54, 165, 56, + 191, 64, 163, 158, 129, 243, 215, 251, + 124, 227, 57, 130, 155, 47, 255, 135, + 52, 142, 67, 68, 196, 222, 233, 203, + 84, 123, 148, 50, 166, 194, 35, 61, + 238, 76, 149, 11, 66, 250, 195, 78, + 8, 46, 161, 102, 40, 217, 36, 178, + 118, 91, 162, 73, 109, 139, 209, 37, + 114, 248, 246, 100, 134, 104, 152, 22, + 212, 164, 92, 204, 93, 101, 182, 146, + 108, 112, 72, 80, 253, 237, 185, 218, + 94, 21, 70, 87, 167, 141, 157, 132, + 144, 216, 171, 0, 140, 188, 211, 10, + 247, 228, 88, 5, 184, 179, 69, 6, + 208, 44, 30, 143, 202, 63, 15, 2, + 193, 175, 189, 3, 1, 19, 138, 107, + 58, 145, 17, 65, 79, 103, 220, 234, + 151, 242, 207, 206, 240, 180, 230, 115, + 150, 172, 116, 34, 231, 173, 53, 133, + 226, 249, 55, 232, 28, 117, 223, 110, + 71, 241, 26, 113, 29, 41, 197, 137, + 111, 183, 98, 14, 170, 24, 190, 27, + 252, 86, 62, 75, 198, 210, 121, 32, + 154, 219, 192, 254, 120, 205, 90, 244, + 31, 221, 168, 51, 136, 7, 199, 49, + 177, 18, 16, 89, 39, 128, 236, 95, + 96, 81, 127, 169, 25, 181, 74, 13, + 45, 229, 122, 159, 147, 201, 156, 239, + 160, 224, 59, 77, 174, 42, 245, 176, + 200, 235, 187, 60, 131, 83, 153, 97, + 23, 43, 4, 126, 186, 119, 214, 38, + 225, 105, 20, 99, 85, 33, 12, 125, + }; + + // vector used in calculating key schedule (powers of x in GF(256)) + private static readonly byte[] rcon = + { + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, + 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 + }; + + private static uint Shift(uint r, int shift) + { + return (r >> shift) | (r << (32 - shift)); + } + + /* multiply four bytes in GF(2^8) by 'x' {02} in parallel */ + + private const uint m1 = 0x80808080; + private const uint m2 = 0x7f7f7f7f; + private const uint m3 = 0x0000001b; + private const uint m4 = 0xC0C0C0C0; + private const uint m5 = 0x3f3f3f3f; + + private static uint FFmulX(uint x) + { + return ((x & m2) << 1) ^ (((x & m1) >> 7) * m3); + } + + private static uint FFmulX2(uint x) + { + uint t0 = (x & m5) << 2; + uint t1 = (x & m4); + t1 ^= (t1 >> 1); + return t0 ^ (t1 >> 2) ^ (t1 >> 5); + } + + /* + The following defines provide alternative definitions of FFmulX that might + give improved performance if a fast 32-bit multiply is not available. + + private int FFmulX(int x) { int u = x & m1; u |= (u >> 1); return ((x & m2) << 1) ^ ((u >>> 3) | (u >>> 6)); } + private static final int m4 = 0x1b1b1b1b; + private int FFmulX(int x) { int u = x & m1; return ((x & m2) << 1) ^ ((u - (u >>> 7)) & m4); } + + */ + + private static uint Mcol(uint x) + { + uint t0, t1; + t0 = Shift(x, 8); + t1 = x ^ t0; + return Shift(t1, 16) ^ t0 ^ FFmulX(t1); + } + + private static uint Inv_Mcol(uint x) + { + uint t0, t1; + t0 = x; + t1 = t0 ^ Shift(t0, 8); + t0 ^= FFmulX(t1); + t1 ^= FFmulX2(t0); + t0 ^= t1 ^ Shift(t1, 16); + return t0; + } + + private static uint SubWord(uint x) + { + return (uint)S[x&255] + | (((uint)S[(x>>8)&255]) << 8) + | (((uint)S[(x>>16)&255]) << 16) + | (((uint)S[(x>>24)&255]) << 24); + } + + /** + * Calculate the necessary round keys + * The number of calculations depends on key size and block size + * AES specified a fixed block size of 128 bits and key sizes 128/192/256 bits + * This code is written assuming those are the only possible values + */ + private uint[][] GenerateWorkingKey(byte[] key, bool forEncryption) + { + int keyLen = key.Length; + if (keyLen < 16 || keyLen > 32 || (keyLen & 7) != 0) + throw new ArgumentException("Key length not 128/192/256 bits."); + + int KC = keyLen >> 2; + this.ROUNDS = KC + 6; // This is not always true for the generalized Rijndael that allows larger block sizes + + uint[][] W = new uint[ROUNDS + 1][]; // 4 words in a block + for (int i = 0; i <= ROUNDS; ++i) + { + W[i] = new uint[4]; + } + + switch (KC) + { + case 4: + { + uint t0 = Pack.LE_To_UInt32(key, 0); W[0][0] = t0; + uint t1 = Pack.LE_To_UInt32(key, 4); W[0][1] = t1; + uint t2 = Pack.LE_To_UInt32(key, 8); W[0][2] = t2; + uint t3 = Pack.LE_To_UInt32(key, 12); W[0][3] = t3; + + for (int i = 1; i <= 10; ++i) + { + uint u = SubWord(Shift(t3, 8)) ^ rcon[i - 1]; + t0 ^= u; W[i][0] = t0; + t1 ^= t0; W[i][1] = t1; + t2 ^= t1; W[i][2] = t2; + t3 ^= t2; W[i][3] = t3; + } + + break; + } + case 6: + { + uint t0 = Pack.LE_To_UInt32(key, 0); W[0][0] = t0; + uint t1 = Pack.LE_To_UInt32(key, 4); W[0][1] = t1; + uint t2 = Pack.LE_To_UInt32(key, 8); W[0][2] = t2; + uint t3 = Pack.LE_To_UInt32(key, 12); W[0][3] = t3; + uint t4 = Pack.LE_To_UInt32(key, 16); W[1][0] = t4; + uint t5 = Pack.LE_To_UInt32(key, 20); W[1][1] = t5; + + uint rcon = 1; + uint u = SubWord(Shift(t5, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[1][2] = t0; + t1 ^= t0; W[1][3] = t1; + t2 ^= t1; W[2][0] = t2; + t3 ^= t2; W[2][1] = t3; + t4 ^= t3; W[2][2] = t4; + t5 ^= t4; W[2][3] = t5; + + for (int i = 3; i < 12; i += 3) + { + u = SubWord(Shift(t5, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[i ][0] = t0; + t1 ^= t0; W[i ][1] = t1; + t2 ^= t1; W[i ][2] = t2; + t3 ^= t2; W[i ][3] = t3; + t4 ^= t3; W[i + 1][0] = t4; + t5 ^= t4; W[i + 1][1] = t5; + u = SubWord(Shift(t5, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[i + 1][2] = t0; + t1 ^= t0; W[i + 1][3] = t1; + t2 ^= t1; W[i + 2][0] = t2; + t3 ^= t2; W[i + 2][1] = t3; + t4 ^= t3; W[i + 2][2] = t4; + t5 ^= t4; W[i + 2][3] = t5; + } + + u = SubWord(Shift(t5, 8)) ^ rcon; + t0 ^= u; W[12][0] = t0; + t1 ^= t0; W[12][1] = t1; + t2 ^= t1; W[12][2] = t2; + t3 ^= t2; W[12][3] = t3; + + break; + } + case 8: + { + uint t0 = Pack.LE_To_UInt32(key, 0); W[0][0] = t0; + uint t1 = Pack.LE_To_UInt32(key, 4); W[0][1] = t1; + uint t2 = Pack.LE_To_UInt32(key, 8); W[0][2] = t2; + uint t3 = Pack.LE_To_UInt32(key, 12); W[0][3] = t3; + uint t4 = Pack.LE_To_UInt32(key, 16); W[1][0] = t4; + uint t5 = Pack.LE_To_UInt32(key, 20); W[1][1] = t5; + uint t6 = Pack.LE_To_UInt32(key, 24); W[1][2] = t6; + uint t7 = Pack.LE_To_UInt32(key, 28); W[1][3] = t7; + + uint u, rcon = 1; + + for (int i = 2; i < 14; i += 2) + { + u = SubWord(Shift(t7, 8)) ^ rcon; rcon <<= 1; + t0 ^= u; W[i ][0] = t0; + t1 ^= t0; W[i ][1] = t1; + t2 ^= t1; W[i ][2] = t2; + t3 ^= t2; W[i ][3] = t3; + u = SubWord(t3); + t4 ^= u; W[i + 1][0] = t4; + t5 ^= t4; W[i + 1][1] = t5; + t6 ^= t5; W[i + 1][2] = t6; + t7 ^= t6; W[i + 1][3] = t7; + } + + u = SubWord(Shift(t7, 8)) ^ rcon; + t0 ^= u; W[14][0] = t0; + t1 ^= t0; W[14][1] = t1; + t2 ^= t1; W[14][2] = t2; + t3 ^= t2; W[14][3] = t3; + + break; + } + default: + { + throw new InvalidOperationException("Should never get here"); + } + } + + if (!forEncryption) + { + for (int j = 1; j < ROUNDS; j++) + { + uint[] w = W[j]; + for (int i = 0; i < 4; i++) + { + w[i] = Inv_Mcol(w[i]); + } + } + } + + return W; + } + + private int ROUNDS; + private uint[][] WorkingKey; + private uint C0, C1, C2, C3; + private bool forEncryption; + + private const int BLOCK_SIZE = 16; + + /** + * default constructor - 128 bit block size. + */ + public AesLightEngine() + { + } + + /** + * initialise an AES cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + KeyParameter keyParameter = parameters as KeyParameter; + + if (keyParameter == null) + throw new ArgumentException("invalid parameter passed to AES init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + WorkingKey = GenerateWorkingKey(keyParameter.GetKey(), forEncryption); + + this.forEncryption = forEncryption; + } + + public virtual string AlgorithmName + { + get { return "AES"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (WorkingKey == null) + throw new InvalidOperationException("AES engine not initialised"); + + Check.DataLength(input, inOff, 16, "input buffer too short"); + Check.OutputLength(output, outOff, 16, "output buffer too short"); + + UnPackBlock(input, inOff); + + if (forEncryption) + { + EncryptBlock(WorkingKey); + } + else + { + DecryptBlock(WorkingKey); + } + + PackBlock(output, outOff); + + return BLOCK_SIZE; + } + + public virtual void Reset() + { + } + + private void UnPackBlock( + byte[] bytes, + int off) + { + C0 = Pack.LE_To_UInt32(bytes, off); + C1 = Pack.LE_To_UInt32(bytes, off + 4); + C2 = Pack.LE_To_UInt32(bytes, off + 8); + C3 = Pack.LE_To_UInt32(bytes, off + 12); + } + + private void PackBlock( + byte[] bytes, + int off) + { + Pack.UInt32_To_LE(C0, bytes, off); + Pack.UInt32_To_LE(C1, bytes, off + 4); + Pack.UInt32_To_LE(C2, bytes, off + 8); + Pack.UInt32_To_LE(C3, bytes, off + 12); + } + + private void EncryptBlock(uint[][] KW) + { + uint[] kw = KW[0]; + uint t0 = this.C0 ^ kw[0]; + uint t1 = this.C1 ^ kw[1]; + uint t2 = this.C2 ^ kw[2]; + + uint r0, r1, r2, r3 = this.C3 ^ kw[3]; + int r = 1; + while (r < ROUNDS - 1) + { + kw = KW[r++]; + r0 = Mcol((uint)S[t0 & 255] ^ (((uint)S[(t1 >> 8) & 255]) << 8) ^ (((uint)S[(t2 >> 16) & 255]) << 16) ^ (((uint)S[(r3 >> 24) & 255]) << 24)) ^ kw[0]; + r1 = Mcol((uint)S[t1 & 255] ^ (((uint)S[(t2 >> 8) & 255]) << 8) ^ (((uint)S[(r3 >> 16) & 255]) << 16) ^ (((uint)S[(t0 >> 24) & 255]) << 24)) ^ kw[1]; + r2 = Mcol((uint)S[t2 & 255] ^ (((uint)S[(r3 >> 8) & 255]) << 8) ^ (((uint)S[(t0 >> 16) & 255]) << 16) ^ (((uint)S[(t1 >> 24) & 255]) << 24)) ^ kw[2]; + r3 = Mcol((uint)S[r3 & 255] ^ (((uint)S[(t0 >> 8) & 255]) << 8) ^ (((uint)S[(t1 >> 16) & 255]) << 16) ^ (((uint)S[(t2 >> 24) & 255]) << 24)) ^ kw[3]; + kw = KW[r++]; + t0 = Mcol((uint)S[r0 & 255] ^ (((uint)S[(r1 >> 8) & 255]) << 8) ^ (((uint)S[(r2 >> 16) & 255]) << 16) ^ (((uint)S[(r3 >> 24) & 255]) << 24)) ^ kw[0]; + t1 = Mcol((uint)S[r1 & 255] ^ (((uint)S[(r2 >> 8) & 255]) << 8) ^ (((uint)S[(r3 >> 16) & 255]) << 16) ^ (((uint)S[(r0 >> 24) & 255]) << 24)) ^ kw[1]; + t2 = Mcol((uint)S[r2 & 255] ^ (((uint)S[(r3 >> 8) & 255]) << 8) ^ (((uint)S[(r0 >> 16) & 255]) << 16) ^ (((uint)S[(r1 >> 24) & 255]) << 24)) ^ kw[2]; + r3 = Mcol((uint)S[r3 & 255] ^ (((uint)S[(r0 >> 8) & 255]) << 8) ^ (((uint)S[(r1 >> 16) & 255]) << 16) ^ (((uint)S[(r2 >> 24) & 255]) << 24)) ^ kw[3]; + } + + kw = KW[r++]; + r0 = Mcol((uint)S[t0 & 255] ^ (((uint)S[(t1 >> 8) & 255]) << 8) ^ (((uint)S[(t2 >> 16) & 255]) << 16) ^ (((uint)S[(r3 >> 24) & 255]) << 24)) ^ kw[0]; + r1 = Mcol((uint)S[t1 & 255] ^ (((uint)S[(t2 >> 8) & 255]) << 8) ^ (((uint)S[(r3 >> 16) & 255]) << 16) ^ (((uint)S[(t0 >> 24) & 255]) << 24)) ^ kw[1]; + r2 = Mcol((uint)S[t2 & 255] ^ (((uint)S[(r3 >> 8) & 255]) << 8) ^ (((uint)S[(t0 >> 16) & 255]) << 16) ^ (((uint)S[(t1 >> 24) & 255]) << 24)) ^ kw[2]; + r3 = Mcol((uint)S[r3 & 255] ^ (((uint)S[(t0 >> 8) & 255]) << 8) ^ (((uint)S[(t1 >> 16) & 255]) << 16) ^ (((uint)S[(t2 >> 24) & 255]) << 24)) ^ kw[3]; + + // the final round is a simple function of S + + kw = KW[r]; + this.C0 = (uint)S[r0 & 255] ^ (((uint)S[(r1 >> 8) & 255]) << 8) ^ (((uint)S[(r2 >> 16) & 255]) << 16) ^ (((uint)S[(r3 >> 24) & 255]) << 24) ^ kw[0]; + this.C1 = (uint)S[r1 & 255] ^ (((uint)S[(r2 >> 8) & 255]) << 8) ^ (((uint)S[(r3 >> 16) & 255]) << 16) ^ (((uint)S[(r0 >> 24) & 255]) << 24) ^ kw[1]; + this.C2 = (uint)S[r2 & 255] ^ (((uint)S[(r3 >> 8) & 255]) << 8) ^ (((uint)S[(r0 >> 16) & 255]) << 16) ^ (((uint)S[(r1 >> 24) & 255]) << 24) ^ kw[2]; + this.C3 = (uint)S[r3 & 255] ^ (((uint)S[(r0 >> 8) & 255]) << 8) ^ (((uint)S[(r1 >> 16) & 255]) << 16) ^ (((uint)S[(r2 >> 24) & 255]) << 24) ^ kw[3]; + } + + private void DecryptBlock(uint[][] KW) + { + uint[] kw = KW[ROUNDS]; + uint t0 = this.C0 ^ kw[0]; + uint t1 = this.C1 ^ kw[1]; + uint t2 = this.C2 ^ kw[2]; + + uint r0, r1, r2, r3 = this.C3 ^ kw[3]; + int r = ROUNDS - 1; + while (r > 1) + { + kw = KW[r--]; + r0 = Inv_Mcol((uint)Si[t0 & 255] ^ (((uint)Si[(r3 >> 8) & 255]) << 8) ^ (((uint)Si[(t2 >> 16) & 255]) << 16) ^ ((uint)Si[(t1 >> 24) & 255] << 24)) ^ kw[0]; + r1 = Inv_Mcol((uint)Si[t1 & 255] ^ (((uint)Si[(t0 >> 8) & 255]) << 8) ^ (((uint)Si[(r3 >> 16) & 255]) << 16) ^ ((uint)Si[(t2 >> 24) & 255] << 24)) ^ kw[1]; + r2 = Inv_Mcol((uint)Si[t2 & 255] ^ (((uint)Si[(t1 >> 8) & 255]) << 8) ^ (((uint)Si[(t0 >> 16) & 255]) << 16) ^ ((uint)Si[(r3 >> 24) & 255] << 24)) ^ kw[2]; + r3 = Inv_Mcol((uint)Si[r3 & 255] ^ (((uint)Si[(t2 >> 8) & 255]) << 8) ^ (((uint)Si[(t1 >> 16) & 255]) << 16) ^ ((uint)Si[(t0 >> 24) & 255] << 24)) ^ kw[3]; + kw = KW[r--]; + t0 = Inv_Mcol((uint)Si[r0 & 255] ^ (((uint)Si[(r3 >> 8) & 255]) << 8) ^ (((uint)Si[(r2 >> 16) & 255]) << 16) ^ ((uint)Si[(r1 >> 24) & 255] << 24)) ^ kw[0]; + t1 = Inv_Mcol((uint)Si[r1 & 255] ^ (((uint)Si[(r0 >> 8) & 255]) << 8) ^ (((uint)Si[(r3 >> 16) & 255]) << 16) ^ ((uint)Si[(r2 >> 24) & 255] << 24)) ^ kw[1]; + t2 = Inv_Mcol((uint)Si[r2 & 255] ^ (((uint)Si[(r1 >> 8) & 255]) << 8) ^ (((uint)Si[(r0 >> 16) & 255]) << 16) ^ ((uint)Si[(r3 >> 24) & 255] << 24)) ^ kw[2]; + r3 = Inv_Mcol((uint)Si[r3 & 255] ^ (((uint)Si[(r2 >> 8) & 255]) << 8) ^ (((uint)Si[(r1 >> 16) & 255]) << 16) ^ ((uint)Si[(r0 >> 24) & 255] << 24)) ^ kw[3]; + } + + kw = KW[1]; + r0 = Inv_Mcol((uint)Si[t0 & 255] ^ (((uint)Si[(r3 >> 8) & 255]) << 8) ^ (((uint)Si[(t2 >> 16) & 255]) << 16) ^ ((uint)Si[(t1 >> 24) & 255] << 24)) ^ kw[0]; + r1 = Inv_Mcol((uint)Si[t1 & 255] ^ (((uint)Si[(t0 >> 8) & 255]) << 8) ^ (((uint)Si[(r3 >> 16) & 255]) << 16) ^ ((uint)Si[(t2 >> 24) & 255] << 24)) ^ kw[1]; + r2 = Inv_Mcol((uint)Si[t2 & 255] ^ (((uint)Si[(t1 >> 8) & 255]) << 8) ^ (((uint)Si[(t0 >> 16) & 255]) << 16) ^ ((uint)Si[(r3 >> 24) & 255] << 24)) ^ kw[2]; + r3 = Inv_Mcol((uint)Si[r3 & 255] ^ (((uint)Si[(t2 >> 8) & 255]) << 8) ^ (((uint)Si[(t1 >> 16) & 255]) << 16) ^ ((uint)Si[(t0 >> 24) & 255] << 24)) ^ kw[3]; + + // the final round's table is a simple function of Si + + kw = KW[0]; + this.C0 = (uint)Si[r0 & 255] ^ (((uint)Si[(r3 >> 8) & 255]) << 8) ^ (((uint)Si[(r2 >> 16) & 255]) << 16) ^ (((uint)Si[(r1 >> 24) & 255]) << 24) ^ kw[0]; + this.C1 = (uint)Si[r1 & 255] ^ (((uint)Si[(r0 >> 8) & 255]) << 8) ^ (((uint)Si[(r3 >> 16) & 255]) << 16) ^ (((uint)Si[(r2 >> 24) & 255]) << 24) ^ kw[1]; + this.C2 = (uint)Si[r2 & 255] ^ (((uint)Si[(r1 >> 8) & 255]) << 8) ^ (((uint)Si[(r0 >> 16) & 255]) << 16) ^ (((uint)Si[(r3 >> 24) & 255]) << 24) ^ kw[2]; + this.C3 = (uint)Si[r3 & 255] ^ (((uint)Si[(r2 >> 8) & 255]) << 8) ^ (((uint)Si[(r1 >> 16) & 255]) << 16) ^ (((uint)Si[(r0 >> 24) & 255]) << 24) ^ kw[3]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesLightEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesLightEngine.cs.meta new file mode 100644 index 00000000..e0c9e978 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesLightEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13a5836677ccf124397d55f4f1cb136d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesWrapEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesWrapEngine.cs new file mode 100644 index 00000000..01299919 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesWrapEngine.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// + /// An implementation of the AES Key Wrapper from the NIST Key Wrap Specification. + ///

+ /// For further details see: http://csrc.nist.gov/encryption/kms/key-wrap.pdf. + /// + public class AesWrapEngine + : Rfc3394WrapEngine + { + public AesWrapEngine() + : base(new AesEngine()) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesWrapEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesWrapEngine.cs.meta new file mode 100644 index 00000000..f390733a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/AesWrapEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 298095ce0aa6ae74e812fd919e59cdee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/BlowfishEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/BlowfishEngine.cs new file mode 100644 index 00000000..d882dd9e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/BlowfishEngine.cs @@ -0,0 +1,557 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * A class that provides Blowfish key encryption operations, + * such as encoding data and generating keys. + * All the algorithms herein are from Applied Cryptography + * and implement a simplified cryptography interface. + */ + public sealed class BlowfishEngine + : IBlockCipher + { + private readonly static uint[] KP = + { + 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, + 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, + 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, + 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, + 0x9216D5D9, 0x8979FB1B + }, + KS0 = + { + 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, + 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99, + 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, + 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, + 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE, + 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, + 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, + 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E, + 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, + 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, + 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, + 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, + 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, + 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677, + 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, + 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, + 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88, + 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, + 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, + 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0, + 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, + 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, + 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88, + 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, + 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, + 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D, + 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, + 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, + 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA, + 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, + 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, + 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09, + 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, + 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, + 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279, + 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, + 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, + 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82, + 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, + 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, + 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0, + 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, + 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, + 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8, + 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, + 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, + 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7, + 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, + 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, + 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1, + 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, + 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, + 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477, + 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, + 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, + 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF, + 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, + 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, + 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41, + 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, + 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, + 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915, + 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, + 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A + }, + KS1 = + { + 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, + 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, + 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, + 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, + 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6, + 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, + 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E, + 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1, + 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, + 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, + 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, + 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, + 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701, + 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7, + 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, + 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, + 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF, + 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, + 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E, + 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87, + 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, + 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2, + 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16, + 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, + 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B, + 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509, + 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, + 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3, + 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F, + 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, + 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, + 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960, + 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, + 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28, + 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802, + 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, + 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510, + 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF, + 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, + 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E, + 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50, + 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, + 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8, + 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281, + 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, + 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, + 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128, + 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, + 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0, + 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0, + 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, + 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250, + 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3, + 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, + 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00, + 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061, + 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, + 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E, + 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735, + 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, + 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, + 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340, + 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, + 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 + }, + KS2 = + { + 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, + 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, + 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF, + 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, + 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45, + 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, + 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A, + 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, + 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE, + 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, + 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, + 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, + 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2, + 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB, + 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527, + 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, + 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33, + 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C, + 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3, + 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC, + 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, + 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564, + 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B, + 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115, + 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922, + 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, + 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0, + 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E, + 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37, + 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D, + 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, + 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B, + 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3, + 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB, + 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D, + 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, + 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350, + 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9, + 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A, + 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE, + 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, + 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC, + 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F, + 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61, + 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2, + 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, + 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2, + 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C, + 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E, + 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633, + 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, + 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169, + 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52, + 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027, + 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5, + 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, + 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634, + 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76, + 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24, + 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC, + 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, + 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C, + 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837, + 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 + }, + KS3 = + { + 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, + 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE, + 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B, + 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, + 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8, + 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, + 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, + 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22, + 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4, + 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, + 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, + 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59, + 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, + 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51, + 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28, + 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, + 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B, + 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28, + 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, + 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD, + 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, + 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, + 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB, + 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F, + 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, + 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32, + 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680, + 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, + 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE, + 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB, + 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, + 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47, + 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370, + 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, + 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84, + 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, + 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, + 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD, + 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9, + 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, + 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38, + 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F, + 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, + 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525, + 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1, + 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, + 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964, + 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E, + 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, + 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D, + 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, + 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, + 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02, + 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC, + 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, + 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A, + 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, + 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, + 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0, + 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060, + 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, + 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9, + 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F, + 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 + }; + + //==================================== + // Useful constants + //==================================== + + private static readonly int ROUNDS = 16; + private const int BLOCK_SIZE = 8; // bytes = 64 bits + private static readonly int SBOX_SK = 256; + private static readonly int P_SZ = ROUNDS+2; + + private readonly uint[] S0, S1, S2, S3; // the s-boxes + private readonly uint[] P; // the p-array + + private bool encrypting; + + private byte[] workingKey; + + public BlowfishEngine() + { + S0 = new uint[SBOX_SK]; + S1 = new uint[SBOX_SK]; + S2 = new uint[SBOX_SK]; + S3 = new uint[SBOX_SK]; + P = new uint[P_SZ]; + } + + /** + * initialise a Blowfish cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("invalid parameter passed to Blowfish init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + this.encrypting = forEncryption; + this.workingKey = ((KeyParameter)parameters).GetKey(); + SetKey(this.workingKey); + } + + public string AlgorithmName + { + get { return "Blowfish"; } + } + + public bool IsPartialBlockOkay + { + get { return false; } + } + + public int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (workingKey == null) + throw new InvalidOperationException("Blowfish not initialised"); + + Check.DataLength(input, inOff, BLOCK_SIZE, "input buffer too short"); + Check.OutputLength(output, outOff, BLOCK_SIZE, "output buffer too short"); + + if (encrypting) + { + EncryptBlock(input, inOff, output, outOff); + } + else + { + DecryptBlock(input, inOff, output, outOff); + } + + return BLOCK_SIZE; + } + + public void Reset() + { + } + + public int GetBlockSize() + { + return BLOCK_SIZE; + } + + //================================== + // Private Implementation + //================================== + + private uint F(uint x) + { + return (((S0[x >> 24] + S1[(x >> 16) & 0xff]) ^ S2[(x >> 8) & 0xff]) + S3[x & 0xff]); + } + + /** + * apply the encryption cycle to each value pair in the table. + */ + private void ProcessTable( + uint xl, + uint xr, + uint[] table) + { + int size = table.Length; + + for (int s = 0; s < size; s += 2) + { + xl ^= P[0]; + + for (int i = 1; i < ROUNDS; i += 2) + { + xr ^= F(xl) ^ P[i]; + xl ^= F(xr) ^ P[i + 1]; + } + + xr ^= P[ROUNDS + 1]; + + table[s] = xr; + table[s + 1] = xl; + + xr = xl; // end of cycle swap + xl = table[s]; + } + } + + private void SetKey(byte[] key) + { + /* + * - comments are from _Applied Crypto_, Schneier, p338 + * please be careful comparing the two, AC numbers the + * arrays from 1, the enclosed code from 0. + * + * (1) + * Initialise the S-boxes and the P-array, with a fixed string + * This string contains the hexadecimal digits of pi (3.141...) + */ + Array.Copy(KS0, 0, S0, 0, SBOX_SK); + Array.Copy(KS1, 0, S1, 0, SBOX_SK); + Array.Copy(KS2, 0, S2, 0, SBOX_SK); + Array.Copy(KS3, 0, S3, 0, SBOX_SK); + + Array.Copy(KP, 0, P, 0, P_SZ); + + /* + * (2) + * Now, XOR P[0] with the first 32 bits of the key, XOR P[1] with the + * second 32-bits of the key, and so on for all bits of the key + * (up to P[17]). Repeatedly cycle through the key bits until the + * entire P-array has been XOR-ed with the key bits + */ + int keyLength = key.Length; + int keyIndex = 0; + + for (int i=0; i < P_SZ; i++) + { + // Get the 32 bits of the key, in 4 * 8 bit chunks + uint data = 0x0000000; + for (int j=0; j < 4; j++) + { + // create a 32 bit block + data = (data << 8) | (uint)key[keyIndex++]; + + // wrap when we get to the end of the key + if (keyIndex >= keyLength) + { + keyIndex = 0; + } + } + // XOR the newly created 32 bit chunk onto the P-array + P[i] ^= data; + } + + /* + * (3) + * Encrypt the all-zero string with the Blowfish algorithm, using + * the subkeys described in (1) and (2) + * + * (4) + * Replace P1 and P2 with the output of step (3) + * + * (5) + * Encrypt the output of step(3) using the Blowfish algorithm, + * with the modified subkeys. + * + * (6) + * Replace P3 and P4 with the output of step (5) + * + * (7) + * Continue the process, replacing all elements of the P-array + * and then all four S-boxes in order, with the output of the + * continuously changing Blowfish algorithm + */ + + ProcessTable(0, 0, P); + ProcessTable(P[P_SZ - 2], P[P_SZ - 1], S0); + ProcessTable(S0[SBOX_SK - 2], S0[SBOX_SK - 1], S1); + ProcessTable(S1[SBOX_SK - 2], S1[SBOX_SK - 1], S2); + ProcessTable(S2[SBOX_SK - 2], S2[SBOX_SK - 1], S3); + } + + /** + * Encrypt the given input starting at the given offset and place + * the result in the provided buffer starting at the given offset. + * The input will be an exact multiple of our blocksize. + */ + private void EncryptBlock( + byte[] src, + int srcIndex, + byte[] dst, + int dstIndex) + { + uint xl = Pack.BE_To_UInt32(src, srcIndex); + uint xr = Pack.BE_To_UInt32(src, srcIndex+4); + + xl ^= P[0]; + + for (int i = 1; i < ROUNDS; i += 2) + { + xr ^= F(xl) ^ P[i]; + xl ^= F(xr) ^ P[i + 1]; + } + + xr ^= P[ROUNDS + 1]; + + Pack.UInt32_To_BE(xr, dst, dstIndex); + Pack.UInt32_To_BE(xl, dst, dstIndex + 4); + } + + /** + * Decrypt the given input starting at the given offset and place + * the result in the provided buffer starting at the given offset. + * The input will be an exact multiple of our blocksize. + */ + private void DecryptBlock( + byte[] src, + int srcIndex, + byte[] dst, + int dstIndex) + { + uint xl = Pack.BE_To_UInt32(src, srcIndex); + uint xr = Pack.BE_To_UInt32(src, srcIndex + 4); + + xl ^= P[ROUNDS + 1]; + + for (int i = ROUNDS; i > 0 ; i -= 2) + { + xr ^= F(xl) ^ P[i]; + xl ^= F(xr) ^ P[i - 1]; + } + + xr ^= P[0]; + + Pack.UInt32_To_BE(xr, dst, dstIndex); + Pack.UInt32_To_BE(xl, dst, dstIndex + 4); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/BlowfishEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/BlowfishEngine.cs.meta new file mode 100644 index 00000000..799d4926 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/BlowfishEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f53324f77555fe42bd19122a07da1dc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaEngine.cs new file mode 100644 index 00000000..db5613df --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaEngine.cs @@ -0,0 +1,672 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * Camellia - based on RFC 3713. + */ + public class CamelliaEngine + : IBlockCipher + { + private bool initialised = false; + private bool _keyIs128; + + private const int BLOCK_SIZE = 16; + + private uint[] subkey = new uint[24 * 4]; + private uint[] kw = new uint[4 * 2]; // for whitening + private uint[] ke = new uint[6 * 2]; // for FL and FL^(-1) + private uint[] state = new uint[4]; // for encryption and decryption + + private static readonly uint[] SIGMA = new uint[]{ + 0xa09e667f, 0x3bcc908b, + 0xb67ae858, 0x4caa73b2, + 0xc6ef372f, 0xe94f82be, + 0x54ff53a5, 0xf1d36f1c, + 0x10e527fa, 0xde682d1d, + 0xb05688c2, 0xb3e6c1fd + }; + + /* + * + * S-box data + * + */ + private static readonly uint[] SBOX1_1110 = new uint[]{ + 0x70707000, 0x82828200, 0x2c2c2c00, 0xececec00, 0xb3b3b300, 0x27272700, + 0xc0c0c000, 0xe5e5e500, 0xe4e4e400, 0x85858500, 0x57575700, 0x35353500, + 0xeaeaea00, 0x0c0c0c00, 0xaeaeae00, 0x41414100, 0x23232300, 0xefefef00, + 0x6b6b6b00, 0x93939300, 0x45454500, 0x19191900, 0xa5a5a500, 0x21212100, + 0xededed00, 0x0e0e0e00, 0x4f4f4f00, 0x4e4e4e00, 0x1d1d1d00, 0x65656500, + 0x92929200, 0xbdbdbd00, 0x86868600, 0xb8b8b800, 0xafafaf00, 0x8f8f8f00, + 0x7c7c7c00, 0xebebeb00, 0x1f1f1f00, 0xcecece00, 0x3e3e3e00, 0x30303000, + 0xdcdcdc00, 0x5f5f5f00, 0x5e5e5e00, 0xc5c5c500, 0x0b0b0b00, 0x1a1a1a00, + 0xa6a6a600, 0xe1e1e100, 0x39393900, 0xcacaca00, 0xd5d5d500, 0x47474700, + 0x5d5d5d00, 0x3d3d3d00, 0xd9d9d900, 0x01010100, 0x5a5a5a00, 0xd6d6d600, + 0x51515100, 0x56565600, 0x6c6c6c00, 0x4d4d4d00, 0x8b8b8b00, 0x0d0d0d00, + 0x9a9a9a00, 0x66666600, 0xfbfbfb00, 0xcccccc00, 0xb0b0b000, 0x2d2d2d00, + 0x74747400, 0x12121200, 0x2b2b2b00, 0x20202000, 0xf0f0f000, 0xb1b1b100, + 0x84848400, 0x99999900, 0xdfdfdf00, 0x4c4c4c00, 0xcbcbcb00, 0xc2c2c200, + 0x34343400, 0x7e7e7e00, 0x76767600, 0x05050500, 0x6d6d6d00, 0xb7b7b700, + 0xa9a9a900, 0x31313100, 0xd1d1d100, 0x17171700, 0x04040400, 0xd7d7d700, + 0x14141400, 0x58585800, 0x3a3a3a00, 0x61616100, 0xdedede00, 0x1b1b1b00, + 0x11111100, 0x1c1c1c00, 0x32323200, 0x0f0f0f00, 0x9c9c9c00, 0x16161600, + 0x53535300, 0x18181800, 0xf2f2f200, 0x22222200, 0xfefefe00, 0x44444400, + 0xcfcfcf00, 0xb2b2b200, 0xc3c3c300, 0xb5b5b500, 0x7a7a7a00, 0x91919100, + 0x24242400, 0x08080800, 0xe8e8e800, 0xa8a8a800, 0x60606000, 0xfcfcfc00, + 0x69696900, 0x50505000, 0xaaaaaa00, 0xd0d0d000, 0xa0a0a000, 0x7d7d7d00, + 0xa1a1a100, 0x89898900, 0x62626200, 0x97979700, 0x54545400, 0x5b5b5b00, + 0x1e1e1e00, 0x95959500, 0xe0e0e000, 0xffffff00, 0x64646400, 0xd2d2d200, + 0x10101000, 0xc4c4c400, 0x00000000, 0x48484800, 0xa3a3a300, 0xf7f7f700, + 0x75757500, 0xdbdbdb00, 0x8a8a8a00, 0x03030300, 0xe6e6e600, 0xdadada00, + 0x09090900, 0x3f3f3f00, 0xdddddd00, 0x94949400, 0x87878700, 0x5c5c5c00, + 0x83838300, 0x02020200, 0xcdcdcd00, 0x4a4a4a00, 0x90909000, 0x33333300, + 0x73737300, 0x67676700, 0xf6f6f600, 0xf3f3f300, 0x9d9d9d00, 0x7f7f7f00, + 0xbfbfbf00, 0xe2e2e200, 0x52525200, 0x9b9b9b00, 0xd8d8d800, 0x26262600, + 0xc8c8c800, 0x37373700, 0xc6c6c600, 0x3b3b3b00, 0x81818100, 0x96969600, + 0x6f6f6f00, 0x4b4b4b00, 0x13131300, 0xbebebe00, 0x63636300, 0x2e2e2e00, + 0xe9e9e900, 0x79797900, 0xa7a7a700, 0x8c8c8c00, 0x9f9f9f00, 0x6e6e6e00, + 0xbcbcbc00, 0x8e8e8e00, 0x29292900, 0xf5f5f500, 0xf9f9f900, 0xb6b6b600, + 0x2f2f2f00, 0xfdfdfd00, 0xb4b4b400, 0x59595900, 0x78787800, 0x98989800, + 0x06060600, 0x6a6a6a00, 0xe7e7e700, 0x46464600, 0x71717100, 0xbababa00, + 0xd4d4d400, 0x25252500, 0xababab00, 0x42424200, 0x88888800, 0xa2a2a200, + 0x8d8d8d00, 0xfafafa00, 0x72727200, 0x07070700, 0xb9b9b900, 0x55555500, + 0xf8f8f800, 0xeeeeee00, 0xacacac00, 0x0a0a0a00, 0x36363600, 0x49494900, + 0x2a2a2a00, 0x68686800, 0x3c3c3c00, 0x38383800, 0xf1f1f100, 0xa4a4a400, + 0x40404000, 0x28282800, 0xd3d3d300, 0x7b7b7b00, 0xbbbbbb00, 0xc9c9c900, + 0x43434300, 0xc1c1c100, 0x15151500, 0xe3e3e300, 0xadadad00, 0xf4f4f400, + 0x77777700, 0xc7c7c700, 0x80808000, 0x9e9e9e00 + }; + + private static readonly uint[] SBOX4_4404 = new uint[]{ + 0x70700070, 0x2c2c002c, 0xb3b300b3, 0xc0c000c0, 0xe4e400e4, 0x57570057, + 0xeaea00ea, 0xaeae00ae, 0x23230023, 0x6b6b006b, 0x45450045, 0xa5a500a5, + 0xeded00ed, 0x4f4f004f, 0x1d1d001d, 0x92920092, 0x86860086, 0xafaf00af, + 0x7c7c007c, 0x1f1f001f, 0x3e3e003e, 0xdcdc00dc, 0x5e5e005e, 0x0b0b000b, + 0xa6a600a6, 0x39390039, 0xd5d500d5, 0x5d5d005d, 0xd9d900d9, 0x5a5a005a, + 0x51510051, 0x6c6c006c, 0x8b8b008b, 0x9a9a009a, 0xfbfb00fb, 0xb0b000b0, + 0x74740074, 0x2b2b002b, 0xf0f000f0, 0x84840084, 0xdfdf00df, 0xcbcb00cb, + 0x34340034, 0x76760076, 0x6d6d006d, 0xa9a900a9, 0xd1d100d1, 0x04040004, + 0x14140014, 0x3a3a003a, 0xdede00de, 0x11110011, 0x32320032, 0x9c9c009c, + 0x53530053, 0xf2f200f2, 0xfefe00fe, 0xcfcf00cf, 0xc3c300c3, 0x7a7a007a, + 0x24240024, 0xe8e800e8, 0x60600060, 0x69690069, 0xaaaa00aa, 0xa0a000a0, + 0xa1a100a1, 0x62620062, 0x54540054, 0x1e1e001e, 0xe0e000e0, 0x64640064, + 0x10100010, 0x00000000, 0xa3a300a3, 0x75750075, 0x8a8a008a, 0xe6e600e6, + 0x09090009, 0xdddd00dd, 0x87870087, 0x83830083, 0xcdcd00cd, 0x90900090, + 0x73730073, 0xf6f600f6, 0x9d9d009d, 0xbfbf00bf, 0x52520052, 0xd8d800d8, + 0xc8c800c8, 0xc6c600c6, 0x81810081, 0x6f6f006f, 0x13130013, 0x63630063, + 0xe9e900e9, 0xa7a700a7, 0x9f9f009f, 0xbcbc00bc, 0x29290029, 0xf9f900f9, + 0x2f2f002f, 0xb4b400b4, 0x78780078, 0x06060006, 0xe7e700e7, 0x71710071, + 0xd4d400d4, 0xabab00ab, 0x88880088, 0x8d8d008d, 0x72720072, 0xb9b900b9, + 0xf8f800f8, 0xacac00ac, 0x36360036, 0x2a2a002a, 0x3c3c003c, 0xf1f100f1, + 0x40400040, 0xd3d300d3, 0xbbbb00bb, 0x43430043, 0x15150015, 0xadad00ad, + 0x77770077, 0x80800080, 0x82820082, 0xecec00ec, 0x27270027, 0xe5e500e5, + 0x85850085, 0x35350035, 0x0c0c000c, 0x41410041, 0xefef00ef, 0x93930093, + 0x19190019, 0x21210021, 0x0e0e000e, 0x4e4e004e, 0x65650065, 0xbdbd00bd, + 0xb8b800b8, 0x8f8f008f, 0xebeb00eb, 0xcece00ce, 0x30300030, 0x5f5f005f, + 0xc5c500c5, 0x1a1a001a, 0xe1e100e1, 0xcaca00ca, 0x47470047, 0x3d3d003d, + 0x01010001, 0xd6d600d6, 0x56560056, 0x4d4d004d, 0x0d0d000d, 0x66660066, + 0xcccc00cc, 0x2d2d002d, 0x12120012, 0x20200020, 0xb1b100b1, 0x99990099, + 0x4c4c004c, 0xc2c200c2, 0x7e7e007e, 0x05050005, 0xb7b700b7, 0x31310031, + 0x17170017, 0xd7d700d7, 0x58580058, 0x61610061, 0x1b1b001b, 0x1c1c001c, + 0x0f0f000f, 0x16160016, 0x18180018, 0x22220022, 0x44440044, 0xb2b200b2, + 0xb5b500b5, 0x91910091, 0x08080008, 0xa8a800a8, 0xfcfc00fc, 0x50500050, + 0xd0d000d0, 0x7d7d007d, 0x89890089, 0x97970097, 0x5b5b005b, 0x95950095, + 0xffff00ff, 0xd2d200d2, 0xc4c400c4, 0x48480048, 0xf7f700f7, 0xdbdb00db, + 0x03030003, 0xdada00da, 0x3f3f003f, 0x94940094, 0x5c5c005c, 0x02020002, + 0x4a4a004a, 0x33330033, 0x67670067, 0xf3f300f3, 0x7f7f007f, 0xe2e200e2, + 0x9b9b009b, 0x26260026, 0x37370037, 0x3b3b003b, 0x96960096, 0x4b4b004b, + 0xbebe00be, 0x2e2e002e, 0x79790079, 0x8c8c008c, 0x6e6e006e, 0x8e8e008e, + 0xf5f500f5, 0xb6b600b6, 0xfdfd00fd, 0x59590059, 0x98980098, 0x6a6a006a, + 0x46460046, 0xbaba00ba, 0x25250025, 0x42420042, 0xa2a200a2, 0xfafa00fa, + 0x07070007, 0x55550055, 0xeeee00ee, 0x0a0a000a, 0x49490049, 0x68680068, + 0x38380038, 0xa4a400a4, 0x28280028, 0x7b7b007b, 0xc9c900c9, 0xc1c100c1, + 0xe3e300e3, 0xf4f400f4, 0xc7c700c7, 0x9e9e009e + }; + + private static readonly uint[] SBOX2_0222 = new uint[]{ + 0x00e0e0e0, 0x00050505, 0x00585858, 0x00d9d9d9, 0x00676767, 0x004e4e4e, + 0x00818181, 0x00cbcbcb, 0x00c9c9c9, 0x000b0b0b, 0x00aeaeae, 0x006a6a6a, + 0x00d5d5d5, 0x00181818, 0x005d5d5d, 0x00828282, 0x00464646, 0x00dfdfdf, + 0x00d6d6d6, 0x00272727, 0x008a8a8a, 0x00323232, 0x004b4b4b, 0x00424242, + 0x00dbdbdb, 0x001c1c1c, 0x009e9e9e, 0x009c9c9c, 0x003a3a3a, 0x00cacaca, + 0x00252525, 0x007b7b7b, 0x000d0d0d, 0x00717171, 0x005f5f5f, 0x001f1f1f, + 0x00f8f8f8, 0x00d7d7d7, 0x003e3e3e, 0x009d9d9d, 0x007c7c7c, 0x00606060, + 0x00b9b9b9, 0x00bebebe, 0x00bcbcbc, 0x008b8b8b, 0x00161616, 0x00343434, + 0x004d4d4d, 0x00c3c3c3, 0x00727272, 0x00959595, 0x00ababab, 0x008e8e8e, + 0x00bababa, 0x007a7a7a, 0x00b3b3b3, 0x00020202, 0x00b4b4b4, 0x00adadad, + 0x00a2a2a2, 0x00acacac, 0x00d8d8d8, 0x009a9a9a, 0x00171717, 0x001a1a1a, + 0x00353535, 0x00cccccc, 0x00f7f7f7, 0x00999999, 0x00616161, 0x005a5a5a, + 0x00e8e8e8, 0x00242424, 0x00565656, 0x00404040, 0x00e1e1e1, 0x00636363, + 0x00090909, 0x00333333, 0x00bfbfbf, 0x00989898, 0x00979797, 0x00858585, + 0x00686868, 0x00fcfcfc, 0x00ececec, 0x000a0a0a, 0x00dadada, 0x006f6f6f, + 0x00535353, 0x00626262, 0x00a3a3a3, 0x002e2e2e, 0x00080808, 0x00afafaf, + 0x00282828, 0x00b0b0b0, 0x00747474, 0x00c2c2c2, 0x00bdbdbd, 0x00363636, + 0x00222222, 0x00383838, 0x00646464, 0x001e1e1e, 0x00393939, 0x002c2c2c, + 0x00a6a6a6, 0x00303030, 0x00e5e5e5, 0x00444444, 0x00fdfdfd, 0x00888888, + 0x009f9f9f, 0x00656565, 0x00878787, 0x006b6b6b, 0x00f4f4f4, 0x00232323, + 0x00484848, 0x00101010, 0x00d1d1d1, 0x00515151, 0x00c0c0c0, 0x00f9f9f9, + 0x00d2d2d2, 0x00a0a0a0, 0x00555555, 0x00a1a1a1, 0x00414141, 0x00fafafa, + 0x00434343, 0x00131313, 0x00c4c4c4, 0x002f2f2f, 0x00a8a8a8, 0x00b6b6b6, + 0x003c3c3c, 0x002b2b2b, 0x00c1c1c1, 0x00ffffff, 0x00c8c8c8, 0x00a5a5a5, + 0x00202020, 0x00898989, 0x00000000, 0x00909090, 0x00474747, 0x00efefef, + 0x00eaeaea, 0x00b7b7b7, 0x00151515, 0x00060606, 0x00cdcdcd, 0x00b5b5b5, + 0x00121212, 0x007e7e7e, 0x00bbbbbb, 0x00292929, 0x000f0f0f, 0x00b8b8b8, + 0x00070707, 0x00040404, 0x009b9b9b, 0x00949494, 0x00212121, 0x00666666, + 0x00e6e6e6, 0x00cecece, 0x00ededed, 0x00e7e7e7, 0x003b3b3b, 0x00fefefe, + 0x007f7f7f, 0x00c5c5c5, 0x00a4a4a4, 0x00373737, 0x00b1b1b1, 0x004c4c4c, + 0x00919191, 0x006e6e6e, 0x008d8d8d, 0x00767676, 0x00030303, 0x002d2d2d, + 0x00dedede, 0x00969696, 0x00262626, 0x007d7d7d, 0x00c6c6c6, 0x005c5c5c, + 0x00d3d3d3, 0x00f2f2f2, 0x004f4f4f, 0x00191919, 0x003f3f3f, 0x00dcdcdc, + 0x00797979, 0x001d1d1d, 0x00525252, 0x00ebebeb, 0x00f3f3f3, 0x006d6d6d, + 0x005e5e5e, 0x00fbfbfb, 0x00696969, 0x00b2b2b2, 0x00f0f0f0, 0x00313131, + 0x000c0c0c, 0x00d4d4d4, 0x00cfcfcf, 0x008c8c8c, 0x00e2e2e2, 0x00757575, + 0x00a9a9a9, 0x004a4a4a, 0x00575757, 0x00848484, 0x00111111, 0x00454545, + 0x001b1b1b, 0x00f5f5f5, 0x00e4e4e4, 0x000e0e0e, 0x00737373, 0x00aaaaaa, + 0x00f1f1f1, 0x00dddddd, 0x00595959, 0x00141414, 0x006c6c6c, 0x00929292, + 0x00545454, 0x00d0d0d0, 0x00787878, 0x00707070, 0x00e3e3e3, 0x00494949, + 0x00808080, 0x00505050, 0x00a7a7a7, 0x00f6f6f6, 0x00777777, 0x00939393, + 0x00868686, 0x00838383, 0x002a2a2a, 0x00c7c7c7, 0x005b5b5b, 0x00e9e9e9, + 0x00eeeeee, 0x008f8f8f, 0x00010101, 0x003d3d3d + }; + + private static readonly uint[] SBOX3_3033 = new uint[]{ + 0x38003838, 0x41004141, 0x16001616, 0x76007676, 0xd900d9d9, 0x93009393, + 0x60006060, 0xf200f2f2, 0x72007272, 0xc200c2c2, 0xab00abab, 0x9a009a9a, + 0x75007575, 0x06000606, 0x57005757, 0xa000a0a0, 0x91009191, 0xf700f7f7, + 0xb500b5b5, 0xc900c9c9, 0xa200a2a2, 0x8c008c8c, 0xd200d2d2, 0x90009090, + 0xf600f6f6, 0x07000707, 0xa700a7a7, 0x27002727, 0x8e008e8e, 0xb200b2b2, + 0x49004949, 0xde00dede, 0x43004343, 0x5c005c5c, 0xd700d7d7, 0xc700c7c7, + 0x3e003e3e, 0xf500f5f5, 0x8f008f8f, 0x67006767, 0x1f001f1f, 0x18001818, + 0x6e006e6e, 0xaf00afaf, 0x2f002f2f, 0xe200e2e2, 0x85008585, 0x0d000d0d, + 0x53005353, 0xf000f0f0, 0x9c009c9c, 0x65006565, 0xea00eaea, 0xa300a3a3, + 0xae00aeae, 0x9e009e9e, 0xec00ecec, 0x80008080, 0x2d002d2d, 0x6b006b6b, + 0xa800a8a8, 0x2b002b2b, 0x36003636, 0xa600a6a6, 0xc500c5c5, 0x86008686, + 0x4d004d4d, 0x33003333, 0xfd00fdfd, 0x66006666, 0x58005858, 0x96009696, + 0x3a003a3a, 0x09000909, 0x95009595, 0x10001010, 0x78007878, 0xd800d8d8, + 0x42004242, 0xcc00cccc, 0xef00efef, 0x26002626, 0xe500e5e5, 0x61006161, + 0x1a001a1a, 0x3f003f3f, 0x3b003b3b, 0x82008282, 0xb600b6b6, 0xdb00dbdb, + 0xd400d4d4, 0x98009898, 0xe800e8e8, 0x8b008b8b, 0x02000202, 0xeb00ebeb, + 0x0a000a0a, 0x2c002c2c, 0x1d001d1d, 0xb000b0b0, 0x6f006f6f, 0x8d008d8d, + 0x88008888, 0x0e000e0e, 0x19001919, 0x87008787, 0x4e004e4e, 0x0b000b0b, + 0xa900a9a9, 0x0c000c0c, 0x79007979, 0x11001111, 0x7f007f7f, 0x22002222, + 0xe700e7e7, 0x59005959, 0xe100e1e1, 0xda00dada, 0x3d003d3d, 0xc800c8c8, + 0x12001212, 0x04000404, 0x74007474, 0x54005454, 0x30003030, 0x7e007e7e, + 0xb400b4b4, 0x28002828, 0x55005555, 0x68006868, 0x50005050, 0xbe00bebe, + 0xd000d0d0, 0xc400c4c4, 0x31003131, 0xcb00cbcb, 0x2a002a2a, 0xad00adad, + 0x0f000f0f, 0xca00caca, 0x70007070, 0xff00ffff, 0x32003232, 0x69006969, + 0x08000808, 0x62006262, 0x00000000, 0x24002424, 0xd100d1d1, 0xfb00fbfb, + 0xba00baba, 0xed00eded, 0x45004545, 0x81008181, 0x73007373, 0x6d006d6d, + 0x84008484, 0x9f009f9f, 0xee00eeee, 0x4a004a4a, 0xc300c3c3, 0x2e002e2e, + 0xc100c1c1, 0x01000101, 0xe600e6e6, 0x25002525, 0x48004848, 0x99009999, + 0xb900b9b9, 0xb300b3b3, 0x7b007b7b, 0xf900f9f9, 0xce00cece, 0xbf00bfbf, + 0xdf00dfdf, 0x71007171, 0x29002929, 0xcd00cdcd, 0x6c006c6c, 0x13001313, + 0x64006464, 0x9b009b9b, 0x63006363, 0x9d009d9d, 0xc000c0c0, 0x4b004b4b, + 0xb700b7b7, 0xa500a5a5, 0x89008989, 0x5f005f5f, 0xb100b1b1, 0x17001717, + 0xf400f4f4, 0xbc00bcbc, 0xd300d3d3, 0x46004646, 0xcf00cfcf, 0x37003737, + 0x5e005e5e, 0x47004747, 0x94009494, 0xfa00fafa, 0xfc00fcfc, 0x5b005b5b, + 0x97009797, 0xfe00fefe, 0x5a005a5a, 0xac00acac, 0x3c003c3c, 0x4c004c4c, + 0x03000303, 0x35003535, 0xf300f3f3, 0x23002323, 0xb800b8b8, 0x5d005d5d, + 0x6a006a6a, 0x92009292, 0xd500d5d5, 0x21002121, 0x44004444, 0x51005151, + 0xc600c6c6, 0x7d007d7d, 0x39003939, 0x83008383, 0xdc00dcdc, 0xaa00aaaa, + 0x7c007c7c, 0x77007777, 0x56005656, 0x05000505, 0x1b001b1b, 0xa400a4a4, + 0x15001515, 0x34003434, 0x1e001e1e, 0x1c001c1c, 0xf800f8f8, 0x52005252, + 0x20002020, 0x14001414, 0xe900e9e9, 0xbd00bdbd, 0xdd00dddd, 0xe400e4e4, + 0xa100a1a1, 0xe000e0e0, 0x8a008a8a, 0xf100f1f1, 0xd600d6d6, 0x7a007a7a, + 0xbb00bbbb, 0xe300e3e3, 0x40004040, 0x4f004f4f + }; + + private static uint rightRotate(uint x, int s) + { + return ((x >> s) + (x << (32 - s))); + } + + private static uint leftRotate(uint x, int s) + { + return (x << s) + (x >> (32 - s)); + } + + private static void roldq(int rot, uint[] ki, int ioff, uint[] ko, int ooff) + { + ko[0 + ooff] = (ki[0 + ioff] << rot) | (ki[1 + ioff] >> (32 - rot)); + ko[1 + ooff] = (ki[1 + ioff] << rot) | (ki[2 + ioff] >> (32 - rot)); + ko[2 + ooff] = (ki[2 + ioff] << rot) | (ki[3 + ioff] >> (32 - rot)); + ko[3 + ooff] = (ki[3 + ioff] << rot) | (ki[0 + ioff] >> (32 - rot)); + ki[0 + ioff] = ko[0 + ooff]; + ki[1 + ioff] = ko[1 + ooff]; + ki[2 + ioff] = ko[2 + ooff]; + ki[3 + ioff] = ko[3 + ooff]; + } + + private static void decroldq(int rot, uint[] ki, int ioff, uint[] ko, int ooff) + { + ko[2 + ooff] = (ki[0 + ioff] << rot) | (ki[1 + ioff] >> (32 - rot)); + ko[3 + ooff] = (ki[1 + ioff] << rot) | (ki[2 + ioff] >> (32 - rot)); + ko[0 + ooff] = (ki[2 + ioff] << rot) | (ki[3 + ioff] >> (32 - rot)); + ko[1 + ooff] = (ki[3 + ioff] << rot) | (ki[0 + ioff] >> (32 - rot)); + ki[0 + ioff] = ko[2 + ooff]; + ki[1 + ioff] = ko[3 + ooff]; + ki[2 + ioff] = ko[0 + ooff]; + ki[3 + ioff] = ko[1 + ooff]; + } + + private static void roldqo32(int rot, uint[] ki, int ioff, uint[] ko, int ooff) + { + ko[0 + ooff] = (ki[1 + ioff] << (rot - 32)) | (ki[2 + ioff] >> (64 - rot)); + ko[1 + ooff] = (ki[2 + ioff] << (rot - 32)) | (ki[3 + ioff] >> (64 - rot)); + ko[2 + ooff] = (ki[3 + ioff] << (rot - 32)) | (ki[0 + ioff] >> (64 - rot)); + ko[3 + ooff] = (ki[0 + ioff] << (rot - 32)) | (ki[1 + ioff] >> (64 - rot)); + ki[0 + ioff] = ko[0 + ooff]; + ki[1 + ioff] = ko[1 + ooff]; + ki[2 + ioff] = ko[2 + ooff]; + ki[3 + ioff] = ko[3 + ooff]; + } + + private static void decroldqo32(int rot, uint[] ki, int ioff, uint[] ko, int ooff) + { + ko[2 + ooff] = (ki[1 + ioff] << (rot - 32)) | (ki[2 + ioff] >> (64 - rot)); + ko[3 + ooff] = (ki[2 + ioff] << (rot - 32)) | (ki[3 + ioff] >> (64 - rot)); + ko[0 + ooff] = (ki[3 + ioff] << (rot - 32)) | (ki[0 + ioff] >> (64 - rot)); + ko[1 + ooff] = (ki[0 + ioff] << (rot - 32)) | (ki[1 + ioff] >> (64 - rot)); + ki[0 + ioff] = ko[2 + ooff]; + ki[1 + ioff] = ko[3 + ooff]; + ki[2 + ioff] = ko[0 + ooff]; + ki[3 + ioff] = ko[1 + ooff]; + } + + private static uint bytes2uint(byte[] src, int offset) + { + uint word = 0; + for (int i = 0; i < 4; i++) + { + word = (word << 8) + (uint)src[i + offset]; + } + return word; + } + + private static void uint2bytes(uint word, byte[] dst, int offset) + { + for (int i = 0; i < 4; i++) + { + dst[(3 - i) + offset] = (byte)word; + word >>= 8; + } + } + + private static void camelliaF2(uint[] s, uint[] skey, int keyoff) + { + uint t1, t2, u, v; + + t1 = s[0] ^ skey[0 + keyoff]; + u = SBOX4_4404[(byte)t1]; + u ^= SBOX3_3033[(byte)(t1 >> 8)]; + u ^= SBOX2_0222[(byte)(t1 >> 16)]; + u ^= SBOX1_1110[(byte)(t1 >> 24)]; + t2 = s[1] ^ skey[1 + keyoff]; + v = SBOX1_1110[(byte)t2]; + v ^= SBOX4_4404[(byte)(t2 >> 8)]; + v ^= SBOX3_3033[(byte)(t2 >> 16)]; + v ^= SBOX2_0222[(byte)(t2 >> 24)]; + + s[2] ^= u ^ v; + s[3] ^= u ^ v ^ rightRotate(u, 8); + + t1 = s[2] ^ skey[2 + keyoff]; + u = SBOX4_4404[(byte)t1]; + u ^= SBOX3_3033[(byte)(t1 >> 8)]; + u ^= SBOX2_0222[(byte)(t1 >> 16)]; + u ^= SBOX1_1110[(byte)(t1 >> 24)]; + t2 = s[3] ^ skey[3 + keyoff]; + v = SBOX1_1110[(byte)t2]; + v ^= SBOX4_4404[(byte)(t2 >> 8)]; + v ^= SBOX3_3033[(byte)(t2 >> 16)]; + v ^= SBOX2_0222[(byte)(t2 >> 24)]; + + s[0] ^= u ^ v; + s[1] ^= u ^ v ^ rightRotate(u, 8); + } + + private static void camelliaFLs(uint[] s, uint[] fkey, int keyoff) + { + + s[1] ^= leftRotate(s[0] & fkey[0 + keyoff], 1); + s[0] ^= fkey[1 + keyoff] | s[1]; + + s[2] ^= fkey[3 + keyoff] | s[3]; + s[3] ^= leftRotate(fkey[2 + keyoff] & s[2], 1); + } + + private void setKey(bool forEncryption, byte[] key) + { + uint[] k = new uint[8]; + uint[] ka = new uint[4]; + uint[] kb = new uint[4]; + uint[] t = new uint[4]; + + switch (key.Length) + { + case 16: + _keyIs128 = true; + k[0] = bytes2uint(key, 0); + k[1] = bytes2uint(key, 4); + k[2] = bytes2uint(key, 8); + k[3] = bytes2uint(key, 12); + k[4] = k[5] = k[6] = k[7] = 0; + break; + case 24: + k[0] = bytes2uint(key, 0); + k[1] = bytes2uint(key, 4); + k[2] = bytes2uint(key, 8); + k[3] = bytes2uint(key, 12); + k[4] = bytes2uint(key, 16); + k[5] = bytes2uint(key, 20); + k[6] = ~k[4]; + k[7] = ~k[5]; + _keyIs128 = false; + break; + case 32: + k[0] = bytes2uint(key, 0); + k[1] = bytes2uint(key, 4); + k[2] = bytes2uint(key, 8); + k[3] = bytes2uint(key, 12); + k[4] = bytes2uint(key, 16); + k[5] = bytes2uint(key, 20); + k[6] = bytes2uint(key, 24); + k[7] = bytes2uint(key, 28); + _keyIs128 = false; + break; + default: + throw new ArgumentException("key sizes are only 16/24/32 bytes."); + } + + for (int i = 0; i < 4; i++) + { + ka[i] = k[i] ^ k[i + 4]; + } + /* compute KA */ + camelliaF2(ka, SIGMA, 0); + for (int i = 0; i < 4; i++) + { + ka[i] ^= k[i]; + } + camelliaF2(ka, SIGMA, 4); + + if (_keyIs128) + { + if (forEncryption) + { + /* KL dependant keys */ + kw[0] = k[0]; + kw[1] = k[1]; + kw[2] = k[2]; + kw[3] = k[3]; + roldq(15, k, 0, subkey, 4); + roldq(30, k, 0, subkey, 12); + roldq(15, k, 0, t, 0); + subkey[18] = t[2]; + subkey[19] = t[3]; + roldq(17, k, 0, ke, 4); + roldq(17, k, 0, subkey, 24); + roldq(17, k, 0, subkey, 32); + /* KA dependant keys */ + subkey[0] = ka[0]; + subkey[1] = ka[1]; + subkey[2] = ka[2]; + subkey[3] = ka[3]; + roldq(15, ka, 0, subkey, 8); + roldq(15, ka, 0, ke, 0); + roldq(15, ka, 0, t, 0); + subkey[16] = t[0]; + subkey[17] = t[1]; + roldq(15, ka, 0, subkey, 20); + roldqo32(34, ka, 0, subkey, 28); + roldq(17, ka, 0, kw, 4); + + } + else + { // decryption + /* KL dependant keys */ + kw[4] = k[0]; + kw[5] = k[1]; + kw[6] = k[2]; + kw[7] = k[3]; + decroldq(15, k, 0, subkey, 28); + decroldq(30, k, 0, subkey, 20); + decroldq(15, k, 0, t, 0); + subkey[16] = t[0]; + subkey[17] = t[1]; + decroldq(17, k, 0, ke, 0); + decroldq(17, k, 0, subkey, 8); + decroldq(17, k, 0, subkey, 0); + /* KA dependant keys */ + subkey[34] = ka[0]; + subkey[35] = ka[1]; + subkey[32] = ka[2]; + subkey[33] = ka[3]; + decroldq(15, ka, 0, subkey, 24); + decroldq(15, ka, 0, ke, 4); + decroldq(15, ka, 0, t, 0); + subkey[18] = t[2]; + subkey[19] = t[3]; + decroldq(15, ka, 0, subkey, 12); + decroldqo32(34, ka, 0, subkey, 4); + roldq(17, ka, 0, kw, 0); + } + } + else + { // 192bit or 256bit + /* compute KB */ + for (int i = 0; i < 4; i++) + { + kb[i] = ka[i] ^ k[i + 4]; + } + camelliaF2(kb, SIGMA, 8); + + if (forEncryption) + { + /* KL dependant keys */ + kw[0] = k[0]; + kw[1] = k[1]; + kw[2] = k[2]; + kw[3] = k[3]; + roldqo32(45, k, 0, subkey, 16); + roldq(15, k, 0, ke, 4); + roldq(17, k, 0, subkey, 32); + roldqo32(34, k, 0, subkey, 44); + /* KR dependant keys */ + roldq(15, k, 4, subkey, 4); + roldq(15, k, 4, ke, 0); + roldq(30, k, 4, subkey, 24); + roldqo32(34, k, 4, subkey, 36); + /* KA dependant keys */ + roldq(15, ka, 0, subkey, 8); + roldq(30, ka, 0, subkey, 20); + /* 32bit rotation */ + ke[8] = ka[1]; + ke[9] = ka[2]; + ke[10] = ka[3]; + ke[11] = ka[0]; + roldqo32(49, ka, 0, subkey, 40); + + /* KB dependant keys */ + subkey[0] = kb[0]; + subkey[1] = kb[1]; + subkey[2] = kb[2]; + subkey[3] = kb[3]; + roldq(30, kb, 0, subkey, 12); + roldq(30, kb, 0, subkey, 28); + roldqo32(51, kb, 0, kw, 4); + + } + else + { // decryption + /* KL dependant keys */ + kw[4] = k[0]; + kw[5] = k[1]; + kw[6] = k[2]; + kw[7] = k[3]; + decroldqo32(45, k, 0, subkey, 28); + decroldq(15, k, 0, ke, 4); + decroldq(17, k, 0, subkey, 12); + decroldqo32(34, k, 0, subkey, 0); + /* KR dependant keys */ + decroldq(15, k, 4, subkey, 40); + decroldq(15, k, 4, ke, 8); + decroldq(30, k, 4, subkey, 20); + decroldqo32(34, k, 4, subkey, 8); + /* KA dependant keys */ + decroldq(15, ka, 0, subkey, 36); + decroldq(30, ka, 0, subkey, 24); + /* 32bit rotation */ + ke[2] = ka[1]; + ke[3] = ka[2]; + ke[0] = ka[3]; + ke[1] = ka[0]; + decroldqo32(49, ka, 0, subkey, 4); + + /* KB dependant keys */ + subkey[46] = kb[0]; + subkey[47] = kb[1]; + subkey[44] = kb[2]; + subkey[45] = kb[3]; + decroldq(30, kb, 0, subkey, 32); + decroldq(30, kb, 0, subkey, 16); + roldqo32(51, kb, 0, kw, 0); + } + } + } + + private int processBlock128(byte[] input, int inOff, byte[] output, int outOff) + { + for (int i = 0; i < 4; i++) + { + state[i] = bytes2uint(input, inOff + (i * 4)); + state[i] ^= kw[i]; + } + + camelliaF2(state, subkey, 0); + camelliaF2(state, subkey, 4); + camelliaF2(state, subkey, 8); + camelliaFLs(state, ke, 0); + camelliaF2(state, subkey, 12); + camelliaF2(state, subkey, 16); + camelliaF2(state, subkey, 20); + camelliaFLs(state, ke, 4); + camelliaF2(state, subkey, 24); + camelliaF2(state, subkey, 28); + camelliaF2(state, subkey, 32); + + state[2] ^= kw[4]; + state[3] ^= kw[5]; + state[0] ^= kw[6]; + state[1] ^= kw[7]; + + uint2bytes(state[2], output, outOff); + uint2bytes(state[3], output, outOff + 4); + uint2bytes(state[0], output, outOff + 8); + uint2bytes(state[1], output, outOff + 12); + + return BLOCK_SIZE; + } + + private int processBlock192or256(byte[] input, int inOff, byte[] output, int outOff) + { + for (int i = 0; i < 4; i++) + { + state[i] = bytes2uint(input, inOff + (i * 4)); + state[i] ^= kw[i]; + } + + camelliaF2(state, subkey, 0); + camelliaF2(state, subkey, 4); + camelliaF2(state, subkey, 8); + camelliaFLs(state, ke, 0); + camelliaF2(state, subkey, 12); + camelliaF2(state, subkey, 16); + camelliaF2(state, subkey, 20); + camelliaFLs(state, ke, 4); + camelliaF2(state, subkey, 24); + camelliaF2(state, subkey, 28); + camelliaF2(state, subkey, 32); + camelliaFLs(state, ke, 8); + camelliaF2(state, subkey, 36); + camelliaF2(state, subkey, 40); + camelliaF2(state, subkey, 44); + + state[2] ^= kw[4]; + state[3] ^= kw[5]; + state[0] ^= kw[6]; + state[1] ^= kw[7]; + + uint2bytes(state[2], output, outOff); + uint2bytes(state[3], output, outOff + 4); + uint2bytes(state[0], output, outOff + 8); + uint2bytes(state[1], output, outOff + 12); + return BLOCK_SIZE; + } + + public CamelliaEngine() + { + } + + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("only simple KeyParameter expected."); + + setKey(forEncryption, ((KeyParameter)parameters).GetKey()); + + initialised = true; + } + + public virtual string AlgorithmName + { + get { return "Camellia"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (!initialised) + throw new InvalidOperationException("Camellia engine not initialised"); + + Check.DataLength(input, inOff, BLOCK_SIZE, "input buffer too short"); + Check.OutputLength(output, outOff, BLOCK_SIZE, "output buffer too short"); + + if (_keyIs128) + { + return processBlock128(input, inOff, output, outOff); + } + else + { + return processBlock192or256(input, inOff, output, outOff); + } + } + + public virtual void Reset() + { + // nothing + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaEngine.cs.meta new file mode 100644 index 00000000..a9d76d73 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f140d1eda7db7a44a1f175275ecc0f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaLightEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaLightEngine.cs new file mode 100644 index 00000000..d5502c90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaLightEngine.cs @@ -0,0 +1,584 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * Camellia - based on RFC 3713, smaller implementation, about half the size of CamelliaEngine. + */ + public class CamelliaLightEngine + : IBlockCipher + { + private const int BLOCK_SIZE = 16; +// private const int MASK8 = 0xff; + private bool initialised; + private bool _keyis128; + + private uint[] subkey = new uint[24 * 4]; + private uint[] kw = new uint[4 * 2]; // for whitening + private uint[] ke = new uint[6 * 2]; // for FL and FL^(-1) + private uint[] state = new uint[4]; // for encryption and decryption + + private static readonly uint[] SIGMA = { + 0xa09e667f, 0x3bcc908b, + 0xb67ae858, 0x4caa73b2, + 0xc6ef372f, 0xe94f82be, + 0x54ff53a5, 0xf1d36f1c, + 0x10e527fa, 0xde682d1d, + 0xb05688c2, 0xb3e6c1fd + }; + + /* + * + * S-box data + * + */ + private static readonly byte[] SBOX1 = { + (byte)112, (byte)130, (byte)44, (byte)236, + (byte)179, (byte)39, (byte)192, (byte)229, + (byte)228, (byte)133, (byte)87, (byte)53, + (byte)234, (byte)12, (byte)174, (byte)65, + (byte)35, (byte)239, (byte)107, (byte)147, + (byte)69, (byte)25, (byte)165, (byte)33, + (byte)237, (byte)14, (byte)79, (byte)78, + (byte)29, (byte)101, (byte)146, (byte)189, + (byte)134, (byte)184, (byte)175, (byte)143, + (byte)124, (byte)235, (byte)31, (byte)206, + (byte)62, (byte)48, (byte)220, (byte)95, + (byte)94, (byte)197, (byte)11, (byte)26, + (byte)166, (byte)225, (byte)57, (byte)202, + (byte)213, (byte)71, (byte)93, (byte)61, + (byte)217, (byte)1, (byte)90, (byte)214, + (byte)81, (byte)86, (byte)108, (byte)77, + (byte)139, (byte)13, (byte)154, (byte)102, + (byte)251, (byte)204, (byte)176, (byte)45, + (byte)116, (byte)18, (byte)43, (byte)32, + (byte)240, (byte)177, (byte)132, (byte)153, + (byte)223, (byte)76, (byte)203, (byte)194, + (byte)52, (byte)126, (byte)118, (byte)5, + (byte)109, (byte)183, (byte)169, (byte)49, + (byte)209, (byte)23, (byte)4, (byte)215, + (byte)20, (byte)88, (byte)58, (byte)97, + (byte)222, (byte)27, (byte)17, (byte)28, + (byte)50, (byte)15, (byte)156, (byte)22, + (byte)83, (byte)24, (byte)242, (byte)34, + (byte)254, (byte)68, (byte)207, (byte)178, + (byte)195, (byte)181, (byte)122, (byte)145, + (byte)36, (byte)8, (byte)232, (byte)168, + (byte)96, (byte)252, (byte)105, (byte)80, + (byte)170, (byte)208, (byte)160, (byte)125, + (byte)161, (byte)137, (byte)98, (byte)151, + (byte)84, (byte)91, (byte)30, (byte)149, + (byte)224, (byte)255, (byte)100, (byte)210, + (byte)16, (byte)196, (byte)0, (byte)72, + (byte)163, (byte)247, (byte)117, (byte)219, + (byte)138, (byte)3, (byte)230, (byte)218, + (byte)9, (byte)63, (byte)221, (byte)148, + (byte)135, (byte)92, (byte)131, (byte)2, + (byte)205, (byte)74, (byte)144, (byte)51, + (byte)115, (byte)103, (byte)246, (byte)243, + (byte)157, (byte)127, (byte)191, (byte)226, + (byte)82, (byte)155, (byte)216, (byte)38, + (byte)200, (byte)55, (byte)198, (byte)59, + (byte)129, (byte)150, (byte)111, (byte)75, + (byte)19, (byte)190, (byte)99, (byte)46, + (byte)233, (byte)121, (byte)167, (byte)140, + (byte)159, (byte)110, (byte)188, (byte)142, + (byte)41, (byte)245, (byte)249, (byte)182, + (byte)47, (byte)253, (byte)180, (byte)89, + (byte)120, (byte)152, (byte)6, (byte)106, + (byte)231, (byte)70, (byte)113, (byte)186, + (byte)212, (byte)37, (byte)171, (byte)66, + (byte)136, (byte)162, (byte)141, (byte)250, + (byte)114, (byte)7, (byte)185, (byte)85, + (byte)248, (byte)238, (byte)172, (byte)10, + (byte)54, (byte)73, (byte)42, (byte)104, + (byte)60, (byte)56, (byte)241, (byte)164, + (byte)64, (byte)40, (byte)211, (byte)123, + (byte)187, (byte)201, (byte)67, (byte)193, + (byte)21, (byte)227, (byte)173, (byte)244, + (byte)119, (byte)199, (byte)128, (byte)158 + }; + + private static uint rightRotate(uint x, int s) + { + return ((x >> s) + (x << (32 - s))); + } + + private static uint leftRotate(uint x, int s) + { + return (x << s) + (x >> (32 - s)); + } + + private static void roldq(int rot, uint[] ki, int ioff, uint[] ko, int ooff) + { + ko[0 + ooff] = (ki[0 + ioff] << rot) | (ki[1 + ioff] >> (32 - rot)); + ko[1 + ooff] = (ki[1 + ioff] << rot) | (ki[2 + ioff] >> (32 - rot)); + ko[2 + ooff] = (ki[2 + ioff] << rot) | (ki[3 + ioff] >> (32 - rot)); + ko[3 + ooff] = (ki[3 + ioff] << rot) | (ki[0 + ioff] >> (32 - rot)); + ki[0 + ioff] = ko[0 + ooff]; + ki[1 + ioff] = ko[1 + ooff]; + ki[2 + ioff] = ko[2 + ooff]; + ki[3 + ioff] = ko[3 + ooff]; + } + + private static void decroldq(int rot, uint[] ki, int ioff, uint[] ko, int ooff) + { + ko[2 + ooff] = (ki[0 + ioff] << rot) | (ki[1 + ioff] >> (32 - rot)); + ko[3 + ooff] = (ki[1 + ioff] << rot) | (ki[2 + ioff] >> (32 - rot)); + ko[0 + ooff] = (ki[2 + ioff] << rot) | (ki[3 + ioff] >> (32 - rot)); + ko[1 + ooff] = (ki[3 + ioff] << rot) | (ki[0 + ioff] >> (32 - rot)); + ki[0 + ioff] = ko[2 + ooff]; + ki[1 + ioff] = ko[3 + ooff]; + ki[2 + ioff] = ko[0 + ooff]; + ki[3 + ioff] = ko[1 + ooff]; + } + + private static void roldqo32(int rot, uint[] ki, int ioff, uint[] ko, int ooff) + { + ko[0 + ooff] = (ki[1 + ioff] << (rot - 32)) | (ki[2 + ioff] >> (64 - rot)); + ko[1 + ooff] = (ki[2 + ioff] << (rot - 32)) | (ki[3 + ioff] >> (64 - rot)); + ko[2 + ooff] = (ki[3 + ioff] << (rot - 32)) | (ki[0 + ioff] >> (64 - rot)); + ko[3 + ooff] = (ki[0 + ioff] << (rot - 32)) | (ki[1 + ioff] >> (64 - rot)); + ki[0 + ioff] = ko[0 + ooff]; + ki[1 + ioff] = ko[1 + ooff]; + ki[2 + ioff] = ko[2 + ooff]; + ki[3 + ioff] = ko[3 + ooff]; + } + + private static void decroldqo32(int rot, uint[] ki, int ioff, uint[] ko, int ooff) + { + ko[2 + ooff] = (ki[1 + ioff] << (rot - 32)) | (ki[2 + ioff] >> (64 - rot)); + ko[3 + ooff] = (ki[2 + ioff] << (rot - 32)) | (ki[3 + ioff] >> (64 - rot)); + ko[0 + ooff] = (ki[3 + ioff] << (rot - 32)) | (ki[0 + ioff] >> (64 - rot)); + ko[1 + ooff] = (ki[0 + ioff] << (rot - 32)) | (ki[1 + ioff] >> (64 - rot)); + ki[0 + ioff] = ko[2 + ooff]; + ki[1 + ioff] = ko[3 + ooff]; + ki[2 + ioff] = ko[0 + ooff]; + ki[3 + ioff] = ko[1 + ooff]; + } + + private static uint bytes2uint(byte[] src, int offset) + { + uint word = 0; + for (int i = 0; i < 4; i++) + { + word = (word << 8) + (uint)src[i + offset]; + } + return word; + } + + private static void uint2bytes(uint word, byte[] dst, int offset) + { + for (int i = 0; i < 4; i++) + { + dst[(3 - i) + offset] = (byte)word; + word >>= 8; + } + } + + private byte lRot8(byte v, int rot) + { + return (byte)(((uint)v << rot) | ((uint)v >> (8 - rot))); + } + + private uint sbox2(int x) + { + return (uint)lRot8(SBOX1[x], 1); + } + + private uint sbox3(int x) + { + return (uint)lRot8(SBOX1[x], 7); + } + + private uint sbox4(int x) + { + return (uint)SBOX1[lRot8((byte)x, 1)]; + } + + private void camelliaF2(uint[] s, uint[] skey, int keyoff) + { + uint t1, t2, u, v; + + t1 = s[0] ^ skey[0 + keyoff]; + u = sbox4((byte)t1); + u |= (sbox3((byte)(t1 >> 8)) << 8); + u |= (sbox2((byte)(t1 >> 16)) << 16); + u |= ((uint)(SBOX1[(byte)(t1 >> 24)]) << 24); + + t2 = s[1] ^ skey[1 + keyoff]; + v = (uint)SBOX1[(byte)t2]; + v |= (sbox4((byte)(t2 >> 8)) << 8); + v |= (sbox3((byte)(t2 >> 16)) << 16); + v |= (sbox2((byte)(t2 >> 24)) << 24); + + v = leftRotate(v, 8); + u ^= v; + v = leftRotate(v, 8) ^ u; + u = rightRotate(u, 8) ^ v; + s[2] ^= leftRotate(v, 16) ^ u; + s[3] ^= leftRotate(u, 8); + + t1 = s[2] ^ skey[2 + keyoff]; + u = sbox4((byte)t1); + u |= sbox3((byte)(t1 >> 8)) << 8; + u |= sbox2((byte)(t1 >> 16)) << 16; + u |= ((uint)SBOX1[(byte)(t1 >> 24)]) << 24; + + t2 = s[3] ^ skey[3 + keyoff]; + v = (uint)SBOX1[(byte)t2]; + v |= sbox4((byte)(t2 >> 8)) << 8; + v |= sbox3((byte)(t2 >> 16)) << 16; + v |= sbox2((byte)(t2 >> 24)) << 24; + + v = leftRotate(v, 8); + u ^= v; + v = leftRotate(v, 8) ^ u; + u = rightRotate(u, 8) ^ v; + s[0] ^= leftRotate(v, 16) ^ u; + s[1] ^= leftRotate(u, 8); + } + + private void camelliaFLs(uint[] s, uint[] fkey, int keyoff) + { + s[1] ^= leftRotate(s[0] & fkey[0 + keyoff], 1); + s[0] ^= fkey[1 + keyoff] | s[1]; + + s[2] ^= fkey[3 + keyoff] | s[3]; + s[3] ^= leftRotate(fkey[2 + keyoff] & s[2], 1); + } + + private void setKey(bool forEncryption, byte[] key) + { + uint[] k = new uint[8]; + uint[] ka = new uint[4]; + uint[] kb = new uint[4]; + uint[] t = new uint[4]; + + switch (key.Length) + { + case 16: + _keyis128 = true; + k[0] = bytes2uint(key, 0); + k[1] = bytes2uint(key, 4); + k[2] = bytes2uint(key, 8); + k[3] = bytes2uint(key, 12); + k[4] = k[5] = k[6] = k[7] = 0; + break; + case 24: + k[0] = bytes2uint(key, 0); + k[1] = bytes2uint(key, 4); + k[2] = bytes2uint(key, 8); + k[3] = bytes2uint(key, 12); + k[4] = bytes2uint(key, 16); + k[5] = bytes2uint(key, 20); + k[6] = ~k[4]; + k[7] = ~k[5]; + _keyis128 = false; + break; + case 32: + k[0] = bytes2uint(key, 0); + k[1] = bytes2uint(key, 4); + k[2] = bytes2uint(key, 8); + k[3] = bytes2uint(key, 12); + k[4] = bytes2uint(key, 16); + k[5] = bytes2uint(key, 20); + k[6] = bytes2uint(key, 24); + k[7] = bytes2uint(key, 28); + _keyis128 = false; + break; + default: + throw new ArgumentException("key sizes are only 16/24/32 bytes."); + } + + for (int i = 0; i < 4; i++) + { + ka[i] = k[i] ^ k[i + 4]; + } + /* compute KA */ + camelliaF2(ka, SIGMA, 0); + for (int i = 0; i < 4; i++) + { + ka[i] ^= k[i]; + } + camelliaF2(ka, SIGMA, 4); + + if (_keyis128) + { + if (forEncryption) + { + /* KL dependant keys */ + kw[0] = k[0]; + kw[1] = k[1]; + kw[2] = k[2]; + kw[3] = k[3]; + roldq(15, k, 0, subkey, 4); + roldq(30, k, 0, subkey, 12); + roldq(15, k, 0, t, 0); + subkey[18] = t[2]; + subkey[19] = t[3]; + roldq(17, k, 0, ke, 4); + roldq(17, k, 0, subkey, 24); + roldq(17, k, 0, subkey, 32); + /* KA dependant keys */ + subkey[0] = ka[0]; + subkey[1] = ka[1]; + subkey[2] = ka[2]; + subkey[3] = ka[3]; + roldq(15, ka, 0, subkey, 8); + roldq(15, ka, 0, ke, 0); + roldq(15, ka, 0, t, 0); + subkey[16] = t[0]; + subkey[17] = t[1]; + roldq(15, ka, 0, subkey, 20); + roldqo32(34, ka, 0, subkey, 28); + roldq(17, ka, 0, kw, 4); + + } + else + { // decryption + /* KL dependant keys */ + kw[4] = k[0]; + kw[5] = k[1]; + kw[6] = k[2]; + kw[7] = k[3]; + decroldq(15, k, 0, subkey, 28); + decroldq(30, k, 0, subkey, 20); + decroldq(15, k, 0, t, 0); + subkey[16] = t[0]; + subkey[17] = t[1]; + decroldq(17, k, 0, ke, 0); + decroldq(17, k, 0, subkey, 8); + decroldq(17, k, 0, subkey, 0); + /* KA dependant keys */ + subkey[34] = ka[0]; + subkey[35] = ka[1]; + subkey[32] = ka[2]; + subkey[33] = ka[3]; + decroldq(15, ka, 0, subkey, 24); + decroldq(15, ka, 0, ke, 4); + decroldq(15, ka, 0, t, 0); + subkey[18] = t[2]; + subkey[19] = t[3]; + decroldq(15, ka, 0, subkey, 12); + decroldqo32(34, ka, 0, subkey, 4); + roldq(17, ka, 0, kw, 0); + } + } + else + { // 192bit or 256bit + /* compute KB */ + for (int i = 0; i < 4; i++) + { + kb[i] = ka[i] ^ k[i + 4]; + } + camelliaF2(kb, SIGMA, 8); + + if (forEncryption) + { + /* KL dependant keys */ + kw[0] = k[0]; + kw[1] = k[1]; + kw[2] = k[2]; + kw[3] = k[3]; + roldqo32(45, k, 0, subkey, 16); + roldq(15, k, 0, ke, 4); + roldq(17, k, 0, subkey, 32); + roldqo32(34, k, 0, subkey, 44); + /* KR dependant keys */ + roldq(15, k, 4, subkey, 4); + roldq(15, k, 4, ke, 0); + roldq(30, k, 4, subkey, 24); + roldqo32(34, k, 4, subkey, 36); + /* KA dependant keys */ + roldq(15, ka, 0, subkey, 8); + roldq(30, ka, 0, subkey, 20); + /* 32bit rotation */ + ke[8] = ka[1]; + ke[9] = ka[2]; + ke[10] = ka[3]; + ke[11] = ka[0]; + roldqo32(49, ka, 0, subkey, 40); + + /* KB dependant keys */ + subkey[0] = kb[0]; + subkey[1] = kb[1]; + subkey[2] = kb[2]; + subkey[3] = kb[3]; + roldq(30, kb, 0, subkey, 12); + roldq(30, kb, 0, subkey, 28); + roldqo32(51, kb, 0, kw, 4); + + } + else + { // decryption + /* KL dependant keys */ + kw[4] = k[0]; + kw[5] = k[1]; + kw[6] = k[2]; + kw[7] = k[3]; + decroldqo32(45, k, 0, subkey, 28); + decroldq(15, k, 0, ke, 4); + decroldq(17, k, 0, subkey, 12); + decroldqo32(34, k, 0, subkey, 0); + /* KR dependant keys */ + decroldq(15, k, 4, subkey, 40); + decroldq(15, k, 4, ke, 8); + decroldq(30, k, 4, subkey, 20); + decroldqo32(34, k, 4, subkey, 8); + /* KA dependant keys */ + decroldq(15, ka, 0, subkey, 36); + decroldq(30, ka, 0, subkey, 24); + /* 32bit rotation */ + ke[2] = ka[1]; + ke[3] = ka[2]; + ke[0] = ka[3]; + ke[1] = ka[0]; + decroldqo32(49, ka, 0, subkey, 4); + + /* KB dependant keys */ + subkey[46] = kb[0]; + subkey[47] = kb[1]; + subkey[44] = kb[2]; + subkey[45] = kb[3]; + decroldq(30, kb, 0, subkey, 32); + decroldq(30, kb, 0, subkey, 16); + roldqo32(51, kb, 0, kw, 0); + } + } + } + + private int processBlock128(byte[] input, int inOff, byte[] output, int outOff) + { + for (int i = 0; i < 4; i++) + { + state[i] = bytes2uint(input, inOff + (i * 4)); + state[i] ^= kw[i]; + } + + camelliaF2(state, subkey, 0); + camelliaF2(state, subkey, 4); + camelliaF2(state, subkey, 8); + camelliaFLs(state, ke, 0); + camelliaF2(state, subkey, 12); + camelliaF2(state, subkey, 16); + camelliaF2(state, subkey, 20); + camelliaFLs(state, ke, 4); + camelliaF2(state, subkey, 24); + camelliaF2(state, subkey, 28); + camelliaF2(state, subkey, 32); + + state[2] ^= kw[4]; + state[3] ^= kw[5]; + state[0] ^= kw[6]; + state[1] ^= kw[7]; + + uint2bytes(state[2], output, outOff); + uint2bytes(state[3], output, outOff + 4); + uint2bytes(state[0], output, outOff + 8); + uint2bytes(state[1], output, outOff + 12); + + return BLOCK_SIZE; + } + + private int processBlock192or256(byte[] input, int inOff, byte[] output, int outOff) + { + for (int i = 0; i < 4; i++) + { + state[i] = bytes2uint(input, inOff + (i * 4)); + state[i] ^= kw[i]; + } + + camelliaF2(state, subkey, 0); + camelliaF2(state, subkey, 4); + camelliaF2(state, subkey, 8); + camelliaFLs(state, ke, 0); + camelliaF2(state, subkey, 12); + camelliaF2(state, subkey, 16); + camelliaF2(state, subkey, 20); + camelliaFLs(state, ke, 4); + camelliaF2(state, subkey, 24); + camelliaF2(state, subkey, 28); + camelliaF2(state, subkey, 32); + camelliaFLs(state, ke, 8); + camelliaF2(state, subkey, 36); + camelliaF2(state, subkey, 40); + camelliaF2(state, subkey, 44); + + state[2] ^= kw[4]; + state[3] ^= kw[5]; + state[0] ^= kw[6]; + state[1] ^= kw[7]; + + uint2bytes(state[2], output, outOff); + uint2bytes(state[3], output, outOff + 4); + uint2bytes(state[0], output, outOff + 8); + uint2bytes(state[1], output, outOff + 12); + return BLOCK_SIZE; + } + + public CamelliaLightEngine() + { + initialised = false; + } + + public virtual string AlgorithmName + { + get { return "Camellia"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("only simple KeyParameter expected."); + + setKey(forEncryption, ((KeyParameter)parameters).GetKey()); + + initialised = true; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (!initialised) + throw new InvalidOperationException("Camellia engine not initialised"); + + Check.DataLength(input, inOff, BLOCK_SIZE, "input buffer too short"); + Check.OutputLength(output, outOff, BLOCK_SIZE, "output buffer too short"); + + if (_keyis128) + { + return processBlock128(input, inOff, output, outOff); + } + else + { + return processBlock192or256(input, inOff, output, outOff); + } + } + + public virtual void Reset() + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaLightEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaLightEngine.cs.meta new file mode 100644 index 00000000..4bad1d4b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaLightEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 95526c47cb1ea984ba143e6f98be7455 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaWrapEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaWrapEngine.cs new file mode 100644 index 00000000..fc362673 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaWrapEngine.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// + /// An implementation of the Camellia key wrapper based on RFC 3657/RFC 3394. + ///

+ /// For further details see: http://www.ietf.org/rfc/rfc3657.txt. + /// + public class CamelliaWrapEngine + : Rfc3394WrapEngine + { + public CamelliaWrapEngine() + : base(new CamelliaEngine()) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaWrapEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaWrapEngine.cs.meta new file mode 100644 index 00000000..f0ca40a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/CamelliaWrapEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b75fafaaa8f1b1041ae39378d6ce4a00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast5Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast5Engine.cs new file mode 100644 index 00000000..1c5eb9d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast5Engine.cs @@ -0,0 +1,806 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * A class that provides CAST key encryption operations, + * such as encoding data and generating keys. + * + * All the algorithms herein are from the Internet RFC's + * + * RFC2144 - Cast5 (64bit block, 40-128bit key) + * RFC2612 - CAST6 (128bit block, 128-256bit key) + * + * and implement a simplified cryptography interface. + */ + public class Cast5Engine + : IBlockCipher + { + private static readonly uint[] S1 = + { + 0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949, + 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e, + 0x28683b6f, 0xc07fd059, 0xff2379c8, 0x775f50e2, 0x43c340d3, 0xdf2f8656, 0x887ca41a, 0xa2d2bd2d, + 0xa1c9e0d6, 0x346c4819, 0x61b76d87, 0x22540f2f, 0x2abe32e1, 0xaa54166b, 0x22568e3a, 0xa2d341d0, + 0x66db40c8, 0xa784392f, 0x004dff2f, 0x2db9d2de, 0x97943fac, 0x4a97c1d8, 0x527644b7, 0xb5f437a7, + 0xb82cbaef, 0xd751d159, 0x6ff7f0ed, 0x5a097a1f, 0x827b68d0, 0x90ecf52e, 0x22b0c054, 0xbc8e5935, + 0x4b6d2f7f, 0x50bb64a2, 0xd2664910, 0xbee5812d, 0xb7332290, 0xe93b159f, 0xb48ee411, 0x4bff345d, + 0xfd45c240, 0xad31973f, 0xc4f6d02e, 0x55fc8165, 0xd5b1caad, 0xa1ac2dae, 0xa2d4b76d, 0xc19b0c50, + 0x882240f2, 0x0c6e4f38, 0xa4e4bfd7, 0x4f5ba272, 0x564c1d2f, 0xc59c5319, 0xb949e354, 0xb04669fe, + 0xb1b6ab8a, 0xc71358dd, 0x6385c545, 0x110f935d, 0x57538ad5, 0x6a390493, 0xe63d37e0, 0x2a54f6b3, + 0x3a787d5f, 0x6276a0b5, 0x19a6fcdf, 0x7a42206a, 0x29f9d4d5, 0xf61b1891, 0xbb72275e, 0xaa508167, + 0x38901091, 0xc6b505eb, 0x84c7cb8c, 0x2ad75a0f, 0x874a1427, 0xa2d1936b, 0x2ad286af, 0xaa56d291, + 0xd7894360, 0x425c750d, 0x93b39e26, 0x187184c9, 0x6c00b32d, 0x73e2bb14, 0xa0bebc3c, 0x54623779, + 0x64459eab, 0x3f328b82, 0x7718cf82, 0x59a2cea6, 0x04ee002e, 0x89fe78e6, 0x3fab0950, 0x325ff6c2, + 0x81383f05, 0x6963c5c8, 0x76cb5ad6, 0xd49974c9, 0xca180dcf, 0x380782d5, 0xc7fa5cf6, 0x8ac31511, + 0x35e79e13, 0x47da91d0, 0xf40f9086, 0xa7e2419e, 0x31366241, 0x051ef495, 0xaa573b04, 0x4a805d8d, + 0x548300d0, 0x00322a3c, 0xbf64cddf, 0xba57a68e, 0x75c6372b, 0x50afd341, 0xa7c13275, 0x915a0bf5, + 0x6b54bfab, 0x2b0b1426, 0xab4cc9d7, 0x449ccd82, 0xf7fbf265, 0xab85c5f3, 0x1b55db94, 0xaad4e324, + 0xcfa4bd3f, 0x2deaa3e2, 0x9e204d02, 0xc8bd25ac, 0xeadf55b3, 0xd5bd9e98, 0xe31231b2, 0x2ad5ad6c, + 0x954329de, 0xadbe4528, 0xd8710f69, 0xaa51c90f, 0xaa786bf6, 0x22513f1e, 0xaa51a79b, 0x2ad344cc, + 0x7b5a41f0, 0xd37cfbad, 0x1b069505, 0x41ece491, 0xb4c332e6, 0x032268d4, 0xc9600acc, 0xce387e6d, + 0xbf6bb16c, 0x6a70fb78, 0x0d03d9c9, 0xd4df39de, 0xe01063da, 0x4736f464, 0x5ad328d8, 0xb347cc96, + 0x75bb0fc3, 0x98511bfb, 0x4ffbcc35, 0xb58bcf6a, 0xe11f0abc, 0xbfc5fe4a, 0xa70aec10, 0xac39570a, + 0x3f04442f, 0x6188b153, 0xe0397a2e, 0x5727cb79, 0x9ceb418f, 0x1cacd68d, 0x2ad37c96, 0x0175cb9d, + 0xc69dff09, 0xc75b65f0, 0xd9db40d8, 0xec0e7779, 0x4744ead4, 0xb11c3274, 0xdd24cb9e, 0x7e1c54bd, + 0xf01144f9, 0xd2240eb1, 0x9675b3fd, 0xa3ac3755, 0xd47c27af, 0x51c85f4d, 0x56907596, 0xa5bb15e6, + 0x580304f0, 0xca042cf1, 0x011a37ea, 0x8dbfaadb, 0x35ba3e4a, 0x3526ffa0, 0xc37b4d09, 0xbc306ed9, + 0x98a52666, 0x5648f725, 0xff5e569d, 0x0ced63d0, 0x7c63b2cf, 0x700b45e1, 0xd5ea50f1, 0x85a92872, + 0xaf1fbda7, 0xd4234870, 0xa7870bf3, 0x2d3b4d79, 0x42e04198, 0x0cd0ede7, 0x26470db8, 0xf881814c, + 0x474d6ad7, 0x7c0c5e5c, 0xd1231959, 0x381b7298, 0xf5d2f4db, 0xab838653, 0x6e2f1e23, 0x83719c9e, + 0xbd91e046, 0x9a56456e, 0xdc39200c, 0x20c8c571, 0x962bda1c, 0xe1e696ff, 0xb141ab08, 0x7cca89b9, + 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf + }, + S2 = + { + 0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 0xeec5207a, 0x55889c94, 0x72fc0651, + 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 0x5f0c0794, 0x18dcdb7d, 0xa1d6eff3, + 0xa0b52f7b, 0x59e83605, 0xee15b094, 0xe9ffd909, 0xdc440086, 0xef944459, 0xba83ccb3, 0xe0c3cdfb, + 0xd1da4181, 0x3b092ab1, 0xf997f1c1, 0xa5e6cf7b, 0x01420ddb, 0xe4e7ef5b, 0x25a1ff41, 0xe180f806, + 0x1fc41080, 0x179bee7a, 0xd37ac6a9, 0xfe5830a4, 0x98de8b7f, 0x77e83f4e, 0x79929269, 0x24fa9f7b, + 0xe113c85b, 0xacc40083, 0xd7503525, 0xf7ea615f, 0x62143154, 0x0d554b63, 0x5d681121, 0xc866c359, + 0x3d63cf73, 0xcee234c0, 0xd4d87e87, 0x5c672b21, 0x071f6181, 0x39f7627f, 0x361e3084, 0xe4eb573b, + 0x602f64a4, 0xd63acd9c, 0x1bbc4635, 0x9e81032d, 0x2701f50c, 0x99847ab4, 0xa0e3df79, 0xba6cf38c, + 0x10843094, 0x2537a95e, 0xf46f6ffe, 0xa1ff3b1f, 0x208cfb6a, 0x8f458c74, 0xd9e0a227, 0x4ec73a34, + 0xfc884f69, 0x3e4de8df, 0xef0e0088, 0x3559648d, 0x8a45388c, 0x1d804366, 0x721d9bfd, 0xa58684bb, + 0xe8256333, 0x844e8212, 0x128d8098, 0xfed33fb4, 0xce280ae1, 0x27e19ba5, 0xd5a6c252, 0xe49754bd, + 0xc5d655dd, 0xeb667064, 0x77840b4d, 0xa1b6a801, 0x84db26a9, 0xe0b56714, 0x21f043b7, 0xe5d05860, + 0x54f03084, 0x066ff472, 0xa31aa153, 0xdadc4755, 0xb5625dbf, 0x68561be6, 0x83ca6b94, 0x2d6ed23b, + 0xeccf01db, 0xa6d3d0ba, 0xb6803d5c, 0xaf77a709, 0x33b4a34c, 0x397bc8d6, 0x5ee22b95, 0x5f0e5304, + 0x81ed6f61, 0x20e74364, 0xb45e1378, 0xde18639b, 0x881ca122, 0xb96726d1, 0x8049a7e8, 0x22b7da7b, + 0x5e552d25, 0x5272d237, 0x79d2951c, 0xc60d894c, 0x488cb402, 0x1ba4fe5b, 0xa4b09f6b, 0x1ca815cf, + 0xa20c3005, 0x8871df63, 0xb9de2fcb, 0x0cc6c9e9, 0x0beeff53, 0xe3214517, 0xb4542835, 0x9f63293c, + 0xee41e729, 0x6e1d2d7c, 0x50045286, 0x1e6685f3, 0xf33401c6, 0x30a22c95, 0x31a70850, 0x60930f13, + 0x73f98417, 0xa1269859, 0xec645c44, 0x52c877a9, 0xcdff33a6, 0xa02b1741, 0x7cbad9a2, 0x2180036f, + 0x50d99c08, 0xcb3f4861, 0xc26bd765, 0x64a3f6ab, 0x80342676, 0x25a75e7b, 0xe4e6d1fc, 0x20c710e6, + 0xcdf0b680, 0x17844d3b, 0x31eef84d, 0x7e0824e4, 0x2ccb49eb, 0x846a3bae, 0x8ff77888, 0xee5d60f6, + 0x7af75673, 0x2fdd5cdb, 0xa11631c1, 0x30f66f43, 0xb3faec54, 0x157fd7fa, 0xef8579cc, 0xd152de58, + 0xdb2ffd5e, 0x8f32ce19, 0x306af97a, 0x02f03ef8, 0x99319ad5, 0xc242fa0f, 0xa7e3ebb0, 0xc68e4906, + 0xb8da230c, 0x80823028, 0xdcdef3c8, 0xd35fb171, 0x088a1bc8, 0xbec0c560, 0x61a3c9e8, 0xbca8f54d, + 0xc72feffa, 0x22822e99, 0x82c570b4, 0xd8d94e89, 0x8b1c34bc, 0x301e16e6, 0x273be979, 0xb0ffeaa6, + 0x61d9b8c6, 0x00b24869, 0xb7ffce3f, 0x08dc283b, 0x43daf65a, 0xf7e19798, 0x7619b72f, 0x8f1c9ba4, + 0xdc8637a0, 0x16a7d3b1, 0x9fc393b7, 0xa7136eeb, 0xc6bcc63e, 0x1a513742, 0xef6828bc, 0x520365d6, + 0x2d6a77ab, 0x3527ed4b, 0x821fd216, 0x095c6e2e, 0xdb92f2fb, 0x5eea29cb, 0x145892f5, 0x91584f7f, + 0x5483697b, 0x2667a8cc, 0x85196048, 0x8c4bacea, 0x833860d4, 0x0d23e0f9, 0x6c387e8a, 0x0ae6d249, + 0xb284600c, 0xd835731d, 0xdcb1c647, 0xac4c56ea, 0x3ebd81b3, 0x230eabb0, 0x6438bc87, 0xf0b5b1fa, + 0x8f5ea2b3, 0xfc184642, 0x0a036b7a, 0x4fb089bd, 0x649da589, 0xa345415e, 0x5c038323, 0x3e5d3bb9, + 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1 + }, + S3 = + { + 0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 0x369fe44b, 0x8c1fc644, 0xaececa90, + 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 0xf0ad0548, 0xe13c8d83, 0x927010d5, + 0x11107d9f, 0x07647db9, 0xb2e3e4d4, 0x3d4f285e, 0xb9afa820, 0xfade82e0, 0xa067268b, 0x8272792e, + 0x553fb2c0, 0x489ae22b, 0xd4ef9794, 0x125e3fbc, 0x21fffcee, 0x825b1bfd, 0x9255c5ed, 0x1257a240, + 0x4e1a8302, 0xbae07fff, 0x528246e7, 0x8e57140e, 0x3373f7bf, 0x8c9f8188, 0xa6fc4ee8, 0xc982b5a5, + 0xa8c01db7, 0x579fc264, 0x67094f31, 0xf2bd3f5f, 0x40fff7c1, 0x1fb78dfc, 0x8e6bd2c1, 0x437be59b, + 0x99b03dbf, 0xb5dbc64b, 0x638dc0e6, 0x55819d99, 0xa197c81c, 0x4a012d6e, 0xc5884a28, 0xccc36f71, + 0xb843c213, 0x6c0743f1, 0x8309893c, 0x0feddd5f, 0x2f7fe850, 0xd7c07f7e, 0x02507fbf, 0x5afb9a04, + 0xa747d2d0, 0x1651192e, 0xaf70bf3e, 0x58c31380, 0x5f98302e, 0x727cc3c4, 0x0a0fb402, 0x0f7fef82, + 0x8c96fdad, 0x5d2c2aae, 0x8ee99a49, 0x50da88b8, 0x8427f4a0, 0x1eac5790, 0x796fb449, 0x8252dc15, + 0xefbd7d9b, 0xa672597d, 0xada840d8, 0x45f54504, 0xfa5d7403, 0xe83ec305, 0x4f91751a, 0x925669c2, + 0x23efe941, 0xa903f12e, 0x60270df2, 0x0276e4b6, 0x94fd6574, 0x927985b2, 0x8276dbcb, 0x02778176, + 0xf8af918d, 0x4e48f79e, 0x8f616ddf, 0xe29d840e, 0x842f7d83, 0x340ce5c8, 0x96bbb682, 0x93b4b148, + 0xef303cab, 0x984faf28, 0x779faf9b, 0x92dc560d, 0x224d1e20, 0x8437aa88, 0x7d29dc96, 0x2756d3dc, + 0x8b907cee, 0xb51fd240, 0xe7c07ce3, 0xe566b4a1, 0xc3e9615e, 0x3cf8209d, 0x6094d1e3, 0xcd9ca341, + 0x5c76460e, 0x00ea983b, 0xd4d67881, 0xfd47572c, 0xf76cedd9, 0xbda8229c, 0x127dadaa, 0x438a074e, + 0x1f97c090, 0x081bdb8a, 0x93a07ebe, 0xb938ca15, 0x97b03cff, 0x3dc2c0f8, 0x8d1ab2ec, 0x64380e51, + 0x68cc7bfb, 0xd90f2788, 0x12490181, 0x5de5ffd4, 0xdd7ef86a, 0x76a2e214, 0xb9a40368, 0x925d958f, + 0x4b39fffa, 0xba39aee9, 0xa4ffd30b, 0xfaf7933b, 0x6d498623, 0x193cbcfa, 0x27627545, 0x825cf47a, + 0x61bd8ba0, 0xd11e42d1, 0xcead04f4, 0x127ea392, 0x10428db7, 0x8272a972, 0x9270c4a8, 0x127de50b, + 0x285ba1c8, 0x3c62f44f, 0x35c0eaa5, 0xe805d231, 0x428929fb, 0xb4fcdf82, 0x4fb66a53, 0x0e7dc15b, + 0x1f081fab, 0x108618ae, 0xfcfd086d, 0xf9ff2889, 0x694bcc11, 0x236a5cae, 0x12deca4d, 0x2c3f8cc5, + 0xd2d02dfe, 0xf8ef5896, 0xe4cf52da, 0x95155b67, 0x494a488c, 0xb9b6a80c, 0x5c8f82bc, 0x89d36b45, + 0x3a609437, 0xec00c9a9, 0x44715253, 0x0a874b49, 0xd773bc40, 0x7c34671c, 0x02717ef6, 0x4feb5536, + 0xa2d02fff, 0xd2bf60c4, 0xd43f03c0, 0x50b4ef6d, 0x07478cd1, 0x006e1888, 0xa2e53f55, 0xb9e6d4bc, + 0xa2048016, 0x97573833, 0xd7207d67, 0xde0f8f3d, 0x72f87b33, 0xabcc4f33, 0x7688c55d, 0x7b00a6b0, + 0x947b0001, 0x570075d2, 0xf9bb88f8, 0x8942019e, 0x4264a5ff, 0x856302e0, 0x72dbd92b, 0xee971b69, + 0x6ea22fde, 0x5f08ae2b, 0xaf7a616d, 0xe5c98767, 0xcf1febd2, 0x61efc8c2, 0xf1ac2571, 0xcc8239c2, + 0x67214cb8, 0xb1e583d1, 0xb7dc3e62, 0x7f10bdce, 0xf90a5c38, 0x0ff0443d, 0x606e6dc6, 0x60543a49, + 0x5727c148, 0x2be98a1d, 0x8ab41738, 0x20e1be24, 0xaf96da0f, 0x68458425, 0x99833be5, 0x600d457d, + 0x282f9350, 0x8334b362, 0xd91d1120, 0x2b6d8da0, 0x642b1e31, 0x9c305a00, 0x52bce688, 0x1b03588a, + 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783 + }, + S4 = + { + 0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 0x64ad8c57, 0x85510443, 0xfa020ed1, + 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 0x6497b7b1, 0xf3641f63, 0x241e4adf, + 0x28147f5f, 0x4fa2b8cd, 0xc9430040, 0x0cc32220, 0xfdd30b30, 0xc0a5374f, 0x1d2d00d9, 0x24147b15, + 0xee4d111a, 0x0fca5167, 0x71ff904c, 0x2d195ffe, 0x1a05645f, 0x0c13fefe, 0x081b08ca, 0x05170121, + 0x80530100, 0xe83e5efe, 0xac9af4f8, 0x7fe72701, 0xd2b8ee5f, 0x06df4261, 0xbb9e9b8a, 0x7293ea25, + 0xce84ffdf, 0xf5718801, 0x3dd64b04, 0xa26f263b, 0x7ed48400, 0x547eebe6, 0x446d4ca0, 0x6cf3d6f5, + 0x2649abdf, 0xaea0c7f5, 0x36338cc1, 0x503f7e93, 0xd3772061, 0x11b638e1, 0x72500e03, 0xf80eb2bb, + 0xabe0502e, 0xec8d77de, 0x57971e81, 0xe14f6746, 0xc9335400, 0x6920318f, 0x081dbb99, 0xffc304a5, + 0x4d351805, 0x7f3d5ce3, 0xa6c866c6, 0x5d5bcca9, 0xdaec6fea, 0x9f926f91, 0x9f46222f, 0x3991467d, + 0xa5bf6d8e, 0x1143c44f, 0x43958302, 0xd0214eeb, 0x022083b8, 0x3fb6180c, 0x18f8931e, 0x281658e6, + 0x26486e3e, 0x8bd78a70, 0x7477e4c1, 0xb506e07c, 0xf32d0a25, 0x79098b02, 0xe4eabb81, 0x28123b23, + 0x69dead38, 0x1574ca16, 0xdf871b62, 0x211c40b7, 0xa51a9ef9, 0x0014377b, 0x041e8ac8, 0x09114003, + 0xbd59e4d2, 0xe3d156d5, 0x4fe876d5, 0x2f91a340, 0x557be8de, 0x00eae4a7, 0x0ce5c2ec, 0x4db4bba6, + 0xe756bdff, 0xdd3369ac, 0xec17b035, 0x06572327, 0x99afc8b0, 0x56c8c391, 0x6b65811c, 0x5e146119, + 0x6e85cb75, 0xbe07c002, 0xc2325577, 0x893ff4ec, 0x5bbfc92d, 0xd0ec3b25, 0xb7801ab7, 0x8d6d3b24, + 0x20c763ef, 0xc366a5fc, 0x9c382880, 0x0ace3205, 0xaac9548a, 0xeca1d7c7, 0x041afa32, 0x1d16625a, + 0x6701902c, 0x9b757a54, 0x31d477f7, 0x9126b031, 0x36cc6fdb, 0xc70b8b46, 0xd9e66a48, 0x56e55a79, + 0x026a4ceb, 0x52437eff, 0x2f8f76b4, 0x0df980a5, 0x8674cde3, 0xedda04eb, 0x17a9be04, 0x2c18f4df, + 0xb7747f9d, 0xab2af7b4, 0xefc34d20, 0x2e096b7c, 0x1741a254, 0xe5b6a035, 0x213d42f6, 0x2c1c7c26, + 0x61c2f50f, 0x6552daf9, 0xd2c231f8, 0x25130f69, 0xd8167fa2, 0x0418f2c8, 0x001a96a6, 0x0d1526ab, + 0x63315c21, 0x5e0a72ec, 0x49bafefd, 0x187908d9, 0x8d0dbd86, 0x311170a7, 0x3e9b640c, 0xcc3e10d7, + 0xd5cad3b6, 0x0caec388, 0xf73001e1, 0x6c728aff, 0x71eae2a1, 0x1f9af36e, 0xcfcbd12f, 0xc1de8417, + 0xac07be6b, 0xcb44a1d8, 0x8b9b0f56, 0x013988c3, 0xb1c52fca, 0xb4be31cd, 0xd8782806, 0x12a3a4e2, + 0x6f7de532, 0x58fd7eb6, 0xd01ee900, 0x24adffc2, 0xf4990fc5, 0x9711aac5, 0x001d7b95, 0x82e5e7d2, + 0x109873f6, 0x00613096, 0xc32d9521, 0xada121ff, 0x29908415, 0x7fbb977f, 0xaf9eb3db, 0x29c9ed2a, + 0x5ce2a465, 0xa730f32c, 0xd0aa3fe8, 0x8a5cc091, 0xd49e2ce7, 0x0ce454a9, 0xd60acd86, 0x015f1919, + 0x77079103, 0xdea03af6, 0x78a8565e, 0xdee356df, 0x21f05cbe, 0x8b75e387, 0xb3c50651, 0xb8a5c3ef, + 0xd8eeb6d2, 0xe523be77, 0xc2154529, 0x2f69efdf, 0xafe67afb, 0xf470c4b2, 0xf3e0eb5b, 0xd6cc9876, + 0x39e4460c, 0x1fda8538, 0x1987832f, 0xca007367, 0xa99144f8, 0x296b299e, 0x492fc295, 0x9266beab, + 0xb5676e69, 0x9bd3ddda, 0xdf7e052f, 0xdb25701c, 0x1b5e51ee, 0xf65324e6, 0x6afce36c, 0x0316cc04, + 0x8644213e, 0xb7dc59d0, 0x7965291f, 0xccd6fd43, 0x41823979, 0x932bcdf6, 0xb657c34d, 0x4edfd282, + 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2 + }, + S5 = + { + 0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff, 0x1dd358f5, 0x44dd9d44, 0x1731167f, + 0x08fbf1fa, 0xe7f511cc, 0xd2051b00, 0x735aba00, 0x2ab722d8, 0x386381cb, 0xacf6243a, 0x69befd7a, + 0xe6a2e77f, 0xf0c720cd, 0xc4494816, 0xccf5c180, 0x38851640, 0x15b0a848, 0xe68b18cb, 0x4caadeff, + 0x5f480a01, 0x0412b2aa, 0x259814fc, 0x41d0efe2, 0x4e40b48d, 0x248eb6fb, 0x8dba1cfe, 0x41a99b02, + 0x1a550a04, 0xba8f65cb, 0x7251f4e7, 0x95a51725, 0xc106ecd7, 0x97a5980a, 0xc539b9aa, 0x4d79fe6a, + 0xf2f3f763, 0x68af8040, 0xed0c9e56, 0x11b4958b, 0xe1eb5a88, 0x8709e6b0, 0xd7e07156, 0x4e29fea7, + 0x6366e52d, 0x02d1c000, 0xc4ac8e05, 0x9377f571, 0x0c05372a, 0x578535f2, 0x2261be02, 0xd642a0c9, + 0xdf13a280, 0x74b55bd2, 0x682199c0, 0xd421e5ec, 0x53fb3ce8, 0xc8adedb3, 0x28a87fc9, 0x3d959981, + 0x5c1ff900, 0xfe38d399, 0x0c4eff0b, 0x062407ea, 0xaa2f4fb1, 0x4fb96976, 0x90c79505, 0xb0a8a774, + 0xef55a1ff, 0xe59ca2c2, 0xa6b62d27, 0xe66a4263, 0xdf65001f, 0x0ec50966, 0xdfdd55bc, 0x29de0655, + 0x911e739a, 0x17af8975, 0x32c7911c, 0x89f89468, 0x0d01e980, 0x524755f4, 0x03b63cc9, 0x0cc844b2, + 0xbcf3f0aa, 0x87ac36e9, 0xe53a7426, 0x01b3d82b, 0x1a9e7449, 0x64ee2d7e, 0xcddbb1da, 0x01c94910, + 0xb868bf80, 0x0d26f3fd, 0x9342ede7, 0x04a5c284, 0x636737b6, 0x50f5b616, 0xf24766e3, 0x8eca36c1, + 0x136e05db, 0xfef18391, 0xfb887a37, 0xd6e7f7d4, 0xc7fb7dc9, 0x3063fcdf, 0xb6f589de, 0xec2941da, + 0x26e46695, 0xb7566419, 0xf654efc5, 0xd08d58b7, 0x48925401, 0xc1bacb7f, 0xe5ff550f, 0xb6083049, + 0x5bb5d0e8, 0x87d72e5a, 0xab6a6ee1, 0x223a66ce, 0xc62bf3cd, 0x9e0885f9, 0x68cb3e47, 0x086c010f, + 0xa21de820, 0xd18b69de, 0xf3f65777, 0xfa02c3f6, 0x407edac3, 0xcbb3d550, 0x1793084d, 0xb0d70eba, + 0x0ab378d5, 0xd951fb0c, 0xded7da56, 0x4124bbe4, 0x94ca0b56, 0x0f5755d1, 0xe0e1e56e, 0x6184b5be, + 0x580a249f, 0x94f74bc0, 0xe327888e, 0x9f7b5561, 0xc3dc0280, 0x05687715, 0x646c6bd7, 0x44904db3, + 0x66b4f0a3, 0xc0f1648a, 0x697ed5af, 0x49e92ff6, 0x309e374f, 0x2cb6356a, 0x85808573, 0x4991f840, + 0x76f0ae02, 0x083be84d, 0x28421c9a, 0x44489406, 0x736e4cb8, 0xc1092910, 0x8bc95fc6, 0x7d869cf4, + 0x134f616f, 0x2e77118d, 0xb31b2be1, 0xaa90b472, 0x3ca5d717, 0x7d161bba, 0x9cad9010, 0xaf462ba2, + 0x9fe459d2, 0x45d34559, 0xd9f2da13, 0xdbc65487, 0xf3e4f94e, 0x176d486f, 0x097c13ea, 0x631da5c7, + 0x445f7382, 0x175683f4, 0xcdc66a97, 0x70be0288, 0xb3cdcf72, 0x6e5dd2f3, 0x20936079, 0x459b80a5, + 0xbe60e2db, 0xa9c23101, 0xeba5315c, 0x224e42f2, 0x1c5c1572, 0xf6721b2c, 0x1ad2fff3, 0x8c25404e, + 0x324ed72f, 0x4067b7fd, 0x0523138e, 0x5ca3bc78, 0xdc0fd66e, 0x75922283, 0x784d6b17, 0x58ebb16e, + 0x44094f85, 0x3f481d87, 0xfcfeae7b, 0x77b5ff76, 0x8c2302bf, 0xaaf47556, 0x5f46b02a, 0x2b092801, + 0x3d38f5f7, 0x0ca81f36, 0x52af4a8a, 0x66d5e7c0, 0xdf3b0874, 0x95055110, 0x1b5ad7a8, 0xf61ed5ad, + 0x6cf6e479, 0x20758184, 0xd0cefa65, 0x88f7be58, 0x4a046826, 0x0ff6f8f3, 0xa09c7f70, 0x5346aba0, + 0x5ce96c28, 0xe176eda3, 0x6bac307f, 0x376829d2, 0x85360fa9, 0x17e3fe2a, 0x24b79767, 0xf5a96b20, + 0xd6cd2595, 0x68ff1ebf, 0x7555442c, 0xf19f06be, 0xf9e0659a, 0xeeb9491d, 0x34010718, 0xbb30cab8, + 0xe822fe15, 0x88570983, 0x750e6249, 0xda627e55, 0x5e76ffa8, 0xb1534546, 0x6d47de08, 0xefe9e7d4 + }, + S6 = + { + 0xf6fa8f9d, 0x2cac6ce1, 0x4ca34867, 0xe2337f7c, 0x95db08e7, 0x016843b4, 0xeced5cbc, 0x325553ac, + 0xbf9f0960, 0xdfa1e2ed, 0x83f0579d, 0x63ed86b9, 0x1ab6a6b8, 0xde5ebe39, 0xf38ff732, 0x8989b138, + 0x33f14961, 0xc01937bd, 0xf506c6da, 0xe4625e7e, 0xa308ea99, 0x4e23e33c, 0x79cbd7cc, 0x48a14367, + 0xa3149619, 0xfec94bd5, 0xa114174a, 0xeaa01866, 0xa084db2d, 0x09a8486f, 0xa888614a, 0x2900af98, + 0x01665991, 0xe1992863, 0xc8f30c60, 0x2e78ef3c, 0xd0d51932, 0xcf0fec14, 0xf7ca07d2, 0xd0a82072, + 0xfd41197e, 0x9305a6b0, 0xe86be3da, 0x74bed3cd, 0x372da53c, 0x4c7f4448, 0xdab5d440, 0x6dba0ec3, + 0x083919a7, 0x9fbaeed9, 0x49dbcfb0, 0x4e670c53, 0x5c3d9c01, 0x64bdb941, 0x2c0e636a, 0xba7dd9cd, + 0xea6f7388, 0xe70bc762, 0x35f29adb, 0x5c4cdd8d, 0xf0d48d8c, 0xb88153e2, 0x08a19866, 0x1ae2eac8, + 0x284caf89, 0xaa928223, 0x9334be53, 0x3b3a21bf, 0x16434be3, 0x9aea3906, 0xefe8c36e, 0xf890cdd9, + 0x80226dae, 0xc340a4a3, 0xdf7e9c09, 0xa694a807, 0x5b7c5ecc, 0x221db3a6, 0x9a69a02f, 0x68818a54, + 0xceb2296f, 0x53c0843a, 0xfe893655, 0x25bfe68a, 0xb4628abc, 0xcf222ebf, 0x25ac6f48, 0xa9a99387, + 0x53bddb65, 0xe76ffbe7, 0xe967fd78, 0x0ba93563, 0x8e342bc1, 0xe8a11be9, 0x4980740d, 0xc8087dfc, + 0x8de4bf99, 0xa11101a0, 0x7fd37975, 0xda5a26c0, 0xe81f994f, 0x9528cd89, 0xfd339fed, 0xb87834bf, + 0x5f04456d, 0x22258698, 0xc9c4c83b, 0x2dc156be, 0x4f628daa, 0x57f55ec5, 0xe2220abe, 0xd2916ebf, + 0x4ec75b95, 0x24f2c3c0, 0x42d15d99, 0xcd0d7fa0, 0x7b6e27ff, 0xa8dc8af0, 0x7345c106, 0xf41e232f, + 0x35162386, 0xe6ea8926, 0x3333b094, 0x157ec6f2, 0x372b74af, 0x692573e4, 0xe9a9d848, 0xf3160289, + 0x3a62ef1d, 0xa787e238, 0xf3a5f676, 0x74364853, 0x20951063, 0x4576698d, 0xb6fad407, 0x592af950, + 0x36f73523, 0x4cfb6e87, 0x7da4cec0, 0x6c152daa, 0xcb0396a8, 0xc50dfe5d, 0xfcd707ab, 0x0921c42f, + 0x89dff0bb, 0x5fe2be78, 0x448f4f33, 0x754613c9, 0x2b05d08d, 0x48b9d585, 0xdc049441, 0xc8098f9b, + 0x7dede786, 0xc39a3373, 0x42410005, 0x6a091751, 0x0ef3c8a6, 0x890072d6, 0x28207682, 0xa9a9f7be, + 0xbf32679d, 0xd45b5b75, 0xb353fd00, 0xcbb0e358, 0x830f220a, 0x1f8fb214, 0xd372cf08, 0xcc3c4a13, + 0x8cf63166, 0x061c87be, 0x88c98f88, 0x6062e397, 0x47cf8e7a, 0xb6c85283, 0x3cc2acfb, 0x3fc06976, + 0x4e8f0252, 0x64d8314d, 0xda3870e3, 0x1e665459, 0xc10908f0, 0x513021a5, 0x6c5b68b7, 0x822f8aa0, + 0x3007cd3e, 0x74719eef, 0xdc872681, 0x073340d4, 0x7e432fd9, 0x0c5ec241, 0x8809286c, 0xf592d891, + 0x08a930f6, 0x957ef305, 0xb7fbffbd, 0xc266e96f, 0x6fe4ac98, 0xb173ecc0, 0xbc60b42a, 0x953498da, + 0xfba1ae12, 0x2d4bd736, 0x0f25faab, 0xa4f3fceb, 0xe2969123, 0x257f0c3d, 0x9348af49, 0x361400bc, + 0xe8816f4a, 0x3814f200, 0xa3f94043, 0x9c7a54c2, 0xbc704f57, 0xda41e7f9, 0xc25ad33a, 0x54f4a084, + 0xb17f5505, 0x59357cbe, 0xedbd15c8, 0x7f97c5ab, 0xba5ac7b5, 0xb6f6deaf, 0x3a479c3a, 0x5302da25, + 0x653d7e6a, 0x54268d49, 0x51a477ea, 0x5017d55b, 0xd7d25d88, 0x44136c76, 0x0404a8c8, 0xb8e5a121, + 0xb81a928a, 0x60ed5869, 0x97c55b96, 0xeaec991b, 0x29935913, 0x01fdb7f1, 0x088e8dfa, 0x9ab6f6f5, + 0x3b4cbf9f, 0x4a5de3ab, 0xe6051d35, 0xa0e1d855, 0xd36b4cf1, 0xf544edeb, 0xb0e93524, 0xbebb8fbd, + 0xa2d762cf, 0x49c92f54, 0x38b5f331, 0x7128a454, 0x48392905, 0xa65b1db8, 0x851c97bd, 0xd675cf2f + }, + S7 = + { + 0x85e04019, 0x332bf567, 0x662dbfff, 0xcfc65693, 0x2a8d7f6f, 0xab9bc912, 0xde6008a1, 0x2028da1f, + 0x0227bce7, 0x4d642916, 0x18fac300, 0x50f18b82, 0x2cb2cb11, 0xb232e75c, 0x4b3695f2, 0xb28707de, + 0xa05fbcf6, 0xcd4181e9, 0xe150210c, 0xe24ef1bd, 0xb168c381, 0xfde4e789, 0x5c79b0d8, 0x1e8bfd43, + 0x4d495001, 0x38be4341, 0x913cee1d, 0x92a79c3f, 0x089766be, 0xbaeeadf4, 0x1286becf, 0xb6eacb19, + 0x2660c200, 0x7565bde4, 0x64241f7a, 0x8248dca9, 0xc3b3ad66, 0x28136086, 0x0bd8dfa8, 0x356d1cf2, + 0x107789be, 0xb3b2e9ce, 0x0502aa8f, 0x0bc0351e, 0x166bf52a, 0xeb12ff82, 0xe3486911, 0xd34d7516, + 0x4e7b3aff, 0x5f43671b, 0x9cf6e037, 0x4981ac83, 0x334266ce, 0x8c9341b7, 0xd0d854c0, 0xcb3a6c88, + 0x47bc2829, 0x4725ba37, 0xa66ad22b, 0x7ad61f1e, 0x0c5cbafa, 0x4437f107, 0xb6e79962, 0x42d2d816, + 0x0a961288, 0xe1a5c06e, 0x13749e67, 0x72fc081a, 0xb1d139f7, 0xf9583745, 0xcf19df58, 0xbec3f756, + 0xc06eba30, 0x07211b24, 0x45c28829, 0xc95e317f, 0xbc8ec511, 0x38bc46e9, 0xc6e6fa14, 0xbae8584a, + 0xad4ebc46, 0x468f508b, 0x7829435f, 0xf124183b, 0x821dba9f, 0xaff60ff4, 0xea2c4e6d, 0x16e39264, + 0x92544a8b, 0x009b4fc3, 0xaba68ced, 0x9ac96f78, 0x06a5b79a, 0xb2856e6e, 0x1aec3ca9, 0xbe838688, + 0x0e0804e9, 0x55f1be56, 0xe7e5363b, 0xb3a1f25d, 0xf7debb85, 0x61fe033c, 0x16746233, 0x3c034c28, + 0xda6d0c74, 0x79aac56c, 0x3ce4e1ad, 0x51f0c802, 0x98f8f35a, 0x1626a49f, 0xeed82b29, 0x1d382fe3, + 0x0c4fb99a, 0xbb325778, 0x3ec6d97b, 0x6e77a6a9, 0xcb658b5c, 0xd45230c7, 0x2bd1408b, 0x60c03eb7, + 0xb9068d78, 0xa33754f4, 0xf430c87d, 0xc8a71302, 0xb96d8c32, 0xebd4e7be, 0xbe8b9d2d, 0x7979fb06, + 0xe7225308, 0x8b75cf77, 0x11ef8da4, 0xe083c858, 0x8d6b786f, 0x5a6317a6, 0xfa5cf7a0, 0x5dda0033, + 0xf28ebfb0, 0xf5b9c310, 0xa0eac280, 0x08b9767a, 0xa3d9d2b0, 0x79d34217, 0x021a718d, 0x9ac6336a, + 0x2711fd60, 0x438050e3, 0x069908a8, 0x3d7fedc4, 0x826d2bef, 0x4eeb8476, 0x488dcf25, 0x36c9d566, + 0x28e74e41, 0xc2610aca, 0x3d49a9cf, 0xbae3b9df, 0xb65f8de6, 0x92aeaf64, 0x3ac7d5e6, 0x9ea80509, + 0xf22b017d, 0xa4173f70, 0xdd1e16c3, 0x15e0d7f9, 0x50b1b887, 0x2b9f4fd5, 0x625aba82, 0x6a017962, + 0x2ec01b9c, 0x15488aa9, 0xd716e740, 0x40055a2c, 0x93d29a22, 0xe32dbf9a, 0x058745b9, 0x3453dc1e, + 0xd699296e, 0x496cff6f, 0x1c9f4986, 0xdfe2ed07, 0xb87242d1, 0x19de7eae, 0x053e561a, 0x15ad6f8c, + 0x66626c1c, 0x7154c24c, 0xea082b2a, 0x93eb2939, 0x17dcb0f0, 0x58d4f2ae, 0x9ea294fb, 0x52cf564c, + 0x9883fe66, 0x2ec40581, 0x763953c3, 0x01d6692e, 0xd3a0c108, 0xa1e7160e, 0xe4f2dfa6, 0x693ed285, + 0x74904698, 0x4c2b0edd, 0x4f757656, 0x5d393378, 0xa132234f, 0x3d321c5d, 0xc3f5e194, 0x4b269301, + 0xc79f022f, 0x3c997e7e, 0x5e4f9504, 0x3ffafbbd, 0x76f7ad0e, 0x296693f4, 0x3d1fce6f, 0xc61e45be, + 0xd3b5ab34, 0xf72bf9b7, 0x1b0434c0, 0x4e72b567, 0x5592a33d, 0xb5229301, 0xcfd2a87f, 0x60aeb767, + 0x1814386b, 0x30bcc33d, 0x38a0c07d, 0xfd1606f2, 0xc363519b, 0x589dd390, 0x5479f8e6, 0x1cb8d647, + 0x97fd61a9, 0xea7759f4, 0x2d57539d, 0x569a58cf, 0xe84e63ad, 0x462e1b78, 0x6580f87e, 0xf3817914, + 0x91da55f4, 0x40a230f3, 0xd1988f35, 0xb6e318d2, 0x3ffa50bc, 0x3d40f021, 0xc3c0bdae, 0x4958c24c, + 0x518f36b2, 0x84b1d370, 0x0fedce83, 0x878ddada, 0xf2a279c7, 0x94e01be8, 0x90716f4b, 0x954b8aa3 + }, + S8 = + { + 0xe216300d, 0xbbddfffc, 0xa7ebdabd, 0x35648095, 0x7789f8b7, 0xe6c1121b, 0x0e241600, 0x052ce8b5, + 0x11a9cfb0, 0xe5952f11, 0xece7990a, 0x9386d174, 0x2a42931c, 0x76e38111, 0xb12def3a, 0x37ddddfc, + 0xde9adeb1, 0x0a0cc32c, 0xbe197029, 0x84a00940, 0xbb243a0f, 0xb4d137cf, 0xb44e79f0, 0x049eedfd, + 0x0b15a15d, 0x480d3168, 0x8bbbde5a, 0x669ded42, 0xc7ece831, 0x3f8f95e7, 0x72df191b, 0x7580330d, + 0x94074251, 0x5c7dcdfa, 0xabbe6d63, 0xaa402164, 0xb301d40a, 0x02e7d1ca, 0x53571dae, 0x7a3182a2, + 0x12a8ddec, 0xfdaa335d, 0x176f43e8, 0x71fb46d4, 0x38129022, 0xce949ad4, 0xb84769ad, 0x965bd862, + 0x82f3d055, 0x66fb9767, 0x15b80b4e, 0x1d5b47a0, 0x4cfde06f, 0xc28ec4b8, 0x57e8726e, 0x647a78fc, + 0x99865d44, 0x608bd593, 0x6c200e03, 0x39dc5ff6, 0x5d0b00a3, 0xae63aff2, 0x7e8bd632, 0x70108c0c, + 0xbbd35049, 0x2998df04, 0x980cf42a, 0x9b6df491, 0x9e7edd53, 0x06918548, 0x58cb7e07, 0x3b74ef2e, + 0x522fffb1, 0xd24708cc, 0x1c7e27cd, 0xa4eb215b, 0x3cf1d2e2, 0x19b47a38, 0x424f7618, 0x35856039, + 0x9d17dee7, 0x27eb35e6, 0xc9aff67b, 0x36baf5b8, 0x09c467cd, 0xc18910b1, 0xe11dbf7b, 0x06cd1af8, + 0x7170c608, 0x2d5e3354, 0xd4de495a, 0x64c6d006, 0xbcc0c62c, 0x3dd00db3, 0x708f8f34, 0x77d51b42, + 0x264f620f, 0x24b8d2bf, 0x15c1b79e, 0x46a52564, 0xf8d7e54e, 0x3e378160, 0x7895cda5, 0x859c15a5, + 0xe6459788, 0xc37bc75f, 0xdb07ba0c, 0x0676a3ab, 0x7f229b1e, 0x31842e7b, 0x24259fd7, 0xf8bef472, + 0x835ffcb8, 0x6df4c1f2, 0x96f5b195, 0xfd0af0fc, 0xb0fe134c, 0xe2506d3d, 0x4f9b12ea, 0xf215f225, + 0xa223736f, 0x9fb4c428, 0x25d04979, 0x34c713f8, 0xc4618187, 0xea7a6e98, 0x7cd16efc, 0x1436876c, + 0xf1544107, 0xbedeee14, 0x56e9af27, 0xa04aa441, 0x3cf7c899, 0x92ecbae6, 0xdd67016d, 0x151682eb, + 0xa842eedf, 0xfdba60b4, 0xf1907b75, 0x20e3030f, 0x24d8c29e, 0xe139673b, 0xefa63fb8, 0x71873054, + 0xb6f2cf3b, 0x9f326442, 0xcb15a4cc, 0xb01a4504, 0xf1e47d8d, 0x844a1be5, 0xbae7dfdc, 0x42cbda70, + 0xcd7dae0a, 0x57e85b7a, 0xd53f5af6, 0x20cf4d8c, 0xcea4d428, 0x79d130a4, 0x3486ebfb, 0x33d3cddc, + 0x77853b53, 0x37effcb5, 0xc5068778, 0xe580b3e6, 0x4e68b8f4, 0xc5c8b37e, 0x0d809ea2, 0x398feb7c, + 0x132a4f94, 0x43b7950e, 0x2fee7d1c, 0x223613bd, 0xdd06caa2, 0x37df932b, 0xc4248289, 0xacf3ebc3, + 0x5715f6b7, 0xef3478dd, 0xf267616f, 0xc148cbe4, 0x9052815e, 0x5e410fab, 0xb48a2465, 0x2eda7fa4, + 0xe87b40e4, 0xe98ea084, 0x5889e9e1, 0xefd390fc, 0xdd07d35b, 0xdb485694, 0x38d7e5b2, 0x57720101, + 0x730edebc, 0x5b643113, 0x94917e4f, 0x503c2fba, 0x646f1282, 0x7523d24a, 0xe0779695, 0xf9c17a8f, + 0x7a5b2121, 0xd187b896, 0x29263a4d, 0xba510cdf, 0x81f47c9f, 0xad1163ed, 0xea7b5965, 0x1a00726e, + 0x11403092, 0x00da6d77, 0x4a0cdd61, 0xad1f4603, 0x605bdfb0, 0x9eedc364, 0x22ebe6a8, 0xcee7d28a, + 0xa0e736a0, 0x5564a6b9, 0x10853209, 0xc7eb8f37, 0x2de705ca, 0x8951570f, 0xdf09822b, 0xbd691a6c, + 0xaa12e4f2, 0x87451c0f, 0xe0f6a27a, 0x3ada4819, 0x4cf1764f, 0x0d771c2b, 0x67cdb156, 0x350d8384, + 0x5938fa0f, 0x42399ef3, 0x36997b07, 0x0e84093d, 0x4aa93e61, 0x8360d87b, 0x1fa98b0c, 0x1149382c, + 0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82, + 0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e + }; + + //==================================== + // Useful constants + //==================================== + + internal static readonly int MAX_ROUNDS = 16; + internal static readonly int RED_ROUNDS = 12; + + private const int BLOCK_SIZE = 8; // bytes = 64 bits + + private int[] _Kr = new int[17]; // the rotating round key + private uint[] _Km = new uint[17]; // the masking round key + + private bool _encrypting; + + private byte[] _workingKey; + private int _rounds = MAX_ROUNDS; + + public Cast5Engine() + { + } + + /** + * initialise a CAST cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("Invalid parameter passed to "+ AlgorithmName +" init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + _encrypting = forEncryption; + _workingKey = ((KeyParameter)parameters).GetKey(); + SetKey(_workingKey); + } + + public virtual string AlgorithmName + { + get { return "CAST5"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + int blockSize = GetBlockSize(); + if (_workingKey == null) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Check.DataLength(input, inOff, blockSize, "input buffer too short"); + Check.OutputLength(output, outOff, blockSize, "output buffer too short"); + + if (_encrypting) + { + return EncryptBlock(input, inOff, output, outOff); + } + else + { + return DecryptBlock(input, inOff, output, outOff); + } + } + + public virtual void Reset() + { + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + //================================== + // Private Implementation + //================================== + + /* + * Creates the subkeys using the same nomenclature + * as described in RFC2144. + * + * See section 2.4 + */ + internal virtual void SetKey(byte[] key) + { + /* + * Determine the key size here, if required + * + * if keysize <= 80bits, use 12 rounds instead of 16 + * if keysize < 128bits, pad with 0 + * + * Typical key sizes => 40, 64, 80, 128 + */ + + if (key.Length < 11) + { + _rounds = RED_ROUNDS; + } + + int [] z = new int[16]; + int [] x = new int[16]; + + uint z03, z47, z8B, zCF; + uint x03, x47, x8B, xCF; + + /* copy the key into x */ + for (int i=0; i< key.Length; i++) + { + x[i] = (int)(key[i] & 0xff); + } + + /* + * This will look different because the selection of + * bytes from the input key I've already chosen the + * correct int. + */ + x03 = IntsTo32bits(x, 0x0); + x47 = IntsTo32bits(x, 0x4); + x8B = IntsTo32bits(x, 0x8); + xCF = IntsTo32bits(x, 0xC); + + z03 = x03 ^S5[x[0xD]] ^S6[x[0xF]] ^S7[x[0xC]] ^S8[x[0xE]] ^S7[x[0x8]]; + + Bits32ToInts(z03, z, 0x0); + z47 = x8B ^S5[z[0x0]] ^S6[z[0x2]] ^S7[z[0x1]] ^S8[z[0x3]] ^S8[x[0xA]]; + Bits32ToInts(z47, z, 0x4); + z8B = xCF ^S5[z[0x7]] ^S6[z[0x6]] ^S7[z[0x5]] ^S8[z[0x4]] ^S5[x[0x9]]; + Bits32ToInts(z8B, z, 0x8); + zCF = x47 ^S5[z[0xA]] ^S6[z[0x9]] ^S7[z[0xB]] ^S8[z[0x8]] ^S6[x[0xB]]; + Bits32ToInts(zCF, z, 0xC); + _Km[ 1]= S5[z[0x8]] ^ S6[z[0x9]] ^ S7[z[0x7]] ^ S8[z[0x6]] ^ S5[z[0x2]]; + _Km[ 2]= S5[z[0xA]] ^ S6[z[0xB]] ^ S7[z[0x5]] ^ S8[z[0x4]] ^ S6[z[0x6]]; + _Km[ 3]= S5[z[0xC]] ^ S6[z[0xD]] ^ S7[z[0x3]] ^ S8[z[0x2]] ^ S7[z[0x9]]; + _Km[ 4]= S5[z[0xE]] ^ S6[z[0xF]] ^ S7[z[0x1]] ^ S8[z[0x0]] ^ S8[z[0xC]]; + + z03 = IntsTo32bits(z, 0x0); + z47 = IntsTo32bits(z, 0x4); + z8B = IntsTo32bits(z, 0x8); + zCF = IntsTo32bits(z, 0xC); + x03 = z8B ^S5[z[0x5]] ^S6[z[0x7]] ^S7[z[0x4]] ^S8[z[0x6]] ^S7[z[0x0]]; + Bits32ToInts(x03, x, 0x0); + x47 = z03 ^S5[x[0x0]] ^S6[x[0x2]] ^S7[x[0x1]] ^S8[x[0x3]] ^S8[z[0x2]]; + Bits32ToInts(x47, x, 0x4); + x8B = z47 ^S5[x[0x7]] ^S6[x[0x6]] ^S7[x[0x5]] ^S8[x[0x4]] ^S5[z[0x1]]; + Bits32ToInts(x8B, x, 0x8); + xCF = zCF ^S5[x[0xA]] ^S6[x[0x9]] ^S7[x[0xB]] ^S8[x[0x8]] ^S6[z[0x3]]; + Bits32ToInts(xCF, x, 0xC); + _Km[ 5]= S5[x[0x3]] ^ S6[x[0x2]] ^ S7[x[0xC]] ^ S8[x[0xD]] ^ S5[x[0x8]]; + _Km[ 6]= S5[x[0x1]] ^ S6[x[0x0]] ^ S7[x[0xE]] ^ S8[x[0xF]] ^ S6[x[0xD]]; + _Km[ 7]= S5[x[0x7]] ^ S6[x[0x6]] ^ S7[x[0x8]] ^ S8[x[0x9]] ^ S7[x[0x3]]; + _Km[ 8]= S5[x[0x5]] ^ S6[x[0x4]] ^ S7[x[0xA]] ^ S8[x[0xB]] ^ S8[x[0x7]]; + + x03 = IntsTo32bits(x, 0x0); + x47 = IntsTo32bits(x, 0x4); + x8B = IntsTo32bits(x, 0x8); + xCF = IntsTo32bits(x, 0xC); + z03 = x03 ^S5[x[0xD]] ^S6[x[0xF]] ^S7[x[0xC]] ^S8[x[0xE]] ^S7[x[0x8]]; + Bits32ToInts(z03, z, 0x0); + z47 = x8B ^S5[z[0x0]] ^S6[z[0x2]] ^S7[z[0x1]] ^S8[z[0x3]] ^S8[x[0xA]]; + Bits32ToInts(z47, z, 0x4); + z8B = xCF ^S5[z[0x7]] ^S6[z[0x6]] ^S7[z[0x5]] ^S8[z[0x4]] ^S5[x[0x9]]; + Bits32ToInts(z8B, z, 0x8); + zCF = x47 ^S5[z[0xA]] ^S6[z[0x9]] ^S7[z[0xB]] ^S8[z[0x8]] ^S6[x[0xB]]; + Bits32ToInts(zCF, z, 0xC); + _Km[ 9]= S5[z[0x3]] ^ S6[z[0x2]] ^ S7[z[0xC]] ^ S8[z[0xD]] ^ S5[z[0x9]]; + _Km[10]= S5[z[0x1]] ^ S6[z[0x0]] ^ S7[z[0xE]] ^ S8[z[0xF]] ^ S6[z[0xc]]; + _Km[11]= S5[z[0x7]] ^ S6[z[0x6]] ^ S7[z[0x8]] ^ S8[z[0x9]] ^ S7[z[0x2]]; + _Km[12]= S5[z[0x5]] ^ S6[z[0x4]] ^ S7[z[0xA]] ^ S8[z[0xB]] ^ S8[z[0x6]]; + + z03 = IntsTo32bits(z, 0x0); + z47 = IntsTo32bits(z, 0x4); + z8B = IntsTo32bits(z, 0x8); + zCF = IntsTo32bits(z, 0xC); + x03 = z8B ^S5[z[0x5]] ^S6[z[0x7]] ^S7[z[0x4]] ^S8[z[0x6]] ^S7[z[0x0]]; + Bits32ToInts(x03, x, 0x0); + x47 = z03 ^S5[x[0x0]] ^S6[x[0x2]] ^S7[x[0x1]] ^S8[x[0x3]] ^S8[z[0x2]]; + Bits32ToInts(x47, x, 0x4); + x8B = z47 ^S5[x[0x7]] ^S6[x[0x6]] ^S7[x[0x5]] ^S8[x[0x4]] ^S5[z[0x1]]; + Bits32ToInts(x8B, x, 0x8); + xCF = zCF ^S5[x[0xA]] ^S6[x[0x9]] ^S7[x[0xB]] ^S8[x[0x8]] ^S6[z[0x3]]; + Bits32ToInts(xCF, x, 0xC); + _Km[13]= S5[x[0x8]] ^ S6[x[0x9]] ^ S7[x[0x7]] ^ S8[x[0x6]] ^ S5[x[0x3]]; + _Km[14]= S5[x[0xA]] ^ S6[x[0xB]] ^ S7[x[0x5]] ^ S8[x[0x4]] ^ S6[x[0x7]]; + _Km[15]= S5[x[0xC]] ^ S6[x[0xD]] ^ S7[x[0x3]] ^ S8[x[0x2]] ^ S7[x[0x8]]; + _Km[16]= S5[x[0xE]] ^ S6[x[0xF]] ^ S7[x[0x1]] ^ S8[x[0x0]] ^ S8[x[0xD]]; + + x03 = IntsTo32bits(x, 0x0); + x47 = IntsTo32bits(x, 0x4); + x8B = IntsTo32bits(x, 0x8); + xCF = IntsTo32bits(x, 0xC); + z03 = x03 ^S5[x[0xD]] ^S6[x[0xF]] ^S7[x[0xC]] ^S8[x[0xE]] ^S7[x[0x8]]; + Bits32ToInts(z03, z, 0x0); + z47 = x8B ^S5[z[0x0]] ^S6[z[0x2]] ^S7[z[0x1]] ^S8[z[0x3]] ^S8[x[0xA]]; + Bits32ToInts(z47, z, 0x4); + z8B = xCF ^S5[z[0x7]] ^S6[z[0x6]] ^S7[z[0x5]] ^S8[z[0x4]] ^S5[x[0x9]]; + Bits32ToInts(z8B, z, 0x8); + zCF = x47 ^S5[z[0xA]] ^S6[z[0x9]] ^S7[z[0xB]] ^S8[z[0x8]] ^S6[x[0xB]]; + Bits32ToInts(zCF, z, 0xC); + _Kr[ 1]=(int)((S5[z[0x8]]^S6[z[0x9]]^S7[z[0x7]]^S8[z[0x6]] ^ S5[z[0x2]])&0x1f); + _Kr[ 2]=(int)((S5[z[0xA]]^S6[z[0xB]]^S7[z[0x5]]^S8[z[0x4]] ^ S6[z[0x6]])&0x1f); + _Kr[ 3]=(int)((S5[z[0xC]]^S6[z[0xD]]^S7[z[0x3]]^S8[z[0x2]] ^ S7[z[0x9]])&0x1f); + _Kr[ 4]=(int)((S5[z[0xE]]^S6[z[0xF]]^S7[z[0x1]]^S8[z[0x0]] ^ S8[z[0xC]])&0x1f); + + z03 = IntsTo32bits(z, 0x0); + z47 = IntsTo32bits(z, 0x4); + z8B = IntsTo32bits(z, 0x8); + zCF = IntsTo32bits(z, 0xC); + x03 = z8B ^S5[z[0x5]] ^S6[z[0x7]] ^S7[z[0x4]] ^S8[z[0x6]] ^S7[z[0x0]]; + Bits32ToInts(x03, x, 0x0); + x47 = z03 ^S5[x[0x0]] ^S6[x[0x2]] ^S7[x[0x1]] ^S8[x[0x3]] ^S8[z[0x2]]; + Bits32ToInts(x47, x, 0x4); + x8B = z47 ^S5[x[0x7]] ^S6[x[0x6]] ^S7[x[0x5]] ^S8[x[0x4]] ^S5[z[0x1]]; + Bits32ToInts(x8B, x, 0x8); + xCF = zCF ^S5[x[0xA]] ^S6[x[0x9]] ^S7[x[0xB]] ^S8[x[0x8]] ^S6[z[0x3]]; + Bits32ToInts(xCF, x, 0xC); + _Kr[ 5]=(int)((S5[x[0x3]]^S6[x[0x2]]^S7[x[0xC]]^S8[x[0xD]]^S5[x[0x8]])&0x1f); + _Kr[ 6]=(int)((S5[x[0x1]]^S6[x[0x0]]^S7[x[0xE]]^S8[x[0xF]]^S6[x[0xD]])&0x1f); + _Kr[ 7]=(int)((S5[x[0x7]]^S6[x[0x6]]^S7[x[0x8]]^S8[x[0x9]]^S7[x[0x3]])&0x1f); + _Kr[ 8]=(int)((S5[x[0x5]]^S6[x[0x4]]^S7[x[0xA]]^S8[x[0xB]]^S8[x[0x7]])&0x1f); + + x03 = IntsTo32bits(x, 0x0); + x47 = IntsTo32bits(x, 0x4); + x8B = IntsTo32bits(x, 0x8); + xCF = IntsTo32bits(x, 0xC); + z03 = x03 ^S5[x[0xD]] ^S6[x[0xF]] ^S7[x[0xC]] ^S8[x[0xE]] ^S7[x[0x8]]; + Bits32ToInts(z03, z, 0x0); + z47 = x8B ^S5[z[0x0]] ^S6[z[0x2]] ^S7[z[0x1]] ^S8[z[0x3]] ^S8[x[0xA]]; + Bits32ToInts(z47, z, 0x4); + z8B = xCF ^S5[z[0x7]] ^S6[z[0x6]] ^S7[z[0x5]] ^S8[z[0x4]] ^S5[x[0x9]]; + Bits32ToInts(z8B, z, 0x8); + zCF = x47 ^S5[z[0xA]] ^S6[z[0x9]] ^S7[z[0xB]] ^S8[z[0x8]] ^S6[x[0xB]]; + Bits32ToInts(zCF, z, 0xC); + _Kr[ 9]=(int)((S5[z[0x3]]^S6[z[0x2]]^S7[z[0xC]]^S8[z[0xD]]^S5[z[0x9]])&0x1f); + _Kr[10]=(int)((S5[z[0x1]]^S6[z[0x0]]^S7[z[0xE]]^S8[z[0xF]]^S6[z[0xc]])&0x1f); + _Kr[11]=(int)((S5[z[0x7]]^S6[z[0x6]]^S7[z[0x8]]^S8[z[0x9]]^S7[z[0x2]])&0x1f); + _Kr[12]=(int)((S5[z[0x5]]^S6[z[0x4]]^S7[z[0xA]]^S8[z[0xB]]^S8[z[0x6]])&0x1f); + + z03 = IntsTo32bits(z, 0x0); + z47 = IntsTo32bits(z, 0x4); + z8B = IntsTo32bits(z, 0x8); + zCF = IntsTo32bits(z, 0xC); + x03 = z8B ^S5[z[0x5]] ^S6[z[0x7]] ^S7[z[0x4]] ^S8[z[0x6]] ^S7[z[0x0]]; + Bits32ToInts(x03, x, 0x0); + x47 = z03 ^S5[x[0x0]] ^S6[x[0x2]] ^S7[x[0x1]] ^S8[x[0x3]] ^S8[z[0x2]]; + Bits32ToInts(x47, x, 0x4); + x8B = z47 ^S5[x[0x7]] ^S6[x[0x6]] ^S7[x[0x5]] ^S8[x[0x4]] ^S5[z[0x1]]; + Bits32ToInts(x8B, x, 0x8); + xCF = zCF ^S5[x[0xA]] ^S6[x[0x9]] ^S7[x[0xB]] ^S8[x[0x8]] ^S6[z[0x3]]; + Bits32ToInts(xCF, x, 0xC); + _Kr[13]=(int)((S5[x[0x8]]^S6[x[0x9]]^S7[x[0x7]]^S8[x[0x6]]^S5[x[0x3]])&0x1f); + _Kr[14]=(int)((S5[x[0xA]]^S6[x[0xB]]^S7[x[0x5]]^S8[x[0x4]]^S6[x[0x7]])&0x1f); + _Kr[15]=(int)((S5[x[0xC]]^S6[x[0xD]]^S7[x[0x3]]^S8[x[0x2]]^S7[x[0x8]])&0x1f); + _Kr[16]=(int)((S5[x[0xE]]^S6[x[0xF]]^S7[x[0x1]]^S8[x[0x0]]^S8[x[0xD]])&0x1f); + } + + /** + * Encrypt the given input starting at the given offset and place + * the result in the provided buffer starting at the given offset. + * + * @param src The plaintext buffer + * @param srcIndex An offset into src + * @param dst The ciphertext buffer + * @param dstIndex An offset into dst + */ + internal virtual int EncryptBlock( + byte[] src, + int srcIndex, + byte[] dst, + int dstIndex) + { + // process the input block + // batch the units up into a 32 bit chunk and go for it + // the array is in bytes, the increment is 8x8 bits = 64 + + uint L0 = Pack.BE_To_UInt32(src, srcIndex); + uint R0 = Pack.BE_To_UInt32(src, srcIndex + 4); + + uint[] result = new uint[2]; + CAST_Encipher(L0, R0, result); + + // now stuff them into the destination block + Pack.UInt32_To_BE(result[0], dst, dstIndex); + Pack.UInt32_To_BE(result[1], dst, dstIndex + 4); + + return BLOCK_SIZE; + } + + /** + * Decrypt the given input starting at the given offset and place + * the result in the provided buffer starting at the given offset. + * + * @param src The plaintext buffer + * @param srcIndex An offset into src + * @param dst The ciphertext buffer + * @param dstIndex An offset into dst + */ + internal virtual int DecryptBlock( + byte[] src, + int srcIndex, + byte[] dst, + int dstIndex) + { + // process the input block + // batch the units up into a 32 bit chunk and go for it + // the array is in bytes, the increment is 8x8 bits = 64 + uint L16 = Pack.BE_To_UInt32(src, srcIndex); + uint R16 = Pack.BE_To_UInt32(src, srcIndex + 4); + + uint[] result = new uint[2]; + CAST_Decipher(L16, R16, result); + + // now stuff them into the destination block + Pack.UInt32_To_BE(result[0], dst, dstIndex); + Pack.UInt32_To_BE(result[1], dst, dstIndex + 4); + + return BLOCK_SIZE; + } + + /** + * The first of the three processing functions for the + * encryption and decryption. + * + * @param D the input to be processed + * @param Kmi the mask to be used from Km[n] + * @param Kri the rotation value to be used + * + */ + internal static uint F1(uint D, uint Kmi, int Kri) + { + uint I = Kmi + D; + I = I << Kri | (I >> (32-Kri)); + return ((S1[(I>>24)&0xff]^S2[(I>>16)&0xff])-S3[(I>>8)&0xff])+S4[I&0xff]; + } + + /** + * The second of the three processing functions for the + * encryption and decryption. + * + * @param D the input to be processed + * @param Kmi the mask to be used from Km[n] + * @param Kri the rotation value to be used + * + */ + internal static uint F2(uint D, uint Kmi, int Kri) + { + uint I = Kmi ^ D; + I = I << Kri | (I >> (32-Kri)); + return ((S1[(I>>24)&0xff]-S2[(I>>16)&0xff])+S3[(I>>8)&0xff])^S4[I&0xff]; + } + + /** + * The third of the three processing functions for the + * encryption and decryption. + * + * @param D the input to be processed + * @param Kmi the mask to be used from Km[n] + * @param Kri the rotation value to be used + * + */ + internal static uint F3(uint D, uint Kmi, int Kri) + { + uint I = Kmi - D; + I = I << Kri | (I >> (32-Kri)); + return ((S1[(I>>24)&0xff]+S2[(I>>16)&0xff])^S3[(I>>8)&0xff])-S4[I&0xff]; + } + + /** + * Does the 16 rounds to encrypt the block. + * + * @param L0 the LH-32bits of the plaintext block + * @param R0 the RH-32bits of the plaintext block + */ + internal void CAST_Encipher(uint L0, uint R0, uint[] result) + { + uint Lp = L0; // the previous value, equiv to L[i-1] + uint Rp = R0; // equivalent to R[i-1] + + /* + * numbering consistent with paper to make + * checking and validating easier + */ + uint Li = L0, Ri = R0; + + for (int i = 1; i<=_rounds ; i++) + { + Lp = Li; + Rp = Ri; + + Li = Rp; + switch (i) + { + case 1: + case 4: + case 7: + case 10: + case 13: + case 16: + Ri = Lp ^ F1(Rp, _Km[i], _Kr[i]); + break; + case 2: + case 5: + case 8: + case 11: + case 14: + Ri = Lp ^ F2(Rp, _Km[i], _Kr[i]); + break; + case 3: + case 6: + case 9: + case 12: + case 15: + Ri = Lp ^ F3(Rp, _Km[i], _Kr[i]); + break; + } + } + + result[0] = Ri; + result[1] = Li; + + return; + } + + internal void CAST_Decipher(uint L16, uint R16, uint[] result) + { + uint Lp = L16; // the previous value, equiv to L[i-1] + uint Rp = R16; // equivalent to R[i-1] + + /* + * numbering consistent with paper to make + * checking and validating easier + */ + uint Li = L16, Ri = R16; + + for (int i = _rounds; i > 0; i--) + { + Lp = Li; + Rp = Ri; + + Li = Rp; + switch (i) + { + case 1: + case 4: + case 7: + case 10: + case 13: + case 16: + Ri = Lp ^ F1(Rp, _Km[i], _Kr[i]); + break; + case 2: + case 5: + case 8: + case 11: + case 14: + Ri = Lp ^ F2(Rp, _Km[i], _Kr[i]); + break; + case 3: + case 6: + case 9: + case 12: + case 15: + Ri = Lp ^ F3(Rp, _Km[i], _Kr[i]); + break; + } + } + + result[0] = Ri; + result[1] = Li; + + return; + } + + internal static void Bits32ToInts(uint inData, int[] b, int offset) + { + b[offset + 3] = (int) (inData & 0xff); + b[offset + 2] = (int) ((inData >> 8) & 0xff); + b[offset + 1] = (int) ((inData >> 16) & 0xff); + b[offset] = (int) ((inData >> 24) & 0xff); + } + + internal static uint IntsTo32bits(int[] b, int i) + { + return (uint)(((b[i] & 0xff) << 24) | + ((b[i+1] & 0xff) << 16) | + ((b[i+2] & 0xff) << 8) | + ((b[i+3] & 0xff))); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast5Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast5Engine.cs.meta new file mode 100644 index 00000000..c34047e4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast5Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8e6be43f32217e342897a427819c9724 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast6Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast6Engine.cs new file mode 100644 index 00000000..028d70c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast6Engine.cs @@ -0,0 +1,283 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * A class that provides CAST6 key encryption operations, + * such as encoding data and generating keys. + * + * All the algorithms herein are from the Internet RFC + * + * RFC2612 - CAST6 (128bit block, 128-256bit key) + * + * and implement a simplified cryptography interface. + */ + public sealed class Cast6Engine + : Cast5Engine + { + //==================================== + // Useful constants + //==================================== + private const int ROUNDS = 12; + private const int BLOCK_SIZE = 16; // bytes = 128 bits + + /* + * Put the round and mask keys into an array. + * Kr0[i] => _Kr[i*4 + 0] + */ + private int []_Kr = new int[ROUNDS*4]; // the rotating round key(s) + private uint []_Km = new uint[ROUNDS*4]; // the masking round key(s) + + /* + * Key setup + */ + private int []_Tr = new int[24 * 8]; + private uint []_Tm = new uint[24 * 8]; + private uint[] _workingKey = new uint[8]; + + public Cast6Engine() + { + } + + public override string AlgorithmName + { + get { return "CAST6"; } + } + + public override void Reset() + { + } + + public override int GetBlockSize() + { + return BLOCK_SIZE; + } + + //================================== + // Private Implementation + //================================== + /* + * Creates the subkeys using the same nomenclature + * as described in RFC2612. + * + * See section 2.4 + */ + internal override void SetKey( + byte[] key) + { + uint Cm = 0x5a827999; + uint Mm = 0x6ed9eba1; + int Cr = 19; + int Mr = 17; + /* + * Determine the key size here, if required + * + * if keysize < 256 bytes, pad with 0 + * + * Typical key sizes => 128, 160, 192, 224, 256 + */ + for (int i=0; i< 24; i++) + { + for (int j=0; j< 8; j++) + { + _Tm[i*8 + j] = Cm; + Cm += Mm; //mod 2^32; + _Tr[i*8 + j] = Cr; + Cr = (Cr + Mr) & 0x1f; // mod 32 + } + } + + byte[] tmpKey = new byte[64]; + key.CopyTo(tmpKey, 0); + + // now create ABCDEFGH + for (int i = 0; i < 8; i++) + { + _workingKey[i] = Pack.BE_To_UInt32(tmpKey, i*4); + } + + // Generate the key schedule + for (int i = 0; i < 12; i++) + { + // KAPPA <- W2i(KAPPA) + int i2 = i*2 *8; + _workingKey[6] ^= F1(_workingKey[7], _Tm[i2], _Tr[i2]); + _workingKey[5] ^= F2(_workingKey[6], _Tm[i2+1], _Tr[i2+1]); + _workingKey[4] ^= F3(_workingKey[5], _Tm[i2+2], _Tr[i2+2]); + _workingKey[3] ^= F1(_workingKey[4], _Tm[i2+3], _Tr[i2+3]); + _workingKey[2] ^= F2(_workingKey[3], _Tm[i2+4], _Tr[i2+4]); + _workingKey[1] ^= F3(_workingKey[2], _Tm[i2+5], _Tr[i2+5]); + _workingKey[0] ^= F1(_workingKey[1], _Tm[i2+6], _Tr[i2+6]); + _workingKey[7] ^= F2(_workingKey[0], _Tm[i2+7], _Tr[i2+7]); + // KAPPA <- W2i+1(KAPPA) + i2 = (i*2 + 1)*8; + _workingKey[6] ^= F1(_workingKey[7], _Tm[i2], _Tr[i2]); + _workingKey[5] ^= F2(_workingKey[6], _Tm[i2+1], _Tr[i2+1]); + _workingKey[4] ^= F3(_workingKey[5], _Tm[i2+2], _Tr[i2+2]); + _workingKey[3] ^= F1(_workingKey[4], _Tm[i2+3], _Tr[i2+3]); + _workingKey[2] ^= F2(_workingKey[3], _Tm[i2+4], _Tr[i2+4]); + _workingKey[1] ^= F3(_workingKey[2], _Tm[i2+5], _Tr[i2+5]); + _workingKey[0] ^= F1(_workingKey[1], _Tm[i2+6], _Tr[i2+6]); + _workingKey[7] ^= F2(_workingKey[0], _Tm[i2+7], _Tr[i2+7]); + // Kr_(i) <- KAPPA + _Kr[i*4] = (int)(_workingKey[0] & 0x1f); + _Kr[i*4 + 1] = (int)(_workingKey[2] & 0x1f); + _Kr[i*4 + 2] = (int)(_workingKey[4] & 0x1f); + _Kr[i*4 + 3] = (int)(_workingKey[6] & 0x1f); + // Km_(i) <- KAPPA + _Km[i*4] = _workingKey[7]; + _Km[i*4 + 1] = _workingKey[5]; + _Km[i*4 + 2] = _workingKey[3]; + _Km[i*4 + 3] = _workingKey[1]; + } + } + + /** + * Encrypt the given input starting at the given offset and place + * the result in the provided buffer starting at the given offset. + * + * @param src The plaintext buffer + * @param srcIndex An offset into src + * @param dst The ciphertext buffer + * @param dstIndex An offset into dst + */ + internal override int EncryptBlock( + byte[] src, + int srcIndex, + byte[] dst, + int dstIndex) + { + // process the input block + // batch the units up into 4x32 bit chunks and go for it + uint A = Pack.BE_To_UInt32(src, srcIndex); + uint B = Pack.BE_To_UInt32(src, srcIndex + 4); + uint C = Pack.BE_To_UInt32(src, srcIndex + 8); + uint D = Pack.BE_To_UInt32(src, srcIndex + 12); + uint[] result = new uint[4]; + CAST_Encipher(A, B, C, D, result); + // now stuff them into the destination block + Pack.UInt32_To_BE(result[0], dst, dstIndex); + Pack.UInt32_To_BE(result[1], dst, dstIndex + 4); + Pack.UInt32_To_BE(result[2], dst, dstIndex + 8); + Pack.UInt32_To_BE(result[3], dst, dstIndex + 12); + return BLOCK_SIZE; + } + + /** + * Decrypt the given input starting at the given offset and place + * the result in the provided buffer starting at the given offset. + * + * @param src The plaintext buffer + * @param srcIndex An offset into src + * @param dst The ciphertext buffer + * @param dstIndex An offset into dst + */ + internal override int DecryptBlock( + byte[] src, + int srcIndex, + byte[] dst, + int dstIndex) + { + // process the input block + // batch the units up into 4x32 bit chunks and go for it + uint A = Pack.BE_To_UInt32(src, srcIndex); + uint B = Pack.BE_To_UInt32(src, srcIndex + 4); + uint C = Pack.BE_To_UInt32(src, srcIndex + 8); + uint D = Pack.BE_To_UInt32(src, srcIndex + 12); + uint[] result = new uint[4]; + CAST_Decipher(A, B, C, D, result); + // now stuff them into the destination block + Pack.UInt32_To_BE(result[0], dst, dstIndex); + Pack.UInt32_To_BE(result[1], dst, dstIndex + 4); + Pack.UInt32_To_BE(result[2], dst, dstIndex + 8); + Pack.UInt32_To_BE(result[3], dst, dstIndex + 12); + return BLOCK_SIZE; + } + + /** + * Does the 12 quad rounds rounds to encrypt the block. + * + * @param A the 00-31 bits of the plaintext block + * @param B the 32-63 bits of the plaintext block + * @param C the 64-95 bits of the plaintext block + * @param D the 96-127 bits of the plaintext block + * @param result the resulting ciphertext + */ + private void CAST_Encipher( + uint A, + uint B, + uint C, + uint D, + uint[] result) + { + for (int i = 0; i < 6; i++) + { + int x = i*4; + // BETA <- Qi(BETA) + C ^= F1(D, _Km[x], _Kr[x]); + B ^= F2(C, _Km[x + 1], _Kr[x + 1]); + A ^= F3(B, _Km[x + 2], _Kr[x + 2]); + D ^= F1(A, _Km[x + 3], _Kr[x + 3]); + } + for (int i = 6; i < 12; i++) + { + int x = i*4; + // BETA <- QBARi(BETA) + D ^= F1(A, _Km[x + 3], _Kr[x + 3]); + A ^= F3(B, _Km[x + 2], _Kr[x + 2]); + B ^= F2(C, _Km[x + 1], _Kr[x + 1]); + C ^= F1(D, _Km[x], _Kr[x]); + } + result[0] = A; + result[1] = B; + result[2] = C; + result[3] = D; + } + + /** + * Does the 12 quad rounds rounds to decrypt the block. + * + * @param A the 00-31 bits of the ciphertext block + * @param B the 32-63 bits of the ciphertext block + * @param C the 64-95 bits of the ciphertext block + * @param D the 96-127 bits of the ciphertext block + * @param result the resulting plaintext + */ + private void CAST_Decipher( + uint A, + uint B, + uint C, + uint D, + uint[] result) + { + for (int i = 0; i < 6; i++) + { + int x = (11-i)*4; + // BETA <- Qi(BETA) + C ^= F1(D, _Km[x], _Kr[x]); + B ^= F2(C, _Km[x + 1], _Kr[x + 1]); + A ^= F3(B, _Km[x + 2], _Kr[x + 2]); + D ^= F1(A, _Km[x + 3], _Kr[x + 3]); + } + for (int i=6; i<12; i++) + { + int x = (11-i)*4; + // BETA <- QBARi(BETA) + D ^= F1(A, _Km[x + 3], _Kr[x + 3]); + A ^= F3(B, _Km[x + 2], _Kr[x + 2]); + B ^= F2(C, _Km[x + 1], _Kr[x + 1]); + C ^= F1(D, _Km[x], _Kr[x]); + } + result[0] = A; + result[1] = B; + result[2] = C; + result[3] = D; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast6Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast6Engine.cs.meta new file mode 100644 index 00000000..042ffc7c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Cast6Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d1669c52f77c2147bfccea922c6c851 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaCha7539Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaCha7539Engine.cs new file mode 100644 index 00000000..75e7c504 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaCha7539Engine.cs @@ -0,0 +1,69 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + ///

+ /// Implementation of Daniel J. Bernstein's ChaCha stream cipher. + /// + public class ChaCha7539Engine + : Salsa20Engine + { + /// + /// Creates a 20 rounds ChaCha engine. + /// + public ChaCha7539Engine() + { + } + + public override string AlgorithmName + { + get { return "ChaCha7539" + rounds; } + } + + protected override int NonceSize + { + get { return 12; } + } + + protected override void AdvanceCounter() + { + if (++engineState[12] == 0) + throw new InvalidOperationException("attempt to increase counter past 2^32."); + } + + protected override void ResetCounter() + { + engineState[12] = 0; + } + + protected override void SetKey(byte[] keyBytes, byte[] ivBytes) + { + if (keyBytes != null) + { + if (keyBytes.Length != 32) + throw new ArgumentException(AlgorithmName + " requires 256 bit key"); + + PackTauOrSigma(keyBytes.Length, engineState, 0); + + // Key + Pack.LE_To_UInt32(keyBytes, 0, engineState, 4, 8); + } + + // IV + Pack.LE_To_UInt32(ivBytes, 0, engineState, 13, 3); + } + + protected override void GenerateKeyStream(byte[] output) + { + ChaChaEngine.ChachaCore(rounds, engineState, x); + Pack.UInt32_To_LE(x, output, 0); + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaCha7539Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaCha7539Engine.cs.meta new file mode 100644 index 00000000..697fe158 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaCha7539Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a57a7d360758b345a64cca79b830e0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaChaEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaChaEngine.cs new file mode 100644 index 00000000..e0fc1c5e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaChaEngine.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// + /// Implementation of Daniel J. Bernstein's ChaCha stream cipher. + /// + public class ChaChaEngine + : Salsa20Engine + { + /// + /// Creates a 20 rounds ChaCha engine. + /// + public ChaChaEngine() + { + } + + /// + /// Creates a ChaCha engine with a specific number of rounds. + /// + /// the number of rounds (must be an even number). + public ChaChaEngine(int rounds) + : base(rounds) + { + } + + public override string AlgorithmName + { + get { return "ChaCha" + rounds; } + } + + protected override void AdvanceCounter() + { + if (++engineState[12] == 0) + { + ++engineState[13]; + } + } + + protected override void ResetCounter() + { + engineState[12] = engineState[13] = 0; + } + + protected override void SetKey(byte[] keyBytes, byte[] ivBytes) + { + if (keyBytes != null) + { + if ((keyBytes.Length != 16) && (keyBytes.Length != 32)) + throw new ArgumentException(AlgorithmName + " requires 128 bit or 256 bit key"); + + PackTauOrSigma(keyBytes.Length, engineState, 0); + + // Key + Pack.LE_To_UInt32(keyBytes, 0, engineState, 4, 4); + Pack.LE_To_UInt32(keyBytes, keyBytes.Length - 16, engineState, 8, 4); + } + + // IV + Pack.LE_To_UInt32(ivBytes, 0, engineState, 14, 2); + } + + protected override void GenerateKeyStream(byte[] output) + { + ChachaCore(rounds, engineState, x); + Pack.UInt32_To_LE(x, output, 0); + } + + /// + /// ChaCha function. + /// + /// The number of ChaCha rounds to execute + /// The input words. + /// The ChaCha state to modify. + internal static void ChachaCore(int rounds, uint[] input, uint[] x) + { + if (input.Length != 16) + throw new ArgumentException(); + if (x.Length != 16) + throw new ArgumentException(); + if (rounds % 2 != 0) + throw new ArgumentException("Number of rounds must be even"); + + uint x00 = input[ 0]; + uint x01 = input[ 1]; + uint x02 = input[ 2]; + uint x03 = input[ 3]; + uint x04 = input[ 4]; + uint x05 = input[ 5]; + uint x06 = input[ 6]; + uint x07 = input[ 7]; + uint x08 = input[ 8]; + uint x09 = input[ 9]; + uint x10 = input[10]; + uint x11 = input[11]; + uint x12 = input[12]; + uint x13 = input[13]; + uint x14 = input[14]; + uint x15 = input[15]; + + for (int i = rounds; i > 0; i -= 2) + { + x00 += x04; x12 = R(x12 ^ x00, 16); + x08 += x12; x04 = R(x04 ^ x08, 12); + x00 += x04; x12 = R(x12 ^ x00, 8); + x08 += x12; x04 = R(x04 ^ x08, 7); + x01 += x05; x13 = R(x13 ^ x01, 16); + x09 += x13; x05 = R(x05 ^ x09, 12); + x01 += x05; x13 = R(x13 ^ x01, 8); + x09 += x13; x05 = R(x05 ^ x09, 7); + x02 += x06; x14 = R(x14 ^ x02, 16); + x10 += x14; x06 = R(x06 ^ x10, 12); + x02 += x06; x14 = R(x14 ^ x02, 8); + x10 += x14; x06 = R(x06 ^ x10, 7); + x03 += x07; x15 = R(x15 ^ x03, 16); + x11 += x15; x07 = R(x07 ^ x11, 12); + x03 += x07; x15 = R(x15 ^ x03, 8); + x11 += x15; x07 = R(x07 ^ x11, 7); + x00 += x05; x15 = R(x15 ^ x00, 16); + x10 += x15; x05 = R(x05 ^ x10, 12); + x00 += x05; x15 = R(x15 ^ x00, 8); + x10 += x15; x05 = R(x05 ^ x10, 7); + x01 += x06; x12 = R(x12 ^ x01, 16); + x11 += x12; x06 = R(x06 ^ x11, 12); + x01 += x06; x12 = R(x12 ^ x01, 8); + x11 += x12; x06 = R(x06 ^ x11, 7); + x02 += x07; x13 = R(x13 ^ x02, 16); + x08 += x13; x07 = R(x07 ^ x08, 12); + x02 += x07; x13 = R(x13 ^ x02, 8); + x08 += x13; x07 = R(x07 ^ x08, 7); + x03 += x04; x14 = R(x14 ^ x03, 16); + x09 += x14; x04 = R(x04 ^ x09, 12); + x03 += x04; x14 = R(x14 ^ x03, 8); + x09 += x14; x04 = R(x04 ^ x09, 7); + } + + x[ 0] = x00 + input[ 0]; + x[ 1] = x01 + input[ 1]; + x[ 2] = x02 + input[ 2]; + x[ 3] = x03 + input[ 3]; + x[ 4] = x04 + input[ 4]; + x[ 5] = x05 + input[ 5]; + x[ 6] = x06 + input[ 6]; + x[ 7] = x07 + input[ 7]; + x[ 8] = x08 + input[ 8]; + x[ 9] = x09 + input[ 9]; + x[10] = x10 + input[10]; + x[11] = x11 + input[11]; + x[12] = x12 + input[12]; + x[13] = x13 + input[13]; + x[14] = x14 + input[14]; + x[15] = x15 + input[15]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaChaEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaChaEngine.cs.meta new file mode 100644 index 00000000..22c4b168 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ChaChaEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 64e919c1d89f77543913b622c89de806 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeEngine.cs new file mode 100644 index 00000000..7c13e48c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeEngine.cs @@ -0,0 +1,104 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// A class that provides a basic DESede (or Triple DES) engine. + public class DesEdeEngine + : DesEngine + { + private int[] workingKey1, workingKey2, workingKey3; + private bool forEncryption; + + /** + * initialise a DESede cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public override void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("invalid parameter passed to DESede init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + byte[] keyMaster = ((KeyParameter)parameters).GetKey(); + if (keyMaster.Length != 24 && keyMaster.Length != 16) + throw new ArgumentException("key size must be 16 or 24 bytes."); + + this.forEncryption = forEncryption; + + byte[] key1 = new byte[8]; + Array.Copy(keyMaster, 0, key1, 0, key1.Length); + workingKey1 = GenerateWorkingKey(forEncryption, key1); + + byte[] key2 = new byte[8]; + Array.Copy(keyMaster, 8, key2, 0, key2.Length); + workingKey2 = GenerateWorkingKey(!forEncryption, key2); + + if (keyMaster.Length == 24) + { + byte[] key3 = new byte[8]; + Array.Copy(keyMaster, 16, key3, 0, key3.Length); + workingKey3 = GenerateWorkingKey(forEncryption, key3); + } + else // 16 byte key + { + workingKey3 = workingKey1; + } + } + + public override string AlgorithmName + { + get { return "DESede"; } + } + + public override int GetBlockSize() + { + return BLOCK_SIZE; + } + + public override int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (workingKey1 == null) + throw new InvalidOperationException("DESede engine not initialised"); + + Check.DataLength(input, inOff, BLOCK_SIZE, "input buffer too short"); + Check.OutputLength(output, outOff, BLOCK_SIZE, "output buffer too short"); + + byte[] temp = new byte[BLOCK_SIZE]; + + if (forEncryption) + { + DesFunc(workingKey1, input, inOff, temp, 0); + DesFunc(workingKey2, temp, 0, temp, 0); + DesFunc(workingKey3, temp, 0, output, outOff); + } + else + { + DesFunc(workingKey3, input, inOff, temp, 0); + DesFunc(workingKey2, temp, 0, temp, 0); + DesFunc(workingKey1, temp, 0, output, outOff); + } + + return BLOCK_SIZE; + } + + public override void Reset() + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeEngine.cs.meta new file mode 100644 index 00000000..464de3ca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 40f7755f6290bac4fa55c0f4ad40923a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeWrapEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeWrapEngine.cs new file mode 100644 index 00000000..47574084 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeWrapEngine.cs @@ -0,0 +1,326 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * Wrap keys according to + * + * draft-ietf-smime-key-wrap-01.txt. + *

+ * Note: + *

    + *
  • this is based on a draft, and as such is subject to change - don't use this class for anything requiring long term storage.
  • + *
  • if you are using this to wrap triple-des keys you need to set the + * parity bits on the key and, if it's a two-key triple-des key, pad it + * yourself.
  • + *
+ *

+ */ + public class DesEdeWrapEngine + : IWrapper + { + /** Field engine */ + private CbcBlockCipher engine; + /** Field param */ + private KeyParameter param; + /** Field paramPlusIV */ + private ParametersWithIV paramPlusIV; + /** Field iv */ + private byte[] iv; + /** Field forWrapping */ + private bool forWrapping; + /** Field IV2 */ + private static readonly byte[] IV2 = { (byte) 0x4a, (byte) 0xdd, (byte) 0xa2, + (byte) 0x2c, (byte) 0x79, (byte) 0xe8, + (byte) 0x21, (byte) 0x05 }; + + // + // checksum digest + // + private readonly IDigest sha1 = new Sha1Digest(); + private readonly byte[] digest = new byte[20]; + + /** + * Method init + * + * @param forWrapping + * @param param + */ + public virtual void Init( + bool forWrapping, + ICipherParameters parameters) + { + this.forWrapping = forWrapping; + this.engine = new CbcBlockCipher(new DesEdeEngine()); + + SecureRandom sr; + if (parameters is ParametersWithRandom) + { + ParametersWithRandom pr = (ParametersWithRandom) parameters; + parameters = pr.Parameters; + sr = pr.Random; + } + else + { + sr = new SecureRandom(); + } + + if (parameters is KeyParameter) + { + this.param = (KeyParameter) parameters; + if (this.forWrapping) + { + // Hm, we have no IV but we want to wrap ?!? + // well, then we have to create our own IV. + this.iv = new byte[8]; + sr.NextBytes(iv); + + this.paramPlusIV = new ParametersWithIV(this.param, this.iv); + } + } + else if (parameters is ParametersWithIV) + { + if (!forWrapping) + throw new ArgumentException("You should not supply an IV for unwrapping"); + + this.paramPlusIV = (ParametersWithIV) parameters; + this.iv = this.paramPlusIV.GetIV(); + this.param = (KeyParameter) this.paramPlusIV.Parameters; + + if (this.iv.Length != 8) + throw new ArgumentException("IV is not 8 octets", "parameters"); + } + } + + /** + * Method GetAlgorithmName + * + * @return + */ + public virtual string AlgorithmName + { + get { return "DESede"; } + } + + /** + * Method wrap + * + * @param in + * @param inOff + * @param inLen + * @return + */ + public virtual byte[] Wrap( + byte[] input, + int inOff, + int length) + { + if (!forWrapping) + { + throw new InvalidOperationException("Not initialized for wrapping"); + } + + byte[] keyToBeWrapped = new byte[length]; + Array.Copy(input, inOff, keyToBeWrapped, 0, length); + + // Compute the CMS Key Checksum, (section 5.6.1), call this CKS. + byte[] CKS = CalculateCmsKeyChecksum(keyToBeWrapped); + + // Let WKCKS = WK || CKS where || is concatenation. + byte[] WKCKS = new byte[keyToBeWrapped.Length + CKS.Length]; + Array.Copy(keyToBeWrapped, 0, WKCKS, 0, keyToBeWrapped.Length); + Array.Copy(CKS, 0, WKCKS, keyToBeWrapped.Length, CKS.Length); + + // Encrypt WKCKS in CBC mode using KEK as the key and IV as the + // initialization vector. Call the results TEMP1. + + int blockSize = engine.GetBlockSize(); + + if (WKCKS.Length % blockSize != 0) + throw new InvalidOperationException("Not multiple of block length"); + + engine.Init(true, paramPlusIV); + + byte [] TEMP1 = new byte[WKCKS.Length]; + + for (int currentBytePos = 0; currentBytePos != WKCKS.Length; currentBytePos += blockSize) + { + engine.ProcessBlock(WKCKS, currentBytePos, TEMP1, currentBytePos); + } + + // Let TEMP2 = IV || TEMP1. + byte[] TEMP2 = new byte[this.iv.Length + TEMP1.Length]; + Array.Copy(this.iv, 0, TEMP2, 0, this.iv.Length); + Array.Copy(TEMP1, 0, TEMP2, this.iv.Length, TEMP1.Length); + + // Reverse the order of the octets in TEMP2 and call the result TEMP3. + byte[] TEMP3 = reverse(TEMP2); + + // Encrypt TEMP3 in CBC mode using the KEK and an initialization vector + // of 0x 4a dd a2 2c 79 e8 21 05. The resulting cipher text is the desired + // result. It is 40 octets long if a 168 bit key is being wrapped. + ParametersWithIV param2 = new ParametersWithIV(this.param, IV2); + this.engine.Init(true, param2); + + for (int currentBytePos = 0; currentBytePos != TEMP3.Length; currentBytePos += blockSize) + { + engine.ProcessBlock(TEMP3, currentBytePos, TEMP3, currentBytePos); + } + + return TEMP3; + } + + /** + * Method unwrap + * + * @param in + * @param inOff + * @param inLen + * @return + * @throws InvalidCipherTextException + */ + public virtual byte[] Unwrap( + byte[] input, + int inOff, + int length) + { + if (forWrapping) + { + throw new InvalidOperationException("Not set for unwrapping"); + } + if (input == null) + { + throw new InvalidCipherTextException("Null pointer as ciphertext"); + } + + int blockSize = engine.GetBlockSize(); + + if (length % blockSize != 0) + { + throw new InvalidCipherTextException("Ciphertext not multiple of " + blockSize); + } + + /* + // Check if the length of the cipher text is reasonable given the key + // type. It must be 40 bytes for a 168 bit key and either 32, 40, or + // 48 bytes for a 128, 192, or 256 bit key. If the length is not supported + // or inconsistent with the algorithm for which the key is intended, + // return error. + // + // we do not accept 168 bit keys. it has to be 192 bit. + int lengthA = (estimatedKeyLengthInBit / 8) + 16; + int lengthB = estimatedKeyLengthInBit % 8; + if ((lengthA != keyToBeUnwrapped.Length) || (lengthB != 0)) { + throw new XMLSecurityException("empty"); + } + */ + + // Decrypt the cipher text with TRIPLedeS in CBC mode using the KEK + // and an initialization vector (IV) of 0x4adda22c79e82105. Call the output TEMP3. + ParametersWithIV param2 = new ParametersWithIV(this.param, IV2); + this.engine.Init(false, param2); + + byte [] TEMP3 = new byte[length]; + + for (int currentBytePos = 0; currentBytePos != TEMP3.Length; currentBytePos += blockSize) + { + engine.ProcessBlock(input, inOff + currentBytePos, TEMP3, currentBytePos); + } + + // Reverse the order of the octets in TEMP3 and call the result TEMP2. + byte[] TEMP2 = reverse(TEMP3); + + // Decompose TEMP2 into IV, the first 8 octets, and TEMP1, the remaining octets. + this.iv = new byte[8]; + byte[] TEMP1 = new byte[TEMP2.Length - 8]; + Array.Copy(TEMP2, 0, this.iv, 0, 8); + Array.Copy(TEMP2, 8, TEMP1, 0, TEMP2.Length - 8); + + // Decrypt TEMP1 using TRIPLedeS in CBC mode using the KEK and the IV + // found in the previous step. Call the result WKCKS. + this.paramPlusIV = new ParametersWithIV(this.param, this.iv); + this.engine.Init(false, this.paramPlusIV); + + byte[] WKCKS = new byte[TEMP1.Length]; + + for (int currentBytePos = 0; currentBytePos != WKCKS.Length; currentBytePos += blockSize) + { + engine.ProcessBlock(TEMP1, currentBytePos, WKCKS, currentBytePos); + } + + // Decompose WKCKS. CKS is the last 8 octets and WK, the wrapped key, are + // those octets before the CKS. + byte[] result = new byte[WKCKS.Length - 8]; + byte[] CKStoBeVerified = new byte[8]; + Array.Copy(WKCKS, 0, result, 0, WKCKS.Length - 8); + Array.Copy(WKCKS, WKCKS.Length - 8, CKStoBeVerified, 0, 8); + + // Calculate a CMS Key Checksum, (section 5.6.1), over the WK and compare + // with the CKS extracted in the above step. If they are not equal, return error. + if (!CheckCmsKeyChecksum(result, CKStoBeVerified)) { + throw new InvalidCipherTextException( + "Checksum inside ciphertext is corrupted"); + } + + // WK is the wrapped key, now extracted for use in data decryption. + return result; + } + + /** + * Some key wrap algorithms make use of the Key Checksum defined + * in CMS [CMS-Algorithms]. This is used to provide an integrity + * check value for the key being wrapped. The algorithm is + * + * - Compute the 20 octet SHA-1 hash on the key being wrapped. + * - Use the first 8 octets of this hash as the checksum value. + * + * @param key + * @return + * @throws Exception + * @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + */ + private byte[] CalculateCmsKeyChecksum( + byte[] key) + { + sha1.BlockUpdate(key, 0, key.Length); + sha1.DoFinal(digest, 0); + + byte[] result = new byte[8]; + Array.Copy(digest, 0, result, 0, 8); + return result; + } + + /** + * @param key + * @param checksum + * @return + * @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + */ + private bool CheckCmsKeyChecksum( + byte[] key, + byte[] checksum) + { + return Arrays.ConstantTimeAreEqual(CalculateCmsKeyChecksum(key), checksum); + } + + private static byte[] reverse(byte[] bs) + { + byte[] result = new byte[bs.Length]; + for (int i = 0; i < bs.Length; i++) + { + result[i] = bs[bs.Length - (i + 1)]; + } + return result; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeWrapEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeWrapEngine.cs.meta new file mode 100644 index 00000000..417f67bf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEdeWrapEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f34c10037e77a294fa8cf56041b48c29 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEngine.cs new file mode 100644 index 00000000..cf9255c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEngine.cs @@ -0,0 +1,479 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// A class that provides a basic DES engine. + public class DesEngine + : IBlockCipher + { + internal const int BLOCK_SIZE = 8; + + private int[] workingKey; + + public virtual int[] GetWorkingKey() + { + return workingKey; + } + + /** + * initialise a DES cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("invalid parameter passed to DES init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + workingKey = GenerateWorkingKey(forEncryption, ((KeyParameter)parameters).GetKey()); + } + + public virtual string AlgorithmName + { + get { return "DES"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (workingKey == null) + throw new InvalidOperationException("DES engine not initialised"); + + Check.DataLength(input, inOff, BLOCK_SIZE, "input buffer too short"); + Check.OutputLength(output, outOff, BLOCK_SIZE, "output buffer too short"); + + DesFunc(workingKey, input, inOff, output, outOff); + + return BLOCK_SIZE; + } + + public virtual void Reset() + { + } + + /** + * what follows is mainly taken from "Applied Cryptography", by + * Bruce Schneier, however it also bears great resemblance to Richard + * Outerbridge's D3DES... + */ + +// private static readonly short[] Df_Key = +// { +// 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, +// 0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10, +// 0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 +// }; + + private static readonly short[] bytebit = + { + 128, 64, 32, 16, 8, 4, 2, 1 + }; + + private static readonly int[] bigbyte = + { + 0x800000, 0x400000, 0x200000, 0x100000, + 0x80000, 0x40000, 0x20000, 0x10000, + 0x8000, 0x4000, 0x2000, 0x1000, + 0x800, 0x400, 0x200, 0x100, + 0x80, 0x40, 0x20, 0x10, + 0x8, 0x4, 0x2, 0x1 + }; + + /* + * Use the key schedule specified in the Standard (ANSI X3.92-1981). + */ + private static readonly byte[] pc1 = + { + 56, 48, 40, 32, 24, 16, 8, 0, 57, 49, 41, 33, 25, 17, + 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, + 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, + 13, 5, 60, 52, 44, 36, 28, 20, 12, 4, 27, 19, 11, 3 + }; + + private static readonly byte[] totrot = + { + 1, 2, 4, 6, 8, 10, 12, 14, + 15, 17, 19, 21, 23, 25, 27, 28 + }; + + private static readonly byte[] pc2 = + { + 13, 16, 10, 23, 0, 4, 2, 27, 14, 5, 20, 9, + 22, 18, 11, 3, 25, 7, 15, 6, 26, 19, 12, 1, + 40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47, + 43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 + }; + + private static readonly uint[] SP1 = + { + 0x01010400, 0x00000000, 0x00010000, 0x01010404, + 0x01010004, 0x00010404, 0x00000004, 0x00010000, + 0x00000400, 0x01010400, 0x01010404, 0x00000400, + 0x01000404, 0x01010004, 0x01000000, 0x00000004, + 0x00000404, 0x01000400, 0x01000400, 0x00010400, + 0x00010400, 0x01010000, 0x01010000, 0x01000404, + 0x00010004, 0x01000004, 0x01000004, 0x00010004, + 0x00000000, 0x00000404, 0x00010404, 0x01000000, + 0x00010000, 0x01010404, 0x00000004, 0x01010000, + 0x01010400, 0x01000000, 0x01000000, 0x00000400, + 0x01010004, 0x00010000, 0x00010400, 0x01000004, + 0x00000400, 0x00000004, 0x01000404, 0x00010404, + 0x01010404, 0x00010004, 0x01010000, 0x01000404, + 0x01000004, 0x00000404, 0x00010404, 0x01010400, + 0x00000404, 0x01000400, 0x01000400, 0x00000000, + 0x00010004, 0x00010400, 0x00000000, 0x01010004 + }; + + private static readonly uint[] SP2 = + { + 0x80108020, 0x80008000, 0x00008000, 0x00108020, + 0x00100000, 0x00000020, 0x80100020, 0x80008020, + 0x80000020, 0x80108020, 0x80108000, 0x80000000, + 0x80008000, 0x00100000, 0x00000020, 0x80100020, + 0x00108000, 0x00100020, 0x80008020, 0x00000000, + 0x80000000, 0x00008000, 0x00108020, 0x80100000, + 0x00100020, 0x80000020, 0x00000000, 0x00108000, + 0x00008020, 0x80108000, 0x80100000, 0x00008020, + 0x00000000, 0x00108020, 0x80100020, 0x00100000, + 0x80008020, 0x80100000, 0x80108000, 0x00008000, + 0x80100000, 0x80008000, 0x00000020, 0x80108020, + 0x00108020, 0x00000020, 0x00008000, 0x80000000, + 0x00008020, 0x80108000, 0x00100000, 0x80000020, + 0x00100020, 0x80008020, 0x80000020, 0x00100020, + 0x00108000, 0x00000000, 0x80008000, 0x00008020, + 0x80000000, 0x80100020, 0x80108020, 0x00108000 + }; + + private static readonly uint[] SP3 = + { + 0x00000208, 0x08020200, 0x00000000, 0x08020008, + 0x08000200, 0x00000000, 0x00020208, 0x08000200, + 0x00020008, 0x08000008, 0x08000008, 0x00020000, + 0x08020208, 0x00020008, 0x08020000, 0x00000208, + 0x08000000, 0x00000008, 0x08020200, 0x00000200, + 0x00020200, 0x08020000, 0x08020008, 0x00020208, + 0x08000208, 0x00020200, 0x00020000, 0x08000208, + 0x00000008, 0x08020208, 0x00000200, 0x08000000, + 0x08020200, 0x08000000, 0x00020008, 0x00000208, + 0x00020000, 0x08020200, 0x08000200, 0x00000000, + 0x00000200, 0x00020008, 0x08020208, 0x08000200, + 0x08000008, 0x00000200, 0x00000000, 0x08020008, + 0x08000208, 0x00020000, 0x08000000, 0x08020208, + 0x00000008, 0x00020208, 0x00020200, 0x08000008, + 0x08020000, 0x08000208, 0x00000208, 0x08020000, + 0x00020208, 0x00000008, 0x08020008, 0x00020200 + }; + + private static readonly uint[] SP4 = + { + 0x00802001, 0x00002081, 0x00002081, 0x00000080, + 0x00802080, 0x00800081, 0x00800001, 0x00002001, + 0x00000000, 0x00802000, 0x00802000, 0x00802081, + 0x00000081, 0x00000000, 0x00800080, 0x00800001, + 0x00000001, 0x00002000, 0x00800000, 0x00802001, + 0x00000080, 0x00800000, 0x00002001, 0x00002080, + 0x00800081, 0x00000001, 0x00002080, 0x00800080, + 0x00002000, 0x00802080, 0x00802081, 0x00000081, + 0x00800080, 0x00800001, 0x00802000, 0x00802081, + 0x00000081, 0x00000000, 0x00000000, 0x00802000, + 0x00002080, 0x00800080, 0x00800081, 0x00000001, + 0x00802001, 0x00002081, 0x00002081, 0x00000080, + 0x00802081, 0x00000081, 0x00000001, 0x00002000, + 0x00800001, 0x00002001, 0x00802080, 0x00800081, + 0x00002001, 0x00002080, 0x00800000, 0x00802001, + 0x00000080, 0x00800000, 0x00002000, 0x00802080 + }; + + private static readonly uint[] SP5 = + { + 0x00000100, 0x02080100, 0x02080000, 0x42000100, + 0x00080000, 0x00000100, 0x40000000, 0x02080000, + 0x40080100, 0x00080000, 0x02000100, 0x40080100, + 0x42000100, 0x42080000, 0x00080100, 0x40000000, + 0x02000000, 0x40080000, 0x40080000, 0x00000000, + 0x40000100, 0x42080100, 0x42080100, 0x02000100, + 0x42080000, 0x40000100, 0x00000000, 0x42000000, + 0x02080100, 0x02000000, 0x42000000, 0x00080100, + 0x00080000, 0x42000100, 0x00000100, 0x02000000, + 0x40000000, 0x02080000, 0x42000100, 0x40080100, + 0x02000100, 0x40000000, 0x42080000, 0x02080100, + 0x40080100, 0x00000100, 0x02000000, 0x42080000, + 0x42080100, 0x00080100, 0x42000000, 0x42080100, + 0x02080000, 0x00000000, 0x40080000, 0x42000000, + 0x00080100, 0x02000100, 0x40000100, 0x00080000, + 0x00000000, 0x40080000, 0x02080100, 0x40000100 + }; + + private static readonly uint[] SP6 = + { + 0x20000010, 0x20400000, 0x00004000, 0x20404010, + 0x20400000, 0x00000010, 0x20404010, 0x00400000, + 0x20004000, 0x00404010, 0x00400000, 0x20000010, + 0x00400010, 0x20004000, 0x20000000, 0x00004010, + 0x00000000, 0x00400010, 0x20004010, 0x00004000, + 0x00404000, 0x20004010, 0x00000010, 0x20400010, + 0x20400010, 0x00000000, 0x00404010, 0x20404000, + 0x00004010, 0x00404000, 0x20404000, 0x20000000, + 0x20004000, 0x00000010, 0x20400010, 0x00404000, + 0x20404010, 0x00400000, 0x00004010, 0x20000010, + 0x00400000, 0x20004000, 0x20000000, 0x00004010, + 0x20000010, 0x20404010, 0x00404000, 0x20400000, + 0x00404010, 0x20404000, 0x00000000, 0x20400010, + 0x00000010, 0x00004000, 0x20400000, 0x00404010, + 0x00004000, 0x00400010, 0x20004010, 0x00000000, + 0x20404000, 0x20000000, 0x00400010, 0x20004010 + }; + + private static readonly uint[] SP7 = + { + 0x00200000, 0x04200002, 0x04000802, 0x00000000, + 0x00000800, 0x04000802, 0x00200802, 0x04200800, + 0x04200802, 0x00200000, 0x00000000, 0x04000002, + 0x00000002, 0x04000000, 0x04200002, 0x00000802, + 0x04000800, 0x00200802, 0x00200002, 0x04000800, + 0x04000002, 0x04200000, 0x04200800, 0x00200002, + 0x04200000, 0x00000800, 0x00000802, 0x04200802, + 0x00200800, 0x00000002, 0x04000000, 0x00200800, + 0x04000000, 0x00200800, 0x00200000, 0x04000802, + 0x04000802, 0x04200002, 0x04200002, 0x00000002, + 0x00200002, 0x04000000, 0x04000800, 0x00200000, + 0x04200800, 0x00000802, 0x00200802, 0x04200800, + 0x00000802, 0x04000002, 0x04200802, 0x04200000, + 0x00200800, 0x00000000, 0x00000002, 0x04200802, + 0x00000000, 0x00200802, 0x04200000, 0x00000800, + 0x04000002, 0x04000800, 0x00000800, 0x00200002 + }; + + private static readonly uint[] SP8 = + { + 0x10001040, 0x00001000, 0x00040000, 0x10041040, + 0x10000000, 0x10001040, 0x00000040, 0x10000000, + 0x00040040, 0x10040000, 0x10041040, 0x00041000, + 0x10041000, 0x00041040, 0x00001000, 0x00000040, + 0x10040000, 0x10000040, 0x10001000, 0x00001040, + 0x00041000, 0x00040040, 0x10040040, 0x10041000, + 0x00001040, 0x00000000, 0x00000000, 0x10040040, + 0x10000040, 0x10001000, 0x00041040, 0x00040000, + 0x00041040, 0x00040000, 0x10041000, 0x00001000, + 0x00000040, 0x10040040, 0x00001000, 0x00041040, + 0x10001000, 0x00000040, 0x10000040, 0x10040000, + 0x10040040, 0x10000000, 0x00040000, 0x10001040, + 0x00000000, 0x10041040, 0x00040040, 0x10000040, + 0x10040000, 0x10001000, 0x10001040, 0x00000000, + 0x10041040, 0x00041000, 0x00041000, 0x00001040, + 0x00001040, 0x00040040, 0x10000000, 0x10041000 + }; + + /** + * Generate an integer based working key based on our secret key + * and what we processing we are planning to do. + * + * Acknowledgements for this routine go to James Gillogly and Phil Karn. + * (whoever, and wherever they are!). + */ + protected static int[] GenerateWorkingKey( + bool encrypting, + byte[] key) + { + int[] newKey = new int[32]; + bool[] pc1m = new bool[56]; + bool[] pcr = new bool[56]; + + for (int j = 0; j < 56; j++ ) + { + int l = pc1[j]; + + pc1m[j] = ((key[(uint) l >> 3] & bytebit[l & 07]) != 0); + } + + for (int i = 0; i < 16; i++) + { + int l, m, n; + + if (encrypting) + { + m = i << 1; + } + else + { + m = (15 - i) << 1; + } + + n = m + 1; + newKey[m] = newKey[n] = 0; + + for (int j = 0; j < 28; j++) + { + l = j + totrot[i]; + if ( l < 28 ) + { + pcr[j] = pc1m[l]; + } + else + { + pcr[j] = pc1m[l - 28]; + } + } + + for (int j = 28; j < 56; j++) + { + l = j + totrot[i]; + if (l < 56 ) + { + pcr[j] = pc1m[l]; + } + else + { + pcr[j] = pc1m[l - 28]; + } + } + + for (int j = 0; j < 24; j++) + { + if (pcr[pc2[j]]) + { + newKey[m] |= bigbyte[j]; + } + + if (pcr[pc2[j + 24]]) + { + newKey[n] |= bigbyte[j]; + } + } + } + + // + // store the processed key + // + for (int i = 0; i != 32; i += 2) + { + int i1, i2; + + i1 = newKey[i]; + i2 = newKey[i + 1]; + + newKey[i] = (int) ( (uint) ((i1 & 0x00fc0000) << 6) | + (uint) ((i1 & 0x00000fc0) << 10) | + ((uint) (i2 & 0x00fc0000) >> 10) | + ((uint) (i2 & 0x00000fc0) >> 6)); + + newKey[i + 1] = (int) ( (uint) ((i1 & 0x0003f000) << 12) | + (uint) ((i1 & 0x0000003f) << 16) | + ((uint) (i2 & 0x0003f000) >> 4) | + (uint) (i2 & 0x0000003f)); + } + + return newKey; + } + + /** + * the DES engine. + */ + internal static void DesFunc( + int[] wKey, + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + uint left = Pack.BE_To_UInt32(input, inOff); + uint right = Pack.BE_To_UInt32(input, inOff + 4); + uint work; + + work = ((left >> 4) ^ right) & 0x0f0f0f0f; + right ^= work; + left ^= (work << 4); + work = ((left >> 16) ^ right) & 0x0000ffff; + right ^= work; + left ^= (work << 16); + work = ((right >> 2) ^ left) & 0x33333333; + left ^= work; + right ^= (work << 2); + work = ((right >> 8) ^ left) & 0x00ff00ff; + left ^= work; + right ^= (work << 8); + right = (right << 1) | (right >> 31); + work = (left ^ right) & 0xaaaaaaaa; + left ^= work; + right ^= work; + left = (left << 1) | (left >> 31); + + for (int round = 0; round < 8; round++) + { + uint fval; + + work = (right << 28) | (right >> 4); + work ^= (uint)wKey[round * 4 + 0]; + fval = SP7[work & 0x3f]; + fval |= SP5[(work >> 8) & 0x3f]; + fval |= SP3[(work >> 16) & 0x3f]; + fval |= SP1[(work >> 24) & 0x3f]; + work = right ^ (uint)wKey[round * 4 + 1]; + fval |= SP8[ work & 0x3f]; + fval |= SP6[(work >> 8) & 0x3f]; + fval |= SP4[(work >> 16) & 0x3f]; + fval |= SP2[(work >> 24) & 0x3f]; + left ^= fval; + work = (left << 28) | (left >> 4); + work ^= (uint)wKey[round * 4 + 2]; + fval = SP7[ work & 0x3f]; + fval |= SP5[(work >> 8) & 0x3f]; + fval |= SP3[(work >> 16) & 0x3f]; + fval |= SP1[(work >> 24) & 0x3f]; + work = left ^ (uint)wKey[round * 4 + 3]; + fval |= SP8[ work & 0x3f]; + fval |= SP6[(work >> 8) & 0x3f]; + fval |= SP4[(work >> 16) & 0x3f]; + fval |= SP2[(work >> 24) & 0x3f]; + right ^= fval; + } + + right = (right << 31) | (right >> 1); + work = (left ^ right) & 0xaaaaaaaa; + left ^= work; + right ^= work; + left = (left << 31) | (left >> 1); + work = ((left >> 8) ^ right) & 0x00ff00ff; + right ^= work; + left ^= (work << 8); + work = ((left >> 2) ^ right) & 0x33333333; + right ^= work; + left ^= (work << 2); + work = ((right >> 16) ^ left) & 0x0000ffff; + left ^= work; + right ^= (work << 16); + work = ((right >> 4) ^ left) & 0x0f0f0f0f; + left ^= work; + right ^= (work << 4); + + Pack.UInt32_To_BE(right, outBytes, outOff); + Pack.UInt32_To_BE(left, outBytes, outOff + 4); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEngine.cs.meta new file mode 100644 index 00000000..bb55258d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/DesEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f19a6fb9b287c8f449b0d2caee173303 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624Engine.cs new file mode 100644 index 00000000..4f0452cc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624Engine.cs @@ -0,0 +1,1088 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * implementation of DSTU 7624 (Kalyna) + */ + public class Dstu7624Engine + : IBlockCipher + { + private ulong[] internalState; + private ulong[] workingKey; + private ulong[][] roundKeys; + + /* Number of 64-bit words in block */ + private int wordsInBlock; + + /* Number of 64-bit words in key */ + private int wordsInKey; + + /* Number of encryption rounds depending on key length */ + private const int ROUNDS_128 = 10; + private const int ROUNDS_256 = 14; + private const int ROUNDS_512 = 18; + + private int roundsAmount; + + private bool forEncryption; + + public Dstu7624Engine(int blockSizeBits) + { + /* DSTU7624 supports 128 | 256 | 512 key/block sizes */ + if (blockSizeBits != 128 && blockSizeBits != 256 && blockSizeBits != 512) + { + throw new ArgumentException("unsupported block length: only 128/256/512 are allowed"); + } + + wordsInBlock = blockSizeBits / 64; + internalState = new ulong[wordsInBlock]; + } + + #region INITIALIZATION + + public virtual void Init(bool forEncryption, ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("Invalid parameter passed to Dstu7624Engine Init"); + + this.forEncryption = forEncryption; + + byte[] keyBytes = ((KeyParameter)parameters).GetKey(); + int keyBitLength = keyBytes.Length << 3; + int blockBitLength = wordsInBlock << 6; + + if (keyBitLength != 128 && keyBitLength != 256 && keyBitLength != 512) + { + throw new ArgumentException("unsupported key length: only 128/256/512 are allowed"); + } + + /* Limitations on key lengths depending on block lengths. See table 6.1 in standard */ + if (keyBitLength != blockBitLength && keyBitLength != (2 * blockBitLength)) + { + throw new ArgumentException("Unsupported key length"); + } + + switch (keyBitLength) + { + case 128: + roundsAmount = ROUNDS_128; + break; + case 256: + roundsAmount = ROUNDS_256; + break; + case 512: + roundsAmount = ROUNDS_512; + break; + } + + wordsInKey = keyBitLength / 64; + + /* +1 round key as defined in standard */ + roundKeys = new ulong[roundsAmount + 1][]; + for (int roundKeyIndex = 0; roundKeyIndex < roundKeys.Length; roundKeyIndex++) + { + roundKeys[roundKeyIndex] = new ulong[wordsInBlock]; + } + + workingKey = new ulong[wordsInKey]; + + if (keyBytes.Length != wordsInKey * 8) + { + throw new ArgumentException("Invalid key parameter passed to Dstu7624Engine Init"); + } + + /* Unpack encryption key bytes to words */ + Pack.LE_To_UInt64(keyBytes, 0, workingKey); + + ulong[] tempKeys = new ulong[wordsInBlock]; + + /* KSA in DSTU7624 is strengthened to mitigate known weaknesses in AES KSA (eprint.iacr.org/2012/260.pdf) */ + WorkingKeyExpandKT(workingKey, tempKeys); + WorkingKeyExpandEven(workingKey, tempKeys); + WorkingKeyExpandOdd(); + } + + private void WorkingKeyExpandKT(ulong[] workingKey, ulong[] tempKeys) + { + ulong[] k0 = new ulong[wordsInBlock]; + ulong[] k1 = new ulong[wordsInBlock]; + + internalState = new ulong[wordsInBlock]; + internalState[0] += (ulong)(wordsInBlock + wordsInKey + 1); + + if (wordsInBlock == wordsInKey) + { + Array.Copy(workingKey, 0, k0, 0, k0.Length); + Array.Copy(workingKey, 0, k1, 0, k1.Length); + } + else + { + Array.Copy(workingKey, 0, k0, 0, wordsInBlock); + Array.Copy(workingKey, wordsInBlock, k1, 0, wordsInBlock); + } + + + for (int wordIndex = 0; wordIndex < internalState.Length; wordIndex++) + { + internalState[wordIndex] += k0[wordIndex]; + } + + EncryptionRound(); + + for (int wordIndex = 0; wordIndex < internalState.Length; wordIndex++) + { + internalState[wordIndex] ^= k1[wordIndex]; + } + + EncryptionRound(); + + for (int wordIndex = 0; wordIndex < internalState.Length; wordIndex++) + { + internalState[wordIndex] += k0[wordIndex]; + } + + EncryptionRound(); + + Array.Copy(internalState, 0, tempKeys, 0, wordsInBlock); + } + + private void WorkingKeyExpandEven(ulong[] workingKey, ulong[] tempKey) + { + ulong[] initialData = new ulong[wordsInKey]; + ulong[] tempRoundKey = new ulong[wordsInBlock]; + + int round = 0; + + Array.Copy(workingKey, 0, initialData, 0, wordsInKey); + + ulong tmv = 0x0001000100010001UL; + + while (true) + { + for (int wordIndex = 0; wordIndex < wordsInBlock; wordIndex++) + { + tempRoundKey[wordIndex] = tempKey[wordIndex] + tmv; + } + + for (int wordIndex = 0; wordIndex < wordsInBlock; wordIndex++) + { + internalState[wordIndex] = initialData[wordIndex] + tempRoundKey[wordIndex]; + } + + EncryptionRound(); + + for (int wordIndex = 0; wordIndex < wordsInBlock; wordIndex++) + { + internalState[wordIndex] ^= tempRoundKey[wordIndex]; + } + + EncryptionRound(); + + for (int wordIndex = 0; wordIndex < wordsInBlock; wordIndex++) + { + internalState[wordIndex] += tempRoundKey[wordIndex]; + } + + Array.Copy(internalState, 0, roundKeys[round], 0, wordsInBlock); + + if (roundsAmount == round) + { + break; + } + + if (wordsInKey != wordsInBlock) + { + round += 2; + tmv <<= 1; + + for (int wordIndex = 0; wordIndex < wordsInBlock; wordIndex++) + { + tempRoundKey[wordIndex] = tempKey[wordIndex] + tmv; + } + + for (int wordIndex = 0; wordIndex < wordsInBlock; wordIndex++) + { + internalState[wordIndex] = initialData[wordsInBlock + wordIndex] + tempRoundKey[wordIndex]; + } + + EncryptionRound(); + + for (int wordIndex = 0; wordIndex < wordsInBlock; wordIndex++) + { + internalState[wordIndex] ^= tempRoundKey[wordIndex]; + } + + EncryptionRound(); + + for (int wordIndex = 0; wordIndex < wordsInBlock; wordIndex++) + { + internalState[wordIndex] += tempRoundKey[wordIndex]; + } + + Array.Copy(internalState, 0, roundKeys[round], 0, wordsInBlock); + + if (roundsAmount == round) + { + break; + } + } + + round += 2; + tmv <<= 1; + + ulong temp = initialData[0]; + for (int i = 1; i < initialData.Length; ++i) + { + initialData[i - 1] = initialData[i]; + } + initialData[initialData.Length - 1] = temp; + } + } + + private void WorkingKeyExpandOdd() + { + for (int roundIndex = 1; roundIndex < roundsAmount; roundIndex += 2) + { + RotateLeft(roundKeys[roundIndex - 1], roundKeys[roundIndex]); + } + } + + #endregion + + public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff) + { + if (workingKey == null) + throw new InvalidOperationException("Dstu7624Engine not initialised"); + + Check.DataLength(input, inOff, GetBlockSize(), "input buffer too short"); + Check.OutputLength(output, outOff, GetBlockSize(), "output buffer too short"); + + if (forEncryption) + { + /* Encrypt */ + switch (wordsInBlock) + { + case 2: + { + EncryptBlock_128(input, inOff, output, outOff); + break; + } + default: + { + Pack.LE_To_UInt64(input, inOff, internalState); + AddRoundKey(0); + for (int round = 0;;) + { + EncryptionRound(); + + if (++round == roundsAmount) + { + break; + } + + XorRoundKey(round); + } + AddRoundKey(roundsAmount); + Pack.UInt64_To_LE(internalState, output, outOff); + break; + } + } + } + else + { + /* Decrypt */ + switch (wordsInBlock) + { + case 2: + { + DecryptBlock_128(input, inOff, output, outOff); + break; + } + default: + { + Pack.LE_To_UInt64(input, inOff, internalState); + SubRoundKey(roundsAmount); + for (int round = roundsAmount;;) + { + DecryptionRound(); + + if (--round == 0) + { + break; + } + + XorRoundKey(round); + } + SubRoundKey(0); + Pack.UInt64_To_LE(internalState, output, outOff); + break; + } + } + } + + return GetBlockSize(); + } + + private void EncryptionRound() + { + SubBytes(); + ShiftRows(); + MixColumns(); + } + + private void DecryptionRound() + { + MixColumnsInv(); + InvShiftRows(); + InvSubBytes(); + } + + private void DecryptBlock_128(byte[] input, int inOff, byte[] output, int outOff) + { + ulong c0 = Pack.LE_To_UInt64(input, inOff); + ulong c1 = Pack.LE_To_UInt64(input, inOff + 8); + + ulong[] roundKey = roundKeys[roundsAmount]; + c0 -= roundKey[0]; + c1 -= roundKey[1]; + + for (int round = roundsAmount;;) + { + c0 = MixColumnInv(c0); + c1 = MixColumnInv(c1); + + uint lo0 = (uint)c0, hi0 = (uint)(c0 >> 32); + uint lo1 = (uint)c1, hi1 = (uint)(c1 >> 32); + + { + byte t0 = T0[lo0 & 0xFF]; + byte t1 = T1[(lo0 >> 8) & 0xFF]; + byte t2 = T2[(lo0 >> 16) & 0xFF]; + byte t3 = T3[lo0 >> 24]; + lo0 = (uint)t0 | ((uint)t1 << 8) | ((uint)t2 << 16) | ((uint)t3 << 24); + byte t4 = T0[hi1 & 0xFF]; + byte t5 = T1[(hi1 >> 8) & 0xFF]; + byte t6 = T2[(hi1 >> 16) & 0xFF]; + byte t7 = T3[hi1 >> 24]; + hi1 = (uint)t4 | ((uint)t5 << 8) | ((uint)t6 << 16) | ((uint)t7 << 24); + c0 = (ulong)lo0 | ((ulong)hi1 << 32); + } + + { + byte t0 = T0[lo1 & 0xFF]; + byte t1 = T1[(lo1 >> 8) & 0xFF]; + byte t2 = T2[(lo1 >> 16) & 0xFF]; + byte t3 = T3[lo1 >> 24]; + lo1 = (uint)t0 | ((uint)t1 << 8) | ((uint)t2 << 16) | ((uint)t3 << 24); + byte t4 = T0[hi0 & 0xFF]; + byte t5 = T1[(hi0 >> 8) & 0xFF]; + byte t6 = T2[(hi0 >> 16) & 0xFF]; + byte t7 = T3[hi0 >> 24]; + hi0 = (uint)t4 | ((uint)t5 << 8) | ((uint)t6 << 16) | ((uint)t7 << 24); + c1 = (ulong)lo1 | ((ulong)hi0 << 32); + } + + if (--round == 0) + { + break; + } + + roundKey = roundKeys[round]; + c0 ^= roundKey[0]; + c1 ^= roundKey[1]; + } + + roundKey = roundKeys[0]; + c0 -= roundKey[0]; + c1 -= roundKey[1]; + + Pack.UInt64_To_LE(c0, output, outOff); + Pack.UInt64_To_LE(c1, output, outOff + 8); + } + + private void EncryptBlock_128(byte[] input, int inOff, byte[] output, int outOff) + { + ulong c0 = Pack.LE_To_UInt64(input, inOff); + ulong c1 = Pack.LE_To_UInt64(input, inOff + 8); + + ulong[] roundKey = roundKeys[0]; + c0 += roundKey[0]; + c1 += roundKey[1]; + + for (int round = 0;;) + { + uint lo0 = (uint)c0, hi0 = (uint)(c0 >> 32); + uint lo1 = (uint)c1, hi1 = (uint)(c1 >> 32); + + { + byte t0 = S0[lo0 & 0xFF]; + byte t1 = S1[(lo0 >> 8) & 0xFF]; + byte t2 = S2[(lo0 >> 16) & 0xFF]; + byte t3 = S3[lo0 >> 24]; + lo0 = (uint)t0 | ((uint)t1 << 8) | ((uint)t2 << 16) | ((uint)t3 << 24); + byte t4 = S0[hi1 & 0xFF]; + byte t5 = S1[(hi1 >> 8) & 0xFF]; + byte t6 = S2[(hi1 >> 16) & 0xFF]; + byte t7 = S3[hi1 >> 24]; + hi1 = (uint)t4 | ((uint)t5 << 8) | ((uint)t6 << 16) | ((uint)t7 << 24); + c0 = (ulong)lo0 | ((ulong)hi1 << 32); + } + + { + byte t0 = S0[lo1 & 0xFF]; + byte t1 = S1[(lo1 >> 8) & 0xFF]; + byte t2 = S2[(lo1 >> 16) & 0xFF]; + byte t3 = S3[lo1 >> 24]; + lo1 = (uint)t0 | ((uint)t1 << 8) | ((uint)t2 << 16) | ((uint)t3 << 24); + byte t4 = S0[hi0 & 0xFF]; + byte t5 = S1[(hi0 >> 8) & 0xFF]; + byte t6 = S2[(hi0 >> 16) & 0xFF]; + byte t7 = S3[hi0 >> 24]; + hi0 = (uint)t4 | ((uint)t5 << 8) | ((uint)t6 << 16) | ((uint)t7 << 24); + c1 = (ulong)lo1 | ((ulong)hi0 << 32); + } + + c0 = MixColumn(c0); + c1 = MixColumn(c1); + + if (++round == roundsAmount) + { + break; + } + + roundKey = roundKeys[round]; + c0 ^= roundKey[0]; + c1 ^= roundKey[1]; + } + + roundKey = roundKeys[roundsAmount]; + c0 += roundKey[0]; + c1 += roundKey[1]; + + Pack.UInt64_To_LE(c0, output, outOff); + Pack.UInt64_To_LE(c1, output, outOff + 8); + } + + private void SubBytes() + { + for (int i = 0; i < wordsInBlock; i++) + { + ulong u = internalState[i]; + uint lo = (uint)u, hi = (uint)(u >> 32); + byte t0 = S0[lo & 0xFF]; + byte t1 = S1[(lo >> 8) & 0xFF]; + byte t2 = S2[(lo >> 16) & 0xFF]; + byte t3 = S3[lo >> 24]; + lo = (uint)t0 | ((uint)t1 << 8) | ((uint)t2 << 16) | ((uint)t3 << 24); + byte t4 = S0[hi & 0xFF]; + byte t5 = S1[(hi >> 8) & 0xFF]; + byte t6 = S2[(hi >> 16) & 0xFF]; + byte t7 = S3[hi >> 24]; + hi = (uint)t4 | ((uint)t5 << 8) | ((uint)t6 << 16) | ((uint)t7 << 24); + internalState[i] = (ulong)lo | ((ulong)hi << 32); + } + } + + private void InvSubBytes() + { + for (int i = 0; i < wordsInBlock; i++) + { + ulong u = internalState[i]; + uint lo = (uint)u, hi = (uint)(u >> 32); + byte t0 = T0[lo & 0xFF]; + byte t1 = T1[(lo >> 8) & 0xFF]; + byte t2 = T2[(lo >> 16) & 0xFF]; + byte t3 = T3[lo >> 24]; + lo = (uint)t0 | ((uint)t1 << 8) | ((uint)t2 << 16) | ((uint)t3 << 24); + byte t4 = T0[hi & 0xFF]; + byte t5 = T1[(hi >> 8) & 0xFF]; + byte t6 = T2[(hi >> 16) & 0xFF]; + byte t7 = T3[hi >> 24]; + hi = (uint)t4 | ((uint)t5 << 8) | ((uint)t6 << 16) | ((uint)t7 << 24); + internalState[i] = (ulong)lo | ((ulong)hi << 32); + } + } + + private void ShiftRows() + { + switch (wordsInBlock) + { + case 2: + { + ulong c0 = internalState[0], c1 = internalState[1]; + ulong d; + + d = (c0 ^ c1) & 0xFFFFFFFF00000000UL; c0 ^= d; c1 ^= d; + + internalState[0] = c0; + internalState[1] = c1; + break; + } + case 4: + { + ulong c0 = internalState[0], c1 = internalState[1], c2 = internalState[2], c3 = internalState[3]; + ulong d; + + d = (c0 ^ c2) & 0xFFFFFFFF00000000UL; c0 ^= d; c2 ^= d; + d = (c1 ^ c3) & 0x0000FFFFFFFF0000UL; c1 ^= d; c3 ^= d; + + d = (c0 ^ c1) & 0xFFFF0000FFFF0000UL; c0 ^= d; c1 ^= d; + d = (c2 ^ c3) & 0xFFFF0000FFFF0000UL; c2 ^= d; c3 ^= d; + + internalState[0] = c0; + internalState[1] = c1; + internalState[2] = c2; + internalState[3] = c3; + break; + } + case 8: + { + ulong c0 = internalState[0], c1 = internalState[1], c2 = internalState[2], c3 = internalState[3]; + ulong c4 = internalState[4], c5 = internalState[5], c6 = internalState[6], c7 = internalState[7]; + ulong d; + + d = (c0 ^ c4) & 0xFFFFFFFF00000000UL; c0 ^= d; c4 ^= d; + d = (c1 ^ c5) & 0x00FFFFFFFF000000UL; c1 ^= d; c5 ^= d; + d = (c2 ^ c6) & 0x0000FFFFFFFF0000UL; c2 ^= d; c6 ^= d; + d = (c3 ^ c7) & 0x000000FFFFFFFF00UL; c3 ^= d; c7 ^= d; + + d = (c0 ^ c2) & 0xFFFF0000FFFF0000UL; c0 ^= d; c2 ^= d; + d = (c1 ^ c3) & 0x00FFFF0000FFFF00UL; c1 ^= d; c3 ^= d; + d = (c4 ^ c6) & 0xFFFF0000FFFF0000UL; c4 ^= d; c6 ^= d; + d = (c5 ^ c7) & 0x00FFFF0000FFFF00UL; c5 ^= d; c7 ^= d; + + d = (c0 ^ c1) & 0xFF00FF00FF00FF00UL; c0 ^= d; c1 ^= d; + d = (c2 ^ c3) & 0xFF00FF00FF00FF00UL; c2 ^= d; c3 ^= d; + d = (c4 ^ c5) & 0xFF00FF00FF00FF00UL; c4 ^= d; c5 ^= d; + d = (c6 ^ c7) & 0xFF00FF00FF00FF00UL; c6 ^= d; c7 ^= d; + + internalState[0] = c0; + internalState[1] = c1; + internalState[2] = c2; + internalState[3] = c3; + internalState[4] = c4; + internalState[5] = c5; + internalState[6] = c6; + internalState[7] = c7; + break; + } + default: + { + throw new InvalidOperationException("unsupported block length: only 128/256/512 are allowed"); + } + } + } + + private void InvShiftRows() + { + switch (wordsInBlock) + { + case 2: + { + ulong c0 = internalState[0], c1 = internalState[1]; + ulong d; + + d = (c0 ^ c1) & 0xFFFFFFFF00000000UL; c0 ^= d; c1 ^= d; + + internalState[0] = c0; + internalState[1] = c1; + break; + } + case 4: + { + ulong c0 = internalState[0], c1 = internalState[1], c2 = internalState[2], c3 = internalState[3]; + ulong d; + + d = (c0 ^ c1) & 0xFFFF0000FFFF0000UL; c0 ^= d; c1 ^= d; + d = (c2 ^ c3) & 0xFFFF0000FFFF0000UL; c2 ^= d; c3 ^= d; + + d = (c0 ^ c2) & 0xFFFFFFFF00000000UL; c0 ^= d; c2 ^= d; + d = (c1 ^ c3) & 0x0000FFFFFFFF0000UL; c1 ^= d; c3 ^= d; + + internalState[0] = c0; + internalState[1] = c1; + internalState[2] = c2; + internalState[3] = c3; + break; + } + case 8: + { + ulong c0 = internalState[0], c1 = internalState[1], c2 = internalState[2], c3 = internalState[3]; + ulong c4 = internalState[4], c5 = internalState[5], c6 = internalState[6], c7 = internalState[7]; + ulong d; + + d = (c0 ^ c1) & 0xFF00FF00FF00FF00UL; c0 ^= d; c1 ^= d; + d = (c2 ^ c3) & 0xFF00FF00FF00FF00UL; c2 ^= d; c3 ^= d; + d = (c4 ^ c5) & 0xFF00FF00FF00FF00UL; c4 ^= d; c5 ^= d; + d = (c6 ^ c7) & 0xFF00FF00FF00FF00UL; c6 ^= d; c7 ^= d; + + d = (c0 ^ c2) & 0xFFFF0000FFFF0000UL; c0 ^= d; c2 ^= d; + d = (c1 ^ c3) & 0x00FFFF0000FFFF00UL; c1 ^= d; c3 ^= d; + d = (c4 ^ c6) & 0xFFFF0000FFFF0000UL; c4 ^= d; c6 ^= d; + d = (c5 ^ c7) & 0x00FFFF0000FFFF00UL; c5 ^= d; c7 ^= d; + + d = (c0 ^ c4) & 0xFFFFFFFF00000000UL; c0 ^= d; c4 ^= d; + d = (c1 ^ c5) & 0x00FFFFFFFF000000UL; c1 ^= d; c5 ^= d; + d = (c2 ^ c6) & 0x0000FFFFFFFF0000UL; c2 ^= d; c6 ^= d; + d = (c3 ^ c7) & 0x000000FFFFFFFF00UL; c3 ^= d; c7 ^= d; + + internalState[0] = c0; + internalState[1] = c1; + internalState[2] = c2; + internalState[3] = c3; + internalState[4] = c4; + internalState[5] = c5; + internalState[6] = c6; + internalState[7] = c7; + break; + } + default: + { + throw new InvalidOperationException("unsupported block length: only 128/256/512 are allowed"); + } + } + } + + private void AddRoundKey(int round) + { + ulong[] roundKey = roundKeys[round]; + for (int i = 0; i < wordsInBlock; ++i) + { + internalState[i] += roundKey[i]; + } + } + + private void SubRoundKey(int round) + { + ulong[] roundKey = roundKeys[round]; + for (int i = 0; i < wordsInBlock; ++i) + { + internalState[i] -= roundKey[i]; + } + } + + private void XorRoundKey(int round) + { + ulong[] roundKey = roundKeys[round]; + for (int i = 0; i < wordsInBlock; i++) + { + internalState[i] ^= roundKey[i]; + } + } + + private static ulong MixColumn(ulong c) + { + //// Calculate column multiplied by powers of 'x' + //ulong x0 = c; + //ulong x1 = MulX(x0); + //ulong x2 = MulX(x1); + //ulong x3 = MulX(x2); + + //// Calculate products with circulant matrix from (0x01, 0x01, 0x05, 0x01, 0x08, 0x06, 0x07, 0x04) + //ulong m0 = x0; + //ulong m1 = x0; + //ulong m2 = x0 ^ x2; + //ulong m3 = x0; + //ulong m4 = x3; + //ulong m5 = x1 ^ x2; + //ulong m6 = x0 ^ x1 ^ x2; + //ulong m7 = x2; + + //// Assemble the rotated products + //return m0 + // ^ Rotate(8, m1) + // ^ Rotate(16, m2) + // ^ Rotate(24, m3) + // ^ Rotate(32, m4) + // ^ Rotate(40, m5) + // ^ Rotate(48, m6) + // ^ Rotate(56, m7); + + ulong x1 = MulX(c); + ulong u, v; + + u = Rotate(8, c) ^ c; + u ^= Rotate(16, u); + u ^= Rotate(48, c); + + v = MulX2(u ^ c ^ x1); + + return u ^ Rotate(32, v) ^ Rotate(40, x1) ^ Rotate(48, x1); + } + + private void MixColumns() + { + for (int col = 0; col < wordsInBlock; ++col) + { + internalState[col] = MixColumn(internalState[col]); + } + } + + private static ulong MixColumnInv(ulong c) + { +/* + // Calculate column multiplied by powers of 'x' + ulong x0 = c; + ulong x1 = MulX(x0); + ulong x2 = MulX(x1); + ulong x3 = MulX(x2); + ulong x4 = MulX(x3); + ulong x5 = MulX(x4); + ulong x6 = MulX(x5); + ulong x7 = MulX(x6); + + // Calculate products with circulant matrix from (0xAD,0x95,0x76,0xA8,0x2F,0x49,0xD7,0xCA) + //long m0 = x0 ^ x2 ^ x3 ^ x5 ^ x7; + //long m1 = x0 ^ x2 ^ x4 ^ x7; + //long m2 = x1 ^ x2 ^ x4 ^ x5 ^ x6; + //long m3 = x3 ^ x5 ^ x7; + //long m4 = x0 ^ x1 ^ x2 ^ x3 ^ x5; + //long m5 = x0 ^ x3 ^ x6; + //long m6 = x0 ^ x1 ^ x2 ^ x4 ^ x6 ^ x7; + //long m7 = x1 ^ x3 ^ x6 ^ x7; + + ulong m5 = x0 ^ x3 ^ x6; + x0 ^= x2; + ulong m3 = x3 ^ x5 ^ x7; + ulong m0 = m3 ^ x0; + ulong m6 = x0 ^ x4; + ulong m1 = m6 ^ x7; + x5 ^= x1; + x7 ^= x1 ^ x6; + ulong m2 = x2 ^ x4 ^ x5 ^ x6; + ulong m4 = x0 ^ x3 ^ x5; + m6 ^= x7; + ulong m7 = x3 ^ x7; + + // Assemble the rotated products + return m0 + ^ Rotate(8, m1) + ^ Rotate(16, m2) + ^ Rotate(24, m3) + ^ Rotate(32, m4) + ^ Rotate(40, m5) + ^ Rotate(48, m6) + ^ Rotate(56, m7); +*/ + + ulong u0 = c; + u0 ^= Rotate( 8, u0); + u0 ^= Rotate(32, u0); + u0 ^= Rotate(48, c); + + ulong t = u0 ^ c; + + ulong c48 = Rotate(48, c); + ulong c56 = Rotate(56, c); + + ulong u7 = t ^ c56; + ulong u6 = Rotate(56, t); + u6 ^= MulX(u7); + ulong u5 = Rotate(16, t) ^ c; + u5 ^= Rotate(40, MulX(u6) ^ c); + ulong u4 = t ^ c48; + u4 ^= MulX(u5); + ulong u3 = Rotate(16, u0); + u3 ^= MulX(u4); + ulong u2 = t ^ Rotate(24, c) ^ c48 ^ c56; + u2 ^= MulX(u3); + ulong u1 = Rotate(32, t) ^ c ^ c56; + u1 ^= MulX(u2); + u0 ^= MulX(Rotate(40, u1)); + + return u0; + } + + private void MixColumnsInv() + { + for (int col = 0; col < wordsInBlock; ++col) + { + internalState[col] = MixColumnInv(internalState[col]); + } + } + + private static ulong MulX(ulong n) + { + return ((n & 0x7F7F7F7F7F7F7F7FUL) << 1) ^ (((n & 0x8080808080808080UL) >> 7) * 0x1DUL); + } + + private static ulong MulX2(ulong n) + { + return ((n & 0x3F3F3F3F3F3F3F3FUL) << 2) ^ (((n & 0x8080808080808080UL) >> 6) * 0x1DUL) ^ (((n & 0x4040404040404040UL) >> 6) * 0x1DUL); + } + + //private static ulong MulX4(ulong n) + //{ + // ulong u = n & 0xF0F0F0F0F0F0F0F0UL; + // return ((n & 0x0F0F0F0F0F0F0F0FUL) << 4) ^ u ^ (u >> 1) ^ (u >> 2) ^ (u >> 4); + //} + + /* + * Pair-wise modular multiplication of 8 byte-pairs. + * + * REDUCTION_POLYNOMIAL is x^8 + x^4 + x^3 + x^2 + 1 + */ + //private static ulong MultiplyGFx8(ulong u, ulong v, int vMaxDegree) + //{ + // ulong r = u & ((v & 0x0101010101010101UL) * 0xFFUL); + // for (int i = 1; i <= vMaxDegree; ++i) + // { + // u = ((u & 0x7F7F7F7F7F7F7F7FUL) << 1) ^ (((u >> 7) & 0x0101010101010101UL) * 0x1DUL); + // v >>= 1; + + // r ^= u & ((v & 0x0101010101010101UL) * 0xFFUL); + // } + + // return r; + //} + + //private static ulong MultiplyMds(ulong u) + //{ + // ulong r = 0, s = 0, t = (u >> 8); + // r ^= u & 0x0000001F00000000UL; r <<= 1; + // s ^= t & 0x00000000E0000000UL; s <<= 1; + // r ^= u & 0x3F3F3F00003F0000UL; r <<= 1; + // s ^= t & 0x00C0C0C00000C000UL; s <<= 1; + // r ^= u & 0x007F7F0000000000UL; r <<= 1; + // s ^= t & 0x0000808000000000UL; s <<= 1; + // r ^= u & 0x00FF0000FFFFFFFFUL; + // r ^= s ^ (s << 2) ^ (s << 3) ^ (s << 4); + // return r; + //} + + private static ulong Rotate(int n, ulong x) + { + return (x >> n) | (x << -n); + } + + private void RotateLeft(ulong[] x, ulong[] z) + { + switch (wordsInBlock) + { + case 2: + { + ulong x0 = x[0], x1 = x[1]; + z[0] = (x0 >> 56) | (x1 << 8); + z[1] = (x1 >> 56) | (x0 << 8); + break; + } + case 4: + { + ulong x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3]; + z[0] = (x1 >> 24) | (x2 << 40); + z[1] = (x2 >> 24) | (x3 << 40); + z[2] = (x3 >> 24) | (x0 << 40); + z[3] = (x0 >> 24) | (x1 << 40); + break; + } + case 8: + { + ulong x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3]; + ulong x4 = x[4], x5 = x[5], x6 = x[6], x7 = x[7]; + z[0] = (x2 >> 24) | (x3 << 40); + z[1] = (x3 >> 24) | (x4 << 40); + z[2] = (x4 >> 24) | (x5 << 40); + z[3] = (x5 >> 24) | (x6 << 40); + z[4] = (x6 >> 24) | (x7 << 40); + z[5] = (x7 >> 24) | (x0 << 40); + z[6] = (x0 >> 24) | (x1 << 40); + z[7] = (x1 >> 24) | (x2 << 40); + break; + } + default: + { + throw new InvalidOperationException("unsupported block length: only 128/256/512 are allowed"); + } + } + } + + #region TABLES AND S-BOXES + + private const ulong mdsMatrix = 0x0407060801050101UL; + private const ulong mdsInvMatrix = 0xCAD7492FA87695ADUL; + + private static readonly byte[] S0 = new byte[]{ + 0xa8, 0x43, 0x5f, 0x06, 0x6b, 0x75, 0x6c, 0x59, 0x71, 0xdf, 0x87, 0x95, 0x17, 0xf0, 0xd8, 0x09, + 0x6d, 0xf3, 0x1d, 0xcb, 0xc9, 0x4d, 0x2c, 0xaf, 0x79, 0xe0, 0x97, 0xfd, 0x6f, 0x4b, 0x45, 0x39, + 0x3e, 0xdd, 0xa3, 0x4f, 0xb4, 0xb6, 0x9a, 0x0e, 0x1f, 0xbf, 0x15, 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 0x64, 0x10, 0xd0, 0xd9, 0x13, 0x0c, 0x12, 0x29, 0x51, 0xb9, 0xcf, 0xd6, 0x73, 0x8d, + 0x81, 0x54, 0xc0, 0xed, 0x4e, 0x44, 0xa7, 0x2a, 0x85, 0x25, 0xe6, 0xca, 0x7c, 0x8b, 0x56, 0x80 + }; + + private static readonly byte[] S1 = new byte[]{ + 0xce, 0xbb, 0xeb, 0x92, 0xea, 0xcb, 0x13, 0xc1, 0xe9, 0x3a, 0xd6, 0xb2, 0xd2, 0x90, 0x17, 0xf8, + 0x42, 0x15, 0x56, 0xb4, 0x65, 0x1c, 0x88, 0x43, 0xc5, 0x5c, 0x36, 0xba, 0xf5, 0x57, 0x67, 0x8d, + 0x31, 0xf6, 0x64, 0x58, 0x9e, 0xf4, 0x22, 0xaa, 0x75, 0x0f, 0x02, 0xb1, 0xdf, 0x6d, 0x73, 0x4d, + 0x7c, 0x26, 0x2e, 0xf7, 0x08, 0x5d, 0x44, 0x3e, 0x9f, 0x14, 0xc8, 0xae, 0x54, 0x10, 0xd8, 0xbc, + 0x1a, 0x6b, 0x69, 0xf3, 0xbd, 0x33, 0xab, 0xfa, 0xd1, 0x9b, 0x68, 0x4e, 0x16, 0x95, 0x91, 0xee, + 0x4c, 0x63, 0x8e, 0x5b, 0xcc, 0x3c, 0x19, 0xa1, 0x81, 0x49, 0x7b, 0xd9, 0x6f, 0x37, 0x60, 0xca, + 0xe7, 0x2b, 0x48, 0xfd, 0x96, 0x45, 0xfc, 0x41, 0x12, 0x0d, 0x79, 0xe5, 0x89, 0x8c, 0xe3, 0x20, + 0x30, 0xdc, 0xb7, 0x6c, 0x4a, 0xb5, 0x3f, 0x97, 0xd4, 0x62, 0x2d, 0x06, 0xa4, 0xa5, 0x83, 0x5f, + 0x2a, 0xda, 0xc9, 0x00, 0x7e, 0xa2, 0x55, 0xbf, 0x11, 0xd5, 0x9c, 0xcf, 0x0e, 0x0a, 0x3d, 0x51, + 0x7d, 0x93, 0x1b, 0xfe, 0xc4, 0x47, 0x09, 0x86, 0x0b, 0x8f, 0x9d, 0x6a, 0x07, 0xb9, 0xb0, 0x98, + 0x18, 0x32, 0x71, 0x4b, 0xef, 0x3b, 0x70, 0xa0, 0xe4, 0x40, 0xff, 0xc3, 0xa9, 0xe6, 0x78, 0xf9, + 0x8b, 0x46, 0x80, 0x1e, 0x38, 0xe1, 0xb8, 0xa8, 0xe0, 0x0c, 0x23, 0x76, 0x1d, 0x25, 0x24, 0x05, + 0xf1, 0x6e, 0x94, 0x28, 0x9a, 0x84, 0xe8, 0xa3, 0x4f, 0x77, 0xd3, 0x85, 0xe2, 0x52, 0xf2, 0x82, + 0x50, 0x7a, 0x2f, 0x74, 0x53, 0xb3, 0x61, 0xaf, 0x39, 0x35, 0xde, 0xcd, 0x1f, 0x99, 0xac, 0xad, + 0x72, 0x2c, 0xdd, 0xd0, 0x87, 0xbe, 0x5e, 0xa6, 0xec, 0x04, 0xc6, 0x03, 0x34, 0xfb, 0xdb, 0x59, + 0xb6, 0xc2, 0x01, 0xf0, 0x5a, 0xed, 0xa7, 0x66, 0x21, 0x7f, 0x8a, 0x27, 0xc7, 0xc0, 0x29, 0xd7 + }; + + private static readonly byte[] S2 = new byte[]{ + 0x93, 0xd9, 0x9a, 0xb5, 0x98, 0x22, 0x45, 0xfc, 0xba, 0x6a, 0xdf, 0x02, 0x9f, 0xdc, 0x51, 0x59, + 0x4a, 0x17, 0x2b, 0xc2, 0x94, 0xf4, 0xbb, 0xa3, 0x62, 0xe4, 0x71, 0xd4, 0xcd, 0x70, 0x16, 0xe1, + 0x49, 0x3c, 0xc0, 0xd8, 0x5c, 0x9b, 0xad, 0x85, 0x53, 0xa1, 0x7a, 0xc8, 0x2d, 0xe0, 0xd1, 0x72, + 0xa6, 0x2c, 0xc4, 0xe3, 0x76, 0x78, 0xb7, 0xb4, 0x09, 0x3b, 0x0e, 0x41, 0x4c, 0xde, 0xb2, 0x90, + 0x25, 0xa5, 0xd7, 0x03, 0x11, 0x00,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, 0x0c, 0x74, 0x67 + }; + + private static readonly byte[] S3 = new byte[]{ + 0x68, 0x8d, 0xca, 0x4d, 0x73, 0x4b, 0x4e, 0x2a, 0xd4, 0x52, 0x26, 0xb3, 0x54, 0x1e, 0x19, 0x1f, + 0x22, 0x03, 0x46, 0x3d, 0x2d, 0x4a, 0x53, 0x83, 0x13, 0x8a, 0xb7, 0xd5, 0x25, 0x79, 0xf5, 0xbd, + 0x58, 0x2f, 0x0d, 0x02, 0xed, 0x51, 0x9e, 0x11, 0xf2, 0x3e, 0x55, 0x5e, 0xd1, 0x16, 0x3c, 0x66, + 0x70, 0x5d, 0xf3, 0x45, 0x40, 0xcc, 0xe8, 0x94, 0x56, 0x08, 0xce, 0x1a, 0x3a, 0xd2, 0xe1, 0xdf, + 0xb5, 0x38, 0x6e, 0x0e, 0xe5, 0xf4, 0xf9, 0x86, 0xe9, 0x4f, 0xd6, 0x85, 0x23, 0xcf, 0x32, 0x99, + 0x31, 0x14, 0xae, 0xee, 0xc8, 0x48, 0xd3, 0x30, 0xa1, 0x92, 0x41, 0xb1, 0x18, 0xc4, 0x2c, 0x71, + 0x72, 0x44, 0x15, 0xfd, 0x37, 0xbe, 0x5f, 0xaa, 0x9b, 0x88, 0xd8, 0xab, 0x89, 0x9c, 0xfa, 0x60, + 0xea, 0xbc, 0x62, 0x0c, 0x24, 0xa6, 0xa8, 0xec, 0x67, 0x20, 0xdb, 0x7c, 0x28, 0xdd, 0xac, 0x5b, + 0x34, 0x7e, 0x10, 0xf1, 0x7b, 0x8f, 0x63, 0xa0, 0x05, 0x9a, 0x43, 0x77, 0x21, 0xbf, 0x27, 0x09, + 0xc3, 0x9f, 0xb6, 0xd7, 0x29, 0xc2, 0xeb, 0xc0, 0xa4, 0x8b, 0x8c, 0x1d, 0xfb, 0xff, 0xc1, 0xb2, + 0x97, 0x2e, 0xf8, 0x65, 0xf6, 0x75, 0x07, 0x04, 0x49, 0x33, 0xe4, 0xd9, 0xb9, 0xd0, 0x42, 0xc7, + 0x6c, 0x90, 0x00, 0x8e, 0x6f, 0x50, 0x01, 0xc5, 0xda, 0x47, 0x3f, 0xcd, 0x69, 0xa2, 0xe2, 0x7a, + 0xa7, 0xc6, 0x93, 0x0f, 0x0a, 0x06, 0xe6, 0x2b, 0x96, 0xa3, 0x1c, 0xaf, 0x6a, 0x12, 0x84, 0x39, + 0xe7, 0xb0, 0x82, 0xf7, 0xfe, 0x9d, 0x87, 0x5c, 0x81, 0x35, 0xde, 0xb4, 0xa5, 0xfc, 0x80, 0xef, + 0xcb, 0xbb, 0x6b, 0x76, 0xba, 0x5a, 0x7d, 0x78, 0x0b, 0x95, 0xe3, 0xad, 0x74, 0x98, 0x3b, 0x36, + 0x64, 0x6d, 0xdc, 0xf0, 0x59, 0xa9, 0x4c, 0x17, 0x7f, 0x91, 0xb8, 0xc9, 0x57, 0x1b, 0xe0, 0x61 + }; + + private static readonly byte[] T0 = new byte[]{ + 0xa4, 0xa2, 0xa9, 0xc5, 0x4e, 0xc9, 0x03, 0xd9, 0x7e, 0x0f, 0xd2, 0xad, 0xe7, 0xd3, 0x27, 0x5b, + 0xe3, 0xa1, 0xe8, 0xe6, 0x7c, 0x2a, 0x55, 0x0c, 0x86, 0x39, 0xd7, 0x8d, 0xb8, 0x12, 0x6f, 0x28, + 0xcd, 0x8a, 0x70, 0x56, 0x72, 0xf9, 0xbf, 0x4f, 0x73, 0xe9, 0xf7, 0x57, 0x16, 0xac, 0x50, 0xc0, + 0x9d, 0xb7, 0x47, 0x71, 0x60, 0xc4, 0x74, 0x43, 0x6c, 0x1f, 0x93, 0x77, 0xdc, 0xce, 0x20, 0x8c, + 0x99, 0x5f, 0x44, 0x01, 0xf5, 0x1e, 0x87, 0x5e, 0x61, 0x2c, 0x4b, 0x1d, 0x81, 0x15, 0xf4, 0x23, + 0xd6, 0xea, 0xe1, 0x67, 0xf1, 0x7f, 0xfe, 0xda, 0x3c, 0x07, 0x53, 0x6a, 0x84, 0x9c, 0xcb, 0x02, + 0x83, 0x33, 0xdd, 0x35, 0xe2, 0x59, 0x5a, 0x98, 0xa5, 0x92, 0x64, 0x04, 0x06, 0x10, 0x4d, 0x1c, + 0x97, 0x08, 0x31, 0xee, 0xab, 0x05, 0xaf, 0x79, 0xa0, 0x18, 0x46, 0x6d, 0xfc, 0x89, 0xd4, 0xc7, + 0xff, 0xf0, 0xcf, 0x42, 0x91, 0xf8, 0x68, 0x0a, 0x65, 0x8e, 0xb6, 0xfd, 0xc3, 0xef, 0x78, 0x4c, + 0xcc, 0x9e, 0x30, 0x2e, 0xbc, 0x0b, 0x54, 0x1a, 0xa6, 0xbb, 0x26, 0x80, 0x48, 0x94, 0x32, 0x7d, + 0xa7, 0x3f, 0xae, 0x22, 0x3d, 0x66, 0xaa, 0xf6, 0x00, 0x5d, 0xbd, 0x4a, 0xe0, 0x3b, 0xb4, 0x17, + 0x8b, 0x9f, 0x76, 0xb0, 0x24, 0x9a, 0x25, 0x63, 0xdb, 0xeb, 0x7a, 0x3e, 0x5c, 0xb3, 0xb1, 0x29, + 0xf2, 0xca, 0x58, 0x6e, 0xd8, 0xa8, 0x2f, 0x75, 0xdf, 0x14, 0xfb, 0x13, 0x49, 0x88, 0xb2, 0xec, + 0xe4, 0x34, 0x2d, 0x96, 0xc6, 0x3a, 0xed, 0x95, 0x0e, 0xe5, 0x85, 0x6b, 0x40, 0x21, 0x9b, 0x09, + 0x19, 0x2b, 0x52, 0xde, 0x45, 0xa3, 0xfa, 0x51, 0xc2, 0xb5, 0xd1, 0x90, 0xb9, 0xf3, 0x37, 0xc1, + 0x0d, 0xba, 0x41, 0x11, 0x38, 0x7b, 0xbe, 0xd0, 0xd5, 0x69, 0x36, 0xc8, 0x62, 0x1b, 0x82, 0x8f + }; + + private static readonly byte[] T1 = new byte[]{ + 0x83, 0xf2, 0x2a, 0xeb, 0xe9, 0xbf, 0x7b, 0x9c, 0x34, 0x96, 0x8d, 0x98, 0xb9, 0x69, 0x8c, 0x29, + 0x3d, 0x88, 0x68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, 0x82, 0x5f, 0x05, 0x54, 0xdb, 0x00, 0x8b, + 0xe3, 0x48, 0x0c, 0xca, 0x78, 0x89, 0x0a, 0xff, 0x3e, 0x5b, 0x81, 0xee, 0x71, 0xe2, 0xda, 0x2c, + 0xb8, 0xb5, 0xcc, 0x6e, 0xa8, 0x6b, 0xad, 0x60, 0xc6, 0x08, 0x04, 0x02, 0xe8, 0xf5, 0x4f, 0xa4, + 0xf3, 0xc0, 0xce, 0x43, 0x25, 0x1c, 0x21, 0x33, 0x0f, 0xaf, 0x47, 0xed, 0x66, 0x63, 0x93, 0xaa + }; + + private static readonly byte[] T2 = new byte[]{ + 0x45, 0xd4, 0x0b, 0x43, 0xf1, 0x72, 0xed, 0xa4, 0xc2, 0x38, 0xe6, 0x71, 0xfd, 0xb6, 0x3a, 0x95, + 0x50, 0x44, 0x4b, 0xe2, 0x74, 0x6b, 0x1e, 0x11, 0x5a, 0xc6, 0xb4, 0xd8, 0xa5, 0x8a, 0x70, 0xa3, + 0xa8, 0xfa, 0x05, 0xd9, 0x97, 0x40, 0xc9, 0x90, 0x98, 0x8f, 0xdc, 0x12, 0x31, 0x2c, 0x47, 0x6a, + 0x99, 0xae, 0xc8, 0x7f, 0xf9, 0x4f, 0x5d, 0x96, 0x6f, 0xf4, 0xb3, 0x39, 0x21, 0xda, 0x9c, 0x85, + 0x9e, 0x3b, 0xf0, 0xbf, 0xef, 0x06, 0xee, 0xe5, 0x5f, 0x20, 0x10, 0xcc, 0x3c, 0x54, 0x4a, 0x52, + 0x94, 0x0e, 0xc0, 0x28, 0xf6, 0x56, 0x60, 0xa2, 0xe3, 0x0f, 0xec, 0x9d, 0x24, 0x83, 0x7e, 0xd5, + 0x7c, 0xeb, 0x18, 0xd7, 0xcd, 0xdd, 0x78, 0xff, 0xdb, 0xa1, 0x09, 0xd0, 0x76, 0x84, 0x75, 0xbb, + 0x1d, 0x1a, 0x2f, 0xb0, 0xfe, 0xd6, 0x34, 0x63, 0x35, 0xd2, 0x2a, 0x59, 0x6d, 0x4d, 0x77, 0xe7, + 0x8e, 0x61, 0xcf, 0x9f, 0xce, 0x27, 0xf5, 0x80, 0x86, 0xc7, 0xa6, 0xfb, 0xf8, 0x87, 0xab, 0x62, + 0x3f, 0xdf, 0x48, 0x00, 0x14, 0x9a, 0xbd, 0x5b, 0x04, 0x92, 0x02, 0x25, 0x65, 0x4c, 0x53, 0x0c, + 0xf2, 0x29, 0xaf, 0x17, 0x6c, 0x41, 0x30, 0xe9, 0x93, 0x55, 0xf7, 0xac, 0x68, 0x26, 0xc4, 0x7d, + 0xca, 0x7a, 0x3e, 0xa0, 0x37, 0x03, 0xc1, 0x36, 0x69, 0x66, 0x08, 0x16, 0xa7, 0xbc, 0xc5, 0xd3, + 0x22, 0xb7, 0x13, 0x46, 0x32, 0xe8, 0x57, 0x88, 0x2b, 0x81, 0xb2, 0x4e, 0x64, 0x1c, 0xaa, 0x91, + 0x58, 0x2e, 0x9b, 0x5c, 0x1b, 0x51, 0x73, 0x42, 0x23, 0x01, 0x6e, 0xf3, 0x0d, 0xbe, 0x3d, 0x0a, + 0x2d, 0x1f, 0x67, 0x33, 0x19, 0x7b, 0x5e, 0xea, 0xde, 0x8b, 0xcb, 0xa9, 0x8c, 0x8d, 0xad, 0x49, + 0x82, 0xe4, 0xba, 0xc3, 0x15, 0xd1, 0xe0, 0x89, 0xfc, 0xb1, 0xb9, 0xb5, 0x07, 0x79, 0xb8, 0xe1 + }; + + private static readonly byte[] T3 = new byte[]{ + 0xb2, 0xb6, 0x23, 0x11, 0xa7, 0x88, 0xc5, 0xa6, 0x39, 0x8f, 0xc4, 0xe8, 0x73, 0x22, 0x43, 0xc3, + 0x82, 0x27, 0xcd, 0x18, 0x51, 0x62, 0x2d, 0xf7, 0x5c, 0x0e, 0x3b, 0xfd, 0xca, 0x9b, 0x0d, 0x0f, + 0x79, 0x8c, 0x10, 0x4c, 0x74, 0x1c, 0x0a, 0x8e, 0x7c, 0x94, 0x07, 0xc7, 0x5e, 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ea, 0xaa, 0x44, 0xc6, 0xd0, 0x36, 0x48, 0x70, 0x96, 0x77, 0x24, 0x53, 0xdf, + 0xf3, 0x83, 0x28, 0x32, 0x45, 0x1e, 0xa4, 0xd3, 0xa2, 0x46, 0x6e, 0x9c, 0xdd, 0x63, 0xd4, 0x9d + }; + + #endregion + + public virtual string AlgorithmName + { + get { return "DSTU7624"; } + } + + public virtual int GetBlockSize() + { + return wordsInBlock << 3; + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual void Reset() + { + Array.Clear(internalState, 0, internalState.Length); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624Engine.cs.meta new file mode 100644 index 00000000..0a152daf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b7431fbefc683994a9e9387e00a6f10c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624WrapEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624WrapEngine.cs new file mode 100644 index 00000000..7ab1bd06 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624WrapEngine.cs @@ -0,0 +1,220 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + public class Dstu7624WrapEngine + : IWrapper + { + private KeyParameter param; + private Dstu7624Engine engine; + private bool forWrapping; + private int blockSize; + + public Dstu7624WrapEngine(int blockSizeBits) + { + engine = new Dstu7624Engine(blockSizeBits); + param = null; + + blockSize = blockSizeBits / 8; + } + + public string AlgorithmName + { + get { return "Dstu7624WrapEngine"; } + } + + public void Init(bool forWrapping, ICipherParameters parameters) + { + this.forWrapping = forWrapping; + + if (parameters is KeyParameter) + { + this.param = (KeyParameter)parameters; + + engine.Init(forWrapping, param); + } + else + { + throw new ArgumentException("Bad parameters passed to Dstu7624WrapEngine"); + } + } + + public byte[] Wrap(byte[] input, int inOff, int length) + { + if (!forWrapping) + throw new InvalidOperationException("Not set for wrapping"); + + if (length % blockSize != 0) + throw new ArgumentException("Padding not supported"); + + int n = 2 * (1 + length / blockSize); + int V = (n - 1) * 6; + + byte[] buffer = new byte[length + blockSize]; + Array.Copy(input, inOff, buffer, 0, length); + //Console.WriteLine(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(buffer)); + + byte[] B = new byte[blockSize / 2]; + Array.Copy(buffer, 0, B, 0, blockSize / 2); + //Console.WriteLine("B0: "+ BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(B)); + + IList bTemp = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + int bHalfBlocksLen = buffer.Length - blockSize / 2; + int bufOff = blockSize / 2; + while (bHalfBlocksLen != 0) + { + byte[] temp = new byte[blockSize / 2]; + Array.Copy(buffer, bufOff, temp, 0, blockSize / 2); + //Console.WriteLine(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(buffer)); + //Console.WriteLine(buffer.Length); + //Console.WriteLine("b: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(temp)); + + bTemp.Add(temp); + + bHalfBlocksLen -= blockSize / 2; + bufOff += blockSize / 2; + } + + for (int j = 0; j < V; j++) + { + Array.Copy(B, 0, buffer, 0, blockSize / 2); + Array.Copy((byte[])bTemp[0], 0, buffer, blockSize / 2, blockSize / 2); + + engine.ProcessBlock(buffer, 0, buffer, 0); + + byte[] intArray = Pack.UInt32_To_LE((uint)(j + 1)); + for (int byteNum = 0; byteNum < intArray.Length; byteNum++) + { + buffer[byteNum + blockSize / 2] ^= intArray[byteNum]; + } + + Array.Copy(buffer, blockSize / 2, B, 0, blockSize / 2); + + for (int i = 2; i < n; i++) + { + Array.Copy((byte[])bTemp[i - 1], 0, (byte[])bTemp[i - 2], 0, blockSize / 2); + } + + Array.Copy(buffer, 0, (byte[])bTemp[n - 2], 0, blockSize / 2); + + //Console.WriteLine("B" + j.ToString() + ": " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(B)); + //Console.WriteLine("b: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(bTemp[0])); + //Console.WriteLine("b: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(bTemp[1])); + //Console.WriteLine("b: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(bTemp[2])); + + //Console.WriteLine(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(buffer)); + } + + Array.Copy(B, 0, buffer, 0, blockSize / 2); + bufOff = blockSize / 2; + + for (int i = 0; i < n - 1; i++) + { + Array.Copy((byte[])bTemp[i], 0, buffer, bufOff, blockSize / 2); + bufOff += blockSize / 2; + } + + return buffer; + } + + public byte[] Unwrap(byte[] input, int inOff, int length) + { + if (forWrapping) + throw new InvalidOperationException("not set for unwrapping"); + + if (length % blockSize != 0) + throw new ArgumentException("Padding not supported"); + + int n = 2 * length / blockSize; + int V = (n - 1) * 6; + + byte[] buffer = new byte[length]; + Array.Copy(input, inOff, buffer, 0, length); + + byte[] B = new byte[blockSize / 2]; + Array.Copy(buffer, 0, B, 0, blockSize / 2); + //Console.WriteLine("B18: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(B)); + + IList bTemp = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + int bHalfBlocksLen = buffer.Length - blockSize / 2; + int bufOff = blockSize / 2; + while (bHalfBlocksLen != 0) + { + byte[] temp = new byte[blockSize / 2]; + Array.Copy(buffer, bufOff, temp, 0, blockSize / 2); + //Console.WriteLine(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(buffer)); + //Console.WriteLine(buffer.Length); + //Console.WriteLine("b: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(temp)); + + bTemp.Add(temp); + + bHalfBlocksLen -= blockSize / 2; + bufOff += blockSize / 2; + } + + for (int j = 0; j < V; j++) + { + Array.Copy((byte[])bTemp[n - 2], 0, buffer, 0, blockSize / 2); + Array.Copy(B, 0, buffer, blockSize / 2, blockSize / 2); + + byte[] intArray = Pack.UInt32_To_LE((uint)(V - j)); + for (int byteNum = 0; byteNum < intArray.Length; byteNum++) + { + buffer[byteNum + blockSize / 2] ^= intArray[byteNum]; + } + + //Console.WriteLine(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(buffer)); + + engine.ProcessBlock(buffer, 0, buffer, 0); + + //Console.WriteLine(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(buffer)); + + Array.Copy(buffer, 0, B, 0, blockSize / 2); + + for (int i = 2; i < n; i++) + { + Array.Copy((byte[])bTemp[n - i - 1], 0, (byte[])bTemp[n - i], 0, blockSize / 2); + } + + Array.Copy(buffer, blockSize / 2, (byte[])bTemp[0], 0, blockSize / 2); + + //Console.WriteLine("B" + (V - j - 1).ToString() + ": " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(B)); + //Console.WriteLine("b: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(bTemp[0])); + //Console.WriteLine("b: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(bTemp[1])); + //Console.WriteLine("b: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(bTemp[2])); + + //Console.WriteLine(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders.Hex.ToHexString(buffer)); + } + + Array.Copy(B, 0, buffer, 0, blockSize / 2); + bufOff = blockSize / 2; + + for (int i = 0; i < n - 1; i++) + { + Array.Copy((byte[])bTemp[i], 0, buffer, bufOff, blockSize / 2); + bufOff += blockSize / 2; + } + + byte diff = 0; + for (int i = buffer.Length - blockSize; i < buffer.Length; ++i) + { + diff |= buffer[i]; + } + + if (diff != 0) + throw new InvalidCipherTextException("checksum failed"); + + return Arrays.CopyOfRange(buffer, 0, buffer.Length - blockSize); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624WrapEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624WrapEngine.cs.meta new file mode 100644 index 00000000..a237aaf3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Dstu7624WrapEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebfb6e5ada8143143a0e9abc8f253d26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ElGamalEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ElGamalEngine.cs new file mode 100644 index 00000000..e948dee1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ElGamalEngine.cs @@ -0,0 +1,182 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * this does your basic ElGamal algorithm. + */ + public class ElGamalEngine + : IAsymmetricBlockCipher + { + private ElGamalKeyParameters key; + private SecureRandom random; + private bool forEncryption; + private int bitSize; + + public virtual string AlgorithmName + { + get { return "ElGamal"; } + } + + /** + * initialise the ElGamal engine. + * + * @param forEncryption true if we are encrypting, false otherwise. + * @param param the necessary ElGamal key parameters. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (parameters is ParametersWithRandom) + { + ParametersWithRandom p = (ParametersWithRandom) parameters; + + this.key = (ElGamalKeyParameters) p.Parameters; + this.random = p.Random; + } + else + { + this.key = (ElGamalKeyParameters) parameters; + this.random = new SecureRandom(); + } + + this.forEncryption = forEncryption; + this.bitSize = key.Parameters.P.BitLength; + + if (forEncryption) + { + if (!(key is ElGamalPublicKeyParameters)) + { + throw new ArgumentException("ElGamalPublicKeyParameters are required for encryption."); + } + } + else + { + if (!(key is ElGamalPrivateKeyParameters)) + { + throw new ArgumentException("ElGamalPrivateKeyParameters are required for decryption."); + } + } + } + + /** + * Return the maximum size for an input block to this engine. + * For ElGamal this is always one byte less than the size of P on + * encryption, and twice the length as the size of P on decryption. + * + * @return maximum size for an input block. + */ + public virtual int GetInputBlockSize() + { + if (forEncryption) + { + return (bitSize - 1) / 8; + } + + return 2 * ((bitSize + 7) / 8); + } + + /** + * Return the maximum size for an output block to this engine. + * For ElGamal this is always one byte less than the size of P on + * decryption, and twice the length as the size of P on encryption. + * + * @return maximum size for an output block. + */ + public virtual int GetOutputBlockSize() + { + if (forEncryption) + { + return 2 * ((bitSize + 7) / 8); + } + + return (bitSize - 1) / 8; + } + + /** + * Process a single block using the basic ElGamal algorithm. + * + * @param in the input array. + * @param inOff the offset into the input buffer where the data starts. + * @param length the length of the data to be processed. + * @return the result of the ElGamal process. + * @exception DataLengthException the input block is too large. + */ + public virtual byte[] ProcessBlock( + byte[] input, + int inOff, + int length) + { + if (key == null) + throw new InvalidOperationException("ElGamal engine not initialised"); + + int maxLength = forEncryption + ? (bitSize - 1 + 7) / 8 + : GetInputBlockSize(); + + if (length > maxLength) + throw new DataLengthException("input too large for ElGamal cipher.\n"); + + BigInteger p = key.Parameters.P; + + byte[] output; + if (key is ElGamalPrivateKeyParameters) // decryption + { + int halfLength = length / 2; + BigInteger gamma = new BigInteger(1, input, inOff, halfLength); + BigInteger phi = new BigInteger(1, input, inOff + halfLength, halfLength); + + ElGamalPrivateKeyParameters priv = (ElGamalPrivateKeyParameters) key; + + // a shortcut, which generally relies on p being prime amongst other things. + // if a problem with this shows up, check the p and g values! + BigInteger m = gamma.ModPow(p.Subtract(BigInteger.One).Subtract(priv.X), p).Multiply(phi).Mod(p); + + output = m.ToByteArrayUnsigned(); + } + else // encryption + { + BigInteger tmp = new BigInteger(1, input, inOff, length); + + if (tmp.BitLength >= p.BitLength) + throw new DataLengthException("input too large for ElGamal cipher.\n"); + + + ElGamalPublicKeyParameters pub = (ElGamalPublicKeyParameters) key; + + BigInteger pSub2 = p.Subtract(BigInteger.Two); + + // TODO In theory, a series of 'k', 'g.ModPow(k, p)' and 'y.ModPow(k, p)' can be pre-calculated + BigInteger k; + do + { + k = new BigInteger(p.BitLength, random); + } + while (k.SignValue == 0 || k.CompareTo(pSub2) > 0); + + BigInteger g = key.Parameters.G; + BigInteger gamma = g.ModPow(k, p); + BigInteger phi = tmp.Multiply(pub.Y.ModPow(k, p)).Mod(p); + + output = new byte[this.GetOutputBlockSize()]; + + // TODO Add methods to allow writing BigInteger to existing byte array? + byte[] out1 = gamma.ToByteArrayUnsigned(); + byte[] out2 = phi.ToByteArrayUnsigned(); + out1.CopyTo(output, output.Length / 2 - out1.Length); + out2.CopyTo(output, output.Length - out2.Length); + } + + return output; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ElGamalEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ElGamalEngine.cs.meta new file mode 100644 index 00000000..6c78e03c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ElGamalEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aeba69dc4e3260b439d2c421e50fce8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/GOST28147Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/GOST28147Engine.cs new file mode 100644 index 00000000..c308cef6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/GOST28147Engine.cs @@ -0,0 +1,386 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * implementation of GOST 28147-89 + */ + public class Gost28147Engine + : IBlockCipher + { + private const int BlockSize = 8; + private int[] workingKey = null; + private bool forEncryption; + + private byte[] S = Sbox_Default; + + // these are the S-boxes given in Applied Cryptography 2nd Ed., p. 333 + // This is default S-box! + private static readonly byte[] Sbox_Default = { + 0x4,0xA,0x9,0x2,0xD,0x8,0x0,0xE,0x6,0xB,0x1,0xC,0x7,0xF,0x5,0x3, + 0xE,0xB,0x4,0xC,0x6,0xD,0xF,0xA,0x2,0x3,0x8,0x1,0x0,0x7,0x5,0x9, + 0x5,0x8,0x1,0xD,0xA,0x3,0x4,0x2,0xE,0xF,0xC,0x7,0x6,0x0,0x9,0xB, + 0x7,0xD,0xA,0x1,0x0,0x8,0x9,0xF,0xE,0x4,0x6,0xC,0xB,0x2,0x5,0x3, + 0x6,0xC,0x7,0x1,0x5,0xF,0xD,0x8,0x4,0xA,0x9,0xE,0x0,0x3,0xB,0x2, + 0x4,0xB,0xA,0x0,0x7,0x2,0x1,0xD,0x3,0x6,0x8,0x5,0x9,0xC,0xF,0xE, + 0xD,0xB,0x4,0x1,0x3,0xF,0x5,0x9,0x0,0xA,0xE,0x7,0x6,0x8,0x2,0xC, + 0x1,0xF,0xD,0x0,0x5,0x7,0xA,0x4,0x9,0x2,0x3,0xE,0x6,0xB,0x8,0xC + }; + + /* + * class content S-box parameters for encrypting + * getting from, see: http://tools.ietf.org/id/draft-popov-cryptopro-cpalgs-01.txt + * http://tools.ietf.org/id/draft-popov-cryptopro-cpalgs-02.txt + */ + private static readonly byte[] ESbox_Test = { + 0x4,0x2,0xF,0x5,0x9,0x1,0x0,0x8,0xE,0x3,0xB,0xC,0xD,0x7,0xA,0x6, + 0xC,0x9,0xF,0xE,0x8,0x1,0x3,0xA,0x2,0x7,0x4,0xD,0x6,0x0,0xB,0x5, + 0xD,0x8,0xE,0xC,0x7,0x3,0x9,0xA,0x1,0x5,0x2,0x4,0x6,0xF,0x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,0xE,0x6,0xB,0x8,0xC + }; + + private static readonly byte[] DSbox_A = { + 0xA,0x4,0x5,0x6,0x8,0x1,0x3,0x7,0xD,0xC,0xE,0x0,0x9,0x2,0xB,0xF, + 0x5,0xF,0x4,0x0,0x2,0xD,0xB,0x9,0x1,0x7,0x6,0x3,0xC,0xE,0xA,0x8, + 0x7,0xF,0xC,0xE,0x9,0x4,0x1,0x0,0x3,0xB,0x5,0x2,0x6,0xA,0x8,0xD, + 0x4,0xA,0x7,0xC,0x0,0xF,0x2,0x8,0xE,0x1,0x6,0x5,0xD,0xB,0x9,0x3, + 0x7,0x6,0x4,0xB,0x9,0xC,0x2,0xA,0x1,0x8,0x0,0xE,0xF,0xD,0x3,0x5, + 0x7,0x6,0x2,0x4,0xD,0x9,0xF,0x0,0xA,0x1,0x5,0xB,0x8,0xE,0xC,0x3, + 0xD,0xE,0x4,0x1,0x7,0x0,0x5,0xA,0x3,0xC,0x8,0xF,0x6,0x2,0x9,0xB, + 0x1,0x3,0xA,0x9,0x5,0xB,0x4,0xF,0x8,0x6,0x7,0xE,0xD,0x0,0x2,0xC + }; + + // + // pre-defined sbox table + // + private static readonly IDictionary sBoxes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static Gost28147Engine() + { + AddSBox("Default", Sbox_Default); + AddSBox("E-TEST", ESbox_Test); + AddSBox("E-A", ESbox_A); + AddSBox("E-B", ESbox_B); + AddSBox("E-C", ESbox_C); + AddSBox("E-D", ESbox_D); + AddSBox("D-TEST", DSbox_Test); + AddSBox("D-A", DSbox_A); + } + + private static void AddSBox(string sBoxName, byte[] sBox) + { + sBoxes.Add(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(sBoxName), sBox); + } + + /** + * standard constructor. + */ + public Gost28147Engine() + { + } + + /** + * initialise an Gost28147 cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (parameters is ParametersWithSBox) + { + ParametersWithSBox param = (ParametersWithSBox)parameters; + + // + // Set the S-Box + // + byte[] sBox = param.GetSBox(); + if (sBox.Length != Sbox_Default.Length) + throw new ArgumentException("invalid S-box passed to GOST28147 init"); + + this.S = Arrays.Clone(sBox); + + // + // set key if there is one + // + if (param.Parameters != null) + { + workingKey = generateWorkingKey(forEncryption, + ((KeyParameter)param.Parameters).GetKey()); + } + } + else if (parameters is KeyParameter) + { + workingKey = generateWorkingKey(forEncryption, + ((KeyParameter)parameters).GetKey()); + } + else if (parameters != null) + { + throw new ArgumentException("invalid parameter passed to Gost28147 init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + } + + public virtual string AlgorithmName + { + get { return "Gost28147"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BlockSize; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (workingKey == null) + throw new InvalidOperationException("Gost28147 engine not initialised"); + + Check.DataLength(input, inOff, BlockSize, "input buffer too short"); + Check.OutputLength(output, outOff, BlockSize, "output buffer too short"); + + Gost28147Func(workingKey, input, inOff, output, outOff); + + return BlockSize; + } + + public virtual void Reset() + { + } + + private int[] generateWorkingKey( + bool forEncryption, + byte[] userKey) + { + this.forEncryption = forEncryption; + + if (userKey.Length != 32) + { + throw new ArgumentException("Key length invalid. Key needs to be 32 byte - 256 bit!!!"); + } + + int[] key = new int[8]; + for(int i=0; i!=8; i++) + { + key[i] = bytesToint(userKey,i*4); + } + + return key; + } + + private int Gost28147_mainStep(int n1, int key) + { + int cm = (key + n1); // CM1 + + // S-box replacing + + int om = S[ 0 + ((cm >> (0 * 4)) & 0xF)] << (0 * 4); + om += S[ 16 + ((cm >> (1 * 4)) & 0xF)] << (1 * 4); + om += S[ 32 + ((cm >> (2 * 4)) & 0xF)] << (2 * 4); + om += S[ 48 + ((cm >> (3 * 4)) & 0xF)] << (3 * 4); + om += S[ 64 + ((cm >> (4 * 4)) & 0xF)] << (4 * 4); + om += S[ 80 + ((cm >> (5 * 4)) & 0xF)] << (5 * 4); + om += S[ 96 + ((cm >> (6 * 4)) & 0xF)] << (6 * 4); + om += S[112 + ((cm >> (7 * 4)) & 0xF)] << (7 * 4); + +// return om << 11 | om >>> (32-11); // 11-leftshift + int omLeft = om << 11; + int omRight = (int)(((uint) om) >> (32 - 11)); // Note: Casts required to get unsigned bit rotation + + return omLeft | omRight; + } + + private void Gost28147Func( + int[] workingKey, + byte[] inBytes, + int inOff, + byte[] outBytes, + int outOff) + { + int N1, N2, tmp; //tmp -> for saving N1 + N1 = bytesToint(inBytes, inOff); + N2 = bytesToint(inBytes, inOff + 4); + + if (this.forEncryption) + { + for(int k = 0; k < 3; k++) // 1-24 steps + { + for(int j = 0; j < 8; j++) + { + tmp = N1; + int step = Gost28147_mainStep(N1, workingKey[j]); + N1 = N2 ^ step; // CM2 + N2 = tmp; + } + } + for(int j = 7; j > 0; j--) // 25-31 steps + { + tmp = N1; + N1 = N2 ^ Gost28147_mainStep(N1, workingKey[j]); // CM2 + N2 = tmp; + } + } + else //decrypt + { + for(int j = 0; j < 8; j++) // 1-8 steps + { + tmp = N1; + N1 = N2 ^ Gost28147_mainStep(N1, workingKey[j]); // CM2 + N2 = tmp; + } + for(int k = 0; k < 3; k++) //9-31 steps + { + for(int j = 7; j >= 0; j--) + { + if ((k == 2) && (j==0)) + { + break; // break 32 step + } + tmp = N1; + N1 = N2 ^ Gost28147_mainStep(N1, workingKey[j]); // CM2 + N2 = tmp; + } + } + } + + N2 = N2 ^ Gost28147_mainStep(N1, workingKey[0]); // 32 step (N1=N1) + + intTobytes(N1, outBytes, outOff); + intTobytes(N2, outBytes, outOff + 4); + } + + //array of bytes to type int + private static int bytesToint( + byte[] inBytes, + int inOff) + { + return (int)((inBytes[inOff + 3] << 24) & 0xff000000) + ((inBytes[inOff + 2] << 16) & 0xff0000) + + ((inBytes[inOff + 1] << 8) & 0xff00) + (inBytes[inOff] & 0xff); + } + + //int to array of bytes + private static void intTobytes( + int num, + byte[] outBytes, + int outOff) + { + outBytes[outOff + 3] = (byte)(num >> 24); + outBytes[outOff + 2] = (byte)(num >> 16); + outBytes[outOff + 1] = (byte)(num >> 8); + outBytes[outOff] = (byte)num; + } + + /** + * Return the S-Box associated with SBoxName + * @param sBoxName name of the S-Box + * @return byte array representing the S-Box + */ + public static byte[] GetSBox( + string sBoxName) + { + byte[] sBox = (byte[])sBoxes[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(sBoxName)]; + + if (sBox == null) + { + throw new ArgumentException("Unknown S-Box - possible types: " + + "\"Default\", \"E-Test\", \"E-A\", \"E-B\", \"E-C\", \"E-D\", \"D-Test\", \"D-A\"."); + } + + return Arrays.Clone(sBox); + } + + public static string GetSBoxName(byte[] sBox) + { + foreach (string name in sBoxes.Keys) + { + byte[] sb = (byte[])sBoxes[name]; + if (Arrays.AreEqual(sb, sBox)) + { + return name; + } + } + + throw new ArgumentException("SBOX provided did not map to a known one"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/GOST28147Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/GOST28147Engine.cs.meta new file mode 100644 index 00000000..15380ffd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/GOST28147Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4c737f7f68f496f4a860774bee5eb7a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC128Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC128Engine.cs new file mode 100644 index 00000000..8955fff3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC128Engine.cs @@ -0,0 +1,239 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * HC-128 is a software-efficient stream cipher created by Hongjun Wu. It + * generates keystream from a 128-bit secret key and a 128-bit initialization + * vector. + *

+ * http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc128_p3.pdf + *

+ * It is a third phase candidate in the eStream contest, and is patent-free. + * No attacks are known as of today (April 2007). See + * + * http://www.ecrypt.eu.org/stream/hcp3.html + *

+ */ + public class HC128Engine + : IStreamCipher + { + private uint[] p = new uint[512]; + private uint[] q = new uint[512]; + private uint cnt = 0; + + private static uint F1(uint x) + { + return RotateRight(x, 7) ^ RotateRight(x, 18) ^ (x >> 3); + } + + private static uint F2(uint x) + { + return RotateRight(x, 17) ^ RotateRight(x, 19) ^ (x >> 10); + } + + private uint G1(uint x, uint y, uint z) + { + return (RotateRight(x, 10) ^ RotateRight(z, 23)) + RotateRight(y, 8); + } + + private uint G2(uint x, uint y, uint z) + { + return (RotateLeft(x, 10) ^ RotateLeft(z, 23)) + RotateLeft(y, 8); + } + + private static uint RotateLeft(uint x, int bits) + { + return (x << bits) | (x >> -bits); + } + + private static uint RotateRight(uint x, int bits) + { + return (x >> bits) | (x << -bits); + } + + private uint H1(uint x) + { + return q[x & 0xFF] + q[((x >> 16) & 0xFF) + 256]; + } + + private uint H2(uint x) + { + return p[x & 0xFF] + p[((x >> 16) & 0xFF) + 256]; + } + + private static uint Mod1024(uint x) + { + return x & 0x3FF; + } + + private static uint Mod512(uint x) + { + return x & 0x1FF; + } + + private static uint Dim(uint x, uint y) + { + return Mod512(x - y); + } + + private uint Step() + { + uint j = Mod512(cnt); + uint ret; + if (cnt < 512) + { + p[j] += G1(p[Dim(j, 3)], p[Dim(j, 10)], p[Dim(j, 511)]); + ret = H1(p[Dim(j, 12)]) ^ p[j]; + } + else + { + q[j] += G2(q[Dim(j, 3)], q[Dim(j, 10)], q[Dim(j, 511)]); + ret = H2(q[Dim(j, 12)]) ^ q[j]; + } + cnt = Mod1024(cnt + 1); + return ret; + } + + private byte[] key, iv; + private bool initialised; + + private void Init() + { + if (key.Length != 16) + throw new ArgumentException("The key must be 128 bits long"); + + idx = 0; + cnt = 0; + + uint[] w = new uint[1280]; + + for (int i = 0; i < 16; i++) + { + w[i >> 2] |= ((uint)key[i] << (8 * (i & 0x3))); + } + Array.Copy(w, 0, w, 4, 4); + + for (int i = 0; i < iv.Length && i < 16; i++) + { + w[(i >> 2) + 8] |= ((uint)iv[i] << (8 * (i & 0x3))); + } + Array.Copy(w, 8, w, 12, 4); + + for (uint i = 16; i < 1280; i++) + { + w[i] = F2(w[i - 2]) + w[i - 7] + F1(w[i - 15]) + w[i - 16] + i; + } + + Array.Copy(w, 256, p, 0, 512); + Array.Copy(w, 768, q, 0, 512); + + for (int i = 0; i < 512; i++) + { + p[i] = Step(); + } + for (int i = 0; i < 512; i++) + { + q[i] = Step(); + } + + cnt = 0; + } + + public virtual string AlgorithmName + { + get { return "HC-128"; } + } + + /** + * Initialise a HC-128 cipher. + * + * @param forEncryption whether or not we are for encryption. Irrelevant, as + * encryption and decryption are the same. + * @param params the parameters required to set up the cipher. + * @throws ArgumentException if the params argument is + * inappropriate (ie. the key is not 128 bit long). + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + ICipherParameters keyParam = parameters; + + if (parameters is ParametersWithIV) + { + iv = ((ParametersWithIV)parameters).GetIV(); + keyParam = ((ParametersWithIV)parameters).Parameters; + } + else + { + iv = new byte[0]; + } + + if (keyParam is KeyParameter) + { + key = ((KeyParameter)keyParam).GetKey(); + Init(); + } + else + { + throw new ArgumentException( + "Invalid parameter passed to HC128 init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters), + "parameters"); + } + + initialised = true; + } + + private byte[] buf = new byte[4]; + private int idx = 0; + + private byte GetByte() + { + if (idx == 0) + { + Pack.UInt32_To_LE(Step(), buf); + } + byte ret = buf[idx]; + idx = idx + 1 & 0x3; + return ret; + } + + public virtual void ProcessBytes( + byte[] input, + int inOff, + int len, + byte[] output, + int outOff) + { + if (!initialised) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Check.DataLength(input, inOff, len, "input buffer too short"); + Check.OutputLength(output, outOff, len, "output buffer too short"); + + for (int i = 0; i < len; i++) + { + output[outOff + i] = (byte)(input[inOff + i] ^ GetByte()); + } + } + + public virtual void Reset() + { + Init(); + } + + public virtual byte ReturnByte(byte input) + { + return (byte)(input ^ GetByte()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC128Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC128Engine.cs.meta new file mode 100644 index 00000000..0bdf95a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC128Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 181b21bf264bc414aa9f03db25c3431d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC256Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC256Engine.cs new file mode 100644 index 00000000..bd709732 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC256Engine.cs @@ -0,0 +1,228 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * HC-256 is a software-efficient stream cipher created by Hongjun Wu. It + * generates keystream from a 256-bit secret key and a 256-bit initialization + * vector. + *

+ * http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc256_p3.pdf + *

+ * Its brother, HC-128, is a third phase candidate in the eStream contest. + * The algorithm is patent-free. No attacks are known as of today (April 2007). + * See + * + * http://www.ecrypt.eu.org/stream/hcp3.html + *

+ */ + public class HC256Engine + : IStreamCipher + { + private uint[] p = new uint[1024]; + private uint[] q = new uint[1024]; + private uint cnt = 0; + + private uint Step() + { + uint j = cnt & 0x3FF; + uint ret; + if (cnt < 1024) + { + uint x = p[(j - 3 & 0x3FF)]; + uint y = p[(j - 1023 & 0x3FF)]; + p[j] += p[(j - 10 & 0x3FF)] + + (RotateRight(x, 10) ^ RotateRight(y, 23)) + + q[((x ^ y) & 0x3FF)]; + + x = p[(j - 12 & 0x3FF)]; + ret = (q[x & 0xFF] + q[((x >> 8) & 0xFF) + 256] + + q[((x >> 16) & 0xFF) + 512] + q[((x >> 24) & 0xFF) + 768]) + ^ p[j]; + } + else + { + uint x = q[(j - 3 & 0x3FF)]; + uint y = q[(j - 1023 & 0x3FF)]; + q[j] += q[(j - 10 & 0x3FF)] + + (RotateRight(x, 10) ^ RotateRight(y, 23)) + + p[((x ^ y) & 0x3FF)]; + + x = q[(j - 12 & 0x3FF)]; + ret = (p[x & 0xFF] + p[((x >> 8) & 0xFF) + 256] + + p[((x >> 16) & 0xFF) + 512] + p[((x >> 24) & 0xFF) + 768]) + ^ q[j]; + } + cnt = cnt + 1 & 0x7FF; + return ret; + } + + private byte[] key, iv; + private bool initialised; + + private void Init() + { + if (key.Length != 32 && key.Length != 16) + throw new ArgumentException("The key must be 128/256 bits long"); + + if (iv.Length < 16) + throw new ArgumentException("The IV must be at least 128 bits long"); + + if (key.Length != 32) + { + byte[] k = new byte[32]; + + Array.Copy(key, 0, k, 0, key.Length); + Array.Copy(key, 0, k, 16, key.Length); + + key = k; + } + + if (iv.Length < 32) + { + byte[] newIV = new byte[32]; + + Array.Copy(iv, 0, newIV, 0, iv.Length); + Array.Copy(iv, 0, newIV, iv.Length, newIV.Length - iv.Length); + + iv = newIV; + } + + idx = 0; + cnt = 0; + + uint[] w = new uint[2560]; + + for (int i = 0; i < 32; i++) + { + w[i >> 2] |= ((uint)key[i] << (8 * (i & 0x3))); + } + + for (int i = 0; i < 32; i++) + { + w[(i >> 2) + 8] |= ((uint)iv[i] << (8 * (i & 0x3))); + } + + for (uint i = 16; i < 2560; i++) + { + uint x = w[i - 2]; + uint y = w[i - 15]; + w[i] = (RotateRight(x, 17) ^ RotateRight(x, 19) ^ (x >> 10)) + + w[i - 7] + + (RotateRight(y, 7) ^ RotateRight(y, 18) ^ (y >> 3)) + + w[i - 16] + i; + } + + Array.Copy(w, 512, p, 0, 1024); + Array.Copy(w, 1536, q, 0, 1024); + + for (int i = 0; i < 4096; i++) + { + Step(); + } + + cnt = 0; + } + + public virtual string AlgorithmName + { + get { return "HC-256"; } + } + + /** + * Initialise a HC-256 cipher. + * + * @param forEncryption whether or not we are for encryption. Irrelevant, as + * encryption and decryption are the same. + * @param params the parameters required to set up the cipher. + * @throws ArgumentException if the params argument is + * inappropriate (ie. the key is not 256 bit long). + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + ICipherParameters keyParam = parameters; + + if (parameters is ParametersWithIV) + { + iv = ((ParametersWithIV)parameters).GetIV(); + keyParam = ((ParametersWithIV)parameters).Parameters; + } + else + { + iv = new byte[0]; + } + + if (keyParam is KeyParameter) + { + key = ((KeyParameter)keyParam).GetKey(); + Init(); + } + else + { + throw new ArgumentException( + "Invalid parameter passed to HC256 init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters), + "parameters"); + } + + initialised = true; + } + + private byte[] buf = new byte[4]; + private int idx = 0; + + private byte GetByte() + { + if (idx == 0) + { + Pack.UInt32_To_LE(Step(), buf); + } + byte ret = buf[idx]; + idx = idx + 1 & 0x3; + return ret; + } + + public virtual void ProcessBytes( + byte[] input, + int inOff, + int len, + byte[] output, + int outOff) + { + if (!initialised) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Check.DataLength(input, inOff, len, "input buffer too short"); + Check.OutputLength(output, outOff, len, "output buffer too short"); + + for (int i = 0; i < len; i++) + { + output[outOff + i] = (byte)(input[inOff + i] ^ GetByte()); + } + } + + public virtual void Reset() + { + Init(); + } + + public virtual byte ReturnByte(byte input) + { + return (byte)(input ^ GetByte()); + } + + private static uint RotateRight(uint x, int bits) + { + return (x >> bits) | (x << -bits); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC256Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC256Engine.cs.meta new file mode 100644 index 00000000..68bee56a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/HC256Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a97c4e05480602c42b965ee80fd861b8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ISAACEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ISAACEngine.cs new file mode 100644 index 00000000..261318fb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ISAACEngine.cs @@ -0,0 +1,216 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * Implementation of Bob Jenkin's ISAAC (Indirection Shift Accumulate Add and Count). + * see: http://www.burtleburtle.net/bob/rand/isaacafa.html + */ + public class IsaacEngine + : IStreamCipher + { + // Constants + private static readonly int sizeL = 8, + stateArraySize = sizeL<<5; // 256 + + // Cipher's internal state + private uint[] engineState = null, // mm + results = null; // randrsl + private uint a = 0, b = 0, c = 0; + + // Engine state + private int index = 0; + private byte[] keyStream = new byte[stateArraySize<<2], // results expanded into bytes + workingKey = null; + private bool initialised = false; + + /** + * initialise an ISAAC cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param params the parameters required to set up the cipher. + * @exception ArgumentException if the params argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException( + "invalid parameter passed to ISAAC Init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters), + "parameters"); + + /* + * ISAAC encryption and decryption is completely + * symmetrical, so the 'forEncryption' is + * irrelevant. + */ + KeyParameter p = (KeyParameter) parameters; + setKey(p.GetKey()); + } + + public virtual byte ReturnByte( + byte input) + { + if (index == 0) + { + isaac(); + keyStream = Pack.UInt32_To_BE(results); + } + + byte output = (byte)(keyStream[index]^input); + index = (index + 1) & 1023; + + return output; + } + + public virtual void ProcessBytes( + byte[] input, + int inOff, + int len, + byte[] output, + int outOff) + { + if (!initialised) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Check.DataLength(input, inOff, len, "input buffer too short"); + Check.OutputLength(output, outOff, len, "output buffer too short"); + + for (int i = 0; i < len; i++) + { + if (index == 0) + { + isaac(); + keyStream = Pack.UInt32_To_BE(results); + } + output[i+outOff] = (byte)(keyStream[index]^input[i+inOff]); + index = (index + 1) & 1023; + } + } + + public virtual string AlgorithmName + { + get { return "ISAAC"; } + } + + public virtual void Reset() + { + setKey(workingKey); + } + + // Private implementation + private void setKey( + byte[] keyBytes) + { + workingKey = keyBytes; + + if (engineState == null) + { + engineState = new uint[stateArraySize]; + } + + if (results == null) + { + results = new uint[stateArraySize]; + } + + int i, j, k; + + // Reset state + for (i = 0; i < stateArraySize; i++) + { + engineState[i] = results[i] = 0; + } + a = b = c = 0; + + // Reset index counter for output + index = 0; + + // Convert the key bytes to ints and put them into results[] for initialization + byte[] t = new byte[keyBytes.Length + (keyBytes.Length & 3)]; + Array.Copy(keyBytes, 0, t, 0, keyBytes.Length); + for (i = 0; i < t.Length; i+=4) + { + results[i >> 2] = Pack.LE_To_UInt32(t, i); + } + + // It has begun? + uint[] abcdefgh = new uint[sizeL]; + + for (i = 0; i < sizeL; i++) + { + abcdefgh[i] = 0x9e3779b9; // Phi (golden ratio) + } + + for (i = 0; i < 4; i++) + { + mix(abcdefgh); + } + + for (i = 0; i < 2; i++) + { + for (j = 0; j < stateArraySize; j+=sizeL) + { + for (k = 0; k < sizeL; k++) + { + abcdefgh[k] += (i<1) ? results[j+k] : engineState[j+k]; + } + + mix(abcdefgh); + + for (k = 0; k < sizeL; k++) + { + engineState[j+k] = abcdefgh[k]; + } + } + } + + isaac(); + + initialised = true; + } + + private void isaac() + { + uint x, y; + + b += ++c; + for (int i = 0; i < stateArraySize; i++) + { + x = engineState[i]; + switch (i & 3) + { + case 0: a ^= (a << 13); break; + case 1: a ^= (a >> 6); break; + case 2: a ^= (a << 2); break; + case 3: a ^= (a >> 16); break; + } + a += engineState[(i+128) & 0xFF]; + engineState[i] = y = engineState[(int)((uint)x >> 2) & 0xFF] + a + b; + results[i] = b = engineState[(int)((uint)y >> 10) & 0xFF] + x; + } + } + + private void mix(uint[] x) + { + x[0]^=x[1]<< 11; x[3]+=x[0]; x[1]+=x[2]; + x[1]^=x[2]>> 2; x[4]+=x[1]; x[2]+=x[3]; + x[2]^=x[3]<< 8; x[5]+=x[2]; x[3]+=x[4]; + x[3]^=x[4]>> 16; x[6]+=x[3]; x[4]+=x[5]; + x[4]^=x[5]<< 10; x[7]+=x[4]; x[5]+=x[6]; + x[5]^=x[6]>> 4; x[0]+=x[5]; x[6]+=x[7]; + x[6]^=x[7]<< 8; x[1]+=x[6]; x[7]+=x[0]; + x[7]^=x[0]>> 9; x[2]+=x[7]; x[0]+=x[1]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ISAACEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ISAACEngine.cs.meta new file mode 100644 index 00000000..4190ef6b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ISAACEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7564107a47479e74b800f239f1636fad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IdeaEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IdeaEngine.cs new file mode 100644 index 00000000..1cf97080 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IdeaEngine.cs @@ -0,0 +1,326 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * A class that provides a basic International Data Encryption Algorithm (IDEA) engine. + *

+ * This implementation is based on the "HOWTO: INTERNATIONAL DATA ENCRYPTION ALGORITHM" + * implementation summary by Fauzan Mirza (F.U.Mirza@sheffield.ac.uk). (barring 1 typo at the + * end of the MulInv function!). + *

+ *

+ * It can be found at ftp://ftp.funet.fi/pub/crypt/cryptography/symmetric/idea/ + *

+ *

+ * Note: This algorithm was patented in the USA, Japan and Europe. These patents expired in 2011/2012. + *

+ */ + public class IdeaEngine + : IBlockCipher + { + private const int BLOCK_SIZE = 8; + private int[] workingKey; + /** + * standard constructor. + */ + public IdeaEngine() + { + } + /** + * initialise an IDEA cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("invalid parameter passed to IDEA init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + workingKey = GenerateWorkingKey(forEncryption, + ((KeyParameter)parameters).GetKey()); + } + + public virtual string AlgorithmName + { + get { return "IDEA"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (workingKey == null) + throw new InvalidOperationException("IDEA engine not initialised"); + + Check.DataLength(input, inOff, BLOCK_SIZE, "input buffer too short"); + Check.OutputLength(output, outOff, BLOCK_SIZE, "output buffer too short"); + + IdeaFunc(workingKey, input, inOff, output, outOff); + return BLOCK_SIZE; + } + public virtual void Reset() + { + } + private static readonly int MASK = 0xffff; + private static readonly int BASE = 0x10001; + private int BytesToWord( + byte[] input, + int inOff) + { + return ((input[inOff] << 8) & 0xff00) + (input[inOff + 1] & 0xff); + } + private void WordToBytes( + int word, + byte[] outBytes, + int outOff) + { + outBytes[outOff] = (byte)((uint) word >> 8); + outBytes[outOff + 1] = (byte)word; + } + /** + * return x = x * y where the multiplication is done modulo + * 65537 (0x10001) (as defined in the IDEA specification) and + * a zero input is taken to be 65536 (0x10000). + * + * @param x the x value + * @param y the y value + * @return x = x * y + */ + private int Mul( + int x, + int y) + { + if (x == 0) + { + x = (BASE - y); + } + else if (y == 0) + { + x = (BASE - x); + } + else + { + int p = x * y; + y = p & MASK; + x = (int) ((uint) p >> 16); + x = y - x + ((y < x) ? 1 : 0); + } + return x & MASK; + } + private void IdeaFunc( + int[] workingKey, + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + int x0, x1, x2, x3, t0, t1; + int keyOff = 0; + x0 = BytesToWord(input, inOff); + x1 = BytesToWord(input, inOff + 2); + x2 = BytesToWord(input, inOff + 4); + x3 = BytesToWord(input, inOff + 6); + for (int round = 0; round < 8; round++) + { + x0 = Mul(x0, workingKey[keyOff++]); + x1 += workingKey[keyOff++]; + x1 &= MASK; + x2 += workingKey[keyOff++]; + x2 &= MASK; + x3 = Mul(x3, workingKey[keyOff++]); + t0 = x1; + t1 = x2; + x2 ^= x0; + x1 ^= x3; + x2 = Mul(x2, workingKey[keyOff++]); + x1 += x2; + x1 &= MASK; + x1 = Mul(x1, workingKey[keyOff++]); + x2 += x1; + x2 &= MASK; + x0 ^= x1; + x3 ^= x2; + x1 ^= t1; + x2 ^= t0; + } + WordToBytes(Mul(x0, workingKey[keyOff++]), outBytes, outOff); + WordToBytes(x2 + workingKey[keyOff++], outBytes, outOff + 2); /* NB: Order */ + WordToBytes(x1 + workingKey[keyOff++], outBytes, outOff + 4); + WordToBytes(Mul(x3, workingKey[keyOff]), outBytes, outOff + 6); + } + /** + * The following function is used to expand the user key to the encryption + * subkey. The first 16 bytes are the user key, and the rest of the subkey + * is calculated by rotating the previous 16 bytes by 25 bits to the left, + * and so on until the subkey is completed. + */ + private int[] ExpandKey( + byte[] uKey) + { + int[] key = new int[52]; + if (uKey.Length < 16) + { + byte[] tmp = new byte[16]; + Array.Copy(uKey, 0, tmp, tmp.Length - uKey.Length, uKey.Length); + uKey = tmp; + } + for (int i = 0; i < 8; i++) + { + key[i] = BytesToWord(uKey, i * 2); + } + for (int i = 8; i < 52; i++) + { + if ((i & 7) < 6) + { + key[i] = ((key[i - 7] & 127) << 9 | key[i - 6] >> 7) & MASK; + } + else if ((i & 7) == 6) + { + key[i] = ((key[i - 7] & 127) << 9 | key[i - 14] >> 7) & MASK; + } + else + { + key[i] = ((key[i - 15] & 127) << 9 | key[i - 14] >> 7) & MASK; + } + } + return key; + } + /** + * This function computes multiplicative inverse using Euclid's Greatest + * Common Divisor algorithm. Zero and one are self inverse. + *

+ * i.e. x * MulInv(x) == 1 (modulo BASE) + *

+ */ + private int MulInv( + int x) + { + int t0, t1, q, y; + + if (x < 2) + { + return x; + } + t0 = 1; + t1 = BASE / x; + y = BASE % x; + while (y != 1) + { + q = x / y; + x = x % y; + t0 = (t0 + (t1 * q)) & MASK; + if (x == 1) + { + return t0; + } + q = y / x; + y = y % x; + t1 = (t1 + (t0 * q)) & MASK; + } + return (1 - t1) & MASK; + } + /** + * Return the additive inverse of x. + *

+ * i.e. x + AddInv(x) == 0 + *

+ */ + int AddInv( + int x) + { + return (0 - x) & MASK; + } + + /** + * The function to invert the encryption subkey to the decryption subkey. + * It also involves the multiplicative inverse and the additive inverse functions. + */ + private int[] InvertKey( + int[] inKey) + { + int t1, t2, t3, t4; + int p = 52; /* We work backwards */ + int[] key = new int[52]; + int inOff = 0; + + t1 = MulInv(inKey[inOff++]); + t2 = AddInv(inKey[inOff++]); + t3 = AddInv(inKey[inOff++]); + t4 = MulInv(inKey[inOff++]); + key[--p] = t4; + key[--p] = t3; + key[--p] = t2; + key[--p] = t1; + + for (int round = 1; round < 8; round++) + { + t1 = inKey[inOff++]; + t2 = inKey[inOff++]; + key[--p] = t2; + key[--p] = t1; + + t1 = MulInv(inKey[inOff++]); + t2 = AddInv(inKey[inOff++]); + t3 = AddInv(inKey[inOff++]); + t4 = MulInv(inKey[inOff++]); + key[--p] = t4; + key[--p] = t2; /* NB: Order */ + key[--p] = t3; + key[--p] = t1; + } + t1 = inKey[inOff++]; + t2 = inKey[inOff++]; + key[--p] = t2; + key[--p] = t1; + + t1 = MulInv(inKey[inOff++]); + t2 = AddInv(inKey[inOff++]); + t3 = AddInv(inKey[inOff++]); + t4 = MulInv(inKey[inOff]); + key[--p] = t4; + key[--p] = t3; + key[--p] = t2; + key[--p] = t1; + return key; + } + + private int[] GenerateWorkingKey( + bool forEncryption, + byte[] userKey) + { + if (forEncryption) + { + return ExpandKey(userKey); + } + else + { + return InvertKey(ExpandKey(userKey)); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IdeaEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IdeaEngine.cs.meta new file mode 100644 index 00000000..0b1f20b8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IdeaEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4803aa4dab7fb004db3a42672bcbb85a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IesEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IesEngine.cs new file mode 100644 index 00000000..2b4c9045 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IesEngine.cs @@ -0,0 +1,247 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * support class for constructing intergrated encryption ciphers + * for doing basic message exchanges on top of key agreement ciphers + */ + public class IesEngine + { + private readonly IBasicAgreement agree; + private readonly IDerivationFunction kdf; + private readonly IMac mac; + private readonly BufferedBlockCipher cipher; + private readonly byte[] macBuf; + + private bool forEncryption; + private ICipherParameters privParam, pubParam; + private IesParameters param; + + /** + * set up for use with stream mode, where the key derivation function + * is used to provide a stream of bytes to xor with the message. + * + * @param agree the key agreement used as the basis for the encryption + * @param kdf the key derivation function used for byte generation + * @param mac the message authentication code generator for the message + */ + public IesEngine( + IBasicAgreement agree, + IDerivationFunction kdf, + IMac mac) + { + this.agree = agree; + this.kdf = kdf; + this.mac = mac; + this.macBuf = new byte[mac.GetMacSize()]; +// this.cipher = null; + } + + /** + * set up for use in conjunction with a block cipher to handle the + * message. + * + * @param agree the key agreement used as the basis for the encryption + * @param kdf the key derivation function used for byte generation + * @param mac the message authentication code generator for the message + * @param cipher the cipher to used for encrypting the message + */ + public IesEngine( + IBasicAgreement agree, + IDerivationFunction kdf, + IMac mac, + BufferedBlockCipher cipher) + { + this.agree = agree; + this.kdf = kdf; + this.mac = mac; + this.macBuf = new byte[mac.GetMacSize()]; + this.cipher = cipher; + } + + /** + * Initialise the encryptor. + * + * @param forEncryption whether or not this is encryption/decryption. + * @param privParam our private key parameters + * @param pubParam the recipient's/sender's public key parameters + * @param param encoding and derivation parameters. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters privParameters, + ICipherParameters pubParameters, + ICipherParameters iesParameters) + { + this.forEncryption = forEncryption; + this.privParam = privParameters; + this.pubParam = pubParameters; + this.param = (IesParameters)iesParameters; + } + + private byte[] DecryptBlock( + byte[] in_enc, + int inOff, + int inLen, + byte[] z) + { + byte[] M = null; + KeyParameter macKey = null; + KdfParameters kParam = new KdfParameters(z, param.GetDerivationV()); + int macKeySize = param.MacKeySize; + + kdf.Init(kParam); + + // Ensure that the length of the input is greater than the MAC in bytes + if (inLen < mac.GetMacSize()) + throw new InvalidCipherTextException("Length of input must be greater than the MAC"); + + inLen -= mac.GetMacSize(); + + if (cipher == null) // stream mode + { + byte[] Buffer = GenerateKdfBytes(kParam, inLen + (macKeySize / 8)); + + M = new byte[inLen]; + + for (int i = 0; i != inLen; i++) + { + M[i] = (byte)(in_enc[inOff + i] ^ Buffer[i]); + } + + macKey = new KeyParameter(Buffer, inLen, (macKeySize / 8)); + } + else + { + int cipherKeySize = ((IesWithCipherParameters)param).CipherKeySize; + byte[] Buffer = GenerateKdfBytes(kParam, (cipherKeySize / 8) + (macKeySize / 8)); + + cipher.Init(false, new KeyParameter(Buffer, 0, (cipherKeySize / 8))); + + M = cipher.DoFinal(in_enc, inOff, inLen); + + macKey = new KeyParameter(Buffer, (cipherKeySize / 8), (macKeySize / 8)); + } + + byte[] macIV = param.GetEncodingV(); + + mac.Init(macKey); + mac.BlockUpdate(in_enc, inOff, inLen); + mac.BlockUpdate(macIV, 0, macIV.Length); + mac.DoFinal(macBuf, 0); + + inOff += inLen; + + byte[] T1 = Arrays.CopyOfRange(in_enc, inOff, inOff + macBuf.Length); + + if (!Arrays.ConstantTimeAreEqual(T1, macBuf)) + throw (new InvalidCipherTextException("Invalid MAC.")); + + return M; + } + + private byte[] EncryptBlock( + byte[] input, + int inOff, + int inLen, + byte[] z) + { + byte[] C = null; + KeyParameter macKey = null; + KdfParameters kParam = new KdfParameters(z, param.GetDerivationV()); + int c_text_length = 0; + int macKeySize = param.MacKeySize; + + if (cipher == null) // stream mode + { + byte[] Buffer = GenerateKdfBytes(kParam, inLen + (macKeySize / 8)); + + C = new byte[inLen + mac.GetMacSize()]; + c_text_length = inLen; + + for (int i = 0; i != inLen; i++) + { + C[i] = (byte)(input[inOff + i] ^ Buffer[i]); + } + + macKey = new KeyParameter(Buffer, inLen, (macKeySize / 8)); + } + else + { + int cipherKeySize = ((IesWithCipherParameters)param).CipherKeySize; + byte[] Buffer = GenerateKdfBytes(kParam, (cipherKeySize / 8) + (macKeySize / 8)); + + cipher.Init(true, new KeyParameter(Buffer, 0, (cipherKeySize / 8))); + + c_text_length = cipher.GetOutputSize(inLen); + byte[] tmp = new byte[c_text_length]; + + int len = cipher.ProcessBytes(input, inOff, inLen, tmp, 0); + len += cipher.DoFinal(tmp, len); + + C = new byte[len + mac.GetMacSize()]; + c_text_length = len; + + Array.Copy(tmp, 0, C, 0, len); + + macKey = new KeyParameter(Buffer, (cipherKeySize / 8), (macKeySize / 8)); + } + + byte[] macIV = param.GetEncodingV(); + + mac.Init(macKey); + mac.BlockUpdate(C, 0, c_text_length); + mac.BlockUpdate(macIV, 0, macIV.Length); + // + // return the message and it's MAC + // + mac.DoFinal(C, c_text_length); + return C; + } + + private byte[] GenerateKdfBytes( + KdfParameters kParam, + int length) + { + byte[] buf = new byte[length]; + + kdf.Init(kParam); + + kdf.GenerateBytes(buf, 0, buf.Length); + + return buf; + } + + public virtual byte[] ProcessBlock( + byte[] input, + int inOff, + int inLen) + { + agree.Init(privParam); + + BigInteger z = agree.CalculateAgreement(pubParam); + + byte[] zBytes = BigIntegers.AsUnsignedByteArray(agree.GetFieldSize(), z); + + try + { + return forEncryption + ? EncryptBlock(input, inOff, inLen, zBytes) + : DecryptBlock(input, inOff, inLen, zBytes); + } + finally + { + Array.Clear(zBytes, 0, zBytes.Length); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IesEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IesEngine.cs.meta new file mode 100644 index 00000000..5af747d0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/IesEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7cea1426e4f8131488b05c998910d4ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NaccacheSternEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NaccacheSternEngine.cs new file mode 100644 index 00000000..77e739c4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NaccacheSternEngine.cs @@ -0,0 +1,362 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * NaccacheStern Engine. For details on this cipher, please see + * http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + */ + public class NaccacheSternEngine + : IAsymmetricBlockCipher + { + private bool forEncryption; + + private NaccacheSternKeyParameters key; + + private IList[] lookup = null; + + public string AlgorithmName + { + get { return "NaccacheStern"; } + } + + /** + * Initializes this algorithm. Must be called before all other Functions. + * + * @see org.bouncycastle.crypto.AsymmetricBlockCipher#init(bool, + * org.bouncycastle.crypto.CipherParameters) + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.forEncryption = forEncryption; + + if (parameters is ParametersWithRandom) + { + parameters = ((ParametersWithRandom) parameters).Parameters; + } + + key = (NaccacheSternKeyParameters)parameters; + + // construct lookup table for faster decryption if necessary + if (!this.forEncryption) + { + NaccacheSternPrivateKeyParameters priv = (NaccacheSternPrivateKeyParameters)key; + IList primes = priv.SmallPrimesList; + lookup = new IList[primes.Count]; + for (int i = 0; i < primes.Count; i++) + { + BigInteger actualPrime = (BigInteger) primes[i]; + int actualPrimeValue = actualPrime.IntValue; + + lookup[i] = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(actualPrimeValue); + lookup[i].Add(BigInteger.One); + + BigInteger accJ = BigInteger.Zero; + + for (int j = 1; j < actualPrimeValue; j++) + { +// BigInteger bigJ = BigInteger.ValueOf(j); +// accJ = priv.PhiN.Multiply(bigJ); + accJ = accJ.Add(priv.PhiN); + BigInteger comp = accJ.Divide(actualPrime); + lookup[i].Add(priv.G.ModPow(comp, priv.Modulus)); + } + } + } + } + + [Obsolete("Remove: no longer used")] + public virtual bool Debug + { + set {} + } + + /** + * Returns the input block size of this algorithm. + * + * @see org.bouncycastle.crypto.AsymmetricBlockCipher#GetInputBlockSize() + */ + public virtual int GetInputBlockSize() + { + if (forEncryption) + { + // We can only encrypt values up to lowerSigmaBound + return (key.LowerSigmaBound + 7) / 8 - 1; + } + else + { + // We pad to modulus-size bytes for easier decryption. +// return key.Modulus.ToByteArray().Length; + return key.Modulus.BitLength / 8 + 1; + } + } + + /** + * Returns the output block size of this algorithm. + * + * @see org.bouncycastle.crypto.AsymmetricBlockCipher#GetOutputBlockSize() + */ + public virtual int GetOutputBlockSize() + { + if (forEncryption) + { + // encrypted Data is always padded up to modulus size +// return key.Modulus.ToByteArray().Length; + return key.Modulus.BitLength / 8 + 1; + } + else + { + // decrypted Data has upper limit lowerSigmaBound + return (key.LowerSigmaBound + 7) / 8 - 1; + } + } + + /** + * Process a single Block using the Naccache-Stern algorithm. + * + * @see org.bouncycastle.crypto.AsymmetricBlockCipher#ProcessBlock(byte[], + * int, int) + */ + public virtual byte[] ProcessBlock( + byte[] inBytes, + int inOff, + int length) + { + if (key == null) + throw new InvalidOperationException("NaccacheStern engine not initialised"); + if (length > (GetInputBlockSize() + 1)) + throw new DataLengthException("input too large for Naccache-Stern cipher.\n"); + + if (!forEncryption) + { + // At decryption make sure that we receive padded data blocks + if (length < GetInputBlockSize()) + { + throw new InvalidCipherTextException("BlockLength does not match modulus for Naccache-Stern cipher.\n"); + } + } + + // transform input into BigInteger + BigInteger input = new BigInteger(1, inBytes, inOff, length); + + byte[] output; + if (forEncryption) + { + output = Encrypt(input); + } + else + { + IList plain = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + NaccacheSternPrivateKeyParameters priv = (NaccacheSternPrivateKeyParameters)key; + IList primes = priv.SmallPrimesList; + // Get Chinese Remainders of CipherText + for (int i = 0; i < primes.Count; i++) + { + BigInteger exp = input.ModPow(priv.PhiN.Divide((BigInteger)primes[i]), priv.Modulus); + IList al = lookup[i]; + if (lookup[i].Count != ((BigInteger)primes[i]).IntValue) + { + throw new InvalidCipherTextException("Error in lookup Array for " + + ((BigInteger)primes[i]).IntValue + + ": Size mismatch. Expected ArrayList with length " + + ((BigInteger)primes[i]).IntValue + " but found ArrayList of length " + + lookup[i].Count); + } + int lookedup = al.IndexOf(exp); + + if (lookedup == -1) + { + throw new InvalidCipherTextException("Lookup failed"); + } + plain.Add(BigInteger.ValueOf(lookedup)); + } + BigInteger test = chineseRemainder(plain, primes); + + // Should not be used as an oracle, so reencrypt output to see + // if it corresponds to input + + // this breaks probabilisic encryption, so disable it. Anyway, we do + // use the first n primes for key generation, so it is pretty easy + // to guess them. But as stated in the paper, this is not a security + // breach. So we can just work with the correct sigma. + + // if ((key.G.ModPow(test, key.Modulus)).Equals(input)) { + // output = test.ToByteArray(); + // } else { + // output = null; + // } + + output = test.ToByteArray(); + } + + return output; + } + + /** + * Encrypts a BigInteger aka Plaintext with the public key. + * + * @param plain + * The BigInteger to encrypt + * @return The byte[] representation of the encrypted BigInteger (i.e. + * crypted.toByteArray()) + */ + public virtual byte[] Encrypt( + BigInteger plain) + { + // Always return modulus size values 0-padded at the beginning + // 0-padding at the beginning is correctly parsed by BigInteger :) +// byte[] output = key.Modulus.ToByteArray(); +// Array.Clear(output, 0, output.Length); + byte[] output = new byte[key.Modulus.BitLength / 8 + 1]; + + byte[] tmp = key.G.ModPow(plain, key.Modulus).ToByteArray(); + Array.Copy(tmp, 0, output, output.Length - tmp.Length, tmp.Length); + return output; + } + + /** + * Adds the contents of two encrypted blocks mod sigma + * + * @param block1 + * the first encrypted block + * @param block2 + * the second encrypted block + * @return encrypt((block1 + block2) mod sigma) + * @throws InvalidCipherTextException + */ + public virtual byte[] AddCryptedBlocks( + byte[] block1, + byte[] block2) + { + // check for correct blocksize + if (forEncryption) + { + if ((block1.Length > GetOutputBlockSize()) + || (block2.Length > GetOutputBlockSize())) + { + throw new InvalidCipherTextException( + "BlockLength too large for simple addition.\n"); + } + } + else + { + if ((block1.Length > GetInputBlockSize()) + || (block2.Length > GetInputBlockSize())) + { + throw new InvalidCipherTextException( + "BlockLength too large for simple addition.\n"); + } + } + + // calculate resulting block + BigInteger m1Crypt = new BigInteger(1, block1); + BigInteger m2Crypt = new BigInteger(1, block2); + BigInteger m1m2Crypt = m1Crypt.Multiply(m2Crypt); + m1m2Crypt = m1m2Crypt.Mod(key.Modulus); + + //byte[] output = key.Modulus.ToByteArray(); + //Array.Clear(output, 0, output.Length); + byte[] output = new byte[key.Modulus.BitLength / 8 + 1]; + + byte[] m1m2CryptBytes = m1m2Crypt.ToByteArray(); + Array.Copy(m1m2CryptBytes, 0, output, + output.Length - m1m2CryptBytes.Length, m1m2CryptBytes.Length); + + return output; + } + + /** + * Convenience Method for data exchange with the cipher. + * + * Determines blocksize and splits data to blocksize. + * + * @param data the data to be processed + * @return the data after it went through the NaccacheSternEngine. + * @throws InvalidCipherTextException + */ + public virtual byte[] ProcessData( + byte[] data) + { + if (data.Length > GetInputBlockSize()) + { + int inBlocksize = GetInputBlockSize(); + int outBlocksize = GetOutputBlockSize(); + int datapos = 0; + int retpos = 0; + byte[] retval = new byte[(data.Length / inBlocksize + 1) * outBlocksize]; + while (datapos < data.Length) + { + byte[] tmp; + if (datapos + inBlocksize < data.Length) + { + tmp = ProcessBlock(data, datapos, inBlocksize); + datapos += inBlocksize; + } + else + { + tmp = ProcessBlock(data, datapos, data.Length - datapos); + datapos += data.Length - datapos; + } + if (tmp != null) + { + tmp.CopyTo(retval, retpos); + retpos += tmp.Length; + } + else + { + throw new InvalidCipherTextException("cipher returned null"); + } + } + byte[] ret = new byte[retpos]; + Array.Copy(retval, 0, ret, 0, retpos); + return ret; + } + else + { + return ProcessBlock(data, 0, data.Length); + } + } + + /** + * Computes the integer x that is expressed through the given primes and the + * congruences with the chinese remainder theorem (CRT). + * + * @param congruences + * the congruences c_i + * @param primes + * the primes p_i + * @return an integer x for that x % p_i == c_i + */ + private static BigInteger chineseRemainder(IList congruences, IList primes) + { + BigInteger retval = BigInteger.Zero; + BigInteger all = BigInteger.One; + for (int i = 0; i < primes.Count; i++) + { + all = all.Multiply((BigInteger)primes[i]); + } + for (int i = 0; i < primes.Count; i++) + { + BigInteger a = (BigInteger)primes[i]; + BigInteger b = all.Divide(a); + BigInteger b2 = b.ModInverse(a); + BigInteger tmp = b.Multiply(b2); + tmp = tmp.Multiply((BigInteger)congruences[i]); + retval = retval.Add(tmp); + } + + return retval.Mod(all); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NaccacheSternEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NaccacheSternEngine.cs.meta new file mode 100644 index 00000000..66c1df8b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NaccacheSternEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a7ab764450893347acda928f15fa396 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NoekeonEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NoekeonEngine.cs new file mode 100644 index 00000000..a39d7140 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NoekeonEngine.cs @@ -0,0 +1,245 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * A Noekeon engine, using direct-key mode. + */ + public class NoekeonEngine + : IBlockCipher + { + private const int GenericSize = 16; // Block and key size, as well as the amount of rounds. + + private static readonly uint[] nullVector = + { + 0x00, 0x00, 0x00, 0x00 // Used in decryption + }; + + private static readonly uint[] roundConstants = + { + 0x80, 0x1b, 0x36, 0x6c, + 0xd8, 0xab, 0x4d, 0x9a, + 0x2f, 0x5e, 0xbc, 0x63, + 0xc6, 0x97, 0x35, 0x6a, + 0xd4 + }; + + private uint[] state = new uint[4], // a + subKeys = new uint[4], // k + decryptKeys = new uint[4]; + + private bool _initialised, _forEncryption; + + /** + * Create an instance of the Noekeon encryption algorithm + * and set some defaults + */ + public NoekeonEngine() + { + _initialised = false; + } + + public virtual string AlgorithmName + { + get { return "Noekeon"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return GenericSize; + } + + /** + * initialise + * + * @param forEncryption whether or not we are for encryption. + * @param params the parameters required to set up the cipher. + * @exception ArgumentException if the params argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("Invalid parameters passed to Noekeon init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters), "parameters"); + + _forEncryption = forEncryption; + _initialised = true; + + KeyParameter p = (KeyParameter) parameters; + + setKey(p.GetKey()); + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (!_initialised) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Check.DataLength(input, inOff, GenericSize, "input buffer too short"); + Check.OutputLength(output, outOff, GenericSize, "output buffer too short"); + + return _forEncryption + ? encryptBlock(input, inOff, output, outOff) + : decryptBlock(input, inOff, output, outOff); + } + + public virtual void Reset() + { + // TODO This should do something in case the encryption is aborted + } + + /** + * Re-key the cipher. + * + * @param key the key to be used + */ + private void setKey(byte[] key) + { + subKeys[0] = Pack.BE_To_UInt32(key, 0); + subKeys[1] = Pack.BE_To_UInt32(key, 4); + subKeys[2] = Pack.BE_To_UInt32(key, 8); + subKeys[3] = Pack.BE_To_UInt32(key, 12); + } + + private int encryptBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + state[0] = Pack.BE_To_UInt32(input, inOff); + state[1] = Pack.BE_To_UInt32(input, inOff+4); + state[2] = Pack.BE_To_UInt32(input, inOff+8); + state[3] = Pack.BE_To_UInt32(input, inOff+12); + + int i; + for (i = 0; i < GenericSize; i++) + { + state[0] ^= roundConstants[i]; + theta(state, subKeys); + pi1(state); + gamma(state); + pi2(state); + } + + state[0] ^= roundConstants[i]; + theta(state, subKeys); + + Pack.UInt32_To_BE(state[0], output, outOff); + Pack.UInt32_To_BE(state[1], output, outOff+4); + Pack.UInt32_To_BE(state[2], output, outOff+8); + Pack.UInt32_To_BE(state[3], output, outOff+12); + + return GenericSize; + } + + private int decryptBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + state[0] = Pack.BE_To_UInt32(input, inOff); + state[1] = Pack.BE_To_UInt32(input, inOff+4); + state[2] = Pack.BE_To_UInt32(input, inOff+8); + state[3] = Pack.BE_To_UInt32(input, inOff+12); + + Array.Copy(subKeys, 0, decryptKeys, 0, subKeys.Length); + theta(decryptKeys, nullVector); + + int i; + for (i = GenericSize; i > 0; i--) + { + theta(state, decryptKeys); + state[0] ^= roundConstants[i]; + pi1(state); + gamma(state); + pi2(state); + } + + theta(state, decryptKeys); + state[0] ^= roundConstants[i]; + + Pack.UInt32_To_BE(state[0], output, outOff); + Pack.UInt32_To_BE(state[1], output, outOff+4); + Pack.UInt32_To_BE(state[2], output, outOff+8); + Pack.UInt32_To_BE(state[3], output, outOff+12); + + return GenericSize; + } + + private void gamma(uint[] a) + { + a[1] ^= ~a[3] & ~a[2]; + a[0] ^= a[2] & a[1]; + + uint tmp = a[3]; + a[3] = a[0]; + a[0] = tmp; + a[2] ^= a[0]^a[1]^a[3]; + + a[1] ^= ~a[3] & ~a[2]; + a[0] ^= a[2] & a[1]; + } + + private void theta(uint[] a, uint[] k) + { + uint tmp; + tmp = a[0]^a[2]; + tmp ^= rotl(tmp,8)^rotl(tmp,24); + a[1] ^= tmp; + a[3] ^= tmp; + + for (int i = 0; i < 4; i++) + { + a[i] ^= k[i]; + } + + tmp = a[1]^a[3]; + tmp ^= rotl(tmp,8)^rotl(tmp,24); + a[0] ^= tmp; + a[2] ^= tmp; + } + + private void pi1(uint[] a) + { + a[1] = rotl(a[1], 1); + a[2] = rotl(a[2], 5); + a[3] = rotl(a[3], 2); + } + + private void pi2(uint[] a) + { + a[1] = rotl(a[1], 31); + a[2] = rotl(a[2], 27); + a[3] = rotl(a[3], 30); + } + + // Helpers + + private uint rotl(uint x, int y) + { + return (x << y) | (x >> (32-y)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NoekeonEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NoekeonEngine.cs.meta new file mode 100644 index 00000000..b3e41eb6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NoekeonEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89978e6f457d6a546ac5b8c81fa0b9cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NullEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NullEngine.cs new file mode 100644 index 00000000..8611c190 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NullEngine.cs @@ -0,0 +1,73 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * The no-op engine that just copies bytes through, irrespective of whether encrypting and decrypting. + * Provided for the sake of completeness. + */ + public class NullEngine + : IBlockCipher + { + private bool initialised; + private const int BlockSize = 1; + + public NullEngine() + { + } + + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + // we don't mind any parameters that may come in + initialised = true; + } + + public virtual string AlgorithmName + { + get { return "Null"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return true; } + } + + public virtual int GetBlockSize() + { + return BlockSize; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (!initialised) + throw new InvalidOperationException("Null engine not initialised"); + + Check.DataLength(input, inOff, BlockSize, "input buffer too short"); + Check.OutputLength(output, outOff, BlockSize, "output buffer too short"); + + for (int i = 0; i < BlockSize; ++i) + { + output[outOff + i] = input[inOff + i]; + } + + return BlockSize; + } + + public virtual void Reset() + { + // nothing needs to be done + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NullEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NullEngine.cs.meta new file mode 100644 index 00000000..82f177c8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/NullEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e8ef7c09573c15a4aa37a145bd617daf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2Engine.cs new file mode 100644 index 00000000..19b850ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2Engine.cs @@ -0,0 +1,315 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * an implementation of RC2 as described in RFC 2268 + * "A Description of the RC2(r) Encryption Algorithm" R. Rivest. + */ + public class RC2Engine + : IBlockCipher + { + // + // the values we use for key expansion (based on the digits of PI) + // + private static readonly byte[] piTable = + { + (byte)0xd9, (byte)0x78, (byte)0xf9, (byte)0xc4, (byte)0x19, (byte)0xdd, (byte)0xb5, (byte)0xed, + (byte)0x28, (byte)0xe9, (byte)0xfd, (byte)0x79, (byte)0x4a, (byte)0xa0, (byte)0xd8, (byte)0x9d, + (byte)0xc6, (byte)0x7e, (byte)0x37, (byte)0x83, (byte)0x2b, (byte)0x76, (byte)0x53, (byte)0x8e, + (byte)0x62, (byte)0x4c, (byte)0x64, (byte)0x88, (byte)0x44, (byte)0x8b, (byte)0xfb, (byte)0xa2, + (byte)0x17, (byte)0x9a, (byte)0x59, (byte)0xf5, (byte)0x87, (byte)0xb3, (byte)0x4f, (byte)0x13, + (byte)0x61, (byte)0x45, (byte)0x6d, (byte)0x8d, (byte)0x9, (byte)0x81, (byte)0x7d, (byte)0x32, + (byte)0xbd, (byte)0x8f, (byte)0x40, (byte)0xeb, (byte)0x86, (byte)0xb7, (byte)0x7b, (byte)0xb, + (byte)0xf0, (byte)0x95, (byte)0x21, (byte)0x22, (byte)0x5c, (byte)0x6b, (byte)0x4e, (byte)0x82, + (byte)0x54, (byte)0xd6, (byte)0x65, (byte)0x93, (byte)0xce, (byte)0x60, (byte)0xb2, (byte)0x1c, + (byte)0x73, (byte)0x56, (byte)0xc0, (byte)0x14, (byte)0xa7, (byte)0x8c, (byte)0xf1, (byte)0xdc, + (byte)0x12, (byte)0x75, (byte)0xca, (byte)0x1f, (byte)0x3b, (byte)0xbe, (byte)0xe4, (byte)0xd1, + (byte)0x42, (byte)0x3d, (byte)0xd4, (byte)0x30, (byte)0xa3, (byte)0x3c, (byte)0xb6, (byte)0x26, + (byte)0x6f, (byte)0xbf, (byte)0xe, (byte)0xda, (byte)0x46, (byte)0x69, (byte)0x7, (byte)0x57, + (byte)0x27, (byte)0xf2, (byte)0x1d, (byte)0x9b, (byte)0xbc, (byte)0x94, (byte)0x43, (byte)0x3, + (byte)0xf8, (byte)0x11, (byte)0xc7, (byte)0xf6, (byte)0x90, (byte)0xef, (byte)0x3e, (byte)0xe7, + (byte)0x6, (byte)0xc3, (byte)0xd5, (byte)0x2f, (byte)0xc8, (byte)0x66, (byte)0x1e, (byte)0xd7, + (byte)0x8, (byte)0xe8, (byte)0xea, (byte)0xde, (byte)0x80, (byte)0x52, (byte)0xee, (byte)0xf7, + (byte)0x84, (byte)0xaa, (byte)0x72, (byte)0xac, (byte)0x35, (byte)0x4d, (byte)0x6a, (byte)0x2a, + (byte)0x96, (byte)0x1a, (byte)0xd2, (byte)0x71, (byte)0x5a, (byte)0x15, (byte)0x49, (byte)0x74, + (byte)0x4b, (byte)0x9f, (byte)0xd0, (byte)0x5e, (byte)0x4, (byte)0x18, (byte)0xa4, (byte)0xec, + (byte)0xc2, (byte)0xe0, (byte)0x41, (byte)0x6e, (byte)0xf, (byte)0x51, (byte)0xcb, (byte)0xcc, + (byte)0x24, (byte)0x91, (byte)0xaf, (byte)0x50, (byte)0xa1, (byte)0xf4, (byte)0x70, (byte)0x39, + (byte)0x99, (byte)0x7c, (byte)0x3a, (byte)0x85, (byte)0x23, (byte)0xb8, (byte)0xb4, (byte)0x7a, + (byte)0xfc, (byte)0x2, (byte)0x36, (byte)0x5b, (byte)0x25, (byte)0x55, (byte)0x97, (byte)0x31, + (byte)0x2d, (byte)0x5d, (byte)0xfa, (byte)0x98, (byte)0xe3, (byte)0x8a, (byte)0x92, (byte)0xae, + (byte)0x5, (byte)0xdf, (byte)0x29, (byte)0x10, (byte)0x67, (byte)0x6c, (byte)0xba, (byte)0xc9, + (byte)0xd3, (byte)0x0, (byte)0xe6, (byte)0xcf, (byte)0xe1, (byte)0x9e, (byte)0xa8, (byte)0x2c, + (byte)0x63, (byte)0x16, (byte)0x1, (byte)0x3f, (byte)0x58, (byte)0xe2, (byte)0x89, (byte)0xa9, + (byte)0xd, (byte)0x38, (byte)0x34, (byte)0x1b, (byte)0xab, (byte)0x33, (byte)0xff, (byte)0xb0, + (byte)0xbb, (byte)0x48, (byte)0xc, (byte)0x5f, (byte)0xb9, (byte)0xb1, (byte)0xcd, (byte)0x2e, + (byte)0xc5, (byte)0xf3, (byte)0xdb, (byte)0x47, (byte)0xe5, (byte)0xa5, (byte)0x9c, (byte)0x77, + (byte)0xa, (byte)0xa6, (byte)0x20, (byte)0x68, (byte)0xfe, (byte)0x7f, (byte)0xc1, (byte)0xad + }; + + private const int BLOCK_SIZE = 8; + + private int[] workingKey; + private bool encrypting; + + private int[] GenerateWorkingKey( + byte[] key, + int bits) + { + int x; + int[] xKey = new int[128]; + + for (int i = 0; i != key.Length; i++) + { + xKey[i] = key[i] & 0xff; + } + + // Phase 1: Expand input key to 128 bytes + int len = key.Length; + + if (len < 128) + { + int index = 0; + + x = xKey[len - 1]; + + do + { + x = piTable[(x + xKey[index++]) & 255] & 0xff; + xKey[len++] = x; + } + while (len < 128); + } + + // Phase 2 - reduce effective key size to "bits" + len = (bits + 7) >> 3; + x = piTable[xKey[128 - len] & (255 >> (7 & -bits))] & 0xff; + xKey[128 - len] = x; + + for (int i = 128 - len - 1; i >= 0; i--) + { + x = piTable[x ^ xKey[i + len]] & 0xff; + xKey[i] = x; + } + + // Phase 3 - copy to newKey in little-endian order + int[] newKey = new int[64]; + + for (int i = 0; i != newKey.Length; i++) + { + newKey[i] = (xKey[2 * i] + (xKey[2 * i + 1] << 8)); + } + + return newKey; + } + + /** + * initialise a RC2 cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.encrypting = forEncryption; + + if (parameters is RC2Parameters) + { + RC2Parameters param = (RC2Parameters) parameters; + + workingKey = GenerateWorkingKey(param.GetKey(), param.EffectiveKeyBits); + } + else if (parameters is KeyParameter) + { + KeyParameter param = (KeyParameter) parameters; + byte[] key = param.GetKey(); + + workingKey = GenerateWorkingKey(key, key.Length * 8); + } + else + { + throw new ArgumentException("invalid parameter passed to RC2 init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + } + + public virtual void Reset() + { + } + + public virtual string AlgorithmName + { + get { return "RC2"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (workingKey == null) + throw new InvalidOperationException("RC2 engine not initialised"); + + Check.DataLength(input, inOff, BLOCK_SIZE, "input buffer too short"); + Check.OutputLength(output, outOff, BLOCK_SIZE, "output buffer too short"); + + if (encrypting) + { + EncryptBlock(input, inOff, output, outOff); + } + else + { + DecryptBlock(input, inOff, output, outOff); + } + + return BLOCK_SIZE; + } + + /** + * return the result rotating the 16 bit number in x left by y + */ + private int RotateWordLeft( + int x, + int y) + { + x &= 0xffff; + return (x << y) | (x >> (16 - y)); + } + + private void EncryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + int x76, x54, x32, x10; + + x76 = ((input[inOff + 7] & 0xff) << 8) + (input[inOff + 6] & 0xff); + x54 = ((input[inOff + 5] & 0xff) << 8) + (input[inOff + 4] & 0xff); + x32 = ((input[inOff + 3] & 0xff) << 8) + (input[inOff + 2] & 0xff); + x10 = ((input[inOff + 1] & 0xff) << 8) + (input[inOff + 0] & 0xff); + + for (int i = 0; i <= 16; i += 4) + { + x10 = RotateWordLeft(x10 + (x32 & ~x76) + (x54 & x76) + workingKey[i ], 1); + x32 = RotateWordLeft(x32 + (x54 & ~x10) + (x76 & x10) + workingKey[i+1], 2); + x54 = RotateWordLeft(x54 + (x76 & ~x32) + (x10 & x32) + workingKey[i+2], 3); + x76 = RotateWordLeft(x76 + (x10 & ~x54) + (x32 & x54) + workingKey[i+3], 5); + } + + x10 += workingKey[x76 & 63]; + x32 += workingKey[x10 & 63]; + x54 += workingKey[x32 & 63]; + x76 += workingKey[x54 & 63]; + + for (int i = 20; i <= 40; i += 4) + { + x10 = RotateWordLeft(x10 + (x32 & ~x76) + (x54 & x76) + workingKey[i ], 1); + x32 = RotateWordLeft(x32 + (x54 & ~x10) + (x76 & x10) + workingKey[i+1], 2); + x54 = RotateWordLeft(x54 + (x76 & ~x32) + (x10 & x32) + workingKey[i+2], 3); + x76 = RotateWordLeft(x76 + (x10 & ~x54) + (x32 & x54) + workingKey[i+3], 5); + } + + x10 += workingKey[x76 & 63]; + x32 += workingKey[x10 & 63]; + x54 += workingKey[x32 & 63]; + x76 += workingKey[x54 & 63]; + + for (int i = 44; i < 64; i += 4) + { + x10 = RotateWordLeft(x10 + (x32 & ~x76) + (x54 & x76) + workingKey[i ], 1); + x32 = RotateWordLeft(x32 + (x54 & ~x10) + (x76 & x10) + workingKey[i+1], 2); + x54 = RotateWordLeft(x54 + (x76 & ~x32) + (x10 & x32) + workingKey[i+2], 3); + x76 = RotateWordLeft(x76 + (x10 & ~x54) + (x32 & x54) + workingKey[i+3], 5); + } + + outBytes[outOff + 0] = (byte)x10; + outBytes[outOff + 1] = (byte)(x10 >> 8); + outBytes[outOff + 2] = (byte)x32; + outBytes[outOff + 3] = (byte)(x32 >> 8); + outBytes[outOff + 4] = (byte)x54; + outBytes[outOff + 5] = (byte)(x54 >> 8); + outBytes[outOff + 6] = (byte)x76; + outBytes[outOff + 7] = (byte)(x76 >> 8); + } + + private void DecryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + int x76, x54, x32, x10; + + x76 = ((input[inOff + 7] & 0xff) << 8) + (input[inOff + 6] & 0xff); + x54 = ((input[inOff + 5] & 0xff) << 8) + (input[inOff + 4] & 0xff); + x32 = ((input[inOff + 3] & 0xff) << 8) + (input[inOff + 2] & 0xff); + x10 = ((input[inOff + 1] & 0xff) << 8) + (input[inOff + 0] & 0xff); + + for (int i = 60; i >= 44; i -= 4) + { + x76 = RotateWordLeft(x76, 11) - ((x10 & ~x54) + (x32 & x54) + workingKey[i+3]); + x54 = RotateWordLeft(x54, 13) - ((x76 & ~x32) + (x10 & x32) + workingKey[i+2]); + x32 = RotateWordLeft(x32, 14) - ((x54 & ~x10) + (x76 & x10) + workingKey[i+1]); + x10 = RotateWordLeft(x10, 15) - ((x32 & ~x76) + (x54 & x76) + workingKey[i ]); + } + + x76 -= workingKey[x54 & 63]; + x54 -= workingKey[x32 & 63]; + x32 -= workingKey[x10 & 63]; + x10 -= workingKey[x76 & 63]; + + for (int i = 40; i >= 20; i -= 4) + { + x76 = RotateWordLeft(x76, 11) - ((x10 & ~x54) + (x32 & x54) + workingKey[i+3]); + x54 = RotateWordLeft(x54, 13) - ((x76 & ~x32) + (x10 & x32) + workingKey[i+2]); + x32 = RotateWordLeft(x32, 14) - ((x54 & ~x10) + (x76 & x10) + workingKey[i+1]); + x10 = RotateWordLeft(x10, 15) - ((x32 & ~x76) + (x54 & x76) + workingKey[i ]); + } + + x76 -= workingKey[x54 & 63]; + x54 -= workingKey[x32 & 63]; + x32 -= workingKey[x10 & 63]; + x10 -= workingKey[x76 & 63]; + + for (int i = 16; i >= 0; i -= 4) + { + x76 = RotateWordLeft(x76, 11) - ((x10 & ~x54) + (x32 & x54) + workingKey[i+3]); + x54 = RotateWordLeft(x54, 13) - ((x76 & ~x32) + (x10 & x32) + workingKey[i+2]); + x32 = RotateWordLeft(x32, 14) - ((x54 & ~x10) + (x76 & x10) + workingKey[i+1]); + x10 = RotateWordLeft(x10, 15) - ((x32 & ~x76) + (x54 & x76) + workingKey[i ]); + } + + outBytes[outOff + 0] = (byte)x10; + outBytes[outOff + 1] = (byte)(x10 >> 8); + outBytes[outOff + 2] = (byte)x32; + outBytes[outOff + 3] = (byte)(x32 >> 8); + outBytes[outOff + 4] = (byte)x54; + outBytes[outOff + 5] = (byte)(x54 >> 8); + outBytes[outOff + 6] = (byte)x76; + outBytes[outOff + 7] = (byte)(x76 >> 8); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2Engine.cs.meta new file mode 100644 index 00000000..a5e43817 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9e2908df73e25da4690be4d9c34ba50c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2WrapEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2WrapEngine.cs new file mode 100644 index 00000000..ad9ddf3e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2WrapEngine.cs @@ -0,0 +1,374 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * Wrap keys according to RFC 3217 - RC2 mechanism + */ + public class RC2WrapEngine + : IWrapper + { + /** Field engine */ + private CbcBlockCipher engine; + + /** Field param */ + private ICipherParameters parameters; + + /** Field paramPlusIV */ + private ParametersWithIV paramPlusIV; + + /** Field iv */ + private byte[] iv; + + /** Field forWrapping */ + private bool forWrapping; + + private SecureRandom sr; + + /** Field IV2 */ + private static readonly byte[] IV2 = + { + (byte) 0x4a, (byte) 0xdd, (byte) 0xa2, + (byte) 0x2c, (byte) 0x79, (byte) 0xe8, + (byte) 0x21, (byte) 0x05 + }; + + // + // checksum digest + // + IDigest sha1 = new Sha1Digest(); + byte[] digest = new byte[20]; + + /** + * Method init + * + * @param forWrapping + * @param param + */ + public virtual void Init( + bool forWrapping, + ICipherParameters parameters) + { + this.forWrapping = forWrapping; + this.engine = new CbcBlockCipher(new RC2Engine()); + + if (parameters is ParametersWithRandom) + { + ParametersWithRandom pWithR = (ParametersWithRandom)parameters; + sr = pWithR.Random; + parameters = pWithR.Parameters; + } + else + { + sr = new SecureRandom(); + } + + if (parameters is ParametersWithIV) + { + if (!forWrapping) + throw new ArgumentException("You should not supply an IV for unwrapping"); + + this.paramPlusIV = (ParametersWithIV)parameters; + this.iv = this.paramPlusIV.GetIV(); + this.parameters = this.paramPlusIV.Parameters; + + if (this.iv.Length != 8) + throw new ArgumentException("IV is not 8 octets"); + } + else + { + this.parameters = parameters; + + if (this.forWrapping) + { + // Hm, we have no IV but we want to wrap ?!? + // well, then we have to create our own IV. + this.iv = new byte[8]; + sr.NextBytes(iv); + this.paramPlusIV = new ParametersWithIV(this.parameters, this.iv); + } + } + } + + /** + * Method GetAlgorithmName + * + * @return + */ + public virtual string AlgorithmName + { + get { return "RC2"; } + } + + /** + * Method wrap + * + * @param in + * @param inOff + * @param inLen + * @return + */ + public virtual byte[] Wrap( + byte[] input, + int inOff, + int length) + { + if (!forWrapping) + { + throw new InvalidOperationException("Not initialized for wrapping"); + } + + int len = length + 1; + if ((len % 8) != 0) + { + len += 8 - (len % 8); + } + + byte [] keyToBeWrapped = new byte[len]; + + keyToBeWrapped[0] = (byte)length; + Array.Copy(input, inOff, keyToBeWrapped, 1, length); + + byte[] pad = new byte[keyToBeWrapped.Length - length - 1]; + + if (pad.Length > 0) + { + sr.NextBytes(pad); + Array.Copy(pad, 0, keyToBeWrapped, length + 1, pad.Length); + } + + // Compute the CMS Key Checksum, (section 5.6.1), call this CKS. + byte[] CKS = CalculateCmsKeyChecksum(keyToBeWrapped); + + // Let WKCKS = WK || CKS where || is concatenation. + byte[] WKCKS = new byte[keyToBeWrapped.Length + CKS.Length]; + + Array.Copy(keyToBeWrapped, 0, WKCKS, 0, keyToBeWrapped.Length); + Array.Copy(CKS, 0, WKCKS, keyToBeWrapped.Length, CKS.Length); + + // Encrypt WKCKS in CBC mode using KEK as the key and IV as the + // initialization vector. Call the results TEMP1. + byte [] TEMP1 = new byte[WKCKS.Length]; + + Array.Copy(WKCKS, 0, TEMP1, 0, WKCKS.Length); + + int noOfBlocks = WKCKS.Length / engine.GetBlockSize(); + int extraBytes = WKCKS.Length % engine.GetBlockSize(); + + if (extraBytes != 0) + { + throw new InvalidOperationException("Not multiple of block length"); + } + + engine.Init(true, paramPlusIV); + + for (int i = 0; i < noOfBlocks; i++) + { + int currentBytePos = i * engine.GetBlockSize(); + + engine.ProcessBlock(TEMP1, currentBytePos, TEMP1, currentBytePos); + } + + // Left TEMP2 = IV || TEMP1. + byte[] TEMP2 = new byte[this.iv.Length + TEMP1.Length]; + + Array.Copy(this.iv, 0, TEMP2, 0, this.iv.Length); + Array.Copy(TEMP1, 0, TEMP2, this.iv.Length, TEMP1.Length); + + // Reverse the order of the octets in TEMP2 and call the result TEMP3. + byte[] TEMP3 = new byte[TEMP2.Length]; + + for (int i = 0; i < TEMP2.Length; i++) + { + TEMP3[i] = TEMP2[TEMP2.Length - (i + 1)]; + } + + // Encrypt TEMP3 in CBC mode using the KEK and an initialization vector + // of 0x 4a dd a2 2c 79 e8 21 05. The resulting cipher text is the desired + // result. It is 40 octets long if a 168 bit key is being wrapped. + ParametersWithIV param2 = new ParametersWithIV(this.parameters, IV2); + + this.engine.Init(true, param2); + + for (int i = 0; i < noOfBlocks + 1; i++) + { + int currentBytePos = i * engine.GetBlockSize(); + + engine.ProcessBlock(TEMP3, currentBytePos, TEMP3, currentBytePos); + } + + return TEMP3; + } + + /** + * Method unwrap + * + * @param in + * @param inOff + * @param inLen + * @return + * @throws InvalidCipherTextException + */ + public virtual byte[] Unwrap( + byte[] input, + int inOff, + int length) + { + if (forWrapping) + { + throw new InvalidOperationException("Not set for unwrapping"); + } + + if (input == null) + { + throw new InvalidCipherTextException("Null pointer as ciphertext"); + } + + if (length % engine.GetBlockSize() != 0) + { + throw new InvalidCipherTextException("Ciphertext not multiple of " + + engine.GetBlockSize()); + } + + /* + // Check if the length of the cipher text is reasonable given the key + // type. It must be 40 bytes for a 168 bit key and either 32, 40, or + // 48 bytes for a 128, 192, or 256 bit key. If the length is not supported + // or inconsistent with the algorithm for which the key is intended, + // return error. + // + // we do not accept 168 bit keys. it has to be 192 bit. + int lengthA = (estimatedKeyLengthInBit / 8) + 16; + int lengthB = estimatedKeyLengthInBit % 8; + + if ((lengthA != keyToBeUnwrapped.Length) || (lengthB != 0)) { + throw new XMLSecurityException("empty"); + } + */ + + // Decrypt the cipher text with TRIPLedeS in CBC mode using the KEK + // and an initialization vector (IV) of 0x4adda22c79e82105. Call the output TEMP3. + ParametersWithIV param2 = new ParametersWithIV(this.parameters, IV2); + + this.engine.Init(false, param2); + + byte [] TEMP3 = new byte[length]; + + Array.Copy(input, inOff, TEMP3, 0, length); + + for (int i = 0; i < (TEMP3.Length / engine.GetBlockSize()); i++) + { + int currentBytePos = i * engine.GetBlockSize(); + + engine.ProcessBlock(TEMP3, currentBytePos, TEMP3, currentBytePos); + } + + // Reverse the order of the octets in TEMP3 and call the result TEMP2. + byte[] TEMP2 = new byte[TEMP3.Length]; + + for (int i = 0; i < TEMP3.Length; i++) + { + TEMP2[i] = TEMP3[TEMP3.Length - (i + 1)]; + } + + // Decompose TEMP2 into IV, the first 8 octets, and TEMP1, the remaining octets. + this.iv = new byte[8]; + + byte[] TEMP1 = new byte[TEMP2.Length - 8]; + + Array.Copy(TEMP2, 0, this.iv, 0, 8); + Array.Copy(TEMP2, 8, TEMP1, 0, TEMP2.Length - 8); + + // Decrypt TEMP1 using TRIPLedeS in CBC mode using the KEK and the IV + // found in the previous step. Call the result WKCKS. + this.paramPlusIV = new ParametersWithIV(this.parameters, this.iv); + + this.engine.Init(false, this.paramPlusIV); + + byte[] LCEKPADICV = new byte[TEMP1.Length]; + + Array.Copy(TEMP1, 0, LCEKPADICV, 0, TEMP1.Length); + + for (int i = 0; i < (LCEKPADICV.Length / engine.GetBlockSize()); i++) + { + int currentBytePos = i * engine.GetBlockSize(); + + engine.ProcessBlock(LCEKPADICV, currentBytePos, LCEKPADICV, currentBytePos); + } + + // Decompose LCEKPADICV. CKS is the last 8 octets and WK, the wrapped key, are + // those octets before the CKS. + byte[] result = new byte[LCEKPADICV.Length - 8]; + byte[] CKStoBeVerified = new byte[8]; + + Array.Copy(LCEKPADICV, 0, result, 0, LCEKPADICV.Length - 8); + Array.Copy(LCEKPADICV, LCEKPADICV.Length - 8, CKStoBeVerified, 0, 8); + + // Calculate a CMS Key Checksum, (section 5.6.1), over the WK and compare + // with the CKS extracted in the above step. If they are not equal, return error. + if (!CheckCmsKeyChecksum(result, CKStoBeVerified)) + { + throw new InvalidCipherTextException( + "Checksum inside ciphertext is corrupted"); + } + + if ((result.Length - ((result[0] & 0xff) + 1)) > 7) + { + throw new InvalidCipherTextException( + "too many pad bytes (" + (result.Length - ((result[0] & 0xff) + 1)) + ")"); + } + + // CEK is the wrapped key, now extracted for use in data decryption. + byte[] CEK = new byte[result[0]]; + Array.Copy(result, 1, CEK, 0, CEK.Length); + return CEK; + } + + /** + * Some key wrap algorithms make use of the Key Checksum defined + * in CMS [CMS-Algorithms]. This is used to provide an integrity + * check value for the key being wrapped. The algorithm is + * + * - Compute the 20 octet SHA-1 hash on the key being wrapped. + * - Use the first 8 octets of this hash as the checksum value. + * + * @param key + * @return + * @throws Exception + * @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + */ + private byte[] CalculateCmsKeyChecksum( + byte[] key) + { + sha1.BlockUpdate(key, 0, key.Length); + sha1.DoFinal(digest, 0); + + byte[] result = new byte[8]; + Array.Copy(digest, 0, result, 0, 8); + return result; + } + + /** + * @param key + * @param checksum + * @return + * @see http://www.w3.org/TR/xmlenc-core/#sec-CMSKeyChecksum + */ + private bool CheckCmsKeyChecksum( + byte[] key, + byte[] checksum) + { + return Arrays.ConstantTimeAreEqual(CalculateCmsKeyChecksum(key), checksum); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2WrapEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2WrapEngine.cs.meta new file mode 100644 index 00000000..ece1f929 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC2WrapEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c68dd7b320ee974c9bf521cec0159e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC4Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC4Engine.cs new file mode 100644 index 00000000..8f6214a8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC4Engine.cs @@ -0,0 +1,143 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + public class RC4Engine + : IStreamCipher + { + private readonly static int STATE_LENGTH = 256; + + /* + * variables to hold the state of the RC4 engine + * during encryption and decryption + */ + + private byte[] engineState; + private int x; + private int y; + private byte[] workingKey; + + /** + * initialise a RC4 cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (parameters is KeyParameter) + { + /* + * RC4 encryption and decryption is completely + * symmetrical, so the 'forEncryption' is + * irrelevant. + */ + workingKey = ((KeyParameter)parameters).GetKey(); + SetKey(workingKey); + + return; + } + + throw new ArgumentException("invalid parameter passed to RC4 init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + + public virtual string AlgorithmName + { + get { return "RC4"; } + } + + public virtual byte ReturnByte( + byte input) + { + x = (x + 1) & 0xff; + y = (engineState[x] + y) & 0xff; + + // swap + byte tmp = engineState[x]; + engineState[x] = engineState[y]; + engineState[y] = tmp; + + // xor + return (byte)(input ^ engineState[(engineState[x] + engineState[y]) & 0xff]); + } + + public virtual void ProcessBytes( + byte[] input, + int inOff, + int length, + byte[] output, + int outOff) + { + Check.DataLength(input, inOff, length, "input buffer too short"); + Check.OutputLength(output, outOff, length, "output buffer too short"); + + for (int i = 0; i < length ; i++) + { + x = (x + 1) & 0xff; + y = (engineState[x] + y) & 0xff; + + // swap + byte tmp = engineState[x]; + engineState[x] = engineState[y]; + engineState[y] = tmp; + + // xor + output[i+outOff] = (byte)(input[i + inOff] + ^ engineState[(engineState[x] + engineState[y]) & 0xff]); + } + } + + public virtual void Reset() + { + SetKey(workingKey); + } + + // Private implementation + + private void SetKey( + byte[] keyBytes) + { + workingKey = keyBytes; + + // System.out.println("the key length is ; "+ workingKey.Length); + + x = 0; + y = 0; + + if (engineState == null) + { + engineState = new byte[STATE_LENGTH]; + } + + // reset the state of the engine + for (int i=0; i < STATE_LENGTH; i++) + { + engineState[i] = (byte)i; + } + + int i1 = 0; + int i2 = 0; + + for (int i=0; i < STATE_LENGTH; i++) + { + i2 = ((keyBytes[i1] & 0xff) + engineState[i] + i2) & 0xff; + // do the byte-swap inline + byte tmp = engineState[i]; + engineState[i] = engineState[i2]; + engineState[i2] = tmp; + i1 = (i1+1) % keyBytes.Length; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC4Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC4Engine.cs.meta new file mode 100644 index 00000000..f0922824 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC4Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 068d5429f72b08f45a6b2ecde0991212 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC532Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC532Engine.cs new file mode 100644 index 00000000..b0882407 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC532Engine.cs @@ -0,0 +1,301 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if UNITY_WSA && !UNITY_EDITOR && !ENABLE_IL2CPP +using System.TypeFix; +#endif +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * The specification for RC5 came from the RC5 Encryption Algorithm + * publication in RSA CryptoBytes, Spring of 1995. + * http://www.rsasecurity.com/rsalabs/cryptobytes. + *

+ * This implementation has a word size of 32 bits.

+ */ + public class RC532Engine + : IBlockCipher + { + /* + * the number of rounds to perform + */ + private int _noRounds; + + /* + * the expanded key array of size 2*(rounds + 1) + */ + private int [] _S; + + /* + * our "magic constants" for 32 32 + * + * Pw = Odd((e-2) * 2^wordsize) + * Qw = Odd((o-2) * 2^wordsize) + * + * where e is the base of natural logarithms (2.718281828...) + * and o is the golden ratio (1.61803398...) + */ + private static readonly int P32 = unchecked((int) 0xb7e15163); + private static readonly int Q32 = unchecked((int) 0x9e3779b9); + + private bool forEncryption; + + /** + * Create an instance of the RC5 encryption algorithm + * and set some defaults + */ + public RC532Engine() + { + _noRounds = 12; // the default +// _S = null; + } + + public virtual string AlgorithmName + { + get { return "RC5-32"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return 2 * 4; + } + + /** + * initialise a RC5-32 cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (typeof(RC5Parameters).IsInstanceOfType(parameters)) + { + RC5Parameters p = (RC5Parameters)parameters; + + _noRounds = p.Rounds; + + SetKey(p.GetKey()); + } + else if (typeof(KeyParameter).IsInstanceOfType(parameters)) + { + KeyParameter p = (KeyParameter)parameters; + + SetKey(p.GetKey()); + } + else + { + throw new ArgumentException("invalid parameter passed to RC532 init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + + this.forEncryption = forEncryption; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + return (forEncryption) + ? EncryptBlock(input, inOff, output, outOff) + : DecryptBlock(input, inOff, output, outOff); + } + + public virtual void Reset() + { + } + + /** + * Re-key the cipher. + * + * @param key the key to be used + */ + private void SetKey( + byte[] key) + { + // + // KEY EXPANSION: + // + // There are 3 phases to the key expansion. + // + // Phase 1: + // Copy the secret key K[0...b-1] into an array L[0..c-1] of + // c = ceil(b/u), where u = 32/8 in little-endian order. + // In other words, we fill up L using u consecutive key bytes + // of K. Any unfilled byte positions in L are zeroed. In the + // case that b = c = 0, set c = 1 and L[0] = 0. + // + int[] L = new int[(key.Length + (4 - 1)) / 4]; + + for (int i = 0; i != key.Length; i++) + { + L[i / 4] += (key[i] & 0xff) << (8 * (i % 4)); + } + + // + // Phase 2: + // Initialize S to a particular fixed pseudo-random bit pattern + // using an arithmetic progression modulo 2^wordsize determined + // by the magic numbers, Pw & Qw. + // + _S = new int[2*(_noRounds + 1)]; + + _S[0] = P32; + for (int i=1; i < _S.Length; i++) + { + _S[i] = (_S[i-1] + Q32); + } + + // + // Phase 3: + // Mix in the user's secret key in 3 passes over the arrays S & L. + // The max of the arrays sizes is used as the loop control + // + int iter; + + if (L.Length > _S.Length) + { + iter = 3 * L.Length; + } + else + { + iter = 3 * _S.Length; + } + + int A = 0, B = 0; + int ii = 0, jj = 0; + + for (int k = 0; k < iter; k++) + { + A = _S[ii] = RotateLeft(_S[ii] + A + B, 3); + B = L[jj] = RotateLeft( L[jj] + A + B, A+B); + ii = (ii+1) % _S.Length; + jj = (jj+1) % L.Length; + } + } + + /** + * Encrypt the given block starting at the given offset and place + * the result in the provided buffer starting at the given offset. + * + * @param in in byte buffer containing data to encrypt + * @param inOff offset into src buffer + * @param out out buffer where encrypted data is written + * @param outOff offset into out buffer + */ + private int EncryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + int A = BytesToWord(input, inOff) + _S[0]; + int B = BytesToWord(input, inOff + 4) + _S[1]; + + for (int i = 1; i <= _noRounds; i++) + { + A = RotateLeft(A ^ B, B) + _S[2*i]; + B = RotateLeft(B ^ A, A) + _S[2*i+1]; + } + + WordToBytes(A, outBytes, outOff); + WordToBytes(B, outBytes, outOff + 4); + + return 2 * 4; + } + + private int DecryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + int A = BytesToWord(input, inOff); + int B = BytesToWord(input, inOff + 4); + + for (int i = _noRounds; i >= 1; i--) + { + B = RotateRight(B - _S[2*i+1], A) ^ A; + A = RotateRight(A - _S[2*i], B) ^ B; + } + + WordToBytes(A - _S[0], outBytes, outOff); + WordToBytes(B - _S[1], outBytes, outOff + 4); + + return 2 * 4; + } + + + ////////////////////////////////////////////////////////////// + // + // PRIVATE Helper Methods + // + ////////////////////////////////////////////////////////////// + + /** + * Perform a left "spin" of the word. The rotation of the given + * word x is rotated left by y bits. + * Only the lg(32) low-order bits of y + * are used to determine the rotation amount. Here it is + * assumed that the wordsize used is a power of 2. + * + * @param x word to rotate + * @param y number of bits to rotate % 32 + */ + private int RotateLeft(int x, int y) { + return ((int) ( (uint) (x << (y & (32-1))) | + ((uint) x >> (32 - (y & (32-1)))) ) + ); + } + + /** + * Perform a right "spin" of the word. The rotation of the given + * word x is rotated left by y bits. + * Only the lg(32) low-order bits of y + * are used to determine the rotation amount. Here it is + * assumed that the wordsize used is a power of 2. + * + * @param x word to rotate + * @param y number of bits to rotate % 32 + */ + private int RotateRight(int x, int y) { + return ((int) ( ((uint) x >> (y & (32-1))) | + (uint) (x << (32 - (y & (32-1)))) ) + ); + } + + private int BytesToWord( + byte[] src, + int srcOff) + { + return (src[srcOff] & 0xff) | ((src[srcOff + 1] & 0xff) << 8) + | ((src[srcOff + 2] & 0xff) << 16) | ((src[srcOff + 3] & 0xff) << 24); + } + + private void WordToBytes( + int word, + byte[] dst, + int dstOff) + { + dst[dstOff] = (byte)word; + dst[dstOff + 1] = (byte)(word >> 8); + dst[dstOff + 2] = (byte)(word >> 16); + dst[dstOff + 3] = (byte)(word >> 24); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC532Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC532Engine.cs.meta new file mode 100644 index 00000000..4017d637 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC532Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 715d03447094f77489e130fd0ae50f48 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC564Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC564Engine.cs new file mode 100644 index 00000000..66e7379b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC564Engine.cs @@ -0,0 +1,302 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if UNITY_WSA && !UNITY_EDITOR && !ENABLE_IL2CPP +using System.TypeFix; +#endif +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * The specification for RC5 came from the RC5 Encryption Algorithm + * publication in RSA CryptoBytes, Spring of 1995. + * http://www.rsasecurity.com/rsalabs/cryptobytes. + *

+ * This implementation is set to work with a 64 bit word size.

+ */ + public class RC564Engine + : IBlockCipher + { + private static readonly int wordSize = 64; + private static readonly int bytesPerWord = wordSize / 8; + + /* + * the number of rounds to perform + */ + private int _noRounds; + + /* + * the expanded key array of size 2*(rounds + 1) + */ + private long [] _S; + + /* + * our "magic constants" for wordSize 62 + * + * Pw = Odd((e-2) * 2^wordsize) + * Qw = Odd((o-2) * 2^wordsize) + * + * where e is the base of natural logarithms (2.718281828...) + * and o is the golden ratio (1.61803398...) + */ + private static readonly long P64 = unchecked( (long) 0xb7e151628aed2a6bL); + private static readonly long Q64 = unchecked( (long) 0x9e3779b97f4a7c15L); + + private bool forEncryption; + + /** + * Create an instance of the RC5 encryption algorithm + * and set some defaults + */ + public RC564Engine() + { + _noRounds = 12; +// _S = null; + } + + public virtual string AlgorithmName + { + get { return "RC5-64"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return 2 * bytesPerWord; + } + + /** + * initialise a RC5-64 cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(typeof(RC5Parameters).IsInstanceOfType(parameters))) + { + throw new ArgumentException("invalid parameter passed to RC564 init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + + RC5Parameters p = (RC5Parameters)parameters; + + this.forEncryption = forEncryption; + + _noRounds = p.Rounds; + + SetKey(p.GetKey()); + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + return (forEncryption) ? EncryptBlock(input, inOff, output, outOff) + : DecryptBlock(input, inOff, output, outOff); + } + + public virtual void Reset() + { + } + + /** + * Re-key the cipher. + * + * @param key the key to be used + */ + private void SetKey( + byte[] key) + { + // + // KEY EXPANSION: + // + // There are 3 phases to the key expansion. + // + // Phase 1: + // Copy the secret key K[0...b-1] into an array L[0..c-1] of + // c = ceil(b/u), where u = wordSize/8 in little-endian order. + // In other words, we fill up L using u consecutive key bytes + // of K. Any unfilled byte positions in L are zeroed. In the + // case that b = c = 0, set c = 1 and L[0] = 0. + // + long[] L = new long[(key.Length + (bytesPerWord - 1)) / bytesPerWord]; + + for (int i = 0; i != key.Length; i++) + { + L[i / bytesPerWord] += (long)(key[i] & 0xff) << (8 * (i % bytesPerWord)); + } + + // + // Phase 2: + // Initialize S to a particular fixed pseudo-random bit pattern + // using an arithmetic progression modulo 2^wordsize determined + // by the magic numbers, Pw & Qw. + // + _S = new long[2*(_noRounds + 1)]; + + _S[0] = P64; + for (int i=1; i < _S.Length; i++) + { + _S[i] = (_S[i-1] + Q64); + } + + // + // Phase 3: + // Mix in the user's secret key in 3 passes over the arrays S & L. + // The max of the arrays sizes is used as the loop control + // + int iter; + + if (L.Length > _S.Length) + { + iter = 3 * L.Length; + } + else + { + iter = 3 * _S.Length; + } + + long A = 0, B = 0; + int ii = 0, jj = 0; + + for (int k = 0; k < iter; k++) + { + A = _S[ii] = RotateLeft(_S[ii] + A + B, 3); + B = L[jj] = RotateLeft( L[jj] + A + B, A+B); + ii = (ii+1) % _S.Length; + jj = (jj+1) % L.Length; + } + } + + /** + * Encrypt the given block starting at the given offset and place + * the result in the provided buffer starting at the given offset. + * + * @param in in byte buffer containing data to encrypt + * @param inOff offset into src buffer + * @param out out buffer where encrypted data is written + * @param outOff offset into out buffer + */ + private int EncryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + long A = BytesToWord(input, inOff) + _S[0]; + long B = BytesToWord(input, inOff + bytesPerWord) + _S[1]; + + for (int i = 1; i <= _noRounds; i++) + { + A = RotateLeft(A ^ B, B) + _S[2*i]; + B = RotateLeft(B ^ A, A) + _S[2*i+1]; + } + + WordToBytes(A, outBytes, outOff); + WordToBytes(B, outBytes, outOff + bytesPerWord); + + return 2 * bytesPerWord; + } + + private int DecryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + long A = BytesToWord(input, inOff); + long B = BytesToWord(input, inOff + bytesPerWord); + + for (int i = _noRounds; i >= 1; i--) + { + B = RotateRight(B - _S[2*i+1], A) ^ A; + A = RotateRight(A - _S[2*i], B) ^ B; + } + + WordToBytes(A - _S[0], outBytes, outOff); + WordToBytes(B - _S[1], outBytes, outOff + bytesPerWord); + + return 2 * bytesPerWord; + } + + + ////////////////////////////////////////////////////////////// + // + // PRIVATE Helper Methods + // + ////////////////////////////////////////////////////////////// + + /** + * Perform a left "spin" of the word. The rotation of the given + * word x is rotated left by y bits. + * Only the lg(wordSize) low-order bits of y + * are used to determine the rotation amount. Here it is + * assumed that the wordsize used is a power of 2. + * + * @param x word to rotate + * @param y number of bits to rotate % wordSize + */ + private long RotateLeft(long x, long y) { + return ((long) ( (ulong) (x << (int) (y & (wordSize-1))) | + ((ulong) x >> (int) (wordSize - (y & (wordSize-1))))) + ); + } + + /** + * Perform a right "spin" of the word. The rotation of the given + * word x is rotated left by y bits. + * Only the lg(wordSize) low-order bits of y + * are used to determine the rotation amount. Here it is + * assumed that the wordsize used is a power of 2. + * + * @param x word to rotate + * @param y number of bits to rotate % wordSize + */ + private long RotateRight(long x, long y) { + return ((long) ( ((ulong) x >> (int) (y & (wordSize-1))) | + (ulong) (x << (int) (wordSize - (y & (wordSize-1))))) + ); + } + + private long BytesToWord( + byte[] src, + int srcOff) + { + long word = 0; + + for (int i = bytesPerWord - 1; i >= 0; i--) + { + word = (word << 8) + (src[i + srcOff] & 0xff); + } + + return word; + } + + private void WordToBytes( + long word, + byte[] dst, + int dstOff) + { + for (int i = 0; i < bytesPerWord; i++) + { + dst[i + dstOff] = (byte)word; + word = (long) ((ulong) word >> 8); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC564Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC564Engine.cs.meta new file mode 100644 index 00000000..d106eb92 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC564Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e794bc4a420f67d47924b24a7d3e9fd0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC6Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC6Engine.cs new file mode 100644 index 00000000..e1ca2d70 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC6Engine.cs @@ -0,0 +1,365 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * An RC6 engine. + */ + public class RC6Engine + : IBlockCipher + { + private static readonly int wordSize = 32; + private static readonly int bytesPerWord = wordSize / 8; + + /* + * the number of rounds to perform + */ + private static readonly int _noRounds = 20; + + /* + * the expanded key array of size 2*(rounds + 1) + */ + private int [] _S; + + /* + * our "magic constants" for wordSize 32 + * + * Pw = Odd((e-2) * 2^wordsize) + * Qw = Odd((o-2) * 2^wordsize) + * + * where e is the base of natural logarithms (2.718281828...) + * and o is the golden ratio (1.61803398...) + */ + private static readonly int P32 = unchecked((int) 0xb7e15163); + private static readonly int Q32 = unchecked((int) 0x9e3779b9); + + private static readonly int LGW = 5; // log2(32) + + private bool forEncryption; + + /** + * Create an instance of the RC6 encryption algorithm + * and set some defaults + */ + public RC6Engine() + { +// _S = null; + } + + public virtual string AlgorithmName + { + get { return "RC6"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return 4 * bytesPerWord; + } + + /** + * initialise a RC5-32 cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("invalid parameter passed to RC6 init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + this.forEncryption = forEncryption; + + KeyParameter p = (KeyParameter)parameters; + SetKey(p.GetKey()); + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + int blockSize = GetBlockSize(); + if (_S == null) + throw new InvalidOperationException("RC6 engine not initialised"); + + Check.DataLength(input, inOff, blockSize, "input buffer too short"); + Check.OutputLength(output, outOff, blockSize, "output buffer too short"); + + return (forEncryption) + ? EncryptBlock(input, inOff, output, outOff) + : DecryptBlock(input, inOff, output, outOff); + } + + public virtual void Reset() + { + } + + /** + * Re-key the cipher. + * + * @param inKey the key to be used + */ + private void SetKey( + byte[] key) + { + // + // KEY EXPANSION: + // + // There are 3 phases to the key expansion. + // + // Phase 1: + // Copy the secret key K[0...b-1] into an array L[0..c-1] of + // c = ceil(b/u), where u = wordSize/8 in little-endian order. + // In other words, we fill up L using u consecutive key bytes + // of K. Any unfilled byte positions in L are zeroed. In the + // case that b = c = 0, set c = 1 and L[0] = 0. + // + // compute number of dwords + int c = (key.Length + (bytesPerWord - 1)) / bytesPerWord; + if (c == 0) + { + c = 1; + } + int[] L = new int[(key.Length + bytesPerWord - 1) / bytesPerWord]; + + // load all key bytes into array of key dwords + for (int i = key.Length - 1; i >= 0; i--) + { + L[i / bytesPerWord] = (L[i / bytesPerWord] << 8) + (key[i] & 0xff); + } + + // + // Phase 2: + // Key schedule is placed in a array of 2+2*ROUNDS+2 = 44 dwords. + // Initialize S to a particular fixed pseudo-random bit pattern + // using an arithmetic progression modulo 2^wordsize determined + // by the magic numbers, Pw & Qw. + // + _S = new int[2+2*_noRounds+2]; + + _S[0] = P32; + for (int i=1; i < _S.Length; i++) + { + _S[i] = (_S[i-1] + Q32); + } + + // + // Phase 3: + // Mix in the user's secret key in 3 passes over the arrays S & L. + // The max of the arrays sizes is used as the loop control + // + int iter; + + if (L.Length > _S.Length) + { + iter = 3 * L.Length; + } + else + { + iter = 3 * _S.Length; + } + + int A = 0; + int B = 0; + int ii = 0, jj = 0; + + for (int k = 0; k < iter; k++) + { + A = _S[ii] = RotateLeft(_S[ii] + A + B, 3); + B = L[jj] = RotateLeft( L[jj] + A + B, A+B); + ii = (ii+1) % _S.Length; + jj = (jj+1) % L.Length; + } + } + + private int EncryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + // load A,B,C and D registers from in. + int A = BytesToWord(input, inOff); + int B = BytesToWord(input, inOff + bytesPerWord); + int C = BytesToWord(input, inOff + bytesPerWord*2); + int D = BytesToWord(input, inOff + bytesPerWord*3); + + // Do pseudo-round #0: pre-whitening of B and D + B += _S[0]; + D += _S[1]; + + // perform round #1,#2 ... #ROUNDS of encryption + for (int i = 1; i <= _noRounds; i++) + { + int t = 0,u = 0; + + t = B*(2*B+1); + t = RotateLeft(t,5); + + u = D*(2*D+1); + u = RotateLeft(u,5); + + A ^= t; + A = RotateLeft(A,u); + A += _S[2*i]; + + C ^= u; + C = RotateLeft(C,t); + C += _S[2*i+1]; + + int temp = A; + A = B; + B = C; + C = D; + D = temp; + } + // do pseudo-round #(ROUNDS+1) : post-whitening of A and C + A += _S[2*_noRounds+2]; + C += _S[2*_noRounds+3]; + + // store A, B, C and D registers to out + WordToBytes(A, outBytes, outOff); + WordToBytes(B, outBytes, outOff + bytesPerWord); + WordToBytes(C, outBytes, outOff + bytesPerWord*2); + WordToBytes(D, outBytes, outOff + bytesPerWord*3); + + return 4 * bytesPerWord; + } + + private int DecryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + // load A,B,C and D registers from out. + int A = BytesToWord(input, inOff); + int B = BytesToWord(input, inOff + bytesPerWord); + int C = BytesToWord(input, inOff + bytesPerWord*2); + int D = BytesToWord(input, inOff + bytesPerWord*3); + + // Undo pseudo-round #(ROUNDS+1) : post whitening of A and C + C -= _S[2*_noRounds+3]; + A -= _S[2*_noRounds+2]; + + // Undo round #ROUNDS, .., #2,#1 of encryption + for (int i = _noRounds; i >= 1; i--) + { + int t=0,u = 0; + + int temp = D; + D = C; + C = B; + B = A; + A = temp; + + t = B*(2*B+1); + t = RotateLeft(t, LGW); + + u = D*(2*D+1); + u = RotateLeft(u, LGW); + + C -= _S[2*i+1]; + C = RotateRight(C,t); + C ^= u; + + A -= _S[2*i]; + A = RotateRight(A,u); + A ^= t; + + } + // Undo pseudo-round #0: pre-whitening of B and D + D -= _S[1]; + B -= _S[0]; + + WordToBytes(A, outBytes, outOff); + WordToBytes(B, outBytes, outOff + bytesPerWord); + WordToBytes(C, outBytes, outOff + bytesPerWord*2); + WordToBytes(D, outBytes, outOff + bytesPerWord*3); + + return 4 * bytesPerWord; + } + + + ////////////////////////////////////////////////////////////// + // + // PRIVATE Helper Methods + // + ////////////////////////////////////////////////////////////// + + /** + * Perform a left "spin" of the word. The rotation of the given + * word x is rotated left by y bits. + * Only the lg(wordSize) low-order bits of y + * are used to determine the rotation amount. Here it is + * assumed that the wordsize used is a power of 2. + * + * @param x word to rotate + * @param y number of bits to rotate % wordSize + */ + private int RotateLeft(int x, int y) + { + return ((int)((uint)(x << (y & (wordSize-1))) + | ((uint) x >> (wordSize - (y & (wordSize-1)))))); + } + + /** + * Perform a right "spin" of the word. The rotation of the given + * word x is rotated left by y bits. + * Only the lg(wordSize) low-order bits of y + * are used to determine the rotation amount. Here it is + * assumed that the wordsize used is a power of 2. + * + * @param x word to rotate + * @param y number of bits to rotate % wordSize + */ + private int RotateRight(int x, int y) + { + return ((int)(((uint) x >> (y & (wordSize-1))) + | (uint)(x << (wordSize - (y & (wordSize-1)))))); + } + + private int BytesToWord( + byte[] src, + int srcOff) + { + int word = 0; + + for (int i = bytesPerWord - 1; i >= 0; i--) + { + word = (word << 8) + (src[i + srcOff] & 0xff); + } + + return word; + } + + private void WordToBytes( + int word, + byte[] dst, + int dstOff) + { + for (int i = 0; i < bytesPerWord; i++) + { + dst[i + dstOff] = (byte)word; + word = (int) ((uint) word >> 8); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC6Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC6Engine.cs.meta new file mode 100644 index 00000000..33490c07 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RC6Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b7585edcc7be3146a7550caa7c8678b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3211WrapEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3211WrapEngine.cs new file mode 100644 index 00000000..69bf4e64 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3211WrapEngine.cs @@ -0,0 +1,183 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * an implementation of the RFC 3211 Key Wrap + * Specification. + */ + public class Rfc3211WrapEngine + : IWrapper + { + private CbcBlockCipher engine; + private ParametersWithIV param; + private bool forWrapping; + private SecureRandom rand; + + public Rfc3211WrapEngine( + IBlockCipher engine) + { + this.engine = new CbcBlockCipher(engine); + } + + public virtual void Init( + bool forWrapping, + ICipherParameters param) + { + this.forWrapping = forWrapping; + + if (param is ParametersWithRandom) + { + ParametersWithRandom p = (ParametersWithRandom)param; + + this.rand = p.Random; + this.param = p.Parameters as ParametersWithIV; + } + else + { + if (forWrapping) + { + rand = new SecureRandom(); + } + + this.param = param as ParametersWithIV; + } + + if (null == this.param) + throw new ArgumentException("RFC3211Wrap requires an IV", "param"); + } + + public virtual string AlgorithmName + { + get { return engine.GetUnderlyingCipher().AlgorithmName + "/RFC3211Wrap"; } + } + + public virtual byte[] Wrap( + byte[] inBytes, + int inOff, + int inLen) + { + if (!forWrapping) + throw new InvalidOperationException("not set for wrapping"); + if (inLen > 255 || inLen < 0) + throw new ArgumentException("input must be from 0 to 255 bytes", "inLen"); + + engine.Init(true, param); + + int blockSize = engine.GetBlockSize(); + byte[] cekBlock; + + if (inLen + 4 < blockSize * 2) + { + cekBlock = new byte[blockSize * 2]; + } + else + { + cekBlock = new byte[(inLen + 4) % blockSize == 0 ? inLen + 4 : ((inLen + 4) / blockSize + 1) * blockSize]; + } + + cekBlock[0] = (byte)inLen; + + Array.Copy(inBytes, inOff, cekBlock, 4, inLen); + + rand.NextBytes(cekBlock, inLen + 4, cekBlock.Length - inLen - 4); + + cekBlock[1] = (byte)~cekBlock[4]; + cekBlock[2] = (byte)~cekBlock[4 + 1]; + cekBlock[3] = (byte)~cekBlock[4 + 2]; + + for (int i = 0; i < cekBlock.Length; i += blockSize) + { + engine.ProcessBlock(cekBlock, i, cekBlock, i); + } + + for (int i = 0; i < cekBlock.Length; i += blockSize) + { + engine.ProcessBlock(cekBlock, i, cekBlock, i); + } + + return cekBlock; + } + + public virtual byte[] Unwrap( + byte[] inBytes, + int inOff, + int inLen) + { + if (forWrapping) + { + throw new InvalidOperationException("not set for unwrapping"); + } + + int blockSize = engine.GetBlockSize(); + + if (inLen < 2 * blockSize) + { + throw new InvalidCipherTextException("input too short"); + } + + byte[] cekBlock = new byte[inLen]; + byte[] iv = new byte[blockSize]; + + Array.Copy(inBytes, inOff, cekBlock, 0, inLen); + Array.Copy(inBytes, inOff, iv, 0, iv.Length); + + engine.Init(false, new ParametersWithIV(param.Parameters, iv)); + + for (int i = blockSize; i < cekBlock.Length; i += blockSize) + { + engine.ProcessBlock(cekBlock, i, cekBlock, i); + } + + Array.Copy(cekBlock, cekBlock.Length - iv.Length, iv, 0, iv.Length); + + engine.Init(false, new ParametersWithIV(param.Parameters, iv)); + + engine.ProcessBlock(cekBlock, 0, cekBlock, 0); + + engine.Init(false, param); + + for (int i = 0; i < cekBlock.Length; i += blockSize) + { + engine.ProcessBlock(cekBlock, i, cekBlock, i); + } + + bool invalidLength = (int)cekBlock[0] > (cekBlock.Length - 4); + + byte[] key; + if (invalidLength) + { + key = new byte[cekBlock.Length - 4]; + } + else + { + key = new byte[cekBlock[0]]; + } + + Array.Copy(cekBlock, 4, key, 0, key.Length); + + // Note: Using constant time comparison + int nonEqual = 0; + for (int i = 0; i != 3; i++) + { + byte check = (byte)~cekBlock[1 + i]; + nonEqual |= (check ^ cekBlock[4 + i]); + } + + Array.Clear(cekBlock, 0, cekBlock.Length); + + if (nonEqual != 0 | invalidLength) + throw new InvalidCipherTextException("wrapped key corrupted"); + + return key; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3211WrapEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3211WrapEngine.cs.meta new file mode 100644 index 00000000..c182dc04 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3211WrapEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e6aba8788322b964490eefbb8c3d6208 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3394WrapEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3394WrapEngine.cs new file mode 100644 index 00000000..34a55448 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3394WrapEngine.cs @@ -0,0 +1,182 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// + /// An implementation of the AES Key Wrapper from the NIST Key Wrap + /// Specification as described in RFC 3394. + ///

+ /// For further details see: http://www.ietf.org/rfc/rfc3394.txt + /// and http://csrc.nist.gov/encryption/kms/key-wrap.pdf. + /// + public class Rfc3394WrapEngine + : IWrapper + { + private readonly IBlockCipher engine; + + private KeyParameter param; + private bool forWrapping; + + private byte[] iv = + { + 0xa6, 0xa6, 0xa6, 0xa6, + 0xa6, 0xa6, 0xa6, 0xa6 + }; + + public Rfc3394WrapEngine( + IBlockCipher engine) + { + this.engine = engine; + } + + public virtual void Init( + bool forWrapping, + ICipherParameters parameters) + { + this.forWrapping = forWrapping; + + if (parameters is ParametersWithRandom) + { + parameters = ((ParametersWithRandom) parameters).Parameters; + } + + if (parameters is KeyParameter) + { + this.param = (KeyParameter) parameters; + } + else if (parameters is ParametersWithIV) + { + ParametersWithIV pIV = (ParametersWithIV) parameters; + byte[] iv = pIV.GetIV(); + + if (iv.Length != 8) + throw new ArgumentException("IV length not equal to 8", "parameters"); + + this.iv = iv; + this.param = (KeyParameter) pIV.Parameters; + } + else + { + // TODO Throw an exception for bad parameters? + } + } + + public virtual string AlgorithmName + { + get { return engine.AlgorithmName; } + } + + public virtual byte[] Wrap( + byte[] input, + int inOff, + int inLen) + { + if (!forWrapping) + { + throw new InvalidOperationException("not set for wrapping"); + } + + int n = inLen / 8; + + if ((n * 8) != inLen) + { + throw new DataLengthException("wrap data must be a multiple of 8 bytes"); + } + + byte[] block = new byte[inLen + iv.Length]; + byte[] buf = new byte[8 + iv.Length]; + + Array.Copy(iv, 0, block, 0, iv.Length); + Array.Copy(input, inOff, block, iv.Length, inLen); + + engine.Init(true, param); + + for (int j = 0; j != 6; j++) + { + for (int i = 1; i <= n; i++) + { + Array.Copy(block, 0, buf, 0, iv.Length); + Array.Copy(block, 8 * i, buf, iv.Length, 8); + engine.ProcessBlock(buf, 0, buf, 0); + + int t = n * j + i; + for (int k = 1; t != 0; k++) + { + byte v = (byte)t; + + buf[iv.Length - k] ^= v; + t = (int) ((uint)t >> 8); + } + + Array.Copy(buf, 0, block, 0, 8); + Array.Copy(buf, 8, block, 8 * i, 8); + } + } + + return block; + } + + public virtual byte[] Unwrap( + byte[] input, + int inOff, + int inLen) + { + if (forWrapping) + { + throw new InvalidOperationException("not set for unwrapping"); + } + + int n = inLen / 8; + + if ((n * 8) != inLen) + { + throw new InvalidCipherTextException("unwrap data must be a multiple of 8 bytes"); + } + + byte[] block = new byte[inLen - iv.Length]; + byte[] a = new byte[iv.Length]; + byte[] buf = new byte[8 + iv.Length]; + + Array.Copy(input, inOff, a, 0, iv.Length); + Array.Copy(input, inOff + iv.Length, block, 0, inLen - iv.Length); + + engine.Init(false, param); + + n = n - 1; + + for (int j = 5; j >= 0; j--) + { + for (int i = n; i >= 1; i--) + { + Array.Copy(a, 0, buf, 0, iv.Length); + Array.Copy(block, 8 * (i - 1), buf, iv.Length, 8); + + int t = n * j + i; + for (int k = 1; t != 0; k++) + { + byte v = (byte)t; + + buf[iv.Length - k] ^= v; + t = (int) ((uint)t >> 8); + } + + engine.ProcessBlock(buf, 0, buf, 0); + Array.Copy(buf, 0, a, 0, 8); + Array.Copy(buf, 8, block, 8 * (i - 1), 8); + } + } + + if (!Arrays.ConstantTimeAreEqual(a, iv)) + throw new InvalidCipherTextException("checksum failed"); + + return block; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3394WrapEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3394WrapEngine.cs.meta new file mode 100644 index 00000000..b6a42f0a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RFC3394WrapEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7e321866e73515648bfd4569ca4b8573 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindedEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindedEngine.cs new file mode 100644 index 00000000..db1a0edb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindedEngine.cs @@ -0,0 +1,143 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * this does your basic RSA algorithm with blinding + */ + public class RsaBlindedEngine + : IAsymmetricBlockCipher + { + private readonly IRsa core; + + private RsaKeyParameters key; + private SecureRandom random; + + public RsaBlindedEngine() + : this(new RsaCoreEngine()) + { + } + + public RsaBlindedEngine(IRsa rsa) + { + this.core = rsa; + } + + public virtual string AlgorithmName + { + get { return "RSA"; } + } + + /** + * initialise the RSA engine. + * + * @param forEncryption true if we are encrypting, false otherwise. + * @param param the necessary RSA key parameters. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters param) + { + core.Init(forEncryption, param); + + if (param is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)param; + + key = (RsaKeyParameters)rParam.Parameters; + random = rParam.Random; + } + else + { + key = (RsaKeyParameters)param; + random = new SecureRandom(); + } + } + + /** + * Return the maximum size for an input block to this engine. + * For RSA this is always one byte less than the key size on + * encryption, and the same length as the key size on decryption. + * + * @return maximum size for an input block. + */ + public virtual int GetInputBlockSize() + { + return core.GetInputBlockSize(); + } + + /** + * Return the maximum size for an output block to this engine. + * For RSA this is always one byte less than the key size on + * decryption, and the same length as the key size on encryption. + * + * @return maximum size for an output block. + */ + public virtual int GetOutputBlockSize() + { + return core.GetOutputBlockSize(); + } + + /** + * Process a single block using the basic RSA algorithm. + * + * @param inBuf the input array. + * @param inOff the offset into the input buffer where the data starts. + * @param inLen the length of the data to be processed. + * @return the result of the RSA process. + * @exception DataLengthException the input block is too large. + */ + public virtual byte[] ProcessBlock( + byte[] inBuf, + int inOff, + int inLen) + { + if (key == null) + throw new InvalidOperationException("RSA engine not initialised"); + + BigInteger input = core.ConvertInput(inBuf, inOff, inLen); + + BigInteger result; + if (key is RsaPrivateCrtKeyParameters) + { + RsaPrivateCrtKeyParameters k = (RsaPrivateCrtKeyParameters)key; + BigInteger e = k.PublicExponent; + if (e != null) // can't do blinding without a public exponent + { + BigInteger m = k.Modulus; + BigInteger r = BigIntegers.CreateRandomInRange( + BigInteger.One, m.Subtract(BigInteger.One), random); + + BigInteger blindedInput = r.ModPow(e, m).Multiply(input).Mod(m); + BigInteger blindedResult = core.ProcessBlock(blindedInput); + + BigInteger rInv = r.ModInverse(m); + result = blindedResult.Multiply(rInv).Mod(m); + + // defence against Arjen Lenstra�s CRT attack + if (!input.Equals(result.ModPow(e, m))) + throw new InvalidOperationException("RSA engine faulty decryption/signing detected"); + } + else + { + result = core.ProcessBlock(input); + } + } + else + { + result = core.ProcessBlock(input); + } + + return core.ConvertOutput(result); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindedEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindedEngine.cs.meta new file mode 100644 index 00000000..3c7983a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindedEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 85f59d14d3e55564aa1645a62950ed19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindingEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindingEngine.cs new file mode 100644 index 00000000..80a09682 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindingEngine.cs @@ -0,0 +1,153 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * This does your basic RSA Chaum's blinding and unblinding as outlined in + * "Handbook of Applied Cryptography", page 475. You need to use this if you are + * trying to get another party to generate signatures without them being aware + * of the message they are signing. + */ + public class RsaBlindingEngine + : IAsymmetricBlockCipher + { + private readonly IRsa core; + + private RsaKeyParameters key; + private BigInteger blindingFactor; + + private bool forEncryption; + + public RsaBlindingEngine() + : this(new RsaCoreEngine()) + { + } + + public RsaBlindingEngine(IRsa rsa) + { + this.core = rsa; + } + + public virtual string AlgorithmName + { + get { return "RSA"; } + } + + /** + * Initialise the blinding engine. + * + * @param forEncryption true if we are encrypting (blinding), false otherwise. + * @param param the necessary RSA key parameters. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters param) + { + RsaBlindingParameters p; + + if (param is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)param; + + p = (RsaBlindingParameters)rParam.Parameters; + } + else + { + p = (RsaBlindingParameters)param; + } + + core.Init(forEncryption, p.PublicKey); + + this.forEncryption = forEncryption; + this.key = p.PublicKey; + this.blindingFactor = p.BlindingFactor; + } + + /** + * Return the maximum size for an input block to this engine. + * For RSA this is always one byte less than the key size on + * encryption, and the same length as the key size on decryption. + * + * @return maximum size for an input block. + */ + public virtual int GetInputBlockSize() + { + return core.GetInputBlockSize(); + } + + /** + * Return the maximum size for an output block to this engine. + * For RSA this is always one byte less than the key size on + * decryption, and the same length as the key size on encryption. + * + * @return maximum size for an output block. + */ + public virtual int GetOutputBlockSize() + { + return core.GetOutputBlockSize(); + } + + /** + * Process a single block using the RSA blinding algorithm. + * + * @param in the input array. + * @param inOff the offset into the input buffer where the data starts. + * @param inLen the length of the data to be processed. + * @return the result of the RSA process. + * @throws DataLengthException the input block is too large. + */ + public virtual byte[] ProcessBlock( + byte[] inBuf, + int inOff, + int inLen) + { + BigInteger msg = core.ConvertInput(inBuf, inOff, inLen); + + if (forEncryption) + { + msg = BlindMessage(msg); + } + else + { + msg = UnblindMessage(msg); + } + + return core.ConvertOutput(msg); + } + + /* + * Blind message with the blind factor. + */ + private BigInteger BlindMessage( + BigInteger msg) + { + BigInteger blindMsg = blindingFactor; + blindMsg = msg.Multiply(blindMsg.ModPow(key.Exponent, key.Modulus)); + blindMsg = blindMsg.Mod(key.Modulus); + + return blindMsg; + } + + /* + * Unblind the message blinded with the blind factor. + */ + private BigInteger UnblindMessage( + BigInteger blindedMsg) + { + BigInteger m = key.Modulus; + BigInteger msg = blindedMsg; + BigInteger blindFactorInverse = blindingFactor.ModInverse(m); + msg = msg.Multiply(blindFactorInverse); + msg = msg.Mod(m); + + return msg; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindingEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindingEngine.cs.meta new file mode 100644 index 00000000..316a751c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSABlindingEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a223950200657314d88493a524185ba2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSACoreEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSACoreEngine.cs new file mode 100644 index 00000000..112536b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSACoreEngine.cs @@ -0,0 +1,177 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * this does your basic RSA algorithm. + */ + public class RsaCoreEngine + : IRsa + { + private RsaKeyParameters key; + private bool forEncryption; + private int bitSize; + + private void CheckInitialised() + { + if (key == null) + throw new InvalidOperationException("RSA engine not initialised"); + } + + /** + * initialise the RSA engine. + * + * @param forEncryption true if we are encrypting, false otherwise. + * @param param the necessary RSA key parameters. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (parameters is ParametersWithRandom) + { + parameters = ((ParametersWithRandom) parameters).Parameters; + } + + if (!(parameters is RsaKeyParameters)) + throw new InvalidKeyException("Not an RSA key"); + + this.key = (RsaKeyParameters) parameters; + this.forEncryption = forEncryption; + this.bitSize = key.Modulus.BitLength; + } + + /** + * Return the maximum size for an input block to this engine. + * For RSA this is always one byte less than the key size on + * encryption, and the same length as the key size on decryption. + * + * @return maximum size for an input block. + */ + public virtual int GetInputBlockSize() + { + CheckInitialised(); + + if (forEncryption) + { + return (bitSize - 1) / 8; + } + + return (bitSize + 7) / 8; + } + + /** + * Return the maximum size for an output block to this engine. + * For RSA this is always one byte less than the key size on + * decryption, and the same length as the key size on encryption. + * + * @return maximum size for an output block. + */ + public virtual int GetOutputBlockSize() + { + CheckInitialised(); + + if (forEncryption) + { + return (bitSize + 7) / 8; + } + + return (bitSize - 1) / 8; + } + + public virtual BigInteger ConvertInput( + byte[] inBuf, + int inOff, + int inLen) + { + CheckInitialised(); + + int maxLength = (bitSize + 7) / 8; + + if (inLen > maxLength) + throw new DataLengthException("input too large for RSA cipher."); + + BigInteger input = new BigInteger(1, inBuf, inOff, inLen); + + if (input.CompareTo(key.Modulus) >= 0) + throw new DataLengthException("input too large for RSA cipher."); + + return input; + } + + public virtual byte[] ConvertOutput( + BigInteger result) + { + CheckInitialised(); + + byte[] output = result.ToByteArrayUnsigned(); + + if (forEncryption) + { + int outSize = GetOutputBlockSize(); + + // TODO To avoid this, create version of BigInteger.ToByteArray that + // writes to an existing array + if (output.Length < outSize) // have ended up with less bytes than normal, lengthen + { + byte[] tmp = new byte[outSize]; + output.CopyTo(tmp, tmp.Length - output.Length); + output = tmp; + } + } + + return output; + } + + public virtual BigInteger ProcessBlock( + BigInteger input) + { + CheckInitialised(); + + if (key is RsaPrivateCrtKeyParameters) + { + // + // we have the extra factors, use the Chinese Remainder Theorem - the author + // wishes to express his thanks to Dirk Bonekaemper at rtsffm.com for + // advice regarding the expression of this. + // + RsaPrivateCrtKeyParameters crtKey = (RsaPrivateCrtKeyParameters)key; + + BigInteger p = crtKey.P; + BigInteger q = crtKey.Q; + BigInteger dP = crtKey.DP; + BigInteger dQ = crtKey.DQ; + BigInteger qInv = crtKey.QInv; + + BigInteger mP, mQ, h, m; + + // mP = ((input Mod p) ^ dP)) Mod p + mP = (input.Remainder(p)).ModPow(dP, p); + + // mQ = ((input Mod q) ^ dQ)) Mod q + mQ = (input.Remainder(q)).ModPow(dQ, q); + + // h = qInv * (mP - mQ) Mod p + h = mP.Subtract(mQ); + h = h.Multiply(qInv); + h = h.Mod(p); // Mod (in Java) returns the positive residual + + // m = h * q + mQ + m = h.Multiply(q); + m = m.Add(mQ); + + return m; + } + + return input.ModPow(key.Exponent, key.Modulus); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSACoreEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSACoreEngine.cs.meta new file mode 100644 index 00000000..94af5eb8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RSACoreEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5746cae08e3e594fb68d786851c04ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RijndaelEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RijndaelEngine.cs new file mode 100644 index 00000000..6153bc60 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RijndaelEngine.cs @@ -0,0 +1,745 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if UNITY_WSA && !UNITY_EDITOR && !ENABLE_IL2CPP +using System.TypeFix; +#endif +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * an implementation of Rijndael, based on the documentation and reference implementation + * by Paulo Barreto, Vincent Rijmen, for v2.0 August '99. + *

+ * Note: this implementation is based on information prior to readonly NIST publication. + *

+ */ + public class RijndaelEngine + : IBlockCipher + { + private static readonly int MAXROUNDS = 14; + + private static readonly int MAXKC = (256/4); + + private static readonly byte[] Logtable = + { + 0, 0, 25, 1, 50, 2, 26, 198, + 75, 199, 27, 104, 51, 238, 223, 3, + 100, 4, 224, 14, 52, 141, 129, 239, + 76, 113, 8, 200, 248, 105, 28, 193, + 125, 194, 29, 181, 249, 185, 39, 106, + 77, 228, 166, 114, 154, 201, 9, 120, + 101, 47, 138, 5, 33, 15, 225, 36, + 18, 240, 130, 69, 53, 147, 218, 142, + 150, 143, 219, 189, 54, 208, 206, 148, + 19, 92, 210, 241, 64, 70, 131, 56, + 102, 221, 253, 48, 191, 6, 139, 98, + 179, 37, 226, 152, 34, 136, 145, 16, + 126, 110, 72, 195, 163, 182, 30, 66, + 58, 107, 40, 84, 250, 133, 61, 186, + 43, 121, 10, 21, 155, 159, 94, 202, + 78, 212, 172, 229, 243, 115, 167, 87, + 175, 88, 168, 80, 244, 234, 214, 116, + 79, 174, 233, 213, 231, 230, 173, 232, + 44, 215, 117, 122, 235, 22, 11, 245, + 89, 203, 95, 176, 156, 169, 81, 160, + 127, 12, 246, 111, 23, 196, 73, 236, + 216, 67, 31, 45, 164, 118, 123, 183, + 204, 187, 62, 90, 251, 96, 177, 134, + 59, 82, 161, 108, 170, 85, 41, 157, + 151, 178, 135, 144, 97, 190, 220, 252, + 188, 149, 207, 205, 55, 63, 91, 209, + 83, 57, 132, 60, 65, 162, 109, 71, + 20, 42, 158, 93, 86, 242, 211, 171, + 68, 17, 146, 217, 35, 32, 46, 137, + 180, 124, 184, 38, 119, 153, 227, 165, + 103, 74, 237, 222, 197, 49, 254, 24, + 13, 99, 140, 128, 192, 247, 112, 7 + }; + + private static readonly byte[] Alogtable = + { + 0, 3, 5, 15, 17, 51, 85, 255, 26, 46, 114, 150, 161, 248, 19, 53, + 95, 225, 56, 72, 216, 115, 149, 164, 247, 2, 6, 10, 30, 34, 102, 170, + 229, 52, 92, 228, 55, 89, 235, 38, 106, 190, 217, 112, 144, 171, 230, 49, + 83, 245, 4, 12, 20, 60, 68, 204, 79, 209, 104, 184, 211, 110, 178, 205, + 76, 212, 103, 169, 224, 59, 77, 215, 98, 166, 241, 8, 24, 40, 120, 136, + 131, 158, 185, 208, 107, 189, 220, 127, 129, 152, 179, 206, 73, 219, 118, 154, + 181, 196, 87, 249, 16, 48, 80, 240, 11, 29, 39, 105, 187, 214, 97, 163, + 254, 25, 43, 125, 135, 146, 173, 236, 47, 113, 147, 174, 233, 32, 96, 160, + 251, 22, 58, 78, 210, 109, 183, 194, 93, 231, 50, 86, 250, 21, 63, 65, + 195, 94, 226, 61, 71, 201, 64, 192, 91, 237, 44, 116, 156, 191, 218, 117, + 159, 186, 213, 100, 172, 239, 42, 126, 130, 157, 188, 223, 122, 142, 137, 128, + 155, 182, 193, 88, 232, 35, 101, 175, 234, 37, 111, 177, 200, 67, 197, 84, + 252, 31, 33, 99, 165, 244, 7, 9, 27, 45, 119, 153, 176, 203, 70, 202, + 69, 207, 74, 222, 121, 139, 134, 145, 168, 227, 62, 66, 198, 81, 243, 14, + 18, 54, 90, 238, 41, 123, 141, 140, 143, 138, 133, 148, 167, 242, 13, 23, + 57, 75, 221, 124, 132, 151, 162, 253, 28, 36, 108, 180, 199, 82, 246, 1, + 3, 5, 15, 17, 51, 85, 255, 26, 46, 114, 150, 161, 248, 19, 53, + 95, 225, 56, 72, 216, 115, 149, 164, 247, 2, 6, 10, 30, 34, 102, 170, + 229, 52, 92, 228, 55, 89, 235, 38, 106, 190, 217, 112, 144, 171, 230, 49, + 83, 245, 4, 12, 20, 60, 68, 204, 79, 209, 104, 184, 211, 110, 178, 205, + 76, 212, 103, 169, 224, 59, 77, 215, 98, 166, 241, 8, 24, 40, 120, 136, + 131, 158, 185, 208, 107, 189, 220, 127, 129, 152, 179, 206, 73, 219, 118, 154, + 181, 196, 87, 249, 16, 48, 80, 240, 11, 29, 39, 105, 187, 214, 97, 163, + 254, 25, 43, 125, 135, 146, 173, 236, 47, 113, 147, 174, 233, 32, 96, 160, + 251, 22, 58, 78, 210, 109, 183, 194, 93, 231, 50, 86, 250, 21, 63, 65, + 195, 94, 226, 61, 71, 201, 64, 192, 91, 237, 44, 116, 156, 191, 218, 117, + 159, 186, 213, 100, 172, 239, 42, 126, 130, 157, 188, 223, 122, 142, 137, 128, + 155, 182, 193, 88, 232, 35, 101, 175, 234, 37, 111, 177, 200, 67, 197, 84, + 252, 31, 33, 99, 165, 244, 7, 9, 27, 45, 119, 153, 176, 203, 70, 202, + 69, 207, 74, 222, 121, 139, 134, 145, 168, 227, 62, 66, 198, 81, 243, 14, + 18, 54, 90, 238, 41, 123, 141, 140, 143, 138, 133, 148, 167, 242, 13, 23, + 57, 75, 221, 124, 132, 151, 162, 253, 28, 36, 108, 180, 199, 82, 246, 1, + }; + + private static readonly byte[] S = + { + 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, + 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, + 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, + 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, + 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, + 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, + 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, + 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, + 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, + 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, + 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, + 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, + 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, + 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, + 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, + 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22, + }; + + private static readonly byte[] Si = + { + 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, + 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, + 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, + 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, + 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, + 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, + 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, + 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, + 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, + 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, + 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, + 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, + 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, + 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, + 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, + 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125, + }; + + private static readonly byte[] rcon = + { + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, + 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 + }; + + static readonly byte[][] shifts0 = new byte [][] + { + new byte[]{ 0, 8, 16, 24 }, + new byte[]{ 0, 8, 16, 24 }, + new byte[]{ 0, 8, 16, 24 }, + new byte[]{ 0, 8, 16, 32 }, + new byte[]{ 0, 8, 24, 32 } + }; + + static readonly byte[][] shifts1 = + { + new byte[]{ 0, 24, 16, 8 }, + new byte[]{ 0, 32, 24, 16 }, + new byte[]{ 0, 40, 32, 24 }, + new byte[]{ 0, 48, 40, 24 }, + new byte[]{ 0, 56, 40, 32 } + }; + + /** + * multiply two elements of GF(2^m) + * needed for MixColumn and InvMixColumn + */ + private byte Mul0x2( + int b) + { + if (b != 0) + { + return Alogtable[25 + (Logtable[b] & 0xff)]; + } + else + { + return 0; + } + } + + private byte Mul0x3( + int b) + { + if (b != 0) + { + return Alogtable[1 + (Logtable[b] & 0xff)]; + } + else + { + return 0; + } + } + + private byte Mul0x9( + int b) + { + if (b >= 0) + { + return Alogtable[199 + b]; + } + else + { + return 0; + } + } + + private byte Mul0xb( + int b) + { + if (b >= 0) + { + return Alogtable[104 + b]; + } + else + { + return 0; + } + } + + private byte Mul0xd( + int b) + { + if (b >= 0) + { + return Alogtable[238 + b]; + } + else + { + return 0; + } + } + + private byte Mul0xe( + int b) + { + if (b >= 0) + { + return Alogtable[223 + b]; + } + else + { + return 0; + } + } + + /** + * xor corresponding text input and round key input bytes + */ + private void KeyAddition( + long[] rk) + { + A0 ^= rk[0]; + A1 ^= rk[1]; + A2 ^= rk[2]; + A3 ^= rk[3]; + } + + private long Shift( + long r, + int shift) + { + //return (((long)((ulong) r >> shift) | (r << (BC - shift)))) & BC_MASK; + + ulong temp = (ulong) r >> shift; + + // NB: This corrects for Mono Bug #79087 (fixed in 1.1.17) + if (shift > 31) + { + temp &= 0xFFFFFFFFUL; + } + + return ((long) temp | (r << (BC - shift))) & BC_MASK; + } + + /** + * Row 0 remains unchanged + * The other three rows are shifted a variable amount + */ + private void ShiftRow( + byte[] shiftsSC) + { + A1 = Shift(A1, shiftsSC[1]); + A2 = Shift(A2, shiftsSC[2]); + A3 = Shift(A3, shiftsSC[3]); + } + + private long ApplyS( + long r, + byte[] box) + { + long res = 0; + + for (int j = 0; j < BC; j += 8) + { + res |= (long)(box[(int)((r >> j) & 0xff)] & 0xff) << j; + } + + return res; + } + + /** + * Replace every byte of the input by the byte at that place + * in the nonlinear S-box + */ + private void Substitution( + byte[] box) + { + A0 = ApplyS(A0, box); + A1 = ApplyS(A1, box); + A2 = ApplyS(A2, box); + A3 = ApplyS(A3, box); + } + + /** + * Mix the bytes of every column in a linear way + */ + private void MixColumn() + { + long r0, r1, r2, r3; + + r0 = r1 = r2 = r3 = 0; + + for (int j = 0; j < BC; j += 8) + { + int a0 = (int)((A0 >> j) & 0xff); + int a1 = (int)((A1 >> j) & 0xff); + int a2 = (int)((A2 >> j) & 0xff); + int a3 = (int)((A3 >> j) & 0xff); + + r0 |= (long)((Mul0x2(a0) ^ Mul0x3(a1) ^ a2 ^ a3) & 0xff) << j; + + r1 |= (long)((Mul0x2(a1) ^ Mul0x3(a2) ^ a3 ^ a0) & 0xff) << j; + + r2 |= (long)((Mul0x2(a2) ^ Mul0x3(a3) ^ a0 ^ a1) & 0xff) << j; + + r3 |= (long)((Mul0x2(a3) ^ Mul0x3(a0) ^ a1 ^ a2) & 0xff) << j; + } + + A0 = r0; + A1 = r1; + A2 = r2; + A3 = r3; + } + + /** + * Mix the bytes of every column in a linear way + * This is the opposite operation of Mixcolumn + */ + private void InvMixColumn() + { + long r0, r1, r2, r3; + + r0 = r1 = r2 = r3 = 0; + for (int j = 0; j < BC; j += 8) + { + int a0 = (int)((A0 >> j) & 0xff); + int a1 = (int)((A1 >> j) & 0xff); + int a2 = (int)((A2 >> j) & 0xff); + int a3 = (int)((A3 >> j) & 0xff); + + // + // pre-lookup the log table + // + a0 = (a0 != 0) ? (Logtable[a0 & 0xff] & 0xff) : -1; + a1 = (a1 != 0) ? (Logtable[a1 & 0xff] & 0xff) : -1; + a2 = (a2 != 0) ? (Logtable[a2 & 0xff] & 0xff) : -1; + a3 = (a3 != 0) ? (Logtable[a3 & 0xff] & 0xff) : -1; + + r0 |= (long)((Mul0xe(a0) ^ Mul0xb(a1) ^ Mul0xd(a2) ^ Mul0x9(a3)) & 0xff) << j; + + r1 |= (long)((Mul0xe(a1) ^ Mul0xb(a2) ^ Mul0xd(a3) ^ Mul0x9(a0)) & 0xff) << j; + + r2 |= (long)((Mul0xe(a2) ^ Mul0xb(a3) ^ Mul0xd(a0) ^ Mul0x9(a1)) & 0xff) << j; + + r3 |= (long)((Mul0xe(a3) ^ Mul0xb(a0) ^ Mul0xd(a1) ^ Mul0x9(a2)) & 0xff) << j; + } + + A0 = r0; + A1 = r1; + A2 = r2; + A3 = r3; + } + + /** + * Calculate the necessary round keys + * The number of calculations depends on keyBits and blockBits + */ + private long[][] GenerateWorkingKey( + byte[] key) + { + int KC; + int t, rconpointer = 0; + int keyBits = key.Length * 8; + byte[,] tk = new byte[4,MAXKC]; + //long[,] W = new long[MAXROUNDS+1,4]; + long[][] W = new long[MAXROUNDS+1][]; + + for (int i = 0; i < MAXROUNDS+1; i++) W[i] = new long[4]; + + switch (keyBits) + { + case 128: + KC = 4; + break; + case 160: + KC = 5; + break; + case 192: + KC = 6; + break; + case 224: + KC = 7; + break; + case 256: + KC = 8; + break; + default : + throw new ArgumentException("Key length not 128/160/192/224/256 bits."); + } + + if (keyBits >= blockBits) + { + ROUNDS = KC + 6; + } + else + { + ROUNDS = (BC / 8) + 6; + } + + // + // copy the key into the processing area + // + int index = 0; + + for (int i = 0; i < key.Length; i++) + { + tk[i % 4,i / 4] = key[index++]; + } + + t = 0; + + // + // copy values into round key array + // + for (int j = 0; (j < KC) && (t < (ROUNDS+1)*(BC / 8)); j++, t++) + { + for (int i = 0; i < 4; i++) + { + W[t / (BC / 8)][i] |= (long)(tk[i,j] & 0xff) << ((t * 8) % BC); + } + } + + // + // while not enough round key material calculated + // calculate new values + // + while (t < (ROUNDS+1)*(BC/8)) + { + for (int i = 0; i < 4; i++) + { + tk[i,0] ^= S[tk[(i+1)%4,KC-1] & 0xff]; + } + tk[0,0] ^= (byte) rcon[rconpointer++]; + + if (KC <= 6) + { + for (int j = 1; j < KC; j++) + { + for (int i = 0; i < 4; i++) + { + tk[i,j] ^= tk[i,j-1]; + } + } + } + else + { + for (int j = 1; j < 4; j++) + { + for (int i = 0; i < 4; i++) + { + tk[i,j] ^= tk[i,j-1]; + } + } + for (int i = 0; i < 4; i++) + { + tk[i,4] ^= S[tk[i,3] & 0xff]; + } + for (int j = 5; j < KC; j++) + { + for (int i = 0; i < 4; i++) + { + tk[i,j] ^= tk[i,j-1]; + } + } + } + + // + // copy values into round key array + // + for (int j = 0; (j < KC) && (t < (ROUNDS+1)*(BC/8)); j++, t++) + { + for (int i = 0; i < 4; i++) + { + W[t / (BC/8)][i] |= (long)(tk[i,j] & 0xff) << ((t * 8) % (BC)); + } + } + } + return W; + } + + private int BC; + private long BC_MASK; + private int ROUNDS; + private int blockBits; + private long[][] workingKey; + private long A0, A1, A2, A3; + private bool forEncryption; + private byte[] shifts0SC; + private byte[] shifts1SC; + + /** + * default constructor - 128 bit block size. + */ + public RijndaelEngine() : this(128) {} + + /** + * basic constructor - set the cipher up for a given blocksize + * + * @param blocksize the blocksize in bits, must be 128, 192, or 256. + */ + public RijndaelEngine( + int blockBits) + { + switch (blockBits) + { + case 128: + BC = 32; + BC_MASK = 0xffffffffL; + shifts0SC = shifts0[0]; + shifts1SC = shifts1[0]; + break; + case 160: + BC = 40; + BC_MASK = 0xffffffffffL; + shifts0SC = shifts0[1]; + shifts1SC = shifts1[1]; + break; + case 192: + BC = 48; + BC_MASK = 0xffffffffffffL; + shifts0SC = shifts0[2]; + shifts1SC = shifts1[2]; + break; + case 224: + BC = 56; + BC_MASK = 0xffffffffffffffL; + shifts0SC = shifts0[3]; + shifts1SC = shifts1[3]; + break; + case 256: + BC = 64; + BC_MASK = unchecked( (long)0xffffffffffffffffL); + shifts0SC = shifts0[4]; + shifts1SC = shifts1[4]; + break; + default: + throw new ArgumentException("unknown blocksize to Rijndael"); + } + + this.blockBits = blockBits; + } + + /** + * initialise a Rijndael cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (typeof(KeyParameter).IsInstanceOfType(parameters)) + { + workingKey = GenerateWorkingKey(((KeyParameter)parameters).GetKey()); + this.forEncryption = forEncryption; + return; + } + + throw new ArgumentException("invalid parameter passed to Rijndael init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + + public virtual string AlgorithmName + { + get { return "Rijndael"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BC / 2; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (workingKey == null) + throw new InvalidOperationException("Rijndael engine not initialised"); + + Check.DataLength(input, inOff, (BC / 2), "input buffer too short"); + Check.OutputLength(output, outOff, (BC / 2), "output buffer too short"); + + UnPackBlock(input, inOff); + + if (forEncryption) + { + EncryptBlock(workingKey); + } + else + { + DecryptBlock(workingKey); + } + + PackBlock(output, outOff); + + return BC / 2; + } + + public virtual void Reset() + { + } + + private void UnPackBlock( + byte[] bytes, + int off) + { + int index = off; + + A0 = (long)(bytes[index++] & 0xff); + A1 = (long)(bytes[index++] & 0xff); + A2 = (long)(bytes[index++] & 0xff); + A3 = (long)(bytes[index++] & 0xff); + + for (int j = 8; j != BC; j += 8) + { + A0 |= (long)(bytes[index++] & 0xff) << j; + A1 |= (long)(bytes[index++] & 0xff) << j; + A2 |= (long)(bytes[index++] & 0xff) << j; + A3 |= (long)(bytes[index++] & 0xff) << j; + } + } + + private void PackBlock( + byte[] bytes, + int off) + { + int index = off; + + for (int j = 0; j != BC; j += 8) + { + bytes[index++] = (byte)(A0 >> j); + bytes[index++] = (byte)(A1 >> j); + bytes[index++] = (byte)(A2 >> j); + bytes[index++] = (byte)(A3 >> j); + } + } + + private void EncryptBlock( + long[][] rk) + { + int r; + + // + // begin with a key addition + // + KeyAddition(rk[0]); + + // + // ROUNDS-1 ordinary rounds + // + for (r = 1; r < ROUNDS; r++) + { + Substitution(S); + ShiftRow(shifts0SC); + MixColumn(); + KeyAddition(rk[r]); + } + + // + // Last round is special: there is no MixColumn + // + Substitution(S); + ShiftRow(shifts0SC); + KeyAddition(rk[ROUNDS]); + } + + private void DecryptBlock( + long[][] rk) + { + int r; + + // To decrypt: apply the inverse operations of the encrypt routine, + // in opposite order + // + // (KeyAddition is an involution: it 's equal to its inverse) + // (the inverse of Substitution with table S is Substitution with the inverse table of S) + // (the inverse of Shiftrow is Shiftrow over a suitable distance) + // + + // First the special round: + // without InvMixColumn + // with extra KeyAddition + // + KeyAddition(rk[ROUNDS]); + Substitution(Si); + ShiftRow(shifts1SC); + + // + // ROUNDS-1 ordinary rounds + // + for (r = ROUNDS-1; r > 0; r--) + { + KeyAddition(rk[r]); + InvMixColumn(); + Substitution(Si); + ShiftRow(shifts1SC); + } + + // + // End with the extra key addition + // + KeyAddition(rk[0]); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RijndaelEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RijndaelEngine.cs.meta new file mode 100644 index 00000000..671fa6fe --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RijndaelEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a49117f9f15a0794da51511f5e07a5df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RsaEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RsaEngine.cs new file mode 100644 index 00000000..fcfd221a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RsaEngine.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * this does your basic RSA algorithm. + */ + public class RsaEngine + : IAsymmetricBlockCipher + { + private readonly IRsa core; + + public RsaEngine() + : this(new RsaCoreEngine()) + { + } + + public RsaEngine(IRsa rsa) + { + this.core = rsa; + } + + public virtual string AlgorithmName + { + get { return "RSA"; } + } + + /** + * initialise the RSA engine. + * + * @param forEncryption true if we are encrypting, false otherwise. + * @param param the necessary RSA key parameters. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + core.Init(forEncryption, parameters); + } + + /** + * Return the maximum size for an input block to this engine. + * For RSA this is always one byte less than the key size on + * encryption, and the same length as the key size on decryption. + * + * @return maximum size for an input block. + */ + public virtual int GetInputBlockSize() + { + return core.GetInputBlockSize(); + } + + /** + * Return the maximum size for an output block to this engine. + * For RSA this is always one byte less than the key size on + * decryption, and the same length as the key size on encryption. + * + * @return maximum size for an output block. + */ + public virtual int GetOutputBlockSize() + { + return core.GetOutputBlockSize(); + } + + /** + * Process a single block using the basic RSA algorithm. + * + * @param inBuf the input array. + * @param inOff the offset into the input buffer where the data starts. + * @param inLen the length of the data to be processed. + * @return the result of the RSA process. + * @exception DataLengthException the input block is too large. + */ + public virtual byte[] ProcessBlock( + byte[] inBuf, + int inOff, + int inLen) + { + BigInteger input = core.ConvertInput(inBuf, inOff, inLen); + BigInteger output = core.ProcessBlock(input); + return core.ConvertOutput(output); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RsaEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RsaEngine.cs.meta new file mode 100644 index 00000000..161b70fd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/RsaEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bce75b4767f99964da73d7bd7ba91701 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDEngine.cs new file mode 100644 index 00000000..66a39211 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDEngine.cs @@ -0,0 +1,364 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * Implementation of the SEED algorithm as described in RFC 4009 + */ + public class SeedEngine + : IBlockCipher + { + private const int BlockSize = 16; + + private static readonly uint[] SS0 = + { + 0x2989a1a8, 0x05858184, 0x16c6d2d4, 0x13c3d3d0, 0x14445054, 0x1d0d111c, 0x2c8ca0ac, 0x25052124, + 0x1d4d515c, 0x03434340, 0x18081018, 0x1e0e121c, 0x11415150, 0x3cccf0fc, 0x0acac2c8, 0x23436360, + 0x28082028, 0x04444044, 0x20002020, 0x1d8d919c, 0x20c0e0e0, 0x22c2e2e0, 0x08c8c0c8, 0x17071314, + 0x2585a1a4, 0x0f8f838c, 0x03030300, 0x3b4b7378, 0x3b8bb3b8, 0x13031310, 0x12c2d2d0, 0x2ecee2ec, + 0x30407070, 0x0c8c808c, 0x3f0f333c, 0x2888a0a8, 0x32023230, 0x1dcdd1dc, 0x36c6f2f4, 0x34447074, + 0x2ccce0ec, 0x15859194, 0x0b0b0308, 0x17475354, 0x1c4c505c, 0x1b4b5358, 0x3d8db1bc, 0x01010100, + 0x24042024, 0x1c0c101c, 0x33437370, 0x18889098, 0x10001010, 0x0cccc0cc, 0x32c2f2f0, 0x19c9d1d8, + 0x2c0c202c, 0x27c7e3e4, 0x32427270, 0x03838380, 0x1b8b9398, 0x11c1d1d0, 0x06868284, 0x09c9c1c8, + 0x20406060, 0x10405050, 0x2383a3a0, 0x2bcbe3e8, 0x0d0d010c, 0x3686b2b4, 0x1e8e929c, 0x0f4f434c, + 0x3787b3b4, 0x1a4a5258, 0x06c6c2c4, 0x38487078, 0x2686a2a4, 0x12021210, 0x2f8fa3ac, 0x15c5d1d4, + 0x21416160, 0x03c3c3c0, 0x3484b0b4, 0x01414140, 0x12425250, 0x3d4d717c, 0x0d8d818c, 0x08080008, + 0x1f0f131c, 0x19899198, 0x00000000, 0x19091118, 0x04040004, 0x13435350, 0x37c7f3f4, 0x21c1e1e0, + 0x3dcdf1fc, 0x36467274, 0x2f0f232c, 0x27072324, 0x3080b0b0, 0x0b8b8388, 0x0e0e020c, 0x2b8ba3a8, + 0x2282a2a0, 0x2e4e626c, 0x13839390, 0x0d4d414c, 0x29496168, 0x3c4c707c, 0x09090108, 0x0a0a0208, + 0x3f8fb3bc, 0x2fcfe3ec, 0x33c3f3f0, 0x05c5c1c4, 0x07878384, 0x14041014, 0x3ecef2fc, 0x24446064, + 0x1eced2dc, 0x2e0e222c, 0x0b4b4348, 0x1a0a1218, 0x06060204, 0x21012120, 0x2b4b6368, 0x26466264, + 0x02020200, 0x35c5f1f4, 0x12829290, 0x0a8a8288, 0x0c0c000c, 0x3383b3b0, 0x3e4e727c, 0x10c0d0d0, + 0x3a4a7278, 0x07474344, 0x16869294, 0x25c5e1e4, 0x26062224, 0x00808080, 0x2d8da1ac, 0x1fcfd3dc, + 0x2181a1a0, 0x30003030, 0x37073334, 0x2e8ea2ac, 0x36063234, 0x15051114, 0x22022220, 0x38083038, + 0x34c4f0f4, 0x2787a3a4, 0x05454144, 0x0c4c404c, 0x01818180, 0x29c9e1e8, 0x04848084, 0x17879394, + 0x35053134, 0x0bcbc3c8, 0x0ecec2cc, 0x3c0c303c, 0x31417170, 0x11011110, 0x07c7c3c4, 0x09898188, + 0x35457174, 0x3bcbf3f8, 0x1acad2d8, 0x38c8f0f8, 0x14849094, 0x19495158, 0x02828280, 0x04c4c0c4, + 0x3fcff3fc, 0x09494148, 0x39093138, 0x27476364, 0x00c0c0c0, 0x0fcfc3cc, 0x17c7d3d4, 0x3888b0b8, + 0x0f0f030c, 0x0e8e828c, 0x02424240, 0x23032320, 0x11819190, 0x2c4c606c, 0x1bcbd3d8, 0x2484a0a4, + 0x34043034, 0x31c1f1f0, 0x08484048, 0x02c2c2c0, 0x2f4f636c, 0x3d0d313c, 0x2d0d212c, 0x00404040, + 0x3e8eb2bc, 0x3e0e323c, 0x3c8cb0bc, 0x01c1c1c0, 0x2a8aa2a8, 0x3a8ab2b8, 0x0e4e424c, 0x15455154, + 0x3b0b3338, 0x1cccd0dc, 0x28486068, 0x3f4f737c, 0x1c8c909c, 0x18c8d0d8, 0x0a4a4248, 0x16465254, + 0x37477374, 0x2080a0a0, 0x2dcde1ec, 0x06464244, 0x3585b1b4, 0x2b0b2328, 0x25456164, 0x3acaf2f8, + 0x23c3e3e0, 0x3989b1b8, 0x3181b1b0, 0x1f8f939c, 0x1e4e525c, 0x39c9f1f8, 0x26c6e2e4, 0x3282b2b0, + 0x31013130, 0x2acae2e8, 0x2d4d616c, 0x1f4f535c, 0x24c4e0e4, 0x30c0f0f0, 0x0dcdc1cc, 0x08888088, + 0x16061214, 0x3a0a3238, 0x18485058, 0x14c4d0d4, 0x22426260, 0x29092128, 0x07070304, 0x33033330, + 0x28c8e0e8, 0x1b0b1318, 0x05050104, 0x39497178, 0x10809090, 0x2a4a6268, 0x2a0a2228, 0x1a8a9298 + }; + + private static readonly uint[] SS1 = + { + 0x38380830, 0xe828c8e0, 0x2c2d0d21, 0xa42686a2, 0xcc0fcfc3, 0xdc1eced2, 0xb03383b3, 0xb83888b0, + 0xac2f8fa3, 0x60204060, 0x54154551, 0xc407c7c3, 0x44044440, 0x6c2f4f63, 0x682b4b63, 0x581b4b53, + 0xc003c3c3, 0x60224262, 0x30330333, 0xb43585b1, 0x28290921, 0xa02080a0, 0xe022c2e2, 0xa42787a3, + 0xd013c3d3, 0x90118191, 0x10110111, 0x04060602, 0x1c1c0c10, 0xbc3c8cb0, 0x34360632, 0x480b4b43, + 0xec2fcfe3, 0x88088880, 0x6c2c4c60, 0xa82888a0, 0x14170713, 0xc404c4c0, 0x14160612, 0xf434c4f0, + 0xc002c2c2, 0x44054541, 0xe021c1e1, 0xd416c6d2, 0x3c3f0f33, 0x3c3d0d31, 0x8c0e8e82, 0x98188890, + 0x28280820, 0x4c0e4e42, 0xf436c6f2, 0x3c3e0e32, 0xa42585a1, 0xf839c9f1, 0x0c0d0d01, 0xdc1fcfd3, + 0xd818c8d0, 0x282b0b23, 0x64264662, 0x783a4a72, 0x24270723, 0x2c2f0f23, 0xf031c1f1, 0x70324272, + 0x40024242, 0xd414c4d0, 0x40014141, 0xc000c0c0, 0x70334373, 0x64274763, 0xac2c8ca0, 0x880b8b83, + 0xf437c7f3, 0xac2d8da1, 0x80008080, 0x1c1f0f13, 0xc80acac2, 0x2c2c0c20, 0xa82a8aa2, 0x34340430, + 0xd012c2d2, 0x080b0b03, 0xec2ecee2, 0xe829c9e1, 0x5c1d4d51, 0x94148490, 0x18180810, 0xf838c8f0, + 0x54174753, 0xac2e8ea2, 0x08080800, 0xc405c5c1, 0x10130313, 0xcc0dcdc1, 0x84068682, 0xb83989b1, + 0xfc3fcff3, 0x7c3d4d71, 0xc001c1c1, 0x30310131, 0xf435c5f1, 0x880a8a82, 0x682a4a62, 0xb03181b1, + 0xd011c1d1, 0x20200020, 0xd417c7d3, 0x00020202, 0x20220222, 0x04040400, 0x68284860, 0x70314171, + 0x04070703, 0xd81bcbd3, 0x9c1d8d91, 0x98198991, 0x60214161, 0xbc3e8eb2, 0xe426c6e2, 0x58194951, + 0xdc1dcdd1, 0x50114151, 0x90108090, 0xdc1cccd0, 0x981a8a92, 0xa02383a3, 0xa82b8ba3, 0xd010c0d0, + 0x80018181, 0x0c0f0f03, 0x44074743, 0x181a0a12, 0xe023c3e3, 0xec2ccce0, 0x8c0d8d81, 0xbc3f8fb3, + 0x94168692, 0x783b4b73, 0x5c1c4c50, 0xa02282a2, 0xa02181a1, 0x60234363, 0x20230323, 0x4c0d4d41, + 0xc808c8c0, 0x9c1e8e92, 0x9c1c8c90, 0x383a0a32, 0x0c0c0c00, 0x2c2e0e22, 0xb83a8ab2, 0x6c2e4e62, + 0x9c1f8f93, 0x581a4a52, 0xf032c2f2, 0x90128292, 0xf033c3f3, 0x48094941, 0x78384870, 0xcc0cccc0, + 0x14150511, 0xf83bcbf3, 0x70304070, 0x74354571, 0x7c3f4f73, 0x34350531, 0x10100010, 0x00030303, + 0x64244460, 0x6c2d4d61, 0xc406c6c2, 0x74344470, 0xd415c5d1, 0xb43484b0, 0xe82acae2, 0x08090901, + 0x74364672, 0x18190911, 0xfc3ecef2, 0x40004040, 0x10120212, 0xe020c0e0, 0xbc3d8db1, 0x04050501, + 0xf83acaf2, 0x00010101, 0xf030c0f0, 0x282a0a22, 0x5c1e4e52, 0xa82989a1, 0x54164652, 0x40034343, + 0x84058581, 0x14140410, 0x88098981, 0x981b8b93, 0xb03080b0, 0xe425c5e1, 0x48084840, 0x78394971, + 0x94178793, 0xfc3cccf0, 0x1c1e0e12, 0x80028282, 0x20210121, 0x8c0c8c80, 0x181b0b13, 0x5c1f4f53, + 0x74374773, 0x54144450, 0xb03282b2, 0x1c1d0d11, 0x24250521, 0x4c0f4f43, 0x00000000, 0x44064642, + 0xec2dcde1, 0x58184850, 0x50124252, 0xe82bcbe3, 0x7c3e4e72, 0xd81acad2, 0xc809c9c1, 0xfc3dcdf1, + 0x30300030, 0x94158591, 0x64254561, 0x3c3c0c30, 0xb43686b2, 0xe424c4e0, 0xb83b8bb3, 0x7c3c4c70, + 0x0c0e0e02, 0x50104050, 0x38390931, 0x24260622, 0x30320232, 0x84048480, 0x68294961, 0x90138393, + 0x34370733, 0xe427c7e3, 0x24240420, 0xa42484a0, 0xc80bcbc3, 0x50134353, 0x080a0a02, 0x84078783, + 0xd819c9d1, 0x4c0c4c40, 0x80038383, 0x8c0f8f83, 0xcc0ecec2, 0x383b0b33, 0x480a4a42, 0xb43787b3 + }; + + private static readonly uint[] SS2 = + { + + 0xa1a82989, 0x81840585, 0xd2d416c6, 0xd3d013c3, 0x50541444, 0x111c1d0d, 0xa0ac2c8c, 0x21242505, + 0x515c1d4d, 0x43400343, 0x10181808, 0x121c1e0e, 0x51501141, 0xf0fc3ccc, 0xc2c80aca, 0x63602343, + 0x20282808, 0x40440444, 0x20202000, 0x919c1d8d, 0xe0e020c0, 0xe2e022c2, 0xc0c808c8, 0x13141707, + 0xa1a42585, 0x838c0f8f, 0x03000303, 0x73783b4b, 0xb3b83b8b, 0x13101303, 0xd2d012c2, 0xe2ec2ece, + 0x70703040, 0x808c0c8c, 0x333c3f0f, 0xa0a82888, 0x32303202, 0xd1dc1dcd, 0xf2f436c6, 0x70743444, + 0xe0ec2ccc, 0x91941585, 0x03080b0b, 0x53541747, 0x505c1c4c, 0x53581b4b, 0xb1bc3d8d, 0x01000101, + 0x20242404, 0x101c1c0c, 0x73703343, 0x90981888, 0x10101000, 0xc0cc0ccc, 0xf2f032c2, 0xd1d819c9, + 0x202c2c0c, 0xe3e427c7, 0x72703242, 0x83800383, 0x93981b8b, 0xd1d011c1, 0x82840686, 0xc1c809c9, + 0x60602040, 0x50501040, 0xa3a02383, 0xe3e82bcb, 0x010c0d0d, 0xb2b43686, 0x929c1e8e, 0x434c0f4f, + 0xb3b43787, 0x52581a4a, 0xc2c406c6, 0x70783848, 0xa2a42686, 0x12101202, 0xa3ac2f8f, 0xd1d415c5, + 0x61602141, 0xc3c003c3, 0xb0b43484, 0x41400141, 0x52501242, 0x717c3d4d, 0x818c0d8d, 0x00080808, + 0x131c1f0f, 0x91981989, 0x00000000, 0x11181909, 0x00040404, 0x53501343, 0xf3f437c7, 0xe1e021c1, + 0xf1fc3dcd, 0x72743646, 0x232c2f0f, 0x23242707, 0xb0b03080, 0x83880b8b, 0x020c0e0e, 0xa3a82b8b, + 0xa2a02282, 0x626c2e4e, 0x93901383, 0x414c0d4d, 0x61682949, 0x707c3c4c, 0x01080909, 0x02080a0a, + 0xb3bc3f8f, 0xe3ec2fcf, 0xf3f033c3, 0xc1c405c5, 0x83840787, 0x10141404, 0xf2fc3ece, 0x60642444, + 0xd2dc1ece, 0x222c2e0e, 0x43480b4b, 0x12181a0a, 0x02040606, 0x21202101, 0x63682b4b, 0x62642646, + 0x02000202, 0xf1f435c5, 0x92901282, 0x82880a8a, 0x000c0c0c, 0xb3b03383, 0x727c3e4e, 0xd0d010c0, + 0x72783a4a, 0x43440747, 0x92941686, 0xe1e425c5, 0x22242606, 0x80800080, 0xa1ac2d8d, 0xd3dc1fcf, + 0xa1a02181, 0x30303000, 0x33343707, 0xa2ac2e8e, 0x32343606, 0x11141505, 0x22202202, 0x30383808, + 0xf0f434c4, 0xa3a42787, 0x41440545, 0x404c0c4c, 0x81800181, 0xe1e829c9, 0x80840484, 0x93941787, + 0x31343505, 0xc3c80bcb, 0xc2cc0ece, 0x303c3c0c, 0x71703141, 0x11101101, 0xc3c407c7, 0x81880989, + 0x71743545, 0xf3f83bcb, 0xd2d81aca, 0xf0f838c8, 0x90941484, 0x51581949, 0x82800282, 0xc0c404c4, + 0xf3fc3fcf, 0x41480949, 0x31383909, 0x63642747, 0xc0c000c0, 0xc3cc0fcf, 0xd3d417c7, 0xb0b83888, + 0x030c0f0f, 0x828c0e8e, 0x42400242, 0x23202303, 0x91901181, 0x606c2c4c, 0xd3d81bcb, 0xa0a42484, + 0x30343404, 0xf1f031c1, 0x40480848, 0xc2c002c2, 0x636c2f4f, 0x313c3d0d, 0x212c2d0d, 0x40400040, + 0xb2bc3e8e, 0x323c3e0e, 0xb0bc3c8c, 0xc1c001c1, 0xa2a82a8a, 0xb2b83a8a, 0x424c0e4e, 0x51541545, + 0x33383b0b, 0xd0dc1ccc, 0x60682848, 0x737c3f4f, 0x909c1c8c, 0xd0d818c8, 0x42480a4a, 0x52541646, + 0x73743747, 0xa0a02080, 0xe1ec2dcd, 0x42440646, 0xb1b43585, 0x23282b0b, 0x61642545, 0xf2f83aca, + 0xe3e023c3, 0xb1b83989, 0xb1b03181, 0x939c1f8f, 0x525c1e4e, 0xf1f839c9, 0xe2e426c6, 0xb2b03282, + 0x31303101, 0xe2e82aca, 0x616c2d4d, 0x535c1f4f, 0xe0e424c4, 0xf0f030c0, 0xc1cc0dcd, 0x80880888, + 0x12141606, 0x32383a0a, 0x50581848, 0xd0d414c4, 0x62602242, 0x21282909, 0x03040707, 0x33303303, + 0xe0e828c8, 0x13181b0b, 0x01040505, 0x71783949, 0x90901080, 0x62682a4a, 0x22282a0a, 0x92981a8a + }; + + private static readonly uint[] SS3 = + { + + 0x08303838, 0xc8e0e828, 0x0d212c2d, 0x86a2a426, 0xcfc3cc0f, 0xced2dc1e, 0x83b3b033, 0x88b0b838, + 0x8fa3ac2f, 0x40606020, 0x45515415, 0xc7c3c407, 0x44404404, 0x4f636c2f, 0x4b63682b, 0x4b53581b, + 0xc3c3c003, 0x42626022, 0x03333033, 0x85b1b435, 0x09212829, 0x80a0a020, 0xc2e2e022, 0x87a3a427, + 0xc3d3d013, 0x81919011, 0x01111011, 0x06020406, 0x0c101c1c, 0x8cb0bc3c, 0x06323436, 0x4b43480b, + 0xcfe3ec2f, 0x88808808, 0x4c606c2c, 0x88a0a828, 0x07131417, 0xc4c0c404, 0x06121416, 0xc4f0f434, + 0xc2c2c002, 0x45414405, 0xc1e1e021, 0xc6d2d416, 0x0f333c3f, 0x0d313c3d, 0x8e828c0e, 0x88909818, + 0x08202828, 0x4e424c0e, 0xc6f2f436, 0x0e323c3e, 0x85a1a425, 0xc9f1f839, 0x0d010c0d, 0xcfd3dc1f, + 0xc8d0d818, 0x0b23282b, 0x46626426, 0x4a72783a, 0x07232427, 0x0f232c2f, 0xc1f1f031, 0x42727032, + 0x42424002, 0xc4d0d414, 0x41414001, 0xc0c0c000, 0x43737033, 0x47636427, 0x8ca0ac2c, 0x8b83880b, + 0xc7f3f437, 0x8da1ac2d, 0x80808000, 0x0f131c1f, 0xcac2c80a, 0x0c202c2c, 0x8aa2a82a, 0x04303434, + 0xc2d2d012, 0x0b03080b, 0xcee2ec2e, 0xc9e1e829, 0x4d515c1d, 0x84909414, 0x08101818, 0xc8f0f838, + 0x47535417, 0x8ea2ac2e, 0x08000808, 0xc5c1c405, 0x03131013, 0xcdc1cc0d, 0x86828406, 0x89b1b839, + 0xcff3fc3f, 0x4d717c3d, 0xc1c1c001, 0x01313031, 0xc5f1f435, 0x8a82880a, 0x4a62682a, 0x81b1b031, + 0xc1d1d011, 0x00202020, 0xc7d3d417, 0x02020002, 0x02222022, 0x04000404, 0x48606828, 0x41717031, + 0x07030407, 0xcbd3d81b, 0x8d919c1d, 0x89919819, 0x41616021, 0x8eb2bc3e, 0xc6e2e426, 0x49515819, + 0xcdd1dc1d, 0x41515011, 0x80909010, 0xccd0dc1c, 0x8a92981a, 0x83a3a023, 0x8ba3a82b, 0xc0d0d010, + 0x81818001, 0x0f030c0f, 0x47434407, 0x0a12181a, 0xc3e3e023, 0xcce0ec2c, 0x8d818c0d, 0x8fb3bc3f, + 0x86929416, 0x4b73783b, 0x4c505c1c, 0x82a2a022, 0x81a1a021, 0x43636023, 0x03232023, 0x4d414c0d, + 0xc8c0c808, 0x8e929c1e, 0x8c909c1c, 0x0a32383a, 0x0c000c0c, 0x0e222c2e, 0x8ab2b83a, 0x4e626c2e, + 0x8f939c1f, 0x4a52581a, 0xc2f2f032, 0x82929012, 0xc3f3f033, 0x49414809, 0x48707838, 0xccc0cc0c, + 0x05111415, 0xcbf3f83b, 0x40707030, 0x45717435, 0x4f737c3f, 0x05313435, 0x00101010, 0x03030003, + 0x44606424, 0x4d616c2d, 0xc6c2c406, 0x44707434, 0xc5d1d415, 0x84b0b434, 0xcae2e82a, 0x09010809, + 0x46727436, 0x09111819, 0xcef2fc3e, 0x40404000, 0x02121012, 0xc0e0e020, 0x8db1bc3d, 0x05010405, + 0xcaf2f83a, 0x01010001, 0xc0f0f030, 0x0a22282a, 0x4e525c1e, 0x89a1a829, 0x46525416, 0x43434003, + 0x85818405, 0x04101414, 0x89818809, 0x8b93981b, 0x80b0b030, 0xc5e1e425, 0x48404808, 0x49717839, + 0x87939417, 0xccf0fc3c, 0x0e121c1e, 0x82828002, 0x01212021, 0x8c808c0c, 0x0b13181b, 0x4f535c1f, + 0x47737437, 0x44505414, 0x82b2b032, 0x0d111c1d, 0x05212425, 0x4f434c0f, 0x00000000, 0x46424406, + 0xcde1ec2d, 0x48505818, 0x42525012, 0xcbe3e82b, 0x4e727c3e, 0xcad2d81a, 0xc9c1c809, 0xcdf1fc3d, + 0x00303030, 0x85919415, 0x45616425, 0x0c303c3c, 0x86b2b436, 0xc4e0e424, 0x8bb3b83b, 0x4c707c3c, + 0x0e020c0e, 0x40505010, 0x09313839, 0x06222426, 0x02323032, 0x84808404, 0x49616829, 0x83939013, + 0x07333437, 0xc7e3e427, 0x04202424, 0x84a0a424, 0xcbc3c80b, 0x43535013, 0x0a02080a, 0x87838407, + 0xc9d1d819, 0x4c404c0c, 0x83838003, 0x8f838c0f, 0xcec2cc0e, 0x0b33383b, 0x4a42480a, 0x87b3b437 + }; + + private static readonly uint[] KC = + { + 0x9e3779b9, 0x3c6ef373, 0x78dde6e6, 0xf1bbcdcc, + 0xe3779b99, 0xc6ef3733, 0x8dde6e67, 0x1bbcdccf, + 0x3779b99e, 0x6ef3733c, 0xdde6e678, 0xbbcdccf1, + 0x779b99e3, 0xef3733c6, 0xde6e678d, 0xbcdccf1b + }; + + private int[] wKey; + private bool forEncryption; + + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.forEncryption = forEncryption; + wKey = createWorkingKey(((KeyParameter)parameters).GetKey()); + } + + public virtual string AlgorithmName + { + get { return "SEED"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BlockSize; + } + + public virtual int ProcessBlock( + byte[] inBuf, + int inOff, + byte[] outBuf, + int outOff) + { + if (wKey == null) + throw new InvalidOperationException("SEED engine not initialised"); + + Check.DataLength(inBuf, inOff, BlockSize, "input buffer too short"); + Check.OutputLength(outBuf, outOff, BlockSize, "output buffer too short"); + + long l = bytesToLong(inBuf, inOff + 0); + long r = bytesToLong(inBuf, inOff + 8); + + if (forEncryption) + { + for (int i = 0; i < 16; i++) + { + long nl = r; + + r = l ^ F(wKey[2 * i], wKey[(2 * i) + 1], r); + l = nl; + } + } + else + { + for (int i = 15; i >= 0; i--) + { + long nl = r; + + r = l ^ F(wKey[2 * i], wKey[(2 * i) + 1], r); + l = nl; + } + } + + longToBytes(outBuf, outOff + 0, r); + longToBytes(outBuf, outOff + 8, l); + + return BlockSize; + } + + public virtual void Reset() + { + } + + private int[] createWorkingKey( + byte[] inKey) + { + int[] key = new int[32]; + long lower = bytesToLong(inKey, 0); + long upper = bytesToLong(inKey, 8); + + int key0 = extractW0(lower); + int key1 = extractW1(lower); + int key2 = extractW0(upper); + int key3 = extractW1(upper); + + for (int i = 0; i < 16; i++) + { + key[2 * i] = G(key0 + key2 - (int)KC[i]); + key[2 * i + 1] = G(key1 - key3 + (int)KC[i]); + + if (i % 2 == 0) + { + lower = rotateRight8(lower); + key0 = extractW0(lower); + key1 = extractW1(lower); + } + else + { + upper = rotateLeft8(upper); + key2 = extractW0(upper); + key3 = extractW1(upper); + } + } + + return key; + } + + private int extractW1( + long lVal) + { + return (int)lVal; + } + + private int extractW0( + long lVal) + { + return (int)(lVal >> 32); + } + + private long rotateLeft8( + long x) + { + return (x << 8) | ((long)((ulong) x >> 56)); + } + + private long rotateRight8( + long x) + { + return ((long)((ulong) x >> 8)) | (x << 56); + } + + private long bytesToLong( + byte[] src, + int srcOff) + { + long word = 0; + + for (int i = 0; i <= 7; i++) + { + word = (word << 8) + (src[i + srcOff] & 0xff); + } + + return word; + } + + private void longToBytes( + byte[] dest, + int destOff, + long value) + { + for (int i = 0; i < 8; i++) + { + dest[i + destOff] = (byte)(value >> ((7 - i) * 8)); + } + } + + private int G( + int x) + { + return (int)(SS0[x & 0xff] ^ SS1[(x >> 8) & 0xff] ^ SS2[(x >> 16) & 0xff] ^ SS3[(x >> 24) & 0xff]); + } + + private long F( + int ki0, + int ki1, + long r) + { + int r0 = (int)(r >> 32); + int r1 = (int)r; + int rd1 = phaseCalc2(r0, ki0, r1, ki1); + int rd0 = rd1 + phaseCalc1(r0, ki0, r1, ki1); + + return ((long)rd0 << 32) | (rd1 & 0xffffffffL); + } + + private int phaseCalc1( + int r0, + int ki0, + int r1, + int ki1) + { + return G(G((r0 ^ ki0) ^ (r1 ^ ki1)) + (r0 ^ ki0)); + } + + private int phaseCalc2( + int r0, + int ki0, + int r1, + int ki1) + { + return G(phaseCalc1(r0, ki0, r1, ki1) + G((r0 ^ ki0) ^ (r1 ^ ki1))); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDEngine.cs.meta new file mode 100644 index 00000000..9fc7a63a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2871544d92435c54787622babc99b141 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDWrapEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDWrapEngine.cs new file mode 100644 index 00000000..5a8dec06 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDWrapEngine.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// + /// An implementation of the SEED key wrapper based on RFC 4010/RFC 3394. + ///

+ /// For further details see: http://www.ietf.org/rfc/rfc4010.txt. + /// + public class SeedWrapEngine + : Rfc3394WrapEngine + { + public SeedWrapEngine() + : base(new SeedEngine()) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDWrapEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDWrapEngine.cs.meta new file mode 100644 index 00000000..e65254a8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SEEDWrapEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9401520a7aa7c8d41baf502990de084a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM2Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM2Engine.cs new file mode 100644 index 00000000..bc93ee77 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM2Engine.cs @@ -0,0 +1,242 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + ///

+ /// SM2 public key encryption engine - based on https://tools.ietf.org/html/draft-shen-sm2-ecdsa-02. + /// + public class SM2Engine + { + private readonly IDigest mDigest; + + private bool mForEncryption; + private ECKeyParameters mECKey; + private ECDomainParameters mECParams; + private int mCurveLength; + private SecureRandom mRandom; + + public SM2Engine() + : this(new SM3Digest()) + { + } + + public SM2Engine(IDigest digest) + { + this.mDigest = digest; + } + + public virtual void Init(bool forEncryption, ICipherParameters param) + { + this.mForEncryption = forEncryption; + + if (forEncryption) + { + ParametersWithRandom rParam = (ParametersWithRandom)param; + + mECKey = (ECKeyParameters)rParam.Parameters; + mECParams = mECKey.Parameters; + + ECPoint s = ((ECPublicKeyParameters)mECKey).Q.Multiply(mECParams.H); + if (s.IsInfinity) + throw new ArgumentException("invalid key: [h]Q at infinity"); + + mRandom = rParam.Random; + } + else + { + mECKey = (ECKeyParameters)param; + mECParams = mECKey.Parameters; + } + + mCurveLength = (mECParams.Curve.FieldSize + 7) / 8; + } + + public virtual byte[] ProcessBlock(byte[] input, int inOff, int inLen) + { + if (mForEncryption) + { + return Encrypt(input, inOff, inLen); + } + else + { + return Decrypt(input, inOff, inLen); + } + } + + protected virtual ECMultiplier CreateBasePointMultiplier() + { + return new FixedPointCombMultiplier(); + } + + private byte[] Encrypt(byte[] input, int inOff, int inLen) + { + byte[] c2 = new byte[inLen]; + + Array.Copy(input, inOff, c2, 0, c2.Length); + + ECMultiplier multiplier = CreateBasePointMultiplier(); + + byte[] c1; + ECPoint kPB; + do + { + BigInteger k = NextK(); + + ECPoint c1P = multiplier.Multiply(mECParams.G, k).Normalize(); + + c1 = c1P.GetEncoded(false); + + kPB = ((ECPublicKeyParameters)mECKey).Q.Multiply(k).Normalize(); + + Kdf(mDigest, kPB, c2); + } + while (NotEncrypted(c2, input, inOff)); + + AddFieldElement(mDigest, kPB.AffineXCoord); + mDigest.BlockUpdate(input, inOff, inLen); + AddFieldElement(mDigest, kPB.AffineYCoord); + + byte[] c3 = DigestUtilities.DoFinal(mDigest); + + return Arrays.ConcatenateAll(c1, c2, c3); + } + + private byte[] Decrypt(byte[] input, int inOff, int inLen) + { + byte[] c1 = new byte[mCurveLength * 2 + 1]; + + Array.Copy(input, inOff, c1, 0, c1.Length); + + ECPoint c1P = mECParams.Curve.DecodePoint(c1); + + ECPoint s = c1P.Multiply(mECParams.H); + if (s.IsInfinity) + throw new InvalidCipherTextException("[h]C1 at infinity"); + + c1P = c1P.Multiply(((ECPrivateKeyParameters)mECKey).D).Normalize(); + + byte[] c2 = new byte[inLen - c1.Length - mDigest.GetDigestSize()]; + + Array.Copy(input, inOff + c1.Length, c2, 0, c2.Length); + + Kdf(mDigest, c1P, c2); + + AddFieldElement(mDigest, c1P.AffineXCoord); + mDigest.BlockUpdate(c2, 0, c2.Length); + AddFieldElement(mDigest, c1P.AffineYCoord); + + byte[] c3 = DigestUtilities.DoFinal(mDigest); + + int check = 0; + for (int i = 0; i != c3.Length; i++) + { + check |= c3[i] ^ input[inOff + c1.Length + c2.Length + i]; + } + + Arrays.Fill(c1, 0); + Arrays.Fill(c3, 0); + + if (check != 0) + { + Arrays.Fill(c2, 0); + throw new InvalidCipherTextException("invalid cipher text"); + } + + return c2; + } + + private bool NotEncrypted(byte[] encData, byte[] input, int inOff) + { + for (int i = 0; i != encData.Length; i++) + { + if (encData[i] != input[inOff]) + { + return false; + } + } + + return true; + } + + private void Kdf(IDigest digest, ECPoint c1, byte[] encData) + { + int digestSize = digest.GetDigestSize(); + byte[] buf = new byte[System.Math.Max(4, digestSize)]; + int off = 0; + + IMemoable memo = digest as IMemoable; + IMemoable copy = null; + + if (memo != null) + { + AddFieldElement(digest, c1.AffineXCoord); + AddFieldElement(digest, c1.AffineYCoord); + copy = memo.Copy(); + } + + uint ct = 0; + + while (off < encData.Length) + { + if (memo != null) + { + memo.Reset(copy); + } + else + { + AddFieldElement(digest, c1.AffineXCoord); + AddFieldElement(digest, c1.AffineYCoord); + } + + Pack.UInt32_To_BE(++ct, buf, 0); + digest.BlockUpdate(buf, 0, 4); + digest.DoFinal(buf, 0); + + int xorLen = System.Math.Min(digestSize, encData.Length - off); + Xor(encData, buf, off, xorLen); + off += xorLen; + } + } + + private void Xor(byte[] data, byte[] kdfOut, int dOff, int dRemaining) + { + for (int i = 0; i != dRemaining; i++) + { + data[dOff + i] ^= kdfOut[i]; + } + } + + private BigInteger NextK() + { + int qBitLength = mECParams.N.BitLength; + + BigInteger k; + do + { + k = new BigInteger(qBitLength, mRandom); + } + while (k.SignValue == 0 || k.CompareTo(mECParams.N) >= 0); + + return k; + } + + private void AddFieldElement(IDigest digest, ECFieldElement v) + { + byte[] p = v.GetEncoded(); + digest.BlockUpdate(p, 0, p.Length); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM2Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM2Engine.cs.meta new file mode 100644 index 00000000..8e8974c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM2Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98ba5c33f3d8bf14499919dce964edae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM4Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM4Engine.cs new file mode 100644 index 00000000..08558775 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM4Engine.cs @@ -0,0 +1,193 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// SM4 Block Cipher - SM4 is a 128 bit block cipher with a 128 bit key. + /// + /// The implementation here is based on the document http://eprint.iacr.org/2008/329.pdf + /// by Whitfield Diffie and George Ledin, which is a translation of Prof. LU Shu-wang's original standard. + /// + public class SM4Engine + : IBlockCipher + { + private const int BlockSize = 16; + + private static readonly byte[] Sbox = + { + 0xd6, 0x90, 0xe9, 0xfe, 0xcc, 0xe1, 0x3d, 0xb7, 0x16, 0xb6, 0x14, 0xc2, 0x28, 0xfb, 0x2c, 0x05, + 0x2b, 0x67, 0x9a, 0x76, 0x2a, 0xbe, 0x04, 0xc3, 0xaa, 0x44, 0x13, 0x26, 0x49, 0x86, 0x06, 0x99, + 0x9c, 0x42, 0x50, 0xf4, 0x91, 0xef, 0x98, 0x7a, 0x33, 0x54, 0x0b, 0x43, 0xed, 0xcf, 0xac, 0x62, + 0xe4, 0xb3, 0x1c, 0xa9, 0xc9, 0x08, 0xe8, 0x95, 0x80, 0xdf, 0x94, 0xfa, 0x75, 0x8f, 0x3f, 0xa6, + 0x47, 0x07, 0xa7, 0xfc, 0xf3, 0x73, 0x17, 0xba, 0x83, 0x59, 0x3c, 0x19, 0xe6, 0x85, 0x4f, 0xa8, + 0x68, 0x6b, 0x81, 0xb2, 0x71, 0x64, 0xda, 0x8b, 0xf8, 0xeb, 0x0f, 0x4b, 0x70, 0x56, 0x9d, 0x35, + 0x1e, 0x24, 0x0e, 0x5e, 0x63, 0x58, 0xd1, 0xa2, 0x25, 0x22, 0x7c, 0x3b, 0x01, 0x21, 0x78, 0x87, + 0xd4, 0x00, 0x46, 0x57, 0x9f, 0xd3, 0x27, 0x52, 0x4c, 0x36, 0x02, 0xe7, 0xa0, 0xc4, 0xc8, 0x9e, + 0xea, 0xbf, 0x8a, 0xd2, 0x40, 0xc7, 0x38, 0xb5, 0xa3, 0xf7, 0xf2, 0xce, 0xf9, 0x61, 0x15, 0xa1, + 0xe0, 0xae, 0x5d, 0xa4, 0x9b, 0x34, 0x1a, 0x55, 0xad, 0x93, 0x32, 0x30, 0xf5, 0x8c, 0xb1, 0xe3, + 0x1d, 0xf6, 0xe2, 0x2e, 0x82, 0x66, 0xca, 0x60, 0xc0, 0x29, 0x23, 0xab, 0x0d, 0x53, 0x4e, 0x6f, + 0xd5, 0xdb, 0x37, 0x45, 0xde, 0xfd, 0x8e, 0x2f, 0x03, 0xff, 0x6a, 0x72, 0x6d, 0x6c, 0x5b, 0x51, + 0x8d, 0x1b, 0xaf, 0x92, 0xbb, 0xdd, 0xbc, 0x7f, 0x11, 0xd9, 0x5c, 0x41, 0x1f, 0x10, 0x5a, 0xd8, + 0x0a, 0xc1, 0x31, 0x88, 0xa5, 0xcd, 0x7b, 0xbd, 0x2d, 0x74, 0xd0, 0x12, 0xb8, 0xe5, 0xb4, 0xb0, + 0x89, 0x69, 0x97, 0x4a, 0x0c, 0x96, 0x77, 0x7e, 0x65, 0xb9, 0xf1, 0x09, 0xc5, 0x6e, 0xc6, 0x84, + 0x18, 0xf0, 0x7d, 0xec, 0x3a, 0xdc, 0x4d, 0x20, 0x79, 0xee, 0x5f, 0x3e, 0xd7, 0xcb, 0x39, 0x48 + }; + + private static readonly uint[] CK = + { + 0x00070e15, 0x1c232a31, 0x383f464d, 0x545b6269, + 0x70777e85, 0x8c939aa1, 0xa8afb6bd, 0xc4cbd2d9, + 0xe0e7eef5, 0xfc030a11, 0x181f262d, 0x343b4249, + 0x50575e65, 0x6c737a81, 0x888f969d, 0xa4abb2b9, + 0xc0c7ced5, 0xdce3eaf1, 0xf8ff060d, 0x141b2229, + 0x30373e45, 0x4c535a61, 0x686f767d, 0x848b9299, + 0xa0a7aeb5, 0xbcc3cad1, 0xd8dfe6ed, 0xf4fb0209, + 0x10171e25, 0x2c333a41, 0x484f565d, 0x646b7279 + }; + + private static readonly uint[] FK = + { + 0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc + }; + + private uint[] rk; + + // non-linear substitution tau. + private static uint tau(uint A) + { + uint b0 = Sbox[A >> 24]; + uint b1 = Sbox[(A >> 16) & 0xFF]; + uint b2 = Sbox[(A >> 8) & 0xFF]; + uint b3 = Sbox[A & 0xFF]; + + return (b0 << 24) | (b1 << 16) | (b2 << 8) | b3; + } + + private static uint L_ap(uint B) + { + return B ^ Integers.RotateLeft(B, 13) ^ Integers.RotateLeft(B, 23); + } + + private uint T_ap(uint Z) + { + return L_ap(tau(Z)); + } + + // Key expansion + private void ExpandKey(bool forEncryption, byte[] key) + { + uint K0 = Pack.BE_To_UInt32(key, 0) ^ FK[0]; + uint K1 = Pack.BE_To_UInt32(key, 4) ^ FK[1]; + uint K2 = Pack.BE_To_UInt32(key, 8) ^ FK[2]; + uint K3 = Pack.BE_To_UInt32(key, 12) ^ FK[3]; + + if (forEncryption) + { + rk[0] = K0 ^ T_ap(K1 ^ K2 ^ K3 ^ CK[0]); + rk[1] = K1 ^ T_ap(K2 ^ K3 ^ rk[0] ^ CK[1]); + rk[2] = K2 ^ T_ap(K3 ^ rk[0] ^ rk[1] ^ CK[2]); + rk[3] = K3 ^ T_ap(rk[0] ^ rk[1] ^ rk[2] ^ CK[3]); + for (int i = 4; i < 32; ++i) + { + rk[i] = rk[i - 4] ^ T_ap(rk[i - 3] ^ rk[i - 2] ^ rk[i - 1] ^ CK[i]); + } + } + else + { + rk[31] = K0 ^ T_ap(K1 ^ K2 ^ K3 ^ CK[0]); + rk[30] = K1 ^ T_ap(K2 ^ K3 ^ rk[31] ^ CK[1]); + rk[29] = K2 ^ T_ap(K3 ^ rk[31] ^ rk[30] ^ CK[2]); + rk[28] = K3 ^ T_ap(rk[31] ^ rk[30] ^ rk[29] ^ CK[3]); + for (int i = 27; i >= 0; --i) + { + rk[i] = rk[i + 4] ^ T_ap(rk[i + 3] ^ rk[i + 2] ^ rk[i + 1] ^ CK[31 - i]); + } + } + } + + // Linear substitution L + private static uint L(uint B) + { + return B ^ Integers.RotateLeft(B, 2) ^ Integers.RotateLeft(B, 10) ^ Integers.RotateLeft(B, 18) ^ Integers.RotateLeft(B, 24); + } + + // Mixer-substitution T + private static uint T(uint Z) + { + return L(tau(Z)); + } + + public virtual void Init(bool forEncryption, ICipherParameters parameters) + { + KeyParameter keyParameter = parameters as KeyParameter; + if (null == keyParameter) + throw new ArgumentException("invalid parameter passed to SM4 init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters), "parameters"); + + byte[] key = keyParameter.GetKey(); + if (key.Length != 16) + throw new ArgumentException("SM4 requires a 128 bit key", "parameters"); + + if (null == rk) + { + rk = new uint[32]; + } + + ExpandKey(forEncryption, key); + } + + public virtual string AlgorithmName + { + get { return "SM4"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BlockSize; + } + + public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff) + { + if (null == rk) + throw new InvalidOperationException("SM4 not initialised"); + + Check.DataLength(input, inOff, BlockSize, "input buffer too short"); + Check.OutputLength(output, outOff, BlockSize, "output buffer too short"); + + uint X0 = Pack.BE_To_UInt32(input, inOff); + uint X1 = Pack.BE_To_UInt32(input, inOff + 4); + uint X2 = Pack.BE_To_UInt32(input, inOff + 8); + uint X3 = Pack.BE_To_UInt32(input, inOff + 12); + + for (int i = 0; i < 32; i += 4) + { + X0 ^= T(X1 ^ X2 ^ X3 ^ rk[i ]); // F0 + X1 ^= T(X2 ^ X3 ^ X0 ^ rk[i + 1]); // F1 + X2 ^= T(X3 ^ X0 ^ X1 ^ rk[i + 2]); // F2 + X3 ^= T(X0 ^ X1 ^ X2 ^ rk[i + 3]); // F3 + } + + Pack.UInt32_To_BE(X3, output, outOff); + Pack.UInt32_To_BE(X2, output, outOff + 4); + Pack.UInt32_To_BE(X1, output, outOff + 8); + Pack.UInt32_To_BE(X0, output, outOff + 12); + + return BlockSize; + } + + public virtual void Reset() + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM4Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM4Engine.cs.meta new file mode 100644 index 00000000..8c9c66ee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SM4Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f458e754a7e6c3c4aa5af54a925ccf12 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Salsa20Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Salsa20Engine.cs new file mode 100644 index 00000000..a57475e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Salsa20Engine.cs @@ -0,0 +1,366 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// + /// Implementation of Daniel J. Bernstein's Salsa20 stream cipher, Snuffle 2005 + /// + public class Salsa20Engine + : IStreamCipher + { + public static readonly int DEFAULT_ROUNDS = 20; + + /** Constants */ + private const int StateSize = 16; // 16, 32 bit ints = 64 bytes + + private readonly static uint[] TAU_SIGMA = Pack.LE_To_UInt32(Strings.ToAsciiByteArray("expand 16-byte k" + "expand 32-byte k"), 0, 8); + + internal void PackTauOrSigma(int keyLength, uint[] state, int stateOffset) + { + int tsOff = (keyLength - 16) / 4; + state[stateOffset] = TAU_SIGMA[tsOff]; + state[stateOffset + 1] = TAU_SIGMA[tsOff + 1]; + state[stateOffset + 2] = TAU_SIGMA[tsOff + 2]; + state[stateOffset + 3] = TAU_SIGMA[tsOff + 3]; + } + + [Obsolete] + protected readonly static byte[] + sigma = Strings.ToAsciiByteArray("expand 32-byte k"), + tau = Strings.ToAsciiByteArray("expand 16-byte k"); + + protected int rounds; + + /* + * variables to hold the state of the engine + * during encryption and decryption + */ + private int index = 0; + internal uint[] engineState = new uint[StateSize]; // state + internal uint[] x = new uint[StateSize]; // internal buffer + private byte[] keyStream = new byte[StateSize * 4]; // expanded state, 64 bytes + private bool initialised = false; + + /* + * internal counter + */ + private uint cW0, cW1, cW2; + + /// + /// Creates a 20 round Salsa20 engine. + /// + public Salsa20Engine() + : this(DEFAULT_ROUNDS) + { + } + + /// + /// Creates a Salsa20 engine with a specific number of rounds. + /// + /// the number of rounds (must be an even number). + public Salsa20Engine(int rounds) + { + if (rounds <= 0 || (rounds & 1) != 0) + { + throw new ArgumentException("'rounds' must be a positive, even number"); + } + + this.rounds = rounds; + } + + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + /* + * Salsa20 encryption and decryption is completely + * symmetrical, so the 'forEncryption' is + * irrelevant. (Like 90% of stream ciphers) + */ + + ParametersWithIV ivParams = parameters as ParametersWithIV; + if (ivParams == null) + throw new ArgumentException(AlgorithmName + " Init requires an IV", "parameters"); + + byte[] iv = ivParams.GetIV(); + if (iv == null || iv.Length != NonceSize) + throw new ArgumentException(AlgorithmName + " requires exactly " + NonceSize + " bytes of IV"); + + ICipherParameters keyParam = ivParams.Parameters; + if (keyParam == null) + { + if (!initialised) + throw new InvalidOperationException(AlgorithmName + " KeyParameter can not be null for first initialisation"); + + SetKey(null, iv); + } + else if (keyParam is KeyParameter) + { + SetKey(((KeyParameter)keyParam).GetKey(), iv); + } + else + { + throw new ArgumentException(AlgorithmName + " Init parameters must contain a KeyParameter (or null for re-init)"); + } + + Reset(); + initialised = true; + } + + protected virtual int NonceSize + { + get { return 8; } + } + + public virtual string AlgorithmName + { + get + { + string name = "Salsa20"; + if (rounds != DEFAULT_ROUNDS) + { + name += "/" + rounds; + } + return name; + } + } + + public virtual byte ReturnByte( + byte input) + { + if (LimitExceeded()) + { + throw new MaxBytesExceededException("2^70 byte limit per IV; Change IV"); + } + + if (index == 0) + { + GenerateKeyStream(keyStream); + AdvanceCounter(); + } + + byte output = (byte)(keyStream[index] ^ input); + index = (index + 1) & 63; + + return output; + } + + protected virtual void AdvanceCounter() + { + if (++engineState[8] == 0) + { + ++engineState[9]; + } + } + + public virtual void ProcessBytes( + byte[] inBytes, + int inOff, + int len, + byte[] outBytes, + int outOff) + { + if (!initialised) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Check.DataLength(inBytes, inOff, len, "input buffer too short"); + Check.OutputLength(outBytes, outOff, len, "output buffer too short"); + + if (LimitExceeded((uint)len)) + throw new MaxBytesExceededException("2^70 byte limit per IV would be exceeded; Change IV"); + + for (int i = 0; i < len; i++) + { + if (index == 0) + { + GenerateKeyStream(keyStream); + AdvanceCounter(); + } + outBytes[i+outOff] = (byte)(keyStream[index]^inBytes[i+inOff]); + index = (index + 1) & 63; + } + } + + public virtual void Reset() + { + index = 0; + ResetLimitCounter(); + ResetCounter(); + } + + protected virtual void ResetCounter() + { + engineState[8] = engineState[9] = 0; + } + + protected virtual void SetKey(byte[] keyBytes, byte[] ivBytes) + { + if (keyBytes != null) + { + if ((keyBytes.Length != 16) && (keyBytes.Length != 32)) + throw new ArgumentException(AlgorithmName + " requires 128 bit or 256 bit key"); + + int tsOff = (keyBytes.Length - 16) / 4; + engineState[0] = TAU_SIGMA[tsOff]; + engineState[5] = TAU_SIGMA[tsOff + 1]; + engineState[10] = TAU_SIGMA[tsOff + 2]; + engineState[15] = TAU_SIGMA[tsOff + 3]; + + // Key + Pack.LE_To_UInt32(keyBytes, 0, engineState, 1, 4); + Pack.LE_To_UInt32(keyBytes, keyBytes.Length - 16, engineState, 11, 4); + } + + // IV + Pack.LE_To_UInt32(ivBytes, 0, engineState, 6, 2); + } + + protected virtual void GenerateKeyStream(byte[] output) + { + SalsaCore(rounds, engineState, x); + Pack.UInt32_To_LE(x, output, 0); + } + + internal static void SalsaCore(int rounds, uint[] input, uint[] x) + { + if (input.Length != 16) + throw new ArgumentException(); + if (x.Length != 16) + throw new ArgumentException(); + if (rounds % 2 != 0) + throw new ArgumentException("Number of rounds must be even"); + + uint x00 = input[ 0]; + uint x01 = input[ 1]; + uint x02 = input[ 2]; + uint x03 = input[ 3]; + uint x04 = input[ 4]; + uint x05 = input[ 5]; + uint x06 = input[ 6]; + uint x07 = input[ 7]; + uint x08 = input[ 8]; + uint x09 = input[ 9]; + uint x10 = input[10]; + uint x11 = input[11]; + uint x12 = input[12]; + uint x13 = input[13]; + uint x14 = input[14]; + uint x15 = input[15]; + + for (int i = rounds; i > 0; i -= 2) + { + x04 ^= R((x00+x12), 7); + x08 ^= R((x04+x00), 9); + x12 ^= R((x08+x04),13); + x00 ^= R((x12+x08),18); + x09 ^= R((x05+x01), 7); + x13 ^= R((x09+x05), 9); + x01 ^= R((x13+x09),13); + x05 ^= R((x01+x13),18); + x14 ^= R((x10+x06), 7); + x02 ^= R((x14+x10), 9); + x06 ^= R((x02+x14),13); + x10 ^= R((x06+x02),18); + x03 ^= R((x15+x11), 7); + x07 ^= R((x03+x15), 9); + x11 ^= R((x07+x03),13); + x15 ^= R((x11+x07),18); + + x01 ^= R((x00+x03), 7); + x02 ^= R((x01+x00), 9); + x03 ^= R((x02+x01),13); + x00 ^= R((x03+x02),18); + x06 ^= R((x05+x04), 7); + x07 ^= R((x06+x05), 9); + x04 ^= R((x07+x06),13); + x05 ^= R((x04+x07),18); + x11 ^= R((x10+x09), 7); + x08 ^= R((x11+x10), 9); + x09 ^= R((x08+x11),13); + x10 ^= R((x09+x08),18); + x12 ^= R((x15+x14), 7); + x13 ^= R((x12+x15), 9); + x14 ^= R((x13+x12),13); + x15 ^= R((x14+x13),18); + } + + x[ 0] = x00 + input[ 0]; + x[ 1] = x01 + input[ 1]; + x[ 2] = x02 + input[ 2]; + x[ 3] = x03 + input[ 3]; + x[ 4] = x04 + input[ 4]; + x[ 5] = x05 + input[ 5]; + x[ 6] = x06 + input[ 6]; + x[ 7] = x07 + input[ 7]; + x[ 8] = x08 + input[ 8]; + x[ 9] = x09 + input[ 9]; + x[10] = x10 + input[10]; + x[11] = x11 + input[11]; + x[12] = x12 + input[12]; + x[13] = x13 + input[13]; + x[14] = x14 + input[14]; + x[15] = x15 + input[15]; + } + + /** + * Rotate left + * + * @param x value to rotate + * @param y amount to rotate x + * + * @return rotated x + */ + internal static uint R(uint x, int y) + { + return (x << y) | (x >> (32 - y)); + } + + private void ResetLimitCounter() + { + cW0 = 0; + cW1 = 0; + cW2 = 0; + } + + private bool LimitExceeded() + { + if (++cW0 == 0) + { + if (++cW1 == 0) + { + return (++cW2 & 0x20) != 0; // 2^(32 + 32 + 6) + } + } + + return false; + } + + /* + * this relies on the fact len will always be positive. + */ + private bool LimitExceeded( + uint len) + { + uint old = cW0; + cW0 += len; + if (cW0 < old) + { + if (++cW1 == 0) + { + return (++cW2 & 0x20) != 0; // 2^(32 + 32 + 6) + } + } + + return false; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Salsa20Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Salsa20Engine.cs.meta new file mode 100644 index 00000000..65228f44 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/Salsa20Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e6638eb0b1fe30e45ada9cdca38690cd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngine.cs new file mode 100644 index 00000000..9c458eeb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngine.cs @@ -0,0 +1,296 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * Serpent is a 128-bit 32-round block cipher with variable key lengths, + * including 128, 192 and 256 bit keys conjectured to be at least as + * secure as three-key triple-DES. + *

+ * Serpent was designed by Ross Anderson, Eli Biham and Lars Knudsen as a + * candidate algorithm for the NIST AES Quest. + *

+ *

+ * For full details see The Serpent home page + *

+ */ + public sealed class SerpentEngine + : SerpentEngineBase + { + /** + * Expand a user-supplied key material into a session key. + * + * @param key The user-key bytes (multiples of 4) to use. + * @exception ArgumentException + */ + protected override int[] MakeWorkingKey(byte[] key) + { + // + // pad key to 256 bits + // + int[] kPad = new int[16]; + int off = 0; + int length = 0; + + for (off = 0; (off + 4) < key.Length; off += 4) + { + kPad[length++] = (int)Pack.LE_To_UInt32(key, off); + } + + if (off % 4 == 0) + { + kPad[length++] = (int)Pack.LE_To_UInt32(key, off); + if (length < 8) + { + kPad[length] = 1; + } + } + else + { + throw new ArgumentException("key must be a multiple of 4 bytes"); + } + + // + // expand the padded key up to 33 x 128 bits of key material + // + int amount = (ROUNDS + 1) * 4; + int[] w = new int[amount]; + + // + // compute w0 to w7 from w-8 to w-1 + // + for (int i = 8; i < 16; i++) + { + kPad[i] = RotateLeft(kPad[i - 8] ^ kPad[i - 5] ^ kPad[i - 3] ^ kPad[i - 1] ^ PHI ^ (i - 8), 11); + } + + Array.Copy(kPad, 8, w, 0, 8); + + // + // compute w8 to w136 + // + for (int i = 8; i < amount; i++) + { + w[i] = RotateLeft(w[i - 8] ^ w[i - 5] ^ w[i - 3] ^ w[i - 1] ^ PHI ^ i, 11); + } + + // + // create the working keys by processing w with the Sbox and IP + // + Sb3(w[0], w[1], w[2], w[3]); + w[0] = X0; w[1] = X1; w[2] = X2; w[3] = X3; + Sb2(w[4], w[5], w[6], w[7]); + w[4] = X0; w[5] = X1; w[6] = X2; w[7] = X3; + Sb1(w[8], w[9], w[10], w[11]); + w[8] = X0; w[9] = X1; w[10] = X2; w[11] = X3; + Sb0(w[12], w[13], w[14], w[15]); + w[12] = X0; w[13] = X1; w[14] = X2; w[15] = X3; + Sb7(w[16], w[17], w[18], w[19]); + w[16] = X0; w[17] = X1; w[18] = X2; w[19] = X3; + Sb6(w[20], w[21], w[22], w[23]); + w[20] = X0; w[21] = X1; w[22] = X2; w[23] = X3; + Sb5(w[24], w[25], w[26], w[27]); + w[24] = X0; w[25] = X1; w[26] = X2; w[27] = X3; + Sb4(w[28], w[29], w[30], w[31]); + w[28] = X0; w[29] = X1; w[30] = X2; w[31] = X3; + Sb3(w[32], w[33], w[34], w[35]); + w[32] = X0; w[33] = X1; w[34] = X2; w[35] = X3; + Sb2(w[36], w[37], w[38], w[39]); + w[36] = X0; w[37] = X1; w[38] = X2; w[39] = X3; + Sb1(w[40], w[41], w[42], w[43]); + w[40] = X0; w[41] = X1; w[42] = X2; w[43] = X3; + Sb0(w[44], w[45], w[46], w[47]); + w[44] = X0; w[45] = X1; w[46] = X2; w[47] = X3; + Sb7(w[48], w[49], w[50], w[51]); + w[48] = X0; w[49] = X1; w[50] = X2; w[51] = X3; + Sb6(w[52], w[53], w[54], w[55]); + w[52] = X0; w[53] = X1; w[54] = X2; w[55] = X3; + Sb5(w[56], w[57], w[58], w[59]); + w[56] = X0; w[57] = X1; w[58] = X2; w[59] = X3; + Sb4(w[60], w[61], w[62], w[63]); + w[60] = X0; w[61] = X1; w[62] = X2; w[63] = X3; + Sb3(w[64], w[65], w[66], w[67]); + w[64] = X0; w[65] = X1; w[66] = X2; w[67] = X3; + Sb2(w[68], w[69], w[70], w[71]); + w[68] = X0; w[69] = X1; w[70] = X2; w[71] = X3; + Sb1(w[72], w[73], w[74], w[75]); + w[72] = X0; w[73] = X1; w[74] = X2; w[75] = X3; + Sb0(w[76], w[77], w[78], w[79]); + w[76] = X0; w[77] = X1; w[78] = X2; w[79] = X3; + Sb7(w[80], w[81], w[82], w[83]); + w[80] = X0; w[81] = X1; w[82] = X2; w[83] = X3; + Sb6(w[84], w[85], w[86], w[87]); + w[84] = X0; w[85] = X1; w[86] = X2; w[87] = X3; + Sb5(w[88], w[89], w[90], w[91]); + w[88] = X0; w[89] = X1; w[90] = X2; w[91] = X3; + Sb4(w[92], w[93], w[94], w[95]); + w[92] = X0; w[93] = X1; w[94] = X2; w[95] = X3; + Sb3(w[96], w[97], w[98], w[99]); + w[96] = X0; w[97] = X1; w[98] = X2; w[99] = X3; + Sb2(w[100], w[101], w[102], w[103]); + w[100] = X0; w[101] = X1; w[102] = X2; w[103] = X3; + Sb1(w[104], w[105], w[106], w[107]); + w[104] = X0; w[105] = X1; w[106] = X2; w[107] = X3; + Sb0(w[108], w[109], w[110], w[111]); + w[108] = X0; w[109] = X1; w[110] = X2; w[111] = X3; + Sb7(w[112], w[113], w[114], w[115]); + w[112] = X0; w[113] = X1; w[114] = X2; w[115] = X3; + Sb6(w[116], w[117], w[118], w[119]); + w[116] = X0; w[117] = X1; w[118] = X2; w[119] = X3; + Sb5(w[120], w[121], w[122], w[123]); + w[120] = X0; w[121] = X1; w[122] = X2; w[123] = X3; + Sb4(w[124], w[125], w[126], w[127]); + w[124] = X0; w[125] = X1; w[126] = X2; w[127] = X3; + Sb3(w[128], w[129], w[130], w[131]); + w[128] = X0; w[129] = X1; w[130] = X2; w[131] = X3; + + return w; + } + + /** + * Encrypt one block of plaintext. + * + * @param input the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param output the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + */ + protected override void EncryptBlock(byte[] input, int inOff, byte[] output, int outOff) + { + X0 = (int)Pack.LE_To_UInt32(input, inOff); + X1 = (int)Pack.LE_To_UInt32(input, inOff + 4); + X2 = (int)Pack.LE_To_UInt32(input, inOff + 8); + X3 = (int)Pack.LE_To_UInt32(input, inOff + 12); + + Sb0(wKey[0] ^ X0, wKey[1] ^ X1, wKey[2] ^ X2, wKey[3] ^ X3); LT(); + Sb1(wKey[4] ^ X0, wKey[5] ^ X1, wKey[6] ^ X2, wKey[7] ^ X3); LT(); + Sb2(wKey[8] ^ X0, wKey[9] ^ X1, wKey[10] ^ X2, wKey[11] ^ X3); LT(); + Sb3(wKey[12] ^ X0, wKey[13] ^ X1, wKey[14] ^ X2, wKey[15] ^ X3); LT(); + Sb4(wKey[16] ^ X0, wKey[17] ^ X1, wKey[18] ^ X2, wKey[19] ^ X3); LT(); + Sb5(wKey[20] ^ X0, wKey[21] ^ X1, wKey[22] ^ X2, wKey[23] ^ X3); LT(); + Sb6(wKey[24] ^ X0, wKey[25] ^ X1, wKey[26] ^ X2, wKey[27] ^ X3); LT(); + Sb7(wKey[28] ^ X0, wKey[29] ^ X1, wKey[30] ^ X2, wKey[31] ^ X3); LT(); + Sb0(wKey[32] ^ X0, wKey[33] ^ X1, wKey[34] ^ X2, wKey[35] ^ X3); LT(); + Sb1(wKey[36] ^ X0, wKey[37] ^ X1, wKey[38] ^ X2, wKey[39] ^ X3); LT(); + Sb2(wKey[40] ^ X0, wKey[41] ^ X1, wKey[42] ^ X2, wKey[43] ^ X3); LT(); + Sb3(wKey[44] ^ X0, wKey[45] ^ X1, wKey[46] ^ X2, wKey[47] ^ X3); LT(); + Sb4(wKey[48] ^ X0, wKey[49] ^ X1, wKey[50] ^ X2, wKey[51] ^ X3); LT(); + Sb5(wKey[52] ^ X0, wKey[53] ^ X1, wKey[54] ^ X2, wKey[55] ^ X3); LT(); + Sb6(wKey[56] ^ X0, wKey[57] ^ X1, wKey[58] ^ X2, wKey[59] ^ X3); LT(); + Sb7(wKey[60] ^ X0, wKey[61] ^ X1, wKey[62] ^ X2, wKey[63] ^ X3); LT(); + Sb0(wKey[64] ^ X0, wKey[65] ^ X1, wKey[66] ^ X2, wKey[67] ^ X3); LT(); + Sb1(wKey[68] ^ X0, wKey[69] ^ X1, wKey[70] ^ X2, wKey[71] ^ X3); LT(); + Sb2(wKey[72] ^ X0, wKey[73] ^ X1, wKey[74] ^ X2, wKey[75] ^ X3); LT(); + Sb3(wKey[76] ^ X0, wKey[77] ^ X1, wKey[78] ^ X2, wKey[79] ^ X3); LT(); + Sb4(wKey[80] ^ X0, wKey[81] ^ X1, wKey[82] ^ X2, wKey[83] ^ X3); LT(); + Sb5(wKey[84] ^ X0, wKey[85] ^ X1, wKey[86] ^ X2, wKey[87] ^ X3); LT(); + Sb6(wKey[88] ^ X0, wKey[89] ^ X1, wKey[90] ^ X2, wKey[91] ^ X3); LT(); + Sb7(wKey[92] ^ X0, wKey[93] ^ X1, wKey[94] ^ X2, wKey[95] ^ X3); LT(); + Sb0(wKey[96] ^ X0, wKey[97] ^ X1, wKey[98] ^ X2, wKey[99] ^ X3); LT(); + Sb1(wKey[100] ^ X0, wKey[101] ^ X1, wKey[102] ^ X2, wKey[103] ^ X3); LT(); + Sb2(wKey[104] ^ X0, wKey[105] ^ X1, wKey[106] ^ X2, wKey[107] ^ X3); LT(); + Sb3(wKey[108] ^ X0, wKey[109] ^ X1, wKey[110] ^ X2, wKey[111] ^ X3); LT(); + Sb4(wKey[112] ^ X0, wKey[113] ^ X1, wKey[114] ^ X2, wKey[115] ^ X3); LT(); + Sb5(wKey[116] ^ X0, wKey[117] ^ X1, wKey[118] ^ X2, wKey[119] ^ X3); LT(); + Sb6(wKey[120] ^ X0, wKey[121] ^ X1, wKey[122] ^ X2, wKey[123] ^ X3); LT(); + Sb7(wKey[124] ^ X0, wKey[125] ^ X1, wKey[126] ^ X2, wKey[127] ^ X3); + + Pack.UInt32_To_LE((uint)(wKey[128] ^ X0), output, outOff); + Pack.UInt32_To_LE((uint)(wKey[129] ^ X1), output, outOff + 4); + Pack.UInt32_To_LE((uint)(wKey[130] ^ X2), output, outOff + 8); + Pack.UInt32_To_LE((uint)(wKey[131] ^ X3), output, outOff + 12); + } + + /** + * Decrypt one block of ciphertext. + * + * @param input the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param output the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + */ + protected override void DecryptBlock(byte[] input, int inOff, byte[] output, int outOff) + { + X0 = wKey[128] ^ (int)Pack.LE_To_UInt32(input, inOff); + X1 = wKey[129] ^ (int)Pack.LE_To_UInt32(input, inOff + 4); + X2 = wKey[130] ^ (int)Pack.LE_To_UInt32(input, inOff + 8); + X3 = wKey[131] ^ (int)Pack.LE_To_UInt32(input, inOff + 12); + + Ib7(X0, X1, X2, X3); + X0 ^= wKey[124]; X1 ^= wKey[125]; X2 ^= wKey[126]; X3 ^= wKey[127]; + InverseLT(); Ib6(X0, X1, X2, X3); + X0 ^= wKey[120]; X1 ^= wKey[121]; X2 ^= wKey[122]; X3 ^= wKey[123]; + InverseLT(); Ib5(X0, X1, X2, X3); + X0 ^= wKey[116]; X1 ^= wKey[117]; X2 ^= wKey[118]; X3 ^= wKey[119]; + InverseLT(); Ib4(X0, X1, X2, X3); + X0 ^= wKey[112]; X1 ^= wKey[113]; X2 ^= wKey[114]; X3 ^= wKey[115]; + InverseLT(); Ib3(X0, X1, X2, X3); + X0 ^= wKey[108]; X1 ^= wKey[109]; X2 ^= wKey[110]; X3 ^= wKey[111]; + InverseLT(); Ib2(X0, X1, X2, X3); + X0 ^= wKey[104]; X1 ^= wKey[105]; X2 ^= wKey[106]; X3 ^= wKey[107]; + InverseLT(); Ib1(X0, X1, X2, X3); + X0 ^= wKey[100]; X1 ^= wKey[101]; X2 ^= wKey[102]; X3 ^= wKey[103]; + InverseLT(); Ib0(X0, X1, X2, X3); + X0 ^= wKey[96]; X1 ^= wKey[97]; X2 ^= wKey[98]; X3 ^= wKey[99]; + InverseLT(); Ib7(X0, X1, X2, X3); + X0 ^= wKey[92]; X1 ^= wKey[93]; X2 ^= wKey[94]; X3 ^= wKey[95]; + InverseLT(); Ib6(X0, X1, X2, X3); + X0 ^= wKey[88]; X1 ^= wKey[89]; X2 ^= wKey[90]; X3 ^= wKey[91]; + InverseLT(); Ib5(X0, X1, X2, X3); + X0 ^= wKey[84]; X1 ^= wKey[85]; X2 ^= wKey[86]; X3 ^= wKey[87]; + InverseLT(); Ib4(X0, X1, X2, X3); + X0 ^= wKey[80]; X1 ^= wKey[81]; X2 ^= wKey[82]; X3 ^= wKey[83]; + InverseLT(); Ib3(X0, X1, X2, X3); + X0 ^= wKey[76]; X1 ^= wKey[77]; X2 ^= wKey[78]; X3 ^= wKey[79]; + InverseLT(); Ib2(X0, X1, X2, X3); + X0 ^= wKey[72]; X1 ^= wKey[73]; X2 ^= wKey[74]; X3 ^= wKey[75]; + InverseLT(); Ib1(X0, X1, X2, X3); + X0 ^= wKey[68]; X1 ^= wKey[69]; X2 ^= wKey[70]; X3 ^= wKey[71]; + InverseLT(); Ib0(X0, X1, X2, X3); + X0 ^= wKey[64]; X1 ^= wKey[65]; X2 ^= wKey[66]; X3 ^= wKey[67]; + InverseLT(); Ib7(X0, X1, X2, X3); + X0 ^= wKey[60]; X1 ^= wKey[61]; X2 ^= wKey[62]; X3 ^= wKey[63]; + InverseLT(); Ib6(X0, X1, X2, X3); + X0 ^= wKey[56]; X1 ^= wKey[57]; X2 ^= wKey[58]; X3 ^= wKey[59]; + InverseLT(); Ib5(X0, X1, X2, X3); + X0 ^= wKey[52]; X1 ^= wKey[53]; X2 ^= wKey[54]; X3 ^= wKey[55]; + InverseLT(); Ib4(X0, X1, X2, X3); + X0 ^= wKey[48]; X1 ^= wKey[49]; X2 ^= wKey[50]; X3 ^= wKey[51]; + InverseLT(); Ib3(X0, X1, X2, X3); + X0 ^= wKey[44]; X1 ^= wKey[45]; X2 ^= wKey[46]; X3 ^= wKey[47]; + InverseLT(); Ib2(X0, X1, X2, X3); + X0 ^= wKey[40]; X1 ^= wKey[41]; X2 ^= wKey[42]; X3 ^= wKey[43]; + InverseLT(); Ib1(X0, X1, X2, X3); + X0 ^= wKey[36]; X1 ^= wKey[37]; X2 ^= wKey[38]; X3 ^= wKey[39]; + InverseLT(); Ib0(X0, X1, X2, X3); + X0 ^= wKey[32]; X1 ^= wKey[33]; X2 ^= wKey[34]; X3 ^= wKey[35]; + InverseLT(); Ib7(X0, X1, X2, X3); + X0 ^= wKey[28]; X1 ^= wKey[29]; X2 ^= wKey[30]; X3 ^= wKey[31]; + InverseLT(); Ib6(X0, X1, X2, X3); + X0 ^= wKey[24]; X1 ^= wKey[25]; X2 ^= wKey[26]; X3 ^= wKey[27]; + InverseLT(); Ib5(X0, X1, X2, X3); + X0 ^= wKey[20]; X1 ^= wKey[21]; X2 ^= wKey[22]; X3 ^= wKey[23]; + InverseLT(); Ib4(X0, X1, X2, X3); + X0 ^= wKey[16]; X1 ^= wKey[17]; X2 ^= wKey[18]; X3 ^= wKey[19]; + InverseLT(); Ib3(X0, X1, X2, X3); + X0 ^= wKey[12]; X1 ^= wKey[13]; X2 ^= wKey[14]; X3 ^= wKey[15]; + InverseLT(); Ib2(X0, X1, X2, X3); + X0 ^= wKey[8]; X1 ^= wKey[9]; X2 ^= wKey[10]; X3 ^= wKey[11]; + InverseLT(); Ib1(X0, X1, X2, X3); + X0 ^= wKey[4]; X1 ^= wKey[5]; X2 ^= wKey[6]; X3 ^= wKey[7]; + InverseLT(); Ib0(X0, X1, X2, X3); + + Pack.UInt32_To_LE((uint)(X0 ^ wKey[0]), output, outOff); + Pack.UInt32_To_LE((uint)(X1 ^ wKey[1]), output, outOff + 4); + Pack.UInt32_To_LE((uint)(X2 ^ wKey[2]), output, outOff + 8); + Pack.UInt32_To_LE((uint)(X3 ^ wKey[3]), output, outOff + 12); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngine.cs.meta new file mode 100644 index 00000000..1fda676a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 491e4a3043740fb4aa22329380b4cbe4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngineBase.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngineBase.cs new file mode 100644 index 00000000..35fe66e3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngineBase.cs @@ -0,0 +1,473 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + public abstract class SerpentEngineBase + : IBlockCipher + { + protected static readonly int BlockSize = 16; + + internal const int ROUNDS = 32; + internal const int PHI = unchecked((int)0x9E3779B9); // (sqrt(5) - 1) * 2**31 + + protected bool encrypting; + protected int[] wKey; + + protected int X0, X1, X2, X3; // registers + + protected SerpentEngineBase() + { + } + + /** + * initialise a Serpent cipher. + * + * @param encrypting whether or not we are for encryption. + * @param params the parameters required to set up the cipher. + * @throws IllegalArgumentException if the params argument is + * inappropriate. + */ + public virtual void Init(bool encrypting, ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("invalid parameter passed to " + AlgorithmName + " init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + this.encrypting = encrypting; + this.wKey = MakeWorkingKey(((KeyParameter)parameters).GetKey()); + } + + public virtual string AlgorithmName + { + get { return "Serpent"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BlockSize; + } + + /** + * Process one block of input from the array in and write it to + * the out array. + * + * @param in the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param out the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @return the number of bytes processed and produced. + * @throws DataLengthException if there isn't enough data in in, or + * space in out. + * @throws IllegalStateException if the cipher isn't initialised. + */ + public int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff) + { + if (wKey == null) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Check.DataLength(input, inOff, BlockSize, "input buffer too short"); + Check.OutputLength(output, outOff, BlockSize, "output buffer too short"); + + if (encrypting) + { + EncryptBlock(input, inOff, output, outOff); + } + else + { + DecryptBlock(input, inOff, output, outOff); + } + + return BlockSize; + } + + public virtual void Reset() + { + } + + protected static int RotateLeft(int x, int bits) + { + return ((x << bits) | (int) ((uint)x >> (32 - bits))); + } + + private static int RotateRight(int x, int bits) + { + return ( (int)((uint)x >> bits) | (x << (32 - bits))); + } + + /* + * The sboxes below are based on the work of Brian Gladman and + * Sam Simpson, whose original notice appears below. + *

+ * For further details see: + * http://fp.gladman.plus.com/cryptography_technology/serpent/ + *

+ */ + + /* Partially optimised Serpent S Box boolean functions derived */ + /* using a recursive descent analyser but without a full search */ + /* of all subtrees. This set of S boxes is the result of work */ + /* by Sam Simpson and Brian Gladman using the spare time on a */ + /* cluster of high capacity servers to search for S boxes with */ + /* this customised search engine. There are now an average of */ + /* 15.375 terms per S box. */ + /* */ + /* Copyright: Dr B. R Gladman (gladman@seven77.demon.co.uk) */ + /* and Sam Simpson (s.simpson@mia.co.uk) */ + /* 17th December 1998 */ + /* */ + /* We hereby give permission for information in this file to be */ + /* used freely subject only to acknowledgement of its origin. */ + + /* + * S0 - { 3, 8,15, 1,10, 6, 5,11,14,13, 4, 2, 7, 0, 9,12 } - 15 terms. + */ + protected void Sb0(int a, int b, int c, int d) + { + int t1 = a ^ d; + int t3 = c ^ t1; + int t4 = b ^ t3; + X3 = (a & d) ^ t4; + int t7 = a ^ (b & t1); + X2 = t4 ^ (c | t7); + int t12 = X3 & (t3 ^ t7); + X1 = (~t3) ^ t12; + X0 = t12 ^ (~t7); + } + + /** + * InvSO - {13, 3,11, 0,10, 6, 5,12, 1,14, 4, 7,15, 9, 8, 2 } - 15 terms. + */ + protected void Ib0(int a, int b, int c, int d) + { + int t1 = ~a; + int t2 = a ^ b; + int t4 = d ^ (t1 | t2); + int t5 = c ^ t4; + X2 = t2 ^ t5; + int t8 = t1 ^ (d & t2); + X1 = t4 ^ (X2 & t8); + X3 = (a & t4) ^ (t5 | X1); + X0 = X3 ^ (t5 ^ t8); + } + + /** + * S1 - {15,12, 2, 7, 9, 0, 5,10, 1,11,14, 8, 6,13, 3, 4 } - 14 terms. + */ + protected void Sb1(int a, int b, int c, int d) + { + int t2 = b ^ (~a); + int t5 = c ^ (a | t2); + X2 = d ^ t5; + int t7 = b ^ (d | t2); + int t8 = t2 ^ X2; + X3 = t8 ^ (t5 & t7); + int t11 = t5 ^ t7; + X1 = X3 ^ t11; + X0 = t5 ^ (t8 & t11); + } + + /** + * InvS1 - { 5, 8, 2,14,15, 6,12, 3,11, 4, 7, 9, 1,13,10, 0 } - 14 steps. + */ + protected void Ib1(int a, int b, int c, int d) + { + int t1 = b ^ d; + int t3 = a ^ (b & t1); + int t4 = t1 ^ t3; + X3 = c ^ t4; + int t7 = b ^ (t1 & t3); + int t8 = X3 | t7; + X1 = t3 ^ t8; + int t10 = ~X1; + int t11 = X3 ^ t7; + X0 = t10 ^ t11; + X2 = t4 ^ (t10 | t11); + } + + /** + * S2 - { 8, 6, 7, 9, 3,12,10,15,13, 1,14, 4, 0,11, 5, 2 } - 16 terms. + */ + protected void Sb2(int a, int b, int c, int d) + { + int t1 = ~a; + int t2 = b ^ d; + int t3 = c & t1; + X0 = t2 ^ t3; + int t5 = c ^ t1; + int t6 = c ^ X0; + int t7 = b & t6; + X3 = t5 ^ t7; + X2 = a ^ ((d | t7) & (X0 | t5)); + X1 = (t2 ^ X3) ^ (X2 ^ (d | t1)); + } + + /** + * InvS2 - {12, 9,15, 4,11,14, 1, 2, 0, 3, 6,13, 5, 8,10, 7 } - 16 steps. + */ + protected void Ib2(int a, int b, int c, int d) + { + int t1 = b ^ d; + int t2 = ~t1; + int t3 = a ^ c; + int t4 = c ^ t1; + int t5 = b & t4; + X0 = t3 ^ t5; + int t7 = a | t2; + int t8 = d ^ t7; + int t9 = t3 | t8; + X3 = t1 ^ t9; + int t11 = ~t4; + int t12 = X0 | X3; + X1 = t11 ^ t12; + X2 = (d & t11) ^ (t3 ^ t12); + } + + /** + * S3 - { 0,15,11, 8,12, 9, 6, 3,13, 1, 2, 4,10, 7, 5,14 } - 16 terms. + */ + protected void Sb3(int a, int b, int c, int d) + { + int t1 = a ^ b; + int t2 = a & c; + int t3 = a | d; + int t4 = c ^ d; + int t5 = t1 & t3; + int t6 = t2 | t5; + X2 = t4 ^ t6; + int t8 = b ^ t3; + int t9 = t6 ^ t8; + int t10 = t4 & t9; + X0 = t1 ^ t10; + int t12 = X2 & X0; + X1 = t9 ^ t12; + X3 = (b | d) ^ (t4 ^ t12); + } + + /** + * InvS3 - { 0, 9,10, 7,11,14, 6,13, 3, 5,12, 2, 4, 8,15, 1 } - 15 terms + */ + protected void Ib3(int a, int b, int c, int d) + { + int t1 = a | b; + int t2 = b ^ c; + int t3 = b & t2; + int t4 = a ^ t3; + int t5 = c ^ t4; + int t6 = d | t4; + X0 = t2 ^ t6; + int t8 = t2 | t6; + int t9 = d ^ t8; + X2 = t5 ^ t9; + int t11 = t1 ^ t9; + int t12 = X0 & t11; + X3 = t4 ^ t12; + X1 = X3 ^ (X0 ^ t11); + } + + /** + * S4 - { 1,15, 8, 3,12, 0,11, 6, 2, 5, 4,10, 9,14, 7,13 } - 15 terms. + */ + protected void Sb4(int a, int b, int c, int d) + { + int t1 = a ^ d; + int t2 = d & t1; + int t3 = c ^ t2; + int t4 = b | t3; + X3 = t1 ^ t4; + int t6 = ~b; + int t7 = t1 | t6; + X0 = t3 ^ t7; + int t9 = a & X0; + int t10 = t1 ^ t6; + int t11 = t4 & t10; + X2 = t9 ^ t11; + X1 = (a ^ t3) ^ (t10 & X2); + } + + /** + * InvS4 - { 5, 0, 8, 3,10, 9, 7,14, 2,12,11, 6, 4,15,13, 1 } - 15 terms. + */ + protected void Ib4(int a, int b, int c, int d) + { + int t1 = c | d; + int t2 = a & t1; + int t3 = b ^ t2; + int t4 = a & t3; + int t5 = c ^ t4; + X1 = d ^ t5; + int t7 = ~a; + int t8 = t5 & X1; + X3 = t3 ^ t8; + int t10 = X1 | t7; + int t11 = d ^ t10; + X0 = X3 ^ t11; + X2 = (t3 & t11) ^ (X1 ^ t7); + } + + /** + * S5 - {15, 5, 2,11, 4,10, 9,12, 0, 3,14, 8,13, 6, 7, 1 } - 16 terms. + */ + protected void Sb5(int a, int b, int c, int d) + { + int t1 = ~a; + int t2 = a ^ b; + int t3 = a ^ d; + int t4 = c ^ t1; + int t5 = t2 | t3; + X0 = t4 ^ t5; + int t7 = d & X0; + int t8 = t2 ^ X0; + X1 = t7 ^ t8; + int t10 = t1 | X0; + int t11 = t2 | t7; + int t12 = t3 ^ t10; + X2 = t11 ^ t12; + X3 = (b ^ t7) ^ (X1 & t12); + } + + /** + * InvS5 - { 8,15, 2, 9, 4, 1,13,14,11, 6, 5, 3, 7,12,10, 0 } - 16 terms. + */ + protected void Ib5(int a, int b, int c, int d) + { + int t1 = ~c; + int t2 = b & t1; + int t3 = d ^ t2; + int t4 = a & t3; + int t5 = b ^ t1; + X3 = t4 ^ t5; + int t7 = b | X3; + int t8 = a & t7; + X1 = t3 ^ t8; + int t10 = a | d; + int t11 = t1 ^ t7; + X0 = t10 ^ t11; + X2 = (b & t10) ^ (t4 | (a ^ c)); + } + + /** + * S6 - { 7, 2,12, 5, 8, 4, 6,11,14, 9, 1,15,13, 3,10, 0 } - 15 terms. + */ + protected void Sb6(int a, int b, int c, int d) + { + int t1 = ~a; + int t2 = a ^ d; + int t3 = b ^ t2; + int t4 = t1 | t2; + int t5 = c ^ t4; + X1 = b ^ t5; + int t7 = t2 | X1; + int t8 = d ^ t7; + int t9 = t5 & t8; + X2 = t3 ^ t9; + int t11 = t5 ^ t8; + X0 = X2 ^ t11; + X3 = (~t5) ^ (t3 & t11); + } + + /** + * InvS6 - {15,10, 1,13, 5, 3, 6, 0, 4, 9,14, 7, 2,12, 8,11 } - 15 terms. + */ + protected void Ib6(int a, int b, int c, int d) + { + int t1 = ~a; + int t2 = a ^ b; + int t3 = c ^ t2; + int t4 = c | t1; + int t5 = d ^ t4; + X1 = t3 ^ t5; + int t7 = t3 & t5; + int t8 = t2 ^ t7; + int t9 = b | t8; + X3 = t5 ^ t9; + int t11 = b | X3; + X0 = t8 ^ t11; + X2 = (d & t1) ^ (t3 ^ t11); + } + + /** + * S7 - { 1,13,15, 0,14, 8, 2,11, 7, 4,12,10, 9, 3, 5, 6 } - 16 terms. + */ + protected void Sb7(int a, int b, int c, int d) + { + int t1 = b ^ c; + int t2 = c & t1; + int t3 = d ^ t2; + int t4 = a ^ t3; + int t5 = d | t1; + int t6 = t4 & t5; + X1 = b ^ t6; + int t8 = t3 | X1; + int t9 = a & t4; + X3 = t1 ^ t9; + int t11 = t4 ^ t8; + int t12 = X3 & t11; + X2 = t3 ^ t12; + X0 = (~t11) ^ (X3 & X2); + } + + /** + * InvS7 - { 3, 0, 6,13, 9,14,15, 8, 5,12,11, 7,10, 1, 4, 2 } - 17 terms. + */ + protected void Ib7(int a, int b, int c, int d) + { + int t3 = c | (a & b); + int t4 = d & (a | b); + X3 = t3 ^ t4; + int t6 = ~d; + int t7 = b ^ t4; + int t9 = t7 | (X3 ^ t6); + X1 = a ^ t9; + X0 = (c ^ t7) ^ (d | X1); + X2 = (t3 ^ X1) ^ (X0 ^ (a & X3)); + } + + /** + * Apply the linear transformation to the register set. + */ + protected void LT() + { + int x0 = RotateLeft(X0, 13); + int x2 = RotateLeft(X2, 3); + int x1 = X1 ^ x0 ^ x2; + int x3 = X3 ^ x2 ^ x0 << 3; + + X1 = RotateLeft(x1, 1); + X3 = RotateLeft(x3, 7); + X0 = RotateLeft(x0 ^ X1 ^ X3, 5); + X2 = RotateLeft(x2 ^ X3 ^ (X1 << 7), 22); + } + + /** + * Apply the inverse of the linear transformation to the register set. + */ + protected void InverseLT() + { + int x2 = RotateRight(X2, 22) ^ X3 ^ (X1 << 7); + int x0 = RotateRight(X0, 5) ^ X1 ^ X3; + int x3 = RotateRight(X3, 7); + int x1 = RotateRight(X1, 1); + X3 = x3 ^ x2 ^ x0 << 3; + X1 = x1 ^ x0 ^ x2; + X2 = RotateRight(x2, 3); + X0 = RotateRight(x0, 13); + } + + protected abstract int[] MakeWorkingKey(byte[] key); + + protected abstract void EncryptBlock(byte[] input, int inOff, byte[] output, int outOff); + + protected abstract void DecryptBlock(byte[] input, int inOff, byte[] output, int outOff); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngineBase.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngineBase.cs.meta new file mode 100644 index 00000000..047ea6b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SerpentEngineBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f164055e1ead4fa418746f4253a72692 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SkipjackEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SkipjackEngine.cs new file mode 100644 index 00000000..000161d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SkipjackEngine.cs @@ -0,0 +1,258 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * a class that provides a basic SKIPJACK engine. + */ + public class SkipjackEngine + : IBlockCipher + { + const int BLOCK_SIZE = 8; + + static readonly short [] ftable = + { + 0xa3, 0xd7, 0x09, 0x83, 0xf8, 0x48, 0xf6, 0xf4, 0xb3, 0x21, 0x15, 0x78, 0x99, 0xb1, 0xaf, 0xf9, + 0xe7, 0x2d, 0x4d, 0x8a, 0xce, 0x4c, 0xca, 0x2e, 0x52, 0x95, 0xd9, 0x1e, 0x4e, 0x38, 0x44, 0x28, + 0x0a, 0xdf, 0x02, 0xa0, 0x17, 0xf1, 0x60, 0x68, 0x12, 0xb7, 0x7a, 0xc3, 0xe9, 0xfa, 0x3d, 0x53, + 0x96, 0x84, 0x6b, 0xba, 0xf2, 0x63, 0x9a, 0x19, 0x7c, 0xae, 0xe5, 0xf5, 0xf7, 0x16, 0x6a, 0xa2, + 0x39, 0xb6, 0x7b, 0x0f, 0xc1, 0x93, 0x81, 0x1b, 0xee, 0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}; + + private int[] key0, key1, key2, key3; + private bool encrypting; + + /** + * initialise a SKIPJACK cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("invalid parameter passed to SKIPJACK init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + byte[] keyBytes = ((KeyParameter)parameters).GetKey(); + + this.encrypting = forEncryption; + this.key0 = new int[32]; + this.key1 = new int[32]; + this.key2 = new int[32]; + this.key3 = new int[32]; + + // + // expand the key to 128 bytes in 4 parts (saving us a modulo, multiply + // and an addition). + // + for (int i = 0; i < 32; i ++) + { + key0[i] = keyBytes[(i * 4) % 10] & 0xff; + key1[i] = keyBytes[(i * 4 + 1) % 10] & 0xff; + key2[i] = keyBytes[(i * 4 + 2) % 10] & 0xff; + key3[i] = keyBytes[(i * 4 + 3) % 10] & 0xff; + } + } + + public virtual string AlgorithmName + { + get { return "SKIPJACK"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (key1 == null) + throw new InvalidOperationException("SKIPJACK engine not initialised"); + + Check.DataLength(input, inOff, BLOCK_SIZE, "input buffer too short"); + Check.OutputLength(output, outOff, BLOCK_SIZE, "output buffer too short"); + + if (encrypting) + { + EncryptBlock(input, inOff, output, outOff); + } + else + { + DecryptBlock(input, inOff, output, outOff); + } + + return BLOCK_SIZE; + } + + public virtual void Reset() + { + } + + /** + * The G permutation + */ + private int G( + int k, + int w) + { + int g1, g2, g3, g4, g5, g6; + + g1 = (w >> 8) & 0xff; + g2 = w & 0xff; + + g3 = ftable[g2 ^ key0[k]] ^ g1; + g4 = ftable[g3 ^ key1[k]] ^ g2; + g5 = ftable[g4 ^ key2[k]] ^ g3; + g6 = ftable[g5 ^ key3[k]] ^ g4; + + return ((g5 << 8) + g6); + } + + public virtual int EncryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + int w1 = (input[inOff + 0] << 8) + (input[inOff + 1] & 0xff); + int w2 = (input[inOff + 2] << 8) + (input[inOff + 3] & 0xff); + int w3 = (input[inOff + 4] << 8) + (input[inOff + 5] & 0xff); + int w4 = (input[inOff + 6] << 8) + (input[inOff + 7] & 0xff); + + int k = 0; + + for (int t = 0; t < 2; t++) + { + for(int i = 0; i < 8; i++) + { + int tmp = w4; + w4 = w3; + w3 = w2; + w2 = G(k, w1); + w1 = w2 ^ tmp ^ (k + 1); + k++; + } + + for(int i = 0; i < 8; i++) + { + int tmp = w4; + w4 = w3; + w3 = w1 ^ w2 ^ (k + 1); + w2 = G(k, w1); + w1 = tmp; + k++; + } + } + + outBytes[outOff + 0] = (byte)((w1 >> 8)); + outBytes[outOff + 1] = (byte)(w1); + outBytes[outOff + 2] = (byte)((w2 >> 8)); + outBytes[outOff + 3] = (byte)(w2); + outBytes[outOff + 4] = (byte)((w3 >> 8)); + outBytes[outOff + 5] = (byte)(w3); + outBytes[outOff + 6] = (byte)((w4 >> 8)); + outBytes[outOff + 7] = (byte)(w4); + + return BLOCK_SIZE; + } + + /** + * the inverse of the G permutation. + */ + private int H( + int k, + int w) + { + int h1, h2, h3, h4, h5, h6; + + h1 = w & 0xff; + h2 = (w >> 8) & 0xff; + + h3 = ftable[h2 ^ key3[k]] ^ h1; + h4 = ftable[h3 ^ key2[k]] ^ h2; + h5 = ftable[h4 ^ key1[k]] ^ h3; + h6 = ftable[h5 ^ key0[k]] ^ h4; + + return ((h6 << 8) + h5); + } + + public virtual int DecryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + int w2 = (input[inOff + 0] << 8) + (input[inOff + 1] & 0xff); + int w1 = (input[inOff + 2] << 8) + (input[inOff + 3] & 0xff); + int w4 = (input[inOff + 4] << 8) + (input[inOff + 5] & 0xff); + int w3 = (input[inOff + 6] << 8) + (input[inOff + 7] & 0xff); + + int k = 31; + + for (int t = 0; t < 2; t++) + { + for(int i = 0; i < 8; i++) + { + int tmp = w4; + w4 = w3; + w3 = w2; + w2 = H(k, w1); + w1 = w2 ^ tmp ^ (k + 1); + k--; + } + + for(int i = 0; i < 8; i++) + { + int tmp = w4; + w4 = w3; + w3 = w1 ^ w2 ^ (k + 1); + w2 = H(k, w1); + w1 = tmp; + k--; + } + } + + outBytes[outOff + 0] = (byte)((w2 >> 8)); + outBytes[outOff + 1] = (byte)(w2); + outBytes[outOff + 2] = (byte)((w1 >> 8)); + outBytes[outOff + 3] = (byte)(w1); + outBytes[outOff + 4] = (byte)((w4 >> 8)); + outBytes[outOff + 5] = (byte)(w4); + outBytes[outOff + 6] = (byte)((w3 >> 8)); + outBytes[outOff + 7] = (byte)(w3); + + return BLOCK_SIZE; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SkipjackEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SkipjackEngine.cs.meta new file mode 100644 index 00000000..14ba4236 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/SkipjackEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee50d237d55d7f9409d3850b96c5a875 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TEAEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TEAEngine.cs new file mode 100644 index 00000000..71081aed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TEAEngine.cs @@ -0,0 +1,170 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * An TEA engine. + */ + public class TeaEngine + : IBlockCipher + { + private const int + rounds = 32, + block_size = 8; +// key_size = 16, + + private const uint + delta = 0x9E3779B9, + d_sum = 0xC6EF3720; // sum on decrypt + + /* + * the expanded key array of 4 subkeys + */ + private uint _a, _b, _c, _d; + private bool _initialised; + private bool _forEncryption; + + /** + * Create an instance of the TEA encryption algorithm + * and set some defaults + */ + public TeaEngine() + { + _initialised = false; + } + + public virtual string AlgorithmName + { + get { return "TEA"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return block_size; + } + + /** + * initialise + * + * @param forEncryption whether or not we are for encryption. + * @param params the parameters required to set up the cipher. + * @exception ArgumentException if the params argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + { + throw new ArgumentException("invalid parameter passed to TEA init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + + _forEncryption = forEncryption; + _initialised = true; + + KeyParameter p = (KeyParameter) parameters; + + setKey(p.GetKey()); + } + + public virtual int ProcessBlock( + byte[] inBytes, + int inOff, + byte[] outBytes, + int outOff) + { + if (!_initialised) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Check.DataLength(inBytes, inOff, block_size, "input buffer too short"); + Check.OutputLength(outBytes, outOff, block_size, "output buffer too short"); + + return _forEncryption + ? encryptBlock(inBytes, inOff, outBytes, outOff) + : decryptBlock(inBytes, inOff, outBytes, outOff); + } + + public virtual void Reset() + { + } + + /** + * Re-key the cipher. + * + * @param key the key to be used + */ + private void setKey( + byte[] key) + { + _a = Pack.BE_To_UInt32(key, 0); + _b = Pack.BE_To_UInt32(key, 4); + _c = Pack.BE_To_UInt32(key, 8); + _d = Pack.BE_To_UInt32(key, 12); + } + + private int encryptBlock( + byte[] inBytes, + int inOff, + byte[] outBytes, + int outOff) + { + // Pack bytes into integers + uint v0 = Pack.BE_To_UInt32(inBytes, inOff); + uint v1 = Pack.BE_To_UInt32(inBytes, inOff + 4); + + uint sum = 0; + + for (int i = 0; i != rounds; i++) + { + sum += delta; + v0 += ((v1 << 4) + _a) ^ (v1 + sum) ^ ((v1 >> 5) + _b); + v1 += ((v0 << 4) + _c) ^ (v0 + sum) ^ ((v0 >> 5) + _d); + } + + Pack.UInt32_To_BE(v0, outBytes, outOff); + Pack.UInt32_To_BE(v1, outBytes, outOff + 4); + + return block_size; + } + + private int decryptBlock( + byte[] inBytes, + int inOff, + byte[] outBytes, + int outOff) + { + // Pack bytes into integers + uint v0 = Pack.BE_To_UInt32(inBytes, inOff); + uint v1 = Pack.BE_To_UInt32(inBytes, inOff + 4); + + uint sum = d_sum; + + for (int i = 0; i != rounds; i++) + { + v1 -= ((v0 << 4) + _c) ^ (v0 + sum) ^ ((v0 >> 5) + _d); + v0 -= ((v1 << 4) + _a) ^ (v1 + sum) ^ ((v1 >> 5) + _b); + sum -= delta; + } + + Pack.UInt32_To_BE(v0, outBytes, outOff); + Pack.UInt32_To_BE(v1, outBytes, outOff + 4); + + return block_size; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TEAEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TEAEngine.cs.meta new file mode 100644 index 00000000..5f82aab8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TEAEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 35dd311c76c77164f9dd915b865c17d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ThreefishEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ThreefishEngine.cs new file mode 100644 index 00000000..9a672ae9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ThreefishEngine.cs @@ -0,0 +1,1495 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// + /// Implementation of the Threefish tweakable large block cipher in 256, 512 and 1024 bit block + /// sizes. + /// + /// + /// This is the 1.3 version of Threefish defined in the Skein hash function submission to the NIST + /// SHA-3 competition in October 2010. + ///

+ /// Threefish was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + /// Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. + ///

+ /// This implementation inlines all round functions, unrolls 8 rounds, and uses 1.2k of static tables + /// to speed up key schedule injection.
+ /// 2 x block size state is retained by each cipher instance. + /// + public class ThreefishEngine + : IBlockCipher + { + ///

+ /// 256 bit block size - Threefish-256 + /// + public const int BLOCKSIZE_256 = 256; + /// + /// 512 bit block size - Threefish-512 + /// + public const int BLOCKSIZE_512 = 512; + /// + /// 1024 bit block size - Threefish-1024 + /// + public const int BLOCKSIZE_1024 = 1024; + + /** + * Size of the tweak in bytes (always 128 bit/16 bytes) + */ + private const int TWEAK_SIZE_BYTES = 16; + private const int TWEAK_SIZE_WORDS = TWEAK_SIZE_BYTES / 8; + + /** + * Rounds in Threefish-256 + */ + private const int ROUNDS_256 = 72; + /** + * Rounds in Threefish-512 + */ + private const int ROUNDS_512 = 72; + /** + * Rounds in Threefish-1024 + */ + private const int ROUNDS_1024 = 80; + + /** + * Max rounds of any of the variants + */ + private const int MAX_ROUNDS = ROUNDS_1024; + + /** + * Key schedule parity constant + */ + private const ulong C_240 = 0x1BD11BDAA9FC1A22L; + + /* Pre-calculated modulo arithmetic tables for key schedule lookups */ + private static readonly int[] MOD9 = new int[MAX_ROUNDS]; + private static readonly int[] MOD17 = new int[MOD9.Length]; + private static readonly int[] MOD5 = new int[MOD9.Length]; + private static readonly int[] MOD3 = new int[MOD9.Length]; + + static ThreefishEngine() + { + for (int i = 0; i < MOD9.Length; i++) + { + MOD17[i] = i % 17; + MOD9[i] = i % 9; + MOD5[i] = i % 5; + MOD3[i] = i % 3; + } + } + + /** + * Block size in bytes + */ + private readonly int blocksizeBytes; + + /** + * Block size in 64 bit words + */ + private readonly int blocksizeWords; + + /** + * Buffer for byte oriented processBytes to call internal word API + */ + private readonly ulong[] currentBlock; + + /** + * Tweak bytes (2 byte t1,t2, calculated t3 and repeat of t1,t2 for modulo free lookup + */ + private readonly ulong[] t = new ulong[5]; + + /** + * Key schedule words + */ + private readonly ulong[] kw; + + /** + * The internal cipher implementation (varies by blocksize) + */ + private readonly ThreefishCipher cipher; + + private bool forEncryption; + + /// + /// Constructs a new Threefish cipher, with a specified block size. + /// + /// the block size in bits, one of , , + /// . + public ThreefishEngine(int blocksizeBits) + { + this.blocksizeBytes = (blocksizeBits / 8); + this.blocksizeWords = (this.blocksizeBytes / 8); + this.currentBlock = new ulong[blocksizeWords]; + + /* + * Provide room for original key words, extended key word and repeat of key words for modulo + * free lookup of key schedule words. + */ + this.kw = new ulong[2 * blocksizeWords + 1]; + + switch (blocksizeBits) + { + case BLOCKSIZE_256: + cipher = new Threefish256Cipher(kw, t); + break; + case BLOCKSIZE_512: + cipher = new Threefish512Cipher(kw, t); + break; + case BLOCKSIZE_1024: + cipher = new Threefish1024Cipher(kw, t); + break; + default: + throw new ArgumentException( + "Invalid blocksize - Threefish is defined with block size of 256, 512, or 1024 bits"); + } + } + + /// + /// Initialise the engine. + /// + /// Initialise for encryption if true, for decryption if false. + /// an instance of or (to + /// use a 0 tweak) + public virtual void Init(bool forEncryption, ICipherParameters parameters) + { + byte[] keyBytes; + byte[] tweakBytes; + + if (parameters is TweakableBlockCipherParameters) + { + TweakableBlockCipherParameters tParams = (TweakableBlockCipherParameters)parameters; + keyBytes = tParams.Key.GetKey(); + tweakBytes = tParams.Tweak; + } + else if (parameters is KeyParameter) + { + keyBytes = ((KeyParameter)parameters).GetKey(); + tweakBytes = null; + } + else + { + throw new ArgumentException("Invalid parameter passed to Threefish init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + + ulong[] keyWords = null; + ulong[] tweakWords = null; + + if (keyBytes != null) + { + if (keyBytes.Length != this.blocksizeBytes) + { + throw new ArgumentException("Threefish key must be same size as block (" + blocksizeBytes + + " bytes)"); + } + keyWords = new ulong[blocksizeWords]; + for (int i = 0; i < keyWords.Length; i++) + { + keyWords[i] = BytesToWord(keyBytes, i * 8); + } + } + if (tweakBytes != null) + { + if (tweakBytes.Length != TWEAK_SIZE_BYTES) + { + throw new ArgumentException("Threefish tweak must be " + TWEAK_SIZE_BYTES + " bytes"); + } + tweakWords = new ulong[]{BytesToWord(tweakBytes, 0), BytesToWord(tweakBytes, 8)}; + } + Init(forEncryption, keyWords, tweakWords); + } + + /// + /// Initialise the engine, specifying the key and tweak directly. + /// + /// the cipher mode. + /// the words of the key, or null to use the current key. + /// the 2 word (128 bit) tweak, or null to use the current tweak. + internal void Init(bool forEncryption, ulong[] key, ulong[] tweak) + { + this.forEncryption = forEncryption; + if (key != null) + { + SetKey(key); + } + if (tweak != null) + { + SetTweak(tweak); + } + } + + private void SetKey(ulong[] key) + { + if (key.Length != this.blocksizeWords) + { + throw new ArgumentException("Threefish key must be same size as block (" + blocksizeWords + + " words)"); + } + + /* + * Full subkey schedule is deferred to execution to avoid per cipher overhead (10k for 512, + * 20k for 1024). + * + * Key and tweak word sequences are repeated, and static MOD17/MOD9/MOD5/MOD3 calculations + * used, to avoid expensive mod computations during cipher operation. + */ + + ulong knw = C_240; + for (int i = 0; i < blocksizeWords; i++) + { + kw[i] = key[i]; + knw = knw ^ kw[i]; + } + kw[blocksizeWords] = knw; + Array.Copy(kw, 0, kw, blocksizeWords + 1, blocksizeWords); + } + + private void SetTweak(ulong[] tweak) + { + if (tweak.Length != TWEAK_SIZE_WORDS) + { + throw new ArgumentException("Tweak must be " + TWEAK_SIZE_WORDS + " words."); + } + + /* + * Tweak schedule partially repeated to avoid mod computations during cipher operation + */ + t[0] = tweak[0]; + t[1] = tweak[1]; + t[2] = t[0] ^ t[1]; + t[3] = t[0]; + t[4] = t[1]; + } + + public virtual string AlgorithmName + { + get { return "Threefish-" + (blocksizeBytes * 8); } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return blocksizeBytes; + } + + public virtual void Reset() + { + } + + public virtual int ProcessBlock(byte[] inBytes, int inOff, byte[] outBytes, int outOff) + { + if ((outOff + blocksizeBytes) > outBytes.Length) + { + throw new DataLengthException("Output buffer too short"); + } + + if ((inOff + blocksizeBytes) > inBytes.Length) + { + throw new DataLengthException("Input buffer too short"); + } + + for (int i = 0; i < blocksizeBytes; i += 8) + { + currentBlock[i >> 3] = BytesToWord(inBytes, inOff + i); + } + ProcessBlock(this.currentBlock, this.currentBlock); + for (int i = 0; i < blocksizeBytes; i += 8) + { + WordToBytes(this.currentBlock[i >> 3], outBytes, outOff + i); + } + + return blocksizeBytes; + } + + /// + /// Process a block of data represented as 64 bit words. + /// + /// the number of 8 byte words processed (which will be the same as the block size). + /// a block sized buffer of words to process. + /// a block sized buffer of words to receive the output of the operation. + /// if either the input or output is not block sized + /// if this engine is not initialised + internal int ProcessBlock(ulong[] inWords, ulong[] outWords) + { + if (kw[blocksizeWords] == 0) + { + throw new InvalidOperationException("Threefish engine not initialised"); + } + + if (inWords.Length != blocksizeWords) + { + throw new DataLengthException("Input buffer too short"); + } + if (outWords.Length != blocksizeWords) + { + throw new DataLengthException("Output buffer too short"); + } + + if (forEncryption) + { + cipher.EncryptBlock(inWords, outWords); + } + else + { + cipher.DecryptBlock(inWords, outWords); + } + + return blocksizeWords; + } + + /// + /// Read a single 64 bit word from input in LSB first order. + /// + internal static ulong BytesToWord(byte[] bytes, int off) + { + if ((off + 8) > bytes.Length) + { + // Help the JIT avoid index checks + throw new ArgumentException(); + } + + ulong word = 0; + int index = off; + + word = (bytes[index++] & 0xffUL); + word |= (bytes[index++] & 0xffUL) << 8; + word |= (bytes[index++] & 0xffUL) << 16; + word |= (bytes[index++] & 0xffUL) << 24; + word |= (bytes[index++] & 0xffUL) << 32; + word |= (bytes[index++] & 0xffUL) << 40; + word |= (bytes[index++] & 0xffUL) << 48; + word |= (bytes[index++] & 0xffUL) << 56; + + return word; + } + + /// + /// Write a 64 bit word to output in LSB first order. + /// + internal static void WordToBytes(ulong word, byte[] bytes, int off) + { + if ((off + 8) > bytes.Length) + { + // Help the JIT avoid index checks + throw new ArgumentException(); + } + int index = off; + + bytes[index++] = (byte)word; + bytes[index++] = (byte)(word >> 8); + bytes[index++] = (byte)(word >> 16); + bytes[index++] = (byte)(word >> 24); + bytes[index++] = (byte)(word >> 32); + bytes[index++] = (byte)(word >> 40); + bytes[index++] = (byte)(word >> 48); + bytes[index++] = (byte)(word >> 56); + } + + /** + * Rotate left + xor part of the mix operation. + */ + private static ulong RotlXor(ulong x, int n, ulong xor) + { + return ((x << n) | (x >> (64 - n))) ^ xor; + } + + /** + * Rotate xor + rotate right part of the unmix operation. + */ + private static ulong XorRotr(ulong x, int n, ulong xor) + { + ulong xored = x ^ xor; + return (xored >> n) | (xored << (64 - n)); + } + + private abstract class ThreefishCipher + { + /** + * The extended + repeated tweak words + */ + protected readonly ulong[] t; + /** + * The extended + repeated key words + */ + protected readonly ulong[] kw; + + protected ThreefishCipher(ulong[] kw, ulong[] t) + { + this.kw = kw; + this.t = t; + } + + internal abstract void EncryptBlock(ulong[] block, ulong[] outWords); + + internal abstract void DecryptBlock(ulong[] block, ulong[] outWords); + + } + + private sealed class Threefish256Cipher + : ThreefishCipher + { + /** + * Mix rotation constants defined in Skein 1.3 specification + */ + private const int ROTATION_0_0 = 14, ROTATION_0_1 = 16; + private const int ROTATION_1_0 = 52, ROTATION_1_1 = 57; + private const int ROTATION_2_0 = 23, ROTATION_2_1 = 40; + private const int ROTATION_3_0 = 5, ROTATION_3_1 = 37; + + private const int ROTATION_4_0 = 25, ROTATION_4_1 = 33; + private const int ROTATION_5_0 = 46, ROTATION_5_1 = 12; + private const int ROTATION_6_0 = 58, ROTATION_6_1 = 22; + private const int ROTATION_7_0 = 32, ROTATION_7_1 = 32; + + public Threefish256Cipher(ulong[] kw, ulong[] t) + : base(kw, t) + { + } + + internal override void EncryptBlock(ulong[] block, ulong[] outWords) + { + ulong[] kw = this.kw; + ulong[] t = this.t; + int[] mod5 = MOD5; + int[] mod3 = MOD3; + + /* Help the JIT avoid index bounds checks */ + if (kw.Length != 9) + { + throw new ArgumentException(); + } + if (t.Length != 5) + { + throw new ArgumentException(); + } + + /* + * Read 4 words of plaintext data, not using arrays for cipher state + */ + ulong b0 = block[0]; + ulong b1 = block[1]; + ulong b2 = block[2]; + ulong b3 = block[3]; + + /* + * First subkey injection. + */ + b0 += kw[0]; + b1 += kw[1] + t[0]; + b2 += kw[2] + t[1]; + b3 += kw[3]; + + /* + * Rounds loop, unrolled to 8 rounds per iteration. + * + * Unrolling to multiples of 4 avoids the mod 4 check for key injection, and allows + * inlining of the permutations, which cycle every of 2 rounds (avoiding array + * index/lookup). + * + * Unrolling to multiples of 8 avoids the mod 8 rotation constant lookup, and allows + * inlining constant rotation values (avoiding array index/lookup). + */ + + for (int d = 1; d < (ROUNDS_256 / 4); d += 2) + { + int dm5 = mod5[d]; + int dm3 = mod3[d]; + + /* + * 4 rounds of mix and permute. + * + * Permute schedule has a 2 round cycle, so permutes are inlined in the mix + * operations in each 4 round block. + */ + b1 = RotlXor(b1, ROTATION_0_0, b0 += b1); + b3 = RotlXor(b3, ROTATION_0_1, b2 += b3); + + b3 = RotlXor(b3, ROTATION_1_0, b0 += b3); + b1 = RotlXor(b1, ROTATION_1_1, b2 += b1); + + b1 = RotlXor(b1, ROTATION_2_0, b0 += b1); + b3 = RotlXor(b3, ROTATION_2_1, b2 += b3); + + b3 = RotlXor(b3, ROTATION_3_0, b0 += b3); + b1 = RotlXor(b1, ROTATION_3_1, b2 += b1); + + /* + * Subkey injection for first 4 rounds. + */ + b0 += kw[dm5]; + b1 += kw[dm5 + 1] + t[dm3]; + b2 += kw[dm5 + 2] + t[dm3 + 1]; + b3 += kw[dm5 + 3] + (uint)d; + + /* + * 4 more rounds of mix/permute + */ + b1 = RotlXor(b1, ROTATION_4_0, b0 += b1); + b3 = RotlXor(b3, ROTATION_4_1, b2 += b3); + + b3 = RotlXor(b3, ROTATION_5_0, b0 += b3); + b1 = RotlXor(b1, ROTATION_5_1, b2 += b1); + + b1 = RotlXor(b1, ROTATION_6_0, b0 += b1); + b3 = RotlXor(b3, ROTATION_6_1, b2 += b3); + + b3 = RotlXor(b3, ROTATION_7_0, b0 += b3); + b1 = RotlXor(b1, ROTATION_7_1, b2 += b1); + + /* + * Subkey injection for next 4 rounds. + */ + b0 += kw[dm5 + 1]; + b1 += kw[dm5 + 2] + t[dm3 + 1]; + b2 += kw[dm5 + 3] + t[dm3 + 2]; + b3 += kw[dm5 + 4] + (uint)d + 1; + } + + /* + * Output cipher state. + */ + outWords[0] = b0; + outWords[1] = b1; + outWords[2] = b2; + outWords[3] = b3; + } + + internal override void DecryptBlock(ulong[] block, ulong[] state) + { + ulong[] kw = this.kw; + ulong[] t = this.t; + int[] mod5 = MOD5; + int[] mod3 = MOD3; + + /* Help the JIT avoid index bounds checks */ + if (kw.Length != 9) + { + throw new ArgumentException(); + } + if (t.Length != 5) + { + throw new ArgumentException(); + } + + ulong b0 = block[0]; + ulong b1 = block[1]; + ulong b2 = block[2]; + ulong b3 = block[3]; + + for (int d = (ROUNDS_256 / 4) - 1; d >= 1; d -= 2) + { + int dm5 = mod5[d]; + int dm3 = mod3[d]; + + /* Reverse key injection for second 4 rounds */ + b0 -= kw[dm5 + 1]; + b1 -= kw[dm5 + 2] + t[dm3 + 1]; + b2 -= kw[dm5 + 3] + t[dm3 + 2]; + b3 -= kw[dm5 + 4] + (uint)d + 1; + + /* Reverse second 4 mix/permute rounds */ + + b3 = XorRotr(b3, ROTATION_7_0, b0); + b0 -= b3; + b1 = XorRotr(b1, ROTATION_7_1, b2); + b2 -= b1; + + b1 = XorRotr(b1, ROTATION_6_0, b0); + b0 -= b1; + b3 = XorRotr(b3, ROTATION_6_1, b2); + b2 -= b3; + + b3 = XorRotr(b3, ROTATION_5_0, b0); + b0 -= b3; + b1 = XorRotr(b1, ROTATION_5_1, b2); + b2 -= b1; + + b1 = XorRotr(b1, ROTATION_4_0, b0); + b0 -= b1; + b3 = XorRotr(b3, ROTATION_4_1, b2); + b2 -= b3; + + /* Reverse key injection for first 4 rounds */ + b0 -= kw[dm5]; + b1 -= kw[dm5 + 1] + t[dm3]; + b2 -= kw[dm5 + 2] + t[dm3 + 1]; + b3 -= kw[dm5 + 3] + (uint)d; + + /* Reverse first 4 mix/permute rounds */ + b3 = XorRotr(b3, ROTATION_3_0, b0); + b0 -= b3; + b1 = XorRotr(b1, ROTATION_3_1, b2); + b2 -= b1; + + b1 = XorRotr(b1, ROTATION_2_0, b0); + b0 -= b1; + b3 = XorRotr(b3, ROTATION_2_1, b2); + b2 -= b3; + + b3 = XorRotr(b3, ROTATION_1_0, b0); + b0 -= b3; + b1 = XorRotr(b1, ROTATION_1_1, b2); + b2 -= b1; + + b1 = XorRotr(b1, ROTATION_0_0, b0); + b0 -= b1; + b3 = XorRotr(b3, ROTATION_0_1, b2); + b2 -= b3; + } + + /* + * First subkey uninjection. + */ + b0 -= kw[0]; + b1 -= kw[1] + t[0]; + b2 -= kw[2] + t[1]; + b3 -= kw[3]; + + /* + * Output cipher state. + */ + state[0] = b0; + state[1] = b1; + state[2] = b2; + state[3] = b3; + } + + } + + private sealed class Threefish512Cipher + : ThreefishCipher + { + /** + * Mix rotation constants defined in Skein 1.3 specification + */ + private const int ROTATION_0_0 = 46, ROTATION_0_1 = 36, ROTATION_0_2 = 19, ROTATION_0_3 = 37; + private const int ROTATION_1_0 = 33, ROTATION_1_1 = 27, ROTATION_1_2 = 14, ROTATION_1_3 = 42; + private const int ROTATION_2_0 = 17, ROTATION_2_1 = 49, ROTATION_2_2 = 36, ROTATION_2_3 = 39; + private const int ROTATION_3_0 = 44, ROTATION_3_1 = 9, ROTATION_3_2 = 54, ROTATION_3_3 = 56; + + private const int ROTATION_4_0 = 39, ROTATION_4_1 = 30, ROTATION_4_2 = 34, ROTATION_4_3 = 24; + private const int ROTATION_5_0 = 13, ROTATION_5_1 = 50, ROTATION_5_2 = 10, ROTATION_5_3 = 17; + private const int ROTATION_6_0 = 25, ROTATION_6_1 = 29, ROTATION_6_2 = 39, ROTATION_6_3 = 43; + private const int ROTATION_7_0 = 8, ROTATION_7_1 = 35, ROTATION_7_2 = 56, ROTATION_7_3 = 22; + + internal Threefish512Cipher(ulong[] kw, ulong[] t) + : base(kw, t) + { + } + + internal override void EncryptBlock(ulong[] block, ulong[] outWords) + { + ulong[] kw = this.kw; + ulong[] t = this.t; + int[] mod9 = MOD9; + int[] mod3 = MOD3; + + /* Help the JIT avoid index bounds checks */ + if (kw.Length != 17) + { + throw new ArgumentException(); + } + if (t.Length != 5) + { + throw new ArgumentException(); + } + + /* + * Read 8 words of plaintext data, not using arrays for cipher state + */ + ulong b0 = block[0]; + ulong b1 = block[1]; + ulong b2 = block[2]; + ulong b3 = block[3]; + ulong b4 = block[4]; + ulong b5 = block[5]; + ulong b6 = block[6]; + ulong b7 = block[7]; + + /* + * First subkey injection. + */ + b0 += kw[0]; + b1 += kw[1]; + b2 += kw[2]; + b3 += kw[3]; + b4 += kw[4]; + b5 += kw[5] + t[0]; + b6 += kw[6] + t[1]; + b7 += kw[7]; + + /* + * Rounds loop, unrolled to 8 rounds per iteration. + * + * Unrolling to multiples of 4 avoids the mod 4 check for key injection, and allows + * inlining of the permutations, which cycle every of 4 rounds (avoiding array + * index/lookup). + * + * Unrolling to multiples of 8 avoids the mod 8 rotation constant lookup, and allows + * inlining constant rotation values (avoiding array index/lookup). + */ + + for (int d = 1; d < (ROUNDS_512 / 4); d += 2) + { + int dm9 = mod9[d]; + int dm3 = mod3[d]; + + /* + * 4 rounds of mix and permute. + * + * Permute schedule has a 4 round cycle, so permutes are inlined in the mix + * operations in each 4 round block. + */ + b1 = RotlXor(b1, ROTATION_0_0, b0 += b1); + b3 = RotlXor(b3, ROTATION_0_1, b2 += b3); + b5 = RotlXor(b5, ROTATION_0_2, b4 += b5); + b7 = RotlXor(b7, ROTATION_0_3, b6 += b7); + + b1 = RotlXor(b1, ROTATION_1_0, b2 += b1); + b7 = RotlXor(b7, ROTATION_1_1, b4 += b7); + b5 = RotlXor(b5, ROTATION_1_2, b6 += b5); + b3 = RotlXor(b3, ROTATION_1_3, b0 += b3); + + b1 = RotlXor(b1, ROTATION_2_0, b4 += b1); + b3 = RotlXor(b3, ROTATION_2_1, b6 += b3); + b5 = RotlXor(b5, ROTATION_2_2, b0 += b5); + b7 = RotlXor(b7, ROTATION_2_3, b2 += b7); + + b1 = RotlXor(b1, ROTATION_3_0, b6 += b1); + b7 = RotlXor(b7, ROTATION_3_1, b0 += b7); + b5 = RotlXor(b5, ROTATION_3_2, b2 += b5); + b3 = RotlXor(b3, ROTATION_3_3, b4 += b3); + + /* + * Subkey injection for first 4 rounds. + */ + b0 += kw[dm9]; + b1 += kw[dm9 + 1]; + b2 += kw[dm9 + 2]; + b3 += kw[dm9 + 3]; + b4 += kw[dm9 + 4]; + b5 += kw[dm9 + 5] + t[dm3]; + b6 += kw[dm9 + 6] + t[dm3 + 1]; + b7 += kw[dm9 + 7] + (uint)d; + + /* + * 4 more rounds of mix/permute + */ + b1 = RotlXor(b1, ROTATION_4_0, b0 += b1); + b3 = RotlXor(b3, ROTATION_4_1, b2 += b3); + b5 = RotlXor(b5, ROTATION_4_2, b4 += b5); + b7 = RotlXor(b7, ROTATION_4_3, b6 += b7); + + b1 = RotlXor(b1, ROTATION_5_0, b2 += b1); + b7 = RotlXor(b7, ROTATION_5_1, b4 += b7); + b5 = RotlXor(b5, ROTATION_5_2, b6 += b5); + b3 = RotlXor(b3, ROTATION_5_3, b0 += b3); + + b1 = RotlXor(b1, ROTATION_6_0, b4 += b1); + b3 = RotlXor(b3, ROTATION_6_1, b6 += b3); + b5 = RotlXor(b5, ROTATION_6_2, b0 += b5); + b7 = RotlXor(b7, ROTATION_6_3, b2 += b7); + + b1 = RotlXor(b1, ROTATION_7_0, b6 += b1); + b7 = RotlXor(b7, ROTATION_7_1, b0 += b7); + b5 = RotlXor(b5, ROTATION_7_2, b2 += b5); + b3 = RotlXor(b3, ROTATION_7_3, b4 += b3); + + /* + * Subkey injection for next 4 rounds. + */ + b0 += kw[dm9 + 1]; + b1 += kw[dm9 + 2]; + b2 += kw[dm9 + 3]; + b3 += kw[dm9 + 4]; + b4 += kw[dm9 + 5]; + b5 += kw[dm9 + 6] + t[dm3 + 1]; + b6 += kw[dm9 + 7] + t[dm3 + 2]; + b7 += kw[dm9 + 8] + (uint)d + 1; + } + + /* + * Output cipher state. + */ + outWords[0] = b0; + outWords[1] = b1; + outWords[2] = b2; + outWords[3] = b3; + outWords[4] = b4; + outWords[5] = b5; + outWords[6] = b6; + outWords[7] = b7; + } + + internal override void DecryptBlock(ulong[] block, ulong[] state) + { + ulong[] kw = this.kw; + ulong[] t = this.t; + int[] mod9 = MOD9; + int[] mod3 = MOD3; + + /* Help the JIT avoid index bounds checks */ + if (kw.Length != 17) + { + throw new ArgumentException(); + } + if (t.Length != 5) + { + throw new ArgumentException(); + } + + ulong b0 = block[0]; + ulong b1 = block[1]; + ulong b2 = block[2]; + ulong b3 = block[3]; + ulong b4 = block[4]; + ulong b5 = block[5]; + ulong b6 = block[6]; + ulong b7 = block[7]; + + for (int d = (ROUNDS_512 / 4) - 1; d >= 1; d -= 2) + { + int dm9 = mod9[d]; + int dm3 = mod3[d]; + + /* Reverse key injection for second 4 rounds */ + b0 -= kw[dm9 + 1]; + b1 -= kw[dm9 + 2]; + b2 -= kw[dm9 + 3]; + b3 -= kw[dm9 + 4]; + b4 -= kw[dm9 + 5]; + b5 -= kw[dm9 + 6] + t[dm3 + 1]; + b6 -= kw[dm9 + 7] + t[dm3 + 2]; + b7 -= kw[dm9 + 8] + (uint)d + 1; + + /* Reverse second 4 mix/permute rounds */ + + b1 = XorRotr(b1, ROTATION_7_0, b6); + b6 -= b1; + b7 = XorRotr(b7, ROTATION_7_1, b0); + b0 -= b7; + b5 = XorRotr(b5, ROTATION_7_2, b2); + b2 -= b5; + b3 = XorRotr(b3, ROTATION_7_3, b4); + b4 -= b3; + + b1 = XorRotr(b1, ROTATION_6_0, b4); + b4 -= b1; + b3 = XorRotr(b3, ROTATION_6_1, b6); + b6 -= b3; + b5 = XorRotr(b5, ROTATION_6_2, b0); + b0 -= b5; + b7 = XorRotr(b7, ROTATION_6_3, b2); + b2 -= b7; + + b1 = XorRotr(b1, ROTATION_5_0, b2); + b2 -= b1; + b7 = XorRotr(b7, ROTATION_5_1, b4); + b4 -= b7; + b5 = XorRotr(b5, ROTATION_5_2, b6); + b6 -= b5; + b3 = XorRotr(b3, ROTATION_5_3, b0); + b0 -= b3; + + b1 = XorRotr(b1, ROTATION_4_0, b0); + b0 -= b1; + b3 = XorRotr(b3, ROTATION_4_1, b2); + b2 -= b3; + b5 = XorRotr(b5, ROTATION_4_2, b4); + b4 -= b5; + b7 = XorRotr(b7, ROTATION_4_3, b6); + b6 -= b7; + + /* Reverse key injection for first 4 rounds */ + b0 -= kw[dm9]; + b1 -= kw[dm9 + 1]; + b2 -= kw[dm9 + 2]; + b3 -= kw[dm9 + 3]; + b4 -= kw[dm9 + 4]; + b5 -= kw[dm9 + 5] + t[dm3]; + b6 -= kw[dm9 + 6] + t[dm3 + 1]; + b7 -= kw[dm9 + 7] + (uint)d; + + /* Reverse first 4 mix/permute rounds */ + b1 = XorRotr(b1, ROTATION_3_0, b6); + b6 -= b1; + b7 = XorRotr(b7, ROTATION_3_1, b0); + b0 -= b7; + b5 = XorRotr(b5, ROTATION_3_2, b2); + b2 -= b5; + b3 = XorRotr(b3, ROTATION_3_3, b4); + b4 -= b3; + + b1 = XorRotr(b1, ROTATION_2_0, b4); + b4 -= b1; + b3 = XorRotr(b3, ROTATION_2_1, b6); + b6 -= b3; + b5 = XorRotr(b5, ROTATION_2_2, b0); + b0 -= b5; + b7 = XorRotr(b7, ROTATION_2_3, b2); + b2 -= b7; + + b1 = XorRotr(b1, ROTATION_1_0, b2); + b2 -= b1; + b7 = XorRotr(b7, ROTATION_1_1, b4); + b4 -= b7; + b5 = XorRotr(b5, ROTATION_1_2, b6); + b6 -= b5; + b3 = XorRotr(b3, ROTATION_1_3, b0); + b0 -= b3; + + b1 = XorRotr(b1, ROTATION_0_0, b0); + b0 -= b1; + b3 = XorRotr(b3, ROTATION_0_1, b2); + b2 -= b3; + b5 = XorRotr(b5, ROTATION_0_2, b4); + b4 -= b5; + b7 = XorRotr(b7, ROTATION_0_3, b6); + b6 -= b7; + } + + /* + * First subkey uninjection. + */ + b0 -= kw[0]; + b1 -= kw[1]; + b2 -= kw[2]; + b3 -= kw[3]; + b4 -= kw[4]; + b5 -= kw[5] + t[0]; + b6 -= kw[6] + t[1]; + b7 -= kw[7]; + + /* + * Output cipher state. + */ + state[0] = b0; + state[1] = b1; + state[2] = b2; + state[3] = b3; + state[4] = b4; + state[5] = b5; + state[6] = b6; + state[7] = b7; + } + } + + private sealed class Threefish1024Cipher + : ThreefishCipher + { + /** + * Mix rotation constants defined in Skein 1.3 specification + */ + private const int ROTATION_0_0 = 24, ROTATION_0_1 = 13, ROTATION_0_2 = 8, ROTATION_0_3 = 47; + private const int ROTATION_0_4 = 8, ROTATION_0_5 = 17, ROTATION_0_6 = 22, ROTATION_0_7 = 37; + private const int ROTATION_1_0 = 38, ROTATION_1_1 = 19, ROTATION_1_2 = 10, ROTATION_1_3 = 55; + private const int ROTATION_1_4 = 49, ROTATION_1_5 = 18, ROTATION_1_6 = 23, ROTATION_1_7 = 52; + private const int ROTATION_2_0 = 33, ROTATION_2_1 = 4, ROTATION_2_2 = 51, ROTATION_2_3 = 13; + private const int ROTATION_2_4 = 34, ROTATION_2_5 = 41, ROTATION_2_6 = 59, ROTATION_2_7 = 17; + private const int ROTATION_3_0 = 5, ROTATION_3_1 = 20, ROTATION_3_2 = 48, ROTATION_3_3 = 41; + private const int ROTATION_3_4 = 47, ROTATION_3_5 = 28, ROTATION_3_6 = 16, ROTATION_3_7 = 25; + + private const int ROTATION_4_0 = 41, ROTATION_4_1 = 9, ROTATION_4_2 = 37, ROTATION_4_3 = 31; + private const int ROTATION_4_4 = 12, ROTATION_4_5 = 47, ROTATION_4_6 = 44, ROTATION_4_7 = 30; + private const int ROTATION_5_0 = 16, ROTATION_5_1 = 34, ROTATION_5_2 = 56, ROTATION_5_3 = 51; + private const int ROTATION_5_4 = 4, ROTATION_5_5 = 53, ROTATION_5_6 = 42, ROTATION_5_7 = 41; + private const int ROTATION_6_0 = 31, ROTATION_6_1 = 44, ROTATION_6_2 = 47, ROTATION_6_3 = 46; + private const int ROTATION_6_4 = 19, ROTATION_6_5 = 42, ROTATION_6_6 = 44, ROTATION_6_7 = 25; + private const int ROTATION_7_0 = 9, ROTATION_7_1 = 48, ROTATION_7_2 = 35, ROTATION_7_3 = 52; + private const int ROTATION_7_4 = 23, ROTATION_7_5 = 31, ROTATION_7_6 = 37, ROTATION_7_7 = 20; + + public Threefish1024Cipher(ulong[] kw, ulong[] t) + : base(kw, t) + { + } + + internal override void EncryptBlock(ulong[] block, ulong[] outWords) + { + ulong[] kw = this.kw; + ulong[] t = this.t; + int[] mod17 = MOD17; + int[] mod3 = MOD3; + + /* Help the JIT avoid index bounds checks */ + if (kw.Length != 33) + { + throw new ArgumentException(); + } + if (t.Length != 5) + { + throw new ArgumentException(); + } + + /* + * Read 16 words of plaintext data, not using arrays for cipher state + */ + ulong b0 = block[0]; + ulong b1 = block[1]; + ulong b2 = block[2]; + ulong b3 = block[3]; + ulong b4 = block[4]; + ulong b5 = block[5]; + ulong b6 = block[6]; + ulong b7 = block[7]; + ulong b8 = block[8]; + ulong b9 = block[9]; + ulong b10 = block[10]; + ulong b11 = block[11]; + ulong b12 = block[12]; + ulong b13 = block[13]; + ulong b14 = block[14]; + ulong b15 = block[15]; + + /* + * First subkey injection. + */ + b0 += kw[0]; + b1 += kw[1]; + b2 += kw[2]; + b3 += kw[3]; + b4 += kw[4]; + b5 += kw[5]; + b6 += kw[6]; + b7 += kw[7]; + b8 += kw[8]; + b9 += kw[9]; + b10 += kw[10]; + b11 += kw[11]; + b12 += kw[12]; + b13 += kw[13] + t[0]; + b14 += kw[14] + t[1]; + b15 += kw[15]; + + /* + * Rounds loop, unrolled to 8 rounds per iteration. + * + * Unrolling to multiples of 4 avoids the mod 4 check for key injection, and allows + * inlining of the permutations, which cycle every of 4 rounds (avoiding array + * index/lookup). + * + * Unrolling to multiples of 8 avoids the mod 8 rotation constant lookup, and allows + * inlining constant rotation values (avoiding array index/lookup). + */ + + for (int d = 1; d < (ROUNDS_1024 / 4); d += 2) + { + int dm17 = mod17[d]; + int dm3 = mod3[d]; + + /* + * 4 rounds of mix and permute. + * + * Permute schedule has a 4 round cycle, so permutes are inlined in the mix + * operations in each 4 round block. + */ + b1 = RotlXor(b1, ROTATION_0_0, b0 += b1); + b3 = RotlXor(b3, ROTATION_0_1, b2 += b3); + b5 = RotlXor(b5, ROTATION_0_2, b4 += b5); + b7 = RotlXor(b7, ROTATION_0_3, b6 += b7); + b9 = RotlXor(b9, ROTATION_0_4, b8 += b9); + b11 = RotlXor(b11, ROTATION_0_5, b10 += b11); + b13 = RotlXor(b13, ROTATION_0_6, b12 += b13); + b15 = RotlXor(b15, ROTATION_0_7, b14 += b15); + + b9 = RotlXor(b9, ROTATION_1_0, b0 += b9); + b13 = RotlXor(b13, ROTATION_1_1, b2 += b13); + b11 = RotlXor(b11, ROTATION_1_2, b6 += b11); + b15 = RotlXor(b15, ROTATION_1_3, b4 += b15); + b7 = RotlXor(b7, ROTATION_1_4, b10 += b7); + b3 = RotlXor(b3, ROTATION_1_5, b12 += b3); + b5 = RotlXor(b5, ROTATION_1_6, b14 += b5); + b1 = RotlXor(b1, ROTATION_1_7, b8 += b1); + + b7 = RotlXor(b7, ROTATION_2_0, b0 += b7); + b5 = RotlXor(b5, ROTATION_2_1, b2 += b5); + b3 = RotlXor(b3, ROTATION_2_2, b4 += b3); + b1 = RotlXor(b1, ROTATION_2_3, b6 += b1); + b15 = RotlXor(b15, ROTATION_2_4, b12 += b15); + b13 = RotlXor(b13, ROTATION_2_5, b14 += b13); + b11 = RotlXor(b11, ROTATION_2_6, b8 += b11); + b9 = RotlXor(b9, ROTATION_2_7, b10 += b9); + + b15 = RotlXor(b15, ROTATION_3_0, b0 += b15); + b11 = RotlXor(b11, ROTATION_3_1, b2 += b11); + b13 = RotlXor(b13, ROTATION_3_2, b6 += b13); + b9 = RotlXor(b9, ROTATION_3_3, b4 += b9); + b1 = RotlXor(b1, ROTATION_3_4, b14 += b1); + b5 = RotlXor(b5, ROTATION_3_5, b8 += b5); + b3 = RotlXor(b3, ROTATION_3_6, b10 += b3); + b7 = RotlXor(b7, ROTATION_3_7, b12 += b7); + + /* + * Subkey injection for first 4 rounds. + */ + b0 += kw[dm17]; + b1 += kw[dm17 + 1]; + b2 += kw[dm17 + 2]; + b3 += kw[dm17 + 3]; + b4 += kw[dm17 + 4]; + b5 += kw[dm17 + 5]; + b6 += kw[dm17 + 6]; + b7 += kw[dm17 + 7]; + b8 += kw[dm17 + 8]; + b9 += kw[dm17 + 9]; + b10 += kw[dm17 + 10]; + b11 += kw[dm17 + 11]; + b12 += kw[dm17 + 12]; + b13 += kw[dm17 + 13] + t[dm3]; + b14 += kw[dm17 + 14] + t[dm3 + 1]; + b15 += kw[dm17 + 15] + (uint)d; + + /* + * 4 more rounds of mix/permute + */ + b1 = RotlXor(b1, ROTATION_4_0, b0 += b1); + b3 = RotlXor(b3, ROTATION_4_1, b2 += b3); + b5 = RotlXor(b5, ROTATION_4_2, b4 += b5); + b7 = RotlXor(b7, ROTATION_4_3, b6 += b7); + b9 = RotlXor(b9, ROTATION_4_4, b8 += b9); + b11 = RotlXor(b11, ROTATION_4_5, b10 += b11); + b13 = RotlXor(b13, ROTATION_4_6, b12 += b13); + b15 = RotlXor(b15, ROTATION_4_7, b14 += b15); + + b9 = RotlXor(b9, ROTATION_5_0, b0 += b9); + b13 = RotlXor(b13, ROTATION_5_1, b2 += b13); + b11 = RotlXor(b11, ROTATION_5_2, b6 += b11); + b15 = RotlXor(b15, ROTATION_5_3, b4 += b15); + b7 = RotlXor(b7, ROTATION_5_4, b10 += b7); + b3 = RotlXor(b3, ROTATION_5_5, b12 += b3); + b5 = RotlXor(b5, ROTATION_5_6, b14 += b5); + b1 = RotlXor(b1, ROTATION_5_7, b8 += b1); + + b7 = RotlXor(b7, ROTATION_6_0, b0 += b7); + b5 = RotlXor(b5, ROTATION_6_1, b2 += b5); + b3 = RotlXor(b3, ROTATION_6_2, b4 += b3); + b1 = RotlXor(b1, ROTATION_6_3, b6 += b1); + b15 = RotlXor(b15, ROTATION_6_4, b12 += b15); + b13 = RotlXor(b13, ROTATION_6_5, b14 += b13); + b11 = RotlXor(b11, ROTATION_6_6, b8 += b11); + b9 = RotlXor(b9, ROTATION_6_7, b10 += b9); + + b15 = RotlXor(b15, ROTATION_7_0, b0 += b15); + b11 = RotlXor(b11, ROTATION_7_1, b2 += b11); + b13 = RotlXor(b13, ROTATION_7_2, b6 += b13); + b9 = RotlXor(b9, ROTATION_7_3, b4 += b9); + b1 = RotlXor(b1, ROTATION_7_4, b14 += b1); + b5 = RotlXor(b5, ROTATION_7_5, b8 += b5); + b3 = RotlXor(b3, ROTATION_7_6, b10 += b3); + b7 = RotlXor(b7, ROTATION_7_7, b12 += b7); + + /* + * Subkey injection for next 4 rounds. + */ + b0 += kw[dm17 + 1]; + b1 += kw[dm17 + 2]; + b2 += kw[dm17 + 3]; + b3 += kw[dm17 + 4]; + b4 += kw[dm17 + 5]; + b5 += kw[dm17 + 6]; + b6 += kw[dm17 + 7]; + b7 += kw[dm17 + 8]; + b8 += kw[dm17 + 9]; + b9 += kw[dm17 + 10]; + b10 += kw[dm17 + 11]; + b11 += kw[dm17 + 12]; + b12 += kw[dm17 + 13]; + b13 += kw[dm17 + 14] + t[dm3 + 1]; + b14 += kw[dm17 + 15] + t[dm3 + 2]; + b15 += kw[dm17 + 16] + (uint)d + 1; + + } + + /* + * Output cipher state. + */ + outWords[0] = b0; + outWords[1] = b1; + outWords[2] = b2; + outWords[3] = b3; + outWords[4] = b4; + outWords[5] = b5; + outWords[6] = b6; + outWords[7] = b7; + outWords[8] = b8; + outWords[9] = b9; + outWords[10] = b10; + outWords[11] = b11; + outWords[12] = b12; + outWords[13] = b13; + outWords[14] = b14; + outWords[15] = b15; + } + + internal override void DecryptBlock(ulong[] block, ulong[] state) + { + ulong[] kw = this.kw; + ulong[] t = this.t; + int[] mod17 = MOD17; + int[] mod3 = MOD3; + + /* Help the JIT avoid index bounds checks */ + if (kw.Length != 33) + { + throw new ArgumentException(); + } + if (t.Length != 5) + { + throw new ArgumentException(); + } + + ulong b0 = block[0]; + ulong b1 = block[1]; + ulong b2 = block[2]; + ulong b3 = block[3]; + ulong b4 = block[4]; + ulong b5 = block[5]; + ulong b6 = block[6]; + ulong b7 = block[7]; + ulong b8 = block[8]; + ulong b9 = block[9]; + ulong b10 = block[10]; + ulong b11 = block[11]; + ulong b12 = block[12]; + ulong b13 = block[13]; + ulong b14 = block[14]; + ulong b15 = block[15]; + + for (int d = (ROUNDS_1024 / 4) - 1; d >= 1; d -= 2) + { + int dm17 = mod17[d]; + int dm3 = mod3[d]; + + /* Reverse key injection for second 4 rounds */ + b0 -= kw[dm17 + 1]; + b1 -= kw[dm17 + 2]; + b2 -= kw[dm17 + 3]; + b3 -= kw[dm17 + 4]; + b4 -= kw[dm17 + 5]; + b5 -= kw[dm17 + 6]; + b6 -= kw[dm17 + 7]; + b7 -= kw[dm17 + 8]; + b8 -= kw[dm17 + 9]; + b9 -= kw[dm17 + 10]; + b10 -= kw[dm17 + 11]; + b11 -= kw[dm17 + 12]; + b12 -= kw[dm17 + 13]; + b13 -= kw[dm17 + 14] + t[dm3 + 1]; + b14 -= kw[dm17 + 15] + t[dm3 + 2]; + b15 -= kw[dm17 + 16] + (uint)d + 1; + + /* Reverse second 4 mix/permute rounds */ + b15 = XorRotr(b15, ROTATION_7_0, b0); + b0 -= b15; + b11 = XorRotr(b11, ROTATION_7_1, b2); + b2 -= b11; + b13 = XorRotr(b13, ROTATION_7_2, b6); + b6 -= b13; + b9 = XorRotr(b9, ROTATION_7_3, b4); + b4 -= b9; + b1 = XorRotr(b1, ROTATION_7_4, b14); + b14 -= b1; + b5 = XorRotr(b5, ROTATION_7_5, b8); + b8 -= b5; + b3 = XorRotr(b3, ROTATION_7_6, b10); + b10 -= b3; + b7 = XorRotr(b7, ROTATION_7_7, b12); + b12 -= b7; + + b7 = XorRotr(b7, ROTATION_6_0, b0); + b0 -= b7; + b5 = XorRotr(b5, ROTATION_6_1, b2); + b2 -= b5; + b3 = XorRotr(b3, ROTATION_6_2, b4); + b4 -= b3; + b1 = XorRotr(b1, ROTATION_6_3, b6); + b6 -= b1; + b15 = XorRotr(b15, ROTATION_6_4, b12); + b12 -= b15; + b13 = XorRotr(b13, ROTATION_6_5, b14); + b14 -= b13; + b11 = XorRotr(b11, ROTATION_6_6, b8); + b8 -= b11; + b9 = XorRotr(b9, ROTATION_6_7, b10); + b10 -= b9; + + b9 = XorRotr(b9, ROTATION_5_0, b0); + b0 -= b9; + b13 = XorRotr(b13, ROTATION_5_1, b2); + b2 -= b13; + b11 = XorRotr(b11, ROTATION_5_2, b6); + b6 -= b11; + b15 = XorRotr(b15, ROTATION_5_3, b4); + b4 -= b15; + b7 = XorRotr(b7, ROTATION_5_4, b10); + b10 -= b7; + b3 = XorRotr(b3, ROTATION_5_5, b12); + b12 -= b3; + b5 = XorRotr(b5, ROTATION_5_6, b14); + b14 -= b5; + b1 = XorRotr(b1, ROTATION_5_7, b8); + b8 -= b1; + + b1 = XorRotr(b1, ROTATION_4_0, b0); + b0 -= b1; + b3 = XorRotr(b3, ROTATION_4_1, b2); + b2 -= b3; + b5 = XorRotr(b5, ROTATION_4_2, b4); + b4 -= b5; + b7 = XorRotr(b7, ROTATION_4_3, b6); + b6 -= b7; + b9 = XorRotr(b9, ROTATION_4_4, b8); + b8 -= b9; + b11 = XorRotr(b11, ROTATION_4_5, b10); + b10 -= b11; + b13 = XorRotr(b13, ROTATION_4_6, b12); + b12 -= b13; + b15 = XorRotr(b15, ROTATION_4_7, b14); + b14 -= b15; + + /* Reverse key injection for first 4 rounds */ + b0 -= kw[dm17]; + b1 -= kw[dm17 + 1]; + b2 -= kw[dm17 + 2]; + b3 -= kw[dm17 + 3]; + b4 -= kw[dm17 + 4]; + b5 -= kw[dm17 + 5]; + b6 -= kw[dm17 + 6]; + b7 -= kw[dm17 + 7]; + b8 -= kw[dm17 + 8]; + b9 -= kw[dm17 + 9]; + b10 -= kw[dm17 + 10]; + b11 -= kw[dm17 + 11]; + b12 -= kw[dm17 + 12]; + b13 -= kw[dm17 + 13] + t[dm3]; + b14 -= kw[dm17 + 14] + t[dm3 + 1]; + b15 -= kw[dm17 + 15] + (uint)d; + + /* Reverse first 4 mix/permute rounds */ + b15 = XorRotr(b15, ROTATION_3_0, b0); + b0 -= b15; + b11 = XorRotr(b11, ROTATION_3_1, b2); + b2 -= b11; + b13 = XorRotr(b13, ROTATION_3_2, b6); + b6 -= b13; + b9 = XorRotr(b9, ROTATION_3_3, b4); + b4 -= b9; + b1 = XorRotr(b1, ROTATION_3_4, b14); + b14 -= b1; + b5 = XorRotr(b5, ROTATION_3_5, b8); + b8 -= b5; + b3 = XorRotr(b3, ROTATION_3_6, b10); + b10 -= b3; + b7 = XorRotr(b7, ROTATION_3_7, b12); + b12 -= b7; + + b7 = XorRotr(b7, ROTATION_2_0, b0); + b0 -= b7; + b5 = XorRotr(b5, ROTATION_2_1, b2); + b2 -= b5; + b3 = XorRotr(b3, ROTATION_2_2, b4); + b4 -= b3; + b1 = XorRotr(b1, ROTATION_2_3, b6); + b6 -= b1; + b15 = XorRotr(b15, ROTATION_2_4, b12); + b12 -= b15; + b13 = XorRotr(b13, ROTATION_2_5, b14); + b14 -= b13; + b11 = XorRotr(b11, ROTATION_2_6, b8); + b8 -= b11; + b9 = XorRotr(b9, ROTATION_2_7, b10); + b10 -= b9; + + b9 = XorRotr(b9, ROTATION_1_0, b0); + b0 -= b9; + b13 = XorRotr(b13, ROTATION_1_1, b2); + b2 -= b13; + b11 = XorRotr(b11, ROTATION_1_2, b6); + b6 -= b11; + b15 = XorRotr(b15, ROTATION_1_3, b4); + b4 -= b15; + b7 = XorRotr(b7, ROTATION_1_4, b10); + b10 -= b7; + b3 = XorRotr(b3, ROTATION_1_5, b12); + b12 -= b3; + b5 = XorRotr(b5, ROTATION_1_6, b14); + b14 -= b5; + b1 = XorRotr(b1, ROTATION_1_7, b8); + b8 -= b1; + + b1 = XorRotr(b1, ROTATION_0_0, b0); + b0 -= b1; + b3 = XorRotr(b3, ROTATION_0_1, b2); + b2 -= b3; + b5 = XorRotr(b5, ROTATION_0_2, b4); + b4 -= b5; + b7 = XorRotr(b7, ROTATION_0_3, b6); + b6 -= b7; + b9 = XorRotr(b9, ROTATION_0_4, b8); + b8 -= b9; + b11 = XorRotr(b11, ROTATION_0_5, b10); + b10 -= b11; + b13 = XorRotr(b13, ROTATION_0_6, b12); + b12 -= b13; + b15 = XorRotr(b15, ROTATION_0_7, b14); + b14 -= b15; + } + + /* + * First subkey uninjection. + */ + b0 -= kw[0]; + b1 -= kw[1]; + b2 -= kw[2]; + b3 -= kw[3]; + b4 -= kw[4]; + b5 -= kw[5]; + b6 -= kw[6]; + b7 -= kw[7]; + b8 -= kw[8]; + b9 -= kw[9]; + b10 -= kw[10]; + b11 -= kw[11]; + b12 -= kw[12]; + b13 -= kw[13] + t[0]; + b14 -= kw[14] + t[1]; + b15 -= kw[15]; + + /* + * Output cipher state. + */ + state[0] = b0; + state[1] = b1; + state[2] = b2; + state[3] = b3; + state[4] = b4; + state[5] = b5; + state[6] = b6; + state[7] = b7; + state[8] = b8; + state[9] = b9; + state[10] = b10; + state[11] = b11; + state[12] = b12; + state[13] = b13; + state[14] = b14; + state[15] = b15; + } + + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ThreefishEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ThreefishEngine.cs.meta new file mode 100644 index 00000000..9e0d787a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/ThreefishEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 015b89c9dc51aec49acedc3323aad0b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TnepresEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TnepresEngine.cs new file mode 100644 index 00000000..fc3c2e68 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TnepresEngine.cs @@ -0,0 +1,303 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * Tnepres is a 128-bit 32-round block cipher with variable key lengths, + * including 128, 192 and 256 bit keys conjectured to be at least as + * secure as three-key triple-DES. + *

+ * Tnepres is based on Serpent which was designed by Ross Anderson, Eli Biham and Lars Knudsen as a + * candidate algorithm for the NIST AES Quest. Unfortunately there was an endianness issue + * with test vectors in the AES submission and the resulting confusion lead to the Tnepres cipher + * as well, which is a byte swapped version of Serpent. + *

+ *

+ * For full details see The Serpent home page + *

+ */ + public sealed class TnepresEngine + : SerpentEngineBase + { + public override string AlgorithmName + { + get { return "Tnepres"; } + } + + /** + * Expand a user-supplied key material into a session key. + * + * @param key The user-key bytes (multiples of 4) to use. + * @exception ArgumentException + */ + protected override int[] MakeWorkingKey(byte[] key) + { + // + // pad key to 256 bits + // + int[] kPad = new int[16]; + int off = 0; + int length = 0; + + for (off = key.Length - 4; off > 0; off -= 4) + { + kPad[length++] = (int)Pack.BE_To_UInt32(key, off); + } + + if (off == 0) + { + kPad[length++] = (int)Pack.BE_To_UInt32(key, 0); + if (length < 8) + { + kPad[length] = 1; + } + } + else + { + throw new ArgumentException("key must be a multiple of 4 bytes"); + } + + // + // expand the padded key up to 33 x 128 bits of key material + // + int amount = (ROUNDS + 1) * 4; + int[] w = new int[amount]; + + // + // compute w0 to w7 from w-8 to w-1 + // + for (int i = 8; i < 16; i++) + { + kPad[i] = RotateLeft(kPad[i - 8] ^ kPad[i - 5] ^ kPad[i - 3] ^ kPad[i - 1] ^ PHI ^ (i - 8), 11); + } + + Array.Copy(kPad, 8, w, 0, 8); + + // + // compute w8 to w136 + // + for (int i = 8; i < amount; i++) + { + w[i] = RotateLeft(w[i - 8] ^ w[i - 5] ^ w[i - 3] ^ w[i - 1] ^ PHI ^ i, 11); + } + + // + // create the working keys by processing w with the Sbox and IP + // + Sb3(w[0], w[1], w[2], w[3]); + w[0] = X0; w[1] = X1; w[2] = X2; w[3] = X3; + Sb2(w[4], w[5], w[6], w[7]); + w[4] = X0; w[5] = X1; w[6] = X2; w[7] = X3; + Sb1(w[8], w[9], w[10], w[11]); + w[8] = X0; w[9] = X1; w[10] = X2; w[11] = X3; + Sb0(w[12], w[13], w[14], w[15]); + w[12] = X0; w[13] = X1; w[14] = X2; w[15] = X3; + Sb7(w[16], w[17], w[18], w[19]); + w[16] = X0; w[17] = X1; w[18] = X2; w[19] = X3; + Sb6(w[20], w[21], w[22], w[23]); + w[20] = X0; w[21] = X1; w[22] = X2; w[23] = X3; + Sb5(w[24], w[25], w[26], w[27]); + w[24] = X0; w[25] = X1; w[26] = X2; w[27] = X3; + Sb4(w[28], w[29], w[30], w[31]); + w[28] = X0; w[29] = X1; w[30] = X2; w[31] = X3; + Sb3(w[32], w[33], w[34], w[35]); + w[32] = X0; w[33] = X1; w[34] = X2; w[35] = X3; + Sb2(w[36], w[37], w[38], w[39]); + w[36] = X0; w[37] = X1; w[38] = X2; w[39] = X3; + Sb1(w[40], w[41], w[42], w[43]); + w[40] = X0; w[41] = X1; w[42] = X2; w[43] = X3; + Sb0(w[44], w[45], w[46], w[47]); + w[44] = X0; w[45] = X1; w[46] = X2; w[47] = X3; + Sb7(w[48], w[49], w[50], w[51]); + w[48] = X0; w[49] = X1; w[50] = X2; w[51] = X3; + Sb6(w[52], w[53], w[54], w[55]); + w[52] = X0; w[53] = X1; w[54] = X2; w[55] = X3; + Sb5(w[56], w[57], w[58], w[59]); + w[56] = X0; w[57] = X1; w[58] = X2; w[59] = X3; + Sb4(w[60], w[61], w[62], w[63]); + w[60] = X0; w[61] = X1; w[62] = X2; w[63] = X3; + Sb3(w[64], w[65], w[66], w[67]); + w[64] = X0; w[65] = X1; w[66] = X2; w[67] = X3; + Sb2(w[68], w[69], w[70], w[71]); + w[68] = X0; w[69] = X1; w[70] = X2; w[71] = X3; + Sb1(w[72], w[73], w[74], w[75]); + w[72] = X0; w[73] = X1; w[74] = X2; w[75] = X3; + Sb0(w[76], w[77], w[78], w[79]); + w[76] = X0; w[77] = X1; w[78] = X2; w[79] = X3; + Sb7(w[80], w[81], w[82], w[83]); + w[80] = X0; w[81] = X1; w[82] = X2; w[83] = X3; + Sb6(w[84], w[85], w[86], w[87]); + w[84] = X0; w[85] = X1; w[86] = X2; w[87] = X3; + Sb5(w[88], w[89], w[90], w[91]); + w[88] = X0; w[89] = X1; w[90] = X2; w[91] = X3; + Sb4(w[92], w[93], w[94], w[95]); + w[92] = X0; w[93] = X1; w[94] = X2; w[95] = X3; + Sb3(w[96], w[97], w[98], w[99]); + w[96] = X0; w[97] = X1; w[98] = X2; w[99] = X3; + Sb2(w[100], w[101], w[102], w[103]); + w[100] = X0; w[101] = X1; w[102] = X2; w[103] = X3; + Sb1(w[104], w[105], w[106], w[107]); + w[104] = X0; w[105] = X1; w[106] = X2; w[107] = X3; + Sb0(w[108], w[109], w[110], w[111]); + w[108] = X0; w[109] = X1; w[110] = X2; w[111] = X3; + Sb7(w[112], w[113], w[114], w[115]); + w[112] = X0; w[113] = X1; w[114] = X2; w[115] = X3; + Sb6(w[116], w[117], w[118], w[119]); + w[116] = X0; w[117] = X1; w[118] = X2; w[119] = X3; + Sb5(w[120], w[121], w[122], w[123]); + w[120] = X0; w[121] = X1; w[122] = X2; w[123] = X3; + Sb4(w[124], w[125], w[126], w[127]); + w[124] = X0; w[125] = X1; w[126] = X2; w[127] = X3; + Sb3(w[128], w[129], w[130], w[131]); + w[128] = X0; w[129] = X1; w[130] = X2; w[131] = X3; + + return w; + } + + /** + * Encrypt one block of plaintext. + * + * @param input the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param output the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + */ + protected override void EncryptBlock(byte[] input, int inOff, byte[] output, int outOff) + { + X3 = (int)Pack.BE_To_UInt32(input, inOff); + X2 = (int)Pack.BE_To_UInt32(input, inOff + 4); + X1 = (int)Pack.BE_To_UInt32(input, inOff + 8); + X0 = (int)Pack.BE_To_UInt32(input, inOff + 12); + + Sb0(wKey[0] ^ X0, wKey[1] ^ X1, wKey[2] ^ X2, wKey[3] ^ X3); LT(); + Sb1(wKey[4] ^ X0, wKey[5] ^ X1, wKey[6] ^ X2, wKey[7] ^ X3); LT(); + Sb2(wKey[8] ^ X0, wKey[9] ^ X1, wKey[10] ^ X2, wKey[11] ^ X3); LT(); + Sb3(wKey[12] ^ X0, wKey[13] ^ X1, wKey[14] ^ X2, wKey[15] ^ X3); LT(); + Sb4(wKey[16] ^ X0, wKey[17] ^ X1, wKey[18] ^ X2, wKey[19] ^ X3); LT(); + Sb5(wKey[20] ^ X0, wKey[21] ^ X1, wKey[22] ^ X2, wKey[23] ^ X3); LT(); + Sb6(wKey[24] ^ X0, wKey[25] ^ X1, wKey[26] ^ X2, wKey[27] ^ X3); LT(); + Sb7(wKey[28] ^ X0, wKey[29] ^ X1, wKey[30] ^ X2, wKey[31] ^ X3); LT(); + Sb0(wKey[32] ^ X0, wKey[33] ^ X1, wKey[34] ^ X2, wKey[35] ^ X3); LT(); + Sb1(wKey[36] ^ X0, wKey[37] ^ X1, wKey[38] ^ X2, wKey[39] ^ X3); LT(); + Sb2(wKey[40] ^ X0, wKey[41] ^ X1, wKey[42] ^ X2, wKey[43] ^ X3); LT(); + Sb3(wKey[44] ^ X0, wKey[45] ^ X1, wKey[46] ^ X2, wKey[47] ^ X3); LT(); + Sb4(wKey[48] ^ X0, wKey[49] ^ X1, wKey[50] ^ X2, wKey[51] ^ X3); LT(); + Sb5(wKey[52] ^ X0, wKey[53] ^ X1, wKey[54] ^ X2, wKey[55] ^ X3); LT(); + Sb6(wKey[56] ^ X0, wKey[57] ^ X1, wKey[58] ^ X2, wKey[59] ^ X3); LT(); + Sb7(wKey[60] ^ X0, wKey[61] ^ X1, wKey[62] ^ X2, wKey[63] ^ X3); LT(); + Sb0(wKey[64] ^ X0, wKey[65] ^ X1, wKey[66] ^ X2, wKey[67] ^ X3); LT(); + Sb1(wKey[68] ^ X0, wKey[69] ^ X1, wKey[70] ^ X2, wKey[71] ^ X3); LT(); + Sb2(wKey[72] ^ X0, wKey[73] ^ X1, wKey[74] ^ X2, wKey[75] ^ X3); LT(); + Sb3(wKey[76] ^ X0, wKey[77] ^ X1, wKey[78] ^ X2, wKey[79] ^ X3); LT(); + Sb4(wKey[80] ^ X0, wKey[81] ^ X1, wKey[82] ^ X2, wKey[83] ^ X3); LT(); + Sb5(wKey[84] ^ X0, wKey[85] ^ X1, wKey[86] ^ X2, wKey[87] ^ X3); LT(); + Sb6(wKey[88] ^ X0, wKey[89] ^ X1, wKey[90] ^ X2, wKey[91] ^ X3); LT(); + Sb7(wKey[92] ^ X0, wKey[93] ^ X1, wKey[94] ^ X2, wKey[95] ^ X3); LT(); + Sb0(wKey[96] ^ X0, wKey[97] ^ X1, wKey[98] ^ X2, wKey[99] ^ X3); LT(); + Sb1(wKey[100] ^ X0, wKey[101] ^ X1, wKey[102] ^ X2, wKey[103] ^ X3); LT(); + Sb2(wKey[104] ^ X0, wKey[105] ^ X1, wKey[106] ^ X2, wKey[107] ^ X3); LT(); + Sb3(wKey[108] ^ X0, wKey[109] ^ X1, wKey[110] ^ X2, wKey[111] ^ X3); LT(); + Sb4(wKey[112] ^ X0, wKey[113] ^ X1, wKey[114] ^ X2, wKey[115] ^ X3); LT(); + Sb5(wKey[116] ^ X0, wKey[117] ^ X1, wKey[118] ^ X2, wKey[119] ^ X3); LT(); + Sb6(wKey[120] ^ X0, wKey[121] ^ X1, wKey[122] ^ X2, wKey[123] ^ X3); LT(); + Sb7(wKey[124] ^ X0, wKey[125] ^ X1, wKey[126] ^ X2, wKey[127] ^ X3); + + Pack.UInt32_To_BE((uint)(wKey[131] ^ X3), output, outOff); + Pack.UInt32_To_BE((uint)(wKey[130] ^ X2), output, outOff + 4); + Pack.UInt32_To_BE((uint)(wKey[129] ^ X1), output, outOff + 8); + Pack.UInt32_To_BE((uint)(wKey[128] ^ X0), output, outOff + 12); + } + + /** + * Decrypt one block of ciphertext. + * + * @param input the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param output the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + */ + protected override void DecryptBlock(byte[] input, int inOff, byte[] output, int outOff) + { + X3 = wKey[131] ^ (int)Pack.BE_To_UInt32(input, inOff); + X2 = wKey[130] ^ (int)Pack.BE_To_UInt32(input, inOff + 4); + X1 = wKey[129] ^ (int)Pack.BE_To_UInt32(input, inOff + 8); + X0 = wKey[128] ^ (int)Pack.BE_To_UInt32(input, inOff + 12); + + Ib7(X0, X1, X2, X3); + X0 ^= wKey[124]; X1 ^= wKey[125]; X2 ^= wKey[126]; X3 ^= wKey[127]; + InverseLT(); Ib6(X0, X1, X2, X3); + X0 ^= wKey[120]; X1 ^= wKey[121]; X2 ^= wKey[122]; X3 ^= wKey[123]; + InverseLT(); Ib5(X0, X1, X2, X3); + X0 ^= wKey[116]; X1 ^= wKey[117]; X2 ^= wKey[118]; X3 ^= wKey[119]; + InverseLT(); Ib4(X0, X1, X2, X3); + X0 ^= wKey[112]; X1 ^= wKey[113]; X2 ^= wKey[114]; X3 ^= wKey[115]; + InverseLT(); Ib3(X0, X1, X2, X3); + X0 ^= wKey[108]; X1 ^= wKey[109]; X2 ^= wKey[110]; X3 ^= wKey[111]; + InverseLT(); Ib2(X0, X1, X2, X3); + X0 ^= wKey[104]; X1 ^= wKey[105]; X2 ^= wKey[106]; X3 ^= wKey[107]; + InverseLT(); Ib1(X0, X1, X2, X3); + X0 ^= wKey[100]; X1 ^= wKey[101]; X2 ^= wKey[102]; X3 ^= wKey[103]; + InverseLT(); Ib0(X0, X1, X2, X3); + X0 ^= wKey[96]; X1 ^= wKey[97]; X2 ^= wKey[98]; X3 ^= wKey[99]; + InverseLT(); Ib7(X0, X1, X2, X3); + X0 ^= wKey[92]; X1 ^= wKey[93]; X2 ^= wKey[94]; X3 ^= wKey[95]; + InverseLT(); Ib6(X0, X1, X2, X3); + X0 ^= wKey[88]; X1 ^= wKey[89]; X2 ^= wKey[90]; X3 ^= wKey[91]; + InverseLT(); Ib5(X0, X1, X2, X3); + X0 ^= wKey[84]; X1 ^= wKey[85]; X2 ^= wKey[86]; X3 ^= wKey[87]; + InverseLT(); Ib4(X0, X1, X2, X3); + X0 ^= wKey[80]; X1 ^= wKey[81]; X2 ^= wKey[82]; X3 ^= wKey[83]; + InverseLT(); Ib3(X0, X1, X2, X3); + X0 ^= wKey[76]; X1 ^= wKey[77]; X2 ^= wKey[78]; X3 ^= wKey[79]; + InverseLT(); Ib2(X0, X1, X2, X3); + X0 ^= wKey[72]; X1 ^= wKey[73]; X2 ^= wKey[74]; X3 ^= wKey[75]; + InverseLT(); Ib1(X0, X1, X2, X3); + X0 ^= wKey[68]; X1 ^= wKey[69]; X2 ^= wKey[70]; X3 ^= wKey[71]; + InverseLT(); Ib0(X0, X1, X2, X3); + X0 ^= wKey[64]; X1 ^= wKey[65]; X2 ^= wKey[66]; X3 ^= wKey[67]; + InverseLT(); Ib7(X0, X1, X2, X3); + X0 ^= wKey[60]; X1 ^= wKey[61]; X2 ^= wKey[62]; X3 ^= wKey[63]; + InverseLT(); Ib6(X0, X1, X2, X3); + X0 ^= wKey[56]; X1 ^= wKey[57]; X2 ^= wKey[58]; X3 ^= wKey[59]; + InverseLT(); Ib5(X0, X1, X2, X3); + X0 ^= wKey[52]; X1 ^= wKey[53]; X2 ^= wKey[54]; X3 ^= wKey[55]; + InverseLT(); Ib4(X0, X1, X2, X3); + X0 ^= wKey[48]; X1 ^= wKey[49]; X2 ^= wKey[50]; X3 ^= wKey[51]; + InverseLT(); Ib3(X0, X1, X2, X3); + X0 ^= wKey[44]; X1 ^= wKey[45]; X2 ^= wKey[46]; X3 ^= wKey[47]; + InverseLT(); Ib2(X0, X1, X2, X3); + X0 ^= wKey[40]; X1 ^= wKey[41]; X2 ^= wKey[42]; X3 ^= wKey[43]; + InverseLT(); Ib1(X0, X1, X2, X3); + X0 ^= wKey[36]; X1 ^= wKey[37]; X2 ^= wKey[38]; X3 ^= wKey[39]; + InverseLT(); Ib0(X0, X1, X2, X3); + X0 ^= wKey[32]; X1 ^= wKey[33]; X2 ^= wKey[34]; X3 ^= wKey[35]; + InverseLT(); Ib7(X0, X1, X2, X3); + X0 ^= wKey[28]; X1 ^= wKey[29]; X2 ^= wKey[30]; X3 ^= wKey[31]; + InverseLT(); Ib6(X0, X1, X2, X3); + X0 ^= wKey[24]; X1 ^= wKey[25]; X2 ^= wKey[26]; X3 ^= wKey[27]; + InverseLT(); Ib5(X0, X1, X2, X3); + X0 ^= wKey[20]; X1 ^= wKey[21]; X2 ^= wKey[22]; X3 ^= wKey[23]; + InverseLT(); Ib4(X0, X1, X2, X3); + X0 ^= wKey[16]; X1 ^= wKey[17]; X2 ^= wKey[18]; X3 ^= wKey[19]; + InverseLT(); Ib3(X0, X1, X2, X3); + X0 ^= wKey[12]; X1 ^= wKey[13]; X2 ^= wKey[14]; X3 ^= wKey[15]; + InverseLT(); Ib2(X0, X1, X2, X3); + X0 ^= wKey[8]; X1 ^= wKey[9]; X2 ^= wKey[10]; X3 ^= wKey[11]; + InverseLT(); Ib1(X0, X1, X2, X3); + X0 ^= wKey[4]; X1 ^= wKey[5]; X2 ^= wKey[6]; X3 ^= wKey[7]; + InverseLT(); Ib0(X0, X1, X2, X3); + + Pack.UInt32_To_BE((uint)(X3 ^ wKey[3]), output, outOff); + Pack.UInt32_To_BE((uint)(X2 ^ wKey[2]), output, outOff + 4); + Pack.UInt32_To_BE((uint)(X1 ^ wKey[1]), output, outOff + 8); + Pack.UInt32_To_BE((uint)(X0 ^ wKey[0]), output, outOff + 12); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TnepresEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TnepresEngine.cs.meta new file mode 100644 index 00000000..76eb96d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TnepresEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94414e692bd322540bf0d382fe5770c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TwofishEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TwofishEngine.cs new file mode 100644 index 00000000..0317709f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TwofishEngine.cs @@ -0,0 +1,679 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * A class that provides Twofish encryption operations. + * + * This Java implementation is based on the Java reference + * implementation provided by Bruce Schneier and developed + * by Raif S. Naffah. + */ + public sealed class TwofishEngine + : IBlockCipher + { + private static readonly byte[,] P = { + { // p0 + (byte) 0xA9, (byte) 0x67, (byte) 0xB3, (byte) 0xE8, + (byte) 0x04, (byte) 0xFD, (byte) 0xA3, (byte) 0x76, + (byte) 0x9A, (byte) 0x92, (byte) 0x80, (byte) 0x78, + (byte) 0xE4, (byte) 0xDD, (byte) 0xD1, (byte) 0x38, + (byte) 0x0D, (byte) 0xC6, (byte) 0x35, (byte) 0x98, + (byte) 0x18, (byte) 0xF7, (byte) 0xEC, (byte) 0x6C, + (byte) 0x43, (byte) 0x75, (byte) 0x37, (byte) 0x26, + (byte) 0xFA, (byte) 0x13, (byte) 0x94, (byte) 0x48, + (byte) 0xF2, (byte) 0xD0, (byte) 0x8B, (byte) 0x30, + (byte) 0x84, (byte) 0x54, (byte) 0xDF, (byte) 0x23, + (byte) 0x19, (byte) 0x5B, (byte) 0x3D, (byte) 0x59, + (byte) 0xF3, (byte) 0xAE, (byte) 0xA2, (byte) 0x82, + (byte) 0x63, (byte) 0x01, (byte) 0x83, (byte) 0x2E, + (byte) 0xD9, (byte) 0x51, (byte) 0x9B, (byte) 0x7C, + (byte) 0xA6, (byte) 0xEB, (byte) 0xA5, (byte) 0xBE, + (byte) 0x16, (byte) 0x0C, (byte) 0xE3, (byte) 0x61, + (byte) 0xC0, (byte) 0x8C, (byte) 0x3A, (byte) 0xF5, + (byte) 0x73, (byte) 0x2C, (byte) 0x25, (byte) 0x0B, + (byte) 0xBB, (byte) 0x4E, (byte) 0x89, (byte) 0x6B, + (byte) 0x53, (byte) 0x6A, (byte) 0xB4, (byte) 0xF1, + (byte) 0xE1, (byte) 0xE6, (byte) 0xBD, (byte) 0x45, + (byte) 0xE2, (byte) 0xF4, (byte) 0xB6, (byte) 0x66, + (byte) 0xCC, (byte) 0x95, (byte) 0x03, (byte) 0x56, + (byte) 0xD4, (byte) 0x1C, (byte) 0x1E, (byte) 0xD7, + (byte) 0xFB, (byte) 0xC3, (byte) 0x8E, (byte) 0xB5, + (byte) 0xE9, (byte) 0xCF, (byte) 0xBF, (byte) 0xBA, + (byte) 0xEA, (byte) 0x77, (byte) 0x39, (byte) 0xAF, + (byte) 0x33, (byte) 0xC9, (byte) 0x62, (byte) 0x71, + (byte) 0x81, (byte) 0x79, (byte) 0x09, (byte) 0xAD, + (byte) 0x24, (byte) 0xCD, (byte) 0xF9, (byte) 0xD8, + (byte) 0xE5, (byte) 0xC5, (byte) 0xB9, (byte) 0x4D, + (byte) 0x44, (byte) 0x08, (byte) 0x86, (byte) 0xE7, + (byte) 0xA1, (byte) 0x1D, (byte) 0xAA, (byte) 0xED, + (byte) 0x06, (byte) 0x70, (byte) 0xB2, (byte) 0xD2, + (byte) 0x41, (byte) 0x7B, (byte) 0xA0, (byte) 0x11, + (byte) 0x31, (byte) 0xC2, (byte) 0x27, (byte) 0x90, + (byte) 0x20, (byte) 0xF6, (byte) 0x60, (byte) 0xFF, + (byte) 0x96, (byte) 0x5C, (byte) 0xB1, (byte) 0xAB, + (byte) 0x9E, (byte) 0x9C, (byte) 0x52, (byte) 0x1B, + (byte) 0x5F, (byte) 0x93, (byte) 0x0A, (byte) 0xEF, + (byte) 0x91, (byte) 0x85, (byte) 0x49, (byte) 0xEE, + (byte) 0x2D, (byte) 0x4F, (byte) 0x8F, (byte) 0x3B, + (byte) 0x47, (byte) 0x87, (byte) 0x6D, (byte) 0x46, + (byte) 0xD6, (byte) 0x3E, (byte) 0x69, (byte) 0x64, + (byte) 0x2A, (byte) 0xCE, (byte) 0xCB, (byte) 0x2F, + (byte) 0xFC, (byte) 0x97, (byte) 0x05, (byte) 0x7A, + (byte) 0xAC, (byte) 0x7F, (byte) 0xD5, (byte) 0x1A, + (byte) 0x4B, (byte) 0x0E, (byte) 0xA7, (byte) 0x5A, + (byte) 0x28, (byte) 0x14, (byte) 0x3F, (byte) 0x29, + (byte) 0x88, (byte) 0x3C, (byte) 0x4C, (byte) 0x02, + (byte) 0xB8, (byte) 0xDA, (byte) 0xB0, (byte) 0x17, + (byte) 0x55, (byte) 0x1F, (byte) 0x8A, (byte) 0x7D, + (byte) 0x57, (byte) 0xC7, (byte) 0x8D, (byte) 0x74, + (byte) 0xB7, (byte) 0xC4, (byte) 0x9F, (byte) 0x72, + (byte) 0x7E, (byte) 0x15, (byte) 0x22, (byte) 0x12, + (byte) 0x58, (byte) 0x07, (byte) 0x99, (byte) 0x34, + (byte) 0x6E, (byte) 0x50, (byte) 0xDE, (byte) 0x68, + (byte) 0x65, (byte) 0xBC, (byte) 0xDB, (byte) 0xF8, + (byte) 0xC8, (byte) 0xA8, (byte) 0x2B, (byte) 0x40, + (byte) 0xDC, (byte) 0xFE, (byte) 0x32, (byte) 0xA4, + (byte) 0xCA, (byte) 0x10, (byte) 0x21, (byte) 0xF0, + (byte) 0xD3, (byte) 0x5D, (byte) 0x0F, (byte) 0x00, + (byte) 0x6F, (byte) 0x9D, (byte) 0x36, (byte) 0x42, + (byte) 0x4A, (byte) 0x5E, (byte) 0xC1, (byte) 0xE0 }, + { // p1 + (byte) 0x75, (byte) 0xF3, (byte) 0xC6, (byte) 0xF4, + (byte) 0xDB, (byte) 0x7B, (byte) 0xFB, (byte) 0xC8, + (byte) 0x4A, (byte) 0xD3, (byte) 0xE6, (byte) 0x6B, + (byte) 0x45, (byte) 0x7D, (byte) 0xE8, (byte) 0x4B, + (byte) 0xD6, (byte) 0x32, (byte) 0xD8, (byte) 0xFD, + (byte) 0x37, (byte) 0x71, (byte) 0xF1, (byte) 0xE1, + (byte) 0x30, (byte) 0x0F, (byte) 0xF8, (byte) 0x1B, + (byte) 0x87, (byte) 0xFA, (byte) 0x06, (byte) 0x3F, + (byte) 0x5E, (byte) 0xBA, (byte) 0xAE, (byte) 0x5B, + (byte) 0x8A, (byte) 0x00, (byte) 0xBC, (byte) 0x9D, + (byte) 0x6D, (byte) 0xC1, (byte) 0xB1, (byte) 0x0E, + (byte) 0x80, (byte) 0x5D, (byte) 0xD2, (byte) 0xD5, + (byte) 0xA0, (byte) 0x84, (byte) 0x07, (byte) 0x14, + (byte) 0xB5, (byte) 0x90, (byte) 0x2C, (byte) 0xA3, + (byte) 0xB2, (byte) 0x73, (byte) 0x4C, (byte) 0x54, + (byte) 0x92, (byte) 0x74, (byte) 0x36, (byte) 0x51, + (byte) 0x38, (byte) 0xB0, (byte) 0xBD, (byte) 0x5A, + (byte) 0xFC, (byte) 0x60, (byte) 0x62, (byte) 0x96, + (byte) 0x6C, (byte) 0x42, (byte) 0xF7, (byte) 0x10, + (byte) 0x7C, (byte) 0x28, (byte) 0x27, (byte) 0x8C, + (byte) 0x13, (byte) 0x95, (byte) 0x9C, (byte) 0xC7, + (byte) 0x24, (byte) 0x46, (byte) 0x3B, (byte) 0x70, + (byte) 0xCA, (byte) 0xE3, (byte) 0x85, (byte) 0xCB, + (byte) 0x11, (byte) 0xD0, (byte) 0x93, (byte) 0xB8, + (byte) 0xA6, (byte) 0x83, (byte) 0x20, (byte) 0xFF, + (byte) 0x9F, (byte) 0x77, (byte) 0xC3, (byte) 0xCC, + (byte) 0x03, (byte) 0x6F, (byte) 0x08, (byte) 0xBF, + (byte) 0x40, (byte) 0xE7, (byte) 0x2B, (byte) 0xE2, + (byte) 0x79, (byte) 0x0C, (byte) 0xAA, (byte) 0x82, + (byte) 0x41, (byte) 0x3A, (byte) 0xEA, (byte) 0xB9, + (byte) 0xE4, (byte) 0x9A, (byte) 0xA4, (byte) 0x97, + (byte) 0x7E, (byte) 0xDA, (byte) 0x7A, (byte) 0x17, + (byte) 0x66, (byte) 0x94, (byte) 0xA1, (byte) 0x1D, + (byte) 0x3D, (byte) 0xF0, (byte) 0xDE, (byte) 0xB3, + (byte) 0x0B, (byte) 0x72, (byte) 0xA7, (byte) 0x1C, + (byte) 0xEF, (byte) 0xD1, (byte) 0x53, (byte) 0x3E, + (byte) 0x8F, (byte) 0x33, (byte) 0x26, (byte) 0x5F, + (byte) 0xEC, (byte) 0x76, (byte) 0x2A, (byte) 0x49, + (byte) 0x81, (byte) 0x88, (byte) 0xEE, (byte) 0x21, + (byte) 0xC4, (byte) 0x1A, (byte) 0xEB, (byte) 0xD9, + (byte) 0xC5, (byte) 0x39, (byte) 0x99, (byte) 0xCD, + (byte) 0xAD, (byte) 0x31, (byte) 0x8B, (byte) 0x01, + (byte) 0x18, (byte) 0x23, (byte) 0xDD, (byte) 0x1F, + (byte) 0x4E, (byte) 0x2D, (byte) 0xF9, (byte) 0x48, + (byte) 0x4F, (byte) 0xF2, (byte) 0x65, (byte) 0x8E, + (byte) 0x78, (byte) 0x5C, (byte) 0x58, (byte) 0x19, + (byte) 0x8D, (byte) 0xE5, (byte) 0x98, (byte) 0x57, + (byte) 0x67, (byte) 0x7F, (byte) 0x05, (byte) 0x64, + (byte) 0xAF, (byte) 0x63, (byte) 0xB6, (byte) 0xFE, + (byte) 0xF5, (byte) 0xB7, (byte) 0x3C, (byte) 0xA5, + (byte) 0xCE, (byte) 0xE9, (byte) 0x68, (byte) 0x44, + (byte) 0xE0, (byte) 0x4D, (byte) 0x43, (byte) 0x69, + (byte) 0x29, (byte) 0x2E, (byte) 0xAC, (byte) 0x15, + (byte) 0x59, (byte) 0xA8, (byte) 0x0A, (byte) 0x9E, + (byte) 0x6E, (byte) 0x47, (byte) 0xDF, (byte) 0x34, + (byte) 0x35, (byte) 0x6A, (byte) 0xCF, (byte) 0xDC, + (byte) 0x22, (byte) 0xC9, (byte) 0xC0, (byte) 0x9B, + (byte) 0x89, (byte) 0xD4, (byte) 0xED, (byte) 0xAB, + (byte) 0x12, (byte) 0xA2, (byte) 0x0D, (byte) 0x52, + (byte) 0xBB, (byte) 0x02, (byte) 0x2F, (byte) 0xA9, + (byte) 0xD7, (byte) 0x61, (byte) 0x1E, (byte) 0xB4, + (byte) 0x50, (byte) 0x04, (byte) 0xF6, (byte) 0xC2, + (byte) 0x16, (byte) 0x25, (byte) 0x86, (byte) 0x56, + (byte) 0x55, (byte) 0x09, (byte) 0xBE, (byte) 0x91 } + }; + + /** + * Define the fixed p0/p1 permutations used in keyed S-box lookup. + * By changing the following constant definitions, the S-boxes will + * automatically Get changed in the Twofish engine. + */ + private const int P_00 = 1; + private const int P_01 = 0; + private const int P_02 = 0; + private const int P_03 = P_01 ^ 1; + private const int P_04 = 1; + + private const int P_10 = 0; + private const int P_11 = 0; + private const int P_12 = 1; + private const int P_13 = P_11 ^ 1; + private const int P_14 = 0; + + private const int P_20 = 1; + private const int P_21 = 1; + private const int P_22 = 0; + private const int P_23 = P_21 ^ 1; + private const int P_24 = 0; + + private const int P_30 = 0; + private const int P_31 = 1; + private const int P_32 = 1; + private const int P_33 = P_31 ^ 1; + private const int P_34 = 1; + + /* Primitive polynomial for GF(256) */ + private const int GF256_FDBK = 0x169; + private const int GF256_FDBK_2 = GF256_FDBK / 2; + private const int GF256_FDBK_4 = GF256_FDBK / 4; + + private const int RS_GF_FDBK = 0x14D; // field generator + + //==================================== + // Useful constants + //==================================== + + private const int ROUNDS = 16; + private const int MAX_ROUNDS = 16; // bytes = 128 bits + private const int BLOCK_SIZE = 16; // bytes = 128 bits + private const int MAX_KEY_BITS = 256; + + private const int INPUT_WHITEN=0; + private const int OUTPUT_WHITEN=INPUT_WHITEN+BLOCK_SIZE/4; // 4 + private const int ROUND_SUBKEYS=OUTPUT_WHITEN+BLOCK_SIZE/4;// 8 + + private const int TOTAL_SUBKEYS=ROUND_SUBKEYS+2*MAX_ROUNDS;// 40 + + private const int SK_STEP = 0x02020202; + private const int SK_BUMP = 0x01010101; + private const int SK_ROTL = 9; + + private bool encrypting; + + private int[] gMDS0 = new int[MAX_KEY_BITS]; + private int[] gMDS1 = new int[MAX_KEY_BITS]; + private int[] gMDS2 = new int[MAX_KEY_BITS]; + private int[] gMDS3 = new int[MAX_KEY_BITS]; + + /** + * gSubKeys[] and gSBox[] are eventually used in the + * encryption and decryption methods. + */ + private int[] gSubKeys; + private int[] gSBox; + + private int k64Cnt; + + private byte[] workingKey; + + public TwofishEngine() + { + // calculate the MDS matrix + int[] m1 = new int[2]; + int[] mX = new int[2]; + int[] mY = new int[2]; + int j; + + for (int i=0; i< MAX_KEY_BITS ; i++) + { + j = P[0,i] & 0xff; + m1[0] = j; + mX[0] = Mx_X(j) & 0xff; + mY[0] = Mx_Y(j) & 0xff; + + j = P[1,i] & 0xff; + m1[1] = j; + mX[1] = Mx_X(j) & 0xff; + mY[1] = Mx_Y(j) & 0xff; + + gMDS0[i] = m1[P_00] | mX[P_00] << 8 | + mY[P_00] << 16 | mY[P_00] << 24; + + gMDS1[i] = mY[P_10] | mY[P_10] << 8 | + mX[P_10] << 16 | m1[P_10] << 24; + + gMDS2[i] = mX[P_20] | mY[P_20] << 8 | + m1[P_20] << 16 | mY[P_20] << 24; + + gMDS3[i] = mX[P_30] | m1[P_30] << 8 | + mY[P_30] << 16 | mX[P_30] << 24; + } + } + + /** + * initialise a Twofish cipher. + * + * @param forEncryption whether or not we are for encryption. + * @param parameters the parameters required to set up the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + throw new ArgumentException("invalid parameter passed to Twofish init - " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + + this.encrypting = forEncryption; + this.workingKey = ((KeyParameter)parameters).GetKey(); + this.k64Cnt = (this.workingKey.Length / 8); // pre-padded ? + SetKey(this.workingKey); + } + + public string AlgorithmName + { + get { return "Twofish"; } + } + + public bool IsPartialBlockOkay + { + get { return false; } + } + + public int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if (workingKey == null) + throw new InvalidOperationException("Twofish not initialised"); + + Check.DataLength(input, inOff, BLOCK_SIZE, "input buffer too short"); + Check.OutputLength(output, outOff, BLOCK_SIZE, "output buffer too short"); + + if (encrypting) + { + EncryptBlock(input, inOff, output, outOff); + } + else + { + DecryptBlock(input, inOff, output, outOff); + } + + return BLOCK_SIZE; + } + + public void Reset() + { + if (this.workingKey != null) + { + SetKey(this.workingKey); + } + } + + public int GetBlockSize() + { + return BLOCK_SIZE; + } + + //================================== + // Private Implementation + //================================== + + private void SetKey(byte[] key) + { + int[] k32e = new int[MAX_KEY_BITS/64]; // 4 + int[] k32o = new int[MAX_KEY_BITS/64]; // 4 + + int[] sBoxKeys = new int[MAX_KEY_BITS/64]; // 4 + gSubKeys = new int[TOTAL_SUBKEYS]; + + if (k64Cnt < 1) + { + throw new ArgumentException("Key size less than 64 bits"); + } + + if (k64Cnt > 4) + { + throw new ArgumentException("Key size larger than 256 bits"); + } + + /* + * k64Cnt is the number of 8 byte blocks (64 chunks) + * that are in the input key. The input key is a + * maximum of 32 bytes ( 256 bits ), so the range + * for k64Cnt is 1..4 + */ + for (int i=0,p=0; i> 24); + A += B; + gSubKeys[i*2] = A; + A += B; + gSubKeys[i*2 + 1] = A << SK_ROTL | (int)((uint)A >> (32-SK_ROTL)); + } + + /* + * fully expand the table for speed + */ + int k0 = sBoxKeys[0]; + int k1 = sBoxKeys[1]; + int k2 = sBoxKeys[2]; + int k3 = sBoxKeys[3]; + int b0, b1, b2, b3; + gSBox = new int[4*MAX_KEY_BITS]; + for (int i=0; i>1) | x2 << 31; + x3 = (x3 << 1 | (int) ((uint)x3 >> 31)) ^ (t0 + 2*t1 + gSubKeys[k++]); + + t0 = Fe32_0(x2); + t1 = Fe32_3(x3); + x0 ^= t0 + t1 + gSubKeys[k++]; + x0 = (int) ((uint)x0 >>1) | x0 << 31; + x1 = (x1 << 1 | (int)((uint)x1 >> 31)) ^ (t0 + 2*t1 + gSubKeys[k++]); + } + + Bits32ToBytes(x2 ^ gSubKeys[OUTPUT_WHITEN], dst, dstIndex); + Bits32ToBytes(x3 ^ gSubKeys[OUTPUT_WHITEN + 1], dst, dstIndex + 4); + Bits32ToBytes(x0 ^ gSubKeys[OUTPUT_WHITEN + 2], dst, dstIndex + 8); + Bits32ToBytes(x1 ^ gSubKeys[OUTPUT_WHITEN + 3], dst, dstIndex + 12); + } + + /** + * Decrypt the given input starting at the given offset and place + * the result in the provided buffer starting at the given offset. + * The input will be an exact multiple of our blocksize. + */ + private void DecryptBlock( + byte[] src, + int srcIndex, + byte[] dst, + int dstIndex) + { + int x2 = BytesTo32Bits(src, srcIndex) ^ gSubKeys[OUTPUT_WHITEN]; + int x3 = BytesTo32Bits(src, srcIndex+4) ^ gSubKeys[OUTPUT_WHITEN + 1]; + int x0 = BytesTo32Bits(src, srcIndex+8) ^ gSubKeys[OUTPUT_WHITEN + 2]; + int x1 = BytesTo32Bits(src, srcIndex+12) ^ gSubKeys[OUTPUT_WHITEN + 3]; + + int k = ROUND_SUBKEYS + 2 * ROUNDS -1 ; + int t0, t1; + for (int r = 0; r< ROUNDS ; r +=2) + { + t0 = Fe32_0(x2); + t1 = Fe32_3(x3); + x1 ^= t0 + 2*t1 + gSubKeys[k--]; + x0 = (x0 << 1 | (int)((uint) x0 >> 31)) ^ (t0 + t1 + gSubKeys[k--]); + x1 = (int) ((uint)x1 >>1) | x1 << 31; + + t0 = Fe32_0(x0); + t1 = Fe32_3(x1); + x3 ^= t0 + 2*t1 + gSubKeys[k--]; + x2 = (x2 << 1 | (int)((uint)x2 >> 31)) ^ (t0 + t1 + gSubKeys[k--]); + x3 = (int)((uint)x3 >>1) | x3 << 31; + } + + Bits32ToBytes(x0 ^ gSubKeys[INPUT_WHITEN], dst, dstIndex); + Bits32ToBytes(x1 ^ gSubKeys[INPUT_WHITEN + 1], dst, dstIndex + 4); + Bits32ToBytes(x2 ^ gSubKeys[INPUT_WHITEN + 2], dst, dstIndex + 8); + Bits32ToBytes(x3 ^ gSubKeys[INPUT_WHITEN + 3], dst, dstIndex + 12); + } + + /* + * TODO: This can be optimised and made cleaner by combining + * the functionality in this function and applying it appropriately + * to the creation of the subkeys during key setup. + */ + private int F32(int x, int[] k32) + { + int b0 = M_b0(x); + int b1 = M_b1(x); + int b2 = M_b2(x); + int b3 = M_b3(x); + int k0 = k32[0]; + int k1 = k32[1]; + int k2 = k32[2]; + int k3 = k32[3]; + + int result = 0; + switch (k64Cnt & 3) + { + case 1: + result = gMDS0[(P[P_01,b0] & 0xff) ^ M_b0(k0)] ^ + gMDS1[(P[P_11,b1] & 0xff) ^ M_b1(k0)] ^ + gMDS2[(P[P_21,b2] & 0xff) ^ M_b2(k0)] ^ + gMDS3[(P[P_31,b3] & 0xff) ^ M_b3(k0)]; + break; + case 0: /* 256 bits of key */ + b0 = (P[P_04,b0] & 0xff) ^ M_b0(k3); + b1 = (P[P_14,b1] & 0xff) ^ M_b1(k3); + b2 = (P[P_24,b2] & 0xff) ^ M_b2(k3); + b3 = (P[P_34,b3] & 0xff) ^ M_b3(k3); + goto case 3; + case 3: + b0 = (P[P_03,b0] & 0xff) ^ M_b0(k2); + b1 = (P[P_13,b1] & 0xff) ^ M_b1(k2); + b2 = (P[P_23,b2] & 0xff) ^ M_b2(k2); + b3 = (P[P_33,b3] & 0xff) ^ M_b3(k2); + goto case 2; + case 2: + result = + gMDS0[(P[P_01,(P[P_02,b0]&0xff)^M_b0(k1)]&0xff)^M_b0(k0)] ^ + gMDS1[(P[P_11,(P[P_12,b1]&0xff)^M_b1(k1)]&0xff)^M_b1(k0)] ^ + gMDS2[(P[P_21,(P[P_22,b2]&0xff)^M_b2(k1)]&0xff)^M_b2(k0)] ^ + gMDS3[(P[P_31,(P[P_32,b3]&0xff)^M_b3(k1)]&0xff)^M_b3(k0)]; + break; + } + return result; + } + + /** + * Use (12, 8) Reed-Solomon code over GF(256) to produce + * a key S-box 32-bit entity from 2 key material 32-bit + * entities. + * + * @param k0 first 32-bit entity + * @param k1 second 32-bit entity + * @return Remainder polynomial Generated using RS code + */ + private int RS_MDS_Encode(int k0, int k1) + { + int r = k1; + for (int i = 0 ; i < 4 ; i++) // shift 1 byte at a time + { + r = RS_rem(r); + } + r ^= k0; + for (int i=0 ; i < 4 ; i++) + { + r = RS_rem(r); + } + + return r; + } + + /** + * Reed-Solomon code parameters: (12,8) reversible code: + *

+ *

+        * G(x) = x^4 + (a+1/a)x^3 + ax^2 + (a+1/a)x + 1
+        * 
+ * where a = primitive root of field generator 0x14D + *

+ */ + private int RS_rem(int x) + { + int b = (int) (((uint)x >> 24) & 0xff); + int g2 = ((b << 1) ^ + ((b & 0x80) != 0 ? RS_GF_FDBK : 0)) & 0xff; + int g3 = ( (int)((uint)b >> 1) ^ + ((b & 0x01) != 0 ? (int)((uint)RS_GF_FDBK >> 1) : 0)) ^ g2 ; + return ((x << 8) ^ (g3 << 24) ^ (g2 << 16) ^ (g3 << 8) ^ b); + } + + private int LFSR1(int x) + { + return (x >> 1) ^ + (((x & 0x01) != 0) ? GF256_FDBK_2 : 0); + } + + private int LFSR2(int x) + { + return (x >> 2) ^ + (((x & 0x02) != 0) ? GF256_FDBK_2 : 0) ^ + (((x & 0x01) != 0) ? GF256_FDBK_4 : 0); + } + + private int Mx_X(int x) + { + return x ^ LFSR2(x); + } // 5B + + private int Mx_Y(int x) + { + return x ^ LFSR1(x) ^ LFSR2(x); + } // EF + + private int M_b0(int x) + { + return x & 0xff; + } + + private int M_b1(int x) + { + return (int)((uint)x >> 8) & 0xff; + } + + private int M_b2(int x) + { + return (int)((uint)x >> 16) & 0xff; + } + + private int M_b3(int x) + { + return (int)((uint)x >> 24) & 0xff; + } + + private int Fe32_0(int x) + { + return gSBox[ 0x000 + 2*(x & 0xff) ] ^ + gSBox[ 0x001 + 2*((int)((uint)x >> 8) & 0xff) ] ^ + gSBox[ 0x200 + 2*((int)((uint)x >> 16) & 0xff) ] ^ + gSBox[ 0x201 + 2*((int)((uint)x >> 24) & 0xff) ]; + } + + private int Fe32_3(int x) + { + return gSBox[ 0x000 + 2*((int)((uint)x >> 24) & 0xff) ] ^ + gSBox[ 0x001 + 2*(x & 0xff) ] ^ + gSBox[ 0x200 + 2*((int)((uint)x >> 8) & 0xff) ] ^ + gSBox[ 0x201 + 2*((int)((uint)x >> 16) & 0xff) ]; + } + + private int BytesTo32Bits(byte[] b, int p) + { + return ((b[p] & 0xff) ) | + ((b[p+1] & 0xff) << 8) | + ((b[p+2] & 0xff) << 16) | + ((b[p+3] & 0xff) << 24); + } + + private void Bits32ToBytes(int inData, byte[] b, int offset) + { + b[offset] = (byte)inData; + b[offset + 1] = (byte)(inData >> 8); + b[offset + 2] = (byte)(inData >> 16); + b[offset + 3] = (byte)(inData >> 24); + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TwofishEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TwofishEngine.cs.meta new file mode 100644 index 00000000..eab3ab82 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/TwofishEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55bc155aecc561841af464c77f3a4cf9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCEngine.cs new file mode 100644 index 00000000..c1da4ca0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCEngine.cs @@ -0,0 +1,137 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + public class VmpcEngine + : IStreamCipher + { + /* + * variables to hold the state of the VMPC engine during encryption and + * decryption + */ + protected byte n = 0; + protected byte[] P = null; + protected byte s = 0; + + protected byte[] workingIV; + protected byte[] workingKey; + + public virtual string AlgorithmName + { + get { return "VMPC"; } + } + + /** + * initialise a VMPC cipher. + * + * @param forEncryption + * whether or not we are for encryption. + * @param params + * the parameters required to set up the cipher. + * @exception ArgumentException + * if the params argument is inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is ParametersWithIV)) + throw new ArgumentException("VMPC Init parameters must include an IV"); + + ParametersWithIV ivParams = (ParametersWithIV) parameters; + + if (!(ivParams.Parameters is KeyParameter)) + throw new ArgumentException("VMPC Init parameters must include a key"); + + KeyParameter key = (KeyParameter)ivParams.Parameters; + + this.workingIV = ivParams.GetIV(); + + if (workingIV == null || workingIV.Length < 1 || workingIV.Length > 768) + throw new ArgumentException("VMPC requires 1 to 768 bytes of IV"); + + this.workingKey = key.GetKey(); + + InitKey(this.workingKey, this.workingIV); + } + + protected virtual void InitKey( + byte[] keyBytes, + byte[] ivBytes) + { + s = 0; + P = new byte[256]; + for (int i = 0; i < 256; i++) + { + P[i] = (byte) i; + } + + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + keyBytes[m % keyBytes.Length]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + ivBytes[m % ivBytes.Length]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + n = 0; + } + + public virtual void ProcessBytes( + byte[] input, + int inOff, + int len, + byte[] output, + int outOff) + { + Check.DataLength(input, inOff, len, "input buffer too short"); + Check.OutputLength(output, outOff, len, "output buffer too short"); + + for (int i = 0; i < len; i++) + { + s = P[(s + P[n & 0xff]) & 0xff]; + byte z = P[(P[(P[s & 0xff]) & 0xff] + 1) & 0xff]; + // encryption + byte temp = P[n & 0xff]; + P[n & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + n = (byte) ((n + 1) & 0xff); + + // xor + output[i + outOff] = (byte) (input[i + inOff] ^ z); + } + } + + public virtual void Reset() + { + InitKey(this.workingKey, this.workingIV); + } + + public virtual byte ReturnByte( + byte input) + { + s = P[(s + P[n & 0xff]) & 0xff]; + byte z = P[(P[(P[s & 0xff]) & 0xff] + 1) & 0xff]; + // encryption + byte temp = P[n & 0xff]; + P[n & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + n = (byte) ((n + 1) & 0xff); + + // xor + return (byte) (input ^ z); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCEngine.cs.meta new file mode 100644 index 00000000..97e927ec --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c29feaad92e27d4a8e258e0856100ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCKSA3Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCKSA3Engine.cs new file mode 100644 index 00000000..ed7b6c0d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCKSA3Engine.cs @@ -0,0 +1,55 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + public class VmpcKsa3Engine + : VmpcEngine + { + public override string AlgorithmName + { + get { return "VMPC-KSA3"; } + } + + protected override void InitKey( + byte[] keyBytes, + byte[] ivBytes) + { + s = 0; + P = new byte[256]; + for (int i = 0; i < 256; i++) + { + P[i] = (byte) i; + } + + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + keyBytes[m % keyBytes.Length]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + ivBytes[m % ivBytes.Length]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + keyBytes[m % keyBytes.Length]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + + n = 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCKSA3Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCKSA3Engine.cs.meta new file mode 100644 index 00000000..21fe52d8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/VMPCKSA3Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05ccf3686014dfd48981280c5cc5b3b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XSalsa20Engine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XSalsa20Engine.cs new file mode 100644 index 00000000..efcaf391 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XSalsa20Engine.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /// + /// Implementation of Daniel J. Bernstein's XSalsa20 stream cipher - Salsa20 with an extended nonce. + /// + /// + /// XSalsa20 requires a 256 bit key, and a 192 bit nonce. + /// + public class XSalsa20Engine + : Salsa20Engine + { + public override string AlgorithmName + { + get { return "XSalsa20"; } + } + + protected override int NonceSize + { + get { return 24; } + } + + /// + /// XSalsa20 key generation: process 256 bit input key and 128 bits of the input nonce + /// using a core Salsa20 function without input addition to produce 256 bit working key + /// and use that with the remaining 64 bits of nonce to initialize a standard Salsa20 engine state. + /// + protected override void SetKey(byte[] keyBytes, byte[] ivBytes) + { + if (keyBytes == null) + throw new ArgumentException(AlgorithmName + " doesn't support re-init with null key"); + + if (keyBytes.Length != 32) + throw new ArgumentException(AlgorithmName + " requires a 256 bit key"); + + // Set key for HSalsa20 + base.SetKey(keyBytes, ivBytes); + + // Pack next 64 bits of IV into engine state instead of counter + Pack.LE_To_UInt32(ivBytes, 8, engineState, 8, 2); + + // Process engine state to generate Salsa20 key + uint[] hsalsa20Out = new uint[engineState.Length]; + SalsaCore(20, engineState, hsalsa20Out); + + // Set new key, removing addition in last round of salsaCore + engineState[1] = hsalsa20Out[0] - engineState[0]; + engineState[2] = hsalsa20Out[5] - engineState[5]; + engineState[3] = hsalsa20Out[10] - engineState[10]; + engineState[4] = hsalsa20Out[15] - engineState[15]; + + engineState[11] = hsalsa20Out[6] - engineState[6]; + engineState[12] = hsalsa20Out[7] - engineState[7]; + engineState[13] = hsalsa20Out[8] - engineState[8]; + engineState[14] = hsalsa20Out[9] - engineState[9]; + + // Last 64 bits of input IV + Pack.LE_To_UInt32(ivBytes, 16, engineState, 6, 2); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XSalsa20Engine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XSalsa20Engine.cs.meta new file mode 100644 index 00000000..d35fc424 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XSalsa20Engine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2496ed6753462e243b7d54834823fc34 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XTEAEngine.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XTEAEngine.cs new file mode 100644 index 00000000..b2fdaada --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XTEAEngine.cs @@ -0,0 +1,170 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines +{ + /** + * An XTEA engine. + */ + public class XteaEngine + : IBlockCipher + { + private const int + rounds = 32, + block_size = 8, +// key_size = 16, + delta = unchecked((int) 0x9E3779B9); + + /* + * the expanded key array of 4 subkeys + */ + private uint[] _S = new uint[4], + _sum0 = new uint[32], + _sum1 = new uint[32]; + private bool _initialised, _forEncryption; + + /** + * Create an instance of the TEA encryption algorithm + * and set some defaults + */ + public XteaEngine() + { + _initialised = false; + } + + public virtual string AlgorithmName + { + get { return "XTEA"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return false; } + } + + public virtual int GetBlockSize() + { + return block_size; + } + + /** + * initialise + * + * @param forEncryption whether or not we are for encryption. + * @param params the parameters required to set up the cipher. + * @exception ArgumentException if the params argument is + * inappropriate. + */ + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (!(parameters is KeyParameter)) + { + throw new ArgumentException("invalid parameter passed to TEA init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + + _forEncryption = forEncryption; + _initialised = true; + + KeyParameter p = (KeyParameter) parameters; + + setKey(p.GetKey()); + } + + public virtual int ProcessBlock( + byte[] inBytes, + int inOff, + byte[] outBytes, + int outOff) + { + if (!_initialised) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Check.DataLength(inBytes, inOff, block_size, "input buffer too short"); + Check.OutputLength(outBytes, outOff, block_size, "output buffer too short"); + + return _forEncryption + ? encryptBlock(inBytes, inOff, outBytes, outOff) + : decryptBlock(inBytes, inOff, outBytes, outOff); + } + + public virtual void Reset() + { + } + + /** + * Re-key the cipher. + * + * @param key the key to be used + */ + private void setKey( + byte[] key) + { + int i, j; + for (i = j = 0; i < 4; i++,j+=4) + { + _S[i] = Pack.BE_To_UInt32(key, j); + } + + for (i = j = 0; i < rounds; i++) + { + _sum0[i] = ((uint)j + _S[j & 3]); + j += delta; + _sum1[i] = ((uint)j + _S[j >> 11 & 3]); + } + } + + private int encryptBlock( + byte[] inBytes, + int inOff, + byte[] outBytes, + int outOff) + { + // Pack bytes into integers + uint v0 = Pack.BE_To_UInt32(inBytes, inOff); + uint v1 = Pack.BE_To_UInt32(inBytes, inOff + 4); + + for (int i = 0; i < rounds; i++) + { + v0 += ((v1 << 4 ^ v1 >> 5) + v1) ^ _sum0[i]; + v1 += ((v0 << 4 ^ v0 >> 5) + v0) ^ _sum1[i]; + } + + Pack.UInt32_To_BE(v0, outBytes, outOff); + Pack.UInt32_To_BE(v1, outBytes, outOff + 4); + + return block_size; + } + + private int decryptBlock( + byte[] inBytes, + int inOff, + byte[] outBytes, + int outOff) + { + // Pack bytes into integers + uint v0 = Pack.BE_To_UInt32(inBytes, inOff); + uint v1 = Pack.BE_To_UInt32(inBytes, inOff + 4); + + for (int i = rounds-1; i >= 0; i--) + { + v1 -= ((v0 << 4 ^ v0 >> 5) + v0) ^ _sum1[i]; + v0 -= ((v1 << 4 ^ v1 >> 5) + v1) ^ _sum0[i]; + } + + Pack.UInt32_To_BE(v0, outBytes, outOff); + Pack.UInt32_To_BE(v1, outBytes, outOff + 4); + + return block_size; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XTEAEngine.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XTEAEngine.cs.meta new file mode 100644 index 00000000..bfccba88 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/engines/XTEAEngine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6051826ba9ea2a74bbbc2efd92b5d977 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators.meta new file mode 100644 index 00000000..4fee965a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a0959102436299e4eba93aa086cc6f46 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BCrypt.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BCrypt.cs new file mode 100644 index 00000000..c8a176f3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BCrypt.cs @@ -0,0 +1,632 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Core of password hashing scheme Bcrypt, + * designed by Niels Provos and David Mazières, + * corresponds to the C reference implementation. + *

+ * This implementation does not correspondent to the 1999 published paper + * "A Future-Adaptable Password Scheme" of Niels Provos and David Mazières, + * see: https://www.usenix.org/legacy/events/usenix99/provos/provos_html/node1.html. + * In contrast to the paper, the order of key setup and salt setup is reversed: + * state <- ExpandKey(state, 0, key) + * state %lt;- ExpandKey(state, 0, salt) + * This corresponds to the OpenBSD reference implementation of Bcrypt. + *

+ * Note: + * There is no successful cryptanalysis (status 2015), but + * the amount of memory and the band width of Bcrypt + * may be insufficient to effectively prevent attacks + * with custom hardware like FPGAs, ASICs + *

+ * This implementation uses some parts of Bouncy Castle's BlowfishEngine. + *

+ */ + public sealed class BCrypt + { + // magic String "OrpheanBeholderScryDoubt" is used as clear text for encryption + private static readonly uint[] MAGIC_STRING = + { + 0x4F727068, 0x65616E42, 0x65686F6C, + 0x64657253, 0x63727944, 0x6F756274 + }; + + internal const int MAGIC_STRING_LENGTH = 6; + + private static readonly uint[] + KP = { + 0x243F6A88, 0x85A308D3, 0x13198A2E, 0x03707344, + 0xA4093822, 0x299F31D0, 0x082EFA98, 0xEC4E6C89, + 0x452821E6, 0x38D01377, 0xBE5466CF, 0x34E90C6C, + 0xC0AC29B7, 0xC97C50DD, 0x3F84D5B5, 0xB5470917, + 0x9216D5D9, 0x8979FB1B + }, + + KS0 = { + 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, + 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99, + 0x24A19947, 0xB3916CF7, 0x0801F2E2, 0x858EFC16, + 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, + 0x0D95748F, 0x728EB658, 0x718BCD58, 0x82154AEE, + 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, + 0xC5D1B023, 0x286085F0, 0xCA417918, 0xB8DB38EF, + 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E, + 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60, + 0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, + 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, + 0xA15486AF, 0x7C72E993, 0xB3EE1411, 0x636FBC2A, + 0x2BA9C55D, 0x741831F6, 0xCE5C3E16, 0x9B87931E, + 0xAFD6BA33, 0x6C24CF5C, 0x7A325381, 0x28958677, + 0x3B8F4898, 0x6B4BB9AF, 0xC4BFE81B, 0x66282193, + 0x61D809CC, 0xFB21A991, 0x487CAC60, 0x5DEC8032, + 0xEF845D5D, 0xE98575B1, 0xDC262302, 0xEB651B88, + 0x23893E81, 0xD396ACC5, 0x0F6D6FF3, 0x83F44239, + 0x2E0B4482, 0xA4842004, 0x69C8F04A, 0x9E1F9B5E, + 0x21C66842, 0xF6E96C9A, 0x670C9C61, 0xABD388F0, + 0x6A51A0D2, 0xD8542F68, 0x960FA728, 0xAB5133A3, + 0x6EEF0B6C, 0x137A3BE4, 0xBA3BF050, 0x7EFB2A98, + 0xA1F1651D, 0x39AF0176, 0x66CA593E, 0x82430E88, + 0x8CEE8619, 0x456F9FB4, 0x7D84A5C3, 0x3B8B5EBE, + 0xE06F75D8, 0x85C12073, 0x401A449F, 0x56C16AA6, + 0x4ED3AA62, 0x363F7706, 0x1BFEDF72, 0x429B023D, + 0x37D0D724, 0xD00A1248, 0xDB0FEAD3, 0x49F1C09B, + 0x075372C9, 0x80991B7B, 0x25D479D8, 0xF6E8DEF7, + 0xE3FE501A, 0xB6794C3B, 0x976CE0BD, 0x04C006BA, + 0xC1A94FB6, 0x409F60C4, 0x5E5C9EC2, 0x196A2463, + 0x68FB6FAF, 0x3E6C53B5, 0x1339B2EB, 0x3B52EC6F, + 0x6DFC511F, 0x9B30952C, 0xCC814544, 0xAF5EBD09, + 0xBEE3D004, 0xDE334AFD, 0x660F2807, 0x192E4BB3, + 0xC0CBA857, 0x45C8740F, 0xD20B5F39, 0xB9D3FBDB, + 0x5579C0BD, 0x1A60320A, 0xD6A100C6, 0x402C7279, + 0x679F25FE, 0xFB1FA3CC, 0x8EA5E9F8, 0xDB3222F8, + 0x3C7516DF, 0xFD616B15, 0x2F501EC8, 0xAD0552AB, + 0x323DB5FA, 0xFD238760, 0x53317B48, 0x3E00DF82, + 0x9E5C57BB, 0xCA6F8CA0, 0x1A87562E, 0xDF1769DB, + 0xD542A8F6, 0x287EFFC3, 0xAC6732C6, 0x8C4F5573, + 0x695B27B0, 0xBBCA58C8, 0xE1FFA35D, 0xB8F011A0, + 0x10FA3D98, 0xFD2183B8, 0x4AFCB56C, 0x2DD1D35B, + 0x9A53E479, 0xB6F84565, 0xD28E49BC, 0x4BFB9790, + 0xE1DDF2DA, 0xA4CB7E33, 0x62FB1341, 0xCEE4C6E8, + 0xEF20CADA, 0x36774C01, 0xD07E9EFE, 0x2BF11FB4, + 0x95DBDA4D, 0xAE909198, 0xEAAD8E71, 0x6B93D5A0, + 0xD08ED1D0, 0xAFC725E0, 0x8E3C5B2F, 0x8E7594B7, + 0x8FF6E2FB, 0xF2122B64, 0x8888B812, 0x900DF01C, + 0x4FAD5EA0, 0x688FC31C, 0xD1CFF191, 0xB3A8C1AD, + 0x2F2F2218, 0xBE0E1777, 0xEA752DFE, 0x8B021FA1, + 0xE5A0CC0F, 0xB56F74E8, 0x18ACF3D6, 0xCE89E299, + 0xB4A84FE0, 0xFD13E0B7, 0x7CC43B81, 0xD2ADA8D9, + 0x165FA266, 0x80957705, 0x93CC7314, 0x211A1477, + 0xE6AD2065, 0x77B5FA86, 0xC75442F5, 0xFB9D35CF, + 0xEBCDAF0C, 0x7B3E89A0, 0xD6411BD3, 0xAE1E7E49, + 0x00250E2D, 0x2071B35E, 0x226800BB, 0x57B8E0AF, + 0x2464369B, 0xF009B91E, 0x5563911D, 0x59DFA6AA, + 0x78C14389, 0xD95A537F, 0x207D5BA2, 0x02E5B9C5, + 0x83260376, 0x6295CFA9, 0x11C81968, 0x4E734A41, + 0xB3472DCA, 0x7B14A94A, 0x1B510052, 0x9A532915, + 0xD60F573F, 0xBC9BC6E4, 0x2B60A476, 0x81E67400, + 0x08BA6FB5, 0x571BE91F, 0xF296EC6B, 0x2A0DD915, + 0xB6636521, 0xE7B9F9B6, 0xFF34052E, 0xC5855664, + 0x53B02D5D, 0xA99F8FA1, 0x08BA4799, 0x6E85076A + }, + + KS1 = { + 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, + 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, + 0xECAA8C71, 0x699A17FF, 0x5664526C, 0xC2B19EE1, + 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, + 0x3F54989A, 0x5B429D65, 0x6B8FE4D6, 0x99F73FD6, + 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, + 0x4CDD2086, 0x8470EB26, 0x6382E9C6, 0x021ECC5E, + 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1, + 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737, + 0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, + 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, + 0xAE0CF51A, 0x3CB574B2, 0x25837A58, 0xDC0921BD, + 0xD19113F9, 0x7CA92FF6, 0x94324773, 0x22F54701, + 0x3AE5E581, 0x37C2DADC, 0xC8B57634, 0x9AF3DDA7, + 0xA9446146, 0x0FD0030E, 0xECC8C73E, 0xA4751E41, + 0xE238CD99, 0x3BEA0E2F, 0x3280BBA1, 0x183EB331, + 0x4E548B38, 0x4F6DB908, 0x6F420D03, 0xF60A04BF, + 0x2CB81290, 0x24977C79, 0x5679B072, 0xBCAF89AF, + 0xDE9A771F, 0xD9930810, 0xB38BAE12, 0xDCCF3F2E, + 0x5512721F, 0x2E6B7124, 0x501ADDE6, 0x9F84CD87, + 0x7A584718, 0x7408DA17, 0xBC9F9ABC, 0xE94B7D8C, + 0xEC7AEC3A, 0xDB851DFA, 0x63094366, 0xC464C3D2, + 0xEF1C1847, 0x3215D908, 0xDD433B37, 0x24C2BA16, + 0x12A14D43, 0x2A65C451, 0x50940002, 0x133AE4DD, + 0x71DFF89E, 0x10314E55, 0x81AC77D6, 0x5F11199B, + 0x043556F1, 0xD7A3C76B, 0x3C11183B, 0x5924A509, + 0xF28FE6ED, 0x97F1FBFA, 0x9EBABF2C, 0x1E153C6E, + 0x86E34570, 0xEAE96FB1, 0x860E5E0A, 0x5A3E2AB3, + 0x771FE71C, 0x4E3D06FA, 0x2965DCB9, 0x99E71D0F, + 0x803E89D6, 0x5266C825, 0x2E4CC978, 0x9C10B36A, + 0xC6150EBA, 0x94E2EA78, 0xA5FC3C53, 0x1E0A2DF4, + 0xF2F74EA7, 0x361D2B3D, 0x1939260F, 0x19C27960, + 0x5223A708, 0xF71312B6, 0xEBADFE6E, 0xEAC31F66, + 0xE3BC4595, 0xA67BC883, 0xB17F37D1, 0x018CFF28, + 0xC332DDEF, 0xBE6C5AA5, 0x65582185, 0x68AB9802, + 0xEECEA50F, 0xDB2F953B, 0x2AEF7DAD, 0x5B6E2F84, + 0x1521B628, 0x29076170, 0xECDD4775, 0x619F1510, + 0x13CCA830, 0xEB61BD96, 0x0334FE1E, 0xAA0363CF, + 0xB5735C90, 0x4C70A239, 0xD59E9E0B, 0xCBAADE14, + 0xEECC86BC, 0x60622CA7, 0x9CAB5CAB, 0xB2F3846E, + 0x648B1EAF, 0x19BDF0CA, 0xA02369B9, 0x655ABB50, + 0x40685A32, 0x3C2AB4B3, 0x319EE9D5, 0xC021B8F7, + 0x9B540B19, 0x875FA099, 0x95F7997E, 0x623D7DA8, + 0xF837889A, 0x97E32D77, 0x11ED935F, 0x16681281, + 0x0E358829, 0xC7E61FD6, 0x96DEDFA1, 0x7858BA99, + 0x57F584A5, 0x1B227263, 0x9B83C3FF, 0x1AC24696, + 0xCDB30AEB, 0x532E3054, 0x8FD948E4, 0x6DBC3128, + 0x58EBF2EF, 0x34C6FFEA, 0xFE28ED61, 0xEE7C3C73, + 0x5D4A14D9, 0xE864B7E3, 0x42105D14, 0x203E13E0, + 0x45EEE2B6, 0xA3AAABEA, 0xDB6C4F15, 0xFACB4FD0, + 0xC742F442, 0xEF6ABBB5, 0x654F3B1D, 0x41CD2105, + 0xD81E799E, 0x86854DC7, 0xE44B476A, 0x3D816250, + 0xCF62A1F2, 0x5B8D2646, 0xFC8883A0, 0xC1C7B6A3, + 0x7F1524C3, 0x69CB7492, 0x47848A0B, 0x5692B285, + 0x095BBF00, 0xAD19489D, 0x1462B174, 0x23820E00, + 0x58428D2A, 0x0C55F5EA, 0x1DADF43E, 0x233F7061, + 0x3372F092, 0x8D937E41, 0xD65FECF1, 0x6C223BDB, + 0x7CDE3759, 0xCBEE7460, 0x4085F2A7, 0xCE77326E, + 0xA6078084, 0x19F8509E, 0xE8EFD855, 0x61D99735, + 0xA969A7AA, 0xC50C06C2, 0x5A04ABFC, 0x800BCADC, + 0x9E447A2E, 0xC3453484, 0xFDD56705, 0x0E1E9EC9, + 0xDB73DBD3, 0x105588CD, 0x675FDA79, 0xE3674340, + 0xC5C43465, 0x713E38D8, 0x3D28F89E, 0xF16DFF20, + 0x153E21E7, 0x8FB03D4A, 0xE6E39F2B, 0xDB83ADF7 + }, + + KS2 = { + 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, + 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, + 0xD4082471, 0x3320F46A, 0x43B7D4B7, 0x500061AF, + 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, + 0x4D95FC1D, 0x96B591AF, 0x70F4DDD3, 0x66A02F45, + 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, + 0x96EB27B3, 0x55FD3941, 0xDA2547E6, 0xABCA0A9A, + 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, + 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE, + 0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, + 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, + 0x20FE9E35, 0xD9F385B9, 0xEE39D7AB, 0x3B124E8B, + 0x1DC9FAF7, 0x4B6D1856, 0x26A36631, 0xEAE397B2, + 0x3A6EFA74, 0xDD5B4332, 0x6841E7F7, 0xCA7820FB, + 0xFB0AF54E, 0xD8FEB397, 0x454056AC, 0xBA489527, + 0x55533A3A, 0x20838D87, 0xFE6BA9B7, 0xD096954B, + 0x55A867BC, 0xA1159A58, 0xCCA92963, 0x99E1DB33, + 0xA62A4A56, 0x3F3125F9, 0x5EF47E1C, 0x9029317C, + 0xFDF8E802, 0x04272F70, 0x80BB155C, 0x05282CE3, + 0x95C11548, 0xE4C66D22, 0x48C1133F, 0xC70F86DC, + 0x07F9C9EE, 0x41041F0F, 0x404779A4, 0x5D886E17, + 0x325F51EB, 0xD59BC0D1, 0xF2BCC18F, 0x41113564, + 0x257B7834, 0x602A9C60, 0xDFF8E8A3, 0x1F636C1B, + 0x0E12B4C2, 0x02E1329E, 0xAF664FD1, 0xCAD18115, + 0x6B2395E0, 0x333E92E1, 0x3B240B62, 0xEEBEB922, + 0x85B2A20E, 0xE6BA0D99, 0xDE720C8C, 0x2DA2F728, + 0xD0127845, 0x95B794FD, 0x647D0862, 0xE7CCF5F0, + 0x5449A36F, 0x877D48FA, 0xC39DFD27, 0xF33E8D1E, + 0x0A476341, 0x992EFF74, 0x3A6F6EAB, 0xF4F8FD37, + 0xA812DC60, 0xA1EBDDF8, 0x991BE14C, 0xDB6E6B0D, + 0xC67B5510, 0x6D672C37, 0x2765D43B, 0xDCD0E804, + 0xF1290DC7, 0xCC00FFA3, 0xB5390F92, 0x690FED0B, + 0x667B9FFB, 0xCEDB7D9C, 0xA091CF0B, 0xD9155EA3, + 0xBB132F88, 0x515BAD24, 0x7B9479BF, 0x763BD6EB, + 0x37392EB3, 0xCC115979, 0x8026E297, 0xF42E312D, + 0x6842ADA7, 0xC66A2B3B, 0x12754CCC, 0x782EF11C, + 0x6A124237, 0xB79251E7, 0x06A1BBE6, 0x4BFB6350, + 0x1A6B1018, 0x11CAEDFA, 0x3D25BDD8, 0xE2E1C3C9, + 0x44421659, 0x0A121386, 0xD90CEC6E, 0xD5ABEA2A, + 0x64AF674E, 0xDA86A85F, 0xBEBFE988, 0x64E4C3FE, + 0x9DBC8057, 0xF0F7C086, 0x60787BF8, 0x6003604D, + 0xD1FD8346, 0xF6381FB0, 0x7745AE04, 0xD736FCCC, + 0x83426B33, 0xF01EAB71, 0xB0804187, 0x3C005E5F, + 0x77A057BE, 0xBDE8AE24, 0x55464299, 0xBF582E61, + 0x4E58F48F, 0xF2DDFDA2, 0xF474EF38, 0x8789BDC2, + 0x5366F9C3, 0xC8B38E74, 0xB475F255, 0x46FCD9B9, + 0x7AEB2661, 0x8B1DDF84, 0x846A0E79, 0x915F95E2, + 0x466E598E, 0x20B45770, 0x8CD55591, 0xC902DE4C, + 0xB90BACE1, 0xBB8205D0, 0x11A86248, 0x7574A99E, + 0xB77F19B6, 0xE0A9DC09, 0x662D09A1, 0xC4324633, + 0xE85A1F02, 0x09F0BE8C, 0x4A99A025, 0x1D6EFE10, + 0x1AB93D1D, 0x0BA5A4DF, 0xA186F20F, 0x2868F169, + 0xDCB7DA83, 0x573906FE, 0xA1E2CE9B, 0x4FCD7F52, + 0x50115E01, 0xA70683FA, 0xA002B5C4, 0x0DE6D027, + 0x9AF88C27, 0x773F8641, 0xC3604C06, 0x61A806B5, + 0xF0177A28, 0xC0F586E0, 0x006058AA, 0x30DC7D62, + 0x11E69ED7, 0x2338EA63, 0x53C2DD94, 0xC2C21634, + 0xBBCBEE56, 0x90BCB6DE, 0xEBFC7DA1, 0xCE591D76, + 0x6F05E409, 0x4B7C0188, 0x39720A3D, 0x7C927C24, + 0x86E3725F, 0x724D9DB9, 0x1AC15BB4, 0xD39EB8FC, + 0xED545578, 0x08FCA5B5, 0xD83D7CD3, 0x4DAD0FC4, + 0x1E50EF5E, 0xB161E6F8, 0xA28514D9, 0x6C51133C, + 0x6FD5C7E7, 0x56E14EC4, 0x362ABFCE, 0xDDC6C837, + 0xD79A3234, 0x92638212, 0x670EFA8E, 0x406000E0 + }, + + KS3 = { + 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, + 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE, + 0xD5118E9D, 0xBF0F7315, 0xD62D1C7E, 0xC700C47B, + 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, + 0x5748AB2F, 0xBC946E79, 0xC6A376D2, 0x6549C2C8, + 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, + 0x2939BBDB, 0xA9BA4650, 0xAC9526E8, 0xBE5EE304, + 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22, + 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4, + 0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, + 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, + 0xC72FEFD3, 0xF752F7DA, 0x3F046F69, 0x77FA0A59, + 0x80E4A915, 0x87B08601, 0x9B09E6AD, 0x3B3EE593, + 0xE990FD5A, 0x9E34D797, 0x2CF0B7D9, 0x022B8B51, + 0x96D5AC3A, 0x017DA67D, 0xD1CF3ED6, 0x7C7D2D28, + 0x1F9F25CF, 0xADF2B89B, 0x5AD6B472, 0x5A88F54C, + 0xE029AC71, 0xE019A5E6, 0x47B0ACFD, 0xED93FA9B, + 0xE8D3C48D, 0x283B57CC, 0xF8D56629, 0x79132E28, + 0x785F0191, 0xED756055, 0xF7960E44, 0xE3D35E8C, + 0x15056DD4, 0x88F46DBA, 0x03A16125, 0x0564F0BD, + 0xC3EB9E15, 0x3C9057A2, 0x97271AEC, 0xA93A072A, + 0x1B3F6D9B, 0x1E6321F5, 0xF59C66FB, 0x26DCF319, + 0x7533D928, 0xB155FDF5, 0x03563482, 0x8ABA3CBB, + 0x28517711, 0xC20AD9F8, 0xABCC5167, 0xCCAD925F, + 0x4DE81751, 0x3830DC8E, 0x379D5862, 0x9320F991, + 0xEA7A90C2, 0xFB3E7BCE, 0x5121CE64, 0x774FBE32, + 0xA8B6E37E, 0xC3293D46, 0x48DE5369, 0x6413E680, + 0xA2AE0810, 0xDD6DB224, 0x69852DFD, 0x09072166, + 0xB39A460A, 0x6445C0DD, 0x586CDECF, 0x1C20C8AE, + 0x5BBEF7DD, 0x1B588D40, 0xCCD2017F, 0x6BB4E3BB, + 0xDDA26A7E, 0x3A59FF45, 0x3E350A44, 0xBCB4CDD5, + 0x72EACEA8, 0xFA6484BB, 0x8D6612AE, 0xBF3C6F47, + 0xD29BE463, 0x542F5D9E, 0xAEC2771B, 0xF64E6370, + 0x740E0D8D, 0xE75B1357, 0xF8721671, 0xAF537D5D, + 0x4040CB08, 0x4EB4E2CC, 0x34D2466A, 0x0115AF84, + 0xE1B00428, 0x95983A1D, 0x06B89FB4, 0xCE6EA048, + 0x6F3F3B82, 0x3520AB82, 0x011A1D4B, 0x277227F8, + 0x611560B1, 0xE7933FDC, 0xBB3A792B, 0x344525BD, + 0xA08839E1, 0x51CE794B, 0x2F32C9B7, 0xA01FBAC9, + 0xE01CC87E, 0xBCC7D1F6, 0xCF0111C3, 0xA1E8AAC7, + 0x1A908749, 0xD44FBD9A, 0xD0DADECB, 0xD50ADA38, + 0x0339C32A, 0xC6913667, 0x8DF9317C, 0xE0B12B4F, + 0xF79E59B7, 0x43F5BB3A, 0xF2D519FF, 0x27D9459C, + 0xBF97222C, 0x15E6FC2A, 0x0F91FC71, 0x9B941525, + 0xFAE59361, 0xCEB69CEB, 0xC2A86459, 0x12BAA8D1, + 0xB6C1075E, 0xE3056A0C, 0x10D25065, 0xCB03A442, + 0xE0EC6E0E, 0x1698DB3B, 0x4C98A0BE, 0x3278E964, + 0x9F1F9532, 0xE0D392DF, 0xD3A0342B, 0x8971F21E, + 0x1B0A7441, 0x4BA3348C, 0xC5BE7120, 0xC37632D8, + 0xDF359F8D, 0x9B992F2E, 0xE60B6F47, 0x0FE3F11D, + 0xE54CDA54, 0x1EDAD891, 0xCE6279CF, 0xCD3E7E6F, + 0x1618B166, 0xFD2C1D05, 0x848FD2C5, 0xF6FB2299, + 0xF523F357, 0xA6327623, 0x93A83531, 0x56CCCD02, + 0xACF08162, 0x5A75EBB5, 0x6E163697, 0x88D273CC, + 0xDE966292, 0x81B949D0, 0x4C50901B, 0x71C65614, + 0xE6C6C7BD, 0x327A140A, 0x45E1D006, 0xC3F27B9A, + 0xC9AA53FD, 0x62A80F00, 0xBB25BFE2, 0x35BDD2F6, + 0x71126905, 0xB2040222, 0xB6CBCF7C, 0xCD769C2B, + 0x53113EC0, 0x1640E3D3, 0x38ABBD60, 0x2547ADF0, + 0xBA38209C, 0xF746CE76, 0x77AFA1C5, 0x20756060, + 0x85CBFE4E, 0x8AE88DD8, 0x7AAAF9B0, 0x4CF9AA7E, + 0x1948C25C, 0x02FB8A8C, 0x01C36AE4, 0xD6EBE1F9, + 0x90D4F869, 0xA65CDEA0, 0x3F09252D, 0xC208E69F, + 0xB74E6132, 0xCE77E25B, 0x578FDFE3, 0x3AC372E6 + }; + + //==================================== + // Useful constants + //==================================== + + private const int ROUNDS = 16; + private const int SBOX_SK = 256; + private const int SBOX_SK2 = SBOX_SK * 2; + private const int SBOX_SK3 = SBOX_SK * 3; + private const int P_SZ = ROUNDS + 2; + + private readonly uint[] S; // the s-boxes + private readonly uint[] P; // the p-array + + private BCrypt() + { + S = new uint[SBOX_SK * 4]; + P = new uint[P_SZ]; + } + + //================================== + // Private Implementation + //================================== + + private uint F(uint x) + { + return (((S[(x >> 24)] + S[SBOX_SK + ((x >> 16) & 0xff)]) + ^ S[SBOX_SK2 + ((x >> 8) & 0xff)]) + S[SBOX_SK3 + (x & 0xff)]); + } + + /* + * apply the encryption cycle to each value pair in the table. + */ + private void ProcessTable(uint xl, uint xr, uint[] table) + { + int size = table.Length; + + for (int s = 0; s < size; s += 2) + { + xl ^= P[0]; + + for (int i = 1; i < ROUNDS; i += 2) + { + xr ^= F(xl) ^ P[i]; + xl ^= F(xr) ^ P[i + 1]; + } + + xr ^= P[ROUNDS + 1]; + + table[s] = xr; + table[s + 1] = xl; + + xr = xl; // end of cycle swap + xl = table[s]; + } + } + + /* + * Initialize the S-boxes and the P-array, with a fixed string + * This string contains the hexadecimal digits of pi (3.141...) + */ + private void InitState() + { + Array.Copy(KS0, 0, S, 0, SBOX_SK); + Array.Copy(KS1, 0, S, SBOX_SK, SBOX_SK); + Array.Copy(KS2, 0, S, SBOX_SK2, SBOX_SK); + Array.Copy(KS3, 0, S, SBOX_SK3, SBOX_SK); + + Array.Copy(KP, 0, P, 0, P_SZ); + } + + /* + * XOR P with key cyclic. + * This is the first part of ExpandKey function + */ + private void CyclicXorKey(byte[] key) + { + int keyLength = key.Length; + int keyIndex = 0; + + for (int i = 0; i < P_SZ; i++) + { + // get the 32 bits of the key, in 4 * 8 bit chunks + uint data = 0x0000000; + for (int j = 0; j < 4; j++) + { + // create a 32 bit block + data = (data << 8) | key[keyIndex]; + + // wrap when we get to the end of the key + if (++keyIndex >= keyLength) + { + keyIndex = 0; + } + } + // XOR the newly created 32 bit chunk onto the P-array + P[i] ^= data; + } + } + + + /* + * encrypt magic String 64 times in ECB + */ + private byte[] EncryptMagicString() + { + uint[] text = { + MAGIC_STRING[0], MAGIC_STRING[1], + MAGIC_STRING[2], MAGIC_STRING[3], + MAGIC_STRING[4], MAGIC_STRING[5] + }; + for (int i = 0; i < 64; i++) + { + for (int j = 0; j < MAGIC_STRING_LENGTH; j += 2) + { + uint left = text[j]; + uint right = text[j + 1]; + + left ^= P[0]; + for (int k = 1; k < ROUNDS; k += 2) + { + right ^= F(left) ^ P[k]; + left ^= F(right) ^ P[k + 1]; + } + right ^= P[ROUNDS + 1]; + // swap values: + text[j] = right; + text[j + 1] = left; + } + } + byte[] result = new byte[24]; // holds 192 bit key + Pack.UInt32_To_BE(text, result, 0); + Array.Clear(text, 0, text.Length); + Array.Clear(P, 0, P.Length); + Array.Clear(S, 0, S.Length); + + return result; + } + + /* + * This is a part of Eksblowfish function + * + * @param table: sub-keys or working key + * @param salt32Bit: a 16 byte salt as two 32 bit words + * @param iv1: value from last proceeded table + * @param iv2: value from last proceeded table + */ + private void ProcessTableWithSalt(uint[] table, uint[] salt32Bit, uint iv1, uint iv2) + { + uint xl = iv1 ^ salt32Bit[0]; + uint xr = iv2 ^ salt32Bit[1]; + + uint yl; + uint yr; + int size = table.Length; + + for (int s = 0; s < size; s += 4) + { + xl ^= P[0]; + for (int i = 1; i < ROUNDS; i += 2) + { + xr ^= F(xl) ^ P[i]; + xl ^= F(xr) ^ P[i + 1]; + } + xr ^= P[ROUNDS + 1]; + + table[s] = xr; + table[s + 1] = xl; + + yl = salt32Bit[2] ^ xr; + yr = salt32Bit[3] ^ xl; + + if (s + 2 >= size) // P holds 18 values + { + break; + } + + yl ^= P[0]; + for (int i = 1; i < ROUNDS; i += 2) + { + yr ^= F(yl) ^ P[i]; + yl ^= F(yr) ^ P[i + 1]; + } + yr ^= P[ROUNDS + 1]; + + table[s + 2] = yr; + table[s + 3] = yl; + + xl = salt32Bit[0] ^ yr; + xr = salt32Bit[1] ^ yl; + } + } + + /** + * Derives a raw 192 bit Bcrypt key + * + * @param cost the cost factor, treated as an exponent of 2 + * @param salt a 16 byte salt + * @param psw the password + * @return a 192 bit key + */ + private byte[] DeriveRawKey(int cost, byte[] salt, byte[] psw) + { + if (salt.Length != 16) + throw new DataLengthException("Invalid salt size: 16 bytes expected."); + if (cost < 4 || cost > 31) + throw new ArgumentException("Illegal cost factor: 4 - 31 expected.", "cost"); + + if (psw.Length == 0) + { + psw = new byte[4]; + } + + // state <- InitState() + InitState(); + + uint[] salt32Bit = new uint[4]; // holds 16 byte salt + Pack.BE_To_UInt32(salt, 0, salt32Bit); + + uint[] salt32Bit2 = new uint[salt.Length]; // swapped values + salt32Bit2[0] = salt32Bit[2]; + salt32Bit2[1] = salt32Bit[3]; + salt32Bit2[2] = salt32Bit[0]; + salt32Bit2[3] = salt32Bit[1]; + + // ExpandKey( state, salt, key): + CyclicXorKey(psw); + ProcessTableWithSalt(P, salt32Bit, 0, 0); + Array.Clear(salt32Bit, 0, salt32Bit.Length); + ProcessTableWithSalt(S, salt32Bit2, P[P.Length - 2], P[P.Length - 1]); + Array.Clear(salt32Bit2, 0, salt32Bit2.Length); + + int rounds = 1 << cost; + for (int i = 0; i != rounds; i++) // rounds may be negative if cost is 31 + { + // state <- ExpandKey(state, 0, key); + CyclicXorKey(psw); + ProcessTable(0, 0, P); + ProcessTable(P[P_SZ - 2], P[P_SZ - 1], S); + + // state <- ExpandKey(state, 0, salt); + CyclicXorKey(salt); + ProcessTable(0, 0, P); + ProcessTable(P[P_SZ - 2], P[P_SZ - 1], S); + } + + // encrypt magicString 64 times + return EncryptMagicString(); + } + + /** + * Size of the salt parameter in bytes + */ + internal const int SALT_SIZE_BYTES = 16; + + /** + * Minimum value of cost parameter, equal to log2(bytes of salt) + */ + internal const int MIN_COST = 4; + + /** + * Maximum value of cost parameter (31 == 2,147,483,648) + */ + internal const int MAX_COST = 31; + + /** + * Maximum size of password == max (unrestricted) size of Blowfish key + */ + // Blowfish spec limits keys to 448bit/56 bytes to ensure all bits of key affect all ciphertext + // bits, but technically algorithm handles 72 byte keys and most implementations support this. + internal const int MAX_PASSWORD_BYTES = 72; + + /** + * Converts a character password to bytes incorporating the required trailing zero byte. + * + * @param password the password to be encoded. + * @return a byte representation of the password in UTF8 + trailing zero. + */ + public static byte[] PasswordToByteArray(char[] password) + { + return Arrays.Append(Strings.ToUtf8ByteArray(password), 0); + } + + /** + * Calculates the bcrypt hash of a password. + *

+ * This implements the raw bcrypt function as defined in the bcrypt specification, not + * the crypt encoded version implemented in OpenBSD. + *

+ * @param password the password bytes (up to 72 bytes) to use for this invocation. + * @param salt the 128 bit salt to use for this invocation. + * @param cost the bcrypt cost parameter. The cost of the bcrypt function grows as + * 2^cost. Legal values are 4..31 inclusive. + * @return the output of the raw bcrypt operation: a 192 bit (24 byte) hash. + */ + public static byte[] Generate(byte[] password, byte[] salt, int cost) + { + if (password == null) + throw new ArgumentNullException("password"); + if (password.Length > MAX_PASSWORD_BYTES) + throw new ArgumentException("BCrypt password must be <= 72 bytes", "password"); + if (salt == null) + throw new ArgumentNullException("salt"); + if (salt.Length != SALT_SIZE_BYTES) + throw new ArgumentException("BCrypt salt must be 128 bits", "salt"); + if (cost < MIN_COST || cost > MAX_COST) + throw new ArgumentException("BCrypt cost must be from 4..31", "cost"); + + return new BCrypt().DeriveRawKey(cost, salt, password); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BCrypt.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BCrypt.cs.meta new file mode 100644 index 00000000..4a26076f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BCrypt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b99a1fd27e8d8940acf6dc195270f8f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BaseKdfBytesGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BaseKdfBytesGenerator.cs new file mode 100644 index 00000000..ecc20b22 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BaseKdfBytesGenerator.cs @@ -0,0 +1,136 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Basic KDF generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 + *
+ * This implementation is based on ISO 18033/P1363a. + */ + public class BaseKdfBytesGenerator + : IDerivationFunction + { + private int counterStart; + private IDigest digest; + private byte[] shared; + private byte[] iv; + + /** + * Construct a KDF Parameters generator. + * + * @param counterStart value of counter. + * @param digest the digest to be used as the source of derived keys. + */ + public BaseKdfBytesGenerator(int counterStart, IDigest digest) + { + this.counterStart = counterStart; + this.digest = digest; + } + + public virtual void Init(IDerivationParameters parameters) + { + if (parameters is KdfParameters) + { + KdfParameters p = (KdfParameters)parameters; + + shared = p.GetSharedSecret(); + iv = p.GetIV(); + } + else if (parameters is Iso18033KdfParameters) + { + Iso18033KdfParameters p = (Iso18033KdfParameters)parameters; + + shared = p.GetSeed(); + iv = null; + } + else + { + throw new ArgumentException("KDF parameters required for KDF Generator"); + } + } + + /** + * return the underlying digest. + */ + public virtual IDigest Digest + { + get { return digest; } + } + + /** + * fill len bytes of the output buffer with bytes generated from + * the derivation function. + * + * @throws ArgumentException if the size of the request will cause an overflow. + * @throws DataLengthException if the out buffer is too small. + */ + public virtual int GenerateBytes(byte[] output, int outOff, int length) + { + if ((output.Length - length) < outOff) + throw new DataLengthException("output buffer too small"); + + long oBytes = length; + int outLen = digest.GetDigestSize(); + + // + // this is at odds with the standard implementation, the + // maximum value should be hBits * (2^32 - 1) where hBits + // is the digest output size in bits. We can't have an + // array with a long index at the moment... + // + if (oBytes > ((2L << 32) - 1)) + throw new ArgumentException("Output length too large"); + + int cThreshold = (int)((oBytes + outLen - 1) / outLen); + + byte[] dig = new byte[digest.GetDigestSize()]; + + byte[] C = new byte[4]; + Pack.UInt32_To_BE((uint)counterStart, C, 0); + + uint counterBase = (uint)(counterStart & ~0xFF); + + for (int i = 0; i < cThreshold; i++) + { + digest.BlockUpdate(shared, 0, shared.Length); + digest.BlockUpdate(C, 0, 4); + + if (iv != null) + { + digest.BlockUpdate(iv, 0, iv.Length); + } + + digest.DoFinal(dig, 0); + + if (length > outLen) + { + Array.Copy(dig, 0, output, outOff, outLen); + outOff += outLen; + length -= outLen; + } + else + { + Array.Copy(dig, 0, output, outOff, length); + } + + if (++C[3] == 0) + { + counterBase += 0x100; + Pack.UInt32_To_BE(counterBase, C, 0); + } + } + + digest.Reset(); + + return (int)oBytes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BaseKdfBytesGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BaseKdfBytesGenerator.cs.meta new file mode 100644 index 00000000..db27dec0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/BaseKdfBytesGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 529254d7f00c94c4eb4a87e22e280ee0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHBasicKeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHBasicKeyPairGenerator.cs new file mode 100644 index 00000000..9455d84c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHBasicKeyPairGenerator.cs @@ -0,0 +1,42 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * a basic Diffie-Hellman key pair generator. + * + * This generates keys consistent for use with the basic algorithm for + * Diffie-Hellman. + */ + public class DHBasicKeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private DHKeyGenerationParameters param; + + public virtual void Init( + KeyGenerationParameters parameters) + { + this.param = (DHKeyGenerationParameters)parameters; + } + + public virtual AsymmetricCipherKeyPair GenerateKeyPair() + { + DHKeyGeneratorHelper helper = DHKeyGeneratorHelper.Instance; + DHParameters dhp = param.Parameters; + + BigInteger x = helper.CalculatePrivate(dhp, param.Random); + BigInteger y = helper.CalculatePublic(dhp, x); + + return new AsymmetricCipherKeyPair( + new DHPublicKeyParameters(y, dhp), + new DHPrivateKeyParameters(x, dhp)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHBasicKeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHBasicKeyPairGenerator.cs.meta new file mode 100644 index 00000000..de466898 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHBasicKeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b7a4dfca0f6e38241991e7bc666269d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyGeneratorHelper.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyGeneratorHelper.cs new file mode 100644 index 00000000..3c4cba5b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyGeneratorHelper.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + class DHKeyGeneratorHelper + { + internal static readonly DHKeyGeneratorHelper Instance = new DHKeyGeneratorHelper(); + + private DHKeyGeneratorHelper() + { + } + + internal BigInteger CalculatePrivate( + DHParameters dhParams, + SecureRandom random) + { + int limit = dhParams.L; + + if (limit != 0) + { + int minWeight = limit >> 2; + for (;;) + { + BigInteger x = new BigInteger(limit, random).SetBit(limit - 1); + if (WNafUtilities.GetNafWeight(x) >= minWeight) + { + return x; + } + } + } + + BigInteger min = BigInteger.Two; + int m = dhParams.M; + if (m != 0) + { + min = BigInteger.One.ShiftLeft(m - 1); + } + + BigInteger q = dhParams.Q; + if (q == null) + { + q = dhParams.P; + } + BigInteger max = q.Subtract(BigInteger.Two); + + { + int minWeight = max.BitLength >> 2; + for (;;) + { + BigInteger x = BigIntegers.CreateRandomInRange(min, max, random); + if (WNafUtilities.GetNafWeight(x) >= minWeight) + { + return x; + } + } + } + } + + internal BigInteger CalculatePublic( + DHParameters dhParams, + BigInteger x) + { + return dhParams.G.ModPow(x, dhParams.P); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyGeneratorHelper.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyGeneratorHelper.cs.meta new file mode 100644 index 00000000..709d116e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyGeneratorHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98272963180479a45b4495273799bb5c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyPairGenerator.cs new file mode 100644 index 00000000..a9eba6e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyPairGenerator.cs @@ -0,0 +1,42 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * a Diffie-Hellman key pair generator. + * + * This generates keys consistent for use in the MTI/A0 key agreement protocol + * as described in "Handbook of Applied Cryptography", Pages 516-519. + */ + public class DHKeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private DHKeyGenerationParameters param; + + public virtual void Init( + KeyGenerationParameters parameters) + { + this.param = (DHKeyGenerationParameters)parameters; + } + + public virtual AsymmetricCipherKeyPair GenerateKeyPair() + { + DHKeyGeneratorHelper helper = DHKeyGeneratorHelper.Instance; + DHParameters dhp = param.Parameters; + + BigInteger x = helper.CalculatePrivate(dhp, param.Random); + BigInteger y = helper.CalculatePublic(dhp, x); + + return new AsymmetricCipherKeyPair( + new DHPublicKeyParameters(y, dhp), + new DHPrivateKeyParameters(x, dhp)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyPairGenerator.cs.meta new file mode 100644 index 00000000..82b4e2fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHKeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c6dd5179b7382f74dbd970c11817e3b8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersGenerator.cs new file mode 100644 index 00000000..9013d0bf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersGenerator.cs @@ -0,0 +1,49 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + public class DHParametersGenerator + { + private int size; + private int certainty; + private SecureRandom random; + + public virtual void Init( + int size, + int certainty, + SecureRandom random) + { + this.size = size; + this.certainty = certainty; + this.random = random; + } + + /** + * which Generates the p and g values from the given parameters, + * returning the DHParameters object. + *

+ * Note: can take a while...

+ */ + public virtual DHParameters GenerateParameters() + { + // + // find a safe prime p where p = 2*q + 1, where p and q are prime. + // + BigInteger[] safePrimes = DHParametersHelper.GenerateSafePrimes(size, certainty, random); + + BigInteger p = safePrimes[0]; + BigInteger q = safePrimes[1]; + BigInteger g = DHParametersHelper.SelectGenerator(p, q, random); + + return new DHParameters(p, g, q, BigInteger.Two, null); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersGenerator.cs.meta new file mode 100644 index 00000000..fd27cd09 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0fae909793a7d5c40b20696050343040 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersHelper.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersHelper.cs new file mode 100644 index 00000000..77cafb64 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersHelper.cs @@ -0,0 +1,160 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + internal class DHParametersHelper + { + private static readonly BigInteger Six = BigInteger.ValueOf(6); + + private static readonly int[][] primeLists = BigInteger.primeLists; + private static readonly int[] primeProducts = BigInteger.primeProducts; + private static readonly BigInteger[] BigPrimeProducts = ConstructBigPrimeProducts(primeProducts); + + private static BigInteger[] ConstructBigPrimeProducts(int[] primeProducts) + { + BigInteger[] bpp = new BigInteger[primeProducts.Length]; + for (int i = 0; i < bpp.Length; ++i) + { + bpp[i] = BigInteger.ValueOf(primeProducts[i]); + } + return bpp; + } + + /* + * Finds a pair of prime BigInteger's {p, q: p = 2q + 1} + * + * (see: Handbook of Applied Cryptography 4.86) + */ + internal static BigInteger[] GenerateSafePrimes(int size, int certainty, SecureRandom random) + { + BigInteger p, q; + int qLength = size - 1; + int minWeight = size >> 2; + + if (size <= 32) + { + for (;;) + { + q = new BigInteger(qLength, 2, random); + + p = q.ShiftLeft(1).Add(BigInteger.One); + + if (!p.IsProbablePrime(certainty, true)) + continue; + + if (certainty > 2 && !q.IsProbablePrime(certainty, true)) + continue; + + break; + } + } + else + { + // Note: Modified from Java version for speed + for (;;) + { + q = new BigInteger(qLength, 0, random); + + retry: + for (int i = 0; i < primeLists.Length; ++i) + { + int test = q.Remainder(BigPrimeProducts[i]).IntValue; + + if (i == 0) + { + int rem3 = test % 3; + if (rem3 != 2) + { + int diff = 2 * rem3 + 2; + q = q.Add(BigInteger.ValueOf(diff)); + test = (test + diff) % primeProducts[i]; + } + } + + int[] primeList = primeLists[i]; + for (int j = 0; j < primeList.Length; ++j) + { + int prime = primeList[j]; + int qRem = test % prime; + if (qRem == 0 || qRem == (prime >> 1)) + { + q = q.Add(Six); + goto retry; + } + } + } + + if (q.BitLength != qLength) + continue; + + if (!q.RabinMillerTest(2, random, true)) + continue; + + p = q.ShiftLeft(1).Add(BigInteger.One); + + if (!p.RabinMillerTest(certainty, random, true)) + continue; + + if (certainty > 2 && !q.RabinMillerTest(certainty - 2, random, true)) + continue; + + /* + * Require a minimum weight of the NAF representation, since low-weight primes may be + * weak against a version of the number-field-sieve for the discrete-logarithm-problem. + * + * See "The number field sieve for integers of low weight", Oliver Schirokauer. + */ + if (WNafUtilities.GetNafWeight(p) < minWeight) + continue; + + break; + } + } + + return new BigInteger[] { p, q }; + } + + /* + * Select a high order element of the multiplicative group Zp* + * + * p and q must be s.t. p = 2*q + 1, where p and q are prime (see generateSafePrimes) + */ + internal static BigInteger SelectGenerator(BigInteger p, BigInteger q, SecureRandom random) + { + BigInteger pMinusTwo = p.Subtract(BigInteger.Two); + BigInteger g; + + /* + * (see: Handbook of Applied Cryptography 4.80) + */ +// do +// { +// g = BigIntegers.CreateRandomInRange(BigInteger.Two, pMinusTwo, random); +// } +// while (g.ModPow(BigInteger.Two, p).Equals(BigInteger.One) +// || g.ModPow(q, p).Equals(BigInteger.One)); + + /* + * RFC 2631 2.2.1.2 (and see: Handbook of Applied Cryptography 4.81) + */ + do + { + BigInteger h = BigIntegers.CreateRandomInRange(BigInteger.Two, pMinusTwo, random); + + g = h.ModPow(BigInteger.Two, p); + } + while (g.Equals(BigInteger.One)); + + return g; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersHelper.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersHelper.cs.meta new file mode 100644 index 00000000..4ac84dcd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DHParametersHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4fdec6c91ff77e41add37910a845fa0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesEdeKeyGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesEdeKeyGenerator.cs new file mode 100644 index 00000000..f5598056 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesEdeKeyGenerator.cs @@ -0,0 +1,71 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + public class DesEdeKeyGenerator + : DesKeyGenerator + { + public DesEdeKeyGenerator() + { + } + + internal DesEdeKeyGenerator( + int defaultStrength) + : base(defaultStrength) + { + } + + /** + * initialise the key generator - if strength is set to zero + * the key Generated will be 192 bits in size, otherwise + * strength can be 128 or 192 (or 112 or 168 if you don't count + * parity bits), depending on whether you wish to do 2-key or 3-key + * triple DES. + * + * @param param the parameters to be used for key generation + */ + protected override void engineInit( + KeyGenerationParameters parameters) + { + this.random = parameters.Random; + this.strength = (parameters.Strength + 7) / 8; + + if (strength == 0 || strength == (168 / 8)) + { + strength = DesEdeParameters.DesEdeKeyLength; + } + else if (strength == (112 / 8)) + { + strength = 2 * DesEdeParameters.DesKeyLength; + } + else if (strength != DesEdeParameters.DesEdeKeyLength + && strength != (2 * DesEdeParameters.DesKeyLength)) + { + throw new ArgumentException("DESede key must be " + + (DesEdeParameters.DesEdeKeyLength * 8) + " or " + + (2 * 8 * DesEdeParameters.DesKeyLength) + + " bits long."); + } + } + + protected override byte[] engineGenerateKey() + { + byte[] newKey = new byte[strength]; + + do + { + random.NextBytes(newKey); + DesEdeParameters.SetOddParity(newKey); + } + while (DesEdeParameters.IsWeakKey(newKey, 0, newKey.Length) || !DesEdeParameters.IsRealEdeKey(newKey, 0)); + + return newKey; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesEdeKeyGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesEdeKeyGenerator.cs.meta new file mode 100644 index 00000000..4488aa9e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesEdeKeyGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2aaa0fb6f892b1f46a0b89ffe9d98654 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesKeyGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesKeyGenerator.cs new file mode 100644 index 00000000..845583f3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesKeyGenerator.cs @@ -0,0 +1,61 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + public class DesKeyGenerator + : CipherKeyGenerator + { + public DesKeyGenerator() + { + } + + internal DesKeyGenerator( + int defaultStrength) + : base(defaultStrength) + { + } + + /** + * initialise the key generator - if strength is set to zero + * the key generated will be 64 bits in size, otherwise + * strength can be 64 or 56 bits (if you don't count the parity bits). + * + * @param param the parameters to be used for key generation + */ + protected override void engineInit( + KeyGenerationParameters parameters) + { + base.engineInit(parameters); + + if (strength == 0 || strength == (56 / 8)) + { + strength = DesParameters.DesKeyLength; + } + else if (strength != DesParameters.DesKeyLength) + { + throw new ArgumentException( + "DES key must be " + (DesParameters.DesKeyLength * 8) + " bits long."); + } + } + + protected override byte[] engineGenerateKey() + { + byte[] newKey = new byte[DesParameters.DesKeyLength]; + + do + { + random.NextBytes(newKey); + DesParameters.SetOddParity(newKey); + } + while (DesParameters.IsWeakKey(newKey, 0)); + + return newKey; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesKeyGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesKeyGenerator.cs.meta new file mode 100644 index 00000000..6f8f5325 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DesKeyGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f5d7742609933942bd3204450aabe4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaKeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaKeyPairGenerator.cs new file mode 100644 index 00000000..58dec1b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaKeyPairGenerator.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * a DSA key pair generator. + * + * This Generates DSA keys in line with the method described + * in FIPS 186-3 B.1 FFC Key Pair Generation. + */ + public class DsaKeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private static readonly BigInteger One = BigInteger.One; + + private DsaKeyGenerationParameters param; + + public void Init( + KeyGenerationParameters parameters) + { + if (parameters == null) + throw new ArgumentNullException("parameters"); + + // Note: If we start accepting instances of KeyGenerationParameters, + // must apply constraint checking on strength (see DsaParametersGenerator.Init) + + this.param = (DsaKeyGenerationParameters) parameters; + } + + public AsymmetricCipherKeyPair GenerateKeyPair() + { + DsaParameters dsaParams = param.Parameters; + + BigInteger x = GeneratePrivateKey(dsaParams.Q, param.Random); + BigInteger y = CalculatePublicKey(dsaParams.P, dsaParams.G, x); + + return new AsymmetricCipherKeyPair( + new DsaPublicKeyParameters(y, dsaParams), + new DsaPrivateKeyParameters(x, dsaParams)); + } + + private static BigInteger GeneratePrivateKey(BigInteger q, SecureRandom random) + { + // B.1.2 Key Pair Generation by Testing Candidates + int minWeight = q.BitLength >> 2; + for (;;) + { + // TODO Prefer this method? (change test cases that used fixed random) + // B.1.1 Key Pair Generation Using Extra Random Bits + //BigInteger x = new BigInteger(q.BitLength + 64, random).Mod(q.Subtract(One)).Add(One); + + BigInteger x = BigIntegers.CreateRandomInRange(One, q.Subtract(One), random); + if (WNafUtilities.GetNafWeight(x) >= minWeight) + { + return x; + } + } + } + + private static BigInteger CalculatePublicKey(BigInteger p, BigInteger g, BigInteger x) + { + return g.ModPow(x, p); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaKeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaKeyPairGenerator.cs.meta new file mode 100644 index 00000000..0c06ea31 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaKeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 81ed675e8e1609d468d4e8957e891e0e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaParametersGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaParametersGenerator.cs new file mode 100644 index 00000000..26dfca3f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaParametersGenerator.cs @@ -0,0 +1,359 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Generate suitable parameters for DSA, in line with FIPS 186-2, or FIPS 186-3. + */ + public class DsaParametersGenerator + { + private IDigest digest; + private int L, N; + private int certainty; + private SecureRandom random; + private bool use186_3; + private int usageIndex; + + public DsaParametersGenerator() + : this(new Sha1Digest()) + { + } + + public DsaParametersGenerator(IDigest digest) + { + this.digest = digest; + } + + /// Initialise the generator + /// This form can only be used for older DSA (pre-DSA2) parameters + /// the size of keys in bits (from 512 up to 1024, and a multiple of 64) + /// measure of robustness of primes (at least 80 for FIPS 186-2 compliance) + /// the source of randomness to use + public virtual void Init( + int size, + int certainty, + SecureRandom random) + { + if (!IsValidDsaStrength(size)) + throw new ArgumentException("size must be from 512 - 1024 and a multiple of 64", "size"); + + this.use186_3 = false; + this.L = size; + this.N = GetDefaultN(size); + this.certainty = certainty; + this.random = random; + } + + /// Initialise the generator for DSA 2 + /// You must use this Init method if you need to generate parameters for DSA 2 keys + /// An instance of DsaParameterGenerationParameters used to configure this generator + public virtual void Init(DsaParameterGenerationParameters parameters) + { + // TODO Should we enforce the minimum 'certainty' values as per C.3 Table C.1? + this.use186_3 = true; + this.L = parameters.L; + this.N = parameters.N; + this.certainty = parameters.Certainty; + this.random = parameters.Random; + this.usageIndex = parameters.UsageIndex; + + if ((L < 1024 || L > 3072) || L % 1024 != 0) + throw new ArgumentException("Values must be between 1024 and 3072 and a multiple of 1024", "L"); + if (L == 1024 && N != 160) + throw new ArgumentException("N must be 160 for L = 1024"); + if (L == 2048 && (N != 224 && N != 256)) + throw new ArgumentException("N must be 224 or 256 for L = 2048"); + if (L == 3072 && N != 256) + throw new ArgumentException("N must be 256 for L = 3072"); + + if (digest.GetDigestSize() * 8 < N) + throw new InvalidOperationException("Digest output size too small for value of N"); + } + + /// Generates a set of DsaParameters + /// Can take a while... + public virtual DsaParameters GenerateParameters() + { + return use186_3 + ? GenerateParameters_FIPS186_3() + : GenerateParameters_FIPS186_2(); + } + + protected virtual DsaParameters GenerateParameters_FIPS186_2() + { + byte[] seed = new byte[20]; + byte[] part1 = new byte[20]; + byte[] part2 = new byte[20]; + byte[] u = new byte[20]; + int n = (L - 1) / 160; + byte[] w = new byte[L / 8]; + + if (!(digest is Sha1Digest)) + throw new InvalidOperationException("can only use SHA-1 for generating FIPS 186-2 parameters"); + + for (;;) + { + random.NextBytes(seed); + + Hash(digest, seed, part1); + Array.Copy(seed, 0, part2, 0, seed.Length); + Inc(part2); + Hash(digest, part2, part2); + + for (int i = 0; i != u.Length; i++) + { + u[i] = (byte)(part1[i] ^ part2[i]); + } + + u[0] |= (byte)0x80; + u[19] |= (byte)0x01; + + BigInteger q = new BigInteger(1, u); + + if (!q.IsProbablePrime(certainty)) + continue; + + byte[] offset = Arrays.Clone(seed); + Inc(offset); + + for (int counter = 0; counter < 4096; ++counter) + { + for (int k = 0; k < n; k++) + { + Inc(offset); + Hash(digest, offset, part1); + Array.Copy(part1, 0, w, w.Length - (k + 1) * part1.Length, part1.Length); + } + + Inc(offset); + Hash(digest, offset, part1); + Array.Copy(part1, part1.Length - ((w.Length - (n) * part1.Length)), w, 0, w.Length - n * part1.Length); + + w[0] |= (byte)0x80; + + BigInteger x = new BigInteger(1, w); + + BigInteger c = x.Mod(q.ShiftLeft(1)); + + BigInteger p = x.Subtract(c.Subtract(BigInteger.One)); + + if (p.BitLength != L) + continue; + + if (p.IsProbablePrime(certainty)) + { + BigInteger g = CalculateGenerator_FIPS186_2(p, q, random); + + return new DsaParameters(p, q, g, new DsaValidationParameters(seed, counter)); + } + } + } + } + + protected virtual BigInteger CalculateGenerator_FIPS186_2(BigInteger p, BigInteger q, SecureRandom r) + { + BigInteger e = p.Subtract(BigInteger.One).Divide(q); + BigInteger pSub2 = p.Subtract(BigInteger.Two); + + for (;;) + { + BigInteger h = BigIntegers.CreateRandomInRange(BigInteger.Two, pSub2, r); + BigInteger g = h.ModPow(e, p); + + if (g.BitLength > 1) + return g; + } + } + + /** + * generate suitable parameters for DSA, in line with + * FIPS 186-3 A.1 Generation of the FFC Primes p and q. + */ + protected virtual DsaParameters GenerateParameters_FIPS186_3() + { +// A.1.1.2 Generation of the Probable Primes p and q Using an Approved Hash Function + IDigest d = digest; + int outlen = d.GetDigestSize() * 8; + +// 1. Check that the (L, N) pair is in the list of acceptable (L, N pairs) (see Section 4.2). If +// the pair is not in the list, then return INVALID. + // Note: checked at initialisation + +// 2. If (seedlen < N), then return INVALID. + // FIXME This should be configurable (must be >= N) + int seedlen = N; + byte[] seed = new byte[seedlen / 8]; + +// 3. n = ceiling(L ⁄ outlen) – 1. + int n = (L - 1) / outlen; + +// 4. b = L – 1 – (n ∗ outlen). + int b = (L - 1) % outlen; + + byte[] output = new byte[d.GetDigestSize()]; + for (;;) + { +// 5. Get an arbitrary sequence of seedlen bits as the domain_parameter_seed. + random.NextBytes(seed); + +// 6. U = Hash (domain_parameter_seed) mod 2^(N–1). + Hash(d, seed, output); + BigInteger U = new BigInteger(1, output).Mod(BigInteger.One.ShiftLeft(N - 1)); + +// 7. q = 2^(N–1) + U + 1 – ( U mod 2). + BigInteger q = U.SetBit(0).SetBit(N - 1); + +// 8. Test whether or not q is prime as specified in Appendix C.3. + // TODO Review C.3 for primality checking + if (!q.IsProbablePrime(certainty)) + { +// 9. If q is not a prime, then go to step 5. + continue; + } + +// 10. offset = 1. + // Note: 'offset' value managed incrementally + byte[] offset = Arrays.Clone(seed); + +// 11. For counter = 0 to (4L – 1) do + int counterLimit = 4 * L; + for (int counter = 0; counter < counterLimit; ++counter) + { +// 11.1 For j = 0 to n do +// Vj = Hash ((domain_parameter_seed + offset + j) mod 2^seedlen). +// 11.2 W = V0 + (V1 ∗ 2^outlen) + ... + (V^(n–1) ∗ 2^((n–1) ∗ outlen)) + ((Vn mod 2^b) ∗ 2^(n ∗ outlen)). + // TODO Assemble w as a byte array + BigInteger W = BigInteger.Zero; + for (int j = 0, exp = 0; j <= n; ++j, exp += outlen) + { + Inc(offset); + Hash(d, offset, output); + + BigInteger Vj = new BigInteger(1, output); + if (j == n) + { + Vj = Vj.Mod(BigInteger.One.ShiftLeft(b)); + } + + W = W.Add(Vj.ShiftLeft(exp)); + } + +// 11.3 X = W + 2^(L–1). Comment: 0 ≤ W < 2L–1; hence, 2L–1 ≤ X < 2L. + BigInteger X = W.Add(BigInteger.One.ShiftLeft(L - 1)); + +// 11.4 c = X mod 2q. + BigInteger c = X.Mod(q.ShiftLeft(1)); + +// 11.5 p = X - (c - 1). Comment: p ≡ 1 (mod 2q). + BigInteger p = X.Subtract(c.Subtract(BigInteger.One)); + + // 11.6 If (p < 2^(L - 1)), then go to step 11.9 + if (p.BitLength != L) + continue; + +// 11.7 Test whether or not p is prime as specified in Appendix C.3. + // TODO Review C.3 for primality checking + if (p.IsProbablePrime(certainty)) + { +// 11.8 If p is determined to be prime, then return VALID and the values of p, q and +// (optionally) the values of domain_parameter_seed and counter. + // TODO Make configurable (8-bit unsigned)? + + if (usageIndex >= 0) + { + BigInteger g = CalculateGenerator_FIPS186_3_Verifiable(d, p, q, seed, usageIndex); + if (g != null) + return new DsaParameters(p, q, g, new DsaValidationParameters(seed, counter, usageIndex)); + } + + { + BigInteger g = CalculateGenerator_FIPS186_3_Unverifiable(p, q, random); + + return new DsaParameters(p, q, g, new DsaValidationParameters(seed, counter)); + } + } + +// 11.9 offset = offset + n + 1. Comment: Increment offset; then, as part of +// the loop in step 11, increment counter; if +// counter < 4L, repeat steps 11.1 through 11.8. + // Note: 'offset' value already incremented in inner loop + } +// 12. Go to step 5. + } + } + + protected virtual BigInteger CalculateGenerator_FIPS186_3_Unverifiable(BigInteger p, BigInteger q, + SecureRandom r) + { + return CalculateGenerator_FIPS186_2(p, q, r); + } + + protected virtual BigInteger CalculateGenerator_FIPS186_3_Verifiable(IDigest d, BigInteger p, BigInteger q, + byte[] seed, int index) + { + // A.2.3 Verifiable Canonical Generation of the Generator g + BigInteger e = p.Subtract(BigInteger.One).Divide(q); + byte[] ggen = Hex.Decode("6767656E"); + + // 7. U = domain_parameter_seed || "ggen" || index || count. + byte[] U = new byte[seed.Length + ggen.Length + 1 + 2]; + Array.Copy(seed, 0, U, 0, seed.Length); + Array.Copy(ggen, 0, U, seed.Length, ggen.Length); + U[U.Length - 3] = (byte)index; + + byte[] w = new byte[d.GetDigestSize()]; + for (int count = 1; count < (1 << 16); ++count) + { + Inc(U); + Hash(d, U, w); + BigInteger W = new BigInteger(1, w); + BigInteger g = W.ModPow(e, p); + + if (g.CompareTo(BigInteger.Two) >= 0) + return g; + } + + return null; + } + + private static bool IsValidDsaStrength( + int strength) + { + return strength >= 512 && strength <= 1024 && strength % 64 == 0; + } + + protected static void Hash(IDigest d, byte[] input, byte[] output) + { + d.BlockUpdate(input, 0, input.Length); + d.DoFinal(output, 0); + } + + private static int GetDefaultN(int L) + { + return L > 1024 ? 256 : 160; + } + + protected static void Inc(byte[] buf) + { + for (int i = buf.Length - 1; i >= 0; --i) + { + byte b = (byte)(buf[i] + 1); + buf[i] = b; + + if (b != 0) + break; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaParametersGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaParametersGenerator.cs.meta new file mode 100644 index 00000000..fb0a7bf7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/DsaParametersGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5d1e4f356c022fc448e391006e5ad3ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ECKeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ECKeyPairGenerator.cs new file mode 100644 index 00000000..6bb89a51 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ECKeyPairGenerator.cs @@ -0,0 +1,166 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + public class ECKeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private readonly string algorithm; + + private ECDomainParameters parameters; + private DerObjectIdentifier publicKeyParamSet; + private SecureRandom random; + + public ECKeyPairGenerator() + : this("EC") + { + } + + public ECKeyPairGenerator( + string algorithm) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + + this.algorithm = ECKeyParameters.VerifyAlgorithmName(algorithm); + } + + public void Init( + KeyGenerationParameters parameters) + { + if (parameters is ECKeyGenerationParameters) + { + ECKeyGenerationParameters ecP = (ECKeyGenerationParameters) parameters; + + this.publicKeyParamSet = ecP.PublicKeyParamSet; + this.parameters = ecP.DomainParameters; + } + else + { + DerObjectIdentifier oid; + switch (parameters.Strength) + { + case 192: + oid = X9ObjectIdentifiers.Prime192v1; + break; + case 224: + oid = SecObjectIdentifiers.SecP224r1; + break; + case 239: + oid = X9ObjectIdentifiers.Prime239v1; + break; + case 256: + oid = X9ObjectIdentifiers.Prime256v1; + break; + case 384: + oid = SecObjectIdentifiers.SecP384r1; + break; + case 521: + oid = SecObjectIdentifiers.SecP521r1; + break; + default: + throw new InvalidParameterException("unknown key size."); + } + + X9ECParameters ecps = FindECCurveByOid(oid); + + this.publicKeyParamSet = oid; + this.parameters = new ECDomainParameters( + ecps.Curve, ecps.G, ecps.N, ecps.H, ecps.GetSeed()); + } + + this.random = parameters.Random; + + if (this.random == null) + { + this.random = new SecureRandom(); + } + } + + /** + * Given the domain parameters this routine generates an EC key + * pair in accordance with X9.62 section 5.2.1 pages 26, 27. + */ + public AsymmetricCipherKeyPair GenerateKeyPair() + { + BigInteger n = parameters.N; + BigInteger d; + int minWeight = n.BitLength >> 2; + + for (;;) + { + d = new BigInteger(n.BitLength, random); + + if (d.CompareTo(BigInteger.Two) < 0 || d.CompareTo(n) >= 0) + continue; + + if (WNafUtilities.GetNafWeight(d) < minWeight) + continue; + + break; + } + + ECPoint q = CreateBasePointMultiplier().Multiply(parameters.G, d); + + if (publicKeyParamSet != null) + { + return new AsymmetricCipherKeyPair( + new ECPublicKeyParameters(algorithm, q, publicKeyParamSet), + new ECPrivateKeyParameters(algorithm, d, publicKeyParamSet)); + } + + return new AsymmetricCipherKeyPair( + new ECPublicKeyParameters(algorithm, q, parameters), + new ECPrivateKeyParameters(algorithm, d, parameters)); + } + + protected virtual ECMultiplier CreateBasePointMultiplier() + { + return new FixedPointCombMultiplier(); + } + + internal static X9ECParameters FindECCurveByOid(DerObjectIdentifier oid) + { + // TODO ECGost3410NamedCurves support (returns ECDomainParameters though) + + X9ECParameters ecP = CustomNamedCurves.GetByOid(oid); + if (ecP == null) + { + ecP = ECNamedCurveTable.GetByOid(oid); + } + return ecP; + } + + internal static ECPublicKeyParameters GetCorrespondingPublicKey( + ECPrivateKeyParameters privKey) + { + ECDomainParameters ec = privKey.Parameters; + ECPoint q = new FixedPointCombMultiplier().Multiply(ec.G, privKey.D); + + if (privKey.PublicKeyParamSet != null) + { + return new ECPublicKeyParameters(privKey.AlgorithmName, q, privKey.PublicKeyParamSet); + } + + return new ECPublicKeyParameters(privKey.AlgorithmName, q, ec); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ECKeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ECKeyPairGenerator.cs.meta new file mode 100644 index 00000000..f483b84f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ECKeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd6193d5b658f3549963a15501652b67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed25519KeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed25519KeyPairGenerator.cs new file mode 100644 index 00000000..12907cf0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed25519KeyPairGenerator.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + public class Ed25519KeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private SecureRandom random; + + public virtual void Init(KeyGenerationParameters parameters) + { + this.random = parameters.Random; + } + + public virtual AsymmetricCipherKeyPair GenerateKeyPair() + { + Ed25519PrivateKeyParameters privateKey = new Ed25519PrivateKeyParameters(random); + Ed25519PublicKeyParameters publicKey = privateKey.GeneratePublicKey(); + return new AsymmetricCipherKeyPair(publicKey, privateKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed25519KeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed25519KeyPairGenerator.cs.meta new file mode 100644 index 00000000..b5889e72 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed25519KeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2a3de68bed278f408115696520ae15f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed448KeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed448KeyPairGenerator.cs new file mode 100644 index 00000000..d86183d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed448KeyPairGenerator.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + public class Ed448KeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private SecureRandom random; + + public virtual void Init(KeyGenerationParameters parameters) + { + this.random = parameters.Random; + } + + public virtual AsymmetricCipherKeyPair GenerateKeyPair() + { + Ed448PrivateKeyParameters privateKey = new Ed448PrivateKeyParameters(random); + Ed448PublicKeyParameters publicKey = privateKey.GeneratePublicKey(); + return new AsymmetricCipherKeyPair(publicKey, privateKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed448KeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed448KeyPairGenerator.cs.meta new file mode 100644 index 00000000..26fcf3f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Ed448KeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56076fa04e5259c439c2b244cf9b73c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalKeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalKeyPairGenerator.cs new file mode 100644 index 00000000..b9fef7d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalKeyPairGenerator.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * a ElGamal key pair generator. + *

+ * This Generates keys consistent for use with ElGamal as described in + * page 164 of "Handbook of Applied Cryptography".

+ */ + public class ElGamalKeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private ElGamalKeyGenerationParameters param; + + public void Init( + KeyGenerationParameters parameters) + { + this.param = (ElGamalKeyGenerationParameters) parameters; + } + + public AsymmetricCipherKeyPair GenerateKeyPair() + { + DHKeyGeneratorHelper helper = DHKeyGeneratorHelper.Instance; + ElGamalParameters egp = param.Parameters; + DHParameters dhp = new DHParameters(egp.P, egp.G, null, 0, egp.L); + + BigInteger x = helper.CalculatePrivate(dhp, param.Random); + BigInteger y = helper.CalculatePublic(dhp, x); + + return new AsymmetricCipherKeyPair( + new ElGamalPublicKeyParameters(y, egp), + new ElGamalPrivateKeyParameters(x, egp)); + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalKeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalKeyPairGenerator.cs.meta new file mode 100644 index 00000000..972fe84d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalKeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d3c646aa86666e4ca77bdb7f900d2df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalParametersGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalParametersGenerator.cs new file mode 100644 index 00000000..234d6f64 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalParametersGenerator.cs @@ -0,0 +1,50 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + public class ElGamalParametersGenerator + { + private int size; + private int certainty; + private SecureRandom random; + + public void Init( + int size, + int certainty, + SecureRandom random) + { + this.size = size; + this.certainty = certainty; + this.random = random; + } + + /** + * which Generates the p and g values from the given parameters, + * returning the ElGamalParameters object. + *

+ * Note: can take a while... + *

+ */ + public ElGamalParameters GenerateParameters() + { + // + // find a safe prime p where p = 2*q + 1, where p and q are prime. + // + BigInteger[] safePrimes = DHParametersHelper.GenerateSafePrimes(size, certainty, random); + + BigInteger p = safePrimes[0]; + BigInteger q = safePrimes[1]; + BigInteger g = DHParametersHelper.SelectGenerator(p, q, random); + + return new ElGamalParameters(p, g); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalParametersGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalParametersGenerator.cs.meta new file mode 100644 index 00000000..ec9f323a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/ElGamalParametersGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0463e1119f1f8b94182ba9a9cdf26312 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410KeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410KeyPairGenerator.cs new file mode 100644 index 00000000..eff645be --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410KeyPairGenerator.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * a GOST3410 key pair generator. + * This generates GOST3410 keys in line with the method described + * in GOST R 34.10-94. + */ + public class Gost3410KeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private Gost3410KeyGenerationParameters param; + + public void Init( + KeyGenerationParameters parameters) + { + if (parameters is Gost3410KeyGenerationParameters) + { + this.param = (Gost3410KeyGenerationParameters) parameters; + } + else + { + Gost3410KeyGenerationParameters kgp = new Gost3410KeyGenerationParameters( + parameters.Random, + CryptoProObjectIdentifiers.GostR3410x94CryptoProA); + + if (parameters.Strength != kgp.Parameters.P.BitLength - 1) + { + // TODO Should we complain? + } + + this.param = kgp; + } + } + + public AsymmetricCipherKeyPair GenerateKeyPair() + { + SecureRandom random = param.Random; + Gost3410Parameters gost3410Params = param.Parameters; + + BigInteger q = gost3410Params.Q, x; + + int minWeight = 64; + for (;;) + { + x = new BigInteger(256, random); + + if (x.SignValue < 1 || x.CompareTo(q) >= 0) + continue; + + if (WNafUtilities.GetNafWeight(x) < minWeight) + continue; + + break; + } + + BigInteger p = gost3410Params.P; + BigInteger a = gost3410Params.A; + + // calculate the public key. + BigInteger y = a.ModPow(x, p); + + if (param.PublicKeyParamSet != null) + { + return new AsymmetricCipherKeyPair( + new Gost3410PublicKeyParameters(y, param.PublicKeyParamSet), + new Gost3410PrivateKeyParameters(x, param.PublicKeyParamSet)); + } + + return new AsymmetricCipherKeyPair( + new Gost3410PublicKeyParameters(y, gost3410Params), + new Gost3410PrivateKeyParameters(x, gost3410Params)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410KeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410KeyPairGenerator.cs.meta new file mode 100644 index 00000000..98223ab3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410KeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f3d826c975554e4a92fe8058998f65a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410ParametersGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410ParametersGenerator.cs new file mode 100644 index 00000000..cdb80f08 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410ParametersGenerator.cs @@ -0,0 +1,534 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * generate suitable parameters for GOST3410. + */ + public class Gost3410ParametersGenerator + { + private int size; + private int typeproc; + private SecureRandom init_random; + + /** + * initialise the key generator. + * + * @param size size of the key + * @param typeProcedure type procedure A,B = 1; A',B' - else + * @param random random byte source. + */ + public void Init( + int size, + int typeProcedure, + SecureRandom random) + { + this.size = size; + this.typeproc = typeProcedure; + this.init_random = random; + } + + //Procedure A + private int procedure_A(int x0, int c, BigInteger[] pq, int size) + { + //Verify and perform condition: 065536) + { + x0 = init_random.NextInt()/32768; + } + + while((c<0 || c>65536) || (c/2==0)) + { + c = init_random.NextInt()/32768 + 1; + } + + BigInteger C = BigInteger.ValueOf(c); + BigInteger constA16 = BigInteger.ValueOf(19381); + + //step1 + BigInteger[] y = new BigInteger[1]; // begin length = 1 + y[0] = BigInteger.ValueOf(x0); + + //step 2 + int[] t = new int[1]; // t - orders; begin length = 1 + t[0] = size; + int s = 0; + for (int i=0; t[i]>=17; i++) + { + // extension array t + int[] tmp_t = new int[t.Length + 1]; /////////////// + Array.Copy(t,0,tmp_t,0,t.Length); // extension + t = new int[tmp_t.Length]; // array t + Array.Copy(tmp_t, 0, t, 0, tmp_t.Length); /////////////// + + t[i+1] = t[i]/2; + s = i+1; + } + + //step3 + BigInteger[] p = new BigInteger[s+1]; + p[s] = new BigInteger("8003",16); //set min prime number length 16 bit + + int m = s-1; //step4 + + for (int i=0; i t[m]) + { + goto step6; //step 12 + } + + p[m] = NByLastP.Add(BigInteger.One); + + //step13 + if (BigInteger.Two.ModPow(NByLastP, p[m]).CompareTo(BigInteger.One) == 0 + && BigInteger.Two.ModPow(N, p[m]).CompareTo(BigInteger.One) != 0) + { + break; + } + + N = N.Add(BigInteger.Two); + } + + if (--m < 0) + { + pq[0] = p[0]; + pq[1] = p[1]; + return y[0].IntValue; //return for procedure B step 2 + } + + break; //step 14 + } + } + return y[0].IntValue; + } + + //Procedure A' + private long procedure_Aa(long x0, long c, BigInteger[] pq, int size) + { + //Verify and perform condition: 04294967296L) + { + x0 = init_random.NextInt()*2; + } + + while((c<0 || c>4294967296L) || (c/2==0)) + { + c = init_random.NextInt()*2+1; + } + + BigInteger C = BigInteger.ValueOf(c); + BigInteger constA32 = BigInteger.ValueOf(97781173); + + //step1 + BigInteger[] y = new BigInteger[1]; // begin length = 1 + y[0] = BigInteger.ValueOf(x0); + + //step 2 + int[] t = new int[1]; // t - orders; begin length = 1 + t[0] = size; + int s = 0; + for (int i=0; t[i]>=33; i++) + { + // extension array t + int[] tmp_t = new int[t.Length + 1]; /////////////// + Array.Copy(t,0,tmp_t,0,t.Length); // extension + t = new int[tmp_t.Length]; // array t + Array.Copy(tmp_t, 0, t, 0, tmp_t.Length); /////////////// + + t[i+1] = t[i]/2; + s = i+1; + } + + //step3 + BigInteger[] p = new BigInteger[s+1]; + p[s] = new BigInteger("8000000B",16); //set min prime number length 32 bit + + int m = s-1; //step4 + + for (int i=0; i t[m]) + { + goto step6; //step 12 + } + + p[m] = NByLastP.Add(BigInteger.One); + + //step13 + if (BigInteger.Two.ModPow(NByLastP, p[m]).CompareTo(BigInteger.One) == 0 + && BigInteger.Two.ModPow(N, p[m]).CompareTo(BigInteger.One) != 0) + { + break; + } + + N = N.Add(BigInteger.Two); + } + + if (--m < 0) + { + pq[0] = p[0]; + pq[1] = p[1]; + return y[0].LongValue; //return for procedure B' step 2 + } + + break; //step 14 + } + } + return y[0].LongValue; + } + + //Procedure B + private void procedure_B(int x0, int c, BigInteger[] pq) + { + //Verify and perform condition: 065536) + { + x0 = init_random.NextInt()/32768; + } + + while((c<0 || c>65536) || (c/2==0)) + { + c = init_random.NextInt()/32768 + 1; + } + + BigInteger [] qp = new BigInteger[2]; + BigInteger q = null, Q = null, p = null; + BigInteger C = BigInteger.ValueOf(c); + BigInteger constA16 = BigInteger.ValueOf(19381); + + //step1 + x0 = procedure_A(x0, c, qp, 256); + q = qp[0]; + + //step2 + x0 = procedure_A(x0, c, qp, 512); + Q = qp[0]; + + BigInteger[] y = new BigInteger[65]; + y[0] = BigInteger.ValueOf(x0); + + const int tp = 1024; + + BigInteger qQ = q.Multiply(Q); + +step3: + for(;;) + { + //step 3 + for (int j=0; j<64; j++) + { + y[j+1] = (y[j].Multiply(constA16).Add(C)).Mod(BigInteger.Two.Pow(16)); + } + + //step 4 + BigInteger Y = BigInteger.Zero; + + for (int j=0; j<64; j++) + { + Y = Y.Add(y[j].ShiftLeft(16*j)); + } + + y[0] = y[64]; //step 5 + + //step 6 + BigInteger N = BigInteger.One.ShiftLeft(tp-1).Divide(qQ).Add( + Y.ShiftLeft(tp-1).Divide(qQ.ShiftLeft(1024))); + + if (N.TestBit(0)) + { + N = N.Add(BigInteger.One); + } + + //step 7 + + for(;;) + { + //step 11 + BigInteger qQN = qQ.Multiply(N); + + if (qQN.BitLength > tp) + { + goto step3; //step 9 + } + + p = qQN.Add(BigInteger.One); + + //step10 + if (BigInteger.Two.ModPow(qQN, p).CompareTo(BigInteger.One) == 0 + && BigInteger.Two.ModPow(q.Multiply(N), p).CompareTo(BigInteger.One) != 0) + { + pq[0] = p; + pq[1] = q; + return; + } + + N = N.Add(BigInteger.Two); + } + } + } + + //Procedure B' + private void procedure_Bb(long x0, long c, BigInteger[] pq) + { + //Verify and perform condition: 04294967296L) + { + x0 = init_random.NextInt()*2; + } + + while((c<0 || c>4294967296L) || (c/2==0)) + { + c = init_random.NextInt()*2+1; + } + + BigInteger [] qp = new BigInteger[2]; + BigInteger q = null, Q = null, p = null; + BigInteger C = BigInteger.ValueOf(c); + BigInteger constA32 = BigInteger.ValueOf(97781173); + + //step1 + x0 = procedure_Aa(x0, c, qp, 256); + q = qp[0]; + + //step2 + x0 = procedure_Aa(x0, c, qp, 512); + Q = qp[0]; + + BigInteger[] y = new BigInteger[33]; + y[0] = BigInteger.ValueOf(x0); + + const int tp = 1024; + + BigInteger qQ = q.Multiply(Q); + +step3: + for(;;) + { + //step 3 + for (int j=0; j<32; j++) + { + y[j+1] = (y[j].Multiply(constA32).Add(C)).Mod(BigInteger.Two.Pow(32)); + } + + //step 4 + BigInteger Y = BigInteger.Zero; + for (int j=0; j<32; j++) + { + Y = Y.Add(y[j].ShiftLeft(32*j)); + } + + y[0] = y[32]; //step 5 + + //step 6 + BigInteger N = BigInteger.One.ShiftLeft(tp-1).Divide(qQ).Add( + Y.ShiftLeft(tp-1).Divide(qQ.ShiftLeft(1024))); + + if (N.TestBit(0)) + { + N = N.Add(BigInteger.One); + } + + //step 7 + + for(;;) + { + //step 11 + BigInteger qQN = qQ.Multiply(N); + + if (qQN.BitLength > tp) + { + goto step3; //step 9 + } + + p = qQN.Add(BigInteger.One); + + //step10 + if (BigInteger.Two.ModPow(qQN, p).CompareTo(BigInteger.One) == 0 + && BigInteger.Two.ModPow(q.Multiply(N), p).CompareTo(BigInteger.One) != 0) + { + pq[0] = p; + pq[1] = q; + return; + } + + N = N.Add(BigInteger.Two); + } + } + } + + + /** + * Procedure C + * procedure generates the a value from the given p,q, + * returning the a value. + */ + private BigInteger procedure_C(BigInteger p, BigInteger q) + { + BigInteger pSub1 = p.Subtract(BigInteger.One); + BigInteger pSub1Divq = pSub1.Divide(q); + + for(;;) + { + BigInteger d = new BigInteger(p.BitLength, init_random); + + // 1 < d < p-1 + if (d.CompareTo(BigInteger.One) > 0 && d.CompareTo(pSub1) < 0) + { + BigInteger a = d.ModPow(pSub1Divq, p); + + if (a.CompareTo(BigInteger.One) != 0) + { + return a; + } + } + } + } + + /** + * which generates the p , q and a values from the given parameters, + * returning the Gost3410Parameters object. + */ + public Gost3410Parameters GenerateParameters() + { + BigInteger [] pq = new BigInteger[2]; + BigInteger q = null, p = null, a = null; + + int x0, c; + long x0L, cL; + + if (typeproc==1) + { + x0 = init_random.NextInt(); + c = init_random.NextInt(); + + switch(size) + { + case 512: + procedure_A(x0, c, pq, 512); + break; + case 1024: + procedure_B(x0, c, pq); + break; + default: + throw new ArgumentException("Ooops! key size 512 or 1024 bit."); + } + p = pq[0]; q = pq[1]; + a = procedure_C(p, q); + //System.out.println("p:"+p.toString(16)+"\n"+"q:"+q.toString(16)+"\n"+"a:"+a.toString(16)); + //System.out.println("p:"+p+"\n"+"q:"+q+"\n"+"a:"+a); + return new Gost3410Parameters(p, q, a, new Gost3410ValidationParameters(x0, c)); + } + else + { + x0L = init_random.NextLong(); + cL = init_random.NextLong(); + + switch(size) + { + case 512: + procedure_Aa(x0L, cL, pq, 512); + break; + case 1024: + procedure_Bb(x0L, cL, pq); + break; + default: + throw new InvalidOperationException("Ooops! key size 512 or 1024 bit."); + } + p = pq[0]; q = pq[1]; + a = procedure_C(p, q); + //System.out.println("p:"+p.toString(16)+"\n"+"q:"+q.toString(16)+"\n"+"a:"+a.toString(16)); + //System.out.println("p:"+p+"\n"+"q:"+q+"\n"+"a:"+a); + return new Gost3410Parameters(p, q, a, new Gost3410ValidationParameters(x0L, cL)); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410ParametersGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410ParametersGenerator.cs.meta new file mode 100644 index 00000000..e47ad0c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/GOST3410ParametersGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55c0c063ba32c654d988998faa5cebbf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/HKDFBytesGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/HKDFBytesGenerator.cs new file mode 100644 index 00000000..99b4e5af --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/HKDFBytesGenerator.cs @@ -0,0 +1,156 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * HMAC-based Extract-and-Expand Key Derivation Function (HKDF) implemented + * according to IETF RFC 5869, May 2010 as specified by H. Krawczyk, IBM + * Research & P. Eronen, Nokia. It uses a HMac internally to compute de OKM + * (output keying material) and is likely to have better security properties + * than KDF's based on just a hash function. + */ + public class HkdfBytesGenerator + : IDerivationFunction + { + private HMac hMacHash; + private int hashLen; + + private byte[] info; + private byte[] currentT; + + private int generatedBytes; + + /** + * Creates a HKDFBytesGenerator based on the given hash function. + * + * @param hash the digest to be used as the source of generatedBytes bytes + */ + public HkdfBytesGenerator(IDigest hash) + { + this.hMacHash = new HMac(hash); + this.hashLen = hash.GetDigestSize(); + } + + public virtual void Init(IDerivationParameters parameters) + { + if (!(parameters is HkdfParameters)) + throw new ArgumentException("HKDF parameters required for HkdfBytesGenerator", "parameters"); + + HkdfParameters hkdfParameters = (HkdfParameters)parameters; + if (hkdfParameters.SkipExtract) + { + // use IKM directly as PRK + hMacHash.Init(new KeyParameter(hkdfParameters.GetIkm())); + } + else + { + hMacHash.Init(Extract(hkdfParameters.GetSalt(), hkdfParameters.GetIkm())); + } + + info = hkdfParameters.GetInfo(); + + generatedBytes = 0; + currentT = new byte[hashLen]; + } + + /** + * Performs the extract part of the key derivation function. + * + * @param salt the salt to use + * @param ikm the input keying material + * @return the PRK as KeyParameter + */ + private KeyParameter Extract(byte[] salt, byte[] ikm) + { + if (salt == null) + { + // TODO check if hashLen is indeed same as HMAC size + hMacHash.Init(new KeyParameter(new byte[hashLen])); + } + else + { + hMacHash.Init(new KeyParameter(salt)); + } + + hMacHash.BlockUpdate(ikm, 0, ikm.Length); + + byte[] prk = new byte[hashLen]; + hMacHash.DoFinal(prk, 0); + return new KeyParameter(prk); + } + + /** + * Performs the expand part of the key derivation function, using currentT + * as input and output buffer. + * + * @throws DataLengthException if the total number of bytes generated is larger than the one + * specified by RFC 5869 (255 * HashLen) + */ + private void ExpandNext() + { + int n = generatedBytes / hashLen + 1; + if (n >= 256) + { + throw new DataLengthException( + "HKDF cannot generate more than 255 blocks of HashLen size"); + } + // special case for T(0): T(0) is empty, so no update + if (generatedBytes != 0) + { + hMacHash.BlockUpdate(currentT, 0, hashLen); + } + hMacHash.BlockUpdate(info, 0, info.Length); + hMacHash.Update((byte)n); + hMacHash.DoFinal(currentT, 0); + } + + public virtual IDigest Digest + { + get { return hMacHash.GetUnderlyingDigest(); } + } + + public virtual int GenerateBytes(byte[] output, int outOff, int len) + { + if (generatedBytes + len > 255 * hashLen) + { + throw new DataLengthException( + "HKDF may only be used for 255 * HashLen bytes of output"); + } + + if (generatedBytes % hashLen == 0) + { + ExpandNext(); + } + + // copy what is left in the currentT (1..hash + int toGenerate = len; + int posInT = generatedBytes % hashLen; + int leftInT = hashLen - generatedBytes % hashLen; + int toCopy = System.Math.Min(leftInT, toGenerate); + Array.Copy(currentT, posInT, output, outOff, toCopy); + generatedBytes += toCopy; + toGenerate -= toCopy; + outOff += toCopy; + + while (toGenerate > 0) + { + ExpandNext(); + toCopy = System.Math.Min(hashLen, toGenerate); + Array.Copy(currentT, 0, output, outOff, toCopy); + generatedBytes += toCopy; + toGenerate -= toCopy; + outOff += toCopy; + } + + return len; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/HKDFBytesGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/HKDFBytesGenerator.cs.meta new file mode 100644 index 00000000..5e75b8b3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/HKDFBytesGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 60c549f57c0a75c4bad2d81891b9016c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf1BytesGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf1BytesGenerator.cs new file mode 100644 index 00000000..b99e4e7b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf1BytesGenerator.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * KFD2 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 + *
+ * This implementation is based on IEEE P1363/ISO 18033. + */ + public class Kdf1BytesGenerator + : BaseKdfBytesGenerator + { + /** + * Construct a KDF1 byte generator. + * + * @param digest the digest to be used as the source of derived keys. + */ + public Kdf1BytesGenerator(IDigest digest) + : base(0, digest) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf1BytesGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf1BytesGenerator.cs.meta new file mode 100644 index 00000000..84d21c33 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf1BytesGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d7074bad2d3d06438d11b782fef919d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf2BytesGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf2BytesGenerator.cs new file mode 100644 index 00000000..39683b7c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf2BytesGenerator.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * KDF2 generator for derived keys and ivs as defined by IEEE P1363a/ISO 18033 + *
+ * This implementation is based on IEEE P1363/ISO 18033. + */ + public class Kdf2BytesGenerator + : BaseKdfBytesGenerator + { + /** + * Construct a KDF2 bytes generator. Generates key material + * according to IEEE P1363 or ISO 18033 depending on the initialisation. + * + * @param digest the digest to be used as the source of derived keys. + */ + public Kdf2BytesGenerator(IDigest digest) + : base(1, digest) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf2BytesGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf2BytesGenerator.cs.meta new file mode 100644 index 00000000..1dbf1175 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Kdf2BytesGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 28a22366b40aeec43b46ed5e13467239 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Mgf1BytesGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Mgf1BytesGenerator.cs new file mode 100644 index 00000000..b06e9ff6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Mgf1BytesGenerator.cs @@ -0,0 +1,124 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if UNITY_WSA && !UNITY_EDITOR && !ENABLE_IL2CPP +using System.TypeFix; +#endif +using System; +//using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +//using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Generator for MGF1 as defined in Pkcs 1v2 + */ + public class Mgf1BytesGenerator : IDerivationFunction + { + private IDigest digest; + private byte[] seed; + private int hLen; + + /** + * @param digest the digest to be used as the source of Generated bytes + */ + public Mgf1BytesGenerator( + IDigest digest) + { + this.digest = digest; + this.hLen = digest.GetDigestSize(); + } + + public void Init( + IDerivationParameters parameters) + { + if (!(typeof(MgfParameters).IsInstanceOfType(parameters))) + { + throw new ArgumentException("MGF parameters required for MGF1Generator"); + } + + MgfParameters p = (MgfParameters)parameters; + + seed = p.GetSeed(); + } + + /** + * return the underlying digest. + */ + public IDigest Digest + { + get + { + return digest; + } + } + + /** + * int to octet string. + */ + private void ItoOSP( + int i, + byte[] sp) + { + sp[0] = (byte)((uint) i >> 24); + sp[1] = (byte)((uint) i >> 16); + sp[2] = (byte)((uint) i >> 8); + sp[3] = (byte)((uint) i >> 0); + } + + /** + * fill len bytes of the output buffer with bytes Generated from + * the derivation function. + * + * @throws DataLengthException if the out buffer is too small. + */ + public int GenerateBytes( + byte[] output, + int outOff, + int length) + { + if ((output.Length - length) < outOff) + { + throw new DataLengthException("output buffer too small"); + } + + byte[] hashBuf = new byte[hLen]; + byte[] C = new byte[4]; + int counter = 0; + + digest.Reset(); + + if (length > hLen) + { + do + { + ItoOSP(counter, C); + + digest.BlockUpdate(seed, 0, seed.Length); + digest.BlockUpdate(C, 0, C.Length); + digest.DoFinal(hashBuf, 0); + + Array.Copy(hashBuf, 0, output, outOff + counter * hLen, hLen); + } + while (++counter < (length / hLen)); + } + + if ((counter * hLen) < length) + { + ItoOSP(counter, C); + + digest.BlockUpdate(seed, 0, seed.Length); + digest.BlockUpdate(C, 0, C.Length); + digest.DoFinal(hashBuf, 0); + + Array.Copy(hashBuf, 0, output, outOff + counter * hLen, length - (counter * hLen)); + } + + return length; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Mgf1BytesGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Mgf1BytesGenerator.cs.meta new file mode 100644 index 00000000..dcf60b3b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Mgf1BytesGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31a110c2dc0902d479e2a482d25f7212 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/NaccacheSternKeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/NaccacheSternKeyPairGenerator.cs new file mode 100644 index 00000000..8caac625 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/NaccacheSternKeyPairGenerator.cs @@ -0,0 +1,272 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Key generation parameters for NaccacheStern cipher. For details on this cipher, please see + * + * http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + */ + public class NaccacheSternKeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private static readonly int[] smallPrimes = + { + 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, + 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, + 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, + 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, + 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, + 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, + 541, 547, 557 + }; + + private NaccacheSternKeyGenerationParameters param; + + /* + * (non-Javadoc) + * + * @see org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator#init(org.bouncycastle.crypto.KeyGenerationParameters) + */ + public void Init(KeyGenerationParameters parameters) + { + this.param = (NaccacheSternKeyGenerationParameters)parameters; + } + + /* + * (non-Javadoc) + * + * @see org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator#generateKeyPair() + */ + public AsymmetricCipherKeyPair GenerateKeyPair() + { + int strength = param.Strength; + SecureRandom rand = param.Random; + int certainty = param.Certainty; + + IList smallPrimes = findFirstPrimes(param.CountSmallPrimes); + + smallPrimes = permuteList(smallPrimes, rand); + + BigInteger u = BigInteger.One; + BigInteger v = BigInteger.One; + + for (int i = 0; i < smallPrimes.Count / 2; i++) + { + u = u.Multiply((BigInteger)smallPrimes[i]); + } + for (int i = smallPrimes.Count / 2; i < smallPrimes.Count; i++) + { + v = v.Multiply((BigInteger)smallPrimes[i]); + } + + BigInteger sigma = u.Multiply(v); + + // n = (2 a u _p + 1 ) ( 2 b v _q + 1) + // -> |n| = strength + // |2| = 1 in bits + // -> |a| * |b| = |n| - |u| - |v| - |_p| - |_q| - |2| -|2| + // remainingStrength = strength - sigma.bitLength() - _p.bitLength() - + // _q.bitLength() - 1 -1 + int remainingStrength = strength - sigma.BitLength - 48; + BigInteger a = generatePrime(remainingStrength / 2 + 1, certainty, rand); + BigInteger b = generatePrime(remainingStrength / 2 + 1, certainty, rand); + + BigInteger _p; + BigInteger _q; + BigInteger p; + BigInteger q; + + long tries = 0; + + BigInteger _2au = a.Multiply(u).ShiftLeft(1); + BigInteger _2bv = b.Multiply(v).ShiftLeft(1); + + for (;;) + { + tries++; + + _p = generatePrime(24, certainty, rand); + + p = _p.Multiply(_2au).Add(BigInteger.One); + + if (!p.IsProbablePrime(certainty, true)) + continue; + + for (;;) + { + _q = generatePrime(24, certainty, rand); + + if (_p.Equals(_q)) + continue; + + q = _q.Multiply(_2bv).Add(BigInteger.One); + + if (q.IsProbablePrime(certainty, true)) + break; + } + + if (!sigma.Gcd(_p.Multiply(_q)).Equals(BigInteger.One)) + { + //Console.WriteLine("sigma.gcd(_p.mult(_q)) != 1!\n _p: " + _p +"\n _q: "+ _q ); + continue; + } + + if (p.Multiply(q).BitLength < strength) + { + continue; + } + break; + } + + BigInteger n = p.Multiply(q); + BigInteger phi_n = p.Subtract(BigInteger.One).Multiply(q.Subtract(BigInteger.One)); + BigInteger g; + tries = 0; + + for (;;) + { + // TODO After the first loop, just regenerate one randomly-selected gPart each time? + IList gParts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + for (int ind = 0; ind != smallPrimes.Count; ind++) + { + BigInteger i = (BigInteger)smallPrimes[ind]; + BigInteger e = phi_n.Divide(i); + + for (;;) + { + tries++; + + g = generatePrime(strength, certainty, rand); + + if (!g.ModPow(e, n).Equals(BigInteger.One)) + { + gParts.Add(g); + break; + } + } + } + g = BigInteger.One; + for (int i = 0; i < smallPrimes.Count; i++) + { + BigInteger gPart = (BigInteger) gParts[i]; + BigInteger smallPrime = (BigInteger) smallPrimes[i]; + g = g.Multiply(gPart.ModPow(sigma.Divide(smallPrime), n)).Mod(n); + } + + // make sure that g is not divisible by p_i or q_i + bool divisible = false; + for (int i = 0; i < smallPrimes.Count; i++) + { + if (g.ModPow(phi_n.Divide((BigInteger)smallPrimes[i]), n).Equals(BigInteger.One)) + { + divisible = true; + break; + } + } + + if (divisible) + { + continue; + } + + // make sure that g has order > phi_n/4 + + //if (g.ModPow(phi_n.Divide(BigInteger.ValueOf(4)), n).Equals(BigInteger.One)) + if (g.ModPow(phi_n.ShiftRight(2), n).Equals(BigInteger.One)) + { + continue; + } + + if (g.ModPow(phi_n.Divide(_p), n).Equals(BigInteger.One)) + { + continue; + } + if (g.ModPow(phi_n.Divide(_q), n).Equals(BigInteger.One)) + { + continue; + } + if (g.ModPow(phi_n.Divide(a), n).Equals(BigInteger.One)) + { + continue; + } + if (g.ModPow(phi_n.Divide(b), n).Equals(BigInteger.One)) + { + continue; + } + break; + } + + return new AsymmetricCipherKeyPair(new NaccacheSternKeyParameters(false, g, n, sigma.BitLength), + new NaccacheSternPrivateKeyParameters(g, n, sigma.BitLength, smallPrimes, phi_n)); + } + + private static BigInteger generatePrime( + int bitLength, + int certainty, + SecureRandom rand) + { + return new BigInteger(bitLength, certainty, rand); + } + + /** + * Generates a permuted ArrayList from the original one. The original List + * is not modified + * + * @param arr + * the ArrayList to be permuted + * @param rand + * the source of Randomness for permutation + * @return a new IList with the permuted elements. + */ + private static IList permuteList( + IList arr, + SecureRandom rand) + { + // TODO Create a utility method for generating permutation of first 'n' integers + + IList retval = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(arr.Count); + + foreach (object element in arr) + { + int index = rand.Next(retval.Count + 1); + retval.Insert(index, element); + } + + return retval; + } + + /** + * Finds the first 'count' primes starting with 3 + * + * @param count + * the number of primes to find + * @return a vector containing the found primes as Integer + */ + private static IList findFirstPrimes( + int count) + { + IList primes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(count); + + for (int i = 0; i != count; i++) + { + primes.Add(BigInteger.ValueOf(smallPrimes[i])); + } + + return primes; + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/NaccacheSternKeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/NaccacheSternKeyPairGenerator.cs.meta new file mode 100644 index 00000000..1f71a49c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/NaccacheSternKeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 720fd0eb1bd2a4048ba38b891037760b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenBsdBCrypt.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenBsdBCrypt.cs new file mode 100644 index 00000000..01914ef9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenBsdBCrypt.cs @@ -0,0 +1,309 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Password hashing scheme BCrypt, + * designed by Niels Provos and David Mazières, using the + * String format and the Base64 encoding + * of the reference implementation on OpenBSD + */ + public class OpenBsdBCrypt + { + private static readonly byte[] EncodingTable = // the Bcrypts encoding table for OpenBSD + { + (byte)'.', (byte)'/', (byte)'A', (byte)'B', (byte)'C', (byte)'D', + (byte)'E', (byte)'F', (byte)'G', (byte)'H', (byte)'I', (byte)'J', + (byte)'K', (byte)'L', (byte)'M', (byte)'N', (byte)'O', (byte)'P', + (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U', (byte)'V', + (byte)'W', (byte)'X', (byte)'Y', (byte)'Z', (byte)'a', (byte)'b', + (byte)'c', (byte)'d', (byte)'e', (byte)'f', (byte)'g', (byte)'h', + (byte)'i', (byte)'j', (byte)'k', (byte)'l', (byte)'m', (byte)'n', + (byte)'o', (byte)'p', (byte)'q', (byte)'r', (byte)'s', (byte)'t', + (byte)'u', (byte)'v', (byte)'w', (byte)'x', (byte)'y', (byte)'z', + (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', + (byte)'6', (byte)'7', (byte)'8', (byte)'9' + }; + + /* + * set up the decoding table. + */ + private static readonly byte[] DecodingTable = new byte[128]; + private static readonly string DefaultVersion = "2y"; + private static readonly ISet AllowedVersions = new HashSet(); + + static OpenBsdBCrypt() + { + // Presently just the Bcrypt versions. + AllowedVersions.Add("2a"); + AllowedVersions.Add("2y"); + AllowedVersions.Add("2b"); + + for (int i = 0; i < DecodingTable.Length; i++) + { + DecodingTable[i] = (byte)0xff; + } + + for (int i = 0; i < EncodingTable.Length; i++) + { + DecodingTable[EncodingTable[i]] = (byte)i; + } + } + + public OpenBsdBCrypt() + { + } + + /** + * Creates a 60 character Bcrypt String, including + * version, cost factor, salt and hash, separated by '$' + * + * @param version the version, 2y,2b or 2a. (2a is not backwards compatible.) + * @param cost the cost factor, treated as an exponent of 2 + * @param salt a 16 byte salt + * @param password the password + * @return a 60 character Bcrypt String + */ + private static string CreateBcryptString(string version, byte[] password, byte[] salt, int cost) + { + if (!AllowedVersions.Contains(version)) + throw new ArgumentException("Version " + version + " is not accepted by this implementation.", "version"); + + StringBuilder sb = new StringBuilder(60); + sb.Append('$'); + sb.Append(version); + sb.Append('$'); + sb.Append(cost < 10 ? ("0" + cost) : cost.ToString()); + sb.Append('$'); + sb.Append(EncodeData(salt)); + + byte[] key = BCrypt.Generate(password, salt, cost); + + sb.Append(EncodeData(key)); + + return sb.ToString(); + } + + /** + * Creates a 60 character Bcrypt String, including + * version, cost factor, salt and hash, separated by '$' using version + * '2y'. + * + * @param cost the cost factor, treated as an exponent of 2 + * @param salt a 16 byte salt + * @param password the password + * @return a 60 character Bcrypt String + */ + public static string Generate(char[] password, byte[] salt, int cost) + { + return Generate(DefaultVersion, password, salt, cost); + } + + /** + * Creates a 60 character Bcrypt String, including + * version, cost factor, salt and hash, separated by '$' + * + * @param version the version, may be 2b, 2y or 2a. (2a is not backwards compatible.) + * @param cost the cost factor, treated as an exponent of 2 + * @param salt a 16 byte salt + * @param password the password + * @return a 60 character Bcrypt String + */ + public static string Generate(string version, char[] password, byte[] salt, int cost) + { + if (!AllowedVersions.Contains(version)) + throw new ArgumentException("Version " + version + " is not accepted by this implementation.", "version"); + if (password == null) + throw new ArgumentNullException("password"); + if (salt == null) + throw new ArgumentNullException("salt"); + if (salt.Length != 16) + throw new DataLengthException("16 byte salt required: " + salt.Length); + + if (cost < 4 || cost > 31) // Minimum rounds: 16, maximum 2^31 + throw new ArgumentException("Invalid cost factor.", "cost"); + + byte[] psw = Strings.ToUtf8ByteArray(password); + + // 0 termination: + + byte[] tmp = new byte[psw.Length >= 72 ? 72 : psw.Length + 1]; + int copyLen = System.Math.Min(psw.Length, tmp.Length); + Array.Copy(psw, 0, tmp, 0, copyLen); + + Array.Clear(psw, 0, psw.Length); + + string rv = CreateBcryptString(version, tmp, salt, cost); + + Array.Clear(tmp, 0, tmp.Length); + + return rv; + } + + /** + * Checks if a password corresponds to a 60 character Bcrypt String + * + * @param bcryptString a 60 character Bcrypt String, including + * version, cost factor, salt and hash, + * separated by '$' + * @param password the password as an array of chars + * @return true if the password corresponds to the + * Bcrypt String, otherwise false + */ + public static bool CheckPassword(string bcryptString, char[] password) + { + // validate bcryptString: + if (bcryptString.Length != 60) + throw new DataLengthException("Bcrypt String length: " + bcryptString.Length + ", 60 required."); + if (bcryptString[0] != '$' || bcryptString[3] != '$' || bcryptString[6] != '$') + throw new ArgumentException("Invalid Bcrypt String format.", "bcryptString"); + + string version = bcryptString.Substring(1, 2); + if (!AllowedVersions.Contains(version)) + throw new ArgumentException("Bcrypt version '" + version + "' is not supported by this implementation", "bcryptString"); + + int cost = 0; + try + { + cost = Int32.Parse(bcryptString.Substring(4, 2)); + } + catch (Exception nfe) + { +#if PORTABLE || NETFX_CORE + throw new ArgumentException("Invalid cost factor: " + bcryptString.Substring(4, 2), "bcryptString"); +#else + throw new ArgumentException("Invalid cost factor: " + bcryptString.Substring(4, 2), "bcryptString", nfe); +#endif + } + if (cost < 4 || cost > 31) + throw new ArgumentException("Invalid cost factor: " + cost + ", 4 < cost < 31 expected."); + + // check password: + if (password == null) + throw new ArgumentNullException("Missing password."); + + int start = bcryptString.LastIndexOf('$') + 1, end = bcryptString.Length - 31; + byte[] salt = DecodeSaltString(bcryptString.Substring(start, end - start)); + + string newBcryptString = Generate(version, password, salt, cost); + + return bcryptString.Equals(newBcryptString); + } + + /* + * encode the input data producing a Bcrypt base 64 string. + * + * @param a byte representation of the salt or the password + * @return the Bcrypt base64 string + */ + private static string EncodeData(byte[] data) + { + if (data.Length != 24 && data.Length != 16) // 192 bit key or 128 bit salt expected + throw new DataLengthException("Invalid length: " + data.Length + ", 24 for key or 16 for salt expected"); + + bool salt = false; + if (data.Length == 16)//salt + { + salt = true; + byte[] tmp = new byte[18];// zero padding + Array.Copy(data, 0, tmp, 0, data.Length); + data = tmp; + } + else // key + { + data[data.Length - 1] = (byte)0; + } + + MemoryStream mOut = new MemoryStream(); + int len = data.Length; + + uint a1, a2, a3; + int i; + for (i = 0; i < len; i += 3) + { + a1 = data[i]; + a2 = data[i + 1]; + a3 = data[i + 2]; + + mOut.WriteByte(EncodingTable[(a1 >> 2) & 0x3f]); + mOut.WriteByte(EncodingTable[((a1 << 4) | (a2 >> 4)) & 0x3f]); + mOut.WriteByte(EncodingTable[((a2 << 2) | (a3 >> 6)) & 0x3f]); + mOut.WriteByte(EncodingTable[a3 & 0x3f]); + } + + string result = Strings.FromByteArray(mOut.ToArray()); + int resultLen = salt + ? 22 // truncate padding + : result.Length - 1; + + return result.Substring(0, resultLen); + } + + + /* + * decodes the bcrypt base 64 encoded SaltString + * + * @param a 22 character Bcrypt base 64 encoded String + * @return the 16 byte salt + * @exception DataLengthException if the length + * of parameter is not 22 + * @exception InvalidArgumentException if the parameter + * contains a value other than from Bcrypts base 64 encoding table + */ + private static byte[] DecodeSaltString(string saltString) + { + char[] saltChars = saltString.ToCharArray(); + + MemoryStream mOut = new MemoryStream(16); + byte b1, b2, b3, b4; + + if (saltChars.Length != 22)// bcrypt salt must be 22 (16 bytes) + throw new DataLengthException("Invalid base64 salt length: " + saltChars.Length + " , 22 required."); + + // check string for invalid characters: + for (int i = 0; i < saltChars.Length; i++) + { + int value = saltChars[i]; + if (value > 122 || value < 46 || (value > 57 && value < 65)) + throw new ArgumentException("Salt string contains invalid character: " + value, "saltString"); + } + + // Padding: add two '\u0000' + char[] tmp = new char[22 + 2]; + Array.Copy(saltChars, 0, tmp, 0, saltChars.Length); + saltChars = tmp; + + int len = saltChars.Length; + + for (int i = 0; i < len; i += 4) + { + b1 = DecodingTable[saltChars[i]]; + b2 = DecodingTable[saltChars[i + 1]]; + b3 = DecodingTable[saltChars[i + 2]]; + b4 = DecodingTable[saltChars[i + 3]]; + + mOut.WriteByte((byte)((b1 << 2) | (b2 >> 4))); + mOut.WriteByte((byte)((b2 << 4) | (b3 >> 2))); + mOut.WriteByte((byte)((b3 << 6) | b4)); + } + + byte[] saltBytes = mOut.ToArray(); + + // truncate: + byte[] tmpSalt = new byte[16]; + Array.Copy(saltBytes, 0, tmpSalt, 0, tmpSalt.Length); + saltBytes = tmpSalt; + + return saltBytes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenBsdBCrypt.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenBsdBCrypt.cs.meta new file mode 100644 index 00000000..f72722af --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenBsdBCrypt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1fec56be41cc0b4f86d231a91f025ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenSSLPBEParametersGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenSSLPBEParametersGenerator.cs new file mode 100644 index 00000000..6419bf11 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenSSLPBEParametersGenerator.cs @@ -0,0 +1,171 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Generator for PBE derived keys and ivs as usd by OpenSSL. + *

+ * The scheme is a simple extension of PKCS 5 V2.0 Scheme 1 using MD5 with an + * iteration count of 1. + *

+ */ + public class OpenSslPbeParametersGenerator + : PbeParametersGenerator + { + private readonly IDigest digest = new MD5Digest(); + + /** + * Construct a OpenSSL Parameters generator. + */ + public OpenSslPbeParametersGenerator() + { + } + + public override void Init( + byte[] password, + byte[] salt, + int iterationCount) + { + // Ignore the provided iterationCount + base.Init(password, salt, 1); + } + + /** + * Initialise - note the iteration count for this algorithm is fixed at 1. + * + * @param password password to use. + * @param salt salt to use. + */ + public virtual void Init( + byte[] password, + byte[] salt) + { + base.Init(password, salt, 1); + } + + /** + * the derived key function, the ith hash of the password and the salt. + */ + private byte[] GenerateDerivedKey( + int bytesNeeded) + { + byte[] buf = new byte[digest.GetDigestSize()]; + byte[] key = new byte[bytesNeeded]; + int offset = 0; + + for (;;) + { + digest.BlockUpdate(mPassword, 0, mPassword.Length); + digest.BlockUpdate(mSalt, 0, mSalt.Length); + + digest.DoFinal(buf, 0); + + int len = (bytesNeeded > buf.Length) ? buf.Length : bytesNeeded; + Array.Copy(buf, 0, key, offset, len); + offset += len; + + // check if we need any more + bytesNeeded -= len; + if (bytesNeeded == 0) + { + break; + } + + // do another round + digest.Reset(); + digest.BlockUpdate(buf, 0, buf.Length); + } + + return key; + } + + /** + * Generate a key parameter derived from the password, salt, and iteration + * count we are currently initialised with. + * + * @param keySize the size of the key we want (in bits) + * @return a KeyParameter object. + * @exception ArgumentException if the key length larger than the base hash size. + */ + [Obsolete("Use version with 'algorithm' parameter")] + public override ICipherParameters GenerateDerivedParameters( + int keySize) + { + return GenerateDerivedMacParameters(keySize); + } + + public override ICipherParameters GenerateDerivedParameters( + string algorithm, + int keySize) + { + keySize /= 8; + + byte[] dKey = GenerateDerivedKey(keySize); + + return ParameterUtilities.CreateKeyParameter(algorithm, dKey, 0, keySize); + } + + /** + * Generate a key with initialisation vector parameter derived from + * the password, salt, and iteration count we are currently initialised + * with. + * + * @param keySize the size of the key we want (in bits) + * @param ivSize the size of the iv we want (in bits) + * @return a ParametersWithIV object. + * @exception ArgumentException if keySize + ivSize is larger than the base hash size. + */ + [Obsolete("Use version with 'algorithm' parameter")] + public override ICipherParameters GenerateDerivedParameters( + int keySize, + int ivSize) + { + keySize = keySize / 8; + ivSize = ivSize / 8; + + byte[] dKey = GenerateDerivedKey(keySize + ivSize); + + return new ParametersWithIV(new KeyParameter(dKey, 0, keySize), dKey, keySize, ivSize); + } + + public override ICipherParameters GenerateDerivedParameters( + string algorithm, + int keySize, + int ivSize) + { + keySize /= 8; + ivSize /= 8; + + byte[] dKey = GenerateDerivedKey(keySize + ivSize); + KeyParameter key = ParameterUtilities.CreateKeyParameter(algorithm, dKey, 0, keySize); + + return new ParametersWithIV(key, dKey, keySize, ivSize); + } + + /** + * Generate a key parameter for use with a MAC derived from the password, + * salt, and iteration count we are currently initialised with. + * + * @param keySize the size of the key we want (in bits) + * @return a KeyParameter object. + * @exception ArgumentException if the key length larger than the base hash size. + */ + public override ICipherParameters GenerateDerivedMacParameters( + int keySize) + { + keySize = keySize / 8; + + byte[] dKey = GenerateDerivedKey(keySize); + + return new KeyParameter(dKey, 0, keySize); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenSSLPBEParametersGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenSSLPBEParametersGenerator.cs.meta new file mode 100644 index 00000000..2b81f85b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/OpenSSLPBEParametersGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 227a7f058cce60f4e9f1944112a1e3e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs12ParametersGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs12ParametersGenerator.cs new file mode 100644 index 00000000..e7f7467d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs12ParametersGenerator.cs @@ -0,0 +1,247 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Generator for Pbe derived keys and ivs as defined by Pkcs 12 V1.0. + *

+ * The document this implementation is based on can be found at + * + * RSA's Pkcs12 Page + *

+ */ + public class Pkcs12ParametersGenerator + : PbeParametersGenerator + { + public const int KeyMaterial = 1; + public const int IVMaterial = 2; + public const int MacMaterial = 3; + + private readonly IDigest digest; + + private readonly int u; + private readonly int v; + + /** + * Construct a Pkcs 12 Parameters generator. + * + * @param digest the digest to be used as the source of derived keys. + * @exception ArgumentException if an unknown digest is passed in. + */ + public Pkcs12ParametersGenerator( + IDigest digest) + { + this.digest = digest; + + u = digest.GetDigestSize(); + v = digest.GetByteLength(); + } + + /** + * add a + b + 1, returning the result in a. The a value is treated + * as a BigInteger of length (b.Length * 8) bits. The result is + * modulo 2^b.Length in case of overflow. + */ + private void Adjust( + byte[] a, + int aOff, + byte[] b) + { + int x = (b[b.Length - 1] & 0xff) + (a[aOff + b.Length - 1] & 0xff) + 1; + + a[aOff + b.Length - 1] = (byte)x; + x = (int) ((uint) x >> 8); + + for (int i = b.Length - 2; i >= 0; i--) + { + x += (b[i] & 0xff) + (a[aOff + i] & 0xff); + a[aOff + i] = (byte)x; + x = (int) ((uint) x >> 8); + } + } + + /** + * generation of a derived key ala Pkcs12 V1.0. + */ + private byte[] GenerateDerivedKey( + int idByte, + int n) + { + byte[] D = new byte[v]; + byte[] dKey = new byte[n]; + + for (int i = 0; i != D.Length; i++) + { + D[i] = (byte)idByte; + } + + byte[] S; + + if ((mSalt != null) && (mSalt.Length != 0)) + { + S = new byte[v * ((mSalt.Length + v - 1) / v)]; + + for (int i = 0; i != S.Length; i++) + { + S[i] = mSalt[i % mSalt.Length]; + } + } + else + { + S = new byte[0]; + } + + byte[] P; + + if ((mPassword != null) && (mPassword.Length != 0)) + { + P = new byte[v * ((mPassword.Length + v - 1) / v)]; + + for (int i = 0; i != P.Length; i++) + { + P[i] = mPassword[i % mPassword.Length]; + } + } + else + { + P = new byte[0]; + } + + byte[] I = new byte[S.Length + P.Length]; + + Array.Copy(S, 0, I, 0, S.Length); + Array.Copy(P, 0, I, S.Length, P.Length); + + byte[] B = new byte[v]; + int c = (n + u - 1) / u; + byte[] A = new byte[u]; + + for (int i = 1; i <= c; i++) + { + digest.BlockUpdate(D, 0, D.Length); + digest.BlockUpdate(I, 0, I.Length); + digest.DoFinal(A, 0); + + for (int j = 1; j != mIterationCount; j++) + { + digest.BlockUpdate(A, 0, A.Length); + digest.DoFinal(A, 0); + } + + for (int j = 0; j != B.Length; j++) + { + B[j] = A[j % A.Length]; + } + + for (int j = 0; j != I.Length / v; j++) + { + Adjust(I, j * v, B); + } + + if (i == c) + { + Array.Copy(A, 0, dKey, (i - 1) * u, dKey.Length - ((i - 1) * u)); + } + else + { + Array.Copy(A, 0, dKey, (i - 1) * u, A.Length); + } + } + + return dKey; + } + + /** + * Generate a key parameter derived from the password, salt, and iteration + * count we are currently initialised with. + * + * @param keySize the size of the key we want (in bits) + * @return a KeyParameter object. + */ + public override ICipherParameters GenerateDerivedParameters( + int keySize) + { + keySize /= 8; + + byte[] dKey = GenerateDerivedKey(KeyMaterial, keySize); + + return new KeyParameter(dKey, 0, keySize); + } + + public override ICipherParameters GenerateDerivedParameters( + string algorithm, + int keySize) + { + keySize /= 8; + + byte[] dKey = GenerateDerivedKey(KeyMaterial, keySize); + + return ParameterUtilities.CreateKeyParameter(algorithm, dKey, 0, keySize); + } + + /** + * Generate a key with initialisation vector parameter derived from + * the password, salt, and iteration count we are currently initialised + * with. + * + * @param keySize the size of the key we want (in bits) + * @param ivSize the size of the iv we want (in bits) + * @return a ParametersWithIV object. + */ + public override ICipherParameters GenerateDerivedParameters( + int keySize, + int ivSize) + { + keySize /= 8; + ivSize /= 8; + + byte[] dKey = GenerateDerivedKey(KeyMaterial, keySize); + + byte[] iv = GenerateDerivedKey(IVMaterial, ivSize); + + return new ParametersWithIV(new KeyParameter(dKey, 0, keySize), iv, 0, ivSize); + } + + public override ICipherParameters GenerateDerivedParameters( + string algorithm, + int keySize, + int ivSize) + { + keySize /= 8; + ivSize /= 8; + + byte[] dKey = GenerateDerivedKey(KeyMaterial, keySize); + KeyParameter key = ParameterUtilities.CreateKeyParameter(algorithm, dKey, 0, keySize); + + byte[] iv = GenerateDerivedKey(IVMaterial, ivSize); + + return new ParametersWithIV(key, iv, 0, ivSize); + } + + /** + * Generate a key parameter for use with a MAC derived from the password, + * salt, and iteration count we are currently initialised with. + * + * @param keySize the size of the key we want (in bits) + * @return a KeyParameter object. + */ + public override ICipherParameters GenerateDerivedMacParameters( + int keySize) + { + keySize /= 8; + + byte[] dKey = GenerateDerivedKey(MacMaterial, keySize); + + return new KeyParameter(dKey, 0, keySize); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs12ParametersGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs12ParametersGenerator.cs.meta new file mode 100644 index 00000000..808d7297 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs12ParametersGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 80f581c321bf56745a81a710ed7fc4c0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S1ParametersGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S1ParametersGenerator.cs new file mode 100644 index 00000000..bf469e6a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S1ParametersGenerator.cs @@ -0,0 +1,164 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Generator for Pbe derived keys and ivs as defined by Pkcs 5 V2.0 Scheme 1. + * Note this generator is limited to the size of the hash produced by the + * digest used to drive it. + *

+ * The document this implementation is based on can be found at + * + * RSA's Pkcs5 Page + *

+ */ + public class Pkcs5S1ParametersGenerator + : PbeParametersGenerator + { + private readonly IDigest digest; + + /** + * Construct a Pkcs 5 Scheme 1 Parameters generator. + * + * @param digest the digest to be used as the source of derived keys. + */ + public Pkcs5S1ParametersGenerator( + IDigest digest) + { + this.digest = digest; + } + + /** + * the derived key function, the ith hash of the mPassword and the mSalt. + */ + private byte[] GenerateDerivedKey() + { + byte[] digestBytes = new byte[digest.GetDigestSize()]; + + digest.BlockUpdate(mPassword, 0, mPassword.Length); + digest.BlockUpdate(mSalt, 0, mSalt.Length); + + digest.DoFinal(digestBytes, 0); + for (int i = 1; i < mIterationCount; i++) + { + digest.BlockUpdate(digestBytes, 0, digestBytes.Length); + digest.DoFinal(digestBytes, 0); + } + + return digestBytes; + } + + /** + * Generate a key parameter derived from the mPassword, mSalt, and iteration + * count we are currently initialised with. + * + * @param keySize the size of the key we want (in bits) + * @return a KeyParameter object. + * @exception ArgumentException if the key length larger than the base hash size. + */ + public override ICipherParameters GenerateDerivedParameters( + int keySize) + { + return GenerateDerivedMacParameters(keySize); + } + + public override ICipherParameters GenerateDerivedParameters( + string algorithm, + int keySize) + { + keySize /= 8; + + if (keySize > digest.GetDigestSize()) + { + throw new ArgumentException( + "Can't Generate a derived key " + keySize + " bytes long."); + } + + byte[] dKey = GenerateDerivedKey(); + + return ParameterUtilities.CreateKeyParameter(algorithm, dKey, 0, keySize); + } + + /** + * Generate a key with initialisation vector parameter derived from + * the mPassword, mSalt, and iteration count we are currently initialised + * with. + * + * @param keySize the size of the key we want (in bits) + * @param ivSize the size of the iv we want (in bits) + * @return a ParametersWithIV object. + * @exception ArgumentException if keySize + ivSize is larger than the base hash size. + */ + public override ICipherParameters GenerateDerivedParameters( + int keySize, + int ivSize) + { + keySize /= 8; + ivSize /= 8; + + if ((keySize + ivSize) > digest.GetDigestSize()) + { + throw new ArgumentException( + "Can't Generate a derived key " + (keySize + ivSize) + " bytes long."); + } + + byte[] dKey = GenerateDerivedKey(); + + return new ParametersWithIV(new KeyParameter(dKey, 0, keySize), dKey, keySize, ivSize); + } + + public override ICipherParameters GenerateDerivedParameters( + string algorithm, + int keySize, + int ivSize) + { + keySize /= 8; + ivSize /= 8; + + if ((keySize + ivSize) > digest.GetDigestSize()) + { + throw new ArgumentException( + "Can't Generate a derived key " + (keySize + ivSize) + " bytes long."); + } + + byte[] dKey = GenerateDerivedKey(); + KeyParameter key = ParameterUtilities.CreateKeyParameter(algorithm, dKey, 0, keySize); + + return new ParametersWithIV(key, dKey, keySize, ivSize); + } + + /** + * Generate a key parameter for use with a MAC derived from the mPassword, + * mSalt, and iteration count we are currently initialised with. + * + * @param keySize the size of the key we want (in bits) + * @return a KeyParameter object. + * @exception ArgumentException if the key length larger than the base hash size. + */ + public override ICipherParameters GenerateDerivedMacParameters( + int keySize) + { + keySize /= 8; + + if (keySize > digest.GetDigestSize()) + { + throw new ArgumentException( + "Can't Generate a derived key " + keySize + " bytes long."); + } + + byte[] dKey = GenerateDerivedKey(); + + return new KeyParameter(dKey, 0, keySize); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S1ParametersGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S1ParametersGenerator.cs.meta new file mode 100644 index 00000000..43f73a70 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S1ParametersGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c288f7bdb27a2b4ebbfe5e2b74e4e30 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S2ParametersGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S2ParametersGenerator.cs new file mode 100644 index 00000000..35c5b3e9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S2ParametersGenerator.cs @@ -0,0 +1,182 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Generator for Pbe derived keys and ivs as defined by Pkcs 5 V2.0 Scheme 2. + * This generator uses a SHA-1 HMac as the calculation function. + *

+ * The document this implementation is based on can be found at + * + * RSA's Pkcs5 Page

+ */ + public class Pkcs5S2ParametersGenerator + : PbeParametersGenerator + { + private readonly IMac hMac; + private readonly byte[] state; + + /** + * construct a Pkcs5 Scheme 2 Parameters generator. + */ + public Pkcs5S2ParametersGenerator() + : this(new Sha1Digest()) + { + } + + public Pkcs5S2ParametersGenerator(IDigest digest) + { + this.hMac = new HMac(digest); + this.state = new byte[hMac.GetMacSize()]; + } + + private void F( + byte[] S, + int c, + byte[] iBuf, + byte[] outBytes, + int outOff) + { + if (c == 0) + throw new ArgumentException("iteration count must be at least 1."); + + if (S != null) + { + hMac.BlockUpdate(S, 0, S.Length); + } + + hMac.BlockUpdate(iBuf, 0, iBuf.Length); + hMac.DoFinal(state, 0); + + Array.Copy(state, 0, outBytes, outOff, state.Length); + + for (int count = 1; count < c; ++count) + { + hMac.BlockUpdate(state, 0, state.Length); + hMac.DoFinal(state, 0); + + for (int j = 0; j < state.Length; ++j) + { + outBytes[outOff + j] ^= state[j]; + } + } + } + + private byte[] GenerateDerivedKey( + int dkLen) + { + int hLen = hMac.GetMacSize(); + int l = (dkLen + hLen - 1) / hLen; + byte[] iBuf = new byte[4]; + byte[] outBytes = new byte[l * hLen]; + int outPos = 0; + + ICipherParameters param = new KeyParameter(mPassword); + + hMac.Init(param); + + for (int i = 1; i <= l; i++) + { + // Increment the value in 'iBuf' + int pos = 3; + while (++iBuf[pos] == 0) + { + --pos; + } + + F(mSalt, mIterationCount, iBuf, outBytes, outPos); + outPos += hLen; + } + + return outBytes; + } + + /** + * Generate a key parameter derived from the password, salt, and iteration + * count we are currently initialised with. + * + * @param keySize the size of the key we want (in bits) + * @return a KeyParameter object. + */ + public override ICipherParameters GenerateDerivedParameters( + int keySize) + { + return GenerateDerivedMacParameters(keySize); + } + + public override ICipherParameters GenerateDerivedParameters( + string algorithm, + int keySize) + { + keySize /= 8; + + byte[] dKey = GenerateDerivedKey(keySize); + + return ParameterUtilities.CreateKeyParameter(algorithm, dKey, 0, keySize); + } + + /** + * Generate a key with initialisation vector parameter derived from + * the password, salt, and iteration count we are currently initialised + * with. + * + * @param keySize the size of the key we want (in bits) + * @param ivSize the size of the iv we want (in bits) + * @return a ParametersWithIV object. + */ + public override ICipherParameters GenerateDerivedParameters( + int keySize, + int ivSize) + { + keySize /= 8; + ivSize /= 8; + + byte[] dKey = GenerateDerivedKey(keySize + ivSize); + + return new ParametersWithIV(new KeyParameter(dKey, 0, keySize), dKey, keySize, ivSize); + } + + public override ICipherParameters GenerateDerivedParameters( + string algorithm, + int keySize, + int ivSize) + { + keySize /= 8; + ivSize /= 8; + + byte[] dKey = GenerateDerivedKey(keySize + ivSize); + KeyParameter key = ParameterUtilities.CreateKeyParameter(algorithm, dKey, 0, keySize); + + return new ParametersWithIV(key, dKey, keySize, ivSize); + } + + /** + * Generate a key parameter for use with a MAC derived from the password, + * salt, and iteration count we are currently initialised with. + * + * @param keySize the size of the key we want (in bits) + * @return a KeyParameter object. + */ + public override ICipherParameters GenerateDerivedMacParameters( + int keySize) + { + keySize /= 8; + + byte[] dKey = GenerateDerivedKey(keySize); + + return new KeyParameter(dKey, 0, keySize); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S2ParametersGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S2ParametersGenerator.cs.meta new file mode 100644 index 00000000..b1b7451f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Pkcs5S2ParametersGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 059cb4d08d9b8cc49b1a842639d86b27 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Poly1305KeyGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Poly1305KeyGenerator.cs new file mode 100644 index 00000000..9f337248 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Poly1305KeyGenerator.cs @@ -0,0 +1,120 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /// + /// Generates keys for the Poly1305 MAC. + /// + /// + /// Poly1305 keys are 256 bit keys consisting of a 128 bit secret key used for the underlying block + /// cipher followed by a 128 bit {@code r} value used for the polynomial portion of the Mac.
+ /// The {@code r} value has a specific format with some bits required to be cleared, resulting in an + /// effective 106 bit key.
+ /// A separately generated 256 bit key can be modified to fit the Poly1305 key format by using the + /// {@link #clamp(byte[])} method to clear the required bits. + ///
+ /// + public class Poly1305KeyGenerator + : CipherKeyGenerator + { + private const byte R_MASK_LOW_2 = (byte)0xFC; + private const byte R_MASK_HIGH_4 = (byte)0x0F; + + /// + /// Initialises the key generator. + /// + /// + /// Poly1305 keys are always 256 bits, so the key length in the provided parameters is ignored. + /// + protected override void engineInit(KeyGenerationParameters param) + { + // Poly1305 keys are always 256 bits + this.random = param.Random; + this.strength = 32; + } + + /// + /// Generates a 256 bit key in the format required for Poly1305 - e.g. + /// k[0] ... k[15], r[0] ... r[15] with the required bits in r cleared + /// as per . + /// + protected override byte[] engineGenerateKey() + { + byte[] key = base.engineGenerateKey(); + Clamp(key); + return key; + } + + /// + /// Modifies an existing 32 byte key value to comply with the requirements of the Poly1305 key by + /// clearing required bits in the r (second 16 bytes) portion of the key.
+ /// Specifically: + ///
    + ///
  • r[3], r[7], r[11], r[15] have top four bits clear (i.e., are {0, 1, . . . , 15})
  • + ///
  • r[4], r[8], r[12] have bottom two bits clear (i.e., are in {0, 4, 8, . . . , 252})
  • + ///
+ ///
+ /// a 32 byte key value k[0] ... k[15], r[0] ... r[15] + public static void Clamp(byte[] key) + { + /* + * Key is k[0] ... k[15], r[0] ... r[15] as per poly1305_aes_clamp in ref impl. + */ + if (key.Length != 32) + throw new ArgumentException("Poly1305 key must be 256 bits."); + + /* + * r[3], r[7], r[11], r[15] have top four bits clear (i.e., are {0, 1, . . . , 15}) + */ + key[3] &= R_MASK_HIGH_4; + key[7] &= R_MASK_HIGH_4; + key[11] &= R_MASK_HIGH_4; + key[15] &= R_MASK_HIGH_4; + + /* + * r[4], r[8], r[12] have bottom two bits clear (i.e., are in {0, 4, 8, . . . , 252}). + */ + key[4] &= R_MASK_LOW_2; + key[8] &= R_MASK_LOW_2; + key[12] &= R_MASK_LOW_2; + } + + /// + /// Checks a 32 byte key for compliance with the Poly1305 key requirements, e.g. + /// k[0] ... k[15], r[0] ... r[15] with the required bits in r cleared + /// as per . + /// + /// Key. + /// if the key is of the wrong length, or has invalid bits set + /// in the r portion of the key. + public static void CheckKey(byte[] key) + { + if (key.Length != 32) + throw new ArgumentException("Poly1305 key must be 256 bits."); + + CheckMask(key[3], R_MASK_HIGH_4); + CheckMask(key[7], R_MASK_HIGH_4); + CheckMask(key[11], R_MASK_HIGH_4); + CheckMask(key[15], R_MASK_HIGH_4); + + CheckMask(key[4], R_MASK_LOW_2); + CheckMask(key[8], R_MASK_LOW_2); + CheckMask(key[12], R_MASK_LOW_2); + } + + private static void CheckMask(byte b, byte mask) + { + if ((b & (~mask)) != 0) + throw new ArgumentException("Invalid format for r portion of Poly1305 key."); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Poly1305KeyGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Poly1305KeyGenerator.cs.meta new file mode 100644 index 00000000..5ab35d84 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/Poly1305KeyGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5da95a369948e924eaed42d18e10729a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RSABlindingFactorGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RSABlindingFactorGenerator.cs new file mode 100644 index 00000000..89d8a588 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RSABlindingFactorGenerator.cs @@ -0,0 +1,73 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * Generate a random factor suitable for use with RSA blind signatures + * as outlined in Chaum's blinding and unblinding as outlined in + * "Handbook of Applied Cryptography", page 475. + */ + public class RsaBlindingFactorGenerator + { + private RsaKeyParameters key; + private SecureRandom random; + + /** + * Initialise the factor generator + * + * @param param the necessary RSA key parameters. + */ + public void Init( + ICipherParameters param) + { + if (param is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)param; + + key = (RsaKeyParameters)rParam.Parameters; + random = rParam.Random; + } + else + { + key = (RsaKeyParameters)param; + random = new SecureRandom(); + } + + if (key.IsPrivate) + throw new ArgumentException("generator requires RSA public key"); + } + + /** + * Generate a suitable blind factor for the public key the generator was initialised with. + * + * @return a random blind factor + */ + public BigInteger GenerateBlindingFactor() + { + if (key == null) + throw new InvalidOperationException("generator not initialised"); + + BigInteger m = key.Modulus; + int length = m.BitLength - 1; // must be less than m.BitLength + BigInteger factor; + BigInteger gcd; + + do + { + factor = new BigInteger(length, random); + gcd = factor.Gcd(m); + } + while (factor.SignValue == 0 || factor.Equals(BigInteger.One) || !gcd.Equals(BigInteger.One)); + + return factor; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RSABlindingFactorGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RSABlindingFactorGenerator.cs.meta new file mode 100644 index 00000000..6e491f7d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RSABlindingFactorGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf74dd7003cd2824f9339e01e58b2e7f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RsaKeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RsaKeyPairGenerator.cs new file mode 100644 index 00000000..577c769b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RsaKeyPairGenerator.cs @@ -0,0 +1,167 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /** + * an RSA key pair generator. + */ + public class RsaKeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private static readonly int[] SPECIAL_E_VALUES = new int[]{ 3, 5, 17, 257, 65537 }; + private static readonly int SPECIAL_E_HIGHEST = SPECIAL_E_VALUES[SPECIAL_E_VALUES.Length - 1]; + private static readonly int SPECIAL_E_BITS = BigInteger.ValueOf(SPECIAL_E_HIGHEST).BitLength; + + protected static readonly BigInteger One = BigInteger.One; + protected static readonly BigInteger DefaultPublicExponent = BigInteger.ValueOf(0x10001); + protected const int DefaultTests = 100; + + protected RsaKeyGenerationParameters parameters; + + public virtual void Init( + KeyGenerationParameters parameters) + { + if (parameters is RsaKeyGenerationParameters) + { + this.parameters = (RsaKeyGenerationParameters)parameters; + } + else + { + this.parameters = new RsaKeyGenerationParameters( + DefaultPublicExponent, parameters.Random, parameters.Strength, DefaultTests); + } + } + + public virtual AsymmetricCipherKeyPair GenerateKeyPair() + { + for (;;) + { + // + // p and q values should have a length of half the strength in bits + // + int strength = parameters.Strength; + int pBitlength = (strength + 1) / 2; + int qBitlength = strength - pBitlength; + int mindiffbits = strength / 3; + int minWeight = strength >> 2; + + BigInteger e = parameters.PublicExponent; + + // TODO Consider generating safe primes for p, q (see DHParametersHelper.generateSafePrimes) + // (then p-1 and q-1 will not consist of only small factors - see "Pollard's algorithm") + + BigInteger p = ChooseRandomPrime(pBitlength, e); + BigInteger q, n; + + // + // generate a modulus of the required length + // + for (;;) + { + q = ChooseRandomPrime(qBitlength, e); + + // p and q should not be too close together (or equal!) + BigInteger diff = q.Subtract(p).Abs(); + if (diff.BitLength < mindiffbits) + continue; + + // + // calculate the modulus + // + n = p.Multiply(q); + + if (n.BitLength != strength) + { + // + // if we get here our primes aren't big enough, make the largest + // of the two p and try again + // + p = p.Max(q); + continue; + } + + /* + * Require a minimum weight of the NAF representation, since low-weight composites may + * be weak against a version of the number-field-sieve for factoring. + * + * See "The number field sieve for integers of low weight", Oliver Schirokauer. + */ + if (WNafUtilities.GetNafWeight(n) < minWeight) + { + p = ChooseRandomPrime(pBitlength, e); + continue; + } + + break; + } + + if (p.CompareTo(q) < 0) + { + BigInteger tmp = p; + p = q; + q = tmp; + } + + BigInteger pSub1 = p.Subtract(One); + BigInteger qSub1 = q.Subtract(One); + //BigInteger phi = pSub1.Multiply(qSub1); + BigInteger gcd = pSub1.Gcd(qSub1); + BigInteger lcm = pSub1.Divide(gcd).Multiply(qSub1); + + // + // calculate the private exponent + // + BigInteger d = e.ModInverse(lcm); + + if (d.BitLength <= qBitlength) + continue; + + // + // calculate the CRT factors + // + BigInteger dP = d.Remainder(pSub1); + BigInteger dQ = d.Remainder(qSub1); + BigInteger qInv = q.ModInverse(p); + + return new AsymmetricCipherKeyPair( + new RsaKeyParameters(false, n, e), + new RsaPrivateCrtKeyParameters(n, e, d, p, q, dP, dQ, qInv)); + } + } + + /// Choose a random prime value for use with RSA + /// the bit-length of the returned prime + /// the RSA public exponent + /// a prime p, with (p-1) relatively prime to e + protected virtual BigInteger ChooseRandomPrime(int bitlength, BigInteger e) + { + bool eIsKnownOddPrime = (e.BitLength <= SPECIAL_E_BITS) && Arrays.Contains(SPECIAL_E_VALUES, e.IntValue); + + for (;;) + { + BigInteger p = new BigInteger(bitlength, 1, parameters.Random); + + if (p.Mod(e).Equals(One)) + continue; + + if (!p.IsProbablePrime(parameters.Certainty, true)) + continue; + + if (!eIsKnownOddPrime && !e.Gcd(p.Subtract(One)).Equals(One)) + continue; + + return p; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RsaKeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RsaKeyPairGenerator.cs.meta new file mode 100644 index 00000000..84cef2b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/RsaKeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d11ab5e345ab24647ab0356dc7f92e64 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/SCrypt.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/SCrypt.cs new file mode 100644 index 00000000..ed168743 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/SCrypt.cs @@ -0,0 +1,186 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + /// Implementation of the scrypt a password-based key derivation function. + /// + /// Scrypt was created by Colin Percival and is specified in + /// draft-josefsson-scrypt-kd. + /// + public class SCrypt + { + /// Generate a key using the scrypt key derivation function. + /// the bytes of the pass phrase. + /// the salt to use for this invocation. + /// CPU/Memory cost parameter. Must be larger than 1, a power of 2 and less than + /// 2^(128 * r / 8). + /// the block size, must be >= 1. + /// Parallelization parameter. Must be a positive integer less than or equal to + /// Int32.MaxValue / (128 * r * 8). + /// the length of the key to generate. + /// the generated key. + public static byte[] Generate(byte[] P, byte[] S, int N, int r, int p, int dkLen) + { + if (P == null) + throw new ArgumentNullException("Passphrase P must be provided."); + if (S == null) + throw new ArgumentNullException("Salt S must be provided."); + if (N <= 1 || !IsPowerOf2(N)) + throw new ArgumentException("Cost parameter N must be > 1 and a power of 2."); + // Only value of r that cost (as an int) could be exceeded for is 1 + if (r == 1 && N >= 65536) + throw new ArgumentException("Cost parameter N must be > 1 and < 65536."); + if (r < 1) + throw new ArgumentException("Block size r must be >= 1."); + int maxParallel = Int32.MaxValue / (128 * r * 8); + if (p < 1 || p > maxParallel) + { + throw new ArgumentException("Parallelisation parameter p must be >= 1 and <= " + maxParallel + + " (based on block size r of " + r + ")"); + } + if (dkLen < 1) + throw new ArgumentException("Generated key length dkLen must be >= 1."); + + return MFcrypt(P, S, N, r, p, dkLen); + } + + private static byte[] MFcrypt(byte[] P, byte[] S, int N, int r, int p, int dkLen) + { + int MFLenBytes = r * 128; + byte[] bytes = SingleIterationPBKDF2(P, S, p * MFLenBytes); + + uint[] B = null; + + try + { + int BLen = bytes.Length >> 2; + B = new uint[BLen]; + + Pack.LE_To_UInt32(bytes, 0, B); + + int MFLenWords = MFLenBytes >> 2; + for (int BOff = 0; BOff < BLen; BOff += MFLenWords) + { + // TODO These can be done in parallel threads + SMix(B, BOff, N, r); + } + + Pack.UInt32_To_LE(B, bytes, 0); + + return SingleIterationPBKDF2(P, bytes, dkLen); + } + finally + { + ClearAll(bytes, B); + } + } + + private static byte[] SingleIterationPBKDF2(byte[] P, byte[] S, int dkLen) + { + PbeParametersGenerator pGen = new Pkcs5S2ParametersGenerator(new Sha256Digest()); + pGen.Init(P, S, 1); + KeyParameter key = (KeyParameter)pGen.GenerateDerivedMacParameters(dkLen * 8); + return key.GetKey(); + } + + private static void SMix(uint[] B, int BOff, int N, int r) + { + int BCount = r * 32; + + uint[] blockX1 = new uint[16]; + uint[] blockX2 = new uint[16]; + uint[] blockY = new uint[BCount]; + + uint[] X = new uint[BCount]; + uint[][] V = new uint[N][]; + + try + { + Array.Copy(B, BOff, X, 0, BCount); + + for (int i = 0; i < N; ++i) + { + V[i] = (uint[])X.Clone(); + BlockMix(X, blockX1, blockX2, blockY, r); + } + + uint mask = (uint)N - 1; + for (int i = 0; i < N; ++i) + { + uint j = X[BCount - 16] & mask; + Xor(X, V[j], 0, X); + BlockMix(X, blockX1, blockX2, blockY, r); + } + + Array.Copy(X, 0, B, BOff, BCount); + } + finally + { + ClearAll(V); + ClearAll(X, blockX1, blockX2, blockY); + } + } + + private static void BlockMix(uint[] B, uint[] X1, uint[] X2, uint[] Y, int r) + { + Array.Copy(B, B.Length - 16, X1, 0, 16); + + int BOff = 0, YOff = 0, halfLen = B.Length >> 1; + + for (int i = 2 * r; i > 0; --i) + { + Xor(X1, B, BOff, X2); + + Salsa20Engine.SalsaCore(8, X2, X1); + Array.Copy(X1, 0, Y, YOff, 16); + + YOff = halfLen + BOff - YOff; + BOff += 16; + } + + Array.Copy(Y, 0, B, 0, Y.Length); + } + + private static void Xor(uint[] a, uint[] b, int bOff, uint[] output) + { + for (int i = output.Length - 1; i >= 0; --i) + { + output[i] = a[i] ^ b[bOff + i]; + } + } + + private static void Clear(Array array) + { + if (array != null) + { + Array.Clear(array, 0, array.Length); + } + } + + private static void ClearAll(params Array[] arrays) + { + foreach (Array array in arrays) + { + Clear(array); + } + } + + // note: we know X is non-zero + private static bool IsPowerOf2(int x) + { + Debug.Assert(x != 0); + + return (x & (x - 1)) == 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/SCrypt.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/SCrypt.cs.meta new file mode 100644 index 00000000..9444d8e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/SCrypt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8823cf014ab23d449745f5379eb32e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X25519KeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X25519KeyPairGenerator.cs new file mode 100644 index 00000000..8dc6cc99 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X25519KeyPairGenerator.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + public class X25519KeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private SecureRandom random; + + public virtual void Init(KeyGenerationParameters parameters) + { + this.random = parameters.Random; + } + + public virtual AsymmetricCipherKeyPair GenerateKeyPair() + { + X25519PrivateKeyParameters privateKey = new X25519PrivateKeyParameters(random); + X25519PublicKeyParameters publicKey = privateKey.GeneratePublicKey(); + return new AsymmetricCipherKeyPair(publicKey, privateKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X25519KeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X25519KeyPairGenerator.cs.meta new file mode 100644 index 00000000..42ec38da --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X25519KeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c6529992521da3f47a1b632f2b203fb1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X448KeyPairGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X448KeyPairGenerator.cs new file mode 100644 index 00000000..d2f9b091 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X448KeyPairGenerator.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators +{ + public class X448KeyPairGenerator + : IAsymmetricCipherKeyPairGenerator + { + private SecureRandom random; + + public virtual void Init(KeyGenerationParameters parameters) + { + this.random = parameters.Random; + } + + public virtual AsymmetricCipherKeyPair GenerateKeyPair() + { + X448PrivateKeyParameters privateKey = new X448PrivateKeyParameters(random); + X448PublicKeyParameters publicKey = privateKey.GeneratePublicKey(); + return new AsymmetricCipherKeyPair(publicKey, privateKey); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X448KeyPairGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X448KeyPairGenerator.cs.meta new file mode 100644 index 00000000..fb9f90e4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/generators/X448KeyPairGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a6f36d86b2007d4ca27dea499f0770a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io.meta new file mode 100644 index 00000000..a861b3ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0d16b3ea73dbb9648b5c61af890ff3fc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/CipherStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/CipherStream.cs new file mode 100644 index 00000000..3a8bb46e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/CipherStream.cs @@ -0,0 +1,256 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO +{ + public class CipherStream + : Stream + { + internal Stream stream; + internal IBufferedCipher inCipher, outCipher; + private byte[] mInBuf; + private int mInPos; + private bool inStreamEnded; + + public CipherStream( + Stream stream, + IBufferedCipher readCipher, + IBufferedCipher writeCipher) + { + this.stream = stream; + + if (readCipher != null) + { + this.inCipher = readCipher; + mInBuf = null; + } + + if (writeCipher != null) + { + this.outCipher = writeCipher; + } + } + + public IBufferedCipher ReadCipher + { + get { return inCipher; } + } + + public IBufferedCipher WriteCipher + { + get { return outCipher; } + } + + public override int ReadByte() + { + if (inCipher == null) + return stream.ReadByte(); + + if (mInBuf == null || mInPos >= mInBuf.Length) + { + if (!FillInBuf()) + return -1; + } + + return mInBuf[mInPos++]; + } + + public override int Read( + byte[] buffer, + int offset, + int count) + { + if (inCipher == null) + return stream.Read(buffer, offset, count); + + int num = 0; + while (num < count) + { + if (mInBuf == null || mInPos >= mInBuf.Length) + { + if (!FillInBuf()) + break; + } + + int numToCopy = System.Math.Min(count - num, mInBuf.Length - mInPos); + Array.Copy(mInBuf, mInPos, buffer, offset + num, numToCopy); + mInPos += numToCopy; + num += numToCopy; + } + + return num; + } + + private bool FillInBuf() + { + if (inStreamEnded) + return false; + + mInPos = 0; + + do + { + mInBuf = ReadAndProcessBlock(); + } + while (!inStreamEnded && mInBuf == null); + + return mInBuf != null; + } + + private byte[] ReadAndProcessBlock() + { + int blockSize = inCipher.GetBlockSize(); + int readSize = (blockSize == 0) ? 256 : blockSize; + + byte[] block = new byte[readSize]; + int numRead = 0; + do + { + int count = stream.Read(block, numRead, block.Length - numRead); + if (count < 1) + { + inStreamEnded = true; + break; + } + numRead += count; + } + while (numRead < block.Length); + + Debug.Assert(inStreamEnded || numRead == block.Length); + + byte[] bytes = inStreamEnded + ? inCipher.DoFinal(block, 0, numRead) + : inCipher.ProcessBytes(block); + + if (bytes != null && bytes.Length == 0) + { + bytes = null; + } + + return bytes; + } + + public override void Write( + byte[] buffer, + int offset, + int count) + { + Debug.Assert(buffer != null); + Debug.Assert(0 <= offset && offset <= buffer.Length); + Debug.Assert(count >= 0); + + int end = offset + count; + + Debug.Assert(0 <= end && end <= buffer.Length); + + if (outCipher == null) + { + stream.Write(buffer, offset, count); + return; + } + + byte[] data = outCipher.ProcessBytes(buffer, offset, count); + if (data != null) + { + stream.Write(data, 0, data.Length); + } + } + + public override void WriteByte( + byte b) + { + if (outCipher == null) + { + stream.WriteByte(b); + return; + } + + byte[] data = outCipher.ProcessByte(b); + if (data != null) + { + stream.Write(data, 0, data.Length); + } + } + + public override bool CanRead + { + get { return stream.CanRead && (inCipher != null); } + } + + public override bool CanWrite + { + get { return stream.CanWrite && (outCipher != null); } + } + + public override bool CanSeek + { + get { return false; } + } + + public sealed override long Length + { + get { throw new NotSupportedException(); } + } + + public sealed override long Position + { + get { throw new NotSupportedException(); } + set { throw new NotSupportedException(); } + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (outCipher != null) + { + byte[] data = outCipher.DoFinal(); + stream.Write(data, 0, data.Length); + stream.Flush(); + } + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(stream); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + if (outCipher != null) + { + byte[] data = outCipher.DoFinal(); + stream.Write(data, 0, data.Length); + stream.Flush(); + } + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(stream); + base.Close(); + } +#endif + + public override void Flush() + { + // Note: outCipher.DoFinal is only called during Close() + stream.Flush(); + } + + public sealed override long Seek( + long offset, + SeekOrigin origin) + { + throw new NotSupportedException(); + } + + public sealed override void SetLength( + long length) + { + throw new NotSupportedException(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/CipherStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/CipherStream.cs.meta new file mode 100644 index 00000000..e99f9f7c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/CipherStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f14ba4986c39a4548a143fe9ea9858a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestSink.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestSink.cs new file mode 100644 index 00000000..e5017da1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestSink.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO +{ + public class DigestSink + : BaseOutputStream + { + private readonly IDigest mDigest; + + public DigestSink(IDigest digest) + { + this.mDigest = digest; + } + + public virtual IDigest Digest + { + get { return mDigest; } + } + + public override void WriteByte(byte b) + { + mDigest.Update(b); + } + + public override void Write(byte[] buf, int off, int len) + { + if (len > 0) + { + mDigest.BlockUpdate(buf, off, len); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestSink.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestSink.cs.meta new file mode 100644 index 00000000..a0e844cb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestSink.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19c2c27df57824948a6439d7aff3cdaf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestStream.cs new file mode 100644 index 00000000..f6aa9a1e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestStream.cs @@ -0,0 +1,155 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO +{ + public class DigestStream + : Stream + { + protected readonly Stream stream; + protected readonly IDigest inDigest; + protected readonly IDigest outDigest; + + public DigestStream( + Stream stream, + IDigest readDigest, + IDigest writeDigest) + { + this.stream = stream; + this.inDigest = readDigest; + this.outDigest = writeDigest; + } + + public virtual IDigest ReadDigest() + { + return inDigest; + } + + public virtual IDigest WriteDigest() + { + return outDigest; + } + + public override int Read( + byte[] buffer, + int offset, + int count) + { + int n = stream.Read(buffer, offset, count); + if (inDigest != null) + { + if (n > 0) + { + inDigest.BlockUpdate(buffer, offset, n); + } + } + return n; + } + + public override int ReadByte() + { + int b = stream.ReadByte(); + if (inDigest != null) + { + if (b >= 0) + { + inDigest.Update((byte)b); + } + } + return b; + } + + public override void Write( + byte[] buffer, + int offset, + int count) + { + if (outDigest != null) + { + if (count > 0) + { + outDigest.BlockUpdate(buffer, offset, count); + } + } + stream.Write(buffer, offset, count); + } + + public override void WriteByte( + byte b) + { + if (outDigest != null) + { + outDigest.Update(b); + } + stream.WriteByte(b); + } + + public override bool CanRead + { + get { return stream.CanRead; } + } + + public override bool CanWrite + { + get { return stream.CanWrite; } + } + + public override bool CanSeek + { + get { return stream.CanSeek; } + } + + public override long Length + { + get { return stream.Length; } + } + + public override long Position + { + get { return stream.Position; } + set { stream.Position = value; } + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(stream); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(stream); + base.Close(); + } +#endif + + public override void Flush() + { + stream.Flush(); + } + + public override long Seek( + long offset, + SeekOrigin origin) + { + return stream.Seek(offset, origin); + } + + public override void SetLength( + long length) + { + stream.SetLength(length); + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestStream.cs.meta new file mode 100644 index 00000000..858722a2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/DigestStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 97329c855262a8c4c96ebe6fb56f4ffb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacSink.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacSink.cs new file mode 100644 index 00000000..0dbbf520 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacSink.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO +{ + public class MacSink + : BaseOutputStream + { + private readonly IMac mMac; + + public MacSink(IMac mac) + { + this.mMac = mac; + } + + public virtual IMac Mac + { + get { return mMac; } + } + + public override void WriteByte(byte b) + { + mMac.Update(b); + } + + public override void Write(byte[] buf, int off, int len) + { + if (len > 0) + { + mMac.BlockUpdate(buf, off, len); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacSink.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacSink.cs.meta new file mode 100644 index 00000000..a30fc66f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacSink.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0411a8b05f7e5e3419bd1ab8a1630319 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacStream.cs new file mode 100644 index 00000000..b11fc1f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacStream.cs @@ -0,0 +1,154 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO +{ + public class MacStream + : Stream + { + protected readonly Stream stream; + protected readonly IMac inMac; + protected readonly IMac outMac; + + public MacStream( + Stream stream, + IMac readMac, + IMac writeMac) + { + this.stream = stream; + this.inMac = readMac; + this.outMac = writeMac; + } + + public virtual IMac ReadMac() + { + return inMac; + } + + public virtual IMac WriteMac() + { + return outMac; + } + + public override int Read( + byte[] buffer, + int offset, + int count) + { + int n = stream.Read(buffer, offset, count); + if (inMac != null) + { + if (n > 0) + { + inMac.BlockUpdate(buffer, offset, n); + } + } + return n; + } + + public override int ReadByte() + { + int b = stream.ReadByte(); + if (inMac != null) + { + if (b >= 0) + { + inMac.Update((byte)b); + } + } + return b; + } + + public override void Write( + byte[] buffer, + int offset, + int count) + { + if (outMac != null) + { + if (count > 0) + { + outMac.BlockUpdate(buffer, offset, count); + } + } + stream.Write(buffer, offset, count); + } + + public override void WriteByte(byte b) + { + if (outMac != null) + { + outMac.Update(b); + } + stream.WriteByte(b); + } + + public override bool CanRead + { + get { return stream.CanRead; } + } + + public override bool CanWrite + { + get { return stream.CanWrite; } + } + + public override bool CanSeek + { + get { return stream.CanSeek; } + } + + public override long Length + { + get { return stream.Length; } + } + + public override long Position + { + get { return stream.Position; } + set { stream.Position = value; } + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(stream); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(stream); + base.Close(); + } +#endif + + public override void Flush() + { + stream.Flush(); + } + + public override long Seek( + long offset, + SeekOrigin origin) + { + return stream.Seek(offset,origin); + } + + public override void SetLength( + long length) + { + stream.SetLength(length); + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacStream.cs.meta new file mode 100644 index 00000000..9ac7a7b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/MacStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89f7b5360e5fde147bf149b2788714da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerSink.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerSink.cs new file mode 100644 index 00000000..2f6b2866 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerSink.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO +{ + public class SignerSink + : BaseOutputStream + { + private readonly ISigner mSigner; + + public SignerSink(ISigner signer) + { + this.mSigner = signer; + } + + public virtual ISigner Signer + { + get { return mSigner; } + } + + public override void WriteByte(byte b) + { + mSigner.Update(b); + } + + public override void Write(byte[] buf, int off, int len) + { + if (len > 0) + { + mSigner.BlockUpdate(buf, off, len); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerSink.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerSink.cs.meta new file mode 100644 index 00000000..3f353298 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerSink.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 23cf4ec0649ecd8418e9723ca65f3bdd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerStream.cs new file mode 100644 index 00000000..3d3ea750 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerStream.cs @@ -0,0 +1,155 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO +{ + public class SignerStream + : Stream + { + protected readonly Stream stream; + protected readonly ISigner inSigner; + protected readonly ISigner outSigner; + + public SignerStream( + Stream stream, + ISigner readSigner, + ISigner writeSigner) + { + this.stream = stream; + this.inSigner = readSigner; + this.outSigner = writeSigner; + } + + public virtual ISigner ReadSigner() + { + return inSigner; + } + + public virtual ISigner WriteSigner() + { + return outSigner; + } + + public override int Read( + byte[] buffer, + int offset, + int count) + { + int n = stream.Read(buffer, offset, count); + if (inSigner != null) + { + if (n > 0) + { + inSigner.BlockUpdate(buffer, offset, n); + } + } + return n; + } + + public override int ReadByte() + { + int b = stream.ReadByte(); + if (inSigner != null) + { + if (b >= 0) + { + inSigner.Update((byte)b); + } + } + return b; + } + + public override void Write( + byte[] buffer, + int offset, + int count) + { + if (outSigner != null) + { + if (count > 0) + { + outSigner.BlockUpdate(buffer, offset, count); + } + } + stream.Write(buffer, offset, count); + } + + public override void WriteByte( + byte b) + { + if (outSigner != null) + { + outSigner.Update(b); + } + stream.WriteByte(b); + } + + public override bool CanRead + { + get { return stream.CanRead; } + } + + public override bool CanWrite + { + get { return stream.CanWrite; } + } + + public override bool CanSeek + { + get { return stream.CanSeek; } + } + + public override long Length + { + get { return stream.Length; } + } + + public override long Position + { + get { return stream.Position; } + set { stream.Position = value; } + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(stream); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(stream); + base.Close(); + } +#endif + + public override void Flush() + { + stream.Flush(); + } + + public override long Seek( + long offset, + SeekOrigin origin) + { + return stream.Seek(offset, origin); + } + + public override void SetLength( + long length) + { + stream.SetLength(length); + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerStream.cs.meta new file mode 100644 index 00000000..71b5e1af --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/io/SignerStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e402c2b637c2e546a7ac4336b548998 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs.meta new file mode 100644 index 00000000..f3ebb3bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d929d360f5bba5429128c0fce7c78e9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CMac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CMac.cs new file mode 100644 index 00000000..10c19f21 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CMac.cs @@ -0,0 +1,261 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /** + * CMAC - as specified at www.nuee.nagoya-u.ac.jp/labs/tiwata/omac/omac.html + *

+ * CMAC is analogous to OMAC1 - see also en.wikipedia.org/wiki/CMAC + *

+ * CMAC is a NIST recomendation - see + * csrc.nist.gov/CryptoToolkit/modes/800-38_Series_Publications/SP800-38B.pdf + *

+ * CMAC/OMAC1 is a blockcipher-based message authentication code designed and + * analyzed by Tetsu Iwata and Kaoru Kurosawa. + *

+ * CMAC/OMAC1 is a simple variant of the CBC MAC (Cipher Block Chaining Message + * Authentication Code). OMAC stands for One-Key CBC MAC. + *

+ * It supports 128- or 64-bits block ciphers, with any key size, and returns + * a MAC with dimension less or equal to the block size of the underlying + * cipher. + *

+ */ + public class CMac + : IMac + { + private const byte CONSTANT_128 = (byte)0x87; + private const byte CONSTANT_64 = (byte)0x1b; + + private byte[] ZEROES; + + private byte[] mac; + + private byte[] buf; + private int bufOff; + private IBlockCipher cipher; + + private int macSize; + + private byte[] L, Lu, Lu2; + + /** + * create a standard MAC based on a CBC block cipher (64 or 128 bit block). + * This will produce an authentication code the length of the block size + * of the cipher. + * + * @param cipher the cipher to be used as the basis of the MAC generation. + */ + public CMac( + IBlockCipher cipher) + : this(cipher, cipher.GetBlockSize() * 8) + { + } + + /** + * create a standard MAC based on a block cipher with the size of the + * MAC been given in bits. + *

+ * Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + * or 16 bits if being used as a data authenticator (FIPS Publication 113), + * and in general should be less than the size of the block cipher as it reduces + * the chance of an exhaustive attack (see Handbook of Applied Cryptography). + * + * @param cipher the cipher to be used as the basis of the MAC generation. + * @param macSizeInBits the size of the MAC in bits, must be a multiple of 8 and @lt;= 128. + */ + public CMac( + IBlockCipher cipher, + int macSizeInBits) + { + if ((macSizeInBits % 8) != 0) + throw new ArgumentException("MAC size must be multiple of 8"); + + if (macSizeInBits > (cipher.GetBlockSize() * 8)) + { + throw new ArgumentException( + "MAC size must be less or equal to " + + (cipher.GetBlockSize() * 8)); + } + + if (cipher.GetBlockSize() != 8 && cipher.GetBlockSize() != 16) + { + throw new ArgumentException( + "Block size must be either 64 or 128 bits"); + } + + this.cipher = new CbcBlockCipher(cipher); + this.macSize = macSizeInBits / 8; + + mac = new byte[cipher.GetBlockSize()]; + + buf = new byte[cipher.GetBlockSize()]; + + ZEROES = new byte[cipher.GetBlockSize()]; + + bufOff = 0; + } + + public string AlgorithmName + { + get { return cipher.AlgorithmName; } + } + + private static int ShiftLeft(byte[] block, byte[] output) + { + int i = block.Length; + uint bit = 0; + while (--i >= 0) + { + uint b = block[i]; + output[i] = (byte)((b << 1) | bit); + bit = (b >> 7) & 1; + } + return (int)bit; + } + + private static byte[] DoubleLu(byte[] input) + { + byte[] ret = new byte[input.Length]; + int carry = ShiftLeft(input, ret); + int xor = input.Length == 16 ? CONSTANT_128 : CONSTANT_64; + + /* + * NOTE: This construction is an attempt at a constant-time implementation. + */ + ret[input.Length - 1] ^= (byte)(xor >> ((1 - carry) << 3)); + + return ret; + } + + public void Init( + ICipherParameters parameters) + { + if (parameters is KeyParameter) + { + cipher.Init(true, parameters); + + //initializes the L, Lu, Lu2 numbers + L = new byte[ZEROES.Length]; + cipher.ProcessBlock(ZEROES, 0, L, 0); + Lu = DoubleLu(L); + Lu2 = DoubleLu(Lu); + } + else if (parameters != null) + { + // CMAC mode does not permit IV to underlying CBC mode + throw new ArgumentException("CMac mode only permits key to be set.", "parameters"); + } + + Reset(); + } + + public int GetMacSize() + { + return macSize; + } + + public void Update( + byte input) + { + if (bufOff == buf.Length) + { + cipher.ProcessBlock(buf, 0, mac, 0); + bufOff = 0; + } + + buf[bufOff++] = input; + } + + public void BlockUpdate( + byte[] inBytes, + int inOff, + int len) + { + if (len < 0) + throw new ArgumentException("Can't have a negative input length!"); + + int blockSize = cipher.GetBlockSize(); + int gapLen = blockSize - bufOff; + + if (len > gapLen) + { + Array.Copy(inBytes, inOff, buf, bufOff, gapLen); + + cipher.ProcessBlock(buf, 0, mac, 0); + + bufOff = 0; + len -= gapLen; + inOff += gapLen; + + while (len > blockSize) + { + cipher.ProcessBlock(inBytes, inOff, mac, 0); + + len -= blockSize; + inOff += blockSize; + } + } + + Array.Copy(inBytes, inOff, buf, bufOff, len); + + bufOff += len; + } + + public int DoFinal( + byte[] outBytes, + int outOff) + { + int blockSize = cipher.GetBlockSize(); + + byte[] lu; + if (bufOff == blockSize) + { + lu = Lu; + } + else + { + new ISO7816d4Padding().AddPadding(buf, bufOff); + lu = Lu2; + } + + for (int i = 0; i < mac.Length; i++) + { + buf[i] ^= lu[i]; + } + + cipher.ProcessBlock(buf, 0, mac, 0); + + Array.Copy(mac, 0, outBytes, outOff, macSize); + + Reset(); + + return macSize; + } + + /** + * Reset the mac generator. + */ + public void Reset() + { + /* + * clean the buffer. + */ + Array.Clear(buf, 0, buf.Length); + bufOff = 0; + + /* + * Reset the underlying cipher. + */ + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CMac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CMac.cs.meta new file mode 100644 index 00000000..7f4f2d55 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 147ba6faf8894394bb4ede3ad60aa6ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CbcBlockCipherMac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CbcBlockCipherMac.cs new file mode 100644 index 00000000..1b0c82cf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CbcBlockCipherMac.cs @@ -0,0 +1,213 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /** + * standard CBC Block Cipher MAC - if no padding is specified the default of + * pad of zeroes is used. + */ + public class CbcBlockCipherMac + : IMac + { + private byte[] buf; + private int bufOff; + private IBlockCipher cipher; + private IBlockCipherPadding padding; + private int macSize; + + /** + * create a standard MAC based on a CBC block cipher. This will produce an + * authentication code half the length of the block size of the cipher. + * + * @param cipher the cipher to be used as the basis of the MAC generation. + */ + public CbcBlockCipherMac( + IBlockCipher cipher) + : this(cipher, (cipher.GetBlockSize() * 8) / 2, null) + { + } + + /** + * create a standard MAC based on a CBC block cipher. This will produce an + * authentication code half the length of the block size of the cipher. + * + * @param cipher the cipher to be used as the basis of the MAC generation. + * @param padding the padding to be used to complete the last block. + */ + public CbcBlockCipherMac( + IBlockCipher cipher, + IBlockCipherPadding padding) + : this(cipher, (cipher.GetBlockSize() * 8) / 2, padding) + { + } + + /** + * create a standard MAC based on a block cipher with the size of the + * MAC been given in bits. This class uses CBC mode as the basis for the + * MAC generation. + *

+ * Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + * or 16 bits if being used as a data authenticator (FIPS Publication 113), + * and in general should be less than the size of the block cipher as it reduces + * the chance of an exhaustive attack (see Handbook of Applied Cryptography). + *

+ * @param cipher the cipher to be used as the basis of the MAC generation. + * @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + */ + public CbcBlockCipherMac( + IBlockCipher cipher, + int macSizeInBits) + : this(cipher, macSizeInBits, null) + { + } + + /** + * create a standard MAC based on a block cipher with the size of the + * MAC been given in bits. This class uses CBC mode as the basis for the + * MAC generation. + *

+ * Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + * or 16 bits if being used as a data authenticator (FIPS Publication 113), + * and in general should be less than the size of the block cipher as it reduces + * the chance of an exhaustive attack (see Handbook of Applied Cryptography). + *

+ * @param cipher the cipher to be used as the basis of the MAC generation. + * @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + * @param padding the padding to be used to complete the last block. + */ + public CbcBlockCipherMac( + IBlockCipher cipher, + int macSizeInBits, + IBlockCipherPadding padding) + { + if ((macSizeInBits % 8) != 0) + throw new ArgumentException("MAC size must be multiple of 8"); + + this.cipher = new CbcBlockCipher(cipher); + this.padding = padding; + this.macSize = macSizeInBits / 8; + + buf = new byte[cipher.GetBlockSize()]; + bufOff = 0; + } + + public string AlgorithmName + { + get { return cipher.AlgorithmName; } + } + + public void Init( + ICipherParameters parameters) + { + Reset(); + + cipher.Init(true, parameters); + } + + public int GetMacSize() + { + return macSize; + } + + public void Update( + byte input) + { + if (bufOff == buf.Length) + { + cipher.ProcessBlock(buf, 0, buf, 0); + bufOff = 0; + } + + buf[bufOff++] = input; + } + + public void BlockUpdate( + byte[] input, + int inOff, + int len) + { + if (len < 0) + throw new ArgumentException("Can't have a negative input length!"); + + int blockSize = cipher.GetBlockSize(); + int gapLen = blockSize - bufOff; + + if (len > gapLen) + { + Array.Copy(input, inOff, buf, bufOff, gapLen); + + cipher.ProcessBlock(buf, 0, buf, 0); + + bufOff = 0; + len -= gapLen; + inOff += gapLen; + + while (len > blockSize) + { + cipher.ProcessBlock(input, inOff, buf, 0); + + len -= blockSize; + inOff += blockSize; + } + } + + Array.Copy(input, inOff, buf, bufOff, len); + + bufOff += len; + } + + public int DoFinal( + byte[] output, + int outOff) + { + int blockSize = cipher.GetBlockSize(); + + if (padding == null) + { + // pad with zeroes + while (bufOff < blockSize) + { + buf[bufOff++] = 0; + } + } + else + { + if (bufOff == blockSize) + { + cipher.ProcessBlock(buf, 0, buf, 0); + bufOff = 0; + } + + padding.AddPadding(buf, bufOff); + } + + cipher.ProcessBlock(buf, 0, buf, 0); + + Array.Copy(buf, 0, output, outOff, macSize); + + Reset(); + + return macSize; + } + + /** + * Reset the mac generator. + */ + public void Reset() + { + // Clear the buffer. + Array.Clear(buf, 0, buf.Length); + bufOff = 0; + + // Reset the underlying cipher. + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CbcBlockCipherMac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CbcBlockCipherMac.cs.meta new file mode 100644 index 00000000..8babb16c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CbcBlockCipherMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 85bfc6f3c7c846946b5e385bca692356 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CfbBlockCipherMac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CfbBlockCipherMac.cs new file mode 100644 index 00000000..9bfa80b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CfbBlockCipherMac.cs @@ -0,0 +1,372 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /** + * implements a Cipher-FeedBack (CFB) mode on top of a simple cipher. + */ + class MacCFBBlockCipher + : IBlockCipher + { + private byte[] IV; + private byte[] cfbV; + private byte[] cfbOutV; + + private readonly int blockSize; + private readonly IBlockCipher cipher; + + /** + * Basic constructor. + * + * @param cipher the block cipher to be used as the basis of the + * feedback mode. + * @param blockSize the block size in bits (note: a multiple of 8) + */ + public MacCFBBlockCipher( + IBlockCipher cipher, + int bitBlockSize) + { + this.cipher = cipher; + this.blockSize = bitBlockSize / 8; + + this.IV = new byte[cipher.GetBlockSize()]; + this.cfbV = new byte[cipher.GetBlockSize()]; + this.cfbOutV = new byte[cipher.GetBlockSize()]; + } + + /** + * Initialise the cipher and, possibly, the initialisation vector (IV). + * If an IV isn't passed as part of the parameter, the IV will be all zeros. + * An IV which is too short is handled in FIPS compliant fashion. + * + * @param param the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public void Init( + bool forEncryption, + ICipherParameters parameters) + { + if (parameters is ParametersWithIV) + { + ParametersWithIV ivParam = (ParametersWithIV)parameters; + byte[] iv = ivParam.GetIV(); + + if (iv.Length < IV.Length) + { + Array.Copy(iv, 0, IV, IV.Length - iv.Length, iv.Length); + } + else + { + Array.Copy(iv, 0, IV, 0, IV.Length); + } + + parameters = ivParam.Parameters; + } + + Reset(); + + cipher.Init(true, parameters); + } + + /** + * return the algorithm name and mode. + * + * @return the name of the underlying algorithm followed by "/CFB" + * and the block size in bits. + */ + public string AlgorithmName + { + get { return cipher.AlgorithmName + "/CFB" + (blockSize * 8); } + } + + public bool IsPartialBlockOkay + { + get { return true; } + } + + /** + * return the block size we are operating at. + * + * @return the block size we are operating at (in bytes). + */ + public int GetBlockSize() + { + return blockSize; + } + + /** + * Process one block of input from the array in and write it to + * the out array. + * + * @param in the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param out the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + public int ProcessBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + if ((inOff + blockSize) > input.Length) + throw new DataLengthException("input buffer too short"); + + if ((outOff + blockSize) > outBytes.Length) + throw new DataLengthException("output buffer too short"); + + cipher.ProcessBlock(cfbV, 0, cfbOutV, 0); + + // + // XOR the cfbV with the plaintext producing the cipher text + // + for (int i = 0; i < blockSize; i++) + { + outBytes[outOff + i] = (byte)(cfbOutV[i] ^ input[inOff + i]); + } + + // + // change over the input block. + // + Array.Copy(cfbV, blockSize, cfbV, 0, cfbV.Length - blockSize); + Array.Copy(outBytes, outOff, cfbV, cfbV.Length - blockSize, blockSize); + + return blockSize; + } + + /** + * reset the chaining vector back to the IV and reset the underlying + * cipher. + */ + public void Reset() + { + IV.CopyTo(cfbV, 0); + + cipher.Reset(); + } + + public void GetMacBlock( + byte[] mac) + { + cipher.ProcessBlock(cfbV, 0, mac, 0); + } + } + + public class CfbBlockCipherMac + : IMac + { + private byte[] mac; + private byte[] Buffer; + private int bufOff; + private MacCFBBlockCipher cipher; + private IBlockCipherPadding padding; + private int macSize; + + /** + * create a standard MAC based on a CFB block cipher. This will produce an + * authentication code half the length of the block size of the cipher, with + * the CFB mode set to 8 bits. + * + * @param cipher the cipher to be used as the basis of the MAC generation. + */ + public CfbBlockCipherMac( + IBlockCipher cipher) + : this(cipher, 8, (cipher.GetBlockSize() * 8) / 2, null) + { + } + + /** + * create a standard MAC based on a CFB block cipher. This will produce an + * authentication code half the length of the block size of the cipher, with + * the CFB mode set to 8 bits. + * + * @param cipher the cipher to be used as the basis of the MAC generation. + * @param padding the padding to be used. + */ + public CfbBlockCipherMac( + IBlockCipher cipher, + IBlockCipherPadding padding) + : this(cipher, 8, (cipher.GetBlockSize() * 8) / 2, padding) + { + } + + /** + * create a standard MAC based on a block cipher with the size of the + * MAC been given in bits. This class uses CFB mode as the basis for the + * MAC generation. + *

+ * Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + * or 16 bits if being used as a data authenticator (FIPS Publication 113), + * and in general should be less than the size of the block cipher as it reduces + * the chance of an exhaustive attack (see Handbook of Applied Cryptography). + *

+ * @param cipher the cipher to be used as the basis of the MAC generation. + * @param cfbBitSize the size of an output block produced by the CFB mode. + * @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + */ + public CfbBlockCipherMac( + IBlockCipher cipher, + int cfbBitSize, + int macSizeInBits) + : this(cipher, cfbBitSize, macSizeInBits, null) + { + } + + /** + * create a standard MAC based on a block cipher with the size of the + * MAC been given in bits. This class uses CFB mode as the basis for the + * MAC generation. + *

+ * Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + * or 16 bits if being used as a data authenticator (FIPS Publication 113), + * and in general should be less than the size of the block cipher as it reduces + * the chance of an exhaustive attack (see Handbook of Applied Cryptography). + *

+ * @param cipher the cipher to be used as the basis of the MAC generation. + * @param cfbBitSize the size of an output block produced by the CFB mode. + * @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + * @param padding a padding to be used. + */ + public CfbBlockCipherMac( + IBlockCipher cipher, + int cfbBitSize, + int macSizeInBits, + IBlockCipherPadding padding) + { + if ((macSizeInBits % 8) != 0) + throw new ArgumentException("MAC size must be multiple of 8"); + + mac = new byte[cipher.GetBlockSize()]; + + this.cipher = new MacCFBBlockCipher(cipher, cfbBitSize); + this.padding = padding; + this.macSize = macSizeInBits / 8; + + Buffer = new byte[this.cipher.GetBlockSize()]; + bufOff = 0; + } + + public string AlgorithmName + { + get { return cipher.AlgorithmName; } + } + + public void Init( + ICipherParameters parameters) + { + Reset(); + + cipher.Init(true, parameters); + } + + public int GetMacSize() + { + return macSize; + } + + public void Update( + byte input) + { + if (bufOff == Buffer.Length) + { + cipher.ProcessBlock(Buffer, 0, mac, 0); + bufOff = 0; + } + + Buffer[bufOff++] = input; + } + + public void BlockUpdate( + byte[] input, + int inOff, + int len) + { + if (len < 0) + throw new ArgumentException("Can't have a negative input length!"); + + int blockSize = cipher.GetBlockSize(); + int resultLen = 0; + int gapLen = blockSize - bufOff; + + if (len > gapLen) + { + Array.Copy(input, inOff, Buffer, bufOff, gapLen); + + resultLen += cipher.ProcessBlock(Buffer, 0, mac, 0); + + bufOff = 0; + len -= gapLen; + inOff += gapLen; + + while (len > blockSize) + { + resultLen += cipher.ProcessBlock(input, inOff, mac, 0); + + len -= blockSize; + inOff += blockSize; + } + } + + Array.Copy(input, inOff, Buffer, bufOff, len); + + bufOff += len; + } + + public int DoFinal( + byte[] output, + int outOff) + { + int blockSize = cipher.GetBlockSize(); + + // pad with zeroes + if (this.padding == null) + { + while (bufOff < blockSize) + { + Buffer[bufOff++] = 0; + } + } + else + { + padding.AddPadding(Buffer, bufOff); + } + + cipher.ProcessBlock(Buffer, 0, mac, 0); + + cipher.GetMacBlock(mac); + + Array.Copy(mac, 0, output, outOff, macSize); + + Reset(); + + return macSize; + } + + /** + * Reset the mac generator. + */ + public void Reset() + { + // Clear the buffer. + Array.Clear(Buffer, 0, Buffer.Length); + bufOff = 0; + + // Reset the underlying cipher. + cipher.Reset(); + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CfbBlockCipherMac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CfbBlockCipherMac.cs.meta new file mode 100644 index 00000000..3baab491 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/CfbBlockCipherMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fc42df051ecc104680ab4efa67051c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7564Mac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7564Mac.cs new file mode 100644 index 00000000..0041617d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7564Mac.cs @@ -0,0 +1,147 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /// + /// Implementation of DSTU7564 mac mode + /// + public class Dstu7564Mac + : IMac + { + private Dstu7564Digest engine; + private int macSize; + + private ulong inputLength; + + byte[] paddedKey; + byte[] invertedKey; + + public string AlgorithmName + { + get { return "DSTU7564Mac"; } + } + + public Dstu7564Mac(int macSizeBits) + { + engine = new Dstu7564Digest(macSizeBits); + macSize = macSizeBits / 8; + } + + public void Init(ICipherParameters parameters) + { + if (parameters is KeyParameter) + { + byte[] key = ((KeyParameter)parameters).GetKey(); + + invertedKey = new byte[key.Length]; + + paddedKey = PadKey(key); + + for (int byteIndex = 0; byteIndex < invertedKey.Length; byteIndex++) + { + invertedKey[byteIndex] = (byte)(key[byteIndex] ^ (byte)0xFF); + } + } + else + { + throw new ArgumentException("Bad parameter passed"); + } + + engine.BlockUpdate(paddedKey, 0, paddedKey.Length); + } + + public int GetMacSize() + { + return macSize; + } + + public void BlockUpdate(byte[] input, int inOff, int len) + { + Check.DataLength(input, inOff, len, "Input buffer too short"); + + if (paddedKey == null) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + engine.BlockUpdate(input, inOff, len); + inputLength += (ulong)len; + } + + public void Update(byte input) + { + engine.Update(input); + inputLength++; + } + + public int DoFinal(byte[] output, int outOff) + { + Check.OutputLength(output, outOff, macSize, "Output buffer too short"); + + if (paddedKey == null) + throw new InvalidOperationException(AlgorithmName + " not initialised"); + + Pad(); + + engine.BlockUpdate(invertedKey, 0, invertedKey.Length); + + inputLength = 0; + + return engine.DoFinal(output, outOff); + } + + public void Reset() + { + inputLength = 0; + engine.Reset(); + if (paddedKey != null) + { + engine.BlockUpdate(paddedKey, 0, paddedKey.Length); + } + } + + private void Pad() + { + int extra = engine.GetByteLength() - (int)(inputLength % (ulong)engine.GetByteLength()); + if (extra < 13) // terminator byte + 96 bits of length + { + extra += engine.GetByteLength(); + } + + byte[] padded = new byte[extra]; + + padded[0] = (byte)0x80; // Defined in standard; + + // Defined in standard; + Pack.UInt64_To_LE(inputLength * 8, padded, padded.Length - 12); + + engine.BlockUpdate(padded, 0, padded.Length); + } + + private byte[] PadKey(byte[] input) + { + int paddedLen = ((input.Length + engine.GetByteLength() - 1) / engine.GetByteLength()) * engine.GetByteLength(); + + int extra = engine.GetByteLength() - (int)(input.Length % engine.GetByteLength()); + if (extra < 13) // terminator byte + 96 bits of length + { + paddedLen += engine.GetByteLength(); + } + + byte[] padded = new byte[paddedLen]; + + Array.Copy(input, 0, padded, 0, input.Length); + + padded[input.Length] = (byte)0x80; // Defined in standard; + Pack.UInt32_To_LE((uint)(input.Length * 8), padded, padded.Length - 12); // Defined in standard; + + return padded; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7564Mac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7564Mac.cs.meta new file mode 100644 index 00000000..11c3be29 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7564Mac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3df87f14e95d97499b6682f752537fd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7624Mac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7624Mac.cs new file mode 100644 index 00000000..af26c5d0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7624Mac.cs @@ -0,0 +1,164 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /** + * implementation of DSTU 7624 MAC + */ + public class Dstu7624Mac : IMac + { + private int macSize; + + private Dstu7624Engine engine; + private int blockSize; + + private byte[] c, cTemp, kDelta; + private byte[] buf; + private int bufOff; + + public Dstu7624Mac(int blockSizeBits, int q) + { + engine = new Dstu7624Engine(blockSizeBits); + + blockSize = blockSizeBits / 8; + + macSize = q / 8; + + c = new byte[blockSize]; + + cTemp = new byte[blockSize]; + + kDelta = new byte[blockSize]; + buf = new byte[blockSize]; + } + + public void Init(ICipherParameters parameters) + { + if (parameters is KeyParameter) + { + engine.Init(true, (KeyParameter)parameters); + + engine.ProcessBlock(kDelta, 0, kDelta, 0); + } + else + { + throw new ArgumentException("invalid parameter passed to Dstu7624Mac init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + } + + public string AlgorithmName + { + get { return "Dstu7624Mac"; } + } + + public int GetMacSize() + { + return macSize; + } + + public void Update(byte input) + { + if (bufOff == buf.Length) + { + processBlock(buf, 0); + bufOff = 0; + } + + buf[bufOff++] = input; + } + + public void BlockUpdate(byte[] input, int inOff, int len) + { + if (len < 0) + { + throw new ArgumentException( + "Can't have a negative input length!"); + } + + int blockSize = engine.GetBlockSize(); + int gapLen = blockSize - bufOff; + + if (len > gapLen) + { + Array.Copy(input, inOff, buf, bufOff, gapLen); + + processBlock(buf, 0); + + bufOff = 0; + len -= gapLen; + inOff += gapLen; + + while (len > blockSize) + { + processBlock(input, inOff); + + len -= blockSize; + inOff += blockSize; + } + } + + Array.Copy(input, inOff, buf, bufOff, len); + + bufOff += len; + } + + private void processBlock(byte[] input, int inOff) + { + Xor(c, 0, input, inOff, cTemp); + + engine.ProcessBlock(cTemp, 0, c, 0); + } + + private void Xor(byte[] c, int cOff, byte[] input, int inOff, byte[] xorResult) + { + for (int byteIndex = 0; byteIndex < blockSize; byteIndex++) + { + xorResult[byteIndex] = (byte)(c[byteIndex + cOff] ^ input[byteIndex + inOff]); + } + } + + public int DoFinal(byte[] output, int outOff) + { + if (bufOff % buf.Length != 0) + { + throw new DataLengthException("Input must be a multiple of blocksize"); + } + + //Last block + Xor(c, 0, buf, 0, cTemp); + Xor(cTemp, 0, kDelta, 0, c); + engine.ProcessBlock(c, 0, c, 0); + + if (macSize + outOff > output.Length) + { + throw new DataLengthException("Output buffer too short"); + } + + Array.Copy(c, 0, output, outOff, macSize); + + return macSize; + } + + public void Reset() + { + Arrays.Fill(c, (byte)0x00); + Arrays.Fill(cTemp, (byte)0x00); + Arrays.Fill(kDelta, (byte)0x00); + Arrays.Fill(buf, (byte)0x00); + engine.Reset(); + engine.ProcessBlock(kDelta, 0, kDelta, 0); + bufOff = 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7624Mac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7624Mac.cs.meta new file mode 100644 index 00000000..f5044f25 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/DSTU7624Mac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1ef86dfb559e6e34c97d13a961c01118 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GMac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GMac.cs new file mode 100644 index 00000000..ba0389c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GMac.cs @@ -0,0 +1,116 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /// + /// The GMAC specialisation of Galois/Counter mode (GCM) detailed in NIST Special Publication + /// 800-38D. + /// + /// + /// GMac is an invocation of the GCM mode where no data is encrypted (i.e. all input data to the Mac + /// is processed as additional authenticated data with the underlying GCM block cipher). + /// + public class GMac + : IMac + { + private readonly GcmBlockCipher cipher; + private readonly int macSizeBits; + + /// + /// Creates a GMAC based on the operation of a block cipher in GCM mode. + /// + /// + /// This will produce an authentication code the length of the block size of the cipher. + /// + /// the cipher to be used in GCM mode to generate the MAC. + public GMac(GcmBlockCipher cipher) + : this(cipher, 128) + { + } + + /// + /// Creates a GMAC based on the operation of a 128 bit block cipher in GCM mode. + /// + /// + /// This will produce an authentication code the length of the block size of the cipher. + /// + /// the cipher to be used in GCM mode to generate the MAC. + /// the mac size to generate, in bits. Must be a multiple of 8, between 32 and 128 (inclusive). + /// Sizes less than 96 are not recommended, but are supported for specialized applications. + public GMac(GcmBlockCipher cipher, int macSizeBits) + { + this.cipher = cipher; + this.macSizeBits = macSizeBits; + } + + /// + /// Initialises the GMAC - requires a + /// providing a and a nonce. + /// + public void Init(ICipherParameters parameters) + { + if (parameters is ParametersWithIV) + { + ParametersWithIV param = (ParametersWithIV)parameters; + + byte[] iv = param.GetIV(); + KeyParameter keyParam = (KeyParameter)param.Parameters; + + // GCM is always operated in encrypt mode to calculate MAC + cipher.Init(true, new AeadParameters(keyParam, macSizeBits, iv)); + } + else + { + throw new ArgumentException("GMAC requires ParametersWithIV"); + } + } + + public string AlgorithmName + { + get { return cipher.GetUnderlyingCipher().AlgorithmName + "-GMAC"; } + } + + public int GetMacSize() + { + return macSizeBits / 8; + } + + public void Update(byte input) + { + cipher.ProcessAadByte(input); + } + + public void BlockUpdate(byte[] input, int inOff, int len) + { + cipher.ProcessAadBytes(input, inOff, len); + } + + public int DoFinal(byte[] output, int outOff) + { + try + { + return cipher.DoFinal(output, outOff); + } + catch (InvalidCipherTextException e) + { + // Impossible in encrypt mode + throw new InvalidOperationException(e.ToString()); + } + } + + public void Reset() + { + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GMac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GMac.cs.meta new file mode 100644 index 00000000..d9eaa7b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff10578c84beafb499d22468085654d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GOST28147Mac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GOST28147Mac.cs new file mode 100644 index 00000000..0d5adddd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GOST28147Mac.cs @@ -0,0 +1,319 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /** + * implementation of GOST 28147-89 MAC + */ + public class Gost28147Mac : IMac + { + private const int blockSize = 8; + private const int macSize = 4; + private int bufOff; + private byte[] buf; + private byte[] mac; + private bool firstStep = true; + private int[] workingKey; + private byte[] macIV = null; + + // + // This is default S-box - E_A. + private byte[] S = + { + 0x9,0x6,0x3,0x2,0x8,0xB,0x1,0x7,0xA,0x4,0xE,0xF,0xC,0x0,0xD,0x5, + 0x3,0x7,0xE,0x9,0x8,0xA,0xF,0x0,0x5,0x2,0x6,0xC,0xB,0x4,0xD,0x1, + 0xE,0x4,0x6,0x2,0xB,0x3,0xD,0x8,0xC,0xF,0x5,0xA,0x0,0x7,0x1,0x9, + 0xE,0x7,0xA,0xC,0xD,0x1,0x3,0x9,0x0,0x2,0xB,0x4,0xF,0x8,0x5,0x6, + 0xB,0x5,0x1,0x9,0x8,0xD,0xF,0x0,0xE,0x4,0x2,0x3,0xC,0x7,0xA,0x6, + 0x3,0xA,0xD,0xC,0x1,0x2,0x0,0xB,0x7,0x5,0x9,0x4,0x8,0xF,0xE,0x6, + 0x1,0xD,0x2,0x9,0x7,0xA,0x6,0x0,0x8,0xC,0x4,0x5,0xF,0x3,0xB,0xE, + 0xB,0xA,0xF,0x5,0x0,0xC,0xE,0x8,0x6,0x2,0x3,0x9,0x1,0x7,0xD,0x4 + }; + + public Gost28147Mac() + { + mac = new byte[blockSize]; + buf = new byte[blockSize]; + bufOff = 0; + } + + private static int[] GenerateWorkingKey( + byte[] userKey) + { + if (userKey.Length != 32) + throw new ArgumentException("Key length invalid. Key needs to be 32 byte - 256 bit!!!"); + + int[] key = new int[8]; + for(int i=0; i!=8; i++) + { + key[i] = bytesToint(userKey,i*4); + } + + return key; + } + + public void Init( + ICipherParameters parameters) + { + Reset(); + buf = new byte[blockSize]; + macIV = null; + if (parameters is ParametersWithSBox) + { + ParametersWithSBox param = (ParametersWithSBox)parameters; + + // + // Set the S-Box + // + param.GetSBox().CopyTo(this.S, 0); + + // + // set key if there is one + // + if (param.Parameters != null) + { + workingKey = GenerateWorkingKey(((KeyParameter)param.Parameters).GetKey()); + } + } + else if (parameters is KeyParameter) + { + workingKey = GenerateWorkingKey(((KeyParameter)parameters).GetKey()); + } + else if (parameters is ParametersWithIV) + { + ParametersWithIV p = (ParametersWithIV)parameters; + + workingKey = GenerateWorkingKey(((KeyParameter)p.Parameters).GetKey()); + Array.Copy(p.GetIV(), 0, mac, 0, mac.Length); + macIV = p.GetIV(); // don't skip the initial CM5Func + } + else + { + throw new ArgumentException("invalid parameter passed to Gost28147 init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + } + + public string AlgorithmName + { + get { return "Gost28147Mac"; } + } + + public int GetMacSize() + { + return macSize; + } + + private int gost28147_mainStep(int n1, int key) + { + int cm = (key + n1); // CM1 + + // S-box replacing + + int om = S[ 0 + ((cm >> (0 * 4)) & 0xF)] << (0 * 4); + om += S[ 16 + ((cm >> (1 * 4)) & 0xF)] << (1 * 4); + om += S[ 32 + ((cm >> (2 * 4)) & 0xF)] << (2 * 4); + om += S[ 48 + ((cm >> (3 * 4)) & 0xF)] << (3 * 4); + om += S[ 64 + ((cm >> (4 * 4)) & 0xF)] << (4 * 4); + om += S[ 80 + ((cm >> (5 * 4)) & 0xF)] << (5 * 4); + om += S[ 96 + ((cm >> (6 * 4)) & 0xF)] << (6 * 4); + om += S[112 + ((cm >> (7 * 4)) & 0xF)] << (7 * 4); + +// return om << 11 | om >>> (32-11); // 11-leftshift + int omLeft = om << 11; + int omRight = (int)(((uint) om) >> (32 - 11)); // Note: Casts required to get unsigned bit rotation + + return omLeft | omRight; + } + + private void gost28147MacFunc( + int[] workingKey, + byte[] input, + int inOff, + byte[] output, + int outOff) + { + int N1, N2, tmp; //tmp -> for saving N1 + N1 = bytesToint(input, inOff); + N2 = bytesToint(input, inOff + 4); + + for (int k = 0; k < 2; k++) // 1-16 steps + { + for (int j = 0; j < 8; j++) + { + tmp = N1; + N1 = N2 ^ gost28147_mainStep(N1, workingKey[j]); // CM2 + N2 = tmp; + } + } + + intTobytes(N1, output, outOff); + intTobytes(N2, output, outOff + 4); + } + + //array of bytes to type int + private static int bytesToint( + byte[] input, + int inOff) + { + return (int)((input[inOff + 3] << 24) & 0xff000000) + ((input[inOff + 2] << 16) & 0xff0000) + + ((input[inOff + 1] << 8) & 0xff00) + (input[inOff] & 0xff); + } + + //int to array of bytes + private static void intTobytes( + int num, + byte[] output, + int outOff) + { + output[outOff + 3] = (byte)(num >> 24); + output[outOff + 2] = (byte)(num >> 16); + output[outOff + 1] = (byte)(num >> 8); + output[outOff] = (byte)num; + } + + private static byte[] CM5func( + byte[] buf, + int bufOff, + byte[] mac) + { + byte[] sum = new byte[buf.Length - bufOff]; + + Array.Copy(buf, bufOff, sum, 0, mac.Length); + + for (int i = 0; i != mac.Length; i++) + { + sum[i] = (byte)(sum[i] ^ mac[i]); + } + + return sum; + } + + public void Update( + byte input) + { + if (bufOff == buf.Length) + { + byte[] sumbuf = new byte[buf.Length]; + Array.Copy(buf, 0, sumbuf, 0, mac.Length); + + if (firstStep) + { + firstStep = false; + if (macIV != null) + { + sumbuf = CM5func(buf, 0, macIV); + } + } + else + { + sumbuf = CM5func(buf, 0, mac); + } + + gost28147MacFunc(workingKey, sumbuf, 0, mac, 0); + bufOff = 0; + } + + buf[bufOff++] = input; + } + + public void BlockUpdate( + byte[] input, + int inOff, + int len) + { + if (len < 0) + throw new ArgumentException("Can't have a negative input length!"); + + int gapLen = blockSize - bufOff; + + if (len > gapLen) + { + Array.Copy(input, inOff, buf, bufOff, gapLen); + + byte[] sumbuf = new byte[buf.Length]; + Array.Copy(buf, 0, sumbuf, 0, mac.Length); + + if (firstStep) + { + firstStep = false; + if (macIV != null) + { + sumbuf = CM5func(buf, 0, macIV); + } + } + else + { + sumbuf = CM5func(buf, 0, mac); + } + + gost28147MacFunc(workingKey, sumbuf, 0, mac, 0); + + bufOff = 0; + len -= gapLen; + inOff += gapLen; + + while (len > blockSize) + { + sumbuf = CM5func(input, inOff, mac); + gost28147MacFunc(workingKey, sumbuf, 0, mac, 0); + + len -= blockSize; + inOff += blockSize; + } + } + + Array.Copy(input, inOff, buf, bufOff, len); + + bufOff += len; + } + + public int DoFinal( + byte[] output, + int outOff) + { + //padding with zero + while (bufOff < blockSize) + { + buf[bufOff++] = 0; + } + + byte[] sumbuf = new byte[buf.Length]; + Array.Copy(buf, 0, sumbuf, 0, mac.Length); + + if (firstStep) + { + firstStep = false; + } + else + { + sumbuf = CM5func(buf, 0, mac); + } + + gost28147MacFunc(workingKey, sumbuf, 0, mac, 0); + + Array.Copy(mac, (mac.Length/2)-macSize, output, outOff, macSize); + + Reset(); + + return macSize; + } + + public void Reset() + { + // Clear the buffer. + Array.Clear(buf, 0, buf.Length); + bufOff = 0; + + firstStep = true; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GOST28147Mac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GOST28147Mac.cs.meta new file mode 100644 index 00000000..9d6814cd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/GOST28147Mac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a1a6f75281759774dbe9f4409f241a2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/HMac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/HMac.cs new file mode 100644 index 00000000..e50a2f71 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/HMac.cs @@ -0,0 +1,158 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /** + * HMAC implementation based on RFC2104 + * + * H(K XOR opad, H(K XOR ipad, text)) + */ + public class HMac + : IMac + { + private const byte IPAD = (byte)0x36; + private const byte OPAD = (byte)0x5C; + + private readonly IDigest digest; + private readonly int digestSize; + private readonly int blockLength; + private IMemoable ipadState; + private IMemoable opadState; + + private readonly byte[] inputPad; + private readonly byte[] outputBuf; + + public HMac(IDigest digest) + { + this.digest = digest; + this.digestSize = digest.GetDigestSize(); + this.blockLength = digest.GetByteLength(); + this.inputPad = new byte[blockLength]; + this.outputBuf = new byte[blockLength + digestSize]; + } + + public virtual string AlgorithmName + { + get { return digest.AlgorithmName + "/HMAC"; } + } + + public virtual IDigest GetUnderlyingDigest() + { + return digest; + } + + public virtual void Init(ICipherParameters parameters) + { + digest.Reset(); + + byte[] key = ((KeyParameter)parameters).GetKey(); + int keyLength = key.Length; + + if (keyLength > blockLength) + { + digest.BlockUpdate(key, 0, keyLength); + digest.DoFinal(inputPad, 0); + + keyLength = digestSize; + } + else + { + Array.Copy(key, 0, inputPad, 0, keyLength); + } + + Array.Clear(inputPad, keyLength, blockLength - keyLength); + Array.Copy(inputPad, 0, outputBuf, 0, blockLength); + + XorPad(inputPad, blockLength, IPAD); + XorPad(outputBuf, blockLength, OPAD); + + if (digest is IMemoable) + { + opadState = ((IMemoable)digest).Copy(); + + ((IDigest)opadState).BlockUpdate(outputBuf, 0, blockLength); + } + + digest.BlockUpdate(inputPad, 0, inputPad.Length); + + if (digest is IMemoable) + { + ipadState = ((IMemoable)digest).Copy(); + } + } + + public virtual int GetMacSize() + { + return digestSize; + } + + public virtual void Update(byte input) + { + digest.Update(input); + } + + public virtual void BlockUpdate(byte[] input, int inOff, int len) + { + digest.BlockUpdate(input, inOff, len); + } + + public virtual int DoFinal(byte[] output, int outOff) + { + digest.DoFinal(outputBuf, blockLength); + + if (opadState != null) + { + ((IMemoable)digest).Reset(opadState); + digest.BlockUpdate(outputBuf, blockLength, digest.GetDigestSize()); + } + else + { + digest.BlockUpdate(outputBuf, 0, outputBuf.Length); + } + + int len = digest.DoFinal(output, outOff); + + Array.Clear(outputBuf, blockLength, digestSize); + + if (ipadState != null) + { + ((IMemoable)digest).Reset(ipadState); + } + else + { + digest.BlockUpdate(inputPad, 0, inputPad.Length); + } + + return len; + } + + /** + * Reset the mac generator. + */ + public virtual void Reset() + { + // Reset underlying digest + digest.Reset(); + + // Initialise the digest + digest.BlockUpdate(inputPad, 0, inputPad.Length); + } + + private static void XorPad(byte[] pad, int len, byte n) + { + for (int i = 0; i < len; ++i) + { + pad[i] ^= n; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/HMac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/HMac.cs.meta new file mode 100644 index 00000000..78867a2f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/HMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff9c8a587cf6ee843b4bc5fadb67a117 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/ISO9797Alg3Mac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/ISO9797Alg3Mac.cs new file mode 100644 index 00000000..31d8d91e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/ISO9797Alg3Mac.cs @@ -0,0 +1,279 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /** + * DES based CBC Block Cipher MAC according to ISO9797, algorithm 3 (ANSI X9.19 Retail MAC) + * + * This could as well be derived from CBCBlockCipherMac, but then the property mac in the base + * class must be changed to protected + */ + public class ISO9797Alg3Mac : IMac + { + private byte[] mac; + private byte[] buf; + private int bufOff; + private IBlockCipher cipher; + private IBlockCipherPadding padding; + private int macSize; + private KeyParameter lastKey2; + private KeyParameter lastKey3; + + /** + * create a Retail-MAC based on a CBC block cipher. This will produce an + * authentication code of the length of the block size of the cipher. + * + * @param cipher the cipher to be used as the basis of the MAC generation. This must + * be DESEngine. + */ + public ISO9797Alg3Mac( + IBlockCipher cipher) + : this(cipher, cipher.GetBlockSize() * 8, null) + { + } + + /** + * create a Retail-MAC based on a CBC block cipher. This will produce an + * authentication code of the length of the block size of the cipher. + * + * @param cipher the cipher to be used as the basis of the MAC generation. + * @param padding the padding to be used to complete the last block. + */ + public ISO9797Alg3Mac( + IBlockCipher cipher, + IBlockCipherPadding padding) + : this(cipher, cipher.GetBlockSize() * 8, padding) + { + } + + /** + * create a Retail-MAC based on a block cipher with the size of the + * MAC been given in bits. This class uses single DES CBC mode as the basis for the + * MAC generation. + *

+ * Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + * or 16 bits if being used as a data authenticator (FIPS Publication 113), + * and in general should be less than the size of the block cipher as it reduces + * the chance of an exhaustive attack (see Handbook of Applied Cryptography). + *

+ * @param cipher the cipher to be used as the basis of the MAC generation. + * @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + */ + public ISO9797Alg3Mac( + IBlockCipher cipher, + int macSizeInBits) + : this(cipher, macSizeInBits, null) + { + } + + /** + * create a standard MAC based on a block cipher with the size of the + * MAC been given in bits. This class uses single DES CBC mode as the basis for the + * MAC generation. The final block is decrypted and then encrypted using the + * middle and right part of the key. + *

+ * Note: the size of the MAC must be at least 24 bits (FIPS Publication 81), + * or 16 bits if being used as a data authenticator (FIPS Publication 113), + * and in general should be less than the size of the block cipher as it reduces + * the chance of an exhaustive attack (see Handbook of Applied Cryptography). + *

+ * @param cipher the cipher to be used as the basis of the MAC generation. + * @param macSizeInBits the size of the MAC in bits, must be a multiple of 8. + * @param padding the padding to be used to complete the last block. + */ + public ISO9797Alg3Mac( + IBlockCipher cipher, + int macSizeInBits, + IBlockCipherPadding padding) + { + if ((macSizeInBits % 8) != 0) + throw new ArgumentException("MAC size must be multiple of 8"); + + if (!(cipher is DesEngine)) + throw new ArgumentException("cipher must be instance of DesEngine"); + + this.cipher = new CbcBlockCipher(cipher); + this.padding = padding; + this.macSize = macSizeInBits / 8; + + mac = new byte[cipher.GetBlockSize()]; + buf = new byte[cipher.GetBlockSize()]; + bufOff = 0; + } + + public string AlgorithmName + { + get { return "ISO9797Alg3"; } + } + + public void Init( + ICipherParameters parameters) + { + Reset(); + + if (!(parameters is KeyParameter || parameters is ParametersWithIV)) + throw new ArgumentException("parameters must be an instance of KeyParameter or ParametersWithIV"); + + // KeyParameter must contain a double or triple length DES key, + // however the underlying cipher is a single DES. The middle and + // right key are used only in the final step. + + KeyParameter kp; + if (parameters is KeyParameter) + { + kp = (KeyParameter)parameters; + } + else + { + kp = (KeyParameter)((ParametersWithIV)parameters).Parameters; + } + + KeyParameter key1; + byte[] keyvalue = kp.GetKey(); + + if (keyvalue.Length == 16) + { // Double length DES key + key1 = new KeyParameter(keyvalue, 0, 8); + this.lastKey2 = new KeyParameter(keyvalue, 8, 8); + this.lastKey3 = key1; + } + else if (keyvalue.Length == 24) + { // Triple length DES key + key1 = new KeyParameter(keyvalue, 0, 8); + this.lastKey2 = new KeyParameter(keyvalue, 8, 8); + this.lastKey3 = new KeyParameter(keyvalue, 16, 8); + } + else + { + throw new ArgumentException("Key must be either 112 or 168 bit long"); + } + + if (parameters is ParametersWithIV) + { + cipher.Init(true, new ParametersWithIV(key1, ((ParametersWithIV)parameters).GetIV())); + } + else + { + cipher.Init(true, key1); + } + } + + public int GetMacSize() + { + return macSize; + } + + public void Update( + byte input) + { + if (bufOff == buf.Length) + { + cipher.ProcessBlock(buf, 0, mac, 0); + bufOff = 0; + } + + buf[bufOff++] = input; + } + + public void BlockUpdate( + byte[] input, + int inOff, + int len) + { + if (len < 0) + throw new ArgumentException("Can't have a negative input length!"); + + int blockSize = cipher.GetBlockSize(); + int resultLen = 0; + int gapLen = blockSize - bufOff; + + if (len > gapLen) + { + Array.Copy(input, inOff, buf, bufOff, gapLen); + + resultLen += cipher.ProcessBlock(buf, 0, mac, 0); + + bufOff = 0; + len -= gapLen; + inOff += gapLen; + + while (len > blockSize) + { + resultLen += cipher.ProcessBlock(input, inOff, mac, 0); + + len -= blockSize; + inOff += blockSize; + } + } + + Array.Copy(input, inOff, buf, bufOff, len); + + bufOff += len; + } + + public int DoFinal( + byte[] output, + int outOff) + { + int blockSize = cipher.GetBlockSize(); + + if (padding == null) + { + // pad with zeroes + while (bufOff < blockSize) + { + buf[bufOff++] = 0; + } + } + else + { + if (bufOff == blockSize) + { + cipher.ProcessBlock(buf, 0, mac, 0); + bufOff = 0; + } + + padding.AddPadding(buf, bufOff); + } + + cipher.ProcessBlock(buf, 0, mac, 0); + + // Added to code from base class + DesEngine deseng = new DesEngine(); + + deseng.Init(false, this.lastKey2); + deseng.ProcessBlock(mac, 0, mac, 0); + + deseng.Init(true, this.lastKey3); + deseng.ProcessBlock(mac, 0, mac, 0); + // **** + + Array.Copy(mac, 0, output, outOff, macSize); + + Reset(); + + return macSize; + } + + /** + * Reset the mac generator. + */ + public void Reset() + { + Array.Clear(buf, 0, buf.Length); + bufOff = 0; + + // reset the underlying cipher. + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/ISO9797Alg3Mac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/ISO9797Alg3Mac.cs.meta new file mode 100644 index 00000000..d00aad9d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/ISO9797Alg3Mac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba1bf157d949c9a40b850fc633d073cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/Poly1305.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/Poly1305.cs new file mode 100644 index 00000000..f0ab17b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/Poly1305.cs @@ -0,0 +1,297 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + + /// + /// Poly1305 message authentication code, designed by D. J. Bernstein. + /// + /// + /// Poly1305 computes a 128-bit (16 bytes) authenticator, using a 128 bit nonce and a 256 bit key + /// consisting of a 128 bit key applied to an underlying cipher, and a 128 bit key (with 106 + /// effective key bits) used in the authenticator. + /// + /// The polynomial calculation in this implementation is adapted from the public domain poly1305-donna-unrolled C implementation + /// by Andrew M (@floodyberry). + /// + /// + public class Poly1305 + : IMac + { + private const int BlockSize = 16; + + private readonly IBlockCipher cipher; + + private readonly byte[] singleByte = new byte[1]; + + // Initialised state + + /** Polynomial key */ + private uint r0, r1, r2, r3, r4; + + /** Precomputed 5 * r[1..4] */ + private uint s1, s2, s3, s4; + + /** Encrypted nonce */ + private uint k0, k1, k2, k3; + + // Accumulating state + + /** Current block of buffered input */ + private byte[] currentBlock = new byte[BlockSize]; + + /** Current offset in input buffer */ + private int currentBlockOffset = 0; + + /** Polynomial accumulator */ + private uint h0, h1, h2, h3, h4; + + /** + * Constructs a Poly1305 MAC, where the key passed to init() will be used directly. + */ + public Poly1305() + { + this.cipher = null; + } + + /** + * Constructs a Poly1305 MAC, using a 128 bit block cipher. + */ + public Poly1305(IBlockCipher cipher) + { + if (cipher.GetBlockSize() != BlockSize) + { + throw new ArgumentException("Poly1305 requires a 128 bit block cipher."); + } + this.cipher = cipher; + } + + /// + /// Initialises the Poly1305 MAC. + /// + /// a {@link ParametersWithIV} containing a 128 bit nonce and a {@link KeyParameter} with + /// a 256 bit key complying to the {@link Poly1305KeyGenerator Poly1305 key format}. + public void Init(ICipherParameters parameters) + { + byte[] nonce = null; + + if (cipher != null) + { + if (!(parameters is ParametersWithIV)) + throw new ArgumentException("Poly1305 requires an IV when used with a block cipher.", "parameters"); + + ParametersWithIV ivParams = (ParametersWithIV)parameters; + nonce = ivParams.GetIV(); + parameters = ivParams.Parameters; + } + + if (!(parameters is KeyParameter)) + throw new ArgumentException("Poly1305 requires a key."); + + KeyParameter keyParams = (KeyParameter)parameters; + + SetKey(keyParams.GetKey(), nonce); + + Reset(); + } + + private void SetKey(byte[] key, byte[] nonce) + { + if (key.Length != 32) + throw new ArgumentException("Poly1305 key must be 256 bits."); + + if (cipher != null && (nonce == null || nonce.Length != BlockSize)) + throw new ArgumentException("Poly1305 requires a 128 bit IV."); + + // Extract r portion of key (and "clamp" the values) + uint t0 = Pack.LE_To_UInt32(key, 0); + uint t1 = Pack.LE_To_UInt32(key, 4); + uint t2 = Pack.LE_To_UInt32(key, 8); + uint t3 = Pack.LE_To_UInt32(key, 12); + + // NOTE: The masks perform the key "clamping" implicitly + r0 = t0 & 0x03FFFFFFU; + r1 = ((t0 >> 26) | (t1 << 6)) & 0x03FFFF03U; + r2 = ((t1 >> 20) | (t2 << 12)) & 0x03FFC0FFU; + r3 = ((t2 >> 14) | (t3 << 18)) & 0x03F03FFFU; + r4 = (t3 >> 8) & 0x000FFFFFU; + + // Precompute multipliers + s1 = r1 * 5; + s2 = r2 * 5; + s3 = r3 * 5; + s4 = r4 * 5; + + byte[] kBytes; + int kOff; + + if (cipher == null) + { + kBytes = key; + kOff = BlockSize; + } + else + { + // Compute encrypted nonce + kBytes = new byte[BlockSize]; + kOff = 0; + + cipher.Init(true, new KeyParameter(key, BlockSize, BlockSize)); + cipher.ProcessBlock(nonce, 0, kBytes, 0); + } + + k0 = Pack.LE_To_UInt32(kBytes, kOff + 0); + k1 = Pack.LE_To_UInt32(kBytes, kOff + 4); + k2 = Pack.LE_To_UInt32(kBytes, kOff + 8); + k3 = Pack.LE_To_UInt32(kBytes, kOff + 12); + } + + public string AlgorithmName + { + get { return cipher == null ? "Poly1305" : "Poly1305-" + cipher.AlgorithmName; } + } + + public int GetMacSize() + { + return BlockSize; + } + + public void Update(byte input) + { + singleByte[0] = input; + BlockUpdate(singleByte, 0, 1); + } + + public void BlockUpdate(byte[] input, int inOff, int len) + { + int copied = 0; + while (len > copied) + { + if (currentBlockOffset == BlockSize) + { + ProcessBlock(); + currentBlockOffset = 0; + } + + int toCopy = System.Math.Min((len - copied), BlockSize - currentBlockOffset); + Array.Copy(input, copied + inOff, currentBlock, currentBlockOffset, toCopy); + copied += toCopy; + currentBlockOffset += toCopy; + } + + } + + private void ProcessBlock() + { + if (currentBlockOffset < BlockSize) + { + currentBlock[currentBlockOffset] = 1; + for (int i = currentBlockOffset + 1; i < BlockSize; i++) + { + currentBlock[i] = 0; + } + } + + ulong t0 = Pack.LE_To_UInt32(currentBlock, 0); + ulong t1 = Pack.LE_To_UInt32(currentBlock, 4); + ulong t2 = Pack.LE_To_UInt32(currentBlock, 8); + ulong t3 = Pack.LE_To_UInt32(currentBlock, 12); + + h0 += (uint)(t0 & 0x3ffffffU); + h1 += (uint)((((t1 << 32) | t0) >> 26) & 0x3ffffff); + h2 += (uint)((((t2 << 32) | t1) >> 20) & 0x3ffffff); + h3 += (uint)((((t3 << 32) | t2) >> 14) & 0x3ffffff); + h4 += (uint)(t3 >> 8); + + if (currentBlockOffset == BlockSize) + { + h4 += (1 << 24); + } + + ulong tp0 = mul32x32_64(h0,r0) + mul32x32_64(h1,s4) + mul32x32_64(h2,s3) + mul32x32_64(h3,s2) + mul32x32_64(h4,s1); + ulong tp1 = mul32x32_64(h0,r1) + mul32x32_64(h1,r0) + mul32x32_64(h2,s4) + mul32x32_64(h3,s3) + mul32x32_64(h4,s2); + ulong tp2 = mul32x32_64(h0,r2) + mul32x32_64(h1,r1) + mul32x32_64(h2,r0) + mul32x32_64(h3,s4) + mul32x32_64(h4,s3); + ulong tp3 = mul32x32_64(h0,r3) + mul32x32_64(h1,r2) + mul32x32_64(h2,r1) + mul32x32_64(h3,r0) + mul32x32_64(h4,s4); + ulong tp4 = mul32x32_64(h0,r4) + mul32x32_64(h1,r3) + mul32x32_64(h2,r2) + mul32x32_64(h3,r1) + mul32x32_64(h4,r0); + + h0 = (uint)tp0 & 0x3ffffff; tp1 += (tp0 >> 26); + h1 = (uint)tp1 & 0x3ffffff; tp2 += (tp1 >> 26); + h2 = (uint)tp2 & 0x3ffffff; tp3 += (tp2 >> 26); + h3 = (uint)tp3 & 0x3ffffff; tp4 += (tp3 >> 26); + h4 = (uint)tp4 & 0x3ffffff; + h0 += (uint)(tp4 >> 26) * 5; + h1 += (h0 >> 26); h0 &= 0x3ffffff; + } + + public int DoFinal(byte[] output, int outOff) + { + Check.DataLength(output, outOff, BlockSize, "Output buffer is too short."); + + if (currentBlockOffset > 0) + { + // Process padded block + ProcessBlock(); + } + + h1 += (h0 >> 26); h0 &= 0x3ffffff; + h2 += (h1 >> 26); h1 &= 0x3ffffff; + h3 += (h2 >> 26); h2 &= 0x3ffffff; + h4 += (h3 >> 26); h3 &= 0x3ffffff; + h0 += (h4 >> 26) * 5; h4 &= 0x3ffffff; + h1 += (h0 >> 26); h0 &= 0x3ffffff; + + uint g0, g1, g2, g3, g4, b; + g0 = h0 + 5; b = g0 >> 26; g0 &= 0x3ffffff; + g1 = h1 + b; b = g1 >> 26; g1 &= 0x3ffffff; + g2 = h2 + b; b = g2 >> 26; g2 &= 0x3ffffff; + g3 = h3 + b; b = g3 >> 26; g3 &= 0x3ffffff; + g4 = h4 + b - (1 << 26); + + b = (g4 >> 31) - 1; + uint nb = ~b; + h0 = (h0 & nb) | (g0 & b); + h1 = (h1 & nb) | (g1 & b); + h2 = (h2 & nb) | (g2 & b); + h3 = (h3 & nb) | (g3 & b); + h4 = (h4 & nb) | (g4 & b); + + ulong f0, f1, f2, f3; + f0 = ((h0 ) | (h1 << 26)) + (ulong)k0; + f1 = ((h1 >> 6 ) | (h2 << 20)) + (ulong)k1; + f2 = ((h2 >> 12) | (h3 << 14)) + (ulong)k2; + f3 = ((h3 >> 18) | (h4 << 8 )) + (ulong)k3; + + Pack.UInt32_To_LE((uint)f0, output, outOff); + f1 += (f0 >> 32); + Pack.UInt32_To_LE((uint)f1, output, outOff + 4); + f2 += (f1 >> 32); + Pack.UInt32_To_LE((uint)f2, output, outOff + 8); + f3 += (f2 >> 32); + Pack.UInt32_To_LE((uint)f3, output, outOff + 12); + + Reset(); + return BlockSize; + } + + public void Reset() + { + currentBlockOffset = 0; + + h0 = h1 = h2 = h3 = h4 = 0; + } + + private static ulong mul32x32_64(uint i1, uint i2) + { + return ((ulong)i1) * i2; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/Poly1305.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/Poly1305.cs.meta new file mode 100644 index 00000000..fd42df6a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/Poly1305.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 741547bc11f330d47b607e905832b385 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SipHash.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SipHash.cs new file mode 100644 index 00000000..74f7e8de --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SipHash.cs @@ -0,0 +1,203 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + /// + /// Implementation of SipHash as specified in "SipHash: a fast short-input PRF", by Jean-Philippe + /// Aumasson and Daniel J. Bernstein (https://131002.net/siphash/siphash.pdf). + /// + /// + /// "SipHash is a family of PRFs SipHash-c-d where the integer parameters c and d are the number of + /// compression rounds and the number of finalization rounds. A compression round is identical to a + /// finalization round and this round function is called SipRound. Given a 128-bit key k and a + /// (possibly empty) byte string m, SipHash-c-d returns a 64-bit value..." + /// + public class SipHash + : IMac + { + protected readonly int c, d; + + protected long k0, k1; + protected long v0, v1, v2, v3; + + protected long m = 0; + protected int wordPos = 0; + protected int wordCount = 0; + + /// SipHash-2-4 + public SipHash() + : this(2, 4) + { + } + + /// SipHash-c-d + /// the number of compression rounds + /// the number of finalization rounds + public SipHash(int c, int d) + { + this.c = c; + this.d = d; + } + + public virtual string AlgorithmName + { + get { return "SipHash-" + c + "-" + d; } + } + + public virtual int GetMacSize() + { + return 8; + } + + public virtual void Init(ICipherParameters parameters) + { + KeyParameter keyParameter = parameters as KeyParameter; + if (keyParameter == null) + throw new ArgumentException("must be an instance of KeyParameter", "parameters"); + byte[] key = keyParameter.GetKey(); + if (key.Length != 16) + throw new ArgumentException("must be a 128-bit key", "parameters"); + + this.k0 = (long)Pack.LE_To_UInt64(key, 0); + this.k1 = (long)Pack.LE_To_UInt64(key, 8); + + Reset(); + } + + public virtual void Update(byte input) + { + m = (long)(((ulong)m >> 8) | ((ulong)input << 56)); + + if (++wordPos == 8) + { + ProcessMessageWord(); + wordPos = 0; + } + } + + public virtual void BlockUpdate(byte[] input, int offset, int length) + { + int i = 0, fullWords = length & ~7; + if (wordPos == 0) + { + for (; i < fullWords; i += 8) + { + m = (long)Pack.LE_To_UInt64(input, offset + i); + ProcessMessageWord(); + } + for (; i < length; ++i) + { + m = (long)(((ulong)m >> 8) | ((ulong)input[offset + i] << 56)); + } + wordPos = length - fullWords; + } + else + { + int bits = wordPos << 3; + for (; i < fullWords; i += 8) + { + ulong n = Pack.LE_To_UInt64(input, offset + i); + m = (long)((n << bits) | ((ulong)m >> -bits)); + ProcessMessageWord(); + m = (long)n; + } + for (; i < length; ++i) + { + m = (long)(((ulong)m >> 8) | ((ulong)input[offset + i] << 56)); + + if (++wordPos == 8) + { + ProcessMessageWord(); + wordPos = 0; + } + } + } + } + + public virtual long DoFinal() + { + // NOTE: 2 distinct shifts to avoid "64-bit shift" when wordPos == 0 + m = (long)((ulong)m >> ((7 - wordPos) << 3)); + m = (long)((ulong)m >> 8); + m = (long)((ulong)m | ((ulong)((wordCount << 3) + wordPos) << 56)); + + ProcessMessageWord(); + + v2 ^= 0xffL; + + ApplySipRounds(d); + + long result = v0 ^ v1 ^ v2 ^ v3; + + Reset(); + + return result; + } + + public virtual int DoFinal(byte[] output, int outOff) + { + long result = DoFinal(); + Pack.UInt64_To_LE((ulong)result, output, outOff); + return 8; + } + + public virtual void Reset() + { + v0 = k0 ^ 0x736f6d6570736575L; + v1 = k1 ^ 0x646f72616e646f6dL; + v2 = k0 ^ 0x6c7967656e657261L; + v3 = k1 ^ 0x7465646279746573L; + + m = 0; + wordPos = 0; + wordCount = 0; + } + + protected virtual void ProcessMessageWord() + { + ++wordCount; + v3 ^= m; + ApplySipRounds(c); + v0 ^= m; + } + + protected virtual void ApplySipRounds(int n) + { + long r0 = v0, r1 = v1, r2 = v2, r3 = v3; + + for (int r = 0; r < n; ++r) + { + r0 += r1; + r2 += r3; + r1 = RotateLeft(r1, 13); + r3 = RotateLeft(r3, 16); + r1 ^= r0; + r3 ^= r2; + r0 = RotateLeft(r0, 32); + r2 += r1; + r0 += r3; + r1 = RotateLeft(r1, 17); + r3 = RotateLeft(r3, 21); + r1 ^= r2; + r3 ^= r0; + r2 = RotateLeft(r2, 32); + } + + v0 = r0; v1 = r1; v2 = r2; v3 = r3; + } + + protected static long RotateLeft(long x, int n) + { + ulong ux = (ulong)x; + ux = (ux << n) | (ux >> -n); + return (long)ux; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SipHash.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SipHash.cs.meta new file mode 100644 index 00000000..e9857af6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SipHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0bbbba09da03b8439fc20b05469327b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SkeinMac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SkeinMac.cs new file mode 100644 index 00000000..3daaf469 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SkeinMac.cs @@ -0,0 +1,122 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + + /// + /// Implementation of the Skein parameterised MAC function in 256, 512 and 1024 bit block sizes, + /// based on the Threefish tweakable block cipher. + /// + /// + /// This is the 1.3 version of Skein defined in the Skein hash function submission to the NIST SHA-3 + /// competition in October 2010. + ///

+ /// Skein was designed by Niels Ferguson - Stefan Lucks - Bruce Schneier - Doug Whiting - Mihir + /// Bellare - Tadayoshi Kohno - Jon Callas - Jesse Walker. + /// + /// + /// + public class SkeinMac + : IMac + { + ///

+ /// 256 bit block size - Skein-256 + /// + public const int SKEIN_256 = SkeinEngine.SKEIN_256; + /// + /// 512 bit block size - Skein-512 + /// + public const int SKEIN_512 = SkeinEngine.SKEIN_512; + /// + /// 1024 bit block size - Skein-1024 + /// + public const int SKEIN_1024 = SkeinEngine.SKEIN_1024; + + private readonly SkeinEngine engine; + + /// + /// Constructs a Skein MAC with an internal state size and output size. + /// + /// the internal state size in bits - one of or + /// . + /// the output/MAC size to produce in bits, which must be an integral number of + /// bytes. + public SkeinMac(int stateSizeBits, int digestSizeBits) + { + this.engine = new SkeinEngine(stateSizeBits, digestSizeBits); + } + + public SkeinMac(SkeinMac mac) + { + this.engine = new SkeinEngine(mac.engine); + } + + public string AlgorithmName + { + get { return "Skein-MAC-" + (engine.BlockSize * 8) + "-" + (engine.OutputSize * 8); } + } + + /// + /// Optionally initialises the Skein digest with the provided parameters. + /// + /// See for details on the parameterisation of the Skein hash function. + /// the parameters to apply to this engine, or null to use no parameters. + public void Init(ICipherParameters parameters) + { + SkeinParameters skeinParameters; + if (parameters is SkeinParameters) + { + skeinParameters = (SkeinParameters)parameters; + } + else if (parameters is KeyParameter) + { + skeinParameters = new SkeinParameters.Builder().SetKey(((KeyParameter)parameters).GetKey()).Build(); + } + else + { + throw new ArgumentException("Invalid parameter passed to Skein MAC init - " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(parameters)); + } + if (skeinParameters.GetKey() == null) + { + throw new ArgumentException("Skein MAC requires a key parameter."); + } + engine.Init(skeinParameters); + } + + public int GetMacSize() + { + return engine.OutputSize; + } + + public void Reset() + { + engine.Reset(); + } + + public void Update(byte inByte) + { + engine.Update(inByte); + } + + public void BlockUpdate(byte[] input, int inOff, int len) + { + engine.Update(input, inOff, len); + } + + public int DoFinal(byte[] output, int outOff) + { + return engine.DoFinal(output, outOff); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SkeinMac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SkeinMac.cs.meta new file mode 100644 index 00000000..20755db2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/SkeinMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: af48cc87590fd7a4d9bb38522bbd59bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/VMPCMac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/VMPCMac.cs new file mode 100644 index 00000000..03c08830 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/VMPCMac.cs @@ -0,0 +1,177 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs +{ + public class VmpcMac + : IMac + { + private byte g; + + private byte n = 0; + private byte[] P = null; + private byte s = 0; + + private byte[] T; + private byte[] workingIV; + + private byte[] workingKey; + + private byte x1, x2, x3, x4; + + public virtual int DoFinal(byte[] output, int outOff) + { + // Execute the Post-Processing Phase + for (int r = 1; r < 25; r++) + { + s = P[(s + P[n & 0xff]) & 0xff]; + + x4 = P[(x4 + x3 + r) & 0xff]; + x3 = P[(x3 + x2 + r) & 0xff]; + x2 = P[(x2 + x1 + r) & 0xff]; + x1 = P[(x1 + s + r) & 0xff]; + T[g & 0x1f] = (byte) (T[g & 0x1f] ^ x1); + T[(g + 1) & 0x1f] = (byte) (T[(g + 1) & 0x1f] ^ x2); + T[(g + 2) & 0x1f] = (byte) (T[(g + 2) & 0x1f] ^ x3); + T[(g + 3) & 0x1f] = (byte) (T[(g + 3) & 0x1f] ^ x4); + g = (byte) ((g + 4) & 0x1f); + + byte temp = P[n & 0xff]; + P[n & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + n = (byte) ((n + 1) & 0xff); + } + + // Input T to the IV-phase of the VMPC KSA + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + T[m & 0x1f]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + + // Store 20 new outputs of the VMPC Stream Cipher input table M + byte[] M = new byte[20]; + for (int i = 0; i < 20; i++) + { + s = P[(s + P[i & 0xff]) & 0xff]; + M[i] = P[(P[(P[s & 0xff]) & 0xff] + 1) & 0xff]; + + byte temp = P[i & 0xff]; + P[i & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + + Array.Copy(M, 0, output, outOff, M.Length); + Reset(); + + return M.Length; + } + + public virtual string AlgorithmName + { + get { return "VMPC-MAC"; } + } + + public virtual int GetMacSize() + { + return 20; + } + + public virtual void Init(ICipherParameters parameters) + { + if (!(parameters is ParametersWithIV)) + throw new ArgumentException("VMPC-MAC Init parameters must include an IV", "parameters"); + + ParametersWithIV ivParams = (ParametersWithIV) parameters; + KeyParameter key = (KeyParameter) ivParams.Parameters; + + if (!(ivParams.Parameters is KeyParameter)) + throw new ArgumentException("VMPC-MAC Init parameters must include a key", "parameters"); + + this.workingIV = ivParams.GetIV(); + + if (workingIV == null || workingIV.Length < 1 || workingIV.Length > 768) + throw new ArgumentException("VMPC-MAC requires 1 to 768 bytes of IV", "parameters"); + + this.workingKey = key.GetKey(); + + Reset(); + + } + + private void initKey(byte[] keyBytes, byte[] ivBytes) + { + s = 0; + P = new byte[256]; + for (int i = 0; i < 256; i++) + { + P[i] = (byte) i; + } + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + keyBytes[m % keyBytes.Length]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + for (int m = 0; m < 768; m++) + { + s = P[(s + P[m & 0xff] + ivBytes[m % ivBytes.Length]) & 0xff]; + byte temp = P[m & 0xff]; + P[m & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + } + n = 0; + } + + public virtual void Reset() + { + initKey(this.workingKey, this.workingIV); + g = x1 = x2 = x3 = x4 = n = 0; + T = new byte[32]; + for (int i = 0; i < 32; i++) + { + T[i] = 0; + } + } + + public virtual void Update(byte input) + { + s = P[(s + P[n & 0xff]) & 0xff]; + byte c = (byte) (input ^ P[(P[(P[s & 0xff]) & 0xff] + 1) & 0xff]); + + x4 = P[(x4 + x3) & 0xff]; + x3 = P[(x3 + x2) & 0xff]; + x2 = P[(x2 + x1) & 0xff]; + x1 = P[(x1 + s + c) & 0xff]; + T[g & 0x1f] = (byte) (T[g & 0x1f] ^ x1); + T[(g + 1) & 0x1f] = (byte) (T[(g + 1) & 0x1f] ^ x2); + T[(g + 2) & 0x1f] = (byte) (T[(g + 2) & 0x1f] ^ x3); + T[(g + 3) & 0x1f] = (byte) (T[(g + 3) & 0x1f] ^ x4); + g = (byte) ((g + 4) & 0x1f); + + byte temp = P[n & 0xff]; + P[n & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + n = (byte) ((n + 1) & 0xff); + } + + public virtual void BlockUpdate(byte[] input, int inOff, int len) + { + if ((inOff + len) > input.Length) + throw new DataLengthException("input buffer too short"); + + for (int i = 0; i < len; i++) + { + Update(input[inOff + i]); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/VMPCMac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/VMPCMac.cs.meta new file mode 100644 index 00000000..892d98a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/macs/VMPCMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4144352b9e83dda43b21e612553bf87c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes.meta new file mode 100644 index 00000000..d65ffab2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7290ea1bd4b4b8044b8c839a0f6e38e6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CbcBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CbcBlockCipher.cs new file mode 100644 index 00000000..8c683f59 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CbcBlockCipher.cs @@ -0,0 +1,245 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * implements Cipher-Block-Chaining (CBC) mode on top of a simple cipher. + */ + public sealed class CbcBlockCipher + : IBlockCipher + { + private byte[] IV, cbcV, cbcNextV; + private int blockSize; + private IBlockCipher cipher; + private bool encrypting; + + /** + * Basic constructor. + * + * @param cipher the block cipher to be used as the basis of chaining. + */ + public CbcBlockCipher( + IBlockCipher cipher) + { + this.cipher = cipher; + this.blockSize = cipher.GetBlockSize(); + + this.IV = new byte[blockSize]; + this.cbcV = new byte[blockSize]; + this.cbcNextV = new byte[blockSize]; + } + + /** + * return the underlying block cipher that we are wrapping. + * + * @return the underlying block cipher that we are wrapping. + */ + public IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + + /** + * Initialise the cipher and, possibly, the initialisation vector (IV). + * If an IV isn't passed as part of the parameter, the IV will be all zeros. + * + * @param forEncryption if true the cipher is initialised for + * encryption, if false for decryption. + * @param param the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public void Init( + bool forEncryption, + ICipherParameters parameters) + { + bool oldEncrypting = this.encrypting; + + this.encrypting = forEncryption; + + if (parameters is ParametersWithIV) + { + ParametersWithIV ivParam = (ParametersWithIV)parameters; + byte[] iv = ivParam.GetIV(); + + if (iv.Length != blockSize) + { + throw new ArgumentException("initialisation vector must be the same length as block size"); + } + + Array.Copy(iv, 0, IV, 0, iv.Length); + + parameters = ivParam.Parameters; + } + + Reset(); + + // if null it's an IV changed only. + if (parameters != null) + { + cipher.Init(encrypting, parameters); + } + else if (oldEncrypting != encrypting) + { + throw new ArgumentException("cannot change encrypting state without providing key."); + } + } + + /** + * return the algorithm name and mode. + * + * @return the name of the underlying algorithm followed by "/CBC". + */ + public string AlgorithmName + { + get { return cipher.AlgorithmName + "/CBC"; } + } + + public bool IsPartialBlockOkay + { + get { return false; } + } + + /** + * return the block size of the underlying cipher. + * + * @return the block size of the underlying cipher. + */ + public int GetBlockSize() + { + return cipher.GetBlockSize(); + } + + /** + * Process one block of input from the array in and write it to + * the out array. + * + * @param in the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param out the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + public int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + return (encrypting) + ? EncryptBlock(input, inOff, output, outOff) + : DecryptBlock(input, inOff, output, outOff); + } + + /** + * reset the chaining vector back to the IV and reset the underlying + * cipher. + */ + public void Reset() + { + Array.Copy(IV, 0, cbcV, 0, IV.Length); + Array.Clear(cbcNextV, 0, cbcNextV.Length); + + cipher.Reset(); + } + + /** + * Do the appropriate chaining step for CBC mode encryption. + * + * @param in the array containing the data to be encrypted. + * @param inOff offset into the in array the data starts at. + * @param out the array the encrypted data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + private int EncryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + if ((inOff + blockSize) > input.Length) + { + throw new DataLengthException("input buffer too short"); + } + + /* + * XOR the cbcV and the input, + * then encrypt the cbcV + */ + for (int i = 0; i < blockSize; i++) + { + cbcV[i] ^= input[inOff + i]; + } + + int length = cipher.ProcessBlock(cbcV, 0, outBytes, outOff); + + /* + * copy ciphertext to cbcV + */ + Array.Copy(outBytes, outOff, cbcV, 0, cbcV.Length); + + return length; + } + + /** + * Do the appropriate chaining step for CBC mode decryption. + * + * @param in the array containing the data to be decrypted. + * @param inOff offset into the in array the data starts at. + * @param out the array the decrypted data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + private int DecryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + if ((inOff + blockSize) > input.Length) + { + throw new DataLengthException("input buffer too short"); + } + + Array.Copy(input, inOff, cbcNextV, 0, blockSize); + + int length = cipher.ProcessBlock(input, inOff, outBytes, outOff); + + /* + * XOR the cbcV and the output + */ + for (int i = 0; i < blockSize; i++) + { + outBytes[outOff + i] ^= cbcV[i]; + } + + /* + * swap the back up buffer into next position + */ + byte[] tmp; + + tmp = cbcV; + cbcV = cbcNextV; + cbcNextV = tmp; + + return length; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CbcBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CbcBlockCipher.cs.meta new file mode 100644 index 00000000..723b50a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CbcBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3831153ecb36bcf4ba6723fbb3b02484 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CcmBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CcmBlockCipher.cs new file mode 100644 index 00000000..c07163d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CcmBlockCipher.cs @@ -0,0 +1,451 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * Implements the Counter with Cipher Block Chaining mode (CCM) detailed in + * NIST Special Publication 800-38C. + *

+ * Note: this mode is a packet mode - it needs all the data up front. + *

+ */ + public class CcmBlockCipher + : IAeadBlockCipher + { + private static readonly int BlockSize = 16; + + private readonly IBlockCipher cipher; + private readonly byte[] macBlock; + private bool forEncryption; + private byte[] nonce; + private byte[] initialAssociatedText; + private int macSize; + private ICipherParameters keyParam; + private readonly MemoryStream associatedText = new MemoryStream(); + private readonly MemoryStream data = new MemoryStream(); + + /** + * Basic constructor. + * + * @param cipher the block cipher to be used. + */ + public CcmBlockCipher( + IBlockCipher cipher) + { + this.cipher = cipher; + this.macBlock = new byte[BlockSize]; + + if (cipher.GetBlockSize() != BlockSize) + throw new ArgumentException("cipher required with a block size of " + BlockSize + "."); + } + + /** + * return the underlying block cipher that we are wrapping. + * + * @return the underlying block cipher that we are wrapping. + */ + public virtual IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.forEncryption = forEncryption; + + ICipherParameters cipherParameters; + if (parameters is AeadParameters) + { + AeadParameters param = (AeadParameters) parameters; + + nonce = param.GetNonce(); + initialAssociatedText = param.GetAssociatedText(); + macSize = param.MacSize / 8; + cipherParameters = param.Key; + } + else if (parameters is ParametersWithIV) + { + ParametersWithIV param = (ParametersWithIV) parameters; + + nonce = param.GetIV(); + initialAssociatedText = null; + macSize = macBlock.Length / 2; + cipherParameters = param.Parameters; + } + else + { + throw new ArgumentException("invalid parameters passed to CCM"); + } + + // NOTE: Very basic support for key re-use, but no performance gain from it + if (cipherParameters != null) + { + keyParam = cipherParameters; + } + + if (nonce == null || nonce.Length < 7 || nonce.Length > 13) + throw new ArgumentException("nonce must have length from 7 to 13 octets"); + + Reset(); + } + + public virtual string AlgorithmName + { + get { return cipher.AlgorithmName + "/CCM"; } + } + + public virtual int GetBlockSize() + { + return cipher.GetBlockSize(); + } + + public virtual void ProcessAadByte(byte input) + { + associatedText.WriteByte(input); + } + + public virtual void ProcessAadBytes(byte[] inBytes, int inOff, int len) + { + // TODO: Process AAD online + associatedText.Write(inBytes, inOff, len); + } + + public virtual int ProcessByte( + byte input, + byte[] outBytes, + int outOff) + { + data.WriteByte(input); + + return 0; + } + + public virtual int ProcessBytes( + byte[] inBytes, + int inOff, + int inLen, + byte[] outBytes, + int outOff) + { + Check.DataLength(inBytes, inOff, inLen, "Input buffer too short"); + + data.Write(inBytes, inOff, inLen); + + return 0; + } + + public virtual int DoFinal( + byte[] outBytes, + int outOff) + { +#if PORTABLE || NETFX_CORE + byte[] input = data.ToArray(); + int inLen = input.Length; +#else + byte[] input = data.GetBuffer(); + int inLen = (int)data.Position; +#endif + + int len = ProcessPacket(input, 0, inLen, outBytes, outOff); + + Reset(); + + return len; + } + + public virtual void Reset() + { + cipher.Reset(); + associatedText.SetLength(0); + data.SetLength(0); + } + + /** + * Returns a byte array containing the mac calculated as part of the + * last encrypt or decrypt operation. + * + * @return the last mac calculated. + */ + public virtual byte[] GetMac() + { + return Arrays.CopyOfRange(macBlock, 0, macSize); + } + + public virtual int GetUpdateOutputSize( + int len) + { + return 0; + } + + public virtual int GetOutputSize( + int len) + { + int totalData = (int)data.Length + len; + + if (forEncryption) + { + return totalData + macSize; + } + + return totalData < macSize ? 0 : totalData - macSize; + } + + /** + * Process a packet of data for either CCM decryption or encryption. + * + * @param in data for processing. + * @param inOff offset at which data starts in the input array. + * @param inLen length of the data in the input array. + * @return a byte array containing the processed input.. + * @throws IllegalStateException if the cipher is not appropriately set up. + * @throws InvalidCipherTextException if the input data is truncated or the mac check fails. + */ + public virtual byte[] ProcessPacket(byte[] input, int inOff, int inLen) + { + byte[] output; + + if (forEncryption) + { + output = new byte[inLen + macSize]; + } + else + { + if (inLen < macSize) + throw new InvalidCipherTextException("data too short"); + + output = new byte[inLen - macSize]; + } + + ProcessPacket(input, inOff, inLen, output, 0); + + return output; + } + + /** + * Process a packet of data for either CCM decryption or encryption. + * + * @param in data for processing. + * @param inOff offset at which data starts in the input array. + * @param inLen length of the data in the input array. + * @param output output array. + * @param outOff offset into output array to start putting processed bytes. + * @return the number of bytes added to output. + * @throws IllegalStateException if the cipher is not appropriately set up. + * @throws InvalidCipherTextException if the input data is truncated or the mac check fails. + * @throws DataLengthException if output buffer too short. + */ + public virtual int ProcessPacket(byte[] input, int inOff, int inLen, byte[] output, int outOff) + { + // TODO: handle null keyParam (e.g. via RepeatedKeySpec) + // Need to keep the CTR and CBC Mac parts around and reset + if (keyParam == null) + throw new InvalidOperationException("CCM cipher unitialized."); + + int n = nonce.Length; + int q = 15 - n; + if (q < 4) + { + int limitLen = 1 << (8 * q); + if (inLen >= limitLen) + throw new InvalidOperationException("CCM packet too large for choice of q."); + } + + byte[] iv = new byte[BlockSize]; + iv[0] = (byte)((q - 1) & 0x7); + nonce.CopyTo(iv, 1); + + IBlockCipher ctrCipher = new SicBlockCipher(cipher); + ctrCipher.Init(forEncryption, new ParametersWithIV(keyParam, iv)); + + int outputLen; + int inIndex = inOff; + int outIndex = outOff; + + if (forEncryption) + { + outputLen = inLen + macSize; + Check.OutputLength(output, outOff, outputLen, "Output buffer too short."); + + CalculateMac(input, inOff, inLen, macBlock); + + byte[] encMac = new byte[BlockSize]; + ctrCipher.ProcessBlock(macBlock, 0, encMac, 0); // S0 + + while (inIndex < (inOff + inLen - BlockSize)) // S1... + { + ctrCipher.ProcessBlock(input, inIndex, output, outIndex); + outIndex += BlockSize; + inIndex += BlockSize; + } + + byte[] block = new byte[BlockSize]; + + Array.Copy(input, inIndex, block, 0, inLen + inOff - inIndex); + + ctrCipher.ProcessBlock(block, 0, block, 0); + + Array.Copy(block, 0, output, outIndex, inLen + inOff - inIndex); + + Array.Copy(encMac, 0, output, outOff + inLen, macSize); + } + else + { + if (inLen < macSize) + throw new InvalidCipherTextException("data too short"); + + outputLen = inLen - macSize; + Check.OutputLength(output, outOff, outputLen, "Output buffer too short."); + + Array.Copy(input, inOff + outputLen, macBlock, 0, macSize); + + ctrCipher.ProcessBlock(macBlock, 0, macBlock, 0); + + for (int i = macSize; i != macBlock.Length; i++) + { + macBlock[i] = 0; + } + + while (inIndex < (inOff + outputLen - BlockSize)) + { + ctrCipher.ProcessBlock(input, inIndex, output, outIndex); + outIndex += BlockSize; + inIndex += BlockSize; + } + + byte[] block = new byte[BlockSize]; + + Array.Copy(input, inIndex, block, 0, outputLen - (inIndex - inOff)); + + ctrCipher.ProcessBlock(block, 0, block, 0); + + Array.Copy(block, 0, output, outIndex, outputLen - (inIndex - inOff)); + + byte[] calculatedMacBlock = new byte[BlockSize]; + + CalculateMac(output, outOff, outputLen, calculatedMacBlock); + + if (!Arrays.ConstantTimeAreEqual(macBlock, calculatedMacBlock)) + throw new InvalidCipherTextException("mac check in CCM failed"); + } + + return outputLen; + } + + private int CalculateMac(byte[] data, int dataOff, int dataLen, byte[] macBlock) + { + IMac cMac = new CbcBlockCipherMac(cipher, macSize * 8); + + cMac.Init(keyParam); + + // + // build b0 + // + byte[] b0 = new byte[16]; + + if (HasAssociatedText()) + { + b0[0] |= 0x40; + } + + b0[0] |= (byte)((((cMac.GetMacSize() - 2) / 2) & 0x7) << 3); + + b0[0] |= (byte)(((15 - nonce.Length) - 1) & 0x7); + + Array.Copy(nonce, 0, b0, 1, nonce.Length); + + int q = dataLen; + int count = 1; + while (q > 0) + { + b0[b0.Length - count] = (byte)(q & 0xff); + q >>= 8; + count++; + } + + cMac.BlockUpdate(b0, 0, b0.Length); + + // + // process associated text + // + if (HasAssociatedText()) + { + int extra; + + int textLength = GetAssociatedTextLength(); + if (textLength < ((1 << 16) - (1 << 8))) + { + cMac.Update((byte)(textLength >> 8)); + cMac.Update((byte)textLength); + + extra = 2; + } + else // can't go any higher than 2^32 + { + cMac.Update((byte)0xff); + cMac.Update((byte)0xfe); + cMac.Update((byte)(textLength >> 24)); + cMac.Update((byte)(textLength >> 16)); + cMac.Update((byte)(textLength >> 8)); + cMac.Update((byte)textLength); + + extra = 6; + } + + if (initialAssociatedText != null) + { + cMac.BlockUpdate(initialAssociatedText, 0, initialAssociatedText.Length); + } + if (associatedText.Position > 0) + { +#if PORTABLE || NETFX_CORE + byte[] input = associatedText.ToArray(); + int len = input.Length; +#else + byte[] input = associatedText.GetBuffer(); + int len = (int)associatedText.Position; +#endif + + cMac.BlockUpdate(input, 0, len); + } + + extra = (extra + textLength) % 16; + if (extra != 0) + { + for (int i = extra; i < 16; ++i) + { + cMac.Update((byte)0x00); + } + } + } + + // + // add the text + // + cMac.BlockUpdate(data, dataOff, dataLen); + + return cMac.DoFinal(macBlock, 0); + } + + private int GetAssociatedTextLength() + { + return (int)associatedText.Length + ((initialAssociatedText == null) ? 0 : initialAssociatedText.Length); + } + + private bool HasAssociatedText() + { + return GetAssociatedTextLength() > 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CcmBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CcmBlockCipher.cs.meta new file mode 100644 index 00000000..4f10a308 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CcmBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e209f184af83f8f4494a19e8b869a055 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CfbBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CfbBlockCipher.cs new file mode 100644 index 00000000..87249413 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CfbBlockCipher.cs @@ -0,0 +1,228 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * implements a Cipher-FeedBack (CFB) mode on top of a simple cipher. + */ + public class CfbBlockCipher + : IBlockCipher + { + private byte[] IV; + private byte[] cfbV; + private byte[] cfbOutV; + private bool encrypting; + + private readonly int blockSize; + private readonly IBlockCipher cipher; + + /** + * Basic constructor. + * + * @param cipher the block cipher to be used as the basis of the + * feedback mode. + * @param blockSize the block size in bits (note: a multiple of 8) + */ + public CfbBlockCipher( + IBlockCipher cipher, + int bitBlockSize) + { + this.cipher = cipher; + this.blockSize = bitBlockSize / 8; + this.IV = new byte[cipher.GetBlockSize()]; + this.cfbV = new byte[cipher.GetBlockSize()]; + this.cfbOutV = new byte[cipher.GetBlockSize()]; + } + /** + * return the underlying block cipher that we are wrapping. + * + * @return the underlying block cipher that we are wrapping. + */ + public IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + /** + * Initialise the cipher and, possibly, the initialisation vector (IV). + * If an IV isn't passed as part of the parameter, the IV will be all zeros. + * An IV which is too short is handled in FIPS compliant fashion. + * + * @param forEncryption if true the cipher is initialised for + * encryption, if false for decryption. + * @param param the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.encrypting = forEncryption; + if (parameters is ParametersWithIV) + { + ParametersWithIV ivParam = (ParametersWithIV) parameters; + byte[] iv = ivParam.GetIV(); + int diff = IV.Length - iv.Length; + Array.Copy(iv, 0, IV, diff, iv.Length); + Array.Clear(IV, 0, diff); + + parameters = ivParam.Parameters; + } + Reset(); + + // if it's null, key is to be reused. + if (parameters != null) + { + cipher.Init(true, parameters); + } + } + + /** + * return the algorithm name and mode. + * + * @return the name of the underlying algorithm followed by "/CFB" + * and the block size in bits. + */ + public string AlgorithmName + { + get { return cipher.AlgorithmName + "/CFB" + (blockSize * 8); } + } + + public bool IsPartialBlockOkay + { + get { return true; } + } + + /** + * return the block size we are operating at. + * + * @return the block size we are operating at (in bytes). + */ + public int GetBlockSize() + { + return blockSize; + } + + /** + * Process one block of input from the array in and write it to + * the out array. + * + * @param in the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param out the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + public int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + return (encrypting) + ? EncryptBlock(input, inOff, output, outOff) + : DecryptBlock(input, inOff, output, outOff); + } + + /** + * Do the appropriate processing for CFB mode encryption. + * + * @param in the array containing the data to be encrypted. + * @param inOff offset into the in array the data starts at. + * @param out the array the encrypted data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + public int EncryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + if ((inOff + blockSize) > input.Length) + { + throw new DataLengthException("input buffer too short"); + } + if ((outOff + blockSize) > outBytes.Length) + { + throw new DataLengthException("output buffer too short"); + } + cipher.ProcessBlock(cfbV, 0, cfbOutV, 0); + // + // XOR the cfbV with the plaintext producing the ciphertext + // + for (int i = 0; i < blockSize; i++) + { + outBytes[outOff + i] = (byte)(cfbOutV[i] ^ input[inOff + i]); + } + // + // change over the input block. + // + Array.Copy(cfbV, blockSize, cfbV, 0, cfbV.Length - blockSize); + Array.Copy(outBytes, outOff, cfbV, cfbV.Length - blockSize, blockSize); + return blockSize; + } + /** + * Do the appropriate processing for CFB mode decryption. + * + * @param in the array containing the data to be decrypted. + * @param inOff offset into the in array the data starts at. + * @param out the array the encrypted data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + public int DecryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + if ((inOff + blockSize) > input.Length) + { + throw new DataLengthException("input buffer too short"); + } + if ((outOff + blockSize) > outBytes.Length) + { + throw new DataLengthException("output buffer too short"); + } + cipher.ProcessBlock(cfbV, 0, cfbOutV, 0); + // + // change over the input block. + // + Array.Copy(cfbV, blockSize, cfbV, 0, cfbV.Length - blockSize); + Array.Copy(input, inOff, cfbV, cfbV.Length - blockSize, blockSize); + // + // XOR the cfbV with the ciphertext producing the plaintext + // + for (int i = 0; i < blockSize; i++) + { + outBytes[outOff + i] = (byte)(cfbOutV[i] ^ input[inOff + i]); + } + return blockSize; + } + /** + * reset the chaining vector back to the IV and reset the underlying + * cipher. + */ + public void Reset() + { + Array.Copy(IV, 0, cfbV, 0, IV.Length); + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CfbBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CfbBlockCipher.cs.meta new file mode 100644 index 00000000..6118b126 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CfbBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c7ff0cbf4f101654b8f34a6112e42ae3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CtsBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CtsBlockCipher.cs new file mode 100644 index 00000000..5008ae4a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CtsBlockCipher.cs @@ -0,0 +1,257 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * A Cipher Text Stealing (CTS) mode cipher. CTS allows block ciphers to + * be used to produce cipher text which is the same outLength as the plain text. + */ + public class CtsBlockCipher + : BufferedBlockCipher + { + private readonly int blockSize; + + /** + * Create a buffered block cipher that uses Cipher Text Stealing + * + * @param cipher the underlying block cipher this buffering object wraps. + */ + public CtsBlockCipher( + IBlockCipher cipher) + { + // TODO Should this test for acceptable ones instead? + if (cipher is OfbBlockCipher || cipher is CfbBlockCipher) + throw new ArgumentException("CtsBlockCipher can only accept ECB, or CBC ciphers"); + + this.cipher = cipher; + + blockSize = cipher.GetBlockSize(); + + buf = new byte[blockSize * 2]; + bufOff = 0; + } + + /** + * return the size of the output buffer required for an update of 'length' bytes. + * + * @param length the outLength of the input. + * @return the space required to accommodate a call to update + * with length bytes of input. + */ + public override int GetUpdateOutputSize( + int length) + { + int total = length + bufOff; + int leftOver = total % buf.Length; + + if (leftOver == 0) + { + return total - buf.Length; + } + + return total - leftOver; + } + + /** + * return the size of the output buffer required for an update plus a + * doFinal with an input of length bytes. + * + * @param length the outLength of the input. + * @return the space required to accommodate a call to update and doFinal + * with length bytes of input. + */ + public override int GetOutputSize( + int length) + { + return length + bufOff; + } + + /** + * process a single byte, producing an output block if necessary. + * + * @param in the input byte. + * @param out the space for any output that might be produced. + * @param outOff the offset from which the output will be copied. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there isn't enough space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + */ + public override int ProcessByte( + byte input, + byte[] output, + int outOff) + { + int resultLen = 0; + + if (bufOff == buf.Length) + { + resultLen = cipher.ProcessBlock(buf, 0, output, outOff); + Debug.Assert(resultLen == blockSize); + + Array.Copy(buf, blockSize, buf, 0, blockSize); + bufOff = blockSize; + } + + buf[bufOff++] = input; + + return resultLen; + } + + /** + * process an array of bytes, producing output if necessary. + * + * @param in the input byte array. + * @param inOff the offset at which the input data starts. + * @param length the number of bytes to be copied out of the input array. + * @param out the space for any output that might be produced. + * @param outOff the offset from which the output will be copied. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there isn't enough space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + */ + public override int ProcessBytes( + byte[] input, + int inOff, + int length, + byte[] output, + int outOff) + { + if (length < 0) + { + throw new ArgumentException("Can't have a negative input outLength!"); + } + + int blockSize = GetBlockSize(); + int outLength = GetUpdateOutputSize(length); + + if (outLength > 0) + { + if ((outOff + outLength) > output.Length) + { + throw new DataLengthException("output buffer too short"); + } + } + + int resultLen = 0; + int gapLen = buf.Length - bufOff; + + if (length > gapLen) + { + Array.Copy(input, inOff, buf, bufOff, gapLen); + + resultLen += cipher.ProcessBlock(buf, 0, output, outOff); + Array.Copy(buf, blockSize, buf, 0, blockSize); + + bufOff = blockSize; + + length -= gapLen; + inOff += gapLen; + + while (length > blockSize) + { + Array.Copy(input, inOff, buf, bufOff, blockSize); + resultLen += cipher.ProcessBlock(buf, 0, output, outOff + resultLen); + Array.Copy(buf, blockSize, buf, 0, blockSize); + + length -= blockSize; + inOff += blockSize; + } + } + + Array.Copy(input, inOff, buf, bufOff, length); + + bufOff += length; + + return resultLen; + } + + /** + * Process the last block in the buffer. + * + * @param out the array the block currently being held is copied into. + * @param outOff the offset at which the copying starts. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there is insufficient space in out for + * the output. + * @exception InvalidOperationException if the underlying cipher is not + * initialised. + * @exception InvalidCipherTextException if cipher text decrypts wrongly (in + * case the exception will never Get thrown). + */ + public override int DoFinal( + byte[] output, + int outOff) + { + if (bufOff + outOff > output.Length) + { + throw new DataLengthException("output buffer too small in doFinal"); + } + + int blockSize = cipher.GetBlockSize(); + int length = bufOff - blockSize; + byte[] block = new byte[blockSize]; + + if (forEncryption) + { + cipher.ProcessBlock(buf, 0, block, 0); + + if (bufOff < blockSize) + { + throw new DataLengthException("need at least one block of input for CTS"); + } + + for (int i = bufOff; i != buf.Length; i++) + { + buf[i] = block[i - blockSize]; + } + + for (int i = blockSize; i != bufOff; i++) + { + buf[i] ^= block[i - blockSize]; + } + + IBlockCipher c = (cipher is CbcBlockCipher) + ? ((CbcBlockCipher)cipher).GetUnderlyingCipher() + : cipher; + + c.ProcessBlock(buf, blockSize, output, outOff); + + Array.Copy(block, 0, output, outOff + blockSize, length); + } + else + { + byte[] lastBlock = new byte[blockSize]; + + IBlockCipher c = (cipher is CbcBlockCipher) + ? ((CbcBlockCipher)cipher).GetUnderlyingCipher() + : cipher; + + c.ProcessBlock(buf, 0, block, 0); + + for (int i = blockSize; i != bufOff; i++) + { + lastBlock[i - blockSize] = (byte)(block[i - blockSize] ^ buf[i]); + } + + Array.Copy(buf, blockSize, block, 0, length); + + cipher.ProcessBlock(block, 0, output, outOff); + Array.Copy(lastBlock, 0, output, outOff + blockSize, length); + } + + int offset = bufOff; + + Reset(); + + return offset; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CtsBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CtsBlockCipher.cs.meta new file mode 100644 index 00000000..282052a2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/CtsBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d853fe439c7b3cd42be0ebc115faebc1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/EAXBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/EAXBlockCipher.cs new file mode 100644 index 00000000..966b4cb2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/EAXBlockCipher.cs @@ -0,0 +1,383 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * A Two-Pass Authenticated-Encryption Scheme Optimized for Simplicity and + * Efficiency - by M. Bellare, P. Rogaway, D. Wagner. + * + * http://www.cs.ucdavis.edu/~rogaway/papers/eax.pdf + * + * EAX is an AEAD scheme based on CTR and OMAC1/CMAC, that uses a single block + * cipher to encrypt and authenticate data. It's on-line (the length of a + * message isn't needed to begin processing it), has good performances, it's + * simple and provably secure (provided the underlying block cipher is secure). + * + * Of course, this implementations is NOT thread-safe. + */ + public class EaxBlockCipher + : IAeadBlockCipher + { + private enum Tag : byte { N, H, C }; + + private SicBlockCipher cipher; + + private bool forEncryption; + + private int blockSize; + + private IMac mac; + + private byte[] nonceMac; + private byte[] associatedTextMac; + private byte[] macBlock; + + private int macSize; + private byte[] bufBlock; + private int bufOff; + + private bool cipherInitialized; + private byte[] initialAssociatedText; + + /** + * Constructor that accepts an instance of a block cipher engine. + * + * @param cipher the engine to use + */ + public EaxBlockCipher( + IBlockCipher cipher) + { + blockSize = cipher.GetBlockSize(); + mac = new CMac(cipher); + macBlock = new byte[blockSize]; + associatedTextMac = new byte[mac.GetMacSize()]; + nonceMac = new byte[mac.GetMacSize()]; + this.cipher = new SicBlockCipher(cipher); + } + + public virtual string AlgorithmName + { + get { return cipher.GetUnderlyingCipher().AlgorithmName + "/EAX"; } + } + + public virtual IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + + public virtual int GetBlockSize() + { + return cipher.GetBlockSize(); + } + + public virtual void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.forEncryption = forEncryption; + + byte[] nonce; + ICipherParameters keyParam; + + if (parameters is AeadParameters) + { + AeadParameters param = (AeadParameters) parameters; + + nonce = param.GetNonce(); + initialAssociatedText = param.GetAssociatedText(); + macSize = param.MacSize / 8; + keyParam = param.Key; + } + else if (parameters is ParametersWithIV) + { + ParametersWithIV param = (ParametersWithIV) parameters; + + nonce = param.GetIV(); + initialAssociatedText = null; + macSize = mac.GetMacSize() / 2; + keyParam = param.Parameters; + } + else + { + throw new ArgumentException("invalid parameters passed to EAX"); + } + + bufBlock = new byte[forEncryption ? blockSize : (blockSize + macSize)]; + + byte[] tag = new byte[blockSize]; + + // Key reuse implemented in CBC mode of underlying CMac + mac.Init(keyParam); + + tag[blockSize - 1] = (byte)Tag.N; + mac.BlockUpdate(tag, 0, blockSize); + mac.BlockUpdate(nonce, 0, nonce.Length); + mac.DoFinal(nonceMac, 0); + + // Same BlockCipher underlies this and the mac, so reuse last key on cipher + cipher.Init(true, new ParametersWithIV(null, nonceMac)); + + Reset(); + } + + private void InitCipher() + { + if (cipherInitialized) + { + return; + } + + cipherInitialized = true; + + mac.DoFinal(associatedTextMac, 0); + + byte[] tag = new byte[blockSize]; + tag[blockSize - 1] = (byte)Tag.C; + mac.BlockUpdate(tag, 0, blockSize); + } + + private void CalculateMac() + { + byte[] outC = new byte[blockSize]; + mac.DoFinal(outC, 0); + + for (int i = 0; i < macBlock.Length; i++) + { + macBlock[i] = (byte)(nonceMac[i] ^ associatedTextMac[i] ^ outC[i]); + } + } + + public virtual void Reset() + { + Reset(true); + } + + private void Reset( + bool clearMac) + { + cipher.Reset(); // TODO Redundant since the mac will reset it? + mac.Reset(); + + bufOff = 0; + Array.Clear(bufBlock, 0, bufBlock.Length); + + if (clearMac) + { + Array.Clear(macBlock, 0, macBlock.Length); + } + + byte[] tag = new byte[blockSize]; + tag[blockSize - 1] = (byte)Tag.H; + mac.BlockUpdate(tag, 0, blockSize); + + cipherInitialized = false; + + if (initialAssociatedText != null) + { + ProcessAadBytes(initialAssociatedText, 0, initialAssociatedText.Length); + } + } + + public virtual void ProcessAadByte(byte input) + { + if (cipherInitialized) + { + throw new InvalidOperationException("AAD data cannot be added after encryption/decryption processing has begun."); + } + mac.Update(input); + } + + public virtual void ProcessAadBytes(byte[] inBytes, int inOff, int len) + { + if (cipherInitialized) + { + throw new InvalidOperationException("AAD data cannot be added after encryption/decryption processing has begun."); + } + mac.BlockUpdate(inBytes, inOff, len); + } + + public virtual int ProcessByte( + byte input, + byte[] outBytes, + int outOff) + { + InitCipher(); + + return Process(input, outBytes, outOff); + } + + public virtual int ProcessBytes( + byte[] inBytes, + int inOff, + int len, + byte[] outBytes, + int outOff) + { + InitCipher(); + + int resultLen = 0; + + for (int i = 0; i != len; i++) + { + resultLen += Process(inBytes[inOff + i], outBytes, outOff + resultLen); + } + + return resultLen; + } + + public virtual int DoFinal( + byte[] outBytes, + int outOff) + { + InitCipher(); + + int extra = bufOff; + byte[] tmp = new byte[bufBlock.Length]; + + bufOff = 0; + + if (forEncryption) + { + Check.OutputLength(outBytes, outOff, extra + macSize, "Output buffer too short"); + + cipher.ProcessBlock(bufBlock, 0, tmp, 0); + + Array.Copy(tmp, 0, outBytes, outOff, extra); + + mac.BlockUpdate(tmp, 0, extra); + + CalculateMac(); + + Array.Copy(macBlock, 0, outBytes, outOff + extra, macSize); + + Reset(false); + + return extra + macSize; + } + else + { + if (extra < macSize) + throw new InvalidCipherTextException("data too short"); + + Check.OutputLength(outBytes, outOff, extra - macSize, "Output buffer too short"); + + if (extra > macSize) + { + mac.BlockUpdate(bufBlock, 0, extra - macSize); + + cipher.ProcessBlock(bufBlock, 0, tmp, 0); + + Array.Copy(tmp, 0, outBytes, outOff, extra - macSize); + } + + CalculateMac(); + + if (!VerifyMac(bufBlock, extra - macSize)) + throw new InvalidCipherTextException("mac check in EAX failed"); + + Reset(false); + + return extra - macSize; + } + } + + public virtual byte[] GetMac() + { + byte[] mac = new byte[macSize]; + + Array.Copy(macBlock, 0, mac, 0, macSize); + + return mac; + } + + public virtual int GetUpdateOutputSize( + int len) + { + int totalData = len + bufOff; + if (!forEncryption) + { + if (totalData < macSize) + { + return 0; + } + totalData -= macSize; + } + return totalData - totalData % blockSize; + } + + public virtual int GetOutputSize( + int len) + { + int totalData = len + bufOff; + + if (forEncryption) + { + return totalData + macSize; + } + + return totalData < macSize ? 0 : totalData - macSize; + } + + private int Process( + byte b, + byte[] outBytes, + int outOff) + { + bufBlock[bufOff++] = b; + + if (bufOff == bufBlock.Length) + { + Check.OutputLength(outBytes, outOff, blockSize, "Output buffer is too short"); + + // TODO Could move the ProcessByte(s) calls to here +// InitCipher(); + + int size; + + if (forEncryption) + { + size = cipher.ProcessBlock(bufBlock, 0, outBytes, outOff); + + mac.BlockUpdate(outBytes, outOff, blockSize); + } + else + { + mac.BlockUpdate(bufBlock, 0, blockSize); + + size = cipher.ProcessBlock(bufBlock, 0, outBytes, outOff); + } + + bufOff = 0; + if (!forEncryption) + { + Array.Copy(bufBlock, blockSize, bufBlock, 0, macSize); + bufOff = macSize; + } + + return size; + } + + return 0; + } + + private bool VerifyMac(byte[] mac, int off) + { + int nonEqual = 0; + + for (int i = 0; i < macSize; i++) + { + nonEqual |= (macBlock[i] ^ mac[off + i]); + } + + return nonEqual == 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/EAXBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/EAXBlockCipher.cs.meta new file mode 100644 index 00000000..bcc886ad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/EAXBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 56a798d87f3f7d741b9de7bff3c6622e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GCMBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GCMBlockCipher.cs new file mode 100644 index 00000000..5df264dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GCMBlockCipher.cs @@ -0,0 +1,651 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /// + /// Implements the Galois/Counter mode (GCM) detailed in + /// NIST Special Publication 800-38D. + /// + public sealed class GcmBlockCipher + : IAeadBlockCipher + { + private const int BlockSize = 16; + byte[] ctrBlock = new byte[BlockSize]; + + private readonly IBlockCipher cipher; + private readonly IGcmMultiplier multiplier; + private IGcmExponentiator exp; + + // These fields are set by Init and not modified by processing + private bool forEncryption; + private bool initialised; + private int macSize; + private byte[] lastKey; + private byte[] nonce; + private byte[] initialAssociatedText; + private byte[] H; + private byte[] J0; + + // These fields are modified during processing + private byte[] bufBlock; + private byte[] macBlock; + private byte[] S, S_at, S_atPre; + private byte[] counter; + private uint blocksRemaining; + private int bufOff; + private ulong totalLength; + private byte[] atBlock; + private int atBlockPos; + private ulong atLength; + private ulong atLengthPre; + + public GcmBlockCipher( + IBlockCipher c) + : this(c, null) + { + } + + public GcmBlockCipher( + IBlockCipher c, + IGcmMultiplier m) + { + if (c.GetBlockSize() != BlockSize) + throw new ArgumentException("cipher required with a block size of " + BlockSize + "."); + + if (m == null) + { + // TODO Consider a static property specifying default multiplier + m = new Tables8kGcmMultiplier(); + } + + this.cipher = c; + this.multiplier = m; + } + + public /*virtual*/ string AlgorithmName + { + get { return cipher.AlgorithmName + "/GCM"; } + } + + public IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + + public /*virtual*/ int GetBlockSize() + { + return BlockSize; + } + + /// + /// MAC sizes from 32 bits to 128 bits (must be a multiple of 8) are supported. The default is 128 bits. + /// Sizes less than 96 are not recommended, but are supported for specialized applications. + /// + public /*virtual*/ void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.forEncryption = forEncryption; + this.macBlock = null; + this.initialised = true; + + KeyParameter keyParam; + byte[] newNonce = null; + + if (parameters is AeadParameters) + { + AeadParameters param = (AeadParameters)parameters; + + newNonce = param.GetNonce(); + initialAssociatedText = param.GetAssociatedText(); + + int macSizeBits = param.MacSize; + if (macSizeBits < 32 || macSizeBits > 128 || macSizeBits % 8 != 0) + { + throw new ArgumentException("Invalid value for MAC size: " + macSizeBits); + } + + macSize = macSizeBits / 8; + keyParam = param.Key; + } + else if (parameters is ParametersWithIV) + { + ParametersWithIV param = (ParametersWithIV)parameters; + + newNonce = param.GetIV(); + initialAssociatedText = null; + macSize = 16; + keyParam = (KeyParameter)param.Parameters; + } + else + { + throw new ArgumentException("invalid parameters passed to GCM"); + } + + int bufLength = forEncryption ? BlockSize : (BlockSize + macSize); + this.bufBlock = new byte[bufLength]; + + if (newNonce == null || newNonce.Length < 1) + { + throw new ArgumentException("IV must be at least 1 byte"); + } + + if (forEncryption) + { + if (nonce != null && Arrays.AreEqual(nonce, newNonce)) + { + if (keyParam == null) + { + throw new ArgumentException("cannot reuse nonce for GCM encryption"); + } + if (lastKey != null && Arrays.AreEqual(lastKey, keyParam.GetKey())) + { + throw new ArgumentException("cannot reuse nonce for GCM encryption"); + } + } + } + + nonce = newNonce; + if (keyParam != null) + { + lastKey = keyParam.GetKey(); + } + + // TODO Restrict macSize to 16 if nonce length not 12? + + // Cipher always used in forward mode + // if keyParam is null we're reusing the last key. + if (keyParam != null) + { + cipher.Init(true, keyParam); + + this.H = new byte[BlockSize]; + cipher.ProcessBlock(H, 0, H, 0); + + // if keyParam is null we're reusing the last key and the multiplier doesn't need re-init + multiplier.Init(H); + exp = null; + } + else if (this.H == null) + { + throw new ArgumentException("Key must be specified in initial init"); + } + + this.J0 = new byte[BlockSize]; + + if (nonce.Length == 12) + { + Array.Copy(nonce, 0, J0, 0, nonce.Length); + this.J0[BlockSize - 1] = 0x01; + } + else + { + gHASH(J0, nonce, nonce.Length); + byte[] X = new byte[BlockSize]; + Pack.UInt64_To_BE((ulong)nonce.Length * 8UL, X, 8); + gHASHBlock(J0, X); + } + + this.S = new byte[BlockSize]; + this.S_at = new byte[BlockSize]; + this.S_atPre = new byte[BlockSize]; + this.atBlock = new byte[BlockSize]; + this.atBlockPos = 0; + this.atLength = 0; + this.atLengthPre = 0; + this.counter = Arrays.Clone(J0); + this.blocksRemaining = uint.MaxValue - 1; // page 8, len(P) <= 2^39 - 256, 1 block used by tag + this.bufOff = 0; + this.totalLength = 0; + + if (initialAssociatedText != null) + { + ProcessAadBytes(initialAssociatedText, 0, initialAssociatedText.Length); + } + } + + public /*virtual*/ byte[] GetMac() + { + return macBlock == null + ? new byte[macSize] + : Arrays.Clone(macBlock); + } + + public /*virtual*/ int GetOutputSize( + int len) + { + int totalData = len + bufOff; + + if (forEncryption) + { + return totalData + macSize; + } + + return totalData < macSize ? 0 : totalData - macSize; + } + + public /*virtual*/ int GetUpdateOutputSize( + int len) + { + int totalData = len + bufOff; + if (!forEncryption) + { + if (totalData < macSize) + { + return 0; + } + totalData -= macSize; + } + return totalData - totalData % BlockSize; + } + + public /*virtual*/ void ProcessAadByte(byte input) + { + CheckStatus(); + + atBlock[atBlockPos] = input; + if (++atBlockPos == BlockSize) + { + // Hash each block as it fills + gHASHBlock(S_at, atBlock); + atBlockPos = 0; + atLength += BlockSize; + } + } + + public /*virtual*/ void ProcessAadBytes(byte[] inBytes, int inOff, int len) + { + CheckStatus(); + + for (int i = 0; i < len; ++i) + { + atBlock[atBlockPos] = inBytes[inOff + i]; + if (++atBlockPos == BlockSize) + { + // Hash each block as it fills + gHASHBlock(S_at, atBlock); + atBlockPos = 0; + atLength += BlockSize; + } + } + } + + private void InitCipher() + { + if (atLength > 0) + { + Array.Copy(S_at, 0, S_atPre, 0, BlockSize); + atLengthPre = atLength; + } + + // Finish hash for partial AAD block + if (atBlockPos > 0) + { + gHASHPartial(S_atPre, atBlock, 0, atBlockPos); + atLengthPre += (uint)atBlockPos; + } + + if (atLengthPre > 0) + { + Array.Copy(S_atPre, 0, S, 0, BlockSize); + } + } + + public /*virtual*/ int ProcessByte( + byte input, + byte[] output, + int outOff) + { + CheckStatus(); + + bufBlock[bufOff] = input; + if (++bufOff == bufBlock.Length) + { + ProcessBlock(bufBlock, 0, output, outOff); + if (forEncryption) + { + bufOff = 0; + } + else + { + Array.Copy(bufBlock, BlockSize, bufBlock, 0, macSize); + bufOff = macSize; + } + return BlockSize; + } + return 0; + } + + public /*virtual*/ int ProcessBytes( + byte[] input, + int inOff, + int len, + byte[] output, + int outOff) + { + CheckStatus(); + + Check.DataLength(input, inOff, len, "input buffer too short"); + + int resultLen = 0; + + if (forEncryption) + { + if (bufOff != 0) + { + while (len > 0) + { + --len; + bufBlock[bufOff] = input[inOff++]; + if (++bufOff == BlockSize) + { + ProcessBlock(bufBlock, 0, output, outOff); + bufOff = 0; + resultLen += BlockSize; + break; + } + } + } + + while (len >= BlockSize) + { + ProcessBlock(input, inOff, output, outOff + resultLen); + inOff += BlockSize; + len -= BlockSize; + resultLen += BlockSize; + } + + if (len > 0) + { + Array.Copy(input, inOff, bufBlock, 0, len); + bufOff = len; + } + } + else + { + for (int i = 0; i < len; ++i) + { + bufBlock[bufOff] = input[inOff + i]; + if (++bufOff == bufBlock.Length) + { + ProcessBlock(bufBlock, 0, output, outOff + resultLen); + Array.Copy(bufBlock, BlockSize, bufBlock, 0, macSize); + bufOff = macSize; + resultLen += BlockSize; + } + } + } + + return resultLen; + } + + public int DoFinal(byte[] output, int outOff) + { + CheckStatus(); + + if (totalLength == 0) + { + InitCipher(); + } + + int extra = bufOff; + + if (forEncryption) + { + Check.OutputLength(output, outOff, extra + macSize, "Output buffer too short"); + } + else + { + if (extra < macSize) + throw new InvalidCipherTextException("data too short"); + + extra -= macSize; + + Check.OutputLength(output, outOff, extra, "Output buffer too short"); + } + + if (extra > 0) + { + ProcessPartial(bufBlock, 0, extra, output, outOff); + } + + atLength += (uint)atBlockPos; + + if (atLength > atLengthPre) + { + /* + * Some AAD was sent after the cipher started. We determine the difference b/w the hash value + * we actually used when the cipher started (S_atPre) and the final hash value calculated (S_at). + * Then we carry this difference forward by multiplying by H^c, where c is the number of (full or + * partial) cipher-text blocks produced, and adjust the current hash. + */ + + // Finish hash for partial AAD block + if (atBlockPos > 0) + { + gHASHPartial(S_at, atBlock, 0, atBlockPos); + } + + // Find the difference between the AAD hashes + if (atLengthPre > 0) + { + GcmUtilities.Xor(S_at, S_atPre); + } + + // Number of cipher-text blocks produced + long c = (long)(((totalLength * 8) + 127) >> 7); + + // Calculate the adjustment factor + byte[] H_c = new byte[16]; + if (exp == null) + { + exp = new Tables1kGcmExponentiator(); + exp.Init(H); + } + exp.ExponentiateX(c, H_c); + + // Carry the difference forward + GcmUtilities.Multiply(S_at, H_c); + + // Adjust the current hash + GcmUtilities.Xor(S, S_at); + } + + // Final gHASH + byte[] X = new byte[BlockSize]; + Pack.UInt64_To_BE(atLength * 8UL, X, 0); + Pack.UInt64_To_BE(totalLength * 8UL, X, 8); + + gHASHBlock(S, X); + + // T = MSBt(GCTRk(J0,S)) + byte[] tag = new byte[BlockSize]; + cipher.ProcessBlock(J0, 0, tag, 0); + GcmUtilities.Xor(tag, S); + + int resultLen = extra; + + // We place into macBlock our calculated value for T + this.macBlock = new byte[macSize]; + Array.Copy(tag, 0, macBlock, 0, macSize); + + if (forEncryption) + { + // Append T to the message + Array.Copy(macBlock, 0, output, outOff + bufOff, macSize); + resultLen += macSize; + } + else + { + // Retrieve the T value from the message and compare to calculated one + byte[] msgMac = new byte[macSize]; + Array.Copy(bufBlock, extra, msgMac, 0, macSize); + if (!Arrays.ConstantTimeAreEqual(this.macBlock, msgMac)) + throw new InvalidCipherTextException("mac check in GCM failed"); + } + + Reset(false); + + return resultLen; + } + + public /*virtual*/ void Reset() + { + Reset(true); + } + + private void Reset( + bool clearMac) + { + cipher.Reset(); + + // note: we do not reset the nonce. + + S = new byte[BlockSize]; + S_at = new byte[BlockSize]; + S_atPre = new byte[BlockSize]; + atBlock = new byte[BlockSize]; + atBlockPos = 0; + atLength = 0; + atLengthPre = 0; + counter = Arrays.Clone(J0); + blocksRemaining = uint.MaxValue - 1; + bufOff = 0; + totalLength = 0; + + if (bufBlock != null) + { + Arrays.Fill(bufBlock, 0); + } + + if (clearMac) + { + macBlock = null; + } + + if (forEncryption) + { + initialised = false; + } + else + { + if (initialAssociatedText != null) + { + ProcessAadBytes(initialAssociatedText, 0, initialAssociatedText.Length); + } + } + } + + private void ProcessBlock(byte[] buf, int bufOff, byte[] output, int outOff) + { + Check.OutputLength(output, outOff, BlockSize, "Output buffer too short"); + + if (totalLength == 0) + { + InitCipher(); + } + + //byte[] ctrBlock = new byte[BlockSize]; + GetNextCtrBlock(ctrBlock); + + if (forEncryption) + { + GcmUtilities.Xor(ctrBlock, buf, bufOff); + gHASHBlock(S, ctrBlock); + Array.Copy(ctrBlock, 0, output, outOff, BlockSize); + } + else + { + gHASHBlock(S, buf, bufOff); + GcmUtilities.Xor(ctrBlock, 0, buf, bufOff, output, outOff); + } + + totalLength += BlockSize; + } + + private void ProcessPartial(byte[] buf, int off, int len, byte[] output, int outOff) + { + //byte[] ctrBlock = new byte[BlockSize]; + GetNextCtrBlock(ctrBlock); + + if (forEncryption) + { + GcmUtilities.Xor(buf, off, ctrBlock, 0, len); + gHASHPartial(S, buf, off, len); + } + else + { + gHASHPartial(S, buf, off, len); + GcmUtilities.Xor(buf, off, ctrBlock, 0, len); + } + + Array.Copy(buf, off, output, outOff, len); + totalLength += (uint)len; + } + + private void gHASH(byte[] Y, byte[] b, int len) + { + for (int pos = 0; pos < len; pos += BlockSize) + { + int num = System.Math.Min(len - pos, BlockSize); + gHASHPartial(Y, b, pos, num); + } + } + + private void gHASHBlock(byte[] Y, byte[] b) + { + GcmUtilities.Xor(Y, b); + multiplier.MultiplyH(Y); + } + + private void gHASHBlock(byte[] Y, byte[] b, int off) + { + GcmUtilities.Xor(Y, b, off); + multiplier.MultiplyH(Y); + } + + private void gHASHPartial(byte[] Y, byte[] b, int off, int len) + { + GcmUtilities.Xor(Y, b, off, len); + multiplier.MultiplyH(Y); + } + + private void GetNextCtrBlock(byte[] block) + { + if (blocksRemaining == 0) + throw new InvalidOperationException("Attempt to process too many blocks"); + + blocksRemaining--; + + uint c = 1; + c += counter[15]; counter[15] = (byte)c; c >>= 8; + c += counter[14]; counter[14] = (byte)c; c >>= 8; + c += counter[13]; counter[13] = (byte)c; c >>= 8; + c += counter[12]; counter[12] = (byte)c; + + cipher.ProcessBlock(counter, 0, block, 0); + } + + private void CheckStatus() + { + if (!initialised) + { + if (forEncryption) + { + throw new InvalidOperationException("GCM cipher cannot be reused for encryption"); + } + throw new InvalidOperationException("GCM cipher needs to be initialised"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GCMBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GCMBlockCipher.cs.meta new file mode 100644 index 00000000..bad82543 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GCMBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f9e700bc931d48247b4b368d48e44803 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GOFBBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GOFBBlockCipher.cs new file mode 100644 index 00000000..4ad7f355 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GOFBBlockCipher.cs @@ -0,0 +1,238 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * implements the GOST 28147 OFB counter mode (GCTR). + */ + public class GOfbBlockCipher + : IBlockCipher + { + private byte[] IV; + private byte[] ofbV; + private byte[] ofbOutV; + + private readonly int blockSize; + private readonly IBlockCipher cipher; + + bool firstStep = true; + int N3; + int N4; + const int C1 = 16843012; //00000001000000010000000100000100 + const int C2 = 16843009; //00000001000000010000000100000001 + + /** + * Basic constructor. + * + * @param cipher the block cipher to be used as the basis of the + * counter mode (must have a 64 bit block size). + */ + public GOfbBlockCipher( + IBlockCipher cipher) + { + this.cipher = cipher; + this.blockSize = cipher.GetBlockSize(); + + if (blockSize != 8) + { + throw new ArgumentException("GCTR only for 64 bit block ciphers"); + } + + this.IV = new byte[cipher.GetBlockSize()]; + this.ofbV = new byte[cipher.GetBlockSize()]; + this.ofbOutV = new byte[cipher.GetBlockSize()]; + } + + /** + * return the underlying block cipher that we are wrapping. + * + * @return the underlying block cipher that we are wrapping. + */ + public IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + + /** + * Initialise the cipher and, possibly, the initialisation vector (IV). + * If an IV isn't passed as part of the parameter, the IV will be all zeros. + * An IV which is too short is handled in FIPS compliant fashion. + * + * @param encrypting if true the cipher is initialised for + * encryption, if false for decryption. + * @param parameters the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is inappropriate. + */ + public void Init( + bool forEncryption, //ignored by this CTR mode + ICipherParameters parameters) + { + firstStep = true; + N3 = 0; + N4 = 0; + + if (parameters is ParametersWithIV) + { + ParametersWithIV ivParam = (ParametersWithIV)parameters; + byte[] iv = ivParam.GetIV(); + + if (iv.Length < IV.Length) + { + // prepend the supplied IV with zeros (per FIPS PUB 81) + Array.Copy(iv, 0, IV, IV.Length - iv.Length, iv.Length); + for (int i = 0; i < IV.Length - iv.Length; i++) + { + IV[i] = 0; + } + } + else + { + Array.Copy(iv, 0, IV, 0, IV.Length); + } + + parameters = ivParam.Parameters; + } + + Reset(); + + // if it's null, key is to be reused. + if (parameters != null) + { + cipher.Init(true, parameters); + } + } + + /** + * return the algorithm name and mode. + * + * @return the name of the underlying algorithm followed by "/GCTR" + * and the block size in bits + */ + public string AlgorithmName + { + get { return cipher.AlgorithmName + "/GCTR"; } + } + + public bool IsPartialBlockOkay + { + get { return true; } + } + + /** + * return the block size we are operating at (in bytes). + * + * @return the block size we are operating at (in bytes). + */ + public int GetBlockSize() + { + return blockSize; + } + + /** + * Process one block of input from the array in and write it to + * the out array. + * + * @param in the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param out the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + public int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if ((inOff + blockSize) > input.Length) + { + throw new DataLengthException("input buffer too short"); + } + + if ((outOff + blockSize) > output.Length) + { + throw new DataLengthException("output buffer too short"); + } + + if (firstStep) + { + firstStep = false; + cipher.ProcessBlock(ofbV, 0, ofbOutV, 0); + N3 = bytesToint(ofbOutV, 0); + N4 = bytesToint(ofbOutV, 4); + } + N3 += C2; + N4 += C1; + if (N4 < C1) // addition is mod (2**32 - 1) + { + if (N4 > 0) + { + N4++; + } + } + intTobytes(N3, ofbV, 0); + intTobytes(N4, ofbV, 4); + + cipher.ProcessBlock(ofbV, 0, ofbOutV, 0); + + // + // XOR the ofbV with the plaintext producing the cipher text (and + // the next input block). + // + for (int i = 0; i < blockSize; i++) + { + output[outOff + i] = (byte)(ofbOutV[i] ^ input[inOff + i]); + } + + // + // change over the input block. + // + Array.Copy(ofbV, blockSize, ofbV, 0, ofbV.Length - blockSize); + Array.Copy(ofbOutV, 0, ofbV, ofbV.Length - blockSize, blockSize); + + return blockSize; + } + + /** + * reset the feedback vector back to the IV and reset the underlying + * cipher. + */ + public void Reset() + { + Array.Copy(IV, 0, ofbV, 0, IV.Length); + + cipher.Reset(); + } + + //array of bytes to type int + private int bytesToint( + byte[] inBytes, + int inOff) + { + return (int)((inBytes[inOff + 3] << 24) & 0xff000000) + ((inBytes[inOff + 2] << 16) & 0xff0000) + + ((inBytes[inOff + 1] << 8) & 0xff00) + (inBytes[inOff] & 0xff); + } + + //int to array of bytes + private void intTobytes( + int num, + byte[] outBytes, + int outOff) + { + outBytes[outOff + 3] = (byte)(num >> 24); + outBytes[outOff + 2] = (byte)(num >> 16); + outBytes[outOff + 1] = (byte)(num >> 8); + outBytes[outOff] = (byte)num; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GOFBBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GOFBBlockCipher.cs.meta new file mode 100644 index 00000000..f11a4065 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/GOFBBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3a091d7cad075041a691018998b39de +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/IAeadBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/IAeadBlockCipher.cs new file mode 100644 index 00000000..25e34c21 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/IAeadBlockCipher.cs @@ -0,0 +1,109 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /// + /// A block cipher mode that includes authenticated encryption with a streaming mode + /// and optional associated data. + /// + public interface IAeadBlockCipher + { + /// The name of the algorithm this cipher implements. + string AlgorithmName { get; } + + /// The block cipher underlying this algorithm. + IBlockCipher GetUnderlyingCipher(); + + /// Initialise the cipher. + /// Parameter can either be an AeadParameters or a ParametersWithIV object. + /// Initialise for encryption if true, for decryption if false. + /// The key or other data required by the cipher. + void Init(bool forEncryption, ICipherParameters parameters); + + /// The block size for this cipher, in bytes. + int GetBlockSize(); + + /// Add a single byte to the associated data check. + /// If the implementation supports it, this will be an online operation and will not retain the associated data. + /// The byte to be processed. + void ProcessAadByte(byte input); + + /// Add a sequence of bytes to the associated data check. + /// If the implementation supports it, this will be an online operation and will not retain the associated data. + /// The input byte array. + /// The offset into the input array where the data to be processed starts. + /// The number of bytes to be processed. + void ProcessAadBytes(byte[] inBytes, int inOff, int len); + + /** + * Encrypt/decrypt a single byte. + * + * @param input the byte to be processed. + * @param outBytes the output buffer the processed byte goes into. + * @param outOff the offset into the output byte array the processed data starts at. + * @return the number of bytes written to out. + * @exception DataLengthException if the output buffer is too small. + */ + int ProcessByte(byte input, byte[] outBytes, int outOff); + + /** + * Process a block of bytes from in putting the result into out. + * + * @param inBytes the input byte array. + * @param inOff the offset into the in array where the data to be processed starts. + * @param len the number of bytes to be processed. + * @param outBytes the output buffer the processed bytes go into. + * @param outOff the offset into the output byte array the processed data starts at. + * @return the number of bytes written to out. + * @exception DataLengthException if the output buffer is too small. + */ + int ProcessBytes(byte[] inBytes, int inOff, int len, byte[] outBytes, int outOff); + + /** + * Finish the operation either appending or verifying the MAC at the end of the data. + * + * @param outBytes space for any resulting output data. + * @param outOff offset into out to start copying the data at. + * @return number of bytes written into out. + * @throws InvalidOperationException if the cipher is in an inappropriate state. + * @throws InvalidCipherTextException if the MAC fails to match. + */ + int DoFinal(byte[] outBytes, int outOff); + + /** + * Return the value of the MAC associated with the last stream processed. + * + * @return MAC for plaintext data. + */ + byte[] GetMac(); + + /** + * Return the size of the output buffer required for a ProcessBytes + * an input of len bytes. + * + * @param len the length of the input. + * @return the space required to accommodate a call to ProcessBytes + * with len bytes of input. + */ + int GetUpdateOutputSize(int len); + + /** + * Return the size of the output buffer required for a ProcessBytes plus a + * DoFinal with an input of len bytes. + * + * @param len the length of the input. + * @return the space required to accommodate a call to ProcessBytes and DoFinal + * with len bytes of input. + */ + int GetOutputSize(int len); + + /// + /// Reset the cipher to the same state as it was after the last init (if there was one). + /// + void Reset(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/IAeadBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/IAeadBlockCipher.cs.meta new file mode 100644 index 00000000..b33e62d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/IAeadBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 18514e25fcebaa840909a75294f2f1e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCcmBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCcmBlockCipher.cs new file mode 100644 index 00000000..ea5e5792 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCcmBlockCipher.cs @@ -0,0 +1,494 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + public class KCcmBlockCipher: IAeadBlockCipher + { + private static readonly int BYTES_IN_INT = 4; + private static readonly int BITS_IN_BYTE = 8; + + private static readonly int MAX_MAC_BIT_LENGTH = 512; + private static readonly int MIN_MAC_BIT_LENGTH = 64; + + private IBlockCipher engine; + + private int macSize; + private bool forEncryption; + + private byte[] initialAssociatedText; + private byte[] mac; + private byte[] macBlock; + + private byte[] nonce; + + private byte[] G1; + private byte[] buffer; + + private byte[] s; + private byte[] counter; + + private readonly MemoryStream associatedText = new MemoryStream(); + private readonly MemoryStream data = new MemoryStream(); + + /* + * + * + */ + private int Nb_ = 4; + + private void setNb(int Nb) + { + if (Nb == 4 || Nb == 6 || Nb == 8) + { + Nb_ = Nb; + } + else + { + throw new ArgumentException("Nb = 4 is recommended by DSTU7624 but can be changed to only 6 or 8 in this implementation"); + } + } + + /// + /// Base constructor. Nb value is set to 4. + /// + /// base cipher to use under CCM. + public KCcmBlockCipher(IBlockCipher engine): this(engine, 4) + { + } + + /// + /// Constructor allowing Nb configuration. + /// + /// Nb is a parameter specified in CCM mode of DSTU7624 standard. + /// This parameter specifies maximum possible length of input.It should + /// be calculated as follows: Nb = 1 / 8 * (-3 + log[2]Nmax) + 1, + /// where Nmax - length of input message in bits.For practical reasons + /// Nmax usually less than 4Gb, e.g. for Nmax = 2^32 - 1, Nb = 4. + /// + /// base cipher to use under CCM. + /// Nb value to use. + public KCcmBlockCipher(IBlockCipher engine, int Nb) + { + this.engine = engine; + this.macSize = engine.GetBlockSize(); + this.nonce = new byte[engine.GetBlockSize()]; + this.initialAssociatedText = new byte[engine.GetBlockSize()]; + this.mac = new byte[engine.GetBlockSize()]; + this.macBlock = new byte[engine.GetBlockSize()]; + this.G1 = new byte[engine.GetBlockSize()]; + this.buffer = new byte[engine.GetBlockSize()]; + this.s = new byte[engine.GetBlockSize()]; + this.counter = new byte[engine.GetBlockSize()]; + setNb(Nb); + } + + public virtual void Init(bool forEncryption, ICipherParameters parameters) + { + + ICipherParameters cipherParameters; + if (parameters is AeadParameters) + { + + AeadParameters param = (AeadParameters)parameters; + + if (param.MacSize > MAX_MAC_BIT_LENGTH || param.MacSize < MIN_MAC_BIT_LENGTH || param.MacSize % 8 != 0) + { + throw new ArgumentException("Invalid mac size specified"); + } + + nonce = param.GetNonce(); + macSize = param.MacSize / BITS_IN_BYTE; + initialAssociatedText = param.GetAssociatedText(); + cipherParameters = param.Key; + } + else if (parameters is ParametersWithIV) + { + nonce = ((ParametersWithIV)parameters).GetIV(); + macSize = engine.GetBlockSize(); // use default blockSize for MAC if it is not specified + initialAssociatedText = null; + cipherParameters = ((ParametersWithIV)parameters).Parameters; + } + else + { + throw new ArgumentException("Invalid parameters specified"); + } + + this.mac = new byte[macSize]; + this.forEncryption = forEncryption; + engine.Init(true, cipherParameters); + + counter[0] = 0x01; // defined in standard + + if (initialAssociatedText != null) + { + ProcessAadBytes(initialAssociatedText, 0, initialAssociatedText.Length); + } + } + + public virtual String AlgorithmName + { + get + { + return engine.AlgorithmName + "/KCCM"; + } + } + + public virtual int GetBlockSize() + { + return engine.GetBlockSize(); + } + + public virtual IBlockCipher GetUnderlyingCipher() + { + return engine; + } + + public virtual void ProcessAadByte(byte input) + { + associatedText.WriteByte(input); + } + + public virtual void ProcessAadBytes(byte[] input, int inOff, int len) + { + associatedText.Write(input, inOff, len); + } + + private void ProcessAAD(byte[] assocText, int assocOff, int assocLen, int dataLen) + { + if (assocLen - assocOff < engine.GetBlockSize()) + { + throw new ArgumentException("authText buffer too short"); + } + if (assocLen % engine.GetBlockSize() != 0) + { + throw new ArgumentException("padding not supported"); + } + + Array.Copy(nonce, 0, G1, 0, nonce.Length - Nb_ - 1); + + intToBytes(dataLen, buffer, 0); // for G1 + + Array.Copy(buffer, 0, G1, nonce.Length - Nb_ - 1, BYTES_IN_INT); + + G1[G1.Length - 1] = getFlag(true, macSize); + + engine.ProcessBlock(G1, 0, macBlock, 0); + + intToBytes(assocLen, buffer, 0); // for G2 + + if (assocLen <= engine.GetBlockSize() - Nb_) + { + for (int byteIndex = 0; byteIndex < assocLen; byteIndex++) + { + buffer[byteIndex + Nb_] ^= assocText[assocOff + byteIndex]; + } + + for (int byteIndex = 0; byteIndex < engine.GetBlockSize(); byteIndex++) + { + macBlock[byteIndex] ^= buffer[byteIndex]; + } + + engine.ProcessBlock(macBlock, 0, macBlock, 0); + + return; + } + + for (int byteIndex = 0; byteIndex < engine.GetBlockSize(); byteIndex++) + { + macBlock[byteIndex] ^= buffer[byteIndex]; + } + + engine.ProcessBlock(macBlock, 0, macBlock, 0); + + int authLen = assocLen; + while (authLen != 0) + { + for (int byteIndex = 0; byteIndex < engine.GetBlockSize(); byteIndex++) + { + macBlock[byteIndex] ^= assocText[byteIndex + assocOff]; + } + + engine.ProcessBlock(macBlock, 0, macBlock, 0); + + assocOff += engine.GetBlockSize(); + authLen -= engine.GetBlockSize(); + } + } + + public virtual int ProcessByte(byte input, byte[] output, int outOff) + { + data.WriteByte(input); + + return 0; + } + + public virtual int ProcessBytes(byte[] input, int inOff, int inLen, byte[] output, int outOff) + { + Check.DataLength(input, inOff, inLen, "input buffer too short"); + + data.Write(input, inOff, inLen); + + return 0; + } + + public int ProcessPacket(byte[] input, int inOff, int len, byte[] output, int outOff) + { + Check.DataLength(input, inOff, len, "input buffer too short"); + Check.OutputLength(output, outOff, len, "output buffer too short"); + + if (associatedText.Length > 0) + { +#if PORTABLE || NETFX_CORE + byte[] aad = associatedText.ToArray(); + int aadLen = aad.Length; +#else + byte[] aad = associatedText.GetBuffer(); + int aadLen = (int)associatedText.Length; +#endif + + int dataLen = forEncryption ? (int)data.Length : ((int)data.Length - macSize); + + ProcessAAD(aad, 0, aadLen, dataLen); + } + + if (forEncryption) + { + Check.DataLength(len % engine.GetBlockSize() != 0, "partial blocks not supported"); + + CalculateMac(input, inOff, len); + engine.ProcessBlock(nonce, 0, s, 0); + + int totalLength = len; + while (totalLength > 0) + { + ProcessBlock(input, inOff, len, output, outOff); + totalLength -= engine.GetBlockSize(); + inOff += engine.GetBlockSize(); + outOff += engine.GetBlockSize(); + } + + for (int byteIndex = 0; byteIndex inOff) + { + for (int byteIndex = 0; byteIndex 0) + { + for (int byteIndex = 0; byteIndex < engine.GetBlockSize(); byteIndex++) + { + macBlock[byteIndex] ^= authText[authOff + byteIndex]; + } + + engine.ProcessBlock(macBlock, 0, macBlock, 0); + + totalLen -= engine.GetBlockSize(); + authOff += engine.GetBlockSize(); + } + } + + public virtual int DoFinal(byte[] output, int outOff) + { +#if PORTABLE || NETFX_CORE + byte[] buf = data.ToArray(); + int bufLen = buf.Length; +#else + byte[] buf = data.GetBuffer(); + int bufLen = (int)data.Length; +#endif + + int len = ProcessPacket(buf, 0, bufLen, output, outOff); + + Reset(); + + return len; + } + + public virtual byte[] GetMac() + { + return Arrays.Clone(mac); + } + + public virtual int GetUpdateOutputSize(int len) + { + return len; + } + + public virtual int GetOutputSize(int len) + { + return len + macSize; + } + + public virtual void Reset() + { + Arrays.Fill(G1, (byte)0); + Arrays.Fill(buffer, (byte)0); + Arrays.Fill(counter, (byte)0); + Arrays.Fill(macBlock, (byte)0); + + counter[0] = 0x01; + data.SetLength(0); + associatedText.SetLength(0); + + if (initialAssociatedText != null) + { + ProcessAadBytes(initialAssociatedText, 0, initialAssociatedText.Length); + } + } + + private void intToBytes( + int num, + byte[] outBytes, + int outOff) + { + outBytes[outOff + 3] = (byte)(num >> 24); + outBytes[outOff + 2] = (byte)(num >> 16); + outBytes[outOff + 1] = (byte)(num >> 8); + outBytes[outOff] = (byte)num; + } + + private byte getFlag(bool authTextPresents, int macSize) + { + StringBuilder flagByte = new StringBuilder(); + + if (authTextPresents) + { + flagByte.Append("1"); + } + else + { + flagByte.Append("0"); + } + + + switch (macSize) + { + case 8: + flagByte.Append("010"); // binary 2 + break; + case 16: + flagByte.Append("011"); // binary 3 + break; + case 32: + flagByte.Append("100"); // binary 4 + break; + case 48: + flagByte.Append("101"); // binary 5 + break; + case 64: + flagByte.Append("110"); // binary 6 + break; + } + + String binaryNb = Convert.ToString(Nb_ - 1, 2); + while (binaryNb.Length < 4) + { + binaryNb = new StringBuilder(binaryNb).Insert(0, "0").ToString(); + } + + flagByte.Append(binaryNb); + + return (byte)Convert.ToInt32(flagByte.ToString(), 2); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCcmBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCcmBlockCipher.cs.meta new file mode 100644 index 00000000..1d59104f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCcmBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: afe761e6598d68e4397a8694051cd2f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCtrBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCtrBlockCipher.cs new file mode 100644 index 00000000..e5935086 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/KCtrBlockCipher.cs @@ -0,0 +1,239 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * Implements a Gamming or Counter (CTR) mode on top of a DSTU 7624 block cipher. + */ + public class KCtrBlockCipher : IStreamCipher, IBlockCipher + { + private byte[] IV; + private byte[] ofbV; + private byte[] ofbOutV; + private bool initialised; + + private int byteCount; + + private readonly int blockSize; + private readonly IBlockCipher cipher; + + /** + * Basic constructor. + * + * @param cipher the block cipher to be used as the basis of the + * feedback mode. + */ + public KCtrBlockCipher(IBlockCipher cipher) + { + this.cipher = cipher; + this.IV = new byte[cipher.GetBlockSize()]; + this.blockSize = cipher.GetBlockSize(); + + this.ofbV = new byte[cipher.GetBlockSize()]; + this.ofbOutV = new byte[cipher.GetBlockSize()]; + } + + /** + * return the underlying block cipher that we are wrapping. + * + * @return the underlying block cipher that we are wrapping. + */ + public IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + /** + * Initialise the cipher and, possibly, the initialisation vector (IV). + * If an IV isn't passed as part of the parameter, the IV will be all zeros. + * An IV which is too short is handled in FIPS compliant fashion. + * + * @param forEncryption if true the cipher is initialised for + * encryption, if false for decryption. + * @param param the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.initialised = true; + if (parameters is ParametersWithIV) + { + ParametersWithIV ivParam = (ParametersWithIV)parameters; + byte[] iv = ivParam.GetIV(); + int diff = IV.Length - iv.Length; + + Array.Clear(IV, 0, IV.Length); + Array.Copy(iv, 0, IV, diff, iv.Length); + + parameters = ivParam.Parameters; + } + else + { + throw new ArgumentException("Invalid parameter passed"); + } + + // if it's null, key is to be reused. + if (parameters != null) + { + cipher.Init(true, parameters); + } + + Reset(); + } + + /** + * return the algorithm name and mode. + * + * @return the name of the underlying algorithm followed by "/KCTR" + * and the block size in bits. + */ + public string AlgorithmName + { + get { return cipher.AlgorithmName + "/KCTR"; } + } + + public bool IsPartialBlockOkay + { + get { return true; } + } + + /** + * return the block size we are operating at. + * + * @return the block size we are operating at (in bytes). + */ + public int GetBlockSize() + { + return cipher.GetBlockSize(); + } + + public byte ReturnByte(byte input) + { + return CalculateByte(input); + } + + public void ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff) + { + if (outOff + len > output.Length) + { + throw new DataLengthException("Output buffer too short"); + } + + if (inOff + len > input.Length) + { + throw new DataLengthException("Input buffer too small"); + } + + int inStart = inOff; + int inEnd = inOff + len; + int outStart = outOff; + + while (inStartRFC 7253 on The OCB + * Authenticated-Encryption Algorithm, licensed per: + * + *

License for + * Open-Source Software Implementations of OCB (Jan 9, 2013) - 'License 1'
+ * Under this license, you are authorized to make, use, and distribute open-source software + * implementations of OCB. This license terminates for you if you sue someone over their open-source + * software implementation of OCB claiming that you have a patent covering their implementation. + *

+ * This is a non-binding summary of a legal document (the link above). The parameters of the license + * are specified in the license document and that document is controlling.

+ */ + public class OcbBlockCipher + : IAeadBlockCipher + { + private const int BLOCK_SIZE = 16; + + private readonly IBlockCipher hashCipher; + private readonly IBlockCipher mainCipher; + + /* + * CONFIGURATION + */ + private bool forEncryption; + private int macSize; + private byte[] initialAssociatedText; + + /* + * KEY-DEPENDENT + */ + // NOTE: elements are lazily calculated + private IList L; + private byte[] L_Asterisk, L_Dollar; + + /* + * NONCE-DEPENDENT + */ + private byte[] KtopInput = null; + private byte[] Stretch = new byte[24]; + private byte[] OffsetMAIN_0 = new byte[16]; + + /* + * PER-ENCRYPTION/DECRYPTION + */ + private byte[] hashBlock, mainBlock; + private int hashBlockPos, mainBlockPos; + private long hashBlockCount, mainBlockCount; + private byte[] OffsetHASH; + private byte[] Sum; + private byte[] OffsetMAIN = new byte[16]; + private byte[] Checksum; + + // NOTE: The MAC value is preserved after doFinal + private byte[] macBlock; + + public OcbBlockCipher(IBlockCipher hashCipher, IBlockCipher mainCipher) + { + if (hashCipher == null) + throw new ArgumentNullException("hashCipher"); + if (hashCipher.GetBlockSize() != BLOCK_SIZE) + throw new ArgumentException("must have a block size of " + BLOCK_SIZE, "hashCipher"); + if (mainCipher == null) + throw new ArgumentNullException("mainCipher"); + if (mainCipher.GetBlockSize() != BLOCK_SIZE) + throw new ArgumentException("must have a block size of " + BLOCK_SIZE, "mainCipher"); + + if (!hashCipher.AlgorithmName.Equals(mainCipher.AlgorithmName)) + throw new ArgumentException("'hashCipher' and 'mainCipher' must be the same algorithm"); + + this.hashCipher = hashCipher; + this.mainCipher = mainCipher; + } + + public virtual IBlockCipher GetUnderlyingCipher() + { + return mainCipher; + } + + public virtual string AlgorithmName + { + get { return mainCipher.AlgorithmName + "/OCB"; } + } + + public virtual void Init(bool forEncryption, ICipherParameters parameters) + { + bool oldForEncryption = this.forEncryption; + this.forEncryption = forEncryption; + this.macBlock = null; + + KeyParameter keyParameter; + + byte[] N; + if (parameters is AeadParameters) + { + AeadParameters aeadParameters = (AeadParameters) parameters; + + N = aeadParameters.GetNonce(); + initialAssociatedText = aeadParameters.GetAssociatedText(); + + int macSizeBits = aeadParameters.MacSize; + if (macSizeBits < 64 || macSizeBits > 128 || macSizeBits % 8 != 0) + throw new ArgumentException("Invalid value for MAC size: " + macSizeBits); + + macSize = macSizeBits / 8; + keyParameter = aeadParameters.Key; + } + else if (parameters is ParametersWithIV) + { + ParametersWithIV parametersWithIV = (ParametersWithIV) parameters; + + N = parametersWithIV.GetIV(); + initialAssociatedText = null; + macSize = 16; + keyParameter = (KeyParameter) parametersWithIV.Parameters; + } + else + { + throw new ArgumentException("invalid parameters passed to OCB"); + } + + this.hashBlock = new byte[16]; + this.mainBlock = new byte[forEncryption ? BLOCK_SIZE : (BLOCK_SIZE + macSize)]; + + if (N == null) + { + N = new byte[0]; + } + + if (N.Length > 15) + { + throw new ArgumentException("IV must be no more than 15 bytes"); + } + + /* + * KEY-DEPENDENT INITIALISATION + */ + + if (keyParameter != null) + { + // hashCipher always used in forward mode + hashCipher.Init(true, keyParameter); + mainCipher.Init(forEncryption, keyParameter); + KtopInput = null; + } + else if (oldForEncryption != forEncryption) + { + throw new ArgumentException("cannot change encrypting state without providing key."); + } + + this.L_Asterisk = new byte[16]; + hashCipher.ProcessBlock(L_Asterisk, 0, L_Asterisk, 0); + + this.L_Dollar = OCB_double(L_Asterisk); + + this.L = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + this.L.Add(OCB_double(L_Dollar)); + + /* + * NONCE-DEPENDENT AND PER-ENCRYPTION/DECRYPTION INITIALISATION + */ + + int bottom = ProcessNonce(N); + + int bits = bottom % 8, bytes = bottom / 8; + if (bits == 0) + { + Array.Copy(Stretch, bytes, OffsetMAIN_0, 0, 16); + } + else + { + for (int i = 0; i < 16; ++i) + { + uint b1 = Stretch[bytes]; + uint b2 = Stretch[++bytes]; + this.OffsetMAIN_0[i] = (byte) ((b1 << bits) | (b2 >> (8 - bits))); + } + } + + this.hashBlockPos = 0; + this.mainBlockPos = 0; + + this.hashBlockCount = 0; + this.mainBlockCount = 0; + + this.OffsetHASH = new byte[16]; + this.Sum = new byte[16]; + Array.Copy(OffsetMAIN_0, 0, OffsetMAIN, 0, 16); + this.Checksum = new byte[16]; + + if (initialAssociatedText != null) + { + ProcessAadBytes(initialAssociatedText, 0, initialAssociatedText.Length); + } + } + + protected virtual int ProcessNonce(byte[] N) + { + byte[] nonce = new byte[16]; + Array.Copy(N, 0, nonce, nonce.Length - N.Length, N.Length); + nonce[0] = (byte)(macSize << 4); + nonce[15 - N.Length] |= 1; + + int bottom = nonce[15] & 0x3F; + nonce[15] &= 0xC0; + + /* + * When used with incrementing nonces, the cipher is only applied once every 64 inits. + */ + if (KtopInput == null || !Arrays.AreEqual(nonce, KtopInput)) + { + byte[] Ktop = new byte[16]; + KtopInput = nonce; + hashCipher.ProcessBlock(KtopInput, 0, Ktop, 0); + Array.Copy(Ktop, 0, Stretch, 0, 16); + for (int i = 0; i < 8; ++i) + { + Stretch[16 + i] = (byte)(Ktop[i] ^ Ktop[i + 1]); + } + } + + return bottom; + } + + public virtual int GetBlockSize() + { + return BLOCK_SIZE; + } + + public virtual byte[] GetMac() + { + return macBlock == null + ? new byte[macSize] + : Arrays.Clone(macBlock); + } + + public virtual int GetOutputSize(int len) + { + int totalData = len + mainBlockPos; + if (forEncryption) + { + return totalData + macSize; + } + return totalData < macSize ? 0 : totalData - macSize; + } + + public virtual int GetUpdateOutputSize(int len) + { + int totalData = len + mainBlockPos; + if (!forEncryption) + { + if (totalData < macSize) + { + return 0; + } + totalData -= macSize; + } + return totalData - totalData % BLOCK_SIZE; + } + + public virtual void ProcessAadByte(byte input) + { + hashBlock[hashBlockPos] = input; + if (++hashBlockPos == hashBlock.Length) + { + ProcessHashBlock(); + } + } + + public virtual void ProcessAadBytes(byte[] input, int off, int len) + { + for (int i = 0; i < len; ++i) + { + hashBlock[hashBlockPos] = input[off + i]; + if (++hashBlockPos == hashBlock.Length) + { + ProcessHashBlock(); + } + } + } + + public virtual int ProcessByte(byte input, byte[] output, int outOff) + { + mainBlock[mainBlockPos] = input; + if (++mainBlockPos == mainBlock.Length) + { + ProcessMainBlock(output, outOff); + return BLOCK_SIZE; + } + return 0; + } + + public virtual int ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff) + { + int resultLen = 0; + + for (int i = 0; i < len; ++i) + { + mainBlock[mainBlockPos] = input[inOff + i]; + if (++mainBlockPos == mainBlock.Length) + { + ProcessMainBlock(output, outOff + resultLen); + resultLen += BLOCK_SIZE; + } + } + + return resultLen; + } + + public virtual int DoFinal(byte[] output, int outOff) + { + /* + * For decryption, get the tag from the end of the message + */ + byte[] tag = null; + if (!forEncryption) { + if (mainBlockPos < macSize) + throw new InvalidCipherTextException("data too short"); + + mainBlockPos -= macSize; + tag = new byte[macSize]; + Array.Copy(mainBlock, mainBlockPos, tag, 0, macSize); + } + + /* + * HASH: Process any final partial block; compute final hash value + */ + if (hashBlockPos > 0) + { + OCB_extend(hashBlock, hashBlockPos); + UpdateHASH(L_Asterisk); + } + + /* + * OCB-ENCRYPT/OCB-DECRYPT: Process any final partial block + */ + if (mainBlockPos > 0) + { + if (forEncryption) + { + OCB_extend(mainBlock, mainBlockPos); + Xor(Checksum, mainBlock); + } + + Xor(OffsetMAIN, L_Asterisk); + + byte[] Pad = new byte[16]; + hashCipher.ProcessBlock(OffsetMAIN, 0, Pad, 0); + + Xor(mainBlock, Pad); + + Check.OutputLength(output, outOff, mainBlockPos, "Output buffer too short"); + Array.Copy(mainBlock, 0, output, outOff, mainBlockPos); + + if (!forEncryption) + { + OCB_extend(mainBlock, mainBlockPos); + Xor(Checksum, mainBlock); + } + } + + /* + * OCB-ENCRYPT/OCB-DECRYPT: Compute raw tag + */ + Xor(Checksum, OffsetMAIN); + Xor(Checksum, L_Dollar); + hashCipher.ProcessBlock(Checksum, 0, Checksum, 0); + Xor(Checksum, Sum); + + this.macBlock = new byte[macSize]; + Array.Copy(Checksum, 0, macBlock, 0, macSize); + + /* + * Validate or append tag and reset this cipher for the next run + */ + int resultLen = mainBlockPos; + + if (forEncryption) + { + Check.OutputLength(output, outOff, resultLen + macSize, "Output buffer too short"); + + // Append tag to the message + Array.Copy(macBlock, 0, output, outOff + resultLen, macSize); + resultLen += macSize; + } + else + { + // Compare the tag from the message with the calculated one + if (!Arrays.ConstantTimeAreEqual(macBlock, tag)) + throw new InvalidCipherTextException("mac check in OCB failed"); + } + + Reset(false); + + return resultLen; + } + + public virtual void Reset() + { + Reset(true); + } + + protected virtual void Clear(byte[] bs) + { + if (bs != null) + { + Array.Clear(bs, 0, bs.Length); + } + } + + protected virtual byte[] GetLSub(int n) + { + while (n >= L.Count) + { + L.Add(OCB_double((byte[]) L[L.Count - 1])); + } + return (byte[])L[n]; + } + + protected virtual void ProcessHashBlock() + { + /* + * HASH: Process any whole blocks + */ + UpdateHASH(GetLSub(OCB_ntz(++hashBlockCount))); + hashBlockPos = 0; + } + + protected virtual void ProcessMainBlock(byte[] output, int outOff) + { + Check.DataLength(output, outOff, BLOCK_SIZE, "Output buffer too short"); + + /* + * OCB-ENCRYPT/OCB-DECRYPT: Process any whole blocks + */ + + if (forEncryption) + { + Xor(Checksum, mainBlock); + mainBlockPos = 0; + } + + Xor(OffsetMAIN, GetLSub(OCB_ntz(++mainBlockCount))); + + Xor(mainBlock, OffsetMAIN); + mainCipher.ProcessBlock(mainBlock, 0, mainBlock, 0); + Xor(mainBlock, OffsetMAIN); + + Array.Copy(mainBlock, 0, output, outOff, 16); + + if (!forEncryption) + { + Xor(Checksum, mainBlock); + Array.Copy(mainBlock, BLOCK_SIZE, mainBlock, 0, macSize); + mainBlockPos = macSize; + } + } + + protected virtual void Reset(bool clearMac) + { + hashCipher.Reset(); + mainCipher.Reset(); + + Clear(hashBlock); + Clear(mainBlock); + + hashBlockPos = 0; + mainBlockPos = 0; + + hashBlockCount = 0; + mainBlockCount = 0; + + Clear(OffsetHASH); + Clear(Sum); + Array.Copy(OffsetMAIN_0, 0, OffsetMAIN, 0, 16); + Clear(Checksum); + + if (clearMac) + { + macBlock = null; + } + + if (initialAssociatedText != null) + { + ProcessAadBytes(initialAssociatedText, 0, initialAssociatedText.Length); + } + } + + protected virtual void UpdateHASH(byte[] LSub) + { + Xor(OffsetHASH, LSub); + Xor(hashBlock, OffsetHASH); + hashCipher.ProcessBlock(hashBlock, 0, hashBlock, 0); + Xor(Sum, hashBlock); + } + + protected static byte[] OCB_double(byte[] block) + { + byte[] result = new byte[16]; + int carry = ShiftLeft(block, result); + + /* + * NOTE: This construction is an attempt at a constant-time implementation. + */ + result[15] ^= (byte)(0x87 >> ((1 - carry) << 3)); + + return result; + } + + protected static void OCB_extend(byte[] block, int pos) + { + block[pos] = (byte) 0x80; + while (++pos < 16) + { + block[pos] = 0; + } + } + + protected static int OCB_ntz(long x) + { + if (x == 0) + { + return 64; + } + + int n = 0; + ulong ux = (ulong)x; + while ((ux & 1UL) == 0UL) + { + ++n; + ux >>= 1; + } + return n; + } + + protected static int ShiftLeft(byte[] block, byte[] output) + { + int i = 16; + uint bit = 0; + while (--i >= 0) + { + uint b = block[i]; + output[i] = (byte) ((b << 1) | bit); + bit = (b >> 7) & 1; + } + return (int)bit; + } + + protected static void Xor(byte[] block, byte[] val) + { + for (int i = 15; i >= 0; --i) + { + block[i] ^= val[i]; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OCBBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OCBBlockCipher.cs.meta new file mode 100644 index 00000000..a6a9e514 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OCBBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89052943097a6b3488c0e056459769e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OfbBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OfbBlockCipher.cs new file mode 100644 index 00000000..5b31da6f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OfbBlockCipher.cs @@ -0,0 +1,186 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * implements a Output-FeedBack (OFB) mode on top of a simple cipher. + */ + public class OfbBlockCipher + : IBlockCipher + { + private byte[] IV; + private byte[] ofbV; + private byte[] ofbOutV; + + private readonly int blockSize; + private readonly IBlockCipher cipher; + + /** + * Basic constructor. + * + * @param cipher the block cipher to be used as the basis of the + * feedback mode. + * @param blockSize the block size in bits (note: a multiple of 8) + */ + public OfbBlockCipher( + IBlockCipher cipher, + int blockSize) + { + this.cipher = cipher; + this.blockSize = blockSize / 8; + + this.IV = new byte[cipher.GetBlockSize()]; + this.ofbV = new byte[cipher.GetBlockSize()]; + this.ofbOutV = new byte[cipher.GetBlockSize()]; + } + + /** + * return the underlying block cipher that we are wrapping. + * + * @return the underlying block cipher that we are wrapping. + */ + public IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + + /** + * Initialise the cipher and, possibly, the initialisation vector (IV). + * If an IV isn't passed as part of the parameter, the IV will be all zeros. + * An IV which is too short is handled in FIPS compliant fashion. + * + * @param forEncryption if true the cipher is initialised for + * encryption, if false for decryption. + * @param param the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public void Init( + bool forEncryption, //ignored by this OFB mode + ICipherParameters parameters) + { + if (parameters is ParametersWithIV) + { + ParametersWithIV ivParam = (ParametersWithIV)parameters; + byte[] iv = ivParam.GetIV(); + + if (iv.Length < IV.Length) + { + // prepend the supplied IV with zeros (per FIPS PUB 81) + Array.Copy(iv, 0, IV, IV.Length - iv.Length, iv.Length); + for (int i = 0; i < IV.Length - iv.Length; i++) + { + IV[i] = 0; + } + } + else + { + Array.Copy(iv, 0, IV, 0, IV.Length); + } + + parameters = ivParam.Parameters; + } + + Reset(); + + // if it's null, key is to be reused. + if (parameters != null) + { + cipher.Init(true, parameters); + } + } + + /** + * return the algorithm name and mode. + * + * @return the name of the underlying algorithm followed by "/OFB" + * and the block size in bits + */ + public string AlgorithmName + { + get { return cipher.AlgorithmName + "/OFB" + (blockSize * 8); } + } + + public bool IsPartialBlockOkay + { + get { return true; } + } + + /** + * return the block size we are operating at (in bytes). + * + * @return the block size we are operating at (in bytes). + */ + public int GetBlockSize() + { + return blockSize; + } + + /** + * Process one block of input from the array in and write it to + * the out array. + * + * @param in the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param out the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + public int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + if ((inOff + blockSize) > input.Length) + { + throw new DataLengthException("input buffer too short"); + } + + if ((outOff + blockSize) > output.Length) + { + throw new DataLengthException("output buffer too short"); + } + + cipher.ProcessBlock(ofbV, 0, ofbOutV, 0); + + // + // XOR the ofbV with the plaintext producing the cipher text (and + // the next input block). + // + for (int i = 0; i < blockSize; i++) + { + output[outOff + i] = (byte)(ofbOutV[i] ^ input[inOff + i]); + } + + // + // change over the input block. + // + Array.Copy(ofbV, blockSize, ofbV, 0, ofbV.Length - blockSize); + Array.Copy(ofbOutV, 0, ofbV, ofbV.Length - blockSize, blockSize); + + return blockSize; + } + + /** + * reset the feedback vector back to the IV and reset the underlying + * cipher. + */ + public void Reset() + { + Array.Copy(IV, 0, ofbV, 0, IV.Length); + + cipher.Reset(); + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OfbBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OfbBlockCipher.cs.meta new file mode 100644 index 00000000..06ef7cb8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OfbBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71bc36ce7925c074aa3654b21bda3a7f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OpenPgpCfbBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OpenPgpCfbBlockCipher.cs new file mode 100644 index 00000000..93213723 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OpenPgpCfbBlockCipher.cs @@ -0,0 +1,341 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * Implements OpenPGP's rather strange version of Cipher-FeedBack (CFB) mode + * on top of a simple cipher. This class assumes the IV has been prepended + * to the data stream already, and just accomodates the reset after + * (blockSize + 2) bytes have been read. + *

+ * For further info see RFC 2440. + *

+ */ + public class OpenPgpCfbBlockCipher + : IBlockCipher + { + private byte[] IV; + private byte[] FR; + private byte[] FRE; + + private readonly IBlockCipher cipher; + private readonly int blockSize; + + private int count; + private bool forEncryption; + + /** + * Basic constructor. + * + * @param cipher the block cipher to be used as the basis of the + * feedback mode. + */ + public OpenPgpCfbBlockCipher( + IBlockCipher cipher) + { + this.cipher = cipher; + + this.blockSize = cipher.GetBlockSize(); + this.IV = new byte[blockSize]; + this.FR = new byte[blockSize]; + this.FRE = new byte[blockSize]; + } + + /** + * return the underlying block cipher that we are wrapping. + * + * @return the underlying block cipher that we are wrapping. + */ + public IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + + /** + * return the algorithm name and mode. + * + * @return the name of the underlying algorithm followed by "/PGPCFB" + * and the block size in bits. + */ + public string AlgorithmName + { + get { return cipher.AlgorithmName + "/OpenPGPCFB"; } + } + + public bool IsPartialBlockOkay + { + get { return true; } + } + + /** + * return the block size we are operating at. + * + * @return the block size we are operating at (in bytes). + */ + public int GetBlockSize() + { + return cipher.GetBlockSize(); + } + + /** + * Process one block of input from the array in and write it to + * the out array. + * + * @param in the array containing the input data. + * @param inOff offset into the in array the data starts at. + * @param out the array the output data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + public int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + return (forEncryption) ? EncryptBlock(input, inOff, output, outOff) : DecryptBlock(input, inOff, output, outOff); + } + + /** + * reset the chaining vector back to the IV and reset the underlying + * cipher. + */ + public void Reset() + { + count = 0; + + Array.Copy(IV, 0, FR, 0, FR.Length); + + cipher.Reset(); + } + + /** + * Initialise the cipher and, possibly, the initialisation vector (IV). + * If an IV isn't passed as part of the parameter, the IV will be all zeros. + * An IV which is too short is handled in FIPS compliant fashion. + * + * @param forEncryption if true the cipher is initialised for + * encryption, if false for decryption. + * @param parameters the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.forEncryption = forEncryption; + + if (parameters is ParametersWithIV) + { + ParametersWithIV ivParam = (ParametersWithIV)parameters; + byte[] iv = ivParam.GetIV(); + + if (iv.Length < IV.Length) + { + // prepend the supplied IV with zeros (per FIPS PUB 81) + Array.Copy(iv, 0, IV, IV.Length - iv.Length, iv.Length); + for (int i = 0; i < IV.Length - iv.Length; i++) + { + IV[i] = 0; + } + } + else + { + Array.Copy(iv, 0, IV, 0, IV.Length); + } + + parameters = ivParam.Parameters; + } + + Reset(); + + cipher.Init(true, parameters); + } + + /** + * Encrypt one byte of data according to CFB mode. + * @param data the byte to encrypt + * @param blockOff offset in the current block + * @returns the encrypted byte + */ + private byte EncryptByte(byte data, int blockOff) + { + return (byte)(FRE[blockOff] ^ data); + } + + /** + * Do the appropriate processing for CFB IV mode encryption. + * + * @param in the array containing the data to be encrypted. + * @param inOff offset into the in array the data starts at. + * @param out the array the encrypted data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + private int EncryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + if ((inOff + blockSize) > input.Length) + { + throw new DataLengthException("input buffer too short"); + } + + if ((outOff + blockSize) > outBytes.Length) + { + throw new DataLengthException("output buffer too short"); + } + + if (count > blockSize) + { + FR[blockSize - 2] = outBytes[outOff] = EncryptByte(input[inOff], blockSize - 2); + FR[blockSize - 1] = outBytes[outOff + 1] = EncryptByte(input[inOff + 1], blockSize - 1); + + cipher.ProcessBlock(FR, 0, FRE, 0); + + for (int n = 2; n < blockSize; n++) + { + FR[n - 2] = outBytes[outOff + n] = EncryptByte(input[inOff + n], n - 2); + } + } + else if (count == 0) + { + cipher.ProcessBlock(FR, 0, FRE, 0); + + for (int n = 0; n < blockSize; n++) + { + FR[n] = outBytes[outOff + n] = EncryptByte(input[inOff + n], n); + } + + count += blockSize; + } + else if (count == blockSize) + { + cipher.ProcessBlock(FR, 0, FRE, 0); + + outBytes[outOff] = EncryptByte(input[inOff], 0); + outBytes[outOff + 1] = EncryptByte(input[inOff + 1], 1); + + // + // do reset + // + Array.Copy(FR, 2, FR, 0, blockSize - 2); + Array.Copy(outBytes, outOff, FR, blockSize - 2, 2); + + cipher.ProcessBlock(FR, 0, FRE, 0); + + for (int n = 2; n < blockSize; n++) + { + FR[n - 2] = outBytes[outOff + n] = EncryptByte(input[inOff + n], n - 2); + } + + count += blockSize; + } + + return blockSize; + } + + /** + * Do the appropriate processing for CFB IV mode decryption. + * + * @param in the array containing the data to be decrypted. + * @param inOff offset into the in array the data starts at. + * @param out the array the encrypted data will be copied into. + * @param outOff the offset into the out array the output will start at. + * @exception DataLengthException if there isn't enough data in in, or + * space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + * @return the number of bytes processed and produced. + */ + private int DecryptBlock( + byte[] input, + int inOff, + byte[] outBytes, + int outOff) + { + if ((inOff + blockSize) > input.Length) + { + throw new DataLengthException("input buffer too short"); + } + + if ((outOff + blockSize) > outBytes.Length) + { + throw new DataLengthException("output buffer too short"); + } + + if (count > blockSize) + { + byte inVal = input[inOff]; + FR[blockSize - 2] = inVal; + outBytes[outOff] = EncryptByte(inVal, blockSize - 2); + + inVal = input[inOff + 1]; + FR[blockSize - 1] = inVal; + outBytes[outOff + 1] = EncryptByte(inVal, blockSize - 1); + + cipher.ProcessBlock(FR, 0, FRE, 0); + + for (int n = 2; n < blockSize; n++) + { + inVal = input[inOff + n]; + FR[n - 2] = inVal; + outBytes[outOff + n] = EncryptByte(inVal, n - 2); + } + } + else if (count == 0) + { + cipher.ProcessBlock(FR, 0, FRE, 0); + + for (int n = 0; n < blockSize; n++) + { + FR[n] = input[inOff + n]; + outBytes[n] = EncryptByte(input[inOff + n], n); + } + + count += blockSize; + } + else if (count == blockSize) + { + cipher.ProcessBlock(FR, 0, FRE, 0); + + byte inVal1 = input[inOff]; + byte inVal2 = input[inOff + 1]; + outBytes[outOff ] = EncryptByte(inVal1, 0); + outBytes[outOff + 1] = EncryptByte(inVal2, 1); + + Array.Copy(FR, 2, FR, 0, blockSize - 2); + + FR[blockSize - 2] = inVal1; + FR[blockSize - 1] = inVal2; + + cipher.ProcessBlock(FR, 0, FRE, 0); + + for (int n = 2; n < blockSize; n++) + { + byte inVal = input[inOff + n]; + FR[n - 2] = inVal; + outBytes[outOff + n] = EncryptByte(inVal, n - 2); + } + + count += blockSize; + } + + return blockSize; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OpenPgpCfbBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OpenPgpCfbBlockCipher.cs.meta new file mode 100644 index 00000000..10974c92 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/OpenPgpCfbBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b1ada4d10e1ce0546a797441077dd7a4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/SicBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/SicBlockCipher.cs new file mode 100644 index 00000000..014d29c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/SicBlockCipher.cs @@ -0,0 +1,124 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes +{ + /** + * Implements the Segmented Integer Counter (SIC) mode on top of a simple + * block cipher. + */ + public class SicBlockCipher + : IBlockCipher + { + private readonly IBlockCipher cipher; + private readonly int blockSize; + private readonly byte[] counter; + private readonly byte[] counterOut; + private byte[] IV; + + /** + * Basic constructor. + * + * @param c the block cipher to be used. + */ + public SicBlockCipher(IBlockCipher cipher) + { + this.cipher = cipher; + this.blockSize = cipher.GetBlockSize(); + this.counter = new byte[blockSize]; + this.counterOut = new byte[blockSize]; + this.IV = new byte[blockSize]; + } + + /** + * return the underlying block cipher that we are wrapping. + * + * @return the underlying block cipher that we are wrapping. + */ + public virtual IBlockCipher GetUnderlyingCipher() + { + return cipher; + } + + public virtual void Init( + bool forEncryption, //ignored by this CTR mode + ICipherParameters parameters) + { + ParametersWithIV ivParam = parameters as ParametersWithIV; + if (ivParam == null) + throw new ArgumentException("CTR/SIC mode requires ParametersWithIV", "parameters"); + + this.IV = Arrays.Clone(ivParam.GetIV()); + + if (blockSize < IV.Length) + throw new ArgumentException("CTR/SIC mode requires IV no greater than: " + blockSize + " bytes."); + + int maxCounterSize = System.Math.Min(8, blockSize / 2); + if (blockSize - IV.Length > maxCounterSize) + throw new ArgumentException("CTR/SIC mode requires IV of at least: " + (blockSize - maxCounterSize) + " bytes."); + + // if null it's an IV changed only. + if (ivParam.Parameters != null) + { + cipher.Init(true, ivParam.Parameters); + } + + Reset(); + } + + public virtual string AlgorithmName + { + get { return cipher.AlgorithmName + "/SIC"; } + } + + public virtual bool IsPartialBlockOkay + { + get { return true; } + } + + public virtual int GetBlockSize() + { + return cipher.GetBlockSize(); + } + + public virtual int ProcessBlock( + byte[] input, + int inOff, + byte[] output, + int outOff) + { + cipher.ProcessBlock(counter, 0, counterOut, 0); + + // + // XOR the counterOut with the plaintext producing the cipher text + // + for (int i = 0; i < counterOut.Length; i++) + { + output[outOff + i] = (byte)(counterOut[i] ^ input[inOff + i]); + } + + // Increment the counter + int j = counter.Length; + while (--j >= 0 && ++counter[j] == 0) + { + } + + return counter.Length; + } + + public virtual void Reset() + { + Arrays.Fill(counter, (byte)0); + Array.Copy(IV, 0, counter, 0, IV.Length); + cipher.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/SicBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/SicBlockCipher.cs.meta new file mode 100644 index 00000000..26d92958 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/SicBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2296184ee476c384393555a8260b697e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm.meta new file mode 100644 index 00000000..789a2606 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 25332b96083d377489f73df4e40c17c8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmExponentiator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmExponentiator.cs new file mode 100644 index 00000000..cabf8207 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmExponentiator.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm +{ + public class BasicGcmExponentiator + : IGcmExponentiator + { + private uint[] x; + + public void Init(byte[] x) + { + this.x = GcmUtilities.AsUints(x); + } + + public void ExponentiateX(long pow, byte[] output) + { + // Initial value is little-endian 1 + uint[] y = GcmUtilities.OneAsUints(); + + if (pow > 0) + { + uint[] powX = Arrays.Clone(x); + do + { + if ((pow & 1L) != 0) + { + GcmUtilities.Multiply(y, powX); + } + GcmUtilities.Multiply(powX, powX); + pow >>= 1; + } + while (pow > 0); + } + + GcmUtilities.AsBytes(y, output); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmExponentiator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmExponentiator.cs.meta new file mode 100644 index 00000000..f0ad3d54 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmExponentiator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a079161b52b48be48a3b061183d2342a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmMultiplier.cs new file mode 100644 index 00000000..c87a7e0c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmMultiplier.cs @@ -0,0 +1,26 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm +{ + public class BasicGcmMultiplier + : IGcmMultiplier + { + private uint[] H; + + public void Init(byte[] H) + { + this.H = GcmUtilities.AsUints(H); + } + + public void MultiplyH(byte[] x) + { + uint[] t = GcmUtilities.AsUints(x); + GcmUtilities.Multiply(t, H); + GcmUtilities.AsBytes(t, x); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmMultiplier.cs.meta new file mode 100644 index 00000000..ae9b801e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/BasicGcmMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 21667055c0a779443a148941e7c64ee1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/GcmUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/GcmUtilities.cs new file mode 100644 index 00000000..1ab51637 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/GcmUtilities.cs @@ -0,0 +1,357 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm +{ + internal abstract class GcmUtilities + { + private const uint E1 = 0xe1000000; + private const ulong E1L = (ulong)E1 << 32; + + private static uint[] GenerateLookup() + { + uint[] lookup = new uint[256]; + + for (int c = 0; c < 256; ++c) + { + uint v = 0; + for (int i = 7; i >= 0; --i) + { + if ((c & (1 << i)) != 0) + { + v ^= (E1 >> (7 - i)); + } + } + lookup[c] = v; + } + + return lookup; + } + + private static readonly uint[] LOOKUP = GenerateLookup(); + + internal static byte[] OneAsBytes() + { + byte[] tmp = new byte[16]; + tmp[0] = 0x80; + return tmp; + } + + internal static uint[] OneAsUints() + { + uint[] tmp = new uint[4]; + tmp[0] = 0x80000000; + return tmp; + } + + internal static ulong[] OneAsUlongs() + { + ulong[] tmp = new ulong[2]; + tmp[0] = 1UL << 63; + return tmp; + } + + internal static byte[] AsBytes(uint[] x) + { + return Pack.UInt32_To_BE(x); + } + + internal static void AsBytes(uint[] x, byte[] z) + { + Pack.UInt32_To_BE(x, z, 0); + } + + internal static byte[] AsBytes(ulong[] x) + { + byte[] z = new byte[16]; + Pack.UInt64_To_BE(x, z, 0); + return z; + } + + internal static void AsBytes(ulong[] x, byte[] z) + { + Pack.UInt64_To_BE(x, z, 0); + } + + internal static uint[] AsUints(byte[] bs) + { + uint[] output = new uint[4]; + Pack.BE_To_UInt32(bs, 0, output); + return output; + } + + internal static void AsUints(byte[] bs, uint[] output) + { + Pack.BE_To_UInt32(bs, 0, output); + } + + internal static ulong[] AsUlongs(byte[] x) + { + ulong[] z = new ulong[2]; + Pack.BE_To_UInt64(x, 0, z); + return z; + } + + public static void AsUlongs(byte[] x, ulong[] z) + { + Pack.BE_To_UInt64(x, 0, z); + } + + internal static void Multiply(byte[] x, byte[] y) + { + uint[] t1 = GcmUtilities.AsUints(x); + uint[] t2 = GcmUtilities.AsUints(y); + GcmUtilities.Multiply(t1, t2); + GcmUtilities.AsBytes(t1, x); + } + + internal static void Multiply(uint[] x, uint[] y) + { + uint r00 = x[0], r01 = x[1], r02 = x[2], r03 = x[3]; + uint r10 = 0, r11 = 0, r12 = 0, r13 = 0; + + for (int i = 0; i < 4; ++i) + { + int bits = (int)y[i]; + for (int j = 0; j < 32; ++j) + { + uint m1 = (uint)(bits >> 31); bits <<= 1; + r10 ^= (r00 & m1); + r11 ^= (r01 & m1); + r12 ^= (r02 & m1); + r13 ^= (r03 & m1); + + uint m2 = (uint)((int)(r03 << 31) >> 8); + r03 = (r03 >> 1) | (r02 << 31); + r02 = (r02 >> 1) | (r01 << 31); + r01 = (r01 >> 1) | (r00 << 31); + r00 = (r00 >> 1) ^ (m2 & E1); + } + } + + x[0] = r10; + x[1] = r11; + x[2] = r12; + x[3] = r13; + } + + internal static void Multiply(ulong[] x, ulong[] y) + { + ulong r00 = x[0], r01 = x[1], r10 = 0, r11 = 0; + + for (int i = 0; i < 2; ++i) + { + long bits = (long)y[i]; + for (int j = 0; j < 64; ++j) + { + ulong m1 = (ulong)(bits >> 63); bits <<= 1; + r10 ^= (r00 & m1); + r11 ^= (r01 & m1); + + ulong m2 = (ulong)((long)(r01 << 63) >> 8); + r01 = (r01 >> 1) | (r00 << 63); + r00 = (r00 >> 1) ^ (m2 & E1L); + } + } + + x[0] = r10; + x[1] = r11; + } + + // P is the value with only bit i=1 set + internal static void MultiplyP(uint[] x) + { + uint m = (uint)((int)ShiftRight(x) >> 8); + x[0] ^= (m & E1); + } + + internal static void MultiplyP(uint[] x, uint[] z) + { + uint m = (uint)((int)ShiftRight(x, z) >> 8); + z[0] ^= (m & E1); + } + + internal static void MultiplyP8(uint[] x) + { +// for (int i = 8; i != 0; --i) +// { +// MultiplyP(x); +// } + + uint c = ShiftRightN(x, 8); + x[0] ^= LOOKUP[c >> 24]; + } + + internal static void MultiplyP8(uint[] x, uint[] y) + { + uint c = ShiftRightN(x, 8, y); + y[0] ^= LOOKUP[c >> 24]; + } + + internal static uint ShiftRight(uint[] x) + { + uint b = x[0]; + x[0] = b >> 1; + uint c = b << 31; + b = x[1]; + x[1] = (b >> 1) | c; + c = b << 31; + b = x[2]; + x[2] = (b >> 1) | c; + c = b << 31; + b = x[3]; + x[3] = (b >> 1) | c; + return b << 31; + } + + internal static uint ShiftRight(uint[] x, uint[] z) + { + uint b = x[0]; + z[0] = b >> 1; + uint c = b << 31; + b = x[1]; + z[1] = (b >> 1) | c; + c = b << 31; + b = x[2]; + z[2] = (b >> 1) | c; + c = b << 31; + b = x[3]; + z[3] = (b >> 1) | c; + return b << 31; + } + + internal static uint ShiftRightN(uint[] x, int n) + { + uint b = x[0]; int nInv = 32 - n; + x[0] = b >> n; + uint c = b << nInv; + b = x[1]; + x[1] = (b >> n) | c; + c = b << nInv; + b = x[2]; + x[2] = (b >> n) | c; + c = b << nInv; + b = x[3]; + x[3] = (b >> n) | c; + return b << nInv; + } + + internal static uint ShiftRightN(uint[] x, int n, uint[] z) + { + uint b = x[0]; int nInv = 32 - n; + z[0] = b >> n; + uint c = b << nInv; + b = x[1]; + z[1] = (b >> n) | c; + c = b << nInv; + b = x[2]; + z[2] = (b >> n) | c; + c = b << nInv; + b = x[3]; + z[3] = (b >> n) | c; + return b << nInv; + } + + internal static void Xor(byte[] x, byte[] y) + { + int i = 0; + do + { + x[i] ^= y[i]; ++i; + x[i] ^= y[i]; ++i; + x[i] ^= y[i]; ++i; + x[i] ^= y[i]; ++i; + } + while (i < 16); + } + + internal static void Xor(byte[] x, byte[] y, int yOff) + { + int i = 0; + do + { + x[i] ^= y[yOff + i]; ++i; + x[i] ^= y[yOff + i]; ++i; + x[i] ^= y[yOff + i]; ++i; + x[i] ^= y[yOff + i]; ++i; + } + while (i < 16); + } + + internal static void Xor(byte[] x, int xOff, byte[] y, int yOff, byte[] z, int zOff) + { + int i = 0; + do + { + z[zOff + i] = (byte)(x[xOff + i] ^ y[yOff + i]); ++i; + z[zOff + i] = (byte)(x[xOff + i] ^ y[yOff + i]); ++i; + z[zOff + i] = (byte)(x[xOff + i] ^ y[yOff + i]); ++i; + z[zOff + i] = (byte)(x[xOff + i] ^ y[yOff + i]); ++i; + } + while (i < 16); + } + + internal static void Xor(byte[] x, byte[] y, int yOff, int yLen) + { + while (--yLen >= 0) + { + x[yLen] ^= y[yOff + yLen]; + } + } + + internal static void Xor(byte[] x, int xOff, byte[] y, int yOff, int len) + { + while (--len >= 0) + { + x[xOff + len] ^= y[yOff + len]; + } + } + + internal static void Xor(byte[] x, byte[] y, byte[] z) + { + int i = 0; + do + { + z[i] = (byte)(x[i] ^ y[i]); ++i; + z[i] = (byte)(x[i] ^ y[i]); ++i; + z[i] = (byte)(x[i] ^ y[i]); ++i; + z[i] = (byte)(x[i] ^ y[i]); ++i; + } + while (i < 16); + } + + internal static void Xor(uint[] x, uint[] y) + { + x[0] ^= y[0]; + x[1] ^= y[1]; + x[2] ^= y[2]; + x[3] ^= y[3]; + } + + internal static void Xor(uint[] x, uint[] y, uint[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + z[2] = x[2] ^ y[2]; + z[3] = x[3] ^ y[3]; + } + + internal static void Xor(ulong[] x, ulong[] y) + { + x[0] ^= y[0]; + x[1] ^= y[1]; + } + + internal static void Xor(ulong[] x, ulong[] y, ulong[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/GcmUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/GcmUtilities.cs.meta new file mode 100644 index 00000000..3cbe3561 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/GcmUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a537b491bcdd0934aac526f2ac481e5e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmExponentiator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmExponentiator.cs new file mode 100644 index 00000000..09bc1632 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmExponentiator.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm +{ + public interface IGcmExponentiator + { + void Init(byte[] x); + void ExponentiateX(long pow, byte[] output); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmExponentiator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmExponentiator.cs.meta new file mode 100644 index 00000000..9caa76f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmExponentiator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2b9360b15af87e1479595647271315ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmMultiplier.cs new file mode 100644 index 00000000..966c02c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmMultiplier.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm +{ + public interface IGcmMultiplier + { + void Init(byte[] H); + void MultiplyH(byte[] x); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmMultiplier.cs.meta new file mode 100644 index 00000000..da3d384c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/IGcmMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c18943b1cef80dd40b832574fd4e810e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables1kGcmExponentiator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables1kGcmExponentiator.cs new file mode 100644 index 00000000..57104a36 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables1kGcmExponentiator.cs @@ -0,0 +1,63 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm +{ + public class Tables1kGcmExponentiator + : IGcmExponentiator + { + // A lookup table of the power-of-two powers of 'x' + // - lookupPowX2[i] = x^(2^i) + private IList lookupPowX2; + + public void Init(byte[] x) + { + uint[] y = GcmUtilities.AsUints(x); + if (lookupPowX2 != null && Arrays.AreEqual(y, (uint[])lookupPowX2[0])) + return; + + lookupPowX2 = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(8); + lookupPowX2.Add(y); + } + + public void ExponentiateX(long pow, byte[] output) + { + uint[] y = GcmUtilities.OneAsUints(); + int bit = 0; + while (pow > 0) + { + if ((pow & 1L) != 0) + { + EnsureAvailable(bit); + GcmUtilities.Multiply(y, (uint[])lookupPowX2[bit]); + } + ++bit; + pow >>= 1; + } + + GcmUtilities.AsBytes(y, output); + } + + private void EnsureAvailable(int bit) + { + int count = lookupPowX2.Count; + if (count <= bit) + { + uint[] tmp = (uint[])lookupPowX2[count - 1]; + do + { + tmp = Arrays.Clone(tmp); + GcmUtilities.Multiply(tmp, tmp); + lookupPowX2.Add(tmp); + } + while (++count <= bit); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables1kGcmExponentiator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables1kGcmExponentiator.cs.meta new file mode 100644 index 00000000..87abe9a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables1kGcmExponentiator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb76a60bca7933e4fa45510eada87774 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables64kGcmMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables64kGcmMultiplier.cs new file mode 100644 index 00000000..a8c93fc3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables64kGcmMultiplier.cs @@ -0,0 +1,81 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm +{ + public class Tables64kGcmMultiplier + : IGcmMultiplier + { + private byte[] H; + private uint[][][] M; + + public void Init(byte[] H) + { + if (M == null) + { + M = new uint[16][][]; + } + else if (Arrays.AreEqual(this.H, H)) + { + return; + } + + this.H = Arrays.Clone(H); + + M[0] = new uint[256][]; + M[0][0] = new uint[4]; + M[0][128] = GcmUtilities.AsUints(H); + for (int j = 64; j >= 1; j >>= 1) + { + uint[] tmp = (uint[])M[0][j + j].Clone(); + GcmUtilities.MultiplyP(tmp); + M[0][j] = tmp; + } + for (int i = 0; ; ) + { + for (int j = 2; j < 256; j += j) + { + for (int k = 1; k < j; ++k) + { + uint[] tmp = (uint[])M[i][j].Clone(); + GcmUtilities.Xor(tmp, M[i][k]); + M[i][j + k] = tmp; + } + } + + if (++i == 16) return; + + M[i] = new uint[256][]; + M[i][0] = new uint[4]; + for (int j = 128; j > 0; j >>= 1) + { + uint[] tmp = (uint[])M[i - 1][j].Clone(); + GcmUtilities.MultiplyP8(tmp); + M[i][j] = tmp; + } + } + } + + public void MultiplyH(byte[] x) + { + uint[] z = new uint[4]; + for (int i = 0; i != 16; ++i) + { + //GcmUtilities.Xor(z, M[i][x[i]]); + uint[] m = M[i][x[i]]; + z[0] ^= m[0]; + z[1] ^= m[1]; + z[2] ^= m[2]; + z[3] ^= m[3]; + } + + Pack.UInt32_To_BE(z, x, 0); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables64kGcmMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables64kGcmMultiplier.cs.meta new file mode 100644 index 00000000..10e5681d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables64kGcmMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 11e15117f8c61854a8ed870e37ef1af8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables8kGcmMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables8kGcmMultiplier.cs new file mode 100644 index 00000000..e92cb2e3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables8kGcmMultiplier.cs @@ -0,0 +1,108 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.Gcm +{ + public sealed class Tables8kGcmMultiplier + : IGcmMultiplier + { + private byte[] H; + private uint[][][] M; + + public void Init(byte[] H) + { + if (M == null) + { + M = new uint[32][][]; + } + else if (Arrays.AreEqual(this.H, H)) + { + return; + } + + this.H = Arrays.Clone(H); + + M[0] = new uint[16][]; + M[1] = new uint[16][]; + M[0][0] = new uint[4]; + M[1][0] = new uint[4]; + M[1][8] = GcmUtilities.AsUints(H); + + for (int j = 4; j >= 1; j >>= 1) + { + uint[] tmp = (uint[])M[1][j + j].Clone(); + GcmUtilities.MultiplyP(tmp); + M[1][j] = tmp; + } + + { + uint[] tmp = (uint[])M[1][1].Clone(); + GcmUtilities.MultiplyP(tmp); + M[0][8] = tmp; + } + + for (int j = 4; j >= 1; j >>= 1) + { + uint[] tmp = (uint[])M[0][j + j].Clone(); + GcmUtilities.MultiplyP(tmp); + M[0][j] = tmp; + } + + for (int i = 0; ; ) + { + for (int j = 2; j < 16; j += j) + { + for (int k = 1; k < j; ++k) + { + uint[] tmp = (uint[])M[i][j].Clone(); + GcmUtilities.Xor(tmp, M[i][k]); + M[i][j + k] = tmp; + } + } + + if (++i == 32) return; + + if (i > 1) + { + M[i] = new uint[16][]; + M[i][0] = new uint[4]; + for (int j = 8; j > 0; j >>= 1) + { + uint[] tmp = (uint[])M[i - 2][j].Clone(); + GcmUtilities.MultiplyP8(tmp); + M[i][j] = tmp; + } + } + } + } + uint[] z = new uint[4]; + + public void MultiplyH(byte[] x) + { + Array.Clear(z, 0, z.Length); + for (int i = 15; i >= 0; --i) + { + //GcmUtilities.Xor(z, M[i + i][x[i] & 0x0f]); + uint[] m = M[i + i][x[i] & 0x0f]; + z[0] ^= m[0]; + z[1] ^= m[1]; + z[2] ^= m[2]; + z[3] ^= m[3]; + //GcmUtilities.Xor(z, M[i + i + 1][(x[i] & 0xf0) >> 4]); + m = M[i + i + 1][(x[i] & 0xf0) >> 4]; + z[0] ^= m[0]; + z[1] ^= m[1]; + z[2] ^= m[2]; + z[3] ^= m[3]; + } + + Pack.UInt32_To_BE(z, x, 0); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables8kGcmMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables8kGcmMultiplier.cs.meta new file mode 100644 index 00000000..117d3451 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/modes/gcm/Tables8kGcmMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d0ed8793a414fb442ad8987957e3d03f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators.meta new file mode 100644 index 00000000..4643ca42 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 68a42d586834bc5489474f303f2686c1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/Asn1Signature.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/Asn1Signature.cs new file mode 100644 index 00000000..c367bd1d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/Asn1Signature.cs @@ -0,0 +1,388 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators +{ + internal class X509Utilities + { + private static readonly Asn1Null derNull = DerNull.Instance; + + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary exParams = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly ISet noParams = new HashSet(); + + static X509Utilities() + { + algorithms.Add("MD2WITHRSAENCRYPTION", PkcsObjectIdentifiers.MD2WithRsaEncryption); + algorithms.Add("MD2WITHRSA", PkcsObjectIdentifiers.MD2WithRsaEncryption); + algorithms.Add("MD5WITHRSAENCRYPTION", PkcsObjectIdentifiers.MD5WithRsaEncryption); + algorithms.Add("MD5WITHRSA", PkcsObjectIdentifiers.MD5WithRsaEncryption); + algorithms.Add("SHA1WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha1WithRsaEncryption); + algorithms.Add("SHA1WITHRSA", PkcsObjectIdentifiers.Sha1WithRsaEncryption); + algorithms.Add("SHA224WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha224WithRsaEncryption); + algorithms.Add("SHA224WITHRSA", PkcsObjectIdentifiers.Sha224WithRsaEncryption); + algorithms.Add("SHA256WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha256WithRsaEncryption); + algorithms.Add("SHA256WITHRSA", PkcsObjectIdentifiers.Sha256WithRsaEncryption); + algorithms.Add("SHA384WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha384WithRsaEncryption); + algorithms.Add("SHA384WITHRSA", PkcsObjectIdentifiers.Sha384WithRsaEncryption); + algorithms.Add("SHA512WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha512WithRsaEncryption); + algorithms.Add("SHA512WITHRSA", PkcsObjectIdentifiers.Sha512WithRsaEncryption); + algorithms.Add("SHA1WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA224WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA256WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA384WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA512WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("RIPEMD160WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160); + algorithms.Add("RIPEMD160WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160); + algorithms.Add("RIPEMD128WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128); + algorithms.Add("RIPEMD128WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128); + algorithms.Add("RIPEMD256WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256); + algorithms.Add("RIPEMD256WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256); + algorithms.Add("SHA1WITHDSA", X9ObjectIdentifiers.IdDsaWithSha1); + algorithms.Add("DSAWITHSHA1", X9ObjectIdentifiers.IdDsaWithSha1); + algorithms.Add("SHA224WITHDSA", NistObjectIdentifiers.DsaWithSha224); + algorithms.Add("SHA256WITHDSA", NistObjectIdentifiers.DsaWithSha256); + algorithms.Add("SHA384WITHDSA", NistObjectIdentifiers.DsaWithSha384); + algorithms.Add("SHA512WITHDSA", NistObjectIdentifiers.DsaWithSha512); + algorithms.Add("SHA1WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha1); + algorithms.Add("ECDSAWITHSHA1", X9ObjectIdentifiers.ECDsaWithSha1); + algorithms.Add("SHA224WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha224); + algorithms.Add("SHA256WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha256); + algorithms.Add("SHA384WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha384); + algorithms.Add("SHA512WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha512); + algorithms.Add("GOST3411WITHGOST3410", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + algorithms.Add("GOST3411WITHGOST3410-94", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + algorithms.Add("GOST3411WITHECGOST3410", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + algorithms.Add("GOST3411WITHECGOST3410-2001", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + algorithms.Add("GOST3411WITHGOST3410-2001", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + + // + // According to RFC 3279, the ASN.1 encoding SHALL (id-dsa-with-sha1) or MUST (ecdsa-with-SHA*) omit the parameters field. + // The parameters field SHALL be NULL for RSA based signature algorithms. + // + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha1); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha224); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha256); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha384); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha512); + noParams.Add(X9ObjectIdentifiers.IdDsaWithSha1); + noParams.Add(NistObjectIdentifiers.DsaWithSha224); + noParams.Add(NistObjectIdentifiers.DsaWithSha256); + noParams.Add(NistObjectIdentifiers.DsaWithSha384); + noParams.Add(NistObjectIdentifiers.DsaWithSha512); + + // + // RFC 4491 + // + noParams.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + noParams.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + + // + // explicit params + // + AlgorithmIdentifier sha1AlgId = new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1, DerNull.Instance); + exParams.Add("SHA1WITHRSAANDMGF1", CreatePssParams(sha1AlgId, 20)); + + AlgorithmIdentifier sha224AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha224, DerNull.Instance); + exParams.Add("SHA224WITHRSAANDMGF1", CreatePssParams(sha224AlgId, 28)); + + AlgorithmIdentifier sha256AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha256, DerNull.Instance); + exParams.Add("SHA256WITHRSAANDMGF1", CreatePssParams(sha256AlgId, 32)); + + AlgorithmIdentifier sha384AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha384, DerNull.Instance); + exParams.Add("SHA384WITHRSAANDMGF1", CreatePssParams(sha384AlgId, 48)); + + AlgorithmIdentifier sha512AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha512, DerNull.Instance); + exParams.Add("SHA512WITHRSAANDMGF1", CreatePssParams(sha512AlgId, 64)); + } + + /** + * Return the digest algorithm using one of the standard JCA string + * representations rather than the algorithm identifier (if possible). + */ + private static string GetDigestAlgName( + DerObjectIdentifier digestAlgOID) + { + if (PkcsObjectIdentifiers.MD5.Equals(digestAlgOID)) + { + return "MD5"; + } + else if (OiwObjectIdentifiers.IdSha1.Equals(digestAlgOID)) + { + return "SHA1"; + } + else if (NistObjectIdentifiers.IdSha224.Equals(digestAlgOID)) + { + return "SHA224"; + } + else if (NistObjectIdentifiers.IdSha256.Equals(digestAlgOID)) + { + return "SHA256"; + } + else if (NistObjectIdentifiers.IdSha384.Equals(digestAlgOID)) + { + return "SHA384"; + } + else if (NistObjectIdentifiers.IdSha512.Equals(digestAlgOID)) + { + return "SHA512"; + } + else if (TeleTrusTObjectIdentifiers.RipeMD128.Equals(digestAlgOID)) + { + return "RIPEMD128"; + } + else if (TeleTrusTObjectIdentifiers.RipeMD160.Equals(digestAlgOID)) + { + return "RIPEMD160"; + } + else if (TeleTrusTObjectIdentifiers.RipeMD256.Equals(digestAlgOID)) + { + return "RIPEMD256"; + } + else if (CryptoProObjectIdentifiers.GostR3411.Equals(digestAlgOID)) + { + return "GOST3411"; + } + else + { + return digestAlgOID.Id; + } + } + + internal static string GetSignatureName(AlgorithmIdentifier sigAlgId) + { + Asn1Encodable parameters = sigAlgId.Parameters; + + if (parameters != null && !derNull.Equals(parameters)) + { + if (sigAlgId.Algorithm.Equals(PkcsObjectIdentifiers.IdRsassaPss)) + { + RsassaPssParameters rsaParams = RsassaPssParameters.GetInstance(parameters); + + return GetDigestAlgName(rsaParams.HashAlgorithm.Algorithm) + "withRSAandMGF1"; + } + if (sigAlgId.Algorithm.Equals(X9ObjectIdentifiers.ECDsaWithSha2)) + { + Asn1Sequence ecDsaParams = Asn1Sequence.GetInstance(parameters); + + return GetDigestAlgName((DerObjectIdentifier)ecDsaParams[0]) + "withECDSA"; + } + } + + return sigAlgId.Algorithm.Id; + } + + private static RsassaPssParameters CreatePssParams( + AlgorithmIdentifier hashAlgId, + int saltSize) + { + return new RsassaPssParameters( + hashAlgId, + new AlgorithmIdentifier(PkcsObjectIdentifiers.IdMgf1, hashAlgId), + new DerInteger(saltSize), + new DerInteger(1)); + } + + internal static DerObjectIdentifier GetAlgorithmOid( + string algorithmName) + { + algorithmName = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithmName); + + if (algorithms.Contains(algorithmName)) + { + return (DerObjectIdentifier) algorithms[algorithmName]; + } + + return new DerObjectIdentifier(algorithmName); + } + + internal static AlgorithmIdentifier GetSigAlgID( + DerObjectIdentifier sigOid, + string algorithmName) + { + if (noParams.Contains(sigOid)) + { + return new AlgorithmIdentifier(sigOid); + } + + algorithmName = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithmName); + + if (exParams.Contains(algorithmName)) + { + return new AlgorithmIdentifier(sigOid, (Asn1Encodable) exParams[algorithmName]); + } + + return new AlgorithmIdentifier(sigOid, DerNull.Instance); + } + + internal static IEnumerable GetAlgNames() + { + return new EnumerableProxy(algorithms.Keys); + } + } + + /// + /// Calculator factory class for signature generation in ASN.1 based profiles that use an AlgorithmIdentifier to preserve + /// signature algorithm details. + /// + public class Asn1SignatureFactory + : ISignatureFactory + { + private readonly AlgorithmIdentifier algID; + private readonly string algorithm; + private readonly AsymmetricKeyParameter privateKey; + private readonly SecureRandom random; + + /// + /// Base constructor. + /// + /// The name of the signature algorithm to use. + /// The private key to be used in the signing operation. + public Asn1SignatureFactory (string algorithm, AsymmetricKeyParameter privateKey) + : this(algorithm, privateKey, null) + { + } + + /// + /// Constructor which also specifies a source of randomness to be used if one is required. + /// + /// The name of the signature algorithm to use. + /// The private key to be used in the signing operation. + /// The source of randomness to be used in signature calculation. + public Asn1SignatureFactory(string algorithm, AsymmetricKeyParameter privateKey, SecureRandom random) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + if (privateKey == null) + throw new ArgumentNullException("privateKey"); + if (!privateKey.IsPrivate) + throw new ArgumentException("Key for signing must be private", "privateKey"); + + DerObjectIdentifier sigOid = X509Utilities.GetAlgorithmOid(algorithm); + + this.algorithm = algorithm; + this.privateKey = privateKey; + this.random = random; + this.algID = X509Utilities.GetSigAlgID(sigOid, algorithm); + } + + public Object AlgorithmDetails + { + get { return this.algID; } + } + + public IStreamCalculator CreateCalculator() + { + ISigner signer = SignerUtilities.InitSigner(algorithm, true, privateKey, random); + + return new DefaultSignatureCalculator(signer); + } + + /// + /// Allows enumeration of the signature names supported by the verifier provider. + /// + public static IEnumerable SignatureAlgNames + { + get { return X509Utilities.GetAlgNames(); } + } + } + + /// + /// Verifier class for signature verification in ASN.1 based profiles that use an AlgorithmIdentifier to preserve + /// signature algorithm details. + /// + public class Asn1VerifierFactory + : IVerifierFactory + { + private readonly AlgorithmIdentifier algID; + private readonly AsymmetricKeyParameter publicKey; + + /// + /// Base constructor. + /// + /// The name of the signature algorithm to use. + /// The public key to be used in the verification operation. + public Asn1VerifierFactory(string algorithm, AsymmetricKeyParameter publicKey) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + if (publicKey == null) + throw new ArgumentNullException("publicKey"); + if (publicKey.IsPrivate) + throw new ArgumentException("Key for verifying must be public", "publicKey"); + + DerObjectIdentifier sigOid = X509Utilities.GetAlgorithmOid(algorithm); + + this.publicKey = publicKey; + this.algID = X509Utilities.GetSigAlgID(sigOid, algorithm); + } + + public Asn1VerifierFactory(AlgorithmIdentifier algorithm, AsymmetricKeyParameter publicKey) + { + this.publicKey = publicKey; + this.algID = algorithm; + } + + public Object AlgorithmDetails + { + get { return this.algID; } + } + + public IStreamCalculator CreateCalculator() + { + ISigner verifier = SignerUtilities.InitSigner(X509Utilities.GetSignatureName(algID), false, publicKey, null); + + return new DefaultVerifierCalculator(verifier); + } + } + + /// + /// Provider class which supports dynamic creation of signature verifiers. + /// + public class Asn1VerifierFactoryProvider: IVerifierFactoryProvider + { + private readonly AsymmetricKeyParameter publicKey; + + /// + /// Base constructor - specify the public key to be used in verification. + /// + /// The public key to be used in creating verifiers provided by this object. + public Asn1VerifierFactoryProvider(AsymmetricKeyParameter publicKey) + { + this.publicKey = publicKey; + } + + public IVerifierFactory CreateVerifierFactory(Object algorithmDetails) + { + return new Asn1VerifierFactory((AlgorithmIdentifier)algorithmDetails, publicKey); + } + + /// + /// Allows enumeration of the signature names supported by the verifier provider. + /// + public IEnumerable SignatureAlgNames + { + get { return X509Utilities.GetAlgNames(); } + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/Asn1Signature.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/Asn1Signature.cs.meta new file mode 100644 index 00000000..8ab4abdd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/Asn1Signature.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3cfa37c567c69d64e94a320d53944aff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureCalculator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureCalculator.cs new file mode 100644 index 00000000..4ed3ece6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureCalculator.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators +{ + public class DefaultSignatureCalculator + : IStreamCalculator + { + private readonly SignerSink mSignerSink; + + public DefaultSignatureCalculator(ISigner signer) + { + this.mSignerSink = new SignerSink(signer); + } + + public Stream Stream + { + get { return mSignerSink; } + } + + public object GetResult() + { + return new DefaultSignatureResult(mSignerSink.Signer); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureCalculator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureCalculator.cs.meta new file mode 100644 index 00000000..891ce0e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd95bd10d03dd5c43a84352032191028 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureResult.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureResult.cs new file mode 100644 index 00000000..3d89f999 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureResult.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators +{ + public class DefaultSignatureResult + : IBlockResult + { + private readonly ISigner mSigner; + + public DefaultSignatureResult(ISigner signer) + { + this.mSigner = signer; + } + + public byte[] Collect() + { + return mSigner.GenerateSignature(); + } + + public int Collect(byte[] sig, int sigOff) + { + byte[] signature = Collect(); + signature.CopyTo(sig, sigOff); + return signature.Length; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureResult.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureResult.cs.meta new file mode 100644 index 00000000..60485fe5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultSignatureResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8713fbe707f798c41802405bcdf53ae3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierCalculator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierCalculator.cs new file mode 100644 index 00000000..aa0a3195 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierCalculator.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators +{ + public class DefaultVerifierCalculator + : IStreamCalculator + { + private readonly SignerSink mSignerSink; + + public DefaultVerifierCalculator(ISigner signer) + { + this.mSignerSink = new SignerSink(signer); + } + + public Stream Stream + { + get { return mSignerSink; } + } + + public object GetResult() + { + return new DefaultVerifierResult(mSignerSink.Signer); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierCalculator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierCalculator.cs.meta new file mode 100644 index 00000000..a1ba2219 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17f76450775ae0d458726adec8a5ad4c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierResult.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierResult.cs new file mode 100644 index 00000000..1f25d4b4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierResult.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators +{ + public class DefaultVerifierResult + : IVerifier + { + private readonly ISigner mSigner; + + public DefaultVerifierResult(ISigner signer) + { + this.mSigner = signer; + } + + public bool IsVerified(byte[] signature) + { + return mSigner.VerifySignature(signature); + } + + public bool IsVerified(byte[] sig, int sigOff, int sigLen) + { + byte[] signature = Arrays.CopyOfRange(sig, sigOff, sigOff + sigLen); + + return IsVerified(signature); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierResult.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierResult.cs.meta new file mode 100644 index 00000000..87f2fe8b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/operators/DefaultVerifierResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c49a906488d90c4dbe543d0d477d26d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings.meta new file mode 100644 index 00000000..d6c9e47d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c60458b835ab8c54ba3ae600588beeeb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/BlockCipherPadding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/BlockCipherPadding.cs new file mode 100644 index 00000000..33d32ecf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/BlockCipherPadding.cs @@ -0,0 +1,47 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings +{ + /** + * Block cipher padders are expected to conform to this interface + */ + public interface IBlockCipherPadding + { + /** + * Initialise the padder. + * + * @param param parameters, if any required. + */ + void Init(SecureRandom random); + //throws ArgumentException; + + /** + * Return the name of the algorithm the cipher implements. + * + * @return the name of the algorithm the cipher implements. + */ + string PaddingName { get; } + + /** + * add the pad bytes to the passed in block, returning the + * number of bytes added. + */ + int AddPadding(byte[] input, int inOff); + + /** + * return the number of pad bytes present in the block. + * @exception InvalidCipherTextException if the padding is badly formed + * or invalid. + */ + int PadCount(byte[] input); + //throws InvalidCipherTextException; + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/BlockCipherPadding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/BlockCipherPadding.cs.meta new file mode 100644 index 00000000..8e84b310 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/BlockCipherPadding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f24f6689dd124343ab88b53bbef3e26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO10126d2Padding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO10126d2Padding.cs new file mode 100644 index 00000000..313b3224 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO10126d2Padding.cs @@ -0,0 +1,80 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings +{ + + /** + * A padder that adds ISO10126-2 padding to a block. + */ + public class ISO10126d2Padding: IBlockCipherPadding + { + private SecureRandom random; + + /** + * Initialise the padder. + * + * @param random a SecureRandom if available. + */ + public void Init( + SecureRandom random) + //throws ArgumentException + { + this.random = (random != null) ? random : new SecureRandom(); + } + + /** + * Return the name of the algorithm the cipher implements. + * + * @return the name of the algorithm the cipher implements. + */ + public string PaddingName + { + get { return "ISO10126-2"; } + } + + /** + * add the pad bytes to the passed in block, returning the + * number of bytes added. + */ + public int AddPadding( + byte[] input, + int inOff) + { + byte code = (byte)(input.Length - inOff); + + while (inOff < (input.Length - 1)) + { + input[inOff] = (byte)random.NextInt(); + inOff++; + } + + input[inOff] = code; + + return code; + } + + /** + * return the number of pad bytes present in the block. + */ + public int PadCount(byte[] input) + //throws InvalidCipherTextException + { + int count = input[input.Length - 1] & 0xff; + + if (count > input.Length) + { + throw new InvalidCipherTextException("pad block corrupted"); + } + + return count; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO10126d2Padding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO10126d2Padding.cs.meta new file mode 100644 index 00000000..44806757 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO10126d2Padding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 81e4c7d79b217c44da9b2dc55d48fb3d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO7816d4Padding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO7816d4Padding.cs new file mode 100644 index 00000000..18206dc8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO7816d4Padding.cs @@ -0,0 +1,83 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings +{ + /** + * A padder that adds the padding according to the scheme referenced in + * ISO 7814-4 - scheme 2 from ISO 9797-1. The first byte is 0x80, rest is 0x00 + */ + public class ISO7816d4Padding + : IBlockCipherPadding + { + /** + * Initialise the padder. + * + * @param random - a SecureRandom if available. + */ + public void Init( + SecureRandom random) + { + // nothing to do. + } + + /** + * Return the name of the algorithm the padder implements. + * + * @return the name of the algorithm the padder implements. + */ + public string PaddingName + { + get { return "ISO7816-4"; } + } + + /** + * add the pad bytes to the passed in block, returning the + * number of bytes added. + */ + public int AddPadding( + byte[] input, + int inOff) + { + int added = (input.Length - inOff); + + input[inOff]= (byte) 0x80; + inOff ++; + + while (inOff < input.Length) + { + input[inOff] = (byte) 0; + inOff++; + } + + return added; + } + + /** + * return the number of pad bytes present in the block. + */ + public int PadCount( + byte[] input) + { + int count = input.Length - 1; + + while (count > 0 && input[count] == 0) + { + count--; + } + + if (input[count] != (byte)0x80) + { + throw new InvalidCipherTextException("pad block corrupted"); + } + + return input.Length - count; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO7816d4Padding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO7816d4Padding.cs.meta new file mode 100644 index 00000000..6ee22178 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ISO7816d4Padding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26e9e3006aa8e5b49939429f343fbea4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/PaddedBufferedBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/PaddedBufferedBlockCipher.cs new file mode 100644 index 00000000..c68a5a76 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/PaddedBufferedBlockCipher.cs @@ -0,0 +1,289 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings +{ + /** + * A wrapper class that allows block ciphers to be used to process data in + * a piecemeal fashion with padding. The PaddedBufferedBlockCipher + * outputs a block only when the buffer is full and more data is being added, + * or on a doFinal (unless the current block in the buffer is a pad block). + * The default padding mechanism used is the one outlined in Pkcs5/Pkcs7. + */ + public class PaddedBufferedBlockCipher + : BufferedBlockCipher + { + private readonly IBlockCipherPadding padding; + + /** + * Create a buffered block cipher with the desired padding. + * + * @param cipher the underlying block cipher this buffering object wraps. + * @param padding the padding type. + */ + public PaddedBufferedBlockCipher( + IBlockCipher cipher, + IBlockCipherPadding padding) + { + this.cipher = cipher; + this.padding = padding; + + buf = new byte[cipher.GetBlockSize()]; + bufOff = 0; + } + + /** + * Create a buffered block cipher Pkcs7 padding + * + * @param cipher the underlying block cipher this buffering object wraps. + */ + public PaddedBufferedBlockCipher( + IBlockCipher cipher) + : this(cipher, new Pkcs7Padding()) { } + + /** + * initialise the cipher. + * + * @param forEncryption if true the cipher is initialised for + * encryption, if false for decryption. + * @param param the key and other data required by the cipher. + * @exception ArgumentException if the parameters argument is + * inappropriate. + */ + public override void Init( + bool forEncryption, + ICipherParameters parameters) + { + this.forEncryption = forEncryption; + + SecureRandom initRandom = null; + if (parameters is ParametersWithRandom) + { + ParametersWithRandom p = (ParametersWithRandom)parameters; + initRandom = p.Random; + parameters = p.Parameters; + } + + Reset(); + padding.Init(initRandom); + cipher.Init(forEncryption, parameters); + } + + /** + * return the minimum size of the output buffer required for an update + * plus a doFinal with an input of len bytes. + * + * @param len the length of the input. + * @return the space required to accommodate a call to update and doFinal + * with len bytes of input. + */ + public override int GetOutputSize( + int length) + { + int total = length + bufOff; + int leftOver = total % buf.Length; + + if (leftOver == 0) + { + if (forEncryption) + { + return total + buf.Length; + } + + return total; + } + + return total - leftOver + buf.Length; + } + + /** + * return the size of the output buffer required for an update + * an input of len bytes. + * + * @param len the length of the input. + * @return the space required to accommodate a call to update + * with len bytes of input. + */ + public override int GetUpdateOutputSize( + int length) + { + int total = length + bufOff; + int leftOver = total % buf.Length; + + if (leftOver == 0) + { + return total - buf.Length; + } + + return total - leftOver; + } + + /** + * process a single byte, producing an output block if necessary. + * + * @param in the input byte. + * @param out the space for any output that might be produced. + * @param outOff the offset from which the output will be copied. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there isn't enough space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + */ + public override int ProcessByte( + byte input, + byte[] output, + int outOff) + { + int resultLen = 0; + + if (bufOff == buf.Length) + { + resultLen = cipher.ProcessBlock(buf, 0, output, outOff); + bufOff = 0; + } + + buf[bufOff++] = input; + + return resultLen; + } + + /** + * process an array of bytes, producing output if necessary. + * + * @param in the input byte array. + * @param inOff the offset at which the input data starts. + * @param len the number of bytes to be copied out of the input array. + * @param out the space for any output that might be produced. + * @param outOff the offset from which the output will be copied. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there isn't enough space in out. + * @exception InvalidOperationException if the cipher isn't initialised. + */ + public override int ProcessBytes( + byte[] input, + int inOff, + int length, + byte[] output, + int outOff) + { + if (length < 0) + { + throw new ArgumentException("Can't have a negative input length!"); + } + + int blockSize = GetBlockSize(); + int outLength = GetUpdateOutputSize(length); + + if (outLength > 0) + { + Check.OutputLength(output, outOff, outLength, "output buffer too short"); + } + + int resultLen = 0; + int gapLen = buf.Length - bufOff; + + if (length > gapLen) + { + Array.Copy(input, inOff, buf, bufOff, gapLen); + + resultLen += cipher.ProcessBlock(buf, 0, output, outOff); + + bufOff = 0; + length -= gapLen; + inOff += gapLen; + + while (length > buf.Length) + { + resultLen += cipher.ProcessBlock(input, inOff, output, outOff + resultLen); + + length -= blockSize; + inOff += blockSize; + } + } + + Array.Copy(input, inOff, buf, bufOff, length); + + bufOff += length; + + return resultLen; + } + + /** + * Process the last block in the buffer. If the buffer is currently + * full and padding needs to be added a call to doFinal will produce + * 2 * GetBlockSize() bytes. + * + * @param out the array the block currently being held is copied into. + * @param outOff the offset at which the copying starts. + * @return the number of output bytes copied to out. + * @exception DataLengthException if there is insufficient space in out for + * the output or we are decrypting and the input is not block size aligned. + * @exception InvalidOperationException if the underlying cipher is not + * initialised. + * @exception InvalidCipherTextException if padding is expected and not found. + */ + public override int DoFinal( + byte[] output, + int outOff) + { + int blockSize = cipher.GetBlockSize(); + int resultLen = 0; + + if (forEncryption) + { + if (bufOff == blockSize) + { + if ((outOff + 2 * blockSize) > output.Length) + { + Reset(); + + throw new OutputLengthException("output buffer too short"); + } + + resultLen = cipher.ProcessBlock(buf, 0, output, outOff); + bufOff = 0; + } + + padding.AddPadding(buf, bufOff); + + resultLen += cipher.ProcessBlock(buf, 0, output, outOff + resultLen); + + Reset(); + } + else + { + if (bufOff == blockSize) + { + resultLen = cipher.ProcessBlock(buf, 0, buf, 0); + bufOff = 0; + } + else + { + Reset(); + + throw new DataLengthException("last block incomplete in decryption"); + } + + try + { + resultLen -= padding.PadCount(buf); + + Array.Copy(buf, 0, output, outOff, resultLen); + } + finally + { + Reset(); + } + } + + return resultLen; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/PaddedBufferedBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/PaddedBufferedBlockCipher.cs.meta new file mode 100644 index 00000000..5f7930aa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/PaddedBufferedBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 65e1994a7e4976f4aa5b7844d08da1d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/Pkcs7Padding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/Pkcs7Padding.cs new file mode 100644 index 00000000..2e1d4b6c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/Pkcs7Padding.cs @@ -0,0 +1,80 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings +{ + /** + * A padder that adds Pkcs7/Pkcs5 padding to a block. + */ + public class Pkcs7Padding + : IBlockCipherPadding + { + /** + * Initialise the padder. + * + * @param random - a SecureRandom if available. + */ + public void Init( + SecureRandom random) + { + // nothing to do. + } + + /** + * Return the name of the algorithm the cipher implements. + * + * @return the name of the algorithm the cipher implements. + */ + public string PaddingName + { + get { return "PKCS7"; } + } + + /** + * add the pad bytes to the passed in block, returning the + * number of bytes added. + */ + public int AddPadding( + byte[] input, + int inOff) + { + byte code = (byte)(input.Length - inOff); + + while (inOff < input.Length) + { + input[inOff] = code; + inOff++; + } + + return code; + } + + /** + * return the number of pad bytes present in the block. + */ + public int PadCount( + byte[] input) + { + byte countAsByte = input[input.Length - 1]; + int count = countAsByte; + + if (count < 1 || count > input.Length) + throw new InvalidCipherTextException("pad block corrupted"); + + for (int i = 2; i <= count; i++) + { + if (input[input.Length - i] != countAsByte) + throw new InvalidCipherTextException("pad block corrupted"); + } + + return count; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/Pkcs7Padding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/Pkcs7Padding.cs.meta new file mode 100644 index 00000000..5334f056 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/Pkcs7Padding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a987dc3355949814fa1b788c5ba932d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/TbcPadding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/TbcPadding.cs new file mode 100644 index 00000000..0ed6edcd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/TbcPadding.cs @@ -0,0 +1,83 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings +{ + + /// A padder that adds Trailing-Bit-Compliment padding to a block. + ///

+ /// This padding pads the block out compliment of the last bit + /// of the plain text. + ///

+ ///
+ public class TbcPadding + : IBlockCipherPadding + { + /// Return the name of the algorithm the cipher implements. + /// the name of the algorithm the cipher implements. + /// + public string PaddingName + { + get { return "TBC"; } + } + + /// Initialise the padder. + /// - a SecureRandom if available. + /// + public virtual void Init(SecureRandom random) + { + // nothing to do. + } + + /// add the pad bytes to the passed in block, returning the + /// number of bytes added. + ///

+ /// Note: this assumes that the last block of plain text is always + /// passed to it inside in. i.e. if inOff is zero, indicating the + /// entire block is to be overwritten with padding the value of in + /// should be the same as the last block of plain text. + ///

+ ///
+ public virtual int AddPadding(byte[] input, int inOff) + { + int count = input.Length - inOff; + byte code; + + if (inOff > 0) + { + code = (byte)((input[inOff - 1] & 0x01) == 0?0xff:0x00); + } + else + { + code = (byte)((input[input.Length - 1] & 0x01) == 0?0xff:0x00); + } + + while (inOff < input.Length) + { + input[inOff] = code; + inOff++; + } + + return count; + } + + /// return the number of pad bytes present in the block. + public virtual int PadCount(byte[] input) + { + byte code = input[input.Length - 1]; + + int index = input.Length - 1; + while (index > 0 && input[index - 1] == code) + { + index--; + } + + return input.Length - index; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/TbcPadding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/TbcPadding.cs.meta new file mode 100644 index 00000000..53ee546b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/TbcPadding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee3e7e57e20d50c41b6f9cc4f31b6b69 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/X923Padding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/X923Padding.cs new file mode 100644 index 00000000..00296b16 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/X923Padding.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings +{ + /** + * A padder that adds X9.23 padding to a block - if a SecureRandom is + * passed in random padding is assumed, otherwise padding with zeros is used. + */ + public class X923Padding + : IBlockCipherPadding + { + private SecureRandom random; + + /** + * Initialise the padder. + * + * @param random a SecureRandom if one is available. + */ + public void Init( + SecureRandom random) + { + this.random = random; + } + + /** + * Return the name of the algorithm the cipher implements. + * + * @return the name of the algorithm the cipher implements. + */ + public string PaddingName + { + get { return "X9.23"; } + } + + /** + * add the pad bytes to the passed in block, returning the + * number of bytes added. + */ + public int AddPadding( + byte[] input, + int inOff) + { + byte code = (byte)(input.Length - inOff); + + while (inOff < input.Length - 1) + { + if (random == null) + { + input[inOff] = 0; + } + else + { + input[inOff] = (byte)random.NextInt(); + } + inOff++; + } + + input[inOff] = code; + + return code; + } + + /** + * return the number of pad bytes present in the block. + */ + public int PadCount( + byte[] input) + { + int count = input[input.Length - 1] & 0xff; + + if (count > input.Length) + { + throw new InvalidCipherTextException("pad block corrupted"); + } + + return count; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/X923Padding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/X923Padding.cs.meta new file mode 100644 index 00000000..7b01661a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/X923Padding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7c0da47832981c243887ec0245c7c943 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ZeroBytePadding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ZeroBytePadding.cs new file mode 100644 index 00000000..3033aef6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ZeroBytePadding.cs @@ -0,0 +1,72 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings +{ + + /// A padder that adds Null byte padding to a block. + public class ZeroBytePadding : IBlockCipherPadding + { + /// Return the name of the algorithm the cipher implements. + /// + /// + /// the name of the algorithm the cipher implements. + /// + public string PaddingName + { + get { return "ZeroBytePadding"; } + } + + /// Initialise the padder. + /// + /// + /// - a SecureRandom if available. + /// + public void Init(SecureRandom random) + { + // nothing to do. + } + + /// add the pad bytes to the passed in block, returning the + /// number of bytes added. + /// + public int AddPadding( + byte[] input, + int inOff) + { + int added = (input.Length - inOff); + + while (inOff < input.Length) + { + input[inOff] = (byte) 0; + inOff++; + } + + return added; + } + + /// return the number of pad bytes present in the block. + public int PadCount( + byte[] input) + { + int count = input.Length; + + while (count > 0) + { + if (input[count - 1] != 0) + { + break; + } + + count--; + } + + return input.Length - count; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ZeroBytePadding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ZeroBytePadding.cs.meta new file mode 100644 index 00000000..5962f1e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/paddings/ZeroBytePadding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: efef1293185559b4e9313cbecabb9d7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters.meta new file mode 100644 index 00000000..882a1c86 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e16c007b18245954f945dea9b529da6f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/AEADParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/AEADParameters.cs new file mode 100644 index 00000000..f401add3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/AEADParameters.cs @@ -0,0 +1,69 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class AeadParameters + : ICipherParameters + { + private readonly byte[] associatedText; + private readonly byte[] nonce; + private readonly KeyParameter key; + private readonly int macSize; + + /** + * Base constructor. + * + * @param key key to be used by underlying cipher + * @param macSize macSize in bits + * @param nonce nonce to be used + */ + public AeadParameters(KeyParameter key, int macSize, byte[] nonce) + : this(key, macSize, nonce, null) + { + } + + /** + * Base constructor. + * + * @param key key to be used by underlying cipher + * @param macSize macSize in bits + * @param nonce nonce to be used + * @param associatedText associated text, if any + */ + public AeadParameters( + KeyParameter key, + int macSize, + byte[] nonce, + byte[] associatedText) + { + this.key = key; + this.nonce = nonce; + this.macSize = macSize; + this.associatedText = associatedText; + } + + public virtual KeyParameter Key + { + get { return key; } + } + + public virtual int MacSize + { + get { return macSize; } + } + + public virtual byte[] GetAssociatedText() + { + return associatedText; + } + + public virtual byte[] GetNonce() + { + return nonce; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/AEADParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/AEADParameters.cs.meta new file mode 100644 index 00000000..1587c907 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/AEADParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ab1e4d400f1fe643a1fc969f83989a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/CcmParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/CcmParameters.cs new file mode 100644 index 00000000..9d3588d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/CcmParameters.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + [Obsolete("Use AeadParameters")] + public class CcmParameters + : AeadParameters + { + /** + * Base constructor. + * + * @param key key to be used by underlying cipher + * @param macSize macSize in bits + * @param nonce nonce to be used + * @param associatedText associated text, if any + */ + public CcmParameters( + KeyParameter key, + int macSize, + byte[] nonce, + byte[] associatedText) + : base(key, macSize, nonce, associatedText) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/CcmParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/CcmParameters.cs.meta new file mode 100644 index 00000000..d564d769 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/CcmParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 467dc2af6a94561478578aa36156b2d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyGenerationParameters.cs new file mode 100644 index 00000000..8076b692 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyGenerationParameters.cs @@ -0,0 +1,35 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DHKeyGenerationParameters + : KeyGenerationParameters + { + private readonly DHParameters parameters; + + public DHKeyGenerationParameters( + SecureRandom random, + DHParameters parameters) + : base(random, GetStrength(parameters)) + { + this.parameters = parameters; + } + + public DHParameters Parameters + { + get { return parameters; } + } + + internal static int GetStrength( + DHParameters parameters) + { + return parameters.L != 0 ? parameters.L : parameters.P.BitLength; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyGenerationParameters.cs.meta new file mode 100644 index 00000000..c4d214ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3543cbf42d2468469b628ec9921121f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyParameters.cs new file mode 100644 index 00000000..afeef1d0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyParameters.cs @@ -0,0 +1,80 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DHKeyParameters + : AsymmetricKeyParameter + { + private readonly DHParameters parameters; + private readonly DerObjectIdentifier algorithmOid; + + protected DHKeyParameters( + bool isPrivate, + DHParameters parameters) + : this(isPrivate, parameters, PkcsObjectIdentifiers.DhKeyAgreement) + { + } + + protected DHKeyParameters( + bool isPrivate, + DHParameters parameters, + DerObjectIdentifier algorithmOid) + : base(isPrivate) + { + // TODO Should we allow parameters to be null? + this.parameters = parameters; + this.algorithmOid = algorithmOid; + } + + public DHParameters Parameters + { + get { return parameters; } + } + + public DerObjectIdentifier AlgorithmOid + { + get { return algorithmOid; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + DHKeyParameters other = obj as DHKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + DHKeyParameters other) + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(parameters, other.parameters) + && base.Equals(other); + } + + public override int GetHashCode() + { + int hc = base.GetHashCode(); + + if (parameters != null) + { + hc ^= parameters.GetHashCode(); + } + + return hc; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyParameters.cs.meta new file mode 100644 index 00000000..33d58615 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b184706d42c626541b7a830e2f1eb396 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHParameters.cs new file mode 100644 index 00000000..4f8d592c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHParameters.cs @@ -0,0 +1,189 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DHParameters + : ICipherParameters + { + private const int DefaultMinimumLength = 160; + + private readonly BigInteger p, g, q, j; + private readonly int m, l; + private readonly DHValidationParameters validation; + + private static int GetDefaultMParam( + int lParam) + { + if (lParam == 0) + return DefaultMinimumLength; + + return System.Math.Min(lParam, DefaultMinimumLength); + } + + public DHParameters( + BigInteger p, + BigInteger g) + : this(p, g, null, 0) + { + } + + public DHParameters( + BigInteger p, + BigInteger g, + BigInteger q) + : this(p, g, q, 0) + { + } + + public DHParameters( + BigInteger p, + BigInteger g, + BigInteger q, + int l) + : this(p, g, q, GetDefaultMParam(l), l, null, null) + { + } + + public DHParameters( + BigInteger p, + BigInteger g, + BigInteger q, + int m, + int l) + : this(p, g, q, m, l, null, null) + { + } + + public DHParameters( + BigInteger p, + BigInteger g, + BigInteger q, + BigInteger j, + DHValidationParameters validation) + : this(p, g, q, DefaultMinimumLength, 0, j, validation) + { + } + + public DHParameters( + BigInteger p, + BigInteger g, + BigInteger q, + int m, + int l, + BigInteger j, + DHValidationParameters validation) + { + if (p == null) + throw new ArgumentNullException("p"); + if (g == null) + throw new ArgumentNullException("g"); + if (!p.TestBit(0)) + throw new ArgumentException("field must be an odd prime", "p"); + if (g.CompareTo(BigInteger.Two) < 0 + || g.CompareTo(p.Subtract(BigInteger.Two)) > 0) + throw new ArgumentException("generator must in the range [2, p - 2]", "g"); + if (q != null && q.BitLength >= p.BitLength) + throw new ArgumentException("q too big to be a factor of (p-1)", "q"); + if (m >= p.BitLength) + throw new ArgumentException("m value must be < bitlength of p", "m"); + if (l != 0) + { + // TODO Check this against the Java version, which has 'l > p.BitLength' here + if (l >= p.BitLength) + throw new ArgumentException("when l value specified, it must be less than bitlength(p)", "l"); + if (l < m) + throw new ArgumentException("when l value specified, it may not be less than m value", "l"); + } + if (j != null && j.CompareTo(BigInteger.Two) < 0) + throw new ArgumentException("subgroup factor must be >= 2", "j"); + + // TODO If q, j both provided, validate p = jq + 1 ? + + this.p = p; + this.g = g; + this.q = q; + this.m = m; + this.l = l; + this.j = j; + this.validation = validation; + } + + public BigInteger P + { + get { return p; } + } + + public BigInteger G + { + get { return g; } + } + + public BigInteger Q + { + get { return q; } + } + + public BigInteger J + { + get { return j; } + } + + /// The minimum bitlength of the private value. + public int M + { + get { return m; } + } + + /// The bitlength of the private value. + public int L + { + get { return l; } + } + + public DHValidationParameters ValidationParameters + { + get { return validation; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + DHParameters other = obj as DHParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected virtual bool Equals( + DHParameters other) + { + return p.Equals(other.p) + && g.Equals(other.g) + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(q, other.q); + } + + public override int GetHashCode() + { + int hc = p.GetHashCode() ^ g.GetHashCode(); + + if (q != null) + { + hc ^= q.GetHashCode(); + } + + return hc; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHParameters.cs.meta new file mode 100644 index 00000000..d4d69746 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf264f19a21f3204cb815a491eaf7891 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPrivateKeyParameters.cs new file mode 100644 index 00000000..6aeaaf22 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPrivateKeyParameters.cs @@ -0,0 +1,64 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DHPrivateKeyParameters + : DHKeyParameters + { + private readonly BigInteger x; + + public DHPrivateKeyParameters( + BigInteger x, + DHParameters parameters) + : base(true, parameters) + { + this.x = x; + } + + public DHPrivateKeyParameters( + BigInteger x, + DHParameters parameters, + DerObjectIdentifier algorithmOid) + : base(true, parameters, algorithmOid) + { + this.x = x; + } + + public BigInteger X + { + get { return x; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + DHPrivateKeyParameters other = obj as DHPrivateKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + DHPrivateKeyParameters other) + { + return x.Equals(other.x) && base.Equals(other); + } + + public override int GetHashCode() + { + return x.GetHashCode() ^ base.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPrivateKeyParameters.cs.meta new file mode 100644 index 00000000..ae6b4338 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0fdd4d67cf6500a4bb5dfe324c483f9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPublicKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPublicKeyParameters.cs new file mode 100644 index 00000000..d14c856b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPublicKeyParameters.cs @@ -0,0 +1,83 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DHPublicKeyParameters + : DHKeyParameters + { + private static BigInteger Validate(BigInteger y, DHParameters dhParams) + { + if (y == null) + throw new ArgumentNullException("y"); + + // TLS check + if (y.CompareTo(BigInteger.Two) < 0 || y.CompareTo(dhParams.P.Subtract(BigInteger.Two)) > 0) + throw new ArgumentException("invalid DH public key", "y"); + + // we can't validate without Q. + if (dhParams.Q != null + && !y.ModPow(dhParams.Q, dhParams.P).Equals(BigInteger.One)) + { + throw new ArgumentException("y value does not appear to be in correct group", "y"); + } + + return y; + } + + private readonly BigInteger y; + + public DHPublicKeyParameters( + BigInteger y, + DHParameters parameters) + : base(false, parameters) + { + this.y = Validate(y, parameters); + } + + public DHPublicKeyParameters( + BigInteger y, + DHParameters parameters, + DerObjectIdentifier algorithmOid) + : base(false, parameters, algorithmOid) + { + this.y = Validate(y, parameters); + } + + public virtual BigInteger Y + { + get { return y; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + DHPublicKeyParameters other = obj as DHPublicKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + DHPublicKeyParameters other) + { + return y.Equals(other.y) && base.Equals(other); + } + + public override int GetHashCode() + { + return y.GetHashCode() ^ base.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPublicKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPublicKeyParameters.cs.meta new file mode 100644 index 00000000..d11fcd3f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHPublicKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dcdcc5dd36103a347803778660e62bac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHValidationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHValidationParameters.cs new file mode 100644 index 00000000..35f12007 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHValidationParameters.cs @@ -0,0 +1,63 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DHValidationParameters + { + private readonly byte[] seed; + private readonly int counter; + + public DHValidationParameters( + byte[] seed, + int counter) + { + if (seed == null) + throw new ArgumentNullException("seed"); + + this.seed = (byte[]) seed.Clone(); + this.counter = counter; + } + + public byte[] GetSeed() + { + return (byte[]) seed.Clone(); + } + + public int Counter + { + get { return counter; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + DHValidationParameters other = obj as DHValidationParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + DHValidationParameters other) + { + return counter == other.counter + && Arrays.AreEqual(this.seed, other.seed); + } + + public override int GetHashCode() + { + return counter.GetHashCode() ^ Arrays.GetHashCode(seed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHValidationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHValidationParameters.cs.meta new file mode 100644 index 00000000..3b59ad5b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DHValidationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bcfe09e6364f2824ea27955a589ae4b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DSAParameterGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DSAParameterGenerationParameters.cs new file mode 100644 index 00000000..97bd2db9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DSAParameterGenerationParameters.cs @@ -0,0 +1,78 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DsaParameterGenerationParameters + { + public const int DigitalSignatureUsage = 1; + public const int KeyEstablishmentUsage = 2; + + private readonly int l; + private readonly int n; + private readonly int certainty; + private readonly SecureRandom random; + private readonly int usageIndex; + + /** + * Construct without a usage index, this will do a random construction of G. + * + * @param L desired length of prime P in bits (the effective key size). + * @param N desired length of prime Q in bits. + * @param certainty certainty level for prime number generation. + * @param random the source of randomness to use. + */ + public DsaParameterGenerationParameters(int L, int N, int certainty, SecureRandom random) + : this(L, N, certainty, random, -1) + { + } + + /** + * Construct for a specific usage index - this has the effect of using verifiable canonical generation of G. + * + * @param L desired length of prime P in bits (the effective key size). + * @param N desired length of prime Q in bits. + * @param certainty certainty level for prime number generation. + * @param random the source of randomness to use. + * @param usageIndex a valid usage index. + */ + public DsaParameterGenerationParameters(int L, int N, int certainty, SecureRandom random, int usageIndex) + { + this.l = L; + this.n = N; + this.certainty = certainty; + this.random = random; + this.usageIndex = usageIndex; + } + + public virtual int L + { + get { return l; } + } + + public virtual int N + { + get { return n; } + } + + public virtual int UsageIndex + { + get { return usageIndex; } + } + + public virtual int Certainty + { + get { return certainty; } + } + + public virtual SecureRandom Random + { + get { return random; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DSAParameterGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DSAParameterGenerationParameters.cs.meta new file mode 100644 index 00000000..41a2240f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DSAParameterGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5bae2087e40f1ca4497d9a252aff83c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesEdeParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesEdeParameters.cs new file mode 100644 index 00000000..cc3eafc0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesEdeParameters.cs @@ -0,0 +1,144 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DesEdeParameters + : DesParameters + { + /* + * DES-EDE Key length in bytes. + */ + public const int DesEdeKeyLength = 24; + + private static byte[] FixKey( + byte[] key, + int keyOff, + int keyLen) + { + byte[] tmp = new byte[24]; + + switch (keyLen) + { + case 16: + Array.Copy(key, keyOff, tmp, 0, 16); + Array.Copy(key, keyOff, tmp, 16, 8); + break; + case 24: + Array.Copy(key, keyOff, tmp, 0, 24); + break; + default: + throw new ArgumentException("Bad length for DESede key: " + keyLen, "keyLen"); + } + + if (IsWeakKey(tmp)) + throw new ArgumentException("attempt to create weak DESede key"); + + return tmp; + } + + public DesEdeParameters( + byte[] key) + : base(FixKey(key, 0, key.Length)) + { + } + + public DesEdeParameters( + byte[] key, + int keyOff, + int keyLen) + : base(FixKey(key, keyOff, keyLen)) + { + } + + /** + * return true if the passed in key is a DES-EDE weak key. + * + * @param key bytes making up the key + * @param offset offset into the byte array the key starts at + * @param length number of bytes making up the key + */ + public static bool IsWeakKey( + byte[] key, + int offset, + int length) + { + for (int i = offset; i < length; i += DesKeyLength) + { + if (DesParameters.IsWeakKey(key, i)) + { + return true; + } + } + + return false; + } + + /** + * return true if the passed in key is a DES-EDE weak key. + * + * @param key bytes making up the key + * @param offset offset into the byte array the key starts at + */ + public static new bool IsWeakKey( + byte[] key, + int offset) + { + return IsWeakKey(key, offset, key.Length - offset); + } + + public static new bool IsWeakKey( + byte[] key) + { + return IsWeakKey(key, 0, key.Length); + } + + /** + * return true if the passed in key is a real 2/3 part DES-EDE key. + * + * @param key bytes making up the key + * @param offset offset into the byte array the key starts at + */ + public static bool IsRealEdeKey(byte[] key, int offset) + { + return key.Length == 16 ? IsReal2Key(key, offset) : IsReal3Key(key, offset); + } + + /** + * return true if the passed in key is a real 2 part DES-EDE key. + * + * @param key bytes making up the key + * @param offset offset into the byte array the key starts at + */ + public static bool IsReal2Key(byte[] key, int offset) + { + bool isValid = false; + for (int i = offset; i != offset + 8; i++) + { + isValid |= (key[i] != key[i + 8]); + } + return isValid; + } + + /** + * return true if the passed in key is a real 3 part DES-EDE key. + * + * @param key bytes making up the key + * @param offset offset into the byte array the key starts at + */ + public static bool IsReal3Key(byte[] key, int offset) + { + bool diff12 = false, diff13 = false, diff23 = false; + for (int i = offset; i != offset + 8; i++) + { + diff12 |= (key[i] != key[i + 8]); + diff13 |= (key[i] != key[i + 16]); + diff23 |= (key[i + 8] != key[i + 16]); + } + return diff12 && diff13 && diff23; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesEdeParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesEdeParameters.cs.meta new file mode 100644 index 00000000..10eb11a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesEdeParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4749e39c2006221438acbd5317e3f77c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesParameters.cs new file mode 100644 index 00000000..a43b0132 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesParameters.cs @@ -0,0 +1,143 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DesParameters + : KeyParameter + { + public DesParameters( + byte[] key) + : base(key) + { + if (IsWeakKey(key)) + throw new ArgumentException("attempt to create weak DES key"); + } + + public DesParameters( + byte[] key, + int keyOff, + int keyLen) + : base(key, keyOff, keyLen) + { + if (IsWeakKey(key, keyOff)) + throw new ArgumentException("attempt to create weak DES key"); + } + + /* + * DES Key Length in bytes. + */ + public const int DesKeyLength = 8; + + /* + * Table of weak and semi-weak keys taken from Schneier pp281 + */ + private const int N_DES_WEAK_KEYS = 16; + + private static readonly byte[] DES_weak_keys = + { + /* weak keys */ + (byte)0x01,(byte)0x01,(byte)0x01,(byte)0x01, (byte)0x01,(byte)0x01,(byte)0x01,(byte)0x01, + (byte)0x1f,(byte)0x1f,(byte)0x1f,(byte)0x1f, (byte)0x0e,(byte)0x0e,(byte)0x0e,(byte)0x0e, + (byte)0xe0,(byte)0xe0,(byte)0xe0,(byte)0xe0, (byte)0xf1,(byte)0xf1,(byte)0xf1,(byte)0xf1, + (byte)0xfe,(byte)0xfe,(byte)0xfe,(byte)0xfe, (byte)0xfe,(byte)0xfe,(byte)0xfe,(byte)0xfe, + + /* semi-weak keys */ + (byte)0x01,(byte)0xfe,(byte)0x01,(byte)0xfe, (byte)0x01,(byte)0xfe,(byte)0x01,(byte)0xfe, + (byte)0x1f,(byte)0xe0,(byte)0x1f,(byte)0xe0, (byte)0x0e,(byte)0xf1,(byte)0x0e,(byte)0xf1, + (byte)0x01,(byte)0xe0,(byte)0x01,(byte)0xe0, (byte)0x01,(byte)0xf1,(byte)0x01,(byte)0xf1, + (byte)0x1f,(byte)0xfe,(byte)0x1f,(byte)0xfe, (byte)0x0e,(byte)0xfe,(byte)0x0e,(byte)0xfe, + (byte)0x01,(byte)0x1f,(byte)0x01,(byte)0x1f, (byte)0x01,(byte)0x0e,(byte)0x01,(byte)0x0e, + (byte)0xe0,(byte)0xfe,(byte)0xe0,(byte)0xfe, (byte)0xf1,(byte)0xfe,(byte)0xf1,(byte)0xfe, + (byte)0xfe,(byte)0x01,(byte)0xfe,(byte)0x01, (byte)0xfe,(byte)0x01,(byte)0xfe,(byte)0x01, + (byte)0xe0,(byte)0x1f,(byte)0xe0,(byte)0x1f, (byte)0xf1,(byte)0x0e,(byte)0xf1,(byte)0x0e, + (byte)0xe0,(byte)0x01,(byte)0xe0,(byte)0x01, (byte)0xf1,(byte)0x01,(byte)0xf1,(byte)0x01, + (byte)0xfe,(byte)0x1f,(byte)0xfe,(byte)0x1f, (byte)0xfe,(byte)0x0e,(byte)0xfe,(byte)0x0e, + (byte)0x1f,(byte)0x01,(byte)0x1f,(byte)0x01, (byte)0x0e,(byte)0x01,(byte)0x0e,(byte)0x01, + (byte)0xfe,(byte)0xe0,(byte)0xfe,(byte)0xe0, (byte)0xfe,(byte)0xf1,(byte)0xfe,(byte)0xf1 + }; + + /** + * DES has 16 weak keys. This method will check + * if the given DES key material is weak or semi-weak. + * Key material that is too short is regarded as weak. + *

+ * See "Applied + * Cryptography" by Bruce Schneier for more information. + *

+ * @return true if the given DES key material is weak or semi-weak, + * false otherwise. + */ + public static bool IsWeakKey( + byte[] key, + int offset) + { + if (key.Length - offset < DesKeyLength) + throw new ArgumentException("key material too short."); + + //nextkey: + for (int i = 0; i < N_DES_WEAK_KEYS; i++) + { + bool unmatch = false; + for (int j = 0; j < DesKeyLength; j++) + { + if (key[j + offset] != DES_weak_keys[i * DesKeyLength + j]) + { + //continue nextkey; + unmatch = true; + break; + } + } + + if (!unmatch) + { + return true; + } + } + + return false; + } + + public static bool IsWeakKey( + byte[] key) + { + return IsWeakKey(key, 0); + } + + public static byte SetOddParity(byte b) + { + uint parity = b ^ 1U; + parity ^= (parity >> 4); + parity ^= (parity >> 2); + parity ^= (parity >> 1); + parity &= 1U; + + return (byte)(b ^ parity); + } + + /** + * DES Keys use the LSB as the odd parity bit. This can + * be used to check for corrupt keys. + * + * @param bytes the byte array to set the parity on. + */ + public static void SetOddParity(byte[] bytes) + { + for (int i = 0; i < bytes.Length; i++) + { + bytes[i] = SetOddParity(bytes[i]); + } + } + + public static void SetOddParity(byte[] bytes, int off, int len) + { + for (int i = 0; i < len; i++) + { + bytes[off + i] = SetOddParity(bytes[off + i]); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesParameters.cs.meta new file mode 100644 index 00000000..08c231d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DesParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b00a12c88d7bcc248b4ca2f26e3aa06d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyGenerationParameters.cs new file mode 100644 index 00000000..d94c2edb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyGenerationParameters.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DsaKeyGenerationParameters + : KeyGenerationParameters + { + private readonly DsaParameters parameters; + + public DsaKeyGenerationParameters( + SecureRandom random, + DsaParameters parameters) + : base(random, parameters.P.BitLength - 1) + { + this.parameters = parameters; + } + + public DsaParameters Parameters + { + get { return parameters; } + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyGenerationParameters.cs.meta new file mode 100644 index 00000000..52c08ac3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 276581811002f3e4c9cb17ec0a51d092 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyParameters.cs new file mode 100644 index 00000000..6511a09d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyParameters.cs @@ -0,0 +1,63 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public abstract class DsaKeyParameters + : AsymmetricKeyParameter + { + private readonly DsaParameters parameters; + + protected DsaKeyParameters( + bool isPrivate, + DsaParameters parameters) + : base(isPrivate) + { + // Note: parameters may be null + this.parameters = parameters; + } + + public DsaParameters Parameters + { + get { return parameters; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + DsaKeyParameters other = obj as DsaKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + DsaKeyParameters other) + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(parameters, other.parameters) + && base.Equals(other); + } + + public override int GetHashCode() + { + int hc = base.GetHashCode(); + + if (parameters != null) + { + hc ^= parameters.GetHashCode(); + } + + return hc; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyParameters.cs.meta new file mode 100644 index 00000000..89884033 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f1017d8a70458545aa4e27a696f2df5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaParameters.cs new file mode 100644 index 00000000..6006e691 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaParameters.cs @@ -0,0 +1,89 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DsaParameters + : ICipherParameters + { + private readonly BigInteger p, q , g; + private readonly DsaValidationParameters validation; + + public DsaParameters( + BigInteger p, + BigInteger q, + BigInteger g) + : this(p, q, g, null) + { + } + + public DsaParameters( + BigInteger p, + BigInteger q, + BigInteger g, + DsaValidationParameters parameters) + { + if (p == null) + throw new ArgumentNullException("p"); + if (q == null) + throw new ArgumentNullException("q"); + if (g == null) + throw new ArgumentNullException("g"); + + this.p = p; + this.q = q; + this.g = g; + this.validation = parameters; + } + + public BigInteger P + { + get { return p; } + } + + public BigInteger Q + { + get { return q; } + } + + public BigInteger G + { + get { return g; } + } + + public DsaValidationParameters ValidationParameters + { + get { return validation; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + DsaParameters other = obj as DsaParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + DsaParameters other) + { + return p.Equals(other.p) && q.Equals(other.q) && g.Equals(other.g); + } + + public override int GetHashCode() + { + return p.GetHashCode() ^ q.GetHashCode() ^ g.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaParameters.cs.meta new file mode 100644 index 00000000..da0fc5dd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee680943739e3ab4abee72f41f4cb6e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPrivateKeyParameters.cs new file mode 100644 index 00000000..b7e91eeb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPrivateKeyParameters.cs @@ -0,0 +1,57 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DsaPrivateKeyParameters + : DsaKeyParameters + { + private readonly BigInteger x; + + public DsaPrivateKeyParameters( + BigInteger x, + DsaParameters parameters) + : base(true, parameters) + { + if (x == null) + throw new ArgumentNullException("x"); + + this.x = x; + } + + public BigInteger X + { + get { return x; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + DsaPrivateKeyParameters other = obj as DsaPrivateKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + DsaPrivateKeyParameters other) + { + return x.Equals(other.x) && base.Equals(other); + } + + public override int GetHashCode() + { + return x.GetHashCode() ^ base.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPrivateKeyParameters.cs.meta new file mode 100644 index 00000000..7a083fa0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4f0cb0e77323ee4b94fdb6249c169d1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPublicKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPublicKeyParameters.cs new file mode 100644 index 00000000..308ab13c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPublicKeyParameters.cs @@ -0,0 +1,72 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DsaPublicKeyParameters + : DsaKeyParameters + { + private static BigInteger Validate(BigInteger y, DsaParameters parameters) + { + // we can't validate without params, fortunately we can't use the key either... + if (parameters != null) + { + if (y.CompareTo(BigInteger.Two) < 0 + || y.CompareTo(parameters.P.Subtract(BigInteger.Two)) > 0 + || !y.ModPow(parameters.Q, parameters.P).Equals(BigInteger.One)) + { + throw new ArgumentException("y value does not appear to be in correct group"); + } + } + + return y; + } + + private readonly BigInteger y; + + public DsaPublicKeyParameters( + BigInteger y, + DsaParameters parameters) + : base(false, parameters) + { + if (y == null) + throw new ArgumentNullException("y"); + + this.y = Validate(y, parameters); + } + + public BigInteger Y + { + get { return y; } + } + + public override bool Equals(object obj) + { + if (obj == this) + return true; + + DsaPublicKeyParameters other = obj as DsaPublicKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + DsaPublicKeyParameters other) + { + return y.Equals(other.y) && base.Equals(other); + } + + public override int GetHashCode() + { + return y.GetHashCode() ^ base.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPublicKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPublicKeyParameters.cs.meta new file mode 100644 index 00000000..8ff9118e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaPublicKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1afe3462c21af6a4ca12ef6e3169445f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaValidationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaValidationParameters.cs new file mode 100644 index 00000000..a4bc0e30 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaValidationParameters.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class DsaValidationParameters + { + private readonly byte[] seed; + private readonly int counter; + private readonly int usageIndex; + + public DsaValidationParameters(byte[] seed, int counter) + : this(seed, counter, -1) + { + } + + public DsaValidationParameters( + byte[] seed, + int counter, + int usageIndex) + { + if (seed == null) + throw new ArgumentNullException("seed"); + + this.seed = (byte[]) seed.Clone(); + this.counter = counter; + this.usageIndex = usageIndex; + } + + public virtual byte[] GetSeed() + { + return (byte[]) seed.Clone(); + } + + public virtual int Counter + { + get { return counter; } + } + + public virtual int UsageIndex + { + get { return usageIndex; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + DsaValidationParameters other = obj as DsaValidationParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected virtual bool Equals( + DsaValidationParameters other) + { + return counter == other.counter + && Arrays.AreEqual(seed, other.seed); + } + + public override int GetHashCode() + { + return counter.GetHashCode() ^ Arrays.GetHashCode(seed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaValidationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaValidationParameters.cs.meta new file mode 100644 index 00000000..d7d330a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/DsaValidationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 66dbc197d770cc74da7061f3a853ea1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECDomainParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECDomainParameters.cs new file mode 100644 index 00000000..b24bace7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECDomainParameters.cs @@ -0,0 +1,152 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ECDomainParameters + { + internal ECCurve curve; + internal byte[] seed; + internal ECPoint g; + internal BigInteger n; + internal BigInteger h; + internal BigInteger hInv; + + public ECDomainParameters( + ECCurve curve, + ECPoint g, + BigInteger n) + : this(curve, g, n, BigInteger.One, null) + { + } + + public ECDomainParameters( + ECCurve curve, + ECPoint g, + BigInteger n, + BigInteger h) + : this(curve, g, n, h, null) + { + } + + public ECDomainParameters( + ECCurve curve, + ECPoint g, + BigInteger n, + BigInteger h, + byte[] seed) + { + if (curve == null) + throw new ArgumentNullException("curve"); + if (g == null) + throw new ArgumentNullException("g"); + if (n == null) + throw new ArgumentNullException("n"); + // we can't check for h == null here as h is optional in X9.62 as it is not required for ECDSA + + this.curve = curve; + this.g = Validate(curve, g); + this.n = n; + this.h = h; + this.seed = Arrays.Clone(seed); + } + + public ECCurve Curve + { + get { return curve; } + } + + public ECPoint G + { + get { return g; } + } + + public BigInteger N + { + get { return n; } + } + + public BigInteger H + { + get { return h; } + } + + public BigInteger HInv + { + get + { + lock (this) + { + if (hInv == null) + { + hInv = h.ModInverse(n); + } + return hInv; + } + } + } + + public byte[] GetSeed() + { + return Arrays.Clone(seed); + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + ECDomainParameters other = obj as ECDomainParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected virtual bool Equals( + ECDomainParameters other) + { + return curve.Equals(other.curve) + && g.Equals(other.g) + && n.Equals(other.n) + && h.Equals(other.h); + } + + public override int GetHashCode() + { + int hc = curve.GetHashCode(); + hc *= 37; + hc ^= g.GetHashCode(); + hc *= 37; + hc ^= n.GetHashCode(); + hc *= 37; + hc ^= h.GetHashCode(); + return hc; + } + + internal static ECPoint Validate(ECCurve c, ECPoint q) + { + if (q == null) + throw new ArgumentException("Point has null value", "q"); + + q = ECAlgorithms.ImportPoint(c, q).Normalize(); + + if (q.IsInfinity) + throw new ArgumentException("Point at infinity", "q"); + + if (!q.IsValid()) + throw new ArgumentException("Point not on curve", "q"); + + return q; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECDomainParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECDomainParameters.cs.meta new file mode 100644 index 00000000..9ae6fef6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECDomainParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3beb4f5cf7c45294aae379ff966dee7f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyGenerationParameters.cs new file mode 100644 index 00000000..7c95b7d0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyGenerationParameters.cs @@ -0,0 +1,45 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ECKeyGenerationParameters + : KeyGenerationParameters + { + private readonly ECDomainParameters domainParams; + private readonly DerObjectIdentifier publicKeyParamSet; + + public ECKeyGenerationParameters( + ECDomainParameters domainParameters, + SecureRandom random) + : base(random, domainParameters.N.BitLength) + { + this.domainParams = domainParameters; + } + + public ECKeyGenerationParameters( + DerObjectIdentifier publicKeyParamSet, + SecureRandom random) + : this(ECKeyParameters.LookupParameters(publicKeyParamSet), random) + { + this.publicKeyParamSet = publicKeyParamSet; + } + + public ECDomainParameters DomainParameters + { + get { return domainParams; } + } + + public DerObjectIdentifier PublicKeyParamSet + { + get { return publicKeyParamSet; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyGenerationParameters.cs.meta new file mode 100644 index 00000000..75934100 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab3ecd7ab43e33a458ea35a383957a07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyParameters.cs new file mode 100644 index 00000000..50badba6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyParameters.cs @@ -0,0 +1,140 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public abstract class ECKeyParameters + : AsymmetricKeyParameter + { + private static readonly string[] algorithms = { "EC", "ECDSA", "ECDH", "ECDHC", "ECGOST3410", "ECMQV" }; + + private readonly string algorithm; + private readonly ECDomainParameters parameters; + private readonly DerObjectIdentifier publicKeyParamSet; + + protected ECKeyParameters( + string algorithm, + bool isPrivate, + ECDomainParameters parameters) + : base(isPrivate) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + if (parameters == null) + throw new ArgumentNullException("parameters"); + + this.algorithm = VerifyAlgorithmName(algorithm); + this.parameters = parameters; + } + + protected ECKeyParameters( + string algorithm, + bool isPrivate, + DerObjectIdentifier publicKeyParamSet) + : base(isPrivate) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + if (publicKeyParamSet == null) + throw new ArgumentNullException("publicKeyParamSet"); + + this.algorithm = VerifyAlgorithmName(algorithm); + this.parameters = LookupParameters(publicKeyParamSet); + this.publicKeyParamSet = publicKeyParamSet; + } + + public string AlgorithmName + { + get { return algorithm; } + } + + public ECDomainParameters Parameters + { + get { return parameters; } + } + + public DerObjectIdentifier PublicKeyParamSet + { + get { return publicKeyParamSet; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + ECDomainParameters other = obj as ECDomainParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + ECKeyParameters other) + { + return parameters.Equals(other.parameters) && base.Equals(other); + } + + public override int GetHashCode() + { + return parameters.GetHashCode() ^ base.GetHashCode(); + } + + internal ECKeyGenerationParameters CreateKeyGenerationParameters( + SecureRandom random) + { + if (publicKeyParamSet != null) + { + return new ECKeyGenerationParameters(publicKeyParamSet, random); + } + + return new ECKeyGenerationParameters(parameters, random); + } + + internal static string VerifyAlgorithmName(string algorithm) + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + if (Array.IndexOf(algorithms, algorithm, 0, algorithms.Length) < 0) + throw new ArgumentException("unrecognised algorithm: " + algorithm, "algorithm"); + return upper; + } + + internal static ECDomainParameters LookupParameters( + DerObjectIdentifier publicKeyParamSet) + { + if (publicKeyParamSet == null) + throw new ArgumentNullException("publicKeyParamSet"); + + ECDomainParameters p = ECGost3410NamedCurves.GetByOid(publicKeyParamSet); + + if (p == null) + { + X9ECParameters x9 = ECKeyPairGenerator.FindECCurveByOid(publicKeyParamSet); + + if (x9 == null) + { + throw new ArgumentException("OID is not a valid public key parameter set", "publicKeyParamSet"); + } + + p = new ECDomainParameters(x9.Curve, x9.G, x9.N, x9.H, x9.GetSeed()); + } + + return p; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyParameters.cs.meta new file mode 100644 index 00000000..3bb8bb83 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7082d8fbbed75824585e4b8956c19af4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPrivateKeyParameters.cs new file mode 100644 index 00000000..a909e412 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPrivateKeyParameters.cs @@ -0,0 +1,91 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Globalization; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ECPrivateKeyParameters + : ECKeyParameters + { + private readonly BigInteger d; + + public ECPrivateKeyParameters( + BigInteger d, + ECDomainParameters parameters) + : this("EC", d, parameters) + { + } + + [Obsolete("Use version with explicit 'algorithm' parameter")] + public ECPrivateKeyParameters( + BigInteger d, + DerObjectIdentifier publicKeyParamSet) + : base("ECGOST3410", true, publicKeyParamSet) + { + if (d == null) + throw new ArgumentNullException("d"); + + this.d = d; + } + + public ECPrivateKeyParameters( + string algorithm, + BigInteger d, + ECDomainParameters parameters) + : base(algorithm, true, parameters) + { + if (d == null) + throw new ArgumentNullException("d"); + + this.d = d; + } + + public ECPrivateKeyParameters( + string algorithm, + BigInteger d, + DerObjectIdentifier publicKeyParamSet) + : base(algorithm, true, publicKeyParamSet) + { + if (d == null) + throw new ArgumentNullException("d"); + + this.d = d; + } + + public BigInteger D + { + get { return d; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + ECPrivateKeyParameters other = obj as ECPrivateKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + ECPrivateKeyParameters other) + { + return d.Equals(other.d) && base.Equals(other); + } + + public override int GetHashCode() + { + return d.GetHashCode() ^ base.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPrivateKeyParameters.cs.meta new file mode 100644 index 00000000..876b4c07 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f9d84f447cca6e4080ff2469a3642d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPublicKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPublicKeyParameters.cs new file mode 100644 index 00000000..15467320 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPublicKeyParameters.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Globalization; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ECPublicKeyParameters + : ECKeyParameters + { + private readonly ECPoint q; + + public ECPublicKeyParameters( + ECPoint q, + ECDomainParameters parameters) + : this("EC", q, parameters) + { + } + + [Obsolete("Use version with explicit 'algorithm' parameter")] + public ECPublicKeyParameters( + ECPoint q, + DerObjectIdentifier publicKeyParamSet) + : base("ECGOST3410", false, publicKeyParamSet) + { + if (q == null) + throw new ArgumentNullException("q"); + + this.q = ECDomainParameters.Validate(Parameters.Curve, q); + } + + public ECPublicKeyParameters( + string algorithm, + ECPoint q, + ECDomainParameters parameters) + : base(algorithm, false, parameters) + { + if (q == null) + throw new ArgumentNullException("q"); + + this.q = ECDomainParameters.Validate(Parameters.Curve, q); + } + + public ECPublicKeyParameters( + string algorithm, + ECPoint q, + DerObjectIdentifier publicKeyParamSet) + : base(algorithm, false, publicKeyParamSet) + { + if (q == null) + throw new ArgumentNullException("q"); + + this.q = ECDomainParameters.Validate(Parameters.Curve, q); + } + + public ECPoint Q + { + get { return q; } + } + + public override bool Equals(object obj) + { + if (obj == this) + return true; + + ECPublicKeyParameters other = obj as ECPublicKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + ECPublicKeyParameters other) + { + return q.Equals(other.q) && base.Equals(other); + } + + public override int GetHashCode() + { + return q.GetHashCode() ^ base.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPublicKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPublicKeyParameters.cs.meta new file mode 100644 index 00000000..d73a5c61 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ECPublicKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03c066cb5e3c19d4eb02383352313fd5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519KeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519KeyGenerationParameters.cs new file mode 100644 index 00000000..a1a056e5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519KeyGenerationParameters.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class Ed25519KeyGenerationParameters + : KeyGenerationParameters + { + public Ed25519KeyGenerationParameters(SecureRandom random) + : base(random, 256) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519KeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519KeyGenerationParameters.cs.meta new file mode 100644 index 00000000..33bb6d17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519KeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b1b969ec9bb03545b94b55e5a159259 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PrivateKeyParameters.cs new file mode 100644 index 00000000..50534708 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PrivateKeyParameters.cs @@ -0,0 +1,102 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public sealed class Ed25519PrivateKeyParameters + : AsymmetricKeyParameter + { + public static readonly int KeySize = Ed25519.SecretKeySize; + public static readonly int SignatureSize = Ed25519.SignatureSize; + + private readonly byte[] data = new byte[KeySize]; + + public Ed25519PrivateKeyParameters(SecureRandom random) + : base(true) + { + Ed25519.GeneratePrivateKey(random, data); + } + + public Ed25519PrivateKeyParameters(byte[] buf, int off) + : base(true) + { + Array.Copy(buf, off, data, 0, KeySize); + } + + public Ed25519PrivateKeyParameters(Stream input) + : base(true) + { + if (KeySize != Streams.ReadFully(input, data)) + throw new EndOfStreamException("EOF encountered in middle of Ed25519 private key"); + } + + public void Encode(byte[] buf, int off) + { + Array.Copy(data, 0, buf, off, KeySize); + } + + public byte[] GetEncoded() + { + return Arrays.Clone(data); + } + + public Ed25519PublicKeyParameters GeneratePublicKey() + { + byte[] publicKey = new byte[Ed25519.PublicKeySize]; + Ed25519.GeneratePublicKey(data, 0, publicKey, 0); + return new Ed25519PublicKeyParameters(publicKey, 0); + } + + public void Sign(Ed25519.Algorithm algorithm, Ed25519PublicKeyParameters publicKey, byte[] ctx, byte[] msg, int msgOff, int msgLen, + byte[] sig, int sigOff) + { + byte[] pk = new byte[Ed25519.PublicKeySize]; + if (null == publicKey) + { + Ed25519.GeneratePublicKey(data, 0, pk, 0); + } + else + { + publicKey.Encode(pk, 0); + } + + switch (algorithm) + { + case Ed25519.Algorithm.Ed25519: + { + if (null != ctx) + throw new ArgumentException("ctx"); + + Ed25519.Sign(data, 0, pk, 0, msg, msgOff, msgLen, sig, sigOff); + break; + } + case Ed25519.Algorithm.Ed25519ctx: + { + Ed25519.Sign(data, 0, pk, 0, ctx, msg, msgOff, msgLen, sig, sigOff); + break; + } + case Ed25519.Algorithm.Ed25519ph: + { + if (Ed25519.PrehashSize != msgLen) + throw new ArgumentException("msgLen"); + + Ed25519.SignPrehash(data, 0, pk, 0, ctx, msg, msgOff, sig, sigOff); + break; + } + default: + { + throw new ArgumentException("algorithm"); + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PrivateKeyParameters.cs.meta new file mode 100644 index 00000000..ff197afa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 60049b51ce5e74c47b9f0a552eab4608 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PublicKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PublicKeyParameters.cs new file mode 100644 index 00000000..c8f20631 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PublicKeyParameters.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public sealed class Ed25519PublicKeyParameters + : AsymmetricKeyParameter + { + public static readonly int KeySize = Ed25519.PublicKeySize; + + private readonly byte[] data = new byte[KeySize]; + + public Ed25519PublicKeyParameters(byte[] buf, int off) + : base(false) + { + Array.Copy(buf, off, data, 0, KeySize); + } + + public Ed25519PublicKeyParameters(Stream input) + : base(false) + { + if (KeySize != Streams.ReadFully(input, data)) + throw new EndOfStreamException("EOF encountered in middle of Ed25519 public key"); + } + + public void Encode(byte[] buf, int off) + { + Array.Copy(data, 0, buf, off, KeySize); + } + + public byte[] GetEncoded() + { + return Arrays.Clone(data); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PublicKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PublicKeyParameters.cs.meta new file mode 100644 index 00000000..007d4f96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed25519PublicKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d246edc11614ac4eac1f7f7f2fec905 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448KeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448KeyGenerationParameters.cs new file mode 100644 index 00000000..e07c0792 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448KeyGenerationParameters.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class Ed448KeyGenerationParameters + : KeyGenerationParameters + { + public Ed448KeyGenerationParameters(SecureRandom random) + : base(random, 448) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448KeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448KeyGenerationParameters.cs.meta new file mode 100644 index 00000000..6d85173e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448KeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e70fb91643687874f855792db265a440 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PrivateKeyParameters.cs new file mode 100644 index 00000000..b348a017 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PrivateKeyParameters.cs @@ -0,0 +1,94 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public sealed class Ed448PrivateKeyParameters + : AsymmetricKeyParameter + { + public static readonly int KeySize = Ed448.SecretKeySize; + public static readonly int SignatureSize = Ed448.SignatureSize; + + private readonly byte[] data = new byte[KeySize]; + + public Ed448PrivateKeyParameters(SecureRandom random) + : base(true) + { + Ed448.GeneratePrivateKey(random, data); + } + + public Ed448PrivateKeyParameters(byte[] buf, int off) + : base(true) + { + Array.Copy(buf, off, data, 0, KeySize); + } + + public Ed448PrivateKeyParameters(Stream input) + : base(true) + { + if (KeySize != Streams.ReadFully(input, data)) + throw new EndOfStreamException("EOF encountered in middle of Ed448 private key"); + } + + public void Encode(byte[] buf, int off) + { + Array.Copy(data, 0, buf, off, KeySize); + } + + public byte[] GetEncoded() + { + return Arrays.Clone(data); + } + + public Ed448PublicKeyParameters GeneratePublicKey() + { + byte[] publicKey = new byte[Ed448.PublicKeySize]; + Ed448.GeneratePublicKey(data, 0, publicKey, 0); + return new Ed448PublicKeyParameters(publicKey, 0); + } + + public void Sign(Ed448.Algorithm algorithm, Ed448PublicKeyParameters publicKey, byte[] ctx, byte[] msg, int msgOff, int msgLen, + byte[] sig, int sigOff) + { + byte[] pk = new byte[Ed448.PublicKeySize]; + if (null == publicKey) + { + Ed448.GeneratePublicKey(data, 0, pk, 0); + } + else + { + publicKey.Encode(pk, 0); + } + + switch (algorithm) + { + case Ed448.Algorithm.Ed448: + { + Ed448.Sign(data, 0, pk, 0, ctx, msg, msgOff, msgLen, sig, sigOff); + break; + } + case Ed448.Algorithm.Ed448ph: + { + if (Ed448.PrehashSize != msgLen) + throw new ArgumentException("msgLen"); + + Ed448.SignPrehash(data, 0, pk, 0, ctx, msg, msgOff, sig, sigOff); + break; + } + default: + { + throw new ArgumentException("algorithm"); + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PrivateKeyParameters.cs.meta new file mode 100644 index 00000000..802b44f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b4c976aa9828651448913498d4f1418c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PublicKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PublicKeyParameters.cs new file mode 100644 index 00000000..fb39d592 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PublicKeyParameters.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public sealed class Ed448PublicKeyParameters + : AsymmetricKeyParameter + { + public static readonly int KeySize = Ed448.PublicKeySize; + + private readonly byte[] data = new byte[KeySize]; + + public Ed448PublicKeyParameters(byte[] buf, int off) + : base(false) + { + Array.Copy(buf, off, data, 0, KeySize); + } + + public Ed448PublicKeyParameters(Stream input) + : base(false) + { + if (KeySize != Streams.ReadFully(input, data)) + throw new EndOfStreamException("EOF encountered in middle of Ed448 public key"); + } + + public void Encode(byte[] buf, int off) + { + Array.Copy(data, 0, buf, off, KeySize); + } + + public byte[] GetEncoded() + { + return Arrays.Clone(data); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PublicKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PublicKeyParameters.cs.meta new file mode 100644 index 00000000..b7e372e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Ed448PublicKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f94469426783edb40b4a167fe5bfaea7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyGenerationParameters.cs new file mode 100644 index 00000000..e0b918c4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyGenerationParameters.cs @@ -0,0 +1,35 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ElGamalKeyGenerationParameters + : KeyGenerationParameters + { + private readonly ElGamalParameters parameters; + + public ElGamalKeyGenerationParameters( + SecureRandom random, + ElGamalParameters parameters) + : base(random, GetStrength(parameters)) + { + this.parameters = parameters; + } + + public ElGamalParameters Parameters + { + get { return parameters; } + } + + internal static int GetStrength( + ElGamalParameters parameters) + { + return parameters.L != 0 ? parameters.L : parameters.P.BitLength; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyGenerationParameters.cs.meta new file mode 100644 index 00000000..89a4daea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 605fe530d358a834b87bd5618b3592eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyParameters.cs new file mode 100644 index 00000000..04b6ae06 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyParameters.cs @@ -0,0 +1,63 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ElGamalKeyParameters + : AsymmetricKeyParameter + { + private readonly ElGamalParameters parameters; + + protected ElGamalKeyParameters( + bool isPrivate, + ElGamalParameters parameters) + : base(isPrivate) + { + // TODO Should we allow 'parameters' to be null? + this.parameters = parameters; + } + + public ElGamalParameters Parameters + { + get { return parameters; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + ElGamalKeyParameters other = obj as ElGamalKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + ElGamalKeyParameters other) + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(parameters, other.parameters) + && base.Equals(other); + } + + public override int GetHashCode() + { + int hc = base.GetHashCode(); + + if (parameters != null) + { + hc ^= parameters.GetHashCode(); + } + + return hc; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyParameters.cs.meta new file mode 100644 index 00000000..4263fd10 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7cf4458861963154489ccdb128696971 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalParameters.cs new file mode 100644 index 00000000..bc59ce91 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalParameters.cs @@ -0,0 +1,85 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ElGamalParameters + : ICipherParameters + { + private readonly BigInteger p, g; + private readonly int l; + + public ElGamalParameters( + BigInteger p, + BigInteger g) + : this(p, g, 0) + { + } + + public ElGamalParameters( + BigInteger p, + BigInteger g, + int l) + { + if (p == null) + throw new ArgumentNullException("p"); + if (g == null) + throw new ArgumentNullException("g"); + + this.p = p; + this.g = g; + this.l = l; + } + + public BigInteger P + { + get { return p; } + } + + /** + * return the generator - g + */ + public BigInteger G + { + get { return g; } + } + + /** + * return private value limit - l + */ + public int L + { + get { return l; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + ElGamalParameters other = obj as ElGamalParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + ElGamalParameters other) + { + return p.Equals(other.p) && g.Equals(other.g) && l == other.l; + } + + public override int GetHashCode() + { + return p.GetHashCode() ^ g.GetHashCode() ^ l; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalParameters.cs.meta new file mode 100644 index 00000000..8cf37eed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e46c9305cb7e5e49a27049f3f2018ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPrivateKeyParameters.cs new file mode 100644 index 00000000..c28b94d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPrivateKeyParameters.cs @@ -0,0 +1,57 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ElGamalPrivateKeyParameters + : ElGamalKeyParameters + { + private readonly BigInteger x; + + public ElGamalPrivateKeyParameters( + BigInteger x, + ElGamalParameters parameters) + : base(true, parameters) + { + if (x == null) + throw new ArgumentNullException("x"); + + this.x = x; + } + + public BigInteger X + { + get { return x; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + ElGamalPrivateKeyParameters other = obj as ElGamalPrivateKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + ElGamalPrivateKeyParameters other) + { + return other.x.Equals(x) && base.Equals(other); + } + + public override int GetHashCode() + { + return x.GetHashCode() ^ base.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPrivateKeyParameters.cs.meta new file mode 100644 index 00000000..4ca414ee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 334db63a79120bd4a8c4f2fa512f5b35 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPublicKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPublicKeyParameters.cs new file mode 100644 index 00000000..71fe9c56 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPublicKeyParameters.cs @@ -0,0 +1,57 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ElGamalPublicKeyParameters + : ElGamalKeyParameters + { + private readonly BigInteger y; + + public ElGamalPublicKeyParameters( + BigInteger y, + ElGamalParameters parameters) + : base(false, parameters) + { + if (y == null) + throw new ArgumentNullException("y"); + + this.y = y; + } + + public BigInteger Y + { + get { return y; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + ElGamalPublicKeyParameters other = obj as ElGamalPublicKeyParameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + ElGamalPublicKeyParameters other) + { + return y.Equals(other.y) && base.Equals(other); + } + + public override int GetHashCode() + { + return y.GetHashCode() ^ base.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPublicKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPublicKeyParameters.cs.meta new file mode 100644 index 00000000..8837bf5f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ElGamalPublicKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 66e505fdb6b021e4f826fcdbac27d43f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyGenerationParameters.cs new file mode 100644 index 00000000..1861da5b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyGenerationParameters.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class Gost3410KeyGenerationParameters + : KeyGenerationParameters + { + private readonly Gost3410Parameters parameters; + private readonly DerObjectIdentifier publicKeyParamSet; + + public Gost3410KeyGenerationParameters( + SecureRandom random, + Gost3410Parameters parameters) + : base(random, parameters.P.BitLength - 1) + { + this.parameters = parameters; + } + + public Gost3410KeyGenerationParameters( + SecureRandom random, + DerObjectIdentifier publicKeyParamSet) + : this(random, LookupParameters(publicKeyParamSet)) + { + this.publicKeyParamSet = publicKeyParamSet; + } + + public Gost3410Parameters Parameters + { + get { return parameters; } + } + + public DerObjectIdentifier PublicKeyParamSet + { + get { return publicKeyParamSet; } + } + + private static Gost3410Parameters LookupParameters( + DerObjectIdentifier publicKeyParamSet) + { + if (publicKeyParamSet == null) + throw new ArgumentNullException("publicKeyParamSet"); + + Gost3410ParamSetParameters p = Gost3410NamedParameters.GetByOid(publicKeyParamSet); + + if (p == null) + throw new ArgumentException("OID is not a valid CryptoPro public key parameter set", "publicKeyParamSet"); + + return new Gost3410Parameters(p.P, p.Q, p.A); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyGenerationParameters.cs.meta new file mode 100644 index 00000000..a6d585c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d2b36972901f8645b70cec28ad5541b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyParameters.cs new file mode 100644 index 00000000..f4958a78 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyParameters.cs @@ -0,0 +1,62 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public abstract class Gost3410KeyParameters + : AsymmetricKeyParameter + { + private readonly Gost3410Parameters parameters; + private readonly DerObjectIdentifier publicKeyParamSet; + + protected Gost3410KeyParameters( + bool isPrivate, + Gost3410Parameters parameters) + : base(isPrivate) + { + this.parameters = parameters; + } + + protected Gost3410KeyParameters( + bool isPrivate, + DerObjectIdentifier publicKeyParamSet) + : base(isPrivate) + { + this.parameters = LookupParameters(publicKeyParamSet); + this.publicKeyParamSet = publicKeyParamSet; + } + + public Gost3410Parameters Parameters + { + get { return parameters; } + } + + public DerObjectIdentifier PublicKeyParamSet + { + get { return publicKeyParamSet; } + } + + // TODO Implement Equals/GetHashCode + + private static Gost3410Parameters LookupParameters( + DerObjectIdentifier publicKeyParamSet) + { + if (publicKeyParamSet == null) + throw new ArgumentNullException("publicKeyParamSet"); + + Gost3410ParamSetParameters p = Gost3410NamedParameters.GetByOid(publicKeyParamSet); + + if (p == null) + throw new ArgumentException("OID is not a valid CryptoPro public key parameter set", "publicKeyParamSet"); + + return new Gost3410Parameters(p.P, p.Q, p.A); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyParameters.cs.meta new file mode 100644 index 00000000..703d58c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410KeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1dc6988914e81bd46905d8ebc7b82e2a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410Parameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410Parameters.cs new file mode 100644 index 00000000..19fe07ef --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410Parameters.cs @@ -0,0 +1,90 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class Gost3410Parameters + : ICipherParameters + { + private readonly BigInteger p, q, a; + private readonly Gost3410ValidationParameters validation; + + public Gost3410Parameters( + BigInteger p, + BigInteger q, + BigInteger a) + : this(p, q, a, null) + { + } + + public Gost3410Parameters( + BigInteger p, + BigInteger q, + BigInteger a, + Gost3410ValidationParameters validation) + { + if (p == null) + throw new ArgumentNullException("p"); + if (q == null) + throw new ArgumentNullException("q"); + if (a == null) + throw new ArgumentNullException("a"); + + this.p = p; + this.q = q; + this.a = a; + this.validation = validation; + } + + public BigInteger P + { + get { return p; } + } + + public BigInteger Q + { + get { return q; } + } + + public BigInteger A + { + get { return a; } + } + + public Gost3410ValidationParameters ValidationParameters + { + get { return validation; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + Gost3410Parameters other = obj as Gost3410Parameters; + + if (other == null) + return false; + + return Equals(other); + } + + protected bool Equals( + Gost3410Parameters other) + { + return p.Equals(other.p) && q.Equals(other.q) && a.Equals(other.a); + } + + public override int GetHashCode() + { + return p.GetHashCode() ^ q.GetHashCode() ^ a.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410Parameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410Parameters.cs.meta new file mode 100644 index 00000000..95555580 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410Parameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5dbdc652c3f5f944f87efef0cff09e1e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PrivateKeyParameters.cs new file mode 100644 index 00000000..8ca4f554 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PrivateKeyParameters.cs @@ -0,0 +1,45 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class Gost3410PrivateKeyParameters + : Gost3410KeyParameters + { + private readonly BigInteger x; + + public Gost3410PrivateKeyParameters( + BigInteger x, + Gost3410Parameters parameters) + : base(true, parameters) + { + if (x.SignValue < 1 || x.BitLength > 256 || x.CompareTo(Parameters.Q) >= 0) + throw new ArgumentException("Invalid x for GOST3410 private key", "x"); + + this.x = x; + } + + public Gost3410PrivateKeyParameters( + BigInteger x, + DerObjectIdentifier publicKeyParamSet) + : base(true, publicKeyParamSet) + { + if (x.SignValue < 1 || x.BitLength > 256 || x.CompareTo(Parameters.Q) >= 0) + throw new ArgumentException("Invalid x for GOST3410 private key", "x"); + + this.x = x; + } + + public BigInteger X + { + get { return x; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PrivateKeyParameters.cs.meta new file mode 100644 index 00000000..4e475ad0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f6711979a24300844aa8670163e40905 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PublicKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PublicKeyParameters.cs new file mode 100644 index 00000000..31f70538 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PublicKeyParameters.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class Gost3410PublicKeyParameters + : Gost3410KeyParameters + { + private readonly BigInteger y; + + public Gost3410PublicKeyParameters( + BigInteger y, + Gost3410Parameters parameters) + : base(false, parameters) + { + if (y.SignValue < 1 || y.CompareTo(Parameters.P) >= 0) + throw new ArgumentException("Invalid y for GOST3410 public key", "y"); + + this.y = y; + } + + public Gost3410PublicKeyParameters( + BigInteger y, + DerObjectIdentifier publicKeyParamSet) + : base(false, publicKeyParamSet) + { + if (y.SignValue < 1 || y.CompareTo(Parameters.P) >= 0) + throw new ArgumentException("Invalid y for GOST3410 public key", "y"); + + this.y = y; + } + + public BigInteger Y + { + get { return y; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PublicKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PublicKeyParameters.cs.meta new file mode 100644 index 00000000..3117dfd4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410PublicKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d46ac587d55b6046a73f3d32ed2c8a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410ValidationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410ValidationParameters.cs new file mode 100644 index 00000000..71dd73a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410ValidationParameters.cs @@ -0,0 +1,55 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class Gost3410ValidationParameters + { + private int x0; + private int c; + private long x0L; + private long cL; + + public Gost3410ValidationParameters( + int x0, + int c) + { + this.x0 = x0; + this.c = c; + } + + public Gost3410ValidationParameters( + long x0L, + long cL) + { + this.x0L = x0L; + this.cL = cL; + } + + public int C { get { return c; } } + public int X0 { get { return x0; } } + public long CL { get { return cL; } } + public long X0L { get { return x0L; } } + + public override bool Equals( + object obj) + { + Gost3410ValidationParameters other = obj as Gost3410ValidationParameters; + + return other != null + && other.c == this.c + && other.x0 == this.x0 + && other.cL == this.cL + && other.x0L == this.x0L; + } + + public override int GetHashCode() + { + return c.GetHashCode() ^ x0.GetHashCode() ^ cL.GetHashCode() ^ x0L.GetHashCode(); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410ValidationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410ValidationParameters.cs.meta new file mode 100644 index 00000000..3e32abc2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/GOST3410ValidationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c64f65e9276e6e4785c41edb30a4d8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/HKDFParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/HKDFParameters.cs new file mode 100644 index 00000000..b83bd63b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/HKDFParameters.cs @@ -0,0 +1,123 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /** + * Parameter class for the HkdfBytesGenerator class. + */ + public class HkdfParameters + : IDerivationParameters + { + private readonly byte[] ikm; + private readonly bool skipExpand; + private readonly byte[] salt; + private readonly byte[] info; + + private HkdfParameters(byte[] ikm, bool skip, byte[] salt, byte[] info) + { + if (ikm == null) + throw new ArgumentNullException("ikm"); + + this.ikm = Arrays.Clone(ikm); + this.skipExpand = skip; + + if (salt == null || salt.Length == 0) + { + this.salt = null; + } + else + { + this.salt = Arrays.Clone(salt); + } + + if (info == null) + { + this.info = new byte[0]; + } + else + { + this.info = Arrays.Clone(info); + } + } + + /** + * Generates parameters for HKDF, specifying both the optional salt and + * optional info. Step 1: Extract won't be skipped. + * + * @param ikm the input keying material or seed + * @param salt the salt to use, may be null for a salt for hashLen zeros + * @param info the info to use, may be null for an info field of zero bytes + */ + public HkdfParameters(byte[] ikm, byte[] salt, byte[] info) + : this(ikm, false, salt, info) + { + } + + /** + * Factory method that makes the HKDF skip the extract part of the key + * derivation function. + * + * @param ikm the input keying material or seed, directly used for step 2: + * Expand + * @param info the info to use, may be null for an info field of zero bytes + * @return HKDFParameters that makes the implementation skip step 1 + */ + public static HkdfParameters SkipExtractParameters(byte[] ikm, byte[] info) + { + return new HkdfParameters(ikm, true, null, info); + } + + public static HkdfParameters DefaultParameters(byte[] ikm) + { + return new HkdfParameters(ikm, false, null, null); + } + + /** + * Returns the input keying material or seed. + * + * @return the keying material + */ + public virtual byte[] GetIkm() + { + return Arrays.Clone(ikm); + } + + /** + * Returns if step 1: extract has to be skipped or not + * + * @return true for skipping, false for no skipping of step 1 + */ + public virtual bool SkipExtract + { + get { return skipExpand; } + } + + /** + * Returns the salt, or null if the salt should be generated as a byte array + * of HashLen zeros. + * + * @return the salt, or null + */ + public virtual byte[] GetSalt() + { + return Arrays.Clone(salt); + } + + /** + * Returns the info field, which may be empty (null is converted to empty). + * + * @return the info field, never null + */ + public virtual byte[] GetInfo() + { + return Arrays.Clone(info); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/HKDFParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/HKDFParameters.cs.meta new file mode 100644 index 00000000..429b3e1e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/HKDFParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 293360ebd6a248a49be4e61a3bb9a636 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ISO18033KDFParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ISO18033KDFParameters.cs new file mode 100644 index 00000000..c5a86863 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ISO18033KDFParameters.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /** + * parameters for Key derivation functions for ISO-18033 + */ + public class Iso18033KdfParameters + : IDerivationParameters + { + byte[] seed; + + public Iso18033KdfParameters( + byte[] seed) + { + this.seed = seed; + } + + public byte[] GetSeed() + { + return seed; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ISO18033KDFParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ISO18033KDFParameters.cs.meta new file mode 100644 index 00000000..a0c89771 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ISO18033KDFParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1841ab6676510b84a9a6154b0c8c6004 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesParameters.cs new file mode 100644 index 00000000..53b4cfa4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesParameters.cs @@ -0,0 +1,53 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /** + * parameters for using an integrated cipher in stream mode. + */ + public class IesParameters : ICipherParameters + { + private byte[] derivation; + private byte[] encoding; + private int macKeySize; + + /** + * @param derivation the derivation parameter for the KDF function. + * @param encoding the encoding parameter for the KDF function. + * @param macKeySize the size of the MAC key (in bits). + */ + public IesParameters( + byte[] derivation, + byte[] encoding, + int macKeySize) + { + this.derivation = derivation; + this.encoding = encoding; + this.macKeySize = macKeySize; + } + + public byte[] GetDerivationV() + { + return derivation; + } + + public byte[] GetEncodingV() + { + return encoding; + } + + public int MacKeySize + { + get + { + return macKeySize; + } + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesParameters.cs.meta new file mode 100644 index 00000000..09c63ac5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7c03aa52286eafd459b8fc92fa4177e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesWithCipherParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesWithCipherParameters.cs new file mode 100644 index 00000000..dc3c220e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesWithCipherParameters.cs @@ -0,0 +1,37 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class IesWithCipherParameters : IesParameters + { + private int cipherKeySize; + + /** + * @param derivation the derivation parameter for the KDF function. + * @param encoding the encoding parameter for the KDF function. + * @param macKeySize the size of the MAC key (in bits). + * @param cipherKeySize the size of the associated Cipher key (in bits). + */ + public IesWithCipherParameters( + byte[] derivation, + byte[] encoding, + int macKeySize, + int cipherKeySize) : base(derivation, encoding, macKeySize) + { + this.cipherKeySize = cipherKeySize; + } + + public int CipherKeySize + { + get + { + return cipherKeySize; + } + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesWithCipherParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesWithCipherParameters.cs.meta new file mode 100644 index 00000000..73334ffb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/IesWithCipherParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3413d4030dee0b47a112e722521d66c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KdfParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KdfParameters.cs new file mode 100644 index 00000000..ed66588f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KdfParameters.cs @@ -0,0 +1,37 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /** + * parameters for Key derivation functions for IEEE P1363a + */ + public class KdfParameters : IDerivationParameters + { + byte[] iv; + byte[] shared; + + public KdfParameters( + byte[] shared, + byte[] iv) + { + this.shared = shared; + this.iv = iv; + } + + public byte[] GetSharedSecret() + { + return shared; + } + + public byte[] GetIV() + { + return iv; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KdfParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KdfParameters.cs.meta new file mode 100644 index 00000000..0371bc4c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KdfParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26a35bd34dbec4c4c8291c90a9e688d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KeyParameter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KeyParameter.cs new file mode 100644 index 00000000..8475f6e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KeyParameter.cs @@ -0,0 +1,47 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class KeyParameter + : ICipherParameters + { + private readonly byte[] key; + + public KeyParameter( + byte[] key) + { + if (key == null) + throw new ArgumentNullException("key"); + + this.key = (byte[]) key.Clone(); + } + + public KeyParameter( + byte[] key, + int keyOff, + int keyLen) + { + if (key == null) + throw new ArgumentNullException("key"); + if (keyOff < 0 || keyOff > key.Length) + throw new ArgumentOutOfRangeException("keyOff"); + if (keyLen < 0 || keyLen > (key.Length - keyOff)) + throw new ArgumentOutOfRangeException("keyLen"); + + this.key = new byte[keyLen]; + Array.Copy(key, keyOff, this.key, 0, keyLen); + } + + public byte[] GetKey() + { + return (byte[]) key.Clone(); + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KeyParameter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KeyParameter.cs.meta new file mode 100644 index 00000000..f508c555 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/KeyParameter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fd79ff15a5360d745bdc45b2083e2958 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MgfParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MgfParameters.cs new file mode 100644 index 00000000..51e86ab5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MgfParameters.cs @@ -0,0 +1,35 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /// Parameters for mask derivation functions. + public class MgfParameters + : IDerivationParameters + { + private readonly byte[] seed; + + public MgfParameters( + byte[] seed) + : this(seed, 0, seed.Length) + { + } + + public MgfParameters( + byte[] seed, + int off, + int len) + { + this.seed = new byte[len]; + Array.Copy(seed, off, this.seed, 0, len); + } + + public byte[] GetSeed() + { + return (byte[]) seed.Clone(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MgfParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MgfParameters.cs.meta new file mode 100644 index 00000000..d792a526 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MgfParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 75c55f2fe09e5404eac96fe38d1d0a40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPrivateParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPrivateParameters.cs new file mode 100644 index 00000000..cb8a4c3a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPrivateParameters.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class MqvPrivateParameters + : ICipherParameters + { + private readonly ECPrivateKeyParameters staticPrivateKey; + private readonly ECPrivateKeyParameters ephemeralPrivateKey; + private readonly ECPublicKeyParameters ephemeralPublicKey; + + public MqvPrivateParameters( + ECPrivateKeyParameters staticPrivateKey, + ECPrivateKeyParameters ephemeralPrivateKey) + : this(staticPrivateKey, ephemeralPrivateKey, null) + { + } + + public MqvPrivateParameters( + ECPrivateKeyParameters staticPrivateKey, + ECPrivateKeyParameters ephemeralPrivateKey, + ECPublicKeyParameters ephemeralPublicKey) + { + if (staticPrivateKey == null) + throw new ArgumentNullException("staticPrivateKey"); + if (ephemeralPrivateKey == null) + throw new ArgumentNullException("ephemeralPrivateKey"); + + ECDomainParameters parameters = staticPrivateKey.Parameters; + if (!parameters.Equals(ephemeralPrivateKey.Parameters)) + throw new ArgumentException("Static and ephemeral private keys have different domain parameters"); + + if (ephemeralPublicKey == null) + { + ephemeralPublicKey = new ECPublicKeyParameters( + parameters.G.Multiply(ephemeralPrivateKey.D), + parameters); + } + else if (!parameters.Equals(ephemeralPublicKey.Parameters)) + { + throw new ArgumentException("Ephemeral public key has different domain parameters"); + } + + this.staticPrivateKey = staticPrivateKey; + this.ephemeralPrivateKey = ephemeralPrivateKey; + this.ephemeralPublicKey = ephemeralPublicKey; + } + + public virtual ECPrivateKeyParameters StaticPrivateKey + { + get { return staticPrivateKey; } + } + + public virtual ECPrivateKeyParameters EphemeralPrivateKey + { + get { return ephemeralPrivateKey; } + } + + public virtual ECPublicKeyParameters EphemeralPublicKey + { + get { return ephemeralPublicKey; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPrivateParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPrivateParameters.cs.meta new file mode 100644 index 00000000..ceb57df8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPrivateParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48e1468458832e9438b4568785726d43 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPublicParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPublicParameters.cs new file mode 100644 index 00000000..2cf2c943 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPublicParameters.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class MqvPublicParameters + : ICipherParameters + { + private readonly ECPublicKeyParameters staticPublicKey; + private readonly ECPublicKeyParameters ephemeralPublicKey; + + public MqvPublicParameters( + ECPublicKeyParameters staticPublicKey, + ECPublicKeyParameters ephemeralPublicKey) + { + if (staticPublicKey == null) + throw new ArgumentNullException("staticPublicKey"); + if (ephemeralPublicKey == null) + throw new ArgumentNullException("ephemeralPublicKey"); + if (!staticPublicKey.Parameters.Equals(ephemeralPublicKey.Parameters)) + throw new ArgumentException("Static and ephemeral public keys have different domain parameters"); + + this.staticPublicKey = staticPublicKey; + this.ephemeralPublicKey = ephemeralPublicKey; + } + + public virtual ECPublicKeyParameters StaticPublicKey + { + get { return staticPublicKey; } + } + + public virtual ECPublicKeyParameters EphemeralPublicKey + { + get { return ephemeralPublicKey; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPublicParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPublicParameters.cs.meta new file mode 100644 index 00000000..dfa86a67 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/MqvPublicParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e50ff85b1ca76d8428cde7f72e9d9d34 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyGenerationParameters.cs new file mode 100644 index 00000000..cb56f457 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyGenerationParameters.cs @@ -0,0 +1,102 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /** + * Parameters for NaccacheStern public private key generation. For details on + * this cipher, please see + * + * http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + */ + public class NaccacheSternKeyGenerationParameters : KeyGenerationParameters + { + // private BigInteger publicExponent; + private readonly int certainty; + private readonly int countSmallPrimes; + + /** + * Parameters for generating a NaccacheStern KeyPair. + * + * @param random + * The source of randomness + * @param strength + * The desired strength of the Key in Bits + * @param certainty + * the probability that the generated primes are not really prime + * as integer: 2^(-certainty) is then the probability + * @param countSmallPrimes + * How many small key factors are desired + */ + public NaccacheSternKeyGenerationParameters( + SecureRandom random, + int strength, + int certainty, + int countSmallPrimes) + : base(random, strength) + { + if (countSmallPrimes % 2 == 1) + throw new ArgumentException("countSmallPrimes must be a multiple of 2"); + if (countSmallPrimes < 30) + throw new ArgumentException("countSmallPrimes must be >= 30 for security reasons"); + + this.certainty = certainty; + this.countSmallPrimes = countSmallPrimes; + } + + /** + * Parameters for a NaccacheStern KeyPair. + * + * @param random + * The source of randomness + * @param strength + * The desired strength of the Key in Bits + * @param certainty + * the probability that the generated primes are not really prime + * as integer: 2^(-certainty) is then the probability + * @param cntSmallPrimes + * How many small key factors are desired + * @param debug + * Ignored + */ + [Obsolete("Use version without 'debug' parameter")] + public NaccacheSternKeyGenerationParameters( + SecureRandom random, + int strength, + int certainty, + int countSmallPrimes, + bool debug) + : this(random, strength, certainty, countSmallPrimes) + { + } + + /** + * @return Returns the certainty. + */ + public int Certainty + { + get { return certainty; } + } + + /** + * @return Returns the countSmallPrimes. + */ + public int CountSmallPrimes + { + get { return countSmallPrimes; } + } + + [Obsolete("Remove: always false")] + public bool IsDebug + { + get { return false; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyGenerationParameters.cs.meta new file mode 100644 index 00000000..91605a69 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ee6bf0ab7004704a8e12912a0b65335 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyParameters.cs new file mode 100644 index 00000000..a88c6d54 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyParameters.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /** + * Public key parameters for NaccacheStern cipher. For details on this cipher, + * please see + * + * http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + */ + public class NaccacheSternKeyParameters : AsymmetricKeyParameter + { + private readonly BigInteger g, n; + private readonly int lowerSigmaBound; + + /** + * @param privateKey + */ + public NaccacheSternKeyParameters(bool privateKey, BigInteger g, BigInteger n, int lowerSigmaBound) + : base(privateKey) + { + this.g = g; + this.n = n; + this.lowerSigmaBound = lowerSigmaBound; + } + + /** + * @return Returns the g. + */ + public BigInteger G { get { return g; } } + + /** + * @return Returns the lowerSigmaBound. + */ + public int LowerSigmaBound { get { return lowerSigmaBound; } } + + /** + * @return Returns the n. + */ + public BigInteger Modulus { get { return n; } } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyParameters.cs.meta new file mode 100644 index 00000000..b4c99db7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c608e6e37c22c2c45bae901d561cf8ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternPrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternPrivateKeyParameters.cs new file mode 100644 index 00000000..6b43f8a3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternPrivateKeyParameters.cs @@ -0,0 +1,83 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /** + * Private key parameters for NaccacheStern cipher. For details on this cipher, + * please see + * + * http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf + */ + public class NaccacheSternPrivateKeyParameters : NaccacheSternKeyParameters + { + private readonly BigInteger phiN; + private readonly IList smallPrimes; + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete] + public NaccacheSternPrivateKeyParameters( + BigInteger g, + BigInteger n, + int lowerSigmaBound, + ArrayList smallPrimes, + BigInteger phiN) + : base(true, g, n, lowerSigmaBound) + { + this.smallPrimes = smallPrimes; + this.phiN = phiN; + } +#endif + + /** + * Constructs a NaccacheSternPrivateKey + * + * @param g + * the public enryption parameter g + * @param n + * the public modulus n = p*q + * @param lowerSigmaBound + * the public lower sigma bound up to which data can be encrypted + * @param smallPrimes + * the small primes, of which sigma is constructed in the right + * order + * @param phi_n + * the private modulus phi(n) = (p-1)(q-1) + */ + public NaccacheSternPrivateKeyParameters( + BigInteger g, + BigInteger n, + int lowerSigmaBound, + IList smallPrimes, + BigInteger phiN) + : base(true, g, n, lowerSigmaBound) + { + this.smallPrimes = smallPrimes; + this.phiN = phiN; + } + + public BigInteger PhiN + { + get { return phiN; } + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete("Use 'SmallPrimesList' instead")] + public ArrayList SmallPrimes + { + get { return new ArrayList(smallPrimes); } + } +#endif + + public IList SmallPrimesList + { + get { return smallPrimes; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternPrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternPrivateKeyParameters.cs.meta new file mode 100644 index 00000000..52e0cab9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/NaccacheSternPrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf5a274ff3cb7634f810983e35f3bfde +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithID.cs new file mode 100644 index 00000000..cf57afd2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithID.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ParametersWithID + : ICipherParameters + { + private readonly ICipherParameters parameters; + private readonly byte[] id; + + public ParametersWithID(ICipherParameters parameters, + byte[] id) + : this(parameters, id, 0, id.Length) + { + } + + public ParametersWithID(ICipherParameters parameters, + byte[] id, int idOff, int idLen) + { + this.parameters = parameters; + this.id = Arrays.CopyOfRange(id, idOff, idOff + idLen); + } + + public byte[] GetID() + { + return id; + } + + public ICipherParameters Parameters + { + get { return parameters; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithID.cs.meta new file mode 100644 index 00000000..a5ab6226 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0f143d4cda38054f897e6d8a00c3491 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithIV.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithIV.cs new file mode 100644 index 00000000..ea03ebe5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithIV.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ParametersWithIV + : ICipherParameters + { + private readonly ICipherParameters parameters; + private readonly byte[] iv; + + public ParametersWithIV(ICipherParameters parameters, + byte[] iv) + : this(parameters, iv, 0, iv.Length) + { + } + + public ParametersWithIV(ICipherParameters parameters, + byte[] iv, int ivOff, int ivLen) + { + // NOTE: 'parameters' may be null to imply key re-use + if (iv == null) + throw new ArgumentNullException("iv"); + + this.parameters = parameters; + this.iv = Arrays.CopyOfRange(iv, ivOff, ivOff + ivLen); + } + + public byte[] GetIV() + { + return (byte[])iv.Clone(); + } + + public ICipherParameters Parameters + { + get { return parameters; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithIV.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithIV.cs.meta new file mode 100644 index 00000000..2e8332a3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithIV.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68fc549489833994d859f97f7f947591 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithRandom.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithRandom.cs new file mode 100644 index 00000000..719c39c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithRandom.cs @@ -0,0 +1,52 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ParametersWithRandom + : ICipherParameters + { + private readonly ICipherParameters parameters; + private readonly SecureRandom random; + + public ParametersWithRandom( + ICipherParameters parameters, + SecureRandom random) + { + if (parameters == null) + throw new ArgumentNullException("parameters"); + if (random == null) + throw new ArgumentNullException("random"); + + this.parameters = parameters; + this.random = random; + } + + public ParametersWithRandom( + ICipherParameters parameters) + : this(parameters, new SecureRandom()) + { + } + + [Obsolete("Use Random property instead")] + public SecureRandom GetRandom() + { + return Random; + } + + public SecureRandom Random + { + get { return random; } + } + + public ICipherParameters Parameters + { + get { return parameters; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithRandom.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithRandom.cs.meta new file mode 100644 index 00000000..854caeeb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithRandom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9ce4f2340d8a7d944a7ea4678b7c69ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSBox.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSBox.cs new file mode 100644 index 00000000..5ac99850 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSBox.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class ParametersWithSBox : ICipherParameters + { + private ICipherParameters parameters; + private byte[] sBox; + + public ParametersWithSBox( + ICipherParameters parameters, + byte[] sBox) + { + this.parameters = parameters; + this.sBox = sBox; + } + + public byte[] GetSBox() { return sBox; } + + public ICipherParameters Parameters { get { return parameters; } } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSBox.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSBox.cs.meta new file mode 100644 index 00000000..af279fb4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSBox.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 638195a3abd1d6a46b904b329c8245af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSalt.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSalt.cs new file mode 100644 index 00000000..84352f3b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSalt.cs @@ -0,0 +1,43 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + + /// Cipher parameters with a fixed salt value associated with them. + public class ParametersWithSalt : ICipherParameters + { + private byte[] salt; + private ICipherParameters parameters; + + public ParametersWithSalt(ICipherParameters parameters, byte[] salt):this(parameters, salt, 0, salt.Length) + { + } + + public ParametersWithSalt(ICipherParameters parameters, byte[] salt, int saltOff, int saltLen) + { + this.salt = new byte[saltLen]; + this.parameters = parameters; + + Array.Copy(salt, saltOff, this.salt, 0, saltLen); + } + + public byte[] GetSalt() + { + return salt; + } + + public ICipherParameters Parameters + { + get + { + return parameters; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSalt.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSalt.cs.meta new file mode 100644 index 00000000..b1f4c65c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/ParametersWithSalt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46fe3e74d88b9a94892a247fbc85f040 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC2Parameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC2Parameters.cs new file mode 100644 index 00000000..64064ee4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC2Parameters.cs @@ -0,0 +1,51 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class RC2Parameters + : KeyParameter + { + private readonly int bits; + + public RC2Parameters( + byte[] key) + : this(key, (key.Length > 128) ? 1024 : (key.Length * 8)) + { + } + + public RC2Parameters( + byte[] key, + int keyOff, + int keyLen) + : this(key, keyOff, keyLen, (keyLen > 128) ? 1024 : (keyLen * 8)) + { + } + + public RC2Parameters( + byte[] key, + int bits) + : base(key) + { + this.bits = bits; + } + + public RC2Parameters( + byte[] key, + int keyOff, + int keyLen, + int bits) + : base(key, keyOff, keyLen) + { + this.bits = bits; + } + + public int EffectiveKeyBits + { + get { return bits; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC2Parameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC2Parameters.cs.meta new file mode 100644 index 00000000..3a73b743 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC2Parameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 383dd2f6afb5c064e937be5dd2cb7ec8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC5Parameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC5Parameters.cs new file mode 100644 index 00000000..40137181 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC5Parameters.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class RC5Parameters + : KeyParameter + { + private readonly int rounds; + + public RC5Parameters( + byte[] key, + int rounds) + : base(key) + { + if (key.Length > 255) + throw new ArgumentException("RC5 key length can be no greater than 255"); + + this.rounds = rounds; + } + + public int Rounds + { + get { return rounds; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC5Parameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC5Parameters.cs.meta new file mode 100644 index 00000000..98206a19 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RC5Parameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71a86e01a87befa429932b5ce00b9fa6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RSABlindingParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RSABlindingParameters.cs new file mode 100644 index 00000000..52a8fe20 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RSABlindingParameters.cs @@ -0,0 +1,38 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class RsaBlindingParameters + : ICipherParameters + { + private readonly RsaKeyParameters publicKey; + private readonly BigInteger blindingFactor; + + public RsaBlindingParameters( + RsaKeyParameters publicKey, + BigInteger blindingFactor) + { + if (publicKey.IsPrivate) + throw new ArgumentException("RSA parameters should be for a public key"); + + this.publicKey = publicKey; + this.blindingFactor = blindingFactor; + } + + public RsaKeyParameters PublicKey + { + get { return publicKey; } + } + + public BigInteger BlindingFactor + { + get { return blindingFactor; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RSABlindingParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RSABlindingParameters.cs.meta new file mode 100644 index 00000000..c573abc1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RSABlindingParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 64139b13faf91484d84de884824f3b4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyGenerationParameters.cs new file mode 100644 index 00000000..9c4cfcc6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyGenerationParameters.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class RsaKeyGenerationParameters + : KeyGenerationParameters + { + private readonly BigInteger publicExponent; + private readonly int certainty; + + public RsaKeyGenerationParameters( + BigInteger publicExponent, + SecureRandom random, + int strength, + int certainty) + : base(random, strength) + { + this.publicExponent = publicExponent; + this.certainty = certainty; + } + + public BigInteger PublicExponent + { + get { return publicExponent; } + } + + public int Certainty + { + get { return certainty; } + } + + public override bool Equals( + object obj) + { + RsaKeyGenerationParameters other = obj as RsaKeyGenerationParameters; + + if (other == null) + { + return false; + } + + return certainty == other.certainty + && publicExponent.Equals(other.publicExponent); + } + + public override int GetHashCode() + { + return certainty.GetHashCode() ^ publicExponent.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyGenerationParameters.cs.meta new file mode 100644 index 00000000..fb8472c8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2dfb8ecda9194534ebe72fd378a0a6ba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyParameters.cs new file mode 100644 index 00000000..18827591 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyParameters.cs @@ -0,0 +1,89 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class RsaKeyParameters + : AsymmetricKeyParameter + { + // the value is the product of the 132 smallest primes from 3 to 751 + private static BigInteger SmallPrimesProduct = new BigInteger( + "8138E8A0FCF3A4E84A771D40FD305D7F4AA59306D7251DE54D98AF8FE95729A1" + + "F73D893FA424CD2EDC8636A6C3285E022B0E3866A565AE8108EED8591CD4FE8D" + + "2CE86165A978D719EBF647F362D33FCA29CD179FB42401CBAF3DF0C614056F9C" + + "8F3CFD51E474AFB6BC6974F78DB8ABA8E9E517FDED658591AB7502BD41849462F", + 16); + + private static BigInteger Validate(BigInteger modulus) + { + if ((modulus.IntValue & 1) == 0) + throw new ArgumentException("RSA modulus is even", "modulus"); + if (!modulus.Gcd(SmallPrimesProduct).Equals(BigInteger.One)) + throw new ArgumentException("RSA modulus has a small prime factor"); + + // TODO: add additional primePower/Composite test - expensive!! + + return modulus; + } + + private readonly BigInteger modulus; + private readonly BigInteger exponent; + + public RsaKeyParameters( + bool isPrivate, + BigInteger modulus, + BigInteger exponent) + : base(isPrivate) + { + if (modulus == null) + throw new ArgumentNullException("modulus"); + if (exponent == null) + throw new ArgumentNullException("exponent"); + if (modulus.SignValue <= 0) + throw new ArgumentException("Not a valid RSA modulus", "modulus"); + if (exponent.SignValue <= 0) + throw new ArgumentException("Not a valid RSA exponent", "exponent"); + if (!isPrivate && (exponent.IntValue & 1) == 0) + throw new ArgumentException("RSA publicExponent is even", "exponent"); + + this.modulus = Validate(modulus); + this.exponent = exponent; + } + + public BigInteger Modulus + { + get { return modulus; } + } + + public BigInteger Exponent + { + get { return exponent; } + } + + public override bool Equals( + object obj) + { + RsaKeyParameters kp = obj as RsaKeyParameters; + + if (kp == null) + { + return false; + } + + return kp.IsPrivate == this.IsPrivate + && kp.Modulus.Equals(this.modulus) + && kp.Exponent.Equals(this.exponent); + } + + public override int GetHashCode() + { + return modulus.GetHashCode() ^ exponent.GetHashCode() ^ IsPrivate.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyParameters.cs.meta new file mode 100644 index 00000000..96405082 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8fbdd0c93dcb1ea49b65b46b26c2d1db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaPrivateCrtKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaPrivateCrtKeyParameters.cs new file mode 100644 index 00000000..85e028a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaPrivateCrtKeyParameters.cs @@ -0,0 +1,122 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class RsaPrivateCrtKeyParameters + : RsaKeyParameters + { + private readonly BigInteger e, p, q, dP, dQ, qInv; + + public RsaPrivateCrtKeyParameters( + BigInteger modulus, + BigInteger publicExponent, + BigInteger privateExponent, + BigInteger p, + BigInteger q, + BigInteger dP, + BigInteger dQ, + BigInteger qInv) + : base(true, modulus, privateExponent) + { + ValidateValue(publicExponent, "publicExponent", "exponent"); + ValidateValue(p, "p", "P value"); + ValidateValue(q, "q", "Q value"); + ValidateValue(dP, "dP", "DP value"); + ValidateValue(dQ, "dQ", "DQ value"); + ValidateValue(qInv, "qInv", "InverseQ value"); + + this.e = publicExponent; + this.p = p; + this.q = q; + this.dP = dP; + this.dQ = dQ; + this.qInv = qInv; + } + + public RsaPrivateCrtKeyParameters(RsaPrivateKeyStructure rsaPrivateKey) + : this( + rsaPrivateKey.Modulus, + rsaPrivateKey.PublicExponent, + rsaPrivateKey.PrivateExponent, + rsaPrivateKey.Prime1, + rsaPrivateKey.Prime2, + rsaPrivateKey.Exponent1, + rsaPrivateKey.Exponent2, + rsaPrivateKey.Coefficient) + { + } + + public BigInteger PublicExponent + { + get { return e; } + } + + public BigInteger P + { + get { return p; } + } + + public BigInteger Q + { + get { return q; } + } + + public BigInteger DP + { + get { return dP; } + } + + public BigInteger DQ + { + get { return dQ; } + } + + public BigInteger QInv + { + get { return qInv; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + RsaPrivateCrtKeyParameters kp = obj as RsaPrivateCrtKeyParameters; + + if (kp == null) + return false; + + return kp.DP.Equals(dP) + && kp.DQ.Equals(dQ) + && kp.Exponent.Equals(this.Exponent) + && kp.Modulus.Equals(this.Modulus) + && kp.P.Equals(p) + && kp.Q.Equals(q) + && kp.PublicExponent.Equals(e) + && kp.QInv.Equals(qInv); + } + + public override int GetHashCode() + { + return DP.GetHashCode() ^ DQ.GetHashCode() ^ Exponent.GetHashCode() ^ Modulus.GetHashCode() + ^ P.GetHashCode() ^ Q.GetHashCode() ^ PublicExponent.GetHashCode() ^ QInv.GetHashCode(); + } + + private static void ValidateValue(BigInteger x, string name, string desc) + { + if (x == null) + throw new ArgumentNullException(name); + if (x.SignValue <= 0) + throw new ArgumentException("Not a valid RSA " + desc, name); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaPrivateCrtKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaPrivateCrtKeyParameters.cs.meta new file mode 100644 index 00000000..03893cab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/RsaPrivateCrtKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b78b91bb256c288459bcb8c8aeb11f63 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePrivateParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePrivateParameters.cs new file mode 100644 index 00000000..178f0db7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePrivateParameters.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /// Private parameters for an SM2 key exchange. + /// The ephemeralPrivateKey is used to calculate the random point used in the algorithm. + public class SM2KeyExchangePrivateParameters + : ICipherParameters + { + private readonly bool mInitiator; + private readonly ECPrivateKeyParameters mStaticPrivateKey; + private readonly ECPoint mStaticPublicPoint; + private readonly ECPrivateKeyParameters mEphemeralPrivateKey; + private readonly ECPoint mEphemeralPublicPoint; + + public SM2KeyExchangePrivateParameters( + bool initiator, + ECPrivateKeyParameters staticPrivateKey, + ECPrivateKeyParameters ephemeralPrivateKey) + { + if (staticPrivateKey == null) + throw new ArgumentNullException("staticPrivateKey"); + if (ephemeralPrivateKey == null) + throw new ArgumentNullException("ephemeralPrivateKey"); + + ECDomainParameters parameters = staticPrivateKey.Parameters; + if (!parameters.Equals(ephemeralPrivateKey.Parameters)) + throw new ArgumentException("Static and ephemeral private keys have different domain parameters"); + + this.mInitiator = initiator; + this.mStaticPrivateKey = staticPrivateKey; + this.mStaticPublicPoint = parameters.G.Multiply(staticPrivateKey.D).Normalize(); + this.mEphemeralPrivateKey = ephemeralPrivateKey; + this.mEphemeralPublicPoint = parameters.G.Multiply(ephemeralPrivateKey.D).Normalize(); + } + + public virtual bool IsInitiator + { + get { return mInitiator; } + } + + public virtual ECPrivateKeyParameters StaticPrivateKey + { + get { return mStaticPrivateKey; } + } + + public virtual ECPoint StaticPublicPoint + { + get { return mStaticPublicPoint; } + } + + public virtual ECPrivateKeyParameters EphemeralPrivateKey + { + get { return mEphemeralPrivateKey; } + } + + public virtual ECPoint EphemeralPublicPoint + { + get { return mEphemeralPublicPoint; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePrivateParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePrivateParameters.cs.meta new file mode 100644 index 00000000..c8bf417d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePrivateParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e8b2b11f2864c51499f5b2c0cad414b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePublicParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePublicParameters.cs new file mode 100644 index 00000000..f39eb380 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePublicParameters.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + /// Public parameters for an SM2 key exchange. + /// In this case the ephemeralPublicKey provides the random point used in the algorithm. + public class SM2KeyExchangePublicParameters + : ICipherParameters + { + private readonly ECPublicKeyParameters mStaticPublicKey; + private readonly ECPublicKeyParameters mEphemeralPublicKey; + + public SM2KeyExchangePublicParameters( + ECPublicKeyParameters staticPublicKey, + ECPublicKeyParameters ephemeralPublicKey) + { + if (staticPublicKey == null) + throw new ArgumentNullException("staticPublicKey"); + if (ephemeralPublicKey == null) + throw new ArgumentNullException("ephemeralPublicKey"); + if (!staticPublicKey.Parameters.Equals(ephemeralPublicKey.Parameters)) + throw new ArgumentException("Static and ephemeral public keys have different domain parameters"); + + this.mStaticPublicKey = staticPublicKey; + this.mEphemeralPublicKey = ephemeralPublicKey; + } + + public virtual ECPublicKeyParameters StaticPublicKey + { + get { return mStaticPublicKey; } + } + + public virtual ECPublicKeyParameters EphemeralPublicKey + { + get { return mEphemeralPublicKey; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePublicParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePublicParameters.cs.meta new file mode 100644 index 00000000..71a3933c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SM2KeyExchangePublicParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 64f9f4869ef3631459fffa7cffcff1cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SkeinParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SkeinParameters.cs new file mode 100644 index 00000000..a93a8acc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SkeinParameters.cs @@ -0,0 +1,290 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Globalization; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + + /// + /// Parameters for the Skein hash function - a series of byte[] strings identified by integer tags. + /// + /// + /// Parameterised Skein can be used for: + ///
    + ///
  • MAC generation, by providing a key.
  • + ///
  • Randomised hashing, by providing a nonce.
  • + ///
  • A hash function for digital signatures, associating a + /// public key with the message digest.
  • + ///
  • A key derivation function, by providing a + /// key identifier.
  • + ///
  • Personalised hashing, by providing a + /// recommended format or + /// arbitrary personalisation string.
  • + ///
+ ///
+ /// + /// + /// + public class SkeinParameters + : ICipherParameters + { + /// + /// The parameter type for a secret key, supporting MAC or KDF functions: 0 + /// + public const int PARAM_TYPE_KEY = 0; + + /// + /// The parameter type for the Skein configuration block: 4 + /// + public const int PARAM_TYPE_CONFIG = 4; + + /// + /// The parameter type for a personalisation string: 8 + /// + public const int PARAM_TYPE_PERSONALISATION = 8; + + /// + /// The parameter type for a public key: 12 + /// + public const int PARAM_TYPE_PUBLIC_KEY = 12; + + /// + /// The parameter type for a key identifier string: 16 + /// + public const int PARAM_TYPE_KEY_IDENTIFIER = 16; + + /// + /// The parameter type for a nonce: 20 + /// + public const int PARAM_TYPE_NONCE = 20; + + /// + /// The parameter type for the message: 48 + /// + public const int PARAM_TYPE_MESSAGE = 48; + + /// + /// The parameter type for the output transformation: 63 + /// + public const int PARAM_TYPE_OUTPUT = 63; + + private IDictionary parameters; + + public SkeinParameters() + : this(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable()) + + { + } + + private SkeinParameters(IDictionary parameters) + { + this.parameters = parameters; + } + + /// + /// Obtains a map of type (int) to value (byte[]) for the parameters tracked in this object. + /// + public IDictionary GetParameters() + { + return parameters; + } + + /// + /// Obtains the value of the key parameter, or null if not + /// set. + /// + /// The key. + public byte[] GetKey() + { + return (byte[])parameters[PARAM_TYPE_KEY]; + } + + /// + /// Obtains the value of the personalisation parameter, or + /// null if not set. + /// + public byte[] GetPersonalisation() + { + return (byte[])parameters[PARAM_TYPE_PERSONALISATION]; + } + + /// + /// Obtains the value of the public key parameter, or + /// null if not set. + /// + public byte[] GetPublicKey() + { + return (byte[])parameters[PARAM_TYPE_PUBLIC_KEY]; + } + + /// + /// Obtains the value of the key identifier parameter, or + /// null if not set. + /// + public byte[] GetKeyIdentifier() + { + return (byte[])parameters[PARAM_TYPE_KEY_IDENTIFIER]; + } + + /// + /// Obtains the value of the nonce parameter, or null if + /// not set. + /// + public byte[] GetNonce() + { + return (byte[])parameters[PARAM_TYPE_NONCE]; + } + + /// + /// A builder for . + /// + public class Builder + { + private IDictionary parameters = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + public Builder() + { + } + + public Builder(IDictionary paramsMap) + { + IEnumerator keys = paramsMap.Keys.GetEnumerator(); + while (keys.MoveNext()) + { + int key = (int)keys.Current; + parameters.Add(key, paramsMap[key]); + } + } + + public Builder(SkeinParameters parameters) + { + IEnumerator keys = parameters.parameters.Keys.GetEnumerator(); + while (keys.MoveNext()) + { + int key = (int)keys.Current; + this.parameters.Add(key, parameters.parameters[key]); + } + } + + /// + /// Sets a parameters to apply to the Skein hash function. + /// + /// + /// Parameter types must be in the range 0,5..62, and cannot use the value 48 + /// (reserved for message body). + ///

+ /// Parameters with type < 48 are processed before + /// the message content, parameters with type > 48 + /// are processed after the message and prior to output. + /// + /// the type of the parameter, in the range 5..62. + /// the byte sequence of the parameter. + public Builder Set(int type, byte[] value) + { + if (value == null) + { + throw new ArgumentException("Parameter value must not be null."); + } + if ((type != PARAM_TYPE_KEY) + && (type <= PARAM_TYPE_CONFIG || type >= PARAM_TYPE_OUTPUT || type == PARAM_TYPE_MESSAGE)) + { + throw new ArgumentException("Parameter types must be in the range 0,5..47,49..62."); + } + if (type == PARAM_TYPE_CONFIG) + { + throw new ArgumentException("Parameter type " + PARAM_TYPE_CONFIG + + " is reserved for internal use."); + } + this.parameters.Add(type, value); + return this; + } + + ///

+ /// Sets the parameter. + /// + public Builder SetKey(byte[] key) + { + return Set(PARAM_TYPE_KEY, key); + } + + /// + /// Sets the parameter. + /// + public Builder SetPersonalisation(byte[] personalisation) + { + return Set(PARAM_TYPE_PERSONALISATION, personalisation); + } + + /// + /// Implements the recommended personalisation format for Skein defined in Section 4.11 of + /// the Skein 1.3 specification. + /// + /// + /// The format is YYYYMMDD email@address distinguisher, encoded to a byte + /// sequence using UTF-8 encoding. + /// + /// the date the personalised application of the Skein was defined. + /// the email address of the creation of the personalised application. + /// an arbitrary personalisation string distinguishing the application. + public Builder SetPersonalisation(DateTime date, string emailAddress, string distinguisher) + { + try + { + MemoryStream bout = new MemoryStream(); + StreamWriter outBytes = new StreamWriter(bout, System.Text.Encoding.UTF8); + outBytes.Write(date.ToString("YYYYMMDD", CultureInfo.InvariantCulture)); + outBytes.Write(" "); + outBytes.Write(emailAddress); + outBytes.Write(" "); + outBytes.Write(distinguisher); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(outBytes); + return Set(PARAM_TYPE_PERSONALISATION, bout.ToArray()); + } + catch (IOException e) + { + throw new InvalidOperationException("Byte I/O failed.", e); + } + } + + /// + /// Sets the parameter. + /// + public Builder SetPublicKey(byte[] publicKey) + { + return Set(PARAM_TYPE_PUBLIC_KEY, publicKey); + } + + /// + /// Sets the parameter. + /// + public Builder SetKeyIdentifier(byte[] keyIdentifier) + { + return Set(PARAM_TYPE_KEY_IDENTIFIER, keyIdentifier); + } + + /// + /// Sets the parameter. + /// + public Builder SetNonce(byte[] nonce) + { + return Set(PARAM_TYPE_NONCE, nonce); + } + + /// + /// Constructs a new instance with the parameters provided to this + /// builder. + /// + public SkeinParameters Build() + { + return new SkeinParameters(parameters); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SkeinParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SkeinParameters.cs.meta new file mode 100644 index 00000000..258bb2a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/SkeinParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 04b73b990c8ab224b97961b1dd1fb4f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Srp6GroupParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Srp6GroupParameters.cs new file mode 100644 index 00000000..f37abe61 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Srp6GroupParameters.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public sealed class Srp6GroupParameters + { + private readonly BigInteger n, g; + + public Srp6GroupParameters(BigInteger N, BigInteger g) + { + this.n = N; + this.g = g; + } + + public BigInteger G + { + get { return g; } + } + + public BigInteger N + { + get { return n; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Srp6GroupParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Srp6GroupParameters.cs.meta new file mode 100644 index 00000000..345ab156 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/Srp6GroupParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 04d30757713732143b4d9cc5087b8682 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/TweakableBlockCipherParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/TweakableBlockCipherParameters.cs new file mode 100644 index 00000000..53f0308c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/TweakableBlockCipherParameters.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + + /// + /// Parameters for tweakable block ciphers. + /// + public class TweakableBlockCipherParameters + : ICipherParameters + { + private readonly byte[] tweak; + private readonly KeyParameter key; + + public TweakableBlockCipherParameters(KeyParameter key, byte[] tweak) + { + this.key = key; + this.tweak = Arrays.Clone(tweak); + } + + /// + /// Gets the key. + /// + /// the key to use, or null to use the current key. + public KeyParameter Key + { + get { return key; } + } + + /// + /// Gets the tweak value. + /// + /// The tweak to use, or null to use the current tweak. + public byte[] Tweak + { + get { return tweak; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/TweakableBlockCipherParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/TweakableBlockCipherParameters.cs.meta new file mode 100644 index 00000000..5ea901ac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/TweakableBlockCipherParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8535be3fd9fd37f4387792c8e64eb4b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519KeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519KeyGenerationParameters.cs new file mode 100644 index 00000000..718d57a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519KeyGenerationParameters.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class X25519KeyGenerationParameters + : KeyGenerationParameters + { + public X25519KeyGenerationParameters(SecureRandom random) + : base(random, 255) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519KeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519KeyGenerationParameters.cs.meta new file mode 100644 index 00000000..fbae2b1a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519KeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 34b65ca852361294a88bedf107bfbb97 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PrivateKeyParameters.cs new file mode 100644 index 00000000..6dbf9c06 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PrivateKeyParameters.cs @@ -0,0 +1,67 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public sealed class X25519PrivateKeyParameters + : AsymmetricKeyParameter + { + public static readonly int KeySize = X25519.ScalarSize; + public static readonly int SecretSize = X25519.PointSize; + + private readonly byte[] data = new byte[KeySize]; + + public X25519PrivateKeyParameters(SecureRandom random) + : base(true) + { + X25519.GeneratePrivateKey(random, data); + } + + public X25519PrivateKeyParameters(byte[] buf, int off) + : base(true) + { + Array.Copy(buf, off, data, 0, KeySize); + } + + public X25519PrivateKeyParameters(Stream input) + : base(true) + { + if (KeySize != Streams.ReadFully(input, data)) + throw new EndOfStreamException("EOF encountered in middle of X25519 private key"); + } + + public void Encode(byte[] buf, int off) + { + Array.Copy(data, 0, buf, off, KeySize); + } + + public byte[] GetEncoded() + { + return Arrays.Clone(data); + } + + public X25519PublicKeyParameters GeneratePublicKey() + { + byte[] publicKey = new byte[X25519.PointSize]; + X25519.GeneratePublicKey(data, 0, publicKey, 0); + return new X25519PublicKeyParameters(publicKey, 0); + } + + public void GenerateSecret(X25519PublicKeyParameters publicKey, byte[] buf, int off) + { + byte[] encoded = new byte[X25519.PointSize]; + publicKey.Encode(encoded, 0); + if (!X25519.CalculateAgreement(data, 0, encoded, 0, buf, off)) + throw new InvalidOperationException("X25519 agreement failed"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PrivateKeyParameters.cs.meta new file mode 100644 index 00000000..c907832f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a01dc8b4999799642ba9fc316dccb701 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PublicKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PublicKeyParameters.cs new file mode 100644 index 00000000..2fc13afc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PublicKeyParameters.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public sealed class X25519PublicKeyParameters + : AsymmetricKeyParameter + { + public static readonly int KeySize = X25519.PointSize; + + private readonly byte[] data = new byte[KeySize]; + + public X25519PublicKeyParameters(byte[] buf, int off) + : base(false) + { + Array.Copy(buf, off, data, 0, KeySize); + } + + public X25519PublicKeyParameters(Stream input) + : base(false) + { + if (KeySize != Streams.ReadFully(input, data)) + throw new EndOfStreamException("EOF encountered in middle of X25519 public key"); + } + + public void Encode(byte[] buf, int off) + { + Array.Copy(data, 0, buf, off, KeySize); + } + + public byte[] GetEncoded() + { + return Arrays.Clone(data); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PublicKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PublicKeyParameters.cs.meta new file mode 100644 index 00000000..4e952bff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X25519PublicKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: adb017b96c708f947bdfd05e8ed09197 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448KeyGenerationParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448KeyGenerationParameters.cs new file mode 100644 index 00000000..87749fa8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448KeyGenerationParameters.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public class X448KeyGenerationParameters + : KeyGenerationParameters + { + public X448KeyGenerationParameters(SecureRandom random) + : base(random, 448) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448KeyGenerationParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448KeyGenerationParameters.cs.meta new file mode 100644 index 00000000..67b6f3b8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448KeyGenerationParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 28e1826bc7c435c4c90c3a42d42b3641 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PrivateKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PrivateKeyParameters.cs new file mode 100644 index 00000000..f1abb297 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PrivateKeyParameters.cs @@ -0,0 +1,67 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public sealed class X448PrivateKeyParameters + : AsymmetricKeyParameter + { + public static readonly int KeySize = X448.ScalarSize; + public static readonly int SecretSize = X448.PointSize; + + private readonly byte[] data = new byte[KeySize]; + + public X448PrivateKeyParameters(SecureRandom random) + : base(true) + { + X448.GeneratePrivateKey(random, data); + } + + public X448PrivateKeyParameters(byte[] buf, int off) + : base(true) + { + Array.Copy(buf, off, data, 0, KeySize); + } + + public X448PrivateKeyParameters(Stream input) + : base(true) + { + if (KeySize != Streams.ReadFully(input, data)) + throw new EndOfStreamException("EOF encountered in middle of X448 private key"); + } + + public void Encode(byte[] buf, int off) + { + Array.Copy(data, 0, buf, off, KeySize); + } + + public byte[] GetEncoded() + { + return Arrays.Clone(data); + } + + public X448PublicKeyParameters GeneratePublicKey() + { + byte[] publicKey = new byte[X448.PointSize]; + X448.GeneratePublicKey(data, 0, publicKey, 0); + return new X448PublicKeyParameters(publicKey, 0); + } + + public void GenerateSecret(X448PublicKeyParameters publicKey, byte[] buf, int off) + { + byte[] encoded = new byte[X448.PointSize]; + publicKey.Encode(encoded, 0); + if (!X448.CalculateAgreement(data, 0, encoded, 0, buf, off)) + throw new InvalidOperationException("X448 agreement failed"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PrivateKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PrivateKeyParameters.cs.meta new file mode 100644 index 00000000..ffd26a69 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PrivateKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9bfb9abfbe5e9144192249ae8d52c553 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PublicKeyParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PublicKeyParameters.cs new file mode 100644 index 00000000..4ea87ea5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PublicKeyParameters.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters +{ + public sealed class X448PublicKeyParameters + : AsymmetricKeyParameter + { + public static readonly int KeySize = X448.PointSize; + + private readonly byte[] data = new byte[KeySize]; + + public X448PublicKeyParameters(byte[] buf, int off) + : base(false) + { + Array.Copy(buf, off, data, 0, KeySize); + } + + public X448PublicKeyParameters(Stream input) + : base(false) + { + if (KeySize != Streams.ReadFully(input, data)) + throw new EndOfStreamException("EOF encountered in middle of X448 public key"); + } + + public void Encode(byte[] buf, int off) + { + Array.Copy(data, 0, buf, off, KeySize); + } + + public byte[] GetEncoded() + { + return Arrays.Clone(data); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PublicKeyParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PublicKeyParameters.cs.meta new file mode 100644 index 00000000..3e0f9144 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/parameters/X448PublicKeyParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f1678e519b7aad4bb9fa3e9eadd39c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng.meta new file mode 100644 index 00000000..90986746 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0a4df581a93a3a246848f91de3e20edf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/BasicEntropySourceProvider.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/BasicEntropySourceProvider.cs new file mode 100644 index 00000000..06866218 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/BasicEntropySourceProvider.cs @@ -0,0 +1,75 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + /** + * An EntropySourceProvider where entropy generation is based on a SecureRandom output using SecureRandom.generateSeed(). + */ + public class BasicEntropySourceProvider + : IEntropySourceProvider + { + private readonly SecureRandom mSecureRandom; + private readonly bool mPredictionResistant; + + /** + * Create a entropy source provider based on the passed in SecureRandom. + * + * @param secureRandom the SecureRandom to base EntropySource construction on. + * @param isPredictionResistant boolean indicating if the SecureRandom is based on prediction resistant entropy or not (true if it is). + */ + public BasicEntropySourceProvider(SecureRandom secureRandom, bool isPredictionResistant) + { + mSecureRandom = secureRandom; + mPredictionResistant = isPredictionResistant; + } + + /** + * Return an entropy source that will create bitsRequired bits of entropy on + * each invocation of getEntropy(). + * + * @param bitsRequired size (in bits) of entropy to be created by the provided source. + * @return an EntropySource that generates bitsRequired bits of entropy on each call to its getEntropy() method. + */ + public IEntropySource Get(int bitsRequired) + { + return new BasicEntropySource(mSecureRandom, mPredictionResistant, bitsRequired); + } + + private class BasicEntropySource + : IEntropySource + { + private readonly SecureRandom mSecureRandom; + private readonly bool mPredictionResistant; + private readonly int mEntropySize; + + internal BasicEntropySource(SecureRandom secureRandom, bool predictionResistant, int entropySize) + { + this.mSecureRandom = secureRandom; + this.mPredictionResistant = predictionResistant; + this.mEntropySize = entropySize; + } + + bool IEntropySource.IsPredictionResistant + { + get { return mPredictionResistant; } + } + + byte[] IEntropySource.GetEntropy() + { + // TODO[FIPS] Not all SecureRandom implementations are considered valid entropy sources + return SecureRandom.GetNextBytes(mSecureRandom, (mEntropySize + 7) / 8); + } + + int IEntropySource.EntropySize + { + get { return mEntropySize; } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/BasicEntropySourceProvider.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/BasicEntropySourceProvider.cs.meta new file mode 100644 index 00000000..94715764 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/BasicEntropySourceProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f55c9b6e8b6c844ca193d3ee8949628 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiEntropySourceProvider.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiEntropySourceProvider.cs new file mode 100644 index 00000000..f717ac60 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiEntropySourceProvider.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if !(NETCF_1_0 || PORTABLE || NETFX_CORE) +using System; +using System.Security.Cryptography; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + public class CryptoApiEntropySourceProvider + : IEntropySourceProvider + { + private readonly RandomNumberGenerator mRng; + private readonly bool mPredictionResistant; + + public CryptoApiEntropySourceProvider() + : this(RandomNumberGenerator.Create(), true) + { + } + + public CryptoApiEntropySourceProvider(RandomNumberGenerator rng, bool isPredictionResistant) + { + if (rng == null) + throw new ArgumentNullException("rng"); + + mRng = rng; + mPredictionResistant = isPredictionResistant; + } + + public IEntropySource Get(int bitsRequired) + { + return new CryptoApiEntropySource(mRng, mPredictionResistant, bitsRequired); + } + + private class CryptoApiEntropySource + : IEntropySource + { + private readonly RandomNumberGenerator mRng; + private readonly bool mPredictionResistant; + private readonly int mEntropySize; + + internal CryptoApiEntropySource(RandomNumberGenerator rng, bool predictionResistant, int entropySize) + { + this.mRng = rng; + this.mPredictionResistant = predictionResistant; + this.mEntropySize = entropySize; + } + + #region IEntropySource Members + + bool IEntropySource.IsPredictionResistant + { + get { return mPredictionResistant; } + } + + byte[] IEntropySource.GetEntropy() + { + byte[] result = new byte[(mEntropySize + 7) / 8]; + mRng.GetBytes(result); + return result; + } + + int IEntropySource.EntropySize + { + get { return mEntropySize; } + } + + #endregion + } + } +} + +#endif +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiEntropySourceProvider.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiEntropySourceProvider.cs.meta new file mode 100644 index 00000000..785dec23 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiEntropySourceProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 25ec2a0632ecc8449b1d88c41c111fe2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiRandomGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiRandomGenerator.cs new file mode 100644 index 00000000..16366c52 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiRandomGenerator.cs @@ -0,0 +1,70 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if !(NETCF_1_0 || PORTABLE || NETFX_CORE) + +using System; +using System.Security.Cryptography; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + /// + /// Uses RandomNumberGenerator.Create() to get randomness generator + /// + public class CryptoApiRandomGenerator + : IRandomGenerator + { + private readonly RandomNumberGenerator rndProv; + + public CryptoApiRandomGenerator() + : this(RandomNumberGenerator.Create()) + { + } + + public CryptoApiRandomGenerator(RandomNumberGenerator rng) + { + this.rndProv = rng; + } + + #region IRandomGenerator Members + + public virtual void AddSeedMaterial(byte[] seed) + { + // We don't care about the seed + } + + public virtual void AddSeedMaterial(long seed) + { + // We don't care about the seed + } + + public virtual void NextBytes(byte[] bytes) + { + rndProv.GetBytes(bytes); + } + + public virtual void NextBytes(byte[] bytes, int start, int len) + { + if (start < 0) + throw new ArgumentException("Start offset cannot be negative", "start"); + if (bytes.Length < (start + len)) + throw new ArgumentException("Byte array too small for requested offset and length"); + + if (bytes.Length == len && start == 0) + { + NextBytes(bytes); + } + else + { + byte[] tmpBuf = new byte[len]; + NextBytes(tmpBuf); + Array.Copy(tmpBuf, 0, bytes, start, len); + } + } + + #endregion + } +} + +#endif +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiRandomGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiRandomGenerator.cs.meta new file mode 100644 index 00000000..74923c7c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/CryptoApiRandomGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ccbe3ba15c23a8a4d94f9d684f23a748 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/DigestRandomGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/DigestRandomGenerator.cs new file mode 100644 index 00000000..5c3e5780 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/DigestRandomGenerator.cs @@ -0,0 +1,131 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + /** + * Random generation based on the digest with counter. Calling AddSeedMaterial will + * always increase the entropy of the hash. + *

+ * Internal access to the digest is synchronized so a single one of these can be shared. + *

+ */ + public class DigestRandomGenerator + : IRandomGenerator + { + private const long CYCLE_COUNT = 10; + + private long stateCounter; + private long seedCounter; + private IDigest digest; + private byte[] state; + private byte[] seed; + + public DigestRandomGenerator( + IDigest digest) + { + this.digest = digest; + + this.seed = new byte[digest.GetDigestSize()]; + this.seedCounter = 1; + + this.state = new byte[digest.GetDigestSize()]; + this.stateCounter = 1; + } + + public void AddSeedMaterial( + byte[] inSeed) + { + lock (this) + { + DigestUpdate(inSeed); + DigestUpdate(seed); + DigestDoFinal(seed); + } + } + + public void AddSeedMaterial( + long rSeed) + { + lock (this) + { + DigestAddCounter(rSeed); + DigestUpdate(seed); + DigestDoFinal(seed); + } + } + + public void NextBytes( + byte[] bytes) + { + NextBytes(bytes, 0, bytes.Length); + } + + public void NextBytes( + byte[] bytes, + int start, + int len) + { + lock (this) + { + int stateOff = 0; + + GenerateState(); + + int end = start + len; + for (int i = start; i < end; ++i) + { + if (stateOff == state.Length) + { + GenerateState(); + stateOff = 0; + } + bytes[i] = state[stateOff++]; + } + } + } + + private void CycleSeed() + { + DigestUpdate(seed); + DigestAddCounter(seedCounter++); + DigestDoFinal(seed); + } + + private void GenerateState() + { + DigestAddCounter(stateCounter++); + DigestUpdate(state); + DigestUpdate(seed); + DigestDoFinal(state); + + if ((stateCounter % CYCLE_COUNT) == 0) + { + CycleSeed(); + } + } + + private void DigestAddCounter(long seedVal) + { + byte[] bytes = new byte[8]; + Pack.UInt64_To_LE((ulong)seedVal, bytes); + digest.BlockUpdate(bytes, 0, bytes.Length); + } + + private void DigestUpdate(byte[] inSeed) + { + digest.BlockUpdate(inSeed, 0, inSeed.Length); + } + + private void DigestDoFinal(byte[] result) + { + digest.DoFinal(result, 0); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/DigestRandomGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/DigestRandomGenerator.cs.meta new file mode 100644 index 00000000..41699862 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/DigestRandomGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7979612bf0f2722478158ecadb846f1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/EntropyUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/EntropyUtilities.cs new file mode 100644 index 00000000..a0818027 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/EntropyUtilities.cs @@ -0,0 +1,34 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + public abstract class EntropyUtilities + { + /** + * Generate numBytes worth of entropy from the passed in entropy source. + * + * @param entropySource the entropy source to request the data from. + * @param numBytes the number of bytes of entropy requested. + * @return a byte array populated with the random data. + */ + public static byte[] GenerateSeed(IEntropySource entropySource, int numBytes) + { + byte[] bytes = new byte[numBytes]; + int count = 0; + while (count < numBytes) + { + byte[] entropy = entropySource.GetEntropy(); + int toCopy = System.Math.Min(bytes.Length, numBytes - count); + Array.Copy(entropy, 0, bytes, count, toCopy); + count += toCopy; + } + return bytes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/EntropyUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/EntropyUtilities.cs.meta new file mode 100644 index 00000000..862ddfdc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/EntropyUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 49e236d42630bab4fa9185520ecc86be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IDrbgProvider.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IDrbgProvider.cs new file mode 100644 index 00000000..1f05d88c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IDrbgProvider.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + internal interface IDrbgProvider + { + ISP80090Drbg Get(IEntropySource entropySource); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IDrbgProvider.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IDrbgProvider.cs.meta new file mode 100644 index 00000000..0f39ba86 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IDrbgProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4a6b6d841dbe6e4d9b5e05bbb356b42 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IRandomGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IRandomGenerator.cs new file mode 100644 index 00000000..ebc5cbd6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IRandomGenerator.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + /// Generic interface for objects generating random bytes. + public interface IRandomGenerator + { + /// Add more seed material to the generator. + /// A byte array to be mixed into the generator's state. + void AddSeedMaterial(byte[] seed); + + /// Add more seed material to the generator. + /// A long value to be mixed into the generator's state. + void AddSeedMaterial(long seed); + + /// Fill byte array with random values. + /// Array to be filled. + void NextBytes(byte[] bytes); + + /// Fill byte array with random values. + /// Array to receive bytes. + /// Index to start filling at. + /// Length of segment to fill. + void NextBytes(byte[] bytes, int start, int len); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IRandomGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IRandomGenerator.cs.meta new file mode 100644 index 00000000..49efec88 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/IRandomGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4455377f4c3b6cf4fb000aca48c08ab8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ReversedWindowGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ReversedWindowGenerator.cs new file mode 100644 index 00000000..02e092e4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ReversedWindowGenerator.cs @@ -0,0 +1,102 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + /// + /// Takes bytes generated by an underling RandomGenerator and reverses the order in + /// each small window (of configurable size). + ///

+ /// Access to internals is synchronized so a single one of these can be shared. + ///

+ ///
+ public class ReversedWindowGenerator + : IRandomGenerator + { + private readonly IRandomGenerator generator; + + private byte[] window; + private int windowCount; + + public ReversedWindowGenerator( + IRandomGenerator generator, + int windowSize) + { + if (generator == null) + throw new ArgumentNullException("generator"); + if (windowSize < 2) + throw new ArgumentException("Window size must be at least 2", "windowSize"); + + this.generator = generator; + this.window = new byte[windowSize]; + } + + /// Add more seed material to the generator. + /// A byte array to be mixed into the generator's state. + public virtual void AddSeedMaterial( + byte[] seed) + { + lock (this) + { + windowCount = 0; + generator.AddSeedMaterial(seed); + } + } + + /// Add more seed material to the generator. + /// A long value to be mixed into the generator's state. + public virtual void AddSeedMaterial( + long seed) + { + lock (this) + { + windowCount = 0; + generator.AddSeedMaterial(seed); + } + } + + /// Fill byte array with random values. + /// Array to be filled. + public virtual void NextBytes( + byte[] bytes) + { + doNextBytes(bytes, 0, bytes.Length); + } + + /// Fill byte array with random values. + /// Array to receive bytes. + /// Index to start filling at. + /// Length of segment to fill. + public virtual void NextBytes( + byte[] bytes, + int start, + int len) + { + doNextBytes(bytes, start, len); + } + + private void doNextBytes( + byte[] bytes, + int start, + int len) + { + lock (this) + { + int done = 0; + while (done < len) + { + if (windowCount < 1) + { + generator.NextBytes(window, 0, window.Length); + windowCount = window.Length; + } + + bytes[start + done++] = window[--windowCount]; + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ReversedWindowGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ReversedWindowGenerator.cs.meta new file mode 100644 index 00000000..659a1ced --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ReversedWindowGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c9b45d1f0973ac4a9db88250e6d0ebb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandom.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandom.cs new file mode 100644 index 00000000..a2e4d3ad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandom.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + public class SP800SecureRandom + : SecureRandom + { + private readonly IDrbgProvider mDrbgProvider; + private readonly bool mPredictionResistant; + private readonly SecureRandom mRandomSource; + private readonly IEntropySource mEntropySource; + + private ISP80090Drbg mDrbg; + + internal SP800SecureRandom(SecureRandom randomSource, IEntropySource entropySource, IDrbgProvider drbgProvider, bool predictionResistant) + : base((IRandomGenerator)null) + { + this.mRandomSource = randomSource; + this.mEntropySource = entropySource; + this.mDrbgProvider = drbgProvider; + this.mPredictionResistant = predictionResistant; + } + + public override void SetSeed(byte[] seed) + { + lock (this) + { + if (mRandomSource != null) + { + this.mRandomSource.SetSeed(seed); + } + } + } + + public override void SetSeed(long seed) + { + lock (this) + { + // this will happen when SecureRandom() is created + if (mRandomSource != null) + { + this.mRandomSource.SetSeed(seed); + } + } + } + + public override void NextBytes(byte[] bytes) + { + lock (this) + { + if (mDrbg == null) + { + mDrbg = mDrbgProvider.Get(mEntropySource); + } + + // check if a reseed is required... + if (mDrbg.Generate(bytes, null, mPredictionResistant) < 0) + { + mDrbg.Reseed(null); + mDrbg.Generate(bytes, null, mPredictionResistant); + } + } + } + + public override void NextBytes(byte[] buf, int off, int len) + { + byte[] bytes = new byte[len]; + NextBytes(bytes); + Array.Copy(bytes, 0, buf, off, len); + } + + public override byte[] GenerateSeed(int numBytes) + { + return EntropyUtilities.GenerateSeed(mEntropySource, numBytes); + } + + /// Force a reseed of the DRBG. + /// optional additional input + public virtual void Reseed(byte[] additionalInput) + { + lock (this) + { + if (mDrbg == null) + { + mDrbg = mDrbgProvider.Get(mEntropySource); + } + + mDrbg.Reseed(additionalInput); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandom.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandom.cs.meta new file mode 100644 index 00000000..c0ad78a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 065a9c94a09b9e14faf04e78e06d355c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandomBuilder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandomBuilder.cs new file mode 100644 index 00000000..c7c9179e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandomBuilder.cs @@ -0,0 +1,212 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + /** + * Builder class for making SecureRandom objects based on SP 800-90A Deterministic Random Bit Generators (DRBG). + */ + public class SP800SecureRandomBuilder + { + private readonly SecureRandom mRandom; + private readonly IEntropySourceProvider mEntropySourceProvider; + + private byte[] mPersonalizationString = null; + private int mSecurityStrength = 256; + private int mEntropyBitsRequired = 256; + + /** + * Basic constructor, creates a builder using an EntropySourceProvider based on the default SecureRandom with + * predictionResistant set to false. + *

+ * Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + * the default SecureRandom does for its generateSeed() call. + *

+ */ + public SP800SecureRandomBuilder() + : this(new SecureRandom(), false) + { + } + + /** + * Construct a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value + * for prediction resistance. + *

+ * Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + * the passed in SecureRandom does for its generateSeed() call. + *

+ * @param entropySource + * @param predictionResistant + */ + public SP800SecureRandomBuilder(SecureRandom entropySource, bool predictionResistant) + { + this.mRandom = entropySource; + this.mEntropySourceProvider = new BasicEntropySourceProvider(entropySource, predictionResistant); + } + + /** + * Create a builder which makes creates the SecureRandom objects from a specified entropy source provider. + *

+ * Note: If this constructor is used any calls to setSeed() in the resulting SecureRandom will be ignored. + *

+ * @param entropySourceProvider a provider of EntropySource objects. + */ + public SP800SecureRandomBuilder(IEntropySourceProvider entropySourceProvider) + { + this.mRandom = null; + this.mEntropySourceProvider = entropySourceProvider; + } + + /** + * Set the personalization string for DRBG SecureRandoms created by this builder + * @param personalizationString the personalisation string for the underlying DRBG. + * @return the current builder. + */ + public SP800SecureRandomBuilder SetPersonalizationString(byte[] personalizationString) + { + this.mPersonalizationString = personalizationString; + return this; + } + + /** + * Set the security strength required for DRBGs used in building SecureRandom objects. + * + * @param securityStrength the security strength (in bits) + * @return the current builder. + */ + public SP800SecureRandomBuilder SetSecurityStrength(int securityStrength) + { + this.mSecurityStrength = securityStrength; + return this; + } + + /** + * Set the amount of entropy bits required for seeding and reseeding DRBGs used in building SecureRandom objects. + * + * @param entropyBitsRequired the number of bits of entropy to be requested from the entropy source on each seed/reseed. + * @return the current builder. + */ + public SP800SecureRandomBuilder SetEntropyBitsRequired(int entropyBitsRequired) + { + this.mEntropyBitsRequired = entropyBitsRequired; + return this; + } + + /** + * Build a SecureRandom based on a SP 800-90A Hash DRBG. + * + * @param digest digest algorithm to use in the DRBG underneath the SecureRandom. + * @param nonce nonce value to use in DRBG construction. + * @param predictionResistant specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes. + * @return a SecureRandom supported by a Hash DRBG. + */ + public SP800SecureRandom BuildHash(IDigest digest, byte[] nonce, bool predictionResistant) + { + return new SP800SecureRandom(mRandom, mEntropySourceProvider.Get(mEntropyBitsRequired), + new HashDrbgProvider(digest, nonce, mPersonalizationString, mSecurityStrength), predictionResistant); + } + + /** + * Build a SecureRandom based on a SP 800-90A CTR DRBG. + * + * @param cipher the block cipher to base the DRBG on. + * @param keySizeInBits key size in bits to be used with the block cipher. + * @param nonce nonce value to use in DRBG construction. + * @param predictionResistant specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes. + * @return a SecureRandom supported by a CTR DRBG. + */ + public SP800SecureRandom BuildCtr(IBlockCipher cipher, int keySizeInBits, byte[] nonce, bool predictionResistant) + { + return new SP800SecureRandom(mRandom, mEntropySourceProvider.Get(mEntropyBitsRequired), + new CtrDrbgProvider(cipher, keySizeInBits, nonce, mPersonalizationString, mSecurityStrength), predictionResistant); + } + + /** + * Build a SecureRandom based on a SP 800-90A HMAC DRBG. + * + * @param hMac HMAC algorithm to use in the DRBG underneath the SecureRandom. + * @param nonce nonce value to use in DRBG construction. + * @param predictionResistant specify whether the underlying DRBG in the resulting SecureRandom should reseed on each request for bytes. + * @return a SecureRandom supported by a HMAC DRBG. + */ + public SP800SecureRandom BuildHMac(IMac hMac, byte[] nonce, bool predictionResistant) + { + return new SP800SecureRandom(mRandom, mEntropySourceProvider.Get(mEntropyBitsRequired), + new HMacDrbgProvider(hMac, nonce, mPersonalizationString, mSecurityStrength), predictionResistant); + } + + private class HashDrbgProvider + : IDrbgProvider + { + private readonly IDigest mDigest; + private readonly byte[] mNonce; + private readonly byte[] mPersonalizationString; + private readonly int mSecurityStrength; + + public HashDrbgProvider(IDigest digest, byte[] nonce, byte[] personalizationString, int securityStrength) + { + this.mDigest = digest; + this.mNonce = nonce; + this.mPersonalizationString = personalizationString; + this.mSecurityStrength = securityStrength; + } + + public ISP80090Drbg Get(IEntropySource entropySource) + { + return new HashSP800Drbg(mDigest, mSecurityStrength, entropySource, mPersonalizationString, mNonce); + } + } + + private class HMacDrbgProvider + : IDrbgProvider + { + private readonly IMac mHMac; + private readonly byte[] mNonce; + private readonly byte[] mPersonalizationString; + private readonly int mSecurityStrength; + + public HMacDrbgProvider(IMac hMac, byte[] nonce, byte[] personalizationString, int securityStrength) + { + this.mHMac = hMac; + this.mNonce = nonce; + this.mPersonalizationString = personalizationString; + this.mSecurityStrength = securityStrength; + } + + public ISP80090Drbg Get(IEntropySource entropySource) + { + return new HMacSP800Drbg(mHMac, mSecurityStrength, entropySource, mPersonalizationString, mNonce); + } + } + + private class CtrDrbgProvider + : IDrbgProvider + { + private readonly IBlockCipher mBlockCipher; + private readonly int mKeySizeInBits; + private readonly byte[] mNonce; + private readonly byte[] mPersonalizationString; + private readonly int mSecurityStrength; + + public CtrDrbgProvider(IBlockCipher blockCipher, int keySizeInBits, byte[] nonce, byte[] personalizationString, int securityStrength) + { + this.mBlockCipher = blockCipher; + this.mKeySizeInBits = keySizeInBits; + this.mNonce = nonce; + this.mPersonalizationString = personalizationString; + this.mSecurityStrength = securityStrength; + } + + public ISP80090Drbg Get(IEntropySource entropySource) + { + return new CtrSP800Drbg(mBlockCipher, mKeySizeInBits, mSecurityStrength, entropySource, mPersonalizationString, mNonce); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandomBuilder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandomBuilder.cs.meta new file mode 100644 index 00000000..708e82b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/SP800SecureRandomBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0226b1743b2ec34a8fdaf4c0c3017eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ThreadedSeedGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ThreadedSeedGenerator.cs new file mode 100644 index 00000000..cc5330f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ThreadedSeedGenerator.cs @@ -0,0 +1,148 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Threading; + +#if NO_THREADS || NETFX_CORE +using System.Threading.Tasks; +#endif + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + /** + * A thread based seed generator - one source of randomness. + *

+ * Based on an idea from Marcus Lippert. + *

+ */ + public class ThreadedSeedGenerator + { + private class SeedGenerator + { +#if NETCF_1_0 + // No volatile keyword, but all fields implicitly volatile anyway + private int counter = 0; + private bool stop = false; +#else + private volatile int counter = 0; + private volatile bool stop = false; +#endif + + private void Run(object ignored) + { + while (!this.stop) + { + this.counter++; + } + } + + public byte[] GenerateSeed( + int numBytes, + bool fast) + { +#if SILVERLIGHT || PORTABLE || NETFX_CORE + return DoGenerateSeed(numBytes, fast); +#else + ThreadPriority originalPriority = Thread.CurrentThread.Priority; + try + { + Thread.CurrentThread.Priority = ThreadPriority.Normal; + return DoGenerateSeed(numBytes, fast); + } + finally + { + Thread.CurrentThread.Priority = originalPriority; + } +#endif + } + + private byte[] DoGenerateSeed( + int numBytes, + bool fast) + { + this.counter = 0; + this.stop = false; + + byte[] result = new byte[numBytes]; + int last = 0; + int end = fast ? numBytes : numBytes * 8; + +#if NO_THREADS || NETFX_CORE + Task.Factory.StartNew(() => Run(null), TaskCreationOptions.None); +#else + ThreadPool.QueueUserWorkItem(new WaitCallback(Run)); +#endif + +#if PORTABLE || NETFX_CORE + AutoResetEvent autoResetEvent = new AutoResetEvent(false); +#endif + + try + { + for (int i = 0; i < end; i++) + { + while (this.counter == last) + { + try + { +#if PORTABLE || NETFX_CORE + autoResetEvent.WaitOne(1); +#else + Thread.Sleep(1); +#endif + } + catch (Exception) + { + // ignore + } + } + + last = this.counter; + + if (fast) + { + result[i] = (byte)last; + } + else + { + int bytepos = i / 8; + result[bytepos] = (byte)((result[bytepos] << 1) | (last & 1)); + } + } + } + finally + { +#if PORTABLE || NETFX_CORE + autoResetEvent.Dispose(); +#endif + } + + this.stop = true; + + return result; + } + } + + /** + * Generate seed bytes. Set fast to false for best quality. + *

+ * If fast is set to true, the code should be round about 8 times faster when + * generating a long sequence of random bytes. 20 bytes of random values using + * the fast mode take less than half a second on a Nokia e70. If fast is set to false, + * it takes round about 2500 ms. + *

+ * @param numBytes the number of bytes to generate + * @param fast true if fast mode should be used + */ + public byte[] GenerateSeed( + int numBytes, + bool fast) + { + return new SeedGenerator().GenerateSeed(numBytes, fast); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ThreadedSeedGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ThreadedSeedGenerator.cs.meta new file mode 100644 index 00000000..1b08657a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/ThreadedSeedGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8f30b0f52d893c4e9b8fa70a2e9b93b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/VMPCRandomGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/VMPCRandomGenerator.cs new file mode 100644 index 00000000..b4840b02 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/VMPCRandomGenerator.cs @@ -0,0 +1,118 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + public class VmpcRandomGenerator + : IRandomGenerator + { + private byte n = 0; + + /// + /// Permutation generated by code: + /// + /// // First 1850 fractional digit of Pi number. + /// byte[] key = new BigInteger("14159265358979323846...5068006422512520511").ToByteArray(); + /// s = 0; + /// P = new byte[256]; + /// for (int i = 0; i < 256; i++) + /// { + /// P[i] = (byte) i; + /// } + /// for (int m = 0; m < 768; m++) + /// { + /// s = P[(s + P[m & 0xff] + key[m % key.length]) & 0xff]; + /// byte temp = P[m & 0xff]; + /// P[m & 0xff] = P[s & 0xff]; + /// P[s & 0xff] = temp; + /// } + /// + private byte[] P = + { + (byte) 0xbb, (byte) 0x2c, (byte) 0x62, (byte) 0x7f, (byte) 0xb5, (byte) 0xaa, (byte) 0xd4, + (byte) 0x0d, (byte) 0x81, (byte) 0xfe, (byte) 0xb2, (byte) 0x82, (byte) 0xcb, (byte) 0xa0, (byte) 0xa1, + (byte) 0x08, (byte) 0x18, (byte) 0x71, (byte) 0x56, (byte) 0xe8, (byte) 0x49, (byte) 0x02, (byte) 0x10, + (byte) 0xc4, (byte) 0xde, (byte) 0x35, (byte) 0xa5, (byte) 0xec, (byte) 0x80, (byte) 0x12, (byte) 0xb8, + (byte) 0x69, (byte) 0xda, (byte) 0x2f, (byte) 0x75, (byte) 0xcc, (byte) 0xa2, (byte) 0x09, (byte) 0x36, + (byte) 0x03, (byte) 0x61, (byte) 0x2d, (byte) 0xfd, (byte) 0xe0, (byte) 0xdd, (byte) 0x05, (byte) 0x43, + (byte) 0x90, (byte) 0xad, (byte) 0xc8, (byte) 0xe1, (byte) 0xaf, (byte) 0x57, (byte) 0x9b, (byte) 0x4c, + (byte) 0xd8, (byte) 0x51, (byte) 0xae, (byte) 0x50, (byte) 0x85, (byte) 0x3c, (byte) 0x0a, (byte) 0xe4, + (byte) 0xf3, (byte) 0x9c, (byte) 0x26, (byte) 0x23, (byte) 0x53, (byte) 0xc9, (byte) 0x83, (byte) 0x97, + (byte) 0x46, (byte) 0xb1, (byte) 0x99, (byte) 0x64, (byte) 0x31, (byte) 0x77, (byte) 0xd5, (byte) 0x1d, + (byte) 0xd6, (byte) 0x78, (byte) 0xbd, (byte) 0x5e, (byte) 0xb0, (byte) 0x8a, (byte) 0x22, (byte) 0x38, + (byte) 0xf8, (byte) 0x68, (byte) 0x2b, (byte) 0x2a, (byte) 0xc5, (byte) 0xd3, (byte) 0xf7, (byte) 0xbc, + (byte) 0x6f, (byte) 0xdf, (byte) 0x04, (byte) 0xe5, (byte) 0x95, (byte) 0x3e, (byte) 0x25, (byte) 0x86, + (byte) 0xa6, (byte) 0x0b, (byte) 0x8f, (byte) 0xf1, (byte) 0x24, (byte) 0x0e, (byte) 0xd7, (byte) 0x40, + (byte) 0xb3, (byte) 0xcf, (byte) 0x7e, (byte) 0x06, (byte) 0x15, (byte) 0x9a, (byte) 0x4d, (byte) 0x1c, + (byte) 0xa3, (byte) 0xdb, (byte) 0x32, (byte) 0x92, (byte) 0x58, (byte) 0x11, (byte) 0x27, (byte) 0xf4, + (byte) 0x59, (byte) 0xd0, (byte) 0x4e, (byte) 0x6a, (byte) 0x17, (byte) 0x5b, (byte) 0xac, (byte) 0xff, + (byte) 0x07, (byte) 0xc0, (byte) 0x65, (byte) 0x79, (byte) 0xfc, (byte) 0xc7, (byte) 0xcd, (byte) 0x76, + (byte) 0x42, (byte) 0x5d, (byte) 0xe7, (byte) 0x3a, (byte) 0x34, (byte) 0x7a, (byte) 0x30, (byte) 0x28, + (byte) 0x0f, (byte) 0x73, (byte) 0x01, (byte) 0xf9, (byte) 0xd1, (byte) 0xd2, (byte) 0x19, (byte) 0xe9, + (byte) 0x91, (byte) 0xb9, (byte) 0x5a, (byte) 0xed, (byte) 0x41, (byte) 0x6d, (byte) 0xb4, (byte) 0xc3, + (byte) 0x9e, (byte) 0xbf, (byte) 0x63, (byte) 0xfa, (byte) 0x1f, (byte) 0x33, (byte) 0x60, (byte) 0x47, + (byte) 0x89, (byte) 0xf0, (byte) 0x96, (byte) 0x1a, (byte) 0x5f, (byte) 0x93, (byte) 0x3d, (byte) 0x37, + (byte) 0x4b, (byte) 0xd9, (byte) 0xa8, (byte) 0xc1, (byte) 0x1b, (byte) 0xf6, (byte) 0x39, (byte) 0x8b, + (byte) 0xb7, (byte) 0x0c, (byte) 0x20, (byte) 0xce, (byte) 0x88, (byte) 0x6e, (byte) 0xb6, (byte) 0x74, + (byte) 0x8e, (byte) 0x8d, (byte) 0x16, (byte) 0x29, (byte) 0xf2, (byte) 0x87, (byte) 0xf5, (byte) 0xeb, + (byte) 0x70, (byte) 0xe3, (byte) 0xfb, (byte) 0x55, (byte) 0x9f, (byte) 0xc6, (byte) 0x44, (byte) 0x4a, + (byte) 0x45, (byte) 0x7d, (byte) 0xe2, (byte) 0x6b, (byte) 0x5c, (byte) 0x6c, (byte) 0x66, (byte) 0xa9, + (byte) 0x8c, (byte) 0xee, (byte) 0x84, (byte) 0x13, (byte) 0xa7, (byte) 0x1e, (byte) 0x9d, (byte) 0xdc, + (byte) 0x67, (byte) 0x48, (byte) 0xba, (byte) 0x2e, (byte) 0xe6, (byte) 0xa4, (byte) 0xab, (byte) 0x7c, + (byte) 0x94, (byte) 0x00, (byte) 0x21, (byte) 0xef, (byte) 0xea, (byte) 0xbe, (byte) 0xca, (byte) 0x72, + (byte) 0x4f, (byte) 0x52, (byte) 0x98, (byte) 0x3f, (byte) 0xc2, (byte) 0x14, (byte) 0x7b, (byte) 0x3b, + (byte) 0x54 + }; + + /// Value generated in the same way as P. + private byte s = (byte) 0xbe; + + public VmpcRandomGenerator() + { + } + + public virtual void AddSeedMaterial(byte[] seed) + { + for (int m = 0; m < seed.Length; m++) + { + s = P[(s + P[n & 0xff] + seed[m]) & 0xff]; + byte temp = P[n & 0xff]; + P[n & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + n = (byte) ((n + 1) & 0xff); + } + } + + public virtual void AddSeedMaterial(long seed) + { + AddSeedMaterial(Pack.UInt64_To_BE((ulong)seed)); + } + + public virtual void NextBytes(byte[] bytes) + { + NextBytes(bytes, 0, bytes.Length); + } + + public virtual void NextBytes(byte[] bytes, int start, int len) + { + lock (P) + { + int end = start + len; + for (int i = start; i != end; i++) + { + s = P[(s + P[n & 0xff]) & 0xff]; + bytes[i] = P[(P[(P[s & 0xff]) & 0xff] + 1) & 0xff]; + byte temp = P[n & 0xff]; + P[n & 0xff] = P[s & 0xff]; + P[s & 0xff] = temp; + n = (byte) ((n + 1) & 0xff); + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/VMPCRandomGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/VMPCRandomGenerator.cs.meta new file mode 100644 index 00000000..62f83f4a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/VMPCRandomGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 80462596f7a610e42b2868a2e799caa5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931Rng.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931Rng.cs new file mode 100644 index 00000000..b4a4fd59 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931Rng.cs @@ -0,0 +1,150 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + internal class X931Rng + { + private const long BLOCK64_RESEED_MAX = 1L << (16 - 1); + private const long BLOCK128_RESEED_MAX = 1L << (24 - 1); + private const int BLOCK64_MAX_BITS_REQUEST = 1 << (13 - 1); + private const int BLOCK128_MAX_BITS_REQUEST = 1 << (19 - 1); + + private readonly IBlockCipher mEngine; + private readonly IEntropySource mEntropySource; + + private readonly byte[] mDT; + private readonly byte[] mI; + private readonly byte[] mR; + + private byte[] mV; + + private long mReseedCounter = 1; + + /** + * + * @param engine + * @param entropySource + */ + internal X931Rng(IBlockCipher engine, byte[] dateTimeVector, IEntropySource entropySource) + { + this.mEngine = engine; + this.mEntropySource = entropySource; + + this.mDT = new byte[engine.GetBlockSize()]; + + Array.Copy(dateTimeVector, 0, mDT, 0, mDT.Length); + + this.mI = new byte[engine.GetBlockSize()]; + this.mR = new byte[engine.GetBlockSize()]; + } + + /** + * Populate a passed in array with random data. + * + * @param output output array for generated bits. + * @param predictionResistant true if a reseed should be forced, false otherwise. + * + * @return number of bits generated, -1 if a reseed required. + */ + internal int Generate(byte[] output, bool predictionResistant) + { + if (mR.Length == 8) // 64 bit block size + { + if (mReseedCounter > BLOCK64_RESEED_MAX) + return -1; + + if (IsTooLarge(output, BLOCK64_MAX_BITS_REQUEST / 8)) + throw new ArgumentException("Number of bits per request limited to " + BLOCK64_MAX_BITS_REQUEST, "output"); + } + else + { + if (mReseedCounter > BLOCK128_RESEED_MAX) + return -1; + + if (IsTooLarge(output, BLOCK128_MAX_BITS_REQUEST / 8)) + throw new ArgumentException("Number of bits per request limited to " + BLOCK128_MAX_BITS_REQUEST, "output"); + } + + if (predictionResistant || mV == null) + { + mV = mEntropySource.GetEntropy(); + if (mV.Length != mEngine.GetBlockSize()) + throw new InvalidOperationException("Insufficient entropy returned"); + } + + int m = output.Length / mR.Length; + + for (int i = 0; i < m; i++) + { + mEngine.ProcessBlock(mDT, 0, mI, 0); + Process(mR, mI, mV); + Process(mV, mR, mI); + + Array.Copy(mR, 0, output, i * mR.Length, mR.Length); + + Increment(mDT); + } + + int bytesToCopy = (output.Length - m * mR.Length); + + if (bytesToCopy > 0) + { + mEngine.ProcessBlock(mDT, 0, mI, 0); + Process(mR, mI, mV); + Process(mV, mR, mI); + + Array.Copy(mR, 0, output, m * mR.Length, bytesToCopy); + + Increment(mDT); + } + + mReseedCounter++; + + return output.Length; + } + + /** + * Reseed the RNG. + */ + internal void Reseed() + { + mV = mEntropySource.GetEntropy(); + if (mV.Length != mEngine.GetBlockSize()) + throw new InvalidOperationException("Insufficient entropy returned"); + mReseedCounter = 1; + } + + internal IEntropySource EntropySource + { + get { return mEntropySource; } + } + + private void Process(byte[] res, byte[] a, byte[] b) + { + for (int i = 0; i != res.Length; i++) + { + res[i] = (byte)(a[i] ^ b[i]); + } + + mEngine.ProcessBlock(res, 0, res, 0); + } + + private void Increment(byte[] val) + { + for (int i = val.Length - 1; i >= 0; i--) + { + if (++val[i] != 0) + break; + } + } + + private static bool IsTooLarge(byte[] bytes, int maxBytes) + { + return bytes != null && bytes.Length > maxBytes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931Rng.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931Rng.cs.meta new file mode 100644 index 00000000..0a0b9a27 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931Rng.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 16e904d5b0e43f2438f909a96c2c1a5f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandom.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandom.cs new file mode 100644 index 00000000..9ce61d2a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandom.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + public class X931SecureRandom + : SecureRandom + { + private readonly bool mPredictionResistant; + private readonly SecureRandom mRandomSource; + private readonly X931Rng mDrbg; + + internal X931SecureRandom(SecureRandom randomSource, X931Rng drbg, bool predictionResistant) + : base((IRandomGenerator)null) + { + this.mRandomSource = randomSource; + this.mDrbg = drbg; + this.mPredictionResistant = predictionResistant; + } + + public override void SetSeed(byte[] seed) + { + lock (this) + { + if (mRandomSource != null) + { + this.mRandomSource.SetSeed(seed); + } + } + } + + public override void SetSeed(long seed) + { + lock (this) + { + // this will happen when SecureRandom() is created + if (mRandomSource != null) + { + this.mRandomSource.SetSeed(seed); + } + } + } + + public override void NextBytes(byte[] bytes) + { + lock (this) + { + // check if a reseed is required... + if (mDrbg.Generate(bytes, mPredictionResistant) < 0) + { + mDrbg.Reseed(); + mDrbg.Generate(bytes, mPredictionResistant); + } + } + } + + public override void NextBytes(byte[] buf, int off, int len) + { + byte[] bytes = new byte[len]; + NextBytes(bytes); + Array.Copy(bytes, 0, buf, off, len); + } + + public override byte[] GenerateSeed(int numBytes) + { + return EntropyUtilities.GenerateSeed(mDrbg.EntropySource, numBytes); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandom.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandom.cs.meta new file mode 100644 index 00000000..85e66042 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0bc46819b51a0049afe9e3486eb35c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandomBuilder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandomBuilder.cs new file mode 100644 index 00000000..f23fdeb5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandomBuilder.cs @@ -0,0 +1,91 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng +{ + public class X931SecureRandomBuilder + { + private readonly SecureRandom mRandom; // JDK 1.1 complains on final. + + private IEntropySourceProvider mEntropySourceProvider; + private byte[] mDateTimeVector; + + /** + * Basic constructor, creates a builder using an EntropySourceProvider based on the default SecureRandom with + * predictionResistant set to false. + *

+ * Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + * the default SecureRandom does for its generateSeed() call. + *

+ */ + public X931SecureRandomBuilder() + : this(new SecureRandom(), false) + { + } + + /** + * Construct a builder with an EntropySourceProvider based on the passed in SecureRandom and the passed in value + * for prediction resistance. + *

+ * Any SecureRandom created from a builder constructed like this will make use of input passed to SecureRandom.setSeed() if + * the passed in SecureRandom does for its generateSeed() call. + *

+ * @param entropySource + * @param predictionResistant + */ + public X931SecureRandomBuilder(SecureRandom entropySource, bool predictionResistant) + { + this.mRandom = entropySource; + this.mEntropySourceProvider = new BasicEntropySourceProvider(mRandom, predictionResistant); + } + + /** + * Create a builder which makes creates the SecureRandom objects from a specified entropy source provider. + *

+ * Note: If this constructor is used any calls to setSeed() in the resulting SecureRandom will be ignored. + *

+ * @param entropySourceProvider a provider of EntropySource objects. + */ + public X931SecureRandomBuilder(IEntropySourceProvider entropySourceProvider) + { + this.mRandom = null; + this.mEntropySourceProvider = entropySourceProvider; + } + + public X931SecureRandomBuilder SetDateTimeVector(byte[] dateTimeVector) + { + this.mDateTimeVector = dateTimeVector; + return this; + } + + /** + * Construct a X9.31 secure random generator using the passed in engine and key. If predictionResistant is true the + * generator will be reseeded on each request. + * + * @param engine a block cipher to use as the operator. + * @param key the block cipher key to initialise engine with. + * @param predictionResistant true if engine to be reseeded on each use, false otherwise. + * @return a SecureRandom. + */ + public X931SecureRandom Build(IBlockCipher engine, KeyParameter key, bool predictionResistant) + { + if (mDateTimeVector == null) + { + mDateTimeVector = new byte[engine.GetBlockSize()]; + Pack.UInt64_To_BE((ulong)DateTimeUtilities.CurrentUnixMs(), mDateTimeVector, 0); + } + + engine.Init(true, key); + + return new X931SecureRandom(mRandom, new X931Rng(engine, mDateTimeVector, mEntropySourceProvider.Get(engine.GetBlockSize() * 8)), predictionResistant); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandomBuilder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandomBuilder.cs.meta new file mode 100644 index 00000000..6fcb782b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/X931SecureRandomBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa412f39ca843ca4db9e5b10bc4a12d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg.meta new file mode 100644 index 00000000..ff40ee10 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af63aec738a072a448eee5c48d43e9f8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/CtrSP800Drbg.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/CtrSP800Drbg.cs new file mode 100644 index 00000000..4dcab6e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/CtrSP800Drbg.cs @@ -0,0 +1,470 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg +{ + /** + * A SP800-90A CTR DRBG. + */ + public class CtrSP800Drbg + : ISP80090Drbg + { + private static readonly long TDEA_RESEED_MAX = 1L << (32 - 1); + private static readonly long AES_RESEED_MAX = 1L << (48 - 1); + private static readonly int TDEA_MAX_BITS_REQUEST = 1 << (13 - 1); + private static readonly int AES_MAX_BITS_REQUEST = 1 << (19 - 1); + + private readonly IEntropySource mEntropySource; + private readonly IBlockCipher mEngine; + private readonly int mKeySizeInBits; + private readonly int mSeedLength; + private readonly int mSecurityStrength; + + // internal state + private byte[] mKey; + private byte[] mV; + private long mReseedCounter = 0; + private bool mIsTdea = false; + + /** + * Construct a SP800-90A CTR DRBG. + *

+ * Minimum entropy requirement is the security strength requested. + *

+ * @param engine underlying block cipher to use to support DRBG + * @param keySizeInBits size of the key to use with the block cipher. + * @param securityStrength security strength required (in bits) + * @param entropySource source of entropy to use for seeding/reseeding. + * @param personalizationString personalization string to distinguish this DRBG (may be null). + * @param nonce nonce to further distinguish this DRBG (may be null). + */ + public CtrSP800Drbg(IBlockCipher engine, int keySizeInBits, int securityStrength, IEntropySource entropySource, + byte[] personalizationString, byte[] nonce) + { + if (securityStrength > 256) + throw new ArgumentException("Requested security strength is not supported by the derivation function"); + if (GetMaxSecurityStrength(engine, keySizeInBits) < securityStrength) + throw new ArgumentException("Requested security strength is not supported by block cipher and key size"); + if (entropySource.EntropySize < securityStrength) + throw new ArgumentException("Not enough entropy for security strength required"); + + mEntropySource = entropySource; + mEngine = engine; + + mKeySizeInBits = keySizeInBits; + mSecurityStrength = securityStrength; + mSeedLength = keySizeInBits + engine.GetBlockSize() * 8; + mIsTdea = IsTdea(engine); + + byte[] entropy = GetEntropy(); // Get_entropy_input + + CTR_DRBG_Instantiate_algorithm(entropy, nonce, personalizationString); + } + + private void CTR_DRBG_Instantiate_algorithm(byte[] entropy, byte[] nonce, byte[] personalisationString) + { + byte[] seedMaterial = Arrays.ConcatenateAll(entropy, nonce, personalisationString); + byte[] seed = Block_Cipher_df(seedMaterial, mSeedLength); + + int outlen = mEngine.GetBlockSize(); + + mKey = new byte[(mKeySizeInBits + 7) / 8]; + mV = new byte[outlen]; + + // mKey & mV are modified by this call + CTR_DRBG_Update(seed, mKey, mV); + + mReseedCounter = 1; + } + + private void CTR_DRBG_Update(byte[] seed, byte[] key, byte[] v) + { + byte[] temp = new byte[seed.Length]; + byte[] outputBlock = new byte[mEngine.GetBlockSize()]; + + int i = 0; + int outLen = mEngine.GetBlockSize(); + + mEngine.Init(true, new KeyParameter(ExpandKey(key))); + while (i*outLen < seed.Length) + { + AddOneTo(v); + mEngine.ProcessBlock(v, 0, outputBlock, 0); + + int bytesToCopy = ((temp.Length - i * outLen) > outLen) + ? outLen : (temp.Length - i * outLen); + + Array.Copy(outputBlock, 0, temp, i * outLen, bytesToCopy); + ++i; + } + + XOR(temp, seed, temp, 0); + + Array.Copy(temp, 0, key, 0, key.Length); + Array.Copy(temp, key.Length, v, 0, v.Length); + } + + private void CTR_DRBG_Reseed_algorithm(byte[] additionalInput) + { + byte[] seedMaterial = Arrays.Concatenate(GetEntropy(), additionalInput); + + seedMaterial = Block_Cipher_df(seedMaterial, mSeedLength); + + CTR_DRBG_Update(seedMaterial, mKey, mV); + + mReseedCounter = 1; + } + + private void XOR(byte[] output, byte[] a, byte[] b, int bOff) + { + for (int i = 0; i < output.Length; i++) + { + output[i] = (byte)(a[i] ^ b[bOff + i]); + } + } + + private void AddOneTo(byte[] longer) + { + uint carry = 1; + int i = longer.Length; + while (--i >= 0) + { + carry += longer[i]; + longer[i] = (byte)carry; + carry >>= 8; + } + } + + private byte[] GetEntropy() + { + byte[] entropy = mEntropySource.GetEntropy(); + if (entropy.Length < (mSecurityStrength + 7) / 8) + throw new InvalidOperationException("Insufficient entropy provided by entropy source"); + return entropy; + } + + // -- Internal state migration --- + + private static readonly byte[] K_BITS = Hex.Decode("000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F"); + + // 1. If (number_of_bits_to_return > max_number_of_bits), then return an + // ERROR_FLAG. + // 2. L = len (input_string)/8. + // 3. N = number_of_bits_to_return/8. + // Comment: L is the bitstring represention of + // the integer resulting from len (input_string)/8. + // L shall be represented as a 32-bit integer. + // + // Comment : N is the bitstring represention of + // the integer resulting from + // number_of_bits_to_return/8. N shall be + // represented as a 32-bit integer. + // + // 4. S = L || N || input_string || 0x80. + // 5. While (len (S) mod outlen) + // Comment : Pad S with zeros, if necessary. + // 0, S = S || 0x00. + // + // Comment : Compute the starting value. + // 6. temp = the Null string. + // 7. i = 0. + // 8. K = Leftmost keylen bits of 0x00010203...1D1E1F. + // 9. While len (temp) < keylen + outlen, do + // + // IV = i || 0outlen - len (i). + // + // 9.1 + // + // temp = temp || BCC (K, (IV || S)). + // + // 9.2 + // + // i = i + 1. + // + // 9.3 + // + // Comment : i shall be represented as a 32-bit + // integer, i.e., len (i) = 32. + // + // Comment: The 32-bit integer represenation of + // i is padded with zeros to outlen bits. + // + // Comment: Compute the requested number of + // bits. + // + // 10. K = Leftmost keylen bits of temp. + // + // 11. X = Next outlen bits of temp. + // + // 12. temp = the Null string. + // + // 13. While len (temp) < number_of_bits_to_return, do + // + // 13.1 X = Block_Encrypt (K, X). + // + // 13.2 temp = temp || X. + // + // 14. requested_bits = Leftmost number_of_bits_to_return of temp. + // + // 15. Return SUCCESS and requested_bits. + private byte[] Block_Cipher_df(byte[] inputString, int bitLength) + { + int outLen = mEngine.GetBlockSize(); + int L = inputString.Length; // already in bytes + int N = bitLength / 8; + // 4 S = L || N || inputstring || 0x80 + int sLen = 4 + 4 + L + 1; + int blockLen = ((sLen + outLen - 1) / outLen) * outLen; + byte[] S = new byte[blockLen]; + copyIntToByteArray(S, L, 0); + copyIntToByteArray(S, N, 4); + Array.Copy(inputString, 0, S, 8, L); + S[8 + L] = (byte)0x80; + // S already padded with zeros + + byte[] temp = new byte[mKeySizeInBits / 8 + outLen]; + byte[] bccOut = new byte[outLen]; + + byte[] IV = new byte[outLen]; + + int i = 0; + byte[] K = new byte[mKeySizeInBits / 8]; + Array.Copy(K_BITS, 0, K, 0, K.Length); + + while (i*outLen*8 < mKeySizeInBits + outLen *8) + { + copyIntToByteArray(IV, i, 0); + BCC(bccOut, K, IV, S); + + int bytesToCopy = ((temp.Length - i * outLen) > outLen) + ? outLen + : (temp.Length - i * outLen); + + Array.Copy(bccOut, 0, temp, i * outLen, bytesToCopy); + ++i; + } + + byte[] X = new byte[outLen]; + Array.Copy(temp, 0, K, 0, K.Length); + Array.Copy(temp, K.Length, X, 0, X.Length); + + temp = new byte[bitLength / 2]; + + i = 0; + mEngine.Init(true, new KeyParameter(ExpandKey(K))); + + while (i * outLen < temp.Length) + { + mEngine.ProcessBlock(X, 0, X, 0); + + int bytesToCopy = ((temp.Length - i * outLen) > outLen) + ? outLen + : (temp.Length - i * outLen); + + Array.Copy(X, 0, temp, i * outLen, bytesToCopy); + i++; + } + + return temp; + } + + /* + * 1. chaining_value = 0^outlen + * . Comment: Set the first chaining value to outlen zeros. + * 2. n = len (data)/outlen. + * 3. Starting with the leftmost bits of data, split the data into n blocks of outlen bits + * each, forming block(1) to block(n). + * 4. For i = 1 to n do + * 4.1 input_block = chaining_value ^ block(i) . + * 4.2 chaining_value = Block_Encrypt (Key, input_block). + * 5. output_block = chaining_value. + * 6. Return output_block. + */ + private void BCC(byte[] bccOut, byte[] k, byte[] iV, byte[] data) + { + int outlen = mEngine.GetBlockSize(); + byte[] chainingValue = new byte[outlen]; // initial values = 0 + int n = data.Length / outlen; + + byte[] inputBlock = new byte[outlen]; + + mEngine.Init(true, new KeyParameter(ExpandKey(k))); + + mEngine.ProcessBlock(iV, 0, chainingValue, 0); + + for (int i = 0; i < n; i++) + { + XOR(inputBlock, chainingValue, data, i*outlen); + mEngine.ProcessBlock(inputBlock, 0, chainingValue, 0); + } + + Array.Copy(chainingValue, 0, bccOut, 0, bccOut.Length); + } + + private void copyIntToByteArray(byte[] buf, int value, int offSet) + { + buf[offSet + 0] = ((byte)(value >> 24)); + buf[offSet + 1] = ((byte)(value >> 16)); + buf[offSet + 2] = ((byte)(value >> 8)); + buf[offSet + 3] = ((byte)(value)); + } + + /** + * Return the block size (in bits) of the DRBG. + * + * @return the number of bits produced on each internal round of the DRBG. + */ + public int BlockSize + { + get { return mV.Length * 8; } + } + + /** + * Populate a passed in array with random data. + * + * @param output output array for generated bits. + * @param additionalInput additional input to be added to the DRBG in this step. + * @param predictionResistant true if a reseed should be forced, false otherwise. + * + * @return number of bits generated, -1 if a reseed required. + */ + public int Generate(byte[] output, byte[] additionalInput, bool predictionResistant) + { + if (mIsTdea) + { + if (mReseedCounter > TDEA_RESEED_MAX) + return -1; + + if (DrbgUtilities.IsTooLarge(output, TDEA_MAX_BITS_REQUEST / 8)) + throw new ArgumentException("Number of bits per request limited to " + TDEA_MAX_BITS_REQUEST, "output"); + } + else + { + if (mReseedCounter > AES_RESEED_MAX) + return -1; + + if (DrbgUtilities.IsTooLarge(output, AES_MAX_BITS_REQUEST / 8)) + throw new ArgumentException("Number of bits per request limited to " + AES_MAX_BITS_REQUEST, "output"); + } + + if (predictionResistant) + { + CTR_DRBG_Reseed_algorithm(additionalInput); + additionalInput = null; + } + + if (additionalInput != null) + { + additionalInput = Block_Cipher_df(additionalInput, mSeedLength); + CTR_DRBG_Update(additionalInput, mKey, mV); + } + else + { + additionalInput = new byte[mSeedLength]; + } + + byte[] tmp = new byte[mV.Length]; + + mEngine.Init(true, new KeyParameter(ExpandKey(mKey))); + + for (int i = 0; i <= output.Length / tmp.Length; i++) + { + int bytesToCopy = ((output.Length - i * tmp.Length) > tmp.Length) + ? tmp.Length + : (output.Length - i * mV.Length); + + if (bytesToCopy != 0) + { + AddOneTo(mV); + + mEngine.ProcessBlock(mV, 0, tmp, 0); + + Array.Copy(tmp, 0, output, i * tmp.Length, bytesToCopy); + } + } + + CTR_DRBG_Update(additionalInput, mKey, mV); + + mReseedCounter++; + + return output.Length * 8; + } + + /** + * Reseed the DRBG. + * + * @param additionalInput additional input to be added to the DRBG in this step. + */ + public void Reseed(byte[] additionalInput) + { + CTR_DRBG_Reseed_algorithm(additionalInput); + } + + private bool IsTdea(IBlockCipher cipher) + { + return cipher.AlgorithmName.Equals("DESede") || cipher.AlgorithmName.Equals("TDEA"); + } + + private int GetMaxSecurityStrength(IBlockCipher cipher, int keySizeInBits) + { + if (IsTdea(cipher) && keySizeInBits == 168) + { + return 112; + } + if (cipher.AlgorithmName.Equals("AES")) + { + return keySizeInBits; + } + + return -1; + } + + private byte[] ExpandKey(byte[] key) + { + if (mIsTdea) + { + // expand key to 192 bits. + byte[] tmp = new byte[24]; + + PadKey(key, 0, tmp, 0); + PadKey(key, 7, tmp, 8); + PadKey(key, 14, tmp, 16); + + return tmp; + } + else + { + return key; + } + } + + /** + * Pad out a key for TDEA, setting odd parity for each byte. + * + * @param keyMaster + * @param keyOff + * @param tmp + * @param tmpOff + */ + private void PadKey(byte[] keyMaster, int keyOff, byte[] tmp, int tmpOff) + { + tmp[tmpOff + 0] = (byte)(keyMaster[keyOff + 0] & 0xfe); + tmp[tmpOff + 1] = (byte)((keyMaster[keyOff + 0] << 7) | ((keyMaster[keyOff + 1] & 0xfc) >> 1)); + tmp[tmpOff + 2] = (byte)((keyMaster[keyOff + 1] << 6) | ((keyMaster[keyOff + 2] & 0xf8) >> 2)); + tmp[tmpOff + 3] = (byte)((keyMaster[keyOff + 2] << 5) | ((keyMaster[keyOff + 3] & 0xf0) >> 3)); + tmp[tmpOff + 4] = (byte)((keyMaster[keyOff + 3] << 4) | ((keyMaster[keyOff + 4] & 0xe0) >> 4)); + tmp[tmpOff + 5] = (byte)((keyMaster[keyOff + 4] << 3) | ((keyMaster[keyOff + 5] & 0xc0) >> 5)); + tmp[tmpOff + 6] = (byte)((keyMaster[keyOff + 5] << 2) | ((keyMaster[keyOff + 6] & 0x80) >> 6)); + tmp[tmpOff + 7] = (byte)(keyMaster[keyOff + 6] << 1); + + DesParameters.SetOddParity(tmp, tmpOff, 8); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/CtrSP800Drbg.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/CtrSP800Drbg.cs.meta new file mode 100644 index 00000000..55b69515 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/CtrSP800Drbg.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: edfb0cb793332c04897bd15f6ba5d7dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/DrbgUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/DrbgUtilities.cs new file mode 100644 index 00000000..f3ef1ca3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/DrbgUtilities.cs @@ -0,0 +1,107 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg +{ + internal class DrbgUtilities + { + private static readonly IDictionary maxSecurityStrengths = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static DrbgUtilities() + { + maxSecurityStrengths.Add("SHA-1", 128); + + maxSecurityStrengths.Add("SHA-224", 192); + maxSecurityStrengths.Add("SHA-256", 256); + maxSecurityStrengths.Add("SHA-384", 256); + maxSecurityStrengths.Add("SHA-512", 256); + + maxSecurityStrengths.Add("SHA-512/224", 192); + maxSecurityStrengths.Add("SHA-512/256", 256); + } + + internal static int GetMaxSecurityStrength(IDigest d) + { + return (int)maxSecurityStrengths[d.AlgorithmName]; + } + + internal static int GetMaxSecurityStrength(IMac m) + { + string name = m.AlgorithmName; + + return (int)maxSecurityStrengths[name.Substring(0, name.IndexOf("/"))]; + } + + /** + * Used by both Dual EC and Hash. + */ + internal static byte[] HashDF(IDigest digest, byte[] seedMaterial, int seedLength) + { + // 1. temp = the Null string. + // 2. . + // 3. counter = an 8-bit binary value representing the integer "1". + // 4. For i = 1 to len do + // Comment : In step 4.1, no_of_bits_to_return + // is used as a 32-bit string. + // 4.1 temp = temp || Hash (counter || no_of_bits_to_return || + // input_string). + // 4.2 counter = counter + 1. + // 5. requested_bits = Leftmost (no_of_bits_to_return) of temp. + // 6. Return SUCCESS and requested_bits. + byte[] temp = new byte[(seedLength + 7) / 8]; + + int len = temp.Length / digest.GetDigestSize(); + int counter = 1; + + byte[] dig = new byte[digest.GetDigestSize()]; + + for (int i = 0; i <= len; i++) + { + digest.Update((byte)counter); + + digest.Update((byte)(seedLength >> 24)); + digest.Update((byte)(seedLength >> 16)); + digest.Update((byte)(seedLength >> 8)); + digest.Update((byte)seedLength); + + digest.BlockUpdate(seedMaterial, 0, seedMaterial.Length); + + digest.DoFinal(dig, 0); + + int bytesToCopy = ((temp.Length - i * dig.Length) > dig.Length) + ? dig.Length + : (temp.Length - i * dig.Length); + Array.Copy(dig, 0, temp, i * dig.Length, bytesToCopy); + + counter++; + } + + // do a left shift to get rid of excess bits. + if (seedLength % 8 != 0) + { + int shift = 8 - (seedLength % 8); + uint carry = 0; + + for (int i = 0; i != temp.Length; i++) + { + uint b = temp[i]; + temp[i] = (byte)((b >> shift) | (carry << (8 - shift))); + carry = b; + } + } + + return temp; + } + + internal static bool IsTooLarge(byte[] bytes, int maxBytes) + { + return bytes != null && bytes.Length > maxBytes; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/DrbgUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/DrbgUtilities.cs.meta new file mode 100644 index 00000000..d248fc17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/DrbgUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b7d5029db1ebd4d488a8e6d442ba71e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HMacSP800Drbg.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HMacSP800Drbg.cs new file mode 100644 index 00000000..445c3149 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HMacSP800Drbg.cs @@ -0,0 +1,190 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg +{ + /** + * A SP800-90A HMAC DRBG. + */ + public class HMacSP800Drbg + : ISP80090Drbg + { + private readonly static long RESEED_MAX = 1L << (48 - 1); + private readonly static int MAX_BITS_REQUEST = 1 << (19 - 1); + + private readonly byte[] mK; + private readonly byte[] mV; + private readonly IEntropySource mEntropySource; + private readonly IMac mHMac; + private readonly int mSecurityStrength; + + private long mReseedCounter; + + /** + * Construct a SP800-90A Hash DRBG. + *

+ * Minimum entropy requirement is the security strength requested. + *

+ * @param hMac Hash MAC to base the DRBG on. + * @param securityStrength security strength required (in bits) + * @param entropySource source of entropy to use for seeding/reseeding. + * @param personalizationString personalization string to distinguish this DRBG (may be null). + * @param nonce nonce to further distinguish this DRBG (may be null). + */ + public HMacSP800Drbg(IMac hMac, int securityStrength, IEntropySource entropySource, byte[] personalizationString, byte[] nonce) + { + if (securityStrength > DrbgUtilities.GetMaxSecurityStrength(hMac)) + throw new ArgumentException("Requested security strength is not supported by the derivation function"); + if (entropySource.EntropySize < securityStrength) + throw new ArgumentException("Not enough entropy for security strength required"); + + mHMac = hMac; + mSecurityStrength = securityStrength; + mEntropySource = entropySource; + + byte[] entropy = GetEntropy(); + byte[] seedMaterial = Arrays.ConcatenateAll(entropy, nonce, personalizationString); + + mK = new byte[hMac.GetMacSize()]; + mV = new byte[mK.Length]; + Arrays.Fill(mV, (byte)1); + + hmac_DRBG_Update(seedMaterial); + + mReseedCounter = 1; + } + + private void hmac_DRBG_Update(byte[] seedMaterial) + { + hmac_DRBG_Update_Func(seedMaterial, (byte)0x00); + if (seedMaterial != null) + { + hmac_DRBG_Update_Func(seedMaterial, (byte)0x01); + } + } + + private void hmac_DRBG_Update_Func(byte[] seedMaterial, byte vValue) + { + mHMac.Init(new KeyParameter(mK)); + + mHMac.BlockUpdate(mV, 0, mV.Length); + mHMac.Update(vValue); + + if (seedMaterial != null) + { + mHMac.BlockUpdate(seedMaterial, 0, seedMaterial.Length); + } + + mHMac.DoFinal(mK, 0); + + mHMac.Init(new KeyParameter(mK)); + mHMac.BlockUpdate(mV, 0, mV.Length); + + mHMac.DoFinal(mV, 0); + } + + /** + * Return the block size (in bits) of the DRBG. + * + * @return the number of bits produced on each round of the DRBG. + */ + public int BlockSize + { + get { return mV.Length * 8; } + } + + /** + * Populate a passed in array with random data. + * + * @param output output array for generated bits. + * @param additionalInput additional input to be added to the DRBG in this step. + * @param predictionResistant true if a reseed should be forced, false otherwise. + * + * @return number of bits generated, -1 if a reseed required. + */ + public int Generate(byte[] output, byte[] additionalInput, bool predictionResistant) + { + int numberOfBits = output.Length * 8; + + if (numberOfBits > MAX_BITS_REQUEST) + throw new ArgumentException("Number of bits per request limited to " + MAX_BITS_REQUEST, "output"); + + if (mReseedCounter > RESEED_MAX) + { + return -1; + } + + if (predictionResistant) + { + Reseed(additionalInput); + additionalInput = null; + } + + // 2. + if (additionalInput != null) + { + hmac_DRBG_Update(additionalInput); + } + + // 3. + byte[] rv = new byte[output.Length]; + + int m = output.Length / mV.Length; + + mHMac.Init(new KeyParameter(mK)); + + for (int i = 0; i < m; i++) + { + mHMac.BlockUpdate(mV, 0, mV.Length); + mHMac.DoFinal(mV, 0); + + Array.Copy(mV, 0, rv, i * mV.Length, mV.Length); + } + + if (m * mV.Length < rv.Length) + { + mHMac.BlockUpdate(mV, 0, mV.Length); + mHMac.DoFinal(mV, 0); + + Array.Copy(mV, 0, rv, m * mV.Length, rv.Length - (m * mV.Length)); + } + + hmac_DRBG_Update(additionalInput); + + mReseedCounter++; + + Array.Copy(rv, 0, output, 0, output.Length); + + return numberOfBits; + } + + /** + * Reseed the DRBG. + * + * @param additionalInput additional input to be added to the DRBG in this step. + */ + public void Reseed(byte[] additionalInput) + { + byte[] entropy = GetEntropy(); + byte[] seedMaterial = Arrays.Concatenate(entropy, additionalInput); + + hmac_DRBG_Update(seedMaterial); + + mReseedCounter = 1; + } + + private byte[] GetEntropy() + { + byte[] entropy = mEntropySource.GetEntropy(); + if (entropy.Length < (mSecurityStrength + 7) / 8) + throw new InvalidOperationException("Insufficient entropy provided by entropy source"); + return entropy; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HMacSP800Drbg.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HMacSP800Drbg.cs.meta new file mode 100644 index 00000000..82d3de0f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HMacSP800Drbg.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0531f450ee87c1344976250270fa8568 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HashSP800Drbg.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HashSP800Drbg.cs new file mode 100644 index 00000000..7d244fcc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HashSP800Drbg.cs @@ -0,0 +1,291 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg +{ + /** + * A SP800-90A Hash DRBG. + */ + public class HashSP800Drbg + : ISP80090Drbg + { + private readonly static byte[] ONE = { 0x01 }; + + private readonly static long RESEED_MAX = 1L << (48 - 1); + private readonly static int MAX_BITS_REQUEST = 1 << (19 - 1); + + private static readonly IDictionary seedlens = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static HashSP800Drbg() + { + seedlens.Add("SHA-1", 440); + seedlens.Add("SHA-224", 440); + seedlens.Add("SHA-256", 440); + seedlens.Add("SHA-512/256", 440); + seedlens.Add("SHA-512/224", 440); + seedlens.Add("SHA-384", 888); + seedlens.Add("SHA-512", 888); + } + + private readonly IDigest mDigest; + private readonly IEntropySource mEntropySource; + private readonly int mSecurityStrength; + private readonly int mSeedLength; + + private byte[] mV; + private byte[] mC; + private long mReseedCounter; + + /** + * Construct a SP800-90A Hash DRBG. + *

+ * Minimum entropy requirement is the security strength requested. + *

+ * @param digest source digest to use for DRB stream. + * @param securityStrength security strength required (in bits) + * @param entropySource source of entropy to use for seeding/reseeding. + * @param personalizationString personalization string to distinguish this DRBG (may be null). + * @param nonce nonce to further distinguish this DRBG (may be null). + */ + public HashSP800Drbg(IDigest digest, int securityStrength, IEntropySource entropySource, byte[] personalizationString, byte[] nonce) + { + if (securityStrength > DrbgUtilities.GetMaxSecurityStrength(digest)) + throw new ArgumentException("Requested security strength is not supported by the derivation function"); + if (entropySource.EntropySize < securityStrength) + throw new ArgumentException("Not enough entropy for security strength required"); + + mDigest = digest; + mEntropySource = entropySource; + mSecurityStrength = securityStrength; + mSeedLength = (int)seedlens[digest.AlgorithmName]; + + // 1. seed_material = entropy_input || nonce || personalization_string. + // 2. seed = Hash_df (seed_material, seedlen). + // 3. V = seed. + // 4. C = Hash_df ((0x00 || V), seedlen). Comment: Preceed V with a byte + // of zeros. + // 5. reseed_counter = 1. + // 6. Return V, C, and reseed_counter as the initial_working_state + + byte[] entropy = GetEntropy(); + byte[] seedMaterial = Arrays.ConcatenateAll(entropy, nonce, personalizationString); + byte[] seed = DrbgUtilities.HashDF(mDigest, seedMaterial, mSeedLength); + + mV = seed; + byte[] subV = new byte[mV.Length + 1]; + Array.Copy(mV, 0, subV, 1, mV.Length); + mC = DrbgUtilities.HashDF(mDigest, subV, mSeedLength); + + mReseedCounter = 1; + } + + /** + * Return the block size (in bits) of the DRBG. + * + * @return the number of bits produced on each internal round of the DRBG. + */ + public int BlockSize + { + get { return mDigest.GetDigestSize () * 8; } + } + + /** + * Populate a passed in array with random data. + * + * @param output output array for generated bits. + * @param additionalInput additional input to be added to the DRBG in this step. + * @param predictionResistant true if a reseed should be forced, false otherwise. + * + * @return number of bits generated, -1 if a reseed required. + */ + public int Generate(byte[] output, byte[] additionalInput, bool predictionResistant) + { + // 1. If reseed_counter > reseed_interval, then return an indication that a + // reseed is required. + // 2. If (additional_input != Null), then do + // 2.1 w = Hash (0x02 || V || additional_input). + // 2.2 V = (V + w) mod 2^seedlen + // . + // 3. (returned_bits) = Hashgen (requested_number_of_bits, V). + // 4. H = Hash (0x03 || V). + // 5. V = (V + H + C + reseed_counter) mod 2^seedlen + // . + // 6. reseed_counter = reseed_counter + 1. + // 7. Return SUCCESS, returned_bits, and the new values of V, C, and + // reseed_counter for the new_working_state. + int numberOfBits = output.Length * 8; + + if (numberOfBits > MAX_BITS_REQUEST) + throw new ArgumentException("Number of bits per request limited to " + MAX_BITS_REQUEST, "output"); + + if (mReseedCounter > RESEED_MAX) + return -1; + + if (predictionResistant) + { + Reseed(additionalInput); + additionalInput = null; + } + + // 2. + if (additionalInput != null) + { + byte[] newInput = new byte[1 + mV.Length + additionalInput.Length]; + newInput[0] = 0x02; + Array.Copy(mV, 0, newInput, 1, mV.Length); + // TODO: inOff / inLength + Array.Copy(additionalInput, 0, newInput, 1 + mV.Length, additionalInput.Length); + byte[] w = Hash(newInput); + + AddTo(mV, w); + } + + // 3. + byte[] rv = hashgen(mV, numberOfBits); + + // 4. + byte[] subH = new byte[mV.Length + 1]; + Array.Copy(mV, 0, subH, 1, mV.Length); + subH[0] = 0x03; + + byte[] H = Hash(subH); + + // 5. + AddTo(mV, H); + AddTo(mV, mC); + byte[] c = new byte[4]; + c[0] = (byte)(mReseedCounter >> 24); + c[1] = (byte)(mReseedCounter >> 16); + c[2] = (byte)(mReseedCounter >> 8); + c[3] = (byte)mReseedCounter; + + AddTo(mV, c); + + mReseedCounter++; + + Array.Copy(rv, 0, output, 0, output.Length); + + return numberOfBits; + } + + private byte[] GetEntropy() + { + byte[] entropy = mEntropySource.GetEntropy(); + if (entropy.Length < (mSecurityStrength + 7) / 8) + throw new InvalidOperationException("Insufficient entropy provided by entropy source"); + return entropy; + } + + // this will always add the shorter length byte array mathematically to the + // longer length byte array. + // be careful.... + private void AddTo(byte[] longer, byte[] shorter) + { + int off = longer.Length - shorter.Length; + + uint carry = 0; + int i = shorter.Length; + while (--i >= 0) + { + carry += (uint)longer[off + i] + (uint)shorter[i]; + longer[off + i] = (byte)carry; + carry >>= 8; + } + + i = off; + while (--i >= 0) + { + carry += longer[i]; + longer[i] = (byte)carry; + carry >>= 8; + } + } + + /** + * Reseed the DRBG. + * + * @param additionalInput additional input to be added to the DRBG in this step. + */ + public void Reseed(byte[] additionalInput) + { + // 1. seed_material = 0x01 || V || entropy_input || additional_input. + // + // 2. seed = Hash_df (seed_material, seedlen). + // + // 3. V = seed. + // + // 4. C = Hash_df ((0x00 || V), seedlen). + // + // 5. reseed_counter = 1. + // + // 6. Return V, C, and reseed_counter for the new_working_state. + // + // Comment: Precede with a byte of all zeros. + byte[] entropy = GetEntropy(); + byte[] seedMaterial = Arrays.ConcatenateAll(ONE, mV, entropy, additionalInput); + byte[] seed = DrbgUtilities.HashDF(mDigest, seedMaterial, mSeedLength); + + mV = seed; + byte[] subV = new byte[mV.Length + 1]; + subV[0] = 0x00; + Array.Copy(mV, 0, subV, 1, mV.Length); + mC = DrbgUtilities.HashDF(mDigest, subV, mSeedLength); + + mReseedCounter = 1; + } + + private byte[] Hash(byte[] input) + { + byte[] hash = new byte[mDigest.GetDigestSize()]; + DoHash(input, hash); + return hash; + } + + private void DoHash(byte[] input, byte[] output) + { + mDigest.BlockUpdate(input, 0, input.Length); + mDigest.DoFinal(output, 0); + } + + // 1. m = [requested_number_of_bits / outlen] + // 2. data = V. + // 3. W = the Null string. + // 4. For i = 1 to m + // 4.1 wi = Hash (data). + // 4.2 W = W || wi. + // 4.3 data = (data + 1) mod 2^seedlen + // . + // 5. returned_bits = Leftmost (requested_no_of_bits) bits of W. + private byte[] hashgen(byte[] input, int lengthInBits) + { + int digestSize = mDigest.GetDigestSize(); + int m = (lengthInBits / 8) / digestSize; + + byte[] data = new byte[input.Length]; + Array.Copy(input, 0, data, 0, input.Length); + + byte[] W = new byte[lengthInBits / 8]; + + byte[] dig = new byte[mDigest.GetDigestSize()]; + for (int i = 0; i <= m; i++) + { + DoHash(data, dig); + + int bytesToCopy = ((W.Length - i * dig.Length) > dig.Length) + ? dig.Length + : (W.Length - i * dig.Length); + Array.Copy(dig, 0, W, i * dig.Length, bytesToCopy); + + AddTo(data, ONE); + } + + return W; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HashSP800Drbg.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HashSP800Drbg.cs.meta new file mode 100644 index 00000000..e5705360 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/HashSP800Drbg.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a85748f6547ed6342a29b17c5d5fc6eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/ISP80090Drbg.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/ISP80090Drbg.cs new file mode 100644 index 00000000..b48b7fe7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/ISP80090Drbg.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng.Drbg +{ + /** + * Interface to SP800-90A deterministic random bit generators. + */ + public interface ISP80090Drbg + { + /** + * Return the block size of the DRBG. + * + * @return the block size (in bits) produced by each round of the DRBG. + */ + int BlockSize { get; } + + /** + * Populate a passed in array with random data. + * + * @param output output array for generated bits. + * @param additionalInput additional input to be added to the DRBG in this step. + * @param predictionResistant true if a reseed should be forced, false otherwise. + * + * @return number of bits generated, -1 if a reseed required. + */ + int Generate(byte[] output, byte[] additionalInput, bool predictionResistant); + + /** + * Reseed the DRBG. + * + * @param additionalInput additional input to be added to the DRBG in this step. + */ + void Reseed(byte[] additionalInput); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/ISP80090Drbg.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/ISP80090Drbg.cs.meta new file mode 100644 index 00000000..a30836d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/prng/drbg/ISP80090Drbg.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5c19a9bd75eab245b6a2d472950fd2d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers.meta new file mode 100644 index 00000000..09316afa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 962655b8d2a40294bad978e6d458a24e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaDigestSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaDigestSigner.cs new file mode 100644 index 00000000..036f7cb5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaDigestSigner.cs @@ -0,0 +1,150 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class DsaDigestSigner + : ISigner + { + private readonly IDsa dsa; + private readonly IDigest digest; + private readonly IDsaEncoding encoding; + private bool forSigning; + + public DsaDigestSigner( + IDsa dsa, + IDigest digest) + { + this.dsa = dsa; + this.digest = digest; + this.encoding = StandardDsaEncoding.Instance; + } + + public DsaDigestSigner( + IDsaExt dsa, + IDigest digest, + IDsaEncoding encoding) + { + this.dsa = dsa; + this.digest = digest; + this.encoding = encoding; + } + + public virtual string AlgorithmName + { + get { return digest.AlgorithmName + "with" + dsa.AlgorithmName; } + } + + public virtual void Init( + bool forSigning, + ICipherParameters parameters) + { + this.forSigning = forSigning; + + AsymmetricKeyParameter k; + + if (parameters is ParametersWithRandom) + { + k = (AsymmetricKeyParameter)((ParametersWithRandom)parameters).Parameters; + } + else + { + k = (AsymmetricKeyParameter)parameters; + } + + if (forSigning && !k.IsPrivate) + throw new InvalidKeyException("Signing Requires Private Key."); + + if (!forSigning && k.IsPrivate) + throw new InvalidKeyException("Verification Requires Public Key."); + + Reset(); + + dsa.Init(forSigning, parameters); + } + + /** + * update the internal digest with the byte b + */ + public virtual void Update( + byte input) + { + digest.Update(input); + } + + /** + * update the internal digest with the byte array in + */ + public virtual void BlockUpdate( + byte[] input, + int inOff, + int length) + { + digest.BlockUpdate(input, inOff, length); + } + + /** + * Generate a signature for the message we've been loaded with using + * the key we were initialised with. + */ + public virtual byte[] GenerateSignature() + { + if (!forSigning) + throw new InvalidOperationException("DSADigestSigner not initialised for signature generation."); + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + BigInteger[] sig = dsa.GenerateSignature(hash); + + try + { + return encoding.Encode(GetOrder(), sig[0], sig[1]); + } + catch (Exception) + { + throw new InvalidOperationException("unable to encode signature"); + } + } + + /// true if the internal state represents the signature described in the passed in array. + public virtual bool VerifySignature( + byte[] signature) + { + if (forSigning) + throw new InvalidOperationException("DSADigestSigner not initialised for verification"); + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + try + { + BigInteger[] sig = encoding.Decode(GetOrder(), signature); + + return dsa.VerifySignature(hash, sig[0], sig[1]); + } + catch (Exception e) + { + return false; + } + } + + /// Reset the internal state + public virtual void Reset() + { + digest.Reset(); + } + + protected virtual BigInteger GetOrder() + { + return dsa is IDsaExt ? ((IDsaExt)dsa).Order : null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaDigestSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaDigestSigner.cs.meta new file mode 100644 index 00000000..645f7640 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaDigestSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c9905792014e74d4f8a532ab18084ac5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaSigner.cs new file mode 100644 index 00000000..c042e32e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaSigner.cs @@ -0,0 +1,165 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /** + * The Digital Signature Algorithm - as described in "Handbook of Applied + * Cryptography", pages 452 - 453. + */ + public class DsaSigner + : IDsaExt + { + protected readonly IDsaKCalculator kCalculator; + + protected DsaKeyParameters key = null; + protected SecureRandom random = null; + + /** + * Default configuration, random K values. + */ + public DsaSigner() + { + this.kCalculator = new RandomDsaKCalculator(); + } + + /** + * Configuration with an alternate, possibly deterministic calculator of K. + * + * @param kCalculator a K value calculator. + */ + public DsaSigner(IDsaKCalculator kCalculator) + { + this.kCalculator = kCalculator; + } + + public virtual string AlgorithmName + { + get { return "DSA"; } + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + SecureRandom providedRandom = null; + + if (forSigning) + { + if (parameters is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)parameters; + + providedRandom = rParam.Random; + parameters = rParam.Parameters; + } + + if (!(parameters is DsaPrivateKeyParameters)) + throw new InvalidKeyException("DSA private key required for signing"); + + this.key = (DsaPrivateKeyParameters)parameters; + } + else + { + if (!(parameters is DsaPublicKeyParameters)) + throw new InvalidKeyException("DSA public key required for verification"); + + this.key = (DsaPublicKeyParameters)parameters; + } + + this.random = InitSecureRandom(forSigning && !kCalculator.IsDeterministic, providedRandom); + } + + public virtual BigInteger Order + { + get { return key.Parameters.Q; } + } + + /** + * Generate a signature for the given message using the key we were + * initialised with. For conventional DSA the message should be a SHA-1 + * hash of the message of interest. + * + * @param message the message that will be verified later. + */ + public virtual BigInteger[] GenerateSignature(byte[] message) + { + DsaParameters parameters = key.Parameters; + BigInteger q = parameters.Q; + BigInteger m = CalculateE(q, message); + BigInteger x = ((DsaPrivateKeyParameters)key).X; + + if (kCalculator.IsDeterministic) + { + kCalculator.Init(q, x, message); + } + else + { + kCalculator.Init(q, random); + } + + BigInteger k = kCalculator.NextK(); + + BigInteger r = parameters.G.ModPow(k, parameters.P).Mod(q); + + k = k.ModInverse(q).Multiply(m.Add(x.Multiply(r))); + + BigInteger s = k.Mod(q); + + return new BigInteger[]{ r, s }; + } + + /** + * return true if the value r and s represent a DSA signature for + * the passed in message for standard DSA the message should be a + * SHA-1 hash of the real message to be verified. + */ + public virtual bool VerifySignature(byte[] message, BigInteger r, BigInteger s) + { + DsaParameters parameters = key.Parameters; + BigInteger q = parameters.Q; + BigInteger m = CalculateE(q, message); + + if (r.SignValue <= 0 || q.CompareTo(r) <= 0) + { + return false; + } + + if (s.SignValue <= 0 || q.CompareTo(s) <= 0) + { + return false; + } + + BigInteger w = s.ModInverse(q); + + BigInteger u1 = m.Multiply(w).Mod(q); + BigInteger u2 = r.Multiply(w).Mod(q); + + BigInteger p = parameters.P; + u1 = parameters.G.ModPow(u1, p); + u2 = ((DsaPublicKeyParameters)key).Y.ModPow(u2, p); + + BigInteger v = u1.Multiply(u2).Mod(p).Mod(q); + + return v.Equals(r); + } + + protected virtual BigInteger CalculateE(BigInteger n, byte[] message) + { + int length = System.Math.Min(message.Length, n.BitLength / 8); + + return new BigInteger(1, message, 0, length); + } + + protected virtual SecureRandom InitSecureRandom(bool needed, SecureRandom provided) + { + return !needed ? null : (provided != null) ? provided : new SecureRandom(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaSigner.cs.meta new file mode 100644 index 00000000..f2b98a82 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/DsaSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5b22a4699dfabe048aca470ec8820c46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECDsaSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECDsaSigner.cs new file mode 100644 index 00000000..a1165ee0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECDsaSigner.cs @@ -0,0 +1,249 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /** + * EC-DSA as described in X9.62 + */ + public class ECDsaSigner + : IDsaExt + { + private static readonly BigInteger Eight = BigInteger.ValueOf(8); + + protected readonly IDsaKCalculator kCalculator; + + protected ECKeyParameters key = null; + protected SecureRandom random = null; + + /** + * Default configuration, random K values. + */ + public ECDsaSigner() + { + this.kCalculator = new RandomDsaKCalculator(); + } + + /** + * Configuration with an alternate, possibly deterministic calculator of K. + * + * @param kCalculator a K value calculator. + */ + public ECDsaSigner(IDsaKCalculator kCalculator) + { + this.kCalculator = kCalculator; + } + + public virtual string AlgorithmName + { + get { return "ECDSA"; } + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + SecureRandom providedRandom = null; + + if (forSigning) + { + if (parameters is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)parameters; + + providedRandom = rParam.Random; + parameters = rParam.Parameters; + } + + if (!(parameters is ECPrivateKeyParameters)) + throw new InvalidKeyException("EC private key required for signing"); + + this.key = (ECPrivateKeyParameters)parameters; + } + else + { + if (!(parameters is ECPublicKeyParameters)) + throw new InvalidKeyException("EC public key required for verification"); + + this.key = (ECPublicKeyParameters)parameters; + } + + this.random = InitSecureRandom(forSigning && !kCalculator.IsDeterministic, providedRandom); + } + + public virtual BigInteger Order + { + get { return key.Parameters.N; } + } + + // 5.3 pg 28 + /** + * Generate a signature for the given message using the key we were + * initialised with. For conventional DSA the message should be a SHA-1 + * hash of the message of interest. + * + * @param message the message that will be verified later. + */ + public virtual BigInteger[] GenerateSignature(byte[] message) + { + ECDomainParameters ec = key.Parameters; + BigInteger n = ec.N; + BigInteger e = CalculateE(n, message); + BigInteger d = ((ECPrivateKeyParameters)key).D; + + if (kCalculator.IsDeterministic) + { + kCalculator.Init(n, d, message); + } + else + { + kCalculator.Init(n, random); + } + + BigInteger r, s; + + ECMultiplier basePointMultiplier = CreateBasePointMultiplier(); + + // 5.3.2 + do // Generate s + { + BigInteger k; + do // Generate r + { + k = kCalculator.NextK(); + + ECPoint p = basePointMultiplier.Multiply(ec.G, k).Normalize(); + + // 5.3.3 + r = p.AffineXCoord.ToBigInteger().Mod(n); + } + while (r.SignValue == 0); + + s = k.ModInverse(n).Multiply(e.Add(d.Multiply(r))).Mod(n); + } + while (s.SignValue == 0); + + return new BigInteger[]{ r, s }; + } + + // 5.4 pg 29 + /** + * return true if the value r and s represent a DSA signature for + * the passed in message (for standard DSA the message should be + * a SHA-1 hash of the real message to be verified). + */ + public virtual bool VerifySignature(byte[] message, BigInteger r, BigInteger s) + { + BigInteger n = key.Parameters.N; + + // r and s should both in the range [1,n-1] + if (r.SignValue < 1 || s.SignValue < 1 + || r.CompareTo(n) >= 0 || s.CompareTo(n) >= 0) + { + return false; + } + + BigInteger e = CalculateE(n, message); + BigInteger c = s.ModInverse(n); + + BigInteger u1 = e.Multiply(c).Mod(n); + BigInteger u2 = r.Multiply(c).Mod(n); + + ECPoint G = key.Parameters.G; + ECPoint Q = ((ECPublicKeyParameters) key).Q; + + ECPoint point = ECAlgorithms.SumOfTwoMultiplies(G, u1, Q, u2); + + if (point.IsInfinity) + return false; + + /* + * If possible, avoid normalizing the point (to save a modular inversion in the curve field). + * + * There are ~cofactor elements of the curve field that reduce (modulo the group order) to 'r'. + * If the cofactor is known and small, we generate those possible field values and project each + * of them to the same "denominator" (depending on the particular projective coordinates in use) + * as the calculated point.X. If any of the projected values matches point.X, then we have: + * (point.X / Denominator mod p) mod n == r + * as required, and verification succeeds. + * + * Based on an original idea by Gregory Maxwell (https://github.com/gmaxwell), as implemented in + * the libsecp256k1 project (https://github.com/bitcoin/secp256k1). + */ + ECCurve curve = point.Curve; + if (curve != null) + { + BigInteger cofactor = curve.Cofactor; + if (cofactor != null && cofactor.CompareTo(Eight) <= 0) + { + ECFieldElement D = GetDenominator(curve.CoordinateSystem, point); + if (D != null && !D.IsZero) + { + ECFieldElement X = point.XCoord; + while (curve.IsValidFieldElement(r)) + { + ECFieldElement R = curve.FromBigInteger(r).Multiply(D); + if (R.Equals(X)) + { + return true; + } + r = r.Add(n); + } + return false; + } + } + } + + BigInteger v = point.Normalize().AffineXCoord.ToBigInteger().Mod(n); + return v.Equals(r); + } + + protected virtual BigInteger CalculateE(BigInteger n, byte[] message) + { + int messageBitLength = message.Length * 8; + BigInteger trunc = new BigInteger(1, message); + + if (n.BitLength < messageBitLength) + { + trunc = trunc.ShiftRight(messageBitLength - n.BitLength); + } + + return trunc; + } + + protected virtual ECMultiplier CreateBasePointMultiplier() + { + return new FixedPointCombMultiplier(); + } + + protected virtual ECFieldElement GetDenominator(int coordinateSystem, ECPoint p) + { + switch (coordinateSystem) + { + case ECCurve.COORD_HOMOGENEOUS: + case ECCurve.COORD_LAMBDA_PROJECTIVE: + case ECCurve.COORD_SKEWED: + return p.GetZCoord(0); + case ECCurve.COORD_JACOBIAN: + case ECCurve.COORD_JACOBIAN_CHUDNOVSKY: + case ECCurve.COORD_JACOBIAN_MODIFIED: + return p.GetZCoord(0).Square(); + default: + return null; + } + } + + protected virtual SecureRandom InitSecureRandom(bool needed, SecureRandom provided) + { + return !needed ? null : (provided != null) ? provided : new SecureRandom(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECDsaSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECDsaSigner.cs.meta new file mode 100644 index 00000000..3bf6ef68 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECDsaSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2aeec19b82b60784b857139153cf8807 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECGOST3410Signer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECGOST3410Signer.cs new file mode 100644 index 00000000..44e5d1a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECGOST3410Signer.cs @@ -0,0 +1,171 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /** + * GOST R 34.10-2001 Signature Algorithm + */ + public class ECGost3410Signer + : IDsaExt + { + private ECKeyParameters key; + private SecureRandom random; + + public virtual string AlgorithmName + { + get { return "ECGOST3410"; } + } + + public virtual void Init( + bool forSigning, + ICipherParameters parameters) + { + if (forSigning) + { + if (parameters is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)parameters; + + this.random = rParam.Random; + parameters = rParam.Parameters; + } + else + { + this.random = new SecureRandom(); + } + + if (!(parameters is ECPrivateKeyParameters)) + throw new InvalidKeyException("EC private key required for signing"); + + this.key = (ECPrivateKeyParameters) parameters; + } + else + { + if (!(parameters is ECPublicKeyParameters)) + throw new InvalidKeyException("EC public key required for verification"); + + this.key = (ECPublicKeyParameters)parameters; + } + } + + public virtual BigInteger Order + { + get { return key.Parameters.N; } + } + + /** + * generate a signature for the given message using the key we were + * initialised with. For conventional GOST3410 the message should be a GOST3411 + * hash of the message of interest. + * + * @param message the message that will be verified later. + */ + public virtual BigInteger[] GenerateSignature( + byte[] message) + { + byte[] mRev = new byte[message.Length]; // conversion is little-endian + for (int i = 0; i != mRev.Length; i++) + { + mRev[i] = message[mRev.Length - 1 - i]; + } + + BigInteger e = new BigInteger(1, mRev); + + ECDomainParameters ec = key.Parameters; + BigInteger n = ec.N; + BigInteger d = ((ECPrivateKeyParameters)key).D; + + BigInteger r, s = null; + + ECMultiplier basePointMultiplier = CreateBasePointMultiplier(); + + do // generate s + { + BigInteger k; + do // generate r + { + do + { + k = new BigInteger(n.BitLength, random); + } + while (k.SignValue == 0); + + ECPoint p = basePointMultiplier.Multiply(ec.G, k).Normalize(); + + r = p.AffineXCoord.ToBigInteger().Mod(n); + } + while (r.SignValue == 0); + + s = (k.Multiply(e)).Add(d.Multiply(r)).Mod(n); + } + while (s.SignValue == 0); + + return new BigInteger[]{ r, s }; + } + + /** + * return true if the value r and s represent a GOST3410 signature for + * the passed in message (for standard GOST3410 the message should be + * a GOST3411 hash of the real message to be verified). + */ + public virtual bool VerifySignature( + byte[] message, + BigInteger r, + BigInteger s) + { + byte[] mRev = new byte[message.Length]; // conversion is little-endian + for (int i = 0; i != mRev.Length; i++) + { + mRev[i] = message[mRev.Length - 1 - i]; + } + + BigInteger e = new BigInteger(1, mRev); + BigInteger n = key.Parameters.N; + + // r in the range [1,n-1] + if (r.CompareTo(BigInteger.One) < 0 || r.CompareTo(n) >= 0) + { + return false; + } + + // s in the range [1,n-1] + if (s.CompareTo(BigInteger.One) < 0 || s.CompareTo(n) >= 0) + { + return false; + } + + BigInteger v = e.ModInverse(n); + + BigInteger z1 = s.Multiply(v).Mod(n); + BigInteger z2 = (n.Subtract(r)).Multiply(v).Mod(n); + + ECPoint G = key.Parameters.G; // P + ECPoint Q = ((ECPublicKeyParameters)key).Q; + + ECPoint point = ECAlgorithms.SumOfTwoMultiplies(G, z1, Q, z2).Normalize(); + + if (point.IsInfinity) + return false; + + BigInteger R = point.AffineXCoord.ToBigInteger().Mod(n); + + return R.Equals(r); + } + + protected virtual ECMultiplier CreateBasePointMultiplier() + { + return new FixedPointCombMultiplier(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECGOST3410Signer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECGOST3410Signer.cs.meta new file mode 100644 index 00000000..62116d19 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECGOST3410Signer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0fa6c431f2efb54c89b5784adc45bd7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECNRSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECNRSigner.cs new file mode 100644 index 00000000..03fa64be --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECNRSigner.cs @@ -0,0 +1,197 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /** + * EC-NR as described in IEEE 1363-2000 + */ + public class ECNRSigner + : IDsaExt + { + private bool forSigning; + private ECKeyParameters key; + private SecureRandom random; + + public virtual string AlgorithmName + { + get { return "ECNR"; } + } + + public virtual void Init( + bool forSigning, + ICipherParameters parameters) + { + this.forSigning = forSigning; + + if (forSigning) + { + if (parameters is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom) parameters; + + this.random = rParam.Random; + parameters = rParam.Parameters; + } + else + { + this.random = new SecureRandom(); + } + + if (!(parameters is ECPrivateKeyParameters)) + throw new InvalidKeyException("EC private key required for signing"); + + this.key = (ECPrivateKeyParameters) parameters; + } + else + { + if (!(parameters is ECPublicKeyParameters)) + throw new InvalidKeyException("EC public key required for verification"); + + this.key = (ECPublicKeyParameters) parameters; + } + } + + public virtual BigInteger Order + { + get { return key.Parameters.N; } + } + + // Section 7.2.5 ECSP-NR, pg 34 + /** + * generate a signature for the given message using the key we were + * initialised with. Generally, the order of the curve should be at + * least as long as the hash of the message of interest, and with + * ECNR it *must* be at least as long. + * + * @param digest the digest to be signed. + * @exception DataLengthException if the digest is longer than the key allows + */ + public virtual BigInteger[] GenerateSignature( + byte[] message) + { + if (!this.forSigning) + { + // not properly initilaized... deal with it + throw new InvalidOperationException("not initialised for signing"); + } + + BigInteger n = Order; + int nBitLength = n.BitLength; + + BigInteger e = new BigInteger(1, message); + int eBitLength = e.BitLength; + + ECPrivateKeyParameters privKey = (ECPrivateKeyParameters)key; + + if (eBitLength > nBitLength) + { + throw new DataLengthException("input too large for ECNR key."); + } + + BigInteger r = null; + BigInteger s = null; + + AsymmetricCipherKeyPair tempPair; + do // generate r + { + // generate another, but very temporary, key pair using + // the same EC parameters + ECKeyPairGenerator keyGen = new ECKeyPairGenerator(); + + keyGen.Init(new ECKeyGenerationParameters(privKey.Parameters, this.random)); + + tempPair = keyGen.GenerateKeyPair(); + + // BigInteger Vx = tempPair.getPublic().getW().getAffineX(); + ECPublicKeyParameters V = (ECPublicKeyParameters) tempPair.Public; // get temp's public key + BigInteger Vx = V.Q.AffineXCoord.ToBigInteger(); // get the point's x coordinate + + r = Vx.Add(e).Mod(n); + } + while (r.SignValue == 0); + + // generate s + BigInteger x = privKey.D; // private key value + BigInteger u = ((ECPrivateKeyParameters) tempPair.Private).D; // temp's private key value + s = u.Subtract(r.Multiply(x)).Mod(n); + + return new BigInteger[]{ r, s }; + } + + // Section 7.2.6 ECVP-NR, pg 35 + /** + * return true if the value r and s represent a signature for the + * message passed in. Generally, the order of the curve should be at + * least as long as the hash of the message of interest, and with + * ECNR, it *must* be at least as long. But just in case the signer + * applied mod(n) to the longer digest, this implementation will + * apply mod(n) during verification. + * + * @param digest the digest to be verified. + * @param r the r value of the signature. + * @param s the s value of the signature. + * @exception DataLengthException if the digest is longer than the key allows + */ + public virtual bool VerifySignature( + byte[] message, + BigInteger r, + BigInteger s) + { + if (this.forSigning) + { + // not properly initilaized... deal with it + throw new InvalidOperationException("not initialised for verifying"); + } + + ECPublicKeyParameters pubKey = (ECPublicKeyParameters)key; + BigInteger n = pubKey.Parameters.N; + int nBitLength = n.BitLength; + + BigInteger e = new BigInteger(1, message); + int eBitLength = e.BitLength; + + if (eBitLength > nBitLength) + { + throw new DataLengthException("input too large for ECNR key."); + } + + // r in the range [1,n-1] + if (r.CompareTo(BigInteger.One) < 0 || r.CompareTo(n) >= 0) + { + return false; + } + + // s in the range [0,n-1] NB: ECNR spec says 0 + if (s.CompareTo(BigInteger.Zero) < 0 || s.CompareTo(n) >= 0) + { + return false; + } + + // compute P = sG + rW + + ECPoint G = pubKey.Parameters.G; + ECPoint W = pubKey.Q; + // calculate P using Bouncy math + ECPoint P = ECAlgorithms.SumOfTwoMultiplies(G, s, W, r).Normalize(); + + if (P.IsInfinity) + return false; + + BigInteger x = P.AffineXCoord.ToBigInteger(); + BigInteger t = r.Subtract(x).Mod(n); + + return t.Equals(e); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECNRSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECNRSigner.cs.meta new file mode 100644 index 00000000..7e5ffc36 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/ECNRSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b65a3f5dbbb4a340bbc3407aa2a1316 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519Signer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519Signer.cs new file mode 100644 index 00000000..d2485d32 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519Signer.cs @@ -0,0 +1,138 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class Ed25519Signer + : ISigner + { + private readonly Buffer buffer = new Buffer(); + + private bool forSigning; + private Ed25519PrivateKeyParameters privateKey; + private Ed25519PublicKeyParameters publicKey; + + public Ed25519Signer() + { + } + + public virtual string AlgorithmName + { + get { return "Ed25519"; } + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + this.forSigning = forSigning; + + if (forSigning) + { + // TODO Allow IAsymmetricCipherKeyPair to be an ICipherParameters? + + this.privateKey = (Ed25519PrivateKeyParameters)parameters; + this.publicKey = privateKey.GeneratePublicKey(); + } + else + { + this.privateKey = null; + this.publicKey = (Ed25519PublicKeyParameters)parameters; + } + + Reset(); + } + + public virtual void Update(byte b) + { + buffer.WriteByte(b); + } + + public virtual void BlockUpdate(byte[] buf, int off, int len) + { + buffer.Write(buf, off, len); + } + + public virtual byte[] GenerateSignature() + { + if (!forSigning || null == privateKey) + throw new InvalidOperationException("Ed25519Signer not initialised for signature generation."); + + return buffer.GenerateSignature(privateKey, publicKey); + } + + public virtual bool VerifySignature(byte[] signature) + { + if (forSigning || null == publicKey) + throw new InvalidOperationException("Ed25519Signer not initialised for verification"); + + return buffer.VerifySignature(publicKey, signature); + } + + public virtual void Reset() + { + buffer.Reset(); + } + + private class Buffer : MemoryStream + { + internal byte[] GenerateSignature(Ed25519PrivateKeyParameters privateKey, Ed25519PublicKeyParameters publicKey) + { + lock (this) + { +#if PORTABLE || NETFX_CORE + byte[] buf = ToArray(); + int count = buf.Length; +#else + byte[] buf = GetBuffer(); + int count = (int)Position; +#endif + byte[] signature = new byte[Ed25519PrivateKeyParameters.SignatureSize]; + privateKey.Sign(Ed25519.Algorithm.Ed25519, publicKey, null, buf, 0, count, signature, 0); + Reset(); + return signature; + } + } + + internal bool VerifySignature(Ed25519PublicKeyParameters publicKey, byte[] signature) + { + lock (this) + { +#if PORTABLE || NETFX_CORE + byte[] buf = ToArray(); + int count = buf.Length; +#else + byte[] buf = GetBuffer(); + int count = (int)Position; +#endif + byte[] pk = publicKey.GetEncoded(); + bool result = Ed25519.Verify(signature, 0, pk, 0, buf, 0, count); + Reset(); + return result; + } + } + + internal void Reset() + { + lock (this) + { + long count = Position; +#if PORTABLE || NETFX_CORE + this.Position = 0L; + Streams.WriteZeroes(this, count); +#else + Array.Clear(GetBuffer(), 0, (int)count); +#endif + this.Position = 0L; + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519Signer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519Signer.cs.meta new file mode 100644 index 00000000..b5498a35 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519Signer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4be6eb199857ba4fbc1658655705be2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519ctxSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519ctxSigner.cs new file mode 100644 index 00000000..c381b3c1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519ctxSigner.cs @@ -0,0 +1,140 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class Ed25519ctxSigner + : ISigner + { + private readonly Buffer buffer = new Buffer(); + private readonly byte[] context; + + private bool forSigning; + private Ed25519PrivateKeyParameters privateKey; + private Ed25519PublicKeyParameters publicKey; + + public Ed25519ctxSigner(byte[] context) + { + this.context = Arrays.Clone(context); + } + + public virtual string AlgorithmName + { + get { return "Ed25519ctx"; } + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + this.forSigning = forSigning; + + if (forSigning) + { + // TODO Allow IAsymmetricCipherKeyPair to be an ICipherParameters? + + this.privateKey = (Ed25519PrivateKeyParameters)parameters; + this.publicKey = privateKey.GeneratePublicKey(); + } + else + { + this.privateKey = null; + this.publicKey = (Ed25519PublicKeyParameters)parameters; + } + + Reset(); + } + + public virtual void Update(byte b) + { + buffer.WriteByte(b); + } + + public virtual void BlockUpdate(byte[] buf, int off, int len) + { + buffer.Write(buf, off, len); + } + + public virtual byte[] GenerateSignature() + { + if (!forSigning || null == privateKey) + throw new InvalidOperationException("Ed25519ctxSigner not initialised for signature generation."); + + return buffer.GenerateSignature(privateKey, publicKey, context); + } + + public virtual bool VerifySignature(byte[] signature) + { + if (forSigning || null == publicKey) + throw new InvalidOperationException("Ed25519ctxSigner not initialised for verification"); + + return buffer.VerifySignature(publicKey, context, signature); + } + + public virtual void Reset() + { + buffer.Reset(); + } + + private class Buffer : MemoryStream + { + internal byte[] GenerateSignature(Ed25519PrivateKeyParameters privateKey, Ed25519PublicKeyParameters publicKey, byte[] ctx) + { + lock (this) + { +#if PORTABLE || NETFX_CORE + byte[] buf = ToArray(); + int count = buf.Length; +#else + byte[] buf = GetBuffer(); + int count = (int)Position; +#endif + byte[] signature = new byte[Ed25519PrivateKeyParameters.SignatureSize]; + privateKey.Sign(Ed25519.Algorithm.Ed25519ctx, publicKey, ctx, buf, 0, count, signature, 0); + Reset(); + return signature; + } + } + + internal bool VerifySignature(Ed25519PublicKeyParameters publicKey, byte[] ctx, byte[] signature) + { + lock (this) + { +#if PORTABLE || NETFX_CORE + byte[] buf = ToArray(); + int count = buf.Length; +#else + byte[] buf = GetBuffer(); + int count = (int)Position; +#endif + byte[] pk = publicKey.GetEncoded(); + bool result = Ed25519.Verify(signature, 0, pk, 0, ctx, buf, 0, count); + Reset(); + return result; + } + } + + internal void Reset() + { + lock (this) + { + long count = Position; +#if PORTABLE || NETFX_CORE + this.Position = 0L; + Streams.WriteZeroes(this, count); +#else + Array.Clear(GetBuffer(), 0, (int)count); +#endif + this.Position = 0L; + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519ctxSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519ctxSigner.cs.meta new file mode 100644 index 00000000..8be00c05 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519ctxSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a1d3e7080838824a9ba890b627de089 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519phSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519phSigner.cs new file mode 100644 index 00000000..ce24107d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519phSigner.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class Ed25519phSigner + : ISigner + { + private readonly IDigest prehash = Ed25519.CreatePrehash(); + private readonly byte[] context; + + private bool forSigning; + private Ed25519PrivateKeyParameters privateKey; + private Ed25519PublicKeyParameters publicKey; + + public Ed25519phSigner(byte[] context) + { + this.context = Arrays.Clone(context); + } + + public virtual string AlgorithmName + { + get { return "Ed25519ph"; } + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + this.forSigning = forSigning; + + if (forSigning) + { + // TODO Allow AsymmetricCipherKeyPair to be a CipherParameters? + + this.privateKey = (Ed25519PrivateKeyParameters)parameters; + this.publicKey = privateKey.GeneratePublicKey(); + } + else + { + this.privateKey = null; + this.publicKey = (Ed25519PublicKeyParameters)parameters; + } + + Reset(); + } + + public virtual void Update(byte b) + { + prehash.Update(b); + } + + public virtual void BlockUpdate(byte[] buf, int off, int len) + { + prehash.BlockUpdate(buf, off, len); + } + + public virtual byte[] GenerateSignature() + { + if (!forSigning || null == privateKey) + throw new InvalidOperationException("Ed25519phSigner not initialised for signature generation."); + + byte[] msg = new byte[Ed25519.PrehashSize]; + if (Ed25519.PrehashSize != prehash.DoFinal(msg, 0)) + throw new InvalidOperationException("Prehash digest failed"); + + byte[] signature = new byte[Ed25519PrivateKeyParameters.SignatureSize]; + privateKey.Sign(Ed25519.Algorithm.Ed25519ph, publicKey, context, msg, 0, Ed25519.PrehashSize, signature, 0); + return signature; + } + + public virtual bool VerifySignature(byte[] signature) + { + if (forSigning || null == publicKey) + throw new InvalidOperationException("Ed25519phSigner not initialised for verification"); + + byte[] pk = publicKey.GetEncoded(); + return Ed25519.VerifyPrehash(signature, 0, pk, 0, context, prehash); + } + + public void Reset() + { + prehash.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519phSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519phSigner.cs.meta new file mode 100644 index 00000000..32d69648 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed25519phSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4cb55a2ed90089e49bf2f4a650bd0b75 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448Signer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448Signer.cs new file mode 100644 index 00000000..386c221e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448Signer.cs @@ -0,0 +1,140 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class Ed448Signer + : ISigner + { + private readonly Buffer buffer = new Buffer(); + private readonly byte[] context; + + private bool forSigning; + private Ed448PrivateKeyParameters privateKey; + private Ed448PublicKeyParameters publicKey; + + public Ed448Signer(byte[] context) + { + this.context = Arrays.Clone(context); + } + + public virtual string AlgorithmName + { + get { return "Ed448"; } + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + this.forSigning = forSigning; + + if (forSigning) + { + // TODO Allow IAsymmetricCipherKeyPair to be an ICipherParameters? + + this.privateKey = (Ed448PrivateKeyParameters)parameters; + this.publicKey = privateKey.GeneratePublicKey(); + } + else + { + this.privateKey = null; + this.publicKey = (Ed448PublicKeyParameters)parameters; + } + + Reset(); + } + + public virtual void Update(byte b) + { + buffer.WriteByte(b); + } + + public virtual void BlockUpdate(byte[] buf, int off, int len) + { + buffer.Write(buf, off, len); + } + + public virtual byte[] GenerateSignature() + { + if (!forSigning || null == privateKey) + throw new InvalidOperationException("Ed448Signer not initialised for signature generation."); + + return buffer.GenerateSignature(privateKey, publicKey, context); + } + + public virtual bool VerifySignature(byte[] signature) + { + if (forSigning || null == publicKey) + throw new InvalidOperationException("Ed448Signer not initialised for verification"); + + return buffer.VerifySignature(publicKey, context, signature); + } + + public virtual void Reset() + { + buffer.Reset(); + } + + private class Buffer : MemoryStream + { + internal byte[] GenerateSignature(Ed448PrivateKeyParameters privateKey, Ed448PublicKeyParameters publicKey, byte[] ctx) + { + lock (this) + { +#if PORTABLE || NETFX_CORE + byte[] buf = ToArray(); + int count = buf.Length; +#else + byte[] buf = GetBuffer(); + int count = (int)Position; +#endif + byte[] signature = new byte[Ed448PrivateKeyParameters.SignatureSize]; + privateKey.Sign(Ed448.Algorithm.Ed448, publicKey, ctx, buf, 0, count, signature, 0); + Reset(); + return signature; + } + } + + internal bool VerifySignature(Ed448PublicKeyParameters publicKey, byte[] ctx, byte[] signature) + { + lock (this) + { +#if PORTABLE || NETFX_CORE + byte[] buf = ToArray(); + int count = buf.Length; +#else + byte[] buf = GetBuffer(); + int count = (int)Position; +#endif + byte[] pk = publicKey.GetEncoded(); + bool result = Ed448.Verify(signature, 0, pk, 0, ctx, buf, 0, count); + Reset(); + return result; + } + } + + internal void Reset() + { + lock (this) + { + long count = Position; +#if PORTABLE || NETFX_CORE + this.Position = 0L; + Streams.WriteZeroes(this, count); +#else + Array.Clear(GetBuffer(), 0, (int)count); +#endif + this.Position = 0L; + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448Signer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448Signer.cs.meta new file mode 100644 index 00000000..9f1f36e9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448Signer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f9d2c4cec709344a955e7ee6be9ef75 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448phSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448phSigner.cs new file mode 100644 index 00000000..5c3208ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448phSigner.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class Ed448phSigner + : ISigner + { + private readonly IXof prehash = Ed448.CreatePrehash(); + private readonly byte[] context; + + private bool forSigning; + private Ed448PrivateKeyParameters privateKey; + private Ed448PublicKeyParameters publicKey; + + public Ed448phSigner(byte[] context) + { + this.context = Arrays.Clone(context); + } + + public virtual string AlgorithmName + { + get { return "Ed448ph"; } + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + this.forSigning = forSigning; + + if (forSigning) + { + // TODO Allow AsymmetricCipherKeyPair to be a CipherParameters? + + this.privateKey = (Ed448PrivateKeyParameters)parameters; + this.publicKey = privateKey.GeneratePublicKey(); + } + else + { + this.privateKey = null; + this.publicKey = (Ed448PublicKeyParameters)parameters; + } + + Reset(); + } + + public virtual void Update(byte b) + { + prehash.Update(b); + } + + public virtual void BlockUpdate(byte[] buf, int off, int len) + { + prehash.BlockUpdate(buf, off, len); + } + + public virtual byte[] GenerateSignature() + { + if (!forSigning || null == privateKey) + throw new InvalidOperationException("Ed448phSigner not initialised for signature generation."); + + byte[] msg = new byte[Ed448.PrehashSize]; + if (Ed448.PrehashSize != prehash.DoFinal(msg, 0, Ed448.PrehashSize)) + throw new InvalidOperationException("Prehash digest failed"); + + byte[] signature = new byte[Ed448PrivateKeyParameters.SignatureSize]; + privateKey.Sign(Ed448.Algorithm.Ed448ph, publicKey, context, msg, 0, Ed448.PrehashSize, signature, 0); + return signature; + } + + public virtual bool VerifySignature(byte[] signature) + { + if (forSigning || null == publicKey) + throw new InvalidOperationException("Ed448phSigner not initialised for verification"); + + byte[] pk = publicKey.GetEncoded(); + return Ed448.VerifyPrehash(signature, 0, pk, 0, context, prehash); + } + + public void Reset() + { + prehash.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448phSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448phSigner.cs.meta new file mode 100644 index 00000000..cd684f89 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Ed448phSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d482c3f30a338e84eac18dc552d6f14f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410DigestSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410DigestSigner.cs new file mode 100644 index 00000000..c690e191 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410DigestSigner.cs @@ -0,0 +1,149 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class Gost3410DigestSigner + : ISigner + { + private readonly IDigest digest; + private readonly IDsa dsaSigner; + private bool forSigning; + + public Gost3410DigestSigner( + IDsa signer, + IDigest digest) + { + this.dsaSigner = signer; + this.digest = digest; + } + + public virtual string AlgorithmName + { + get { return digest.AlgorithmName + "with" + dsaSigner.AlgorithmName; } + } + + public virtual void Init( + bool forSigning, + ICipherParameters parameters) + { + this.forSigning = forSigning; + + AsymmetricKeyParameter k; + if (parameters is ParametersWithRandom) + { + k = (AsymmetricKeyParameter)((ParametersWithRandom)parameters).Parameters; + } + else + { + k = (AsymmetricKeyParameter)parameters; + } + + if (forSigning && !k.IsPrivate) + { + throw new InvalidKeyException("Signing Requires Private Key."); + } + + if (!forSigning && k.IsPrivate) + { + throw new InvalidKeyException("Verification Requires Public Key."); + } + + Reset(); + + dsaSigner.Init(forSigning, parameters); + } + + /** + * update the internal digest with the byte b + */ + public virtual void Update( + byte input) + { + digest.Update(input); + } + + /** + * update the internal digest with the byte array in + */ + public virtual void BlockUpdate( + byte[] input, + int inOff, + int length) + { + digest.BlockUpdate(input, inOff, length); + } + + /** + * Generate a signature for the message we've been loaded with using + * the key we were initialised with. + */ + public virtual byte[] GenerateSignature() + { + if (!forSigning) + throw new InvalidOperationException("GOST3410DigestSigner not initialised for signature generation."); + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + try + { + BigInteger[] sig = dsaSigner.GenerateSignature(hash); + byte[] sigBytes = new byte[64]; + + // TODO Add methods to allow writing BigInteger to existing byte array? + byte[] r = sig[0].ToByteArrayUnsigned(); + byte[] s = sig[1].ToByteArrayUnsigned(); + s.CopyTo(sigBytes, 32 - s.Length); + r.CopyTo(sigBytes, 64 - r.Length); + return sigBytes; + } + catch (Exception e) + { + throw new SignatureException(e.Message, e); + } + } + + /// true if the internal state represents the signature described in the passed in array. + public virtual bool VerifySignature( + byte[] signature) + { + if (forSigning) + throw new InvalidOperationException("DSADigestSigner not initialised for verification"); + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + BigInteger R, S; + try + { + R = new BigInteger(1, signature, 32, 32); + S = new BigInteger(1, signature, 0, 32); + } + catch (Exception e) + { + throw new SignatureException("error decoding signature bytes.", e); + } + + return dsaSigner.VerifySignature(hash, R, S); + } + + /// Reset the internal state + public virtual void Reset() + { + digest.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410DigestSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410DigestSigner.cs.meta new file mode 100644 index 00000000..313b6beb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410DigestSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e49e35369e72fe545b2a1fddbaa3603a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410Signer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410Signer.cs new file mode 100644 index 00000000..84f7a64a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410Signer.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /** + * Gost R 34.10-94 Signature Algorithm + */ + public class Gost3410Signer + : IDsaExt + { + private Gost3410KeyParameters key; + private SecureRandom random; + + public virtual string AlgorithmName + { + get { return "GOST3410"; } + } + + public virtual void Init( + bool forSigning, + ICipherParameters parameters) + { + if (forSigning) + { + if (parameters is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)parameters; + + this.random = rParam.Random; + parameters = rParam.Parameters; + } + else + { + this.random = new SecureRandom(); + } + + if (!(parameters is Gost3410PrivateKeyParameters)) + throw new InvalidKeyException("GOST3410 private key required for signing"); + + this.key = (Gost3410PrivateKeyParameters) parameters; + } + else + { + if (!(parameters is Gost3410PublicKeyParameters)) + throw new InvalidKeyException("GOST3410 public key required for signing"); + + this.key = (Gost3410PublicKeyParameters) parameters; + } + } + + public virtual BigInteger Order + { + get { return key.Parameters.Q; } + } + + /** + * generate a signature for the given message using the key we were + * initialised with. For conventional Gost3410 the message should be a Gost3411 + * hash of the message of interest. + * + * @param message the message that will be verified later. + */ + public virtual BigInteger[] GenerateSignature( + byte[] message) + { + byte[] mRev = new byte[message.Length]; // conversion is little-endian + for (int i = 0; i != mRev.Length; i++) + { + mRev[i] = message[mRev.Length - 1 - i]; + } + + BigInteger m = new BigInteger(1, mRev); + Gost3410Parameters parameters = key.Parameters; + BigInteger k; + + do + { + k = new BigInteger(parameters.Q.BitLength, random); + } + while (k.CompareTo(parameters.Q) >= 0); + + BigInteger r = parameters.A.ModPow(k, parameters.P).Mod(parameters.Q); + + BigInteger s = k.Multiply(m). + Add(((Gost3410PrivateKeyParameters)key).X.Multiply(r)). + Mod(parameters.Q); + + return new BigInteger[]{ r, s }; + } + + /** + * return true if the value r and s represent a Gost3410 signature for + * the passed in message for standard Gost3410 the message should be a + * Gost3411 hash of the real message to be verified. + */ + public virtual bool VerifySignature( + byte[] message, + BigInteger r, + BigInteger s) + { + byte[] mRev = new byte[message.Length]; // conversion is little-endian + for (int i = 0; i != mRev.Length; i++) + { + mRev[i] = message[mRev.Length - 1 - i]; + } + + BigInteger m = new BigInteger(1, mRev); + Gost3410Parameters parameters = key.Parameters; + + if (r.SignValue < 0 || parameters.Q.CompareTo(r) <= 0) + { + return false; + } + + if (s.SignValue < 0 || parameters.Q.CompareTo(s) <= 0) + { + return false; + } + + BigInteger v = m.ModPow(parameters.Q.Subtract(BigInteger.Two), parameters.Q); + + BigInteger z1 = s.Multiply(v).Mod(parameters.Q); + BigInteger z2 = (parameters.Q.Subtract(r)).Multiply(v).Mod(parameters.Q); + + z1 = parameters.A.ModPow(z1, parameters.P); + z2 = ((Gost3410PublicKeyParameters)key).Y.ModPow(z2, parameters.P); + + BigInteger u = z1.Multiply(z2).Mod(parameters.P).Mod(parameters.Q); + + return u.Equals(r); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410Signer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410Signer.cs.meta new file mode 100644 index 00000000..ec61a12e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GOST3410Signer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 675f660b7066e3842bfd94bc6c5ea723 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GenericSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GenericSigner.cs new file mode 100644 index 00000000..abf14d92 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GenericSigner.cs @@ -0,0 +1,134 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class GenericSigner + : ISigner + { + private readonly IAsymmetricBlockCipher engine; + private readonly IDigest digest; + private bool forSigning; + + public GenericSigner( + IAsymmetricBlockCipher engine, + IDigest digest) + { + this.engine = engine; + this.digest = digest; + } + + public virtual string AlgorithmName + { + get { return "Generic(" + engine.AlgorithmName + "/" + digest.AlgorithmName + ")"; } + } + + /** + * initialise the signer for signing or verification. + * + * @param forSigning + * true if for signing, false otherwise + * @param parameters + * necessary parameters. + */ + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + this.forSigning = forSigning; + + AsymmetricKeyParameter k; + if (parameters is ParametersWithRandom) + { + k = (AsymmetricKeyParameter)((ParametersWithRandom)parameters).Parameters; + } + else + { + k = (AsymmetricKeyParameter)parameters; + } + + if (forSigning && !k.IsPrivate) + throw new InvalidKeyException("Signing requires private key."); + + if (!forSigning && k.IsPrivate) + throw new InvalidKeyException("Verification requires public key."); + + Reset(); + + engine.Init(forSigning, parameters); + } + + /** + * update the internal digest with the byte b + */ + public virtual void Update(byte input) + { + digest.Update(input); + } + + /** + * update the internal digest with the byte array in + */ + public virtual void BlockUpdate(byte[] input, int inOff, int length) + { + digest.BlockUpdate(input, inOff, length); + } + + /** + * Generate a signature for the message we've been loaded with using the key + * we were initialised with. + */ + public virtual byte[] GenerateSignature() + { + if (!forSigning) + throw new InvalidOperationException("GenericSigner not initialised for signature generation."); + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + return engine.ProcessBlock(hash, 0, hash.Length); + } + + /** + * return true if the internal state represents the signature described in + * the passed in array. + */ + public virtual bool VerifySignature(byte[] signature) + { + if (forSigning) + throw new InvalidOperationException("GenericSigner not initialised for verification"); + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + try + { + byte[] sig = engine.ProcessBlock(signature, 0, signature.Length); + + // Extend with leading zeroes to match the digest size, if necessary. + if (sig.Length < hash.Length) + { + byte[] tmp = new byte[hash.Length]; + Array.Copy(sig, 0, tmp, tmp.Length - sig.Length, sig.Length); + sig = tmp; + } + + return Arrays.ConstantTimeAreEqual(sig, hash); + } + catch (Exception) + { + return false; + } + } + + public virtual void Reset() + { + digest.Reset(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GenericSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GenericSigner.cs.meta new file mode 100644 index 00000000..554fceec --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/GenericSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c33281fcbe5fc2448a481ded39da05c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/HMacDsaKCalculator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/HMacDsaKCalculator.cs new file mode 100644 index 00000000..a8cb7ca6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/HMacDsaKCalculator.cs @@ -0,0 +1,155 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /** + * A deterministic K calculator based on the algorithm in section 3.2 of RFC 6979. + */ + public class HMacDsaKCalculator + : IDsaKCalculator + { + private readonly HMac hMac; + private readonly byte[] K; + private readonly byte[] V; + + private BigInteger n; + + /** + * Base constructor. + * + * @param digest digest to build the HMAC on. + */ + public HMacDsaKCalculator(IDigest digest) + { + this.hMac = new HMac(digest); + this.V = new byte[hMac.GetMacSize()]; + this.K = new byte[hMac.GetMacSize()]; + } + + public virtual bool IsDeterministic + { + get { return true; } + } + + public virtual void Init(BigInteger n, SecureRandom random) + { + throw new InvalidOperationException("Operation not supported"); + } + + public void Init(BigInteger n, BigInteger d, byte[] message) + { + this.n = n; + + Arrays.Fill(V, (byte)0x01); + Arrays.Fill(K, (byte)0); + + int size = BigIntegers.GetUnsignedByteLength(n); + byte[] x = new byte[size]; + byte[] dVal = BigIntegers.AsUnsignedByteArray(d); + + Array.Copy(dVal, 0, x, x.Length - dVal.Length, dVal.Length); + + byte[] m = new byte[size]; + + BigInteger mInt = BitsToInt(message); + + if (mInt.CompareTo(n) >= 0) + { + mInt = mInt.Subtract(n); + } + + byte[] mVal = BigIntegers.AsUnsignedByteArray(mInt); + + Array.Copy(mVal, 0, m, m.Length - mVal.Length, mVal.Length); + + hMac.Init(new KeyParameter(K)); + + hMac.BlockUpdate(V, 0, V.Length); + hMac.Update((byte)0x00); + hMac.BlockUpdate(x, 0, x.Length); + hMac.BlockUpdate(m, 0, m.Length); + + hMac.DoFinal(K, 0); + + hMac.Init(new KeyParameter(K)); + + hMac.BlockUpdate(V, 0, V.Length); + + hMac.DoFinal(V, 0); + + hMac.BlockUpdate(V, 0, V.Length); + hMac.Update((byte)0x01); + hMac.BlockUpdate(x, 0, x.Length); + hMac.BlockUpdate(m, 0, m.Length); + + hMac.DoFinal(K, 0); + + hMac.Init(new KeyParameter(K)); + + hMac.BlockUpdate(V, 0, V.Length); + + hMac.DoFinal(V, 0); + } + + public virtual BigInteger NextK() + { + byte[] t = new byte[BigIntegers.GetUnsignedByteLength(n)]; + + for (;;) + { + int tOff = 0; + + while (tOff < t.Length) + { + hMac.BlockUpdate(V, 0, V.Length); + + hMac.DoFinal(V, 0); + + int len = System.Math.Min(t.Length - tOff, V.Length); + Array.Copy(V, 0, t, tOff, len); + tOff += len; + } + + BigInteger k = BitsToInt(t); + + if (k.SignValue > 0 && k.CompareTo(n) < 0) + { + return k; + } + + hMac.BlockUpdate(V, 0, V.Length); + hMac.Update((byte)0x00); + + hMac.DoFinal(K, 0); + + hMac.Init(new KeyParameter(K)); + + hMac.BlockUpdate(V, 0, V.Length); + + hMac.DoFinal(V, 0); + } + } + + private BigInteger BitsToInt(byte[] t) + { + BigInteger v = new BigInteger(1, t); + + if (t.Length * 8 > n.BitLength) + { + v = v.ShiftRight(t.Length * 8 - n.BitLength); + } + + return v; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/HMacDsaKCalculator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/HMacDsaKCalculator.cs.meta new file mode 100644 index 00000000..a805ca9d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/HMacDsaKCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78e1027b4769aa54ba1097aeccbdf881 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaEncoding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaEncoding.cs new file mode 100644 index 00000000..c921dcb3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaEncoding.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /// + /// An interface for different encoding formats for DSA signatures. + /// + public interface IDsaEncoding + { + /// Decode the (r, s) pair of a DSA signature. + /// The order of the group that r, s belong to. + /// An encoding of the (r, s) pair of a DSA signature. + /// The (r, s) of a DSA signature, stored in an array of exactly two elements, r followed by s. + BigInteger[] Decode(BigInteger n, byte[] encoding); + + /// Encode the (r, s) pair of a DSA signature. + /// The order of the group that r, s belong to. + /// The r value of a DSA signature. + /// The s value of a DSA signature. + /// An encoding of the DSA signature given by the provided (r, s) pair. + byte[] Encode(BigInteger n, BigInteger r, BigInteger s); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaEncoding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaEncoding.cs.meta new file mode 100644 index 00000000..f11da500 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaEncoding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b15d467750338ac4a8b50bf23145b743 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaKCalculator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaKCalculator.cs new file mode 100644 index 00000000..08a40c45 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaKCalculator.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /** + * Interface define calculators of K values for DSA/ECDSA. + */ + public interface IDsaKCalculator + { + /** + * Return true if this calculator is deterministic, false otherwise. + * + * @return true if deterministic, otherwise false. + */ + bool IsDeterministic { get; } + + /** + * Non-deterministic initialiser. + * + * @param n the order of the DSA group. + * @param random a source of randomness. + */ + void Init(BigInteger n, SecureRandom random); + + /** + * Deterministic initialiser. + * + * @param n the order of the DSA group. + * @param d the DSA private value. + * @param message the message being signed. + */ + void Init(BigInteger n, BigInteger d, byte[] message); + + /** + * Return the next valid value of K. + * + * @return a K value. + */ + BigInteger NextK(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaKCalculator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaKCalculator.cs.meta new file mode 100644 index 00000000..c6a65e1e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IDsaKCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6b2ca8e130099946a1565068a5b5929 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2PssSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2PssSigner.cs new file mode 100644 index 00000000..72469898 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2PssSigner.cs @@ -0,0 +1,623 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /// ISO9796-2 - mechanism using a hash function with recovery (scheme 2 and 3). + ///

+ /// Note: the usual length for the salt is the length of the hash + /// function used in bytes.

+ ///
+ public class Iso9796d2PssSigner + : ISignerWithRecovery + { + /// + /// Return a reference to the recoveredMessage message. + /// + /// The full/partial recoveredMessage message. + /// + public byte[] GetRecoveredMessage() + { + return recoveredMessage; + } + + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerImplicit = 0xBC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerRipeMD160 = 0x31CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerRipeMD128 = 0x32CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerSha1 = 0x33CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerSha256 = 0x34CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerSha512 = 0x35CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerSha384 = 0x36CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerWhirlpool = 0x37CC; + + private IDigest digest; + private IAsymmetricBlockCipher cipher; + + private SecureRandom random; + private byte[] standardSalt; + + private int hLen; + private int trailer; + private int keyBits; + private byte[] block; + private byte[] mBuf; + private int messageLength; + private readonly int saltLength; + private bool fullMessage; + private byte[] recoveredMessage; + + private byte[] preSig; + private byte[] preBlock; + private int preMStart; + private int preTLength; + + /// + /// Generate a signer with either implicit or explicit trailers for ISO9796-2, scheme 2 or 3. + /// + /// base cipher to use for signature creation/verification + /// digest to use. + /// length of salt in bytes. + /// whether or not the trailer is implicit or gives the hash. + public Iso9796d2PssSigner( + IAsymmetricBlockCipher cipher, + IDigest digest, + int saltLength, + bool isImplicit) + { + this.cipher = cipher; + this.digest = digest; + this.hLen = digest.GetDigestSize(); + this.saltLength = saltLength; + + if (isImplicit) + { + trailer = IsoTrailers.TRAILER_IMPLICIT; + } + else if (IsoTrailers.NoTrailerAvailable(digest)) + { + throw new ArgumentException("no valid trailer", "digest"); + } + else + { + trailer = IsoTrailers.GetTrailer(digest); + } + } + + /// Constructor for a signer with an explicit digest trailer. + /// + /// + /// cipher to use. + /// + /// digest to sign with. + /// + /// length of salt in bytes. + /// + public Iso9796d2PssSigner( + IAsymmetricBlockCipher cipher, + IDigest digest, + int saltLength) + : this(cipher, digest, saltLength, false) + { + } + + public virtual string AlgorithmName + { + get { return digest.AlgorithmName + "with" + "ISO9796-2S2"; } + } + + /// Initialise the signer. + /// true if for signing, false if for verification. + /// parameters for signature generation/verification. If the + /// parameters are for generation they should be a ParametersWithRandom, + /// a ParametersWithSalt, or just an RsaKeyParameters object. If RsaKeyParameters + /// are passed in a SecureRandom will be created. + /// + /// if wrong parameter type or a fixed + /// salt is passed in which is the wrong length. + /// + public virtual void Init( + bool forSigning, + ICipherParameters parameters) + { + RsaKeyParameters kParam; + if (parameters is ParametersWithRandom) + { + ParametersWithRandom p = (ParametersWithRandom) parameters; + + kParam = (RsaKeyParameters) p.Parameters; + + if (forSigning) + { + random = p.Random; + } + } + else if (parameters is ParametersWithSalt) + { + if (!forSigning) + throw new ArgumentException("ParametersWithSalt only valid for signing", "parameters"); + + ParametersWithSalt p = (ParametersWithSalt) parameters; + + kParam = (RsaKeyParameters) p.Parameters; + standardSalt = p.GetSalt(); + + if (standardSalt.Length != saltLength) + throw new ArgumentException("Fixed salt is of wrong length"); + } + else + { + kParam = (RsaKeyParameters) parameters; + + if (forSigning) + { + random = new SecureRandom(); + } + } + + cipher.Init(forSigning, kParam); + + keyBits = kParam.Modulus.BitLength; + + block = new byte[(keyBits + 7) / 8]; + + if (trailer == IsoTrailers.TRAILER_IMPLICIT) + { + mBuf = new byte[block.Length - digest.GetDigestSize() - saltLength - 1 - 1]; + } + else + { + mBuf = new byte[block.Length - digest.GetDigestSize() - saltLength - 1 - 2]; + } + + Reset(); + } + + /// compare two byte arrays - constant time. + private bool IsSameAs(byte[] a, byte[] b) + { + if (messageLength != b.Length) + { + return false; + } + + bool isOkay = true; + + for (int i = 0; i != b.Length; i++) + { + if (a[i] != b[i]) + { + isOkay = false; + } + } + + return isOkay; + } + + /// clear possible sensitive data + private void ClearBlock( + byte[] block) + { + Array.Clear(block, 0, block.Length); + } + + public virtual void UpdateWithRecoveredMessage( + byte[] signature) + { + byte[] block = cipher.ProcessBlock(signature, 0, signature.Length); + + // + // adjust block size for leading zeroes if necessary + // + if (block.Length < (keyBits + 7) / 8) + { + byte[] tmp = new byte[(keyBits + 7) / 8]; + + Array.Copy(block, 0, tmp, tmp.Length - block.Length, block.Length); + ClearBlock(block); + block = tmp; + } + + int tLength; + + if (((block[block.Length - 1] & 0xFF) ^ 0xBC) == 0) + { + tLength = 1; + } + else + { + int sigTrail = ((block[block.Length - 2] & 0xFF) << 8) | (block[block.Length - 1] & 0xFF); + + if (IsoTrailers.NoTrailerAvailable(digest)) + throw new ArgumentException("unrecognised hash in signature"); + + if (sigTrail != IsoTrailers.GetTrailer(digest)) + throw new InvalidOperationException("signer initialised with wrong digest for trailer " + sigTrail); + + tLength = 2; + } + + // + // calculate H(m2) + // + byte[] m2Hash = new byte[hLen]; + digest.DoFinal(m2Hash, 0); + + // + // remove the mask + // + byte[] dbMask = MaskGeneratorFunction1(block, block.Length - hLen - tLength, hLen, block.Length - hLen - tLength); + for (int i = 0; i != dbMask.Length; i++) + { + block[i] ^= dbMask[i]; + } + + block[0] &= 0x7f; + + // + // find out how much padding we've got + // + int mStart = 0; + + while (mStart < block.Length) + { + if (block[mStart++] == 0x01) + break; + } + + if (mStart >= block.Length) + { + ClearBlock(block); + } + + fullMessage = (mStart > 1); + + recoveredMessage = new byte[dbMask.Length - mStart - saltLength]; + + Array.Copy(block, mStart, recoveredMessage, 0, recoveredMessage.Length); + recoveredMessage.CopyTo(mBuf, 0); + + preSig = signature; + preBlock = block; + preMStart = mStart; + preTLength = tLength; + } + + /// update the internal digest with the byte b + public virtual void Update( + byte input) + { + if (preSig == null && messageLength < mBuf.Length) + { + mBuf[messageLength++] = input; + } + else + { + digest.Update(input); + } + } + + /// update the internal digest with the byte array in + public virtual void BlockUpdate( + byte[] input, + int inOff, + int length) + { + if (preSig == null) + { + while (length > 0 && messageLength < mBuf.Length) + { + this.Update(input[inOff]); + inOff++; + length--; + } + } + + if (length > 0) + { + digest.BlockUpdate(input, inOff, length); + } + } + + /// reset the internal state + public virtual void Reset() + { + digest.Reset(); + messageLength = 0; + if (mBuf != null) + { + ClearBlock(mBuf); + } + if (recoveredMessage != null) + { + ClearBlock(recoveredMessage); + recoveredMessage = null; + } + fullMessage = false; + if (preSig != null) + { + preSig = null; + ClearBlock(preBlock); + preBlock = null; + } + } + + /// Generate a signature for the loaded message using the key we were + /// initialised with. + /// + public virtual byte[] GenerateSignature() + { + int digSize = digest.GetDigestSize(); + byte[] m2Hash = new byte[digSize]; + digest.DoFinal(m2Hash, 0); + + byte[] C = new byte[8]; + LtoOSP(messageLength * 8, C); + + digest.BlockUpdate(C, 0, C.Length); + digest.BlockUpdate(mBuf, 0, messageLength); + digest.BlockUpdate(m2Hash, 0, m2Hash.Length); + + byte[] salt; + if (standardSalt != null) + { + salt = standardSalt; + } + else + { + salt = new byte[saltLength]; + random.NextBytes(salt); + } + + digest.BlockUpdate(salt, 0, salt.Length); + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + int tLength = 2; + if (trailer == IsoTrailers.TRAILER_IMPLICIT) + { + tLength = 1; + } + + int off = block.Length - messageLength - salt.Length - hLen - tLength - 1; + + block[off] = (byte) (0x01); + + Array.Copy(mBuf, 0, block, off + 1, messageLength); + Array.Copy(salt, 0, block, off + 1 + messageLength, salt.Length); + + byte[] dbMask = MaskGeneratorFunction1(hash, 0, hash.Length, block.Length - hLen - tLength); + for (int i = 0; i != dbMask.Length; i++) + { + block[i] ^= dbMask[i]; + } + + Array.Copy(hash, 0, block, block.Length - hLen - tLength, hLen); + + if (trailer == IsoTrailers.TRAILER_IMPLICIT) + { + block[block.Length - 1] = (byte)IsoTrailers.TRAILER_IMPLICIT; + } + else + { + block[block.Length - 2] = (byte) ((uint)trailer >> 8); + block[block.Length - 1] = (byte) trailer; + } + + block[0] &= (byte) (0x7f); + + byte[] b = cipher.ProcessBlock(block, 0, block.Length); + + ClearBlock(mBuf); + ClearBlock(block); + messageLength = 0; + + return b; + } + + /// return true if the signature represents a ISO9796-2 signature + /// for the passed in message. + /// + public virtual bool VerifySignature( + byte[] signature) + { + // + // calculate H(m2) + // + byte[] m2Hash = new byte[hLen]; + digest.DoFinal(m2Hash, 0); + + byte[] block; + int tLength; + int mStart = 0; + + if (preSig == null) + { + try + { + UpdateWithRecoveredMessage(signature); + } + catch (Exception) + { + return false; + } + } + else + { + if (!Arrays.AreEqual(preSig, signature)) + { + throw new InvalidOperationException("UpdateWithRecoveredMessage called on different signature"); + } + } + + block = preBlock; + mStart = preMStart; + tLength = preTLength; + + preSig = null; + preBlock = null; + + // + // check the hashes + // + byte[] C = new byte[8]; + LtoOSP(recoveredMessage.Length * 8, C); + + digest.BlockUpdate(C, 0, C.Length); + + if (recoveredMessage.Length != 0) + { + digest.BlockUpdate(recoveredMessage, 0, recoveredMessage.Length); + } + + digest.BlockUpdate(m2Hash, 0, m2Hash.Length); + + // Update for the salt + if (standardSalt != null) + { + digest.BlockUpdate(standardSalt, 0, standardSalt.Length); + } + else + { + digest.BlockUpdate(block, mStart + recoveredMessage.Length, saltLength); + } + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + int off = block.Length - tLength - hash.Length; + + bool isOkay = true; + + for (int i = 0; i != hash.Length; i++) + { + if (hash[i] != block[off + i]) + { + isOkay = false; + } + } + + ClearBlock(block); + ClearBlock(hash); + + if (!isOkay) + { + fullMessage = false; + messageLength = 0; + ClearBlock(recoveredMessage); + return false; + } + + // + // if they've input a message check what we've recovered against + // what was input. + // + if (messageLength != 0) + { + if (!IsSameAs(mBuf, recoveredMessage)) + { + messageLength = 0; + ClearBlock(mBuf); + return false; + } + } + + messageLength = 0; + + ClearBlock(mBuf); + return true; + } + + /// + /// Return true if the full message was recoveredMessage. + /// + /// true on full message recovery, false otherwise, or if not sure. + /// + public virtual bool HasFullMessage() + { + return fullMessage; + } + + /// int to octet string. + /// int to octet string. + private void ItoOSP( + int i, + byte[] sp) + { + sp[0] = (byte)((uint)i >> 24); + sp[1] = (byte)((uint)i >> 16); + sp[2] = (byte)((uint)i >> 8); + sp[3] = (byte)((uint)i >> 0); + } + + /// long to octet string. + private void LtoOSP(long l, byte[] sp) + { + sp[0] = (byte)((ulong)l >> 56); + sp[1] = (byte)((ulong)l >> 48); + sp[2] = (byte)((ulong)l >> 40); + sp[3] = (byte)((ulong)l >> 32); + sp[4] = (byte)((ulong)l >> 24); + sp[5] = (byte)((ulong)l >> 16); + sp[6] = (byte)((ulong)l >> 8); + sp[7] = (byte)((ulong)l >> 0); + } + + /// mask generator function, as described in Pkcs1v2. + private byte[] MaskGeneratorFunction1( + byte[] Z, + int zOff, + int zLen, + int length) + { + byte[] mask = new byte[length]; + byte[] hashBuf = new byte[hLen]; + byte[] C = new byte[4]; + int counter = 0; + + digest.Reset(); + + do + { + ItoOSP(counter, C); + + digest.BlockUpdate(Z, zOff, zLen); + digest.BlockUpdate(C, 0, C.Length); + digest.DoFinal(hashBuf, 0); + + Array.Copy(hashBuf, 0, mask, counter * hLen, hLen); + } + while (++counter < (length / hLen)); + + if ((counter * hLen) < length) + { + ItoOSP(counter, C); + + digest.BlockUpdate(Z, zOff, zLen); + digest.BlockUpdate(C, 0, C.Length); + digest.DoFinal(hashBuf, 0); + + Array.Copy(hashBuf, 0, mask, counter * hLen, mask.Length - (counter * hLen)); + } + + return mask; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2PssSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2PssSigner.cs.meta new file mode 100644 index 00000000..c323cdb0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2PssSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d99002462363d2048b142db69714f6ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2Signer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2Signer.cs new file mode 100644 index 00000000..db5ed7b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2Signer.cs @@ -0,0 +1,560 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /// ISO9796-2 - mechanism using a hash function with recovery (scheme 1) + public class Iso9796d2Signer : ISignerWithRecovery + { + /// + /// Return a reference to the recoveredMessage message. + /// + /// The full/partial recoveredMessage message. + /// + public byte[] GetRecoveredMessage() + { + return recoveredMessage; + } + + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerImplicit = 0xBC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerRipeMD160 = 0x31CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerRipeMD128 = 0x32CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerSha1 = 0x33CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerSha256 = 0x34CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerSha512 = 0x35CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerSha384 = 0x36CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TrailerWhirlpool = 0x37CC; + + private IDigest digest; + private IAsymmetricBlockCipher cipher; + + private int trailer; + private int keyBits; + private byte[] block; + private byte[] mBuf; + private int messageLength; + private bool fullMessage; + private byte[] recoveredMessage; + + private byte[] preSig; + private byte[] preBlock; + + /// + /// Generate a signer with either implicit or explicit trailers for ISO9796-2. + /// + /// base cipher to use for signature creation/verification + /// digest to use. + /// whether or not the trailer is implicit or gives the hash. + public Iso9796d2Signer( + IAsymmetricBlockCipher cipher, + IDigest digest, + bool isImplicit) + { + this.cipher = cipher; + this.digest = digest; + + if (isImplicit) + { + trailer = IsoTrailers.TRAILER_IMPLICIT; + } + else if (IsoTrailers.NoTrailerAvailable(digest)) + { + throw new ArgumentException("no valid trailer", "digest"); + } + else + { + trailer = IsoTrailers.GetTrailer(digest); + } + } + + /// Constructor for a signer with an explicit digest trailer. + /// + /// + /// cipher to use. + /// + /// digest to sign with. + /// + public Iso9796d2Signer(IAsymmetricBlockCipher cipher, IDigest digest) + : this(cipher, digest, false) + { + } + + public virtual string AlgorithmName + { + get { return digest.AlgorithmName + "with" + "ISO9796-2S1"; } + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + RsaKeyParameters kParam = (RsaKeyParameters) parameters; + + cipher.Init(forSigning, kParam); + + keyBits = kParam.Modulus.BitLength; + + block = new byte[(keyBits + 7) / 8]; + if (trailer == IsoTrailers.TRAILER_IMPLICIT) + { + mBuf = new byte[block.Length - digest.GetDigestSize() - 2]; + } + else + { + mBuf = new byte[block.Length - digest.GetDigestSize() - 3]; + } + + Reset(); + } + + /// compare two byte arrays - constant time. + private bool IsSameAs(byte[] a, byte[] b) + { + int checkLen; + if (messageLength > mBuf.Length) + { + if (mBuf.Length > b.Length) + { + return false; + } + + checkLen = mBuf.Length; + } + else + { + if (messageLength != b.Length) + { + return false; + } + + checkLen = b.Length; + } + + bool isOkay = true; + + for (int i = 0; i != checkLen; i++) + { + if (a[i] != b[i]) + { + isOkay = false; + } + } + + return isOkay; + } + + /// clear possible sensitive data + private void ClearBlock( + byte[] block) + { + Array.Clear(block, 0, block.Length); + } + + public virtual void UpdateWithRecoveredMessage( + byte[] signature) + { + byte[] block = cipher.ProcessBlock(signature, 0, signature.Length); + + if (((block[0] & 0xC0) ^ 0x40) != 0) + throw new InvalidCipherTextException("malformed signature"); + + if (((block[block.Length - 1] & 0xF) ^ 0xC) != 0) + throw new InvalidCipherTextException("malformed signature"); + + int delta = 0; + + if (((block[block.Length - 1] & 0xFF) ^ 0xBC) == 0) + { + delta = 1; + } + else + { + int sigTrail = ((block[block.Length - 2] & 0xFF) << 8) | (block[block.Length - 1] & 0xFF); + + if (IsoTrailers.NoTrailerAvailable(digest)) + throw new ArgumentException("unrecognised hash in signature"); + + if (sigTrail != IsoTrailers.GetTrailer(digest)) + throw new InvalidOperationException("signer initialised with wrong digest for trailer " + sigTrail); + + delta = 2; + } + + // + // find out how much padding we've got + // + int mStart = 0; + + for (mStart = 0; mStart != block.Length; mStart++) + { + if (((block[mStart] & 0x0f) ^ 0x0a) == 0) + break; + } + + mStart++; + + int off = block.Length - delta - digest.GetDigestSize(); + + // + // there must be at least one byte of message string + // + if ((off - mStart) <= 0) + throw new InvalidCipherTextException("malformed block"); + + // + // if we contain the whole message as well, check the hash of that. + // + if ((block[0] & 0x20) == 0) + { + fullMessage = true; + + recoveredMessage = new byte[off - mStart]; + Array.Copy(block, mStart, recoveredMessage, 0, recoveredMessage.Length); + } + else + { + fullMessage = false; + + recoveredMessage = new byte[off - mStart]; + Array.Copy(block, mStart, recoveredMessage, 0, recoveredMessage.Length); + } + + preSig = signature; + preBlock = block; + + digest.BlockUpdate(recoveredMessage, 0, recoveredMessage.Length); + messageLength = recoveredMessage.Length; + recoveredMessage.CopyTo(mBuf, 0); + } + + /// update the internal digest with the byte b + public virtual void Update( + byte input) + { + digest.Update(input); + + if (messageLength < mBuf.Length) + { + mBuf[messageLength] = input; + } + + messageLength++; + } + + /// update the internal digest with the byte array in + public virtual void BlockUpdate( + byte[] input, + int inOff, + int length) + { + while (length > 0 && messageLength < mBuf.Length) + { + //for (int i = 0; i < length && (i + messageLength) < mBuf.Length; i++) + //{ + // mBuf[messageLength + i] = input[inOff + i]; + //} + this.Update(input[inOff]); + inOff++; + length--; + } + + digest.BlockUpdate(input, inOff, length); + messageLength += length; + } + + /// reset the internal state + public virtual void Reset() + { + digest.Reset(); + messageLength = 0; + ClearBlock(mBuf); + + if (recoveredMessage != null) + { + ClearBlock(recoveredMessage); + } + + recoveredMessage = null; + fullMessage = false; + + if (preSig != null) + { + preSig = null; + ClearBlock(preBlock); + preBlock = null; + } + } + + /// Generate a signature for the loaded message using the key we were + /// initialised with. + /// + public virtual byte[] GenerateSignature() + { + int digSize = digest.GetDigestSize(); + + int t = 0; + int delta = 0; + + if (trailer == IsoTrailers.TRAILER_IMPLICIT) + { + t = 8; + delta = block.Length - digSize - 1; + digest.DoFinal(block, delta); + block[block.Length - 1] = (byte)IsoTrailers.TRAILER_IMPLICIT; + } + else + { + t = 16; + delta = block.Length - digSize - 2; + digest.DoFinal(block, delta); + block[block.Length - 2] = (byte) ((uint)trailer >> 8); + block[block.Length - 1] = (byte) trailer; + } + + byte header = 0; + int x = (digSize + messageLength) * 8 + t + 4 - keyBits; + + if (x > 0) + { + int mR = messageLength - ((x + 7) / 8); + header = (byte) (0x60); + + delta -= mR; + + Array.Copy(mBuf, 0, block, delta, mR); + } + else + { + header = (byte) (0x40); + delta -= messageLength; + + Array.Copy(mBuf, 0, block, delta, messageLength); + } + + if ((delta - 1) > 0) + { + for (int i = delta - 1; i != 0; i--) + { + block[i] = (byte) 0xbb; + } + block[delta - 1] ^= (byte) 0x01; + block[0] = (byte) 0x0b; + block[0] |= header; + } + else + { + block[0] = (byte) 0x0a; + block[0] |= header; + } + + byte[] b = cipher.ProcessBlock(block, 0, block.Length); + + messageLength = 0; + + ClearBlock(mBuf); + ClearBlock(block); + + return b; + } + + /// return true if the signature represents a ISO9796-2 signature + /// for the passed in message. + /// + public virtual bool VerifySignature(byte[] signature) + { + byte[] block; + + if (preSig == null) + { + try + { + block = cipher.ProcessBlock(signature, 0, signature.Length); + } + catch (Exception) + { + return false; + } + } + else + { + if (!Arrays.AreEqual(preSig, signature)) + throw new InvalidOperationException("updateWithRecoveredMessage called on different signature"); + + block = preBlock; + + preSig = null; + preBlock = null; + } + + if (((block[0] & 0xC0) ^ 0x40) != 0) + return ReturnFalse(block); + + if (((block[block.Length - 1] & 0xF) ^ 0xC) != 0) + return ReturnFalse(block); + + int delta = 0; + + if (((block[block.Length - 1] & 0xFF) ^ 0xBC) == 0) + { + delta = 1; + } + else + { + int sigTrail = ((block[block.Length - 2] & 0xFF) << 8) | (block[block.Length - 1] & 0xFF); + + if (IsoTrailers.NoTrailerAvailable(digest)) + throw new ArgumentException("unrecognised hash in signature"); + + if (sigTrail != IsoTrailers.GetTrailer(digest)) + throw new InvalidOperationException("signer initialised with wrong digest for trailer " + sigTrail); + + delta = 2; + } + + // + // find out how much padding we've got + // + int mStart = 0; + for (; mStart != block.Length; mStart++) + { + if (((block[mStart] & 0x0f) ^ 0x0a) == 0) + { + break; + } + } + + mStart++; + + // + // check the hashes + // + byte[] hash = new byte[digest.GetDigestSize()]; + + int off = block.Length - delta - hash.Length; + + // + // there must be at least one byte of message string + // + if ((off - mStart) <= 0) + { + return ReturnFalse(block); + } + + // + // if we contain the whole message as well, check the hash of that. + // + if ((block[0] & 0x20) == 0) + { + fullMessage = true; + + // check right number of bytes passed in. + if (messageLength > off - mStart) + { + return ReturnFalse(block); + } + + digest.Reset(); + digest.BlockUpdate(block, mStart, off - mStart); + digest.DoFinal(hash, 0); + + bool isOkay = true; + + for (int i = 0; i != hash.Length; i++) + { + block[off + i] ^= hash[i]; + if (block[off + i] != 0) + { + isOkay = false; + } + } + + if (!isOkay) + { + return ReturnFalse(block); + } + + recoveredMessage = new byte[off - mStart]; + Array.Copy(block, mStart, recoveredMessage, 0, recoveredMessage.Length); + } + else + { + fullMessage = false; + + digest.DoFinal(hash, 0); + + bool isOkay = true; + + for (int i = 0; i != hash.Length; i++) + { + block[off + i] ^= hash[i]; + if (block[off + i] != 0) + { + isOkay = false; + } + } + + if (!isOkay) + { + return ReturnFalse(block); + } + + recoveredMessage = new byte[off - mStart]; + Array.Copy(block, mStart, recoveredMessage, 0, recoveredMessage.Length); + } + + // + // if they've input a message check what we've recovered against + // what was input. + // + if (messageLength != 0) + { + if (!IsSameAs(mBuf, recoveredMessage)) + { + return ReturnFalse(block); + } + } + + ClearBlock(mBuf); + ClearBlock(block); + + messageLength = 0; + + return true; + } + + private bool ReturnFalse(byte[] block) + { + messageLength = 0; + + ClearBlock(mBuf); + ClearBlock(block); + + return false; + } + + /// + /// Return true if the full message was recoveredMessage. + /// + /// true on full message recovery, false otherwise. + /// + public virtual bool HasFullMessage() + { + return fullMessage; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2Signer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2Signer.cs.meta new file mode 100644 index 00000000..bebac84e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/Iso9796d2Signer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 87ac94cff478bb34ba55e541d2971b29 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IsoTrailers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IsoTrailers.cs new file mode 100644 index 00000000..b388c2a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IsoTrailers.cs @@ -0,0 +1,61 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class IsoTrailers + { + public const int TRAILER_IMPLICIT = 0xBC; + public const int TRAILER_RIPEMD160 = 0x31CC; + public const int TRAILER_RIPEMD128 = 0x32CC; + public const int TRAILER_SHA1 = 0x33CC; + public const int TRAILER_SHA256 = 0x34CC; + public const int TRAILER_SHA512 = 0x35CC; + public const int TRAILER_SHA384 = 0x36CC; + public const int TRAILER_WHIRLPOOL = 0x37CC; + public const int TRAILER_SHA224 = 0x38CC; + public const int TRAILER_SHA512_224 = 0x39CC; + public const int TRAILER_SHA512_256 = 0x40CC; + + private static IDictionary CreateTrailerMap() + { + IDictionary trailers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + trailers.Add("RIPEMD128", TRAILER_RIPEMD128); + trailers.Add("RIPEMD160", TRAILER_RIPEMD160); + + trailers.Add("SHA-1", TRAILER_SHA1); + trailers.Add("SHA-224", TRAILER_SHA224); + trailers.Add("SHA-256", TRAILER_SHA256); + trailers.Add("SHA-384", TRAILER_SHA384); + trailers.Add("SHA-512", TRAILER_SHA512); + trailers.Add("SHA-512/224", TRAILER_SHA512_224); + trailers.Add("SHA-512/256", TRAILER_SHA512_256); + + trailers.Add("Whirlpool", TRAILER_WHIRLPOOL); + + return CollectionUtilities.ReadOnly(trailers); + } + + // IDictionary is (string -> Int32) + private static readonly IDictionary trailerMap = CreateTrailerMap(); + + public static int GetTrailer(IDigest digest) + { + return (int)trailerMap[digest.AlgorithmName]; + } + + public static bool NoTrailerAvailable(IDigest digest) + { + return !trailerMap.Contains(digest.AlgorithmName); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IsoTrailers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IsoTrailers.cs.meta new file mode 100644 index 00000000..89eb253f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/IsoTrailers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a5fd009acb42ef44a8b900072b16221b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PlainDsaEncoding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PlainDsaEncoding.cs new file mode 100644 index 00000000..7264d050 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PlainDsaEncoding.cs @@ -0,0 +1,62 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class PlainDsaEncoding + : IDsaEncoding + { + public static readonly PlainDsaEncoding Instance = new PlainDsaEncoding(); + + public virtual BigInteger[] Decode(BigInteger n, byte[] encoding) + { + int valueLength = BigIntegers.GetUnsignedByteLength(n); + if (encoding.Length != valueLength * 2) + throw new ArgumentException("Encoding has incorrect length", "encoding"); + + return new BigInteger[] { + DecodeValue(n, encoding, 0, valueLength), + DecodeValue(n, encoding, valueLength, valueLength), + }; + } + + public virtual byte[] Encode(BigInteger n, BigInteger r, BigInteger s) + { + int valueLength = BigIntegers.GetUnsignedByteLength(n); + byte[] result = new byte[valueLength * 2]; + EncodeValue(n, r, result, 0, valueLength); + EncodeValue(n, s, result, valueLength, valueLength); + return result; + } + + protected virtual BigInteger CheckValue(BigInteger n, BigInteger x) + { + if (x.SignValue < 0 || x.CompareTo(n) >= 0) + throw new ArgumentException("Value out of range", "x"); + + return x; + } + + protected virtual BigInteger DecodeValue(BigInteger n, byte[] buf, int off, int len) + { + return CheckValue(n, new BigInteger(1, buf, off, len)); + } + + protected virtual void EncodeValue(BigInteger n, BigInteger x, byte[] buf, int off, int len) + { + byte[] bs = CheckValue(n, x).ToByteArrayUnsigned(); + int bsOff = System.Math.Max(0, bs.Length - len); + int bsLen = bs.Length - bsOff; + + int pos = len - bsLen; + Arrays.Fill(buf, off, off + pos, 0); + Array.Copy(bs, bsOff, buf, off + pos, bsLen); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PlainDsaEncoding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PlainDsaEncoding.cs.meta new file mode 100644 index 00000000..604749fc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PlainDsaEncoding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aec988137075c7942a73a6b10ffef83f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PssSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PssSigner.cs new file mode 100644 index 00000000..aa3296ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PssSigner.cs @@ -0,0 +1,390 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /// RSA-PSS as described in Pkcs# 1 v 2.1. + ///

+ /// Note: the usual value for the salt length is the number of + /// bytes in the hash function.

+ ///
+ public class PssSigner + : ISigner + { + public const byte TrailerImplicit = (byte)0xBC; + + private readonly IDigest contentDigest1, contentDigest2; + private readonly IDigest mgfDigest; + private readonly IAsymmetricBlockCipher cipher; + + private SecureRandom random; + + private int hLen; + private int mgfhLen; + private int sLen; + private bool sSet; + private int emBits; + private byte[] salt; + private byte[] mDash; + private byte[] block; + private byte trailer; + + public static PssSigner CreateRawSigner( + IAsymmetricBlockCipher cipher, + IDigest digest) + { + return new PssSigner(cipher, new NullDigest(), digest, digest, digest.GetDigestSize(), null, TrailerImplicit); + } + + public static PssSigner CreateRawSigner( + IAsymmetricBlockCipher cipher, + IDigest contentDigest, + IDigest mgfDigest, + int saltLen, + byte trailer) + { + return new PssSigner(cipher, new NullDigest(), contentDigest, mgfDigest, saltLen, null, trailer); + } + + public PssSigner( + IAsymmetricBlockCipher cipher, + IDigest digest) + : this(cipher, digest, digest.GetDigestSize()) + { + } + + /// Basic constructor + /// the asymmetric cipher to use. + /// the digest to use. + /// the length of the salt to use (in bytes). + public PssSigner( + IAsymmetricBlockCipher cipher, + IDigest digest, + int saltLen) + : this(cipher, digest, saltLen, TrailerImplicit) + { + } + + /// Basic constructor + /// the asymmetric cipher to use. + /// the digest to use. + /// the fixed salt to be used. + public PssSigner( + IAsymmetricBlockCipher cipher, + IDigest digest, + byte[] salt) + : this(cipher, digest, digest, digest, salt.Length, salt, TrailerImplicit) + { + } + + public PssSigner( + IAsymmetricBlockCipher cipher, + IDigest contentDigest, + IDigest mgfDigest, + int saltLen) + : this(cipher, contentDigest, mgfDigest, saltLen, TrailerImplicit) + { + } + + public PssSigner( + IAsymmetricBlockCipher cipher, + IDigest contentDigest, + IDigest mgfDigest, + byte[] salt) + : this(cipher, contentDigest, contentDigest, mgfDigest, salt.Length, salt, TrailerImplicit) + { + } + + public PssSigner( + IAsymmetricBlockCipher cipher, + IDigest digest, + int saltLen, + byte trailer) + : this(cipher, digest, digest, saltLen, TrailerImplicit) + { + } + + public PssSigner( + IAsymmetricBlockCipher cipher, + IDigest contentDigest, + IDigest mgfDigest, + int saltLen, + byte trailer) + : this(cipher, contentDigest, contentDigest, mgfDigest, saltLen, null, trailer) + { + } + + private PssSigner( + IAsymmetricBlockCipher cipher, + IDigest contentDigest1, + IDigest contentDigest2, + IDigest mgfDigest, + int saltLen, + byte[] salt, + byte trailer) + { + this.cipher = cipher; + this.contentDigest1 = contentDigest1; + this.contentDigest2 = contentDigest2; + this.mgfDigest = mgfDigest; + this.hLen = contentDigest2.GetDigestSize(); + this.mgfhLen = mgfDigest.GetDigestSize(); + this.sLen = saltLen; + this.sSet = salt != null; + if (sSet) + { + this.salt = salt; + } + else + { + this.salt = new byte[saltLen]; + } + this.mDash = new byte[8 + saltLen + hLen]; + this.trailer = trailer; + } + + public virtual string AlgorithmName + { + get { return mgfDigest.AlgorithmName + "withRSAandMGF1"; } + } + + public virtual void Init( + bool forSigning, + ICipherParameters parameters) + { + if (parameters is ParametersWithRandom) + { + ParametersWithRandom p = (ParametersWithRandom) parameters; + + parameters = p.Parameters; + random = p.Random; + } + else + { + if (forSigning) + { + random = new SecureRandom(); + } + } + + cipher.Init(forSigning, parameters); + + RsaKeyParameters kParam; + if (parameters is RsaBlindingParameters) + { + kParam = ((RsaBlindingParameters) parameters).PublicKey; + } + else + { + kParam = (RsaKeyParameters) parameters; + } + + emBits = kParam.Modulus.BitLength - 1; + + if (emBits < (8 * hLen + 8 * sLen + 9)) + throw new ArgumentException("key too small for specified hash and salt lengths"); + + block = new byte[(emBits + 7) / 8]; + } + + /// clear possible sensitive data + private void ClearBlock( + byte[] block) + { + Array.Clear(block, 0, block.Length); + } + + /// update the internal digest with the byte b + public virtual void Update( + byte input) + { + contentDigest1.Update(input); + } + + /// update the internal digest with the byte array in + public virtual void BlockUpdate( + byte[] input, + int inOff, + int length) + { + contentDigest1.BlockUpdate(input, inOff, length); + } + + /// reset the internal state + public virtual void Reset() + { + contentDigest1.Reset(); + } + + /// Generate a signature for the message we've been loaded with using + /// the key we were initialised with. + /// + public virtual byte[] GenerateSignature() + { + contentDigest1.DoFinal(mDash, mDash.Length - hLen - sLen); + + if (sLen != 0) + { + if (!sSet) + { + random.NextBytes(salt); + } + salt.CopyTo(mDash, mDash.Length - sLen); + } + + byte[] h = new byte[hLen]; + + contentDigest2.BlockUpdate(mDash, 0, mDash.Length); + + contentDigest2.DoFinal(h, 0); + + block[block.Length - sLen - 1 - hLen - 1] = (byte) (0x01); + salt.CopyTo(block, block.Length - sLen - hLen - 1); + + byte[] dbMask = MaskGeneratorFunction1(h, 0, h.Length, block.Length - hLen - 1); + for (int i = 0; i != dbMask.Length; i++) + { + block[i] ^= dbMask[i]; + } + + block[0] &= (byte) ((0xff >> ((block.Length * 8) - emBits))); + + h.CopyTo(block, block.Length - hLen - 1); + + block[block.Length - 1] = trailer; + + byte[] b = cipher.ProcessBlock(block, 0, block.Length); + + ClearBlock(block); + + return b; + } + + /// return true if the internal state represents the signature described + /// in the passed in array. + /// + public virtual bool VerifySignature( + byte[] signature) + { + contentDigest1.DoFinal(mDash, mDash.Length - hLen - sLen); + + byte[] b = cipher.ProcessBlock(signature, 0, signature.Length); + b.CopyTo(block, block.Length - b.Length); + + if (block[block.Length - 1] != trailer) + { + ClearBlock(block); + return false; + } + + byte[] dbMask = MaskGeneratorFunction1(block, block.Length - hLen - 1, hLen, block.Length - hLen - 1); + + for (int i = 0; i != dbMask.Length; i++) + { + block[i] ^= dbMask[i]; + } + + block[0] &= (byte) ((0xff >> ((block.Length * 8) - emBits))); + + for (int i = 0; i != block.Length - hLen - sLen - 2; i++) + { + if (block[i] != 0) + { + ClearBlock(block); + return false; + } + } + + if (block[block.Length - hLen - sLen - 2] != 0x01) + { + ClearBlock(block); + return false; + } + + if (sSet) + { + Array.Copy(salt, 0, mDash, mDash.Length - sLen, sLen); + } + else + { + Array.Copy(block, block.Length - sLen - hLen - 1, mDash, mDash.Length - sLen, sLen); + } + + contentDigest2.BlockUpdate(mDash, 0, mDash.Length); + contentDigest2.DoFinal(mDash, mDash.Length - hLen); + + for (int i = block.Length - hLen - 1, j = mDash.Length - hLen; j != mDash.Length; i++, j++) + { + if ((block[i] ^ mDash[j]) != 0) + { + ClearBlock(mDash); + ClearBlock(block); + return false; + } + } + + ClearBlock(mDash); + ClearBlock(block); + + return true; + } + + /// int to octet string. + private void ItoOSP( + int i, + byte[] sp) + { + sp[0] = (byte)((uint) i >> 24); + sp[1] = (byte)((uint) i >> 16); + sp[2] = (byte)((uint) i >> 8); + sp[3] = (byte)((uint) i >> 0); + } + + /// mask generator function, as described in Pkcs1v2. + private byte[] MaskGeneratorFunction1( + byte[] Z, + int zOff, + int zLen, + int length) + { + byte[] mask = new byte[length]; + byte[] hashBuf = new byte[mgfhLen]; + byte[] C = new byte[4]; + int counter = 0; + + mgfDigest.Reset(); + + while (counter < (length / mgfhLen)) + { + ItoOSP(counter, C); + + mgfDigest.BlockUpdate(Z, zOff, zLen); + mgfDigest.BlockUpdate(C, 0, C.Length); + mgfDigest.DoFinal(hashBuf, 0); + + hashBuf.CopyTo(mask, counter * mgfhLen); + ++counter; + } + + if ((counter * mgfhLen) < length) + { + ItoOSP(counter, C); + + mgfDigest.BlockUpdate(Z, zOff, zLen); + mgfDigest.BlockUpdate(C, 0, C.Length); + mgfDigest.DoFinal(hashBuf, 0); + + Array.Copy(hashBuf, 0, mask, counter * mgfhLen, mask.Length - (counter * mgfhLen)); + } + + return mask; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PssSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PssSigner.cs.meta new file mode 100644 index 00000000..4ccfb407 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/PssSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 29735d3087c8c97469fcd65a9be64767 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RandomDsaKCalculator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RandomDsaKCalculator.cs new file mode 100644 index 00000000..2597b1b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RandomDsaKCalculator.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class RandomDsaKCalculator + : IDsaKCalculator + { + private BigInteger q; + private SecureRandom random; + + public virtual bool IsDeterministic + { + get { return false; } + } + + public virtual void Init(BigInteger n, SecureRandom random) + { + this.q = n; + this.random = random; + } + + public virtual void Init(BigInteger n, BigInteger d, byte[] message) + { + throw new InvalidOperationException("Operation not supported"); + } + + public virtual BigInteger NextK() + { + int qBitLength = q.BitLength; + + BigInteger k; + do + { + k = new BigInteger(qBitLength, random); + } + while (k.SignValue < 1 || k.CompareTo(q) >= 0); + + return k; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RandomDsaKCalculator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RandomDsaKCalculator.cs.meta new file mode 100644 index 00000000..3d80dd41 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RandomDsaKCalculator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1bb646c95a66c04787462b6a62bd3cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RsaDigestSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RsaDigestSigner.cs new file mode 100644 index 00000000..cb96abb9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RsaDigestSigner.cs @@ -0,0 +1,237 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class RsaDigestSigner + : ISigner + { + private readonly IAsymmetricBlockCipher rsaEngine; + private readonly AlgorithmIdentifier algId; + private readonly IDigest digest; + private bool forSigning; + + private static readonly IDictionary oidMap = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + /// + /// Load oid table. + /// + static RsaDigestSigner() + { + oidMap["RIPEMD128"] = TeleTrusTObjectIdentifiers.RipeMD128; + oidMap["RIPEMD160"] = TeleTrusTObjectIdentifiers.RipeMD160; + oidMap["RIPEMD256"] = TeleTrusTObjectIdentifiers.RipeMD256; + + oidMap["SHA-1"] = X509ObjectIdentifiers.IdSha1; + oidMap["SHA-224"] = NistObjectIdentifiers.IdSha224; + oidMap["SHA-256"] = NistObjectIdentifiers.IdSha256; + oidMap["SHA-384"] = NistObjectIdentifiers.IdSha384; + oidMap["SHA-512"] = NistObjectIdentifiers.IdSha512; + + oidMap["MD2"] = PkcsObjectIdentifiers.MD2; + oidMap["MD4"] = PkcsObjectIdentifiers.MD4; + oidMap["MD5"] = PkcsObjectIdentifiers.MD5; + } + + public RsaDigestSigner(IDigest digest) + : this(digest, (DerObjectIdentifier)oidMap[digest.AlgorithmName]) + { + } + + public RsaDigestSigner(IDigest digest, DerObjectIdentifier digestOid) + : this(digest, new AlgorithmIdentifier(digestOid, DerNull.Instance)) + { + } + + public RsaDigestSigner(IDigest digest, AlgorithmIdentifier algId) + : this(new RsaCoreEngine(), digest, algId) + { + } + + public RsaDigestSigner(IRsa rsa, IDigest digest, DerObjectIdentifier digestOid) + : this(rsa, digest, new AlgorithmIdentifier(digestOid, DerNull.Instance)) + { + } + + public RsaDigestSigner(IRsa rsa, IDigest digest, AlgorithmIdentifier algId) + : this(new RsaBlindedEngine(rsa), digest, algId) + { + } + + public RsaDigestSigner(IAsymmetricBlockCipher rsaEngine, IDigest digest, AlgorithmIdentifier algId) + { + this.rsaEngine = new Pkcs1Encoding(rsaEngine); + this.digest = digest; + this.algId = algId; + } + + public virtual string AlgorithmName + { + get { return digest.AlgorithmName + "withRSA"; } + } + + /** + * Initialise the signer for signing or verification. + * + * @param forSigning true if for signing, false otherwise + * @param param necessary parameters. + */ + public virtual void Init( + bool forSigning, + ICipherParameters parameters) + { + this.forSigning = forSigning; + AsymmetricKeyParameter k; + + if (parameters is ParametersWithRandom) + { + k = (AsymmetricKeyParameter)((ParametersWithRandom)parameters).Parameters; + } + else + { + k = (AsymmetricKeyParameter)parameters; + } + + if (forSigning && !k.IsPrivate) + throw new InvalidKeyException("Signing requires private key."); + + if (!forSigning && k.IsPrivate) + throw new InvalidKeyException("Verification requires public key."); + + Reset(); + + rsaEngine.Init(forSigning, parameters); + } + + /** + * update the internal digest with the byte b + */ + public virtual void Update( + byte input) + { + digest.Update(input); + } + + /** + * update the internal digest with the byte array in + */ + public virtual void BlockUpdate( + byte[] input, + int inOff, + int length) + { + digest.BlockUpdate(input, inOff, length); + } + + /** + * Generate a signature for the message we've been loaded with using + * the key we were initialised with. + */ + public virtual byte[] GenerateSignature() + { + if (!forSigning) + throw new InvalidOperationException("RsaDigestSigner not initialised for signature generation."); + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + byte[] data = DerEncode(hash); + return rsaEngine.ProcessBlock(data, 0, data.Length); + } + + /** + * return true if the internal state represents the signature described + * in the passed in array. + */ + public virtual bool VerifySignature( + byte[] signature) + { + if (forSigning) + throw new InvalidOperationException("RsaDigestSigner not initialised for verification"); + + byte[] hash = new byte[digest.GetDigestSize()]; + digest.DoFinal(hash, 0); + + byte[] sig; + byte[] expected; + + try + { + sig = rsaEngine.ProcessBlock(signature, 0, signature.Length); + expected = DerEncode(hash); + } + catch (Exception) + { + return false; + } + + if (sig.Length == expected.Length) + { + return Arrays.ConstantTimeAreEqual(sig, expected); + } + else if (sig.Length == expected.Length - 2) // NULL left out + { + int sigOffset = sig.Length - hash.Length - 2; + int expectedOffset = expected.Length - hash.Length - 2; + + expected[1] -= 2; // adjust lengths + expected[3] -= 2; + + int nonEqual = 0; + + for (int i = 0; i < hash.Length; i++) + { + nonEqual |= (sig[sigOffset + i] ^ expected[expectedOffset + i]); + } + + for (int i = 0; i < sigOffset; i++) + { + nonEqual |= (sig[i] ^ expected[i]); // check header less NULL + } + + return nonEqual == 0; + } + else + { + return false; + } + } + + public virtual void Reset() + { + digest.Reset(); + } + + private byte[] DerEncode(byte[] hash) + { + if (algId == null) + { + // For raw RSA, the DigestInfo must be prepared externally + return hash; + } + + DigestInfo dInfo = new DigestInfo(algId, hash); + + return dInfo.GetDerEncoded(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RsaDigestSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RsaDigestSigner.cs.meta new file mode 100644 index 00000000..21e2861b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/RsaDigestSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a1d2191580cc304e9dd7fb6a78629ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/SM2Signer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/SM2Signer.cs new file mode 100644 index 00000000..07b2ec0e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/SM2Signer.cs @@ -0,0 +1,246 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /// The SM2 Digital Signature algorithm. + public class SM2Signer + : ISigner + { + private readonly IDsaKCalculator kCalculator = new RandomDsaKCalculator(); + private readonly SM3Digest digest = new SM3Digest(); + private readonly IDsaEncoding encoding; + + private ECDomainParameters ecParams; + private ECPoint pubPoint; + private ECKeyParameters ecKey; + private byte[] z; + + public SM2Signer() + { + this.encoding = StandardDsaEncoding.Instance; + } + + public SM2Signer(IDsaEncoding encoding) + { + this.encoding = encoding; + } + + public virtual string AlgorithmName + { + get { return "SM2Sign"; } + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + ICipherParameters baseParam; + byte[] userID; + + if (parameters is ParametersWithID) + { + baseParam = ((ParametersWithID)parameters).Parameters; + userID = ((ParametersWithID)parameters).GetID(); + } + else + { + baseParam = parameters; + userID = Hex.Decode("31323334353637383132333435363738"); // the default value (ASCII "1234567812345678") + } + + if (forSigning) + { + if (baseParam is ParametersWithRandom) + { + ParametersWithRandom rParam = (ParametersWithRandom)baseParam; + + ecKey = (ECKeyParameters)rParam.Parameters; + ecParams = ecKey.Parameters; + kCalculator.Init(ecParams.N, rParam.Random); + } + else + { + ecKey = (ECKeyParameters)baseParam; + ecParams = ecKey.Parameters; + kCalculator.Init(ecParams.N, new SecureRandom()); + } + pubPoint = CreateBasePointMultiplier().Multiply(ecParams.G, ((ECPrivateKeyParameters)ecKey).D).Normalize(); + } + else + { + ecKey = (ECKeyParameters)baseParam; + ecParams = ecKey.Parameters; + pubPoint = ((ECPublicKeyParameters)ecKey).Q; + } + + digest.Reset(); + z = GetZ(userID); + + digest.BlockUpdate(z, 0, z.Length); + } + + public virtual void Update(byte b) + { + digest.Update(b); + } + + public virtual void BlockUpdate(byte[] buf, int off, int len) + { + digest.BlockUpdate(buf, off, len); + } + + public virtual bool VerifySignature(byte[] signature) + { + try + { + BigInteger[] rs = encoding.Decode(ecParams.N, signature); + + return VerifySignature(rs[0], rs[1]); + } + catch (Exception) + { + } + + return false; + } + + public virtual void Reset() + { + if (z != null) + { + digest.Reset(); + digest.BlockUpdate(z, 0, z.Length); + } + } + + public virtual byte[] GenerateSignature() + { + byte[] eHash = DigestUtilities.DoFinal(digest); + + BigInteger n = ecParams.N; + BigInteger e = CalculateE(eHash); + BigInteger d = ((ECPrivateKeyParameters)ecKey).D; + + BigInteger r, s; + + ECMultiplier basePointMultiplier = CreateBasePointMultiplier(); + + // 5.2.1 Draft RFC: SM2 Public Key Algorithms + do // generate s + { + BigInteger k; + do // generate r + { + // A3 + k = kCalculator.NextK(); + + // A4 + ECPoint p = basePointMultiplier.Multiply(ecParams.G, k).Normalize(); + + // A5 + r = e.Add(p.AffineXCoord.ToBigInteger()).Mod(n); + } + while (r.SignValue == 0 || r.Add(k).Equals(n)); + + // A6 + BigInteger dPlus1ModN = d.Add(BigInteger.One).ModInverse(n); + + s = k.Subtract(r.Multiply(d)).Mod(n); + s = dPlus1ModN.Multiply(s).Mod(n); + } + while (s.SignValue == 0); + + // A7 + try + { + return encoding.Encode(ecParams.N, r, s); + } + catch (Exception ex) + { + throw new CryptoException("unable to encode signature: " + ex.Message, ex); + } + } + + private bool VerifySignature(BigInteger r, BigInteger s) + { + BigInteger n = ecParams.N; + + // 5.3.1 Draft RFC: SM2 Public Key Algorithms + // B1 + if (r.CompareTo(BigInteger.One) < 0 || r.CompareTo(n) >= 0) + return false; + + // B2 + if (s.CompareTo(BigInteger.One) < 0 || s.CompareTo(n) >= 0) + return false; + + // B3 + byte[] eHash = DigestUtilities.DoFinal(digest); + + // B4 + BigInteger e = CalculateE(eHash); + + // B5 + BigInteger t = r.Add(s).Mod(n); + if (t.SignValue == 0) + return false; + + // B6 + ECPoint q = ((ECPublicKeyParameters)ecKey).Q; + ECPoint x1y1 = ECAlgorithms.SumOfTwoMultiplies(ecParams.G, s, q, t).Normalize(); + if (x1y1.IsInfinity) + return false; + + // B7 + return r.Equals(e.Add(x1y1.AffineXCoord.ToBigInteger()).Mod(n)); + } + + private byte[] GetZ(byte[] userID) + { + AddUserID(digest, userID); + + AddFieldElement(digest, ecParams.Curve.A); + AddFieldElement(digest, ecParams.Curve.B); + AddFieldElement(digest, ecParams.G.AffineXCoord); + AddFieldElement(digest, ecParams.G.AffineYCoord); + AddFieldElement(digest, pubPoint.AffineXCoord); + AddFieldElement(digest, pubPoint.AffineYCoord); + + return DigestUtilities.DoFinal(digest); + } + + private void AddUserID(IDigest digest, byte[] userID) + { + int len = userID.Length * 8; + digest.Update((byte)(len >> 8)); + digest.Update((byte)len); + digest.BlockUpdate(userID, 0, userID.Length); + } + + private void AddFieldElement(IDigest digest, ECFieldElement v) + { + byte[] p = v.GetEncoded(); + digest.BlockUpdate(p, 0, p.Length); + } + + protected virtual BigInteger CalculateE(byte[] message) + { + return new BigInteger(1, message); + } + + protected virtual ECMultiplier CreateBasePointMultiplier() + { + return new FixedPointCombMultiplier(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/SM2Signer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/SM2Signer.cs.meta new file mode 100644 index 00000000..9faddedd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/SM2Signer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68f56593743e64f4faf9b45065c5894a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/StandardDsaEncoding.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/StandardDsaEncoding.cs new file mode 100644 index 00000000..ba76d033 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/StandardDsaEncoding.cs @@ -0,0 +1,60 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + public class StandardDsaEncoding + : IDsaEncoding + { + public static readonly StandardDsaEncoding Instance = new StandardDsaEncoding(); + + public virtual BigInteger[] Decode(BigInteger n, byte[] encoding) + { + Asn1Sequence seq = (Asn1Sequence)Asn1Object.FromByteArray(encoding); + if (seq.Count == 2) + { + BigInteger r = DecodeValue(n, seq, 0); + BigInteger s = DecodeValue(n, seq, 1); + + byte[] expectedEncoding = Encode(n, r, s); + if (Arrays.AreEqual(expectedEncoding, encoding)) + return new BigInteger[]{ r, s }; + } + + throw new ArgumentException("Malformed signature", "encoding"); + } + + public virtual byte[] Encode(BigInteger n, BigInteger r, BigInteger s) + { + return new DerSequence( + EncodeValue(n, r), + EncodeValue(n, s) + ).GetEncoded(Asn1Encodable.Der); + } + + protected virtual BigInteger CheckValue(BigInteger n, BigInteger x) + { + if (x.SignValue < 0 || (null != n && x.CompareTo(n) >= 0)) + throw new ArgumentException("Value out of range", "x"); + + return x; + } + + protected virtual BigInteger DecodeValue(BigInteger n, Asn1Sequence s, int pos) + { + return CheckValue(n, ((DerInteger)s[pos]).Value); + } + + protected virtual DerInteger EncodeValue(BigInteger n, BigInteger x) + { + return new DerInteger(CheckValue(n, x)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/StandardDsaEncoding.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/StandardDsaEncoding.cs.meta new file mode 100644 index 00000000..38fa2759 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/StandardDsaEncoding.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a964647027be2f14db0b63d2fb74479a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/X931Signer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/X931Signer.cs new file mode 100644 index 00000000..86ea3e37 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/X931Signer.cs @@ -0,0 +1,230 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers +{ + /** + * X9.31-1998 - signing using a hash. + *

+ * The message digest hash, H, is encapsulated to form a byte string as follows + *

+ *
+     * EB = 06 || PS || 0xBA || H || TRAILER
+     * 
+ * where PS is a string of bytes all of value 0xBB of length such that |EB|=|n|, and TRAILER is the ISO/IEC 10118 part number† for the digest. The byte string, EB, is converted to an integer value, the message representative, f. + */ + public class X931Signer + : ISigner + { + [Obsolete("Use 'IsoTrailers' instead")] + public const int TRAILER_IMPLICIT = 0xBC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TRAILER_RIPEMD160 = 0x31CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TRAILER_RIPEMD128 = 0x32CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TRAILER_SHA1 = 0x33CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TRAILER_SHA256 = 0x34CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TRAILER_SHA512 = 0x35CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TRAILER_SHA384 = 0x36CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TRAILER_WHIRLPOOL = 0x37CC; + [Obsolete("Use 'IsoTrailers' instead")] + public const int TRAILER_SHA224 = 0x38CC; + + private IDigest digest; + private IAsymmetricBlockCipher cipher; + private RsaKeyParameters kParam; + + private int trailer; + private int keyBits; + private byte[] block; + + /** + * Generate a signer with either implicit or explicit trailers for X9.31. + * + * @param cipher base cipher to use for signature creation/verification + * @param digest digest to use. + * @param implicit whether or not the trailer is implicit or gives the hash. + */ + public X931Signer(IAsymmetricBlockCipher cipher, IDigest digest, bool isImplicit) + { + this.cipher = cipher; + this.digest = digest; + + if (isImplicit) + { + trailer = IsoTrailers.TRAILER_IMPLICIT; + } + else if (IsoTrailers.NoTrailerAvailable(digest)) + { + throw new ArgumentException("no valid trailer", "digest"); + } + else + { + trailer = IsoTrailers.GetTrailer(digest); + } + } + + public virtual string AlgorithmName + { + get { return digest.AlgorithmName + "with" + cipher.AlgorithmName + "/X9.31"; } + } + + /** + * Constructor for a signer with an explicit digest trailer. + * + * @param cipher cipher to use. + * @param digest digest to sign with. + */ + public X931Signer(IAsymmetricBlockCipher cipher, IDigest digest) + : this(cipher, digest, false) + { + } + + public virtual void Init(bool forSigning, ICipherParameters parameters) + { + kParam = (RsaKeyParameters)parameters; + + cipher.Init(forSigning, kParam); + + keyBits = kParam.Modulus.BitLength; + + block = new byte[(keyBits + 7) / 8]; + + Reset(); + } + + /// clear possible sensitive data + private void ClearBlock(byte[] block) + { + Array.Clear(block, 0, block.Length); + } + + /** + * update the internal digest with the byte b + */ + public virtual void Update(byte b) + { + digest.Update(b); + } + + /** + * update the internal digest with the byte array in + */ + public virtual void BlockUpdate(byte[] input, int off, int len) + { + digest.BlockUpdate(input, off, len); + } + + /** + * reset the internal state + */ + public virtual void Reset() + { + digest.Reset(); + } + + /** + * generate a signature for the loaded message using the key we were + * initialised with. + */ + public virtual byte[] GenerateSignature() + { + CreateSignatureBlock(); + + BigInteger t = new BigInteger(1, cipher.ProcessBlock(block, 0, block.Length)); + ClearBlock(block); + + t = t.Min(kParam.Modulus.Subtract(t)); + + int size = BigIntegers.GetUnsignedByteLength(kParam.Modulus); + return BigIntegers.AsUnsignedByteArray(size, t); + } + + private void CreateSignatureBlock() + { + int digSize = digest.GetDigestSize(); + + int delta; + if (trailer == IsoTrailers.TRAILER_IMPLICIT) + { + delta = block.Length - digSize - 1; + digest.DoFinal(block, delta); + block[block.Length - 1] = (byte)IsoTrailers.TRAILER_IMPLICIT; + } + else + { + delta = block.Length - digSize - 2; + digest.DoFinal(block, delta); + block[block.Length - 2] = (byte)(trailer >> 8); + block[block.Length - 1] = (byte)trailer; + } + + block[0] = 0x6b; + for (int i = delta - 2; i != 0; i--) + { + block[i] = (byte)0xbb; + } + block[delta - 1] = (byte)0xba; + } + + /** + * return true if the signature represents a ISO9796-2 signature + * for the passed in message. + */ + public virtual bool VerifySignature(byte[] signature) + { + try + { + block = cipher.ProcessBlock(signature, 0, signature.Length); + } + catch (Exception) + { + return false; + } + + BigInteger t = new BigInteger(1, block); + BigInteger f; + + if ((t.IntValue & 15) == 12) + { + f = t; + } + else + { + t = kParam.Modulus.Subtract(t); + if ((t.IntValue & 15) == 12) + { + f = t; + } + else + { + return false; + } + } + + CreateSignatureBlock(); + + byte[] fBlock = BigIntegers.AsUnsignedByteArray(block.Length, f); + + bool rv = Arrays.ConstantTimeAreEqual(block, fBlock); + + ClearBlock(block); + ClearBlock(fBlock); + + return rv; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/X931Signer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/X931Signer.cs.meta new file mode 100644 index 00000000..9b00b1f5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/signers/X931Signer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4d003e3a33c78049a002e2b2f4da98d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls.meta new file mode 100644 index 00000000..05810b86 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 377c62a7a08191a46babb9e0f98c238c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsAgreementCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsAgreementCredentials.cs new file mode 100644 index 00000000..147aadff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsAgreementCredentials.cs @@ -0,0 +1,16 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class AbstractTlsAgreementCredentials + : AbstractTlsCredentials, TlsAgreementCredentials + { + /// + public abstract byte[] GenerateAgreement(AsymmetricKeyParameter peerPublicKey); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsAgreementCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsAgreementCredentials.cs.meta new file mode 100644 index 00000000..b0e62f87 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsAgreementCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 883690e221f19a6418e8bc624f2e9a08 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCipherFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCipherFactory.cs new file mode 100644 index 00000000..67dc9876 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCipherFactory.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class AbstractTlsCipherFactory + : TlsCipherFactory + { + /// + public virtual TlsCipher CreateCipher(TlsContext context, int encryptionAlgorithm, int macAlgorithm) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCipherFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCipherFactory.cs.meta new file mode 100644 index 00000000..ebd4b5de --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCipherFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f22405f313bf66a449f14a07c843bc2f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsClient.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsClient.cs new file mode 100644 index 00000000..cadc0466 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsClient.cs @@ -0,0 +1,282 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class AbstractTlsClient + : AbstractTlsPeer, TlsClient + { + protected TlsCipherFactory mCipherFactory; + + protected TlsClientContext mContext; + + protected IList mSupportedSignatureAlgorithms; + protected int[] mNamedCurves; + protected byte[] mClientECPointFormats, mServerECPointFormats; + + protected int mSelectedCipherSuite; + protected short mSelectedCompressionMethod; + + public System.Collections.Generic.List HostNames { get; set; } + + public AbstractTlsClient() + : this(new DefaultTlsCipherFactory()) + { + } + + public AbstractTlsClient(TlsCipherFactory cipherFactory) + { + this.mCipherFactory = cipherFactory; + } + + protected virtual bool AllowUnexpectedServerExtension(int extensionType, byte[] extensionData) + { + switch (extensionType) + { + case ExtensionType.elliptic_curves: + /* + * Exception added based on field reports that some servers do send this, although the + * Supported Elliptic Curves Extension is clearly intended to be client-only. If + * present, we still require that it is a valid EllipticCurveList. + */ + TlsEccUtilities.ReadSupportedEllipticCurvesExtension(extensionData); + return true; + + case ExtensionType.ec_point_formats: + /* + * Exception added based on field reports that some servers send this even when they + * didn't negotiate an ECC cipher suite. If present, we still require that it is a valid + * ECPointFormatList. + */ + TlsEccUtilities.ReadSupportedPointFormatsExtension(extensionData); + return true; + + default: + return false; + } + } + + protected virtual void CheckForUnexpectedServerExtension(IDictionary serverExtensions, int extensionType) + { + byte[] extensionData = TlsUtilities.GetExtensionData(serverExtensions, extensionType); + if (extensionData != null && !AllowUnexpectedServerExtension(extensionType, extensionData)) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + + public virtual void Init(TlsClientContext context) + { + this.mContext = context; + } + + public virtual TlsSession GetSessionToResume() + { + return null; + } + + public virtual ProtocolVersion ClientHelloRecordLayerVersion + { + get + { + // "{03,00}" + //return ProtocolVersion.SSLv3; + + // "the lowest version number supported by the client" + //return MinimumVersion; + + // "the value of ClientHello.client_version" + return ClientVersion; + } + } + + public virtual ProtocolVersion ClientVersion + { + get { return ProtocolVersion.TLSv12; } + } + + public virtual bool IsFallback + { + /* + * RFC 7507 4. The TLS_FALLBACK_SCSV cipher suite value is meant for use by clients that + * repeat a connection attempt with a downgraded protocol (perform a "fallback retry") in + * order to work around interoperability problems with legacy servers. + */ + get { return false; } + } + + public virtual IDictionary GetClientExtensions() + { + IDictionary clientExtensions = null; + + ProtocolVersion clientVersion = mContext.ClientVersion; + + /* + * RFC 5246 7.4.1.4.1. Note: this extension is not meaningful for TLS versions prior to 1.2. + * Clients MUST NOT offer it if they are offering prior versions. + */ + if (TlsUtilities.IsSignatureAlgorithmsExtensionAllowed(clientVersion)) + { + // TODO Provide a way for the user to specify the acceptable hash/signature algorithms. + + this.mSupportedSignatureAlgorithms = TlsUtilities.GetDefaultSupportedSignatureAlgorithms(); + + clientExtensions = TlsExtensionsUtilities.EnsureExtensionsInitialised(clientExtensions); + + TlsUtilities.AddSignatureAlgorithmsExtension(clientExtensions, mSupportedSignatureAlgorithms); + } + + if (TlsEccUtilities.ContainsEccCipherSuites(GetCipherSuites())) + { + /* + * RFC 4492 5.1. A client that proposes ECC cipher suites in its ClientHello message + * appends these extensions (along with any others), enumerating the curves it supports + * and the point formats it can parse. Clients SHOULD send both the Supported Elliptic + * Curves Extension and the Supported Point Formats Extension. + */ + /* + * TODO Could just add all the curves since we support them all, but users may not want + * to use unnecessarily large fields. Need configuration options. + */ + this.mNamedCurves = new int[]{ NamedCurve.secp256r1, NamedCurve.secp384r1 }; + this.mClientECPointFormats = new byte[]{ ECPointFormat.uncompressed, + ECPointFormat.ansiX962_compressed_prime, ECPointFormat.ansiX962_compressed_char2, }; + + clientExtensions = TlsExtensionsUtilities.EnsureExtensionsInitialised(clientExtensions); + + TlsEccUtilities.AddSupportedEllipticCurvesExtension(clientExtensions, mNamedCurves); + TlsEccUtilities.AddSupportedPointFormatsExtension(clientExtensions, mClientECPointFormats); + } + + if (this.HostNames != null && this.HostNames.Count > 0) + { + var list = new System.Collections.Generic.List(this.HostNames.Count); + + for (int i = 0; i < this.HostNames.Count; ++i) + list.Add(new ServerName(Tls.NameType.host_name, this.HostNames[i])); + + TlsExtensionsUtilities.AddServerNameExtension(clientExtensions, new ServerNameList(list)); + } + + return clientExtensions; + } + + public virtual ProtocolVersion MinimumVersion + { + get { return ProtocolVersion.TLSv10; } + } + + public virtual void NotifyServerVersion(ProtocolVersion serverVersion) + { + if (!MinimumVersion.IsEqualOrEarlierVersionOf(serverVersion)) + throw new TlsFatalAlert(AlertDescription.protocol_version); + } + + public abstract int[] GetCipherSuites(); + + public virtual byte[] GetCompressionMethods() + { + return new byte[]{ CompressionMethod.cls_null }; + } + + public virtual void NotifySessionID(byte[] sessionID) + { + // Currently ignored + } + + public virtual void NotifySelectedCipherSuite(int selectedCipherSuite) + { + this.mSelectedCipherSuite = selectedCipherSuite; + } + + public virtual void NotifySelectedCompressionMethod(byte selectedCompressionMethod) + { + this.mSelectedCompressionMethod = selectedCompressionMethod; + } + + public virtual void ProcessServerExtensions(IDictionary serverExtensions) + { + /* + * TlsProtocol implementation validates that any server extensions received correspond to + * client extensions sent. By default, we don't send any, and this method is not called. + */ + if (serverExtensions != null) + { + /* + * RFC 5246 7.4.1.4.1. Servers MUST NOT send this extension. + */ + CheckForUnexpectedServerExtension(serverExtensions, ExtensionType.signature_algorithms); + + CheckForUnexpectedServerExtension(serverExtensions, ExtensionType.elliptic_curves); + + if (TlsEccUtilities.IsEccCipherSuite(this.mSelectedCipherSuite)) + { + this.mServerECPointFormats = TlsEccUtilities.GetSupportedPointFormatsExtension(serverExtensions); + } + else + { + CheckForUnexpectedServerExtension(serverExtensions, ExtensionType.ec_point_formats); + } + + /* + * RFC 7685 3. The server MUST NOT echo the extension. + */ + CheckForUnexpectedServerExtension(serverExtensions, ExtensionType.padding); + } + } + + public virtual void ProcessServerSupplementalData(IList serverSupplementalData) + { + if (serverSupplementalData != null) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public abstract TlsKeyExchange GetKeyExchange(); + + public abstract TlsAuthentication GetAuthentication(); + + public virtual IList GetClientSupplementalData() + { + return null; + } + + public override TlsCompression GetCompression() + { + switch (mSelectedCompressionMethod) + { + case CompressionMethod.cls_null: + return new TlsNullCompression(); + + case CompressionMethod.DEFLATE: + return new TlsDeflateCompression(); + + default: + /* + * Note: internal error here; the TlsProtocol implementation verifies that the + * server-selected compression method was in the list of client-offered compression + * methods, so if we now can't produce an implementation, we shouldn't have offered it! + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public override TlsCipher GetCipher() + { + int encryptionAlgorithm = TlsUtilities.GetEncryptionAlgorithm(mSelectedCipherSuite); + int macAlgorithm = TlsUtilities.GetMacAlgorithm(mSelectedCipherSuite); + + return mCipherFactory.CreateCipher(mContext, encryptionAlgorithm, macAlgorithm); + } + + public virtual void NotifyNewSessionTicket(NewSessionTicket newSessionTicket) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsClient.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsClient.cs.meta new file mode 100644 index 00000000..9a4d0185 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c301d56f352233b47bd13d7a3142a95a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsContext.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsContext.cs new file mode 100644 index 00000000..351a5d3a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsContext.cs @@ -0,0 +1,158 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Threading; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal abstract class AbstractTlsContext + : TlsContext + { + private static long counter = Times.NanoTime(); + +#if NETCF_1_0 + private static object counterLock = new object(); + private static long NextCounterValue() + { + lock (counterLock) + { + return ++counter; + } + } +#else + private static long NextCounterValue() + { + return Interlocked.Increment(ref counter); + } +#endif + + private readonly IRandomGenerator mNonceRandom; + private readonly SecureRandom mSecureRandom; + private readonly SecurityParameters mSecurityParameters; + + private ProtocolVersion mClientVersion = null; + private ProtocolVersion mServerVersion = null; + private TlsSession mSession = null; + private object mUserObject = null; + + internal AbstractTlsContext(SecureRandom secureRandom, SecurityParameters securityParameters) + { + IDigest d = TlsUtilities.CreateHash(HashAlgorithm.sha256); + byte[] seed = new byte[d.GetDigestSize()]; + secureRandom.NextBytes(seed); + + this.mNonceRandom = new DigestRandomGenerator(d); + mNonceRandom.AddSeedMaterial(NextCounterValue()); + mNonceRandom.AddSeedMaterial(Times.NanoTime()); + mNonceRandom.AddSeedMaterial(seed); + + this.mSecureRandom = secureRandom; + this.mSecurityParameters = securityParameters; + } + + public virtual IRandomGenerator NonceRandomGenerator + { + get { return mNonceRandom; } + } + + public virtual SecureRandom SecureRandom + { + get { return mSecureRandom; } + } + + public virtual SecurityParameters SecurityParameters + { + get { return mSecurityParameters; } + } + + public abstract bool IsServer { get; } + + public virtual ProtocolVersion ClientVersion + { + get { return mClientVersion; } + } + + internal virtual void SetClientVersion(ProtocolVersion clientVersion) + { + this.mClientVersion = clientVersion; + } + + public virtual ProtocolVersion ServerVersion + { + get { return mServerVersion; } + } + + internal virtual void SetServerVersion(ProtocolVersion serverVersion) + { + this.mServerVersion = serverVersion; + } + + public virtual TlsSession ResumableSession + { + get { return mSession; } + } + + internal virtual void SetResumableSession(TlsSession session) + { + this.mSession = session; + } + + public virtual object UserObject + { + get { return mUserObject; } + set { this.mUserObject = value; } + } + + public virtual byte[] ExportKeyingMaterial(string asciiLabel, byte[] context_value, int length) + { + if (context_value != null && !TlsUtilities.IsValidUint16(context_value.Length)) + throw new ArgumentException("must have length less than 2^16 (or be null)", "context_value"); + + SecurityParameters sp = SecurityParameters; + if (!sp.IsExtendedMasterSecret) + { + /* + * RFC 7627 5.4. If a client or server chooses to continue with a full handshake without + * the extended master secret extension, [..] the client or server MUST NOT export any + * key material based on the new master secret for any subsequent application-level + * authentication. In particular, it MUST disable [RFC5705] [..]. + */ + throw new InvalidOperationException("cannot export keying material without extended_master_secret"); + } + + byte[] cr = sp.ClientRandom, sr = sp.ServerRandom; + + int seedLength = cr.Length + sr.Length; + if (context_value != null) + { + seedLength += (2 + context_value.Length); + } + + byte[] seed = new byte[seedLength]; + int seedPos = 0; + + Array.Copy(cr, 0, seed, seedPos, cr.Length); + seedPos += cr.Length; + Array.Copy(sr, 0, seed, seedPos, sr.Length); + seedPos += sr.Length; + if (context_value != null) + { + TlsUtilities.WriteUint16(context_value.Length, seed, seedPos); + seedPos += 2; + Array.Copy(context_value, 0, seed, seedPos, context_value.Length); + seedPos += context_value.Length; + } + + if (seedPos != seedLength) + throw new InvalidOperationException("error in calculation of seed for export"); + + return TlsUtilities.PRF(this, sp.MasterSecret, asciiLabel, seed, length); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsContext.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsContext.cs.meta new file mode 100644 index 00000000..e48cf096 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae1694ad34c5af748804e7e441781e6e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCredentials.cs new file mode 100644 index 00000000..05406ced --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCredentials.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class AbstractTlsCredentials + : TlsCredentials + { + public abstract Certificate Certificate { get; } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCredentials.cs.meta new file mode 100644 index 00000000..b440ca3c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 45b44747a83f28d4a8d737abb08516fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsEncryptionCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsEncryptionCredentials.cs new file mode 100644 index 00000000..59f565e9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsEncryptionCredentials.cs @@ -0,0 +1,16 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class AbstractTlsEncryptionCredentials + : AbstractTlsCredentials, TlsEncryptionCredentials + { + /// + public abstract byte[] DecryptPreMasterSecret(byte[] encryptedPreMasterSecret); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsEncryptionCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsEncryptionCredentials.cs.meta new file mode 100644 index 00000000..ee422dd4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsEncryptionCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55bf10e0f1cbfca47b598d52fb8cdd7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsKeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsKeyExchange.cs new file mode 100644 index 00000000..a1f9b4fd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsKeyExchange.cs @@ -0,0 +1,181 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class AbstractTlsKeyExchange + : TlsKeyExchange + { + protected readonly int mKeyExchange; + protected IList mSupportedSignatureAlgorithms; + + protected TlsContext mContext; + + protected AbstractTlsKeyExchange(int keyExchange, IList supportedSignatureAlgorithms) + { + this.mKeyExchange = keyExchange; + this.mSupportedSignatureAlgorithms = supportedSignatureAlgorithms; + } + + protected virtual DigitallySigned ParseSignature(Stream input) + { + DigitallySigned signature = DigitallySigned.Parse(mContext, input); + SignatureAndHashAlgorithm signatureAlgorithm = signature.Algorithm; + if (signatureAlgorithm != null) + { + TlsUtilities.VerifySupportedSignatureAlgorithm(mSupportedSignatureAlgorithms, signatureAlgorithm); + } + return signature; + } + + public virtual void Init(TlsContext context) + { + this.mContext = context; + + ProtocolVersion clientVersion = context.ClientVersion; + + if (TlsUtilities.IsSignatureAlgorithmsExtensionAllowed(clientVersion)) + { + /* + * RFC 5246 7.4.1.4.1. If the client does not send the signature_algorithms extension, + * the server MUST do the following: + * + * - If the negotiated key exchange algorithm is one of (RSA, DHE_RSA, DH_RSA, RSA_PSK, + * ECDH_RSA, ECDHE_RSA), behave as if client had sent the value {sha1,rsa}. + * + * - If the negotiated key exchange algorithm is one of (DHE_DSS, DH_DSS), behave as if + * the client had sent the value {sha1,dsa}. + * + * - If the negotiated key exchange algorithm is one of (ECDH_ECDSA, ECDHE_ECDSA), + * behave as if the client had sent value {sha1,ecdsa}. + */ + if (this.mSupportedSignatureAlgorithms == null) + { + switch (mKeyExchange) + { + case KeyExchangeAlgorithm.DH_DSS: + case KeyExchangeAlgorithm.DHE_DSS: + case KeyExchangeAlgorithm.SRP_DSS: + { + this.mSupportedSignatureAlgorithms = TlsUtilities.GetDefaultDssSignatureAlgorithms(); + break; + } + + case KeyExchangeAlgorithm.ECDH_ECDSA: + case KeyExchangeAlgorithm.ECDHE_ECDSA: + { + this.mSupportedSignatureAlgorithms = TlsUtilities.GetDefaultECDsaSignatureAlgorithms(); + break; + } + + case KeyExchangeAlgorithm.DH_RSA: + case KeyExchangeAlgorithm.DHE_RSA: + case KeyExchangeAlgorithm.ECDH_RSA: + case KeyExchangeAlgorithm.ECDHE_RSA: + case KeyExchangeAlgorithm.RSA: + case KeyExchangeAlgorithm.RSA_PSK: + case KeyExchangeAlgorithm.SRP_RSA: + { + this.mSupportedSignatureAlgorithms = TlsUtilities.GetDefaultRsaSignatureAlgorithms(); + break; + } + + case KeyExchangeAlgorithm.DHE_PSK: + case KeyExchangeAlgorithm.ECDHE_PSK: + case KeyExchangeAlgorithm.PSK: + case KeyExchangeAlgorithm.SRP: + break; + + default: + throw new InvalidOperationException("unsupported key exchange algorithm"); + } + } + + } + else if (this.mSupportedSignatureAlgorithms != null) + { + throw new InvalidOperationException("supported_signature_algorithms not allowed for " + clientVersion); + } + } + + public abstract void SkipServerCredentials(); + + public virtual void ProcessServerCertificate(Certificate serverCertificate) + { + if (mSupportedSignatureAlgorithms == null) + { + /* + * TODO RFC 2246 7.4.2. Unless otherwise specified, the signing algorithm for the + * certificate must be the same as the algorithm for the certificate key. + */ + } + else + { + /* + * TODO RFC 5246 7.4.2. If the client provided a "signature_algorithms" extension, then + * all certificates provided by the server MUST be signed by a hash/signature algorithm + * pair that appears in that extension. + */ + } + } + + public virtual void ProcessServerCredentials(TlsCredentials serverCredentials) + { + ProcessServerCertificate(serverCredentials.Certificate); + } + + public virtual bool RequiresServerKeyExchange + { + get { return false; } + } + + public virtual byte[] GenerateServerKeyExchange() + { + if (RequiresServerKeyExchange) + throw new TlsFatalAlert(AlertDescription.internal_error); + + return null; + } + + public virtual void SkipServerKeyExchange() + { + if (RequiresServerKeyExchange) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public virtual void ProcessServerKeyExchange(Stream input) + { + if (!RequiresServerKeyExchange) + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + } + + public abstract void ValidateCertificateRequest(CertificateRequest certificateRequest); + + public virtual void SkipClientCredentials() + { + } + + public abstract void ProcessClientCredentials(TlsCredentials clientCredentials); + + public virtual void ProcessClientCertificate(Certificate clientCertificate) + { + } + + public abstract void GenerateClientKeyExchange(Stream output); + + public virtual void ProcessClientKeyExchange(Stream input) + { + // Key exchange implementation MUST support client key exchange + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public abstract byte[] GeneratePremasterSecret(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsKeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsKeyExchange.cs.meta new file mode 100644 index 00000000..107538c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsKeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3f8816144989924494adb4d63ab573e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsPeer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsPeer.cs new file mode 100644 index 00000000..2ad34f8c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsPeer.cs @@ -0,0 +1,57 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class AbstractTlsPeer + : TlsPeer + { + public virtual bool RequiresExtendedMasterSecret() + { + return false; + } + + public virtual bool ShouldUseGmtUnixTime() + { + /* + * draft-mathewson-no-gmtunixtime-00 2. For the reasons we discuss above, we recommend that + * TLS implementors MUST by default set the entire value the ClientHello.Random and + * ServerHello.Random fields, including gmt_unix_time, to a cryptographically random + * sequence. + */ + return false; + } + + public virtual void NotifySecureRenegotiation(bool secureRenegotiation) + { + if (!secureRenegotiation) + { + /* + * RFC 5746 3.4/3.6. In this case, some clients/servers may want to terminate the handshake instead + * of continuing; see Section 4.1/4.3 for discussion. + */ + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + } + + public abstract TlsCompression GetCompression(); + + public abstract TlsCipher GetCipher(); + + public virtual void NotifyAlertRaised(byte alertLevel, byte alertDescription, string message, Exception cause) + { + } + + public virtual void NotifyAlertReceived(byte alertLevel, byte alertDescription) + { + } + + public virtual void NotifyHandshakeComplete() + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsPeer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsPeer.cs.meta new file mode 100644 index 00000000..34241da9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsPeer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 630d4642ce55ac74fb84bdf9d0244397 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsServer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsServer.cs new file mode 100644 index 00000000..79870179 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsServer.cs @@ -0,0 +1,355 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class AbstractTlsServer + : AbstractTlsPeer, TlsServer + { + protected TlsCipherFactory mCipherFactory; + + protected TlsServerContext mContext; + + protected ProtocolVersion mClientVersion; + protected int[] mOfferedCipherSuites; + protected byte[] mOfferedCompressionMethods; + protected IDictionary mClientExtensions; + + protected bool mEncryptThenMacOffered; + protected short mMaxFragmentLengthOffered; + protected bool mTruncatedHMacOffered; + protected IList mSupportedSignatureAlgorithms; + protected bool mEccCipherSuitesOffered; + protected int[] mNamedCurves; + protected byte[] mClientECPointFormats, mServerECPointFormats; + + protected ProtocolVersion mServerVersion; + protected int mSelectedCipherSuite; + protected byte mSelectedCompressionMethod; + protected IDictionary mServerExtensions; + + public AbstractTlsServer() + : this(new DefaultTlsCipherFactory()) + { + } + + public AbstractTlsServer(TlsCipherFactory cipherFactory) + { + this.mCipherFactory = cipherFactory; + } + + protected virtual bool AllowEncryptThenMac + { + get { return true; } + } + + protected virtual bool AllowTruncatedHMac + { + get { return false; } + } + + protected virtual IDictionary CheckServerExtensions() + { + return this.mServerExtensions = TlsExtensionsUtilities.EnsureExtensionsInitialised(this.mServerExtensions); + } + + protected abstract int[] GetCipherSuites(); + + protected byte[] GetCompressionMethods() + { + return new byte[] { CompressionMethod.cls_null }; + } + + protected virtual ProtocolVersion MaximumVersion + { + get { return ProtocolVersion.TLSv11; } + } + + protected virtual ProtocolVersion MinimumVersion + { + get { return ProtocolVersion.TLSv10; } + } + + protected virtual bool SupportsClientEccCapabilities(int[] namedCurves, byte[] ecPointFormats) + { + // NOTE: BC supports all the current set of point formats so we don't check them here + + if (namedCurves == null) + { + /* + * RFC 4492 4. A client that proposes ECC cipher suites may choose not to include these + * extensions. In this case, the server is free to choose any one of the elliptic curves + * or point formats [...]. + */ + return TlsEccUtilities.HasAnySupportedNamedCurves(); + } + + for (int i = 0; i < namedCurves.Length; ++i) + { + int namedCurve = namedCurves[i]; + if (NamedCurve.IsValid(namedCurve) + && (!NamedCurve.RefersToASpecificNamedCurve(namedCurve) || TlsEccUtilities.IsSupportedNamedCurve(namedCurve))) + { + return true; + } + } + + return false; + } + + public virtual void Init(TlsServerContext context) + { + this.mContext = context; + } + + public virtual void NotifyClientVersion(ProtocolVersion clientVersion) + { + this.mClientVersion = clientVersion; + } + + public virtual void NotifyFallback(bool isFallback) + { + /* + * RFC 7507 3. If TLS_FALLBACK_SCSV appears in ClientHello.cipher_suites and the highest + * protocol version supported by the server is higher than the version indicated in + * ClientHello.client_version, the server MUST respond with a fatal inappropriate_fallback + * alert [..]. + */ + if (isFallback && MaximumVersion.IsLaterVersionOf(mClientVersion)) + throw new TlsFatalAlert(AlertDescription.inappropriate_fallback); + } + + public virtual void NotifyOfferedCipherSuites(int[] offeredCipherSuites) + { + this.mOfferedCipherSuites = offeredCipherSuites; + this.mEccCipherSuitesOffered = TlsEccUtilities.ContainsEccCipherSuites(this.mOfferedCipherSuites); + } + + public virtual void NotifyOfferedCompressionMethods(byte[] offeredCompressionMethods) + { + this.mOfferedCompressionMethods = offeredCompressionMethods; + } + + public virtual void ProcessClientExtensions(IDictionary clientExtensions) + { + this.mClientExtensions = clientExtensions; + + if (clientExtensions != null) + { + this.mEncryptThenMacOffered = TlsExtensionsUtilities.HasEncryptThenMacExtension(clientExtensions); + + this.mMaxFragmentLengthOffered = TlsExtensionsUtilities.GetMaxFragmentLengthExtension(clientExtensions); + if (mMaxFragmentLengthOffered >= 0 && !MaxFragmentLength.IsValid((byte)mMaxFragmentLengthOffered)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + this.mTruncatedHMacOffered = TlsExtensionsUtilities.HasTruncatedHMacExtension(clientExtensions); + + this.mSupportedSignatureAlgorithms = TlsUtilities.GetSignatureAlgorithmsExtension(clientExtensions); + if (this.mSupportedSignatureAlgorithms != null) + { + /* + * RFC 5246 7.4.1.4.1. Note: this extension is not meaningful for TLS versions prior + * to 1.2. Clients MUST NOT offer it if they are offering prior versions. + */ + if (!TlsUtilities.IsSignatureAlgorithmsExtensionAllowed(mClientVersion)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + this.mNamedCurves = TlsEccUtilities.GetSupportedEllipticCurvesExtension(clientExtensions); + this.mClientECPointFormats = TlsEccUtilities.GetSupportedPointFormatsExtension(clientExtensions); + } + + /* + * RFC 4429 4. The client MUST NOT include these extensions in the ClientHello message if it + * does not propose any ECC cipher suites. + * + * NOTE: This was overly strict as there may be ECC cipher suites that we don't recognize. + * Also, draft-ietf-tls-negotiated-ff-dhe will be overloading the 'elliptic_curves' + * extension to explicitly allow FFDHE (i.e. non-ECC) groups. + */ + //if (!this.mEccCipherSuitesOffered && (this.mNamedCurves != null || this.mClientECPointFormats != null)) + // throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + public virtual ProtocolVersion GetServerVersion() + { + if (MinimumVersion.IsEqualOrEarlierVersionOf(mClientVersion)) + { + ProtocolVersion maximumVersion = MaximumVersion; + if (mClientVersion.IsEqualOrEarlierVersionOf(maximumVersion)) + { + return mServerVersion = mClientVersion; + } + if (mClientVersion.IsLaterVersionOf(maximumVersion)) + { + return mServerVersion = maximumVersion; + } + } + throw new TlsFatalAlert(AlertDescription.protocol_version); + } + + public virtual int GetSelectedCipherSuite() + { + /* + * RFC 5246 7.4.3. In order to negotiate correctly, the server MUST check any candidate + * cipher suites against the "signature_algorithms" extension before selecting them. This is + * somewhat inelegant but is a compromise designed to minimize changes to the original + * cipher suite design. + */ + IList sigAlgs = TlsUtilities.GetUsableSignatureAlgorithms(this.mSupportedSignatureAlgorithms); + + /* + * RFC 4429 5.1. A server that receives a ClientHello containing one or both of these + * extensions MUST use the client's enumerated capabilities to guide its selection of an + * appropriate cipher suite. One of the proposed ECC cipher suites must be negotiated only + * if the server can successfully complete the handshake while using the curves and point + * formats supported by the client [...]. + */ + bool eccCipherSuitesEnabled = SupportsClientEccCapabilities(this.mNamedCurves, this.mClientECPointFormats); + + int[] cipherSuites = GetCipherSuites(); + for (int i = 0; i < cipherSuites.Length; ++i) + { + int cipherSuite = cipherSuites[i]; + + if (Arrays.Contains(this.mOfferedCipherSuites, cipherSuite) + && (eccCipherSuitesEnabled || !TlsEccUtilities.IsEccCipherSuite(cipherSuite)) + && TlsUtilities.IsValidCipherSuiteForVersion(cipherSuite, mServerVersion) + && TlsUtilities.IsValidCipherSuiteForSignatureAlgorithms(cipherSuite, sigAlgs)) + { + return this.mSelectedCipherSuite = cipherSuite; + } + } + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + + public virtual byte GetSelectedCompressionMethod() + { + byte[] compressionMethods = GetCompressionMethods(); + for (int i = 0; i < compressionMethods.Length; ++i) + { + if (Arrays.Contains(mOfferedCompressionMethods, compressionMethods[i])) + { + return this.mSelectedCompressionMethod = compressionMethods[i]; + } + } + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + + // IDictionary is (Int32 -> byte[]) + public virtual IDictionary GetServerExtensions() + { + if (this.mEncryptThenMacOffered && AllowEncryptThenMac) + { + /* + * RFC 7366 3. If a server receives an encrypt-then-MAC request extension from a client + * and then selects a stream or Authenticated Encryption with Associated Data (AEAD) + * ciphersuite, it MUST NOT send an encrypt-then-MAC response extension back to the + * client. + */ + if (TlsUtilities.IsBlockCipherSuite(this.mSelectedCipherSuite)) + { + TlsExtensionsUtilities.AddEncryptThenMacExtension(CheckServerExtensions()); + } + } + + if (this.mMaxFragmentLengthOffered >= 0 + && TlsUtilities.IsValidUint8(mMaxFragmentLengthOffered) + && MaxFragmentLength.IsValid((byte)mMaxFragmentLengthOffered)) + { + TlsExtensionsUtilities.AddMaxFragmentLengthExtension(CheckServerExtensions(), (byte)mMaxFragmentLengthOffered); + } + + if (this.mTruncatedHMacOffered && AllowTruncatedHMac) + { + TlsExtensionsUtilities.AddTruncatedHMacExtension(CheckServerExtensions()); + } + + if (this.mClientECPointFormats != null && TlsEccUtilities.IsEccCipherSuite(this.mSelectedCipherSuite)) + { + /* + * RFC 4492 5.2. A server that selects an ECC cipher suite in response to a ClientHello + * message including a Supported Point Formats Extension appends this extension (along + * with others) to its ServerHello message, enumerating the point formats it can parse. + */ + this.mServerECPointFormats = new byte[]{ ECPointFormat.uncompressed, + ECPointFormat.ansiX962_compressed_prime, ECPointFormat.ansiX962_compressed_char2, }; + + TlsEccUtilities.AddSupportedPointFormatsExtension(CheckServerExtensions(), mServerECPointFormats); + } + + return mServerExtensions; + } + + public virtual IList GetServerSupplementalData() + { + return null; + } + + public abstract TlsCredentials GetCredentials(); + + public virtual CertificateStatus GetCertificateStatus() + { + return null; + } + + public abstract TlsKeyExchange GetKeyExchange(); + + public virtual CertificateRequest GetCertificateRequest() + { + return null; + } + + public virtual void ProcessClientSupplementalData(IList clientSupplementalData) + { + if (clientSupplementalData != null) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public virtual void NotifyClientCertificate(Certificate clientCertificate) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public override TlsCompression GetCompression() + { + switch (mSelectedCompressionMethod) + { + case CompressionMethod.cls_null: + return new TlsNullCompression(); + + default: + /* + * Note: internal error here; we selected the compression method, so if we now can't + * produce an implementation, we shouldn't have chosen it! + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public override TlsCipher GetCipher() + { + int encryptionAlgorithm = TlsUtilities.GetEncryptionAlgorithm(mSelectedCipherSuite); + int macAlgorithm = TlsUtilities.GetMacAlgorithm(mSelectedCipherSuite); + + return mCipherFactory.CreateCipher(mContext, encryptionAlgorithm, macAlgorithm); + } + + public virtual NewSessionTicket GetNewSessionTicket() + { + /* + * RFC 5077 3.3. If the server determines that it does not want to include a ticket after it + * has included the SessionTicket extension in the ServerHello, then it sends a zero-length + * ticket in the NewSessionTicket handshake message. + */ + return new NewSessionTicket(0L, TlsUtilities.EmptyBytes); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsServer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsServer.cs.meta new file mode 100644 index 00000000..1964f9d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsServer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: faff47b25a0d7154f8ff18e0ab6843ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSigner.cs new file mode 100644 index 00000000..1f50eb49 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSigner.cs @@ -0,0 +1,54 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class AbstractTlsSigner + : TlsSigner + { + protected TlsContext mContext; + + public virtual void Init(TlsContext context) + { + this.mContext = context; + } + + public virtual byte[] GenerateRawSignature(AsymmetricKeyParameter privateKey, byte[] md5AndSha1) + { + return GenerateRawSignature(null, privateKey, md5AndSha1); + } + + public abstract byte[] GenerateRawSignature(SignatureAndHashAlgorithm algorithm, + AsymmetricKeyParameter privateKey, byte[] hash); + + public virtual bool VerifyRawSignature(byte[] sigBytes, AsymmetricKeyParameter publicKey, byte[] md5AndSha1) + { + return VerifyRawSignature(null, sigBytes, publicKey, md5AndSha1); + } + + public abstract bool VerifyRawSignature(SignatureAndHashAlgorithm algorithm, byte[] sigBytes, + AsymmetricKeyParameter publicKey, byte[] hash); + + public virtual ISigner CreateSigner(AsymmetricKeyParameter privateKey) + { + return CreateSigner(null, privateKey); + } + + public abstract ISigner CreateSigner(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter privateKey); + + public virtual ISigner CreateVerifyer(AsymmetricKeyParameter publicKey) + { + return CreateVerifyer(null, publicKey); + } + + public abstract ISigner CreateVerifyer(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter publicKey); + + public abstract bool IsValidPublicKey(AsymmetricKeyParameter publicKey); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSigner.cs.meta new file mode 100644 index 00000000..de665c91 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d7986fd51deb2444927d8eb012464dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSignerCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSignerCredentials.cs new file mode 100644 index 00000000..c7869662 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSignerCredentials.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class AbstractTlsSignerCredentials + : AbstractTlsCredentials, TlsSignerCredentials + { + /// + public abstract byte[] GenerateCertificateSignature(byte[] hash); + + public virtual SignatureAndHashAlgorithm SignatureAndHashAlgorithm + { + get + { + throw new InvalidOperationException("TlsSignerCredentials implementation does not support (D)TLS 1.2+"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSignerCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSignerCredentials.cs.meta new file mode 100644 index 00000000..8851f3fc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AbstractTlsSignerCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c1498aa1db4f844e9473a971d4efbd2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertDescription.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertDescription.cs new file mode 100644 index 00000000..6135d2e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertDescription.cs @@ -0,0 +1,308 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// RFC 5246 7.2 + /// + public abstract class AlertDescription + { + /** + * This message notifies the recipient that the sender will not send any more messages on this + * connection. Note that as of TLS 1.1, failure to properly close a connection no longer + * requires that a session not be resumed. This is a change from TLS 1.0 ("The session becomes + * unresumable if any connection is terminated without proper close_notify messages with level + * equal to warning.") to conform with widespread implementation practice. + */ + public const byte close_notify = 0; + + /** + * An inappropriate message was received. This alert is always fatal and should never be + * observed in communication between proper implementations. + */ + public const byte unexpected_message = 10; + + /** + * This alert is returned if a record is received with an incorrect MAC. This alert also MUST be + * returned if an alert is sent because a TLSCiphertext decrypted in an invalid way: either it + * wasn't an even multiple of the block length, or its padding values, when checked, weren't + * correct. This message is always fatal and should never be observed in communication between + * proper implementations (except when messages were corrupted in the network). + */ + public const byte bad_record_mac = 20; + + /** + * This alert was used in some earlier versions of TLS, and may have permitted certain attacks + * against the CBC mode [CBCATT]. It MUST NOT be sent by compliant implementations. + */ + public const byte decryption_failed = 21; + + /** + * A TLSCiphertext record was received that had a length more than 2^14+2048 bytes, or a record + * decrypted to a TLSCompressed record with more than 2^14+1024 bytes. This message is always + * fatal and should never be observed in communication between proper implementations (except + * when messages were corrupted in the network). + */ + public const byte record_overflow = 22; + + /** + * The decompression function received improper input (e.g., data that would expand to excessive + * length). This message is always fatal and should never be observed in communication between + * proper implementations. + */ + public const byte decompression_failure = 30; + + /** + * Reception of a handshake_failure alert message indicates that the sender was unable to + * negotiate an acceptable set of security parameters given the options available. This is a + * fatal error. + */ + public const byte handshake_failure = 40; + + /** + * This alert was used in SSLv3 but not any version of TLS. It MUST NOT be sent by compliant + * implementations. + */ + public const byte no_certificate = 41; + + /** + * A certificate was corrupt, contained signatures that did not verify correctly, etc. + */ + public const byte bad_certificate = 42; + + /** + * A certificate was of an unsupported type. + */ + public const byte unsupported_certificate = 43; + + /** + * A certificate was revoked by its signer. + */ + public const byte certificate_revoked = 44; + + /** + * A certificate has expired or is not currently valid. + */ + public const byte certificate_expired = 45; + + /** + * Some other (unspecified) issue arose in processing the certificate, rendering it + * unacceptable. + */ + public const byte certificate_unknown = 46; + + /** + * A field in the handshake was out of range or inconsistent with other fields. This message is + * always fatal. + */ + public const byte illegal_parameter = 47; + + /** + * A valid certificate chain or partial chain was received, but the certificate was not accepted + * because the CA certificate could not be located or couldn't be matched with a known, trusted + * CA. This message is always fatal. + */ + public const byte unknown_ca = 48; + + /** + * A valid certificate was received, but when access control was applied, the sender decided not + * to proceed with negotiation. This message is always fatal. + */ + public const byte access_denied = 49; + + /** + * A message could not be decoded because some field was out of the specified range or the + * length of the message was incorrect. This message is always fatal and should never be + * observed in communication between proper implementations (except when messages were corrupted + * in the network). + */ + public const byte decode_error = 50; + + /** + * A handshake cryptographic operation failed, including being unable to correctly verify a + * signature or validate a Finished message. This message is always fatal. + */ + public const byte decrypt_error = 51; + + /** + * This alert was used in some earlier versions of TLS. It MUST NOT be sent by compliant + * implementations. + */ + public const byte export_restriction = 60; + + /** + * The protocol version the client has attempted to negotiate is recognized but not supported. + * (For example, old protocol versions might be avoided for security reasons.) This message is + * always fatal. + */ + public const byte protocol_version = 70; + + /** + * Returned instead of handshake_failure when a negotiation has failed specifically because the + * server requires ciphers more secure than those supported by the client. This message is + * always fatal. + */ + public const byte insufficient_security = 71; + + /** + * An internal error unrelated to the peer or the correctness of the protocol (such as a memory + * allocation failure) makes it impossible to continue. This message is always fatal. + */ + public const byte internal_error = 80; + + /** + * This handshake is being canceled for some reason unrelated to a protocol failure. If the user + * cancels an operation after the handshake is complete, just closing the connection by sending + * a close_notify is more appropriate. This alert should be followed by a close_notify. This + * message is generally a warning. + */ + public const byte user_canceled = 90; + + /** + * Sent by the client in response to a hello request or by the server in response to a client + * hello after initial handshaking. Either of these would normally lead to renegotiation; when + * that is not appropriate, the recipient should respond with this alert. At that point, the + * original requester can decide whether to proceed with the connection. One case where this + * would be appropriate is where a server has spawned a process to satisfy a request; the + * process might receive security parameters (key length, authentication, etc.) at startup, and + * it might be difficult to communicate changes to these parameters after that point. This + * message is always a warning. + */ + public const byte no_renegotiation = 100; + + /** + * Sent by clients that receive an extended server hello containing an extension that they did + * not put in the corresponding client hello. This message is always fatal. + */ + public const byte unsupported_extension = 110; + + /* + * RFC 3546 + */ + + /** + * This alert is sent by servers who are unable to retrieve a certificate chain from the URL + * supplied by the client (see Section 3.3). This message MAY be fatal - for example if client + * authentication is required by the server for the handshake to continue and the server is + * unable to retrieve the certificate chain, it may send a fatal alert. + */ + public const byte certificate_unobtainable = 111; + + /** + * This alert is sent by servers that receive a server_name extension request, but do not + * recognize the server name. This message MAY be fatal. + */ + public const byte unrecognized_name = 112; + + /** + * This alert is sent by clients that receive an invalid certificate status response (see + * Section 3.6). This message is always fatal. + */ + public const byte bad_certificate_status_response = 113; + + /** + * This alert is sent by servers when a certificate hash does not match a client provided + * certificate_hash. This message is always fatal. + */ + public const byte bad_certificate_hash_value = 114; + + /* + * RFC 4279 + */ + + /** + * If the server does not recognize the PSK identity, it MAY respond with an + * "unknown_psk_identity" alert message. + */ + public const byte unknown_psk_identity = 115; + + /* + * RFC 7507 + */ + + /** + * If TLS_FALLBACK_SCSV appears in ClientHello.cipher_suites and the highest protocol version + * supported by the server is higher than the version indicated in ClientHello.client_version, + * the server MUST respond with a fatal inappropriate_fallback alert [..]. + */ + public const byte inappropriate_fallback = 86; + + public static string GetName(byte alertDescription) + { + switch (alertDescription) + { + case close_notify: + return "close_notify"; + case unexpected_message: + return "unexpected_message"; + case bad_record_mac: + return "bad_record_mac"; + case decryption_failed: + return "decryption_failed"; + case record_overflow: + return "record_overflow"; + case decompression_failure: + return "decompression_failure"; + case handshake_failure: + return "handshake_failure"; + case no_certificate: + return "no_certificate"; + case bad_certificate: + return "bad_certificate"; + case unsupported_certificate: + return "unsupported_certificate"; + case certificate_revoked: + return "certificate_revoked"; + case certificate_expired: + return "certificate_expired"; + case certificate_unknown: + return "certificate_unknown"; + case illegal_parameter: + return "illegal_parameter"; + case unknown_ca: + return "unknown_ca"; + case access_denied: + return "access_denied"; + case decode_error: + return "decode_error"; + case decrypt_error: + return "decrypt_error"; + case export_restriction: + return "export_restriction"; + case protocol_version: + return "protocol_version"; + case insufficient_security: + return "insufficient_security"; + case internal_error: + return "internal_error"; + case user_canceled: + return "user_canceled"; + case no_renegotiation: + return "no_renegotiation"; + case unsupported_extension: + return "unsupported_extension"; + case certificate_unobtainable: + return "certificate_unobtainable"; + case unrecognized_name: + return "unrecognized_name"; + case bad_certificate_status_response: + return "bad_certificate_status_response"; + case bad_certificate_hash_value: + return "bad_certificate_hash_value"; + case unknown_psk_identity: + return "unknown_psk_identity"; + case inappropriate_fallback: + return "inappropriate_fallback"; + default: + return "UNKNOWN"; + } + } + + public static string GetText(byte alertDescription) + { + return GetName(alertDescription) + "(" + alertDescription + ")"; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertDescription.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertDescription.cs.meta new file mode 100644 index 00000000..c52faa2d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertDescription.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0e83bdd3959fac74eb57e28a1ffd3fe0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertLevel.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertLevel.cs new file mode 100644 index 00000000..e19cf4e0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertLevel.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// RFC 5246 7.2 + /// + public abstract class AlertLevel + { + public const byte warning = 1; + public const byte fatal = 2; + + public static string GetName(byte alertDescription) + { + switch (alertDescription) + { + case warning: + return "warning"; + case fatal: + return "fatal"; + default: + return "UNKNOWN"; + } + } + + public static string GetText(byte alertDescription) + { + return GetName(alertDescription) + "(" + alertDescription + ")"; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertLevel.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertLevel.cs.meta new file mode 100644 index 00000000..4bba27ab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlertLevel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f5a7ce7fd31dd384680237a5e4538758 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs new file mode 100644 index 00000000..0710fafa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs @@ -0,0 +1,25 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace Org.BouncyCastle.Crypto.Tls +{ + /// + /// A certificate verifyer, that will always return true. + ///
+	/// DO NOT USE THIS FILE UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING.
+	/// 
+ ///
+ public class AlwaysValidVerifyer : ICertificateVerifyer + { + /// Return true. + public bool IsValid(Uri targetUri, X509CertificateStructure[] certs) + { + return true; + } + } +} + +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs.meta new file mode 100644 index 00000000..0d63c847 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 50fdbee77ed43ea4598b7a52994f3323 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BasicTlsPskIdentity.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BasicTlsPskIdentity.cs new file mode 100644 index 00000000..57dc3291 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BasicTlsPskIdentity.cs @@ -0,0 +1,47 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class BasicTlsPskIdentity + : TlsPskIdentity + { + protected byte[] mIdentity; + protected byte[] mPsk; + + public BasicTlsPskIdentity(byte[] identity, byte[] psk) + { + this.mIdentity = Arrays.Clone(identity); + this.mPsk = Arrays.Clone(psk); + } + + public BasicTlsPskIdentity(string identity, byte[] psk) + { + this.mIdentity = Strings.ToUtf8ByteArray(identity); + this.mPsk = Arrays.Clone(psk); + } + + public virtual void SkipIdentityHint() + { + } + + public virtual void NotifyIdentityHint(byte[] psk_identity_hint) + { + } + + public virtual byte[] GetPskIdentity() + { + return mIdentity; + } + + public virtual byte[] GetPsk() + { + return mPsk; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BasicTlsPskIdentity.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BasicTlsPskIdentity.cs.meta new file mode 100644 index 00000000..207fa45d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BasicTlsPskIdentity.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a7efbf194a43ae849b278789c2f9afcb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BulkCipherAlgorithm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BulkCipherAlgorithm.cs new file mode 100644 index 00000000..6a877d87 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BulkCipherAlgorithm.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 2246 + /// + /// Note that the values here are implementation-specific and arbitrary. It is recommended not to + /// depend on the particular values (e.g. serialization). + /// + public abstract class BulkCipherAlgorithm + { + public const int cls_null = 0; + public const int rc4 = 1; + public const int rc2 = 2; + public const int des = 3; + public const int cls_3des = 4; + public const int des40 = 5; + + /* + * RFC 4346 + */ + public const int aes = 6; + public const int idea = 7; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BulkCipherAlgorithm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BulkCipherAlgorithm.cs.meta new file mode 100644 index 00000000..dee46efa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/BulkCipherAlgorithm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ed9ea69cd7f421b4a9c8a02dd294b729 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueue.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueue.cs new file mode 100644 index 00000000..6d65a26c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueue.cs @@ -0,0 +1,215 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// A queue for bytes. + ///

+ /// This file could be more optimized. + ///

+ ///
+ public class ByteQueue + { + /// The smallest number which can be written as 2^x which is bigger than i. + public static int NextTwoPow( + int i) + { + /* + * This code is based of a lot of code I found on the Internet + * which mostly referenced a book called "Hacking delight". + * + */ + i |= (i >> 1); + i |= (i >> 2); + i |= (i >> 4); + i |= (i >> 8); + i |= (i >> 16); + return i + 1; + } + + /** + * The initial size for our buffer. + */ + private const int DefaultCapacity = 1024; + + /** + * The buffer where we store our data. + */ + private byte[] databuf; + + /** + * How many bytes at the beginning of the buffer are skipped. + */ + private int skipped = 0; + + /** + * How many bytes in the buffer are valid data. + */ + private int available = 0; + + private bool readOnlyBuf = false; + + public ByteQueue() + : this(DefaultCapacity) + { + } + + public ByteQueue(int capacity) + { + this.databuf = capacity == 0 ? TlsUtilities.EmptyBytes : new byte[capacity]; + } + + public ByteQueue(byte[] buf, int off, int len) + { + this.databuf = buf; + this.skipped = off; + this.available = len; + this.readOnlyBuf = true; + } + + /// Add some data to our buffer. + /// A byte-array to read data from. + /// How many bytes to skip at the beginning of the array. + /// How many bytes to read from the array. + public void AddData( + byte[] data, + int offset, + int len) + { + if (readOnlyBuf) + throw new InvalidOperationException("Cannot add data to read-only buffer"); + + if ((skipped + available + len) > databuf.Length) + { + int desiredSize = ByteQueue.NextTwoPow(available + len); + if (desiredSize > databuf.Length) + { + byte[] tmp = new byte[desiredSize]; + Array.Copy(databuf, skipped, tmp, 0, available); + databuf = tmp; + } + else + { + Array.Copy(databuf, skipped, databuf, 0, available); + } + skipped = 0; + } + + Array.Copy(data, offset, databuf, skipped + available, len); + available += len; + } + + /// The number of bytes which are available in this buffer. + public int Available + { + get { return available; } + } + + /// Copy some bytes from the beginning of the data to the provided Stream. + /// The Stream to copy the bytes to. + /// How many bytes to copy. + /// If insufficient data is available. + /// If there is a problem copying the data. + public void CopyTo(Stream output, int length) + { + if (length > available) + throw new InvalidOperationException("Cannot copy " + length + " bytes, only got " + available); + + output.Write(databuf, skipped, length); + } + + /// Read data from the buffer. + /// The buffer where the read data will be copied to. + /// How many bytes to skip at the beginning of buf. + /// How many bytes to read at all. + /// How many bytes from our data to skip. + public void Read( + byte[] buf, + int offset, + int len, + int skip) + { + if ((buf.Length - offset) < len) + { + throw new ArgumentException("Buffer size of " + buf.Length + " is too small for a read of " + len + " bytes"); + } + if ((available - skip) < len) + { + throw new InvalidOperationException("Not enough data to read"); + } + Array.Copy(databuf, skipped + skip, buf, offset, len); + } + + /// Return a MemoryStream over some bytes at the beginning of the data. + /// How many bytes will be readable. + /// A MemoryStream over the data. + /// If insufficient data is available. + public MemoryStream ReadFrom(int length) + { + if (length > available) + throw new InvalidOperationException("Cannot read " + length + " bytes, only got " + available); + + int position = skipped; + + available -= length; + skipped += length; + + return new MemoryStream(databuf, position, length, false); + } + + /// Remove some bytes from our data from the beginning. + /// How many bytes to remove. + public void RemoveData( + int i) + { + if (i > available) + { + throw new InvalidOperationException("Cannot remove " + i + " bytes, only got " + available); + } + + /* + * Skip the data. + */ + available -= i; + skipped += i; + } + + public void RemoveData(byte[] buf, int off, int len, int skip) + { + Read(buf, off, len, skip); + RemoveData(skip + len); + } + + public byte[] RemoveData(int len, int skip) + { + byte[] buf = new byte[len]; + RemoveData(buf, 0, len, skip); + return buf; + } + + public void Shrink() + { + if (available == 0) + { + databuf = TlsUtilities.EmptyBytes; + skipped = 0; + } + else + { + int desiredSize = ByteQueue.NextTwoPow(available); + if (desiredSize < databuf.Length) + { + byte[] tmp = new byte[desiredSize]; + Array.Copy(databuf, skipped, tmp, 0, available); + databuf = tmp; + skipped = 0; + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueue.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueue.cs.meta new file mode 100644 index 00000000..49f59a31 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0b6d03f89d72e64da9242c29d55083d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueueStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueueStream.cs new file mode 100644 index 00000000..f8c3417b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueueStream.cs @@ -0,0 +1,114 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class ByteQueueStream + : Stream + { + private readonly ByteQueue buffer; + + public ByteQueueStream() + { + this.buffer = new ByteQueue(); + } + + public virtual int Available + { + get { return buffer.Available; } + } + + public override bool CanRead + { + get { return true; } + } + + public override bool CanSeek + { + get { return false; } + } + + public override bool CanWrite + { + get { return true; } + } + + public override void Flush() + { + } + + public override long Length + { + get { throw new NotSupportedException(); } + } + + public virtual int Peek(byte[] buf) + { + int bytesToRead = System.Math.Min(buffer.Available, buf.Length); + buffer.Read(buf, 0, bytesToRead, 0); + return bytesToRead; + } + + public override long Position + { + get { throw new NotSupportedException(); } + set { throw new NotSupportedException(); } + } + + public virtual int Read(byte[] buf) + { + return Read(buf, 0, buf.Length); + } + + public override int Read(byte[] buf, int off, int len) + { + int bytesToRead = System.Math.Min(buffer.Available, len); + buffer.RemoveData(buf, off, bytesToRead, 0); + return bytesToRead; + } + + public override int ReadByte() + { + if (buffer.Available == 0) + return -1; + + return buffer.RemoveData(1, 0)[0] & 0xFF; + } + + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException(); + } + + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + public virtual int Skip(int n) + { + int bytesToSkip = System.Math.Min(buffer.Available, n); + buffer.RemoveData(bytesToSkip); + return bytesToSkip; + } + + public virtual void Write(byte[] buf) + { + buffer.AddData(buf, 0, buf.Length); + } + + public override void Write(byte[] buf, int off, int len) + { + buffer.AddData(buf, off, len); + } + + public override void WriteByte(byte b) + { + buffer.AddData(new byte[]{ b }, 0, 1); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueueStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueueStream.cs.meta new file mode 100644 index 00000000..3ce48d79 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ByteQueueStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fec5e2d706f06ac4eacec774c074001a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertChainType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertChainType.cs new file mode 100644 index 00000000..cc109b66 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertChainType.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /* + * RFC 3546 3.3. + */ + public abstract class CertChainType + { + public const byte individual_certs = 0; + public const byte pkipath = 1; + + public static bool IsValid(byte certChainType) + { + return certChainType >= individual_certs && certChainType <= pkipath; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertChainType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertChainType.cs.meta new file mode 100644 index 00000000..eea30181 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertChainType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8bc6b0ebc7686e944b7bb9ab70a50f50 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Certificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Certificate.cs new file mode 100644 index 00000000..54201af1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Certificate.cs @@ -0,0 +1,140 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * Parsing and encoding of a Certificate struct from RFC 4346. + *

+ *

+     * opaque ASN.1Cert<2^24-1>;
+     *
+     * struct {
+     *     ASN.1Cert certificate_list<0..2^24-1>;
+     * } Certificate;
+     * 
+ * + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509.X509CertificateStructure + */ + public class Certificate + { + public static readonly Certificate EmptyChain = new Certificate(new X509CertificateStructure[0]); + + /** + * The certificates. + */ + protected readonly X509CertificateStructure[] mCertificateList; + + public Certificate(X509CertificateStructure[] certificateList) + { + if (certificateList == null) + throw new ArgumentNullException("certificateList"); + + this.mCertificateList = certificateList; + } + + /** + * @return an array of {@link org.bouncycastle.asn1.x509.Certificate} representing a certificate + * chain. + */ + public virtual X509CertificateStructure[] GetCertificateList() + { + return CloneCertificateList(); + } + + public virtual X509CertificateStructure GetCertificateAt(int index) + { + return mCertificateList[index]; + } + + public virtual int Length + { + get { return mCertificateList.Length; } + } + + /** + * @return true if this certificate chain contains no certificates, or + * false otherwise. + */ + public virtual bool IsEmpty + { + get { return mCertificateList.Length == 0; } + } + + /** + * Encode this {@link Certificate} to a {@link Stream}. + * + * @param output the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + IList derEncodings = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(mCertificateList.Length); + + int totalLength = 0; + foreach (Asn1Encodable asn1Cert in mCertificateList) + { + byte[] derEncoding = asn1Cert.GetEncoded(Asn1Encodable.Der); + derEncodings.Add(derEncoding); + totalLength += derEncoding.Length + 3; + } + + TlsUtilities.CheckUint24(totalLength); + TlsUtilities.WriteUint24(totalLength, output); + + foreach (byte[] derEncoding in derEncodings) + { + TlsUtilities.WriteOpaque24(derEncoding, output); + } + } + + /** + * Parse a {@link Certificate} from a {@link Stream}. + * + * @param input the {@link Stream} to parse from. + * @return a {@link Certificate} object. + * @throws IOException + */ + public static Certificate Parse(Stream input) + { + int totalLength = TlsUtilities.ReadUint24(input); + if (totalLength == 0) + { + return EmptyChain; + } + + byte[] certListData = TlsUtilities.ReadFully(totalLength, input); + + MemoryStream buf = new MemoryStream(certListData, false); + + IList certificate_list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + while (buf.Position < buf.Length) + { + byte[] berEncoding = TlsUtilities.ReadOpaque24(buf); + Asn1Object asn1Cert = TlsUtilities.ReadAsn1Object(berEncoding); + certificate_list.Add(X509CertificateStructure.GetInstance(asn1Cert)); + } + + X509CertificateStructure[] certificateList = new X509CertificateStructure[certificate_list.Count]; + for (int i = 0; i < certificate_list.Count; ++i) + { + certificateList[i] = (X509CertificateStructure)certificate_list[i]; + } + return new Certificate(certificateList); + } + + protected virtual X509CertificateStructure[] CloneCertificateList() + { + return (X509CertificateStructure[])mCertificateList.Clone(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Certificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Certificate.cs.meta new file mode 100644 index 00000000..2b333ee2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Certificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 04e2a7ee7d3bba041bea0b7d394a2fcb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateRequest.cs new file mode 100644 index 00000000..01ce1ea0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateRequest.cs @@ -0,0 +1,160 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * Parsing and encoding of a CertificateRequest struct from RFC 4346. + *

+ *

+     * struct {
+     *     ClientCertificateType certificate_types<1..2^8-1>;
+     *     DistinguishedName certificate_authorities<3..2^16-1>
+     * } CertificateRequest;
+     * 
+ * + * @see ClientCertificateType + * @see X509Name + */ + public class CertificateRequest + { + protected readonly byte[] mCertificateTypes; + protected readonly IList mSupportedSignatureAlgorithms; + protected readonly IList mCertificateAuthorities; + + /** + * @param certificateTypes see {@link ClientCertificateType} for valid constants. + * @param certificateAuthorities an {@link IList} of {@link X509Name}. + */ + public CertificateRequest(byte[] certificateTypes, IList supportedSignatureAlgorithms, + IList certificateAuthorities) + { + this.mCertificateTypes = certificateTypes; + this.mSupportedSignatureAlgorithms = supportedSignatureAlgorithms; + this.mCertificateAuthorities = certificateAuthorities; + } + + /** + * @return an array of certificate types + * @see {@link ClientCertificateType} + */ + public virtual byte[] CertificateTypes + { + get { return mCertificateTypes; } + } + + /** + * @return an {@link IList} of {@link SignatureAndHashAlgorithm} (or null before TLS 1.2). + */ + public virtual IList SupportedSignatureAlgorithms + { + get { return mSupportedSignatureAlgorithms; } + } + + /** + * @return an {@link IList} of {@link X509Name} + */ + public virtual IList CertificateAuthorities + { + get { return mCertificateAuthorities; } + } + + /** + * Encode this {@link CertificateRequest} to a {@link Stream}. + * + * @param output the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + if (mCertificateTypes == null || mCertificateTypes.Length == 0) + { + TlsUtilities.WriteUint8(0, output); + } + else + { + TlsUtilities.WriteUint8ArrayWithUint8Length(mCertificateTypes, output); + } + + if (mSupportedSignatureAlgorithms != null) + { + // TODO Check whether SignatureAlgorithm.anonymous is allowed here + TlsUtilities.EncodeSupportedSignatureAlgorithms(mSupportedSignatureAlgorithms, false, output); + } + + if (mCertificateAuthorities == null || mCertificateAuthorities.Count < 1) + { + TlsUtilities.WriteUint16(0, output); + } + else + { + IList derEncodings = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(mCertificateAuthorities.Count); + + int totalLength = 0; + foreach (Asn1Encodable certificateAuthority in mCertificateAuthorities) + { + byte[] derEncoding = certificateAuthority.GetEncoded(Asn1Encodable.Der); + derEncodings.Add(derEncoding); + totalLength += derEncoding.Length + 2; + } + + TlsUtilities.CheckUint16(totalLength); + TlsUtilities.WriteUint16(totalLength, output); + + foreach (byte[] derEncoding in derEncodings) + { + TlsUtilities.WriteOpaque16(derEncoding, output); + } + } + } + + /** + * Parse a {@link CertificateRequest} from a {@link Stream}. + * + * @param context + * the {@link TlsContext} of the current connection. + * @param input + * the {@link Stream} to parse from. + * @return a {@link CertificateRequest} object. + * @throws IOException + */ + public static CertificateRequest Parse(TlsContext context, Stream input) + { + int numTypes = TlsUtilities.ReadUint8(input); + byte[] certificateTypes = new byte[numTypes]; + for (int i = 0; i < numTypes; ++i) + { + certificateTypes[i] = TlsUtilities.ReadUint8(input); + } + + IList supportedSignatureAlgorithms = null; + if (TlsUtilities.IsTlsV12(context)) + { + // TODO Check whether SignatureAlgorithm.anonymous is allowed here + supportedSignatureAlgorithms = TlsUtilities.ParseSupportedSignatureAlgorithms(false, input); + } + + IList certificateAuthorities = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + byte[] certAuthData = TlsUtilities.ReadOpaque16(input); + MemoryStream bis = new MemoryStream(certAuthData, false); + while (bis.Position < bis.Length) + { + byte[] derEncoding = TlsUtilities.ReadOpaque16(bis); + Asn1Object asn1 = TlsUtilities.ReadDerObject(derEncoding); + // TODO Switch to X500Name when available + certificateAuthorities.Add(X509Name.GetInstance(asn1)); + } + + return new CertificateRequest(certificateTypes, supportedSignatureAlgorithms, certificateAuthorities); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateRequest.cs.meta new file mode 100644 index 00000000..0f71db3b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c6de822998d2e9a409cce2db7a032dcd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatus.cs new file mode 100644 index 00000000..4e7223ca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatus.cs @@ -0,0 +1,106 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class CertificateStatus + { + protected readonly byte mStatusType; + protected readonly object mResponse; + + public CertificateStatus(byte statusType, object response) + { + if (!IsCorrectType(statusType, response)) + throw new ArgumentException("not an instance of the correct type", "response"); + + this.mStatusType = statusType; + this.mResponse = response; + } + + public virtual byte StatusType + { + get { return mStatusType; } + } + + public virtual object Response + { + get { return mResponse; } + } + + public virtual OcspResponse GetOcspResponse() + { + if (!IsCorrectType(CertificateStatusType.ocsp, mResponse)) + throw new InvalidOperationException("'response' is not an OcspResponse"); + + return (OcspResponse)mResponse; + } + + /** + * Encode this {@link CertificateStatus} to a {@link Stream}. + * + * @param output + * the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + TlsUtilities.WriteUint8(mStatusType, output); + + switch (mStatusType) + { + case CertificateStatusType.ocsp: + byte[] derEncoding = ((OcspResponse)mResponse).GetEncoded(Asn1Encodable.Der); + TlsUtilities.WriteOpaque24(derEncoding, output); + break; + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + /** + * Parse a {@link CertificateStatus} from a {@link Stream}. + * + * @param input + * the {@link Stream} to parse from. + * @return a {@link CertificateStatus} object. + * @throws IOException + */ + public static CertificateStatus Parse(Stream input) + { + byte status_type = TlsUtilities.ReadUint8(input); + object response; + + switch (status_type) + { + case CertificateStatusType.ocsp: + { + byte[] derEncoding = TlsUtilities.ReadOpaque24(input); + response = OcspResponse.GetInstance(TlsUtilities.ReadDerObject(derEncoding)); + break; + } + default: + throw new TlsFatalAlert(AlertDescription.decode_error); + } + + return new CertificateStatus(status_type, response); + } + + protected static bool IsCorrectType(byte statusType, object response) + { + switch (statusType) + { + case CertificateStatusType.ocsp: + return response is OcspResponse; + default: + throw new ArgumentException("unsupported CertificateStatusType", "statusType"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatus.cs.meta new file mode 100644 index 00000000..027ea7be --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef5cccf2d49a9184fa820ad3b0bbf784 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusRequest.cs new file mode 100644 index 00000000..95769408 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusRequest.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class CertificateStatusRequest + { + protected readonly byte mStatusType; + protected readonly object mRequest; + + public CertificateStatusRequest(byte statusType, Object request) + { + if (!IsCorrectType(statusType, request)) + throw new ArgumentException("not an instance of the correct type", "request"); + + this.mStatusType = statusType; + this.mRequest = request; + } + + public virtual byte StatusType + { + get { return mStatusType; } + } + + public virtual object Request + { + get { return mRequest; } + } + + public virtual OcspStatusRequest GetOcspStatusRequest() + { + if (!IsCorrectType(CertificateStatusType.ocsp, mRequest)) + throw new InvalidOperationException("'request' is not an OCSPStatusRequest"); + + return (OcspStatusRequest)mRequest; + } + + /** + * Encode this {@link CertificateStatusRequest} to a {@link Stream}. + * + * @param output + * the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + TlsUtilities.WriteUint8(mStatusType, output); + + switch (mStatusType) + { + case CertificateStatusType.ocsp: + ((OcspStatusRequest)mRequest).Encode(output); + break; + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + /** + * Parse a {@link CertificateStatusRequest} from a {@link Stream}. + * + * @param input + * the {@link Stream} to parse from. + * @return a {@link CertificateStatusRequest} object. + * @throws IOException + */ + public static CertificateStatusRequest Parse(Stream input) + { + byte status_type = TlsUtilities.ReadUint8(input); + object result; + + switch (status_type) + { + case CertificateStatusType.ocsp: + result = OcspStatusRequest.Parse(input); + break; + default: + throw new TlsFatalAlert(AlertDescription.decode_error); + } + + return new CertificateStatusRequest(status_type, result); + } + + protected static bool IsCorrectType(byte statusType, object request) + { + switch (statusType) + { + case CertificateStatusType.ocsp: + return request is OcspStatusRequest; + default: + throw new ArgumentException("unsupported CertificateStatusType", "statusType"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusRequest.cs.meta new file mode 100644 index 00000000..b0c55774 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 323d128a88127984889c78f89508470b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusType.cs new file mode 100644 index 00000000..760ea16b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusType.cs @@ -0,0 +1,16 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class CertificateStatusType + { + /* + * RFC 3546 3.6 + */ + public const byte ocsp = 1; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusType.cs.meta new file mode 100644 index 00000000..783d9abc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateStatusType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e75533986ca52349be91292aa2eb6a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateType.cs new file mode 100644 index 00000000..0c16da85 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateType.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * RFC 6091 + */ + public class CertificateType + { + public const byte X509 = 0; + public const byte OpenPGP = 1; + + /* + * RFC 7250 + */ + public const byte RawPublicKey = 2; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateType.cs.meta new file mode 100644 index 00000000..055610e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eea7d62966169bf4a86791f383a77031 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateUrl.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateUrl.cs new file mode 100644 index 00000000..bd2844c5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateUrl.cs @@ -0,0 +1,129 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /* + * RFC 3546 3.3 + */ + public class CertificateUrl + { + protected readonly byte mType; + protected readonly IList mUrlAndHashList; + + /** + * @param type + * see {@link CertChainType} for valid constants. + * @param urlAndHashList + * a {@link IList} of {@link UrlAndHash}. + */ + public CertificateUrl(byte type, IList urlAndHashList) + { + if (!CertChainType.IsValid(type)) + throw new ArgumentException("not a valid CertChainType value", "type"); + if (urlAndHashList == null || urlAndHashList.Count < 1) + throw new ArgumentException("must have length > 0", "urlAndHashList"); + + this.mType = type; + this.mUrlAndHashList = urlAndHashList; + } + + /** + * @return {@link CertChainType} + */ + public virtual byte Type + { + get { return mType; } + } + + /** + * @return an {@link IList} of {@link UrlAndHash} + */ + public virtual IList UrlAndHashList + { + get { return mUrlAndHashList; } + } + + /** + * Encode this {@link CertificateUrl} to a {@link Stream}. + * + * @param output the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + TlsUtilities.WriteUint8(this.mType, output); + + ListBuffer16 buf = new ListBuffer16(); + foreach (UrlAndHash urlAndHash in this.mUrlAndHashList) + { + urlAndHash.Encode(buf); + } + buf.EncodeTo(output); + } + + /** + * Parse a {@link CertificateUrl} from a {@link Stream}. + * + * @param context + * the {@link TlsContext} of the current connection. + * @param input + * the {@link Stream} to parse from. + * @return a {@link CertificateUrl} object. + * @throws IOException + */ + public static CertificateUrl parse(TlsContext context, Stream input) + { + byte type = TlsUtilities.ReadUint8(input); + if (!CertChainType.IsValid(type)) + throw new TlsFatalAlert(AlertDescription.decode_error); + + int totalLength = TlsUtilities.ReadUint16(input); + if (totalLength < 1) + throw new TlsFatalAlert(AlertDescription.decode_error); + + byte[] urlAndHashListData = TlsUtilities.ReadFully(totalLength, input); + + MemoryStream buf = new MemoryStream(urlAndHashListData, false); + + IList url_and_hash_list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + while (buf.Position < buf.Length) + { + UrlAndHash url_and_hash = UrlAndHash.Parse(context, buf); + url_and_hash_list.Add(url_and_hash); + } + + return new CertificateUrl(type, url_and_hash_list); + } + + // TODO Could be more generally useful + internal class ListBuffer16 + : MemoryStream + { + internal ListBuffer16() + { + // Reserve space for length + TlsUtilities.WriteUint16(0, this); + } + + internal void EncodeTo(Stream output) + { + // Patch actual length back in + long length = Length - 2; + TlsUtilities.CheckUint16(length); + this.Position = 0; + TlsUtilities.WriteUint16((int)length, this); + Streams.WriteBufTo(this, output); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(this); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateUrl.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateUrl.cs.meta new file mode 100644 index 00000000..6b9bc37a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CertificateUrl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f6f47d673dc4424786059001de782e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Chacha20Poly1305.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Chacha20Poly1305.cs new file mode 100644 index 00000000..698d35c2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Chacha20Poly1305.cs @@ -0,0 +1,203 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * draft-ietf-tls-chacha20-poly1305-04 + */ + public class Chacha20Poly1305 + : TlsCipher + { + private static readonly byte[] Zeroes = new byte[15]; + + protected readonly TlsContext context; + + protected readonly ChaCha7539Engine encryptCipher, decryptCipher; + protected readonly byte[] encryptIV, decryptIV; + + /// + public Chacha20Poly1305(TlsContext context) + { + if (!TlsUtilities.IsTlsV12(context)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + this.context = context; + + int cipherKeySize = 32; + // TODO SecurityParameters.fixed_iv_length + int fixed_iv_length = 12; + // TODO SecurityParameters.record_iv_length = 0 + + int key_block_size = (2 * cipherKeySize) + (2 * fixed_iv_length); + + byte[] key_block = TlsUtilities.CalculateKeyBlock(context, key_block_size); + + int offset = 0; + + KeyParameter client_write_key = new KeyParameter(key_block, offset, cipherKeySize); + offset += cipherKeySize; + KeyParameter server_write_key = new KeyParameter(key_block, offset, cipherKeySize); + offset += cipherKeySize; + byte[] client_write_IV = Arrays.CopyOfRange(key_block, offset, offset + fixed_iv_length); + offset += fixed_iv_length; + byte[] server_write_IV = Arrays.CopyOfRange(key_block, offset, offset + fixed_iv_length); + offset += fixed_iv_length; + + if (offset != key_block_size) + throw new TlsFatalAlert(AlertDescription.internal_error); + + this.encryptCipher = new ChaCha7539Engine(); + this.decryptCipher = new ChaCha7539Engine(); + + KeyParameter encryptKey, decryptKey; + if (context.IsServer) + { + encryptKey = server_write_key; + decryptKey = client_write_key; + this.encryptIV = server_write_IV; + this.decryptIV = client_write_IV; + } + else + { + encryptKey = client_write_key; + decryptKey = server_write_key; + this.encryptIV = client_write_IV; + this.decryptIV = server_write_IV; + } + + this.encryptCipher.Init(true, new ParametersWithIV(encryptKey, encryptIV)); + this.decryptCipher.Init(false, new ParametersWithIV(decryptKey, decryptIV)); + } + + public virtual int GetPlaintextLimit(int ciphertextLimit) + { + return ciphertextLimit - 16; + } + + /// + public virtual byte[] EncodePlaintext(long seqNo, byte type, byte[] plaintext, int offset, int len) + { + KeyParameter macKey = InitRecord(encryptCipher, true, seqNo, encryptIV); + + byte[] output = new byte[len + 16]; + encryptCipher.ProcessBytes(plaintext, offset, len, output, 0); + + byte[] additionalData = GetAdditionalData(seqNo, type, len); + byte[] mac = CalculateRecordMac(macKey, additionalData, output, 0, len); + Array.Copy(mac, 0, output, len, mac.Length); + + return output; + } + + /// + public virtual byte[] DecodeCiphertext(long seqNo, byte type, byte[] ciphertext, int offset, int len) + { + if (GetPlaintextLimit(len) < 0) + throw new TlsFatalAlert(AlertDescription.decode_error); + + KeyParameter macKey = InitRecord(decryptCipher, false, seqNo, decryptIV); + + int plaintextLength = len - 16; + + byte[] additionalData = GetAdditionalData(seqNo, type, plaintextLength); + byte[] calculatedMac = CalculateRecordMac(macKey, additionalData, ciphertext, offset, plaintextLength); + byte[] receivedMac = Arrays.CopyOfRange(ciphertext, offset + plaintextLength, offset + len); + + if (!Arrays.ConstantTimeAreEqual(calculatedMac, receivedMac)) + throw new TlsFatalAlert(AlertDescription.bad_record_mac); + + byte[] output = new byte[plaintextLength]; + decryptCipher.ProcessBytes(ciphertext, offset, plaintextLength, output, 0); + return output; + } + + protected virtual KeyParameter InitRecord(IStreamCipher cipher, bool forEncryption, long seqNo, byte[] iv) + { + byte[] nonce = CalculateNonce(seqNo, iv); + cipher.Init(forEncryption, new ParametersWithIV(null, nonce)); + return GenerateRecordMacKey(cipher); + } + + protected virtual byte[] CalculateNonce(long seqNo, byte[] iv) + { + byte[] nonce = new byte[12]; + TlsUtilities.WriteUint64(seqNo, nonce, 4); + + for (int i = 0; i < 12; ++i) + { + nonce[i] ^= iv[i]; + } + + return nonce; + } + + protected virtual KeyParameter GenerateRecordMacKey(IStreamCipher cipher) + { + byte[] firstBlock = new byte[64]; + cipher.ProcessBytes(firstBlock, 0, firstBlock.Length, firstBlock, 0); + + KeyParameter macKey = new KeyParameter(firstBlock, 0, 32); + Arrays.Fill(firstBlock, (byte)0); + return macKey; + } + + protected virtual byte[] CalculateRecordMac(KeyParameter macKey, byte[] additionalData, byte[] buf, int off, int len) + { + IMac mac = new Poly1305(); + mac.Init(macKey); + + UpdateRecordMacText(mac, additionalData, 0, additionalData.Length); + UpdateRecordMacText(mac, buf, off, len); + UpdateRecordMacLength(mac, additionalData.Length); + UpdateRecordMacLength(mac, len); + + return MacUtilities.DoFinal(mac); + } + + protected virtual void UpdateRecordMacLength(IMac mac, int len) + { + byte[] longLen = Pack.UInt64_To_LE((ulong)len); + mac.BlockUpdate(longLen, 0, longLen.Length); + } + + protected virtual void UpdateRecordMacText(IMac mac, byte[] buf, int off, int len) + { + mac.BlockUpdate(buf, off, len); + + int partial = len % 16; + if (partial != 0) + { + mac.BlockUpdate(Zeroes, 0, 16 - partial); + } + } + + /// + protected virtual byte[] GetAdditionalData(long seqNo, byte type, int len) + { + /* + * additional_data = seq_num + TLSCompressed.type + TLSCompressed.version + + * TLSCompressed.length + */ + byte[] additional_data = new byte[13]; + TlsUtilities.WriteUint64(seqNo, additional_data, 0); + TlsUtilities.WriteUint8(type, additional_data, 8); + TlsUtilities.WriteVersion(context.ServerVersion, additional_data, 9); + TlsUtilities.WriteUint16(len, additional_data, 11); + + return additional_data; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Chacha20Poly1305.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Chacha20Poly1305.cs.meta new file mode 100644 index 00000000..e38d56ed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Chacha20Poly1305.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 564a63c16dc8afd4a83fd19e4682a540 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ChangeCipherSpec.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ChangeCipherSpec.cs new file mode 100644 index 00000000..f2054f45 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ChangeCipherSpec.cs @@ -0,0 +1,13 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class ChangeCipherSpec + { + public const byte change_cipher_spec = 1; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ChangeCipherSpec.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ChangeCipherSpec.cs.meta new file mode 100644 index 00000000..c4cb5ad5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ChangeCipherSpec.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94c6cbdf3e6636d4cab39f225441e580 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherSuite.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherSuite.cs new file mode 100644 index 00000000..c7fcd2b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherSuite.cs @@ -0,0 +1,381 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// RFC 2246 A.5 + /// + public abstract class CipherSuite + { + public const int TLS_NULL_WITH_NULL_NULL = 0x0000; + public const int TLS_RSA_WITH_NULL_MD5 = 0x0001; + public const int TLS_RSA_WITH_NULL_SHA = 0x0002; + public const int TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x0003; + public const int TLS_RSA_WITH_RC4_128_MD5 = 0x0004; + public const int TLS_RSA_WITH_RC4_128_SHA = 0x0005; + public const int TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x0006; + public const int TLS_RSA_WITH_IDEA_CBC_SHA = 0x0007; + public const int TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0008; + public const int TLS_RSA_WITH_DES_CBC_SHA = 0x0009; + public const int TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x000A; + public const int TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x000B; + public const int TLS_DH_DSS_WITH_DES_CBC_SHA = 0x000C; + public const int TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x000D; + public const int TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x000E; + public const int TLS_DH_RSA_WITH_DES_CBC_SHA = 0x000F; + public const int TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0010; + public const int TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0011; + public const int TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x0012; + public const int TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x0013; + public const int TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0014; + public const int TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x0015; + public const int TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x0016; + public const int TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x0017; + public const int TLS_DH_anon_WITH_RC4_128_MD5 = 0x0018; + public const int TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x0019; + public const int TLS_DH_anon_WITH_DES_CBC_SHA = 0x001A; + public const int TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x001B; + + /* + * Note: The cipher suite values { 0x00, 0x1C } and { 0x00, 0x1D } are reserved to avoid + * collision with Fortezza-based cipher suites in SSL 3. + */ + + /* + * RFC 3268 + */ + public const int TLS_RSA_WITH_AES_128_CBC_SHA = 0x002F; + public const int TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x0030; + public const int TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x0031; + public const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x0032; + public const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x0033; + public const int TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x0034; + public const int TLS_RSA_WITH_AES_256_CBC_SHA = 0x0035; + public const int TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x0036; + public const int TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x0037; + public const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x0038; + public const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x0039; + public const int TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x003A; + + /* + * RFC 5932 + */ + public const int TLS_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0041; + public const int TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0042; + public const int TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0043; + public const int TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA = 0x0044; + public const int TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x0045; + public const int TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA = 0x0046; + + public const int TLS_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0084; + public const int TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0085; + public const int TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0086; + public const int TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA = 0x0087; + public const int TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x0088; + public const int TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA = 0x0089; + + public const int TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BA; + public const int TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BB; + public const int TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BC; + public const int TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BD; + public const int TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BE; + public const int TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 = 0x00BF; + + public const int TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C0; + public const int TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C1; + public const int TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C2; + public const int TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C3; + public const int TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C4; + public const int TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 = 0x00C5; + + /* + * RFC 4162 + */ + public const int TLS_RSA_WITH_SEED_CBC_SHA = 0x0096; + public const int TLS_DH_DSS_WITH_SEED_CBC_SHA = 0x0097; + public const int TLS_DH_RSA_WITH_SEED_CBC_SHA = 0x0098; + public const int TLS_DHE_DSS_WITH_SEED_CBC_SHA = 0x0099; + public const int TLS_DHE_RSA_WITH_SEED_CBC_SHA = 0x009A; + public const int TLS_DH_anon_WITH_SEED_CBC_SHA = 0x009B; + + /* + * RFC 4279 + */ + public const int TLS_PSK_WITH_RC4_128_SHA = 0x008A; + public const int TLS_PSK_WITH_3DES_EDE_CBC_SHA = 0x008B; + public const int TLS_PSK_WITH_AES_128_CBC_SHA = 0x008C; + public const int TLS_PSK_WITH_AES_256_CBC_SHA = 0x008D; + public const int TLS_DHE_PSK_WITH_RC4_128_SHA = 0x008E; + public const int TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA = 0x008F; + public const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA = 0x0090; + public const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA = 0x0091; + public const int TLS_RSA_PSK_WITH_RC4_128_SHA = 0x0092; + public const int TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA = 0x0093; + public const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA = 0x0094; + public const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA = 0x0095; + + /* + * RFC 4492 + */ + public const int TLS_ECDH_ECDSA_WITH_NULL_SHA = 0xC001; + public const int TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0xC002; + public const int TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC003; + public const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0xC004; + public const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0xC005; + public const int TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0xC006; + public const int TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0xC007; + public const int TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0xC008; + public const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0xC009; + public const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0xC00A; + public const int TLS_ECDH_RSA_WITH_NULL_SHA = 0xC00B; + public const int TLS_ECDH_RSA_WITH_RC4_128_SHA = 0xC00C; + public const int TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0xC00D; + public const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0xC00E; + public const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0xC00F; + public const int TLS_ECDHE_RSA_WITH_NULL_SHA = 0xC010; + public const int TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0xC011; + public const int TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0xC012; + public const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0xC013; + public const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0xC014; + public const int TLS_ECDH_anon_WITH_NULL_SHA = 0xC015; + public const int TLS_ECDH_anon_WITH_RC4_128_SHA = 0xC016; + public const int TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA = 0xC017; + public const int TLS_ECDH_anon_WITH_AES_128_CBC_SHA = 0xC018; + public const int TLS_ECDH_anon_WITH_AES_256_CBC_SHA = 0xC019; + + /* + * RFC 4785 + */ + public const int TLS_PSK_WITH_NULL_SHA = 0x002C; + public const int TLS_DHE_PSK_WITH_NULL_SHA = 0x002D; + public const int TLS_RSA_PSK_WITH_NULL_SHA = 0x002E; + + /* + * RFC 5054 + */ + public const int TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA = 0xC01A; + public const int TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA = 0xC01B; + public const int TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA = 0xC01C; + public const int TLS_SRP_SHA_WITH_AES_128_CBC_SHA = 0xC01D; + public const int TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA = 0xC01E; + public const int TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA = 0xC01F; + public const int TLS_SRP_SHA_WITH_AES_256_CBC_SHA = 0xC020; + public const int TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA = 0xC021; + public const int TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA = 0xC022; + + /* + * RFC 5246 + */ + public const int TLS_RSA_WITH_NULL_SHA256 = 0x003B; + public const int TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x003C; + public const int TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x003D; + public const int TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x003E; + public const int TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x003F; + public const int TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x0040; + public const int TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x0067; + public const int TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x0068; + public const int TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x0069; + public const int TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x006A; + public const int TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x006B; + public const int TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x006C; + public const int TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x006D; + + /* + * RFC 5288 + */ + public const int TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x009C; + public const int TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x009D; + public const int TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x009E; + public const int TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x009F; + public const int TLS_DH_RSA_WITH_AES_128_GCM_SHA256 = 0x00A0; + public const int TLS_DH_RSA_WITH_AES_256_GCM_SHA384 = 0x00A1; + public const int TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 = 0x00A2; + public const int TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 = 0x00A3; + public const int TLS_DH_DSS_WITH_AES_128_GCM_SHA256 = 0x00A4; + public const int TLS_DH_DSS_WITH_AES_256_GCM_SHA384 = 0x00A5; + public const int TLS_DH_anon_WITH_AES_128_GCM_SHA256 = 0x00A6; + public const int TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0x00A7; + + /* + * RFC 5289 + */ + public const int TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC023; + public const int TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC024; + public const int TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0xC025; + public const int TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0xC026; + public const int TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0xC027; + public const int TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0xC028; + public const int TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0xC029; + public const int TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0xC02A; + public const int TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02B; + public const int TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02C; + public const int TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0xC02D; + public const int TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0xC02E; + public const int TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0xC02F; + public const int TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0xC030; + public const int TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0xC031; + public const int TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0xC032; + + /* + * RFC 5487 + */ + public const int TLS_PSK_WITH_AES_128_GCM_SHA256 = 0x00A8; + public const int TLS_PSK_WITH_AES_256_GCM_SHA384 = 0x00A9; + public const int TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 0x00AA; + public const int TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 0x00AB; + public const int TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 = 0x00AC; + public const int TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 = 0x00AD; + public const int TLS_PSK_WITH_AES_128_CBC_SHA256 = 0x00AE; + public const int TLS_PSK_WITH_AES_256_CBC_SHA384 = 0x00AF; + public const int TLS_PSK_WITH_NULL_SHA256 = 0x00B0; + public const int TLS_PSK_WITH_NULL_SHA384 = 0x00B1; + public const int TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 = 0x00B2; + public const int TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 = 0x00B3; + public const int TLS_DHE_PSK_WITH_NULL_SHA256 = 0x00B4; + public const int TLS_DHE_PSK_WITH_NULL_SHA384 = 0x00B5; + public const int TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 = 0x00B6; + public const int TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 = 0x00B7; + public const int TLS_RSA_PSK_WITH_NULL_SHA256 = 0x00B8; + public const int TLS_RSA_PSK_WITH_NULL_SHA384 = 0x00B9; + + /* + * RFC 5489 + */ + public const int TLS_ECDHE_PSK_WITH_RC4_128_SHA = 0xC033; + public const int TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA = 0xC034; + public const int TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA = 0xC035; + public const int TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA = 0xC036; + public const int TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 = 0xC037; + public const int TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 = 0xC038; + public const int TLS_ECDHE_PSK_WITH_NULL_SHA = 0xC039; + public const int TLS_ECDHE_PSK_WITH_NULL_SHA256 = 0xC03A; + public const int TLS_ECDHE_PSK_WITH_NULL_SHA384 = 0xC03B; + + /* + * RFC 5746 + */ + public const int TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0x00FF; + + /* + * RFC 6367 + */ + public const int TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC072; + public const int TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC073; + public const int TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC074; + public const int TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC075; + public const int TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC076; + public const int TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC077; + public const int TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xC078; + public const int TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 = 0xC079; + + public const int TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07A; + public const int TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07B; + public const int TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07C; + public const int TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07D; + public const int TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC07E; + public const int TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC07F; + public const int TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256 = 0xC080; + public const int TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384 = 0xC081; + public const int TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256 = 0xC082; + public const int TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384 = 0xC083; + public const int TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 = 0xC084; + public const int TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 = 0xC085; + public const int TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC086; + public const int TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC087; + public const int TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC088; + public const int TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC089; + public const int TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08A; + public const int TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08B; + public const int TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08C; + public const int TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08D; + + public const int TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC08E; + public const int TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC08F; + public const int TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC090; + public const int TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC091; + public const int TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 = 0xC092; + public const int TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 = 0xC093; + public const int TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC094; + public const int TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC095; + public const int TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC096; + public const int TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC097; + public const int TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC098; + public const int TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC099; + public const int TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 = 0xC09A; + public const int TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 = 0xC09B; + + /* + * RFC 6655 + */ + public const int TLS_RSA_WITH_AES_128_CCM = 0xC09C; + public const int TLS_RSA_WITH_AES_256_CCM = 0xC09D; + public const int TLS_DHE_RSA_WITH_AES_128_CCM = 0xC09E; + public const int TLS_DHE_RSA_WITH_AES_256_CCM = 0xC09F; + public const int TLS_RSA_WITH_AES_128_CCM_8 = 0xC0A0; + public const int TLS_RSA_WITH_AES_256_CCM_8 = 0xC0A1; + public const int TLS_DHE_RSA_WITH_AES_128_CCM_8 = 0xC0A2; + public const int TLS_DHE_RSA_WITH_AES_256_CCM_8 = 0xC0A3; + public const int TLS_PSK_WITH_AES_128_CCM = 0xC0A4; + public const int TLS_PSK_WITH_AES_256_CCM = 0xC0A5; + public const int TLS_DHE_PSK_WITH_AES_128_CCM = 0xC0A6; + public const int TLS_DHE_PSK_WITH_AES_256_CCM = 0xC0A7; + public const int TLS_PSK_WITH_AES_128_CCM_8 = 0xC0A8; + public const int TLS_PSK_WITH_AES_256_CCM_8 = 0xC0A9; + public const int TLS_PSK_DHE_WITH_AES_128_CCM_8 = 0xC0AA; + public const int TLS_PSK_DHE_WITH_AES_256_CCM_8 = 0xC0AB; + + /* + * RFC 7251 + */ + public const int TLS_ECDHE_ECDSA_WITH_AES_128_CCM = 0xC0AC; + public const int TLS_ECDHE_ECDSA_WITH_AES_256_CCM = 0xC0AD; + public const int TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 = 0xC0AE; + public const int TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 = 0xC0AF; + + /* + * RFC 7507 + */ + public const int TLS_FALLBACK_SCSV = 0x5600; + + /* + * draft-ietf-tls-chacha20-poly1305-04 + */ + public const int DRAFT_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA8; + public const int DRAFT_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCA9; + public const int DRAFT_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAA; + public const int DRAFT_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAB; + public const int DRAFT_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAC; + public const int DRAFT_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAD; + public const int DRAFT_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xCCAE; + + /* + * draft-zauner-tls-aes-ocb-04 (code points TBD) + */ + public const int DRAFT_TLS_DHE_RSA_WITH_AES_128_OCB = 0xFF00; + public const int DRAFT_TLS_DHE_RSA_WITH_AES_256_OCB = 0xFF01; + public const int DRAFT_TLS_ECDHE_RSA_WITH_AES_128_OCB = 0xFF02; + public const int DRAFT_TLS_ECDHE_RSA_WITH_AES_256_OCB = 0xFF03; + public const int DRAFT_TLS_ECDHE_ECDSA_WITH_AES_128_OCB = 0xFF04; + public const int DRAFT_TLS_ECDHE_ECDSA_WITH_AES_256_OCB = 0xFF05; + public const int DRAFT_TLS_PSK_WITH_AES_128_OCB = 0xFF10; + public const int DRAFT_TLS_PSK_WITH_AES_256_OCB = 0xFF11; + public const int DRAFT_TLS_DHE_PSK_WITH_AES_128_OCB = 0xFF12; + public const int DRAFT_TLS_DHE_PSK_WITH_AES_256_OCB = 0xFF13; + public const int DRAFT_TLS_ECDHE_PSK_WITH_AES_128_OCB = 0xFF14; + public const int DRAFT_TLS_ECDHE_PSK_WITH_AES_256_OCB = 0xFF15; + + public static bool IsScsv(int cipherSuite) + { + switch (cipherSuite) + { + case TLS_EMPTY_RENEGOTIATION_INFO_SCSV: + case TLS_FALLBACK_SCSV: + return true; + default: + return false; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherSuite.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherSuite.cs.meta new file mode 100644 index 00000000..ea165f03 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherSuite.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c73b6efb7aba3f8488ad1b3db36e743f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherType.cs new file mode 100644 index 00000000..5e3c4c96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherType.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 2246 + /// + /// Note that the values here are implementation-specific and arbitrary. It is recommended not to + /// depend on the particular values (e.g. serialization). + /// + public abstract class CipherType + { + public const int stream = 0; + public const int block = 1; + + /* + * RFC 5246 + */ + public const int aead = 2; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherType.cs.meta new file mode 100644 index 00000000..da1f69d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CipherType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f1306d0e5036e1b40b6f5b7e9879f53d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientAuthenticationType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientAuthenticationType.cs new file mode 100644 index 00000000..55ae1e36 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientAuthenticationType.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class ClientAuthenticationType + { + /* + * RFC 5077 4 + */ + public const byte anonymous = 0; + public const byte certificate_based = 1; + public const byte psk = 2; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientAuthenticationType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientAuthenticationType.cs.meta new file mode 100644 index 00000000..7f49ab97 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientAuthenticationType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c8ef7e3919b0ed4f8a73eee9a82a490 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientCertificateType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientCertificateType.cs new file mode 100644 index 00000000..5514f217 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientCertificateType.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class ClientCertificateType + { + /* + * RFC 4346 7.4.4 + */ + public const byte rsa_sign = 1; + public const byte dss_sign = 2; + public const byte rsa_fixed_dh = 3; + public const byte dss_fixed_dh = 4; + public const byte rsa_ephemeral_dh_RESERVED = 5; + public const byte dss_ephemeral_dh_RESERVED = 6; + public const byte fortezza_dms_RESERVED = 20; + + /* + * RFC 4492 5.5 + */ + public const byte ecdsa_sign = 64; + public const byte rsa_fixed_ecdh = 65; + public const byte ecdsa_fixed_ecdh = 66; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientCertificateType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientCertificateType.cs.meta new file mode 100644 index 00000000..53cb067f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ClientCertificateType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0196ebd3420ed1f41a477463bfbd322a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CombinedHash.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CombinedHash.cs new file mode 100644 index 00000000..8eb7369a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CombinedHash.cs @@ -0,0 +1,137 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * A combined hash, which implements md5(m) || sha1(m). + */ + internal class CombinedHash + : TlsHandshakeHash + { + protected TlsContext mContext; + protected IDigest mMd5; + protected IDigest mSha1; + + internal CombinedHash() + { + this.mMd5 = TlsUtilities.CreateHash(HashAlgorithm.md5); + this.mSha1 = TlsUtilities.CreateHash(HashAlgorithm.sha1); + } + + internal CombinedHash(CombinedHash t) + { + this.mContext = t.mContext; + this.mMd5 = TlsUtilities.CloneHash(HashAlgorithm.md5, t.mMd5); + this.mSha1 = TlsUtilities.CloneHash(HashAlgorithm.sha1, t.mSha1); + } + + public virtual void Init(TlsContext context) + { + this.mContext = context; + } + + public virtual TlsHandshakeHash NotifyPrfDetermined() + { + return this; + } + + public virtual void TrackHashAlgorithm(byte hashAlgorithm) + { + throw new InvalidOperationException("CombinedHash only supports calculating the legacy PRF for handshake hash"); + } + + public virtual void SealHashAlgorithms() + { + } + + public virtual TlsHandshakeHash StopTracking() + { + return new CombinedHash(this); + } + + public virtual IDigest ForkPrfHash() + { + return new CombinedHash(this); + } + + public virtual byte[] GetFinalHash(byte hashAlgorithm) + { + throw new InvalidOperationException("CombinedHash doesn't support multiple hashes"); + } + + public virtual string AlgorithmName + { + get { return mMd5.AlgorithmName + " and " + mSha1.AlgorithmName; } + } + + public virtual int GetByteLength() + { + return System.Math.Max(mMd5.GetByteLength(), mSha1.GetByteLength()); + } + + public virtual int GetDigestSize() + { + return mMd5.GetDigestSize() + mSha1.GetDigestSize(); + } + + public virtual void Update(byte input) + { + mMd5.Update(input); + mSha1.Update(input); + } + + /** + * @see org.bouncycastle.crypto.Digest#update(byte[], int, int) + */ + public virtual void BlockUpdate(byte[] input, int inOff, int len) + { + mMd5.BlockUpdate(input, inOff, len); + mSha1.BlockUpdate(input, inOff, len); + } + + /** + * @see org.bouncycastle.crypto.Digest#doFinal(byte[], int) + */ + public virtual int DoFinal(byte[] output, int outOff) + { + if (mContext != null && TlsUtilities.IsSsl(mContext)) + { + Ssl3Complete(mMd5, Ssl3Mac.IPAD, Ssl3Mac.OPAD, 48); + Ssl3Complete(mSha1, Ssl3Mac.IPAD, Ssl3Mac.OPAD, 40); + } + + int i1 = mMd5.DoFinal(output, outOff); + int i2 = mSha1.DoFinal(output, outOff + i1); + return i1 + i2; + } + + /** + * @see org.bouncycastle.crypto.Digest#reset() + */ + public virtual void Reset() + { + mMd5.Reset(); + mSha1.Reset(); + } + + protected virtual void Ssl3Complete(IDigest d, byte[] ipad, byte[] opad, int padLength) + { + byte[] master_secret = mContext.SecurityParameters.masterSecret; + + d.BlockUpdate(master_secret, 0, master_secret.Length); + d.BlockUpdate(ipad, 0, padLength); + + byte[] tmp = DigestUtilities.DoFinal(d); + + d.BlockUpdate(master_secret, 0, master_secret.Length); + d.BlockUpdate(opad, 0, padLength); + d.BlockUpdate(tmp, 0, tmp.Length); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CombinedHash.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CombinedHash.cs.meta new file mode 100644 index 00000000..77f535fc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CombinedHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: af3c6c47834d645488de7375ddc01158 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CompressionMethod.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CompressionMethod.cs new file mode 100644 index 00000000..842d5a50 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CompressionMethod.cs @@ -0,0 +1,26 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// RFC 2246 6.1 + /// + public abstract class CompressionMethod + { + public const byte cls_null = 0; + + /* + * RFC 3749 2 + */ + public const byte DEFLATE = 1; + + /* + * Values from 224 decimal (0xE0) through 255 decimal (0xFF) + * inclusive are reserved for private use. + */ + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CompressionMethod.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CompressionMethod.cs.meta new file mode 100644 index 00000000..a9559ccb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/CompressionMethod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b73c28d0fbb64c74086bc3db3142c50c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ConnectionEnd.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ConnectionEnd.cs new file mode 100644 index 00000000..5a3b7687 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ConnectionEnd.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 2246 + /// + /// Note that the values here are implementation-specific and arbitrary. It is recommended not to + /// depend on the particular values (e.g. serialization). + /// + public abstract class ConnectionEnd + { + public const int server = 0; + public const int client = 1; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ConnectionEnd.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ConnectionEnd.cs.meta new file mode 100644 index 00000000..93acf514 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ConnectionEnd.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 450461823377efe458859c00c62dfb7d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ContentType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ContentType.cs new file mode 100644 index 00000000..a829186c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ContentType.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * RFC 2246 6.2.1 + */ + public abstract class ContentType + { + public const byte change_cipher_spec = 20; + public const byte alert = 21; + public const byte handshake = 22; + public const byte application_data = 23; + public const byte heartbeat = 24; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ContentType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ContentType.cs.meta new file mode 100644 index 00000000..4bfc10f4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ContentType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e4a759488b194124ebfdb4f5c4185365 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DatagramTransport.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DatagramTransport.cs new file mode 100644 index 00000000..31e63a6d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DatagramTransport.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface DatagramTransport + { + /// + int GetReceiveLimit(); + + /// + int GetSendLimit(); + + /// + int Receive(byte[] buf, int off, int len, int waitMillis); + + /// + void Send(byte[] buf, int off, int len); + + /// + void Close(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DatagramTransport.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DatagramTransport.cs.meta new file mode 100644 index 00000000..ca030232 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DatagramTransport.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67e21ffc6e4bfae49b08ede38bb9d801 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsAgreementCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsAgreementCredentials.cs new file mode 100644 index 00000000..97d19e45 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsAgreementCredentials.cs @@ -0,0 +1,73 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DefaultTlsAgreementCredentials + : AbstractTlsAgreementCredentials + { + protected readonly Certificate mCertificate; + protected readonly AsymmetricKeyParameter mPrivateKey; + + protected readonly IBasicAgreement mBasicAgreement; + protected readonly bool mTruncateAgreement; + + public DefaultTlsAgreementCredentials(Certificate certificate, AsymmetricKeyParameter privateKey) + { + if (certificate == null) + throw new ArgumentNullException("certificate"); + if (certificate.IsEmpty) + throw new ArgumentException("cannot be empty", "certificate"); + if (privateKey == null) + throw new ArgumentNullException("privateKey"); + if (!privateKey.IsPrivate) + throw new ArgumentException("must be private", "privateKey"); + + if (privateKey is DHPrivateKeyParameters) + { + mBasicAgreement = new DHBasicAgreement(); + mTruncateAgreement = true; + } + else if (privateKey is ECPrivateKeyParameters) + { + mBasicAgreement = new ECDHBasicAgreement(); + mTruncateAgreement = false; + } + else + { + throw new ArgumentException("type not supported: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(privateKey), "privateKey"); + } + + this.mCertificate = certificate; + this.mPrivateKey = privateKey; + } + + public override Certificate Certificate + { + get { return mCertificate; } + } + + /// + public override byte[] GenerateAgreement(AsymmetricKeyParameter peerPublicKey) + { + mBasicAgreement.Init(mPrivateKey); + BigInteger agreementValue = mBasicAgreement.CalculateAgreement(peerPublicKey); + + if (mTruncateAgreement) + { + return BigIntegers.AsUnsignedByteArray(agreementValue); + } + + return BigIntegers.AsUnsignedByteArray(mBasicAgreement.GetFieldSize(), agreementValue); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsAgreementCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsAgreementCredentials.cs.meta new file mode 100644 index 00000000..0fda9009 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsAgreementCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 219a58825ae09a9468d8ea85fc96c5db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsCipherFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsCipherFactory.cs new file mode 100644 index 00000000..558f2e6c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsCipherFactory.cs @@ -0,0 +1,231 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DefaultTlsCipherFactory + : AbstractTlsCipherFactory + { + /// + public override TlsCipher CreateCipher(TlsContext context, int encryptionAlgorithm, int macAlgorithm) + { + switch (encryptionAlgorithm) + { + case EncryptionAlgorithm.cls_3DES_EDE_CBC: + return CreateDesEdeCipher(context, macAlgorithm); + case EncryptionAlgorithm.AES_128_CBC: + return CreateAESCipher(context, 16, macAlgorithm); + case EncryptionAlgorithm.AES_128_CCM: + // NOTE: Ignores macAlgorithm + return CreateCipher_Aes_Ccm(context, 16, 16); + case EncryptionAlgorithm.AES_128_CCM_8: + // NOTE: Ignores macAlgorithm + return CreateCipher_Aes_Ccm(context, 16, 8); + case EncryptionAlgorithm.AES_128_GCM: + // NOTE: Ignores macAlgorithm + return CreateCipher_Aes_Gcm(context, 16, 16); + case EncryptionAlgorithm.AES_128_OCB_TAGLEN96: + // NOTE: Ignores macAlgorithm + return CreateCipher_Aes_Ocb(context, 16, 12); + case EncryptionAlgorithm.AES_256_CBC: + return CreateAESCipher(context, 32, macAlgorithm); + case EncryptionAlgorithm.AES_256_CCM: + // NOTE: Ignores macAlgorithm + return CreateCipher_Aes_Ccm(context, 32, 16); + case EncryptionAlgorithm.AES_256_CCM_8: + // NOTE: Ignores macAlgorithm + return CreateCipher_Aes_Ccm(context, 32, 8); + case EncryptionAlgorithm.AES_256_GCM: + // NOTE: Ignores macAlgorithm + return CreateCipher_Aes_Gcm(context, 32, 16); + case EncryptionAlgorithm.AES_256_OCB_TAGLEN96: + // NOTE: Ignores macAlgorithm + return CreateCipher_Aes_Ocb(context, 32, 12); + case EncryptionAlgorithm.CAMELLIA_128_CBC: + return CreateCamelliaCipher(context, 16, macAlgorithm); + case EncryptionAlgorithm.CAMELLIA_128_GCM: + // NOTE: Ignores macAlgorithm + return CreateCipher_Camellia_Gcm(context, 16, 16); + case EncryptionAlgorithm.CAMELLIA_256_CBC: + return CreateCamelliaCipher(context, 32, macAlgorithm); + case EncryptionAlgorithm.CAMELLIA_256_GCM: + // NOTE: Ignores macAlgorithm + return CreateCipher_Camellia_Gcm(context, 32, 16); + case EncryptionAlgorithm.CHACHA20_POLY1305: + // NOTE: Ignores macAlgorithm + return CreateChaCha20Poly1305(context); + case EncryptionAlgorithm.NULL: + return CreateNullCipher(context, macAlgorithm); + case EncryptionAlgorithm.RC4_128: + return CreateRC4Cipher(context, 16, macAlgorithm); + case EncryptionAlgorithm.SEED_CBC: + return CreateSeedCipher(context, macAlgorithm); + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + /// + protected virtual TlsBlockCipher CreateAESCipher(TlsContext context, int cipherKeySize, int macAlgorithm) + { + return new TlsBlockCipher(context, CreateAesBlockCipher(), CreateAesBlockCipher(), + CreateHMacDigest(macAlgorithm), CreateHMacDigest(macAlgorithm), cipherKeySize); + } + + /// + protected virtual TlsBlockCipher CreateCamelliaCipher(TlsContext context, int cipherKeySize, int macAlgorithm) + { + return new TlsBlockCipher(context, CreateCamelliaBlockCipher(), + CreateCamelliaBlockCipher(), CreateHMacDigest(macAlgorithm), + CreateHMacDigest(macAlgorithm), cipherKeySize); + } + + /// + protected virtual TlsCipher CreateChaCha20Poly1305(TlsContext context) + { + return new Chacha20Poly1305(context); + } + + /// + protected virtual TlsAeadCipher CreateCipher_Aes_Ccm(TlsContext context, int cipherKeySize, int macSize) + { + return new TlsAeadCipher(context, CreateAeadBlockCipher_Aes_Ccm(), + CreateAeadBlockCipher_Aes_Ccm(), cipherKeySize, macSize); + } + + /// + protected virtual TlsAeadCipher CreateCipher_Aes_Gcm(TlsContext context, int cipherKeySize, int macSize) + { + return new TlsAeadCipher(context, CreateAeadBlockCipher_Aes_Gcm(), + CreateAeadBlockCipher_Aes_Gcm(), cipherKeySize, macSize); + } + + /// + protected virtual TlsAeadCipher CreateCipher_Aes_Ocb(TlsContext context, int cipherKeySize, int macSize) + { + return new TlsAeadCipher(context, CreateAeadBlockCipher_Aes_Ocb(), + CreateAeadBlockCipher_Aes_Ocb(), cipherKeySize, macSize, TlsAeadCipher.NONCE_DRAFT_CHACHA20_POLY1305); + } + + /// + protected virtual TlsAeadCipher CreateCipher_Camellia_Gcm(TlsContext context, int cipherKeySize, int macSize) + { + return new TlsAeadCipher(context, CreateAeadBlockCipher_Camellia_Gcm(), + CreateAeadBlockCipher_Camellia_Gcm(), cipherKeySize, macSize); + } + + /// + protected virtual TlsBlockCipher CreateDesEdeCipher(TlsContext context, int macAlgorithm) + { + return new TlsBlockCipher(context, CreateDesEdeBlockCipher(), CreateDesEdeBlockCipher(), + CreateHMacDigest(macAlgorithm), CreateHMacDigest(macAlgorithm), 24); + } + + /// + protected virtual TlsNullCipher CreateNullCipher(TlsContext context, int macAlgorithm) + { + return new TlsNullCipher(context, CreateHMacDigest(macAlgorithm), + CreateHMacDigest(macAlgorithm)); + } + + /// + protected virtual TlsStreamCipher CreateRC4Cipher(TlsContext context, int cipherKeySize, int macAlgorithm) + { + return new TlsStreamCipher(context, CreateRC4StreamCipher(), CreateRC4StreamCipher(), + CreateHMacDigest(macAlgorithm), CreateHMacDigest(macAlgorithm), cipherKeySize, false); + } + + /// + protected virtual TlsBlockCipher CreateSeedCipher(TlsContext context, int macAlgorithm) + { + return new TlsBlockCipher(context, CreateSeedBlockCipher(), CreateSeedBlockCipher(), + CreateHMacDigest(macAlgorithm), CreateHMacDigest(macAlgorithm), 16); + } + + protected virtual IBlockCipher CreateAesEngine() + { + return new AesEngine(); + } + + protected virtual IBlockCipher CreateCamelliaEngine() + { + return new CamelliaEngine(); + } + + protected virtual IBlockCipher CreateAesBlockCipher() + { + return new CbcBlockCipher(CreateAesEngine()); + } + + protected virtual IAeadBlockCipher CreateAeadBlockCipher_Aes_Ccm() + { + return new CcmBlockCipher(CreateAesEngine()); + } + + protected virtual IAeadBlockCipher CreateAeadBlockCipher_Aes_Gcm() + { + // TODO Consider allowing custom configuration of multiplier + return new GcmBlockCipher(CreateAesEngine()); + } + + protected virtual IAeadBlockCipher CreateAeadBlockCipher_Aes_Ocb() + { + return new OcbBlockCipher(CreateAesEngine(), CreateAesEngine()); + } + + protected virtual IAeadBlockCipher CreateAeadBlockCipher_Camellia_Gcm() + { + // TODO Consider allowing custom configuration of multiplier + return new GcmBlockCipher(CreateCamelliaEngine()); + } + + protected virtual IBlockCipher CreateCamelliaBlockCipher() + { + return new CbcBlockCipher(CreateCamelliaEngine()); + } + + protected virtual IBlockCipher CreateDesEdeBlockCipher() + { + return new CbcBlockCipher(new DesEdeEngine()); + } + + protected virtual IStreamCipher CreateRC4StreamCipher() + { + return new RC4Engine(); + } + + protected virtual IBlockCipher CreateSeedBlockCipher() + { + return new CbcBlockCipher(new SeedEngine()); + } + + /// + protected virtual IDigest CreateHMacDigest(int macAlgorithm) + { + switch (macAlgorithm) + { + case MacAlgorithm.cls_null: + return null; + case MacAlgorithm.hmac_md5: + return TlsUtilities.CreateHash(HashAlgorithm.md5); + case MacAlgorithm.hmac_sha1: + return TlsUtilities.CreateHash(HashAlgorithm.sha1); + case MacAlgorithm.hmac_sha256: + return TlsUtilities.CreateHash(HashAlgorithm.sha256); + case MacAlgorithm.hmac_sha384: + return TlsUtilities.CreateHash(HashAlgorithm.sha384); + case MacAlgorithm.hmac_sha512: + return TlsUtilities.CreateHash(HashAlgorithm.sha512); + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsCipherFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsCipherFactory.cs.meta new file mode 100644 index 00000000..1f99c14a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsCipherFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ddaf894bcaa2d914892b1950de5107a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsClient.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsClient.cs new file mode 100644 index 00000000..58f3c88b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsClient.cs @@ -0,0 +1,119 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class DefaultTlsClient + : AbstractTlsClient + { + protected TlsDHVerifier mDHVerifier; + + public DefaultTlsClient() + : this(new DefaultTlsCipherFactory()) + { + } + + public DefaultTlsClient(TlsCipherFactory cipherFactory) + : this(cipherFactory, new DefaultTlsDHVerifier()) + { + } + + public DefaultTlsClient(TlsCipherFactory cipherFactory, TlsDHVerifier dhVerifier) + : base(cipherFactory) + { + this.mDHVerifier = dhVerifier; + } + + public override int[] GetCipherSuites() + { + return new int[] + { + CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256, + CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA256, + CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA, + }; + } + + public override TlsKeyExchange GetKeyExchange() + { + int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite); + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.DH_anon: + case KeyExchangeAlgorithm.DH_DSS: + case KeyExchangeAlgorithm.DH_RSA: + return CreateDHKeyExchange(keyExchangeAlgorithm); + + case KeyExchangeAlgorithm.DHE_DSS: + case KeyExchangeAlgorithm.DHE_RSA: + return CreateDheKeyExchange(keyExchangeAlgorithm); + + case KeyExchangeAlgorithm.ECDH_anon: + case KeyExchangeAlgorithm.ECDH_ECDSA: + case KeyExchangeAlgorithm.ECDH_RSA: + return CreateECDHKeyExchange(keyExchangeAlgorithm); + + case KeyExchangeAlgorithm.ECDHE_ECDSA: + case KeyExchangeAlgorithm.ECDHE_RSA: + return CreateECDheKeyExchange(keyExchangeAlgorithm); + + case KeyExchangeAlgorithm.RSA: + return CreateRsaKeyExchange(); + + default: + /* + * Note: internal error here; the TlsProtocol implementation verifies that the + * server-selected cipher suite was in the list of client-offered cipher suites, so if + * we now can't produce an implementation, we shouldn't have offered it! + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + protected virtual TlsKeyExchange CreateDHKeyExchange(int keyExchange) + { + return new TlsDHKeyExchange(keyExchange, mSupportedSignatureAlgorithms, mDHVerifier, null); + } + + protected virtual TlsKeyExchange CreateDheKeyExchange(int keyExchange) + { + return new TlsDheKeyExchange(keyExchange, mSupportedSignatureAlgorithms, mDHVerifier, null); + } + + protected virtual TlsKeyExchange CreateECDHKeyExchange(int keyExchange) + { + return new TlsECDHKeyExchange(keyExchange, mSupportedSignatureAlgorithms, mNamedCurves, mClientECPointFormats, + mServerECPointFormats); + } + + protected virtual TlsKeyExchange CreateECDheKeyExchange(int keyExchange) + { + return new TlsECDheKeyExchange(keyExchange, mSupportedSignatureAlgorithms, mNamedCurves, mClientECPointFormats, + mServerECPointFormats); + } + + protected virtual TlsKeyExchange CreateRsaKeyExchange() + { + return new TlsRsaKeyExchange(mSupportedSignatureAlgorithms); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsClient.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsClient.cs.meta new file mode 100644 index 00000000..49779960 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 407646f18e94e0e4ebd018e992aa5fc3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsDHVerifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsDHVerifier.cs new file mode 100644 index 00000000..cf560896 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsDHVerifier.cs @@ -0,0 +1,105 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DefaultTlsDHVerifier + : TlsDHVerifier + { + public static readonly int DefaultMinimumPrimeBits = 2048; + + protected static readonly IList DefaultGroups = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + private static void AddDefaultGroup(DHParameters dhParameters) + { + DefaultGroups.Add(dhParameters); + } + + static DefaultTlsDHVerifier() + { + AddDefaultGroup(DHStandardGroups.rfc7919_ffdhe2048); + AddDefaultGroup(DHStandardGroups.rfc7919_ffdhe3072); + AddDefaultGroup(DHStandardGroups.rfc7919_ffdhe4096); + AddDefaultGroup(DHStandardGroups.rfc7919_ffdhe6144); + AddDefaultGroup(DHStandardGroups.rfc7919_ffdhe8192); + + AddDefaultGroup(DHStandardGroups.rfc3526_1536); + AddDefaultGroup(DHStandardGroups.rfc3526_2048); + AddDefaultGroup(DHStandardGroups.rfc3526_3072); + AddDefaultGroup(DHStandardGroups.rfc3526_4096); + AddDefaultGroup(DHStandardGroups.rfc3526_6144); + AddDefaultGroup(DHStandardGroups.rfc3526_8192); + } + + // IList is (DHParameters) + protected readonly IList mGroups; + protected readonly int mMinimumPrimeBits; + + /// Accept various standard DH groups with 'P' at least DefaultMinimumPrimeBits bits. + public DefaultTlsDHVerifier() + : this(DefaultMinimumPrimeBits) + { + } + + /// Accept various standard DH groups with 'P' at least the specified number of bits. + public DefaultTlsDHVerifier(int minimumPrimeBits) + : this(DefaultGroups, minimumPrimeBits) + { + } + + /// Accept a custom set of group parameters, subject to a minimum bitlength for 'P'. + /// An IList of acceptable DHParameters. + /// The minimum acceptable bitlength of the 'P' parameter. + public DefaultTlsDHVerifier(IList groups, int minimumPrimeBits) + { + this.mGroups = groups; + this.mMinimumPrimeBits = minimumPrimeBits; + } + + public virtual bool Accept(DHParameters dhParameters) + { + return CheckMinimumPrimeBits(dhParameters) && CheckGroup(dhParameters); + } + + public virtual int MinimumPrimeBits + { + get { return mMinimumPrimeBits; } + } + + protected virtual bool AreGroupsEqual(DHParameters a, DHParameters b) + { + return a == b || (AreParametersEqual(a.P, b.P) && AreParametersEqual(a.G, b.G)); + } + + protected virtual bool AreParametersEqual(BigInteger a, BigInteger b) + { + return a == b || a.Equals(b); + } + + protected virtual bool CheckGroup(DHParameters dhParameters) + { + foreach (DHParameters group in mGroups) + { + if (AreGroupsEqual(dhParameters, group)) + { + return true; + } + } + return false; + } + + protected virtual bool CheckMinimumPrimeBits(DHParameters dhParameters) + { + return dhParameters.P.BitLength >= MinimumPrimeBits; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsDHVerifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsDHVerifier.cs.meta new file mode 100644 index 00000000..95e69b72 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsDHVerifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f664ee27db9b6d4c90e103cdcfdfdb9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsEncryptionCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsEncryptionCredentials.cs new file mode 100644 index 00000000..9e8d3b74 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsEncryptionCredentials.cs @@ -0,0 +1,56 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DefaultTlsEncryptionCredentials + : AbstractTlsEncryptionCredentials + { + protected readonly TlsContext mContext; + protected readonly Certificate mCertificate; + protected readonly AsymmetricKeyParameter mPrivateKey; + + public DefaultTlsEncryptionCredentials(TlsContext context, Certificate certificate, + AsymmetricKeyParameter privateKey) + { + if (certificate == null) + throw new ArgumentNullException("certificate"); + if (certificate.IsEmpty) + throw new ArgumentException("cannot be empty", "certificate"); + if (privateKey == null) + throw new ArgumentNullException("'privateKey' cannot be null"); + if (!privateKey.IsPrivate) + throw new ArgumentException("must be private", "privateKey"); + + if (privateKey is RsaKeyParameters) + { + } + else + { + throw new ArgumentException("type not supported: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(privateKey), "privateKey"); + } + + this.mContext = context; + this.mCertificate = certificate; + this.mPrivateKey = privateKey; + } + + public override Certificate Certificate + { + get { return mCertificate; } + } + + /// + public override byte[] DecryptPreMasterSecret(byte[] encryptedPreMasterSecret) + { + return TlsRsaUtilities.SafeDecryptPreMasterSecret(mContext, (RsaKeyParameters)mPrivateKey, encryptedPreMasterSecret); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsEncryptionCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsEncryptionCredentials.cs.meta new file mode 100644 index 00000000..b3ddd962 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsEncryptionCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19b731223cc00474a84d78bbdf9f88c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsServer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsServer.cs new file mode 100644 index 00000000..6f2ad207 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsServer.cs @@ -0,0 +1,170 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class DefaultTlsServer + : AbstractTlsServer + { + public DefaultTlsServer() + : base() + { + } + + public DefaultTlsServer(TlsCipherFactory cipherFactory) + : base(cipherFactory) + { + } + + protected virtual TlsSignerCredentials GetDsaSignerCredentials() + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + protected virtual TlsSignerCredentials GetECDsaSignerCredentials() + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + protected virtual TlsEncryptionCredentials GetRsaEncryptionCredentials() + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + protected virtual TlsSignerCredentials GetRsaSignerCredentials() + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + protected virtual DHParameters GetDHParameters() + { + return DHStandardGroups.rfc7919_ffdhe2048; + } + + protected override int[] GetCipherSuites() + { + return new int[] + { + CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, + CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + CipherSuite.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, + CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, + CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, + CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, + CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA, + CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA, + CipherSuite.TLS_RSA_WITH_AES_256_GCM_SHA384, + CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256, + CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA256, + CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA256, + CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA, + CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA, + }; + } + + public override TlsCredentials GetCredentials() + { + int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite); + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.DHE_DSS: + return GetDsaSignerCredentials(); + + case KeyExchangeAlgorithm.DH_anon: + case KeyExchangeAlgorithm.ECDH_anon: + return null; + + case KeyExchangeAlgorithm.ECDHE_ECDSA: + return GetECDsaSignerCredentials(); + + case KeyExchangeAlgorithm.DHE_RSA: + case KeyExchangeAlgorithm.ECDHE_RSA: + return GetRsaSignerCredentials(); + + case KeyExchangeAlgorithm.RSA: + return GetRsaEncryptionCredentials(); + + default: + /* Note: internal error here; selected a key exchange we don't implement! */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public override TlsKeyExchange GetKeyExchange() + { + int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite); + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.DH_anon: + case KeyExchangeAlgorithm.DH_DSS: + case KeyExchangeAlgorithm.DH_RSA: + return CreateDHKeyExchange(keyExchangeAlgorithm); + + case KeyExchangeAlgorithm.DHE_DSS: + case KeyExchangeAlgorithm.DHE_RSA: + return CreateDheKeyExchange(keyExchangeAlgorithm); + + case KeyExchangeAlgorithm.ECDH_anon: + case KeyExchangeAlgorithm.ECDH_ECDSA: + case KeyExchangeAlgorithm.ECDH_RSA: + return CreateECDHKeyExchange(keyExchangeAlgorithm); + + case KeyExchangeAlgorithm.ECDHE_ECDSA: + case KeyExchangeAlgorithm.ECDHE_RSA: + return CreateECDheKeyExchange(keyExchangeAlgorithm); + + case KeyExchangeAlgorithm.RSA: + return CreateRsaKeyExchange(); + + default: + /* + * Note: internal error here; the TlsProtocol implementation verifies that the + * server-selected cipher suite was in the list of client-offered cipher suites, so if + * we now can't produce an implementation, we shouldn't have offered it! + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + protected virtual TlsKeyExchange CreateDHKeyExchange(int keyExchange) + { + return new TlsDHKeyExchange(keyExchange, mSupportedSignatureAlgorithms, null, GetDHParameters()); + } + + protected virtual TlsKeyExchange CreateDheKeyExchange(int keyExchange) + { + return new TlsDheKeyExchange(keyExchange, mSupportedSignatureAlgorithms, null, GetDHParameters()); + } + + protected virtual TlsKeyExchange CreateECDHKeyExchange(int keyExchange) + { + return new TlsECDHKeyExchange(keyExchange, mSupportedSignatureAlgorithms, mNamedCurves, mClientECPointFormats, + mServerECPointFormats); + } + + protected virtual TlsKeyExchange CreateECDheKeyExchange(int keyExchange) + { + return new TlsECDheKeyExchange(keyExchange, mSupportedSignatureAlgorithms, mNamedCurves, mClientECPointFormats, + mServerECPointFormats); + } + + protected virtual TlsKeyExchange CreateRsaKeyExchange() + { + return new TlsRsaKeyExchange(mSupportedSignatureAlgorithms); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsServer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsServer.cs.meta new file mode 100644 index 00000000..6c53da36 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsServer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3375905f76ecbfb41a1d98200756d951 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSignerCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSignerCredentials.cs new file mode 100644 index 00000000..70074aab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSignerCredentials.cs @@ -0,0 +1,97 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DefaultTlsSignerCredentials + : AbstractTlsSignerCredentials + { + protected readonly TlsContext mContext; + protected readonly Certificate mCertificate; + protected readonly AsymmetricKeyParameter mPrivateKey; + protected readonly SignatureAndHashAlgorithm mSignatureAndHashAlgorithm; + + protected readonly TlsSigner mSigner; + + public DefaultTlsSignerCredentials(TlsContext context, Certificate certificate, AsymmetricKeyParameter privateKey) + : this(context, certificate, privateKey, null) + { + } + + public DefaultTlsSignerCredentials(TlsContext context, Certificate certificate, AsymmetricKeyParameter privateKey, + SignatureAndHashAlgorithm signatureAndHashAlgorithm) + { + if (certificate == null) + throw new ArgumentNullException("certificate"); + if (certificate.IsEmpty) + throw new ArgumentException("cannot be empty", "clientCertificate"); + if (privateKey == null) + throw new ArgumentNullException("privateKey"); + if (!privateKey.IsPrivate) + throw new ArgumentException("must be private", "privateKey"); + if (TlsUtilities.IsTlsV12(context) && signatureAndHashAlgorithm == null) + throw new ArgumentException("cannot be null for (D)TLS 1.2+", "signatureAndHashAlgorithm"); + + if (privateKey is RsaKeyParameters) + { + mSigner = new TlsRsaSigner(); + } + else if (privateKey is DsaPrivateKeyParameters) + { + mSigner = new TlsDssSigner(); + } + else if (privateKey is ECPrivateKeyParameters) + { + mSigner = new TlsECDsaSigner(); + } + else + { + throw new ArgumentException("type not supported: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(privateKey), "privateKey"); + } + + this.mSigner.Init(context); + + this.mContext = context; + this.mCertificate = certificate; + this.mPrivateKey = privateKey; + this.mSignatureAndHashAlgorithm = signatureAndHashAlgorithm; + } + + public override Certificate Certificate + { + get { return mCertificate; } + } + + /// + public override byte[] GenerateCertificateSignature(byte[] hash) + { + try + { + if (TlsUtilities.IsTlsV12(mContext)) + { + return mSigner.GenerateRawSignature(mSignatureAndHashAlgorithm, mPrivateKey, hash); + } + else + { + return mSigner.GenerateRawSignature(mPrivateKey, hash); + } + } + catch (CryptoException e) + { + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + } + + public override SignatureAndHashAlgorithm SignatureAndHashAlgorithm + { + get { return mSignatureAndHashAlgorithm; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSignerCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSignerCredentials.cs.meta new file mode 100644 index 00000000..6b0c385d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSignerCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36036cf371790154ea9e0823d84ff456 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSrpGroupVerifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSrpGroupVerifier.cs new file mode 100644 index 00000000..6979b42c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSrpGroupVerifier.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Srp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DefaultTlsSrpGroupVerifier + : TlsSrpGroupVerifier + { + protected static readonly IList DefaultGroups = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + static DefaultTlsSrpGroupVerifier() + { + DefaultGroups.Add(Srp6StandardGroups.rfc5054_1024); + DefaultGroups.Add(Srp6StandardGroups.rfc5054_1536); + DefaultGroups.Add(Srp6StandardGroups.rfc5054_2048); + DefaultGroups.Add(Srp6StandardGroups.rfc5054_3072); + DefaultGroups.Add(Srp6StandardGroups.rfc5054_4096); + DefaultGroups.Add(Srp6StandardGroups.rfc5054_6144); + DefaultGroups.Add(Srp6StandardGroups.rfc5054_8192); + } + + // Vector is (SRP6GroupParameters) + protected readonly IList mGroups; + + /** + * Accept only the group parameters specified in RFC 5054 Appendix A. + */ + public DefaultTlsSrpGroupVerifier() + : this(DefaultGroups) + { + } + + /** + * Specify a custom set of acceptable group parameters. + * + * @param groups a {@link Vector} of acceptable {@link SRP6GroupParameters} + */ + public DefaultTlsSrpGroupVerifier(IList groups) + { + this.mGroups = groups; + } + + public virtual bool Accept(Srp6GroupParameters group) + { + foreach (Srp6GroupParameters entry in mGroups) + { + if (AreGroupsEqual(group, entry)) + { + return true; + } + } + return false; + } + + protected virtual bool AreGroupsEqual(Srp6GroupParameters a, Srp6GroupParameters b) + { + return a == b || (AreParametersEqual(a.N, b.N) && AreParametersEqual(a.G, b.G)); + } + + protected virtual bool AreParametersEqual(BigInteger a, BigInteger b) + { + return a == b || a.Equals(b); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSrpGroupVerifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSrpGroupVerifier.cs.meta new file mode 100644 index 00000000..abadcec6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DefaultTlsSrpGroupVerifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6f643ff4731456d49b0d2415e0321f59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DeferredHash.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DeferredHash.cs new file mode 100644 index 00000000..1be05f78 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DeferredHash.cs @@ -0,0 +1,205 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * Buffers input until the hash algorithm is determined. + */ + internal class DeferredHash + : TlsHandshakeHash + { + protected const int BUFFERING_HASH_LIMIT = 4; + + protected TlsContext mContext; + + private DigestInputBuffer mBuf; + private IDictionary mHashes; + private int mPrfHashAlgorithm; + + internal DeferredHash() + { + this.mBuf = new DigestInputBuffer(); + this.mHashes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + this.mPrfHashAlgorithm = -1; + } + + private DeferredHash(byte prfHashAlgorithm, IDigest prfHash) + { + this.mBuf = null; + this.mHashes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + this.mPrfHashAlgorithm = prfHashAlgorithm; + mHashes[prfHashAlgorithm] = prfHash; + } + + public virtual void Init(TlsContext context) + { + this.mContext = context; + } + + public virtual TlsHandshakeHash NotifyPrfDetermined() + { + int prfAlgorithm = mContext.SecurityParameters.PrfAlgorithm; + if (prfAlgorithm == PrfAlgorithm.tls_prf_legacy) + { + CombinedHash legacyHash = new CombinedHash(); + legacyHash.Init(mContext); + mBuf.UpdateDigest(legacyHash); + return legacyHash.NotifyPrfDetermined(); + } + + this.mPrfHashAlgorithm = TlsUtilities.GetHashAlgorithmForPrfAlgorithm(prfAlgorithm); + + CheckTrackingHash((byte)mPrfHashAlgorithm); + + return this; + } + + public virtual void TrackHashAlgorithm(byte hashAlgorithm) + { + if (mBuf == null) + throw new InvalidOperationException("Too late to track more hash algorithms"); + + CheckTrackingHash(hashAlgorithm); + } + + public virtual void SealHashAlgorithms() + { + CheckStopBuffering(); + } + + public virtual TlsHandshakeHash StopTracking() + { + byte prfHashAlgorithm = (byte)mPrfHashAlgorithm; + IDigest prfHash = TlsUtilities.CloneHash(prfHashAlgorithm, (IDigest)mHashes[prfHashAlgorithm]); + if (mBuf != null) + { + mBuf.UpdateDigest(prfHash); + } + DeferredHash result = new DeferredHash(prfHashAlgorithm, prfHash); + result.Init(mContext); + return result; + } + + public virtual IDigest ForkPrfHash() + { + CheckStopBuffering(); + + byte prfHashAlgorithm = (byte)mPrfHashAlgorithm; + if (mBuf != null) + { + IDigest prfHash = TlsUtilities.CreateHash(prfHashAlgorithm); + mBuf.UpdateDigest(prfHash); + return prfHash; + } + + return TlsUtilities.CloneHash(prfHashAlgorithm, (IDigest)mHashes[prfHashAlgorithm]); + } + + public virtual byte[] GetFinalHash(byte hashAlgorithm) + { + IDigest d = (IDigest)mHashes[hashAlgorithm]; + if (d == null) + throw new InvalidOperationException("HashAlgorithm." + HashAlgorithm.GetText(hashAlgorithm) + " is not being tracked"); + + d = TlsUtilities.CloneHash(hashAlgorithm, d); + if (mBuf != null) + { + mBuf.UpdateDigest(d); + } + + return DigestUtilities.DoFinal(d); + } + + public virtual string AlgorithmName + { + get { throw new InvalidOperationException("Use Fork() to get a definite IDigest"); } + } + + public virtual int GetByteLength() + { + throw new InvalidOperationException("Use Fork() to get a definite IDigest"); + } + + public virtual int GetDigestSize() + { + throw new InvalidOperationException("Use Fork() to get a definite IDigest"); + } + + public virtual void Update(byte input) + { + if (mBuf != null) + { + mBuf.WriteByte(input); + return; + } + + foreach (IDigest hash in mHashes.Values) + { + hash.Update(input); + } + } + + public virtual void BlockUpdate(byte[] input, int inOff, int len) + { + if (mBuf != null) + { + mBuf.Write(input, inOff, len); + return; + } + + foreach (IDigest hash in mHashes.Values) + { + hash.BlockUpdate(input, inOff, len); + } + } + + public virtual int DoFinal(byte[] output, int outOff) + { + throw new InvalidOperationException("Use Fork() to get a definite IDigest"); + } + + public virtual void Reset() + { + if (mBuf != null) + { + mBuf.SetLength(0); + return; + } + + foreach (IDigest hash in mHashes.Values) + { + hash.Reset(); + } + } + + protected virtual void CheckStopBuffering() + { + if (mBuf != null && mHashes.Count <= BUFFERING_HASH_LIMIT) + { + foreach (IDigest hash in mHashes.Values) + { + mBuf.UpdateDigest(hash); + } + + this.mBuf = null; + } + } + + protected virtual void CheckTrackingHash(byte hashAlgorithm) + { + if (!mHashes.Contains(hashAlgorithm)) + { + IDigest hash = TlsUtilities.CreateHash(hashAlgorithm); + mHashes[hashAlgorithm] = hash; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DeferredHash.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DeferredHash.cs.meta new file mode 100644 index 00000000..864e2736 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DeferredHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 35244b3409862df4fb244db83d469188 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigestInputBuffer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigestInputBuffer.cs new file mode 100644 index 00000000..85700b98 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigestInputBuffer.cs @@ -0,0 +1,41 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal class DigestInputBuffer + : MemoryStream + { + internal void UpdateDigest(IDigest d) + { + Streams.WriteBufTo(this, new DigStream(d)); + } + + private class DigStream + : BaseOutputStream + { + private readonly IDigest d; + + internal DigStream(IDigest d) + { + this.d = d; + } + + public override void WriteByte(byte b) + { + d.Update(b); + } + + public override void Write(byte[] buf, int off, int len) + { + d.BlockUpdate(buf, off, len); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigestInputBuffer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigestInputBuffer.cs.meta new file mode 100644 index 00000000..d8f723fb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigestInputBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7407d2712d4fe2c489e6c3374c52d797 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigitallySigned.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigitallySigned.cs new file mode 100644 index 00000000..7f1860ec --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigitallySigned.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DigitallySigned + { + protected readonly SignatureAndHashAlgorithm mAlgorithm; + protected readonly byte[] mSignature; + + public DigitallySigned(SignatureAndHashAlgorithm algorithm, byte[] signature) + { + if (signature == null) + throw new ArgumentNullException("signature"); + + this.mAlgorithm = algorithm; + this.mSignature = signature; + } + + /** + * @return a {@link SignatureAndHashAlgorithm} (or null before TLS 1.2). + */ + public virtual SignatureAndHashAlgorithm Algorithm + { + get { return mAlgorithm; } + } + + public virtual byte[] Signature + { + get { return mSignature; } + } + + /** + * Encode this {@link DigitallySigned} to a {@link Stream}. + * + * @param output + * the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + if (mAlgorithm != null) + { + mAlgorithm.Encode(output); + } + TlsUtilities.WriteOpaque16(mSignature, output); + } + + /** + * Parse a {@link DigitallySigned} from a {@link Stream}. + * + * @param context + * the {@link TlsContext} of the current connection. + * @param input + * the {@link Stream} to parse from. + * @return a {@link DigitallySigned} object. + * @throws IOException + */ + public static DigitallySigned Parse(TlsContext context, Stream input) + { + SignatureAndHashAlgorithm algorithm = null; + if (TlsUtilities.IsTlsV12(context)) + { + algorithm = SignatureAndHashAlgorithm.Parse(input); + } + byte[] signature = TlsUtilities.ReadOpaque16(input); + return new DigitallySigned(algorithm, signature); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigitallySigned.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigitallySigned.cs.meta new file mode 100644 index 00000000..15f54a6d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DigitallySigned.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b20d78f9aa88ca2469189563d7403921 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsClientProtocol.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsClientProtocol.cs new file mode 100644 index 00000000..765ed49a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsClientProtocol.cs @@ -0,0 +1,866 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DtlsClientProtocol + : DtlsProtocol + { + public DtlsClientProtocol(SecureRandom secureRandom) + : base(secureRandom) + { + } + + public virtual DtlsTransport Connect(TlsClient client, DatagramTransport transport) + { + if (client == null) + throw new ArgumentNullException("client"); + if (transport == null) + throw new ArgumentNullException("transport"); + + SecurityParameters securityParameters = new SecurityParameters(); + securityParameters.entity = ConnectionEnd.client; + + ClientHandshakeState state = new ClientHandshakeState(); + state.client = client; + state.clientContext = new TlsClientContextImpl(mSecureRandom, securityParameters); + + securityParameters.clientRandom = TlsProtocol.CreateRandomBlock(client.ShouldUseGmtUnixTime(), + state.clientContext.NonceRandomGenerator); + + client.Init(state.clientContext); + + DtlsRecordLayer recordLayer = new DtlsRecordLayer(transport, state.clientContext, client, ContentType.handshake); + + TlsSession sessionToResume = state.client.GetSessionToResume(); + if (sessionToResume != null && sessionToResume.IsResumable) + { + SessionParameters sessionParameters = sessionToResume.ExportSessionParameters(); + if (sessionParameters != null && sessionParameters.IsExtendedMasterSecret) + { + state.tlsSession = sessionToResume; + state.sessionParameters = sessionParameters; + } + } + + try + { + return ClientHandshake(state, recordLayer); + } + catch (TlsFatalAlert fatalAlert) + { + AbortClientHandshake(state, recordLayer, fatalAlert.AlertDescription); + throw fatalAlert; + } + catch (IOException e) + { + AbortClientHandshake(state, recordLayer, AlertDescription.internal_error); + throw e; + } + catch (Exception e) + { + AbortClientHandshake(state, recordLayer, AlertDescription.internal_error); + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + finally + { + securityParameters.Clear(); + } + } + + internal virtual void AbortClientHandshake(ClientHandshakeState state, DtlsRecordLayer recordLayer, byte alertDescription) + { + recordLayer.Fail(alertDescription); + InvalidateSession(state); + } + + internal virtual DtlsTransport ClientHandshake(ClientHandshakeState state, DtlsRecordLayer recordLayer) + { + SecurityParameters securityParameters = state.clientContext.SecurityParameters; + DtlsReliableHandshake handshake = new DtlsReliableHandshake(state.clientContext, recordLayer); + + byte[] clientHelloBody = GenerateClientHello(state, state.client); + + recordLayer.SetWriteVersion(ProtocolVersion.DTLSv10); + + handshake.SendMessage(HandshakeType.client_hello, clientHelloBody); + + DtlsReliableHandshake.Message serverMessage = handshake.ReceiveMessage(); + + while (serverMessage.Type == HandshakeType.hello_verify_request) + { + ProtocolVersion recordLayerVersion = recordLayer.ReadVersion; + ProtocolVersion client_version = state.clientContext.ClientVersion; + + /* + * RFC 6347 4.2.1 DTLS 1.2 server implementations SHOULD use DTLS version 1.0 regardless of + * the version of TLS that is expected to be negotiated. DTLS 1.2 and 1.0 clients MUST use + * the version solely to indicate packet formatting (which is the same in both DTLS 1.2 and + * 1.0) and not as part of version negotiation. + */ + if (!recordLayerVersion.IsEqualOrEarlierVersionOf(client_version)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + recordLayer.ReadVersion = null; + + byte[] cookie = ProcessHelloVerifyRequest(state, serverMessage.Body); + byte[] patched = PatchClientHelloWithCookie(clientHelloBody, cookie); + + handshake.ResetHandshakeMessagesDigest(); + handshake.SendMessage(HandshakeType.client_hello, patched); + + serverMessage = handshake.ReceiveMessage(); + } + + if (serverMessage.Type == HandshakeType.server_hello) + { + ProtocolVersion recordLayerVersion = recordLayer.ReadVersion; + ReportServerVersion(state, recordLayerVersion); + recordLayer.SetWriteVersion(recordLayerVersion); + + ProcessServerHello(state, serverMessage.Body); + } + else + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + handshake.NotifyHelloComplete(); + + ApplyMaxFragmentLengthExtension(recordLayer, securityParameters.maxFragmentLength); + + if (state.resumedSession) + { + securityParameters.masterSecret = Arrays.Clone(state.sessionParameters.MasterSecret); + recordLayer.InitPendingEpoch(state.client.GetCipher()); + + // NOTE: Calculated exclusive of the actual Finished message from the server + byte[] resExpectedServerVerifyData = TlsUtilities.CalculateVerifyData(state.clientContext, ExporterLabel.server_finished, + TlsProtocol.GetCurrentPrfHash(state.clientContext, handshake.HandshakeHash, null)); + ProcessFinished(handshake.ReceiveMessageBody(HandshakeType.finished), resExpectedServerVerifyData); + + // NOTE: Calculated exclusive of the Finished message itself + byte[] resClientVerifyData = TlsUtilities.CalculateVerifyData(state.clientContext, ExporterLabel.client_finished, + TlsProtocol.GetCurrentPrfHash(state.clientContext, handshake.HandshakeHash, null)); + handshake.SendMessage(HandshakeType.finished, resClientVerifyData); + + handshake.Finish(); + + state.clientContext.SetResumableSession(state.tlsSession); + + state.client.NotifyHandshakeComplete(); + + return new DtlsTransport(recordLayer); + } + + InvalidateSession(state); + + if (state.selectedSessionID.Length > 0) + { + state.tlsSession = new TlsSessionImpl(state.selectedSessionID, null); + } + + serverMessage = handshake.ReceiveMessage(); + + if (serverMessage.Type == HandshakeType.supplemental_data) + { + ProcessServerSupplementalData(state, serverMessage.Body); + serverMessage = handshake.ReceiveMessage(); + } + else + { + state.client.ProcessServerSupplementalData(null); + } + + state.keyExchange = state.client.GetKeyExchange(); + state.keyExchange.Init(state.clientContext); + + Certificate serverCertificate = null; + + if (serverMessage.Type == HandshakeType.certificate) + { + serverCertificate = ProcessServerCertificate(state, serverMessage.Body); + serverMessage = handshake.ReceiveMessage(); + } + else + { + // Okay, Certificate is optional + state.keyExchange.SkipServerCredentials(); + } + + // TODO[RFC 3546] Check whether empty certificates is possible, allowed, or excludes CertificateStatus + if (serverCertificate == null || serverCertificate.IsEmpty) + { + state.allowCertificateStatus = false; + } + + if (serverMessage.Type == HandshakeType.certificate_status) + { + ProcessCertificateStatus(state, serverMessage.Body); + serverMessage = handshake.ReceiveMessage(); + } + else + { + // Okay, CertificateStatus is optional + } + + if (serverMessage.Type == HandshakeType.server_key_exchange) + { + ProcessServerKeyExchange(state, serverMessage.Body); + serverMessage = handshake.ReceiveMessage(); + } + else + { + // Okay, ServerKeyExchange is optional + state.keyExchange.SkipServerKeyExchange(); + } + + if (serverMessage.Type == HandshakeType.certificate_request) + { + ProcessCertificateRequest(state, serverMessage.Body); + + /* + * TODO Give the client a chance to immediately select the CertificateVerify hash + * algorithm here to avoid tracking the other hash algorithms unnecessarily? + */ + TlsUtilities.TrackHashAlgorithms(handshake.HandshakeHash, + state.certificateRequest.SupportedSignatureAlgorithms); + + serverMessage = handshake.ReceiveMessage(); + } + else + { + // Okay, CertificateRequest is optional + } + + if (serverMessage.Type == HandshakeType.server_hello_done) + { + if (serverMessage.Body.Length != 0) + { + throw new TlsFatalAlert(AlertDescription.decode_error); + } + } + else + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + handshake.HandshakeHash.SealHashAlgorithms(); + + IList clientSupplementalData = state.client.GetClientSupplementalData(); + if (clientSupplementalData != null) + { + byte[] supplementalDataBody = GenerateSupplementalData(clientSupplementalData); + handshake.SendMessage(HandshakeType.supplemental_data, supplementalDataBody); + } + + if (state.certificateRequest != null) + { + state.clientCredentials = state.authentication.GetClientCredentials(state.clientContext, state.certificateRequest); + + /* + * RFC 5246 If no suitable certificate is available, the client MUST send a certificate + * message containing no certificates. + * + * NOTE: In previous RFCs, this was SHOULD instead of MUST. + */ + Certificate clientCertificate = null; + if (state.clientCredentials != null) + { + clientCertificate = state.clientCredentials.Certificate; + } + if (clientCertificate == null) + { + clientCertificate = Certificate.EmptyChain; + } + + byte[] certificateBody = GenerateCertificate(clientCertificate); + handshake.SendMessage(HandshakeType.certificate, certificateBody); + } + + if (state.clientCredentials != null) + { + state.keyExchange.ProcessClientCredentials(state.clientCredentials); + } + else + { + state.keyExchange.SkipClientCredentials(); + } + + byte[] clientKeyExchangeBody = GenerateClientKeyExchange(state); + handshake.SendMessage(HandshakeType.client_key_exchange, clientKeyExchangeBody); + + TlsHandshakeHash prepareFinishHash = handshake.PrepareToFinish(); + securityParameters.sessionHash = TlsProtocol.GetCurrentPrfHash(state.clientContext, prepareFinishHash, null); + + TlsProtocol.EstablishMasterSecret(state.clientContext, state.keyExchange); + recordLayer.InitPendingEpoch(state.client.GetCipher()); + + if (state.clientCredentials != null && state.clientCredentials is TlsSignerCredentials) + { + TlsSignerCredentials signerCredentials = (TlsSignerCredentials)state.clientCredentials; + + /* + * RFC 5246 4.7. digitally-signed element needs SignatureAndHashAlgorithm from TLS 1.2 + */ + SignatureAndHashAlgorithm signatureAndHashAlgorithm = TlsUtilities.GetSignatureAndHashAlgorithm( + state.clientContext, signerCredentials); + + byte[] hash; + if (signatureAndHashAlgorithm == null) + { + hash = securityParameters.SessionHash; + } + else + { + hash = prepareFinishHash.GetFinalHash(signatureAndHashAlgorithm.Hash); + } + + byte[] signature = signerCredentials.GenerateCertificateSignature(hash); + DigitallySigned certificateVerify = new DigitallySigned(signatureAndHashAlgorithm, signature); + byte[] certificateVerifyBody = GenerateCertificateVerify(state, certificateVerify); + handshake.SendMessage(HandshakeType.certificate_verify, certificateVerifyBody); + } + + // NOTE: Calculated exclusive of the Finished message itself + byte[] clientVerifyData = TlsUtilities.CalculateVerifyData(state.clientContext, ExporterLabel.client_finished, + TlsProtocol.GetCurrentPrfHash(state.clientContext, handshake.HandshakeHash, null)); + handshake.SendMessage(HandshakeType.finished, clientVerifyData); + + if (state.expectSessionTicket) + { + serverMessage = handshake.ReceiveMessage(); + if (serverMessage.Type == HandshakeType.session_ticket) + { + ProcessNewSessionTicket(state, serverMessage.Body); + } + else + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + } + + // NOTE: Calculated exclusive of the actual Finished message from the server + byte[] expectedServerVerifyData = TlsUtilities.CalculateVerifyData(state.clientContext, ExporterLabel.server_finished, + TlsProtocol.GetCurrentPrfHash(state.clientContext, handshake.HandshakeHash, null)); + ProcessFinished(handshake.ReceiveMessageBody(HandshakeType.finished), expectedServerVerifyData); + + handshake.Finish(); + + if (state.tlsSession != null) + { + state.sessionParameters = new SessionParameters.Builder() + .SetCipherSuite(securityParameters.CipherSuite) + .SetCompressionAlgorithm(securityParameters.CompressionAlgorithm) + .SetExtendedMasterSecret(securityParameters.IsExtendedMasterSecret) + .SetMasterSecret(securityParameters.MasterSecret) + .SetPeerCertificate(serverCertificate) + .SetPskIdentity(securityParameters.PskIdentity) + .SetSrpIdentity(securityParameters.SrpIdentity) + // TODO Consider filtering extensions that aren't relevant to resumed sessions + .SetServerExtensions(state.serverExtensions) + .Build(); + + state.tlsSession = TlsUtilities.ImportSession(state.tlsSession.SessionID, state.sessionParameters); + + state.clientContext.SetResumableSession(state.tlsSession); + } + + state.client.NotifyHandshakeComplete(); + + return new DtlsTransport(recordLayer); + } + + protected virtual byte[] GenerateCertificateVerify(ClientHandshakeState state, DigitallySigned certificateVerify) + { + MemoryStream buf = new MemoryStream(); + certificateVerify.Encode(buf); + return buf.ToArray(); + } + + protected virtual byte[] GenerateClientHello(ClientHandshakeState state, TlsClient client) + { + ProtocolVersion client_version = client.ClientVersion; + if (!client_version.IsDtls) + throw new TlsFatalAlert(AlertDescription.internal_error); + + TlsClientContextImpl context = state.clientContext; + + context.SetClientVersion(client_version); + + SecurityParameters securityParameters = context.SecurityParameters; + + // Session ID + byte[] session_id = TlsUtilities.EmptyBytes; + if (state.tlsSession != null) + { + session_id = state.tlsSession.SessionID; + if (session_id == null || session_id.Length > 32) + { + session_id = TlsUtilities.EmptyBytes; + } + } + + bool fallback = client.IsFallback; + + state.offeredCipherSuites = client.GetCipherSuites(); + + if (session_id.Length > 0 && state.sessionParameters != null) + { + if (!state.sessionParameters.IsExtendedMasterSecret + || !Arrays.Contains(state.offeredCipherSuites, state.sessionParameters.CipherSuite) + || CompressionMethod.cls_null != state.sessionParameters.CompressionAlgorithm) + { + session_id = TlsUtilities.EmptyBytes; + } + } + + state.clientExtensions = TlsExtensionsUtilities.EnsureExtensionsInitialised(client.GetClientExtensions()); + + TlsExtensionsUtilities.AddExtendedMasterSecretExtension(state.clientExtensions); + + MemoryStream buf = new MemoryStream(); + + TlsUtilities.WriteVersion(client_version, buf); + + buf.Write(securityParameters.ClientRandom, 0, securityParameters.ClientRandom.Length); + + TlsUtilities.WriteOpaque8(session_id, buf); + + // Cookie + TlsUtilities.WriteOpaque8(TlsUtilities.EmptyBytes, buf); + + // Cipher Suites (and SCSV) + { + /* + * RFC 5746 3.4. The client MUST include either an empty "renegotiation_info" extension, + * or the TLS_EMPTY_RENEGOTIATION_INFO_SCSV signaling cipher suite value in the + * ClientHello. Including both is NOT RECOMMENDED. + */ + byte[] renegExtData = TlsUtilities.GetExtensionData(state.clientExtensions, ExtensionType.renegotiation_info); + bool noRenegExt = (null == renegExtData); + + bool noRenegSCSV = !Arrays.Contains(state.offeredCipherSuites, CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV); + + if (noRenegExt && noRenegSCSV) + { + // TODO Consider whether to default to a client extension instead + state.offeredCipherSuites = Arrays.Append(state.offeredCipherSuites, CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV); + } + + /* + * RFC 7507 4. If a client sends a ClientHello.client_version containing a lower value + * than the latest (highest-valued) version supported by the client, it SHOULD include + * the TLS_FALLBACK_SCSV cipher suite value in ClientHello.cipher_suites [..]. (The + * client SHOULD put TLS_FALLBACK_SCSV after all cipher suites that it actually intends + * to negotiate.) + */ + if (fallback && !Arrays.Contains(state.offeredCipherSuites, CipherSuite.TLS_FALLBACK_SCSV)) + { + state.offeredCipherSuites = Arrays.Append(state.offeredCipherSuites, CipherSuite.TLS_FALLBACK_SCSV); + } + + TlsUtilities.WriteUint16ArrayWithUint16Length(state.offeredCipherSuites, buf); + } + + TlsUtilities.WriteUint8ArrayWithUint8Length(new byte[]{ CompressionMethod.cls_null }, buf); + + TlsProtocol.WriteExtensions(buf, state.clientExtensions); + + return buf.ToArray(); + } + + protected virtual byte[] GenerateClientKeyExchange(ClientHandshakeState state) + { + MemoryStream buf = new MemoryStream(); + state.keyExchange.GenerateClientKeyExchange(buf); + return buf.ToArray(); + } + + protected virtual void InvalidateSession(ClientHandshakeState state) + { + if (state.sessionParameters != null) + { + state.sessionParameters.Clear(); + state.sessionParameters = null; + } + + if (state.tlsSession != null) + { + state.tlsSession.Invalidate(); + state.tlsSession = null; + } + } + + protected virtual void ProcessCertificateRequest(ClientHandshakeState state, byte[] body) + { + if (state.authentication == null) + { + /* + * RFC 2246 7.4.4. It is a fatal handshake_failure alert for an anonymous server to + * request client identification. + */ + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + + MemoryStream buf = new MemoryStream(body, false); + + state.certificateRequest = CertificateRequest.Parse(state.clientContext, buf); + + TlsProtocol.AssertEmpty(buf); + + state.keyExchange.ValidateCertificateRequest(state.certificateRequest); + } + + protected virtual void ProcessCertificateStatus(ClientHandshakeState state, byte[] body) + { + if (!state.allowCertificateStatus) + { + /* + * RFC 3546 3.6. If a server returns a "CertificateStatus" message, then the + * server MUST have included an extension of type "status_request" with empty + * "extension_data" in the extended server hello.. + */ + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + MemoryStream buf = new MemoryStream(body, false); + + state.certificateStatus = CertificateStatus.Parse(buf); + + TlsProtocol.AssertEmpty(buf); + + // TODO[RFC 3546] Figure out how to provide this to the client/authentication. + } + + protected virtual byte[] ProcessHelloVerifyRequest(ClientHandshakeState state, byte[] body) + { + MemoryStream buf = new MemoryStream(body, false); + + ProtocolVersion server_version = TlsUtilities.ReadVersion(buf); + byte[] cookie = TlsUtilities.ReadOpaque8(buf); + + TlsProtocol.AssertEmpty(buf); + + // TODO Seems this behaviour is not yet in line with OpenSSL for DTLS 1.2 + // reportServerVersion(state, server_version); + if (!server_version.IsEqualOrEarlierVersionOf(state.clientContext.ClientVersion)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + /* + * RFC 6347 This specification increases the cookie size limit to 255 bytes for greater + * future flexibility. The limit remains 32 for previous versions of DTLS. + */ + if (!ProtocolVersion.DTLSv12.IsEqualOrEarlierVersionOf(server_version) && cookie.Length > 32) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + return cookie; + } + + protected virtual void ProcessNewSessionTicket(ClientHandshakeState state, byte[] body) + { + MemoryStream buf = new MemoryStream(body, false); + + NewSessionTicket newSessionTicket = NewSessionTicket.Parse(buf); + + TlsProtocol.AssertEmpty(buf); + + state.client.NotifyNewSessionTicket(newSessionTicket); + } + + protected virtual Certificate ProcessServerCertificate(ClientHandshakeState state, byte[] body) + { + MemoryStream buf = new MemoryStream(body, false); + + Certificate serverCertificate = Certificate.Parse(buf); + + TlsProtocol.AssertEmpty(buf); + + state.keyExchange.ProcessServerCertificate(serverCertificate); + state.authentication = state.client.GetAuthentication(); + state.authentication.NotifyServerCertificate(serverCertificate); + + return serverCertificate; + } + + protected virtual void ProcessServerHello(ClientHandshakeState state, byte[] body) + { + SecurityParameters securityParameters = state.clientContext.SecurityParameters; + + MemoryStream buf = new MemoryStream(body, false); + + { + ProtocolVersion server_version = TlsUtilities.ReadVersion(buf); + ReportServerVersion(state, server_version); + } + + securityParameters.serverRandom = TlsUtilities.ReadFully(32, buf); + + state.selectedSessionID = TlsUtilities.ReadOpaque8(buf); + if (state.selectedSessionID.Length > 32) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + state.client.NotifySessionID(state.selectedSessionID); + state.resumedSession = state.selectedSessionID.Length > 0 && state.tlsSession != null + && Arrays.AreEqual(state.selectedSessionID, state.tlsSession.SessionID); + + int selectedCipherSuite = TlsUtilities.ReadUint16(buf); + if (!Arrays.Contains(state.offeredCipherSuites, selectedCipherSuite) + || selectedCipherSuite == CipherSuite.TLS_NULL_WITH_NULL_NULL + || CipherSuite.IsScsv(selectedCipherSuite) + || !TlsUtilities.IsValidCipherSuiteForVersion(selectedCipherSuite, state.clientContext.ServerVersion)) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + ValidateSelectedCipherSuite(selectedCipherSuite, AlertDescription.illegal_parameter); + state.client.NotifySelectedCipherSuite(selectedCipherSuite); + + byte selectedCompressionMethod = TlsUtilities.ReadUint8(buf); + if (CompressionMethod.cls_null != selectedCompressionMethod) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + state.client.NotifySelectedCompressionMethod(selectedCompressionMethod); + + /* + * RFC3546 2.2 The extended server hello message format MAY be sent in place of the server + * hello message when the client has requested extended functionality via the extended + * client hello message specified in Section 2.1. ... Note that the extended server hello + * message is only sent in response to an extended client hello message. This prevents the + * possibility that the extended server hello message could "break" existing TLS 1.0 + * clients. + */ + + /* + * TODO RFC 3546 2.3 If [...] the older session is resumed, then the server MUST ignore + * extensions appearing in the client hello, and send a server hello containing no + * extensions. + */ + + // Integer -> byte[] + state.serverExtensions = TlsProtocol.ReadExtensions(buf); + + /* + * RFC 7627 4. Clients and servers SHOULD NOT accept handshakes that do not use the extended + * master secret [..]. (and see 5.2, 5.3) + */ + securityParameters.extendedMasterSecret = TlsExtensionsUtilities.HasExtendedMasterSecretExtension(state.serverExtensions); + + if (!securityParameters.IsExtendedMasterSecret + && (state.resumedSession || state.client.RequiresExtendedMasterSecret())) + { + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + + /* + * RFC 3546 2.2 Note that the extended server hello message is only sent in response to an + * extended client hello message. However, see RFC 5746 exception below. We always include + * the SCSV, so an Extended Server Hello is always allowed. + */ + if (state.serverExtensions != null) + { + foreach (int extType in state.serverExtensions.Keys) + { + /* + * RFC 5746 3.6. Note that sending a "renegotiation_info" extension in response to a + * ClientHello containing only the SCSV is an explicit exception to the prohibition + * in RFC 5246, Section 7.4.1.4, on the server sending unsolicited extensions and is + * only allowed because the client is signaling its willingness to receive the + * extension via the TLS_EMPTY_RENEGOTIATION_INFO_SCSV SCSV. + */ + if (extType == ExtensionType.renegotiation_info) + continue; + + /* + * RFC 5246 7.4.1.4 An extension type MUST NOT appear in the ServerHello unless the + * same extension type appeared in the corresponding ClientHello. If a client + * receives an extension type in ServerHello that it did not request in the + * associated ClientHello, it MUST abort the handshake with an unsupported_extension + * fatal alert. + */ + if (null == TlsUtilities.GetExtensionData(state.clientExtensions, extType)) + throw new TlsFatalAlert(AlertDescription.unsupported_extension); + + /* + * RFC 3546 2.3. If [...] the older session is resumed, then the server MUST ignore + * extensions appearing in the client hello, and send a server hello containing no + * extensions[.] + */ + if (state.resumedSession) + { + // TODO[compat-gnutls] GnuTLS test server sends server extensions e.g. ec_point_formats + // TODO[compat-openssl] OpenSSL test server sends server extensions e.g. ec_point_formats + // TODO[compat-polarssl] PolarSSL test server sends server extensions e.g. ec_point_formats + //throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + } + + /* + * RFC 5746 3.4. Client Behavior: Initial Handshake + */ + { + /* + * When a ServerHello is received, the client MUST check if it includes the + * "renegotiation_info" extension: + */ + byte[] renegExtData = TlsUtilities.GetExtensionData(state.serverExtensions, ExtensionType.renegotiation_info); + if (renegExtData != null) + { + /* + * If the extension is present, set the secure_renegotiation flag to TRUE. The + * client MUST then verify that the length of the "renegotiated_connection" + * field is zero, and if it is not, MUST abort the handshake (by sending a fatal + * handshake_failure alert). + */ + state.secure_renegotiation = true; + + if (!Arrays.ConstantTimeAreEqual(renegExtData, TlsProtocol.CreateRenegotiationInfo(TlsUtilities.EmptyBytes))) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + } + + // TODO[compat-gnutls] GnuTLS test server fails to send renegotiation_info extension when resuming + state.client.NotifySecureRenegotiation(state.secure_renegotiation); + + IDictionary sessionClientExtensions = state.clientExtensions, sessionServerExtensions = state.serverExtensions; + if (state.resumedSession) + { + if (selectedCipherSuite != state.sessionParameters.CipherSuite + || selectedCompressionMethod != state.sessionParameters.CompressionAlgorithm) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + sessionClientExtensions = null; + sessionServerExtensions = state.sessionParameters.ReadServerExtensions(); + } + + securityParameters.cipherSuite = selectedCipherSuite; + securityParameters.compressionAlgorithm = selectedCompressionMethod; + + if (sessionServerExtensions != null && sessionServerExtensions.Count > 0) + { + { + /* + * RFC 7366 3. If a server receives an encrypt-then-MAC request extension from a client + * and then selects a stream or Authenticated Encryption with Associated Data (AEAD) + * ciphersuite, it MUST NOT send an encrypt-then-MAC response extension back to the + * client. + */ + bool serverSentEncryptThenMAC = TlsExtensionsUtilities.HasEncryptThenMacExtension(sessionServerExtensions); + if (serverSentEncryptThenMAC && !TlsUtilities.IsBlockCipherSuite(securityParameters.CipherSuite)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + securityParameters.encryptThenMac = serverSentEncryptThenMAC; + } + + securityParameters.maxFragmentLength = EvaluateMaxFragmentLengthExtension(state.resumedSession, + sessionClientExtensions, sessionServerExtensions, AlertDescription.illegal_parameter); + + securityParameters.truncatedHMac = TlsExtensionsUtilities.HasTruncatedHMacExtension(sessionServerExtensions); + + /* + * TODO It's surprising that there's no provision to allow a 'fresh' CertificateStatus to be + * sent in a session resumption handshake. + */ + state.allowCertificateStatus = !state.resumedSession + && TlsUtilities.HasExpectedEmptyExtensionData(sessionServerExtensions, ExtensionType.status_request, + AlertDescription.illegal_parameter); + + state.expectSessionTicket = !state.resumedSession + && TlsUtilities.HasExpectedEmptyExtensionData(sessionServerExtensions, ExtensionType.session_ticket, + AlertDescription.illegal_parameter); + } + + if (sessionClientExtensions != null) + { + state.client.ProcessServerExtensions(sessionServerExtensions); + } + + securityParameters.prfAlgorithm = TlsProtocol.GetPrfAlgorithm(state.clientContext, + securityParameters.CipherSuite); + + /* + * RFC 5246 7.4.9. Any cipher suite which does not explicitly specify verify_data_length has + * a verify_data_length equal to 12. This includes all existing cipher suites. + */ + securityParameters.verifyDataLength = 12; + } + + protected virtual void ProcessServerKeyExchange(ClientHandshakeState state, byte[] body) + { + MemoryStream buf = new MemoryStream(body, false); + + state.keyExchange.ProcessServerKeyExchange(buf); + + TlsProtocol.AssertEmpty(buf); + } + + protected virtual void ProcessServerSupplementalData(ClientHandshakeState state, byte[] body) + { + MemoryStream buf = new MemoryStream(body, false); + IList serverSupplementalData = TlsProtocol.ReadSupplementalDataMessage(buf); + state.client.ProcessServerSupplementalData(serverSupplementalData); + } + + protected virtual void ReportServerVersion(ClientHandshakeState state, ProtocolVersion server_version) + { + TlsClientContextImpl clientContext = state.clientContext; + ProtocolVersion currentServerVersion = clientContext.ServerVersion; + if (null == currentServerVersion) + { + clientContext.SetServerVersion(server_version); + state.client.NotifyServerVersion(server_version); + } + else if (!currentServerVersion.Equals(server_version)) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + + protected static byte[] PatchClientHelloWithCookie(byte[] clientHelloBody, byte[] cookie) + { + int sessionIDPos = 34; + int sessionIDLength = TlsUtilities.ReadUint8(clientHelloBody, sessionIDPos); + + int cookieLengthPos = sessionIDPos + 1 + sessionIDLength; + int cookiePos = cookieLengthPos + 1; + + byte[] patched = new byte[clientHelloBody.Length + cookie.Length]; + Array.Copy(clientHelloBody, 0, patched, 0, cookieLengthPos); + TlsUtilities.CheckUint8(cookie.Length); + TlsUtilities.WriteUint8((byte)cookie.Length, patched, cookieLengthPos); + Array.Copy(cookie, 0, patched, cookiePos, cookie.Length); + Array.Copy(clientHelloBody, cookiePos, patched, cookiePos + cookie.Length, clientHelloBody.Length - cookiePos); + + return patched; + } + + protected internal class ClientHandshakeState + { + internal TlsClient client = null; + internal TlsClientContextImpl clientContext = null; + internal TlsSession tlsSession = null; + internal SessionParameters sessionParameters = null; + internal SessionParameters.Builder sessionParametersBuilder = null; + internal int[] offeredCipherSuites = null; + internal IDictionary clientExtensions = null; + internal IDictionary serverExtensions = null; + internal byte[] selectedSessionID = null; + internal bool resumedSession = false; + internal bool secure_renegotiation = false; + internal bool allowCertificateStatus = false; + internal bool expectSessionTicket = false; + internal TlsKeyExchange keyExchange = null; + internal TlsAuthentication authentication = null; + internal CertificateStatus certificateStatus = null; + internal CertificateRequest certificateRequest = null; + internal TlsCredentials clientCredentials = null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsClientProtocol.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsClientProtocol.cs.meta new file mode 100644 index 00000000..cda7f4cc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsClientProtocol.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8220ec2d4ff39f45892bc0ecd72000a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsEpoch.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsEpoch.cs new file mode 100644 index 00000000..8d0c704d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsEpoch.cs @@ -0,0 +1,55 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal class DtlsEpoch + { + private readonly DtlsReplayWindow mReplayWindow = new DtlsReplayWindow(); + + private readonly int mEpoch; + private readonly TlsCipher mCipher; + + private long mSequenceNumber = 0; + + internal DtlsEpoch(int epoch, TlsCipher cipher) + { + if (epoch < 0) + throw new ArgumentException("must be >= 0", "epoch"); + if (cipher == null) + throw new ArgumentNullException("cipher"); + + this.mEpoch = epoch; + this.mCipher = cipher; + } + + internal long AllocateSequenceNumber() + { + // TODO Check for overflow + return mSequenceNumber++; + } + + internal TlsCipher Cipher + { + get { return mCipher; } + } + + internal int Epoch + { + get { return mEpoch; } + } + + internal DtlsReplayWindow ReplayWindow + { + get { return mReplayWindow; } + } + + internal long SequenceNumber + { + get { return mSequenceNumber; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsEpoch.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsEpoch.cs.meta new file mode 100644 index 00000000..edeaf416 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsEpoch.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 406494e56abd4874f9ba7be77592018c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsHandshakeRetransmit.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsHandshakeRetransmit.cs new file mode 100644 index 00000000..2aa31872 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsHandshakeRetransmit.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + interface DtlsHandshakeRetransmit + { + /// + void ReceivedHandshakeRecord(int epoch, byte[] buf, int off, int len); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsHandshakeRetransmit.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsHandshakeRetransmit.cs.meta new file mode 100644 index 00000000..ab305074 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsHandshakeRetransmit.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6b758dd8554047646998a0f670e7e2f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsProtocol.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsProtocol.cs new file mode 100644 index 00000000..2d156d24 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsProtocol.cs @@ -0,0 +1,96 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class DtlsProtocol + { + protected readonly SecureRandom mSecureRandom; + + protected DtlsProtocol(SecureRandom secureRandom) + { + if (secureRandom == null) + throw new ArgumentNullException("secureRandom"); + + this.mSecureRandom = secureRandom; + } + + /// + protected virtual void ProcessFinished(byte[] body, byte[] expected_verify_data) + { + MemoryStream buf = new MemoryStream(body, false); + + byte[] verify_data = TlsUtilities.ReadFully(expected_verify_data.Length, buf); + + TlsProtocol.AssertEmpty(buf); + + if (!Arrays.ConstantTimeAreEqual(expected_verify_data, verify_data)) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + + /// + internal static void ApplyMaxFragmentLengthExtension(DtlsRecordLayer recordLayer, short maxFragmentLength) + { + if (maxFragmentLength >= 0) + { + if (!MaxFragmentLength.IsValid((byte)maxFragmentLength)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + int plainTextLimit = 1 << (8 + maxFragmentLength); + recordLayer.SetPlaintextLimit(plainTextLimit); + } + } + + /// + protected static short EvaluateMaxFragmentLengthExtension(bool resumedSession, IDictionary clientExtensions, + IDictionary serverExtensions, byte alertDescription) + { + short maxFragmentLength = TlsExtensionsUtilities.GetMaxFragmentLengthExtension(serverExtensions); + if (maxFragmentLength >= 0) + { + if (!MaxFragmentLength.IsValid((byte)maxFragmentLength) + || (!resumedSession && maxFragmentLength != TlsExtensionsUtilities + .GetMaxFragmentLengthExtension(clientExtensions))) + { + throw new TlsFatalAlert(alertDescription); + } + } + return maxFragmentLength; + } + + /// + protected static byte[] GenerateCertificate(Certificate certificate) + { + MemoryStream buf = new MemoryStream(); + certificate.Encode(buf); + return buf.ToArray(); + } + + /// + protected static byte[] GenerateSupplementalData(IList supplementalData) + { + MemoryStream buf = new MemoryStream(); + TlsProtocol.WriteSupplementalData(buf, supplementalData); + return buf.ToArray(); + } + + /// + protected static void ValidateSelectedCipherSuite(int selectedCipherSuite, byte alertDescription) + { + switch (TlsUtilities.GetEncryptionAlgorithm(selectedCipherSuite)) + { + case EncryptionAlgorithm.RC4_40: + case EncryptionAlgorithm.RC4_128: + throw new TlsFatalAlert(alertDescription); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsProtocol.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsProtocol.cs.meta new file mode 100644 index 00000000..7caba458 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsProtocol.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5d00951d0e07324997241ccf1698252 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReassembler.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReassembler.cs new file mode 100644 index 00000000..5a6aef31 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReassembler.cs @@ -0,0 +1,129 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + class DtlsReassembler + { + private readonly byte mMsgType; + private readonly byte[] mBody; + + private readonly IList mMissing = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + internal DtlsReassembler(byte msg_type, int length) + { + this.mMsgType = msg_type; + this.mBody = new byte[length]; + this.mMissing.Add(new Range(0, length)); + } + + internal byte MsgType + { + get { return mMsgType; } + } + + internal byte[] GetBodyIfComplete() + { + return mMissing.Count == 0 ? mBody : null; + } + + internal void ContributeFragment(byte msg_type, int length, byte[] buf, int off, int fragment_offset, + int fragment_length) + { + int fragment_end = fragment_offset + fragment_length; + + if (this.mMsgType != msg_type || this.mBody.Length != length || fragment_end > length) + { + return; + } + + if (fragment_length == 0) + { + // NOTE: Empty messages still require an empty fragment to complete it + if (fragment_offset == 0 && mMissing.Count > 0) + { + Range firstRange = (Range)mMissing[0]; + if (firstRange.End == 0) + { + mMissing.RemoveAt(0); + } + } + return; + } + + for (int i = 0; i < mMissing.Count; ++i) + { + Range range = (Range)mMissing[i]; + if (range.Start >= fragment_end) + { + break; + } + if (range.End > fragment_offset) + { + + int copyStart = System.Math.Max(range.Start, fragment_offset); + int copyEnd = System.Math.Min(range.End, fragment_end); + int copyLength = copyEnd - copyStart; + + Array.Copy(buf, off + copyStart - fragment_offset, mBody, copyStart, + copyLength); + + if (copyStart == range.Start) + { + if (copyEnd == range.End) + { + mMissing.RemoveAt(i--); + } + else + { + range.Start = copyEnd; + } + } + else + { + if (copyEnd != range.End) + { + mMissing.Insert(++i, new Range(copyEnd, range.End)); + } + range.End = copyStart; + } + } + } + } + + internal void Reset() + { + this.mMissing.Clear(); + this.mMissing.Add(new Range(0, mBody.Length)); + } + + private class Range + { + private int mStart, mEnd; + + internal Range(int start, int end) + { + this.mStart = start; + this.mEnd = end; + } + + public int Start + { + get { return mStart; } + set { this.mStart = value; } + } + + public int End + { + get { return mEnd; } + set { this.mEnd = value; } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReassembler.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReassembler.cs.meta new file mode 100644 index 00000000..e5acf2df --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReassembler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4e2ce3711606aff43ad5a1652d5e7a90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsRecordLayer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsRecordLayer.cs new file mode 100644 index 00000000..b97dd18c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsRecordLayer.cs @@ -0,0 +1,534 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal class DtlsRecordLayer + : DatagramTransport + { + private const int RECORD_HEADER_LENGTH = 13; + private const int MAX_FRAGMENT_LENGTH = 1 << 14; + private const long TCP_MSL = 1000L * 60 * 2; + private const long RETRANSMIT_TIMEOUT = TCP_MSL * 2; + + private readonly DatagramTransport mTransport; + private readonly TlsContext mContext; + private readonly TlsPeer mPeer; + + private readonly ByteQueue mRecordQueue = new ByteQueue(); + + private volatile bool mClosed = false; + private volatile bool mFailed = false; + private volatile ProtocolVersion mReadVersion = null, mWriteVersion = null; + private volatile bool mInHandshake; + private volatile int mPlaintextLimit; + private DtlsEpoch mCurrentEpoch, mPendingEpoch; + private DtlsEpoch mReadEpoch, mWriteEpoch; + + private DtlsHandshakeRetransmit mRetransmit = null; + private DtlsEpoch mRetransmitEpoch = null; + private long mRetransmitExpiry = 0; + + internal DtlsRecordLayer(DatagramTransport transport, TlsContext context, TlsPeer peer, byte contentType) + { + this.mTransport = transport; + this.mContext = context; + this.mPeer = peer; + + this.mInHandshake = true; + + this.mCurrentEpoch = new DtlsEpoch(0, new TlsNullCipher(context)); + this.mPendingEpoch = null; + this.mReadEpoch = mCurrentEpoch; + this.mWriteEpoch = mCurrentEpoch; + + SetPlaintextLimit(MAX_FRAGMENT_LENGTH); + } + + internal virtual void SetPlaintextLimit(int plaintextLimit) + { + this.mPlaintextLimit = plaintextLimit; + } + + internal virtual int ReadEpoch + { + get { return mReadEpoch.Epoch; } + } + + internal virtual ProtocolVersion ReadVersion + { + get { return mReadVersion; } + set { this.mReadVersion = value; } + } + + internal virtual void SetWriteVersion(ProtocolVersion writeVersion) + { + this.mWriteVersion = writeVersion; + } + + internal virtual void InitPendingEpoch(TlsCipher pendingCipher) + { + if (mPendingEpoch != null) + throw new InvalidOperationException(); + + /* + * TODO "In order to ensure that any given sequence/epoch pair is unique, implementations + * MUST NOT allow the same epoch value to be reused within two times the TCP maximum segment + * lifetime." + */ + + // TODO Check for overflow + this.mPendingEpoch = new DtlsEpoch(mWriteEpoch.Epoch + 1, pendingCipher); + } + + internal virtual void HandshakeSuccessful(DtlsHandshakeRetransmit retransmit) + { + if (mReadEpoch == mCurrentEpoch || mWriteEpoch == mCurrentEpoch) + { + // TODO + throw new InvalidOperationException(); + } + + if (retransmit != null) + { + this.mRetransmit = retransmit; + this.mRetransmitEpoch = mCurrentEpoch; + this.mRetransmitExpiry = DateTimeUtilities.CurrentUnixMs() + RETRANSMIT_TIMEOUT; + } + + this.mInHandshake = false; + this.mCurrentEpoch = mPendingEpoch; + this.mPendingEpoch = null; + } + + internal virtual void ResetWriteEpoch() + { + if (mRetransmitEpoch != null) + { + this.mWriteEpoch = mRetransmitEpoch; + } + else + { + this.mWriteEpoch = mCurrentEpoch; + } + } + + public virtual int GetReceiveLimit() + { + return System.Math.Min(this.mPlaintextLimit, + mReadEpoch.Cipher.GetPlaintextLimit(mTransport.GetReceiveLimit() - RECORD_HEADER_LENGTH)); + } + + public virtual int GetSendLimit() + { + return System.Math.Min(this.mPlaintextLimit, + mWriteEpoch.Cipher.GetPlaintextLimit(mTransport.GetSendLimit() - RECORD_HEADER_LENGTH)); + } + + public virtual int Receive(byte[] buf, int off, int len, int waitMillis) + { + byte[] record = null; + + for (;;) + { + int receiveLimit = System.Math.Min(len, GetReceiveLimit()) + RECORD_HEADER_LENGTH; + if (record == null || record.Length < receiveLimit) + { + record = new byte[receiveLimit]; + } + + try + { + if (mRetransmit != null && DateTimeUtilities.CurrentUnixMs() > mRetransmitExpiry) + { + mRetransmit = null; + mRetransmitEpoch = null; + } + + int received = ReceiveRecord(record, 0, receiveLimit, waitMillis); + if (received < 0) + { + return received; + } + if (received < RECORD_HEADER_LENGTH) + { + continue; + } + int length = TlsUtilities.ReadUint16(record, 11); + if (received != (length + RECORD_HEADER_LENGTH)) + { + continue; + } + + byte type = TlsUtilities.ReadUint8(record, 0); + + // TODO Support user-specified custom protocols? + switch (type) + { + case ContentType.alert: + case ContentType.application_data: + case ContentType.change_cipher_spec: + case ContentType.handshake: + case ContentType.heartbeat: + break; + default: + // TODO Exception? + continue; + } + + int epoch = TlsUtilities.ReadUint16(record, 3); + + DtlsEpoch recordEpoch = null; + if (epoch == mReadEpoch.Epoch) + { + recordEpoch = mReadEpoch; + } + else if (type == ContentType.handshake && mRetransmitEpoch != null + && epoch == mRetransmitEpoch.Epoch) + { + recordEpoch = mRetransmitEpoch; + } + + if (recordEpoch == null) + { + continue; + } + + long seq = TlsUtilities.ReadUint48(record, 5); + if (recordEpoch.ReplayWindow.ShouldDiscard(seq)) + { + continue; + } + + ProtocolVersion version = TlsUtilities.ReadVersion(record, 1); + if (!version.IsDtls) + { + continue; + } + + if (mReadVersion != null && !mReadVersion.Equals(version)) + { + continue; + } + + byte[] plaintext = recordEpoch.Cipher.DecodeCiphertext( + GetMacSequenceNumber(recordEpoch.Epoch, seq), type, record, RECORD_HEADER_LENGTH, + received - RECORD_HEADER_LENGTH); + + recordEpoch.ReplayWindow.ReportAuthenticated(seq); + + if (plaintext.Length > this.mPlaintextLimit) + { + continue; + } + + if (mReadVersion == null) + { + mReadVersion = version; + } + + switch (type) + { + case ContentType.alert: + { + if (plaintext.Length == 2) + { + byte alertLevel = plaintext[0]; + byte alertDescription = plaintext[1]; + + mPeer.NotifyAlertReceived(alertLevel, alertDescription); + + if (alertLevel == AlertLevel.fatal) + { + Failed(); + throw new TlsFatalAlert(alertDescription); + } + + // TODO Can close_notify be a fatal alert? + if (alertDescription == AlertDescription.close_notify) + { + CloseTransport(); + } + } + + continue; + } + case ContentType.application_data: + { + if (mInHandshake) + { + // TODO Consider buffering application data for new epoch that arrives + // out-of-order with the Finished message + continue; + } + break; + } + case ContentType.change_cipher_spec: + { + // Implicitly receive change_cipher_spec and change to pending cipher state + + for (int i = 0; i < plaintext.Length; ++i) + { + byte message = TlsUtilities.ReadUint8(plaintext, i); + if (message != ChangeCipherSpec.change_cipher_spec) + { + continue; + } + + if (mPendingEpoch != null) + { + mReadEpoch = mPendingEpoch; + } + } + + continue; + } + case ContentType.handshake: + { + if (!mInHandshake) + { + if (mRetransmit != null) + { + mRetransmit.ReceivedHandshakeRecord(epoch, plaintext, 0, plaintext.Length); + } + + // TODO Consider support for HelloRequest + continue; + } + break; + } + case ContentType.heartbeat: + { + // TODO[RFC 6520] + continue; + } + } + + /* + * NOTE: If we receive any non-handshake data in the new epoch implies the peer has + * received our final flight. + */ + if (!mInHandshake && mRetransmit != null) + { + this.mRetransmit = null; + this.mRetransmitEpoch = null; + } + + Array.Copy(plaintext, 0, buf, off, plaintext.Length); + return plaintext.Length; + } + catch (IOException e) + { + // NOTE: Assume this is a timeout for the moment + throw e; + } + } + } + + /// + public virtual void Send(byte[] buf, int off, int len) + { + byte contentType = ContentType.application_data; + + if (this.mInHandshake || this.mWriteEpoch == this.mRetransmitEpoch) + { + contentType = ContentType.handshake; + + byte handshakeType = TlsUtilities.ReadUint8(buf, off); + if (handshakeType == HandshakeType.finished) + { + DtlsEpoch nextEpoch = null; + if (this.mInHandshake) + { + nextEpoch = mPendingEpoch; + } + else if (this.mWriteEpoch == this.mRetransmitEpoch) + { + nextEpoch = mCurrentEpoch; + } + + if (nextEpoch == null) + { + // TODO + throw new InvalidOperationException(); + } + + // Implicitly send change_cipher_spec and change to pending cipher state + + // TODO Send change_cipher_spec and finished records in single datagram? + byte[] data = new byte[]{ 1 }; + SendRecord(ContentType.change_cipher_spec, data, 0, data.Length); + + mWriteEpoch = nextEpoch; + } + } + + SendRecord(contentType, buf, off, len); + } + + public virtual void Close() + { + if (!mClosed) + { + if (mInHandshake) + { + Warn(AlertDescription.user_canceled, "User canceled handshake"); + } + CloseTransport(); + } + } + + internal virtual void Failed() + { + if (!mClosed) + { + mFailed = true; + + CloseTransport(); + } + } + + internal virtual void Fail(byte alertDescription) + { + if (!mClosed) + { + try + { + RaiseAlert(AlertLevel.fatal, alertDescription, null, null); + } + catch (Exception) + { + // Ignore + } + + mFailed = true; + + CloseTransport(); + } + } + + internal virtual void Warn(byte alertDescription, string message) + { + RaiseAlert(AlertLevel.warning, alertDescription, message, null); + } + + private void CloseTransport() + { + if (!mClosed) + { + /* + * RFC 5246 7.2.1. Unless some other fatal alert has been transmitted, each party is + * required to send a close_notify alert before closing the write side of the + * connection. The other party MUST respond with a close_notify alert of its own and + * close down the connection immediately, discarding any pending writes. + */ + + try + { + if (!mFailed) + { + Warn(AlertDescription.close_notify, null); + } + mTransport.Close(); + } + catch (Exception) + { + // Ignore + } + + mClosed = true; + } + } + + private void RaiseAlert(byte alertLevel, byte alertDescription, string message, Exception cause) + { + mPeer.NotifyAlertRaised(alertLevel, alertDescription, message, cause); + + byte[] error = new byte[2]; + error[0] = (byte)alertLevel; + error[1] = (byte)alertDescription; + + SendRecord(ContentType.alert, error, 0, 2); + } + + private int ReceiveRecord(byte[] buf, int off, int len, int waitMillis) + { + if (mRecordQueue.Available > 0) + { + int length = 0; + if (mRecordQueue.Available >= RECORD_HEADER_LENGTH) + { + byte[] lengthBytes = new byte[2]; + mRecordQueue.Read(lengthBytes, 0, 2, 11); + length = TlsUtilities.ReadUint16(lengthBytes, 0); + } + + int received = System.Math.Min(mRecordQueue.Available, RECORD_HEADER_LENGTH + length); + mRecordQueue.RemoveData(buf, off, received, 0); + return received; + } + + { + int received = mTransport.Receive(buf, off, len, waitMillis); + if (received >= RECORD_HEADER_LENGTH) + { + int fragmentLength = TlsUtilities.ReadUint16(buf, off + 11); + int recordLength = RECORD_HEADER_LENGTH + fragmentLength; + if (received > recordLength) + { + mRecordQueue.AddData(buf, off + recordLength, received - recordLength); + received = recordLength; + } + } + return received; + } + } + + private void SendRecord(byte contentType, byte[] buf, int off, int len) + { + // Never send anything until a valid ClientHello has been received + if (mWriteVersion == null) + return; + + if (len > this.mPlaintextLimit) + throw new TlsFatalAlert(AlertDescription.internal_error); + + /* + * RFC 5246 6.2.1 Implementations MUST NOT send zero-length fragments of Handshake, Alert, + * or ChangeCipherSpec content types. + */ + if (len < 1 && contentType != ContentType.application_data) + throw new TlsFatalAlert(AlertDescription.internal_error); + + int recordEpoch = mWriteEpoch.Epoch; + long recordSequenceNumber = mWriteEpoch.AllocateSequenceNumber(); + + byte[] ciphertext = mWriteEpoch.Cipher.EncodePlaintext( + GetMacSequenceNumber(recordEpoch, recordSequenceNumber), contentType, buf, off, len); + + // TODO Check the ciphertext length? + + byte[] record = new byte[ciphertext.Length + RECORD_HEADER_LENGTH]; + TlsUtilities.WriteUint8(contentType, record, 0); + ProtocolVersion version = mWriteVersion; + TlsUtilities.WriteVersion(version, record, 1); + TlsUtilities.WriteUint16(recordEpoch, record, 3); + TlsUtilities.WriteUint48(recordSequenceNumber, record, 5); + TlsUtilities.WriteUint16(ciphertext.Length, record, 11); + Array.Copy(ciphertext, 0, record, RECORD_HEADER_LENGTH, ciphertext.Length); + + mTransport.Send(record, 0, record.Length); + } + + private static long GetMacSequenceNumber(int epoch, long sequence_number) + { + return ((epoch & 0xFFFFFFFFL) << 48) | sequence_number; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsRecordLayer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsRecordLayer.cs.meta new file mode 100644 index 00000000..d3bf2b52 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsRecordLayer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b797b0054ad1cc47a597bcb7b721313 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReliableHandshake.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReliableHandshake.cs new file mode 100644 index 00000000..effff7d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReliableHandshake.cs @@ -0,0 +1,438 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal class DtlsReliableHandshake + { + private const int MaxReceiveAhead = 16; + private const int MessageHeaderLength = 12; + + private readonly DtlsRecordLayer mRecordLayer; + + private TlsHandshakeHash mHandshakeHash; + + private IDictionary mCurrentInboundFlight = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private IDictionary mPreviousInboundFlight = null; + private IList mOutboundFlight = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + private bool mSending = true; + + private int mMessageSeq = 0, mNextReceiveSeq = 0; + + internal DtlsReliableHandshake(TlsContext context, DtlsRecordLayer transport) + { + this.mRecordLayer = transport; + this.mHandshakeHash = new DeferredHash(); + this.mHandshakeHash.Init(context); + } + + internal void NotifyHelloComplete() + { + this.mHandshakeHash = mHandshakeHash.NotifyPrfDetermined(); + } + + internal TlsHandshakeHash HandshakeHash + { + get { return mHandshakeHash; } + } + + internal TlsHandshakeHash PrepareToFinish() + { + TlsHandshakeHash result = mHandshakeHash; + this.mHandshakeHash = mHandshakeHash.StopTracking(); + return result; + } + + internal void SendMessage(byte msg_type, byte[] body) + { + TlsUtilities.CheckUint24(body.Length); + + if (!mSending) + { + CheckInboundFlight(); + mSending = true; + mOutboundFlight.Clear(); + } + + Message message = new Message(mMessageSeq++, msg_type, body); + + mOutboundFlight.Add(message); + + WriteMessage(message); + UpdateHandshakeMessagesDigest(message); + } + + internal byte[] ReceiveMessageBody(byte msg_type) + { + Message message = ReceiveMessage(); + if (message.Type != msg_type) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + return message.Body; + } + + internal Message ReceiveMessage() + { + if (mSending) + { + mSending = false; + PrepareInboundFlight(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable()); + } + + byte[] buf = null; + + // TODO Check the conditions under which we should reset this + int readTimeoutMillis = 1000; + + for (;;) + { + try + { + for (;;) + { + Message pending = GetPendingMessage(); + if (pending != null) + return pending; + + int receiveLimit = mRecordLayer.GetReceiveLimit(); + if (buf == null || buf.Length < receiveLimit) + { + buf = new byte[receiveLimit]; + } + + int received = mRecordLayer.Receive(buf, 0, receiveLimit, readTimeoutMillis); + if (received < 0) + break; + + bool resentOutbound = ProcessRecord(MaxReceiveAhead, mRecordLayer.ReadEpoch, buf, 0, received); + if (resentOutbound) + { + readTimeoutMillis = BackOff(readTimeoutMillis); + } + } + } + catch (IOException e) + { + // NOTE: Assume this is a timeout for the moment + } + + ResendOutboundFlight(); + readTimeoutMillis = BackOff(readTimeoutMillis); + } + } + + internal void Finish() + { + DtlsHandshakeRetransmit retransmit = null; + if (!mSending) + { + CheckInboundFlight(); + } + else + { + PrepareInboundFlight(null); + + if (mPreviousInboundFlight != null) + { + /* + * RFC 6347 4.2.4. In addition, for at least twice the default MSL defined for [TCP], + * when in the FINISHED state, the node that transmits the last flight (the server in an + * ordinary handshake or the client in a resumed handshake) MUST respond to a retransmit + * of the peer's last flight with a retransmit of the last flight. + */ + retransmit = new Retransmit(this); + } + } + + mRecordLayer.HandshakeSuccessful(retransmit); + } + + internal void ResetHandshakeMessagesDigest() + { + mHandshakeHash.Reset(); + } + + private int BackOff(int timeoutMillis) + { + /* + * TODO[DTLS] implementations SHOULD back off handshake packet size during the + * retransmit backoff. + */ + return System.Math.Min(timeoutMillis * 2, 60000); + } + + /** + * Check that there are no "extra" messages left in the current inbound flight + */ + private void CheckInboundFlight() + { + foreach (int key in mCurrentInboundFlight.Keys) + { + if (key >= mNextReceiveSeq) + { + // TODO Should this be considered an error? + } + } + } + + private Message GetPendingMessage() + { + DtlsReassembler next = (DtlsReassembler)mCurrentInboundFlight[mNextReceiveSeq]; + if (next != null) + { + byte[] body = next.GetBodyIfComplete(); + if (body != null) + { + mPreviousInboundFlight = null; + return UpdateHandshakeMessagesDigest(new Message(mNextReceiveSeq++, next.MsgType, body)); + } + } + return null; + } + + private void PrepareInboundFlight(IDictionary nextFlight) + { + ResetAll(mCurrentInboundFlight); + mPreviousInboundFlight = mCurrentInboundFlight; + mCurrentInboundFlight = nextFlight; + } + + private bool ProcessRecord(int windowSize, int epoch, byte[] buf, int off, int len) + { + bool checkPreviousFlight = false; + + while (len >= MessageHeaderLength) + { + int fragment_length = TlsUtilities.ReadUint24(buf, off + 9); + int message_length = fragment_length + MessageHeaderLength; + if (len < message_length) + { + // NOTE: Truncated message - ignore it + break; + } + + int length = TlsUtilities.ReadUint24(buf, off + 1); + int fragment_offset = TlsUtilities.ReadUint24(buf, off + 6); + if (fragment_offset + fragment_length > length) + { + // NOTE: Malformed fragment - ignore it and the rest of the record + break; + } + + /* + * NOTE: This very simple epoch check will only work until we want to support + * renegotiation (and we're not likely to do that anyway). + */ + byte msg_type = TlsUtilities.ReadUint8(buf, off + 0); + int expectedEpoch = msg_type == HandshakeType.finished ? 1 : 0; + if (epoch != expectedEpoch) + { + break; + } + + int message_seq = TlsUtilities.ReadUint16(buf, off + 4); + if (message_seq >= (mNextReceiveSeq + windowSize)) + { + // NOTE: Too far ahead - ignore + } + else if (message_seq >= mNextReceiveSeq) + { + DtlsReassembler reassembler = (DtlsReassembler)mCurrentInboundFlight[message_seq]; + if (reassembler == null) + { + reassembler = new DtlsReassembler(msg_type, length); + mCurrentInboundFlight[message_seq] = reassembler; + } + + reassembler.ContributeFragment(msg_type, length, buf, off + MessageHeaderLength, fragment_offset, + fragment_length); + } + else if (mPreviousInboundFlight != null) + { + /* + * NOTE: If we receive the previous flight of incoming messages in full again, + * retransmit our last flight + */ + + DtlsReassembler reassembler = (DtlsReassembler)mPreviousInboundFlight[message_seq]; + if (reassembler != null) + { + reassembler.ContributeFragment(msg_type, length, buf, off + MessageHeaderLength, fragment_offset, + fragment_length); + checkPreviousFlight = true; + } + } + + off += message_length; + len -= message_length; + } + + bool result = checkPreviousFlight && CheckAll(mPreviousInboundFlight); + if (result) + { + ResendOutboundFlight(); + ResetAll(mPreviousInboundFlight); + } + return result; + } + + private void ResendOutboundFlight() + { + mRecordLayer.ResetWriteEpoch(); + for (int i = 0; i < mOutboundFlight.Count; ++i) + { + WriteMessage((Message)mOutboundFlight[i]); + } + } + + private Message UpdateHandshakeMessagesDigest(Message message) + { + if (message.Type != HandshakeType.hello_request) + { + byte[] body = message.Body; + byte[] buf = new byte[MessageHeaderLength]; + TlsUtilities.WriteUint8(message.Type, buf, 0); + TlsUtilities.WriteUint24(body.Length, buf, 1); + TlsUtilities.WriteUint16(message.Seq, buf, 4); + TlsUtilities.WriteUint24(0, buf, 6); + TlsUtilities.WriteUint24(body.Length, buf, 9); + mHandshakeHash.BlockUpdate(buf, 0, buf.Length); + mHandshakeHash.BlockUpdate(body, 0, body.Length); + } + return message; + } + + private void WriteMessage(Message message) + { + int sendLimit = mRecordLayer.GetSendLimit(); + int fragmentLimit = sendLimit - MessageHeaderLength; + + // TODO Support a higher minimum fragment size? + if (fragmentLimit < 1) + { + // TODO Should we be throwing an exception here? + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + int length = message.Body.Length; + + // NOTE: Must still send a fragment if body is empty + int fragment_offset = 0; + do + { + int fragment_length = System.Math.Min(length - fragment_offset, fragmentLimit); + WriteHandshakeFragment(message, fragment_offset, fragment_length); + fragment_offset += fragment_length; + } + while (fragment_offset < length); + } + + private void WriteHandshakeFragment(Message message, int fragment_offset, int fragment_length) + { + RecordLayerBuffer fragment = new RecordLayerBuffer(MessageHeaderLength + fragment_length); + TlsUtilities.WriteUint8(message.Type, fragment); + TlsUtilities.WriteUint24(message.Body.Length, fragment); + TlsUtilities.WriteUint16(message.Seq, fragment); + TlsUtilities.WriteUint24(fragment_offset, fragment); + TlsUtilities.WriteUint24(fragment_length, fragment); + fragment.Write(message.Body, fragment_offset, fragment_length); + + fragment.SendToRecordLayer(mRecordLayer); + } + + private static bool CheckAll(IDictionary inboundFlight) + { + foreach (DtlsReassembler r in inboundFlight.Values) + { + if (r.GetBodyIfComplete() == null) + { + return false; + } + } + return true; + } + + private static void ResetAll(IDictionary inboundFlight) + { + foreach (DtlsReassembler r in inboundFlight.Values) + { + r.Reset(); + } + } + + internal class Message + { + private readonly int mMessageSeq; + private readonly byte mMsgType; + private readonly byte[] mBody; + + internal Message(int message_seq, byte msg_type, byte[] body) + { + this.mMessageSeq = message_seq; + this.mMsgType = msg_type; + this.mBody = body; + } + + public int Seq + { + get { return mMessageSeq; } + } + + public byte Type + { + get { return mMsgType; } + } + + public byte[] Body + { + get { return mBody; } + } + } + + internal class RecordLayerBuffer + : MemoryStream + { + internal RecordLayerBuffer(int size) + : base(size) + { + } + + internal void SendToRecordLayer(DtlsRecordLayer recordLayer) + { +#if PORTABLE || NETFX_CORE + byte[] buf = ToArray(); + int bufLen = buf.Length; +#else + byte[] buf = GetBuffer(); + int bufLen = (int)Length; +#endif + + recordLayer.Send(buf, 0, bufLen); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(this); + } + } + + internal class Retransmit + : DtlsHandshakeRetransmit + { + private readonly DtlsReliableHandshake mOuter; + + internal Retransmit(DtlsReliableHandshake outer) + { + this.mOuter = outer; + } + + public void ReceivedHandshakeRecord(int epoch, byte[] buf, int off, int len) + { + mOuter.ProcessRecord(0, epoch, buf, off, len); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReliableHandshake.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReliableHandshake.cs.meta new file mode 100644 index 00000000..38a4df43 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReliableHandshake.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa235f6e724e71147b1b85156939dfda +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReplayWindow.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReplayWindow.cs new file mode 100644 index 00000000..2ab0e009 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReplayWindow.cs @@ -0,0 +1,89 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * RFC 4347 4.1.2.5 Anti-replay + *

+ * Support fast rejection of duplicate records by maintaining a sliding receive window + */ + internal class DtlsReplayWindow + { + private const long VALID_SEQ_MASK = 0x0000FFFFFFFFFFFFL; + + private const long WINDOW_SIZE = 64L; + + private long mLatestConfirmedSeq = -1; + private long mBitmap = 0; + + /** + * Check whether a received record with the given sequence number should be rejected as a duplicate. + * + * @param seq the 48-bit DTLSPlainText.sequence_number field of a received record. + * @return true if the record should be discarded without further processing. + */ + internal bool ShouldDiscard(long seq) + { + if ((seq & VALID_SEQ_MASK) != seq) + return true; + + if (seq <= mLatestConfirmedSeq) + { + long diff = mLatestConfirmedSeq - seq; + if (diff >= WINDOW_SIZE) + return true; + if ((mBitmap & (1L << (int)diff)) != 0) + return true; + } + + return false; + } + + /** + * Report that a received record with the given sequence number passed authentication checks. + * + * @param seq the 48-bit DTLSPlainText.sequence_number field of an authenticated record. + */ + internal void ReportAuthenticated(long seq) + { + if ((seq & VALID_SEQ_MASK) != seq) + throw new ArgumentException("out of range", "seq"); + + if (seq <= mLatestConfirmedSeq) + { + long diff = mLatestConfirmedSeq - seq; + if (diff < WINDOW_SIZE) + { + mBitmap |= (1L << (int)diff); + } + } + else + { + long diff = seq - mLatestConfirmedSeq; + if (diff >= WINDOW_SIZE) + { + mBitmap = 1; + } + else + { + mBitmap <<= (int)diff; + mBitmap |= 1; + } + mLatestConfirmedSeq = seq; + } + } + + /** + * When a new epoch begins, sequence numbers begin again at 0 + */ + internal void Reset() + { + mLatestConfirmedSeq = -1; + mBitmap = 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReplayWindow.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReplayWindow.cs.meta new file mode 100644 index 00000000..267ae20b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsReplayWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d96e5916c480aa4f87350eb7aa5a613 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsServerProtocol.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsServerProtocol.cs new file mode 100644 index 00000000..42d299d0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsServerProtocol.cs @@ -0,0 +1,722 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DtlsServerProtocol + : DtlsProtocol + { + protected bool mVerifyRequests = true; + + public DtlsServerProtocol(SecureRandom secureRandom) + : base(secureRandom) + { + } + + public virtual bool VerifyRequests + { + get { return mVerifyRequests; } + set { this.mVerifyRequests = value; } + } + + public virtual DtlsTransport Accept(TlsServer server, DatagramTransport transport) + { + if (server == null) + throw new ArgumentNullException("server"); + if (transport == null) + throw new ArgumentNullException("transport"); + + SecurityParameters securityParameters = new SecurityParameters(); + securityParameters.entity = ConnectionEnd.server; + + ServerHandshakeState state = new ServerHandshakeState(); + state.server = server; + state.serverContext = new TlsServerContextImpl(mSecureRandom, securityParameters); + + securityParameters.serverRandom = TlsProtocol.CreateRandomBlock(server.ShouldUseGmtUnixTime(), + state.serverContext.NonceRandomGenerator); + + server.Init(state.serverContext); + + DtlsRecordLayer recordLayer = new DtlsRecordLayer(transport, state.serverContext, server, ContentType.handshake); + + // TODO Need to handle sending of HelloVerifyRequest without entering a full connection + + try + { + return ServerHandshake(state, recordLayer); + } + catch (TlsFatalAlert fatalAlert) + { + AbortServerHandshake(state, recordLayer, fatalAlert.AlertDescription); + throw fatalAlert; + } + catch (IOException e) + { + AbortServerHandshake(state, recordLayer, AlertDescription.internal_error); + throw e; + } + catch (Exception e) + { + AbortServerHandshake(state, recordLayer, AlertDescription.internal_error); + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + finally + { + securityParameters.Clear(); + } + } + + internal virtual void AbortServerHandshake(ServerHandshakeState state, DtlsRecordLayer recordLayer, byte alertDescription) + { + recordLayer.Fail(alertDescription); + InvalidateSession(state); + } + + internal virtual DtlsTransport ServerHandshake(ServerHandshakeState state, DtlsRecordLayer recordLayer) + { + SecurityParameters securityParameters = state.serverContext.SecurityParameters; + DtlsReliableHandshake handshake = new DtlsReliableHandshake(state.serverContext, recordLayer); + + DtlsReliableHandshake.Message clientMessage = handshake.ReceiveMessage(); + + // NOTE: DTLSRecordLayer requires any DTLS version, we don't otherwise constrain this + //ProtocolVersion recordLayerVersion = recordLayer.ReadVersion; + + if (clientMessage.Type == HandshakeType.client_hello) + { + ProcessClientHello(state, clientMessage.Body); + } + else + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + { + byte[] serverHelloBody = GenerateServerHello(state); + + ApplyMaxFragmentLengthExtension(recordLayer, securityParameters.maxFragmentLength); + + ProtocolVersion recordLayerVersion = state.serverContext.ServerVersion; + recordLayer.ReadVersion = recordLayerVersion; + recordLayer.SetWriteVersion(recordLayerVersion); + + handshake.SendMessage(HandshakeType.server_hello, serverHelloBody); + } + + handshake.NotifyHelloComplete(); + + IList serverSupplementalData = state.server.GetServerSupplementalData(); + if (serverSupplementalData != null) + { + byte[] supplementalDataBody = GenerateSupplementalData(serverSupplementalData); + handshake.SendMessage(HandshakeType.supplemental_data, supplementalDataBody); + } + + state.keyExchange = state.server.GetKeyExchange(); + state.keyExchange.Init(state.serverContext); + + state.serverCredentials = state.server.GetCredentials(); + + Certificate serverCertificate = null; + + if (state.serverCredentials == null) + { + state.keyExchange.SkipServerCredentials(); + } + else + { + state.keyExchange.ProcessServerCredentials(state.serverCredentials); + + serverCertificate = state.serverCredentials.Certificate; + byte[] certificateBody = GenerateCertificate(serverCertificate); + handshake.SendMessage(HandshakeType.certificate, certificateBody); + } + + // TODO[RFC 3546] Check whether empty certificates is possible, allowed, or excludes CertificateStatus + if (serverCertificate == null || serverCertificate.IsEmpty) + { + state.allowCertificateStatus = false; + } + + if (state.allowCertificateStatus) + { + CertificateStatus certificateStatus = state.server.GetCertificateStatus(); + if (certificateStatus != null) + { + byte[] certificateStatusBody = GenerateCertificateStatus(state, certificateStatus); + handshake.SendMessage(HandshakeType.certificate_status, certificateStatusBody); + } + } + + byte[] serverKeyExchange = state.keyExchange.GenerateServerKeyExchange(); + if (serverKeyExchange != null) + { + handshake.SendMessage(HandshakeType.server_key_exchange, serverKeyExchange); + } + + if (state.serverCredentials != null) + { + state.certificateRequest = state.server.GetCertificateRequest(); + if (state.certificateRequest != null) + { + if (TlsUtilities.IsTlsV12(state.serverContext) != (state.certificateRequest.SupportedSignatureAlgorithms != null)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + state.keyExchange.ValidateCertificateRequest(state.certificateRequest); + + byte[] certificateRequestBody = GenerateCertificateRequest(state, state.certificateRequest); + handshake.SendMessage(HandshakeType.certificate_request, certificateRequestBody); + + TlsUtilities.TrackHashAlgorithms(handshake.HandshakeHash, + state.certificateRequest.SupportedSignatureAlgorithms); + } + } + + handshake.SendMessage(HandshakeType.server_hello_done, TlsUtilities.EmptyBytes); + + handshake.HandshakeHash.SealHashAlgorithms(); + + clientMessage = handshake.ReceiveMessage(); + + if (clientMessage.Type == HandshakeType.supplemental_data) + { + ProcessClientSupplementalData(state, clientMessage.Body); + clientMessage = handshake.ReceiveMessage(); + } + else + { + state.server.ProcessClientSupplementalData(null); + } + + if (state.certificateRequest == null) + { + state.keyExchange.SkipClientCredentials(); + } + else + { + if (clientMessage.Type == HandshakeType.certificate) + { + ProcessClientCertificate(state, clientMessage.Body); + clientMessage = handshake.ReceiveMessage(); + } + else + { + if (TlsUtilities.IsTlsV12(state.serverContext)) + { + /* + * RFC 5246 If no suitable certificate is available, the client MUST send a + * certificate message containing no certificates. + * + * NOTE: In previous RFCs, this was SHOULD instead of MUST. + */ + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + NotifyClientCertificate(state, Certificate.EmptyChain); + } + } + + if (clientMessage.Type == HandshakeType.client_key_exchange) + { + ProcessClientKeyExchange(state, clientMessage.Body); + } + else + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + TlsHandshakeHash prepareFinishHash = handshake.PrepareToFinish(); + securityParameters.sessionHash = TlsProtocol.GetCurrentPrfHash(state.serverContext, prepareFinishHash, null); + + TlsProtocol.EstablishMasterSecret(state.serverContext, state.keyExchange); + recordLayer.InitPendingEpoch(state.server.GetCipher()); + + /* + * RFC 5246 7.4.8 This message is only sent following a client certificate that has signing + * capability (i.e., all certificates except those containing fixed Diffie-Hellman + * parameters). + */ + if (ExpectCertificateVerifyMessage(state)) + { + byte[] certificateVerifyBody = handshake.ReceiveMessageBody(HandshakeType.certificate_verify); + ProcessCertificateVerify(state, certificateVerifyBody, prepareFinishHash); + } + + // NOTE: Calculated exclusive of the actual Finished message from the client + byte[] expectedClientVerifyData = TlsUtilities.CalculateVerifyData(state.serverContext, ExporterLabel.client_finished, + TlsProtocol.GetCurrentPrfHash(state.serverContext, handshake.HandshakeHash, null)); + ProcessFinished(handshake.ReceiveMessageBody(HandshakeType.finished), expectedClientVerifyData); + + if (state.expectSessionTicket) + { + NewSessionTicket newSessionTicket = state.server.GetNewSessionTicket(); + byte[] newSessionTicketBody = GenerateNewSessionTicket(state, newSessionTicket); + handshake.SendMessage(HandshakeType.session_ticket, newSessionTicketBody); + } + + // NOTE: Calculated exclusive of the Finished message itself + byte[] serverVerifyData = TlsUtilities.CalculateVerifyData(state.serverContext, ExporterLabel.server_finished, + TlsProtocol.GetCurrentPrfHash(state.serverContext, handshake.HandshakeHash, null)); + handshake.SendMessage(HandshakeType.finished, serverVerifyData); + + handshake.Finish(); + + //{ + // state.sessionParameters = new SessionParameters.Builder() + // .SetCipherSuite(securityParameters.CipherSuite) + // .SetCompressionAlgorithm(securityParameters.CompressionAlgorithm) + // .SetExtendedMasterSecret(securityParameters.IsExtendedMasterSecret) + // .SetMasterSecret(securityParameters.MasterSecret) + // .SetPeerCertificate(state.clientCertificate) + // .SetPskIdentity(securityParameters.PskIdentity) + // .SetSrpIdentity(securityParameters.SrpIdentity) + // // TODO Consider filtering extensions that aren't relevant to resumed sessions + // .SetServerExtensions(state.serverExtensions) + // .Build(); + + // state.tlsSession = TlsUtilities.ImportSession(state.tlsSession.SessionID, state.sessionParameters); + + // state.serverContext.SetResumableSession(state.tlsSession); + //} + + state.server.NotifyHandshakeComplete(); + + return new DtlsTransport(recordLayer); + } + + protected virtual void InvalidateSession(ServerHandshakeState state) + { + if (state.sessionParameters != null) + { + state.sessionParameters.Clear(); + state.sessionParameters = null; + } + + if (state.tlsSession != null) + { + state.tlsSession.Invalidate(); + state.tlsSession = null; + } + } + + protected virtual byte[] GenerateCertificateRequest(ServerHandshakeState state, CertificateRequest certificateRequest) + { + MemoryStream buf = new MemoryStream(); + certificateRequest.Encode(buf); + return buf.ToArray(); + } + + protected virtual byte[] GenerateCertificateStatus(ServerHandshakeState state, CertificateStatus certificateStatus) + { + MemoryStream buf = new MemoryStream(); + certificateStatus.Encode(buf); + return buf.ToArray(); + } + + protected virtual byte[] GenerateNewSessionTicket(ServerHandshakeState state, NewSessionTicket newSessionTicket) + { + MemoryStream buf = new MemoryStream(); + newSessionTicket.Encode(buf); + return buf.ToArray(); + } + + protected virtual byte[] GenerateServerHello(ServerHandshakeState state) + { + SecurityParameters securityParameters = state.serverContext.SecurityParameters; + + MemoryStream buf = new MemoryStream(); + + { + ProtocolVersion server_version = state.server.GetServerVersion(); + if (!server_version.IsEqualOrEarlierVersionOf(state.serverContext.ClientVersion)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + // TODO Read RFCs for guidance on the expected record layer version number + // recordStream.setReadVersion(server_version); + // recordStream.setWriteVersion(server_version); + // recordStream.setRestrictReadVersion(true); + state.serverContext.SetServerVersion(server_version); + + TlsUtilities.WriteVersion(state.serverContext.ServerVersion, buf); + } + + buf.Write(securityParameters.ServerRandom, 0, securityParameters.ServerRandom.Length); + + /* + * The server may return an empty session_id to indicate that the session will not be cached + * and therefore cannot be resumed. + */ + TlsUtilities.WriteOpaque8(TlsUtilities.EmptyBytes, buf); + + int selectedCipherSuite = state.server.GetSelectedCipherSuite(); + if (!Arrays.Contains(state.offeredCipherSuites, selectedCipherSuite) + || selectedCipherSuite == CipherSuite.TLS_NULL_WITH_NULL_NULL + || CipherSuite.IsScsv(selectedCipherSuite) + || !TlsUtilities.IsValidCipherSuiteForVersion(selectedCipherSuite, state.serverContext.ServerVersion)) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + ValidateSelectedCipherSuite(selectedCipherSuite, AlertDescription.internal_error); + securityParameters.cipherSuite = selectedCipherSuite; + + byte selectedCompressionMethod = state.server.GetSelectedCompressionMethod(); + if (!Arrays.Contains(state.offeredCompressionMethods, selectedCompressionMethod)) + throw new TlsFatalAlert(AlertDescription.internal_error); + securityParameters.compressionAlgorithm = selectedCompressionMethod; + + TlsUtilities.WriteUint16(selectedCipherSuite, buf); + TlsUtilities.WriteUint8(selectedCompressionMethod, buf); + + state.serverExtensions = TlsExtensionsUtilities.EnsureExtensionsInitialised(state.server.GetServerExtensions()); + + /* + * RFC 5746 3.6. Server Behavior: Initial Handshake + */ + if (state.secure_renegotiation) + { + byte[] renegExtData = TlsUtilities.GetExtensionData(state.serverExtensions, ExtensionType.renegotiation_info); + bool noRenegExt = (null == renegExtData); + + if (noRenegExt) + { + /* + * Note that sending a "renegotiation_info" extension in response to a ClientHello + * containing only the SCSV is an explicit exception to the prohibition in RFC 5246, + * Section 7.4.1.4, on the server sending unsolicited extensions and is only allowed + * because the client is signaling its willingness to receive the extension via the + * TLS_EMPTY_RENEGOTIATION_INFO_SCSV SCSV. + */ + + /* + * If the secure_renegotiation flag is set to TRUE, the server MUST include an empty + * "renegotiation_info" extension in the ServerHello message. + */ + state.serverExtensions[ExtensionType.renegotiation_info] = TlsProtocol.CreateRenegotiationInfo(TlsUtilities.EmptyBytes); + } + } + + if (securityParameters.IsExtendedMasterSecret) + { + TlsExtensionsUtilities.AddExtendedMasterSecretExtension(state.serverExtensions); + } + + /* + * TODO RFC 3546 2.3 If [...] the older session is resumed, then the server MUST ignore + * extensions appearing in the client hello, and send a server hello containing no + * extensions. + */ + + if (state.serverExtensions.Count > 0) + { + securityParameters.encryptThenMac = TlsExtensionsUtilities.HasEncryptThenMacExtension(state.serverExtensions); + + securityParameters.maxFragmentLength = EvaluateMaxFragmentLengthExtension(state.resumedSession, + state.clientExtensions, state.serverExtensions, AlertDescription.internal_error); + + securityParameters.truncatedHMac = TlsExtensionsUtilities.HasTruncatedHMacExtension(state.serverExtensions); + + /* + * TODO It's surprising that there's no provision to allow a 'fresh' CertificateStatus to be sent in + * a session resumption handshake. + */ + state.allowCertificateStatus = !state.resumedSession + && TlsUtilities.HasExpectedEmptyExtensionData(state.serverExtensions, ExtensionType.status_request, + AlertDescription.internal_error); + + state.expectSessionTicket = !state.resumedSession + && TlsUtilities.HasExpectedEmptyExtensionData(state.serverExtensions, ExtensionType.session_ticket, + AlertDescription.internal_error); + + TlsProtocol.WriteExtensions(buf, state.serverExtensions); + } + + securityParameters.prfAlgorithm = TlsProtocol.GetPrfAlgorithm(state.serverContext, + securityParameters.CipherSuite); + + /* + * RFC 5246 7.4.9. Any cipher suite which does not explicitly specify verify_data_length + * has a verify_data_length equal to 12. This includes all existing cipher suites. + */ + securityParameters.verifyDataLength = 12; + + return buf.ToArray(); + } + + protected virtual void NotifyClientCertificate(ServerHandshakeState state, Certificate clientCertificate) + { + if (state.certificateRequest == null) + throw new InvalidOperationException(); + + if (state.clientCertificate != null) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + state.clientCertificate = clientCertificate; + + if (clientCertificate.IsEmpty) + { + state.keyExchange.SkipClientCredentials(); + } + else + { + + /* + * TODO RFC 5246 7.4.6. If the certificate_authorities list in the certificate request + * message was non-empty, one of the certificates in the certificate chain SHOULD be + * issued by one of the listed CAs. + */ + + state.clientCertificateType = TlsUtilities.GetClientCertificateType(clientCertificate, + state.serverCredentials.Certificate); + + state.keyExchange.ProcessClientCertificate(clientCertificate); + } + + /* + * RFC 5246 7.4.6. If the client does not send any certificates, the server MAY at its + * discretion either continue the handshake without client authentication, or respond with a + * fatal handshake_failure alert. Also, if some aspect of the certificate chain was + * unacceptable (e.g., it was not signed by a known, trusted CA), the server MAY at its + * discretion either continue the handshake (considering the client unauthenticated) or send + * a fatal alert. + */ + state.server.NotifyClientCertificate(clientCertificate); + } + + protected virtual void ProcessClientCertificate(ServerHandshakeState state, byte[] body) + { + MemoryStream buf = new MemoryStream(body, false); + + Certificate clientCertificate = Certificate.Parse(buf); + + TlsProtocol.AssertEmpty(buf); + + NotifyClientCertificate(state, clientCertificate); + } + + protected virtual void ProcessCertificateVerify(ServerHandshakeState state, byte[] body, TlsHandshakeHash prepareFinishHash) + { + if (state.certificateRequest == null) + throw new InvalidOperationException(); + + MemoryStream buf = new MemoryStream(body, false); + + TlsServerContextImpl context = state.serverContext; + DigitallySigned clientCertificateVerify = DigitallySigned.Parse(context, buf); + + TlsProtocol.AssertEmpty(buf); + + // Verify the CertificateVerify message contains a correct signature. + try + { + SignatureAndHashAlgorithm signatureAlgorithm = clientCertificateVerify.Algorithm; + + byte[] hash; + if (TlsUtilities.IsTlsV12(context)) + { + TlsUtilities.VerifySupportedSignatureAlgorithm(state.certificateRequest.SupportedSignatureAlgorithms, signatureAlgorithm); + hash = prepareFinishHash.GetFinalHash(signatureAlgorithm.Hash); + } + else + { + hash = context.SecurityParameters.SessionHash; + } + + X509CertificateStructure x509Cert = state.clientCertificate.GetCertificateAt(0); + SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo; + AsymmetricKeyParameter publicKey = PublicKeyFactory.CreateKey(keyInfo); + + TlsSigner tlsSigner = TlsUtilities.CreateTlsSigner((byte)state.clientCertificateType); + tlsSigner.Init(context); + if (!tlsSigner.VerifyRawSignature(signatureAlgorithm, clientCertificateVerify.Signature, publicKey, hash)) + throw new TlsFatalAlert(AlertDescription.decrypt_error); + } + catch (TlsFatalAlert e) + { + throw e; + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.decrypt_error, e); + } + } + + protected virtual void ProcessClientHello(ServerHandshakeState state, byte[] body) + { + MemoryStream buf = new MemoryStream(body, false); + + // TODO Read RFCs for guidance on the expected record layer version number + ProtocolVersion client_version = TlsUtilities.ReadVersion(buf); + if (!client_version.IsDtls) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + /* + * Read the client random + */ + byte[] client_random = TlsUtilities.ReadFully(32, buf); + + byte[] sessionID = TlsUtilities.ReadOpaque8(buf); + if (sessionID.Length > 32) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + // TODO RFC 4347 has the cookie length restricted to 32, but not in RFC 6347 + byte[] cookie = TlsUtilities.ReadOpaque8(buf); + + int cipher_suites_length = TlsUtilities.ReadUint16(buf); + if (cipher_suites_length < 2 || (cipher_suites_length & 1) != 0) + { + throw new TlsFatalAlert(AlertDescription.decode_error); + } + + /* + * NOTE: "If the session_id field is not empty (implying a session resumption request) this + * vector must include at least the cipher_suite from that session." + */ + state.offeredCipherSuites = TlsUtilities.ReadUint16Array(cipher_suites_length / 2, buf); + + int compression_methods_length = TlsUtilities.ReadUint8(buf); + if (compression_methods_length < 1) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + state.offeredCompressionMethods = TlsUtilities.ReadUint8Array(compression_methods_length, buf); + + /* + * TODO RFC 3546 2.3 If [...] the older session is resumed, then the server MUST ignore + * extensions appearing in the client hello, and send a server hello containing no + * extensions. + */ + state.clientExtensions = TlsProtocol.ReadExtensions(buf); + + TlsServerContextImpl context = state.serverContext; + SecurityParameters securityParameters = context.SecurityParameters; + + /* + * TODO[resumption] Check RFC 7627 5.4. for required behaviour + */ + + /* + * RFC 7627 4. Clients and servers SHOULD NOT accept handshakes that do not use the extended + * master secret [..]. (and see 5.2, 5.3) + */ + securityParameters.extendedMasterSecret = TlsExtensionsUtilities.HasExtendedMasterSecretExtension(state.clientExtensions); + if (!securityParameters.IsExtendedMasterSecret && state.server.RequiresExtendedMasterSecret()) + { + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + + context.SetClientVersion(client_version); + + state.server.NotifyClientVersion(client_version); + state.server.NotifyFallback(Arrays.Contains(state.offeredCipherSuites, CipherSuite.TLS_FALLBACK_SCSV)); + + securityParameters.clientRandom = client_random; + + state.server.NotifyOfferedCipherSuites(state.offeredCipherSuites); + state.server.NotifyOfferedCompressionMethods(state.offeredCompressionMethods); + + /* + * RFC 5746 3.6. Server Behavior: Initial Handshake + */ + { + /* + * RFC 5746 3.4. The client MUST include either an empty "renegotiation_info" extension, + * or the TLS_EMPTY_RENEGOTIATION_INFO_SCSV signaling cipher suite value in the + * ClientHello. Including both is NOT RECOMMENDED. + */ + + /* + * When a ClientHello is received, the server MUST check if it includes the + * TLS_EMPTY_RENEGOTIATION_INFO_SCSV SCSV. If it does, set the secure_renegotiation flag + * to TRUE. + */ + if (Arrays.Contains(state.offeredCipherSuites, CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) + { + state.secure_renegotiation = true; + } + + /* + * The server MUST check if the "renegotiation_info" extension is included in the + * ClientHello. + */ + byte[] renegExtData = TlsUtilities.GetExtensionData(state.clientExtensions, ExtensionType.renegotiation_info); + if (renegExtData != null) + { + /* + * If the extension is present, set secure_renegotiation flag to TRUE. The + * server MUST then verify that the length of the "renegotiated_connection" + * field is zero, and if it is not, MUST abort the handshake. + */ + state.secure_renegotiation = true; + + if (!Arrays.ConstantTimeAreEqual(renegExtData, TlsProtocol.CreateRenegotiationInfo(TlsUtilities.EmptyBytes))) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + } + + state.server.NotifySecureRenegotiation(state.secure_renegotiation); + + if (state.clientExtensions != null) + { + // NOTE: Validates the padding extension data, if present + TlsExtensionsUtilities.GetPaddingExtension(state.clientExtensions); + + state.server.ProcessClientExtensions(state.clientExtensions); + } + } + + protected virtual void ProcessClientKeyExchange(ServerHandshakeState state, byte[] body) + { + MemoryStream buf = new MemoryStream(body, false); + + state.keyExchange.ProcessClientKeyExchange(buf); + + TlsProtocol.AssertEmpty(buf); + } + + protected virtual void ProcessClientSupplementalData(ServerHandshakeState state, byte[] body) + { + MemoryStream buf = new MemoryStream(body, false); + IList clientSupplementalData = TlsProtocol.ReadSupplementalDataMessage(buf); + state.server.ProcessClientSupplementalData(clientSupplementalData); + } + + protected virtual bool ExpectCertificateVerifyMessage(ServerHandshakeState state) + { + return state.clientCertificateType >= 0 && TlsUtilities.HasSigningCapability((byte)state.clientCertificateType); + } + + protected internal class ServerHandshakeState + { + internal TlsServer server = null; + internal TlsServerContextImpl serverContext = null; + internal TlsSession tlsSession = null; + internal SessionParameters sessionParameters = null; + internal SessionParameters.Builder sessionParametersBuilder = null; + internal int[] offeredCipherSuites = null; + internal byte[] offeredCompressionMethods = null; + internal IDictionary clientExtensions = null; + internal IDictionary serverExtensions = null; + internal bool resumedSession = false; + internal bool secure_renegotiation = false; + internal bool allowCertificateStatus = false; + internal bool expectSessionTicket = false; + internal TlsKeyExchange keyExchange = null; + internal TlsCredentials serverCredentials = null; + internal CertificateRequest certificateRequest = null; + internal short clientCertificateType = -1; + internal Certificate clientCertificate = null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsServerProtocol.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsServerProtocol.cs.meta new file mode 100644 index 00000000..c0167f75 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsServerProtocol.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf41bc2b10b6b0440901491239d4a031 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsTransport.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsTransport.cs new file mode 100644 index 00000000..9103bde2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsTransport.cs @@ -0,0 +1,81 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class DtlsTransport + : DatagramTransport + { + private readonly DtlsRecordLayer mRecordLayer; + + internal DtlsTransport(DtlsRecordLayer recordLayer) + { + this.mRecordLayer = recordLayer; + } + + public virtual int GetReceiveLimit() + { + return mRecordLayer.GetReceiveLimit(); + } + + public virtual int GetSendLimit() + { + return mRecordLayer.GetSendLimit(); + } + + public virtual int Receive(byte[] buf, int off, int len, int waitMillis) + { + try + { + return mRecordLayer.Receive(buf, off, len, waitMillis); + } + catch (TlsFatalAlert fatalAlert) + { + mRecordLayer.Fail(fatalAlert.AlertDescription); + throw fatalAlert; + } + catch (IOException e) + { + mRecordLayer.Fail(AlertDescription.internal_error); + throw e; + } + catch (Exception e) + { + mRecordLayer.Fail(AlertDescription.internal_error); + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + } + + public virtual void Send(byte[] buf, int off, int len) + { + try + { + mRecordLayer.Send(buf, off, len); + } + catch (TlsFatalAlert fatalAlert) + { + mRecordLayer.Fail(fatalAlert.AlertDescription); + throw fatalAlert; + } + catch (IOException e) + { + mRecordLayer.Fail(AlertDescription.internal_error); + throw e; + } + catch (Exception e) + { + mRecordLayer.Fail(AlertDescription.internal_error); + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + } + + public virtual void Close() + { + mRecordLayer.Close(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsTransport.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsTransport.cs.meta new file mode 100644 index 00000000..27b8a233 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/DtlsTransport.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36ac7bf991af09244be9e7546c32272f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECBasisType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECBasisType.cs new file mode 100644 index 00000000..da1da860 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECBasisType.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + ///

RFC 4492 5.4. (Errata ID: 2389) + public abstract class ECBasisType + { + public const byte ec_basis_trinomial = 1; + public const byte ec_basis_pentanomial = 2; + + public static bool IsValid(byte ecBasisType) + { + return ecBasisType >= ec_basis_trinomial && ecBasisType <= ec_basis_pentanomial; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECBasisType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECBasisType.cs.meta new file mode 100644 index 00000000..1056871c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECBasisType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b1a05facdad16f4a94480843b47056f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECCurveType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECCurveType.cs new file mode 100644 index 00000000..af5872cb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECCurveType.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// RFC 4492 5.4 + /// + public abstract class ECCurveType + { + /** + * Indicates the elliptic curve domain parameters are conveyed verbosely, and the + * underlying finite field is a prime field. + */ + public const byte explicit_prime = 1; + + /** + * Indicates the elliptic curve domain parameters are conveyed verbosely, and the + * underlying finite field is a characteristic-2 field. + */ + public const byte explicit_char2 = 2; + + /** + * Indicates that a named curve is used. This option SHOULD be used when applicable. + */ + public const byte named_curve = 3; + + /* + * Values 248 through 255 are reserved for private use. + */ + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECCurveType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECCurveType.cs.meta new file mode 100644 index 00000000..ac1c5767 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECCurveType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9b54ca1f2b1231a41b6c9e4a87e85d40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECPointFormat.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECPointFormat.cs new file mode 100644 index 00000000..cbbcd1aa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECPointFormat.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// RFC 4492 5.1.2 + /// + public abstract class ECPointFormat + { + public const byte uncompressed = 0; + public const byte ansiX962_compressed_prime = 1; + public const byte ansiX962_compressed_char2 = 2; + + /* + * reserved (248..255) + */ + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECPointFormat.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECPointFormat.cs.meta new file mode 100644 index 00000000..894fae1e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ECPointFormat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc8629ffdb3eafc41b5f8070a55e0bfe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/EncryptionAlgorithm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/EncryptionAlgorithm.cs new file mode 100644 index 00000000..a9ea7a2f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/EncryptionAlgorithm.cs @@ -0,0 +1,73 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 2246 + /// + /// Note that the values here are implementation-specific and arbitrary. It is recommended not to + /// depend on the particular values (e.g. serialization). + /// + public abstract class EncryptionAlgorithm + { + public const int NULL = 0; + public const int RC4_40 = 1; + public const int RC4_128 = 2; + public const int RC2_CBC_40 = 3; + public const int IDEA_CBC = 4; + public const int DES40_CBC = 5; + public const int DES_CBC = 6; + public const int cls_3DES_EDE_CBC = 7; + + /* + * RFC 3268 + */ + public const int AES_128_CBC = 8; + public const int AES_256_CBC = 9; + + /* + * RFC 5289 + */ + public const int AES_128_GCM = 10; + public const int AES_256_GCM = 11; + + /* + * RFC 4132 + */ + public const int CAMELLIA_128_CBC = 12; + public const int CAMELLIA_256_CBC = 13; + + /* + * RFC 4162 + */ + public const int SEED_CBC = 14; + + /* + * RFC 6655 + */ + public const int AES_128_CCM = 15; + public const int AES_128_CCM_8 = 16; + public const int AES_256_CCM = 17; + public const int AES_256_CCM_8 = 18; + + /* + * RFC 6367 + */ + public const int CAMELLIA_128_GCM = 19; + public const int CAMELLIA_256_GCM = 20; + + /* + * RFC 7905 + */ + public const int CHACHA20_POLY1305 = 21; + + /* + * draft-zauner-tls-aes-ocb-04 + */ + public const int AES_128_OCB_TAGLEN96 = 103; + public const int AES_256_OCB_TAGLEN96 = 104; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/EncryptionAlgorithm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/EncryptionAlgorithm.cs.meta new file mode 100644 index 00000000..a1acbbee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/EncryptionAlgorithm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9e20fa3a265e9c24392f009daf9ecae0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExporterLabel.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExporterLabel.cs new file mode 100644 index 00000000..5428b478 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExporterLabel.cs @@ -0,0 +1,41 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 5705 + public abstract class ExporterLabel + { + /* + * RFC 5246 + */ + public const string client_finished = "client finished"; + public const string server_finished = "server finished"; + public const string master_secret = "master secret"; + public const string key_expansion = "key expansion"; + + /* + * RFC 5216 + */ + public const string client_EAP_encryption = "client EAP encryption"; + + /* + * RFC 5281 + */ + public const string ttls_keying_material = "ttls keying material"; + public const string ttls_challenge = "ttls challenge"; + + /* + * RFC 5764 + */ + public const string dtls_srtp = "EXTRACTOR-dtls_srtp"; + + /* + * RFC 7627 + */ + public static readonly string extended_master_secret = "extended master secret"; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExporterLabel.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExporterLabel.cs.meta new file mode 100644 index 00000000..192fc605 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExporterLabel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 34fbb70e28322eb4b9250222336ef88b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExtensionType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExtensionType.cs new file mode 100644 index 00000000..79881e76 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExtensionType.cs @@ -0,0 +1,132 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class ExtensionType + { + /* + * RFC 2546 2.3. + */ + public const int server_name = 0; + public const int max_fragment_length = 1; + public const int client_certificate_url = 2; + public const int trusted_ca_keys = 3; + public const int truncated_hmac = 4; + public const int status_request = 5; + + /* + * RFC 4681 + */ + public const int user_mapping = 6; + + /* + * RFC 5878 + */ + public const int client_authz = 7; + public const int server_authz = 8; + + /* + * RFC RFC6091 + */ + public const int cert_type = 9; + + /* + * draft-ietf-tls-negotiated-ff-dhe-10 + */ + public const int supported_groups = 10; + + /* + * RFC 4492 5.1. + */ + [Obsolete("Use 'supported_groups' instead")] + public const int elliptic_curves = supported_groups; + public const int ec_point_formats = 11; + + /* + * RFC 5054 2.8.1. + */ + public const int srp = 12; + + /* + * RFC 5246 7.4.1.4. + */ + public const int signature_algorithms = 13; + + /* + * RFC 5764 9. + */ + public const int use_srtp = 14; + + /* + * RFC 6520 6. + */ + public const int heartbeat = 15; + + /* + * RFC 7301 + */ + public const int application_layer_protocol_negotiation = 16; + + /* + * RFC 6961 + */ + public const int status_request_v2 = 17; + + /* + * RFC 6962 + */ + public const int signed_certificate_timestamp = 18; + + /* + * RFC 7250 + */ + public const int client_certificate_type = 19; + public const int server_certificate_type = 20; + + /* + * RFC 7685 + */ + public const int padding = 21; + + /* + * RFC 7366 + */ + public const int encrypt_then_mac = 22; + + /* + * RFC 7627 + */ + public const int extended_master_secret = 23; + + /* + * draft-ietf-tokbind-negotiation-08 + */ + public static readonly int DRAFT_token_binding = 24; + + /* + * RFC 7924 + */ + public const int cached_info = 25; + + /* + * RFC 5077 7. + */ + public const int session_ticket = 35; + + /* + * draft-ietf-tls-negotiated-ff-dhe-01 + * + * WARNING: Placeholder value; the real value is TBA + */ + public static readonly int negotiated_ff_dhe_groups = 101; + + /* + * RFC 5746 3.2. + */ + public const int renegotiation_info = 0xff01; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExtensionType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExtensionType.cs.meta new file mode 100644 index 00000000..28cc7bc1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ExtensionType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7df2068c8808c2f4a800c4c052ca8475 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/FiniteFieldDheGroup.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/FiniteFieldDheGroup.cs new file mode 100644 index 00000000..06cc1940 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/FiniteFieldDheGroup.cs @@ -0,0 +1,25 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /* + * draft-ietf-tls-negotiated-ff-dhe-01 + */ + public abstract class FiniteFieldDheGroup + { + public const byte ffdhe2432 = 0; + public const byte ffdhe3072 = 1; + public const byte ffdhe4096 = 2; + public const byte ffdhe6144 = 3; + public const byte ffdhe8192 = 4; + + public static bool IsValid(byte group) + { + return group >= ffdhe2432 && group <= ffdhe8192; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/FiniteFieldDheGroup.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/FiniteFieldDheGroup.cs.meta new file mode 100644 index 00000000..2fa885c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/FiniteFieldDheGroup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 09266df25d9c9be45ba30131f8aa1fa6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HandshakeType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HandshakeType.cs new file mode 100644 index 00000000..75c7e3a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HandshakeType.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class HandshakeType + { + /* + * RFC 2246 7.4 + */ + public const byte hello_request = 0; + public const byte client_hello = 1; + public const byte server_hello = 2; + public const byte certificate = 11; + public const byte server_key_exchange = 12; + public const byte certificate_request = 13; + public const byte server_hello_done = 14; + public const byte certificate_verify = 15; + public const byte client_key_exchange = 16; + public const byte finished = 20; + + /* + * RFC 3546 2.4 + */ + public const byte certificate_url = 21; + public const byte certificate_status = 22; + + /* + * (DTLS) RFC 4347 4.3.2 + */ + public const byte hello_verify_request = 3; + + /* + * RFC 4680 + */ + public const byte supplemental_data = 23; + + /* + * RFC 5077 + */ + public const byte session_ticket = 4; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HandshakeType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HandshakeType.cs.meta new file mode 100644 index 00000000..fcb8130d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HandshakeType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 632f3a4fb7f86914b9b9f4aa22501b69 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HashAlgorithm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HashAlgorithm.cs new file mode 100644 index 00000000..0946e27b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HashAlgorithm.cs @@ -0,0 +1,69 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 5246 7.4.1.4.1 + public abstract class HashAlgorithm + { + public const byte none = 0; + public const byte md5 = 1; + public const byte sha1 = 2; + public const byte sha224 = 3; + public const byte sha256 = 4; + public const byte sha384 = 5; + public const byte sha512 = 6; + + public static string GetName(byte hashAlgorithm) + { + switch (hashAlgorithm) + { + case none: + return "none"; + case md5: + return "md5"; + case sha1: + return "sha1"; + case sha224: + return "sha224"; + case sha256: + return "sha256"; + case sha384: + return "sha384"; + case sha512: + return "sha512"; + default: + return "UNKNOWN"; + } + } + + public static string GetText(byte hashAlgorithm) + { + return GetName(hashAlgorithm) + "(" + hashAlgorithm + ")"; + } + + public static bool IsPrivate(byte hashAlgorithm) + { + return 224 <= hashAlgorithm && hashAlgorithm <= 255; + } + + public static bool IsRecognized(byte hashAlgorithm) + { + switch (hashAlgorithm) + { + case md5: + case sha1: + case sha224: + case sha256: + case sha384: + case sha512: + return true; + default: + return false; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HashAlgorithm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HashAlgorithm.cs.meta new file mode 100644 index 00000000..67281c6f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HashAlgorithm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 677ef3b9d573f1a47b3ba5afe6247d04 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatExtension.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatExtension.cs new file mode 100644 index 00000000..014b7d96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatExtension.cs @@ -0,0 +1,56 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class HeartbeatExtension + { + protected readonly byte mMode; + + public HeartbeatExtension(byte mode) + { + if (!HeartbeatMode.IsValid(mode)) + throw new ArgumentException("not a valid HeartbeatMode value", "mode"); + + this.mMode = mode; + } + + public virtual byte Mode + { + get { return mMode; } + } + + /** + * Encode this {@link HeartbeatExtension} to a {@link Stream}. + * + * @param output + * the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + TlsUtilities.WriteUint8(mMode, output); + } + + /** + * Parse a {@link HeartbeatExtension} from a {@link Stream}. + * + * @param input + * the {@link Stream} to parse from. + * @return a {@link HeartbeatExtension} object. + * @throws IOException + */ + public static HeartbeatExtension Parse(Stream input) + { + byte mode = TlsUtilities.ReadUint8(input); + if (!HeartbeatMode.IsValid(mode)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + return new HeartbeatExtension(mode); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatExtension.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatExtension.cs.meta new file mode 100644 index 00000000..8abf2ab7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatExtension.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 475dad59ffa979641afb6ad8d395452b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessage.cs new file mode 100644 index 00000000..a5ef5156 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessage.cs @@ -0,0 +1,113 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class HeartbeatMessage + { + protected readonly byte mType; + protected readonly byte[] mPayload; + protected readonly int mPaddingLength; + + public HeartbeatMessage(byte type, byte[] payload, int paddingLength) + { + if (!HeartbeatMessageType.IsValid(type)) + throw new ArgumentException("not a valid HeartbeatMessageType value", "type"); + if (payload == null || payload.Length >= (1 << 16)) + throw new ArgumentException("must have length < 2^16", "payload"); + if (paddingLength < 16) + throw new ArgumentException("must be at least 16", "paddingLength"); + + this.mType = type; + this.mPayload = payload; + this.mPaddingLength = paddingLength; + } + + /** + * Encode this {@link HeartbeatMessage} to a {@link Stream}. + * + * @param output + * the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(TlsContext context, Stream output) + { + TlsUtilities.WriteUint8(mType, output); + + TlsUtilities.CheckUint16(mPayload.Length); + TlsUtilities.WriteUint16(mPayload.Length, output); + output.Write(mPayload, 0, mPayload.Length); + + byte[] padding = new byte[mPaddingLength]; + context.NonceRandomGenerator.NextBytes(padding); + output.Write(padding, 0, padding.Length); + } + + /** + * Parse a {@link HeartbeatMessage} from a {@link Stream}. + * + * @param input + * the {@link Stream} to parse from. + * @return a {@link HeartbeatMessage} object. + * @throws IOException + */ + public static HeartbeatMessage Parse(Stream input) + { + byte type = TlsUtilities.ReadUint8(input); + if (!HeartbeatMessageType.IsValid(type)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + int payload_length = TlsUtilities.ReadUint16(input); + + PayloadBuffer buf = new PayloadBuffer(); + Streams.PipeAll(input, buf); + + byte[] payload = buf.ToTruncatedByteArray(payload_length); + if (payload == null) + { + /* + * RFC 6520 4. If the payload_length of a received HeartbeatMessage is too large, the + * received HeartbeatMessage MUST be discarded silently. + */ + return null; + } + + TlsUtilities.CheckUint16(buf.Length); + int padding_length = (int)buf.Length - payload.Length; + + /* + * RFC 6520 4. The padding of a received HeartbeatMessage message MUST be ignored + */ + return new HeartbeatMessage(type, payload, padding_length); + } + + internal class PayloadBuffer + : MemoryStream + { + internal byte[] ToTruncatedByteArray(int payloadLength) + { + /* + * RFC 6520 4. The padding_length MUST be at least 16. + */ + int minimumCount = payloadLength + 16; + if (Length < minimumCount) + return null; + +#if PORTABLE || NETFX_CORE + byte[] buf = ToArray(); +#else + byte[] buf = GetBuffer(); +#endif + + return Arrays.CopyOf(buf, payloadLength); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessage.cs.meta new file mode 100644 index 00000000..ca30d702 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3804754c72a6934296d73598c789ea3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessageType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessageType.cs new file mode 100644 index 00000000..68505597 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessageType.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /* + * RFC 6520 3. + */ + public abstract class HeartbeatMessageType + { + public const byte heartbeat_request = 1; + public const byte heartbeat_response = 2; + + public static bool IsValid(byte heartbeatMessageType) + { + return heartbeatMessageType >= heartbeat_request && heartbeatMessageType <= heartbeat_response; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessageType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessageType.cs.meta new file mode 100644 index 00000000..cb63a0db --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMessageType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f965165b59c150647a20d1f184e4bf13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMode.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMode.cs new file mode 100644 index 00000000..952d040c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMode.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /* + * RFC 6520 + */ + public abstract class HeartbeatMode + { + public const byte peer_allowed_to_send = 1; + public const byte peer_not_allowed_to_send = 2; + + public static bool IsValid(byte heartbeatMode) + { + return heartbeatMode >= peer_allowed_to_send && heartbeatMode <= peer_not_allowed_to_send; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMode.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMode.cs.meta new file mode 100644 index 00000000..ac7dbd29 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/HeartbeatMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6eeaea474b6dc2e489b340a6094c6303 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs new file mode 100644 index 00000000..584f9ba7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace Org.BouncyCastle.Crypto.Tls +{ + /// + /// This should be implemented by any class which can find out, if a given + /// certificate chain is being accepted by an client. + /// + public interface ICertificateVerifyer + { + /// The certs, which are part of the chain. + /// + /// True, if the chain is accepted, false otherwise + bool IsValid(Uri targetUri, X509CertificateStructure[] certs); + } +} + +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs.meta new file mode 100644 index 00000000..2732ccc4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a380c55b877e11941acc0c2a2510f33a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/KeyExchangeAlgorithm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/KeyExchangeAlgorithm.cs new file mode 100644 index 00000000..b21dbd6c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/KeyExchangeAlgorithm.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 2246 + /// + /// Note that the values here are implementation-specific and arbitrary. It is recommended not to + /// depend on the particular values (e.g. serialization). + /// + public abstract class KeyExchangeAlgorithm + { + public const int NULL = 0; + public const int RSA = 1; + public const int RSA_EXPORT = 2; + public const int DHE_DSS = 3; + public const int DHE_DSS_EXPORT = 4; + public const int DHE_RSA = 5; + public const int DHE_RSA_EXPORT = 6; + public const int DH_DSS = 7; + public const int DH_DSS_EXPORT = 8; + public const int DH_RSA = 9; + public const int DH_RSA_EXPORT = 10; + public const int DH_anon = 11; + public const int DH_anon_EXPORT = 12; + + /* + * RFC 4279 + */ + public const int PSK = 13; + public const int DHE_PSK = 14; + public const int RSA_PSK = 15; + + /* + * RFC 4429 + */ + public const int ECDH_ECDSA = 16; + public const int ECDHE_ECDSA = 17; + public const int ECDH_RSA = 18; + public const int ECDHE_RSA = 19; + public const int ECDH_anon = 20; + + /* + * RFC 5054 + */ + public const int SRP = 21; + public const int SRP_DSS = 22; + public const int SRP_RSA = 23; + + /* + * RFC 5489 + */ + public const int ECDHE_PSK = 24; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/KeyExchangeAlgorithm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/KeyExchangeAlgorithm.cs.meta new file mode 100644 index 00000000..7881b854 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/KeyExchangeAlgorithm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3ec31da934849f4459d2c54c67c5f005 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs new file mode 100644 index 00000000..8c93b8b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs @@ -0,0 +1,42 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls; + +namespace Org.BouncyCastle.Crypto.Tls +{ + public interface IClientCredentialsProvider + { + TlsCredentials GetClientCredentials(TlsContext context, CertificateRequest certificateRequest); + } + + /// + /// A temporary class to wrap old CertificateVerifyer stuff for new TlsAuthentication. + /// + public class LegacyTlsAuthentication : TlsAuthentication + { + protected ICertificateVerifyer verifyer; + protected IClientCredentialsProvider credProvider; + protected Uri TargetUri; + + public LegacyTlsAuthentication(Uri targetUri, ICertificateVerifyer verifyer, IClientCredentialsProvider prov) + { + this.TargetUri = targetUri; + this.verifyer = verifyer; + this.credProvider = prov; + } + + public virtual void NotifyServerCertificate(Certificate serverCertificate) + { + if (!this.verifyer.IsValid(this.TargetUri, serverCertificate.GetCertificateList())) + throw new TlsFatalAlert(AlertDescription.user_canceled); + } + + public virtual TlsCredentials GetClientCredentials(TlsContext context, CertificateRequest certificateRequest) + { + return credProvider == null ? null : credProvider.GetClientCredentials(context, certificateRequest); + } + } +} + +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs.meta new file mode 100644 index 00000000..f39f17b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e309837f2448ec6498bc6ceaf8008b56 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs new file mode 100644 index 00000000..1e9d3db1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) + +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls; + +namespace Org.BouncyCastle.Crypto.Tls +{ + /// + /// A temporary class to use LegacyTlsAuthentication + /// + public sealed class LegacyTlsClient : DefaultTlsClient + { + private readonly Uri TargetUri; + private readonly ICertificateVerifyer verifyer; + private readonly IClientCredentialsProvider credProvider; + + public LegacyTlsClient(Uri targetUri, ICertificateVerifyer verifyer, IClientCredentialsProvider prov, System.Collections.Generic.List hostNames) + { + this.TargetUri = targetUri; + this.verifyer = verifyer; + this.credProvider = prov; + this.HostNames = hostNames; + } + + public override TlsAuthentication GetAuthentication() + { + return new LegacyTlsAuthentication(this.TargetUri, verifyer, credProvider); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs.meta new file mode 100644 index 00000000..e19cedd0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 63f0e2a08c9284b4f90c89cb0627eff4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MacAlgorithm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MacAlgorithm.cs new file mode 100644 index 00000000..bee313c1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MacAlgorithm.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 2246 + /// + /// Note that the values here are implementation-specific and arbitrary. It is recommended not to + /// depend on the particular values (e.g. serialization). + /// + public abstract class MacAlgorithm + { + public const int cls_null = 0; + public const int md5 = 1; + public const int sha = 2; + + /* + * RFC 5246 + */ + public const int hmac_md5 = md5; + public const int hmac_sha1 = sha; + public const int hmac_sha256 = 3; + public const int hmac_sha384 = 4; + public const int hmac_sha512 = 5; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MacAlgorithm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MacAlgorithm.cs.meta new file mode 100644 index 00000000..557386dd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MacAlgorithm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0097a03fc57753c40931a7c115b2df0e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MaxFragmentLength.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MaxFragmentLength.cs new file mode 100644 index 00000000..d611b2c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MaxFragmentLength.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class MaxFragmentLength + { + /* + * RFC 3546 3.2. + */ + public const byte pow2_9 = 1; + public const byte pow2_10 = 2; + public const byte pow2_11 = 3; + public const byte pow2_12 = 4; + + public static bool IsValid(byte maxFragmentLength) + { + return maxFragmentLength >= pow2_9 && maxFragmentLength <= pow2_12; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MaxFragmentLength.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MaxFragmentLength.cs.meta new file mode 100644 index 00000000..1720f347 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/MaxFragmentLength.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8fe16c772a3380242beabd576ef7e256 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NameType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NameType.cs new file mode 100644 index 00000000..74417afb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NameType.cs @@ -0,0 +1,21 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class NameType + { + /* + * RFC 3546 3.1. + */ + public const byte host_name = 0; + + public static bool IsValid(byte nameType) + { + return nameType == host_name; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NameType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NameType.cs.meta new file mode 100644 index 00000000..93d90e3a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NameType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f309541f5f97b9d4fbf72b2311ffbd25 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NamedCurve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NamedCurve.cs new file mode 100644 index 00000000..fadfdf48 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NamedCurve.cs @@ -0,0 +1,81 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// RFC 4492 5.1.1 + /// The named curves defined here are those specified in SEC 2 [13]. Note that many of + /// these curves are also recommended in ANSI X9.62 [7] and FIPS 186-2 [11]. Values 0xFE00 + /// through 0xFEFF are reserved for private use. Values 0xFF01 and 0xFF02 indicate that the + /// client supports arbitrary prime and characteristic-2 curves, respectively (the curve + /// parameters must be encoded explicitly in ECParameters). + /// + public abstract class NamedCurve + { + public const int sect163k1 = 1; + public const int sect163r1 = 2; + public const int sect163r2 = 3; + public const int sect193r1 = 4; + public const int sect193r2 = 5; + public const int sect233k1 = 6; + public const int sect233r1 = 7; + public const int sect239k1 = 8; + public const int sect283k1 = 9; + public const int sect283r1 = 10; + public const int sect409k1 = 11; + public const int sect409r1 = 12; + public const int sect571k1 = 13; + public const int sect571r1 = 14; + public const int secp160k1 = 15; + public const int secp160r1 = 16; + public const int secp160r2 = 17; + public const int secp192k1 = 18; + public const int secp192r1 = 19; + public const int secp224k1 = 20; + public const int secp224r1 = 21; + public const int secp256k1 = 22; + public const int secp256r1 = 23; + public const int secp384r1 = 24; + public const int secp521r1 = 25; + + /* + * RFC 7027 + */ + public const int brainpoolP256r1 = 26; + public const int brainpoolP384r1 = 27; + public const int brainpoolP512r1 = 28; + + /* + * reserved (0xFE00..0xFEFF) + */ + + public const int arbitrary_explicit_prime_curves = 0xFF01; + public const int arbitrary_explicit_char2_curves = 0xFF02; + + public static bool IsValid(int namedCurve) + { + return (namedCurve >= sect163k1 && namedCurve <= brainpoolP512r1) + || (namedCurve >= arbitrary_explicit_prime_curves && namedCurve <= arbitrary_explicit_char2_curves); + } + + public static bool RefersToASpecificNamedCurve(int namedCurve) + { + switch (namedCurve) + { + case arbitrary_explicit_prime_curves: + case arbitrary_explicit_char2_curves: + return false; + default: + return true; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NamedCurve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NamedCurve.cs.meta new file mode 100644 index 00000000..dd7667b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NamedCurve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea610a144bac59e4692df166bac37dd8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NewSessionTicket.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NewSessionTicket.cs new file mode 100644 index 00000000..c95a5aae --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NewSessionTicket.cs @@ -0,0 +1,57 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class NewSessionTicket + { + protected readonly long mTicketLifetimeHint; + protected readonly byte[] mTicket; + + public NewSessionTicket(long ticketLifetimeHint, byte[] ticket) + { + this.mTicketLifetimeHint = ticketLifetimeHint; + this.mTicket = ticket; + } + + public virtual long TicketLifetimeHint + { + get { return mTicketLifetimeHint; } + } + + public virtual byte[] Ticket + { + get { return mTicket; } + } + + /** + * Encode this {@link NewSessionTicket} to a {@link Stream}. + * + * @param output the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + TlsUtilities.WriteUint32(mTicketLifetimeHint, output); + TlsUtilities.WriteOpaque16(mTicket, output); + } + + /** + * Parse a {@link NewSessionTicket} from a {@link Stream}. + * + * @param input the {@link Stream} to parse from. + * @return a {@link NewSessionTicket} object. + * @throws IOException + */ + public static NewSessionTicket Parse(Stream input) + { + long ticketLifetimeHint = TlsUtilities.ReadUint32(input); + byte[] ticket = TlsUtilities.ReadOpaque16(input); + return new NewSessionTicket(ticketLifetimeHint, ticket); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NewSessionTicket.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NewSessionTicket.cs.meta new file mode 100644 index 00000000..d12a9723 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/NewSessionTicket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93abceb59e82eb9418fd94289540c1bf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/OcspStatusRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/OcspStatusRequest.cs new file mode 100644 index 00000000..4ca37986 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/OcspStatusRequest.cs @@ -0,0 +1,135 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * RFC 3546 3.6 + */ + public class OcspStatusRequest + { + protected readonly IList mResponderIDList; + protected readonly X509Extensions mRequestExtensions; + + /** + * @param responderIDList + * an {@link IList} of {@link ResponderID}, specifying the list of trusted OCSP + * responders. An empty list has the special meaning that the responders are + * implicitly known to the server - e.g., by prior arrangement. + * @param requestExtensions + * OCSP request extensions. A null value means that there are no extensions. + */ + public OcspStatusRequest(IList responderIDList, X509Extensions requestExtensions) + { + this.mResponderIDList = responderIDList; + this.mRequestExtensions = requestExtensions; + } + + /** + * @return an {@link IList} of {@link ResponderID} + */ + public virtual IList ResponderIDList + { + get { return mResponderIDList; } + } + + /** + * @return OCSP request extensions + */ + public virtual X509Extensions RequestExtensions + { + get { return mRequestExtensions; } + } + + /** + * Encode this {@link OcspStatusRequest} to a {@link Stream}. + * + * @param output + * the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + if (mResponderIDList == null || mResponderIDList.Count < 1) + { + TlsUtilities.WriteUint16(0, output); + } + else + { + MemoryStream buf = new MemoryStream(); + for (int i = 0; i < mResponderIDList.Count; ++i) + { + ResponderID responderID = (ResponderID)mResponderIDList[i]; + byte[] derEncoding = responderID.GetEncoded(Asn1Encodable.Der); + TlsUtilities.WriteOpaque16(derEncoding, buf); + } + TlsUtilities.CheckUint16(buf.Length); + TlsUtilities.WriteUint16((int)buf.Length, output); + Streams.WriteBufTo(buf, output); + } + + if (mRequestExtensions == null) + { + TlsUtilities.WriteUint16(0, output); + } + else + { + byte[] derEncoding = mRequestExtensions.GetEncoded(Asn1Encodable.Der); + TlsUtilities.CheckUint16(derEncoding.Length); + TlsUtilities.WriteUint16(derEncoding.Length, output); + output.Write(derEncoding, 0, derEncoding.Length); + } + } + + /** + * Parse a {@link OcspStatusRequest} from a {@link Stream}. + * + * @param input + * the {@link Stream} to parse from. + * @return an {@link OcspStatusRequest} object. + * @throws IOException + */ + public static OcspStatusRequest Parse(Stream input) + { + IList responderIDList = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + { + int length = TlsUtilities.ReadUint16(input); + if (length > 0) + { + byte[] data = TlsUtilities.ReadFully(length, input); + MemoryStream buf = new MemoryStream(data, false); + do + { + byte[] derEncoding = TlsUtilities.ReadOpaque16(buf); + ResponderID responderID = ResponderID.GetInstance(TlsUtilities.ReadDerObject(derEncoding)); + responderIDList.Add(responderID); + } + while (buf.Position < buf.Length); + } + } + + X509Extensions requestExtensions = null; + { + int length = TlsUtilities.ReadUint16(input); + if (length > 0) + { + byte[] derEncoding = TlsUtilities.ReadFully(length, input); + requestExtensions = X509Extensions.GetInstance(TlsUtilities.ReadDerObject(derEncoding)); + } + } + + return new OcspStatusRequest(responderIDList, requestExtensions); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/OcspStatusRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/OcspStatusRequest.cs.meta new file mode 100644 index 00000000..3a4c9a01 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/OcspStatusRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2eb26ad027843b746b3453768e6c5ac5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PrfAlgorithm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PrfAlgorithm.cs new file mode 100644 index 00000000..7ca88687 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PrfAlgorithm.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 5246 + /// + /// Note that the values here are implementation-specific and arbitrary. It is recommended not to + /// depend on the particular values (e.g. serialization). + /// + public abstract class PrfAlgorithm + { + /* + * Placeholder to refer to the legacy TLS algorithm + */ + public const int tls_prf_legacy = 0; + + public const int tls_prf_sha256 = 1; + + /* + * Implied by RFC 5288 + */ + public const int tls_prf_sha384 = 2; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PrfAlgorithm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PrfAlgorithm.cs.meta new file mode 100644 index 00000000..ec0caf1e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PrfAlgorithm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3a280a86cd18384c9650c60935f3f4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ProtocolVersion.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ProtocolVersion.cs new file mode 100644 index 00000000..7d2758e4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ProtocolVersion.cs @@ -0,0 +1,163 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public sealed class ProtocolVersion + { + public static readonly ProtocolVersion SSLv3 = new ProtocolVersion(0x0300, "SSL 3.0"); + public static readonly ProtocolVersion TLSv10 = new ProtocolVersion(0x0301, "TLS 1.0"); + public static readonly ProtocolVersion TLSv11 = new ProtocolVersion(0x0302, "TLS 1.1"); + public static readonly ProtocolVersion TLSv12 = new ProtocolVersion(0x0303, "TLS 1.2"); + public static readonly ProtocolVersion DTLSv10 = new ProtocolVersion(0xFEFF, "DTLS 1.0"); + public static readonly ProtocolVersion DTLSv12 = new ProtocolVersion(0xFEFD, "DTLS 1.2"); + + private readonly int version; + private readonly String name; + + private ProtocolVersion(int v, String name) + { + this.version = v & 0xffff; + this.name = name; + } + + public int FullVersion + { + get { return version; } + } + + public int MajorVersion + { + get { return version >> 8; } + } + + public int MinorVersion + { + get { return version & 0xff; } + } + + public bool IsDtls + { + get { return MajorVersion == 0xFE; } + } + + public bool IsSsl + { + get { return this == SSLv3; } + } + + public bool IsTls + { + get { return MajorVersion == 0x03; } + } + + public ProtocolVersion GetEquivalentTLSVersion() + { + if (!IsDtls) + { + return this; + } + if (this == DTLSv10) + { + return TLSv11; + } + return TLSv12; + } + + public bool IsEqualOrEarlierVersionOf(ProtocolVersion version) + { + if (MajorVersion != version.MajorVersion) + { + return false; + } + int diffMinorVersion = version.MinorVersion - MinorVersion; + return IsDtls ? diffMinorVersion <= 0 : diffMinorVersion >= 0; + } + + public bool IsLaterVersionOf(ProtocolVersion version) + { + if (MajorVersion != version.MajorVersion) + { + return false; + } + int diffMinorVersion = version.MinorVersion - MinorVersion; + return IsDtls ? diffMinorVersion > 0 : diffMinorVersion < 0; + } + + public override bool Equals(object other) + { + return this == other || (other is ProtocolVersion && Equals((ProtocolVersion)other)); + } + + public bool Equals(ProtocolVersion other) + { + return other != null && this.version == other.version; + } + + public override int GetHashCode() + { + return version; + } + + /// + public static ProtocolVersion Get(int major, int minor) + { + switch (major) + { + case 0x03: + { + switch (minor) + { + case 0x00: + return SSLv3; + case 0x01: + return TLSv10; + case 0x02: + return TLSv11; + case 0x03: + return TLSv12; + } + return GetUnknownVersion(major, minor, "TLS"); + } + case 0xFE: + { + switch (minor) + { + case 0xFF: + return DTLSv10; + case 0xFE: + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + case 0xFD: + return DTLSv12; + } + return GetUnknownVersion(major, minor, "DTLS"); + } + default: + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + } + + public override string ToString() + { + return name; + } + + private static ProtocolVersion GetUnknownVersion(int major, int minor, string prefix) + { + TlsUtilities.CheckUint8(major); + TlsUtilities.CheckUint8(minor); + + int v = (major << 8) | minor; + String hex = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(Convert.ToString(0x10000 | v, 16).Substring(1)); + return new ProtocolVersion(v, prefix + " 0x" + hex); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ProtocolVersion.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ProtocolVersion.cs.meta new file mode 100644 index 00000000..4a616d16 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ProtocolVersion.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6379f9b46678ef4b942095480ee3e36 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsClient.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsClient.cs new file mode 100644 index 00000000..1a5053e4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsClient.cs @@ -0,0 +1,79 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class PskTlsClient + : AbstractTlsClient + { + protected TlsDHVerifier mDHVerifier; + protected TlsPskIdentity mPskIdentity; + + public PskTlsClient(TlsPskIdentity pskIdentity) + : this(new DefaultTlsCipherFactory(), pskIdentity) + { + } + + public PskTlsClient(TlsCipherFactory cipherFactory, TlsPskIdentity pskIdentity) + : this(cipherFactory, new DefaultTlsDHVerifier(), pskIdentity) + { + } + + public PskTlsClient(TlsCipherFactory cipherFactory, TlsDHVerifier dhVerifier, TlsPskIdentity pskIdentity) + : base(cipherFactory) + { + this.mDHVerifier = dhVerifier; + this.mPskIdentity = pskIdentity; + } + + public override int[] GetCipherSuites() + { + return new int[] + { + CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, + CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, + }; + } + + public override TlsKeyExchange GetKeyExchange() + { + int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite); + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.DHE_PSK: + case KeyExchangeAlgorithm.ECDHE_PSK: + case KeyExchangeAlgorithm.PSK: + case KeyExchangeAlgorithm.RSA_PSK: + return CreatePskKeyExchange(keyExchangeAlgorithm); + + default: + /* + * Note: internal error here; the TlsProtocol implementation verifies that the + * server-selected cipher suite was in the list of client-offered cipher suites, so if + * we now can't produce an implementation, we shouldn't have offered it! + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public override TlsAuthentication GetAuthentication() + { + /* + * Note: This method is not called unless a server certificate is sent, which may be the + * case e.g. for RSA_PSK key exchange. + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + protected virtual TlsKeyExchange CreatePskKeyExchange(int keyExchange) + { + return new TlsPskKeyExchange(keyExchange, mSupportedSignatureAlgorithms, mPskIdentity, null, mDHVerifier, null, + mNamedCurves, mClientECPointFormats, mServerECPointFormats); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsClient.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsClient.cs.meta new file mode 100644 index 00000000..7d7fc26a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4274930b17c9f4e43b333e9d0cd33c9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsServer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsServer.cs new file mode 100644 index 00000000..6f344909 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsServer.cs @@ -0,0 +1,97 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class PskTlsServer + : AbstractTlsServer + { + protected TlsPskIdentityManager mPskIdentityManager; + + public PskTlsServer(TlsPskIdentityManager pskIdentityManager) + : this(new DefaultTlsCipherFactory(), pskIdentityManager) + { + } + + public PskTlsServer(TlsCipherFactory cipherFactory, TlsPskIdentityManager pskIdentityManager) + : base(cipherFactory) + { + this.mPskIdentityManager = pskIdentityManager; + } + + protected virtual TlsEncryptionCredentials GetRsaEncryptionCredentials() + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + protected virtual DHParameters GetDHParameters() + { + return DHStandardGroups.rfc7919_ffdhe2048; + } + + protected override int[] GetCipherSuites() + { + return new int[] + { + CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, + CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, + CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, + CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA + }; + } + + public override TlsCredentials GetCredentials() + { + int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite); + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.DHE_PSK: + case KeyExchangeAlgorithm.ECDHE_PSK: + case KeyExchangeAlgorithm.PSK: + return null; + + case KeyExchangeAlgorithm.RSA_PSK: + return GetRsaEncryptionCredentials(); + + default: + /* Note: internal error here; selected a key exchange we don't implement! */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public override TlsKeyExchange GetKeyExchange() + { + int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite); + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.DHE_PSK: + case KeyExchangeAlgorithm.ECDHE_PSK: + case KeyExchangeAlgorithm.PSK: + case KeyExchangeAlgorithm.RSA_PSK: + return CreatePskKeyExchange(keyExchangeAlgorithm); + + default: + /* + * Note: internal error here; the TlsProtocol implementation verifies that the + * server-selected cipher suite was in the list of client-offered cipher suites, so if + * we now can't produce an implementation, we shouldn't have offered it! + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + protected virtual TlsKeyExchange CreatePskKeyExchange(int keyExchange) + { + return new TlsPskKeyExchange(keyExchange, mSupportedSignatureAlgorithms, null, mPskIdentityManager, + null, GetDHParameters(), mNamedCurves, mClientECPointFormats, mServerECPointFormats); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsServer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsServer.cs.meta new file mode 100644 index 00000000..8e333539 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/PskTlsServer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51a5a718e06e6724daa8dfa7c9ea0d3e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/RecordStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/RecordStream.cs new file mode 100644 index 00000000..52b7cbd6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/RecordStream.cs @@ -0,0 +1,418 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// An implementation of the TLS 1.0/1.1/1.2 record layer, allowing downgrade to SSLv3. + internal sealed class RecordStream + { + private const int DEFAULT_PLAINTEXT_LIMIT = (1 << 14); + + internal const int TLS_HEADER_SIZE = 5; + internal const int TLS_HEADER_TYPE_OFFSET = 0; + internal const int TLS_HEADER_VERSION_OFFSET = 1; + internal const int TLS_HEADER_LENGTH_OFFSET = 3; + + private TlsProtocol mHandler; + private Stream mInput; + private Stream mOutput; + private TlsCompression mPendingCompression = null, mReadCompression = null, mWriteCompression = null; + private TlsCipher mPendingCipher = null, mReadCipher = null, mWriteCipher = null; + private SequenceNumber mReadSeqNo = new SequenceNumber(), mWriteSeqNo = new SequenceNumber(); + private MemoryStream mBuffer = new MemoryStream(); + + private TlsHandshakeHash mHandshakeHash = null; + private readonly BaseOutputStream mHandshakeHashUpdater; + + private ProtocolVersion mReadVersion = null, mWriteVersion = null; + private bool mRestrictReadVersion = true; + + private int mPlaintextLimit, mCompressedLimit, mCiphertextLimit; + + internal RecordStream(TlsProtocol handler, Stream input, Stream output) + { + this.mHandler = handler; + this.mInput = input; + this.mOutput = output; + this.mReadCompression = new TlsNullCompression(); + this.mWriteCompression = this.mReadCompression; + this.mHandshakeHashUpdater = new HandshakeHashUpdateStream(this); + } + + internal /*virtual*/ void Init(TlsContext context) + { + this.mReadCipher = new TlsNullCipher(context); + this.mWriteCipher = this.mReadCipher; + this.mHandshakeHash = new DeferredHash(); + this.mHandshakeHash.Init(context); + + SetPlaintextLimit(DEFAULT_PLAINTEXT_LIMIT); + } + + internal /*virtual*/ int GetPlaintextLimit() + { + return mPlaintextLimit; + } + + internal /*virtual*/ void SetPlaintextLimit(int plaintextLimit) + { + this.mPlaintextLimit = plaintextLimit; + this.mCompressedLimit = this.mPlaintextLimit + 1024; + this.mCiphertextLimit = this.mCompressedLimit + 1024; + } + + internal /*virtual*/ ProtocolVersion ReadVersion + { + get { return mReadVersion; } + set { this.mReadVersion = value; } + } + + internal /*virtual*/ void SetWriteVersion(ProtocolVersion writeVersion) + { + this.mWriteVersion = writeVersion; + } + + /** + * RFC 5246 E.1. "Earlier versions of the TLS specification were not fully clear on what the + * record layer version number (TLSPlaintext.version) should contain when sending ClientHello + * (i.e., before it is known which version of the protocol will be employed). Thus, TLS servers + * compliant with this specification MUST accept any value {03,XX} as the record layer version + * number for ClientHello." + */ + internal /*virtual*/ void SetRestrictReadVersion(bool enabled) + { + this.mRestrictReadVersion = enabled; + } + + internal /*virtual*/ void SetPendingConnectionState(TlsCompression tlsCompression, TlsCipher tlsCipher) + { + this.mPendingCompression = tlsCompression; + this.mPendingCipher = tlsCipher; + } + + internal /*virtual*/ void SentWriteCipherSpec() + { + if (mPendingCompression == null || mPendingCipher == null) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + + this.mWriteCompression = this.mPendingCompression; + this.mWriteCipher = this.mPendingCipher; + this.mWriteSeqNo = new SequenceNumber(); + } + + internal /*virtual*/ void ReceivedReadCipherSpec() + { + if (mPendingCompression == null || mPendingCipher == null) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + + this.mReadCompression = this.mPendingCompression; + this.mReadCipher = this.mPendingCipher; + this.mReadSeqNo = new SequenceNumber(); + } + + internal /*virtual*/ void FinaliseHandshake() + { + if (mReadCompression != mPendingCompression || mWriteCompression != mPendingCompression + || mReadCipher != mPendingCipher || mWriteCipher != mPendingCipher) + { + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + this.mPendingCompression = null; + this.mPendingCipher = null; + } + + internal /*virtual*/ void CheckRecordHeader(byte[] recordHeader) + { + byte type = TlsUtilities.ReadUint8(recordHeader, TLS_HEADER_TYPE_OFFSET); + + /* + * RFC 5246 6. If a TLS implementation receives an unexpected record type, it MUST send an + * unexpected_message alert. + */ + CheckType(type, AlertDescription.unexpected_message); + + if (!mRestrictReadVersion) + { + int version = TlsUtilities.ReadVersionRaw(recordHeader, TLS_HEADER_VERSION_OFFSET); + if ((version & 0xffffff00) != 0x0300) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + else + { + ProtocolVersion version = TlsUtilities.ReadVersion(recordHeader, TLS_HEADER_VERSION_OFFSET); + if (mReadVersion == null) + { + // Will be set later in 'readRecord' + } + else if (!version.Equals(mReadVersion)) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + + int length = TlsUtilities.ReadUint16(recordHeader, TLS_HEADER_LENGTH_OFFSET); + + CheckLength(length, mCiphertextLimit, AlertDescription.record_overflow); + } + + internal /*virtual*/ bool ReadRecord() + { + byte[] recordHeader = TlsUtilities.ReadAllOrNothing(TLS_HEADER_SIZE, mInput); + if (recordHeader == null) + return false; + + byte type = TlsUtilities.ReadUint8(recordHeader, TLS_HEADER_TYPE_OFFSET); + + /* + * RFC 5246 6. If a TLS implementation receives an unexpected record type, it MUST send an + * unexpected_message alert. + */ + CheckType(type, AlertDescription.unexpected_message); + + if (!mRestrictReadVersion) + { + int version = TlsUtilities.ReadVersionRaw(recordHeader, TLS_HEADER_VERSION_OFFSET); + if ((version & 0xffffff00) != 0x0300) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + else + { + ProtocolVersion version = TlsUtilities.ReadVersion(recordHeader, TLS_HEADER_VERSION_OFFSET); + if (mReadVersion == null) + { + mReadVersion = version; + } + else if (!version.Equals(mReadVersion)) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + + int length = TlsUtilities.ReadUint16(recordHeader, TLS_HEADER_LENGTH_OFFSET); + + CheckLength(length, mCiphertextLimit, AlertDescription.record_overflow); + + byte[] plaintext = DecodeAndVerify(type, mInput, length); + mHandler.ProcessRecord(type, plaintext, 0, plaintext.Length); + return true; + } + + internal /*virtual*/ byte[] DecodeAndVerify(byte type, Stream input, int len) + { + byte[] buf = TlsUtilities.ReadFully(len, input); + + long seqNo = mReadSeqNo.NextValue(AlertDescription.unexpected_message); + byte[] decoded = mReadCipher.DecodeCiphertext(seqNo, type, buf, 0, buf.Length); + + CheckLength(decoded.Length, mCompressedLimit, AlertDescription.record_overflow); + + /* + * TODO 5246 6.2.2. Implementation note: Decompression functions are responsible for + * ensuring that messages cannot cause internal buffer overflows. + */ + Stream cOut = mReadCompression.Decompress(mBuffer); + if (cOut != mBuffer) + { + cOut.Write(decoded, 0, decoded.Length); + cOut.Flush(); + decoded = GetBufferContents(); + } + + /* + * RFC 5246 6.2.2. If the decompression function encounters a TLSCompressed.fragment that + * would decompress to a length in excess of 2^14 bytes, it should report a fatal + * decompression failure error. + */ + CheckLength(decoded.Length, mPlaintextLimit, AlertDescription.decompression_failure); + + /* + * RFC 5246 6.2.1 Implementations MUST NOT send zero-length fragments of Handshake, Alert, + * or ChangeCipherSpec content types. + */ + if (decoded.Length < 1 && type != ContentType.application_data) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + return decoded; + } + + internal /*virtual*/ void WriteRecord(byte type, byte[] plaintext, int plaintextOffset, int plaintextLength) + { + // Never send anything until a valid ClientHello has been received + if (mWriteVersion == null) + return; + + /* + * RFC 5246 6. Implementations MUST NOT send record types not defined in this document + * unless negotiated by some extension. + */ + CheckType(type, AlertDescription.internal_error); + + /* + * RFC 5246 6.2.1 The length should not exceed 2^14. + */ + CheckLength(plaintextLength, mPlaintextLimit, AlertDescription.internal_error); + + /* + * RFC 5246 6.2.1 Implementations MUST NOT send zero-length fragments of Handshake, Alert, + * or ChangeCipherSpec content types. + */ + if (plaintextLength < 1 && type != ContentType.application_data) + throw new TlsFatalAlert(AlertDescription.internal_error); + + Stream cOut = mWriteCompression.Compress(mBuffer); + + long seqNo = mWriteSeqNo.NextValue(AlertDescription.internal_error); + + byte[] ciphertext; + if (cOut == mBuffer) + { + ciphertext = mWriteCipher.EncodePlaintext(seqNo, type, plaintext, plaintextOffset, plaintextLength); + } + else + { + cOut.Write(plaintext, plaintextOffset, plaintextLength); + cOut.Flush(); + byte[] compressed = GetBufferContents(); + + /* + * RFC 5246 6.2.2. Compression must be lossless and may not increase the content length + * by more than 1024 bytes. + */ + CheckLength(compressed.Length, plaintextLength + 1024, AlertDescription.internal_error); + + ciphertext = mWriteCipher.EncodePlaintext(seqNo, type, compressed, 0, compressed.Length); + } + + /* + * RFC 5246 6.2.3. The length may not exceed 2^14 + 2048. + */ + CheckLength(ciphertext.Length, mCiphertextLimit, AlertDescription.internal_error); + + int recordLength = ciphertext.Length + TLS_HEADER_SIZE; + byte[] record = BestHTTP.Extensions.VariableSizedBufferPool.Get(recordLength, true); + TlsUtilities.WriteUint8(type, record, TLS_HEADER_TYPE_OFFSET); + TlsUtilities.WriteVersion(mWriteVersion, record, TLS_HEADER_VERSION_OFFSET); + TlsUtilities.WriteUint16(ciphertext.Length, record, TLS_HEADER_LENGTH_OFFSET); + Array.Copy(ciphertext, 0, record, TLS_HEADER_SIZE, ciphertext.Length); + mOutput.Write(record, 0, recordLength); + BestHTTP.Extensions.VariableSizedBufferPool.Release(record); + mOutput.Flush(); + } + + internal /*virtual*/ void NotifyHelloComplete() + { + this.mHandshakeHash = mHandshakeHash.NotifyPrfDetermined(); + } + + internal /*virtual*/ TlsHandshakeHash HandshakeHash + { + get { return mHandshakeHash; } + } + + internal /*virtual*/ Stream HandshakeHashUpdater + { + get { return mHandshakeHashUpdater; } + } + + internal /*virtual*/ TlsHandshakeHash PrepareToFinish() + { + TlsHandshakeHash result = mHandshakeHash; + this.mHandshakeHash = mHandshakeHash.StopTracking(); + return result; + } + + internal /*virtual*/ void SafeClose() + { + try + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(mInput); + } + catch (IOException) + { + } + + try + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(mOutput); + } + catch (IOException) + { + } + } + + internal /*virtual*/ void Flush() + { + mOutput.Flush(); + } + + private byte[] GetBufferContents() + { + byte[] contents = mBuffer.ToArray(); + mBuffer.SetLength(0); + return contents; + } + + private static void CheckType(byte type, byte alertDescription) + { + switch (type) + { + case ContentType.application_data: + case ContentType.alert: + case ContentType.change_cipher_spec: + case ContentType.handshake: + //case ContentType.heartbeat: + break; + default: + throw new TlsFatalAlert(alertDescription); + } + } + + private static void CheckLength(int length, int limit, byte alertDescription) + { + if (length > limit) + throw new TlsFatalAlert(alertDescription); + } + + private class HandshakeHashUpdateStream + : BaseOutputStream + { + private readonly RecordStream mOuter; + public HandshakeHashUpdateStream(RecordStream mOuter) + { + this.mOuter = mOuter; + } + + public override void Write(byte[] buf, int off, int len) + { + mOuter.mHandshakeHash.BlockUpdate(buf, off, len); + } + } + + private class SequenceNumber + { + private long value = 0L; + private bool exhausted = false; + + internal long NextValue(byte alertDescription) + { + if (exhausted) + { + throw new TlsFatalAlert(alertDescription); + } + long result = value; + if (++value == 0) + { + exhausted = true; + } + return result; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/RecordStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/RecordStream.cs.meta new file mode 100644 index 00000000..4ef894a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/RecordStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31e36fd85b9d4fd4a99eb864a0ef112e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SecurityParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SecurityParameters.cs new file mode 100644 index 00000000..57f058c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SecurityParameters.cs @@ -0,0 +1,112 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class SecurityParameters + { + internal int entity = -1; + internal int cipherSuite = -1; + internal byte compressionAlgorithm = CompressionMethod.cls_null; + internal int prfAlgorithm = -1; + internal int verifyDataLength = -1; + internal byte[] masterSecret = null; + internal byte[] clientRandom = null; + internal byte[] serverRandom = null; + internal byte[] sessionHash = null; + internal byte[] pskIdentity = null; + internal byte[] srpIdentity = null; + + // TODO Keep these internal, since it's maybe not the ideal place for them + internal short maxFragmentLength = -1; + internal bool truncatedHMac = false; + internal bool encryptThenMac = false; + internal bool extendedMasterSecret = false; + + internal virtual void Clear() + { + if (this.masterSecret != null) + { + Arrays.Fill(this.masterSecret, (byte)0); + this.masterSecret = null; + } + } + + /** + * @return {@link ConnectionEnd} + */ + public virtual int Entity + { + get { return entity; } + } + + /** + * @return {@link CipherSuite} + */ + public virtual int CipherSuite + { + get { return cipherSuite; } + } + + /** + * @return {@link CompressionMethod} + */ + public virtual byte CompressionAlgorithm + { + get { return compressionAlgorithm; } + } + + /** + * @return {@link PRFAlgorithm} + */ + public virtual int PrfAlgorithm + { + get { return prfAlgorithm; } + } + + public virtual int VerifyDataLength + { + get { return verifyDataLength; } + } + + public virtual byte[] MasterSecret + { + get { return masterSecret; } + } + + public virtual byte[] ClientRandom + { + get { return clientRandom; } + } + + public virtual byte[] ServerRandom + { + get { return serverRandom; } + } + + public virtual byte[] SessionHash + { + get { return sessionHash; } + } + + public virtual byte[] PskIdentity + { + get { return pskIdentity; } + } + + public virtual byte[] SrpIdentity + { + get { return srpIdentity; } + } + + public virtual bool IsExtendedMasterSecret + { + get { return extendedMasterSecret; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SecurityParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SecurityParameters.cs.meta new file mode 100644 index 00000000..10e4772f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SecurityParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 052c0351b35336f4fbebef23e845bb71 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerDHParams.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerDHParams.cs new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerDHParams.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerDHParams.cs.meta new file mode 100644 index 00000000..30fb6715 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerDHParams.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: bc85256928a3962439d4054da18404b0 +timeCreated: 1547126420 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerName.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerName.cs new file mode 100644 index 00000000..7d4d6e48 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerName.cs @@ -0,0 +1,109 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class ServerName + { + protected readonly byte mNameType; + protected readonly object mName; + + public ServerName(byte nameType, object name) + { + if (!IsCorrectType(nameType, name)) + throw new ArgumentException("not an instance of the correct type", "name"); + + this.mNameType = nameType; + this.mName = name; + } + + public virtual byte NameType + { + get { return mNameType; } + } + + public virtual object Name + { + get { return mName; } + } + + public virtual string GetHostName() + { + if (!IsCorrectType(Tls.NameType.host_name, mName)) + throw new InvalidOperationException("'name' is not a HostName string"); + + return (string)mName; + } + + /** + * Encode this {@link ServerName} to a {@link Stream}. + * + * @param output + * the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + TlsUtilities.WriteUint8(mNameType, output); + + switch (mNameType) + { + case Tls.NameType.host_name: + byte[] asciiEncoding = Strings.ToAsciiByteArray((string)mName); + if (asciiEncoding.Length < 1) + throw new TlsFatalAlert(AlertDescription.internal_error); + TlsUtilities.WriteOpaque16(asciiEncoding, output); + break; + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + /** + * Parse a {@link ServerName} from a {@link Stream}. + * + * @param input + * the {@link Stream} to parse from. + * @return a {@link ServerName} object. + * @throws IOException + */ + public static ServerName Parse(Stream input) + { + byte name_type = TlsUtilities.ReadUint8(input); + object name; + + switch (name_type) + { + case Tls.NameType.host_name: + { + byte[] asciiEncoding = TlsUtilities.ReadOpaque16(input); + if (asciiEncoding.Length < 1) + throw new TlsFatalAlert(AlertDescription.decode_error); + name = Strings.FromAsciiByteArray(asciiEncoding); + break; + } + default: + throw new TlsFatalAlert(AlertDescription.decode_error); + } + + return new ServerName(name_type, name); + } + + protected static bool IsCorrectType(byte nameType, object name) + { + switch (nameType) + { + case Tls.NameType.host_name: + return name is string; + default: + throw new ArgumentException("unsupported NameType", "nameType"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerName.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerName.cs.meta new file mode 100644 index 00000000..72587996 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerName.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3df32b0fc4d3c734aa5301dd1b86ba0c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerNameList.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerNameList.cs new file mode 100644 index 00000000..7a12b89d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerNameList.cs @@ -0,0 +1,109 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class ServerNameList + { + protected readonly IList mServerNameList; + + /** + * @param serverNameList an {@link IList} of {@link ServerName}. + */ + public ServerNameList(IList serverNameList) + { + if (serverNameList == null) + throw new ArgumentNullException("serverNameList"); + + this.mServerNameList = serverNameList; + } + + /** + * @return an {@link IList} of {@link ServerName}. + */ + public virtual IList ServerNames + { + get { return mServerNameList; } + } + + /** + * Encode this {@link ServerNameList} to a {@link Stream}. + * + * @param output + * the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + MemoryStream buf = new MemoryStream(); + + byte[] nameTypesSeen = TlsUtilities.EmptyBytes; + foreach (ServerName entry in ServerNames) + { + nameTypesSeen = CheckNameType(nameTypesSeen, entry.NameType); + if (nameTypesSeen == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + entry.Encode(buf); + } + + TlsUtilities.CheckUint16(buf.Length); + TlsUtilities.WriteUint16((int)buf.Length, output); + Streams.WriteBufTo(buf, output); + } + + /** + * Parse a {@link ServerNameList} from a {@link Stream}. + * + * @param input + * the {@link Stream} to parse from. + * @return a {@link ServerNameList} object. + * @throws IOException + */ + public static ServerNameList Parse(Stream input) + { + int length = TlsUtilities.ReadUint16(input); + if (length < 1) + throw new TlsFatalAlert(AlertDescription.decode_error); + + byte[] data = TlsUtilities.ReadFully(length, input); + + MemoryStream buf = new MemoryStream(data, false); + + byte[] nameTypesSeen = TlsUtilities.EmptyBytes; + IList server_name_list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + while (buf.Position < buf.Length) + { + ServerName entry = ServerName.Parse(buf); + + nameTypesSeen = CheckNameType(nameTypesSeen, entry.NameType); + if (nameTypesSeen == null) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + server_name_list.Add(entry); + } + + return new ServerNameList(server_name_list); + } + + private static byte[] CheckNameType(byte[] nameTypesSeen, byte nameType) + { + /* + * RFC 6066 3. The ServerNameList MUST NOT contain more than one name of the same + * name_type. + */ + if (!NameType.IsValid(nameType) || Arrays.Contains(nameTypesSeen, nameType)) + return null; + + return Arrays.Append(nameTypesSeen, nameType); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerNameList.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerNameList.cs.meta new file mode 100644 index 00000000..1b4f2848 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerNameList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f1d3abc4e8e4859489773087e2c8f99a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerOnlyTlsAuthentication.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerOnlyTlsAuthentication.cs new file mode 100644 index 00000000..893703ca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerOnlyTlsAuthentication.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class ServerOnlyTlsAuthentication + : TlsAuthentication + { + public abstract void NotifyServerCertificate(Certificate serverCertificate); + + public TlsCredentials GetClientCredentials(TlsContext context, CertificateRequest certificateRequest) + { + return null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerOnlyTlsAuthentication.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerOnlyTlsAuthentication.cs.meta new file mode 100644 index 00000000..03eeda49 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerOnlyTlsAuthentication.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b154edbb60457d4ea6269d83d939c21 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerSrpParams.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerSrpParams.cs new file mode 100644 index 00000000..8fc8c6f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerSrpParams.cs @@ -0,0 +1,79 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class ServerSrpParams + { + protected BigInteger m_N, m_g, m_B; + protected byte[] m_s; + + public ServerSrpParams(BigInteger N, BigInteger g, byte[] s, BigInteger B) + { + this.m_N = N; + this.m_g = g; + this.m_s = Arrays.Clone(s); + this.m_B = B; + } + + public virtual BigInteger B + { + get { return m_B; } + } + + public virtual BigInteger G + { + get { return m_g; } + } + + public virtual BigInteger N + { + get { return m_N; } + } + + public virtual byte[] S + { + get { return m_s; } + } + + /** + * Encode this {@link ServerSRPParams} to an {@link OutputStream}. + * + * @param output + * the {@link OutputStream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + TlsSrpUtilities.WriteSrpParameter(m_N, output); + TlsSrpUtilities.WriteSrpParameter(m_g, output); + TlsUtilities.WriteOpaque8(m_s, output); + TlsSrpUtilities.WriteSrpParameter(m_B, output); + } + + /** + * Parse a {@link ServerSRPParams} from an {@link InputStream}. + * + * @param input + * the {@link InputStream} to parse from. + * @return a {@link ServerSRPParams} object. + * @throws IOException + */ + public static ServerSrpParams Parse(Stream input) + { + BigInteger N = TlsSrpUtilities.ReadSrpParameter(input); + BigInteger g = TlsSrpUtilities.ReadSrpParameter(input); + byte[] s = TlsUtilities.ReadOpaque8(input); + BigInteger B = TlsSrpUtilities.ReadSrpParameter(input); + + return new ServerSrpParams(N, g, s, B); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerSrpParams.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerSrpParams.cs.meta new file mode 100644 index 00000000..4beedc4f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/ServerSrpParams.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b5acfd71e2f285a41aa4ac1d54521172 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SessionParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SessionParameters.cs new file mode 100644 index 00000000..96474179 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SessionParameters.cs @@ -0,0 +1,184 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public sealed class SessionParameters + { + public sealed class Builder + { + private int mCipherSuite = -1; + private short mCompressionAlgorithm = -1; + private byte[] mMasterSecret = null; + private Certificate mPeerCertificate = null; + private byte[] mPskIdentity = null; + private byte[] mSrpIdentity = null; + private byte[] mEncodedServerExtensions = null; + private bool mExtendedMasterSecret = false; + + public Builder() + { + } + + public SessionParameters Build() + { + Validate(this.mCipherSuite >= 0, "cipherSuite"); + Validate(this.mCompressionAlgorithm >= 0, "compressionAlgorithm"); + Validate(this.mMasterSecret != null, "masterSecret"); + return new SessionParameters(mCipherSuite, (byte)mCompressionAlgorithm, mMasterSecret, mPeerCertificate, + mPskIdentity, mSrpIdentity, mEncodedServerExtensions, mExtendedMasterSecret); + } + + public Builder SetCipherSuite(int cipherSuite) + { + this.mCipherSuite = cipherSuite; + return this; + } + + public Builder SetCompressionAlgorithm(byte compressionAlgorithm) + { + this.mCompressionAlgorithm = compressionAlgorithm; + return this; + } + + public Builder SetExtendedMasterSecret(bool extendedMasterSecret) + { + this.mExtendedMasterSecret = extendedMasterSecret; + return this; + } + + public Builder SetMasterSecret(byte[] masterSecret) + { + this.mMasterSecret = masterSecret; + return this; + } + + public Builder SetPeerCertificate(Certificate peerCertificate) + { + this.mPeerCertificate = peerCertificate; + return this; + } + + public Builder SetPskIdentity(byte[] pskIdentity) + { + this.mPskIdentity = pskIdentity; + return this; + } + + public Builder SetSrpIdentity(byte[] srpIdentity) + { + this.mSrpIdentity = srpIdentity; + return this; + } + + public Builder SetServerExtensions(IDictionary serverExtensions) + { + if (serverExtensions == null) + { + mEncodedServerExtensions = null; + } + else + { + MemoryStream buf = new MemoryStream(); + TlsProtocol.WriteExtensions(buf, serverExtensions); + mEncodedServerExtensions = buf.ToArray(); + } + return this; + } + + private void Validate(bool condition, string parameter) + { + if (!condition) + throw new InvalidOperationException("Required session parameter '" + parameter + "' not configured"); + } + } + + private int mCipherSuite; + private byte mCompressionAlgorithm; + private byte[] mMasterSecret; + private Certificate mPeerCertificate; + private byte[] mPskIdentity; + private byte[] mSrpIdentity; + private byte[] mEncodedServerExtensions; + private bool mExtendedMasterSecret; + + private SessionParameters(int cipherSuite, byte compressionAlgorithm, byte[] masterSecret, + Certificate peerCertificate, byte[] pskIdentity, byte[] srpIdentity, byte[] encodedServerExtensions, + bool extendedMasterSecret) + { + this.mCipherSuite = cipherSuite; + this.mCompressionAlgorithm = compressionAlgorithm; + this.mMasterSecret = Arrays.Clone(masterSecret); + this.mPeerCertificate = peerCertificate; + this.mPskIdentity = Arrays.Clone(pskIdentity); + this.mSrpIdentity = Arrays.Clone(srpIdentity); + this.mEncodedServerExtensions = encodedServerExtensions; + this.mExtendedMasterSecret = extendedMasterSecret; + } + + public void Clear() + { + if (this.mMasterSecret != null) + { + Arrays.Fill(this.mMasterSecret, (byte)0); + } + } + + public SessionParameters Copy() + { + return new SessionParameters(mCipherSuite, mCompressionAlgorithm, mMasterSecret, mPeerCertificate, + mPskIdentity, mSrpIdentity, mEncodedServerExtensions, mExtendedMasterSecret); + } + + public int CipherSuite + { + get { return mCipherSuite; } + } + + public byte CompressionAlgorithm + { + get { return mCompressionAlgorithm; } + } + + public bool IsExtendedMasterSecret + { + get { return mExtendedMasterSecret; } + } + + public byte[] MasterSecret + { + get { return mMasterSecret; } + } + + public Certificate PeerCertificate + { + get { return mPeerCertificate; } + } + + public byte[] PskIdentity + { + get { return mPskIdentity; } + } + + public byte[] SrpIdentity + { + get { return mSrpIdentity; } + } + + public IDictionary ReadServerExtensions() + { + if (mEncodedServerExtensions == null) + return null; + + MemoryStream buf = new MemoryStream(mEncodedServerExtensions, false); + return TlsProtocol.ReadExtensions(buf); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SessionParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SessionParameters.cs.meta new file mode 100644 index 00000000..9c4fb5c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SessionParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bbc6009270152664498342e5a67289f0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAlgorithm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAlgorithm.cs new file mode 100644 index 00000000..84a3590a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAlgorithm.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * RFC 5246 7.4.1.4.1 (in RFC 2246, there were no specific values assigned) + */ + public abstract class SignatureAlgorithm + { + public const byte anonymous = 0; + public const byte rsa = 1; + public const byte dsa = 2; + public const byte ecdsa = 3; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAlgorithm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAlgorithm.cs.meta new file mode 100644 index 00000000..8c986c2c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAlgorithm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe1e468e29a65364e967c9c43ec97ac0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAndHashAlgorithm.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAndHashAlgorithm.cs new file mode 100644 index 00000000..018acb06 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAndHashAlgorithm.cs @@ -0,0 +1,98 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * RFC 5246 7.4.1.4.1 + */ + public class SignatureAndHashAlgorithm + { + protected readonly byte mHash; + protected readonly byte mSignature; + + /** + * @param hash {@link HashAlgorithm} + * @param signature {@link SignatureAlgorithm} + */ + public SignatureAndHashAlgorithm(byte hash, byte signature) + { + if (!TlsUtilities.IsValidUint8(hash)) + { + throw new ArgumentException("should be a uint8", "hash"); + } + if (!TlsUtilities.IsValidUint8(signature)) + { + throw new ArgumentException("should be a uint8", "signature"); + } + if (signature == SignatureAlgorithm.anonymous) + { + throw new ArgumentException("MUST NOT be \"anonymous\"", "signature"); + } + + this.mHash = hash; + this.mSignature = signature; + } + + /** + * @return {@link HashAlgorithm} + */ + public virtual byte Hash + { + get { return mHash; } + } + + /** + * @return {@link SignatureAlgorithm} + */ + public virtual byte Signature + { + get { return mSignature; } + } + + public override bool Equals(object obj) + { + if (!(obj is SignatureAndHashAlgorithm)) + { + return false; + } + SignatureAndHashAlgorithm other = (SignatureAndHashAlgorithm)obj; + return other.Hash == Hash && other.Signature == Signature; + } + + public override int GetHashCode() + { + return ((int)Hash << 16) | (int)Signature; + } + + /** + * Encode this {@link SignatureAndHashAlgorithm} to a {@link Stream}. + * + * @param output the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + TlsUtilities.WriteUint8(Hash, output); + TlsUtilities.WriteUint8(Signature, output); + } + + /** + * Parse a {@link SignatureAndHashAlgorithm} from a {@link Stream}. + * + * @param input the {@link Stream} to parse from. + * @return a {@link SignatureAndHashAlgorithm} object. + * @throws IOException + */ + public static SignatureAndHashAlgorithm Parse(Stream input) + { + byte hash = TlsUtilities.ReadUint8(input); + byte signature = TlsUtilities.ReadUint8(input); + return new SignatureAndHashAlgorithm(hash, signature); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAndHashAlgorithm.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAndHashAlgorithm.cs.meta new file mode 100644 index 00000000..9f82c4e5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignatureAndHashAlgorithm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 51e114f319dd0f14ba74e6d415a6fb4b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignerInputBuffer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignerInputBuffer.cs new file mode 100644 index 00000000..8e263f3d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignerInputBuffer.cs @@ -0,0 +1,41 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal class SignerInputBuffer + : MemoryStream + { + internal void UpdateSigner(ISigner s) + { + Streams.WriteBufTo(this, new SigStream(s)); + } + + private class SigStream + : BaseOutputStream + { + private readonly ISigner s; + + internal SigStream(ISigner s) + { + this.s = s; + } + + public override void WriteByte(byte b) + { + s.Update(b); + } + + public override void Write(byte[] buf, int off, int len) + { + s.BlockUpdate(buf, off, len); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignerInputBuffer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignerInputBuffer.cs.meta new file mode 100644 index 00000000..70eb0eb1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SignerInputBuffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ede9b2816a63d104bba0b2d60c28a180 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SimulatedTlsSrpIdentityManager.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SimulatedTlsSrpIdentityManager.cs new file mode 100644 index 00000000..5dc2f844 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SimulatedTlsSrpIdentityManager.cs @@ -0,0 +1,73 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Srp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * An implementation of {@link TlsSRPIdentityManager} that simulates the existence of "unknown" identities + * to obscure the fact that there is no verifier for them. + */ + public class SimulatedTlsSrpIdentityManager + : TlsSrpIdentityManager + { + private static readonly byte[] PREFIX_PASSWORD = Strings.ToByteArray("password"); + private static readonly byte[] PREFIX_SALT = Strings.ToByteArray("salt"); + + /** + * Create a {@link SimulatedTlsSRPIdentityManager} that implements the algorithm from RFC 5054 2.5.1.3 + * + * @param group the {@link SRP6GroupParameters} defining the group that SRP is operating in + * @param seedKey the secret "seed key" referred to in RFC 5054 2.5.1.3 + * @return an instance of {@link SimulatedTlsSRPIdentityManager} + */ + public static SimulatedTlsSrpIdentityManager GetRfc5054Default(Srp6GroupParameters group, byte[] seedKey) + { + Srp6VerifierGenerator verifierGenerator = new Srp6VerifierGenerator(); + verifierGenerator.Init(group, TlsUtilities.CreateHash(HashAlgorithm.sha1)); + + HMac mac = new HMac(TlsUtilities.CreateHash(HashAlgorithm.sha1)); + mac.Init(new KeyParameter(seedKey)); + + return new SimulatedTlsSrpIdentityManager(group, verifierGenerator, mac); + } + + protected readonly Srp6GroupParameters mGroup; + protected readonly Srp6VerifierGenerator mVerifierGenerator; + protected readonly IMac mMac; + + public SimulatedTlsSrpIdentityManager(Srp6GroupParameters group, Srp6VerifierGenerator verifierGenerator, IMac mac) + { + this.mGroup = group; + this.mVerifierGenerator = verifierGenerator; + this.mMac = mac; + } + + public virtual TlsSrpLoginParameters GetLoginParameters(byte[] identity) + { + mMac.BlockUpdate(PREFIX_SALT, 0, PREFIX_SALT.Length); + mMac.BlockUpdate(identity, 0, identity.Length); + + byte[] salt = new byte[mMac.GetMacSize()]; + mMac.DoFinal(salt, 0); + + mMac.BlockUpdate(PREFIX_PASSWORD, 0, PREFIX_PASSWORD.Length); + mMac.BlockUpdate(identity, 0, identity.Length); + + byte[] password = new byte[mMac.GetMacSize()]; + mMac.DoFinal(password, 0); + + BigInteger verifier = mVerifierGenerator.GenerateVerifier(salt, identity, password); + + return new TlsSrpLoginParameters(mGroup, verifier, salt); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SimulatedTlsSrpIdentityManager.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SimulatedTlsSrpIdentityManager.cs.meta new file mode 100644 index 00000000..dcf9a67c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SimulatedTlsSrpIdentityManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4dd5313838d6b1489bcc5ec13c11fc9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsClient.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsClient.cs new file mode 100644 index 00000000..d737a8c1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsClient.cs @@ -0,0 +1,108 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class SrpTlsClient + : AbstractTlsClient + { + protected TlsSrpGroupVerifier mGroupVerifier; + + protected byte[] mIdentity; + protected byte[] mPassword; + + public SrpTlsClient(byte[] identity, byte[] password) + : this(new DefaultTlsCipherFactory(), new DefaultTlsSrpGroupVerifier(), identity, password) + { + } + + public SrpTlsClient(TlsCipherFactory cipherFactory, byte[] identity, byte[] password) + : this(cipherFactory, new DefaultTlsSrpGroupVerifier(), identity, password) + { + } + + public SrpTlsClient(TlsCipherFactory cipherFactory, TlsSrpGroupVerifier groupVerifier, + byte[] identity, byte[] password) + : base(cipherFactory) + { + this.mGroupVerifier = groupVerifier; + this.mIdentity = Arrays.Clone(identity); + this.mPassword = Arrays.Clone(password); + } + + protected virtual bool RequireSrpServerExtension + { + // No explicit guidance in RFC 5054; by default an (empty) extension from server is optional + get { return false; } + } + + public override int[] GetCipherSuites() + { + return new int[] + { + CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA + }; + } + + public override IDictionary GetClientExtensions() + { + IDictionary clientExtensions = TlsExtensionsUtilities.EnsureExtensionsInitialised(base.GetClientExtensions()); + TlsSrpUtilities.AddSrpExtension(clientExtensions, this.mIdentity); + return clientExtensions; + } + + public override void ProcessServerExtensions(IDictionary serverExtensions) + { + if (!TlsUtilities.HasExpectedEmptyExtensionData(serverExtensions, ExtensionType.srp, + AlertDescription.illegal_parameter)) + { + if (RequireSrpServerExtension) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + base.ProcessServerExtensions(serverExtensions); + } + + public override TlsKeyExchange GetKeyExchange() + { + int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite); + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.SRP: + case KeyExchangeAlgorithm.SRP_DSS: + case KeyExchangeAlgorithm.SRP_RSA: + return CreateSrpKeyExchange(keyExchangeAlgorithm); + + default: + /* + * Note: internal error here; the TlsProtocol implementation verifies that the + * server-selected cipher suite was in the list of client-offered cipher suites, so if + * we now can't produce an implementation, we shouldn't have offered it! + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public override TlsAuthentication GetAuthentication() + { + /* + * Note: This method is not called unless a server certificate is sent, which may be the + * case e.g. for SRP_DSS or SRP_RSA key exchange. + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + protected virtual TlsKeyExchange CreateSrpKeyExchange(int keyExchange) + { + return new TlsSrpKeyExchange(keyExchange, mSupportedSignatureAlgorithms, mGroupVerifier, mIdentity, mPassword); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsClient.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsClient.cs.meta new file mode 100644 index 00000000..ce28f810 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c6937c3c9dc856643a4e089b21f3a01d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsServer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsServer.cs new file mode 100644 index 00000000..2e5ccd1a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsServer.cs @@ -0,0 +1,125 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class SrpTlsServer + : AbstractTlsServer + { + protected TlsSrpIdentityManager mSrpIdentityManager; + + protected byte[] mSrpIdentity = null; + protected TlsSrpLoginParameters mLoginParameters = null; + + public SrpTlsServer(TlsSrpIdentityManager srpIdentityManager) + : this(new DefaultTlsCipherFactory(), srpIdentityManager) + { + } + + public SrpTlsServer(TlsCipherFactory cipherFactory, TlsSrpIdentityManager srpIdentityManager) + : base(cipherFactory) + { + this.mSrpIdentityManager = srpIdentityManager; + } + + protected virtual TlsSignerCredentials GetDsaSignerCredentials() + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + protected virtual TlsSignerCredentials GetRsaSignerCredentials() + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + protected override int[] GetCipherSuites() + { + return new int[] + { + CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA, + CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA, + CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA, + CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA, + CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA, + CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA + }; + } + + public override void ProcessClientExtensions(IDictionary clientExtensions) + { + base.ProcessClientExtensions(clientExtensions); + + this.mSrpIdentity = TlsSrpUtilities.GetSrpExtension(clientExtensions); + } + + public override int GetSelectedCipherSuite() + { + int cipherSuite = base.GetSelectedCipherSuite(); + + if (TlsSrpUtilities.IsSrpCipherSuite(cipherSuite)) + { + if (mSrpIdentity != null) + { + this.mLoginParameters = mSrpIdentityManager.GetLoginParameters(mSrpIdentity); + } + + if (mLoginParameters == null) + throw new TlsFatalAlert(AlertDescription.unknown_psk_identity); + } + + return cipherSuite; + } + + public override TlsCredentials GetCredentials() + { + int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite); + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.SRP: + return null; + + case KeyExchangeAlgorithm.SRP_DSS: + return GetDsaSignerCredentials(); + + case KeyExchangeAlgorithm.SRP_RSA: + return GetRsaSignerCredentials(); + + default: + /* Note: internal error here; selected a key exchange we don't implement! */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public override TlsKeyExchange GetKeyExchange() + { + int keyExchangeAlgorithm = TlsUtilities.GetKeyExchangeAlgorithm(mSelectedCipherSuite); + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.SRP: + case KeyExchangeAlgorithm.SRP_DSS: + case KeyExchangeAlgorithm.SRP_RSA: + return CreateSrpKeyExchange(keyExchangeAlgorithm); + + default: + /* + * Note: internal error here; the TlsProtocol implementation verifies that the + * server-selected cipher suite was in the list of client-offered cipher suites, so if + * we now can't produce an implementation, we shouldn't have offered it! + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + protected virtual TlsKeyExchange CreateSrpKeyExchange(int keyExchange) + { + return new TlsSrpKeyExchange(keyExchange, mSupportedSignatureAlgorithms, mSrpIdentity, mLoginParameters); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsServer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsServer.cs.meta new file mode 100644 index 00000000..344272f8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrpTlsServer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 916fb543f68ecab4fa675dbf757a8d91 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrtpProtectionProfile.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrtpProtectionProfile.cs new file mode 100644 index 00000000..36bd980f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrtpProtectionProfile.cs @@ -0,0 +1,25 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class SrtpProtectionProfile + { + /* + * RFC 5764 4.1.2. + */ + public const int SRTP_AES128_CM_HMAC_SHA1_80 = 0x0001; + public const int SRTP_AES128_CM_HMAC_SHA1_32 = 0x0002; + public const int SRTP_NULL_HMAC_SHA1_80 = 0x0005; + public const int SRTP_NULL_HMAC_SHA1_32 = 0x0006; + + /* + * RFC 7714 14.2. + */ + public const int SRTP_AEAD_AES_128_GCM = 0x0007; + public const int SRTP_AEAD_AES_256_GCM = 0x0008; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrtpProtectionProfile.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrtpProtectionProfile.cs.meta new file mode 100644 index 00000000..f8cf2ac7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SrtpProtectionProfile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67e65ee5b73aa824ca3b8df843b61ad8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Ssl3Mac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Ssl3Mac.cs new file mode 100644 index 00000000..823229b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Ssl3Mac.cs @@ -0,0 +1,114 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * HMAC implementation based on original internet draft for HMAC (RFC 2104) + * + * The difference is that padding is concatentated versus XORed with the key + * + * H(K + opad, H(K + ipad, text)) + */ + public class Ssl3Mac + : IMac + { + private const byte IPAD_BYTE = 0x36; + private const byte OPAD_BYTE = 0x5C; + + internal static readonly byte[] IPAD = GenPad(IPAD_BYTE, 48); + internal static readonly byte[] OPAD = GenPad(OPAD_BYTE, 48); + + private readonly IDigest digest; + private readonly int padLength; + + private byte[] secret; + + /** + * Base constructor for one of the standard digest algorithms that the byteLength of + * the algorithm is know for. Behaviour is undefined for digests other than MD5 or SHA1. + * + * @param digest the digest. + */ + public Ssl3Mac(IDigest digest) + { + this.digest = digest; + + if (digest.GetDigestSize() == 20) + { + this.padLength = 40; + } + else + { + this.padLength = 48; + } + } + + public virtual string AlgorithmName + { + get { return digest.AlgorithmName + "/SSL3MAC"; } + } + + public virtual void Init(ICipherParameters parameters) + { + secret = Arrays.Clone(((KeyParameter)parameters).GetKey()); + + Reset(); + } + + public virtual int GetMacSize() + { + return digest.GetDigestSize(); + } + + public virtual void Update(byte input) + { + digest.Update(input); + } + + public virtual void BlockUpdate(byte[] input, int inOff, int len) + { + digest.BlockUpdate(input, inOff, len); + } + + public virtual int DoFinal(byte[] output, int outOff) + { + byte[] tmp = new byte[digest.GetDigestSize()]; + digest.DoFinal(tmp, 0); + + digest.BlockUpdate(secret, 0, secret.Length); + digest.BlockUpdate(OPAD, 0, padLength); + digest.BlockUpdate(tmp, 0, tmp.Length); + + int len = digest.DoFinal(output, outOff); + + Reset(); + + return len; + } + + /** + * Reset the mac generator. + */ + public virtual void Reset() + { + digest.Reset(); + digest.BlockUpdate(secret, 0, secret.Length); + digest.BlockUpdate(IPAD, 0, padLength); + } + + private static byte[] GenPad(byte b, int count) + { + byte[] padding = new byte[count]; + Arrays.Fill(padding, b); + return padding; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Ssl3Mac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Ssl3Mac.cs.meta new file mode 100644 index 00000000..5cfec714 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/Ssl3Mac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8efb8ed745b4b2141b65fe1efdc9d92c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataEntry.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataEntry.cs new file mode 100644 index 00000000..459c6010 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataEntry.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class SupplementalDataEntry + { + protected readonly int mDataType; + protected readonly byte[] mData; + + public SupplementalDataEntry(int dataType, byte[] data) + { + this.mDataType = dataType; + this.mData = data; + } + + public virtual int DataType + { + get { return mDataType; } + } + + public virtual byte[] Data + { + get { return mData; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataEntry.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataEntry.cs.meta new file mode 100644 index 00000000..9115b265 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataEntry.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7756b340729452241aeb7d6f4fdb93d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataType.cs new file mode 100644 index 00000000..9422db89 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataType.cs @@ -0,0 +1,17 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 4680 + public abstract class SupplementalDataType + { + /* + * RFC 4681 + */ + public const int user_mapping_data = 0; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataType.cs.meta new file mode 100644 index 00000000..493f4dd7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/SupplementalDataType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a839e7a4598115344b32e22692f90dbf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAeadCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAeadCipher.cs new file mode 100644 index 00000000..7c640ebd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAeadCipher.cs @@ -0,0 +1,253 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsAeadCipher + : TlsCipher + { + // TODO[draft-zauner-tls-aes-ocb-04] Apply data volume limit described in section 8.4 + + public const int NONCE_RFC5288 = 1; + + /* + * draft-zauner-tls-aes-ocb-04 specifies the nonce construction from draft-ietf-tls-chacha20-poly1305-04 + */ + internal const int NONCE_DRAFT_CHACHA20_POLY1305 = 2; + + protected readonly TlsContext context; + protected readonly int macSize; + // TODO SecurityParameters.record_iv_length + protected readonly int record_iv_length; + + protected readonly IAeadBlockCipher encryptCipher; + protected readonly IAeadBlockCipher decryptCipher; + + protected readonly byte[] encryptImplicitNonce, decryptImplicitNonce; + + protected readonly int nonceMode; + + /// + public TlsAeadCipher(TlsContext context, IAeadBlockCipher clientWriteCipher, IAeadBlockCipher serverWriteCipher, + int cipherKeySize, int macSize) + : this(context, clientWriteCipher, serverWriteCipher, cipherKeySize, macSize, NONCE_RFC5288) + { + } + + /// + internal TlsAeadCipher(TlsContext context, IAeadBlockCipher clientWriteCipher, IAeadBlockCipher serverWriteCipher, + int cipherKeySize, int macSize, int nonceMode) + { + if (!TlsUtilities.IsTlsV12(context)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + this.nonceMode = nonceMode; + + // TODO SecurityParameters.fixed_iv_length + int fixed_iv_length; + + switch (nonceMode) + { + case NONCE_RFC5288: + fixed_iv_length = 4; + this.record_iv_length = 8; + break; + case NONCE_DRAFT_CHACHA20_POLY1305: + fixed_iv_length = 12; + this.record_iv_length = 0; + break; + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + this.context = context; + this.macSize = macSize; + + int key_block_size = (2 * cipherKeySize) + (2 * fixed_iv_length); + + byte[] key_block = TlsUtilities.CalculateKeyBlock(context, key_block_size); + + int offset = 0; + + KeyParameter client_write_key = new KeyParameter(key_block, offset, cipherKeySize); + offset += cipherKeySize; + KeyParameter server_write_key = new KeyParameter(key_block, offset, cipherKeySize); + offset += cipherKeySize; + byte[] client_write_IV = Arrays.CopyOfRange(key_block, offset, offset + fixed_iv_length); + offset += fixed_iv_length; + byte[] server_write_IV = Arrays.CopyOfRange(key_block, offset, offset + fixed_iv_length); + offset += fixed_iv_length; + + if (offset != key_block_size) + throw new TlsFatalAlert(AlertDescription.internal_error); + + KeyParameter encryptKey, decryptKey; + if (context.IsServer) + { + this.encryptCipher = serverWriteCipher; + this.decryptCipher = clientWriteCipher; + this.encryptImplicitNonce = server_write_IV; + this.decryptImplicitNonce = client_write_IV; + encryptKey = server_write_key; + decryptKey = client_write_key; + } + else + { + this.encryptCipher = clientWriteCipher; + this.decryptCipher = serverWriteCipher; + this.encryptImplicitNonce = client_write_IV; + this.decryptImplicitNonce = server_write_IV; + encryptKey = client_write_key; + decryptKey = server_write_key; + } + + byte[] dummyNonce = new byte[fixed_iv_length + record_iv_length]; + + this.encryptCipher.Init(true, new AeadParameters(encryptKey, 8 * macSize, dummyNonce)); + this.decryptCipher.Init(false, new AeadParameters(decryptKey, 8 * macSize, dummyNonce)); + } + + public virtual int GetPlaintextLimit(int ciphertextLimit) + { + // TODO We ought to be able to ask the decryptCipher (independently of it's current state!) + return ciphertextLimit - macSize - record_iv_length; + } + + /// + public virtual byte[] EncodePlaintext(long seqNo, byte type, byte[] plaintext, int offset, int len) + { + byte[] nonce = new byte[encryptImplicitNonce.Length + record_iv_length]; + + switch (nonceMode) + { + case NONCE_RFC5288: + Array.Copy(encryptImplicitNonce, 0, nonce, 0, encryptImplicitNonce.Length); + // RFC 5288/6655: The nonce_explicit MAY be the 64-bit sequence number. + TlsUtilities.WriteUint64(seqNo, nonce, encryptImplicitNonce.Length); + break; + case NONCE_DRAFT_CHACHA20_POLY1305: + TlsUtilities.WriteUint64(seqNo, nonce, nonce.Length - 8); + for (int i = 0; i < encryptImplicitNonce.Length; ++i) + { + nonce[i] ^= encryptImplicitNonce[i]; + } + break; + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + int plaintextOffset = offset; + int plaintextLength = len; + int ciphertextLength = encryptCipher.GetOutputSize(plaintextLength); + + byte[] output = new byte[record_iv_length + ciphertextLength]; + if (record_iv_length != 0) + { + Array.Copy(nonce, nonce.Length - record_iv_length, output, 0, record_iv_length); + } + int outputPos = record_iv_length; + + byte[] additionalData = GetAdditionalData(seqNo, type, plaintextLength); + AeadParameters parameters = new AeadParameters(null, 8 * macSize, nonce, additionalData); + + try + { + encryptCipher.Init(true, parameters); + outputPos += encryptCipher.ProcessBytes(plaintext, plaintextOffset, plaintextLength, output, outputPos); + outputPos += encryptCipher.DoFinal(output, outputPos); + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + + if (outputPos != output.Length) + { + // NOTE: Existing AEAD cipher implementations all give exact output lengths + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + return output; + } + + /// + public virtual byte[] DecodeCiphertext(long seqNo, byte type, byte[] ciphertext, int offset, int len) + { + if (GetPlaintextLimit(len) < 0) + throw new TlsFatalAlert(AlertDescription.decode_error); + + byte[] nonce = new byte[decryptImplicitNonce.Length + record_iv_length]; + + switch (nonceMode) + { + case NONCE_RFC5288: + Array.Copy(decryptImplicitNonce, 0, nonce, 0, decryptImplicitNonce.Length); + Array.Copy(ciphertext, offset, nonce, nonce.Length - record_iv_length, record_iv_length); + break; + case NONCE_DRAFT_CHACHA20_POLY1305: + TlsUtilities.WriteUint64(seqNo, nonce, nonce.Length - 8); + for (int i = 0; i < decryptImplicitNonce.Length; ++i) + { + nonce[i] ^= decryptImplicitNonce[i]; + } + break; + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + int ciphertextOffset = offset + record_iv_length; + int ciphertextLength = len - record_iv_length; + int plaintextLength = decryptCipher.GetOutputSize(ciphertextLength); + + byte[] output = new byte[plaintextLength]; + int outputPos = 0; + + byte[] additionalData = GetAdditionalData(seqNo, type, plaintextLength); + AeadParameters parameters = new AeadParameters(null, 8 * macSize, nonce, additionalData); + + try + { + decryptCipher.Init(false, parameters); + outputPos += decryptCipher.ProcessBytes(ciphertext, ciphertextOffset, ciphertextLength, output, outputPos); + outputPos += decryptCipher.DoFinal(output, outputPos); + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.bad_record_mac, e); + } + + if (outputPos != output.Length) + { + // NOTE: Existing AEAD cipher implementations all give exact output lengths + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + return output; + } + + /// + protected virtual byte[] GetAdditionalData(long seqNo, byte type, int len) + { + /* + * additional_data = seq_num + TLSCompressed.type + TLSCompressed.version + + * TLSCompressed.length + */ + + byte[] additional_data = new byte[13]; + TlsUtilities.WriteUint64(seqNo, additional_data, 0); + TlsUtilities.WriteUint8(type, additional_data, 8); + TlsUtilities.WriteVersion(context.ServerVersion, additional_data, 9); + TlsUtilities.WriteUint16(len, additional_data, 11); + + return additional_data; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAeadCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAeadCipher.cs.meta new file mode 100644 index 00000000..f38f8a65 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAeadCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd60419f3a93fb4439f9a62115948e22 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAgreementCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAgreementCredentials.cs new file mode 100644 index 00000000..a98e95e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAgreementCredentials.cs @@ -0,0 +1,16 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsAgreementCredentials + : TlsCredentials + { + /// + byte[] GenerateAgreement(AsymmetricKeyParameter peerPublicKey); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAgreementCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAgreementCredentials.cs.meta new file mode 100644 index 00000000..0cdcd4d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAgreementCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e668ed02ffcd9340b4b08fcc6ef8fc9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAuthentication.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAuthentication.cs new file mode 100644 index 00000000..a39b1352 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAuthentication.cs @@ -0,0 +1,35 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsAuthentication + { + /// + /// Called by the protocol handler to report the server certificate. + /// + /// + /// This method is responsible for certificate verification and validation + /// + /// The server received + /// + void NotifyServerCertificate(Certificate serverCertificate); + + /// + /// Return client credentials in response to server's certificate request + /// + /// + /// A containing server certificate request details + /// + /// + /// A to be used for client authentication + /// (or null for no client authentication) + /// + /// + TlsCredentials GetClientCredentials(TlsContext context, CertificateRequest certificateRequest); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAuthentication.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAuthentication.cs.meta new file mode 100644 index 00000000..9ebd82db --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsAuthentication.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c47d5a2f1fcf0924482f99db660945be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsBlockCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsBlockCipher.cs new file mode 100644 index 00000000..88939031 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsBlockCipher.cs @@ -0,0 +1,400 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// A generic TLS 1.0-1.2 / SSLv3 block cipher. This can be used for AES or 3DES for example. + /// + public class TlsBlockCipher + : TlsCipher + { + protected readonly TlsContext context; + protected readonly byte[] randomData; + protected readonly bool useExplicitIV; + protected readonly bool encryptThenMac; + + protected readonly IBlockCipher encryptCipher; + protected readonly IBlockCipher decryptCipher; + + protected readonly TlsMac mWriteMac; + protected readonly TlsMac mReadMac; + + public virtual TlsMac WriteMac + { + get { return mWriteMac; } + } + + public virtual TlsMac ReadMac + { + get { return mReadMac; } + } + + /// + public TlsBlockCipher(TlsContext context, IBlockCipher clientWriteCipher, IBlockCipher serverWriteCipher, + IDigest clientWriteDigest, IDigest serverWriteDigest, int cipherKeySize) + { + this.context = context; + + this.randomData = new byte[256]; + context.NonceRandomGenerator.NextBytes(randomData); + + this.useExplicitIV = TlsUtilities.IsTlsV11(context); + this.encryptThenMac = context.SecurityParameters.encryptThenMac; + + int key_block_size = (2 * cipherKeySize) + clientWriteDigest.GetDigestSize() + + serverWriteDigest.GetDigestSize(); + + // From TLS 1.1 onwards, block ciphers don't need client_write_IV + if (!useExplicitIV) + { + key_block_size += clientWriteCipher.GetBlockSize() + serverWriteCipher.GetBlockSize(); + } + + byte[] key_block = TlsUtilities.CalculateKeyBlock(context, key_block_size); + + int offset = 0; + + TlsMac clientWriteMac = new TlsMac(context, clientWriteDigest, key_block, offset, + clientWriteDigest.GetDigestSize()); + offset += clientWriteDigest.GetDigestSize(); + TlsMac serverWriteMac = new TlsMac(context, serverWriteDigest, key_block, offset, + serverWriteDigest.GetDigestSize()); + offset += serverWriteDigest.GetDigestSize(); + + KeyParameter client_write_key = new KeyParameter(key_block, offset, cipherKeySize); + offset += cipherKeySize; + KeyParameter server_write_key = new KeyParameter(key_block, offset, cipherKeySize); + offset += cipherKeySize; + + byte[] client_write_IV, server_write_IV; + if (useExplicitIV) + { + client_write_IV = new byte[clientWriteCipher.GetBlockSize()]; + server_write_IV = new byte[serverWriteCipher.GetBlockSize()]; + } + else + { + client_write_IV = Arrays.CopyOfRange(key_block, offset, offset + clientWriteCipher.GetBlockSize()); + offset += clientWriteCipher.GetBlockSize(); + server_write_IV = Arrays.CopyOfRange(key_block, offset, offset + serverWriteCipher.GetBlockSize()); + offset += serverWriteCipher.GetBlockSize(); + } + + if (offset != key_block_size) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + ICipherParameters encryptParams, decryptParams; + if (context.IsServer) + { + this.mWriteMac = serverWriteMac; + this.mReadMac = clientWriteMac; + this.encryptCipher = serverWriteCipher; + this.decryptCipher = clientWriteCipher; + encryptParams = new ParametersWithIV(server_write_key, server_write_IV); + decryptParams = new ParametersWithIV(client_write_key, client_write_IV); + } + else + { + this.mWriteMac = clientWriteMac; + this.mReadMac = serverWriteMac; + this.encryptCipher = clientWriteCipher; + this.decryptCipher = serverWriteCipher; + encryptParams = new ParametersWithIV(client_write_key, client_write_IV); + decryptParams = new ParametersWithIV(server_write_key, server_write_IV); + } + + this.encryptCipher.Init(true, encryptParams); + this.decryptCipher.Init(false, decryptParams); + } + + public virtual int GetPlaintextLimit(int ciphertextLimit) + { + int blockSize = encryptCipher.GetBlockSize(); + int macSize = mWriteMac.Size; + + int plaintextLimit = ciphertextLimit; + + // An explicit IV consumes 1 block + if (useExplicitIV) + { + plaintextLimit -= blockSize; + } + + // Leave room for the MAC, and require block-alignment + if (encryptThenMac) + { + plaintextLimit -= macSize; + plaintextLimit -= plaintextLimit % blockSize; + } + else + { + plaintextLimit -= plaintextLimit % blockSize; + plaintextLimit -= macSize; + } + + // Minimum 1 byte of padding + --plaintextLimit; + + return plaintextLimit; + } + + byte[] explicitIV = null; + public virtual byte[] EncodePlaintext(long seqNo, byte type, byte[] plaintext, int offset, int len) + { + int blockSize = encryptCipher.GetBlockSize(); + int macSize = mWriteMac.Size; + + ProtocolVersion version = context.ServerVersion; + + int enc_input_length = len; + if (!encryptThenMac) + { + enc_input_length += macSize; + } + + int padding_length = blockSize - 1 - (enc_input_length % blockSize); + + /* + * Don't use variable-length padding with truncated MACs. + * + * See "Tag Size Does Matter: Attacks and Proofs for the TLS Record Protocol", Paterson, + * Ristenpart, Shrimpton. + */ + if (encryptThenMac || !context.SecurityParameters.truncatedHMac) + { + // TODO[DTLS] Consider supporting in DTLS (without exceeding send limit though) + if (!version.IsDtls && !version.IsSsl) + { + // Add a random number of extra blocks worth of padding + int maxExtraPadBlocks = (255 - padding_length) / blockSize; + int actualExtraPadBlocks = ChooseExtraPadBlocks(context.SecureRandom, maxExtraPadBlocks); + padding_length += actualExtraPadBlocks * blockSize; + } + } + + int totalSize = len + macSize + padding_length + 1; + if (useExplicitIV) + { + totalSize += blockSize; + } + + byte[] outBuf = new byte[totalSize]; + int outOff = 0; + + if (useExplicitIV) + { + if (explicitIV == null || explicitIV.Length != blockSize) Array.Resize(ref explicitIV, blockSize); + context.NonceRandomGenerator.NextBytes(explicitIV); + + encryptCipher.Init(true, new ParametersWithIV(null, explicitIV)); + + Array.Copy(explicitIV, 0, outBuf, outOff, blockSize); + outOff += blockSize; + } + + int blocks_start = outOff; + + Array.Copy(plaintext, offset, outBuf, outOff, len); + outOff += len; + + if (!encryptThenMac) + { + byte[] mac = mWriteMac.CalculateMac(seqNo, type, plaintext, offset, len); + Array.Copy(mac, 0, outBuf, outOff, mac.Length); + outOff += mac.Length; + } + + for (int i = 0; i <= padding_length; i++) + { + outBuf[outOff++] = (byte)padding_length; + } + + for (int i = blocks_start; i < outOff; i += blockSize) + { + encryptCipher.ProcessBlock(outBuf, i, outBuf, i); + } + + if (encryptThenMac) + { + byte[] mac = mWriteMac.CalculateMac(seqNo, type, outBuf, 0, outOff); + Array.Copy(mac, 0, outBuf, outOff, mac.Length); + outOff += mac.Length; + } + + // assert outBuf.length == outOff; + + return outBuf; + } + + /// + public virtual byte[] DecodeCiphertext(long seqNo, byte type, byte[] ciphertext, int offset, int len) + { + int blockSize = decryptCipher.GetBlockSize(); + int macSize = mReadMac.Size; + + int minLen = blockSize; + if (encryptThenMac) + { + minLen += macSize; + } + else + { + minLen = System.Math.Max(minLen, macSize + 1); + } + + if (useExplicitIV) + { + minLen += blockSize; + } + + if (len < minLen) + throw new TlsFatalAlert(AlertDescription.decode_error); + + int blocks_length = len; + if (encryptThenMac) + { + blocks_length -= macSize; + } + + if (blocks_length % blockSize != 0) + throw new TlsFatalAlert(AlertDescription.decryption_failed); + + if (encryptThenMac) + { + int end = offset + len; + byte[] receivedMac = Arrays.CopyOfRange(ciphertext, end - macSize, end); + byte[] calculatedMac = mReadMac.CalculateMac(seqNo, type, ciphertext, offset, len - macSize); + + bool badMacEtm = !Arrays.ConstantTimeAreEqual(calculatedMac, receivedMac); + if (badMacEtm) + { + /* + * RFC 7366 3. The MAC SHALL be evaluated before any further processing such as + * decryption is performed, and if the MAC verification fails, then processing SHALL + * terminate immediately. For TLS, a fatal bad_record_mac MUST be generated [2]. For + * DTLS, the record MUST be discarded, and a fatal bad_record_mac MAY be generated + * [4]. This immediate response to a bad MAC eliminates any timing channels that may + * be available through the use of manipulated packet data. + */ + throw new TlsFatalAlert(AlertDescription.bad_record_mac); + } + } + + if (useExplicitIV) + { + decryptCipher.Init(false, new ParametersWithIV(null, ciphertext, offset, blockSize)); + + offset += blockSize; + blocks_length -= blockSize; + } + + for (int i = 0; i < blocks_length; i += blockSize) + { + decryptCipher.ProcessBlock(ciphertext, offset + i, ciphertext, offset + i); + } + + // If there's anything wrong with the padding, this will return zero + int totalPad = CheckPaddingConstantTime(ciphertext, offset, blocks_length, blockSize, encryptThenMac ? 0 : macSize); + bool badMac = (totalPad == 0); + + int dec_output_length = blocks_length - totalPad; + + if (!encryptThenMac) + { + dec_output_length -= macSize; + int macInputLen = dec_output_length; + int macOff = offset + macInputLen; + byte[] receivedMac = Arrays.CopyOfRange(ciphertext, macOff, macOff + macSize); + byte[] calculatedMac = mReadMac.CalculateMacConstantTime(seqNo, type, ciphertext, offset, macInputLen, + blocks_length - macSize, randomData); + + badMac |= !Arrays.ConstantTimeAreEqual(calculatedMac, receivedMac); + } + + if (badMac) + throw new TlsFatalAlert(AlertDescription.bad_record_mac); + + return Arrays.CopyOfRange(ciphertext, offset, offset + dec_output_length); + } + + protected virtual int CheckPaddingConstantTime(byte[] buf, int off, int len, int blockSize, int macSize) + { + int end = off + len; + byte lastByte = buf[end - 1]; + int padlen = lastByte & 0xff; + int totalPad = padlen + 1; + + int dummyIndex = 0; + byte padDiff = 0; + + if ((TlsUtilities.IsSsl(context) && totalPad > blockSize) || (macSize + totalPad > len)) + { + totalPad = 0; + } + else + { + int padPos = end - totalPad; + do + { + padDiff |= (byte)(buf[padPos++] ^ lastByte); + } + while (padPos < end); + + dummyIndex = totalPad; + + if (padDiff != 0) + { + totalPad = 0; + } + } + + // Run some extra dummy checks so the number of checks is always constant + { + byte[] dummyPad = randomData; + while (dummyIndex < 256) + { + padDiff |= (byte)(dummyPad[dummyIndex++] ^ lastByte); + } + // Ensure the above loop is not eliminated + dummyPad[0] ^= padDiff; + } + + return totalPad; + } + + protected virtual int ChooseExtraPadBlocks(SecureRandom r, int max) + { + // return r.NextInt(max + 1); + + int x = r.NextInt(); + int n = LowestBitSet(x); + return System.Math.Min(n, max); + } + + protected virtual int LowestBitSet(int x) + { + if (x == 0) + return 32; + + uint ux = (uint)x; + int n = 0; + while ((ux & 1U) == 0) + { + ++n; + ux >>= 1; + } + return n; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsBlockCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsBlockCipher.cs.meta new file mode 100644 index 00000000..8c0ea2a3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsBlockCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6ed82dfad77b01e46b2c034e89f070c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipher.cs new file mode 100644 index 00000000..f71bba67 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipher.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsCipher + { + int GetPlaintextLimit(int ciphertextLimit); + + /// + byte[] EncodePlaintext(long seqNo, byte type, byte[] plaintext, int offset, int len); + + /// + byte[] DecodeCiphertext(long seqNo, byte type, byte[] ciphertext, int offset, int len); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipher.cs.meta new file mode 100644 index 00000000..1395b958 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5595bb6c662c55c4d9b41c10ee8ba729 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipherFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipherFactory.cs new file mode 100644 index 00000000..12f89817 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipherFactory.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsCipherFactory + { + /// + TlsCipher CreateCipher(TlsContext context, int encryptionAlgorithm, int macAlgorithm); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipherFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipherFactory.cs.meta new file mode 100644 index 00000000..ab9581a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCipherFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f7c1d04c20c75c4dbedfaef773eea2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClient.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClient.cs new file mode 100644 index 00000000..e40a9791 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClient.cs @@ -0,0 +1,154 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsClient + : TlsPeer + { + System.Collections.Generic.List HostNames { get; set; } + + /// + /// Called at the start of a new TLS session, before any other methods. + /// + /// + /// A + /// + void Init(TlsClientContext context); + + /// Return the session this client wants to resume, if any. + /// Note that the peer's certificate chain for the session (if any) may need to be periodically revalidated. + /// + /// A representing the resumable session to be used for this connection, + /// or null to use a new session. + /// + TlsSession GetSessionToResume(); + + /// + /// Return the to use for the TLSPlaintext.version field prior to + /// receiving the server version. NOTE: This method is not called for DTLS. + /// + /// + /// See RFC 5246 E.1.: "TLS clients that wish to negotiate with older servers MAY send any value + /// {03,XX} as the record layer version number. Typical values would be {03,00}, the lowest + /// version number supported by the client, and the value of ClientHello.client_version. No + /// single value will guarantee interoperability with all old servers, but this is a complex + /// topic beyond the scope of this document." + /// + /// The to use. + ProtocolVersion ClientHelloRecordLayerVersion { get; } + + ProtocolVersion ClientVersion { get; } + + bool IsFallback { get; } + + /// + /// Get the list of cipher suites that this client supports. + /// + /// + /// An array of values, each specifying a supported cipher suite. + /// + int[] GetCipherSuites(); + + /// + /// Get the list of compression methods that this client supports. + /// + /// + /// An array of values, each specifying a supported compression method. + /// + byte[] GetCompressionMethods(); + + /// + /// Get the (optional) table of client extensions to be included in (extended) client hello. + /// + /// + /// A (Int32 -> byte[]). May be null. + /// + /// + IDictionary GetClientExtensions(); + + /// + void NotifyServerVersion(ProtocolVersion selectedVersion); + + /// + /// Notifies the client of the session_id sent in the ServerHello. + /// + /// An array of + void NotifySessionID(byte[] sessionID); + + /// + /// Report the cipher suite that was selected by the server. + /// + /// + /// The protocol handler validates this value against the offered cipher suites + /// + /// + /// + /// A + /// + void NotifySelectedCipherSuite(int selectedCipherSuite); + + /// + /// Report the compression method that was selected by the server. + /// + /// + /// The protocol handler validates this value against the offered compression methods + /// + /// + /// + /// A + /// + void NotifySelectedCompressionMethod(byte selectedCompressionMethod); + + /// + /// Report the extensions from an extended server hello. + /// + /// + /// Will only be called if we returned a non-null result from . + /// + /// + /// A (Int32 -> byte[]) + /// + void ProcessServerExtensions(IDictionary serverExtensions); + + /// A list of + /// + void ProcessServerSupplementalData(IList serverSupplementalData); + + /// + /// Return an implementation of to negotiate the key exchange + /// part of the protocol. + /// + /// + /// A + /// + /// + TlsKeyExchange GetKeyExchange(); + + /// + /// Return an implementation of to handle authentication + /// part of the protocol. + /// + /// + TlsAuthentication GetAuthentication(); + + /// A list of + /// + IList GetClientSupplementalData(); + + /// RFC 5077 3.3. NewSessionTicket Handshake Message + /// + /// This method will be called (only) when a NewSessionTicket handshake message is received. The + /// ticket is opaque to the client and clients MUST NOT examine the ticket under the assumption + /// that it complies with e.g. RFC 5077 4. Recommended Ticket Construction. + /// + /// The ticket + /// + void NotifyNewSessionTicket(NewSessionTicket newSessionTicket); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClient.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClient.cs.meta new file mode 100644 index 00000000..849ec0a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClient.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 96745de7428eac7458009404ae7f5be8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContext.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContext.cs new file mode 100644 index 00000000..0a8df993 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContext.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsClientContext + : TlsContext + { + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContext.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContext.cs.meta new file mode 100644 index 00000000..501a5f64 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12f6a51fefbe0364da64091cf6e2313a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContextImpl.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContextImpl.cs new file mode 100644 index 00000000..20d84df5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContextImpl.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal class TlsClientContextImpl + : AbstractTlsContext, TlsClientContext + { + internal TlsClientContextImpl(SecureRandom secureRandom, SecurityParameters securityParameters) + : base(secureRandom, securityParameters) + { + } + + public override bool IsServer + { + get { return false; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContextImpl.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContextImpl.cs.meta new file mode 100644 index 00000000..206f9f67 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientContextImpl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32dbc6eb04c4e42478c01371a1f961c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientProtocol.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientProtocol.cs new file mode 100644 index 00000000..0a401f85 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientProtocol.cs @@ -0,0 +1,920 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsClientProtocol + : TlsProtocol + { + protected TlsClient mTlsClient = null; + internal TlsClientContextImpl mTlsClientContext = null; + + protected byte[] mSelectedSessionID = null; + + protected TlsKeyExchange mKeyExchange = null; + protected TlsAuthentication mAuthentication = null; + + protected CertificateStatus mCertificateStatus = null; + protected CertificateRequest mCertificateRequest = null; + + /** + * Constructor for blocking mode. + * @param stream The bi-directional stream of data to/from the server + * @param secureRandom Random number generator for various cryptographic functions + */ + public TlsClientProtocol(Stream stream, SecureRandom secureRandom) + : base(stream, secureRandom) + { + } + + /** + * Constructor for blocking mode. + * @param input The stream of data from the server + * @param output The stream of data to the server + * @param secureRandom Random number generator for various cryptographic functions + */ + public TlsClientProtocol(Stream input, Stream output, SecureRandom secureRandom) + : base(input, output, secureRandom) + { + } + + /** + * Constructor for non-blocking mode.
+ *
+ * When data is received, use {@link #offerInput(java.nio.ByteBuffer)} to + * provide the received ciphertext, then use + * {@link #readInput(byte[], int, int)} to read the corresponding cleartext.
+ *
+ * Similarly, when data needs to be sent, use + * {@link #offerOutput(byte[], int, int)} to provide the cleartext, then use + * {@link #readOutput(byte[], int, int)} to get the corresponding + * ciphertext. + * + * @param secureRandom + * Random number generator for various cryptographic functions + */ + public TlsClientProtocol(SecureRandom secureRandom) + : base(secureRandom) + { + } + + /** + * Initiates a TLS handshake in the role of client.
+ *
+ * In blocking mode, this will not return until the handshake is complete. + * In non-blocking mode, use {@link TlsPeer#NotifyHandshakeComplete()} to + * receive a callback when the handshake is complete. + * + * @param tlsClient The {@link TlsClient} to use for the handshake. + * @throws IOException If in blocking mode and handshake was not successful. + */ + public virtual void Connect(TlsClient tlsClient) + { + if (tlsClient == null) + throw new ArgumentNullException("tlsClient"); + if (this.mTlsClient != null) + throw new InvalidOperationException("'Connect' can only be called once"); + + this.mTlsClient = tlsClient; + + this.mSecurityParameters = new SecurityParameters(); + this.mSecurityParameters.entity = ConnectionEnd.client; + + this.mTlsClientContext = new TlsClientContextImpl(mSecureRandom, mSecurityParameters); + + this.mSecurityParameters.clientRandom = CreateRandomBlock(tlsClient.ShouldUseGmtUnixTime(), + mTlsClientContext.NonceRandomGenerator); + + this.mTlsClient.Init(mTlsClientContext); + this.mRecordStream.Init(mTlsClientContext); + + TlsSession sessionToResume = tlsClient.GetSessionToResume(); + if (sessionToResume != null && sessionToResume.IsResumable) + { + SessionParameters sessionParameters = sessionToResume.ExportSessionParameters(); + if (sessionParameters != null && sessionParameters.IsExtendedMasterSecret) + { + this.mTlsSession = sessionToResume; + this.mSessionParameters = sessionParameters; + } + } + + SendClientHelloMessage(); + this.mConnectionState = CS_CLIENT_HELLO; + + BlockForHandshake(); + } + + protected override void CleanupHandshake() + { + base.CleanupHandshake(); + + this.mSelectedSessionID = null; + this.mKeyExchange = null; + this.mAuthentication = null; + this.mCertificateStatus = null; + this.mCertificateRequest = null; + } + + protected override TlsContext Context + { + get { return mTlsClientContext; } + } + + internal override AbstractTlsContext ContextAdmin + { + get { return mTlsClientContext; } + } + + protected override TlsPeer Peer + { + get { return mTlsClient; } + } + + protected override void HandleHandshakeMessage(byte type, MemoryStream buf) + { + if (this.mResumedSession) + { + if (type != HandshakeType.finished || this.mConnectionState != CS_SERVER_HELLO) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + ProcessFinishedMessage(buf); + this.mConnectionState = CS_SERVER_FINISHED; + + SendChangeCipherSpecMessage(); + SendFinishedMessage(); + this.mConnectionState = CS_CLIENT_FINISHED; + + CompleteHandshake(); + return; + } + + switch (type) + { + case HandshakeType.certificate: + { + switch (this.mConnectionState) + { + case CS_SERVER_HELLO: + case CS_SERVER_SUPPLEMENTAL_DATA: + { + if (this.mConnectionState == CS_SERVER_HELLO) + { + HandleSupplementalData(null); + } + + // Parse the Certificate message and Send to cipher suite + + this.mPeerCertificate = Certificate.Parse(buf); + + AssertEmpty(buf); + + // TODO[RFC 3546] Check whether empty certificates is possible, allowed, or excludes CertificateStatus + if (this.mPeerCertificate == null || this.mPeerCertificate.IsEmpty) + { + this.mAllowCertificateStatus = false; + } + + this.mKeyExchange.ProcessServerCertificate(this.mPeerCertificate); + + this.mAuthentication = mTlsClient.GetAuthentication(); + this.mAuthentication.NotifyServerCertificate(this.mPeerCertificate); + + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + this.mConnectionState = CS_SERVER_CERTIFICATE; + break; + } + case HandshakeType.certificate_status: + { + switch (this.mConnectionState) + { + case CS_SERVER_CERTIFICATE: + { + if (!this.mAllowCertificateStatus) + { + /* + * RFC 3546 3.6. If a server returns a "CertificateStatus" message, then the + * server MUST have included an extension of type "status_request" with empty + * "extension_data" in the extended server hello.. + */ + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + this.mCertificateStatus = CertificateStatus.Parse(buf); + + AssertEmpty(buf); + + // TODO[RFC 3546] Figure out how to provide this to the client/authentication. + + this.mConnectionState = CS_CERTIFICATE_STATUS; + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.finished: + { + switch (this.mConnectionState) + { + case CS_CLIENT_FINISHED: + case CS_SERVER_SESSION_TICKET: + { + if (this.mConnectionState == CS_CLIENT_FINISHED && this.mExpectSessionTicket) + { + /* + * RFC 5077 3.3. This message MUST be sent if the server included a + * SessionTicket extension in the ServerHello. + */ + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + ProcessFinishedMessage(buf); + this.mConnectionState = CS_SERVER_FINISHED; + + CompleteHandshake(); + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.server_hello: + { + switch (this.mConnectionState) + { + case CS_CLIENT_HELLO: + { + ReceiveServerHelloMessage(buf); + this.mConnectionState = CS_SERVER_HELLO; + + this.mRecordStream.NotifyHelloComplete(); + + ApplyMaxFragmentLengthExtension(); + + if (this.mResumedSession) + { + this.mSecurityParameters.masterSecret = Arrays.Clone(this.mSessionParameters.MasterSecret); + this.mRecordStream.SetPendingConnectionState(Peer.GetCompression(), Peer.GetCipher()); + } + else + { + InvalidateSession(); + + if (this.mSelectedSessionID.Length > 0) + { + this.mTlsSession = new TlsSessionImpl(this.mSelectedSessionID, null); + } + } + + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.supplemental_data: + { + switch (this.mConnectionState) + { + case CS_SERVER_HELLO: + { + HandleSupplementalData(ReadSupplementalDataMessage(buf)); + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.server_hello_done: + { + switch (this.mConnectionState) + { + case CS_SERVER_HELLO: + case CS_SERVER_SUPPLEMENTAL_DATA: + case CS_SERVER_CERTIFICATE: + case CS_CERTIFICATE_STATUS: + case CS_SERVER_KEY_EXCHANGE: + case CS_CERTIFICATE_REQUEST: + { + if (mConnectionState < CS_SERVER_SUPPLEMENTAL_DATA) + { + HandleSupplementalData(null); + } + + if (mConnectionState < CS_SERVER_CERTIFICATE) + { + // There was no server certificate message; check it's OK + this.mKeyExchange.SkipServerCredentials(); + this.mAuthentication = null; + } + + if (mConnectionState < CS_SERVER_KEY_EXCHANGE) + { + // There was no server key exchange message; check it's OK + this.mKeyExchange.SkipServerKeyExchange(); + } + + AssertEmpty(buf); + + this.mConnectionState = CS_SERVER_HELLO_DONE; + + this.mRecordStream.HandshakeHash.SealHashAlgorithms(); + + IList clientSupplementalData = mTlsClient.GetClientSupplementalData(); + if (clientSupplementalData != null) + { + SendSupplementalDataMessage(clientSupplementalData); + } + this.mConnectionState = CS_CLIENT_SUPPLEMENTAL_DATA; + + TlsCredentials clientCreds = null; + if (mCertificateRequest == null) + { + this.mKeyExchange.SkipClientCredentials(); + } + else + { + clientCreds = this.mAuthentication.GetClientCredentials(Context, mCertificateRequest); + + if (clientCreds == null) + { + this.mKeyExchange.SkipClientCredentials(); + + /* + * RFC 5246 If no suitable certificate is available, the client MUST Send a + * certificate message containing no certificates. + * + * NOTE: In previous RFCs, this was SHOULD instead of MUST. + */ + SendCertificateMessage(Certificate.EmptyChain); + } + else + { + this.mKeyExchange.ProcessClientCredentials(clientCreds); + + SendCertificateMessage(clientCreds.Certificate); + } + } + + this.mConnectionState = CS_CLIENT_CERTIFICATE; + + /* + * Send the client key exchange message, depending on the key exchange we are using + * in our CipherSuite. + */ + SendClientKeyExchangeMessage(); + this.mConnectionState = CS_CLIENT_KEY_EXCHANGE; + + if (TlsUtilities.IsSsl(Context)) + { + EstablishMasterSecret(Context, mKeyExchange); + } + + TlsHandshakeHash prepareFinishHash = mRecordStream.PrepareToFinish(); + this.mSecurityParameters.sessionHash = GetCurrentPrfHash(Context, prepareFinishHash, null); + + if (!TlsUtilities.IsSsl(Context)) + { + EstablishMasterSecret(Context, mKeyExchange); + } + + mRecordStream.SetPendingConnectionState(Peer.GetCompression(), Peer.GetCipher()); + + if (clientCreds != null && clientCreds is TlsSignerCredentials) + { + TlsSignerCredentials signerCredentials = (TlsSignerCredentials)clientCreds; + + /* + * RFC 5246 4.7. digitally-signed element needs SignatureAndHashAlgorithm from TLS 1.2 + */ + SignatureAndHashAlgorithm signatureAndHashAlgorithm = TlsUtilities.GetSignatureAndHashAlgorithm( + Context, signerCredentials); + + byte[] hash; + if (signatureAndHashAlgorithm == null) + { + hash = mSecurityParameters.SessionHash; + } + else + { + hash = prepareFinishHash.GetFinalHash(signatureAndHashAlgorithm.Hash); + } + + byte[] signature = signerCredentials.GenerateCertificateSignature(hash); + DigitallySigned certificateVerify = new DigitallySigned(signatureAndHashAlgorithm, signature); + SendCertificateVerifyMessage(certificateVerify); + + this.mConnectionState = CS_CERTIFICATE_VERIFY; + } + + SendChangeCipherSpecMessage(); + SendFinishedMessage(); + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + this.mConnectionState = CS_CLIENT_FINISHED; + break; + } + case HandshakeType.server_key_exchange: + { + switch (this.mConnectionState) + { + case CS_SERVER_HELLO: + case CS_SERVER_SUPPLEMENTAL_DATA: + case CS_SERVER_CERTIFICATE: + case CS_CERTIFICATE_STATUS: + { + if (mConnectionState < CS_SERVER_SUPPLEMENTAL_DATA) + { + HandleSupplementalData(null); + } + + if (mConnectionState < CS_SERVER_CERTIFICATE) + { + // There was no server certificate message; check it's OK + this.mKeyExchange.SkipServerCredentials(); + this.mAuthentication = null; + } + + this.mKeyExchange.ProcessServerKeyExchange(buf); + + AssertEmpty(buf); + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + this.mConnectionState = CS_SERVER_KEY_EXCHANGE; + break; + } + case HandshakeType.certificate_request: + { + switch (this.mConnectionState) + { + case CS_SERVER_CERTIFICATE: + case CS_CERTIFICATE_STATUS: + case CS_SERVER_KEY_EXCHANGE: + { + if (this.mConnectionState != CS_SERVER_KEY_EXCHANGE) + { + // There was no server key exchange message; check it's OK + this.mKeyExchange.SkipServerKeyExchange(); + } + + if (this.mAuthentication == null) + { + /* + * RFC 2246 7.4.4. It is a fatal handshake_failure alert for an anonymous server + * to request client identification. + */ + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + + this.mCertificateRequest = CertificateRequest.Parse(Context, buf); + + AssertEmpty(buf); + + this.mKeyExchange.ValidateCertificateRequest(this.mCertificateRequest); + + /* + * TODO Give the client a chance to immediately select the CertificateVerify hash + * algorithm here to avoid tracking the other hash algorithms unnecessarily? + */ + TlsUtilities.TrackHashAlgorithms(this.mRecordStream.HandshakeHash, + this.mCertificateRequest.SupportedSignatureAlgorithms); + + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + this.mConnectionState = CS_CERTIFICATE_REQUEST; + break; + } + case HandshakeType.session_ticket: + { + switch (this.mConnectionState) + { + case CS_CLIENT_FINISHED: + { + if (!this.mExpectSessionTicket) + { + /* + * RFC 5077 3.3. This message MUST NOT be sent if the server did not include a + * SessionTicket extension in the ServerHello. + */ + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + /* + * RFC 5077 3.4. If the client receives a session ticket from the server, then it + * discards any Session ID that was sent in the ServerHello. + */ + InvalidateSession(); + + ReceiveNewSessionTicketMessage(buf); + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + this.mConnectionState = CS_SERVER_SESSION_TICKET; + break; + } + case HandshakeType.hello_request: + { + AssertEmpty(buf); + + /* + * RFC 2246 7.4.1.1 Hello request This message will be ignored by the client if the + * client is currently negotiating a session. This message may be ignored by the client + * if it does not wish to renegotiate a session, or the client may, if it wishes, + * respond with a no_renegotiation alert. + */ + if (this.mConnectionState == CS_END) + { + RefuseRenegotiation(); + } + break; + } + case HandshakeType.client_hello: + case HandshakeType.client_key_exchange: + case HandshakeType.certificate_verify: + case HandshakeType.hello_verify_request: + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + } + + protected virtual void HandleSupplementalData(IList serverSupplementalData) + { + this.mTlsClient.ProcessServerSupplementalData(serverSupplementalData); + this.mConnectionState = CS_SERVER_SUPPLEMENTAL_DATA; + + this.mKeyExchange = mTlsClient.GetKeyExchange(); + this.mKeyExchange.Init(Context); + } + + protected virtual void ReceiveNewSessionTicketMessage(MemoryStream buf) + { + NewSessionTicket newSessionTicket = NewSessionTicket.Parse(buf); + + AssertEmpty(buf); + + mTlsClient.NotifyNewSessionTicket(newSessionTicket); + } + + protected virtual void ReceiveServerHelloMessage(MemoryStream buf) + { + { + ProtocolVersion server_version = TlsUtilities.ReadVersion(buf); + if (server_version.IsDtls) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + // Check that this matches what the server is Sending in the record layer + if (!server_version.Equals(this.mRecordStream.ReadVersion)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + ProtocolVersion client_version = Context.ClientVersion; + if (!server_version.IsEqualOrEarlierVersionOf(client_version)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + this.mRecordStream.SetWriteVersion(server_version); + ContextAdmin.SetServerVersion(server_version); + this.mTlsClient.NotifyServerVersion(server_version); + } + + /* + * Read the server random + */ + this.mSecurityParameters.serverRandom = TlsUtilities.ReadFully(32, buf); + + this.mSelectedSessionID = TlsUtilities.ReadOpaque8(buf); + if (this.mSelectedSessionID.Length > 32) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + this.mTlsClient.NotifySessionID(this.mSelectedSessionID); + this.mResumedSession = this.mSelectedSessionID.Length > 0 && this.mTlsSession != null + && Arrays.AreEqual(this.mSelectedSessionID, this.mTlsSession.SessionID); + + /* + * Find out which CipherSuite the server has chosen and check that it was one of the offered + * ones, and is a valid selection for the negotiated version. + */ + int selectedCipherSuite = TlsUtilities.ReadUint16(buf); + if (!Arrays.Contains(this.mOfferedCipherSuites, selectedCipherSuite) + || selectedCipherSuite == CipherSuite.TLS_NULL_WITH_NULL_NULL + || CipherSuite.IsScsv(selectedCipherSuite) + || !TlsUtilities.IsValidCipherSuiteForVersion(selectedCipherSuite, Context.ServerVersion)) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + this.mTlsClient.NotifySelectedCipherSuite(selectedCipherSuite); + + /* + * Find out which CompressionMethod the server has chosen and check that it was one of the + * offered ones. + */ + byte selectedCompressionMethod = TlsUtilities.ReadUint8(buf); + if (!Arrays.Contains(this.mOfferedCompressionMethods, selectedCompressionMethod)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + this.mTlsClient.NotifySelectedCompressionMethod(selectedCompressionMethod); + + /* + * RFC 3546 2.2 The extended server hello message format MAY be sent in place of the server + * hello message when the client has requested extended functionality via the extended + * client hello message specified in Section 2.1. ... Note that the extended server hello + * message is only sent in response to an extended client hello message. This prevents the + * possibility that the extended server hello message could "break" existing TLS 1.0 + * clients. + */ + this.mServerExtensions = ReadExtensions(buf); + + /* + * RFC 7627 4. Clients and servers SHOULD NOT accept handshakes that do not use the extended + * master secret [..]. (and see 5.2, 5.3) + */ + this.mSecurityParameters.extendedMasterSecret = !TlsUtilities.IsSsl(mTlsClientContext) + && TlsExtensionsUtilities.HasExtendedMasterSecretExtension(mServerExtensions); + + if (!mSecurityParameters.IsExtendedMasterSecret + && (mResumedSession || mTlsClient.RequiresExtendedMasterSecret())) + { + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + + /* + * RFC 3546 2.2 Note that the extended server hello message is only sent in response to an + * extended client hello message. + * + * However, see RFC 5746 exception below. We always include the SCSV, so an Extended Server + * Hello is always allowed. + */ + if (this.mServerExtensions != null) + { + foreach (int extType in this.mServerExtensions.Keys) + { + /* + * RFC 5746 3.6. Note that Sending a "renegotiation_info" extension in response to a + * ClientHello containing only the SCSV is an explicit exception to the prohibition + * in RFC 5246, Section 7.4.1.4, on the server Sending unsolicited extensions and is + * only allowed because the client is signaling its willingness to receive the + * extension via the TLS_EMPTY_RENEGOTIATION_INFO_SCSV SCSV. + */ + if (extType == ExtensionType.renegotiation_info) + continue; + + /* + * RFC 5246 7.4.1.4 An extension type MUST NOT appear in the ServerHello unless the + * same extension type appeared in the corresponding ClientHello. If a client + * receives an extension type in ServerHello that it did not request in the + * associated ClientHello, it MUST abort the handshake with an unsupported_extension + * fatal alert. + */ + if (null == TlsUtilities.GetExtensionData(this.mClientExtensions, extType)) + throw new TlsFatalAlert(AlertDescription.unsupported_extension); + + /* + * RFC 3546 2.3. If [...] the older session is resumed, then the server MUST ignore + * extensions appearing in the client hello, and Send a server hello containing no + * extensions[.] + */ + if (this.mResumedSession) + { + // TODO[compat-gnutls] GnuTLS test server Sends server extensions e.g. ec_point_formats + // TODO[compat-openssl] OpenSSL test server Sends server extensions e.g. ec_point_formats + // TODO[compat-polarssl] PolarSSL test server Sends server extensions e.g. ec_point_formats + // throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + } + + /* + * RFC 5746 3.4. Client Behavior: Initial Handshake + */ + { + /* + * When a ServerHello is received, the client MUST check if it includes the + * "renegotiation_info" extension: + */ + byte[] renegExtData = TlsUtilities.GetExtensionData(this.mServerExtensions, ExtensionType.renegotiation_info); + if (renegExtData != null) + { + /* + * If the extension is present, set the secure_renegotiation flag to TRUE. The + * client MUST then verify that the length of the "renegotiated_connection" + * field is zero, and if it is not, MUST abort the handshake (by Sending a fatal + * handshake_failure alert). + */ + this.mSecureRenegotiation = true; + + if (!Arrays.ConstantTimeAreEqual(renegExtData, CreateRenegotiationInfo(TlsUtilities.EmptyBytes))) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + } + + // TODO[compat-gnutls] GnuTLS test server fails to Send renegotiation_info extension when resuming + this.mTlsClient.NotifySecureRenegotiation(this.mSecureRenegotiation); + + IDictionary sessionClientExtensions = mClientExtensions, sessionServerExtensions = mServerExtensions; + if (this.mResumedSession) + { + if (selectedCipherSuite != this.mSessionParameters.CipherSuite + || selectedCompressionMethod != this.mSessionParameters.CompressionAlgorithm) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + sessionClientExtensions = null; + sessionServerExtensions = this.mSessionParameters.ReadServerExtensions(); + } + + this.mSecurityParameters.cipherSuite = selectedCipherSuite; + this.mSecurityParameters.compressionAlgorithm = selectedCompressionMethod; + + if (sessionServerExtensions != null && sessionServerExtensions.Count > 0) + { + { + /* + * RFC 7366 3. If a server receives an encrypt-then-MAC request extension from a client + * and then selects a stream or Authenticated Encryption with Associated Data (AEAD) + * ciphersuite, it MUST NOT send an encrypt-then-MAC response extension back to the + * client. + */ + bool serverSentEncryptThenMAC = TlsExtensionsUtilities.HasEncryptThenMacExtension(sessionServerExtensions); + if (serverSentEncryptThenMAC && !TlsUtilities.IsBlockCipherSuite(selectedCipherSuite)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + this.mSecurityParameters.encryptThenMac = serverSentEncryptThenMAC; + } + + this.mSecurityParameters.maxFragmentLength = ProcessMaxFragmentLengthExtension(sessionClientExtensions, + sessionServerExtensions, AlertDescription.illegal_parameter); + + this.mSecurityParameters.truncatedHMac = TlsExtensionsUtilities.HasTruncatedHMacExtension(sessionServerExtensions); + + /* + * TODO It's surprising that there's no provision to allow a 'fresh' CertificateStatus to be sent in + * a session resumption handshake. + */ + this.mAllowCertificateStatus = !this.mResumedSession + && TlsUtilities.HasExpectedEmptyExtensionData(sessionServerExtensions, ExtensionType.status_request, + AlertDescription.illegal_parameter); + + this.mExpectSessionTicket = !this.mResumedSession + && TlsUtilities.HasExpectedEmptyExtensionData(sessionServerExtensions, ExtensionType.session_ticket, + AlertDescription.illegal_parameter); + } + + if (sessionClientExtensions != null) + { + this.mTlsClient.ProcessServerExtensions(sessionServerExtensions); + } + + this.mSecurityParameters.prfAlgorithm = GetPrfAlgorithm(Context, this.mSecurityParameters.CipherSuite); + + /* + * RFC 5246 7.4.9. Any cipher suite which does not explicitly specify + * verify_data_length has a verify_data_length equal to 12. This includes all + * existing cipher suites. + */ + this.mSecurityParameters.verifyDataLength = 12; + } + + protected virtual void SendCertificateVerifyMessage(DigitallySigned certificateVerify) + { + HandshakeMessage message = new HandshakeMessage(HandshakeType.certificate_verify); + + certificateVerify.Encode(message); + + message.WriteToRecordStream(this); + } + + protected virtual void SendClientHelloMessage() + { + this.mRecordStream.SetWriteVersion(this.mTlsClient.ClientHelloRecordLayerVersion); + + ProtocolVersion client_version = this.mTlsClient.ClientVersion; + if (client_version.IsDtls) + throw new TlsFatalAlert(AlertDescription.internal_error); + + ContextAdmin.SetClientVersion(client_version); + + /* + * TODO RFC 5077 3.4. When presenting a ticket, the client MAY generate and include a + * Session ID in the TLS ClientHello. + */ + byte[] session_id = TlsUtilities.EmptyBytes; + if (this.mTlsSession != null) + { + session_id = this.mTlsSession.SessionID; + if (session_id == null || session_id.Length > 32) + { + session_id = TlsUtilities.EmptyBytes; + } + } + + bool fallback = this.mTlsClient.IsFallback; + + this.mOfferedCipherSuites = this.mTlsClient.GetCipherSuites(); + + this.mOfferedCompressionMethods = this.mTlsClient.GetCompressionMethods(); + + if (session_id.Length > 0 && this.mSessionParameters != null) + { + if (!mSessionParameters.IsExtendedMasterSecret + || !Arrays.Contains(this.mOfferedCipherSuites, mSessionParameters.CipherSuite) + || !Arrays.Contains(this.mOfferedCompressionMethods, mSessionParameters.CompressionAlgorithm)) + { + session_id = TlsUtilities.EmptyBytes; + } + } + + this.mClientExtensions = TlsExtensionsUtilities.EnsureExtensionsInitialised(this.mTlsClient.GetClientExtensions()); + + if (!client_version.IsSsl) + { + TlsExtensionsUtilities.AddExtendedMasterSecretExtension(this.mClientExtensions); + } + + HandshakeMessage message = new HandshakeMessage(HandshakeType.client_hello); + + TlsUtilities.WriteVersion(client_version, message); + + message.Write(this.mSecurityParameters.ClientRandom); + + TlsUtilities.WriteOpaque8(session_id, message); + + // Cipher Suites (and SCSV) + { + /* + * RFC 5746 3.4. The client MUST include either an empty "renegotiation_info" extension, + * or the TLS_EMPTY_RENEGOTIATION_INFO_SCSV signaling cipher suite value in the + * ClientHello. Including both is NOT RECOMMENDED. + */ + byte[] renegExtData = TlsUtilities.GetExtensionData(mClientExtensions, ExtensionType.renegotiation_info); + bool noRenegExt = (null == renegExtData); + + bool noRenegScsv = !Arrays.Contains(mOfferedCipherSuites, CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV); + + if (noRenegExt && noRenegScsv) + { + // TODO Consider whether to default to a client extension instead + this.mOfferedCipherSuites = Arrays.Append(mOfferedCipherSuites, CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV); + } + + /* + * RFC 7507 4. If a client sends a ClientHello.client_version containing a lower value + * than the latest (highest-valued) version supported by the client, it SHOULD include + * the TLS_FALLBACK_SCSV cipher suite value in ClientHello.cipher_suites [..]. (The + * client SHOULD put TLS_FALLBACK_SCSV after all cipher suites that it actually intends + * to negotiate.) + */ + if (fallback && !Arrays.Contains(mOfferedCipherSuites, CipherSuite.TLS_FALLBACK_SCSV)) + { + this.mOfferedCipherSuites = Arrays.Append(mOfferedCipherSuites, CipherSuite.TLS_FALLBACK_SCSV); + } + + TlsUtilities.WriteUint16ArrayWithUint16Length(mOfferedCipherSuites, message); + } + + TlsUtilities.WriteUint8ArrayWithUint8Length(mOfferedCompressionMethods, message); + + WriteExtensions(message, mClientExtensions); + + message.WriteToRecordStream(this); + } + + protected virtual void SendClientKeyExchangeMessage() + { + HandshakeMessage message = new HandshakeMessage(HandshakeType.client_key_exchange); + + this.mKeyExchange.GenerateClientKeyExchange(message); + + message.WriteToRecordStream(this); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientProtocol.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientProtocol.cs.meta new file mode 100644 index 00000000..9e5c97b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsClientProtocol.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: efd7608bc44f5434583f0ade20610e6c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCompression.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCompression.cs new file mode 100644 index 00000000..27ad0a16 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCompression.cs @@ -0,0 +1,16 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsCompression + { + Stream Compress(Stream output); + + Stream Decompress(Stream output); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCompression.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCompression.cs.meta new file mode 100644 index 00000000..7ca959cc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCompression.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 118ee7f4845b75f4fa6d64e872b4f53e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsContext.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsContext.cs new file mode 100644 index 00000000..208de262 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsContext.cs @@ -0,0 +1,49 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsContext + { + IRandomGenerator NonceRandomGenerator { get; } + + SecureRandom SecureRandom { get; } + + SecurityParameters SecurityParameters { get; } + + bool IsServer { get; } + + ProtocolVersion ClientVersion { get; } + + ProtocolVersion ServerVersion { get; } + + /** + * Used to get the resumable session, if any, used by this connection. Only available after the + * handshake has successfully completed. + * + * @return A {@link TlsSession} representing the resumable session used by this connection, or + * null if no resumable session available. + * @see TlsPeer#NotifyHandshakeComplete() + */ + TlsSession ResumableSession { get; } + + object UserObject { get; set; } + + /** + * Export keying material according to RFC 5705: "Keying Material Exporters for TLS". + * + * @param asciiLabel indicates which application will use the exported keys. + * @param context_value allows the application using the exporter to mix its own data with the TLS PRF for + * the exporter output. + * @param length the number of bytes to generate + * @return a pseudorandom bit string of 'length' bytes generated from the master_secret. + */ + byte[] ExportKeyingMaterial(string asciiLabel, byte[] context_value, int length); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsContext.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsContext.cs.meta new file mode 100644 index 00000000..f2a08ad1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68ec95ad3cb7b5f4495addfe40c83363 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCredentials.cs new file mode 100644 index 00000000..e5be092b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCredentials.cs @@ -0,0 +1,13 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsCredentials + { + Certificate Certificate { get; } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCredentials.cs.meta new file mode 100644 index 00000000..3c8be353 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5bcedf628549c6d428c60b55b1c6286f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHKeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHKeyExchange.cs new file mode 100644 index 00000000..2dcb728c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHKeyExchange.cs @@ -0,0 +1,253 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// (D)TLS DH key exchange. + public class TlsDHKeyExchange + : AbstractTlsKeyExchange + { + protected TlsSigner mTlsSigner; + protected TlsDHVerifier mDHVerifier; + protected DHParameters mDHParameters; + + protected AsymmetricKeyParameter mServerPublicKey; + protected TlsAgreementCredentials mAgreementCredentials; + + protected DHPrivateKeyParameters mDHAgreePrivateKey; + protected DHPublicKeyParameters mDHAgreePublicKey; + + [Obsolete("Use constructor that takes a TlsDHVerifier")] + public TlsDHKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, DHParameters dhParameters) + : this(keyExchange, supportedSignatureAlgorithms, new DefaultTlsDHVerifier(), dhParameters) + { + } + + public TlsDHKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, TlsDHVerifier dhVerifier, DHParameters dhParameters) + : base(keyExchange, supportedSignatureAlgorithms) + { + switch (keyExchange) + { + case KeyExchangeAlgorithm.DH_anon: + case KeyExchangeAlgorithm.DH_RSA: + case KeyExchangeAlgorithm.DH_DSS: + this.mTlsSigner = null; + break; + case KeyExchangeAlgorithm.DHE_RSA: + this.mTlsSigner = new TlsRsaSigner(); + break; + case KeyExchangeAlgorithm.DHE_DSS: + this.mTlsSigner = new TlsDssSigner(); + break; + default: + throw new InvalidOperationException("unsupported key exchange algorithm"); + } + + this.mDHVerifier = dhVerifier; + this.mDHParameters = dhParameters; + } + + public override void Init(TlsContext context) + { + base.Init(context); + + if (this.mTlsSigner != null) + { + this.mTlsSigner.Init(context); + } + } + + public override void SkipServerCredentials() + { + if (mKeyExchange != KeyExchangeAlgorithm.DH_anon) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public override void ProcessServerCertificate(Certificate serverCertificate) + { + if (mKeyExchange == KeyExchangeAlgorithm.DH_anon) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + if (serverCertificate.IsEmpty) + throw new TlsFatalAlert(AlertDescription.bad_certificate); + + X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0); + + SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo; + try + { + this.mServerPublicKey = PublicKeyFactory.CreateKey(keyInfo); + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.unsupported_certificate, e); + } + + if (mTlsSigner == null) + { + try + { + this.mDHAgreePublicKey = (DHPublicKeyParameters)this.mServerPublicKey; + this.mDHParameters = mDHAgreePublicKey.Parameters; + } + catch (InvalidCastException e) + { + throw new TlsFatalAlert(AlertDescription.certificate_unknown, e); + } + + TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.KeyAgreement); + } + else + { + if (!mTlsSigner.IsValidPublicKey(this.mServerPublicKey)) + { + throw new TlsFatalAlert(AlertDescription.certificate_unknown); + } + + TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.DigitalSignature); + } + + base.ProcessServerCertificate(serverCertificate); + } + + public override bool RequiresServerKeyExchange + { + get + { + switch (mKeyExchange) + { + case KeyExchangeAlgorithm.DH_anon: + case KeyExchangeAlgorithm.DHE_DSS: + case KeyExchangeAlgorithm.DHE_RSA: + return true; + default: + return false; + } + } + } + + public override byte[] GenerateServerKeyExchange() + { + if (!RequiresServerKeyExchange) + return null; + + // DH_anon is handled here, DHE_* in a subclass + + MemoryStream buf = new MemoryStream(); + this.mDHAgreePrivateKey = TlsDHUtilities.GenerateEphemeralServerKeyExchange(mContext.SecureRandom, + this.mDHParameters, buf); + return buf.ToArray(); + } + + public override void ProcessServerKeyExchange(Stream input) + { + if (!RequiresServerKeyExchange) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + // DH_anon is handled here, DHE_* in a subclass + + this.mDHParameters = TlsDHUtilities.ReceiveDHParameters(mDHVerifier, input); + this.mDHAgreePublicKey = new DHPublicKeyParameters(TlsDHUtilities.ReadDHParameter(input), mDHParameters); + } + + public override void ValidateCertificateRequest(CertificateRequest certificateRequest) + { + if (mKeyExchange == KeyExchangeAlgorithm.DH_anon) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + + byte[] types = certificateRequest.CertificateTypes; + for (int i = 0; i < types.Length; ++i) + { + switch (types[i]) + { + case ClientCertificateType.rsa_sign: + case ClientCertificateType.dss_sign: + case ClientCertificateType.rsa_fixed_dh: + case ClientCertificateType.dss_fixed_dh: + case ClientCertificateType.ecdsa_sign: + break; + default: + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + } + + public override void ProcessClientCredentials(TlsCredentials clientCredentials) + { + if (mKeyExchange == KeyExchangeAlgorithm.DH_anon) + throw new TlsFatalAlert(AlertDescription.internal_error); + + if (clientCredentials is TlsAgreementCredentials) + { + // TODO Validate client cert has matching parameters (see 'areCompatibleParameters')? + + this.mAgreementCredentials = (TlsAgreementCredentials)clientCredentials; + } + else if (clientCredentials is TlsSignerCredentials) + { + // OK + } + else + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public override void GenerateClientKeyExchange(Stream output) + { + /* + * RFC 2246 7.4.7.2 If the client certificate already contains a suitable Diffie-Hellman + * key, then Yc is implicit and does not need to be sent again. In this case, the Client Key + * Exchange message will be sent, but will be empty. + */ + if (mAgreementCredentials == null) + { + this.mDHAgreePrivateKey = TlsDHUtilities.GenerateEphemeralClientKeyExchange(mContext.SecureRandom, + mDHParameters, output); + } + } + + public override void ProcessClientCertificate(Certificate clientCertificate) + { + if (mKeyExchange == KeyExchangeAlgorithm.DH_anon) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + // TODO Extract the public key + // TODO If the certificate is 'fixed', take the public key as dhAgreePublicKey + } + + public override void ProcessClientKeyExchange(Stream input) + { + if (mDHAgreePublicKey != null) + { + // For dss_fixed_dh and rsa_fixed_dh, the key arrived in the client certificate + return; + } + + this.mDHAgreePublicKey = new DHPublicKeyParameters(TlsDHUtilities.ReadDHParameter(input), mDHParameters); + } + + public override byte[] GeneratePremasterSecret() + { + if (mAgreementCredentials != null) + { + return mAgreementCredentials.GenerateAgreement(mDHAgreePublicKey); + } + + if (mDHAgreePrivateKey != null) + { + return TlsDHUtilities.CalculateDHBasicAgreement(mDHAgreePublicKey, mDHAgreePrivateKey); + } + + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHKeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHKeyExchange.cs.meta new file mode 100644 index 00000000..4aa28e21 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHKeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da85cdeda01348a4b9c96d7be44452ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHUtilities.cs new file mode 100644 index 00000000..ff2a9440 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHUtilities.cs @@ -0,0 +1,482 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class TlsDHUtilities + { + internal static readonly BigInteger Two = BigInteger.Two; + + /* + * TODO[draft-ietf-tls-negotiated-ff-dhe-01] Move these groups to DHStandardGroups once reaches RFC + */ + private static BigInteger FromHex(String hex) + { + return new BigInteger(1, Hex.Decode(hex)); + } + + private static DHParameters FromSafeP(String hexP) + { + BigInteger p = FromHex(hexP), q = p.ShiftRight(1); + return new DHParameters(p, Two, q); + } + + private static readonly string draft_ffdhe2432_p = + "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + + "AEFE13098533C8B3FFFFFFFFFFFFFFFF"; + internal static readonly DHParameters draft_ffdhe2432 = FromSafeP(draft_ffdhe2432_p); + + private static readonly string draft_ffdhe3072_p = + "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B66C62E37FFFFFFFFFFFFFFFF"; + internal static readonly DHParameters draft_ffdhe3072 = FromSafeP(draft_ffdhe3072_p); + + private static readonly string draft_ffdhe4096_p = + "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B669E1EF16E6F52C3164DF4FB" + + "7930E9E4E58857B6AC7D5F42D69F6D187763CF1D55034004" + + "87F55BA57E31CC7A7135C886EFB4318AED6A1E012D9E6832" + + "A907600A918130C46DC778F971AD0038092999A333CB8B7A" + + "1A1DB93D7140003C2A4ECEA9F98D0ACC0A8291CDCEC97DCF" + + "8EC9B55A7F88A46B4DB5A851F44182E1C68A007E5E655F6A" + + "FFFFFFFFFFFFFFFF"; + internal static readonly DHParameters draft_ffdhe4096 = FromSafeP(draft_ffdhe4096_p); + + private static readonly string draft_ffdhe6144_p = + "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B669E1EF16E6F52C3164DF4FB" + + "7930E9E4E58857B6AC7D5F42D69F6D187763CF1D55034004" + + "87F55BA57E31CC7A7135C886EFB4318AED6A1E012D9E6832" + + "A907600A918130C46DC778F971AD0038092999A333CB8B7A" + + "1A1DB93D7140003C2A4ECEA9F98D0ACC0A8291CDCEC97DCF" + + "8EC9B55A7F88A46B4DB5A851F44182E1C68A007E5E0DD902" + + "0BFD64B645036C7A4E677D2C38532A3A23BA4442CAF53EA6" + + "3BB454329B7624C8917BDD64B1C0FD4CB38E8C334C701C3A" + + "CDAD0657FCCFEC719B1F5C3E4E46041F388147FB4CFDB477" + + "A52471F7A9A96910B855322EDB6340D8A00EF092350511E3" + + "0ABEC1FFF9E3A26E7FB29F8C183023C3587E38DA0077D9B4" + + "763E4E4B94B2BBC194C6651E77CAF992EEAAC0232A281BF6" + + "B3A739C1226116820AE8DB5847A67CBEF9C9091B462D538C" + + "D72B03746AE77F5E62292C311562A846505DC82DB854338A" + + "E49F5235C95B91178CCF2DD5CACEF403EC9D1810C6272B04" + + "5B3B71F9DC6B80D63FDD4A8E9ADB1E6962A69526D43161C1" + + "A41D570D7938DAD4A40E329CD0E40E65FFFFFFFFFFFFFFFF"; + internal static readonly DHParameters draft_ffdhe6144 = FromSafeP(draft_ffdhe6144_p); + + private static readonly string draft_ffdhe8192_p = + "FFFFFFFFFFFFFFFFADF85458A2BB4A9AAFDC5620273D3CF1" + + "D8B9C583CE2D3695A9E13641146433FBCC939DCE249B3EF9" + + "7D2FE363630C75D8F681B202AEC4617AD3DF1ED5D5FD6561" + + "2433F51F5F066ED0856365553DED1AF3B557135E7F57C935" + + "984F0C70E0E68B77E2A689DAF3EFE8721DF158A136ADE735" + + "30ACCA4F483A797ABC0AB182B324FB61D108A94BB2C8E3FB" + + "B96ADAB760D7F4681D4F42A3DE394DF4AE56EDE76372BB19" + + "0B07A7C8EE0A6D709E02FCE1CDF7E2ECC03404CD28342F61" + + "9172FE9CE98583FF8E4F1232EEF28183C3FE3B1B4C6FAD73" + + "3BB5FCBC2EC22005C58EF1837D1683B2C6F34A26C1B2EFFA" + + "886B4238611FCFDCDE355B3B6519035BBC34F4DEF99C0238" + + "61B46FC9D6E6C9077AD91D2691F7F7EE598CB0FAC186D91C" + + "AEFE130985139270B4130C93BC437944F4FD4452E2D74DD3" + + "64F2E21E71F54BFF5CAE82AB9C9DF69EE86D2BC522363A0D" + + "ABC521979B0DEADA1DBF9A42D5C4484E0ABCD06BFA53DDEF" + + "3C1B20EE3FD59D7C25E41D2B669E1EF16E6F52C3164DF4FB" + + "7930E9E4E58857B6AC7D5F42D69F6D187763CF1D55034004" + + "87F55BA57E31CC7A7135C886EFB4318AED6A1E012D9E6832" + + "A907600A918130C46DC778F971AD0038092999A333CB8B7A" + + "1A1DB93D7140003C2A4ECEA9F98D0ACC0A8291CDCEC97DCF" + + "8EC9B55A7F88A46B4DB5A851F44182E1C68A007E5E0DD902" + + "0BFD64B645036C7A4E677D2C38532A3A23BA4442CAF53EA6" + + "3BB454329B7624C8917BDD64B1C0FD4CB38E8C334C701C3A" + + "CDAD0657FCCFEC719B1F5C3E4E46041F388147FB4CFDB477" + + "A52471F7A9A96910B855322EDB6340D8A00EF092350511E3" + + "0ABEC1FFF9E3A26E7FB29F8C183023C3587E38DA0077D9B4" + + "763E4E4B94B2BBC194C6651E77CAF992EEAAC0232A281BF6" + + "B3A739C1226116820AE8DB5847A67CBEF9C9091B462D538C" + + "D72B03746AE77F5E62292C311562A846505DC82DB854338A" + + "E49F5235C95B91178CCF2DD5CACEF403EC9D1810C6272B04" + + "5B3B71F9DC6B80D63FDD4A8E9ADB1E6962A69526D43161C1" + + "A41D570D7938DAD4A40E329CCFF46AAA36AD004CF600C838" + + "1E425A31D951AE64FDB23FCEC9509D43687FEB69EDD1CC5E" + + "0B8CC3BDF64B10EF86B63142A3AB8829555B2F747C932665" + + "CB2C0F1CC01BD70229388839D2AF05E454504AC78B758282" + + "2846C0BA35C35F5C59160CC046FD8251541FC68C9C86B022" + + "BB7099876A460E7451A8A93109703FEE1C217E6C3826E52C" + + "51AA691E0E423CFC99E9E31650C1217B624816CDAD9A95F9" + + "D5B8019488D9C0A0A1FE3075A577E23183F81D4A3F2FA457" + + "1EFC8CE0BA8A4FE8B6855DFE72B0A66EDED2FBABFBE58A30" + + "FAFABE1C5D71A87E2F741EF8C1FE86FEA6BBFDE530677F0D" + + "97D11D49F7A8443D0822E506A9F4614E011E2A94838FF88C" + + "D68C8BB7C5C6424CFFFFFFFFFFFFFFFF"; + internal static readonly DHParameters draft_ffdhe8192 = FromSafeP(draft_ffdhe8192_p); + + + public static void AddNegotiatedDheGroupsClientExtension(IDictionary extensions, byte[] dheGroups) + { + extensions[ExtensionType.negotiated_ff_dhe_groups] = CreateNegotiatedDheGroupsClientExtension(dheGroups); + } + + public static void AddNegotiatedDheGroupsServerExtension(IDictionary extensions, byte dheGroup) + { + extensions[ExtensionType.negotiated_ff_dhe_groups] = CreateNegotiatedDheGroupsServerExtension(dheGroup); + } + + public static byte[] GetNegotiatedDheGroupsClientExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.negotiated_ff_dhe_groups); + return extensionData == null ? null : ReadNegotiatedDheGroupsClientExtension(extensionData); + } + + public static short GetNegotiatedDheGroupsServerExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.negotiated_ff_dhe_groups); + return extensionData == null ? (short)-1 : (short)ReadNegotiatedDheGroupsServerExtension(extensionData); + } + + public static byte[] CreateNegotiatedDheGroupsClientExtension(byte[] dheGroups) + { + if (dheGroups == null || dheGroups.Length < 1 || dheGroups.Length > 255) + throw new TlsFatalAlert(AlertDescription.internal_error); + + return TlsUtilities.EncodeUint8ArrayWithUint8Length(dheGroups); + } + + public static byte[] CreateNegotiatedDheGroupsServerExtension(byte dheGroup) + { + return TlsUtilities.EncodeUint8(dheGroup); + } + + public static byte[] ReadNegotiatedDheGroupsClientExtension(byte[] extensionData) + { + byte[] dheGroups = TlsUtilities.DecodeUint8ArrayWithUint8Length(extensionData); + if (dheGroups.Length < 1) + throw new TlsFatalAlert(AlertDescription.decode_error); + return dheGroups; + } + + public static byte ReadNegotiatedDheGroupsServerExtension(byte[] extensionData) + { + return TlsUtilities.DecodeUint8(extensionData); + } + + public static DHParameters GetParametersForDHEGroup(short dheGroup) + { + switch (dheGroup) + { + case FiniteFieldDheGroup.ffdhe2432: + return draft_ffdhe2432; + case FiniteFieldDheGroup.ffdhe3072: + return draft_ffdhe3072; + case FiniteFieldDheGroup.ffdhe4096: + return draft_ffdhe4096; + case FiniteFieldDheGroup.ffdhe6144: + return draft_ffdhe6144; + case FiniteFieldDheGroup.ffdhe8192: + return draft_ffdhe8192; + default: + return null; + } + } + + public static bool ContainsDheCipherSuites(int[] cipherSuites) + { + for (int i = 0; i < cipherSuites.Length; ++i) + { + if (IsDheCipherSuite(cipherSuites[i])) + return true; + } + return false; + } + + public static bool IsDheCipherSuite(int cipherSuite) + { + switch (cipherSuite) + { + /* + * RFC 2246 + */ + case CipherSuite.TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_DES_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_DES_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA: + + /* + * RFC 3268 + */ + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA: + + /* + * RFC 5932 + */ + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256: + + /* + * RFC 4162 + */ + case CipherSuite.TLS_DHE_DSS_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_SEED_CBC_SHA: + + /* + * RFC 4279 + */ + case CipherSuite.TLS_DHE_PSK_WITH_RC4_128_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA: + + /* + * RFC 4785 + */ + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA: + + /* + * RFC 5246 + */ + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: + + /* + * RFC 5288 + */ + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_GCM_SHA384: + + /* + * RFC 5487 + */ + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA384: + + /* + * RFC 6367 + */ + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + + /* + * RFC 6655 + */ + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_PSK_DHE_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_DHE_WITH_AES_256_CCM_8: + + /* + * draft-ietf-tls-chacha20-poly1305-04 + */ + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + + /* + * draft-zauner-tls-aes-ocb-04 + */ + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_256_OCB: + + /* + * DH_anon cipher suites are consider ephemeral DH + */ + case CipherSuite.TLS_DH_anon_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_anon_WITH_RC4_128_MD5: + case CipherSuite.TLS_DH_anon_WITH_SEED_CBC_SHA: + + return true; + + default: + return false; + } + } + + public static bool AreCompatibleParameters(DHParameters a, DHParameters b) + { + return a.P.Equals(b.P) && a.G.Equals(b.G) + && (a.Q == null || b.Q == null || a.Q.Equals(b.Q)); + } + + public static byte[] CalculateDHBasicAgreement(DHPublicKeyParameters publicKey, + DHPrivateKeyParameters privateKey) + { + DHBasicAgreement basicAgreement = new DHBasicAgreement(); + basicAgreement.Init(privateKey); + BigInteger agreementValue = basicAgreement.CalculateAgreement(publicKey); + + /* + * RFC 5246 8.1.2. Leading bytes of Z that contain all zero bits are stripped before it is + * used as the pre_master_secret. + */ + return BigIntegers.AsUnsignedByteArray(agreementValue); + } + + public static AsymmetricCipherKeyPair GenerateDHKeyPair(SecureRandom random, DHParameters dhParams) + { + DHBasicKeyPairGenerator dhGen = new DHBasicKeyPairGenerator(); + dhGen.Init(new DHKeyGenerationParameters(random, dhParams)); + return dhGen.GenerateKeyPair(); + } + + public static DHPrivateKeyParameters GenerateEphemeralClientKeyExchange(SecureRandom random, + DHParameters dhParams, Stream output) + { + AsymmetricCipherKeyPair kp = GenerateDHKeyPair(random, dhParams); + + DHPublicKeyParameters dhPublic = (DHPublicKeyParameters)kp.Public; + WriteDHParameter(dhPublic.Y, output); + + return (DHPrivateKeyParameters)kp.Private; + } + + public static DHPrivateKeyParameters GenerateEphemeralServerKeyExchange(SecureRandom random, + DHParameters dhParams, Stream output) + { + AsymmetricCipherKeyPair kp = GenerateDHKeyPair(random, dhParams); + + DHPublicKeyParameters dhPublic = (DHPublicKeyParameters)kp.Public; + WriteDHParameters(dhParams, output); + WriteDHParameter(dhPublic.Y, output); + + return (DHPrivateKeyParameters)kp.Private; + } + + public static BigInteger ReadDHParameter(Stream input) + { + return new BigInteger(1, TlsUtilities.ReadOpaque16(input)); + } + + public static DHParameters ReadDHParameters(Stream input) + { + BigInteger p = ReadDHParameter(input); + BigInteger g = ReadDHParameter(input); + + return new DHParameters(p, g); + } + + public static DHParameters ReceiveDHParameters(TlsDHVerifier dhVerifier, Stream input) + { + DHParameters dhParameters = ReadDHParameters(input); + if (!dhVerifier.Accept(dhParameters)) + throw new TlsFatalAlert(AlertDescription.insufficient_security); + + return dhParameters; + } + + public static void WriteDHParameter(BigInteger x, Stream output) + { + TlsUtilities.WriteOpaque16(BigIntegers.AsUnsignedByteArray(x), output); + } + + public static void WriteDHParameters(DHParameters dhParameters, Stream output) + { + WriteDHParameter(dhParameters.P, output); + WriteDHParameter(dhParameters.G, output); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHUtilities.cs.meta new file mode 100644 index 00000000..bec962c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1436a65a79102a14080a0a51db47d919 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHVerifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHVerifier.cs new file mode 100644 index 00000000..d037d361 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHVerifier.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// An interface for verifying that Diffie-Hellman parameters are acceptable. + public interface TlsDHVerifier + { + /// Verify that the given DHParameters are acceptable. + /// The DHParameters to verify. + /// true if (and only if) the specified parameters are acceptable. + bool Accept(DHParameters dhParameters); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHVerifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHVerifier.cs.meta new file mode 100644 index 00000000..76613508 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDHVerifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9debf11000391114b85a24d21b64d459 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDeflateCompression.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDeflateCompression.cs new file mode 100644 index 00000000..c2c317e4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDeflateCompression.cs @@ -0,0 +1,72 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsDeflateCompression : TlsCompression + { + public const int LEVEL_NONE = JZlib.Z_NO_COMPRESSION; + public const int LEVEL_FASTEST = JZlib.Z_BEST_SPEED; + public const int LEVEL_SMALLEST = JZlib.Z_BEST_COMPRESSION; + public const int LEVEL_DEFAULT = JZlib.Z_DEFAULT_COMPRESSION; + + protected readonly ZStream zIn, zOut; + + public TlsDeflateCompression() + : this(LEVEL_DEFAULT) + { + } + + public TlsDeflateCompression(int level) + { + this.zIn = new ZStream(); + this.zIn.inflateInit(); + + this.zOut = new ZStream(); + this.zOut.deflateInit(level); + } + + public virtual Stream Compress(Stream output) + { + return new DeflateOutputStream(output, zOut, true); + } + + public virtual Stream Decompress(Stream output) + { + return new DeflateOutputStream(output, zIn, false); + } + + protected class DeflateOutputStream : ZOutputStream + { + public DeflateOutputStream(Stream output, ZStream z, bool compress) + : base(output, z) + { + this.compress = compress; + + /* + * See discussion at http://www.bolet.org/~pornin/deflate-flush.html . + */ + this.FlushMode = JZlib.Z_SYNC_FLUSH; + } + + public override void Flush() + { + /* + * TODO The inflateSyncPoint doesn't appear to work the way I hoped at the moment. + * In any case, we may like to accept PARTIAL_FLUSH input, not just SYNC_FLUSH. + * It's not clear how to check this in the Inflater. + */ + //if (!this.compress && (z == null || z.istate == null || z.istate.inflateSyncPoint(z) <= 0)) + //{ + // throw new TlsFatalAlert(AlertDescription.decompression_failure); + //} + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDeflateCompression.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDeflateCompression.cs.meta new file mode 100644 index 00000000..b48be1e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDeflateCompression.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4fa4a39186a3e43409048df72c4447a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDheKeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDheKeyExchange.cs new file mode 100644 index 00000000..764e45da --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDheKeyExchange.cs @@ -0,0 +1,101 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsDheKeyExchange + : TlsDHKeyExchange + { + protected TlsSignerCredentials mServerCredentials = null; + + [Obsolete("Use constructor that takes a TlsDHVerifier")] + public TlsDheKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, DHParameters dhParameters) + : this(keyExchange, supportedSignatureAlgorithms, new DefaultTlsDHVerifier(), dhParameters) + { + } + + public TlsDheKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, TlsDHVerifier dhVerifier, DHParameters dhParameters) + : base(keyExchange, supportedSignatureAlgorithms, dhVerifier, dhParameters) + { + } + + public override void ProcessServerCredentials(TlsCredentials serverCredentials) + { + if (!(serverCredentials is TlsSignerCredentials)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + ProcessServerCertificate(serverCredentials.Certificate); + + this.mServerCredentials = (TlsSignerCredentials)serverCredentials; + } + + public override byte[] GenerateServerKeyExchange() + { + if (this.mDHParameters == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + DigestInputBuffer buf = new DigestInputBuffer(); + + this.mDHAgreePrivateKey = TlsDHUtilities.GenerateEphemeralServerKeyExchange(mContext.SecureRandom, + this.mDHParameters, buf); + + /* + * RFC 5246 4.7. digitally-signed element needs SignatureAndHashAlgorithm from TLS 1.2 + */ + SignatureAndHashAlgorithm signatureAndHashAlgorithm = TlsUtilities.GetSignatureAndHashAlgorithm( + mContext, mServerCredentials); + + IDigest d = TlsUtilities.CreateHash(signatureAndHashAlgorithm); + + SecurityParameters securityParameters = mContext.SecurityParameters; + d.BlockUpdate(securityParameters.clientRandom, 0, securityParameters.clientRandom.Length); + d.BlockUpdate(securityParameters.serverRandom, 0, securityParameters.serverRandom.Length); + buf.UpdateDigest(d); + + byte[] hash = DigestUtilities.DoFinal(d); + + byte[] signature = mServerCredentials.GenerateCertificateSignature(hash); + + DigitallySigned signed_params = new DigitallySigned(signatureAndHashAlgorithm, signature); + signed_params.Encode(buf); + + return buf.ToArray(); + } + + public override void ProcessServerKeyExchange(Stream input) + { + SecurityParameters securityParameters = mContext.SecurityParameters; + + SignerInputBuffer buf = new SignerInputBuffer(); + Stream teeIn = new TeeInputStream(input, buf); + + this.mDHParameters = TlsDHUtilities.ReceiveDHParameters(mDHVerifier, teeIn); + this.mDHAgreePublicKey = new DHPublicKeyParameters(TlsDHUtilities.ReadDHParameter(teeIn), mDHParameters); + + DigitallySigned signed_params = ParseSignature(input); + + ISigner signer = InitVerifyer(mTlsSigner, signed_params.Algorithm, securityParameters); + buf.UpdateSigner(signer); + if (!signer.VerifySignature(signed_params.Signature)) + throw new TlsFatalAlert(AlertDescription.decrypt_error); + } + + protected virtual ISigner InitVerifyer(TlsSigner tlsSigner, SignatureAndHashAlgorithm algorithm, + SecurityParameters securityParameters) + { + ISigner signer = tlsSigner.CreateVerifyer(algorithm, this.mServerPublicKey); + signer.BlockUpdate(securityParameters.clientRandom, 0, securityParameters.clientRandom.Length); + signer.BlockUpdate(securityParameters.serverRandom, 0, securityParameters.serverRandom.Length); + return signer; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDheKeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDheKeyExchange.cs.meta new file mode 100644 index 00000000..fbf33f58 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDheKeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fdd022dd94e7a09428adb6043fc75a79 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDsaSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDsaSigner.cs new file mode 100644 index 00000000..0f534da1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDsaSigner.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class TlsDsaSigner + : AbstractTlsSigner + { + public override byte[] GenerateRawSignature(SignatureAndHashAlgorithm algorithm, + AsymmetricKeyParameter privateKey, byte[] hash) + { + ISigner signer = MakeSigner(algorithm, true, true, + new ParametersWithRandom(privateKey, this.mContext.SecureRandom)); + if (algorithm == null) + { + // Note: Only use the SHA1 part of the (MD5/SHA1) hash + signer.BlockUpdate(hash, 16, 20); + } + else + { + signer.BlockUpdate(hash, 0, hash.Length); + } + return signer.GenerateSignature(); + } + + public override bool VerifyRawSignature(SignatureAndHashAlgorithm algorithm, byte[] sigBytes, + AsymmetricKeyParameter publicKey, byte[] hash) + { + ISigner signer = MakeSigner(algorithm, true, false, publicKey); + if (algorithm == null) + { + // Note: Only use the SHA1 part of the (MD5/SHA1) hash + signer.BlockUpdate(hash, 16, 20); + } + else + { + signer.BlockUpdate(hash, 0, hash.Length); + } + return signer.VerifySignature(sigBytes); + } + + public override ISigner CreateSigner(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter privateKey) + { + return MakeSigner(algorithm, false, true, privateKey); + } + + public override ISigner CreateVerifyer(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter publicKey) + { + return MakeSigner(algorithm, false, false, publicKey); + } + + protected virtual ICipherParameters MakeInitParameters(bool forSigning, ICipherParameters cp) + { + return cp; + } + + protected virtual ISigner MakeSigner(SignatureAndHashAlgorithm algorithm, bool raw, bool forSigning, + ICipherParameters cp) + { + if ((algorithm != null) != TlsUtilities.IsTlsV12(mContext)) + throw new InvalidOperationException(); + + if (algorithm != null && algorithm.Signature != SignatureAlgorithm) + throw new InvalidOperationException(); + + byte hashAlgorithm = algorithm == null ? HashAlgorithm.sha1 : algorithm.Hash; + IDigest d = raw ? new NullDigest() : TlsUtilities.CreateHash(hashAlgorithm); + + ISigner s = new DsaDigestSigner(CreateDsaImpl(hashAlgorithm), d); + s.Init(forSigning, MakeInitParameters(forSigning, cp)); + return s; + } + + protected abstract byte SignatureAlgorithm { get; } + + protected abstract IDsa CreateDsaImpl(byte hashAlgorithm); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDsaSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDsaSigner.cs.meta new file mode 100644 index 00000000..382207a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDsaSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 622a2d819dc4f73468f75ba7ab9ed160 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDssSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDssSigner.cs new file mode 100644 index 00000000..b703b2c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDssSigner.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsDssSigner + : TlsDsaSigner + { + public override bool IsValidPublicKey(AsymmetricKeyParameter publicKey) + { + return publicKey is DsaPublicKeyParameters; + } + + protected override IDsa CreateDsaImpl(byte hashAlgorithm) + { + return new DsaSigner(new HMacDsaKCalculator(TlsUtilities.CreateHash(hashAlgorithm))); + } + + protected override byte SignatureAlgorithm + { + get { return Tls.SignatureAlgorithm.dsa; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDssSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDssSigner.cs.meta new file mode 100644 index 00000000..7ae0f31c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsDssSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c91b91e67a1e0ab44a98aec094cb08ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDHKeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDHKeyExchange.cs new file mode 100644 index 00000000..c2e55be4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDHKeyExchange.cs @@ -0,0 +1,256 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// (D)TLS ECDH key exchange (see RFC 4492). + public class TlsECDHKeyExchange + : AbstractTlsKeyExchange + { + protected TlsSigner mTlsSigner; + protected int[] mNamedCurves; + protected byte[] mClientECPointFormats, mServerECPointFormats; + + protected AsymmetricKeyParameter mServerPublicKey; + protected TlsAgreementCredentials mAgreementCredentials; + + protected ECPrivateKeyParameters mECAgreePrivateKey; + protected ECPublicKeyParameters mECAgreePublicKey; + + public TlsECDHKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, int[] namedCurves, + byte[] clientECPointFormats, byte[] serverECPointFormats) + : base(keyExchange, supportedSignatureAlgorithms) + { + switch (keyExchange) + { + case KeyExchangeAlgorithm.ECDHE_RSA: + this.mTlsSigner = new TlsRsaSigner(); + break; + case KeyExchangeAlgorithm.ECDHE_ECDSA: + this.mTlsSigner = new TlsECDsaSigner(); + break; + case KeyExchangeAlgorithm.ECDH_anon: + case KeyExchangeAlgorithm.ECDH_RSA: + case KeyExchangeAlgorithm.ECDH_ECDSA: + this.mTlsSigner = null; + break; + default: + throw new InvalidOperationException("unsupported key exchange algorithm"); + } + + this.mNamedCurves = namedCurves; + this.mClientECPointFormats = clientECPointFormats; + this.mServerECPointFormats = serverECPointFormats; + } + + public override void Init(TlsContext context) + { + base.Init(context); + + if (this.mTlsSigner != null) + { + this.mTlsSigner.Init(context); + } + } + + public override void SkipServerCredentials() + { + if (mKeyExchange != KeyExchangeAlgorithm.ECDH_anon) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public override void ProcessServerCertificate(Certificate serverCertificate) + { + if (mKeyExchange == KeyExchangeAlgorithm.ECDH_anon) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + if (serverCertificate.IsEmpty) + throw new TlsFatalAlert(AlertDescription.bad_certificate); + + X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0); + + SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo; + try + { + this.mServerPublicKey = PublicKeyFactory.CreateKey(keyInfo); + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.unsupported_certificate, e); + } + + if (mTlsSigner == null) + { + try + { + this.mECAgreePublicKey = TlsEccUtilities.ValidateECPublicKey((ECPublicKeyParameters) this.mServerPublicKey); + } + catch (InvalidCastException e) + { + throw new TlsFatalAlert(AlertDescription.certificate_unknown, e); + } + + TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.KeyAgreement); + } + else + { + if (!mTlsSigner.IsValidPublicKey(this.mServerPublicKey)) + throw new TlsFatalAlert(AlertDescription.certificate_unknown); + + TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.DigitalSignature); + } + + base.ProcessServerCertificate(serverCertificate); + } + + public override bool RequiresServerKeyExchange + { + get + { + switch (mKeyExchange) + { + case KeyExchangeAlgorithm.ECDH_anon: + case KeyExchangeAlgorithm.ECDHE_ECDSA: + case KeyExchangeAlgorithm.ECDHE_RSA: + return true; + default: + return false; + } + } + } + + public override byte[] GenerateServerKeyExchange() + { + if (!RequiresServerKeyExchange) + return null; + + // ECDH_anon is handled here, ECDHE_* in a subclass + + MemoryStream buf = new MemoryStream(); + this.mECAgreePrivateKey = TlsEccUtilities.GenerateEphemeralServerKeyExchange(mContext.SecureRandom, mNamedCurves, + mClientECPointFormats, buf); + return buf.ToArray(); + } + + public override void ProcessServerKeyExchange(Stream input) + { + if (!RequiresServerKeyExchange) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + // ECDH_anon is handled here, ECDHE_* in a subclass + + ECDomainParameters curve_params = TlsEccUtilities.ReadECParameters(mNamedCurves, mClientECPointFormats, input); + + byte[] point = TlsUtilities.ReadOpaque8(input); + + this.mECAgreePublicKey = TlsEccUtilities.ValidateECPublicKey(TlsEccUtilities.DeserializeECPublicKey( + mClientECPointFormats, curve_params, point)); + } + + public override void ValidateCertificateRequest(CertificateRequest certificateRequest) + { + if (mKeyExchange == KeyExchangeAlgorithm.ECDH_anon) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + + /* + * RFC 4492 3. [...] The ECDSA_fixed_ECDH and RSA_fixed_ECDH mechanisms are usable with + * ECDH_ECDSA and ECDH_RSA. Their use with ECDHE_ECDSA and ECDHE_RSA is prohibited because + * the use of a long-term ECDH client key would jeopardize the forward secrecy property of + * these algorithms. + */ + byte[] types = certificateRequest.CertificateTypes; + for (int i = 0; i < types.Length; ++i) + { + switch (types[i]) + { + case ClientCertificateType.rsa_sign: + case ClientCertificateType.dss_sign: + case ClientCertificateType.ecdsa_sign: + case ClientCertificateType.rsa_fixed_ecdh: + case ClientCertificateType.ecdsa_fixed_ecdh: + break; + default: + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + } + + public override void ProcessClientCredentials(TlsCredentials clientCredentials) + { + if (mKeyExchange == KeyExchangeAlgorithm.ECDH_anon) + throw new TlsFatalAlert(AlertDescription.internal_error); + + if (clientCredentials is TlsAgreementCredentials) + { + // TODO Validate client cert has matching parameters (see 'TlsEccUtilities.AreOnSameCurve')? + + this.mAgreementCredentials = (TlsAgreementCredentials)clientCredentials; + } + else if (clientCredentials is TlsSignerCredentials) + { + // OK + } + else + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public override void GenerateClientKeyExchange(Stream output) + { + if (mAgreementCredentials == null) + { + this.mECAgreePrivateKey = TlsEccUtilities.GenerateEphemeralClientKeyExchange(mContext.SecureRandom, + mServerECPointFormats, mECAgreePublicKey.Parameters, output); + } + } + + public override void ProcessClientCertificate(Certificate clientCertificate) + { + if (mKeyExchange == KeyExchangeAlgorithm.ECDH_anon) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + // TODO Extract the public key + // TODO If the certificate is 'fixed', take the public key as mECAgreeClientPublicKey + } + + public override void ProcessClientKeyExchange(Stream input) + { + if (mECAgreePublicKey != null) + { + // For ecdsa_fixed_ecdh and rsa_fixed_ecdh, the key arrived in the client certificate + return; + } + + byte[] point = TlsUtilities.ReadOpaque8(input); + + ECDomainParameters curve_params = this.mECAgreePrivateKey.Parameters; + + this.mECAgreePublicKey = TlsEccUtilities.ValidateECPublicKey(TlsEccUtilities.DeserializeECPublicKey( + mServerECPointFormats, curve_params, point)); + } + + public override byte[] GeneratePremasterSecret() + { + if (mAgreementCredentials != null) + { + return mAgreementCredentials.GenerateAgreement(mECAgreePublicKey); + } + + if (mECAgreePrivateKey != null) + { + return TlsEccUtilities.CalculateECDHBasicAgreement(mECAgreePublicKey, mECAgreePrivateKey); + } + + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDHKeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDHKeyExchange.cs.meta new file mode 100644 index 00000000..e9eb8c30 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDHKeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d82e1a91d4c267149beadc33b13b1e13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDheKeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDheKeyExchange.cs new file mode 100644 index 00000000..5df1cec7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDheKeyExchange.cs @@ -0,0 +1,135 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// (D)TLS ECDHE key exchange (see RFC 4492). + public class TlsECDheKeyExchange + : TlsECDHKeyExchange + { + protected TlsSignerCredentials mServerCredentials = null; + + public TlsECDheKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, int[] namedCurves, + byte[] clientECPointFormats, byte[] serverECPointFormats) + : base(keyExchange, supportedSignatureAlgorithms, namedCurves, clientECPointFormats, serverECPointFormats) + { + } + + public override void ProcessServerCredentials(TlsCredentials serverCredentials) + { + if (!(serverCredentials is TlsSignerCredentials)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + ProcessServerCertificate(serverCredentials.Certificate); + + this.mServerCredentials = (TlsSignerCredentials)serverCredentials; + } + + public override byte[] GenerateServerKeyExchange() + { + DigestInputBuffer buf = new DigestInputBuffer(); + + this.mECAgreePrivateKey = TlsEccUtilities.GenerateEphemeralServerKeyExchange(mContext.SecureRandom, mNamedCurves, + mClientECPointFormats, buf); + + /* + * RFC 5246 4.7. digitally-signed element needs SignatureAndHashAlgorithm from TLS 1.2 + */ + SignatureAndHashAlgorithm signatureAndHashAlgorithm = TlsUtilities.GetSignatureAndHashAlgorithm( + mContext, mServerCredentials); + + IDigest d = TlsUtilities.CreateHash(signatureAndHashAlgorithm); + + SecurityParameters securityParameters = mContext.SecurityParameters; + d.BlockUpdate(securityParameters.clientRandom, 0, securityParameters.clientRandom.Length); + d.BlockUpdate(securityParameters.serverRandom, 0, securityParameters.serverRandom.Length); + buf.UpdateDigest(d); + + byte[] hash = DigestUtilities.DoFinal(d); + + byte[] signature = mServerCredentials.GenerateCertificateSignature(hash); + + DigitallySigned signed_params = new DigitallySigned(signatureAndHashAlgorithm, signature); + signed_params.Encode(buf); + + return buf.ToArray(); + } + + public override void ProcessServerKeyExchange(Stream input) + { + SecurityParameters securityParameters = mContext.SecurityParameters; + + SignerInputBuffer buf = new SignerInputBuffer(); + Stream teeIn = new TeeInputStream(input, buf); + + ECDomainParameters curve_params = TlsEccUtilities.ReadECParameters(mNamedCurves, mClientECPointFormats, teeIn); + + byte[] point = TlsUtilities.ReadOpaque8(teeIn); + + DigitallySigned signed_params = ParseSignature(input); + + ISigner signer = InitVerifyer(mTlsSigner, signed_params.Algorithm, securityParameters); + buf.UpdateSigner(signer); + if (!signer.VerifySignature(signed_params.Signature)) + throw new TlsFatalAlert(AlertDescription.decrypt_error); + + this.mECAgreePublicKey = TlsEccUtilities.ValidateECPublicKey(TlsEccUtilities.DeserializeECPublicKey( + mClientECPointFormats, curve_params, point)); + } + + public override void ValidateCertificateRequest(CertificateRequest certificateRequest) + { + /* + * RFC 4492 3. [...] The ECDSA_fixed_ECDH and RSA_fixed_ECDH mechanisms are usable with + * ECDH_ECDSA and ECDH_RSA. Their use with ECDHE_ECDSA and ECDHE_RSA is prohibited because + * the use of a long-term ECDH client key would jeopardize the forward secrecy property of + * these algorithms. + */ + byte[] types = certificateRequest.CertificateTypes; + for (int i = 0; i < types.Length; ++i) + { + switch (types[i]) + { + case ClientCertificateType.rsa_sign: + case ClientCertificateType.dss_sign: + case ClientCertificateType.ecdsa_sign: + break; + default: + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + } + + public override void ProcessClientCredentials(TlsCredentials clientCredentials) + { + if (clientCredentials is TlsSignerCredentials) + { + // OK + } + else + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + protected virtual ISigner InitVerifyer(TlsSigner tlsSigner, SignatureAndHashAlgorithm algorithm, + SecurityParameters securityParameters) + { + ISigner signer = tlsSigner.CreateVerifyer(algorithm, this.mServerPublicKey); + signer.BlockUpdate(securityParameters.clientRandom, 0, securityParameters.clientRandom.Length); + signer.BlockUpdate(securityParameters.serverRandom, 0, securityParameters.serverRandom.Length); + return signer; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDheKeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDheKeyExchange.cs.meta new file mode 100644 index 00000000..a8937305 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDheKeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 45ad60ff6d1404b4aa76988fb43dee8e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDsaSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDsaSigner.cs new file mode 100644 index 00000000..a61688cd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDsaSigner.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsECDsaSigner + : TlsDsaSigner + { + public override bool IsValidPublicKey(AsymmetricKeyParameter publicKey) + { + return publicKey is ECPublicKeyParameters; + } + + protected override IDsa CreateDsaImpl(byte hashAlgorithm) + { + return new ECDsaSigner(new HMacDsaKCalculator(TlsUtilities.CreateHash(hashAlgorithm))); + } + + protected override byte SignatureAlgorithm + { + get { return Tls.SignatureAlgorithm.ecdsa; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDsaSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDsaSigner.cs.meta new file mode 100644 index 00000000..af7a9cfb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsECDsaSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32521fa89cfa36546ae5d24cec11efb5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEccUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEccUtilities.cs new file mode 100644 index 00000000..d15424d0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEccUtilities.cs @@ -0,0 +1,709 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class TlsEccUtilities + { + private static readonly string[] CurveNames = new string[] { "sect163k1", "sect163r1", "sect163r2", "sect193r1", + "sect193r2", "sect233k1", "sect233r1", "sect239k1", "sect283k1", "sect283r1", "sect409k1", "sect409r1", + "sect571k1", "sect571r1", "secp160k1", "secp160r1", "secp160r2", "secp192k1", "secp192r1", "secp224k1", + "secp224r1", "secp256k1", "secp256r1", "secp384r1", "secp521r1", + "brainpoolP256r1", "brainpoolP384r1", "brainpoolP512r1"}; + + public static void AddSupportedEllipticCurvesExtension(IDictionary extensions, int[] namedCurves) + { + extensions[ExtensionType.elliptic_curves] = CreateSupportedEllipticCurvesExtension(namedCurves); + } + + public static void AddSupportedPointFormatsExtension(IDictionary extensions, byte[] ecPointFormats) + { + extensions[ExtensionType.ec_point_formats] = CreateSupportedPointFormatsExtension(ecPointFormats); + } + + public static int[] GetSupportedEllipticCurvesExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.elliptic_curves); + return extensionData == null ? null : ReadSupportedEllipticCurvesExtension(extensionData); + } + + public static byte[] GetSupportedPointFormatsExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.ec_point_formats); + return extensionData == null ? null : ReadSupportedPointFormatsExtension(extensionData); + } + + public static byte[] CreateSupportedEllipticCurvesExtension(int[] namedCurves) + { + if (namedCurves == null || namedCurves.Length < 1) + throw new TlsFatalAlert(AlertDescription.internal_error); + + return TlsUtilities.EncodeUint16ArrayWithUint16Length(namedCurves); + } + + public static byte[] CreateSupportedPointFormatsExtension(byte[] ecPointFormats) + { + if (ecPointFormats == null || !Arrays.Contains(ecPointFormats, ECPointFormat.uncompressed)) + { + /* + * RFC 4492 5.1. If the Supported Point Formats Extension is indeed sent, it MUST + * contain the value 0 (uncompressed) as one of the items in the list of point formats. + */ + + // NOTE: We add it at the end (lowest preference) + ecPointFormats = Arrays.Append(ecPointFormats, ECPointFormat.uncompressed); + } + + return TlsUtilities.EncodeUint8ArrayWithUint8Length(ecPointFormats); + } + + public static int[] ReadSupportedEllipticCurvesExtension(byte[] extensionData) + { + if (extensionData == null) + throw new ArgumentNullException("extensionData"); + + MemoryStream buf = new MemoryStream(extensionData, false); + + int length = TlsUtilities.ReadUint16(buf); + if (length < 2 || (length & 1) != 0) + throw new TlsFatalAlert(AlertDescription.decode_error); + + int[] namedCurves = TlsUtilities.ReadUint16Array(length / 2, buf); + + TlsProtocol.AssertEmpty(buf); + + return namedCurves; + } + + public static byte[] ReadSupportedPointFormatsExtension(byte[] extensionData) + { + byte[] ecPointFormats = TlsUtilities.DecodeUint8ArrayWithUint8Length(extensionData); + if (!Arrays.Contains(ecPointFormats, ECPointFormat.uncompressed)) + { + /* + * RFC 4492 5.1. If the Supported Point Formats Extension is indeed sent, it MUST + * contain the value 0 (uncompressed) as one of the items in the list of point formats. + */ + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + return ecPointFormats; + } + + public static string GetNameOfNamedCurve(int namedCurve) + { + return IsSupportedNamedCurve(namedCurve) ? CurveNames[namedCurve - 1] : null; + } + + public static ECDomainParameters GetParametersForNamedCurve(int namedCurve) + { + string curveName = GetNameOfNamedCurve(namedCurve); + if (curveName == null) + return null; + + // Parameters are lazily created the first time a particular curve is accessed + + X9ECParameters ecP = CustomNamedCurves.GetByName(curveName); + if (ecP == null) + { + ecP = ECNamedCurveTable.GetByName(curveName); + if (ecP == null) + return null; + } + + // It's a bit inefficient to do this conversion every time + return new ECDomainParameters(ecP.Curve, ecP.G, ecP.N, ecP.H, ecP.GetSeed()); + } + + public static bool HasAnySupportedNamedCurves() + { + return CurveNames.Length > 0; + } + + public static bool ContainsEccCipherSuites(int[] cipherSuites) + { + for (int i = 0; i < cipherSuites.Length; ++i) + { + if (IsEccCipherSuite(cipherSuites[i])) + return true; + } + return false; + } + + public static bool IsEccCipherSuite(int cipherSuite) + { + switch (cipherSuite) + { + /* + * RFC 4492 + */ + case CipherSuite.TLS_ECDH_ECDSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_AES_256_CBC_SHA: + + /* + * RFC 5289 + */ + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384: + + /* + * RFC 5489 + */ + case CipherSuite.TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_RC4_128_SHA: + + /* + * RFC 6367 + */ + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384: + + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + + case CipherSuite.TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + + /* + * RFC 7251 + */ + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8: + + /* + * draft-ietf-tls-chacha20-poly1305-04 + */ + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + + /* + * draft-zauner-tls-aes-ocb-04 + */ + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_256_OCB: + + return true; + + default: + return false; + } + } + + public static bool AreOnSameCurve(ECDomainParameters a, ECDomainParameters b) + { + return a != null && a.Equals(b); + } + + public static bool IsSupportedNamedCurve(int namedCurve) + { + return (namedCurve > 0 && namedCurve <= CurveNames.Length); + } + + public static bool IsCompressionPreferred(byte[] ecPointFormats, byte compressionFormat) + { + if (ecPointFormats == null) + return false; + + for (int i = 0; i < ecPointFormats.Length; ++i) + { + byte ecPointFormat = ecPointFormats[i]; + if (ecPointFormat == ECPointFormat.uncompressed) + return false; + if (ecPointFormat == compressionFormat) + return true; + } + return false; + } + + public static byte[] SerializeECFieldElement(int fieldSize, BigInteger x) + { + return BigIntegers.AsUnsignedByteArray((fieldSize + 7) / 8, x); + } + + public static byte[] SerializeECPoint(byte[] ecPointFormats, ECPoint point) + { + ECCurve curve = point.Curve; + + /* + * RFC 4492 5.7. ...an elliptic curve point in uncompressed or compressed format. Here, the + * format MUST conform to what the server has requested through a Supported Point Formats + * Extension if this extension was used, and MUST be uncompressed if this extension was not + * used. + */ + bool compressed = false; + if (ECAlgorithms.IsFpCurve(curve)) + { + compressed = IsCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_prime); + } + else if (ECAlgorithms.IsF2mCurve(curve)) + { + compressed = IsCompressionPreferred(ecPointFormats, ECPointFormat.ansiX962_compressed_char2); + } + return point.GetEncoded(compressed); + } + + public static byte[] SerializeECPublicKey(byte[] ecPointFormats, ECPublicKeyParameters keyParameters) + { + return SerializeECPoint(ecPointFormats, keyParameters.Q); + } + + public static BigInteger DeserializeECFieldElement(int fieldSize, byte[] encoding) + { + int requiredLength = (fieldSize + 7) / 8; + if (encoding.Length != requiredLength) + throw new TlsFatalAlert(AlertDescription.decode_error); + return new BigInteger(1, encoding); + } + + public static ECPoint DeserializeECPoint(byte[] ecPointFormats, ECCurve curve, byte[] encoding) + { + if (encoding == null || encoding.Length < 1) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + byte actualFormat; + switch (encoding[0]) + { + case 0x02: // compressed + case 0x03: // compressed + { + if (ECAlgorithms.IsF2mCurve(curve)) + { + actualFormat = ECPointFormat.ansiX962_compressed_char2; + } + else if (ECAlgorithms.IsFpCurve(curve)) + { + actualFormat = ECPointFormat.ansiX962_compressed_prime; + } + else + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + break; + } + case 0x04: // uncompressed + { + actualFormat = ECPointFormat.uncompressed; + break; + } + case 0x00: // infinity + case 0x06: // hybrid + case 0x07: // hybrid + default: + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + if (actualFormat != ECPointFormat.uncompressed + && (ecPointFormats == null || !Arrays.Contains(ecPointFormats, actualFormat))) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + return curve.DecodePoint(encoding); + } + + public static ECPublicKeyParameters DeserializeECPublicKey(byte[] ecPointFormats, ECDomainParameters curve_params, + byte[] encoding) + { + try + { + ECPoint Y = DeserializeECPoint(ecPointFormats, curve_params.Curve, encoding); + return new ECPublicKeyParameters(Y, curve_params); + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter, e); + } + } + + public static byte[] CalculateECDHBasicAgreement(ECPublicKeyParameters publicKey, ECPrivateKeyParameters privateKey) + { + ECDHBasicAgreement basicAgreement = new ECDHBasicAgreement(); + basicAgreement.Init(privateKey); + BigInteger agreementValue = basicAgreement.CalculateAgreement(publicKey); + + /* + * RFC 4492 5.10. Note that this octet string (Z in IEEE 1363 terminology) as output by + * FE2OSP, the Field Element to Octet String Conversion Primitive, has constant length for + * any given field; leading zeros found in this octet string MUST NOT be truncated. + */ + return BigIntegers.AsUnsignedByteArray(basicAgreement.GetFieldSize(), agreementValue); + } + + public static AsymmetricCipherKeyPair GenerateECKeyPair(SecureRandom random, ECDomainParameters ecParams) + { + ECKeyPairGenerator keyPairGenerator = new ECKeyPairGenerator(); + keyPairGenerator.Init(new ECKeyGenerationParameters(ecParams, random)); + return keyPairGenerator.GenerateKeyPair(); + } + + public static ECPrivateKeyParameters GenerateEphemeralClientKeyExchange(SecureRandom random, byte[] ecPointFormats, + ECDomainParameters ecParams, Stream output) + { + AsymmetricCipherKeyPair kp = GenerateECKeyPair(random, ecParams); + + ECPublicKeyParameters ecPublicKey = (ECPublicKeyParameters)kp.Public; + WriteECPoint(ecPointFormats, ecPublicKey.Q, output); + + return (ECPrivateKeyParameters)kp.Private; + } + + // TODO Refactor around ServerECDHParams before making this public + internal static ECPrivateKeyParameters GenerateEphemeralServerKeyExchange(SecureRandom random, int[] namedCurves, + byte[] ecPointFormats, Stream output) + { + /* First we try to find a supported named curve from the client's list. */ + int namedCurve = -1; + if (namedCurves == null) + { + // TODO Let the peer choose the default named curve + namedCurve = NamedCurve.secp256r1; + } + else + { + for (int i = 0; i < namedCurves.Length; ++i) + { + int entry = namedCurves[i]; + if (NamedCurve.IsValid(entry) && IsSupportedNamedCurve(entry)) + { + namedCurve = entry; + break; + } + } + } + + ECDomainParameters ecParams = null; + if (namedCurve >= 0) + { + ecParams = GetParametersForNamedCurve(namedCurve); + } + else + { + /* If no named curves are suitable, check if the client supports explicit curves. */ + if (Arrays.Contains(namedCurves, NamedCurve.arbitrary_explicit_prime_curves)) + { + ecParams = GetParametersForNamedCurve(NamedCurve.secp256r1); + } + else if (Arrays.Contains(namedCurves, NamedCurve.arbitrary_explicit_char2_curves)) + { + ecParams = GetParametersForNamedCurve(NamedCurve.sect283r1); + } + } + + if (ecParams == null) + { + /* + * NOTE: We shouldn't have negotiated ECDHE key exchange since we apparently can't find + * a suitable curve. + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + if (namedCurve < 0) + { + WriteExplicitECParameters(ecPointFormats, ecParams, output); + } + else + { + WriteNamedECParameters(namedCurve, output); + } + + return GenerateEphemeralClientKeyExchange(random, ecPointFormats, ecParams, output); + } + + public static ECPublicKeyParameters ValidateECPublicKey(ECPublicKeyParameters key) + { + // TODO Check RFC 4492 for validation + return key; + } + + public static int ReadECExponent(int fieldSize, Stream input) + { + BigInteger K = ReadECParameter(input); + if (K.BitLength < 32) + { + int k = K.IntValue; + if (k > 0 && k < fieldSize) + { + return k; + } + } + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + public static BigInteger ReadECFieldElement(int fieldSize, Stream input) + { + return DeserializeECFieldElement(fieldSize, TlsUtilities.ReadOpaque8(input)); + } + + public static BigInteger ReadECParameter(Stream input) + { + // TODO Are leading zeroes okay here? + return new BigInteger(1, TlsUtilities.ReadOpaque8(input)); + } + + public static ECDomainParameters ReadECParameters(int[] namedCurves, byte[] ecPointFormats, Stream input) + { + try + { + byte curveType = TlsUtilities.ReadUint8(input); + + switch (curveType) + { + case ECCurveType.explicit_prime: + { + CheckNamedCurve(namedCurves, NamedCurve.arbitrary_explicit_prime_curves); + + BigInteger prime_p = ReadECParameter(input); + BigInteger a = ReadECFieldElement(prime_p.BitLength, input); + BigInteger b = ReadECFieldElement(prime_p.BitLength, input); + byte[] baseEncoding = TlsUtilities.ReadOpaque8(input); + BigInteger order = ReadECParameter(input); + BigInteger cofactor = ReadECParameter(input); + ECCurve curve = new FpCurve(prime_p, a, b, order, cofactor); + ECPoint basePoint = DeserializeECPoint(ecPointFormats, curve, baseEncoding); + return new ECDomainParameters(curve, basePoint, order, cofactor); + } + case ECCurveType.explicit_char2: + { + CheckNamedCurve(namedCurves, NamedCurve.arbitrary_explicit_char2_curves); + + int m = TlsUtilities.ReadUint16(input); + byte basis = TlsUtilities.ReadUint8(input); + if (!ECBasisType.IsValid(basis)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + int k1 = ReadECExponent(m, input), k2 = -1, k3 = -1; + if (basis == ECBasisType.ec_basis_pentanomial) + { + k2 = ReadECExponent(m, input); + k3 = ReadECExponent(m, input); + } + + BigInteger a = ReadECFieldElement(m, input); + BigInteger b = ReadECFieldElement(m, input); + byte[] baseEncoding = TlsUtilities.ReadOpaque8(input); + BigInteger order = ReadECParameter(input); + BigInteger cofactor = ReadECParameter(input); + + ECCurve curve = (basis == ECBasisType.ec_basis_pentanomial) + ? new F2mCurve(m, k1, k2, k3, a, b, order, cofactor) + : new F2mCurve(m, k1, a, b, order, cofactor); + + ECPoint basePoint = DeserializeECPoint(ecPointFormats, curve, baseEncoding); + + return new ECDomainParameters(curve, basePoint, order, cofactor); + } + case ECCurveType.named_curve: + { + int namedCurve = TlsUtilities.ReadUint16(input); + if (!NamedCurve.RefersToASpecificNamedCurve(namedCurve)) + { + /* + * RFC 4492 5.4. All those values of NamedCurve are allowed that refer to a + * specific curve. Values of NamedCurve that indicate support for a class of + * explicitly defined curves are not allowed here [...]. + */ + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + CheckNamedCurve(namedCurves, namedCurve); + + return GetParametersForNamedCurve(namedCurve); + } + default: + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter, e); + } + } + + private static void CheckNamedCurve(int[] namedCurves, int namedCurve) + { + if (namedCurves != null && !Arrays.Contains(namedCurves, namedCurve)) + { + /* + * RFC 4492 4. [...] servers MUST NOT negotiate the use of an ECC cipher suite + * unless they can complete the handshake while respecting the choice of curves + * and compression techniques specified by the client. + */ + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + + public static void WriteECExponent(int k, Stream output) + { + BigInteger K = BigInteger.ValueOf(k); + WriteECParameter(K, output); + } + + public static void WriteECFieldElement(ECFieldElement x, Stream output) + { + TlsUtilities.WriteOpaque8(x.GetEncoded(), output); + } + + public static void WriteECFieldElement(int fieldSize, BigInteger x, Stream output) + { + TlsUtilities.WriteOpaque8(SerializeECFieldElement(fieldSize, x), output); + } + + public static void WriteECParameter(BigInteger x, Stream output) + { + TlsUtilities.WriteOpaque8(BigIntegers.AsUnsignedByteArray(x), output); + } + + public static void WriteExplicitECParameters(byte[] ecPointFormats, ECDomainParameters ecParameters, + Stream output) + { + ECCurve curve = ecParameters.Curve; + + if (ECAlgorithms.IsFpCurve(curve)) + { + TlsUtilities.WriteUint8(ECCurveType.explicit_prime, output); + + WriteECParameter(curve.Field.Characteristic, output); + } + else if (ECAlgorithms.IsF2mCurve(curve)) + { + IPolynomialExtensionField field = (IPolynomialExtensionField)curve.Field; + int[] exponents = field.MinimalPolynomial.GetExponentsPresent(); + + TlsUtilities.WriteUint8(ECCurveType.explicit_char2, output); + + int m = exponents[exponents.Length - 1]; + TlsUtilities.CheckUint16(m); + TlsUtilities.WriteUint16(m, output); + + if (exponents.Length == 3) + { + TlsUtilities.WriteUint8(ECBasisType.ec_basis_trinomial, output); + WriteECExponent(exponents[1], output); + } + else if (exponents.Length == 5) + { + TlsUtilities.WriteUint8(ECBasisType.ec_basis_pentanomial, output); + WriteECExponent(exponents[1], output); + WriteECExponent(exponents[2], output); + WriteECExponent(exponents[3], output); + } + else + { + throw new ArgumentException("Only trinomial and pentomial curves are supported"); + } + } + else + { + throw new ArgumentException("'ecParameters' not a known curve type"); + } + + WriteECFieldElement(curve.A, output); + WriteECFieldElement(curve.B, output); + TlsUtilities.WriteOpaque8(SerializeECPoint(ecPointFormats, ecParameters.G), output); + WriteECParameter(ecParameters.N, output); + WriteECParameter(ecParameters.H, output); + } + + public static void WriteECPoint(byte[] ecPointFormats, ECPoint point, Stream output) + { + TlsUtilities.WriteOpaque8(SerializeECPoint(ecPointFormats, point), output); + } + + public static void WriteNamedECParameters(int namedCurve, Stream output) + { + if (!NamedCurve.RefersToASpecificNamedCurve(namedCurve)) + { + /* + * RFC 4492 5.4. All those values of NamedCurve are allowed that refer to a specific + * curve. Values of NamedCurve that indicate support for a class of explicitly defined + * curves are not allowed here [...]. + */ + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + TlsUtilities.WriteUint8(ECCurveType.named_curve, output); + TlsUtilities.CheckUint16(namedCurve); + TlsUtilities.WriteUint16(namedCurve, output); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEccUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEccUtilities.cs.meta new file mode 100644 index 00000000..13e57172 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEccUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 552941c9df6a1f841a85c7ff8312731b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEncryptionCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEncryptionCredentials.cs new file mode 100644 index 00000000..c2e9bcdd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEncryptionCredentials.cs @@ -0,0 +1,16 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsEncryptionCredentials + : TlsCredentials + { + /// + byte[] DecryptPreMasterSecret(byte[] encryptedPreMasterSecret); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEncryptionCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEncryptionCredentials.cs.meta new file mode 100644 index 00000000..d8881200 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsEncryptionCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: df922784ce60a3e42b03ed7c6f114886 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsException.cs new file mode 100644 index 00000000..46d991bb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsException + : IOException + { + public TlsException(string message, Exception cause) + : base(message, cause) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsException.cs.meta new file mode 100644 index 00000000..b93c181a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba0443a372583a742991a22b02aea413 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsExtensionsUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsExtensionsUtilities.cs new file mode 100644 index 00000000..d152645e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsExtensionsUtilities.cs @@ -0,0 +1,372 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class TlsExtensionsUtilities + { + public static IDictionary EnsureExtensionsInitialised(IDictionary extensions) + { + return extensions == null ? BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable() : extensions; + } + + /// + public static void AddClientCertificateTypeExtensionClient(IDictionary extensions, byte[] certificateTypes) + { + extensions[ExtensionType.client_certificate_type] = CreateCertificateTypeExtensionClient(certificateTypes); + } + + /// + public static void AddClientCertificateTypeExtensionServer(IDictionary extensions, byte certificateType) + { + extensions[ExtensionType.client_certificate_type] = CreateCertificateTypeExtensionServer(certificateType); + } + + public static void AddEncryptThenMacExtension(IDictionary extensions) + { + extensions[ExtensionType.encrypt_then_mac] = CreateEncryptThenMacExtension(); + } + + public static void AddExtendedMasterSecretExtension(IDictionary extensions) + { + extensions[ExtensionType.extended_master_secret] = CreateExtendedMasterSecretExtension(); + } + + /// + public static void AddHeartbeatExtension(IDictionary extensions, HeartbeatExtension heartbeatExtension) + { + extensions[ExtensionType.heartbeat] = CreateHeartbeatExtension(heartbeatExtension); + } + + /// + public static void AddMaxFragmentLengthExtension(IDictionary extensions, byte maxFragmentLength) + { + extensions[ExtensionType.max_fragment_length] = CreateMaxFragmentLengthExtension(maxFragmentLength); + } + + /// + public static void AddPaddingExtension(IDictionary extensions, int dataLength) + { + extensions[ExtensionType.padding] = CreatePaddingExtension(dataLength); + } + + /// + public static void AddServerCertificateTypeExtensionClient(IDictionary extensions, byte[] certificateTypes) + { + extensions[ExtensionType.server_certificate_type] = CreateCertificateTypeExtensionClient(certificateTypes); + } + + /// + public static void AddServerCertificateTypeExtensionServer(IDictionary extensions, byte certificateType) + { + extensions[ExtensionType.server_certificate_type] = CreateCertificateTypeExtensionServer(certificateType); + } + + /// + public static void AddServerNameExtension(IDictionary extensions, ServerNameList serverNameList) + { + extensions[ExtensionType.server_name] = CreateServerNameExtension(serverNameList); + } + + /// + public static void AddStatusRequestExtension(IDictionary extensions, CertificateStatusRequest statusRequest) + { + extensions[ExtensionType.status_request] = CreateStatusRequestExtension(statusRequest); + } + + public static void AddTruncatedHMacExtension(IDictionary extensions) + { + extensions[ExtensionType.truncated_hmac] = CreateTruncatedHMacExtension(); + } + + /// + public static byte[] GetClientCertificateTypeExtensionClient(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.client_certificate_type); + return extensionData == null ? null : ReadCertificateTypeExtensionClient(extensionData); + } + + /// + public static short GetClientCertificateTypeExtensionServer(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.client_certificate_type); + return extensionData == null ? (short)-1 : (short)ReadCertificateTypeExtensionServer(extensionData); + } + + /// + public static HeartbeatExtension GetHeartbeatExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.heartbeat); + return extensionData == null ? null : ReadHeartbeatExtension(extensionData); + } + + /// + public static short GetMaxFragmentLengthExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.max_fragment_length); + return extensionData == null ? (short)-1 : (short)ReadMaxFragmentLengthExtension(extensionData); + } + + /// + public static int GetPaddingExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.padding); + return extensionData == null ? -1 : ReadPaddingExtension(extensionData); + } + + /// + public static byte[] GetServerCertificateTypeExtensionClient(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.server_certificate_type); + return extensionData == null ? null : ReadCertificateTypeExtensionClient(extensionData); + } + + /// + public static short GetServerCertificateTypeExtensionServer(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.server_certificate_type); + return extensionData == null ? (short)-1 : (short)ReadCertificateTypeExtensionServer(extensionData); + } + + /// + public static ServerNameList GetServerNameExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.server_name); + return extensionData == null ? null : ReadServerNameExtension(extensionData); + } + + /// + public static CertificateStatusRequest GetStatusRequestExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.status_request); + return extensionData == null ? null : ReadStatusRequestExtension(extensionData); + } + + /// + public static bool HasEncryptThenMacExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.encrypt_then_mac); + return extensionData == null ? false : ReadEncryptThenMacExtension(extensionData); + } + + /// + public static bool HasExtendedMasterSecretExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.extended_master_secret); + return extensionData == null ? false : ReadExtendedMasterSecretExtension(extensionData); + } + + /// + public static bool HasTruncatedHMacExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.truncated_hmac); + return extensionData == null ? false : ReadTruncatedHMacExtension(extensionData); + } + + /// + public static byte[] CreateCertificateTypeExtensionClient(byte[] certificateTypes) + { + if (certificateTypes == null || certificateTypes.Length < 1 || certificateTypes.Length > 255) + throw new TlsFatalAlert(AlertDescription.internal_error); + + return TlsUtilities.EncodeUint8ArrayWithUint8Length(certificateTypes); + } + + /// + public static byte[] CreateCertificateTypeExtensionServer(byte certificateType) + { + return TlsUtilities.EncodeUint8(certificateType); + } + + public static byte[] CreateEmptyExtensionData() + { + return TlsUtilities.EmptyBytes; + } + + public static byte[] CreateEncryptThenMacExtension() + { + return CreateEmptyExtensionData(); + } + + public static byte[] CreateExtendedMasterSecretExtension() + { + return CreateEmptyExtensionData(); + } + + /// + public static byte[] CreateHeartbeatExtension(HeartbeatExtension heartbeatExtension) + { + if (heartbeatExtension == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + MemoryStream buf = new MemoryStream(); + + heartbeatExtension.Encode(buf); + + return buf.ToArray(); + } + + /// + public static byte[] CreateMaxFragmentLengthExtension(byte maxFragmentLength) + { + return TlsUtilities.EncodeUint8(maxFragmentLength); + } + + /// + public static byte[] CreatePaddingExtension(int dataLength) + { + TlsUtilities.CheckUint16(dataLength); + return new byte[dataLength]; + } + + /// + public static byte[] CreateServerNameExtension(ServerNameList serverNameList) + { + if (serverNameList == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + MemoryStream buf = new MemoryStream(); + + serverNameList.Encode(buf); + + return buf.ToArray(); + } + + /// + public static byte[] CreateStatusRequestExtension(CertificateStatusRequest statusRequest) + { + if (statusRequest == null) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + MemoryStream buf = new MemoryStream(); + + statusRequest.Encode(buf); + + return buf.ToArray(); + } + + public static byte[] CreateTruncatedHMacExtension() + { + return CreateEmptyExtensionData(); + } + + /// + private static bool ReadEmptyExtensionData(byte[] extensionData) + { + if (extensionData == null) + throw new ArgumentNullException("extensionData"); + + if (extensionData.Length != 0) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + return true; + } + + /// + public static byte[] ReadCertificateTypeExtensionClient(byte[] extensionData) + { + byte[] certificateTypes = TlsUtilities.DecodeUint8ArrayWithUint8Length(extensionData); + if (certificateTypes.Length < 1) + throw new TlsFatalAlert(AlertDescription.decode_error); + return certificateTypes; + } + + /// + public static byte ReadCertificateTypeExtensionServer(byte[] extensionData) + { + return TlsUtilities.DecodeUint8(extensionData); + } + + /// + public static bool ReadEncryptThenMacExtension(byte[] extensionData) + { + return ReadEmptyExtensionData(extensionData); + } + + /// + public static bool ReadExtendedMasterSecretExtension(byte[] extensionData) + { + return ReadEmptyExtensionData(extensionData); + } + + /// + public static HeartbeatExtension ReadHeartbeatExtension(byte[] extensionData) + { + if (extensionData == null) + throw new ArgumentNullException("extensionData"); + + MemoryStream buf = new MemoryStream(extensionData, false); + + HeartbeatExtension heartbeatExtension = HeartbeatExtension.Parse(buf); + + TlsProtocol.AssertEmpty(buf); + + return heartbeatExtension; + } + + /// + public static byte ReadMaxFragmentLengthExtension(byte[] extensionData) + { + return TlsUtilities.DecodeUint8(extensionData); + } + + /// + public static int ReadPaddingExtension(byte[] extensionData) + { + if (extensionData == null) + throw new ArgumentNullException("extensionData"); + + for (int i = 0; i < extensionData.Length; ++i) + { + if (extensionData[i] != 0) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + return extensionData.Length; + } + + /// + public static ServerNameList ReadServerNameExtension(byte[] extensionData) + { + if (extensionData == null) + throw new ArgumentNullException("extensionData"); + + MemoryStream buf = new MemoryStream(extensionData, false); + + ServerNameList serverNameList = ServerNameList.Parse(buf); + + TlsProtocol.AssertEmpty(buf); + + return serverNameList; + } + + /// + public static CertificateStatusRequest ReadStatusRequestExtension(byte[] extensionData) + { + if (extensionData == null) + throw new ArgumentNullException("extensionData"); + + MemoryStream buf = new MemoryStream(extensionData, false); + + CertificateStatusRequest statusRequest = CertificateStatusRequest.Parse(buf); + + TlsProtocol.AssertEmpty(buf); + + return statusRequest; + } + + /// + public static bool ReadTruncatedHMacExtension(byte[] extensionData) + { + return ReadEmptyExtensionData(extensionData); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsExtensionsUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsExtensionsUtilities.cs.meta new file mode 100644 index 00000000..d9deb3e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsExtensionsUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: acef69aa55d244f45ad92252311061c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlert.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlert.cs new file mode 100644 index 00000000..03457fd5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlert.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsFatalAlert + : TlsException + { + private readonly byte alertDescription; + + public TlsFatalAlert(byte alertDescription) + : this(alertDescription, null) + { + } + + public TlsFatalAlert(byte alertDescription, Exception alertCause) + : base(Tls.AlertDescription.GetText(alertDescription), alertCause) + { + this.alertDescription = alertDescription; + } + + public virtual byte AlertDescription + { + get { return alertDescription; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlert.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlert.cs.meta new file mode 100644 index 00000000..0d986d18 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlert.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ffee8525007c0ac4ab970389710de6ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlertReceived.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlertReceived.cs new file mode 100644 index 00000000..b2005f6c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlertReceived.cs @@ -0,0 +1,25 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsFatalAlertReceived + : TlsException + { + private readonly byte alertDescription; + + public TlsFatalAlertReceived(byte alertDescription) + : base(Tls.AlertDescription.GetText(alertDescription), null) + { + this.alertDescription = alertDescription; + } + + public virtual byte AlertDescription + { + get { return alertDescription; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlertReceived.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlertReceived.cs.meta new file mode 100644 index 00000000..a0c75bac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsFatalAlertReceived.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91ecbbca40285cf4a98a3f899d1b0eb3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsHandshakeHash.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsHandshakeHash.cs new file mode 100644 index 00000000..4a229565 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsHandshakeHash.cs @@ -0,0 +1,26 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsHandshakeHash + : IDigest + { + void Init(TlsContext context); + + TlsHandshakeHash NotifyPrfDetermined(); + + void TrackHashAlgorithm(byte hashAlgorithm); + + void SealHashAlgorithms(); + + TlsHandshakeHash StopTracking(); + + IDigest ForkPrfHash(); + + byte[] GetFinalHash(byte hashAlgorithm); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsHandshakeHash.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsHandshakeHash.cs.meta new file mode 100644 index 00000000..1be754ee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsHandshakeHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4efa34121572a1d46ac3849616f0d395 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsKeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsKeyExchange.cs new file mode 100644 index 00000000..f98276c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsKeyExchange.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// A generic interface for key exchange implementations in (D)TLS. + /// + public interface TlsKeyExchange + { + void Init(TlsContext context); + + /// + void SkipServerCredentials(); + + /// + void ProcessServerCredentials(TlsCredentials serverCredentials); + + /// + void ProcessServerCertificate(Certificate serverCertificate); + + bool RequiresServerKeyExchange { get; } + + /// + byte[] GenerateServerKeyExchange(); + + /// + void SkipServerKeyExchange(); + + /// + void ProcessServerKeyExchange(Stream input); + + /// + void ValidateCertificateRequest(CertificateRequest certificateRequest); + + /// + void SkipClientCredentials(); + + /// + void ProcessClientCredentials(TlsCredentials clientCredentials); + + /// + void ProcessClientCertificate(Certificate clientCertificate); + + /// + void GenerateClientKeyExchange(Stream output); + + /// + void ProcessClientKeyExchange(Stream input); + + /// + byte[] GeneratePremasterSecret(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsKeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsKeyExchange.cs.meta new file mode 100644 index 00000000..702a72e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsKeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03f31ef4465223f439a14aa8fcc60bec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsMac.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsMac.cs new file mode 100644 index 00000000..d0264913 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsMac.cs @@ -0,0 +1,177 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// A generic TLS MAC implementation, acting as an HMAC based on some underlying Digest. + /// + public class TlsMac + { + protected readonly TlsContext context; + protected readonly byte[] secret; + protected readonly IMac mac; + protected readonly int digestBlockSize; + protected readonly int digestOverhead; + protected readonly int macLength; + + /** + * Generate a new instance of an TlsMac. + * + * @param context the TLS client context + * @param digest The digest to use. + * @param key A byte-array where the key for this MAC is located. + * @param keyOff The number of bytes to skip, before the key starts in the buffer. + * @param keyLen The length of the key. + */ + public TlsMac(TlsContext context, IDigest digest, byte[] key, int keyOff, int keyLen) + { + this.context = context; + + KeyParameter keyParameter = new KeyParameter(key, keyOff, keyLen); + + this.secret = Arrays.Clone(keyParameter.GetKey()); + + // TODO This should check the actual algorithm, not rely on the engine type + if (digest is LongDigest) + { + this.digestBlockSize = 128; + this.digestOverhead = 16; + } + else + { + this.digestBlockSize = 64; + this.digestOverhead = 8; + } + + if (TlsUtilities.IsSsl(context)) + { + this.mac = new Ssl3Mac(digest); + + // TODO This should check the actual algorithm, not assume based on the digest size + if (digest.GetDigestSize() == 20) + { + /* + * NOTE: When SHA-1 is used with the SSL 3.0 MAC, the secret + input pad is not + * digest block-aligned. + */ + this.digestOverhead = 4; + } + } + else + { + this.mac = new HMac(digest); + + // NOTE: The input pad for HMAC is always a full digest block + } + + this.mac.Init(keyParameter); + + this.macLength = mac.GetMacSize(); + if (context.SecurityParameters.truncatedHMac) + { + this.macLength = System.Math.Min(this.macLength, 10); + } + } + + /** + * @return the MAC write secret + */ + public virtual byte[] MacSecret + { + get { return this.secret; } + } + + /** + * @return The output length of this MAC. + */ + public virtual int Size + { + get { return macLength; } + } + + /** + * Calculate the MAC for some given data. + * + * @param type The message type of the message. + * @param message A byte-buffer containing the message. + * @param offset The number of bytes to skip, before the message starts. + * @param length The length of the message. + * @return A new byte-buffer containing the MAC value. + */ + public virtual byte[] CalculateMac(long seqNo, byte type, byte[] message, int offset, int length) + { + ProtocolVersion serverVersion = context.ServerVersion; + bool isSsl = serverVersion.IsSsl; + + byte[] macHeader = new byte[isSsl ? 11 : 13]; + TlsUtilities.WriteUint64(seqNo, macHeader, 0); + TlsUtilities.WriteUint8(type, macHeader, 8); + if (!isSsl) + { + TlsUtilities.WriteVersion(serverVersion, macHeader, 9); + } + TlsUtilities.WriteUint16(length, macHeader, macHeader.Length - 2); + + mac.BlockUpdate(macHeader, 0, macHeader.Length); + mac.BlockUpdate(message, offset, length); + + return Truncate(MacUtilities.DoFinal(mac)); + } + + public virtual byte[] CalculateMacConstantTime(long seqNo, byte type, byte[] message, int offset, int length, + int fullLength, byte[] dummyData) + { + /* + * Actual MAC only calculated on 'length' bytes... + */ + byte[] result = CalculateMac(seqNo, type, message, offset, length); + + /* + * ...but ensure a constant number of complete digest blocks are processed (as many as would + * be needed for 'fullLength' bytes of input). + */ + int headerLength = TlsUtilities.IsSsl(context) ? 11 : 13; + + // How many extra full blocks do we need to calculate? + int extra = GetDigestBlockCount(headerLength + fullLength) - GetDigestBlockCount(headerLength + length); + + while (--extra >= 0) + { + mac.BlockUpdate(dummyData, 0, digestBlockSize); + } + + // One more byte in case the implementation is "lazy" about processing blocks + mac.Update(dummyData[0]); + mac.Reset(); + + return result; + } + + protected virtual int GetDigestBlockCount(int inputLength) + { + // NOTE: This calculation assumes a minimum of 1 pad byte + return (inputLength + digestOverhead) / digestBlockSize; + } + + protected virtual byte[] Truncate(byte[] bs) + { + if (bs.Length <= macLength) + { + return bs; + } + + return Arrays.CopyOf(bs, macLength); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsMac.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsMac.cs.meta new file mode 100644 index 00000000..2a0eb47f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsMac.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f8292646fa7b0c7439a1c3a0914d6fde +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNoCloseNotifyException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNoCloseNotifyException.cs new file mode 100644 index 00000000..b5fdd269 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNoCloseNotifyException.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// This exception will be thrown(only) when the connection is closed by the peer without sending a + /// close_notify warning alert. + /// + /// + /// If this happens, the TLS protocol cannot rule out truncation of the connection data (potentially + /// malicious). It may be possible to check for truncation via some property of a higher level protocol + /// built upon TLS, e.g.the Content-Length header for HTTPS. + /// + public class TlsNoCloseNotifyException + : EndOfStreamException + { + public TlsNoCloseNotifyException() + : base("No close_notify alert received before connection closed") + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNoCloseNotifyException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNoCloseNotifyException.cs.meta new file mode 100644 index 00000000..691dbc66 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNoCloseNotifyException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 57229a1433215c14392238228c84934b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCipher.cs new file mode 100644 index 00000000..a38149a0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCipher.cs @@ -0,0 +1,122 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// + /// A NULL CipherSuite, with optional MAC. + /// + public class TlsNullCipher + : TlsCipher + { + protected readonly TlsContext context; + + protected readonly TlsMac writeMac; + protected readonly TlsMac readMac; + + public TlsNullCipher(TlsContext context) + { + this.context = context; + this.writeMac = null; + this.readMac = null; + } + + /// + public TlsNullCipher(TlsContext context, IDigest clientWriteDigest, IDigest serverWriteDigest) + { + if ((clientWriteDigest == null) != (serverWriteDigest == null)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + this.context = context; + + TlsMac clientWriteMac = null, serverWriteMac = null; + + if (clientWriteDigest != null) + { + int key_block_size = clientWriteDigest.GetDigestSize() + + serverWriteDigest.GetDigestSize(); + byte[] key_block = TlsUtilities.CalculateKeyBlock(context, key_block_size); + + int offset = 0; + + clientWriteMac = new TlsMac(context, clientWriteDigest, key_block, offset, + clientWriteDigest.GetDigestSize()); + offset += clientWriteDigest.GetDigestSize(); + + serverWriteMac = new TlsMac(context, serverWriteDigest, key_block, offset, + serverWriteDigest.GetDigestSize()); + offset += serverWriteDigest.GetDigestSize(); + + if (offset != key_block_size) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + if (context.IsServer) + { + writeMac = serverWriteMac; + readMac = clientWriteMac; + } + else + { + writeMac = clientWriteMac; + readMac = serverWriteMac; + } + } + + public virtual int GetPlaintextLimit(int ciphertextLimit) + { + int result = ciphertextLimit; + if (writeMac != null) + { + result -= writeMac.Size; + } + return result; + } + + /// + public virtual byte[] EncodePlaintext(long seqNo, byte type, byte[] plaintext, int offset, int len) + { + if (writeMac == null) + { + return Arrays.CopyOfRange(plaintext, offset, offset + len); + } + + byte[] mac = writeMac.CalculateMac(seqNo, type, plaintext, offset, len); + byte[] ciphertext = new byte[len + mac.Length]; + Array.Copy(plaintext, offset, ciphertext, 0, len); + Array.Copy(mac, 0, ciphertext, len, mac.Length); + return ciphertext; + } + + /// + public virtual byte[] DecodeCiphertext(long seqNo, byte type, byte[] ciphertext, int offset, int len) + { + if (readMac == null) + { + return Arrays.CopyOfRange(ciphertext, offset, offset + len); + } + + int macSize = readMac.Size; + if (len < macSize) + throw new TlsFatalAlert(AlertDescription.decode_error); + + int macInputLen = len - macSize; + + byte[] receivedMac = Arrays.CopyOfRange(ciphertext, offset + macInputLen, offset + len); + byte[] computedMac = readMac.CalculateMac(seqNo, type, ciphertext, offset, macInputLen); + + if (!Arrays.ConstantTimeAreEqual(receivedMac, computedMac)) + throw new TlsFatalAlert(AlertDescription.bad_record_mac); + + return Arrays.CopyOfRange(ciphertext, offset, offset + macInputLen); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCipher.cs.meta new file mode 100644 index 00000000..1b4660b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 542ace76e14774a4a844b9991b935684 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCompression.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCompression.cs new file mode 100644 index 00000000..29b1d195 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCompression.cs @@ -0,0 +1,23 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsNullCompression + : TlsCompression + { + public virtual Stream Compress(Stream output) + { + return output; + } + + public virtual Stream Decompress(Stream output) + { + return output; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCompression.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCompression.cs.meta new file mode 100644 index 00000000..2c9de92c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsNullCompression.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2dbc8356620c83641823301e670735b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPeer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPeer.cs new file mode 100644 index 00000000..d91ecdd8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPeer.cs @@ -0,0 +1,81 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsPeer + { + /// + /// This implementation supports RFC 7627 and will always negotiate the extended_master_secret + /// extension where possible. + /// + /// + /// When connecting to a peer that does not offer/accept this extension, it is recommended to + /// abort the handshake. This option is provided for interoperability with legacy peers, + /// although some TLS features will be disabled in that case (see RFC 7627 5.4). + /// + /// + /// true if the handshake should be aborted when the peer does not negotiate the + /// extended_master_secret extension, or false to support legacy interoperability. + /// + bool RequiresExtendedMasterSecret(); + + /// + /// draft-mathewson-no-gmtunixtime-00 2. "If existing users of a TLS implementation may rely on + /// gmt_unix_time containing the current time, we recommend that implementors MAY provide the + /// ability to set gmt_unix_time as an option only, off by default." + /// + /// + /// true if the current time should be used in the gmt_unix_time field of + /// Random, or false if gmt_unix_time should contain a cryptographically + /// random value. + /// + bool ShouldUseGmtUnixTime(); + + /// + /// Report whether the server supports secure renegotiation + /// + /// + /// The protocol handler automatically processes the relevant extensions + /// + /// + /// A , true if the server supports secure renegotiation + /// + /// + void NotifySecureRenegotiation(bool secureRenegotiation); + + /// + /// Return an implementation of to handle record compression. + /// + /// A + /// + TlsCompression GetCompression(); + + /// + /// Return an implementation of to use for encryption/decryption. + /// + /// A + /// + TlsCipher GetCipher(); + + /// This method will be called when an alert is raised by the protocol. + /// + /// + /// A human-readable message explaining what caused this alert. May be null. + /// The Exception that caused this alert to be raised. May be null. + void NotifyAlertRaised(byte alertLevel, byte alertDescription, string message, Exception cause); + + /// This method will be called when an alert is received from the remote peer. + /// + /// + void NotifyAlertReceived(byte alertLevel, byte alertDescription); + + /// Notifies the peer that the handshake has been successfully completed. + /// + void NotifyHandshakeComplete(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPeer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPeer.cs.meta new file mode 100644 index 00000000..3bad5fc7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPeer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59b35c099f90afd4bbab07593f6db596 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs new file mode 100644 index 00000000..d49e7865 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs @@ -0,0 +1,1454 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class TlsProtocol + { + /* + * Our Connection states + */ + protected const short CS_START = 0; + protected const short CS_CLIENT_HELLO = 1; + protected const short CS_SERVER_HELLO = 2; + protected const short CS_SERVER_SUPPLEMENTAL_DATA = 3; + protected const short CS_SERVER_CERTIFICATE = 4; + protected const short CS_CERTIFICATE_STATUS = 5; + protected const short CS_SERVER_KEY_EXCHANGE = 6; + protected const short CS_CERTIFICATE_REQUEST = 7; + protected const short CS_SERVER_HELLO_DONE = 8; + protected const short CS_CLIENT_SUPPLEMENTAL_DATA = 9; + protected const short CS_CLIENT_CERTIFICATE = 10; + protected const short CS_CLIENT_KEY_EXCHANGE = 11; + protected const short CS_CERTIFICATE_VERIFY = 12; + protected const short CS_CLIENT_FINISHED = 13; + protected const short CS_SERVER_SESSION_TICKET = 14; + protected const short CS_SERVER_FINISHED = 15; + protected const short CS_END = 16; + + /* + * Different modes to handle the known IV weakness + */ + protected const short ADS_MODE_1_Nsub1 = 0; // 1/n-1 record splitting + protected const short ADS_MODE_0_N = 1; // 0/n record splitting + protected const short ADS_MODE_0_N_FIRSTONLY = 2; // 0/n record splitting on first data fragment only + + /* + * Queues for data from some protocols. + */ + private ByteQueue mApplicationDataQueue = new ByteQueue(0); + private ByteQueue mAlertQueue = new ByteQueue(2); + private ByteQueue mHandshakeQueue = new ByteQueue(0); + // private ByteQueue mHeartbeatQueue = new ByteQueue(); + + /* + * The Record Stream we use + */ + internal RecordStream mRecordStream; + protected SecureRandom mSecureRandom; + + private TlsStream mTlsStream = null; + + private volatile bool mClosed = false; + private volatile bool mFailedWithError = false; + private volatile bool mAppDataReady = false; + private volatile bool mAppDataSplitEnabled = true; + private volatile int mAppDataSplitMode = ADS_MODE_1_Nsub1; + private byte[] mExpectedVerifyData = null; + + protected TlsSession mTlsSession = null; + protected SessionParameters mSessionParameters = null; + protected SecurityParameters mSecurityParameters = null; + protected Certificate mPeerCertificate = null; + + protected int[] mOfferedCipherSuites = null; + protected byte[] mOfferedCompressionMethods = null; + protected IDictionary mClientExtensions = null; + protected IDictionary mServerExtensions = null; + + protected short mConnectionState = CS_START; + protected bool mResumedSession = false; + protected bool mReceivedChangeCipherSpec = false; + protected bool mSecureRenegotiation = false; + protected bool mAllowCertificateStatus = false; + protected bool mExpectSessionTicket = false; + + protected bool mBlocking = true; + protected ByteQueueStream mInputBuffers = null; + protected ByteQueueStream mOutputBuffer = null; + + public TlsProtocol(Stream stream, SecureRandom secureRandom) + : this(stream, stream, secureRandom) + { + } + + public TlsProtocol(Stream input, Stream output, SecureRandom secureRandom) + { + this.mRecordStream = new RecordStream(this, input, output); + this.mSecureRandom = secureRandom; + } + + public TlsProtocol(SecureRandom secureRandom) + { + this.mBlocking = false; + this.mInputBuffers = new ByteQueueStream(); + this.mOutputBuffer = new ByteQueueStream(); + this.mRecordStream = new RecordStream(this, mInputBuffers, mOutputBuffer); + this.mSecureRandom = secureRandom; + } + + protected abstract TlsContext Context { get; } + + internal abstract AbstractTlsContext ContextAdmin { get; } + + protected abstract TlsPeer Peer { get; } + + protected virtual void HandleAlertMessage(byte alertLevel, byte alertDescription) + { + Peer.NotifyAlertReceived(alertLevel, alertDescription); + + if (alertLevel == AlertLevel.warning) + { + HandleAlertWarningMessage(alertDescription); + } + else + { + HandleFailure(); + + throw new TlsFatalAlertReceived(alertDescription); + } + } + + protected virtual void HandleAlertWarningMessage(byte alertDescription) + { + /* + * RFC 5246 7.2.1. The other party MUST respond with a close_notify alert of its own + * and close down the connection immediately, discarding any pending writes. + */ + if (alertDescription == AlertDescription.close_notify) + { + if (!mAppDataReady) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + + HandleClose(false); + } + } + + protected virtual void HandleChangeCipherSpecMessage() + { + } + + protected virtual void HandleClose(bool user_canceled) + { + if (!mClosed) + { + this.mClosed = true; + + if (user_canceled && !mAppDataReady) + { + RaiseAlertWarning(AlertDescription.user_canceled, "User canceled handshake"); + } + + RaiseAlertWarning(AlertDescription.close_notify, "Connection closed"); + + mRecordStream.SafeClose(); + + if (!mAppDataReady) + { + CleanupHandshake(); + } + } + } + + protected virtual void HandleException(byte alertDescription, string message, Exception cause) + { + if (!mClosed) + { + RaiseAlertFatal(alertDescription, message, cause); + + HandleFailure(); + } + } + + protected virtual void HandleFailure() + { + this.mClosed = true; + this.mFailedWithError = true; + + /* + * RFC 2246 7.2.1. The session becomes unresumable if any connection is terminated + * without proper close_notify messages with level equal to warning. + */ + // TODO This isn't quite in the right place. Also, as of TLS 1.1 the above is obsolete. + InvalidateSession(); + + mRecordStream.SafeClose(); + + if (!mAppDataReady) + { + CleanupHandshake(); + } + } + + protected abstract void HandleHandshakeMessage(byte type, MemoryStream buf); + + protected virtual void ApplyMaxFragmentLengthExtension() + { + if (mSecurityParameters.maxFragmentLength >= 0) + { + if (!MaxFragmentLength.IsValid((byte)mSecurityParameters.maxFragmentLength)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + int plainTextLimit = 1 << (8 + mSecurityParameters.maxFragmentLength); + mRecordStream.SetPlaintextLimit(plainTextLimit); + } + } + + protected virtual void CheckReceivedChangeCipherSpec(bool expected) + { + if (expected != mReceivedChangeCipherSpec) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + protected virtual void CleanupHandshake() + { + if (this.mExpectedVerifyData != null) + { + Arrays.Fill(this.mExpectedVerifyData, (byte)0); + this.mExpectedVerifyData = null; + } + + this.mSecurityParameters.Clear(); + this.mPeerCertificate = null; + + this.mOfferedCipherSuites = null; + this.mOfferedCompressionMethods = null; + this.mClientExtensions = null; + this.mServerExtensions = null; + + this.mResumedSession = false; + this.mReceivedChangeCipherSpec = false; + this.mSecureRenegotiation = false; + this.mAllowCertificateStatus = false; + this.mExpectSessionTicket = false; + } + + protected virtual void BlockForHandshake() + { + if (mBlocking) + { + while (this.mConnectionState != CS_END) + { + if (this.mClosed) + { + // NOTE: Any close during the handshake should have raised an exception. + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + SafeReadRecord(); + } + } + } + + protected virtual void CompleteHandshake() + { + try + { + this.mConnectionState = CS_END; + + this.mAlertQueue.Shrink(); + this.mHandshakeQueue.Shrink(); + + this.mRecordStream.FinaliseHandshake(); + + this.mAppDataSplitEnabled = !TlsUtilities.IsTlsV11(Context); + + /* + * If this was an initial handshake, we are now ready to send and receive application data. + */ + if (!mAppDataReady) + { + this.mAppDataReady = true; + + if (mBlocking) + { + this.mTlsStream = new TlsStream(this); + } + } + + if (this.mTlsSession != null) + { + if (this.mSessionParameters == null) + { + this.mSessionParameters = new SessionParameters.Builder() + .SetCipherSuite(this.mSecurityParameters.CipherSuite) + .SetCompressionAlgorithm(this.mSecurityParameters.CompressionAlgorithm) + .SetExtendedMasterSecret(this.mSecurityParameters.IsExtendedMasterSecret) + .SetMasterSecret(this.mSecurityParameters.MasterSecret) + .SetPeerCertificate(this.mPeerCertificate) + .SetPskIdentity(this.mSecurityParameters.PskIdentity) + .SetSrpIdentity(this.mSecurityParameters.SrpIdentity) + // TODO Consider filtering extensions that aren't relevant to resumed sessions + .SetServerExtensions(this.mServerExtensions) + .Build(); + + this.mTlsSession = new TlsSessionImpl(this.mTlsSession.SessionID, this.mSessionParameters); + } + + ContextAdmin.SetResumableSession(this.mTlsSession); + } + + Peer.NotifyHandshakeComplete(); + } + finally + { + CleanupHandshake(); + } + } + + protected internal void ProcessRecord(byte protocol, byte[] buf, int off, int len) + { + /* + * Have a look at the protocol type, and add it to the correct queue. + */ + switch (protocol) + { + case ContentType.alert: + { + mAlertQueue.AddData(buf, off, len); + ProcessAlertQueue(); + break; + } + case ContentType.application_data: + { + if (!mAppDataReady) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + mApplicationDataQueue.AddData(buf, off, len); + ProcessApplicationDataQueue(); + break; + } + case ContentType.change_cipher_spec: + { + ProcessChangeCipherSpec(buf, off, len); + break; + } + case ContentType.handshake: + { + if (mHandshakeQueue.Available > 0) + { + mHandshakeQueue.AddData(buf, off, len); + ProcessHandshakeQueue(mHandshakeQueue); + } + else + { + ByteQueue tmpQueue = new ByteQueue(buf, off, len); + ProcessHandshakeQueue(tmpQueue); + int remaining = tmpQueue.Available; + if (remaining > 0) + { + mHandshakeQueue.AddData(buf, off + len - remaining, remaining); + } + } + break; + } + //case ContentType.heartbeat: + //{ + // if (!mAppDataReady) + // throw new TlsFatalAlert(AlertDescription.unexpected_message); + + // // TODO[RFC 6520] + // //mHeartbeatQueue.AddData(buf, offset, len); + // //ProcessHeartbeat(); + // break; + //} + default: + // Record type should already have been checked + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + private void ProcessHandshakeQueue(ByteQueue queue) + { + while (queue.Available >= 4) + { + /* + * We need the first 4 bytes, they contain type and length of the message. + */ + byte[] beginning = new byte[4]; + queue.Read(beginning, 0, 4, 0); + byte type = TlsUtilities.ReadUint8(beginning, 0); + int length = TlsUtilities.ReadUint24(beginning, 1); + int totalLength = 4 + length; + + /* + * Check if we have enough bytes in the buffer to read the full message. + */ + if (queue.Available < totalLength) + break; + + /* + * RFC 2246 7.4.9. The value handshake_messages includes all handshake messages + * starting at client hello up to, but not including, this finished message. + * [..] Note: [Also,] Hello Request messages are omitted from handshake hashes. + */ + if (HandshakeType.hello_request != type) + { + if (HandshakeType.finished == type) + { + CheckReceivedChangeCipherSpec(true); + + TlsContext ctx = Context; + if (this.mExpectedVerifyData == null + && ctx.SecurityParameters.MasterSecret != null) + { + this.mExpectedVerifyData = CreateVerifyData(!ctx.IsServer); + } + } + else + { + CheckReceivedChangeCipherSpec(mConnectionState == CS_END); + } + + queue.CopyTo(mRecordStream.HandshakeHashUpdater, totalLength); + } + + queue.RemoveData(4); + + MemoryStream buf = queue.ReadFrom(length); + + /* + * Now, parse the message. + */ + HandleHandshakeMessage(type, buf); + } + } + + private void ProcessApplicationDataQueue() + { + /* + * There is nothing we need to do here. + * + * This function could be used for callbacks when application data arrives in the future. + */ + } + + private void ProcessAlertQueue() + { + while (mAlertQueue.Available >= 2) + { + /* + * An alert is always 2 bytes. Read the alert. + */ + byte[] alert = mAlertQueue.RemoveData(2, 0); + byte alertLevel = alert[0]; + byte alertDescription = alert[1]; + + HandleAlertMessage(alertLevel, alertDescription); + } + } + + /** + * This method is called, when a change cipher spec message is received. + * + * @throws IOException If the message has an invalid content or the handshake is not in the correct + * state. + */ + private void ProcessChangeCipherSpec(byte[] buf, int off, int len) + { + for (int i = 0; i < len; ++i) + { + byte message = TlsUtilities.ReadUint8(buf, off + i); + + if (message != ChangeCipherSpec.change_cipher_spec) + throw new TlsFatalAlert(AlertDescription.decode_error); + + if (this.mReceivedChangeCipherSpec + || mAlertQueue.Available > 0 + || mHandshakeQueue.Available > 0) + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + mRecordStream.ReceivedReadCipherSpec(); + + this.mReceivedChangeCipherSpec = true; + + HandleChangeCipherSpecMessage(); + } + } + + protected internal virtual int ApplicationDataAvailable() + { + return mApplicationDataQueue.Available; + } + + /** + * Read data from the network. The method will return immediately, if there is still some data + * left in the buffer, or block until some application data has been read from the network. + * + * @param buf The buffer where the data will be copied to. + * @param offset The position where the data will be placed in the buffer. + * @param len The maximum number of bytes to read. + * @return The number of bytes read. + * @throws IOException If something goes wrong during reading data. + */ + protected internal virtual int ReadApplicationData(byte[] buf, int offset, int len) + { + if (len < 1) + return 0; + + while (mApplicationDataQueue.Available == 0) + { + if (this.mClosed) + { + if (this.mFailedWithError) + throw new IOException("Cannot read application data on failed TLS connection"); + + if (!mAppDataReady) + throw new InvalidOperationException("Cannot read application data until initial handshake completed."); + + return 0; + } + + SafeReadRecord(); + } + + len = System.Math.Min(len, mApplicationDataQueue.Available); + mApplicationDataQueue.RemoveData(buf, offset, len, 0); + return len; + } + + protected virtual void SafeCheckRecordHeader(byte[] recordHeader) + { + try + { + mRecordStream.CheckRecordHeader(recordHeader); + } + catch (TlsFatalAlert e) + { + HandleException(e.AlertDescription, "Failed to read record", e); + throw e; + } + catch (IOException e) + { + HandleException(AlertDescription.internal_error, "Failed to read record", e); + throw e; + } + catch (Exception e) + { + HandleException(AlertDescription.internal_error, "Failed to read record", e); + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + } + + protected virtual void SafeReadRecord() + { + try + { + if (mRecordStream.ReadRecord()) + return; + + if (!mAppDataReady) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + catch (TlsFatalAlertReceived e) + { + // Connection failure already handled at source + throw e; + } + catch (TlsFatalAlert e) + { + HandleException(e.AlertDescription, "Failed to read record", e); + throw e; + } + catch (IOException e) + { + HandleException(AlertDescription.internal_error, "Failed to read record", e); + throw e; + } + catch (Exception e) + { + HandleException(AlertDescription.internal_error, "Failed to read record", e); + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + + HandleFailure(); + + throw new TlsNoCloseNotifyException(); + } + + protected virtual void SafeWriteRecord(byte type, byte[] buf, int offset, int len) + { + try + { + mRecordStream.WriteRecord(type, buf, offset, len); + } + catch (TlsFatalAlert e) + { + HandleException(e.AlertDescription, "Failed to write record", e); + throw e; + } + catch (IOException e) + { + HandleException(AlertDescription.internal_error, "Failed to write record", e); + throw e; + } + catch (Exception e) + { + HandleException(AlertDescription.internal_error, "Failed to write record", e); + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + } + + /** + * Send some application data to the remote system. + *

+ * The method will handle fragmentation internally. + * + * @param buf The buffer with the data. + * @param offset The position in the buffer where the data is placed. + * @param len The length of the data. + * @throws IOException If something goes wrong during sending. + */ + protected internal virtual void WriteData(byte[] buf, int offset, int len) + { + if (this.mClosed) + throw new IOException("Cannot write application data on closed/failed TLS connection"); + + while (len > 0) + { + /* + * RFC 5246 6.2.1. Zero-length fragments of Application data MAY be sent as they are + * potentially useful as a traffic analysis countermeasure. + * + * NOTE: Actually, implementations appear to have settled on 1/n-1 record splitting. + */ + + if (this.mAppDataSplitEnabled) + { + /* + * Protect against known IV attack! + * + * DO NOT REMOVE THIS CODE, EXCEPT YOU KNOW EXACTLY WHAT YOU ARE DOING HERE. + */ + switch (mAppDataSplitMode) + { + case ADS_MODE_0_N: + SafeWriteRecord(ContentType.application_data, TlsUtilities.EmptyBytes, 0, 0); + break; + case ADS_MODE_0_N_FIRSTONLY: + this.mAppDataSplitEnabled = false; + SafeWriteRecord(ContentType.application_data, TlsUtilities.EmptyBytes, 0, 0); + break; + case ADS_MODE_1_Nsub1: + default: + SafeWriteRecord(ContentType.application_data, buf, offset, 1); + ++offset; + --len; + break; + } + } + + if (len > 0) + { + // Fragment data according to the current fragment limit. + int toWrite = System.Math.Min(len, mRecordStream.GetPlaintextLimit()); + SafeWriteRecord(ContentType.application_data, buf, offset, toWrite); + offset += toWrite; + len -= toWrite; + } + } + } + + protected virtual void SetAppDataSplitMode(int appDataSplitMode) + { + if (appDataSplitMode < ADS_MODE_1_Nsub1 || appDataSplitMode > ADS_MODE_0_N_FIRSTONLY) + throw new ArgumentException("Illegal appDataSplitMode mode: " + appDataSplitMode, "appDataSplitMode"); + + this.mAppDataSplitMode = appDataSplitMode; + } + + protected virtual void WriteHandshakeMessage(byte[] buf, int off, int len) + { + if (len < 4) + throw new TlsFatalAlert(AlertDescription.internal_error); + + byte type = TlsUtilities.ReadUint8(buf, off); + if (type != HandshakeType.hello_request) + { + mRecordStream.HandshakeHashUpdater.Write(buf, off, len); + } + + int total = 0; + do + { + // Fragment data according to the current fragment limit. + int toWrite = System.Math.Min(len - total, mRecordStream.GetPlaintextLimit()); + SafeWriteRecord(ContentType.handshake, buf, off + total, toWrite); + total += toWrite; + } + while (total < len); + } + + ///

The secure bidirectional stream for this connection + /// Only allowed in blocking mode. + public virtual Stream Stream + { + get + { + if (!mBlocking) + throw new InvalidOperationException("Cannot use Stream in non-blocking mode! Use OfferInput()/OfferOutput() instead."); + return this.mTlsStream; + } + } + + /** + * Should be called in non-blocking mode when the input data reaches EOF. + */ + public virtual void CloseInput() + { + if (mBlocking) + throw new InvalidOperationException("Cannot use CloseInput() in blocking mode!"); + + if (mClosed) + return; + + if (mInputBuffers.Available > 0) + throw new EndOfStreamException(); + + if (!mAppDataReady) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + + throw new TlsNoCloseNotifyException(); + } + + /** + * Offer input from an arbitrary source. Only allowed in non-blocking mode.
+ *
+ * After this method returns, the input buffer is "owned" by this object. Other code + * must not attempt to do anything with it.
+ *
+ * This method will decrypt and process all records that are fully available. + * If only part of a record is available, the buffer will be retained until the + * remainder of the record is offered.
+ *
+ * If any records containing application data were processed, the decrypted data + * can be obtained using {@link #readInput(byte[], int, int)}. If any records + * containing protocol data were processed, a response may have been generated. + * You should always check to see if there is any available output after calling + * this method by calling {@link #getAvailableOutputBytes()}. + * @param input The input buffer to offer + * @throws IOException If an error occurs while decrypting or processing a record + */ + public virtual void OfferInput(byte[] input) + { + if (mBlocking) + throw new InvalidOperationException("Cannot use OfferInput() in blocking mode! Use Stream instead."); + if (mClosed) + throw new IOException("Connection is closed, cannot accept any more input"); + + mInputBuffers.Write(input); + + // loop while there are enough bytes to read the length of the next record + while (mInputBuffers.Available >= RecordStream.TLS_HEADER_SIZE) + { + byte[] recordHeader = new byte[RecordStream.TLS_HEADER_SIZE]; + mInputBuffers.Peek(recordHeader); + + int totalLength = TlsUtilities.ReadUint16(recordHeader, RecordStream.TLS_HEADER_LENGTH_OFFSET) + RecordStream.TLS_HEADER_SIZE; + if (mInputBuffers.Available < totalLength) + { + // not enough bytes to read a whole record + SafeCheckRecordHeader(recordHeader); + break; + } + + SafeReadRecord(); + + if (mClosed) + { + if (mConnectionState != CS_END) + { + // NOTE: Any close during the handshake should have raised an exception. + throw new TlsFatalAlert(AlertDescription.internal_error); + } + break; + } + } + } + + /** + * Gets the amount of received application data. A call to {@link #readInput(byte[], int, int)} + * is guaranteed to be able to return at least this much data.
+ *
+ * Only allowed in non-blocking mode. + * @return The number of bytes of available application data + */ + public virtual int GetAvailableInputBytes() + { + if (mBlocking) + throw new InvalidOperationException("Cannot use GetAvailableInputBytes() in blocking mode! Use ApplicationDataAvailable() instead."); + + return ApplicationDataAvailable(); + } + + /** + * Retrieves received application data. Use {@link #getAvailableInputBytes()} to check + * how much application data is currently available. This method functions similarly to + * {@link InputStream#read(byte[], int, int)}, except that it never blocks. If no data + * is available, nothing will be copied and zero will be returned.
+ *
+ * Only allowed in non-blocking mode. + * @param buffer The buffer to hold the application data + * @param offset The start offset in the buffer at which the data is written + * @param length The maximum number of bytes to read + * @return The total number of bytes copied to the buffer. May be less than the + * length specified if the length was greater than the amount of available data. + */ + public virtual int ReadInput(byte[] buffer, int offset, int length) + { + if (mBlocking) + throw new InvalidOperationException("Cannot use ReadInput() in blocking mode! Use Stream instead."); + + return ReadApplicationData(buffer, offset, System.Math.Min(length, ApplicationDataAvailable())); + } + + /** + * Offer output from an arbitrary source. Only allowed in non-blocking mode.
+ *
+ * After this method returns, the specified section of the buffer will have been + * processed. Use {@link #readOutput(byte[], int, int)} to get the bytes to + * transmit to the other peer.
+ *
+ * This method must not be called until after the handshake is complete! Attempting + * to call it before the handshake is complete will result in an exception. + * @param buffer The buffer containing application data to encrypt + * @param offset The offset at which to begin reading data + * @param length The number of bytes of data to read + * @throws IOException If an error occurs encrypting the data, or the handshake is not complete + */ + public virtual void OfferOutput(byte[] buffer, int offset, int length) + { + if (mBlocking) + throw new InvalidOperationException("Cannot use OfferOutput() in blocking mode! Use Stream instead."); + if (!mAppDataReady) + throw new IOException("Application data cannot be sent until the handshake is complete!"); + + WriteData(buffer, offset, length); + } + + /** + * Gets the amount of encrypted data available to be sent. A call to + * {@link #readOutput(byte[], int, int)} is guaranteed to be able to return at + * least this much data.
+ *
+ * Only allowed in non-blocking mode. + * @return The number of bytes of available encrypted data + */ + public virtual int GetAvailableOutputBytes() + { + if (mBlocking) + throw new InvalidOperationException("Cannot use GetAvailableOutputBytes() in blocking mode! Use Stream instead."); + + return mOutputBuffer.Available; + } + + /** + * Retrieves encrypted data to be sent. Use {@link #getAvailableOutputBytes()} to check + * how much encrypted data is currently available. This method functions similarly to + * {@link InputStream#read(byte[], int, int)}, except that it never blocks. If no data + * is available, nothing will be copied and zero will be returned.
+ *
+ * Only allowed in non-blocking mode. + * @param buffer The buffer to hold the encrypted data + * @param offset The start offset in the buffer at which the data is written + * @param length The maximum number of bytes to read + * @return The total number of bytes copied to the buffer. May be less than the + * length specified if the length was greater than the amount of available data. + */ + public virtual int ReadOutput(byte[] buffer, int offset, int length) + { + if (mBlocking) + throw new InvalidOperationException("Cannot use ReadOutput() in blocking mode! Use Stream instead."); + + return mOutputBuffer.Read(buffer, offset, length); + } + + protected virtual void InvalidateSession() + { + if (this.mSessionParameters != null) + { + this.mSessionParameters.Clear(); + this.mSessionParameters = null; + } + + if (this.mTlsSession != null) + { + this.mTlsSession.Invalidate(); + this.mTlsSession = null; + } + } + + protected virtual void ProcessFinishedMessage(MemoryStream buf) + { + if (mExpectedVerifyData == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + byte[] verify_data = TlsUtilities.ReadFully(mExpectedVerifyData.Length, buf); + + AssertEmpty(buf); + + /* + * Compare both checksums. + */ + if (!Arrays.ConstantTimeAreEqual(mExpectedVerifyData, verify_data)) + { + /* + * Wrong checksum in the finished message. + */ + throw new TlsFatalAlert(AlertDescription.decrypt_error); + } + } + + protected virtual void RaiseAlertFatal(byte alertDescription, string message, Exception cause) + { + Peer.NotifyAlertRaised(AlertLevel.fatal, alertDescription, message, cause); + + byte[] alert = new byte[]{ AlertLevel.fatal, alertDescription }; + + try + { + mRecordStream.WriteRecord(ContentType.alert, alert, 0, 2); + } + catch (Exception) + { + // We are already processing an exception, so just ignore this + } + } + + protected virtual void RaiseAlertWarning(byte alertDescription, string message) + { + Peer.NotifyAlertRaised(AlertLevel.warning, alertDescription, message, null); + + byte[] alert = new byte[]{ AlertLevel.warning, alertDescription }; + + SafeWriteRecord(ContentType.alert, alert, 0, 2); + } + + protected virtual void SendCertificateMessage(Certificate certificate) + { + if (certificate == null) + { + certificate = Certificate.EmptyChain; + } + + if (certificate.IsEmpty) + { + TlsContext context = Context; + if (!context.IsServer) + { + ProtocolVersion serverVersion = Context.ServerVersion; + if (serverVersion.IsSsl) + { + string errorMessage = serverVersion.ToString() + " client didn't provide credentials"; + RaiseAlertWarning(AlertDescription.no_certificate, errorMessage); + return; + } + } + } + + HandshakeMessage message = new HandshakeMessage(HandshakeType.certificate); + + certificate.Encode(message); + + message.WriteToRecordStream(this); + } + + protected virtual void SendChangeCipherSpecMessage() + { + byte[] message = new byte[]{ 1 }; + SafeWriteRecord(ContentType.change_cipher_spec, message, 0, message.Length); + mRecordStream.SentWriteCipherSpec(); + } + + protected virtual void SendFinishedMessage() + { + byte[] verify_data = CreateVerifyData(Context.IsServer); + + HandshakeMessage message = new HandshakeMessage(HandshakeType.finished, verify_data.Length); + + message.Write(verify_data, 0, verify_data.Length); + + message.WriteToRecordStream(this); + } + + protected virtual void SendSupplementalDataMessage(IList supplementalData) + { + HandshakeMessage message = new HandshakeMessage(HandshakeType.supplemental_data); + + WriteSupplementalData(message, supplementalData); + + message.WriteToRecordStream(this); + } + + protected virtual byte[] CreateVerifyData(bool isServer) + { + TlsContext context = Context; + string asciiLabel = isServer ? ExporterLabel.server_finished : ExporterLabel.client_finished; + byte[] sslSender = isServer ? TlsUtilities.SSL_SERVER : TlsUtilities.SSL_CLIENT; + byte[] hash = GetCurrentPrfHash(context, mRecordStream.HandshakeHash, sslSender); + return TlsUtilities.CalculateVerifyData(context, asciiLabel, hash); + } + + /** + * Closes this connection. + * + * @throws IOException If something goes wrong during closing. + */ + public virtual void Close() + { + HandleClose(true); + } + + protected internal virtual void Flush() + { + mRecordStream.Flush(); + } + + public virtual bool IsClosed + { + get { return mClosed; } + } + + protected virtual short ProcessMaxFragmentLengthExtension(IDictionary clientExtensions, IDictionary serverExtensions, + byte alertDescription) + { + short maxFragmentLength = TlsExtensionsUtilities.GetMaxFragmentLengthExtension(serverExtensions); + if (maxFragmentLength >= 0) + { + if (!MaxFragmentLength.IsValid((byte)maxFragmentLength) + || (!this.mResumedSession && maxFragmentLength != TlsExtensionsUtilities + .GetMaxFragmentLengthExtension(clientExtensions))) + { + throw new TlsFatalAlert(alertDescription); + } + } + return maxFragmentLength; + } + + protected virtual void RefuseRenegotiation() + { + /* + * RFC 5746 4.5 SSLv3 clients that refuse renegotiation SHOULD use a fatal + * handshake_failure alert. + */ + if (TlsUtilities.IsSsl(Context)) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + + RaiseAlertWarning(AlertDescription.no_renegotiation, "Renegotiation not supported"); + } + + /** + * Make sure the InputStream 'buf' now empty. Fail otherwise. + * + * @param buf The InputStream to check. + * @throws IOException If 'buf' is not empty. + */ + protected internal static void AssertEmpty(MemoryStream buf) + { + if (buf.Position < buf.Length) + throw new TlsFatalAlert(AlertDescription.decode_error); + } + + protected internal static byte[] CreateRandomBlock(bool useGmtUnixTime, IRandomGenerator randomGenerator) + { + byte[] result = new byte[32]; + randomGenerator.NextBytes(result); + + if (useGmtUnixTime) + { + TlsUtilities.WriteGmtUnixTime(result, 0); + } + + return result; + } + + protected internal static byte[] CreateRenegotiationInfo(byte[] renegotiated_connection) + { + return TlsUtilities.EncodeOpaque8(renegotiated_connection); + } + + protected internal static void EstablishMasterSecret(TlsContext context, TlsKeyExchange keyExchange) + { + byte[] pre_master_secret = keyExchange.GeneratePremasterSecret(); + + try + { + context.SecurityParameters.masterSecret = TlsUtilities.CalculateMasterSecret(context, pre_master_secret); + } + finally + { + // TODO Is there a way to ensure the data is really overwritten? + /* + * RFC 2246 8.1. The pre_master_secret should be deleted from memory once the + * master_secret has been computed. + */ + if (pre_master_secret != null) + { + Arrays.Fill(pre_master_secret, (byte)0); + } + } + } + + /** + * 'sender' only relevant to SSLv3 + */ + protected internal static byte[] GetCurrentPrfHash(TlsContext context, TlsHandshakeHash handshakeHash, byte[] sslSender) + { + IDigest d = handshakeHash.ForkPrfHash(); + + if (sslSender != null && TlsUtilities.IsSsl(context)) + { + d.BlockUpdate(sslSender, 0, sslSender.Length); + } + + return DigestUtilities.DoFinal(d); + } + + protected internal static IDictionary ReadExtensions(MemoryStream input) + { + if (input.Position >= input.Length) + return null; + + byte[] extBytes = TlsUtilities.ReadOpaque16(input); + + AssertEmpty(input); + + MemoryStream buf = new MemoryStream(extBytes, false); + + // Integer -> byte[] + IDictionary extensions = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + while (buf.Position < buf.Length) + { + int extension_type = TlsUtilities.ReadUint16(buf); + byte[] extension_data = TlsUtilities.ReadOpaque16(buf); + + /* + * RFC 3546 2.3 There MUST NOT be more than one extension of the same type. + */ + if (extensions.Contains(extension_type)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + extensions.Add(extension_type, extension_data); + } + + return extensions; + } + + protected internal static IList ReadSupplementalDataMessage(MemoryStream input) + { + byte[] supp_data = TlsUtilities.ReadOpaque24(input); + + AssertEmpty(input); + + MemoryStream buf = new MemoryStream(supp_data, false); + + IList supplementalData = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + while (buf.Position < buf.Length) + { + int supp_data_type = TlsUtilities.ReadUint16(buf); + byte[] data = TlsUtilities.ReadOpaque16(buf); + + supplementalData.Add(new SupplementalDataEntry(supp_data_type, data)); + } + + return supplementalData; + } + + protected internal static void WriteExtensions(Stream output, IDictionary extensions) + { + MemoryStream buf = new MemoryStream(); + + /* + * NOTE: There are reports of servers that don't accept a zero-length extension as the last + * one, so we write out any zero-length ones first as a best-effort workaround. + */ + WriteSelectedExtensions(buf, extensions, true); + WriteSelectedExtensions(buf, extensions, false); + + byte[] extBytes = buf.ToArray(); + + TlsUtilities.WriteOpaque16(extBytes, output); + } + + protected internal static void WriteSelectedExtensions(Stream output, IDictionary extensions, bool selectEmpty) + { + foreach (int extension_type in extensions.Keys) + { + byte[] extension_data = (byte[])extensions[extension_type]; + if (selectEmpty == (extension_data.Length == 0)) + { + TlsUtilities.CheckUint16(extension_type); + TlsUtilities.WriteUint16(extension_type, output); + TlsUtilities.WriteOpaque16(extension_data, output); + } + } + } + + protected internal static void WriteSupplementalData(Stream output, IList supplementalData) + { + MemoryStream buf = new MemoryStream(); + + foreach (SupplementalDataEntry entry in supplementalData) + { + int supp_data_type = entry.DataType; + TlsUtilities.CheckUint16(supp_data_type); + TlsUtilities.WriteUint16(supp_data_type, buf); + TlsUtilities.WriteOpaque16(entry.Data, buf); + } + + byte[] supp_data = buf.ToArray(); + + TlsUtilities.WriteOpaque24(supp_data, output); + } + + protected internal static int GetPrfAlgorithm(TlsContext context, int ciphersuite) + { + bool isTLSv12 = TlsUtilities.IsTlsV12(context); + + switch (ciphersuite) + { + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_128_OCB: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CCM: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_256_OCB: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_128_OCB: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM_8: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_256_OCB: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_128_OCB: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_256_OCB: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_256_OCB: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_PSK_DHE_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_DHE_WITH_AES_256_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_128_OCB: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM_8: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_256_OCB: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_NULL_SHA256: + { + if (isTLSv12) + { + return PrfAlgorithm.tls_prf_sha256; + } + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + case CipherSuite.TLS_DH_anon_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384: + { + if (isTLSv12) + { + return PrfAlgorithm.tls_prf_sha384; + } + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA384: + { + if (isTLSv12) + { + return PrfAlgorithm.tls_prf_sha384; + } + return PrfAlgorithm.tls_prf_legacy; + } + + default: + { + if (isTLSv12) + { + return PrfAlgorithm.tls_prf_sha256; + } + return PrfAlgorithm.tls_prf_legacy; + } + } + } + + internal class HandshakeMessage + : MemoryStream + { + internal HandshakeMessage(byte handshakeType) + : this(handshakeType, 60) + { + } + + internal HandshakeMessage(byte handshakeType, int length) + : base(length + 4) + { + TlsUtilities.WriteUint8(handshakeType, this); + // Reserve space for length + TlsUtilities.WriteUint24(0, this); + } + + internal void Write(byte[] data) + { + Write(data, 0, data.Length); + } + + internal void WriteToRecordStream(TlsProtocol protocol) + { + // Patch actual length back in + long length = Length - 4; + TlsUtilities.CheckUint24(length); + this.Position = 1; + TlsUtilities.WriteUint24((int)length, this); + +#if PORTABLE || NETFX_CORE + byte[] buf = ToArray(); + int bufLen = buf.Length; +#else + byte[] buf = GetBuffer(); + int bufLen = (int)Length; +#endif + + protocol.WriteHandshakeMessage(buf, 0, bufLen); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(this); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs.meta new file mode 100644 index 00000000..bece783a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocol.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 574c7c786bb3d3646b011a406a951272 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocolHandler.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocolHandler.cs new file mode 100644 index 00000000..0c0281ff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocolHandler.cs @@ -0,0 +1,43 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Srp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IO; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + [Obsolete("Use 'TlsClientProtocol' instead")] + public class TlsProtocolHandler + : TlsClientProtocol + { + public TlsProtocolHandler(Stream stream, SecureRandom secureRandom) + : base(stream, stream, secureRandom) + { + } + + /// Both streams can be the same object + public TlsProtocolHandler(Stream input, Stream output, SecureRandom secureRandom) + : base(input, output, secureRandom) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocolHandler.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocolHandler.cs.meta new file mode 100644 index 00000000..4bfe40bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsProtocolHandler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6959eea898cfc344bd0e91ac5ab2a35 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentity.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentity.cs new file mode 100644 index 00000000..8eaf6efe --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentity.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsPskIdentity + { + void SkipIdentityHint(); + + void NotifyIdentityHint(byte[] psk_identity_hint); + + byte[] GetPskIdentity(); + + byte[] GetPsk(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentity.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentity.cs.meta new file mode 100644 index 00000000..5884ee3f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentity.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca597e6ea5e11f7498407a1a21e20014 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentityManager.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentityManager.cs new file mode 100644 index 00000000..74b17e61 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentityManager.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsPskIdentityManager + { + byte[] GetHint(); + + byte[] GetPsk(byte[] identity); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentityManager.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentityManager.cs.meta new file mode 100644 index 00000000..833f9ca5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskIdentityManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd5ee21fb3ab44c4aa66027255e77c44 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskKeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskKeyExchange.cs new file mode 100644 index 00000000..e328db3a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskKeyExchange.cs @@ -0,0 +1,338 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// (D)TLS PSK key exchange (RFC 4279). + public class TlsPskKeyExchange + : AbstractTlsKeyExchange + { + protected TlsPskIdentity mPskIdentity; + protected TlsPskIdentityManager mPskIdentityManager; + + protected TlsDHVerifier mDHVerifier; + protected DHParameters mDHParameters; + protected int[] mNamedCurves; + protected byte[] mClientECPointFormats, mServerECPointFormats; + + protected byte[] mPskIdentityHint = null; + protected byte[] mPsk = null; + + protected DHPrivateKeyParameters mDHAgreePrivateKey = null; + protected DHPublicKeyParameters mDHAgreePublicKey = null; + + protected ECPrivateKeyParameters mECAgreePrivateKey = null; + protected ECPublicKeyParameters mECAgreePublicKey = null; + + protected AsymmetricKeyParameter mServerPublicKey = null; + protected RsaKeyParameters mRsaServerPublicKey = null; + protected TlsEncryptionCredentials mServerCredentials = null; + protected byte[] mPremasterSecret; + + [Obsolete("Use constructor that takes a TlsDHVerifier")] + public TlsPskKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, TlsPskIdentity pskIdentity, + TlsPskIdentityManager pskIdentityManager, DHParameters dhParameters, int[] namedCurves, + byte[] clientECPointFormats, byte[] serverECPointFormats) + : this(keyExchange, supportedSignatureAlgorithms, pskIdentity, pskIdentityManager, new DefaultTlsDHVerifier(), + dhParameters, namedCurves, clientECPointFormats, serverECPointFormats) + { + } + + public TlsPskKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, TlsPskIdentity pskIdentity, + TlsPskIdentityManager pskIdentityManager, TlsDHVerifier dhVerifier, DHParameters dhParameters, int[] namedCurves, + byte[] clientECPointFormats, byte[] serverECPointFormats) + : base(keyExchange, supportedSignatureAlgorithms) + { + switch (keyExchange) + { + case KeyExchangeAlgorithm.DHE_PSK: + case KeyExchangeAlgorithm.ECDHE_PSK: + case KeyExchangeAlgorithm.PSK: + case KeyExchangeAlgorithm.RSA_PSK: + break; + default: + throw new InvalidOperationException("unsupported key exchange algorithm"); + } + + this.mPskIdentity = pskIdentity; + this.mPskIdentityManager = pskIdentityManager; + this.mDHVerifier = dhVerifier; + this.mDHParameters = dhParameters; + this.mNamedCurves = namedCurves; + this.mClientECPointFormats = clientECPointFormats; + this.mServerECPointFormats = serverECPointFormats; + } + + public override void SkipServerCredentials() + { + if (mKeyExchange == KeyExchangeAlgorithm.RSA_PSK) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public override void ProcessServerCredentials(TlsCredentials serverCredentials) + { + if (!(serverCredentials is TlsEncryptionCredentials)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + ProcessServerCertificate(serverCredentials.Certificate); + + this.mServerCredentials = (TlsEncryptionCredentials)serverCredentials; + } + + public override byte[] GenerateServerKeyExchange() + { + this.mPskIdentityHint = mPskIdentityManager.GetHint(); + + if (this.mPskIdentityHint == null && !RequiresServerKeyExchange) + return null; + + MemoryStream buf = new MemoryStream(); + + if (this.mPskIdentityHint == null) + { + TlsUtilities.WriteOpaque16(TlsUtilities.EmptyBytes, buf); + } + else + { + TlsUtilities.WriteOpaque16(this.mPskIdentityHint, buf); + } + + if (this.mKeyExchange == KeyExchangeAlgorithm.DHE_PSK) + { + if (this.mDHParameters == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + this.mDHAgreePrivateKey = TlsDHUtilities.GenerateEphemeralServerKeyExchange(mContext.SecureRandom, + this.mDHParameters, buf); + } + else if (this.mKeyExchange == KeyExchangeAlgorithm.ECDHE_PSK) + { + this.mECAgreePrivateKey = TlsEccUtilities.GenerateEphemeralServerKeyExchange(mContext.SecureRandom, + mNamedCurves, mClientECPointFormats, buf); + } + + return buf.ToArray(); + } + + public override void ProcessServerCertificate(Certificate serverCertificate) + { + if (mKeyExchange != KeyExchangeAlgorithm.RSA_PSK) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + if (serverCertificate.IsEmpty) + throw new TlsFatalAlert(AlertDescription.bad_certificate); + + X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0); + + SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo; + try + { + this.mServerPublicKey = PublicKeyFactory.CreateKey(keyInfo); + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.unsupported_certificate, e); + } + + // Sanity check the PublicKeyFactory + if (this.mServerPublicKey.IsPrivate) + throw new TlsFatalAlert(AlertDescription.internal_error); + + this.mRsaServerPublicKey = ValidateRsaPublicKey((RsaKeyParameters)this.mServerPublicKey); + + TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.KeyEncipherment); + + base.ProcessServerCertificate(serverCertificate); + } + + public override bool RequiresServerKeyExchange + { + get + { + switch (mKeyExchange) + { + case KeyExchangeAlgorithm.DHE_PSK: + case KeyExchangeAlgorithm.ECDHE_PSK: + return true; + default: + return false; + } + } + } + + public override void ProcessServerKeyExchange(Stream input) + { + this.mPskIdentityHint = TlsUtilities.ReadOpaque16(input); + + if (this.mKeyExchange == KeyExchangeAlgorithm.DHE_PSK) + { + this.mDHParameters = TlsDHUtilities.ReceiveDHParameters(mDHVerifier, input); + this.mDHAgreePublicKey = new DHPublicKeyParameters(TlsDHUtilities.ReadDHParameter(input), mDHParameters); + } + else if (this.mKeyExchange == KeyExchangeAlgorithm.ECDHE_PSK) + { + ECDomainParameters ecParams = TlsEccUtilities.ReadECParameters(mNamedCurves, mClientECPointFormats, input); + + byte[] point = TlsUtilities.ReadOpaque8(input); + + this.mECAgreePublicKey = TlsEccUtilities.ValidateECPublicKey(TlsEccUtilities.DeserializeECPublicKey( + mClientECPointFormats, ecParams, point)); + } + } + + public override void ValidateCertificateRequest(CertificateRequest certificateRequest) + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public override void ProcessClientCredentials(TlsCredentials clientCredentials) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public override void GenerateClientKeyExchange(Stream output) + { + if (mPskIdentityHint == null) + { + mPskIdentity.SkipIdentityHint(); + } + else + { + mPskIdentity.NotifyIdentityHint(mPskIdentityHint); + } + + byte[] psk_identity = mPskIdentity.GetPskIdentity(); + if (psk_identity == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + this.mPsk = mPskIdentity.GetPsk(); + if (mPsk == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + TlsUtilities.WriteOpaque16(psk_identity, output); + + mContext.SecurityParameters.pskIdentity = psk_identity; + + if (this.mKeyExchange == KeyExchangeAlgorithm.DHE_PSK) + { + this.mDHAgreePrivateKey = TlsDHUtilities.GenerateEphemeralClientKeyExchange(mContext.SecureRandom, + mDHParameters, output); + } + else if (this.mKeyExchange == KeyExchangeAlgorithm.ECDHE_PSK) + { + this.mECAgreePrivateKey = TlsEccUtilities.GenerateEphemeralClientKeyExchange(mContext.SecureRandom, + mServerECPointFormats, mECAgreePublicKey.Parameters, output); + } + else if (this.mKeyExchange == KeyExchangeAlgorithm.RSA_PSK) + { + this.mPremasterSecret = TlsRsaUtilities.GenerateEncryptedPreMasterSecret(mContext, + this.mRsaServerPublicKey, output); + } + } + + public override void ProcessClientKeyExchange(Stream input) + { + byte[] psk_identity = TlsUtilities.ReadOpaque16(input); + + this.mPsk = mPskIdentityManager.GetPsk(psk_identity); + if (mPsk == null) + throw new TlsFatalAlert(AlertDescription.unknown_psk_identity); + + mContext.SecurityParameters.pskIdentity = psk_identity; + + if (this.mKeyExchange == KeyExchangeAlgorithm.DHE_PSK) + { + this.mDHAgreePublicKey = new DHPublicKeyParameters(TlsDHUtilities.ReadDHParameter(input), mDHParameters); + } + else if (this.mKeyExchange == KeyExchangeAlgorithm.ECDHE_PSK) + { + byte[] point = TlsUtilities.ReadOpaque8(input); + + ECDomainParameters curve_params = this.mECAgreePrivateKey.Parameters; + + this.mECAgreePublicKey = TlsEccUtilities.ValidateECPublicKey(TlsEccUtilities.DeserializeECPublicKey( + mServerECPointFormats, curve_params, point)); + } + else if (this.mKeyExchange == KeyExchangeAlgorithm.RSA_PSK) + { + byte[] encryptedPreMasterSecret; + if (TlsUtilities.IsSsl(mContext)) + { + // TODO Do any SSLv3 clients actually include the length? + encryptedPreMasterSecret = Streams.ReadAll(input); + } + else + { + encryptedPreMasterSecret = TlsUtilities.ReadOpaque16(input); + } + + this.mPremasterSecret = mServerCredentials.DecryptPreMasterSecret(encryptedPreMasterSecret); + } + } + + public override byte[] GeneratePremasterSecret() + { + byte[] other_secret = GenerateOtherSecret(mPsk.Length); + + MemoryStream buf = new MemoryStream(4 + other_secret.Length + mPsk.Length); + TlsUtilities.WriteOpaque16(other_secret, buf); + TlsUtilities.WriteOpaque16(mPsk, buf); + + Arrays.Fill(mPsk, (byte)0); + this.mPsk = null; + + return buf.ToArray(); + } + + protected virtual byte[] GenerateOtherSecret(int pskLength) + { + if (this.mKeyExchange == KeyExchangeAlgorithm.DHE_PSK) + { + if (mDHAgreePrivateKey != null) + { + return TlsDHUtilities.CalculateDHBasicAgreement(mDHAgreePublicKey, mDHAgreePrivateKey); + } + + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + if (this.mKeyExchange == KeyExchangeAlgorithm.ECDHE_PSK) + { + if (mECAgreePrivateKey != null) + { + return TlsEccUtilities.CalculateECDHBasicAgreement(mECAgreePublicKey, mECAgreePrivateKey); + } + + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + if (this.mKeyExchange == KeyExchangeAlgorithm.RSA_PSK) + { + return this.mPremasterSecret; + } + + return new byte[pskLength]; + } + + protected virtual RsaKeyParameters ValidateRsaPublicKey(RsaKeyParameters key) + { + // TODO What is the minimum bit length required? + // key.Modulus.BitLength; + + if (!key.Exponent.IsProbablePrime(2)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + return key; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskKeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskKeyExchange.cs.meta new file mode 100644 index 00000000..1dfb3244 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsPskKeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0bb9259bbb9f124c82326fa99151efc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaKeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaKeyExchange.cs new file mode 100644 index 00000000..d7d814c1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaKeyExchange.cs @@ -0,0 +1,144 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// (D)TLS and SSLv3 RSA key exchange. + public class TlsRsaKeyExchange + : AbstractTlsKeyExchange + { + protected AsymmetricKeyParameter mServerPublicKey = null; + + protected RsaKeyParameters mRsaServerPublicKey = null; + + protected TlsEncryptionCredentials mServerCredentials = null; + + protected byte[] mPremasterSecret; + + public TlsRsaKeyExchange(IList supportedSignatureAlgorithms) + : base(KeyExchangeAlgorithm.RSA, supportedSignatureAlgorithms) + { + } + + public override void SkipServerCredentials() + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public override void ProcessServerCredentials(TlsCredentials serverCredentials) + { + if (!(serverCredentials is TlsEncryptionCredentials)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + ProcessServerCertificate(serverCredentials.Certificate); + + this.mServerCredentials = (TlsEncryptionCredentials)serverCredentials; + } + + public override void ProcessServerCertificate(Certificate serverCertificate) + { + if (serverCertificate.IsEmpty) + throw new TlsFatalAlert(AlertDescription.bad_certificate); + + X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0); + + SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo; + try + { + this.mServerPublicKey = PublicKeyFactory.CreateKey(keyInfo); + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.unsupported_certificate, e); + } + + // Sanity check the PublicKeyFactory + if (this.mServerPublicKey.IsPrivate) + throw new TlsFatalAlert(AlertDescription.internal_error); + + this.mRsaServerPublicKey = ValidateRsaPublicKey((RsaKeyParameters)this.mServerPublicKey); + + TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.KeyEncipherment); + + base.ProcessServerCertificate(serverCertificate); + } + + public override void ValidateCertificateRequest(CertificateRequest certificateRequest) + { + byte[] types = certificateRequest.CertificateTypes; + for (int i = 0; i < types.Length; ++i) + { + switch (types[i]) + { + case ClientCertificateType.rsa_sign: + case ClientCertificateType.dss_sign: + case ClientCertificateType.ecdsa_sign: + break; + default: + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + } + } + + public override void ProcessClientCredentials(TlsCredentials clientCredentials) + { + if (!(clientCredentials is TlsSignerCredentials)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public override void GenerateClientKeyExchange(Stream output) + { + this.mPremasterSecret = TlsRsaUtilities.GenerateEncryptedPreMasterSecret(mContext, mRsaServerPublicKey, output); + } + + public override void ProcessClientKeyExchange(Stream input) + { + byte[] encryptedPreMasterSecret; + if (TlsUtilities.IsSsl(mContext)) + { + // TODO Do any SSLv3 clients actually include the length? + encryptedPreMasterSecret = Streams.ReadAll(input); + } + else + { + encryptedPreMasterSecret = TlsUtilities.ReadOpaque16(input); + } + + this.mPremasterSecret = mServerCredentials.DecryptPreMasterSecret(encryptedPreMasterSecret); + } + + public override byte[] GeneratePremasterSecret() + { + if (this.mPremasterSecret == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + byte[] tmp = this.mPremasterSecret; + this.mPremasterSecret = null; + return tmp; + } + + protected virtual RsaKeyParameters ValidateRsaPublicKey(RsaKeyParameters key) + { + // TODO What is the minimum bit length required? + // key.Modulus.BitLength; + + if (!key.Exponent.IsProbablePrime(2)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + return key; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaKeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaKeyExchange.cs.meta new file mode 100644 index 00000000..9dd12742 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaKeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e10809a192c17c74ca9938acd9b5fd6b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaSigner.cs new file mode 100644 index 00000000..12494188 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaSigner.cs @@ -0,0 +1,106 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsRsaSigner + : AbstractTlsSigner + { + public override byte[] GenerateRawSignature(SignatureAndHashAlgorithm algorithm, + AsymmetricKeyParameter privateKey, byte[] hash) + { + ISigner signer = MakeSigner(algorithm, true, true, + new ParametersWithRandom(privateKey, this.mContext.SecureRandom)); + signer.BlockUpdate(hash, 0, hash.Length); + return signer.GenerateSignature(); + } + + public override bool VerifyRawSignature(SignatureAndHashAlgorithm algorithm, byte[] sigBytes, + AsymmetricKeyParameter publicKey, byte[] hash) + { + ISigner signer = MakeSigner(algorithm, true, false, publicKey); + signer.BlockUpdate(hash, 0, hash.Length); + return signer.VerifySignature(sigBytes); + } + + public override ISigner CreateSigner(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter privateKey) + { + return MakeSigner(algorithm, false, true, new ParametersWithRandom(privateKey, this.mContext.SecureRandom)); + } + + public override ISigner CreateVerifyer(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter publicKey) + { + return MakeSigner(algorithm, false, false, publicKey); + } + + public override bool IsValidPublicKey(AsymmetricKeyParameter publicKey) + { + return publicKey is RsaKeyParameters && !publicKey.IsPrivate; + } + + protected virtual ISigner MakeSigner(SignatureAndHashAlgorithm algorithm, bool raw, bool forSigning, + ICipherParameters cp) + { + if ((algorithm != null) != TlsUtilities.IsTlsV12(mContext)) + throw new InvalidOperationException(); + if (algorithm != null && algorithm.Signature != SignatureAlgorithm.rsa) + throw new InvalidOperationException(); + + IDigest d; + if (raw) + { + d = new NullDigest(); + } + else if (algorithm == null) + { + d = new CombinedHash(); + } + else + { + d = TlsUtilities.CreateHash(algorithm.Hash); + } + + ISigner s; + if (algorithm != null) + { + /* + * RFC 5246 4.7. In RSA signing, the opaque vector contains the signature generated + * using the RSASSA-PKCS1-v1_5 signature scheme defined in [PKCS1]. + */ + s = new RsaDigestSigner(d, TlsUtilities.GetOidForHashAlgorithm(algorithm.Hash)); + } + else + { + /* + * RFC 5246 4.7. Note that earlier versions of TLS used a different RSA signature scheme + * that did not include a DigestInfo encoding. + */ + s = new GenericSigner(CreateRsaImpl(), d); + } + s.Init(forSigning, cp); + return s; + } + + protected virtual IAsymmetricBlockCipher CreateRsaImpl() + { + /* + * RFC 5246 7.4.7.1. Implementation note: It is now known that remote timing-based attacks + * on TLS are possible, at least when the client and server are on the same LAN. + * Accordingly, implementations that use static RSA keys MUST use RSA blinding or some other + * anti-timing technique, as described in [TIMING]. + */ + return new Pkcs1Encoding(new RsaBlindedEngine()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaSigner.cs.meta new file mode 100644 index 00000000..499e8ec8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a72e29def0f52934882ba8417e892e72 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaUtilities.cs new file mode 100644 index 00000000..a3037ef1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaUtilities.cs @@ -0,0 +1,136 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class TlsRsaUtilities + { + /// + public static byte[] GenerateEncryptedPreMasterSecret(TlsContext context, RsaKeyParameters rsaServerPublicKey, + Stream output) + { + /* + * Choose a PremasterSecret and send it encrypted to the server + */ + byte[] premasterSecret = new byte[48]; + context.SecureRandom.NextBytes(premasterSecret); + TlsUtilities.WriteVersion(context.ClientVersion, premasterSecret, 0); + + Pkcs1Encoding encoding = new Pkcs1Encoding(new RsaBlindedEngine()); + encoding.Init(true, new ParametersWithRandom(rsaServerPublicKey, context.SecureRandom)); + + try + { + byte[] encryptedPreMasterSecret = encoding.ProcessBlock(premasterSecret, 0, premasterSecret.Length); + + if (TlsUtilities.IsSsl(context)) + { + // TODO Do any SSLv3 servers actually expect the length? + output.Write(encryptedPreMasterSecret, 0, encryptedPreMasterSecret.Length); + } + else + { + TlsUtilities.WriteOpaque16(encryptedPreMasterSecret, output); + } + } + catch (InvalidCipherTextException e) + { + /* + * This should never happen, only during decryption. + */ + throw new TlsFatalAlert(AlertDescription.internal_error, e); + } + + return premasterSecret; + } + + public static byte[] SafeDecryptPreMasterSecret(TlsContext context, RsaKeyParameters rsaServerPrivateKey, + byte[] encryptedPreMasterSecret) + { + /* + * RFC 5246 7.4.7.1. + */ + ProtocolVersion clientVersion = context.ClientVersion; + + // TODO Provide as configuration option? + bool versionNumberCheckDisabled = false; + + /* + * Generate 48 random bytes we can use as a Pre-Master-Secret, if the + * PKCS1 padding check should fail. + */ + byte[] fallback = new byte[48]; + context.SecureRandom.NextBytes(fallback); + + byte[] M = Arrays.Clone(fallback); + try + { + Pkcs1Encoding encoding = new Pkcs1Encoding(new RsaBlindedEngine(), fallback); + encoding.Init(false, + new ParametersWithRandom(rsaServerPrivateKey, context.SecureRandom)); + + M = encoding.ProcessBlock(encryptedPreMasterSecret, 0, encryptedPreMasterSecret.Length); + } + catch (Exception) + { + /* + * This should never happen since the decryption should never throw an exception + * and return a random value instead. + * + * In any case, a TLS server MUST NOT generate an alert if processing an + * RSA-encrypted premaster secret message fails, or the version number is not as + * expected. Instead, it MUST continue the handshake with a randomly generated + * premaster secret. + */ + } + + /* + * If ClientHello.client_version is TLS 1.1 or higher, server implementations MUST + * check the version number [..]. + */ + if (versionNumberCheckDisabled && clientVersion.IsEqualOrEarlierVersionOf(ProtocolVersion.TLSv10)) + { + /* + * If the version number is TLS 1.0 or earlier, server + * implementations SHOULD check the version number, but MAY have a + * configuration option to disable the check. + * + * So there is nothing to do here. + */ + } + else + { + /* + * OK, we need to compare the version number in the decrypted Pre-Master-Secret with the + * clientVersion received during the handshake. If they don't match, we replace the + * decrypted Pre-Master-Secret with a random one. + */ + int correct = (clientVersion.MajorVersion ^ (M[0] & 0xff)) + | (clientVersion.MinorVersion ^ (M[1] & 0xff)); + correct |= correct >> 1; + correct |= correct >> 2; + correct |= correct >> 4; + int mask = ~((correct & 1) - 1); + + /* + * mask will be all bits set to 0xff if the version number differed. + */ + for (int i = 0; i < 48; i++) + { + M[i] = (byte)((M[i] & (~mask)) | (fallback[i] & mask)); + } + } + return M; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaUtilities.cs.meta new file mode 100644 index 00000000..5e37d7cb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsRsaUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3c0c982c94b368040b889309c787f574 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServer.cs new file mode 100644 index 00000000..c1b952b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServer.cs @@ -0,0 +1,97 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsServer + : TlsPeer + { + void Init(TlsServerContext context); + + /// + void NotifyClientVersion(ProtocolVersion clientVersion); + + /// + void NotifyFallback(bool isFallback); + + /// + void NotifyOfferedCipherSuites(int[] offeredCipherSuites); + + /// + void NotifyOfferedCompressionMethods(byte[] offeredCompressionMethods); + + /// A (Int32 -> byte[]). Will never be null. + /// + void ProcessClientExtensions(IDictionary clientExtensions); + + /// + ProtocolVersion GetServerVersion(); + + /// + int GetSelectedCipherSuite(); + + /// + byte GetSelectedCompressionMethod(); + + /// + /// Get the (optional) table of server extensions to be included in (extended) server hello. + /// + /// + /// A (Int32 -> byte[]). May be null. + /// + /// + IDictionary GetServerExtensions(); + + /// + /// A (). May be null. + /// + /// + IList GetServerSupplementalData(); + + /// + TlsCredentials GetCredentials(); + + /// + /// This method will be called (only) if the server included an extension of type + /// "status_request" with empty "extension_data" in the extended server hello. See RFC 3546 + /// 3.6. Certificate Status Request. If a non-null is returned, it + /// is sent to the client as a handshake message of type "certificate_status". + /// + /// A to be sent to the client (or null for none). + /// + CertificateStatus GetCertificateStatus(); + + /// + TlsKeyExchange GetKeyExchange(); + + /// + CertificateRequest GetCertificateRequest(); + + /// () + /// + void ProcessClientSupplementalData(IList clientSupplementalData); + + /// + /// Called by the protocol handler to report the client certificate, only if GetCertificateRequest + /// returned non-null. + /// + /// Note: this method is responsible for certificate verification and validation. + /// the effective client certificate (may be an empty chain). + /// + void NotifyClientCertificate(Certificate clientCertificate); + + /// RFC 5077 3.3. NewSessionTicket Handshake Message. + /// + /// This method will be called (only) if a NewSessionTicket extension was sent by the server. See + /// RFC 5077 4. Recommended Ticket Construction for recommended format and protection. + /// + /// The ticket) + /// + NewSessionTicket GetNewSessionTicket(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServer.cs.meta new file mode 100644 index 00000000..8f3c8c67 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b4331fbbc8986049b27b67a94a7ce65 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContext.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContext.cs new file mode 100644 index 00000000..6739e651 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContext.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsServerContext + : TlsContext + { + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContext.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContext.cs.meta new file mode 100644 index 00000000..dba1e485 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5cc374d2521dd6147b68f1d913923b00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContextImpl.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContextImpl.cs new file mode 100644 index 00000000..fe779bdb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContextImpl.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal class TlsServerContextImpl + : AbstractTlsContext, TlsServerContext + { + internal TlsServerContextImpl(SecureRandom secureRandom, SecurityParameters securityParameters) + : base(secureRandom, securityParameters) + { + } + + public override bool IsServer + { + get { return true; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContextImpl.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContextImpl.cs.meta new file mode 100644 index 00000000..2d95118e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerContextImpl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 701947cdab669614f8cadfbe1fd9ac90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerProtocol.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerProtocol.cs new file mode 100644 index 00000000..8c6ca4e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerProtocol.cs @@ -0,0 +1,840 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsServerProtocol + : TlsProtocol + { + protected TlsServer mTlsServer = null; + internal TlsServerContextImpl mTlsServerContext = null; + + protected TlsKeyExchange mKeyExchange = null; + protected TlsCredentials mServerCredentials = null; + protected CertificateRequest mCertificateRequest = null; + + protected short mClientCertificateType = -1; + protected TlsHandshakeHash mPrepareFinishHash = null; + + /** + * Constructor for blocking mode. + * @param stream The bi-directional stream of data to/from the client + * @param output The stream of data to the client + * @param secureRandom Random number generator for various cryptographic functions + */ + public TlsServerProtocol(Stream stream, SecureRandom secureRandom) + : base(stream, secureRandom) + { + } + + /** + * Constructor for blocking mode. + * @param input The stream of data from the client + * @param output The stream of data to the client + * @param secureRandom Random number generator for various cryptographic functions + */ + public TlsServerProtocol(Stream input, Stream output, SecureRandom secureRandom) + : base(input, output, secureRandom) + { + } + + /** + * Constructor for non-blocking mode.
+ *
+ * When data is received, use {@link #offerInput(java.nio.ByteBuffer)} to + * provide the received ciphertext, then use + * {@link #readInput(byte[], int, int)} to read the corresponding cleartext.
+ *
+ * Similarly, when data needs to be sent, use + * {@link #offerOutput(byte[], int, int)} to provide the cleartext, then use + * {@link #readOutput(byte[], int, int)} to get the corresponding + * ciphertext. + * + * @param secureRandom + * Random number generator for various cryptographic functions + */ + public TlsServerProtocol(SecureRandom secureRandom) + : base(secureRandom) + { + } + + /** + * Receives a TLS handshake in the role of server.
+ *
+ * In blocking mode, this will not return until the handshake is complete. + * In non-blocking mode, use {@link TlsPeer#notifyHandshakeComplete()} to + * receive a callback when the handshake is complete. + * + * @param tlsServer + * @throws IOException If in blocking mode and handshake was not successful. + */ + public virtual void Accept(TlsServer tlsServer) + { + if (tlsServer == null) + throw new ArgumentNullException("tlsServer"); + if (this.mTlsServer != null) + throw new InvalidOperationException("'Accept' can only be called once"); + + this.mTlsServer = tlsServer; + + this.mSecurityParameters = new SecurityParameters(); + this.mSecurityParameters.entity = ConnectionEnd.server; + + this.mTlsServerContext = new TlsServerContextImpl(mSecureRandom, mSecurityParameters); + + this.mSecurityParameters.serverRandom = CreateRandomBlock(tlsServer.ShouldUseGmtUnixTime(), + mTlsServerContext.NonceRandomGenerator); + + this.mTlsServer.Init(mTlsServerContext); + this.mRecordStream.Init(mTlsServerContext); + + this.mRecordStream.SetRestrictReadVersion(false); + + BlockForHandshake(); + } + + protected override void CleanupHandshake() + { + base.CleanupHandshake(); + + this.mKeyExchange = null; + this.mServerCredentials = null; + this.mCertificateRequest = null; + this.mPrepareFinishHash = null; + } + + protected override TlsContext Context + { + get { return mTlsServerContext; } + } + + internal override AbstractTlsContext ContextAdmin + { + get { return mTlsServerContext; } + } + + protected override TlsPeer Peer + { + get { return mTlsServer; } + } + + protected override void HandleHandshakeMessage(byte type, MemoryStream buf) + { + switch (type) + { + case HandshakeType.client_hello: + { + switch (this.mConnectionState) + { + case CS_START: + { + ReceiveClientHelloMessage(buf); + this.mConnectionState = CS_CLIENT_HELLO; + + SendServerHelloMessage(); + this.mConnectionState = CS_SERVER_HELLO; + + mRecordStream.NotifyHelloComplete(); + + IList serverSupplementalData = mTlsServer.GetServerSupplementalData(); + if (serverSupplementalData != null) + { + SendSupplementalDataMessage(serverSupplementalData); + } + this.mConnectionState = CS_SERVER_SUPPLEMENTAL_DATA; + + this.mKeyExchange = mTlsServer.GetKeyExchange(); + this.mKeyExchange.Init(Context); + + this.mServerCredentials = mTlsServer.GetCredentials(); + + Certificate serverCertificate = null; + + if (this.mServerCredentials == null) + { + this.mKeyExchange.SkipServerCredentials(); + } + else + { + this.mKeyExchange.ProcessServerCredentials(this.mServerCredentials); + + serverCertificate = this.mServerCredentials.Certificate; + SendCertificateMessage(serverCertificate); + } + this.mConnectionState = CS_SERVER_CERTIFICATE; + + // TODO[RFC 3546] Check whether empty certificates is possible, allowed, or excludes CertificateStatus + if (serverCertificate == null || serverCertificate.IsEmpty) + { + this.mAllowCertificateStatus = false; + } + + if (this.mAllowCertificateStatus) + { + CertificateStatus certificateStatus = mTlsServer.GetCertificateStatus(); + if (certificateStatus != null) + { + SendCertificateStatusMessage(certificateStatus); + } + } + + this.mConnectionState = CS_CERTIFICATE_STATUS; + + byte[] serverKeyExchange = this.mKeyExchange.GenerateServerKeyExchange(); + if (serverKeyExchange != null) + { + SendServerKeyExchangeMessage(serverKeyExchange); + } + this.mConnectionState = CS_SERVER_KEY_EXCHANGE; + + if (this.mServerCredentials != null) + { + this.mCertificateRequest = mTlsServer.GetCertificateRequest(); + if (this.mCertificateRequest != null) + { + if (TlsUtilities.IsTlsV12(Context) != (mCertificateRequest.SupportedSignatureAlgorithms != null)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + this.mKeyExchange.ValidateCertificateRequest(mCertificateRequest); + + SendCertificateRequestMessage(mCertificateRequest); + + TlsUtilities.TrackHashAlgorithms(this.mRecordStream.HandshakeHash, + this.mCertificateRequest.SupportedSignatureAlgorithms); + } + } + this.mConnectionState = CS_CERTIFICATE_REQUEST; + + SendServerHelloDoneMessage(); + this.mConnectionState = CS_SERVER_HELLO_DONE; + + this.mRecordStream.HandshakeHash.SealHashAlgorithms(); + + break; + } + case CS_END: + { + RefuseRenegotiation(); + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.supplemental_data: + { + switch (this.mConnectionState) + { + case CS_SERVER_HELLO_DONE: + { + mTlsServer.ProcessClientSupplementalData(ReadSupplementalDataMessage(buf)); + this.mConnectionState = CS_CLIENT_SUPPLEMENTAL_DATA; + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.certificate: + { + switch (this.mConnectionState) + { + case CS_SERVER_HELLO_DONE: + case CS_CLIENT_SUPPLEMENTAL_DATA: + { + if (mConnectionState < CS_CLIENT_SUPPLEMENTAL_DATA) + { + mTlsServer.ProcessClientSupplementalData(null); + } + + if (this.mCertificateRequest == null) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + ReceiveCertificateMessage(buf); + this.mConnectionState = CS_CLIENT_CERTIFICATE; + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.client_key_exchange: + { + switch (this.mConnectionState) + { + case CS_SERVER_HELLO_DONE: + case CS_CLIENT_SUPPLEMENTAL_DATA: + case CS_CLIENT_CERTIFICATE: + { + if (mConnectionState < CS_CLIENT_SUPPLEMENTAL_DATA) + { + mTlsServer.ProcessClientSupplementalData(null); + } + + if (mConnectionState < CS_CLIENT_CERTIFICATE) + { + if (this.mCertificateRequest == null) + { + this.mKeyExchange.SkipClientCredentials(); + } + else + { + if (TlsUtilities.IsTlsV12(Context)) + { + /* + * RFC 5246 If no suitable certificate is available, the client MUST Send a + * certificate message containing no certificates. + * + * NOTE: In previous RFCs, this was SHOULD instead of MUST. + */ + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + else if (TlsUtilities.IsSsl(Context)) + { + if (this.mPeerCertificate == null) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + else + { + NotifyClientCertificate(Certificate.EmptyChain); + } + } + } + + ReceiveClientKeyExchangeMessage(buf); + this.mConnectionState = CS_CLIENT_KEY_EXCHANGE; + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.certificate_verify: + { + switch (this.mConnectionState) + { + case CS_CLIENT_KEY_EXCHANGE: + { + /* + * RFC 5246 7.4.8 This message is only sent following a client certificate that has + * signing capability (i.e., all certificates except those containing fixed + * Diffie-Hellman parameters). + */ + if (!ExpectCertificateVerifyMessage()) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + ReceiveCertificateVerifyMessage(buf); + this.mConnectionState = CS_CERTIFICATE_VERIFY; + + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.finished: + { + switch (this.mConnectionState) + { + case CS_CLIENT_KEY_EXCHANGE: + case CS_CERTIFICATE_VERIFY: + { + if (mConnectionState < CS_CERTIFICATE_VERIFY && ExpectCertificateVerifyMessage()) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + ProcessFinishedMessage(buf); + this.mConnectionState = CS_CLIENT_FINISHED; + + if (this.mExpectSessionTicket) + { + SendNewSessionTicketMessage(mTlsServer.GetNewSessionTicket()); + } + this.mConnectionState = CS_SERVER_SESSION_TICKET; + + SendChangeCipherSpecMessage(); + SendFinishedMessage(); + this.mConnectionState = CS_SERVER_FINISHED; + + CompleteHandshake(); + break; + } + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + break; + } + case HandshakeType.hello_request: + case HandshakeType.hello_verify_request: + case HandshakeType.server_hello: + case HandshakeType.server_key_exchange: + case HandshakeType.certificate_request: + case HandshakeType.server_hello_done: + case HandshakeType.session_ticket: + default: + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + } + + protected override void HandleAlertWarningMessage(byte alertDescription) + { + base.HandleAlertWarningMessage(alertDescription); + + switch (alertDescription) + { + case AlertDescription.no_certificate: + { + /* + * SSL 3.0 If the server has sent a certificate request Message, the client must send + * either the certificate message or a no_certificate alert. + */ + if (TlsUtilities.IsSsl(Context) && this.mCertificateRequest != null) + { + switch (this.mConnectionState) + { + case CS_SERVER_HELLO_DONE: + case CS_CLIENT_SUPPLEMENTAL_DATA: + { + if (mConnectionState < CS_CLIENT_SUPPLEMENTAL_DATA) + { + mTlsServer.ProcessClientSupplementalData(null); + } + + NotifyClientCertificate(Certificate.EmptyChain); + this.mConnectionState = CS_CLIENT_CERTIFICATE; + return; + } + } + } + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + } + } + + protected virtual void NotifyClientCertificate(Certificate clientCertificate) + { + if (mCertificateRequest == null) + throw new InvalidOperationException(); + if (mPeerCertificate != null) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + + this.mPeerCertificate = clientCertificate; + + if (clientCertificate.IsEmpty) + { + this.mKeyExchange.SkipClientCredentials(); + } + else + { + + /* + * TODO RFC 5246 7.4.6. If the certificate_authorities list in the certificate request + * message was non-empty, one of the certificates in the certificate chain SHOULD be + * issued by one of the listed CAs. + */ + + this.mClientCertificateType = TlsUtilities.GetClientCertificateType(clientCertificate, + this.mServerCredentials.Certificate); + + this.mKeyExchange.ProcessClientCertificate(clientCertificate); + } + + /* + * RFC 5246 7.4.6. If the client does not Send any certificates, the server MAY at its + * discretion either continue the handshake without client authentication, or respond with a + * fatal handshake_failure alert. Also, if some aspect of the certificate chain was + * unacceptable (e.g., it was not signed by a known, trusted CA), the server MAY at its + * discretion either continue the handshake (considering the client unauthenticated) or Send + * a fatal alert. + */ + this.mTlsServer.NotifyClientCertificate(clientCertificate); + } + + protected virtual void ReceiveCertificateMessage(MemoryStream buf) + { + Certificate clientCertificate = Certificate.Parse(buf); + + AssertEmpty(buf); + + NotifyClientCertificate(clientCertificate); + } + + protected virtual void ReceiveCertificateVerifyMessage(MemoryStream buf) + { + if (mCertificateRequest == null) + throw new InvalidOperationException(); + + DigitallySigned clientCertificateVerify = DigitallySigned.Parse(Context, buf); + + AssertEmpty(buf); + + // Verify the CertificateVerify message contains a correct signature. + try + { + SignatureAndHashAlgorithm signatureAlgorithm = clientCertificateVerify.Algorithm; + + byte[] hash; + if (TlsUtilities.IsTlsV12(Context)) + { + TlsUtilities.VerifySupportedSignatureAlgorithm(mCertificateRequest.SupportedSignatureAlgorithms, signatureAlgorithm); + hash = mPrepareFinishHash.GetFinalHash(signatureAlgorithm.Hash); + } + else + { + hash = mSecurityParameters.SessionHash; + } + + X509CertificateStructure x509Cert = mPeerCertificate.GetCertificateAt(0); + SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo; + AsymmetricKeyParameter publicKey = PublicKeyFactory.CreateKey(keyInfo); + + TlsSigner tlsSigner = TlsUtilities.CreateTlsSigner((byte)mClientCertificateType); + tlsSigner.Init(Context); + if (!tlsSigner.VerifyRawSignature(signatureAlgorithm, clientCertificateVerify.Signature, publicKey, hash)) + throw new TlsFatalAlert(AlertDescription.decrypt_error); + } + catch (TlsFatalAlert e) + { + throw e; + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.decrypt_error, e); + } + } + + protected virtual void ReceiveClientHelloMessage(MemoryStream buf) + { + ProtocolVersion client_version = TlsUtilities.ReadVersion(buf); + mRecordStream.SetWriteVersion(client_version); + + if (client_version.IsDtls) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + byte[] client_random = TlsUtilities.ReadFully(32, buf); + + /* + * TODO RFC 5077 3.4. If a ticket is presented by the client, the server MUST NOT attempt to + * use the Session ID in the ClientHello for stateful session resumption. + */ + byte[] sessionID = TlsUtilities.ReadOpaque8(buf); + if (sessionID.Length > 32) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + /* + * TODO RFC 5246 7.4.1.2. If the session_id field is not empty (implying a session + * resumption request), this vector MUST include at least the cipher_suite from that + * session. + */ + int cipher_suites_length = TlsUtilities.ReadUint16(buf); + if (cipher_suites_length < 2 || (cipher_suites_length & 1) != 0) + throw new TlsFatalAlert(AlertDescription.decode_error); + + this.mOfferedCipherSuites = TlsUtilities.ReadUint16Array(cipher_suites_length / 2, buf); + + /* + * TODO RFC 5246 7.4.1.2. If the session_id field is not empty (implying a session + * resumption request), it MUST include the compression_method from that session. + */ + int compression_methods_length = TlsUtilities.ReadUint8(buf); + if (compression_methods_length < 1) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + + this.mOfferedCompressionMethods = TlsUtilities.ReadUint8Array(compression_methods_length, buf); + + /* + * TODO RFC 3546 2.3 If [...] the older session is resumed, then the server MUST ignore + * extensions appearing in the client hello, and Send a server hello containing no + * extensions. + */ + this.mClientExtensions = ReadExtensions(buf); + + /* + * TODO[resumption] Check RFC 7627 5.4. for required behaviour + */ + + /* + * RFC 7627 4. Clients and servers SHOULD NOT accept handshakes that do not use the extended + * master secret [..]. (and see 5.2, 5.3) + */ + this.mSecurityParameters.extendedMasterSecret = TlsExtensionsUtilities.HasExtendedMasterSecretExtension(mClientExtensions); + if (!mSecurityParameters.IsExtendedMasterSecret && mTlsServer.RequiresExtendedMasterSecret()) + { + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + + ContextAdmin.SetClientVersion(client_version); + + mTlsServer.NotifyClientVersion(client_version); + mTlsServer.NotifyFallback(Arrays.Contains(mOfferedCipherSuites, CipherSuite.TLS_FALLBACK_SCSV)); + + mSecurityParameters.clientRandom = client_random; + + mTlsServer.NotifyOfferedCipherSuites(mOfferedCipherSuites); + mTlsServer.NotifyOfferedCompressionMethods(mOfferedCompressionMethods); + + /* + * RFC 5746 3.6. Server Behavior: Initial Handshake + */ + { + /* + * RFC 5746 3.4. The client MUST include either an empty "renegotiation_info" extension, + * or the TLS_EMPTY_RENEGOTIATION_INFO_SCSV signaling cipher suite value in the + * ClientHello. Including both is NOT RECOMMENDED. + */ + + /* + * When a ClientHello is received, the server MUST check if it includes the + * TLS_EMPTY_RENEGOTIATION_INFO_SCSV SCSV. If it does, set the secure_renegotiation flag + * to TRUE. + */ + if (Arrays.Contains(mOfferedCipherSuites, CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) + { + this.mSecureRenegotiation = true; + } + + /* + * The server MUST check if the "renegotiation_info" extension is included in the + * ClientHello. + */ + byte[] renegExtData = TlsUtilities.GetExtensionData(mClientExtensions, ExtensionType.renegotiation_info); + if (renegExtData != null) + { + /* + * If the extension is present, set secure_renegotiation flag to TRUE. The + * server MUST then verify that the length of the "renegotiated_connection" + * field is zero, and if it is not, MUST abort the handshake. + */ + this.mSecureRenegotiation = true; + + if (!Arrays.ConstantTimeAreEqual(renegExtData, CreateRenegotiationInfo(TlsUtilities.EmptyBytes))) + throw new TlsFatalAlert(AlertDescription.handshake_failure); + } + } + + mTlsServer.NotifySecureRenegotiation(this.mSecureRenegotiation); + + if (mClientExtensions != null) + { + // NOTE: Validates the padding extension data, if present + TlsExtensionsUtilities.GetPaddingExtension(mClientExtensions); + + mTlsServer.ProcessClientExtensions(mClientExtensions); + } + } + + protected virtual void ReceiveClientKeyExchangeMessage(MemoryStream buf) + { + mKeyExchange.ProcessClientKeyExchange(buf); + + AssertEmpty(buf); + + if (TlsUtilities.IsSsl(Context)) + { + EstablishMasterSecret(Context, mKeyExchange); + } + + this.mPrepareFinishHash = mRecordStream.PrepareToFinish(); + this.mSecurityParameters.sessionHash = GetCurrentPrfHash(Context, mPrepareFinishHash, null); + + if (!TlsUtilities.IsSsl(Context)) + { + EstablishMasterSecret(Context, mKeyExchange); + } + + mRecordStream.SetPendingConnectionState(Peer.GetCompression(), Peer.GetCipher()); + } + + protected virtual void SendCertificateRequestMessage(CertificateRequest certificateRequest) + { + HandshakeMessage message = new HandshakeMessage(HandshakeType.certificate_request); + + certificateRequest.Encode(message); + + message.WriteToRecordStream(this); + } + + protected virtual void SendCertificateStatusMessage(CertificateStatus certificateStatus) + { + HandshakeMessage message = new HandshakeMessage(HandshakeType.certificate_status); + + certificateStatus.Encode(message); + + message.WriteToRecordStream(this); + } + + protected virtual void SendNewSessionTicketMessage(NewSessionTicket newSessionTicket) + { + if (newSessionTicket == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + HandshakeMessage message = new HandshakeMessage(HandshakeType.session_ticket); + + newSessionTicket.Encode(message); + + message.WriteToRecordStream(this); + } + + protected virtual void SendServerHelloMessage() + { + HandshakeMessage message = new HandshakeMessage(HandshakeType.server_hello); + + { + ProtocolVersion server_version = mTlsServer.GetServerVersion(); + if (!server_version.IsEqualOrEarlierVersionOf(Context.ClientVersion)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + mRecordStream.ReadVersion = server_version; + mRecordStream.SetWriteVersion(server_version); + mRecordStream.SetRestrictReadVersion(true); + ContextAdmin.SetServerVersion(server_version); + + TlsUtilities.WriteVersion(server_version, message); + } + + message.Write(this.mSecurityParameters.serverRandom); + + /* + * The server may return an empty session_id to indicate that the session will not be cached + * and therefore cannot be resumed. + */ + TlsUtilities.WriteOpaque8(TlsUtilities.EmptyBytes, message); + + int selectedCipherSuite = mTlsServer.GetSelectedCipherSuite(); + if (!Arrays.Contains(mOfferedCipherSuites, selectedCipherSuite) + || selectedCipherSuite == CipherSuite.TLS_NULL_WITH_NULL_NULL + || CipherSuite.IsScsv(selectedCipherSuite) + || !TlsUtilities.IsValidCipherSuiteForVersion(selectedCipherSuite, Context.ServerVersion)) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + mSecurityParameters.cipherSuite = selectedCipherSuite; + + byte selectedCompressionMethod = mTlsServer.GetSelectedCompressionMethod(); + if (!Arrays.Contains(mOfferedCompressionMethods, selectedCompressionMethod)) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + mSecurityParameters.compressionAlgorithm = selectedCompressionMethod; + + TlsUtilities.WriteUint16(selectedCipherSuite, message); + TlsUtilities.WriteUint8(selectedCompressionMethod, message); + + this.mServerExtensions = TlsExtensionsUtilities.EnsureExtensionsInitialised(mTlsServer.GetServerExtensions()); + + /* + * RFC 5746 3.6. Server Behavior: Initial Handshake + */ + if (this.mSecureRenegotiation) + { + byte[] renegExtData = TlsUtilities.GetExtensionData(this.mServerExtensions, ExtensionType.renegotiation_info); + bool noRenegExt = (null == renegExtData); + + if (noRenegExt) + { + /* + * Note that Sending a "renegotiation_info" extension in response to a ClientHello + * containing only the SCSV is an explicit exception to the prohibition in RFC 5246, + * Section 7.4.1.4, on the server Sending unsolicited extensions and is only allowed + * because the client is signaling its willingness to receive the extension via the + * TLS_EMPTY_RENEGOTIATION_INFO_SCSV SCSV. + */ + + /* + * If the secure_renegotiation flag is set to TRUE, the server MUST include an empty + * "renegotiation_info" extension in the ServerHello message. + */ + this.mServerExtensions[ExtensionType.renegotiation_info] = CreateRenegotiationInfo(TlsUtilities.EmptyBytes); + } + } + + if (TlsUtilities.IsSsl(mTlsServerContext)) + { + mSecurityParameters.extendedMasterSecret = false; + } + else if (mSecurityParameters.IsExtendedMasterSecret) + { + TlsExtensionsUtilities.AddExtendedMasterSecretExtension(mServerExtensions); + } + + /* + * TODO RFC 3546 2.3 If [...] the older session is resumed, then the server MUST ignore + * extensions appearing in the client hello, and Send a server hello containing no + * extensions. + */ + + if (this.mServerExtensions.Count > 0) + { + this.mSecurityParameters.encryptThenMac = TlsExtensionsUtilities.HasEncryptThenMacExtension(mServerExtensions); + + this.mSecurityParameters.maxFragmentLength = ProcessMaxFragmentLengthExtension(mClientExtensions, + mServerExtensions, AlertDescription.internal_error); + + this.mSecurityParameters.truncatedHMac = TlsExtensionsUtilities.HasTruncatedHMacExtension(mServerExtensions); + + /* + * TODO It's surprising that there's no provision to allow a 'fresh' CertificateStatus to be sent in + * a session resumption handshake. + */ + this.mAllowCertificateStatus = !mResumedSession + && TlsUtilities.HasExpectedEmptyExtensionData(mServerExtensions, ExtensionType.status_request, + AlertDescription.internal_error); + + this.mExpectSessionTicket = !mResumedSession + && TlsUtilities.HasExpectedEmptyExtensionData(mServerExtensions, ExtensionType.session_ticket, + AlertDescription.internal_error); + + WriteExtensions(message, this.mServerExtensions); + } + + mSecurityParameters.prfAlgorithm = GetPrfAlgorithm(Context, mSecurityParameters.CipherSuite); + + /* + * RFC 5246 7.4.9. Any cipher suite which does not explicitly specify verify_data_length has + * a verify_data_length equal to 12. This includes all existing cipher suites. + */ + mSecurityParameters.verifyDataLength = 12; + + ApplyMaxFragmentLengthExtension(); + + message.WriteToRecordStream(this); + } + + protected virtual void SendServerHelloDoneMessage() + { + byte[] message = new byte[4]; + TlsUtilities.WriteUint8(HandshakeType.server_hello_done, message, 0); + TlsUtilities.WriteUint24(0, message, 1); + + WriteHandshakeMessage(message, 0, message.Length); + } + + protected virtual void SendServerKeyExchangeMessage(byte[] serverKeyExchange) + { + HandshakeMessage message = new HandshakeMessage(HandshakeType.server_key_exchange, serverKeyExchange.Length); + + message.Write(serverKeyExchange); + + message.WriteToRecordStream(this); + } + + protected virtual bool ExpectCertificateVerifyMessage() + { + return mClientCertificateType >= 0 && TlsUtilities.HasSigningCapability((byte)mClientCertificateType); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerProtocol.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerProtocol.cs.meta new file mode 100644 index 00000000..a9dd3c24 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsServerProtocol.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3aa250d422c64a84c8e61b61b19b8153 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSession.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSession.cs new file mode 100644 index 00000000..37029993 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSession.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsSession + { + SessionParameters ExportSessionParameters(); + + byte[] SessionID { get; } + + void Invalidate(); + + bool IsResumable { get; } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSession.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSession.cs.meta new file mode 100644 index 00000000..d2dabf02 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSession.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f1d9fbb6b810af4795034160469ac96 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSessionImpl.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSessionImpl.cs new file mode 100644 index 00000000..be6d7506 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSessionImpl.cs @@ -0,0 +1,55 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal class TlsSessionImpl + : TlsSession + { + internal readonly byte[] mSessionID; + internal readonly SessionParameters mSessionParameters; + internal bool mResumable; + + internal TlsSessionImpl(byte[] sessionID, SessionParameters sessionParameters) + { + if (sessionID == null) + throw new ArgumentNullException("sessionID"); + if (sessionID.Length > 32) + throw new ArgumentException("cannot be longer than 32 bytes", "sessionID"); + + this.mSessionID = Arrays.Clone(sessionID); + this.mSessionParameters = sessionParameters; + this.mResumable = sessionID.Length > 0 + && null != sessionParameters + && sessionParameters.IsExtendedMasterSecret; + } + + public virtual SessionParameters ExportSessionParameters() + { + lock (this) + { + return this.mSessionParameters == null ? null : this.mSessionParameters.Copy(); + } + } + + public virtual byte[] SessionID + { + get { lock (this) return mSessionID; } + } + + public virtual void Invalidate() + { + lock (this) this.mResumable = false; + } + + public virtual bool IsResumable + { + get { lock (this) return mResumable; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSessionImpl.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSessionImpl.cs.meta new file mode 100644 index 00000000..feba1601 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSessionImpl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a838e66fd7fe8b4c816147b77fbf9a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSigner.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSigner.cs new file mode 100644 index 00000000..55e95969 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSigner.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsSigner + { + void Init(TlsContext context); + + byte[] GenerateRawSignature(AsymmetricKeyParameter privateKey, byte[] md5AndSha1); + + byte[] GenerateRawSignature(SignatureAndHashAlgorithm algorithm, + AsymmetricKeyParameter privateKey, byte[] hash); + + bool VerifyRawSignature(byte[] sigBytes, AsymmetricKeyParameter publicKey, byte[] md5AndSha1); + + bool VerifyRawSignature(SignatureAndHashAlgorithm algorithm, byte[] sigBytes, + AsymmetricKeyParameter publicKey, byte[] hash); + + ISigner CreateSigner(AsymmetricKeyParameter privateKey); + + ISigner CreateSigner(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter privateKey); + + ISigner CreateVerifyer(AsymmetricKeyParameter publicKey); + + ISigner CreateVerifyer(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter publicKey); + + bool IsValidPublicKey(AsymmetricKeyParameter publicKey); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSigner.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSigner.cs.meta new file mode 100644 index 00000000..0ed282a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSigner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 843bc529cfcb8b042bc162b6439803f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSignerCredentials.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSignerCredentials.cs new file mode 100644 index 00000000..ff6fbecc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSignerCredentials.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsSignerCredentials + : TlsCredentials + { + /// + byte[] GenerateCertificateSignature(byte[] hash); + + SignatureAndHashAlgorithm SignatureAndHashAlgorithm { get; } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSignerCredentials.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSignerCredentials.cs.meta new file mode 100644 index 00000000..57ae8222 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSignerCredentials.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 295e93e4b17fd484caf7f2bca75cdfb3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpGroupVerifier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpGroupVerifier.cs new file mode 100644 index 00000000..c412e987 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpGroupVerifier.cs @@ -0,0 +1,21 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsSrpGroupVerifier + { + /** + * Check whether the given SRP group parameters are acceptable for use. + * + * @param group the {@link SRP6GroupParameters} to check + * @return true if (and only if) the specified group parameters are acceptable + */ + bool Accept(Srp6GroupParameters group); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpGroupVerifier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpGroupVerifier.cs.meta new file mode 100644 index 00000000..9e458656 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpGroupVerifier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ad1ba4cc1cc7fc458b759a5eea91e1e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpIdentityManager.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpIdentityManager.cs new file mode 100644 index 00000000..0b0c2ba6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpIdentityManager.cs @@ -0,0 +1,25 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public interface TlsSrpIdentityManager + { + /** + * Lookup the {@link TlsSRPLoginParameters} corresponding to the specified identity. + * + * NOTE: To avoid "identity probing", unknown identities SHOULD be handled as recommended in RFC + * 5054 2.5.1.3. {@link SimulatedTlsSRPIdentityManager} is provided for this purpose. + * + * @param identity + * the SRP identity sent by the connecting client + * @return the {@link TlsSRPLoginParameters} for the specified identity, or else 'simulated' + * parameters if the identity is not recognized. A null value is also allowed, but not + * recommended. + */ + TlsSrpLoginParameters GetLoginParameters(byte[] identity); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpIdentityManager.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpIdentityManager.cs.meta new file mode 100644 index 00000000..545848e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpIdentityManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31eb821af7f529f42aaf159e0c22d747 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpKeyExchange.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpKeyExchange.cs new file mode 100644 index 00000000..17f66884 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpKeyExchange.cs @@ -0,0 +1,289 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Srp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// (D)TLS SRP key exchange (RFC 5054). + public class TlsSrpKeyExchange + : AbstractTlsKeyExchange + { + protected static TlsSigner CreateSigner(int keyExchange) + { + switch (keyExchange) + { + case KeyExchangeAlgorithm.SRP: + return null; + case KeyExchangeAlgorithm.SRP_RSA: + return new TlsRsaSigner(); + case KeyExchangeAlgorithm.SRP_DSS: + return new TlsDssSigner(); + default: + throw new ArgumentException("unsupported key exchange algorithm"); + } + } + + protected TlsSigner mTlsSigner; + protected TlsSrpGroupVerifier mGroupVerifier; + protected byte[] mIdentity; + protected byte[] mPassword; + + protected AsymmetricKeyParameter mServerPublicKey = null; + + protected Srp6GroupParameters mSrpGroup = null; + protected Srp6Client mSrpClient = null; + protected Srp6Server mSrpServer = null; + protected BigInteger mSrpPeerCredentials = null; + protected BigInteger mSrpVerifier = null; + protected byte[] mSrpSalt = null; + + protected TlsSignerCredentials mServerCredentials = null; + + [Obsolete("Use constructor taking an explicit 'groupVerifier' argument")] + public TlsSrpKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, byte[] identity, byte[] password) + : this(keyExchange, supportedSignatureAlgorithms, new DefaultTlsSrpGroupVerifier(), identity, password) + { + } + + public TlsSrpKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, TlsSrpGroupVerifier groupVerifier, + byte[] identity, byte[] password) + : base(keyExchange, supportedSignatureAlgorithms) + { + this.mTlsSigner = CreateSigner(keyExchange); + this.mGroupVerifier = groupVerifier; + this.mIdentity = identity; + this.mPassword = password; + this.mSrpClient = new Srp6Client(); + } + + public TlsSrpKeyExchange(int keyExchange, IList supportedSignatureAlgorithms, byte[] identity, + TlsSrpLoginParameters loginParameters) + : base(keyExchange, supportedSignatureAlgorithms) + { + this.mTlsSigner = CreateSigner(keyExchange); + this.mIdentity = identity; + this.mSrpServer = new Srp6Server(); + this.mSrpGroup = loginParameters.Group; + this.mSrpVerifier = loginParameters.Verifier; + this.mSrpSalt = loginParameters.Salt; + } + + public override void Init(TlsContext context) + { + base.Init(context); + + if (this.mTlsSigner != null) + { + this.mTlsSigner.Init(context); + } + } + + public override void SkipServerCredentials() + { + if (mTlsSigner != null) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public override void ProcessServerCertificate(Certificate serverCertificate) + { + if (mTlsSigner == null) + throw new TlsFatalAlert(AlertDescription.unexpected_message); + if (serverCertificate.IsEmpty) + throw new TlsFatalAlert(AlertDescription.bad_certificate); + + X509CertificateStructure x509Cert = serverCertificate.GetCertificateAt(0); + + SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo; + try + { + this.mServerPublicKey = PublicKeyFactory.CreateKey(keyInfo); + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.unsupported_certificate, e); + } + + if (!mTlsSigner.IsValidPublicKey(this.mServerPublicKey)) + throw new TlsFatalAlert(AlertDescription.certificate_unknown); + + TlsUtilities.ValidateKeyUsage(x509Cert, KeyUsage.DigitalSignature); + + base.ProcessServerCertificate(serverCertificate); + } + + public override void ProcessServerCredentials(TlsCredentials serverCredentials) + { + if ((mKeyExchange == KeyExchangeAlgorithm.SRP) || !(serverCredentials is TlsSignerCredentials)) + throw new TlsFatalAlert(AlertDescription.internal_error); + + ProcessServerCertificate(serverCredentials.Certificate); + + this.mServerCredentials = (TlsSignerCredentials)serverCredentials; + } + + public override bool RequiresServerKeyExchange + { + get { return true; } + } + + public override byte[] GenerateServerKeyExchange() + { + mSrpServer.Init(mSrpGroup, mSrpVerifier, TlsUtilities.CreateHash(HashAlgorithm.sha1), mContext.SecureRandom); + BigInteger B = mSrpServer.GenerateServerCredentials(); + + ServerSrpParams srpParams = new ServerSrpParams(mSrpGroup.N, mSrpGroup.G, mSrpSalt, B); + + DigestInputBuffer buf = new DigestInputBuffer(); + + srpParams.Encode(buf); + + if (mServerCredentials != null) + { + /* + * RFC 5246 4.7. digitally-signed element needs SignatureAndHashAlgorithm from TLS 1.2 + */ + SignatureAndHashAlgorithm signatureAndHashAlgorithm = TlsUtilities.GetSignatureAndHashAlgorithm( + mContext, mServerCredentials); + + IDigest d = TlsUtilities.CreateHash(signatureAndHashAlgorithm); + + SecurityParameters securityParameters = mContext.SecurityParameters; + d.BlockUpdate(securityParameters.clientRandom, 0, securityParameters.clientRandom.Length); + d.BlockUpdate(securityParameters.serverRandom, 0, securityParameters.serverRandom.Length); + buf.UpdateDigest(d); + + byte[] hash = new byte[d.GetDigestSize()]; + d.DoFinal(hash, 0); + + byte[] signature = mServerCredentials.GenerateCertificateSignature(hash); + + DigitallySigned signed_params = new DigitallySigned(signatureAndHashAlgorithm, signature); + signed_params.Encode(buf); + } + + return buf.ToArray(); + } + + public override void ProcessServerKeyExchange(Stream input) + { + SecurityParameters securityParameters = mContext.SecurityParameters; + + SignerInputBuffer buf = null; + Stream teeIn = input; + + if (mTlsSigner != null) + { + buf = new SignerInputBuffer(); + teeIn = new TeeInputStream(input, buf); + } + + ServerSrpParams srpParams = ServerSrpParams.Parse(teeIn); + + if (buf != null) + { + DigitallySigned signed_params = ParseSignature(input); + + ISigner signer = InitVerifyer(mTlsSigner, signed_params.Algorithm, securityParameters); + buf.UpdateSigner(signer); + if (!signer.VerifySignature(signed_params.Signature)) + throw new TlsFatalAlert(AlertDescription.decrypt_error); + } + + this.mSrpGroup = new Srp6GroupParameters(srpParams.N, srpParams.G); + + if (!mGroupVerifier.Accept(mSrpGroup)) + throw new TlsFatalAlert(AlertDescription.insufficient_security); + + this.mSrpSalt = srpParams.S; + + /* + * RFC 5054 2.5.3: The client MUST abort the handshake with an "illegal_parameter" alert if + * B % N = 0. + */ + try + { + this.mSrpPeerCredentials = Srp6Utilities.ValidatePublicValue(mSrpGroup.N, srpParams.B); + } + catch (CryptoException e) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter, e); + } + + this.mSrpClient.Init(mSrpGroup, TlsUtilities.CreateHash(HashAlgorithm.sha1), mContext.SecureRandom); + } + + public override void ValidateCertificateRequest(CertificateRequest certificateRequest) + { + throw new TlsFatalAlert(AlertDescription.unexpected_message); + } + + public override void ProcessClientCredentials(TlsCredentials clientCredentials) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public override void GenerateClientKeyExchange(Stream output) + { + BigInteger A = mSrpClient.GenerateClientCredentials(mSrpSalt, mIdentity, mPassword); + TlsSrpUtilities.WriteSrpParameter(A, output); + + mContext.SecurityParameters.srpIdentity = Arrays.Clone(mIdentity); + } + + public override void ProcessClientKeyExchange(Stream input) + { + /* + * RFC 5054 2.5.4: The server MUST abort the handshake with an "illegal_parameter" alert if + * A % N = 0. + */ + try + { + this.mSrpPeerCredentials = Srp6Utilities.ValidatePublicValue(mSrpGroup.N, TlsSrpUtilities.ReadSrpParameter(input)); + } + catch (CryptoException e) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter, e); + } + + mContext.SecurityParameters.srpIdentity = Arrays.Clone(mIdentity); + } + + public override byte[] GeneratePremasterSecret() + { + try + { + BigInteger S = mSrpServer != null + ? mSrpServer.CalculateSecret(mSrpPeerCredentials) + : mSrpClient.CalculateSecret(mSrpPeerCredentials); + + // TODO Check if this needs to be a fixed size + return BigIntegers.AsUnsignedByteArray(S); + } + catch (CryptoException e) + { + throw new TlsFatalAlert(AlertDescription.illegal_parameter, e); + } + } + + protected virtual ISigner InitVerifyer(TlsSigner tlsSigner, SignatureAndHashAlgorithm algorithm, + SecurityParameters securityParameters) + { + ISigner signer = tlsSigner.CreateVerifyer(algorithm, this.mServerPublicKey); + signer.BlockUpdate(securityParameters.clientRandom, 0, securityParameters.clientRandom.Length); + signer.BlockUpdate(securityParameters.serverRandom, 0, securityParameters.serverRandom.Length); + return signer; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpKeyExchange.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpKeyExchange.cs.meta new file mode 100644 index 00000000..3c4d7dcc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpKeyExchange.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2159efcf61fc19348b1c0301596684a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpLoginParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpLoginParameters.cs new file mode 100644 index 00000000..5b7d1375 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpLoginParameters.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsSrpLoginParameters + { + protected readonly Srp6GroupParameters mGroup; + protected readonly BigInteger mVerifier; + protected readonly byte[] mSalt; + + public TlsSrpLoginParameters(Srp6GroupParameters group, BigInteger verifier, byte[] salt) + { + this.mGroup = group; + this.mVerifier = verifier; + this.mSalt = salt; + } + + public virtual Srp6GroupParameters Group + { + get { return mGroup; } + } + + public virtual byte[] Salt + { + get { return mSalt; } + } + + public virtual BigInteger Verifier + { + get { return mVerifier; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpLoginParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpLoginParameters.cs.meta new file mode 100644 index 00000000..ee605a4b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpLoginParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: add318e204ff5c64b808b8ddeae69e46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpUtilities.cs new file mode 100644 index 00000000..9fc75722 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpUtilities.cs @@ -0,0 +1,78 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public abstract class TlsSrpUtilities + { + public static void AddSrpExtension(IDictionary extensions, byte[] identity) + { + extensions[ExtensionType.srp] = CreateSrpExtension(identity); + } + + public static byte[] GetSrpExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.srp); + return extensionData == null ? null : ReadSrpExtension(extensionData); + } + + public static byte[] CreateSrpExtension(byte[] identity) + { + if (identity == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + + return TlsUtilities.EncodeOpaque8(identity); + } + + public static byte[] ReadSrpExtension(byte[] extensionData) + { + if (extensionData == null) + throw new ArgumentNullException("extensionData"); + + MemoryStream buf = new MemoryStream(extensionData, false); + byte[] identity = TlsUtilities.ReadOpaque8(buf); + + TlsProtocol.AssertEmpty(buf); + + return identity; + } + + public static BigInteger ReadSrpParameter(Stream input) + { + return new BigInteger(1, TlsUtilities.ReadOpaque16(input)); + } + + public static void WriteSrpParameter(BigInteger x, Stream output) + { + TlsUtilities.WriteOpaque16(BigIntegers.AsUnsignedByteArray(x), output); + } + + public static bool IsSrpCipherSuite(int cipherSuite) + { + switch (cipherSuite) + { + case CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA: + return true; + + default: + return false; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpUtilities.cs.meta new file mode 100644 index 00000000..135597df --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrpUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5f7b28a9617d5047ad3e2eac92146f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrtpUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrtpUtilities.cs new file mode 100644 index 00000000..36f9ed23 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrtpUtilities.cs @@ -0,0 +1,66 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * RFC 5764 DTLS Extension to Establish Keys for SRTP. + */ + public abstract class TlsSRTPUtils + { + public static void AddUseSrtpExtension(IDictionary extensions, UseSrtpData useSRTPData) + { + extensions[ExtensionType.use_srtp] = CreateUseSrtpExtension(useSRTPData); + } + + public static UseSrtpData GetUseSrtpExtension(IDictionary extensions) + { + byte[] extensionData = TlsUtilities.GetExtensionData(extensions, ExtensionType.use_srtp); + return extensionData == null ? null : ReadUseSrtpExtension(extensionData); + } + + public static byte[] CreateUseSrtpExtension(UseSrtpData useSrtpData) + { + if (useSrtpData == null) + throw new ArgumentNullException("useSrtpData"); + + MemoryStream buf = new MemoryStream(); + + // SRTPProtectionProfiles + TlsUtilities.WriteUint16ArrayWithUint16Length(useSrtpData.ProtectionProfiles, buf); + + // srtp_mki + TlsUtilities.WriteOpaque8(useSrtpData.Mki, buf); + + return buf.ToArray(); + } + + public static UseSrtpData ReadUseSrtpExtension(byte[] extensionData) + { + if (extensionData == null) + throw new ArgumentNullException("extensionData"); + + MemoryStream buf = new MemoryStream(extensionData, true); + + // SRTPProtectionProfiles + int length = TlsUtilities.ReadUint16(buf); + if (length < 2 || (length & 1) != 0) + { + throw new TlsFatalAlert(AlertDescription.decode_error); + } + int[] protectionProfiles = TlsUtilities.ReadUint16Array(length / 2, buf); + + // srtp_mki + byte[] mki = TlsUtilities.ReadOpaque8(buf); + + TlsProtocol.AssertEmpty(buf); + + return new UseSrtpData(protectionProfiles, mki); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrtpUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrtpUtilities.cs.meta new file mode 100644 index 00000000..b17862d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsSrtpUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 14024973a91fca6488b2e9432cd4f4ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStream.cs new file mode 100644 index 00000000..8e585c84 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStream.cs @@ -0,0 +1,101 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + internal class TlsStream + : Stream + { + private readonly TlsProtocol handler; + + internal TlsStream(TlsProtocol handler) + { + this.handler = handler; + } + + public override bool CanRead + { + get { return !handler.IsClosed; } + } + + public override bool CanSeek + { + get { return false; } + } + + public override bool CanWrite + { + get { return !handler.IsClosed; } + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + handler.Close(); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + handler.Close(); + base.Close(); + } +#endif + + public override void Flush() + { + handler.Flush(); + } + + public override long Length + { + get { throw new NotSupportedException(); } + } + + public override long Position + { + get { throw new NotSupportedException(); } + set { throw new NotSupportedException(); } + } + + public override int Read(byte[] buf, int off, int len) + { + return this.handler.ReadApplicationData(buf, off, len); + } + + public override int ReadByte() + { + byte[] buf = new byte[1]; + if (this.Read(buf, 0, 1) <= 0) + return -1; + return buf[0]; + } + + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotSupportedException(); + } + + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + public override void Write(byte[] buf, int off, int len) + { + this.handler.WriteData(buf, off, len); + } + + public override void WriteByte(byte b) + { + this.handler.WriteData(new byte[] { b }, 0, 1); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStream.cs.meta new file mode 100644 index 00000000..32e1107b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c787d53198668a4d92cdd44e5b92d41 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStreamCipher.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStreamCipher.cs new file mode 100644 index 00000000..269e30d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStreamCipher.cs @@ -0,0 +1,156 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + public class TlsStreamCipher + : TlsCipher + { + protected readonly TlsContext context; + + protected readonly IStreamCipher encryptCipher; + protected readonly IStreamCipher decryptCipher; + + protected readonly TlsMac writeMac; + protected readonly TlsMac readMac; + + protected readonly bool usesNonce; + + /// + public TlsStreamCipher(TlsContext context, IStreamCipher clientWriteCipher, + IStreamCipher serverWriteCipher, IDigest clientWriteDigest, IDigest serverWriteDigest, + int cipherKeySize, bool usesNonce) + { + bool isServer = context.IsServer; + + this.context = context; + this.usesNonce = usesNonce; + + this.encryptCipher = clientWriteCipher; + this.decryptCipher = serverWriteCipher; + + int key_block_size = (2 * cipherKeySize) + clientWriteDigest.GetDigestSize() + + serverWriteDigest.GetDigestSize(); + + byte[] key_block = TlsUtilities.CalculateKeyBlock(context, key_block_size); + + int offset = 0; + + // Init MACs + TlsMac clientWriteMac = new TlsMac(context, clientWriteDigest, key_block, offset, + clientWriteDigest.GetDigestSize()); + offset += clientWriteDigest.GetDigestSize(); + TlsMac serverWriteMac = new TlsMac(context, serverWriteDigest, key_block, offset, + serverWriteDigest.GetDigestSize()); + offset += serverWriteDigest.GetDigestSize(); + + // Build keys + KeyParameter clientWriteKey = new KeyParameter(key_block, offset, cipherKeySize); + offset += cipherKeySize; + KeyParameter serverWriteKey = new KeyParameter(key_block, offset, cipherKeySize); + offset += cipherKeySize; + + if (offset != key_block_size) + { + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + ICipherParameters encryptParams, decryptParams; + if (isServer) + { + this.writeMac = serverWriteMac; + this.readMac = clientWriteMac; + this.encryptCipher = serverWriteCipher; + this.decryptCipher = clientWriteCipher; + encryptParams = serverWriteKey; + decryptParams = clientWriteKey; + } + else + { + this.writeMac = clientWriteMac; + this.readMac = serverWriteMac; + this.encryptCipher = clientWriteCipher; + this.decryptCipher = serverWriteCipher; + encryptParams = clientWriteKey; + decryptParams = serverWriteKey; + } + + if (usesNonce) + { + byte[] dummyNonce = new byte[8]; + encryptParams = new ParametersWithIV(encryptParams, dummyNonce); + decryptParams = new ParametersWithIV(decryptParams, dummyNonce); + } + + this.encryptCipher.Init(true, encryptParams); + this.decryptCipher.Init(false, decryptParams); + } + + public virtual int GetPlaintextLimit(int ciphertextLimit) + { + return ciphertextLimit - writeMac.Size; + } + + public virtual byte[] EncodePlaintext(long seqNo, byte type, byte[] plaintext, int offset, int len) + { + if (usesNonce) + { + UpdateIV(encryptCipher, true, seqNo); + } + + byte[] outBuf = new byte[len + writeMac.Size]; + + encryptCipher.ProcessBytes(plaintext, offset, len, outBuf, 0); + + byte[] mac = writeMac.CalculateMac(seqNo, type, plaintext, offset, len); + encryptCipher.ProcessBytes(mac, 0, mac.Length, outBuf, len); + + return outBuf; + } + + /// + public virtual byte[] DecodeCiphertext(long seqNo, byte type, byte[] ciphertext, int offset, int len) + { + if (usesNonce) + { + UpdateIV(decryptCipher, false, seqNo); + } + + int macSize = readMac.Size; + if (len < macSize) + throw new TlsFatalAlert(AlertDescription.decode_error); + + int plaintextLength = len - macSize; + + byte[] deciphered = new byte[len]; + decryptCipher.ProcessBytes(ciphertext, offset, len, deciphered, 0); + CheckMac(seqNo, type, deciphered, plaintextLength, len, deciphered, 0, plaintextLength); + return Arrays.CopyOfRange(deciphered, 0, plaintextLength); + } + + /// + protected virtual void CheckMac(long seqNo, byte type, byte[] recBuf, int recStart, int recEnd, byte[] calcBuf, int calcOff, int calcLen) + { + byte[] receivedMac = Arrays.CopyOfRange(recBuf, recStart, recEnd); + byte[] computedMac = readMac.CalculateMac(seqNo, type, calcBuf, calcOff, calcLen); + + if (!Arrays.ConstantTimeAreEqual(receivedMac, computedMac)) + throw new TlsFatalAlert(AlertDescription.bad_record_mac); + } + + protected virtual void UpdateIV(IStreamCipher cipher, bool forEncryption, long seqNo) + { + byte[] nonce = new byte[8]; + TlsUtilities.WriteUint64(seqNo, nonce, 0); + cipher.Init(forEncryption, new ParametersWithIV(null, nonce)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStreamCipher.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStreamCipher.cs.meta new file mode 100644 index 00000000..331310bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsStreamCipher.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 695c981a9f3aa3348affbd5877a1aa91 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsUtilities.cs new file mode 100644 index 00000000..906c6c21 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsUtilities.cs @@ -0,0 +1,2405 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// Some helper functions for MicroTLS. + public abstract class TlsUtilities + { + public static readonly byte[] EmptyBytes = new byte[0]; + public static readonly short[] EmptyShorts = new short[0]; + public static readonly int[] EmptyInts = new int[0]; + public static readonly long[] EmptyLongs = new long[0]; + + public static void CheckUint8(int i) + { + if (!IsValidUint8(i)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public static void CheckUint8(long i) + { + if (!IsValidUint8(i)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public static void CheckUint16(int i) + { + if (!IsValidUint16(i)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public static void CheckUint16(long i) + { + if (!IsValidUint16(i)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public static void CheckUint24(int i) + { + if (!IsValidUint24(i)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public static void CheckUint24(long i) + { + if (!IsValidUint24(i)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public static void CheckUint32(long i) + { + if (!IsValidUint32(i)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public static void CheckUint48(long i) + { + if (!IsValidUint48(i)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public static void CheckUint64(long i) + { + if (!IsValidUint64(i)) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + + public static bool IsValidUint8(int i) + { + return (i & 0xFF) == i; + } + + public static bool IsValidUint8(long i) + { + return (i & 0xFFL) == i; + } + + public static bool IsValidUint16(int i) + { + return (i & 0xFFFF) == i; + } + + public static bool IsValidUint16(long i) + { + return (i & 0xFFFFL) == i; + } + + public static bool IsValidUint24(int i) + { + return (i & 0xFFFFFF) == i; + } + + public static bool IsValidUint24(long i) + { + return (i & 0xFFFFFFL) == i; + } + + public static bool IsValidUint32(long i) + { + return (i & 0xFFFFFFFFL) == i; + } + + public static bool IsValidUint48(long i) + { + return (i & 0xFFFFFFFFFFFFL) == i; + } + + public static bool IsValidUint64(long i) + { + return true; + } + + public static bool IsSsl(TlsContext context) + { + return context.ServerVersion.IsSsl; + } + + public static bool IsTlsV11(ProtocolVersion version) + { + return ProtocolVersion.TLSv11.IsEqualOrEarlierVersionOf(version.GetEquivalentTLSVersion()); + } + + public static bool IsTlsV11(TlsContext context) + { + return IsTlsV11(context.ServerVersion); + } + + public static bool IsTlsV12(ProtocolVersion version) + { + return ProtocolVersion.TLSv12.IsEqualOrEarlierVersionOf(version.GetEquivalentTLSVersion()); + } + + public static bool IsTlsV12(TlsContext context) + { + return IsTlsV12(context.ServerVersion); + } + + public static void WriteUint8(byte i, Stream output) + { + output.WriteByte(i); + } + + public static void WriteUint8(byte i, byte[] buf, int offset) + { + buf[offset] = i; + } + + public static void WriteUint16(int i, Stream output) + { + output.WriteByte((byte)(i >> 8)); + output.WriteByte((byte)i); + } + + public static void WriteUint16(int i, byte[] buf, int offset) + { + buf[offset] = (byte)(i >> 8); + buf[offset + 1] = (byte)i; + } + + public static void WriteUint24(int i, Stream output) + { + output.WriteByte((byte)(i >> 16)); + output.WriteByte((byte)(i >> 8)); + output.WriteByte((byte)i); + } + + public static void WriteUint24(int i, byte[] buf, int offset) + { + buf[offset] = (byte)(i >> 16); + buf[offset + 1] = (byte)(i >> 8); + buf[offset + 2] = (byte)i; + } + + public static void WriteUint32(long i, Stream output) + { + output.WriteByte((byte)(i >> 24)); + output.WriteByte((byte)(i >> 16)); + output.WriteByte((byte)(i >> 8)); + output.WriteByte((byte)i); + } + + public static void WriteUint32(long i, byte[] buf, int offset) + { + buf[offset] = (byte)(i >> 24); + buf[offset + 1] = (byte)(i >> 16); + buf[offset + 2] = (byte)(i >> 8); + buf[offset + 3] = (byte)i; + } + + public static void WriteUint48(long i, Stream output) + { + output.WriteByte((byte)(i >> 40)); + output.WriteByte((byte)(i >> 32)); + output.WriteByte((byte)(i >> 24)); + output.WriteByte((byte)(i >> 16)); + output.WriteByte((byte)(i >> 8)); + output.WriteByte((byte)i); + } + + public static void WriteUint48(long i, byte[] buf, int offset) + { + buf[offset] = (byte)(i >> 40); + buf[offset + 1] = (byte)(i >> 32); + buf[offset + 2] = (byte)(i >> 24); + buf[offset + 3] = (byte)(i >> 16); + buf[offset + 4] = (byte)(i >> 8); + buf[offset + 5] = (byte)i; + } + + public static void WriteUint64(long i, Stream output) + { + output.WriteByte((byte)(i >> 56)); + output.WriteByte((byte)(i >> 48)); + output.WriteByte((byte)(i >> 40)); + output.WriteByte((byte)(i >> 32)); + output.WriteByte((byte)(i >> 24)); + output.WriteByte((byte)(i >> 16)); + output.WriteByte((byte)(i >> 8)); + output.WriteByte((byte)i); + } + + public static void WriteUint64(long i, byte[] buf, int offset) + { + buf[offset] = (byte)(i >> 56); + buf[offset + 1] = (byte)(i >> 48); + buf[offset + 2] = (byte)(i >> 40); + buf[offset + 3] = (byte)(i >> 32); + buf[offset + 4] = (byte)(i >> 24); + buf[offset + 5] = (byte)(i >> 16); + buf[offset + 6] = (byte)(i >> 8); + buf[offset + 7] = (byte)i; + } + + public static void WriteOpaque8(byte[] buf, Stream output) + { + WriteUint8((byte)buf.Length, output); + output.Write(buf, 0, buf.Length); + } + + public static void WriteOpaque16(byte[] buf, Stream output) + { + WriteUint16(buf.Length, output); + output.Write(buf, 0, buf.Length); + } + + public static void WriteOpaque24(byte[] buf, Stream output) + { + WriteUint24(buf.Length, output); + output.Write(buf, 0, buf.Length); + } + + public static void WriteUint8Array(byte[] uints, Stream output) + { + output.Write(uints, 0, uints.Length); + } + + public static void WriteUint8Array(byte[] uints, byte[] buf, int offset) + { + for (int i = 0; i < uints.Length; ++i) + { + WriteUint8(uints[i], buf, offset); + ++offset; + } + } + + public static void WriteUint8ArrayWithUint8Length(byte[] uints, Stream output) + { + CheckUint8(uints.Length); + WriteUint8((byte)uints.Length, output); + WriteUint8Array(uints, output); + } + + public static void WriteUint8ArrayWithUint8Length(byte[] uints, byte[] buf, int offset) + { + CheckUint8(uints.Length); + WriteUint8((byte)uints.Length, buf, offset); + WriteUint8Array(uints, buf, offset + 1); + } + + public static void WriteUint16Array(int[] uints, Stream output) + { + for (int i = 0; i < uints.Length; ++i) + { + WriteUint16(uints[i], output); + } + } + + public static void WriteUint16Array(int[] uints, byte[] buf, int offset) + { + for (int i = 0; i < uints.Length; ++i) + { + WriteUint16(uints[i], buf, offset); + offset += 2; + } + } + + public static void WriteUint16ArrayWithUint16Length(int[] uints, Stream output) + { + int length = 2 * uints.Length; + CheckUint16(length); + WriteUint16(length, output); + WriteUint16Array(uints, output); + } + + public static void WriteUint16ArrayWithUint16Length(int[] uints, byte[] buf, int offset) + { + int length = 2 * uints.Length; + CheckUint16(length); + WriteUint16(length, buf, offset); + WriteUint16Array(uints, buf, offset + 2); + } + + public static byte DecodeUint8(byte[] buf) + { + if (buf == null) + throw new ArgumentNullException("buf"); + if (buf.Length != 1) + throw new TlsFatalAlert(AlertDescription.decode_error); + return ReadUint8(buf, 0); + } + + public static byte[] DecodeUint8ArrayWithUint8Length(byte[] buf) + { + if (buf == null) + throw new ArgumentNullException("buf"); + + int count = ReadUint8(buf, 0); + if (buf.Length != (count + 1)) + throw new TlsFatalAlert(AlertDescription.decode_error); + + byte[] uints = new byte[count]; + for (int i = 0; i < count; ++i) + { + uints[i] = ReadUint8(buf, i + 1); + } + return uints; + } + + public static byte[] EncodeOpaque8(byte[] buf) + { + CheckUint8(buf.Length); + return Arrays.Prepend(buf, (byte)buf.Length); + } + + public static byte[] EncodeUint8(byte val) + { + CheckUint8(val); + + byte[] extensionData = new byte[1]; + WriteUint8(val, extensionData, 0); + return extensionData; + } + + public static byte[] EncodeUint8ArrayWithUint8Length(byte[] uints) + { + byte[] result = new byte[1 + uints.Length]; + WriteUint8ArrayWithUint8Length(uints, result, 0); + return result; + } + + public static byte[] EncodeUint16ArrayWithUint16Length(int[] uints) + { + int length = 2 * uints.Length; + byte[] result = new byte[2 + length]; + WriteUint16ArrayWithUint16Length(uints, result, 0); + return result; + } + + public static byte ReadUint8(Stream input) + { + int i = input.ReadByte(); + if (i < 0) + throw new EndOfStreamException(); + return (byte)i; + } + + public static byte ReadUint8(byte[] buf, int offset) + { + return buf[offset]; + } + + public static int ReadUint16(Stream input) + { + int i1 = input.ReadByte(); + int i2 = input.ReadByte(); + if (i2 < 0) + throw new EndOfStreamException(); + return (i1 << 8) | i2; + } + + public static int ReadUint16(byte[] buf, int offset) + { + uint n = (uint)buf[offset] << 8; + n |= (uint)buf[++offset]; + return (int)n; + } + + public static int ReadUint24(Stream input) + { + int i1 = input.ReadByte(); + int i2 = input.ReadByte(); + int i3 = input.ReadByte(); + if (i3 < 0) + throw new EndOfStreamException(); + return (i1 << 16) | (i2 << 8) | i3; + } + + public static int ReadUint24(byte[] buf, int offset) + { + uint n = (uint)buf[offset] << 16; + n |= (uint)buf[++offset] << 8; + n |= (uint)buf[++offset]; + return (int)n; + } + + public static long ReadUint32(Stream input) + { + int i1 = input.ReadByte(); + int i2 = input.ReadByte(); + int i3 = input.ReadByte(); + int i4 = input.ReadByte(); + if (i4 < 0) + throw new EndOfStreamException(); + return (long)(uint)((i1 << 24) | (i2 << 16) | (i3 << 8) | i4); + } + + public static long ReadUint32(byte[] buf, int offset) + { + uint n = (uint)buf[offset] << 24; + n |= (uint)buf[++offset] << 16; + n |= (uint)buf[++offset] << 8; + n |= (uint)buf[++offset]; + return (long)n; + } + + public static long ReadUint48(Stream input) + { + int hi = ReadUint24(input); + int lo = ReadUint24(input); + return ((long)(hi & 0xffffffffL) << 24) | (long)(lo & 0xffffffffL); + } + + public static long ReadUint48(byte[] buf, int offset) + { + int hi = ReadUint24(buf, offset); + int lo = ReadUint24(buf, offset + 3); + return ((long)(hi & 0xffffffffL) << 24) | (long)(lo & 0xffffffffL); + } + + public static byte[] ReadAllOrNothing(int length, Stream input) + { + if (length < 1) + return EmptyBytes; + byte[] buf = new byte[length]; + int read = Streams.ReadFully(input, buf); + if (read == 0) + return null; + if (read != length) + throw new EndOfStreamException(); + return buf; + } + + public static byte[] ReadFully(int length, Stream input) + { + if (length < 1) + return EmptyBytes; + byte[] buf = new byte[length]; + if (length != Streams.ReadFully(input, buf)) + throw new EndOfStreamException(); + return buf; + } + + public static void ReadFully(byte[] buf, Stream input) + { + if (Streams.ReadFully(input, buf, 0, buf.Length) < buf.Length) + throw new EndOfStreamException(); + } + + public static byte[] ReadOpaque8(Stream input) + { + byte length = ReadUint8(input); + byte[] bytes = new byte[length]; + ReadFully(bytes, input); + return bytes; + } + + public static byte[] ReadOpaque16(Stream input) + { + int length = ReadUint16(input); + byte[] bytes = new byte[length]; + ReadFully(bytes, input); + return bytes; + } + + public static byte[] ReadOpaque24(Stream input) + { + int length = ReadUint24(input); + return ReadFully(length, input); + } + + public static byte[] ReadUint8Array(int count, Stream input) + { + byte[] uints = new byte[count]; + for (int i = 0; i < count; ++i) + { + uints[i] = ReadUint8(input); + } + return uints; + } + + public static int[] ReadUint16Array(int count, Stream input) + { + int[] uints = new int[count]; + for (int i = 0; i < count; ++i) + { + uints[i] = ReadUint16(input); + } + return uints; + } + + public static ProtocolVersion ReadVersion(byte[] buf, int offset) + { + return ProtocolVersion.Get(buf[offset], buf[offset + 1]); + } + + public static ProtocolVersion ReadVersion(Stream input) + { + int i1 = input.ReadByte(); + int i2 = input.ReadByte(); + if (i2 < 0) + throw new EndOfStreamException(); + return ProtocolVersion.Get(i1, i2); + } + + public static int ReadVersionRaw(byte[] buf, int offset) + { + return (buf[offset] << 8) | buf[offset + 1]; + } + + public static int ReadVersionRaw(Stream input) + { + int i1 = input.ReadByte(); + int i2 = input.ReadByte(); + if (i2 < 0) + throw new EndOfStreamException(); + return (i1 << 8) | i2; + } + + public static Asn1Object ReadAsn1Object(byte[] encoding) + { + MemoryStream input = new MemoryStream(encoding, false); + Asn1InputStream asn1 = new Asn1InputStream(input, encoding.Length); + Asn1Object result = asn1.ReadObject(); + if (null == result) + throw new TlsFatalAlert(AlertDescription.decode_error); + if (input.Position != input.Length) + throw new TlsFatalAlert(AlertDescription.decode_error); + return result; + } + + public static Asn1Object ReadDerObject(byte[] encoding) + { + /* + * NOTE: The current ASN.1 parsing code can't enforce DER-only parsing, but since DER is + * canonical, we can check it by re-encoding the result and comparing to the original. + */ + Asn1Object result = ReadAsn1Object(encoding); + byte[] check = result.GetEncoded(Asn1Encodable.Der); + if (!Arrays.AreEqual(check, encoding)) + throw new TlsFatalAlert(AlertDescription.decode_error); + return result; + } + + public static void WriteGmtUnixTime(byte[] buf, int offset) + { + int t = (int)(DateTimeUtilities.CurrentUnixMs() / 1000L); + buf[offset] = (byte)(t >> 24); + buf[offset + 1] = (byte)(t >> 16); + buf[offset + 2] = (byte)(t >> 8); + buf[offset + 3] = (byte)t; + } + + public static void WriteVersion(ProtocolVersion version, Stream output) + { + output.WriteByte((byte)version.MajorVersion); + output.WriteByte((byte)version.MinorVersion); + } + + public static void WriteVersion(ProtocolVersion version, byte[] buf, int offset) + { + buf[offset] = (byte)version.MajorVersion; + buf[offset + 1] = (byte)version.MinorVersion; + } + + public static IList GetAllSignatureAlgorithms() + { + IList v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(4); + v.Add(SignatureAlgorithm.anonymous); + v.Add(SignatureAlgorithm.rsa); + v.Add(SignatureAlgorithm.dsa); + v.Add(SignatureAlgorithm.ecdsa); + return v; + } + + public static IList GetDefaultDssSignatureAlgorithms() + { + return VectorOfOne(new SignatureAndHashAlgorithm(HashAlgorithm.sha1, SignatureAlgorithm.dsa)); + } + + public static IList GetDefaultECDsaSignatureAlgorithms() + { + return VectorOfOne(new SignatureAndHashAlgorithm(HashAlgorithm.sha1, SignatureAlgorithm.ecdsa)); + } + + public static IList GetDefaultRsaSignatureAlgorithms() + { + return VectorOfOne(new SignatureAndHashAlgorithm(HashAlgorithm.sha1, SignatureAlgorithm.rsa)); + } + + public static byte[] GetExtensionData(IDictionary extensions, int extensionType) + { + return extensions == null ? null : (byte[])extensions[extensionType]; + } + + public static IList GetDefaultSupportedSignatureAlgorithms() + { + byte[] hashAlgorithms = new byte[]{ HashAlgorithm.sha1, HashAlgorithm.sha224, HashAlgorithm.sha256, + HashAlgorithm.sha384, HashAlgorithm.sha512 }; + byte[] signatureAlgorithms = new byte[]{ SignatureAlgorithm.rsa, SignatureAlgorithm.dsa, + SignatureAlgorithm.ecdsa }; + + IList result = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + for (int i = 0; i < signatureAlgorithms.Length; ++i) + { + for (int j = 0; j < hashAlgorithms.Length; ++j) + { + result.Add(new SignatureAndHashAlgorithm(hashAlgorithms[j], signatureAlgorithms[i])); + } + } + return result; + } + + public static SignatureAndHashAlgorithm GetSignatureAndHashAlgorithm(TlsContext context, + TlsSignerCredentials signerCredentials) + { + SignatureAndHashAlgorithm signatureAndHashAlgorithm = null; + if (IsTlsV12(context)) + { + signatureAndHashAlgorithm = signerCredentials.SignatureAndHashAlgorithm; + if (signatureAndHashAlgorithm == null) + throw new TlsFatalAlert(AlertDescription.internal_error); + } + return signatureAndHashAlgorithm; + } + + public static bool HasExpectedEmptyExtensionData(IDictionary extensions, int extensionType, + byte alertDescription) + { + byte[] extension_data = GetExtensionData(extensions, extensionType); + if (extension_data == null) + return false; + if (extension_data.Length != 0) + throw new TlsFatalAlert(alertDescription); + return true; + } + + public static TlsSession ImportSession(byte[] sessionID, SessionParameters sessionParameters) + { + return new TlsSessionImpl(sessionID, sessionParameters); + } + + public static bool IsSignatureAlgorithmsExtensionAllowed(ProtocolVersion clientVersion) + { + return ProtocolVersion.TLSv12.IsEqualOrEarlierVersionOf(clientVersion.GetEquivalentTLSVersion()); + } + + /** + * Add a 'signature_algorithms' extension to existing extensions. + * + * @param extensions A {@link Hashtable} to add the extension to. + * @param supportedSignatureAlgorithms {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}. + * @throws IOException + */ + public static void AddSignatureAlgorithmsExtension(IDictionary extensions, IList supportedSignatureAlgorithms) + { + extensions[ExtensionType.signature_algorithms] = CreateSignatureAlgorithmsExtension(supportedSignatureAlgorithms); + } + + /** + * Get a 'signature_algorithms' extension from extensions. + * + * @param extensions A {@link Hashtable} to get the extension from, if it is present. + * @return A {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}, or null. + * @throws IOException + */ + public static IList GetSignatureAlgorithmsExtension(IDictionary extensions) + { + byte[] extensionData = GetExtensionData(extensions, ExtensionType.signature_algorithms); + return extensionData == null ? null : ReadSignatureAlgorithmsExtension(extensionData); + } + + /** + * Create a 'signature_algorithms' extension value. + * + * @param supportedSignatureAlgorithms A {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}. + * @return A byte array suitable for use as an extension value. + * @throws IOException + */ + public static byte[] CreateSignatureAlgorithmsExtension(IList supportedSignatureAlgorithms) + { + MemoryStream buf = new MemoryStream(); + + // supported_signature_algorithms + EncodeSupportedSignatureAlgorithms(supportedSignatureAlgorithms, false, buf); + + return buf.ToArray(); + } + + /** + * Read 'signature_algorithms' extension data. + * + * @param extensionData The extension data. + * @return A {@link Vector} containing at least 1 {@link SignatureAndHashAlgorithm}. + * @throws IOException + */ + public static IList ReadSignatureAlgorithmsExtension(byte[] extensionData) + { + if (extensionData == null) + throw new ArgumentNullException("extensionData"); + + MemoryStream buf = new MemoryStream(extensionData, false); + + // supported_signature_algorithms + IList supported_signature_algorithms = ParseSupportedSignatureAlgorithms(false, buf); + + TlsProtocol.AssertEmpty(buf); + + return supported_signature_algorithms; + } + + public static void EncodeSupportedSignatureAlgorithms(IList supportedSignatureAlgorithms, bool allowAnonymous, + Stream output) + { + if (supportedSignatureAlgorithms == null) + throw new ArgumentNullException("supportedSignatureAlgorithms"); + if (supportedSignatureAlgorithms.Count < 1 || supportedSignatureAlgorithms.Count >= (1 << 15)) + throw new ArgumentException("must have length from 1 to (2^15 - 1)", "supportedSignatureAlgorithms"); + + // supported_signature_algorithms + int length = 2 * supportedSignatureAlgorithms.Count; + CheckUint16(length); + WriteUint16(length, output); + + foreach (SignatureAndHashAlgorithm entry in supportedSignatureAlgorithms) + { + if (!allowAnonymous && entry.Signature == SignatureAlgorithm.anonymous) + { + /* + * RFC 5246 7.4.1.4.1 The "anonymous" value is meaningless in this context but used + * in Section 7.4.3. It MUST NOT appear in this extension. + */ + throw new ArgumentException( + "SignatureAlgorithm.anonymous MUST NOT appear in the signature_algorithms extension"); + } + entry.Encode(output); + } + } + + public static IList ParseSupportedSignatureAlgorithms(bool allowAnonymous, Stream input) + { + // supported_signature_algorithms + int length = ReadUint16(input); + if (length < 2 || (length & 1) != 0) + throw new TlsFatalAlert(AlertDescription.decode_error); + int count = length / 2; + IList supportedSignatureAlgorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(count); + for (int i = 0; i < count; ++i) + { + SignatureAndHashAlgorithm entry = SignatureAndHashAlgorithm.Parse(input); + if (!allowAnonymous && entry.Signature == SignatureAlgorithm.anonymous) + { + /* + * RFC 5246 7.4.1.4.1 The "anonymous" value is meaningless in this context but used + * in Section 7.4.3. It MUST NOT appear in this extension. + */ + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + supportedSignatureAlgorithms.Add(entry); + } + return supportedSignatureAlgorithms; + } + + public static void VerifySupportedSignatureAlgorithm(IList supportedSignatureAlgorithms, SignatureAndHashAlgorithm signatureAlgorithm) + { + if (supportedSignatureAlgorithms == null) + throw new ArgumentNullException("supportedSignatureAlgorithms"); + if (supportedSignatureAlgorithms.Count < 1 || supportedSignatureAlgorithms.Count >= (1 << 15)) + throw new ArgumentException("must have length from 1 to (2^15 - 1)", "supportedSignatureAlgorithms"); + if (signatureAlgorithm == null) + throw new ArgumentNullException("signatureAlgorithm"); + + if (signatureAlgorithm.Signature != SignatureAlgorithm.anonymous) + { + foreach (SignatureAndHashAlgorithm entry in supportedSignatureAlgorithms) + { + if (entry.Hash == signatureAlgorithm.Hash && entry.Signature == signatureAlgorithm.Signature) + return; + } + } + + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + public static byte[] PRF(TlsContext context, byte[] secret, string asciiLabel, byte[] seed, int size) + { + ProtocolVersion version = context.ServerVersion; + + if (version.IsSsl) + throw new InvalidOperationException("No PRF available for SSLv3 session"); + + byte[] label = Strings.ToByteArray(asciiLabel); + byte[] labelSeed = Concat(label, seed); + + int prfAlgorithm = context.SecurityParameters.PrfAlgorithm; + + if (prfAlgorithm == PrfAlgorithm.tls_prf_legacy) + return PRF_legacy(secret, label, labelSeed, size); + + IDigest prfDigest = CreatePrfHash(prfAlgorithm); + byte[] buf = new byte[size]; + HMacHash(prfDigest, secret, labelSeed, buf); + return buf; + } + + public static byte[] PRF_legacy(byte[] secret, string asciiLabel, byte[] seed, int size) + { + byte[] label = Strings.ToByteArray(asciiLabel); + byte[] labelSeed = Concat(label, seed); + + return PRF_legacy(secret, label, labelSeed, size); + } + + internal static byte[] PRF_legacy(byte[] secret, byte[] label, byte[] labelSeed, int size) + { + int s_half = (secret.Length + 1) / 2; + byte[] s1 = new byte[s_half]; + byte[] s2 = new byte[s_half]; + Array.Copy(secret, 0, s1, 0, s_half); + Array.Copy(secret, secret.Length - s_half, s2, 0, s_half); + + byte[] b1 = new byte[size]; + byte[] b2 = new byte[size]; + HMacHash(CreateHash(HashAlgorithm.md5), s1, labelSeed, b1); + HMacHash(CreateHash(HashAlgorithm.sha1), s2, labelSeed, b2); + for (int i = 0; i < size; i++) + { + b1[i] ^= b2[i]; + } + return b1; + } + + internal static byte[] Concat(byte[] a, byte[] b) + { + byte[] c = new byte[a.Length + b.Length]; + Array.Copy(a, 0, c, 0, a.Length); + Array.Copy(b, 0, c, a.Length, b.Length); + return c; + } + + internal static void HMacHash(IDigest digest, byte[] secret, byte[] seed, byte[] output) + { + HMac mac = new HMac(digest); + mac.Init(new KeyParameter(secret)); + byte[] a = seed; + int size = digest.GetDigestSize(); + int iterations = (output.Length + size - 1) / size; + byte[] buf = new byte[mac.GetMacSize()]; + byte[] buf2 = new byte[mac.GetMacSize()]; + for (int i = 0; i < iterations; i++) + { + mac.BlockUpdate(a, 0, a.Length); + mac.DoFinal(buf, 0); + a = buf; + mac.BlockUpdate(a, 0, a.Length); + mac.BlockUpdate(seed, 0, seed.Length); + mac.DoFinal(buf2, 0); + Array.Copy(buf2, 0, output, (size * i), System.Math.Min(size, output.Length - (size * i))); + } + } + + internal static void ValidateKeyUsage(X509CertificateStructure c, int keyUsageBits) + { + X509Extensions exts = c.TbsCertificate.Extensions; + if (exts != null) + { + X509Extension ext = exts.GetExtension(X509Extensions.KeyUsage); + if (ext != null) + { + DerBitString ku = KeyUsage.GetInstance(ext); + int bits = ku.GetBytes()[0]; + if ((bits & keyUsageBits) != keyUsageBits) + throw new TlsFatalAlert(AlertDescription.certificate_unknown); + } + } + } + + internal static byte[] CalculateKeyBlock(TlsContext context, int size) + { + SecurityParameters securityParameters = context.SecurityParameters; + byte[] master_secret = securityParameters.MasterSecret; + byte[] seed = Concat(securityParameters.ServerRandom, securityParameters.ClientRandom); + + if (IsSsl(context)) + return CalculateKeyBlock_Ssl(master_secret, seed, size); + + return PRF(context, master_secret, ExporterLabel.key_expansion, seed, size); + } + + internal static byte[] CalculateKeyBlock_Ssl(byte[] master_secret, byte[] random, int size) + { + IDigest md5 = CreateHash(HashAlgorithm.md5); + IDigest sha1 = CreateHash(HashAlgorithm.sha1); + int md5Size = md5.GetDigestSize(); + byte[] shatmp = new byte[sha1.GetDigestSize()]; + byte[] tmp = new byte[size + md5Size]; + + int i = 0, pos = 0; + while (pos < size) + { + byte[] ssl3Const = SSL3_CONST[i]; + + sha1.BlockUpdate(ssl3Const, 0, ssl3Const.Length); + sha1.BlockUpdate(master_secret, 0, master_secret.Length); + sha1.BlockUpdate(random, 0, random.Length); + sha1.DoFinal(shatmp, 0); + + md5.BlockUpdate(master_secret, 0, master_secret.Length); + md5.BlockUpdate(shatmp, 0, shatmp.Length); + md5.DoFinal(tmp, pos); + + pos += md5Size; + ++i; + } + + return Arrays.CopyOfRange(tmp, 0, size); + } + + internal static byte[] CalculateMasterSecret(TlsContext context, byte[] pre_master_secret) + { + SecurityParameters securityParameters = context.SecurityParameters; + + byte[] seed = securityParameters.IsExtendedMasterSecret + ? securityParameters.SessionHash + : Concat(securityParameters.ClientRandom, securityParameters.ServerRandom); + + if (IsSsl(context)) + return CalculateMasterSecret_Ssl(pre_master_secret, seed); + + string asciiLabel = securityParameters.IsExtendedMasterSecret + ? ExporterLabel.extended_master_secret + : ExporterLabel.master_secret; + + return PRF(context, pre_master_secret, asciiLabel, seed, 48); + } + + internal static byte[] CalculateMasterSecret_Ssl(byte[] pre_master_secret, byte[] random) + { + IDigest md5 = CreateHash(HashAlgorithm.md5); + IDigest sha1 = CreateHash(HashAlgorithm.sha1); + int md5Size = md5.GetDigestSize(); + byte[] shatmp = new byte[sha1.GetDigestSize()]; + + byte[] rval = new byte[md5Size * 3]; + int pos = 0; + + for (int i = 0; i < 3; ++i) + { + byte[] ssl3Const = SSL3_CONST[i]; + + sha1.BlockUpdate(ssl3Const, 0, ssl3Const.Length); + sha1.BlockUpdate(pre_master_secret, 0, pre_master_secret.Length); + sha1.BlockUpdate(random, 0, random.Length); + sha1.DoFinal(shatmp, 0); + + md5.BlockUpdate(pre_master_secret, 0, pre_master_secret.Length); + md5.BlockUpdate(shatmp, 0, shatmp.Length); + md5.DoFinal(rval, pos); + + pos += md5Size; + } + + return rval; + } + + internal static byte[] CalculateVerifyData(TlsContext context, string asciiLabel, byte[] handshakeHash) + { + if (IsSsl(context)) + return handshakeHash; + + SecurityParameters securityParameters = context.SecurityParameters; + byte[] master_secret = securityParameters.MasterSecret; + int verify_data_length = securityParameters.VerifyDataLength; + + return PRF(context, master_secret, asciiLabel, handshakeHash, verify_data_length); + } + + public static IDigest CreateHash(byte hashAlgorithm) + { + switch (hashAlgorithm) + { + case HashAlgorithm.md5: + return new MD5Digest(); + case HashAlgorithm.sha1: + return new Sha1Digest(); + case HashAlgorithm.sha224: + return new Sha224Digest(); + case HashAlgorithm.sha256: + return new Sha256Digest(); + case HashAlgorithm.sha384: + return new Sha384Digest(); + case HashAlgorithm.sha512: + return new Sha512Digest(); + default: + throw new ArgumentException("unknown HashAlgorithm", "hashAlgorithm"); + } + } + + public static IDigest CreateHash(SignatureAndHashAlgorithm signatureAndHashAlgorithm) + { + return signatureAndHashAlgorithm == null + ? new CombinedHash() + : CreateHash(signatureAndHashAlgorithm.Hash); + } + + public static IDigest CloneHash(byte hashAlgorithm, IDigest hash) + { + switch (hashAlgorithm) + { + case HashAlgorithm.md5: + return new MD5Digest((MD5Digest)hash); + case HashAlgorithm.sha1: + return new Sha1Digest((Sha1Digest)hash); + case HashAlgorithm.sha224: + return new Sha224Digest((Sha224Digest)hash); + case HashAlgorithm.sha256: + return new Sha256Digest((Sha256Digest)hash); + case HashAlgorithm.sha384: + return new Sha384Digest((Sha384Digest)hash); + case HashAlgorithm.sha512: + return new Sha512Digest((Sha512Digest)hash); + default: + throw new ArgumentException("unknown HashAlgorithm", "hashAlgorithm"); + } + } + + public static IDigest CreatePrfHash(int prfAlgorithm) + { + switch (prfAlgorithm) + { + case PrfAlgorithm.tls_prf_legacy: + return new CombinedHash(); + default: + return CreateHash(GetHashAlgorithmForPrfAlgorithm(prfAlgorithm)); + } + } + + public static IDigest ClonePrfHash(int prfAlgorithm, IDigest hash) + { + switch (prfAlgorithm) + { + case PrfAlgorithm.tls_prf_legacy: + return new CombinedHash((CombinedHash)hash); + default: + return CloneHash(GetHashAlgorithmForPrfAlgorithm(prfAlgorithm), hash); + } + } + + public static byte GetHashAlgorithmForPrfAlgorithm(int prfAlgorithm) + { + switch (prfAlgorithm) + { + case PrfAlgorithm.tls_prf_legacy: + throw new ArgumentException("legacy PRF not a valid algorithm", "prfAlgorithm"); + case PrfAlgorithm.tls_prf_sha256: + return HashAlgorithm.sha256; + case PrfAlgorithm.tls_prf_sha384: + return HashAlgorithm.sha384; + default: + throw new ArgumentException("unknown PrfAlgorithm", "prfAlgorithm"); + } + } + + public static DerObjectIdentifier GetOidForHashAlgorithm(byte hashAlgorithm) + { + switch (hashAlgorithm) + { + case HashAlgorithm.md5: + return PkcsObjectIdentifiers.MD5; + case HashAlgorithm.sha1: + return X509ObjectIdentifiers.IdSha1; + case HashAlgorithm.sha224: + return NistObjectIdentifiers.IdSha224; + case HashAlgorithm.sha256: + return NistObjectIdentifiers.IdSha256; + case HashAlgorithm.sha384: + return NistObjectIdentifiers.IdSha384; + case HashAlgorithm.sha512: + return NistObjectIdentifiers.IdSha512; + default: + throw new ArgumentException("unknown HashAlgorithm", "hashAlgorithm"); + } + } + + internal static short GetClientCertificateType(Certificate clientCertificate, Certificate serverCertificate) + { + if (clientCertificate.IsEmpty) + return -1; + + X509CertificateStructure x509Cert = clientCertificate.GetCertificateAt(0); + SubjectPublicKeyInfo keyInfo = x509Cert.SubjectPublicKeyInfo; + try + { + AsymmetricKeyParameter publicKey = PublicKeyFactory.CreateKey(keyInfo); + if (publicKey.IsPrivate) + throw new TlsFatalAlert(AlertDescription.internal_error); + + /* + * TODO RFC 5246 7.4.6. The certificates MUST be signed using an acceptable hash/ + * signature algorithm pair, as described in Section 7.4.4. Note that this relaxes the + * constraints on certificate-signing algorithms found in prior versions of TLS. + */ + + /* + * RFC 5246 7.4.6. Client Certificate + */ + + /* + * RSA public key; the certificate MUST allow the key to be used for signing with the + * signature scheme and hash algorithm that will be employed in the certificate verify + * message. + */ + if (publicKey is RsaKeyParameters) + { + ValidateKeyUsage(x509Cert, KeyUsage.DigitalSignature); + return ClientCertificateType.rsa_sign; + } + + /* + * DSA public key; the certificate MUST allow the key to be used for signing with the + * hash algorithm that will be employed in the certificate verify message. + */ + if (publicKey is DsaPublicKeyParameters) + { + ValidateKeyUsage(x509Cert, KeyUsage.DigitalSignature); + return ClientCertificateType.dss_sign; + } + + /* + * ECDSA-capable public key; the certificate MUST allow the key to be used for signing + * with the hash algorithm that will be employed in the certificate verify message; the + * public key MUST use a curve and point format supported by the server. + */ + if (publicKey is ECPublicKeyParameters) + { + ValidateKeyUsage(x509Cert, KeyUsage.DigitalSignature); + // TODO Check the curve and point format + return ClientCertificateType.ecdsa_sign; + } + + // TODO Add support for ClientCertificateType.*_fixed_* + + throw new TlsFatalAlert(AlertDescription.unsupported_certificate); + } + catch (Exception e) + { + throw new TlsFatalAlert(AlertDescription.unsupported_certificate, e); + } + } + + internal static void TrackHashAlgorithms(TlsHandshakeHash handshakeHash, IList supportedSignatureAlgorithms) + { + if (supportedSignatureAlgorithms != null) + { + foreach (SignatureAndHashAlgorithm signatureAndHashAlgorithm in supportedSignatureAlgorithms) + { + byte hashAlgorithm = signatureAndHashAlgorithm.Hash; + + if (HashAlgorithm.IsRecognized(hashAlgorithm)) + { + handshakeHash.TrackHashAlgorithm(hashAlgorithm); + } + else //if (HashAlgorithm.IsPrivate(hashAlgorithm)) + { + // TODO Support values in the "Reserved for Private Use" range + } + } + } + } + + public static bool HasSigningCapability(byte clientCertificateType) + { + switch (clientCertificateType) + { + case ClientCertificateType.dss_sign: + case ClientCertificateType.ecdsa_sign: + case ClientCertificateType.rsa_sign: + return true; + default: + return false; + } + } + + public static TlsSigner CreateTlsSigner(byte clientCertificateType) + { + switch (clientCertificateType) + { + case ClientCertificateType.dss_sign: + return new TlsDssSigner(); + case ClientCertificateType.ecdsa_sign: + return new TlsECDsaSigner(); + case ClientCertificateType.rsa_sign: + return new TlsRsaSigner(); + default: + throw new ArgumentException("not a type with signing capability", "clientCertificateType"); + } + } + + internal static readonly byte[] SSL_CLIENT = {0x43, 0x4C, 0x4E, 0x54}; + internal static readonly byte[] SSL_SERVER = {0x53, 0x52, 0x56, 0x52}; + + // SSL3 magic mix constants ("A", "BB", "CCC", ...) + internal static readonly byte[][] SSL3_CONST = GenSsl3Const(); + + private static byte[][] GenSsl3Const() + { + int n = 10; + byte[][] arr = new byte[n][]; + for (int i = 0; i < n; i++) + { + byte[] b = new byte[i + 1]; + Arrays.Fill(b, (byte)('A' + i)); + arr[i] = b; + } + return arr; + } + + private static IList VectorOfOne(object obj) + { + IList v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(1); + v.Add(obj); + return v; + } + + public static int GetCipherType(int ciphersuite) + { + switch (GetEncryptionAlgorithm(ciphersuite)) + { + case EncryptionAlgorithm.AES_128_CCM: + case EncryptionAlgorithm.AES_128_CCM_8: + case EncryptionAlgorithm.AES_128_GCM: + case EncryptionAlgorithm.AES_128_OCB_TAGLEN96: + case EncryptionAlgorithm.AES_256_CCM: + case EncryptionAlgorithm.AES_256_CCM_8: + case EncryptionAlgorithm.AES_256_GCM: + case EncryptionAlgorithm.AES_256_OCB_TAGLEN96: + case EncryptionAlgorithm.CAMELLIA_128_GCM: + case EncryptionAlgorithm.CAMELLIA_256_GCM: + case EncryptionAlgorithm.CHACHA20_POLY1305: + return CipherType.aead; + + case EncryptionAlgorithm.RC2_CBC_40: + case EncryptionAlgorithm.IDEA_CBC: + case EncryptionAlgorithm.DES40_CBC: + case EncryptionAlgorithm.DES_CBC: + case EncryptionAlgorithm.cls_3DES_EDE_CBC: + case EncryptionAlgorithm.AES_128_CBC: + case EncryptionAlgorithm.AES_256_CBC: + case EncryptionAlgorithm.CAMELLIA_128_CBC: + case EncryptionAlgorithm.CAMELLIA_256_CBC: + case EncryptionAlgorithm.SEED_CBC: + return CipherType.block; + + case EncryptionAlgorithm.NULL: + case EncryptionAlgorithm.RC4_40: + case EncryptionAlgorithm.RC4_128: + return CipherType.stream; + + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public static int GetEncryptionAlgorithm(int ciphersuite) + { + switch (ciphersuite) + { + case CipherSuite.TLS_DH_anon_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA: + return EncryptionAlgorithm.cls_3DES_EDE_CBC; + + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_anon_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA: + return EncryptionAlgorithm.AES_128_CBC; + + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM: + return EncryptionAlgorithm.AES_128_CCM; + + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_DHE_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM_8: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM_8: + return EncryptionAlgorithm.AES_128_CCM_8; + + case CipherSuite.TLS_DH_anon_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256: + return EncryptionAlgorithm.AES_128_GCM; + + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_128_OCB: + return EncryptionAlgorithm.AES_128_OCB_TAGLEN96; + + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_ECDH_anon_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA: + return EncryptionAlgorithm.AES_256_CBC; + + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM: + return EncryptionAlgorithm.AES_256_CCM; + + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_PSK_DHE_WITH_AES_256_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM_8: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM_8: + return EncryptionAlgorithm.AES_256_CCM_8; + + case CipherSuite.TLS_DH_anon_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_WITH_AES_256_GCM_SHA384: + return EncryptionAlgorithm.AES_256_GCM; + + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_256_OCB: + return EncryptionAlgorithm.AES_256_OCB_TAGLEN96; + + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256: + return EncryptionAlgorithm.CAMELLIA_128_CBC; + + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256: + return EncryptionAlgorithm.CAMELLIA_128_GCM; + + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384: + return EncryptionAlgorithm.CAMELLIA_256_CBC; + + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384: + return EncryptionAlgorithm.CAMELLIA_256_GCM; + + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256: + return EncryptionAlgorithm.CHACHA20_POLY1305; + + case CipherSuite.TLS_RSA_WITH_NULL_MD5: + return EncryptionAlgorithm.NULL; + + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_RSA_WITH_NULL_SHA: + return EncryptionAlgorithm.NULL; + + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_RSA_WITH_NULL_SHA256: + return EncryptionAlgorithm.NULL; + + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA384: + return EncryptionAlgorithm.NULL; + + case CipherSuite.TLS_DH_anon_WITH_RC4_128_MD5: + case CipherSuite.TLS_RSA_WITH_RC4_128_MD5: + return EncryptionAlgorithm.RC4_128; + + case CipherSuite.TLS_DHE_PSK_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_PSK_WITH_RC4_128_SHA: + case CipherSuite.TLS_RSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_RC4_128_SHA: + return EncryptionAlgorithm.RC4_128; + + case CipherSuite.TLS_DH_anon_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_SEED_CBC_SHA: + return EncryptionAlgorithm.SEED_CBC; + + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public static int GetKeyExchangeAlgorithm(int ciphersuite) + { + switch (ciphersuite) + { + case CipherSuite.TLS_DH_anon_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_anon_WITH_RC4_128_MD5: + case CipherSuite.TLS_DH_anon_WITH_SEED_CBC_SHA: + return KeyExchangeAlgorithm.DH_anon; + + case CipherSuite.TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_SEED_CBC_SHA: + return KeyExchangeAlgorithm.DH_DSS; + + case CipherSuite.TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_SEED_CBC_SHA: + return KeyExchangeAlgorithm.DH_RSA; + + case CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_SEED_CBC_SHA: + return KeyExchangeAlgorithm.DHE_DSS; + + case CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_128_OCB: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_256_OCB: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_RC4_128_SHA: + case CipherSuite.TLS_PSK_DHE_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_DHE_WITH_AES_256_CCM_8: + return KeyExchangeAlgorithm.DHE_PSK; + + case CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_128_OCB: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_256_OCB: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_SEED_CBC_SHA: + return KeyExchangeAlgorithm.DHE_RSA; + + case CipherSuite.TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_RC4_128_SHA: + return KeyExchangeAlgorithm.ECDH_anon; + + case CipherSuite.TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_128_OCB: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_256_OCB: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_RC4_128_SHA: + return KeyExchangeAlgorithm.ECDH_ECDSA; + + case CipherSuite.TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_RC4_128_SHA: + return KeyExchangeAlgorithm.ECDH_RSA; + + case CipherSuite.TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: + return KeyExchangeAlgorithm.ECDHE_ECDSA; + + case CipherSuite.TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_128_OCB: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_256_OCB: + case CipherSuite.TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_RC4_128_SHA: + return KeyExchangeAlgorithm.ECDHE_PSK; + + case CipherSuite.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_128_OCB: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_256_OCB: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_RC4_128_SHA: + return KeyExchangeAlgorithm.ECDHE_RSA; + + case CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_128_OCB: + case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_256_OCB: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_PSK_WITH_RC4_128_SHA: + return KeyExchangeAlgorithm.PSK; + + case CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_RSA_WITH_NULL_MD5: + case CipherSuite.TLS_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_RSA_WITH_NULL_SHA256: + case CipherSuite.TLS_RSA_WITH_RC4_128_MD5: + case CipherSuite.TLS_RSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_RSA_WITH_SEED_CBC_SHA: + return KeyExchangeAlgorithm.RSA; + + case CipherSuite.TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_RC4_128_SHA: + return KeyExchangeAlgorithm.RSA_PSK; + + case CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA: + return KeyExchangeAlgorithm.SRP; + + case CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA: + return KeyExchangeAlgorithm.SRP_DSS; + + case CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA: + return KeyExchangeAlgorithm.SRP_RSA; + + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public static int GetMacAlgorithm(int ciphersuite) + { + switch (ciphersuite) + { + case CipherSuite.TLS_DH_anon_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_128_OCB: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_256_OCB: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_128_OCB: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_256_OCB: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_128_OCB: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_256_OCB: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_128_OCB: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_256_OCB: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_PSK_DHE_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_DHE_WITH_AES_256_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_128_OCB: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_256_OCB: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384: + return MacAlgorithm.cls_null; + + case CipherSuite.TLS_DH_anon_WITH_RC4_128_MD5: + case CipherSuite.TLS_RSA_WITH_NULL_MD5: + case CipherSuite.TLS_RSA_WITH_RC4_128_MD5: + return MacAlgorithm.hmac_md5; + + case CipherSuite.TLS_DH_anon_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_anon_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_DSS_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DH_RSA_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DHE_DSS_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_DHE_PSK_WITH_RC4_128_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_DHE_RSA_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_anon_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_ECDSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDH_RSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_PSK_WITH_RC4_128_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_ECDHE_RSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_PSK_WITH_RC4_128_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA: + case CipherSuite.TLS_RSA_PSK_WITH_RC4_128_SHA: + case CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_CBC_SHA: + case CipherSuite.TLS_RSA_WITH_NULL_SHA: + case CipherSuite.TLS_RSA_WITH_RC4_128_SHA: + case CipherSuite.TLS_RSA_WITH_SEED_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_AES_128_CBC_SHA: + case CipherSuite.TLS_SRP_SHA_WITH_AES_256_CBC_SHA: + return MacAlgorithm.hmac_sha1; + + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_NULL_SHA256: + return MacAlgorithm.hmac_sha256; + + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_PSK_WITH_NULL_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_NULL_SHA384: + return MacAlgorithm.hmac_sha384; + + default: + throw new TlsFatalAlert(AlertDescription.internal_error); + } + } + + public static ProtocolVersion GetMinimumVersion(int ciphersuite) + { + switch (ciphersuite) + { + case CipherSuite.TLS_DH_anon_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_128_OCB: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_DHE_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_AES_256_OCB: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_128_OCB: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_DHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_AES_256_OCB: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_128_OCB: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_AES_256_OCB: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_128_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_AES_256_OCB: + case CipherSuite.DRAFT_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_128_OCB: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_AES_256_OCB: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384: + case CipherSuite.TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_PSK_DHE_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_DHE_WITH_AES_256_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM: + case CipherSuite.TLS_PSK_WITH_AES_128_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_128_OCB: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM: + case CipherSuite.TLS_PSK_WITH_AES_256_CCM_8: + case CipherSuite.TLS_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_PSK_WITH_AES_256_OCB: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.DRAFT_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM: + case CipherSuite.TLS_RSA_WITH_AES_128_CCM_8: + case CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM: + case CipherSuite.TLS_RSA_WITH_AES_256_CCM_8: + case CipherSuite.TLS_RSA_WITH_AES_256_GCM_SHA384: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256: + case CipherSuite.TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384: + case CipherSuite.TLS_RSA_WITH_NULL_SHA256: + return ProtocolVersion.TLSv12; + + default: + return ProtocolVersion.SSLv3; + } + } + + public static bool IsAeadCipherSuite(int ciphersuite) + { + return CipherType.aead == GetCipherType(ciphersuite); + } + + public static bool IsBlockCipherSuite(int ciphersuite) + { + return CipherType.block == GetCipherType(ciphersuite); + } + + public static bool IsStreamCipherSuite(int ciphersuite) + { + return CipherType.stream == GetCipherType(ciphersuite); + } + + public static bool IsValidCipherSuiteForSignatureAlgorithms(int cipherSuite, IList sigAlgs) + { + int keyExchangeAlgorithm; + try + { + keyExchangeAlgorithm = GetKeyExchangeAlgorithm(cipherSuite); + } + catch (IOException e) + { + return true; + } + + switch (keyExchangeAlgorithm) + { + case KeyExchangeAlgorithm.DH_anon: + case KeyExchangeAlgorithm.DH_anon_EXPORT: + case KeyExchangeAlgorithm.ECDH_anon: + return sigAlgs.Contains(SignatureAlgorithm.anonymous); + + case KeyExchangeAlgorithm.DHE_RSA: + case KeyExchangeAlgorithm.DHE_RSA_EXPORT: + case KeyExchangeAlgorithm.ECDHE_RSA: + case KeyExchangeAlgorithm.SRP_RSA: + return sigAlgs.Contains(SignatureAlgorithm.rsa); + + case KeyExchangeAlgorithm.DHE_DSS: + case KeyExchangeAlgorithm.DHE_DSS_EXPORT: + case KeyExchangeAlgorithm.SRP_DSS: + return sigAlgs.Contains(SignatureAlgorithm.dsa); + + case KeyExchangeAlgorithm.ECDHE_ECDSA: + return sigAlgs.Contains(SignatureAlgorithm.ecdsa); + + default: + return true; + } + } + + public static bool IsValidCipherSuiteForVersion(int cipherSuite, ProtocolVersion serverVersion) + { + return GetMinimumVersion(cipherSuite).IsEqualOrEarlierVersionOf(serverVersion.GetEquivalentTLSVersion()); + } + + public static IList GetUsableSignatureAlgorithms(IList sigHashAlgs) + { + if (sigHashAlgs == null) + return GetAllSignatureAlgorithms(); + + IList v = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(4); + v.Add(SignatureAlgorithm.anonymous); + foreach (SignatureAndHashAlgorithm sigHashAlg in sigHashAlgs) + { + //if (sigHashAlg.Hash >= MINIMUM_HASH_STRICT) + { + byte sigAlg = sigHashAlg.Signature; + if (!v.Contains(sigAlg)) + { + v.Add(sigAlg); + } + } + } + return v; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsUtilities.cs.meta new file mode 100644 index 00000000..7155f11c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/TlsUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3fd2e5c07ad1dd45931d22a3797521d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UrlAndHash.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UrlAndHash.cs new file mode 100644 index 00000000..049633d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UrlAndHash.cs @@ -0,0 +1,98 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * RFC 6066 5. + */ + public class UrlAndHash + { + protected readonly string mUrl; + protected readonly byte[] mSha1Hash; + + public UrlAndHash(string url, byte[] sha1Hash) + { + if (url == null || url.Length < 1 || url.Length >= (1 << 16)) + throw new ArgumentException("must have length from 1 to (2^16 - 1)", "url"); + if (sha1Hash != null && sha1Hash.Length != 20) + throw new ArgumentException("must have length == 20, if present", "sha1Hash"); + + this.mUrl = url; + this.mSha1Hash = sha1Hash; + } + + public virtual string Url + { + get { return mUrl; } + } + + public virtual byte[] Sha1Hash + { + get { return mSha1Hash; } + } + + /** + * Encode this {@link UrlAndHash} to a {@link Stream}. + * + * @param output the {@link Stream} to encode to. + * @throws IOException + */ + public virtual void Encode(Stream output) + { + byte[] urlEncoding = Strings.ToByteArray(this.mUrl); + TlsUtilities.WriteOpaque16(urlEncoding, output); + + if (this.mSha1Hash == null) + { + TlsUtilities.WriteUint8(0, output); + } + else + { + TlsUtilities.WriteUint8(1, output); + output.Write(this.mSha1Hash, 0, this.mSha1Hash.Length); + } + } + + /** + * Parse a {@link UrlAndHash} from a {@link Stream}. + * + * @param context + * the {@link TlsContext} of the current connection. + * @param input + * the {@link Stream} to parse from. + * @return a {@link UrlAndHash} object. + * @throws IOException + */ + public static UrlAndHash Parse(TlsContext context, Stream input) + { + byte[] urlEncoding = TlsUtilities.ReadOpaque16(input); + if (urlEncoding.Length < 1) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + string url = Strings.FromByteArray(urlEncoding); + + byte[] sha1Hash = null; + byte padding = TlsUtilities.ReadUint8(input); + switch (padding) + { + case 0: + if (TlsUtilities.IsTlsV12(context)) + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + break; + case 1: + sha1Hash = TlsUtilities.ReadFully(20, input); + break; + default: + throw new TlsFatalAlert(AlertDescription.illegal_parameter); + } + + return new UrlAndHash(url, sha1Hash); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UrlAndHash.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UrlAndHash.cs.meta new file mode 100644 index 00000000..dfb91915 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UrlAndHash.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4284587e3c1fef64fa90d63c8cfae763 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UseSrtpData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UseSrtpData.cs new file mode 100644 index 00000000..f201c982 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UseSrtpData.cs @@ -0,0 +1,60 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /** + * RFC 5764 4.1.1 + */ + public class UseSrtpData + { + protected readonly int[] mProtectionProfiles; + protected readonly byte[] mMki; + + /** + * @param protectionProfiles see {@link SrtpProtectionProfile} for valid constants. + * @param mki valid lengths from 0 to 255. + */ + public UseSrtpData(int[] protectionProfiles, byte[] mki) + { + if (protectionProfiles == null || protectionProfiles.Length < 1 + || protectionProfiles.Length >= (1 << 15)) + { + throw new ArgumentException("must have length from 1 to (2^15 - 1)", "protectionProfiles"); + } + + if (mki == null) + { + mki = TlsUtilities.EmptyBytes; + } + else if (mki.Length > 255) + { + throw new ArgumentException("cannot be longer than 255 bytes", "mki"); + } + + this.mProtectionProfiles = protectionProfiles; + this.mMki = mki; + } + + /** + * @return see {@link SrtpProtectionProfile} for valid constants. + */ + public virtual int[] ProtectionProfiles + { + get { return mProtectionProfiles; } + } + + /** + * @return valid lengths from 0 to 255. + */ + public virtual byte[] Mki + { + get { return mMki; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UseSrtpData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UseSrtpData.cs.meta new file mode 100644 index 00000000..ebd62577 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UseSrtpData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98171235a6a98474891a19aa213fecaf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UserMappingType.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UserMappingType.cs new file mode 100644 index 00000000..b7fe5082 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UserMappingType.cs @@ -0,0 +1,17 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls +{ + /// RFC 4681 + public abstract class UserMappingType + { + /* + * RFC 4681 + */ + public const byte upn_domain_hint = 64; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UserMappingType.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UserMappingType.cs.meta new file mode 100644 index 00000000..d1f186df --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/tls/UserMappingType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b184e4b5bfd10ec4889bad3516d3e67e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util.meta new file mode 100644 index 00000000..ac7559fd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e9c7f1f65018a6b489b3d3892004d352 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util/Pack.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util/Pack.cs new file mode 100644 index 00000000..188320b1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util/Pack.cs @@ -0,0 +1,349 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities +{ + internal sealed class Pack + { + private Pack() + { + } + + internal static void UInt16_To_BE(ushort n, byte[] bs) + { + bs[0] = (byte)(n >> 8); + bs[1] = (byte)(n); + } + + internal static void UInt16_To_BE(ushort n, byte[] bs, int off) + { + bs[off] = (byte)(n >> 8); + bs[off + 1] = (byte)(n); + } + + internal static ushort BE_To_UInt16(byte[] bs) + { + uint n = (uint)bs[0] << 8 + | (uint)bs[1]; + return (ushort)n; + } + + internal static ushort BE_To_UInt16(byte[] bs, int off) + { + uint n = (uint)bs[off] << 8 + | (uint)bs[off + 1]; + return (ushort)n; + } + + internal static byte[] UInt32_To_BE(uint n) + { + byte[] bs = new byte[4]; + UInt32_To_BE(n, bs, 0); + return bs; + } + + internal static void UInt32_To_BE(uint n, byte[] bs) + { + bs[0] = (byte)(n >> 24); + bs[1] = (byte)(n >> 16); + bs[2] = (byte)(n >> 8); + bs[3] = (byte)(n); + } + + internal static void UInt32_To_BE(uint n, byte[] bs, int off) + { + bs[off] = (byte)(n >> 24); + bs[off + 1] = (byte)(n >> 16); + bs[off + 2] = (byte)(n >> 8); + bs[off + 3] = (byte)(n); + } + + internal static byte[] UInt32_To_BE(uint[] ns) + { + byte[] bs = new byte[4 * ns.Length]; + UInt32_To_BE(ns, bs, 0); + return bs; + } + + internal static void UInt32_To_BE(uint[] ns, byte[] bs, int off) + { + for (int i = 0; i < ns.Length; ++i) + { + UInt32_To_BE(ns[i], bs, off); + off += 4; + } + } + + internal static uint BE_To_UInt32(byte[] bs) + { + return (uint)bs[0] << 24 + | (uint)bs[1] << 16 + | (uint)bs[2] << 8 + | (uint)bs[3]; + } + + internal static uint BE_To_UInt32(byte[] bs, int off) + { + return (uint)bs[off] << 24 + | (uint)bs[off + 1] << 16 + | (uint)bs[off + 2] << 8 + | (uint)bs[off + 3]; + } + + internal static void BE_To_UInt32(byte[] bs, int off, uint[] ns) + { + for (int i = 0; i < ns.Length; ++i) + { + ns[i] = BE_To_UInt32(bs, off); + off += 4; + } + } + + internal static byte[] UInt64_To_BE(ulong n) + { + byte[] bs = new byte[8]; + UInt64_To_BE(n, bs, 0); + return bs; + } + + internal static void UInt64_To_BE(ulong n, byte[] bs) + { + UInt32_To_BE((uint)(n >> 32), bs); + UInt32_To_BE((uint)(n), bs, 4); + } + + internal static void UInt64_To_BE(ulong n, byte[] bs, int off) + { + UInt32_To_BE((uint)(n >> 32), bs, off); + UInt32_To_BE((uint)(n), bs, off + 4); + } + + internal static byte[] UInt64_To_BE(ulong[] ns) + { + byte[] bs = new byte[8 * ns.Length]; + UInt64_To_BE(ns, bs, 0); + return bs; + } + + internal static void UInt64_To_BE(ulong[] ns, byte[] bs, int off) + { + for (int i = 0; i < ns.Length; ++i) + { + UInt64_To_BE(ns[i], bs, off); + off += 8; + } + } + + internal static ulong BE_To_UInt64(byte[] bs) + { + uint hi = BE_To_UInt32(bs); + uint lo = BE_To_UInt32(bs, 4); + return ((ulong)hi << 32) | (ulong)lo; + } + + internal static ulong BE_To_UInt64(byte[] bs, int off) + { + uint hi = BE_To_UInt32(bs, off); + uint lo = BE_To_UInt32(bs, off + 4); + return ((ulong)hi << 32) | (ulong)lo; + } + + internal static void BE_To_UInt64(byte[] bs, int off, ulong[] ns) + { + for (int i = 0; i < ns.Length; ++i) + { + ns[i] = BE_To_UInt64(bs, off); + off += 8; + } + } + + internal static void UInt16_To_LE(ushort n, byte[] bs) + { + bs[0] = (byte)(n); + bs[1] = (byte)(n >> 8); + } + + internal static void UInt16_To_LE(ushort n, byte[] bs, int off) + { + bs[off] = (byte)(n); + bs[off + 1] = (byte)(n >> 8); + } + + internal static ushort LE_To_UInt16(byte[] bs) + { + uint n = (uint)bs[0] + | (uint)bs[1] << 8; + return (ushort)n; + } + + internal static ushort LE_To_UInt16(byte[] bs, int off) + { + uint n = (uint)bs[off] + | (uint)bs[off + 1] << 8; + return (ushort)n; + } + + internal static byte[] UInt32_To_LE(uint n) + { + byte[] bs = new byte[4]; + UInt32_To_LE(n, bs, 0); + return bs; + } + + internal static void UInt32_To_LE(uint n, byte[] bs) + { + bs[0] = (byte)(n); + bs[1] = (byte)(n >> 8); + bs[2] = (byte)(n >> 16); + bs[3] = (byte)(n >> 24); + } + + internal static void UInt32_To_LE(uint n, byte[] bs, int off) + { + bs[off] = (byte)(n); + bs[off + 1] = (byte)(n >> 8); + bs[off + 2] = (byte)(n >> 16); + bs[off + 3] = (byte)(n >> 24); + } + + internal static byte[] UInt32_To_LE(uint[] ns) + { + byte[] bs = new byte[4 * ns.Length]; + UInt32_To_LE(ns, bs, 0); + return bs; + } + + internal static void UInt32_To_LE(uint[] ns, byte[] bs, int off) + { + for (int i = 0; i < ns.Length; ++i) + { + UInt32_To_LE(ns[i], bs, off); + off += 4; + } + } + + internal static uint LE_To_UInt32(byte[] bs) + { + return (uint)bs[0] + | (uint)bs[1] << 8 + | (uint)bs[2] << 16 + | (uint)bs[3] << 24; + } + + internal static uint LE_To_UInt32(byte[] bs, int off) + { + return (uint)bs[off] + | (uint)bs[off + 1] << 8 + | (uint)bs[off + 2] << 16 + | (uint)bs[off + 3] << 24; + } + + internal static void LE_To_UInt32(byte[] bs, int off, uint[] ns) + { + for (int i = 0; i < ns.Length; ++i) + { + ns[i] = LE_To_UInt32(bs, off); + off += 4; + } + } + + internal static void LE_To_UInt32(byte[] bs, int bOff, uint[] ns, int nOff, int count) + { + for (int i = 0; i < count; ++i) + { + ns[nOff + i] = LE_To_UInt32(bs, bOff); + bOff += 4; + } + } + + internal static uint[] LE_To_UInt32(byte[] bs, int off, int count) + { + uint[] ns = new uint[count]; + for (int i = 0; i < ns.Length; ++i) + { + ns[i] = LE_To_UInt32(bs, off); + off += 4; + } + return ns; + } + + internal static byte[] UInt64_To_LE(ulong n) + { + byte[] bs = new byte[8]; + UInt64_To_LE(n, bs, 0); + return bs; + } + + internal static void UInt64_To_LE(ulong n, byte[] bs) + { + UInt32_To_LE((uint)(n), bs); + UInt32_To_LE((uint)(n >> 32), bs, 4); + } + + internal static void UInt64_To_LE(ulong n, byte[] bs, int off) + { + UInt32_To_LE((uint)(n), bs, off); + UInt32_To_LE((uint)(n >> 32), bs, off + 4); + } + + internal static byte[] UInt64_To_LE(ulong[] ns) + { + byte[] bs = new byte[8 * ns.Length]; + UInt64_To_LE(ns, bs, 0); + return bs; + } + + internal static void UInt64_To_LE(ulong[] ns, byte[] bs, int off) + { + for (int i = 0; i < ns.Length; ++i) + { + UInt64_To_LE(ns[i], bs, off); + off += 8; + } + } + + internal static void UInt64_To_LE(ulong[] ns, int nsOff, int nsLen, byte[] bs, int bsOff) + { + for (int i = 0; i < nsLen; ++i) + { + UInt64_To_LE(ns[nsOff + i], bs, bsOff); + bsOff += 8; + } + } + + internal static ulong LE_To_UInt64(byte[] bs) + { + uint lo = LE_To_UInt32(bs); + uint hi = LE_To_UInt32(bs, 4); + return ((ulong)hi << 32) | (ulong)lo; + } + + internal static ulong LE_To_UInt64(byte[] bs, int off) + { + uint lo = LE_To_UInt32(bs, off); + uint hi = LE_To_UInt32(bs, off + 4); + return ((ulong)hi << 32) | (ulong)lo; + } + + internal static void LE_To_UInt64(byte[] bs, int off, ulong[] ns) + { + for (int i = 0; i < ns.Length; ++i) + { + ns[i] = LE_To_UInt64(bs, off); + off += 8; + } + } + + internal static void LE_To_UInt64(byte[] bs, int bsOff, ulong[] ns, int nsOff, int nsLen) + { + for (int i = 0; i < nsLen; ++i) + { + ns[nsOff + i] = LE_To_UInt64(bs, bsOff); + bsOff += 8; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util/Pack.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util/Pack.cs.meta new file mode 100644 index 00000000..d25c5b7e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/crypto/util/Pack.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d5c1783497718141a4efcd23f5d22a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math.meta new file mode 100644 index 00000000..1571104d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5701df17f62065143b8cf179ae96e414 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/BigInteger.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/BigInteger.cs new file mode 100644 index 00000000..aa54b943 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/BigInteger.cs @@ -0,0 +1,3604 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Diagnostics; +using System.Globalization; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class BigInteger + { + // The first few odd primes + /* + 3 5 7 11 13 17 19 23 29 + 31 37 41 43 47 53 59 61 67 71 + 73 79 83 89 97 101 103 107 109 113 + 127 131 137 139 149 151 157 163 167 173 + 179 181 191 193 197 199 211 223 227 229 + 233 239 241 251 257 263 269 271 277 281 + 283 293 307 311 313 317 331 337 347 349 + 353 359 367 373 379 383 389 397 401 409 + 419 421 431 433 439 443 449 457 461 463 + 467 479 487 491 499 503 509 521 523 541 + 547 557 563 569 571 577 587 593 599 601 + 607 613 617 619 631 641 643 647 653 659 + 661 673 677 683 691 701 709 719 727 733 + 739 743 751 757 761 769 773 787 797 809 + 811 821 823 827 829 839 853 857 859 863 + 877 881 883 887 907 911 919 929 937 941 + 947 953 967 971 977 983 991 997 1009 + 1013 1019 1021 1031 1033 1039 1049 1051 + 1061 1063 1069 1087 1091 1093 1097 1103 + 1109 1117 1123 1129 1151 1153 1163 1171 + 1181 1187 1193 1201 1213 1217 1223 1229 + 1231 1237 1249 1259 1277 1279 1283 1289 + */ + + // Each list has a product < 2^31 + internal static readonly int[][] primeLists = new int[][] + { + new int[]{ 3, 5, 7, 11, 13, 17, 19, 23 }, + new int[]{ 29, 31, 37, 41, 43 }, + new int[]{ 47, 53, 59, 61, 67 }, + new int[]{ 71, 73, 79, 83 }, + new int[]{ 89, 97, 101, 103 }, + + new int[]{ 107, 109, 113, 127 }, + new int[]{ 131, 137, 139, 149 }, + new int[]{ 151, 157, 163, 167 }, + new int[]{ 173, 179, 181, 191 }, + new int[]{ 193, 197, 199, 211 }, + + new int[]{ 223, 227, 229 }, + new int[]{ 233, 239, 241 }, + new int[]{ 251, 257, 263 }, + new int[]{ 269, 271, 277 }, + new int[]{ 281, 283, 293 }, + + new int[]{ 307, 311, 313 }, + new int[]{ 317, 331, 337 }, + new int[]{ 347, 349, 353 }, + new int[]{ 359, 367, 373 }, + new int[]{ 379, 383, 389 }, + + new int[]{ 397, 401, 409 }, + new int[]{ 419, 421, 431 }, + new int[]{ 433, 439, 443 }, + new int[]{ 449, 457, 461 }, + new int[]{ 463, 467, 479 }, + + new int[]{ 487, 491, 499 }, + new int[]{ 503, 509, 521 }, + new int[]{ 523, 541, 547 }, + new int[]{ 557, 563, 569 }, + new int[]{ 571, 577, 587 }, + + new int[]{ 593, 599, 601 }, + new int[]{ 607, 613, 617 }, + new int[]{ 619, 631, 641 }, + new int[]{ 643, 647, 653 }, + new int[]{ 659, 661, 673 }, + + new int[]{ 677, 683, 691 }, + new int[]{ 701, 709, 719 }, + new int[]{ 727, 733, 739 }, + new int[]{ 743, 751, 757 }, + new int[]{ 761, 769, 773 }, + + new int[]{ 787, 797, 809 }, + new int[]{ 811, 821, 823 }, + new int[]{ 827, 829, 839 }, + new int[]{ 853, 857, 859 }, + new int[]{ 863, 877, 881 }, + + new int[]{ 883, 887, 907 }, + new int[]{ 911, 919, 929 }, + new int[]{ 937, 941, 947 }, + new int[]{ 953, 967, 971 }, + new int[]{ 977, 983, 991 }, + + new int[]{ 997, 1009, 1013 }, + new int[]{ 1019, 1021, 1031 }, + new int[]{ 1033, 1039, 1049 }, + new int[]{ 1051, 1061, 1063 }, + new int[]{ 1069, 1087, 1091 }, + + new int[]{ 1093, 1097, 1103 }, + new int[]{ 1109, 1117, 1123 }, + new int[]{ 1129, 1151, 1153 }, + new int[]{ 1163, 1171, 1181 }, + new int[]{ 1187, 1193, 1201 }, + + new int[]{ 1213, 1217, 1223 }, + new int[]{ 1229, 1231, 1237 }, + new int[]{ 1249, 1259, 1277 }, + new int[]{ 1279, 1283, 1289 }, + }; + + internal static readonly int[] primeProducts; + + private const long IMASK = 0xFFFFFFFFL; + private const ulong UIMASK = 0xFFFFFFFFUL; + + private static readonly int[] ZeroMagnitude = new int[0]; + private static readonly byte[] ZeroEncoding = new byte[0]; + + private static readonly BigInteger[] SMALL_CONSTANTS = new BigInteger[17]; + public static readonly BigInteger Zero; + public static readonly BigInteger One; + public static readonly BigInteger Two; + public static readonly BigInteger Three; + public static readonly BigInteger Ten; + + //private readonly static byte[] BitCountTable = + //{ + // 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, + // 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + // 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + // 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + // 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + // 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + // 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + // 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + // 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + // 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + // 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + // 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5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// TODO Parse radix-2 64 bits at a time and radix-8 63 bits at a time + private const int chunk2 = 1, chunk8 = 1, chunk10 = 19, chunk16 = 16; + private static readonly BigInteger radix2, radix2E, radix8, radix8E, radix10, radix10E, radix16, radix16E; + + private static readonly SecureRandom RandomSource = new SecureRandom(); + + /* + * These are the threshold bit-lengths (of an exponent) where we increase the window size. + * They are calculated according to the expected savings in multiplications. + * Some squares will also be saved on average, but we offset these against the extra storage costs. + */ + private static readonly int[] ExpWindowThresholds = { 7, 25, 81, 241, 673, 1793, 4609, Int32.MaxValue }; + + private const int BitsPerByte = 8; + private const int BitsPerInt = 32; + private const int BytesPerInt = 4; + + static BigInteger() + { + Zero = new BigInteger(0, ZeroMagnitude, false); + Zero.nBits = 0; Zero.nBitLength = 0; + + SMALL_CONSTANTS[0] = Zero; + for (uint i = 1; i < SMALL_CONSTANTS.Length; ++i) + { + SMALL_CONSTANTS[i] = CreateUValueOf(i); + } + + One = SMALL_CONSTANTS[1]; + Two = SMALL_CONSTANTS[2]; + Three = SMALL_CONSTANTS[3]; + Ten = SMALL_CONSTANTS[10]; + + radix2 = ValueOf(2); + radix2E = radix2.Pow(chunk2); + + radix8 = ValueOf(8); + radix8E = radix8.Pow(chunk8); + + radix10 = ValueOf(10); + radix10E = radix10.Pow(chunk10); + + radix16 = ValueOf(16); + radix16E = radix16.Pow(chunk16); + + primeProducts = new int[primeLists.Length]; + + for (int i = 0; i < primeLists.Length; ++i) + { + int[] primeList = primeLists[i]; + int product = primeList[0]; + for (int j = 1; j < primeList.Length; ++j) + { + product *= primeList[j]; + } + primeProducts[i] = product; + } + } + + private int[] magnitude; // array of ints with [0] being the most significant + private int sign; // -1 means -ve; +1 means +ve; 0 means 0; + private int nBits = -1; // cache BitCount() value + private int nBitLength = -1; // cache BitLength() value + private int mQuote = 0; // -m^(-1) mod b, b = 2^32 (see Montgomery mult.), 0 when uninitialised + + private static int GetByteLength( + int nBits) + { + return (nBits + BitsPerByte - 1) / BitsPerByte; + } + + internal static BigInteger Arbitrary(int sizeInBits) + { + return new BigInteger(sizeInBits, RandomSource); + } + + private BigInteger( + int signum, + int[] mag, + bool checkMag) + { + if (checkMag) + { + int i = 0; + while (i < mag.Length && mag[i] == 0) + { + ++i; + } + + if (i == mag.Length) + { + this.sign = 0; + this.magnitude = ZeroMagnitude; + } + else + { + this.sign = signum; + + if (i == 0) + { + this.magnitude = mag; + } + else + { + // strip leading 0 words + this.magnitude = new int[mag.Length - i]; + Array.Copy(mag, i, this.magnitude, 0, this.magnitude.Length); + } + } + } + else + { + this.sign = signum; + this.magnitude = mag; + } + } + + public BigInteger( + string value) + : this(value, 10) + { + } + + public BigInteger( + string str, + int radix) + { + if (str.Length == 0) + throw new FormatException("Zero length BigInteger"); + + NumberStyles style; + int chunk; + BigInteger r; + BigInteger rE; + + switch (radix) + { + case 2: + // Is there anyway to restrict to binary digits? + style = NumberStyles.Integer; + chunk = chunk2; + r = radix2; + rE = radix2E; + break; + case 8: + // Is there anyway to restrict to octal digits? + style = NumberStyles.Integer; + chunk = chunk8; + r = radix8; + rE = radix8E; + break; + case 10: + // This style seems to handle spaces and minus sign already (our processing redundant?) + style = NumberStyles.Integer; + chunk = chunk10; + r = radix10; + rE = radix10E; + break; + case 16: + // TODO Should this be HexNumber? + style = NumberStyles.AllowHexSpecifier; + chunk = chunk16; + r = radix16; + rE = radix16E; + break; + default: + throw new FormatException("Only bases 2, 8, 10, or 16 allowed"); + } + + + int index = 0; + sign = 1; + + if (str[0] == '-') + { + if (str.Length == 1) + throw new FormatException("Zero length BigInteger"); + + sign = -1; + index = 1; + } + + // strip leading zeros from the string str + while (index < str.Length && Int32.Parse(str[index].ToString(), style) == 0) + { + index++; + } + + if (index >= str.Length) + { + // zero value - we're done + sign = 0; + magnitude = ZeroMagnitude; + return; + } + + ////// + // could we work out the max number of ints required to store + // str.Length digits in the given base, then allocate that + // storage in one hit?, then Generate the magnitude in one hit too? + ////// + + BigInteger b = Zero; + + + int next = index + chunk; + + if (next <= str.Length) + { + do + { + string s = str.Substring(index, chunk); + ulong i = ulong.Parse(s, style); + BigInteger bi = CreateUValueOf(i); + + switch (radix) + { + case 2: + // TODO Need this because we are parsing in radix 10 above + if (i >= 2) + throw new FormatException("Bad character in radix 2 string: " + s); + + // TODO Parse 64 bits at a time + b = b.ShiftLeft(1); + break; + case 8: + // TODO Need this because we are parsing in radix 10 above + if (i >= 8) + throw new FormatException("Bad character in radix 8 string: " + s); + + // TODO Parse 63 bits at a time + b = b.ShiftLeft(3); + break; + case 16: + b = b.ShiftLeft(64); + break; + default: + b = b.Multiply(rE); + break; + } + + b = b.Add(bi); + + index = next; + next += chunk; + } + while (next <= str.Length); + } + + if (index < str.Length) + { + string s = str.Substring(index); + ulong i = ulong.Parse(s, style); + BigInteger bi = CreateUValueOf(i); + + if (b.sign > 0) + { + if (radix == 2) + { + // NB: Can't reach here since we are parsing one char at a time + Debug.Assert(false); + + // TODO Parse all bits at once +// b = b.ShiftLeft(s.Length); + } + else if (radix == 8) + { + // NB: Can't reach here since we are parsing one char at a time + Debug.Assert(false); + + // TODO Parse all bits at once +// b = b.ShiftLeft(s.Length * 3); + } + else if (radix == 16) + { + b = b.ShiftLeft(s.Length << 2); + } + else + { + b = b.Multiply(r.Pow(s.Length)); + } + + b = b.Add(bi); + } + else + { + b = bi; + } + } + + // Note: This is the previous (slower) algorithm +// while (index < value.Length) +// { +// char c = value[index]; +// string s = c.ToString(); +// int i = Int32.Parse(s, style); +// +// b = b.Multiply(r).Add(ValueOf(i)); +// index++; +// } + + magnitude = b.magnitude; + } + + public BigInteger( + byte[] bytes) + : this(bytes, 0, bytes.Length) + { + } + + public BigInteger( + byte[] bytes, + int offset, + int length) + { + if (length == 0) + throw new FormatException("Zero length BigInteger"); + + // TODO Move this processing into MakeMagnitude (provide sign argument) + if ((sbyte)bytes[offset] < 0) + { + this.sign = -1; + + int end = offset + length; + + int iBval; + // strip leading sign bytes + for (iBval = offset; iBval < end && ((sbyte)bytes[iBval] == -1); iBval++) + { + } + + if (iBval >= end) + { + this.magnitude = One.magnitude; + } + else + { + int numBytes = end - iBval; + byte[] inverse = new byte[numBytes]; + + int index = 0; + while (index < numBytes) + { + inverse[index++] = (byte)~bytes[iBval++]; + } + + Debug.Assert(iBval == end); + + while (inverse[--index] == byte.MaxValue) + { + inverse[index] = byte.MinValue; + } + + inverse[index]++; + + this.magnitude = MakeMagnitude(inverse, 0, inverse.Length); + } + } + else + { + // strip leading zero bytes and return magnitude bytes + this.magnitude = MakeMagnitude(bytes, offset, length); + this.sign = this.magnitude.Length > 0 ? 1 : 0; + } + } + + private static int[] MakeMagnitude( + byte[] bytes, + int offset, + int length) + { + int end = offset + length; + + // strip leading zeros + int firstSignificant; + for (firstSignificant = offset; firstSignificant < end + && bytes[firstSignificant] == 0; firstSignificant++) + { + } + + if (firstSignificant >= end) + { + return ZeroMagnitude; + } + + int nInts = (end - firstSignificant + 3) / BytesPerInt; + int bCount = (end - firstSignificant) % BytesPerInt; + if (bCount == 0) + { + bCount = BytesPerInt; + } + + if (nInts < 1) + { + return ZeroMagnitude; + } + + int[] mag = new int[nInts]; + + int v = 0; + int magnitudeIndex = 0; + for (int i = firstSignificant; i < end; ++i) + { + v <<= 8; + v |= bytes[i] & 0xff; + bCount--; + if (bCount <= 0) + { + mag[magnitudeIndex] = v; + magnitudeIndex++; + bCount = BytesPerInt; + v = 0; + } + } + + if (magnitudeIndex < mag.Length) + { + mag[magnitudeIndex] = v; + } + + return mag; + } + + public BigInteger( + int sign, + byte[] bytes) + : this(sign, bytes, 0, bytes.Length) + { + } + + public BigInteger( + int sign, + byte[] bytes, + int offset, + int length) + { + if (sign < -1 || sign > 1) + throw new FormatException("Invalid sign value"); + + if (sign == 0) + { + this.sign = 0; + this.magnitude = ZeroMagnitude; + } + else + { + // copy bytes + this.magnitude = MakeMagnitude(bytes, offset, length); + this.sign = this.magnitude.Length < 1 ? 0 : sign; + } + } + + public BigInteger( + int sizeInBits, + Random random) + { + if (sizeInBits < 0) + throw new ArgumentException("sizeInBits must be non-negative"); + + this.nBits = -1; + this.nBitLength = -1; + + if (sizeInBits == 0) + { + this.sign = 0; + this.magnitude = ZeroMagnitude; + return; + } + + int nBytes = GetByteLength(sizeInBits); + byte[] b = new byte[nBytes]; + random.NextBytes(b); + + // strip off any excess bits in the MSB + int xBits = BitsPerByte * nBytes - sizeInBits; + b[0] &= (byte)(255U >> xBits); + + this.magnitude = MakeMagnitude(b, 0, b.Length); + this.sign = this.magnitude.Length < 1 ? 0 : 1; + } + + public BigInteger( + int bitLength, + int certainty, + Random random) + { + if (bitLength < 2) + throw new ArithmeticException("bitLength < 2"); + + this.sign = 1; + this.nBitLength = bitLength; + + if (bitLength == 2) + { + this.magnitude = random.Next(2) == 0 + ? Two.magnitude + : Three.magnitude; + return; + } + + int nBytes = GetByteLength(bitLength); + byte[] b = new byte[nBytes]; + + int xBits = BitsPerByte * nBytes - bitLength; + byte mask = (byte)(255U >> xBits); + byte lead = (byte)(1 << (7 - xBits)); + + for (;;) + { + random.NextBytes(b); + + // strip off any excess bits in the MSB + b[0] &= mask; + + // ensure the leading bit is 1 (to meet the strength requirement) + b[0] |= lead; + + // ensure the trailing bit is 1 (i.e. must be odd) + b[nBytes - 1] |= 1; + + this.magnitude = MakeMagnitude(b, 0, b.Length); + this.nBits = -1; + this.mQuote = 0; + + if (certainty < 1) + break; + + if (CheckProbablePrime(certainty, random, true)) + break; + + for (int j = 1; j < (magnitude.Length - 1); ++j) + { + this.magnitude[j] ^= random.Next(); + + if (CheckProbablePrime(certainty, random, true)) + return; + } + } + } + + public BigInteger Abs() + { + return sign >= 0 ? this : Negate(); + } + + /** + * return a = a + b - b preserved. + */ + private static int[] AddMagnitudes( + int[] a, + int[] b) + { + int tI = a.Length - 1; + int vI = b.Length - 1; + long m = 0; + + while (vI >= 0) + { + m += ((long)(uint)a[tI] + (long)(uint)b[vI--]); + a[tI--] = (int)m; + m = (long)((ulong)m >> 32); + } + + if (m != 0) + { + while (tI >= 0 && ++a[tI--] == 0) + { + } + } + + return a; + } + + public BigInteger Add( + BigInteger value) + { + if (this.sign == 0) + return value; + + if (this.sign != value.sign) + { + if (value.sign == 0) + return this; + + if (value.sign < 0) + return Subtract(value.Negate()); + + return value.Subtract(Negate()); + } + + return AddToMagnitude(value.magnitude); + } + + private BigInteger AddToMagnitude( + int[] magToAdd) + { + int[] big, small; + if (this.magnitude.Length < magToAdd.Length) + { + big = magToAdd; + small = this.magnitude; + } + else + { + big = this.magnitude; + small = magToAdd; + } + + // Conservatively avoid over-allocation when no overflow possible + uint limit = uint.MaxValue; + if (big.Length == small.Length) + limit -= (uint) small[0]; + + bool possibleOverflow = (uint) big[0] >= limit; + + int[] bigCopy; + if (possibleOverflow) + { + bigCopy = new int[big.Length + 1]; + big.CopyTo(bigCopy, 1); + } + else + { + bigCopy = (int[]) big.Clone(); + } + + bigCopy = AddMagnitudes(bigCopy, small); + + return new BigInteger(this.sign, bigCopy, possibleOverflow); + } + + public BigInteger And( + BigInteger value) + { + if (this.sign == 0 || value.sign == 0) + { + return Zero; + } + + int[] aMag = this.sign > 0 + ? this.magnitude + : Add(One).magnitude; + + int[] bMag = value.sign > 0 + ? value.magnitude + : value.Add(One).magnitude; + + bool resultNeg = sign < 0 && value.sign < 0; + int resultLength = System.Math.Max(aMag.Length, bMag.Length); + int[] resultMag = new int[resultLength]; + + int aStart = resultMag.Length - aMag.Length; + int bStart = resultMag.Length - bMag.Length; + + for (int i = 0; i < resultMag.Length; ++i) + { + int aWord = i >= aStart ? aMag[i - aStart] : 0; + int bWord = i >= bStart ? bMag[i - bStart] : 0; + + if (this.sign < 0) + { + aWord = ~aWord; + } + + if (value.sign < 0) + { + bWord = ~bWord; + } + + resultMag[i] = aWord & bWord; + + if (resultNeg) + { + resultMag[i] = ~resultMag[i]; + } + } + + BigInteger result = new BigInteger(1, resultMag, true); + + // TODO Optimise this case + if (resultNeg) + { + result = result.Not(); + } + + return result; + } + + public BigInteger AndNot( + BigInteger val) + { + return And(val.Not()); + } + + public int BitCount + { + get + { + if (nBits == -1) + { + if (sign < 0) + { + // TODO Optimise this case + nBits = Not().BitCount; + } + else + { + int sum = 0; + for (int i = 0; i < magnitude.Length; ++i) + { + sum += BitCnt(magnitude[i]); + } + nBits = sum; + } + } + + return nBits; + } + } + + public static int BitCnt(int i) + { + uint u = (uint)i; + u = u - ((u >> 1) & 0x55555555); + u = (u & 0x33333333) + ((u >> 2) & 0x33333333); + u = (u + (u >> 4)) & 0x0f0f0f0f; + u += (u >> 8); + u += (u >> 16); + u &= 0x3f; + return (int)u; + } + + private static int CalcBitLength(int sign, int indx, int[] mag) + { + for (;;) + { + if (indx >= mag.Length) + return 0; + + if (mag[indx] != 0) + break; + + ++indx; + } + + // bit length for everything after the first int + int bitLength = 32 * ((mag.Length - indx) - 1); + + // and determine bitlength of first int + int firstMag = mag[indx]; + bitLength += BitLen(firstMag); + + // Check for negative powers of two + if (sign < 0 && ((firstMag & -firstMag) == firstMag)) + { + do + { + if (++indx >= mag.Length) + { + --bitLength; + break; + } + } + while (mag[indx] == 0); + } + + return bitLength; + } + + public int BitLength + { + get + { + if (nBitLength == -1) + { + nBitLength = sign == 0 + ? 0 + : CalcBitLength(sign, 0, magnitude); + } + + return nBitLength; + } + } + + // + // BitLen(value) is the number of bits in value. + // + internal static int BitLen(int w) + { + uint v = (uint)w; + uint t = v >> 24; + if (t != 0) + return 24 + BitLengthTable[t]; + t = v >> 16; + if (t != 0) + return 16 + BitLengthTable[t]; + t = v >> 8; + if (t != 0) + return 8 + BitLengthTable[t]; + return BitLengthTable[v]; + } + + private bool QuickPow2Check() + { + return sign > 0 && nBits == 1; + } + + public int CompareTo( + object obj) + { + return CompareTo((BigInteger)obj); + } + + /** + * unsigned comparison on two arrays - note the arrays may + * start with leading zeros. + */ + private static int CompareTo( + int xIndx, + int[] x, + int yIndx, + int[] y) + { + while (xIndx != x.Length && x[xIndx] == 0) + { + xIndx++; + } + + while (yIndx != y.Length && y[yIndx] == 0) + { + yIndx++; + } + + return CompareNoLeadingZeroes(xIndx, x, yIndx, y); + } + + private static int CompareNoLeadingZeroes( + int xIndx, + int[] x, + int yIndx, + int[] y) + { + int diff = (x.Length - y.Length) - (xIndx - yIndx); + + if (diff != 0) + { + return diff < 0 ? -1 : 1; + } + + // lengths of magnitudes the same, test the magnitude values + + while (xIndx < x.Length) + { + uint v1 = (uint)x[xIndx++]; + uint v2 = (uint)y[yIndx++]; + + if (v1 != v2) + return v1 < v2 ? -1 : 1; + } + + return 0; + } + + public int CompareTo( + BigInteger value) + { + return sign < value.sign ? -1 + : sign > value.sign ? 1 + : sign == 0 ? 0 + : sign * CompareNoLeadingZeroes(0, magnitude, 0, value.magnitude); + } + + /** + * return z = x / y - done in place (z value preserved, x contains the + * remainder) + */ + private int[] Divide( + int[] x, + int[] y) + { + int xStart = 0; + while (xStart < x.Length && x[xStart] == 0) + { + ++xStart; + } + + int yStart = 0; + while (yStart < y.Length && y[yStart] == 0) + { + ++yStart; + } + + Debug.Assert(yStart < y.Length); + + int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); + int[] count; + + if (xyCmp > 0) + { + int yBitLength = CalcBitLength(1, yStart, y); + int xBitLength = CalcBitLength(1, xStart, x); + int shift = xBitLength - yBitLength; + + int[] iCount; + int iCountStart = 0; + + int[] c; + int cStart = 0; + int cBitLength = yBitLength; + if (shift > 0) + { +// iCount = ShiftLeft(One.magnitude, shift); + iCount = new int[(shift >> 5) + 1]; + iCount[0] = 1 << (shift % 32); + + c = ShiftLeft(y, shift); + cBitLength += shift; + } + else + { + iCount = new int[] { 1 }; + + int len = y.Length - yStart; + c = new int[len]; + Array.Copy(y, yStart, c, 0, len); + } + + count = new int[iCount.Length]; + + for (;;) + { + if (cBitLength < xBitLength + || CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0) + { + Subtract(xStart, x, cStart, c); + AddMagnitudes(count, iCount); + + while (x[xStart] == 0) + { + if (++xStart == x.Length) + return count; + } + + //xBitLength = CalcBitLength(xStart, x); + xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]); + + if (xBitLength <= yBitLength) + { + if (xBitLength < yBitLength) + return count; + + xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); + + if (xyCmp <= 0) + break; + } + } + + shift = cBitLength - xBitLength; + + // NB: The case where c[cStart] is 1-bit is harmless + if (shift == 1) + { + uint firstC = (uint) c[cStart] >> 1; + uint firstX = (uint) x[xStart]; + if (firstC > firstX) + ++shift; + } + + if (shift < 2) + { + ShiftRightOneInPlace(cStart, c); + --cBitLength; + ShiftRightOneInPlace(iCountStart, iCount); + } + else + { + ShiftRightInPlace(cStart, c, shift); + cBitLength -= shift; + ShiftRightInPlace(iCountStart, iCount, shift); + } + + //cStart = c.Length - ((cBitLength + 31) / 32); + while (c[cStart] == 0) + { + ++cStart; + } + + while (iCount[iCountStart] == 0) + { + ++iCountStart; + } + } + } + else + { + count = new int[1]; + } + + if (xyCmp == 0) + { + AddMagnitudes(count, One.magnitude); + Array.Clear(x, xStart, x.Length - xStart); + } + + return count; + } + + public BigInteger Divide( + BigInteger val) + { + if (val.sign == 0) + throw new ArithmeticException("Division by zero error"); + + if (sign == 0) + return Zero; + + if (val.QuickPow2Check()) // val is power of two + { + BigInteger result = this.Abs().ShiftRight(val.Abs().BitLength - 1); + return val.sign == this.sign ? result : result.Negate(); + } + + int[] mag = (int[]) this.magnitude.Clone(); + + return new BigInteger(this.sign * val.sign, Divide(mag, val.magnitude), true); + } + + public BigInteger[] DivideAndRemainder( + BigInteger val) + { + if (val.sign == 0) + throw new ArithmeticException("Division by zero error"); + + BigInteger[] biggies = new BigInteger[2]; + + if (sign == 0) + { + biggies[0] = Zero; + biggies[1] = Zero; + } + else if (val.QuickPow2Check()) // val is power of two + { + int e = val.Abs().BitLength - 1; + BigInteger quotient = this.Abs().ShiftRight(e); + int[] remainder = this.LastNBits(e); + + biggies[0] = val.sign == this.sign ? quotient : quotient.Negate(); + biggies[1] = new BigInteger(this.sign, remainder, true); + } + else + { + int[] remainder = (int[]) this.magnitude.Clone(); + int[] quotient = Divide(remainder, val.magnitude); + + biggies[0] = new BigInteger(this.sign * val.sign, quotient, true); + biggies[1] = new BigInteger(this.sign, remainder, true); + } + + return biggies; + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + BigInteger biggie = obj as BigInteger; + if (biggie == null) + return false; + + return sign == biggie.sign && IsEqualMagnitude(biggie); + } + + private bool IsEqualMagnitude(BigInteger x) + { + int[] xMag = x.magnitude; + if (magnitude.Length != x.magnitude.Length) + return false; + for (int i = 0; i < magnitude.Length; i++) + { + if (magnitude[i] != x.magnitude[i]) + return false; + } + return true; + } + + public BigInteger Gcd( + BigInteger value) + { + if (value.sign == 0) + return Abs(); + + if (sign == 0) + return value.Abs(); + + BigInteger r; + BigInteger u = this; + BigInteger v = value; + + while (v.sign != 0) + { + r = u.Mod(v); + u = v; + v = r; + } + + return u; + } + + public override int GetHashCode() + { + int hc = magnitude.Length; + if (magnitude.Length > 0) + { + hc ^= magnitude[0]; + + if (magnitude.Length > 1) + { + hc ^= magnitude[magnitude.Length - 1]; + } + } + + return sign < 0 ? ~hc : hc; + } + + // TODO Make public? + private BigInteger Inc() + { + if (this.sign == 0) + return One; + + if (this.sign < 0) + return new BigInteger(-1, doSubBigLil(this.magnitude, One.magnitude), true); + + return AddToMagnitude(One.magnitude); + } + + public int IntValue + { + get + { + if (sign == 0) + return 0; + + int n = magnitude.Length; + + int v = magnitude[n - 1]; + + return sign < 0 ? -v : v; + } + } + + /** + * return whether or not a BigInteger is probably prime with a + * probability of 1 - (1/2)**certainty. + *

From Knuth Vol 2, pg 395.

+ */ + public bool IsProbablePrime(int certainty) + { + return IsProbablePrime(certainty, false); + } + + internal bool IsProbablePrime(int certainty, bool randomlySelected) + { + if (certainty <= 0) + return true; + + BigInteger n = Abs(); + + if (!n.TestBit(0)) + return n.Equals(Two); + + if (n.Equals(One)) + return false; + + return n.CheckProbablePrime(certainty, RandomSource, randomlySelected); + } + + private bool CheckProbablePrime(int certainty, Random random, bool randomlySelected) + { + Debug.Assert(certainty > 0); + Debug.Assert(CompareTo(Two) > 0); + Debug.Assert(TestBit(0)); + + + // Try to reduce the penalty for really small numbers + int numLists = System.Math.Min(BitLength - 1, primeLists.Length); + + for (int i = 0; i < numLists; ++i) + { + int test = Remainder(primeProducts[i]); + + int[] primeList = primeLists[i]; + for (int j = 0; j < primeList.Length; ++j) + { + int prime = primeList[j]; + int qRem = test % prime; + if (qRem == 0) + { + // We may find small numbers in the list + return BitLength < 16 && IntValue == prime; + } + } + } + + + // TODO Special case for < 10^16 (RabinMiller fixed list) +// if (BitLength < 30) +// { +// RabinMiller against 2, 3, 5, 7, 11, 13, 23 is sufficient +// } + + + // TODO Is it worth trying to create a hybrid of these two? + return RabinMillerTest(certainty, random, randomlySelected); +// return SolovayStrassenTest(certainty, random); + +// bool rbTest = RabinMillerTest(certainty, random); +// bool ssTest = SolovayStrassenTest(certainty, random); +// +// Debug.Assert(rbTest == ssTest); +// +// return rbTest; + } + + public bool RabinMillerTest(int certainty, Random random) + { + return RabinMillerTest(certainty, random, false); + } + + internal bool RabinMillerTest(int certainty, Random random, bool randomlySelected) + { + int bits = BitLength; + + Debug.Assert(certainty > 0); + Debug.Assert(bits > 2); + Debug.Assert(TestBit(0)); + + int iterations = ((certainty - 1) / 2) + 1; + if (randomlySelected) + { + int itersFor100Cert = bits >= 1024 ? 4 + : bits >= 512 ? 8 + : bits >= 256 ? 16 + : 50; + + if (certainty < 100) + { + iterations = System.Math.Min(itersFor100Cert, iterations); + } + else + { + iterations -= 50; + iterations += itersFor100Cert; + } + } + + // let n = 1 + d . 2^s + BigInteger n = this; + int s = n.GetLowestSetBitMaskFirst(-1 << 1); + Debug.Assert(s >= 1); + BigInteger r = n.ShiftRight(s); + + // NOTE: Avoid conversion to/from Montgomery form and check for R/-R as result instead + + BigInteger montRadix = One.ShiftLeft(32 * n.magnitude.Length).Remainder(n); + BigInteger minusMontRadix = n.Subtract(montRadix); + + do + { + BigInteger a; + do + { + a = new BigInteger(n.BitLength, random); + } + while (a.sign == 0 || a.CompareTo(n) >= 0 + || a.IsEqualMagnitude(montRadix) || a.IsEqualMagnitude(minusMontRadix)); + + BigInteger y = ModPowMonty(a, r, n, false); + + if (!y.Equals(montRadix)) + { + int j = 0; + while (!y.Equals(minusMontRadix)) + { + if (++j == s) + return false; + + y = ModPowMonty(y, Two, n, false); + + if (y.Equals(montRadix)) + return false; + } + } + } + while (--iterations > 0); + + return true; + } + +// private bool SolovayStrassenTest( +// int certainty, +// Random random) +// { +// Debug.Assert(certainty > 0); +// Debug.Assert(CompareTo(Two) > 0); +// Debug.Assert(TestBit(0)); +// +// BigInteger n = this; +// BigInteger nMinusOne = n.Subtract(One); +// BigInteger e = nMinusOne.ShiftRight(1); +// +// do +// { +// BigInteger a; +// do +// { +// a = new BigInteger(nBitLength, random); +// } +// // NB: Spec says 0 < x < n, but 1 is trivial +// while (a.CompareTo(One) <= 0 || a.CompareTo(n) >= 0); +// +// +// // TODO Check this is redundant given the way Jacobi() works? +//// if (!a.Gcd(n).Equals(One)) +//// return false; +// +// int x = Jacobi(a, n); +// +// if (x == 0) +// return false; +// +// BigInteger check = a.ModPow(e, n); +// +// if (x == 1 && !check.Equals(One)) +// return false; +// +// if (x == -1 && !check.Equals(nMinusOne)) +// return false; +// +// --certainty; +// } +// while (certainty > 0); +// +// return true; +// } +// +// private static int Jacobi( +// BigInteger a, +// BigInteger b) +// { +// Debug.Assert(a.sign >= 0); +// Debug.Assert(b.sign > 0); +// Debug.Assert(b.TestBit(0)); +// Debug.Assert(a.CompareTo(b) < 0); +// +// int totalS = 1; +// for (;;) +// { +// if (a.sign == 0) +// return 0; +// +// if (a.Equals(One)) +// break; +// +// int e = a.GetLowestSetBit(); +// +// int bLsw = b.magnitude[b.magnitude.Length - 1]; +// if ((e & 1) != 0 && ((bLsw & 7) == 3 || (bLsw & 7) == 5)) +// totalS = -totalS; +// +// // TODO Confirm this is faster than later a1.Equals(One) test +// if (a.BitLength == e + 1) +// break; +// BigInteger a1 = a.ShiftRight(e); +//// if (a1.Equals(One)) +//// break; +// +// int a1Lsw = a1.magnitude[a1.magnitude.Length - 1]; +// if ((bLsw & 3) == 3 && (a1Lsw & 3) == 3) +// totalS = -totalS; +// +//// a = b.Mod(a1); +// a = b.Remainder(a1); +// b = a1; +// } +// return totalS; +// } + + public long LongValue + { + get + { + if (sign == 0) + return 0; + + int n = magnitude.Length; + + long v = magnitude[n - 1] & IMASK; + if (n > 1) + { + v |= (magnitude[n - 2] & IMASK) << 32; + } + + return sign < 0 ? -v : v; + } + } + + public BigInteger Max( + BigInteger value) + { + return CompareTo(value) > 0 ? this : value; + } + + public BigInteger Min( + BigInteger value) + { + return CompareTo(value) < 0 ? this : value; + } + + public BigInteger Mod( + BigInteger m) + { + if (m.sign < 1) + throw new ArithmeticException("Modulus must be positive"); + + BigInteger biggie = Remainder(m); + + return (biggie.sign >= 0 ? biggie : biggie.Add(m)); + } + + public BigInteger ModInverse( + BigInteger m) + { + if (m.sign < 1) + throw new ArithmeticException("Modulus must be positive"); + + // TODO Too slow at the moment +// // "Fast Key Exchange with Elliptic Curve Systems" R.Schoeppel +// if (m.TestBit(0)) +// { +// //The Almost Inverse Algorithm +// int k = 0; +// BigInteger B = One, C = Zero, F = this, G = m, tmp; +// +// for (;;) +// { +// // While F is even, do F=F/u, C=C*u, k=k+1. +// int zeroes = F.GetLowestSetBit(); +// if (zeroes > 0) +// { +// F = F.ShiftRight(zeroes); +// C = C.ShiftLeft(zeroes); +// k += zeroes; +// } +// +// // If F = 1, then return B,k. +// if (F.Equals(One)) +// { +// BigInteger half = m.Add(One).ShiftRight(1); +// BigInteger halfK = half.ModPow(BigInteger.ValueOf(k), m); +// return B.Multiply(halfK).Mod(m); +// } +// +// if (F.CompareTo(G) < 0) +// { +// tmp = G; G = F; F = tmp; +// tmp = B; B = C; C = tmp; +// } +// +// F = F.Add(G); +// B = B.Add(C); +// } +// } + + if (m.QuickPow2Check()) + { + return ModInversePow2(m); + } + + BigInteger d = this.Remainder(m); + BigInteger x; + BigInteger gcd = ExtEuclid(d, m, out x); + + if (!gcd.Equals(One)) + throw new ArithmeticException("Numbers not relatively prime."); + + if (x.sign < 0) + { + x = x.Add(m); + } + + return x; + } + + private BigInteger ModInversePow2(BigInteger m) + { + Debug.Assert(m.SignValue > 0); + Debug.Assert(m.BitCount == 1); + + if (!TestBit(0)) + { + throw new ArithmeticException("Numbers not relatively prime."); + } + + int pow = m.BitLength - 1; + + long inv64 = ModInverse64(LongValue); + if (pow < 64) + { + inv64 &= ((1L << pow) - 1); + } + + BigInteger x = BigInteger.ValueOf(inv64); + + if (pow > 64) + { + BigInteger d = this.Remainder(m); + int bitsCorrect = 64; + + do + { + BigInteger t = x.Multiply(d).Remainder(m); + x = x.Multiply(Two.Subtract(t)).Remainder(m); + bitsCorrect <<= 1; + } + while (bitsCorrect < pow); + } + + if (x.sign < 0) + { + x = x.Add(m); + } + + return x; + } + + private static int ModInverse32(int d) + { + // Newton's method with initial estimate "correct to 4 bits" + Debug.Assert((d & 1) != 0); + int x = d + (((d + 1) & 4) << 1); // d.x == 1 mod 2**4 + Debug.Assert(((d * x) & 15) == 1); + x *= 2 - d * x; // d.x == 1 mod 2**8 + x *= 2 - d * x; // d.x == 1 mod 2**16 + x *= 2 - d * x; // d.x == 1 mod 2**32 + Debug.Assert(d * x == 1); + return x; + } + + private static long ModInverse64(long d) + { + // Newton's method with initial estimate "correct to 4 bits" + Debug.Assert((d & 1L) != 0); + long x = d + (((d + 1L) & 4L) << 1); // d.x == 1 mod 2**4 + Debug.Assert(((d * x) & 15L) == 1L); + x *= 2 - d * x; // d.x == 1 mod 2**8 + x *= 2 - d * x; // d.x == 1 mod 2**16 + x *= 2 - d * x; // d.x == 1 mod 2**32 + x *= 2 - d * x; // d.x == 1 mod 2**64 + Debug.Assert(d * x == 1L); + return x; + } + + /** + * Calculate the numbers u1, u2, and u3 such that: + * + * u1 * a + u2 * b = u3 + * + * where u3 is the greatest common divider of a and b. + * a and b using the extended Euclid algorithm (refer p. 323 + * of The Art of Computer Programming vol 2, 2nd ed). + * This also seems to have the side effect of calculating + * some form of multiplicative inverse. + * + * @param a First number to calculate gcd for + * @param b Second number to calculate gcd for + * @param u1Out the return object for the u1 value + * @return The greatest common divisor of a and b + */ + private static BigInteger ExtEuclid(BigInteger a, BigInteger b, out BigInteger u1Out) + { + BigInteger u1 = One, v1 = Zero; + BigInteger u3 = a, v3 = b; + + if (v3.sign > 0) + { + for (;;) + { + BigInteger[] q = u3.DivideAndRemainder(v3); + u3 = v3; + v3 = q[1]; + + BigInteger oldU1 = u1; + u1 = v1; + + if (v3.sign <= 0) + break; + + v1 = oldU1.Subtract(v1.Multiply(q[0])); + } + } + + u1Out = u1; + + return u3; + } + + private static void ZeroOut( + int[] x) + { + Array.Clear(x, 0, x.Length); + } + + public BigInteger ModPow(BigInteger e, BigInteger m) + { + if (m.sign < 1) + throw new ArithmeticException("Modulus must be positive"); + + if (m.Equals(One)) + return Zero; + + if (e.sign == 0) + return One; + + if (sign == 0) + return Zero; + + bool negExp = e.sign < 0; + if (negExp) + e = e.Negate(); + + BigInteger result = this.Mod(m); + if (!e.Equals(One)) + { + if ((m.magnitude[m.magnitude.Length - 1] & 1) == 0) + { + result = ModPowBarrett(result, e, m); + } + else + { + result = ModPowMonty(result, e, m, true); + } + } + + if (negExp) + result = result.ModInverse(m); + + return result; + } + + private static BigInteger ModPowBarrett(BigInteger b, BigInteger e, BigInteger m) + { + int k = m.magnitude.Length; + BigInteger mr = One.ShiftLeft((k + 1) << 5); + BigInteger yu = One.ShiftLeft(k << 6).Divide(m); + + // Sliding window from MSW to LSW + int extraBits = 0, expLength = e.BitLength; + while (expLength > ExpWindowThresholds[extraBits]) + { + ++extraBits; + } + + int numPowers = 1 << extraBits; + BigInteger[] oddPowers = new BigInteger[numPowers]; + oddPowers[0] = b; + + BigInteger b2 = ReduceBarrett(b.Square(), m, mr, yu); + + for (int i = 1; i < numPowers; ++i) + { + oddPowers[i] = ReduceBarrett(oddPowers[i - 1].Multiply(b2), m, mr, yu); + } + + int[] windowList = GetWindowList(e.magnitude, extraBits); + Debug.Assert(windowList.Length > 0); + + int window = windowList[0]; + int mult = window & 0xFF, lastZeroes = window >> 8; + + BigInteger y; + if (mult == 1) + { + y = b2; + --lastZeroes; + } + else + { + y = oddPowers[mult >> 1]; + } + + int windowPos = 1; + while ((window = windowList[windowPos++]) != -1) + { + mult = window & 0xFF; + + int bits = lastZeroes + BitLengthTable[mult]; + for (int j = 0; j < bits; ++j) + { + y = ReduceBarrett(y.Square(), m, mr, yu); + } + + y = ReduceBarrett(y.Multiply(oddPowers[mult >> 1]), m, mr, yu); + + lastZeroes = window >> 8; + } + + for (int i = 0; i < lastZeroes; ++i) + { + y = ReduceBarrett(y.Square(), m, mr, yu); + } + + return y; + } + + private static BigInteger ReduceBarrett(BigInteger x, BigInteger m, BigInteger mr, BigInteger yu) + { + int xLen = x.BitLength, mLen = m.BitLength; + if (xLen < mLen) + return x; + + if (xLen - mLen > 1) + { + int k = m.magnitude.Length; + + BigInteger q1 = x.DivideWords(k - 1); + BigInteger q2 = q1.Multiply(yu); // TODO Only need partial multiplication here + BigInteger q3 = q2.DivideWords(k + 1); + + BigInteger r1 = x.RemainderWords(k + 1); + BigInteger r2 = q3.Multiply(m); // TODO Only need partial multiplication here + BigInteger r3 = r2.RemainderWords(k + 1); + + x = r1.Subtract(r3); + if (x.sign < 0) + { + x = x.Add(mr); + } + } + + while (x.CompareTo(m) >= 0) + { + x = x.Subtract(m); + } + + return x; + } + + private static BigInteger ModPowMonty(BigInteger b, BigInteger e, BigInteger m, bool convert) + { + int n = m.magnitude.Length; + int powR = 32 * n; + bool smallMontyModulus = m.BitLength + 2 <= powR; + uint mDash = (uint)m.GetMQuote(); + + // tmp = this * R mod m + if (convert) + { + b = b.ShiftLeft(powR).Remainder(m); + } + + int[] yAccum = new int[n + 1]; + + int[] zVal = b.magnitude; + Debug.Assert(zVal.Length <= n); + if (zVal.Length < n) + { + int[] tmp = new int[n]; + zVal.CopyTo(tmp, n - zVal.Length); + zVal = tmp; + } + + // Sliding window from MSW to LSW + + int extraBits = 0; + + // Filter the common case of small RSA exponents with few bits set + if (e.magnitude.Length > 1 || e.BitCount > 2) + { + int expLength = e.BitLength; + while (expLength > ExpWindowThresholds[extraBits]) + { + ++extraBits; + } + } + + int numPowers = 1 << extraBits; + int[][] oddPowers = new int[numPowers][]; + oddPowers[0] = zVal; + + int[] zSquared = Arrays.Clone(zVal); + SquareMonty(yAccum, zSquared, m.magnitude, mDash, smallMontyModulus); + + for (int i = 1; i < numPowers; ++i) + { + oddPowers[i] = Arrays.Clone(oddPowers[i - 1]); + MultiplyMonty(yAccum, oddPowers[i], zSquared, m.magnitude, mDash, smallMontyModulus); + } + + int[] windowList = GetWindowList(e.magnitude, extraBits); + Debug.Assert(windowList.Length > 1); + + int window = windowList[0]; + int mult = window & 0xFF, lastZeroes = window >> 8; + + int[] yVal; + if (mult == 1) + { + yVal = zSquared; + --lastZeroes; + } + else + { + yVal = Arrays.Clone(oddPowers[mult >> 1]); + } + + int windowPos = 1; + while ((window = windowList[windowPos++]) != -1) + { + mult = window & 0xFF; + + int bits = lastZeroes + BitLengthTable[mult]; + for (int j = 0; j < bits; ++j) + { + SquareMonty(yAccum, yVal, m.magnitude, mDash, smallMontyModulus); + } + + MultiplyMonty(yAccum, yVal, oddPowers[mult >> 1], m.magnitude, mDash, smallMontyModulus); + + lastZeroes = window >> 8; + } + + for (int i = 0; i < lastZeroes; ++i) + { + SquareMonty(yAccum, yVal, m.magnitude, mDash, smallMontyModulus); + } + + if (convert) + { + // Return y * R^(-1) mod m + MontgomeryReduce(yVal, m.magnitude, mDash); + } + else if (smallMontyModulus && CompareTo(0, yVal, 0, m.magnitude) >= 0) + { + Subtract(0, yVal, 0, m.magnitude); + } + + return new BigInteger(1, yVal, true); + } + + private static int[] GetWindowList(int[] mag, int extraBits) + { + int v = mag[0]; + Debug.Assert(v != 0); + + int leadingBits = BitLen(v); + + int resultSize = (((mag.Length - 1) << 5) + leadingBits) / (1 + extraBits) + 2; + int[] result = new int[resultSize]; + int resultPos = 0; + + int bitPos = 33 - leadingBits; + v <<= bitPos; + + int mult = 1, multLimit = 1 << extraBits; + int zeroes = 0; + + int i = 0; + for (; ; ) + { + for (; bitPos < 32; ++bitPos) + { + if (mult < multLimit) + { + mult = (mult << 1) | (int)((uint)v >> 31); + } + else if (v < 0) + { + result[resultPos++] = CreateWindowEntry(mult, zeroes); + mult = 1; + zeroes = 0; + } + else + { + ++zeroes; + } + + v <<= 1; + } + + if (++i == mag.Length) + { + result[resultPos++] = CreateWindowEntry(mult, zeroes); + break; + } + + v = mag[i]; + bitPos = 0; + } + + result[resultPos] = -1; + return result; + } + + private static int CreateWindowEntry(int mult, int zeroes) + { + while ((mult & 1) == 0) + { + mult >>= 1; + ++zeroes; + } + + return mult | (zeroes << 8); + } + + /** + * return w with w = x * x - w is assumed to have enough space. + */ + private static int[] Square( + int[] w, + int[] x) + { + // Note: this method allows w to be only (2 * x.Length - 1) words if result will fit +// if (w.Length != 2 * x.Length) +// throw new ArgumentException("no I don't think so..."); + + ulong c; + + int wBase = w.Length - 1; + + for (int i = x.Length - 1; i > 0; --i) + { + ulong v = (uint)x[i]; + + c = v * v + (uint)w[wBase]; + w[wBase] = (int)c; + c >>= 32; + + for (int j = i - 1; j >= 0; --j) + { + ulong prod = v * (uint)x[j]; + + c += ((uint)w[--wBase] & UIMASK) + ((uint)prod << 1); + w[wBase] = (int)c; + c = (c >> 32) + (prod >> 31); + } + + c += (uint)w[--wBase]; + w[wBase] = (int)c; + + if (--wBase >= 0) + { + w[wBase] = (int)(c >> 32); + } + else + { + Debug.Assert((c >> 32) == 0); + } + + wBase += i; + } + + c = (uint)x[0]; + + c = c * c + (uint)w[wBase]; + w[wBase] = (int)c; + + if (--wBase >= 0) + { + w[wBase] += (int)(c >> 32); + } + else + { + Debug.Assert((c >> 32) == 0); + } + + return w; + } + + /** + * return x with x = y * z - x is assumed to have enough space. + */ + private static int[] Multiply(int[] x, int[] y, int[] z) + { + int i = z.Length; + + if (i < 1) + return x; + + int xBase = x.Length - y.Length; + + do + { + long a = z[--i] & IMASK; + long val = 0; + + if (a != 0) + { + for (int j = y.Length - 1; j >= 0; j--) + { + val += a * (y[j] & IMASK) + (x[xBase + j] & IMASK); + + x[xBase + j] = (int)val; + + val = (long)((ulong)val >> 32); + } + } + + --xBase; + + if (xBase >= 0) + { + x[xBase] = (int)val; + } + else + { + Debug.Assert(val == 0); + } + } + while (i > 0); + + return x; + } + + /** + * Calculate mQuote = -m^(-1) mod b with b = 2^32 (32 = word size) + */ + private int GetMQuote() + { + if (mQuote != 0) + { + return mQuote; // already calculated + } + + Debug.Assert(this.sign > 0); + + int d = -magnitude[magnitude.Length - 1]; + + Debug.Assert((d & 1) != 0); + + return mQuote = ModInverse32(d); + } + + private static void MontgomeryReduce(int[] x, int[] m, uint mDash) // mDash = -m^(-1) mod b + { + // NOTE: Not a general purpose reduction (which would allow x up to twice the bitlength of m) + Debug.Assert(x.Length == m.Length); + + int n = m.Length; + + for (int i = n - 1; i >= 0; --i) + { + uint x0 = (uint)x[n - 1]; + ulong t = x0 * mDash; + + ulong carry = t * (uint)m[n - 1] + x0; + Debug.Assert((uint)carry == 0); + carry >>= 32; + + for (int j = n - 2; j >= 0; --j) + { + carry += t * (uint)m[j] + (uint)x[j]; + x[j + 1] = (int)carry; + carry >>= 32; + } + + x[0] = (int)carry; + Debug.Assert(carry >> 32 == 0); + } + + if (CompareTo(0, x, 0, m) >= 0) + { + Subtract(0, x, 0, m); + } + } + + /** + * Montgomery multiplication: a = x * y * R^(-1) mod m + *
+ * Based algorithm 14.36 of Handbook of Applied Cryptography. + *
+ *
  • m, x, y should have length n
  • + *
  • a should have length (n + 1)
  • + *
  • b = 2^32, R = b^n
  • + *
    + * The result is put in x + *
    + * NOTE: the indices of x, y, m, a different in HAC and in Java + */ + private static void MultiplyMonty(int[] a, int[] x, int[] y, int[] m, uint mDash, bool smallMontyModulus) + // mDash = -m^(-1) mod b + { + int n = m.Length; + + if (n == 1) + { + x[0] = (int)MultiplyMontyNIsOne((uint)x[0], (uint)y[0], (uint)m[0], mDash); + return; + } + + uint y0 = (uint)y[n - 1]; + int aMax; + + { + ulong xi = (uint)x[n - 1]; + + ulong carry = xi * y0; + ulong t = (uint)carry * mDash; + + ulong prod2 = t * (uint)m[n - 1]; + carry += (uint)prod2; + Debug.Assert((uint)carry == 0); + carry = (carry >> 32) + (prod2 >> 32); + + for (int j = n - 2; j >= 0; --j) + { + ulong prod1 = xi * (uint)y[j]; + prod2 = t * (uint)m[j]; + + carry += (prod1 & UIMASK) + (uint)prod2; + a[j + 2] = (int)carry; + carry = (carry >> 32) + (prod1 >> 32) + (prod2 >> 32); + } + + a[1] = (int)carry; + aMax = (int)(carry >> 32); + } + + for (int i = n - 2; i >= 0; --i) + { + uint a0 = (uint)a[n]; + ulong xi = (uint)x[i]; + + ulong prod1 = xi * y0; + ulong carry = (prod1 & UIMASK) + a0; + ulong t = (uint)carry * mDash; + + ulong prod2 = t * (uint)m[n - 1]; + carry += (uint)prod2; + Debug.Assert((uint)carry == 0); + carry = (carry >> 32) + (prod1 >> 32) + (prod2 >> 32); + + for (int j = n - 2; j >= 0; --j) + { + prod1 = xi * (uint)y[j]; + prod2 = t * (uint)m[j]; + + carry += (prod1 & UIMASK) + (uint)prod2 + (uint)a[j + 1]; + a[j + 2] = (int)carry; + carry = (carry >> 32) + (prod1 >> 32) + (prod2 >> 32); + } + + carry += (uint)aMax; + a[1] = (int)carry; + aMax = (int)(carry >> 32); + } + + a[0] = aMax; + + if (!smallMontyModulus && CompareTo(0, a, 0, m) >= 0) + { + Subtract(0, a, 0, m); + } + + Array.Copy(a, 1, x, 0, n); + } + + private static void SquareMonty(int[] a, int[] x, int[] m, uint mDash, bool smallMontyModulus) + // mDash = -m^(-1) mod b + { + int n = m.Length; + + if (n == 1) + { + uint xVal = (uint)x[0]; + x[0] = (int)MultiplyMontyNIsOne(xVal, xVal, (uint)m[0], mDash); + return; + } + + ulong x0 = (uint)x[n - 1]; + int aMax; + + { + ulong carry = x0 * x0; + ulong t = (uint)carry * mDash; + + ulong prod2 = t * (uint)m[n - 1]; + carry += (uint)prod2; + Debug.Assert((uint)carry == 0); + carry = (carry >> 32) + (prod2 >> 32); + + for (int j = n - 2; j >= 0; --j) + { + ulong prod1 = x0 * (uint)x[j]; + prod2 = t * (uint)m[j]; + + carry += (prod2 & UIMASK) + ((uint)prod1 << 1); + a[j + 2] = (int)carry; + carry = (carry >> 32) + (prod1 >> 31) + (prod2 >> 32); + } + + a[1] = (int)carry; + aMax = (int)(carry >> 32); + } + + for (int i = n - 2; i >= 0; --i) + { + uint a0 = (uint)a[n]; + ulong t = a0 * mDash; + + ulong carry = t * (uint)m[n - 1] + a0; + Debug.Assert((uint)carry == 0); + carry >>= 32; + + for (int j = n - 2; j > i; --j) + { + carry += t * (uint)m[j] + (uint)a[j + 1]; + a[j + 2] = (int)carry; + carry >>= 32; + } + + ulong xi = (uint)x[i]; + + { + ulong prod1 = xi * xi; + ulong prod2 = t * (uint)m[i]; + + carry += (prod1 & UIMASK) + (uint)prod2 + (uint)a[i + 1]; + a[i + 2] = (int)carry; + carry = (carry >> 32) + (prod1 >> 32) + (prod2 >> 32); + } + + for (int j = i - 1; j >= 0; --j) + { + ulong prod1 = xi * (uint)x[j]; + ulong prod2 = t * (uint)m[j]; + + carry += (prod2 & UIMASK) + ((uint)prod1 << 1) + (uint)a[j + 1]; + a[j + 2] = (int)carry; + carry = (carry >> 32) + (prod1 >> 31) + (prod2 >> 32); + } + + carry += (uint)aMax; + a[1] = (int)carry; + aMax = (int)(carry >> 32); + } + + a[0] = aMax; + + if (!smallMontyModulus && CompareTo(0, a, 0, m) >= 0) + { + Subtract(0, a, 0, m); + } + + Array.Copy(a, 1, x, 0, n); + } + + private static uint MultiplyMontyNIsOne(uint x, uint y, uint m, uint mDash) + { + ulong carry = (ulong)x * y; + uint t = (uint)carry * mDash; + ulong um = m; + ulong prod2 = um * t; + carry += (uint)prod2; + Debug.Assert((uint)carry == 0); + carry = (carry >> 32) + (prod2 >> 32); + if (carry > um) + { + carry -= um; + } + Debug.Assert(carry < um); + return (uint)carry; + } + + public BigInteger Multiply( + BigInteger val) + { + if (val == this) + return Square(); + + if ((sign & val.sign) == 0) + return Zero; + + if (val.QuickPow2Check()) // val is power of two + { + BigInteger result = this.ShiftLeft(val.Abs().BitLength - 1); + return val.sign > 0 ? result : result.Negate(); + } + + if (this.QuickPow2Check()) // this is power of two + { + BigInteger result = val.ShiftLeft(this.Abs().BitLength - 1); + return this.sign > 0 ? result : result.Negate(); + } + + int resLength = magnitude.Length + val.magnitude.Length; + int[] res = new int[resLength]; + + Multiply(res, this.magnitude, val.magnitude); + + int resSign = sign ^ val.sign ^ 1; + return new BigInteger(resSign, res, true); + } + + public BigInteger Square() + { + if (sign == 0) + return Zero; + if (this.QuickPow2Check()) + return ShiftLeft(Abs().BitLength - 1); + int resLength = magnitude.Length << 1; + if ((uint)magnitude[0] >> 16 == 0) + --resLength; + int[] res = new int[resLength]; + Square(res, magnitude); + return new BigInteger(1, res, false); + } + + public BigInteger Negate() + { + if (sign == 0) + return this; + + return new BigInteger(-sign, magnitude, false); + } + + public BigInteger NextProbablePrime() + { + if (sign < 0) + throw new ArithmeticException("Cannot be called on value < 0"); + + if (CompareTo(Two) < 0) + return Two; + + BigInteger n = Inc().SetBit(0); + + while (!n.CheckProbablePrime(100, RandomSource, false)) + { + n = n.Add(Two); + } + + return n; + } + + public BigInteger Not() + { + return Inc().Negate(); + } + + public BigInteger Pow(int exp) + { + if (exp <= 0) + { + if (exp < 0) + throw new ArithmeticException("Negative exponent"); + + return One; + } + + if (sign == 0) + { + return this; + } + + if (QuickPow2Check()) + { + long powOf2 = (long)exp * (BitLength - 1); + if (powOf2 > Int32.MaxValue) + { + throw new ArithmeticException("Result too large"); + } + return One.ShiftLeft((int)powOf2); + } + + BigInteger y = One; + BigInteger z = this; + + for (;;) + { + if ((exp & 0x1) == 1) + { + y = y.Multiply(z); + } + exp >>= 1; + if (exp == 0) break; + z = z.Multiply(z); + } + + return y; + } + + public static BigInteger ProbablePrime( + int bitLength, + Random random) + { + return new BigInteger(bitLength, 100, random); + } + + private int Remainder( + int m) + { + Debug.Assert(m > 0); + + long acc = 0; + for (int pos = 0; pos < magnitude.Length; ++pos) + { + long posVal = (uint) magnitude[pos]; + acc = (acc << 32 | posVal) % m; + } + + return (int) acc; + } + + /** + * return x = x % y - done in place (y value preserved) + */ + private static int[] Remainder( + int[] x, + int[] y) + { + int xStart = 0; + while (xStart < x.Length && x[xStart] == 0) + { + ++xStart; + } + + int yStart = 0; + while (yStart < y.Length && y[yStart] == 0) + { + ++yStart; + } + + Debug.Assert(yStart < y.Length); + + int xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); + + if (xyCmp > 0) + { + int yBitLength = CalcBitLength(1, yStart, y); + int xBitLength = CalcBitLength(1, xStart, x); + int shift = xBitLength - yBitLength; + + int[] c; + int cStart = 0; + int cBitLength = yBitLength; + if (shift > 0) + { + c = ShiftLeft(y, shift); + cBitLength += shift; + Debug.Assert(c[0] != 0); + } + else + { + int len = y.Length - yStart; + c = new int[len]; + Array.Copy(y, yStart, c, 0, len); + } + + for (;;) + { + if (cBitLength < xBitLength + || CompareNoLeadingZeroes(xStart, x, cStart, c) >= 0) + { + Subtract(xStart, x, cStart, c); + + while (x[xStart] == 0) + { + if (++xStart == x.Length) + return x; + } + + //xBitLength = CalcBitLength(xStart, x); + xBitLength = 32 * (x.Length - xStart - 1) + BitLen(x[xStart]); + + if (xBitLength <= yBitLength) + { + if (xBitLength < yBitLength) + return x; + + xyCmp = CompareNoLeadingZeroes(xStart, x, yStart, y); + + if (xyCmp <= 0) + break; + } + } + + shift = cBitLength - xBitLength; + + // NB: The case where c[cStart] is 1-bit is harmless + if (shift == 1) + { + uint firstC = (uint) c[cStart] >> 1; + uint firstX = (uint) x[xStart]; + if (firstC > firstX) + ++shift; + } + + if (shift < 2) + { + ShiftRightOneInPlace(cStart, c); + --cBitLength; + } + else + { + ShiftRightInPlace(cStart, c, shift); + cBitLength -= shift; + } + + //cStart = c.Length - ((cBitLength + 31) / 32); + while (c[cStart] == 0) + { + ++cStart; + } + } + } + + if (xyCmp == 0) + { + Array.Clear(x, xStart, x.Length - xStart); + } + + return x; + } + + public BigInteger Remainder( + BigInteger n) + { + if (n.sign == 0) + throw new ArithmeticException("Division by zero error"); + + if (this.sign == 0) + return Zero; + + // For small values, use fast remainder method + if (n.magnitude.Length == 1) + { + int val = n.magnitude[0]; + + if (val > 0) + { + if (val == 1) + return Zero; + + // TODO Make this func work on uint, and handle val == 1? + int rem = Remainder(val); + + return rem == 0 + ? Zero + : new BigInteger(sign, new int[]{ rem }, false); + } + } + + if (CompareNoLeadingZeroes(0, magnitude, 0, n.magnitude) < 0) + return this; + + int[] result; + if (n.QuickPow2Check()) // n is power of two + { + // TODO Move before small values branch above? + result = LastNBits(n.Abs().BitLength - 1); + } + else + { + result = (int[]) this.magnitude.Clone(); + result = Remainder(result, n.magnitude); + } + + return new BigInteger(sign, result, true); + } + + private int[] LastNBits( + int n) + { + if (n < 1) + return ZeroMagnitude; + + int numWords = (n + BitsPerInt - 1) / BitsPerInt; + numWords = System.Math.Min(numWords, this.magnitude.Length); + int[] result = new int[numWords]; + + Array.Copy(this.magnitude, this.magnitude.Length - numWords, result, 0, numWords); + + int excessBits = (numWords << 5) - n; + if (excessBits > 0) + { + result[0] &= (int)(UInt32.MaxValue >> excessBits); + } + + return result; + } + + private BigInteger DivideWords(int w) + { + Debug.Assert(w >= 0); + int n = magnitude.Length; + if (w >= n) + return Zero; + int[] mag = new int[n - w]; + Array.Copy(magnitude, 0, mag, 0, n - w); + return new BigInteger(sign, mag, false); + } + + private BigInteger RemainderWords(int w) + { + Debug.Assert(w >= 0); + int n = magnitude.Length; + if (w >= n) + return this; + int[] mag = new int[w]; + Array.Copy(magnitude, n - w, mag, 0, w); + return new BigInteger(sign, mag, false); + } + + /** + * do a left shift - this returns a new array. + */ + private static int[] ShiftLeft( + int[] mag, + int n) + { + int nInts = (int)((uint)n >> 5); + int nBits = n & 0x1f; + int magLen = mag.Length; + int[] newMag; + + if (nBits == 0) + { + newMag = new int[magLen + nInts]; + mag.CopyTo(newMag, 0); + } + else + { + int i = 0; + int nBits2 = 32 - nBits; + int highBits = (int)((uint)mag[0] >> nBits2); + + if (highBits != 0) + { + newMag = new int[magLen + nInts + 1]; + newMag[i++] = highBits; + } + else + { + newMag = new int[magLen + nInts]; + } + + int m = mag[0]; + for (int j = 0; j < magLen - 1; j++) + { + int next = mag[j + 1]; + + newMag[i++] = (m << nBits) | (int)((uint)next >> nBits2); + m = next; + } + + newMag[i] = mag[magLen - 1] << nBits; + } + + return newMag; + } + + private static int ShiftLeftOneInPlace(int[] x, int carry) + { + Debug.Assert(carry == 0 || carry == 1); + int pos = x.Length; + while (--pos >= 0) + { + uint val = (uint)x[pos]; + x[pos] = (int)(val << 1) | carry; + carry = (int)(val >> 31); + } + return carry; + } + + public BigInteger ShiftLeft( + int n) + { + if (sign == 0 || magnitude.Length == 0) + return Zero; + + if (n == 0) + return this; + + if (n < 0) + return ShiftRight(-n); + + BigInteger result = new BigInteger(sign, ShiftLeft(magnitude, n), true); + + if (this.nBits != -1) + { + result.nBits = sign > 0 + ? this.nBits + : this.nBits + n; + } + + if (this.nBitLength != -1) + { + result.nBitLength = this.nBitLength + n; + } + + return result; + } + + /** + * do a right shift - this does it in place. + */ + private static void ShiftRightInPlace( + int start, + int[] mag, + int n) + { + int nInts = (int)((uint)n >> 5) + start; + int nBits = n & 0x1f; + int magEnd = mag.Length - 1; + + if (nInts != start) + { + int delta = (nInts - start); + + for (int i = magEnd; i >= nInts; i--) + { + mag[i] = mag[i - delta]; + } + for (int i = nInts - 1; i >= start; i--) + { + mag[i] = 0; + } + } + + if (nBits != 0) + { + int nBits2 = 32 - nBits; + int m = mag[magEnd]; + + for (int i = magEnd; i > nInts; --i) + { + int next = mag[i - 1]; + + mag[i] = (int)((uint)m >> nBits) | (next << nBits2); + m = next; + } + + mag[nInts] = (int)((uint)mag[nInts] >> nBits); + } + } + + /** + * do a right shift by one - this does it in place. + */ + private static void ShiftRightOneInPlace( + int start, + int[] mag) + { + int i = mag.Length; + int m = mag[i - 1]; + + while (--i > start) + { + int next = mag[i - 1]; + mag[i] = ((int)((uint)m >> 1)) | (next << 31); + m = next; + } + + mag[start] = (int)((uint)mag[start] >> 1); + } + + public BigInteger ShiftRight( + int n) + { + if (n == 0) + return this; + + if (n < 0) + return ShiftLeft(-n); + + if (n >= BitLength) + return (this.sign < 0 ? One.Negate() : Zero); + +// int[] res = (int[]) this.magnitude.Clone(); +// +// ShiftRightInPlace(0, res, n); +// +// return new BigInteger(this.sign, res, true); + + int resultLength = (BitLength - n + 31) >> 5; + int[] res = new int[resultLength]; + + int numInts = n >> 5; + int numBits = n & 31; + + if (numBits == 0) + { + Array.Copy(this.magnitude, 0, res, 0, res.Length); + } + else + { + int numBits2 = 32 - numBits; + + int magPos = this.magnitude.Length - 1 - numInts; + for (int i = resultLength - 1; i >= 0; --i) + { + res[i] = (int)((uint) this.magnitude[magPos--] >> numBits); + + if (magPos >= 0) + { + res[i] |= this.magnitude[magPos] << numBits2; + } + } + } + + Debug.Assert(res[0] != 0); + + return new BigInteger(this.sign, res, false); + } + + public int SignValue + { + get { return sign; } + } + + /** + * returns x = x - y - we assume x is >= y + */ + private static int[] Subtract( + int xStart, + int[] x, + int yStart, + int[] y) + { + Debug.Assert(yStart < y.Length); + Debug.Assert(x.Length - xStart >= y.Length - yStart); + + int iT = x.Length; + int iV = y.Length; + long m; + int borrow = 0; + + do + { + m = (x[--iT] & IMASK) - (y[--iV] & IMASK) + borrow; + x[iT] = (int) m; + +// borrow = (m < 0) ? -1 : 0; + borrow = (int)(m >> 63); + } + while (iV > yStart); + + if (borrow != 0) + { + while (--x[--iT] == -1) + { + } + } + + return x; + } + + public BigInteger Subtract( + BigInteger n) + { + if (n.sign == 0) + return this; + + if (this.sign == 0) + return n.Negate(); + + if (this.sign != n.sign) + return Add(n.Negate()); + + int compare = CompareNoLeadingZeroes(0, magnitude, 0, n.magnitude); + if (compare == 0) + return Zero; + + BigInteger bigun, lilun; + if (compare < 0) + { + bigun = n; + lilun = this; + } + else + { + bigun = this; + lilun = n; + } + + return new BigInteger(this.sign * compare, doSubBigLil(bigun.magnitude, lilun.magnitude), true); + } + + private static int[] doSubBigLil( + int[] bigMag, + int[] lilMag) + { + int[] res = (int[]) bigMag.Clone(); + + return Subtract(0, res, 0, lilMag); + } + + public byte[] ToByteArray() + { + return ToByteArray(false); + } + + public byte[] ToByteArrayUnsigned() + { + return ToByteArray(true); + } + + private byte[] ToByteArray( + bool unsigned) + { + if (sign == 0) + return unsigned ? ZeroEncoding : new byte[1]; + + int nBits = (unsigned && sign > 0) + ? BitLength + : BitLength + 1; + + int nBytes = GetByteLength(nBits); + byte[] bytes = new byte[nBytes]; + + int magIndex = magnitude.Length; + int bytesIndex = bytes.Length; + + if (sign > 0) + { + while (magIndex > 1) + { + uint mag = (uint) magnitude[--magIndex]; + bytes[--bytesIndex] = (byte) mag; + bytes[--bytesIndex] = (byte)(mag >> 8); + bytes[--bytesIndex] = (byte)(mag >> 16); + bytes[--bytesIndex] = (byte)(mag >> 24); + } + + uint lastMag = (uint) magnitude[0]; + while (lastMag > byte.MaxValue) + { + bytes[--bytesIndex] = (byte) lastMag; + lastMag >>= 8; + } + + bytes[--bytesIndex] = (byte) lastMag; + } + else // sign < 0 + { + bool carry = true; + + while (magIndex > 1) + { + uint mag = ~((uint) magnitude[--magIndex]); + + if (carry) + { + carry = (++mag == uint.MinValue); + } + + bytes[--bytesIndex] = (byte) mag; + bytes[--bytesIndex] = (byte)(mag >> 8); + bytes[--bytesIndex] = (byte)(mag >> 16); + bytes[--bytesIndex] = (byte)(mag >> 24); + } + + uint lastMag = (uint) magnitude[0]; + + if (carry) + { + // Never wraps because magnitude[0] != 0 + --lastMag; + } + + while (lastMag > byte.MaxValue) + { + bytes[--bytesIndex] = (byte) ~lastMag; + lastMag >>= 8; + } + + bytes[--bytesIndex] = (byte) ~lastMag; + + if (bytesIndex > 0) + { + bytes[--bytesIndex] = byte.MaxValue; + } + } + + return bytes; + } + + public override string ToString() + { + return ToString(10); + } + + public string ToString(int radix) + { + // TODO Make this method work for other radices (ideally 2 <= radix <= 36 as in Java) + + switch (radix) + { + case 2: + case 8: + case 10: + case 16: + break; + default: + throw new FormatException("Only bases 2, 8, 10, 16 are allowed"); + } + + // NB: Can only happen to internally managed instances + if (magnitude == null) + return "null"; + + if (sign == 0) + return "0"; + + + // NOTE: This *should* be unnecessary, since the magnitude *should* never have leading zero digits + int firstNonZero = 0; + while (firstNonZero < magnitude.Length) + { + if (magnitude[firstNonZero] != 0) + { + break; + } + ++firstNonZero; + } + + if (firstNonZero == magnitude.Length) + { + return "0"; + } + + + StringBuilder sb = new StringBuilder(); + if (sign == -1) + { + sb.Append('-'); + } + + switch (radix) + { + case 2: + { + int pos = firstNonZero; + sb.Append(Convert.ToString(magnitude[pos], 2)); + while (++pos < magnitude.Length) + { + AppendZeroExtendedString(sb, Convert.ToString(magnitude[pos], 2), 32); + } + break; + } + case 8: + { + int mask = (1 << 30) - 1; + BigInteger u = this.Abs(); + int bits = u.BitLength; + IList S = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + while (bits > 30) + { + S.Add(Convert.ToString(u.IntValue & mask, 8)); + u = u.ShiftRight(30); + bits -= 30; + } + sb.Append(Convert.ToString(u.IntValue, 8)); + for (int i = S.Count - 1; i >= 0; --i) + { + AppendZeroExtendedString(sb, (string)S[i], 10); + } + break; + } + case 16: + { + int pos = firstNonZero; + sb.Append(Convert.ToString(magnitude[pos], 16)); + while (++pos < magnitude.Length) + { + AppendZeroExtendedString(sb, Convert.ToString(magnitude[pos], 16), 8); + } + break; + } + // TODO This could work for other radices if there is an alternative to Convert.ToString method + //default: + case 10: + { + BigInteger q = this.Abs(); + if (q.BitLength < 64) + { + sb.Append(Convert.ToString(q.LongValue, radix)); + break; + } + + // TODO Could cache the moduli for each radix (soft reference?) + IList moduli = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + BigInteger R = BigInteger.ValueOf(radix); + while (R.CompareTo(q) <= 0) + { + moduli.Add(R); + R = R.Square(); + } + + int scale = moduli.Count; + sb.EnsureCapacity(sb.Length + (1 << scale)); + + ToString(sb, radix, moduli, scale, q); + + break; + } + } + + return sb.ToString(); + } + + private static void ToString(StringBuilder sb, int radix, IList moduli, int scale, BigInteger pos) + { + if (pos.BitLength < 64) + { + string s = Convert.ToString(pos.LongValue, radix); + if (sb.Length > 1 || (sb.Length == 1 && sb[0] != '-')) + { + AppendZeroExtendedString(sb, s, 1 << scale); + } + else if (pos.SignValue != 0) + { + sb.Append(s); + } + return; + } + + BigInteger[] qr = pos.DivideAndRemainder((BigInteger)moduli[--scale]); + + ToString(sb, radix, moduli, scale, qr[0]); + ToString(sb, radix, moduli, scale, qr[1]); + } + + private static void AppendZeroExtendedString(StringBuilder sb, string s, int minLength) + { + for (int len = s.Length; len < minLength; ++len) + { + sb.Append('0'); + } + sb.Append(s); + } + + private static BigInteger CreateUValueOf( + ulong value) + { + int msw = (int)(value >> 32); + int lsw = (int)value; + + if (msw != 0) + return new BigInteger(1, new int[] { msw, lsw }, false); + + if (lsw != 0) + { + BigInteger n = new BigInteger(1, new int[] { lsw }, false); + // Check for a power of two + if ((lsw & -lsw) == lsw) + { + n.nBits = 1; + } + return n; + } + + return Zero; + } + + private static BigInteger CreateValueOf( + long value) + { + if (value < 0) + { + if (value == long.MinValue) + return CreateValueOf(~value).Not(); + + return CreateValueOf(-value).Negate(); + } + + return CreateUValueOf((ulong)value); + } + + public static BigInteger ValueOf( + long value) + { + if (value >= 0 && value < SMALL_CONSTANTS.Length) + { + return SMALL_CONSTANTS[value]; + } + + return CreateValueOf(value); + } + + public int GetLowestSetBit() + { + if (this.sign == 0) + return -1; + + return GetLowestSetBitMaskFirst(-1); + } + + private int GetLowestSetBitMaskFirst(int firstWordMask) + { + int w = magnitude.Length, offset = 0; + + uint word = (uint)(magnitude[--w] & firstWordMask); + Debug.Assert(magnitude[0] != 0); + + while (word == 0) + { + word = (uint)magnitude[--w]; + offset += 32; + } + + while ((word & 0xFF) == 0) + { + word >>= 8; + offset += 8; + } + + while ((word & 1) == 0) + { + word >>= 1; + ++offset; + } + + return offset; + } + + public bool TestBit( + int n) + { + if (n < 0) + throw new ArithmeticException("Bit position must not be negative"); + + if (sign < 0) + return !Not().TestBit(n); + + int wordNum = n / 32; + if (wordNum >= magnitude.Length) + return false; + + int word = magnitude[magnitude.Length - 1 - wordNum]; + return ((word >> (n % 32)) & 1) > 0; + } + + public BigInteger Or( + BigInteger value) + { + if (this.sign == 0) + return value; + + if (value.sign == 0) + return this; + + int[] aMag = this.sign > 0 + ? this.magnitude + : Add(One).magnitude; + + int[] bMag = value.sign > 0 + ? value.magnitude + : value.Add(One).magnitude; + + bool resultNeg = sign < 0 || value.sign < 0; + int resultLength = System.Math.Max(aMag.Length, bMag.Length); + int[] resultMag = new int[resultLength]; + + int aStart = resultMag.Length - aMag.Length; + int bStart = resultMag.Length - bMag.Length; + + for (int i = 0; i < resultMag.Length; ++i) + { + int aWord = i >= aStart ? aMag[i - aStart] : 0; + int bWord = i >= bStart ? bMag[i - bStart] : 0; + + if (this.sign < 0) + { + aWord = ~aWord; + } + + if (value.sign < 0) + { + bWord = ~bWord; + } + + resultMag[i] = aWord | bWord; + + if (resultNeg) + { + resultMag[i] = ~resultMag[i]; + } + } + + BigInteger result = new BigInteger(1, resultMag, true); + + // TODO Optimise this case + if (resultNeg) + { + result = result.Not(); + } + + return result; + } + + public BigInteger Xor( + BigInteger value) + { + if (this.sign == 0) + return value; + + if (value.sign == 0) + return this; + + int[] aMag = this.sign > 0 + ? this.magnitude + : Add(One).magnitude; + + int[] bMag = value.sign > 0 + ? value.magnitude + : value.Add(One).magnitude; + + // TODO Can just replace with sign != value.sign? + bool resultNeg = (sign < 0 && value.sign >= 0) || (sign >= 0 && value.sign < 0); + int resultLength = System.Math.Max(aMag.Length, bMag.Length); + int[] resultMag = new int[resultLength]; + + int aStart = resultMag.Length - aMag.Length; + int bStart = resultMag.Length - bMag.Length; + + for (int i = 0; i < resultMag.Length; ++i) + { + int aWord = i >= aStart ? aMag[i - aStart] : 0; + int bWord = i >= bStart ? bMag[i - bStart] : 0; + + if (this.sign < 0) + { + aWord = ~aWord; + } + + if (value.sign < 0) + { + bWord = ~bWord; + } + + resultMag[i] = aWord ^ bWord; + + if (resultNeg) + { + resultMag[i] = ~resultMag[i]; + } + } + + BigInteger result = new BigInteger(1, resultMag, true); + + // TODO Optimise this case + if (resultNeg) + { + result = result.Not(); + } + + return result; + } + + public BigInteger SetBit( + int n) + { + if (n < 0) + throw new ArithmeticException("Bit address less than zero"); + + if (TestBit(n)) + return this; + + // TODO Handle negative values and zero + if (sign > 0 && n < (BitLength - 1)) + return FlipExistingBit(n); + + return Or(One.ShiftLeft(n)); + } + + public BigInteger ClearBit( + int n) + { + if (n < 0) + throw new ArithmeticException("Bit address less than zero"); + + if (!TestBit(n)) + return this; + + // TODO Handle negative values + if (sign > 0 && n < (BitLength - 1)) + return FlipExistingBit(n); + + return AndNot(One.ShiftLeft(n)); + } + + public BigInteger FlipBit( + int n) + { + if (n < 0) + throw new ArithmeticException("Bit address less than zero"); + + // TODO Handle negative values and zero + if (sign > 0 && n < (BitLength - 1)) + return FlipExistingBit(n); + + return Xor(One.ShiftLeft(n)); + } + + private BigInteger FlipExistingBit( + int n) + { + Debug.Assert(sign > 0); + Debug.Assert(n >= 0); + Debug.Assert(n < BitLength - 1); + + int[] mag = (int[]) this.magnitude.Clone(); + mag[mag.Length - 1 - (n >> 5)] ^= (1 << (n & 31)); // Flip bit + //mag[mag.Length - 1 - (n / 32)] ^= (1 << (n % 32)); + return new BigInteger(this.sign, mag, false); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/BigInteger.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/BigInteger.cs.meta new file mode 100644 index 00000000..64bea156 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/BigInteger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 192ce040c8f883047926a9f104e89219 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/Primes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/Primes.cs new file mode 100644 index 00000000..9775cad3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/Primes.cs @@ -0,0 +1,633 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math +{ + /** + * Utility methods for generating primes and testing for primality. + */ + public abstract class Primes + { + public static readonly int SmallFactorLimit = 211; + + private static readonly BigInteger One = BigInteger.One; + private static readonly BigInteger Two = BigInteger.Two; + private static readonly BigInteger Three = BigInteger.Three; + + /** + * Used to return the output from the + * {@linkplain Primes#enhancedMRProbablePrimeTest(BigInteger, SecureRandom, int) Enhanced + * Miller-Rabin Probabilistic Primality Test} + */ + public class MROutput + { + internal static MROutput ProbablyPrime() + { + return new MROutput(false, null); + } + + internal static MROutput ProvablyCompositeWithFactor(BigInteger factor) + { + return new MROutput(true, factor); + } + + internal static MROutput ProvablyCompositeNotPrimePower() + { + return new MROutput(true, null); + } + + private readonly bool mProvablyComposite; + private readonly BigInteger mFactor; + + private MROutput(bool provablyComposite, BigInteger factor) + { + this.mProvablyComposite = provablyComposite; + this.mFactor = factor; + } + + public BigInteger Factor + { + get { return mFactor; } + } + + public bool IsProvablyComposite + { + get { return mProvablyComposite; } + } + + public bool IsNotPrimePower + { + get { return mProvablyComposite && mFactor == null; } + } + } + + /** + * Used to return the output from the {@linkplain Primes#generateSTRandomPrime(Digest, int, byte[]) Shawe-Taylor Random_Prime Routine} + */ + public class STOutput + { + private readonly BigInteger mPrime; + private readonly byte[] mPrimeSeed; + private readonly int mPrimeGenCounter; + + internal STOutput(BigInteger prime, byte[] primeSeed, int primeGenCounter) + { + this.mPrime = prime; + this.mPrimeSeed = primeSeed; + this.mPrimeGenCounter = primeGenCounter; + } + + public BigInteger Prime + { + get { return mPrime; } + } + + public byte[] PrimeSeed + { + get { return mPrimeSeed; } + } + + public int PrimeGenCounter + { + get { return mPrimeGenCounter; } + } + } + + /** + * FIPS 186-4 C.6 Shawe-Taylor Random_Prime Routine + * + * Construct a provable prime number using a hash function. + * + * @param hash + * the {@link Digest} instance to use (as "Hash()"). Cannot be null. + * @param length + * the length (in bits) of the prime to be generated. Must be at least 2. + * @param inputSeed + * the seed to be used for the generation of the requested prime. Cannot be null or + * empty. + * @return an {@link STOutput} instance containing the requested prime. + */ + public static STOutput GenerateSTRandomPrime(IDigest hash, int length, byte[] inputSeed) + { + if (hash == null) + throw new ArgumentNullException("hash"); + if (length < 2) + throw new ArgumentException("must be >= 2", "length"); + if (inputSeed == null) + throw new ArgumentNullException("inputSeed"); + if (inputSeed.Length == 0) + throw new ArgumentException("cannot be empty", "inputSeed"); + + return ImplSTRandomPrime(hash, length, Arrays.Clone(inputSeed)); + } + + /** + * FIPS 186-4 C.3.2 Enhanced Miller-Rabin Probabilistic Primality Test + * + * Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases. This is an + * alternative to {@link #isMRProbablePrime(BigInteger, SecureRandom, int)} that provides more + * information about a composite candidate, which may be useful when generating or validating + * RSA moduli. + * + * @param candidate + * the {@link BigInteger} instance to test for primality. + * @param random + * the source of randomness to use to choose bases. + * @param iterations + * the number of randomly-chosen bases to perform the test for. + * @return an {@link MROutput} instance that can be further queried for details. + */ + public static MROutput EnhancedMRProbablePrimeTest(BigInteger candidate, SecureRandom random, int iterations) + { + CheckCandidate(candidate, "candidate"); + + if (random == null) + throw new ArgumentNullException("random"); + if (iterations < 1) + throw new ArgumentException("must be > 0", "iterations"); + + if (candidate.BitLength == 2) + return MROutput.ProbablyPrime(); + + if (!candidate.TestBit(0)) + return MROutput.ProvablyCompositeWithFactor(Two); + + BigInteger w = candidate; + BigInteger wSubOne = candidate.Subtract(One); + BigInteger wSubTwo = candidate.Subtract(Two); + + int a = wSubOne.GetLowestSetBit(); + BigInteger m = wSubOne.ShiftRight(a); + + for (int i = 0; i < iterations; ++i) + { + BigInteger b = BigIntegers.CreateRandomInRange(Two, wSubTwo, random); + BigInteger g = b.Gcd(w); + + if (g.CompareTo(One) > 0) + return MROutput.ProvablyCompositeWithFactor(g); + + BigInteger z = b.ModPow(m, w); + + if (z.Equals(One) || z.Equals(wSubOne)) + continue; + + bool primeToBase = false; + + BigInteger x = z; + for (int j = 1; j < a; ++j) + { + z = z.ModPow(Two, w); + + if (z.Equals(wSubOne)) + { + primeToBase = true; + break; + } + + if (z.Equals(One)) + break; + + x = z; + } + + if (!primeToBase) + { + if (!z.Equals(One)) + { + x = z; + z = z.ModPow(Two, w); + + if (!z.Equals(One)) + { + x = z; + } + } + + g = x.Subtract(One).Gcd(w); + + if (g.CompareTo(One) > 0) + return MROutput.ProvablyCompositeWithFactor(g); + + return MROutput.ProvablyCompositeNotPrimePower(); + } + } + + return MROutput.ProbablyPrime(); + } + + /** + * A fast check for small divisors, up to some implementation-specific limit. + * + * @param candidate + * the {@link BigInteger} instance to test for division by small factors. + * + * @return true if the candidate is found to have any small factors, + * false otherwise. + */ + public static bool HasAnySmallFactors(BigInteger candidate) + { + CheckCandidate(candidate, "candidate"); + + return ImplHasAnySmallFactors(candidate); + } + + /** + * FIPS 186-4 C.3.1 Miller-Rabin Probabilistic Primality Test + * + * Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases. + * + * @param candidate + * the {@link BigInteger} instance to test for primality. + * @param random + * the source of randomness to use to choose bases. + * @param iterations + * the number of randomly-chosen bases to perform the test for. + * @return false if any witness to compositeness is found amongst the chosen bases + * (so candidate is definitely NOT prime), or else true + * (indicating primality with some probability dependent on the number of iterations + * that were performed). + */ + public static bool IsMRProbablePrime(BigInteger candidate, SecureRandom random, int iterations) + { + CheckCandidate(candidate, "candidate"); + + if (random == null) + throw new ArgumentException("cannot be null", "random"); + if (iterations < 1) + throw new ArgumentException("must be > 0", "iterations"); + + if (candidate.BitLength == 2) + return true; + if (!candidate.TestBit(0)) + return false; + + BigInteger w = candidate; + BigInteger wSubOne = candidate.Subtract(One); + BigInteger wSubTwo = candidate.Subtract(Two); + + int a = wSubOne.GetLowestSetBit(); + BigInteger m = wSubOne.ShiftRight(a); + + for (int i = 0; i < iterations; ++i) + { + BigInteger b = BigIntegers.CreateRandomInRange(Two, wSubTwo, random); + + if (!ImplMRProbablePrimeToBase(w, wSubOne, m, a, b)) + return false; + } + + return true; + } + + /** + * FIPS 186-4 C.3.1 Miller-Rabin Probabilistic Primality Test (to a fixed base). + * + * Run a single iteration of the Miller-Rabin algorithm against the specified base. + * + * @param candidate + * the {@link BigInteger} instance to test for primality. + * @param baseValue + * the base value to use for this iteration. + * @return false if the specified base is a witness to compositeness (so + * candidate is definitely NOT prime), or else true. + */ + public static bool IsMRProbablePrimeToBase(BigInteger candidate, BigInteger baseValue) + { + CheckCandidate(candidate, "candidate"); + CheckCandidate(baseValue, "baseValue"); + + if (baseValue.CompareTo(candidate.Subtract(One)) >= 0) + throw new ArgumentException("must be < ('candidate' - 1)", "baseValue"); + + if (candidate.BitLength == 2) + return true; + + BigInteger w = candidate; + BigInteger wSubOne = candidate.Subtract(One); + + int a = wSubOne.GetLowestSetBit(); + BigInteger m = wSubOne.ShiftRight(a); + + return ImplMRProbablePrimeToBase(w, wSubOne, m, a, baseValue); + } + + private static void CheckCandidate(BigInteger n, string name) + { + if (n == null || n.SignValue < 1 || n.BitLength < 2) + throw new ArgumentException("must be non-null and >= 2", name); + } + + private static bool ImplHasAnySmallFactors(BigInteger x) + { + /* + * Bundle trial divisors into ~32-bit moduli then use fast tests on the ~32-bit remainders. + */ + int m = 2 * 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23; + int r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 2) == 0 || (r % 3) == 0 || (r % 5) == 0 || (r % 7) == 0 || (r % 11) == 0 || (r % 13) == 0 + || (r % 17) == 0 || (r % 19) == 0 || (r % 23) == 0) + { + return true; + } + + m = 29 * 31 * 37 * 41 * 43; + r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 29) == 0 || (r % 31) == 0 || (r % 37) == 0 || (r % 41) == 0 || (r % 43) == 0) + { + return true; + } + + m = 47 * 53 * 59 * 61 * 67; + r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 47) == 0 || (r % 53) == 0 || (r % 59) == 0 || (r % 61) == 0 || (r % 67) == 0) + { + return true; + } + + m = 71 * 73 * 79 * 83; + r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 71) == 0 || (r % 73) == 0 || (r % 79) == 0 || (r % 83) == 0) + { + return true; + } + + m = 89 * 97 * 101 * 103; + r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 89) == 0 || (r % 97) == 0 || (r % 101) == 0 || (r % 103) == 0) + { + return true; + } + + m = 107 * 109 * 113 * 127; + r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 107) == 0 || (r % 109) == 0 || (r % 113) == 0 || (r % 127) == 0) + { + return true; + } + + m = 131 * 137 * 139 * 149; + r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 131) == 0 || (r % 137) == 0 || (r % 139) == 0 || (r % 149) == 0) + { + return true; + } + + m = 151 * 157 * 163 * 167; + r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 151) == 0 || (r % 157) == 0 || (r % 163) == 0 || (r % 167) == 0) + { + return true; + } + + m = 173 * 179 * 181 * 191; + r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 173) == 0 || (r % 179) == 0 || (r % 181) == 0 || (r % 191) == 0) + { + return true; + } + + m = 193 * 197 * 199 * 211; + r = x.Mod(BigInteger.ValueOf(m)).IntValue; + if ((r % 193) == 0 || (r % 197) == 0 || (r % 199) == 0 || (r % 211) == 0) + { + return true; + } + + /* + * NOTE: Unit tests depend on SMALL_FACTOR_LIMIT matching the + * highest small factor tested here. + */ + return false; + } + + private static bool ImplMRProbablePrimeToBase(BigInteger w, BigInteger wSubOne, BigInteger m, int a, BigInteger b) + { + BigInteger z = b.ModPow(m, w); + + if (z.Equals(One) || z.Equals(wSubOne)) + return true; + + bool result = false; + + for (int j = 1; j < a; ++j) + { + z = z.ModPow(Two, w); + + if (z.Equals(wSubOne)) + { + result = true; + break; + } + + if (z.Equals(One)) + return false; + } + + return result; + } + + private static STOutput ImplSTRandomPrime(IDigest d, int length, byte[] primeSeed) + { + int dLen = d.GetDigestSize(); + + if (length < 33) + { + int primeGenCounter = 0; + + byte[] c0 = new byte[dLen]; + byte[] c1 = new byte[dLen]; + + for (;;) + { + Hash(d, primeSeed, c0, 0); + Inc(primeSeed, 1); + + Hash(d, primeSeed, c1, 0); + Inc(primeSeed, 1); + + uint c = Extract32(c0) ^ Extract32(c1); + c &= (uint.MaxValue >> (32 - length)); + c |= (1U << (length - 1)) | 1U; + + ++primeGenCounter; + + if (IsPrime32(c)) + { + return new STOutput(BigInteger.ValueOf((long)c), primeSeed, primeGenCounter); + } + + if (primeGenCounter > (4 * length)) + { + throw new InvalidOperationException("Too many iterations in Shawe-Taylor Random_Prime Routine"); + } + } + } + + STOutput rec = ImplSTRandomPrime(d, (length + 3)/2, primeSeed); + + { + BigInteger c0 = rec.Prime; + primeSeed = rec.PrimeSeed; + int primeGenCounter = rec.PrimeGenCounter; + + int outlen = 8 * dLen; + int iterations = (length - 1)/outlen; + + int oldCounter = primeGenCounter; + + BigInteger x = HashGen(d, primeSeed, iterations + 1); + x = x.Mod(One.ShiftLeft(length - 1)).SetBit(length - 1); + + BigInteger c0x2 = c0.ShiftLeft(1); + BigInteger tx2 = x.Subtract(One).Divide(c0x2).Add(One).ShiftLeft(1); + int dt = 0; + + BigInteger c = tx2.Multiply(c0).Add(One); + + /* + * TODO Since the candidate primes are generated by constant steps ('c0x2'), + * sieving could be used here in place of the 'HasAnySmallFactors' approach. + */ + for (;;) + { + if (c.BitLength > length) + { + tx2 = One.ShiftLeft(length - 1).Subtract(One).Divide(c0x2).Add(One).ShiftLeft(1); + c = tx2.Multiply(c0).Add(One); + } + + ++primeGenCounter; + + /* + * This is an optimization of the original algorithm, using trial division to screen out + * many non-primes quickly. + * + * NOTE: 'primeSeed' is still incremented as if we performed the full check! + */ + if (!ImplHasAnySmallFactors(c)) + { + BigInteger a = HashGen(d, primeSeed, iterations + 1); + a = a.Mod(c.Subtract(Three)).Add(Two); + + tx2 = tx2.Add(BigInteger.ValueOf(dt)); + dt = 0; + + BigInteger z = a.ModPow(tx2, c); + + if (c.Gcd(z.Subtract(One)).Equals(One) && z.ModPow(c0, c).Equals(One)) + { + return new STOutput(c, primeSeed, primeGenCounter); + } + } + else + { + Inc(primeSeed, iterations + 1); + } + + if (primeGenCounter >= ((4 * length) + oldCounter)) + { + throw new InvalidOperationException("Too many iterations in Shawe-Taylor Random_Prime Routine"); + } + + dt += 2; + c = c.Add(c0x2); + } + } + } + + private static uint Extract32(byte[] bs) + { + uint result = 0; + + int count = System.Math.Min(4, bs.Length); + for (int i = 0; i < count; ++i) + { + uint b = bs[bs.Length - (i + 1)]; + result |= (b << (8 * i)); + } + + return result; + } + + private static void Hash(IDigest d, byte[] input, byte[] output, int outPos) + { + d.BlockUpdate(input, 0, input.Length); + d.DoFinal(output, outPos); + } + + private static BigInteger HashGen(IDigest d, byte[] seed, int count) + { + int dLen = d.GetDigestSize(); + int pos = count * dLen; + byte[] buf = new byte[pos]; + for (int i = 0; i < count; ++i) + { + pos -= dLen; + Hash(d, seed, buf, pos); + Inc(seed, 1); + } + return new BigInteger(1, buf); + } + + private static void Inc(byte[] seed, int c) + { + int pos = seed.Length; + while (c > 0 && --pos >= 0) + { + c += seed[pos]; + seed[pos] = (byte)c; + c >>= 8; + } + } + + private static bool IsPrime32(uint x) + { + /* + * Use wheel factorization with 2, 3, 5 to select trial divisors. + */ + + if (x <= 5) + { + return x == 2 || x == 3 || x == 5; + } + + if ((x & 1) == 0 || (x % 3) == 0 || (x % 5) == 0) + { + return false; + } + + uint[] ds = new uint[]{ 1, 7, 11, 13, 17, 19, 23, 29 }; + uint b = 0; + for (int pos = 1; ; pos = 0) + { + /* + * Trial division by wheel-selected divisors + */ + while (pos < ds.Length) + { + uint d = b + ds[pos]; + if (x % d == 0) + { + return x < 30; + } + ++pos; + } + + b += 30; + + if ((b >> 16 != 0) || (b * b >= x)) + { + return true; + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/Primes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/Primes.cs.meta new file mode 100644 index 00000000..7b9365cd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/Primes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f7607b79d7fda4b4fb7452bd465e4f1a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec.meta new file mode 100644 index 00000000..dda245b4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d60220356cda474badfff94d625ad9d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECAlgorithms.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECAlgorithms.cs new file mode 100644 index 00000000..b116ed08 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECAlgorithms.cs @@ -0,0 +1,500 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + public class ECAlgorithms + { + public static bool IsF2mCurve(ECCurve c) + { + return IsF2mField(c.Field); + } + + public static bool IsF2mField(IFiniteField field) + { + return field.Dimension > 1 && field.Characteristic.Equals(BigInteger.Two) + && field is IPolynomialExtensionField; + } + + public static bool IsFpCurve(ECCurve c) + { + return IsFpField(c.Field); + } + + public static bool IsFpField(IFiniteField field) + { + return field.Dimension == 1; + } + + public static ECPoint SumOfMultiplies(ECPoint[] ps, BigInteger[] ks) + { + if (ps == null || ks == null || ps.Length != ks.Length || ps.Length < 1) + throw new ArgumentException("point and scalar arrays should be non-null, and of equal, non-zero, length"); + + int count = ps.Length; + switch (count) + { + case 1: + return ps[0].Multiply(ks[0]); + case 2: + return SumOfTwoMultiplies(ps[0], ks[0], ps[1], ks[1]); + default: + break; + } + + ECPoint p = ps[0]; + ECCurve c = p.Curve; + + ECPoint[] imported = new ECPoint[count]; + imported[0] = p; + for (int i = 1; i < count; ++i) + { + imported[i] = ImportPoint(c, ps[i]); + } + + GlvEndomorphism glvEndomorphism = c.GetEndomorphism() as GlvEndomorphism; + if (glvEndomorphism != null) + { + return ImplCheckResult(ImplSumOfMultipliesGlv(imported, ks, glvEndomorphism)); + } + + return ImplCheckResult(ImplSumOfMultiplies(imported, ks)); + } + + public static ECPoint SumOfTwoMultiplies(ECPoint P, BigInteger a, ECPoint Q, BigInteger b) + { + ECCurve cp = P.Curve; + Q = ImportPoint(cp, Q); + + // Point multiplication for Koblitz curves (using WTNAF) beats Shamir's trick + { + AbstractF2mCurve f2mCurve = cp as AbstractF2mCurve; + if (f2mCurve != null && f2mCurve.IsKoblitz) + { + return ImplCheckResult(P.Multiply(a).Add(Q.Multiply(b))); + } + } + + GlvEndomorphism glvEndomorphism = cp.GetEndomorphism() as GlvEndomorphism; + if (glvEndomorphism != null) + { + return ImplCheckResult( + ImplSumOfMultipliesGlv(new ECPoint[] { P, Q }, new BigInteger[] { a, b }, glvEndomorphism)); + } + + return ImplCheckResult(ImplShamirsTrickWNaf(P, a, Q, b)); + } + + /* + * "Shamir's Trick", originally due to E. G. Straus + * (Addition chains of vectors. American Mathematical Monthly, + * 71(7):806-808, Aug./Sept. 1964) + * + * Input: The points P, Q, scalar k = (km?, ... , k1, k0) + * and scalar l = (lm?, ... , l1, l0). + * Output: R = k * P + l * Q. + * 1: Z <- P + Q + * 2: R <- O + * 3: for i from m-1 down to 0 do + * 4: R <- R + R {point doubling} + * 5: if (ki = 1) and (li = 0) then R <- R + P end if + * 6: if (ki = 0) and (li = 1) then R <- R + Q end if + * 7: if (ki = 1) and (li = 1) then R <- R + Z end if + * 8: end for + * 9: return R + */ + public static ECPoint ShamirsTrick(ECPoint P, BigInteger k, ECPoint Q, BigInteger l) + { + ECCurve cp = P.Curve; + Q = ImportPoint(cp, Q); + + return ImplCheckResult(ImplShamirsTrickJsf(P, k, Q, l)); + } + + public static ECPoint ImportPoint(ECCurve c, ECPoint p) + { + ECCurve cp = p.Curve; + if (!c.Equals(cp)) + throw new ArgumentException("Point must be on the same curve"); + + return c.ImportPoint(p); + } + + public static void MontgomeryTrick(ECFieldElement[] zs, int off, int len) + { + MontgomeryTrick(zs, off, len, null); + } + + public static void MontgomeryTrick(ECFieldElement[] zs, int off, int len, ECFieldElement scale) + { + /* + * Uses the "Montgomery Trick" to invert many field elements, with only a single actual + * field inversion. See e.g. the paper: + * "Fast Multi-scalar Multiplication Methods on Elliptic Curves with Precomputation Strategy Using Montgomery Trick" + * by Katsuyuki Okeya, Kouichi Sakurai. + */ + + ECFieldElement[] c = new ECFieldElement[len]; + c[0] = zs[off]; + + int i = 0; + while (++i < len) + { + c[i] = c[i - 1].Multiply(zs[off + i]); + } + + --i; + + if (scale != null) + { + c[i] = c[i].Multiply(scale); + } + + ECFieldElement u = c[i].Invert(); + + while (i > 0) + { + int j = off + i--; + ECFieldElement tmp = zs[j]; + zs[j] = c[i].Multiply(u); + u = u.Multiply(tmp); + } + + zs[off] = u; + } + + /** + * Simple shift-and-add multiplication. Serves as reference implementation + * to verify (possibly faster) implementations, and for very small scalars. + * + * @param p + * The point to multiply. + * @param k + * The multiplier. + * @return The result of the point multiplication kP. + */ + public static ECPoint ReferenceMultiply(ECPoint p, BigInteger k) + { + BigInteger x = k.Abs(); + ECPoint q = p.Curve.Infinity; + int t = x.BitLength; + if (t > 0) + { + if (x.TestBit(0)) + { + q = p; + } + for (int i = 1; i < t; i++) + { + p = p.Twice(); + if (x.TestBit(i)) + { + q = q.Add(p); + } + } + } + return k.SignValue < 0 ? q.Negate() : q; + } + + public static ECPoint ValidatePoint(ECPoint p) + { + if (!p.IsValid()) + throw new InvalidOperationException("Invalid point"); + + return p; + } + + public static ECPoint CleanPoint(ECCurve c, ECPoint p) + { + ECCurve cp = p.Curve; + if (!c.Equals(cp)) + throw new ArgumentException("Point must be on the same curve", "p"); + + return c.DecodePoint(p.GetEncoded(false)); + } + + internal static ECPoint ImplCheckResult(ECPoint p) + { + if (!p.IsValidPartial()) + throw new InvalidOperationException("Invalid result"); + + return p; + } + + internal static ECPoint ImplShamirsTrickJsf(ECPoint P, BigInteger k, ECPoint Q, BigInteger l) + { + ECCurve curve = P.Curve; + ECPoint infinity = curve.Infinity; + + // TODO conjugate co-Z addition (ZADDC) can return both of these + ECPoint PaddQ = P.Add(Q); + ECPoint PsubQ = P.Subtract(Q); + + ECPoint[] points = new ECPoint[] { Q, PsubQ, P, PaddQ }; + curve.NormalizeAll(points); + + ECPoint[] table = new ECPoint[] { + points[3].Negate(), points[2].Negate(), points[1].Negate(), + points[0].Negate(), infinity, points[0], + points[1], points[2], points[3] }; + + byte[] jsf = WNafUtilities.GenerateJsf(k, l); + + ECPoint R = infinity; + + int i = jsf.Length; + while (--i >= 0) + { + int jsfi = jsf[i]; + + // NOTE: The shifting ensures the sign is extended correctly + int kDigit = ((jsfi << 24) >> 28), lDigit = ((jsfi << 28) >> 28); + + int index = 4 + (kDigit * 3) + lDigit; + R = R.TwicePlus(table[index]); + } + + return R; + } + + internal static ECPoint ImplShamirsTrickWNaf(ECPoint P, BigInteger k, + ECPoint Q, BigInteger l) + { + bool negK = k.SignValue < 0, negL = l.SignValue < 0; + + k = k.Abs(); + l = l.Abs(); + + int widthP = System.Math.Max(2, System.Math.Min(16, WNafUtilities.GetWindowSize(k.BitLength))); + int widthQ = System.Math.Max(2, System.Math.Min(16, WNafUtilities.GetWindowSize(l.BitLength))); + + WNafPreCompInfo infoP = WNafUtilities.Precompute(P, widthP, true); + WNafPreCompInfo infoQ = WNafUtilities.Precompute(Q, widthQ, true); + + ECPoint[] preCompP = negK ? infoP.PreCompNeg : infoP.PreComp; + ECPoint[] preCompQ = negL ? infoQ.PreCompNeg : infoQ.PreComp; + ECPoint[] preCompNegP = negK ? infoP.PreComp : infoP.PreCompNeg; + ECPoint[] preCompNegQ = negL ? infoQ.PreComp : infoQ.PreCompNeg; + + byte[] wnafP = WNafUtilities.GenerateWindowNaf(widthP, k); + byte[] wnafQ = WNafUtilities.GenerateWindowNaf(widthQ, l); + + return ImplShamirsTrickWNaf(preCompP, preCompNegP, wnafP, preCompQ, preCompNegQ, wnafQ); + } + + internal static ECPoint ImplShamirsTrickWNaf(ECPoint P, BigInteger k, ECPointMap pointMapQ, BigInteger l) + { + bool negK = k.SignValue < 0, negL = l.SignValue < 0; + + k = k.Abs(); + l = l.Abs(); + + int width = System.Math.Max(2, System.Math.Min(16, WNafUtilities.GetWindowSize(System.Math.Max(k.BitLength, l.BitLength)))); + + ECPoint Q = WNafUtilities.MapPointWithPrecomp(P, width, true, pointMapQ); + WNafPreCompInfo infoP = WNafUtilities.GetWNafPreCompInfo(P); + WNafPreCompInfo infoQ = WNafUtilities.GetWNafPreCompInfo(Q); + + ECPoint[] preCompP = negK ? infoP.PreCompNeg : infoP.PreComp; + ECPoint[] preCompQ = negL ? infoQ.PreCompNeg : infoQ.PreComp; + ECPoint[] preCompNegP = negK ? infoP.PreComp : infoP.PreCompNeg; + ECPoint[] preCompNegQ = negL ? infoQ.PreComp : infoQ.PreCompNeg; + + byte[] wnafP = WNafUtilities.GenerateWindowNaf(width, k); + byte[] wnafQ = WNafUtilities.GenerateWindowNaf(width, l); + + return ImplShamirsTrickWNaf(preCompP, preCompNegP, wnafP, preCompQ, preCompNegQ, wnafQ); + } + + private static ECPoint ImplShamirsTrickWNaf(ECPoint[] preCompP, ECPoint[] preCompNegP, byte[] wnafP, + ECPoint[] preCompQ, ECPoint[] preCompNegQ, byte[] wnafQ) + { + int len = System.Math.Max(wnafP.Length, wnafQ.Length); + + ECCurve curve = preCompP[0].Curve; + ECPoint infinity = curve.Infinity; + + ECPoint R = infinity; + int zeroes = 0; + + for (int i = len - 1; i >= 0; --i) + { + int wiP = i < wnafP.Length ? (int)(sbyte)wnafP[i] : 0; + int wiQ = i < wnafQ.Length ? (int)(sbyte)wnafQ[i] : 0; + + if ((wiP | wiQ) == 0) + { + ++zeroes; + continue; + } + + ECPoint r = infinity; + if (wiP != 0) + { + int nP = System.Math.Abs(wiP); + ECPoint[] tableP = wiP < 0 ? preCompNegP : preCompP; + r = r.Add(tableP[nP >> 1]); + } + if (wiQ != 0) + { + int nQ = System.Math.Abs(wiQ); + ECPoint[] tableQ = wiQ < 0 ? preCompNegQ : preCompQ; + r = r.Add(tableQ[nQ >> 1]); + } + + if (zeroes > 0) + { + R = R.TimesPow2(zeroes); + zeroes = 0; + } + + R = R.TwicePlus(r); + } + + if (zeroes > 0) + { + R = R.TimesPow2(zeroes); + } + + return R; + } + + internal static ECPoint ImplSumOfMultiplies(ECPoint[] ps, BigInteger[] ks) + { + int count = ps.Length; + bool[] negs = new bool[count]; + WNafPreCompInfo[] infos = new WNafPreCompInfo[count]; + byte[][] wnafs = new byte[count][]; + + for (int i = 0; i < count; ++i) + { + BigInteger ki = ks[i]; negs[i] = ki.SignValue < 0; ki = ki.Abs(); + + int width = System.Math.Max(2, System.Math.Min(16, WNafUtilities.GetWindowSize(ki.BitLength))); + infos[i] = WNafUtilities.Precompute(ps[i], width, true); + wnafs[i] = WNafUtilities.GenerateWindowNaf(width, ki); + } + + return ImplSumOfMultiplies(negs, infos, wnafs); + } + + internal static ECPoint ImplSumOfMultipliesGlv(ECPoint[] ps, BigInteger[] ks, GlvEndomorphism glvEndomorphism) + { + BigInteger n = ps[0].Curve.Order; + + int len = ps.Length; + + BigInteger[] abs = new BigInteger[len << 1]; + for (int i = 0, j = 0; i < len; ++i) + { + BigInteger[] ab = glvEndomorphism.DecomposeScalar(ks[i].Mod(n)); + abs[j++] = ab[0]; + abs[j++] = ab[1]; + } + + ECPointMap pointMap = glvEndomorphism.PointMap; + if (glvEndomorphism.HasEfficientPointMap) + { + return ECAlgorithms.ImplSumOfMultiplies(ps, pointMap, abs); + } + + ECPoint[] pqs = new ECPoint[len << 1]; + for (int i = 0, j = 0; i < len; ++i) + { + ECPoint p = ps[i], q = pointMap.Map(p); + pqs[j++] = p; + pqs[j++] = q; + } + + return ECAlgorithms.ImplSumOfMultiplies(pqs, abs); + } + + internal static ECPoint ImplSumOfMultiplies(ECPoint[] ps, ECPointMap pointMap, BigInteger[] ks) + { + int halfCount = ps.Length, fullCount = halfCount << 1; + + bool[] negs = new bool[fullCount]; + WNafPreCompInfo[] infos = new WNafPreCompInfo[fullCount]; + byte[][] wnafs = new byte[fullCount][]; + + for (int i = 0; i < halfCount; ++i) + { + int j0 = i << 1, j1 = j0 + 1; + + BigInteger kj0 = ks[j0]; negs[j0] = kj0.SignValue < 0; kj0 = kj0.Abs(); + BigInteger kj1 = ks[j1]; negs[j1] = kj1.SignValue < 0; kj1 = kj1.Abs(); + + int width = System.Math.Max(2, System.Math.Min(16, WNafUtilities.GetWindowSize(System.Math.Max(kj0.BitLength, kj1.BitLength)))); + + ECPoint P = ps[i], Q = WNafUtilities.MapPointWithPrecomp(P, width, true, pointMap); + infos[j0] = WNafUtilities.GetWNafPreCompInfo(P); + infos[j1] = WNafUtilities.GetWNafPreCompInfo(Q); + wnafs[j0] = WNafUtilities.GenerateWindowNaf(width, kj0); + wnafs[j1] = WNafUtilities.GenerateWindowNaf(width, kj1); + } + + return ImplSumOfMultiplies(negs, infos, wnafs); + } + + private static ECPoint ImplSumOfMultiplies(bool[] negs, WNafPreCompInfo[] infos, byte[][] wnafs) + { + int len = 0, count = wnafs.Length; + for (int i = 0; i < count; ++i) + { + len = System.Math.Max(len, wnafs[i].Length); + } + + ECCurve curve = infos[0].PreComp[0].Curve; + ECPoint infinity = curve.Infinity; + + ECPoint R = infinity; + int zeroes = 0; + + for (int i = len - 1; i >= 0; --i) + { + ECPoint r = infinity; + + for (int j = 0; j < count; ++j) + { + byte[] wnaf = wnafs[j]; + int wi = i < wnaf.Length ? (int)(sbyte)wnaf[i] : 0; + if (wi != 0) + { + int n = System.Math.Abs(wi); + WNafPreCompInfo info = infos[j]; + ECPoint[] table = (wi < 0 == negs[j]) ? info.PreComp : info.PreCompNeg; + r = r.Add(table[n >> 1]); + } + } + + if (r == infinity) + { + ++zeroes; + continue; + } + + if (zeroes > 0) + { + R = R.TimesPow2(zeroes); + zeroes = 0; + } + + R = R.TwicePlus(r); + } + + if (zeroes > 0) + { + R = R.TimesPow2(zeroes); + } + + return R; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECAlgorithms.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECAlgorithms.cs.meta new file mode 100644 index 00000000..d7bb90e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECAlgorithms.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5f3620d97ee7c342a95b5b57c924d90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECCurve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECCurve.cs new file mode 100644 index 00000000..c1f3f362 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECCurve.cs @@ -0,0 +1,1287 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + /// Base class for an elliptic curve. + public abstract class ECCurve + { + public const int COORD_AFFINE = 0; + public const int COORD_HOMOGENEOUS = 1; + public const int COORD_JACOBIAN = 2; + public const int COORD_JACOBIAN_CHUDNOVSKY = 3; + public const int COORD_JACOBIAN_MODIFIED = 4; + public const int COORD_LAMBDA_AFFINE = 5; + public const int COORD_LAMBDA_PROJECTIVE = 6; + public const int COORD_SKEWED = 7; + + public static int[] GetAllCoordinateSystems() + { + return new int[]{ COORD_AFFINE, COORD_HOMOGENEOUS, COORD_JACOBIAN, COORD_JACOBIAN_CHUDNOVSKY, + COORD_JACOBIAN_MODIFIED, COORD_LAMBDA_AFFINE, COORD_LAMBDA_PROJECTIVE, COORD_SKEWED }; + } + + public class Config + { + protected ECCurve outer; + protected int coord; + protected ECEndomorphism endomorphism; + protected ECMultiplier multiplier; + + internal Config(ECCurve outer, int coord, ECEndomorphism endomorphism, ECMultiplier multiplier) + { + this.outer = outer; + this.coord = coord; + this.endomorphism = endomorphism; + this.multiplier = multiplier; + } + + public Config SetCoordinateSystem(int coord) + { + this.coord = coord; + return this; + } + + public Config SetEndomorphism(ECEndomorphism endomorphism) + { + this.endomorphism = endomorphism; + return this; + } + + public Config SetMultiplier(ECMultiplier multiplier) + { + this.multiplier = multiplier; + return this; + } + + public ECCurve Create() + { + if (!outer.SupportsCoordinateSystem(coord)) + { + throw new InvalidOperationException("unsupported coordinate system"); + } + + ECCurve c = outer.CloneCurve(); + if (c == outer) + { + throw new InvalidOperationException("implementation returned current curve"); + } + + c.m_coord = coord; + c.m_endomorphism = endomorphism; + c.m_multiplier = multiplier; + + return c; + } + } + + protected readonly IFiniteField m_field; + protected ECFieldElement m_a, m_b; + protected BigInteger m_order, m_cofactor; + + protected int m_coord = COORD_AFFINE; + protected ECEndomorphism m_endomorphism = null; + protected ECMultiplier m_multiplier = null; + + protected ECCurve(IFiniteField field) + { + this.m_field = field; + } + + public abstract int FieldSize { get; } + public abstract ECFieldElement FromBigInteger(BigInteger x); + public abstract bool IsValidFieldElement(BigInteger x); + + public virtual Config Configure() + { + return new Config(this, this.m_coord, this.m_endomorphism, this.m_multiplier); + } + + public virtual ECPoint ValidatePoint(BigInteger x, BigInteger y) + { + ECPoint p = CreatePoint(x, y); + if (!p.IsValid()) + { + throw new ArgumentException("Invalid point coordinates"); + } + return p; + } + + [Obsolete("Per-point compression property will be removed")] + public virtual ECPoint ValidatePoint(BigInteger x, BigInteger y, bool withCompression) + { + ECPoint p = CreatePoint(x, y, withCompression); + if (!p.IsValid()) + { + throw new ArgumentException("Invalid point coordinates"); + } + return p; + } + + public virtual ECPoint CreatePoint(BigInteger x, BigInteger y) + { + return CreatePoint(x, y, false); + } + + [Obsolete("Per-point compression property will be removed")] + public virtual ECPoint CreatePoint(BigInteger x, BigInteger y, bool withCompression) + { + return CreateRawPoint(FromBigInteger(x), FromBigInteger(y), withCompression); + } + + protected abstract ECCurve CloneCurve(); + + protected internal abstract ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression); + + protected internal abstract ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression); + + protected virtual ECMultiplier CreateDefaultMultiplier() + { + GlvEndomorphism glvEndomorphism = m_endomorphism as GlvEndomorphism; + if (glvEndomorphism != null) + { + return new GlvMultiplier(this, glvEndomorphism); + } + + return new WNafL2RMultiplier(); + } + + public virtual bool SupportsCoordinateSystem(int coord) + { + return coord == COORD_AFFINE; + } + + public virtual PreCompInfo GetPreCompInfo(ECPoint point, string name) + { + CheckPoint(point); + + IDictionary table; + lock (point) + { + table = point.m_preCompTable; + } + + if (null == table) + return null; + + lock (table) + { + return (PreCompInfo)table[name]; + } + } + + /** + * Compute a PreCompInfo for a point on this curve, under a given name. Used by + * ECMultipliers to save the precomputation for this ECPoint for use + * by subsequent multiplication. + * + * @param point + * The ECPoint to store precomputations for. + * @param name + * A String used to index precomputations of different types. + * @param callback + * Called to calculate the PreCompInfo. + */ + public virtual PreCompInfo Precompute(ECPoint point, string name, IPreCompCallback callback) + { + CheckPoint(point); + + IDictionary table; + lock (point) + { + table = point.m_preCompTable; + if (null == table) + { + point.m_preCompTable = table = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(4); + } + } + + lock (table) + { + PreCompInfo existing = (PreCompInfo)table[name]; + PreCompInfo result = callback.Precompute(existing); + + if (result != existing) + { + table[name] = result; + } + + return result; + } + } + + public virtual ECPoint ImportPoint(ECPoint p) + { + if (this == p.Curve) + { + return p; + } + if (p.IsInfinity) + { + return Infinity; + } + + // TODO Default behaviour could be improved if the two curves have the same coordinate system by copying any Z coordinates. + p = p.Normalize(); + + return CreatePoint(p.XCoord.ToBigInteger(), p.YCoord.ToBigInteger(), p.IsCompressed); + } + + /** + * Normalization ensures that any projective coordinate is 1, and therefore that the x, y + * coordinates reflect those of the equivalent point in an affine coordinate system. Where more + * than one point is to be normalized, this method will generally be more efficient than + * normalizing each point separately. + * + * @param points + * An array of points that will be updated in place with their normalized versions, + * where necessary + */ + public virtual void NormalizeAll(ECPoint[] points) + { + NormalizeAll(points, 0, points.Length, null); + } + + /** + * Normalization ensures that any projective coordinate is 1, and therefore that the x, y + * coordinates reflect those of the equivalent point in an affine coordinate system. Where more + * than one point is to be normalized, this method will generally be more efficient than + * normalizing each point separately. An (optional) z-scaling factor can be applied; effectively + * each z coordinate is scaled by this value prior to normalization (but only one + * actual multiplication is needed). + * + * @param points + * An array of points that will be updated in place with their normalized versions, + * where necessary + * @param off + * The start of the range of points to normalize + * @param len + * The length of the range of points to normalize + * @param iso + * The (optional) z-scaling factor - can be null + */ + public virtual void NormalizeAll(ECPoint[] points, int off, int len, ECFieldElement iso) + { + CheckPoints(points, off, len); + + switch (this.CoordinateSystem) + { + case ECCurve.COORD_AFFINE: + case ECCurve.COORD_LAMBDA_AFFINE: + { + if (iso != null) + throw new ArgumentException("not valid for affine coordinates", "iso"); + + return; + } + } + + /* + * Figure out which of the points actually need to be normalized + */ + ECFieldElement[] zs = new ECFieldElement[len]; + int[] indices = new int[len]; + int count = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + if (null != p && (iso != null || !p.IsNormalized())) + { + zs[count] = p.GetZCoord(0); + indices[count++] = off + i; + } + } + + if (count == 0) + { + return; + } + + ECAlgorithms.MontgomeryTrick(zs, 0, count, iso); + + for (int j = 0; j < count; ++j) + { + int index = indices[j]; + points[index] = points[index].Normalize(zs[j]); + } + } + + public abstract ECPoint Infinity { get; } + + public virtual IFiniteField Field + { + get { return m_field; } + } + + public virtual ECFieldElement A + { + get { return m_a; } + } + + public virtual ECFieldElement B + { + get { return m_b; } + } + + public virtual BigInteger Order + { + get { return m_order; } + } + + public virtual BigInteger Cofactor + { + get { return m_cofactor; } + } + + public virtual int CoordinateSystem + { + get { return m_coord; } + } + + /** + * Create a cache-safe lookup table for the specified sequence of points. All the points MUST + * belong to this ECCurve instance, and MUST already be normalized. + */ + public virtual ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + int FE_BYTES = (FieldSize + 7) / 8; + byte[] table = new byte[len * FE_BYTES * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + byte[] px = p.RawXCoord.ToBigInteger().ToByteArray(); + byte[] py = p.RawYCoord.ToBigInteger().ToByteArray(); + + int pxStart = px.Length > FE_BYTES ? 1 : 0, pxLen = px.Length - pxStart; + int pyStart = py.Length > FE_BYTES ? 1 : 0, pyLen = py.Length - pyStart; + + Array.Copy(px, pxStart, table, pos + FE_BYTES - pxLen, pxLen); pos += FE_BYTES; + Array.Copy(py, pyStart, table, pos + FE_BYTES - pyLen, pyLen); pos += FE_BYTES; + } + } + + return new DefaultLookupTable(this, table, len); + } + + protected virtual void CheckPoint(ECPoint point) + { + if (null == point || (this != point.Curve)) + throw new ArgumentException("must be non-null and on this curve", "point"); + } + + protected virtual void CheckPoints(ECPoint[] points) + { + CheckPoints(points, 0, points.Length); + } + + protected virtual void CheckPoints(ECPoint[] points, int off, int len) + { + if (points == null) + throw new ArgumentNullException("points"); + if (off < 0 || len < 0 || (off > (points.Length - len))) + throw new ArgumentException("invalid range specified", "points"); + + for (int i = 0; i < len; ++i) + { + ECPoint point = points[off + i]; + if (null != point && this != point.Curve) + throw new ArgumentException("entries must be null or on this curve", "points"); + } + } + + public virtual bool Equals(ECCurve other) + { + if (this == other) + return true; + if (null == other) + return false; + return Field.Equals(other.Field) + && A.ToBigInteger().Equals(other.A.ToBigInteger()) + && B.ToBigInteger().Equals(other.B.ToBigInteger()); + } + + public override bool Equals(object obj) + { + return Equals(obj as ECCurve); + } + + public override int GetHashCode() + { + return Field.GetHashCode() + ^ Integers.RotateLeft(A.ToBigInteger().GetHashCode(), 8) + ^ Integers.RotateLeft(B.ToBigInteger().GetHashCode(), 16); + } + + protected abstract ECPoint DecompressPoint(int yTilde, BigInteger X1); + + public virtual ECEndomorphism GetEndomorphism() + { + return m_endomorphism; + } + + /** + * Sets the default ECMultiplier, unless already set. + */ + public virtual ECMultiplier GetMultiplier() + { + lock (this) + { + if (this.m_multiplier == null) + { + this.m_multiplier = CreateDefaultMultiplier(); + } + return this.m_multiplier; + } + } + + /** + * Decode a point on this curve from its ASN.1 encoding. The different + * encodings are taken account of, including point compression for + * Fp (X9.62 s 4.2.1 pg 17). + * @return The decoded point. + */ + public virtual ECPoint DecodePoint(byte[] encoded) + { + ECPoint p = null; + int expectedLength = (FieldSize + 7) / 8; + + byte type = encoded[0]; + switch (type) + { + case 0x00: // infinity + { + if (encoded.Length != 1) + throw new ArgumentException("Incorrect length for infinity encoding", "encoded"); + + p = Infinity; + break; + } + + case 0x02: // compressed + case 0x03: // compressed + { + if (encoded.Length != (expectedLength + 1)) + throw new ArgumentException("Incorrect length for compressed encoding", "encoded"); + + int yTilde = type & 1; + BigInteger X = new BigInteger(1, encoded, 1, expectedLength); + + p = DecompressPoint(yTilde, X); + if (!p.ImplIsValid(true, true)) + throw new ArgumentException("Invalid point"); + + break; + } + + case 0x04: // uncompressed + { + if (encoded.Length != (2 * expectedLength + 1)) + throw new ArgumentException("Incorrect length for uncompressed encoding", "encoded"); + + BigInteger X = new BigInteger(1, encoded, 1, expectedLength); + BigInteger Y = new BigInteger(1, encoded, 1 + expectedLength, expectedLength); + + p = ValidatePoint(X, Y); + break; + } + + case 0x06: // hybrid + case 0x07: // hybrid + { + if (encoded.Length != (2 * expectedLength + 1)) + throw new ArgumentException("Incorrect length for hybrid encoding", "encoded"); + + BigInteger X = new BigInteger(1, encoded, 1, expectedLength); + BigInteger Y = new BigInteger(1, encoded, 1 + expectedLength, expectedLength); + + if (Y.TestBit(0) != (type == 0x07)) + throw new ArgumentException("Inconsistent Y coordinate in hybrid encoding", "encoded"); + + p = ValidatePoint(X, Y); + break; + } + + default: + throw new FormatException("Invalid point encoding " + type); + } + + if (type != 0x00 && p.IsInfinity) + throw new ArgumentException("Invalid infinity encoding", "encoded"); + + return p; + } + + private class DefaultLookupTable + : ECLookupTable + { + private readonly ECCurve m_outer; + private readonly byte[] m_table; + private readonly int m_size; + + internal DefaultLookupTable(ECCurve outer, byte[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + int FE_BYTES = (m_outer.FieldSize + 7) / 8; + byte[] x = new byte[FE_BYTES], y = new byte[FE_BYTES]; + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + byte MASK = (byte)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < FE_BYTES; ++j) + { + x[j] ^= (byte)(m_table[pos + j] & MASK); + y[j] ^= (byte)(m_table[pos + FE_BYTES + j] & MASK); + } + + pos += (FE_BYTES * 2); + } + + ECFieldElement X = m_outer.FromBigInteger(new BigInteger(1, x)); + ECFieldElement Y = m_outer.FromBigInteger(new BigInteger(1, y)); + return m_outer.CreateRawPoint(X, Y, false); + } + } + } + + public abstract class AbstractFpCurve + : ECCurve + { + protected AbstractFpCurve(BigInteger q) + : base(FiniteFields.GetPrimeField(q)) + { + } + + public override bool IsValidFieldElement(BigInteger x) + { + return x != null && x.SignValue >= 0 && x.CompareTo(Field.Characteristic) < 0; + } + + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) + { + ECFieldElement x = FromBigInteger(X1); + ECFieldElement rhs = x.Square().Add(A).Multiply(x).Add(B); + ECFieldElement y = rhs.Sqrt(); + + /* + * If y is not a square, then we haven't got a point on the curve + */ + if (y == null) + throw new ArgumentException("Invalid point compression"); + + if (y.TestBitZero() != (yTilde == 1)) + { + // Use the other root + y = y.Negate(); + } + + return CreateRawPoint(x, y, true); + } + } + + /** + * Elliptic curve over Fp + */ + public class FpCurve + : AbstractFpCurve + { + private const int FP_DEFAULT_COORDS = COORD_JACOBIAN_MODIFIED; + + protected readonly BigInteger m_q, m_r; + protected readonly FpPoint m_infinity; + + [Obsolete("Use constructor taking order/cofactor")] + public FpCurve(BigInteger q, BigInteger a, BigInteger b) + : this(q, a, b, null, null) + { + } + + public FpCurve(BigInteger q, BigInteger a, BigInteger b, BigInteger order, BigInteger cofactor) + : base(q) + { + this.m_q = q; + this.m_r = FpFieldElement.CalculateResidue(q); + this.m_infinity = new FpPoint(this, null, null, false); + + this.m_a = FromBigInteger(a); + this.m_b = FromBigInteger(b); + this.m_order = order; + this.m_cofactor = cofactor; + this.m_coord = FP_DEFAULT_COORDS; + } + + [Obsolete("Use constructor taking order/cofactor")] + protected FpCurve(BigInteger q, BigInteger r, ECFieldElement a, ECFieldElement b) + : this(q, r, a, b, null, null) + { + } + + protected FpCurve(BigInteger q, BigInteger r, ECFieldElement a, ECFieldElement b, BigInteger order, BigInteger cofactor) + : base(q) + { + this.m_q = q; + this.m_r = r; + this.m_infinity = new FpPoint(this, null, null, false); + + this.m_a = a; + this.m_b = b; + this.m_order = order; + this.m_cofactor = cofactor; + this.m_coord = FP_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new FpCurve(m_q, m_r, m_a, m_b, m_order, m_cofactor); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_AFFINE: + case COORD_HOMOGENEOUS: + case COORD_JACOBIAN: + case COORD_JACOBIAN_MODIFIED: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return m_q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return m_q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new FpFieldElement(this.m_q, this.m_r, x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new FpPoint(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new FpPoint(this, x, y, zs, withCompression); + } + + public override ECPoint ImportPoint(ECPoint p) + { + if (this != p.Curve && this.CoordinateSystem == COORD_JACOBIAN && !p.IsInfinity) + { + switch (p.Curve.CoordinateSystem) + { + case COORD_JACOBIAN: + case COORD_JACOBIAN_CHUDNOVSKY: + case COORD_JACOBIAN_MODIFIED: + return new FpPoint(this, + FromBigInteger(p.RawXCoord.ToBigInteger()), + FromBigInteger(p.RawYCoord.ToBigInteger()), + new ECFieldElement[] { FromBigInteger(p.GetZCoord(0).ToBigInteger()) }, + p.IsCompressed); + default: + break; + } + } + + return base.ImportPoint(p); + } + } + + public abstract class AbstractF2mCurve + : ECCurve + { + public static BigInteger Inverse(int m, int[] ks, BigInteger x) + { + return new LongArray(x).ModInverse(m, ks).ToBigInteger(); + } + + /** + * The auxiliary values s0 and + * s1 used for partial modular reduction for + * Koblitz curves. + */ + private BigInteger[] si = null; + + private static IFiniteField BuildField(int m, int k1, int k2, int k3) + { + if (k1 == 0) + { + throw new ArgumentException("k1 must be > 0"); + } + + if (k2 == 0) + { + if (k3 != 0) + { + throw new ArgumentException("k3 must be 0 if k2 == 0"); + } + + return FiniteFields.GetBinaryExtensionField(new int[]{ 0, k1, m }); + } + + if (k2 <= k1) + { + throw new ArgumentException("k2 must be > k1"); + } + + if (k3 <= k2) + { + throw new ArgumentException("k3 must be > k2"); + } + + return FiniteFields.GetBinaryExtensionField(new int[]{ 0, k1, k2, k3, m }); + } + + protected AbstractF2mCurve(int m, int k1, int k2, int k3) + : base(BuildField(m, k1, k2, k3)) + { + } + + public override bool IsValidFieldElement(BigInteger x) + { + return x != null && x.SignValue >= 0 && x.BitLength <= FieldSize; + } + + [Obsolete("Per-point compression property will be removed")] + public override ECPoint CreatePoint(BigInteger x, BigInteger y, bool withCompression) + { + ECFieldElement X = FromBigInteger(x), Y = FromBigInteger(y); + + switch (this.CoordinateSystem) + { + case COORD_LAMBDA_AFFINE: + case COORD_LAMBDA_PROJECTIVE: + { + if (X.IsZero) + { + if (!Y.Square().Equals(B)) + throw new ArgumentException(); + } + else + { + // Y becomes Lambda (X + Y/X) here + Y = Y.Divide(X).Add(X); + } + break; + } + default: + { + break; + } + } + + return CreateRawPoint(X, Y, withCompression); + } + + protected override ECPoint DecompressPoint(int yTilde, BigInteger X1) + { + ECFieldElement xp = FromBigInteger(X1), yp = null; + if (xp.IsZero) + { + yp = B.Sqrt(); + } + else + { + ECFieldElement beta = xp.Square().Invert().Multiply(B).Add(A).Add(xp); + ECFieldElement z = SolveQuadraticEquation(beta); + + if (z != null) + { + if (z.TestBitZero() != (yTilde == 1)) + { + z = z.AddOne(); + } + + switch (this.CoordinateSystem) + { + case COORD_LAMBDA_AFFINE: + case COORD_LAMBDA_PROJECTIVE: + { + yp = z.Add(xp); + break; + } + default: + { + yp = z.Multiply(xp); + break; + } + } + } + } + + if (yp == null) + throw new ArgumentException("Invalid point compression"); + + return CreateRawPoint(xp, yp, true); + } + + /** + * Solves a quadratic equation z2 + z = beta(X9.62 + * D.1.6) The other solution is z + 1. + * + * @param beta + * The value to solve the quadratic equation for. + * @return the solution for z2 + z = beta or + * null if no solution exists. + */ + internal ECFieldElement SolveQuadraticEquation(ECFieldElement beta) + { + if (beta.IsZero) + return beta; + + ECFieldElement gamma, z, zeroElement = FromBigInteger(BigInteger.Zero); + + int m = FieldSize; + do + { + ECFieldElement t = FromBigInteger(BigInteger.Arbitrary(m)); + z = zeroElement; + ECFieldElement w = beta; + for (int i = 1; i < m; i++) + { + ECFieldElement w2 = w.Square(); + z = z.Square().Add(w2.Multiply(t)); + w = w2.Add(beta); + } + if (!w.IsZero) + { + return null; + } + gamma = z.Square().Add(z); + } + while (gamma.IsZero); + + return z; + } + + /** + * @return the auxiliary values s0 and + * s1 used for partial modular reduction for + * Koblitz curves. + */ + internal virtual BigInteger[] GetSi() + { + if (si == null) + { + lock (this) + { + if (si == null) + { + si = Tnaf.GetSi(this); + } + } + } + return si; + } + + /** + * Returns true if this is a Koblitz curve (ABC curve). + * @return true if this is a Koblitz curve (ABC curve), false otherwise + */ + public virtual bool IsKoblitz + { + get + { + return m_order != null && m_cofactor != null && m_b.IsOne && (m_a.IsZero || m_a.IsOne); + } + } + } + + /** + * Elliptic curves over F2m. The Weierstrass equation is given by + * y2 + xy = x3 + ax2 + b. + */ + public class F2mCurve + : AbstractF2mCurve + { + private const int F2M_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + + /** + * The exponent m of F2m. + */ + private readonly int m; + + /** + * TPB: The integer k where xm + + * xk + 1 represents the reduction polynomial + * f(z).
    + * PPB: The integer k1 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z).
    + */ + private readonly int k1; + + /** + * TPB: Always set to 0
    + * PPB: The integer k2 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z).
    + */ + private readonly int k2; + + /** + * TPB: Always set to 0
    + * PPB: The integer k3 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z).
    + */ + private readonly int k3; + + /** + * The point at infinity on this curve. + */ + protected readonly F2mPoint m_infinity; + + /** + * Constructor for Trinomial Polynomial Basis (TPB). + * @param m The exponent m of + * F2m. + * @param k The integer k where xm + + * xk + 1 represents the reduction + * polynomial f(z). + * @param a The coefficient a in the Weierstrass equation + * for non-supersingular elliptic curves over + * F2m. + * @param b The coefficient b in the Weierstrass equation + * for non-supersingular elliptic curves over + * F2m. + */ + [Obsolete("Use constructor taking order/cofactor")] + public F2mCurve( + int m, + int k, + BigInteger a, + BigInteger b) + : this(m, k, 0, 0, a, b, null, null) + { + } + + /** + * Constructor for Trinomial Polynomial Basis (TPB). + * @param m The exponent m of + * F2m. + * @param k The integer k where xm + + * xk + 1 represents the reduction + * polynomial f(z). + * @param a The coefficient a in the Weierstrass equation + * for non-supersingular elliptic curves over + * F2m. + * @param b The coefficient b in the Weierstrass equation + * for non-supersingular elliptic curves over + * F2m. + * @param order The order of the main subgroup of the elliptic curve. + * @param cofactor The cofactor of the elliptic curve, i.e. + * #Ea(F2m) = h * n. + */ + public F2mCurve( + int m, + int k, + BigInteger a, + BigInteger b, + BigInteger order, + BigInteger cofactor) + : this(m, k, 0, 0, a, b, order, cofactor) + { + } + + /** + * Constructor for Pentanomial Polynomial Basis (PPB). + * @param m The exponent m of + * F2m. + * @param k1 The integer k1 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param k2 The integer k2 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param k3 The integer k3 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param a The coefficient a in the Weierstrass equation + * for non-supersingular elliptic curves over + * F2m. + * @param b The coefficient b in the Weierstrass equation + * for non-supersingular elliptic curves over + * F2m. + */ + [Obsolete("Use constructor taking order/cofactor")] + public F2mCurve( + int m, + int k1, + int k2, + int k3, + BigInteger a, + BigInteger b) + : this(m, k1, k2, k3, a, b, null, null) + { + } + + /** + * Constructor for Pentanomial Polynomial Basis (PPB). + * @param m The exponent m of + * F2m. + * @param k1 The integer k1 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param k2 The integer k2 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param k3 The integer k3 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param a The coefficient a in the Weierstrass equation + * for non-supersingular elliptic curves over + * F2m. + * @param b The coefficient b in the Weierstrass equation + * for non-supersingular elliptic curves over + * F2m. + * @param order The order of the main subgroup of the elliptic curve. + * @param cofactor The cofactor of the elliptic curve, i.e. + * #Ea(F2m) = h * n. + */ + public F2mCurve( + int m, + int k1, + int k2, + int k3, + BigInteger a, + BigInteger b, + BigInteger order, + BigInteger cofactor) + : base(m, k1, k2, k3) + { + this.m = m; + this.k1 = k1; + this.k2 = k2; + this.k3 = k3; + this.m_order = order; + this.m_cofactor = cofactor; + this.m_infinity = new F2mPoint(this, null, null, false); + + if (k1 == 0) + throw new ArgumentException("k1 must be > 0"); + + if (k2 == 0) + { + if (k3 != 0) + throw new ArgumentException("k3 must be 0 if k2 == 0"); + } + else + { + if (k2 <= k1) + throw new ArgumentException("k2 must be > k1"); + + if (k3 <= k2) + throw new ArgumentException("k3 must be > k2"); + } + + this.m_a = FromBigInteger(a); + this.m_b = FromBigInteger(b); + this.m_coord = F2M_DEFAULT_COORDS; + } + + protected F2mCurve(int m, int k1, int k2, int k3, ECFieldElement a, ECFieldElement b, BigInteger order, BigInteger cofactor) + : base(m, k1, k2, k3) + { + this.m = m; + this.k1 = k1; + this.k2 = k2; + this.k3 = k3; + this.m_order = order; + this.m_cofactor = cofactor; + + this.m_infinity = new F2mPoint(this, null, null, false); + this.m_a = a; + this.m_b = b; + this.m_coord = F2M_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new F2mCurve(m, k1, k2, k3, m_a, m_b, m_order, m_cofactor); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_AFFINE: + case COORD_HOMOGENEOUS: + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + protected override ECMultiplier CreateDefaultMultiplier() + { + if (IsKoblitz) + { + return new WTauNafMultiplier(); + } + + return base.CreateDefaultMultiplier(); + } + + public override int FieldSize + { + get { return m; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new F2mFieldElement(this.m, this.k1, this.k2, this.k3, x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new F2mPoint(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new F2mPoint(this, x, y, zs, withCompression); + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public int M + { + get { return m; } + } + + /** + * Return true if curve uses a Trinomial basis. + * + * @return true if curve Trinomial, false otherwise. + */ + public bool IsTrinomial() + { + return k2 == 0 && k3 == 0; + } + + public int K1 + { + get { return k1; } + } + + public int K2 + { + get { return k2; } + } + + public int K3 + { + get { return k3; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + int FE_LONGS = (m + 63) / 64; + + long[] table = new long[len * FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + ((F2mFieldElement)p.RawXCoord).x.CopyTo(table, pos); pos += FE_LONGS; + ((F2mFieldElement)p.RawYCoord).x.CopyTo(table, pos); pos += FE_LONGS; + } + } + + return new DefaultF2mLookupTable(this, table, len); + } + + private class DefaultF2mLookupTable + : ECLookupTable + { + private readonly F2mCurve m_outer; + private readonly long[] m_table; + private readonly int m_size; + + internal DefaultF2mLookupTable(F2mCurve outer, long[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + int m = m_outer.m; + int[] ks = m_outer.IsTrinomial() ? new int[]{ m_outer.k1 } : new int[]{ m_outer.k1, m_outer.k2, m_outer.k3 }; + + int FE_LONGS = (m_outer.m + 63) / 64; + long[] x = new long[FE_LONGS], y = new long[FE_LONGS]; + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + long MASK =((i ^ index) - 1) >> 31; + + for (int j = 0; j < FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + FE_LONGS + j] & MASK; + } + + pos += (FE_LONGS * 2); + } + + ECFieldElement X = new F2mFieldElement(m, ks, new LongArray(x)); + ECFieldElement Y = new F2mFieldElement(m, ks, new LongArray(y)); + return m_outer.CreateRawPoint(X, Y, false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECCurve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECCurve.cs.meta new file mode 100644 index 00000000..16fa5114 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECCurve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2ba3b2a3c2430914fbced44c7df90596 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECFieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECFieldElement.cs new file mode 100644 index 00000000..e612f0b4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECFieldElement.cs @@ -0,0 +1,978 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + public abstract class ECFieldElement + { + public abstract BigInteger ToBigInteger(); + public abstract string FieldName { get; } + public abstract int FieldSize { get; } + public abstract ECFieldElement Add(ECFieldElement b); + public abstract ECFieldElement AddOne(); + public abstract ECFieldElement Subtract(ECFieldElement b); + public abstract ECFieldElement Multiply(ECFieldElement b); + public abstract ECFieldElement Divide(ECFieldElement b); + public abstract ECFieldElement Negate(); + public abstract ECFieldElement Square(); + public abstract ECFieldElement Invert(); + public abstract ECFieldElement Sqrt(); + + public virtual int BitLength + { + get { return ToBigInteger().BitLength; } + } + + public virtual bool IsOne + { + get { return BitLength == 1; } + } + + public virtual bool IsZero + { + get { return 0 == ToBigInteger().SignValue; } + } + + public virtual ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return Multiply(b).Subtract(x.Multiply(y)); + } + + public virtual ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return Multiply(b).Add(x.Multiply(y)); + } + + public virtual ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return Square().Subtract(x.Multiply(y)); + } + + public virtual ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + return Square().Add(x.Multiply(y)); + } + + public virtual ECFieldElement SquarePow(int pow) + { + ECFieldElement r = this; + for (int i = 0; i < pow; ++i) + { + r = r.Square(); + } + return r; + } + + public virtual bool TestBitZero() + { + return ToBigInteger().TestBit(0); + } + + public override bool Equals(object obj) + { + return Equals(obj as ECFieldElement); + } + + public virtual bool Equals(ECFieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return ToBigInteger().Equals(other.ToBigInteger()); + } + + public override int GetHashCode() + { + return ToBigInteger().GetHashCode(); + } + + public override string ToString() + { + return this.ToBigInteger().ToString(16); + } + + public virtual byte[] GetEncoded() + { + return BigIntegers.AsUnsignedByteArray((FieldSize + 7) / 8, ToBigInteger()); + } + } + + public abstract class AbstractFpFieldElement + : ECFieldElement + { + } + + public class FpFieldElement + : AbstractFpFieldElement + { + private readonly BigInteger q, r, x; + + internal static BigInteger CalculateResidue(BigInteger p) + { + int bitLength = p.BitLength; + if (bitLength >= 96) + { + BigInteger firstWord = p.ShiftRight(bitLength - 64); + if (firstWord.LongValue == -1L) + { + return BigInteger.One.ShiftLeft(bitLength).Subtract(p); + } + if ((bitLength & 7) == 0) + { + return BigInteger.One.ShiftLeft(bitLength << 1).Divide(p).Negate(); + } + } + return null; + } + + [Obsolete("Use ECCurve.FromBigInteger to construct field elements")] + public FpFieldElement(BigInteger q, BigInteger x) + : this(q, CalculateResidue(q), x) + { + } + + internal FpFieldElement(BigInteger q, BigInteger r, BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(q) >= 0) + throw new ArgumentException("value invalid in Fp field element", "x"); + + this.q = q; + this.r = r; + this.x = x; + } + + public override BigInteger ToBigInteger() + { + return x; + } + + /** + * return the field name for this field. + * + * @return the string "Fp". + */ + public override string FieldName + { + get { return "Fp"; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public BigInteger Q + { + get { return q; } + } + + public override ECFieldElement Add( + ECFieldElement b) + { + return new FpFieldElement(q, r, ModAdd(x, b.ToBigInteger())); + } + + public override ECFieldElement AddOne() + { + BigInteger x2 = x.Add(BigInteger.One); + if (x2.CompareTo(q) == 0) + { + x2 = BigInteger.Zero; + } + return new FpFieldElement(q, r, x2); + } + + public override ECFieldElement Subtract( + ECFieldElement b) + { + return new FpFieldElement(q, r, ModSubtract(x, b.ToBigInteger())); + } + + public override ECFieldElement Multiply( + ECFieldElement b) + { + return new FpFieldElement(q, r, ModMult(x, b.ToBigInteger())); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + BigInteger ax = this.x, bx = b.ToBigInteger(), xx = x.ToBigInteger(), yx = y.ToBigInteger(); + BigInteger ab = ax.Multiply(bx); + BigInteger xy = xx.Multiply(yx); + return new FpFieldElement(q, r, ModReduce(ab.Subtract(xy))); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + BigInteger ax = this.x, bx = b.ToBigInteger(), xx = x.ToBigInteger(), yx = y.ToBigInteger(); + BigInteger ab = ax.Multiply(bx); + BigInteger xy = xx.Multiply(yx); + BigInteger sum = ab.Add(xy); + if (r != null && r.SignValue < 0 && sum.BitLength > (q.BitLength << 1)) + { + sum = sum.Subtract(q.ShiftLeft(q.BitLength)); + } + return new FpFieldElement(q, r, ModReduce(sum)); + } + + public override ECFieldElement Divide( + ECFieldElement b) + { + return new FpFieldElement(q, r, ModMult(x, ModInverse(b.ToBigInteger()))); + } + + public override ECFieldElement Negate() + { + return x.SignValue == 0 ? this : new FpFieldElement(q, r, q.Subtract(x)); + } + + public override ECFieldElement Square() + { + return new FpFieldElement(q, r, ModMult(x, x)); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + BigInteger ax = this.x, xx = x.ToBigInteger(), yx = y.ToBigInteger(); + BigInteger aa = ax.Multiply(ax); + BigInteger xy = xx.Multiply(yx); + return new FpFieldElement(q, r, ModReduce(aa.Subtract(xy))); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + BigInteger ax = this.x, xx = x.ToBigInteger(), yx = y.ToBigInteger(); + BigInteger aa = ax.Multiply(ax); + BigInteger xy = xx.Multiply(yx); + BigInteger sum = aa.Add(xy); + if (r != null && r.SignValue < 0 && sum.BitLength > (q.BitLength << 1)) + { + sum = sum.Subtract(q.ShiftLeft(q.BitLength)); + } + return new FpFieldElement(q, r, ModReduce(sum)); + } + + public override ECFieldElement Invert() + { + // TODO Modular inversion can be faster for a (Generalized) Mersenne Prime. + return new FpFieldElement(q, r, ModInverse(x)); + } + + /** + * return a sqrt root - the routine verifies that the calculation + * returns the right value - if none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + if (IsZero || IsOne) + return this; + + if (!q.TestBit(0)) + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("even value of q"); + + if (q.TestBit(1)) // q == 4m + 3 + { + BigInteger e = q.ShiftRight(2).Add(BigInteger.One); + return CheckSqrt(new FpFieldElement(q, r, x.ModPow(e, q))); + } + + if (q.TestBit(2)) // q == 8m + 5 + { + BigInteger t1 = x.ModPow(q.ShiftRight(3), q); + BigInteger t2 = ModMult(t1, x); + BigInteger t3 = ModMult(t2, t1); + + if (t3.Equals(BigInteger.One)) + { + return CheckSqrt(new FpFieldElement(q, r, t2)); + } + + // TODO This is constant and could be precomputed + BigInteger t4 = BigInteger.Two.ModPow(q.ShiftRight(2), q); + + BigInteger y = ModMult(t2, t4); + + return CheckSqrt(new FpFieldElement(q, r, y)); + } + + // q == 8m + 1 + + BigInteger legendreExponent = q.ShiftRight(1); + if (!(x.ModPow(legendreExponent, q).Equals(BigInteger.One))) + return null; + + BigInteger X = this.x; + BigInteger fourX = ModDouble(ModDouble(X)); ; + + BigInteger k = legendreExponent.Add(BigInteger.One), qMinusOne = q.Subtract(BigInteger.One); + + BigInteger U, V; + do + { + BigInteger P; + do + { + P = BigInteger.Arbitrary(q.BitLength); + } + while (P.CompareTo(q) >= 0 + || !ModReduce(P.Multiply(P).Subtract(fourX)).ModPow(legendreExponent, q).Equals(qMinusOne)); + + BigInteger[] result = LucasSequence(P, X, k); + U = result[0]; + V = result[1]; + + if (ModMult(V, V).Equals(fourX)) + { + return new FpFieldElement(q, r, ModHalfAbs(V)); + } + } + while (U.Equals(BigInteger.One) || U.Equals(qMinusOne)); + + return null; + } + + private ECFieldElement CheckSqrt(ECFieldElement z) + { + return z.Square().Equals(this) ? z : null; + } + + private BigInteger[] LucasSequence( + BigInteger P, + BigInteger Q, + BigInteger k) + { + // TODO Research and apply "common-multiplicand multiplication here" + + int n = k.BitLength; + int s = k.GetLowestSetBit(); + + Debug.Assert(k.TestBit(s)); + + BigInteger Uh = BigInteger.One; + BigInteger Vl = BigInteger.Two; + BigInteger Vh = P; + BigInteger Ql = BigInteger.One; + BigInteger Qh = BigInteger.One; + + for (int j = n - 1; j >= s + 1; --j) + { + Ql = ModMult(Ql, Qh); + + if (k.TestBit(j)) + { + Qh = ModMult(Ql, Q); + Uh = ModMult(Uh, Vh); + Vl = ModReduce(Vh.Multiply(Vl).Subtract(P.Multiply(Ql))); + Vh = ModReduce(Vh.Multiply(Vh).Subtract(Qh.ShiftLeft(1))); + } + else + { + Qh = Ql; + Uh = ModReduce(Uh.Multiply(Vl).Subtract(Ql)); + Vh = ModReduce(Vh.Multiply(Vl).Subtract(P.Multiply(Ql))); + Vl = ModReduce(Vl.Multiply(Vl).Subtract(Ql.ShiftLeft(1))); + } + } + + Ql = ModMult(Ql, Qh); + Qh = ModMult(Ql, Q); + Uh = ModReduce(Uh.Multiply(Vl).Subtract(Ql)); + Vl = ModReduce(Vh.Multiply(Vl).Subtract(P.Multiply(Ql))); + Ql = ModMult(Ql, Qh); + + for (int j = 1; j <= s; ++j) + { + Uh = ModMult(Uh, Vl); + Vl = ModReduce(Vl.Multiply(Vl).Subtract(Ql.ShiftLeft(1))); + Ql = ModMult(Ql, Ql); + } + + return new BigInteger[] { Uh, Vl }; + } + + protected virtual BigInteger ModAdd(BigInteger x1, BigInteger x2) + { + BigInteger x3 = x1.Add(x2); + if (x3.CompareTo(q) >= 0) + { + x3 = x3.Subtract(q); + } + return x3; + } + + protected virtual BigInteger ModDouble(BigInteger x) + { + BigInteger _2x = x.ShiftLeft(1); + if (_2x.CompareTo(q) >= 0) + { + _2x = _2x.Subtract(q); + } + return _2x; + } + + protected virtual BigInteger ModHalf(BigInteger x) + { + if (x.TestBit(0)) + { + x = q.Add(x); + } + return x.ShiftRight(1); + } + + protected virtual BigInteger ModHalfAbs(BigInteger x) + { + if (x.TestBit(0)) + { + x = q.Subtract(x); + } + return x.ShiftRight(1); + } + + protected virtual BigInteger ModInverse(BigInteger x) + { + int bits = FieldSize; + int len = (bits + 31) >> 5; + uint[] p = Nat.FromBigInteger(bits, q); + uint[] n = Nat.FromBigInteger(bits, x); + uint[] z = Nat.Create(len); + Mod.Invert(p, n, z); + return Nat.ToBigInteger(len, z); + } + + protected virtual BigInteger ModMult(BigInteger x1, BigInteger x2) + { + return ModReduce(x1.Multiply(x2)); + } + + protected virtual BigInteger ModReduce(BigInteger x) + { + if (r == null) + { + x = x.Mod(q); + } + else + { + bool negative = x.SignValue < 0; + if (negative) + { + x = x.Abs(); + } + int qLen = q.BitLength; + if (r.SignValue > 0) + { + BigInteger qMod = BigInteger.One.ShiftLeft(qLen); + bool rIsOne = r.Equals(BigInteger.One); + while (x.BitLength > (qLen + 1)) + { + BigInteger u = x.ShiftRight(qLen); + BigInteger v = x.Remainder(qMod); + if (!rIsOne) + { + u = u.Multiply(r); + } + x = u.Add(v); + } + } + else + { + int d = ((qLen - 1) & 31) + 1; + BigInteger mu = r.Negate(); + BigInteger u = mu.Multiply(x.ShiftRight(qLen - d)); + BigInteger quot = u.ShiftRight(qLen + d); + BigInteger v = quot.Multiply(q); + BigInteger bk1 = BigInteger.One.ShiftLeft(qLen + d); + v = v.Remainder(bk1); + x = x.Remainder(bk1); + x = x.Subtract(v); + if (x.SignValue < 0) + { + x = x.Add(bk1); + } + } + while (x.CompareTo(q) >= 0) + { + x = x.Subtract(q); + } + if (negative && x.SignValue != 0) + { + x = q.Subtract(x); + } + } + return x; + } + + protected virtual BigInteger ModSubtract(BigInteger x1, BigInteger x2) + { + BigInteger x3 = x1.Subtract(x2); + if (x3.SignValue < 0) + { + x3 = x3.Add(q); + } + return x3; + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + FpFieldElement other = obj as FpFieldElement; + + if (other == null) + return false; + + return Equals(other); + } + + public virtual bool Equals( + FpFieldElement other) + { + return q.Equals(other.q) && base.Equals(other); + } + + public override int GetHashCode() + { + return q.GetHashCode() ^ base.GetHashCode(); + } + } + + public abstract class AbstractF2mFieldElement + : ECFieldElement + { + public virtual ECFieldElement HalfTrace() + { + int m = FieldSize; + if ((m & 1) == 0) + throw new InvalidOperationException("Half-trace only defined for odd m"); + + ECFieldElement fe = this; + ECFieldElement ht = fe; + for (int i = 2; i < m; i += 2) + { + fe = fe.SquarePow(2); + ht = ht.Add(fe); + } + + return ht; + } + + public virtual int Trace() + { + int m = FieldSize; + ECFieldElement fe = this; + ECFieldElement tr = fe; + for (int i = 1; i < m; ++i) + { + fe = fe.Square(); + tr = tr.Add(fe); + } + if (tr.IsZero) + return 0; + if (tr.IsOne) + return 1; + + throw new InvalidOperationException("Internal error in trace calculation"); + } + } + + /** + * Class representing the Elements of the finite field + * F2m in polynomial basis (PB) + * representation. Both trinomial (Tpb) and pentanomial (Ppb) polynomial + * basis representations are supported. Gaussian normal basis (GNB) + * representation is not supported. + */ + public class F2mFieldElement + : AbstractF2mFieldElement + { + /** + * Indicates gaussian normal basis representation (GNB). Number chosen + * according to X9.62. GNB is not implemented at present. + */ + public const int Gnb = 1; + + /** + * Indicates trinomial basis representation (Tpb). Number chosen + * according to X9.62. + */ + public const int Tpb = 2; + + /** + * Indicates pentanomial basis representation (Ppb). Number chosen + * according to X9.62. + */ + public const int Ppb = 3; + + /** + * Tpb or Ppb. + */ + private int representation; + + /** + * The exponent m of F2m. + */ + private int m; + + private int[] ks; + + /** + * The LongArray holding the bits. + */ + internal LongArray x; + + /** + * Constructor for Ppb. + * @param m The exponent m of + * F2m. + * @param k1 The integer k1 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param k2 The integer k2 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param k3 The integer k3 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z). + * @param x The BigInteger representing the value of the field element. + */ + [Obsolete("Use ECCurve.FromBigInteger to construct field elements")] + public F2mFieldElement( + int m, + int k1, + int k2, + int k3, + BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > m) + throw new ArgumentException("value invalid in F2m field element", "x"); + + if ((k2 == 0) && (k3 == 0)) + { + this.representation = Tpb; + this.ks = new int[] { k1 }; + } + else + { + if (k2 >= k3) + throw new ArgumentException("k2 must be smaller than k3"); + if (k2 <= 0) + throw new ArgumentException("k2 must be larger than 0"); + + this.representation = Ppb; + this.ks = new int[] { k1, k2, k3 }; + } + + this.m = m; + this.x = new LongArray(x); + } + + /** + * Constructor for Tpb. + * @param m The exponent m of + * F2m. + * @param k The integer k where xm + + * xk + 1 represents the reduction + * polynomial f(z). + * @param x The BigInteger representing the value of the field element. + */ + [Obsolete("Use ECCurve.FromBigInteger to construct field elements")] + public F2mFieldElement( + int m, + int k, + BigInteger x) + : this(m, k, 0, 0, x) + { + // Set k1 to k, and set k2 and k3 to 0 + } + + internal F2mFieldElement(int m, int[] ks, LongArray x) + { + this.m = m; + this.representation = (ks.Length == 1) ? Tpb : Ppb; + this.ks = ks; + this.x = x; + } + + public override int BitLength + { + get { return x.Degree(); } + } + + public override bool IsOne + { + get { return x.IsOne(); } + } + + public override bool IsZero + { + get { return x.IsZero(); } + } + + public override bool TestBitZero() + { + return x.TestBitZero(); + } + + public override BigInteger ToBigInteger() + { + return x.ToBigInteger(); + } + + public override string FieldName + { + get { return "F2m"; } + } + + public override int FieldSize + { + get { return m; } + } + + /** + * Checks, if the ECFieldElements a and b + * are elements of the same field F2m + * (having the same representation). + * @param a field element. + * @param b field element to be compared. + * @throws ArgumentException if a and b + * are not elements of the same field + * F2m (having the same + * representation). + */ + public static void CheckFieldElements( + ECFieldElement a, + ECFieldElement b) + { + if (!(a is F2mFieldElement) || !(b is F2mFieldElement)) + { + throw new ArgumentException("Field elements are not " + + "both instances of F2mFieldElement"); + } + + F2mFieldElement aF2m = (F2mFieldElement)a; + F2mFieldElement bF2m = (F2mFieldElement)b; + + if (aF2m.representation != bF2m.representation) + { + // Should never occur + throw new ArgumentException("One of the F2m field elements has incorrect representation"); + } + + if ((aF2m.m != bF2m.m) || !Arrays.AreEqual(aF2m.ks, bF2m.ks)) + { + throw new ArgumentException("Field elements are not elements of the same field F2m"); + } + } + + public override ECFieldElement Add( + ECFieldElement b) + { + // No check performed here for performance reasons. Instead the + // elements involved are checked in ECPoint.F2m + // checkFieldElements(this, b); + LongArray iarrClone = this.x.Copy(); + F2mFieldElement bF2m = (F2mFieldElement)b; + iarrClone.AddShiftedByWords(bF2m.x, 0); + return new F2mFieldElement(m, ks, iarrClone); + } + + public override ECFieldElement AddOne() + { + return new F2mFieldElement(m, ks, x.AddOne()); + } + + public override ECFieldElement Subtract( + ECFieldElement b) + { + // Addition and subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply( + ECFieldElement b) + { + // Right-to-left comb multiplication in the LongArray + // Input: Binary polynomials a(z) and b(z) of degree at most m-1 + // Output: c(z) = a(z) * b(z) mod f(z) + + // No check performed here for performance reasons. Instead the + // elements involved are checked in ECPoint.F2m + // checkFieldElements(this, b); + return new F2mFieldElement(m, ks, x.ModMultiply(((F2mFieldElement)b).x, m, ks)); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + LongArray ax = this.x, bx = ((F2mFieldElement)b).x, xx = ((F2mFieldElement)x).x, yx = ((F2mFieldElement)y).x; + + LongArray ab = ax.Multiply(bx, m, ks); + LongArray xy = xx.Multiply(yx, m, ks); + + if (ab == ax || ab == bx) + { + ab = (LongArray)ab.Copy(); + } + + ab.AddShiftedByWords(xy, 0); + ab.Reduce(m, ks); + + return new F2mFieldElement(m, ks, ab); + } + + public override ECFieldElement Divide( + ECFieldElement b) + { + // There may be more efficient implementations + ECFieldElement bInv = b.Invert(); + return Multiply(bInv); + } + + public override ECFieldElement Negate() + { + // -x == x holds for all x in F2m + return this; + } + + public override ECFieldElement Square() + { + return new F2mFieldElement(m, ks, x.ModSquare(m, ks)); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + LongArray ax = this.x, xx = ((F2mFieldElement)x).x, yx = ((F2mFieldElement)y).x; + + LongArray aa = ax.Square(m, ks); + LongArray xy = xx.Multiply(yx, m, ks); + + if (aa == ax) + { + aa = (LongArray)aa.Copy(); + } + + aa.AddShiftedByWords(xy, 0); + aa.Reduce(m, ks); + + return new F2mFieldElement(m, ks, aa); + } + + public override ECFieldElement SquarePow(int pow) + { + return pow < 1 ? this : new F2mFieldElement(m, ks, x.ModSquareN(pow, m, ks)); + } + + public override ECFieldElement Invert() + { + return new F2mFieldElement(this.m, this.ks, this.x.ModInverse(m, ks)); + } + + public override ECFieldElement Sqrt() + { + return (x.IsZero() || x.IsOne()) ? this : SquarePow(m - 1); + } + + /** + * @return the representation of the field + * F2m, either of + * {@link F2mFieldElement.Tpb} (trinomial + * basis representation) or + * {@link F2mFieldElement.Ppb} (pentanomial + * basis representation). + */ + public int Representation + { + get { return this.representation; } + } + + /** + * @return the degree m of the reduction polynomial + * f(z). + */ + public int M + { + get { return this.m; } + } + + /** + * @return Tpb: The integer k where xm + + * xk + 1 represents the reduction polynomial + * f(z).
    + * Ppb: The integer k1 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z).
    + */ + public int K1 + { + get { return this.ks[0]; } + } + + /** + * @return Tpb: Always returns 0
    + * Ppb: The integer k2 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z).
    + */ + public int K2 + { + get { return this.ks.Length >= 2 ? this.ks[1] : 0; } + } + + /** + * @return Tpb: Always set to 0
    + * Ppb: The integer k3 where xm + + * xk3 + xk2 + xk1 + 1 + * represents the reduction polynomial f(z).
    + */ + public int K3 + { + get { return this.ks.Length >= 3 ? this.ks[2] : 0; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + F2mFieldElement other = obj as F2mFieldElement; + + if (other == null) + return false; + + return Equals(other); + } + + public virtual bool Equals( + F2mFieldElement other) + { + return ((this.m == other.m) + && (this.representation == other.representation) + && Arrays.AreEqual(this.ks, other.ks) + && (this.x.Equals(other.x))); + } + + public override int GetHashCode() + { + return x.GetHashCode() ^ m ^ Arrays.GetHashCode(ks); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECFieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECFieldElement.cs.meta new file mode 100644 index 00000000..3db10d0b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECFieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c83e7d57be27b5d428630a56b05d18a1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECLookupTable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECLookupTable.cs new file mode 100644 index 00000000..1c802755 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECLookupTable.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + public interface ECLookupTable + { + int Size { get; } + ECPoint Lookup(int index); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECLookupTable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECLookupTable.cs.meta new file mode 100644 index 00000000..87384ec4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECLookupTable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6bf6a19f32e54374cbf2f2354aedc71e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPoint.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPoint.cs new file mode 100644 index 00000000..efb9f5d4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPoint.cs @@ -0,0 +1,2130 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Diagnostics; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + /** + * base class for points on elliptic curves. + */ + public abstract class ECPoint + { + protected static ECFieldElement[] EMPTY_ZS = new ECFieldElement[0]; + + protected static ECFieldElement[] GetInitialZCoords(ECCurve curve) + { + // Cope with null curve, most commonly used by implicitlyCa + int coord = null == curve ? ECCurve.COORD_AFFINE : curve.CoordinateSystem; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + case ECCurve.COORD_LAMBDA_AFFINE: + return EMPTY_ZS; + default: + break; + } + + ECFieldElement one = curve.FromBigInteger(BigInteger.One); + + switch (coord) + { + case ECCurve.COORD_HOMOGENEOUS: + case ECCurve.COORD_JACOBIAN: + case ECCurve.COORD_LAMBDA_PROJECTIVE: + return new ECFieldElement[] { one }; + case ECCurve.COORD_JACOBIAN_CHUDNOVSKY: + return new ECFieldElement[] { one, one, one }; + case ECCurve.COORD_JACOBIAN_MODIFIED: + return new ECFieldElement[] { one, curve.A }; + default: + throw new ArgumentException("unknown coordinate system"); + } + } + + protected internal readonly ECCurve m_curve; + protected internal readonly ECFieldElement m_x, m_y; + protected internal readonly ECFieldElement[] m_zs; + protected internal readonly bool m_withCompression; + + // Dictionary is (string -> PreCompInfo) + protected internal IDictionary m_preCompTable = null; + + protected ECPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : this(curve, x, y, GetInitialZCoords(curve), withCompression) + { + } + + internal ECPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + this.m_curve = curve; + this.m_x = x; + this.m_y = y; + this.m_zs = zs; + this.m_withCompression = withCompression; + } + + protected abstract bool SatisfiesCurveEquation(); + + protected virtual bool SatisfiesOrder() + { + if (BigInteger.One.Equals(Curve.Cofactor)) + return true; + + BigInteger n = Curve.Order; + + // TODO Require order to be available for all curves + + return n == null || ECAlgorithms.ReferenceMultiply(this, n).IsInfinity; + } + + public ECPoint GetDetachedPoint() + { + return Normalize().Detach(); + } + + public virtual ECCurve Curve + { + get { return m_curve; } + } + + protected abstract ECPoint Detach(); + + protected virtual int CurveCoordinateSystem + { + get + { + // Cope with null curve, most commonly used by implicitlyCa + return null == m_curve ? ECCurve.COORD_AFFINE : m_curve.CoordinateSystem; + } + } + + /** + * Returns the affine x-coordinate after checking that this point is normalized. + * + * @return The affine x-coordinate of this point + * @throws IllegalStateException if the point is not normalized + */ + public virtual ECFieldElement AffineXCoord + { + get + { + CheckNormalized(); + return XCoord; + } + } + + /** + * Returns the affine y-coordinate after checking that this point is normalized + * + * @return The affine y-coordinate of this point + * @throws IllegalStateException if the point is not normalized + */ + public virtual ECFieldElement AffineYCoord + { + get + { + CheckNormalized(); + return YCoord; + } + } + + /** + * Returns the x-coordinate. + * + * Caution: depending on the curve's coordinate system, this may not be the same value as in an + * affine coordinate system; use Normalize() to get a point where the coordinates have their + * affine values, or use AffineXCoord if you expect the point to already have been normalized. + * + * @return the x-coordinate of this point + */ + public virtual ECFieldElement XCoord + { + get { return m_x; } + } + + /** + * Returns the y-coordinate. + * + * Caution: depending on the curve's coordinate system, this may not be the same value as in an + * affine coordinate system; use Normalize() to get a point where the coordinates have their + * affine values, or use AffineYCoord if you expect the point to already have been normalized. + * + * @return the y-coordinate of this point + */ + public virtual ECFieldElement YCoord + { + get { return m_y; } + } + + public virtual ECFieldElement GetZCoord(int index) + { + return (index < 0 || index >= m_zs.Length) ? null : m_zs[index]; + } + + public virtual ECFieldElement[] GetZCoords() + { + int zsLen = m_zs.Length; + if (zsLen == 0) + { + return m_zs; + } + ECFieldElement[] copy = new ECFieldElement[zsLen]; + Array.Copy(m_zs, 0, copy, 0, zsLen); + return copy; + } + + protected internal ECFieldElement RawXCoord + { + get { return m_x; } + } + + protected internal ECFieldElement RawYCoord + { + get { return m_y; } + } + + protected internal ECFieldElement[] RawZCoords + { + get { return m_zs; } + } + + protected virtual void CheckNormalized() + { + if (!IsNormalized()) + throw new InvalidOperationException("point not in normal form"); + } + + public virtual bool IsNormalized() + { + int coord = this.CurveCoordinateSystem; + + return coord == ECCurve.COORD_AFFINE + || coord == ECCurve.COORD_LAMBDA_AFFINE + || IsInfinity + || RawZCoords[0].IsOne; + } + + /** + * Normalization ensures that any projective coordinate is 1, and therefore that the x, y + * coordinates reflect those of the equivalent point in an affine coordinate system. + * + * @return a new ECPoint instance representing the same point, but with normalized coordinates + */ + public virtual ECPoint Normalize() + { + if (this.IsInfinity) + { + return this; + } + + switch (this.CurveCoordinateSystem) + { + case ECCurve.COORD_AFFINE: + case ECCurve.COORD_LAMBDA_AFFINE: + { + return this; + } + default: + { + ECFieldElement Z1 = RawZCoords[0]; + if (Z1.IsOne) + { + return this; + } + + return Normalize(Z1.Invert()); + } + } + } + + internal virtual ECPoint Normalize(ECFieldElement zInv) + { + switch (this.CurveCoordinateSystem) + { + case ECCurve.COORD_HOMOGENEOUS: + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + return CreateScaledPoint(zInv, zInv); + } + case ECCurve.COORD_JACOBIAN: + case ECCurve.COORD_JACOBIAN_CHUDNOVSKY: + case ECCurve.COORD_JACOBIAN_MODIFIED: + { + ECFieldElement zInv2 = zInv.Square(), zInv3 = zInv2.Multiply(zInv); + return CreateScaledPoint(zInv2, zInv3); + } + default: + { + throw new InvalidOperationException("not a projective coordinate system"); + } + } + } + + protected virtual ECPoint CreateScaledPoint(ECFieldElement sx, ECFieldElement sy) + { + return Curve.CreateRawPoint(RawXCoord.Multiply(sx), RawYCoord.Multiply(sy), IsCompressed); + } + + public bool IsInfinity + { + get { return m_x == null && m_y == null; } + } + + public bool IsCompressed + { + get { return m_withCompression; } + } + + public bool IsValid() + { + return ImplIsValid(false, true); + } + + internal bool IsValidPartial() + { + return ImplIsValid(false, false); + } + + internal bool ImplIsValid(bool decompressed, bool checkOrder) + { + if (IsInfinity) + return true; + + ValidityCallback callback = new ValidityCallback(this, decompressed, checkOrder); + ValidityPreCompInfo validity = (ValidityPreCompInfo)Curve.Precompute(this, ValidityPreCompInfo.PRECOMP_NAME, callback); + return !validity.HasFailed(); + } + + public virtual ECPoint ScaleX(ECFieldElement scale) + { + return IsInfinity + ? this + : Curve.CreateRawPoint(RawXCoord.Multiply(scale), RawYCoord, RawZCoords, IsCompressed); + } + + public virtual ECPoint ScaleY(ECFieldElement scale) + { + return IsInfinity + ? this + : Curve.CreateRawPoint(RawXCoord, RawYCoord.Multiply(scale), RawZCoords, IsCompressed); + } + + public override bool Equals(object obj) + { + return Equals(obj as ECPoint); + } + + public virtual bool Equals(ECPoint other) + { + if (this == other) + return true; + if (null == other) + return false; + + ECCurve c1 = this.Curve, c2 = other.Curve; + bool n1 = (null == c1), n2 = (null == c2); + bool i1 = IsInfinity, i2 = other.IsInfinity; + + if (i1 || i2) + { + return (i1 && i2) && (n1 || n2 || c1.Equals(c2)); + } + + ECPoint p1 = this, p2 = other; + if (n1 && n2) + { + // Points with null curve are in affine form, so already normalized + } + else if (n1) + { + p2 = p2.Normalize(); + } + else if (n2) + { + p1 = p1.Normalize(); + } + else if (!c1.Equals(c2)) + { + return false; + } + else + { + // TODO Consider just requiring already normalized, to avoid silent performance degradation + + ECPoint[] points = new ECPoint[] { this, c1.ImportPoint(p2) }; + + // TODO This is a little strong, really only requires coZNormalizeAll to get Zs equal + c1.NormalizeAll(points); + + p1 = points[0]; + p2 = points[1]; + } + + return p1.XCoord.Equals(p2.XCoord) && p1.YCoord.Equals(p2.YCoord); + } + + public override int GetHashCode() + { + ECCurve c = this.Curve; + int hc = (null == c) ? 0 : ~c.GetHashCode(); + + if (!this.IsInfinity) + { + // TODO Consider just requiring already normalized, to avoid silent performance degradation + + ECPoint p = Normalize(); + + hc ^= p.XCoord.GetHashCode() * 17; + hc ^= p.YCoord.GetHashCode() * 257; + } + + return hc; + } + + public override string ToString() + { + if (this.IsInfinity) + { + return "INF"; + } + + StringBuilder sb = new StringBuilder(); + sb.Append('('); + sb.Append(RawXCoord); + sb.Append(','); + sb.Append(RawYCoord); + for (int i = 0; i < m_zs.Length; ++i) + { + sb.Append(','); + sb.Append(m_zs[i]); + } + sb.Append(')'); + return sb.ToString(); + } + + public virtual byte[] GetEncoded() + { + return GetEncoded(m_withCompression); + } + + public abstract byte[] GetEncoded(bool compressed); + + protected internal abstract bool CompressionYTilde { get; } + + public abstract ECPoint Add(ECPoint b); + public abstract ECPoint Subtract(ECPoint b); + public abstract ECPoint Negate(); + + public virtual ECPoint TimesPow2(int e) + { + if (e < 0) + throw new ArgumentException("cannot be negative", "e"); + + ECPoint p = this; + while (--e >= 0) + { + p = p.Twice(); + } + return p; + } + + public abstract ECPoint Twice(); + public abstract ECPoint Multiply(BigInteger b); + + public virtual ECPoint TwicePlus(ECPoint b) + { + return Twice().Add(b); + } + + public virtual ECPoint ThreeTimes() + { + return TwicePlus(this); + } + + private class ValidityCallback + : IPreCompCallback + { + private readonly ECPoint m_outer; + private readonly bool m_decompressed, m_checkOrder; + + internal ValidityCallback(ECPoint outer, bool decompressed, bool checkOrder) + { + this.m_outer = outer; + this.m_decompressed = decompressed; + this.m_checkOrder = checkOrder; + } + + public PreCompInfo Precompute(PreCompInfo existing) + { + ValidityPreCompInfo info = existing as ValidityPreCompInfo; + if (info == null) + { + info = new ValidityPreCompInfo(); + } + + if (info.HasFailed()) + return info; + + if (!info.HasCurveEquationPassed()) + { + if (!m_decompressed && !m_outer.SatisfiesCurveEquation()) + { + info.ReportFailed(); + return info; + } + info.ReportCurveEquationPassed(); + } + if (m_checkOrder && !info.HasOrderPassed()) + { + if (!m_outer.SatisfiesOrder()) + { + info.ReportFailed(); + return info; + } + info.ReportOrderPassed(); + } + return info; + } + } + } + + public abstract class ECPointBase + : ECPoint + { + protected internal ECPointBase( + ECCurve curve, + ECFieldElement x, + ECFieldElement y, + bool withCompression) + : base(curve, x, y, withCompression) + { + } + + protected internal ECPointBase(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + /** + * return the field element encoded with point compression. (S 4.3.6) + */ + public override byte[] GetEncoded(bool compressed) + { + if (this.IsInfinity) + { + return new byte[1]; + } + + ECPoint normed = Normalize(); + + byte[] X = normed.XCoord.GetEncoded(); + + if (compressed) + { + byte[] PO = new byte[X.Length + 1]; + PO[0] = (byte)(normed.CompressionYTilde ? 0x03 : 0x02); + Array.Copy(X, 0, PO, 1, X.Length); + return PO; + } + + byte[] Y = normed.YCoord.GetEncoded(); + + { + byte[] PO = new byte[X.Length + Y.Length + 1]; + PO[0] = 0x04; + Array.Copy(X, 0, PO, 1, X.Length); + Array.Copy(Y, 0, PO, X.Length + 1, Y.Length); + return PO; + } + } + + /** + * Multiplies this ECPoint by the given number. + * @param k The multiplicator. + * @return k * this. + */ + public override ECPoint Multiply(BigInteger k) + { + return this.Curve.GetMultiplier().Multiply(this, k); + } + } + + public abstract class AbstractFpPoint + : ECPointBase + { + protected AbstractFpPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + } + + protected AbstractFpPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected internal override bool CompressionYTilde + { + get { return this.AffineYCoord.TestBitZero(); } + } + + protected override bool SatisfiesCurveEquation() + { + ECFieldElement X = this.RawXCoord, Y = this.RawYCoord, A = Curve.A, B = Curve.B; + ECFieldElement lhs = Y.Square(); + + switch (CurveCoordinateSystem) + { + case ECCurve.COORD_AFFINE: + break; + case ECCurve.COORD_HOMOGENEOUS: + { + ECFieldElement Z = this.RawZCoords[0]; + if (!Z.IsOne) + { + ECFieldElement Z2 = Z.Square(), Z3 = Z.Multiply(Z2); + lhs = lhs.Multiply(Z); + A = A.Multiply(Z2); + B = B.Multiply(Z3); + } + break; + } + case ECCurve.COORD_JACOBIAN: + case ECCurve.COORD_JACOBIAN_CHUDNOVSKY: + case ECCurve.COORD_JACOBIAN_MODIFIED: + { + ECFieldElement Z = this.RawZCoords[0]; + if (!Z.IsOne) + { + ECFieldElement Z2 = Z.Square(), Z4 = Z2.Square(), Z6 = Z2.Multiply(Z4); + A = A.Multiply(Z4); + B = B.Multiply(Z6); + } + break; + } + default: + throw new InvalidOperationException("unsupported coordinate system"); + } + + ECFieldElement rhs = X.Square().Add(A).Multiply(X).Add(B); + return lhs.Equals(rhs); + } + + public override ECPoint Subtract(ECPoint b) + { + if (b.IsInfinity) + return this; + + // Add -b + return Add(b.Negate()); + } + } + + /** + * Elliptic curve points over Fp + */ + public class FpPoint + : AbstractFpPoint + { + /** + * Create a point which encodes without point compression. + * + * @param curve the curve to use + * @param x affine x co-ordinate + * @param y affine y co-ordinate + */ + [Obsolete("Use ECCurve.CreatePoint to construct points")] + public FpPoint(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compression. + * + * @param curve the curve to use + * @param x affine x co-ordinate + * @param y affine y co-ordinate + * @param withCompression if true encode with point compression + */ + [Obsolete("Per-point compression property will be removed, see GetEncoded(bool)")] + public FpPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal FpPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new FpPoint(null, AffineXCoord, AffineYCoord, false); + } + + public override ECFieldElement GetZCoord(int index) + { + if (index == 1 && ECCurve.COORD_JACOBIAN_MODIFIED == this.CurveCoordinateSystem) + { + return GetJacobianModifiedW(); + } + + return base.GetZCoord(index); + } + + // B.3 pg 62 + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + int coord = curve.CoordinateSystem; + + ECFieldElement X1 = this.RawXCoord, Y1 = this.RawYCoord; + ECFieldElement X2 = b.RawXCoord, Y2 = b.RawYCoord; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + { + ECFieldElement dx = X2.Subtract(X1), dy = Y2.Subtract(Y1); + + if (dx.IsZero) + { + if (dy.IsZero) + { + // this == b, i.e. this must be doubled + return Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return Curve.Infinity; + } + + ECFieldElement gamma = dy.Divide(dx); + ECFieldElement X3 = gamma.Square().Subtract(X1).Subtract(X2); + ECFieldElement Y3 = gamma.Multiply(X1.Subtract(X3)).Subtract(Y1); + + return new FpPoint(Curve, X3, Y3, IsCompressed); + } + + case ECCurve.COORD_HOMOGENEOUS: + { + ECFieldElement Z1 = this.RawZCoords[0]; + ECFieldElement Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + bool Z2IsOne = Z2.IsOne; + + ECFieldElement u1 = Z1IsOne ? Y2 : Y2.Multiply(Z1); + ECFieldElement u2 = Z2IsOne ? Y1 : Y1.Multiply(Z2); + ECFieldElement u = u1.Subtract(u2); + ECFieldElement v1 = Z1IsOne ? X2 : X2.Multiply(Z1); + ECFieldElement v2 = Z2IsOne ? X1 : X1.Multiply(Z2); + ECFieldElement v = v1.Subtract(v2); + + // Check if b == this or b == -this + if (v.IsZero) + { + if (u.IsZero) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + // TODO Optimize for when w == 1 + ECFieldElement w = Z1IsOne ? Z2 : Z2IsOne ? Z1 : Z1.Multiply(Z2); + ECFieldElement vSquared = v.Square(); + ECFieldElement vCubed = vSquared.Multiply(v); + ECFieldElement vSquaredV2 = vSquared.Multiply(v2); + ECFieldElement A = u.Square().Multiply(w).Subtract(vCubed).Subtract(Two(vSquaredV2)); + + ECFieldElement X3 = v.Multiply(A); + ECFieldElement Y3 = vSquaredV2.Subtract(A).MultiplyMinusProduct(u, u2, vCubed); + ECFieldElement Z3 = vCubed.Multiply(w); + + return new FpPoint(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + case ECCurve.COORD_JACOBIAN: + case ECCurve.COORD_JACOBIAN_MODIFIED: + { + ECFieldElement Z1 = this.RawZCoords[0]; + ECFieldElement Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + + ECFieldElement X3, Y3, Z3, Z3Squared = null; + + if (!Z1IsOne && Z1.Equals(Z2)) + { + // TODO Make this available as public method coZAdd? + + ECFieldElement dx = X1.Subtract(X2), dy = Y1.Subtract(Y2); + if (dx.IsZero) + { + if (dy.IsZero) + { + return Twice(); + } + return curve.Infinity; + } + + ECFieldElement C = dx.Square(); + ECFieldElement W1 = X1.Multiply(C), W2 = X2.Multiply(C); + ECFieldElement A1 = W1.Subtract(W2).Multiply(Y1); + + X3 = dy.Square().Subtract(W1).Subtract(W2); + Y3 = W1.Subtract(X3).Multiply(dy).Subtract(A1); + Z3 = dx; + + if (Z1IsOne) + { + Z3Squared = C; + } + else + { + Z3 = Z3.Multiply(Z1); + } + } + else + { + ECFieldElement Z1Squared, U2, S2; + if (Z1IsOne) + { + Z1Squared = Z1; U2 = X2; S2 = Y2; + } + else + { + Z1Squared = Z1.Square(); + U2 = Z1Squared.Multiply(X2); + ECFieldElement Z1Cubed = Z1Squared.Multiply(Z1); + S2 = Z1Cubed.Multiply(Y2); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement Z2Squared, U1, S1; + if (Z2IsOne) + { + Z2Squared = Z2; U1 = X1; S1 = Y1; + } + else + { + Z2Squared = Z2.Square(); + U1 = Z2Squared.Multiply(X1); + ECFieldElement Z2Cubed = Z2Squared.Multiply(Z2); + S1 = Z2Cubed.Multiply(Y1); + } + + ECFieldElement H = U1.Subtract(U2); + ECFieldElement R = S1.Subtract(S2); + + // Check if b == this or b == -this + if (H.IsZero) + { + if (R.IsZero) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + ECFieldElement HSquared = H.Square(); + ECFieldElement G = HSquared.Multiply(H); + ECFieldElement V = HSquared.Multiply(U1); + + X3 = R.Square().Add(G).Subtract(Two(V)); + Y3 = V.Subtract(X3).MultiplyMinusProduct(R, G, S1); + + Z3 = H; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + if (!Z2IsOne) + { + Z3 = Z3.Multiply(Z2); + } + + // Alternative calculation of Z3 using fast square + //X3 = four(X3); + //Y3 = eight(Y3); + //Z3 = doubleProductFromSquares(Z1, Z2, Z1Squared, Z2Squared).Multiply(H); + + if (Z3 == H) + { + Z3Squared = HSquared; + } + } + + ECFieldElement[] zs; + if (coord == ECCurve.COORD_JACOBIAN_MODIFIED) + { + // TODO If the result will only be used in a subsequent addition, we don't need W3 + ECFieldElement W3 = CalculateJacobianModifiedW(Z3, Z3Squared); + + zs = new ECFieldElement[] { Z3, W3 }; + } + else + { + zs = new ECFieldElement[] { Z3 }; + } + + return new FpPoint(curve, X3, Y3, zs, IsCompressed); + } + + default: + { + throw new InvalidOperationException("unsupported coordinate system"); + } + } + } + + // B.3 pg 62 + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + int coord = curve.CoordinateSystem; + + ECFieldElement X1 = this.RawXCoord; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + { + ECFieldElement X1Squared = X1.Square(); + ECFieldElement gamma = Three(X1Squared).Add(this.Curve.A).Divide(Two(Y1)); + ECFieldElement X3 = gamma.Square().Subtract(Two(X1)); + ECFieldElement Y3 = gamma.Multiply(X1.Subtract(X3)).Subtract(Y1); + + return new FpPoint(Curve, X3, Y3, IsCompressed); + } + + case ECCurve.COORD_HOMOGENEOUS: + { + ECFieldElement Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + + // TODO Optimize for small negative a4 and -3 + ECFieldElement w = curve.A; + if (!w.IsZero && !Z1IsOne) + { + w = w.Multiply(Z1.Square()); + } + w = w.Add(Three(X1.Square())); + + ECFieldElement s = Z1IsOne ? Y1 : Y1.Multiply(Z1); + ECFieldElement t = Z1IsOne ? Y1.Square() : s.Multiply(Y1); + ECFieldElement B = X1.Multiply(t); + ECFieldElement _4B = Four(B); + ECFieldElement h = w.Square().Subtract(Two(_4B)); + + ECFieldElement _2s = Two(s); + ECFieldElement X3 = h.Multiply(_2s); + ECFieldElement _2t = Two(t); + ECFieldElement Y3 = _4B.Subtract(h).Multiply(w).Subtract(Two(_2t.Square())); + ECFieldElement _4sSquared = Z1IsOne ? Two(_2t) : _2s.Square(); + ECFieldElement Z3 = Two(_4sSquared).Multiply(s); + + return new FpPoint(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + case ECCurve.COORD_JACOBIAN: + { + ECFieldElement Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + + ECFieldElement Y1Squared = Y1.Square(); + ECFieldElement T = Y1Squared.Square(); + + ECFieldElement a4 = curve.A; + ECFieldElement a4Neg = a4.Negate(); + + ECFieldElement M, S; + if (a4Neg.ToBigInteger().Equals(BigInteger.ValueOf(3))) + { + ECFieldElement Z1Squared = Z1IsOne ? Z1 : Z1.Square(); + M = Three(X1.Add(Z1Squared).Multiply(X1.Subtract(Z1Squared))); + S = Four(Y1Squared.Multiply(X1)); + } + else + { + ECFieldElement X1Squared = X1.Square(); + M = Three(X1Squared); + if (Z1IsOne) + { + M = M.Add(a4); + } + else if (!a4.IsZero) + { + ECFieldElement Z1Squared = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement Z1Pow4 = Z1Squared.Square(); + if (a4Neg.BitLength < a4.BitLength) + { + M = M.Subtract(Z1Pow4.Multiply(a4Neg)); + } + else + { + M = M.Add(Z1Pow4.Multiply(a4)); + } + } + //S = two(doubleProductFromSquares(X1, Y1Squared, X1Squared, T)); + S = Four(X1.Multiply(Y1Squared)); + } + + ECFieldElement X3 = M.Square().Subtract(Two(S)); + ECFieldElement Y3 = S.Subtract(X3).Multiply(M).Subtract(Eight(T)); + + ECFieldElement Z3 = Two(Y1); + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + + // Alternative calculation of Z3 using fast square + //ECFieldElement Z3 = doubleProductFromSquares(Y1, Z1, Y1Squared, Z1Squared); + + return new FpPoint(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + case ECCurve.COORD_JACOBIAN_MODIFIED: + { + return TwiceJacobianModified(true); + } + + default: + { + throw new InvalidOperationException("unsupported coordinate system"); + } + } + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + ECCurve curve = this.Curve; + int coord = curve.CoordinateSystem; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + { + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord, Y2 = b.RawYCoord; + + ECFieldElement dx = X2.Subtract(X1), dy = Y2.Subtract(Y1); + + if (dx.IsZero) + { + if (dy.IsZero) + { + // this == b i.e. the result is 3P + return ThreeTimes(); + } + + // this == -b, i.e. the result is P + return this; + } + + /* + * Optimized calculation of 2P + Q, as described in "Trading Inversions for + * Multiplications in Elliptic Curve Cryptography", by Ciet, Joye, Lauter, Montgomery. + */ + + ECFieldElement X = dx.Square(), Y = dy.Square(); + ECFieldElement d = X.Multiply(Two(X1).Add(X2)).Subtract(Y); + if (d.IsZero) + { + return Curve.Infinity; + } + + ECFieldElement D = d.Multiply(dx); + ECFieldElement I = D.Invert(); + ECFieldElement L1 = d.Multiply(I).Multiply(dy); + ECFieldElement L2 = Two(Y1).Multiply(X).Multiply(dx).Multiply(I).Subtract(L1); + ECFieldElement X4 = (L2.Subtract(L1)).Multiply(L1.Add(L2)).Add(X2); + ECFieldElement Y4 = (X1.Subtract(X4)).Multiply(L2).Subtract(Y1); + + return new FpPoint(Curve, X4, Y4, IsCompressed); + } + case ECCurve.COORD_JACOBIAN_MODIFIED: + { + return TwiceJacobianModified(false).Add(b); + } + default: + { + return Twice().Add(b); + } + } + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity) + return this; + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return this; + + ECCurve curve = this.Curve; + int coord = curve.CoordinateSystem; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + { + ECFieldElement X1 = this.RawXCoord; + + ECFieldElement _2Y1 = Two(Y1); + ECFieldElement X = _2Y1.Square(); + ECFieldElement Z = Three(X1.Square()).Add(Curve.A); + ECFieldElement Y = Z.Square(); + + ECFieldElement d = Three(X1).Multiply(X).Subtract(Y); + if (d.IsZero) + { + return Curve.Infinity; + } + + ECFieldElement D = d.Multiply(_2Y1); + ECFieldElement I = D.Invert(); + ECFieldElement L1 = d.Multiply(I).Multiply(Z); + ECFieldElement L2 = X.Square().Multiply(I).Subtract(L1); + + ECFieldElement X4 = (L2.Subtract(L1)).Multiply(L1.Add(L2)).Add(X1); + ECFieldElement Y4 = (X1.Subtract(X4)).Multiply(L2).Subtract(Y1); + return new FpPoint(Curve, X4, Y4, IsCompressed); + } + case ECCurve.COORD_JACOBIAN_MODIFIED: + { + return TwiceJacobianModified(false).Add(this); + } + default: + { + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + } + } + + public override ECPoint TimesPow2(int e) + { + if (e < 0) + throw new ArgumentException("cannot be negative", "e"); + if (e == 0 || this.IsInfinity) + return this; + if (e == 1) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + int coord = curve.CoordinateSystem; + + ECFieldElement W1 = curve.A; + ECFieldElement X1 = this.RawXCoord; + ECFieldElement Z1 = this.RawZCoords.Length < 1 ? curve.FromBigInteger(BigInteger.One) : this.RawZCoords[0]; + + if (!Z1.IsOne) + { + switch (coord) + { + case ECCurve.COORD_HOMOGENEOUS: + ECFieldElement Z1Sq = Z1.Square(); + X1 = X1.Multiply(Z1); + Y1 = Y1.Multiply(Z1Sq); + W1 = CalculateJacobianModifiedW(Z1, Z1Sq); + break; + case ECCurve.COORD_JACOBIAN: + W1 = CalculateJacobianModifiedW(Z1, null); + break; + case ECCurve.COORD_JACOBIAN_MODIFIED: + W1 = GetJacobianModifiedW(); + break; + } + } + + for (int i = 0; i < e; ++i) + { + if (Y1.IsZero) + return curve.Infinity; + + ECFieldElement X1Squared = X1.Square(); + ECFieldElement M = Three(X1Squared); + ECFieldElement _2Y1 = Two(Y1); + ECFieldElement _2Y1Squared = _2Y1.Multiply(Y1); + ECFieldElement S = Two(X1.Multiply(_2Y1Squared)); + ECFieldElement _4T = _2Y1Squared.Square(); + ECFieldElement _8T = Two(_4T); + + if (!W1.IsZero) + { + M = M.Add(W1); + W1 = Two(_8T.Multiply(W1)); + } + + X1 = M.Square().Subtract(Two(S)); + Y1 = M.Multiply(S.Subtract(X1)).Subtract(_8T); + Z1 = Z1.IsOne ? _2Y1 : _2Y1.Multiply(Z1); + } + + switch (coord) + { + case ECCurve.COORD_AFFINE: + ECFieldElement zInv = Z1.Invert(), zInv2 = zInv.Square(), zInv3 = zInv2.Multiply(zInv); + return new FpPoint(curve, X1.Multiply(zInv2), Y1.Multiply(zInv3), IsCompressed); + case ECCurve.COORD_HOMOGENEOUS: + X1 = X1.Multiply(Z1); + Z1 = Z1.Multiply(Z1.Square()); + return new FpPoint(curve, X1, Y1, new ECFieldElement[] { Z1 }, IsCompressed); + case ECCurve.COORD_JACOBIAN: + return new FpPoint(curve, X1, Y1, new ECFieldElement[] { Z1 }, IsCompressed); + case ECCurve.COORD_JACOBIAN_MODIFIED: + return new FpPoint(curve, X1, Y1, new ECFieldElement[] { Z1, W1 }, IsCompressed); + default: + throw new InvalidOperationException("unsupported coordinate system"); + } + } + + protected virtual ECFieldElement Two(ECFieldElement x) + { + return x.Add(x); + } + + protected virtual ECFieldElement Three(ECFieldElement x) + { + return Two(x).Add(x); + } + + protected virtual ECFieldElement Four(ECFieldElement x) + { + return Two(Two(x)); + } + + protected virtual ECFieldElement Eight(ECFieldElement x) + { + return Four(Two(x)); + } + + protected virtual ECFieldElement DoubleProductFromSquares(ECFieldElement a, ECFieldElement b, + ECFieldElement aSquared, ECFieldElement bSquared) + { + /* + * NOTE: If squaring in the field is faster than multiplication, then this is a quicker + * way to calculate 2.A.B, if A^2 and B^2 are already known. + */ + return a.Add(b).Square().Subtract(aSquared).Subtract(bSquared); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + ECCurve curve = Curve; + int coord = curve.CoordinateSystem; + + if (ECCurve.COORD_AFFINE != coord) + { + return new FpPoint(curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + + return new FpPoint(curve, RawXCoord, RawYCoord.Negate(), IsCompressed); + } + + protected virtual ECFieldElement CalculateJacobianModifiedW(ECFieldElement Z, ECFieldElement ZSquared) + { + ECFieldElement a4 = this.Curve.A; + if (a4.IsZero || Z.IsOne) + return a4; + + if (ZSquared == null) + { + ZSquared = Z.Square(); + } + + ECFieldElement W = ZSquared.Square(); + ECFieldElement a4Neg = a4.Negate(); + if (a4Neg.BitLength < a4.BitLength) + { + W = W.Multiply(a4Neg).Negate(); + } + else + { + W = W.Multiply(a4); + } + return W; + } + + protected virtual ECFieldElement GetJacobianModifiedW() + { + ECFieldElement[] ZZ = this.RawZCoords; + ECFieldElement W = ZZ[1]; + if (W == null) + { + // NOTE: Rarely, TwicePlus will result in the need for a lazy W1 calculation here + ZZ[1] = W = CalculateJacobianModifiedW(ZZ[0], null); + } + return W; + } + + protected virtual FpPoint TwiceJacobianModified(bool calculateW) + { + ECFieldElement X1 = this.RawXCoord, Y1 = this.RawYCoord, Z1 = this.RawZCoords[0], W1 = GetJacobianModifiedW(); + + ECFieldElement X1Squared = X1.Square(); + ECFieldElement M = Three(X1Squared).Add(W1); + ECFieldElement _2Y1 = Two(Y1); + ECFieldElement _2Y1Squared = _2Y1.Multiply(Y1); + ECFieldElement S = Two(X1.Multiply(_2Y1Squared)); + ECFieldElement X3 = M.Square().Subtract(Two(S)); + ECFieldElement _4T = _2Y1Squared.Square(); + ECFieldElement _8T = Two(_4T); + ECFieldElement Y3 = M.Multiply(S.Subtract(X3)).Subtract(_8T); + ECFieldElement W3 = calculateW ? Two(_8T.Multiply(W1)) : null; + ECFieldElement Z3 = Z1.IsOne ? _2Y1 : _2Y1.Multiply(Z1); + + return new FpPoint(this.Curve, X3, Y3, new ECFieldElement[] { Z3, W3 }, IsCompressed); + } + } + + public abstract class AbstractF2mPoint + : ECPointBase + { + protected AbstractF2mPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + } + + protected AbstractF2mPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override bool SatisfiesCurveEquation() + { + ECCurve curve = Curve; + ECFieldElement X = this.RawXCoord, Y = this.RawYCoord, A = curve.A, B = curve.B; + ECFieldElement lhs, rhs; + + int coord = curve.CoordinateSystem; + if (coord == ECCurve.COORD_LAMBDA_PROJECTIVE) + { + ECFieldElement Z = this.RawZCoords[0]; + bool ZIsOne = Z.IsOne; + + if (X.IsZero) + { + // NOTE: For x == 0, we expect the affine-y instead of the lambda-y + lhs = Y.Square(); + rhs = B; + if (!ZIsOne) + { + ECFieldElement Z2 = Z.Square(); + rhs = rhs.Multiply(Z2); + } + } + else + { + ECFieldElement L = Y, X2 = X.Square(); + if (ZIsOne) + { + lhs = L.Square().Add(L).Add(A); + rhs = X2.Square().Add(B); + } + else + { + ECFieldElement Z2 = Z.Square(), Z4 = Z2.Square(); + lhs = L.Add(Z).MultiplyPlusProduct(L, A, Z2); + // TODO If sqrt(b) is precomputed this can be simplified to a single square + rhs = X2.SquarePlusProduct(B, Z4); + } + lhs = lhs.Multiply(X2); + } + } + else + { + lhs = Y.Add(X).Multiply(Y); + + switch (coord) + { + case ECCurve.COORD_AFFINE: + break; + case ECCurve.COORD_HOMOGENEOUS: + { + ECFieldElement Z = this.RawZCoords[0]; + if (!Z.IsOne) + { + ECFieldElement Z2 = Z.Square(), Z3 = Z.Multiply(Z2); + lhs = lhs.Multiply(Z); + A = A.Multiply(Z); + B = B.Multiply(Z3); + } + break; + } + default: + throw new InvalidOperationException("unsupported coordinate system"); + } + + rhs = X.Add(A).Multiply(X.Square()).Add(B); + } + + return lhs.Equals(rhs); + } + + protected override bool SatisfiesOrder() + { + ECCurve curve = Curve; + BigInteger cofactor = curve.Cofactor; + if (BigInteger.Two.Equals(cofactor)) + { + /* + * Check that the trace of (X + A) is 0, then there exists a solution to L^2 + L = X + A, + * and so a halving is possible, so this point is the double of another. + */ + ECPoint N = this.Normalize(); + ECFieldElement X = N.AffineXCoord; + ECFieldElement rhs = X.Add(curve.A); + return ((AbstractF2mFieldElement)rhs).Trace() == 0; + } + if (BigInteger.ValueOf(4).Equals(cofactor)) + { + /* + * Solve L^2 + L = X + A to find the half of this point, if it exists (fail if not). + * Generate both possibilities for the square of the half-point's x-coordinate (w), + * and check if Tr(w + A) == 0 for at least one; then a second halving is possible + * (see comments for cofactor 2 above), so this point is four times another. + * + * Note: Tr(x^2) == Tr(x). + */ + ECPoint N = this.Normalize(); + ECFieldElement X = N.AffineXCoord; + ECFieldElement lambda = ((AbstractF2mCurve)curve).SolveQuadraticEquation(X.Add(curve.A)); + if (lambda == null) + return false; + + ECFieldElement w = X.Multiply(lambda).Add(N.AffineYCoord); + ECFieldElement t = w.Add(curve.A); + return ((AbstractF2mFieldElement)t).Trace() == 0 + || ((AbstractF2mFieldElement)(t.Add(X))).Trace() == 0; + } + + return base.SatisfiesOrder(); + } + + public override ECPoint ScaleX(ECFieldElement scale) + { + if (this.IsInfinity) + return this; + + switch (CurveCoordinateSystem) + { + case ECCurve.COORD_LAMBDA_AFFINE: + { + // Y is actually Lambda (X + Y/X) here + ECFieldElement X = RawXCoord, L = RawYCoord; + + ECFieldElement X2 = X.Multiply(scale); + ECFieldElement L2 = L.Add(X).Divide(scale).Add(X2); + + return Curve.CreateRawPoint(X, L2, RawZCoords, IsCompressed); + } + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + // Y is actually Lambda (X + Y/X) here + ECFieldElement X = RawXCoord, L = RawYCoord, Z = RawZCoords[0]; + + // We scale the Z coordinate also, to avoid an inversion + ECFieldElement X2 = X.Multiply(scale.Square()); + ECFieldElement L2 = L.Add(X).Add(X2); + ECFieldElement Z2 = Z.Multiply(scale); + + return Curve.CreateRawPoint(X, L2, new ECFieldElement[] { Z2 }, IsCompressed); + } + default: + { + return base.ScaleX(scale); + } + } + } + + public override ECPoint ScaleY(ECFieldElement scale) + { + if (this.IsInfinity) + return this; + + switch (CurveCoordinateSystem) + { + case ECCurve.COORD_LAMBDA_AFFINE: + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + // Y is actually Lambda (X + Y/X) here + ECFieldElement L2 = L.Add(X).Multiply(scale).Add(X); + + return Curve.CreateRawPoint(X, L2, RawZCoords, IsCompressed); + } + default: + { + return base.ScaleY(scale); + } + } + } + + public override ECPoint Subtract(ECPoint b) + { + if (b.IsInfinity) + return this; + + // Add -b + return Add(b.Negate()); + } + + public virtual AbstractF2mPoint Tau() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + int coord = curve.CoordinateSystem; + + ECFieldElement X1 = this.RawXCoord; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + case ECCurve.COORD_LAMBDA_AFFINE: + { + ECFieldElement Y1 = this.RawYCoord; + return (AbstractF2mPoint)curve.CreateRawPoint(X1.Square(), Y1.Square(), IsCompressed); + } + case ECCurve.COORD_HOMOGENEOUS: + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + ECFieldElement Y1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + return (AbstractF2mPoint)curve.CreateRawPoint(X1.Square(), Y1.Square(), + new ECFieldElement[] { Z1.Square() }, IsCompressed); + } + default: + { + throw new InvalidOperationException("unsupported coordinate system"); + } + } + } + + public virtual AbstractF2mPoint TauPow(int pow) + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + int coord = curve.CoordinateSystem; + + ECFieldElement X1 = this.RawXCoord; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + case ECCurve.COORD_LAMBDA_AFFINE: + { + ECFieldElement Y1 = this.RawYCoord; + return (AbstractF2mPoint)curve.CreateRawPoint(X1.SquarePow(pow), Y1.SquarePow(pow), IsCompressed); + } + case ECCurve.COORD_HOMOGENEOUS: + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + ECFieldElement Y1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + return (AbstractF2mPoint)curve.CreateRawPoint(X1.SquarePow(pow), Y1.SquarePow(pow), + new ECFieldElement[] { Z1.SquarePow(pow) }, IsCompressed); + } + default: + { + throw new InvalidOperationException("unsupported coordinate system"); + } + } + } + } + + /** + * Elliptic curve points over F2m + */ + public class F2mPoint + : AbstractF2mPoint + { + /** + * @param curve base curve + * @param x x point + * @param y y point + */ + [Obsolete("Use ECCurve.CreatePoint to construct points")] + public F2mPoint( + ECCurve curve, + ECFieldElement x, + ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @param curve base curve + * @param x x point + * @param y y point + * @param withCompression true if encode with point compression. + */ + [Obsolete("Per-point compression property will be removed, see GetEncoded(bool)")] + public F2mPoint( + ECCurve curve, + ECFieldElement x, + ECFieldElement y, + bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + { + throw new ArgumentException("Exactly one of the field elements is null"); + } + + if (x != null) + { + // Check if x and y are elements of the same field + F2mFieldElement.CheckFieldElements(x, y); + + // Check if x and a are elements of the same field + if (curve != null) + { + F2mFieldElement.CheckFieldElements(x, curve.A); + } + } + } + + internal F2mPoint(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new F2mPoint(null, AffineXCoord, AffineYCoord, false); + } + + public override ECFieldElement YCoord + { + get + { + int coord = this.CurveCoordinateSystem; + + switch (coord) + { + case ECCurve.COORD_LAMBDA_AFFINE: + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + if (ECCurve.COORD_LAMBDA_PROJECTIVE == coord) + { + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + } + return Y; + } + default: + { + return RawYCoord; + } + } + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + { + return false; + } + + ECFieldElement Y = this.RawYCoord; + + switch (this.CurveCoordinateSystem) + { + case ECCurve.COORD_LAMBDA_AFFINE: + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + default: + { + return Y.Divide(X).TestBitZero(); + } + } + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + int coord = curve.CoordinateSystem; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + { + ECFieldElement Y1 = this.RawYCoord; + ECFieldElement Y2 = b.RawYCoord; + + ECFieldElement dx = X1.Add(X2), dy = Y1.Add(Y2); + if (dx.IsZero) + { + if (dy.IsZero) + { + return Twice(); + } + + return curve.Infinity; + } + + ECFieldElement L = dy.Divide(dx); + + ECFieldElement X3 = L.Square().Add(L).Add(dx).Add(curve.A); + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + + return new F2mPoint(curve, X3, Y3, IsCompressed); + } + case ECCurve.COORD_HOMOGENEOUS: + { + ECFieldElement Y1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement Y2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U1 = Y2, V1 = X2; + if (!Z1IsOne) + { + U1 = U1.Multiply(Z1); + V1 = V1.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U2 = Y1, V2 = X1; + if (!Z2IsOne) + { + U2 = U2.Multiply(Z2); + V2 = V2.Multiply(Z2); + } + + ECFieldElement U = U1.Add(U2); + ECFieldElement V = V1.Add(V2); + + if (V.IsZero) + { + if (U.IsZero) + { + return Twice(); + } + + return curve.Infinity; + } + + ECFieldElement VSq = V.Square(); + ECFieldElement VCu = VSq.Multiply(V); + ECFieldElement W = Z1IsOne ? Z2 : Z2IsOne ? Z1 : Z1.Multiply(Z2); + ECFieldElement uv = U.Add(V); + ECFieldElement A = uv.MultiplyPlusProduct(U, VSq, curve.A).Multiply(W).Add(VCu); + + ECFieldElement X3 = V.Multiply(A); + ECFieldElement VSqZ2 = Z2IsOne ? VSq : VSq.Multiply(Z2); + ECFieldElement Y3 = U.MultiplyPlusProduct(X1, V, Y1).MultiplyPlusProduct(VSqZ2, uv, A); + ECFieldElement Z3 = VCu.Multiply(W); + + return new F2mPoint(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + { + return Twice(); + } + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.RawXCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).Add(curve.A); + if (X3.IsZero) + { + return new F2mPoint(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new F2mPoint(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new F2mPoint(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + default: + { + throw new InvalidOperationException("unsupported coordinate system"); + } + } + } + + /* (non-Javadoc) + * @see BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.ECPoint#twice() + */ + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own additive inverse + return curve.Infinity; + } + + int coord = curve.CoordinateSystem; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + { + ECFieldElement Y1 = this.RawYCoord; + + ECFieldElement L1 = Y1.Divide(X1).Add(X1); + + ECFieldElement X3 = L1.Square().Add(L1).Add(curve.A); + ECFieldElement Y3 = X1.SquarePlusProduct(X3, L1.AddOne()); + + return new F2mPoint(curve, X3, Y3, IsCompressed); + } + case ECCurve.COORD_HOMOGENEOUS: + { + ECFieldElement Y1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement Y1Z1 = Z1IsOne ? Y1 : Y1.Multiply(Z1); + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement S = X1Sq.Add(Y1Z1); + ECFieldElement V = X1Z1; + ECFieldElement vSquared = V.Square(); + ECFieldElement sv = S.Add(V); + ECFieldElement h = sv.MultiplyPlusProduct(S, vSquared, curve.A); + + ECFieldElement X3 = V.Multiply(h); + ECFieldElement Y3 = X1Sq.Square().MultiplyPlusProduct(V, h, sv); + ECFieldElement Z3 = V.Multiply(vSquared); + + return new F2mPoint(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement a = curve.A; + ECFieldElement aZ1Sq = Z1IsOne ? a : a.Multiply(Z1Sq); + ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); + if (T.IsZero) + { + return new F2mPoint(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement b = curve.B; + ECFieldElement L3; + if (b.BitLength < (curve.FieldSize >> 1)) + { + ECFieldElement t1 = L1.Add(X1).Square(); + ECFieldElement t2; + if (b.IsOne) + { + t2 = aZ1Sq.Add(Z1Sq).Square(); + } + else + { + // TODO Can be calculated with one square if we pre-compute sqrt(b) + t2 = aZ1Sq.SquarePlusProduct(b, Z1Sq.Square()); + } + L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3); + if (a.IsZero) + { + L3 = L3.Add(Z3); + } + else if (!a.IsOne) + { + L3 = L3.Add(a.AddOne().Multiply(Z3)); + } + } + else + { + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + } + + return new F2mPoint(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + default: + { + throw new InvalidOperationException("unsupported coordinate system"); + } + } + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own additive inverse + return b; + } + + int coord = curve.CoordinateSystem; + + switch (coord) + { + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + // NOTE: twicePlus() only optimized for lambda-affine argument + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = curve.A.Multiply(Z1Sq).Add(L1Sq).Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = curve.A.Add(L2plus1).Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + { + return b.Twice(); + } + + return curve.Infinity; + } + + if (A.IsZero) + { + return new F2mPoint(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new F2mPoint(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + default: + { + return Twice().Add(b); + } + } + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + ECCurve curve = this.Curve; + int coord = curve.CoordinateSystem; + + switch (coord) + { + case ECCurve.COORD_AFFINE: + { + ECFieldElement Y = this.RawYCoord; + return new F2mPoint(curve, X, Y.Add(X), IsCompressed); + } + case ECCurve.COORD_HOMOGENEOUS: + { + ECFieldElement Y = this.RawYCoord, Z = this.RawZCoords[0]; + return new F2mPoint(curve, X, Y.Add(X), new ECFieldElement[] { Z }, IsCompressed); + } + case ECCurve.COORD_LAMBDA_AFFINE: + { + ECFieldElement L = this.RawYCoord; + return new F2mPoint(curve, X, L.AddOne(), IsCompressed); + } + case ECCurve.COORD_LAMBDA_PROJECTIVE: + { + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new F2mPoint(curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + default: + { + throw new InvalidOperationException("unsupported coordinate system"); + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPoint.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPoint.cs.meta new file mode 100644 index 00000000..f4a2258a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0708bb98a46600e47b0eee7ea6b0d44d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPointMap.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPointMap.cs new file mode 100644 index 00000000..7df57bca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPointMap.cs @@ -0,0 +1,13 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + public interface ECPointMap + { + ECPoint Map(ECPoint p); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPointMap.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPointMap.cs.meta new file mode 100644 index 00000000..1394667d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ECPointMap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b16b78238477b4749b0ad4ff2a2bcf28 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/LongArray.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/LongArray.cs new file mode 100644 index 00000000..52b3ccbc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/LongArray.cs @@ -0,0 +1,2210 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + internal class LongArray + { + //private static long DEInterleave_MASK = 0x5555555555555555L; + + /* + * This expands 8 bit indices into 16 bit contents (high bit 14), by inserting 0s between bits. + * In a binary field, this operation is the same as squaring an 8 bit number. + */ + private static readonly ushort[] INTERLEAVE2_TABLE = new ushort[] + { + 0x0000, 0x0001, 0x0004, 0x0005, 0x0010, 0x0011, 0x0014, 0x0015, + 0x0040, 0x0041, 0x0044, 0x0045, 0x0050, 0x0051, 0x0054, 0x0055, + 0x0100, 0x0101, 0x0104, 0x0105, 0x0110, 0x0111, 0x0114, 0x0115, + 0x0140, 0x0141, 0x0144, 0x0145, 0x0150, 0x0151, 0x0154, 0x0155, + 0x0400, 0x0401, 0x0404, 0x0405, 0x0410, 0x0411, 0x0414, 0x0415, + 0x0440, 0x0441, 0x0444, 0x0445, 0x0450, 0x0451, 0x0454, 0x0455, + 0x0500, 0x0501, 0x0504, 0x0505, 0x0510, 0x0511, 0x0514, 0x0515, + 0x0540, 0x0541, 0x0544, 0x0545, 0x0550, 0x0551, 0x0554, 0x0555, + 0x1000, 0x1001, 0x1004, 0x1005, 0x1010, 0x1011, 0x1014, 0x1015, + 0x1040, 0x1041, 0x1044, 0x1045, 0x1050, 0x1051, 0x1054, 0x1055, + 0x1100, 0x1101, 0x1104, 0x1105, 0x1110, 0x1111, 0x1114, 0x1115, + 0x1140, 0x1141, 0x1144, 0x1145, 0x1150, 0x1151, 0x1154, 0x1155, + 0x1400, 0x1401, 0x1404, 0x1405, 0x1410, 0x1411, 0x1414, 0x1415, + 0x1440, 0x1441, 0x1444, 0x1445, 0x1450, 0x1451, 0x1454, 0x1455, + 0x1500, 0x1501, 0x1504, 0x1505, 0x1510, 0x1511, 0x1514, 0x1515, + 0x1540, 0x1541, 0x1544, 0x1545, 0x1550, 0x1551, 0x1554, 0x1555, + 0x4000, 0x4001, 0x4004, 0x4005, 0x4010, 0x4011, 0x4014, 0x4015, + 0x4040, 0x4041, 0x4044, 0x4045, 0x4050, 0x4051, 0x4054, 0x4055, + 0x4100, 0x4101, 0x4104, 0x4105, 0x4110, 0x4111, 0x4114, 0x4115, + 0x4140, 0x4141, 0x4144, 0x4145, 0x4150, 0x4151, 0x4154, 0x4155, + 0x4400, 0x4401, 0x4404, 0x4405, 0x4410, 0x4411, 0x4414, 0x4415, + 0x4440, 0x4441, 0x4444, 0x4445, 0x4450, 0x4451, 0x4454, 0x4455, + 0x4500, 0x4501, 0x4504, 0x4505, 0x4510, 0x4511, 0x4514, 0x4515, + 0x4540, 0x4541, 0x4544, 0x4545, 0x4550, 0x4551, 0x4554, 0x4555, + 0x5000, 0x5001, 0x5004, 0x5005, 0x5010, 0x5011, 0x5014, 0x5015, + 0x5040, 0x5041, 0x5044, 0x5045, 0x5050, 0x5051, 0x5054, 0x5055, + 0x5100, 0x5101, 0x5104, 0x5105, 0x5110, 0x5111, 0x5114, 0x5115, + 0x5140, 0x5141, 0x5144, 0x5145, 0x5150, 0x5151, 0x5154, 0x5155, + 0x5400, 0x5401, 0x5404, 0x5405, 0x5410, 0x5411, 0x5414, 0x5415, + 0x5440, 0x5441, 0x5444, 0x5445, 0x5450, 0x5451, 0x5454, 0x5455, + 0x5500, 0x5501, 0x5504, 0x5505, 0x5510, 0x5511, 0x5514, 0x5515, + 0x5540, 0x5541, 0x5544, 0x5545, 0x5550, 0x5551, 0x5554, 0x5555 + }; + + /* + * This expands 7 bit indices into 21 bit contents (high bit 18), by inserting 0s between bits. + */ + private static readonly int[] INTERLEAVE3_TABLE = new int[] + { + 0x00000, 0x00001, 0x00008, 0x00009, 0x00040, 0x00041, 0x00048, 0x00049, + 0x00200, 0x00201, 0x00208, 0x00209, 0x00240, 0x00241, 0x00248, 0x00249, + 0x01000, 0x01001, 0x01008, 0x01009, 0x01040, 0x01041, 0x01048, 0x01049, + 0x01200, 0x01201, 0x01208, 0x01209, 0x01240, 0x01241, 0x01248, 0x01249, + 0x08000, 0x08001, 0x08008, 0x08009, 0x08040, 0x08041, 0x08048, 0x08049, + 0x08200, 0x08201, 0x08208, 0x08209, 0x08240, 0x08241, 0x08248, 0x08249, + 0x09000, 0x09001, 0x09008, 0x09009, 0x09040, 0x09041, 0x09048, 0x09049, + 0x09200, 0x09201, 0x09208, 0x09209, 0x09240, 0x09241, 0x09248, 0x09249, + 0x40000, 0x40001, 0x40008, 0x40009, 0x40040, 0x40041, 0x40048, 0x40049, + 0x40200, 0x40201, 0x40208, 0x40209, 0x40240, 0x40241, 0x40248, 0x40249, + 0x41000, 0x41001, 0x41008, 0x41009, 0x41040, 0x41041, 0x41048, 0x41049, + 0x41200, 0x41201, 0x41208, 0x41209, 0x41240, 0x41241, 0x41248, 0x41249, + 0x48000, 0x48001, 0x48008, 0x48009, 0x48040, 0x48041, 0x48048, 0x48049, + 0x48200, 0x48201, 0x48208, 0x48209, 0x48240, 0x48241, 0x48248, 0x48249, + 0x49000, 0x49001, 0x49008, 0x49009, 0x49040, 0x49041, 0x49048, 0x49049, + 0x49200, 0x49201, 0x49208, 0x49209, 0x49240, 0x49241, 0x49248, 0x49249 + }; + + /* + * This expands 8 bit indices into 32 bit contents (high bit 28), by inserting 0s between bits. + */ + private static readonly int[] INTERLEAVE4_TABLE = new int[] + { + 0x00000000, 0x00000001, 0x00000010, 0x00000011, 0x00000100, 0x00000101, 0x00000110, 0x00000111, + 0x00001000, 0x00001001, 0x00001010, 0x00001011, 0x00001100, 0x00001101, 0x00001110, 0x00001111, + 0x00010000, 0x00010001, 0x00010010, 0x00010011, 0x00010100, 0x00010101, 0x00010110, 0x00010111, + 0x00011000, 0x00011001, 0x00011010, 0x00011011, 0x00011100, 0x00011101, 0x00011110, 0x00011111, + 0x00100000, 0x00100001, 0x00100010, 0x00100011, 0x00100100, 0x00100101, 0x00100110, 0x00100111, + 0x00101000, 0x00101001, 0x00101010, 0x00101011, 0x00101100, 0x00101101, 0x00101110, 0x00101111, + 0x00110000, 0x00110001, 0x00110010, 0x00110011, 0x00110100, 0x00110101, 0x00110110, 0x00110111, + 0x00111000, 0x00111001, 0x00111010, 0x00111011, 0x00111100, 0x00111101, 0x00111110, 0x00111111, + 0x01000000, 0x01000001, 0x01000010, 0x01000011, 0x01000100, 0x01000101, 0x01000110, 0x01000111, + 0x01001000, 0x01001001, 0x01001010, 0x01001011, 0x01001100, 0x01001101, 0x01001110, 0x01001111, + 0x01010000, 0x01010001, 0x01010010, 0x01010011, 0x01010100, 0x01010101, 0x01010110, 0x01010111, + 0x01011000, 0x01011001, 0x01011010, 0x01011011, 0x01011100, 0x01011101, 0x01011110, 0x01011111, + 0x01100000, 0x01100001, 0x01100010, 0x01100011, 0x01100100, 0x01100101, 0x01100110, 0x01100111, + 0x01101000, 0x01101001, 0x01101010, 0x01101011, 0x01101100, 0x01101101, 0x01101110, 0x01101111, + 0x01110000, 0x01110001, 0x01110010, 0x01110011, 0x01110100, 0x01110101, 0x01110110, 0x01110111, + 0x01111000, 0x01111001, 0x01111010, 0x01111011, 0x01111100, 0x01111101, 0x01111110, 0x01111111, + 0x10000000, 0x10000001, 0x10000010, 0x10000011, 0x10000100, 0x10000101, 0x10000110, 0x10000111, + 0x10001000, 0x10001001, 0x10001010, 0x10001011, 0x10001100, 0x10001101, 0x10001110, 0x10001111, + 0x10010000, 0x10010001, 0x10010010, 0x10010011, 0x10010100, 0x10010101, 0x10010110, 0x10010111, + 0x10011000, 0x10011001, 0x10011010, 0x10011011, 0x10011100, 0x10011101, 0x10011110, 0x10011111, + 0x10100000, 0x10100001, 0x10100010, 0x10100011, 0x10100100, 0x10100101, 0x10100110, 0x10100111, + 0x10101000, 0x10101001, 0x10101010, 0x10101011, 0x10101100, 0x10101101, 0x10101110, 0x10101111, + 0x10110000, 0x10110001, 0x10110010, 0x10110011, 0x10110100, 0x10110101, 0x10110110, 0x10110111, + 0x10111000, 0x10111001, 0x10111010, 0x10111011, 0x10111100, 0x10111101, 0x10111110, 0x10111111, + 0x11000000, 0x11000001, 0x11000010, 0x11000011, 0x11000100, 0x11000101, 0x11000110, 0x11000111, + 0x11001000, 0x11001001, 0x11001010, 0x11001011, 0x11001100, 0x11001101, 0x11001110, 0x11001111, + 0x11010000, 0x11010001, 0x11010010, 0x11010011, 0x11010100, 0x11010101, 0x11010110, 0x11010111, + 0x11011000, 0x11011001, 0x11011010, 0x11011011, 0x11011100, 0x11011101, 0x11011110, 0x11011111, + 0x11100000, 0x11100001, 0x11100010, 0x11100011, 0x11100100, 0x11100101, 0x11100110, 0x11100111, + 0x11101000, 0x11101001, 0x11101010, 0x11101011, 0x11101100, 0x11101101, 0x11101110, 0x11101111, + 0x11110000, 0x11110001, 0x11110010, 0x11110011, 0x11110100, 0x11110101, 0x11110110, 0x11110111, + 0x11111000, 0x11111001, 0x11111010, 0x11111011, 0x11111100, 0x11111101, 0x11111110, 0x11111111 + }; + + /* + * This expands 7 bit indices into 35 bit contents (high bit 30), by inserting 0s between bits. + */ + private static readonly int[] INTERLEAVE5_TABLE = new int[] { + 0x00000000, 0x00000001, 0x00000020, 0x00000021, 0x00000400, 0x00000401, 0x00000420, 0x00000421, + 0x00008000, 0x00008001, 0x00008020, 0x00008021, 0x00008400, 0x00008401, 0x00008420, 0x00008421, + 0x00100000, 0x00100001, 0x00100020, 0x00100021, 0x00100400, 0x00100401, 0x00100420, 0x00100421, + 0x00108000, 0x00108001, 0x00108020, 0x00108021, 0x00108400, 0x00108401, 0x00108420, 0x00108421, + 0x02000000, 0x02000001, 0x02000020, 0x02000021, 0x02000400, 0x02000401, 0x02000420, 0x02000421, + 0x02008000, 0x02008001, 0x02008020, 0x02008021, 0x02008400, 0x02008401, 0x02008420, 0x02008421, + 0x02100000, 0x02100001, 0x02100020, 0x02100021, 0x02100400, 0x02100401, 0x02100420, 0x02100421, + 0x02108000, 0x02108001, 0x02108020, 0x02108021, 0x02108400, 0x02108401, 0x02108420, 0x02108421, + 0x40000000, 0x40000001, 0x40000020, 0x40000021, 0x40000400, 0x40000401, 0x40000420, 0x40000421, + 0x40008000, 0x40008001, 0x40008020, 0x40008021, 0x40008400, 0x40008401, 0x40008420, 0x40008421, + 0x40100000, 0x40100001, 0x40100020, 0x40100021, 0x40100400, 0x40100401, 0x40100420, 0x40100421, + 0x40108000, 0x40108001, 0x40108020, 0x40108021, 0x40108400, 0x40108401, 0x40108420, 0x40108421, + 0x42000000, 0x42000001, 0x42000020, 0x42000021, 0x42000400, 0x42000401, 0x42000420, 0x42000421, + 0x42008000, 0x42008001, 0x42008020, 0x42008021, 0x42008400, 0x42008401, 0x42008420, 0x42008421, + 0x42100000, 0x42100001, 0x42100020, 0x42100021, 0x42100400, 0x42100401, 0x42100420, 0x42100421, + 0x42108000, 0x42108001, 0x42108020, 0x42108021, 0x42108400, 0x42108401, 0x42108420, 0x42108421 + }; + + /* + * This expands 9 bit indices into 63 bit (long) contents (high bit 56), by inserting 0s between bits. + */ + private static readonly long[] INTERLEAVE7_TABLE = new long[] + { + 0x0000000000000000L, 0x0000000000000001L, 0x0000000000000080L, 0x0000000000000081L, + 0x0000000000004000L, 0x0000000000004001L, 0x0000000000004080L, 0x0000000000004081L, + 0x0000000000200000L, 0x0000000000200001L, 0x0000000000200080L, 0x0000000000200081L, + 0x0000000000204000L, 0x0000000000204001L, 0x0000000000204080L, 0x0000000000204081L, + 0x0000000010000000L, 0x0000000010000001L, 0x0000000010000080L, 0x0000000010000081L, + 0x0000000010004000L, 0x0000000010004001L, 0x0000000010004080L, 0x0000000010004081L, + 0x0000000010200000L, 0x0000000010200001L, 0x0000000010200080L, 0x0000000010200081L, + 0x0000000010204000L, 0x0000000010204001L, 0x0000000010204080L, 0x0000000010204081L, + 0x0000000800000000L, 0x0000000800000001L, 0x0000000800000080L, 0x0000000800000081L, + 0x0000000800004000L, 0x0000000800004001L, 0x0000000800004080L, 0x0000000800004081L, + 0x0000000800200000L, 0x0000000800200001L, 0x0000000800200080L, 0x0000000800200081L, + 0x0000000800204000L, 0x0000000800204001L, 0x0000000800204080L, 0x0000000800204081L, + 0x0000000810000000L, 0x0000000810000001L, 0x0000000810000080L, 0x0000000810000081L, + 0x0000000810004000L, 0x0000000810004001L, 0x0000000810004080L, 0x0000000810004081L, + 0x0000000810200000L, 0x0000000810200001L, 0x0000000810200080L, 0x0000000810200081L, + 0x0000000810204000L, 0x0000000810204001L, 0x0000000810204080L, 0x0000000810204081L, + 0x0000040000000000L, 0x0000040000000001L, 0x0000040000000080L, 0x0000040000000081L, + 0x0000040000004000L, 0x0000040000004001L, 0x0000040000004080L, 0x0000040000004081L, + 0x0000040000200000L, 0x0000040000200001L, 0x0000040000200080L, 0x0000040000200081L, + 0x0000040000204000L, 0x0000040000204001L, 0x0000040000204080L, 0x0000040000204081L, + 0x0000040010000000L, 0x0000040010000001L, 0x0000040010000080L, 0x0000040010000081L, + 0x0000040010004000L, 0x0000040010004001L, 0x0000040010004080L, 0x0000040010004081L, + 0x0000040010200000L, 0x0000040010200001L, 0x0000040010200080L, 0x0000040010200081L, + 0x0000040010204000L, 0x0000040010204001L, 0x0000040010204080L, 0x0000040010204081L, + 0x0000040800000000L, 0x0000040800000001L, 0x0000040800000080L, 0x0000040800000081L, + 0x0000040800004000L, 0x0000040800004001L, 0x0000040800004080L, 0x0000040800004081L, + 0x0000040800200000L, 0x0000040800200001L, 0x0000040800200080L, 0x0000040800200081L, + 0x0000040800204000L, 0x0000040800204001L, 0x0000040800204080L, 0x0000040800204081L, + 0x0000040810000000L, 0x0000040810000001L, 0x0000040810000080L, 0x0000040810000081L, + 0x0000040810004000L, 0x0000040810004001L, 0x0000040810004080L, 0x0000040810004081L, + 0x0000040810200000L, 0x0000040810200001L, 0x0000040810200080L, 0x0000040810200081L, + 0x0000040810204000L, 0x0000040810204001L, 0x0000040810204080L, 0x0000040810204081L, + 0x0002000000000000L, 0x0002000000000001L, 0x0002000000000080L, 0x0002000000000081L, + 0x0002000000004000L, 0x0002000000004001L, 0x0002000000004080L, 0x0002000000004081L, + 0x0002000000200000L, 0x0002000000200001L, 0x0002000000200080L, 0x0002000000200081L, + 0x0002000000204000L, 0x0002000000204001L, 0x0002000000204080L, 0x0002000000204081L, + 0x0002000010000000L, 0x0002000010000001L, 0x0002000010000080L, 0x0002000010000081L, + 0x0002000010004000L, 0x0002000010004001L, 0x0002000010004080L, 0x0002000010004081L, + 0x0002000010200000L, 0x0002000010200001L, 0x0002000010200080L, 0x0002000010200081L, + 0x0002000010204000L, 0x0002000010204001L, 0x0002000010204080L, 0x0002000010204081L, + 0x0002000800000000L, 0x0002000800000001L, 0x0002000800000080L, 0x0002000800000081L, + 0x0002000800004000L, 0x0002000800004001L, 0x0002000800004080L, 0x0002000800004081L, + 0x0002000800200000L, 0x0002000800200001L, 0x0002000800200080L, 0x0002000800200081L, + 0x0002000800204000L, 0x0002000800204001L, 0x0002000800204080L, 0x0002000800204081L, + 0x0002000810000000L, 0x0002000810000001L, 0x0002000810000080L, 0x0002000810000081L, + 0x0002000810004000L, 0x0002000810004001L, 0x0002000810004080L, 0x0002000810004081L, + 0x0002000810200000L, 0x0002000810200001L, 0x0002000810200080L, 0x0002000810200081L, + 0x0002000810204000L, 0x0002000810204001L, 0x0002000810204080L, 0x0002000810204081L, + 0x0002040000000000L, 0x0002040000000001L, 0x0002040000000080L, 0x0002040000000081L, + 0x0002040000004000L, 0x0002040000004001L, 0x0002040000004080L, 0x0002040000004081L, + 0x0002040000200000L, 0x0002040000200001L, 0x0002040000200080L, 0x0002040000200081L, + 0x0002040000204000L, 0x0002040000204001L, 0x0002040000204080L, 0x0002040000204081L, + 0x0002040010000000L, 0x0002040010000001L, 0x0002040010000080L, 0x0002040010000081L, + 0x0002040010004000L, 0x0002040010004001L, 0x0002040010004080L, 0x0002040010004081L, + 0x0002040010200000L, 0x0002040010200001L, 0x0002040010200080L, 0x0002040010200081L, + 0x0002040010204000L, 0x0002040010204001L, 0x0002040010204080L, 0x0002040010204081L, + 0x0002040800000000L, 0x0002040800000001L, 0x0002040800000080L, 0x0002040800000081L, + 0x0002040800004000L, 0x0002040800004001L, 0x0002040800004080L, 0x0002040800004081L, + 0x0002040800200000L, 0x0002040800200001L, 0x0002040800200080L, 0x0002040800200081L, + 0x0002040800204000L, 0x0002040800204001L, 0x0002040800204080L, 0x0002040800204081L, + 0x0002040810000000L, 0x0002040810000001L, 0x0002040810000080L, 0x0002040810000081L, + 0x0002040810004000L, 0x0002040810004001L, 0x0002040810004080L, 0x0002040810004081L, + 0x0002040810200000L, 0x0002040810200001L, 0x0002040810200080L, 0x0002040810200081L, + 0x0002040810204000L, 0x0002040810204001L, 0x0002040810204080L, 0x0002040810204081L, + 0x0100000000000000L, 0x0100000000000001L, 0x0100000000000080L, 0x0100000000000081L, + 0x0100000000004000L, 0x0100000000004001L, 0x0100000000004080L, 0x0100000000004081L, + 0x0100000000200000L, 0x0100000000200001L, 0x0100000000200080L, 0x0100000000200081L, + 0x0100000000204000L, 0x0100000000204001L, 0x0100000000204080L, 0x0100000000204081L, + 0x0100000010000000L, 0x0100000010000001L, 0x0100000010000080L, 0x0100000010000081L, + 0x0100000010004000L, 0x0100000010004001L, 0x0100000010004080L, 0x0100000010004081L, + 0x0100000010200000L, 0x0100000010200001L, 0x0100000010200080L, 0x0100000010200081L, + 0x0100000010204000L, 0x0100000010204001L, 0x0100000010204080L, 0x0100000010204081L, + 0x0100000800000000L, 0x0100000800000001L, 0x0100000800000080L, 0x0100000800000081L, + 0x0100000800004000L, 0x0100000800004001L, 0x0100000800004080L, 0x0100000800004081L, + 0x0100000800200000L, 0x0100000800200001L, 0x0100000800200080L, 0x0100000800200081L, + 0x0100000800204000L, 0x0100000800204001L, 0x0100000800204080L, 0x0100000800204081L, + 0x0100000810000000L, 0x0100000810000001L, 0x0100000810000080L, 0x0100000810000081L, + 0x0100000810004000L, 0x0100000810004001L, 0x0100000810004080L, 0x0100000810004081L, + 0x0100000810200000L, 0x0100000810200001L, 0x0100000810200080L, 0x0100000810200081L, + 0x0100000810204000L, 0x0100000810204001L, 0x0100000810204080L, 0x0100000810204081L, + 0x0100040000000000L, 0x0100040000000001L, 0x0100040000000080L, 0x0100040000000081L, + 0x0100040000004000L, 0x0100040000004001L, 0x0100040000004080L, 0x0100040000004081L, + 0x0100040000200000L, 0x0100040000200001L, 0x0100040000200080L, 0x0100040000200081L, + 0x0100040000204000L, 0x0100040000204001L, 0x0100040000204080L, 0x0100040000204081L, + 0x0100040010000000L, 0x0100040010000001L, 0x0100040010000080L, 0x0100040010000081L, + 0x0100040010004000L, 0x0100040010004001L, 0x0100040010004080L, 0x0100040010004081L, + 0x0100040010200000L, 0x0100040010200001L, 0x0100040010200080L, 0x0100040010200081L, + 0x0100040010204000L, 0x0100040010204001L, 0x0100040010204080L, 0x0100040010204081L, + 0x0100040800000000L, 0x0100040800000001L, 0x0100040800000080L, 0x0100040800000081L, + 0x0100040800004000L, 0x0100040800004001L, 0x0100040800004080L, 0x0100040800004081L, + 0x0100040800200000L, 0x0100040800200001L, 0x0100040800200080L, 0x0100040800200081L, + 0x0100040800204000L, 0x0100040800204001L, 0x0100040800204080L, 0x0100040800204081L, + 0x0100040810000000L, 0x0100040810000001L, 0x0100040810000080L, 0x0100040810000081L, + 0x0100040810004000L, 0x0100040810004001L, 0x0100040810004080L, 0x0100040810004081L, + 0x0100040810200000L, 0x0100040810200001L, 0x0100040810200080L, 0x0100040810200081L, + 0x0100040810204000L, 0x0100040810204001L, 0x0100040810204080L, 0x0100040810204081L, + 0x0102000000000000L, 0x0102000000000001L, 0x0102000000000080L, 0x0102000000000081L, + 0x0102000000004000L, 0x0102000000004001L, 0x0102000000004080L, 0x0102000000004081L, + 0x0102000000200000L, 0x0102000000200001L, 0x0102000000200080L, 0x0102000000200081L, + 0x0102000000204000L, 0x0102000000204001L, 0x0102000000204080L, 0x0102000000204081L, + 0x0102000010000000L, 0x0102000010000001L, 0x0102000010000080L, 0x0102000010000081L, + 0x0102000010004000L, 0x0102000010004001L, 0x0102000010004080L, 0x0102000010004081L, + 0x0102000010200000L, 0x0102000010200001L, 0x0102000010200080L, 0x0102000010200081L, + 0x0102000010204000L, 0x0102000010204001L, 0x0102000010204080L, 0x0102000010204081L, + 0x0102000800000000L, 0x0102000800000001L, 0x0102000800000080L, 0x0102000800000081L, + 0x0102000800004000L, 0x0102000800004001L, 0x0102000800004080L, 0x0102000800004081L, + 0x0102000800200000L, 0x0102000800200001L, 0x0102000800200080L, 0x0102000800200081L, + 0x0102000800204000L, 0x0102000800204001L, 0x0102000800204080L, 0x0102000800204081L, + 0x0102000810000000L, 0x0102000810000001L, 0x0102000810000080L, 0x0102000810000081L, + 0x0102000810004000L, 0x0102000810004001L, 0x0102000810004080L, 0x0102000810004081L, + 0x0102000810200000L, 0x0102000810200001L, 0x0102000810200080L, 0x0102000810200081L, + 0x0102000810204000L, 0x0102000810204001L, 0x0102000810204080L, 0x0102000810204081L, + 0x0102040000000000L, 0x0102040000000001L, 0x0102040000000080L, 0x0102040000000081L, + 0x0102040000004000L, 0x0102040000004001L, 0x0102040000004080L, 0x0102040000004081L, + 0x0102040000200000L, 0x0102040000200001L, 0x0102040000200080L, 0x0102040000200081L, + 0x0102040000204000L, 0x0102040000204001L, 0x0102040000204080L, 0x0102040000204081L, + 0x0102040010000000L, 0x0102040010000001L, 0x0102040010000080L, 0x0102040010000081L, + 0x0102040010004000L, 0x0102040010004001L, 0x0102040010004080L, 0x0102040010004081L, + 0x0102040010200000L, 0x0102040010200001L, 0x0102040010200080L, 0x0102040010200081L, + 0x0102040010204000L, 0x0102040010204001L, 0x0102040010204080L, 0x0102040010204081L, + 0x0102040800000000L, 0x0102040800000001L, 0x0102040800000080L, 0x0102040800000081L, + 0x0102040800004000L, 0x0102040800004001L, 0x0102040800004080L, 0x0102040800004081L, + 0x0102040800200000L, 0x0102040800200001L, 0x0102040800200080L, 0x0102040800200081L, + 0x0102040800204000L, 0x0102040800204001L, 0x0102040800204080L, 0x0102040800204081L, + 0x0102040810000000L, 0x0102040810000001L, 0x0102040810000080L, 0x0102040810000081L, + 0x0102040810004000L, 0x0102040810004001L, 0x0102040810004080L, 0x0102040810004081L, + 0x0102040810200000L, 0x0102040810200001L, 0x0102040810200080L, 0x0102040810200081L, + 0x0102040810204000L, 0x0102040810204001L, 0x0102040810204080L, 0x0102040810204081L + }; + + // For toString(); must have length 64 + private const string ZEROES = "0000000000000000000000000000000000000000000000000000000000000000"; + + internal static readonly byte[] BitLengths = + { + 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 + }; + + // TODO make m fixed for the LongArray, and hence compute T once and for all + + private long[] m_ints; + + public LongArray(int intLen) + { + m_ints = new long[intLen]; + } + + public LongArray(long[] ints) + { + m_ints = ints; + } + + public LongArray(long[] ints, int off, int len) + { + if (off == 0 && len == ints.Length) + { + m_ints = ints; + } + else + { + m_ints = new long[len]; + Array.Copy(ints, off, m_ints, 0, len); + } + } + + public LongArray(BigInteger bigInt) + { + if (bigInt == null || bigInt.SignValue < 0) + { + throw new ArgumentException("invalid F2m field value", "bigInt"); + } + + if (bigInt.SignValue == 0) + { + m_ints = new long[] { 0L }; + return; + } + + byte[] barr = bigInt.ToByteArray(); + int barrLen = barr.Length; + int barrStart = 0; + if (barr[0] == 0) + { + // First byte is 0 to enforce highest (=sign) bit is zero. + // In this case ignore barr[0]. + barrLen--; + barrStart = 1; + } + int intLen = (barrLen + 7) / 8; + m_ints = new long[intLen]; + + int iarrJ = intLen - 1; + int rem = barrLen % 8 + barrStart; + long temp = 0; + int barrI = barrStart; + if (barrStart < rem) + { + for (; barrI < rem; barrI++) + { + temp <<= 8; + uint barrBarrI = barr[barrI]; + temp |= barrBarrI; + } + m_ints[iarrJ--] = temp; + } + + for (; iarrJ >= 0; iarrJ--) + { + temp = 0; + for (int i = 0; i < 8; i++) + { + temp <<= 8; + uint barrBarrI = barr[barrI++]; + temp |= barrBarrI; + } + m_ints[iarrJ] = temp; + } + } + + internal void CopyTo(long[] z, int zOff) + { + Array.Copy(m_ints, 0, z, zOff, m_ints.Length); + } + + public bool IsOne() + { + long[] a = m_ints; + if (a[0] != 1L) + { + return false; + } + for (int i = 1; i < a.Length; ++i) + { + if (a[i] != 0L) + { + return false; + } + } + return true; + } + + public bool IsZero() + { + long[] a = m_ints; + for (int i = 0; i < a.Length; ++i) + { + if (a[i] != 0L) + { + return false; + } + } + return true; + } + + public int GetUsedLength() + { + return GetUsedLengthFrom(m_ints.Length); + } + + public int GetUsedLengthFrom(int from) + { + long[] a = m_ints; + from = System.Math.Min(from, a.Length); + + if (from < 1) + { + return 0; + } + + // Check if first element will act as sentinel + if (a[0] != 0) + { + while (a[--from] == 0) + { + } + return from + 1; + } + + do + { + if (a[--from] != 0) + { + return from + 1; + } + } + while (from > 0); + + return 0; + } + + public int Degree() + { + int i = m_ints.Length; + long w; + do + { + if (i == 0) + { + return 0; + } + w = m_ints[--i]; + } + while (w == 0); + + return (i << 6) + BitLength(w); + } + + private int DegreeFrom(int limit) + { + int i = (int)(((uint)limit + 62) >> 6); + long w; + do + { + if (i == 0) + { + return 0; + } + w = m_ints[--i]; + } + while (w == 0); + + return (i << 6) + BitLength(w); + } + + // private int lowestCoefficient() + // { + // for (int i = 0; i < m_ints.Length; ++i) + // { + // long mi = m_ints[i]; + // if (mi != 0) + // { + // int j = 0; + // while ((mi & 0xFFL) == 0) + // { + // j += 8; + // mi >>>= 8; + // } + // while ((mi & 1L) == 0) + // { + // ++j; + // mi >>>= 1; + // } + // return (i << 6) + j; + // } + // } + // return -1; + // } + + private static int BitLength(long w) + { + int u = (int)((ulong)w >> 32), b; + if (u == 0) + { + u = (int)w; + b = 0; + } + else + { + b = 32; + } + + int t = (int)((uint)u >> 16), k; + if (t == 0) + { + t = (int)((uint)u >> 8); + k = (t == 0) ? BitLengths[u] : 8 + BitLengths[t]; + } + else + { + int v = (int)((uint)t >> 8); + k = (v == 0) ? 16 + BitLengths[t] : 24 + BitLengths[v]; + } + + return b + k; + } + + private long[] ResizedInts(int newLen) + { + long[] newInts = new long[newLen]; + Array.Copy(m_ints, 0, newInts, 0, System.Math.Min(m_ints.Length, newLen)); + return newInts; + } + + public BigInteger ToBigInteger() + { + int usedLen = GetUsedLength(); + if (usedLen == 0) + { + return BigInteger.Zero; + } + + long highestInt = m_ints[usedLen - 1]; + byte[] temp = new byte[8]; + int barrI = 0; + bool trailingZeroBytesDone = false; + for (int j = 7; j >= 0; j--) + { + byte thisByte = (byte)((ulong)highestInt >> (8 * j)); + if (trailingZeroBytesDone || (thisByte != 0)) + { + trailingZeroBytesDone = true; + temp[barrI++] = thisByte; + } + } + + int barrLen = 8 * (usedLen - 1) + barrI; + byte[] barr = new byte[barrLen]; + for (int j = 0; j < barrI; j++) + { + barr[j] = temp[j]; + } + // Highest value int is done now + + for (int iarrJ = usedLen - 2; iarrJ >= 0; iarrJ--) + { + long mi = m_ints[iarrJ]; + for (int j = 7; j >= 0; j--) + { + barr[barrI++] = (byte)((ulong)mi >> (8 * j)); + } + } + return new BigInteger(1, barr); + } + + // private static long shiftUp(long[] x, int xOff, int count) + // { + // long prev = 0; + // for (int i = 0; i < count; ++i) + // { + // long next = x[xOff + i]; + // x[xOff + i] = (next << 1) | prev; + // prev = next >>> 63; + // } + // return prev; + // } + + private static long ShiftUp(long[] x, int xOff, int count, int shift) + { + int shiftInv = 64 - shift; + long prev = 0; + for (int i = 0; i < count; ++i) + { + long next = x[xOff + i]; + x[xOff + i] = (next << shift) | prev; + prev = (long)((ulong)next >> shiftInv); + } + return prev; + } + + private static long ShiftUp(long[] x, int xOff, long[] z, int zOff, int count, int shift) + { + int shiftInv = 64 - shift; + long prev = 0; + for (int i = 0; i < count; ++i) + { + long next = x[xOff + i]; + z[zOff + i] = (next << shift) | prev; + prev = (long)((ulong)next >> shiftInv); + } + return prev; + } + + public LongArray AddOne() + { + if (m_ints.Length == 0) + { + return new LongArray(new long[]{ 1L }); + } + + int resultLen = System.Math.Max(1, GetUsedLength()); + long[] ints = ResizedInts(resultLen); + ints[0] ^= 1L; + return new LongArray(ints); + } + + // private void addShiftedByBits(LongArray other, int bits) + // { + // int words = bits >>> 6; + // int shift = bits & 0x3F; + // + // if (shift == 0) + // { + // addShiftedByWords(other, words); + // return; + // } + // + // int otherUsedLen = other.GetUsedLength(); + // if (otherUsedLen == 0) + // { + // return; + // } + // + // int minLen = otherUsedLen + words + 1; + // if (minLen > m_ints.Length) + // { + // m_ints = resizedInts(minLen); + // } + // + // long carry = addShiftedByBits(m_ints, words, other.m_ints, 0, otherUsedLen, shift); + // m_ints[otherUsedLen + words] ^= carry; + // } + + private void AddShiftedByBitsSafe(LongArray other, int otherDegree, int bits) + { + int otherLen = (int)((uint)(otherDegree + 63) >> 6); + + int words = (int)((uint)bits >> 6); + int shift = bits & 0x3F; + + if (shift == 0) + { + Add(m_ints, words, other.m_ints, 0, otherLen); + return; + } + + long carry = AddShiftedUp(m_ints, words, other.m_ints, 0, otherLen, shift); + if (carry != 0L) + { + m_ints[otherLen + words] ^= carry; + } + } + + private static long AddShiftedUp(long[] x, int xOff, long[] y, int yOff, int count, int shift) + { + int shiftInv = 64 - shift; + long prev = 0; + for (int i = 0; i < count; ++i) + { + long next = y[yOff + i]; + x[xOff + i] ^= (next << shift) | prev; + prev = (long)((ulong)next >> shiftInv); + } + return prev; + } + + private static long AddShiftedDown(long[] x, int xOff, long[] y, int yOff, int count, int shift) + { + int shiftInv = 64 - shift; + long prev = 0; + int i = count; + while (--i >= 0) + { + long next = y[yOff + i]; + x[xOff + i] ^= (long)((ulong)next >> shift) | prev; + prev = next << shiftInv; + } + return prev; + } + + public void AddShiftedByWords(LongArray other, int words) + { + int otherUsedLen = other.GetUsedLength(); + if (otherUsedLen == 0) + { + return; + } + + int minLen = otherUsedLen + words; + if (minLen > m_ints.Length) + { + m_ints = ResizedInts(minLen); + } + + Add(m_ints, words, other.m_ints, 0, otherUsedLen); + } + + private static void Add(long[] x, int xOff, long[] y, int yOff, int count) + { + for (int i = 0; i < count; ++i) + { + x[xOff + i] ^= y[yOff + i]; + } + } + + private static void Add(long[] x, int xOff, long[] y, int yOff, long[] z, int zOff, int count) + { + for (int i = 0; i < count; ++i) + { + z[zOff + i] = x[xOff + i] ^ y[yOff + i]; + } + } + + private static void AddBoth(long[] x, int xOff, long[] y1, int y1Off, long[] y2, int y2Off, int count) + { + for (int i = 0; i < count; ++i) + { + x[xOff + i] ^= y1[y1Off + i] ^ y2[y2Off + i]; + } + } + + private static void Distribute(long[] x, int src, int dst1, int dst2, int count) + { + for (int i = 0; i < count; ++i) + { + long v = x[src + i]; + x[dst1 + i] ^= v; + x[dst2 + i] ^= v; + } + } + + public int Length + { + get { return m_ints.Length; } + } + + private static void FlipWord(long[] buf, int off, int bit, long word) + { + int n = off + (int)((uint)bit >> 6); + int shift = bit & 0x3F; + if (shift == 0) + { + buf[n] ^= word; + } + else + { + buf[n] ^= word << shift; + word = (long)((ulong)word >> (64 - shift)); + if (word != 0) + { + buf[++n] ^= word; + } + } + } + + // private static long getWord(long[] buf, int off, int len, int bit) + // { + // int n = off + (bit >>> 6); + // int shift = bit & 0x3F; + // if (shift == 0) + // { + // return buf[n]; + // } + // long result = buf[n] >>> shift; + // if (++n < len) + // { + // result |= buf[n] << (64 - shift); + // } + // return result; + // } + + public bool TestBitZero() + { + return m_ints.Length > 0 && (m_ints[0] & 1L) != 0; + } + + private static bool TestBit(long[] buf, int off, int n) + { + // theInt = n / 64 + int theInt = (int)((uint)n >> 6); + // theBit = n % 64 + int theBit = n & 0x3F; + long tester = 1L << theBit; + return (buf[off + theInt] & tester) != 0; + } + + private static void FlipBit(long[] buf, int off, int n) + { + // theInt = n / 64 + int theInt = (int)((uint)n >> 6); + // theBit = n % 64 + int theBit = n & 0x3F; + long flipper = 1L << theBit; + buf[off + theInt] ^= flipper; + } + + // private static void SetBit(long[] buf, int off, int n) + // { + // // theInt = n / 64 + // int theInt = n >>> 6; + // // theBit = n % 64 + // int theBit = n & 0x3F; + // long setter = 1L << theBit; + // buf[off + theInt] |= setter; + // } + // + // private static void ClearBit(long[] buf, int off, int n) + // { + // // theInt = n / 64 + // int theInt = n >>> 6; + // // theBit = n % 64 + // int theBit = n & 0x3F; + // long setter = 1L << theBit; + // buf[off + theInt] &= ~setter; + // } + + private static void MultiplyWord(long a, long[] b, int bLen, long[] c, int cOff) + { + if ((a & 1L) != 0L) + { + Add(c, cOff, b, 0, bLen); + } + int k = 1; + while ((a = (long)((ulong)a >> 1)) != 0L) + { + if ((a & 1L) != 0L) + { + long carry = AddShiftedUp(c, cOff, b, 0, bLen, k); + if (carry != 0L) + { + c[cOff + bLen] ^= carry; + } + } + ++k; + } + } + + public LongArray ModMultiplyLD(LongArray other, int m, int[] ks) + { + /* + * Find out the degree of each argument and handle the zero cases + */ + int aDeg = Degree(); + if (aDeg == 0) + { + return this; + } + int bDeg = other.Degree(); + if (bDeg == 0) + { + return other; + } + + /* + * Swap if necessary so that A is the smaller argument + */ + LongArray A = this, B = other; + if (aDeg > bDeg) + { + A = other; B = this; + int tmp = aDeg; aDeg = bDeg; bDeg = tmp; + } + + /* + * Establish the word lengths of the arguments and result + */ + int aLen = (int)((uint)(aDeg + 63) >> 6); + int bLen = (int)((uint)(bDeg + 63) >> 6); + int cLen = (int)((uint)(aDeg + bDeg + 62) >> 6); + + if (aLen == 1) + { + long a0 = A.m_ints[0]; + if (a0 == 1L) + { + return B; + } + + /* + * Fast path for small A, with performance dependent only on the number of set bits + */ + long[] c0 = new long[cLen]; + MultiplyWord(a0, B.m_ints, bLen, c0, 0); + + /* + * Reduce the raw answer against the reduction coefficients + */ + return ReduceResult(c0, 0, cLen, m, ks); + } + + /* + * Determine if B will get bigger during shifting + */ + int bMax = (int)((uint)(bDeg + 7 + 63) >> 6); + + /* + * Lookup table for the offset of each B in the tables + */ + int[] ti = new int[16]; + + /* + * Precompute table of all 4-bit products of B + */ + long[] T0 = new long[bMax << 4]; + int tOff = bMax; + ti[1] = tOff; + Array.Copy(B.m_ints, 0, T0, tOff, bLen); + for (int i = 2; i < 16; ++i) + { + ti[i] = (tOff += bMax); + if ((i & 1) == 0) + { + ShiftUp(T0, (int)((uint)tOff >> 1), T0, tOff, bMax, 1); + } + else + { + Add(T0, bMax, T0, tOff - bMax, T0, tOff, bMax); + } + } + + /* + * Second table with all 4-bit products of B shifted 4 bits + */ + long[] T1 = new long[T0.Length]; + ShiftUp(T0, 0, T1, 0, T0.Length, 4); + // shiftUp(T0, bMax, T1, bMax, tOff, 4); + + long[] a = A.m_ints; + long[] c = new long[cLen]; + + int MASK = 0xF; + + /* + * Lopez-Dahab algorithm + */ + + for (int k = 56; k >= 0; k -= 8) + { + for (int j = 1; j < aLen; j += 2) + { + int aVal = (int)((ulong)a[j] >> k); + int u = aVal & MASK; + int v = (int)((uint)aVal >> 4) & MASK; + AddBoth(c, j - 1, T0, ti[u], T1, ti[v], bMax); + } + ShiftUp(c, 0, cLen, 8); + } + + for (int k = 56; k >= 0; k -= 8) + { + for (int j = 0; j < aLen; j += 2) + { + int aVal = (int)((ulong)a[j] >> k); + int u = aVal & MASK; + int v = (int)((uint)aVal >> 4) & MASK; + AddBoth(c, j, T0, ti[u], T1, ti[v], bMax); + } + if (k > 0) + { + ShiftUp(c, 0, cLen, 8); + } + } + + /* + * Finally the raw answer is collected, reduce it against the reduction coefficients + */ + return ReduceResult(c, 0, cLen, m, ks); + } + + public LongArray ModMultiply(LongArray other, int m, int[] ks) + { + /* + * Find out the degree of each argument and handle the zero cases + */ + int aDeg = Degree(); + if (aDeg == 0) + { + return this; + } + int bDeg = other.Degree(); + if (bDeg == 0) + { + return other; + } + + /* + * Swap if necessary so that A is the smaller argument + */ + LongArray A = this, B = other; + if (aDeg > bDeg) + { + A = other; B = this; + int tmp = aDeg; aDeg = bDeg; bDeg = tmp; + } + + /* + * Establish the word lengths of the arguments and result + */ + int aLen = (int)((uint)(aDeg + 63) >> 6); + int bLen = (int)((uint)(bDeg + 63) >> 6); + int cLen = (int)((uint)(aDeg + bDeg + 62) >> 6); + + if (aLen == 1) + { + long a0 = A.m_ints[0]; + if (a0 == 1L) + { + return B; + } + + /* + * Fast path for small A, with performance dependent only on the number of set bits + */ + long[] c0 = new long[cLen]; + MultiplyWord(a0, B.m_ints, bLen, c0, 0); + + /* + * Reduce the raw answer against the reduction coefficients + */ + return ReduceResult(c0, 0, cLen, m, ks); + } + + /* + * Determine if B will get bigger during shifting + */ + int bMax = (int)((uint)(bDeg + 7 + 63) >> 6); + + /* + * Lookup table for the offset of each B in the tables + */ + int[] ti = new int[16]; + + /* + * Precompute table of all 4-bit products of B + */ + long[] T0 = new long[bMax << 4]; + int tOff = bMax; + ti[1] = tOff; + Array.Copy(B.m_ints, 0, T0, tOff, bLen); + for (int i = 2; i < 16; ++i) + { + ti[i] = (tOff += bMax); + if ((i & 1) == 0) + { + ShiftUp(T0, (int)((uint)tOff >> 1), T0, tOff, bMax, 1); + } + else + { + Add(T0, bMax, T0, tOff - bMax, T0, tOff, bMax); + } + } + + /* + * Second table with all 4-bit products of B shifted 4 bits + */ + long[] T1 = new long[T0.Length]; + ShiftUp(T0, 0, T1, 0, T0.Length, 4); + // ShiftUp(T0, bMax, T1, bMax, tOff, 4); + + long[] a = A.m_ints; + long[] c = new long[cLen << 3]; + + int MASK = 0xF; + + /* + * Lopez-Dahab (Modified) algorithm + */ + + for (int aPos = 0; aPos < aLen; ++aPos) + { + long aVal = a[aPos]; + int cOff = aPos; + for (;;) + { + int u = (int)aVal & MASK; + aVal = (long)((ulong)aVal >> 4); + int v = (int)aVal & MASK; + AddBoth(c, cOff, T0, ti[u], T1, ti[v], bMax); + aVal = (long)((ulong)aVal >> 4); + if (aVal == 0L) + { + break; + } + cOff += cLen; + } + } + + { + int cOff = c.Length; + while ((cOff -= cLen) != 0) + { + AddShiftedUp(c, cOff - cLen, c, cOff, cLen, 8); + } + } + + /* + * Finally the raw answer is collected, reduce it against the reduction coefficients + */ + return ReduceResult(c, 0, cLen, m, ks); + } + + public LongArray ModMultiplyAlt(LongArray other, int m, int[] ks) + { + /* + * Find out the degree of each argument and handle the zero cases + */ + int aDeg = Degree(); + if (aDeg == 0) + { + return this; + } + int bDeg = other.Degree(); + if (bDeg == 0) + { + return other; + } + + /* + * Swap if necessary so that A is the smaller argument + */ + LongArray A = this, B = other; + if (aDeg > bDeg) + { + A = other; B = this; + int tmp = aDeg; aDeg = bDeg; bDeg = tmp; + } + + /* + * Establish the word lengths of the arguments and result + */ + int aLen = (int)((uint)(aDeg + 63) >> 6); + int bLen = (int)((uint)(bDeg + 63) >> 6); + int cLen = (int)((uint)(aDeg + bDeg + 62) >> 6); + + if (aLen == 1) + { + long a0 = A.m_ints[0]; + if (a0 == 1L) + { + return B; + } + + /* + * Fast path for small A, with performance dependent only on the number of set bits + */ + long[] c0 = new long[cLen]; + MultiplyWord(a0, B.m_ints, bLen, c0, 0); + + /* + * Reduce the raw answer against the reduction coefficients + */ + return ReduceResult(c0, 0, cLen, m, ks); + } + + // NOTE: This works, but is slower than width 4 processing + // if (aLen == 2) + // { + // /* + // * Use common-multiplicand optimization to save ~1/4 of the adds + // */ + // long a1 = A.m_ints[0], a2 = A.m_ints[1]; + // long aa = a1 & a2; a1 ^= aa; a2 ^= aa; + // + // long[] b = B.m_ints; + // long[] c = new long[cLen]; + // multiplyWord(aa, b, bLen, c, 1); + // add(c, 0, c, 1, cLen - 1); + // multiplyWord(a1, b, bLen, c, 0); + // multiplyWord(a2, b, bLen, c, 1); + // + // /* + // * Reduce the raw answer against the reduction coefficients + // */ + // return ReduceResult(c, 0, cLen, m, ks); + // } + + /* + * Determine the parameters of the Interleaved window algorithm: the 'width' in bits to + * process together, the number of evaluation 'positions' implied by that width, and the + * 'top' position at which the regular window algorithm stops. + */ + int width, positions, top, banks; + + // NOTE: width 4 is the fastest over the entire range of sizes used in current crypto + // width = 1; positions = 64; top = 64; banks = 4; + // width = 2; positions = 32; top = 64; banks = 4; + // width = 3; positions = 21; top = 63; banks = 3; + width = 4; positions = 16; top = 64; banks = 8; + // width = 5; positions = 13; top = 65; banks = 7; + // width = 7; positions = 9; top = 63; banks = 9; + // width = 8; positions = 8; top = 64; banks = 8; + + /* + * Determine if B will get bigger during shifting + */ + int shifts = top < 64 ? positions : positions - 1; + int bMax = (int)((uint)(bDeg + shifts + 63) >> 6); + + int bTotal = bMax * banks, stride = width * banks; + + /* + * Create a single temporary buffer, with an offset table to find the positions of things in it + */ + int[] ci = new int[1 << width]; + int cTotal = aLen; + { + ci[0] = cTotal; + cTotal += bTotal; + ci[1] = cTotal; + for (int i = 2; i < ci.Length; ++i) + { + cTotal += cLen; + ci[i] = cTotal; + } + cTotal += cLen; + } + // NOTE: Provide a safe dump for "high zeroes" since we are adding 'bMax' and not 'bLen' + ++cTotal; + + long[] c = new long[cTotal]; + + // Prepare A in Interleaved form, according to the chosen width + Interleave(A.m_ints, 0, c, 0, aLen, width); + + // Make a working copy of B, since we will be shifting it + { + int bOff = aLen; + Array.Copy(B.m_ints, 0, c, bOff, bLen); + for (int bank = 1; bank < banks; ++bank) + { + ShiftUp(c, aLen, c, bOff += bMax, bMax, bank); + } + } + + /* + * The main loop analyzes the Interleaved windows in A, and for each non-zero window + * a single word-array XOR is performed to a carefully selected slice of 'c'. The loop is + * breadth-first, checking the lowest window in each word, then looping again for the + * next higher window position. + */ + int MASK = (1 << width) - 1; + + int k = 0; + for (;;) + { + int aPos = 0; + do + { + long aVal = (long)((ulong)c[aPos] >> k); + int bank = 0, bOff = aLen; + for (;;) + { + int index = (int)(aVal) & MASK; + if (index != 0) + { + /* + * Add to a 'c' buffer based on the bit-pattern of 'index'. Since A is in + * Interleaved form, the bits represent the current B shifted by 0, 'positions', + * 'positions' * 2, ..., 'positions' * ('width' - 1) + */ + Add(c, aPos + ci[index], c, bOff, bMax); + } + if (++bank == banks) + { + break; + } + bOff += bMax; + aVal = (long)((ulong)aVal >> width); + } + } + while (++aPos < aLen); + + if ((k += stride) >= top) + { + if (k >= 64) + { + break; + } + + /* + * Adjustment for window setups with top == 63, the final bit (if any) is processed + * as the top-bit of a window + */ + k = 64 - width; + MASK &= MASK << (top - k); + } + + /* + * After each position has been checked for all words of A, B is shifted up 1 place + */ + ShiftUp(c, aLen, bTotal, banks); + } + + int ciPos = ci.Length; + while (--ciPos > 1) + { + if ((ciPos & 1L) == 0L) + { + /* + * For even numbers, shift contents and add to the half-position + */ + AddShiftedUp(c, ci[(uint)ciPos >> 1], c, ci[ciPos], cLen, positions); + } + else + { + /* + * For odd numbers, 'distribute' contents to the result and the next-lowest position + */ + Distribute(c, ci[ciPos], ci[ciPos - 1], ci[1], cLen); + } + } + + /* + * Finally the raw answer is collected, reduce it against the reduction coefficients + */ + return ReduceResult(c, ci[1], cLen, m, ks); + } + + public LongArray ModReduce(int m, int[] ks) + { + long[] buf = Arrays.Clone(m_ints); + int rLen = ReduceInPlace(buf, 0, buf.Length, m, ks); + return new LongArray(buf, 0, rLen); + } + + public LongArray Multiply(LongArray other, int m, int[] ks) + { + /* + * Find out the degree of each argument and handle the zero cases + */ + int aDeg = Degree(); + if (aDeg == 0) + { + return this; + } + int bDeg = other.Degree(); + if (bDeg == 0) + { + return other; + } + + /* + * Swap if necessary so that A is the smaller argument + */ + LongArray A = this, B = other; + if (aDeg > bDeg) + { + A = other; B = this; + int tmp = aDeg; aDeg = bDeg; bDeg = tmp; + } + + /* + * Establish the word lengths of the arguments and result + */ + int aLen = (int)((uint)(aDeg + 63) >> 6); + int bLen = (int)((uint)(bDeg + 63) >> 6); + int cLen = (int)((uint)(aDeg + bDeg + 62) >> 6); + + if (aLen == 1) + { + long a0 = A.m_ints[0]; + if (a0 == 1L) + { + return B; + } + + /* + * Fast path for small A, with performance dependent only on the number of set bits + */ + long[] c0 = new long[cLen]; + MultiplyWord(a0, B.m_ints, bLen, c0, 0); + + /* + * Reduce the raw answer against the reduction coefficients + */ + //return ReduceResult(c0, 0, cLen, m, ks); + return new LongArray(c0, 0, cLen); + } + + /* + * Determine if B will get bigger during shifting + */ + int bMax = (int)((uint)(bDeg + 7 + 63) >> 6); + + /* + * Lookup table for the offset of each B in the tables + */ + int[] ti = new int[16]; + + /* + * Precompute table of all 4-bit products of B + */ + long[] T0 = new long[bMax << 4]; + int tOff = bMax; + ti[1] = tOff; + Array.Copy(B.m_ints, 0, T0, tOff, bLen); + for (int i = 2; i < 16; ++i) + { + ti[i] = (tOff += bMax); + if ((i & 1) == 0) + { + ShiftUp(T0, (int)((uint)tOff >> 1), T0, tOff, bMax, 1); + } + else + { + Add(T0, bMax, T0, tOff - bMax, T0, tOff, bMax); + } + } + + /* + * Second table with all 4-bit products of B shifted 4 bits + */ + long[] T1 = new long[T0.Length]; + ShiftUp(T0, 0, T1, 0, T0.Length, 4); + // ShiftUp(T0, bMax, T1, bMax, tOff, 4); + + long[] a = A.m_ints; + long[] c = new long[cLen << 3]; + + int MASK = 0xF; + + /* + * Lopez-Dahab (Modified) algorithm + */ + + for (int aPos = 0; aPos < aLen; ++aPos) + { + long aVal = a[aPos]; + int cOff = aPos; + for (; ; ) + { + int u = (int)aVal & MASK; + aVal = (long)((ulong)aVal >> 4); + int v = (int)aVal & MASK; + AddBoth(c, cOff, T0, ti[u], T1, ti[v], bMax); + aVal = (long)((ulong)aVal >> 4); + if (aVal == 0L) + { + break; + } + cOff += cLen; + } + } + + { + int cOff = c.Length; + while ((cOff -= cLen) != 0) + { + AddShiftedUp(c, cOff - cLen, c, cOff, cLen, 8); + } + } + + /* + * Finally the raw answer is collected, reduce it against the reduction coefficients + */ + //return ReduceResult(c, 0, cLen, m, ks); + return new LongArray(c, 0, cLen); + } + + public void Reduce(int m, int[] ks) + { + long[] buf = m_ints; + int rLen = ReduceInPlace(buf, 0, buf.Length, m, ks); + if (rLen < buf.Length) + { + m_ints = new long[rLen]; + Array.Copy(buf, 0, m_ints, 0, rLen); + } + } + + private static LongArray ReduceResult(long[] buf, int off, int len, int m, int[] ks) + { + int rLen = ReduceInPlace(buf, off, len, m, ks); + return new LongArray(buf, off, rLen); + } + + // private static void deInterleave(long[] x, int xOff, long[] z, int zOff, int count, int rounds) + // { + // for (int i = 0; i < count; ++i) + // { + // z[zOff + i] = deInterleave(x[zOff + i], rounds); + // } + // } + // + // private static long deInterleave(long x, int rounds) + // { + // while (--rounds >= 0) + // { + // x = deInterleave32(x & DEInterleave_MASK) | (deInterleave32((x >>> 1) & DEInterleave_MASK) << 32); + // } + // return x; + // } + // + // private static long deInterleave32(long x) + // { + // x = (x | (x >>> 1)) & 0x3333333333333333L; + // x = (x | (x >>> 2)) & 0x0F0F0F0F0F0F0F0FL; + // x = (x | (x >>> 4)) & 0x00FF00FF00FF00FFL; + // x = (x | (x >>> 8)) & 0x0000FFFF0000FFFFL; + // x = (x | (x >>> 16)) & 0x00000000FFFFFFFFL; + // return x; + // } + + private static int ReduceInPlace(long[] buf, int off, int len, int m, int[] ks) + { + int mLen = (m + 63) >> 6; + if (len < mLen) + { + return len; + } + + int numBits = System.Math.Min(len << 6, (m << 1) - 1); // TODO use actual degree? + int excessBits = (len << 6) - numBits; + while (excessBits >= 64) + { + --len; + excessBits -= 64; + } + + int kLen = ks.Length, kMax = ks[kLen - 1], kNext = kLen > 1 ? ks[kLen - 2] : 0; + int wordWiseLimit = System.Math.Max(m, kMax + 64); + int vectorableWords = (excessBits + System.Math.Min(numBits - wordWiseLimit, m - kNext)) >> 6; + if (vectorableWords > 1) + { + int vectorWiseWords = len - vectorableWords; + ReduceVectorWise(buf, off, len, vectorWiseWords, m, ks); + while (len > vectorWiseWords) + { + buf[off + --len] = 0L; + } + numBits = vectorWiseWords << 6; + } + + if (numBits > wordWiseLimit) + { + ReduceWordWise(buf, off, len, wordWiseLimit, m, ks); + numBits = wordWiseLimit; + } + + if (numBits > m) + { + ReduceBitWise(buf, off, numBits, m, ks); + } + + return mLen; + } + + private static void ReduceBitWise(long[] buf, int off, int BitLength, int m, int[] ks) + { + while (--BitLength >= m) + { + if (TestBit(buf, off, BitLength)) + { + ReduceBit(buf, off, BitLength, m, ks); + } + } + } + + private static void ReduceBit(long[] buf, int off, int bit, int m, int[] ks) + { + FlipBit(buf, off, bit); + int n = bit - m; + int j = ks.Length; + while (--j >= 0) + { + FlipBit(buf, off, ks[j] + n); + } + FlipBit(buf, off, n); + } + + private static void ReduceWordWise(long[] buf, int off, int len, int toBit, int m, int[] ks) + { + int toPos = (int)((uint)toBit >> 6); + + while (--len > toPos) + { + long word = buf[off + len]; + if (word != 0) + { + buf[off + len] = 0; + ReduceWord(buf, off, (len << 6), word, m, ks); + } + } + + { + int partial = toBit & 0x3F; + long word = (long)((ulong)buf[off + toPos] >> partial); + if (word != 0) + { + buf[off + toPos] ^= word << partial; + ReduceWord(buf, off, toBit, word, m, ks); + } + } + } + + private static void ReduceWord(long[] buf, int off, int bit, long word, int m, int[] ks) + { + int offset = bit - m; + int j = ks.Length; + while (--j >= 0) + { + FlipWord(buf, off, offset + ks[j], word); + } + FlipWord(buf, off, offset, word); + } + + private static void ReduceVectorWise(long[] buf, int off, int len, int words, int m, int[] ks) + { + /* + * NOTE: It's important we go from highest coefficient to lowest, because for the highest + * one (only) we allow the ranges to partially overlap, and therefore any changes must take + * effect for the subsequent lower coefficients. + */ + int baseBit = (words << 6) - m; + int j = ks.Length; + while (--j >= 0) + { + FlipVector(buf, off, buf, off + words, len - words, baseBit + ks[j]); + } + FlipVector(buf, off, buf, off + words, len - words, baseBit); + } + + private static void FlipVector(long[] x, int xOff, long[] y, int yOff, int yLen, int bits) + { + xOff += (int)((uint)bits >> 6); + bits &= 0x3F; + + if (bits == 0) + { + Add(x, xOff, y, yOff, yLen); + } + else + { + long carry = AddShiftedDown(x, xOff + 1, y, yOff, yLen, 64 - bits); + x[xOff] ^= carry; + } + } + + public LongArray ModSquare(int m, int[] ks) + { + int len = GetUsedLength(); + if (len == 0) + { + return this; + } + + int _2len = len << 1; + long[] r = new long[_2len]; + + int pos = 0; + while (pos < _2len) + { + long mi = m_ints[(uint)pos >> 1]; + r[pos++] = Interleave2_32to64((int)mi); + r[pos++] = Interleave2_32to64((int)((ulong)mi >> 32)); + } + + return new LongArray(r, 0, ReduceInPlace(r, 0, r.Length, m, ks)); + } + + public LongArray ModSquareN(int n, int m, int[] ks) + { + int len = GetUsedLength(); + if (len == 0) + { + return this; + } + + int mLen = (m + 63) >> 6; + long[] r = new long[mLen << 1]; + Array.Copy(m_ints, 0, r, 0, len); + + while (--n >= 0) + { + SquareInPlace(r, len, m, ks); + len = ReduceInPlace(r, 0, r.Length, m, ks); + } + + return new LongArray(r, 0, len); + } + + public LongArray Square(int m, int[] ks) + { + int len = GetUsedLength(); + if (len == 0) + { + return this; + } + + int _2len = len << 1; + long[] r = new long[_2len]; + + int pos = 0; + while (pos < _2len) + { + long mi = m_ints[(uint)pos >> 1]; + r[pos++] = Interleave2_32to64((int)mi); + r[pos++] = Interleave2_32to64((int)((ulong)mi >> 32)); + } + + return new LongArray(r, 0, r.Length); + } + + private static void SquareInPlace(long[] x, int xLen, int m, int[] ks) + { + int pos = xLen << 1; + while (--xLen >= 0) + { + long xVal = x[xLen]; + x[--pos] = Interleave2_32to64((int)((ulong)xVal >> 32)); + x[--pos] = Interleave2_32to64((int)xVal); + } + } + + private static void Interleave(long[] x, int xOff, long[] z, int zOff, int count, int width) + { + switch (width) + { + case 3: + Interleave3(x, xOff, z, zOff, count); + break; + case 5: + Interleave5(x, xOff, z, zOff, count); + break; + case 7: + Interleave7(x, xOff, z, zOff, count); + break; + default: + Interleave2_n(x, xOff, z, zOff, count, BitLengths[width] - 1); + break; + } + } + + private static void Interleave3(long[] x, int xOff, long[] z, int zOff, int count) + { + for (int i = 0; i < count; ++i) + { + z[zOff + i] = Interleave3(x[xOff + i]); + } + } + + private static long Interleave3(long x) + { + long z = x & (1L << 63); + return z + | Interleave3_21to63((int)x & 0x1FFFFF) + | Interleave3_21to63((int)((ulong)x >> 21) & 0x1FFFFF) << 1 + | Interleave3_21to63((int)((ulong)x >> 42) & 0x1FFFFF) << 2; + + // int zPos = 0, wPos = 0, xPos = 0; + // for (;;) + // { + // z |= ((x >>> xPos) & 1L) << zPos; + // if (++zPos == 63) + // { + // String sz2 = Long.toBinaryString(z); + // return z; + // } + // if ((xPos += 21) >= 63) + // { + // xPos = ++wPos; + // } + // } + } + + private static long Interleave3_21to63(int x) + { + int r00 = INTERLEAVE3_TABLE[x & 0x7F]; + int r21 = INTERLEAVE3_TABLE[((uint)x >> 7) & 0x7F]; + int r42 = INTERLEAVE3_TABLE[(uint)x >> 14]; + return (r42 & 0xFFFFFFFFL) << 42 | (r21 & 0xFFFFFFFFL) << 21 | (r00 & 0xFFFFFFFFL); + } + + private static void Interleave5(long[] x, int xOff, long[] z, int zOff, int count) + { + for (int i = 0; i < count; ++i) + { + z[zOff + i] = Interleave5(x[xOff + i]); + } + } + + private static long Interleave5(long x) + { + return Interleave3_13to65((int)x & 0x1FFF) + | Interleave3_13to65((int)((ulong)x >> 13) & 0x1FFF) << 1 + | Interleave3_13to65((int)((ulong)x >> 26) & 0x1FFF) << 2 + | Interleave3_13to65((int)((ulong)x >> 39) & 0x1FFF) << 3 + | Interleave3_13to65((int)((ulong)x >> 52) & 0x1FFF) << 4; + + // long z = 0; + // int zPos = 0, wPos = 0, xPos = 0; + // for (;;) + // { + // z |= ((x >>> xPos) & 1L) << zPos; + // if (++zPos == 64) + // { + // return z; + // } + // if ((xPos += 13) >= 64) + // { + // xPos = ++wPos; + // } + // } + } + + private static long Interleave3_13to65(int x) + { + int r00 = INTERLEAVE5_TABLE[x & 0x7F]; + int r35 = INTERLEAVE5_TABLE[(uint)x >> 7]; + return (r35 & 0xFFFFFFFFL) << 35 | (r00 & 0xFFFFFFFFL); + } + + private static void Interleave7(long[] x, int xOff, long[] z, int zOff, int count) + { + for (int i = 0; i < count; ++i) + { + z[zOff + i] = Interleave7(x[xOff + i]); + } + } + + private static long Interleave7(long x) + { + long z = x & (1L << 63); + return z + | INTERLEAVE7_TABLE[(int)x & 0x1FF] + | INTERLEAVE7_TABLE[(int)((ulong)x >> 9) & 0x1FF] << 1 + | INTERLEAVE7_TABLE[(int)((ulong)x >> 18) & 0x1FF] << 2 + | INTERLEAVE7_TABLE[(int)((ulong)x >> 27) & 0x1FF] << 3 + | INTERLEAVE7_TABLE[(int)((ulong)x >> 36) & 0x1FF] << 4 + | INTERLEAVE7_TABLE[(int)((ulong)x >> 45) & 0x1FF] << 5 + | INTERLEAVE7_TABLE[(int)((ulong)x >> 54) & 0x1FF] << 6; + + // int zPos = 0, wPos = 0, xPos = 0; + // for (;;) + // { + // z |= ((x >>> xPos) & 1L) << zPos; + // if (++zPos == 63) + // { + // return z; + // } + // if ((xPos += 9) >= 63) + // { + // xPos = ++wPos; + // } + // } + } + + private static void Interleave2_n(long[] x, int xOff, long[] z, int zOff, int count, int rounds) + { + for (int i = 0; i < count; ++i) + { + z[zOff + i] = Interleave2_n(x[xOff + i], rounds); + } + } + + private static long Interleave2_n(long x, int rounds) + { + while (rounds > 1) + { + rounds -= 2; + x = Interleave4_16to64((int)x & 0xFFFF) + | Interleave4_16to64((int)((ulong)x >> 16) & 0xFFFF) << 1 + | Interleave4_16to64((int)((ulong)x >> 32) & 0xFFFF) << 2 + | Interleave4_16to64((int)((ulong)x >> 48) & 0xFFFF) << 3; + } + if (rounds > 0) + { + x = Interleave2_32to64((int)x) | Interleave2_32to64((int)((ulong)x >> 32)) << 1; + } + return x; + } + + private static long Interleave4_16to64(int x) + { + int r00 = INTERLEAVE4_TABLE[x & 0xFF]; + int r32 = INTERLEAVE4_TABLE[(uint)x >> 8]; + return (r32 & 0xFFFFFFFFL) << 32 | (r00 & 0xFFFFFFFFL); + } + + private static long Interleave2_32to64(int x) + { + int r00 = INTERLEAVE2_TABLE[x & 0xFF] | INTERLEAVE2_TABLE[((uint)x >> 8) & 0xFF] << 16; + int r32 = INTERLEAVE2_TABLE[((uint)x >> 16) & 0xFF] | INTERLEAVE2_TABLE[(uint)x >> 24] << 16; + return (r32 & 0xFFFFFFFFL) << 32 | (r00 & 0xFFFFFFFFL); + } + + // private static LongArray ExpItohTsujii2(LongArray B, int n, int m, int[] ks) + // { + // LongArray t1 = B, t3 = new LongArray(new long[]{ 1L }); + // int scale = 1; + // + // int numTerms = n; + // while (numTerms > 1) + // { + // if ((numTerms & 1) != 0) + // { + // t3 = t3.ModMultiply(t1, m, ks); + // t1 = t1.modSquareN(scale, m, ks); + // } + // + // LongArray t2 = t1.modSquareN(scale, m, ks); + // t1 = t1.ModMultiply(t2, m, ks); + // numTerms >>>= 1; scale <<= 1; + // } + // + // return t3.ModMultiply(t1, m, ks); + // } + // + // private static LongArray ExpItohTsujii23(LongArray B, int n, int m, int[] ks) + // { + // LongArray t1 = B, t3 = new LongArray(new long[]{ 1L }); + // int scale = 1; + // + // int numTerms = n; + // while (numTerms > 1) + // { + // bool m03 = numTerms % 3 == 0; + // bool m14 = !m03 && (numTerms & 1) != 0; + // + // if (m14) + // { + // t3 = t3.ModMultiply(t1, m, ks); + // t1 = t1.modSquareN(scale, m, ks); + // } + // + // LongArray t2 = t1.modSquareN(scale, m, ks); + // t1 = t1.ModMultiply(t2, m, ks); + // + // if (m03) + // { + // t2 = t2.modSquareN(scale, m, ks); + // t1 = t1.ModMultiply(t2, m, ks); + // numTerms /= 3; scale *= 3; + // } + // else + // { + // numTerms >>>= 1; scale <<= 1; + // } + // } + // + // return t3.ModMultiply(t1, m, ks); + // } + // + // private static LongArray ExpItohTsujii235(LongArray B, int n, int m, int[] ks) + // { + // LongArray t1 = B, t4 = new LongArray(new long[]{ 1L }); + // int scale = 1; + // + // int numTerms = n; + // while (numTerms > 1) + // { + // if (numTerms % 5 == 0) + // { + //// t1 = ExpItohTsujii23(t1, 5, m, ks); + // + // LongArray t3 = t1; + // t1 = t1.modSquareN(scale, m, ks); + // + // LongArray t2 = t1.modSquareN(scale, m, ks); + // t1 = t1.ModMultiply(t2, m, ks); + // t2 = t1.modSquareN(scale << 1, m, ks); + // t1 = t1.ModMultiply(t2, m, ks); + // + // t1 = t1.ModMultiply(t3, m, ks); + // + // numTerms /= 5; scale *= 5; + // continue; + // } + // + // bool m03 = numTerms % 3 == 0; + // bool m14 = !m03 && (numTerms & 1) != 0; + // + // if (m14) + // { + // t4 = t4.ModMultiply(t1, m, ks); + // t1 = t1.modSquareN(scale, m, ks); + // } + // + // LongArray t2 = t1.modSquareN(scale, m, ks); + // t1 = t1.ModMultiply(t2, m, ks); + // + // if (m03) + // { + // t2 = t2.modSquareN(scale, m, ks); + // t1 = t1.ModMultiply(t2, m, ks); + // numTerms /= 3; scale *= 3; + // } + // else + // { + // numTerms >>>= 1; scale <<= 1; + // } + // } + // + // return t4.ModMultiply(t1, m, ks); + // } + + public LongArray ModInverse(int m, int[] ks) + { + /* + * Fermat's Little Theorem + */ + // LongArray A = this; + // LongArray B = A.modSquare(m, ks); + // LongArray R0 = B, R1 = B; + // for (int i = 2; i < m; ++i) + // { + // R1 = R1.modSquare(m, ks); + // R0 = R0.ModMultiply(R1, m, ks); + // } + // + // return R0; + + /* + * Itoh-Tsujii + */ + // LongArray B = modSquare(m, ks); + // switch (m) + // { + // case 409: + // return ExpItohTsujii23(B, m - 1, m, ks); + // case 571: + // return ExpItohTsujii235(B, m - 1, m, ks); + // case 163: + // case 233: + // case 283: + // default: + // return ExpItohTsujii2(B, m - 1, m, ks); + // } + + /* + * Inversion in F2m using the extended Euclidean algorithm + * + * Input: A nonzero polynomial a(z) of degree at most m-1 + * Output: a(z)^(-1) mod f(z) + */ + int uzDegree = Degree(); + if (uzDegree == 0) + { + throw new InvalidOperationException(); + } + if (uzDegree == 1) + { + return this; + } + + // u(z) := a(z) + LongArray uz = (LongArray)Copy(); + + int t = (m + 63) >> 6; + + // v(z) := f(z) + LongArray vz = new LongArray(t); + ReduceBit(vz.m_ints, 0, m, m, ks); + + // g1(z) := 1, g2(z) := 0 + LongArray g1z = new LongArray(t); + g1z.m_ints[0] = 1L; + LongArray g2z = new LongArray(t); + + int[] uvDeg = new int[]{ uzDegree, m + 1 }; + LongArray[] uv = new LongArray[]{ uz, vz }; + + int[] ggDeg = new int[]{ 1, 0 }; + LongArray[] gg = new LongArray[]{ g1z, g2z }; + + int b = 1; + int duv1 = uvDeg[b]; + int dgg1 = ggDeg[b]; + int j = duv1 - uvDeg[1 - b]; + + for (;;) + { + if (j < 0) + { + j = -j; + uvDeg[b] = duv1; + ggDeg[b] = dgg1; + b = 1 - b; + duv1 = uvDeg[b]; + dgg1 = ggDeg[b]; + } + + uv[b].AddShiftedByBitsSafe(uv[1 - b], uvDeg[1 - b], j); + + int duv2 = uv[b].DegreeFrom(duv1); + if (duv2 == 0) + { + return gg[1 - b]; + } + + { + int dgg2 = ggDeg[1 - b]; + gg[b].AddShiftedByBitsSafe(gg[1 - b], dgg2, j); + dgg2 += j; + + if (dgg2 > dgg1) + { + dgg1 = dgg2; + } + else if (dgg2 == dgg1) + { + dgg1 = gg[b].DegreeFrom(dgg1); + } + } + + j += (duv2 - duv1); + duv1 = duv2; + } + } + + public override bool Equals(object obj) + { + return Equals(obj as LongArray); + } + + public virtual bool Equals(LongArray other) + { + if (this == other) + return true; + if (null == other) + return false; + int usedLen = GetUsedLength(); + if (other.GetUsedLength() != usedLen) + { + return false; + } + for (int i = 0; i < usedLen; i++) + { + if (m_ints[i] != other.m_ints[i]) + { + return false; + } + } + return true; + } + + public override int GetHashCode() + { + int usedLen = GetUsedLength(); + int hash = 1; + for (int i = 0; i < usedLen; i++) + { + long mi = m_ints[i]; + hash *= 31; + hash ^= (int)mi; + hash *= 31; + hash ^= (int)((ulong)mi >> 32); + } + return hash; + } + + public LongArray Copy() + { + return new LongArray(Arrays.Clone(m_ints)); + } + + public override string ToString() + { + int i = GetUsedLength(); + if (i == 0) + { + return "0"; + } + + StringBuilder sb = new StringBuilder(Convert.ToString(m_ints[--i], 2)); + while (--i >= 0) + { + string s = Convert.ToString(m_ints[i], 2); + + // Add leading zeroes, except for highest significant word + int len = s.Length; + if (len < 64) + { + sb.Append(ZEROES.Substring(len)); + } + + sb.Append(s); + } + return sb.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/LongArray.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/LongArray.cs.meta new file mode 100644 index 00000000..d50df6c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/LongArray.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c64005ee201237e4fb747b16625d3307 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleXPointMap.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleXPointMap.cs new file mode 100644 index 00000000..eb97b964 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleXPointMap.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + public class ScaleXPointMap + : ECPointMap + { + protected readonly ECFieldElement scale; + + public ScaleXPointMap(ECFieldElement scale) + { + this.scale = scale; + } + + public virtual ECPoint Map(ECPoint p) + { + return p.ScaleX(scale); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleXPointMap.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleXPointMap.cs.meta new file mode 100644 index 00000000..579c20c2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleXPointMap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9dfd9f72fc2d48e42b878a2169f7e4d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleYPointMap.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleYPointMap.cs new file mode 100644 index 00000000..a1e7dc6f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleYPointMap.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + public class ScaleYPointMap + : ECPointMap + { + protected readonly ECFieldElement scale; + + public ScaleYPointMap(ECFieldElement scale) + { + this.scale = scale; + } + + public virtual ECPoint Map(ECPoint p) + { + return p.ScaleY(scale); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleYPointMap.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleYPointMap.cs.meta new file mode 100644 index 00000000..f2544405 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/ScaleYPointMap.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0012fa428aef224e95dfcbacde294a1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/SimpleLookupTable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/SimpleLookupTable.cs new file mode 100644 index 00000000..48aee116 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/SimpleLookupTable.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC +{ + public class SimpleLookupTable + : ECLookupTable + { + private static ECPoint[] Copy(ECPoint[] points, int off, int len) + { + ECPoint[] result = new ECPoint[len]; + for (int i = 0; i < len; ++i) + { + result[i] = points[off + i]; + } + return result; + } + + private readonly ECPoint[] points; + + public SimpleLookupTable(ECPoint[] points, int off, int len) + { + this.points = Copy(points, off, len); + } + + public virtual int Size + { + get { return points.Length; } + } + + public virtual ECPoint Lookup(int index) + { + return points[index]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/SimpleLookupTable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/SimpleLookupTable.cs.meta new file mode 100644 index 00000000..cea49226 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/SimpleLookupTable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31b37f390092cbf49912e6eec081a533 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc.meta new file mode 100644 index 00000000..e2159c42 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 40e69c1e558a62e4cb5a52d30eb8fdfd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/SimpleBigDecimal.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/SimpleBigDecimal.cs new file mode 100644 index 00000000..2cf3ec90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/SimpleBigDecimal.cs @@ -0,0 +1,245 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc +{ + /** + * Class representing a simple version of a big decimal. A + * SimpleBigDecimal is basically a + * {@link java.math.BigInteger BigInteger} with a few digits on the right of + * the decimal point. The number of (binary) digits on the right of the decimal + * point is called the scale of the SimpleBigDecimal. + * Unlike in {@link java.math.BigDecimal BigDecimal}, the scale is not adjusted + * automatically, but must be set manually. All SimpleBigDecimals + * taking part in the same arithmetic operation must have equal scale. The + * result of a multiplication of two SimpleBigDecimals returns a + * SimpleBigDecimal with double scale. + */ + internal class SimpleBigDecimal + // : Number + { + // private static final long serialVersionUID = 1L; + + private readonly BigInteger bigInt; + private readonly int scale; + + /** + * Returns a SimpleBigDecimal representing the same numerical + * value as value. + * @param value The value of the SimpleBigDecimal to be + * created. + * @param scale The scale of the SimpleBigDecimal to be + * created. + * @return The such created SimpleBigDecimal. + */ + public static SimpleBigDecimal GetInstance(BigInteger val, int scale) + { + return new SimpleBigDecimal(val.ShiftLeft(scale), scale); + } + + /** + * Constructor for SimpleBigDecimal. The value of the + * constructed SimpleBigDecimal Equals bigInt / + * 2scale. + * @param bigInt The bigInt value parameter. + * @param scale The scale of the constructed SimpleBigDecimal. + */ + public SimpleBigDecimal(BigInteger bigInt, int scale) + { + if (scale < 0) + throw new ArgumentException("scale may not be negative"); + + this.bigInt = bigInt; + this.scale = scale; + } + + private SimpleBigDecimal(SimpleBigDecimal limBigDec) + { + bigInt = limBigDec.bigInt; + scale = limBigDec.scale; + } + + private void CheckScale(SimpleBigDecimal b) + { + if (scale != b.scale) + throw new ArgumentException("Only SimpleBigDecimal of same scale allowed in arithmetic operations"); + } + + public SimpleBigDecimal AdjustScale(int newScale) + { + if (newScale < 0) + throw new ArgumentException("scale may not be negative"); + + if (newScale == scale) + return this; + + return new SimpleBigDecimal(bigInt.ShiftLeft(newScale - scale), newScale); + } + + public SimpleBigDecimal Add(SimpleBigDecimal b) + { + CheckScale(b); + return new SimpleBigDecimal(bigInt.Add(b.bigInt), scale); + } + + public SimpleBigDecimal Add(BigInteger b) + { + return new SimpleBigDecimal(bigInt.Add(b.ShiftLeft(scale)), scale); + } + + public SimpleBigDecimal Negate() + { + return new SimpleBigDecimal(bigInt.Negate(), scale); + } + + public SimpleBigDecimal Subtract(SimpleBigDecimal b) + { + return Add(b.Negate()); + } + + public SimpleBigDecimal Subtract(BigInteger b) + { + return new SimpleBigDecimal(bigInt.Subtract(b.ShiftLeft(scale)), scale); + } + + public SimpleBigDecimal Multiply(SimpleBigDecimal b) + { + CheckScale(b); + return new SimpleBigDecimal(bigInt.Multiply(b.bigInt), scale + scale); + } + + public SimpleBigDecimal Multiply(BigInteger b) + { + return new SimpleBigDecimal(bigInt.Multiply(b), scale); + } + + public SimpleBigDecimal Divide(SimpleBigDecimal b) + { + CheckScale(b); + BigInteger dividend = bigInt.ShiftLeft(scale); + return new SimpleBigDecimal(dividend.Divide(b.bigInt), scale); + } + + public SimpleBigDecimal Divide(BigInteger b) + { + return new SimpleBigDecimal(bigInt.Divide(b), scale); + } + + public SimpleBigDecimal ShiftLeft(int n) + { + return new SimpleBigDecimal(bigInt.ShiftLeft(n), scale); + } + + public int CompareTo(SimpleBigDecimal val) + { + CheckScale(val); + return bigInt.CompareTo(val.bigInt); + } + + public int CompareTo(BigInteger val) + { + return bigInt.CompareTo(val.ShiftLeft(scale)); + } + + public BigInteger Floor() + { + return bigInt.ShiftRight(scale); + } + + public BigInteger Round() + { + SimpleBigDecimal oneHalf = new SimpleBigDecimal(BigInteger.One, 1); + return Add(oneHalf.AdjustScale(scale)).Floor(); + } + + public int IntValue + { + get { return Floor().IntValue; } + } + + public long LongValue + { + get { return Floor().LongValue; } + } + +// public double doubleValue() +// { +// return new Double(ToString()).doubleValue(); +// } +// +// public float floatValue() +// { +// return new Float(ToString()).floatValue(); +// } + + public int Scale + { + get { return scale; } + } + + public override string ToString() + { + if (scale == 0) + return bigInt.ToString(); + + BigInteger floorBigInt = Floor(); + + BigInteger fract = bigInt.Subtract(floorBigInt.ShiftLeft(scale)); + if (bigInt.SignValue < 0) + { + fract = BigInteger.One.ShiftLeft(scale).Subtract(fract); + } + + if ((floorBigInt.SignValue == -1) && (!(fract.Equals(BigInteger.Zero)))) + { + floorBigInt = floorBigInt.Add(BigInteger.One); + } + string leftOfPoint = floorBigInt.ToString(); + + char[] fractCharArr = new char[scale]; + string fractStr = fract.ToString(2); + int fractLen = fractStr.Length; + int zeroes = scale - fractLen; + for (int i = 0; i < zeroes; i++) + { + fractCharArr[i] = '0'; + } + for (int j = 0; j < fractLen; j++) + { + fractCharArr[zeroes + j] = fractStr[j]; + } + string rightOfPoint = new string(fractCharArr); + + StringBuilder sb = new StringBuilder(leftOfPoint); + sb.Append("."); + sb.Append(rightOfPoint); + + return sb.ToString(); + } + + public override bool Equals( + object obj) + { + if (this == obj) + return true; + + SimpleBigDecimal other = obj as SimpleBigDecimal; + + if (other == null) + return false; + + return bigInt.Equals(other.bigInt) + && scale == other.scale; + } + + public override int GetHashCode() + { + return bigInt.GetHashCode() ^ scale; + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/SimpleBigDecimal.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/SimpleBigDecimal.cs.meta new file mode 100644 index 00000000..83973ab0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/SimpleBigDecimal.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 90b2a6bdef50756439d9f47423252e4b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/Tnaf.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/Tnaf.cs new file mode 100644 index 00000000..95aaefd1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/Tnaf.cs @@ -0,0 +1,849 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc +{ + /** + * Class holding methods for point multiplication based on the window + * τ-adic nonadjacent form (WTNAF). The algorithms are based on the + * paper "Improved Algorithms for Arithmetic on Anomalous Binary Curves" + * by Jerome A. Solinas. The paper first appeared in the Proceedings of + * Crypto 1997. + */ + internal class Tnaf + { + private static readonly BigInteger MinusOne = BigInteger.One.Negate(); + private static readonly BigInteger MinusTwo = BigInteger.Two.Negate(); + private static readonly BigInteger MinusThree = BigInteger.Three.Negate(); + private static readonly BigInteger Four = BigInteger.ValueOf(4); + + /** + * The window width of WTNAF. The standard value of 4 is slightly less + * than optimal for running time, but keeps space requirements for + * precomputation low. For typical curves, a value of 5 or 6 results in + * a better running time. When changing this value, the + * αu's must be computed differently, see + * e.g. "Guide to Elliptic Curve Cryptography", Darrel Hankerson, + * Alfred Menezes, Scott Vanstone, Springer-Verlag New York Inc., 2004, + * p. 121-122 + */ + public const sbyte Width = 4; + + /** + * 24 + */ + public const sbyte Pow2Width = 16; + + /** + * The αu's for a=0 as an array + * of ZTauElements. + */ + public static readonly ZTauElement[] Alpha0 = + { + null, + new ZTauElement(BigInteger.One, BigInteger.Zero), null, + new ZTauElement(MinusThree, MinusOne), null, + new ZTauElement(MinusOne, MinusOne), null, + new ZTauElement(BigInteger.One, MinusOne), null + }; + + /** + * The αu's for a=0 as an array + * of TNAFs. + */ + public static readonly sbyte[][] Alpha0Tnaf = + { + null, new sbyte[]{1}, null, new sbyte[]{-1, 0, 1}, null, new sbyte[]{1, 0, 1}, null, new sbyte[]{-1, 0, 0, 1} + }; + + /** + * The αu's for a=1 as an array + * of ZTauElements. + */ + public static readonly ZTauElement[] Alpha1 = + { + null, + new ZTauElement(BigInteger.One, BigInteger.Zero), null, + new ZTauElement(MinusThree, BigInteger.One), null, + new ZTauElement(MinusOne, BigInteger.One), null, + new ZTauElement(BigInteger.One, BigInteger.One), null + }; + + /** + * The αu's for a=1 as an array + * of TNAFs. + */ + public static readonly sbyte[][] Alpha1Tnaf = + { + null, new sbyte[]{1}, null, new sbyte[]{-1, 0, 1}, null, new sbyte[]{1, 0, 1}, null, new sbyte[]{-1, 0, 0, -1} + }; + + /** + * Computes the norm of an element λ of + * Z[τ]. + * @param mu The parameter μ of the elliptic curve. + * @param lambda The element λ of + * Z[τ]. + * @return The norm of λ. + */ + public static BigInteger Norm(sbyte mu, ZTauElement lambda) + { + BigInteger norm; + + // s1 = u^2 + BigInteger s1 = lambda.u.Multiply(lambda.u); + + // s2 = u * v + BigInteger s2 = lambda.u.Multiply(lambda.v); + + // s3 = 2 * v^2 + BigInteger s3 = lambda.v.Multiply(lambda.v).ShiftLeft(1); + + if (mu == 1) + { + norm = s1.Add(s2).Add(s3); + } + else if (mu == -1) + { + norm = s1.Subtract(s2).Add(s3); + } + else + { + throw new ArgumentException("mu must be 1 or -1"); + } + + return norm; + } + + /** + * Computes the norm of an element λ of + * R[τ], where λ = u + vτ + * and u and u are real numbers (elements of + * R). + * @param mu The parameter μ of the elliptic curve. + * @param u The real part of the element λ of + * R[τ]. + * @param v The τ-adic part of the element + * λ of R[τ]. + * @return The norm of λ. + */ + public static SimpleBigDecimal Norm(sbyte mu, SimpleBigDecimal u, SimpleBigDecimal v) + { + SimpleBigDecimal norm; + + // s1 = u^2 + SimpleBigDecimal s1 = u.Multiply(u); + + // s2 = u * v + SimpleBigDecimal s2 = u.Multiply(v); + + // s3 = 2 * v^2 + SimpleBigDecimal s3 = v.Multiply(v).ShiftLeft(1); + + if (mu == 1) + { + norm = s1.Add(s2).Add(s3); + } + else if (mu == -1) + { + norm = s1.Subtract(s2).Add(s3); + } + else + { + throw new ArgumentException("mu must be 1 or -1"); + } + + return norm; + } + + /** + * Rounds an element λ of R[τ] + * to an element of Z[τ], such that their difference + * has minimal norm. λ is given as + * λ = λ0 + λ1τ. + * @param lambda0 The component λ0. + * @param lambda1 The component λ1. + * @param mu The parameter μ of the elliptic curve. Must + * equal 1 or -1. + * @return The rounded element of Z[τ]. + * @throws ArgumentException if lambda0 and + * lambda1 do not have same scale. + */ + public static ZTauElement Round(SimpleBigDecimal lambda0, + SimpleBigDecimal lambda1, sbyte mu) + { + int scale = lambda0.Scale; + if (lambda1.Scale != scale) + throw new ArgumentException("lambda0 and lambda1 do not have same scale"); + + if (!((mu == 1) || (mu == -1))) + throw new ArgumentException("mu must be 1 or -1"); + + BigInteger f0 = lambda0.Round(); + BigInteger f1 = lambda1.Round(); + + SimpleBigDecimal eta0 = lambda0.Subtract(f0); + SimpleBigDecimal eta1 = lambda1.Subtract(f1); + + // eta = 2*eta0 + mu*eta1 + SimpleBigDecimal eta = eta0.Add(eta0); + if (mu == 1) + { + eta = eta.Add(eta1); + } + else + { + // mu == -1 + eta = eta.Subtract(eta1); + } + + // check1 = eta0 - 3*mu*eta1 + // check2 = eta0 + 4*mu*eta1 + SimpleBigDecimal threeEta1 = eta1.Add(eta1).Add(eta1); + SimpleBigDecimal fourEta1 = threeEta1.Add(eta1); + SimpleBigDecimal check1; + SimpleBigDecimal check2; + if (mu == 1) + { + check1 = eta0.Subtract(threeEta1); + check2 = eta0.Add(fourEta1); + } + else + { + // mu == -1 + check1 = eta0.Add(threeEta1); + check2 = eta0.Subtract(fourEta1); + } + + sbyte h0 = 0; + sbyte h1 = 0; + + // if eta >= 1 + if (eta.CompareTo(BigInteger.One) >= 0) + { + if (check1.CompareTo(MinusOne) < 0) + { + h1 = mu; + } + else + { + h0 = 1; + } + } + else + { + // eta < 1 + if (check2.CompareTo(BigInteger.Two) >= 0) + { + h1 = mu; + } + } + + // if eta < -1 + if (eta.CompareTo(MinusOne) < 0) + { + if (check1.CompareTo(BigInteger.One) >= 0) + { + h1 = (sbyte)-mu; + } + else + { + h0 = -1; + } + } + else + { + // eta >= -1 + if (check2.CompareTo(MinusTwo) < 0) + { + h1 = (sbyte)-mu; + } + } + + BigInteger q0 = f0.Add(BigInteger.ValueOf(h0)); + BigInteger q1 = f1.Add(BigInteger.ValueOf(h1)); + return new ZTauElement(q0, q1); + } + + /** + * Approximate division by n. For an integer + * k, the value λ = s k / n is + * computed to c bits of accuracy. + * @param k The parameter k. + * @param s The curve parameter s0 or + * s1. + * @param vm The Lucas Sequence element Vm. + * @param a The parameter a of the elliptic curve. + * @param m The bit length of the finite field + * Fm. + * @param c The number of bits of accuracy, i.e. the scale of the returned + * SimpleBigDecimal. + * @return The value λ = s k / n computed to + * c bits of accuracy. + */ + public static SimpleBigDecimal ApproximateDivisionByN(BigInteger k, + BigInteger s, BigInteger vm, sbyte a, int m, int c) + { + int _k = (m + 5)/2 + c; + BigInteger ns = k.ShiftRight(m - _k - 2 + a); + + BigInteger gs = s.Multiply(ns); + + BigInteger hs = gs.ShiftRight(m); + + BigInteger js = vm.Multiply(hs); + + BigInteger gsPlusJs = gs.Add(js); + BigInteger ls = gsPlusJs.ShiftRight(_k-c); + if (gsPlusJs.TestBit(_k-c-1)) + { + // round up + ls = ls.Add(BigInteger.One); + } + + return new SimpleBigDecimal(ls, c); + } + + /** + * Computes the τ-adic NAF (non-adjacent form) of an + * element λ of Z[τ]. + * @param mu The parameter μ of the elliptic curve. + * @param lambda The element λ of + * Z[τ]. + * @return The τ-adic NAF of λ. + */ + public static sbyte[] TauAdicNaf(sbyte mu, ZTauElement lambda) + { + if (!((mu == 1) || (mu == -1))) + throw new ArgumentException("mu must be 1 or -1"); + + BigInteger norm = Norm(mu, lambda); + + // Ceiling of log2 of the norm + int log2Norm = norm.BitLength; + + // If length(TNAF) > 30, then length(TNAF) < log2Norm + 3.52 + int maxLength = log2Norm > 30 ? log2Norm + 4 : 34; + + // The array holding the TNAF + sbyte[] u = new sbyte[maxLength]; + int i = 0; + + // The actual length of the TNAF + int length = 0; + + BigInteger r0 = lambda.u; + BigInteger r1 = lambda.v; + + while(!((r0.Equals(BigInteger.Zero)) && (r1.Equals(BigInteger.Zero)))) + { + // If r0 is odd + if (r0.TestBit(0)) + { + u[i] = (sbyte) BigInteger.Two.Subtract((r0.Subtract(r1.ShiftLeft(1))).Mod(Four)).IntValue; + + // r0 = r0 - u[i] + if (u[i] == 1) + { + r0 = r0.ClearBit(0); + } + else + { + // u[i] == -1 + r0 = r0.Add(BigInteger.One); + } + length = i; + } + else + { + u[i] = 0; + } + + BigInteger t = r0; + BigInteger s = r0.ShiftRight(1); + if (mu == 1) + { + r0 = r1.Add(s); + } + else + { + // mu == -1 + r0 = r1.Subtract(s); + } + + r1 = t.ShiftRight(1).Negate(); + i++; + } + + length++; + + // Reduce the TNAF array to its actual length + sbyte[] tnaf = new sbyte[length]; + Array.Copy(u, 0, tnaf, 0, length); + return tnaf; + } + + /** + * Applies the operation τ() to an + * AbstractF2mPoint. + * @param p The AbstractF2mPoint to which τ() is applied. + * @return τ(p) + */ + public static AbstractF2mPoint Tau(AbstractF2mPoint p) + { + return p.Tau(); + } + + /** + * Returns the parameter μ of the elliptic curve. + * @param curve The elliptic curve from which to obtain μ. + * The curve must be a Koblitz curve, i.e. a Equals + * 0 or 1 and b Equals + * 1. + * @return μ of the elliptic curve. + * @throws ArgumentException if the given ECCurve is not a Koblitz + * curve. + */ + public static sbyte GetMu(AbstractF2mCurve curve) + { + BigInteger a = curve.A.ToBigInteger(); + + sbyte mu; + if (a.SignValue == 0) + { + mu = -1; + } + else if (a.Equals(BigInteger.One)) + { + mu = 1; + } + else + { + throw new ArgumentException("No Koblitz curve (ABC), TNAF multiplication not possible"); + } + return mu; + } + + public static sbyte GetMu(ECFieldElement curveA) + { + return (sbyte)(curveA.IsZero ? -1 : 1); + } + + public static sbyte GetMu(int curveA) + { + return (sbyte)(curveA == 0 ? -1 : 1); + } + + /** + * Calculates the Lucas Sequence elements Uk-1 and + * Uk or Vk-1 and + * Vk. + * @param mu The parameter μ of the elliptic curve. + * @param k The index of the second element of the Lucas Sequence to be + * returned. + * @param doV If set to true, computes Vk-1 and + * Vk, otherwise Uk-1 and + * Uk. + * @return An array with 2 elements, containing Uk-1 + * and Uk or Vk-1 + * and Vk. + */ + public static BigInteger[] GetLucas(sbyte mu, int k, bool doV) + { + if (!(mu == 1 || mu == -1)) + throw new ArgumentException("mu must be 1 or -1"); + + BigInteger u0; + BigInteger u1; + BigInteger u2; + + if (doV) + { + u0 = BigInteger.Two; + u1 = BigInteger.ValueOf(mu); + } + else + { + u0 = BigInteger.Zero; + u1 = BigInteger.One; + } + + for (int i = 1; i < k; i++) + { + // u2 = mu*u1 - 2*u0; + BigInteger s = null; + if (mu == 1) + { + s = u1; + } + else + { + // mu == -1 + s = u1.Negate(); + } + + u2 = s.Subtract(u0.ShiftLeft(1)); + u0 = u1; + u1 = u2; + // System.out.println(i + ": " + u2); + // System.out.println(); + } + + BigInteger[] retVal = {u0, u1}; + return retVal; + } + + /** + * Computes the auxiliary value tw. If the width is + * 4, then for mu = 1, tw = 6 and for + * mu = -1, tw = 10 + * @param mu The parameter μ of the elliptic curve. + * @param w The window width of the WTNAF. + * @return the auxiliary value tw + */ + public static BigInteger GetTw(sbyte mu, int w) + { + if (w == 4) + { + if (mu == 1) + { + return BigInteger.ValueOf(6); + } + else + { + // mu == -1 + return BigInteger.ValueOf(10); + } + } + else + { + // For w <> 4, the values must be computed + BigInteger[] us = GetLucas(mu, w, false); + BigInteger twoToW = BigInteger.Zero.SetBit(w); + BigInteger u1invert = us[1].ModInverse(twoToW); + BigInteger tw; + tw = BigInteger.Two.Multiply(us[0]).Multiply(u1invert).Mod(twoToW); + //System.out.println("mu = " + mu); + //System.out.println("tw = " + tw); + return tw; + } + } + + /** + * Computes the auxiliary values s0 and + * s1 used for partial modular reduction. + * @param curve The elliptic curve for which to compute + * s0 and s1. + * @throws ArgumentException if curve is not a + * Koblitz curve (Anomalous Binary Curve, ABC). + */ + public static BigInteger[] GetSi(AbstractF2mCurve curve) + { + if (!curve.IsKoblitz) + throw new ArgumentException("si is defined for Koblitz curves only"); + + int m = curve.FieldSize; + int a = curve.A.ToBigInteger().IntValue; + sbyte mu = GetMu(a); + int shifts = GetShiftsForCofactor(curve.Cofactor); + int index = m + 3 - a; + BigInteger[] ui = GetLucas(mu, index, false); + + if (mu == 1) + { + ui[0] = ui[0].Negate(); + ui[1] = ui[1].Negate(); + } + + BigInteger dividend0 = BigInteger.One.Add(ui[1]).ShiftRight(shifts); + BigInteger dividend1 = BigInteger.One.Add(ui[0]).ShiftRight(shifts).Negate(); + + return new BigInteger[] { dividend0, dividend1 }; + } + + public static BigInteger[] GetSi(int fieldSize, int curveA, BigInteger cofactor) + { + sbyte mu = GetMu(curveA); + int shifts = GetShiftsForCofactor(cofactor); + int index = fieldSize + 3 - curveA; + BigInteger[] ui = GetLucas(mu, index, false); + if (mu == 1) + { + ui[0] = ui[0].Negate(); + ui[1] = ui[1].Negate(); + } + + BigInteger dividend0 = BigInteger.One.Add(ui[1]).ShiftRight(shifts); + BigInteger dividend1 = BigInteger.One.Add(ui[0]).ShiftRight(shifts).Negate(); + + return new BigInteger[] { dividend0, dividend1 }; + } + + protected static int GetShiftsForCofactor(BigInteger h) + { + if (h != null && h.BitLength < 4) + { + int hi = h.IntValue; + if (hi == 2) + return 1; + if (hi == 4) + return 2; + } + + throw new ArgumentException("h (Cofactor) must be 2 or 4"); + } + + /** + * Partial modular reduction modulo + * m - 1)/(τ - 1). + * @param k The integer to be reduced. + * @param m The bitlength of the underlying finite field. + * @param a The parameter a of the elliptic curve. + * @param s The auxiliary values s0 and + * s1. + * @param mu The parameter μ of the elliptic curve. + * @param c The precision (number of bits of accuracy) of the partial + * modular reduction. + * @return ρ := k partmod (τm - 1)/(τ - 1) + */ + public static ZTauElement PartModReduction(BigInteger k, int m, sbyte a, + BigInteger[] s, sbyte mu, sbyte c) + { + // d0 = s[0] + mu*s[1]; mu is either 1 or -1 + BigInteger d0; + if (mu == 1) + { + d0 = s[0].Add(s[1]); + } + else + { + d0 = s[0].Subtract(s[1]); + } + + BigInteger[] v = GetLucas(mu, m, true); + BigInteger vm = v[1]; + + SimpleBigDecimal lambda0 = ApproximateDivisionByN( + k, s[0], vm, a, m, c); + + SimpleBigDecimal lambda1 = ApproximateDivisionByN( + k, s[1], vm, a, m, c); + + ZTauElement q = Round(lambda0, lambda1, mu); + + // r0 = n - d0*q0 - 2*s1*q1 + BigInteger r0 = k.Subtract(d0.Multiply(q.u)).Subtract( + BigInteger.ValueOf(2).Multiply(s[1]).Multiply(q.v)); + + // r1 = s1*q0 - s0*q1 + BigInteger r1 = s[1].Multiply(q.u).Subtract(s[0].Multiply(q.v)); + + return new ZTauElement(r0, r1); + } + + /** + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + * by a BigInteger using the reduced τ-adic + * NAF (RTNAF) method. + * @param p The AbstractF2mPoint to Multiply. + * @param k The BigInteger by which to Multiply p. + * @return k * p + */ + public static AbstractF2mPoint MultiplyRTnaf(AbstractF2mPoint p, BigInteger k) + { + AbstractF2mCurve curve = (AbstractF2mCurve)p.Curve; + int m = curve.FieldSize; + int a = curve.A.ToBigInteger().IntValue; + sbyte mu = GetMu(a); + BigInteger[] s = curve.GetSi(); + ZTauElement rho = PartModReduction(k, m, (sbyte)a, s, mu, (sbyte)10); + + return MultiplyTnaf(p, rho); + } + + /** + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + * by an element λ of Z[τ] + * using the τ-adic NAF (TNAF) method. + * @param p The AbstractF2mPoint to Multiply. + * @param lambda The element λ of + * Z[τ]. + * @return λ * p + */ + public static AbstractF2mPoint MultiplyTnaf(AbstractF2mPoint p, ZTauElement lambda) + { + AbstractF2mCurve curve = (AbstractF2mCurve)p.Curve; + sbyte mu = GetMu(curve.A); + sbyte[] u = TauAdicNaf(mu, lambda); + + AbstractF2mPoint q = MultiplyFromTnaf(p, u); + + return q; + } + + /** + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + * by an element λ of Z[τ] + * using the τ-adic NAF (TNAF) method, given the TNAF + * of λ. + * @param p The AbstractF2mPoint to Multiply. + * @param u The the TNAF of λ.. + * @return λ * p + */ + public static AbstractF2mPoint MultiplyFromTnaf(AbstractF2mPoint p, sbyte[] u) + { + ECCurve curve = p.Curve; + AbstractF2mPoint q = (AbstractF2mPoint)curve.Infinity; + AbstractF2mPoint pNeg = (AbstractF2mPoint)p.Negate(); + int tauCount = 0; + for (int i = u.Length - 1; i >= 0; i--) + { + ++tauCount; + sbyte ui = u[i]; + if (ui != 0) + { + q = q.TauPow(tauCount); + tauCount = 0; + + ECPoint x = ui > 0 ? p : pNeg; + q = (AbstractF2mPoint)q.Add(x); + } + } + if (tauCount > 0) + { + q = q.TauPow(tauCount); + } + return q; + } + + /** + * Computes the [τ]-adic window NAF of an element + * λ of Z[τ]. + * @param mu The parameter μ of the elliptic curve. + * @param lambda The element λ of + * Z[τ] of which to compute the + * [τ]-adic NAF. + * @param width The window width of the resulting WNAF. + * @param pow2w 2width. + * @param tw The auxiliary value tw. + * @param alpha The αu's for the window width. + * @return The [τ]-adic window NAF of + * λ. + */ + public static sbyte[] TauAdicWNaf(sbyte mu, ZTauElement lambda, + sbyte width, BigInteger pow2w, BigInteger tw, ZTauElement[] alpha) + { + if (!((mu == 1) || (mu == -1))) + throw new ArgumentException("mu must be 1 or -1"); + + BigInteger norm = Norm(mu, lambda); + + // Ceiling of log2 of the norm + int log2Norm = norm.BitLength; + + // If length(TNAF) > 30, then length(TNAF) < log2Norm + 3.52 + int maxLength = log2Norm > 30 ? log2Norm + 4 + width : 34 + width; + + // The array holding the TNAF + sbyte[] u = new sbyte[maxLength]; + + // 2^(width - 1) + BigInteger pow2wMin1 = pow2w.ShiftRight(1); + + // Split lambda into two BigIntegers to simplify calculations + BigInteger r0 = lambda.u; + BigInteger r1 = lambda.v; + int i = 0; + + // while lambda <> (0, 0) + while (!((r0.Equals(BigInteger.Zero))&&(r1.Equals(BigInteger.Zero)))) + { + // if r0 is odd + if (r0.TestBit(0)) + { + // uUnMod = r0 + r1*tw Mod 2^width + BigInteger uUnMod + = r0.Add(r1.Multiply(tw)).Mod(pow2w); + + sbyte uLocal; + // if uUnMod >= 2^(width - 1) + if (uUnMod.CompareTo(pow2wMin1) >= 0) + { + uLocal = (sbyte) uUnMod.Subtract(pow2w).IntValue; + } + else + { + uLocal = (sbyte) uUnMod.IntValue; + } + // uLocal is now in [-2^(width-1), 2^(width-1)-1] + + u[i] = uLocal; + bool s = true; + if (uLocal < 0) + { + s = false; + uLocal = (sbyte)-uLocal; + } + // uLocal is now >= 0 + + if (s) + { + r0 = r0.Subtract(alpha[uLocal].u); + r1 = r1.Subtract(alpha[uLocal].v); + } + else + { + r0 = r0.Add(alpha[uLocal].u); + r1 = r1.Add(alpha[uLocal].v); + } + } + else + { + u[i] = 0; + } + + BigInteger t = r0; + + if (mu == 1) + { + r0 = r1.Add(r0.ShiftRight(1)); + } + else + { + // mu == -1 + r0 = r1.Subtract(r0.ShiftRight(1)); + } + r1 = t.ShiftRight(1).Negate(); + i++; + } + return u; + } + + /** + * Does the precomputation for WTNAF multiplication. + * @param p The ECPoint for which to do the precomputation. + * @param a The parameter a of the elliptic curve. + * @return The precomputation array for p. + */ + public static AbstractF2mPoint[] GetPreComp(AbstractF2mPoint p, sbyte a) + { + sbyte[][] alphaTnaf = (a == 0) ? Tnaf.Alpha0Tnaf : Tnaf.Alpha1Tnaf; + + AbstractF2mPoint[] pu = new AbstractF2mPoint[(uint)(alphaTnaf.Length + 1) >> 1]; + pu[0] = p; + + uint precompLen = (uint)alphaTnaf.Length; + for (uint i = 3; i < precompLen; i += 2) + { + pu[i >> 1] = Tnaf.MultiplyFromTnaf(p, alphaTnaf[i]); + } + + p.Curve.NormalizeAll(pu); + + return pu; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/Tnaf.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/Tnaf.cs.meta new file mode 100644 index 00000000..e5f80c09 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/Tnaf.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c350a1fcb33886749ad8b6d264d92746 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/ZTauElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/ZTauElement.cs new file mode 100644 index 00000000..720141ec --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/ZTauElement.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc +{ + /** + * Class representing an element of Z[τ]. Let + * λ be an element of Z[τ]. Then + * λ is given as λ = u + vτ. The + * components u and v may be used directly, there + * are no accessor methods. + * Immutable class. + */ + internal class ZTauElement + { + /** + * The "real" part of λ. + */ + public readonly BigInteger u; + + /** + * The "τ-adic" part of λ. + */ + public readonly BigInteger v; + + /** + * Constructor for an element λ of + * Z[τ]. + * @param u The "real" part of λ. + * @param v The "τ-adic" part of + * λ. + */ + public ZTauElement(BigInteger u, BigInteger v) + { + this.u = u; + this.v = v; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/ZTauElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/ZTauElement.cs.meta new file mode 100644 index 00000000..291026d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/abc/ZTauElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 06f1426762adf7a4a814250bf4084ce7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom.meta new file mode 100644 index 00000000..c3cb22fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f13f8a0df1a5e424796c38a3c077a81c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb.meta new file mode 100644 index 00000000..6d5155dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 31334dab2586b6c458754ba0fa30f370 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519.cs new file mode 100644 index 00000000..1b8e8b25 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519.cs @@ -0,0 +1,139 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Djb +{ + internal class Curve25519 + : AbstractFpCurve + { + public static readonly BigInteger q = Nat256.ToBigInteger(Curve25519Field.P); + + private const int Curve25519_DEFAULT_COORDS = COORD_JACOBIAN_MODIFIED; + private const int CURVE25519_FE_INTS = 8; + + protected readonly Curve25519Point m_infinity; + + public Curve25519() + : base(q) + { + this.m_infinity = new Curve25519Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA984914A144"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("7B425ED097B425ED097B425ED097B425ED097B425ED097B4260B5E9C7710C864"))); + this.m_order = new BigInteger(1, Hex.Decode("1000000000000000000000000000000014DEF9DEA2F79CD65812631A5CF5D3ED")); + this.m_cofactor = BigInteger.ValueOf(8); + this.m_coord = Curve25519_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new Curve25519(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN_MODIFIED: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new Curve25519FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new Curve25519Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new Curve25519Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * CURVE25519_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat256.Copy(((Curve25519FieldElement)p.RawXCoord).x, 0, table, pos); pos += CURVE25519_FE_INTS; + Nat256.Copy(((Curve25519FieldElement)p.RawYCoord).x, 0, table, pos); pos += CURVE25519_FE_INTS; + } + } + + return new Curve25519LookupTable(this, table, len); + } + + private class Curve25519LookupTable + : ECLookupTable + { + private readonly Curve25519 m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal Curve25519LookupTable(Curve25519 outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat256.Create(), y = Nat256.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < CURVE25519_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + CURVE25519_FE_INTS + j] & MASK; + } + + pos += (CURVE25519_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new Curve25519FieldElement(x), new Curve25519FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519.cs.meta new file mode 100644 index 00000000..8ba9b198 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 62c48392045829f409ce2c44bab3f21f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Field.cs new file mode 100644 index 00000000..c19873dd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Field.cs @@ -0,0 +1,257 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Djb +{ + internal class Curve25519Field + { + // 2^255 - 2^4 - 2^1 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFFFED, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0x7FFFFFFF }; + private const uint P7 = 0x7FFFFFFF; + private static readonly uint[] PExt = new uint[]{ 0x00000169, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFED, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0x3FFFFFFF }; + private const uint PInv = 0x13; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + Nat256.Add(x, y, z); + if (Nat256.Gte(z, P)) + { + SubPFrom(z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + Nat.Add(16, xx, yy, zz); + if (Nat.Gte(16, zz, PExt)) + { + SubPExtFrom(zz); + } + } + + public static void AddOne(uint[] x, uint[] z) + { + Nat.Inc(8, x, z); + if (Nat256.Gte(z, P)) + { + SubPFrom(z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat256.FromBigInteger(x); + while (Nat256.Gte(z, P)) + { + Nat256.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(8, x, 0, z); + } + else + { + Nat256.Add(x, P, z); + Nat.ShiftDownBit(8, z, 0); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat256.CreateExt(); + Nat256.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + Nat256.MulAddTo(x, y, zz); + if (Nat.Gte(16, zz, PExt)) + { + SubPExtFrom(zz); + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat256.IsZero(x)) + { + Nat256.Zero(z); + } + else + { + Nat256.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + Debug.Assert(xx[15] >> 30 == 0); + + uint xx07 = xx[7]; + Nat.ShiftUpBit(8, xx, 8, xx07, z, 0); + uint c = Nat256.MulByWordAddTo(PInv, xx, z) << 1; + uint z7 = z[7]; + c += (z7 >> 31) - (xx07 >> 31); + z7 &= P7; + z7 += Nat.AddWordTo(7, c * PInv, z); + z[7] = z7; + if (z7 >= P7 && Nat256.Gte(z, P)) + { + SubPFrom(z); + } + } + + public static void Reduce27(uint x, uint[] z) + { + Debug.Assert(x >> 26 == 0); + + uint z7 = z[7]; + uint c = (x << 1 | z7 >> 31); + z7 &= P7; + z7 += Nat.AddWordTo(7, c * PInv, z); + z[7] = z7; + if (z7 >= P7 && Nat256.Gte(z, P)) + { + SubPFrom(z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat256.CreateExt(); + Nat256.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat256.CreateExt(); + Nat256.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat256.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat256.Sub(x, y, z); + if (c != 0) + { + AddPTo(z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(16, xx, yy, zz); + if (c != 0) + { + AddPExtTo(zz); + } + } + + public static void Twice(uint[] x, uint[] z) + { + Nat.ShiftUpBit(8, x, 0, z); + if (Nat256.Gte(z, P)) + { + SubPFrom(z); + } + } + + private static uint AddPTo(uint[] z) + { + long c = (long)z[0] - PInv; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c = Nat.DecAt(7, z, 1); + } + c += (long)z[7] + (P7 + 1); + z[7] = (uint)c; + c >>= 32; + return (uint)c; + } + + private static uint AddPExtTo(uint[] zz) + { + long c = (long)zz[0] + PExt[0]; + zz[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c = Nat.IncAt(8, zz, 1); + } + c += (long)zz[8] - PInv; + zz[8] = (uint)c; + c >>= 32; + if (c != 0) + { + c = Nat.DecAt(15, zz, 9); + } + c += (long)zz[15] + (PExt[15] + 1); + zz[15] = (uint)c; + c >>= 32; + return (uint)c; + } + + private static int SubPFrom(uint[] z) + { + long c = (long)z[0] + PInv; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c = Nat.IncAt(7, z, 1); + } + c += (long)z[7] - (P7 + 1); + z[7] = (uint)c; + c >>= 32; + return (int)c; + } + + private static int SubPExtFrom(uint[] zz) + { + long c = (long)zz[0] - PExt[0]; + zz[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c = Nat.DecAt(8, zz, 1); + } + c += (long)zz[8] + PInv; + zz[8] = (uint)c; + c >>= 32; + if (c != 0) + { + c = Nat.IncAt(15, zz, 9); + } + c += (long)zz[15] - (PExt[15] + 1); + zz[15] = (uint)c; + c >>= 32; + return (int)c; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Field.cs.meta new file mode 100644 index 00000000..43b91cf3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1890aa1e585a00c46bd4d6e34b72cacd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519FieldElement.cs new file mode 100644 index 00000000..17b61a6b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519FieldElement.cs @@ -0,0 +1,237 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Djb +{ + internal class Curve25519FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = Curve25519.q; + + // Calculated as ECConstants.TWO.modPow(Q.shiftRight(2), Q) + private static readonly uint[] PRECOMP_POW2 = new uint[]{ 0x4a0ea0b0, 0xc4ee1b27, 0xad2fe478, 0x2f431806, + 0x3dfbd7a7, 0x2b4d0099, 0x4fc1df0b, 0x2b832480 }; + + protected internal readonly uint[] x; + + public Curve25519FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for Curve25519FieldElement", "x"); + + this.x = Curve25519Field.FromBigInteger(x); + } + + public Curve25519FieldElement() + { + this.x = Nat256.Create(); + } + + protected internal Curve25519FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat256.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat256.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat256.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat256.ToBigInteger(x); + } + + public override string FieldName + { + get { return "Curve25519Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat256.Create(); + Curve25519Field.Add(x, ((Curve25519FieldElement)b).x, z); + return new Curve25519FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat256.Create(); + Curve25519Field.AddOne(x, z); + return new Curve25519FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat256.Create(); + Curve25519Field.Subtract(x, ((Curve25519FieldElement)b).x, z); + return new Curve25519FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat256.Create(); + Curve25519Field.Multiply(x, ((Curve25519FieldElement)b).x, z); + return new Curve25519FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat256.Create(); + Mod.Invert(Curve25519Field.P, ((Curve25519FieldElement)b).x, z); + Curve25519Field.Multiply(z, x, z); + return new Curve25519FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat256.Create(); + Curve25519Field.Negate(x, z); + return new Curve25519FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat256.Create(); + Curve25519Field.Square(x, z); + return new Curve25519FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new Curve25519FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat256.Create(); + Mod.Invert(Curve25519Field.P, x, z); + return new Curve25519FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + /* + * Q == 8m + 5, so we use Pocklington's method for this case. + * + * First, raise this element to the exponent 2^252 - 2^1 (i.e. m + 1) + * + * Breaking up the exponent's binary representation into "repunits", we get: + * { 251 1s } { 1 0s } + * + * Therefore we need an addition chain containing 251 (the lengths of the repunits) + * We use: 1, 2, 3, 4, 7, 11, 15, 30, 60, 120, 131, [251] + */ + + uint[] x1 = this.x; + if (Nat256.IsZero(x1) || Nat256.IsOne(x1)) + return this; + + uint[] x2 = Nat256.Create(); + Curve25519Field.Square(x1, x2); + Curve25519Field.Multiply(x2, x1, x2); + uint[] x3 = x2; + Curve25519Field.Square(x2, x3); + Curve25519Field.Multiply(x3, x1, x3); + uint[] x4 = Nat256.Create(); + Curve25519Field.Square(x3, x4); + Curve25519Field.Multiply(x4, x1, x4); + uint[] x7 = Nat256.Create(); + Curve25519Field.SquareN(x4, 3, x7); + Curve25519Field.Multiply(x7, x3, x7); + uint[] x11 = x3; + Curve25519Field.SquareN(x7, 4, x11); + Curve25519Field.Multiply(x11, x4, x11); + uint[] x15 = x7; + Curve25519Field.SquareN(x11, 4, x15); + Curve25519Field.Multiply(x15, x4, x15); + uint[] x30 = x4; + Curve25519Field.SquareN(x15, 15, x30); + Curve25519Field.Multiply(x30, x15, x30); + uint[] x60 = x15; + Curve25519Field.SquareN(x30, 30, x60); + Curve25519Field.Multiply(x60, x30, x60); + uint[] x120 = x30; + Curve25519Field.SquareN(x60, 60, x120); + Curve25519Field.Multiply(x120, x60, x120); + uint[] x131 = x60; + Curve25519Field.SquareN(x120, 11, x131); + Curve25519Field.Multiply(x131, x11, x131); + uint[] x251 = x11; + Curve25519Field.SquareN(x131, 120, x251); + Curve25519Field.Multiply(x251, x120, x251); + + uint[] t1 = x251; + Curve25519Field.Square(t1, t1); + + uint[] t2 = x120; + Curve25519Field.Square(t1, t2); + + if (Nat256.Eq(x1, t2)) + { + return new Curve25519FieldElement(t1); + } + + /* + * If the first guess is incorrect, we multiply by a precomputed power of 2 to get the second guess, + * which is ((4x)^(m + 1))/2 mod Q + */ + Curve25519Field.Multiply(t1, PRECOMP_POW2, t1); + + Curve25519Field.Square(t1, t2); + + if (Nat256.Eq(x1, t2)) + { + return new Curve25519FieldElement(t1); + } + + return null; + } + + public override bool Equals(object obj) + { + return Equals(obj as Curve25519FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as Curve25519FieldElement); + } + + public virtual bool Equals(Curve25519FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat256.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 8); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519FieldElement.cs.meta new file mode 100644 index 00000000..368818d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07192861401eab44e845802495e99b0d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Point.cs new file mode 100644 index 00000000..e23b917c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Point.cs @@ -0,0 +1,317 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Djb +{ + internal class Curve25519Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve the curve to use + * @param x affine x co-ordinate + * @param y affine y co-ordinate + * + * @deprecated Use ECCurve.CreatePoint to construct points + */ + public Curve25519Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve the curve to use + * @param x affine x co-ordinate + * @param y affine y co-ordinate + * @param withCompression if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public Curve25519Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal Curve25519Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new Curve25519Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement GetZCoord(int index) + { + if (index == 1) + { + return GetJacobianModifiedW(); + } + + return base.GetZCoord(index); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + Curve25519FieldElement X1 = (Curve25519FieldElement)this.RawXCoord, Y1 = (Curve25519FieldElement)this.RawYCoord, + Z1 = (Curve25519FieldElement)this.RawZCoords[0]; + Curve25519FieldElement X2 = (Curve25519FieldElement)b.RawXCoord, Y2 = (Curve25519FieldElement)b.RawYCoord, + Z2 = (Curve25519FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat256.CreateExt(); + uint[] t2 = Nat256.Create(); + uint[] t3 = Nat256.Create(); + uint[] t4 = Nat256.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + Curve25519Field.Square(Z1.x, S2); + + U2 = t2; + Curve25519Field.Multiply(S2, X2.x, U2); + + Curve25519Field.Multiply(S2, Z1.x, S2); + Curve25519Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + Curve25519Field.Square(Z2.x, S1); + + U1 = tt1; + Curve25519Field.Multiply(S1, X1.x, U1); + + Curve25519Field.Multiply(S1, Z2.x, S1); + Curve25519Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat256.Create(); + Curve25519Field.Subtract(U1, U2, H); + + uint[] R = t2; + Curve25519Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat256.IsZero(H)) + { + if (Nat256.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = Nat256.Create(); + Curve25519Field.Square(H, HSquared); + + uint[] G = Nat256.Create(); + Curve25519Field.Multiply(HSquared, H, G); + + uint[] V = t3; + Curve25519Field.Multiply(HSquared, U1, V); + + Curve25519Field.Negate(G, G); + Nat256.Mul(S1, G, tt1); + + c = Nat256.AddBothTo(V, V, G); + Curve25519Field.Reduce27(c, G); + + Curve25519FieldElement X3 = new Curve25519FieldElement(t4); + Curve25519Field.Square(R, X3.x); + Curve25519Field.Subtract(X3.x, G, X3.x); + + Curve25519FieldElement Y3 = new Curve25519FieldElement(G); + Curve25519Field.Subtract(V, X3.x, Y3.x); + Curve25519Field.MultiplyAddToExt(Y3.x, R, tt1); + Curve25519Field.Reduce(tt1, Y3.x); + + Curve25519FieldElement Z3 = new Curve25519FieldElement(H); + if (!Z1IsOne) + { + Curve25519Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + Curve25519Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + uint[] Z3Squared = (Z1IsOne && Z2IsOne) ? HSquared : null; + + // TODO If the result will only be used in a subsequent addition, we don't need W3 + Curve25519FieldElement W3 = CalculateJacobianModifiedW((Curve25519FieldElement)Z3, Z3Squared); + + ECFieldElement[] zs = new ECFieldElement[] { Z3, W3 }; + + return new Curve25519Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + return TwiceJacobianModified(true); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return TwiceJacobianModified(false).Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + return TwiceJacobianModified(false).Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new Curve25519Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + + protected virtual Curve25519FieldElement CalculateJacobianModifiedW(Curve25519FieldElement Z, uint[] ZSquared) + { + Curve25519FieldElement a4 = (Curve25519FieldElement)this.Curve.A; + if (Z.IsOne) + return a4; + + Curve25519FieldElement W = new Curve25519FieldElement(); + if (ZSquared == null) + { + ZSquared = W.x; + Curve25519Field.Square(Z.x, ZSquared); + } + Curve25519Field.Square(ZSquared, W.x); + Curve25519Field.Multiply(W.x, a4.x, W.x); + return W; + } + + protected virtual Curve25519FieldElement GetJacobianModifiedW() + { + ECFieldElement[] ZZ = this.RawZCoords; + Curve25519FieldElement W = (Curve25519FieldElement)ZZ[1]; + if (W == null) + { + // NOTE: Rarely, TwicePlus will result in the need for a lazy W1 calculation here + ZZ[1] = W = CalculateJacobianModifiedW((Curve25519FieldElement)ZZ[0], null); + } + return W; + } + + protected virtual Curve25519Point TwiceJacobianModified(bool calculateW) + { + Curve25519FieldElement X1 = (Curve25519FieldElement)this.RawXCoord, Y1 = (Curve25519FieldElement)this.RawYCoord, + Z1 = (Curve25519FieldElement)this.RawZCoords[0], W1 = GetJacobianModifiedW(); + + uint c; + + uint[] M = Nat256.Create(); + Curve25519Field.Square(X1.x, M); + c = Nat256.AddBothTo(M, M, M); + c += Nat256.AddTo(W1.x, M); + Curve25519Field.Reduce27(c, M); + + uint[] _2Y1 = Nat256.Create(); + Curve25519Field.Twice(Y1.x, _2Y1); + + uint[] _2Y1Squared = Nat256.Create(); + Curve25519Field.Multiply(_2Y1, Y1.x, _2Y1Squared); + + uint[] S = Nat256.Create(); + Curve25519Field.Multiply(_2Y1Squared, X1.x, S); + Curve25519Field.Twice(S, S); + + uint[] _8T = Nat256.Create(); + Curve25519Field.Square(_2Y1Squared, _8T); + Curve25519Field.Twice(_8T, _8T); + + Curve25519FieldElement X3 = new Curve25519FieldElement(_2Y1Squared); + Curve25519Field.Square(M, X3.x); + Curve25519Field.Subtract(X3.x, S, X3.x); + Curve25519Field.Subtract(X3.x, S, X3.x); + + Curve25519FieldElement Y3 = new Curve25519FieldElement(S); + Curve25519Field.Subtract(S, X3.x, Y3.x); + Curve25519Field.Multiply(Y3.x, M, Y3.x); + Curve25519Field.Subtract(Y3.x, _8T, Y3.x); + + Curve25519FieldElement Z3 = new Curve25519FieldElement(_2Y1); + if (!Nat256.IsOne(Z1.x)) + { + Curve25519Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + Curve25519FieldElement W3 = null; + if (calculateW) + { + W3 = new Curve25519FieldElement(_8T); + Curve25519Field.Multiply(W3.x, W1.x, W3.x); + Curve25519Field.Twice(W3.x, W3.x); + } + + return new Curve25519Point(this.Curve, X3, Y3, new ECFieldElement[] { Z3, W3 }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Point.cs.meta new file mode 100644 index 00000000..4afbbe45 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/djb/Curve25519Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5876f88aced697149a82ac6ff3f8e27f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm.meta new file mode 100644 index 00000000..154cf3d8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 055f8fc08106e0646a52547e1a32b372 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Curve.cs new file mode 100644 index 00000000..2d463a3d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Curve.cs @@ -0,0 +1,140 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.GM +{ + internal class SM2P256V1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF")); + + private const int SM2P256V1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SM2P256V1_FE_INTS = 8; + + protected readonly SM2P256V1Point m_infinity; + + public SM2P256V1Curve() + : base(q) + { + this.m_infinity = new SM2P256V1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93"))); + this.m_order = new BigInteger(1, Hex.Decode("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123")); + this.m_cofactor = BigInteger.One; + this.m_coord = SM2P256V1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SM2P256V1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SM2P256V1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SM2P256V1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SM2P256V1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SM2P256V1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat256.Copy(((SM2P256V1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SM2P256V1_FE_INTS; + Nat256.Copy(((SM2P256V1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SM2P256V1_FE_INTS; + } + } + + return new SM2P256V1LookupTable(this, table, len); + } + + private class SM2P256V1LookupTable + : ECLookupTable + { + private readonly SM2P256V1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SM2P256V1LookupTable(SM2P256V1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat256.Create(), y = Nat256.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SM2P256V1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SM2P256V1_FE_INTS + j] & MASK; + } + + pos += (SM2P256V1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SM2P256V1FieldElement(x), new SM2P256V1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Curve.cs.meta new file mode 100644 index 00000000..895a40a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: acbfba639c7e65d4093f380a4ba84523 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Field.cs new file mode 100644 index 00000000..503a01c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Field.cs @@ -0,0 +1,311 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.GM +{ + internal class SM2P256V1Field + { + // 2^256 - 2^224 - 2^96 + 2^64 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFE }; + internal static readonly uint[] PExt = new uint[]{ 00000001, 0x00000000, 0xFFFFFFFE, 0x00000001, 0x00000001, + 0xFFFFFFFE, 0x00000000, 0x00000002, 0xFFFFFFFE, 0xFFFFFFFD, 0x00000003, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, + 0x00000000, 0xFFFFFFFE }; + internal const uint P7 = 0xFFFFFFFE; + internal const uint PExt15 = 0xFFFFFFFE; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat256.Add(x, y, z); + if (c != 0 || (z[7] >= P7 && Nat256.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(16, xx, yy, zz); + if (c != 0 || (zz[15] >= PExt15 && Nat.Gte(16, zz, PExt))) + { + Nat.SubFrom(16, PExt, zz); + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(8, x, z); + if (c != 0 || (z[7] >= P7 && Nat256.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat256.FromBigInteger(x); + if (z[7] >= P7 && Nat256.Gte(z, P)) + { + Nat256.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(8, x, 0, z); + } + else + { + uint c = Nat256.Add(x, P, z); + Nat.ShiftDownBit(8, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat256.CreateExt(); + Nat256.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat256.MulAddTo(x, y, zz); + if (c != 0 || (zz[15] >= PExt15 && Nat.Gte(16, zz, PExt))) + { + Nat.SubFrom(16, PExt, zz); + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat256.IsZero(x)) + { + Nat256.Zero(z); + } + else + { + Nat256.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + long xx08 = xx[8], xx09 = xx[9], xx10 = xx[10], xx11 = xx[11]; + long xx12 = xx[12], xx13 = xx[13], xx14 = xx[14], xx15 = xx[15]; + + long t0 = xx08 + xx09; + long t1 = xx10 + xx11; + long t2 = xx12 + xx15; + long t3 = xx13 + xx14; + long t4 = t3 + (xx15 << 1); + + long ts = t0 + t3; + long tt = t1 + t2 + ts; + + long cc = 0; + cc += (long)xx[0] + tt + xx13 + xx14 + xx15; + z[0] = (uint)cc; + cc >>= 32; + cc += (long)xx[1] + tt - xx08 + xx14 + xx15; + z[1] = (uint)cc; + cc >>= 32; + cc += (long)xx[2] - ts; + z[2] = (uint)cc; + cc >>= 32; + cc += (long)xx[3] + tt - xx09 - xx10 + xx13; + z[3] = (uint)cc; + cc >>= 32; + cc += (long)xx[4] + tt - t1 - xx08 + xx14; + z[4] = (uint)cc; + cc >>= 32; + cc += (long)xx[5] + t4 + xx10; + z[5] = (uint)cc; + cc >>= 32; + cc += (long)xx[6] + xx11 + xx14 + xx15; + z[6] = (uint)cc; + cc >>= 32; + cc += (long)xx[7] + tt + t4 + xx12; + z[7] = (uint)cc; + cc >>= 32; + + Debug.Assert(cc >= 0); + + Reduce32((uint)cc, z); + } + + public static void Reduce32(uint x, uint[] z) + { + long cc = 0; + + if (x != 0) + { + long xx08 = x; + + cc += (long)z[0] + xx08; + z[0] = (uint)cc; + cc >>= 32; + if (cc != 0) + { + cc += (long)z[1]; + z[1] = (uint)cc; + cc >>= 32; + } + cc += (long)z[2] - xx08; + z[2] = (uint)cc; + cc >>= 32; + cc += (long)z[3] + xx08; + z[3] = (uint)cc; + cc >>= 32; + if (cc != 0) + { + cc += (long)z[4]; + z[4] = (uint)cc; + cc >>= 32; + cc += (long)z[5]; + z[5] = (uint)cc; + cc >>= 32; + cc += (long)z[6]; + z[6] = (uint)cc; + cc >>= 32; + } + cc += (long)z[7] + xx08; + z[7] = (uint)cc; + cc >>= 32; + + Debug.Assert(cc == 0 || cc == 1); + } + + if (cc != 0 || (z[7] >= P7 && Nat256.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat256.CreateExt(); + Nat256.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat256.CreateExt(); + Nat256.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat256.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat256.Sub(x, y, z); + if (c != 0) + { + SubPInvFrom(z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(16, xx, yy, zz); + if (c != 0) + { + Nat.AddTo(16, PExt, zz); + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(8, x, 0, z); + if (c != 0 || (z[7] >= P7 && Nat256.Gte(z, P))) + { + AddPInvTo(z); + } + } + + private static void AddPInvTo(uint[] z) + { + long c = (long)z[0] + 1; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; + c >>= 32; + } + c += (long)z[2] - 1; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] + 1; + z[3] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5]; + z[5] = (uint)c; + c >>= 32; + c += (long)z[6]; + z[6] = (uint)c; + c >>= 32; + } + c += (long)z[7] + 1; + z[7] = (uint)c; + //c >>= 32; + } + + private static void SubPInvFrom(uint[] z) + { + long c = (long)z[0] - 1; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; + c >>= 32; + } + c += (long)z[2] + 1; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - 1; + z[3] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5]; + z[5] = (uint)c; + c >>= 32; + c += (long)z[6]; + z[6] = (uint)c; + c >>= 32; + } + c += (long)z[7] - 1; + z[7] = (uint)c; + //c >>= 32; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Field.cs.meta new file mode 100644 index 00000000..b5743fc2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b192a254f279cb545b0e25c31042094e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1FieldElement.cs new file mode 100644 index 00000000..77bd113e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1FieldElement.cs @@ -0,0 +1,215 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.GM +{ + internal class SM2P256V1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SM2P256V1Curve.q; + + protected internal readonly uint[] x; + + public SM2P256V1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SM2P256V1FieldElement", "x"); + + this.x = SM2P256V1Field.FromBigInteger(x); + } + + public SM2P256V1FieldElement() + { + this.x = Nat256.Create(); + } + + protected internal SM2P256V1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat256.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat256.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat256.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat256.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SM2P256V1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat256.Create(); + SM2P256V1Field.Add(x, ((SM2P256V1FieldElement)b).x, z); + return new SM2P256V1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat256.Create(); + SM2P256V1Field.AddOne(x, z); + return new SM2P256V1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat256.Create(); + SM2P256V1Field.Subtract(x, ((SM2P256V1FieldElement)b).x, z); + return new SM2P256V1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat256.Create(); + SM2P256V1Field.Multiply(x, ((SM2P256V1FieldElement)b).x, z); + return new SM2P256V1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat256.Create(); + Mod.Invert(SM2P256V1Field.P, ((SM2P256V1FieldElement)b).x, z); + SM2P256V1Field.Multiply(z, x, z); + return new SM2P256V1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat256.Create(); + SM2P256V1Field.Negate(x, z); + return new SM2P256V1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat256.Create(); + SM2P256V1Field.Square(x, z); + return new SM2P256V1FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new SM2P256V1FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat256.Create(); + Mod.Invert(SM2P256V1Field.P, x, z); + return new SM2P256V1FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + /* + * Raise this element to the exponent 2^254 - 2^222 - 2^94 + 2^62 + * + * Breaking up the exponent's binary representation into "repunits", we get: + * { 31 1s } { 1 0s } { 128 1s } { 31 0s } { 1 1s } { 62 0s} + * + * We use an addition chain for the beginning: [1], 2, 3, 6, 12, [24], 30, [31] + */ + + uint[] x1 = this.x; + if (Nat256.IsZero(x1) || Nat256.IsOne(x1)) + { + return this; + } + + uint[] x2 = Nat256.Create(); + SM2P256V1Field.Square(x1, x2); + SM2P256V1Field.Multiply(x2, x1, x2); + uint[] x4 = Nat256.Create(); + SM2P256V1Field.SquareN(x2, 2, x4); + SM2P256V1Field.Multiply(x4, x2, x4); + uint[] x6 = Nat256.Create(); + SM2P256V1Field.SquareN(x4, 2, x6); + SM2P256V1Field.Multiply(x6, x2, x6); + uint[] x12 = x2; + SM2P256V1Field.SquareN(x6, 6, x12); + SM2P256V1Field.Multiply(x12, x6, x12); + uint[] x24 = Nat256.Create(); + SM2P256V1Field.SquareN(x12, 12, x24); + SM2P256V1Field.Multiply(x24, x12, x24); + uint[] x30 = x12; + SM2P256V1Field.SquareN(x24, 6, x30); + SM2P256V1Field.Multiply(x30, x6, x30); + uint[] x31 = x6; + SM2P256V1Field.Square(x30, x31); + SM2P256V1Field.Multiply(x31, x1, x31); + + uint[] t1 = x24; + SM2P256V1Field.SquareN(x31, 31, t1); + + uint[] x62 = x30; + SM2P256V1Field.Multiply(t1, x31, x62); + + SM2P256V1Field.SquareN(t1, 32, t1); + SM2P256V1Field.Multiply(t1, x62, t1); + SM2P256V1Field.SquareN(t1, 62, t1); + SM2P256V1Field.Multiply(t1, x62, t1); + SM2P256V1Field.SquareN(t1, 4, t1); + SM2P256V1Field.Multiply(t1, x4, t1); + SM2P256V1Field.SquareN(t1, 32, t1); + SM2P256V1Field.Multiply(t1, x1, t1); + SM2P256V1Field.SquareN(t1, 62, t1); + + uint[] t2 = x4; + SM2P256V1Field.Square(t1, t2); + + return Nat256.Eq(x1, t2) ? new SM2P256V1FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SM2P256V1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SM2P256V1FieldElement); + } + + public virtual bool Equals(SM2P256V1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat256.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 8); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1FieldElement.cs.meta new file mode 100644 index 00000000..00c07eed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 73006e3eaec93cb44a4d004d03e84862 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Point.cs new file mode 100644 index 00000000..c2104819 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Point.cs @@ -0,0 +1,283 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.GM +{ + internal class SM2P256V1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SM2P256V1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SM2P256V1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SM2P256V1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SM2P256V1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SM2P256V1FieldElement X1 = (SM2P256V1FieldElement)this.RawXCoord, Y1 = (SM2P256V1FieldElement)this.RawYCoord; + SM2P256V1FieldElement X2 = (SM2P256V1FieldElement)b.RawXCoord, Y2 = (SM2P256V1FieldElement)b.RawYCoord; + + SM2P256V1FieldElement Z1 = (SM2P256V1FieldElement)this.RawZCoords[0]; + SM2P256V1FieldElement Z2 = (SM2P256V1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat256.CreateExt(); + uint[] t2 = Nat256.Create(); + uint[] t3 = Nat256.Create(); + uint[] t4 = Nat256.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SM2P256V1Field.Square(Z1.x, S2); + + U2 = t2; + SM2P256V1Field.Multiply(S2, X2.x, U2); + + SM2P256V1Field.Multiply(S2, Z1.x, S2); + SM2P256V1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SM2P256V1Field.Square(Z2.x, S1); + + U1 = tt1; + SM2P256V1Field.Multiply(S1, X1.x, U1); + + SM2P256V1Field.Multiply(S1, Z2.x, S1); + SM2P256V1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat256.Create(); + SM2P256V1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SM2P256V1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat256.IsZero(H)) + { + if (Nat256.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SM2P256V1Field.Square(H, HSquared); + + uint[] G = Nat256.Create(); + SM2P256V1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SM2P256V1Field.Multiply(HSquared, U1, V); + + SM2P256V1Field.Negate(G, G); + Nat256.Mul(S1, G, tt1); + + c = Nat256.AddBothTo(V, V, G); + SM2P256V1Field.Reduce32(c, G); + + SM2P256V1FieldElement X3 = new SM2P256V1FieldElement(t4); + SM2P256V1Field.Square(R, X3.x); + SM2P256V1Field.Subtract(X3.x, G, X3.x); + + SM2P256V1FieldElement Y3 = new SM2P256V1FieldElement(G); + SM2P256V1Field.Subtract(V, X3.x, Y3.x); + SM2P256V1Field.MultiplyAddToExt(Y3.x, R, tt1); + SM2P256V1Field.Reduce(tt1, Y3.x); + + SM2P256V1FieldElement Z3 = new SM2P256V1FieldElement(H); + if (!Z1IsOne) + { + SM2P256V1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SM2P256V1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; + + return new SM2P256V1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SM2P256V1FieldElement Y1 = (SM2P256V1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SM2P256V1FieldElement X1 = (SM2P256V1FieldElement)this.RawXCoord, Z1 = (SM2P256V1FieldElement)this.RawZCoords[0]; + + uint c; + uint[] t1 = Nat256.Create(); + uint[] t2 = Nat256.Create(); + + uint[] Y1Squared = Nat256.Create(); + SM2P256V1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat256.Create(); + SM2P256V1Field.Square(Y1Squared, T); + + bool Z1IsOne = Z1.IsOne; + + uint[] Z1Squared = Z1.x; + if (!Z1IsOne) + { + Z1Squared = t2; + SM2P256V1Field.Square(Z1.x, Z1Squared); + } + + SM2P256V1Field.Subtract(X1.x, Z1Squared, t1); + + uint[] M = t2; + SM2P256V1Field.Add(X1.x, Z1Squared, M); + SM2P256V1Field.Multiply(M, t1, M); + c = Nat256.AddBothTo(M, M, M); + SM2P256V1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SM2P256V1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(8, S, 2, 0); + SM2P256V1Field.Reduce32(c, S); + + c = Nat.ShiftUpBits(8, T, 3, 0, t1); + SM2P256V1Field.Reduce32(c, t1); + + SM2P256V1FieldElement X3 = new SM2P256V1FieldElement(T); + SM2P256V1Field.Square(M, X3.x); + SM2P256V1Field.Subtract(X3.x, S, X3.x); + SM2P256V1Field.Subtract(X3.x, S, X3.x); + + SM2P256V1FieldElement Y3 = new SM2P256V1FieldElement(S); + SM2P256V1Field.Subtract(S, X3.x, Y3.x); + SM2P256V1Field.Multiply(Y3.x, M, Y3.x); + SM2P256V1Field.Subtract(Y3.x, t1, Y3.x); + + SM2P256V1FieldElement Z3 = new SM2P256V1FieldElement(M); + SM2P256V1Field.Twice(Y1.x, Z3.x); + if (!Z1IsOne) + { + SM2P256V1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SM2P256V1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SM2P256V1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Point.cs.meta new file mode 100644 index 00000000..e079cf5c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/gm/SM2P256V1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7c6a52fc113d5c74a839cb2861ce100d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec.meta new file mode 100644 index 00000000..21d4c1ee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: edf4874c4cb236144b35b46e9a8037ad +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Curve.cs new file mode 100644 index 00000000..0d75ae7d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Curve.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP128R1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF")); + + private const int SECP128R1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP128R1_FE_INTS = 4; + + protected readonly SecP128R1Point m_infinity; + + public SecP128R1Curve() + : base(q) + { + this.m_infinity = new SecP128R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("E87579C11079F43DD824993C2CEE5ED3"))); + this.m_order = new BigInteger(1, Hex.Decode("FFFFFFFE0000000075A30D1B9038A115")); + this.m_cofactor = BigInteger.One; + + this.m_coord = SECP128R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP128R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP128R1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP128R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP128R1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP128R1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat128.Copy(((SecP128R1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP128R1_FE_INTS; + Nat128.Copy(((SecP128R1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP128R1_FE_INTS; + } + } + + return new SecP128R1LookupTable(this, table, len); + } + + private class SecP128R1LookupTable + : ECLookupTable + { + private readonly SecP128R1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP128R1LookupTable(SecP128R1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat128.Create(), y = Nat128.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP128R1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP128R1_FE_INTS + j] & MASK; + } + + pos += (SECP128R1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP128R1FieldElement(x), new SecP128R1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Curve.cs.meta new file mode 100644 index 00000000..5952f1dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07d11740bf1c5f949b70c6663eb822ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Field.cs new file mode 100644 index 00000000..ad4b6e17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Field.cs @@ -0,0 +1,222 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP128R1Field + { + // 2^128 - 2^97 - 1 + internal static readonly uint[] P = new uint[] { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFD }; + internal static readonly uint[] PExt = new uint[] { 0x00000001, 0x00000000, 0x00000000, 0x00000004, 0xFFFFFFFE, + 0xFFFFFFFF, 0x00000003, 0xFFFFFFFC }; + private static readonly uint[] PExtInv = new uint[]{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFB, + 0x00000001, 0x00000000, 0xFFFFFFFC, 0x00000003 }; + private const uint P3 = 0xFFFFFFFD; + private const uint PExt7 = 0xFFFFFFFC; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat128.Add(x, y, z); + if (c != 0 || (z[3] >= P3 && Nat128.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat256.Add(xx, yy, zz); + if (c != 0 || (zz[7] >= PExt7 && Nat256.Gte(zz, PExt))) + { + Nat.AddTo(PExtInv.Length, PExtInv, zz); + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(4, x, z); + if (c != 0 || (z[3] >= P3 && Nat128.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat128.FromBigInteger(x); + if (z[3] >= P3 && Nat128.Gte(z, P)) + { + Nat128.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(4, x, 0, z); + } + else + { + uint c = Nat128.Add(x, P, z); + Nat.ShiftDownBit(4, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat128.CreateExt(); + Nat128.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat128.MulAddTo(x, y, zz); + if (c != 0 || (zz[7] >= PExt7 && Nat256.Gte(zz, PExt))) + { + Nat.AddTo(PExtInv.Length, PExtInv, zz); + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat128.IsZero(x)) + { + Nat128.Zero(z); + } + else + { + Nat128.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + ulong x0 = xx[0], x1 = xx[1], x2 = xx[2], x3 = xx[3]; + ulong x4 = xx[4], x5 = xx[5], x6 = xx[6], x7 = xx[7]; + + x3 += x7; x6 += (x7 << 1); + x2 += x6; x5 += (x6 << 1); + x1 += x5; x4 += (x5 << 1); + x0 += x4; x3 += (x4 << 1); + + z[0] = (uint)x0; x1 += (x0 >> 32); + z[1] = (uint)x1; x2 += (x1 >> 32); + z[2] = (uint)x2; x3 += (x2 >> 32); + z[3] = (uint)x3; + + Reduce32((uint)(x3 >> 32), z); + } + + public static void Reduce32(uint x, uint[] z) + { + while (x != 0) + { + ulong c, x4 = x; + + c = (ulong)z[0] + x4; + z[0] = (uint)c; c >>= 32; + if (c != 0) + { + c += (ulong)z[1]; + z[1] = (uint)c; c >>= 32; + c += (ulong)z[2]; + z[2] = (uint)c; c >>= 32; + } + c += (ulong)z[3] + (x4 << 1); + z[3] = (uint)c; c >>= 32; + + Debug.Assert(c >= 0 && c <= 2); + + x = (uint)c; + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat128.CreateExt(); + Nat128.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat128.CreateExt(); + Nat128.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat128.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat128.Sub(x, y, z); + if (c != 0) + { + SubPInvFrom(z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(10, xx, yy, zz); + if (c != 0) + { + Nat.SubFrom(PExtInv.Length, PExtInv, zz); + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(4, x, 0, z); + if (c != 0 || (z[3] >= P3 && Nat128.Gte(z, P))) + { + AddPInvTo(z); + } + } + + private static void AddPInvTo(uint[] z) + { + long c = (long)z[0] + 1; + z[0] = (uint)c; c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; c >>= 32; + c += (long)z[2]; + z[2] = (uint)c; c >>= 32; + } + c += (long)z[3] + 2; + z[3] = (uint)c; + } + + private static void SubPInvFrom(uint[] z) + { + long c = (long)z[0] - 1; + z[0] = (uint)c; c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; c >>= 32; + c += (long)z[2]; + z[2] = (uint)c; c >>= 32; + } + c += (long)z[3] - 2; + z[3] = (uint)c; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Field.cs.meta new file mode 100644 index 00000000..e7c0f71f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f9d092c55e0cd03418fa2b044ec88ff3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1FieldElement.cs new file mode 100644 index 00000000..3f18a543 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1FieldElement.cs @@ -0,0 +1,202 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP128R1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP128R1Curve.q; + + protected internal readonly uint[] x; + + public SecP128R1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP128R1FieldElement", "x"); + + this.x = SecP128R1Field.FromBigInteger(x); + } + + public SecP128R1FieldElement() + { + this.x = Nat128.Create(); + } + + protected internal SecP128R1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat128.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat128.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat128.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat128.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SecP128R1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat128.Create(); + SecP128R1Field.Add(x, ((SecP128R1FieldElement)b).x, z); + return new SecP128R1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat128.Create(); + SecP128R1Field.AddOne(x, z); + return new SecP128R1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat128.Create(); + SecP128R1Field.Subtract(x, ((SecP128R1FieldElement)b).x, z); + return new SecP128R1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat128.Create(); + SecP128R1Field.Multiply(x, ((SecP128R1FieldElement)b).x, z); + return new SecP128R1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + // return multiply(b.invert()); + uint[] z = Nat128.Create(); + Mod.Invert(SecP128R1Field.P, ((SecP128R1FieldElement)b).x, z); + SecP128R1Field.Multiply(z, x, z); + return new SecP128R1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat128.Create(); + SecP128R1Field.Negate(x, z); + return new SecP128R1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat128.Create(); + SecP128R1Field.Square(x, z); + return new SecP128R1FieldElement(z); + } + + public override ECFieldElement Invert() + { + // return new SecP128R1FieldElement(toBigInteger().modInverse(Q)); + uint[] z = Nat128.Create(); + Mod.Invert(SecP128R1Field.P, x, z); + return new SecP128R1FieldElement(z); + } + + // D.1.4 91 + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + /* + * Raise this element to the exponent 2^126 - 2^95 + * + * Breaking up the exponent's binary representation into "repunits", we get: + * { 31 1s } { 95 0s } + * + * Therefore we need an addition chain containing 31 (the length of the repunit) We use: + * 1, 2, 4, 8, 10, 20, 30, [31] + */ + + uint[] x1 = this.x; + if (Nat128.IsZero(x1) || Nat128.IsOne(x1)) + return this; + + uint[] x2 = Nat128.Create(); + SecP128R1Field.Square(x1, x2); + SecP128R1Field.Multiply(x2, x1, x2); + uint[] x4 = Nat128.Create(); + SecP128R1Field.SquareN(x2, 2, x4); + SecP128R1Field.Multiply(x4, x2, x4); + uint[] x8 = Nat128.Create(); + SecP128R1Field.SquareN(x4, 4, x8); + SecP128R1Field.Multiply(x8, x4, x8); + uint[] x10 = x4; + SecP128R1Field.SquareN(x8, 2, x10); + SecP128R1Field.Multiply(x10, x2, x10); + uint[] x20 = x2; + SecP128R1Field.SquareN(x10, 10, x20); + SecP128R1Field.Multiply(x20, x10, x20); + uint[] x30 = x8; + SecP128R1Field.SquareN(x20, 10, x30); + SecP128R1Field.Multiply(x30, x10, x30); + uint[] x31 = x10; + SecP128R1Field.Square(x30, x31); + SecP128R1Field.Multiply(x31, x1, x31); + + uint[] t1 = x31; + SecP128R1Field.SquareN(t1, 95, t1); + + uint[] t2 = x30; + SecP128R1Field.Square(t1, t2); + + return Nat128.Eq(x1, t2) ? new SecP128R1FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP128R1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP128R1FieldElement); + } + + public virtual bool Equals(SecP128R1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat128.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 4); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1FieldElement.cs.meta new file mode 100644 index 00000000..abd571af --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f1b6f52fadd8950438dcf90df281b600 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Point.cs new file mode 100644 index 00000000..932c1e74 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Point.cs @@ -0,0 +1,283 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP128R1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecP128R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(boolean)} + */ + public SecP128R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP128R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP128R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP128R1FieldElement X1 = (SecP128R1FieldElement)this.RawXCoord, Y1 = (SecP128R1FieldElement)this.RawYCoord; + SecP128R1FieldElement X2 = (SecP128R1FieldElement)b.RawXCoord, Y2 = (SecP128R1FieldElement)b.RawYCoord; + + SecP128R1FieldElement Z1 = (SecP128R1FieldElement)this.RawZCoords[0]; + SecP128R1FieldElement Z2 = (SecP128R1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat128.CreateExt(); + uint[] t2 = Nat128.Create(); + uint[] t3 = Nat128.Create(); + uint[] t4 = Nat128.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP128R1Field.Square(Z1.x, S2); + + U2 = t2; + SecP128R1Field.Multiply(S2, X2.x, U2); + + SecP128R1Field.Multiply(S2, Z1.x, S2); + SecP128R1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP128R1Field.Square(Z2.x, S1); + + U1 = tt1; + SecP128R1Field.Multiply(S1, X1.x, U1); + + SecP128R1Field.Multiply(S1, Z2.x, S1); + SecP128R1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat128.Create(); + SecP128R1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP128R1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat128.IsZero(H)) + { + if (Nat128.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP128R1Field.Square(H, HSquared); + + uint[] G = Nat128.Create(); + SecP128R1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP128R1Field.Multiply(HSquared, U1, V); + + SecP128R1Field.Negate(G, G); + Nat128.Mul(S1, G, tt1); + + c = Nat128.AddBothTo(V, V, G); + SecP128R1Field.Reduce32(c, G); + + SecP128R1FieldElement X3 = new SecP128R1FieldElement(t4); + SecP128R1Field.Square(R, X3.x); + SecP128R1Field.Subtract(X3.x, G, X3.x); + + SecP128R1FieldElement Y3 = new SecP128R1FieldElement(G); + SecP128R1Field.Subtract(V, X3.x, Y3.x); + SecP128R1Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP128R1Field.Reduce(tt1, Y3.x); + + SecP128R1FieldElement Z3 = new SecP128R1FieldElement(H); + if (!Z1IsOne) + { + SecP128R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP128R1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; + + return new SecP128R1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP128R1FieldElement Y1 = (SecP128R1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP128R1FieldElement X1 = (SecP128R1FieldElement)this.RawXCoord, Z1 = (SecP128R1FieldElement)this.RawZCoords[0]; + + uint c; + uint[] t1 = Nat128.Create(); + uint[] t2 = Nat128.Create(); + + uint[] Y1Squared = Nat128.Create(); + SecP128R1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat128.Create(); + SecP128R1Field.Square(Y1Squared, T); + + bool Z1IsOne = Z1.IsOne; + + uint[] Z1Squared = Z1.x; + if (!Z1IsOne) + { + Z1Squared = t2; + SecP128R1Field.Square(Z1.x, Z1Squared); + } + + SecP128R1Field.Subtract(X1.x, Z1Squared, t1); + + uint[] M = t2; + SecP128R1Field.Add(X1.x, Z1Squared, M); + SecP128R1Field.Multiply(M, t1, M); + c = Nat128.AddBothTo(M, M, M); + SecP128R1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP128R1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(4, S, 2, 0); + SecP128R1Field.Reduce32(c, S); + + c = Nat.ShiftUpBits(4, T, 3, 0, t1); + SecP128R1Field.Reduce32(c, t1); + + SecP128R1FieldElement X3 = new SecP128R1FieldElement(T); + SecP128R1Field.Square(M, X3.x); + SecP128R1Field.Subtract(X3.x, S, X3.x); + SecP128R1Field.Subtract(X3.x, S, X3.x); + + SecP128R1FieldElement Y3 = new SecP128R1FieldElement(S); + SecP128R1Field.Subtract(S, X3.x, Y3.x); + SecP128R1Field.Multiply(Y3.x, M, Y3.x); + SecP128R1Field.Subtract(Y3.x, t1, Y3.x); + + SecP128R1FieldElement Z3 = new SecP128R1FieldElement(M); + SecP128R1Field.Twice(Y1.x, Z3.x); + if (!Z1IsOne) + { + SecP128R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP128R1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between twicePlus and threeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP128R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Point.cs.meta new file mode 100644 index 00000000..18a7bf89 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP128R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b719fcfaca4697a499481a1ec81e4e74 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Curve.cs new file mode 100644 index 00000000..51ef1aa6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Curve.cs @@ -0,0 +1,137 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160K1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = SecP160R2Curve.q; + + private const int SECP160K1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP160K1_FE_INTS = 5; + + protected readonly SecP160K1Point m_infinity; + + public SecP160K1Curve() + : base(q) + { + this.m_infinity = new SecP160K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.Zero); + this.m_b = FromBigInteger(BigInteger.ValueOf(7)); + this.m_order = new BigInteger(1, Hex.Decode("0100000000000000000001B8FA16DFAB9ACA16B6B3")); + this.m_cofactor = BigInteger.One; + this.m_coord = SECP160K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP160K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP160R2FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP160K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP160K1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP160K1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat160.Copy(((SecP160R2FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP160K1_FE_INTS; + Nat160.Copy(((SecP160R2FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP160K1_FE_INTS; + } + } + + return new SecP160K1LookupTable(this, table, len); + } + + private class SecP160K1LookupTable + : ECLookupTable + { + private readonly SecP160K1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP160K1LookupTable(SecP160K1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat256.Create(), y = Nat256.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP160K1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP160K1_FE_INTS + j] & MASK; + } + + pos += (SECP160K1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP160R2FieldElement(x), new SecP160R2FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Curve.cs.meta new file mode 100644 index 00000000..4e94332f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1150199688daf104cb227e8776202137 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Point.cs new file mode 100644 index 00000000..7fe95c79 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Point.cs @@ -0,0 +1,273 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160K1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.CreatePoint to construct points + */ + public SecP160K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP160K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP160K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, + bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP160K1Point(null, AffineXCoord, AffineYCoord); + } + + // B.3 pg 62 + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP160R2FieldElement X1 = (SecP160R2FieldElement)this.RawXCoord, Y1 = (SecP160R2FieldElement)this.RawYCoord; + SecP160R2FieldElement X2 = (SecP160R2FieldElement)b.RawXCoord, Y2 = (SecP160R2FieldElement)b.RawYCoord; + + SecP160R2FieldElement Z1 = (SecP160R2FieldElement)this.RawZCoords[0]; + SecP160R2FieldElement Z2 = (SecP160R2FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat160.CreateExt(); + uint[] t2 = Nat160.Create(); + uint[] t3 = Nat160.Create(); + uint[] t4 = Nat160.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP160R2Field.Square(Z1.x, S2); + + U2 = t2; + SecP160R2Field.Multiply(S2, X2.x, U2); + + SecP160R2Field.Multiply(S2, Z1.x, S2); + SecP160R2Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP160R2Field.Square(Z2.x, S1); + + U1 = tt1; + SecP160R2Field.Multiply(S1, X1.x, U1); + + SecP160R2Field.Multiply(S1, Z2.x, S1); + SecP160R2Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat160.Create(); + SecP160R2Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP160R2Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat160.IsZero(H)) + { + if (Nat160.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP160R2Field.Square(H, HSquared); + + uint[] G = Nat160.Create(); + SecP160R2Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP160R2Field.Multiply(HSquared, U1, V); + + SecP160R2Field.Negate(G, G); + Nat160.Mul(S1, G, tt1); + + c = Nat160.AddBothTo(V, V, G); + SecP160R2Field.Reduce32(c, G); + + SecP160R2FieldElement X3 = new SecP160R2FieldElement(t4); + SecP160R2Field.Square(R, X3.x); + SecP160R2Field.Subtract(X3.x, G, X3.x); + + SecP160R2FieldElement Y3 = new SecP160R2FieldElement(G); + SecP160R2Field.Subtract(V, X3.x, Y3.x); + SecP160R2Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP160R2Field.Reduce(tt1, Y3.x); + + SecP160R2FieldElement Z3 = new SecP160R2FieldElement(H); + if (!Z1IsOne) + { + SecP160R2Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP160R2Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[] { Z3 }; + + return new SecP160K1Point(curve, X3, Y3, zs, IsCompressed); + } + + // B.3 pg 62 + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP160R2FieldElement Y1 = (SecP160R2FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP160R2FieldElement X1 = (SecP160R2FieldElement)this.RawXCoord, Z1 = (SecP160R2FieldElement)this.RawZCoords[0]; + + uint c; + + uint[] Y1Squared = Nat160.Create(); + SecP160R2Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat160.Create(); + SecP160R2Field.Square(Y1Squared, T); + + uint[] M = Nat160.Create(); + SecP160R2Field.Square(X1.x, M); + c = Nat160.AddBothTo(M, M, M); + SecP160R2Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP160R2Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(5, S, 2, 0); + SecP160R2Field.Reduce32(c, S); + + uint[] t1 = Nat160.Create(); + c = Nat.ShiftUpBits(5, T, 3, 0, t1); + SecP160R2Field.Reduce32(c, t1); + + SecP160R2FieldElement X3 = new SecP160R2FieldElement(T); + SecP160R2Field.Square(M, X3.x); + SecP160R2Field.Subtract(X3.x, S, X3.x); + SecP160R2Field.Subtract(X3.x, S, X3.x); + + SecP160R2FieldElement Y3 = new SecP160R2FieldElement(S); + SecP160R2Field.Subtract(S, X3.x, Y3.x); + SecP160R2Field.Multiply(Y3.x, M, Y3.x); + SecP160R2Field.Subtract(Y3.x, t1, Y3.x); + + SecP160R2FieldElement Z3 = new SecP160R2FieldElement(M); + SecP160R2Field.Twice(Y1.x, Z3.x); + if (!Z1.IsOne) + { + SecP160R2Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP160K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and threeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP160K1Point(Curve, this.RawXCoord, this.RawYCoord.Negate(), this.RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Point.cs.meta new file mode 100644 index 00000000..724446b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5e8be84848d57df40bf9d4558a98c6e7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Curve.cs new file mode 100644 index 00000000..66c9435c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Curve.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160R1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF")); + + private const int SECP160R1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP160R1_FE_INTS = 5; + + protected readonly SecP160R1Point m_infinity; + + public SecP160R1Curve() + : base(q) + { + this.m_infinity = new SecP160R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"))); + this.m_order = new BigInteger(1, Hex.Decode("0100000000000000000001F4C8F927AED3CA752257")); + this.m_cofactor = BigInteger.One; + + this.m_coord = SECP160R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP160R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP160R1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP160R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP160R1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP160R1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat160.Copy(((SecP160R1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP160R1_FE_INTS; + Nat160.Copy(((SecP160R1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP160R1_FE_INTS; + } + } + + return new SecP160R1LookupTable(this, table, len); + } + + private class SecP160R1LookupTable + : ECLookupTable + { + private readonly SecP160R1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP160R1LookupTable(SecP160R1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat160.Create(), y = Nat160.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP160R1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP160R1_FE_INTS + j] & MASK; + } + + pos += (SECP160R1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP160R1FieldElement(x), new SecP160R1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Curve.cs.meta new file mode 100644 index 00000000..02c3c690 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab70ddacc717f914998f8131af159ac2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Field.cs new file mode 100644 index 00000000..da619080 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Field.cs @@ -0,0 +1,190 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160R1Field + { + // 2^160 - 2^31 - 1 + internal static readonly uint[] P = new uint[] { 0x7FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}; + internal static readonly uint[] PExt = new uint[] { 0x00000001, 0x40000001, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFE, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + private static readonly uint[] PExtInv = new uint[]{ 0xFFFFFFFF, 0xBFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0x00000001, 0x00000001 }; + private const uint P4 = 0xFFFFFFFF; + private const uint PExt9 = 0xFFFFFFFF; + private const uint PInv = 0x80000001; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat160.Add(x, y, z); + if (c != 0 || (z[4] == P4 && Nat160.Gte(z, P))) + { + Nat.AddWordTo(5, PInv, z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(10, xx, yy, zz); + if (c != 0 || (zz[9] == PExt9 && Nat.Gte(10, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(10, zz, PExtInv.Length); + } + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(5, x, z); + if (c != 0 || (z[4] == P4 && Nat160.Gte(z, P))) + { + Nat.AddWordTo(5, PInv, z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat160.FromBigInteger(x); + if (z[4] == P4 && Nat160.Gte(z, P)) + { + Nat160.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(5, x, 0, z); + } + else + { + uint c = Nat160.Add(x, P, z); + Nat.ShiftDownBit(5, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat160.CreateExt(); + Nat160.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat160.MulAddTo(x, y, zz); + if (c != 0 || (zz[9] == PExt9 && Nat.Gte(10, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(10, zz, PExtInv.Length); + } + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat160.IsZero(x)) + { + Nat160.Zero(z); + } + else + { + Nat160.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + ulong x5 = xx[5], x6 = xx[6], x7 = xx[7], x8 = xx[8], x9 = xx[9]; + + ulong c = 0; + c += (ulong)xx[0] + x5 + (x5 << 31); + z[0] = (uint)c; c >>= 32; + c += (ulong)xx[1] + x6 + (x6 << 31); + z[1] = (uint)c; c >>= 32; + c += (ulong)xx[2] + x7 + (x7 << 31); + z[2] = (uint)c; c >>= 32; + c += (ulong)xx[3] + x8 + (x8 << 31); + z[3] = (uint)c; c >>= 32; + c += (ulong)xx[4] + x9 + (x9 << 31); + z[4] = (uint)c; c >>= 32; + + Debug.Assert(c >> 32 == 0); + + Reduce32((uint)c, z); + } + + public static void Reduce32(uint x, uint[] z) + { + if ((x != 0 && Nat160.MulWordsAdd(PInv, x, z, 0) != 0) + || (z[4] == P4 && Nat160.Gte(z, P))) + { + Nat.AddWordTo(5, PInv, z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat160.CreateExt(); + Nat160.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat160.CreateExt(); + Nat160.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat160.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat160.Sub(x, y, z); + if (c != 0) + { + Nat.SubWordFrom(5, PInv, z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(10, xx, yy, zz); + if (c != 0) + { + if (Nat.SubFrom(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.DecAt(10, zz, PExtInv.Length); + } + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(5, x, 0, z); + if (c != 0 || (z[4] == P4 && Nat160.Gte(z, P))) + { + Nat.AddWordTo(5, PInv, z); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Field.cs.meta new file mode 100644 index 00000000..1e2ff512 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d444683aade1525409d6f03a80cd747c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1FieldElement.cs new file mode 100644 index 00000000..3fdbf231 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1FieldElement.cs @@ -0,0 +1,207 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160R1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP160R1Curve.q; + + protected internal readonly uint[] x; + + public SecP160R1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP160R1FieldElement", "x"); + + this.x = SecP160R1Field.FromBigInteger(x); + } + + public SecP160R1FieldElement() + { + this.x = Nat160.Create(); + } + + protected internal SecP160R1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat160.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat160.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat160.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat160.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SecP160R1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat160.Create(); + SecP160R1Field.Add(x, ((SecP160R1FieldElement)b).x, z); + return new SecP160R1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat160.Create(); + SecP160R1Field.AddOne(x, z); + return new SecP160R1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat160.Create(); + SecP160R1Field.Subtract(x, ((SecP160R1FieldElement)b).x, z); + return new SecP160R1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat160.Create(); + SecP160R1Field.Multiply(x, ((SecP160R1FieldElement)b).x, z); + return new SecP160R1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + // return multiply(b.invert()); + uint[] z = Nat160.Create(); + Mod.Invert(SecP160R1Field.P, ((SecP160R1FieldElement)b).x, z); + SecP160R1Field.Multiply(z, x, z); + return new SecP160R1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat160.Create(); + SecP160R1Field.Negate(x, z); + return new SecP160R1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat160.Create(); + SecP160R1Field.Square(x, z); + return new SecP160R1FieldElement(z); + } + + public override ECFieldElement Invert() + { + // return new SecP160R1FieldElement(ToBigInteger().modInverse(Q)); + uint[] z = Nat160.Create(); + Mod.Invert(SecP160R1Field.P, x, z); + return new SecP160R1FieldElement(z); + } + + // D.1.4 91 + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + /* + * Raise this element to the exponent 2^158 - 2^29 + * + * Breaking up the exponent's binary representation into "repunits", we get: + * { 129 1s } { 29 0s } + * + * Therefore we need an addition chain containing 129 (the length of the repunit) We use: + * 1, 2, 4, 8, 16, 32, 64, 128, [129] + */ + + uint[] x1 = this.x; + if (Nat160.IsZero(x1) || Nat160.IsOne(x1)) + { + return this; + } + + uint[] x2 = Nat160.Create(); + SecP160R1Field.Square(x1, x2); + SecP160R1Field.Multiply(x2, x1, x2); + uint[] x4 = Nat160.Create(); + SecP160R1Field.SquareN(x2, 2, x4); + SecP160R1Field.Multiply(x4, x2, x4); + uint[] x8 = x2; + SecP160R1Field.SquareN(x4, 4, x8); + SecP160R1Field.Multiply(x8, x4, x8); + uint[] x16 = x4; + SecP160R1Field.SquareN(x8, 8, x16); + SecP160R1Field.Multiply(x16, x8, x16); + uint[] x32 = x8; + SecP160R1Field.SquareN(x16, 16, x32); + SecP160R1Field.Multiply(x32, x16, x32); + uint[] x64 = x16; + SecP160R1Field.SquareN(x32, 32, x64); + SecP160R1Field.Multiply(x64, x32, x64); + uint[] x128 = x32; + SecP160R1Field.SquareN(x64, 64, x128); + SecP160R1Field.Multiply(x128, x64, x128); + uint[] x129 = x64; + SecP160R1Field.Square(x128, x129); + SecP160R1Field.Multiply(x129, x1, x129); + + uint[] t1 = x129; + SecP160R1Field.SquareN(t1, 29, t1); + + uint[] t2 = x128; + SecP160R1Field.Square(t1, t2); + + return Nat160.Eq(x1, t2) ? new SecP160R1FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP160R1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP160R1FieldElement); + } + + public virtual bool Equals(SecP160R1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat160.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 5); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1FieldElement.cs.meta new file mode 100644 index 00000000..a44741f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 07c4fed00202a584c88533f83236ec32 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Point.cs new file mode 100644 index 00000000..bfd7a599 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Point.cs @@ -0,0 +1,283 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160R1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.CreatePoint to construct points + */ + public SecP160R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP160R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP160R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP160R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP160R1FieldElement X1 = (SecP160R1FieldElement)this.RawXCoord, Y1 = (SecP160R1FieldElement)this.RawYCoord; + SecP160R1FieldElement X2 = (SecP160R1FieldElement)b.RawXCoord, Y2 = (SecP160R1FieldElement)b.RawYCoord; + + SecP160R1FieldElement Z1 = (SecP160R1FieldElement)this.RawZCoords[0]; + SecP160R1FieldElement Z2 = (SecP160R1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat160.CreateExt(); + uint[] t2 = Nat160.Create(); + uint[] t3 = Nat160.Create(); + uint[] t4 = Nat160.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP160R1Field.Square(Z1.x, S2); + + U2 = t2; + SecP160R1Field.Multiply(S2, X2.x, U2); + + SecP160R1Field.Multiply(S2, Z1.x, S2); + SecP160R1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP160R1Field.Square(Z2.x, S1); + + U1 = tt1; + SecP160R1Field.Multiply(S1, X1.x, U1); + + SecP160R1Field.Multiply(S1, Z2.x, S1); + SecP160R1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat160.Create(); + SecP160R1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP160R1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat160.IsZero(H)) + { + if (Nat160.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP160R1Field.Square(H, HSquared); + + uint[] G = Nat160.Create(); + SecP160R1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP160R1Field.Multiply(HSquared, U1, V); + + SecP160R1Field.Negate(G, G); + Nat160.Mul(S1, G, tt1); + + c = Nat160.AddBothTo(V, V, G); + SecP160R1Field.Reduce32(c, G); + + SecP160R1FieldElement X3 = new SecP160R1FieldElement(t4); + SecP160R1Field.Square(R, X3.x); + SecP160R1Field.Subtract(X3.x, G, X3.x); + + SecP160R1FieldElement Y3 = new SecP160R1FieldElement(G); + SecP160R1Field.Subtract(V, X3.x, Y3.x); + SecP160R1Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP160R1Field.Reduce(tt1, Y3.x); + + SecP160R1FieldElement Z3 = new SecP160R1FieldElement(H); + if (!Z1IsOne) + { + SecP160R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP160R1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; + + return new SecP160R1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP160R1FieldElement Y1 = (SecP160R1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP160R1FieldElement X1 = (SecP160R1FieldElement)this.RawXCoord, Z1 = (SecP160R1FieldElement)this.RawZCoords[0]; + + uint c; + uint[] t1 = Nat160.Create(); + uint[] t2 = Nat160.Create(); + + uint[] Y1Squared = Nat160.Create(); + SecP160R1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat160.Create(); + SecP160R1Field.Square(Y1Squared, T); + + bool Z1IsOne = Z1.IsOne; + + uint[] Z1Squared = Z1.x; + if (!Z1IsOne) + { + Z1Squared = t2; + SecP160R1Field.Square(Z1.x, Z1Squared); + } + + SecP160R1Field.Subtract(X1.x, Z1Squared, t1); + + uint[] M = t2; + SecP160R1Field.Add(X1.x, Z1Squared, M); + SecP160R1Field.Multiply(M, t1, M); + c = Nat160.AddBothTo(M, M, M); + SecP160R1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP160R1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(5, S, 2, 0); + SecP160R1Field.Reduce32(c, S); + + c = Nat.ShiftUpBits(5, T, 3, 0, t1); + SecP160R1Field.Reduce32(c, t1); + + SecP160R1FieldElement X3 = new SecP160R1FieldElement(T); + SecP160R1Field.Square(M, X3.x); + SecP160R1Field.Subtract(X3.x, S, X3.x); + SecP160R1Field.Subtract(X3.x, S, X3.x); + + SecP160R1FieldElement Y3 = new SecP160R1FieldElement(S); + SecP160R1Field.Subtract(S, X3.x, Y3.x); + SecP160R1Field.Multiply(Y3.x, M, Y3.x); + SecP160R1Field.Subtract(Y3.x, t1, Y3.x); + + SecP160R1FieldElement Z3 = new SecP160R1FieldElement(M); + SecP160R1Field.Twice(Y1.x, Z3.x); + if (!Z1IsOne) + { + SecP160R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP160R1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP160R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Point.cs.meta new file mode 100644 index 00000000..dcfbeffb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48035112039046c41b2a437840a8014d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Curve.cs new file mode 100644 index 00000000..5fcdf586 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Curve.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160R2Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73")); + + private const int SECP160R2_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP160R2_FE_INTS = 5; + + protected readonly SecP160R2Point m_infinity; + + public SecP160R2Curve() + : base(q) + { + this.m_infinity = new SecP160R2Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("B4E134D3FB59EB8BAB57274904664D5AF50388BA"))); + this.m_order = new BigInteger(1, Hex.Decode("0100000000000000000000351EE786A818F3A1A16B")); + this.m_cofactor = BigInteger.One; + + this.m_coord = SECP160R2_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP160R2Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP160R2FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP160R2Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP160R2Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP160R2_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat160.Copy(((SecP160R2FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP160R2_FE_INTS; + Nat160.Copy(((SecP160R2FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP160R2_FE_INTS; + } + } + + return new SecP160R2LookupTable(this, table, len); + } + + private class SecP160R2LookupTable + : ECLookupTable + { + private readonly SecP160R2Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP160R2LookupTable(SecP160R2Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat160.Create(), y = Nat160.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP160R2_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP160R2_FE_INTS + j] & MASK; + } + + pos += (SECP160R2_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP160R2FieldElement(x), new SecP160R2FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Curve.cs.meta new file mode 100644 index 00000000..9710d0cd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d36a6056a9fa51946b70dd3977edfb28 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Field.cs new file mode 100644 index 00000000..c11dd7b3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Field.cs @@ -0,0 +1,182 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160R2Field + { + // 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFAC73, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + internal static readonly uint[] PExt = new uint[]{ 0x1B44BBA9, 0x0000A71A, 0x00000001, 0x00000000, 0x00000000, + 0xFFFF58E6, 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + private static readonly uint[] PExtInv = new uint[]{ 0xE4BB4457, 0xFFFF58E5, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, + 0x0000A719, 0x00000002 }; + private const uint P4 = 0xFFFFFFFF; + private const uint PExt9 = 0xFFFFFFFF; + private const uint PInv33 = 0x538D; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat160.Add(x, y, z); + if (c != 0 || (z[4] == P4 && Nat160.Gte(z, P))) + { + Nat.Add33To(5, PInv33, z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(10, xx, yy, zz); + if (c != 0 || (zz[9] == PExt9 && Nat.Gte(10, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(10, zz, PExtInv.Length); + } + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(5, x, z); + if (c != 0 || (z[4] == P4 && Nat160.Gte(z, P))) + { + Nat.Add33To(5, PInv33, z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat160.FromBigInteger(x); + if (z[4] == P4 && Nat160.Gte(z, P)) + { + Nat160.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(5, x, 0, z); + } + else + { + uint c = Nat160.Add(x, P, z); + Nat.ShiftDownBit(5, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat160.CreateExt(); + Nat160.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat160.MulAddTo(x, y, zz); + if (c != 0 || (zz[9] == PExt9 && Nat.Gte(10, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(10, zz, PExtInv.Length); + } + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat160.IsZero(x)) + { + Nat160.Zero(z); + } + else + { + Nat160.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + ulong cc = Nat160.Mul33Add(PInv33, xx, 5, xx, 0, z, 0); + uint c = Nat160.Mul33DWordAdd(PInv33, cc, z, 0); + + Debug.Assert(c == 0 || c == 1); + + if (c != 0 || (z[4] == P4 && Nat160.Gte(z, P))) + { + Nat.Add33To(5, PInv33, z); + } + } + + public static void Reduce32(uint x, uint[] z) + { + if ((x != 0 && Nat160.Mul33WordAdd(PInv33, x, z, 0) != 0) + || (z[4] == P4 && Nat160.Gte(z, P))) + { + Nat.Add33To(5, PInv33, z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat160.CreateExt(); + Nat160.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat160.CreateExt(); + Nat160.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat160.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat160.Sub(x, y, z); + if (c != 0) + { + Nat.Sub33From(5, PInv33, z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(10, xx, yy, zz); + if (c != 0) + { + if (Nat.SubFrom(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.DecAt(10, zz, PExtInv.Length); + } + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(5, x, 0, z); + if (c != 0 || (z[4] == P4 && Nat160.Gte(z, P))) + { + Nat.Add33To(5, PInv33, z); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Field.cs.meta new file mode 100644 index 00000000..344bf7ce --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e351f45b5e75bb149baf02e11f068f33 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2FieldElement.cs new file mode 100644 index 00000000..1f9e9742 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2FieldElement.cs @@ -0,0 +1,222 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160R2FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP160R2Curve.q; + + protected internal readonly uint[] x; + + public SecP160R2FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP160R2FieldElement", "x"); + + this.x = SecP160R2Field.FromBigInteger(x); + } + + public SecP160R2FieldElement() + { + this.x = Nat160.Create(); + } + + protected internal SecP160R2FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat160.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat160.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat160.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat160.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SecP160R2Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat160.Create(); + SecP160R2Field.Add(x, ((SecP160R2FieldElement)b).x, z); + return new SecP160R2FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat160.Create(); + SecP160R2Field.AddOne(x, z); + return new SecP160R2FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat160.Create(); + SecP160R2Field.Subtract(x, ((SecP160R2FieldElement)b).x, z); + return new SecP160R2FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat160.Create(); + SecP160R2Field.Multiply(x, ((SecP160R2FieldElement)b).x, z); + return new SecP160R2FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + // return Multiply(b.invert()); + uint[] z = Nat160.Create(); + Mod.Invert(SecP160R2Field.P, ((SecP160R2FieldElement)b).x, z); + SecP160R2Field.Multiply(z, x, z); + return new SecP160R2FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat160.Create(); + SecP160R2Field.Negate(x, z); + return new SecP160R2FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat160.Create(); + SecP160R2Field.Square(x, z); + return new SecP160R2FieldElement(z); + } + + public override ECFieldElement Invert() + { + // return new SecP160R2FieldElement(ToBigInteger().modInverse(Q)); + uint[] z = Nat160.Create(); + Mod.Invert(SecP160R2Field.P, x, z); + return new SecP160R2FieldElement(z); + } + + // D.1.4 91 + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + /* + * Raise this element to the exponent 2^158 - 2^30 - 2^12 - 2^10 - 2^7 - 2^6 - 2^5 - 2^1 - 2^0 + * + * Breaking up the exponent's binary representation into "repunits", we get: { 127 1s } { 1 + * 0s } { 17 1s } { 1 0s } { 1 1s } { 1 0s } { 2 1s } { 3 0s } { 3 1s } { 1 0s } { 1 1s } + * + * Therefore we need an Addition chain containing 1, 2, 3, 17, 127 (the lengths of the repunits) + * We use: [1], [2], [3], 4, 7, 14, [17], 31, 62, 124, [127] + */ + + uint[] x1 = this.x; + if (Nat160.IsZero(x1) || Nat160.IsOne(x1)) + { + return this; + } + + uint[] x2 = Nat160.Create(); + SecP160R2Field.Square(x1, x2); + SecP160R2Field.Multiply(x2, x1, x2); + uint[] x3 = Nat160.Create(); + SecP160R2Field.Square(x2, x3); + SecP160R2Field.Multiply(x3, x1, x3); + uint[] x4 = Nat160.Create(); + SecP160R2Field.Square(x3, x4); + SecP160R2Field.Multiply(x4, x1, x4); + uint[] x7 = Nat160.Create(); + SecP160R2Field.SquareN(x4, 3, x7); + SecP160R2Field.Multiply(x7, x3, x7); + uint[] x14 = x4; + SecP160R2Field.SquareN(x7, 7, x14); + SecP160R2Field.Multiply(x14, x7, x14); + uint[] x17 = x7; + SecP160R2Field.SquareN(x14, 3, x17); + SecP160R2Field.Multiply(x17, x3, x17); + uint[] x31 = Nat160.Create(); + SecP160R2Field.SquareN(x17, 14, x31); + SecP160R2Field.Multiply(x31, x14, x31); + uint[] x62 = x14; + SecP160R2Field.SquareN(x31, 31, x62); + SecP160R2Field.Multiply(x62, x31, x62); + uint[] x124 = x31; + SecP160R2Field.SquareN(x62, 62, x124); + SecP160R2Field.Multiply(x124, x62, x124); + uint[] x127 = x62; + SecP160R2Field.SquareN(x124, 3, x127); + SecP160R2Field.Multiply(x127, x3, x127); + + uint[] t1 = x127; + SecP160R2Field.SquareN(t1, 18, t1); + SecP160R2Field.Multiply(t1, x17, t1); + SecP160R2Field.SquareN(t1, 2, t1); + SecP160R2Field.Multiply(t1, x1, t1); + SecP160R2Field.SquareN(t1, 3, t1); + SecP160R2Field.Multiply(t1, x2, t1); + SecP160R2Field.SquareN(t1, 6, t1); + SecP160R2Field.Multiply(t1, x3, t1); + SecP160R2Field.SquareN(t1, 2, t1); + SecP160R2Field.Multiply(t1, x1, t1); + + uint[] t2 = x2; + SecP160R2Field.Square(t1, t2); + + return Nat160.Eq(x1, t2) ? new SecP160R2FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP160R2FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP160R2FieldElement); + } + + public virtual bool Equals(SecP160R2FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat160.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 5); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2FieldElement.cs.meta new file mode 100644 index 00000000..2091211f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aae5056faf4a481479fc7b296b811965 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Point.cs new file mode 100644 index 00000000..41f129c8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Point.cs @@ -0,0 +1,283 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP160R2Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.CreatePoint to construct points + */ + public SecP160R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP160R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP160R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP160R2Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP160R2FieldElement X1 = (SecP160R2FieldElement)this.RawXCoord, Y1 = (SecP160R2FieldElement)this.RawYCoord; + SecP160R2FieldElement X2 = (SecP160R2FieldElement)b.RawXCoord, Y2 = (SecP160R2FieldElement)b.RawYCoord; + + SecP160R2FieldElement Z1 = (SecP160R2FieldElement)this.RawZCoords[0]; + SecP160R2FieldElement Z2 = (SecP160R2FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat160.CreateExt(); + uint[] t2 = Nat160.Create(); + uint[] t3 = Nat160.Create(); + uint[] t4 = Nat160.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP160R2Field.Square(Z1.x, S2); + + U2 = t2; + SecP160R2Field.Multiply(S2, X2.x, U2); + + SecP160R2Field.Multiply(S2, Z1.x, S2); + SecP160R2Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP160R2Field.Square(Z2.x, S1); + + U1 = tt1; + SecP160R2Field.Multiply(S1, X1.x, U1); + + SecP160R2Field.Multiply(S1, Z2.x, S1); + SecP160R2Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat160.Create(); + SecP160R2Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP160R2Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat160.IsZero(H)) + { + if (Nat160.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP160R2Field.Square(H, HSquared); + + uint[] G = Nat160.Create(); + SecP160R2Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP160R2Field.Multiply(HSquared, U1, V); + + SecP160R2Field.Negate(G, G); + Nat160.Mul(S1, G, tt1); + + c = Nat160.AddBothTo(V, V, G); + SecP160R2Field.Reduce32(c, G); + + SecP160R2FieldElement X3 = new SecP160R2FieldElement(t4); + SecP160R2Field.Square(R, X3.x); + SecP160R2Field.Subtract(X3.x, G, X3.x); + + SecP160R2FieldElement Y3 = new SecP160R2FieldElement(G); + SecP160R2Field.Subtract(V, X3.x, Y3.x); + SecP160R2Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP160R2Field.Reduce(tt1, Y3.x); + + SecP160R2FieldElement Z3 = new SecP160R2FieldElement(H); + if (!Z1IsOne) + { + SecP160R2Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP160R2Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; + + return new SecP160R2Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP160R2FieldElement Y1 = (SecP160R2FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP160R2FieldElement X1 = (SecP160R2FieldElement)this.RawXCoord, Z1 = (SecP160R2FieldElement)this.RawZCoords[0]; + + uint c; + uint[] t1 = Nat160.Create(); + uint[] t2 = Nat160.Create(); + + uint[] Y1Squared = Nat160.Create(); + SecP160R2Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat160.Create(); + SecP160R2Field.Square(Y1Squared, T); + + bool Z1IsOne = Z1.IsOne; + + uint[] Z1Squared = Z1.x; + if (!Z1IsOne) + { + Z1Squared = t2; + SecP160R2Field.Square(Z1.x, Z1Squared); + } + + SecP160R2Field.Subtract(X1.x, Z1Squared, t1); + + uint[] M = t2; + SecP160R2Field.Add(X1.x, Z1Squared, M); + SecP160R2Field.Multiply(M, t1, M); + c = Nat160.AddBothTo(M, M, M); + SecP160R2Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP160R2Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(5, S, 2, 0); + SecP160R2Field.Reduce32(c, S); + + c = Nat.ShiftUpBits(5, T, 3, 0, t1); + SecP160R2Field.Reduce32(c, t1); + + SecP160R2FieldElement X3 = new SecP160R2FieldElement(T); + SecP160R2Field.Square(M, X3.x); + SecP160R2Field.Subtract(X3.x, S, X3.x); + SecP160R2Field.Subtract(X3.x, S, X3.x); + + SecP160R2FieldElement Y3 = new SecP160R2FieldElement(S); + SecP160R2Field.Subtract(S, X3.x, Y3.x); + SecP160R2Field.Multiply(Y3.x, M, Y3.x); + SecP160R2Field.Subtract(Y3.x, t1, Y3.x); + + SecP160R2FieldElement Z3 = new SecP160R2FieldElement(M); + SecP160R2Field.Twice(Y1.x, Z3.x); + if (!Z1IsOne) + { + SecP160R2Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP160R2Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP160R2Point(Curve, this.RawXCoord, this.RawYCoord.Negate(), this.RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Point.cs.meta new file mode 100644 index 00000000..e147aa3b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP160R2Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 052ed3284b9686047ad51492201a07e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Curve.cs new file mode 100644 index 00000000..5c4def73 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Curve.cs @@ -0,0 +1,138 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP192K1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37")); + + private const int SECP192K1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP192K1_FE_INTS = 6; + + protected readonly SecP192K1Point m_infinity; + + public SecP192K1Curve() + : base(q) + { + this.m_infinity = new SecP192K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.Zero); + this.m_b = FromBigInteger(BigInteger.ValueOf(3)); + this.m_order = new BigInteger(1, Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D")); + this.m_cofactor = BigInteger.One; + this.m_coord = SECP192K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP192K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP192K1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP192K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP192K1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP192K1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat192.Copy(((SecP192K1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP192K1_FE_INTS; + Nat192.Copy(((SecP192K1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP192K1_FE_INTS; + } + } + + return new SecP192K1LookupTable(this, table, len); + } + + private class SecP192K1LookupTable + : ECLookupTable + { + private readonly SecP192K1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP192K1LookupTable(SecP192K1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat192.Create(), y = Nat192.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP192K1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP192K1_FE_INTS + j] & MASK; + } + + pos += (SECP192K1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP192K1FieldElement(x), new SecP192K1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Curve.cs.meta new file mode 100644 index 00000000..9b08ab02 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4c57242857a693945805fab06e8b8816 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Field.cs new file mode 100644 index 00000000..33eee844 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Field.cs @@ -0,0 +1,182 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP192K1Field + { + // 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFEE37, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + internal static readonly uint[] PExt = new uint[]{ 0x013C4FD1, 0x00002392, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0xFFFFDC6E, 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + private static readonly uint[] PExtInv = new uint[]{ 0xFEC3B02F, 0xFFFFDC6D, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0x00002391, 0x00000002 }; + private const uint P5 = 0xFFFFFFFF; + private const uint PExt11 = 0xFFFFFFFF; + private const uint PInv33 = 0x11C9; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat192.Add(x, y, z); + if (c != 0 || (z[5] == P5 && Nat192.Gte(z, P))) + { + Nat.Add33To(6, PInv33, z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(12, xx, yy, zz); + if (c != 0 || (zz[11] == PExt11 && Nat.Gte(12, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(12, zz, PExtInv.Length); + } + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(6, x, z); + if (c != 0 || (z[5] == P5 && Nat192.Gte(z, P))) + { + Nat.Add33To(6, PInv33, z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat192.FromBigInteger(x); + if (z[5] == P5 && Nat192.Gte(z, P)) + { + Nat192.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(6, x, 0, z); + } + else + { + uint c = Nat192.Add(x, P, z); + Nat.ShiftDownBit(6, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat192.CreateExt(); + Nat192.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat192.MulAddTo(x, y, zz); + if (c != 0 || (zz[11] == PExt11 && Nat.Gte(12, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(12, zz, PExtInv.Length); + } + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat192.IsZero(x)) + { + Nat192.Zero(z); + } + else + { + Nat192.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + ulong cc = Nat192.Mul33Add(PInv33, xx, 6, xx, 0, z, 0); + uint c = Nat192.Mul33DWordAdd(PInv33, cc, z, 0); + + Debug.Assert(c == 0 || c == 1); + + if (c != 0 || (z[5] == P5 && Nat192.Gte(z, P))) + { + Nat.Add33To(6, PInv33, z); + } + } + + public static void Reduce32(uint x, uint[] z) + { + if ((x != 0 && Nat192.Mul33WordAdd(PInv33, x, z, 0) != 0) + || (z[5] == P5 && Nat192.Gte(z, P))) + { + Nat.Add33To(6, PInv33, z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat192.CreateExt(); + Nat192.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat192.CreateExt(); + Nat192.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat192.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat192.Sub(x, y, z); + if (c != 0) + { + Nat.Sub33From(6, PInv33, z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(12, xx, yy, zz); + if (c != 0) + { + if (Nat.SubFrom(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.DecAt(12, zz, PExtInv.Length); + } + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(6, x, 0, z); + if (c != 0 || (z[5] == P5 && Nat192.Gte(z, P))) + { + Nat.Add33To(6, PInv33, z); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Field.cs.meta new file mode 100644 index 00000000..02286069 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 218f3d42a4e59cf4a953af9121236128 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1FieldElement.cs new file mode 100644 index 00000000..398cb2b1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1FieldElement.cs @@ -0,0 +1,217 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP192K1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP192K1Curve.q; + + protected internal readonly uint[] x; + + public SecP192K1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP192K1FieldElement", "x"); + + this.x = SecP192K1Field.FromBigInteger(x); + } + + public SecP192K1FieldElement() + { + this.x = Nat192.Create(); + } + + protected internal SecP192K1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat192.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat192.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat192.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat192.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SecP192K1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat192.Create(); + SecP192K1Field.Add(x, ((SecP192K1FieldElement)b).x, z); + return new SecP192K1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat192.Create(); + SecP192K1Field.AddOne(x, z); + return new SecP192K1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat192.Create(); + SecP192K1Field.Subtract(x, ((SecP192K1FieldElement)b).x, z); + return new SecP192K1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat192.Create(); + SecP192K1Field.Multiply(x, ((SecP192K1FieldElement)b).x, z); + return new SecP192K1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat192.Create(); + Mod.Invert(SecP192K1Field.P, ((SecP192K1FieldElement)b).x, z); + SecP192K1Field.Multiply(z, x, z); + return new SecP192K1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat192.Create(); + SecP192K1Field.Negate(x, z); + return new SecP192K1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat192.Create(); + SecP192K1Field.Square(x, z); + return new SecP192K1FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new SecP192K1FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat192.Create(); + Mod.Invert(SecP192K1Field.P, x, z); + return new SecP192K1FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + /* + * Raise this element to the exponent 2^190 - 2^30 - 2^10 - 2^6 - 2^5 - 2^4 - 2^1 + * + * Breaking up the exponent's binary representation into "repunits", we get: + * { 159 1s } { 1 0s } { 19 1s } { 1 0s } { 3 1s } { 3 0s} { 3 1s } { 1 0s } + * + * Therefore we need an addition chain containing 3, 19, 159 (the lengths of the repunits) + * We use: 1, 2, [3], 6, 8, 16, [19], 35, 70, 140, [159] + */ + + uint[] x1 = this.x; + if (Nat192.IsZero(x1) || Nat192.IsOne(x1)) + return this; + + uint[] x2 = Nat192.Create(); + SecP192K1Field.Square(x1, x2); + SecP192K1Field.Multiply(x2, x1, x2); + uint[] x3 = Nat192.Create(); + SecP192K1Field.Square(x2, x3); + SecP192K1Field.Multiply(x3, x1, x3); + uint[] x6 = Nat192.Create(); + SecP192K1Field.SquareN(x3, 3, x6); + SecP192K1Field.Multiply(x6, x3, x6); + uint[] x8 = x6; + SecP192K1Field.SquareN(x6, 2, x8); + SecP192K1Field.Multiply(x8, x2, x8); + uint[] x16 = x2; + SecP192K1Field.SquareN(x8, 8, x16); + SecP192K1Field.Multiply(x16, x8, x16); + uint[] x19 = x8; + SecP192K1Field.SquareN(x16, 3, x19); + SecP192K1Field.Multiply(x19, x3, x19); + uint[] x35 = Nat192.Create(); + SecP192K1Field.SquareN(x19, 16, x35); + SecP192K1Field.Multiply(x35, x16, x35); + uint[] x70 = x16; + SecP192K1Field.SquareN(x35, 35, x70); + SecP192K1Field.Multiply(x70, x35, x70); + uint[] x140 = x35; + SecP192K1Field.SquareN(x70, 70, x140); + SecP192K1Field.Multiply(x140, x70, x140); + uint[] x159 = x70; + SecP192K1Field.SquareN(x140, 19, x159); + SecP192K1Field.Multiply(x159, x19, x159); + + uint[] t1 = x159; + SecP192K1Field.SquareN(t1, 20, t1); + SecP192K1Field.Multiply(t1, x19, t1); + SecP192K1Field.SquareN(t1, 4, t1); + SecP192K1Field.Multiply(t1, x3, t1); + SecP192K1Field.SquareN(t1, 6, t1); + SecP192K1Field.Multiply(t1, x3, t1); + SecP192K1Field.Square(t1, t1); + + uint[] t2 = x3; + SecP192K1Field.Square(t1, t2); + + return Nat192.Eq(x1, t2) ? new SecP192K1FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP192K1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP192K1FieldElement); + } + + public virtual bool Equals(SecP192K1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat192.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 6); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1FieldElement.cs.meta new file mode 100644 index 00000000..fa52cbd6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5a7a619c061cd24cafd0a7cdbb3a432 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Point.cs new file mode 100644 index 00000000..39a7f7d5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Point.cs @@ -0,0 +1,271 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP192K1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecP192K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP192K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP192K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, + bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP192K1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP192K1FieldElement X1 = (SecP192K1FieldElement)this.RawXCoord, Y1 = (SecP192K1FieldElement)this.RawYCoord; + SecP192K1FieldElement X2 = (SecP192K1FieldElement)b.RawXCoord, Y2 = (SecP192K1FieldElement)b.RawYCoord; + + SecP192K1FieldElement Z1 = (SecP192K1FieldElement)this.RawZCoords[0]; + SecP192K1FieldElement Z2 = (SecP192K1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat192.CreateExt(); + uint[] t2 = Nat192.Create(); + uint[] t3 = Nat192.Create(); + uint[] t4 = Nat192.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP192K1Field.Square(Z1.x, S2); + + U2 = t2; + SecP192K1Field.Multiply(S2, X2.x, U2); + + SecP192K1Field.Multiply(S2, Z1.x, S2); + SecP192K1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP192K1Field.Square(Z2.x, S1); + + U1 = tt1; + SecP192K1Field.Multiply(S1, X1.x, U1); + + SecP192K1Field.Multiply(S1, Z2.x, S1); + SecP192K1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat192.Create(); + SecP192K1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP192K1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat192.IsZero(H)) + { + if (Nat192.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP192K1Field.Square(H, HSquared); + + uint[] G = Nat192.Create(); + SecP192K1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP192K1Field.Multiply(HSquared, U1, V); + + SecP192K1Field.Negate(G, G); + Nat192.Mul(S1, G, tt1); + + c = Nat192.AddBothTo(V, V, G); + SecP192K1Field.Reduce32(c, G); + + SecP192K1FieldElement X3 = new SecP192K1FieldElement(t4); + SecP192K1Field.Square(R, X3.x); + SecP192K1Field.Subtract(X3.x, G, X3.x); + + SecP192K1FieldElement Y3 = new SecP192K1FieldElement(G); + SecP192K1Field.Subtract(V, X3.x, Y3.x); + SecP192K1Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP192K1Field.Reduce(tt1, Y3.x); + + SecP192K1FieldElement Z3 = new SecP192K1FieldElement(H); + if (!Z1IsOne) + { + SecP192K1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP192K1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[] { Z3 }; + + return new SecP192K1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP192K1FieldElement Y1 = (SecP192K1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP192K1FieldElement X1 = (SecP192K1FieldElement)this.RawXCoord, Z1 = (SecP192K1FieldElement)this.RawZCoords[0]; + + uint c; + + uint[] Y1Squared = Nat192.Create(); + SecP192K1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat192.Create(); + SecP192K1Field.Square(Y1Squared, T); + + uint[] M = Nat192.Create(); + SecP192K1Field.Square(X1.x, M); + c = Nat192.AddBothTo(M, M, M); + SecP192K1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP192K1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(6, S, 2, 0); + SecP192K1Field.Reduce32(c, S); + + uint[] t1 = Nat192.Create(); + c = Nat.ShiftUpBits(6, T, 3, 0, t1); + SecP192K1Field.Reduce32(c, t1); + + SecP192K1FieldElement X3 = new SecP192K1FieldElement(T); + SecP192K1Field.Square(M, X3.x); + SecP192K1Field.Subtract(X3.x, S, X3.x); + SecP192K1Field.Subtract(X3.x, S, X3.x); + + SecP192K1FieldElement Y3 = new SecP192K1FieldElement(S); + SecP192K1Field.Subtract(S, X3.x, Y3.x); + SecP192K1Field.Multiply(Y3.x, M, Y3.x); + SecP192K1Field.Subtract(Y3.x, t1, Y3.x); + + SecP192K1FieldElement Z3 = new SecP192K1FieldElement(M); + SecP192K1Field.Twice(Y1.x, Z3.x); + if (!Z1.IsOne) + { + SecP192K1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP192K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP192K1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Point.cs.meta new file mode 100644 index 00000000..e564406e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d94a23a9df7487e4b8647bb414b5c412 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Curve.cs new file mode 100644 index 00000000..0bc0838c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Curve.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP192R1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF")); + + private const int SECP192R1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP192R1_FE_INTS = 6; + + protected readonly SecP192R1Point m_infinity; + + public SecP192R1Curve() + : base(q) + { + this.m_infinity = new SecP192R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"))); + this.m_order = new BigInteger(1, Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831")); + this.m_cofactor = BigInteger.One; + + this.m_coord = SECP192R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP192R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP192R1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP192R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP192R1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP192R1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat192.Copy(((SecP192R1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP192R1_FE_INTS; + Nat192.Copy(((SecP192R1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP192R1_FE_INTS; + } + } + + return new SecP192R1LookupTable(this, table, len); + } + + private class SecP192R1LookupTable + : ECLookupTable + { + private readonly SecP192R1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP192R1LookupTable(SecP192R1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat192.Create(), y = Nat192.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP192R1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP192R1_FE_INTS + j] & MASK; + } + + pos += (SECP192R1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP192R1FieldElement(x), new SecP192R1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Curve.cs.meta new file mode 100644 index 00000000..0f04485e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9051396fd403a4143a8049754bd784c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Field.cs new file mode 100644 index 00000000..600020ad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Field.cs @@ -0,0 +1,287 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP192R1Field + { + // 2^192 - 2^64 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + internal static readonly uint[] PExt = new uint[]{ 0x00000001, 0x00000000, 0x00000002, 0x00000000, 0x00000001, + 0x00000000, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + private static readonly uint[] PExtInv = new uint[]{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFE, + 0xFFFFFFFF, 0x00000001, 0x00000000, 0x00000002 }; + private const uint P5 = 0xFFFFFFFF; + private const uint PExt11 = 0xFFFFFFFF; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat192.Add(x, y, z); + if (c != 0 || (z[5] == P5 && Nat192.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(12, xx, yy, zz); + if (c != 0 || (zz[11] == PExt11 && Nat.Gte(12, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(12, zz, PExtInv.Length); + } + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(6, x, z); + if (c != 0 || (z[5] == P5 && Nat192.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat192.FromBigInteger(x); + if (z[5] == P5 && Nat192.Gte(z, P)) + { + Nat192.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(6, x, 0, z); + } + else + { + uint c = Nat192.Add(x, P, z); + Nat.ShiftDownBit(6, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat192.CreateExt(); + Nat192.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat192.MulAddTo(x, y, zz); + if (c != 0 || (zz[11] == PExt11 && Nat.Gte(12, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(12, zz, PExtInv.Length); + } + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat192.IsZero(x)) + { + Nat192.Zero(z); + } + else + { + Nat192.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + ulong xx06 = xx[6], xx07 = xx[7], xx08 = xx[8]; + ulong xx09 = xx[9], xx10 = xx[10], xx11 = xx[11]; + + ulong t0 = xx06 + xx10; + ulong t1 = xx07 + xx11; + + ulong cc = 0; + cc += (ulong)xx[0] + t0; + uint z0 = (uint)cc; + cc >>= 32; + cc += (ulong)xx[1] + t1; + z[1] = (uint)cc; + cc >>= 32; + + t0 += xx08; + t1 += xx09; + + cc += (ulong)xx[2] + t0; + ulong z2 = (uint)cc; + cc >>= 32; + cc += (ulong)xx[3] + t1; + z[3] = (uint)cc; + cc >>= 32; + + t0 -= xx06; + t1 -= xx07; + + cc += (ulong)xx[4] + t0; + z[4] = (uint)cc; + cc >>= 32; + cc += (ulong)xx[5] + t1; + z[5] = (uint)cc; + cc >>= 32; + + z2 += cc; + + cc += z0; + z[0] = (uint)cc; + cc >>= 32; + if (cc != 0) + { + cc += z[1]; + z[1] = (uint)cc; + z2 += cc >> 32; + } + z[2] = (uint)z2; + cc = z2 >> 32; + + Debug.Assert(cc == 0 || cc == 1); + + if ((cc != 0 && Nat.IncAt(6, z, 3) != 0) + || (z[5] == P5 && Nat192.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void Reduce32(uint x, uint[] z) + { + ulong cc = 0; + + if (x != 0) + { + cc += (ulong)z[0] + x; + z[0] = (uint)cc; + cc >>= 32; + if (cc != 0) + { + cc += (ulong)z[1]; + z[1] = (uint)cc; + cc >>= 32; + } + cc += (ulong)z[2] + x; + z[2] = (uint)cc; + cc >>= 32; + + Debug.Assert(cc == 0 || cc == 1); + } + + if ((cc != 0 && Nat.IncAt(6, z, 3) != 0) + || (z[5] == P5 && Nat192.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat192.CreateExt(); + Nat192.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat192.CreateExt(); + Nat192.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat192.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat192.Sub(x, y, z); + if (c != 0) + { + SubPInvFrom(z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(12, xx, yy, zz); + if (c != 0) + { + if (Nat.SubFrom(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.DecAt(12, zz, PExtInv.Length); + } + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(6, x, 0, z); + if (c != 0 || (z[5] == P5 && Nat192.Gte(z, P))) + { + AddPInvTo(z); + } + } + + private static void AddPInvTo(uint[] z) + { + long c = (long)z[0] + 1; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; + c >>= 32; + } + c += (long)z[2] + 1; + z[2] = (uint)c; + c >>= 32; + if (c != 0) + { + Nat.IncAt(6, z, 3); + } + } + + private static void SubPInvFrom(uint[] z) + { + long c = (long)z[0] - 1; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; + c >>= 32; + } + c += (long)z[2] - 1; + z[2] = (uint)c; + c >>= 32; + if (c != 0) + { + Nat.DecAt(6, z, 3); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Field.cs.meta new file mode 100644 index 00000000..2863b572 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44fb8f1c5ae47e64caf48325ec0b3902 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1FieldElement.cs new file mode 100644 index 00000000..f343fc2a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1FieldElement.cs @@ -0,0 +1,192 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP192R1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP192R1Curve.q; + + protected internal readonly uint[] x; + + public SecP192R1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP192R1FieldElement", "x"); + + this.x = SecP192R1Field.FromBigInteger(x); + } + + public SecP192R1FieldElement() + { + this.x = Nat192.Create(); + } + + protected internal SecP192R1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat192.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat192.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat192.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat192.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SecP192R1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat192.Create(); + SecP192R1Field.Add(x, ((SecP192R1FieldElement)b).x, z); + return new SecP192R1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat192.Create(); + SecP192R1Field.AddOne(x, z); + return new SecP192R1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat192.Create(); + SecP192R1Field.Subtract(x, ((SecP192R1FieldElement)b).x, z); + return new SecP192R1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat192.Create(); + SecP192R1Field.Multiply(x, ((SecP192R1FieldElement)b).x, z); + return new SecP192R1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat192.Create(); + Mod.Invert(SecP192R1Field.P, ((SecP192R1FieldElement)b).x, z); + SecP192R1Field.Multiply(z, x, z); + return new SecP192R1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat192.Create(); + SecP192R1Field.Negate(x, z); + return new SecP192R1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat192.Create(); + SecP192R1Field.Square(x, z); + return new SecP192R1FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new SecP192R1FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat192.Create(); + Mod.Invert(SecP192R1Field.P, x, z); + return new SecP192R1FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + // Raise this element to the exponent 2^190 - 2^62 + + uint[] x1 = this.x; + if (Nat192.IsZero(x1) || Nat192.IsOne(x1)) + return this; + + uint[] t1 = Nat192.Create(); + uint[] t2 = Nat192.Create(); + + SecP192R1Field.Square(x1, t1); + SecP192R1Field.Multiply(t1, x1, t1); + + SecP192R1Field.SquareN(t1, 2, t2); + SecP192R1Field.Multiply(t2, t1, t2); + + SecP192R1Field.SquareN(t2, 4, t1); + SecP192R1Field.Multiply(t1, t2, t1); + + SecP192R1Field.SquareN(t1, 8, t2); + SecP192R1Field.Multiply(t2, t1, t2); + + SecP192R1Field.SquareN(t2, 16, t1); + SecP192R1Field.Multiply(t1, t2, t1); + + SecP192R1Field.SquareN(t1, 32, t2); + SecP192R1Field.Multiply(t2, t1, t2); + + SecP192R1Field.SquareN(t2, 64, t1); + SecP192R1Field.Multiply(t1, t2, t1); + + SecP192R1Field.SquareN(t1, 62, t1); + SecP192R1Field.Square(t1, t2); + + return Nat192.Eq(x1, t2) ? new SecP192R1FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP192R1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP192R1FieldElement); + } + + public virtual bool Equals(SecP192R1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat192.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 6); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1FieldElement.cs.meta new file mode 100644 index 00000000..a5495afc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1a07149a2b0efd429eb787280af3bc0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Point.cs new file mode 100644 index 00000000..de2ebaff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Point.cs @@ -0,0 +1,283 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP192R1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecP192R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP192R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP192R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP192R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP192R1FieldElement X1 = (SecP192R1FieldElement)this.RawXCoord, Y1 = (SecP192R1FieldElement)this.RawYCoord; + SecP192R1FieldElement X2 = (SecP192R1FieldElement)b.RawXCoord, Y2 = (SecP192R1FieldElement)b.RawYCoord; + + SecP192R1FieldElement Z1 = (SecP192R1FieldElement)this.RawZCoords[0]; + SecP192R1FieldElement Z2 = (SecP192R1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat192.CreateExt(); + uint[] t2 = Nat192.Create(); + uint[] t3 = Nat192.Create(); + uint[] t4 = Nat192.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP192R1Field.Square(Z1.x, S2); + + U2 = t2; + SecP192R1Field.Multiply(S2, X2.x, U2); + + SecP192R1Field.Multiply(S2, Z1.x, S2); + SecP192R1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP192R1Field.Square(Z2.x, S1); + + U1 = tt1; + SecP192R1Field.Multiply(S1, X1.x, U1); + + SecP192R1Field.Multiply(S1, Z2.x, S1); + SecP192R1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat192.Create(); + SecP192R1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP192R1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat192.IsZero(H)) + { + if (Nat192.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP192R1Field.Square(H, HSquared); + + uint[] G = Nat192.Create(); + SecP192R1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP192R1Field.Multiply(HSquared, U1, V); + + SecP192R1Field.Negate(G, G); + Nat192.Mul(S1, G, tt1); + + c = Nat192.AddBothTo(V, V, G); + SecP192R1Field.Reduce32(c, G); + + SecP192R1FieldElement X3 = new SecP192R1FieldElement(t4); + SecP192R1Field.Square(R, X3.x); + SecP192R1Field.Subtract(X3.x, G, X3.x); + + SecP192R1FieldElement Y3 = new SecP192R1FieldElement(G); + SecP192R1Field.Subtract(V, X3.x, Y3.x); + SecP192R1Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP192R1Field.Reduce(tt1, Y3.x); + + SecP192R1FieldElement Z3 = new SecP192R1FieldElement(H); + if (!Z1IsOne) + { + SecP192R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP192R1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[] { Z3 }; + + return new SecP192R1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP192R1FieldElement Y1 = (SecP192R1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP192R1FieldElement X1 = (SecP192R1FieldElement)this.RawXCoord, Z1 = (SecP192R1FieldElement)this.RawZCoords[0]; + + uint c; + uint[] t1 = Nat192.Create(); + uint[] t2 = Nat192.Create(); + + uint[] Y1Squared = Nat192.Create(); + SecP192R1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat192.Create(); + SecP192R1Field.Square(Y1Squared, T); + + bool Z1IsOne = Z1.IsOne; + + uint[] Z1Squared = Z1.x; + if (!Z1IsOne) + { + Z1Squared = t2; + SecP192R1Field.Square(Z1.x, Z1Squared); + } + + SecP192R1Field.Subtract(X1.x, Z1Squared, t1); + + uint[] M = t2; + SecP192R1Field.Add(X1.x, Z1Squared, M); + SecP192R1Field.Multiply(M, t1, M); + c = Nat192.AddBothTo(M, M, M); + SecP192R1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP192R1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(6, S, 2, 0); + SecP192R1Field.Reduce32(c, S); + + c = Nat.ShiftUpBits(6, T, 3, 0, t1); + SecP192R1Field.Reduce32(c, t1); + + SecP192R1FieldElement X3 = new SecP192R1FieldElement(T); + SecP192R1Field.Square(M, X3.x); + SecP192R1Field.Subtract(X3.x, S, X3.x); + SecP192R1Field.Subtract(X3.x, S, X3.x); + + SecP192R1FieldElement Y3 = new SecP192R1FieldElement(S); + SecP192R1Field.Subtract(S, X3.x, Y3.x); + SecP192R1Field.Multiply(Y3.x, M, Y3.x); + SecP192R1Field.Subtract(Y3.x, t1, Y3.x); + + SecP192R1FieldElement Z3 = new SecP192R1FieldElement(M); + SecP192R1Field.Twice(Y1.x, Z3.x); + if (!Z1IsOne) + { + SecP192R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP192R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP192R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Point.cs.meta new file mode 100644 index 00000000..ee80bb78 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP192R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5084e06d37760694d9392014cb72ba23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Curve.cs new file mode 100644 index 00000000..8a2a98ae --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Curve.cs @@ -0,0 +1,138 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP224K1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D")); + + private const int SECP224K1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP224K1_FE_INTS = 7; + + protected readonly SecP224K1Point m_infinity; + + public SecP224K1Curve() + : base(q) + { + this.m_infinity = new SecP224K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.Zero); + this.m_b = FromBigInteger(BigInteger.ValueOf(5)); + this.m_order = new BigInteger(1, Hex.Decode("010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7")); + this.m_cofactor = BigInteger.One; + this.m_coord = SECP224K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP224K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP224K1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP224K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP224K1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP224K1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat224.Copy(((SecP224K1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP224K1_FE_INTS; + Nat224.Copy(((SecP224K1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP224K1_FE_INTS; + } + } + + return new SecP224K1LookupTable(this, table, len); + } + + private class SecP224K1LookupTable + : ECLookupTable + { + private readonly SecP224K1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP224K1LookupTable(SecP224K1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat224.Create(), y = Nat224.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP224K1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP224K1_FE_INTS + j] & MASK; + } + + pos += (SECP224K1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP224K1FieldElement(x), new SecP224K1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Curve.cs.meta new file mode 100644 index 00000000..6f1a155f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1233e0816ad5b44f9f27e6b791d2e97 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Field.cs new file mode 100644 index 00000000..63b841de --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Field.cs @@ -0,0 +1,183 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP224K1Field + { + // 2^224 - 2^32 - 2^12 - 2^11 - 2^9 - 2^7 - 2^4 - 2 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFE56D, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF }; + internal static readonly uint[] PExt = new uint[]{ 0x02C23069, 0x00003526, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xFFFFCADA, 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + private static readonly uint[] PExtInv = new uint[]{ 0xFD3DCF97, 0xFFFFCAD9, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0x00003525, 0x00000002 }; + private const uint P6 = 0xFFFFFFFF; + private const uint PExt13 = 0xFFFFFFFF; + private const uint PInv33 = 0x1A93; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat224.Add(x, y, z); + if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P))) + { + Nat.Add33To(7, PInv33, z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(14, xx, yy, zz); + if (c != 0 || (zz[13] == PExt13 && Nat.Gte(14, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(14, zz, PExtInv.Length); + } + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(7, x, z); + if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P))) + { + Nat.Add33To(7, PInv33, z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat224.FromBigInteger(x); + if (z[6] == P6 && Nat224.Gte(z, P)) + { + Nat224.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(7, x, 0, z); + } + else + { + uint c = Nat224.Add(x, P, z); + Nat.ShiftDownBit(7, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat224.CreateExt(); + Nat224.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat224.MulAddTo(x, y, zz); + if (c != 0 || (zz[13] == PExt13 && Nat.Gte(14, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(14, zz, PExtInv.Length); + } + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat224.IsZero(x)) + { + Nat224.Zero(z); + } + else + { + Nat224.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + ulong cc = Nat224.Mul33Add(PInv33, xx, 7, xx, 0, z, 0); + uint c = Nat224.Mul33DWordAdd(PInv33, cc, z, 0); + + Debug.Assert(c == 0 || c == 1); + + if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P))) + { + Nat.Add33To(7, PInv33, z); + } + } + + public static void Reduce32(uint x, uint[] z) + { + if ((x != 0 && Nat224.Mul33WordAdd(PInv33, x, z, 0) != 0) + || (z[6] == P6 && Nat224.Gte(z, P))) + { + Nat.Add33To(7, PInv33, z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat224.CreateExt(); + Nat224.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat224.CreateExt(); + Nat224.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat224.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat224.Sub(x, y, z); + if (c != 0) + { + Nat.Sub33From(7, PInv33, z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(14, xx, yy, zz); + if (c != 0) + { + if (Nat.SubFrom(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.DecAt(14, zz, PExtInv.Length); + } + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(7, x, 0, z); + if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P))) + { + Nat.Add33To(7, PInv33, z); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Field.cs.meta new file mode 100644 index 00000000..967cc9d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13c0c039f6103dd4abcd6e56bfe8f54e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1FieldElement.cs new file mode 100644 index 00000000..bf0e7f09 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1FieldElement.cs @@ -0,0 +1,246 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP224K1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP224K1Curve.q; + + // Calculated as BigInteger.Two.ModPow(Q.ShiftRight(2), Q) + private static readonly uint[] PRECOMP_POW2 = new uint[]{ 0x33bfd202, 0xdcfad133, 0x2287624a, 0xc3811ba8, + 0xa85558fc, 0x1eaef5d7, 0x8edf154c }; + + protected internal readonly uint[] x; + + public SecP224K1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP224K1FieldElement", "x"); + + this.x = SecP224K1Field.FromBigInteger(x); + } + + public SecP224K1FieldElement() + { + this.x = Nat224.Create(); + } + + protected internal SecP224K1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat224.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat224.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat224.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat224.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SecP224K1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat224.Create(); + SecP224K1Field.Add(x, ((SecP224K1FieldElement)b).x, z); + return new SecP224K1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat224.Create(); + SecP224K1Field.AddOne(x, z); + return new SecP224K1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat224.Create(); + SecP224K1Field.Subtract(x, ((SecP224K1FieldElement)b).x, z); + return new SecP224K1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat224.Create(); + SecP224K1Field.Multiply(x, ((SecP224K1FieldElement)b).x, z); + return new SecP224K1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat224.Create(); + Mod.Invert(SecP224K1Field.P, ((SecP224K1FieldElement)b).x, z); + SecP224K1Field.Multiply(z, x, z); + return new SecP224K1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat224.Create(); + SecP224K1Field.Negate(x, z); + return new SecP224K1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat224.Create(); + SecP224K1Field.Square(x, z); + return new SecP224K1FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new SecP224K1FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat224.Create(); + Mod.Invert(SecP224K1Field.P, x, z); + return new SecP224K1FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + /* + * Q == 8m + 5, so we use Pocklington's method for this case. + * + * First, raise this element to the exponent 2^221 - 2^29 - 2^9 - 2^8 - 2^6 - 2^4 - 2^1 (i.e. m + 1) + * + * Breaking up the exponent's binary representation into "repunits", we get: + * { 191 1s } { 1 0s } { 19 1s } { 2 0s } { 1 1s } { 1 0s} { 1 1s } { 1 0s} { 3 1s } { 1 0s} + * + * Therefore we need an addition chain containing 1, 3, 19, 191 (the lengths of the repunits) + * We use: [1], 2, [3], 4, 8, 11, [19], 23, 42, 84, 107, [191] + */ + + uint[] x1 = this.x; + if (Nat224.IsZero(x1) || Nat224.IsOne(x1)) + return this; + + uint[] x2 = Nat224.Create(); + SecP224K1Field.Square(x1, x2); + SecP224K1Field.Multiply(x2, x1, x2); + uint[] x3 = x2; + SecP224K1Field.Square(x2, x3); + SecP224K1Field.Multiply(x3, x1, x3); + uint[] x4 = Nat224.Create(); + SecP224K1Field.Square(x3, x4); + SecP224K1Field.Multiply(x4, x1, x4); + uint[] x8 = Nat224.Create(); + SecP224K1Field.SquareN(x4, 4, x8); + SecP224K1Field.Multiply(x8, x4, x8); + uint[] x11 = Nat224.Create(); + SecP224K1Field.SquareN(x8, 3, x11); + SecP224K1Field.Multiply(x11, x3, x11); + uint[] x19 = x11; + SecP224K1Field.SquareN(x11, 8, x19); + SecP224K1Field.Multiply(x19, x8, x19); + uint[] x23 = x8; + SecP224K1Field.SquareN(x19, 4, x23); + SecP224K1Field.Multiply(x23, x4, x23); + uint[] x42 = x4; + SecP224K1Field.SquareN(x23, 19, x42); + SecP224K1Field.Multiply(x42, x19, x42); + uint[] x84 = Nat224.Create(); + SecP224K1Field.SquareN(x42, 42, x84); + SecP224K1Field.Multiply(x84, x42, x84); + uint[] x107 = x42; + SecP224K1Field.SquareN(x84, 23, x107); + SecP224K1Field.Multiply(x107, x23, x107); + uint[] x191 = x23; + SecP224K1Field.SquareN(x107, 84, x191); + SecP224K1Field.Multiply(x191, x84, x191); + + uint[] t1 = x191; + SecP224K1Field.SquareN(t1, 20, t1); + SecP224K1Field.Multiply(t1, x19, t1); + SecP224K1Field.SquareN(t1, 3, t1); + SecP224K1Field.Multiply(t1, x1, t1); + SecP224K1Field.SquareN(t1, 2, t1); + SecP224K1Field.Multiply(t1, x1, t1); + SecP224K1Field.SquareN(t1, 4, t1); + SecP224K1Field.Multiply(t1, x3, t1); + SecP224K1Field.Square(t1, t1); + + uint[] t2 = x84; + SecP224K1Field.Square(t1, t2); + + if (Nat224.Eq(x1, t2)) + { + return new SecP224K1FieldElement(t1); + } + + /* + * If the first guess is incorrect, we multiply by a precomputed power of 2 to get the second guess, + * which is ((4x)^(m + 1))/2 mod Q + */ + SecP224K1Field.Multiply(t1, PRECOMP_POW2, t1); + + SecP224K1Field.Square(t1, t2); + + if (Nat224.Eq(x1, t2)) + { + return new SecP224K1FieldElement(t1); + } + + return null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP224K1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP224K1FieldElement); + } + + public virtual bool Equals(SecP224K1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat224.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 7); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1FieldElement.cs.meta new file mode 100644 index 00000000..ca493e0e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 50f96618b2586c142b195292b3fa8f95 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Point.cs new file mode 100644 index 00000000..c4d64481 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Point.cs @@ -0,0 +1,271 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP224K1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecP224K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP224K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP224K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, + bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP224K1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP224K1FieldElement X1 = (SecP224K1FieldElement)this.RawXCoord, Y1 = (SecP224K1FieldElement)this.RawYCoord; + SecP224K1FieldElement X2 = (SecP224K1FieldElement)b.RawXCoord, Y2 = (SecP224K1FieldElement)b.RawYCoord; + + SecP224K1FieldElement Z1 = (SecP224K1FieldElement)this.RawZCoords[0]; + SecP224K1FieldElement Z2 = (SecP224K1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat224.CreateExt(); + uint[] t2 = Nat224.Create(); + uint[] t3 = Nat224.Create(); + uint[] t4 = Nat224.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP224K1Field.Square(Z1.x, S2); + + U2 = t2; + SecP224K1Field.Multiply(S2, X2.x, U2); + + SecP224K1Field.Multiply(S2, Z1.x, S2); + SecP224K1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP224K1Field.Square(Z2.x, S1); + + U1 = tt1; + SecP224K1Field.Multiply(S1, X1.x, U1); + + SecP224K1Field.Multiply(S1, Z2.x, S1); + SecP224K1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat224.Create(); + SecP224K1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP224K1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat224.IsZero(H)) + { + if (Nat224.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP224K1Field.Square(H, HSquared); + + uint[] G = Nat224.Create(); + SecP224K1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP224K1Field.Multiply(HSquared, U1, V); + + SecP224K1Field.Negate(G, G); + Nat224.Mul(S1, G, tt1); + + c = Nat224.AddBothTo(V, V, G); + SecP224K1Field.Reduce32(c, G); + + SecP224K1FieldElement X3 = new SecP224K1FieldElement(t4); + SecP224K1Field.Square(R, X3.x); + SecP224K1Field.Subtract(X3.x, G, X3.x); + + SecP224K1FieldElement Y3 = new SecP224K1FieldElement(G); + SecP224K1Field.Subtract(V, X3.x, Y3.x); + SecP224K1Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP224K1Field.Reduce(tt1, Y3.x); + + SecP224K1FieldElement Z3 = new SecP224K1FieldElement(H); + if (!Z1IsOne) + { + SecP224K1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP224K1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[] { Z3 }; + + return new SecP224K1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP224K1FieldElement Y1 = (SecP224K1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP224K1FieldElement X1 = (SecP224K1FieldElement)this.RawXCoord, Z1 = (SecP224K1FieldElement)this.RawZCoords[0]; + + uint c; + + uint[] Y1Squared = Nat224.Create(); + SecP224K1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat224.Create(); + SecP224K1Field.Square(Y1Squared, T); + + uint[] M = Nat224.Create(); + SecP224K1Field.Square(X1.x, M); + c = Nat224.AddBothTo(M, M, M); + SecP224K1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP224K1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(7, S, 2, 0); + SecP224K1Field.Reduce32(c, S); + + uint[] t1 = Nat224.Create(); + c = Nat.ShiftUpBits(7, T, 3, 0, t1); + SecP224K1Field.Reduce32(c, t1); + + SecP224K1FieldElement X3 = new SecP224K1FieldElement(T); + SecP224K1Field.Square(M, X3.x); + SecP224K1Field.Subtract(X3.x, S, X3.x); + SecP224K1Field.Subtract(X3.x, S, X3.x); + + SecP224K1FieldElement Y3 = new SecP224K1FieldElement(S); + SecP224K1Field.Subtract(S, X3.x, Y3.x); + SecP224K1Field.Multiply(Y3.x, M, Y3.x); + SecP224K1Field.Subtract(Y3.x, t1, Y3.x); + + SecP224K1FieldElement Z3 = new SecP224K1FieldElement(M); + SecP224K1Field.Twice(Y1.x, Z3.x); + if (!Z1.IsOne) + { + SecP224K1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP224K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP224K1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Point.cs.meta new file mode 100644 index 00000000..59e3f9ff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e6dc58928b3a6b349a413bceb4eda1f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Curve.cs new file mode 100644 index 00000000..be3ed386 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Curve.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP224R1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001")); + + private const int SECP224R1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP224R1_FE_INTS = 7; + + protected readonly SecP224R1Point m_infinity; + + public SecP224R1Curve() + : base(q) + { + this.m_infinity = new SecP224R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"))); + this.m_order = new BigInteger(1, Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D")); + this.m_cofactor = BigInteger.One; + + this.m_coord = SECP224R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP224R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP224R1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP224R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP224R1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP224R1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat224.Copy(((SecP224R1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP224R1_FE_INTS; + Nat224.Copy(((SecP224R1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP224R1_FE_INTS; + } + } + + return new SecP224R1LookupTable(this, table, len); + } + + private class SecP224R1LookupTable + : ECLookupTable + { + private readonly SecP224R1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP224R1LookupTable(SecP224R1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat224.Create(), y = Nat224.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP224R1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP224R1_FE_INTS + j] & MASK; + } + + pos += (SECP224R1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP224R1FieldElement(x), new SecP224R1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Curve.cs.meta new file mode 100644 index 00000000..de76047b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb8ec695468ca8a468dc59c7ef35e719 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Field.cs new file mode 100644 index 00000000..d2d46342 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Field.cs @@ -0,0 +1,301 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP224R1Field + { + // 2^224 - 2^96 + 1 + internal static readonly uint[] P = new uint[] { 0x00000001, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + internal static readonly uint[] PExt = new uint[]{ 0x00000001, 0x00000000, 0x00000000, 0xFFFFFFFE, 0xFFFFFFFF, + 0xFFFFFFFF, 0x00000000, 0x00000002, 0x00000000, 0x00000000, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + private static readonly uint[] PExtInv = new uint[]{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000001, 0x00000000, + 0x00000000, 0xFFFFFFFF, 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000001 }; + private const uint P6 = 0xFFFFFFFF; + private const uint PExt13 = 0xFFFFFFFF; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat224.Add(x, y, z); + if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(14, xx, yy, zz); + if (c != 0 || (zz[13] == PExt13 && Nat.Gte(14, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(14, zz, PExtInv.Length); + } + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(7, x, z); + if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat224.FromBigInteger(x); + if (z[6] == P6 && Nat224.Gte(z, P)) + { + Nat224.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(7, x, 0, z); + } + else + { + uint c = Nat224.Add(x, P, z); + Nat.ShiftDownBit(7, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat224.CreateExt(); + Nat224.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat224.MulAddTo(x, y, zz); + if (c != 0 || (zz[13] == PExt13 && Nat.Gte(14, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(14, zz, PExtInv.Length); + } + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat224.IsZero(x)) + { + Nat224.Zero(z); + } + else + { + Nat224.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + long xx10 = xx[10], xx11 = xx[11], xx12 = xx[12], xx13 = xx[13]; + + const long n = 1; + + long t0 = (long)xx[7] + xx11 - n; + long t1 = (long)xx[8] + xx12; + long t2 = (long)xx[9] + xx13; + + long cc = 0; + cc += (long)xx[0] - t0; + long z0 = (uint)cc; + cc >>= 32; + cc += (long)xx[1] - t1; + z[1] = (uint)cc; + cc >>= 32; + cc += (long)xx[2] - t2; + z[2] = (uint)cc; + cc >>= 32; + cc += (long)xx[3] + t0 - xx10; + long z3 = (uint)cc; + cc >>= 32; + cc += (long)xx[4] + t1 - xx11; + z[4] = (uint)cc; + cc >>= 32; + cc += (long)xx[5] + t2 - xx12; + z[5] = (uint)cc; + cc >>= 32; + cc += (long)xx[6] + xx10 - xx13; + z[6] = (uint)cc; + cc >>= 32; + cc += n; + + Debug.Assert(cc >= 0); + + z3 += cc; + + z0 -= cc; + z[0] = (uint)z0; + cc = z0 >> 32; + if (cc != 0) + { + cc += (long)z[1]; + z[1] = (uint)cc; + cc >>= 32; + cc += (long)z[2]; + z[2] = (uint)cc; + z3 += cc >> 32; + } + z[3] = (uint)z3; + cc = z3 >> 32; + + Debug.Assert(cc == 0 || cc == 1); + + if ((cc != 0 && Nat.IncAt(7, z, 4) != 0) + || (z[6] == P6 && Nat224.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void Reduce32(uint x, uint[] z) + { + long cc = 0; + + if (x != 0) + { + long xx07 = x; + + cc += (long)z[0] - xx07; + z[0] = (uint)cc; + cc >>= 32; + if (cc != 0) + { + cc += (long)z[1]; + z[1] = (uint)cc; + cc >>= 32; + cc += (long)z[2]; + z[2] = (uint)cc; + cc >>= 32; + } + cc += (long)z[3] + xx07; + z[3] = (uint)cc; + cc >>= 32; + + Debug.Assert(cc == 0 || cc == 1); + } + + if ((cc != 0 && Nat.IncAt(7, z, 4) != 0) + || (z[6] == P6 && Nat224.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat224.CreateExt(); + Nat224.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat224.CreateExt(); + Nat224.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat224.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat224.Sub(x, y, z); + if (c != 0) + { + SubPInvFrom(z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(14, xx, yy, zz); + if (c != 0) + { + if (Nat.SubFrom(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.DecAt(14, zz, PExtInv.Length); + } + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(7, x, 0, z); + if (c != 0 || (z[6] == P6 && Nat224.Gte(z, P))) + { + AddPInvTo(z); + } + } + + private static void AddPInvTo(uint[] z) + { + long c = (long)z[0] - 1; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2]; + z[2] = (uint)c; + c >>= 32; + } + c += (long)z[3] + 1; + z[3] = (uint)c; + c >>= 32; + if (c != 0) + { + Nat.IncAt(7, z, 4); + } + } + + private static void SubPInvFrom(uint[] z) + { + long c = (long)z[0] + 1; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2]; + z[2] = (uint)c; + c >>= 32; + } + c += (long)z[3] - 1; + z[3] = (uint)c; + c >>= 32; + if (c != 0) + { + Nat.DecAt(7, z, 4); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Field.cs.meta new file mode 100644 index 00000000..a1f4d291 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: abf1e8ca92f9be6419daf86a48e31c77 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1FieldElement.cs new file mode 100644 index 00000000..203e67e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1FieldElement.cs @@ -0,0 +1,273 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP224R1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP224R1Curve.q; + + protected internal readonly uint[] x; + + public SecP224R1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP224R1FieldElement", "x"); + + this.x = SecP224R1Field.FromBigInteger(x); + } + + public SecP224R1FieldElement() + { + this.x = Nat224.Create(); + } + + protected internal SecP224R1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat224.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat224.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat224.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat224.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SecP224R1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat224.Create(); + SecP224R1Field.Add(x, ((SecP224R1FieldElement)b).x, z); + return new SecP224R1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat224.Create(); + SecP224R1Field.AddOne(x, z); + return new SecP224R1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat224.Create(); + SecP224R1Field.Subtract(x, ((SecP224R1FieldElement)b).x, z); + return new SecP224R1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat224.Create(); + SecP224R1Field.Multiply(x, ((SecP224R1FieldElement)b).x, z); + return new SecP224R1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat224.Create(); + Mod.Invert(SecP224R1Field.P, ((SecP224R1FieldElement)b).x, z); + SecP224R1Field.Multiply(z, x, z); + return new SecP224R1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat224.Create(); + SecP224R1Field.Negate(x, z); + return new SecP224R1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat224.Create(); + SecP224R1Field.Square(x, z); + return new SecP224R1FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new SecP224R1FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat224.Create(); + Mod.Invert(SecP224R1Field.P, x, z); + return new SecP224R1FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + uint[] c = this.x; + if (Nat224.IsZero(c) || Nat224.IsOne(c)) + return this; + + uint[] nc = Nat224.Create(); + SecP224R1Field.Negate(c, nc); + + uint[] r = Mod.Random(SecP224R1Field.P); + uint[] t = Nat224.Create(); + + if (!IsSquare(c)) + return null; + + while (!TrySqrt(nc, r, t)) + { + SecP224R1Field.AddOne(r, r); + } + + SecP224R1Field.Square(t, r); + + return Nat224.Eq(c, r) ? new SecP224R1FieldElement(t) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP224R1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP224R1FieldElement); + } + + public virtual bool Equals(SecP224R1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat224.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 7); + } + + private static bool IsSquare(uint[] x) + { + uint[] t1 = Nat224.Create(); + uint[] t2 = Nat224.Create(); + Nat224.Copy(x, t1); + + for (int i = 0; i < 7; ++i) + { + Nat224.Copy(t1, t2); + SecP224R1Field.SquareN(t1, 1 << i, t1); + SecP224R1Field.Multiply(t1, t2, t1); + } + + SecP224R1Field.SquareN(t1, 95, t1); + return Nat224.IsOne(t1); + } + + private static void RM(uint[] nc, uint[] d0, uint[] e0, uint[] d1, uint[] e1, uint[] f1, uint[] t) + { + SecP224R1Field.Multiply(e1, e0, t); + SecP224R1Field.Multiply(t, nc, t); + SecP224R1Field.Multiply(d1, d0, f1); + SecP224R1Field.Add(f1, t, f1); + SecP224R1Field.Multiply(d1, e0, t); + Nat224.Copy(f1, d1); + SecP224R1Field.Multiply(e1, d0, e1); + SecP224R1Field.Add(e1, t, e1); + SecP224R1Field.Square(e1, f1); + SecP224R1Field.Multiply(f1, nc, f1); + } + + private static void RP(uint[] nc, uint[] d1, uint[] e1, uint[] f1, uint[] t) + { + Nat224.Copy(nc, f1); + + uint[] d0 = Nat224.Create(); + uint[] e0 = Nat224.Create(); + + for (int i = 0; i < 7; ++i) + { + Nat224.Copy(d1, d0); + Nat224.Copy(e1, e0); + + int j = 1 << i; + while (--j >= 0) + { + RS(d1, e1, f1, t); + } + + RM(nc, d0, e0, d1, e1, f1, t); + } + } + + private static void RS(uint[] d, uint[] e, uint[] f, uint[] t) + { + SecP224R1Field.Multiply(e, d, e); + SecP224R1Field.Twice(e, e); + SecP224R1Field.Square(d, t); + SecP224R1Field.Add(f, t, d); + SecP224R1Field.Multiply(f, t, f); + uint c = Nat.ShiftUpBits(7, f, 2, 0); + SecP224R1Field.Reduce32(c, f); + } + + private static bool TrySqrt(uint[] nc, uint[] r, uint[] t) + { + uint[] d1 = Nat224.Create(); + Nat224.Copy(r, d1); + uint[] e1 = Nat224.Create(); + e1[0] = 1; + uint[] f1 = Nat224.Create(); + RP(nc, d1, e1, f1, t); + + uint[] d0 = Nat224.Create(); + uint[] e0 = Nat224.Create(); + + for (int k = 1; k < 96; ++k) + { + Nat224.Copy(d1, d0); + Nat224.Copy(e1, e0); + + RS(d1, e1, f1, t); + + if (Nat224.IsZero(d1)) + { + Mod.Invert(SecP224R1Field.P, e0, t); + SecP224R1Field.Multiply(t, d0, t); + return true; + } + } + + return false; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1FieldElement.cs.meta new file mode 100644 index 00000000..5d58bf2e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef2e59a1deebf7d429a3167b9ff6fed8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Point.cs new file mode 100644 index 00000000..c3f52507 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Point.cs @@ -0,0 +1,283 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP224R1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecP224R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP224R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP224R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP224R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP224R1FieldElement X1 = (SecP224R1FieldElement)this.RawXCoord, Y1 = (SecP224R1FieldElement)this.RawYCoord; + SecP224R1FieldElement X2 = (SecP224R1FieldElement)b.RawXCoord, Y2 = (SecP224R1FieldElement)b.RawYCoord; + + SecP224R1FieldElement Z1 = (SecP224R1FieldElement)this.RawZCoords[0]; + SecP224R1FieldElement Z2 = (SecP224R1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat224.CreateExt(); + uint[] t2 = Nat224.Create(); + uint[] t3 = Nat224.Create(); + uint[] t4 = Nat224.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP224R1Field.Square(Z1.x, S2); + + U2 = t2; + SecP224R1Field.Multiply(S2, X2.x, U2); + + SecP224R1Field.Multiply(S2, Z1.x, S2); + SecP224R1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP224R1Field.Square(Z2.x, S1); + + U1 = tt1; + SecP224R1Field.Multiply(S1, X1.x, U1); + + SecP224R1Field.Multiply(S1, Z2.x, S1); + SecP224R1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat224.Create(); + SecP224R1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP224R1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat224.IsZero(H)) + { + if (Nat224.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP224R1Field.Square(H, HSquared); + + uint[] G = Nat224.Create(); + SecP224R1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP224R1Field.Multiply(HSquared, U1, V); + + SecP224R1Field.Negate(G, G); + Nat224.Mul(S1, G, tt1); + + c = Nat224.AddBothTo(V, V, G); + SecP224R1Field.Reduce32(c, G); + + SecP224R1FieldElement X3 = new SecP224R1FieldElement(t4); + SecP224R1Field.Square(R, X3.x); + SecP224R1Field.Subtract(X3.x, G, X3.x); + + SecP224R1FieldElement Y3 = new SecP224R1FieldElement(G); + SecP224R1Field.Subtract(V, X3.x, Y3.x); + SecP224R1Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP224R1Field.Reduce(tt1, Y3.x); + + SecP224R1FieldElement Z3 = new SecP224R1FieldElement(H); + if (!Z1IsOne) + { + SecP224R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP224R1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[] { Z3 }; + + return new SecP224R1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP224R1FieldElement Y1 = (SecP224R1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP224R1FieldElement X1 = (SecP224R1FieldElement)this.RawXCoord, Z1 = (SecP224R1FieldElement)this.RawZCoords[0]; + + uint c; + uint[] t1 = Nat224.Create(); + uint[] t2 = Nat224.Create(); + + uint[] Y1Squared = Nat224.Create(); + SecP224R1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat224.Create(); + SecP224R1Field.Square(Y1Squared, T); + + bool Z1IsOne = Z1.IsOne; + + uint[] Z1Squared = Z1.x; + if (!Z1IsOne) + { + Z1Squared = t2; + SecP224R1Field.Square(Z1.x, Z1Squared); + } + + SecP224R1Field.Subtract(X1.x, Z1Squared, t1); + + uint[] M = t2; + SecP224R1Field.Add(X1.x, Z1Squared, M); + SecP224R1Field.Multiply(M, t1, M); + c = Nat224.AddBothTo(M, M, M); + SecP224R1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP224R1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(7, S, 2, 0); + SecP224R1Field.Reduce32(c, S); + + c = Nat.ShiftUpBits(7, T, 3, 0, t1); + SecP224R1Field.Reduce32(c, t1); + + SecP224R1FieldElement X3 = new SecP224R1FieldElement(T); + SecP224R1Field.Square(M, X3.x); + SecP224R1Field.Subtract(X3.x, S, X3.x); + SecP224R1Field.Subtract(X3.x, S, X3.x); + + SecP224R1FieldElement Y3 = new SecP224R1FieldElement(S); + SecP224R1Field.Subtract(S, X3.x, Y3.x); + SecP224R1Field.Multiply(Y3.x, M, Y3.x); + SecP224R1Field.Subtract(Y3.x, t1, Y3.x); + + SecP224R1FieldElement Z3 = new SecP224R1FieldElement(M); + SecP224R1Field.Twice(Y1.x, Z3.x); + if (!Z1IsOne) + { + SecP224R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP224R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP224R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Point.cs.meta new file mode 100644 index 00000000..5eedfa28 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP224R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: df4725d3321a1f446b488fceaefa3b0d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Curve.cs new file mode 100644 index 00000000..c36cb6de --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Curve.cs @@ -0,0 +1,138 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP256K1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F")); + + private const int SECP256K1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP256K1_FE_INTS = 8; + + protected readonly SecP256K1Point m_infinity; + + public SecP256K1Curve() + : base(q) + { + this.m_infinity = new SecP256K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.Zero); + this.m_b = FromBigInteger(BigInteger.ValueOf(7)); + this.m_order = new BigInteger(1, Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141")); + this.m_cofactor = BigInteger.One; + this.m_coord = SECP256K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP256K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP256K1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP256K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP256K1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP256K1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat256.Copy(((SecP256K1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP256K1_FE_INTS; + Nat256.Copy(((SecP256K1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP256K1_FE_INTS; + } + } + + return new SecP256K1LookupTable(this, table, len); + } + + private class SecP256K1LookupTable + : ECLookupTable + { + private readonly SecP256K1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP256K1LookupTable(SecP256K1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat256.Create(), y = Nat256.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP256K1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP256K1_FE_INTS + j] & MASK; + } + + pos += (SECP256K1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP256K1FieldElement(x), new SecP256K1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Curve.cs.meta new file mode 100644 index 00000000..6907cd01 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3137bda46ccd4c4bb49936df865386e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Field.cs new file mode 100644 index 00000000..e9be5530 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Field.cs @@ -0,0 +1,184 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP256K1Field + { + // 2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFFC2F, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF }; + internal static readonly uint[] PExt = new uint[]{ 0x000E90A1, 0x000007A2, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xFFFFF85E, 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF }; + private static readonly uint[] PExtInv = new uint[]{ 0xFFF16F5F, 0xFFFFF85D, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x000007A1, 0x00000002 }; + private const uint P7 = 0xFFFFFFFF; + private const uint PExt15 = 0xFFFFFFFF; + private const uint PInv33 = 0x3D1; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat256.Add(x, y, z); + if (c != 0 || (z[7] == P7 && Nat256.Gte(z, P))) + { + Nat.Add33To(8, PInv33, z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(16, xx, yy, zz); + if (c != 0 || (zz[15] == PExt15 && Nat.Gte(16, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(16, zz, PExtInv.Length); + } + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(8, x, z); + if (c != 0 || (z[7] == P7 && Nat256.Gte(z, P))) + { + Nat.Add33To(8, PInv33, z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat256.FromBigInteger(x); + if (z[7] == P7 && Nat256.Gte(z, P)) + { + Nat256.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(8, x, 0, z); + } + else + { + uint c = Nat256.Add(x, P, z); + Nat.ShiftDownBit(8, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat256.CreateExt(); + Nat256.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat256.MulAddTo(x, y, zz); + if (c != 0 || (zz[15] == PExt15 && Nat.Gte(16, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(16, zz, PExtInv.Length); + } + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat256.IsZero(x)) + { + Nat256.Zero(z); + } + else + { + Nat256.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + ulong cc = Nat256.Mul33Add(PInv33, xx, 8, xx, 0, z, 0); + uint c = Nat256.Mul33DWordAdd(PInv33, cc, z, 0); + + Debug.Assert(c == 0 || c == 1); + + if (c != 0 || (z[7] == P7 && Nat256.Gte(z, P))) + { + Nat.Add33To(8, PInv33, z); + } + } + + public static void Reduce32(uint x, uint[] z) + { + if ((x != 0 && Nat256.Mul33WordAdd(PInv33, x, z, 0) != 0) + || (z[7] == P7 && Nat256.Gte(z, P))) + { + Nat.Add33To(8, PInv33, z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat256.CreateExt(); + Nat256.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat256.CreateExt(); + Nat256.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat256.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat256.Sub(x, y, z); + if (c != 0) + { + Nat.Sub33From(8, PInv33, z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(16, xx, yy, zz); + if (c != 0) + { + if (Nat.SubFrom(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.DecAt(16, zz, PExtInv.Length); + } + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(8, x, 0, z); + if (c != 0 || (z[7] == P7 && Nat256.Gte(z, P))) + { + Nat.Add33To(8, PInv33, z); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Field.cs.meta new file mode 100644 index 00000000..4e1047c4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5ed5c34ec10613418e2f1623a468b12 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1FieldElement.cs new file mode 100644 index 00000000..67e5bb3d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1FieldElement.cs @@ -0,0 +1,218 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP256K1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP256K1Curve.q; + + protected internal readonly uint[] x; + + public SecP256K1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP256K1FieldElement", "x"); + + this.x = SecP256K1Field.FromBigInteger(x); + } + + public SecP256K1FieldElement() + { + this.x = Nat256.Create(); + } + + protected internal SecP256K1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat256.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat256.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat256.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat256.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SecP256K1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat256.Create(); + SecP256K1Field.Add(x, ((SecP256K1FieldElement)b).x, z); + return new SecP256K1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat256.Create(); + SecP256K1Field.AddOne(x, z); + return new SecP256K1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat256.Create(); + SecP256K1Field.Subtract(x, ((SecP256K1FieldElement)b).x, z); + return new SecP256K1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat256.Create(); + SecP256K1Field.Multiply(x, ((SecP256K1FieldElement)b).x, z); + return new SecP256K1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat256.Create(); + Mod.Invert(SecP256K1Field.P, ((SecP256K1FieldElement)b).x, z); + SecP256K1Field.Multiply(z, x, z); + return new SecP256K1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat256.Create(); + SecP256K1Field.Negate(x, z); + return new SecP256K1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat256.Create(); + SecP256K1Field.Square(x, z); + return new SecP256K1FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new SecP256K1FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat256.Create(); + Mod.Invert(SecP256K1Field.P, x, z); + return new SecP256K1FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + /* + * Raise this element to the exponent 2^254 - 2^30 - 2^7 - 2^6 - 2^5 - 2^4 - 2^2 + * + * Breaking up the exponent's binary representation into "repunits", we get: + * { 223 1s } { 1 0s } { 22 1s } { 4 0s } { 2 1s } { 2 0s} + * + * Therefore we need an addition chain containing 2, 22, 223 (the lengths of the repunits) + * We use: 1, [2], 3, 6, 9, 11, [22], 44, 88, 176, 220, [223] + */ + + uint[] x1 = this.x; + if (Nat256.IsZero(x1) || Nat256.IsOne(x1)) + return this; + + uint[] x2 = Nat256.Create(); + SecP256K1Field.Square(x1, x2); + SecP256K1Field.Multiply(x2, x1, x2); + uint[] x3 = Nat256.Create(); + SecP256K1Field.Square(x2, x3); + SecP256K1Field.Multiply(x3, x1, x3); + uint[] x6 = Nat256.Create(); + SecP256K1Field.SquareN(x3, 3, x6); + SecP256K1Field.Multiply(x6, x3, x6); + uint[] x9 = x6; + SecP256K1Field.SquareN(x6, 3, x9); + SecP256K1Field.Multiply(x9, x3, x9); + uint[] x11 = x9; + SecP256K1Field.SquareN(x9, 2, x11); + SecP256K1Field.Multiply(x11, x2, x11); + uint[] x22 = Nat256.Create(); + SecP256K1Field.SquareN(x11, 11, x22); + SecP256K1Field.Multiply(x22, x11, x22); + uint[] x44 = x11; + SecP256K1Field.SquareN(x22, 22, x44); + SecP256K1Field.Multiply(x44, x22, x44); + uint[] x88 = Nat256.Create(); + SecP256K1Field.SquareN(x44, 44, x88); + SecP256K1Field.Multiply(x88, x44, x88); + uint[] x176 = Nat256.Create(); + SecP256K1Field.SquareN(x88, 88, x176); + SecP256K1Field.Multiply(x176, x88, x176); + uint[] x220 = x88; + SecP256K1Field.SquareN(x176, 44, x220); + SecP256K1Field.Multiply(x220, x44, x220); + uint[] x223 = x44; + SecP256K1Field.SquareN(x220, 3, x223); + SecP256K1Field.Multiply(x223, x3, x223); + + uint[] t1 = x223; + SecP256K1Field.SquareN(t1, 23, t1); + SecP256K1Field.Multiply(t1, x22, t1); + SecP256K1Field.SquareN(t1, 6, t1); + SecP256K1Field.Multiply(t1, x2, t1); + SecP256K1Field.SquareN(t1, 2, t1); + + uint[] t2 = x2; + SecP256K1Field.Square(t1, t2); + + return Nat256.Eq(x1, t2) ? new SecP256K1FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP256K1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP256K1FieldElement); + } + + public virtual bool Equals(SecP256K1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat256.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 8); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1FieldElement.cs.meta new file mode 100644 index 00000000..a0858a90 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f8852f71d5b64f439a369f3df96cd2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Point.cs new file mode 100644 index 00000000..1244399b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Point.cs @@ -0,0 +1,271 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP256K1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecP256K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP256K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP256K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, + bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP256K1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP256K1FieldElement X1 = (SecP256K1FieldElement)this.RawXCoord, Y1 = (SecP256K1FieldElement)this.RawYCoord; + SecP256K1FieldElement X2 = (SecP256K1FieldElement)b.RawXCoord, Y2 = (SecP256K1FieldElement)b.RawYCoord; + + SecP256K1FieldElement Z1 = (SecP256K1FieldElement)this.RawZCoords[0]; + SecP256K1FieldElement Z2 = (SecP256K1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat256.CreateExt(); + uint[] t2 = Nat256.Create(); + uint[] t3 = Nat256.Create(); + uint[] t4 = Nat256.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP256K1Field.Square(Z1.x, S2); + + U2 = t2; + SecP256K1Field.Multiply(S2, X2.x, U2); + + SecP256K1Field.Multiply(S2, Z1.x, S2); + SecP256K1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP256K1Field.Square(Z2.x, S1); + + U1 = tt1; + SecP256K1Field.Multiply(S1, X1.x, U1); + + SecP256K1Field.Multiply(S1, Z2.x, S1); + SecP256K1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat256.Create(); + SecP256K1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP256K1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat256.IsZero(H)) + { + if (Nat256.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP256K1Field.Square(H, HSquared); + + uint[] G = Nat256.Create(); + SecP256K1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP256K1Field.Multiply(HSquared, U1, V); + + SecP256K1Field.Negate(G, G); + Nat256.Mul(S1, G, tt1); + + c = Nat256.AddBothTo(V, V, G); + SecP256K1Field.Reduce32(c, G); + + SecP256K1FieldElement X3 = new SecP256K1FieldElement(t4); + SecP256K1Field.Square(R, X3.x); + SecP256K1Field.Subtract(X3.x, G, X3.x); + + SecP256K1FieldElement Y3 = new SecP256K1FieldElement(G); + SecP256K1Field.Subtract(V, X3.x, Y3.x); + SecP256K1Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP256K1Field.Reduce(tt1, Y3.x); + + SecP256K1FieldElement Z3 = new SecP256K1FieldElement(H); + if (!Z1IsOne) + { + SecP256K1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP256K1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[] { Z3 }; + + return new SecP256K1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP256K1FieldElement Y1 = (SecP256K1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP256K1FieldElement X1 = (SecP256K1FieldElement)this.RawXCoord, Z1 = (SecP256K1FieldElement)this.RawZCoords[0]; + + uint c; + + uint[] Y1Squared = Nat256.Create(); + SecP256K1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat256.Create(); + SecP256K1Field.Square(Y1Squared, T); + + uint[] M = Nat256.Create(); + SecP256K1Field.Square(X1.x, M); + c = Nat256.AddBothTo(M, M, M); + SecP256K1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP256K1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(8, S, 2, 0); + SecP256K1Field.Reduce32(c, S); + + uint[] t1 = Nat256.Create(); + c = Nat.ShiftUpBits(8, T, 3, 0, t1); + SecP256K1Field.Reduce32(c, t1); + + SecP256K1FieldElement X3 = new SecP256K1FieldElement(T); + SecP256K1Field.Square(M, X3.x); + SecP256K1Field.Subtract(X3.x, S, X3.x); + SecP256K1Field.Subtract(X3.x, S, X3.x); + + SecP256K1FieldElement Y3 = new SecP256K1FieldElement(S); + SecP256K1Field.Subtract(S, X3.x, Y3.x); + SecP256K1Field.Multiply(Y3.x, M, Y3.x); + SecP256K1Field.Subtract(Y3.x, t1, Y3.x); + + SecP256K1FieldElement Z3 = new SecP256K1FieldElement(M); + SecP256K1Field.Twice(Y1.x, Z3.x); + if (!Z1.IsOne) + { + SecP256K1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP256K1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP256K1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Point.cs.meta new file mode 100644 index 00000000..571c01a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee1f2beef4a01324fa3a7977b6e572cd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Curve.cs new file mode 100644 index 00000000..487000f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Curve.cs @@ -0,0 +1,140 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP256R1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF")); + + private const int SECP256R1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP256R1_FE_INTS = 8; + + protected readonly SecP256R1Point m_infinity; + + public SecP256R1Curve() + : base(q) + { + this.m_infinity = new SecP256R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"))); + this.m_order = new BigInteger(1, Hex.Decode("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551")); + this.m_cofactor = BigInteger.One; + this.m_coord = SECP256R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP256R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP256R1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP256R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP256R1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP256R1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat256.Copy(((SecP256R1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP256R1_FE_INTS; + Nat256.Copy(((SecP256R1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP256R1_FE_INTS; + } + } + + return new SecP256R1LookupTable(this, table, len); + } + + private class SecP256R1LookupTable + : ECLookupTable + { + private readonly SecP256R1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP256R1LookupTable(SecP256R1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat256.Create(), y = Nat256.Create(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + uint MASK = (uint)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECP256R1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP256R1_FE_INTS + j] & MASK; + } + + pos += (SECP256R1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP256R1FieldElement(x), new SecP256R1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Curve.cs.meta new file mode 100644 index 00000000..bc730b17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 082371a7f8084154d966a0083ae04fd7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Field.cs new file mode 100644 index 00000000..60cc6589 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Field.cs @@ -0,0 +1,316 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP256R1Field + { + // 2^256 - 2^224 + 2^192 + 2^96 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000, 0x00000000, + 0x00000001, 0xFFFFFFFF }; + internal static readonly uint[] PExt = new uint[]{ 0x00000001, 0x00000000, 0x00000000, 0xFFFFFFFE, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFE, 0x00000001, 0xFFFFFFFE, 0x00000001, 0xFFFFFFFE, 0x00000001, 0x00000001, 0xFFFFFFFE, + 0x00000002, 0xFFFFFFFE }; + internal const uint P7 = 0xFFFFFFFF; + internal const uint PExt15 = 0xFFFFFFFE; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat256.Add(x, y, z); + if (c != 0 || (z[7] == P7 && Nat256.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(16, xx, yy, zz); + if (c != 0 || (zz[15] >= PExt15 && Nat.Gte(16, zz, PExt))) + { + Nat.SubFrom(16, PExt, zz); + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(8, x, z); + if (c != 0 || (z[7] == P7 && Nat256.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat256.FromBigInteger(x); + if (z[7] == P7 && Nat256.Gte(z, P)) + { + Nat256.SubFrom(P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(8, x, 0, z); + } + else + { + uint c = Nat256.Add(x, P, z); + Nat.ShiftDownBit(8, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat256.CreateExt(); + Nat256.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(uint[] x, uint[] y, uint[] zz) + { + uint c = Nat256.MulAddTo(x, y, zz); + if (c != 0 || (zz[15] >= PExt15 && Nat.Gte(16, zz, PExt))) + { + Nat.SubFrom(16, PExt, zz); + } + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat256.IsZero(x)) + { + Nat256.Zero(z); + } + else + { + Nat256.Sub(P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + long xx08 = xx[8], xx09 = xx[9], xx10 = xx[10], xx11 = xx[11]; + long xx12 = xx[12], xx13 = xx[13], xx14 = xx[14], xx15 = xx[15]; + + const long n = 6; + + xx08 -= n; + + long t0 = xx08 + xx09; + long t1 = xx09 + xx10; + long t2 = xx10 + xx11 - xx15; + long t3 = xx11 + xx12; + long t4 = xx12 + xx13; + long t5 = xx13 + xx14; + long t6 = xx14 + xx15; + long t7 = t5 - t0; + + long cc = 0; + cc += (long)xx[0] - t3 - t7; + z[0] = (uint)cc; + cc >>= 32; + cc += (long)xx[1] + t1 - t4 - t6; + z[1] = (uint)cc; + cc >>= 32; + cc += (long)xx[2] + t2 - t5; + z[2] = (uint)cc; + cc >>= 32; + cc += (long)xx[3] + (t3 << 1) + t7 - t6; + z[3] = (uint)cc; + cc >>= 32; + cc += (long)xx[4] + (t4 << 1) + xx14 - t1; + z[4] = (uint)cc; + cc >>= 32; + cc += (long)xx[5] + (t5 << 1) - t2; + z[5] = (uint)cc; + cc >>= 32; + cc += (long)xx[6] + (t6 << 1) + t7; + z[6] = (uint)cc; + cc >>= 32; + cc += (long)xx[7] + (xx15 << 1) + xx08 - t2 - t4; + z[7] = (uint)cc; + cc >>= 32; + cc += n; + + Debug.Assert(cc >= 0); + + Reduce32((uint)cc, z); + } + + public static void Reduce32(uint x, uint[] z) + { + long cc = 0; + + if (x != 0) + { + long xx08 = x; + + cc += (long)z[0] + xx08; + z[0] = (uint)cc; + cc >>= 32; + if (cc != 0) + { + cc += (long)z[1]; + z[1] = (uint)cc; + cc >>= 32; + cc += (long)z[2]; + z[2] = (uint)cc; + cc >>= 32; + } + cc += (long)z[3] - xx08; + z[3] = (uint)cc; + cc >>= 32; + if (cc != 0) + { + cc += (long)z[4]; + z[4] = (uint)cc; + cc >>= 32; + cc += (long)z[5]; + z[5] = (uint)cc; + cc >>= 32; + } + cc += (long)z[6] - xx08; + z[6] = (uint)cc; + cc >>= 32; + cc += (long)z[7] + xx08; + z[7] = (uint)cc; + cc >>= 32; + + Debug.Assert(cc == 0 || cc == 1); + } + + if (cc != 0 || (z[7] == P7 && Nat256.Gte(z, P))) + { + AddPInvTo(z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat256.CreateExt(); + Nat256.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat256.CreateExt(); + Nat256.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat256.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat256.Sub(x, y, z); + if (c != 0) + { + SubPInvFrom(z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(16, xx, yy, zz); + if (c != 0) + { + Nat.AddTo(16, PExt, zz); + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(8, x, 0, z); + if (c != 0 || (z[7] == P7 && Nat256.Gte(z, P))) + { + AddPInvTo(z); + } + } + + private static void AddPInvTo(uint[] z) + { + long c = (long)z[0] + 1; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2]; + z[2] = (uint)c; + c >>= 32; + } + c += (long)z[3] - 1; + z[3] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5]; + z[5] = (uint)c; + c >>= 32; + } + c += (long)z[6] - 1; + z[6] = (uint)c; + c >>= 32; + c += (long)z[7] + 1; + z[7] = (uint)c; + //c >>= 32; + } + + private static void SubPInvFrom(uint[] z) + { + long c = (long)z[0] - 1; + z[0] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2]; + z[2] = (uint)c; + c >>= 32; + } + c += (long)z[3] + 1; + z[3] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5]; + z[5] = (uint)c; + c >>= 32; + } + c += (long)z[6] + 1; + z[6] = (uint)c; + c >>= 32; + c += (long)z[7] - 1; + z[7] = (uint)c; + //c >>= 32; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Field.cs.meta new file mode 100644 index 00000000..c5965b7d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 47c20e25c05835646935a6ff01c312d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1FieldElement.cs new file mode 100644 index 00000000..5b60bde4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1FieldElement.cs @@ -0,0 +1,192 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP256R1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP256R1Curve.q; + + protected internal readonly uint[] x; + + public SecP256R1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP256R1FieldElement", "x"); + + this.x = SecP256R1Field.FromBigInteger(x); + } + + public SecP256R1FieldElement() + { + this.x = Nat256.Create(); + } + + protected internal SecP256R1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat256.IsZero(x); } + } + + public override bool IsOne + { + get { return Nat256.IsOne(x); } + } + + public override bool TestBitZero() + { + return Nat256.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat256.ToBigInteger(x); + } + + public override string FieldName + { + get { return "SecP256R1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat256.Create(); + SecP256R1Field.Add(x, ((SecP256R1FieldElement)b).x, z); + return new SecP256R1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat256.Create(); + SecP256R1Field.AddOne(x, z); + return new SecP256R1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat256.Create(); + SecP256R1Field.Subtract(x, ((SecP256R1FieldElement)b).x, z); + return new SecP256R1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat256.Create(); + SecP256R1Field.Multiply(x, ((SecP256R1FieldElement)b).x, z); + return new SecP256R1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat256.Create(); + Mod.Invert(SecP256R1Field.P, ((SecP256R1FieldElement)b).x, z); + SecP256R1Field.Multiply(z, x, z); + return new SecP256R1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat256.Create(); + SecP256R1Field.Negate(x, z); + return new SecP256R1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat256.Create(); + SecP256R1Field.Square(x, z); + return new SecP256R1FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new SecP256R1FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat256.Create(); + Mod.Invert(SecP256R1Field.P, x, z); + return new SecP256R1FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + // Raise this element to the exponent 2^254 - 2^222 + 2^190 + 2^94 + + uint[] x1 = this.x; + if (Nat256.IsZero(x1) || Nat256.IsOne(x1)) + return this; + + uint[] t1 = Nat256.Create(); + uint[] t2 = Nat256.Create(); + + SecP256R1Field.Square(x1, t1); + SecP256R1Field.Multiply(t1, x1, t1); + + SecP256R1Field.SquareN(t1, 2, t2); + SecP256R1Field.Multiply(t2, t1, t2); + + SecP256R1Field.SquareN(t2, 4, t1); + SecP256R1Field.Multiply(t1, t2, t1); + + SecP256R1Field.SquareN(t1, 8, t2); + SecP256R1Field.Multiply(t2, t1, t2); + + SecP256R1Field.SquareN(t2, 16, t1); + SecP256R1Field.Multiply(t1, t2, t1); + + SecP256R1Field.SquareN(t1, 32, t1); + SecP256R1Field.Multiply(t1, x1, t1); + + SecP256R1Field.SquareN(t1, 96, t1); + SecP256R1Field.Multiply(t1, x1, t1); + + SecP256R1Field.SquareN(t1, 94, t1); + SecP256R1Field.Multiply(t1, t1, t2); + + return Nat256.Eq(x1, t2) ? new SecP256R1FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP256R1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP256R1FieldElement); + } + + public virtual bool Equals(SecP256R1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat256.Eq(x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 8); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1FieldElement.cs.meta new file mode 100644 index 00000000..5a3cff57 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3674fc76d2fd5954ead730124f209893 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Point.cs new file mode 100644 index 00000000..7e802914 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Point.cs @@ -0,0 +1,283 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP256R1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecP256R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP256R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP256R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP256R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP256R1FieldElement X1 = (SecP256R1FieldElement)this.RawXCoord, Y1 = (SecP256R1FieldElement)this.RawYCoord; + SecP256R1FieldElement X2 = (SecP256R1FieldElement)b.RawXCoord, Y2 = (SecP256R1FieldElement)b.RawYCoord; + + SecP256R1FieldElement Z1 = (SecP256R1FieldElement)this.RawZCoords[0]; + SecP256R1FieldElement Z2 = (SecP256R1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat256.CreateExt(); + uint[] t2 = Nat256.Create(); + uint[] t3 = Nat256.Create(); + uint[] t4 = Nat256.Create(); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP256R1Field.Square(Z1.x, S2); + + U2 = t2; + SecP256R1Field.Multiply(S2, X2.x, U2); + + SecP256R1Field.Multiply(S2, Z1.x, S2); + SecP256R1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP256R1Field.Square(Z2.x, S1); + + U1 = tt1; + SecP256R1Field.Multiply(S1, X1.x, U1); + + SecP256R1Field.Multiply(S1, Z2.x, S1); + SecP256R1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat256.Create(); + SecP256R1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP256R1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat256.IsZero(H)) + { + if (Nat256.IsZero(R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP256R1Field.Square(H, HSquared); + + uint[] G = Nat256.Create(); + SecP256R1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP256R1Field.Multiply(HSquared, U1, V); + + SecP256R1Field.Negate(G, G); + Nat256.Mul(S1, G, tt1); + + c = Nat256.AddBothTo(V, V, G); + SecP256R1Field.Reduce32(c, G); + + SecP256R1FieldElement X3 = new SecP256R1FieldElement(t4); + SecP256R1Field.Square(R, X3.x); + SecP256R1Field.Subtract(X3.x, G, X3.x); + + SecP256R1FieldElement Y3 = new SecP256R1FieldElement(G); + SecP256R1Field.Subtract(V, X3.x, Y3.x); + SecP256R1Field.MultiplyAddToExt(Y3.x, R, tt1); + SecP256R1Field.Reduce(tt1, Y3.x); + + SecP256R1FieldElement Z3 = new SecP256R1FieldElement(H); + if (!Z1IsOne) + { + SecP256R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP256R1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[]{ Z3 }; + + return new SecP256R1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP256R1FieldElement Y1 = (SecP256R1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP256R1FieldElement X1 = (SecP256R1FieldElement)this.RawXCoord, Z1 = (SecP256R1FieldElement)this.RawZCoords[0]; + + uint c; + uint[] t1 = Nat256.Create(); + uint[] t2 = Nat256.Create(); + + uint[] Y1Squared = Nat256.Create(); + SecP256R1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat256.Create(); + SecP256R1Field.Square(Y1Squared, T); + + bool Z1IsOne = Z1.IsOne; + + uint[] Z1Squared = Z1.x; + if (!Z1IsOne) + { + Z1Squared = t2; + SecP256R1Field.Square(Z1.x, Z1Squared); + } + + SecP256R1Field.Subtract(X1.x, Z1Squared, t1); + + uint[] M = t2; + SecP256R1Field.Add(X1.x, Z1Squared, M); + SecP256R1Field.Multiply(M, t1, M); + c = Nat256.AddBothTo(M, M, M); + SecP256R1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP256R1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(8, S, 2, 0); + SecP256R1Field.Reduce32(c, S); + + c = Nat.ShiftUpBits(8, T, 3, 0, t1); + SecP256R1Field.Reduce32(c, t1); + + SecP256R1FieldElement X3 = new SecP256R1FieldElement(T); + SecP256R1Field.Square(M, X3.x); + SecP256R1Field.Subtract(X3.x, S, X3.x); + SecP256R1Field.Subtract(X3.x, S, X3.x); + + SecP256R1FieldElement Y3 = new SecP256R1FieldElement(S); + SecP256R1Field.Subtract(S, X3.x, Y3.x); + SecP256R1Field.Multiply(Y3.x, M, Y3.x); + SecP256R1Field.Subtract(Y3.x, t1, Y3.x); + + SecP256R1FieldElement Z3 = new SecP256R1FieldElement(M); + SecP256R1Field.Twice(Y1.x, Z3.x); + if (!Z1IsOne) + { + SecP256R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP256R1Point(curve, X3, Y3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP256R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Point.cs.meta new file mode 100644 index 00000000..2eb8b064 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP256R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 499c5c0285ffb474d88685f7bfadfcd9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Curve.cs new file mode 100644 index 00000000..27d3a252 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Curve.cs @@ -0,0 +1,140 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP384R1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF")); + + private const int SECP384R1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP384R1_FE_INTS = 12; + + protected readonly SecP384R1Point m_infinity; + + public SecP384R1Curve() + : base(q) + { + this.m_infinity = new SecP384R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF"))); + this.m_order = new BigInteger(1, Hex.Decode("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973")); + this.m_cofactor = BigInteger.One; + this.m_coord = SECP384R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP384R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP384R1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP384R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP384R1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP384R1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat.Copy(SECP384R1_FE_INTS, ((SecP384R1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP384R1_FE_INTS; + Nat.Copy(SECP384R1_FE_INTS, ((SecP384R1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP384R1_FE_INTS; + } + } + + return new SecP384R1LookupTable(this, table, len); + } + + private class SecP384R1LookupTable + : ECLookupTable + { + private readonly SecP384R1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP384R1LookupTable(SecP384R1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + 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); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Curve.cs.meta new file mode 100644 index 00000000..cda33812 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 75aff1f4132681d428a0d2eb9daaddfe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Field.cs new file mode 100644 index 00000000..605f34e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Field.cs @@ -0,0 +1,299 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP384R1Field + { + // 2^384 - 2^128 - 2^96 + 2^32 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFFFFF, 0x00000000, 0x00000000, 0xFFFFFFFF, 0xFFFFFFFE, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + internal static readonly uint[] PExt = new uint[]{ 0x00000001, 0xFFFFFFFE, 0x00000000, 0x00000002, 0x00000000, 0xFFFFFFFE, + 0x00000000, 0x00000002, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFE, 0x00000001, 0x00000000, + 0xFFFFFFFE, 0xFFFFFFFD, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; + private static readonly uint[] PExtInv = new uint[]{ 0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0xFFFFFFFD, 0xFFFFFFFF, 0x00000001, + 0xFFFFFFFF, 0xFFFFFFFD, 0xFFFFFFFE, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF, + 0x00000001, 0x00000002 }; + private const uint P11 = 0xFFFFFFFF; + private const uint PExt23 = 0xFFFFFFFF; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat.Add(12, x, y, z); + if (c != 0 || (z[11] == P11 && Nat.Gte(12, z, P))) + { + AddPInvTo(z); + } + } + + public static void AddExt(uint[] xx, uint[] yy, uint[] zz) + { + uint c = Nat.Add(24, xx, yy, zz); + if (c != 0 || (zz[23] == PExt23 && Nat.Gte(24, zz, PExt))) + { + if (Nat.AddTo(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.IncAt(24, zz, PExtInv.Length); + } + } + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(12, x, z); + if (c != 0 || (z[11] == P11 && Nat.Gte(12, z, P))) + { + AddPInvTo(z); + } + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat.FromBigInteger(384, x); + if (z[11] == P11 && Nat.Gte(12, z, P)) + { + Nat.SubFrom(12, P, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + if ((x[0] & 1) == 0) + { + Nat.ShiftDownBit(12, x, 0, z); + } + else + { + uint c = Nat.Add(12, x, P, z); + Nat.ShiftDownBit(12, z, c); + } + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat.Create(24); + Nat384.Mul(x, y, tt); + Reduce(tt, z); + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat.IsZero(12, x)) + { + Nat.Zero(12, z); + } + else + { + Nat.Sub(12, P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + long xx16 = xx[16], xx17 = xx[17], xx18 = xx[18], xx19 = xx[19]; + long xx20 = xx[20], xx21 = xx[21], xx22 = xx[22], xx23 = xx[23]; + + const long n = 1; + + long t0 = (long)xx[12] + xx20 - n; + long t1 = (long)xx[13] + xx22; + long t2 = (long)xx[14] + xx22 + xx23; + long t3 = (long)xx[15] + xx23; + long t4 = xx17 + xx21; + long t5 = xx21 - xx23; + long t6 = xx22 - xx23; + long t7 = t0 + t5; + + long cc = 0; + cc += (long)xx[0] + t7; + z[0] = (uint)cc; + cc >>= 32; + cc += (long)xx[1] + xx23 - t0 + t1; + z[1] = (uint)cc; + cc >>= 32; + cc += (long)xx[2] - xx21 - t1 + t2; + z[2] = (uint)cc; + cc >>= 32; + cc += (long)xx[3] - t2 + t3 + t7; + z[3] = (uint)cc; + cc >>= 32; + cc += (long)xx[4] + xx16 + xx21 + t1 - t3 + t7; + z[4] = (uint)cc; + cc >>= 32; + cc += (long)xx[5] - xx16 + t1 + t2 + t4; + z[5] = (uint)cc; + cc >>= 32; + cc += (long)xx[6] + xx18 - xx17 + t2 + t3; + z[6] = (uint)cc; + cc >>= 32; + cc += (long)xx[7] + xx16 + xx19 - xx18 + t3; + z[7] = (uint)cc; + cc >>= 32; + cc += (long)xx[8] + xx16 + xx17 + xx20 - xx19; + z[8] = (uint)cc; + cc >>= 32; + cc += (long)xx[9] + xx18 - xx20 + t4; + z[9] = (uint)cc; + cc >>= 32; + cc += (long)xx[10] + xx18 + xx19 - t5 + t6; + z[10] = (uint)cc; + cc >>= 32; + cc += (long)xx[11] + xx19 + xx20 - t6; + z[11] = (uint)cc; + cc >>= 32; + cc += n; + + Debug.Assert(cc >= 0); + + Reduce32((uint)cc, z); + } + + public static void Reduce32(uint x, uint[] z) + { + long cc = 0; + + if (x != 0) + { + long xx12 = x; + + cc += (long)z[0] + xx12; + z[0] = (uint)cc; + cc >>= 32; + cc += (long)z[1] - xx12; + z[1] = (uint)cc; + cc >>= 32; + if (cc != 0) + { + cc += (long)z[2]; + z[2] = (uint)cc; + cc >>= 32; + } + cc += (long)z[3] + xx12; + z[3] = (uint)cc; + cc >>= 32; + cc += (long)z[4] + xx12; + z[4] = (uint)cc; + cc >>= 32; + + Debug.Assert(cc == 0 || cc == 1); + } + + if ((cc != 0 && Nat.IncAt(12, z, 5) != 0) + || (z[11] == P11 && Nat.Gte(12, z, P))) + { + AddPInvTo(z); + } + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat.Create(24); + Nat384.Square(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + uint[] tt = Nat.Create(24); + Nat384.Square(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + Nat384.Square(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat.Sub(12, x, y, z); + if (c != 0) + { + SubPInvFrom(z); + } + } + + public static void SubtractExt(uint[] xx, uint[] yy, uint[] zz) + { + int c = Nat.Sub(24, xx, yy, zz); + if (c != 0) + { + if (Nat.SubFrom(PExtInv.Length, PExtInv, zz) != 0) + { + Nat.DecAt(24, zz, PExtInv.Length); + } + } + } + + public static void Twice(uint[] x, uint[] z) + { + uint c = Nat.ShiftUpBit(12, x, 0, z); + if (c != 0 || (z[11] == P11 && Nat.Gte(12, z, P))) + { + AddPInvTo(z); + } + } + + private static void AddPInvTo(uint[] z) + { + long c = (long)z[0] + 1; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - 1; + z[1] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[2]; + z[2] = (uint)c; + c >>= 32; + } + c += (long)z[3] + 1; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] + 1; + z[4] = (uint)c; + c >>= 32; + if (c != 0) + { + Nat.IncAt(12, z, 5); + } + } + + private static void SubPInvFrom(uint[] z) + { + long c = (long)z[0] - 1; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] + 1; + z[1] = (uint)c; + c >>= 32; + if (c != 0) + { + c += (long)z[2]; + z[2] = (uint)c; + c >>= 32; + } + c += (long)z[3] - 1; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] - 1; + z[4] = (uint)c; + c >>= 32; + if (c != 0) + { + Nat.DecAt(12, z, 5); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Field.cs.meta new file mode 100644 index 00000000..886f0adf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b7cb7a5d5e0a1544bce29407d194008 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1FieldElement.cs new file mode 100644 index 00000000..d3ac1220 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1FieldElement.cs @@ -0,0 +1,214 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP384R1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP384R1Curve.q; + + protected internal readonly uint[] x; + + public SecP384R1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP384R1FieldElement", "x"); + + this.x = SecP384R1Field.FromBigInteger(x); + } + + public SecP384R1FieldElement() + { + this.x = Nat.Create(12); + } + + protected internal SecP384R1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat.IsZero(12, x); } + } + + public override bool IsOne + { + get { return Nat.IsOne(12, x); } + } + + public override bool TestBitZero() + { + return Nat.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat.ToBigInteger(12, x); + } + + public override string FieldName + { + get { return "SecP384R1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat.Create(12); + SecP384R1Field.Add(x, ((SecP384R1FieldElement)b).x, z); + return new SecP384R1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat.Create(12); + SecP384R1Field.AddOne(x, z); + return new SecP384R1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat.Create(12); + SecP384R1Field.Subtract(x, ((SecP384R1FieldElement)b).x, z); + return new SecP384R1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat.Create(12); + SecP384R1Field.Multiply(x, ((SecP384R1FieldElement)b).x, z); + return new SecP384R1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat.Create(12); + Mod.Invert(SecP384R1Field.P, ((SecP384R1FieldElement)b).x, z); + SecP384R1Field.Multiply(z, x, z); + return new SecP384R1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat.Create(12); + SecP384R1Field.Negate(x, z); + return new SecP384R1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat.Create(12); + SecP384R1Field.Square(x, z); + return new SecP384R1FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new SecP384R1FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat.Create(12); + Mod.Invert(SecP384R1Field.P, x, z); + return new SecP384R1FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + // Raise this element to the exponent 2^382 - 2^126 - 2^94 + 2^30 + + uint[] x1 = this.x; + if (Nat.IsZero(12, x1) || Nat.IsOne(12, x1)) + return this; + + uint[] t1 = Nat.Create(12); + uint[] t2 = Nat.Create(12); + uint[] t3 = Nat.Create(12); + uint[] t4 = Nat.Create(12); + + SecP384R1Field.Square(x1, t1); + SecP384R1Field.Multiply(t1, x1, t1); + + SecP384R1Field.SquareN(t1, 2, t2); + SecP384R1Field.Multiply(t2, t1, t2); + + SecP384R1Field.Square(t2, t2); + SecP384R1Field.Multiply(t2, x1, t2); + + SecP384R1Field.SquareN(t2, 5, t3); + SecP384R1Field.Multiply(t3, t2, t3); + + SecP384R1Field.SquareN(t3, 5, t4); + SecP384R1Field.Multiply(t4, t2, t4); + + SecP384R1Field.SquareN(t4, 15, t2); + SecP384R1Field.Multiply(t2, t4, t2); + + SecP384R1Field.SquareN(t2, 2, t3); + SecP384R1Field.Multiply(t1, t3, t1); + + SecP384R1Field.SquareN(t3, 28, t3); + SecP384R1Field.Multiply(t2, t3, t2); + + SecP384R1Field.SquareN(t2, 60, t3); + SecP384R1Field.Multiply(t3, t2, t3); + + uint[] r = t2; + + SecP384R1Field.SquareN(t3, 120, r); + SecP384R1Field.Multiply(r, t3, r); + + SecP384R1Field.SquareN(r, 15, r); + SecP384R1Field.Multiply(r, t4, r); + + SecP384R1Field.SquareN(r, 33, r); + SecP384R1Field.Multiply(r, t1, r); + + SecP384R1Field.SquareN(r, 64, r); + SecP384R1Field.Multiply(r, x1, r); + + SecP384R1Field.SquareN(r, 30, t1); + SecP384R1Field.Square(t1, t2); + + return Nat.Eq(12, x1, t2) ? new SecP384R1FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP384R1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP384R1FieldElement); + } + + public virtual bool Equals(SecP384R1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat.Eq(12, x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 12); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1FieldElement.cs.meta new file mode 100644 index 00000000..9eee5699 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8c177ec57fed4194f86bc4bc12fd3100 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Point.cs new file mode 100644 index 00000000..ce008daa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Point.cs @@ -0,0 +1,284 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP384R1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecP384R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP384R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP384R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP384R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP384R1FieldElement X1 = (SecP384R1FieldElement)this.RawXCoord, Y1 = (SecP384R1FieldElement)this.RawYCoord; + SecP384R1FieldElement X2 = (SecP384R1FieldElement)b.RawXCoord, Y2 = (SecP384R1FieldElement)b.RawYCoord; + + SecP384R1FieldElement Z1 = (SecP384R1FieldElement)this.RawZCoords[0]; + SecP384R1FieldElement Z2 = (SecP384R1FieldElement)b.RawZCoords[0]; + + uint c; + uint[] tt1 = Nat.Create(24); + uint[] tt2 = Nat.Create(24); + uint[] t3 = Nat.Create(12); + uint[] t4 = Nat.Create(12); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP384R1Field.Square(Z1.x, S2); + + U2 = tt2; + SecP384R1Field.Multiply(S2, X2.x, U2); + + SecP384R1Field.Multiply(S2, Z1.x, S2); + SecP384R1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP384R1Field.Square(Z2.x, S1); + + U1 = tt1; + SecP384R1Field.Multiply(S1, X1.x, U1); + + SecP384R1Field.Multiply(S1, Z2.x, S1); + SecP384R1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat.Create(12); + SecP384R1Field.Subtract(U1, U2, H); + + uint[] R = Nat.Create(12); + SecP384R1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat.IsZero(12, H)) + { + if (Nat.IsZero(12, R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP384R1Field.Square(H, HSquared); + + uint[] G = Nat.Create(12); + SecP384R1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP384R1Field.Multiply(HSquared, U1, V); + + SecP384R1Field.Negate(G, G); + Nat384.Mul(S1, G, tt1); + + c = Nat.AddBothTo(12, V, V, G); + SecP384R1Field.Reduce32(c, G); + + SecP384R1FieldElement X3 = new SecP384R1FieldElement(t4); + SecP384R1Field.Square(R, X3.x); + SecP384R1Field.Subtract(X3.x, G, X3.x); + + SecP384R1FieldElement Y3 = new SecP384R1FieldElement(G); + SecP384R1Field.Subtract(V, X3.x, Y3.x); + Nat384.Mul(Y3.x, R, tt2); + SecP384R1Field.AddExt(tt1, tt2, tt1); + SecP384R1Field.Reduce(tt1, Y3.x); + + SecP384R1FieldElement Z3 = new SecP384R1FieldElement(H); + if (!Z1IsOne) + { + SecP384R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP384R1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[] { Z3 }; + + return new SecP384R1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP384R1FieldElement Y1 = (SecP384R1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP384R1FieldElement X1 = (SecP384R1FieldElement)this.RawXCoord, Z1 = (SecP384R1FieldElement)this.RawZCoords[0]; + + uint c; + uint[] t1 = Nat.Create(12); + uint[] t2 = Nat.Create(12); + + uint[] Y1Squared = Nat.Create(12); + SecP384R1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat.Create(12); + SecP384R1Field.Square(Y1Squared, T); + + bool Z1IsOne = Z1.IsOne; + + uint[] Z1Squared = Z1.x; + if (!Z1IsOne) + { + Z1Squared = t2; + SecP384R1Field.Square(Z1.x, Z1Squared); + } + + SecP384R1Field.Subtract(X1.x, Z1Squared, t1); + + uint[] M = t2; + SecP384R1Field.Add(X1.x, Z1Squared, M); + SecP384R1Field.Multiply(M, t1, M); + c = Nat.AddBothTo(12, M, M, M); + SecP384R1Field.Reduce32(c, M); + + uint[] S = Y1Squared; + SecP384R1Field.Multiply(Y1Squared, X1.x, S); + c = Nat.ShiftUpBits(12, S, 2, 0); + SecP384R1Field.Reduce32(c, S); + + c = Nat.ShiftUpBits(12, T, 3, 0, t1); + SecP384R1Field.Reduce32(c, t1); + + SecP384R1FieldElement X3 = new SecP384R1FieldElement(T); + SecP384R1Field.Square(M, X3.x); + SecP384R1Field.Subtract(X3.x, S, X3.x); + SecP384R1Field.Subtract(X3.x, S, X3.x); + + SecP384R1FieldElement Y3 = new SecP384R1FieldElement(S); + SecP384R1Field.Subtract(S, X3.x, Y3.x); + SecP384R1Field.Multiply(Y3.x, M, Y3.x); + SecP384R1Field.Subtract(Y3.x, t1, Y3.x); + + SecP384R1FieldElement Z3 = new SecP384R1FieldElement(M); + SecP384R1Field.Twice(Y1.x, Z3.x); + if (!Z1IsOne) + { + SecP384R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP384R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP384R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Point.cs.meta new file mode 100644 index 00000000..e8698a2d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP384R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 533f4a923a033e342854675195b3f0df +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Curve.cs new file mode 100644 index 00000000..d0f39bb7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Curve.cs @@ -0,0 +1,140 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP521R1Curve + : AbstractFpCurve + { + public static readonly BigInteger q = new BigInteger(1, + Hex.Decode("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")); + + private const int SECP521R1_DEFAULT_COORDS = COORD_JACOBIAN; + private const int SECP521R1_FE_INTS = 17; + + protected readonly SecP521R1Point m_infinity; + + public SecP521R1Curve() + : base(q) + { + this.m_infinity = new SecP521R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, + Hex.Decode("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC"))); + this.m_b = FromBigInteger(new BigInteger(1, + Hex.Decode("0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00"))); + this.m_order = new BigInteger(1, Hex.Decode("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409")); + this.m_cofactor = BigInteger.One; + this.m_coord = SECP521R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecP521R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_JACOBIAN: + return true; + default: + return false; + } + } + + public virtual BigInteger Q + { + get { return q; } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return q.BitLength; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecP521R1FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecP521R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecP521R1Point(this, x, y, zs, withCompression); + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + uint[] table = new uint[len * SECP521R1_FE_INTS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat.Copy(SECP521R1_FE_INTS, ((SecP521R1FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECP521R1_FE_INTS; + Nat.Copy(SECP521R1_FE_INTS, ((SecP521R1FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECP521R1_FE_INTS; + } + } + + return new SecP521R1LookupTable(this, table, len); + } + + private class SecP521R1LookupTable + : ECLookupTable + { + private readonly SecP521R1Curve m_outer; + private readonly uint[] m_table; + private readonly int m_size; + + internal SecP521R1LookupTable(SecP521R1Curve outer, uint[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + uint[] x = Nat.Create(SECP521R1_FE_INTS), y = Nat.Create(SECP521R1_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 < SECP521R1_FE_INTS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECP521R1_FE_INTS + j] & MASK; + } + + pos += (SECP521R1_FE_INTS * 2); + } + + return m_outer.CreateRawPoint(new SecP521R1FieldElement(x), new SecP521R1FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Curve.cs.meta new file mode 100644 index 00000000..92a380b3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d65d118e58b9f114c9b15094148d033a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Field.cs new file mode 100644 index 00000000..77c15717 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Field.cs @@ -0,0 +1,159 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP521R1Field + { + // 2^521 - 1 + internal static readonly uint[] P = new uint[]{ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x1FF }; + private const int P16 = 0x1FF; + + public static void Add(uint[] x, uint[] y, uint[] z) + { + uint c = Nat.Add(16, x, y, z) + x[16] + y[16]; + if (c > P16 || (c == P16 && Nat.Eq(16, z, P))) + { + c += Nat.Inc(16, z); + c &= P16; + } + z[16] = c; + } + + public static void AddOne(uint[] x, uint[] z) + { + uint c = Nat.Inc(16, x, z) + x[16]; + if (c > P16 || (c == P16 && Nat.Eq(16, z, P))) + { + c += Nat.Inc(16, z); + c &= P16; + } + z[16] = c; + } + + public static uint[] FromBigInteger(BigInteger x) + { + uint[] z = Nat.FromBigInteger(521, x); + if (Nat.Eq(17, z, P)) + { + Nat.Zero(17, z); + } + return z; + } + + public static void Half(uint[] x, uint[] z) + { + uint x16 = x[16]; + uint c = Nat.ShiftDownBit(16, x, x16, z); + z[16] = (x16 >> 1) | (c >> 23); + } + + public static void Multiply(uint[] x, uint[] y, uint[] z) + { + uint[] tt = Nat.Create(33); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void Negate(uint[] x, uint[] z) + { + if (Nat.IsZero(17, x)) + { + Nat.Zero(17, z); + } + else + { + Nat.Sub(17, P, x, z); + } + } + + public static void Reduce(uint[] xx, uint[] z) + { + Debug.Assert(xx[32] >> 18 == 0); + uint xx32 = xx[32]; + uint c = Nat.ShiftDownBits(16, xx, 16, 9, xx32, z, 0) >> 23; + c += xx32 >> 9; + c += Nat.AddTo(16, xx, z); + if (c > P16 || (c == P16 && Nat.Eq(16, z, P))) + { + c += Nat.Inc(16, z); + c &= P16; + } + z[16] = c; + } + + public static void Reduce23(uint[] z) + { + uint z16 = z[16]; + uint c = Nat.AddWordTo(16, z16 >> 9, z) + (z16 & P16); + if (c > P16 || (c == P16 && Nat.Eq(16, z, P))) + { + c += Nat.Inc(16, z); + c &= P16; + } + z[16] = c; + } + + public static void Square(uint[] x, uint[] z) + { + uint[] tt = Nat.Create(33); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareN(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + uint[] tt = Nat.Create(33); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static void Subtract(uint[] x, uint[] y, uint[] z) + { + int c = Nat.Sub(16, x, y, z) + (int)(x[16] - y[16]); + if (c < 0) + { + c += Nat.Dec(16, z); + c &= P16; + } + z[16] = (uint)c; + } + + public static void Twice(uint[] x, uint[] z) + { + uint x16 = x[16]; + uint c = Nat.ShiftUpBit(16, x, x16 << 23, z) | (x16 << 1); + z[16] = c & P16; + } + + protected static void ImplMultiply(uint[] x, uint[] y, uint[] zz) + { + Nat512.Mul(x, y, zz); + + uint x16 = x[16], y16 = y[16]; + zz[32] = Nat.Mul31BothAdd(16, x16, y, y16, x, zz, 16) + (x16 * y16); + } + + protected static void ImplSquare(uint[] x, uint[] zz) + { + Nat512.Square(x, zz); + + uint x16 = x[16]; + zz[32] = Nat.MulWordAddTo(16, x16 << 1, x, 0, zz, 16) + (x16 * x16); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Field.cs.meta new file mode 100644 index 00000000..87b74cab --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 825661e6afc41554080a475cc6af4dba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1FieldElement.cs new file mode 100644 index 00000000..0f253aac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1FieldElement.cs @@ -0,0 +1,171 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP521R1FieldElement + : AbstractFpFieldElement + { + public static readonly BigInteger Q = SecP521R1Curve.q; + + protected internal readonly uint[] x; + + public SecP521R1FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.CompareTo(Q) >= 0) + throw new ArgumentException("value invalid for SecP521R1FieldElement", "x"); + + this.x = SecP521R1Field.FromBigInteger(x); + } + + public SecP521R1FieldElement() + { + this.x = Nat.Create(17); + } + + protected internal SecP521R1FieldElement(uint[] x) + { + this.x = x; + } + + public override bool IsZero + { + get { return Nat.IsZero(17, x); } + } + + public override bool IsOne + { + get { return Nat.IsOne(17, x); } + } + + public override bool TestBitZero() + { + return Nat.GetBit(x, 0) == 1; + } + + public override BigInteger ToBigInteger() + { + return Nat.ToBigInteger(17, x); + } + + public override string FieldName + { + get { return "SecP521R1Field"; } + } + + public override int FieldSize + { + get { return Q.BitLength; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + uint[] z = Nat.Create(17); + SecP521R1Field.Add(x, ((SecP521R1FieldElement)b).x, z); + return new SecP521R1FieldElement(z); + } + + public override ECFieldElement AddOne() + { + uint[] z = Nat.Create(17); + SecP521R1Field.AddOne(x, z); + return new SecP521R1FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + uint[] z = Nat.Create(17); + SecP521R1Field.Subtract(x, ((SecP521R1FieldElement)b).x, z); + return new SecP521R1FieldElement(z); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + uint[] z = Nat.Create(17); + SecP521R1Field.Multiply(x, ((SecP521R1FieldElement)b).x, z); + return new SecP521R1FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + //return Multiply(b.Invert()); + uint[] z = Nat.Create(17); + Mod.Invert(SecP521R1Field.P, ((SecP521R1FieldElement)b).x, z); + SecP521R1Field.Multiply(z, x, z); + return new SecP521R1FieldElement(z); + } + + public override ECFieldElement Negate() + { + uint[] z = Nat.Create(17); + SecP521R1Field.Negate(x, z); + return new SecP521R1FieldElement(z); + } + + public override ECFieldElement Square() + { + uint[] z = Nat.Create(17); + SecP521R1Field.Square(x, z); + return new SecP521R1FieldElement(z); + } + + public override ECFieldElement Invert() + { + //return new SecP521R1FieldElement(ToBigInteger().ModInverse(Q)); + uint[] z = Nat.Create(17); + Mod.Invert(SecP521R1Field.P, x, z); + return new SecP521R1FieldElement(z); + } + + /** + * return a sqrt root - the routine verifies that the calculation returns the right value - if + * none exists it returns null. + */ + public override ECFieldElement Sqrt() + { + // Raise this element to the exponent 2^519 + + uint[] x1 = this.x; + if (Nat.IsZero(17, x1) || Nat.IsOne(17, x1)) + return this; + + uint[] t1 = Nat.Create(17); + uint[] t2 = Nat.Create(17); + + SecP521R1Field.SquareN(x1, 519, t1); + SecP521R1Field.Square(t1, t2); + + return Nat.Eq(17, x1, t2) ? new SecP521R1FieldElement(t1) : null; + } + + public override bool Equals(object obj) + { + return Equals(obj as SecP521R1FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecP521R1FieldElement); + } + + public virtual bool Equals(SecP521R1FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat.Eq(17, x, other.x); + } + + public override int GetHashCode() + { + return Q.GetHashCode() ^ Arrays.GetHashCode(x, 0, 17); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1FieldElement.cs.meta new file mode 100644 index 00000000..6483af39 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c7adc09b4e3b0e459b5fc6a13d4d040 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Point.cs new file mode 100644 index 00000000..67968e43 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Point.cs @@ -0,0 +1,279 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecP521R1Point + : AbstractFpPoint + { + /** + * Create a point which encodes with point compression. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecP521R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * Create a point that encodes with or without point compresion. + * + * @param curve + * the curve to use + * @param x + * affine x co-ordinate + * @param y + * affine y co-ordinate + * @param withCompression + * if true encode with point compression + * + * @deprecated per-point compression property will be removed, refer + * {@link #getEncoded(bool)} + */ + public SecP521R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecP521R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecP521R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + if (this == b) + return Twice(); + + ECCurve curve = this.Curve; + + SecP521R1FieldElement X1 = (SecP521R1FieldElement)this.RawXCoord, Y1 = (SecP521R1FieldElement)this.RawYCoord; + SecP521R1FieldElement X2 = (SecP521R1FieldElement)b.RawXCoord, Y2 = (SecP521R1FieldElement)b.RawYCoord; + + SecP521R1FieldElement Z1 = (SecP521R1FieldElement)this.RawZCoords[0]; + SecP521R1FieldElement Z2 = (SecP521R1FieldElement)b.RawZCoords[0]; + + uint[] t1 = Nat.Create(17); + uint[] t2 = Nat.Create(17); + uint[] t3 = Nat.Create(17); + uint[] t4 = Nat.Create(17); + + bool Z1IsOne = Z1.IsOne; + uint[] U2, S2; + if (Z1IsOne) + { + U2 = X2.x; + S2 = Y2.x; + } + else + { + S2 = t3; + SecP521R1Field.Square(Z1.x, S2); + + U2 = t2; + SecP521R1Field.Multiply(S2, X2.x, U2); + + SecP521R1Field.Multiply(S2, Z1.x, S2); + SecP521R1Field.Multiply(S2, Y2.x, S2); + } + + bool Z2IsOne = Z2.IsOne; + uint[] U1, S1; + if (Z2IsOne) + { + U1 = X1.x; + S1 = Y1.x; + } + else + { + S1 = t4; + SecP521R1Field.Square(Z2.x, S1); + + U1 = t1; + SecP521R1Field.Multiply(S1, X1.x, U1); + + SecP521R1Field.Multiply(S1, Z2.x, S1); + SecP521R1Field.Multiply(S1, Y1.x, S1); + } + + uint[] H = Nat.Create(17); + SecP521R1Field.Subtract(U1, U2, H); + + uint[] R = t2; + SecP521R1Field.Subtract(S1, S2, R); + + // Check if b == this or b == -this + if (Nat.IsZero(17, H)) + { + if (Nat.IsZero(17, R)) + { + // this == b, i.e. this must be doubled + return this.Twice(); + } + + // this == -b, i.e. the result is the point at infinity + return curve.Infinity; + } + + uint[] HSquared = t3; + SecP521R1Field.Square(H, HSquared); + + uint[] G = Nat.Create(17); + SecP521R1Field.Multiply(HSquared, H, G); + + uint[] V = t3; + SecP521R1Field.Multiply(HSquared, U1, V); + + SecP521R1Field.Multiply(S1, G, t1); + + SecP521R1FieldElement X3 = new SecP521R1FieldElement(t4); + SecP521R1Field.Square(R, X3.x); + SecP521R1Field.Add(X3.x, G, X3.x); + SecP521R1Field.Subtract(X3.x, V, X3.x); + SecP521R1Field.Subtract(X3.x, V, X3.x); + + SecP521R1FieldElement Y3 = new SecP521R1FieldElement(G); + SecP521R1Field.Subtract(V, X3.x, Y3.x); + SecP521R1Field.Multiply(Y3.x, R, t2); + SecP521R1Field.Subtract(t2, t1, Y3.x); + + SecP521R1FieldElement Z3 = new SecP521R1FieldElement(H); + if (!Z1IsOne) + { + SecP521R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + if (!Z2IsOne) + { + SecP521R1Field.Multiply(Z3.x, Z2.x, Z3.x); + } + + ECFieldElement[] zs = new ECFieldElement[] { Z3 }; + + return new SecP521R1Point(curve, X3, Y3, zs, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + SecP521R1FieldElement Y1 = (SecP521R1FieldElement)this.RawYCoord; + if (Y1.IsZero) + return curve.Infinity; + + SecP521R1FieldElement X1 = (SecP521R1FieldElement)this.RawXCoord, Z1 = (SecP521R1FieldElement)this.RawZCoords[0]; + + uint[] t1 = Nat.Create(17); + uint[] t2 = Nat.Create(17); + + uint[] Y1Squared = Nat.Create(17); + SecP521R1Field.Square(Y1.x, Y1Squared); + + uint[] T = Nat.Create(17); + SecP521R1Field.Square(Y1Squared, T); + + bool Z1IsOne = Z1.IsOne; + + uint[] Z1Squared = Z1.x; + if (!Z1IsOne) + { + Z1Squared = t2; + SecP521R1Field.Square(Z1.x, Z1Squared); + } + + SecP521R1Field.Subtract(X1.x, Z1Squared, t1); + + uint[] M = t2; + SecP521R1Field.Add(X1.x, Z1Squared, M); + SecP521R1Field.Multiply(M, t1, M); + Nat.AddBothTo(17, M, M, M); + SecP521R1Field.Reduce23(M); + + uint[] S = Y1Squared; + SecP521R1Field.Multiply(Y1Squared, X1.x, S); + Nat.ShiftUpBits(17, S, 2, 0); + SecP521R1Field.Reduce23(S); + + Nat.ShiftUpBits(17, T, 3, 0, t1); + SecP521R1Field.Reduce23(t1); + + SecP521R1FieldElement X3 = new SecP521R1FieldElement(T); + SecP521R1Field.Square(M, X3.x); + SecP521R1Field.Subtract(X3.x, S, X3.x); + SecP521R1Field.Subtract(X3.x, S, X3.x); + + SecP521R1FieldElement Y3 = new SecP521R1FieldElement(S); + SecP521R1Field.Subtract(S, X3.x, Y3.x); + SecP521R1Field.Multiply(Y3.x, M, Y3.x); + SecP521R1Field.Subtract(Y3.x, t1, Y3.x); + + SecP521R1FieldElement Z3 = new SecP521R1FieldElement(M); + SecP521R1Field.Twice(Y1.x, Z3.x); + if (!Z1IsOne) + { + SecP521R1Field.Multiply(Z3.x, Z1.x, Z3.x); + } + + return new SecP521R1Point(curve, X3, Y3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this == b) + return ThreeTimes(); + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECFieldElement Y1 = this.RawYCoord; + if (Y1.IsZero) + return b; + + return Twice().Add(b); + } + + public override ECPoint ThreeTimes() + { + if (this.IsInfinity || this.RawYCoord.IsZero) + return this; + + // NOTE: Be careful about recursions between TwicePlus and ThreeTimes + return Twice().Add(this); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + return new SecP521R1Point(Curve, RawXCoord, RawYCoord.Negate(), RawZCoords, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Point.cs.meta new file mode 100644 index 00000000..520fac68 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecP521R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b600c3d896b3dd8488f61361cf3363a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113Field.cs new file mode 100644 index 00000000..94db0685 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113Field.cs @@ -0,0 +1,229 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT113Field + { + private const ulong M49 = ulong.MaxValue >> 15; + private const ulong M57 = ulong.MaxValue >> 7; + + public static void Add(ulong[] x, ulong[] y, ulong[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + } + + public static void AddExt(ulong[] xx, ulong[] yy, ulong[] zz) + { + zz[0] = xx[0] ^ yy[0]; + zz[1] = xx[1] ^ yy[1]; + zz[2] = xx[2] ^ yy[2]; + zz[3] = xx[3] ^ yy[3]; + } + + public static void AddOne(ulong[] x, ulong[] z) + { + z[0] = x[0] ^ 1UL; + z[1] = x[1]; + } + + public static ulong[] FromBigInteger(BigInteger x) + { + ulong[] z = Nat128.FromBigInteger64(x); + Reduce15(z, 0); + return z; + } + + public static void Invert(ulong[] x, ulong[] z) + { + if (Nat128.IsZero64(x)) + throw new InvalidOperationException(); + + // Itoh-Tsujii inversion + + ulong[] t0 = Nat128.Create64(); + ulong[] t1 = Nat128.Create64(); + + Square(x, t0); + Multiply(t0, x, t0); + Square(t0, t0); + Multiply(t0, x, t0); + SquareN(t0, 3, t1); + Multiply(t1, t0, t1); + Square(t1, t1); + Multiply(t1, x, t1); + SquareN(t1, 7, t0); + Multiply(t0, t1, t0); + SquareN(t0, 14, t1); + Multiply(t1, t0, t1); + SquareN(t1, 28, t0); + Multiply(t0, t1, t0); + SquareN(t0, 56, t1); + Multiply(t1, t0, t1); + Square(t1, z); + } + + public static void Multiply(ulong[] x, ulong[] y, ulong[] z) + { + ulong[] tt = Nat128.CreateExt64(); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] tt = Nat128.CreateExt64(); + ImplMultiply(x, y, tt); + AddExt(zz, tt, zz); + } + + public static void Reduce(ulong[] xx, ulong[] z) + { + ulong x0 = xx[0], x1 = xx[1], x2 = xx[2], x3 = xx[3]; + + x1 ^= (x3 << 15) ^ (x3 << 24); + x2 ^= (x3 >> 49) ^ (x3 >> 40); + + x0 ^= (x2 << 15) ^ (x2 << 24); + x1 ^= (x2 >> 49) ^ (x2 >> 40); + + ulong t = x1 >> 49; + z[0] = x0 ^ t ^ (t << 9); + z[1] = x1 & M49; + } + + public static void Reduce15(ulong[] z, int zOff) + { + ulong z1 = z[zOff + 1], t = z1 >> 49; + z[zOff ] ^= t ^ (t << 9); + z[zOff + 1] = z1 & M49; + } + + public static void Sqrt(ulong[] x, ulong[] z) + { + ulong u0 = Interleave.Unshuffle(x[0]), u1 = Interleave.Unshuffle(x[1]); + ulong e0 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + ulong c0 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + z[0] = e0 ^ (c0 << 57) ^ (c0 << 5); + z[1] = (c0 >> 7) ^ (c0 >> 59); + } + + public static void Square(ulong[] x, ulong[] z) + { + ulong[] tt = Nat128.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareAddToExt(ulong[] x, ulong[] zz) + { + ulong[] tt = Nat128.CreateExt64(); + ImplSquare(x, tt); + AddExt(zz, tt, zz); + } + + public static void SquareN(ulong[] x, int n, ulong[] z) + { + Debug.Assert(n > 0); + + ulong[] tt = Nat128.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static uint Trace(ulong[] x) + { + // Non-zero-trace bits: 0 + return (uint)(x[0]) & 1U; + } + + protected static void ImplMultiply(ulong[] x, ulong[] y, ulong[] zz) + { + /* + * "Three-way recursion" as described in "Batch binary Edwards", Daniel J. Bernstein. + */ + + ulong f0 = x[0], f1 = x[1]; + f1 = ((f0 >> 57) ^ (f1 << 7)) & M57; + f0 &= M57; + + ulong g0 = y[0], g1 = y[1]; + g1 = ((g0 >> 57) ^ (g1 << 7)) & M57; + g0 &= M57; + + ulong[] H = new ulong[6]; + + ImplMulw(f0, g0, H, 0); // H(0) 57/56 bits + ImplMulw(f1, g1, H, 2); // H(INF) 57/54 bits + ImplMulw(f0 ^ f1, g0 ^ g1, H, 4); // H(1) 57/56 bits + + ulong r = H[1] ^ H[2]; + ulong z0 = H[0], + z3 = H[3], + z1 = H[4] ^ z0 ^ r, + z2 = H[5] ^ z3 ^ r; + + zz[0] = z0 ^ (z1 << 57); + zz[1] = (z1 >> 7) ^ (z2 << 50); + zz[2] = (z2 >> 14) ^ (z3 << 43); + zz[3] = (z3 >> 21); + } + + protected static void ImplMulw(ulong x, ulong y, ulong[] z, int zOff) + { + Debug.Assert(x >> 57 == 0); + Debug.Assert(y >> 57 == 0); + + ulong[] u = new ulong[8]; + //u[0] = 0; + u[1] = y; + u[2] = u[1] << 1; + u[3] = u[2] ^ y; + u[4] = u[2] << 1; + u[5] = u[4] ^ y; + u[6] = u[3] << 1; + u[7] = u[6] ^ y; + + uint j = (uint)x; + ulong g, h = 0, l = u[j & 7]; + int k = 48; + do + { + j = (uint)(x >> k); + g = u[j & 7] + ^ u[(j >> 3) & 7] << 3 + ^ u[(j >> 6) & 7] << 6; + l ^= (g << k); + h ^= (g >> -k); + } + while ((k -= 9) > 0); + + h ^= ((x & 0x0100804020100800UL) & (ulong)(((long)y << 7) >> 63)) >> 8; + + Debug.Assert(h >> 49 == 0); + + z[zOff ] = l & M57; + z[zOff + 1] = (l >> 57) ^ (h << 7); + } + + protected static void ImplSquare(ulong[] x, ulong[] zz) + { + Interleave.Expand64To128(x[0], zz, 0); + Interleave.Expand64To128(x[1], zz, 2); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113Field.cs.meta new file mode 100644 index 00000000..5f574fb8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 11da1b9450f57644fa56b5c007984298 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113FieldElement.cs new file mode 100644 index 00000000..2ac091e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113FieldElement.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT113FieldElement + : AbstractF2mFieldElement + { + protected internal readonly ulong[] x; + + public SecT113FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > 113) + throw new ArgumentException("value invalid for SecT113FieldElement", "x"); + + this.x = SecT113Field.FromBigInteger(x); + } + + public SecT113FieldElement() + { + this.x = Nat128.Create64(); + } + + protected internal SecT113FieldElement(ulong[] x) + { + this.x = x; + } + + public override bool IsOne + { + get { return Nat128.IsOne64(x); } + } + + public override bool IsZero + { + get { return Nat128.IsZero64(x); } + } + + public override bool TestBitZero() + { + return (x[0] & 1L) != 0L; + } + + public override BigInteger ToBigInteger() + { + return Nat128.ToBigInteger64(x); + } + + public override string FieldName + { + get { return "SecT113Field"; } + } + + public override int FieldSize + { + get { return 113; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + ulong[] z = Nat128.Create64(); + SecT113Field.Add(x, ((SecT113FieldElement)b).x, z); + return new SecT113FieldElement(z); + } + + public override ECFieldElement AddOne() + { + ulong[] z = Nat128.Create64(); + SecT113Field.AddOne(x, z); + return new SecT113FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + // Addition and Subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + ulong[] z = Nat128.Create64(); + SecT113Field.Multiply(x, ((SecT113FieldElement)b).x, z); + return new SecT113FieldElement(z); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x, bx = ((SecT113FieldElement)b).x; + ulong[] xx = ((SecT113FieldElement)x).x, yx = ((SecT113FieldElement)y).x; + + ulong[] tt = Nat128.CreateExt64(); + SecT113Field.MultiplyAddToExt(ax, bx, tt); + SecT113Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat128.Create64(); + SecT113Field.Reduce(tt, z); + return new SecT113FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + return Multiply(b.Invert()); + } + + public override ECFieldElement Negate() + { + return this; + } + + public override ECFieldElement Square() + { + ulong[] z = Nat128.Create64(); + SecT113Field.Square(x, z); + return new SecT113FieldElement(z); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x; + ulong[] xx = ((SecT113FieldElement)x).x, yx = ((SecT113FieldElement)y).x; + + ulong[] tt = Nat128.CreateExt64(); + SecT113Field.SquareAddToExt(ax, tt); + SecT113Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat128.Create64(); + SecT113Field.Reduce(tt, z); + return new SecT113FieldElement(z); + } + + public override ECFieldElement SquarePow(int pow) + { + if (pow < 1) + return this; + + ulong[] z = Nat128.Create64(); + SecT113Field.SquareN(x, pow, z); + return new SecT113FieldElement(z); + } + + public override int Trace() + { + return (int)SecT113Field.Trace(x); + } + + public override ECFieldElement Invert() + { + ulong[] z = Nat128.Create64(); + SecT113Field.Invert(x, z); + return new SecT113FieldElement(z); + } + + public override ECFieldElement Sqrt() + { + ulong[] z = Nat128.Create64(); + SecT113Field.Sqrt(x, z); + return new SecT113FieldElement(z); + } + + public virtual int Representation + { + get { return F2mFieldElement.Tpb; } + } + + public virtual int M + { + get { return 113; } + } + + public virtual int K1 + { + get { return 9; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override bool Equals(object obj) + { + return Equals(obj as SecT113FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecT113FieldElement); + } + + public virtual bool Equals(SecT113FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat128.Eq64(x, other.x); + } + + public override int GetHashCode() + { + return 113009 ^ Arrays.GetHashCode(x, 0, 2); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113FieldElement.cs.meta new file mode 100644 index 00000000..b03b61cc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2163552ee3494464490a708ac4a51d7f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Curve.cs new file mode 100644 index 00000000..fde936f2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT113R1Curve + : AbstractF2mCurve + { + private const int SECT113R1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT113R1_FE_LONGS = 2; + + protected readonly SecT113R1Point m_infinity; + + public SecT113R1Curve() + : base(113, 9, 0, 0) + { + this.m_infinity = new SecT113R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, Hex.Decode("003088250CA6E7C7FE649CE85820F7"))); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("00E8BEE4D3E2260744188BE0E9C723"))); + this.m_order = new BigInteger(1, Hex.Decode("0100000000000000D9CCEC8A39E56F")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT113R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT113R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 113; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT113FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT113R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT113R1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 113; } + } + + public virtual bool IsTrinomial + { + get { return true; } + } + + public virtual int K1 + { + get { return 9; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT113R1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat128.Copy64(((SecT113FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT113R1_FE_LONGS; + Nat128.Copy64(((SecT113FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT113R1_FE_LONGS; + } + } + + return new SecT113R1LookupTable(this, table, len); + } + + private class SecT113R1LookupTable + : ECLookupTable + { + private readonly SecT113R1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT113R1LookupTable(SecT113R1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat128.Create64(), y = Nat128.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT113R1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT113R1_FE_LONGS + j] & MASK; + } + + pos += (SECT113R1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT113FieldElement(x), new SecT113FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Curve.cs.meta new file mode 100644 index 00000000..3534cc62 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc69e7fac16cabc41ba1012d78e95f33 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Point.cs new file mode 100644 index 00000000..88b4d8c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Point.cs @@ -0,0 +1,285 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT113R1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT113R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT113R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT113R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT113R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).Add(curve.A); + if (X3.IsZero) + { + return new SecT113R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT113R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT113R1Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement a = curve.A; + ECFieldElement aZ1Sq = Z1IsOne ? a : a.Multiply(Z1Sq); + ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); + if (T.IsZero) + { + return new SecT113R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT113R1Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = curve.A.Multiply(Z1Sq).Add(L1Sq).Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = curve.A.Add(L2plus1).Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT113R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT113R1Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT113R1Point(Curve, X, L.Add(Z), new ECFieldElement[]{ Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Point.cs.meta new file mode 100644 index 00000000..57ebe823 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a8336d94ed396554ea8064dc7cfddf76 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Curve.cs new file mode 100644 index 00000000..13ca096e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT113R2Curve + : AbstractF2mCurve + { + private const int SECT113R2_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT113R2_FE_LONGS = 2; + + protected readonly SecT113R2Point m_infinity; + + public SecT113R2Curve() + : base(113, 9, 0, 0) + { + this.m_infinity = new SecT113R2Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, Hex.Decode("00689918DBEC7E5A0DD6DFC0AA55C7"))); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("0095E9A9EC9B297BD4BF36E059184F"))); + this.m_order = new BigInteger(1, Hex.Decode("010000000000000108789B2496AF93")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT113R2_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT113R2Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 113; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT113FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT113R2Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT113R2Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 113; } + } + + public virtual bool IsTrinomial + { + get { return true; } + } + + public virtual int K1 + { + get { return 9; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT113R2_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat128.Copy64(((SecT113FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT113R2_FE_LONGS; + Nat128.Copy64(((SecT113FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT113R2_FE_LONGS; + } + } + + return new SecT113R2LookupTable(this, table, len); + } + + private class SecT113R2LookupTable + : ECLookupTable + { + private readonly SecT113R2Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT113R2LookupTable(SecT113R2Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat128.Create64(), y = Nat128.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT113R2_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT113R2_FE_LONGS + j] & MASK; + } + + pos += (SECT113R2_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT113FieldElement(x), new SecT113FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Curve.cs.meta new file mode 100644 index 00000000..39c5cd0e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a90d133b57e6e747b05545dad95da40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Point.cs new file mode 100644 index 00000000..5dce853a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Point.cs @@ -0,0 +1,295 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT113R2Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT113R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT113R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT113R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT113R2Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + { + return b; + } + if (b.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).Add(curve.A); + if (X3.IsZero) + { + return new SecT113R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT113R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT113R2Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement a = curve.A; + ECFieldElement aZ1Sq = Z1IsOne ? a : a.Multiply(Z1Sq); + ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); + if (T.IsZero) + { + return new SecT113R2Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT113R2Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + { + return b; + } + if (b.IsInfinity) + { + return Twice(); + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = curve.A.Multiply(Z1Sq).Add(L1Sq).Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = curve.A.Add(L2plus1).Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT113R2Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT113R2Point(curve, X3, L3, new ECFieldElement[]{ Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT113R2Point(Curve, X, L.Add(Z), new ECFieldElement[]{ Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Point.cs.meta new file mode 100644 index 00000000..d30e7549 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT113R2Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 28953e22bdd1e22418f49b57246b6536 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131Field.cs new file mode 100644 index 00000000..94a223e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131Field.cs @@ -0,0 +1,334 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT131Field + { + private const ulong M03 = ulong.MaxValue >> 61; + private const ulong M44 = ulong.MaxValue >> 20; + + private static readonly ulong[] ROOT_Z = new ulong[]{ 0x26BC4D789AF13523UL, 0x26BC4D789AF135E2UL, 0x6UL }; + + public static void Add(ulong[] x, ulong[] y, ulong[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + z[2] = x[2] ^ y[2]; + } + + public static void AddExt(ulong[] xx, ulong[] yy, ulong[] zz) + { + zz[0] = xx[0] ^ yy[0]; + zz[1] = xx[1] ^ yy[1]; + zz[2] = xx[2] ^ yy[2]; + zz[3] = xx[3] ^ yy[3]; + zz[4] = xx[4] ^ yy[4]; + } + + public static void AddOne(ulong[] x, ulong[] z) + { + z[0] = x[0] ^ 1UL; + z[1] = x[1]; + z[2] = x[2]; + } + + public static ulong[] FromBigInteger(BigInteger x) + { + ulong[] z = Nat192.FromBigInteger64(x); + Reduce61(z, 0); + return z; + } + + public static void Invert(ulong[] x, ulong[] z) + { + if (Nat192.IsZero64(x)) + throw new InvalidOperationException(); + + // Itoh-Tsujii inversion + + ulong[] t0 = Nat192.Create64(); + ulong[] t1 = Nat192.Create64(); + + Square(x, t0); + Multiply(t0, x, t0); + SquareN(t0, 2, t1); + Multiply(t1, t0, t1); + SquareN(t1, 4, t0); + Multiply(t0, t1, t0); + SquareN(t0, 8, t1); + Multiply(t1, t0, t1); + SquareN(t1, 16, t0); + Multiply(t0, t1, t0); + SquareN(t0, 32, t1); + Multiply(t1, t0, t1); + Square(t1, t1); + Multiply(t1, x, t1); + SquareN(t1, 65, t0); + Multiply(t0, t1, t0); + Square(t0, z); + } + + public static void Multiply(ulong[] x, ulong[] y, ulong[] z) + { + ulong[] tt = Nat192.CreateExt64(); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] tt = Nat192.CreateExt64(); + ImplMultiply(x, y, tt); + AddExt(zz, tt, zz); + } + + public static void Reduce(ulong[] xx, ulong[] z) + { + ulong x0 = xx[0], x1 = xx[1], x2 = xx[2], x3 = xx[3], x4 = xx[4]; + + x1 ^= (x4 << 61) ^ (x4 << 63); + x2 ^= (x4 >> 3) ^ (x4 >> 1) ^ x4 ^ (x4 << 5); + x3 ^= (x4 >> 59); + + x0 ^= (x3 << 61) ^ (x3 << 63); + x1 ^= (x3 >> 3) ^ (x3 >> 1) ^ x3 ^ (x3 << 5); + x2 ^= (x3 >> 59); + + ulong t = x2 >> 3; + z[0] = x0 ^ t ^ (t << 2) ^ (t << 3) ^ (t << 8); + z[1] = x1 ^ (t >> 56); + z[2] = x2 & M03; + } + + public static void Reduce61(ulong[] z, int zOff) + { + ulong z2 = z[zOff + 2], t = z2 >> 3; + z[zOff ] ^= t ^ (t << 2) ^ (t << 3) ^ (t << 8); + z[zOff + 1] ^= (t >> 56); + z[zOff + 2] = z2 & M03; + } + + public static void Sqrt(ulong[] x, ulong[] z) + { + ulong[] odd = Nat192.Create64(); + + ulong u0, u1; + u0 = Interleave.Unshuffle(x[0]); u1 = Interleave.Unshuffle(x[1]); + ulong e0 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + odd[0] = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[2]); + ulong e1 = (u0 & 0x00000000FFFFFFFFUL); + odd[1] = (u0 >> 32); + + Multiply(odd, ROOT_Z, z); + + z[0] ^= e0; + z[1] ^= e1; + } + + public static void Square(ulong[] x, ulong[] z) + { + ulong[] tt = Nat.Create64(5); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareAddToExt(ulong[] x, ulong[] zz) + { + ulong[] tt = Nat.Create64(5); + ImplSquare(x, tt); + AddExt(zz, tt, zz); + } + + public static void SquareN(ulong[] x, int n, ulong[] z) + { + Debug.Assert(n > 0); + + ulong[] tt = Nat.Create64(5); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static uint Trace(ulong[] x) + { + // Non-zero-trace bits: 0, 123, 129 + return (uint)(x[0] ^ (x[1] >> 59) ^ (x[2] >> 1)) & 1U; + } + + protected static void ImplCompactExt(ulong[] zz) + { + ulong z0 = zz[0], z1 = zz[1], z2 = zz[2], z3 = zz[3], z4 = zz[4], z5 = zz[5]; + zz[0] = z0 ^ (z1 << 44); + zz[1] = (z1 >> 20) ^ (z2 << 24); + zz[2] = (z2 >> 40) ^ (z3 << 4) + ^ (z4 << 48); + zz[3] = (z3 >> 60) ^ (z5 << 28) + ^ (z4 >> 16); + zz[4] = (z5 >> 36); + zz[5] = 0; + } + + protected static void ImplMultiply(ulong[] x, ulong[] y, ulong[] zz) + { + /* + * "Five-way recursion" as described in "Batch binary Edwards", Daniel J. Bernstein. + */ + + ulong f0 = x[0], f1 = x[1], f2 = x[2]; + f2 = ((f1 >> 24) ^ (f2 << 40)) & M44; + f1 = ((f0 >> 44) ^ (f1 << 20)) & M44; + f0 &= M44; + + ulong g0 = y[0], g1 = y[1], g2 = y[2]; + g2 = ((g1 >> 24) ^ (g2 << 40)) & M44; + g1 = ((g0 >> 44) ^ (g1 << 20)) & M44; + g0 &= M44; + + ulong[] H = new ulong[10]; + + ImplMulw(f0, g0, H, 0); // H(0) 44/43 bits + ImplMulw(f2, g2, H, 2); // H(INF) 44/41 bits + + ulong t0 = f0 ^ f1 ^ f2; + ulong t1 = g0 ^ g1 ^ g2; + + ImplMulw(t0, t1, H, 4); // H(1) 44/43 bits + + ulong t2 = (f1 << 1) ^ (f2 << 2); + ulong t3 = (g1 << 1) ^ (g2 << 2); + + ImplMulw(f0 ^ t2, g0 ^ t3, H, 6); // H(t) 44/45 bits + ImplMulw(t0 ^ t2, t1 ^ t3, H, 8); // H(t + 1) 44/45 bits + + ulong t4 = H[6] ^ H[8]; + ulong t5 = H[7] ^ H[9]; + + Debug.Assert(t5 >> 44 == 0); + + // Calculate V + ulong v0 = (t4 << 1) ^ H[6]; + ulong v1 = t4 ^ (t5 << 1) ^ H[7]; + ulong v2 = t5; + + // Calculate U + ulong u0 = H[0]; + ulong u1 = H[1] ^ H[0] ^ H[4]; + ulong u2 = H[1] ^ H[5]; + + // Calculate W + ulong w0 = u0 ^ v0 ^ (H[2] << 4) ^ (H[2] << 1); + ulong w1 = u1 ^ v1 ^ (H[3] << 4) ^ (H[3] << 1); + ulong w2 = u2 ^ v2; + + // Propagate carries + w1 ^= (w0 >> 44); w0 &= M44; + w2 ^= (w1 >> 44); w1 &= M44; + + Debug.Assert((w0 & 1UL) == 0); + + // Divide W by t + + w0 = (w0 >> 1) ^ ((w1 & 1UL) << 43); + w1 = (w1 >> 1) ^ ((w2 & 1UL) << 43); + w2 = (w2 >> 1); + + // Divide W by (t + 1) + + w0 ^= (w0 << 1); + w0 ^= (w0 << 2); + w0 ^= (w0 << 4); + w0 ^= (w0 << 8); + w0 ^= (w0 << 16); + w0 ^= (w0 << 32); + + w0 &= M44; w1 ^= (w0 >> 43); + + w1 ^= (w1 << 1); + w1 ^= (w1 << 2); + w1 ^= (w1 << 4); + w1 ^= (w1 << 8); + w1 ^= (w1 << 16); + w1 ^= (w1 << 32); + + w1 &= M44; w2 ^= (w1 >> 43); + + w2 ^= (w2 << 1); + w2 ^= (w2 << 2); + w2 ^= (w2 << 4); + w2 ^= (w2 << 8); + w2 ^= (w2 << 16); + w2 ^= (w2 << 32); + + Debug.Assert(w2 >> 42 == 0); + + zz[0] = u0; + zz[1] = u1 ^ w0 ^ H[2]; + zz[2] = u2 ^ w1 ^ w0 ^ H[3]; + zz[3] = w2 ^ w1; + zz[4] = w2 ^ H[2]; + zz[5] = H[3]; + + ImplCompactExt(zz); + } + + protected static void ImplMulw(ulong x, ulong y, ulong[] z, int zOff) + { + Debug.Assert(x >> 45 == 0); + Debug.Assert(y >> 45 == 0); + + ulong[] u = new ulong[8]; + //u[0] = 0; + u[1] = y; + u[2] = u[1] << 1; + u[3] = u[2] ^ y; + u[4] = u[2] << 1; + u[5] = u[4] ^ y; + u[6] = u[3] << 1; + u[7] = u[6] ^ y; + + uint j = (uint)x; + ulong g, h = 0, l = u[j & 7] + ^ u[(j >> 3) & 7] << 3 + ^ u[(j >> 6) & 7] << 6; + int k = 33; + do + { + j = (uint)(x >> k); + g = u[j & 7] + ^ u[(j >> 3) & 7] << 3 + ^ u[(j >> 6) & 7] << 6 + ^ u[(j >> 9) & 7] << 9; + l ^= (g << k); + h ^= (g >> -k); + } + while ((k -= 12) > 0); + + Debug.Assert(h >> 25 == 0); + + z[zOff ] = l & M44; + z[zOff + 1] = (l >> 44) ^ (h << 20); + } + + protected static void ImplSquare(ulong[] x, ulong[] zz) + { + Interleave.Expand64To128(x[0], zz, 0); + Interleave.Expand64To128(x[1], zz, 2); + + zz[4] = Interleave.Expand8to16((uint)x[2]); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131Field.cs.meta new file mode 100644 index 00000000..5280dd93 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 527c1d05582060249ab62c9119ba6f62 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131FieldElement.cs new file mode 100644 index 00000000..0deb76c1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131FieldElement.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT131FieldElement + : AbstractF2mFieldElement + { + protected internal readonly ulong[] x; + + public SecT131FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > 131) + throw new ArgumentException("value invalid for SecT131FieldElement", "x"); + + this.x = SecT131Field.FromBigInteger(x); + } + + public SecT131FieldElement() + { + this.x = Nat192.Create64(); + } + + protected internal SecT131FieldElement(ulong[] x) + { + this.x = x; + } + + public override bool IsOne + { + get { return Nat192.IsOne64(x); } + } + + public override bool IsZero + { + get { return Nat192.IsZero64(x); } + } + + public override bool TestBitZero() + { + return (x[0] & 1UL) != 0UL; + } + + public override BigInteger ToBigInteger() + { + return Nat192.ToBigInteger64(x); + } + + public override string FieldName + { + get { return "SecT131Field"; } + } + + public override int FieldSize + { + get { return 131; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + ulong[] z = Nat192.Create64(); + SecT131Field.Add(x, ((SecT131FieldElement)b).x, z); + return new SecT131FieldElement(z); + } + + public override ECFieldElement AddOne() + { + ulong[] z = Nat192.Create64(); + SecT131Field.AddOne(x, z); + return new SecT131FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + // Addition and Subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + ulong[] z = Nat192.Create64(); + SecT131Field.Multiply(x, ((SecT131FieldElement)b).x, z); + return new SecT131FieldElement(z); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x, bx = ((SecT131FieldElement)b).x; + ulong[] xx = ((SecT131FieldElement)x).x, yx = ((SecT131FieldElement)y).x; + + ulong[] tt = Nat.Create64(5); + SecT131Field.MultiplyAddToExt(ax, bx, tt); + SecT131Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat192.Create64(); + SecT131Field.Reduce(tt, z); + return new SecT131FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + return Multiply(b.Invert()); + } + + public override ECFieldElement Negate() + { + return this; + } + + public override ECFieldElement Square() + { + ulong[] z = Nat192.Create64(); + SecT131Field.Square(x, z); + return new SecT131FieldElement(z); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x; + ulong[] xx = ((SecT131FieldElement)x).x, yx = ((SecT131FieldElement)y).x; + + ulong[] tt = Nat.Create64(5); + SecT131Field.SquareAddToExt(ax, tt); + SecT131Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat192.Create64(); + SecT131Field.Reduce(tt, z); + return new SecT131FieldElement(z); + } + + public override ECFieldElement SquarePow(int pow) + { + if (pow < 1) + return this; + + ulong[] z = Nat192.Create64(); + SecT131Field.SquareN(x, pow, z); + return new SecT131FieldElement(z); + } + + public override int Trace() + { + return (int)SecT131Field.Trace(x); + } + + public override ECFieldElement Invert() + { + ulong[] z = Nat192.Create64(); + SecT131Field.Invert(x, z); + return new SecT131FieldElement(z); + } + + public override ECFieldElement Sqrt() + { + ulong[] z = Nat192.Create64(); + SecT131Field.Sqrt(x, z); + return new SecT131FieldElement(z); + } + + public virtual int Representation + { + get { return F2mFieldElement.Ppb; } + } + + public virtual int M + { + get { return 131; } + } + + public virtual int K1 + { + get { return 2; } + } + + public virtual int K2 + { + get { return 3; } + } + + public virtual int K3 + { + get { return 8; } + } + + public override bool Equals(object obj) + { + return Equals(obj as SecT131FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecT131FieldElement); + } + + public virtual bool Equals(SecT131FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat192.Eq64(x, other.x); + } + + public override int GetHashCode() + { + return 131832 ^ Arrays.GetHashCode(x, 0, 3); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131FieldElement.cs.meta new file mode 100644 index 00000000..cd0aceeb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 72de0413a2e13924c819e108bbdaa5e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Curve.cs new file mode 100644 index 00000000..d8907b49 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT131R1Curve + : AbstractF2mCurve + { + private const int SECT131R1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT131R1_FE_LONGS = 3; + + protected readonly SecT131R1Point m_infinity; + + public SecT131R1Curve() + : base(131, 2, 3, 8) + { + this.m_infinity = new SecT131R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, Hex.Decode("07A11B09A76B562144418FF3FF8C2570B8"))); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("0217C05610884B63B9C6C7291678F9D341"))); + this.m_order = new BigInteger(1, Hex.Decode("0400000000000000023123953A9464B54D")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT131R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT131R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 131; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT131FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT131R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT131R1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 131; } + } + + public virtual bool IsTrinomial + { + get { return false; } + } + + public virtual int K1 + { + get { return 2; } + } + + public virtual int K2 + { + get { return 3; } + } + + public virtual int K3 + { + get { return 8; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT131R1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat192.Copy64(((SecT131FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT131R1_FE_LONGS; + Nat192.Copy64(((SecT131FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT131R1_FE_LONGS; + } + } + + return new SecT131R1LookupTable(this, table, len); + } + + private class SecT131R1LookupTable + : ECLookupTable + { + private readonly SecT131R1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT131R1LookupTable(SecT131R1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat192.Create64(), y = Nat192.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT131R1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT131R1_FE_LONGS + j] & MASK; + } + + pos += (SECT131R1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT131FieldElement(x), new SecT131FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Curve.cs.meta new file mode 100644 index 00000000..628cdb61 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d0261827bffcf40469797c5940ecde2a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Point.cs new file mode 100644 index 00000000..9e9b5dff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Point.cs @@ -0,0 +1,291 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT131R1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT131R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT131R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT131R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT131R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).Add(curve.A); + if (X3.IsZero) + { + return new SecT131R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT131R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT131R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement a = curve.A; + ECFieldElement aZ1Sq = Z1IsOne ? a : a.Multiply(Z1Sq); + ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); + if (T.IsZero) + { + return new SecT131R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT131R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + { + return b; + } + if (b.IsInfinity) + { + return Twice(); + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = curve.A.Multiply(Z1Sq).Add(L1Sq).Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = curve.A.Add(L2plus1).Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT131R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT131R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT131R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Point.cs.meta new file mode 100644 index 00000000..c483c15c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b724cdc187d68a14ab82743561c8172c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Curve.cs new file mode 100644 index 00000000..a10e73d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT131R2Curve + : AbstractF2mCurve + { + private const int SECT131R2_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT131R2_FE_LONGS = 3; + + protected readonly SecT131R2Point m_infinity; + + public SecT131R2Curve() + : base(131, 2, 3, 8) + { + this.m_infinity = new SecT131R2Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, Hex.Decode("03E5A88919D7CAFCBF415F07C2176573B2"))); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("04B8266A46C55657AC734CE38F018F2192"))); + this.m_order = new BigInteger(1, Hex.Decode("0400000000000000016954A233049BA98F")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT131R2_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT131R2Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override int FieldSize + { + get { return 131; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT131FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT131R2Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT131R2Point(this, x, y, zs, withCompression); + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 131; } + } + + public virtual bool IsTrinomial + { + get { return false; } + } + + public virtual int K1 + { + get { return 2; } + } + + public virtual int K2 + { + get { return 3; } + } + + public virtual int K3 + { + get { return 8; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT131R2_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat192.Copy64(((SecT131FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT131R2_FE_LONGS; + Nat192.Copy64(((SecT131FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT131R2_FE_LONGS; + } + } + + return new SecT131R2LookupTable(this, table, len); + } + + private class SecT131R2LookupTable + : ECLookupTable + { + private readonly SecT131R2Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT131R2LookupTable(SecT131R2Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat192.Create64(), y = Nat192.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT131R2_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT131R2_FE_LONGS + j] & MASK; + } + + pos += (SECT131R2_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT131FieldElement(x), new SecT131FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Curve.cs.meta new file mode 100644 index 00000000..a165c59c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4921b9560f77c9747861717d70d2afdb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Point.cs new file mode 100644 index 00000000..17d99851 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Point.cs @@ -0,0 +1,287 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT131R2Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT131R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT131R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT131R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT131R2Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).Add(curve.A); + if (X3.IsZero) + { + return new SecT131R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT131R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT131R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement a = curve.A; + ECFieldElement aZ1Sq = Z1IsOne ? a : a.Multiply(Z1Sq); + ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); + if (T.IsZero) + { + return new SecT131R2Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT131R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = curve.A.Multiply(Z1Sq).Add(L1Sq).Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = curve.A.Add(L2plus1).Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT131R2Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT131R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT131R2Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Point.cs.meta new file mode 100644 index 00000000..c53f8cbd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT131R2Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8cd012eab4ae35f43bc77cf7ee5311e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163Field.cs new file mode 100644 index 00000000..ad0a61f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163Field.cs @@ -0,0 +1,344 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT163Field + { + private const ulong M35 = ulong.MaxValue >> 29; + private const ulong M55 = ulong.MaxValue >> 9; + + private static readonly ulong[] ROOT_Z = new ulong[]{ 0xB6DB6DB6DB6DB6B0UL, 0x492492492492DB6DUL, 0x492492492UL }; + + public static void Add(ulong[] x, ulong[] y, ulong[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + z[2] = x[2] ^ y[2]; + } + + public static void AddExt(ulong[] xx, ulong[] yy, ulong[] zz) + { + zz[0] = xx[0] ^ yy[0]; + zz[1] = xx[1] ^ yy[1]; + zz[2] = xx[2] ^ yy[2]; + zz[3] = xx[3] ^ yy[3]; + zz[4] = xx[4] ^ yy[4]; + zz[5] = xx[5] ^ yy[5]; + } + + public static void AddOne(ulong[] x, ulong[] z) + { + z[0] = x[0] ^ 1UL; + z[1] = x[1]; + z[2] = x[2]; + } + + public static ulong[] FromBigInteger(BigInteger x) + { + ulong[] z = Nat192.FromBigInteger64(x); + Reduce29(z, 0); + return z; + } + + public static void Invert(ulong[] x, ulong[] z) + { + if (Nat192.IsZero64(x)) + throw new InvalidOperationException(); + + // Itoh-Tsujii inversion with bases { 2, 3 } + + ulong[] t0 = Nat192.Create64(); + ulong[] t1 = Nat192.Create64(); + + Square(x, t0); + + // 3 | 162 + SquareN(t0, 1, t1); + Multiply(t0, t1, t0); + SquareN(t1, 1, t1); + Multiply(t0, t1, t0); + + // 3 | 54 + SquareN(t0, 3, t1); + Multiply(t0, t1, t0); + SquareN(t1, 3, t1); + Multiply(t0, t1, t0); + + // 3 | 18 + SquareN(t0, 9, t1); + Multiply(t0, t1, t0); + SquareN(t1, 9, t1); + Multiply(t0, t1, t0); + + // 3 | 6 + SquareN(t0, 27, t1); + Multiply(t0, t1, t0); + SquareN(t1, 27, t1); + Multiply(t0, t1, t0); + + // 2 | 2 + SquareN(t0, 81, t1); + Multiply(t0, t1, z); + } + + public static void Multiply(ulong[] x, ulong[] y, ulong[] z) + { + ulong[] tt = Nat192.CreateExt64(); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] tt = Nat192.CreateExt64(); + ImplMultiply(x, y, tt); + AddExt(zz, tt, zz); + } + + public static void Reduce(ulong[] xx, ulong[] z) + { + ulong x0 = xx[0], x1 = xx[1], x2 = xx[2], x3 = xx[3], x4 = xx[4], x5 = xx[5]; + + x2 ^= (x5 << 29) ^ (x5 << 32) ^ (x5 << 35) ^ (x5 << 36); + x3 ^= (x5 >> 35) ^ (x5 >> 32) ^ (x5 >> 29) ^ (x5 >> 28); + + x1 ^= (x4 << 29) ^ (x4 << 32) ^ (x4 << 35) ^ (x4 << 36); + x2 ^= (x4 >> 35) ^ (x4 >> 32) ^ (x4 >> 29) ^ (x4 >> 28); + + x0 ^= (x3 << 29) ^ (x3 << 32) ^ (x3 << 35) ^ (x3 << 36); + x1 ^= (x3 >> 35) ^ (x3 >> 32) ^ (x3 >> 29) ^ (x3 >> 28); + + ulong t = x2 >> 35; + z[0] = x0 ^ t ^ (t << 3) ^ (t << 6) ^ (t << 7); + z[1] = x1; + z[2] = x2 & M35; + } + + public static void Reduce29(ulong[] z, int zOff) + { + ulong z2 = z[zOff + 2], t = z2 >> 35; + z[zOff ] ^= t ^ (t << 3) ^ (t << 6) ^ (t << 7); + z[zOff + 2] = z2 & M35; + } + + public static void Sqrt(ulong[] x, ulong[] z) + { + ulong[] odd = Nat192.Create64(); + + ulong u0, u1; + u0 = Interleave.Unshuffle(x[0]); u1 = Interleave.Unshuffle(x[1]); + ulong e0 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + odd[0] = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[2]); + ulong e1 = (u0 & 0x00000000FFFFFFFFUL); + odd[1] = (u0 >> 32); + + Multiply(odd, ROOT_Z, z); + + z[0] ^= e0; + z[1] ^= e1; + } + + public static void Square(ulong[] x, ulong[] z) + { + ulong[] tt = Nat192.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareAddToExt(ulong[] x, ulong[] zz) + { + ulong[] tt = Nat192.CreateExt64(); + ImplSquare(x, tt); + AddExt(zz, tt, zz); + } + + public static void SquareN(ulong[] x, int n, ulong[] z) + { + Debug.Assert(n > 0); + + ulong[] tt = Nat192.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static uint Trace(ulong[] x) + { + // Non-zero-trace bits: 0, 157 + return (uint)(x[0] ^ (x[2] >> 29)) & 1U; + } + + protected static void ImplCompactExt(ulong[] zz) + { + ulong z0 = zz[0], z1 = zz[1], z2 = zz[2], z3 = zz[3], z4 = zz[4], z5 = zz[5]; + zz[0] = z0 ^ (z1 << 55); + zz[1] = (z1 >> 9) ^ (z2 << 46); + zz[2] = (z2 >> 18) ^ (z3 << 37); + zz[3] = (z3 >> 27) ^ (z4 << 28); + zz[4] = (z4 >> 36) ^ (z5 << 19); + zz[5] = (z5 >> 45); + } + + protected static void ImplMultiply(ulong[] x, ulong[] y, ulong[] zz) + { + /* + * "Five-way recursion" as described in "Batch binary Edwards", Daniel J. Bernstein. + */ + + ulong f0 = x[0], f1 = x[1], f2 = x[2]; + f2 = ((f1 >> 46) ^ (f2 << 18)); + f1 = ((f0 >> 55) ^ (f1 << 9)) & M55; + f0 &= M55; + + ulong g0 = y[0], g1 = y[1], g2 = y[2]; + g2 = ((g1 >> 46) ^ (g2 << 18)); + g1 = ((g0 >> 55) ^ (g1 << 9)) & M55; + g0 &= M55; + + ulong[] H = new ulong[10]; + + ImplMulw(f0, g0, H, 0); // H(0) 55/54 bits + ImplMulw(f2, g2, H, 2); // H(INF) 55/50 bits + + ulong t0 = f0 ^ f1 ^ f2; + ulong t1 = g0 ^ g1 ^ g2; + + ImplMulw(t0, t1, H, 4); // H(1) 55/54 bits + + ulong t2 = (f1 << 1) ^ (f2 << 2); + ulong t3 = (g1 << 1) ^ (g2 << 2); + + ImplMulw(f0 ^ t2, g0 ^ t3, H, 6); // H(t) 55/56 bits + ImplMulw(t0 ^ t2, t1 ^ t3, H, 8); // H(t + 1) 55/56 bits + + ulong t4 = H[6] ^ H[8]; + ulong t5 = H[7] ^ H[9]; + + Debug.Assert(t5 >> 55 == 0); + + // Calculate V + ulong v0 = (t4 << 1) ^ H[6]; + ulong v1 = t4 ^ (t5 << 1) ^ H[7]; + ulong v2 = t5; + + // Calculate U + ulong u0 = H[0]; + ulong u1 = H[1] ^ H[0] ^ H[4]; + ulong u2 = H[1] ^ H[5]; + + // Calculate W + ulong w0 = u0 ^ v0 ^ (H[2] << 4) ^ (H[2] << 1); + ulong w1 = u1 ^ v1 ^ (H[3] << 4) ^ (H[3] << 1); + ulong w2 = u2 ^ v2; + + // Propagate carries + w1 ^= (w0 >> 55); w0 &= M55; + w2 ^= (w1 >> 55); w1 &= M55; + + Debug.Assert((w0 & 1UL) == 0UL); + + // Divide W by t + + w0 = (w0 >> 1) ^ ((w1 & 1UL) << 54); + w1 = (w1 >> 1) ^ ((w2 & 1UL) << 54); + w2 = (w2 >> 1); + + // Divide W by (t + 1) + + w0 ^= (w0 << 1); + w0 ^= (w0 << 2); + w0 ^= (w0 << 4); + w0 ^= (w0 << 8); + w0 ^= (w0 << 16); + w0 ^= (w0 << 32); + + w0 &= M55; w1 ^= (w0 >> 54); + + w1 ^= (w1 << 1); + w1 ^= (w1 << 2); + w1 ^= (w1 << 4); + w1 ^= (w1 << 8); + w1 ^= (w1 << 16); + w1 ^= (w1 << 32); + + w1 &= M55; w2 ^= (w1 >> 54); + + w2 ^= (w2 << 1); + w2 ^= (w2 << 2); + w2 ^= (w2 << 4); + w2 ^= (w2 << 8); + w2 ^= (w2 << 16); + w2 ^= (w2 << 32); + + Debug.Assert(w2 >> 52 == 0); + + zz[0] = u0; + zz[1] = u1 ^ w0 ^ H[2]; + zz[2] = u2 ^ w1 ^ w0 ^ H[3]; + zz[3] = w2 ^ w1; + zz[4] = w2 ^ H[2]; + zz[5] = H[3]; + + ImplCompactExt(zz); + } + + protected static void ImplMulw(ulong x, ulong y, ulong[] z, int zOff) + { + Debug.Assert(x >> 56 == 0); + Debug.Assert(y >> 56 == 0); + + ulong[] u = new ulong[8]; + //u[0] = 0; + u[1] = y; + u[2] = u[1] << 1; + u[3] = u[2] ^ y; + u[4] = u[2] << 1; + u[5] = u[4] ^ y; + u[6] = u[3] << 1; + u[7] = u[6] ^ y; + + uint j = (uint)x; + ulong g, h = 0, l = u[j & 3]; + int k = 47; + do + { + j = (uint)(x >> k); + g = u[j & 7] + ^ u[(j >> 3) & 7] << 3 + ^ u[(j >> 6) & 7] << 6; + l ^= (g << k); + h ^= (g >> -k); + } + while ((k -= 9) > 0); + + Debug.Assert(h >> 47 == 0); + + z[zOff ] = l & M55; + z[zOff + 1] = (l >> 55) ^ (h << 9); + } + + protected static void ImplSquare(ulong[] x, ulong[] zz) + { + Interleave.Expand64To128(x[0], zz, 0); + Interleave.Expand64To128(x[1], zz, 2); + + ulong x2 = x[2]; + zz[4] = Interleave.Expand32to64((uint)x2); + zz[5] = Interleave.Expand8to16((uint)(x2 >> 32)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163Field.cs.meta new file mode 100644 index 00000000..ea47ce07 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b55cdcb57a2bab44be2fb7cc83e0236 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163FieldElement.cs new file mode 100644 index 00000000..7e17a09a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163FieldElement.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT163FieldElement + : AbstractF2mFieldElement + { + protected internal readonly ulong[] x; + + public SecT163FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > 163) + throw new ArgumentException("value invalid for SecT163FieldElement", "x"); + + this.x = SecT163Field.FromBigInteger(x); + } + + public SecT163FieldElement() + { + this.x = Nat192.Create64(); + } + + protected internal SecT163FieldElement(ulong[] x) + { + this.x = x; + } + + public override bool IsOne + { + get { return Nat192.IsOne64(x); } + } + + public override bool IsZero + { + get { return Nat192.IsZero64(x); } + } + + public override bool TestBitZero() + { + return (x[0] & 1L) != 0L; + } + + public override BigInteger ToBigInteger() + { + return Nat192.ToBigInteger64(x); + } + + public override string FieldName + { + get { return "SecT163Field"; } + } + + public override int FieldSize + { + get { return 163; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + ulong[] z = Nat192.Create64(); + SecT163Field.Add(x, ((SecT163FieldElement)b).x, z); + return new SecT163FieldElement(z); + } + + public override ECFieldElement AddOne() + { + ulong[] z = Nat192.Create64(); + SecT163Field.AddOne(x, z); + return new SecT163FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + // Addition and subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + ulong[] z = Nat192.Create64(); + SecT163Field.Multiply(x, ((SecT163FieldElement)b).x, z); + return new SecT163FieldElement(z); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x, bx = ((SecT163FieldElement)b).x; + ulong[] xx = ((SecT163FieldElement)x).x, yx = ((SecT163FieldElement)y).x; + + ulong[] tt = Nat192.CreateExt64(); + SecT163Field.MultiplyAddToExt(ax, bx, tt); + SecT163Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat192.Create64(); + SecT163Field.Reduce(tt, z); + return new SecT163FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + return Multiply(b.Invert()); + } + + public override ECFieldElement Negate() + { + return this; + } + + public override ECFieldElement Square() + { + ulong[] z = Nat192.Create64(); + SecT163Field.Square(x, z); + return new SecT163FieldElement(z); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x; + ulong[] xx = ((SecT163FieldElement)x).x, yx = ((SecT163FieldElement)y).x; + + ulong[] tt = Nat192.CreateExt64(); + SecT163Field.SquareAddToExt(ax, tt); + SecT163Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat192.Create64(); + SecT163Field.Reduce(tt, z); + return new SecT163FieldElement(z); + } + + public override ECFieldElement SquarePow(int pow) + { + if (pow < 1) + return this; + + ulong[] z = Nat192.Create64(); + SecT163Field.SquareN(x, pow, z); + return new SecT163FieldElement(z); + } + + public override int Trace() + { + return (int)SecT163Field.Trace(x); + } + + public override ECFieldElement Invert() + { + ulong[] z = Nat192.Create64(); + SecT163Field.Invert(x, z); + return new SecT163FieldElement(z); + } + + public override ECFieldElement Sqrt() + { + ulong[] z = Nat192.Create64(); + SecT163Field.Sqrt(x, z); + return new SecT163FieldElement(z); + } + + public virtual int Representation + { + get { return F2mFieldElement.Ppb; } + } + + public virtual int M + { + get { return 163; } + } + + public virtual int K1 + { + get { return 3; } + } + + public virtual int K2 + { + get { return 6; } + } + + public virtual int K3 + { + get { return 7; } + } + + public override bool Equals(object obj) + { + return Equals(obj as SecT163FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecT163FieldElement); + } + + public virtual bool Equals(SecT163FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat192.Eq64(x, other.x); + } + + public override int GetHashCode() + { + return 163763 ^ Arrays.GetHashCode(x, 0, 3); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163FieldElement.cs.meta new file mode 100644 index 00000000..0cae076c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 08f568b7d3a3b794fb15d90d7d9cf56e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Curve.cs new file mode 100644 index 00000000..c1f8e364 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Curve.cs @@ -0,0 +1,167 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT163K1Curve + : AbstractF2mCurve + { + private const int SECT163K1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT163K1_FE_LONGS = 3; + + protected readonly SecT163K1Point m_infinity; + + public SecT163K1Curve() + : base(163, 3, 6, 7) + { + this.m_infinity = new SecT163K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.One); + this.m_b = this.m_a; + this.m_order = new BigInteger(1, Hex.Decode("04000000000000000000020108A2E0CC0D99F8A5EF")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT163K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT163K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + protected override ECMultiplier CreateDefaultMultiplier() + { + return new WTauNafMultiplier(); + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 163; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT163FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT163K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT163K1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return true; } + } + + public virtual int M + { + get { return 163; } + } + + public virtual bool IsTrinomial + { + get { return false; } + } + + public virtual int K1 + { + get { return 3; } + } + + public virtual int K2 + { + get { return 6; } + } + + public virtual int K3 + { + get { return 7; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT163K1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat192.Copy64(((SecT163FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT163K1_FE_LONGS; + Nat192.Copy64(((SecT163FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT163K1_FE_LONGS; + } + } + + return new SecT163K1LookupTable(this, table, len); + } + + private class SecT163K1LookupTable + : ECLookupTable + { + private readonly SecT163K1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT163K1LookupTable(SecT163K1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat192.Create64(), y = Nat192.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT163K1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT163K1_FE_LONGS + j] & MASK; + } + + pos += (SECT163K1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT163FieldElement(x), new SecT163FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Curve.cs.meta new file mode 100644 index 00000000..19e33465 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 976cb761a30ff1a4e80fb9334c6f7175 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Point.cs new file mode 100644 index 00000000..9f0c0766 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Point.cs @@ -0,0 +1,285 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT163K1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT163K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT163K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT163K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT163K1Point(null, this.AffineXCoord, this.AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).AddOne(); + if (X3.IsZero) + { + return new SecT163K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT163K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT163K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); + if (T.IsZero) + { + return new SecT163K1Point(curve, T, curve.B, IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement t1 = L1.Add(X1).Square(); + ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(X3); + + return new SecT163K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + // NOTE: TwicePlus() only optimized for lambda-affine argument + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = Z1Sq.Add(L1Sq).Add(L1Z1); + ECFieldElement A = L2.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT163K1Point(curve, A, curve.B, IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); + + return new SecT163K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT163K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Point.cs.meta new file mode 100644 index 00000000..72a6d219 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4644b5025fe7953469fe1de6e795d40e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Curve.cs new file mode 100644 index 00000000..9bd6ae02 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT163R1Curve + : AbstractF2mCurve + { + private const int SECT163R1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT163R1_FE_LONGS = 3; + + protected readonly SecT163R1Point m_infinity; + + public SecT163R1Curve() + : base(163, 3, 6, 7) + { + this.m_infinity = new SecT163R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, Hex.Decode("07B6882CAAEFA84F9554FF8428BD88E246D2782AE2"))); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9"))); + this.m_order = new BigInteger(1, Hex.Decode("03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT163R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT163R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 163; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT163FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT163R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT163R1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 163; } + } + + public virtual bool IsTrinomial + { + get { return false; } + } + + public virtual int K1 + { + get { return 3; } + } + + public virtual int K2 + { + get { return 6; } + } + + public virtual int K3 + { + get { return 7; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT163R1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat192.Copy64(((SecT163FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT163R1_FE_LONGS; + Nat192.Copy64(((SecT163FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT163R1_FE_LONGS; + } + } + + return new SecT163R1LookupTable(this, table, len); + } + + private class SecT163R1LookupTable + : ECLookupTable + { + private readonly SecT163R1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT163R1LookupTable(SecT163R1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat192.Create64(), y = Nat192.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT163R1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT163R1_FE_LONGS + j] & MASK; + } + + pos += (SECT163R1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT163FieldElement(x), new SecT163FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Curve.cs.meta new file mode 100644 index 00000000..b10aba87 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee61fe945074bfa4c8dc05181ba609d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Point.cs new file mode 100644 index 00000000..736becea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Point.cs @@ -0,0 +1,287 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT163R1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT163R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT163R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT163R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT163R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).Add(curve.A); + if (X3.IsZero) + { + return new SecT163R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT163R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement a = curve.A; + ECFieldElement aZ1Sq = Z1IsOne ? a : a.Multiply(Z1Sq); + ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); + if (T.IsZero) + { + return new SecT163R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = curve.A.Multiply(Z1Sq).Add(L1Sq).Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = curve.A.Add(L2plus1).Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT163R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT163R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Point.cs.meta new file mode 100644 index 00000000..b324cfac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fe4ab3e2a058412428aca19b765ca554 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Curve.cs new file mode 100644 index 00000000..1c22565a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT163R2Curve + : AbstractF2mCurve + { + private const int SECT163R2_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT163R2_FE_LONGS = 3; + + protected readonly SecT163R2Point m_infinity; + + public SecT163R2Curve() + : base(163, 3, 6, 7) + { + this.m_infinity = new SecT163R2Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.One); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("020A601907B8C953CA1481EB10512F78744A3205FD"))); + this.m_order = new BigInteger(1, Hex.Decode("040000000000000000000292FE77E70C12A4234C33")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT163R2_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT163R2Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 163; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT163FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT163R2Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT163R2Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 163; } + } + + public virtual bool IsTrinomial + { + get { return false; } + } + + public virtual int K1 + { + get { return 3; } + } + + public virtual int K2 + { + get { return 6; } + } + + public virtual int K3 + { + get { return 7; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT163R2_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat192.Copy64(((SecT163FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT163R2_FE_LONGS; + Nat192.Copy64(((SecT163FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT163R2_FE_LONGS; + } + } + + return new SecT163R2LookupTable(this, table, len); + } + + private class SecT163R2LookupTable + : ECLookupTable + { + private readonly SecT163R2Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT163R2LookupTable(SecT163R2Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat192.Create64(), y = Nat192.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT163R2_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT163R2_FE_LONGS + j] & MASK; + } + + pos += (SECT163R2_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT163FieldElement(x), new SecT163FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Curve.cs.meta new file mode 100644 index 00000000..01fa31a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f69c9a732e5e17244b151ca873d7d6e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Point.cs new file mode 100644 index 00000000..44d7e977 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Point.cs @@ -0,0 +1,290 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT163R2Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT163R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT163R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT163R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT163R2Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + { + return Twice(); + } + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).AddOne(); + if (X3.IsZero) + { + return new SecT163R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT163R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT163R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); + if (T.IsZero) + { + return new SecT163R2Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT163R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + { + return b; + } + if (b.IsInfinity) + { + return Twice(); + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = Z1Sq.Add(L1Sq).Add(L1Z1); + ECFieldElement A = L2.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT163R2Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); + + return new SecT163R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT163R2Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Point.cs.meta new file mode 100644 index 00000000..8d388657 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT163R2Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2962527dcabd980428bc4751bd5097b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193Field.cs new file mode 100644 index 00000000..434bb238 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193Field.cs @@ -0,0 +1,309 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT193Field + { + private const ulong M01 = 1UL; + private const ulong M49 = ulong.MaxValue >> 15; + + public static void Add(ulong[] x, ulong[] y, ulong[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + z[2] = x[2] ^ y[2]; + z[3] = x[3] ^ y[3]; + } + + public static void AddExt(ulong[] xx, ulong[] yy, ulong[] zz) + { + zz[0] = xx[0] ^ yy[0]; + zz[1] = xx[1] ^ yy[1]; + zz[2] = xx[2] ^ yy[2]; + zz[3] = xx[3] ^ yy[3]; + zz[4] = xx[4] ^ yy[4]; + zz[5] = xx[5] ^ yy[5]; + zz[6] = xx[6] ^ yy[6]; + } + + public static void AddOne(ulong[] x, ulong[] z) + { + z[0] = x[0] ^ 1UL; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + } + + public static ulong[] FromBigInteger(BigInteger x) + { + ulong[] z = Nat256.FromBigInteger64(x); + Reduce63(z, 0); + return z; + } + + public static void Invert(ulong[] x, ulong[] z) + { + if (Nat256.IsZero64(x)) + throw new InvalidOperationException(); + + // Itoh-Tsujii inversion with bases { 2, 3 } + + ulong[] t0 = Nat256.Create64(); + ulong[] t1 = Nat256.Create64(); + + Square(x, t0); + + // 3 | 192 + SquareN(t0, 1, t1); + Multiply(t0, t1, t0); + SquareN(t1, 1, t1); + Multiply(t0, t1, t0); + + // 2 | 64 + SquareN(t0, 3, t1); + Multiply(t0, t1, t0); + + // 2 | 32 + SquareN(t0, 6, t1); + Multiply(t0, t1, t0); + + // 2 | 16 + SquareN(t0, 12, t1); + Multiply(t0, t1, t0); + + // 2 | 8 + SquareN(t0, 24, t1); + Multiply(t0, t1, t0); + + // 2 | 4 + SquareN(t0, 48, t1); + Multiply(t0, t1, t0); + + // 2 | 2 + SquareN(t0, 96, t1); + Multiply(t0, t1, z); + } + + public static void Multiply(ulong[] x, ulong[] y, ulong[] z) + { + ulong[] tt = Nat256.CreateExt64(); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] tt = Nat256.CreateExt64(); + ImplMultiply(x, y, tt); + AddExt(zz, tt, zz); + } + + public static void Reduce(ulong[] xx, ulong[] z) + { + ulong x0 = xx[0], x1 = xx[1], x2 = xx[2], x3 = xx[3], x4 = xx[4], x5 = xx[5], x6 = xx[6]; + + x2 ^= (x6 << 63); + x3 ^= (x6 >> 1) ^ (x6 << 14); + x4 ^= (x6 >> 50); + + x1 ^= (x5 << 63); + x2 ^= (x5 >> 1) ^ (x5 << 14); + x3 ^= (x5 >> 50); + + x0 ^= (x4 << 63); + x1 ^= (x4 >> 1) ^ (x4 << 14); + x2 ^= (x4 >> 50); + + ulong t = x3 >> 1; + z[0] = x0 ^ t ^ (t << 15); + z[1] = x1 ^ (t >> 49); + z[2] = x2; + z[3] = x3 & M01; + } + + public static void Reduce63(ulong[] z, int zOff) + { + ulong z3 = z[zOff + 3], t = z3 >> 1; + z[zOff ] ^= t ^ (t << 15); + z[zOff + 1] ^= (t >> 49); + z[zOff + 3] = z3 & M01; + } + + public static void Sqrt(ulong[] x, ulong[] z) + { + ulong u0, u1; + u0 = Interleave.Unshuffle(x[0]); u1 = Interleave.Unshuffle(x[1]); + ulong e0 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + ulong c0 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[2]); + ulong e1 = (u0 & 0x00000000FFFFFFFFUL) ^ (x[3] << 32); + ulong c1 = (u0 >> 32); + + z[0] = e0 ^ (c0 << 8); + z[1] = e1 ^ (c1 << 8) ^ (c0 >> 56) ^ (c0 << 33); + z[2] = (c1 >> 56) ^ (c1 << 33) ^ (c0 >> 31); + z[3] = (c1 >> 31); + } + + public static void Square(ulong[] x, ulong[] z) + { + ulong[] tt = Nat256.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareAddToExt(ulong[] x, ulong[] zz) + { + ulong[] tt = Nat256.CreateExt64(); + ImplSquare(x, tt); + AddExt(zz, tt, zz); + } + + public static void SquareN(ulong[] x, int n, ulong[] z) + { + Debug.Assert(n > 0); + + ulong[] tt = Nat256.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static uint Trace(ulong[] x) + { + // Non-zero-trace bits: 0 + return (uint)(x[0]) & 1U; + } + + protected static void ImplCompactExt(ulong[] zz) + { + ulong z0 = zz[0], z1 = zz[1], z2 = zz[2], z3 = zz[3], z4 = zz[4], z5 = zz[5], z6 = zz[6], z7 = zz[7]; + zz[0] = z0 ^ (z1 << 49); + zz[1] = (z1 >> 15) ^ (z2 << 34); + zz[2] = (z2 >> 30) ^ (z3 << 19); + zz[3] = (z3 >> 45) ^ (z4 << 4) + ^ (z5 << 53); + zz[4] = (z4 >> 60) ^ (z6 << 38) + ^ (z5 >> 11); + zz[5] = (z6 >> 26) ^ (z7 << 23); + zz[6] = (z7 >> 41); + zz[7] = 0; + } + + protected static void ImplExpand(ulong[] x, ulong[] z) + { + ulong x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3]; + z[0] = x0 & M49; + z[1] = ((x0 >> 49) ^ (x1 << 15)) & M49; + z[2] = ((x1 >> 34) ^ (x2 << 30)) & M49; + z[3] = ((x2 >> 19) ^ (x3 << 45)); + } + + protected static void ImplMultiply(ulong[] x, ulong[] y, ulong[] zz) + { + /* + * "Two-level seven-way recursion" as described in "Batch binary Edwards", Daniel J. Bernstein. + */ + + ulong[] f = new ulong[4], g = new ulong[4]; + ImplExpand(x, f); + ImplExpand(y, g); + + ImplMulwAcc(f[0], g[0], zz, 0); + ImplMulwAcc(f[1], g[1], zz, 1); + ImplMulwAcc(f[2], g[2], zz, 2); + ImplMulwAcc(f[3], g[3], zz, 3); + + // U *= (1 - t^n) + for (int i = 5; i > 0; --i) + { + zz[i] ^= zz[i - 1]; + } + + ImplMulwAcc(f[0] ^ f[1], g[0] ^ g[1], zz, 1); + ImplMulwAcc(f[2] ^ f[3], g[2] ^ g[3], zz, 3); + + // V *= (1 - t^2n) + for (int i = 7; i > 1; --i) + { + zz[i] ^= zz[i - 2]; + } + + // Double-length recursion + { + ulong c0 = f[0] ^ f[2], c1 = f[1] ^ f[3]; + ulong d0 = g[0] ^ g[2], d1 = g[1] ^ g[3]; + ImplMulwAcc(c0 ^ c1, d0 ^ d1, zz, 3); + ulong[] t = new ulong[3]; + ImplMulwAcc(c0, d0, t, 0); + ImplMulwAcc(c1, d1, t, 1); + ulong t0 = t[0], t1 = t[1], t2 = t[2]; + zz[2] ^= t0; + zz[3] ^= t0 ^ t1; + zz[4] ^= t2 ^ t1; + zz[5] ^= t2; + } + + ImplCompactExt(zz); + } + + protected static void ImplMulwAcc(ulong x, ulong y, ulong[] z, int zOff) + { + Debug.Assert(x >> 49 == 0); + Debug.Assert(y >> 49 == 0); + + ulong[] u = new ulong[8]; + //u[0] = 0; + u[1] = y; + u[2] = u[1] << 1; + u[3] = u[2] ^ y; + u[4] = u[2] << 1; + u[5] = u[4] ^ y; + u[6] = u[3] << 1; + u[7] = u[6] ^ y; + + uint j = (uint)x; + ulong g, h = 0, l = u[j & 7] + ^ (u[(j >> 3) & 7] << 3); + int k = 36; + do + { + j = (uint)(x >> k); + g = u[j & 7] + ^ u[(j >> 3) & 7] << 3 + ^ u[(j >> 6) & 7] << 6 + ^ u[(j >> 9) & 7] << 9 + ^ u[(j >> 12) & 7] << 12; + l ^= (g << k); + h ^= (g >> -k); + } + while ((k -= 15) > 0); + + Debug.Assert(h >> 33 == 0); + + z[zOff ] ^= l & M49; + z[zOff + 1] ^= (l >> 49) ^ (h << 15); + } + + protected static void ImplSquare(ulong[] x, ulong[] zz) + { + Interleave.Expand64To128(x[0], zz, 0); + Interleave.Expand64To128(x[1], zz, 2); + Interleave.Expand64To128(x[2], zz, 4); + zz[6] = (x[3] & M01); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193Field.cs.meta new file mode 100644 index 00000000..1090288a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94e9d639b53e63640920b428ab252952 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193FieldElement.cs new file mode 100644 index 00000000..6e04079e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193FieldElement.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT193FieldElement + : AbstractF2mFieldElement + { + protected internal readonly ulong[] x; + + public SecT193FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > 193) + throw new ArgumentException("value invalid for SecT193FieldElement", "x"); + + this.x = SecT193Field.FromBigInteger(x); + } + + public SecT193FieldElement() + { + this.x = Nat256.Create64(); + } + + protected internal SecT193FieldElement(ulong[] x) + { + this.x = x; + } + + public override bool IsOne + { + get { return Nat256.IsOne64(x); } + } + + public override bool IsZero + { + get { return Nat256.IsZero64(x); } + } + + public override bool TestBitZero() + { + return (x[0] & 1UL) != 0UL; + } + + public override BigInteger ToBigInteger() + { + return Nat256.ToBigInteger64(x); + } + + public override string FieldName + { + get { return "SecT193Field"; } + } + + public override int FieldSize + { + get { return 193; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + ulong[] z = Nat256.Create64(); + SecT193Field.Add(x, ((SecT193FieldElement)b).x, z); + return new SecT193FieldElement(z); + } + + public override ECFieldElement AddOne() + { + ulong[] z = Nat256.Create64(); + SecT193Field.AddOne(x, z); + return new SecT193FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + // Addition and Subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + ulong[] z = Nat256.Create64(); + SecT193Field.Multiply(x, ((SecT193FieldElement)b).x, z); + return new SecT193FieldElement(z); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x, bx = ((SecT193FieldElement)b).x; + ulong[] xx = ((SecT193FieldElement)x).x, yx = ((SecT193FieldElement)y).x; + + ulong[] tt = Nat256.CreateExt64(); + SecT193Field.MultiplyAddToExt(ax, bx, tt); + SecT193Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat256.Create64(); + SecT193Field.Reduce(tt, z); + return new SecT193FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + return Multiply(b.Invert()); + } + + public override ECFieldElement Negate() + { + return this; + } + + public override ECFieldElement Square() + { + ulong[] z = Nat256.Create64(); + SecT193Field.Square(x, z); + return new SecT193FieldElement(z); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x; + ulong[] xx = ((SecT193FieldElement)x).x, yx = ((SecT193FieldElement)y).x; + + ulong[] tt = Nat256.CreateExt64(); + SecT193Field.SquareAddToExt(ax, tt); + SecT193Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat256.Create64(); + SecT193Field.Reduce(tt, z); + return new SecT193FieldElement(z); + } + + public override ECFieldElement SquarePow(int pow) + { + if (pow < 1) + return this; + + ulong[] z = Nat256.Create64(); + SecT193Field.SquareN(x, pow, z); + return new SecT193FieldElement(z); + } + + public override int Trace() + { + return (int)SecT193Field.Trace(x); + } + + public override ECFieldElement Invert() + { + ulong[] z = Nat256.Create64(); + SecT193Field.Invert(x, z); + return new SecT193FieldElement(z); + } + + public override ECFieldElement Sqrt() + { + ulong[] z = Nat256.Create64(); + SecT193Field.Sqrt(x, z); + return new SecT193FieldElement(z); + } + + public virtual int Representation + { + get { return F2mFieldElement.Tpb; } + } + + public virtual int M + { + get { return 193; } + } + + public virtual int K1 + { + get { return 15; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override bool Equals(object obj) + { + return Equals(obj as SecT193FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecT193FieldElement); + } + + public virtual bool Equals(SecT193FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat256.Eq64(x, other.x); + } + + public override int GetHashCode() + { + return 1930015 ^ Arrays.GetHashCode(x, 0, 4); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193FieldElement.cs.meta new file mode 100644 index 00000000..cee3baaa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ed86b58b8064a6c448038ebcda1c1b6a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Curve.cs new file mode 100644 index 00000000..205fd5a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT193R1Curve + : AbstractF2mCurve + { + private const int SECT193R1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT193R1_FE_LONGS = 4; + + protected readonly SecT193R1Point m_infinity; + + public SecT193R1Curve() + : base(193, 15, 0, 0) + { + this.m_infinity = new SecT193R1Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, Hex.Decode("0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01"))); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814"))); + this.m_order = new BigInteger(1, Hex.Decode("01000000000000000000000000C7F34A778F443ACC920EBA49")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT193R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT193R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 193; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT193FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT193R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT193R1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 193; } + } + + public virtual bool IsTrinomial + { + get { return true; } + } + + public virtual int K1 + { + get { return 15; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT193R1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat256.Copy64(((SecT193FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT193R1_FE_LONGS; + Nat256.Copy64(((SecT193FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT193R1_FE_LONGS; + } + } + + return new SecT193R1LookupTable(this, table, len); + } + + private class SecT193R1LookupTable + : ECLookupTable + { + private readonly SecT193R1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT193R1LookupTable(SecT193R1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat256.Create64(), y = Nat256.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT193R1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT193R1_FE_LONGS + j] & MASK; + } + + pos += (SECT193R1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT193FieldElement(x), new SecT193FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Curve.cs.meta new file mode 100644 index 00000000..4e26fdf1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 24847eeab11476b4ba3244a99c0beb7a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Point.cs new file mode 100644 index 00000000..0480e397 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Point.cs @@ -0,0 +1,287 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT193R1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT193R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT193R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT193R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT193R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).Add(curve.A); + if (X3.IsZero) + { + return new SecT193R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT193R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT193R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement a = curve.A; + ECFieldElement aZ1Sq = Z1IsOne ? a : a.Multiply(Z1Sq); + ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); + if (T.IsZero) + { + return new SecT193R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT193R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = curve.A.Multiply(Z1Sq).Add(L1Sq).Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = curve.A.Add(L2plus1).Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT193R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT193R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT193R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Point.cs.meta new file mode 100644 index 00000000..ca202a64 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a02a055b55d3a44dbf3364748e26b65 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Curve.cs new file mode 100644 index 00000000..bad99360 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT193R2Curve + : AbstractF2mCurve + { + private const int SECT193R2_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT193R2_FE_LONGS = 4; + + protected readonly SecT193R2Point m_infinity; + + public SecT193R2Curve() + : base(193, 15, 0, 0) + { + this.m_infinity = new SecT193R2Point(this, null, null); + + this.m_a = FromBigInteger(new BigInteger(1, Hex.Decode("0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B"))); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE"))); + this.m_order = new BigInteger(1, Hex.Decode("010000000000000000000000015AAB561B005413CCD4EE99D5")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT193R2_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT193R2Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 193; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT193FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT193R2Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT193R2Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 193; } + } + + public virtual bool IsTrinomial + { + get { return true; } + } + + public virtual int K1 + { + get { return 15; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT193R2_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat256.Copy64(((SecT193FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT193R2_FE_LONGS; + Nat256.Copy64(((SecT193FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT193R2_FE_LONGS; + } + } + + return new SecT193R2LookupTable(this, table, len); + } + + private class SecT193R2LookupTable + : ECLookupTable + { + private readonly SecT193R2Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT193R2LookupTable(SecT193R2Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat256.Create64(), y = Nat256.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT193R2_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT193R2_FE_LONGS + j] & MASK; + } + + pos += (SECT193R2_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT193FieldElement(x), new SecT193FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Curve.cs.meta new file mode 100644 index 00000000..a071a527 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d2f3ea3cc4118b84db48818f0e79c25a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Point.cs new file mode 100644 index 00000000..a573023b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Point.cs @@ -0,0 +1,287 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT193R2Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT193R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT193R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT193R2Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT193R2Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).Add(curve.A); + if (X3.IsZero) + { + return new SecT193R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT193R2Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement a = curve.A; + ECFieldElement aZ1Sq = Z1IsOne ? a : a.Multiply(Z1Sq); + ECFieldElement T = L1.Square().Add(L1Z1).Add(aZ1Sq); + if (T.IsZero) + { + return new SecT193R2Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = curve.A.Multiply(Z1Sq).Add(L1Sq).Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = curve.A.Add(L2plus1).Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT193R2Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT193R2Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Point.cs.meta new file mode 100644 index 00000000..5291c974 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT193R2Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b7ab89d88e018047bca78933a467e6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233Field.cs new file mode 100644 index 00000000..8dd73505 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233Field.cs @@ -0,0 +1,321 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT233Field + { + private const ulong M41 = ulong.MaxValue >> 23; + private const ulong M59 = ulong.MaxValue >> 5; + + public static void Add(ulong[] x, ulong[] y, ulong[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + z[2] = x[2] ^ y[2]; + z[3] = x[3] ^ y[3]; + } + + public static void AddExt(ulong[] xx, ulong[] yy, ulong[] zz) + { + zz[0] = xx[0] ^ yy[0]; + zz[1] = xx[1] ^ yy[1]; + zz[2] = xx[2] ^ yy[2]; + zz[3] = xx[3] ^ yy[3]; + zz[4] = xx[4] ^ yy[4]; + zz[5] = xx[5] ^ yy[5]; + zz[6] = xx[6] ^ yy[6]; + zz[7] = xx[7] ^ yy[7]; + } + + public static void AddOne(ulong[] x, ulong[] z) + { + z[0] = x[0] ^ 1UL; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + } + + public static ulong[] FromBigInteger(BigInteger x) + { + ulong[] z = Nat256.FromBigInteger64(x); + Reduce23(z, 0); + return z; + } + + public static void Invert(ulong[] x, ulong[] z) + { + if (Nat256.IsZero64(x)) + throw new InvalidOperationException(); + + // Itoh-Tsujii inversion + + ulong[] t0 = Nat256.Create64(); + ulong[] t1 = Nat256.Create64(); + + Square(x, t0); + Multiply(t0, x, t0); + Square(t0, t0); + Multiply(t0, x, t0); + SquareN(t0, 3, t1); + Multiply(t1, t0, t1); + Square(t1, t1); + Multiply(t1, x, t1); + SquareN(t1, 7, t0); + Multiply(t0, t1, t0); + SquareN(t0, 14, t1); + Multiply(t1, t0, t1); + Square(t1, t1); + Multiply(t1, x, t1); + SquareN(t1, 29, t0); + Multiply(t0, t1, t0); + SquareN(t0, 58, t1); + Multiply(t1, t0, t1); + SquareN(t1, 116, t0); + Multiply(t0, t1, t0); + Square(t0, z); + } + + public static void Multiply(ulong[] x, ulong[] y, ulong[] z) + { + ulong[] tt = Nat256.CreateExt64(); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] tt = Nat256.CreateExt64(); + ImplMultiply(x, y, tt); + AddExt(zz, tt, zz); + } + + public static void Reduce(ulong[] xx, ulong[] z) + { + ulong x0 = xx[0], x1 = xx[1], x2 = xx[2], x3 = xx[3]; + ulong x4 = xx[4], x5 = xx[5], x6 = xx[6], x7 = xx[7]; + + x3 ^= (x7 << 23); + x4 ^= (x7 >> 41) ^ (x7 << 33); + x5 ^= (x7 >> 31); + + x2 ^= (x6 << 23); + x3 ^= (x6 >> 41) ^ (x6 << 33); + x4 ^= (x6 >> 31); + + x1 ^= (x5 << 23); + x2 ^= (x5 >> 41) ^ (x5 << 33); + x3 ^= (x5 >> 31); + + x0 ^= (x4 << 23); + x1 ^= (x4 >> 41) ^ (x4 << 33); + x2 ^= (x4 >> 31); + + ulong t = x3 >> 41; + z[0] = x0 ^ t; + z[1] = x1 ^ (t << 10); + z[2] = x2; + z[3] = x3 & M41; + } + + public static void Reduce23(ulong[] z, int zOff) + { + ulong z3 = z[zOff + 3], t = z3 >> 41; + z[zOff ] ^= t; + z[zOff + 1] ^= (t << 10); + z[zOff + 3] = z3 & M41; + } + + public static void Sqrt(ulong[] x, ulong[] z) + { + ulong u0, u1; + u0 = Interleave.Unshuffle(x[0]); u1 = Interleave.Unshuffle(x[1]); + ulong e0 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + ulong c0 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[2]); u1 = Interleave.Unshuffle(x[3]); + ulong e1 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + ulong c1 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + ulong c2; + c2 = (c1 >> 27); + c1 ^= (c0 >> 27) | (c1 << 37); + c0 ^= (c0 << 37); + + ulong[] tt = Nat256.CreateExt64(); + + int[] shifts = { 32, 117, 191 }; + for (int i = 0; i < shifts.Length; ++i) + { + int w = shifts[i] >> 6, s = shifts[i] & 63; + Debug.Assert(s != 0); + tt[w ] ^= (c0 << s); + tt[w + 1] ^= (c1 << s) | (c0 >> -s); + tt[w + 2] ^= (c2 << s) | (c1 >> -s); + tt[w + 3] ^= (c2 >> -s); + } + + Reduce(tt, z); + + z[0] ^= e0; + z[1] ^= e1; + } + + public static void Square(ulong[] x, ulong[] z) + { + ulong[] tt = Nat256.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareAddToExt(ulong[] x, ulong[] zz) + { + ulong[] tt = Nat256.CreateExt64(); + ImplSquare(x, tt); + AddExt(zz, tt, zz); + } + + public static void SquareN(ulong[] x, int n, ulong[] z) + { + Debug.Assert(n > 0); + + ulong[] tt = Nat256.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static uint Trace(ulong[] x) + { + // Non-zero-trace bits: 0, 159 + return (uint)(x[0] ^ (x[2] >> 31)) & 1U; + } + + protected static void ImplCompactExt(ulong[] zz) + { + ulong z0 = zz[0], z1 = zz[1], z2 = zz[2], z3 = zz[3], z4 = zz[4], z5 = zz[5], z6 = zz[6], z7 = zz[7]; + zz[0] = z0 ^ (z1 << 59); + zz[1] = (z1 >> 5) ^ (z2 << 54); + zz[2] = (z2 >> 10) ^ (z3 << 49); + zz[3] = (z3 >> 15) ^ (z4 << 44); + zz[4] = (z4 >> 20) ^ (z5 << 39); + zz[5] = (z5 >> 25) ^ (z6 << 34); + zz[6] = (z6 >> 30) ^ (z7 << 29); + zz[7] = (z7 >> 35); + } + + protected static void ImplExpand(ulong[] x, ulong[] z) + { + ulong x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3]; + z[0] = x0 & M59; + z[1] = ((x0 >> 59) ^ (x1 << 5)) & M59; + z[2] = ((x1 >> 54) ^ (x2 << 10)) & M59; + z[3] = ((x2 >> 49) ^ (x3 << 15)); + } + + protected static void ImplMultiply(ulong[] x, ulong[] y, ulong[] zz) + { + /* + * "Two-level seven-way recursion" as described in "Batch binary Edwards", Daniel J. Bernstein. + */ + + ulong[] f = new ulong[4], g = new ulong[4]; + ImplExpand(x, f); + ImplExpand(y, g); + + ImplMulwAcc(f[0], g[0], zz, 0); + ImplMulwAcc(f[1], g[1], zz, 1); + ImplMulwAcc(f[2], g[2], zz, 2); + ImplMulwAcc(f[3], g[3], zz, 3); + + // U *= (1 - t^n) + for (int i = 5; i > 0; --i) + { + zz[i] ^= zz[i - 1]; + } + + ImplMulwAcc(f[0] ^ f[1], g[0] ^ g[1], zz, 1); + ImplMulwAcc(f[2] ^ f[3], g[2] ^ g[3], zz, 3); + + // V *= (1 - t^2n) + for (int i = 7; i > 1; --i) + { + zz[i] ^= zz[i - 2]; + } + + // Double-length recursion + { + ulong c0 = f[0] ^ f[2], c1 = f[1] ^ f[3]; + ulong d0 = g[0] ^ g[2], d1 = g[1] ^ g[3]; + ImplMulwAcc(c0 ^ c1, d0 ^ d1, zz, 3); + ulong[] t = new ulong[3]; + ImplMulwAcc(c0, d0, t, 0); + ImplMulwAcc(c1, d1, t, 1); + ulong t0 = t[0], t1 = t[1], t2 = t[2]; + zz[2] ^= t0; + zz[3] ^= t0 ^ t1; + zz[4] ^= t2 ^ t1; + zz[5] ^= t2; + } + + ImplCompactExt(zz); + } + + protected static void ImplMulwAcc(ulong x, ulong y, ulong[] z, int zOff) + { + Debug.Assert(x >> 59 == 0); + Debug.Assert(y >> 59 == 0); + + ulong[] u = new ulong[8]; + //u[0] = 0; + u[1] = y; + u[2] = u[1] << 1; + u[3] = u[2] ^ y; + u[4] = u[2] << 1; + u[5] = u[4] ^ y; + u[6] = u[3] << 1; + u[7] = u[6] ^ y; + + uint j = (uint)x; + ulong g, h = 0, l = u[j & 7] + ^ (u[(j >> 3) & 7] << 3); + int k = 54; + do + { + j = (uint)(x >> k); + g = u[j & 7] + ^ u[(j >> 3) & 7] << 3; + l ^= (g << k); + h ^= (g >> -k); + } + while ((k -= 6) > 0); + + Debug.Assert(h >> 53 == 0); + + z[zOff ] ^= l & M59; + z[zOff + 1] ^= (l >> 59) ^ (h << 5); + } + + protected static void ImplSquare(ulong[] x, ulong[] zz) + { + Interleave.Expand64To128(x[0], zz, 0); + Interleave.Expand64To128(x[1], zz, 2); + Interleave.Expand64To128(x[2], zz, 4); + + ulong x3 = x[3]; + zz[6] = Interleave.Expand32to64((uint)x3); + zz[7] = Interleave.Expand16to32((uint)(x3 >> 32)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233Field.cs.meta new file mode 100644 index 00000000..639f2351 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3383a8a7710727f4991e6f2ab078edfa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233FieldElement.cs new file mode 100644 index 00000000..a4c7babc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233FieldElement.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT233FieldElement + : AbstractF2mFieldElement + { + protected internal readonly ulong[] x; + + public SecT233FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > 233) + throw new ArgumentException("value invalid for SecT233FieldElement", "x"); + + this.x = SecT233Field.FromBigInteger(x); + } + + public SecT233FieldElement() + { + this.x = Nat256.Create64(); + } + + protected internal SecT233FieldElement(ulong[] x) + { + this.x = x; + } + + public override bool IsOne + { + get { return Nat256.IsOne64(x); } + } + + public override bool IsZero + { + get { return Nat256.IsZero64(x); } + } + + public override bool TestBitZero() + { + return (x[0] & 1UL) != 0UL; + } + + public override BigInteger ToBigInteger() + { + return Nat256.ToBigInteger64(x); + } + + public override string FieldName + { + get { return "SecT233Field"; } + } + + public override int FieldSize + { + get { return 233; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + ulong[] z = Nat256.Create64(); + SecT233Field.Add(x, ((SecT233FieldElement)b).x, z); + return new SecT233FieldElement(z); + } + + public override ECFieldElement AddOne() + { + ulong[] z = Nat256.Create64(); + SecT233Field.AddOne(x, z); + return new SecT233FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + // Addition and Subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + ulong[] z = Nat256.Create64(); + SecT233Field.Multiply(x, ((SecT233FieldElement)b).x, z); + return new SecT233FieldElement(z); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x, bx = ((SecT233FieldElement)b).x; + ulong[] xx = ((SecT233FieldElement)x).x, yx = ((SecT233FieldElement)y).x; + + ulong[] tt = Nat256.CreateExt64(); + SecT233Field.MultiplyAddToExt(ax, bx, tt); + SecT233Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat256.Create64(); + SecT233Field.Reduce(tt, z); + return new SecT233FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + return Multiply(b.Invert()); + } + + public override ECFieldElement Negate() + { + return this; + } + + public override ECFieldElement Square() + { + ulong[] z = Nat256.Create64(); + SecT233Field.Square(x, z); + return new SecT233FieldElement(z); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x; + ulong[] xx = ((SecT233FieldElement)x).x, yx = ((SecT233FieldElement)y).x; + + ulong[] tt = Nat256.CreateExt64(); + SecT233Field.SquareAddToExt(ax, tt); + SecT233Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat256.Create64(); + SecT233Field.Reduce(tt, z); + return new SecT233FieldElement(z); + } + + public override ECFieldElement SquarePow(int pow) + { + if (pow < 1) + return this; + + ulong[] z = Nat256.Create64(); + SecT233Field.SquareN(x, pow, z); + return new SecT233FieldElement(z); + } + + public override int Trace() + { + return (int)SecT233Field.Trace(x); + } + + public override ECFieldElement Invert() + { + ulong[] z = Nat256.Create64(); + SecT233Field.Invert(x, z); + return new SecT233FieldElement(z); + } + + public override ECFieldElement Sqrt() + { + ulong[] z = Nat256.Create64(); + SecT233Field.Sqrt(x, z); + return new SecT233FieldElement(z); + } + + public virtual int Representation + { + get { return F2mFieldElement.Tpb; } + } + + public virtual int M + { + get { return 233; } + } + + public virtual int K1 + { + get { return 74; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override bool Equals(object obj) + { + return Equals(obj as SecT233FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecT233FieldElement); + } + + public virtual bool Equals(SecT233FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat256.Eq64(x, other.x); + } + + public override int GetHashCode() + { + return 2330074 ^ Arrays.GetHashCode(x, 0, 4); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233FieldElement.cs.meta new file mode 100644 index 00000000..6b13cdcd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8eb22946dd4169543b83ef9f11743f5b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Curve.cs new file mode 100644 index 00000000..7a1ea9e3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Curve.cs @@ -0,0 +1,167 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT233K1Curve + : AbstractF2mCurve + { + private const int SECT233K1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT233K1_FE_LONGS = 4; + + protected readonly SecT233K1Point m_infinity; + + public SecT233K1Curve() + : base(233, 74, 0, 0) + { + this.m_infinity = new SecT233K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.Zero); + this.m_b = FromBigInteger(BigInteger.One); + this.m_order = new BigInteger(1, Hex.Decode("8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF")); + this.m_cofactor = BigInteger.ValueOf(4); + + this.m_coord = SECT233K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT233K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + protected override ECMultiplier CreateDefaultMultiplier() + { + return new WTauNafMultiplier(); + } + + public override int FieldSize + { + get { return 233; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT233FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT233K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT233K1Point(this, x, y, zs, withCompression); + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override bool IsKoblitz + { + get { return true; } + } + + public virtual int M + { + get { return 233; } + } + + public virtual bool IsTrinomial + { + get { return true; } + } + + public virtual int K1 + { + get { return 74; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT233K1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat256.Copy64(((SecT233FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT233K1_FE_LONGS; + Nat256.Copy64(((SecT233FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT233K1_FE_LONGS; + } + } + + return new SecT233K1LookupTable(this, table, len); + } + + private class SecT233K1LookupTable + : ECLookupTable + { + private readonly SecT233K1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT233K1LookupTable(SecT233K1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat256.Create64(), y = Nat256.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT233K1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT233K1_FE_LONGS + j] & MASK; + } + + pos += (SECT233K1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT233FieldElement(x), new SecT233FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Curve.cs.meta new file mode 100644 index 00000000..d16d652f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de272d7a6f28ae24f98d3e5a96c7a23e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Point.cs new file mode 100644 index 00000000..c5d9647b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Point.cs @@ -0,0 +1,299 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT233K1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT233K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT233K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT233K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT233K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + { + return curve.Infinity; + } + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1); + if (X3.IsZero) + { + return new SecT233K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT233K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT233K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + { + return this; + } + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T; + if (Z1IsOne) + { + T = L1.Square().Add(L1); + } + else + { + T = L1.Add(Z1).Multiply(L1); + } + + if (T.IsZero) + { + return new SecT233K1Point(curve, T, curve.B, IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement t1 = L1.Add(X1).Square(); + ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); + ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); + + return new SecT233K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + // NOTE: TwicePlus() only optimized for lambda-affine argument + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = L1Sq.Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = L2plus1.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + { + return b.Twice(); + } + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT233K1Point(curve, A, curve.B, IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT233K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT233K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Point.cs.meta new file mode 100644 index 00000000..b2c7aac0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d28b86257b8af904e8f2390a9b777469 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Curve.cs new file mode 100644 index 00000000..10fbfc06 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT233R1Curve + : AbstractF2mCurve + { + private const int SECT233R1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT233R1_FE_LONGS = 4; + + protected readonly SecT233R1Point m_infinity; + + public SecT233R1Curve() + : base(233, 74, 0, 0) + { + this.m_infinity = new SecT233R1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.One); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD"))); + this.m_order = new BigInteger(1, Hex.Decode("01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT233R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT233R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 233; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT233FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT233R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT233R1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 233; } + } + + public virtual bool IsTrinomial + { + get { return true; } + } + + public virtual int K1 + { + get { return 74; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT233R1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat256.Copy64(((SecT233FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT233R1_FE_LONGS; + Nat256.Copy64(((SecT233FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT233R1_FE_LONGS; + } + } + + return new SecT233R1LookupTable(this, table, len); + } + + private class SecT233R1LookupTable + : ECLookupTable + { + private readonly SecT233R1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT233R1LookupTable(SecT233R1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat256.Create64(), y = Nat256.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT233R1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT233R1_FE_LONGS + j] & MASK; + } + + pos += (SECT233R1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT233FieldElement(x), new SecT233FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Curve.cs.meta new file mode 100644 index 00000000..497957a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39fcb8d8fd481b744a4edf0d4452c93d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Point.cs new file mode 100644 index 00000000..d08a20da --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Point.cs @@ -0,0 +1,282 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT233R1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT233R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT233R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT233R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT233R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).AddOne(); + if (X3.IsZero) + { + return new SecT233R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT233R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); + if (T.IsZero) + { + return new SecT233R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = Z1Sq.Add(L1Sq).Add(L1Z1); + ECFieldElement A = L2.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT233R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); + + return new SecT233R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT233R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Point.cs.meta new file mode 100644 index 00000000..c6585be0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT233R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e8bf5c80ccef6464da43af257433fbb2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239Field.cs new file mode 100644 index 00000000..54a61ff3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239Field.cs @@ -0,0 +1,332 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT239Field + { + private const ulong M47 = ulong.MaxValue >> 17; + private const ulong M60 = ulong.MaxValue >> 4; + + public static void Add(ulong[] x, ulong[] y, ulong[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + z[2] = x[2] ^ y[2]; + z[3] = x[3] ^ y[3]; + } + + public static void AddExt(ulong[] xx, ulong[] yy, ulong[] zz) + { + zz[0] = xx[0] ^ yy[0]; + zz[1] = xx[1] ^ yy[1]; + zz[2] = xx[2] ^ yy[2]; + zz[3] = xx[3] ^ yy[3]; + zz[4] = xx[4] ^ yy[4]; + zz[5] = xx[5] ^ yy[5]; + zz[6] = xx[6] ^ yy[6]; + zz[7] = xx[7] ^ yy[7]; + } + + public static void AddOne(ulong[] x, ulong[] z) + { + z[0] = x[0] ^ 1UL; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + } + + public static ulong[] FromBigInteger(BigInteger x) + { + ulong[] z = Nat256.FromBigInteger64(x); + Reduce17(z, 0); + return z; + } + + public static void Invert(ulong[] x, ulong[] z) + { + if (Nat256.IsZero64(x)) + throw new InvalidOperationException(); + + // Itoh-Tsujii inversion + + ulong[] t0 = Nat256.Create64(); + ulong[] t1 = Nat256.Create64(); + + Square(x, t0); + Multiply(t0, x, t0); + Square(t0, t0); + Multiply(t0, x, t0); + SquareN(t0, 3, t1); + Multiply(t1, t0, t1); + Square(t1, t1); + Multiply(t1, x, t1); + SquareN(t1, 7, t0); + Multiply(t0, t1, t0); + SquareN(t0, 14, t1); + Multiply(t1, t0, t1); + Square(t1, t1); + Multiply(t1, x, t1); + SquareN(t1, 29, t0); + Multiply(t0, t1, t0); + Square(t0, t0); + Multiply(t0, x, t0); + SquareN(t0, 59, t1); + Multiply(t1, t0, t1); + Square(t1, t1); + Multiply(t1, x, t1); + SquareN(t1, 119, t0); + Multiply(t0, t1, t0); + Square(t0, z); + } + + public static void Multiply(ulong[] x, ulong[] y, ulong[] z) + { + ulong[] tt = Nat256.CreateExt64(); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] tt = Nat256.CreateExt64(); + ImplMultiply(x, y, tt); + AddExt(zz, tt, zz); + } + + public static void Reduce(ulong[] xx, ulong[] z) + { + ulong x0 = xx[0], x1 = xx[1], x2 = xx[2], x3 = xx[3]; + ulong x4 = xx[4], x5 = xx[5], x6 = xx[6], x7 = xx[7]; + + x3 ^= (x7 << 17); + x4 ^= (x7 >> 47); + x5 ^= (x7 << 47); + x6 ^= (x7 >> 17); + + x2 ^= (x6 << 17); + x3 ^= (x6 >> 47); + x4 ^= (x6 << 47); + x5 ^= (x6 >> 17); + + x1 ^= (x5 << 17); + x2 ^= (x5 >> 47); + x3 ^= (x5 << 47); + x4 ^= (x5 >> 17); + + x0 ^= (x4 << 17); + x1 ^= (x4 >> 47); + x2 ^= (x4 << 47); + x3 ^= (x4 >> 17); + + ulong t = x3 >> 47; + z[0] = x0 ^ t; + z[1] = x1; + z[2] = x2 ^ (t << 30); + z[3] = x3 & M47; + } + + public static void Reduce17(ulong[] z, int zOff) + { + ulong z3 = z[zOff + 3], t = z3 >> 47; + z[zOff ] ^= t; + z[zOff + 2] ^= (t << 30); + z[zOff + 3] = z3 & M47; + } + + public static void Sqrt(ulong[] x, ulong[] z) + { + ulong u0, u1; + u0 = Interleave.Unshuffle(x[0]); u1 = Interleave.Unshuffle(x[1]); + ulong e0 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + ulong c0 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[2]); u1 = Interleave.Unshuffle(x[3]); + ulong e1 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + ulong c1 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + ulong c2, c3; + c3 = (c1 >> 49); + c2 = (c0 >> 49) | (c1 << 15); + c1 ^= (c0 << 15); + + ulong[] tt = Nat256.CreateExt64(); + + int[] shifts = { 39, 120 }; + for (int i = 0; i < shifts.Length; ++i) + { + int w = shifts[i] >> 6, s = shifts[i] & 63; + Debug.Assert(s != 0); + tt[w ] ^= (c0 << s); + tt[w + 1] ^= (c1 << s) | (c0 >> -s); + tt[w + 2] ^= (c2 << s) | (c1 >> -s); + tt[w + 3] ^= (c3 << s) | (c2 >> -s); + tt[w + 4] ^= (c3 >> -s); + } + + Reduce(tt, z); + + z[0] ^= e0; + z[1] ^= e1; + } + + public static void Square(ulong[] x, ulong[] z) + { + ulong[] tt = Nat256.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareAddToExt(ulong[] x, ulong[] zz) + { + ulong[] tt = Nat256.CreateExt64(); + ImplSquare(x, tt); + AddExt(zz, tt, zz); + } + + public static void SquareN(ulong[] x, int n, ulong[] z) + { + Debug.Assert(n > 0); + + ulong[] tt = Nat256.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static uint Trace(ulong[] x) + { + // Non-zero-trace bits: 0, 81, 162 + return (uint)(x[0] ^ (x[1] >> 17) ^ (x[2] >> 34)) & 1U; + } + + protected static void ImplCompactExt(ulong[] zz) + { + ulong z0 = zz[0], z1 = zz[1], z2 = zz[2], z3 = zz[3], z4 = zz[4], z5 = zz[5], z6 = zz[6], z7 = zz[7]; + zz[0] = z0 ^ (z1 << 60); + zz[1] = (z1 >> 4) ^ (z2 << 56); + zz[2] = (z2 >> 8) ^ (z3 << 52); + zz[3] = (z3 >> 12) ^ (z4 << 48); + zz[4] = (z4 >> 16) ^ (z5 << 44); + zz[5] = (z5 >> 20) ^ (z6 << 40); + zz[6] = (z6 >> 24) ^ (z7 << 36); + zz[7] = (z7 >> 28); + } + + protected static void ImplExpand(ulong[] x, ulong[] z) + { + ulong x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3]; + z[0] = x0 & M60; + z[1] = ((x0 >> 60) ^ (x1 << 4)) & M60; + z[2] = ((x1 >> 56) ^ (x2 << 8)) & M60; + z[3] = ((x2 >> 52) ^ (x3 << 12)); + } + + protected static void ImplMultiply(ulong[] x, ulong[] y, ulong[] zz) + { + /* + * "Two-level seven-way recursion" as described in "Batch binary Edwards", Daniel J. Bernstein. + */ + + ulong[] f = new ulong[4], g = new ulong[4]; + ImplExpand(x, f); + ImplExpand(y, g); + + ImplMulwAcc(f[0], g[0], zz, 0); + ImplMulwAcc(f[1], g[1], zz, 1); + ImplMulwAcc(f[2], g[2], zz, 2); + ImplMulwAcc(f[3], g[3], zz, 3); + + // U *= (1 - t^n) + for (int i = 5; i > 0; --i) + { + zz[i] ^= zz[i - 1]; + } + + ImplMulwAcc(f[0] ^ f[1], g[0] ^ g[1], zz, 1); + ImplMulwAcc(f[2] ^ f[3], g[2] ^ g[3], zz, 3); + + // V *= (1 - t^2n) + for (int i = 7; i > 1; --i) + { + zz[i] ^= zz[i - 2]; + } + + // Double-length recursion + { + ulong c0 = f[0] ^ f[2], c1 = f[1] ^ f[3]; + ulong d0 = g[0] ^ g[2], d1 = g[1] ^ g[3]; + ImplMulwAcc(c0 ^ c1, d0 ^ d1, zz, 3); + ulong[] t = new ulong[3]; + ImplMulwAcc(c0, d0, t, 0); + ImplMulwAcc(c1, d1, t, 1); + ulong t0 = t[0], t1 = t[1], t2 = t[2]; + zz[2] ^= t0; + zz[3] ^= t0 ^ t1; + zz[4] ^= t2 ^ t1; + zz[5] ^= t2; + } + + ImplCompactExt(zz); + } + + protected static void ImplMulwAcc(ulong x, ulong y, ulong[] z, int zOff) + { + Debug.Assert(x >> 60 == 0); + Debug.Assert(y >> 60 == 0); + + ulong[] u = new ulong[8]; + //u[0] = 0; + u[1] = y; + u[2] = u[1] << 1; + u[3] = u[2] ^ y; + u[4] = u[2] << 1; + u[5] = u[4] ^ y; + u[6] = u[3] << 1; + u[7] = u[6] ^ y; + + uint j = (uint)x; + ulong g, h = 0, l = u[j & 7] + ^ (u[(j >> 3) & 7] << 3); + int k = 54; + do + { + j = (uint)(x >> k); + g = u[j & 7] + ^ u[(j >> 3) & 7] << 3; + l ^= (g << k); + h ^= (g >> -k); + } + while ((k -= 6) > 0); + + h ^= ((x & 0x0820820820820820L) & (ulong)(((long)y << 4) >> 63)) >> 5; + + Debug.Assert(h >> 55 == 0); + + z[zOff ] ^= l & M60; + z[zOff + 1] ^= (l >> 60) ^ (h << 4); + } + + protected static void ImplSquare(ulong[] x, ulong[] zz) + { + Interleave.Expand64To128(x[0], zz, 0); + Interleave.Expand64To128(x[1], zz, 2); + Interleave.Expand64To128(x[2], zz, 4); + + ulong x3 = x[3]; + zz[6] = Interleave.Expand32to64((uint)x3); + zz[7] = Interleave.Expand16to32((uint)(x3 >> 32)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239Field.cs.meta new file mode 100644 index 00000000..4938c515 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7ed9c9a4301e3b3459b6f2d4e1bb4c82 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239FieldElement.cs new file mode 100644 index 00000000..f688f206 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239FieldElement.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT239FieldElement + : AbstractF2mFieldElement + { + protected internal readonly ulong[] x; + + public SecT239FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > 239) + throw new ArgumentException("value invalid for SecT239FieldElement", "x"); + + this.x = SecT239Field.FromBigInteger(x); + } + + public SecT239FieldElement() + { + this.x = Nat256.Create64(); + } + + protected internal SecT239FieldElement(ulong[] x) + { + this.x = x; + } + + public override bool IsOne + { + get { return Nat256.IsOne64(x); } + } + + public override bool IsZero + { + get { return Nat256.IsZero64(x); } + } + + public override bool TestBitZero() + { + return (x[0] & 1L) != 0L; + } + + public override BigInteger ToBigInteger() + { + return Nat256.ToBigInteger64(x); + } + + public override string FieldName + { + get { return "SecT239Field"; } + } + + public override int FieldSize + { + get { return 239; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + ulong[] z = Nat256.Create64(); + SecT239Field.Add(x, ((SecT239FieldElement)b).x, z); + return new SecT239FieldElement(z); + } + + public override ECFieldElement AddOne() + { + ulong[] z = Nat256.Create64(); + SecT239Field.AddOne(x, z); + return new SecT239FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + // Addition and Subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + ulong[] z = Nat256.Create64(); + SecT239Field.Multiply(x, ((SecT239FieldElement)b).x, z); + return new SecT239FieldElement(z); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x, bx = ((SecT239FieldElement)b).x; + ulong[] xx = ((SecT239FieldElement)x).x, yx = ((SecT239FieldElement)y).x; + + ulong[] tt = Nat256.CreateExt64(); + SecT239Field.MultiplyAddToExt(ax, bx, tt); + SecT239Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat256.Create64(); + SecT239Field.Reduce(tt, z); + return new SecT239FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + return Multiply(b.Invert()); + } + + public override ECFieldElement Negate() + { + return this; + } + + public override ECFieldElement Square() + { + ulong[] z = Nat256.Create64(); + SecT239Field.Square(x, z); + return new SecT239FieldElement(z); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x; + ulong[] xx = ((SecT239FieldElement)x).x, yx = ((SecT239FieldElement)y).x; + + ulong[] tt = Nat256.CreateExt64(); + SecT239Field.SquareAddToExt(ax, tt); + SecT239Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat256.Create64(); + SecT239Field.Reduce(tt, z); + return new SecT239FieldElement(z); + } + + public override ECFieldElement SquarePow(int pow) + { + if (pow < 1) + return this; + + ulong[] z = Nat256.Create64(); + SecT239Field.SquareN(x, pow, z); + return new SecT239FieldElement(z); + } + + public override int Trace() + { + return (int)SecT239Field.Trace(x); + } + + public override ECFieldElement Invert() + { + ulong[] z = Nat256.Create64(); + SecT239Field.Invert(x, z); + return new SecT239FieldElement(z); + } + + public override ECFieldElement Sqrt() + { + ulong[] z = Nat256.Create64(); + SecT239Field.Sqrt(x, z); + return new SecT239FieldElement(z); + } + + public virtual int Representation + { + get { return F2mFieldElement.Tpb; } + } + + public virtual int M + { + get { return 239; } + } + + public virtual int K1 + { + get { return 158; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override bool Equals(object obj) + { + return Equals(obj as SecT239FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecT239FieldElement); + } + + public virtual bool Equals(SecT239FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat256.Eq64(x, other.x); + } + + public override int GetHashCode() + { + return 23900158 ^ Arrays.GetHashCode(x, 0, 4); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239FieldElement.cs.meta new file mode 100644 index 00000000..95c8bc30 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d3b2dc73110a51949be2327a20bbd675 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Curve.cs new file mode 100644 index 00000000..2b8f8918 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Curve.cs @@ -0,0 +1,167 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT239K1Curve + : AbstractF2mCurve + { + private const int SECT239K1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT239K1_FE_LONGS = 4; + + protected readonly SecT239K1Point m_infinity; + + public SecT239K1Curve() + : base(239, 158, 0, 0) + { + this.m_infinity = new SecT239K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.Zero); + this.m_b = FromBigInteger(BigInteger.One); + this.m_order = new BigInteger(1, Hex.Decode("2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5")); + this.m_cofactor = BigInteger.ValueOf(4); + + this.m_coord = SECT239K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT239K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + protected override ECMultiplier CreateDefaultMultiplier() + { + return new WTauNafMultiplier(); + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 239; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT239FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT239K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT239K1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return true; } + } + + public virtual int M + { + get { return 239; } + } + + public virtual bool IsTrinomial + { + get { return true; } + } + + public virtual int K1 + { + get { return 158; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT239K1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat256.Copy64(((SecT239FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT239K1_FE_LONGS; + Nat256.Copy64(((SecT239FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT239K1_FE_LONGS; + } + } + + return new SecT239K1LookupTable(this, table, len); + } + + private class SecT239K1LookupTable + : ECLookupTable + { + private readonly SecT239K1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT239K1LookupTable(SecT239K1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat256.Create64(), y = Nat256.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT239K1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT239K1_FE_LONGS + j] & MASK; + } + + pos += (SECT239K1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT239FieldElement(x), new SecT239FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Curve.cs.meta new file mode 100644 index 00000000..19680c87 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48ebb53c6d3e12e4b8383944559a18c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Point.cs new file mode 100644 index 00000000..f6499084 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Point.cs @@ -0,0 +1,294 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT239K1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT239K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT239K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT239K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT239K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1); + if (X3.IsZero) + { + return new SecT239K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT239K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT239K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T; + if (Z1IsOne) + { + T = L1.Square().Add(L1); + } + else + { + T = L1.Add(Z1).Multiply(L1); + } + + if (T.IsZero) + { + return new SecT239K1Point(curve, T, curve.B, IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement t1 = L1.Add(X1).Square(); + ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); + ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); + + return new SecT239K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + // NOTE: TwicePlus() only optimized for lambda-affine argument + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = L1Sq.Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = L2plus1.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT239K1Point(curve, A, curve.B, IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT239K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT239K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Point.cs.meta new file mode 100644 index 00000000..7d3f34a2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT239K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d824fd9c896dd549b3a2bded614ddb7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283Field.cs new file mode 100644 index 00000000..bac3fe93 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283Field.cs @@ -0,0 +1,406 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT283Field + { + private const ulong M27 = ulong.MaxValue >> 37; + private const ulong M57 = ulong.MaxValue >> 7; + + private static readonly ulong[] ROOT_Z = new ulong[]{ 0x0C30C30C30C30808UL, 0x30C30C30C30C30C3UL, 0x820820820820830CUL, 0x0820820820820820UL, 0x2082082UL }; + + public static void Add(ulong[] x, ulong[] y, ulong[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + z[2] = x[2] ^ y[2]; + z[3] = x[3] ^ y[3]; + z[4] = x[4] ^ y[4]; + } + + public static void AddExt(ulong[] xx, ulong[] yy, ulong[] zz) + { + zz[0] = xx[0] ^ yy[0]; + zz[1] = xx[1] ^ yy[1]; + zz[2] = xx[2] ^ yy[2]; + zz[3] = xx[3] ^ yy[3]; + zz[4] = xx[4] ^ yy[4]; + zz[5] = xx[5] ^ yy[5]; + zz[6] = xx[6] ^ yy[6]; + zz[7] = xx[7] ^ yy[7]; + zz[8] = xx[8] ^ yy[8]; + } + + public static void AddOne(ulong[] x, ulong[] z) + { + z[0] = x[0] ^ 1UL; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + } + + public static ulong[] FromBigInteger(BigInteger x) + { + ulong[] z = Nat320.FromBigInteger64(x); + Reduce37(z, 0); + return z; + } + + public static void Invert(ulong[] x, ulong[] z) + { + if (Nat320.IsZero64(x)) + throw new InvalidOperationException(); + + // Itoh-Tsujii inversion + + ulong[] t0 = Nat320.Create64(); + ulong[] t1 = Nat320.Create64(); + + Square(x, t0); + Multiply(t0, x, t0); + SquareN(t0, 2, t1); + Multiply(t1, t0, t1); + SquareN(t1, 4, t0); + Multiply(t0, t1, t0); + SquareN(t0, 8, t1); + Multiply(t1, t0, t1); + Square(t1, t1); + Multiply(t1, x, t1); + SquareN(t1, 17, t0); + Multiply(t0, t1, t0); + Square(t0, t0); + Multiply(t0, x, t0); + SquareN(t0, 35, t1); + Multiply(t1, t0, t1); + SquareN(t1, 70, t0); + Multiply(t0, t1, t0); + Square(t0, t0); + Multiply(t0, x, t0); + SquareN(t0, 141, t1); + Multiply(t1, t0, t1); + Square(t1, z); + } + + public static void Multiply(ulong[] x, ulong[] y, ulong[] z) + { + ulong[] tt = Nat320.CreateExt64(); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] tt = Nat320.CreateExt64(); + ImplMultiply(x, y, tt); + AddExt(zz, tt, zz); + } + + public static void Reduce(ulong[] xx, ulong[] z) + { + ulong x0 = xx[0], x1 = xx[1], x2 = xx[2], x3 = xx[3], x4 = xx[4]; + ulong x5 = xx[5], x6 = xx[6], x7 = xx[7], x8 = xx[8]; + + x3 ^= (x8 << 37) ^ (x8 << 42) ^ (x8 << 44) ^ (x8 << 49); + x4 ^= (x8 >> 27) ^ (x8 >> 22) ^ (x8 >> 20) ^ (x8 >> 15); + + x2 ^= (x7 << 37) ^ (x7 << 42) ^ (x7 << 44) ^ (x7 << 49); + x3 ^= (x7 >> 27) ^ (x7 >> 22) ^ (x7 >> 20) ^ (x7 >> 15); + + x1 ^= (x6 << 37) ^ (x6 << 42) ^ (x6 << 44) ^ (x6 << 49); + x2 ^= (x6 >> 27) ^ (x6 >> 22) ^ (x6 >> 20) ^ (x6 >> 15); + + x0 ^= (x5 << 37) ^ (x5 << 42) ^ (x5 << 44) ^ (x5 << 49); + x1 ^= (x5 >> 27) ^ (x5 >> 22) ^ (x5 >> 20) ^ (x5 >> 15); + + ulong t = x4 >> 27; + z[0] = x0 ^ t ^ (t << 5) ^ (t << 7) ^ (t << 12); + z[1] = x1; + z[2] = x2; + z[3] = x3; + z[4] = x4 & M27; + } + + public static void Reduce37(ulong[] z, int zOff) + { + ulong z4 = z[zOff + 4], t = z4 >> 27; + z[zOff ] ^= t ^ (t << 5) ^ (t << 7) ^ (t << 12); + z[zOff + 4] = z4 & M27; + } + + public static void Sqrt(ulong[] x, ulong[] z) + { + ulong[] odd = Nat320.Create64(); + + ulong u0, u1; + u0 = Interleave.Unshuffle(x[0]); u1 = Interleave.Unshuffle(x[1]); + ulong e0 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + odd[0] = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[2]); u1 = Interleave.Unshuffle(x[3]); + ulong e1 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + odd[1] = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[4]); + ulong e2 = (u0 & 0x00000000FFFFFFFFUL); + odd[2] = (u0 >> 32); + + Multiply(odd, ROOT_Z, z); + + z[0] ^= e0; + z[1] ^= e1; + z[2] ^= e2; + } + + public static void Square(ulong[] x, ulong[] z) + { + ulong[] tt = Nat.Create64(9); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareAddToExt(ulong[] x, ulong[] zz) + { + ulong[] tt = Nat.Create64(9); + ImplSquare(x, tt); + AddExt(zz, tt, zz); + } + + public static void SquareN(ulong[] x, int n, ulong[] z) + { + Debug.Assert(n > 0); + + ulong[] tt = Nat.Create64(9); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static uint Trace(ulong[] x) + { + // Non-zero-trace bits: 0, 271 + return (uint)(x[0] ^ (x[4] >> 15)) & 1U; + } + + protected static void ImplCompactExt(ulong[] zz) + { + ulong z0 = zz[0], z1 = zz[1], z2 = zz[2], z3 = zz[3], z4 = zz[4]; + ulong z5 = zz[5], z6 = zz[6], z7 = zz[7], z8 = zz[8], z9 = zz[9]; + zz[0] = z0 ^ (z1 << 57); + zz[1] = (z1 >> 7) ^ (z2 << 50); + zz[2] = (z2 >> 14) ^ (z3 << 43); + zz[3] = (z3 >> 21) ^ (z4 << 36); + zz[4] = (z4 >> 28) ^ (z5 << 29); + zz[5] = (z5 >> 35) ^ (z6 << 22); + zz[6] = (z6 >> 42) ^ (z7 << 15); + zz[7] = (z7 >> 49) ^ (z8 << 8); + zz[8] = (z8 >> 56) ^ (z9 << 1); + zz[9] = (z9 >> 63); // Zero! + } + + protected static void ImplExpand(ulong[] x, ulong[] z) + { + ulong x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3], x4 = x[4]; + z[0] = x0 & M57; + z[1] = ((x0 >> 57) ^ (x1 << 7)) & M57; + z[2] = ((x1 >> 50) ^ (x2 << 14)) & M57; + z[3] = ((x2 >> 43) ^ (x3 << 21)) & M57; + z[4] = ((x3 >> 36) ^ (x4 << 28)); + } + + //protected static void AddMs(ulong[] zz, int zOff, ulong[] p, params int[] ms) + //{ + // ulong t0 = 0, t1 = 0; + // foreach (int m in ms) + // { + // int i = (m - 1) << 1; + // t0 ^= p[i ]; + // t1 ^= p[i + 1]; + // } + // zz[zOff ] ^= t0; + // zz[zOff + 1] ^= t1; + //} + + protected static void ImplMultiply(ulong[] x, ulong[] y, ulong[] zz) + { + /* + * Formula (17) from "Some New Results on Binary Polynomial Multiplication", + * Murat Cenk and M. Anwar Hasan. + * + * The formula as given contained an error in the term t25, as noted below + */ + ulong[] a = new ulong[5], b = new ulong[5]; + ImplExpand(x, a); + ImplExpand(y, b); + + ulong[] p = new ulong[26]; + + ImplMulw(a[0], b[0], p, 0); // m1 + ImplMulw(a[1], b[1], p, 2); // m2 + ImplMulw(a[2], b[2], p, 4); // m3 + ImplMulw(a[3], b[3], p, 6); // m4 + ImplMulw(a[4], b[4], p, 8); // m5 + + ulong u0 = a[0] ^ a[1], v0 = b[0] ^ b[1]; + ulong u1 = a[0] ^ a[2], v1 = b[0] ^ b[2]; + ulong u2 = a[2] ^ a[4], v2 = b[2] ^ b[4]; + ulong u3 = a[3] ^ a[4], v3 = b[3] ^ b[4]; + + ImplMulw(u1 ^ a[3], v1 ^ b[3], p, 18); // m10 + ImplMulw(u2 ^ a[1], v2 ^ b[1], p, 20); // m11 + + ulong A4 = u0 ^ u3 , B4 = v0 ^ v3; + ulong A5 = A4 ^ a[2], B5 = B4 ^ b[2]; + + ImplMulw(A4, B4, p, 22); // m12 + ImplMulw(A5, B5, p, 24); // m13 + + ImplMulw(u0, v0, p, 10); // m6 + ImplMulw(u1, v1, p, 12); // m7 + ImplMulw(u2, v2, p, 14); // m8 + ImplMulw(u3, v3, p, 16); // m9 + + + // Original method, corresponding to formula (16) + //AddMs(zz, 0, p, 1); + //AddMs(zz, 1, p, 1, 2, 6); + //AddMs(zz, 2, p, 1, 2, 3, 7); + //AddMs(zz, 3, p, 1, 3, 4, 5, 8, 10, 12, 13); + //AddMs(zz, 4, p, 1, 2, 4, 5, 6, 9, 10, 11, 13); + //AddMs(zz, 5, p, 1, 2, 3, 5, 7, 11, 12, 13); + //AddMs(zz, 6, p, 3, 4, 5, 8); + //AddMs(zz, 7, p, 4, 5, 9); + //AddMs(zz, 8, p, 5); + + // Improved method factors out common single-word terms + // NOTE: p1,...,p26 in the paper maps to p[0],...,p[25] here + + zz[0] = p[ 0]; + zz[9] = p[ 9]; + + ulong t1 = p[ 0] ^ p[ 1]; + ulong t2 = t1 ^ p[ 2]; + ulong t3 = t2 ^ p[10]; + + zz[1] = t3; + + ulong t4 = p[ 3] ^ p[ 4]; + ulong t5 = p[11] ^ p[12]; + ulong t6 = t4 ^ t5; + ulong t7 = t2 ^ t6; + + zz[2] = t7; + + ulong t8 = t1 ^ t4; + ulong t9 = p[ 5] ^ p[ 6]; + ulong t10 = t8 ^ t9; + ulong t11 = t10 ^ p[ 8]; + ulong t12 = p[13] ^ p[14]; + ulong t13 = t11 ^ t12; + ulong t14 = p[18] ^ p[22]; + ulong t15 = t14 ^ p[24]; + ulong t16 = t13 ^ t15; + + zz[3] = t16; + + ulong t17 = p[ 7] ^ p[ 8]; + ulong t18 = t17 ^ p[ 9]; + ulong t19 = t18 ^ p[17]; + + zz[8] = t19; + + ulong t20 = t18 ^ t9; + ulong t21 = p[15] ^ p[16]; + ulong t22 = t20 ^ t21; + + zz[7] = t22; + + ulong t23 = t22 ^ t3; + ulong t24 = p[19] ^ p[20]; + // ulong t25 = p[23] ^ p[24]; + ulong t25 = p[25] ^ p[24]; // Fixes an error in the paper: p[23] -> p{25] + ulong t26 = p[18] ^ p[23]; + ulong t27 = t24 ^ t25; + ulong t28 = t27 ^ t26; + ulong t29 = t28 ^ t23; + + zz[4] = t29; + + ulong t30 = t7 ^ t19; + ulong t31 = t27 ^ t30; + ulong t32 = p[21] ^ p[22]; + ulong t33 = t31 ^ t32; + + zz[5] = t33; + + ulong t34 = t11 ^ p[0]; + ulong t35 = t34 ^ p[9]; + ulong t36 = t35 ^ t12; + ulong t37 = t36 ^ p[21]; + ulong t38 = t37 ^ p[23]; + ulong t39 = t38 ^ p[25]; + + zz[6] = t39; + + ImplCompactExt(zz); + } + + protected static void ImplMulw(ulong x, ulong y, ulong[] z, int zOff) + { + Debug.Assert(x >> 57 == 0); + Debug.Assert(y >> 57 == 0); + + ulong[] u = new ulong[8]; + //u[0] = 0; + u[1] = y; + u[2] = u[1] << 1; + u[3] = u[2] ^ y; + u[4] = u[2] << 1; + u[5] = u[4] ^ y; + u[6] = u[3] << 1; + u[7] = u[6] ^ y; + + uint j = (uint)x; + ulong g, h = 0, l = u[j & 7]; + int k = 48; + do + { + j = (uint)(x >> k); + g = u[j & 7] + ^ u[(j >> 3) & 7] << 3 + ^ u[(j >> 6) & 7] << 6; + l ^= (g << k); + h ^= (g >> -k); + } + while ((k -= 9) > 0); + + h ^= ((x & 0x0100804020100800L) & (ulong)(((long)y << 7) >> 63)) >> 8; + + Debug.Assert(h >> 49 == 0); + + z[zOff ] = l & M57; + z[zOff + 1] = (l >> 57) ^ (h << 7); + } + + protected static void ImplSquare(ulong[] x, ulong[] zz) + { + for (int i = 0; i < 4; ++i) + { + Interleave.Expand64To128(x[i], zz, i << 1); + } + zz[8] = Interleave.Expand32to64((uint)x[4]); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283Field.cs.meta new file mode 100644 index 00000000..5daeb4fe --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c626a931419b48a45ad8a5ea5f11d47e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283FieldElement.cs new file mode 100644 index 00000000..5cca6b2f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283FieldElement.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT283FieldElement + : AbstractF2mFieldElement + { + protected internal readonly ulong[] x; + + public SecT283FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > 283) + throw new ArgumentException("value invalid for SecT283FieldElement", "x"); + + this.x = SecT283Field.FromBigInteger(x); + } + + public SecT283FieldElement() + { + this.x = Nat320.Create64(); + } + + protected internal SecT283FieldElement(ulong[] x) + { + this.x = x; + } + + public override bool IsOne + { + get { return Nat320.IsOne64(x); } + } + + public override bool IsZero + { + get { return Nat320.IsZero64(x); } + } + + public override bool TestBitZero() + { + return (x[0] & 1UL) != 0UL; + } + + public override BigInteger ToBigInteger() + { + return Nat320.ToBigInteger64(x); + } + + public override string FieldName + { + get { return "SecT283Field"; } + } + + public override int FieldSize + { + get { return 283; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + ulong[] z = Nat320.Create64(); + SecT283Field.Add(x, ((SecT283FieldElement)b).x, z); + return new SecT283FieldElement(z); + } + + public override ECFieldElement AddOne() + { + ulong[] z = Nat320.Create64(); + SecT283Field.AddOne(x, z); + return new SecT283FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + // Addition and subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + ulong[] z = Nat320.Create64(); + SecT283Field.Multiply(x, ((SecT283FieldElement)b).x, z); + return new SecT283FieldElement(z); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x, bx = ((SecT283FieldElement)b).x; + ulong[] xx = ((SecT283FieldElement)x).x, yx = ((SecT283FieldElement)y).x; + + ulong[] tt = Nat.Create64(9); + SecT283Field.MultiplyAddToExt(ax, bx, tt); + SecT283Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat320.Create64(); + SecT283Field.Reduce(tt, z); + return new SecT283FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + return Multiply(b.Invert()); + } + + public override ECFieldElement Negate() + { + return this; + } + + public override ECFieldElement Square() + { + ulong[] z = Nat320.Create64(); + SecT283Field.Square(x, z); + return new SecT283FieldElement(z); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x; + ulong[] xx = ((SecT283FieldElement)x).x, yx = ((SecT283FieldElement)y).x; + + ulong[] tt = Nat.Create64(9); + SecT283Field.SquareAddToExt(ax, tt); + SecT283Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat320.Create64(); + SecT283Field.Reduce(tt, z); + return new SecT283FieldElement(z); + } + + public override ECFieldElement SquarePow(int pow) + { + if (pow < 1) + return this; + + ulong[] z = Nat320.Create64(); + SecT283Field.SquareN(x, pow, z); + return new SecT283FieldElement(z); + } + + public override int Trace() + { + return (int)SecT283Field.Trace(x); + } + + public override ECFieldElement Invert() + { + ulong[] z = Nat320.Create64(); + SecT283Field.Invert(x, z); + return new SecT283FieldElement(z); + } + + public override ECFieldElement Sqrt() + { + ulong[] z = Nat320.Create64(); + SecT283Field.Sqrt(x, z); + return new SecT283FieldElement(z); + } + + public virtual int Representation + { + get { return F2mFieldElement.Ppb; } + } + + public virtual int M + { + get { return 283; } + } + + public virtual int K1 + { + get { return 5; } + } + + public virtual int K2 + { + get { return 7; } + } + + public virtual int K3 + { + get { return 12; } + } + + public override bool Equals(object obj) + { + return Equals(obj as SecT283FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecT283FieldElement); + } + + public virtual bool Equals(SecT283FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat320.Eq64(x, other.x); + } + + public override int GetHashCode() + { + return 2831275 ^ Arrays.GetHashCode(x, 0, 5); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283FieldElement.cs.meta new file mode 100644 index 00000000..d4782a41 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67822c9ac801be245a30abda22a44f29 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Curve.cs new file mode 100644 index 00000000..41b39f8e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Curve.cs @@ -0,0 +1,167 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT283K1Curve + : AbstractF2mCurve + { + private const int SECT283K1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT283K1_FE_LONGS = 5; + + protected readonly SecT283K1Point m_infinity; + + public SecT283K1Curve() + : base(283, 5, 7, 12) + { + this.m_infinity = new SecT283K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.Zero); + this.m_b = FromBigInteger(BigInteger.One); + this.m_order = new BigInteger(1, Hex.Decode("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61")); + this.m_cofactor = BigInteger.ValueOf(4); + + this.m_coord = SECT283K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT283K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + protected override ECMultiplier CreateDefaultMultiplier() + { + return new WTauNafMultiplier(); + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 283; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT283FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT283K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT283K1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return true; } + } + + public virtual int M + { + get { return 283; } + } + + public virtual bool IsTrinomial + { + get { return false; } + } + + public virtual int K1 + { + get { return 5; } + } + + public virtual int K2 + { + get { return 7; } + } + + public virtual int K3 + { + get { return 12; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT283K1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat320.Copy64(((SecT283FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT283K1_FE_LONGS; + Nat320.Copy64(((SecT283FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT283K1_FE_LONGS; + } + } + + return new SecT283K1LookupTable(this, table, len); + } + + private class SecT283K1LookupTable + : ECLookupTable + { + private readonly SecT283K1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT283K1LookupTable(SecT283K1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat320.Create64(), y = Nat320.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT283K1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT283K1_FE_LONGS + j] & MASK; + } + + pos += (SECT283K1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT283FieldElement(x), new SecT283FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Curve.cs.meta new file mode 100644 index 00000000..243dcbd1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39307d0f60b169f4a81f23cd2faa883a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Point.cs new file mode 100644 index 00000000..3968a31c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Point.cs @@ -0,0 +1,293 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT283K1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT283K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT283K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT283K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT283K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1); + if (X3.IsZero) + { + return new SecT283K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT283K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T; + if (Z1IsOne) + { + T = L1.Square().Add(L1); + } + else + { + T = L1.Add(Z1).Multiply(L1); + } + + if (T.IsZero) + { + return new SecT283K1Point(curve, T, curve.B, IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement t1 = L1.Add(X1).Square(); + ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); + ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); + + return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + // NOTE: TwicePlus() only optimized for lambda-affine argument + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = L1Sq.Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = L2plus1.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT283K1Point(curve, A, curve.B, IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT283K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT283K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Point.cs.meta new file mode 100644 index 00000000..7a091d02 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 158b153a676c1544985041b1aafbb620 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Curve.cs new file mode 100644 index 00000000..a70fbf64 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT283R1Curve + : AbstractF2mCurve + { + private const int SECT283R1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT283R1_FE_LONGS = 5; + + protected readonly SecT283R1Point m_infinity; + + public SecT283R1Curve() + : base(283, 5, 7, 12) + { + this.m_infinity = new SecT283R1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.One); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5"))); + this.m_order = new BigInteger(1, Hex.Decode("03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT283R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT283R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 283; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT283FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT283R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT283R1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 283; } + } + + public virtual bool IsTrinomial + { + get { return false; } + } + + public virtual int K1 + { + get { return 5; } + } + + public virtual int K2 + { + get { return 7; } + } + + public virtual int K3 + { + get { return 12; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT283R1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat320.Copy64(((SecT283FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT283R1_FE_LONGS; + Nat320.Copy64(((SecT283FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT283R1_FE_LONGS; + } + } + + return new SecT283R1LookupTable(this, table, len); + } + + private class SecT283R1LookupTable + : ECLookupTable + { + private readonly SecT283R1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT283R1LookupTable(SecT283R1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat320.Create64(), y = Nat320.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT283R1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT283R1_FE_LONGS + j] & MASK; + } + + pos += (SECT283R1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT283FieldElement(x), new SecT283FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Curve.cs.meta new file mode 100644 index 00000000..cce813dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c3e40474bbba5c647866e91e6a75ba77 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Point.cs new file mode 100644 index 00000000..25198178 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Point.cs @@ -0,0 +1,282 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT283R1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT283R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT283R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT283R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT283R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).AddOne(); + if (X3.IsZero) + { + return new SecT283R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT283R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT283R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); + if (T.IsZero) + { + return new SecT283R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT283R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = Z1Sq.Add(L1Sq).Add(L1Z1); + ECFieldElement A = L2.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT283R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); + + return new SecT283R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT283R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Point.cs.meta new file mode 100644 index 00000000..9518705b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT283R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0c42d0860fab3384cb023920e765d0a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409Field.cs new file mode 100644 index 00000000..573e9e04 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409Field.cs @@ -0,0 +1,335 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT409Field + { + private const ulong M25 = ulong.MaxValue >> 39; + private const ulong M59 = ulong.MaxValue >> 5; + + public static void Add(ulong[] x, ulong[] y, ulong[] z) + { + z[0] = x[0] ^ y[0]; + z[1] = x[1] ^ y[1]; + z[2] = x[2] ^ y[2]; + z[3] = x[3] ^ y[3]; + z[4] = x[4] ^ y[4]; + z[5] = x[5] ^ y[5]; + z[6] = x[6] ^ y[6]; + } + + public static void AddExt(ulong[] xx, ulong[] yy, ulong[] zz) + { + for (int i = 0; i < 13; ++i) + { + zz[i] = xx[i] ^ yy[i]; + } + } + + public static void AddOne(ulong[] x, ulong[] z) + { + z[0] = x[0] ^ 1UL; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + z[5] = x[5]; + z[6] = x[6]; + } + + public static ulong[] FromBigInteger(BigInteger x) + { + ulong[] z = Nat448.FromBigInteger64(x); + Reduce39(z, 0); + return z; + } + + public static void Invert(ulong[] x, ulong[] z) + { + if (Nat448.IsZero64(x)) + throw new InvalidOperationException(); + + // Itoh-Tsujii inversion with bases { 2, 3 } + + ulong[] t0 = Nat448.Create64(); + ulong[] t1 = Nat448.Create64(); + ulong[] t2 = Nat448.Create64(); + + Square(x, t0); + + // 3 | 408 + SquareN(t0, 1, t1); + Multiply(t0, t1, t0); + SquareN(t1, 1, t1); + Multiply(t0, t1, t0); + + // 2 | 136 + SquareN(t0, 3, t1); + Multiply(t0, t1, t0); + + // 2 | 68 + SquareN(t0, 6, t1); + Multiply(t0, t1, t0); + + // 2 | 34 + SquareN(t0, 12, t1); + Multiply(t0, t1, t2); + + // ! {2,3} | 17 + SquareN(t2, 24, t0); + SquareN(t0, 24, t1); + Multiply(t0, t1, t0); + + // 2 | 8 + SquareN(t0, 48, t1); + Multiply(t0, t1, t0); + + // 2 | 4 + SquareN(t0, 96, t1); + Multiply(t0, t1, t0); + + // 2 | 2 + SquareN(t0, 192, t1); + Multiply(t0, t1, t0); + + Multiply(t0, t2, z); + } + + public static void Multiply(ulong[] x, ulong[] y, ulong[] z) + { + ulong[] tt = Nat448.CreateExt64(); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] tt = Nat448.CreateExt64(); + ImplMultiply(x, y, tt); + AddExt(zz, tt, zz); + } + + public static void Reduce(ulong[] xx, ulong[] z) + { + ulong x00 = xx[0], x01 = xx[1], x02 = xx[2], x03 = xx[3]; + ulong x04 = xx[4], x05 = xx[5], x06 = xx[6], x07 = xx[7]; + + ulong u = xx[12]; + x05 ^= (u << 39); + x06 ^= (u >> 25) ^ (u << 62); + x07 ^= (u >> 2); + + u = xx[11]; + x04 ^= (u << 39); + x05 ^= (u >> 25) ^ (u << 62); + x06 ^= (u >> 2); + + u = xx[10]; + x03 ^= (u << 39); + x04 ^= (u >> 25) ^ (u << 62); + x05 ^= (u >> 2); + + u = xx[9]; + x02 ^= (u << 39); + x03 ^= (u >> 25) ^ (u << 62); + x04 ^= (u >> 2); + + u = xx[8]; + x01 ^= (u << 39); + x02 ^= (u >> 25) ^ (u << 62); + x03 ^= (u >> 2); + + u = x07; + x00 ^= (u << 39); + x01 ^= (u >> 25) ^ (u << 62); + x02 ^= (u >> 2); + + ulong t = x06 >> 25; + z[0] = x00 ^ t; + z[1] = x01 ^ (t << 23); + z[2] = x02; + z[3] = x03; + z[4] = x04; + z[5] = x05; + z[6] = x06 & M25; + } + + public static void Reduce39(ulong[] z, int zOff) + { + ulong z6 = z[zOff + 6], t = z6 >> 25; + z[zOff ] ^= t; + z[zOff + 1] ^= (t << 23); + z[zOff + 6] = z6 & M25; + } + + public static void Sqrt(ulong[] x, ulong[] z) + { + ulong u0, u1; + u0 = Interleave.Unshuffle(x[0]); u1 = Interleave.Unshuffle(x[1]); + ulong e0 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + ulong c0 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[2]); u1 = Interleave.Unshuffle(x[3]); + ulong e1 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + ulong c1 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[4]); u1 = Interleave.Unshuffle(x[5]); + ulong e2 = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + ulong c2 = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + + u0 = Interleave.Unshuffle(x[6]); + ulong e3 = (u0 & 0x00000000FFFFFFFFUL); + ulong c3 = (u0 >> 32); + + z[0] = e0 ^ (c0 << 44); + z[1] = e1 ^ (c1 << 44) ^ (c0 >> 20); + z[2] = e2 ^ (c2 << 44) ^ (c1 >> 20); + z[3] = e3 ^ (c3 << 44) ^ (c2 >> 20) ^ (c0 << 13); + z[4] = (c3 >> 20) ^ (c1 << 13) ^ (c0 >> 51); + z[5] = (c2 << 13) ^ (c1 >> 51); + z[6] = (c3 << 13) ^ (c2 >> 51); + + Debug.Assert((c3 >> 51) == 0); + } + + public static void Square(ulong[] x, ulong[] z) + { + ulong[] tt = Nat.Create64(13); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareAddToExt(ulong[] x, ulong[] zz) + { + ulong[] tt = Nat.Create64(13); + ImplSquare(x, tt); + AddExt(zz, tt, zz); + } + + public static void SquareN(ulong[] x, int n, ulong[] z) + { + Debug.Assert(n > 0); + + ulong[] tt = Nat.Create64(13); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static uint Trace(ulong[] x) + { + // Non-zero-trace bits: 0 + return (uint)(x[0]) & 1U; + } + + protected static void ImplCompactExt(ulong[] zz) + { + ulong z00 = zz[ 0], z01 = zz[ 1], z02 = zz[ 2], z03 = zz[ 3], z04 = zz[ 4], z05 = zz[ 5], z06 = zz[ 6]; + ulong z07 = zz[ 7], z08 = zz[ 8], z09 = zz[ 9], z10 = zz[10], z11 = zz[11], z12 = zz[12], z13 = zz[13]; + zz[ 0] = z00 ^ (z01 << 59); + zz[ 1] = (z01 >> 5) ^ (z02 << 54); + zz[ 2] = (z02 >> 10) ^ (z03 << 49); + zz[ 3] = (z03 >> 15) ^ (z04 << 44); + zz[ 4] = (z04 >> 20) ^ (z05 << 39); + zz[ 5] = (z05 >> 25) ^ (z06 << 34); + zz[ 6] = (z06 >> 30) ^ (z07 << 29); + zz[ 7] = (z07 >> 35) ^ (z08 << 24); + zz[ 8] = (z08 >> 40) ^ (z09 << 19); + zz[ 9] = (z09 >> 45) ^ (z10 << 14); + zz[10] = (z10 >> 50) ^ (z11 << 9); + zz[11] = (z11 >> 55) ^ (z12 << 4) + ^ (z13 << 63); + zz[12] = (z12 >> 60) + ^ (z13 >> 1); + zz[13] = 0; + } + + protected static void ImplExpand(ulong[] x, ulong[] z) + { + ulong x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3], x4 = x[4], x5 = x[5], x6 = x[6]; + z[0] = x0 & M59; + z[1] = ((x0 >> 59) ^ (x1 << 5)) & M59; + z[2] = ((x1 >> 54) ^ (x2 << 10)) & M59; + z[3] = ((x2 >> 49) ^ (x3 << 15)) & M59; + z[4] = ((x3 >> 44) ^ (x4 << 20)) & M59; + z[5] = ((x4 >> 39) ^ (x5 << 25)) & M59; + z[6] = ((x5 >> 34) ^ (x6 << 30)); + } + + protected static void ImplMultiply(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] a = new ulong[7], b = new ulong[7]; + ImplExpand(x, a); + ImplExpand(y, b); + + for (int i = 0; i < 7; ++i) + { + ImplMulwAcc(a, b[i], zz, i); + } + + ImplCompactExt(zz); + } + + protected static void ImplMulwAcc(ulong[] xs, ulong y, ulong[] z, int zOff) + { + Debug.Assert(y >> 59 == 0); + + ulong[] u = new ulong[8]; + //u[0] = 0; + u[1] = y; + u[2] = u[1] << 1; + u[3] = u[2] ^ y; + u[4] = u[2] << 1; + u[5] = u[4] ^ y; + u[6] = u[3] << 1; + u[7] = u[6] ^ y; + + for (int i = 0; i < 7; ++i) + { + ulong x = xs[i]; + + Debug.Assert(x >> 59 == 0); + + uint j = (uint)x; + ulong g, h = 0, l = u[j & 7] + ^ (u[(j >> 3) & 7] << 3); + int k = 54; + do + { + j = (uint)(x >> k); + g = u[j & 7] + ^ u[(j >> 3) & 7] << 3; + l ^= (g << k); + h ^= (g >> -k); + } + while ((k -= 6) > 0); + + Debug.Assert(h >> 53 == 0); + + z[zOff + i ] ^= l & M59; + z[zOff + i + 1] ^= (l >> 59) ^ (h << 5); + } + } + + protected static void ImplSquare(ulong[] x, ulong[] zz) + { + for (int i = 0; i < 6; ++i) + { + Interleave.Expand64To128(x[i], zz, i << 1); + } + zz[12] = Interleave.Expand32to64((uint)x[6]); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409Field.cs.meta new file mode 100644 index 00000000..8b579412 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9678e96cfd9602a4287cdda4c732d8f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409FieldElement.cs new file mode 100644 index 00000000..11a45fd1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409FieldElement.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT409FieldElement + : AbstractF2mFieldElement + { + protected internal readonly ulong[] x; + + public SecT409FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > 409) + throw new ArgumentException("value invalid for SecT409FieldElement", "x"); + + this.x = SecT409Field.FromBigInteger(x); + } + + public SecT409FieldElement() + { + this.x = Nat448.Create64(); + } + + protected internal SecT409FieldElement(ulong[] x) + { + this.x = x; + } + + public override bool IsOne + { + get { return Nat448.IsOne64(x); } + } + + public override bool IsZero + { + get { return Nat448.IsZero64(x); } + } + + public override bool TestBitZero() + { + return (x[0] & 1UL) != 0UL; + } + + public override BigInteger ToBigInteger() + { + return Nat448.ToBigInteger64(x); + } + + public override string FieldName + { + get { return "SecT409Field"; } + } + + public override int FieldSize + { + get { return 409; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + ulong[] z = Nat448.Create64(); + SecT409Field.Add(x, ((SecT409FieldElement)b).x, z); + return new SecT409FieldElement(z); + } + + public override ECFieldElement AddOne() + { + ulong[] z = Nat448.Create64(); + SecT409Field.AddOne(x, z); + return new SecT409FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + // Addition and subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + ulong[] z = Nat448.Create64(); + SecT409Field.Multiply(x, ((SecT409FieldElement)b).x, z); + return new SecT409FieldElement(z); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x, bx = ((SecT409FieldElement)b).x; + ulong[] xx = ((SecT409FieldElement)x).x, yx = ((SecT409FieldElement)y).x; + + ulong[] tt = Nat.Create64(13); + SecT409Field.MultiplyAddToExt(ax, bx, tt); + SecT409Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat448.Create64(); + SecT409Field.Reduce(tt, z); + return new SecT409FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + return Multiply(b.Invert()); + } + + public override ECFieldElement Negate() + { + return this; + } + + public override ECFieldElement Square() + { + ulong[] z = Nat448.Create64(); + SecT409Field.Square(x, z); + return new SecT409FieldElement(z); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x; + ulong[] xx = ((SecT409FieldElement)x).x, yx = ((SecT409FieldElement)y).x; + + ulong[] tt = Nat.Create64(13); + SecT409Field.SquareAddToExt(ax, tt); + SecT409Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat448.Create64(); + SecT409Field.Reduce(tt, z); + return new SecT409FieldElement(z); + } + + public override ECFieldElement SquarePow(int pow) + { + if (pow < 1) + return this; + + ulong[] z = Nat448.Create64(); + SecT409Field.SquareN(x, pow, z); + return new SecT409FieldElement(z); + } + + public override int Trace() + { + return (int)SecT409Field.Trace(x); + } + + public override ECFieldElement Invert() + { + ulong[] z = Nat448.Create64(); + SecT409Field.Invert(x, z); + return new SecT409FieldElement(z); + } + + public override ECFieldElement Sqrt() + { + ulong[] z = Nat448.Create64(); + SecT409Field.Sqrt(x, z); + return new SecT409FieldElement(z); + } + + public virtual int Representation + { + get { return F2mFieldElement.Tpb; } + } + + public virtual int M + { + get { return 409; } + } + + public virtual int K1 + { + get { return 87; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override bool Equals(object obj) + { + return Equals(obj as SecT409FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecT409FieldElement); + } + + public virtual bool Equals(SecT409FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat448.Eq64(x, other.x); + } + + public override int GetHashCode() + { + return 4090087 ^ Arrays.GetHashCode(x, 0, 7); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409FieldElement.cs.meta new file mode 100644 index 00000000..7e21d22c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1e5e0f341731bb140baa0eb9ad0b6ed6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Curve.cs new file mode 100644 index 00000000..c1a14898 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Curve.cs @@ -0,0 +1,167 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT409K1Curve + : AbstractF2mCurve + { + private const int SECT409K1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT409K1_FE_LONGS = 7; + + protected readonly SecT409K1Point m_infinity; + + public SecT409K1Curve() + : base(409, 87, 0, 0) + { + this.m_infinity = new SecT409K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.Zero); + this.m_b = FromBigInteger(BigInteger.One); + this.m_order = new BigInteger(1, Hex.Decode("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF")); + this.m_cofactor = BigInteger.ValueOf(4); + + this.m_coord = SECT409K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT409K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + protected override ECMultiplier CreateDefaultMultiplier() + { + return new WTauNafMultiplier(); + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 409; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT409FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT409K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT409K1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return true; } + } + + public virtual int M + { + get { return 409; } + } + + public virtual bool IsTrinomial + { + get { return true; } + } + + public virtual int K1 + { + get { return 87; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT409K1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat448.Copy64(((SecT409FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT409K1_FE_LONGS; + Nat448.Copy64(((SecT409FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT409K1_FE_LONGS; + } + } + + return new SecT409K1LookupTable(this, table, len); + } + + private class SecT409K1LookupTable + : ECLookupTable + { + private readonly SecT409K1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT409K1LookupTable(SecT409K1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat448.Create64(), y = Nat448.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT409K1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT409K1_FE_LONGS + j] & MASK; + } + + pos += (SECT409K1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT409FieldElement(x), new SecT409FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Curve.cs.meta new file mode 100644 index 00000000..70bb6646 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf4755077296bd8448cd4e30aefef694 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Point.cs new file mode 100644 index 00000000..8abfa2ed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Point.cs @@ -0,0 +1,293 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT409K1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT409K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT409K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT409K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT409K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1); + if (X3.IsZero) + { + return new SecT409K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT409K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT409K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T; + if (Z1IsOne) + { + T = L1.Square().Add(L1); + } + else + { + T = L1.Add(Z1).Multiply(L1); + } + + if (T.IsZero) + { + return new SecT409K1Point(curve, T, curve.B, IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement t1 = L1.Add(X1).Square(); + ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); + ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); + + return new SecT409K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + // NOTE: TwicePlus() only optimized for lambda-affine argument + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = L1Sq.Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = L2plus1.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT409K1Point(curve, A, curve.B, IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT409K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT409K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Point.cs.meta new file mode 100644 index 00000000..d66d4915 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dca960a8b177f5041af3ff0e3781a17e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Curve.cs new file mode 100644 index 00000000..d1cc3504 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Curve.cs @@ -0,0 +1,161 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT409R1Curve + : AbstractF2mCurve + { + private const int SECT409R1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT409R1_FE_LONGS = 7; + + protected readonly SecT409R1Point m_infinity; + + public SecT409R1Curve() + : base(409, 87, 0, 0) + { + this.m_infinity = new SecT409R1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.One); + this.m_b = FromBigInteger(new BigInteger(1, Hex.Decode("0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F"))); + this.m_order = new BigInteger(1, Hex.Decode("010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT409R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT409R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 409; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT409FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT409R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT409R1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 409; } + } + + public virtual bool IsTrinomial + { + get { return true; } + } + + public virtual int K1 + { + get { return 87; } + } + + public virtual int K2 + { + get { return 0; } + } + + public virtual int K3 + { + get { return 0; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT409R1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat448.Copy64(((SecT409FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT409R1_FE_LONGS; + Nat448.Copy64(((SecT409FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT409R1_FE_LONGS; + } + } + + return new SecT409R1LookupTable(this, table, len); + } + + private class SecT409R1LookupTable + : ECLookupTable + { + private readonly SecT409R1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT409R1LookupTable(SecT409R1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat448.Create64(), y = Nat448.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT409R1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT409R1_FE_LONGS + j] & MASK; + } + + pos += (SECT409R1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT409FieldElement(x), new SecT409FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Curve.cs.meta new file mode 100644 index 00000000..77296a46 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1dd1b0669a789ac449e87e655d8b9b78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Point.cs new file mode 100644 index 00000000..47ae10b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Point.cs @@ -0,0 +1,282 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT409R1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT409R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT409R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT409R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT409R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).AddOne(); + if (X3.IsZero) + { + return new SecT409R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT409R1Point(curve, X3, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); + if (T.IsZero) + { + return new SecT409R1Point(curve, T, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = Z1Sq.Add(L1Sq).Add(L1Z1); + ECFieldElement A = L2.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT409R1Point(curve, A, curve.B.Sqrt(), IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); + + return new SecT409R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT409R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Point.cs.meta new file mode 100644 index 00000000..7ea2324f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT409R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a5dada0af7a6434487b13aa553ebcbd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571Field.cs new file mode 100644 index 00000000..d4fc92e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571Field.cs @@ -0,0 +1,337 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT571Field + { + private const ulong M59 = ulong.MaxValue >> 5; + + private const ulong RM = 0xEF7BDEF7BDEF7BDEUL; + + private static readonly ulong[] ROOT_Z = new ulong[]{ 0x2BE1195F08CAFB99UL, 0x95F08CAF84657C23UL, 0xCAF84657C232BE11UL, 0x657C232BE1195F08UL, + 0xF84657C2308CAF84UL, 0x7C232BE1195F08CAUL, 0xBE1195F08CAF8465UL, 0x5F08CAF84657C232UL, 0x784657C232BE119UL }; + + public static void Add(ulong[] x, ulong[] y, ulong[] z) + { + for (int i = 0; i < 9; ++i) + { + z[i] = x[i] ^ y[i]; + } + } + + private static void Add(ulong[] x, int xOff, ulong[] y, int yOff, ulong[] z, int zOff) + { + for (int i = 0; i < 9; ++i) + { + z[zOff + i] = x[xOff + i] ^ y[yOff + i]; + } + } + + private static void AddBothTo(ulong[] x, int xOff, ulong[] y, int yOff, ulong[] z, int zOff) + { + for (int i = 0; i < 9; ++i) + { + z[zOff + i] ^= x[xOff + i] ^ y[yOff + i]; + } + } + + public static void AddExt(ulong[] xx, ulong[] yy, ulong[] zz) + { + for (int i = 0; i < 18; ++i) + { + zz[i] = xx[i] ^ yy[i]; + } + } + + public static void AddOne(ulong[] x, ulong[] z) + { + z[0] = x[0] ^ 1UL; + for (int i = 1; i < 9; ++i) + { + z[i] = x[i]; + } + } + + public static ulong[] FromBigInteger(BigInteger x) + { + ulong[] z = Nat576.FromBigInteger64(x); + Reduce5(z, 0); + return z; + } + + public static void Invert(ulong[] x, ulong[] z) + { + if (Nat576.IsZero64(x)) + throw new InvalidOperationException(); + + // Itoh-Tsujii inversion with bases { 2, 3, 5 } + + ulong[] t0 = Nat576.Create64(); + ulong[] t1 = Nat576.Create64(); + ulong[] t2 = Nat576.Create64(); + + Square(x, t2); + + // 5 | 570 + Square(t2, t0); + Square(t0, t1); + Multiply(t0, t1, t0); + SquareN(t0, 2, t1); + Multiply(t0, t1, t0); + Multiply(t0, t2, t0); + + // 3 | 114 + SquareN(t0, 5, t1); + Multiply(t0, t1, t0); + SquareN(t1, 5, t1); + Multiply(t0, t1, t0); + + // 2 | 38 + SquareN(t0, 15, t1); + Multiply(t0, t1, t2); + + // ! {2,3,5} | 19 + SquareN(t2, 30, t0); + SquareN(t0, 30, t1); + Multiply(t0, t1, t0); + + // 3 | 9 + SquareN(t0, 60, t1); + Multiply(t0, t1, t0); + SquareN(t1, 60, t1); + Multiply(t0, t1, t0); + + // 3 | 3 + SquareN(t0, 180, t1); + Multiply(t0, t1, t0); + SquareN(t1, 180, t1); + Multiply(t0, t1, t0); + + Multiply(t0, t2, z); + } + + public static void Multiply(ulong[] x, ulong[] y, ulong[] z) + { + ulong[] tt = Nat576.CreateExt64(); + ImplMultiply(x, y, tt); + Reduce(tt, z); + } + + public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz) + { + ulong[] tt = Nat576.CreateExt64(); + ImplMultiply(x, y, tt); + AddExt(zz, tt, zz); + } + + public static void Reduce(ulong[] xx, ulong[] z) + { + ulong xx09 = xx[9]; + ulong u = xx[17], v = xx09; + + xx09 = v ^ (u >> 59) ^ (u >> 57) ^ (u >> 54) ^ (u >> 49); + v = xx[8] ^ (u << 5) ^ (u << 7) ^ (u << 10) ^ (u << 15); + + for (int i = 16; i >= 10; --i) + { + u = xx[i]; + z[i - 8] = v ^ (u >> 59) ^ (u >> 57) ^ (u >> 54) ^ (u >> 49); + v = xx[i - 9] ^ (u << 5) ^ (u << 7) ^ (u << 10) ^ (u << 15); + } + + u = xx09; + z[1] = v ^ (u >> 59) ^ (u >> 57) ^ (u >> 54) ^ (u >> 49); + v = xx[0] ^ (u << 5) ^ (u << 7) ^ (u << 10) ^ (u << 15); + + ulong x08 = z[8]; + ulong t = x08 >> 59; + z[0] = v ^ t ^ (t << 2) ^ (t << 5) ^ (t << 10); + z[8] = x08 & M59; + } + + public static void Reduce5(ulong[] z, int zOff) + { + ulong z8 = z[zOff + 8], t = z8 >> 59; + z[zOff ] ^= t ^ (t << 2) ^ (t << 5) ^ (t << 10); + z[zOff + 8] = z8 & M59; + } + + public static void Sqrt(ulong[] x, ulong[] z) + { + ulong[] evn = Nat576.Create64(), odd = Nat576.Create64(); + + int pos = 0; + for (int i = 0; i < 4; ++i) + { + ulong u0 = Interleave.Unshuffle(x[pos++]); + ulong u1 = Interleave.Unshuffle(x[pos++]); + evn[i] = (u0 & 0x00000000FFFFFFFFUL) | (u1 << 32); + odd[i] = (u0 >> 32) | (u1 & 0xFFFFFFFF00000000UL); + } + { + ulong u0 = Interleave.Unshuffle(x[pos]); + evn[4] = (u0 & 0x00000000FFFFFFFFUL); + odd[4] = (u0 >> 32); + } + + Multiply(odd, ROOT_Z, z); + Add(z, evn, z); + } + + public static void Square(ulong[] x, ulong[] z) + { + ulong[] tt = Nat576.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + } + + public static void SquareAddToExt(ulong[] x, ulong[] zz) + { + ulong[] tt = Nat576.CreateExt64(); + ImplSquare(x, tt); + AddExt(zz, tt, zz); + } + + public static void SquareN(ulong[] x, int n, ulong[] z) + { + Debug.Assert(n > 0); + + ulong[] tt = Nat576.CreateExt64(); + ImplSquare(x, tt); + Reduce(tt, z); + + while (--n > 0) + { + ImplSquare(z, tt); + Reduce(tt, z); + } + } + + public static uint Trace(ulong[] x) + { + // Non-zero-trace bits: 0, 561, 569 + return (uint)(x[0] ^ (x[8] >> 49) ^ (x[8] >> 57)) & 1U; + } + + protected static void ImplMultiply(ulong[] x, ulong[] y, ulong[] zz) + { + //for (int i = 0; i < 9; ++i) + //{ + // ImplMulwAcc(x, y[i], zz, i); + //} + + /* + * Precompute table of all 4-bit products of y + */ + ulong[] T0 = new ulong[9 << 4]; + Array.Copy(y, 0, T0, 9, 9); + // Reduce5(T0, 9); + int tOff = 0; + for (int i = 7; i > 0; --i) + { + tOff += 18; + Nat.ShiftUpBit64(9, T0, tOff >> 1, 0UL, T0, tOff); + Reduce5(T0, tOff); + Add(T0, 9, T0, tOff, T0, tOff + 9); + } + + /* + * Second table with all 4-bit products of B shifted 4 bits + */ + ulong[] T1 = new ulong[T0.Length]; + Nat.ShiftUpBits64(T0.Length, T0, 0, 4, 0L, T1, 0); + + uint MASK = 0xF; + + /* + * Lopez-Dahab algorithm + */ + + for (int k = 56; k >= 0; k -= 8) + { + for (int j = 1; j < 9; j += 2) + { + uint aVal = (uint)(x[j] >> k); + uint u = aVal & MASK; + uint v = (aVal >> 4) & MASK; + AddBothTo(T0, (int)(9 * u), T1, (int)(9 * v), zz, j - 1); + } + Nat.ShiftUpBits64(16, zz, 0, 8, 0L); + } + + for (int k = 56; k >= 0; k -= 8) + { + for (int j = 0; j < 9; j += 2) + { + uint aVal = (uint)(x[j] >> k); + uint u = aVal & MASK; + uint v = (aVal >> 4) & MASK; + AddBothTo(T0, (int)(9 * u), T1, (int)(9 * v), zz, j); + } + if (k > 0) + { + Nat.ShiftUpBits64(18, zz, 0, 8, 0L); + } + } + } + + protected static void ImplMulwAcc(ulong[] xs, ulong y, ulong[] z, int zOff) + { + ulong[] u = new ulong[32]; + //u[0] = 0; + u[1] = y; + for (int i = 2; i < 32; i += 2) + { + u[i ] = u[i >> 1] << 1; + u[i + 1] = u[i ] ^ y; + } + + ulong l = 0; + for (int i = 0; i < 9; ++i) + { + ulong x = xs[i]; + + uint j = (uint)x; + + l ^= u[j & 31]; + + ulong g, h = 0; + int k = 60; + do + { + j = (uint)(x >> k); + g = u[j & 31]; + l ^= (g << k); + h ^= (g >> -k); + } + while ((k -= 5) > 0); + + for (int p = 0; p < 4; ++p) + { + x = (x & RM) >> 1; + h ^= x & (ulong)(((long)y << p) >> 63); + } + + z[zOff + i] ^= l; + + l = h; + } + z[zOff + 9] ^= l; + } + + protected static void ImplSquare(ulong[] x, ulong[] zz) + { + for (int i = 0; i < 9; ++i) + { + Interleave.Expand64To128(x[i], zz, i << 1); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571Field.cs.meta new file mode 100644 index 00000000..66f61b6c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5102c10449efb5a4a85657c5d25f39bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571FieldElement.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571FieldElement.cs new file mode 100644 index 00000000..8b231984 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571FieldElement.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT571FieldElement + : AbstractF2mFieldElement + { + protected internal readonly ulong[] x; + + public SecT571FieldElement(BigInteger x) + { + if (x == null || x.SignValue < 0 || x.BitLength > 571) + throw new ArgumentException("value invalid for SecT571FieldElement", "x"); + + this.x = SecT571Field.FromBigInteger(x); + } + + public SecT571FieldElement() + { + this.x = Nat576.Create64(); + } + + protected internal SecT571FieldElement(ulong[] x) + { + this.x = x; + } + + public override bool IsOne + { + get { return Nat576.IsOne64(x); } + } + + public override bool IsZero + { + get { return Nat576.IsZero64(x); } + } + + public override bool TestBitZero() + { + return (x[0] & 1UL) != 0UL; + } + + public override BigInteger ToBigInteger() + { + return Nat576.ToBigInteger64(x); + } + + public override String FieldName + { + get { return "SecT571Field"; } + } + + public override int FieldSize + { + get { return 571; } + } + + public override ECFieldElement Add(ECFieldElement b) + { + ulong[] z = Nat576.Create64(); + SecT571Field.Add(x, ((SecT571FieldElement)b).x, z); + return new SecT571FieldElement(z); + } + + public override ECFieldElement AddOne() + { + ulong[] z = Nat576.Create64(); + SecT571Field.AddOne(x, z); + return new SecT571FieldElement(z); + } + + public override ECFieldElement Subtract(ECFieldElement b) + { + // Addition and subtraction are the same in F2m + return Add(b); + } + + public override ECFieldElement Multiply(ECFieldElement b) + { + ulong[] z = Nat576.Create64(); + SecT571Field.Multiply(x, ((SecT571FieldElement)b).x, z); + return new SecT571FieldElement(z); + } + + public override ECFieldElement MultiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + return MultiplyPlusProduct(b, x, y); + } + + public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x, bx = ((SecT571FieldElement)b).x; + ulong[] xx = ((SecT571FieldElement)x).x, yx = ((SecT571FieldElement)y).x; + + ulong[] tt = Nat576.CreateExt64(); + SecT571Field.MultiplyAddToExt(ax, bx, tt); + SecT571Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat576.Create64(); + SecT571Field.Reduce(tt, z); + return new SecT571FieldElement(z); + } + + public override ECFieldElement Divide(ECFieldElement b) + { + return Multiply(b.Invert()); + } + + public override ECFieldElement Negate() + { + return this; + } + + public override ECFieldElement Square() + { + ulong[] z = Nat576.Create64(); + SecT571Field.Square(x, z); + return new SecT571FieldElement(z); + } + + public override ECFieldElement SquareMinusProduct(ECFieldElement x, ECFieldElement y) + { + return SquarePlusProduct(x, y); + } + + public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y) + { + ulong[] ax = this.x; + ulong[] xx = ((SecT571FieldElement)x).x, yx = ((SecT571FieldElement)y).x; + + ulong[] tt = Nat576.CreateExt64(); + SecT571Field.SquareAddToExt(ax, tt); + SecT571Field.MultiplyAddToExt(xx, yx, tt); + + ulong[] z = Nat576.Create64(); + SecT571Field.Reduce(tt, z); + return new SecT571FieldElement(z); + } + + public override ECFieldElement SquarePow(int pow) + { + if (pow < 1) + return this; + + ulong[] z = Nat576.Create64(); + SecT571Field.SquareN(x, pow, z); + return new SecT571FieldElement(z); + } + + public override int Trace() + { + return (int)SecT571Field.Trace(x); + } + + public override ECFieldElement Invert() + { + ulong[] z = Nat576.Create64(); + SecT571Field.Invert(x, z); + return new SecT571FieldElement(z); + } + + public override ECFieldElement Sqrt() + { + ulong[] z = Nat576.Create64(); + SecT571Field.Sqrt(x, z); + return new SecT571FieldElement(z); + } + + public virtual int Representation + { + get { return F2mFieldElement.Ppb; } + } + + public virtual int M + { + get { return 571; } + } + + public virtual int K1 + { + get { return 2; } + } + + public virtual int K2 + { + get { return 5; } + } + + public virtual int K3 + { + get { return 10; } + } + + public override bool Equals(object obj) + { + return Equals(obj as SecT571FieldElement); + } + + public override bool Equals(ECFieldElement other) + { + return Equals(other as SecT571FieldElement); + } + + public virtual bool Equals(SecT571FieldElement other) + { + if (this == other) + return true; + if (null == other) + return false; + return Nat576.Eq64(x, other.x); + } + + public override int GetHashCode() + { + return 5711052 ^ Arrays.GetHashCode(x, 0, 9); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571FieldElement.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571FieldElement.cs.meta new file mode 100644 index 00000000..5b8db289 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571FieldElement.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9d2a199651f1f154d8ed8d08c7f52f15 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Curve.cs new file mode 100644 index 00000000..2def7077 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Curve.cs @@ -0,0 +1,167 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT571K1Curve + : AbstractF2mCurve + { + private const int SECT571K1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT571K1_FE_LONGS = 9; + + protected readonly SecT571K1Point m_infinity; + + public SecT571K1Curve() + : base(571, 2, 5, 10) + { + this.m_infinity = new SecT571K1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.Zero); + this.m_b = FromBigInteger(BigInteger.One); + this.m_order = new BigInteger(1, Hex.Decode("020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001")); + this.m_cofactor = BigInteger.ValueOf(4); + + this.m_coord = SECT571K1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT571K1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + protected override ECMultiplier CreateDefaultMultiplier() + { + return new WTauNafMultiplier(); + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 571; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT571FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT571K1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT571K1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return true; } + } + + public virtual int M + { + get { return 571; } + } + + public virtual bool IsTrinomial + { + get { return false; } + } + + public virtual int K1 + { + get { return 2; } + } + + public virtual int K2 + { + get { return 5; } + } + + public virtual int K3 + { + get { return 10; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT571K1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat576.Copy64(((SecT571FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT571K1_FE_LONGS; + Nat576.Copy64(((SecT571FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT571K1_FE_LONGS; + } + } + + return new SecT571K1LookupTable(this, table, len); + } + + private class SecT571K1LookupTable + : ECLookupTable + { + private readonly SecT571K1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT571K1LookupTable(SecT571K1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat576.Create64(), y = Nat576.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT571K1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT571K1_FE_LONGS + j] & MASK; + } + + pos += (SECT571K1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT571FieldElement(x), new SecT571FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Curve.cs.meta new file mode 100644 index 00000000..0a848842 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 376e118668ede6543b1a007c453d52a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Point.cs new file mode 100644 index 00000000..018876f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Point.cs @@ -0,0 +1,293 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT571K1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT571K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT571K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT571K1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT571K1Point(null, this.AffineXCoord, this.AffineYCoord); // earlier JDK + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1); + if (X3.IsZero) + { + return new SecT571K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT571K1Point(curve, X3, curve.B, IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT571K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T; + if (Z1IsOne) + { + T = L1.Square().Add(L1); + } + else + { + T = L1.Add(Z1).Multiply(L1); + } + + if (T.IsZero) + { + return new SecT571K1Point(curve, T, curve.B, IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement t1 = L1.Add(X1).Square(); + ECFieldElement t2 = Z1IsOne ? Z1 : Z1Sq.Square(); + ECFieldElement L3 = t1.Add(T).Add(Z1Sq).Multiply(t1).Add(t2).Add(X3).Add(Z3); + + return new SecT571K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + // NOTE: TwicePlus() only optimized for lambda-affine argument + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = L1Sq.Add(L1Z1); + ECFieldElement L2plus1 = L2.AddOne(); + ECFieldElement A = L2plus1.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT571K1Point(curve, A, curve.B, IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2plus1, Z3); + + return new SecT571K1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT571K1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Point.cs.meta new file mode 100644 index 00000000..835f77b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571K1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fa7660666cc38b449992eb301ca16b69 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Curve.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Curve.cs new file mode 100644 index 00000000..47d5e876 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Curve.cs @@ -0,0 +1,165 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT571R1Curve + : AbstractF2mCurve + { + private const int SECT571R1_DEFAULT_COORDS = COORD_LAMBDA_PROJECTIVE; + private const int SECT571R1_FE_LONGS = 9; + + protected readonly SecT571R1Point m_infinity; + + internal static readonly SecT571FieldElement SecT571R1_B = new SecT571FieldElement( + new BigInteger(1, Hex.Decode("02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A"))); + internal static readonly SecT571FieldElement SecT571R1_B_SQRT = (SecT571FieldElement)SecT571R1_B.Sqrt(); + + public SecT571R1Curve() + : base(571, 2, 5, 10) + { + this.m_infinity = new SecT571R1Point(this, null, null); + + this.m_a = FromBigInteger(BigInteger.One); + this.m_b = SecT571R1_B; + this.m_order = new BigInteger(1, Hex.Decode("03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47")); + this.m_cofactor = BigInteger.Two; + + this.m_coord = SECT571R1_DEFAULT_COORDS; + } + + protected override ECCurve CloneCurve() + { + return new SecT571R1Curve(); + } + + public override bool SupportsCoordinateSystem(int coord) + { + switch (coord) + { + case COORD_LAMBDA_PROJECTIVE: + return true; + default: + return false; + } + } + + public override ECPoint Infinity + { + get { return m_infinity; } + } + + public override int FieldSize + { + get { return 571; } + } + + public override ECFieldElement FromBigInteger(BigInteger x) + { + return new SecT571FieldElement(x); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, bool withCompression) + { + return new SecT571R1Point(this, x, y, withCompression); + } + + protected internal override ECPoint CreateRawPoint(ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + { + return new SecT571R1Point(this, x, y, zs, withCompression); + } + + public override bool IsKoblitz + { + get { return false; } + } + + public virtual int M + { + get { return 571; } + } + + public virtual bool IsTrinomial + { + get { return false; } + } + + public virtual int K1 + { + get { return 2; } + } + + public virtual int K2 + { + get { return 5; } + } + + public virtual int K3 + { + get { return 10; } + } + + public override ECLookupTable CreateCacheSafeLookupTable(ECPoint[] points, int off, int len) + { + ulong[] table = new ulong[len * SECT571R1_FE_LONGS * 2]; + { + int pos = 0; + for (int i = 0; i < len; ++i) + { + ECPoint p = points[off + i]; + Nat576.Copy64(((SecT571FieldElement)p.RawXCoord).x, 0, table, pos); pos += SECT571R1_FE_LONGS; + Nat576.Copy64(((SecT571FieldElement)p.RawYCoord).x, 0, table, pos); pos += SECT571R1_FE_LONGS; + } + } + + return new SecT571R1LookupTable(this, table, len); + } + + private class SecT571R1LookupTable + : ECLookupTable + { + private readonly SecT571R1Curve m_outer; + private readonly ulong[] m_table; + private readonly int m_size; + + internal SecT571R1LookupTable(SecT571R1Curve outer, ulong[] table, int size) + { + this.m_outer = outer; + this.m_table = table; + this.m_size = size; + } + + public virtual int Size + { + get { return m_size; } + } + + public virtual ECPoint Lookup(int index) + { + ulong[] x = Nat576.Create64(), y = Nat576.Create64(); + int pos = 0; + + for (int i = 0; i < m_size; ++i) + { + ulong MASK = (ulong)(long)(((i ^ index) - 1) >> 31); + + for (int j = 0; j < SECT571R1_FE_LONGS; ++j) + { + x[j] ^= m_table[pos + j] & MASK; + y[j] ^= m_table[pos + SECT571R1_FE_LONGS + j] & MASK; + } + + pos += (SECT571R1_FE_LONGS * 2); + } + + return m_outer.CreateRawPoint(new SecT571FieldElement(x), new SecT571FieldElement(y), false); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Curve.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Curve.cs.meta new file mode 100644 index 00000000..90f92d38 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Curve.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 287691cba348f94419cbfe05b04d46f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Point.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Point.cs new file mode 100644 index 00000000..15fbf574 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Point.cs @@ -0,0 +1,282 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Custom.Sec +{ + internal class SecT571R1Point + : AbstractF2mPoint + { + /** + * @deprecated Use ECCurve.createPoint to construct points + */ + public SecT571R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y) + : this(curve, x, y, false) + { + } + + /** + * @deprecated per-point compression property will be removed, refer {@link #getEncoded(bool)} + */ + public SecT571R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, bool withCompression) + : base(curve, x, y, withCompression) + { + if ((x == null) != (y == null)) + throw new ArgumentException("Exactly one of the field elements is null"); + } + + internal SecT571R1Point(ECCurve curve, ECFieldElement x, ECFieldElement y, ECFieldElement[] zs, bool withCompression) + : base(curve, x, y, zs, withCompression) + { + } + + protected override ECPoint Detach() + { + return new SecT571R1Point(null, AffineXCoord, AffineYCoord); + } + + public override ECFieldElement YCoord + { + get + { + ECFieldElement X = RawXCoord, L = RawYCoord; + + if (this.IsInfinity || X.IsZero) + return L; + + // Y is actually Lambda (X + Y/X) here; convert to affine value on the fly + ECFieldElement Y = L.Add(X).Multiply(X); + + ECFieldElement Z = RawZCoords[0]; + if (!Z.IsOne) + { + Y = Y.Divide(Z); + } + + return Y; + } + } + + protected internal override bool CompressionYTilde + { + get + { + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return false; + + ECFieldElement Y = this.RawYCoord; + + // Y is actually Lambda (X + Y/X) here + return Y.TestBitZero() != X.TestBitZero(); + } + } + + public override ECPoint Add(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + ECFieldElement X2 = b.RawXCoord; + + if (X1.IsZero) + { + if (X2.IsZero) + return curve.Infinity; + + return b.Add(this); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord, Z2 = b.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement U2 = X2, S2 = L2; + if (!Z1IsOne) + { + U2 = U2.Multiply(Z1); + S2 = S2.Multiply(Z1); + } + + bool Z2IsOne = Z2.IsOne; + ECFieldElement U1 = X1, S1 = L1; + if (!Z2IsOne) + { + U1 = U1.Multiply(Z2); + S1 = S1.Multiply(Z2); + } + + ECFieldElement A = S1.Add(S2); + ECFieldElement B = U1.Add(U2); + + if (B.IsZero) + { + if (A.IsZero) + return Twice(); + + return curve.Infinity; + } + + ECFieldElement X3, L3, Z3; + if (X2.IsZero) + { + // TODO This can probably be optimized quite a bit + ECPoint p = this.Normalize(); + X1 = p.XCoord; + ECFieldElement Y1 = p.YCoord; + + ECFieldElement Y2 = L2; + ECFieldElement L = Y1.Add(Y2).Divide(X1); + + X3 = L.Square().Add(L).Add(X1).AddOne(); + if (X3.IsZero) + { + return new SecT571R1Point(curve, X3, SecT571R1Curve.SecT571R1_B_SQRT, IsCompressed); + } + + ECFieldElement Y3 = L.Multiply(X1.Add(X3)).Add(X3).Add(Y1); + L3 = Y3.Divide(X3).Add(X3); + Z3 = curve.FromBigInteger(BigInteger.One); + } + else + { + B = B.Square(); + + ECFieldElement AU1 = A.Multiply(U1); + ECFieldElement AU2 = A.Multiply(U2); + + X3 = AU1.Multiply(AU2); + if (X3.IsZero) + { + return new SecT571R1Point(curve, X3, SecT571R1Curve.SecT571R1_B_SQRT, IsCompressed); + } + + ECFieldElement ABZ2 = A.Multiply(B); + if (!Z2IsOne) + { + ABZ2 = ABZ2.Multiply(Z2); + } + + L3 = AU2.Add(B).SquarePlusProduct(ABZ2, L1.Add(Z1)); + + Z3 = ABZ2; + if (!Z1IsOne) + { + Z3 = Z3.Multiply(Z1); + } + } + + return new SecT571R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Twice() + { + if (this.IsInfinity) + return this; + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return curve.Infinity; + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + + bool Z1IsOne = Z1.IsOne; + ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.Multiply(Z1); + ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.Square(); + ECFieldElement T = L1.Square().Add(L1Z1).Add(Z1Sq); + if (T.IsZero) + { + return new SecT571R1Point(curve, T, SecT571R1Curve.SecT571R1_B_SQRT, IsCompressed); + } + + ECFieldElement X3 = T.Square(); + ECFieldElement Z3 = Z1IsOne ? T : T.Multiply(Z1Sq); + + ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.Multiply(Z1); + ECFieldElement L3 = X1Z1.SquarePlusProduct(T, L1Z1).Add(X3).Add(Z3); + + return new SecT571R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint TwicePlus(ECPoint b) + { + if (this.IsInfinity) + return b; + if (b.IsInfinity) + return Twice(); + + ECCurve curve = this.Curve; + + ECFieldElement X1 = this.RawXCoord; + if (X1.IsZero) + { + // A point with X == 0 is it's own Additive inverse + return b; + } + + ECFieldElement X2 = b.RawXCoord, Z2 = b.RawZCoords[0]; + if (X2.IsZero || !Z2.IsOne) + { + return Twice().Add(b); + } + + ECFieldElement L1 = this.RawYCoord, Z1 = this.RawZCoords[0]; + ECFieldElement L2 = b.RawYCoord; + + ECFieldElement X1Sq = X1.Square(); + ECFieldElement L1Sq = L1.Square(); + ECFieldElement Z1Sq = Z1.Square(); + ECFieldElement L1Z1 = L1.Multiply(Z1); + + ECFieldElement T = Z1Sq.Add(L1Sq).Add(L1Z1); + ECFieldElement A = L2.Multiply(Z1Sq).Add(L1Sq).MultiplyPlusProduct(T, X1Sq, Z1Sq); + ECFieldElement X2Z1Sq = X2.Multiply(Z1Sq); + ECFieldElement B = X2Z1Sq.Add(T).Square(); + + if (B.IsZero) + { + if (A.IsZero) + return b.Twice(); + + return curve.Infinity; + } + + if (A.IsZero) + { + return new SecT571R1Point(curve, A, SecT571R1Curve.SecT571R1_B_SQRT, IsCompressed); + } + + ECFieldElement X3 = A.Square().Multiply(X2Z1Sq); + ECFieldElement Z3 = A.Multiply(B).Multiply(Z1Sq); + ECFieldElement L3 = A.Add(B).Square().MultiplyPlusProduct(T, L2.AddOne(), Z3); + + return new SecT571R1Point(curve, X3, L3, new ECFieldElement[] { Z3 }, IsCompressed); + } + + public override ECPoint Negate() + { + if (this.IsInfinity) + return this; + + ECFieldElement X = this.RawXCoord; + if (X.IsZero) + return this; + + // L is actually Lambda (X + Y/X) here + ECFieldElement L = this.RawYCoord, Z = this.RawZCoords[0]; + return new SecT571R1Point(Curve, X, L.Add(Z), new ECFieldElement[] { Z }, IsCompressed); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Point.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Point.cs.meta new file mode 100644 index 00000000..3b54b1c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/custom/sec/SecT571R1Point.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4d049a4596e1c44199a6558ef1880ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo.meta new file mode 100644 index 00000000..133a2db2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea3bf8e1c91bc00418e4ba58fef48e8d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/ECEndomorphism.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/ECEndomorphism.cs new file mode 100644 index 00000000..c3815ed1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/ECEndomorphism.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo +{ + public interface ECEndomorphism + { + ECPointMap PointMap { get; } + + bool HasEfficientPointMap { get; } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/ECEndomorphism.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/ECEndomorphism.cs.meta new file mode 100644 index 00000000..63d28019 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/ECEndomorphism.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3e5470dddbaf9448addcb073ff9da26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvEndomorphism.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvEndomorphism.cs new file mode 100644 index 00000000..078bbe07 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvEndomorphism.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo +{ + public interface GlvEndomorphism + : ECEndomorphism + { + BigInteger[] DecomposeScalar(BigInteger k); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvEndomorphism.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvEndomorphism.cs.meta new file mode 100644 index 00000000..2c404079 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvEndomorphism.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef17475fe8bc0ff46ac3012a1bc5a09a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBEndomorphism.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBEndomorphism.cs new file mode 100644 index 00000000..dc4e475d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBEndomorphism.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo +{ + public class GlvTypeBEndomorphism + : GlvEndomorphism + { + protected readonly ECCurve m_curve; + protected readonly GlvTypeBParameters m_parameters; + protected readonly ECPointMap m_pointMap; + + public GlvTypeBEndomorphism(ECCurve curve, GlvTypeBParameters parameters) + { + this.m_curve = curve; + this.m_parameters = parameters; + this.m_pointMap = new ScaleXPointMap(curve.FromBigInteger(parameters.Beta)); + } + + public virtual BigInteger[] DecomposeScalar(BigInteger k) + { + int bits = m_parameters.Bits; + BigInteger b1 = CalculateB(k, m_parameters.G1, bits); + BigInteger b2 = CalculateB(k, m_parameters.G2, bits); + + BigInteger[] v1 = m_parameters.V1, v2 = m_parameters.V2; + BigInteger a = k.Subtract((b1.Multiply(v1[0])).Add(b2.Multiply(v2[0]))); + BigInteger b = (b1.Multiply(v1[1])).Add(b2.Multiply(v2[1])).Negate(); + + return new BigInteger[]{ a, b }; + } + + public virtual ECPointMap PointMap + { + get { return m_pointMap; } + } + + public virtual bool HasEfficientPointMap + { + get { return true; } + } + + protected virtual BigInteger CalculateB(BigInteger k, BigInteger g, int t) + { + bool negative = (g.SignValue < 0); + BigInteger b = k.Multiply(g.Abs()); + bool extra = b.TestBit(t - 1); + b = b.ShiftRight(t); + if (extra) + { + b = b.Add(BigInteger.One); + } + return negative ? b.Negate() : b; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBEndomorphism.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBEndomorphism.cs.meta new file mode 100644 index 00000000..5e4ccf81 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBEndomorphism.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d704deeea20becd4daf099cc997710ff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBParameters.cs new file mode 100644 index 00000000..fb0f91f5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBParameters.cs @@ -0,0 +1,64 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo +{ + public class GlvTypeBParameters + { + protected readonly BigInteger m_beta; + protected readonly BigInteger m_lambda; + protected readonly BigInteger[] m_v1, m_v2; + protected readonly BigInteger m_g1, m_g2; + protected readonly int m_bits; + + public GlvTypeBParameters(BigInteger beta, BigInteger lambda, BigInteger[] v1, BigInteger[] v2, + BigInteger g1, BigInteger g2, int bits) + { + this.m_beta = beta; + this.m_lambda = lambda; + this.m_v1 = v1; + this.m_v2 = v2; + this.m_g1 = g1; + this.m_g2 = g2; + this.m_bits = bits; + } + + public virtual BigInteger Beta + { + get { return m_beta; } + } + + public virtual BigInteger Lambda + { + get { return m_lambda; } + } + + public virtual BigInteger[] V1 + { + get { return m_v1; } + } + + public virtual BigInteger[] V2 + { + get { return m_v2; } + } + + public virtual BigInteger G1 + { + get { return m_g1; } + } + + public virtual BigInteger G2 + { + get { return m_g2; } + } + + public virtual int Bits + { + get { return m_bits; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBParameters.cs.meta new file mode 100644 index 00000000..1d3d83a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/endo/GlvTypeBParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43a554c9ef493c94592277d57233a060 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier.meta new file mode 100644 index 00000000..20d742f1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a53de973421193c4cbf33dbbaec90811 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/AbstractECMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/AbstractECMultiplier.cs new file mode 100644 index 00000000..bbea5d8d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/AbstractECMultiplier.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public abstract class AbstractECMultiplier + : ECMultiplier + { + public virtual ECPoint Multiply(ECPoint p, BigInteger k) + { + int sign = k.SignValue; + if (sign == 0 || p.IsInfinity) + return p.Curve.Infinity; + + ECPoint positive = MultiplyPositive(p, k.Abs()); + ECPoint result = sign > 0 ? positive : positive.Negate(); + + /* + * Although the various multipliers ought not to produce invalid output under normal + * circumstances, a final check here is advised to guard against fault attacks. + */ + return CheckResult(result); + } + + protected abstract ECPoint MultiplyPositive(ECPoint p, BigInteger k); + + protected virtual ECPoint CheckResult(ECPoint p) + { + return ECAlgorithms.ImplCheckResult(p); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/AbstractECMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/AbstractECMultiplier.cs.meta new file mode 100644 index 00000000..7b441198 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/AbstractECMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b90b097e4fcebb64a9055665b2062092 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/DoubleAddMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/DoubleAddMultiplier.cs new file mode 100644 index 00000000..500e52d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/DoubleAddMultiplier.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public class DoubleAddMultiplier + : AbstractECMultiplier + { + /** + * Joye's double-add algorithm. + */ + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + ECPoint[] R = new ECPoint[]{ p.Curve.Infinity, p }; + + int n = k.BitLength; + for (int i = 0; i < n; ++i) + { + int b = k.TestBit(i) ? 1 : 0; + int bp = 1 - b; + R[bp] = R[bp].TwicePlus(R[b]); + } + + return R[0]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/DoubleAddMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/DoubleAddMultiplier.cs.meta new file mode 100644 index 00000000..e3c82aa5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/DoubleAddMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e8fbe74587f63243a1e7ae9ea28121d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ECMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ECMultiplier.cs new file mode 100644 index 00000000..67f579bd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ECMultiplier.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Interface for classes encapsulating a point multiplication algorithm + * for ECPoints. + */ + public interface ECMultiplier + { + /** + * Multiplies the ECPoint p by k, i.e. + * p is added k times to itself. + * @param p The ECPoint to be multiplied. + * @param k The factor by which p is multiplied. + * @return p multiplied by k. + */ + ECPoint Multiply(ECPoint p, BigInteger k); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ECMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ECMultiplier.cs.meta new file mode 100644 index 00000000..43516e74 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ECMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0af0eecaaa213474cb001933d00e041e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointCombMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointCombMultiplier.cs new file mode 100644 index 00000000..d9046e63 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointCombMultiplier.cs @@ -0,0 +1,62 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public class FixedPointCombMultiplier + : AbstractECMultiplier + { + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + ECCurve c = p.Curve; + int size = FixedPointUtilities.GetCombSize(c); + + if (k.BitLength > size) + { + /* + * TODO The comb works best when the scalars are less than the (possibly unknown) order. + * Still, if we want to handle larger scalars, we could allow customization of the comb + * size, or alternatively we could deal with the 'extra' bits either by running the comb + * multiple times as necessary, or by using an alternative multiplier as prelude. + */ + throw new InvalidOperationException("fixed-point comb doesn't support scalars larger than the curve order"); + } + + FixedPointPreCompInfo info = FixedPointUtilities.Precompute(p); + ECLookupTable lookupTable = info.LookupTable; + int width = info.Width; + + int d = (size + width - 1) / width; + + ECPoint R = c.Infinity; + + int fullComb = d * width; + uint[] K = Nat.FromBigInteger(fullComb, k); + + int top = fullComb - 1; + for (int i = 0; i < d; ++i) + { + uint secretIndex = 0; + + for (int j = top - i; j >= 0; j -= d) + { + uint secretBit = K[j >> 5] >> (j & 0x1F); + secretIndex ^= secretBit >> 1; + secretIndex <<= 1; + secretIndex ^= secretBit; + } + + ECPoint add = lookupTable.Lookup((int)secretIndex); + + R = R.TwicePlus(add); + } + + return R.Add(info.Offset); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointCombMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointCombMultiplier.cs.meta new file mode 100644 index 00000000..c38865f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointCombMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 063e8c85432309347a8cee70efde8e72 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointPreCompInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointPreCompInfo.cs new file mode 100644 index 00000000..b04f673f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointPreCompInfo.cs @@ -0,0 +1,47 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Class holding precomputation data for fixed-point multiplications. + */ + public class FixedPointPreCompInfo + : PreCompInfo + { + protected ECPoint m_offset = null; + + /** + * Lookup table for the precomputed ECPoints used for a fixed point multiplication. + */ + protected ECLookupTable m_lookupTable = null; + + /** + * The width used for the precomputation. If a larger width precomputation + * is already available this may be larger than was requested, so calling + * code should refer to the actual width. + */ + protected int m_width = -1; + + public virtual ECLookupTable LookupTable + { + get { return m_lookupTable; } + set { this.m_lookupTable = value; } + } + + public virtual ECPoint Offset + { + get { return m_offset; } + set { this.m_offset = value; } + } + + public virtual int Width + { + get { return m_width; } + set { this.m_width = value; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointPreCompInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointPreCompInfo.cs.meta new file mode 100644 index 00000000..db862c5c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointPreCompInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5269ffcee0d3b4f459619e7351ac2e2f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointUtilities.cs new file mode 100644 index 00000000..0839a965 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointUtilities.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public class FixedPointUtilities + { + public static readonly string PRECOMP_NAME = "bc_fixed_point"; + + public static int GetCombSize(ECCurve c) + { + BigInteger order = c.Order; + return order == null ? c.FieldSize + 1 : order.BitLength; + } + + public static FixedPointPreCompInfo GetFixedPointPreCompInfo(PreCompInfo preCompInfo) + { + return preCompInfo as FixedPointPreCompInfo; + } + + public static FixedPointPreCompInfo Precompute(ECPoint p) + { + return (FixedPointPreCompInfo)p.Curve.Precompute(p, PRECOMP_NAME, new FixedPointCallback(p)); + } + + private class FixedPointCallback + : IPreCompCallback + { + private readonly ECPoint m_p; + + internal FixedPointCallback(ECPoint p) + { + this.m_p = p; + } + + public PreCompInfo Precompute(PreCompInfo existing) + { + FixedPointPreCompInfo existingFP = (existing is FixedPointPreCompInfo) ? (FixedPointPreCompInfo)existing : null; + + ECCurve c = m_p.Curve; + int bits = FixedPointUtilities.GetCombSize(c); + int minWidth = bits > 250 ? 6 : 5; + int n = 1 << minWidth; + + if (CheckExisting(existingFP, n)) + return existingFP; + + int d = (bits + minWidth - 1) / minWidth; + + ECPoint[] pow2Table = new ECPoint[minWidth + 1]; + pow2Table[0] = m_p; + for (int i = 1; i < minWidth; ++i) + { + pow2Table[i] = pow2Table[i - 1].TimesPow2(d); + } + + // This will be the 'offset' value + pow2Table[minWidth] = pow2Table[0].Subtract(pow2Table[1]); + + c.NormalizeAll(pow2Table); + + ECPoint[] lookupTable = new ECPoint[n]; + lookupTable[0] = pow2Table[0]; + + for (int bit = minWidth - 1; bit >= 0; --bit) + { + ECPoint pow2 = pow2Table[bit]; + + int step = 1 << bit; + for (int i = step; i < n; i += (step << 1)) + { + lookupTable[i] = lookupTable[i - step].Add(pow2); + } + } + + c.NormalizeAll(lookupTable); + + FixedPointPreCompInfo result = new FixedPointPreCompInfo(); + result.LookupTable = c.CreateCacheSafeLookupTable(lookupTable, 0, lookupTable.Length); + result.Offset = pow2Table[minWidth]; + result.Width = minWidth; + return result; + } + + private bool CheckExisting(FixedPointPreCompInfo existingFP, int n) + { + return existingFP != null && CheckTable(existingFP.LookupTable, n); + } + + private bool CheckTable(ECLookupTable table, int n) + { + return table != null && table.Size >= n; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointUtilities.cs.meta new file mode 100644 index 00000000..25f58a5a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/FixedPointUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 508ed3f5d1e1c934eb8ee7da23677718 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/GlvMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/GlvMultiplier.cs new file mode 100644 index 00000000..4cb92478 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/GlvMultiplier.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Endo; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public class GlvMultiplier + : AbstractECMultiplier + { + protected readonly ECCurve curve; + protected readonly GlvEndomorphism glvEndomorphism; + + public GlvMultiplier(ECCurve curve, GlvEndomorphism glvEndomorphism) + { + if (curve == null || curve.Order == null) + throw new ArgumentException("Need curve with known group order", "curve"); + + this.curve = curve; + this.glvEndomorphism = glvEndomorphism; + } + + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + if (!curve.Equals(p.Curve)) + throw new InvalidOperationException(); + + BigInteger n = p.Curve.Order; + BigInteger[] ab = glvEndomorphism.DecomposeScalar(k.Mod(n)); + BigInteger a = ab[0], b = ab[1]; + + ECPointMap pointMap = glvEndomorphism.PointMap; + if (glvEndomorphism.HasEfficientPointMap) + { + return ECAlgorithms.ImplShamirsTrickWNaf(p, a, pointMap, b); + } + + return ECAlgorithms.ImplShamirsTrickWNaf(p, a, pointMap.Map(p), b); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/GlvMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/GlvMultiplier.cs.meta new file mode 100644 index 00000000..3fe3a770 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/GlvMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fecaa205dd70b694396480bbad11c16d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/IPreCompCallback.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/IPreCompCallback.cs new file mode 100644 index 00000000..7026f76f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/IPreCompCallback.cs @@ -0,0 +1,13 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public interface IPreCompCallback + { + PreCompInfo Precompute(PreCompInfo existing); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/IPreCompCallback.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/IPreCompCallback.cs.meta new file mode 100644 index 00000000..fd21eae4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/IPreCompCallback.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4b23d148bccccc4dac614961ec7fe2d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MixedNafR2LMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MixedNafR2LMultiplier.cs new file mode 100644 index 00000000..a31a58ff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MixedNafR2LMultiplier.cs @@ -0,0 +1,79 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left) using + * mixed coordinates. + */ + public class MixedNafR2LMultiplier + : AbstractECMultiplier + { + protected readonly int additionCoord, doublingCoord; + + /** + * By default, addition will be done in Jacobian coordinates, and doubling will be done in + * Modified Jacobian coordinates (independent of the original coordinate system of each point). + */ + public MixedNafR2LMultiplier() + : this(ECCurve.COORD_JACOBIAN, ECCurve.COORD_JACOBIAN_MODIFIED) + { + } + + public MixedNafR2LMultiplier(int additionCoord, int doublingCoord) + { + this.additionCoord = additionCoord; + this.doublingCoord = doublingCoord; + } + + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + ECCurve curveOrig = p.Curve; + + ECCurve curveAdd = ConfigureCurve(curveOrig, additionCoord); + ECCurve curveDouble = ConfigureCurve(curveOrig, doublingCoord); + + int[] naf = WNafUtilities.GenerateCompactNaf(k); + + ECPoint Ra = curveAdd.Infinity; + ECPoint Td = curveDouble.ImportPoint(p); + + int zeroes = 0; + for (int i = 0; i < naf.Length; ++i) + { + int ni = naf[i]; + int digit = ni >> 16; + zeroes += ni & 0xFFFF; + + Td = Td.TimesPow2(zeroes); + + ECPoint Tj = curveAdd.ImportPoint(Td); + if (digit < 0) + { + Tj = Tj.Negate(); + } + + Ra = Ra.Add(Tj); + + zeroes = 1; + } + + return curveOrig.ImportPoint(Ra); + } + + protected virtual ECCurve ConfigureCurve(ECCurve c, int coord) + { + if (c.CoordinateSystem == coord) + return c; + + if (!c.SupportsCoordinateSystem(coord)) + throw new ArgumentException("Coordinate system " + coord + " not supported by this curve", "coord"); + + return c.Configure().SetCoordinateSystem(coord).Create(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MixedNafR2LMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MixedNafR2LMultiplier.cs.meta new file mode 100644 index 00000000..eb60f0f4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MixedNafR2LMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4ad45cbcac283af4a83c18536e0797a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MontgomeryLadderMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MontgomeryLadderMultiplier.cs new file mode 100644 index 00000000..5ce93df7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MontgomeryLadderMultiplier.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public class MontgomeryLadderMultiplier + : AbstractECMultiplier + { + /** + * Montgomery ladder. + */ + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + ECPoint[] R = new ECPoint[]{ p.Curve.Infinity, p }; + + int n = k.BitLength; + int i = n; + while (--i >= 0) + { + int b = k.TestBit(i) ? 1 : 0; + int bp = 1 - b; + R[bp] = R[bp].Add(R[b]); + R[b] = R[b].Twice(); + } + return R[0]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MontgomeryLadderMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MontgomeryLadderMultiplier.cs.meta new file mode 100644 index 00000000..87f9323b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/MontgomeryLadderMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ee06937c60e6612489c0819cf064d28a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafL2RMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafL2RMultiplier.cs new file mode 100644 index 00000000..18140236 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafL2RMultiplier.cs @@ -0,0 +1,34 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (left-to-right). + */ + public class NafL2RMultiplier + : AbstractECMultiplier + { + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + int[] naf = WNafUtilities.GenerateCompactNaf(k); + + ECPoint addP = p.Normalize(), subP = addP.Negate(); + + ECPoint R = p.Curve.Infinity; + + int i = naf.Length; + while (--i >= 0) + { + int ni = naf[i]; + int digit = ni >> 16, zeroes = ni & 0xFFFF; + + R = R.TwicePlus(digit < 0 ? subP : addP); + R = R.TimesPow2(zeroes); + } + + return R; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafL2RMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafL2RMultiplier.cs.meta new file mode 100644 index 00000000..5b206928 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafL2RMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a6b941d5861e27846b14b905ab4e28c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafR2LMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafR2LMultiplier.cs new file mode 100644 index 00000000..86236040 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafR2LMultiplier.cs @@ -0,0 +1,35 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Class implementing the NAF (Non-Adjacent Form) multiplication algorithm (right-to-left). + */ + public class NafR2LMultiplier + : AbstractECMultiplier + { + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + int[] naf = WNafUtilities.GenerateCompactNaf(k); + + ECPoint R0 = p.Curve.Infinity, R1 = p; + + int zeroes = 0; + for (int i = 0; i < naf.Length; ++i) + { + int ni = naf[i]; + int digit = ni >> 16; + zeroes += ni & 0xFFFF; + + R1 = R1.TimesPow2(zeroes); + R0 = R0.Add(digit < 0 ? R1.Negate() : R1); + + zeroes = 1; + } + + return R0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafR2LMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafR2LMultiplier.cs.meta new file mode 100644 index 00000000..c24e14fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/NafR2LMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb8d8a6fa271ca6468e6dc3ff48dcd7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/PreCompInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/PreCompInfo.cs new file mode 100644 index 00000000..56166a69 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/PreCompInfo.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Interface for classes storing precomputation data for multiplication + * algorithms. Used as a Memento (see GOF patterns) for + * WNafMultiplier. + */ + public interface PreCompInfo + { + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/PreCompInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/PreCompInfo.cs.meta new file mode 100644 index 00000000..e54f2948 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/PreCompInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7a90a54c7ae87ab48977a5a3aadc1d7c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ReferenceMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ReferenceMultiplier.cs new file mode 100644 index 00000000..75f69eb3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ReferenceMultiplier.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public class ReferenceMultiplier + : AbstractECMultiplier + { + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + return ECAlgorithms.ReferenceMultiply(p, k); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ReferenceMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ReferenceMultiplier.cs.meta new file mode 100644 index 00000000..06897aa9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ReferenceMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b109f12d37bd33e499ba67831b299f32 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ValidityPreCompInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ValidityPreCompInfo.cs new file mode 100644 index 00000000..50e4c544 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ValidityPreCompInfo.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + internal class ValidityPreCompInfo + : PreCompInfo + { + internal static readonly string PRECOMP_NAME = "bc_validity"; + + private bool failed = false; + private bool curveEquationPassed = false; + private bool orderPassed = false; + + internal bool HasFailed() + { + return failed; + } + + internal void ReportFailed() + { + failed = true; + } + + internal bool HasCurveEquationPassed() + { + return curveEquationPassed; + } + + internal void ReportCurveEquationPassed() + { + curveEquationPassed = true; + } + + internal bool HasOrderPassed() + { + return orderPassed; + } + + internal void ReportOrderPassed() + { + orderPassed = true; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ValidityPreCompInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ValidityPreCompInfo.cs.meta new file mode 100644 index 00000000..b7ba0633 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ValidityPreCompInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6849bd2beb67e854496f5d40924e901c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafL2RMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafL2RMultiplier.cs new file mode 100644 index 00000000..bdbfbfdc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafL2RMultiplier.cs @@ -0,0 +1,102 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Class implementing the WNAF (Window Non-Adjacent Form) multiplication + * algorithm. + */ + public class WNafL2RMultiplier + : AbstractECMultiplier + { + /** + * Multiplies this by an integer k using the + * Window NAF method. + * @param k The integer by which this is multiplied. + * @return A new ECPoint which equals this + * multiplied by k. + */ + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + // Clamp the window width in the range [2, 16] + int width = System.Math.Max(2, System.Math.Min(16, GetWindowSize(k.BitLength))); + + WNafPreCompInfo wnafPreCompInfo = WNafUtilities.Precompute(p, width, true); + ECPoint[] preComp = wnafPreCompInfo.PreComp; + ECPoint[] preCompNeg = wnafPreCompInfo.PreCompNeg; + + int[] wnaf = WNafUtilities.GenerateCompactWindowNaf(width, k); + + ECPoint R = p.Curve.Infinity; + + int i = wnaf.Length; + + /* + * NOTE: We try to optimize the first window using the precomputed points to substitute an + * addition for 2 or more doublings. + */ + if (i > 1) + { + int wi = wnaf[--i]; + int digit = wi >> 16, zeroes = wi & 0xFFFF; + + int n = System.Math.Abs(digit); + ECPoint[] table = digit < 0 ? preCompNeg : preComp; + + // Optimization can only be used for values in the lower half of the table + if ((n << 2) < (1 << width)) + { + int highest = LongArray.BitLengths[n]; + + // TODO Get addition/doubling cost ratio from curve and compare to 'scale' to see if worth substituting? + int scale = width - highest; + int lowBits = n ^ (1 << (highest - 1)); + + int i1 = ((1 << (width - 1)) - 1); + int i2 = (lowBits << scale) + 1; + R = table[i1 >> 1].Add(table[i2 >> 1]); + + zeroes -= scale; + + //Console.WriteLine("Optimized: 2^" + scale + " * " + n + " = " + i1 + " + " + i2); + } + else + { + R = table[n >> 1]; + } + + R = R.TimesPow2(zeroes); + } + + while (i > 0) + { + int wi = wnaf[--i]; + int digit = wi >> 16, zeroes = wi & 0xFFFF; + + int n = System.Math.Abs(digit); + ECPoint[] table = digit < 0 ? preCompNeg : preComp; + ECPoint r = table[n >> 1]; + + R = R.TwicePlus(r); + R = R.TimesPow2(zeroes); + } + + return R; + } + + /** + * Determine window width to use for a scalar multiplication of the given size. + * + * @param bits the bit-length of the scalar to multiply by + * @return the window size to use + */ + protected virtual int GetWindowSize(int bits) + { + return WNafUtilities.GetWindowSize(bits); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafL2RMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafL2RMultiplier.cs.meta new file mode 100644 index 00000000..1698d174 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafL2RMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e211e4a6b86d3f94fbf2b5ac9c113ad8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafPreCompInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafPreCompInfo.cs new file mode 100644 index 00000000..40a5e808 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafPreCompInfo.cs @@ -0,0 +1,50 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Class holding precomputation data for the WNAF (Window Non-Adjacent Form) + * algorithm. + */ + public class WNafPreCompInfo + : PreCompInfo + { + /** + * Array holding the precomputed ECPoints used for a Window + * NAF multiplication. + */ + protected ECPoint[] m_preComp = null; + + /** + * Array holding the negations of the precomputed ECPoints used + * for a Window NAF multiplication. + */ + protected ECPoint[] m_preCompNeg = null; + + /** + * Holds an ECPoint representing Twice(this). Used for the + * Window NAF multiplication to create or extend the precomputed values. + */ + protected ECPoint m_twice = null; + + public virtual ECPoint[] PreComp + { + get { return m_preComp; } + set { this.m_preComp = value; } + } + + public virtual ECPoint[] PreCompNeg + { + get { return m_preCompNeg; } + set { this.m_preCompNeg = value; } + } + + public virtual ECPoint Twice + { + get { return m_twice; } + set { this.m_twice = value; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafPreCompInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafPreCompInfo.cs.meta new file mode 100644 index 00000000..529c62d4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafPreCompInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c08f3ff220a86c0449f3d1d62cdfb47c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafUtilities.cs new file mode 100644 index 00000000..a85c11be --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafUtilities.cs @@ -0,0 +1,583 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public abstract class WNafUtilities + { + public static readonly string PRECOMP_NAME = "bc_wnaf"; + + private static readonly int[] DEFAULT_WINDOW_SIZE_CUTOFFS = new int[]{ 13, 41, 121, 337, 897, 2305 }; + + private static readonly ECPoint[] EMPTY_POINTS = new ECPoint[0]; + + public static int[] GenerateCompactNaf(BigInteger k) + { + if ((k.BitLength >> 16) != 0) + throw new ArgumentException("must have bitlength < 2^16", "k"); + if (k.SignValue == 0) + return Arrays.EmptyInts; + + BigInteger _3k = k.ShiftLeft(1).Add(k); + + int bits = _3k.BitLength; + int[] naf = new int[bits >> 1]; + + BigInteger diff = _3k.Xor(k); + + int highBit = bits - 1, length = 0, zeroes = 0; + for (int i = 1; i < highBit; ++i) + { + if (!diff.TestBit(i)) + { + ++zeroes; + continue; + } + + int digit = k.TestBit(i) ? -1 : 1; + naf[length++] = (digit << 16) | zeroes; + zeroes = 1; + ++i; + } + + naf[length++] = (1 << 16) | zeroes; + + if (naf.Length > length) + { + naf = Trim(naf, length); + } + + return naf; + } + + public static int[] GenerateCompactWindowNaf(int width, BigInteger k) + { + if (width == 2) + { + return GenerateCompactNaf(k); + } + + if (width < 2 || width > 16) + throw new ArgumentException("must be in the range [2, 16]", "width"); + if ((k.BitLength >> 16) != 0) + throw new ArgumentException("must have bitlength < 2^16", "k"); + if (k.SignValue == 0) + return Arrays.EmptyInts; + + int[] wnaf = new int[k.BitLength / width + 1]; + + // 2^width and a mask and sign bit set accordingly + int pow2 = 1 << width; + int mask = pow2 - 1; + int sign = pow2 >> 1; + + bool carry = false; + int length = 0, pos = 0; + + while (pos <= k.BitLength) + { + if (k.TestBit(pos) == carry) + { + ++pos; + continue; + } + + k = k.ShiftRight(pos); + + int digit = k.IntValue & mask; + if (carry) + { + ++digit; + } + + carry = (digit & sign) != 0; + if (carry) + { + digit -= pow2; + } + + int zeroes = length > 0 ? pos - 1 : pos; + wnaf[length++] = (digit << 16) | zeroes; + pos = width; + } + + // Reduce the WNAF array to its actual length + if (wnaf.Length > length) + { + wnaf = Trim(wnaf, length); + } + + return wnaf; + } + + public static byte[] GenerateJsf(BigInteger g, BigInteger h) + { + int digits = System.Math.Max(g.BitLength, h.BitLength) + 1; + byte[] jsf = new byte[digits]; + + BigInteger k0 = g, k1 = h; + int j = 0, d0 = 0, d1 = 0; + + int offset = 0; + while ((d0 | d1) != 0 || k0.BitLength > offset || k1.BitLength > offset) + { + int n0 = ((int)((uint)k0.IntValue >> offset) + d0) & 7; + int n1 = ((int)((uint)k1.IntValue >> offset) + d1) & 7; + + int u0 = n0 & 1; + if (u0 != 0) + { + u0 -= (n0 & 2); + if ((n0 + u0) == 4 && (n1 & 3) == 2) + { + u0 = -u0; + } + } + + int u1 = n1 & 1; + if (u1 != 0) + { + u1 -= (n1 & 2); + if ((n1 + u1) == 4 && (n0 & 3) == 2) + { + u1 = -u1; + } + } + + if ((d0 << 1) == 1 + u0) + { + d0 ^= 1; + } + if ((d1 << 1) == 1 + u1) + { + d1 ^= 1; + } + + if (++offset == 30) + { + offset = 0; + k0 = k0.ShiftRight(30); + k1 = k1.ShiftRight(30); + } + + jsf[j++] = (byte)((u0 << 4) | (u1 & 0xF)); + } + + // Reduce the JSF array to its actual length + if (jsf.Length > j) + { + jsf = Trim(jsf, j); + } + + return jsf; + } + + public static byte[] GenerateNaf(BigInteger k) + { + if (k.SignValue == 0) + return Arrays.EmptyBytes; + + BigInteger _3k = k.ShiftLeft(1).Add(k); + + int digits = _3k.BitLength - 1; + byte[] naf = new byte[digits]; + + BigInteger diff = _3k.Xor(k); + + for (int i = 1; i < digits; ++i) + { + if (diff.TestBit(i)) + { + naf[i - 1] = (byte)(k.TestBit(i) ? -1 : 1); + ++i; + } + } + + naf[digits - 1] = 1; + + return naf; + } + + /** + * Computes the Window NAF (non-adjacent Form) of an integer. + * @param width The width w of the Window NAF. The width is + * defined as the minimal number w, such that for any + * w consecutive digits in the resulting representation, at + * most one is non-zero. + * @param k The integer of which the Window NAF is computed. + * @return The Window NAF of the given width, such that the following holds: + * k = &sum;i=0l-1 ki2i + * , where the ki denote the elements of the + * returned byte[]. + */ + public static byte[] GenerateWindowNaf(int width, BigInteger k) + { + if (width == 2) + { + return GenerateNaf(k); + } + + if (width < 2 || width > 8) + throw new ArgumentException("must be in the range [2, 8]", "width"); + if (k.SignValue == 0) + return Arrays.EmptyBytes; + + byte[] wnaf = new byte[k.BitLength + 1]; + + // 2^width and a mask and sign bit set accordingly + int pow2 = 1 << width; + int mask = pow2 - 1; + int sign = pow2 >> 1; + + bool carry = false; + int length = 0, pos = 0; + + while (pos <= k.BitLength) + { + if (k.TestBit(pos) == carry) + { + ++pos; + continue; + } + + k = k.ShiftRight(pos); + + int digit = k.IntValue & mask; + if (carry) + { + ++digit; + } + + carry = (digit & sign) != 0; + if (carry) + { + digit -= pow2; + } + + length += (length > 0) ? pos - 1 : pos; + wnaf[length++] = (byte)digit; + pos = width; + } + + // Reduce the WNAF array to its actual length + if (wnaf.Length > length) + { + wnaf = Trim(wnaf, length); + } + + return wnaf; + } + + public static int GetNafWeight(BigInteger k) + { + if (k.SignValue == 0) + return 0; + + BigInteger _3k = k.ShiftLeft(1).Add(k); + BigInteger diff = _3k.Xor(k); + + return diff.BitCount; + } + + public static WNafPreCompInfo GetWNafPreCompInfo(ECPoint p) + { + return GetWNafPreCompInfo(p.Curve.GetPreCompInfo(p, PRECOMP_NAME)); + } + + public static WNafPreCompInfo GetWNafPreCompInfo(PreCompInfo preCompInfo) + { + return preCompInfo as WNafPreCompInfo; + } + + /** + * Determine window width to use for a scalar multiplication of the given size. + * + * @param bits the bit-length of the scalar to multiply by + * @return the window size to use + */ + public static int GetWindowSize(int bits) + { + return GetWindowSize(bits, DEFAULT_WINDOW_SIZE_CUTOFFS); + } + + /** + * Determine window width to use for a scalar multiplication of the given size. + * + * @param bits the bit-length of the scalar to multiply by + * @param windowSizeCutoffs a monotonically increasing list of bit sizes at which to increment the window width + * @return the window size to use + */ + public static int GetWindowSize(int bits, int[] windowSizeCutoffs) + { + int w = 0; + for (; w < windowSizeCutoffs.Length; ++w) + { + if (bits < windowSizeCutoffs[w]) + { + break; + } + } + return w + 2; + } + + public static ECPoint MapPointWithPrecomp(ECPoint p, int width, bool includeNegated, + ECPointMap pointMap) + { + ECCurve c = p.Curve; + WNafPreCompInfo wnafPreCompP = Precompute(p, width, includeNegated); + + ECPoint q = pointMap.Map(p); + c.Precompute(q, PRECOMP_NAME, new MapPointCallback(wnafPreCompP, includeNegated, pointMap)); + return q; + } + + public static WNafPreCompInfo Precompute(ECPoint p, int width, bool includeNegated) + { + return (WNafPreCompInfo)p.Curve.Precompute(p, PRECOMP_NAME, new WNafCallback(p, width, includeNegated)); + } + + private static byte[] Trim(byte[] a, int length) + { + byte[] result = new byte[length]; + Array.Copy(a, 0, result, 0, result.Length); + return result; + } + + private static int[] Trim(int[] a, int length) + { + int[] result = new int[length]; + Array.Copy(a, 0, result, 0, result.Length); + return result; + } + + private static ECPoint[] ResizeTable(ECPoint[] a, int length) + { + ECPoint[] result = new ECPoint[length]; + Array.Copy(a, 0, result, 0, a.Length); + return result; + } + + private class MapPointCallback + : IPreCompCallback + { + private readonly WNafPreCompInfo m_wnafPreCompP; + private readonly bool m_includeNegated; + private readonly ECPointMap m_pointMap; + + internal MapPointCallback(WNafPreCompInfo wnafPreCompP, bool includeNegated, ECPointMap pointMap) + { + this.m_wnafPreCompP = wnafPreCompP; + this.m_includeNegated = includeNegated; + this.m_pointMap = pointMap; + } + + public PreCompInfo Precompute(PreCompInfo existing) + { + WNafPreCompInfo result = new WNafPreCompInfo(); + + ECPoint twiceP = m_wnafPreCompP.Twice; + if (twiceP != null) + { + ECPoint twiceQ = m_pointMap.Map(twiceP); + result.Twice = twiceQ; + } + + ECPoint[] preCompP = m_wnafPreCompP.PreComp; + ECPoint[] preCompQ = new ECPoint[preCompP.Length]; + for (int i = 0; i < preCompP.Length; ++i) + { + preCompQ[i] = m_pointMap.Map(preCompP[i]); + } + result.PreComp = preCompQ; + + if (m_includeNegated) + { + ECPoint[] preCompNegQ = new ECPoint[preCompQ.Length]; + for (int i = 0; i < preCompNegQ.Length; ++i) + { + preCompNegQ[i] = preCompQ[i].Negate(); + } + result.PreCompNeg = preCompNegQ; + } + + return result; + } + } + + private class WNafCallback + : IPreCompCallback + { + private readonly ECPoint m_p; + private readonly int m_width; + private readonly bool m_includeNegated; + + internal WNafCallback(ECPoint p, int width, bool includeNegated) + { + this.m_p = p; + this.m_width = width; + this.m_includeNegated = includeNegated; + } + + public PreCompInfo Precompute(PreCompInfo existing) + { + WNafPreCompInfo existingWNaf = existing as WNafPreCompInfo; + + int reqPreCompLen = 1 << System.Math.Max(0, m_width - 2); + + if (CheckExisting(existingWNaf, reqPreCompLen, m_includeNegated)) + return existingWNaf; + + ECCurve c = m_p.Curve; + ECPoint[] preComp = null, preCompNeg = null; + ECPoint twiceP = null; + + if (existingWNaf != null) + { + preComp = existingWNaf.PreComp; + preCompNeg = existingWNaf.PreCompNeg; + twiceP = existingWNaf.Twice; + } + + int iniPreCompLen = 0; + if (preComp == null) + { + preComp = EMPTY_POINTS; + } + else + { + iniPreCompLen = preComp.Length; + } + + if (iniPreCompLen < reqPreCompLen) + { + preComp = WNafUtilities.ResizeTable(preComp, reqPreCompLen); + + if (reqPreCompLen == 1) + { + preComp[0] = m_p.Normalize(); + } + else + { + int curPreCompLen = iniPreCompLen; + if (curPreCompLen == 0) + { + preComp[0] = m_p; + curPreCompLen = 1; + } + + ECFieldElement iso = null; + + if (reqPreCompLen == 2) + { + preComp[1] = m_p.ThreeTimes(); + } + else + { + ECPoint isoTwiceP = twiceP, last = preComp[curPreCompLen - 1]; + if (isoTwiceP == null) + { + isoTwiceP = preComp[0].Twice(); + twiceP = isoTwiceP; + + /* + * For Fp curves with Jacobian projective coordinates, use a (quasi-)isomorphism + * where 'twiceP' is "affine", so that the subsequent additions are cheaper. This + * also requires scaling the initial point's X, Y coordinates, and reversing the + * isomorphism as part of the subsequent normalization. + * + * NOTE: The correctness of this optimization depends on: + * 1) additions do not use the curve's A, B coefficients. + * 2) no special cases (i.e. Q +/- Q) when calculating 1P, 3P, 5P, ... + */ + if (!twiceP.IsInfinity && ECAlgorithms.IsFpCurve(c) && c.FieldSize >= 64) + { + switch (c.CoordinateSystem) + { + case ECCurve.COORD_JACOBIAN: + case ECCurve.COORD_JACOBIAN_CHUDNOVSKY: + case ECCurve.COORD_JACOBIAN_MODIFIED: + { + iso = twiceP.GetZCoord(0); + isoTwiceP = c.CreatePoint(twiceP.XCoord.ToBigInteger(), + twiceP.YCoord.ToBigInteger()); + + ECFieldElement iso2 = iso.Square(), iso3 = iso2.Multiply(iso); + last = last.ScaleX(iso2).ScaleY(iso3); + + if (iniPreCompLen == 0) + { + preComp[0] = last; + } + break; + } + } + } + } + + while (curPreCompLen < reqPreCompLen) + { + /* + * Compute the new ECPoints for the precomputation array. The values 1, 3, + * 5, ..., 2^(width-1)-1 times p are computed + */ + preComp[curPreCompLen++] = last = last.Add(isoTwiceP); + } + } + + /* + * Having oft-used operands in affine form makes operations faster. + */ + c.NormalizeAll(preComp, iniPreCompLen, reqPreCompLen - iniPreCompLen, iso); + } + } + + if (m_includeNegated) + { + int pos; + if (preCompNeg == null) + { + pos = 0; + preCompNeg = new ECPoint[reqPreCompLen]; + } + else + { + pos = preCompNeg.Length; + if (pos < reqPreCompLen) + { + preCompNeg = WNafUtilities.ResizeTable(preCompNeg, reqPreCompLen); + } + } + + while (pos < reqPreCompLen) + { + preCompNeg[pos] = preComp[pos].Negate(); + ++pos; + } + } + + WNafPreCompInfo result = new WNafPreCompInfo(); + result.PreComp = preComp; + result.PreCompNeg = preCompNeg; + result.Twice = twiceP; + return result; + } + + private bool CheckExisting(WNafPreCompInfo existingWNaf, int reqPreCompLen, bool includeNegated) + { + return existingWNaf != null + && CheckTable(existingWNaf.PreComp, reqPreCompLen) + && (!includeNegated || CheckTable(existingWNaf.PreCompNeg, reqPreCompLen)); + } + + private bool CheckTable(ECPoint[] table, int reqLen) + { + return table != null && table.Length >= reqLen; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafUtilities.cs.meta new file mode 100644 index 00000000..8a572abc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WNafUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3572ce73eb041d6429dc80a09390f1e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafMultiplier.cs new file mode 100644 index 00000000..1736cf28 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafMultiplier.cs @@ -0,0 +1,142 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Class implementing the WTNAF (Window + * τ-adic Non-Adjacent Form) algorithm. + */ + public class WTauNafMultiplier + : AbstractECMultiplier + { + // TODO Create WTauNafUtilities class and move various functionality into it + internal static readonly string PRECOMP_NAME = "bc_wtnaf"; + + /** + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + * by k using the reduced τ-adic NAF (RTNAF) + * method. + * @param p The AbstractF2mPoint to multiply. + * @param k The integer by which to multiply k. + * @return p multiplied by k. + */ + protected override ECPoint MultiplyPositive(ECPoint point, BigInteger k) + { + if (!(point is AbstractF2mPoint)) + throw new ArgumentException("Only AbstractF2mPoint can be used in WTauNafMultiplier"); + + AbstractF2mPoint p = (AbstractF2mPoint)point; + AbstractF2mCurve curve = (AbstractF2mCurve)p.Curve; + int m = curve.FieldSize; + sbyte a = (sbyte)curve.A.ToBigInteger().IntValue; + sbyte mu = Tnaf.GetMu(a); + BigInteger[] s = curve.GetSi(); + + ZTauElement rho = Tnaf.PartModReduction(k, m, a, s, mu, (sbyte)10); + + return MultiplyWTnaf(p, rho, a, mu); + } + + /** + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + * by an element λ of Z[τ] using + * the τ-adic NAF (TNAF) method. + * @param p The AbstractF2mPoint to multiply. + * @param lambda The element λ of + * Z[τ] of which to compute the + * [τ]-adic NAF. + * @return p multiplied by λ. + */ + private AbstractF2mPoint MultiplyWTnaf(AbstractF2mPoint p, ZTauElement lambda, + sbyte a, sbyte mu) + { + ZTauElement[] alpha = (a == 0) ? Tnaf.Alpha0 : Tnaf.Alpha1; + + BigInteger tw = Tnaf.GetTw(mu, Tnaf.Width); + + sbyte[]u = Tnaf.TauAdicWNaf(mu, lambda, Tnaf.Width, + BigInteger.ValueOf(Tnaf.Pow2Width), tw, alpha); + + return MultiplyFromWTnaf(p, u); + } + + /** + * Multiplies a {@link org.bouncycastle.math.ec.AbstractF2mPoint AbstractF2mPoint} + * by an element λ of Z[τ] + * using the window τ-adic NAF (TNAF) method, given the + * WTNAF of λ. + * @param p The AbstractF2mPoint to multiply. + * @param u The the WTNAF of λ.. + * @return λ * p + */ + private static AbstractF2mPoint MultiplyFromWTnaf(AbstractF2mPoint p, sbyte[] u) + { + AbstractF2mCurve curve = (AbstractF2mCurve)p.Curve; + sbyte a = (sbyte)curve.A.ToBigInteger().IntValue; + + WTauNafCallback callback = new WTauNafCallback(p, a); + WTauNafPreCompInfo preCompInfo = (WTauNafPreCompInfo)curve.Precompute(p, PRECOMP_NAME, callback); + AbstractF2mPoint[] pu = preCompInfo.PreComp; + + // TODO Include negations in precomp (optionally) and use from here + AbstractF2mPoint[] puNeg = new AbstractF2mPoint[pu.Length]; + for (int i = 0; i < pu.Length; ++i) + { + puNeg[i] = (AbstractF2mPoint)pu[i].Negate(); + } + + + // q = infinity + AbstractF2mPoint q = (AbstractF2mPoint) p.Curve.Infinity; + + int tauCount = 0; + for (int i = u.Length - 1; i >= 0; i--) + { + ++tauCount; + int ui = u[i]; + if (ui != 0) + { + q = q.TauPow(tauCount); + tauCount = 0; + + ECPoint x = ui > 0 ? pu[ui >> 1] : puNeg[(-ui) >> 1]; + q = (AbstractF2mPoint)q.Add(x); + } + } + if (tauCount > 0) + { + q = q.TauPow(tauCount); + } + return q; + } + + private class WTauNafCallback + : IPreCompCallback + { + private readonly AbstractF2mPoint m_p; + private readonly sbyte m_a; + + internal WTauNafCallback(AbstractF2mPoint p, sbyte a) + { + this.m_p = p; + this.m_a = a; + } + + public PreCompInfo Precompute(PreCompInfo existing) + { + if (existing is WTauNafPreCompInfo) + return existing; + + WTauNafPreCompInfo result = new WTauNafPreCompInfo(); + result.PreComp = Tnaf.GetPreComp(m_p, m_a); + return result; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafMultiplier.cs.meta new file mode 100644 index 00000000..0c8241fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2139991248cc7e04980d36d65b1284b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafPreCompInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafPreCompInfo.cs new file mode 100644 index 00000000..1a454119 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafPreCompInfo.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + /** + * Class holding precomputation data for the WTNAF (Window + * τ-adic Non-Adjacent Form) algorithm. + */ + public class WTauNafPreCompInfo + : PreCompInfo + { + /** + * Array holding the precomputed AbstractF2mPoints used for the + * WTNAF multiplication in + * {@link org.bouncycastle.math.ec.multiplier.WTauNafMultiplier.multiply() + * WTauNafMultiplier.multiply()}. + */ + protected AbstractF2mPoint[] m_preComp; + + public virtual AbstractF2mPoint[] PreComp + { + get { return m_preComp; } + set { this.m_preComp = value; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafPreCompInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafPreCompInfo.cs.meta new file mode 100644 index 00000000..69e71301 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/WTauNafPreCompInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6adae98f46df50549b03088b3c22b378 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs new file mode 100644 index 00000000..2255e206 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public class ZSignedDigitL2RMultiplier + : AbstractECMultiplier + { + /** + * 'Zeroless' Signed Digit Left-to-Right. + */ + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + ECPoint addP = p.Normalize(), subP = addP.Negate(); + + ECPoint R0 = addP; + + int n = k.BitLength; + int s = k.GetLowestSetBit(); + + int i = n; + while (--i > s) + { + R0 = R0.TwicePlus(k.TestBit(i) ? addP : subP); + } + + R0 = R0.TimesPow2(s); + + return R0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs.meta new file mode 100644 index 00000000..3a2a2d69 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitL2RMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ab628b004608984438c6195c4f49fa4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs new file mode 100644 index 00000000..266574f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs @@ -0,0 +1,34 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Multiplier +{ + public class ZSignedDigitR2LMultiplier + : AbstractECMultiplier + { + /** + * 'Zeroless' Signed Digit Right-to-Left. + */ + protected override ECPoint MultiplyPositive(ECPoint p, BigInteger k) + { + ECPoint R0 = p.Curve.Infinity, R1 = p; + + int n = k.BitLength; + int s = k.GetLowestSetBit(); + + R1 = R1.TimesPow2(s); + + int i = s; + while (++i < n) + { + R0 = R0.Add(k.TestBit(i) ? R1 : R1.Negate()); + R1 = R1.Twice(); + } + + R0 = R0.Add(R1); + + return R0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs.meta new file mode 100644 index 00000000..27f8f03e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/multiplier/ZSignedDigitR2LMultiplier.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fcf00b2a9292b914db477ece334a2db0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748.meta new file mode 100644 index 00000000..8d2d6814 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 16749723e84b3bd4ca4ba38c35399291 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519.cs new file mode 100644 index 00000000..cc342656 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519.cs @@ -0,0 +1,163 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748 +{ + public abstract class X25519 + { + public const int PointSize = 32; + public const int ScalarSize = 32; + + private const int C_A = 486662; + private const int C_A24 = (C_A + 2)/4; + + //private static readonly int[] SqrtNeg486664 = { 0x03457E06, 0x03812ABF, 0x01A82CC6, 0x028A5BE8, 0x018B43A7, + // 0x03FC4F7E, 0x02C23700, 0x006BBD27, 0x03A30500, 0x001E4DDB }; + + public static bool CalculateAgreement(byte[] k, int kOff, byte[] u, int uOff, byte[] r, int rOff) + { + ScalarMult(k, kOff, u, uOff, r, rOff); + return !Arrays.AreAllZeroes(r, rOff, PointSize); + } + + private static uint Decode32(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + n |= (uint)bs[++off] << 16; + n |= (uint)bs[++off] << 24; + return n; + } + + private static void DecodeScalar(byte[] k, int kOff, uint[] n) + { + for (int i = 0; i < 8; ++i) + { + n[i] = Decode32(k, kOff + i * 4); + } + + n[0] &= 0xFFFFFFF8U; + n[7] &= 0x7FFFFFFFU; + n[7] |= 0x40000000U; + } + + public static void GeneratePrivateKey(SecureRandom random, byte[] k) + { + random.NextBytes(k); + + k[0] &= 0xF8; + k[ScalarSize - 1] &= 0x7F; + k[ScalarSize - 1] |= 0x40; + } + + public static void GeneratePublicKey(byte[] k, int kOff, byte[] r, int rOff) + { + ScalarMultBase(k, kOff, r, rOff); + } + + private static void PointDouble(int[] x, int[] z) + { + int[] A = X25519Field.Create(); + int[] B = X25519Field.Create(); + + X25519Field.Apm(x, z, A, B); + X25519Field.Sqr(A, A); + X25519Field.Sqr(B, B); + X25519Field.Mul(A, B, x); + X25519Field.Sub(A, B, A); + X25519Field.Mul(A, C_A24, z); + X25519Field.Add(z, B, z); + X25519Field.Mul(z, A, z); + } + + public static void Precompute() + { + Ed25519.Precompute(); + } + + public static void ScalarMult(byte[] k, int kOff, byte[] u, int uOff, byte[] r, int rOff) + { + uint[] n = new uint[8]; DecodeScalar(k, kOff, n); + + int[] x1 = X25519Field.Create(); X25519Field.Decode(u, uOff, x1); + int[] x2 = X25519Field.Create(); X25519Field.Copy(x1, 0, x2, 0); + int[] z2 = X25519Field.Create(); z2[0] = 1; + int[] x3 = X25519Field.Create(); x3[0] = 1; + int[] z3 = X25519Field.Create(); + + int[] t1 = X25519Field.Create(); + int[] t2 = X25519Field.Create(); + + Debug.Assert(n[7] >> 30 == 1U); + + int bit = 254, swap = 1; + do + { + X25519Field.Apm(x3, z3, t1, x3); + X25519Field.Apm(x2, z2, z3, x2); + X25519Field.Mul(t1, x2, t1); + X25519Field.Mul(x3, z3, x3); + X25519Field.Sqr(z3, z3); + X25519Field.Sqr(x2, x2); + + X25519Field.Sub(z3, x2, t2); + X25519Field.Mul(t2, C_A24, z2); + X25519Field.Add(z2, x2, z2); + X25519Field.Mul(z2, t2, z2); + X25519Field.Mul(x2, z3, x2); + + X25519Field.Apm(t1, x3, x3, z3); + X25519Field.Sqr(x3, x3); + X25519Field.Sqr(z3, z3); + X25519Field.Mul(z3, x1, z3); + + --bit; + + int word = bit >> 5, shift = bit & 0x1F; + int kt = (int)(n[word] >> shift) & 1; + swap ^= kt; + X25519Field.CSwap(swap, x2, x3); + X25519Field.CSwap(swap, z2, z3); + swap = kt; + } + while (bit >= 3); + + Debug.Assert(swap == 0); + + for (int i = 0; i < 3; ++i) + { + PointDouble(x2, z2); + } + + X25519Field.Inv(z2, z2); + X25519Field.Mul(x2, z2, x2); + + X25519Field.Normalize(x2); + X25519Field.Encode(x2, r, rOff); + } + + public static void ScalarMultBase(byte[] k, int kOff, byte[] r, int rOff) + { + int[] y = X25519Field.Create(); + int[] z = X25519Field.Create(); + + Ed25519.ScalarMultBaseYZ(k, kOff, y, z); + + X25519Field.Apm(z, y, y, z); + + X25519Field.Inv(z, z); + X25519Field.Mul(y, z, y); + + X25519Field.Normalize(y); + X25519Field.Encode(y, r, rOff); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519.cs.meta new file mode 100644 index 00000000..0ad0252d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dcc98f9e9116df14b8c728485a48fd94 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519Field.cs new file mode 100644 index 00000000..b9b53975 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519Field.cs @@ -0,0 +1,643 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748 +{ + public abstract class X25519Field + { + public const int Size = 10; + + private const int M24 = 0x00FFFFFF; + private const int M25 = 0x01FFFFFF; + private const int M26 = 0x03FFFFFF; + + private static readonly int[] RootNegOne = { 0x020EA0B0, 0x0386C9D2, 0x00478C4E, 0x0035697F, 0x005E8630, + 0x01FBD7A7, 0x0340264F, 0x01F0B2B4, 0x00027E0E, 0x00570649 }; + + private X25519Field() {} + + public static void Add(int[] x, int[] y, int[] z) + { + for (int i = 0; i < Size; ++i) + { + z[i] = x[i] + y[i]; + } + } + + public static void AddOne(int[] z) + { + z[0] += 1; + } + + public static void AddOne(int[] z, int zOff) + { + z[zOff] += 1; + } + + public static void Apm(int[] x, int[] y, int[] zp, int[] zm) + { + for (int i = 0; i < Size; ++i) + { + int xi = x[i], yi = y[i]; + zp[i] = xi + yi; + zm[i] = xi - yi; + } + } + + public static void Carry(int[] z) + { + int z0 = z[0], z1 = z[1], z2 = z[2], z3 = z[3], z4 = z[4]; + int z5 = z[5], z6 = z[6], z7 = z[7], z8 = z[8], z9 = z[9]; + + z3 += (z2 >> 25); z2 &= M25; + z5 += (z4 >> 25); z4 &= M25; + z8 += (z7 >> 25); z7 &= M25; + //z0 += (z9 >> 24) * 19; z9 &= M24; + z0 += (z9 >> 25) * 38; z9 &= M25; + + z1 += (z0 >> 26); z0 &= M26; + z6 += (z5 >> 26); z5 &= M26; + + z2 += (z1 >> 26); z1 &= M26; + z4 += (z3 >> 26); z3 &= M26; + z7 += (z6 >> 26); z6 &= M26; + z9 += (z8 >> 26); z8 &= M26; + + z[0] = z0; z[1] = z1; z[2] = z2; z[3] = z3; z[4] = z4; + z[5] = z5; z[6] = z6; z[7] = z7; z[8] = z8; z[9] = z9; + } + + public static void CNegate(int negate, int[] z) + { + Debug.Assert(negate >> 1 == 0); + + int mask = 0 - negate; + for (int i = 0; i < Size; ++i) + { + z[i] = (z[i] ^ mask) - mask; + } + } + + public static void Copy(int[] x, int xOff, int[] z, int zOff) + { + for (int i = 0; i < Size; ++i) + { + z[zOff + i] = x[xOff + i]; + } + } + + public static int[] Create() + { + return new int[Size]; + } + + public static int[] CreateTable(int n) + { + return new int[Size * n]; + } + + public static void CSwap(int swap, int[] a, int[] b) + { + Debug.Assert(swap >> 1 == 0); + Debug.Assert(a != b); + + int mask = 0 - swap; + for (int i = 0; i < Size; ++i) + { + int ai = a[i], bi = b[i]; + int dummy = mask & (ai ^ bi); + a[i] = ai ^ dummy; + b[i] = bi ^ dummy; + } + } + + public static void Decode(byte[] x, int xOff, int[] z) + { + Decode128(x, xOff, z, 0); + Decode128(x, xOff + 16, z, 5); + z[9] &= M24; + } + + private static void Decode128(byte[] bs, int off, int[] z, int zOff) + { + uint t0 = Decode32(bs, off + 0); + uint t1 = Decode32(bs, off + 4); + uint t2 = Decode32(bs, off + 8); + uint t3 = Decode32(bs, off + 12); + + z[zOff + 0] = (int)t0 & M26; + z[zOff + 1] = (int)((t1 << 6) | (t0 >> 26)) & M26; + z[zOff + 2] = (int)((t2 << 12) | (t1 >> 20)) & M25; + z[zOff + 3] = (int)((t3 << 19) | (t2 >> 13)) & M26; + z[zOff + 4] = (int)(t3 >> 7); + } + + private static uint Decode32(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + n |= (uint)bs[++off] << 16; + n |= (uint)bs[++off] << 24; + return n; + } + + public static void Encode(int[] x, byte[] z, int zOff) + { + Encode128(x, 0, z, zOff); + Encode128(x, 5, z, zOff + 16); + } + + private static void Encode128(int[] x, int xOff, byte[] bs, int off) + { + uint x0 = (uint)x[xOff + 0], x1 = (uint)x[xOff + 1], x2 = (uint)x[xOff + 2]; + uint x3 = (uint)x[xOff + 3], x4 = (uint)x[xOff + 4]; + + uint t0 = x0 | (x1 << 26); Encode32(t0, bs, off + 0); + uint t1 = (x1 >> 6) | (x2 << 20); Encode32(t1, bs, off + 4); + uint t2 = (x2 >> 12) | (x3 << 13); Encode32(t2, bs, off + 8); + uint t3 = (x3 >> 19) | (x4 << 7); Encode32(t3, bs, off + 12); + } + + private static void Encode32(uint n, byte[] bs, int off) + { + bs[ off] = (byte)(n ); + bs[++off] = (byte)(n >> 8); + bs[++off] = (byte)(n >> 16); + bs[++off] = (byte)(n >> 24); + } + + public static void Inv(int[] x, int[] z) + { + // z = x^(p-2) = x^7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB + // (250 1s) (1 0s) (1 1s) (1 0s) (2 1s) + // Addition chain: [1] [2] 3 5 10 15 25 50 75 125 [250] + + int[] x2 = Create(); + int[] t = Create(); + PowPm5d8(x, x2, t); + Sqr(t, 3, t); + Mul(t, x2, z); + } + + public static bool IsZeroVar(int[] x) + { + int d = 0; + for (int i = 0; i < Size; ++i) + { + d |= x[i]; + } + return d == 0; + } + + public static void Mul(int[] x, int y, int[] z) + { + int x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3], x4 = x[4]; + int x5 = x[5], x6 = x[6], x7 = x[7], x8 = x[8], x9 = x[9]; + long c0, c1, c2, c3; + + c0 = (long)x2 * y; x2 = (int)c0 & M25; c0 >>= 25; + c1 = (long)x4 * y; x4 = (int)c1 & M25; c1 >>= 25; + c2 = (long)x7 * y; x7 = (int)c2 & M25; c2 >>= 25; + //c3 = (long)x9 * y; x9 = (int)c3 & M24; c3 >>= 24; + //c3 *= 19; + c3 = (long)x9 * y; x9 = (int)c3 & M25; c3 >>= 25; + c3 *= 38; + + c3 += (long)x0 * y; z[0] = (int)c3 & M26; c3 >>= 26; + c1 += (long)x5 * y; z[5] = (int)c1 & M26; c1 >>= 26; + + c3 += (long)x1 * y; z[1] = (int)c3 & M26; c3 >>= 26; + c0 += (long)x3 * y; z[3] = (int)c0 & M26; c0 >>= 26; + c1 += (long)x6 * y; z[6] = (int)c1 & M26; c1 >>= 26; + c2 += (long)x8 * y; z[8] = (int)c2 & M26; c2 >>= 26; + + z[2] = x2 + (int)c3; + z[4] = x4 + (int)c0; + z[7] = x7 + (int)c1; + z[9] = x9 + (int)c2; + } + + public static void Mul(int[] x, int[] y, int[] z) + { + int x0 = x[0], y0 = y[0]; + int x1 = x[1], y1 = y[1]; + int x2 = x[2], y2 = y[2]; + int x3 = x[3], y3 = y[3]; + int x4 = x[4], y4 = y[4]; + + int u0 = x[5], v0 = y[5]; + int u1 = x[6], v1 = y[6]; + int u2 = x[7], v2 = y[7]; + int u3 = x[8], v3 = y[8]; + int u4 = x[9], v4 = y[9]; + + long a0 = (long)x0 * y0; + long a1 = (long)x0 * y1 + + (long)x1 * y0; + long a2 = (long)x0 * y2 + + (long)x1 * y1 + + (long)x2 * y0; + long a3 = (long)x1 * y2 + + (long)x2 * y1; + a3 <<= 1; + a3 += (long)x0 * y3 + + (long)x3 * y0; + long a4 = (long)x2 * y2; + a4 <<= 1; + a4 += (long)x0 * y4 + + (long)x1 * y3 + + (long)x3 * y1 + + (long)x4 * y0; + long a5 = (long)x1 * y4 + + (long)x2 * y3 + + (long)x3 * y2 + + (long)x4 * y1; + a5 <<= 1; + long a6 = (long)x2 * y4 + + (long)x4 * y2; + a6 <<= 1; + a6 += (long)x3 * y3; + long a7 = (long)x3 * y4 + + (long)x4 * y3; + long a8 = (long)x4 * y4; + a8 <<= 1; + + long b0 = (long)u0 * v0; + long b1 = (long)u0 * v1 + + (long)u1 * v0; + long b2 = (long)u0 * v2 + + (long)u1 * v1 + + (long)u2 * v0; + long b3 = (long)u1 * v2 + + (long)u2 * v1; + b3 <<= 1; + b3 += (long)u0 * v3 + + (long)u3 * v0; + long b4 = (long)u2 * v2; + b4 <<= 1; + b4 += (long)u0 * v4 + + (long)u1 * v3 + + (long)u3 * v1 + + (long)u4 * v0; + long b5 = (long)u1 * v4 + + (long)u2 * v3 + + (long)u3 * v2 + + (long)u4 * v1; + //b5 <<= 1; + long b6 = (long)u2 * v4 + + (long)u4 * v2; + b6 <<= 1; + b6 += (long)u3 * v3; + long b7 = (long)u3 * v4 + + (long)u4 * v3; + long b8 = (long)u4 * v4; + //b8 <<= 1; + + a0 -= b5 * 76; + a1 -= b6 * 38; + a2 -= b7 * 38; + a3 -= b8 * 76; + + a5 -= b0; + a6 -= b1; + a7 -= b2; + a8 -= b3; + //long a9 = -b4; + + x0 += u0; y0 += v0; + x1 += u1; y1 += v1; + x2 += u2; y2 += v2; + x3 += u3; y3 += v3; + x4 += u4; y4 += v4; + + long c0 = (long)x0 * y0; + long c1 = (long)x0 * y1 + + (long)x1 * y0; + long c2 = (long)x0 * y2 + + (long)x1 * y1 + + (long)x2 * y0; + long c3 = (long)x1 * y2 + + (long)x2 * y1; + c3 <<= 1; + c3 += (long)x0 * y3 + + (long)x3 * y0; + long c4 = (long)x2 * y2; + c4 <<= 1; + c4 += (long)x0 * y4 + + (long)x1 * y3 + + (long)x3 * y1 + + (long)x4 * y0; + long c5 = (long)x1 * y4 + + (long)x2 * y3 + + (long)x3 * y2 + + (long)x4 * y1; + c5 <<= 1; + long c6 = (long)x2 * y4 + + (long)x4 * y2; + c6 <<= 1; + c6 += (long)x3 * y3; + long c7 = (long)x3 * y4 + + (long)x4 * y3; + long c8 = (long)x4 * y4; + c8 <<= 1; + + int z8, z9; + long t; + + t = a8 + (c3 - a3); + z8 = (int)t & M26; t >>= 26; + //t += a9 + (c4 - a4); + t += (c4 - a4) - b4; + //z9 = (int)t & M24; t >>= 24; + //t = a0 + (t + ((c5 - a5) << 1)) * 19; + z9 = (int)t & M25; t >>= 25; + t = a0 + (t + c5 - a5) * 38; + z[0] = (int)t & M26; t >>= 26; + t += a1 + (c6 - a6) * 38; + z[1] = (int)t & M26; t >>= 26; + t += a2 + (c7 - a7) * 38; + z[2] = (int)t & M25; t >>= 25; + t += a3 + (c8 - a8) * 38; + z[3] = (int)t & M26; t >>= 26; + //t += a4 - a9 * 38; + t += a4 + b4 * 38; + z[4] = (int)t & M25; t >>= 25; + t += a5 + (c0 - a0); + z[5] = (int)t & M26; t >>= 26; + t += a6 + (c1 - a1); + z[6] = (int)t & M26; t >>= 26; + t += a7 + (c2 - a2); + z[7] = (int)t & M25; t >>= 25; + t += z8; + z[8] = (int)t & M26; t >>= 26; + z[9] = z9 + (int)t; + } + + public static void Negate(int[] x, int[] z) + { + for (int i = 0; i < Size; ++i) + { + z[i] = -x[i]; + } + } + + public static void Normalize(int[] z) + { + int x = (z[9] >> 23) & 1; + Reduce(z, x); + Reduce(z, -x); + Debug.Assert(z[9] >> 24 == 0); + } + + public static void One(int[] z) + { + z[0] = 1; + for (int i = 1; i < Size; ++i) + { + z[i] = 0; + } + } + + private static void PowPm5d8(int[] x, int[] rx2, int[] rz) + { + // z = x^((p-5)/8) = x^FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD + // (250 1s) (1 0s) (1 1s) + // Addition chain: [1] 2 3 5 10 15 25 50 75 125 [250] + + int[] x2 = rx2; Sqr(x, x2); Mul(x, x2, x2); + int[] x3 = Create(); Sqr(x2, x3); Mul(x, x3, x3); + int[] x5 = x3; Sqr(x3, 2, x5); Mul(x2, x5, x5); + int[] x10 = Create(); Sqr(x5, 5, x10); Mul(x5, x10, x10); + int[] x15 = Create(); Sqr(x10, 5, x15); Mul(x5, x15, x15); + int[] x25 = x5; Sqr(x15, 10, x25); Mul(x10, x25, x25); + int[] x50 = x10; Sqr(x25, 25, x50); Mul(x25, x50, x50); + int[] x75 = x15; Sqr(x50, 25, x75); Mul(x25, x75, x75); + int[] x125 = x25; Sqr(x75, 50, x125); Mul(x50, x125, x125); + int[] x250 = x50; Sqr(x125, 125, x250); Mul(x125, x250, x250); + + int[] t = x125; + Sqr(x250, 2, t); + Mul(t, x, rz); + } + + private static void Reduce(int[] z, int c) + { + int z9 = z[9], t = z9; + z9 = t & M24; t >>= 24; + t += c; + t *= 19; + t += z[0]; z[0] = t & M26; t >>= 26; + t += z[1]; z[1] = t & M26; t >>= 26; + t += z[2]; z[2] = t & M25; t >>= 25; + t += z[3]; z[3] = t & M26; t >>= 26; + t += z[4]; z[4] = t & M25; t >>= 25; + t += z[5]; z[5] = t & M26; t >>= 26; + t += z[6]; z[6] = t & M26; t >>= 26; + t += z[7]; z[7] = t & M25; t >>= 25; + t += z[8]; z[8] = t & M26; t >>= 26; + t += z9; z[9] = t; + } + + public static void Sqr(int[] x, int[] z) + { + int x0 = x[0]; + int x1 = x[1]; + int x2 = x[2]; + int x3 = x[3]; + int x4 = x[4]; + + int u0 = x[5]; + int u1 = x[6]; + int u2 = x[7]; + int u3 = x[8]; + int u4 = x[9]; + + int x1_2 = x1 * 2; + int x2_2 = x2 * 2; + int x3_2 = x3 * 2; + int x4_2 = x4 * 2; + + long a0 = (long)x0 * x0; + long a1 = (long)x0 * x1_2; + long a2 = (long)x0 * x2_2 + + (long)x1 * x1; + long a3 = (long)x1_2 * x2_2 + + (long)x0 * x3_2; + long a4 = (long)x2 * x2_2 + + (long)x0 * x4_2 + + (long)x1 * x3_2; + long a5 = (long)x1_2 * x4_2 + + (long)x2_2 * x3_2; + long a6 = (long)x2_2 * x4_2 + + (long)x3 * x3; + long a7 = (long)x3 * x4_2; + long a8 = (long)x4 * x4_2; + + int u1_2 = u1 * 2; + int u2_2 = u2 * 2; + int u3_2 = u3 * 2; + int u4_2 = u4 * 2; + + long b0 = (long)u0 * u0; + long b1 = (long)u0 * u1_2; + long b2 = (long)u0 * u2_2 + + (long)u1 * u1; + long b3 = (long)u1_2 * u2_2 + + (long)u0 * u3_2; + long b4 = (long)u2 * u2_2 + + (long)u0 * u4_2 + + (long)u1 * u3_2; + long b5 = (long)u1_2 * u4_2 + + (long)u2_2 * u3_2; + long b6 = (long)u2_2 * u4_2 + + (long)u3 * u3; + long b7 = (long)u3 * u4_2; + long b8 = (long)u4 * u4_2; + + a0 -= b5 * 38; + a1 -= b6 * 38; + a2 -= b7 * 38; + a3 -= b8 * 38; + + a5 -= b0; + a6 -= b1; + a7 -= b2; + a8 -= b3; + //long a9 = -b4; + + x0 += u0; + x1 += u1; + x2 += u2; + x3 += u3; + x4 += u4; + + x1_2 = x1 * 2; + x2_2 = x2 * 2; + x3_2 = x3 * 2; + x4_2 = x4 * 2; + + long c0 = (long)x0 * x0; + long c1 = (long)x0 * x1_2; + long c2 = (long)x0 * x2_2 + + (long)x1 * x1; + long c3 = (long)x1_2 * x2_2 + + (long)x0 * x3_2; + long c4 = (long)x2 * x2_2 + + (long)x0 * x4_2 + + (long)x1 * x3_2; + long c5 = (long)x1_2 * x4_2 + + (long)x2_2 * x3_2; + long c6 = (long)x2_2 * x4_2 + + (long)x3 * x3; + long c7 = (long)x3 * x4_2; + long c8 = (long)x4 * x4_2; + + int z8, z9; + long t; + + t = a8 + (c3 - a3); + z8 = (int)t & M26; t >>= 26; + //t += a9 + (c4 - a4); + t += (c4 - a4) - b4; + //z9 = (int)t & M24; t >>= 24; + //t = a0 + (t + ((c5 - a5) << 1)) * 19; + z9 = (int)t & M25; t >>= 25; + t = a0 + (t + c5 - a5) * 38; + z[0] = (int)t & M26; t >>= 26; + t += a1 + (c6 - a6) * 38; + z[1] = (int)t & M26; t >>= 26; + t += a2 + (c7 - a7) * 38; + z[2] = (int)t & M25; t >>= 25; + t += a3 + (c8 - a8) * 38; + z[3] = (int)t & M26; t >>= 26; + //t += a4 - a9 * 38; + t += a4 + b4 * 38; + z[4] = (int)t & M25; t >>= 25; + t += a5 + (c0 - a0); + z[5] = (int)t & M26; t >>= 26; + t += a6 + (c1 - a1); + z[6] = (int)t & M26; t >>= 26; + t += a7 + (c2 - a2); + z[7] = (int)t & M25; t >>= 25; + t += z8; + z[8] = (int)t & M26; t >>= 26; + z[9] = z9 + (int)t; + } + + public static void Sqr(int[] x, int n, int[] z) + { + Debug.Assert(n > 0); + + Sqr(x, z); + + while (--n > 0) + { + Sqr(z, z); + } + } + + public static bool SqrtRatioVar(int[] u, int[] v, int[] z) + { + int[] uv3 = Create(); + int[] uv7 = Create(); + + Mul(u, v, uv3); + Sqr(v, uv7); + Mul(uv3, uv7, uv3); + Sqr(uv7, uv7); + Mul(uv7, uv3, uv7); + + int[] t = Create(); + int[] x = Create(); + PowPm5d8(uv7, t, x); + Mul(x, uv3, x); + + int[] vx2 = Create(); + Sqr(x, vx2); + Mul(vx2, v, vx2); + + Sub(vx2, u, t); + Normalize(t); + if (IsZeroVar(t)) + { + Copy(x, 0, z, 0); + return true; + } + + Add(vx2, u, t); + Normalize(t); + if (IsZeroVar(t)) + { + Mul(x, RootNegOne, z); + return true; + } + + return false; + } + + public static void Sub(int[] x, int[] y, int[] z) + { + for (int i = 0; i < Size; ++i) + { + z[i] = x[i] - y[i]; + } + } + + public static void SubOne(int[] z) + { + z[0] -= 1; + } + + public static void Zero(int[] z) + { + for (int i = 0; i < Size; ++i) + { + z[i] = 0; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519Field.cs.meta new file mode 100644 index 00000000..ee727a5e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X25519Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 768a1c272feadb543a7275f3b5adfefa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448.cs new file mode 100644 index 00000000..d9191180 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448.cs @@ -0,0 +1,170 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748 +{ + public abstract class X448 + { + public const int PointSize = 56; + public const int ScalarSize = 56; + + private const uint C_A = 156326; + private const uint C_A24 = (C_A + 2)/4; + + //private static readonly uint[] Sqrt156324 = { 0x0551B193U, 0x07A21E17U, 0x0E635AD3U, 0x00812ABBU, 0x025B3F99U, 0x01605224U, + // 0x0AF8CB32U, 0x0D2E7D68U, 0x06BA50FDU, 0x08E55693U, 0x0CB08EB4U, 0x02ABEBC1U, 0x051BA0BBU, 0x02F8812EU, 0x0829B611U, + // 0x0BA4D3A0U }; + + public static bool CalculateAgreement(byte[] k, int kOff, byte[] u, int uOff, byte[] r, int rOff) + { + ScalarMult(k, kOff, u, uOff, r, rOff); + return !Arrays.AreAllZeroes(r, rOff, PointSize); + } + + private static uint Decode32(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + n |= (uint)bs[++off] << 16; + n |= (uint)bs[++off] << 24; + return n; + } + + private static void DecodeScalar(byte[] k, int kOff, uint[] n) + { + for (int i = 0; i < 14; ++i) + { + n[i] = Decode32(k, kOff + i * 4); + } + + n[ 0] &= 0xFFFFFFFCU; + n[13] |= 0x80000000U; + } + + public static void GeneratePrivateKey(SecureRandom random, byte[] k) + { + random.NextBytes(k); + + k[0] &= 0xFC; + k[ScalarSize - 1] |= 0x80; + } + + public static void GeneratePublicKey(byte[] k, int kOff, byte[] r, int rOff) + { + ScalarMultBase(k, kOff, r, rOff); + } + + private static void PointDouble(uint[] x, uint[] z) + { + uint[] A = X448Field.Create(); + uint[] B = X448Field.Create(); + + //X448Field.Apm(x, z, A, B); + X448Field.Add(x, z, A); + X448Field.Sub(x, z, B); + X448Field.Sqr(A, A); + X448Field.Sqr(B, B); + X448Field.Mul(A, B, x); + X448Field.Sub(A, B, A); + X448Field.Mul(A, C_A24, z); + X448Field.Add(z, B, z); + X448Field.Mul(z, A, z); + } + + public static void Precompute() + { + Ed448.Precompute(); + } + + public static void ScalarMult(byte[] k, int kOff, byte[] u, int uOff, byte[] r, int rOff) + { + uint[] n = new uint[14]; DecodeScalar(k, kOff, n); + + uint[] x1 = X448Field.Create(); X448Field.Decode(u, uOff, x1); + uint[] x2 = X448Field.Create(); X448Field.Copy(x1, 0, x2, 0); + uint[] z2 = X448Field.Create(); z2[0] = 1; + uint[] x3 = X448Field.Create(); x3[0] = 1; + uint[] z3 = X448Field.Create(); + + uint[] t1 = X448Field.Create(); + uint[] t2 = X448Field.Create(); + + Debug.Assert(n[13] >> 31 == 1U); + + int bit = 447, swap = 1; + do + { + //X448Field.Apm(x3, z3, t1, x3); + X448Field.Add(x3, z3, t1); + X448Field.Sub(x3, z3, x3); + //X448Field.Apm(x2, z2, z3, x2); + X448Field.Add(x2, z2, z3); + X448Field.Sub(x2, z2, x2); + + X448Field.Mul(t1, x2, t1); + X448Field.Mul(x3, z3, x3); + X448Field.Sqr(z3, z3); + X448Field.Sqr(x2, x2); + + X448Field.Sub(z3, x2, t2); + X448Field.Mul(t2, C_A24, z2); + X448Field.Add(z2, x2, z2); + X448Field.Mul(z2, t2, z2); + X448Field.Mul(x2, z3, x2); + + //X448Field.Apm(t1, x3, x3, z3); + X448Field.Sub(t1, x3, z3); + X448Field.Add(t1, x3, x3); + X448Field.Sqr(x3, x3); + X448Field.Sqr(z3, z3); + X448Field.Mul(z3, x1, z3); + + --bit; + + int word = bit >> 5, shift = bit & 0x1F; + int kt = (int)(n[word] >> shift) & 1; + swap ^= kt; + X448Field.CSwap(swap, x2, x3); + X448Field.CSwap(swap, z2, z3); + swap = kt; + } + while (bit >= 2); + + Debug.Assert(swap == 0); + + for (int i = 0; i < 2; ++i) + { + PointDouble(x2, z2); + } + + X448Field.Inv(z2, z2); + X448Field.Mul(x2, z2, x2); + + X448Field.Normalize(x2); + X448Field.Encode(x2, r, rOff); + } + + public static void ScalarMultBase(byte[] k, int kOff, byte[] r, int rOff) + { + uint[] x = X448Field.Create(); + uint[] y = X448Field.Create(); + + Ed448.ScalarMultBaseXY(k, kOff, x, y); + + X448Field.Inv(x, x); + X448Field.Mul(x, y, x); + X448Field.Sqr(x, x); + + X448Field.Normalize(x); + X448Field.Encode(x, r, rOff); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448.cs.meta new file mode 100644 index 00000000..8e5b7eba --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf09e42a7b7c71a4e8e71aabfee1856f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448Field.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448Field.cs new file mode 100644 index 00000000..4da525de --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448Field.cs @@ -0,0 +1,1005 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748 +{ + [CLSCompliantAttribute(false)] + public abstract class X448Field + { + public const int Size = 16; + + private const uint M28 = 0x0FFFFFFFU; + + private X448Field() {} + + public static void Add(uint[] x, uint[] y, uint[] z) + { + for (int i = 0; i < Size; ++i) + { + z[i] = x[i] + y[i]; + } + } + + public static void AddOne(uint[] z) + { + z[0] += 1; + } + + public static void AddOne(uint[] z, int zOff) + { + z[zOff] += 1; + } + + //public static void Apm(int[] x, int[] y, int[] zp, int[] zm) + //{ + // for (int i = 0; i < Size; ++i) + // { + // int xi = x[i], yi = y[i]; + // zp[i] = xi + yi; + // zm[i] = xi - yi; + // } + //} + + public static void Carry(uint[] z) + { + uint z0 = z[0], z1 = z[1], z2 = z[2], z3 = z[3], z4 = z[4], z5 = z[5], z6 = z[6], z7 = z[7]; + uint z8 = z[8], z9 = z[9], z10 = z[10], z11 = z[11], z12 = z[12], z13 = z[13], z14 = z[14], z15 = z[15]; + + z2 += (z1 >> 28); z1 &= M28; + z6 += (z5 >> 28); z5 &= M28; + z10 += (z9 >> 28); z9 &= M28; + z14 += (z13 >> 28); z13 &= M28; + + z3 += (z2 >> 28); z2 &= M28; + z7 += (z6 >> 28); z6 &= M28; + z11 += (z10 >> 28); z10 &= M28; + z15 += (z14 >> 28); z14 &= M28; + + uint t = z15 >> 28; z15 &= M28; + z0 += t; + z8 += t; + + z4 += (z3 >> 28); z3 &= M28; + z8 += (z7 >> 28); z7 &= M28; + z12 += (z11 >> 28); z11 &= M28; + + z1 += (z0 >> 28); z0 &= M28; + z5 += (z4 >> 28); z4 &= M28; + z9 += (z8 >> 28); z8 &= M28; + z13 += (z12 >> 28); z12 &= M28; + + z[0] = z0; z[1] = z1; z[2] = z2; z[3] = z3; z[4] = z4; z[5] = z5; z[6] = z6; z[7] = z7; + z[8] = z8; z[9] = z9; z[10] = z10; z[11] = z11; z[12] = z12; z[13] = z13; z[14] = z14; z[15] = z15; + } + + public static void CNegate(int negate, uint[] z) + { + Debug.Assert(negate >> 1 == 0); + + uint[] t = Create(); + Sub(t, z, t); + + Nat.CMov(Size, negate, t, 0, z, 0); + } + + public static void Copy(uint[] x, int xOff, uint[] z, int zOff) + { + for (int i = 0; i < Size; ++i) + { + z[zOff + i] = x[xOff + i]; + } + } + + public static uint[] Create() + { + return new uint[Size]; + } + + public static void CSwap(int swap, uint[] a, uint[] b) + { + Debug.Assert(swap >> 1 == 0); + Debug.Assert(a != b); + + uint mask = (uint)(0 - swap); + for (int i = 0; i < Size; ++i) + { + uint ai = a[i], bi = b[i]; + uint dummy = mask & (ai ^ bi); + a[i] = ai ^ dummy; + b[i] = bi ^ dummy; + } + } + + public static void Decode(byte[] x, int xOff, uint[] z) + { + Decode56(x, xOff, z, 0); + Decode56(x, xOff + 7, z, 2); + Decode56(x, xOff + 14, z, 4); + Decode56(x, xOff + 21, z, 6); + Decode56(x, xOff + 28, z, 8); + Decode56(x, xOff + 35, z, 10); + Decode56(x, xOff + 42, z, 12); + Decode56(x, xOff + 49, z, 14); + } + + private static uint Decode24(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + n |= (uint)bs[++off] << 16; + return n; + } + + private static uint Decode32(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + n |= (uint)bs[++off] << 16; + n |= (uint)bs[++off] << 24; + return n; + } + + private static void Decode56(byte[] bs, int off, uint[] z, int zOff) + { + uint lo = Decode32(bs, off); + uint hi = Decode24(bs, off + 4); + z[zOff] = lo & M28; + z[zOff + 1] = (lo >> 28) | (hi << 4); + } + + public static void Encode(uint[] x, byte[] z, int zOff) + { + Encode56(x, 0, z, zOff); + Encode56(x, 2, z, zOff + 7); + Encode56(x, 4, z, zOff + 14); + Encode56(x, 6, z, zOff + 21); + Encode56(x, 8, z, zOff + 28); + Encode56(x, 10, z, zOff + 35); + Encode56(x, 12, z, zOff + 42); + Encode56(x, 14, z, zOff + 49); + } + + private static void Encode24(uint n, byte[] bs, int off) + { + bs[ off] = (byte)(n ); + bs[++off] = (byte)(n >> 8); + bs[++off] = (byte)(n >> 16); + } + + private static void Encode32(uint n, byte[] bs, int off) + { + bs[ off] = (byte)(n ); + bs[++off] = (byte)(n >> 8); + bs[++off] = (byte)(n >> 16); + bs[++off] = (byte)(n >> 24); + } + + private static void Encode56(uint[] x, int xOff, byte[] bs, int off) + { + uint lo = x[xOff], hi = x[xOff + 1]; + Encode32(lo | (hi << 28), bs, off); + Encode24(hi >> 4, bs, off + 4); + } + + public static void Inv(uint[] x, uint[] z) + { + // z = x^(p-2) = x^(2^448 - 2^224 - 3) + // (223 1s) (1 0s) (222 1s) (1 0s) (1 1s) + // Addition chain: [1] 2 3 6 9 18 19 37 74 111 [222] [223] + + uint[] t = Create(); + PowPm3d4(x, t); + Sqr(t, 2, t); + Mul(t, x, z); + } + + public static bool IsZeroVar(uint[] x) + { + uint d = 0; + for (int i = 0; i < Size; ++i) + { + d |= x[i]; + } + return d == 0U; + } + + public static void Mul(uint[] x, uint y, uint[] z) + { + uint x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3], x4 = x[4], x5 = x[5], x6 = x[6], x7 = x[7]; + uint x8 = x[8], x9 = x[9], x10 = x[10], x11 = x[11], x12 = x[12], x13 = x[13], x14 = x[14], x15 = x[15]; + + uint z1, z5, z9, z13; + ulong c, d, e, f; + + c = (ulong)x1 * y; + z1 = (uint)c & M28; c >>= 28; + d = (ulong)x5 * y; + z5 = (uint)d & M28; d >>= 28; + e = (ulong)x9 * y; + z9 = (uint)e & M28; e >>= 28; + f = (ulong)x13 * y; + z13 = (uint)f & M28; f >>= 28; + + c += (ulong)x2 * y; + z[2] = (uint)c & M28; c >>= 28; + d += (ulong)x6 * y; + z[6] = (uint)d & M28; d >>= 28; + e += (ulong)x10 * y; + z[10] = (uint)e & M28; e >>= 28; + f += (ulong)x14 * y; + z[14] = (uint)f & M28; f >>= 28; + + c += (ulong)x3 * y; + z[3] = (uint)c & M28; c >>= 28; + d += (ulong)x7 * y; + z[7] = (uint)d & M28; d >>= 28; + e += (ulong)x11 * y; + z[11] = (uint)e & M28; e >>= 28; + f += (ulong)x15 * y; + z[15] = (uint)f & M28; f >>= 28; + + d += f; + + c += (ulong)x4 * y; + z[4] = (uint)c & M28; c >>= 28; + d += (ulong)x8 * y; + z[8] = (uint)d & M28; d >>= 28; + e += (ulong)x12 * y; + z[12] = (uint)e & M28; e >>= 28; + f += (ulong)x0 * y; + z[0] = (uint)f & M28; f >>= 28; + + z[1] = z1 + (uint)f; + z[5] = z5 + (uint)c; + z[9] = z9 + (uint)d; + z[13] = z13 + (uint)e; + } + + public static void Mul(uint[] x, uint[] y, uint[] z) + { + uint x0 = x[0]; + uint x1 = x[1]; + uint x2 = x[2]; + uint x3 = x[3]; + uint x4 = x[4]; + uint x5 = x[5]; + uint x6 = x[6]; + uint x7 = x[7]; + + uint u0 = x[8]; + uint u1 = x[9]; + uint u2 = x[10]; + uint u3 = x[11]; + uint u4 = x[12]; + uint u5 = x[13]; + uint u6 = x[14]; + uint u7 = x[15]; + + uint y0 = y[0]; + uint y1 = y[1]; + uint y2 = y[2]; + uint y3 = y[3]; + uint y4 = y[4]; + uint y5 = y[5]; + uint y6 = y[6]; + uint y7 = y[7]; + + uint v0 = y[8]; + uint v1 = y[9]; + uint v2 = y[10]; + uint v3 = y[11]; + uint v4 = y[12]; + uint v5 = y[13]; + uint v6 = y[14]; + uint v7 = y[15]; + + uint s0 = x0 + u0; + uint s1 = x1 + u1; + uint s2 = x2 + u2; + uint s3 = x3 + u3; + uint s4 = x4 + u4; + uint s5 = x5 + u5; + uint s6 = x6 + u6; + uint s7 = x7 + u7; + + uint t0 = y0 + v0; + uint t1 = y1 + v1; + uint t2 = y2 + v2; + uint t3 = y3 + v3; + uint t4 = y4 + v4; + uint t5 = y5 + v5; + uint t6 = y6 + v6; + uint t7 = y7 + v7; + + uint z0, z1, z2, z3, z4, z5, z6, z7, z8, z9, z10, z11, z12, z13, z14, z15; + ulong c, d; + + ulong f0 = (ulong)x0 * y0; + ulong f8 = (ulong)x7 * y1 + + (ulong)x6 * y2 + + (ulong)x5 * y3 + + (ulong)x4 * y4 + + (ulong)x3 * y5 + + (ulong)x2 * y6 + + (ulong)x1 * y7; + ulong g0 = (ulong)u0 * v0; + ulong g8 = (ulong)u7 * v1 + + (ulong)u6 * v2 + + (ulong)u5 * v3 + + (ulong)u4 * v4 + + (ulong)u3 * v5 + + (ulong)u2 * v6 + + (ulong)u1 * v7; + ulong h0 = (ulong)s0 * t0; + ulong h8 = (ulong)s7 * t1 + + (ulong)s6 * t2 + + (ulong)s5 * t3 + + (ulong)s4 * t4 + + (ulong)s3 * t5 + + (ulong)s2 * t6 + + (ulong)s1 * t7; + + c = f0 + g0 + h8 - f8; + z0 = (uint)c & M28; c >>= 28; + d = g8 + h0 - f0 + h8; + z8 = (uint)d & M28; d >>= 28; + + ulong f1 = (ulong)x1 * y0 + + (ulong)x0 * y1; + ulong f9 = (ulong)x7 * y2 + + (ulong)x6 * y3 + + (ulong)x5 * y4 + + (ulong)x4 * y5 + + (ulong)x3 * y6 + + (ulong)x2 * y7; + ulong g1 = (ulong)u1 * v0 + + (ulong)u0 * v1; + ulong g9 = (ulong)u7 * v2 + + (ulong)u6 * v3 + + (ulong)u5 * v4 + + (ulong)u4 * v5 + + (ulong)u3 * v6 + + (ulong)u2 * v7; + ulong h1 = (ulong)s1 * t0 + + (ulong)s0 * t1; + ulong h9 = (ulong)s7 * t2 + + (ulong)s6 * t3 + + (ulong)s5 * t4 + + (ulong)s4 * t5 + + (ulong)s3 * t6 + + (ulong)s2 * t7; + + c += f1 + g1 + h9 - f9; + z1 = (uint)c & M28; c >>= 28; + d += g9 + h1 - f1 + h9; + z9 = (uint)d & M28; d >>= 28; + + ulong f2 = (ulong)x2 * y0 + + (ulong)x1 * y1 + + (ulong)x0 * y2; + ulong f10 = (ulong)x7 * y3 + + (ulong)x6 * y4 + + (ulong)x5 * y5 + + (ulong)x4 * y6 + + (ulong)x3 * y7; + ulong g2 = (ulong)u2 * v0 + + (ulong)u1 * v1 + + (ulong)u0 * v2; + ulong g10 = (ulong)u7 * v3 + + (ulong)u6 * v4 + + (ulong)u5 * v5 + + (ulong)u4 * v6 + + (ulong)u3 * v7; + ulong h2 = (ulong)s2 * t0 + + (ulong)s1 * t1 + + (ulong)s0 * t2; + ulong h10 = (ulong)s7 * t3 + + (ulong)s6 * t4 + + (ulong)s5 * t5 + + (ulong)s4 * t6 + + (ulong)s3 * t7; + + c += f2 + g2 + h10 - f10; + z2 = (uint)c & M28; c >>= 28; + d += g10 + h2 - f2 + h10; + z10 = (uint)d & M28; d >>= 28; + + ulong f3 = (ulong)x3 * y0 + + (ulong)x2 * y1 + + (ulong)x1 * y2 + + (ulong)x0 * y3; + ulong f11 = (ulong)x7 * y4 + + (ulong)x6 * y5 + + (ulong)x5 * y6 + + (ulong)x4 * y7; + ulong g3 = (ulong)u3 * v0 + + (ulong)u2 * v1 + + (ulong)u1 * v2 + + (ulong)u0 * v3; + ulong g11 = (ulong)u7 * v4 + + (ulong)u6 * v5 + + (ulong)u5 * v6 + + (ulong)u4 * v7; + ulong h3 = (ulong)s3 * t0 + + (ulong)s2 * t1 + + (ulong)s1 * t2 + + (ulong)s0 * t3; + ulong h11 = (ulong)s7 * t4 + + (ulong)s6 * t5 + + (ulong)s5 * t6 + + (ulong)s4 * t7; + + c += f3 + g3 + h11 - f11; + z3 = (uint)c & M28; c >>= 28; + d += g11 + h3 - f3 + h11; + z11 = (uint)d & M28; d >>= 28; + + ulong f4 = (ulong)x4 * y0 + + (ulong)x3 * y1 + + (ulong)x2 * y2 + + (ulong)x1 * y3 + + (ulong)x0 * y4; + ulong f12 = (ulong)x7 * y5 + + (ulong)x6 * y6 + + (ulong)x5 * y7; + ulong g4 = (ulong)u4 * v0 + + (ulong)u3 * v1 + + (ulong)u2 * v2 + + (ulong)u1 * v3 + + (ulong)u0 * v4; + ulong g12 = (ulong)u7 * v5 + + (ulong)u6 * v6 + + (ulong)u5 * v7; + ulong h4 = (ulong)s4 * t0 + + (ulong)s3 * t1 + + (ulong)s2 * t2 + + (ulong)s1 * t3 + + (ulong)s0 * t4; + ulong h12 = (ulong)s7 * t5 + + (ulong)s6 * t6 + + (ulong)s5 * t7; + + c += f4 + g4 + h12 - f12; + z4 = (uint)c & M28; c >>= 28; + d += g12 + h4 - f4 + h12; + z12 = (uint)d & M28; d >>= 28; + + ulong f5 = (ulong)x5 * y0 + + (ulong)x4 * y1 + + (ulong)x3 * y2 + + (ulong)x2 * y3 + + (ulong)x1 * y4 + + (ulong)x0 * y5; + ulong f13 = (ulong)x7 * y6 + + (ulong)x6 * y7; + ulong g5 = (ulong)u5 * v0 + + (ulong)u4 * v1 + + (ulong)u3 * v2 + + (ulong)u2 * v3 + + (ulong)u1 * v4 + + (ulong)u0 * v5; + ulong g13 = (ulong)u7 * v6 + + (ulong)u6 * v7; + ulong h5 = (ulong)s5 * t0 + + (ulong)s4 * t1 + + (ulong)s3 * t2 + + (ulong)s2 * t3 + + (ulong)s1 * t4 + + (ulong)s0 * t5; + ulong h13 = (ulong)s7 * t6 + + (ulong)s6 * t7; + + c += f5 + g5 + h13 - f13; + z5 = (uint)c & M28; c >>= 28; + d += g13 + h5 - f5 + h13; + z13 = (uint)d & M28; d >>= 28; + + ulong f6 = (ulong)x6 * y0 + + (ulong)x5 * y1 + + (ulong)x4 * y2 + + (ulong)x3 * y3 + + (ulong)x2 * y4 + + (ulong)x1 * y5 + + (ulong)x0 * y6; + ulong f14 = (ulong)x7 * y7; + ulong g6 = (ulong)u6 * v0 + + (ulong)u5 * v1 + + (ulong)u4 * v2 + + (ulong)u3 * v3 + + (ulong)u2 * v4 + + (ulong)u1 * v5 + + (ulong)u0 * v6; + ulong g14 = (ulong)u7 * v7; + ulong h6 = (ulong)s6 * t0 + + (ulong)s5 * t1 + + (ulong)s4 * t2 + + (ulong)s3 * t3 + + (ulong)s2 * t4 + + (ulong)s1 * t5 + + (ulong)s0 * t6; + ulong h14 = (ulong)s7 * t7; + + c += f6 + g6 + h14 - f14; + z6 = (uint)c & M28; c >>= 28; + d += g14 + h6 - f6 + h14; + z14 = (uint)d & M28; d >>= 28; + + ulong f7 = (ulong)x7 * y0 + + (ulong)x6 * y1 + + (ulong)x5 * y2 + + (ulong)x4 * y3 + + (ulong)x3 * y4 + + (ulong)x2 * y5 + + (ulong)x1 * y6 + + (ulong)x0 * y7; + ulong g7 = (ulong)u7 * v0 + + (ulong)u6 * v1 + + (ulong)u5 * v2 + + (ulong)u4 * v3 + + (ulong)u3 * v4 + + (ulong)u2 * v5 + + (ulong)u1 * v6 + + (ulong)u0 * v7; + ulong h7 = (ulong)s7 * t0 + + (ulong)s6 * t1 + + (ulong)s5 * t2 + + (ulong)s4 * t3 + + (ulong)s3 * t4 + + (ulong)s2 * t5 + + (ulong)s1 * t6 + + (ulong)s0 * t7; + + c += f7 + g7; + z7 = (uint)c & M28; c >>= 28; + d += h7 - f7; + z15 = (uint)d & M28; d >>= 28; + + c += d; + + c += z8; + z8 = (uint)c & M28; c >>= 28; + d += z0; + z0 = (uint)d & M28; d >>= 28; + z9 += (uint)c; + z1 += (uint)d; + + z[0] = z0; + z[1] = z1; + z[2] = z2; + z[3] = z3; + z[4] = z4; + z[5] = z5; + z[6] = z6; + z[7] = z7; + z[8] = z8; + z[9] = z9; + z[10] = z10; + z[11] = z11; + z[12] = z12; + z[13] = z13; + z[14] = z14; + z[15] = z15; + } + + public static void Negate(uint[] x, uint[] z) + { + uint[] zero = Create(); + Sub(zero, x, z); + } + + public static void Normalize(uint[] z) + { + //int x = (z[15] >> (28 - 1)) & 1; + Reduce(z, 1); + Reduce(z, -1); + Debug.Assert(z[15] >> 28 == 0U); + } + + public static void One(uint[] z) + { + z[0] = 1U; + for (int i = 1; i < Size; ++i) + { + z[i] = 0; + } + } + + private static void PowPm3d4(uint[] x, uint[] z) + { + // z = x^((p-3)/4) = x^(2^446 - 2^222 - 1) + // (223 1s) (1 0s) (222 1s) + // Addition chain: 1 2 3 6 9 18 19 37 74 111 [222] [223] + uint[] x2 = Create(); Sqr(x, x2); Mul(x, x2, x2); + uint[] x3 = Create(); Sqr(x2, x3); Mul(x, x3, x3); + uint[] x6 = Create(); Sqr(x3, 3, x6); Mul(x3, x6, x6); + uint[] x9 = Create(); Sqr(x6, 3, x9); Mul(x3, x9, x9); + uint[] x18 = Create(); Sqr(x9, 9, x18); Mul(x9, x18, x18); + uint[] x19 = Create(); Sqr(x18, x19); Mul(x, x19, x19); + uint[] x37 = Create(); Sqr(x19, 18, x37); Mul(x18, x37, x37); + uint[] x74 = Create(); Sqr(x37, 37, x74); Mul(x37, x74, x74); + uint[] x111 = Create(); Sqr(x74, 37, x111); Mul(x37, x111, x111); + uint[] x222 = Create(); Sqr(x111, 111, x222); Mul(x111, x222, x222); + uint[] x223 = Create(); Sqr(x222, x223); Mul(x, x223, x223); + + uint[] t = Create(); + Sqr(x223, 223, t); + Mul(t, x222, z); + } + + private static void Reduce(uint[] z, int c) + { + uint z15 = z[15]; + long t = z15; + z15 &= M28; + t = (t >> 28) + c; + z[8] += (uint)t; + for (int i = 0; i < 15; ++i) + { + t += z[i]; z[i] = (uint)t & M28; t >>= 28; + } + z[15] = z15 + (uint)t; + } + + public static void Sqr(uint[] x, uint[] z) + { + uint x0 = x[0]; + uint x1 = x[1]; + uint x2 = x[2]; + uint x3 = x[3]; + uint x4 = x[4]; + uint x5 = x[5]; + uint x6 = x[6]; + uint x7 = x[7]; + + uint u0 = x[8]; + uint u1 = x[9]; + uint u2 = x[10]; + uint u3 = x[11]; + uint u4 = x[12]; + uint u5 = x[13]; + uint u6 = x[14]; + uint u7 = x[15]; + + uint x0_2 = x0 * 2; + uint x1_2 = x1 * 2; + uint x2_2 = x2 * 2; + uint x3_2 = x3 * 2; + uint x4_2 = x4 * 2; + uint x5_2 = x5 * 2; + uint x6_2 = x6 * 2; + + uint u0_2 = u0 * 2; + uint u1_2 = u1 * 2; + uint u2_2 = u2 * 2; + uint u3_2 = u3 * 2; + uint u4_2 = u4 * 2; + uint u5_2 = u5 * 2; + uint u6_2 = u6 * 2; + + uint s0 = x0 + u0; + uint s1 = x1 + u1; + uint s2 = x2 + u2; + uint s3 = x3 + u3; + uint s4 = x4 + u4; + uint s5 = x5 + u5; + uint s6 = x6 + u6; + uint s7 = x7 + u7; + + uint s0_2 = s0 * 2; + uint s1_2 = s1 * 2; + uint s2_2 = s2 * 2; + uint s3_2 = s3 * 2; + uint s4_2 = s4 * 2; + uint s5_2 = s5 * 2; + uint s6_2 = s6 * 2; + + uint z0, z1, z2, z3, z4, z5, z6, z7, z8, z9, z10, z11, z12, z13, z14, z15; + ulong c, d; + + ulong f0 = (ulong)x0 * x0; + ulong f8 = (ulong)x7 * x1_2 + + (ulong)x6 * x2_2 + + (ulong)x5 * x3_2 + + (ulong)x4 * x4; + ulong g0 = (ulong)u0 * u0; + ulong g8 = (ulong)u7 * u1_2 + + (ulong)u6 * u2_2 + + (ulong)u5 * u3_2 + + (ulong)u4 * u4; + ulong h0 = (ulong)s0 * s0; + ulong h8 = (ulong)s7 * s1_2 + + (ulong)s6 * s2_2 + + (ulong)s5 * s3_2 + + (ulong)s4 * s4; + + c = f0 + g0 + h8 - f8; + z0 = (uint)c & M28; c >>= 28; + d = g8 + h0 - f0 + h8; + z8 = (uint)d & M28; d >>= 28; + + ulong f1 = (ulong)x1 * x0_2; + ulong f9 = (ulong)x7 * x2_2 + + (ulong)x6 * x3_2 + + (ulong)x5 * x4_2; + ulong g1 = (ulong)u1 * u0_2; + ulong g9 = (ulong)u7 * u2_2 + + (ulong)u6 * u3_2 + + (ulong)u5 * u4_2; + ulong h1 = (ulong)s1 * s0_2; + ulong h9 = (ulong)s7 * s2_2 + + (ulong)s6 * s3_2 + + (ulong)s5 * s4_2; + + c += f1 + g1 + h9 - f9; + z1 = (uint)c & M28; c >>= 28; + d += g9 + h1 - f1 + h9; + z9 = (uint)d & M28; d >>= 28; + + ulong f2 = (ulong)x2 * x0_2 + + (ulong)x1 * x1; + ulong f10 = (ulong)x7 * x3_2 + + (ulong)x6 * x4_2 + + (ulong)x5 * x5; + ulong g2 = (ulong)u2 * u0_2 + + (ulong)u1 * u1; + ulong g10 = (ulong)u7 * u3_2 + + (ulong)u6 * u4_2 + + (ulong)u5 * u5; + ulong h2 = (ulong)s2 * s0_2 + + (ulong)s1 * s1; + ulong h10 = (ulong)s7 * s3_2 + + (ulong)s6 * s4_2 + + (ulong)s5 * s5; + + c += f2 + g2 + h10 - f10; + z2 = (uint)c & M28; c >>= 28; + d += g10 + h2 - f2 + h10; + z10 = (uint)d & M28; d >>= 28; + + ulong f3 = (ulong)x3 * x0_2 + + (ulong)x2 * x1_2; + ulong f11 = (ulong)x7 * x4_2 + + (ulong)x6 * x5_2; + ulong g3 = (ulong)u3 * u0_2 + + (ulong)u2 * u1_2; + ulong g11 = (ulong)u7 * u4_2 + + (ulong)u6 * u5_2; + ulong h3 = (ulong)s3 * s0_2 + + (ulong)s2 * s1_2; + ulong h11 = (ulong)s7 * s4_2 + + (ulong)s6 * s5_2; + + c += f3 + g3 + h11 - f11; + z3 = (uint)c & M28; c >>= 28; + d += g11 + h3 - f3 + h11; + z11 = (uint)d & M28; d >>= 28; + + ulong f4 = (ulong)x4 * x0_2 + + (ulong)x3 * x1_2 + + (ulong)x2 * x2; + ulong f12 = (ulong)x7 * x5_2 + + (ulong)x6 * x6; + ulong g4 = (ulong)u4 * u0_2 + + (ulong)u3 * u1_2 + + (ulong)u2 * u2; + ulong g12 = (ulong)u7 * u5_2 + + (ulong)u6 * u6; + ulong h4 = (ulong)s4 * s0_2 + + (ulong)s3 * s1_2 + + (ulong)s2 * s2; + ulong h12 = (ulong)s7 * s5_2 + + (ulong)s6 * s6; + + c += f4 + g4 + h12 - f12; + z4 = (uint)c & M28; c >>= 28; + d += g12 + h4 - f4 + h12; + z12 = (uint)d & M28; d >>= 28; + + ulong f5 = (ulong)x5 * x0_2 + + (ulong)x4 * x1_2 + + (ulong)x3 * x2_2; + ulong f13 = (ulong)x7 * x6_2; + ulong g5 = (ulong)u5 * u0_2 + + (ulong)u4 * u1_2 + + (ulong)u3 * u2_2; + ulong g13 = (ulong)u7 * u6_2; + ulong h5 = (ulong)s5 * s0_2 + + (ulong)s4 * s1_2 + + (ulong)s3 * s2_2; + ulong h13 = (ulong)s7 * s6_2; + + c += f5 + g5 + h13 - f13; + z5 = (uint)c & M28; c >>= 28; + d += g13 + h5 - f5 + h13; + z13 = (uint)d & M28; d >>= 28; + + ulong f6 = (ulong)x6 * x0_2 + + (ulong)x5 * x1_2 + + (ulong)x4 * x2_2 + + (ulong)x3 * x3; + ulong f14 = (ulong)x7 * x7; + ulong g6 = (ulong)u6 * u0_2 + + (ulong)u5 * u1_2 + + (ulong)u4 * u2_2 + + (ulong)u3 * u3; + ulong g14 = (ulong)u7 * u7; + ulong h6 = (ulong)s6 * s0_2 + + (ulong)s5 * s1_2 + + (ulong)s4 * s2_2 + + (ulong)s3 * s3; + ulong h14 = (ulong)s7 * s7; + + c += f6 + g6 + h14 - f14; + z6 = (uint)c & M28; c >>= 28; + d += g14 + h6 - f6 + h14; + z14 = (uint)d & M28; d >>= 28; + + ulong f7 = (ulong)x7 * x0_2 + + (ulong)x6 * x1_2 + + (ulong)x5 * x2_2 + + (ulong)x4 * x3_2; + ulong g7 = (ulong)u7 * u0_2 + + (ulong)u6 * u1_2 + + (ulong)u5 * u2_2 + + (ulong)u4 * u3_2; + ulong h7 = (ulong)s7 * s0_2 + + (ulong)s6 * s1_2 + + (ulong)s5 * s2_2 + + (ulong)s4 * s3_2; + + c += f7 + g7; + z7 = (uint)c & M28; c >>= 28; + d += h7 - f7; + z15 = (uint)d & M28; d >>= 28; + + c += d; + + c += z8; + z8 = (uint)c & M28; c >>= 28; + d += z0; + z0 = (uint)d & M28; d >>= 28; + z9 += (uint)c; + z1 += (uint)d; + + z[0] = z0; + z[1] = z1; + z[2] = z2; + z[3] = z3; + z[4] = z4; + z[5] = z5; + z[6] = z6; + z[7] = z7; + z[8] = z8; + z[9] = z9; + z[10] = z10; + z[11] = z11; + z[12] = z12; + z[13] = z13; + z[14] = z14; + z[15] = z15; + } + + public static void Sqr(uint[] x, int n, uint[] z) + { + Debug.Assert(n > 0); + + Sqr(x, z); + + while (--n > 0) + { + Sqr(z, z); + } + } + + public static bool SqrtRatioVar(uint[] u, uint[] v, uint[] z) + { + uint[] u3v = Create(); + uint[] u5v3 = Create(); + + Sqr(u, u3v); + Mul(u3v, v, u3v); + Sqr(u3v, u5v3); + Mul(u3v, u, u3v); + Mul(u5v3, u, u5v3); + Mul(u5v3, v, u5v3); + + uint[] x = Create(); + PowPm3d4(u5v3, x); + Mul(x, u3v, x); + + uint[] t = Create(); + Sqr(x, t); + Mul(t, v, t); + + Sub(u, t, t); + Normalize(t); + + if (IsZeroVar(t)) + { + Copy(x, 0, z, 0); + return true; + } + + return false; + } + + public static void Sub(uint[] x, uint[] y, uint[] z) + { + uint x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3], x4 = x[4], x5 = x[5], x6 = x[6], x7 = x[7]; + uint x8 = x[8], x9 = x[9], x10 = x[10], x11 = x[11], x12 = x[12], x13 = x[13], x14 = x[14], x15 = x[15]; + uint y0 = y[0], y1 = y[1], y2 = y[2], y3 = y[3], y4 = y[4], y5 = y[5], y6 = y[6], y7 = y[7]; + uint y8 = y[8], y9 = y[9], y10 = y[10], y11 = y[11], y12 = y[12], y13 = y[13], y14 = y[14], y15 = y[15]; + + uint z0 = x0 + 0x1FFFFFFEU - y0; + uint z1 = x1 + 0x1FFFFFFEU - y1; + uint z2 = x2 + 0x1FFFFFFEU - y2; + uint z3 = x3 + 0x1FFFFFFEU - y3; + uint z4 = x4 + 0x1FFFFFFEU - y4; + uint z5 = x5 + 0x1FFFFFFEU - y5; + uint z6 = x6 + 0x1FFFFFFEU - y6; + uint z7 = x7 + 0x1FFFFFFEU - y7; + uint z8 = x8 + 0x1FFFFFFCU - y8; + uint z9 = x9 + 0x1FFFFFFEU - y9; + uint z10 = x10 + 0x1FFFFFFEU - y10; + uint z11 = x11 + 0x1FFFFFFEU - y11; + uint z12 = x12 + 0x1FFFFFFEU - y12; + uint z13 = x13 + 0x1FFFFFFEU - y13; + uint z14 = x14 + 0x1FFFFFFEU - y14; + uint z15 = x15 + 0x1FFFFFFEU - y15; + + z2 += z1 >> 28; z1 &= M28; + z6 += z5 >> 28; z5 &= M28; + z10 += z9 >> 28; z9 &= M28; + z14 += z13 >> 28; z13 &= M28; + + z3 += z2 >> 28; z2 &= M28; + z7 += z6 >> 28; z6 &= M28; + z11 += z10 >> 28; z10 &= M28; + z15 += z14 >> 28; z14 &= M28; + + uint t = z15 >> 28; z15 &= M28; + z0 += t; + z8 += t; + + z4 += z3 >> 28; z3 &= M28; + z8 += z7 >> 28; z7 &= M28; + z12 += z11 >> 28; z11 &= M28; + + z1 += z0 >> 28; z0 &= M28; + z5 += z4 >> 28; z4 &= M28; + z9 += z8 >> 28; z8 &= M28; + z13 += z12 >> 28; z12 &= M28; + + z[0] = z0; + z[1] = z1; + z[2] = z2; + z[3] = z3; + z[4] = z4; + z[5] = z5; + z[6] = z6; + z[7] = z7; + z[8] = z8; + z[9] = z9; + z[10] = z10; + z[11] = z11; + z[12] = z12; + z[13] = z13; + z[14] = z14; + z[15] = z15; + } + + public static void Zero(uint[] z) + { + for (int i = 0; i < Size; ++i) + { + z[i] = 0; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448Field.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448Field.cs.meta new file mode 100644 index 00000000..b7a28167 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc7748/X448Field.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a985ce314f54be41b07d60dce032343 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032.meta new file mode 100644 index 00000000..5d992fed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d199307194a54b9468b969b271f9b7f0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed25519.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed25519.cs new file mode 100644 index 00000000..e0d74f46 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed25519.cs @@ -0,0 +1,1097 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032 +{ + public abstract class Ed25519 + { + public enum Algorithm + { + Ed25519 = 0, + Ed25519ctx = 1, + Ed25519ph = 2, + } + + private const long M28L = 0x0FFFFFFFL; + private const long M32L = 0xFFFFFFFFL; + + private const int PointBytes = 32; + private const int ScalarUints = 8; + private const int ScalarBytes = ScalarUints * 4; + + public static readonly int PrehashSize = 64; + public static readonly int PublicKeySize = PointBytes; + public static readonly int SecretKeySize = 32; + public static readonly int SignatureSize = PointBytes + ScalarBytes; + + private static readonly byte[] Dom2Prefix = Strings.ToByteArray("SigEd25519 no Ed25519 collisions"); + + private static readonly uint[] P = { 0xFFFFFFEDU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x7FFFFFFFU }; + private static readonly uint[] L = { 0x5CF5D3EDU, 0x5812631AU, 0xA2F79CD6U, 0x14DEF9DEU, 0x00000000U, 0x00000000U, 0x00000000U, 0x10000000U }; + + private const int L0 = unchecked((int)0xFCF5D3ED); // L0:26/-- + private const int L1 = 0x012631A6; // L1:24/22 + private const int L2 = 0x079CD658; // L2:27/-- + private const int L3 = unchecked((int)0xFF9DEA2F); // L3:23/-- + private const int L4 = 0x000014DF; // L4:12/11 + + private static readonly int[] B_x = { 0x0325D51A, 0x018B5823, 0x007B2C95, 0x0304A92D, 0x00D2598E, 0x01D6DC5C, + 0x01388C7F, 0x013FEC0A, 0x029E6B72, 0x0042D26D }; + private static readonly int[] B_y = { 0x02666658, 0x01999999, 0x00666666, 0x03333333, 0x00CCCCCC, 0x02666666, + 0x01999999, 0x00666666, 0x03333333, 0x00CCCCCC, }; + private static readonly int[] C_d = { 0x035978A3, 0x02D37284, 0x018AB75E, 0x026A0A0E, 0x0000E014, 0x0379E898, + 0x01D01E5D, 0x01E738CC, 0x03715B7F, 0x00A406D9 }; + private static readonly int[] C_d2 = { 0x02B2F159, 0x01A6E509, 0x01156EBD, 0x00D4141D, 0x0001C029, 0x02F3D130, + 0x03A03CBB, 0x01CE7198, 0x02E2B6FF, 0x00480DB3 }; + private static readonly int[] C_d4 = { 0x0165E2B2, 0x034DCA13, 0x002ADD7A, 0x01A8283B, 0x00038052, 0x01E7A260, + 0x03407977, 0x019CE331, 0x01C56DFF, 0x00901B67 }; + + private const int WnafWidthBase = 7; + + private const int PrecompBlocks = 8; + private const int PrecompTeeth = 4; + private const int PrecompSpacing = 8; + private const int PrecompPoints = 1 << (PrecompTeeth - 1); + private const int PrecompMask = PrecompPoints - 1; + + private static readonly object precompLock = new object(); + // TODO[ed25519] Convert to PointPrecomp + private static PointExt[] precompBaseTable = null; + private static int[] precompBase = null; + + private class PointAccum + { + internal int[] x = X25519Field.Create(); + internal int[] y = X25519Field.Create(); + internal int[] z = X25519Field.Create(); + internal int[] u = X25519Field.Create(); + internal int[] v = X25519Field.Create(); + } + + private class PointExt + { + internal int[] x = X25519Field.Create(); + internal int[] y = X25519Field.Create(); + internal int[] z = X25519Field.Create(); + internal int[] t = X25519Field.Create(); + } + + private class PointPrecomp + { + internal int[] ypx_h = X25519Field.Create(); + internal int[] ymx_h = X25519Field.Create(); + internal int[] xyd = X25519Field.Create(); + } + + private static byte[] CalculateS(byte[] r, byte[] k, byte[] s) + { + uint[] t = new uint[ScalarUints * 2]; DecodeScalar(r, 0, t); + uint[] u = new uint[ScalarUints]; DecodeScalar(k, 0, u); + uint[] v = new uint[ScalarUints]; DecodeScalar(s, 0, v); + + Nat256.MulAddTo(u, v, t); + + byte[] result = new byte[ScalarBytes * 2]; + for (int i = 0; i < t.Length; ++i) + { + Encode32(t[i], result, i * 4); + } + return ReduceScalar(result); + } + + private static bool CheckContextVar(byte[] ctx, byte phflag) + { + return ctx == null && phflag == 0x00 + || ctx != null && ctx.Length < 256; + } + + private static bool CheckPointVar(byte[] p) + { + uint[] t = new uint[8]; + Decode32(p, 0, t, 0, 8); + t[7] &= 0x7FFFFFFFU; + return !Nat256.Gte(t, P); + } + + private static bool CheckScalarVar(byte[] s) + { + uint[] n = new uint[ScalarUints]; + DecodeScalar(s, 0, n); + return !Nat256.Gte(n, L); + } + + private static IDigest CreateDigest() + { + return new Sha512Digest(); + } + + public static IDigest CreatePrehash() + { + return CreateDigest(); + } + + private static uint Decode24(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + n |= (uint)bs[++off] << 16; + return n; + } + + private static uint Decode32(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + n |= (uint)bs[++off] << 16; + n |= (uint)bs[++off] << 24; + return n; + } + + private static void Decode32(byte[] bs, int bsOff, uint[] n, int nOff, int nLen) + { + for (int i = 0; i < nLen; ++i) + { + n[nOff + i] = Decode32(bs, bsOff + i * 4); + } + } + + private static bool DecodePointVar(byte[] p, int pOff, bool negate, PointExt r) + { + byte[] py = Arrays.CopyOfRange(p, pOff, pOff + PointBytes); + if (!CheckPointVar(py)) + return false; + + int x_0 = (py[PointBytes - 1] & 0x80) >> 7; + py[PointBytes - 1] &= 0x7F; + + X25519Field.Decode(py, 0, r.y); + + int[] u = X25519Field.Create(); + int[] v = X25519Field.Create(); + + X25519Field.Sqr(r.y, u); + X25519Field.Mul(C_d, u, v); + X25519Field.SubOne(u); + X25519Field.AddOne(v); + + if (!X25519Field.SqrtRatioVar(u, v, r.x)) + return false; + + X25519Field.Normalize(r.x); + if (x_0 == 1 && X25519Field.IsZeroVar(r.x)) + return false; + + if (negate ^ (x_0 != (r.x[0] & 1))) + { + X25519Field.Negate(r.x, r.x); + } + + PointExtendXY(r); + return true; + } + + private static void DecodeScalar(byte[] k, int kOff, uint[] n) + { + Decode32(k, kOff, n, 0, ScalarUints); + } + + private static void Dom2(IDigest d, byte phflag, byte[] ctx) + { + if (ctx != null) + { + d.BlockUpdate(Dom2Prefix, 0, Dom2Prefix.Length); + d.Update(phflag); + d.Update((byte)ctx.Length); + d.BlockUpdate(ctx, 0, ctx.Length); + } + } + + private static void Encode24(uint n, byte[] bs, int off) + { + bs[off] = (byte)(n); + bs[++off] = (byte)(n >> 8); + bs[++off] = (byte)(n >> 16); + } + + private static void Encode32(uint n, byte[] bs, int off) + { + bs[off] = (byte)(n); + bs[++off] = (byte)(n >> 8); + bs[++off] = (byte)(n >> 16); + bs[++off] = (byte)(n >> 24); + } + + private static void Encode56(ulong n, byte[] bs, int off) + { + Encode32((uint)n, bs, off); + Encode24((uint)(n >> 32), bs, off + 4); + } + + private static void EncodePoint(PointAccum p, byte[] r, int rOff) + { + int[] x = X25519Field.Create(); + int[] y = X25519Field.Create(); + + X25519Field.Inv(p.z, y); + X25519Field.Mul(p.x, y, x); + X25519Field.Mul(p.y, y, y); + X25519Field.Normalize(x); + X25519Field.Normalize(y); + + X25519Field.Encode(y, r, rOff); + r[rOff + PointBytes - 1] |= (byte)((x[0] & 1) << 7); + } + + public static void GeneratePrivateKey(SecureRandom random, byte[] k) + { + random.NextBytes(k); + } + + public static void GeneratePublicKey(byte[] sk, int skOff, byte[] pk, int pkOff) + { + IDigest d = CreateDigest(); + byte[] h = new byte[d.GetDigestSize()]; + + d.BlockUpdate(sk, skOff, SecretKeySize); + d.DoFinal(h, 0); + + byte[] s = new byte[ScalarBytes]; + PruneScalar(h, 0, s); + + ScalarMultBaseEncoded(s, pk, pkOff); + } + + private static sbyte[] GetWnaf(uint[] n, int width) + { + Debug.Assert(n[ScalarUints - 1] >> 31 == 0); + + uint[] t = new uint[ScalarUints * 2]; + { + uint c = 0; + int tPos = t.Length, i = ScalarUints; + while (--i >= 0) + { + uint next = n[i]; + t[--tPos] = (next >> 16) | (c << 16); + t[--tPos] = c = next; + } + } + + sbyte[] ws = new sbyte[256]; + + uint pow2 = 1U << width; + uint mask = pow2 - 1U; + uint sign = pow2 >> 1; + + uint carry = 0U; + int j = 0; + for (int i = 0; i < t.Length; ++i, j -= 16) + { + uint word = t[i]; + while (j < 16) + { + uint word16 = word >> j; + uint bit = word16 & 1U; + + if (bit == carry) + { + ++j; + continue; + } + + uint digit = (word16 & mask) + carry; + carry = digit & sign; + digit -= (carry << 1); + carry >>= (width - 1); + + ws[(i << 4) + j] = (sbyte)digit; + + j += width; + } + } + + Debug.Assert(carry == 0); + + return ws; + } + + private static void ImplSign(IDigest d, byte[] h, byte[] s, byte[] pk, int pkOff, byte[] ctx, byte phflag, + byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + Dom2(d, phflag, ctx); + d.BlockUpdate(h, ScalarBytes, ScalarBytes); + d.BlockUpdate(m, mOff, mLen); + d.DoFinal(h, 0); + + byte[] r = ReduceScalar(h); + byte[] R = new byte[PointBytes]; + ScalarMultBaseEncoded(r, R, 0); + + Dom2(d, phflag, ctx); + d.BlockUpdate(R, 0, PointBytes); + d.BlockUpdate(pk, pkOff, PointBytes); + d.BlockUpdate(m, mOff, mLen); + d.DoFinal(h, 0); + + byte[] k = ReduceScalar(h); + byte[] S = CalculateS(r, k, s); + + Array.Copy(R, 0, sig, sigOff, PointBytes); + Array.Copy(S, 0, sig, sigOff + PointBytes, ScalarBytes); + } + + private static void ImplSign(byte[] sk, int skOff, byte[] ctx, byte phflag, byte[] m, int mOff, int mLen, + byte[] sig, int sigOff) + { + if (!CheckContextVar(ctx, phflag)) + throw new ArgumentException("ctx"); + + IDigest d = CreateDigest(); + byte[] h = new byte[d.GetDigestSize()]; + + d.BlockUpdate(sk, skOff, SecretKeySize); + d.DoFinal(h, 0); + + byte[] s = new byte[ScalarBytes]; + PruneScalar(h, 0, s); + + byte[] pk = new byte[PointBytes]; + ScalarMultBaseEncoded(s, pk, 0); + + ImplSign(d, h, s, pk, 0, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + private static void ImplSign(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte phflag, + byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + if (!CheckContextVar(ctx, phflag)) + throw new ArgumentException("ctx"); + + IDigest d = CreateDigest(); + byte[] h = new byte[d.GetDigestSize()]; + + d.BlockUpdate(sk, skOff, SecretKeySize); + d.DoFinal(h, 0); + + byte[] s = new byte[ScalarBytes]; + PruneScalar(h, 0, s); + + ImplSign(d, h, s, pk, pkOff, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + private static bool ImplVerify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte phflag, + byte[] m, int mOff, int mLen) + { + if (!CheckContextVar(ctx, phflag)) + throw new ArgumentException("ctx"); + + byte[] R = Arrays.CopyOfRange(sig, sigOff, sigOff + PointBytes); + byte[] S = Arrays.CopyOfRange(sig, sigOff + PointBytes, sigOff + SignatureSize); + + if (!CheckPointVar(R)) + return false; + + if (!CheckScalarVar(S)) + return false; + + PointExt pA = new PointExt(); + if (!DecodePointVar(pk, pkOff, true, pA)) + return false; + + IDigest d = CreateDigest(); + byte[] h = new byte[d.GetDigestSize()]; + + Dom2(d, phflag, ctx); + d.BlockUpdate(R, 0, PointBytes); + d.BlockUpdate(pk, pkOff, PointBytes); + d.BlockUpdate(m, mOff, mLen); + d.DoFinal(h, 0); + + byte[] k = ReduceScalar(h); + + uint[] nS = new uint[ScalarUints]; + DecodeScalar(S, 0, nS); + + uint[] nA = new uint[ScalarUints]; + DecodeScalar(k, 0, nA); + + PointAccum pR = new PointAccum(); + ScalarMultStraussVar(nS, nA, pA, pR); + + byte[] check = new byte[PointBytes]; + EncodePoint(pR, check, 0); + + return Arrays.AreEqual(check, R); + } + + private static void PointAddVar(bool negate, PointExt p, PointAccum r) + { + int[] A = X25519Field.Create(); + int[] B = X25519Field.Create(); + int[] C = X25519Field.Create(); + int[] D = X25519Field.Create(); + int[] E = r.u; + int[] F = X25519Field.Create(); + int[] G = X25519Field.Create(); + int[] H = r.v; + + int[] c, d, f, g; + if (negate) + { + c = D; d = C; f = G; g = F; + } + else + { + c = C; d = D; f = F; g = G; + } + + X25519Field.Apm(r.y, r.x, B, A); + X25519Field.Apm(p.y, p.x, d, c); + X25519Field.Mul(A, C, A); + X25519Field.Mul(B, D, B); + X25519Field.Mul(r.u, r.v, C); + X25519Field.Mul(C, p.t, C); + X25519Field.Mul(C, C_d2, C); + X25519Field.Mul(r.z, p.z, D); + X25519Field.Add(D, D, D); + X25519Field.Apm(B, A, H, E); + X25519Field.Apm(D, C, g, f); + X25519Field.Carry(g); + X25519Field.Mul(E, F, r.x); + X25519Field.Mul(G, H, r.y); + X25519Field.Mul(F, G, r.z); + } + + private static void PointAddVar(bool negate, PointExt p, PointExt q, PointExt r) + { + int[] A = X25519Field.Create(); + int[] B = X25519Field.Create(); + int[] C = X25519Field.Create(); + int[] D = X25519Field.Create(); + int[] E = X25519Field.Create(); + int[] F = X25519Field.Create(); + int[] G = X25519Field.Create(); + int[] H = X25519Field.Create(); + + int[] c, d, f, g; + if (negate) + { + c = D; d = C; f = G; g = F; + } + else + { + c = C; d = D; f = F; g = G; + } + + X25519Field.Apm(p.y, p.x, B, A); + X25519Field.Apm(q.y, q.x, d, c); + X25519Field.Mul(A, C, A); + X25519Field.Mul(B, D, B); + X25519Field.Mul(p.t, q.t, C); + X25519Field.Mul(C, C_d2, C); + X25519Field.Mul(p.z, q.z, D); + X25519Field.Add(D, D, D); + X25519Field.Apm(B, A, H, E); + X25519Field.Apm(D, C, g, f); + X25519Field.Carry(g); + X25519Field.Mul(E, F, r.x); + X25519Field.Mul(G, H, r.y); + X25519Field.Mul(F, G, r.z); + X25519Field.Mul(E, H, r.t); + } + + private static void PointAddPrecomp(PointPrecomp p, PointAccum r) + { + int[] A = X25519Field.Create(); + int[] B = X25519Field.Create(); + int[] C = X25519Field.Create(); + int[] E = r.u; + int[] F = X25519Field.Create(); + int[] G = X25519Field.Create(); + int[] H = r.v; + + X25519Field.Apm(r.y, r.x, B, A); + X25519Field.Mul(A, p.ymx_h, A); + X25519Field.Mul(B, p.ypx_h, B); + X25519Field.Mul(r.u, r.v, C); + X25519Field.Mul(C, p.xyd, C); + X25519Field.Apm(B, A, H, E); + X25519Field.Apm(r.z, C, G, F); + X25519Field.Carry(G); + X25519Field.Mul(E, F, r.x); + X25519Field.Mul(G, H, r.y); + X25519Field.Mul(F, G, r.z); + } + + private static PointExt PointCopy(PointAccum p) + { + PointExt r = new PointExt(); + X25519Field.Copy(p.x, 0, r.x, 0); + X25519Field.Copy(p.y, 0, r.y, 0); + X25519Field.Copy(p.z, 0, r.z, 0); + X25519Field.Mul(p.u, p.v, r.t); + return r; + } + + private static PointExt PointCopy(PointExt p) + { + PointExt r = new PointExt(); + X25519Field.Copy(p.x, 0, r.x, 0); + X25519Field.Copy(p.y, 0, r.y, 0); + X25519Field.Copy(p.z, 0, r.z, 0); + X25519Field.Copy(p.t, 0, r.t, 0); + return r; + } + + private static void PointDouble(PointAccum r) + { + int[] A = X25519Field.Create(); + int[] B = X25519Field.Create(); + int[] C = X25519Field.Create(); + int[] E = r.u; + int[] F = X25519Field.Create(); + int[] G = X25519Field.Create(); + int[] H = r.v; + + X25519Field.Sqr(r.x, A); + X25519Field.Sqr(r.y, B); + X25519Field.Sqr(r.z, C); + X25519Field.Add(C, C, C); + X25519Field.Apm(A, B, H, G); + X25519Field.Add(r.x, r.y, E); + X25519Field.Sqr(E, E); + X25519Field.Sub(H, E, E); + X25519Field.Add(C, G, F); + X25519Field.Carry(F); + X25519Field.Mul(E, F, r.x); + X25519Field.Mul(G, H, r.y); + X25519Field.Mul(F, G, r.z); + } + + private static void PointExtendXY(PointAccum p) + { + X25519Field.One(p.z); + X25519Field.Copy(p.x, 0, p.u, 0); + X25519Field.Copy(p.y, 0, p.v, 0); + } + + private static void PointExtendXY(PointExt p) + { + X25519Field.One(p.z); + X25519Field.Mul(p.x, p.y, p.t); + } + + private static void PointLookup(int block, int index, PointPrecomp p) + { + Debug.Assert(0 <= block && block < PrecompBlocks); + Debug.Assert(0 <= index && index < PrecompPoints); + + int off = block * PrecompPoints * 3 * X25519Field.Size; + + for (int i = 0; i < PrecompPoints; ++i) + { + int mask = ((i ^ index) - 1) >> 31; + Nat.CMov(X25519Field.Size, mask, precompBase, off, p.ypx_h, 0); off += X25519Field.Size; + Nat.CMov(X25519Field.Size, mask, precompBase, off, p.ymx_h, 0); off += X25519Field.Size; + Nat.CMov(X25519Field.Size, mask, precompBase, off, p.xyd, 0); off += X25519Field.Size; + } + } + + private static PointExt[] PointPrecompVar(PointExt p, int count) + { + Debug.Assert(count > 0); + + PointExt d = new PointExt(); + PointAddVar(false, p, p, d); + + PointExt[] table = new PointExt[count]; + table[0] = PointCopy(p); + for (int i = 1; i < count; ++i) + { + PointAddVar(false, table[i - 1], d, table[i] = new PointExt()); + } + return table; + } + + private static void PointSetNeutral(PointAccum p) + { + X25519Field.Zero(p.x); + X25519Field.One(p.y); + X25519Field.One(p.z); + X25519Field.Zero(p.u); + X25519Field.One(p.v); + } + + private static void PointSetNeutral(PointExt p) + { + X25519Field.Zero(p.x); + X25519Field.One(p.y); + X25519Field.One(p.z); + X25519Field.Zero(p.t); + } + + public static void Precompute() + { + lock (precompLock) + { + if (precompBase != null) + return; + + // Precomputed table for the base point in verification ladder + { + PointExt b = new PointExt(); + X25519Field.Copy(B_x, 0, b.x, 0); + X25519Field.Copy(B_y, 0, b.y, 0); + PointExtendXY(b); + + precompBaseTable = PointPrecompVar(b, 1 << (WnafWidthBase - 2)); + } + + PointAccum p = new PointAccum(); + X25519Field.Copy(B_x, 0, p.x, 0); + X25519Field.Copy(B_y, 0, p.y, 0); + PointExtendXY(p); + + precompBase = new int[PrecompBlocks * PrecompPoints * 3 * X25519Field.Size]; + + int off = 0; + for (int b = 0; b < PrecompBlocks; ++b) + { + PointExt[] ds = new PointExt[PrecompTeeth]; + + PointExt sum = new PointExt(); + PointSetNeutral(sum); + + for (int t = 0; t < PrecompTeeth; ++t) + { + PointExt q = PointCopy(p); + PointAddVar(true, sum, q, sum); + PointDouble(p); + + ds[t] = PointCopy(p); + + if (b + t != PrecompBlocks + PrecompTeeth - 2) + { + for (int s = 1; s < PrecompSpacing; ++s) + { + PointDouble(p); + } + } + } + + PointExt[] points = new PointExt[PrecompPoints]; + int k = 0; + points[k++] = sum; + + for (int t = 0; t < (PrecompTeeth - 1); ++t) + { + int size = 1 << t; + for (int j = 0; j < size; ++j, ++k) + { + PointAddVar(false, points[k - size], ds[t], points[k] = new PointExt()); + } + } + + Debug.Assert(k == PrecompPoints); + + for (int i = 0; i < PrecompPoints; ++i) + { + PointExt q = points[i]; + + int[] x = X25519Field.Create(); + int[] y = X25519Field.Create(); + + X25519Field.Add(q.z, q.z, x); + // TODO[ed25519] Batch inversion + X25519Field.Inv(x, y); + X25519Field.Mul(q.x, y, x); + X25519Field.Mul(q.y, y, y); + + PointPrecomp r = new PointPrecomp(); + X25519Field.Apm(y, x, r.ypx_h, r.ymx_h); + X25519Field.Mul(x, y, r.xyd); + X25519Field.Mul(r.xyd, C_d4, r.xyd); + + X25519Field.Normalize(r.ypx_h); + X25519Field.Normalize(r.ymx_h); + //X25519Field.Normalize(r.xyd); + + X25519Field.Copy(r.ypx_h, 0, precompBase, off); off += X25519Field.Size; + X25519Field.Copy(r.ymx_h, 0, precompBase, off); off += X25519Field.Size; + X25519Field.Copy(r.xyd, 0, precompBase, off); off += X25519Field.Size; + } + } + + Debug.Assert(off == precompBase.Length); + } + } + + private static void PruneScalar(byte[] n, int nOff, byte[] r) + { + Array.Copy(n, nOff, r, 0, ScalarBytes); + + r[0] &= 0xF8; + r[ScalarBytes - 1] &= 0x7F; + r[ScalarBytes - 1] |= 0x40; + } + + private static byte[] ReduceScalar(byte[] n) + { + long x00 = Decode32(n, 0) & M32L; // x00:32/-- + long x01 = (Decode24(n, 4) << 4) & M32L; // x01:28/-- + long x02 = Decode32(n, 7) & M32L; // x02:32/-- + long x03 = (Decode24(n, 11) << 4) & M32L; // x03:28/-- + long x04 = Decode32(n, 14) & M32L; // x04:32/-- + long x05 = (Decode24(n, 18) << 4) & M32L; // x05:28/-- + long x06 = Decode32(n, 21) & M32L; // x06:32/-- + long x07 = (Decode24(n, 25) << 4) & M32L; // x07:28/-- + long x08 = Decode32(n, 28) & M32L; // x08:32/-- + long x09 = (Decode24(n, 32) << 4) & M32L; // x09:28/-- + long x10 = Decode32(n, 35) & M32L; // x10:32/-- + long x11 = (Decode24(n, 39) << 4) & M32L; // x11:28/-- + long x12 = Decode32(n, 42) & M32L; // x12:32/-- + long x13 = (Decode24(n, 46) << 4) & M32L; // x13:28/-- + long x14 = Decode32(n, 49) & M32L; // x14:32/-- + long x15 = (Decode24(n, 53) << 4) & M32L; // x15:28/-- + long x16 = Decode32(n, 56) & M32L; // x16:32/-- + long x17 = (Decode24(n, 60) << 4) & M32L; // x17:28/-- + long x18 = n[63] & 0xFFL; // x18:08/-- + long t; + + //x18 += (x17 >> 28); x17 &= M28L; + x09 -= x18 * L0; // x09:34/28 + x10 -= x18 * L1; // x10:33/30 + x11 -= x18 * L2; // x11:35/28 + x12 -= x18 * L3; // x12:32/31 + x13 -= x18 * L4; // x13:28/21 + + x17 += (x16 >> 28); x16 &= M28L; // x17:28/--, x16:28/-- + x08 -= x17 * L0; // x08:54/32 + x09 -= x17 * L1; // x09:52/51 + x10 -= x17 * L2; // x10:55/34 + x11 -= x17 * L3; // x11:51/36 + x12 -= x17 * L4; // x12:41/-- + + //x16 += (x15 >> 28); x15 &= M28L; + x07 -= x16 * L0; // x07:54/28 + x08 -= x16 * L1; // x08:54/53 + x09 -= x16 * L2; // x09:55/53 + x10 -= x16 * L3; // x10:55/52 + x11 -= x16 * L4; // x11:51/41 + + x15 += (x14 >> 28); x14 &= M28L; // x15:28/--, x14:28/-- + x06 -= x15 * L0; // x06:54/32 + x07 -= x15 * L1; // x07:54/53 + x08 -= x15 * L2; // x08:56/-- + x09 -= x15 * L3; // x09:55/54 + x10 -= x15 * L4; // x10:55/53 + + //x14 += (x13 >> 28); x13 &= M28L; + x05 -= x14 * L0; // x05:54/28 + x06 -= x14 * L1; // x06:54/53 + x07 -= x14 * L2; // x07:56/-- + x08 -= x14 * L3; // x08:56/51 + x09 -= x14 * L4; // x09:56/-- + + x13 += (x12 >> 28); x12 &= M28L; // x13:28/22, x12:28/-- + x04 -= x13 * L0; // x04:54/49 + x05 -= x13 * L1; // x05:54/53 + x06 -= x13 * L2; // x06:56/-- + x07 -= x13 * L3; // x07:56/52 + x08 -= x13 * L4; // x08:56/52 + + x12 += (x11 >> 28); x11 &= M28L; // x12:28/24, x11:28/-- + x03 -= x12 * L0; // x03:54/49 + x04 -= x12 * L1; // x04:54/51 + x05 -= x12 * L2; // x05:56/-- + x06 -= x12 * L3; // x06:56/52 + x07 -= x12 * L4; // x07:56/53 + + x11 += (x10 >> 28); x10 &= M28L; // x11:29/--, x10:28/-- + x02 -= x11 * L0; // x02:55/32 + x03 -= x11 * L1; // x03:55/-- + x04 -= x11 * L2; // x04:56/55 + x05 -= x11 * L3; // x05:56/52 + x06 -= x11 * L4; // x06:56/53 + + x10 += (x09 >> 28); x09 &= M28L; // x10:29/--, x09:28/-- + x01 -= x10 * L0; // x01:55/28 + x02 -= x10 * L1; // x02:55/54 + x03 -= x10 * L2; // x03:56/55 + x04 -= x10 * L3; // x04:57/-- + x05 -= x10 * L4; // x05:56/53 + + x08 += (x07 >> 28); x07 &= M28L; // x08:56/53, x07:28/-- + x09 += (x08 >> 28); x08 &= M28L; // x09:29/25, x08:28/-- + + t = (x08 >> 27) & 1L; + x09 += t; // x09:29/26 + + x00 -= x09 * L0; // x00:55/53 + x01 -= x09 * L1; // x01:55/54 + x02 -= x09 * L2; // x02:57/-- + x03 -= x09 * L3; // x03:57/-- + x04 -= x09 * L4; // x04:57/42 + + x01 += (x00 >> 28); x00 &= M28L; + x02 += (x01 >> 28); x01 &= M28L; + x03 += (x02 >> 28); x02 &= M28L; + x04 += (x03 >> 28); x03 &= M28L; + x05 += (x04 >> 28); x04 &= M28L; + x06 += (x05 >> 28); x05 &= M28L; + x07 += (x06 >> 28); x06 &= M28L; + x08 += (x07 >> 28); x07 &= M28L; + x09 = (x08 >> 28); x08 &= M28L; + + x09 -= t; + + Debug.Assert(x09 == 0L || x09 == -1L); + + x00 += x09 & L0; + x01 += x09 & L1; + x02 += x09 & L2; + x03 += x09 & L3; + x04 += x09 & L4; + + x01 += (x00 >> 28); x00 &= M28L; + x02 += (x01 >> 28); x01 &= M28L; + x03 += (x02 >> 28); x02 &= M28L; + x04 += (x03 >> 28); x03 &= M28L; + x05 += (x04 >> 28); x04 &= M28L; + x06 += (x05 >> 28); x05 &= M28L; + x07 += (x06 >> 28); x06 &= M28L; + x08 += (x07 >> 28); x07 &= M28L; + + byte[] r = new byte[ScalarBytes]; + Encode56((ulong)(x00 | (x01 << 28)), r, 0); + Encode56((ulong)(x02 | (x03 << 28)), r, 7); + Encode56((ulong)(x04 | (x05 << 28)), r, 14); + Encode56((ulong)(x06 | (x07 << 28)), r, 21); + Encode32((uint)x08, r, 28); + return r; + } + + private static void ScalarMultBase(byte[] k, PointAccum r) + { + Precompute(); + + PointSetNeutral(r); + + uint[] n = new uint[ScalarUints]; + DecodeScalar(k, 0, n); + + // Recode the scalar into signed-digit form, then group comb bits in each block + { + uint c1 = Nat.CAdd(ScalarUints, ~(int)n[0] & 1, n, L, n); Debug.Assert(c1 == 0); + uint c2 = Nat.ShiftDownBit(ScalarUints, n, 1U); Debug.Assert(c2 == (1U << 31)); + + for (int i = 0; i < ScalarUints; ++i) + { + n[i] = Interleave.Shuffle2(n[i]); + } + } + + PointPrecomp p = new PointPrecomp(); + + int cOff = (PrecompSpacing - 1) * PrecompTeeth; + for (; ; ) + { + for (int b = 0; b < PrecompBlocks; ++b) + { + uint w = n[b] >> cOff; + int sign = (int)(w >> (PrecompTeeth - 1)) & 1; + int abs = ((int)w ^ -sign) & PrecompMask; + + Debug.Assert(sign == 0 || sign == 1); + Debug.Assert(0 <= abs && abs < PrecompPoints); + + PointLookup(b, abs, p); + + X25519Field.CSwap(sign, p.ypx_h, p.ymx_h); + X25519Field.CNegate(sign, p.xyd); + + PointAddPrecomp(p, r); + } + + if ((cOff -= PrecompTeeth) < 0) + break; + + PointDouble(r); + } + } + + private static void ScalarMultBaseEncoded(byte[] k, byte[] r, int rOff) + { + PointAccum p = new PointAccum(); + ScalarMultBase(k, p); + EncodePoint(p, r, rOff); + } + + internal static void ScalarMultBaseYZ(byte[] k, int kOff, int[] y, int[] z) + { + byte[] n = new byte[ScalarBytes]; + PruneScalar(k, kOff, n); + + PointAccum p = new PointAccum(); + ScalarMultBase(n, p); + X25519Field.Copy(p.y, 0, y, 0); + X25519Field.Copy(p.z, 0, z, 0); + } + + private static void ScalarMultStraussVar(uint[] nb, uint[] np, PointExt p, PointAccum r) + { + Precompute(); + + int width = 5; + + sbyte[] ws_b = GetWnaf(nb, WnafWidthBase); + sbyte[] ws_p = GetWnaf(np, width); + + PointExt[] tp = PointPrecompVar(p, 1 << (width - 2)); + + PointSetNeutral(r); + + int bit = 255; + while (bit > 0 && (ws_b[bit] | ws_p[bit]) == 0) + { + --bit; + } + + for (; ; ) + { + int wb = ws_b[bit]; + if (wb != 0) + { + int sign = wb >> 31; + int index = (wb ^ sign) >> 1; + + PointAddVar((sign != 0), precompBaseTable[index], r); + } + + int wp = ws_p[bit]; + if (wp != 0) + { + int sign = wp >> 31; + int index = (wp ^ sign) >> 1; + + PointAddVar((sign != 0), tp[index], r); + } + + if (--bit < 0) + break; + + PointDouble(r); + } + } + + public static void Sign(byte[] sk, int skOff, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + byte[] ctx = null; + byte phflag = 0x00; + + ImplSign(sk, skOff, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + public static void Sign(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + byte[] ctx = null; + byte phflag = 0x00; + + ImplSign(sk, skOff, pk, pkOff, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + public static void Sign(byte[] sk, int skOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + byte phflag = 0x00; + + ImplSign(sk, skOff, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + public static void Sign(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + byte phflag = 0x00; + + ImplSign(sk, skOff, pk, pkOff, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + public static void SignPrehash(byte[] sk, int skOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff) + { + byte phflag = 0x01; + + ImplSign(sk, skOff, ctx, phflag, ph, phOff, PrehashSize, sig, sigOff); + } + + public static void SignPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff) + { + byte phflag = 0x01; + + ImplSign(sk, skOff, pk, pkOff, ctx, phflag, ph, phOff, PrehashSize, sig, sigOff); + } + + public static void SignPrehash(byte[] sk, int skOff, byte[] ctx, IDigest ph, byte[] sig, int sigOff) + { + byte[] m = new byte[PrehashSize]; + if (PrehashSize != ph.DoFinal(m, 0)) + throw new ArgumentException("ph"); + + byte phflag = 0x01; + + ImplSign(sk, skOff, ctx, phflag, m, 0, m.Length, sig, sigOff); + } + + public static void SignPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, IDigest ph, byte[] sig, int sigOff) + { + byte[] m = new byte[PrehashSize]; + if (PrehashSize != ph.DoFinal(m, 0)) + throw new ArgumentException("ph"); + + byte phflag = 0x01; + + ImplSign(sk, skOff, pk, pkOff, ctx, phflag, m, 0, m.Length, sig, sigOff); + } + + public static bool Verify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] m, int mOff, int mLen) + { + byte[] ctx = null; + byte phflag = 0x00; + + return ImplVerify(sig, sigOff, pk, pkOff, ctx, phflag, m, mOff, mLen); + } + + public static bool Verify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen) + { + byte phflag = 0x00; + + return ImplVerify(sig, sigOff, pk, pkOff, ctx, phflag, m, mOff, mLen); + } + + public static bool VerifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff) + { + byte phflag = 0x01; + + return ImplVerify(sig, sigOff, pk, pkOff, ctx, phflag, ph, phOff, PrehashSize); + } + + public static bool VerifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, IDigest ph) + { + byte[] m = new byte[PrehashSize]; + if (PrehashSize != ph.DoFinal(m, 0)) + throw new ArgumentException("ph"); + + byte phflag = 0x01; + + return ImplVerify(sig, sigOff, pk, pkOff, ctx, phflag, m, 0, m.Length); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed25519.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed25519.cs.meta new file mode 100644 index 00000000..0d10e44b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed25519.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3713f23ee528ab4449a9c50481c6fd2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed448.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed448.cs new file mode 100644 index 00000000..a0d209e3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed448.cs @@ -0,0 +1,1160 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc7748; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Rfc8032 +{ + public abstract class Ed448 + { + public enum Algorithm + { + Ed448 = 0, + Ed448ph = 1, + } + + private const ulong M26UL = 0x03FFFFFFUL; + private const ulong M28UL = 0x0FFFFFFFUL; + + private const int PointBytes = 57; + private const int ScalarUints = 14; + private const int ScalarBytes = ScalarUints * 4 + 1; + + public static readonly int PrehashSize = 64; + public static readonly int PublicKeySize = PointBytes; + public static readonly int SecretKeySize = 57; + public static readonly int SignatureSize = PointBytes + ScalarBytes; + + private static readonly byte[] Dom4Prefix = Strings.ToByteArray("SigEd448"); + + private static readonly uint[] P = { 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, + 0xFFFFFFFEU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU }; + private static readonly uint[] L = { 0xAB5844F3U, 0x2378C292U, 0x8DC58F55U, 0x216CC272U, 0xAED63690U, 0xC44EDB49U, 0x7CCA23E9U, + 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0xFFFFFFFFU, 0x3FFFFFFFU }; + private static readonly BigInteger N = Nat.ToBigInteger(L.Length, L); + + private const int L_0 = 0x04A7BB0D; // L_0:26/24 + private const int L_1 = 0x0873D6D5; // L_1:27/23 + private const int L_2 = 0x0A70AADC; // L_2:27/26 + private const int L_3 = 0x03D8D723; // L_3:26/-- + private const int L_4 = 0x096FDE93; // L_4:27/25 + private const int L_5 = 0x0B65129C; // L_5:27/26 + private const int L_6 = 0x063BB124; // L_6:27/-- + private const int L_7 = 0x08335DC1; // L_7:27/22 + + private const int L4_0 = 0x029EEC34; // L4_0:25/24 + private const int L4_1 = 0x01CF5B55; // L4_1:25/-- + private const int L4_2 = 0x09C2AB72; // L4_2:27/25 + private const int L4_3 = 0x0F635C8E; // L4_3:28/-- + private const int L4_4 = 0x05BF7A4C; // L4_4:26/25 + private const int L4_5 = 0x0D944A72; // L4_5:28/-- + private const int L4_6 = 0x08EEC492; // L4_6:27/24 + private const int L4_7 = 0x20CD7705; // L4_7:29/24 + + private static readonly uint[] B_x = { 0x070CC05EU, 0x026A82BCU, 0x00938E26U, 0x080E18B0U, 0x0511433BU, 0x0F72AB66U, 0x0412AE1AU, + 0x0A3D3A46U, 0x0A6DE324U, 0x00F1767EU, 0x04657047U, 0x036DA9E1U, 0x05A622BFU, 0x0ED221D1U, 0x066BED0DU, 0x04F1970CU }; + private static readonly uint[] B_y = { 0x0230FA14U, 0x008795BFU, 0x07C8AD98U, 0x0132C4EDU, 0x09C4FDBDU, 0x01CE67C3U, 0x073AD3FFU, + 0x005A0C2DU, 0x07789C1EU, 0x0A398408U, 0x0A73736CU, 0x0C7624BEU, 0x003756C9U, 0x02488762U, 0x016EB6BCU, 0x0693F467U }; + private const int C_d = -39081; + + private const int WnafWidthBase = 7; + + private const int PrecompBlocks = 5; + private const int PrecompTeeth = 5; + private const int PrecompSpacing = 18; + private const int PrecompPoints = 1 << (PrecompTeeth - 1); + private const int PrecompMask = PrecompPoints - 1; + + private static readonly object precompLock = new object(); + // TODO[ed448] Convert to PointPrecomp + private static PointExt[] precompBaseTable = null; + private static uint[] precompBase = null; + + private class PointExt + { + internal uint[] x = X448Field.Create(); + internal uint[] y = X448Field.Create(); + internal uint[] z = X448Field.Create(); + } + + private class PointPrecomp + { + internal uint[] x = X448Field.Create(); + internal uint[] y = X448Field.Create(); + } + + private static byte[] CalculateS(byte[] r, byte[] k, byte[] s) + { + uint[] t = new uint[ScalarUints * 2]; DecodeScalar(r, 0, t); + uint[] u = new uint[ScalarUints]; DecodeScalar(k, 0, u); + uint[] v = new uint[ScalarUints]; DecodeScalar(s, 0, v); + + Nat.MulAddTo(14, u, v, t); + + byte[] result = new byte[ScalarBytes * 2]; + for (int i = 0; i < t.Length; ++i) + { + Encode32(t[i], result, i * 4); + } + return ReduceScalar(result); + } + + private static bool CheckContextVar(byte[] ctx) + { + return ctx != null && ctx.Length < 256; + } + + private static bool CheckPointVar(byte[] p) + { + if ((p[PointBytes - 1] & 0x7F) != 0x00) + return false; + + uint[] t = new uint[14]; + Decode32(p, 0, t, 0, 14); + return !Nat.Gte(14, t, P); + } + + private static bool CheckScalarVar(byte[] s) + { + if (s[ScalarBytes - 1] != 0x00) + return false; + + uint[] n = new uint[ScalarUints]; + DecodeScalar(s, 0, n); + return !Nat.Gte(ScalarUints, n, L); + } + + public static IXof CreatePrehash() + { + return CreateXof(); + } + + private static IXof CreateXof() + { + return new ShakeDigest(256); + } + + private static uint Decode16(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + return n; + } + + private static uint Decode24(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + n |= (uint)bs[++off] << 16; + return n; + } + + private static uint Decode32(byte[] bs, int off) + { + uint n = bs[off]; + n |= (uint)bs[++off] << 8; + n |= (uint)bs[++off] << 16; + n |= (uint)bs[++off] << 24; + return n; + } + + private static void Decode32(byte[] bs, int bsOff, uint[] n, int nOff, int nLen) + { + for (int i = 0; i < nLen; ++i) + { + n[nOff + i] = Decode32(bs, bsOff + i * 4); + } + } + + private static bool DecodePointVar(byte[] p, int pOff, bool negate, PointExt r) + { + byte[] py = Arrays.CopyOfRange(p, pOff, pOff + PointBytes); + if (!CheckPointVar(py)) + return false; + + int x_0 = (py[PointBytes - 1] & 0x80) >> 7; + py[PointBytes - 1] &= 0x7F; + + X448Field.Decode(py, 0, r.y); + + uint[] u = X448Field.Create(); + uint[] v = X448Field.Create(); + + X448Field.Sqr(r.y, u); + X448Field.Mul(u, (uint)-C_d, v); + X448Field.Negate(u, u); + X448Field.AddOne(u); + X448Field.AddOne(v); + + if (!X448Field.SqrtRatioVar(u, v, r.x)) + return false; + + X448Field.Normalize(r.x); + if (x_0 == 1 && X448Field.IsZeroVar(r.x)) + return false; + + if (negate ^ (x_0 != (r.x[0] & 1))) + { + X448Field.Negate(r.x, r.x); + } + + PointExtendXY(r); + return true; + } + + private static void DecodeScalar(byte[] k, int kOff, uint[] n) + { + Debug.Assert(k[kOff + ScalarBytes - 1] == 0x00); + + Decode32(k, kOff, n, 0, ScalarUints); + } + + private static void Dom4(IXof d, byte x, byte[] y) + { + d.BlockUpdate(Dom4Prefix, 0, Dom4Prefix.Length); + d.Update(x); + d.Update((byte)y.Length); + d.BlockUpdate(y, 0, y.Length); + } + + private static void Encode24(uint n, byte[] bs, int off) + { + bs[off] = (byte)(n); + bs[++off] = (byte)(n >> 8); + bs[++off] = (byte)(n >> 16); + } + + private static void Encode32(uint n, byte[] bs, int off) + { + bs[off] = (byte)(n); + bs[++off] = (byte)(n >> 8); + bs[++off] = (byte)(n >> 16); + bs[++off] = (byte)(n >> 24); + } + + private static void Encode56(ulong n, byte[] bs, int off) + { + Encode32((uint)n, bs, off); + Encode24((uint)(n >> 32), bs, off + 4); + } + + private static void EncodePoint(PointExt p, byte[] r, int rOff) + { + uint[] x = X448Field.Create(); + uint[] y = X448Field.Create(); + + X448Field.Inv(p.z, y); + X448Field.Mul(p.x, y, x); + X448Field.Mul(p.y, y, y); + X448Field.Normalize(x); + X448Field.Normalize(y); + + X448Field.Encode(y, r, rOff); + r[rOff + PointBytes - 1] = (byte)((x[0] & 1) << 7); + } + + public static void GeneratePrivateKey(SecureRandom random, byte[] k) + { + random.NextBytes(k); + } + + public static void GeneratePublicKey(byte[] sk, int skOff, byte[] pk, int pkOff) + { + IXof d = CreateXof(); + byte[] h = new byte[ScalarBytes * 2]; + + d.BlockUpdate(sk, skOff, SecretKeySize); + d.DoFinal(h, 0, h.Length); + + byte[] s = new byte[ScalarBytes]; + PruneScalar(h, 0, s); + + ScalarMultBaseEncoded(s, pk, pkOff); + } + + private static sbyte[] GetWnaf(uint[] n, int width) + { + Debug.Assert(n[ScalarUints - 1] >> 31 == 0U); + + uint[] t = new uint[ScalarUints * 2]; + { + uint c = 0; + int tPos = t.Length, i = ScalarUints; + while (--i >= 0) + { + uint next = n[i]; + t[--tPos] = (next >> 16) | (c << 16); + t[--tPos] = c = next; + } + } + + sbyte[] ws = new sbyte[448]; + + uint pow2 = 1U << width; + uint mask = pow2 - 1U; + uint sign = pow2 >> 1; + + uint carry = 0U; + int j = 0; + for (int i = 0; i < t.Length; ++i, j -= 16) + { + uint word = t[i]; + while (j < 16) + { + uint word16 = word >> j; + uint bit = word16 & 1U; + + if (bit == carry) + { + ++j; + continue; + } + + uint digit = (word16 & mask) + carry; + carry = digit & sign; + digit -= (carry << 1); + carry >>= (width - 1); + + ws[(i << 4) + j] = (sbyte)digit; + + j += width; + } + } + + Debug.Assert(carry == 0); + + return ws; + } + + private static void ImplSign(IXof d, byte[] h, byte[] s, byte[] pk, int pkOff, byte[] ctx, byte phflag, + byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + Dom4(d, phflag, ctx); + d.BlockUpdate(h, ScalarBytes, ScalarBytes); + d.BlockUpdate(m, mOff, mLen); + d.DoFinal(h, 0, h.Length); + + byte[] r = ReduceScalar(h); + byte[] R = new byte[PointBytes]; + ScalarMultBaseEncoded(r, R, 0); + + Dom4(d, phflag, ctx); + d.BlockUpdate(R, 0, PointBytes); + d.BlockUpdate(pk, pkOff, PointBytes); + d.BlockUpdate(m, mOff, mLen); + d.DoFinal(h, 0, h.Length); + + byte[] k = ReduceScalar(h); + byte[] S = CalculateS(r, k, s); + + Array.Copy(R, 0, sig, sigOff, PointBytes); + Array.Copy(S, 0, sig, sigOff + PointBytes, ScalarBytes); + } + + private static void ImplSign(byte[] sk, int skOff, byte[] ctx, byte phflag, byte[] m, int mOff, int mLen, + byte[] sig, int sigOff) + { + if (!CheckContextVar(ctx)) + throw new ArgumentException("ctx"); + + IXof d = CreateXof(); + byte[] h = new byte[ScalarBytes * 2]; + + d.BlockUpdate(sk, skOff, SecretKeySize); + d.DoFinal(h, 0, h.Length); + + byte[] s = new byte[ScalarBytes]; + PruneScalar(h, 0, s); + + byte[] pk = new byte[PointBytes]; + ScalarMultBaseEncoded(s, pk, 0); + + ImplSign(d, h, s, pk, 0, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + private static void ImplSign(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte phflag, + byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + if (!CheckContextVar(ctx)) + throw new ArgumentException("ctx"); + + IXof d = CreateXof(); + byte[] h = new byte[ScalarBytes * 2]; + + d.BlockUpdate(sk, skOff, SecretKeySize); + d.DoFinal(h, 0, h.Length); + + byte[] s = new byte[ScalarBytes]; + PruneScalar(h, 0, s); + + ImplSign(d, h, s, pk, pkOff, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + private static bool ImplVerify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte phflag, + byte[] m, int mOff, int mLen) + { + if (!CheckContextVar(ctx)) + throw new ArgumentException("ctx"); + + byte[] R = Arrays.CopyOfRange(sig, sigOff, sigOff + PointBytes); + byte[] S = Arrays.CopyOfRange(sig, sigOff + PointBytes, sigOff + SignatureSize); + + if (!CheckPointVar(R)) + return false; + + if (!CheckScalarVar(S)) + return false; + + PointExt pA = new PointExt(); + if (!DecodePointVar(pk, pkOff, true, pA)) + return false; + + IXof d = CreateXof(); + byte[] h = new byte[ScalarBytes * 2]; + + Dom4(d, phflag, ctx); + d.BlockUpdate(R, 0, PointBytes); + d.BlockUpdate(pk, pkOff, PointBytes); + d.BlockUpdate(m, mOff, mLen); + d.DoFinal(h, 0, h.Length); + + byte[] k = ReduceScalar(h); + + uint[] nS = new uint[ScalarUints]; + DecodeScalar(S, 0, nS); + + uint[] nA = new uint[ScalarUints]; + DecodeScalar(k, 0, nA); + + PointExt pR = new PointExt(); + ScalarMultStraussVar(nS, nA, pA, pR); + + byte[] check = new byte[PointBytes]; + EncodePoint(pR, check, 0); + + return Arrays.AreEqual(check, R); + } + + private static void PointAddVar(bool negate, PointExt p, PointExt r) + { + uint[] A = X448Field.Create(); + uint[] B = X448Field.Create(); + uint[] C = X448Field.Create(); + uint[] D = X448Field.Create(); + uint[] E = X448Field.Create(); + uint[] F = X448Field.Create(); + uint[] G = X448Field.Create(); + uint[] H = X448Field.Create(); + + uint[] b, e, f, g; + if (negate) + { + b = E; e = B; f = G; g = F; + X448Field.Sub(p.y, p.x, H); + } + else + { + b = B; e = E; f = F; g = G; + X448Field.Add(p.y, p.x, H); + } + + X448Field.Mul(p.z, r.z, A); + X448Field.Sqr(A, B); + X448Field.Mul(p.x, r.x, C); + X448Field.Mul(p.y, r.y, D); + X448Field.Mul(C, D, E); + X448Field.Mul(E, -C_d, E); + //X448Field.Apm(B, E, F, G); + X448Field.Add(B, E, f); + X448Field.Sub(B, E, g); + X448Field.Add(r.x, r.y, E); + X448Field.Mul(H, E, H); + //X448Field.Apm(D, C, B, E); + X448Field.Add(D, C, b); + X448Field.Sub(D, C, e); + X448Field.Carry(b); + X448Field.Sub(H, B, H); + X448Field.Mul(H, A, H); + X448Field.Mul(E, A, E); + X448Field.Mul(F, H, r.x); + X448Field.Mul(E, G, r.y); + X448Field.Mul(F, G, r.z); + } + + private static void PointAddPrecomp(PointPrecomp p, PointExt r) + { + uint[] B = X448Field.Create(); + uint[] C = X448Field.Create(); + uint[] D = X448Field.Create(); + uint[] E = X448Field.Create(); + uint[] F = X448Field.Create(); + uint[] G = X448Field.Create(); + uint[] H = X448Field.Create(); + + X448Field.Sqr(r.z, B); + X448Field.Mul(p.x, r.x, C); + X448Field.Mul(p.y, r.y, D); + X448Field.Mul(C, D, E); + X448Field.Mul(E, -C_d, E); + //X448Field.Apm(B, E, F, G); + X448Field.Add(B, E, F); + X448Field.Sub(B, E, G); + X448Field.Add(p.x, p.y, B); + X448Field.Add(r.x, r.y, E); + X448Field.Mul(B, E, H); + //X448Field.Apm(D, C, B, E); + X448Field.Add(D, C, B); + X448Field.Sub(D, C, E); + X448Field.Carry(B); + X448Field.Sub(H, B, H); + X448Field.Mul(H, r.z, H); + X448Field.Mul(E, r.z, E); + X448Field.Mul(F, H, r.x); + X448Field.Mul(E, G, r.y); + X448Field.Mul(F, G, r.z); + } + + private static PointExt PointCopy(PointExt p) + { + PointExt r = new PointExt(); + X448Field.Copy(p.x, 0, r.x, 0); + X448Field.Copy(p.y, 0, r.y, 0); + X448Field.Copy(p.z, 0, r.z, 0); + return r; + } + + private static void PointDouble(PointExt r) + { + uint[] B = X448Field.Create(); + uint[] C = X448Field.Create(); + uint[] D = X448Field.Create(); + uint[] E = X448Field.Create(); + uint[] H = X448Field.Create(); + uint[] J = X448Field.Create(); + + X448Field.Add(r.x, r.y, B); + X448Field.Sqr(B, B); + X448Field.Sqr(r.x, C); + X448Field.Sqr(r.y, D); + X448Field.Add(C, D, E); + X448Field.Carry(E); + X448Field.Sqr(r.z, H); + X448Field.Add(H, H, H); + X448Field.Carry(H); + X448Field.Sub(E, H, J); + X448Field.Sub(B, E, B); + X448Field.Sub(C, D, C); + X448Field.Mul(B, J, r.x); + X448Field.Mul(E, C, r.y); + X448Field.Mul(E, J, r.z); + } + + private static void PointExtendXY(PointExt p) + { + X448Field.One(p.z); + } + + private static void PointLookup(int block, int index, PointPrecomp p) + { + Debug.Assert(0 <= block && block < PrecompBlocks); + Debug.Assert(0 <= index && index < PrecompPoints); + + int off = block * PrecompPoints * 2 * X448Field.Size; + + for (int i = 0; i < PrecompPoints; ++i) + { + int mask = ((i ^ index) - 1) >> 31; + Nat.CMov(X448Field.Size, mask, precompBase, off, p.x, 0); off += X448Field.Size; + Nat.CMov(X448Field.Size, mask, precompBase, off, p.y, 0); off += X448Field.Size; + } + } + + private static PointExt[] PointPrecompVar(PointExt p, int count) + { + Debug.Assert(count > 0); + + PointExt d = PointCopy(p); + PointDouble(d); + + PointExt[] table = new PointExt[count]; + table[0] = PointCopy(p); + for (int i = 1; i < count; ++i) + { + table[i] = PointCopy(table[i - 1]); + PointAddVar(false, d, table[i]); + } + return table; + } + + private static void PointSetNeutral(PointExt p) + { + X448Field.Zero(p.x); + X448Field.One(p.y); + X448Field.One(p.z); + } + + public static void Precompute() + { + lock (precompLock) + { + if (precompBase != null) + return; + + PointExt p = new PointExt(); + X448Field.Copy(B_x, 0, p.x, 0); + X448Field.Copy(B_y, 0, p.y, 0); + PointExtendXY(p); + + precompBaseTable = PointPrecompVar(p, 1 << (WnafWidthBase - 2)); + + precompBase = new uint[PrecompBlocks * PrecompPoints * 2 * X448Field.Size]; + + int off = 0; + for (int b = 0; b < PrecompBlocks; ++b) + { + PointExt[] ds = new PointExt[PrecompTeeth]; + + PointExt sum = new PointExt(); + PointSetNeutral(sum); + + for (int t = 0; t < PrecompTeeth; ++t) + { + PointAddVar(true, p, sum); + PointDouble(p); + + ds[t] = PointCopy(p); + + if (b + t != PrecompBlocks + PrecompTeeth - 2) + { + for (int s = 1; s < PrecompSpacing; ++s) + { + PointDouble(p); + } + } + } + + PointExt[] points = new PointExt[PrecompPoints]; + int k = 0; + points[k++] = sum; + + for (int t = 0; t < (PrecompTeeth - 1); ++t) + { + int size = 1 << t; + for (int j = 0; j < size; ++j, ++k) + { + points[k] = PointCopy(points[k - size]); + PointAddVar(false, ds[t], points[k]); + } + } + + Debug.Assert(k == PrecompPoints); + + for (int i = 0; i < PrecompPoints; ++i) + { + PointExt q = points[i]; + // TODO[ed448] Batch inversion + X448Field.Inv(q.z, q.z); + X448Field.Mul(q.x, q.z, q.x); + X448Field.Mul(q.y, q.z, q.y); + + //X448Field.Normalize(q.x); + //X448Field.Normalize(q.y); + + X448Field.Copy(q.x, 0, precompBase, off); off += X448Field.Size; + X448Field.Copy(q.y, 0, precompBase, off); off += X448Field.Size; + } + } + + Debug.Assert(off == precompBase.Length); + } + } + + private static void PruneScalar(byte[] n, int nOff, byte[] r) + { + Array.Copy(n, nOff, r, 0, ScalarBytes - 1); + + r[0] &= 0xFC; + r[ScalarBytes - 2] |= 0x80; + r[ScalarBytes - 1] = 0x00; + } + + private static byte[] ReduceScalar(byte[] n) + { + ulong x00 = Decode32(n, 0); // x00:32/-- + ulong x01 = (Decode24(n, 4) << 4); // x01:28/-- + ulong x02 = Decode32(n, 7); // x02:32/-- + ulong x03 = (Decode24(n, 11) << 4); // x03:28/-- + ulong x04 = Decode32(n, 14); // x04:32/-- + ulong x05 = (Decode24(n, 18) << 4); // x05:28/-- + ulong x06 = Decode32(n, 21); // x06:32/-- + ulong x07 = (Decode24(n, 25) << 4); // x07:28/-- + ulong x08 = Decode32(n, 28); // x08:32/-- + ulong x09 = (Decode24(n, 32) << 4); // x09:28/-- + ulong x10 = Decode32(n, 35); // x10:32/-- + ulong x11 = (Decode24(n, 39) << 4); // x11:28/-- + ulong x12 = Decode32(n, 42); // x12:32/-- + ulong x13 = (Decode24(n, 46) << 4); // x13:28/-- + ulong x14 = Decode32(n, 49); // x14:32/-- + ulong x15 = (Decode24(n, 53) << 4); // x15:28/-- + ulong x16 = Decode32(n, 56); // x16:32/-- + ulong x17 = (Decode24(n, 60) << 4); // x17:28/-- + ulong x18 = Decode32(n, 63); // x18:32/-- + ulong x19 = (Decode24(n, 67) << 4); // x19:28/-- + ulong x20 = Decode32(n, 70); // x20:32/-- + ulong x21 = (Decode24(n, 74) << 4); // x21:28/-- + ulong x22 = Decode32(n, 77); // x22:32/-- + ulong x23 = (Decode24(n, 81) << 4); // x23:28/-- + ulong x24 = Decode32(n, 84); // x24:32/-- + ulong x25 = (Decode24(n, 88) << 4); // x25:28/-- + ulong x26 = Decode32(n, 91); // x26:32/-- + ulong x27 = (Decode24(n, 95) << 4); // x27:28/-- + ulong x28 = Decode32(n, 98); // x28:32/-- + ulong x29 = (Decode24(n, 102) << 4); // x29:28/-- + ulong x30 = Decode32(n, 105); // x30:32/-- + ulong x31 = (Decode24(n, 109) << 4); // x31:28/-- + ulong x32 = Decode16(n, 112); // x32:16/-- + + // x32 += (x31 >> 28); x31 &= M28UL; + x16 += x32 * L4_0; // x16:42/-- + x17 += x32 * L4_1; // x17:41/28 + x18 += x32 * L4_2; // x18:43/42 + x19 += x32 * L4_3; // x19:44/28 + x20 += x32 * L4_4; // x20:43/-- + x21 += x32 * L4_5; // x21:44/28 + x22 += x32 * L4_6; // x22:43/41 + x23 += x32 * L4_7; // x23:45/41 + + x31 += (x30 >> 28); x30 &= M28UL; // x31:28/--, x30:28/-- + x15 += x31 * L4_0; // x15:54/-- + x16 += x31 * L4_1; // x16:53/42 + x17 += x31 * L4_2; // x17:55/54 + x18 += x31 * L4_3; // x18:56/44 + x19 += x31 * L4_4; // x19:55/-- + x20 += x31 * L4_5; // x20:56/43 + x21 += x31 * L4_6; // x21:55/53 + x22 += x31 * L4_7; // x22:57/53 + + //x30 += (x29 >> 28); x29 &= M28UL; + x14 += x30 * L4_0; // x14:54/-- + x15 += x30 * L4_1; // x15:54/53 + x16 += x30 * L4_2; // x16:56/-- + x17 += x30 * L4_3; // x17:57/-- + x18 += x30 * L4_4; // x18:56/55 + x19 += x30 * L4_5; // x19:56/55 + x20 += x30 * L4_6; // x20:57/-- + x21 += x30 * L4_7; // x21:57/56 + + x29 += (x28 >> 28); x28 &= M28UL; // x29:28/--, x28:28/-- + x13 += x29 * L4_0; // x13:54/-- + x14 += x29 * L4_1; // x14:54/53 + x15 += x29 * L4_2; // x15:56/-- + x16 += x29 * L4_3; // x16:57/-- + x17 += x29 * L4_4; // x17:57/55 + x18 += x29 * L4_5; // x18:57/55 + x19 += x29 * L4_6; // x19:57/52 + x20 += x29 * L4_7; // x20:58/52 + + //x28 += (x27 >> 28); x27 &= M28UL; + x12 += x28 * L4_0; // x12:54/-- + x13 += x28 * L4_1; // x13:54/53 + x14 += x28 * L4_2; // x14:56/-- + x15 += x28 * L4_3; // x15:57/-- + x16 += x28 * L4_4; // x16:57/55 + x17 += x28 * L4_5; // x17:58/-- + x18 += x28 * L4_6; // x18:58/-- + x19 += x28 * L4_7; // x19:58/53 + + x27 += (x26 >> 28); x26 &= M28UL; // x27:28/--, x26:28/-- + x11 += x27 * L4_0; // x11:54/-- + x12 += x27 * L4_1; // x12:54/53 + x13 += x27 * L4_2; // x13:56/-- + x14 += x27 * L4_3; // x14:57/-- + x15 += x27 * L4_4; // x15:57/55 + x16 += x27 * L4_5; // x16:58/-- + x17 += x27 * L4_6; // x17:58/56 + x18 += x27 * L4_7; // x18:59/-- + + //x26 += (x25 >> 28); x25 &= M28UL; + x10 += x26 * L4_0; // x10:54/-- + x11 += x26 * L4_1; // x11:54/53 + x12 += x26 * L4_2; // x12:56/-- + x13 += x26 * L4_3; // x13:57/-- + x14 += x26 * L4_4; // x14:57/55 + x15 += x26 * L4_5; // x15:58/-- + x16 += x26 * L4_6; // x16:58/56 + x17 += x26 * L4_7; // x17:59/-- + + x25 += (x24 >> 28); x24 &= M28UL; // x25:28/--, x24:28/-- + x09 += x25 * L4_0; // x09:54/-- + x10 += x25 * L4_1; // x10:54/53 + x11 += x25 * L4_2; // x11:56/-- + x12 += x25 * L4_3; // x12:57/-- + x13 += x25 * L4_4; // x13:57/55 + x14 += x25 * L4_5; // x14:58/-- + x15 += x25 * L4_6; // x15:58/56 + x16 += x25 * L4_7; // x16:59/-- + + x21 += (x20 >> 28); x20 &= M28UL; // x21:58/--, x20:28/-- + x22 += (x21 >> 28); x21 &= M28UL; // x22:57/54, x21:28/-- + x23 += (x22 >> 28); x22 &= M28UL; // x23:45/42, x22:28/-- + x24 += (x23 >> 28); x23 &= M28UL; // x24:28/18, x23:28/-- + + x08 += x24 * L4_0; // x08:54/-- + x09 += x24 * L4_1; // x09:55/-- + x10 += x24 * L4_2; // x10:56/46 + x11 += x24 * L4_3; // x11:57/46 + x12 += x24 * L4_4; // x12:57/55 + x13 += x24 * L4_5; // x13:58/-- + x14 += x24 * L4_6; // x14:58/56 + x15 += x24 * L4_7; // x15:59/-- + + x07 += x23 * L4_0; // x07:54/-- + x08 += x23 * L4_1; // x08:54/53 + x09 += x23 * L4_2; // x09:56/53 + x10 += x23 * L4_3; // x10:57/46 + x11 += x23 * L4_4; // x11:57/55 + x12 += x23 * L4_5; // x12:58/-- + x13 += x23 * L4_6; // x13:58/56 + x14 += x23 * L4_7; // x14:59/-- + + x06 += x22 * L4_0; // x06:54/-- + x07 += x22 * L4_1; // x07:54/53 + x08 += x22 * L4_2; // x08:56/-- + x09 += x22 * L4_3; // x09:57/53 + x10 += x22 * L4_4; // x10:57/55 + x11 += x22 * L4_5; // x11:58/-- + x12 += x22 * L4_6; // x12:58/56 + x13 += x22 * L4_7; // x13:59/-- + + x18 += (x17 >> 28); x17 &= M28UL; // x18:59/31, x17:28/-- + x19 += (x18 >> 28); x18 &= M28UL; // x19:58/54, x18:28/-- + x20 += (x19 >> 28); x19 &= M28UL; // x20:30/29, x19:28/-- + x21 += (x20 >> 28); x20 &= M28UL; // x21:28/03, x20:28/-- + + x05 += x21 * L4_0; // x05:54/-- + x06 += x21 * L4_1; // x06:55/-- + x07 += x21 * L4_2; // x07:56/31 + x08 += x21 * L4_3; // x08:57/31 + x09 += x21 * L4_4; // x09:57/56 + x10 += x21 * L4_5; // x10:58/-- + x11 += x21 * L4_6; // x11:58/56 + x12 += x21 * L4_7; // x12:59/-- + + x04 += x20 * L4_0; // x04:54/-- + x05 += x20 * L4_1; // x05:54/53 + x06 += x20 * L4_2; // x06:56/53 + x07 += x20 * L4_3; // x07:57/31 + x08 += x20 * L4_4; // x08:57/55 + x09 += x20 * L4_5; // x09:58/-- + x10 += x20 * L4_6; // x10:58/56 + x11 += x20 * L4_7; // x11:59/-- + + x03 += x19 * L4_0; // x03:54/-- + x04 += x19 * L4_1; // x04:54/53 + x05 += x19 * L4_2; // x05:56/-- + x06 += x19 * L4_3; // x06:57/53 + x07 += x19 * L4_4; // x07:57/55 + x08 += x19 * L4_5; // x08:58/-- + x09 += x19 * L4_6; // x09:58/56 + x10 += x19 * L4_7; // x10:59/-- + + x15 += (x14 >> 28); x14 &= M28UL; // x15:59/31, x14:28/-- + x16 += (x15 >> 28); x15 &= M28UL; // x16:59/32, x15:28/-- + x17 += (x16 >> 28); x16 &= M28UL; // x17:31/29, x16:28/-- + x18 += (x17 >> 28); x17 &= M28UL; // x18:28/04, x17:28/-- + + x02 += x18 * L4_0; // x02:54/-- + x03 += x18 * L4_1; // x03:55/-- + x04 += x18 * L4_2; // x04:56/32 + x05 += x18 * L4_3; // x05:57/32 + x06 += x18 * L4_4; // x06:57/56 + x07 += x18 * L4_5; // x07:58/-- + x08 += x18 * L4_6; // x08:58/56 + x09 += x18 * L4_7; // x09:59/-- + + x01 += x17 * L4_0; // x01:54/-- + x02 += x17 * L4_1; // x02:54/53 + x03 += x17 * L4_2; // x03:56/53 + x04 += x17 * L4_3; // x04:57/32 + x05 += x17 * L4_4; // x05:57/55 + x06 += x17 * L4_5; // x06:58/-- + x07 += x17 * L4_6; // x07:58/56 + x08 += x17 * L4_7; // x08:59/-- + + x16 *= 4; + x16 += (x15 >> 26); x15 &= M26UL; + x16 += 1; // x16:30/01 + + x00 += x16 * L_0; + x01 += x16 * L_1; + x02 += x16 * L_2; + x03 += x16 * L_3; + x04 += x16 * L_4; + x05 += x16 * L_5; + x06 += x16 * L_6; + x07 += x16 * L_7; + + x01 += (x00 >> 28); x00 &= M28UL; + x02 += (x01 >> 28); x01 &= M28UL; + x03 += (x02 >> 28); x02 &= M28UL; + x04 += (x03 >> 28); x03 &= M28UL; + x05 += (x04 >> 28); x04 &= M28UL; + x06 += (x05 >> 28); x05 &= M28UL; + x07 += (x06 >> 28); x06 &= M28UL; + x08 += (x07 >> 28); x07 &= M28UL; + x09 += (x08 >> 28); x08 &= M28UL; + x10 += (x09 >> 28); x09 &= M28UL; + x11 += (x10 >> 28); x10 &= M28UL; + x12 += (x11 >> 28); x11 &= M28UL; + x13 += (x12 >> 28); x12 &= M28UL; + x14 += (x13 >> 28); x13 &= M28UL; + x15 += (x14 >> 28); x14 &= M28UL; + x16 = (x15 >> 26); x15 &= M26UL; + + x16 -= 1; + + Debug.Assert(x16 == 0UL || x16 == ulong.MaxValue); + + x00 -= x16 & L_0; + x01 -= x16 & L_1; + x02 -= x16 & L_2; + x03 -= x16 & L_3; + x04 -= x16 & L_4; + x05 -= x16 & L_5; + x06 -= x16 & L_6; + x07 -= x16 & L_7; + + x01 += (ulong)((long)x00 >> 28); x00 &= M28UL; + x02 += (ulong)((long)x01 >> 28); x01 &= M28UL; + x03 += (ulong)((long)x02 >> 28); x02 &= M28UL; + x04 += (ulong)((long)x03 >> 28); x03 &= M28UL; + x05 += (ulong)((long)x04 >> 28); x04 &= M28UL; + x06 += (ulong)((long)x05 >> 28); x05 &= M28UL; + x07 += (ulong)((long)x06 >> 28); x06 &= M28UL; + x08 += (ulong)((long)x07 >> 28); x07 &= M28UL; + x09 += (ulong)((long)x08 >> 28); x08 &= M28UL; + x10 += (ulong)((long)x09 >> 28); x09 &= M28UL; + x11 += (ulong)((long)x10 >> 28); x10 &= M28UL; + x12 += (ulong)((long)x11 >> 28); x11 &= M28UL; + x13 += (ulong)((long)x12 >> 28); x12 &= M28UL; + x14 += (ulong)((long)x13 >> 28); x13 &= M28UL; + x15 += (ulong)((long)x14 >> 28); x14 &= M28UL; + + Debug.Assert(x15 >> 26 == 0UL); + + byte[] r = new byte[ScalarBytes]; + Encode56(x00 | (x01 << 28), r, 0); + Encode56(x02 | (x03 << 28), r, 7); + Encode56(x04 | (x05 << 28), r, 14); + Encode56(x06 | (x07 << 28), r, 21); + Encode56(x08 | (x09 << 28), r, 28); + Encode56(x10 | (x11 << 28), r, 35); + Encode56(x12 | (x13 << 28), r, 42); + Encode56(x14 | (x15 << 28), r, 49); + //r[ScalarBytes - 1] = 0; + return r; + } + + private static void ScalarMultBase(byte[] k, PointExt r) + { + Precompute(); + + PointSetNeutral(r); + + uint[] n = new uint[ScalarUints + 1]; + DecodeScalar(k, 0, n); + + // Recode the scalar into signed-digit form + { + n[ScalarUints] = 4U + Nat.CAdd(ScalarUints, ~(int)n[0] & 1, n, L, n); + uint c = Nat.ShiftDownBit(n.Length, n, 0); + Debug.Assert(c == (1U << 31)); + } + + PointPrecomp p = new PointPrecomp(); + + int cOff = PrecompSpacing - 1; + for (;;) + { + int tPos = cOff; + + for (int b = 0; b < PrecompBlocks; ++b) + { + uint w = 0; + for (int t = 0; t < PrecompTeeth; ++t) + { + uint tBit = n[tPos >> 5] >> (tPos & 0x1F); + w &= ~(1U << t); + w ^= (tBit << t); + tPos += PrecompSpacing; + } + + int sign = (int)(w >> (PrecompTeeth - 1)) & 1; + int abs = ((int)w ^ -sign) & PrecompMask; + + Debug.Assert(sign == 0 || sign == 1); + Debug.Assert(0 <= abs && abs < PrecompPoints); + + PointLookup(b, abs, p); + + X448Field.CNegate(sign, p.x); + + PointAddPrecomp(p, r); + } + + if (--cOff < 0) + break; + + PointDouble(r); + } + } + + private static void ScalarMultBaseEncoded(byte[] k, byte[] r, int rOff) + { + PointExt p = new PointExt(); + ScalarMultBase(k, p); + EncodePoint(p, r, rOff); + } + + internal static void ScalarMultBaseXY(byte[] k, int kOff, uint[] x, uint[] y) + { + byte[] n = new byte[ScalarBytes]; + PruneScalar(k, kOff, n); + + PointExt p = new PointExt(); + ScalarMultBase(n, p); + X448Field.Copy(p.x, 0, x, 0); + X448Field.Copy(p.y, 0, y, 0); + } + + private static void ScalarMultStraussVar(uint[] nb, uint[] np, PointExt p, PointExt r) + { + Precompute(); + + int width = 5; + + sbyte[] ws_b = GetWnaf(nb, WnafWidthBase); + sbyte[] ws_p = GetWnaf(np, width); + + PointExt[] tp = PointPrecompVar(p, 1 << (width - 2)); + + PointSetNeutral(r); + + int bit = 447; + while (bit > 0 && (ws_b[bit] | ws_p[bit]) == 0) + { + --bit; + } + + for (;;) + { + int wb = ws_b[bit]; + if (wb != 0) + { + int sign = wb >> 31; + int index = (wb ^ sign) >> 1; + + PointAddVar((sign != 0), precompBaseTable[index], r); + } + + int wp = ws_p[bit]; + if (wp != 0) + { + int sign = wp >> 31; + int index = (wp ^ sign) >> 1; + + PointAddVar((sign != 0), tp[index], r); + } + + if (--bit < 0) + break; + + PointDouble(r); + } + } + + public static void Sign(byte[] sk, int skOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + byte phflag = 0x00; + + ImplSign(sk, skOff, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + public static void Sign(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen, byte[] sig, int sigOff) + { + byte phflag = 0x00; + + ImplSign(sk, skOff, pk, pkOff, ctx, phflag, m, mOff, mLen, sig, sigOff); + } + + public static void SignPrehash(byte[] sk, int skOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff) + { + byte phflag = 0x01; + + ImplSign(sk, skOff, ctx, phflag, ph, phOff, PrehashSize, sig, sigOff); + } + + public static void SignPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff, byte[] sig, int sigOff) + { + byte phflag = 0x01; + + ImplSign(sk, skOff, pk, pkOff, ctx, phflag, ph, phOff, PrehashSize, sig, sigOff); + } + + public static void SignPrehash(byte[] sk, int skOff, byte[] ctx, IXof ph, byte[] sig, int sigOff) + { + byte[] m = new byte[PrehashSize]; + if (PrehashSize != ph.DoFinal(m, 0, PrehashSize)) + throw new ArgumentException("ph"); + + byte phflag = 0x01; + + ImplSign(sk, skOff, ctx, phflag, m, 0, m.Length, sig, sigOff); + } + + public static void SignPrehash(byte[] sk, int skOff, byte[] pk, int pkOff, byte[] ctx, IXof ph, byte[] sig, int sigOff) + { + byte[] m = new byte[PrehashSize]; + if (PrehashSize != ph.DoFinal(m, 0, PrehashSize)) + throw new ArgumentException("ph"); + + byte phflag = 0x01; + + ImplSign(sk, skOff, pk, pkOff, ctx, phflag, m, 0, m.Length, sig, sigOff); + } + + public static bool Verify(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] m, int mOff, int mLen) + { + byte phflag = 0x00; + + return ImplVerify(sig, sigOff, pk, pkOff, ctx, phflag, m, mOff, mLen); + } + + public static bool VerifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, byte[] ph, int phOff) + { + byte phflag = 0x01; + + return ImplVerify(sig, sigOff, pk, pkOff, ctx, phflag, ph, phOff, PrehashSize); + } + + public static bool VerifyPrehash(byte[] sig, int sigOff, byte[] pk, int pkOff, byte[] ctx, IXof ph) + { + byte[] m = new byte[PrehashSize]; + if (PrehashSize != ph.DoFinal(m, 0, PrehashSize)) + throw new ArgumentException("ph"); + + byte phflag = 0x01; + + return ImplVerify(sig, sigOff, pk, pkOff, ctx, phflag, m, 0, m.Length); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed448.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed448.cs.meta new file mode 100644 index 00000000..4b7df1a2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/ec/rfc8032/Ed448.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c64dbb57202f6ea4d9bb61c1bf7a39b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field.meta new file mode 100644 index 00000000..735d8ed5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8e4af59d5da39324490dcbe72fd54f35 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/FiniteFields.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/FiniteFields.cs new file mode 100644 index 00000000..a4232075 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/FiniteFields.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field +{ + public abstract class FiniteFields + { + internal static readonly IFiniteField GF_2 = new PrimeField(BigInteger.ValueOf(2)); + internal static readonly IFiniteField GF_3 = new PrimeField(BigInteger.ValueOf(3)); + + public static IPolynomialExtensionField GetBinaryExtensionField(int[] exponents) + { + if (exponents[0] != 0) + { + throw new ArgumentException("Irreducible polynomials in GF(2) must have constant term", "exponents"); + } + for (int i = 1; i < exponents.Length; ++i) + { + if (exponents[i] <= exponents[i - 1]) + { + throw new ArgumentException("Polynomial exponents must be montonically increasing", "exponents"); + } + } + + return new GenericPolynomialExtensionField(GF_2, new GF2Polynomial(exponents)); + } + + // public static IPolynomialExtensionField GetTernaryExtensionField(Term[] terms) + // { + // return new GenericPolynomialExtensionField(GF_3, new GF3Polynomial(terms)); + // } + + public static IFiniteField GetPrimeField(BigInteger characteristic) + { + int bitLength = characteristic.BitLength; + if (characteristic.SignValue <= 0 || bitLength < 2) + { + throw new ArgumentException("Must be >= 2", "characteristic"); + } + + if (bitLength < 3) + { + switch (characteristic.IntValue) + { + case 2: + return GF_2; + case 3: + return GF_3; + } + } + + return new PrimeField(characteristic); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/FiniteFields.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/FiniteFields.cs.meta new file mode 100644 index 00000000..4a4ed74d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/FiniteFields.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 92b0c0982de25d14ab60b59bec46e670 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GF2Polynomial.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GF2Polynomial.cs new file mode 100644 index 00000000..c1e34b4a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GF2Polynomial.cs @@ -0,0 +1,50 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field +{ + internal class GF2Polynomial + : IPolynomial + { + protected readonly int[] exponents; + + internal GF2Polynomial(int[] exponents) + { + this.exponents = Arrays.Clone(exponents); + } + + public virtual int Degree + { + get { return exponents[exponents.Length - 1]; } + } + + public virtual int[] GetExponentsPresent() + { + return Arrays.Clone(exponents); + } + + public override bool Equals(object obj) + { + if (this == obj) + { + return true; + } + GF2Polynomial other = obj as GF2Polynomial; + if (null == other) + { + return false; + } + return Arrays.AreEqual(exponents, other.exponents); + } + + public override int GetHashCode() + { + return Arrays.GetHashCode(exponents); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GF2Polynomial.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GF2Polynomial.cs.meta new file mode 100644 index 00000000..bbd88a3d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GF2Polynomial.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f60cfed9db54b1439f939b3bb13603f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GenericPolynomialExtensionField.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GenericPolynomialExtensionField.cs new file mode 100644 index 00000000..bf9a42ad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GenericPolynomialExtensionField.cs @@ -0,0 +1,67 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field +{ + internal class GenericPolynomialExtensionField + : IPolynomialExtensionField + { + protected readonly IFiniteField subfield; + protected readonly IPolynomial minimalPolynomial; + + internal GenericPolynomialExtensionField(IFiniteField subfield, IPolynomial polynomial) + { + this.subfield = subfield; + this.minimalPolynomial = polynomial; + } + + public virtual BigInteger Characteristic + { + get { return subfield.Characteristic; } + } + + public virtual int Dimension + { + get { return subfield.Dimension * minimalPolynomial.Degree; } + } + + public virtual IFiniteField Subfield + { + get { return subfield; } + } + + public virtual int Degree + { + get { return minimalPolynomial.Degree; } + } + + public virtual IPolynomial MinimalPolynomial + { + get { return minimalPolynomial; } + } + + public override bool Equals(object obj) + { + if (this == obj) + { + return true; + } + GenericPolynomialExtensionField other = obj as GenericPolynomialExtensionField; + if (null == other) + { + return false; + } + return subfield.Equals(other.subfield) && minimalPolynomial.Equals(other.minimalPolynomial); + } + + public override int GetHashCode() + { + return subfield.GetHashCode() ^ Integers.RotateLeft(minimalPolynomial.GetHashCode(), 16); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GenericPolynomialExtensionField.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GenericPolynomialExtensionField.cs.meta new file mode 100644 index 00000000..e128156e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/GenericPolynomialExtensionField.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 707d2ae0e23b0474db27c4d8028a82be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IExtensionField.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IExtensionField.cs new file mode 100644 index 00000000..7f902de9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IExtensionField.cs @@ -0,0 +1,16 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field +{ + public interface IExtensionField + : IFiniteField + { + IFiniteField Subfield { get; } + + int Degree { get; } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IExtensionField.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IExtensionField.cs.meta new file mode 100644 index 00000000..83e401be --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IExtensionField.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46600326fc07cab4fb303ad15b653ce8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IFiniteField.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IFiniteField.cs new file mode 100644 index 00000000..b1c66739 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IFiniteField.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field +{ + public interface IFiniteField + { + BigInteger Characteristic { get; } + + int Dimension { get; } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IFiniteField.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IFiniteField.cs.meta new file mode 100644 index 00000000..8a583947 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IFiniteField.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8081bcebd92cff45a40e33456292c5e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomial.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomial.cs new file mode 100644 index 00000000..8acc560b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomial.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field +{ + public interface IPolynomial + { + int Degree { get; } + + //BigInteger[] GetCoefficients(); + + int[] GetExponentsPresent(); + + //Term[] GetNonZeroTerms(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomial.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomial.cs.meta new file mode 100644 index 00000000..8eef2880 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomial.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 877adb45e13476048948e8911ea91d8a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomialExtensionField.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomialExtensionField.cs new file mode 100644 index 00000000..eec86fb1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomialExtensionField.cs @@ -0,0 +1,14 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field +{ + public interface IPolynomialExtensionField + : IExtensionField + { + IPolynomial MinimalPolynomial { get; } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomialExtensionField.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomialExtensionField.cs.meta new file mode 100644 index 00000000..a0de513f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/IPolynomialExtensionField.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d3680e5f8fa00c4fb4365940d546aca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/PrimeField.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/PrimeField.cs new file mode 100644 index 00000000..ce5a1621 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/PrimeField.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Field +{ + internal class PrimeField + : IFiniteField + { + protected readonly BigInteger characteristic; + + internal PrimeField(BigInteger characteristic) + { + this.characteristic = characteristic; + } + + public virtual BigInteger Characteristic + { + get { return characteristic; } + } + + public virtual int Dimension + { + get { return 1; } + } + + public override bool Equals(object obj) + { + if (this == obj) + { + return true; + } + PrimeField other = obj as PrimeField; + if (null == other) + { + return false; + } + return characteristic.Equals(other.characteristic); + } + + public override int GetHashCode() + { + return characteristic.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/PrimeField.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/PrimeField.cs.meta new file mode 100644 index 00000000..a23538d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/field/PrimeField.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7f446b15eeb02a1458d209b9439c3265 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw.meta new file mode 100644 index 00000000..b4539d45 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fee958d1244f2734fa72979d647c8b50 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Interleave.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Interleave.cs new file mode 100644 index 00000000..dd305754 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Interleave.cs @@ -0,0 +1,182 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Interleave + { + private const ulong M32 = 0x55555555UL; + private const ulong M64 = 0x5555555555555555UL; + private const ulong M64R = 0xAAAAAAAAAAAAAAAAUL; + + /* + * This expands 8 bit indices into 16 bit contents (high bit 14), by inserting 0s between bits. + * In a binary field, this operation is the same as squaring an 8 bit number. + */ + //private static readonly ushort[] INTERLEAVE2_TABLE = new ushort[] + //{ + // 0x0000, 0x0001, 0x0004, 0x0005, 0x0010, 0x0011, 0x0014, 0x0015, + // 0x0040, 0x0041, 0x0044, 0x0045, 0x0050, 0x0051, 0x0054, 0x0055, + // 0x0100, 0x0101, 0x0104, 0x0105, 0x0110, 0x0111, 0x0114, 0x0115, + // 0x0140, 0x0141, 0x0144, 0x0145, 0x0150, 0x0151, 0x0154, 0x0155, + // 0x0400, 0x0401, 0x0404, 0x0405, 0x0410, 0x0411, 0x0414, 0x0415, + // 0x0440, 0x0441, 0x0444, 0x0445, 0x0450, 0x0451, 0x0454, 0x0455, + // 0x0500, 0x0501, 0x0504, 0x0505, 0x0510, 0x0511, 0x0514, 0x0515, + // 0x0540, 0x0541, 0x0544, 0x0545, 0x0550, 0x0551, 0x0554, 0x0555, + // 0x1000, 0x1001, 0x1004, 0x1005, 0x1010, 0x1011, 0x1014, 0x1015, + // 0x1040, 0x1041, 0x1044, 0x1045, 0x1050, 0x1051, 0x1054, 0x1055, + // 0x1100, 0x1101, 0x1104, 0x1105, 0x1110, 0x1111, 0x1114, 0x1115, + // 0x1140, 0x1141, 0x1144, 0x1145, 0x1150, 0x1151, 0x1154, 0x1155, + // 0x1400, 0x1401, 0x1404, 0x1405, 0x1410, 0x1411, 0x1414, 0x1415, + // 0x1440, 0x1441, 0x1444, 0x1445, 0x1450, 0x1451, 0x1454, 0x1455, + // 0x1500, 0x1501, 0x1504, 0x1505, 0x1510, 0x1511, 0x1514, 0x1515, + // 0x1540, 0x1541, 0x1544, 0x1545, 0x1550, 0x1551, 0x1554, 0x1555, + // 0x4000, 0x4001, 0x4004, 0x4005, 0x4010, 0x4011, 0x4014, 0x4015, + // 0x4040, 0x4041, 0x4044, 0x4045, 0x4050, 0x4051, 0x4054, 0x4055, + // 0x4100, 0x4101, 0x4104, 0x4105, 0x4110, 0x4111, 0x4114, 0x4115, + // 0x4140, 0x4141, 0x4144, 0x4145, 0x4150, 0x4151, 0x4154, 0x4155, + // 0x4400, 0x4401, 0x4404, 0x4405, 0x4410, 0x4411, 0x4414, 0x4415, + // 0x4440, 0x4441, 0x4444, 0x4445, 0x4450, 0x4451, 0x4454, 0x4455, + // 0x4500, 0x4501, 0x4504, 0x4505, 0x4510, 0x4511, 0x4514, 0x4515, + // 0x4540, 0x4541, 0x4544, 0x4545, 0x4550, 0x4551, 0x4554, 0x4555, + // 0x5000, 0x5001, 0x5004, 0x5005, 0x5010, 0x5011, 0x5014, 0x5015, + // 0x5040, 0x5041, 0x5044, 0x5045, 0x5050, 0x5051, 0x5054, 0x5055, + // 0x5100, 0x5101, 0x5104, 0x5105, 0x5110, 0x5111, 0x5114, 0x5115, + // 0x5140, 0x5141, 0x5144, 0x5145, 0x5150, 0x5151, 0x5154, 0x5155, + // 0x5400, 0x5401, 0x5404, 0x5405, 0x5410, 0x5411, 0x5414, 0x5415, + // 0x5440, 0x5441, 0x5444, 0x5445, 0x5450, 0x5451, 0x5454, 0x5455, + // 0x5500, 0x5501, 0x5504, 0x5505, 0x5510, 0x5511, 0x5514, 0x5515, + // 0x5540, 0x5541, 0x5544, 0x5545, 0x5550, 0x5551, 0x5554, 0x5555 + //}; + + internal static uint Expand8to16(uint x) + { + x &= 0xFFU; + x = (x | (x << 4)) & 0x0F0FU; + x = (x | (x << 2)) & 0x3333U; + x = (x | (x << 1)) & 0x5555U; + return x; + } + + internal static uint Expand16to32(uint x) + { + x &= 0xFFFFU; + x = (x | (x << 8)) & 0x00FF00FFU; + x = (x | (x << 4)) & 0x0F0F0F0FU; + x = (x | (x << 2)) & 0x33333333U; + x = (x | (x << 1)) & 0x55555555U; + return x; + } + + internal static ulong Expand32to64(uint x) + { + // "shuffle" low half to even bits and high half to odd bits + uint t; + t = (x ^ (x >> 8)) & 0x0000FF00U; x ^= (t ^ (t << 8)); + t = (x ^ (x >> 4)) & 0x00F000F0U; x ^= (t ^ (t << 4)); + t = (x ^ (x >> 2)) & 0x0C0C0C0CU; x ^= (t ^ (t << 2)); + t = (x ^ (x >> 1)) & 0x22222222U; x ^= (t ^ (t << 1)); + + return ((x >> 1) & M32) << 32 | (x & M32); + } + + internal static void Expand64To128(ulong x, ulong[] z, int zOff) + { + // "shuffle" low half to even bits and high half to odd bits + ulong t; + t = (x ^ (x >> 16)) & 0x00000000FFFF0000UL; x ^= (t ^ (t << 16)); + t = (x ^ (x >> 8)) & 0x0000FF000000FF00UL; x ^= (t ^ (t << 8)); + t = (x ^ (x >> 4)) & 0x00F000F000F000F0UL; x ^= (t ^ (t << 4)); + t = (x ^ (x >> 2)) & 0x0C0C0C0C0C0C0C0CUL; x ^= (t ^ (t << 2)); + t = (x ^ (x >> 1)) & 0x2222222222222222UL; x ^= (t ^ (t << 1)); + + z[zOff ] = (x ) & M64; + z[zOff + 1] = (x >> 1) & M64; + } + + internal static void Expand64To128Rev(ulong x, ulong[] z, int zOff) + { + // "shuffle" low half to even bits and high half to odd bits + ulong t; + t = (x ^ (x >> 16)) & 0x00000000FFFF0000UL; x ^= (t ^ (t << 16)); + t = (x ^ (x >> 8)) & 0x0000FF000000FF00UL; x ^= (t ^ (t << 8)); + t = (x ^ (x >> 4)) & 0x00F000F000F000F0UL; x ^= (t ^ (t << 4)); + t = (x ^ (x >> 2)) & 0x0C0C0C0C0C0C0C0CUL; x ^= (t ^ (t << 2)); + t = (x ^ (x >> 1)) & 0x2222222222222222UL; x ^= (t ^ (t << 1)); + + z[zOff] = (x ) & M64R; + z[zOff + 1] = (x << 1) & M64R; + } + + internal static uint Shuffle(uint x) + { + // "shuffle" low half to even bits and high half to odd bits + uint t; + t = (x ^ (x >> 8)) & 0x0000FF00U; x ^= (t ^ (t << 8)); + t = (x ^ (x >> 4)) & 0x00F000F0U; x ^= (t ^ (t << 4)); + t = (x ^ (x >> 2)) & 0x0C0C0C0CU; x ^= (t ^ (t << 2)); + t = (x ^ (x >> 1)) & 0x22222222U; x ^= (t ^ (t << 1)); + return x; + } + + internal static ulong Shuffle(ulong x) + { + // "shuffle" low half to even bits and high half to odd bits + ulong t; + t = (x ^ (x >> 16)) & 0x00000000FFFF0000UL; x ^= (t ^ (t << 16)); + t = (x ^ (x >> 8)) & 0x0000FF000000FF00UL; x ^= (t ^ (t << 8)); + t = (x ^ (x >> 4)) & 0x00F000F000F000F0UL; x ^= (t ^ (t << 4)); + t = (x ^ (x >> 2)) & 0x0C0C0C0C0C0C0C0CUL; x ^= (t ^ (t << 2)); + t = (x ^ (x >> 1)) & 0x2222222222222222UL; x ^= (t ^ (t << 1)); + return x; + } + + internal static uint Shuffle2(uint x) + { + // "shuffle" (twice) low half to even bits and high half to odd bits + uint t; + t = (x ^ (x >> 7)) & 0x00AA00AAU; x ^= (t ^ (t << 7)); + t = (x ^ (x >> 14)) & 0x0000CCCCU; x ^= (t ^ (t << 14)); + t = (x ^ (x >> 4)) & 0x00F000F0U; x ^= (t ^ (t << 4)); + t = (x ^ (x >> 8)) & 0x0000FF00U; x ^= (t ^ (t << 8)); + return x; + } + + internal static uint Unshuffle(uint x) + { + // "unshuffle" even bits to low half and odd bits to high half + uint t; + t = (x ^ (x >> 1)) & 0x22222222U; x ^= (t ^ (t << 1)); + t = (x ^ (x >> 2)) & 0x0C0C0C0CU; x ^= (t ^ (t << 2)); + t = (x ^ (x >> 4)) & 0x00F000F0U; x ^= (t ^ (t << 4)); + t = (x ^ (x >> 8)) & 0x0000FF00U; x ^= (t ^ (t << 8)); + return x; + } + + internal static ulong Unshuffle(ulong x) + { + // "unshuffle" even bits to low half and odd bits to high half + ulong t; + t = (x ^ (x >> 1)) & 0x2222222222222222UL; x ^= (t ^ (t << 1)); + t = (x ^ (x >> 2)) & 0x0C0C0C0C0C0C0C0CUL; x ^= (t ^ (t << 2)); + t = (x ^ (x >> 4)) & 0x00F000F000F000F0UL; x ^= (t ^ (t << 4)); + t = (x ^ (x >> 8)) & 0x0000FF000000FF00UL; x ^= (t ^ (t << 8)); + t = (x ^ (x >> 16)) & 0x00000000FFFF0000UL; x ^= (t ^ (t << 16)); + return x; + } + + internal static uint Unshuffle2(uint x) + { + // "unshuffle" (twice) even bits to low half and odd bits to high half + uint t; + t = (x ^ (x >> 8)) & 0x0000FF00U; x ^= (t ^ (t << 8)); + t = (x ^ (x >> 4)) & 0x00F000F0U; x ^= (t ^ (t << 4)); + t = (x ^ (x >> 14)) & 0x0000CCCCU; x ^= (t ^ (t << 14)); + t = (x ^ (x >> 7)) & 0x00AA00AAU; x ^= (t ^ (t << 7)); + return x; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Interleave.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Interleave.cs.meta new file mode 100644 index 00000000..6495c8b3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Interleave.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b27f92aaead537f4faa3a35281664181 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Mod.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Mod.cs new file mode 100644 index 00000000..bdceee9a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Mod.cs @@ -0,0 +1,190 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Mod + { + private static readonly SecureRandom RandomSource = new SecureRandom(); + + public static void Invert(uint[] p, uint[] x, uint[] z) + { + int len = p.Length; + if (Nat.IsZero(len, x)) + throw new ArgumentException("cannot be 0", "x"); + if (Nat.IsOne(len, x)) + { + Array.Copy(x, 0, z, 0, len); + return; + } + + uint[] u = Nat.Copy(len, x); + uint[] a = Nat.Create(len); + a[0] = 1; + int ac = 0; + + if ((u[0] & 1) == 0) + { + InversionStep(p, u, len, a, ref ac); + } + if (Nat.IsOne(len, u)) + { + InversionResult(p, ac, a, z); + return; + } + + uint[] v = Nat.Copy(len, p); + uint[] b = Nat.Create(len); + int bc = 0; + + int uvLen = len; + + for (;;) + { + while (u[uvLen - 1] == 0 && v[uvLen - 1] == 0) + { + --uvLen; + } + + if (Nat.Gte(len, u, v)) + { + Nat.SubFrom(len, v, u); + Debug.Assert((u[0] & 1) == 0); + ac += Nat.SubFrom(len, b, a) - bc; + InversionStep(p, u, uvLen, a, ref ac); + if (Nat.IsOne(len, u)) + { + InversionResult(p, ac, a, z); + return; + } + } + else + { + Nat.SubFrom(len, u, v); + Debug.Assert((v[0] & 1) == 0); + bc += Nat.SubFrom(len, a, b) - ac; + InversionStep(p, v, uvLen, b, ref bc); + if (Nat.IsOne(len, v)) + { + InversionResult(p, bc, b, z); + return; + } + } + } + } + + public static uint[] Random(uint[] p) + { + int len = p.Length; + uint[] s = Nat.Create(len); + + uint m = p[len - 1]; + m |= m >> 1; + m |= m >> 2; + m |= m >> 4; + m |= m >> 8; + m |= m >> 16; + + do + { + byte[] bytes = new byte[len << 2]; + RandomSource.NextBytes(bytes); + Pack.BE_To_UInt32(bytes, 0, s); + s[len - 1] &= m; + } + while (Nat.Gte(len, s, p)); + + return s; + } + + public static void Add(uint[] p, uint[] x, uint[] y, uint[] z) + { + int len = p.Length; + uint c = Nat.Add(len, x, y, z); + if (c != 0) + { + Nat.SubFrom(len, p, z); + } + } + + public static void Subtract(uint[] p, uint[] x, uint[] y, uint[] z) + { + int len = p.Length; + int c = Nat.Sub(len, x, y, z); + if (c != 0) + { + Nat.AddTo(len, p, z); + } + } + + private static void InversionResult(uint[] p, int ac, uint[] a, uint[] z) + { + if (ac < 0) + { + Nat.Add(p.Length, a, p, z); + } + else + { + Array.Copy(a, 0, z, 0, p.Length); + } + } + + private static void InversionStep(uint[] p, uint[] u, int uLen, uint[] x, ref int xc) + { + int len = p.Length; + int count = 0; + while (u[0] == 0) + { + Nat.ShiftDownWord(uLen, u, 0); + count += 32; + } + + { + int zeroes = GetTrailingZeroes(u[0]); + if (zeroes > 0) + { + Nat.ShiftDownBits(uLen, u, zeroes, 0); + count += zeroes; + } + } + + for (int i = 0; i < count; ++i) + { + if ((x[0] & 1) != 0) + { + if (xc < 0) + { + xc += (int)Nat.AddTo(len, p, x); + } + else + { + xc += Nat.SubFrom(len, p, x); + } + } + + Debug.Assert(xc == 0 || xc == -1); + Nat.ShiftDownBit(len, x, (uint)xc); + } + } + + private static int GetTrailingZeroes(uint x) + { + Debug.Assert(x != 0); + int count = 0; + while ((x & 1) == 0) + { + x >>= 1; + ++count; + } + return count; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Mod.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Mod.cs.meta new file mode 100644 index 00000000..087b805a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Mod.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 100ea3391c7eed94c8c1715df12ca0d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat.cs new file mode 100644 index 00000000..b20cfe4e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat.cs @@ -0,0 +1,1157 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat + { + private const ulong M = 0xFFFFFFFFUL; + + public static uint Add(int len, uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + for (int i = 0; i < len; ++i) + { + c += (ulong)x[i] + y[i]; + z[i] = (uint)c; + c >>= 32; + } + return (uint)c; + } + + public static uint Add33At(int len, uint x, uint[] z, int zPos) + { + Debug.Assert(zPos <= (len - 2)); + ulong c = (ulong)z[zPos + 0] + x; + z[zPos + 0] = (uint)c; + c >>= 32; + c += (ulong)z[zPos + 1] + 1; + z[zPos + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zPos + 2); + } + + public static uint Add33At(int len, uint x, uint[] z, int zOff, int zPos) + { + Debug.Assert(zPos <= (len - 2)); + ulong c = (ulong)z[zOff + zPos] + x; + z[zOff + zPos] = (uint)c; + c >>= 32; + c += (ulong)z[zOff + zPos + 1] + 1; + z[zOff + zPos + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zOff, zPos + 2); + } + + public static uint Add33To(int len, uint x, uint[] z) + { + ulong c = (ulong)z[0] + x; + z[0] = (uint)c; + c >>= 32; + c += (ulong)z[1] + 1; + z[1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, 2); + } + + public static uint Add33To(int len, uint x, uint[] z, int zOff) + { + ulong c = (ulong)z[zOff + 0] + x; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)z[zOff + 1] + 1; + z[zOff + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zOff, 2); + } + + public static uint AddBothTo(int len, uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + for (int i = 0; i < len; ++i) + { + c += (ulong)x[i] + y[i] + z[i]; + z[i] = (uint)c; + c >>= 32; + } + return (uint)c; + } + + public static uint AddBothTo(int len, uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + ulong c = 0; + for (int i = 0; i < len; ++i) + { + c += (ulong)x[xOff + i] + y[yOff + i] + z[zOff + i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + return (uint)c; + } + + public static uint AddDWordAt(int len, ulong x, uint[] z, int zPos) + { + Debug.Assert(zPos <= (len - 2)); + ulong c = (ulong)z[zPos + 0] + (x & M); + z[zPos + 0] = (uint)c; + c >>= 32; + c += (ulong)z[zPos + 1] + (x >> 32); + z[zPos + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zPos + 2); + } + + public static uint AddDWordAt(int len, ulong x, uint[] z, int zOff, int zPos) + { + Debug.Assert(zPos <= (len - 2)); + ulong c = (ulong)z[zOff + zPos] + (x & M); + z[zOff + zPos] = (uint)c; + c >>= 32; + c += (ulong)z[zOff + zPos + 1] + (x >> 32); + z[zOff + zPos + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zOff, zPos + 2); + } + + public static uint AddDWordTo(int len, ulong x, uint[] z) + { + ulong c = (ulong)z[0] + (x & M); + z[0] = (uint)c; + c >>= 32; + c += (ulong)z[1] + (x >> 32); + z[1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, 2); + } + + public static uint AddDWordTo(int len, ulong x, uint[] z, int zOff) + { + ulong c = (ulong)z[zOff + 0] + (x & M); + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)z[zOff + 1] + (x >> 32); + z[zOff + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zOff, 2); + } + + public static uint AddTo(int len, uint[] x, uint[] z) + { + ulong c = 0; + for (int i = 0; i < len; ++i) + { + c += (ulong)x[i] + z[i]; + z[i] = (uint)c; + c >>= 32; + } + return (uint)c; + } + + public static uint AddTo(int len, uint[] x, int xOff, uint[] z, int zOff) + { + ulong c = 0; + for (int i = 0; i < len; ++i) + { + c += (ulong)x[xOff + i] + z[zOff + i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + return (uint)c; + } + + public static uint AddWordAt(int len, uint x, uint[] z, int zPos) + { + Debug.Assert(zPos <= (len - 1)); + ulong c = (ulong)x + z[zPos]; + z[zPos] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zPos + 1); + } + + public static uint AddWordAt(int len, uint x, uint[] z, int zOff, int zPos) + { + Debug.Assert(zPos <= (len - 1)); + ulong c = (ulong)x + z[zOff + zPos]; + z[zOff + zPos] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zOff, zPos + 1); + } + + public static uint AddWordTo(int len, uint x, uint[] z) + { + ulong c = (ulong)x + z[0]; + z[0] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, 1); + } + + public static uint AddWordTo(int len, uint x, uint[] z, int zOff) + { + ulong c = (ulong)x + z[zOff]; + z[zOff] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zOff, 1); + } + + public static uint CAdd(int len, int mask, uint[] x, uint[] y, uint[] z) + { + uint MASK = (uint)-(mask & 1); + + ulong c = 0; + for (int i = 0; i < len; ++i) + { + c += (ulong)x[i] + (y[i] & MASK); + z[i] = (uint)c; + c >>= 32; + } + return (uint)c; + } + + public static void CMov(int len, int mask, uint[] x, int xOff, uint[] z, int zOff) + { + uint MASK = (uint)-(mask & 1); + + for (int i = 0; i < len; ++i) + { + uint z_i = z[zOff + i], diff = z_i ^ x[xOff + i]; + z_i ^= (diff & MASK); + z[zOff + i] = z_i; + } + + //uint half = 0x55555555U, rest = half << (-(int)MASK); + + //for (int i = 0; i < len; ++i) + //{ + // uint z_i = z[zOff + i], diff = z_i ^ x[xOff + i]; + // z_i ^= (diff & half); + // z_i ^= (diff & rest); + // z[zOff + i] = z_i; + //} + } + + public static void CMov(int len, int mask, int[] x, int xOff, int[] z, int zOff) + { + mask = -(mask & 1); + + for (int i = 0; i < len; ++i) + { + int z_i = z[zOff + i], diff = z_i ^ x[xOff + i]; + z_i ^= (diff & mask); + z[zOff + i] = z_i; + } + + //int half = 0x55555555, rest = half << (-mask); + + //for (int i = 0; i < len; ++i) + //{ + // int z_i = z[zOff + i], diff = z_i ^ x[xOff + i]; + // z_i ^= (diff & half); + // z_i ^= (diff & rest); + // z[zOff + i] = z_i; + //} + } + + public static void Copy(int len, uint[] x, uint[] z) + { + Array.Copy(x, 0, z, 0, len); + } + + public static uint[] Copy(int len, uint[] x) + { + uint[] z = new uint[len]; + Array.Copy(x, 0, z, 0, len); + return z; + } + + public static void Copy(int len, uint[] x, int xOff, uint[] z, int zOff) + { + Array.Copy(x, xOff, z, zOff, len); + } + + public static uint[] Create(int len) + { + return new uint[len]; + } + + public static ulong[] Create64(int len) + { + return new ulong[len]; + } + + public static int Dec(int len, uint[] z) + { + for (int i = 0; i < len; ++i) + { + if (--z[i] != uint.MaxValue) + { + return 0; + } + } + return -1; + } + + public static int Dec(int len, uint[] x, uint[] z) + { + int i = 0; + while (i < len) + { + uint c = x[i] - 1; + z[i] = c; + ++i; + if (c != uint.MaxValue) + { + while (i < len) + { + z[i] = x[i]; + ++i; + } + return 0; + } + } + return -1; + } + + public static int DecAt(int len, uint[] z, int zPos) + { + Debug.Assert(zPos <= len); + for (int i = zPos; i < len; ++i) + { + if (--z[i] != uint.MaxValue) + { + return 0; + } + } + return -1; + } + + public static int DecAt(int len, uint[] z, int zOff, int zPos) + { + Debug.Assert(zPos <= len); + for (int i = zPos; i < len; ++i) + { + if (--z[zOff + i] != uint.MaxValue) + { + return 0; + } + } + return -1; + } + + public static bool Eq(int len, uint[] x, uint[] y) + { + for (int i = len - 1; i >= 0; --i) + { + if (x[i] != y[i]) + { + return false; + } + } + return true; + } + + public static uint[] FromBigInteger(int bits, BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > bits) + throw new ArgumentException(); + + int len = (bits + 31) >> 5; + uint[] z = Create(len); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (uint)x.IntValue; + x = x.ShiftRight(32); + } + return z; + } + + public static uint GetBit(uint[] x, int bit) + { + if (bit == 0) + { + return x[0] & 1; + } + int w = bit >> 5; + if (w < 0 || w >= x.Length) + { + return 0; + } + int b = bit & 31; + return (x[w] >> b) & 1; + } + + public static bool Gte(int len, uint[] x, uint[] y) + { + for (int i = len - 1; i >= 0; --i) + { + uint x_i = x[i], y_i = y[i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static uint Inc(int len, uint[] z) + { + for (int i = 0; i < len; ++i) + { + if (++z[i] != uint.MinValue) + { + return 0; + } + } + return 1; + } + + public static uint Inc(int len, uint[] x, uint[] z) + { + int i = 0; + while (i < len) + { + uint c = x[i] + 1; + z[i] = c; + ++i; + if (c != 0) + { + while (i < len) + { + z[i] = x[i]; + ++i; + } + return 0; + } + } + return 1; + } + + public static uint IncAt(int len, uint[] z, int zPos) + { + Debug.Assert(zPos <= len); + for (int i = zPos; i < len; ++i) + { + if (++z[i] != uint.MinValue) + { + return 0; + } + } + return 1; + } + + public static uint IncAt(int len, uint[] z, int zOff, int zPos) + { + Debug.Assert(zPos <= len); + for (int i = zPos; i < len; ++i) + { + if (++z[zOff + i] != uint.MinValue) + { + return 0; + } + } + return 1; + } + + public static bool IsOne(int len, uint[] x) + { + if (x[0] != 1) + { + return false; + } + for (int i = 1; i < len; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static bool IsZero(int len, uint[] x) + { + if (x[0] != 0) + { + return false; + } + for (int i = 1; i < len; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static void Mul(int len, uint[] x, uint[] y, uint[] zz) + { + zz[len] = MulWord(len, x[0], y, zz); + + for (int i = 1; i < len; ++i) + { + zz[i + len] = MulWordAddTo(len, x[i], y, 0, zz, i); + } + } + + public static void Mul(int len, uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + zz[zzOff + len] = MulWord(len, x[xOff], y, yOff, zz, zzOff); + + for (int i = 1; i < len; ++i) + { + zz[zzOff + i + len] = MulWordAddTo(len, x[xOff + i], y, yOff, zz, zzOff + i); + } + } + + public static void Mul(uint[] x, int xOff, int xLen, uint[] y, int yOff, int yLen, uint[] zz, int zzOff) + { + zz[zzOff + yLen] = MulWord(yLen, x[xOff], y, yOff, zz, zzOff); + + for (int i = 1; i < xLen; ++i) + { + zz[zzOff + i + yLen] = MulWordAddTo(yLen, x[xOff + i], y, yOff, zz, zzOff + i); + } + } + + public static uint MulAddTo(int len, uint[] x, uint[] y, uint[] zz) + { + ulong zc = 0; + for (int i = 0; i < len; ++i) + { + ulong c = MulWordAddTo(len, x[i], y, 0, zz, i) & M; + c += zc + (zz[i + len] & M); + zz[i + len] = (uint)c; + zc = c >> 32; + } + return (uint)zc; + } + + public static uint MulAddTo(int len, uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong zc = 0; + for (int i = 0; i < len; ++i) + { + ulong c = MulWordAddTo(len, x[xOff + i], y, yOff, zz, zzOff) & M; + c += zc + (zz[zzOff + len] & M); + zz[zzOff + len] = (uint)c; + zc = c >> 32; + ++zzOff; + } + return (uint)zc; + } + + public static uint Mul31BothAdd(int len, uint a, uint[] x, uint b, uint[] y, uint[] z, int zOff) + { + ulong c = 0, aVal = (ulong)a, bVal = (ulong)b; + int i = 0; + do + { + c += aVal * x[i] + bVal * y[i] + z[zOff + i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + while (++i < len); + return (uint)c; + } + + public static uint MulWord(int len, uint x, uint[] y, uint[] z) + { + ulong c = 0, xVal = (ulong)x; + int i = 0; + do + { + c += xVal * y[i]; + z[i] = (uint)c; + c >>= 32; + } + while (++i < len); + return (uint)c; + } + + public static uint MulWord(int len, uint x, uint[] y, int yOff, uint[] z, int zOff) + { + ulong c = 0, xVal = (ulong)x; + int i = 0; + do + { + c += xVal * y[yOff + i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + while (++i < len); + return (uint)c; + } + + public static uint MulWordAddTo(int len, uint x, uint[] y, int yOff, uint[] z, int zOff) + { + ulong c = 0, xVal = (ulong)x; + int i = 0; + do + { + c += xVal * y[yOff + i] + z[zOff + i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + while (++i < len); + return (uint)c; + } + + public static uint MulWordDwordAddAt(int len, uint x, ulong y, uint[] z, int zPos) + { + Debug.Assert(zPos <= (len - 3)); + ulong c = 0, xVal = (ulong)x; + c += xVal * (uint)y + z[zPos + 0]; + z[zPos + 0] = (uint)c; + c >>= 32; + c += xVal * (y >> 32) + z[zPos + 1]; + z[zPos + 1] = (uint)c; + c >>= 32; + c += (ulong)z[zPos + 2]; + z[zPos + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : IncAt(len, z, zPos + 3); + } + + public static uint ShiftDownBit(int len, uint[] z, uint c) + { + int i = len; + while (--i >= 0) + { + uint next = z[i]; + z[i] = (next >> 1) | (c << 31); + c = next; + } + return c << 31; + } + + public static uint ShiftDownBit(int len, uint[] z, int zOff, uint c) + { + int i = len; + while (--i >= 0) + { + uint next = z[zOff + i]; + z[zOff + i] = (next >> 1) | (c << 31); + c = next; + } + return c << 31; + } + + public static uint ShiftDownBit(int len, uint[] x, uint c, uint[] z) + { + int i = len; + while (--i >= 0) + { + uint next = x[i]; + z[i] = (next >> 1) | (c << 31); + c = next; + } + return c << 31; + } + + public static uint ShiftDownBit(int len, uint[] x, int xOff, uint c, uint[] z, int zOff) + { + int i = len; + while (--i >= 0) + { + uint next = x[xOff + i]; + z[zOff + i] = (next >> 1) | (c << 31); + c = next; + } + return c << 31; + } + + public static uint ShiftDownBits(int len, uint[] z, int bits, uint c) + { + Debug.Assert(bits > 0 && bits < 32); + int i = len; + while (--i >= 0) + { + uint next = z[i]; + z[i] = (next >> bits) | (c << -bits); + c = next; + } + return c << -bits; + } + + public static uint ShiftDownBits(int len, uint[] z, int zOff, int bits, uint c) + { + Debug.Assert(bits > 0 && bits < 32); + int i = len; + while (--i >= 0) + { + uint next = z[zOff + i]; + z[zOff + i] = (next >> bits) | (c << -bits); + c = next; + } + return c << -bits; + } + + public static uint ShiftDownBits(int len, uint[] x, int bits, uint c, uint[] z) + { + Debug.Assert(bits > 0 && bits < 32); + int i = len; + while (--i >= 0) + { + uint next = x[i]; + z[i] = (next >> bits) | (c << -bits); + c = next; + } + return c << -bits; + } + + public static uint ShiftDownBits(int len, uint[] x, int xOff, int bits, uint c, uint[] z, int zOff) + { + Debug.Assert(bits > 0 && bits < 32); + int i = len; + while (--i >= 0) + { + uint next = x[xOff + i]; + z[zOff + i] = (next >> bits) | (c << -bits); + c = next; + } + return c << -bits; + } + + public static uint ShiftDownWord(int len, uint[] z, uint c) + { + int i = len; + while (--i >= 0) + { + uint next = z[i]; + z[i] = c; + c = next; + } + return c; + } + + public static uint ShiftUpBit(int len, uint[] z, uint c) + { + for (int i = 0; i < len; ++i) + { + uint next = z[i]; + z[i] = (next << 1) | (c >> 31); + c = next; + } + return c >> 31; + } + + public static uint ShiftUpBit(int len, uint[] z, int zOff, uint c) + { + for (int i = 0; i < len; ++i) + { + uint next = z[zOff + i]; + z[zOff + i] = (next << 1) | (c >> 31); + c = next; + } + return c >> 31; + } + + public static uint ShiftUpBit(int len, uint[] x, uint c, uint[] z) + { + for (int i = 0; i < len; ++i) + { + uint next = x[i]; + z[i] = (next << 1) | (c >> 31); + c = next; + } + return c >> 31; + } + + public static uint ShiftUpBit(int len, uint[] x, int xOff, uint c, uint[] z, int zOff) + { + for (int i = 0; i < len; ++i) + { + uint next = x[xOff + i]; + z[zOff + i] = (next << 1) | (c >> 31); + c = next; + } + return c >> 31; + } + + public static ulong ShiftUpBit64(int len, ulong[] x, int xOff, ulong c, ulong[] z, int zOff) + { + for (int i = 0; i < len; ++i) + { + ulong next = x[xOff + i]; + z[zOff + i] = (next << 1) | (c >> 63); + c = next; + } + return c >> 63; + } + + public static uint ShiftUpBits(int len, uint[] z, int bits, uint c) + { + Debug.Assert(bits > 0 && bits < 32); + for (int i = 0; i < len; ++i) + { + uint next = z[i]; + z[i] = (next << bits) | (c >> -bits); + c = next; + } + return c >> -bits; + } + + public static uint ShiftUpBits(int len, uint[] z, int zOff, int bits, uint c) + { + Debug.Assert(bits > 0 && bits < 32); + for (int i = 0; i < len; ++i) + { + uint next = z[zOff + i]; + z[zOff + i] = (next << bits) | (c >> -bits); + c = next; + } + return c >> -bits; + } + + public static ulong ShiftUpBits64(int len, ulong[] z, int zOff, int bits, ulong c) + { + Debug.Assert(bits > 0 && bits < 64); + for (int i = 0; i < len; ++i) + { + ulong next = z[zOff + i]; + z[zOff + i] = (next << bits) | (c >> -bits); + c = next; + } + return c >> -bits; + } + + public static uint ShiftUpBits(int len, uint[] x, int bits, uint c, uint[] z) + { + Debug.Assert(bits > 0 && bits < 32); + for (int i = 0; i < len; ++i) + { + uint next = x[i]; + z[i] = (next << bits) | (c >> -bits); + c = next; + } + return c >> -bits; + } + + public static uint ShiftUpBits(int len, uint[] x, int xOff, int bits, uint c, uint[] z, int zOff) + { + Debug.Assert(bits > 0 && bits < 32); + for (int i = 0; i < len; ++i) + { + uint next = x[xOff + i]; + z[zOff + i] = (next << bits) | (c >> -bits); + c = next; + } + return c >> -bits; + } + + public static ulong ShiftUpBits64(int len, ulong[] x, int xOff, int bits, ulong c, ulong[] z, int zOff) + { + Debug.Assert(bits > 0 && bits < 64); + for (int i = 0; i < len; ++i) + { + ulong next = x[xOff + i]; + z[zOff + i] = (next << bits) | (c >> -bits); + c = next; + } + return c >> -bits; + } + + public static void Square(int len, uint[] x, uint[] zz) + { + int extLen = len << 1; + uint c = 0; + int j = len, k = extLen; + do + { + ulong xVal = (ulong)x[--j]; + ulong p = xVal * xVal; + zz[--k] = (c << 31) | (uint)(p >> 33); + zz[--k] = (uint)(p >> 1); + c = (uint)p; + } + while (j > 0); + + for (int i = 1; i < len; ++i) + { + c = SquareWordAdd(x, i, zz); + AddWordAt(extLen, c, zz, i << 1); + } + + ShiftUpBit(extLen, zz, x[0] << 31); + } + + public static void Square(int len, uint[] x, int xOff, uint[] zz, int zzOff) + { + int extLen = len << 1; + uint c = 0; + int j = len, k = extLen; + do + { + ulong xVal = (ulong)x[xOff + --j]; + ulong p = xVal * xVal; + zz[zzOff + --k] = (c << 31) | (uint)(p >> 33); + zz[zzOff + --k] = (uint)(p >> 1); + c = (uint)p; + } + while (j > 0); + + for (int i = 1; i < len; ++i) + { + c = SquareWordAdd(x, xOff, i, zz, zzOff); + AddWordAt(extLen, c, zz, zzOff, i << 1); + } + + ShiftUpBit(extLen, zz, zzOff, x[xOff] << 31); + } + + public static uint SquareWordAdd(uint[] x, int xPos, uint[] z) + { + ulong c = 0, xVal = (ulong)x[xPos]; + int i = 0; + do + { + c += xVal * x[i] + z[xPos + i]; + z[xPos + i] = (uint)c; + c >>= 32; + } + while (++i < xPos); + return (uint)c; + } + + public static uint SquareWordAdd(uint[] x, int xOff, int xPos, uint[] z, int zOff) + { + ulong c = 0, xVal = (ulong)x[xOff + xPos]; + int i = 0; + do + { + c += xVal * (x[xOff + i] & M) + (z[xPos + zOff] & M); + z[xPos + zOff] = (uint)c; + c >>= 32; + ++zOff; + } + while (++i < xPos); + return (uint)c; + } + + public static int Sub(int len, uint[] x, uint[] y, uint[] z) + { + long c = 0; + for (int i = 0; i < len; ++i) + { + c += (long)x[i] - y[i]; + z[i] = (uint)c; + c >>= 32; + } + return (int)c; + } + + public static int Sub(int len, uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + long c = 0; + for (int i = 0; i < len; ++i) + { + c += (long)x[xOff + i] - y[yOff + i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + return (int)c; + } + public static int Sub33At(int len, uint x, uint[] z, int zPos) + { + Debug.Assert(zPos <= (len - 2)); + long c = (long)z[zPos + 0] - x; + z[zPos + 0] = (uint)c; + c >>= 32; + c += (long)z[zPos + 1] - 1; + z[zPos + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, zPos + 2); + } + + public static int Sub33At(int len, uint x, uint[] z, int zOff, int zPos) + { + Debug.Assert(zPos <= (len - 2)); + long c = (long)z[zOff + zPos] - x; + z[zOff + zPos] = (uint)c; + c >>= 32; + c += (long)z[zOff + zPos + 1] - 1; + z[zOff + zPos + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, zOff, zPos + 2); + } + + public static int Sub33From(int len, uint x, uint[] z) + { + long c = (long)z[0] - x; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - 1; + z[1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, 2); + } + + public static int Sub33From(int len, uint x, uint[] z, int zOff) + { + long c = (long)z[zOff + 0] - x; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)z[zOff + 1] - 1; + z[zOff + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, zOff, 2); + } + + public static int SubBothFrom(int len, uint[] x, uint[] y, uint[] z) + { + long c = 0; + for (int i = 0; i < len; ++i) + { + c += (long)z[i] - x[i] - y[i]; + z[i] = (uint)c; + c >>= 32; + } + return (int)c; + } + + public static int SubBothFrom(int len, uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + long c = 0; + for (int i = 0; i < len; ++i) + { + c += (long)z[zOff + i] - x[xOff + i] - y[yOff + i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + return (int)c; + } + + public static int SubDWordAt(int len, ulong x, uint[] z, int zPos) + { + Debug.Assert(zPos <= (len - 2)); + long c = (long)z[zPos + 0] - (long)(x & M); + z[zPos + 0] = (uint)c; + c >>= 32; + c += (long)z[zPos + 1] - (long)(x >> 32); + z[zPos + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, zPos + 2); + } + + public static int SubDWordAt(int len, ulong x, uint[] z, int zOff, int zPos) + { + Debug.Assert(zPos <= (len - 2)); + long c = (long)z[zOff + zPos] - (long)(x & M); + z[zOff + zPos] = (uint)c; + c >>= 32; + c += (long)z[zOff + zPos + 1] - (long)(x >> 32); + z[zOff + zPos + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, zOff, zPos + 2); + } + + public static int SubDWordFrom(int len, ulong x, uint[] z) + { + long c = (long)z[0] - (long)(x & M); + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - (long)(x >> 32); + z[1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, 2); + } + + public static int SubDWordFrom(int len, ulong x, uint[] z, int zOff) + { + long c = (long)z[zOff + 0] - (long)(x & M); + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)z[zOff + 1] - (long)(x >> 32); + z[zOff + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, zOff, 2); + } + + public static int SubFrom(int len, uint[] x, uint[] z) + { + long c = 0; + for (int i = 0; i < len; ++i) + { + c += (long)z[i] - x[i]; + z[i] = (uint)c; + c >>= 32; + } + return (int)c; + } + + public static int SubFrom(int len, uint[] x, int xOff, uint[] z, int zOff) + { + long c = 0; + for (int i = 0; i < len; ++i) + { + c += (long)z[zOff + i] - x[xOff + i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + return (int)c; + } + + public static int SubWordAt(int len, uint x, uint[] z, int zPos) + { + Debug.Assert(zPos <= (len - 1)); + long c = (long)z[zPos] - x; + z[zPos] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, zPos + 1); + } + + public static int SubWordAt(int len, uint x, uint[] z, int zOff, int zPos) + { + Debug.Assert(zPos <= (len - 1)); + long c = (long)z[zOff + zPos] - x; + z[zOff + zPos] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, zOff, zPos + 1); + } + + public static int SubWordFrom(int len, uint x, uint[] z) + { + long c = (long)z[0] - x; + z[0] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, 1); + } + + public static int SubWordFrom(int len, uint x, uint[] z, int zOff) + { + long c = (long)z[zOff + 0] - x; + z[zOff + 0] = (uint)c; + c >>= 32; + return c == 0 ? 0 : DecAt(len, z, zOff, 1); + } + + public static BigInteger ToBigInteger(int len, uint[] x) + { + byte[] bs = new byte[len << 2]; + for (int i = 0; i < len; ++i) + { + uint x_i = x[i]; + if (x_i != 0) + { + Pack.UInt32_To_BE(x_i, bs, (len - 1 - i) << 2); + } + } + return new BigInteger(1, bs); + } + + public static void Zero(int len, uint[] z) + { + for (int i = 0; i < len; ++i) + { + z[i] = 0; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat.cs.meta new file mode 100644 index 00000000..ea225881 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67f25ce049bdd324f876627a914e4063 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat128.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat128.cs new file mode 100644 index 00000000..16ff4cdc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat128.cs @@ -0,0 +1,874 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat128 + { + private const ulong M = 0xFFFFFFFFUL; + + public static uint Add(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3]; + z[3] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddBothTo(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, int xOff, uint[] z, int zOff, uint cIn) + { + ulong c = cIn; + c += (ulong)x[xOff + 0] + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 1] + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 2] + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 3] + z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddToEachOther(uint[] u, int uOff, uint[] v, int vOff) + { + ulong c = 0; + c += (ulong)u[uOff + 0] + v[vOff + 0]; + u[uOff + 0] = (uint)c; + v[vOff + 0] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 1] + v[vOff + 1]; + u[uOff + 1] = (uint)c; + v[vOff + 1] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 2] + v[vOff + 2]; + u[uOff + 2] = (uint)c; + v[vOff + 2] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 3] + v[vOff + 3]; + u[uOff + 3] = (uint)c; + v[vOff + 3] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static void Copy(uint[] x, uint[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + } + + public static void Copy(uint[] x, int xOff, uint[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + } + + public static void Copy64(ulong[] x, ulong[] z) + { + z[0] = x[0]; + z[1] = x[1]; + } + + public static void Copy64(ulong[] x, int xOff, ulong[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + } + + public static uint[] Create() + { + return new uint[4]; + } + + public static ulong[] Create64() + { + return new ulong[2]; + } + + public static uint[] CreateExt() + { + return new uint[8]; + } + + public static ulong[] CreateExt64() + { + return new ulong[4]; + } + + public static bool Diff(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + bool pos = Gte(x, xOff, y, yOff); + if (pos) + { + Sub(x, xOff, y, yOff, z, zOff); + } + else + { + Sub(y, yOff, x, xOff, z, zOff); + } + return pos; + } + + public static bool Eq(uint[] x, uint[] y) + { + for (int i = 3; i >= 0; --i) + { + if (x[i] != y[i]) + return false; + } + return true; + } + + public static bool Eq64(ulong[] x, ulong[] y) + { + for (int i = 1; i >= 0; --i) + { + if (x[i] != y[i]) + return false; + } + return true; + } + + public static uint[] FromBigInteger(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 128) + throw new ArgumentException(); + + uint[] z = Create(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (uint)x.IntValue; + x = x.ShiftRight(32); + } + return z; + } + + public static ulong[] FromBigInteger64(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 128) + throw new ArgumentException(); + + ulong[] z = Create64(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (ulong)x.LongValue; + x = x.ShiftRight(64); + } + return z; + } + + public static uint GetBit(uint[] x, int bit) + { + if (bit == 0) + { + return x[0] & 1; + } + if ((bit & 127) != bit) + { + return 0; + } + int w = bit >> 5; + int b = bit & 31; + return (x[w] >> b) & 1; + } + + public static bool Gte(uint[] x, uint[] y) + { + for (int i = 3; i >= 0; --i) + { + uint x_i = x[i], y_i = y[i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool Gte(uint[] x, int xOff, uint[] y, int yOff) + { + for (int i = 3; i >= 0; --i) + { + uint x_i = x[xOff + i], y_i = y[yOff + i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool IsOne(uint[] x) + { + if (x[0] != 1) + { + return false; + } + for (int i = 1; i < 4; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static bool IsOne64(ulong[] x) + { + if (x[0] != 1UL) + { + return false; + } + for (int i = 1; i < 2; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static bool IsZero(uint[] x) + { + for (int i = 0; i < 4; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static bool IsZero64(ulong[] x) + { + for (int i = 0; i < 2; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static void Mul(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + + { + ulong c = 0, x_0 = x[0]; + c += x_0 * y_0; + zz[0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[3] = (uint)c; + c >>= 32; + zz[4] = (uint)c; + } + + for (int i = 1; i < 4; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + zz[i + 4] = (uint)c; + } + } + + public static void Mul(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + + { + ulong c = 0, x_0 = x[xOff + 0]; + c += x_0 * y_0; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[zzOff + 3] = (uint)c; + c >>= 32; + zz[zzOff + 4] = (uint)c; + } + + for (int i = 1; i < 4; ++i) + { + ++zzOff; + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + zz[zzOff + 4] = (uint)c; + } + } + + public static uint MulAddTo(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + + ulong zc = 0; + for (int i = 0; i < 4; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + c += zc + zz[i + 4]; + zz[i + 4] = (uint)c; + zc = c >> 32; + } + return (uint)zc; + } + + public static uint MulAddTo(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + + ulong zc = 0; + for (int i = 0; i < 4; ++i) + { + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += zc + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + zc = c >> 32; + ++zzOff; + } + return (uint)zc; + } + + public static ulong Mul33Add(uint w, uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + Debug.Assert(w >> 31 == 0); + + ulong c = 0, wVal = w; + ulong x0 = x[xOff + 0]; + c += wVal * x0 + y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong x1 = x[xOff + 1]; + c += wVal * x1 + x0 + y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + ulong x2 = x[xOff + 2]; + c += wVal * x2 + x1 + y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + ulong x3 = x[xOff + 3]; + c += wVal * x3 + x2 + y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += x3; + return c; + } + + public static uint MulWordAddExt(uint x, uint[] yy, int yyOff, uint[] zz, int zzOff) + { + Debug.Assert(yyOff <= 4); + Debug.Assert(zzOff <= 4); + + ulong c = 0, xVal = x; + c += xVal * yy[yyOff + 0] + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 1] + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 2] + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 3] + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint Mul33DWordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <= 0); + ulong c = 0, xVal = x; + ulong y00 = y & M; + c += xVal * y00 + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong y01 = y >> 32; + c += xVal * y01 + y00 + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += y01 + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint Mul33WordAdd(uint x, uint y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <= 1); + ulong c = 0, yVal = y; + c += yVal * x + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += yVal + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(4, z, zOff, 3); + } + + public static uint MulWordDwordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(zOff <= 1); + ulong c = 0, xVal = x; + c += xVal * y + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += xVal * (y >> 32) + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(4, z, zOff, 3); + } + + public static uint MulWordsAdd(uint x, uint y, uint[] z, int zOff) + { + Debug.Assert(zOff <= 2); + + ulong c = 0, xVal = x, yVal = y; + c += yVal * xVal + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(4, z, zOff, 2); + } + + public static uint MulWord(uint x, uint[] y, uint[] z, int zOff) + { + ulong c = 0, xVal = x; + int i = 0; + do + { + c += xVal * y[i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + while (++i < 4); + return (uint)c; + } + + public static void Square(uint[] x, uint[] zz) + { + ulong x_0 = x[0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 3, j = 8; + do + { + ulong xVal = x[i--]; + ulong p = xVal * xVal; + zz[--j] = (c << 31) | (uint)(p >> 33); + zz[--j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[1]; + ulong zz_2 = zz[2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[2]; + ulong zz_3 = zz[3]; + ulong zz_4 = zz[4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[3]; + ulong zz_5 = zz[5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_6 += zz_5 >> 32; + } + + w = (uint)zz_4; + zz[4] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_5; + zz[5] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_6; + zz[6] = (w << 1) | c; + c = w >> 31; + w = zz[7] + (uint)(zz_6 >> 32); + zz[7] = (w << 1) | c; + } + + public static void Square(uint[] x, int xOff, uint[] zz, int zzOff) + { + ulong x_0 = x[xOff + 0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 3, j = 8; + do + { + ulong xVal = x[xOff + i--]; + ulong p = xVal * xVal; + zz[zzOff + --j] = (c << 31) | (uint)(p >> 33); + zz[zzOff + --j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[zzOff + 0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[xOff + 1]; + ulong zz_2 = zz[zzOff + 2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[zzOff + 1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[xOff + 2]; + ulong zz_3 = zz[zzOff + 3]; + ulong zz_4 = zz[zzOff + 4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[zzOff + 2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[xOff + 3]; + ulong zz_5 = zz[zzOff + 5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[zzOff + 6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[zzOff + 3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_6 += zz_5 >> 32; + } + + w = (uint)zz_4; + zz[zzOff + 4] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_5; + zz[zzOff + 5] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_6; + zz[zzOff + 6] = (w << 1) | c; + c = w >> 31; + w = zz[zzOff + 7] + (uint)(zz_6 >> 32); + zz[zzOff + 7] = (w << 1) | c; + } + + public static int Sub(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int Sub(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + long c = 0; + c += (long)x[xOff + 0] - y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)x[xOff + 1] - y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)x[xOff + 2] - y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)x[xOff + 3] - y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubBothFrom(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3]; + z[3] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, int xOff, uint[] z, int zOff) + { + long c = 0; + c += (long)z[zOff + 0] - x[xOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)z[zOff + 1] - x[xOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)z[zOff + 2] - x[xOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)z[zOff + 3] - x[xOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + return (int)c; + } + + public static BigInteger ToBigInteger(uint[] x) + { + byte[] bs = new byte[16]; + for (int i = 0; i < 4; ++i) + { + uint x_i = x[i]; + if (x_i != 0) + { + Pack.UInt32_To_BE(x_i, bs, (3 - i) << 2); + } + } + return new BigInteger(1, bs); + } + + public static BigInteger ToBigInteger64(ulong[] x) + { + byte[] bs = new byte[16]; + for (int i = 0; i < 2; ++i) + { + ulong x_i = x[i]; + if (x_i != 0UL) + { + Pack.UInt64_To_BE(x_i, bs, (1 - i) << 3); + } + } + return new BigInteger(1, bs); + } + + public static void Zero(uint[] z) + { + z[0] = 0; + z[1] = 0; + z[2] = 0; + z[3] = 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat128.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat128.cs.meta new file mode 100644 index 00000000..5a994d4d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat128.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 139465f650dc3ff47be85e4d1be06c78 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat160.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat160.cs new file mode 100644 index 00000000..41b24e86 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat160.cs @@ -0,0 +1,887 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat160 + { + private const ulong M = 0xFFFFFFFFUL; + + public static uint Add(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + y[4]; + z[4] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddBothTo(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + y[4] + z[4]; + z[4] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + z[4]; + z[4] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, int xOff, uint[] z, int zOff, uint cIn) + { + ulong c = cIn; + c += (ulong)x[xOff + 0] + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 1] + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 2] + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 3] + z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 4] + z[zOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 5] + z[zOff + 5]; + return (uint)c; + } + + public static uint AddToEachOther(uint[] u, int uOff, uint[] v, int vOff) + { + ulong c = 0; + c += (ulong)u[uOff + 0] + v[vOff + 0]; + u[uOff + 0] = (uint)c; + v[vOff + 0] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 1] + v[vOff + 1]; + u[uOff + 1] = (uint)c; + v[vOff + 1] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 2] + v[vOff + 2]; + u[uOff + 2] = (uint)c; + v[vOff + 2] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 3] + v[vOff + 3]; + u[uOff + 3] = (uint)c; + v[vOff + 3] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 4] + v[vOff + 4]; + u[uOff + 4] = (uint)c; + v[vOff + 4] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static void Copy(uint[] x, uint[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + } + + public static void Copy(uint[] x, int xOff, uint[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + z[zOff + 4] = x[xOff + 4]; + } + + public static uint[] Create() + { + return new uint[5]; + } + + public static uint[] CreateExt() + { + return new uint[10]; + } + + public static bool Diff(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + bool pos = Gte(x, xOff, y, yOff); + if (pos) + { + Sub(x, xOff, y, yOff, z, zOff); + } + else + { + Sub(y, yOff, x, xOff, z, zOff); + } + return pos; + } + + public static bool Eq(uint[] x, uint[] y) + { + for (int i = 4; i >= 0; --i) + { + if (x[i] != y[i]) + return false; + } + return true; + } + + public static uint[] FromBigInteger(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 160) + throw new ArgumentException(); + + uint[] z = Create(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (uint)x.IntValue; + x = x.ShiftRight(32); + } + return z; + } + + public static uint GetBit(uint[] x, int bit) + { + if (bit == 0) + { + return x[0] & 1; + } + int w = bit >> 5; + if (w < 0 || w >= 5) + { + return 0; + } + int b = bit & 31; + return (x[w] >> b) & 1; + } + + public static bool Gte(uint[] x, uint[] y) + { + for (int i = 4; i >= 0; --i) + { + uint x_i = x[i], y_i = y[i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool Gte(uint[] x, int xOff, uint[] y, int yOff) + { + for (int i = 4; i >= 0; --i) + { + uint x_i = x[xOff + i], y_i = y[yOff + i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool IsOne(uint[] x) + { + if (x[0] != 1) + { + return false; + } + for (int i = 1; i < 5; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static bool IsZero(uint[] x) + { + for (int i = 0; i < 5; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static void Mul(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + ulong y_4 = y[4]; + + { + ulong c = 0, x_0 = x[0]; + c += x_0 * y_0; + zz[0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[3] = (uint)c; + c >>= 32; + c += x_0 * y_4; + zz[4] = (uint)c; + c >>= 32; + zz[5] = (uint)c; + } + + for (int i = 1; i < 5; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[i + 4]; + zz[i + 4] = (uint)c; + c >>= 32; + zz[i + 5] = (uint)c; + } + } + + public static void Mul(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + ulong y_4 = y[yOff + 4]; + + { + ulong c = 0, x_0 = x[xOff + 0]; + c += x_0 * y_0; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_0 * y_4; + zz[zzOff + 4] = (uint)c; + c >>= 32; + zz[zzOff + 5] = (uint)c; + } + + for (int i = 1; i < 5; ++i) + { + ++zzOff; + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + zz[zzOff + 5] = (uint)c; + } + } + + public static uint MulAddTo(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + ulong y_4 = y[4]; + + ulong zc = 0; + for (int i = 0; i < 5; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[i + 4]; + zz[i + 4] = (uint)c; + c >>= 32; + c += zc + zz[i + 5]; + zz[i + 5] = (uint)c; + zc = c >> 32; + } + return (uint)zc; + } + + public static uint MulAddTo(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + ulong y_4 = y[yOff + 4]; + + ulong zc = 0; + for (int i = 0; i < 5; ++i) + { + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += zc + zz[zzOff + 5]; + zz[zzOff + 5] = (uint)c; + zc = c >> 32; + ++zzOff; + } + return (uint)zc; + } + + public static ulong Mul33Add(uint w, uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + Debug.Assert(w >> 31 == 0); + + ulong c = 0, wVal = w; + ulong x0 = x[xOff + 0]; + c += wVal * x0 + y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong x1 = x[xOff + 1]; + c += wVal * x1 + x0 + y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + ulong x2 = x[xOff + 2]; + c += wVal * x2 + x1 + y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + ulong x3 = x[xOff + 3]; + c += wVal * x3 + x2 + y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + ulong x4 = x[xOff + 4]; + c += wVal * x4 + x3 + y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += x4; + return c; + } + + public static uint MulWordAddExt(uint x, uint[] yy, int yyOff, uint[] zz, int zzOff) + { + Debug.Assert(yyOff <= 5); + Debug.Assert(zzOff <= 5); + + ulong c = 0, xVal = x; + c += xVal * yy[yyOff + 0] + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 1] + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 2] + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 3] + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 4] + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint Mul33DWordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <= 1); + ulong c = 0, xVal = x; + ulong y00 = y & M; + c += xVal * y00 + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong y01 = y >> 32; + c += xVal * y01 + y00 + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += y01 + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(5, z, zOff, 4); + } + + public static uint Mul33WordAdd(uint x, uint y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <= 2); + ulong c = 0, yVal = y; + c += yVal * x + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += yVal + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(5, z, zOff, 3); + } + + public static uint MulWordDwordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(zOff <= 2); + ulong c = 0, xVal = x; + c += xVal * y + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += xVal * (y >> 32) + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(5, z, zOff, 3); + } + + public static uint MulWordsAdd(uint x, uint y, uint[] z, int zOff) + { + Debug.Assert(zOff <= 3); + + ulong c = 0, xVal = x, yVal = y; + c += yVal * xVal + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(5, z, zOff, 2); + } + + public static uint MulWord(uint x, uint[] y, uint[] z, int zOff) + { + ulong c = 0, xVal = x; + int i = 0; + do + { + c += xVal * y[i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + while (++i < 5); + return (uint)c; + } + + public static void Square(uint[] x, uint[] zz) + { + ulong x_0 = x[0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 4, j = 10; + do + { + ulong xVal = x[i--]; + ulong p = xVal * xVal; + zz[--j] = (c << 31) | (uint)(p >> 33); + zz[--j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[1]; + ulong zz_2 = zz[2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[2]; + ulong zz_3 = zz[3]; + ulong zz_4 = zz[4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[3]; + ulong zz_5 = zz[5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_4 &= M; + zz_6 += zz_5 >> 32; + zz_5 &= M; + } + + ulong x_4 = x[4]; + ulong zz_7 = zz[7] + (zz_6 >> 32); zz_6 &= M; + ulong zz_8 = zz[8] + (zz_7 >> 32); zz_7 &= M; + { + zz_4 += x_4 * x_0; + w = (uint)zz_4; + zz[4] = (w << 1) | c; + c = w >> 31; + zz_5 += (zz_4 >> 32) + x_4 * x_1; + zz_6 += (zz_5 >> 32) + x_4 * x_2; + zz_7 += (zz_6 >> 32) + x_4 * x_3; + zz_8 += zz_7 >> 32; + } + + w = (uint)zz_5; + zz[5] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_6; + zz[6] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_7; + zz[7] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_8; + zz[8] = (w << 1) | c; + c = w >> 31; + w = zz[9] + (uint)(zz_8 >> 32); + zz[9] = (w << 1) | c; + } + + public static void Square(uint[] x, int xOff, uint[] zz, int zzOff) + { + ulong x_0 = x[xOff + 0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 4, j = 10; + do + { + ulong xVal = x[xOff + i--]; + ulong p = xVal * xVal; + zz[zzOff + --j] = (c << 31) | (uint)(p >> 33); + zz[zzOff + --j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[zzOff + 0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[xOff + 1]; + ulong zz_2 = zz[zzOff + 2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[zzOff + 1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[xOff + 2]; + ulong zz_3 = zz[zzOff + 3]; + ulong zz_4 = zz[zzOff + 4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[zzOff + 2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[xOff + 3]; + ulong zz_5 = zz[zzOff + 5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[zzOff + 6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[zzOff + 3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_4 &= M; + zz_6 += zz_5 >> 32; + zz_5 &= M; + } + + ulong x_4 = x[xOff + 4]; + ulong zz_7 = zz[zzOff + 7] + (zz_6 >> 32); zz_6 &= M; + ulong zz_8 = zz[zzOff + 8] + (zz_7 >> 32); zz_7 &= M; + { + zz_4 += x_4 * x_0; + w = (uint)zz_4; + zz[zzOff + 4] = (w << 1) | c; + c = w >> 31; + zz_5 += (zz_4 >> 32) + x_4 * x_1; + zz_6 += (zz_5 >> 32) + x_4 * x_2; + zz_7 += (zz_6 >> 32) + x_4 * x_3; + zz_8 += zz_7 >> 32; + } + + w = (uint)zz_5; + zz[zzOff + 5] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_6; + zz[zzOff + 6] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_7; + zz[zzOff + 7] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_8; + zz[zzOff + 8] = (w << 1) | c; + c = w >> 31; + w = zz[zzOff + 9] + (uint)(zz_8 >> 32); + zz[zzOff + 9] = (w << 1) | c; + } + + public static int Sub(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)x[4] - y[4]; + z[4] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int Sub(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + long c = 0; + c += (long)x[xOff + 0] - y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)x[xOff + 1] - y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)x[xOff + 2] - y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)x[xOff + 3] - y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (long)x[xOff + 4] - y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubBothFrom(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] - x[4] - y[4]; + z[4] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] - x[4]; + z[4] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, int xOff, uint[] z, int zOff) + { + long c = 0; + c += (long)z[zOff + 0] - x[xOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)z[zOff + 1] - x[xOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)z[zOff + 2] - x[xOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)z[zOff + 3] - x[xOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (long)z[zOff + 4] - x[xOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + return (int)c; + } + + public static BigInteger ToBigInteger(uint[] x) + { + byte[] bs = new byte[20]; + for (int i = 0; i < 5; ++i) + { + uint x_i = x[i]; + if (x_i != 0) + { + Pack.UInt32_To_BE(x_i, bs, (4 - i) << 2); + } + } + return new BigInteger(1, bs); + } + + public static void Zero(uint[] z) + { + z[0] = 0; + z[1] = 0; + z[2] = 0; + z[3] = 0; + z[4] = 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat160.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat160.cs.meta new file mode 100644 index 00000000..536f5b56 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat160.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5863c232c0b5d464485955e74011d938 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat192.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat192.cs new file mode 100644 index 00000000..f84d15f0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat192.cs @@ -0,0 +1,1069 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat192 + { + private const ulong M = 0xFFFFFFFFUL; + + public static uint Add(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + y[4]; + z[4] = (uint)c; + c >>= 32; + c += (ulong)x[5] + y[5]; + z[5] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddBothTo(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + y[4] + z[4]; + z[4] = (uint)c; + c >>= 32; + c += (ulong)x[5] + y[5] + z[5]; + z[5] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + z[4]; + z[4] = (uint)c; + c >>= 32; + c += (ulong)x[5] + z[5]; + z[5] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, int xOff, uint[] z, int zOff, uint cIn) + { + ulong c = cIn; + c += (ulong)x[xOff + 0] + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 1] + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 2] + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 3] + z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 4] + z[zOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 5] + z[zOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddToEachOther(uint[] u, int uOff, uint[] v, int vOff) + { + ulong c = 0; + c += (ulong)u[uOff + 0] + v[vOff + 0]; + u[uOff + 0] = (uint)c; + v[vOff + 0] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 1] + v[vOff + 1]; + u[uOff + 1] = (uint)c; + v[vOff + 1] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 2] + v[vOff + 2]; + u[uOff + 2] = (uint)c; + v[vOff + 2] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 3] + v[vOff + 3]; + u[uOff + 3] = (uint)c; + v[vOff + 3] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 4] + v[vOff + 4]; + u[uOff + 4] = (uint)c; + v[vOff + 4] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 5] + v[vOff + 5]; + u[uOff + 5] = (uint)c; + v[vOff + 5] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static void Copy(uint[] x, uint[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + z[5] = x[5]; + } + + public static void Copy(uint[] x, int xOff, uint[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + z[zOff + 4] = x[xOff + 4]; + z[zOff + 5] = x[xOff + 5]; + } + + public static void Copy64(ulong[] x, ulong[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + } + + public static void Copy64(ulong[] x, int xOff, ulong[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + } + + public static uint[] Create() + { + return new uint[6]; + } + + public static ulong[] Create64() + { + return new ulong[3]; + } + + public static uint[] CreateExt() + { + return new uint[12]; + } + + public static ulong[] CreateExt64() + { + return new ulong[6]; + } + + public static bool Diff(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + bool pos = Gte(x, xOff, y, yOff); + if (pos) + { + Sub(x, xOff, y, yOff, z, zOff); + } + else + { + Sub(y, yOff, x, xOff, z, zOff); + } + return pos; + } + + public static bool Eq(uint[] x, uint[] y) + { + for (int i = 5; i >= 0; --i) + { + if (x[i] != y[i]) + return false; + } + return true; + } + + public static bool Eq64(ulong[] x, ulong[] y) + { + for (int i = 2; i >= 0; --i) + { + if (x[i] != y[i]) + { + return false; + } + } + return true; + } + + public static uint[] FromBigInteger(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 192) + throw new ArgumentException(); + + uint[] z = Create(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (uint)x.IntValue; + x = x.ShiftRight(32); + } + return z; + } + + public static ulong[] FromBigInteger64(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 192) + throw new ArgumentException(); + + ulong[] z = Create64(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (ulong)x.LongValue; + x = x.ShiftRight(64); + } + return z; + } + + public static uint GetBit(uint[] x, int bit) + { + if (bit == 0) + { + return x[0] & 1; + } + int w = bit >> 5; + if (w < 0 || w >= 6) + { + return 0; + } + int b = bit & 31; + return (x[w] >> b) & 1; + } + + public static bool Gte(uint[] x, uint[] y) + { + for (int i = 5; i >= 0; --i) + { + uint x_i = x[i], y_i = y[i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool Gte(uint[] x, int xOff, uint[] y, int yOff) + { + for (int i = 5; i >= 0; --i) + { + uint x_i = x[xOff + i], y_i = y[yOff + i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool IsOne(uint[] x) + { + if (x[0] != 1) + { + return false; + } + for (int i = 1; i < 6; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static bool IsOne64(ulong[] x) + { + if (x[0] != 1UL) + { + return false; + } + for (int i = 1; i < 3; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static bool IsZero(uint[] x) + { + for (int i = 0; i < 6; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static bool IsZero64(ulong[] x) + { + for (int i = 0; i < 3; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static void Mul(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + ulong y_4 = y[4]; + ulong y_5 = y[5]; + + { + ulong c = 0, x_0 = x[0]; + c += x_0 * y_0; + zz[0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[3] = (uint)c; + c >>= 32; + c += x_0 * y_4; + zz[4] = (uint)c; + c >>= 32; + c += x_0 * y_5; + zz[5] = (uint)c; + c >>= 32; + zz[6] = (uint)c; + } + + for (int i = 1; i < 6; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[i + 4]; + zz[i + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[i + 5]; + zz[i + 5] = (uint)c; + c >>= 32; + zz[i + 6] = (uint)c; + } + } + + public static void Mul(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + ulong y_4 = y[yOff + 4]; + ulong y_5 = y[yOff + 5]; + + { + ulong c = 0, x_0 = x[xOff + 0]; + c += x_0 * y_0; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_0 * y_4; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += x_0 * y_5; + zz[zzOff + 5] = (uint)c; + c >>= 32; + zz[zzOff + 6] = (uint)c; + } + + for (int i = 1; i < 6; ++i) + { + ++zzOff; + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[zzOff + 5]; + zz[zzOff + 5] = (uint)c; + c >>= 32; + zz[zzOff + 6] = (uint)c; + } + } + + public static uint MulAddTo(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + ulong y_4 = y[4]; + ulong y_5 = y[5]; + + ulong zc = 0; + for (int i = 0; i < 6; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[i + 4]; + zz[i + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[i + 5]; + zz[i + 5] = (uint)c; + c >>= 32; + c += zc + zz[i + 6]; + zz[i + 6] = (uint)c; + zc = c >> 32; + } + return (uint)zc; + } + + public static uint MulAddTo(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + ulong y_4 = y[yOff + 4]; + ulong y_5 = y[yOff + 5]; + + ulong zc = 0; + for (int i = 0; i < 6; ++i) + { + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[zzOff + 5]; + zz[zzOff + 5] = (uint)c; + c >>= 32; + c += zc + zz[zzOff + 6]; + zz[zzOff + 6] = (uint)c; + zc = c >> 32; + ++zzOff; + } + return (uint)zc; + } + + public static ulong Mul33Add(uint w, uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + Debug.Assert(w >> 31 == 0); + + ulong c = 0, wVal = w; + ulong x0 = x[xOff + 0]; + c += wVal * x0 + y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong x1 = x[xOff + 1]; + c += wVal * x1 + x0 + y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + ulong x2 = x[xOff + 2]; + c += wVal * x2 + x1 + y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + ulong x3 = x[xOff + 3]; + c += wVal * x3 + x2 + y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + ulong x4 = x[xOff + 4]; + c += wVal * x4 + x3 + y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + ulong x5 = x[xOff + 5]; + c += wVal * x5 + x4 + y[yOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += x5; + return c; + } + + public static uint MulWordAddExt(uint x, uint[] yy, int yyOff, uint[] zz, int zzOff) + { + Debug.Assert(yyOff <= 6); + Debug.Assert(zzOff <= 6); + ulong c = 0, xVal = x; + c += xVal * yy[yyOff + 0] + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 1] + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 2] + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 3] + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 4] + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += xVal * yy[yyOff + 5] + zz[zzOff + 5]; + zz[zzOff + 5] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint Mul33DWordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <= 2); + ulong c = 0, xVal = x; + ulong y00 = y & M; + c += xVal * y00 + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong y01 = y >> 32; + c += xVal * y01 + y00 + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += y01 + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(6, z, zOff, 4); + } + + public static uint Mul33WordAdd(uint x, uint y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <=3); + ulong c = 0, yVal = y; + c += yVal * x + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += yVal + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(6, z, zOff, 3); + } + + public static uint MulWordDwordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(zOff <= 3); + ulong c = 0, xVal = x; + c += xVal * y + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += xVal * (y >> 32) + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(6, z, zOff, 3); + } + + public static uint MulWord(uint x, uint[] y, uint[] z, int zOff) + { + ulong c = 0, xVal = x; + int i = 0; + do + { + c += xVal * y[i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + while (++i < 6); + return (uint)c; + } + + public static void Square(uint[] x, uint[] zz) + { + ulong x_0 = x[0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 5, j = 12; + do + { + ulong xVal = x[i--]; + ulong p = xVal * xVal; + zz[--j] = (c << 31) | (uint)(p >> 33); + zz[--j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[1]; + ulong zz_2 = zz[2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[2]; + ulong zz_3 = zz[3]; + ulong zz_4 = zz[4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[3]; + ulong zz_5 = zz[5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_4 &= M; + zz_6 += zz_5 >> 32; + zz_5 &= M; + } + + ulong x_4 = x[4]; + ulong zz_7 = zz[7] + (zz_6 >> 32); zz_6 &= M; + ulong zz_8 = zz[8] + (zz_7 >> 32); zz_7 &= M; + { + zz_4 += x_4 * x_0; + w = (uint)zz_4; + zz[4] = (w << 1) | c; + c = w >> 31; + zz_5 += (zz_4 >> 32) + x_4 * x_1; + zz_6 += (zz_5 >> 32) + x_4 * x_2; + zz_5 &= M; + zz_7 += (zz_6 >> 32) + x_4 * x_3; + zz_6 &= M; + zz_8 += zz_7 >> 32; + zz_7 &= M; + } + + ulong x_5 = x[5]; + ulong zz_9 = zz[9] + (zz_8 >> 32); zz_8 &= M; + ulong zz_10 = zz[10] + (zz_9 >> 32); zz_9 &= M; + { + zz_5 += x_5 * x_0; + w = (uint)zz_5; + zz[5] = (w << 1) | c; + c = w >> 31; + zz_6 += (zz_5 >> 32) + x_5 * x_1; + zz_7 += (zz_6 >> 32) + x_5 * x_2; + zz_8 += (zz_7 >> 32) + x_5 * x_3; + zz_9 += (zz_8 >> 32) + x_5 * x_4; + zz_10 += zz_9 >> 32; + } + + w = (uint)zz_6; + zz[6] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_7; + zz[7] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_8; + zz[8] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_9; + zz[9] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_10; + zz[10] = (w << 1) | c; + c = w >> 31; + w = zz[11] + (uint)(zz_10 >> 32); + zz[11] = (w << 1) | c; + } + + public static void Square(uint[] x, int xOff, uint[] zz, int zzOff) + { + ulong x_0 = x[xOff + 0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 5, j = 12; + do + { + ulong xVal = x[xOff + i--]; + ulong p = xVal * xVal; + zz[zzOff + --j] = (c << 31) | (uint)(p >> 33); + zz[zzOff + --j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[zzOff + 0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[xOff + 1]; + ulong zz_2 = zz[zzOff + 2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[zzOff + 1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[xOff + 2]; + ulong zz_3 = zz[zzOff + 3]; + ulong zz_4 = zz[zzOff + 4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[zzOff + 2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[xOff + 3]; + ulong zz_5 = zz[zzOff + 5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[zzOff + 6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[zzOff + 3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_4 &= M; + zz_6 += zz_5 >> 32; + zz_5 &= M; + } + + ulong x_4 = x[xOff + 4]; + ulong zz_7 = zz[zzOff + 7] + (zz_6 >> 32); zz_6 &= M; + ulong zz_8 = zz[zzOff + 8] + (zz_7 >> 32); zz_7 &= M; + { + zz_4 += x_4 * x_0; + w = (uint)zz_4; + zz[zzOff + 4] = (w << 1) | c; + c = w >> 31; + zz_5 += (zz_4 >> 32) + x_4 * x_1; + zz_6 += (zz_5 >> 32) + x_4 * x_2; + zz_5 &= M; + zz_7 += (zz_6 >> 32) + x_4 * x_3; + zz_6 &= M; + zz_8 += zz_7 >> 32; + zz_7 &= M; + } + + ulong x_5 = x[xOff + 5]; + ulong zz_9 = zz[zzOff + 9] + (zz_8 >> 32); zz_8 &= M; + ulong zz_10 = zz[zzOff + 10] + (zz_9 >> 32); zz_9 &= M; + { + zz_5 += x_5 * x_0; + w = (uint)zz_5; + zz[zzOff + 5] = (w << 1) | c; + c = w >> 31; + zz_6 += (zz_5 >> 32) + x_5 * x_1; + zz_7 += (zz_6 >> 32) + x_5 * x_2; + zz_8 += (zz_7 >> 32) + x_5 * x_3; + zz_9 += (zz_8 >> 32) + x_5 * x_4; + zz_10 += zz_9 >> 32; + } + + w = (uint)zz_6; + zz[zzOff + 6] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_7; + zz[zzOff + 7] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_8; + zz[zzOff + 8] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_9; + zz[zzOff + 9] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_10; + zz[zzOff + 10] = (w << 1) | c; + c = w >> 31; + w = zz[zzOff + 11] + (uint)(zz_10 >> 32); + zz[zzOff + 11] = (w << 1) | c; + } + + public static int Sub(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)x[4] - y[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)x[5] - y[5]; + z[5] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int Sub(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + long c = 0; + c += (long)x[xOff + 0] - y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)x[xOff + 1] - y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)x[xOff + 2] - y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)x[xOff + 3] - y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (long)x[xOff + 4] - y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (long)x[xOff + 5] - y[yOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubBothFrom(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] - x[4] - y[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5] - x[5] - y[5]; + z[5] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] - x[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5] - x[5]; + z[5] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, int xOff, uint[] z, int zOff) + { + long c = 0; + c += (long)z[zOff + 0] - x[xOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)z[zOff + 1] - x[xOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)z[zOff + 2] - x[xOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)z[zOff + 3] - x[xOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (long)z[zOff + 4] - x[xOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (long)z[zOff + 5] - x[xOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + return (int)c; + } + + public static BigInteger ToBigInteger(uint[] x) + { + byte[] bs = new byte[24]; + for (int i = 0; i < 6; ++i) + { + uint x_i = x[i]; + if (x_i != 0) + { + Pack.UInt32_To_BE(x_i, bs, (5 - i) << 2); + } + } + return new BigInteger(1, bs); + } + + public static BigInteger ToBigInteger64(ulong[] x) + { + byte[] bs = new byte[24]; + for (int i = 0; i < 3; ++i) + { + ulong x_i = x[i]; + if (x_i != 0L) + { + Pack.UInt64_To_BE(x_i, bs, (2 - i) << 3); + } + } + return new BigInteger(1, bs); + } + + public static void Zero(uint[] z) + { + z[0] = 0; + z[1] = 0; + z[2] = 0; + z[3] = 0; + z[4] = 0; + z[5] = 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat192.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat192.cs.meta new file mode 100644 index 00000000..9f1d17a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat192.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5068ae0f638a4594eb28d3804c58cb91 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat224.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat224.cs new file mode 100644 index 00000000..3b755d0a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat224.cs @@ -0,0 +1,1191 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat224 + { + private const ulong M = 0xFFFFFFFFUL; + + public static uint Add(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + y[4]; + z[4] = (uint)c; + c >>= 32; + c += (ulong)x[5] + y[5]; + z[5] = (uint)c; + c >>= 32; + c += (ulong)x[6] + y[6]; + z[6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint Add(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + ulong c = 0; + c += (ulong)x[xOff + 0] + y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 1] + y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 2] + y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 3] + y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 4] + y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 5] + y[yOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 6] + y[yOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddBothTo(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + y[4] + z[4]; + z[4] = (uint)c; + c >>= 32; + c += (ulong)x[5] + y[5] + z[5]; + z[5] = (uint)c; + c >>= 32; + c += (ulong)x[6] + y[6] + z[6]; + z[6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddBothTo(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + ulong c = 0; + c += (ulong)x[xOff + 0] + y[yOff + 0] + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 1] + y[yOff + 1] + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 2] + y[yOff + 2] + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 3] + y[yOff + 3] + z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 4] + y[yOff + 4] + z[zOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 5] + y[yOff + 5] + z[zOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 6] + y[yOff + 6] + z[zOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + z[4]; + z[4] = (uint)c; + c >>= 32; + c += (ulong)x[5] + z[5]; + z[5] = (uint)c; + c >>= 32; + c += (ulong)x[6] + z[6]; + z[6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, int xOff, uint[] z, int zOff, uint cIn) + { + ulong c = cIn; + c += (ulong)x[xOff + 0] + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 1] + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 2] + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 3] + z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 4] + z[zOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 5] + z[zOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 6] + z[zOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddToEachOther(uint[] u, int uOff, uint[] v, int vOff) + { + ulong c = 0; + c += (ulong)u[uOff + 0] + v[vOff + 0]; + u[uOff + 0] = (uint)c; + v[vOff + 0] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 1] + v[vOff + 1]; + u[uOff + 1] = (uint)c; + v[vOff + 1] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 2] + v[vOff + 2]; + u[uOff + 2] = (uint)c; + v[vOff + 2] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 3] + v[vOff + 3]; + u[uOff + 3] = (uint)c; + v[vOff + 3] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 4] + v[vOff + 4]; + u[uOff + 4] = (uint)c; + v[vOff + 4] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 5] + v[vOff + 5]; + u[uOff + 5] = (uint)c; + v[vOff + 5] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 6] + v[vOff + 6]; + u[uOff + 6] = (uint)c; + v[vOff + 6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static void Copy(uint[] x, uint[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + z[5] = x[5]; + z[6] = x[6]; + } + + public static void Copy(uint[] x, int xOff, uint[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + z[zOff + 4] = x[xOff + 4]; + z[zOff + 5] = x[xOff + 5]; + z[zOff + 6] = x[xOff + 6]; + } + + public static uint[] Create() + { + return new uint[7]; + } + + public static uint[] CreateExt() + { + return new uint[14]; + } + + public static bool Diff(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + bool pos = Gte(x, xOff, y, yOff); + if (pos) + { + Sub(x, xOff, y, yOff, z, zOff); + } + else + { + Sub(y, yOff, x, xOff, z, zOff); + } + return pos; + } + + public static bool Eq(uint[] x, uint[] y) + { + for (int i = 6; i >= 0; --i) + { + if (x[i] != y[i]) + return false; + } + return true; + } + + public static uint[] FromBigInteger(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 224) + throw new ArgumentException(); + + uint[] z = Create(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (uint)x.IntValue; + x = x.ShiftRight(32); + } + return z; + } + + public static uint GetBit(uint[] x, int bit) + { + if (bit == 0) + { + return x[0] & 1; + } + int w = bit >> 5; + if (w < 0 || w >= 7) + { + return 0; + } + int b = bit & 31; + return (x[w] >> b) & 1; + } + + public static bool Gte(uint[] x, uint[] y) + { + for (int i = 6; i >= 0; --i) + { + uint x_i = x[i], y_i = y[i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool Gte(uint[] x, int xOff, uint[] y, int yOff) + { + for (int i = 6; i >= 0; --i) + { + uint x_i = x[xOff + i], y_i = y[yOff + i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool IsOne(uint[] x) + { + if (x[0] != 1) + { + return false; + } + for (int i = 1; i < 7; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static bool IsZero(uint[] x) + { + for (int i = 0; i < 7; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static void Mul(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + ulong y_4 = y[4]; + ulong y_5 = y[5]; + ulong y_6 = y[6]; + + { + ulong c = 0, x_0 = x[0]; + c += x_0 * y_0; + zz[0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[3] = (uint)c; + c >>= 32; + c += x_0 * y_4; + zz[4] = (uint)c; + c >>= 32; + c += x_0 * y_5; + zz[5] = (uint)c; + c >>= 32; + c += x_0 * y_6; + zz[6] = (uint)c; + c >>= 32; + zz[7] = (uint)c; + } + + for (int i = 1; i < 7; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[i + 4]; + zz[i + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[i + 5]; + zz[i + 5] = (uint)c; + c >>= 32; + c += x_i * y_6 + zz[i + 6]; + zz[i + 6] = (uint)c; + c >>= 32; + zz[i + 7] = (uint)c; + } + } + + public static void Mul(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + ulong y_4 = y[yOff + 4]; + ulong y_5 = y[yOff + 5]; + ulong y_6 = y[yOff + 6]; + + { + ulong c = 0, x_0 = x[xOff + 0]; + c += x_0 * y_0; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_0 * y_4; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += x_0 * y_5; + zz[zzOff + 5] = (uint)c; + c >>= 32; + c += x_0 * y_6; + zz[zzOff + 6] = (uint)c; + c >>= 32; + zz[zzOff + 7] = (uint)c; + } + + for (int i = 1; i < 7; ++i) + { + ++zzOff; + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[zzOff + 5]; + zz[zzOff + 5] = (uint)c; + c >>= 32; + c += x_i * y_6 + zz[zzOff + 6]; + zz[zzOff + 6] = (uint)c; + c >>= 32; + zz[zzOff + 7] = (uint)c; + } + } + + public static uint MulAddTo(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + ulong y_4 = y[4]; + ulong y_5 = y[5]; + ulong y_6 = y[6]; + + ulong zc = 0; + for (int i = 0; i < 7; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[i + 4]; + zz[i + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[i + 5]; + zz[i + 5] = (uint)c; + c >>= 32; + c += x_i * y_6 + zz[i + 6]; + zz[i + 6] = (uint)c; + c >>= 32; + c += zc + zz[i + 7]; + zz[i + 7] = (uint)c; + zc = c >> 32; + } + return (uint)zc; + } + + public static uint MulAddTo(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + ulong y_4 = y[yOff + 4]; + ulong y_5 = y[yOff + 5]; + ulong y_6 = y[yOff + 6]; + + ulong zc = 0; + for (int i = 0; i < 7; ++i) + { + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[zzOff + 5]; + zz[zzOff + 5] = (uint)c; + c >>= 32; + c += x_i * y_6 + zz[zzOff + 6]; + zz[zzOff + 6] = (uint)c; + c >>= 32; + c += zc + zz[zzOff + 7]; + zz[zzOff + 7] = (uint)c; + zc = c >> 32; + ++zzOff; + } + return (uint)zc; + } + + public static ulong Mul33Add(uint w, uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + Debug.Assert(w >> 31 == 0); + + ulong c = 0, wVal = w; + ulong x0 = x[xOff + 0]; + c += wVal * x0 + y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong x1 = x[xOff + 1]; + c += wVal * x1 + x0 + y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + ulong x2 = x[xOff + 2]; + c += wVal * x2 + x1 + y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + ulong x3 = x[xOff + 3]; + c += wVal * x3 + x2 + y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + ulong x4 = x[xOff + 4]; + c += wVal * x4 + x3 + y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + ulong x5 = x[xOff + 5]; + c += wVal * x5 + x4 + y[yOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + ulong x6 = x[xOff + 6]; + c += wVal * x6 + x5 + y[yOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + c += x6; + return c; + } + + public static uint MulByWord(uint x, uint[] z) + { + ulong c = 0, xVal = x; + c += xVal * (ulong)z[0]; + z[0] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[1]; + z[1] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[2]; + z[2] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[3]; + z[3] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[4]; + z[4] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[5]; + z[5] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[6]; + z[6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint MulByWordAddTo(uint x, uint[] y, uint[] z) + { + ulong c = 0, xVal = x; + c += xVal * (ulong)z[0] + y[0]; + z[0] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[1] + y[1]; + z[1] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[2] + y[2]; + z[2] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[3] + y[3]; + z[3] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[4] + y[4]; + z[4] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[5] + y[5]; + z[5] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[6] + y[6]; + z[6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint MulWordAddTo(uint x, uint[] y, int yOff, uint[] z, int zOff) + { + ulong c = 0, xVal = x; + c += xVal * y[yOff + 0] + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 1] + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 2] + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 3] + z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 4] + z[zOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 5] + z[zOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 6] + z[zOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint Mul33DWordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <= 3); + ulong c = 0, xVal = x; + ulong y00 = y & M; + c += xVal * y00 + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong y01 = y >> 32; + c += xVal * y01 + y00 + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += y01 + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(7, z, zOff, 4); + } + + public static uint Mul33WordAdd(uint x, uint y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <= 4); + ulong c = 0, yVal = y; + c += yVal * x + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += yVal + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(7, z, zOff, 3); + } + + public static uint MulWordDwordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(zOff <= 4); + ulong c = 0, xVal = x; + c += xVal * y + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += xVal * (y >> 32) + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(7, z, zOff, 3); + } + + public static uint MulWord(uint x, uint[] y, uint[] z, int zOff) + { + ulong c = 0, xVal = x; + int i = 0; + do + { + c += xVal * y[i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + while (++i < 7); + return (uint)c; + } + + public static void Square(uint[] x, uint[] zz) + { + ulong x_0 = x[0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 6, j = 14; + do + { + ulong xVal = x[i--]; + ulong p = xVal * xVal; + zz[--j] = (c << 31) | (uint)(p >> 33); + zz[--j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[1]; + ulong zz_2 = zz[2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[2]; + ulong zz_3 = zz[3]; + ulong zz_4 = zz[4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[3]; + ulong zz_5 = zz[5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_4 &= M; + zz_6 += zz_5 >> 32; + zz_5 &= M; + } + + ulong x_4 = x[4]; + ulong zz_7 = zz[7] + (zz_6 >> 32); zz_6 &= M; + ulong zz_8 = zz[8] + (zz_7 >> 32); zz_7 &= M; + { + zz_4 += x_4 * x_0; + w = (uint)zz_4; + zz[4] = (w << 1) | c; + c = w >> 31; + zz_5 += (zz_4 >> 32) + x_4 * x_1; + zz_6 += (zz_5 >> 32) + x_4 * x_2; + zz_5 &= M; + zz_7 += (zz_6 >> 32) + x_4 * x_3; + zz_6 &= M; + zz_8 += zz_7 >> 32; + zz_7 &= M; + } + + ulong x_5 = x[5]; + ulong zz_9 = zz[9] + (zz_8 >> 32); zz_8 &= M; + ulong zz_10 = zz[10] + (zz_9 >> 32); zz_9 &= M; + { + zz_5 += x_5 * x_0; + w = (uint)zz_5; + zz[5] = (w << 1) | c; + c = w >> 31; + zz_6 += (zz_5 >> 32) + x_5 * x_1; + zz_7 += (zz_6 >> 32) + x_5 * x_2; + zz_6 &= M; + zz_8 += (zz_7 >> 32) + x_5 * x_3; + zz_7 &= M; + zz_9 += (zz_8 >> 32) + x_5 * x_4; + zz_8 &= M; + zz_10 += zz_9 >> 32; + zz_9 &= M; + } + + ulong x_6 = x[6]; + ulong zz_11 = zz[11] + (zz_10 >> 32); zz_10 &= M; + ulong zz_12 = zz[12] + (zz_11 >> 32); zz_11 &= M; + { + zz_6 += x_6 * x_0; + w = (uint)zz_6; + zz[6] = (w << 1) | c; + c = w >> 31; + zz_7 += (zz_6 >> 32) + x_6 * x_1; + zz_8 += (zz_7 >> 32) + x_6 * x_2; + zz_9 += (zz_8 >> 32) + x_6 * x_3; + zz_10 += (zz_9 >> 32) + x_6 * x_4; + zz_11 += (zz_10 >> 32) + x_6 * x_5; + zz_12 += zz_11 >> 32; + } + + w = (uint)zz_7; + zz[7] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_8; + zz[8] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_9; + zz[9] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_10; + zz[10] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_11; + zz[11] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_12; + zz[12] = (w << 1) | c; + c = w >> 31; + w = zz[13] + (uint)(zz_12 >> 32); + zz[13] = (w << 1) | c; + } + + public static void Square(uint[] x, int xOff, uint[] zz, int zzOff) + { + ulong x_0 = x[xOff + 0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 6, j = 14; + do + { + ulong xVal = x[xOff + i--]; + ulong p = xVal * xVal; + zz[zzOff + --j] = (c << 31) | (uint)(p >> 33); + zz[zzOff + --j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[zzOff + 0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[xOff + 1]; + ulong zz_2 = zz[zzOff + 2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[zzOff + 1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[xOff + 2]; + ulong zz_3 = zz[zzOff + 3]; + ulong zz_4 = zz[zzOff + 4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[zzOff + 2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[xOff + 3]; + ulong zz_5 = zz[zzOff + 5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[zzOff + 6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[zzOff + 3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_4 &= M; + zz_6 += zz_5 >> 32; + zz_5 &= M; + } + + ulong x_4 = x[xOff + 4]; + ulong zz_7 = zz[zzOff + 7] + (zz_6 >> 32); zz_6 &= M; + ulong zz_8 = zz[zzOff + 8] + (zz_7 >> 32); zz_7 &= M; + { + zz_4 += x_4 * x_0; + w = (uint)zz_4; + zz[zzOff + 4] = (w << 1) | c; + c = w >> 31; + zz_5 += (zz_4 >> 32) + x_4 * x_1; + zz_6 += (zz_5 >> 32) + x_4 * x_2; + zz_5 &= M; + zz_7 += (zz_6 >> 32) + x_4 * x_3; + zz_6 &= M; + zz_8 += zz_7 >> 32; + zz_7 &= M; + } + + ulong x_5 = x[xOff + 5]; + ulong zz_9 = zz[zzOff + 9] + (zz_8 >> 32); zz_8 &= M; + ulong zz_10 = zz[zzOff + 10] + (zz_9 >> 32); zz_9 &= M; + { + zz_5 += x_5 * x_0; + w = (uint)zz_5; + zz[zzOff + 5] = (w << 1) | c; + c = w >> 31; + zz_6 += (zz_5 >> 32) + x_5 * x_1; + zz_7 += (zz_6 >> 32) + x_5 * x_2; + zz_6 &= M; + zz_8 += (zz_7 >> 32) + x_5 * x_3; + zz_7 &= M; + zz_9 += (zz_8 >> 32) + x_5 * x_4; + zz_8 &= M; + zz_10 += zz_9 >> 32; + zz_9 &= M; + } + + ulong x_6 = x[xOff + 6]; + ulong zz_11 = zz[zzOff + 11] + (zz_10 >> 32); zz_10 &= M; + ulong zz_12 = zz[zzOff + 12] + (zz_11 >> 32); zz_11 &= M; + { + zz_6 += x_6 * x_0; + w = (uint)zz_6; + zz[zzOff + 6] = (w << 1) | c; + c = w >> 31; + zz_7 += (zz_6 >> 32) + x_6 * x_1; + zz_8 += (zz_7 >> 32) + x_6 * x_2; + zz_9 += (zz_8 >> 32) + x_6 * x_3; + zz_10 += (zz_9 >> 32) + x_6 * x_4; + zz_11 += (zz_10 >> 32) + x_6 * x_5; + zz_12 += zz_11 >> 32; + } + + w = (uint)zz_7; + zz[zzOff + 7] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_8; + zz[zzOff + 8] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_9; + zz[zzOff + 9] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_10; + zz[zzOff + 10] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_11; + zz[zzOff + 11] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_12; + zz[zzOff + 12] = (w << 1) | c; + c = w >> 31; + w = zz[zzOff + 13] + (uint)(zz_12 >> 32); + zz[zzOff + 13] = (w << 1) | c; + } + + public static int Sub(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)x[4] - y[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)x[5] - y[5]; + z[5] = (uint)c; + c >>= 32; + c += (long)x[6] - y[6]; + z[6] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int Sub(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + long c = 0; + c += (long)x[xOff + 0] - y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)x[xOff + 1] - y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)x[xOff + 2] - y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)x[xOff + 3] - y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (long)x[xOff + 4] - y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (long)x[xOff + 5] - y[yOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (long)x[xOff + 6] - y[yOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubBothFrom(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] - x[4] - y[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5] - x[5] - y[5]; + z[5] = (uint)c; + c >>= 32; + c += (long)z[6] - x[6] - y[6]; + z[6] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] - x[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5] - x[5]; + z[5] = (uint)c; + c >>= 32; + c += (long)z[6] - x[6]; + z[6] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, int xOff, uint[] z, int zOff) + { + long c = 0; + c += (long)z[zOff + 0] - x[xOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)z[zOff + 1] - x[xOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)z[zOff + 2] - x[xOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)z[zOff + 3] - x[xOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (long)z[zOff + 4] - x[xOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (long)z[zOff + 5] - x[xOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (long)z[zOff + 6] - x[xOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + return (int)c; + } + + public static BigInteger ToBigInteger(uint[] x) + { + byte[] bs = new byte[28]; + for (int i = 0; i < 7; ++i) + { + uint x_i = x[i]; + if (x_i != 0) + { + Pack.UInt32_To_BE(x_i, bs, (6 - i) << 2); + } + } + return new BigInteger(1, bs); + } + + public static void Zero(uint[] z) + { + z[0] = 0; + z[1] = 0; + z[2] = 0; + z[3] = 0; + z[4] = 0; + z[5] = 0; + z[6] = 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat224.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat224.cs.meta new file mode 100644 index 00000000..c3809526 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat224.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c67e923674f4df84f992e06eecec940e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat256.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat256.cs new file mode 100644 index 00000000..0ce48896 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat256.cs @@ -0,0 +1,1411 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat256 + { + private const ulong M = 0xFFFFFFFFUL; + + public static uint Add(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + y[4]; + z[4] = (uint)c; + c >>= 32; + c += (ulong)x[5] + y[5]; + z[5] = (uint)c; + c >>= 32; + c += (ulong)x[6] + y[6]; + z[6] = (uint)c; + c >>= 32; + c += (ulong)x[7] + y[7]; + z[7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint Add(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + ulong c = 0; + c += (ulong)x[xOff + 0] + y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 1] + y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 2] + y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 3] + y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 4] + y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 5] + y[yOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 6] + y[yOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 7] + y[yOff + 7]; + z[zOff + 7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddBothTo(uint[] x, uint[] y, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + y[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + y[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + y[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + y[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + y[4] + z[4]; + z[4] = (uint)c; + c >>= 32; + c += (ulong)x[5] + y[5] + z[5]; + z[5] = (uint)c; + c >>= 32; + c += (ulong)x[6] + y[6] + z[6]; + z[6] = (uint)c; + c >>= 32; + c += (ulong)x[7] + y[7] + z[7]; + z[7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddBothTo(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + ulong c = 0; + c += (ulong)x[xOff + 0] + y[yOff + 0] + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 1] + y[yOff + 1] + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 2] + y[yOff + 2] + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 3] + y[yOff + 3] + z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 4] + y[yOff + 4] + z[zOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 5] + y[yOff + 5] + z[zOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 6] + y[yOff + 6] + z[zOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 7] + y[yOff + 7] + z[zOff + 7]; + z[zOff + 7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, uint[] z) + { + ulong c = 0; + c += (ulong)x[0] + z[0]; + z[0] = (uint)c; + c >>= 32; + c += (ulong)x[1] + z[1]; + z[1] = (uint)c; + c >>= 32; + c += (ulong)x[2] + z[2]; + z[2] = (uint)c; + c >>= 32; + c += (ulong)x[3] + z[3]; + z[3] = (uint)c; + c >>= 32; + c += (ulong)x[4] + z[4]; + z[4] = (uint)c; + c >>= 32; + c += (ulong)x[5] + z[5]; + z[5] = (uint)c; + c >>= 32; + c += (ulong)x[6] + z[6]; + z[6] = (uint)c; + c >>= 32; + c += (ulong)x[7] + z[7]; + z[7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddTo(uint[] x, int xOff, uint[] z, int zOff, uint cIn) + { + ulong c = cIn; + c += (ulong)x[xOff + 0] + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 1] + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 2] + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 3] + z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 4] + z[zOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 5] + z[zOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 6] + z[zOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + c += (ulong)x[xOff + 7] + z[zOff + 7]; + z[zOff + 7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint AddToEachOther(uint[] u, int uOff, uint[] v, int vOff) + { + ulong c = 0; + c += (ulong)u[uOff + 0] + v[vOff + 0]; + u[uOff + 0] = (uint)c; + v[vOff + 0] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 1] + v[vOff + 1]; + u[uOff + 1] = (uint)c; + v[vOff + 1] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 2] + v[vOff + 2]; + u[uOff + 2] = (uint)c; + v[vOff + 2] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 3] + v[vOff + 3]; + u[uOff + 3] = (uint)c; + v[vOff + 3] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 4] + v[vOff + 4]; + u[uOff + 4] = (uint)c; + v[vOff + 4] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 5] + v[vOff + 5]; + u[uOff + 5] = (uint)c; + v[vOff + 5] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 6] + v[vOff + 6]; + u[uOff + 6] = (uint)c; + v[vOff + 6] = (uint)c; + c >>= 32; + c += (ulong)u[uOff + 7] + v[vOff + 7]; + u[uOff + 7] = (uint)c; + v[vOff + 7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static void Copy(uint[] x, uint[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + z[5] = x[5]; + z[6] = x[6]; + z[7] = x[7]; + } + + public static void Copy(uint[] x, int xOff, uint[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + z[zOff + 4] = x[xOff + 4]; + z[zOff + 5] = x[xOff + 5]; + z[zOff + 6] = x[xOff + 6]; + z[zOff + 7] = x[xOff + 7]; + } + + public static void Copy64(ulong[] x, ulong[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + } + + public static void Copy64(ulong[] x, int xOff, ulong[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + } + + public static uint[] Create() + { + return new uint[8]; + } + + public static ulong[] Create64() + { + return new ulong[4]; + } + + public static uint[] CreateExt() + { + return new uint[16]; + } + + public static ulong[] CreateExt64() + { + return new ulong[8]; + } + + public static bool Diff(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + bool pos = Gte(x, xOff, y, yOff); + if (pos) + { + Sub(x, xOff, y, yOff, z, zOff); + } + else + { + Sub(y, yOff, x, xOff, z, zOff); + } + return pos; + } + + public static bool Eq(uint[] x, uint[] y) + { + for (int i = 7; i >= 0; --i) + { + if (x[i] != y[i]) + return false; + } + return true; + } + + public static bool Eq64(ulong[] x, ulong[] y) + { + for (int i = 3; i >= 0; --i) + { + if (x[i] != y[i]) + { + return false; + } + } + return true; + } + + public static uint[] FromBigInteger(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 256) + throw new ArgumentException(); + + uint[] z = Create(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (uint)x.IntValue; + x = x.ShiftRight(32); + } + return z; + } + + public static ulong[] FromBigInteger64(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 256) + throw new ArgumentException(); + + ulong[] z = Create64(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (ulong)x.LongValue; + x = x.ShiftRight(64); + } + return z; + } + + public static uint GetBit(uint[] x, int bit) + { + if (bit == 0) + { + return x[0] & 1; + } + if ((bit & 255) != bit) + { + return 0; + } + int w = bit >> 5; + int b = bit & 31; + return (x[w] >> b) & 1; + } + + public static bool Gte(uint[] x, uint[] y) + { + for (int i = 7; i >= 0; --i) + { + uint x_i = x[i], y_i = y[i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool Gte(uint[] x, int xOff, uint[] y, int yOff) + { + for (int i = 7; i >= 0; --i) + { + uint x_i = x[xOff + i], y_i = y[yOff + i]; + if (x_i < y_i) + return false; + if (x_i > y_i) + return true; + } + return true; + } + + public static bool IsOne(uint[] x) + { + if (x[0] != 1) + { + return false; + } + for (int i = 1; i < 8; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static bool IsOne64(ulong[] x) + { + if (x[0] != 1UL) + { + return false; + } + for (int i = 1; i < 4; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static bool IsZero(uint[] x) + { + for (int i = 0; i < 8; ++i) + { + if (x[i] != 0) + { + return false; + } + } + return true; + } + + public static bool IsZero64(ulong[] x) + { + for (int i = 0; i < 4; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static void Mul(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + ulong y_4 = y[4]; + ulong y_5 = y[5]; + ulong y_6 = y[6]; + ulong y_7 = y[7]; + + { + ulong c = 0, x_0 = x[0]; + c += x_0 * y_0; + zz[0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[3] = (uint)c; + c >>= 32; + c += x_0 * y_4; + zz[4] = (uint)c; + c >>= 32; + c += x_0 * y_5; + zz[5] = (uint)c; + c >>= 32; + c += x_0 * y_6; + zz[6] = (uint)c; + c >>= 32; + c += x_0 * y_7; + zz[7] = (uint)c; + c >>= 32; + zz[8] = (uint)c; + } + + for (int i = 1; i < 8; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[i + 4]; + zz[i + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[i + 5]; + zz[i + 5] = (uint)c; + c >>= 32; + c += x_i * y_6 + zz[i + 6]; + zz[i + 6] = (uint)c; + c >>= 32; + c += x_i * y_7 + zz[i + 7]; + zz[i + 7] = (uint)c; + c >>= 32; + zz[i + 8] = (uint)c; + } + } + + public static void Mul(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + ulong y_4 = y[yOff + 4]; + ulong y_5 = y[yOff + 5]; + ulong y_6 = y[yOff + 6]; + ulong y_7 = y[yOff + 7]; + + { + ulong c = 0, x_0 = x[xOff + 0]; + c += x_0 * y_0; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_0 * y_1; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_0 * y_2; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_0 * y_3; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_0 * y_4; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += x_0 * y_5; + zz[zzOff + 5] = (uint)c; + c >>= 32; + c += x_0 * y_6; + zz[zzOff + 6] = (uint)c; + c >>= 32; + c += x_0 * y_7; + zz[zzOff + 7] = (uint)c; + c >>= 32; + zz[zzOff + 8] = (uint)c; + } + + for (int i = 1; i < 8; ++i) + { + ++zzOff; + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[zzOff + 5]; + zz[zzOff + 5] = (uint)c; + c >>= 32; + c += x_i * y_6 + zz[zzOff + 6]; + zz[zzOff + 6] = (uint)c; + c >>= 32; + c += x_i * y_7 + zz[zzOff + 7]; + zz[zzOff + 7] = (uint)c; + c >>= 32; + zz[zzOff + 8] = (uint)c; + } + } + + public static uint MulAddTo(uint[] x, uint[] y, uint[] zz) + { + ulong y_0 = y[0]; + ulong y_1 = y[1]; + ulong y_2 = y[2]; + ulong y_3 = y[3]; + ulong y_4 = y[4]; + ulong y_5 = y[5]; + ulong y_6 = y[6]; + ulong y_7 = y[7]; + + ulong zc = 0; + for (int i = 0; i < 8; ++i) + { + ulong c = 0, x_i = x[i]; + c += x_i * y_0 + zz[i + 0]; + zz[i + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[i + 1]; + zz[i + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[i + 2]; + zz[i + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[i + 3]; + zz[i + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[i + 4]; + zz[i + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[i + 5]; + zz[i + 5] = (uint)c; + c >>= 32; + c += x_i * y_6 + zz[i + 6]; + zz[i + 6] = (uint)c; + c >>= 32; + c += x_i * y_7 + zz[i + 7]; + zz[i + 7] = (uint)c; + c >>= 32; + c += zc + zz[i + 8]; + zz[i + 8] = (uint)c; + zc = c >> 32; + } + return (uint)zc; + } + + public static uint MulAddTo(uint[] x, int xOff, uint[] y, int yOff, uint[] zz, int zzOff) + { + ulong y_0 = y[yOff + 0]; + ulong y_1 = y[yOff + 1]; + ulong y_2 = y[yOff + 2]; + ulong y_3 = y[yOff + 3]; + ulong y_4 = y[yOff + 4]; + ulong y_5 = y[yOff + 5]; + ulong y_6 = y[yOff + 6]; + ulong y_7 = y[yOff + 7]; + + ulong zc = 0; + for (int i = 0; i < 8; ++i) + { + ulong c = 0, x_i = x[xOff + i]; + c += x_i * y_0 + zz[zzOff + 0]; + zz[zzOff + 0] = (uint)c; + c >>= 32; + c += x_i * y_1 + zz[zzOff + 1]; + zz[zzOff + 1] = (uint)c; + c >>= 32; + c += x_i * y_2 + zz[zzOff + 2]; + zz[zzOff + 2] = (uint)c; + c >>= 32; + c += x_i * y_3 + zz[zzOff + 3]; + zz[zzOff + 3] = (uint)c; + c >>= 32; + c += x_i * y_4 + zz[zzOff + 4]; + zz[zzOff + 4] = (uint)c; + c >>= 32; + c += x_i * y_5 + zz[zzOff + 5]; + zz[zzOff + 5] = (uint)c; + c >>= 32; + c += x_i * y_6 + zz[zzOff + 6]; + zz[zzOff + 6] = (uint)c; + c >>= 32; + c += x_i * y_7 + zz[zzOff + 7]; + zz[zzOff + 7] = (uint)c; + c >>= 32; + c += zc + zz[zzOff + 8]; + zz[zzOff + 8] = (uint)c; + zc = c >> 32; + ++zzOff; + } + return (uint)zc; + } + + public static ulong Mul33Add(uint w, uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + Debug.Assert(w >> 31 == 0); + + ulong c = 0, wVal = w; + ulong x0 = x[xOff + 0]; + c += wVal * x0 + y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong x1 = x[xOff + 1]; + c += wVal * x1 + x0 + y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + ulong x2 = x[xOff + 2]; + c += wVal * x2 + x1 + y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + ulong x3 = x[xOff + 3]; + c += wVal * x3 + x2 + y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + ulong x4 = x[xOff + 4]; + c += wVal * x4 + x3 + y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + ulong x5 = x[xOff + 5]; + c += wVal * x5 + x4 + y[yOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + ulong x6 = x[xOff + 6]; + c += wVal * x6 + x5 + y[yOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + ulong x7 = x[xOff + 7]; + c += wVal * x7 + x6 + y[yOff + 7]; + z[zOff + 7] = (uint)c; + c >>= 32; + c += x7; + return c; + } + + public static uint MulByWord(uint x, uint[] z) + { + ulong c = 0, xVal = x; + c += xVal * (ulong)z[0]; + z[0] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[1]; + z[1] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[2]; + z[2] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[3]; + z[3] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[4]; + z[4] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[5]; + z[5] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[6]; + z[6] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[7]; + z[7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint MulByWordAddTo(uint x, uint[] y, uint[] z) + { + ulong c = 0, xVal = x; + c += xVal * (ulong)z[0] + y[0]; + z[0] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[1] + y[1]; + z[1] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[2] + y[2]; + z[2] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[3] + y[3]; + z[3] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[4] + y[4]; + z[4] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[5] + y[5]; + z[5] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[6] + y[6]; + z[6] = (uint)c; + c >>= 32; + c += xVal * (ulong)z[7] + y[7]; + z[7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint MulWordAddTo(uint x, uint[] y, int yOff, uint[] z, int zOff) + { + ulong c = 0, xVal = x; + c += xVal * y[yOff + 0] + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 1] + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 2] + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 3] + z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 4] + z[zOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 5] + z[zOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 6] + z[zOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + c += xVal * y[yOff + 7] + z[zOff + 7]; + z[zOff + 7] = (uint)c; + c >>= 32; + return (uint)c; + } + + public static uint Mul33DWordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <= 4); + ulong c = 0, xVal = x; + ulong y00 = y & M; + c += xVal * y00 + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + ulong y01 = y >> 32; + c += xVal * y01 + y00 + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += y01 + z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += z[zOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(8, z, zOff, 4); + } + + public static uint Mul33WordAdd(uint x, uint y, uint[] z, int zOff) + { + Debug.Assert(x >> 31 == 0); + Debug.Assert(zOff <= 5); + ulong c = 0, yVal = y; + c += yVal * x + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += yVal + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(8, z, zOff, 3); + } + + public static uint MulWordDwordAdd(uint x, ulong y, uint[] z, int zOff) + { + Debug.Assert(zOff <= 5); + ulong c = 0, xVal = x; + c += xVal * y + z[zOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += xVal * (y >> 32) + z[zOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += z[zOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + return c == 0 ? 0 : Nat.IncAt(8, z, zOff, 3); + } + + public static uint MulWord(uint x, uint[] y, uint[] z, int zOff) + { + ulong c = 0, xVal = x; + int i = 0; + do + { + c += xVal * y[i]; + z[zOff + i] = (uint)c; + c >>= 32; + } + while (++i < 8); + return (uint)c; + } + + public static void Square(uint[] x, uint[] zz) + { + ulong x_0 = x[0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 7, j = 16; + do + { + ulong xVal = x[i--]; + ulong p = xVal * xVal; + zz[--j] = (c << 31) | (uint)(p >> 33); + zz[--j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[1]; + ulong zz_2 = zz[2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[2]; + ulong zz_3 = zz[3]; + ulong zz_4 = zz[4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[3]; + ulong zz_5 = zz[5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_4 &= M; + zz_6 += zz_5 >> 32; + zz_5 &= M; + } + + ulong x_4 = x[4]; + ulong zz_7 = zz[7] + (zz_6 >> 32); zz_6 &= M; + ulong zz_8 = zz[8] + (zz_7 >> 32); zz_7 &= M; + { + zz_4 += x_4 * x_0; + w = (uint)zz_4; + zz[4] = (w << 1) | c; + c = w >> 31; + zz_5 += (zz_4 >> 32) + x_4 * x_1; + zz_6 += (zz_5 >> 32) + x_4 * x_2; + zz_5 &= M; + zz_7 += (zz_6 >> 32) + x_4 * x_3; + zz_6 &= M; + zz_8 += zz_7 >> 32; + zz_7 &= M; + } + + ulong x_5 = x[5]; + ulong zz_9 = zz[9] + (zz_8 >> 32); zz_8 &= M; + ulong zz_10 = zz[10] + (zz_9 >> 32); zz_9 &= M; + { + zz_5 += x_5 * x_0; + w = (uint)zz_5; + zz[5] = (w << 1) | c; + c = w >> 31; + zz_6 += (zz_5 >> 32) + x_5 * x_1; + zz_7 += (zz_6 >> 32) + x_5 * x_2; + zz_6 &= M; + zz_8 += (zz_7 >> 32) + x_5 * x_3; + zz_7 &= M; + zz_9 += (zz_8 >> 32) + x_5 * x_4; + zz_8 &= M; + zz_10 += zz_9 >> 32; + zz_9 &= M; + } + + ulong x_6 = x[6]; + ulong zz_11 = zz[11] + (zz_10 >> 32); zz_10 &= M; + ulong zz_12 = zz[12] + (zz_11 >> 32); zz_11 &= M; + { + zz_6 += x_6 * x_0; + w = (uint)zz_6; + zz[6] = (w << 1) | c; + c = w >> 31; + zz_7 += (zz_6 >> 32) + x_6 * x_1; + zz_8 += (zz_7 >> 32) + x_6 * x_2; + zz_7 &= M; + zz_9 += (zz_8 >> 32) + x_6 * x_3; + zz_8 &= M; + zz_10 += (zz_9 >> 32) + x_6 * x_4; + zz_9 &= M; + zz_11 += (zz_10 >> 32) + x_6 * x_5; + zz_10 &= M; + zz_12 += zz_11 >> 32; + zz_11 &= M; + } + + ulong x_7 = x[7]; + ulong zz_13 = zz[13] + (zz_12 >> 32); zz_12 &= M; + ulong zz_14 = zz[14] + (zz_13 >> 32); zz_13 &= M; + { + zz_7 += x_7 * x_0; + w = (uint)zz_7; + zz[7] = (w << 1) | c; + c = w >> 31; + zz_8 += (zz_7 >> 32) + x_7 * x_1; + zz_9 += (zz_8 >> 32) + x_7 * x_2; + zz_10 += (zz_9 >> 32) + x_7 * x_3; + zz_11 += (zz_10 >> 32) + x_7 * x_4; + zz_12 += (zz_11 >> 32) + x_7 * x_5; + zz_13 += (zz_12 >> 32) + x_7 * x_6; + zz_14 += zz_13 >> 32; + } + + w = (uint)zz_8; + zz[8] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_9; + zz[9] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_10; + zz[10] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_11; + zz[11] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_12; + zz[12] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_13; + zz[13] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_14; + zz[14] = (w << 1) | c; + c = w >> 31; + w = zz[15] + (uint)(zz_14 >> 32); + zz[15] = (w << 1) | c; + } + + public static void Square(uint[] x, int xOff, uint[] zz, int zzOff) + { + ulong x_0 = x[xOff + 0]; + ulong zz_1; + + uint c = 0, w; + { + int i = 7, j = 16; + do + { + ulong xVal = x[xOff + i--]; + ulong p = xVal * xVal; + zz[zzOff + --j] = (c << 31) | (uint)(p >> 33); + zz[zzOff + --j] = (uint)(p >> 1); + c = (uint)p; + } + while (i > 0); + + { + ulong p = x_0 * x_0; + zz_1 = (ulong)(c << 31) | (p >> 33); + zz[zzOff + 0] = (uint)p; + c = (uint)(p >> 32) & 1; + } + } + + ulong x_1 = x[xOff + 1]; + ulong zz_2 = zz[zzOff + 2]; + + { + zz_1 += x_1 * x_0; + w = (uint)zz_1; + zz[zzOff + 1] = (w << 1) | c; + c = w >> 31; + zz_2 += zz_1 >> 32; + } + + ulong x_2 = x[xOff + 2]; + ulong zz_3 = zz[zzOff + 3]; + ulong zz_4 = zz[zzOff + 4]; + { + zz_2 += x_2 * x_0; + w = (uint)zz_2; + zz[zzOff + 2] = (w << 1) | c; + c = w >> 31; + zz_3 += (zz_2 >> 32) + x_2 * x_1; + zz_4 += zz_3 >> 32; + zz_3 &= M; + } + + ulong x_3 = x[xOff + 3]; + ulong zz_5 = zz[zzOff + 5] + (zz_4 >> 32); zz_4 &= M; + ulong zz_6 = zz[zzOff + 6] + (zz_5 >> 32); zz_5 &= M; + { + zz_3 += x_3 * x_0; + w = (uint)zz_3; + zz[zzOff + 3] = (w << 1) | c; + c = w >> 31; + zz_4 += (zz_3 >> 32) + x_3 * x_1; + zz_5 += (zz_4 >> 32) + x_3 * x_2; + zz_4 &= M; + zz_6 += zz_5 >> 32; + zz_5 &= M; + } + + ulong x_4 = x[xOff + 4]; + ulong zz_7 = zz[zzOff + 7] + (zz_6 >> 32); zz_6 &= M; + ulong zz_8 = zz[zzOff + 8] + (zz_7 >> 32); zz_7 &= M; + { + zz_4 += x_4 * x_0; + w = (uint)zz_4; + zz[zzOff + 4] = (w << 1) | c; + c = w >> 31; + zz_5 += (zz_4 >> 32) + x_4 * x_1; + zz_6 += (zz_5 >> 32) + x_4 * x_2; + zz_5 &= M; + zz_7 += (zz_6 >> 32) + x_4 * x_3; + zz_6 &= M; + zz_8 += zz_7 >> 32; + zz_7 &= M; + } + + ulong x_5 = x[xOff + 5]; + ulong zz_9 = zz[zzOff + 9] + (zz_8 >> 32); zz_8 &= M; + ulong zz_10 = zz[zzOff + 10] + (zz_9 >> 32); zz_9 &= M; + { + zz_5 += x_5 * x_0; + w = (uint)zz_5; + zz[zzOff + 5] = (w << 1) | c; + c = w >> 31; + zz_6 += (zz_5 >> 32) + x_5 * x_1; + zz_7 += (zz_6 >> 32) + x_5 * x_2; + zz_6 &= M; + zz_8 += (zz_7 >> 32) + x_5 * x_3; + zz_7 &= M; + zz_9 += (zz_8 >> 32) + x_5 * x_4; + zz_8 &= M; + zz_10 += zz_9 >> 32; + zz_9 &= M; + } + + ulong x_6 = x[xOff + 6]; + ulong zz_11 = zz[zzOff + 11] + (zz_10 >> 32); zz_10 &= M; + ulong zz_12 = zz[zzOff + 12] + (zz_11 >> 32); zz_11 &= M; + { + zz_6 += x_6 * x_0; + w = (uint)zz_6; + zz[zzOff + 6] = (w << 1) | c; + c = w >> 31; + zz_7 += (zz_6 >> 32) + x_6 * x_1; + zz_8 += (zz_7 >> 32) + x_6 * x_2; + zz_7 &= M; + zz_9 += (zz_8 >> 32) + x_6 * x_3; + zz_8 &= M; + zz_10 += (zz_9 >> 32) + x_6 * x_4; + zz_9 &= M; + zz_11 += (zz_10 >> 32) + x_6 * x_5; + zz_10 &= M; + zz_12 += zz_11 >> 32; + zz_11 &= M; + } + + ulong x_7 = x[xOff + 7]; + ulong zz_13 = zz[zzOff + 13] + (zz_12 >> 32); zz_12 &= M; + ulong zz_14 = zz[zzOff + 14] + (zz_13 >> 32); zz_13 &= M; + { + zz_7 += x_7 * x_0; + w = (uint)zz_7; + zz[zzOff + 7] = (w << 1) | c; + c = w >> 31; + zz_8 += (zz_7 >> 32) + x_7 * x_1; + zz_9 += (zz_8 >> 32) + x_7 * x_2; + zz_10 += (zz_9 >> 32) + x_7 * x_3; + zz_11 += (zz_10 >> 32) + x_7 * x_4; + zz_12 += (zz_11 >> 32) + x_7 * x_5; + zz_13 += (zz_12 >> 32) + x_7 * x_6; + zz_14 += zz_13 >> 32; + } + + w = (uint)zz_8; + zz[zzOff + 8] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_9; + zz[zzOff + 9] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_10; + zz[zzOff + 10] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_11; + zz[zzOff + 11] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_12; + zz[zzOff + 12] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_13; + zz[zzOff + 13] = (w << 1) | c; + c = w >> 31; + w = (uint)zz_14; + zz[zzOff + 14] = (w << 1) | c; + c = w >> 31; + w = zz[zzOff + 15] + (uint)(zz_14 >> 32); + zz[zzOff + 15] = (w << 1) | c; + } + + public static int Sub(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)x[4] - y[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)x[5] - y[5]; + z[5] = (uint)c; + c >>= 32; + c += (long)x[6] - y[6]; + z[6] = (uint)c; + c >>= 32; + c += (long)x[7] - y[7]; + z[7] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int Sub(uint[] x, int xOff, uint[] y, int yOff, uint[] z, int zOff) + { + long c = 0; + c += (long)x[xOff + 0] - y[yOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)x[xOff + 1] - y[yOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)x[xOff + 2] - y[yOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)x[xOff + 3] - y[yOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (long)x[xOff + 4] - y[yOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (long)x[xOff + 5] - y[yOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (long)x[xOff + 6] - y[yOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + c += (long)x[xOff + 7] - y[yOff + 7]; + z[zOff + 7] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubBothFrom(uint[] x, uint[] y, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0] - y[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1] - y[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2] - y[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3] - y[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] - x[4] - y[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5] - x[5] - y[5]; + z[5] = (uint)c; + c >>= 32; + c += (long)z[6] - x[6] - y[6]; + z[6] = (uint)c; + c >>= 32; + c += (long)z[7] - x[7] - y[7]; + z[7] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, uint[] z) + { + long c = 0; + c += (long)z[0] - x[0]; + z[0] = (uint)c; + c >>= 32; + c += (long)z[1] - x[1]; + z[1] = (uint)c; + c >>= 32; + c += (long)z[2] - x[2]; + z[2] = (uint)c; + c >>= 32; + c += (long)z[3] - x[3]; + z[3] = (uint)c; + c >>= 32; + c += (long)z[4] - x[4]; + z[4] = (uint)c; + c >>= 32; + c += (long)z[5] - x[5]; + z[5] = (uint)c; + c >>= 32; + c += (long)z[6] - x[6]; + z[6] = (uint)c; + c >>= 32; + c += (long)z[7] - x[7]; + z[7] = (uint)c; + c >>= 32; + return (int)c; + } + + public static int SubFrom(uint[] x, int xOff, uint[] z, int zOff) + { + long c = 0; + c += (long)z[zOff + 0] - x[xOff + 0]; + z[zOff + 0] = (uint)c; + c >>= 32; + c += (long)z[zOff + 1] - x[xOff + 1]; + z[zOff + 1] = (uint)c; + c >>= 32; + c += (long)z[zOff + 2] - x[xOff + 2]; + z[zOff + 2] = (uint)c; + c >>= 32; + c += (long)z[zOff + 3] - x[xOff + 3]; + z[zOff + 3] = (uint)c; + c >>= 32; + c += (long)z[zOff + 4] - x[xOff + 4]; + z[zOff + 4] = (uint)c; + c >>= 32; + c += (long)z[zOff + 5] - x[xOff + 5]; + z[zOff + 5] = (uint)c; + c >>= 32; + c += (long)z[zOff + 6] - x[xOff + 6]; + z[zOff + 6] = (uint)c; + c >>= 32; + c += (long)z[zOff + 7] - x[xOff + 7]; + z[zOff + 7] = (uint)c; + c >>= 32; + return (int)c; + } + + public static BigInteger ToBigInteger(uint[] x) + { + byte[] bs = new byte[32]; + for (int i = 0; i < 8; ++i) + { + uint x_i = x[i]; + if (x_i != 0) + { + Pack.UInt32_To_BE(x_i, bs, (7 - i) << 2); + } + } + return new BigInteger(1, bs); + } + + public static BigInteger ToBigInteger64(ulong[] x) + { + byte[] bs = new byte[32]; + for (int i = 0; i < 4; ++i) + { + ulong x_i = x[i]; + if (x_i != 0L) + { + Pack.UInt64_To_BE(x_i, bs, (3 - i) << 3); + } + } + return new BigInteger(1, bs); + } + + public static void Zero(uint[] z) + { + z[0] = 0; + z[1] = 0; + z[2] = 0; + z[3] = 0; + z[4] = 0; + z[5] = 0; + z[6] = 0; + z[7] = 0; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat256.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat256.cs.meta new file mode 100644 index 00000000..fc839cf7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat256.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d5edac25abdc924b9ca63eb7dd99f1a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat320.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat320.cs new file mode 100644 index 00000000..b05a4afb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat320.cs @@ -0,0 +1,111 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat320 + { + public static void Copy64(ulong[] x, ulong[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + } + + public static void Copy64(ulong[] x, int xOff, ulong[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + z[zOff + 4] = x[xOff + 4]; + } + + public static ulong[] Create64() + { + return new ulong[5]; + } + + public static ulong[] CreateExt64() + { + return new ulong[10]; + } + + public static bool Eq64(ulong[] x, ulong[] y) + { + for (int i = 4; i >= 0; --i) + { + if (x[i] != y[i]) + { + return false; + } + } + return true; + } + + public static ulong[] FromBigInteger64(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 320) + throw new ArgumentException(); + + ulong[] z = Create64(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (ulong)x.LongValue; + x = x.ShiftRight(64); + } + return z; + } + + public static bool IsOne64(ulong[] x) + { + if (x[0] != 1UL) + { + return false; + } + for (int i = 1; i < 5; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static bool IsZero64(ulong[] x) + { + for (int i = 0; i < 5; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static BigInteger ToBigInteger64(ulong[] x) + { + byte[] bs = new byte[40]; + for (int i = 0; i < 5; ++i) + { + ulong x_i = x[i]; + if (x_i != 0L) + { + Pack.UInt64_To_BE(x_i, bs, (4 - i) << 3); + } + } + return new BigInteger(1, bs); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat320.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat320.cs.meta new file mode 100644 index 00000000..28e147c4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat320.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c94e76ab2033ce647ac530c37169bad0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat384.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat384.cs new file mode 100644 index 00000000..319059c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat384.cs @@ -0,0 +1,50 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat384 + { + public static void Mul(uint[] x, uint[] y, uint[] zz) + { + Nat192.Mul(x, y, zz); + Nat192.Mul(x, 6, y, 6, zz, 12); + + uint c18 = Nat192.AddToEachOther(zz, 6, zz, 12); + uint c12 = c18 + Nat192.AddTo(zz, 0, zz, 6, 0); + c18 += Nat192.AddTo(zz, 18, zz, 12, c12); + + uint[] dx = Nat192.Create(), dy = Nat192.Create(); + bool neg = Nat192.Diff(x, 6, x, 0, dx, 0) != Nat192.Diff(y, 6, y, 0, dy, 0); + + uint[] tt = Nat192.CreateExt(); + Nat192.Mul(dx, dy, tt); + + c18 += neg ? Nat.AddTo(12, tt, 0, zz, 6) : (uint)Nat.SubFrom(12, tt, 0, zz, 6); + Nat.AddWordAt(24, c18, zz, 18); + } + + public static void Square(uint[] x, uint[] zz) + { + Nat192.Square(x, zz); + Nat192.Square(x, 6, zz, 12); + + uint c18 = Nat192.AddToEachOther(zz, 6, zz, 12); + uint c12 = c18 + Nat192.AddTo(zz, 0, zz, 6, 0); + c18 += Nat192.AddTo(zz, 18, zz, 12, c12); + + uint[] dx = Nat192.Create(); + Nat192.Diff(x, 6, x, 0, dx, 0); + + uint[] m = Nat192.CreateExt(); + Nat192.Square(dx, m); + + c18 += (uint)Nat.SubFrom(12, m, 0, zz, 6); + Nat.AddWordAt(24, c18, zz, 18); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat384.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat384.cs.meta new file mode 100644 index 00000000..06638735 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat384.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b8f208f66da7aca4cb1f81fb6372a923 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat448.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat448.cs new file mode 100644 index 00000000..a6801284 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat448.cs @@ -0,0 +1,115 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat448 + { + public static void Copy64(ulong[] x, ulong[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + z[5] = x[5]; + z[6] = x[6]; + } + + public static void Copy64(ulong[] x, int xOff, ulong[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + z[zOff + 4] = x[xOff + 4]; + z[zOff + 5] = x[xOff + 5]; + z[zOff + 6] = x[xOff + 6]; + } + + public static ulong[] Create64() + { + return new ulong[7]; + } + + public static ulong[] CreateExt64() + { + return new ulong[14]; + } + + public static bool Eq64(ulong[] x, ulong[] y) + { + for (int i = 6; i >= 0; --i) + { + if (x[i] != y[i]) + { + return false; + } + } + return true; + } + + public static ulong[] FromBigInteger64(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 448) + throw new ArgumentException(); + + ulong[] z = Create64(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (ulong)x.LongValue; + x = x.ShiftRight(64); + } + return z; + } + + public static bool IsOne64(ulong[] x) + { + if (x[0] != 1UL) + { + return false; + } + for (int i = 1; i < 7; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static bool IsZero64(ulong[] x) + { + for (int i = 0; i < 7; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static BigInteger ToBigInteger64(ulong[] x) + { + byte[] bs = new byte[56]; + for (int i = 0; i < 7; ++i) + { + ulong x_i = x[i]; + if (x_i != 0L) + { + Pack.UInt64_To_BE(x_i, bs, (6 - i) << 3); + } + } + return new BigInteger(1, bs); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat448.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat448.cs.meta new file mode 100644 index 00000000..7df65736 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat448.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 231f62a2e5d95c64fb1438455bacbe41 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat512.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat512.cs new file mode 100644 index 00000000..a6410205 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat512.cs @@ -0,0 +1,50 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat512 + { + public static void Mul(uint[] x, uint[] y, uint[] zz) + { + Nat256.Mul(x, y, zz); + Nat256.Mul(x, 8, y, 8, zz, 16); + + uint c24 = Nat256.AddToEachOther(zz, 8, zz, 16); + uint c16 = c24 + Nat256.AddTo(zz, 0, zz, 8, 0); + c24 += Nat256.AddTo(zz, 24, zz, 16, c16); + + uint[] dx = Nat256.Create(), dy = Nat256.Create(); + bool neg = Nat256.Diff(x, 8, x, 0, dx, 0) != Nat256.Diff(y, 8, y, 0, dy, 0); + + uint[] tt = Nat256.CreateExt(); + Nat256.Mul(dx, dy, tt); + + c24 += neg ? Nat.AddTo(16, tt, 0, zz, 8) : (uint)Nat.SubFrom(16, tt, 0, zz, 8); + Nat.AddWordAt(32, c24, zz, 24); + } + + public static void Square(uint[] x, uint[] zz) + { + Nat256.Square(x, zz); + Nat256.Square(x, 8, zz, 16); + + uint c24 = Nat256.AddToEachOther(zz, 8, zz, 16); + uint c16 = c24 + Nat256.AddTo(zz, 0, zz, 8, 0); + c24 += Nat256.AddTo(zz, 24, zz, 16, c16); + + uint[] dx = Nat256.Create(); + Nat256.Diff(x, 8, x, 0, dx, 0); + + uint[] m = Nat256.CreateExt(); + Nat256.Square(dx, m); + + c24 += (uint)Nat.SubFrom(16, m, 0, zz, 8); + Nat.AddWordAt(32, c24, zz, 24); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat512.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat512.cs.meta new file mode 100644 index 00000000..3fafba95 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat512.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd7393016f16a6e429e8e32080996fb4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat576.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat576.cs new file mode 100644 index 00000000..79aaa01c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat576.cs @@ -0,0 +1,119 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.Raw +{ + internal abstract class Nat576 + { + public static void Copy64(ulong[] x, ulong[] z) + { + z[0] = x[0]; + z[1] = x[1]; + z[2] = x[2]; + z[3] = x[3]; + z[4] = x[4]; + z[5] = x[5]; + z[6] = x[6]; + z[7] = x[7]; + z[8] = x[8]; + } + + public static void Copy64(ulong[] x, int xOff, ulong[] z, int zOff) + { + z[zOff + 0] = x[xOff + 0]; + z[zOff + 1] = x[xOff + 1]; + z[zOff + 2] = x[xOff + 2]; + z[zOff + 3] = x[xOff + 3]; + z[zOff + 4] = x[xOff + 4]; + z[zOff + 5] = x[xOff + 5]; + z[zOff + 6] = x[xOff + 6]; + z[zOff + 7] = x[xOff + 7]; + z[zOff + 8] = x[xOff + 8]; + } + + public static ulong[] Create64() + { + return new ulong[9]; + } + + public static ulong[] CreateExt64() + { + return new ulong[18]; + } + + public static bool Eq64(ulong[] x, ulong[] y) + { + for (int i = 8; i >= 0; --i) + { + if (x[i] != y[i]) + { + return false; + } + } + return true; + } + + public static ulong[] FromBigInteger64(BigInteger x) + { + if (x.SignValue < 0 || x.BitLength > 576) + throw new ArgumentException(); + + ulong[] z = Create64(); + int i = 0; + while (x.SignValue != 0) + { + z[i++] = (ulong)x.LongValue; + x = x.ShiftRight(64); + } + return z; + } + + public static bool IsOne64(ulong[] x) + { + if (x[0] != 1UL) + { + return false; + } + for (int i = 1; i < 9; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static bool IsZero64(ulong[] x) + { + for (int i = 0; i < 9; ++i) + { + if (x[i] != 0UL) + { + return false; + } + } + return true; + } + + public static BigInteger ToBigInteger64(ulong[] x) + { + byte[] bs = new byte[72]; + for (int i = 0; i < 9; ++i) + { + ulong x_i = x[i]; + if (x_i != 0L) + { + Pack.UInt64_To_BE(x_i, bs, (8 - i) << 3); + } + } + return new BigInteger(1, bs); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat576.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat576.cs.meta new file mode 100644 index 00000000..b9cbe873 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/math/raw/Nat576.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac3cde8a54f23264c80a50850766fe5a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp.meta new file mode 100644 index 00000000..29ed67ed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 516c3f05851fb4f418aae5d21a088d67 +folderAsset: yes +timeCreated: 1547039641 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPResp.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPResp.cs new file mode 100644 index 00000000..c899acd3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPResp.cs @@ -0,0 +1,224 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + /// + /// + /// BasicOcspResponse ::= SEQUENCE { + /// tbsResponseData ResponseData, + /// signatureAlgorithm AlgorithmIdentifier, + /// signature BIT STRING, + /// certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL + /// } + /// + /// + public class BasicOcspResp + : X509ExtensionBase + { + private readonly BasicOcspResponse resp; + private readonly ResponseData data; +// private readonly X509Certificate[] chain; + + public BasicOcspResp( + BasicOcspResponse resp) + { + this.resp = resp; + this.data = resp.TbsResponseData; + } + + /// The DER encoding of the tbsResponseData field. + /// In the event of an encoding error. + public byte[] GetTbsResponseData() + { + try + { + return data.GetDerEncoded(); + } + catch (IOException e) + { + throw new OcspException("problem encoding tbsResponseData", e); + } + } + + public int Version + { + get { return data.Version.Value.IntValue + 1; } + } + + public RespID ResponderId + { + get { return new RespID(data.ResponderID); } + } + + public DateTime ProducedAt + { + get { return data.ProducedAt.ToDateTime(); } + } + + public SingleResp[] Responses + { + get + { + Asn1Sequence s = data.Responses; + SingleResp[] rs = new SingleResp[s.Count]; + + for (int i = 0; i != rs.Length; i++) + { + rs[i] = new SingleResp(SingleResponse.GetInstance(s[i])); + } + + return rs; + } + } + + public X509Extensions ResponseExtensions + { + get { return data.ResponseExtensions; } + } + + protected override X509Extensions GetX509Extensions() + { + return ResponseExtensions; + } + + public string SignatureAlgName + { + get { return OcspUtilities.GetAlgorithmName(resp.SignatureAlgorithm.Algorithm); } + } + + public string SignatureAlgOid + { + get { return resp.SignatureAlgorithm.Algorithm.Id; } + } + + [Obsolete("RespData class is no longer required as all functionality is available on this class")] + public RespData GetResponseData() + { + return new RespData(data); + } + + public byte[] GetSignature() + { + return resp.GetSignatureOctets(); + } + + private IList GetCertList() + { + // load the certificates and revocation lists if we have any + + IList certs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + Asn1Sequence s = resp.Certs; + + if (s != null) + { + foreach (Asn1Encodable ae in s) + { + try + { + certs.Add(new X509CertificateParser().ReadCertificate(ae.GetEncoded())); + } + catch (IOException ex) + { + throw new OcspException("can't re-encode certificate!", ex); + } + catch (CertificateException ex) + { + throw new OcspException("can't re-encode certificate!", ex); + } + } + } + + return certs; + } + + public X509Certificate[] GetCerts() + { + IList certs = GetCertList(); + X509Certificate[] result = new X509Certificate[certs.Count]; + for (int i = 0; i < certs.Count; ++i) + { + result[i] = (X509Certificate)certs[i]; + } + return result; + } + + /// The certificates, if any, associated with the response. + /// In the event of an encoding error. + public IX509Store GetCertificates( + string type) + { + try + { + return X509StoreFactory.Create( + "Certificate/" + type, + new X509CollectionStoreParameters(this.GetCertList())); + } + catch (Exception e) + { + throw new OcspException("can't setup the CertStore", e); + } + } + + /// + /// Verify the signature against the tbsResponseData object we contain. + /// + public bool Verify( + AsymmetricKeyParameter publicKey) + { + try + { + ISigner signature = SignerUtilities.GetSigner(this.SignatureAlgName); + signature.Init(false, publicKey); + byte[] bs = data.GetDerEncoded(); + signature.BlockUpdate(bs, 0, bs.Length); + + return signature.VerifySignature(this.GetSignature()); + } + catch (Exception e) + { + throw new OcspException("exception processing sig: " + e, e); + } + } + + /// The ASN.1 encoded representation of this object. + public byte[] GetEncoded() + { + return resp.GetEncoded(); + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + BasicOcspResp other = obj as BasicOcspResp; + + if (other == null) + return false; + + return resp.Equals(other.resp); + } + + public override int GetHashCode() + { + return resp.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPResp.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPResp.cs.meta new file mode 100644 index 00000000..adbbf58a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPResp.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2617f7006c85dd44d864e1c11fe6ca73 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPRespGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPRespGenerator.cs new file mode 100644 index 00000000..c3e15108 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPRespGenerator.cs @@ -0,0 +1,317 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + /** + * Generator for basic OCSP response objects. + */ + public class BasicOcspRespGenerator + { + private readonly IList list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + private X509Extensions responseExtensions; + private RespID responderID; + + private class ResponseObject + { + internal CertificateID certId; + internal CertStatus certStatus; + internal DerGeneralizedTime thisUpdate; + internal DerGeneralizedTime nextUpdate; + internal X509Extensions extensions; + + public ResponseObject( + CertificateID certId, + CertificateStatus certStatus, + DateTime thisUpdate, + X509Extensions extensions) + : this(certId, certStatus, new DerGeneralizedTime(thisUpdate), null, extensions) + { + } + + public ResponseObject( + CertificateID certId, + CertificateStatus certStatus, + DateTime thisUpdate, + DateTime nextUpdate, + X509Extensions extensions) + : this(certId, certStatus, new DerGeneralizedTime(thisUpdate), new DerGeneralizedTime(nextUpdate), extensions) + { + } + + private ResponseObject( + CertificateID certId, + CertificateStatus certStatus, + DerGeneralizedTime thisUpdate, + DerGeneralizedTime nextUpdate, + X509Extensions extensions) + { + this.certId = certId; + + if (certStatus == null) + { + this.certStatus = new CertStatus(); + } + else if (certStatus is UnknownStatus) + { + this.certStatus = new CertStatus(2, DerNull.Instance); + } + else + { + RevokedStatus rs = (RevokedStatus) certStatus; + CrlReason revocationReason = rs.HasRevocationReason + ? new CrlReason(rs.RevocationReason) + : null; + + this.certStatus = new CertStatus( + new RevokedInfo(new DerGeneralizedTime(rs.RevocationTime), revocationReason)); + } + + this.thisUpdate = thisUpdate; + this.nextUpdate = nextUpdate; + + this.extensions = extensions; + } + + public SingleResponse ToResponse() + { + return new SingleResponse(certId.ToAsn1Object(), certStatus, thisUpdate, nextUpdate, extensions); + } + } + + /** + * basic constructor + */ + public BasicOcspRespGenerator( + RespID responderID) + { + this.responderID = responderID; + } + + /** + * construct with the responderID to be the SHA-1 keyHash of the passed in public key. + */ + public BasicOcspRespGenerator( + AsymmetricKeyParameter publicKey) + { + this.responderID = new RespID(publicKey); + } + + /** + * Add a response for a particular Certificate ID. + * + * @param certID certificate ID details + * @param certStatus status of the certificate - null if okay + */ + public void AddResponse( + CertificateID certID, + CertificateStatus certStatus) + { + list.Add(new ResponseObject(certID, certStatus, DateTime.UtcNow, null)); + } + + /** + * Add a response for a particular Certificate ID. + * + * @param certID certificate ID details + * @param certStatus status of the certificate - null if okay + * @param singleExtensions optional extensions + */ + public void AddResponse( + CertificateID certID, + CertificateStatus certStatus, + X509Extensions singleExtensions) + { + list.Add(new ResponseObject(certID, certStatus, DateTime.UtcNow, singleExtensions)); + } + + /** + * Add a response for a particular Certificate ID. + * + * @param certID certificate ID details + * @param nextUpdate date when next update should be requested + * @param certStatus status of the certificate - null if okay + * @param singleExtensions optional extensions + */ + public void AddResponse( + CertificateID certID, + CertificateStatus certStatus, + DateTime nextUpdate, + X509Extensions singleExtensions) + { + list.Add(new ResponseObject(certID, certStatus, DateTime.UtcNow, nextUpdate, singleExtensions)); + } + + /** + * Add a response for a particular Certificate ID. + * + * @param certID certificate ID details + * @param thisUpdate date this response was valid on + * @param nextUpdate date when next update should be requested + * @param certStatus status of the certificate - null if okay + * @param singleExtensions optional extensions + */ + public void AddResponse( + CertificateID certID, + CertificateStatus certStatus, + DateTime thisUpdate, + DateTime nextUpdate, + X509Extensions singleExtensions) + { + list.Add(new ResponseObject(certID, certStatus, thisUpdate, nextUpdate, singleExtensions)); + } + + /** + * Set the extensions for the response. + * + * @param responseExtensions the extension object to carry. + */ + public void SetResponseExtensions( + X509Extensions responseExtensions) + { + this.responseExtensions = responseExtensions; + } + + private BasicOcspResp GenerateResponse( + ISignatureFactory signatureCalculator, + X509Certificate[] chain, + DateTime producedAt) + { + AlgorithmIdentifier signingAlgID = (AlgorithmIdentifier)signatureCalculator.AlgorithmDetails; + DerObjectIdentifier signingAlgorithm = signingAlgID.Algorithm; + + Asn1EncodableVector responses = new Asn1EncodableVector(); + + foreach (ResponseObject respObj in list) + { + try + { + responses.Add(respObj.ToResponse()); + } + catch (Exception e) + { + throw new OcspException("exception creating Request", e); + } + } + + ResponseData tbsResp = new ResponseData(responderID.ToAsn1Object(), new DerGeneralizedTime(producedAt), new DerSequence(responses), responseExtensions); + DerBitString bitSig = null; + + try + { + IStreamCalculator streamCalculator = signatureCalculator.CreateCalculator(); + + byte[] encoded = tbsResp.GetDerEncoded(); + + streamCalculator.Stream.Write(encoded, 0, encoded.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + + bitSig = new DerBitString(((IBlockResult)streamCalculator.GetResult()).Collect()); + } + catch (Exception e) + { + throw new OcspException("exception processing TBSRequest: " + e, e); + } + + AlgorithmIdentifier sigAlgId = OcspUtilities.GetSigAlgID(signingAlgorithm); + + DerSequence chainSeq = null; + if (chain != null && chain.Length > 0) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + try + { + for (int i = 0; i != chain.Length; i++) + { + v.Add( + X509CertificateStructure.GetInstance( + Asn1Object.FromByteArray(chain[i].GetEncoded()))); + } + } + catch (IOException e) + { + throw new OcspException("error processing certs", e); + } + catch (CertificateEncodingException e) + { + throw new OcspException("error encoding certs", e); + } + + chainSeq = new DerSequence(v); + } + + return new BasicOcspResp(new BasicOcspResponse(tbsResp, sigAlgId, bitSig, chainSeq)); + } + + public BasicOcspResp Generate( + string signingAlgorithm, + AsymmetricKeyParameter privateKey, + X509Certificate[] chain, + DateTime thisUpdate) + { + return Generate(signingAlgorithm, privateKey, chain, thisUpdate, null); + } + + public BasicOcspResp Generate( + string signingAlgorithm, + AsymmetricKeyParameter privateKey, + X509Certificate[] chain, + DateTime producedAt, + SecureRandom random) + { + if (signingAlgorithm == null) + { + throw new ArgumentException("no signing algorithm specified"); + } + + return GenerateResponse(new Asn1SignatureFactory(signingAlgorithm, privateKey, random), chain, producedAt); + } + + /// + /// Generate the signed response using the passed in signature calculator. + /// + /// Implementation of signing calculator factory. + /// The certificate chain associated with the response signer. + /// "produced at" date. + /// + public BasicOcspResp Generate( + ISignatureFactory signatureCalculatorFactory, + X509Certificate[] chain, + DateTime producedAt) + { + if (signatureCalculatorFactory == null) + { + throw new ArgumentException("no signature calculator specified"); + } + + return GenerateResponse(signatureCalculatorFactory, chain, producedAt); + } + + /** + * Return an IEnumerable of the signature names supported by the generator. + * + * @return an IEnumerable containing recognised names. + */ + public IEnumerable SignatureAlgNames + { + get { return OcspUtilities.AlgNames; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPRespGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPRespGenerator.cs.meta new file mode 100644 index 00000000..e09f77cd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/BasicOCSPRespGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4a4f1ab3630e2c4d84a48f911528701 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateID.cs new file mode 100644 index 00000000..9fbbc978 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateID.cs @@ -0,0 +1,145 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + public class CertificateID + { + public const string HashSha1 = "1.3.14.3.2.26"; + + private readonly CertID id; + + public CertificateID( + CertID id) + { + if (id == null) + throw new ArgumentNullException("id"); + + this.id = id; + } + + /** + * create from an issuer certificate and the serial number of the + * certificate it signed. + * @exception OcspException if any problems occur creating the id fields. + */ + public CertificateID( + string hashAlgorithm, + X509Certificate issuerCert, + BigInteger serialNumber) + { + AlgorithmIdentifier hashAlg = new AlgorithmIdentifier( + new DerObjectIdentifier(hashAlgorithm), DerNull.Instance); + + this.id = CreateCertID(hashAlg, issuerCert, new DerInteger(serialNumber)); + } + + public string HashAlgOid + { + get { return id.HashAlgorithm.Algorithm.Id; } + } + + public byte[] GetIssuerNameHash() + { + return id.IssuerNameHash.GetOctets(); + } + + public byte[] GetIssuerKeyHash() + { + return id.IssuerKeyHash.GetOctets(); + } + + /** + * return the serial number for the certificate associated + * with this request. + */ + public BigInteger SerialNumber + { + get { return id.SerialNumber.Value; } + } + + public bool MatchesIssuer( + X509Certificate issuerCert) + { + return CreateCertID(id.HashAlgorithm, issuerCert, id.SerialNumber).Equals(id); + } + + public CertID ToAsn1Object() + { + return id; + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + CertificateID other = obj as CertificateID; + + if (other == null) + return false; + + return id.ToAsn1Object().Equals(other.id.ToAsn1Object()); + } + + public override int GetHashCode() + { + return id.ToAsn1Object().GetHashCode(); + } + + + /** + * Create a new CertificateID for a new serial number derived from a previous one + * calculated for the same CA certificate. + * + * @param original the previously calculated CertificateID for the CA. + * @param newSerialNumber the serial number for the new certificate of interest. + * + * @return a new CertificateID for newSerialNumber + */ + public static CertificateID DeriveCertificateID(CertificateID original, BigInteger newSerialNumber) + { + return new CertificateID(new CertID(original.id.HashAlgorithm, original.id.IssuerNameHash, + original.id.IssuerKeyHash, new DerInteger(newSerialNumber))); + } + + private static CertID CreateCertID( + AlgorithmIdentifier hashAlg, + X509Certificate issuerCert, + DerInteger serialNumber) + { + try + { + String hashAlgorithm = hashAlg.Algorithm.Id; + + X509Name issuerName = PrincipalUtilities.GetSubjectX509Principal(issuerCert); + byte[] issuerNameHash = DigestUtilities.CalculateDigest( + hashAlgorithm, issuerName.GetEncoded()); + + AsymmetricKeyParameter issuerKey = issuerCert.GetPublicKey(); + SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(issuerKey); + byte[] issuerKeyHash = DigestUtilities.CalculateDigest( + hashAlgorithm, info.PublicKeyData.GetBytes()); + + return new CertID(hashAlg, new DerOctetString(issuerNameHash), + new DerOctetString(issuerKeyHash), serialNumber); + } + catch (Exception e) + { + throw new OcspException("problem creating ID: " + e, e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateID.cs.meta new file mode 100644 index 00000000..8511a6b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a898aa4304e51464a8070aa0e95b80fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateStatus.cs new file mode 100644 index 00000000..0cc6753e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateStatus.cs @@ -0,0 +1,13 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + public abstract class CertificateStatus + { + public static readonly CertificateStatus Good = null; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateStatus.cs.meta new file mode 100644 index 00000000..eb63f6f0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/CertificateStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32c0717bda040f94a96b47918ac8e69b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPException.cs new file mode 100644 index 00000000..81405afa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPException.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class OcspException + : Exception + { + public OcspException() + { + } + + public OcspException( + string message) + : base(message) + { + } + + public OcspException( + string message, + Exception e) + : base(message, e) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPException.cs.meta new file mode 100644 index 00000000..d97f16f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7666ba2ef3fc4e44b94423593baebf5e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReq.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReq.cs new file mode 100644 index 00000000..afb6961c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReq.cs @@ -0,0 +1,272 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + /** + *
    +	 * OcspRequest     ::=     SEQUENCE {
    +	 *       tbsRequest                  TBSRequest,
    +	 *       optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
    +	 *
    +	 *   TBSRequest      ::=     SEQUENCE {
    +	 *       version             [0]     EXPLICIT Version DEFAULT v1,
    +	 *       requestorName       [1]     EXPLICIT GeneralName OPTIONAL,
    +	 *       requestList                 SEQUENCE OF Request,
    +	 *       requestExtensions   [2]     EXPLICIT Extensions OPTIONAL }
    +	 *
    +	 *   Signature       ::=     SEQUENCE {
    +	 *       signatureAlgorithm      AlgorithmIdentifier,
    +	 *       signature               BIT STRING,
    +	 *       certs               [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL}
    +	 *
    +	 *   Version         ::=             INTEGER  {  v1(0) }
    +	 *
    +	 *   Request         ::=     SEQUENCE {
    +	 *       reqCert                     CertID,
    +	 *       singleRequestExtensions     [0] EXPLICIT Extensions OPTIONAL }
    +	 *
    +	 *   CertID          ::=     SEQUENCE {
    +	 *       hashAlgorithm       AlgorithmIdentifier,
    +	 *       issuerNameHash      OCTET STRING, -- Hash of Issuer's DN
    +	 *       issuerKeyHash       OCTET STRING, -- Hash of Issuers public key
    +	 *       serialNumber        CertificateSerialNumber }
    +	 * 
    + */ + public class OcspReq + : X509ExtensionBase + { + private OcspRequest req; + + public OcspReq( + OcspRequest req) + { + this.req = req; + } + + public OcspReq( + byte[] req) + : this(new Asn1InputStream(req)) + { + } + + public OcspReq( + Stream inStr) + : this(new Asn1InputStream(inStr)) + { + } + + private OcspReq( + Asn1InputStream aIn) + { + try + { + this.req = OcspRequest.GetInstance(aIn.ReadObject()); + } + catch (ArgumentException e) + { + throw new IOException("malformed request: " + e.Message); + } + catch (InvalidCastException e) + { + throw new IOException("malformed request: " + e.Message); + } + } + + /** + * Return the DER encoding of the tbsRequest field. + * @return DER encoding of tbsRequest + * @throws OcspException in the event of an encoding error. + */ + public byte[] GetTbsRequest() + { + try + { + return req.TbsRequest.GetEncoded(); + } + catch (IOException e) + { + throw new OcspException("problem encoding tbsRequest", e); + } + } + + public int Version + { + get { return req.TbsRequest.Version.Value.IntValue + 1; } + } + + public GeneralName RequestorName + { + get { return GeneralName.GetInstance(req.TbsRequest.RequestorName); } + } + + public Req[] GetRequestList() + { + Asn1Sequence seq = req.TbsRequest.RequestList; + Req[] requests = new Req[seq.Count]; + + for (int i = 0; i != requests.Length; i++) + { + requests[i] = new Req(Request.GetInstance(seq[i])); + } + + return requests; + } + + public X509Extensions RequestExtensions + { + get { return X509Extensions.GetInstance(req.TbsRequest.RequestExtensions); } + } + + protected override X509Extensions GetX509Extensions() + { + return RequestExtensions; + } + + /** + * return the object identifier representing the signature algorithm + */ + public string SignatureAlgOid + { + get + { + if (!this.IsSigned) + return null; + + return req.OptionalSignature.SignatureAlgorithm.Algorithm.Id; + } + } + + public byte[] GetSignature() + { + if (!this.IsSigned) + return null; + + return req.OptionalSignature.GetSignatureOctets(); + } + + private IList GetCertList() + { + // load the certificates if we have any + + IList certs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + Asn1Sequence s = req.OptionalSignature.Certs; + + if (s != null) + { + foreach (Asn1Encodable ae in s) + { + try + { + certs.Add(new X509CertificateParser().ReadCertificate(ae.GetEncoded())); + } + catch (Exception e) + { + throw new OcspException("can't re-encode certificate!", e); + } + } + } + + return certs; + } + + public X509Certificate[] GetCerts() + { + if (!this.IsSigned) + return null; + + IList certs = this.GetCertList(); + X509Certificate[] result = new X509Certificate[certs.Count]; + for (int i = 0; i < certs.Count; ++i) + { + result[i] = (X509Certificate)certs[i]; + } + return result; + } + + /** + * If the request is signed return a possibly empty CertStore containing the certificates in the + * request. If the request is not signed the method returns null. + * + * @return null if not signed, a CertStore otherwise + * @throws OcspException + */ + public IX509Store GetCertificates( + string type) + { + if (!this.IsSigned) + return null; + + try + { + return X509StoreFactory.Create( + "Certificate/" + type, + new X509CollectionStoreParameters(this.GetCertList())); + } + catch (Exception e) + { + throw new OcspException("can't setup the CertStore", e); + } + } + + /** + * Return whether or not this request is signed. + * + * @return true if signed false otherwise. + */ + public bool IsSigned + { + get { return req.OptionalSignature != null; } + } + + /** + * Verify the signature against the TBSRequest object we contain. + */ + public bool Verify( + AsymmetricKeyParameter publicKey) + { + if (!this.IsSigned) + throw new OcspException("attempt to Verify signature on unsigned object"); + + try + { + ISigner signature = SignerUtilities.GetSigner(this.SignatureAlgOid); + + signature.Init(false, publicKey); + + byte[] encoded = req.TbsRequest.GetEncoded(); + + signature.BlockUpdate(encoded, 0, encoded.Length); + + return signature.VerifySignature(this.GetSignature()); + } + catch (Exception e) + { + throw new OcspException("exception processing sig: " + e, e); + } + } + + /** + * return the ASN.1 encoded representation of this object. + */ + public byte[] GetEncoded() + { + return req.GetEncoded(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReq.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReq.cs.meta new file mode 100644 index 00000000..4210b99a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReq.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f95b7ecb00c00241947e9d20299129b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReqGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReqGenerator.cs new file mode 100644 index 00000000..26cea1c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReqGenerator.cs @@ -0,0 +1,247 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + public class OcspReqGenerator + { + private IList list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + private GeneralName requestorName = null; + private X509Extensions requestExtensions = null; + + private class RequestObject + { + internal CertificateID certId; + internal X509Extensions extensions; + + public RequestObject( + CertificateID certId, + X509Extensions extensions) + { + this.certId = certId; + this.extensions = extensions; + } + + public Request ToRequest() + { + return new Request(certId.ToAsn1Object(), extensions); + } + } + + /** + * Add a request for the given CertificateID. + * + * @param certId certificate ID of interest + */ + public void AddRequest( + CertificateID certId) + { + list.Add(new RequestObject(certId, null)); + } + + /** + * Add a request with extensions + * + * @param certId certificate ID of interest + * @param singleRequestExtensions the extensions to attach to the request + */ + public void AddRequest( + CertificateID certId, + X509Extensions singleRequestExtensions) + { + list.Add(new RequestObject(certId, singleRequestExtensions)); + } + + /** + * Set the requestor name to the passed in X509Principal + * + * @param requestorName a X509Principal representing the requestor name. + */ + public void SetRequestorName( + X509Name requestorName) + { + try + { + this.requestorName = new GeneralName(GeneralName.DirectoryName, requestorName); + } + catch (Exception e) + { + throw new ArgumentException("cannot encode principal", e); + } + } + + public void SetRequestorName( + GeneralName requestorName) + { + this.requestorName = requestorName; + } + + public void SetRequestExtensions( + X509Extensions requestExtensions) + { + this.requestExtensions = requestExtensions; + } + + private OcspReq GenerateRequest( + DerObjectIdentifier signingAlgorithm, + AsymmetricKeyParameter privateKey, + X509Certificate[] chain, + SecureRandom random) + { + Asn1EncodableVector requests = new Asn1EncodableVector(); + + foreach (RequestObject reqObj in list) + { + try + { + requests.Add(reqObj.ToRequest()); + } + catch (Exception e) + { + throw new OcspException("exception creating Request", e); + } + } + + TbsRequest tbsReq = new TbsRequest(requestorName, new DerSequence(requests), requestExtensions); + + ISigner sig = null; + Signature signature = null; + + if (signingAlgorithm != null) + { + if (requestorName == null) + { + throw new OcspException("requestorName must be specified if request is signed."); + } + + try + { + sig = SignerUtilities.GetSigner(signingAlgorithm.Id); + if (random != null) + { + sig.Init(true, new ParametersWithRandom(privateKey, random)); + } + else + { + sig.Init(true, privateKey); + } + } + catch (Exception e) + { + throw new OcspException("exception creating signature: " + e, e); + } + + DerBitString bitSig = null; + + try + { + byte[] encoded = tbsReq.GetEncoded(); + sig.BlockUpdate(encoded, 0, encoded.Length); + + bitSig = new DerBitString(sig.GenerateSignature()); + } + catch (Exception e) + { + throw new OcspException("exception processing TBSRequest: " + e, e); + } + + AlgorithmIdentifier sigAlgId = new AlgorithmIdentifier(signingAlgorithm, DerNull.Instance); + + if (chain != null && chain.Length > 0) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + try + { + for (int i = 0; i != chain.Length; i++) + { + v.Add( + X509CertificateStructure.GetInstance( + Asn1Object.FromByteArray(chain[i].GetEncoded()))); + } + } + catch (IOException e) + { + throw new OcspException("error processing certs", e); + } + catch (CertificateEncodingException e) + { + throw new OcspException("error encoding certs", e); + } + + signature = new Signature(sigAlgId, bitSig, new DerSequence(v)); + } + else + { + signature = new Signature(sigAlgId, bitSig); + } + } + + return new OcspReq(new OcspRequest(tbsReq, signature)); + } + + /** + * Generate an unsigned request + * + * @return the OcspReq + * @throws OcspException + */ + public OcspReq Generate() + { + return GenerateRequest(null, null, null, null); + } + + public OcspReq Generate( + string signingAlgorithm, + AsymmetricKeyParameter privateKey, + X509Certificate[] chain) + { + return Generate(signingAlgorithm, privateKey, chain, null); + } + + public OcspReq Generate( + string signingAlgorithm, + AsymmetricKeyParameter privateKey, + X509Certificate[] chain, + SecureRandom random) + { + if (signingAlgorithm == null) + throw new ArgumentException("no signing algorithm specified"); + + try + { + DerObjectIdentifier oid = OcspUtilities.GetAlgorithmOid(signingAlgorithm); + + return GenerateRequest(oid, privateKey, chain, random); + } + catch (ArgumentException) + { + throw new ArgumentException("unknown signing algorithm specified: " + signingAlgorithm); + } + } + + /** + * Return an IEnumerable of the signature names supported by the generator. + * + * @return an IEnumerable containing recognised names. + */ + public IEnumerable SignatureAlgNames + { + get { return OcspUtilities.AlgNames; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReqGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReqGenerator.cs.meta new file mode 100644 index 00000000..baf3f18c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPReqGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 69f137c4a9de5b640b7e294ab4400582 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPResp.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPResp.cs new file mode 100644 index 00000000..76dd262d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPResp.cs @@ -0,0 +1,104 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + public class OcspResp + { + private OcspResponse resp; + + public OcspResp( + OcspResponse resp) + { + this.resp = resp; + } + + public OcspResp( + byte[] resp) + : this(new Asn1InputStream(resp)) + { + } + + public OcspResp( + Stream inStr) + : this(new Asn1InputStream(inStr)) + { + } + + private OcspResp( + Asn1InputStream aIn) + { + try + { + this.resp = OcspResponse.GetInstance(aIn.ReadObject()); + } + catch (Exception e) + { + throw new IOException("malformed response: " + e.Message, e); + } + } + + public int Status + { + get { return this.resp.ResponseStatus.Value.IntValue; } + } + + public object GetResponseObject() + { + ResponseBytes rb = this.resp.ResponseBytes; + + if (rb == null) + return null; + + if (rb.ResponseType.Equals(OcspObjectIdentifiers.PkixOcspBasic)) + { + try + { + return new BasicOcspResp( + BasicOcspResponse.GetInstance( + Asn1Object.FromByteArray(rb.Response.GetOctets()))); + } + catch (Exception e) + { + throw new OcspException("problem decoding object: " + e, e); + } + } + + return rb.Response; + } + + /** + * return the ASN.1 encoded representation of this object. + */ + public byte[] GetEncoded() + { + return resp.GetEncoded(); + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + OcspResp other = obj as OcspResp; + + if (other == null) + return false; + + return resp.Equals(other.resp); + } + + public override int GetHashCode() + { + return resp.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPResp.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPResp.cs.meta new file mode 100644 index 00000000..138e43dd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPResp.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19a37ebb18c778947808bd6a45e1a6ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespGenerator.cs new file mode 100644 index 00000000..5e5e2aa0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespGenerator.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + /** + * base generator for an OCSP response - at the moment this only supports the + * generation of responses containing BasicOCSP responses. + */ + public class OCSPRespGenerator + { + public const int Successful = 0; // Response has valid confirmations + public const int MalformedRequest = 1; // Illegal confirmation request + public const int InternalError = 2; // Internal error in issuer + public const int TryLater = 3; // Try again later + // (4) is not used + public const int SigRequired = 5; // Must sign the request + public const int Unauthorized = 6; // Request unauthorized + + public OcspResp Generate( + int status, + object response) + { + if (response == null) + { + return new OcspResp(new OcspResponse(new OcspResponseStatus(status),null)); + } + if (response is BasicOcspResp) + { + BasicOcspResp r = (BasicOcspResp)response; + Asn1OctetString octs; + + try + { + octs = new DerOctetString(r.GetEncoded()); + } + catch (Exception e) + { + throw new OcspException("can't encode object.", e); + } + + ResponseBytes rb = new ResponseBytes( + OcspObjectIdentifiers.PkixOcspBasic, octs); + + return new OcspResp(new OcspResponse( + new OcspResponseStatus(status), rb)); + } + + throw new OcspException("unknown response object"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespGenerator.cs.meta new file mode 100644 index 00000000..2b463be8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 304a4d91bffb95a489fc47ab2d2a3fb1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespStatus.cs new file mode 100644 index 00000000..c69dc60d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespStatus.cs @@ -0,0 +1,26 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + [Obsolete("Use version with correct spelling 'OcspRespStatus'")] + public abstract class OcscpRespStatus : OcspRespStatus + { + } + + public abstract class OcspRespStatus + { + /** + * note 4 is not used. + */ + public const int Successful = 0; // --Response has valid confirmations + public const int MalformedRequest = 1; // --Illegal confirmation request + public const int InternalError = 2; // --Internal error in issuer + public const int TryLater = 3; // --Try again later + public const int SigRequired = 5; // --Must sign the request + public const int Unauthorized = 6; // --Request unauthorized + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespStatus.cs.meta new file mode 100644 index 00000000..e5f33571 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPRespStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 18a92b5f029fd6645be84f8f25950a0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPUtil.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPUtil.cs new file mode 100644 index 00000000..381ea63e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPUtil.cs @@ -0,0 +1,140 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + class OcspUtilities + { + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly ISet noParams = new HashSet(); + + static OcspUtilities() + { + algorithms.Add("MD2WITHRSAENCRYPTION", PkcsObjectIdentifiers.MD2WithRsaEncryption); + algorithms.Add("MD2WITHRSA", PkcsObjectIdentifiers.MD2WithRsaEncryption); + algorithms.Add("MD5WITHRSAENCRYPTION", PkcsObjectIdentifiers.MD5WithRsaEncryption); + algorithms.Add("MD5WITHRSA", PkcsObjectIdentifiers.MD5WithRsaEncryption); + algorithms.Add("SHA1WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha1WithRsaEncryption); + algorithms.Add("SHA1WITHRSA", PkcsObjectIdentifiers.Sha1WithRsaEncryption); + algorithms.Add("SHA224WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha224WithRsaEncryption); + algorithms.Add("SHA224WITHRSA", PkcsObjectIdentifiers.Sha224WithRsaEncryption); + algorithms.Add("SHA256WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha256WithRsaEncryption); + algorithms.Add("SHA256WITHRSA", PkcsObjectIdentifiers.Sha256WithRsaEncryption); + algorithms.Add("SHA384WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha384WithRsaEncryption); + algorithms.Add("SHA384WITHRSA", PkcsObjectIdentifiers.Sha384WithRsaEncryption); + algorithms.Add("SHA512WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha512WithRsaEncryption); + algorithms.Add("SHA512WITHRSA", PkcsObjectIdentifiers.Sha512WithRsaEncryption); + algorithms.Add("RIPEMD160WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160); + algorithms.Add("RIPEMD160WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160); + algorithms.Add("RIPEMD128WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128); + algorithms.Add("RIPEMD128WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128); + algorithms.Add("RIPEMD256WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256); + algorithms.Add("RIPEMD256WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256); + algorithms.Add("SHA1WITHDSA", X9ObjectIdentifiers.IdDsaWithSha1); + algorithms.Add("DSAWITHSHA1", X9ObjectIdentifiers.IdDsaWithSha1); + algorithms.Add("SHA224WITHDSA", NistObjectIdentifiers.DsaWithSha224); + algorithms.Add("SHA256WITHDSA", NistObjectIdentifiers.DsaWithSha256); + algorithms.Add("SHA1WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha1); + algorithms.Add("ECDSAWITHSHA1", X9ObjectIdentifiers.ECDsaWithSha1); + algorithms.Add("SHA224WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha224); + algorithms.Add("SHA256WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha256); + algorithms.Add("SHA384WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha384); + algorithms.Add("SHA512WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha512); + algorithms.Add("GOST3411WITHGOST3410", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + algorithms.Add("GOST3411WITHGOST3410-94", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + + oids.Add(PkcsObjectIdentifiers.MD2WithRsaEncryption, "MD2WITHRSA"); + oids.Add(PkcsObjectIdentifiers.MD5WithRsaEncryption, "MD5WITHRSA"); + oids.Add(PkcsObjectIdentifiers.Sha1WithRsaEncryption, "SHA1WITHRSA"); + oids.Add(PkcsObjectIdentifiers.Sha224WithRsaEncryption, "SHA224WITHRSA"); + oids.Add(PkcsObjectIdentifiers.Sha256WithRsaEncryption, "SHA256WITHRSA"); + oids.Add(PkcsObjectIdentifiers.Sha384WithRsaEncryption, "SHA384WITHRSA"); + oids.Add(PkcsObjectIdentifiers.Sha512WithRsaEncryption, "SHA512WITHRSA"); + oids.Add(TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160, "RIPEMD160WITHRSA"); + oids.Add(TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128, "RIPEMD128WITHRSA"); + oids.Add(TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256, "RIPEMD256WITHRSA"); + oids.Add(X9ObjectIdentifiers.IdDsaWithSha1, "SHA1WITHDSA"); + oids.Add(NistObjectIdentifiers.DsaWithSha224, "SHA224WITHDSA"); + oids.Add(NistObjectIdentifiers.DsaWithSha256, "SHA256WITHDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha1, "SHA1WITHECDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha224, "SHA224WITHECDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha256, "SHA256WITHECDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha384, "SHA384WITHECDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha512, "SHA512WITHECDSA"); + oids.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94, "GOST3411WITHGOST3410"); + oids.Add(OiwObjectIdentifiers.MD5WithRsa, "MD5WITHRSA"); + oids.Add(OiwObjectIdentifiers.Sha1WithRsa, "SHA1WITHRSA"); + oids.Add(OiwObjectIdentifiers.DsaWithSha1, "SHA1WITHDSA"); + + // + // According to RFC 3279, the ASN.1 encoding SHALL (id-dsa-with-sha1) or MUST (ecdsa-with-SHA*) omit the parameters field. + // The parameters field SHALL be NULL for RSA based signature algorithms. + // + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha1); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha224); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha256); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha384); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha512); + noParams.Add(X9ObjectIdentifiers.IdDsaWithSha1); + noParams.Add(NistObjectIdentifiers.DsaWithSha224); + noParams.Add(NistObjectIdentifiers.DsaWithSha256); + } + + internal static DerObjectIdentifier GetAlgorithmOid( + string algorithmName) + { + algorithmName = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithmName); + + if (algorithms.Contains(algorithmName)) + { + return (DerObjectIdentifier)algorithms[algorithmName]; + } + + return new DerObjectIdentifier(algorithmName); + } + + + internal static string GetAlgorithmName( + DerObjectIdentifier oid) + { + if (oids.Contains(oid)) + { + return (string)oids[oid]; + } + + return oid.Id; + } + + internal static AlgorithmIdentifier GetSigAlgID( + DerObjectIdentifier sigOid) + { + if (noParams.Contains(sigOid)) + { + return new AlgorithmIdentifier(sigOid); + } + + return new AlgorithmIdentifier(sigOid, DerNull.Instance); + } + + internal static IEnumerable AlgNames + { + get { return new EnumerableProxy(algorithms.Keys); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPUtil.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPUtil.cs.meta new file mode 100644 index 00000000..ca9d1938 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/OCSPUtil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: df2daa91f25e00345abf4eea8f4fcb89 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/Req.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/Req.cs new file mode 100644 index 00000000..0879fc66 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/Req.cs @@ -0,0 +1,42 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + public class Req + : X509ExtensionBase + { + private Request req; + + public Req( + Request req) + { + this.req = req; + } + + public CertificateID GetCertID() + { + return new CertificateID(req.ReqCert); + } + + public X509Extensions SingleRequestExtensions + { + get { return req.SingleRequestExtensions; } + } + + protected override X509Extensions GetX509Extensions() + { + return SingleRequestExtensions; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/Req.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/Req.cs.meta new file mode 100644 index 00000000..9e20ed44 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/Req.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0f5fbac749d65af408d1b69a21018425 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespData.cs new file mode 100644 index 00000000..4e98bed0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespData.cs @@ -0,0 +1,64 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + public class RespData + : X509ExtensionBase + { + internal readonly ResponseData data; + + public RespData( + ResponseData data) + { + this.data = data; + } + + public int Version + { + get { return data.Version.Value.IntValue + 1; } + } + + public RespID GetResponderId() + { + return new RespID(data.ResponderID); + } + + public DateTime ProducedAt + { + get { return data.ProducedAt.ToDateTime(); } + } + + public SingleResp[] GetResponses() + { + Asn1Sequence s = data.Responses; + SingleResp[] rs = new SingleResp[s.Count]; + + for (int i = 0; i != rs.Length; i++) + { + rs[i] = new SingleResp(SingleResponse.GetInstance(s[i])); + } + + return rs; + } + + public X509Extensions ResponseExtensions + { + get { return data.ResponseExtensions; } + } + + protected override X509Extensions GetX509Extensions() + { + return ResponseExtensions; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespData.cs.meta new file mode 100644 index 00000000..18455859 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ad49440b0bfa564096d37219b93ff9e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespID.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespID.cs new file mode 100644 index 00000000..8a33b812 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespID.cs @@ -0,0 +1,76 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + /** + * Carrier for a ResponderID. + */ + public class RespID + { + internal readonly ResponderID id; + + public RespID( + ResponderID id) + { + this.id = id; + } + + public RespID( + X509Name name) + { + this.id = new ResponderID(name); + } + + public RespID( + AsymmetricKeyParameter publicKey) + { + try + { + SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey); + + byte[] keyHash = DigestUtilities.CalculateDigest("SHA1", info.PublicKeyData.GetBytes()); + + this.id = new ResponderID(new DerOctetString(keyHash)); + } + catch (Exception e) + { + throw new OcspException("problem creating ID: " + e, e); + } + } + + public ResponderID ToAsn1Object() + { + return id; + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + RespID other = obj as RespID; + + if (other == null) + return false; + + return id.Equals(other.id); + } + + public override int GetHashCode() + { + return id.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespID.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespID.cs.meta new file mode 100644 index 00000000..fb0943b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RespID.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13f651178027dd544b220f45d0a9235a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RevokedStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RevokedStatus.cs new file mode 100644 index 00000000..622f6b8d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RevokedStatus.cs @@ -0,0 +1,62 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + /** + * wrapper for the RevokedInfo object + */ + public class RevokedStatus + : CertificateStatus + { + internal readonly RevokedInfo info; + + public RevokedStatus( + RevokedInfo info) + { + this.info = info; + } + + public RevokedStatus( + DateTime revocationDate, + int reason) + { + this.info = new RevokedInfo(new DerGeneralizedTime(revocationDate), new CrlReason(reason)); + } + + public DateTime RevocationTime + { + get { return info.RevocationTime.ToDateTime(); } + } + + public bool HasRevocationReason + { + get { return (info.RevocationReason != null); } + } + + /** + * return the revocation reason. Note: this field is optional, test for it + * with hasRevocationReason() first. + * @exception InvalidOperationException if a reason is asked for and none is avaliable + */ + public int RevocationReason + { + get + { + if (info.RevocationReason == null) + { + throw new InvalidOperationException("attempt to get a reason where none is available"); + } + + return info.RevocationReason.Value.IntValue; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RevokedStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RevokedStatus.cs.meta new file mode 100644 index 00000000..d433c918 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/RevokedStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 942d978af399500418044db4ab073932 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/SingleResp.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/SingleResp.cs new file mode 100644 index 00000000..f52f226b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/SingleResp.cs @@ -0,0 +1,85 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ocsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + public class SingleResp + : X509ExtensionBase + { + internal readonly SingleResponse resp; + + public SingleResp( + SingleResponse resp) + { + this.resp = resp; + } + + public CertificateID GetCertID() + { + return new CertificateID(resp.CertId); + } + + /** + * Return the status object for the response - null indicates good. + * + * @return the status object for the response, null if it is good. + */ + public object GetCertStatus() + { + CertStatus s = resp.CertStatus; + + if (s.TagNo == 0) + { + return null; // good + } + + if (s.TagNo == 1) + { + return new RevokedStatus(RevokedInfo.GetInstance(s.Status)); + } + + return new UnknownStatus(); + } + + public DateTime ThisUpdate + { + get { return resp.ThisUpdate.ToDateTime(); } + } + + /** + * return the NextUpdate value - note: this is an optional field so may + * be returned as null. + * + * @return nextUpdate, or null if not present. + */ + public DateTimeObject NextUpdate + { + get + { + return resp.NextUpdate == null + ? null + : new DateTimeObject(resp.NextUpdate.ToDateTime()); + } + } + + public X509Extensions SingleExtensions + { + get { return resp.SingleExtensions; } + } + + protected override X509Extensions GetX509Extensions() + { + return SingleExtensions; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/SingleResp.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/SingleResp.cs.meta new file mode 100644 index 00000000..a97875b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/SingleResp.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91706998de8e56c4082a6a753a1aeeab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/UnknownStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/UnknownStatus.cs new file mode 100644 index 00000000..e44c005e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/UnknownStatus.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Ocsp +{ + /** + * wrapper for the UnknownInfo object + */ + public class UnknownStatus + : CertificateStatus + { + public UnknownStatus() + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/UnknownStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/UnknownStatus.cs.meta new file mode 100644 index 00000000..2aa8bc51 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/ocsp/UnknownStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f278a1680d992a45a352e630ce3ad55 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl.meta new file mode 100644 index 00000000..6c8c19cd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d9b0429922c0a544c993b4880e0172a0 +folderAsset: yes +timeCreated: 1547039641 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/EncryptionException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/EncryptionException.cs new file mode 100644 index 00000000..b1561256 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/EncryptionException.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class EncryptionException + : IOException + { + public EncryptionException( + string message) + : base(message) + { + } + + public EncryptionException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/EncryptionException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/EncryptionException.cs.meta new file mode 100644 index 00000000..07a737a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/EncryptionException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a424bf92daf4a94da4bbe8b216162ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/IPasswordFinder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/IPasswordFinder.cs new file mode 100644 index 00000000..887edf43 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/IPasswordFinder.cs @@ -0,0 +1,13 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.OpenSsl +{ + public interface IPasswordFinder + { + char[] GetPassword(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/IPasswordFinder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/IPasswordFinder.cs.meta new file mode 100644 index 00000000..2e4d5323 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/IPasswordFinder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd93d5ed8706db84582edeff6a96a3d6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/MiscPemGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/MiscPemGenerator.cs new file mode 100644 index 00000000..d04f2984 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/MiscPemGenerator.cs @@ -0,0 +1,279 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.OpenSsl +{ + /** + * PEM generator for the original set of PEM objects used in Open SSL. + */ + public class MiscPemGenerator + : PemObjectGenerator + { + private object obj; + private string algorithm; + private char[] password; + private SecureRandom random; + + public MiscPemGenerator(object obj) + { + this.obj = obj; + } + + public MiscPemGenerator( + object obj, + string algorithm, + char[] password, + SecureRandom random) + { + this.obj = obj; + this.algorithm = algorithm; + this.password = password; + this.random = random; + } + + private static PemObject CreatePemObject(object obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + + if (obj is AsymmetricCipherKeyPair) + { + return CreatePemObject(((AsymmetricCipherKeyPair)obj).Private); + } + + string type; + byte[] encoding; + + if (obj is PemObject) + return (PemObject)obj; + + if (obj is PemObjectGenerator) + return ((PemObjectGenerator)obj).Generate(); + + if (obj is X509Certificate) + { + // TODO Should we prefer "X509 CERTIFICATE" here? + type = "CERTIFICATE"; + try + { + encoding = ((X509Certificate)obj).GetEncoded(); + } + catch (CertificateEncodingException e) + { + throw new IOException("Cannot Encode object: " + e.ToString()); + } + } + else if (obj is X509Crl) + { + type = "X509 CRL"; + try + { + encoding = ((X509Crl)obj).GetEncoded(); + } + catch (CrlException e) + { + throw new IOException("Cannot Encode object: " + e.ToString()); + } + } + else if (obj is AsymmetricKeyParameter) + { + AsymmetricKeyParameter akp = (AsymmetricKeyParameter) obj; + if (akp.IsPrivate) + { + string keyType; + encoding = EncodePrivateKey(akp, out keyType); + + type = keyType + " PRIVATE KEY"; + } + else + { + type = "PUBLIC KEY"; + + encoding = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(akp).GetDerEncoded(); + } + } + else if (obj is IX509AttributeCertificate) + { + type = "ATTRIBUTE CERTIFICATE"; + encoding = ((X509V2AttributeCertificate)obj).GetEncoded(); + } + else if (obj is Pkcs10CertificationRequest) + { + type = "CERTIFICATE REQUEST"; + encoding = ((Pkcs10CertificationRequest)obj).GetEncoded(); + } + else if (obj is Asn1.Cms.ContentInfo) + { + type = "PKCS7"; + encoding = ((Asn1.Cms.ContentInfo)obj).GetEncoded(); + } + else + { + throw new PemGenerationException("Object type not supported: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + return new PemObject(type, encoding); + } + +// private string GetHexEncoded(byte[] bytes) +// { +// bytes = Hex.Encode(bytes); +// +// char[] chars = new char[bytes.Length]; +// +// for (int i = 0; i != bytes.Length; i++) +// { +// chars[i] = (char)bytes[i]; +// } +// +// return new string(chars); +// } + + private static PemObject CreatePemObject( + object obj, + string algorithm, + char[] password, + SecureRandom random) + { + if (obj == null) + throw new ArgumentNullException("obj"); + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + if (password == null) + throw new ArgumentNullException("password"); + if (random == null) + throw new ArgumentNullException("random"); + + if (obj is AsymmetricCipherKeyPair) + { + return CreatePemObject(((AsymmetricCipherKeyPair)obj).Private, algorithm, password, random); + } + + string type = null; + byte[] keyData = null; + + if (obj is AsymmetricKeyParameter) + { + AsymmetricKeyParameter akp = (AsymmetricKeyParameter) obj; + if (akp.IsPrivate) + { + string keyType; + keyData = EncodePrivateKey(akp, out keyType); + + type = keyType + " PRIVATE KEY"; + } + } + + if (type == null || keyData == null) + { + // TODO Support other types? + throw new PemGenerationException("Object type not supported: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(obj)); + } + + + string dekAlgName = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + + // Note: For backward compatibility + if (dekAlgName == "DESEDE") + { + dekAlgName = "DES-EDE3-CBC"; + } + + int ivLength = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(dekAlgName, "AES-") ? 16 : 8; + + byte[] iv = new byte[ivLength]; + random.NextBytes(iv); + + byte[] encData = PemUtilities.Crypt(true, keyData, password, dekAlgName, iv); + + IList headers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(2); + + headers.Add(new PemHeader("Proc-Type", "4,ENCRYPTED")); + headers.Add(new PemHeader("DEK-Info", dekAlgName + "," + Hex.ToHexString(iv))); + + return new PemObject(type, headers, encData); + } + + private static byte[] EncodePrivateKey( + AsymmetricKeyParameter akp, + out string keyType) + { + PrivateKeyInfo info = PrivateKeyInfoFactory.CreatePrivateKeyInfo(akp); + AlgorithmIdentifier algID = info.PrivateKeyAlgorithm; + DerObjectIdentifier oid = algID.Algorithm; + + if (oid.Equals(X9ObjectIdentifiers.IdDsa)) + { + keyType = "DSA"; + + DsaParameter p = DsaParameter.GetInstance(algID.Parameters); + + BigInteger x = ((DsaPrivateKeyParameters) akp).X; + BigInteger y = p.G.ModPow(x, p.P); + + // TODO Create an ASN1 object somewhere for this? + return new DerSequence( + new DerInteger(0), + new DerInteger(p.P), + new DerInteger(p.Q), + new DerInteger(p.G), + new DerInteger(y), + new DerInteger(x)).GetEncoded(); + } + + if (oid.Equals(PkcsObjectIdentifiers.RsaEncryption)) + { + keyType = "RSA"; + } + else if (oid.Equals(CryptoProObjectIdentifiers.GostR3410x2001) + || oid.Equals(X9ObjectIdentifiers.IdECPublicKey)) + { + keyType = "EC"; + } + else + { + throw new ArgumentException("Cannot handle private key of type: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(akp), "akp"); + } + + return info.ParsePrivateKey().GetEncoded(); + } + + public PemObject Generate() + { + try + { + if (algorithm != null) + { + return CreatePemObject(obj, algorithm, password, random); + } + + return CreatePemObject(obj); + } + catch (IOException e) + { + throw new PemGenerationException("encoding exception", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/MiscPemGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/MiscPemGenerator.cs.meta new file mode 100644 index 00000000..2f44a9b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/MiscPemGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0d8a624220f0fc41b80f7f2549e984a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMException.cs new file mode 100644 index 00000000..fec661b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMException.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.OpenSsl +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class PemException + : IOException + { + public PemException( + string message) + : base(message) + { + } + + public PemException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMException.cs.meta new file mode 100644 index 00000000..d2f949a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 02930c4db3958684397dcfe7708b464b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMReader.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMReader.cs new file mode 100644 index 00000000..0debee66 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMReader.cs @@ -0,0 +1,405 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Diagnostics; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.OpenSsl +{ + /** + * Class for reading OpenSSL PEM encoded streams containing + * X509 certificates, PKCS8 encoded keys and PKCS7 objects. + *

    + * In the case of PKCS7 objects the reader will return a CMS ContentInfo object. Keys and + * Certificates will be returned using the appropriate java.security type.

    + */ + public class PemReader + : BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem.PemReader + { +// private static readonly IDictionary parsers = new Hashtable(); + + static PemReader() + { +// parsers.Add("CERTIFICATE REQUEST", new PKCS10CertificationRequestParser()); +// parsers.Add("NEW CERTIFICATE REQUEST", new PKCS10CertificationRequestParser()); +// parsers.Add("CERTIFICATE", new X509CertificateParser(provider)); +// parsers.Add("X509 CERTIFICATE", new X509CertificateParser(provider)); +// parsers.Add("X509 CRL", new X509CRLParser(provider)); +// parsers.Add("PKCS7", new PKCS7Parser()); +// parsers.Add("ATTRIBUTE CERTIFICATE", new X509AttributeCertificateParser()); +// parsers.Add("EC PARAMETERS", new ECNamedCurveSpecParser()); +// parsers.Add("PUBLIC KEY", new PublicKeyParser(provider)); +// parsers.Add("RSA PUBLIC KEY", new RSAPublicKeyParser(provider)); +// parsers.Add("RSA PRIVATE KEY", new RSAKeyPairParser(provider)); +// parsers.Add("DSA PRIVATE KEY", new DSAKeyPairParser(provider)); +// parsers.Add("EC PRIVATE KEY", new ECDSAKeyPairParser(provider)); +// parsers.Add("ENCRYPTED PRIVATE KEY", new EncryptedPrivateKeyParser(provider)); +// parsers.Add("PRIVATE KEY", new PrivateKeyParser(provider)); + } + + private readonly IPasswordFinder pFinder; + + /** + * Create a new PemReader + * + * @param reader the Reader + */ + public PemReader( + TextReader reader) + : this(reader, null) + { + } + + /** + * Create a new PemReader with a password finder + * + * @param reader the Reader + * @param pFinder the password finder + */ + public PemReader( + TextReader reader, + IPasswordFinder pFinder) + : base(reader) + { + this.pFinder = pFinder; + } + + public object ReadObject() + { + PemObject obj = ReadPemObject(); + + if (obj == null) + return null; + + // TODO Follow Java build and map to parser objects? +// if (parsers.Contains(obj.Type)) +// return ((PemObjectParser)parsers[obj.Type]).ParseObject(obj); + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(obj.Type, "PRIVATE KEY")) + return ReadPrivateKey(obj); + + switch (obj.Type) + { + case "PUBLIC KEY": + return ReadPublicKey(obj); + case "RSA PUBLIC KEY": + return ReadRsaPublicKey(obj); + case "CERTIFICATE REQUEST": + case "NEW CERTIFICATE REQUEST": + return ReadCertificateRequest(obj); + case "CERTIFICATE": + case "X509 CERTIFICATE": + return ReadCertificate(obj); + case "PKCS7": + case "CMS": + return ReadPkcs7(obj); + case "X509 CRL": + return ReadCrl(obj); + case "ATTRIBUTE CERTIFICATE": + return ReadAttributeCertificate(obj); + // TODO Add back in when tests done, and return type issue resolved + //case "EC PARAMETERS": + // return ReadECParameters(obj); + default: + throw new IOException("unrecognised object: " + obj.Type); + } + } + + private AsymmetricKeyParameter ReadRsaPublicKey(PemObject pemObject) + { + RsaPublicKeyStructure rsaPubStructure = RsaPublicKeyStructure.GetInstance( + Asn1Object.FromByteArray(pemObject.Content)); + + return new RsaKeyParameters( + false, // not private + rsaPubStructure.Modulus, + rsaPubStructure.PublicExponent); + } + + private AsymmetricKeyParameter ReadPublicKey(PemObject pemObject) + { + return PublicKeyFactory.CreateKey(pemObject.Content); + } + + /** + * Reads in a X509Certificate. + * + * @return the X509Certificate + * @throws IOException if an I/O error occured + */ + private X509Certificate ReadCertificate(PemObject pemObject) + { + try + { + return new X509CertificateParser().ReadCertificate(pemObject.Content); + } + catch (Exception e) + { + throw new PemException("problem parsing cert: " + e.ToString()); + } + } + + /** + * Reads in a X509CRL. + * + * @return the X509Certificate + * @throws IOException if an I/O error occured + */ + private X509Crl ReadCrl(PemObject pemObject) + { + try + { + return new X509CrlParser().ReadCrl(pemObject.Content); + } + catch (Exception e) + { + throw new PemException("problem parsing cert: " + e.ToString()); + } + } + + /** + * Reads in a PKCS10 certification request. + * + * @return the certificate request. + * @throws IOException if an I/O error occured + */ + private Pkcs10CertificationRequest ReadCertificateRequest(PemObject pemObject) + { + try + { + return new Pkcs10CertificationRequest(pemObject.Content); + } + catch (Exception e) + { + throw new PemException("problem parsing cert: " + e.ToString()); + } + } + + /** + * Reads in a X509 Attribute Certificate. + * + * @return the X509 Attribute Certificate + * @throws IOException if an I/O error occured + */ + private IX509AttributeCertificate ReadAttributeCertificate(PemObject pemObject) + { + return new X509V2AttributeCertificate(pemObject.Content); + } + + /** + * Reads in a PKCS7 object. This returns a ContentInfo object suitable for use with the CMS + * API. + * + * @return the X509Certificate + * @throws IOException if an I/O error occured + */ + // TODO Consider returning Asn1.Pkcs.ContentInfo + private Asn1.Cms.ContentInfo ReadPkcs7(PemObject pemObject) + { + try + { + return Asn1.Cms.ContentInfo.GetInstance( + Asn1Object.FromByteArray(pemObject.Content)); + } + catch (Exception e) + { + throw new PemException("problem parsing PKCS7 object: " + e.ToString()); + } + } + + /** + * Read a Key Pair + */ + private object ReadPrivateKey(PemObject pemObject) + { + // + // extract the key + // + Debug.Assert(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(pemObject.Type, "PRIVATE KEY")); + + string type = pemObject.Type.Substring(0, pemObject.Type.Length - "PRIVATE KEY".Length).Trim(); + byte[] keyBytes = pemObject.Content; + + IDictionary fields = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + foreach (PemHeader header in pemObject.Headers) + { + fields[header.Name] = header.Value; + } + + string procType = (string) fields["Proc-Type"]; + + if (procType == "4,ENCRYPTED") + { + if (pFinder == null) + throw new PasswordException("No password finder specified, but a password is required"); + + char[] password = pFinder.GetPassword(); + + if (password == null) + throw new PasswordException("Password is null, but a password is required"); + + string dekInfo = (string) fields["DEK-Info"]; + string[] tknz = dekInfo.Split(','); + + string dekAlgName = tknz[0].Trim(); + byte[] iv = Hex.Decode(tknz[1].Trim()); + + keyBytes = PemUtilities.Crypt(false, keyBytes, password, dekAlgName, iv); + } + + try + { + AsymmetricKeyParameter pubSpec, privSpec; + Asn1Sequence seq = Asn1Sequence.GetInstance(keyBytes); + + switch (type) + { + case "RSA": + { + if (seq.Count != 9) + throw new PemException("malformed sequence in RSA private key"); + + RsaPrivateKeyStructure rsa = RsaPrivateKeyStructure.GetInstance(seq); + + pubSpec = new RsaKeyParameters(false, rsa.Modulus, rsa.PublicExponent); + privSpec = new RsaPrivateCrtKeyParameters( + rsa.Modulus, rsa.PublicExponent, rsa.PrivateExponent, + rsa.Prime1, rsa.Prime2, rsa.Exponent1, rsa.Exponent2, + rsa.Coefficient); + + break; + } + + case "DSA": + { + if (seq.Count != 6) + throw new PemException("malformed sequence in DSA private key"); + + // TODO Create an ASN1 object somewhere for this? + //DerInteger v = (DerInteger)seq[0]; + DerInteger p = (DerInteger)seq[1]; + DerInteger q = (DerInteger)seq[2]; + DerInteger g = (DerInteger)seq[3]; + DerInteger y = (DerInteger)seq[4]; + DerInteger x = (DerInteger)seq[5]; + + DsaParameters parameters = new DsaParameters(p.Value, q.Value, g.Value); + + privSpec = new DsaPrivateKeyParameters(x.Value, parameters); + pubSpec = new DsaPublicKeyParameters(y.Value, parameters); + + break; + } + + case "EC": + { + ECPrivateKeyStructure pKey = ECPrivateKeyStructure.GetInstance(seq); + AlgorithmIdentifier algId = new AlgorithmIdentifier( + X9ObjectIdentifiers.IdECPublicKey, pKey.GetParameters()); + + PrivateKeyInfo privInfo = new PrivateKeyInfo(algId, pKey.ToAsn1Object()); + + // TODO Are the keys returned here ECDSA, as Java version forces? + privSpec = PrivateKeyFactory.CreateKey(privInfo); + + DerBitString pubKey = pKey.GetPublicKey(); + if (pubKey != null) + { + SubjectPublicKeyInfo pubInfo = new SubjectPublicKeyInfo(algId, pubKey.GetBytes()); + + // TODO Are the keys returned here ECDSA, as Java version forces? + pubSpec = PublicKeyFactory.CreateKey(pubInfo); + } + else + { + pubSpec = ECKeyPairGenerator.GetCorrespondingPublicKey( + (ECPrivateKeyParameters)privSpec); + } + + break; + } + + case "ENCRYPTED": + { + char[] password = pFinder.GetPassword(); + + if (password == null) + throw new PasswordException("Password is null, but a password is required"); + + return PrivateKeyFactory.DecryptKey(password, EncryptedPrivateKeyInfo.GetInstance(seq)); + } + + case "": + { + return PrivateKeyFactory.CreateKey(PrivateKeyInfo.GetInstance(seq)); + } + + default: + throw new ArgumentException("Unknown key type: " + type, "type"); + } + + return new AsymmetricCipherKeyPair(pubSpec, privSpec); + } + catch (IOException e) + { + throw e; + } + catch (Exception e) + { + throw new PemException( + "problem creating " + type + " private key: " + e.ToString()); + } + } + + // TODO Add an equivalent class for ECNamedCurveParameterSpec? + //private ECNamedCurveParameterSpec ReadECParameters( +// private X9ECParameters ReadECParameters(PemObject pemObject) +// { +// DerObjectIdentifier oid = (DerObjectIdentifier)Asn1Object.FromByteArray(pemObject.Content); +// +// //return ECNamedCurveTable.getParameterSpec(oid.Id); +// return GetCurveParameters(oid.Id); +// } + + //private static ECDomainParameters GetCurveParameters( + private static X9ECParameters GetCurveParameters( + string name) + { + // TODO ECGost3410NamedCurves support (returns ECDomainParameters though) + + X9ECParameters ecP = CustomNamedCurves.GetByName(name); + if (ecP == null) + { + ecP = ECNamedCurveTable.GetByName(name); + } + + if (ecP == null) + throw new Exception("unknown curve name: " + name); + + //return new ECDomainParameters(ecP.Curve, ecP.G, ecP.N, ecP.H, ecP.GetSeed()); + return ecP; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMReader.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMReader.cs.meta new file mode 100644 index 00000000..a7724a9b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMReader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea2749aedc54590409ca3ca57e7e3a00 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMUtilities.cs new file mode 100644 index 00000000..9e1e4d2b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMUtilities.cs @@ -0,0 +1,162 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.OpenSsl +{ + internal sealed class PemUtilities + { + private enum PemBaseAlg { AES_128, AES_192, AES_256, BF, DES, DES_EDE, DES_EDE3, RC2, RC2_40, RC2_64 }; + private enum PemMode { CBC, CFB, ECB, OFB }; + + static PemUtilities() + { + // Signal to obfuscation tools not to change enum constants + ((PemBaseAlg)Enums.GetArbitraryValue(typeof(PemBaseAlg))).ToString(); + ((PemMode)Enums.GetArbitraryValue(typeof(PemMode))).ToString(); + } + + private static void ParseDekAlgName( + string dekAlgName, + out PemBaseAlg baseAlg, + out PemMode mode) + { + try + { + mode = PemMode.ECB; + + if (dekAlgName == "DES-EDE" || dekAlgName == "DES-EDE3") + { + baseAlg = (PemBaseAlg)Enums.GetEnumValue(typeof(PemBaseAlg), dekAlgName); + return; + } + + int pos = dekAlgName.LastIndexOf('-'); + if (pos >= 0) + { + baseAlg = (PemBaseAlg)Enums.GetEnumValue(typeof(PemBaseAlg), dekAlgName.Substring(0, pos)); + mode = (PemMode)Enums.GetEnumValue(typeof(PemMode), dekAlgName.Substring(pos + 1)); + return; + } + } + catch (ArgumentException) + { + } + + throw new EncryptionException("Unknown DEK algorithm: " + dekAlgName); + } + + internal static byte[] Crypt( + bool encrypt, + byte[] bytes, + char[] password, + string dekAlgName, + byte[] iv) + { + PemBaseAlg baseAlg; + PemMode mode; + ParseDekAlgName(dekAlgName, out baseAlg, out mode); + + string padding; + switch (mode) + { + case PemMode.CBC: + case PemMode.ECB: + padding = "PKCS5Padding"; + break; + case PemMode.CFB: + case PemMode.OFB: + padding = "NoPadding"; + break; + default: + throw new EncryptionException("Unknown DEK algorithm: " + dekAlgName); + } + + string algorithm; + + byte[] salt = iv; + switch (baseAlg) + { + case PemBaseAlg.AES_128: + case PemBaseAlg.AES_192: + case PemBaseAlg.AES_256: + algorithm = "AES"; + if (salt.Length > 8) + { + salt = new byte[8]; + Array.Copy(iv, 0, salt, 0, salt.Length); + } + break; + case PemBaseAlg.BF: + algorithm = "BLOWFISH"; + break; + case PemBaseAlg.DES: + algorithm = "DES"; + break; + case PemBaseAlg.DES_EDE: + case PemBaseAlg.DES_EDE3: + algorithm = "DESede"; + break; + case PemBaseAlg.RC2: + case PemBaseAlg.RC2_40: + case PemBaseAlg.RC2_64: + algorithm = "RC2"; + break; + default: + throw new EncryptionException("Unknown DEK algorithm: " + dekAlgName); + } + + string cipherName = algorithm + "/" + mode + "/" + padding; + IBufferedCipher cipher = CipherUtilities.GetCipher(cipherName); + + ICipherParameters cParams = GetCipherParameters(password, baseAlg, salt); + + if (mode != PemMode.ECB) + { + cParams = new ParametersWithIV(cParams, iv); + } + + cipher.Init(encrypt, cParams); + + return cipher.DoFinal(bytes); + } + + private static ICipherParameters GetCipherParameters( + char[] password, + PemBaseAlg baseAlg, + byte[] salt) + { + string algorithm; + int keyBits; + switch (baseAlg) + { + case PemBaseAlg.AES_128: keyBits = 128; algorithm = "AES128"; break; + case PemBaseAlg.AES_192: keyBits = 192; algorithm = "AES192"; break; + case PemBaseAlg.AES_256: keyBits = 256; algorithm = "AES256"; break; + case PemBaseAlg.BF: keyBits = 128; algorithm = "BLOWFISH"; break; + case PemBaseAlg.DES: keyBits = 64; algorithm = "DES"; break; + case PemBaseAlg.DES_EDE: keyBits = 128; algorithm = "DESEDE"; break; + case PemBaseAlg.DES_EDE3: keyBits = 192; algorithm = "DESEDE3"; break; + case PemBaseAlg.RC2: keyBits = 128; algorithm = "RC2"; break; + case PemBaseAlg.RC2_40: keyBits = 40; algorithm = "RC2"; break; + case PemBaseAlg.RC2_64: keyBits = 64; algorithm = "RC2"; break; + default: + return null; + } + + OpenSslPbeParametersGenerator pGen = new OpenSslPbeParametersGenerator(); + + pGen.Init(PbeParametersGenerator.Pkcs5PasswordToBytes(password), salt); + + return pGen.GenerateDerivedParameters(algorithm, keyBits); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMUtilities.cs.meta new file mode 100644 index 00000000..03b1b1b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb8051867251512499844467793cdf9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMWriter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMWriter.cs new file mode 100644 index 00000000..f0563e54 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMWriter.cs @@ -0,0 +1,65 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.OpenSsl +{ + /// General purpose writer for OpenSSL PEM objects. + public class PemWriter + : BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem.PemWriter + { + /// The TextWriter object to write the output to. + public PemWriter( + TextWriter writer) + : base(writer) + { + } + + public void WriteObject( + object obj) + { + try + { + base.WriteObject(new MiscPemGenerator(obj)); + } + catch (PemGenerationException e) + { + if (e.InnerException is IOException) + throw (IOException)e.InnerException; + + throw e; + } + } + + public void WriteObject( + object obj, + string algorithm, + char[] password, + SecureRandom random) + { + base.WriteObject(new MiscPemGenerator(obj, algorithm, password, random)); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMWriter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMWriter.cs.meta new file mode 100644 index 00000000..6e43b931 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PEMWriter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 23f95c4b40043494bb615ca11764ba46 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PasswordException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PasswordException.cs new file mode 100644 index 00000000..b1ee0283 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PasswordException.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class PasswordException + : IOException + { + public PasswordException( + string message) + : base(message) + { + } + + public PasswordException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PasswordException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PasswordException.cs.meta new file mode 100644 index 00000000..6835ce53 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/PasswordException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1a0af6d81e309f746935cdd3c3287be7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/Pkcs8Generator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/Pkcs8Generator.cs new file mode 100644 index 00000000..0d67b853 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/Pkcs8Generator.cs @@ -0,0 +1,115 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.OpenSsl +{ + public class Pkcs8Generator + : PemObjectGenerator + { + // FIXME See PbeUtilities static constructor +// public static readonly string Aes128Cbc = NistObjectIdentifiers.IdAes128Cbc.Id; +// public static readonly string Aes192Cbc = NistObjectIdentifiers.IdAes192Cbc.Id; +// public static readonly string Aes256Cbc = NistObjectIdentifiers.IdAes256Cbc.Id; +// +// public static readonly string Des3Cbc = PkcsObjectIdentifiers.DesEde3Cbc.Id; + + public static readonly string PbeSha1_RC4_128 = PkcsObjectIdentifiers.PbeWithShaAnd128BitRC4.Id; + public static readonly string PbeSha1_RC4_40 = PkcsObjectIdentifiers.PbeWithShaAnd40BitRC4.Id; + public static readonly string PbeSha1_3DES = PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc.Id; + public static readonly string PbeSha1_2DES = PkcsObjectIdentifiers.PbeWithShaAnd2KeyTripleDesCbc.Id; + public static readonly string PbeSha1_RC2_128 = PkcsObjectIdentifiers.PbeWithShaAnd128BitRC2Cbc.Id; + public static readonly string PbeSha1_RC2_40 = PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc.Id; + + private char[] password; + private string algorithm; + private int iterationCount; + private AsymmetricKeyParameter privKey; + private SecureRandom random; + + /** + * Constructor for an unencrypted private key PEM object. + * + * @param key private key to be encoded. + */ + public Pkcs8Generator(AsymmetricKeyParameter privKey) + { + this.privKey = privKey; + } + + /** + * Constructor for an encrypted private key PEM object. + * + * @param key private key to be encoded + * @param algorithm encryption algorithm to use + * @param provider provider to use + * @throws NoSuchAlgorithmException if algorithm/mode cannot be found + */ + public Pkcs8Generator(AsymmetricKeyParameter privKey, string algorithm) + { + // TODO Check privKey.IsPrivate + this.privKey = privKey; + this.algorithm = algorithm; + this.iterationCount = 2048; + } + + public SecureRandom SecureRandom + { + set { this.random = value; } + } + + public char[] Password + { + set { this.password = value; } + } + + public int IterationCount + { + set { this.iterationCount = value; } + } + + public PemObject Generate() + { + if (algorithm == null) + { + PrivateKeyInfo pki = PrivateKeyInfoFactory.CreatePrivateKeyInfo(privKey); + + return new PemObject("PRIVATE KEY", pki.GetEncoded()); + } + + // TODO Theoretically, the amount of salt needed depends on the algorithm + byte[] salt = new byte[20]; + if (random == null) + { + random = new SecureRandom(); + } + random.NextBytes(salt); + + try + { + EncryptedPrivateKeyInfo epki = EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo( + algorithm, password, salt, iterationCount, privKey); + + return new PemObject("ENCRYPTED PRIVATE KEY", epki.GetEncoded()); + } + catch (Exception e) + { + throw new PemGenerationException("Couldn't encrypt private key", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/Pkcs8Generator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/Pkcs8Generator.cs.meta new file mode 100644 index 00000000..01c253d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/openssl/Pkcs8Generator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8fd3426c3338f804185fac837f54726a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs.meta new file mode 100644 index 00000000..e9cbd2a8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: c5b7d40a38054774bb2cee59156dd3d3 +folderAsset: yes +timeCreated: 1547039641 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/AsymmetricKeyEntry.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/AsymmetricKeyEntry.cs new file mode 100644 index 00000000..7dba455d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/AsymmetricKeyEntry.cs @@ -0,0 +1,64 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + public class AsymmetricKeyEntry + : Pkcs12Entry + { + private readonly AsymmetricKeyParameter key; + + public AsymmetricKeyEntry( + AsymmetricKeyParameter key) + : base(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable()) + { + this.key = key; + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete] + public AsymmetricKeyEntry( + AsymmetricKeyParameter key, + Hashtable attributes) + : base(attributes) + { + this.key = key; + } +#endif + + public AsymmetricKeyEntry( + AsymmetricKeyParameter key, + IDictionary attributes) + : base(attributes) + { + this.key = key; + } + + public AsymmetricKeyParameter Key + { + get { return this.key; } + } + + public override bool Equals(object obj) + { + AsymmetricKeyEntry other = obj as AsymmetricKeyEntry; + + if (other == null) + return false; + + return key.Equals(other.key); + } + + public override int GetHashCode() + { + return ~key.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/AsymmetricKeyEntry.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/AsymmetricKeyEntry.cs.meta new file mode 100644 index 00000000..8c2605ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/AsymmetricKeyEntry.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e0fc1e2e40052dc44899abad8920a4e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/EncryptedPrivateKeyInfoFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/EncryptedPrivateKeyInfoFactory.cs new file mode 100644 index 00000000..7daafcb6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/EncryptedPrivateKeyInfoFactory.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + public sealed class EncryptedPrivateKeyInfoFactory + { + private EncryptedPrivateKeyInfoFactory() + { + } + + public static EncryptedPrivateKeyInfo CreateEncryptedPrivateKeyInfo( + DerObjectIdentifier algorithm, + char[] passPhrase, + byte[] salt, + int iterationCount, + AsymmetricKeyParameter key) + { + return CreateEncryptedPrivateKeyInfo( + algorithm.Id, passPhrase, salt, iterationCount, + PrivateKeyInfoFactory.CreatePrivateKeyInfo(key)); + } + + public static EncryptedPrivateKeyInfo CreateEncryptedPrivateKeyInfo( + string algorithm, + char[] passPhrase, + byte[] salt, + int iterationCount, + AsymmetricKeyParameter key) + { + return CreateEncryptedPrivateKeyInfo( + algorithm, passPhrase, salt, iterationCount, + PrivateKeyInfoFactory.CreatePrivateKeyInfo(key)); + } + + public static EncryptedPrivateKeyInfo CreateEncryptedPrivateKeyInfo( + string algorithm, + char[] passPhrase, + byte[] salt, + int iterationCount, + PrivateKeyInfo keyInfo) + { + IBufferedCipher cipher = PbeUtilities.CreateEngine(algorithm) as IBufferedCipher; + if (cipher == null) + throw new Exception("Unknown encryption algorithm: " + algorithm); + + Asn1Encodable pbeParameters = PbeUtilities.GenerateAlgorithmParameters( + algorithm, salt, iterationCount); + ICipherParameters cipherParameters = PbeUtilities.GenerateCipherParameters( + algorithm, passPhrase, pbeParameters); + cipher.Init(true, cipherParameters); + byte[] encoding = cipher.DoFinal(keyInfo.GetEncoded()); + + DerObjectIdentifier oid = PbeUtilities.GetObjectIdentifier(algorithm); + AlgorithmIdentifier algID = new AlgorithmIdentifier(oid, pbeParameters); + return new EncryptedPrivateKeyInfo(algID, encoding); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/EncryptedPrivateKeyInfoFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/EncryptedPrivateKeyInfoFactory.cs.meta new file mode 100644 index 00000000..fe457e8c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/EncryptedPrivateKeyInfoFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ff4b19a3a083b346a18148d9cd0ba8d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PKCS12StoreBuilder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PKCS12StoreBuilder.cs new file mode 100644 index 00000000..ac53dcd9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PKCS12StoreBuilder.cs @@ -0,0 +1,45 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + public class Pkcs12StoreBuilder + { + private DerObjectIdentifier keyAlgorithm = PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc; + private DerObjectIdentifier certAlgorithm = PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc; + private bool useDerEncoding = false; + + public Pkcs12StoreBuilder() + { + } + + public Pkcs12Store Build() + { + return new Pkcs12Store(keyAlgorithm, certAlgorithm, useDerEncoding); + } + + public Pkcs12StoreBuilder SetCertAlgorithm(DerObjectIdentifier certAlgorithm) + { + this.certAlgorithm = certAlgorithm; + return this; + } + + public Pkcs12StoreBuilder SetKeyAlgorithm(DerObjectIdentifier keyAlgorithm) + { + this.keyAlgorithm = keyAlgorithm; + return this; + } + + public Pkcs12StoreBuilder SetUseDerEncoding(bool useDerEncoding) + { + this.useDerEncoding = useDerEncoding; + return this; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PKCS12StoreBuilder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PKCS12StoreBuilder.cs.meta new file mode 100644 index 00000000..d43a66c2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PKCS12StoreBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43aa4e117903bc6489e2b003abb2af10 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequest.cs new file mode 100644 index 00000000..fcb20bcd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequest.cs @@ -0,0 +1,471 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + /// + /// A class for verifying and creating Pkcs10 Certification requests. + /// + /// + /// CertificationRequest ::= Sequence { + /// certificationRequestInfo CertificationRequestInfo, + /// signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, + /// signature BIT STRING + /// } + /// + /// CertificationRequestInfo ::= Sequence { + /// version Integer { v1(0) } (v1,...), + /// subject Name, + /// subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, + /// attributes [0] Attributes{{ CRIAttributes }} + /// } + /// + /// Attributes { ATTRIBUTE:IOSet } ::= Set OF Attr{{ IOSet }} + /// + /// Attr { ATTRIBUTE:IOSet } ::= Sequence { + /// type ATTRIBUTE.&id({IOSet}), + /// values Set SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type}) + /// } + /// + /// see + public class Pkcs10CertificationRequest + : CertificationRequest + { + protected static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + protected static readonly IDictionary exParams = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + protected static readonly IDictionary keyAlgorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + protected static readonly IDictionary oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + protected static readonly ISet noParams = new HashSet(); + + static Pkcs10CertificationRequest() + { + algorithms.Add("MD2WITHRSAENCRYPTION", PkcsObjectIdentifiers.MD2WithRsaEncryption); + algorithms.Add("MD2WITHRSA", PkcsObjectIdentifiers.MD2WithRsaEncryption); + algorithms.Add("MD5WITHRSAENCRYPTION", PkcsObjectIdentifiers.MD5WithRsaEncryption); + algorithms.Add("MD5WITHRSA", PkcsObjectIdentifiers.MD5WithRsaEncryption); + algorithms.Add("RSAWITHMD5", PkcsObjectIdentifiers.MD5WithRsaEncryption); + algorithms.Add("SHA1WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha1WithRsaEncryption); + algorithms.Add("SHA1WITHRSA", PkcsObjectIdentifiers.Sha1WithRsaEncryption); + algorithms.Add("SHA224WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha224WithRsaEncryption); + algorithms.Add("SHA224WITHRSA", PkcsObjectIdentifiers.Sha224WithRsaEncryption); + algorithms.Add("SHA256WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha256WithRsaEncryption); + algorithms.Add("SHA256WITHRSA", PkcsObjectIdentifiers.Sha256WithRsaEncryption); + algorithms.Add("SHA384WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha384WithRsaEncryption); + algorithms.Add("SHA384WITHRSA", PkcsObjectIdentifiers.Sha384WithRsaEncryption); + algorithms.Add("SHA512WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha512WithRsaEncryption); + algorithms.Add("SHA512WITHRSA", PkcsObjectIdentifiers.Sha512WithRsaEncryption); + algorithms.Add("SHA1WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA224WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA256WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA384WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA512WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("RSAWITHSHA1", PkcsObjectIdentifiers.Sha1WithRsaEncryption); + algorithms.Add("RIPEMD128WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128); + algorithms.Add("RIPEMD128WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128); + algorithms.Add("RIPEMD160WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160); + algorithms.Add("RIPEMD160WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160); + algorithms.Add("RIPEMD256WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256); + algorithms.Add("RIPEMD256WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256); + algorithms.Add("SHA1WITHDSA", X9ObjectIdentifiers.IdDsaWithSha1); + algorithms.Add("DSAWITHSHA1", X9ObjectIdentifiers.IdDsaWithSha1); + algorithms.Add("SHA224WITHDSA", NistObjectIdentifiers.DsaWithSha224); + algorithms.Add("SHA256WITHDSA", NistObjectIdentifiers.DsaWithSha256); + algorithms.Add("SHA384WITHDSA", NistObjectIdentifiers.DsaWithSha384); + algorithms.Add("SHA512WITHDSA", NistObjectIdentifiers.DsaWithSha512); + algorithms.Add("SHA1WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha1); + algorithms.Add("SHA224WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha224); + algorithms.Add("SHA256WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha256); + algorithms.Add("SHA384WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha384); + algorithms.Add("SHA512WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha512); + algorithms.Add("ECDSAWITHSHA1", X9ObjectIdentifiers.ECDsaWithSha1); + algorithms.Add("GOST3411WITHGOST3410", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + algorithms.Add("GOST3410WITHGOST3411", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + algorithms.Add("GOST3411WITHECGOST3410", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + algorithms.Add("GOST3411WITHECGOST3410-2001", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + algorithms.Add("GOST3411WITHGOST3410-2001", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + + // + // reverse mappings + // + oids.Add(PkcsObjectIdentifiers.Sha1WithRsaEncryption, "SHA1WITHRSA"); + oids.Add(PkcsObjectIdentifiers.Sha224WithRsaEncryption, "SHA224WITHRSA"); + oids.Add(PkcsObjectIdentifiers.Sha256WithRsaEncryption, "SHA256WITHRSA"); + oids.Add(PkcsObjectIdentifiers.Sha384WithRsaEncryption, "SHA384WITHRSA"); + oids.Add(PkcsObjectIdentifiers.Sha512WithRsaEncryption, "SHA512WITHRSA"); + oids.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94, "GOST3411WITHGOST3410"); + oids.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001, "GOST3411WITHECGOST3410"); + + oids.Add(PkcsObjectIdentifiers.MD5WithRsaEncryption, "MD5WITHRSA"); + oids.Add(PkcsObjectIdentifiers.MD2WithRsaEncryption, "MD2WITHRSA"); + oids.Add(X9ObjectIdentifiers.IdDsaWithSha1, "SHA1WITHDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha1, "SHA1WITHECDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha224, "SHA224WITHECDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha256, "SHA256WITHECDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha384, "SHA384WITHECDSA"); + oids.Add(X9ObjectIdentifiers.ECDsaWithSha512, "SHA512WITHECDSA"); + oids.Add(OiwObjectIdentifiers.MD5WithRsa, "MD5WITHRSA"); + oids.Add(OiwObjectIdentifiers.Sha1WithRsa, "SHA1WITHRSA"); + oids.Add(OiwObjectIdentifiers.DsaWithSha1, "SHA1WITHDSA"); + oids.Add(NistObjectIdentifiers.DsaWithSha224, "SHA224WITHDSA"); + oids.Add(NistObjectIdentifiers.DsaWithSha256, "SHA256WITHDSA"); + + // + // key types + // + keyAlgorithms.Add(PkcsObjectIdentifiers.RsaEncryption, "RSA"); + keyAlgorithms.Add(X9ObjectIdentifiers.IdDsa, "DSA"); + + // + // According to RFC 3279, the ASN.1 encoding SHALL (id-dsa-with-sha1) or MUST (ecdsa-with-SHA*) omit the parameters field. + // The parameters field SHALL be NULL for RSA based signature algorithms. + // + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha1); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha224); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha256); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha384); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha512); + noParams.Add(X9ObjectIdentifiers.IdDsaWithSha1); + noParams.Add(NistObjectIdentifiers.DsaWithSha224); + noParams.Add(NistObjectIdentifiers.DsaWithSha256); + + // + // RFC 4491 + // + noParams.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + noParams.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + + // + // explicit params + // + AlgorithmIdentifier sha1AlgId = new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1, DerNull.Instance); + exParams.Add("SHA1WITHRSAANDMGF1", CreatePssParams(sha1AlgId, 20)); + + AlgorithmIdentifier sha224AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha224, DerNull.Instance); + exParams.Add("SHA224WITHRSAANDMGF1", CreatePssParams(sha224AlgId, 28)); + + AlgorithmIdentifier sha256AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha256, DerNull.Instance); + exParams.Add("SHA256WITHRSAANDMGF1", CreatePssParams(sha256AlgId, 32)); + + AlgorithmIdentifier sha384AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha384, DerNull.Instance); + exParams.Add("SHA384WITHRSAANDMGF1", CreatePssParams(sha384AlgId, 48)); + + AlgorithmIdentifier sha512AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha512, DerNull.Instance); + exParams.Add("SHA512WITHRSAANDMGF1", CreatePssParams(sha512AlgId, 64)); + } + + private static RsassaPssParameters CreatePssParams( + AlgorithmIdentifier hashAlgId, + int saltSize) + { + return new RsassaPssParameters( + hashAlgId, + new AlgorithmIdentifier(PkcsObjectIdentifiers.IdMgf1, hashAlgId), + new DerInteger(saltSize), + new DerInteger(1)); + } + + protected Pkcs10CertificationRequest() + { + } + + public Pkcs10CertificationRequest( + byte[] encoded) + : base((Asn1Sequence) Asn1Object.FromByteArray(encoded)) + { + } + + public Pkcs10CertificationRequest( + Asn1Sequence seq) + : base(seq) + { + } + + public Pkcs10CertificationRequest( + Stream input) + : base((Asn1Sequence) Asn1Object.FromStream(input)) + { + } + + /// + /// Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + /// + ///Name of Sig Alg. + /// X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + /// Public Key to be included in cert reqest. + /// ASN1Set of Attributes. + /// Matching Private key for nominated (above) public key to be used to sign the request. + public Pkcs10CertificationRequest( + string signatureAlgorithm, + X509Name subject, + AsymmetricKeyParameter publicKey, + Asn1Set attributes, + AsymmetricKeyParameter signingKey) + : this(new Asn1SignatureFactory(signatureAlgorithm, signingKey), subject, publicKey, attributes) + { + } + + /// + /// Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + /// + ///The factory for signature calculators to sign the PKCS#10 request with. + /// X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + /// Public Key to be included in cert reqest. + /// ASN1Set of Attributes. + /// Ignored. + [Obsolete("Use constructor without 'signingKey' parameter (ignored here)")] + public Pkcs10CertificationRequest( + ISignatureFactory signatureFactory, + X509Name subject, + AsymmetricKeyParameter publicKey, + Asn1Set attributes, + AsymmetricKeyParameter signingKey) + : this(signatureFactory, subject, publicKey, attributes) + { + } + + /// + /// Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + /// + ///The factory for signature calculators to sign the PKCS#10 request with. + /// X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + /// Public Key to be included in cert reqest. + /// ASN1Set of Attributes. + public Pkcs10CertificationRequest( + ISignatureFactory signatureFactory, + X509Name subject, + AsymmetricKeyParameter publicKey, + Asn1Set attributes) + { + if (signatureFactory == null) + throw new ArgumentNullException("signatureFactory"); + if (subject == null) + throw new ArgumentNullException("subject"); + if (publicKey == null) + throw new ArgumentNullException("publicKey"); + if (publicKey.IsPrivate) + throw new ArgumentException("expected public key", "publicKey"); + + Init(signatureFactory, subject, publicKey, attributes); + } + + private void Init( + ISignatureFactory signatureFactory, + X509Name subject, + AsymmetricKeyParameter publicKey, + Asn1Set attributes) + { + this.sigAlgId = (AlgorithmIdentifier)signatureFactory.AlgorithmDetails; + + SubjectPublicKeyInfo pubInfo = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey); + + this.reqInfo = new CertificationRequestInfo(subject, pubInfo, attributes); + + IStreamCalculator streamCalculator = signatureFactory.CreateCalculator(); + + byte[] reqInfoData = reqInfo.GetDerEncoded(); + + streamCalculator.Stream.Write(reqInfoData, 0, reqInfoData.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + + // Generate Signature. + sigBits = new DerBitString(((IBlockResult)streamCalculator.GetResult()).Collect()); + } + + // internal Pkcs10CertificationRequest( + // Asn1InputStream seqStream) + // { + // Asn1Sequence seq = (Asn1Sequence) seqStream.ReadObject(); + // try + // { + // this.reqInfo = CertificationRequestInfo.GetInstance(seq[0]); + // this.sigAlgId = AlgorithmIdentifier.GetInstance(seq[1]); + // this.sigBits = (DerBitString) seq[2]; + // } + // catch (Exception ex) + // { + // throw new ArgumentException("Create From Asn1Sequence: " + ex.Message); + // } + // } + + /// + /// Get the public key. + /// + /// The public key. + public AsymmetricKeyParameter GetPublicKey() + { + return PublicKeyFactory.CreateKey(reqInfo.SubjectPublicKeyInfo); + } + + /// + /// Verify Pkcs10 Cert Request is valid. + /// + /// true = valid. + public bool Verify() + { + return Verify(this.GetPublicKey()); + } + + public bool Verify( + AsymmetricKeyParameter publicKey) + { + return Verify(new Asn1VerifierFactoryProvider(publicKey)); + } + + public bool Verify( + IVerifierFactoryProvider verifierProvider) + { + return Verify(verifierProvider.CreateVerifierFactory(sigAlgId)); + } + + public bool Verify( + IVerifierFactory verifier) + { + try + { + byte[] b = reqInfo.GetDerEncoded(); + + IStreamCalculator streamCalculator = verifier.CreateCalculator(); + + streamCalculator.Stream.Write(b, 0, b.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + + return ((IVerifier)streamCalculator.GetResult()).IsVerified(sigBits.GetOctets()); + } + catch (Exception e) + { + throw new SignatureException("exception encoding TBS cert request", e); + } + } + + // /// + // /// Get the Der Encoded Pkcs10 Certification Request. + // /// + // /// A byte array. + // public byte[] GetEncoded() + // { + // return new CertificationRequest(reqInfo, sigAlgId, sigBits).GetDerEncoded(); + // } + + // TODO Figure out how to set parameters on an ISigner + private void SetSignatureParameters( + ISigner signature, + Asn1Encodable asn1Params) + { + if (asn1Params != null && !(asn1Params is Asn1Null)) + { +// AlgorithmParameters sigParams = AlgorithmParameters.GetInstance(signature.getAlgorithm()); +// +// try +// { +// sigParams.init(asn1Params.ToAsn1Object().GetDerEncoded()); +// } +// catch (IOException e) +// { +// throw new SignatureException("IOException decoding parameters: " + e.Message); +// } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(signature.AlgorithmName, "MGF1")) + { + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("signature algorithm with MGF1"); + +// try +// { +// signature.setParameter(sigParams.getParameterSpec(PSSParameterSpec.class)); +// } +// catch (GeneralSecurityException e) +// { +// throw new SignatureException("Exception extracting parameters: " + e.getMessage()); +// } + } + } + } + + internal static string GetSignatureName( + AlgorithmIdentifier sigAlgId) + { + Asn1Encodable asn1Params = sigAlgId.Parameters; + + if (asn1Params != null && !(asn1Params is Asn1Null)) + { + if (sigAlgId.Algorithm.Equals(PkcsObjectIdentifiers.IdRsassaPss)) + { + RsassaPssParameters rsaParams = RsassaPssParameters.GetInstance(asn1Params); + return GetDigestAlgName(rsaParams.HashAlgorithm.Algorithm) + "withRSAandMGF1"; + } + } + + return sigAlgId.Algorithm.Id; + } + + private static string GetDigestAlgName( + DerObjectIdentifier digestAlgOID) + { + if (PkcsObjectIdentifiers.MD5.Equals(digestAlgOID)) + { + return "MD5"; + } + else if (OiwObjectIdentifiers.IdSha1.Equals(digestAlgOID)) + { + return "SHA1"; + } + else if (NistObjectIdentifiers.IdSha224.Equals(digestAlgOID)) + { + return "SHA224"; + } + else if (NistObjectIdentifiers.IdSha256.Equals(digestAlgOID)) + { + return "SHA256"; + } + else if (NistObjectIdentifiers.IdSha384.Equals(digestAlgOID)) + { + return "SHA384"; + } + else if (NistObjectIdentifiers.IdSha512.Equals(digestAlgOID)) + { + return "SHA512"; + } + else if (TeleTrusTObjectIdentifiers.RipeMD128.Equals(digestAlgOID)) + { + return "RIPEMD128"; + } + else if (TeleTrusTObjectIdentifiers.RipeMD160.Equals(digestAlgOID)) + { + return "RIPEMD160"; + } + else if (TeleTrusTObjectIdentifiers.RipeMD256.Equals(digestAlgOID)) + { + return "RIPEMD256"; + } + else if (CryptoProObjectIdentifiers.GostR3411.Equals(digestAlgOID)) + { + return "GOST3411"; + } + else + { + return digestAlgOID.Id; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequest.cs.meta new file mode 100644 index 00000000..7999a1ad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d42133b63178b014eb93bfce9e8655e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequestDelaySigned.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequestDelaySigned.cs new file mode 100644 index 00000000..b4ec7c64 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequestDelaySigned.cs @@ -0,0 +1,154 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Globalization; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + /// + /// A class for creating and verifying Pkcs10 Certification requests (this is an extension on ). + /// The requests are made using delay signing. This is useful for situations where + /// the private key is in another environment and not directly accessible (e.g. HSM) + /// So the first step creates the request, then the signing is done outside this + /// object and the signature is then used to complete the request. + /// + /// + /// CertificationRequest ::= Sequence { + /// certificationRequestInfo CertificationRequestInfo, + /// signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, + /// signature BIT STRING + /// } + /// + /// CertificationRequestInfo ::= Sequence { + /// version Integer { v1(0) } (v1,...), + /// subject Name, + /// subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, + /// attributes [0] Attributes{{ CRIAttributes }} + /// } + /// + /// Attributes { ATTRIBUTE:IOSet } ::= Set OF Attr{{ IOSet }} + /// + /// Attr { ATTRIBUTE:IOSet } ::= Sequence { + /// type ATTRIBUTE.&id({IOSet}), + /// values Set SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type}) + /// } + /// + /// see + public class Pkcs10CertificationRequestDelaySigned : Pkcs10CertificationRequest + { + protected Pkcs10CertificationRequestDelaySigned() + : base() + { + } + public Pkcs10CertificationRequestDelaySigned( + byte[] encoded) + : base(encoded) + { + } + public Pkcs10CertificationRequestDelaySigned( + Asn1Sequence seq) + : base(seq) + { + } + public Pkcs10CertificationRequestDelaySigned( + Stream input) + : base(input) + { + } + public Pkcs10CertificationRequestDelaySigned( + string signatureAlgorithm, + X509Name subject, + AsymmetricKeyParameter publicKey, + Asn1Set attributes, + AsymmetricKeyParameter signingKey) + : base(signatureAlgorithm, subject, publicKey, attributes, signingKey) + { + } + /// + /// Instantiate a Pkcs10CertificationRequest object with the necessary credentials. + /// + /// Name of Sig Alg. + /// X509Name of subject eg OU="My unit." O="My Organisatioin" C="au" + /// Public Key to be included in cert reqest. + /// ASN1Set of Attributes. + /// + /// After the object is constructed use the and finally the + /// SignRequest methods to finalize the request. + /// + public Pkcs10CertificationRequestDelaySigned( + string signatureAlgorithm, + X509Name subject, + AsymmetricKeyParameter publicKey, + Asn1Set attributes) + { + if (signatureAlgorithm == null) + throw new ArgumentNullException("signatureAlgorithm"); + if (subject == null) + throw new ArgumentNullException("subject"); + if (publicKey == null) + throw new ArgumentNullException("publicKey"); + if (publicKey.IsPrivate) + throw new ArgumentException("expected public key", "publicKey"); +// DerObjectIdentifier sigOid = SignerUtilities.GetObjectIdentifier(signatureAlgorithm); + string algorithmName = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(signatureAlgorithm); + DerObjectIdentifier sigOid = (DerObjectIdentifier) algorithms[algorithmName]; + if (sigOid == null) + { + try + { + sigOid = new DerObjectIdentifier(algorithmName); + } + catch (Exception e) + { + throw new ArgumentException("Unknown signature type requested", e); + } + } + if (noParams.Contains(sigOid)) + { + this.sigAlgId = new AlgorithmIdentifier(sigOid); + } + else if (exParams.Contains(algorithmName)) + { + this.sigAlgId = new AlgorithmIdentifier(sigOid, (Asn1Encodable) exParams[algorithmName]); + } + else + { + this.sigAlgId = new AlgorithmIdentifier(sigOid, DerNull.Instance); + } + SubjectPublicKeyInfo pubInfo = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey); + this.reqInfo = new CertificationRequestInfo(subject, pubInfo, attributes); + } + public byte[] GetDataToSign() + { + return reqInfo.GetDerEncoded(); + } + public void SignRequest(byte[] signedData) + { + //build the signature from the signed data + sigBits = new DerBitString(signedData); + } + public void SignRequest(DerBitString signedData) + { + //build the signature from the signed data + sigBits = signedData; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequestDelaySigned.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequestDelaySigned.cs.meta new file mode 100644 index 00000000..eb010919 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs10CertificationRequestDelaySigned.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 91787b3601b63654b83ed2aaadde6434 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Entry.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Entry.cs new file mode 100644 index 00000000..217ae96a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Entry.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + public abstract class Pkcs12Entry + { + private readonly IDictionary attributes; + + protected internal Pkcs12Entry( + IDictionary attributes) + { + this.attributes = attributes; + + foreach (DictionaryEntry entry in attributes) + { + if (!(entry.Key is string)) + throw new ArgumentException("Attribute keys must be of type: " + typeof(string).FullName, "attributes"); + if (!(entry.Value is Asn1Encodable)) + throw new ArgumentException("Attribute values must be of type: " + typeof(Asn1Encodable).FullName, "attributes"); + } + } + + [Obsolete("Use 'object[index]' syntax instead")] + public Asn1Encodable GetBagAttribute( + DerObjectIdentifier oid) + { + return (Asn1Encodable)this.attributes[oid.Id]; + } + + [Obsolete("Use 'object[index]' syntax instead")] + public Asn1Encodable GetBagAttribute( + string oid) + { + return (Asn1Encodable)this.attributes[oid]; + } + + [Obsolete("Use 'BagAttributeKeys' property")] + public IEnumerator GetBagAttributeKeys() + { + return this.attributes.Keys.GetEnumerator(); + } + + public Asn1Encodable this[ + DerObjectIdentifier oid] + { + get { return (Asn1Encodable) this.attributes[oid.Id]; } + } + + public Asn1Encodable this[ + string oid] + { + get { return (Asn1Encodable) this.attributes[oid]; } + } + + public IEnumerable BagAttributeKeys + { + get { return new EnumerableProxy(this.attributes.Keys); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Entry.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Entry.cs.meta new file mode 100644 index 00000000..5b3f66bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Entry.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b33d7051f7d07254d99adcf4f11f449f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Store.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Store.cs new file mode 100644 index 00000000..ec8a7e84 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Store.cs @@ -0,0 +1,1108 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + public class Pkcs12Store + { + private readonly IgnoresCaseHashtable keys = new IgnoresCaseHashtable(); + private readonly IDictionary localIds = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private readonly IgnoresCaseHashtable certs = new IgnoresCaseHashtable(); + private readonly IDictionary chainCerts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private readonly IDictionary keyCerts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private readonly DerObjectIdentifier keyAlgorithm; + private readonly DerObjectIdentifier certAlgorithm; + private readonly bool useDerEncoding; + + private AsymmetricKeyEntry unmarkedKeyEntry = null; + + private const int MinIterations = 1024; + private const int SaltSize = 20; + + private static SubjectKeyIdentifier CreateSubjectKeyID( + AsymmetricKeyParameter pubKey) + { + return new SubjectKeyIdentifier( + SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(pubKey)); + } + + internal class CertId + { + private readonly byte[] id; + + internal CertId( + AsymmetricKeyParameter pubKey) + { + this.id = CreateSubjectKeyID(pubKey).GetKeyIdentifier(); + } + + internal CertId( + byte[] id) + { + this.id = id; + } + + internal byte[] Id + { + get { return id; } + } + + public override int GetHashCode() + { + return Arrays.GetHashCode(id); + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + CertId other = obj as CertId; + + if (other == null) + return false; + + return Arrays.AreEqual(id, other.id); + } + } + + internal Pkcs12Store( + DerObjectIdentifier keyAlgorithm, + DerObjectIdentifier certAlgorithm, + bool useDerEncoding) + { + this.keyAlgorithm = keyAlgorithm; + this.certAlgorithm = certAlgorithm; + this.useDerEncoding = useDerEncoding; + } + + // TODO Consider making obsolete +// [Obsolete("Use 'Pkcs12StoreBuilder' instead")] + public Pkcs12Store() + : this(PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc, + PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc, false) + { + } + + // TODO Consider making obsolete +// [Obsolete("Use 'Pkcs12StoreBuilder' and 'Load' method instead")] + public Pkcs12Store( + Stream input, + char[] password) + : this() + { + Load(input, password); + } + + protected virtual void LoadKeyBag(PrivateKeyInfo privKeyInfo, Asn1Set bagAttributes) + { + AsymmetricKeyParameter privKey = PrivateKeyFactory.CreateKey(privKeyInfo); + + IDictionary attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + AsymmetricKeyEntry keyEntry = new AsymmetricKeyEntry(privKey, attributes); + + string alias = null; + Asn1OctetString localId = null; + + if (bagAttributes != null) + { + foreach (Asn1Sequence sq in bagAttributes) + { + DerObjectIdentifier aOid = DerObjectIdentifier.GetInstance(sq[0]); + Asn1Set attrSet = Asn1Set.GetInstance(sq[1]); + Asn1Encodable attr = null; + + if (attrSet.Count > 0) + { + // TODO We should be adding all attributes in the set + attr = attrSet[0]; + + // TODO We might want to "merge" attribute sets with + // the same OID - currently, differing values give an error + if (attributes.Contains(aOid.Id)) + { + // OK, but the value has to be the same + if (!attributes[aOid.Id].Equals(attr)) + throw new IOException("attempt to add existing attribute with different value"); + } + else + { + attributes.Add(aOid.Id, attr); + } + + if (aOid.Equals(PkcsObjectIdentifiers.Pkcs9AtFriendlyName)) + { + alias = ((DerBmpString)attr).GetString(); + // TODO Do these in a separate loop, just collect aliases here + keys[alias] = keyEntry; + } + else if (aOid.Equals(PkcsObjectIdentifiers.Pkcs9AtLocalKeyID)) + { + localId = (Asn1OctetString)attr; + } + } + } + } + + if (localId != null) + { + string name = Hex.ToHexString(localId.GetOctets()); + + if (alias == null) + { + keys[name] = keyEntry; + } + else + { + // TODO There may have been more than one alias + localIds[alias] = name; + } + } + else + { + unmarkedKeyEntry = keyEntry; + } + } + + protected virtual void LoadPkcs8ShroudedKeyBag(EncryptedPrivateKeyInfo encPrivKeyInfo, Asn1Set bagAttributes, + char[] password, bool wrongPkcs12Zero) + { + if (password != null) + { + PrivateKeyInfo privInfo = PrivateKeyInfoFactory.CreatePrivateKeyInfo( + password, wrongPkcs12Zero, encPrivKeyInfo); + + LoadKeyBag(privInfo, bagAttributes); + } + } + + public void Load( + Stream input, + char[] password) + { + if (input == null) + throw new ArgumentNullException("input"); + + Asn1Sequence obj = (Asn1Sequence) Asn1Object.FromStream(input); + Pfx bag = new Pfx(obj); + ContentInfo info = bag.AuthSafe; + bool wrongPkcs12Zero = false; + + if (password != null && bag.MacData != null) // check the mac code + { + MacData mData = bag.MacData; + DigestInfo dInfo = mData.Mac; + AlgorithmIdentifier algId = dInfo.AlgorithmID; + byte[] salt = mData.GetSalt(); + int itCount = mData.IterationCount.IntValue; + + byte[] data = ((Asn1OctetString) info.Content).GetOctets(); + + byte[] mac = CalculatePbeMac(algId.Algorithm, salt, itCount, password, false, data); + byte[] dig = dInfo.GetDigest(); + + if (!Arrays.ConstantTimeAreEqual(mac, dig)) + { + if (password.Length > 0) + throw new IOException("PKCS12 key store MAC invalid - wrong password or corrupted file."); + + // Try with incorrect zero length password + mac = CalculatePbeMac(algId.Algorithm, salt, itCount, password, true, data); + + if (!Arrays.ConstantTimeAreEqual(mac, dig)) + throw new IOException("PKCS12 key store MAC invalid - wrong password or corrupted file."); + + wrongPkcs12Zero = true; + } + } + + keys.Clear(); + localIds.Clear(); + unmarkedKeyEntry = null; + + IList certBags = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + if (info.ContentType.Equals(PkcsObjectIdentifiers.Data)) + { + byte[] octs = ((Asn1OctetString)info.Content).GetOctets(); + AuthenticatedSafe authSafe = new AuthenticatedSafe( + (Asn1Sequence) Asn1OctetString.FromByteArray(octs)); + ContentInfo[] cis = authSafe.GetContentInfo(); + + foreach (ContentInfo ci in cis) + { + DerObjectIdentifier oid = ci.ContentType; + + byte[] octets = null; + if (oid.Equals(PkcsObjectIdentifiers.Data)) + { + octets = ((Asn1OctetString)ci.Content).GetOctets(); + } + else if (oid.Equals(PkcsObjectIdentifiers.EncryptedData)) + { + if (password != null) + { + EncryptedData d = EncryptedData.GetInstance(ci.Content); + octets = CryptPbeData(false, d.EncryptionAlgorithm, + password, wrongPkcs12Zero, d.Content.GetOctets()); + } + } + else + { + // TODO Other data types + } + + if (octets != null) + { + Asn1Sequence seq = (Asn1Sequence)Asn1Object.FromByteArray(octets); + + foreach (Asn1Sequence subSeq in seq) + { + SafeBag b = new SafeBag(subSeq); + + if (b.BagID.Equals(PkcsObjectIdentifiers.CertBag)) + { + certBags.Add(b); + } + else if (b.BagID.Equals(PkcsObjectIdentifiers.Pkcs8ShroudedKeyBag)) + { + LoadPkcs8ShroudedKeyBag(EncryptedPrivateKeyInfo.GetInstance(b.BagValue), + b.BagAttributes, password, wrongPkcs12Zero); + } + else if (b.BagID.Equals(PkcsObjectIdentifiers.KeyBag)) + { + LoadKeyBag(PrivateKeyInfo.GetInstance(b.BagValue), b.BagAttributes); + } + else + { + // TODO Other bag types + } + } + } + } + } + + certs.Clear(); + chainCerts.Clear(); + keyCerts.Clear(); + + foreach (SafeBag b in certBags) + { + CertBag certBag = new CertBag((Asn1Sequence)b.BagValue); + byte[] octets = ((Asn1OctetString)certBag.CertValue).GetOctets(); + X509Certificate cert = new X509CertificateParser().ReadCertificate(octets); + + // + // set the attributes + // + IDictionary attributes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + Asn1OctetString localId = null; + string alias = null; + + if (b.BagAttributes != null) + { + foreach (Asn1Sequence sq in b.BagAttributes) + { + DerObjectIdentifier aOid = DerObjectIdentifier.GetInstance(sq[0]); + Asn1Set attrSet = Asn1Set.GetInstance(sq[1]); + + if (attrSet.Count > 0) + { + // TODO We should be adding all attributes in the set + Asn1Encodable attr = attrSet[0]; + + // TODO We might want to "merge" attribute sets with + // the same OID - currently, differing values give an error + if (attributes.Contains(aOid.Id)) + { + // OK, but the value has to be the same + if (!attributes[aOid.Id].Equals(attr)) + { + throw new IOException("attempt to add existing attribute with different value"); + } + } + else + { + attributes.Add(aOid.Id, attr); + } + + if (aOid.Equals(PkcsObjectIdentifiers.Pkcs9AtFriendlyName)) + { + alias = ((DerBmpString)attr).GetString(); + } + else if (aOid.Equals(PkcsObjectIdentifiers.Pkcs9AtLocalKeyID)) + { + localId = (Asn1OctetString)attr; + } + } + } + } + + CertId certId = new CertId(cert.GetPublicKey()); + X509CertificateEntry certEntry = new X509CertificateEntry(cert, attributes); + + chainCerts[certId] = certEntry; + + if (unmarkedKeyEntry != null) + { + if (keyCerts.Count == 0) + { + string name = Hex.ToHexString(certId.Id); + + keyCerts[name] = certEntry; + keys[name] = unmarkedKeyEntry; + } + else + { + keys["unmarked"] = unmarkedKeyEntry; + } + } + else + { + if (localId != null) + { + string name = Hex.ToHexString(localId.GetOctets()); + + keyCerts[name] = certEntry; + } + + if (alias != null) + { + // TODO There may have been more than one alias + certs[alias] = certEntry; + } + } + } + } + + public AsymmetricKeyEntry GetKey( + string alias) + { + if (alias == null) + throw new ArgumentNullException("alias"); + + return (AsymmetricKeyEntry)keys[alias]; + } + + public bool IsCertificateEntry( + string alias) + { + if (alias == null) + throw new ArgumentNullException("alias"); + + return (certs[alias] != null && keys[alias] == null); + } + + public bool IsKeyEntry( + string alias) + { + if (alias == null) + throw new ArgumentNullException("alias"); + + return (keys[alias] != null); + } + + private IDictionary GetAliasesTable() + { + IDictionary tab = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + foreach (string key in certs.Keys) + { + tab[key] = "cert"; + } + + foreach (string a in keys.Keys) + { + if (tab[a] == null) + { + tab[a] = "key"; + } + } + + return tab; + } + + public IEnumerable Aliases + { + get { return new EnumerableProxy(GetAliasesTable().Keys); } + } + + public bool ContainsAlias( + string alias) + { + return certs[alias] != null || keys[alias] != null; + } + + /** + * simply return the cert entry for the private key + */ + public X509CertificateEntry GetCertificate( + string alias) + { + if (alias == null) + throw new ArgumentNullException("alias"); + + X509CertificateEntry c = (X509CertificateEntry) certs[alias]; + + // + // look up the key table - and try the local key id + // + if (c == null) + { + string id = (string)localIds[alias]; + if (id != null) + { + c = (X509CertificateEntry)keyCerts[id]; + } + else + { + c = (X509CertificateEntry)keyCerts[alias]; + } + } + + return c; + } + + public string GetCertificateAlias( + X509Certificate cert) + { + if (cert == null) + throw new ArgumentNullException("cert"); + + foreach (DictionaryEntry entry in certs) + { + X509CertificateEntry entryValue = (X509CertificateEntry) entry.Value; + if (entryValue.Certificate.Equals(cert)) + { + return (string) entry.Key; + } + } + + foreach (DictionaryEntry entry in keyCerts) + { + X509CertificateEntry entryValue = (X509CertificateEntry) entry.Value; + if (entryValue.Certificate.Equals(cert)) + { + return (string) entry.Key; + } + } + + return null; + } + + public X509CertificateEntry[] GetCertificateChain( + string alias) + { + if (alias == null) + throw new ArgumentNullException("alias"); + + if (!IsKeyEntry(alias)) + { + return null; + } + + X509CertificateEntry c = GetCertificate(alias); + + if (c != null) + { + IList cs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + while (c != null) + { + X509Certificate x509c = c.Certificate; + X509CertificateEntry nextC = null; + + Asn1OctetString ext = x509c.GetExtensionValue(X509Extensions.AuthorityKeyIdentifier); + if (ext != null) + { + AuthorityKeyIdentifier id = AuthorityKeyIdentifier.GetInstance( + Asn1Object.FromByteArray(ext.GetOctets())); + + if (id.GetKeyIdentifier() != null) + { + nextC = (X509CertificateEntry) chainCerts[new CertId(id.GetKeyIdentifier())]; + } + } + + if (nextC == null) + { + // + // no authority key id, try the Issuer DN + // + X509Name i = x509c.IssuerDN; + X509Name s = x509c.SubjectDN; + + if (!i.Equivalent(s)) + { + foreach (CertId certId in chainCerts.Keys) + { + X509CertificateEntry x509CertEntry = (X509CertificateEntry) chainCerts[certId]; + + X509Certificate crt = x509CertEntry.Certificate; + + X509Name sub = crt.SubjectDN; + if (sub.Equivalent(i)) + { + try + { + x509c.Verify(crt.GetPublicKey()); + + nextC = x509CertEntry; + break; + } + catch (InvalidKeyException) + { + // TODO What if it doesn't verify? + } + } + } + } + } + + cs.Add(c); + if (nextC != c) // self signed - end of the chain + { + c = nextC; + } + else + { + c = null; + } + } + + X509CertificateEntry[] result = new X509CertificateEntry[cs.Count]; + for (int i = 0; i < cs.Count; ++i) + { + result[i] = (X509CertificateEntry)cs[i]; + } + return result; + } + + return null; + } + + public void SetCertificateEntry( + string alias, + X509CertificateEntry certEntry) + { + if (alias == null) + throw new ArgumentNullException("alias"); + if (certEntry == null) + throw new ArgumentNullException("certEntry"); + if (keys[alias] != null) + throw new ArgumentException("There is a key entry with the name " + alias + "."); + + certs[alias] = certEntry; + chainCerts[new CertId(certEntry.Certificate.GetPublicKey())] = certEntry; + } + + public void SetKeyEntry( + string alias, + AsymmetricKeyEntry keyEntry, + X509CertificateEntry[] chain) + { + if (alias == null) + throw new ArgumentNullException("alias"); + if (keyEntry == null) + throw new ArgumentNullException("keyEntry"); + if (keyEntry.Key.IsPrivate && (chain == null)) + throw new ArgumentException("No certificate chain for private key"); + + if (keys[alias] != null) + { + DeleteEntry(alias); + } + + keys[alias] = keyEntry; + certs[alias] = chain[0]; + + for (int i = 0; i != chain.Length; i++) + { + chainCerts[new CertId(chain[i].Certificate.GetPublicKey())] = chain[i]; + } + } + + public void DeleteEntry( + string alias) + { + if (alias == null) + throw new ArgumentNullException("alias"); + + AsymmetricKeyEntry k = (AsymmetricKeyEntry)keys[alias]; + if (k != null) + { + keys.Remove(alias); + } + + X509CertificateEntry c = (X509CertificateEntry)certs[alias]; + + if (c != null) + { + certs.Remove(alias); + chainCerts.Remove(new CertId(c.Certificate.GetPublicKey())); + } + + if (k != null) + { + string id = (string)localIds[alias]; + if (id != null) + { + localIds.Remove(alias); + c = (X509CertificateEntry)keyCerts[id]; + } + if (c != null) + { + keyCerts.Remove(id); + chainCerts.Remove(new CertId(c.Certificate.GetPublicKey())); + } + } + + if (c == null && k == null) + { + throw new ArgumentException("no such entry as " + alias); + } + } + + public bool IsEntryOfType( + string alias, + Type entryType) + { + if (entryType == typeof(X509CertificateEntry)) + return IsCertificateEntry(alias); + + if (entryType == typeof(AsymmetricKeyEntry)) + return IsKeyEntry(alias) && GetCertificate(alias) != null; + + return false; + } + + [Obsolete("Use 'Count' property instead")] + public int Size() + { + return Count; + } + + public int Count + { + // TODO Seems a little inefficient + get { return GetAliasesTable().Count; } + } + + public void Save( + Stream stream, + char[] password, + SecureRandom random) + { + if (stream == null) + throw new ArgumentNullException("stream"); + if (random == null) + throw new ArgumentNullException("random"); + + // + // handle the keys + // + Asn1EncodableVector keyBags = new Asn1EncodableVector(); + foreach (string name in keys.Keys) + { + byte[] kSalt = new byte[SaltSize]; + random.NextBytes(kSalt); + + AsymmetricKeyEntry privKey = (AsymmetricKeyEntry)keys[name]; + + DerObjectIdentifier bagOid; + Asn1Encodable bagData; + + if (password == null) + { + bagOid = PkcsObjectIdentifiers.KeyBag; + bagData = PrivateKeyInfoFactory.CreatePrivateKeyInfo(privKey.Key); + } + else + { + bagOid = PkcsObjectIdentifiers.Pkcs8ShroudedKeyBag; + bagData = EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo( + keyAlgorithm, password, kSalt, MinIterations, privKey.Key); + } + + Asn1EncodableVector kName = new Asn1EncodableVector(); + + foreach (string oid in privKey.BagAttributeKeys) + { + Asn1Encodable entry = privKey[oid]; + + // NB: Ignore any existing FriendlyName + if (oid.Equals(PkcsObjectIdentifiers.Pkcs9AtFriendlyName.Id)) + continue; + + kName.Add( + new DerSequence( + new DerObjectIdentifier(oid), + new DerSet(entry))); + } + + // + // make sure we are using the local alias on store + // + // NB: We always set the FriendlyName based on 'name' + //if (privKey[PkcsObjectIdentifiers.Pkcs9AtFriendlyName] == null) + { + kName.Add( + new DerSequence( + PkcsObjectIdentifiers.Pkcs9AtFriendlyName, + new DerSet(new DerBmpString(name)))); + } + + // + // make sure we have a local key-id + // + if (privKey[PkcsObjectIdentifiers.Pkcs9AtLocalKeyID] == null) + { + X509CertificateEntry ct = GetCertificate(name); + AsymmetricKeyParameter pubKey = ct.Certificate.GetPublicKey(); + SubjectKeyIdentifier subjectKeyID = CreateSubjectKeyID(pubKey); + + kName.Add( + new DerSequence( + PkcsObjectIdentifiers.Pkcs9AtLocalKeyID, + new DerSet(subjectKeyID))); + } + + keyBags.Add(new SafeBag(bagOid, bagData.ToAsn1Object(), new DerSet(kName))); + } + + byte[] keyBagsEncoding = new DerSequence(keyBags).GetDerEncoded(); + ContentInfo keysInfo = new ContentInfo(PkcsObjectIdentifiers.Data, new BerOctetString(keyBagsEncoding)); + + // + // certificate processing + // + byte[] cSalt = new byte[SaltSize]; + + random.NextBytes(cSalt); + + Asn1EncodableVector certBags = new Asn1EncodableVector(); + Pkcs12PbeParams cParams = new Pkcs12PbeParams(cSalt, MinIterations); + AlgorithmIdentifier cAlgId = new AlgorithmIdentifier(certAlgorithm, cParams.ToAsn1Object()); + ISet doneCerts = new HashSet(); + + foreach (string name in keys.Keys) + { + X509CertificateEntry certEntry = GetCertificate(name); + CertBag cBag = new CertBag( + PkcsObjectIdentifiers.X509Certificate, + new DerOctetString(certEntry.Certificate.GetEncoded())); + + Asn1EncodableVector fName = new Asn1EncodableVector(); + + foreach (string oid in certEntry.BagAttributeKeys) + { + Asn1Encodable entry = certEntry[oid]; + + // NB: Ignore any existing FriendlyName + if (oid.Equals(PkcsObjectIdentifiers.Pkcs9AtFriendlyName.Id)) + continue; + + fName.Add( + new DerSequence( + new DerObjectIdentifier(oid), + new DerSet(entry))); + } + + // + // make sure we are using the local alias on store + // + // NB: We always set the FriendlyName based on 'name' + //if (certEntry[PkcsObjectIdentifiers.Pkcs9AtFriendlyName] == null) + { + fName.Add( + new DerSequence( + PkcsObjectIdentifiers.Pkcs9AtFriendlyName, + new DerSet(new DerBmpString(name)))); + } + + // + // make sure we have a local key-id + // + if (certEntry[PkcsObjectIdentifiers.Pkcs9AtLocalKeyID] == null) + { + AsymmetricKeyParameter pubKey = certEntry.Certificate.GetPublicKey(); + SubjectKeyIdentifier subjectKeyID = CreateSubjectKeyID(pubKey); + + fName.Add( + new DerSequence( + PkcsObjectIdentifiers.Pkcs9AtLocalKeyID, + new DerSet(subjectKeyID))); + } + + certBags.Add(new SafeBag(PkcsObjectIdentifiers.CertBag, cBag.ToAsn1Object(), new DerSet(fName))); + + doneCerts.Add(certEntry.Certificate); + } + + foreach (string certId in certs.Keys) + { + X509CertificateEntry cert = (X509CertificateEntry)certs[certId]; + + if (keys[certId] != null) + continue; + + CertBag cBag = new CertBag( + PkcsObjectIdentifiers.X509Certificate, + new DerOctetString(cert.Certificate.GetEncoded())); + + Asn1EncodableVector fName = new Asn1EncodableVector(); + + foreach (string oid in cert.BagAttributeKeys) + { + // a certificate not immediately linked to a key doesn't require + // a localKeyID and will confuse some PKCS12 implementations. + // + // If we find one, we'll prune it out. + if (oid.Equals(PkcsObjectIdentifiers.Pkcs9AtLocalKeyID.Id)) + continue; + + Asn1Encodable entry = cert[oid]; + + // NB: Ignore any existing FriendlyName + if (oid.Equals(PkcsObjectIdentifiers.Pkcs9AtFriendlyName.Id)) + continue; + + fName.Add( + new DerSequence( + new DerObjectIdentifier(oid), + new DerSet(entry))); + } + + // + // make sure we are using the local alias on store + // + // NB: We always set the FriendlyName based on 'certId' + //if (cert[PkcsObjectIdentifiers.Pkcs9AtFriendlyName] == null) + { + fName.Add( + new DerSequence( + PkcsObjectIdentifiers.Pkcs9AtFriendlyName, + new DerSet(new DerBmpString(certId)))); + } + + certBags.Add(new SafeBag(PkcsObjectIdentifiers.CertBag, cBag.ToAsn1Object(), new DerSet(fName))); + + doneCerts.Add(cert.Certificate); + } + + foreach (CertId certId in chainCerts.Keys) + { + X509CertificateEntry cert = (X509CertificateEntry)chainCerts[certId]; + + if (doneCerts.Contains(cert.Certificate)) + continue; + + CertBag cBag = new CertBag( + PkcsObjectIdentifiers.X509Certificate, + new DerOctetString(cert.Certificate.GetEncoded())); + + Asn1EncodableVector fName = new Asn1EncodableVector(); + + foreach (string oid in cert.BagAttributeKeys) + { + // a certificate not immediately linked to a key doesn't require + // a localKeyID and will confuse some PKCS12 implementations. + // + // If we find one, we'll prune it out. + if (oid.Equals(PkcsObjectIdentifiers.Pkcs9AtLocalKeyID.Id)) + continue; + + fName.Add( + new DerSequence( + new DerObjectIdentifier(oid), + new DerSet(cert[oid]))); + } + + certBags.Add(new SafeBag(PkcsObjectIdentifiers.CertBag, cBag.ToAsn1Object(), new DerSet(fName))); + } + + byte[] certBagsEncoding = new DerSequence(certBags).GetDerEncoded(); + + ContentInfo certsInfo; + if (password == null) + { + certsInfo = new ContentInfo(PkcsObjectIdentifiers.Data, new BerOctetString(certBagsEncoding)); + } + else + { + byte[] certBytes = CryptPbeData(true, cAlgId, password, false, certBagsEncoding); + EncryptedData cInfo = new EncryptedData(PkcsObjectIdentifiers.Data, cAlgId, new BerOctetString(certBytes)); + certsInfo = new ContentInfo(PkcsObjectIdentifiers.EncryptedData, cInfo.ToAsn1Object()); + } + + ContentInfo[] info = new ContentInfo[]{ keysInfo, certsInfo }; + + byte[] data = new AuthenticatedSafe(info).GetEncoded( + useDerEncoding ? Asn1Encodable.Der : Asn1Encodable.Ber); + + ContentInfo mainInfo = new ContentInfo(PkcsObjectIdentifiers.Data, new BerOctetString(data)); + + // + // create the mac + // + MacData macData = null; + if (password != null) + { + byte[] mSalt = new byte[20]; + random.NextBytes(mSalt); + + byte[] mac = CalculatePbeMac(OiwObjectIdentifiers.IdSha1, + mSalt, MinIterations, password, false, data); + + AlgorithmIdentifier algId = new AlgorithmIdentifier( + OiwObjectIdentifiers.IdSha1, DerNull.Instance); + DigestInfo dInfo = new DigestInfo(algId, mac); + + macData = new MacData(dInfo, mSalt, MinIterations); + } + + // + // output the Pfx + // + Pfx pfx = new Pfx(mainInfo, macData); + + DerOutputStream derOut; + if (useDerEncoding) + { + derOut = new DerOutputStream(stream); + } + else + { + derOut = new BerOutputStream(stream); + } + + derOut.WriteObject(pfx); + } + + internal static byte[] CalculatePbeMac( + DerObjectIdentifier oid, + byte[] salt, + int itCount, + char[] password, + bool wrongPkcs12Zero, + byte[] data) + { + Asn1Encodable asn1Params = PbeUtilities.GenerateAlgorithmParameters( + oid, salt, itCount); + ICipherParameters cipherParams = PbeUtilities.GenerateCipherParameters( + oid, password, wrongPkcs12Zero, asn1Params); + + IMac mac = (IMac) PbeUtilities.CreateEngine(oid); + mac.Init(cipherParams); + return MacUtilities.DoFinal(mac, data); + } + + private static byte[] CryptPbeData( + bool forEncryption, + AlgorithmIdentifier algId, + char[] password, + bool wrongPkcs12Zero, + byte[] data) + { + IBufferedCipher cipher = PbeUtilities.CreateEngine(algId.Algorithm) as IBufferedCipher; + + if (cipher == null) + throw new Exception("Unknown encryption algorithm: " + algId.Algorithm); + + Pkcs12PbeParams pbeParameters = Pkcs12PbeParams.GetInstance(algId.Parameters); + ICipherParameters cipherParams = PbeUtilities.GenerateCipherParameters( + algId.Algorithm, password, wrongPkcs12Zero, pbeParameters); + cipher.Init(forEncryption, cipherParams); + return cipher.DoFinal(data); + } + + private class IgnoresCaseHashtable + : IEnumerable + { + private readonly IDictionary orig = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private readonly IDictionary keys = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + public void Clear() + { + orig.Clear(); + keys.Clear(); + } + + public IEnumerator GetEnumerator() + { + return orig.GetEnumerator(); + } + + public ICollection Keys + { + get { return orig.Keys; } + } + + public object Remove( + string alias) + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(alias); + string k = (string)keys[upper]; + + if (k == null) + return null; + + keys.Remove(upper); + + object o = orig[k]; + orig.Remove(k); + return o; + } + + public object this[ + string alias] + { + get + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(alias); + string k = (string)keys[upper]; + + if (k == null) + return null; + + return orig[k]; + } + set + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(alias); + string k = (string)keys[upper]; + if (k != null) + { + orig.Remove(k); + } + keys[upper] = alias; + orig[alias] = value; + } + } + + public ICollection Values + { + get { return orig.Values; } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Store.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Store.cs.meta new file mode 100644 index 00000000..480c210d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Store.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 168dce1c98ed30a41b666da9816a25c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Utilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Utilities.cs new file mode 100644 index 00000000..f32bc937 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Utilities.cs @@ -0,0 +1,81 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + /** + * Utility class for reencoding PKCS#12 files to definite length. + */ + public class Pkcs12Utilities + { + /** + * Just re-encode the outer layer of the PKCS#12 file to definite length encoding. + * + * @param berPKCS12File - original PKCS#12 file + * @return a byte array representing the DER encoding of the PFX structure + * @throws IOException + */ + public static byte[] ConvertToDefiniteLength( + byte[] berPkcs12File) + { + Pfx pfx = new Pfx(Asn1Sequence.GetInstance(Asn1Object.FromByteArray(berPkcs12File))); + + return pfx.GetEncoded(Asn1Encodable.Der); + } + + /** + * Re-encode the PKCS#12 structure to definite length encoding at the inner layer + * as well, recomputing the MAC accordingly. + * + * @param berPKCS12File - original PKCS12 file. + * @param provider - provider to use for MAC calculation. + * @return a byte array representing the DER encoding of the PFX structure. + * @throws IOException on parsing, encoding errors. + */ + public static byte[] ConvertToDefiniteLength( + byte[] berPkcs12File, + char[] passwd) + { + Pfx pfx = new Pfx(Asn1Sequence.GetInstance(Asn1Object.FromByteArray(berPkcs12File))); + + ContentInfo info = pfx.AuthSafe; + + Asn1OctetString content = Asn1OctetString.GetInstance(info.Content); + Asn1Object obj = Asn1Object.FromByteArray(content.GetOctets()); + + info = new ContentInfo(info.ContentType, new DerOctetString(obj.GetEncoded(Asn1Encodable.Der))); + + MacData mData = pfx.MacData; + + try + { + int itCount = mData.IterationCount.IntValue; + byte[] data = Asn1OctetString.GetInstance(info.Content).GetOctets(); + byte[] res = Pkcs12Store.CalculatePbeMac( + mData.Mac.AlgorithmID.Algorithm, mData.GetSalt(), itCount, passwd, false, data); + + AlgorithmIdentifier algId = new AlgorithmIdentifier( + mData.Mac.AlgorithmID.Algorithm, DerNull.Instance); + DigestInfo dInfo = new DigestInfo(algId, res); + + mData = new MacData(dInfo, mData.GetSalt(), itCount); + } + catch (Exception e) + { + throw new IOException("error constructing MAC: " + e.ToString()); + } + + pfx = new Pfx(info, mData); + + return pfx.GetEncoded(Asn1Encodable.Der); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Utilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Utilities.cs.meta new file mode 100644 index 00000000..6ebf168e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/Pkcs12Utilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 351095fcda1b7be4fa4bc49f38ce24d7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PrivateKeyInfoFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PrivateKeyInfoFactory.cs new file mode 100644 index 00000000..2b7631bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PrivateKeyInfoFactory.cs @@ -0,0 +1,253 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.EdEC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + public sealed class PrivateKeyInfoFactory + { + private PrivateKeyInfoFactory() + { + } + + public static PrivateKeyInfo CreatePrivateKeyInfo( + AsymmetricKeyParameter privateKey) + { + return CreatePrivateKeyInfo(privateKey, null); + } + + /** + * Create a PrivateKeyInfo representation of a private key with attributes. + * + * @param privateKey the key to be encoded into the info object. + * @param attributes the set of attributes to be included. + * @return the appropriate PrivateKeyInfo + * @throws java.io.IOException on an error encoding the key + */ + public static PrivateKeyInfo CreatePrivateKeyInfo(AsymmetricKeyParameter privateKey, Asn1Set attributes) + { + if (privateKey == null) + throw new ArgumentNullException("privateKey"); + if (!privateKey.IsPrivate) + throw new ArgumentException("Public key passed - private key expected", "privateKey"); + + if (privateKey is ElGamalPrivateKeyParameters) + { + ElGamalPrivateKeyParameters _key = (ElGamalPrivateKeyParameters)privateKey; + ElGamalParameters egp = _key.Parameters; + return new PrivateKeyInfo( + new AlgorithmIdentifier(OiwObjectIdentifiers.ElGamalAlgorithm, new ElGamalParameter(egp.P, egp.G).ToAsn1Object()), + new DerInteger(_key.X), + attributes); + } + + if (privateKey is DsaPrivateKeyParameters) + { + DsaPrivateKeyParameters _key = (DsaPrivateKeyParameters)privateKey; + DsaParameters dp = _key.Parameters; + return new PrivateKeyInfo( + new AlgorithmIdentifier(X9ObjectIdentifiers.IdDsa, new DsaParameter(dp.P, dp.Q, dp.G).ToAsn1Object()), + new DerInteger(_key.X), + attributes); + } + + if (privateKey is DHPrivateKeyParameters) + { + DHPrivateKeyParameters _key = (DHPrivateKeyParameters)privateKey; + + DHParameter p = new DHParameter( + _key.Parameters.P, _key.Parameters.G, _key.Parameters.L); + + return new PrivateKeyInfo( + new AlgorithmIdentifier(_key.AlgorithmOid, p.ToAsn1Object()), + new DerInteger(_key.X), + attributes); + } + + if (privateKey is RsaKeyParameters) + { + AlgorithmIdentifier algID = new AlgorithmIdentifier( + PkcsObjectIdentifiers.RsaEncryption, DerNull.Instance); + + RsaPrivateKeyStructure keyStruct; + if (privateKey is RsaPrivateCrtKeyParameters) + { + RsaPrivateCrtKeyParameters _key = (RsaPrivateCrtKeyParameters)privateKey; + + keyStruct = new RsaPrivateKeyStructure( + _key.Modulus, + _key.PublicExponent, + _key.Exponent, + _key.P, + _key.Q, + _key.DP, + _key.DQ, + _key.QInv); + } + else + { + RsaKeyParameters _key = (RsaKeyParameters) privateKey; + + keyStruct = new RsaPrivateKeyStructure( + _key.Modulus, + BigInteger.Zero, + _key.Exponent, + BigInteger.Zero, + BigInteger.Zero, + BigInteger.Zero, + BigInteger.Zero, + BigInteger.Zero); + } + + return new PrivateKeyInfo(algID, keyStruct.ToAsn1Object(), attributes); + } + + if (privateKey is ECPrivateKeyParameters) + { + ECPrivateKeyParameters priv = (ECPrivateKeyParameters)privateKey; + DerBitString publicKey = new DerBitString(ECKeyPairGenerator.GetCorrespondingPublicKey(priv).Q.GetEncoded(false)); + + ECDomainParameters dp = priv.Parameters; + int orderBitLength = dp.N.BitLength; + + AlgorithmIdentifier algID; + ECPrivateKeyStructure ec; + + if (priv.AlgorithmName == "ECGOST3410") + { + if (priv.PublicKeyParamSet == null) + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("Not a CryptoPro parameter set"); + + Gost3410PublicKeyAlgParameters gostParams = new Gost3410PublicKeyAlgParameters( + priv.PublicKeyParamSet, CryptoProObjectIdentifiers.GostR3411x94CryptoProParamSet); + + algID = new AlgorithmIdentifier(CryptoProObjectIdentifiers.GostR3410x2001, gostParams); + + // TODO Do we need to pass any parameters here? + ec = new ECPrivateKeyStructure(orderBitLength, priv.D, publicKey, null); + } + else + { + X962Parameters x962; + if (priv.PublicKeyParamSet == null) + { + X9ECParameters ecP = new X9ECParameters(dp.Curve, dp.G, dp.N, dp.H, dp.GetSeed()); + x962 = new X962Parameters(ecP); + } + else + { + x962 = new X962Parameters(priv.PublicKeyParamSet); + } + + ec = new ECPrivateKeyStructure(orderBitLength, priv.D, publicKey, x962); + + algID = new AlgorithmIdentifier(X9ObjectIdentifiers.IdECPublicKey, x962); + } + + return new PrivateKeyInfo(algID, ec, attributes); + } + + if (privateKey is Gost3410PrivateKeyParameters) + { + Gost3410PrivateKeyParameters _key = (Gost3410PrivateKeyParameters)privateKey; + + if (_key.PublicKeyParamSet == null) + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("Not a CryptoPro parameter set"); + + byte[] keyEnc = _key.X.ToByteArrayUnsigned(); + byte[] keyBytes = new byte[keyEnc.Length]; + + for (int i = 0; i != keyBytes.Length; i++) + { + keyBytes[i] = keyEnc[keyEnc.Length - 1 - i]; // must be little endian + } + + Gost3410PublicKeyAlgParameters algParams = new Gost3410PublicKeyAlgParameters( + _key.PublicKeyParamSet, CryptoProObjectIdentifiers.GostR3411x94CryptoProParamSet, null); + + AlgorithmIdentifier algID = new AlgorithmIdentifier( + CryptoProObjectIdentifiers.GostR3410x94, + algParams.ToAsn1Object()); + + return new PrivateKeyInfo(algID, new DerOctetString(keyBytes), attributes); + } + + if (privateKey is X448PrivateKeyParameters) + { + X448PrivateKeyParameters key = (X448PrivateKeyParameters)privateKey; + + return new PrivateKeyInfo(new AlgorithmIdentifier(EdECObjectIdentifiers.id_X448), + new DerOctetString(key.GetEncoded()), attributes, key.GeneratePublicKey().GetEncoded()); + } + + if (privateKey is X25519PrivateKeyParameters) + { + X25519PrivateKeyParameters key = (X25519PrivateKeyParameters)privateKey; + + return new PrivateKeyInfo(new AlgorithmIdentifier(EdECObjectIdentifiers.id_X25519), + new DerOctetString(key.GetEncoded()), attributes, key.GeneratePublicKey().GetEncoded()); + } + + if (privateKey is Ed448PrivateKeyParameters) + { + Ed448PrivateKeyParameters key = (Ed448PrivateKeyParameters)privateKey; + + return new PrivateKeyInfo(new AlgorithmIdentifier(EdECObjectIdentifiers.id_Ed448), + new DerOctetString(key.GetEncoded()), attributes, key.GeneratePublicKey().GetEncoded()); + } + + if (privateKey is Ed25519PrivateKeyParameters) + { + Ed25519PrivateKeyParameters key = (Ed25519PrivateKeyParameters)privateKey; + + return new PrivateKeyInfo(new AlgorithmIdentifier(EdECObjectIdentifiers.id_Ed25519), + new DerOctetString(key.GetEncoded()), attributes, key.GeneratePublicKey().GetEncoded()); + } + + throw new ArgumentException("Class provided is not convertible: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(privateKey)); + } + + public static PrivateKeyInfo CreatePrivateKeyInfo( + char[] passPhrase, + EncryptedPrivateKeyInfo encInfo) + { + return CreatePrivateKeyInfo(passPhrase, false, encInfo); + } + + public static PrivateKeyInfo CreatePrivateKeyInfo( + char[] passPhrase, + bool wrongPkcs12Zero, + EncryptedPrivateKeyInfo encInfo) + { + AlgorithmIdentifier algID = encInfo.EncryptionAlgorithm; + + IBufferedCipher cipher = PbeUtilities.CreateEngine(algID) as IBufferedCipher; + if (cipher == null) + throw new Exception("Unknown encryption algorithm: " + algID.Algorithm); + + ICipherParameters cipherParameters = PbeUtilities.GenerateCipherParameters( + algID, passPhrase, wrongPkcs12Zero); + cipher.Init(false, cipherParameters); + byte[] keyBytes = cipher.DoFinal(encInfo.GetEncryptedData()); + + return PrivateKeyInfo.GetInstance(keyBytes); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PrivateKeyInfoFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PrivateKeyInfoFactory.cs.meta new file mode 100644 index 00000000..d1230885 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/PrivateKeyInfoFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: da0b98ec65ab9bd4bae18ff7fbf50ed5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/X509CertificateEntry.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/X509CertificateEntry.cs new file mode 100644 index 00000000..f9b71e7f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/X509CertificateEntry.cs @@ -0,0 +1,64 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs +{ + public class X509CertificateEntry + : Pkcs12Entry + { + private readonly X509Certificate cert; + + public X509CertificateEntry( + X509Certificate cert) + : base(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable()) + { + this.cert = cert; + } + +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + [Obsolete] + public X509CertificateEntry( + X509Certificate cert, + Hashtable attributes) + : base(attributes) + { + this.cert = cert; + } +#endif + + public X509CertificateEntry( + X509Certificate cert, + IDictionary attributes) + : base(attributes) + { + this.cert = cert; + } + + public X509Certificate Certificate + { + get { return this.cert; } + } + + public override bool Equals(object obj) + { + X509CertificateEntry other = obj as X509CertificateEntry; + + if (other == null) + return false; + + return cert.Equals(other.cert); + } + + public override int GetHashCode() + { + return ~cert.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/X509CertificateEntry.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/X509CertificateEntry.cs.meta new file mode 100644 index 00000000..d89466d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkcs/X509CertificateEntry.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0cf80bddefc53c47951df6aac435e62 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix.meta new file mode 100644 index 00000000..f949ee78 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a5512fac3c819e1408d5495e0b9d5eb9 +folderAsset: yes +timeCreated: 1547039641 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/CertStatus.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/CertStatus.cs new file mode 100644 index 00000000..13c88d46 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/CertStatus.cs @@ -0,0 +1,39 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + public class CertStatus + { + public const int Unrevoked = 11; + + public const int Undetermined = 12; + + private int status = Unrevoked; + + DateTimeObject revocationDate = null; + + /// + /// Returns the revocationDate. + /// + public DateTimeObject RevocationDate + { + get { return revocationDate; } + set { this.revocationDate = value; } + } + + /// + /// Returns the certStatus. + /// + public int Status + { + get { return status; } + set { this.status = value; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/CertStatus.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/CertStatus.cs.meta new file mode 100644 index 00000000..2c281262 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/CertStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12be79f326e3a844f80690ca3213a20a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertChecker.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertChecker.cs new file mode 100644 index 00000000..71cc3cb9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertChecker.cs @@ -0,0 +1,61 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + public abstract class PkixAttrCertChecker + { + /** + * Returns an immutable Set of X.509 attribute certificate + * extensions that this PkixAttrCertChecker supports or + * null if no extensions are supported. + *

    + * Each element of the set is a String representing the + * Object Identifier (OID) of the X.509 extension that is supported. + *

    + *

    + * All X.509 attribute certificate extensions that a + * PkixAttrCertChecker might possibly be able to process + * should be included in the set. + *

    + * + * @return an immutable Set of X.509 extension OIDs (in + * String format) supported by this + * PkixAttrCertChecker, or null if no + * extensions are supported + */ + public abstract ISet GetSupportedExtensions(); + + /** + * Performs checks on the specified attribute certificate. Every handled + * extension is rmeoved from the unresolvedCritExts + * collection. + * + * @param attrCert The attribute certificate to be checked. + * @param certPath The certificate path which belongs to the attribute + * certificate issuer public key certificate. + * @param holderCertPath The certificate path which belongs to the holder + * certificate. + * @param unresolvedCritExts a Collection of OID strings + * representing the current set of unresolved critical extensions + * @throws CertPathValidatorException if the specified attribute certificate + * does not pass the check. + */ + public abstract void Check(IX509AttributeCertificate attrCert, PkixCertPath certPath, + PkixCertPath holderCertPath, ICollection unresolvedCritExts); + + /** + * Returns a clone of this object. + * + * @return a copy of this PkixAttrCertChecker + */ + public abstract PkixAttrCertChecker Clone(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertChecker.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertChecker.cs.meta new file mode 100644 index 00000000..e7b3ae9a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertChecker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55a8146ee5b463942b785a1ef6c9b129 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathBuilder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathBuilder.cs new file mode 100644 index 00000000..b5d834b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathBuilder.cs @@ -0,0 +1,219 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + public class PkixAttrCertPathBuilder + { + /** + * Build and validate a CertPath using the given parameter. + * + * @param params PKIXBuilderParameters object containing all information to + * build the CertPath + */ + public virtual PkixCertPathBuilderResult Build( + PkixBuilderParameters pkixParams) + { + // search target certificates + + IX509Selector certSelect = pkixParams.GetTargetConstraints(); + if (!(certSelect is X509AttrCertStoreSelector)) + { + throw new PkixCertPathBuilderException( + "TargetConstraints must be an instance of " + + typeof(X509AttrCertStoreSelector).FullName + + " for " + + typeof(PkixAttrCertPathBuilder).FullName + " class."); + } + + ICollection targets; + try + { + targets = PkixCertPathValidatorUtilities.FindCertificates( + (X509AttrCertStoreSelector)certSelect, pkixParams.GetStores()); + } + catch (Exception e) + { + throw new PkixCertPathBuilderException("Error finding target attribute certificate.", e); + } + + if (targets.Count == 0) + { + throw new PkixCertPathBuilderException( + "No attribute certificate found matching targetContraints."); + } + + PkixCertPathBuilderResult result = null; + + // check all potential target certificates + foreach (IX509AttributeCertificate cert in targets) + { + X509CertStoreSelector selector = new X509CertStoreSelector(); + X509Name[] principals = cert.Issuer.GetPrincipals(); + ISet issuers = new HashSet(); + for (int i = 0; i < principals.Length; i++) + { + try + { + selector.Subject = principals[i]; + + issuers.AddAll(PkixCertPathValidatorUtilities.FindCertificates(selector, pkixParams.GetStores())); + } + catch (Exception e) + { + throw new PkixCertPathBuilderException( + "Public key certificate for attribute certificate cannot be searched.", + e); + } + } + + if (issuers.IsEmpty) + throw new PkixCertPathBuilderException("Public key certificate for attribute certificate cannot be found."); + + IList certPathList = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + foreach (X509Certificate issuer in issuers) + { + result = Build(cert, issuer, pkixParams, certPathList); + + if (result != null) + break; + } + + if (result != null) + break; + } + + if (result == null && certPathException != null) + { + throw new PkixCertPathBuilderException( + "Possible certificate chain could not be validated.", + certPathException); + } + + if (result == null && certPathException == null) + { + throw new PkixCertPathBuilderException( + "Unable to find certificate chain."); + } + + return result; + } + + private Exception certPathException; + + private PkixCertPathBuilderResult Build( + IX509AttributeCertificate attrCert, + X509Certificate tbvCert, + PkixBuilderParameters pkixParams, + IList tbvPath) + { + // If tbvCert is readily present in tbvPath, it indicates having run + // into a cycle in the + // PKI graph. + if (tbvPath.Contains(tbvCert)) + return null; + + // step out, the certificate is not allowed to appear in a certification + // chain + if (pkixParams.GetExcludedCerts().Contains(tbvCert)) + return null; + + // test if certificate path exceeds maximum length + if (pkixParams.MaxPathLength != -1) + { + if (tbvPath.Count - 1 > pkixParams.MaxPathLength) + return null; + } + + tbvPath.Add(tbvCert); + + PkixCertPathBuilderResult builderResult = null; + +// X509CertificateParser certParser = new X509CertificateParser(); + PkixAttrCertPathValidator validator = new PkixAttrCertPathValidator(); + + try + { + // check whether the issuer of is a TrustAnchor + if (PkixCertPathValidatorUtilities.IsIssuerTrustAnchor(tbvCert, pkixParams.GetTrustAnchors())) + { + PkixCertPath certPath = new PkixCertPath(tbvPath); + PkixCertPathValidatorResult result; + + try + { + result = validator.Validate(certPath, pkixParams); + } + catch (Exception e) + { + throw new Exception("Certification path could not be validated.", e); + } + + return new PkixCertPathBuilderResult(certPath, result.TrustAnchor, + result.PolicyTree, result.SubjectPublicKey); + } + else + { + // add additional X.509 stores from locations in certificate + try + { + PkixCertPathValidatorUtilities.AddAdditionalStoresFromAltNames(tbvCert, pkixParams); + } + catch (CertificateParsingException e) + { + throw new Exception("No additional X.509 stores can be added from certificate locations.", e); + } + + // try to get the issuer certificate from one of the stores + ISet issuers = new HashSet(); + try + { + issuers.AddAll(PkixCertPathValidatorUtilities.FindIssuerCerts(tbvCert, pkixParams)); + } + catch (Exception e) + { + throw new Exception("Cannot find issuer certificate for certificate in certification path.", e); + } + + if (issuers.IsEmpty) + throw new Exception("No issuer certificate for certificate in certification path found."); + + foreach (X509Certificate issuer in issuers) + { + // if untrusted self signed certificate continue + if (PkixCertPathValidatorUtilities.IsSelfIssued(issuer)) + continue; + + builderResult = Build(attrCert, issuer, pkixParams, tbvPath); + + if (builderResult != null) + break; + } + } + } + catch (Exception e) + { + certPathException = new Exception("No valid certification path could be build.", e); + } + + if (builderResult == null) + { + tbvPath.Remove(tbvCert); + } + + return builderResult; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathBuilder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathBuilder.cs.meta new file mode 100644 index 00000000..9bcbbb77 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ecee7bdcfcd47514897052237429c5fa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathValidator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathValidator.cs new file mode 100644 index 00000000..4e91f63f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathValidator.cs @@ -0,0 +1,80 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /** + * CertPathValidatorSpi implementation for X.509 Attribute Certificates la RFC 3281. + * + * @see org.bouncycastle.x509.ExtendedPkixParameters + */ + public class PkixAttrCertPathValidator + // extends CertPathValidatorSpi + { + /** + * Validates an attribute certificate with the given certificate path. + * + *

    + * params must be an instance of + * ExtendedPkixParameters. + *

    + * The target constraints in the params must be an + * X509AttrCertStoreSelector with at least the attribute + * certificate criterion set. Obey that also target informations may be + * necessary to correctly validate this attribute certificate. + *

    + * The attribute certificate issuer must be added to the trusted attribute + * issuers with {@link ExtendedPkixParameters#setTrustedACIssuers(Set)}. + *

    + * @param certPath The certificate path which belongs to the attribute + * certificate issuer public key certificate. + * @param params The PKIX parameters. + * @return A PKIXCertPathValidatorResult of the result of + * validating the certPath. + * @throws InvalidAlgorithmParameterException if params is + * inappropriate for this validator. + * @throws CertPathValidatorException if the verification fails. + */ + public virtual PkixCertPathValidatorResult Validate( + PkixCertPath certPath, + PkixParameters pkixParams) + { + IX509Selector certSelect = pkixParams.GetTargetConstraints(); + if (!(certSelect is X509AttrCertStoreSelector)) + { + throw new ArgumentException( + "TargetConstraints must be an instance of " + typeof(X509AttrCertStoreSelector).FullName, + "pkixParams"); + } + IX509AttributeCertificate attrCert = ((X509AttrCertStoreSelector) certSelect).AttributeCert; + + PkixCertPath holderCertPath = Rfc3281CertPathUtilities.ProcessAttrCert1(attrCert, pkixParams); + PkixCertPathValidatorResult result = Rfc3281CertPathUtilities.ProcessAttrCert2(certPath, pkixParams); + X509Certificate issuerCert = (X509Certificate)certPath.Certificates[0]; + Rfc3281CertPathUtilities.ProcessAttrCert3(issuerCert, pkixParams); + Rfc3281CertPathUtilities.ProcessAttrCert4(issuerCert, pkixParams); + Rfc3281CertPathUtilities.ProcessAttrCert5(attrCert, pkixParams); + // 6 already done in X509AttrCertStoreSelector + Rfc3281CertPathUtilities.ProcessAttrCert7(attrCert, certPath, holderCertPath, pkixParams); + Rfc3281CertPathUtilities.AdditionalChecks(attrCert, pkixParams); + DateTime date; + try + { + date = PkixCertPathValidatorUtilities.GetValidCertDateFromValidityModel(pkixParams, null, -1); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Could not get validity date from attribute certificate.", e); + } + Rfc3281CertPathUtilities.CheckCrls(attrCert, pkixParams, issuerCert, date, certPath.Certificates); + return result; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathValidator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathValidator.cs.meta new file mode 100644 index 00000000..f59abde0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixAttrCertPathValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 85b76d91e2248a64191df671fb900d8b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixBuilderParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixBuilderParameters.cs new file mode 100644 index 00000000..8a0ab7c5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixBuilderParameters.cs @@ -0,0 +1,144 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /// + /// Summary description for PkixBuilderParameters. + /// + public class PkixBuilderParameters + : PkixParameters + { + private int maxPathLength = 5; + + private ISet excludedCerts = new HashSet(); + + /** + * Returns an instance of PkixBuilderParameters. + *

    + * This method can be used to get a copy from other + * PKIXBuilderParameters, PKIXParameters, + * and ExtendedPKIXParameters instances. + *

    + * + * @param pkixParams The PKIX parameters to create a copy of. + * @return An PkixBuilderParameters instance. + */ + public static PkixBuilderParameters GetInstance( + PkixParameters pkixParams) + { + PkixBuilderParameters parameters = new PkixBuilderParameters( + pkixParams.GetTrustAnchors(), + new X509CertStoreSelector(pkixParams.GetTargetCertConstraints())); + parameters.SetParams(pkixParams); + return parameters; + } + + public PkixBuilderParameters( + ISet trustAnchors, + IX509Selector targetConstraints) + : base(trustAnchors) + { + SetTargetCertConstraints(targetConstraints); + } + + public virtual int MaxPathLength + { + get { return maxPathLength; } + set + { + if (value < -1) + { + throw new InvalidParameterException( + "The maximum path length parameter can not be less than -1."); + } + this.maxPathLength = value; + } + } + + /// + /// Excluded certificates are not used for building a certification path. + /// + /// the excluded certificates. + public virtual ISet GetExcludedCerts() + { + return new HashSet(excludedCerts); + } + + /// + /// Sets the excluded certificates which are not used for building a + /// certification path. If the ISet is null an + /// empty set is assumed. + /// + /// + /// The given set is cloned to protect it against subsequent modifications. + /// + /// The excluded certificates to set. + public virtual void SetExcludedCerts( + ISet excludedCerts) + { + if (excludedCerts == null) + { + excludedCerts = new HashSet(); + } + else + { + this.excludedCerts = new HashSet(excludedCerts); + } + } + + /** + * Can alse handle ExtendedPKIXBuilderParameters and + * PKIXBuilderParameters. + * + * @param params Parameters to set. + * @see org.bouncycastle.x509.ExtendedPKIXParameters#setParams(java.security.cert.PKIXParameters) + */ + protected override void SetParams( + PkixParameters parameters) + { + base.SetParams(parameters); + if (parameters is PkixBuilderParameters) + { + PkixBuilderParameters _params = (PkixBuilderParameters) parameters; + maxPathLength = _params.maxPathLength; + excludedCerts = new HashSet(_params.excludedCerts); + } + } + + /** + * Makes a copy of this PKIXParameters object. Changes to the + * copy will not affect the original and vice versa. + * + * @return a copy of this PKIXParameters object + */ + public override object Clone() + { + PkixBuilderParameters parameters = new PkixBuilderParameters( + GetTrustAnchors(), GetTargetCertConstraints()); + parameters.SetParams(this); + return parameters; + } + + public override string ToString() + { + string nl = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + StringBuilder s = new StringBuilder(); + s.Append("PkixBuilderParameters [" + nl); + s.Append(base.ToString()); + s.Append(" Maximum Path Length: "); + s.Append(MaxPathLength); + s.Append(nl + "]" + nl); + return s.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixBuilderParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixBuilderParameters.cs.meta new file mode 100644 index 00000000..6f51b544 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixBuilderParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4976f361ba4e5544681c44a8ec8d928c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPath.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPath.cs new file mode 100644 index 00000000..c1f2787f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPath.cs @@ -0,0 +1,464 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.OpenSsl; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /** + * An immutable sequence of certificates (a certification path).
    + *
    + * This is an abstract class that defines the methods common to all CertPaths. + * Subclasses can handle different kinds of certificates (X.509, PGP, etc.).
    + *
    + * All CertPath objects have a type, a list of Certificates, and one or more + * supported encodings. Because the CertPath class is immutable, a CertPath + * cannot change in any externally visible way after being constructed. This + * stipulation applies to all public fields and methods of this class and any + * added or overridden by subclasses.
    + *
    + * The type is a string that identifies the type of Certificates in the + * certification path. For each certificate cert in a certification path + * certPath, cert.getType().equals(certPath.getType()) must be true.
    + *
    + * The list of Certificates is an ordered List of zero or more Certificates. + * This List and all of the Certificates contained in it must be immutable.
    + *
    + * Each CertPath object must support one or more encodings so that the object + * can be translated into a byte array for storage or transmission to other + * parties. Preferably, these encodings should be well-documented standards + * (such as PKCS#7). One of the encodings supported by a CertPath is considered + * the default encoding. This encoding is used if no encoding is explicitly + * requested (for the {@link #getEncoded()} method, for instance).
    + *
    + * All CertPath objects are also Serializable. CertPath objects are resolved + * into an alternate {@link CertPathRep} object during serialization. This + * allows a CertPath object to be serialized into an equivalent representation + * regardless of its underlying implementation.
    + *
    + * CertPath objects can be created with a CertificateFactory or they can be + * returned by other classes, such as a CertPathBuilder.
    + *
    + * By convention, X.509 CertPaths (consisting of X509Certificates), are ordered + * starting with the target certificate and ending with a certificate issued by + * the trust anchor. That is, the issuer of one certificate is the subject of + * the following one. The certificate representing the + * {@link TrustAnchor TrustAnchor} should not be included in the certification + * path. Unvalidated X.509 CertPaths may not follow these conventions. PKIX + * CertPathValidators will detect any departure from these conventions that + * cause the certification path to be invalid and throw a + * CertPathValidatorException.
    + *
    + * Concurrent Access
    + *
    + * All CertPath objects must be thread-safe. That is, multiple threads may + * concurrently invoke the methods defined in this class on a single CertPath + * object (or more than one) with no ill effects. This is also true for the List + * returned by CertPath.getCertificates.
    + *
    + * Requiring CertPath objects to be immutable and thread-safe allows them to be + * passed around to various pieces of code without worrying about coordinating + * access. Providing this thread-safety is generally not difficult, since the + * CertPath and List objects in question are immutable. + * + * @see CertificateFactory + * @see CertPathBuilder + */ + /// + /// CertPath implementation for X.509 certificates. + /// + public class PkixCertPath +// : CertPath + { + internal static readonly IList certPathEncodings; + + static PkixCertPath() + { + IList encodings = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + encodings.Add("PkiPath"); + encodings.Add("PEM"); + encodings.Add("PKCS7"); + certPathEncodings = CollectionUtilities.ReadOnly(encodings); + } + + private readonly IList certificates; + + /** + * @param certs + */ + private static IList SortCerts( + IList certs) + { + if (certs.Count < 2) + return certs; + + X509Name issuer = ((X509Certificate)certs[0]).IssuerDN; + bool okay = true; + + for (int i = 1; i != certs.Count; i++) + { + X509Certificate cert = (X509Certificate)certs[i]; + + if (issuer.Equivalent(cert.SubjectDN, true)) + { + issuer = ((X509Certificate)certs[i]).IssuerDN; + } + else + { + okay = false; + break; + } + } + + if (okay) + return certs; + + // find end-entity cert + IList retList = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(certs.Count); + IList orig = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(certs); + + for (int i = 0; i < certs.Count; i++) + { + X509Certificate cert = (X509Certificate)certs[i]; + bool found = false; + + X509Name subject = cert.SubjectDN; + foreach (X509Certificate c in certs) + { + if (c.IssuerDN.Equivalent(subject, true)) + { + found = true; + break; + } + } + + if (!found) + { + retList.Add(cert); + certs.RemoveAt(i); + } + } + + // can only have one end entity cert - something's wrong, give up. + if (retList.Count > 1) + return orig; + + for (int i = 0; i != retList.Count; i++) + { + issuer = ((X509Certificate)retList[i]).IssuerDN; + + for (int j = 0; j < certs.Count; j++) + { + X509Certificate c = (X509Certificate)certs[j]; + if (issuer.Equivalent(c.SubjectDN, true)) + { + retList.Add(c); + certs.RemoveAt(j); + break; + } + } + } + + // make sure all certificates are accounted for. + if (certs.Count > 0) + return orig; + + return retList; + } + + /** + * Creates a CertPath of the specified type. + * This constructor is protected because most users should use + * a CertificateFactory to create CertPaths. + * @param type the standard name of the type of Certificatesin this path + **/ + public PkixCertPath( + ICollection certificates) +// : base("X.509") + { + this.certificates = SortCerts(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(certificates)); + } + + public PkixCertPath( + Stream inStream) + : this(inStream, "PkiPath") + { + } + + /** + * Creates a CertPath of the specified type. + * This constructor is protected because most users should use + * a CertificateFactory to create CertPaths. + * + * @param type the standard name of the type of Certificatesin this path + **/ + public PkixCertPath( + Stream inStream, + string encoding) +// : base("X.509") + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(encoding); + + IList certs; + try + { + if (upper.Equals(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant("PkiPath"))) + { + Asn1InputStream derInStream = new Asn1InputStream(inStream); + Asn1Object derObject = derInStream.ReadObject(); + if (!(derObject is Asn1Sequence)) + { + throw new CertificateException( + "input stream does not contain a ASN1 SEQUENCE while reading PkiPath encoded data to load CertPath"); + } + + certs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + foreach (Asn1Encodable ae in (Asn1Sequence)derObject) + { + byte[] derBytes = ae.GetEncoded(Asn1Encodable.Der); + Stream certInStream = new MemoryStream(derBytes, false); + + // TODO Is inserting at the front important (list will be sorted later anyway)? + certs.Insert(0, new X509CertificateParser().ReadCertificate(certInStream)); + } + } + else if (upper.Equals("PKCS7") || upper.Equals("PEM")) + { + certs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(new X509CertificateParser().ReadCertificates(inStream)); + } + else + { + throw new CertificateException("unsupported encoding: " + encoding); + } + } + catch (IOException ex) + { + throw new CertificateException( + "IOException throw while decoding CertPath:\n" + + ex.ToString()); + } + + this.certificates = SortCerts(certs); + } + + /** + * Returns an iteration of the encodings supported by this + * certification path, with the default encoding + * first. Attempts to modify the returned Iterator via its + * remove method result in an UnsupportedOperationException. + * + * @return an Iterator over the names of the supported encodings (as Strings) + **/ + public virtual IEnumerable Encodings + { + get { return new EnumerableProxy(certPathEncodings); } + } + + /** + * Compares this certification path for equality with the specified object. + * Two CertPaths are equal if and only if their types are equal and their + * certificate Lists (and by implication the Certificates in those Lists) + * are equal. A CertPath is never equal to an object that is not a CertPath.
    + *
    + * This algorithm is implemented by this method. If it is overridden, the + * behavior specified here must be maintained. + * + * @param other + * the object to test for equality with this certification path + * + * @return true if the specified object is equal to this certification path, + * false otherwise + * + * @see Object#hashCode() Object.hashCode() + */ + public override bool Equals( + object obj) + { + if (this == obj) + return true; + + PkixCertPath other = obj as PkixCertPath; + if (other == null) + return false; + +// if (!this.Type.Equals(other.Type)) +// return false; + + //return this.Certificates.Equals(other.Certificates); + + // TODO Extract this to a utility class + IList thisCerts = this.Certificates; + IList otherCerts = other.Certificates; + + if (thisCerts.Count != otherCerts.Count) + return false; + + IEnumerator e1 = thisCerts.GetEnumerator(); + IEnumerator e2 = thisCerts.GetEnumerator(); + + while (e1.MoveNext()) + { + e2.MoveNext(); + + if (!BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(e1.Current, e2.Current)) + return false; + } + + return true; + } + + public override int GetHashCode() + { + // FIXME? + return this.Certificates.GetHashCode(); + } + + /** + * Returns the encoded form of this certification path, using + * the default encoding. + * + * @return the encoded bytes + * @exception CertificateEncodingException if an encoding error occurs + **/ + public virtual byte[] GetEncoded() + { + foreach (object enc in Encodings) + { + if (enc is string) + { + return GetEncoded((string)enc); + } + } + return null; + } + + /** + * Returns the encoded form of this certification path, using + * the specified encoding. + * + * @param encoding the name of the encoding to use + * @return the encoded bytes + * @exception CertificateEncodingException if an encoding error + * occurs or the encoding requested is not supported + * + */ + public virtual byte[] GetEncoded( + string encoding) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(encoding, "PkiPath")) + { + Asn1EncodableVector v = new Asn1EncodableVector(); + + for (int i = certificates.Count - 1; i >= 0; i--) + { + v.Add(ToAsn1Object((X509Certificate) certificates[i])); + } + + return ToDerEncoded(new DerSequence(v)); + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(encoding, "PKCS7")) + { + Asn1.Pkcs.ContentInfo encInfo = new Asn1.Pkcs.ContentInfo( + PkcsObjectIdentifiers.Data, null); + + Asn1EncodableVector v = new Asn1EncodableVector(); + for (int i = 0; i != certificates.Count; i++) + { + v.Add(ToAsn1Object((X509Certificate)certificates[i])); + } + + Asn1.Pkcs.SignedData sd = new Asn1.Pkcs.SignedData( + new DerInteger(1), + new DerSet(), + encInfo, + new DerSet(v), + null, + new DerSet()); + + return ToDerEncoded(new Asn1.Pkcs.ContentInfo(PkcsObjectIdentifiers.SignedData, sd)); + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(encoding, "PEM")) + { + MemoryStream bOut = new MemoryStream(); + PemWriter pWrt = new PemWriter(new StreamWriter(bOut)); + + try + { + for (int i = 0; i != certificates.Count; i++) + { + pWrt.WriteObject(certificates[i]); + } + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(pWrt.Writer); + } + catch (Exception) + { + throw new CertificateEncodingException("can't encode certificate for PEM encoded path"); + } + + return bOut.ToArray(); + } + else + { + throw new CertificateEncodingException("unsupported encoding: " + encoding); + } + } + + /// + /// Returns the list of certificates in this certification + /// path. + /// + public virtual IList Certificates + { + get { return CollectionUtilities.ReadOnly(certificates); } + } + + /** + * Return a DERObject containing the encoded certificate. + * + * @param cert the X509Certificate object to be encoded + * + * @return the DERObject + **/ + private Asn1Object ToAsn1Object( + X509Certificate cert) + { + try + { + return Asn1Object.FromByteArray(cert.GetEncoded()); + } + catch (Exception e) + { + throw new CertificateEncodingException("Exception while encoding certificate", e); + } + } + + private byte[] ToDerEncoded(Asn1Encodable obj) + { + try + { + return obj.GetEncoded(Asn1Encodable.Der); + } + catch (IOException e) + { + throw new CertificateEncodingException("Exception thrown", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPath.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPath.cs.meta new file mode 100644 index 00000000..32468725 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPath.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 565bdea7eb2a46d40ad29b81bc563819 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilder.cs new file mode 100644 index 00000000..58331568 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilder.cs @@ -0,0 +1,209 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X500; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /** + * Implements the PKIX CertPathBuilding algorithm for BouncyCastle. + * + * @see CertPathBuilderSpi + */ + public class PkixCertPathBuilder + // : CertPathBuilderSpi + { + /** + * Build and validate a CertPath using the given parameter. + * + * @param params PKIXBuilderParameters object containing all information to + * build the CertPath + */ + public virtual PkixCertPathBuilderResult Build( + PkixBuilderParameters pkixParams) + { + // search target certificates + + IX509Selector certSelect = pkixParams.GetTargetCertConstraints(); + if (!(certSelect is X509CertStoreSelector)) + { + throw new PkixCertPathBuilderException( + "TargetConstraints must be an instance of " + + typeof(X509CertStoreSelector).FullName + " for " + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(this) + " class."); + } + + ISet targets = new HashSet(); + try + { + targets.AddAll(PkixCertPathValidatorUtilities.FindCertificates((X509CertStoreSelector)certSelect, pkixParams.GetStores())); + // TODO Should this include an entry for pkixParams.GetAdditionalStores() too? + } + catch (Exception e) + { + throw new PkixCertPathBuilderException( + "Error finding target certificate.", e); + } + + if (targets.IsEmpty) + throw new PkixCertPathBuilderException("No certificate found matching targetContraints."); + + PkixCertPathBuilderResult result = null; + IList certPathList = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + // check all potential target certificates + foreach (X509Certificate cert in targets) + { + result = Build(cert, pkixParams, certPathList); + + if (result != null) + break; + } + + if (result == null && certPathException != null) + { + throw new PkixCertPathBuilderException(certPathException.Message, certPathException.InnerException); + } + + if (result == null && certPathException == null) + { + throw new PkixCertPathBuilderException("Unable to find certificate chain."); + } + + return result; + } + + private Exception certPathException; + + protected virtual PkixCertPathBuilderResult Build( + X509Certificate tbvCert, + PkixBuilderParameters pkixParams, + IList tbvPath) + { + // If tbvCert is readily present in tbvPath, it indicates having run + // into a cycle in the PKI graph. + if (tbvPath.Contains(tbvCert)) + return null; + + // step out, the certificate is not allowed to appear in a certification + // chain. + if (pkixParams.GetExcludedCerts().Contains(tbvCert)) + return null; + + // test if certificate path exceeds maximum length + if (pkixParams.MaxPathLength != -1) + { + if (tbvPath.Count - 1 > pkixParams.MaxPathLength) + return null; + } + + tbvPath.Add(tbvCert); + +// X509CertificateParser certParser = new X509CertificateParser(); + PkixCertPathBuilderResult builderResult = null; + PkixCertPathValidator validator = new PkixCertPathValidator(); + + try + { + // check whether the issuer of is a TrustAnchor + if (PkixCertPathValidatorUtilities.IsIssuerTrustAnchor(tbvCert, pkixParams.GetTrustAnchors())) + { + // exception message from possibly later tried certification + // chains + PkixCertPath certPath = null; + try + { + certPath = new PkixCertPath(tbvPath); + } + catch (Exception e) + { + throw new Exception( + "Certification path could not be constructed from certificate list.", + e); + } + + PkixCertPathValidatorResult result = null; + try + { + result = (PkixCertPathValidatorResult)validator.Validate( + certPath, pkixParams); + } + catch (Exception e) + { + throw new Exception( + "Certification path could not be validated.", e); + } + + return new PkixCertPathBuilderResult(certPath, result.TrustAnchor, + result.PolicyTree, result.SubjectPublicKey); + } + else + { + // add additional X.509 stores from locations in certificate + try + { + PkixCertPathValidatorUtilities.AddAdditionalStoresFromAltNames( + tbvCert, pkixParams); + } + catch (CertificateParsingException e) + { + throw new Exception( + "No additiontal X.509 stores can be added from certificate locations.", + e); + } + + // try to get the issuer certificate from one of the stores + HashSet issuers = new HashSet(); + try + { + issuers.AddAll(PkixCertPathValidatorUtilities.FindIssuerCerts(tbvCert, pkixParams)); + } + catch (Exception e) + { + throw new Exception( + "Cannot find issuer certificate for certificate in certification path.", + e); + } + + if (issuers.IsEmpty) + throw new Exception("No issuer certificate for certificate in certification path found."); + + foreach (X509Certificate issuer in issuers) + { + builderResult = Build(issuer, pkixParams, tbvPath); + + if (builderResult != null) + break; + } + } + } + catch (Exception e) + { + certPathException = e; + } + + if (builderResult == null) + { + tbvPath.Remove(tbvCert); + } + + return builderResult; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilder.cs.meta new file mode 100644 index 00000000..fa3a861a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b141fdaa90999d4f848152c584ce4e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderException.cs new file mode 100644 index 00000000..6bf59052 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderException.cs @@ -0,0 +1,26 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /// + /// Summary description for PkixCertPathBuilderException. + /// +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class PkixCertPathBuilderException : GeneralSecurityException + { + public PkixCertPathBuilderException() : base() { } + + public PkixCertPathBuilderException(string message) : base(message) { } + + public PkixCertPathBuilderException(string message, Exception exception) : base(message, exception) { } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderException.cs.meta new file mode 100644 index 00000000..e719ad6a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 25a59fe00cb35544dbfaae6c24af2f68 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderResult.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderResult.cs new file mode 100644 index 00000000..5e93dff0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderResult.cs @@ -0,0 +1,49 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /// + /// Summary description for PkixCertPathBuilderResult. + /// + public class PkixCertPathBuilderResult + : PkixCertPathValidatorResult//, ICertPathBuilderResult + { + private PkixCertPath certPath; + + public PkixCertPathBuilderResult( + PkixCertPath certPath, + TrustAnchor trustAnchor, + PkixPolicyNode policyTree, + AsymmetricKeyParameter subjectPublicKey) + : base(trustAnchor, policyTree, subjectPublicKey) + { + if (certPath == null) + throw new ArgumentNullException("certPath"); + + this.certPath = certPath; + } + + public PkixCertPath CertPath + { + get { return certPath; } + } + + public override string ToString() + { + StringBuilder s = new StringBuilder(); + s.Append("SimplePKIXCertPathBuilderResult: [\n"); + s.Append(" Certification Path: ").Append(CertPath).Append('\n'); + s.Append(" Trust Anchor: ").Append(this.TrustAnchor.TrustedCert.IssuerDN.ToString()).Append('\n'); + s.Append(" Subject Public Key: ").Append(this.SubjectPublicKey).Append("\n]"); + return s.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderResult.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderResult.cs.meta new file mode 100644 index 00000000..9df5ca33 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathBuilderResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5bb663b8ed6b4c04ead1d50f1b83b3f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathChecker.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathChecker.cs new file mode 100644 index 00000000..476ec4cd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathChecker.cs @@ -0,0 +1,103 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + public abstract class PkixCertPathChecker + { + protected PkixCertPathChecker() + { + } + + /** + * Initializes the internal state of this PKIXCertPathChecker. + *

    + * The forward flag specifies the order that certificates + * will be passed to the {@link #check check} method (forward or reverse). A + * PKIXCertPathChecker must support reverse checking + * and may support forward checking. + *

    + * + * @param forward + * the order that certificates are presented to the + * check method. If true, + * certificates are presented from target to most-trusted CA + * (forward); if false, from most-trusted CA to + * target (reverse). + * @exception CertPathValidatorException + * if this PKIXCertPathChecker is unable to + * check certificates in the specified order; it should never + * be thrown if the forward flag is false since reverse + * checking must be supported + */ + public abstract void Init(bool forward); + //throws CertPathValidatorException; + + /** + * Indicates if forward checking is supported. Forward checking refers to + * the ability of the PKIXCertPathChecker to perform its + * checks when certificates are presented to the check method + * in the forward direction (from target to most-trusted CA). + * + * @return true if forward checking is supported, + * false otherwise + */ + public abstract bool IsForwardCheckingSupported(); + + /** + * Returns an immutable Set of X.509 certificate extensions + * that this PKIXCertPathChecker supports (i.e. recognizes, + * is able to process), or null if no extensions are + * supported. + *

    + * Each element of the set is a String representing the + * Object Identifier (OID) of the X.509 extension that is supported. The OID + * is represented by a set of nonnegative integers separated by periods. + *

    + * All X.509 certificate extensions that a PKIXCertPathChecker + * might possibly be able to process should be included in the set. + *

    + * + * @return an immutable Set of X.509 extension OIDs (in + * String format) supported by this + * PKIXCertPathChecker, or null if no + * extensions are supported + */ + public abstract ISet GetSupportedExtensions(); + + /** + * Performs the check(s) on the specified certificate using its internal + * state and removes any critical extensions that it processes from the + * specified collection of OID strings that represent the unresolved + * critical extensions. The certificates are presented in the order + * specified by the init method. + * + * @param cert + * the Certificate to be checked + * @param unresolvedCritExts + * a Collection of OID strings representing the + * current set of unresolved critical extensions + * @exception CertPathValidatorException + * if the specified certificate does not pass the check + */ + public abstract void Check(X509Certificate cert, ISet unresolvedCritExts); + //throws CertPathValidatorException; + + /** + * Returns a clone of this object. Calls the Object.clone() + * method. All subclasses which maintain state must support and override + * this method, if necessary. + * + * @return a copy of this PKIXCertPathChecker + */ + public virtual object Clone() + { + // TODO Check this + return base.MemberwiseClone(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathChecker.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathChecker.cs.meta new file mode 100644 index 00000000..34f746c5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathChecker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43f01d4bd4f27a943bb693735147c260 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidator.cs new file mode 100644 index 00000000..792bc29d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidator.cs @@ -0,0 +1,452 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /** + * The Service Provider Interface (SPI) + * for the {@link CertPathValidator CertPathValidator} class. All + * CertPathValidator implementations must include a class (the + * SPI class) that extends this class (CertPathValidatorSpi) + * and implements all of its methods. In general, instances of this class + * should only be accessed through the CertPathValidator class. + * For details, see the Java Cryptography Architecture.
    + *
    + * Concurrent Access
    + *
    + * Instances of this class need not be protected against concurrent + * access from multiple threads. Threads that need to access a single + * CertPathValidatorSpi instance concurrently should synchronize + * amongst themselves and provide the necessary locking before calling the + * wrapping CertPathValidator object.
    + *
    + * However, implementations of CertPathValidatorSpi may still + * encounter concurrency issues, since multiple threads each + * manipulating a different CertPathValidatorSpi instance need not + * synchronize. + */ + /// + /// CertPathValidatorSpi implementation for X.509 Certificate validation a la RFC + /// 3280. + /// + public class PkixCertPathValidator + { + public virtual PkixCertPathValidatorResult Validate( + PkixCertPath certPath, + PkixParameters paramsPkix) + { + if (paramsPkix.GetTrustAnchors() == null) + { + throw new ArgumentException( + "trustAnchors is null, this is not allowed for certification path validation.", + "parameters"); + } + + // + // 6.1.1 - inputs + // + + // + // (a) + // + IList certs = certPath.Certificates; + int n = certs.Count; + + if (certs.Count == 0) + throw new PkixCertPathValidatorException("Certification path is empty.", null, certPath, 0); + + // + // (b) + // + // DateTime validDate = PkixCertPathValidatorUtilities.GetValidDate(paramsPkix); + + // + // (c) + // + ISet userInitialPolicySet = paramsPkix.GetInitialPolicies(); + + // + // (d) + // + TrustAnchor trust; + try + { + trust = PkixCertPathValidatorUtilities.FindTrustAnchor( + (X509Certificate)certs[certs.Count - 1], + paramsPkix.GetTrustAnchors()); + + if (trust == null) + throw new PkixCertPathValidatorException("Trust anchor for certification path not found.", null, certPath, -1); + + CheckCertificate(trust.TrustedCert); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException(e.Message, e.InnerException, certPath, certs.Count - 1); + } + + // + // (e), (f), (g) are part of the paramsPkix object. + // + IEnumerator certIter; + int index = 0; + int i; + // Certificate for each interation of the validation loop + // Signature information for each iteration of the validation loop + // + // 6.1.2 - setup + // + + // + // (a) + // + IList[] policyNodes = new IList[n + 1]; + for (int j = 0; j < policyNodes.Length; j++) + { + policyNodes[j] = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + } + + ISet policySet = new HashSet(); + + policySet.Add(Rfc3280CertPathUtilities.ANY_POLICY); + + PkixPolicyNode validPolicyTree = new PkixPolicyNode(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(), 0, policySet, null, new HashSet(), + Rfc3280CertPathUtilities.ANY_POLICY, false); + + policyNodes[0].Add(validPolicyTree); + + // + // (b) and (c) + // + PkixNameConstraintValidator nameConstraintValidator = new PkixNameConstraintValidator(); + + // (d) + // + int explicitPolicy; + ISet acceptablePolicies = new HashSet(); + + if (paramsPkix.IsExplicitPolicyRequired) + { + explicitPolicy = 0; + } + else + { + explicitPolicy = n + 1; + } + + // + // (e) + // + int inhibitAnyPolicy; + + if (paramsPkix.IsAnyPolicyInhibited) + { + inhibitAnyPolicy = 0; + } + else + { + inhibitAnyPolicy = n + 1; + } + + // + // (f) + // + int policyMapping; + + if (paramsPkix.IsPolicyMappingInhibited) + { + policyMapping = 0; + } + else + { + policyMapping = n + 1; + } + + // + // (g), (h), (i), (j) + // + AsymmetricKeyParameter workingPublicKey; + X509Name workingIssuerName; + + X509Certificate sign = trust.TrustedCert; + try + { + if (sign != null) + { + workingIssuerName = sign.SubjectDN; + workingPublicKey = sign.GetPublicKey(); + } + else + { + workingIssuerName = new X509Name(trust.CAName); + workingPublicKey = trust.CAPublicKey; + } + } + catch (ArgumentException ex) + { + throw new PkixCertPathValidatorException("Subject of trust anchor could not be (re)encoded.", ex, certPath, + -1); + } + + AlgorithmIdentifier workingAlgId = null; + try + { + workingAlgId = PkixCertPathValidatorUtilities.GetAlgorithmIdentifier(workingPublicKey); + } + catch (PkixCertPathValidatorException e) + { + throw new PkixCertPathValidatorException( + "Algorithm identifier of public key of trust anchor could not be read.", e, certPath, -1); + } + +// DerObjectIdentifier workingPublicKeyAlgorithm = workingAlgId.Algorithm; +// Asn1Encodable workingPublicKeyParameters = workingAlgId.Parameters; + + // + // (k) + // + int maxPathLength = n; + + // + // 6.1.3 + // + + X509CertStoreSelector certConstraints = paramsPkix.GetTargetCertConstraints(); + if (certConstraints != null && !certConstraints.Match((X509Certificate)certs[0])) + { + throw new PkixCertPathValidatorException( + "Target certificate in certification path does not match targetConstraints.", null, certPath, 0); + } + + // + // initialize CertPathChecker's + // + IList pathCheckers = paramsPkix.GetCertPathCheckers(); + certIter = pathCheckers.GetEnumerator(); + + while (certIter.MoveNext()) + { + ((PkixCertPathChecker)certIter.Current).Init(false); + } + + X509Certificate cert = null; + + for (index = certs.Count - 1; index >= 0; index--) + { + // try + // { + // + // i as defined in the algorithm description + // + i = n - index; + + // + // set certificate to be checked in this round + // sign and workingPublicKey and workingIssuerName are set + // at the end of the for loop and initialized the + // first time from the TrustAnchor + // + cert = (X509Certificate)certs[index]; + + try + { + CheckCertificate(cert); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException(e.Message, e.InnerException, certPath, index); + } + + // + // 6.1.3 + // + + Rfc3280CertPathUtilities.ProcessCertA(certPath, paramsPkix, index, workingPublicKey, + workingIssuerName, sign); + + Rfc3280CertPathUtilities.ProcessCertBC(certPath, index, nameConstraintValidator); + + validPolicyTree = Rfc3280CertPathUtilities.ProcessCertD(certPath, index, + acceptablePolicies, validPolicyTree, policyNodes, inhibitAnyPolicy); + + validPolicyTree = Rfc3280CertPathUtilities.ProcessCertE(certPath, index, validPolicyTree); + + Rfc3280CertPathUtilities.ProcessCertF(certPath, index, validPolicyTree, explicitPolicy); + + // + // 6.1.4 + // + + if (i != n) + { + if (cert != null && cert.Version == 1) + { + // we've found the trust anchor at the top of the path, ignore and keep going + if ((i == 1) && cert.Equals(trust.TrustedCert)) + continue; + + throw new PkixCertPathValidatorException( + "Version 1 certificates can't be used as CA ones.", null, certPath, index); + } + + Rfc3280CertPathUtilities.PrepareNextCertA(certPath, index); + + validPolicyTree = Rfc3280CertPathUtilities.PrepareCertB(certPath, index, policyNodes, + validPolicyTree, policyMapping); + + Rfc3280CertPathUtilities.PrepareNextCertG(certPath, index, nameConstraintValidator); + + // (h) + explicitPolicy = Rfc3280CertPathUtilities.PrepareNextCertH1(certPath, index, explicitPolicy); + policyMapping = Rfc3280CertPathUtilities.PrepareNextCertH2(certPath, index, policyMapping); + inhibitAnyPolicy = Rfc3280CertPathUtilities.PrepareNextCertH3(certPath, index, inhibitAnyPolicy); + + // + // (i) + // + explicitPolicy = Rfc3280CertPathUtilities.PrepareNextCertI1(certPath, index, explicitPolicy); + policyMapping = Rfc3280CertPathUtilities.PrepareNextCertI2(certPath, index, policyMapping); + + // (j) + inhibitAnyPolicy = Rfc3280CertPathUtilities.PrepareNextCertJ(certPath, index, inhibitAnyPolicy); + + // (k) + Rfc3280CertPathUtilities.PrepareNextCertK(certPath, index); + + // (l) + maxPathLength = Rfc3280CertPathUtilities.PrepareNextCertL(certPath, index, maxPathLength); + + // (m) + maxPathLength = Rfc3280CertPathUtilities.PrepareNextCertM(certPath, index, maxPathLength); + + // (n) + Rfc3280CertPathUtilities.PrepareNextCertN(certPath, index); + + ISet criticalExtensions1 = cert.GetCriticalExtensionOids(); + + if (criticalExtensions1 != null) + { + criticalExtensions1 = new HashSet(criticalExtensions1); + + // these extensions are handled by the algorithm + criticalExtensions1.Remove(X509Extensions.KeyUsage.Id); + criticalExtensions1.Remove(X509Extensions.CertificatePolicies.Id); + criticalExtensions1.Remove(X509Extensions.PolicyMappings.Id); + criticalExtensions1.Remove(X509Extensions.InhibitAnyPolicy.Id); + criticalExtensions1.Remove(X509Extensions.IssuingDistributionPoint.Id); + criticalExtensions1.Remove(X509Extensions.DeltaCrlIndicator.Id); + criticalExtensions1.Remove(X509Extensions.PolicyConstraints.Id); + criticalExtensions1.Remove(X509Extensions.BasicConstraints.Id); + criticalExtensions1.Remove(X509Extensions.SubjectAlternativeName.Id); + criticalExtensions1.Remove(X509Extensions.NameConstraints.Id); + } + else + { + criticalExtensions1 = new HashSet(); + } + + // (o) + Rfc3280CertPathUtilities.PrepareNextCertO(certPath, index, criticalExtensions1, pathCheckers); + + // set signing certificate for next round + sign = cert; + + // (c) + workingIssuerName = sign.SubjectDN; + + // (d) + try + { + workingPublicKey = PkixCertPathValidatorUtilities.GetNextWorkingKey(certPath.Certificates, index); + } + catch (PkixCertPathValidatorException e) + { + throw new PkixCertPathValidatorException("Next working key could not be retrieved.", e, certPath, index); + } + + workingAlgId = PkixCertPathValidatorUtilities.GetAlgorithmIdentifier(workingPublicKey); + // (f) +// workingPublicKeyAlgorithm = workingAlgId.Algorithm; + // (e) +// workingPublicKeyParameters = workingAlgId.Parameters; + } + } + + // + // 6.1.5 Wrap-up procedure + // + + explicitPolicy = Rfc3280CertPathUtilities.WrapupCertA(explicitPolicy, cert); + + explicitPolicy = Rfc3280CertPathUtilities.WrapupCertB(certPath, index + 1, explicitPolicy); + + // + // (c) (d) and (e) are already done + // + + // + // (f) + // + ISet criticalExtensions = cert.GetCriticalExtensionOids(); + + if (criticalExtensions != null) + { + criticalExtensions = new HashSet(criticalExtensions); + + // Requires .Id + // these extensions are handled by the algorithm + criticalExtensions.Remove(X509Extensions.KeyUsage.Id); + criticalExtensions.Remove(X509Extensions.CertificatePolicies.Id); + criticalExtensions.Remove(X509Extensions.PolicyMappings.Id); + criticalExtensions.Remove(X509Extensions.InhibitAnyPolicy.Id); + criticalExtensions.Remove(X509Extensions.IssuingDistributionPoint.Id); + criticalExtensions.Remove(X509Extensions.DeltaCrlIndicator.Id); + criticalExtensions.Remove(X509Extensions.PolicyConstraints.Id); + criticalExtensions.Remove(X509Extensions.BasicConstraints.Id); + criticalExtensions.Remove(X509Extensions.SubjectAlternativeName.Id); + criticalExtensions.Remove(X509Extensions.NameConstraints.Id); + criticalExtensions.Remove(X509Extensions.CrlDistributionPoints.Id); + } + else + { + criticalExtensions = new HashSet(); + } + + Rfc3280CertPathUtilities.WrapupCertF(certPath, index + 1, pathCheckers, criticalExtensions); + + PkixPolicyNode intersection = Rfc3280CertPathUtilities.WrapupCertG(certPath, paramsPkix, userInitialPolicySet, + index + 1, policyNodes, validPolicyTree, acceptablePolicies); + + if ((explicitPolicy > 0) || (intersection != null)) + { + return new PkixCertPathValidatorResult(trust, intersection, cert.GetPublicKey()); + } + + throw new PkixCertPathValidatorException("Path processing failed on policy.", null, certPath, index); + } + + internal static void CheckCertificate(X509Certificate cert) + { + try + { + TbsCertificateStructure.GetInstance(cert.CertificateStructure.TbsCertificate); + } + catch (CertificateEncodingException e) + { + throw new Exception("unable to process TBSCertificate", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidator.cs.meta new file mode 100644 index 00000000..f4940c1b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1230039d20abc264894f233518e57548 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorException.cs new file mode 100644 index 00000000..742ef214 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorException.cs @@ -0,0 +1,225 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /** + * An exception indicating one of a variety of problems encountered when + * validating a certification path.
    + *
    + * A CertPathValidatorException provides support for wrapping + * exceptions. The {@link #getCause getCause} method returns the throwable, + * if any, that caused this exception to be thrown.
    + *
    + * A CertPathValidatorException may also include the + * certification path that was being validated when the exception was thrown + * and the index of the certificate in the certification path that caused the + * exception to be thrown. Use the {@link #getCertPath getCertPath} and + * {@link #getIndex getIndex} methods to retrieve this information.
    + *
    + * Concurrent Access
    + *
    + * Unless otherwise specified, the methods defined in this class are not + * thread-safe. Multiple threads that need to access a single + * object concurrently should synchronize amongst themselves and + * provide the necessary locking. Multiple threads each manipulating + * separate objects need not synchronize. + * + * @see CertPathValidator + **/ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class PkixCertPathValidatorException + : GeneralSecurityException + { + private Exception cause; + private PkixCertPath certPath; + private int index = -1; + + public PkixCertPathValidatorException() : base() { } + + /// + /// Creates a PkixCertPathValidatorException with the given detail + /// message. A detail message is a String that describes this + /// particular exception. + /// + /// the detail message + public PkixCertPathValidatorException(string message) : base(message) { } + + /// + /// Creates a PkixCertPathValidatorException with the specified + /// detail message and cause. + /// + /// the detail message + /// the cause (which is saved for later retrieval by the + /// {@link #getCause getCause()} method). (A null + /// value is permitted, and indicates that the cause is + /// nonexistent or unknown.) + public PkixCertPathValidatorException(string message, Exception cause) : base(message) + { + this.cause = cause; + } + + /// + /// Creates a PkixCertPathValidatorException with the specified + /// detail message, cause, certification path, and index. + /// + /// the detail message (or null if none) + /// the cause (or null if none) + /// the certification path that was in the process of being + /// validated when the error was encountered + /// the index of the certificate in the certification path that * + public PkixCertPathValidatorException( + string message, + Exception cause, + PkixCertPath certPath, + int index) + : base(message) + { + if (certPath == null && index != -1) + { + throw new ArgumentNullException( + "certPath = null and index != -1"); + } + if (index < -1 + || (certPath != null && index >= certPath.Certificates.Count)) + { + throw new IndexOutOfRangeException( + " index < -1 or out of bound of certPath.getCertificates()"); + } + + this.cause = cause; + this.certPath = certPath; + this.index = index; + } + + // + // Prints a stack trace to a PrintWriter, including the + // backtrace of the cause, if any. + // + // @param pw + // the PrintWriter to use for output + // + // public void printStackTrace(PrintWriter pw) + // { + // super.printStackTrace(pw); + // if (getCause() != null) + // { + // getCause().printStackTrace(pw); + // } + // } + //} + + + // /** + // * Creates a CertPathValidatorException that wraps the + // * specified throwable. This allows any exception to be converted into a + // * CertPathValidatorException, while retaining information + // * about the wrapped exception, which may be useful for debugging. The + // * detail message is set to (cause==null ? null : cause.toString() + // * ) + // * (which typically contains the class and detail message of cause). + // * + // * @param cause + // * the cause (which is saved for later retrieval by the + // * {@link #getCause getCause()} method). (A null + // * value is permitted, and indicates that the cause is + // * nonexistent or unknown.) + // */ + // public PkixCertPathValidatorException(Throwable cause) + // { + // this.cause = cause; + // } + // + + /// + /// Returns the detail message for this CertPathValidatorException. + /// + /// the detail message, or null if neither the message nor cause were specified + public override string Message + { + get + { + string message = base.Message; + + if (message != null) + { + return message; + } + + if (cause != null) + { + return cause.Message; + } + + return null; + } + } + + /** + * Returns the certification path that was being validated when the + * exception was thrown. + * + * @return the CertPath that was being validated when the + * exception was thrown (or null if not specified) + */ + public PkixCertPath CertPath + { + get { return certPath; } + } + + /** + * Returns the index of the certificate in the certification path that + * caused the exception to be thrown. Note that the list of certificates in + * a CertPath is zero based. If no index has been set, -1 is + * returned. + * + * @return the index that has been set, or -1 if none has been set + */ + public int Index + { + get { return index; } + } + +// /** +// * Returns the cause of this CertPathValidatorException or +// * null if the cause is nonexistent or unknown. +// * +// * @return the cause of this throwable or null if the cause +// * is nonexistent or unknown. +// */ +// public Throwable getCause() +// { +// return cause; +// } +// +// /** +// * Returns a string describing this exception, including a description of +// * the internal (wrapped) cause if there is one. +// * +// * @return a string representation of this +// * CertPathValidatorException +// */ +// public String toString() +// { +// StringBuffer sb = new StringBuffer(); +// String s = getMessage(); +// if (s != null) +// { +// sb.append(s); +// } +// if (getIndex() >= 0) +// { +// sb.append("index in certpath: ").append(getIndex()).append('\n'); +// sb.append(getCertPath()); +// } +// return sb.toString(); +// } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorException.cs.meta new file mode 100644 index 00000000..b4521bf5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db2fbbf90588ea041ab1bf5b62f86bea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorResult.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorResult.cs new file mode 100644 index 00000000..c9132df6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorResult.cs @@ -0,0 +1,73 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /// + /// Summary description for PkixCertPathValidatorResult. + /// + public class PkixCertPathValidatorResult + //: ICertPathValidatorResult + { + private TrustAnchor trustAnchor; + private PkixPolicyNode policyTree; + private AsymmetricKeyParameter subjectPublicKey; + + public PkixPolicyNode PolicyTree + { + get { return this.policyTree; } + } + + public TrustAnchor TrustAnchor + { + get { return this.trustAnchor; } + } + + public AsymmetricKeyParameter SubjectPublicKey + { + get { return this.subjectPublicKey; } + } + + public PkixCertPathValidatorResult( + TrustAnchor trustAnchor, + PkixPolicyNode policyTree, + AsymmetricKeyParameter subjectPublicKey) + { + if (subjectPublicKey == null) + { + throw new NullReferenceException("subjectPublicKey must be non-null"); + } + if (trustAnchor == null) + { + throw new NullReferenceException("trustAnchor must be non-null"); + } + + this.trustAnchor = trustAnchor; + this.policyTree = policyTree; + this.subjectPublicKey = subjectPublicKey; + } + + public object Clone() + { + return new PkixCertPathValidatorResult(this.TrustAnchor, this.PolicyTree, this.SubjectPublicKey); + } + + public override String ToString() + { + StringBuilder sB = new StringBuilder(); + sB.Append("PKIXCertPathValidatorResult: [ \n"); + sB.Append(" Trust Anchor: ").Append(this.TrustAnchor).Append('\n'); + sB.Append(" Policy Tree: ").Append(this.PolicyTree).Append('\n'); + sB.Append(" Subject Public Key: ").Append(this.SubjectPublicKey).Append("\n]"); + return sB.ToString(); + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorResult.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorResult.cs.meta new file mode 100644 index 00000000..3bb041cb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorResult.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f0872050d12dad44abb76c1745b5f870 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorUtilities.cs new file mode 100644 index 00000000..af67e95e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorUtilities.cs @@ -0,0 +1,1212 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.IsisMtt; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /// + /// Summary description for PkixCertPathValidatorUtilities. + /// + public class PkixCertPathValidatorUtilities + { + private static readonly PkixCrlUtilities CrlUtilities = new PkixCrlUtilities(); + + internal static readonly string ANY_POLICY = "2.5.29.32.0"; + + internal static readonly string CRL_NUMBER = X509Extensions.CrlNumber.Id; + + /// + /// key usage bits + /// + internal static readonly int KEY_CERT_SIGN = 5; + internal static readonly int CRL_SIGN = 6; + + internal static readonly string[] crlReasons = new string[] + { + "unspecified", + "keyCompromise", + "cACompromise", + "affiliationChanged", + "superseded", + "cessationOfOperation", + "certificateHold", + "unknown", + "removeFromCRL", + "privilegeWithdrawn", + "aACompromise" + }; + + /// + /// Search the given Set of TrustAnchor's for one that is the + /// issuer of the given X509 certificate. + /// + /// the X509 certificate + /// a Set of TrustAnchor's + /// the TrustAnchor object if found or + /// null if not. + /// + /// @exception + internal static TrustAnchor FindTrustAnchor( + X509Certificate cert, + ISet trustAnchors) + { + IEnumerator iter = trustAnchors.GetEnumerator(); + TrustAnchor trust = null; + AsymmetricKeyParameter trustPublicKey = null; + Exception invalidKeyEx = null; + + X509CertStoreSelector certSelectX509 = new X509CertStoreSelector(); + + try + { + certSelectX509.Subject = GetIssuerPrincipal(cert); + } + catch (IOException ex) + { + throw new Exception("Cannot set subject search criteria for trust anchor.", ex); + } + + while (iter.MoveNext() && trust == null) + { + trust = (TrustAnchor) iter.Current; + if (trust.TrustedCert != null) + { + if (certSelectX509.Match(trust.TrustedCert)) + { + trustPublicKey = trust.TrustedCert.GetPublicKey(); + } + else + { + trust = null; + } + } + else if (trust.CAName != null && trust.CAPublicKey != null) + { + try + { + X509Name certIssuer = GetIssuerPrincipal(cert); + X509Name caName = new X509Name(trust.CAName); + + if (certIssuer.Equivalent(caName, true)) + { + trustPublicKey = trust.CAPublicKey; + } + else + { + trust = null; + } + } + catch (InvalidParameterException) + { + trust = null; + } + } + else + { + trust = null; + } + + if (trustPublicKey != null) + { + try + { + cert.Verify(trustPublicKey); + } + catch (Exception ex) + { + invalidKeyEx = ex; + trust = null; + } + } + } + + if (trust == null && invalidKeyEx != null) + { + throw new Exception("TrustAnchor found but certificate validation failed.", invalidKeyEx); + } + + return trust; + } + + internal static bool IsIssuerTrustAnchor( + X509Certificate cert, + ISet trustAnchors) + { + try + { + return FindTrustAnchor(cert, trustAnchors) != null; + } + catch (Exception e) + { + return false; + } + } + + internal static void AddAdditionalStoresFromAltNames( + X509Certificate cert, + PkixParameters pkixParams) + { + // if in the IssuerAltName extension an URI + // is given, add an additinal X.509 store + if (cert.GetIssuerAlternativeNames() != null) + { + IEnumerator it = cert.GetIssuerAlternativeNames().GetEnumerator(); + while (it.MoveNext()) + { + // look for URI + IList list = (IList)it.Current; + //if (list[0].Equals(new Integer(GeneralName.UniformResourceIdentifier))) + if (list[0].Equals(GeneralName.UniformResourceIdentifier)) + { + // found + string temp = (string)list[1]; + PkixCertPathValidatorUtilities.AddAdditionalStoreFromLocation(temp, pkixParams); + } + } + } + } + + internal static DateTime GetValidDate(PkixParameters paramsPKIX) + { + DateTimeObject validDate = paramsPKIX.Date; + + if (validDate == null) + return DateTime.UtcNow; + + return validDate.Value; + } + + /// + /// Returns the issuer of an attribute certificate or certificate. + /// + /// The attribute certificate or certificate. + /// The issuer as X500Principal. + internal static X509Name GetIssuerPrincipal( + object cert) + { + if (cert is X509Certificate) + { + return ((X509Certificate)cert).IssuerDN; + } + else + { + return ((IX509AttributeCertificate)cert).Issuer.GetPrincipals()[0]; + } + } + + internal static bool IsSelfIssued( + X509Certificate cert) + { + return cert.SubjectDN.Equivalent(cert.IssuerDN, true); + } + + internal static AlgorithmIdentifier GetAlgorithmIdentifier( + AsymmetricKeyParameter key) + { + try + { + SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(key); + + return info.AlgorithmID; + } + catch (Exception e) + { + throw new PkixCertPathValidatorException("Subject public key cannot be decoded.", e); + } + } + + internal static bool IsAnyPolicy( + ISet policySet) + { + return policySet == null || policySet.Contains(ANY_POLICY) || policySet.Count == 0; + } + + internal static void AddAdditionalStoreFromLocation( + string location, + PkixParameters pkixParams) + { + if (pkixParams.IsAdditionalLocationsEnabled) + { + try + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(location, "ldap://")) + { + // ldap://directory.d-trust.net/CN=D-TRUST + // Qualified CA 2003 1:PN,O=D-Trust GmbH,C=DE + // skip "ldap://" + location = location.Substring(7); + // after first / baseDN starts + string url;//, baseDN; + int slashPos = location.IndexOf('/'); + if (slashPos != -1) + { + url = "ldap://" + location.Substring(0, slashPos); +// baseDN = location.Substring(slashPos); + } + else + { + url = "ldap://" + location; +// baseDN = nsull; + } + + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("LDAP cert/CRL stores"); + + // use all purpose parameters + //X509LDAPCertStoreParameters ldapParams = new X509LDAPCertStoreParameters.Builder( + // url, baseDN).build(); + //pkixParams.AddAdditionalStore(X509Store.getInstance( + // "CERTIFICATE/LDAP", ldapParams)); + //pkixParams.AddAdditionalStore(X509Store.getInstance( + // "CRL/LDAP", ldapParams)); + //pkixParams.AddAdditionalStore(X509Store.getInstance( + // "ATTRIBUTECERTIFICATE/LDAP", ldapParams)); + //pkixParams.AddAdditionalStore(X509Store.getInstance( + // "CERTIFICATEPAIR/LDAP", ldapParams)); + } + } + catch (Exception) + { + // cannot happen + throw new Exception("Exception adding X.509 stores."); + } + } + } + + private static BigInteger GetSerialNumber( + object cert) + { + if (cert is X509Certificate) + { + return ((X509Certificate)cert).SerialNumber; + } + else + { + return ((X509V2AttributeCertificate)cert).SerialNumber; + } + } + + // + // policy checking + // + + internal static ISet GetQualifierSet(Asn1Sequence qualifiers) + { + ISet pq = new HashSet(); + + if (qualifiers == null) + { + return pq; + } + + foreach (Asn1Encodable ae in qualifiers) + { + try + { +// pq.Add(PolicyQualifierInfo.GetInstance(Asn1Object.FromByteArray(ae.GetEncoded()))); + pq.Add(PolicyQualifierInfo.GetInstance(ae.ToAsn1Object())); + } + catch (IOException ex) + { + throw new PkixCertPathValidatorException("Policy qualifier info cannot be decoded.", ex); + } + } + + return pq; + } + + internal static PkixPolicyNode RemovePolicyNode( + PkixPolicyNode validPolicyTree, + IList[] policyNodes, + PkixPolicyNode _node) + { + PkixPolicyNode _parent = (PkixPolicyNode)_node.Parent; + + if (validPolicyTree == null) + { + return null; + } + + if (_parent == null) + { + for (int j = 0; j < policyNodes.Length; j++) + { + policyNodes[j] = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + } + + return null; + } + else + { + _parent.RemoveChild(_node); + RemovePolicyNodeRecurse(policyNodes, _node); + + return validPolicyTree; + } + } + + private static void RemovePolicyNodeRecurse(IList[] policyNodes, PkixPolicyNode _node) + { + policyNodes[_node.Depth].Remove(_node); + + if (_node.HasChildren) + { + foreach (PkixPolicyNode _child in _node.Children) + { + RemovePolicyNodeRecurse(policyNodes, _child); + } + } + } + + internal static void PrepareNextCertB1( + int i, + IList[] policyNodes, + string id_p, + IDictionary m_idp, + X509Certificate cert) + { + bool idp_found = false; + IEnumerator nodes_i = policyNodes[i].GetEnumerator(); + while (nodes_i.MoveNext()) + { + PkixPolicyNode node = (PkixPolicyNode)nodes_i.Current; + if (node.ValidPolicy.Equals(id_p)) + { + idp_found = true; + node.ExpectedPolicies = (ISet)m_idp[id_p]; + break; + } + } + + if (!idp_found) + { + nodes_i = policyNodes[i].GetEnumerator(); + while (nodes_i.MoveNext()) + { + PkixPolicyNode node = (PkixPolicyNode)nodes_i.Current; + if (ANY_POLICY.Equals(node.ValidPolicy)) + { + ISet pq = null; + Asn1Sequence policies = null; + try + { + policies = DerSequence.GetInstance(GetExtensionValue(cert, X509Extensions.CertificatePolicies)); + } + catch (Exception e) + { + throw new Exception("Certificate policies cannot be decoded.", e); + } + + IEnumerator enm = policies.GetEnumerator(); + while (enm.MoveNext()) + { + PolicyInformation pinfo = null; + + try + { + pinfo = PolicyInformation.GetInstance(enm.Current); + } + catch (Exception ex) + { + throw new Exception("Policy information cannot be decoded.", ex); + } + + if (ANY_POLICY.Equals(pinfo.PolicyIdentifier.Id)) + { + try + { + pq = GetQualifierSet(pinfo.PolicyQualifiers); + } + catch (PkixCertPathValidatorException ex) + { + throw new PkixCertPathValidatorException( + "Policy qualifier info set could not be built.", ex); + } + break; + } + } + bool ci = false; + ISet critExtOids = cert.GetCriticalExtensionOids(); + if (critExtOids != null) + { + ci = critExtOids.Contains(X509Extensions.CertificatePolicies.Id); + } + + PkixPolicyNode p_node = (PkixPolicyNode)node.Parent; + if (ANY_POLICY.Equals(p_node.ValidPolicy)) + { + PkixPolicyNode c_node = new PkixPolicyNode( + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(), i, + (ISet)m_idp[id_p], + p_node, pq, id_p, ci); + p_node.AddChild(c_node); + policyNodes[i].Add(c_node); + } + break; + } + } + } + } + + internal static PkixPolicyNode PrepareNextCertB2( + int i, + IList[] policyNodes, + string id_p, + PkixPolicyNode validPolicyTree) + { + int pos = 0; + + // Copy to avoid RemoveAt calls interfering with enumeration + foreach (PkixPolicyNode node in BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(policyNodes[i])) + { + if (node.ValidPolicy.Equals(id_p)) + { + PkixPolicyNode p_node = (PkixPolicyNode)node.Parent; + p_node.RemoveChild(node); + + // Removal of element at current iterator position not supported in C# + //nodes_i.remove(); + policyNodes[i].RemoveAt(pos); + + for (int k = (i - 1); k >= 0; k--) + { + IList nodes = policyNodes[k]; + for (int l = 0; l < nodes.Count; l++) + { + PkixPolicyNode node2 = (PkixPolicyNode)nodes[l]; + if (!node2.HasChildren) + { + validPolicyTree = RemovePolicyNode(validPolicyTree, policyNodes, node2); + if (validPolicyTree == null) + break; + } + } + } + } + else + { + ++pos; + } + } + return validPolicyTree; + } + + internal static void GetCertStatus( + DateTime validDate, + X509Crl crl, + Object cert, + CertStatus certStatus) + { + X509Crl bcCRL = null; + + try + { + bcCRL = new X509Crl(CertificateList.GetInstance((Asn1Sequence)Asn1Sequence.FromByteArray(crl.GetEncoded()))); + } + catch (Exception exception) + { + throw new Exception("Bouncy Castle X509Crl could not be created.", exception); + } + + X509CrlEntry crl_entry = (X509CrlEntry)bcCRL.GetRevokedCertificate(GetSerialNumber(cert)); + + if (crl_entry == null) + return; + + X509Name issuer = GetIssuerPrincipal(cert); + + if (issuer.Equivalent(crl_entry.GetCertificateIssuer(), true) + || issuer.Equivalent(crl.IssuerDN, true)) + { + DerEnumerated reasonCode = null; + if (crl_entry.HasExtensions) + { + try + { + reasonCode = DerEnumerated.GetInstance( + GetExtensionValue(crl_entry, X509Extensions.ReasonCode)); + } + catch (Exception e) + { + throw new Exception( + "Reason code CRL entry extension could not be decoded.", + e); + } + } + + // for reason keyCompromise, caCompromise, aACompromise or + // unspecified + if (!(validDate.Ticks < crl_entry.RevocationDate.Ticks) + || reasonCode == null + || reasonCode.Value.TestBit(0) + || reasonCode.Value.TestBit(1) + || reasonCode.Value.TestBit(2) + || reasonCode.Value.TestBit(8)) + { + if (reasonCode != null) // (i) or (j) (1) + { + certStatus.Status = reasonCode.Value.SignValue; + } + else // (i) or (j) (2) + { + certStatus.Status = CrlReason.Unspecified; + } + certStatus.RevocationDate = new DateTimeObject(crl_entry.RevocationDate); + } + } + } + + /** + * Return the next working key inheriting DSA parameters if necessary. + *

    + * This methods inherits DSA parameters from the indexed certificate or + * previous certificates in the certificate chain to the returned + * PublicKey. The list is searched upwards, meaning the end + * certificate is at position 0 and previous certificates are following. + *

    + *

    + * If the indexed certificate does not contain a DSA key this method simply + * returns the public key. If the DSA key already contains DSA parameters + * the key is also only returned. + *

    + * + * @param certs The certification path. + * @param index The index of the certificate which contains the public key + * which should be extended with DSA parameters. + * @return The public key of the certificate in list position + * index extended with DSA parameters if applicable. + * @throws Exception if DSA parameters cannot be inherited. + */ + internal static AsymmetricKeyParameter GetNextWorkingKey( + IList certs, + int index) + { + //Only X509Certificate + X509Certificate cert = (X509Certificate)certs[index]; + + AsymmetricKeyParameter pubKey = cert.GetPublicKey(); + + if (!(pubKey is DsaPublicKeyParameters)) + return pubKey; + + DsaPublicKeyParameters dsaPubKey = (DsaPublicKeyParameters)pubKey; + + if (dsaPubKey.Parameters != null) + return dsaPubKey; + + for (int i = index + 1; i < certs.Count; i++) + { + X509Certificate parentCert = (X509Certificate)certs[i]; + pubKey = parentCert.GetPublicKey(); + + if (!(pubKey is DsaPublicKeyParameters)) + { + throw new PkixCertPathValidatorException( + "DSA parameters cannot be inherited from previous certificate."); + } + + DsaPublicKeyParameters prevDSAPubKey = (DsaPublicKeyParameters)pubKey; + + if (prevDSAPubKey.Parameters == null) + continue; + + DsaParameters dsaParams = prevDSAPubKey.Parameters; + + try + { + return new DsaPublicKeyParameters(dsaPubKey.Y, dsaParams); + } + catch (Exception exception) + { + throw new Exception(exception.Message); + } + } + + throw new PkixCertPathValidatorException("DSA parameters cannot be inherited from previous certificate."); + } + + internal static DateTime GetValidCertDateFromValidityModel( + PkixParameters paramsPkix, + PkixCertPath certPath, + int index) + { + if (paramsPkix.ValidityModel != PkixParameters.ChainValidityModel) + { + return GetValidDate(paramsPkix); + } + + // if end cert use given signing/encryption/... time + if (index <= 0) + { + return PkixCertPathValidatorUtilities.GetValidDate(paramsPkix); + // else use time when previous cert was created + } + + if (index - 1 == 0) + { + DerGeneralizedTime dateOfCertgen = null; + try + { + X509Certificate cert = (X509Certificate)certPath.Certificates[index - 1]; + Asn1OctetString extVal = cert.GetExtensionValue( + IsisMttObjectIdentifiers.IdIsisMttATDateOfCertGen); + dateOfCertgen = DerGeneralizedTime.GetInstance(extVal); + } + catch (ArgumentException) + { + throw new Exception( + "Date of cert gen extension could not be read."); + } + if (dateOfCertgen != null) + { + try + { + return dateOfCertgen.ToDateTime(); + } + catch (ArgumentException e) + { + throw new Exception( + "Date from date of cert gen extension could not be parsed.", + e); + } + } + } + + return ((X509Certificate)certPath.Certificates[index - 1]).NotBefore; + } + + /// + /// Return a Collection of all certificates or attribute certificates found + /// in the X509Store's that are matching the certSelect criteriums. + /// + /// a {@link Selector} object that will be used to select + /// the certificates + /// a List containing only X509Store objects. These + /// are used to search for certificates. + /// a Collection of all found or + /// objects. + /// May be empty but never null. + /// + internal static ICollection FindCertificates( + X509CertStoreSelector certSelect, + IList certStores) + { + ISet certs = new HashSet(); + + foreach (IX509Store certStore in certStores) + { + try + { +// certs.AddAll(certStore.GetMatches(certSelect)); + foreach (X509Certificate c in certStore.GetMatches(certSelect)) + { + certs.Add(c); + } + } + catch (Exception e) + { + throw new Exception("Problem while picking certificates from X.509 store.", e); + } + } + + return certs; + } + + /** + * Add the CRL issuers from the cRLIssuer field of the distribution point or + * from the certificate if not given to the issuer criterion of the + * selector. + *

    + * The issuerPrincipals are a collection with a single + * X500Principal for X509Certificates. For + * {@link X509AttributeCertificate}s the issuer may contain more than one + * X500Principal. + *

    + * + * @param dp The distribution point. + * @param issuerPrincipals The issuers of the certificate or attribute + * certificate which contains the distribution point. + * @param selector The CRL selector. + * @param pkixParams The PKIX parameters containing the cert stores. + * @throws Exception if an exception occurs while processing. + * @throws ClassCastException if issuerPrincipals does not + * contain only X500Principals. + */ + internal static void GetCrlIssuersFromDistributionPoint( + DistributionPoint dp, + ICollection issuerPrincipals, + X509CrlStoreSelector selector, + PkixParameters pkixParams) + { + IList issuers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + // indirect CRL + if (dp.CrlIssuer != null) + { + GeneralName[] genNames = dp.CrlIssuer.GetNames(); + // look for a DN + for (int j = 0; j < genNames.Length; j++) + { + if (genNames[j].TagNo == GeneralName.DirectoryName) + { + try + { + issuers.Add(X509Name.GetInstance(genNames[j].Name.ToAsn1Object())); + } + catch (IOException e) + { + throw new Exception( + "CRL issuer information from distribution point cannot be decoded.", + e); + } + } + } + } + else + { + /* + * certificate issuer is CRL issuer, distributionPoint field MUST be + * present. + */ + if (dp.DistributionPointName == null) + { + throw new Exception( + "CRL issuer is omitted from distribution point but no distributionPoint field present."); + } + + // add and check issuer principals + for (IEnumerator it = issuerPrincipals.GetEnumerator(); it.MoveNext(); ) + { + issuers.Add((X509Name)it.Current); + } + } + // TODO: is not found although this should correctly add the rel name. selector of Sun is buggy here or PKI test case is invalid + // distributionPoint + // if (dp.getDistributionPoint() != null) + // { + // // look for nameRelativeToCRLIssuer + // if (dp.getDistributionPoint().getType() == DistributionPointName.NAME_RELATIVE_TO_CRL_ISSUER) + // { + // // append fragment to issuer, only one + // // issuer can be there, if this is given + // if (issuers.size() != 1) + // { + // throw new AnnotatedException( + // "nameRelativeToCRLIssuer field is given but more than one CRL issuer is given."); + // } + // DEREncodable relName = dp.getDistributionPoint().getName(); + // Iterator it = issuers.iterator(); + // List issuersTemp = new ArrayList(issuers.size()); + // while (it.hasNext()) + // { + // Enumeration e = null; + // try + // { + // e = ASN1Sequence.getInstance( + // new ASN1InputStream(((X500Principal) it.next()) + // .getEncoded()).readObject()).getObjects(); + // } + // catch (IOException ex) + // { + // throw new AnnotatedException( + // "Cannot decode CRL issuer information.", ex); + // } + // ASN1EncodableVector v = new ASN1EncodableVector(); + // while (e.hasMoreElements()) + // { + // v.add((DEREncodable) e.nextElement()); + // } + // v.add(relName); + // issuersTemp.add(new X500Principal(new DERSequence(v) + // .getDEREncoded())); + // } + // issuers.clear(); + // issuers.addAll(issuersTemp); + // } + // } + + selector.Issuers = issuers; + } + + /** + * Fetches complete CRLs according to RFC 3280. + * + * @param dp The distribution point for which the complete CRL + * @param cert The X509Certificate or + * {@link org.bouncycastle.x509.X509AttributeCertificate} for + * which the CRL should be searched. + * @param currentDate The date for which the delta CRLs must be valid. + * @param paramsPKIX The extended PKIX parameters. + * @return A Set of X509CRLs with complete + * CRLs. + * @throws Exception if an exception occurs while picking the CRLs + * or no CRLs are found. + */ + internal static ISet GetCompleteCrls( + DistributionPoint dp, + object cert, + DateTime currentDate, + PkixParameters paramsPKIX) + { + X509CrlStoreSelector crlselect = new X509CrlStoreSelector(); + try + { + ISet issuers = new HashSet(); + if (cert is X509V2AttributeCertificate) + { + issuers.Add(((X509V2AttributeCertificate)cert) + .Issuer.GetPrincipals()[0]); + } + else + { + issuers.Add(GetIssuerPrincipal(cert)); + } + PkixCertPathValidatorUtilities.GetCrlIssuersFromDistributionPoint(dp, issuers, crlselect, paramsPKIX); + } + catch (Exception e) + { + throw new Exception("Could not get issuer information from distribution point.", e); + } + + if (cert is X509Certificate) + { + crlselect.CertificateChecking = (X509Certificate)cert; + } + else if (cert is X509V2AttributeCertificate) + { + crlselect.AttrCertChecking = (IX509AttributeCertificate)cert; + } + + crlselect.CompleteCrlEnabled = true; + ISet crls = CrlUtilities.FindCrls(crlselect, paramsPKIX, currentDate); + + if (crls.IsEmpty) + { + if (cert is IX509AttributeCertificate) + { + IX509AttributeCertificate aCert = (IX509AttributeCertificate)cert; + + throw new Exception("No CRLs found for issuer \"" + aCert.Issuer.GetPrincipals()[0] + "\""); + } + else + { + X509Certificate xCert = (X509Certificate)cert; + + throw new Exception("No CRLs found for issuer \"" + xCert.IssuerDN + "\""); + } + } + + return crls; + } + + /** + * Fetches delta CRLs according to RFC 3280 section 5.2.4. + * + * @param currentDate The date for which the delta CRLs must be valid. + * @param paramsPKIX The extended PKIX parameters. + * @param completeCRL The complete CRL the delta CRL is for. + * @return A Set of X509CRLs with delta CRLs. + * @throws Exception if an exception occurs while picking the delta + * CRLs. + */ + internal static ISet GetDeltaCrls( + DateTime currentDate, + PkixParameters paramsPKIX, + X509Crl completeCRL) + { + X509CrlStoreSelector deltaSelect = new X509CrlStoreSelector(); + + // 5.2.4 (a) + try + { + IList deltaSelectIssuer = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + deltaSelectIssuer.Add(completeCRL.IssuerDN); + deltaSelect.Issuers = deltaSelectIssuer; + } + catch (IOException e) + { + throw new Exception("Cannot extract issuer from CRL.", e); + } + + BigInteger completeCRLNumber = null; + try + { + Asn1Object asn1Object = GetExtensionValue(completeCRL, X509Extensions.CrlNumber); + if (asn1Object != null) + { + completeCRLNumber = CrlNumber.GetInstance(asn1Object).PositiveValue; + } + } + catch (Exception e) + { + throw new Exception( + "CRL number extension could not be extracted from CRL.", e); + } + + // 5.2.4 (b) + byte[] idp = null; + + try + { + Asn1Object obj = GetExtensionValue(completeCRL, X509Extensions.IssuingDistributionPoint); + if (obj != null) + { + idp = obj.GetDerEncoded(); + } + } + catch (Exception e) + { + throw new Exception( + "Issuing distribution point extension value could not be read.", + e); + } + + // 5.2.4 (d) + + deltaSelect.MinCrlNumber = (completeCRLNumber == null) + ? null + : completeCRLNumber.Add(BigInteger.One); + + deltaSelect.IssuingDistributionPoint = idp; + deltaSelect.IssuingDistributionPointEnabled = true; + + // 5.2.4 (c) + deltaSelect.MaxBaseCrlNumber = completeCRLNumber; + + // find delta CRLs + ISet temp = CrlUtilities.FindCrls(deltaSelect, paramsPKIX, currentDate); + + ISet result = new HashSet(); + + foreach (X509Crl crl in temp) + { + if (isDeltaCrl(crl)) + { + result.Add(crl); + } + } + + return result; + } + + private static bool isDeltaCrl( + X509Crl crl) + { + ISet critical = crl.GetCriticalExtensionOids(); + + return critical.Contains(X509Extensions.DeltaCrlIndicator.Id); + } + + internal static ICollection FindCertificates( + X509AttrCertStoreSelector certSelect, + IList certStores) + { + ISet certs = new HashSet(); + + foreach (IX509Store certStore in certStores) + { + try + { +// certs.AddAll(certStore.GetMatches(certSelect)); + foreach (X509V2AttributeCertificate ac in certStore.GetMatches(certSelect)) + { + certs.Add(ac); + } + } + catch (Exception e) + { + throw new Exception( + "Problem while picking certificates from X.509 store.", e); + } + } + + return certs; + } + + internal static void AddAdditionalStoresFromCrlDistributionPoint( + CrlDistPoint crldp, + PkixParameters pkixParams) + { + if (crldp != null) + { + DistributionPoint[] dps = null; + try + { + dps = crldp.GetDistributionPoints(); + } + catch (Exception e) + { + throw new Exception( + "Distribution points could not be read.", e); + } + for (int i = 0; i < dps.Length; i++) + { + DistributionPointName dpn = dps[i].DistributionPointName; + // look for URIs in fullName + if (dpn != null) + { + if (dpn.PointType == DistributionPointName.FullName) + { + GeneralName[] genNames = GeneralNames.GetInstance( + dpn.Name).GetNames(); + // look for an URI + for (int j = 0; j < genNames.Length; j++) + { + if (genNames[j].TagNo == GeneralName.UniformResourceIdentifier) + { + string location = DerIA5String.GetInstance( + genNames[j].Name).GetString(); + PkixCertPathValidatorUtilities.AddAdditionalStoreFromLocation( + location, pkixParams); + } + } + } + } + } + } + } + + internal static bool ProcessCertD1i( + int index, + IList[] policyNodes, + DerObjectIdentifier pOid, + ISet pq) + { + IList policyNodeVec = policyNodes[index - 1]; + + for (int j = 0; j < policyNodeVec.Count; j++) + { + PkixPolicyNode node = (PkixPolicyNode)policyNodeVec[j]; + ISet expectedPolicies = node.ExpectedPolicies; + + if (expectedPolicies.Contains(pOid.Id)) + { + ISet childExpectedPolicies = new HashSet(); + childExpectedPolicies.Add(pOid.Id); + + PkixPolicyNode child = new PkixPolicyNode(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(), + index, + childExpectedPolicies, + node, + pq, + pOid.Id, + false); + node.AddChild(child); + policyNodes[index].Add(child); + + return true; + } + } + + return false; + } + + internal static void ProcessCertD1ii( + int index, + IList[] policyNodes, + DerObjectIdentifier _poid, + ISet _pq) + { + IList policyNodeVec = policyNodes[index - 1]; + + for (int j = 0; j < policyNodeVec.Count; j++) + { + PkixPolicyNode _node = (PkixPolicyNode)policyNodeVec[j]; + + if (ANY_POLICY.Equals(_node.ValidPolicy)) + { + ISet _childExpectedPolicies = new HashSet(); + _childExpectedPolicies.Add(_poid.Id); + + PkixPolicyNode _child = new PkixPolicyNode(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(), + index, + _childExpectedPolicies, + _node, + _pq, + _poid.Id, + false); + _node.AddChild(_child); + policyNodes[index].Add(_child); + return; + } + } + } + + /** + * Find the issuer certificates of a given certificate. + * + * @param cert + * The certificate for which an issuer should be found. + * @param pkixParams + * @return A Collection object containing the issuer + * X509Certificates. Never null. + * + * @exception Exception + * if an error occurs. + */ + internal static ICollection FindIssuerCerts( + X509Certificate cert, + PkixBuilderParameters pkixParams) + { + X509CertStoreSelector certSelect = new X509CertStoreSelector(); + ISet certs = new HashSet(); + try + { + certSelect.Subject = cert.IssuerDN; + } + catch (IOException ex) + { + throw new Exception( + "Subject criteria for certificate selector to find issuer certificate could not be set.", ex); + } + + try + { + certs.AddAll(PkixCertPathValidatorUtilities.FindCertificates(certSelect, pkixParams.GetStores())); + certs.AddAll(PkixCertPathValidatorUtilities.FindCertificates(certSelect, pkixParams.GetAdditionalStores())); + } + catch (Exception e) + { + throw new Exception("Issuer certificate cannot be searched.", e); + } + + return certs; + } + + /// + /// Extract the value of the given extension, if it exists. + /// + /// The extension object. + /// The object identifier to obtain. + /// Asn1Object + /// if the extension cannot be read. + internal static Asn1Object GetExtensionValue( + IX509Extension ext, + DerObjectIdentifier oid) + { + Asn1OctetString bytes = ext.GetExtensionValue(oid); + + if (bytes == null) + return null; + + return X509ExtensionUtilities.FromExtensionValue(bytes); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorUtilities.cs.meta new file mode 100644 index 00000000..302b0f9b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCertPathValidatorUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7825ba3fb6db65f428b313e1641e481b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCrlUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCrlUtilities.cs new file mode 100644 index 00000000..de9bb78c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCrlUtilities.cs @@ -0,0 +1,118 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + public class PkixCrlUtilities + { + public virtual ISet FindCrls(X509CrlStoreSelector crlselect, PkixParameters paramsPkix, DateTime currentDate) + { + ISet initialSet = new HashSet(); + + // get complete CRL(s) + try + { + initialSet.AddAll(FindCrls(crlselect, paramsPkix.GetAdditionalStores())); + initialSet.AddAll(FindCrls(crlselect, paramsPkix.GetStores())); + } + catch (Exception e) + { + throw new Exception("Exception obtaining complete CRLs.", e); + } + + ISet finalSet = new HashSet(); + DateTime validityDate = currentDate; + + if (paramsPkix.Date != null) + { + validityDate = paramsPkix.Date.Value; + } + + // based on RFC 5280 6.3.3 + foreach (X509Crl crl in initialSet) + { + if (crl.NextUpdate.Value.CompareTo(validityDate) > 0) + { + X509Certificate cert = crlselect.CertificateChecking; + + if (cert != null) + { + if (crl.ThisUpdate.CompareTo(cert.NotAfter) < 0) + { + finalSet.Add(crl); + } + } + else + { + finalSet.Add(crl); + } + } + } + + return finalSet; + } + + public virtual ISet FindCrls(X509CrlStoreSelector crlselect, PkixParameters paramsPkix) + { + ISet completeSet = new HashSet(); + + // get complete CRL(s) + try + { + completeSet.AddAll(FindCrls(crlselect, paramsPkix.GetStores())); + } + catch (Exception e) + { + throw new Exception("Exception obtaining complete CRLs.", e); + } + + return completeSet; + } + + /// + /// crl checking + /// Return a Collection of all CRLs found in the X509Store's that are + /// matching the crlSelect criteriums. + /// + /// a {@link X509CRLStoreSelector} object that will be used + /// to select the CRLs + /// a List containing only {@link org.bouncycastle.x509.X509Store + /// X509Store} objects. These are used to search for CRLs + /// a Collection of all found {@link X509CRL X509CRL} objects. May be + /// empty but never null. + /// + private ICollection FindCrls(X509CrlStoreSelector crlSelect, IList crlStores) + { + ISet crls = new HashSet(); + + Exception lastException = null; + bool foundValidStore = false; + + foreach (IX509Store store in crlStores) + { + try + { + crls.AddAll(store.GetMatches(crlSelect)); + foundValidStore = true; + } + catch (X509StoreException e) + { + lastException = new Exception("Exception searching in X.509 CRL store.", e); + } + } + + if (!foundValidStore && lastException != null) + throw lastException; + + return crls; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCrlUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCrlUtilities.cs.meta new file mode 100644 index 00000000..38f64aa7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixCrlUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7931f13e3f4ffef48a585b19606b249f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidator.cs new file mode 100644 index 00000000..904f31d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidator.cs @@ -0,0 +1,1943 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + public class PkixNameConstraintValidator + { + private ISet excludedSubtreesDN = new HashSet(); + + private ISet excludedSubtreesDNS = new HashSet(); + + private ISet excludedSubtreesEmail = new HashSet(); + + private ISet excludedSubtreesURI = new HashSet(); + + private ISet excludedSubtreesIP = new HashSet(); + + private ISet permittedSubtreesDN; + + private ISet permittedSubtreesDNS; + + private ISet permittedSubtreesEmail; + + private ISet permittedSubtreesURI; + + private ISet permittedSubtreesIP; + + public PkixNameConstraintValidator() + { + } + + private static bool WithinDNSubtree( + Asn1Sequence dns, + Asn1Sequence subtree) + { + if (subtree.Count < 1) + { + return false; + } + + if (subtree.Count > dns.Count) + { + return false; + } + + for (int j = subtree.Count - 1; j >= 0; j--) + { + if (!(subtree[j].Equals(dns[j]))) + { + return false; + } + } + + return true; + } + + public void CheckPermittedDN(Asn1Sequence dns) + //throws PkixNameConstraintValidatorException + { + CheckPermittedDN(permittedSubtreesDN, dns); + } + + public void CheckExcludedDN(Asn1Sequence dns) + //throws PkixNameConstraintValidatorException + { + CheckExcludedDN(excludedSubtreesDN, dns); + } + + private void CheckPermittedDN(ISet permitted, Asn1Sequence dns) + //throws PkixNameConstraintValidatorException + { + if (permitted == null) + { + return; + } + + if ((permitted.Count == 0) && dns.Count == 0) + { + return; + } + + IEnumerator it = permitted.GetEnumerator(); + + while (it.MoveNext()) + { + Asn1Sequence subtree = (Asn1Sequence)it.Current; + + if (WithinDNSubtree(dns, subtree)) + { + return; + } + } + + throw new PkixNameConstraintValidatorException( + "Subject distinguished name is not from a permitted subtree"); + } + + private void CheckExcludedDN(ISet excluded, Asn1Sequence dns) + //throws PkixNameConstraintValidatorException + { + if (excluded.IsEmpty) + { + return; + } + + IEnumerator it = excluded.GetEnumerator(); + + while (it.MoveNext()) + { + Asn1Sequence subtree = (Asn1Sequence)it.Current; + + if (WithinDNSubtree(dns, subtree)) + { + throw new PkixNameConstraintValidatorException( + "Subject distinguished name is from an excluded subtree"); + } + } + } + + private ISet IntersectDN(ISet permitted, ISet dns) + { + ISet intersect = new HashSet(); + for (IEnumerator it = dns.GetEnumerator(); it.MoveNext(); ) + { + Asn1Sequence dn = Asn1Sequence.GetInstance(((GeneralSubtree)it + .Current).Base.Name.ToAsn1Object()); + if (permitted == null) + { + if (dn != null) + { + intersect.Add(dn); + } + } + else + { + IEnumerator _iter = permitted.GetEnumerator(); + while (_iter.MoveNext()) + { + Asn1Sequence subtree = (Asn1Sequence)_iter.Current; + + if (WithinDNSubtree(dn, subtree)) + { + intersect.Add(dn); + } + else if (WithinDNSubtree(subtree, dn)) + { + intersect.Add(subtree); + } + } + } + } + return intersect; + } + + private ISet UnionDN(ISet excluded, Asn1Sequence dn) + { + if (excluded.IsEmpty) + { + if (dn == null) + { + return excluded; + } + excluded.Add(dn); + + return excluded; + } + else + { + ISet intersect = new HashSet(); + + IEnumerator it = excluded.GetEnumerator(); + while (it.MoveNext()) + { + Asn1Sequence subtree = (Asn1Sequence)it.Current; + + if (WithinDNSubtree(dn, subtree)) + { + intersect.Add(subtree); + } + else if (WithinDNSubtree(subtree, dn)) + { + intersect.Add(dn); + } + else + { + intersect.Add(subtree); + intersect.Add(dn); + } + } + + return intersect; + } + } + + private ISet IntersectEmail(ISet permitted, ISet emails) + { + ISet intersect = new HashSet(); + for (IEnumerator it = emails.GetEnumerator(); it.MoveNext(); ) + { + String email = ExtractNameAsString(((GeneralSubtree)it.Current) + .Base); + + if (permitted == null) + { + if (email != null) + { + intersect.Add(email); + } + } + else + { + IEnumerator it2 = permitted.GetEnumerator(); + while (it2.MoveNext()) + { + String _permitted = (String)it2.Current; + + intersectEmail(email, _permitted, intersect); + } + } + } + return intersect; + } + + private ISet UnionEmail(ISet excluded, String email) + { + if (excluded.IsEmpty) + { + if (email == null) + { + return excluded; + } + excluded.Add(email); + return excluded; + } + else + { + ISet union = new HashSet(); + + IEnumerator it = excluded.GetEnumerator(); + while (it.MoveNext()) + { + String _excluded = (String)it.Current; + + unionEmail(_excluded, email, union); + } + + return union; + } + } + + /** + * Returns the intersection of the permitted IP ranges in + * permitted with ip. + * + * @param permitted A Set of permitted IP addresses with + * their subnet mask as byte arrays. + * @param ips The IP address with its subnet mask. + * @return The Set of permitted IP ranges intersected with + * ip. + */ + private ISet IntersectIP(ISet permitted, ISet ips) + { + ISet intersect = new HashSet(); + for (IEnumerator it = ips.GetEnumerator(); it.MoveNext(); ) + { + byte[] ip = Asn1OctetString.GetInstance( + ((GeneralSubtree)it.Current).Base.Name).GetOctets(); + if (permitted == null) + { + if (ip != null) + { + intersect.Add(ip); + } + } + else + { + IEnumerator it2 = permitted.GetEnumerator(); + while (it2.MoveNext()) + { + byte[] _permitted = (byte[])it2.Current; + intersect.AddAll(IntersectIPRange(_permitted, ip)); + } + } + } + return intersect; + } + + /** + * Returns the union of the excluded IP ranges in excluded + * with ip. + * + * @param excluded A Set of excluded IP addresses with their + * subnet mask as byte arrays. + * @param ip The IP address with its subnet mask. + * @return The Set of excluded IP ranges unified with + * ip as byte arrays. + */ + private ISet UnionIP(ISet excluded, byte[] ip) + { + if (excluded.IsEmpty) + { + if (ip == null) + { + return excluded; + } + excluded.Add(ip); + + return excluded; + } + else + { + ISet union = new HashSet(); + + IEnumerator it = excluded.GetEnumerator(); + while (it.MoveNext()) + { + byte[] _excluded = (byte[])it.Current; + union.AddAll(UnionIPRange(_excluded, ip)); + } + + return union; + } + } + + /** + * Calculates the union if two IP ranges. + * + * @param ipWithSubmask1 The first IP address with its subnet mask. + * @param ipWithSubmask2 The second IP address with its subnet mask. + * @return A Set with the union of both addresses. + */ + private ISet UnionIPRange(byte[] ipWithSubmask1, byte[] ipWithSubmask2) + { + ISet set = new HashSet(); + + // difficult, adding always all IPs is not wrong + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Arrays.AreEqual(ipWithSubmask1, ipWithSubmask2)) + { + set.Add(ipWithSubmask1); + } + else + { + set.Add(ipWithSubmask1); + set.Add(ipWithSubmask2); + } + return set; + } + + /** + * Calculates the interesction if two IP ranges. + * + * @param ipWithSubmask1 The first IP address with its subnet mask. + * @param ipWithSubmask2 The second IP address with its subnet mask. + * @return A Set with the single IP address with its subnet + * mask as a byte array or an empty Set. + */ + private ISet IntersectIPRange(byte[] ipWithSubmask1, byte[] ipWithSubmask2) + { + if (ipWithSubmask1.Length != ipWithSubmask2.Length) + { + //Collections.EMPTY_SET; + return new HashSet(); + } + + byte[][] temp = ExtractIPsAndSubnetMasks(ipWithSubmask1, ipWithSubmask2); + byte[] ip1 = temp[0]; + byte[] subnetmask1 = temp[1]; + byte[] ip2 = temp[2]; + byte[] subnetmask2 = temp[3]; + + byte[][] minMax = MinMaxIPs(ip1, subnetmask1, ip2, subnetmask2); + byte[] min; + byte[] max; + max = Min(minMax[1], minMax[3]); + min = Max(minMax[0], minMax[2]); + + // minimum IP address must be bigger than max + if (CompareTo(min, max) == 1) + { + //return Collections.EMPTY_SET; + return new HashSet(); + } + // OR keeps all significant bits + byte[] ip = Or(minMax[0], minMax[2]); + byte[] subnetmask = Or(subnetmask1, subnetmask2); + + //return new HashSet( ICollectionsingleton(IpWithSubnetMask(ip, subnetmask)); + ISet hs = new HashSet(); + hs.Add(IpWithSubnetMask(ip, subnetmask)); + + return hs; + } + + /** + * Concatenates the IP address with its subnet mask. + * + * @param ip The IP address. + * @param subnetMask Its subnet mask. + * @return The concatenated IP address with its subnet mask. + */ + private byte[] IpWithSubnetMask(byte[] ip, byte[] subnetMask) + { + int ipLength = ip.Length; + byte[] temp = new byte[ipLength * 2]; + Array.Copy(ip, 0, temp, 0, ipLength); + Array.Copy(subnetMask, 0, temp, ipLength, ipLength); + return temp; + } + + /** + * Splits the IP addresses and their subnet mask. + * + * @param ipWithSubmask1 The first IP address with the subnet mask. + * @param ipWithSubmask2 The second IP address with the subnet mask. + * @return An array with two elements. Each element contains the IP address + * and the subnet mask in this order. + */ + private byte[][] ExtractIPsAndSubnetMasks( + byte[] ipWithSubmask1, + byte[] ipWithSubmask2) + { + int ipLength = ipWithSubmask1.Length / 2; + byte[] ip1 = new byte[ipLength]; + byte[] subnetmask1 = new byte[ipLength]; + Array.Copy(ipWithSubmask1, 0, ip1, 0, ipLength); + Array.Copy(ipWithSubmask1, ipLength, subnetmask1, 0, ipLength); + + byte[] ip2 = new byte[ipLength]; + byte[] subnetmask2 = new byte[ipLength]; + Array.Copy(ipWithSubmask2, 0, ip2, 0, ipLength); + Array.Copy(ipWithSubmask2, ipLength, subnetmask2, 0, ipLength); + return new byte[][] + {ip1, subnetmask1, ip2, subnetmask2}; + } + + /** + * Based on the two IP addresses and their subnet masks the IP range is + * computed for each IP address - subnet mask pair and returned as the + * minimum IP address and the maximum address of the range. + * + * @param ip1 The first IP address. + * @param subnetmask1 The subnet mask of the first IP address. + * @param ip2 The second IP address. + * @param subnetmask2 The subnet mask of the second IP address. + * @return A array with two elements. The first/second element contains the + * min and max IP address of the first/second IP address and its + * subnet mask. + */ + private byte[][] MinMaxIPs( + byte[] ip1, + byte[] subnetmask1, + byte[] ip2, + byte[] subnetmask2) + { + int ipLength = ip1.Length; + byte[] min1 = new byte[ipLength]; + byte[] max1 = new byte[ipLength]; + + byte[] min2 = new byte[ipLength]; + byte[] max2 = new byte[ipLength]; + + for (int i = 0; i < ipLength; i++) + { + min1[i] = (byte)(ip1[i] & subnetmask1[i]); + max1[i] = (byte)(ip1[i] & subnetmask1[i] | ~subnetmask1[i]); + + min2[i] = (byte)(ip2[i] & subnetmask2[i]); + max2[i] = (byte)(ip2[i] & subnetmask2[i] | ~subnetmask2[i]); + } + + return new byte[][] { min1, max1, min2, max2 }; + } + + private void CheckPermittedEmail(ISet permitted, String email) + //throws PkixNameConstraintValidatorException + { + if (permitted == null) + { + return; + } + + IEnumerator it = permitted.GetEnumerator(); + + while (it.MoveNext()) + { + String str = ((String)it.Current); + + if (EmailIsConstrained(email, str)) + { + return; + } + } + + if (email.Length == 0 && permitted.Count == 0) + { + return; + } + + throw new PkixNameConstraintValidatorException( + "Subject email address is not from a permitted subtree."); + } + + private void CheckExcludedEmail(ISet excluded, String email) + //throws PkixNameConstraintValidatorException + { + if (excluded.IsEmpty) + { + return; + } + + IEnumerator it = excluded.GetEnumerator(); + + while (it.MoveNext()) + { + String str = (String)it.Current; + + if (EmailIsConstrained(email, str)) + { + throw new PkixNameConstraintValidatorException( + "Email address is from an excluded subtree."); + } + } + } + + /** + * Checks if the IP ip is included in the permitted ISet + * permitted. + * + * @param permitted A Set of permitted IP addresses with + * their subnet mask as byte arrays. + * @param ip The IP address. + * @throws PkixNameConstraintValidatorException + * if the IP is not permitted. + */ + private void CheckPermittedIP(ISet permitted, byte[] ip) + //throws PkixNameConstraintValidatorException + { + if (permitted == null) + { + return; + } + + IEnumerator it = permitted.GetEnumerator(); + + while (it.MoveNext()) + { + byte[] ipWithSubnet = (byte[])it.Current; + + if (IsIPConstrained(ip, ipWithSubnet)) + { + return; + } + } + if (ip.Length == 0 && permitted.Count == 0) + { + return; + } + throw new PkixNameConstraintValidatorException( + "IP is not from a permitted subtree."); + } + + /** + * Checks if the IP ip is included in the excluded ISet + * excluded. + * + * @param excluded A Set of excluded IP addresses with their + * subnet mask as byte arrays. + * @param ip The IP address. + * @throws PkixNameConstraintValidatorException + * if the IP is excluded. + */ + private void checkExcludedIP(ISet excluded, byte[] ip) + //throws PkixNameConstraintValidatorException + { + if (excluded.IsEmpty) + { + return; + } + + IEnumerator it = excluded.GetEnumerator(); + + while (it.MoveNext()) + { + byte[] ipWithSubnet = (byte[])it.Current; + + if (IsIPConstrained(ip, ipWithSubnet)) + { + throw new PkixNameConstraintValidatorException( + "IP is from an excluded subtree."); + } + } + } + + /** + * Checks if the IP address ip is constrained by + * constraint. + * + * @param ip The IP address. + * @param constraint The constraint. This is an IP address concatenated with + * its subnetmask. + * @return true if constrained, false + * otherwise. + */ + private bool IsIPConstrained(byte[] ip, byte[] constraint) + { + int ipLength = ip.Length; + + if (ipLength != (constraint.Length / 2)) + { + return false; + } + + byte[] subnetMask = new byte[ipLength]; + Array.Copy(constraint, ipLength, subnetMask, 0, ipLength); + + byte[] permittedSubnetAddress = new byte[ipLength]; + + byte[] ipSubnetAddress = new byte[ipLength]; + + // the resulting IP address by applying the subnet mask + for (int i = 0; i < ipLength; i++) + { + permittedSubnetAddress[i] = (byte)(constraint[i] & subnetMask[i]); + ipSubnetAddress[i] = (byte)(ip[i] & subnetMask[i]); + } + + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Arrays.AreEqual(permittedSubnetAddress, ipSubnetAddress); + } + + private bool EmailIsConstrained(String email, String constraint) + { + String sub = email.Substring(email.IndexOf('@') + 1); + // a particular mailbox + if (constraint.IndexOf('@') != -1) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(email).Equals(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(constraint))) + { + return true; + } + } + // on particular host + else if (!(constraint[0].Equals('.'))) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(sub).Equals(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(constraint))) + { + return true; + } + } + // address in sub domain + else if (WithinDomain(sub, constraint)) + { + return true; + } + return false; + } + + private bool WithinDomain(String testDomain, String domain) + { + String tempDomain = domain; + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(tempDomain, ".")) + { + tempDomain = tempDomain.Substring(1); + } + String[] domainParts = tempDomain.Split('.'); // Strings.split(tempDomain, '.'); + String[] testDomainParts = testDomain.Split('.'); // Strings.split(testDomain, '.'); + + // must have at least one subdomain + if (testDomainParts.Length <= domainParts.Length) + { + return false; + } + + int d = testDomainParts.Length - domainParts.Length; + for (int i = -1; i < domainParts.Length; i++) + { + if (i == -1) + { + if (testDomainParts[i + d].Equals("")) + { + return false; + } + } + else if (!BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(testDomainParts[i + d], domainParts[i])) + { + return false; + } + } + return true; + } + + private void CheckPermittedDNS(ISet permitted, String dns) + //throws PkixNameConstraintValidatorException + { + if (permitted == null) + { + return; + } + + IEnumerator it = permitted.GetEnumerator(); + + while (it.MoveNext()) + { + String str = ((String)it.Current); + + // is sub domain + if (WithinDomain(dns, str) + || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(dns).Equals(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(str))) + { + return; + } + } + if (dns.Length == 0 && permitted.Count == 0) + { + return; + } + throw new PkixNameConstraintValidatorException( + "DNS is not from a permitted subtree."); + } + + private void checkExcludedDNS(ISet excluded, String dns) + // throws PkixNameConstraintValidatorException + { + if (excluded.IsEmpty) + { + return; + } + + IEnumerator it = excluded.GetEnumerator(); + + while (it.MoveNext()) + { + String str = ((String)it.Current); + + // is sub domain or the same + if (WithinDomain(dns, str) || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(dns, str)) + { + throw new PkixNameConstraintValidatorException( + "DNS is from an excluded subtree."); + } + } + } + + /** + * The common part of email1 and email2 is + * added to the union union. If email1 and + * email2 have nothing in common they are added both. + * + * @param email1 Email address constraint 1. + * @param email2 Email address constraint 2. + * @param union The union. + */ + private void unionEmail(String email1, String email2, ISet union) + { + // email1 is a particular address + if (email1.IndexOf('@') != -1) + { + String _sub = email1.Substring(email1.IndexOf('@') + 1); + // both are a particular mailbox + if (email2.IndexOf('@') != -1) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(_sub, email2)) + { + union.Add(email2); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a particular host + else + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(_sub, email2)) + { + union.Add(email2); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + } + // email1 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email1, ".")) + { + if (email2.IndexOf('@') != -1) + { + String _sub = email2.Substring(email1.IndexOf('@') + 1); + if (WithinDomain(_sub, email1)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(email1, email2) || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + union.Add(email2); + } + else if (WithinDomain(email2, email1)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + else + { + if (WithinDomain(email2, email1)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + } + // email specifies a host + else + { + if (email2.IndexOf('@') != -1) + { + String _sub = email2.Substring(email1.IndexOf('@') + 1); + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(_sub, email1)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(email1, email2)) + { + union.Add(email2); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a particular host + else + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + } + } + + private void unionURI(String email1, String email2, ISet union) + { + // email1 is a particular address + if (email1.IndexOf('@') != -1) + { + String _sub = email1.Substring(email1.IndexOf('@') + 1); + // both are a particular mailbox + if (email2.IndexOf('@') != -1) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(_sub, email2)) + { + union.Add(email2); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a particular host + else + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(_sub, email2)) + { + union.Add(email2); + } + else + { + union.Add(email1); + union.Add(email2); + + } + } + } + // email1 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email1, ".")) + { + if (email2.IndexOf('@') != -1) + { + String _sub = email2.Substring(email1.IndexOf('@') + 1); + if (WithinDomain(_sub, email1)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(email1, email2) || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + union.Add(email2); + } + else if (WithinDomain(email2, email1)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + else + { + if (WithinDomain(email2, email1)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + } + // email specifies a host + else + { + if (email2.IndexOf('@') != -1) + { + String _sub = email2.Substring(email1.IndexOf('@') + 1); + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(_sub, email1)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(email1, email2)) + { + union.Add(email2); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + // email2 specifies a particular host + else + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + union.Add(email1); + } + else + { + union.Add(email1); + union.Add(email2); + } + } + } + } + + private ISet intersectDNS(ISet permitted, ISet dnss) + { + ISet intersect = new HashSet(); + for (IEnumerator it = dnss.GetEnumerator(); it.MoveNext(); ) + { + String dns = ExtractNameAsString(((GeneralSubtree)it.Current) + .Base); + if (permitted == null) + { + if (dns != null) + { + intersect.Add(dns); + } + } + else + { + IEnumerator _iter = permitted.GetEnumerator(); + while (_iter.MoveNext()) + { + String _permitted = (String)_iter.Current; + + if (WithinDomain(_permitted, dns)) + { + intersect.Add(_permitted); + } + else if (WithinDomain(dns, _permitted)) + { + intersect.Add(dns); + } + } + } + } + + return intersect; + } + + protected ISet unionDNS(ISet excluded, String dns) + { + if (excluded.IsEmpty) + { + if (dns == null) + { + return excluded; + } + excluded.Add(dns); + + return excluded; + } + else + { + ISet union = new HashSet(); + + IEnumerator _iter = excluded.GetEnumerator(); + while (_iter.MoveNext()) + { + String _permitted = (String)_iter.Current; + + if (WithinDomain(_permitted, dns)) + { + union.Add(dns); + } + else if (WithinDomain(dns, _permitted)) + { + union.Add(_permitted); + } + else + { + union.Add(_permitted); + union.Add(dns); + } + } + + return union; + } + } + + /** + * The most restricting part from email1 and + * email2 is added to the intersection intersect. + * + * @param email1 Email address constraint 1. + * @param email2 Email address constraint 2. + * @param intersect The intersection. + */ + private void intersectEmail(String email1, String email2, ISet intersect) + { + // email1 is a particular address + if (email1.IndexOf('@') != -1) + { + String _sub = email1.Substring(email1.IndexOf('@') + 1); + // both are a particular mailbox + if (email2.IndexOf('@') != -1) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + intersect.Add(email1); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(_sub, email2)) + { + intersect.Add(email1); + } + } + // email2 specifies a particular host + else + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(_sub, email2)) + { + intersect.Add(email1); + } + } + } + // email specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email1, ".")) + { + if (email2.IndexOf('@') != -1) + { + String _sub = email2.Substring(email1.IndexOf('@') + 1); + if (WithinDomain(_sub, email1)) + { + intersect.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(email1, email2) || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + intersect.Add(email1); + } + else if (WithinDomain(email2, email1)) + { + intersect.Add(email2); + } + } + else + { + if (WithinDomain(email2, email1)) + { + intersect.Add(email2); + } + } + } + // email1 specifies a host + else + { + if (email2.IndexOf('@') != -1) + { + String _sub = email2.Substring(email2.IndexOf('@') + 1); + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(_sub, email1)) + { + intersect.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(email1, email2)) + { + intersect.Add(email1); + } + } + // email2 specifies a particular host + else + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + intersect.Add(email1); + } + } + } + } + + private void checkExcludedURI(ISet excluded, String uri) + // throws PkixNameConstraintValidatorException + { + if (excluded.IsEmpty) + { + return; + } + + IEnumerator it = excluded.GetEnumerator(); + + while (it.MoveNext()) + { + String str = ((String)it.Current); + + if (IsUriConstrained(uri, str)) + { + throw new PkixNameConstraintValidatorException( + "URI is from an excluded subtree."); + } + } + } + + private ISet intersectURI(ISet permitted, ISet uris) + { + ISet intersect = new HashSet(); + for (IEnumerator it = uris.GetEnumerator(); it.MoveNext(); ) + { + String uri = ExtractNameAsString(((GeneralSubtree)it.Current) + .Base); + if (permitted == null) + { + if (uri != null) + { + intersect.Add(uri); + } + } + else + { + IEnumerator _iter = permitted.GetEnumerator(); + while (_iter.MoveNext()) + { + String _permitted = (String)_iter.Current; + intersectURI(_permitted, uri, intersect); + } + } + } + return intersect; + } + + private ISet unionURI(ISet excluded, String uri) + { + if (excluded.IsEmpty) + { + if (uri == null) + { + return excluded; + } + excluded.Add(uri); + + return excluded; + } + else + { + ISet union = new HashSet(); + + IEnumerator _iter = excluded.GetEnumerator(); + while (_iter.MoveNext()) + { + String _excluded = (String)_iter.Current; + + unionURI(_excluded, uri, union); + } + + return union; + } + } + + private void intersectURI(String email1, String email2, ISet intersect) + { + // email1 is a particular address + if (email1.IndexOf('@') != -1) + { + String _sub = email1.Substring(email1.IndexOf('@') + 1); + // both are a particular mailbox + if (email2.IndexOf('@') != -1) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + intersect.Add(email1); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(_sub, email2)) + { + intersect.Add(email1); + } + } + // email2 specifies a particular host + else + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(_sub, email2)) + { + intersect.Add(email1); + } + } + } + // email specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email1, ".")) + { + if (email2.IndexOf('@') != -1) + { + String _sub = email2.Substring(email1.IndexOf('@') + 1); + if (WithinDomain(_sub, email1)) + { + intersect.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(email1, email2) || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + intersect.Add(email1); + } + else if (WithinDomain(email2, email1)) + { + intersect.Add(email2); + } + } + else + { + if (WithinDomain(email2, email1)) + { + intersect.Add(email2); + } + } + } + // email1 specifies a host + else + { + if (email2.IndexOf('@') != -1) + { + String _sub = email2.Substring(email2.IndexOf('@') + 1); + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(_sub, email1)) + { + intersect.Add(email2); + } + } + // email2 specifies a domain + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(email2, ".")) + { + if (WithinDomain(email1, email2)) + { + intersect.Add(email1); + } + } + // email2 specifies a particular host + else + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(email1, email2)) + { + intersect.Add(email1); + } + } + } + } + + private void CheckPermittedURI(ISet permitted, String uri) + // throws PkixNameConstraintValidatorException + { + if (permitted == null) + { + return; + } + + IEnumerator it = permitted.GetEnumerator(); + + while (it.MoveNext()) + { + String str = ((String)it.Current); + + if (IsUriConstrained(uri, str)) + { + return; + } + } + if (uri.Length == 0 && permitted.Count == 0) + { + return; + } + throw new PkixNameConstraintValidatorException( + "URI is not from a permitted subtree."); + } + + private bool IsUriConstrained(String uri, String constraint) + { + String host = ExtractHostFromURL(uri); + // a host + if (!BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(constraint, ".")) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EqualsIgnoreCase(host, constraint)) + { + return true; + } + } + + // in sub domain or domain + else if (WithinDomain(host, constraint)) + { + return true; + } + + return false; + } + + private static String ExtractHostFromURL(String url) + { + // see RFC 1738 + // remove ':' after protocol, e.g. http: + String sub = url.Substring(url.IndexOf(':') + 1); + // extract host from Common Internet Scheme Syntax, e.g. http:// + int idxOfSlashes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.IndexOf(sub, "//"); + if (idxOfSlashes != -1) + { + sub = sub.Substring(idxOfSlashes + 2); + } + // first remove port, e.g. http://test.com:21 + if (sub.LastIndexOf(':') != -1) + { + sub = sub.Substring(0, sub.LastIndexOf(':')); + } + // remove user and password, e.g. http://john:password@test.com + sub = sub.Substring(sub.IndexOf(':') + 1); + sub = sub.Substring(sub.IndexOf('@') + 1); + // remove local parts, e.g. http://test.com/bla + if (sub.IndexOf('/') != -1) + { + sub = sub.Substring(0, sub.IndexOf('/')); + } + return sub; + } + + /** + * Checks if the given GeneralName is in the permitted ISet. + * + * @param name The GeneralName + * @throws PkixNameConstraintValidatorException + * If the name + */ + public void checkPermitted(GeneralName name) + // throws PkixNameConstraintValidatorException + { + switch (name.TagNo) + { + case 1: + CheckPermittedEmail(permittedSubtreesEmail, + ExtractNameAsString(name)); + break; + case 2: + CheckPermittedDNS(permittedSubtreesDNS, DerIA5String.GetInstance( + name.Name).GetString()); + break; + case 4: + CheckPermittedDN(Asn1Sequence.GetInstance(name.Name.ToAsn1Object())); + break; + case 6: + CheckPermittedURI(permittedSubtreesURI, DerIA5String.GetInstance( + name.Name).GetString()); + break; + case 7: + byte[] ip = Asn1OctetString.GetInstance(name.Name).GetOctets(); + + CheckPermittedIP(permittedSubtreesIP, ip); + break; + } + } + + /** + * Check if the given GeneralName is contained in the excluded ISet. + * + * @param name The GeneralName. + * @throws PkixNameConstraintValidatorException + * If the name is + * excluded. + */ + public void checkExcluded(GeneralName name) + // throws PkixNameConstraintValidatorException + { + switch (name.TagNo) + { + case 1: + CheckExcludedEmail(excludedSubtreesEmail, ExtractNameAsString(name)); + break; + case 2: + checkExcludedDNS(excludedSubtreesDNS, DerIA5String.GetInstance( + name.Name).GetString()); + break; + case 4: + CheckExcludedDN(Asn1Sequence.GetInstance(name.Name.ToAsn1Object())); + break; + case 6: + checkExcludedURI(excludedSubtreesURI, DerIA5String.GetInstance( + name.Name).GetString()); + break; + case 7: + byte[] ip = Asn1OctetString.GetInstance(name.Name).GetOctets(); + + checkExcludedIP(excludedSubtreesIP, ip); + break; + } + } + + /** + * Updates the permitted ISet of these name constraints with the intersection + * with the given subtree. + * + * @param permitted The permitted subtrees + */ + + public void IntersectPermittedSubtree(Asn1Sequence permitted) + { + IDictionary subtreesMap = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + // group in ISets in a map ordered by tag no. + for (IEnumerator e = permitted.GetEnumerator(); e.MoveNext(); ) + { + GeneralSubtree subtree = GeneralSubtree.GetInstance(e.Current); + + int tagNo = subtree.Base.TagNo; + if (subtreesMap[tagNo] == null) + { + subtreesMap[tagNo] = new HashSet(); + } + + ((ISet)subtreesMap[tagNo]).Add(subtree); + } + + for (IEnumerator it = subtreesMap.GetEnumerator(); it.MoveNext(); ) + { + DictionaryEntry entry = (DictionaryEntry)it.Current; + + // go through all subtree groups + switch ((int)entry.Key ) + { + case 1: + permittedSubtreesEmail = IntersectEmail(permittedSubtreesEmail, + (ISet)entry.Value); + break; + case 2: + permittedSubtreesDNS = intersectDNS(permittedSubtreesDNS, + (ISet)entry.Value); + break; + case 4: + permittedSubtreesDN = IntersectDN(permittedSubtreesDN, + (ISet)entry.Value); + break; + case 6: + permittedSubtreesURI = intersectURI(permittedSubtreesURI, + (ISet)entry.Value); + break; + case 7: + permittedSubtreesIP = IntersectIP(permittedSubtreesIP, + (ISet)entry.Value); + break; + } + } + } + + private String ExtractNameAsString(GeneralName name) + { + return DerIA5String.GetInstance(name.Name).GetString(); + } + + public void IntersectEmptyPermittedSubtree(int nameType) + { + switch (nameType) + { + case 1: + permittedSubtreesEmail = new HashSet(); + break; + case 2: + permittedSubtreesDNS = new HashSet(); + break; + case 4: + permittedSubtreesDN = new HashSet(); + break; + case 6: + permittedSubtreesURI = new HashSet(); + break; + case 7: + permittedSubtreesIP = new HashSet(); + break; + } + } + + /** + * Adds a subtree to the excluded ISet of these name constraints. + * + * @param subtree A subtree with an excluded GeneralName. + */ + public void AddExcludedSubtree(GeneralSubtree subtree) + { + GeneralName subTreeBase = subtree.Base; + + switch (subTreeBase.TagNo) + { + case 1: + excludedSubtreesEmail = UnionEmail(excludedSubtreesEmail, + ExtractNameAsString(subTreeBase)); + break; + case 2: + excludedSubtreesDNS = unionDNS(excludedSubtreesDNS, + ExtractNameAsString(subTreeBase)); + break; + case 4: + excludedSubtreesDN = UnionDN(excludedSubtreesDN, + (Asn1Sequence)subTreeBase.Name.ToAsn1Object()); + break; + case 6: + excludedSubtreesURI = unionURI(excludedSubtreesURI, + ExtractNameAsString(subTreeBase)); + break; + case 7: + excludedSubtreesIP = UnionIP(excludedSubtreesIP, Asn1OctetString + .GetInstance(subTreeBase.Name).GetOctets()); + break; + } + } + + /** + * Returns the maximum IP address. + * + * @param ip1 The first IP address. + * @param ip2 The second IP address. + * @return The maximum IP address. + */ + private static byte[] Max(byte[] ip1, byte[] ip2) + { + for (int i = 0; i < ip1.Length; i++) + { + if ((ip1[i] & 0xFFFF) > (ip2[i] & 0xFFFF)) + { + return ip1; + } + } + return ip2; + } + + /** + * Returns the minimum IP address. + * + * @param ip1 The first IP address. + * @param ip2 The second IP address. + * @return The minimum IP address. + */ + private static byte[] Min(byte[] ip1, byte[] ip2) + { + for (int i = 0; i < ip1.Length; i++) + { + if ((ip1[i] & 0xFFFF) < (ip2[i] & 0xFFFF)) + { + return ip1; + } + } + return ip2; + } + + /** + * Compares IP address ip1 with ip2. If ip1 + * is equal to ip2 0 is returned. If ip1 is bigger 1 is returned, -1 + * otherwise. + * + * @param ip1 The first IP address. + * @param ip2 The second IP address. + * @return 0 if ip1 is equal to ip2, 1 if ip1 is bigger, -1 otherwise. + */ + private static int CompareTo(byte[] ip1, byte[] ip2) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Arrays.AreEqual(ip1, ip2)) + { + return 0; + } + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Arrays.AreEqual(Max(ip1, ip2), ip1)) + { + return 1; + } + return -1; + } + + /** + * Returns the logical OR of the IP addresses ip1 and + * ip2. + * + * @param ip1 The first IP address. + * @param ip2 The second IP address. + * @return The OR of ip1 and ip2. + */ + private static byte[] Or(byte[] ip1, byte[] ip2) + { + byte[] temp = new byte[ip1.Length]; + for (int i = 0; i < ip1.Length; i++) + { + temp[i] = (byte)(ip1[i] | ip2[i]); + } + return temp; + } + + [Obsolete("Use GetHashCode instead")] + public int HashCode() + { + return GetHashCode(); + } + + public override int GetHashCode() + { + return HashCollection(excludedSubtreesDN) + + HashCollection(excludedSubtreesDNS) + + HashCollection(excludedSubtreesEmail) + + HashCollection(excludedSubtreesIP) + + HashCollection(excludedSubtreesURI) + + HashCollection(permittedSubtreesDN) + + HashCollection(permittedSubtreesDNS) + + HashCollection(permittedSubtreesEmail) + + HashCollection(permittedSubtreesIP) + + HashCollection(permittedSubtreesURI); + } + + private int HashCollection(ICollection coll) + { + if (coll == null) + { + return 0; + } + int hash = 0; + IEnumerator it1 = coll.GetEnumerator(); + while (it1.MoveNext()) + { + Object o = it1.Current; + if (o is byte[]) + { + hash += BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Arrays.GetHashCode((byte[])o); + } + else + { + hash += o.GetHashCode(); + } + } + return hash; + } + + public override bool Equals(Object o) + { + if (!(o is PkixNameConstraintValidator)) + return false; + + PkixNameConstraintValidator constraintValidator = (PkixNameConstraintValidator)o; + + return CollectionsAreEqual(constraintValidator.excludedSubtreesDN, excludedSubtreesDN) + && CollectionsAreEqual(constraintValidator.excludedSubtreesDNS, excludedSubtreesDNS) + && CollectionsAreEqual(constraintValidator.excludedSubtreesEmail, excludedSubtreesEmail) + && CollectionsAreEqual(constraintValidator.excludedSubtreesIP, excludedSubtreesIP) + && CollectionsAreEqual(constraintValidator.excludedSubtreesURI, excludedSubtreesURI) + && CollectionsAreEqual(constraintValidator.permittedSubtreesDN, permittedSubtreesDN) + && CollectionsAreEqual(constraintValidator.permittedSubtreesDNS, permittedSubtreesDNS) + && CollectionsAreEqual(constraintValidator.permittedSubtreesEmail, permittedSubtreesEmail) + && CollectionsAreEqual(constraintValidator.permittedSubtreesIP, permittedSubtreesIP) + && CollectionsAreEqual(constraintValidator.permittedSubtreesURI, permittedSubtreesURI); + } + + private bool CollectionsAreEqual(ICollection coll1, ICollection coll2) + { + if (coll1 == coll2) + { + return true; + } + if (coll1 == null || coll2 == null) + { + return false; + } + if (coll1.Count != coll2.Count) + { + return false; + } + IEnumerator it1 = coll1.GetEnumerator(); + + while (it1.MoveNext()) + { + Object a = it1.Current; + IEnumerator it2 = coll2.GetEnumerator(); + bool found = false; + while (it2.MoveNext()) + { + Object b = it2.Current; + if (SpecialEquals(a, b)) + { + found = true; + break; + } + } + if (!found) + { + return false; + } + } + return true; + } + + private bool SpecialEquals(Object o1, Object o2) + { + if (o1 == o2) + { + return true; + } + if (o1 == null || o2 == null) + { + return false; + } + if ((o1 is byte[]) && (o2 is byte[])) + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Arrays.AreEqual((byte[])o1, (byte[])o2); + } + else + { + return o1.Equals(o2); + } + } + + /** + * Stringifies an IPv4 or v6 address with subnet mask. + * + * @param ip The IP with subnet mask. + * @return The stringified IP address. + */ + private String StringifyIP(byte[] ip) + { + String temp = ""; + for (int i = 0; i < ip.Length / 2; i++) + { + //temp += Integer.toString(ip[i] & 0x00FF) + "."; + temp += (ip[i] & 0x00FF) + "."; + } + temp = temp.Substring(0, temp.Length - 1); + temp += "/"; + for (int i = ip.Length / 2; i < ip.Length; i++) + { + //temp += Integer.toString(ip[i] & 0x00FF) + "."; + temp += (ip[i] & 0x00FF) + "."; + } + temp = temp.Substring(0, temp.Length - 1); + return temp; + } + + private String StringifyIPCollection(ISet ips) + { + String temp = ""; + temp += "["; + for (IEnumerator it = ips.GetEnumerator(); it.MoveNext(); ) + { + temp += StringifyIP((byte[])it.Current) + ","; + } + if (temp.Length > 1) + { + temp = temp.Substring(0, temp.Length - 1); + } + temp += "]"; + + return temp; + } + + public override String ToString() + { + String temp = ""; + + temp += "permitted:\n"; + if (permittedSubtreesDN != null) + { + temp += "DN:\n"; + temp += permittedSubtreesDN.ToString() + "\n"; + } + if (permittedSubtreesDNS != null) + { + temp += "DNS:\n"; + temp += permittedSubtreesDNS.ToString() + "\n"; + } + if (permittedSubtreesEmail != null) + { + temp += "Email:\n"; + temp += permittedSubtreesEmail.ToString() + "\n"; + } + if (permittedSubtreesURI != null) + { + temp += "URI:\n"; + temp += permittedSubtreesURI.ToString() + "\n"; + } + if (permittedSubtreesIP != null) + { + temp += "IP:\n"; + temp += StringifyIPCollection(permittedSubtreesIP) + "\n"; + } + temp += "excluded:\n"; + if (!(excludedSubtreesDN.IsEmpty)) + { + temp += "DN:\n"; + temp += excludedSubtreesDN.ToString() + "\n"; + } + if (!excludedSubtreesDNS.IsEmpty) + { + temp += "DNS:\n"; + temp += excludedSubtreesDNS.ToString() + "\n"; + } + if (!excludedSubtreesEmail.IsEmpty) + { + temp += "Email:\n"; + temp += excludedSubtreesEmail.ToString() + "\n"; + } + if (!excludedSubtreesURI.IsEmpty) + { + temp += "URI:\n"; + temp += excludedSubtreesURI.ToString() + "\n"; + } + if (!excludedSubtreesIP.IsEmpty) + { + temp += "IP:\n"; + temp += StringifyIPCollection(excludedSubtreesIP) + "\n"; + } + return temp; + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidator.cs.meta new file mode 100644 index 00000000..eb5e5c36 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f526512b4e00a18408980528de75bc05 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidatorException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidatorException.cs new file mode 100644 index 00000000..89157ed7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidatorException.cs @@ -0,0 +1,20 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class PkixNameConstraintValidatorException + : Exception + { + public PkixNameConstraintValidatorException(String msg) + : base(msg) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidatorException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidatorException.cs.meta new file mode 100644 index 00000000..d0dce51b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixNameConstraintValidatorException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7731ec37d612ebe4998773dbfb370c49 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixParameters.cs new file mode 100644 index 00000000..45e20bc9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixParameters.cs @@ -0,0 +1,897 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /// + /// Summary description for PkixParameters. + /// + public class PkixParameters +// : ICertPathParameters + { + /** + * This is the default PKIX validity model. Actually there are two variants + * of this: The PKIX model and the modified PKIX model. The PKIX model + * verifies that all involved certificates must have been valid at the + * current time. The modified PKIX model verifies that all involved + * certificates were valid at the signing time. Both are indirectly choosen + * with the {@link PKIXParameters#setDate(java.util.Date)} method, so this + * methods sets the Date when all certificates must have been + * valid. + */ + public const int PkixValidityModel = 0; + + /** + * This model uses the following validity model. Each certificate must have + * been valid at the moment where is was used. That means the end + * certificate must have been valid at the time the signature was done. The + * CA certificate which signed the end certificate must have been valid, + * when the end certificate was signed. The CA (or Root CA) certificate must + * have been valid, when the CA certificate was signed and so on. So the + * {@link PKIXParameters#setDate(java.util.Date)} method sets the time, when + * the end certificate must have been valid.

    It is used e.g. + * in the German signature law. + */ + public const int ChainValidityModel = 1; + + private ISet trustAnchors; + private DateTimeObject date; + private IList certPathCheckers; + private bool revocationEnabled = true; + private ISet initialPolicies; + //private bool checkOnlyEECertificateCrl = false; + private bool explicitPolicyRequired = false; + private bool anyPolicyInhibited = false; + private bool policyMappingInhibited = false; + private bool policyQualifiersRejected = true; + private IX509Selector certSelector; + private IList stores; + private IX509Selector selector; + private bool additionalLocationsEnabled; + private IList additionalStores; + private ISet trustedACIssuers; + private ISet necessaryACAttributes; + private ISet prohibitedACAttributes; + private ISet attrCertCheckers; + private int validityModel = PkixValidityModel; + private bool useDeltas = false; + + /** + * Creates an instance of PKIXParameters with the specified Set of + * most-trusted CAs. Each element of the set is a TrustAnchor.
    + *
    + * Note that the Set is copied to protect against subsequent modifications. + * + * @param trustAnchors + * a Set of TrustAnchors + * + * @exception InvalidAlgorithmParameterException + * if the specified Set is empty + * (trustAnchors.isEmpty() == true) + * @exception NullPointerException + * if the specified Set is null + * @exception ClassCastException + * if any of the elements in the Set are not of type + * java.security.cert.TrustAnchor + */ + public PkixParameters( + ISet trustAnchors) + { + SetTrustAnchors(trustAnchors); + + this.initialPolicies = new HashSet(); + this.certPathCheckers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + this.stores = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + this.additionalStores = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + this.trustedACIssuers = new HashSet(); + this.necessaryACAttributes = new HashSet(); + this.prohibitedACAttributes = new HashSet(); + this.attrCertCheckers = new HashSet(); + } + +// // TODO implement for other keystores (see Java build)? +// /** +// * Creates an instance of PKIXParameters that +// * populates the set of most-trusted CAs from the trusted +// * certificate entries contained in the specified KeyStore. +// * Only keystore entries that contain trusted X509Certificates +// * are considered; all other certificate types are ignored. +// * +// * @param keystore a KeyStore from which the set of +// * most-trusted CAs will be populated +// * @throws KeyStoreException if the keystore has not been initialized +// * @throws InvalidAlgorithmParameterException if the keystore does +// * not contain at least one trusted certificate entry +// * @throws NullPointerException if the keystore is null +// */ +// public PkixParameters( +// Pkcs12Store keystore) +//// throws KeyStoreException, InvalidAlgorithmParameterException +// { +// if (keystore == null) +// throw new ArgumentNullException("keystore"); +// ISet trustAnchors = new HashSet(); +// foreach (string alias in keystore.Aliases) +// { +// if (keystore.IsCertificateEntry(alias)) +// { +// X509CertificateEntry x509Entry = keystore.GetCertificate(alias); +// trustAnchors.Add(new TrustAnchor(x509Entry.Certificate, null)); +// } +// } +// SetTrustAnchors(trustAnchors); +// +// this.initialPolicies = new HashSet(); +// this.certPathCheckers = new ArrayList(); +// this.stores = new ArrayList(); +// this.additionalStores = new ArrayList(); +// this.trustedACIssuers = new HashSet(); +// this.necessaryACAttributes = new HashSet(); +// this.prohibitedACAttributes = new HashSet(); +// this.attrCertCheckers = new HashSet(); +// } + + public virtual bool IsRevocationEnabled + { + get { return revocationEnabled; } + set { revocationEnabled = value; } + } + + public virtual bool IsExplicitPolicyRequired + { + get { return explicitPolicyRequired; } + set { this.explicitPolicyRequired = value; } + } + + public virtual bool IsAnyPolicyInhibited + { + get { return anyPolicyInhibited; } + set { this.anyPolicyInhibited = value; } + } + + public virtual bool IsPolicyMappingInhibited + { + get { return policyMappingInhibited; } + set { this.policyMappingInhibited = value; } + } + + public virtual bool IsPolicyQualifiersRejected + { + get { return policyQualifiersRejected; } + set { this.policyQualifiersRejected = value; } + } + + //public bool IsCheckOnlyEECertificateCrl + //{ + // get { return this.checkOnlyEECertificateCrl; } + // set { this.checkOnlyEECertificateCrl = value; } + //} + + public virtual DateTimeObject Date + { + get { return this.date; } + set { this.date = value; } + } + + // Returns a Set of the most-trusted CAs. + public virtual ISet GetTrustAnchors() + { + return new HashSet(this.trustAnchors); + } + + // Sets the set of most-trusted CAs. + // Set is copied to protect against subsequent modifications. + public virtual void SetTrustAnchors( + ISet tas) + { + if (tas == null) + throw new ArgumentNullException("value"); + if (tas.IsEmpty) + throw new ArgumentException("non-empty set required", "value"); + + // Explicit copy to enforce type-safety + this.trustAnchors = new HashSet(); + foreach (TrustAnchor ta in tas) + { + if (ta != null) + { + trustAnchors.Add(ta); + } + } + } + + /** + * Returns the required constraints on the target certificate. The + * constraints are returned as an instance of CertSelector. If + * null, no constraints are defined.
    + *
    + * Note that the CertSelector returned is cloned to protect against + * subsequent modifications. + * + * @return a CertSelector specifying the constraints on the target + * certificate (or null) + * + * @see #setTargetCertConstraints(CertSelector) + */ + public virtual X509CertStoreSelector GetTargetCertConstraints() + { + if (certSelector == null) + { + return null; + } + + return (X509CertStoreSelector)certSelector.Clone(); + } + + /** + * Sets the required constraints on the target certificate. The constraints + * are specified as an instance of CertSelector. If null, no constraints are + * defined.
    + *
    + * Note that the CertSelector specified is cloned to protect against + * subsequent modifications. + * + * @param selector + * a CertSelector specifying the constraints on the target + * certificate (or null) + * + * @see #getTargetCertConstraints() + */ + public virtual void SetTargetCertConstraints( + IX509Selector selector) + { + if (selector == null) + { + certSelector = null; + } + else + { + certSelector = (IX509Selector)selector.Clone(); + } + } + + /** + * Returns an immutable Set of initial policy identifiers (OID strings), + * indicating that any one of these policies would be acceptable to the + * certificate user for the purposes of certification path processing. The + * default return value is an empty Set, which is + * interpreted as meaning that any policy would be acceptable. + * + * @return an immutable Set of initial policy OIDs in String + * format, or an empty Set (implying any policy is + * acceptable). Never returns null. + * + * @see #setInitialPolicies(java.util.Set) + */ + public virtual ISet GetInitialPolicies() + { + ISet returnSet = initialPolicies; + + // TODO Can it really be null? + if (initialPolicies == null) + { + returnSet = new HashSet(); + } + + return new HashSet(returnSet); + } + + /** + * Sets the Set of initial policy identifiers (OID strings), + * indicating that any one of these policies would be acceptable to the + * certificate user for the purposes of certification path processing. By + * default, any policy is acceptable (i.e. all policies), so a user that + * wants to allow any policy as acceptable does not need to call this + * method, or can call it with an empty Set (or + * null).
    + *
    + * Note that the Set is copied to protect against subsequent modifications.
    + *
    + * + * @param initialPolicies + * a Set of initial policy OIDs in String format (or + * null) + * + * @exception ClassCastException + * if any of the elements in the set are not of type String + * + * @see #getInitialPolicies() + */ + public virtual void SetInitialPolicies( + ISet initialPolicies) + { + this.initialPolicies = new HashSet(); + if (initialPolicies != null) + { + foreach (string obj in initialPolicies) + { + if (obj != null) + { + this.initialPolicies.Add(obj); + } + } + } + } + + /** + * Sets a List of additional certification path checkers. If + * the specified List contains an object that is not a PKIXCertPathChecker, + * it is ignored.
    + *
    + * Each PKIXCertPathChecker specified implements additional + * checks on a certificate. Typically, these are checks to process and + * verify private extensions contained in certificates. Each + * PKIXCertPathChecker should be instantiated with any + * initialization parameters needed to execute the check.
    + *
    + * This method allows sophisticated applications to extend a PKIX + * CertPathValidator or CertPathBuilder. Each + * of the specified PKIXCertPathCheckers will be called, in turn, by a PKIX + * CertPathValidator or CertPathBuilder for + * each certificate processed or validated.
    + *
    + * Regardless of whether these additional PKIXCertPathCheckers are set, a + * PKIX CertPathValidator or CertPathBuilder + * must perform all of the required PKIX checks on each certificate. The one + * exception to this rule is if the RevocationEnabled flag is set to false + * (see the {@link #setRevocationEnabled(boolean) setRevocationEnabled} + * method).
    + *
    + * Note that the List supplied here is copied and each PKIXCertPathChecker + * in the list is cloned to protect against subsequent modifications. + * + * @param checkers + * a List of PKIXCertPathCheckers. May be null, in which case no + * additional checkers will be used. + * @exception ClassCastException + * if any of the elements in the list are not of type + * java.security.cert.PKIXCertPathChecker + * @see #getCertPathCheckers() + */ + public virtual void SetCertPathCheckers(IList checkers) + { + certPathCheckers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + if (checkers != null) + { + foreach (PkixCertPathChecker obj in checkers) + { + certPathCheckers.Add(obj.Clone()); + } + } + } + + /** + * Returns the List of certification path checkers. Each PKIXCertPathChecker + * in the returned IList is cloned to protect against subsequent modifications. + * + * @return an immutable List of PKIXCertPathCheckers (may be empty, but not + * null) + * + * @see #setCertPathCheckers(java.util.List) + */ + public virtual IList GetCertPathCheckers() + { + IList checkers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + foreach (PkixCertPathChecker obj in certPathCheckers) + { + checkers.Add(obj.Clone()); + } + return checkers; + } + + /** + * Adds a PKIXCertPathChecker to the list of certification + * path checkers. See the {@link #setCertPathCheckers setCertPathCheckers} + * method for more details. + *

    + * Note that the PKIXCertPathChecker is cloned to protect + * against subsequent modifications.

    + * + * @param checker a PKIXCertPathChecker to add to the list of + * checks. If null, the checker is ignored (not added to list). + */ + public virtual void AddCertPathChecker( + PkixCertPathChecker checker) + { + if (checker != null) + { + certPathCheckers.Add(checker.Clone()); + } + } + + public virtual object Clone() + { + // FIXME Check this whole method against the Java implementation! + + PkixParameters parameters = new PkixParameters(GetTrustAnchors()); + parameters.SetParams(this); + return parameters; + + +// PkixParameters obj = new PkixParameters(new HashSet()); +//// (PkixParameters) this.MemberwiseClone(); +// obj.x509Stores = new ArrayList(x509Stores); +// obj.certPathCheckers = new ArrayList(certPathCheckers); +// +// //Iterator iter = certPathCheckers.iterator(); +// //obj.certPathCheckers = new ArrayList(); +// //while (iter.hasNext()) +// //{ +// // obj.certPathCheckers.add(((PKIXCertPathChecker)iter.next()) +// // .clone()); +// //} +// //if (initialPolicies != null) +// //{ +// // obj.initialPolicies = new HashSet(initialPolicies); +// //} +//// if (trustAnchors != null) +//// { +//// obj.trustAnchors = new HashSet(trustAnchors); +//// } +//// if (certSelector != null) +//// { +//// obj.certSelector = (X509CertStoreSelector) certSelector.Clone(); +//// } +// return obj; + } + + /** + * Method to support Clone() under J2ME. + * super.Clone() does not exist and fields are not copied. + * + * @param params Parameters to set. If this are + * ExtendedPkixParameters they are copied to. + */ + protected virtual void SetParams( + PkixParameters parameters) + { + Date = parameters.Date; + SetCertPathCheckers(parameters.GetCertPathCheckers()); + IsAnyPolicyInhibited = parameters.IsAnyPolicyInhibited; + IsExplicitPolicyRequired = parameters.IsExplicitPolicyRequired; + IsPolicyMappingInhibited = parameters.IsPolicyMappingInhibited; + IsRevocationEnabled = parameters.IsRevocationEnabled; + SetInitialPolicies(parameters.GetInitialPolicies()); + IsPolicyQualifiersRejected = parameters.IsPolicyQualifiersRejected; + SetTargetCertConstraints(parameters.GetTargetCertConstraints()); + SetTrustAnchors(parameters.GetTrustAnchors()); + + validityModel = parameters.validityModel; + useDeltas = parameters.useDeltas; + additionalLocationsEnabled = parameters.additionalLocationsEnabled; + selector = parameters.selector == null ? null + : (IX509Selector) parameters.selector.Clone(); + stores = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(parameters.stores); + additionalStores = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(parameters.additionalStores); + trustedACIssuers = new HashSet(parameters.trustedACIssuers); + prohibitedACAttributes = new HashSet(parameters.prohibitedACAttributes); + necessaryACAttributes = new HashSet(parameters.necessaryACAttributes); + attrCertCheckers = new HashSet(parameters.attrCertCheckers); + } + + /** + * Whether delta CRLs should be used for checking the revocation status. + * Defaults to false. + */ + public virtual bool IsUseDeltasEnabled + { + get { return useDeltas; } + set { useDeltas = value; } + } + + /** + * The validity model. + * @see #CHAIN_VALIDITY_MODEL + * @see #PKIX_VALIDITY_MODEL + */ + public virtual int ValidityModel + { + get { return validityModel; } + set { validityModel = value; } + } + + /** + * Sets the Bouncy Castle Stores for finding CRLs, certificates, attribute + * certificates or cross certificates. + *

    + * The IList is cloned. + *

    + * + * @param stores A list of stores to use. + * @see #getStores + * @throws ClassCastException if an element of stores is not + * a {@link Store}. + */ + public virtual void SetStores( + IList stores) + { + if (stores == null) + { + this.stores = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + } + else + { + foreach (object obj in stores) + { + if (!(obj is IX509Store)) + { + throw new InvalidCastException( + "All elements of list must be of type " + typeof(IX509Store).FullName); + } + } + this.stores = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(stores); + } + } + + /** + * Adds a Bouncy Castle {@link Store} to find CRLs, certificates, attribute + * certificates or cross certificates. + *

    + * This method should be used to add local stores, like collection based + * X.509 stores, if available. Local stores should be considered first, + * before trying to use additional (remote) locations, because they do not + * need possible additional network traffic. + *

    + * If store is null it is ignored. + *

    + * + * @param store The store to add. + * @see #getStores + */ + public virtual void AddStore( + IX509Store store) + { + if (store != null) + { + stores.Add(store); + } + } + + /** + * Adds an additional Bouncy Castle {@link Store} to find CRLs, certificates, + * attribute certificates or cross certificates. + *

    + * You should not use this method. This method is used for adding additional + * X.509 stores, which are used to add (remote) locations, e.g. LDAP, found + * during X.509 object processing, e.g. in certificates or CRLs. This method + * is used in PKIX certification path processing. + *

    + * If store is null it is ignored. + *

    + * + * @param store The store to add. + * @see #getStores() + */ + public virtual void AddAdditionalStore( + IX509Store store) + { + if (store != null) + { + additionalStores.Add(store); + } + } + + /** + * Returns an IList of additional Bouncy Castle + * Stores used for finding CRLs, certificates, attribute + * certificates or cross certificates. + * + * @return an immutable IList of additional Bouncy Castle + * Stores. Never null. + * + * @see #addAddionalStore(Store) + */ + public virtual IList GetAdditionalStores() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(additionalStores); + } + + /** + * Returns an IList of Bouncy Castle + * Stores used for finding CRLs, certificates, attribute + * certificates or cross certificates. + * + * @return an immutable IList of Bouncy Castle + * Stores. Never null. + * + * @see #setStores(IList) + */ + public virtual IList GetStores() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(stores); + } + + /** + * Returns if additional {@link X509Store}s for locations like LDAP found + * in certificates or CRLs should be used. + * + * @return Returns true if additional stores are used. + */ + public virtual bool IsAdditionalLocationsEnabled + { + get { return additionalLocationsEnabled; } + } + + /** + * Sets if additional {@link X509Store}s for locations like LDAP found in + * certificates or CRLs should be used. + * + * @param enabled true if additional stores are used. + */ + public virtual void SetAdditionalLocationsEnabled( + bool enabled) + { + additionalLocationsEnabled = enabled; + } + + /** + * Returns the required constraints on the target certificate or attribute + * certificate. The constraints are returned as an instance of + * IX509Selector. If null, no constraints are + * defined. + * + *

    + * The target certificate in a PKIX path may be a certificate or an + * attribute certificate. + *

    + * Note that the IX509Selector returned is cloned to protect + * against subsequent modifications. + *

    + * @return a IX509Selector specifying the constraints on the + * target certificate or attribute certificate (or null) + * @see #setTargetConstraints + * @see X509CertStoreSelector + * @see X509AttributeCertStoreSelector + */ + public virtual IX509Selector GetTargetConstraints() + { + if (selector != null) + { + return (IX509Selector) selector.Clone(); + } + else + { + return null; + } + } + + /** + * Sets the required constraints on the target certificate or attribute + * certificate. The constraints are specified as an instance of + * IX509Selector. If null, no constraints are + * defined. + *

    + * The target certificate in a PKIX path may be a certificate or an + * attribute certificate. + *

    + * Note that the IX509Selector specified is cloned to protect + * against subsequent modifications. + *

    + * + * @param selector a IX509Selector specifying the constraints on + * the target certificate or attribute certificate (or + * null) + * @see #getTargetConstraints + * @see X509CertStoreSelector + * @see X509AttributeCertStoreSelector + */ + public virtual void SetTargetConstraints(IX509Selector selector) + { + if (selector != null) + { + this.selector = (IX509Selector) selector.Clone(); + } + else + { + this.selector = null; + } + } + + /** + * Returns the trusted attribute certificate issuers. If attribute + * certificates is verified the trusted AC issuers must be set. + *

    + * The returned ISet consists of TrustAnchors. + *

    + * The returned ISet is immutable. Never null + *

    + * + * @return Returns an immutable set of the trusted AC issuers. + */ + public virtual ISet GetTrustedACIssuers() + { + return new HashSet(trustedACIssuers); + } + + /** + * Sets the trusted attribute certificate issuers. If attribute certificates + * is verified the trusted AC issuers must be set. + *

    + * The trustedACIssuers must be a ISet of + * TrustAnchor + *

    + * The given set is cloned. + *

    + * + * @param trustedACIssuers The trusted AC issuers to set. Is never + * null. + * @throws ClassCastException if an element of stores is not + * a TrustAnchor. + */ + public virtual void SetTrustedACIssuers( + ISet trustedACIssuers) + { + if (trustedACIssuers == null) + { + this.trustedACIssuers = new HashSet(); + } + else + { + foreach (object obj in trustedACIssuers) + { + if (!(obj is TrustAnchor)) + { + throw new InvalidCastException("All elements of set must be " + + "of type " + typeof(TrustAnchor).FullName + "."); + } + } + this.trustedACIssuers = new HashSet(trustedACIssuers); + } + } + + /** + * Returns the necessary attributes which must be contained in an attribute + * certificate. + *

    + * The returned ISet is immutable and contains + * Strings with the OIDs. + *

    + * + * @return Returns the necessary AC attributes. + */ + public virtual ISet GetNecessaryACAttributes() + { + return new HashSet(necessaryACAttributes); + } + + /** + * Sets the necessary which must be contained in an attribute certificate. + *

    + * The ISet must contain Strings with the + * OIDs. + *

    + * The set is cloned. + *

    + * + * @param necessaryACAttributes The necessary AC attributes to set. + * @throws ClassCastException if an element of + * necessaryACAttributes is not a + * String. + */ + public virtual void SetNecessaryACAttributes( + ISet necessaryACAttributes) + { + if (necessaryACAttributes == null) + { + this.necessaryACAttributes = new HashSet(); + } + else + { + foreach (object obj in necessaryACAttributes) + { + if (!(obj is string)) + { + throw new InvalidCastException("All elements of set must be " + + "of type string."); + } + } + this.necessaryACAttributes = new HashSet(necessaryACAttributes); + } + } + + /** + * Returns the attribute certificates which are not allowed. + *

    + * The returned ISet is immutable and contains + * Strings with the OIDs. + *

    + * + * @return Returns the prohibited AC attributes. Is never null. + */ + public virtual ISet GetProhibitedACAttributes() + { + return new HashSet(prohibitedACAttributes); + } + + /** + * Sets the attribute certificates which are not allowed. + *

    + * The ISet must contain Strings with the + * OIDs. + *

    + * The set is cloned. + *

    + * + * @param prohibitedACAttributes The prohibited AC attributes to set. + * @throws ClassCastException if an element of + * prohibitedACAttributes is not a + * String. + */ + public virtual void SetProhibitedACAttributes( + ISet prohibitedACAttributes) + { + if (prohibitedACAttributes == null) + { + this.prohibitedACAttributes = new HashSet(); + } + else + { + foreach (object obj in prohibitedACAttributes) + { + if (!(obj is String)) + { + throw new InvalidCastException("All elements of set must be " + + "of type string."); + } + } + this.prohibitedACAttributes = new HashSet(prohibitedACAttributes); + } + } + + /** + * Returns the attribute certificate checker. The returned set contains + * {@link PKIXAttrCertChecker}s and is immutable. + * + * @return Returns the attribute certificate checker. Is never + * null. + */ + public virtual ISet GetAttrCertCheckers() + { + return new HashSet(attrCertCheckers); + } + + /** + * Sets the attribute certificate checkers. + *

    + * All elements in the ISet must a {@link PKIXAttrCertChecker}. + *

    + *

    + * The given set is cloned. + *

    + * + * @param attrCertCheckers The attribute certificate checkers to set. Is + * never null. + * @throws ClassCastException if an element of attrCertCheckers + * is not a PKIXAttrCertChecker. + */ + public virtual void SetAttrCertCheckers( + ISet attrCertCheckers) + { + if (attrCertCheckers == null) + { + this.attrCertCheckers = new HashSet(); + } + else + { + foreach (object obj in attrCertCheckers) + { + if (!(obj is PkixAttrCertChecker)) + { + throw new InvalidCastException("All elements of set must be " + + "of type " + typeof(PkixAttrCertChecker).FullName + "."); + } + } + this.attrCertCheckers = new HashSet(attrCertCheckers); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixParameters.cs.meta new file mode 100644 index 00000000..fb4cff4f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bddc2e795cf6cd046bbd64b225ce7cdc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixPolicyNode.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixPolicyNode.cs new file mode 100644 index 00000000..60a58c37 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixPolicyNode.cs @@ -0,0 +1,162 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /// + /// Summary description for PkixPolicyNode. + /// + public class PkixPolicyNode +// : IPolicyNode + { + protected IList mChildren; + protected int mDepth; + protected ISet mExpectedPolicies; + protected PkixPolicyNode mParent; + protected ISet mPolicyQualifiers; + protected string mValidPolicy; + protected bool mCritical; + + public virtual int Depth + { + get { return this.mDepth; } + } + + public virtual IEnumerable Children + { + get { return new EnumerableProxy(mChildren); } + } + + public virtual bool IsCritical + { + get { return this.mCritical; } + set { this.mCritical = value; } + } + + public virtual ISet PolicyQualifiers + { + get { return new HashSet(this.mPolicyQualifiers); } + } + + public virtual string ValidPolicy + { + get { return this.mValidPolicy; } + } + + public virtual bool HasChildren + { + get { return mChildren.Count != 0; } + } + + public virtual ISet ExpectedPolicies + { + get { return new HashSet(this.mExpectedPolicies); } + set { this.mExpectedPolicies = new HashSet(value); } + } + + public virtual PkixPolicyNode Parent + { + get { return this.mParent; } + set { this.mParent = value; } + } + + /// Constructors + public PkixPolicyNode( + IList children, + int depth, + ISet expectedPolicies, + PkixPolicyNode parent, + ISet policyQualifiers, + string validPolicy, + bool critical) + { + if (children == null) + { + this.mChildren = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + } + else + { + this.mChildren = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(children); + } + + this.mDepth = depth; + this.mExpectedPolicies = expectedPolicies; + this.mParent = parent; + this.mPolicyQualifiers = policyQualifiers; + this.mValidPolicy = validPolicy; + this.mCritical = critical; + } + + public virtual void AddChild( + PkixPolicyNode child) + { + child.Parent = this; + mChildren.Add(child); + } + + public virtual void RemoveChild( + PkixPolicyNode child) + { + mChildren.Remove(child); + } + + public override string ToString() + { + return ToString(""); + } + + public virtual string ToString( + string indent) + { + StringBuilder buf = new StringBuilder(); + buf.Append(indent); + buf.Append(mValidPolicy); + buf.Append(" {"); + buf.Append(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine); + + foreach (PkixPolicyNode child in mChildren) + { + buf.Append(child.ToString(indent + " ")); + } + + buf.Append(indent); + buf.Append("}"); + buf.Append(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine); + return buf.ToString(); + } + + public virtual object Clone() + { + return Copy(); + } + + public virtual PkixPolicyNode Copy() + { + PkixPolicyNode node = new PkixPolicyNode( + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(), + mDepth, + new HashSet(mExpectedPolicies), + null, + new HashSet(mPolicyQualifiers), + mValidPolicy, + mCritical); + + foreach (PkixPolicyNode child in mChildren) + { + PkixPolicyNode copy = child.Copy(); + copy.Parent = node; + node.AddChild(copy); + } + + return node; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixPolicyNode.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixPolicyNode.cs.meta new file mode 100644 index 00000000..21f6ba3e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/PkixPolicyNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d33024da030accb498009e4aecd51fe9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/ReasonsMask.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/ReasonsMask.cs new file mode 100644 index 00000000..c03f4bbb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/ReasonsMask.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /// + /// This class helps to handle CRL revocation reasons mask. Each CRL handles a + /// certain set of revocation reasons. + /// + internal class ReasonsMask + { + private int _reasons; + + /// + /// Constructs are reason mask with the reasons. + /// + /// The reasons. + internal ReasonsMask( + int reasons) + { + _reasons = reasons; + } + + /// + /// A reason mask with no reason. + /// + internal ReasonsMask() + : this(0) + { + } + + /// + /// A mask with all revocation reasons. + /// + internal static readonly ReasonsMask AllReasons = new ReasonsMask( + ReasonFlags.AACompromise | ReasonFlags.AffiliationChanged | ReasonFlags.CACompromise + | ReasonFlags.CertificateHold | ReasonFlags.CessationOfOperation + | ReasonFlags.KeyCompromise | ReasonFlags.PrivilegeWithdrawn | ReasonFlags.Unused + | ReasonFlags.Superseded); + + /** + * Adds all reasons from the reasons mask to this mask. + * + * @param mask The reasons mask to add. + */ + internal void AddReasons( + ReasonsMask mask) + { + _reasons = _reasons | mask.Reasons.IntValue; + } + + /// + /// Returns true if this reasons mask contains all possible + /// reasons. + /// + /// true if this reasons mask contains all possible reasons. + /// + internal bool IsAllReasons + { + get { return _reasons == AllReasons._reasons; } + } + + /// + /// Intersects this mask with the given reasons mask. + /// + /// mask The mask to intersect with. + /// The intersection of this and teh given mask. + internal ReasonsMask Intersect( + ReasonsMask mask) + { + ReasonsMask _mask = new ReasonsMask(); + _mask.AddReasons(new ReasonsMask(_reasons & mask.Reasons.IntValue)); + return _mask; + } + + /// + /// Returns true if the passed reasons mask has new reasons. + /// + /// The reasons mask which should be tested for new reasons. + /// true if the passed reasons mask has new reasons. + internal bool HasNewReasons( + ReasonsMask mask) + { + return ((_reasons | mask.Reasons.IntValue ^ _reasons) != 0); + } + + /// + /// Returns the reasons in this mask. + /// + public ReasonFlags Reasons + { + get { return new ReasonFlags(_reasons); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/ReasonsMask.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/ReasonsMask.cs.meta new file mode 100644 index 00000000..f79ac275 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/ReasonsMask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 82782c3f371478d4788bfedceeac9754 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3280CertPathUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3280CertPathUtilities.cs new file mode 100644 index 00000000..e8270fb6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3280CertPathUtilities.cs @@ -0,0 +1,2452 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Globalization; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + public class Rfc3280CertPathUtilities + { + private static readonly PkixCrlUtilities CrlUtilities = new PkixCrlUtilities(); + + internal static readonly string ANY_POLICY = "2.5.29.32.0"; + + // key usage bits + internal static readonly int KEY_CERT_SIGN = 5; + internal static readonly int CRL_SIGN = 6; + + /** + * If the complete CRL includes an issuing distribution point (IDP) CRL + * extension check the following: + *

    + * (i) If the distribution point name is present in the IDP CRL extension + * and the distribution field is present in the DP, then verify that one of + * the names in the IDP matches one of the names in the DP. If the + * distribution point name is present in the IDP CRL extension and the + * distribution field is omitted from the DP, then verify that one of the + * names in the IDP matches one of the names in the cRLIssuer field of the + * DP. + *

    + *

    + * (ii) If the onlyContainsUserCerts boolean is asserted in the IDP CRL + * extension, verify that the certificate does not include the basic + * constraints extension with the cA boolean asserted. + *

    + *

    + * (iii) If the onlyContainsCACerts boolean is asserted in the IDP CRL + * extension, verify that the certificate includes the basic constraints + * extension with the cA boolean asserted. + *

    + *

    + * (iv) Verify that the onlyContainsAttributeCerts boolean is not asserted. + *

    + * + * @param dp The distribution point. + * @param cert The certificate. + * @param crl The CRL. + * @throws AnnotatedException if one of the conditions is not met or an error occurs. + */ + internal static void ProcessCrlB2( + DistributionPoint dp, + object cert, + X509Crl crl) + { + IssuingDistributionPoint idp = null; + try + { + idp = IssuingDistributionPoint.GetInstance(PkixCertPathValidatorUtilities.GetExtensionValue(crl, X509Extensions.IssuingDistributionPoint)); + } + catch (Exception e) + { + throw new Exception("0 Issuing distribution point extension could not be decoded.", e); + } + // (b) (2) (i) + // distribution point name is present + if (idp != null) + { + if (idp.DistributionPoint != null) + { + // make list of names + DistributionPointName dpName = IssuingDistributionPoint.GetInstance(idp).DistributionPoint; + IList names = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + if (dpName.PointType == DistributionPointName.FullName) + { + GeneralName[] genNames = GeneralNames.GetInstance(dpName.Name).GetNames(); + for (int j = 0; j < genNames.Length; j++) + { + names.Add(genNames[j]); + } + } + if (dpName.PointType == DistributionPointName.NameRelativeToCrlIssuer) + { + Asn1EncodableVector vec = new Asn1EncodableVector(); + try + { + IEnumerator e = Asn1Sequence.GetInstance( + Asn1Sequence.FromByteArray(crl.IssuerDN.GetEncoded())).GetEnumerator(); + while (e.MoveNext()) + { + vec.Add((Asn1Encodable)e.Current); + } + } + catch (IOException e) + { + throw new Exception("Could not read CRL issuer.", e); + } + vec.Add(dpName.Name); + names.Add(new GeneralName(X509Name.GetInstance(new DerSequence(vec)))); + } + bool matches = false; + // verify that one of the names in the IDP matches one + // of the names in the DP. + if (dp.DistributionPointName != null) + { + dpName = dp.DistributionPointName; + GeneralName[] genNames = null; + if (dpName.PointType == DistributionPointName.FullName) + { + genNames = GeneralNames.GetInstance(dpName.Name).GetNames(); + } + if (dpName.PointType == DistributionPointName.NameRelativeToCrlIssuer) + { + if (dp.CrlIssuer != null) + { + genNames = dp.CrlIssuer.GetNames(); + } + else + { + genNames = new GeneralName[1]; + try + { + genNames[0] = new GeneralName( + PkixCertPathValidatorUtilities.GetIssuerPrincipal(cert)); + } + catch (IOException e) + { + throw new Exception("Could not read certificate issuer.", e); + } + } + for (int j = 0; j < genNames.Length; j++) + { + IEnumerator e = Asn1Sequence.GetInstance(genNames[j].Name.ToAsn1Object()).GetEnumerator(); + Asn1EncodableVector vec = new Asn1EncodableVector(); + while (e.MoveNext()) + { + vec.Add((Asn1Encodable)e.Current); + } + vec.Add(dpName.Name); + genNames[j] = new GeneralName(X509Name.GetInstance(new DerSequence(vec))); + } + } + if (genNames != null) + { + for (int j = 0; j < genNames.Length; j++) + { + if (names.Contains(genNames[j])) + { + matches = true; + break; + } + } + } + if (!matches) + { + throw new Exception( + "No match for certificate CRL issuing distribution point name to cRLIssuer CRL distribution point."); + } + } + // verify that one of the names in + // the IDP matches one of the names in the cRLIssuer field of + // the DP + else + { + if (dp.CrlIssuer == null) + { + throw new Exception("Either the cRLIssuer or the distributionPoint field must " + + "be contained in DistributionPoint."); + } + GeneralName[] genNames = dp.CrlIssuer.GetNames(); + for (int j = 0; j < genNames.Length; j++) + { + if (names.Contains(genNames[j])) + { + matches = true; + break; + } + } + if (!matches) + { + throw new Exception( + "No match for certificate CRL issuing distribution point name to cRLIssuer CRL distribution point."); + } + } + } + BasicConstraints bc = null; + try + { + bc = BasicConstraints.GetInstance(PkixCertPathValidatorUtilities.GetExtensionValue( + (IX509Extension)cert, X509Extensions.BasicConstraints)); + } + catch (Exception e) + { + throw new Exception("Basic constraints extension could not be decoded.", e); + } + + //if (cert is X509Certificate) + { + // (b) (2) (ii) + if (idp.OnlyContainsUserCerts && ((bc != null) && bc.IsCA())) + { + throw new Exception("CA Cert CRL only contains user certificates."); + } + + // (b) (2) (iii) + if (idp.OnlyContainsCACerts && (bc == null || !bc.IsCA())) + { + throw new Exception("End CRL only contains CA certificates."); + } + } + + // (b) (2) (iv) + if (idp.OnlyContainsAttributeCerts) + { + throw new Exception("onlyContainsAttributeCerts boolean is asserted."); + } + } + } + + internal static void ProcessCertBC( + PkixCertPath certPath, + int index, + PkixNameConstraintValidator nameConstraintValidator) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + int n = certs.Count; + // i as defined in the algorithm description + int i = n - index; + // + // (b), (c) permitted and excluded subtree checking. + // + if (!(PkixCertPathValidatorUtilities.IsSelfIssued(cert) && (i < n))) + { + X509Name principal = cert.SubjectDN; + Asn1InputStream aIn = new Asn1InputStream(principal.GetEncoded()); + Asn1Sequence dns; + + try + { + dns = DerSequence.GetInstance(aIn.ReadObject()); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Exception extracting subject name when checking subtrees.", e, certPath, index); + } + + try + { + nameConstraintValidator.CheckPermittedDN(dns); + nameConstraintValidator.CheckExcludedDN(dns); + } + catch (PkixNameConstraintValidatorException e) + { + throw new PkixCertPathValidatorException( + "Subtree check for certificate subject failed.", e, certPath, index); + } + + GeneralNames altName = null; + try + { + altName = GeneralNames.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.SubjectAlternativeName)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Subject alternative name extension could not be decoded.", e, certPath, index); + } + + IList emails = X509Name.GetInstance(dns).GetValueList(X509Name.EmailAddress); + foreach (string email in emails) + { + GeneralName emailAsGeneralName = new GeneralName(GeneralName.Rfc822Name, email); + try + { + nameConstraintValidator.checkPermitted(emailAsGeneralName); + nameConstraintValidator.checkExcluded(emailAsGeneralName); + } + catch (PkixNameConstraintValidatorException ex) + { + throw new PkixCertPathValidatorException( + "Subtree check for certificate subject alternative email failed.", ex, certPath, index); + } + } + if (altName != null) + { + GeneralName[] genNames = null; + try + { + genNames = altName.GetNames(); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Subject alternative name contents could not be decoded.", e, certPath, index); + } + foreach (GeneralName genName in genNames) + { + try + { + nameConstraintValidator.checkPermitted(genName); + nameConstraintValidator.checkExcluded(genName); + } + catch (PkixNameConstraintValidatorException e) + { + throw new PkixCertPathValidatorException( + "Subtree check for certificate subject alternative name failed.", e, certPath, index); + } + } + } + } + } + + internal static void PrepareNextCertA( + PkixCertPath certPath, + int index) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + // + // + // (a) check the policy mappings + // + Asn1Sequence pm = null; + try + { + pm = Asn1Sequence.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.PolicyMappings)); + } + catch (Exception ex) + { + throw new PkixCertPathValidatorException( + "Policy mappings extension could not be decoded.", ex, certPath, index); + } + if (pm != null) + { + Asn1Sequence mappings = pm; + + for (int j = 0; j < mappings.Count; j++) + { + DerObjectIdentifier issuerDomainPolicy = null; + DerObjectIdentifier subjectDomainPolicy = null; + try + { + Asn1Sequence mapping = DerSequence.GetInstance(mappings[j]); + + issuerDomainPolicy = DerObjectIdentifier.GetInstance(mapping[0]); + subjectDomainPolicy = DerObjectIdentifier.GetInstance(mapping[1]); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Policy mappings extension contents could not be decoded.", e, certPath, index); + } + + if (Rfc3280CertPathUtilities.ANY_POLICY.Equals(issuerDomainPolicy.Id)) + throw new PkixCertPathValidatorException( + "IssuerDomainPolicy is anyPolicy", null, certPath, index); + + if (Rfc3280CertPathUtilities.ANY_POLICY.Equals(subjectDomainPolicy.Id)) + throw new PkixCertPathValidatorException( + "SubjectDomainPolicy is anyPolicy,", null, certPath, index); + } + } + } + + internal static PkixPolicyNode ProcessCertD( + PkixCertPath certPath, + int index, + ISet acceptablePolicies, + PkixPolicyNode validPolicyTree, + IList[] policyNodes, + int inhibitAnyPolicy) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + int n = certs.Count; + // i as defined in the algorithm description + int i = n - index; + // + // (d) policy Information checking against initial policy and + // policy mapping + // + Asn1Sequence certPolicies = null; + try + { + certPolicies = DerSequence.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.CertificatePolicies)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Could not read certificate policies extension from certificate.", e, certPath, index); + } + if (certPolicies != null && validPolicyTree != null) + { + // + // (d) (1) + // + ISet pols = new HashSet(); + + foreach (Asn1Encodable ae in certPolicies) + { + PolicyInformation pInfo = PolicyInformation.GetInstance(ae.ToAsn1Object()); + DerObjectIdentifier pOid = pInfo.PolicyIdentifier; + + pols.Add(pOid.Id); + + if (!Rfc3280CertPathUtilities.ANY_POLICY.Equals(pOid.Id)) + { + ISet pq = null; + try + { + pq = PkixCertPathValidatorUtilities.GetQualifierSet(pInfo.PolicyQualifiers); + } + catch (PkixCertPathValidatorException ex) + { + throw new PkixCertPathValidatorException( + "Policy qualifier info set could not be build.", ex, certPath, index); + } + + bool match = PkixCertPathValidatorUtilities.ProcessCertD1i(i, policyNodes, pOid, pq); + + if (!match) + { + PkixCertPathValidatorUtilities.ProcessCertD1ii(i, policyNodes, pOid, pq); + } + } + } + + if (acceptablePolicies.IsEmpty || acceptablePolicies.Contains(Rfc3280CertPathUtilities.ANY_POLICY)) + { + acceptablePolicies.Clear(); + acceptablePolicies.AddAll(pols); + } + else + { + ISet t1 = new HashSet(); + + foreach (object o in acceptablePolicies) + { + if (pols.Contains(o)) + { + t1.Add(o); + } + } + acceptablePolicies.Clear(); + acceptablePolicies.AddAll(t1); + } + + // + // (d) (2) + // + if ((inhibitAnyPolicy > 0) || ((i < n) && PkixCertPathValidatorUtilities.IsSelfIssued(cert))) + { + foreach (Asn1Encodable ae in certPolicies) + { + PolicyInformation pInfo = PolicyInformation.GetInstance(ae.ToAsn1Object()); + if (Rfc3280CertPathUtilities.ANY_POLICY.Equals(pInfo.PolicyIdentifier.Id)) + { + ISet _apq = PkixCertPathValidatorUtilities.GetQualifierSet(pInfo.PolicyQualifiers); + IList _nodes = policyNodes[i - 1]; + + for (int k = 0; k < _nodes.Count; k++) + { + PkixPolicyNode _node = (PkixPolicyNode)_nodes[k]; + + IEnumerator _policySetIter = _node.ExpectedPolicies.GetEnumerator(); + while (_policySetIter.MoveNext()) + { + object _tmp = _policySetIter.Current; + + string _policy; + if (_tmp is string) + { + _policy = (string)_tmp; + } + else if (_tmp is DerObjectIdentifier) + { + _policy = ((DerObjectIdentifier)_tmp).Id; + } + else + { + continue; + } + + bool _found = false; + + foreach (PkixPolicyNode _child in _node.Children) + { + if (_policy.Equals(_child.ValidPolicy)) + { + _found = true; + } + } + + if (!_found) + { + ISet _newChildExpectedPolicies = new HashSet(); + _newChildExpectedPolicies.Add(_policy); + + PkixPolicyNode _newChild = new PkixPolicyNode(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(), i, + _newChildExpectedPolicies, _node, _apq, _policy, false); + _node.AddChild(_newChild); + policyNodes[i].Add(_newChild); + } + } + } + break; + } + } + } + + PkixPolicyNode _validPolicyTree = validPolicyTree; + // + // (d) (3) + // + for (int j = (i - 1); j >= 0; j--) + { + IList nodes = policyNodes[j]; + + for (int k = 0; k < nodes.Count; k++) + { + PkixPolicyNode node = (PkixPolicyNode)nodes[k]; + if (!node.HasChildren) + { + _validPolicyTree = PkixCertPathValidatorUtilities.RemovePolicyNode(_validPolicyTree, policyNodes, + node); + if (_validPolicyTree == null) + { + break; + } + } + } + } + + // + // d (4) + // + ISet criticalExtensionOids = cert.GetCriticalExtensionOids(); + + if (criticalExtensionOids != null) + { + bool critical = criticalExtensionOids.Contains(X509Extensions.CertificatePolicies.Id); + + IList nodes = policyNodes[i]; + for (int j = 0; j < nodes.Count; j++) + { + PkixPolicyNode node = (PkixPolicyNode)nodes[j]; + node.IsCritical = critical; + } + } + return _validPolicyTree; + } + return null; + } + + /** + * If the DP includes cRLIssuer, then verify that the issuer field in the + * complete CRL matches cRLIssuer in the DP and that the complete CRL + * contains an + * g distribution point extension with the indirectCRL + * boolean asserted. Otherwise, verify that the CRL issuer matches the + * certificate issuer. + * + * @param dp The distribution point. + * @param cert The certificate ot attribute certificate. + * @param crl The CRL for cert. + * @throws AnnotatedException if one of the above conditions does not apply or an error + * occurs. + */ + internal static void ProcessCrlB1( + DistributionPoint dp, + object cert, + X509Crl crl) + { + Asn1Object idp = PkixCertPathValidatorUtilities.GetExtensionValue( + crl, X509Extensions.IssuingDistributionPoint); + + bool isIndirect = false; + if (idp != null) + { + if (IssuingDistributionPoint.GetInstance(idp).IsIndirectCrl) + { + isIndirect = true; + } + } + byte[] issuerBytes = crl.IssuerDN.GetEncoded(); + + bool matchIssuer = false; + if (dp.CrlIssuer != null) + { + GeneralName[] genNames = dp.CrlIssuer.GetNames(); + for (int j = 0; j < genNames.Length; j++) + { + if (genNames[j].TagNo == GeneralName.DirectoryName) + { + try + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Arrays.AreEqual(genNames[j].Name.ToAsn1Object().GetEncoded(), issuerBytes)) + { + matchIssuer = true; + } + } + catch (IOException e) + { + throw new Exception( + "CRL issuer information from distribution point cannot be decoded.", e); + } + } + } + if (matchIssuer && !isIndirect) + { + throw new Exception("Distribution point contains cRLIssuer field but CRL is not indirect."); + } + if (!matchIssuer) + { + throw new Exception("CRL issuer of CRL does not match CRL issuer of distribution point."); + } + } + else + { + if (crl.IssuerDN.Equivalent(PkixCertPathValidatorUtilities.GetIssuerPrincipal(cert), true)) + { + matchIssuer = true; + } + } + if (!matchIssuer) + { + throw new Exception("Cannot find matching CRL issuer for certificate."); + } + } + + internal static ReasonsMask ProcessCrlD( + X509Crl crl, + DistributionPoint dp) + //throws AnnotatedException + { + IssuingDistributionPoint idp = null; + try + { + idp = IssuingDistributionPoint.GetInstance(PkixCertPathValidatorUtilities.GetExtensionValue(crl, X509Extensions.IssuingDistributionPoint)); + } + catch (Exception e) + { + throw new Exception("issuing distribution point extension could not be decoded.", e); + } + + // (d) (1) + if (idp != null && idp.OnlySomeReasons != null && dp.Reasons != null) + { + return new ReasonsMask(dp.Reasons.IntValue).Intersect(new ReasonsMask(idp.OnlySomeReasons + .IntValue)); + } + // (d) (4) + if ((idp == null || idp.OnlySomeReasons == null) && dp.Reasons == null) + { + return ReasonsMask.AllReasons; + } + + // (d) (2) and (d)(3) + + ReasonsMask dpReasons = null; + + if (dp.Reasons == null) + { + dpReasons = ReasonsMask.AllReasons; + } + else + { + dpReasons = new ReasonsMask(dp.Reasons.IntValue); + } + + ReasonsMask idpReasons = null; + + if (idp == null) + { + idpReasons = ReasonsMask.AllReasons; + } + else + { + idpReasons = new ReasonsMask(idp.OnlySomeReasons.IntValue); + } + + return dpReasons.Intersect(idpReasons); + } + + /** + * Obtain and validate the certification path for the complete CRL issuer. + * If a key usage extension is present in the CRL issuer's certificate, + * verify that the cRLSign bit is set. + * + * @param crl CRL which contains revocation information for the certificate + * cert. + * @param cert The attribute certificate or certificate to check if it is + * revoked. + * @param defaultCRLSignCert The issuer certificate of the certificate cert. + * @param defaultCRLSignKey The public key of the issuer certificate + * defaultCRLSignCert. + * @param paramsPKIX paramsPKIX PKIX parameters. + * @param certPathCerts The certificates on the certification path. + * @return A Set with all keys of possible CRL issuer + * certificates. + * @throws AnnotatedException if the CRL is not valid or the status cannot be checked or + * some error occurs. + */ + internal static ISet ProcessCrlF( + X509Crl crl, + object cert, + X509Certificate defaultCRLSignCert, + AsymmetricKeyParameter defaultCRLSignKey, + PkixParameters paramsPKIX, + IList certPathCerts) + { + // (f) + + // get issuer from CRL + X509CertStoreSelector selector = new X509CertStoreSelector(); + try + { + selector.Subject = crl.IssuerDN; + } + catch (IOException e) + { + throw new Exception( + "Subject criteria for certificate selector to find issuer certificate for CRL could not be set.", e); + } + + // get CRL signing certs + IList coll = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + try + { + CollectionUtilities.AddRange(coll, PkixCertPathValidatorUtilities.FindCertificates(selector, paramsPKIX.GetStores())); + CollectionUtilities.AddRange(coll, PkixCertPathValidatorUtilities.FindCertificates(selector, paramsPKIX.GetAdditionalStores())); + } + catch (Exception e) + { + throw new Exception("Issuer certificate for CRL cannot be searched.", e); + } + + coll.Add(defaultCRLSignCert); + + IEnumerator cert_it = coll.GetEnumerator(); + + IList validCerts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + IList validKeys = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + while (cert_it.MoveNext()) + { + X509Certificate signingCert = (X509Certificate)cert_it.Current; + + /* + * CA of the certificate, for which this CRL is checked, has also + * signed CRL, so skip the path validation, because is already done + */ + if (signingCert.Equals(defaultCRLSignCert)) + { + validCerts.Add(signingCert); + validKeys.Add(defaultCRLSignKey); + continue; + } + try + { +// CertPathBuilder builder = CertPathBuilder.GetInstance("PKIX"); + PkixCertPathBuilder builder = new PkixCertPathBuilder(); + selector = new X509CertStoreSelector(); + selector.Certificate = signingCert; + + PkixParameters temp = (PkixParameters)paramsPKIX.Clone(); + temp.SetTargetCertConstraints(selector); + + PkixBuilderParameters parameters = (PkixBuilderParameters) + PkixBuilderParameters.GetInstance(temp); + + /* + * if signingCert is placed not higher on the cert path a + * dependency loop results. CRL for cert is checked, but + * signingCert is needed for checking the CRL which is dependent + * on checking cert because it is higher in the cert path and so + * signing signingCert transitively. so, revocation is disabled, + * forgery attacks of the CRL are detected in this outer loop + * for all other it must be enabled to prevent forgery attacks + */ + if (certPathCerts.Contains(signingCert)) + { + parameters.IsRevocationEnabled = false; + } + else + { + parameters.IsRevocationEnabled = true; + } + IList certs = builder.Build(parameters).CertPath.Certificates; + validCerts.Add(signingCert); + validKeys.Add(PkixCertPathValidatorUtilities.GetNextWorkingKey(certs, 0)); + } + catch (PkixCertPathBuilderException e) + { + throw new Exception("Internal error.", e); + } + catch (PkixCertPathValidatorException e) + { + throw new Exception("Public key of issuer certificate of CRL could not be retrieved.", e); + } + //catch (Exception e) + //{ + // throw new Exception(e.Message); + //} + } + + ISet checkKeys = new HashSet(); + + Exception lastException = null; + for (int i = 0; i < validCerts.Count; i++) + { + X509Certificate signCert = (X509Certificate)validCerts[i]; + bool[] keyusage = signCert.GetKeyUsage(); + + if (keyusage != null && (keyusage.Length < 7 || !keyusage[CRL_SIGN])) + { + lastException = new Exception( + "Issuer certificate key usage extension does not permit CRL signing."); + } + else + { + checkKeys.Add(validKeys[i]); + } + } + + if ((checkKeys.Count == 0) && lastException == null) + { + throw new Exception("Cannot find a valid issuer certificate."); + } + if ((checkKeys.Count == 0) && lastException != null) + { + throw lastException; + } + + return checkKeys; + } + + internal static AsymmetricKeyParameter ProcessCrlG( + X509Crl crl, + ISet keys) + { + Exception lastException = null; + foreach (AsymmetricKeyParameter key in keys) + { + try + { + crl.Verify(key); + return key; + } + catch (Exception e) + { + lastException = e; + } + } + throw new Exception("Cannot verify CRL.", lastException); + } + + internal static X509Crl ProcessCrlH( + ISet deltaCrls, + AsymmetricKeyParameter key) + { + Exception lastException = null; + foreach (X509Crl crl in deltaCrls) + { + try + { + crl.Verify(key); + return crl; + } + catch (Exception e) + { + lastException = e; + } + } + if (lastException != null) + { + throw new Exception("Cannot verify delta CRL.", lastException); + } + return null; + } + + /** + * Checks a distribution point for revocation information for the + * certificate cert. + * + * @param dp The distribution point to consider. + * @param paramsPKIX PKIX parameters. + * @param cert Certificate to check if it is revoked. + * @param validDate The date when the certificate revocation status should be + * checked. + * @param defaultCRLSignCert The issuer certificate of the certificate cert. + * @param defaultCRLSignKey The public key of the issuer certificate + * defaultCRLSignCert. + * @param certStatus The current certificate revocation status. + * @param reasonMask The reasons mask which is already checked. + * @param certPathCerts The certificates of the certification path. + * @throws AnnotatedException if the certificate is revoked or the status cannot be checked + * or some error occurs. + */ + private static void CheckCrl( + DistributionPoint dp, + PkixParameters paramsPKIX, + X509Certificate cert, + DateTime validDate, + X509Certificate defaultCRLSignCert, + AsymmetricKeyParameter defaultCRLSignKey, + CertStatus certStatus, + ReasonsMask reasonMask, + IList certPathCerts) + //throws AnnotatedException + { + DateTime currentDate = DateTime.UtcNow; + + if (validDate.Ticks > currentDate.Ticks) + { + throw new Exception("Validation time is in future."); + } + + // (a) + /* + * We always get timely valid CRLs, so there is no step (a) (1). + * "locally cached" CRLs are assumed to be in getStore(), additional + * CRLs must be enabled in the ExtendedPKIXParameters and are in + * getAdditionalStore() + */ + + ISet crls = PkixCertPathValidatorUtilities.GetCompleteCrls(dp, cert, currentDate, paramsPKIX); + bool validCrlFound = false; + Exception lastException = null; + + IEnumerator crl_iter = crls.GetEnumerator(); + + while (crl_iter.MoveNext() && certStatus.Status == CertStatus.Unrevoked && !reasonMask.IsAllReasons) + { + try + { + X509Crl crl = (X509Crl)crl_iter.Current; + + // (d) + ReasonsMask interimReasonsMask = Rfc3280CertPathUtilities.ProcessCrlD(crl, dp); + + // (e) + /* + * The reasons mask is updated at the end, so only valid CRLs + * can update it. If this CRL does not contain new reasons it + * must be ignored. + */ + if (!interimReasonsMask.HasNewReasons(reasonMask)) + { + continue; + } + + // (f) + ISet keys = Rfc3280CertPathUtilities.ProcessCrlF(crl, cert, defaultCRLSignCert, defaultCRLSignKey, + paramsPKIX, certPathCerts); + // (g) + AsymmetricKeyParameter key = Rfc3280CertPathUtilities.ProcessCrlG(crl, keys); + + X509Crl deltaCRL = null; + + if (paramsPKIX.IsUseDeltasEnabled) + { + // get delta CRLs + ISet deltaCRLs = PkixCertPathValidatorUtilities.GetDeltaCrls(currentDate, paramsPKIX, crl); + // we only want one valid delta CRL + // (h) + deltaCRL = Rfc3280CertPathUtilities.ProcessCrlH(deltaCRLs, key); + } + + /* + * CRL must be be valid at the current time, not the validation + * time. If a certificate is revoked with reason keyCompromise, + * cACompromise, it can be used for forgery, also for the past. + * This reason may not be contained in older CRLs. + */ + + /* + * in the chain model signatures stay valid also after the + * certificate has been expired, so they do not have to be in + * the CRL validity time + */ + + if (paramsPKIX.ValidityModel != PkixParameters.ChainValidityModel) + { + /* + * if a certificate has expired, but was revoked, it is not + * more in the CRL, so it would be regarded as valid if the + * first check is not done + */ + if (cert.NotAfter.Ticks < crl.ThisUpdate.Ticks) + { + throw new Exception("No valid CRL for current time found."); + } + } + + Rfc3280CertPathUtilities.ProcessCrlB1(dp, cert, crl); + + // (b) (2) + Rfc3280CertPathUtilities.ProcessCrlB2(dp, cert, crl); + + // (c) + Rfc3280CertPathUtilities.ProcessCrlC(deltaCRL, crl, paramsPKIX); + + // (i) + Rfc3280CertPathUtilities.ProcessCrlI(validDate, deltaCRL, cert, certStatus, paramsPKIX); + + // (j) + Rfc3280CertPathUtilities.ProcessCrlJ(validDate, crl, cert, certStatus); + + // (k) + if (certStatus.Status == CrlReason.RemoveFromCrl) + { + certStatus.Status = CertStatus.Unrevoked; + } + + // update reasons mask + reasonMask.AddReasons(interimReasonsMask); + + ISet criticalExtensions = crl.GetCriticalExtensionOids(); + + if (criticalExtensions != null) + { + criticalExtensions = new HashSet(criticalExtensions); + criticalExtensions.Remove(X509Extensions.IssuingDistributionPoint.Id); + criticalExtensions.Remove(X509Extensions.DeltaCrlIndicator.Id); + + if (!criticalExtensions.IsEmpty) + throw new Exception("CRL contains unsupported critical extensions."); + } + + if (deltaCRL != null) + { + criticalExtensions = deltaCRL.GetCriticalExtensionOids(); + if (criticalExtensions != null) + { + criticalExtensions = new HashSet(criticalExtensions); + criticalExtensions.Remove(X509Extensions.IssuingDistributionPoint.Id); + criticalExtensions.Remove(X509Extensions.DeltaCrlIndicator.Id); + + if (!criticalExtensions.IsEmpty) + throw new Exception("Delta CRL contains unsupported critical extension."); + } + } + + validCrlFound = true; + } + catch (Exception e) + { + lastException = e; + } + } + if (!validCrlFound) + { + throw lastException; + } + } + + /** + * Checks a certificate if it is revoked. + * + * @param paramsPKIX PKIX parameters. + * @param cert Certificate to check if it is revoked. + * @param validDate The date when the certificate revocation status should be + * checked. + * @param sign The issuer certificate of the certificate cert. + * @param workingPublicKey The public key of the issuer certificate sign. + * @param certPathCerts The certificates of the certification path. + * @throws AnnotatedException if the certificate is revoked or the status cannot be checked + * or some error occurs. + */ + protected static void CheckCrls( + PkixParameters paramsPKIX, + X509Certificate cert, + DateTime validDate, + X509Certificate sign, + AsymmetricKeyParameter workingPublicKey, + IList certPathCerts) + { + Exception lastException = null; + CrlDistPoint crldp = null; + + try + { + crldp = CrlDistPoint.GetInstance(PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.CrlDistributionPoints)); + } + catch (Exception e) + { + throw new Exception("CRL distribution point extension could not be read.", e); + } + + try + { + PkixCertPathValidatorUtilities.AddAdditionalStoresFromCrlDistributionPoint(crldp, paramsPKIX); + } + catch (Exception e) + { + throw new Exception( + "No additional CRL locations could be decoded from CRL distribution point extension.", e); + } + CertStatus certStatus = new CertStatus(); + ReasonsMask reasonsMask = new ReasonsMask(); + + bool validCrlFound = false; + + // for each distribution point + if (crldp != null) + { + DistributionPoint[] dps = null; + try + { + dps = crldp.GetDistributionPoints(); + } + catch (Exception e) + { + throw new Exception("Distribution points could not be read.", e); + } + if (dps != null) + { + for (int i = 0; i < dps.Length && certStatus.Status == CertStatus.Unrevoked && !reasonsMask.IsAllReasons; i++) + { + PkixParameters paramsPKIXClone = (PkixParameters)paramsPKIX.Clone(); + try + { + CheckCrl(dps[i], paramsPKIXClone, cert, validDate, sign, workingPublicKey, certStatus, reasonsMask, certPathCerts); + validCrlFound = true; + } + catch (Exception e) + { + lastException = e; + } + } + } + } + + /* + * If the revocation status has not been determined, repeat the process + * above with any available CRLs not specified in a distribution point + * but issued by the certificate issuer. + */ + + if (certStatus.Status == CertStatus.Unrevoked && !reasonsMask.IsAllReasons) + { + try + { + /* + * assume a DP with both the reasons and the cRLIssuer fields + * omitted and a distribution point name of the certificate + * issuer. + */ + Asn1Object issuer = null; + try + { + issuer = new Asn1InputStream(cert.IssuerDN.GetEncoded()).ReadObject(); + } + catch (Exception e) + { + throw new Exception("Issuer from certificate for CRL could not be reencoded.", e); + } + DistributionPoint dp = new DistributionPoint(new DistributionPointName(0, new GeneralNames( + new GeneralName(GeneralName.DirectoryName, issuer))), null, null); + PkixParameters paramsPKIXClone = (PkixParameters)paramsPKIX.Clone(); + + CheckCrl(dp, paramsPKIXClone, cert, validDate, sign, workingPublicKey, certStatus, reasonsMask, + certPathCerts); + + validCrlFound = true; + } + catch (Exception e) + { + lastException = e; + } + } + + if (!validCrlFound) + { + throw lastException; + } + if (certStatus.Status != CertStatus.Unrevoked) + { + // This format is enforced by the NistCertPath tests + string formattedDate = certStatus.RevocationDate.Value.ToString( + "ddd MMM dd HH:mm:ss K yyyy"); + string message = "Certificate revocation after " + formattedDate; + message += ", reason: " + CrlReasons[certStatus.Status]; + throw new Exception(message); + } + + if (!reasonsMask.IsAllReasons && certStatus.Status == CertStatus.Unrevoked) + { + certStatus.Status = CertStatus.Undetermined; + } + + if (certStatus.Status == CertStatus.Undetermined) + { + throw new Exception("Certificate status could not be determined."); + } + } + + internal static PkixPolicyNode PrepareCertB( + PkixCertPath certPath, + int index, + IList[] policyNodes, + PkixPolicyNode validPolicyTree, + int policyMapping) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + int n = certs.Count; + // i as defined in the algorithm description + int i = n - index; + // (b) + // + Asn1Sequence pm = null; + try + { + pm = (Asn1Sequence)Asn1Sequence.GetInstance(PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.PolicyMappings)); + } + catch (Exception ex) + { + throw new PkixCertPathValidatorException( + "Policy mappings extension could not be decoded.", ex, certPath, index); + } + PkixPolicyNode _validPolicyTree = validPolicyTree; + if (pm != null) + { + Asn1Sequence mappings = (Asn1Sequence)pm; + IDictionary m_idp = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + ISet s_idp = new HashSet(); + + for (int j = 0; j < mappings.Count; j++) + { + Asn1Sequence mapping = (Asn1Sequence) mappings[j]; + string id_p = ((DerObjectIdentifier) mapping[0]).Id; + string sd_p = ((DerObjectIdentifier) mapping[1]).Id; + ISet tmp; + + if (!m_idp.Contains(id_p)) + { + tmp = new HashSet(); + tmp.Add(sd_p); + m_idp[id_p] = tmp; + s_idp.Add(id_p); + } + else + { + tmp = (ISet)m_idp[id_p]; + tmp.Add(sd_p); + } + } + + IEnumerator it_idp = s_idp.GetEnumerator(); + while (it_idp.MoveNext()) + { + string id_p = (string)it_idp.Current; + + // + // (1) + // + if (policyMapping > 0) + { + bool idp_found = false; + IEnumerator nodes_i = policyNodes[i].GetEnumerator(); + + while (nodes_i.MoveNext()) + { + PkixPolicyNode node = (PkixPolicyNode)nodes_i.Current; + if (node.ValidPolicy.Equals(id_p)) + { + idp_found = true; + node.ExpectedPolicies = (ISet)m_idp[id_p]; + break; + } + } + + if (!idp_found) + { + nodes_i = policyNodes[i].GetEnumerator(); + while (nodes_i.MoveNext()) + { + PkixPolicyNode node = (PkixPolicyNode)nodes_i.Current; + if (Rfc3280CertPathUtilities.ANY_POLICY.Equals(node.ValidPolicy)) + { + ISet pq = null; + Asn1Sequence policies = null; + try + { + policies = (Asn1Sequence)PkixCertPathValidatorUtilities.GetExtensionValue(cert, + X509Extensions.CertificatePolicies); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Certificate policies extension could not be decoded.", e, certPath, index); + } + + foreach (Asn1Encodable ae in policies) + { + PolicyInformation pinfo = null; + try + { + pinfo = PolicyInformation.GetInstance(ae.ToAsn1Object()); + } + catch (Exception ex) + { + throw new PkixCertPathValidatorException( + "Policy information could not be decoded.", ex, certPath, index); + } + if (Rfc3280CertPathUtilities.ANY_POLICY.Equals(pinfo.PolicyIdentifier.Id)) + { + try + { + pq = PkixCertPathValidatorUtilities + .GetQualifierSet(pinfo.PolicyQualifiers); + } + catch (PkixCertPathValidatorException ex) + { + throw new PkixCertPathValidatorException( + "Policy qualifier info set could not be decoded.", ex, certPath, + index); + } + break; + } + } + bool ci = false; + ISet critExtOids = cert.GetCriticalExtensionOids(); + if (critExtOids != null) + { + ci = critExtOids.Contains(X509Extensions.CertificatePolicies.Id); + } + + PkixPolicyNode p_node = (PkixPolicyNode)node.Parent; + if (Rfc3280CertPathUtilities.ANY_POLICY.Equals(p_node.ValidPolicy)) + { + PkixPolicyNode c_node = new PkixPolicyNode(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(), i, + (ISet)m_idp[id_p], p_node, pq, id_p, ci); + p_node.AddChild(c_node); + policyNodes[i].Add(c_node); + } + break; + } + } + } + + // + // (2) + // + } + else if (policyMapping <= 0) + { + foreach (PkixPolicyNode node in BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(policyNodes[i])) + { + if (node.ValidPolicy.Equals(id_p)) + { + node.Parent.RemoveChild(node); + + for (int k = i - 1; k >= 0; k--) + { + foreach (PkixPolicyNode node2 in BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(policyNodes[k])) + { + if (!node2.HasChildren) + { + _validPolicyTree = PkixCertPathValidatorUtilities.RemovePolicyNode( + _validPolicyTree, policyNodes, node2); + + if (_validPolicyTree == null) + break; + } + } + } + } + } + } + } + } + return _validPolicyTree; + } + + internal static ISet[] ProcessCrlA1ii( + DateTime currentDate, + PkixParameters paramsPKIX, + X509Certificate cert, + X509Crl crl) + { + ISet deltaSet = new HashSet(); + X509CrlStoreSelector crlselect = new X509CrlStoreSelector(); + crlselect.CertificateChecking = cert; + + try + { + IList issuer = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + issuer.Add(crl.IssuerDN); + crlselect.Issuers = issuer; + } + catch (IOException e) + { + throw new Exception("Cannot extract issuer from CRL." + e, e); + } + + crlselect.CompleteCrlEnabled = true; + ISet completeSet = CrlUtilities.FindCrls(crlselect, paramsPKIX, currentDate); + + if (paramsPKIX.IsUseDeltasEnabled) + { + // get delta CRL(s) + try + { + deltaSet.AddAll(PkixCertPathValidatorUtilities.GetDeltaCrls(currentDate, paramsPKIX, crl)); + } + catch (Exception e) + { + throw new Exception("Exception obtaining delta CRLs.", e); + } + } + + return new ISet[]{ completeSet, deltaSet }; + } + + internal static ISet ProcessCrlA1i( + DateTime currentDate, + PkixParameters paramsPKIX, + X509Certificate cert, + X509Crl crl) + { + ISet deltaSet = new HashSet(); + if (paramsPKIX.IsUseDeltasEnabled) + { + CrlDistPoint freshestCRL = null; + try + { + freshestCRL = CrlDistPoint.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.FreshestCrl)); + } + catch (Exception e) + { + throw new Exception("Freshest CRL extension could not be decoded from certificate.", e); + } + + if (freshestCRL == null) + { + try + { + freshestCRL = CrlDistPoint.GetInstance(PkixCertPathValidatorUtilities.GetExtensionValue(crl, X509Extensions.FreshestCrl)); + } + catch (Exception e) + { + throw new Exception("Freshest CRL extension could not be decoded from CRL.", e); + } + } + if (freshestCRL != null) + { + try + { + PkixCertPathValidatorUtilities.AddAdditionalStoresFromCrlDistributionPoint(freshestCRL, paramsPKIX); + } + catch (Exception e) + { + throw new Exception( + "No new delta CRL locations could be added from Freshest CRL extension.", e); + } + // get delta CRL(s) + try + { + deltaSet.AddAll(PkixCertPathValidatorUtilities.GetDeltaCrls(currentDate, paramsPKIX, crl)); + } + catch (Exception e) + { + throw new Exception("Exception obtaining delta CRLs.", e); + } + } + } + return deltaSet; + } + + internal static void ProcessCertF( + PkixCertPath certPath, + int index, + PkixPolicyNode validPolicyTree, + int explicitPolicy) + { + // + // (f) + // + if (explicitPolicy <= 0 && validPolicyTree == null) + { + throw new PkixCertPathValidatorException( + "No valid policy tree found when one expected.", null, certPath, index); + } + } + + internal static void ProcessCertA( + PkixCertPath certPath, + PkixParameters paramsPKIX, + int index, + AsymmetricKeyParameter workingPublicKey, + X509Name workingIssuerName, + X509Certificate sign) + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + // + // (a) verify + // + try + { + // (a) (1) + // + cert.Verify(workingPublicKey); + } + catch (GeneralSecurityException e) + { + throw new PkixCertPathValidatorException("Could not validate certificate signature.", e, certPath, index); + } + + try + { + // (a) (2) + // + cert.CheckValidity(PkixCertPathValidatorUtilities + .GetValidCertDateFromValidityModel(paramsPKIX, certPath, index)); + } + catch (CertificateExpiredException e) + { + throw new PkixCertPathValidatorException("Could not validate certificate: " + e.Message, e, certPath, index); + } + catch (CertificateNotYetValidException e) + { + throw new PkixCertPathValidatorException("Could not validate certificate: " + e.Message, e, certPath, index); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException("Could not validate time of certificate.", e, certPath, index); + } + + // + // (a) (3) + // + if (paramsPKIX.IsRevocationEnabled) + { + try + { + CheckCrls(paramsPKIX, cert, PkixCertPathValidatorUtilities.GetValidCertDateFromValidityModel(paramsPKIX, + certPath, index), sign, workingPublicKey, certs); + } + catch (Exception e) + { + Exception cause = e.InnerException; + if (cause == null) + { + cause = e; + } + throw new PkixCertPathValidatorException(e.Message, cause, certPath, index); + } + } + + // + // (a) (4) name chaining + // + X509Name issuer = PkixCertPathValidatorUtilities.GetIssuerPrincipal(cert); + if (!issuer.Equivalent(workingIssuerName, true)) + { + throw new PkixCertPathValidatorException("IssuerName(" + issuer + + ") does not match SubjectName(" + workingIssuerName + ") of signing certificate.", null, + certPath, index); + } + } + + internal static int PrepareNextCertI1( + PkixCertPath certPath, + int index, + int explicitPolicy) + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + // + // (i) + // + Asn1Sequence pc = null; + try + { + pc = DerSequence.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.PolicyConstraints)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Policy constraints extension cannot be decoded.", e, certPath, index); + } + + int tmpInt; + + if (pc != null) + { + IEnumerator policyConstraints = pc.GetEnumerator(); + + while (policyConstraints.MoveNext()) + { + try + { + Asn1TaggedObject constraint = Asn1TaggedObject.GetInstance(policyConstraints.Current); + if (constraint.TagNo == 0) + { + tmpInt = DerInteger.GetInstance(constraint, false).Value.IntValue; + if (tmpInt < explicitPolicy) + { + return tmpInt; + } + break; + } + } + catch (ArgumentException e) + { + throw new PkixCertPathValidatorException( + "Policy constraints extension contents cannot be decoded.", e, certPath, index); + } + } + } + return explicitPolicy; + } + + internal static int PrepareNextCertI2( + PkixCertPath certPath, + int index, + int policyMapping) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (i) + // + Asn1Sequence pc = null; + try + { + pc = DerSequence.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.PolicyConstraints)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Policy constraints extension cannot be decoded.", e, certPath, index); + } + + int tmpInt; + + if (pc != null) + { + IEnumerator policyConstraints = pc.GetEnumerator(); + + while (policyConstraints.MoveNext()) + { + try + { + Asn1TaggedObject constraint = Asn1TaggedObject.GetInstance(policyConstraints.Current); + if (constraint.TagNo == 1) + { + tmpInt = DerInteger.GetInstance(constraint, false).Value.IntValue; + if (tmpInt < policyMapping) + { + return tmpInt; + } + break; + } + } + catch (ArgumentException e) + { + throw new PkixCertPathValidatorException( + "Policy constraints extension contents cannot be decoded.", e, certPath, index); + } + } + } + return policyMapping; + } + + internal static void PrepareNextCertG( + PkixCertPath certPath, + int index, + PkixNameConstraintValidator nameConstraintValidator) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (g) handle the name constraints extension + // + NameConstraints nc = null; + try + { + Asn1Sequence ncSeq = DerSequence.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.NameConstraints)); + if (ncSeq != null) + { + nc = new NameConstraints(ncSeq); + } + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Name constraints extension could not be decoded.", e, certPath, index); + } + if (nc != null) + { + // + // (g) (1) permitted subtrees + // + Asn1Sequence permitted = nc.PermittedSubtrees; + if (permitted != null) + { + try + { + nameConstraintValidator.IntersectPermittedSubtree(permitted); + } + catch (Exception ex) + { + throw new PkixCertPathValidatorException( + "Permitted subtrees cannot be build from name constraints extension.", ex, certPath, index); + } + } + + // + // (g) (2) excluded subtrees + // + Asn1Sequence excluded = nc.ExcludedSubtrees; + if (excluded != null) + { + IEnumerator e = excluded.GetEnumerator(); + try + { + while (e.MoveNext()) + { + GeneralSubtree subtree = GeneralSubtree.GetInstance(e.Current); + nameConstraintValidator.AddExcludedSubtree(subtree); + } + } + catch (Exception ex) + { + throw new PkixCertPathValidatorException( + "Excluded subtrees cannot be build from name constraints extension.", ex, certPath, index); + } + } + } + } + + internal static int PrepareNextCertJ( + PkixCertPath certPath, + int index, + int inhibitAnyPolicy) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (j) + // + DerInteger iap = null; + try + { + iap = DerInteger.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.InhibitAnyPolicy)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Inhibit any-policy extension cannot be decoded.", e, certPath, index); + } + + if (iap != null) + { + int _inhibitAnyPolicy = iap.Value.IntValue; + + if (_inhibitAnyPolicy < inhibitAnyPolicy) + return _inhibitAnyPolicy; + } + return inhibitAnyPolicy; + } + + internal static void PrepareNextCertK( + PkixCertPath certPath, + int index) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + // + // (k) + // + BasicConstraints bc = null; + try + { + bc = BasicConstraints.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.BasicConstraints)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException("Basic constraints extension cannot be decoded.", e, certPath, + index); + } + if (bc != null) + { + if (!(bc.IsCA())) + throw new PkixCertPathValidatorException("Not a CA certificate"); + } + else + { + throw new PkixCertPathValidatorException("Intermediate certificate lacks BasicConstraints"); + } + } + + internal static int PrepareNextCertL( + PkixCertPath certPath, + int index, + int maxPathLength) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + // + // (l) + // + if (!PkixCertPathValidatorUtilities.IsSelfIssued(cert)) + { + if (maxPathLength <= 0) + { + throw new PkixCertPathValidatorException("Max path length not greater than zero", null, certPath, index); + } + + return maxPathLength - 1; + } + return maxPathLength; + } + + internal static int PrepareNextCertM( + PkixCertPath certPath, + int index, + int maxPathLength) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (m) + // + BasicConstraints bc = null; + try + { + bc = BasicConstraints.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.BasicConstraints)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException("Basic constraints extension cannot be decoded.", e, certPath, + index); + } + if (bc != null) + { + BigInteger _pathLengthConstraint = bc.PathLenConstraint; + + if (_pathLengthConstraint != null) + { + int _plc = _pathLengthConstraint.IntValue; + + if (_plc < maxPathLength) + { + return _plc; + } + } + } + return maxPathLength; + } + + internal static void PrepareNextCertN( + PkixCertPath certPath, + int index) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (n) + // + bool[] _usage = cert.GetKeyUsage(); + + if ((_usage != null) && !_usage[Rfc3280CertPathUtilities.KEY_CERT_SIGN]) + { + throw new PkixCertPathValidatorException( + "Issuer certificate keyusage extension is critical and does not permit key signing.", null, + certPath, index); + } + } + + internal static void PrepareNextCertO( + PkixCertPath certPath, + int index, + ISet criticalExtensions, + IList pathCheckers) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (o) + // + IEnumerator tmpIter = pathCheckers.GetEnumerator(); + while (tmpIter.MoveNext()) + { + try + { + ((PkixCertPathChecker)tmpIter.Current).Check(cert, criticalExtensions); + } + catch (PkixCertPathValidatorException e) + { + throw new PkixCertPathValidatorException(e.Message, e.InnerException, certPath, index); + } + } + if (!criticalExtensions.IsEmpty) + { + throw new PkixCertPathValidatorException("Certificate has unsupported critical extension.", null, certPath, + index); + } + } + + internal static int PrepareNextCertH1( + PkixCertPath certPath, + int index, + int explicitPolicy) + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (h) + // + if (!PkixCertPathValidatorUtilities.IsSelfIssued(cert)) + { + // + // (1) + // + if (explicitPolicy != 0) + return explicitPolicy - 1; + } + return explicitPolicy; + } + + internal static int PrepareNextCertH2( + PkixCertPath certPath, + int index, + int policyMapping) + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (h) + // + if (!PkixCertPathValidatorUtilities.IsSelfIssued(cert)) + { + // + // (2) + // + if (policyMapping != 0) + return policyMapping - 1; + } + return policyMapping; + } + + + internal static int PrepareNextCertH3( + PkixCertPath certPath, + int index, + int inhibitAnyPolicy) + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (h) + // + if (!PkixCertPathValidatorUtilities.IsSelfIssued(cert)) + { + // + // (3) + // + if (inhibitAnyPolicy != 0) + return inhibitAnyPolicy - 1; + } + return inhibitAnyPolicy; + } + + internal static int WrapupCertA( + int explicitPolicy, + X509Certificate cert) + { + // + // (a) + // + if (!PkixCertPathValidatorUtilities.IsSelfIssued(cert) && (explicitPolicy != 0)) + { + explicitPolicy--; + } + return explicitPolicy; + } + + internal static int WrapupCertB( + PkixCertPath certPath, + int index, + int explicitPolicy) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (b) + // + int tmpInt; + Asn1Sequence pc = null; + try + { + pc = DerSequence.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.PolicyConstraints)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException("Policy constraints could not be decoded.", e, certPath, index); + } + + if (pc != null) + { + IEnumerator policyConstraints = pc.GetEnumerator(); + + while (policyConstraints.MoveNext()) + { + Asn1TaggedObject constraint = (Asn1TaggedObject)policyConstraints.Current; + switch (constraint.TagNo) + { + case 0: + try + { + tmpInt = DerInteger.GetInstance(constraint, false).Value.IntValue; + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Policy constraints requireExplicitPolicy field could not be decoded.", e, certPath, + index); + } + if (tmpInt == 0) + { + return 0; + } + break; + } + } + } + return explicitPolicy; + } + + internal static void WrapupCertF( + PkixCertPath certPath, + int index, + IList pathCheckers, + ISet criticalExtensions) + //throws CertPathValidatorException + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + IEnumerator tmpIter = pathCheckers.GetEnumerator(); + + while (tmpIter.MoveNext()) + { + try + { + ((PkixCertPathChecker)tmpIter.Current).Check(cert, criticalExtensions); + } + catch (PkixCertPathValidatorException e) + { + throw new PkixCertPathValidatorException("Additional certificate path checker failed.", e, certPath, + index); + } + } + + if (!criticalExtensions.IsEmpty) + { + throw new PkixCertPathValidatorException("Certificate has unsupported critical extension", + null, certPath, index); + } + } + + internal static PkixPolicyNode WrapupCertG( + PkixCertPath certPath, + PkixParameters paramsPKIX, + ISet userInitialPolicySet, + int index, + IList[] policyNodes, + PkixPolicyNode validPolicyTree, + ISet acceptablePolicies) + { + int n = certPath.Certificates.Count; + + // + // (g) + // + PkixPolicyNode intersection; + + // + // (g) (i) + // + if (validPolicyTree == null) + { + if (paramsPKIX.IsExplicitPolicyRequired) + { + throw new PkixCertPathValidatorException( + "Explicit policy requested but none available.", null, certPath, index); + } + intersection = null; + } + else if (PkixCertPathValidatorUtilities.IsAnyPolicy(userInitialPolicySet)) // (g) + // (ii) + { + if (paramsPKIX.IsExplicitPolicyRequired) + { + if (acceptablePolicies.IsEmpty) + { + throw new PkixCertPathValidatorException( + "Explicit policy requested but none available.", null, certPath, index); + } + else + { + ISet _validPolicyNodeSet = new HashSet(); + + for (int j = 0; j < policyNodes.Length; j++) + { + IList _nodeDepth = policyNodes[j]; + + for (int k = 0; k < _nodeDepth.Count; k++) + { + PkixPolicyNode _node = (PkixPolicyNode)_nodeDepth[k]; + + if (Rfc3280CertPathUtilities.ANY_POLICY.Equals(_node.ValidPolicy)) + { + foreach (object o in _node.Children) + { + _validPolicyNodeSet.Add(o); + } + } + } + } + + foreach (PkixPolicyNode _node in _validPolicyNodeSet) + { + string _validPolicy = _node.ValidPolicy; + + if (!acceptablePolicies.Contains(_validPolicy)) + { + // TODO? + // validPolicyTree = + // removePolicyNode(validPolicyTree, policyNodes, + // _node); + } + } + if (validPolicyTree != null) + { + for (int j = (n - 1); j >= 0; j--) + { + IList nodes = policyNodes[j]; + + for (int k = 0; k < nodes.Count; k++) + { + PkixPolicyNode node = (PkixPolicyNode)nodes[k]; + if (!node.HasChildren) + { + validPolicyTree = PkixCertPathValidatorUtilities.RemovePolicyNode(validPolicyTree, + policyNodes, node); + } + } + } + } + } + } + + intersection = validPolicyTree; + } + else + { + // + // (g) (iii) + // + // This implementation is not exactly same as the one described in + // RFC3280. + // However, as far as the validation result is concerned, both + // produce + // adequate result. The only difference is whether AnyPolicy is + // remain + // in the policy tree or not. + // + // (g) (iii) 1 + // + ISet _validPolicyNodeSet = new HashSet(); + + for (int j = 0; j < policyNodes.Length; j++) + { + IList _nodeDepth = policyNodes[j]; + + for (int k = 0; k < _nodeDepth.Count; k++) + { + PkixPolicyNode _node = (PkixPolicyNode)_nodeDepth[k]; + + if (Rfc3280CertPathUtilities.ANY_POLICY.Equals(_node.ValidPolicy)) + { + foreach (PkixPolicyNode _c_node in _node.Children) + { + if (!Rfc3280CertPathUtilities.ANY_POLICY.Equals(_c_node.ValidPolicy)) + { + _validPolicyNodeSet.Add(_c_node); + } + } + } + } + } + + // + // (g) (iii) 2 + // + IEnumerator _vpnsIter = _validPolicyNodeSet.GetEnumerator(); + while (_vpnsIter.MoveNext()) + { + PkixPolicyNode _node = (PkixPolicyNode)_vpnsIter.Current; + string _validPolicy = _node.ValidPolicy; + + if (!userInitialPolicySet.Contains(_validPolicy)) + { + validPolicyTree = PkixCertPathValidatorUtilities.RemovePolicyNode(validPolicyTree, policyNodes, _node); + } + } + + // + // (g) (iii) 4 + // + if (validPolicyTree != null) + { + for (int j = (n - 1); j >= 0; j--) + { + IList nodes = policyNodes[j]; + + for (int k = 0; k < nodes.Count; k++) + { + PkixPolicyNode node = (PkixPolicyNode)nodes[k]; + if (!node.HasChildren) + { + validPolicyTree = PkixCertPathValidatorUtilities.RemovePolicyNode(validPolicyTree, policyNodes, + node); + } + } + } + } + + intersection = validPolicyTree; + } + return intersection; + } + + /** + * If use-deltas is set, verify the issuer and scope of the delta CRL. + * + * @param deltaCRL The delta CRL. + * @param completeCRL The complete CRL. + * @param pkixParams The PKIX paramaters. + * @throws AnnotatedException if an exception occurs. + */ + internal static void ProcessCrlC( + X509Crl deltaCRL, + X509Crl completeCRL, + PkixParameters pkixParams) + { + if (deltaCRL == null) + return; + + IssuingDistributionPoint completeidp = null; + try + { + completeidp = IssuingDistributionPoint.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(completeCRL, X509Extensions.IssuingDistributionPoint)); + } + catch (Exception e) + { + throw new Exception("000 Issuing distribution point extension could not be decoded.", e); + } + + if (pkixParams.IsUseDeltasEnabled) + { + // (c) (1) + if (!deltaCRL.IssuerDN.Equivalent(completeCRL.IssuerDN, true)) + throw new Exception("Complete CRL issuer does not match delta CRL issuer."); + + // (c) (2) + IssuingDistributionPoint deltaidp = null; + try + { + deltaidp = IssuingDistributionPoint.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(deltaCRL, X509Extensions.IssuingDistributionPoint)); + } + catch (Exception e) + { + throw new Exception( + "Issuing distribution point extension from delta CRL could not be decoded.", e); + } + + if (!BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(completeidp, deltaidp)) + { + throw new Exception( + "Issuing distribution point extension from delta CRL and complete CRL does not match."); + } + + // (c) (3) + Asn1Object completeKeyIdentifier = null; + try + { + completeKeyIdentifier = PkixCertPathValidatorUtilities.GetExtensionValue( + completeCRL, X509Extensions.AuthorityKeyIdentifier); + } + catch (Exception e) + { + throw new Exception( + "Authority key identifier extension could not be extracted from complete CRL.", e); + } + + Asn1Object deltaKeyIdentifier = null; + try + { + deltaKeyIdentifier = PkixCertPathValidatorUtilities.GetExtensionValue( + deltaCRL, X509Extensions.AuthorityKeyIdentifier); + } + catch (Exception e) + { + throw new Exception( + "Authority key identifier extension could not be extracted from delta CRL.", e); + } + + if (completeKeyIdentifier == null) + throw new Exception("CRL authority key identifier is null."); + + if (deltaKeyIdentifier == null) + throw new Exception("Delta CRL authority key identifier is null."); + + if (!completeKeyIdentifier.Equals(deltaKeyIdentifier)) + { + throw new Exception( + "Delta CRL authority key identifier does not match complete CRL authority key identifier."); + } + } + } + + internal static void ProcessCrlI( + DateTime validDate, + X509Crl deltacrl, + object cert, + CertStatus certStatus, + PkixParameters pkixParams) + { + if (pkixParams.IsUseDeltasEnabled && deltacrl != null) + { + PkixCertPathValidatorUtilities.GetCertStatus(validDate, deltacrl, cert, certStatus); + } + } + + internal static void ProcessCrlJ( + DateTime validDate, + X509Crl completecrl, + object cert, + CertStatus certStatus) + { + if (certStatus.Status == CertStatus.Unrevoked) + { + PkixCertPathValidatorUtilities.GetCertStatus(validDate, completecrl, cert, certStatus); + } + } + + internal static PkixPolicyNode ProcessCertE( + PkixCertPath certPath, + int index, + PkixPolicyNode validPolicyTree) + { + IList certs = certPath.Certificates; + X509Certificate cert = (X509Certificate)certs[index]; + + // + // (e) + // + Asn1Sequence certPolicies = null; + try + { + certPolicies = DerSequence.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue(cert, X509Extensions.CertificatePolicies)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException("Could not read certificate policies extension from certificate.", + e, certPath, index); + } + if (certPolicies == null) + { + validPolicyTree = null; + } + return validPolicyTree; + } + + internal static readonly string[] CrlReasons = new string[] + { + "unspecified", + "keyCompromise", + "cACompromise", + "affiliationChanged", + "superseded", + "cessationOfOperation", + "certificateHold", + "unknown", + "removeFromCRL", + "privilegeWithdrawn", + "aACompromise" + }; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3280CertPathUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3280CertPathUtilities.cs.meta new file mode 100644 index 00000000..f55d9c9d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3280CertPathUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6b4b0eb500c7b0446b1ae401484cb0ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3281CertPathUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3281CertPathUtilities.cs new file mode 100644 index 00000000..41ca1296 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3281CertPathUtilities.cs @@ -0,0 +1,612 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Globalization; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + internal class Rfc3281CertPathUtilities + { + internal static void ProcessAttrCert7( + IX509AttributeCertificate attrCert, + PkixCertPath certPath, + PkixCertPath holderCertPath, + PkixParameters pkixParams) + { + // TODO: + // AA Controls + // Attribute encryption + // Proxy + ISet critExtOids = attrCert.GetCriticalExtensionOids(); + + // 7.1 + // process extensions + + // target information checked in step 6 / X509AttributeCertStoreSelector + if (critExtOids.Contains(X509Extensions.TargetInformation.Id)) + { + try + { + TargetInformation.GetInstance(PkixCertPathValidatorUtilities + .GetExtensionValue(attrCert, X509Extensions.TargetInformation)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Target information extension could not be read.", e); + } + } + critExtOids.Remove(X509Extensions.TargetInformation.Id); + foreach (PkixAttrCertChecker checker in pkixParams.GetAttrCertCheckers()) + { + checker.Check(attrCert, certPath, holderCertPath, critExtOids); + } + if (!critExtOids.IsEmpty) + { + throw new PkixCertPathValidatorException( + "Attribute certificate contains unsupported critical extensions: " + + critExtOids); + } + } + + /** + * Checks if an attribute certificate is revoked. + * + * @param attrCert Attribute certificate to check if it is revoked. + * @param paramsPKIX PKIX parameters. + * @param issuerCert The issuer certificate of the attribute certificate + * attrCert. + * @param validDate The date when the certificate revocation status should + * be checked. + * @param certPathCerts The certificates of the certification path to be + * checked. + * + * @throws CertPathValidatorException if the certificate is revoked or the + * status cannot be checked or some error occurs. + */ + internal static void CheckCrls( + IX509AttributeCertificate attrCert, + PkixParameters paramsPKIX, + X509Certificate issuerCert, + DateTime validDate, + IList certPathCerts) + { + if (paramsPKIX.IsRevocationEnabled) + { + // check if revocation is available + if (attrCert.GetExtensionValue(X509Extensions.NoRevAvail) == null) + { + CrlDistPoint crldp = null; + try + { + crldp = CrlDistPoint.GetInstance( + PkixCertPathValidatorUtilities.GetExtensionValue( + attrCert, X509Extensions.CrlDistributionPoints)); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "CRL distribution point extension could not be read.", e); + } + try + { + PkixCertPathValidatorUtilities + .AddAdditionalStoresFromCrlDistributionPoint(crldp, paramsPKIX); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "No additional CRL locations could be decoded from CRL distribution point extension.", e); + } + CertStatus certStatus = new CertStatus(); + ReasonsMask reasonsMask = new ReasonsMask(); + + Exception lastException = null; + bool validCrlFound = false; + // for each distribution point + if (crldp != null) + { + DistributionPoint[] dps = null; + try + { + dps = crldp.GetDistributionPoints(); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Distribution points could not be read.", e); + } + try + { + for (int i = 0; i < dps.Length + && certStatus.Status == CertStatus.Unrevoked + && !reasonsMask.IsAllReasons; i++) + { + PkixParameters paramsPKIXClone = (PkixParameters) paramsPKIX + .Clone(); + CheckCrl(dps[i], attrCert, paramsPKIXClone, + validDate, issuerCert, certStatus, reasonsMask, + certPathCerts); + validCrlFound = true; + } + } + catch (Exception e) + { + lastException = new Exception( + "No valid CRL for distribution point found.", e); + } + } + + /* + * If the revocation status has not been determined, repeat the + * process above with any available CRLs not specified in a + * distribution point but issued by the certificate issuer. + */ + + if (certStatus.Status == CertStatus.Unrevoked + && !reasonsMask.IsAllReasons) + { + try + { + /* + * assume a DP with both the reasons and the cRLIssuer + * fields omitted and a distribution point name of the + * certificate issuer. + */ + Asn1Object issuer = null; + try + { + issuer = new Asn1InputStream( + attrCert.Issuer.GetPrincipals()[0].GetEncoded()).ReadObject(); + } + catch (Exception e) + { + throw new Exception( + "Issuer from certificate for CRL could not be reencoded.", + e); + } + DistributionPoint dp = new DistributionPoint( + new DistributionPointName(0, new GeneralNames( + new GeneralName(GeneralName.DirectoryName, issuer))), null, null); + PkixParameters paramsPKIXClone = (PkixParameters) paramsPKIX.Clone(); + CheckCrl(dp, attrCert, paramsPKIXClone, validDate, + issuerCert, certStatus, reasonsMask, certPathCerts); + validCrlFound = true; + } + catch (Exception e) + { + lastException = new Exception( + "No valid CRL for distribution point found.", e); + } + } + + if (!validCrlFound) + { + throw new PkixCertPathValidatorException( + "No valid CRL found.", lastException); + } + if (certStatus.Status != CertStatus.Unrevoked) + { + // This format is enforced by the NistCertPath tests + string formattedDate = certStatus.RevocationDate.Value.ToString( + "ddd MMM dd HH:mm:ss K yyyy"); + string message = "Attribute certificate revocation after " + + formattedDate; + message += ", reason: " + + Rfc3280CertPathUtilities.CrlReasons[certStatus.Status]; + throw new PkixCertPathValidatorException(message); + } + if (!reasonsMask.IsAllReasons + && certStatus.Status == CertStatus.Unrevoked) + { + certStatus.Status = CertStatus.Undetermined; + } + if (certStatus.Status == CertStatus.Undetermined) + { + throw new PkixCertPathValidatorException( + "Attribute certificate status could not be determined."); + } + + } + else + { + if (attrCert.GetExtensionValue(X509Extensions.CrlDistributionPoints) != null + || attrCert.GetExtensionValue(X509Extensions.AuthorityInfoAccess) != null) + { + throw new PkixCertPathValidatorException( + "No rev avail extension is set, but also an AC revocation pointer."); + } + } + } + } + + internal static void AdditionalChecks( + IX509AttributeCertificate attrCert, + PkixParameters pkixParams) + { + // 1 + foreach (string oid in pkixParams.GetProhibitedACAttributes()) + { + if (attrCert.GetAttributes(oid) != null) + { + throw new PkixCertPathValidatorException( + "Attribute certificate contains prohibited attribute: " + + oid + "."); + } + } + foreach (string oid in pkixParams.GetNecessaryACAttributes()) + { + if (attrCert.GetAttributes(oid) == null) + { + throw new PkixCertPathValidatorException( + "Attribute certificate does not contain necessary attribute: " + + oid + "."); + } + } + } + + internal static void ProcessAttrCert5( + IX509AttributeCertificate attrCert, + PkixParameters pkixParams) + { + try + { + attrCert.CheckValidity(PkixCertPathValidatorUtilities.GetValidDate(pkixParams)); + } + catch (CertificateExpiredException e) + { + throw new PkixCertPathValidatorException( + "Attribute certificate is not valid.", e); + } + catch (CertificateNotYetValidException e) + { + throw new PkixCertPathValidatorException( + "Attribute certificate is not valid.", e); + } + } + + internal static void ProcessAttrCert4( + X509Certificate acIssuerCert, + PkixParameters pkixParams) + { + ISet set = pkixParams.GetTrustedACIssuers(); + bool trusted = false; + foreach (TrustAnchor anchor in set) + { + IDictionary symbols = X509Name.RFC2253Symbols; + if (acIssuerCert.SubjectDN.ToString(false, symbols).Equals(anchor.CAName) + || acIssuerCert.Equals(anchor.TrustedCert)) + { + trusted = true; + } + } + if (!trusted) + { + throw new PkixCertPathValidatorException( + "Attribute certificate issuer is not directly trusted."); + } + } + + internal static void ProcessAttrCert3( + X509Certificate acIssuerCert, + PkixParameters pkixParams) + { + if (acIssuerCert.GetKeyUsage() != null + && (!acIssuerCert.GetKeyUsage()[0] && !acIssuerCert.GetKeyUsage()[1])) + { + throw new PkixCertPathValidatorException( + "Attribute certificate issuer public key cannot be used to validate digital signatures."); + } + if (acIssuerCert.GetBasicConstraints() != -1) + { + throw new PkixCertPathValidatorException( + "Attribute certificate issuer is also a public key certificate issuer."); + } + } + + internal static PkixCertPathValidatorResult ProcessAttrCert2( + PkixCertPath certPath, + PkixParameters pkixParams) + { + PkixCertPathValidator validator = new PkixCertPathValidator(); + + try + { + return validator.Validate(certPath, pkixParams); + } + catch (PkixCertPathValidatorException e) + { + throw new PkixCertPathValidatorException( + "Certification path for issuer certificate of attribute certificate could not be validated.", + e); + } + } + + /** + * Searches for a holder public key certificate and verifies its + * certification path. + * + * @param attrCert the attribute certificate. + * @param pkixParams The PKIX parameters. + * @return The certificate path of the holder certificate. + * @throws Exception if + *
      + *
    • no public key certificate can be found although holder + * information is given by an entity name or a base certificate + * ID
    • + *
    • support classes cannot be created
    • + *
    • no certification path for the public key certificate can + * be built
    • + *
    + */ + internal static PkixCertPath ProcessAttrCert1( + IX509AttributeCertificate attrCert, + PkixParameters pkixParams) + { + PkixCertPathBuilderResult result = null; + // find holder PKCs + ISet holderPKCs = new HashSet(); + if (attrCert.Holder.GetIssuer() != null) + { + X509CertStoreSelector selector = new X509CertStoreSelector(); + selector.SerialNumber = attrCert.Holder.SerialNumber; + X509Name[] principals = attrCert.Holder.GetIssuer(); + for (int i = 0; i < principals.Length; i++) + { + try + { +// if (principals[i] is X500Principal) + { + selector.Issuer = principals[i]; + } + holderPKCs.AddAll(PkixCertPathValidatorUtilities + .FindCertificates(selector, pkixParams.GetStores())); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Public key certificate for attribute certificate cannot be searched.", + e); + } + } + if (holderPKCs.IsEmpty) + { + throw new PkixCertPathValidatorException( + "Public key certificate specified in base certificate ID for attribute certificate cannot be found."); + } + } + if (attrCert.Holder.GetEntityNames() != null) + { + X509CertStoreSelector selector = new X509CertStoreSelector(); + X509Name[] principals = attrCert.Holder.GetEntityNames(); + for (int i = 0; i < principals.Length; i++) + { + try + { +// if (principals[i] is X500Principal) + { + selector.Issuer = principals[i]; + } + holderPKCs.AddAll(PkixCertPathValidatorUtilities + .FindCertificates(selector, pkixParams.GetStores())); + } + catch (Exception e) + { + throw new PkixCertPathValidatorException( + "Public key certificate for attribute certificate cannot be searched.", + e); + } + } + if (holderPKCs.IsEmpty) + { + throw new PkixCertPathValidatorException( + "Public key certificate specified in entity name for attribute certificate cannot be found."); + } + } + + // verify cert paths for PKCs + PkixBuilderParameters parameters = (PkixBuilderParameters) + PkixBuilderParameters.GetInstance(pkixParams); + + PkixCertPathValidatorException lastException = null; + foreach (X509Certificate cert in holderPKCs) + { + X509CertStoreSelector selector = new X509CertStoreSelector(); + selector.Certificate = cert; + parameters.SetTargetConstraints(selector); + + PkixCertPathBuilder builder = new PkixCertPathBuilder(); + + try + { + result = builder.Build(PkixBuilderParameters.GetInstance(parameters)); + } + catch (PkixCertPathBuilderException e) + { + lastException = new PkixCertPathValidatorException( + "Certification path for public key certificate of attribute certificate could not be build.", + e); + } + } + if (lastException != null) + { + throw lastException; + } + return result.CertPath; + } + + /** + * + * Checks a distribution point for revocation information for the + * certificate attrCert. + * + * @param dp The distribution point to consider. + * @param attrCert The attribute certificate which should be checked. + * @param paramsPKIX PKIX parameters. + * @param validDate The date when the certificate revocation status should + * be checked. + * @param issuerCert Certificate to check if it is revoked. + * @param reasonMask The reasons mask which is already checked. + * @param certPathCerts The certificates of the certification path to be + * checked. + * @throws Exception if the certificate is revoked or the status + * cannot be checked or some error occurs. + */ + private static void CheckCrl( + DistributionPoint dp, + IX509AttributeCertificate attrCert, + PkixParameters paramsPKIX, + DateTime validDate, + X509Certificate issuerCert, + CertStatus certStatus, + ReasonsMask reasonMask, + IList certPathCerts) + { + /* + * 4.3.6 No Revocation Available + * + * The noRevAvail extension, defined in [X.509-2000], allows an AC + * issuer to indicate that no revocation information will be made + * available for this AC. + */ + if (attrCert.GetExtensionValue(X509Extensions.NoRevAvail) != null) + { + return; + } + + DateTime currentDate = DateTime.UtcNow; + if (validDate.CompareTo(currentDate) > 0) + { + throw new Exception("Validation time is in future."); + } + + // (a) + /* + * We always get timely valid CRLs, so there is no step (a) (1). + * "locally cached" CRLs are assumed to be in getStore(), additional + * CRLs must be enabled in the ExtendedPkixParameters and are in + * getAdditionalStore() + */ + ISet crls = PkixCertPathValidatorUtilities.GetCompleteCrls(dp, attrCert, + currentDate, paramsPKIX); + bool validCrlFound = false; + Exception lastException = null; + + IEnumerator crl_iter = crls.GetEnumerator(); + + while (crl_iter.MoveNext() + && certStatus.Status == CertStatus.Unrevoked + && !reasonMask.IsAllReasons) + { + try + { + X509Crl crl = (X509Crl) crl_iter.Current; + + // (d) + ReasonsMask interimReasonsMask = Rfc3280CertPathUtilities.ProcessCrlD(crl, dp); + + // (e) + /* + * The reasons mask is updated at the end, so only valid CRLs + * can update it. If this CRL does not contain new reasons it + * must be ignored. + */ + if (!interimReasonsMask.HasNewReasons(reasonMask)) + { + continue; + } + + // (f) + ISet keys = Rfc3280CertPathUtilities.ProcessCrlF(crl, attrCert, + null, null, paramsPKIX, certPathCerts); + // (g) + AsymmetricKeyParameter pubKey = Rfc3280CertPathUtilities.ProcessCrlG(crl, keys); + + X509Crl deltaCRL = null; + + if (paramsPKIX.IsUseDeltasEnabled) + { + // get delta CRLs + ISet deltaCRLs = PkixCertPathValidatorUtilities.GetDeltaCrls( + currentDate, paramsPKIX, crl); + // we only want one valid delta CRL + // (h) + deltaCRL = Rfc3280CertPathUtilities.ProcessCrlH(deltaCRLs, pubKey); + } + + /* + * CRL must be be valid at the current time, not the validation + * time. If a certificate is revoked with reason keyCompromise, + * cACompromise, it can be used for forgery, also for the past. + * This reason may not be contained in older CRLs. + */ + + /* + * in the chain model signatures stay valid also after the + * certificate has been expired, so they do not have to be in + * the CRL vality time + */ + if (paramsPKIX.ValidityModel != PkixParameters.ChainValidityModel) + { + /* + * if a certificate has expired, but was revoked, it is not + * more in the CRL, so it would be regarded as valid if the + * first check is not done + */ + if (attrCert.NotAfter.CompareTo(crl.ThisUpdate) < 0) + { + throw new Exception( + "No valid CRL for current time found."); + } + } + + Rfc3280CertPathUtilities.ProcessCrlB1(dp, attrCert, crl); + + // (b) (2) + Rfc3280CertPathUtilities.ProcessCrlB2(dp, attrCert, crl); + + // (c) + Rfc3280CertPathUtilities.ProcessCrlC(deltaCRL, crl, paramsPKIX); + + // (i) + Rfc3280CertPathUtilities.ProcessCrlI(validDate, deltaCRL, + attrCert, certStatus, paramsPKIX); + + // (j) + Rfc3280CertPathUtilities.ProcessCrlJ(validDate, crl, attrCert, + certStatus); + + // (k) + if (certStatus.Status == CrlReason.RemoveFromCrl) + { + certStatus.Status = CertStatus.Unrevoked; + } + + // update reasons mask + reasonMask.AddReasons(interimReasonsMask); + validCrlFound = true; + } + catch (Exception e) + { + lastException = e; + } + } + if (!validCrlFound) + { + throw lastException; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3281CertPathUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3281CertPathUtilities.cs.meta new file mode 100644 index 00000000..430c5cf4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/Rfc3281CertPathUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d710687c541762b48abd98c0e1a2246c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/TrustAnchor.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/TrustAnchor.cs new file mode 100644 index 00000000..acc654a0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/TrustAnchor.cs @@ -0,0 +1,263 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Pkix +{ + /// + /// A trust anchor or most-trusted Certification Authority (CA). + /// + /// This class represents a "most-trusted CA", which is used as a trust anchor + /// for validating X.509 certification paths. A most-trusted CA includes the + /// public key of the CA, the CA's name, and any constraints upon the set of + /// paths which may be validated using this key. These parameters can be + /// specified in the form of a trusted X509Certificate or as individual + /// parameters. + /// + public class TrustAnchor + { + private readonly AsymmetricKeyParameter pubKey; + private readonly string caName; + private readonly X509Name caPrincipal; + private readonly X509Certificate trustedCert; + private byte[] ncBytes; + private NameConstraints nc; + + /// + /// Creates an instance of TrustAnchor with the specified X509Certificate and + /// optional name constraints, which are intended to be used as additional + /// constraints when validating an X.509 certification path. + /// The name constraints are specified as a byte array. This byte array + /// should contain the DER encoded form of the name constraints, as they + /// would appear in the NameConstraints structure defined in RFC 2459 and + /// X.509. The ASN.1 definition of this structure appears below. + /// + ///
    +	    ///	NameConstraints ::= SEQUENCE {
    +	    ///		permittedSubtrees       [0]     GeneralSubtrees OPTIONAL,
    +	    ///		excludedSubtrees        [1]     GeneralSubtrees OPTIONAL }
    +	    ///	   
    +        /// GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
    +        /// 
    +        ///		GeneralSubtree ::= SEQUENCE {
    +        ///		base                    GeneralName,
    +        ///		minimum         [0]     BaseDistance DEFAULT 0,
    +        ///		maximum         [1]     BaseDistance OPTIONAL }
    +        ///		
    +        ///		BaseDistance ::= INTEGER (0..MAX)
    +		///
    +		///		GeneralName ::= CHOICE {
    +		///		otherName                       [0]     OtherName,
    +		///		rfc822Name                      [1]     IA5String,
    +		///		dNSName                         [2]     IA5String,
    +		///		x400Address                     [3]     ORAddress,
    +		///		directoryName                   [4]     Name,
    +		///		ediPartyName                    [5]     EDIPartyName,
    +		///		uniformResourceIdentifier       [6]     IA5String,
    +		///		iPAddress                       [7]     OCTET STRING,
    +		///		registeredID                    [8]     OBJECT IDENTIFIER}
    +		///	
    + /// + /// Note that the name constraints byte array supplied is cloned to protect + /// against subsequent modifications. + ///
    + /// a trusted X509Certificate + /// a byte array containing the ASN.1 DER encoding of a + /// NameConstraints extension to be used for checking name + /// constraints. Only the value of the extension is included, not + /// the OID or criticality flag. Specify null to omit the + /// parameter. + /// if the specified X509Certificate is null + public TrustAnchor( + X509Certificate trustedCert, + byte[] nameConstraints) + { + if (trustedCert == null) + throw new ArgumentNullException("trustedCert"); + + this.trustedCert = trustedCert; + this.pubKey = null; + this.caName = null; + this.caPrincipal = null; + setNameConstraints(nameConstraints); + } + + /// + /// Creates an instance of TrustAnchor where the + /// most-trusted CA is specified as an X500Principal and public key. + /// + /// + ///

    + /// Name constraints are an optional parameter, and are intended to be used + /// as additional constraints when validating an X.509 certification path. + ///

    + /// The name constraints are specified as a byte array. This byte array + /// contains the DER encoded form of the name constraints, as they + /// would appear in the NameConstraints structure defined in RFC 2459 + /// and X.509. The ASN.1 notation for this structure is supplied in the + /// documentation for the other constructors. + ///

    + /// Note that the name constraints byte array supplied here is cloned to + /// protect against subsequent modifications. + ///

    + ///
    + /// the name of the most-trusted CA as X509Name + /// the public key of the most-trusted CA + /// + /// a byte array containing the ASN.1 DER encoding of a NameConstraints extension to + /// be used for checking name constraints. Only the value of the extension is included, + /// not the OID or criticality flag. Specify null to omit the parameter. + /// + /// + /// if caPrincipal or pubKey is null + /// + public TrustAnchor( + X509Name caPrincipal, + AsymmetricKeyParameter pubKey, + byte[] nameConstraints) + { + if (caPrincipal == null) + throw new ArgumentNullException("caPrincipal"); + if (pubKey == null) + throw new ArgumentNullException("pubKey"); + + this.trustedCert = null; + this.caPrincipal = caPrincipal; + this.caName = caPrincipal.ToString(); + this.pubKey = pubKey; + setNameConstraints(nameConstraints); + } + + /// + /// Creates an instance of TrustAnchor where the most-trusted + /// CA is specified as a distinguished name and public key. Name constraints + /// are an optional parameter, and are intended to be used as additional + /// constraints when validating an X.509 certification path. + ///
    + /// The name constraints are specified as a byte array. This byte array + /// contains the DER encoded form of the name constraints, as they would + /// appear in the NameConstraints structure defined in RFC 2459 and X.509. + ///
    + /// the X.500 distinguished name of the most-trusted CA in RFC + /// 2253 string format + /// the public key of the most-trusted CA + /// a byte array containing the ASN.1 DER encoding of a + /// NameConstraints extension to be used for checking name + /// constraints. Only the value of the extension is included, not + /// the OID or criticality flag. Specify null to omit the + /// parameter. + /// throws NullPointerException, IllegalArgumentException + public TrustAnchor( + string caName, + AsymmetricKeyParameter pubKey, + byte[] nameConstraints) + { + if (caName == null) + throw new ArgumentNullException("caName"); + if (pubKey == null) + throw new ArgumentNullException("pubKey"); + if (caName.Length == 0) + throw new ArgumentException("caName can not be an empty string"); + + this.caPrincipal = new X509Name(caName); + this.pubKey = pubKey; + this.caName = caName; + this.trustedCert = null; + setNameConstraints(nameConstraints); + } + + /// + /// Returns the most-trusted CA certificate. + /// + public X509Certificate TrustedCert + { + get { return this.trustedCert; } + } + + /// + /// Returns the name of the most-trusted CA as an X509Name. + /// + public X509Name CA + { + get { return this.caPrincipal; } + } + + /// + /// Returns the name of the most-trusted CA in RFC 2253 string format. + /// + public string CAName + { + get { return this.caName; } + } + + /// + /// Returns the public key of the most-trusted CA. + /// + public AsymmetricKeyParameter CAPublicKey + { + get { return this.pubKey; } + } + + /// + /// Decode the name constraints and clone them if not null. + /// + private void setNameConstraints( + byte[] bytes) + { + if (bytes == null) + { + ncBytes = null; + nc = null; + } + else + { + ncBytes = (byte[]) bytes.Clone(); + // validate DER encoding + //nc = new NameConstraintsExtension(Boolean.FALSE, bytes); + nc = NameConstraints.GetInstance(Asn1Object.FromByteArray(bytes)); + } + } + + public byte[] GetNameConstraints + { + get { return Arrays.Clone(ncBytes); } + } + + /// + /// Returns a formatted string describing the TrustAnchor. + /// + /// a formatted string describing the TrustAnchor + public override string ToString() + { + // TODO Some of the sub-objects might not implement ToString() properly + string nl = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + StringBuilder sb = new StringBuilder(); + sb.Append("["); + sb.Append(nl); + if (this.pubKey != null) + { + sb.Append(" Trusted CA Public Key: ").Append(this.pubKey).Append(nl); + sb.Append(" Trusted CA Issuer Name: ").Append(this.caName).Append(nl); + } + else + { + sb.Append(" Trusted CA cert: ").Append(this.TrustedCert).Append(nl); + } + if (nc != null) + { + sb.Append(" Name Constraints: ").Append(nc).Append(nl); + } + return sb.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/TrustAnchor.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/TrustAnchor.cs.meta new file mode 100644 index 00000000..7d545c99 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/pkix/TrustAnchor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d36de1eed444fb4faa2bdef5ce1d96c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security.meta new file mode 100644 index 00000000..959f2742 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2c421ef18ca1f844c8134a15061c4605 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/AgreementUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/AgreementUtilities.cs new file mode 100644 index 00000000..792f34be --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/AgreementUtilities.cs @@ -0,0 +1,128 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.EdEC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement.Kdf; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + /// + /// Utility class for creating IBasicAgreement objects from their names/Oids + /// + public sealed class AgreementUtilities + { + private AgreementUtilities() + { + } + + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + //private static readonly IDictionary oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static AgreementUtilities() + { + algorithms[X9ObjectIdentifiers.DHSinglePassCofactorDHSha1KdfScheme.Id] = "ECCDHWITHSHA1KDF"; + algorithms[X9ObjectIdentifiers.DHSinglePassStdDHSha1KdfScheme.Id] = "ECDHWITHSHA1KDF"; + algorithms[X9ObjectIdentifiers.MqvSinglePassSha1KdfScheme.Id] = "ECMQVWITHSHA1KDF"; + + algorithms[EdECObjectIdentifiers.id_X25519.Id] = "X25519"; + algorithms[EdECObjectIdentifiers.id_X448.Id] = "X448"; + } + + public static IBasicAgreement GetBasicAgreement( + DerObjectIdentifier oid) + { + return GetBasicAgreement(oid.Id); + } + + public static IBasicAgreement GetBasicAgreement( + string algorithm) + { + string mechanism = GetMechanism(algorithm); + + if (mechanism == "DH" || mechanism == "DIFFIEHELLMAN") + return new DHBasicAgreement(); + + if (mechanism == "ECDH") + return new ECDHBasicAgreement(); + + if (mechanism == "ECDHC" || mechanism == "ECCDH") + return new ECDHCBasicAgreement(); + + if (mechanism == "ECMQV") + return new ECMqvBasicAgreement(); + + throw new SecurityUtilityException("Basic Agreement " + algorithm + " not recognised."); + } + + public static IBasicAgreement GetBasicAgreementWithKdf( + DerObjectIdentifier oid, + string wrapAlgorithm) + { + return GetBasicAgreementWithKdf(oid.Id, wrapAlgorithm); + } + + public static IBasicAgreement GetBasicAgreementWithKdf( + string agreeAlgorithm, + string wrapAlgorithm) + { + string mechanism = GetMechanism(agreeAlgorithm); + + // 'DHWITHSHA1KDF' retained for backward compatibility + if (mechanism == "DHWITHSHA1KDF" || mechanism == "ECDHWITHSHA1KDF") + return new ECDHWithKdfBasicAgreement( + wrapAlgorithm, + new ECDHKekGenerator( + new Sha1Digest())); + + if (mechanism == "ECMQVWITHSHA1KDF") + return new ECMqvWithKdfBasicAgreement( + wrapAlgorithm, + new ECDHKekGenerator( + new Sha1Digest())); + + throw new SecurityUtilityException("Basic Agreement (with KDF) " + agreeAlgorithm + " not recognised."); + } + + public static IRawAgreement GetRawAgreement( + DerObjectIdentifier oid) + { + return GetRawAgreement(oid.Id); + } + + public static IRawAgreement GetRawAgreement( + string algorithm) + { + string mechanism = GetMechanism(algorithm); + + if (mechanism == "X25519") + return new X25519Agreement(); + + if (mechanism == "X448") + return new X448Agreement(); + + throw new SecurityUtilityException("Raw Agreement " + algorithm + " not recognised."); + } + + public static string GetAlgorithmName( + DerObjectIdentifier oid) + { + return (string)algorithms[oid.Id]; + } + + private static string GetMechanism(string algorithm) + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + string mechanism = (string)algorithms[upper]; + return mechanism == null ? upper : mechanism; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/AgreementUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/AgreementUtilities.cs.meta new file mode 100644 index 00000000..ef3db30d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/AgreementUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cbde65561e82da43be786150b90a32b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/CipherUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/CipherUtilities.cs new file mode 100644 index 00000000..f26fe829 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/CipherUtilities.cs @@ -0,0 +1,764 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Kisa; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ntt; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Agreement; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Encodings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + /// + /// Cipher Utility class contains methods that can not be specifically grouped into other classes. + /// + public sealed class CipherUtilities + { + private enum CipherAlgorithm { + AES, + ARC4, + BLOWFISH, + CAMELLIA, + CAST5, + CAST6, + DES, + DESEDE, + ELGAMAL, + GOST28147, + HC128, + HC256, + IDEA, + NOEKEON, + PBEWITHSHAAND128BITRC4, + PBEWITHSHAAND40BITRC4, + RC2, + RC5, + RC5_64, + RC6, + RIJNDAEL, + RSA, + SALSA20, + SEED, + SERPENT, + SKIPJACK, + SM4, + TEA, + THREEFISH_256, + THREEFISH_512, + THREEFISH_1024, + TNEPRES, + TWOFISH, + VMPC, + VMPC_KSA3, + XTEA, + }; + + private enum CipherMode { ECB, NONE, CBC, CCM, CFB, CTR, CTS, EAX, GCM, GOFB, OCB, OFB, OPENPGPCFB, SIC }; + private enum CipherPadding + { + NOPADDING, + RAW, + ISO10126PADDING, + ISO10126D2PADDING, + ISO10126_2PADDING, + ISO7816_4PADDING, + ISO9797_1PADDING, + ISO9796_1, + ISO9796_1PADDING, + OAEP, + OAEPPADDING, + OAEPWITHMD5ANDMGF1PADDING, + OAEPWITHSHA1ANDMGF1PADDING, + OAEPWITHSHA_1ANDMGF1PADDING, + OAEPWITHSHA224ANDMGF1PADDING, + OAEPWITHSHA_224ANDMGF1PADDING, + OAEPWITHSHA256ANDMGF1PADDING, + OAEPWITHSHA_256ANDMGF1PADDING, + OAEPWITHSHA384ANDMGF1PADDING, + OAEPWITHSHA_384ANDMGF1PADDING, + OAEPWITHSHA512ANDMGF1PADDING, + OAEPWITHSHA_512ANDMGF1PADDING, + PKCS1, + PKCS1PADDING, + PKCS5, + PKCS5PADDING, + PKCS7, + PKCS7PADDING, + TBCPADDING, + WITHCTS, + X923PADDING, + ZEROBYTEPADDING, + }; + + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static CipherUtilities() + { + // Signal to obfuscation tools not to change enum constants + ((CipherAlgorithm)Enums.GetArbitraryValue(typeof(CipherAlgorithm))).ToString(); + ((CipherMode)Enums.GetArbitraryValue(typeof(CipherMode))).ToString(); + ((CipherPadding)Enums.GetArbitraryValue(typeof(CipherPadding))).ToString(); + + // TODO Flesh out the list of aliases + + algorithms[NistObjectIdentifiers.IdAes128Ecb.Id] = "AES/ECB/PKCS7PADDING"; + algorithms[NistObjectIdentifiers.IdAes192Ecb.Id] = "AES/ECB/PKCS7PADDING"; + algorithms[NistObjectIdentifiers.IdAes256Ecb.Id] = "AES/ECB/PKCS7PADDING"; + algorithms["AES//PKCS7"] = "AES/ECB/PKCS7PADDING"; + algorithms["AES//PKCS7PADDING"] = "AES/ECB/PKCS7PADDING"; + algorithms["AES//PKCS5"] = "AES/ECB/PKCS7PADDING"; + algorithms["AES//PKCS5PADDING"] = "AES/ECB/PKCS7PADDING"; + + algorithms[NistObjectIdentifiers.IdAes128Cbc.Id] = "AES/CBC/PKCS7PADDING"; + algorithms[NistObjectIdentifiers.IdAes192Cbc.Id] = "AES/CBC/PKCS7PADDING"; + algorithms[NistObjectIdentifiers.IdAes256Cbc.Id] = "AES/CBC/PKCS7PADDING"; + + algorithms[NistObjectIdentifiers.IdAes128Ofb.Id] = "AES/OFB/NOPADDING"; + algorithms[NistObjectIdentifiers.IdAes192Ofb.Id] = "AES/OFB/NOPADDING"; + algorithms[NistObjectIdentifiers.IdAes256Ofb.Id] = "AES/OFB/NOPADDING"; + + algorithms[NistObjectIdentifiers.IdAes128Cfb.Id] = "AES/CFB/NOPADDING"; + algorithms[NistObjectIdentifiers.IdAes192Cfb.Id] = "AES/CFB/NOPADDING"; + algorithms[NistObjectIdentifiers.IdAes256Cfb.Id] = "AES/CFB/NOPADDING"; + + algorithms["RSA/ECB/PKCS1"] = "RSA//PKCS1PADDING"; + algorithms["RSA/ECB/PKCS1PADDING"] = "RSA//PKCS1PADDING"; + algorithms[PkcsObjectIdentifiers.RsaEncryption.Id] = "RSA//PKCS1PADDING"; + algorithms[PkcsObjectIdentifiers.IdRsaesOaep.Id] = "RSA//OAEPPADDING"; + + algorithms[OiwObjectIdentifiers.DesCbc.Id] = "DES/CBC"; + algorithms[OiwObjectIdentifiers.DesCfb.Id] = "DES/CFB"; + algorithms[OiwObjectIdentifiers.DesEcb.Id] = "DES/ECB"; + algorithms[OiwObjectIdentifiers.DesOfb.Id] = "DES/OFB"; + algorithms[OiwObjectIdentifiers.DesEde.Id] = "DESEDE"; + algorithms["TDEA"] = "DESEDE"; + algorithms[PkcsObjectIdentifiers.DesEde3Cbc.Id] = "DESEDE/CBC"; + algorithms[PkcsObjectIdentifiers.RC2Cbc.Id] = "RC2/CBC"; + algorithms["1.3.6.1.4.1.188.7.1.1.2"] = "IDEA/CBC"; + algorithms["1.2.840.113533.7.66.10"] = "CAST5/CBC"; + + algorithms["RC4"] = "ARC4"; + algorithms["ARCFOUR"] = "ARC4"; + algorithms["1.2.840.113549.3.4"] = "ARC4"; + + + + algorithms["PBEWITHSHA1AND128BITRC4"] = "PBEWITHSHAAND128BITRC4"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd128BitRC4.Id] = "PBEWITHSHAAND128BITRC4"; + algorithms["PBEWITHSHA1AND40BITRC4"] = "PBEWITHSHAAND40BITRC4"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd40BitRC4.Id] = "PBEWITHSHAAND40BITRC4"; + + algorithms["PBEWITHSHA1ANDDES"] = "PBEWITHSHA1ANDDES-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithSha1AndDesCbc.Id] = "PBEWITHSHA1ANDDES-CBC"; + algorithms["PBEWITHSHA1ANDRC2"] = "PBEWITHSHA1ANDRC2-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithSha1AndRC2Cbc.Id] = "PBEWITHSHA1ANDRC2-CBC"; + + algorithms["PBEWITHSHA1AND3-KEYTRIPLEDES-CBC"] = "PBEWITHSHAAND3-KEYTRIPLEDES-CBC"; + algorithms["PBEWITHSHAAND3KEYTRIPLEDES"] = "PBEWITHSHAAND3-KEYTRIPLEDES-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc.Id] = "PBEWITHSHAAND3-KEYTRIPLEDES-CBC"; + algorithms["PBEWITHSHA1ANDDESEDE"] = "PBEWITHSHAAND3-KEYTRIPLEDES-CBC"; + + algorithms["PBEWITHSHA1AND2-KEYTRIPLEDES-CBC"] = "PBEWITHSHAAND2-KEYTRIPLEDES-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd2KeyTripleDesCbc.Id] = "PBEWITHSHAAND2-KEYTRIPLEDES-CBC"; + + algorithms["PBEWITHSHA1AND128BITRC2-CBC"] = "PBEWITHSHAAND128BITRC2-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd128BitRC2Cbc.Id] = "PBEWITHSHAAND128BITRC2-CBC"; + + algorithms["PBEWITHSHA1AND40BITRC2-CBC"] = "PBEWITHSHAAND40BITRC2-CBC"; + algorithms[PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc.Id] = "PBEWITHSHAAND40BITRC2-CBC"; + + algorithms["PBEWITHSHA1AND128BITAES-CBC-BC"] = "PBEWITHSHAAND128BITAES-CBC-BC"; + algorithms["PBEWITHSHA-1AND128BITAES-CBC-BC"] = "PBEWITHSHAAND128BITAES-CBC-BC"; + + algorithms["PBEWITHSHA1AND192BITAES-CBC-BC"] = "PBEWITHSHAAND192BITAES-CBC-BC"; + algorithms["PBEWITHSHA-1AND192BITAES-CBC-BC"] = "PBEWITHSHAAND192BITAES-CBC-BC"; + + algorithms["PBEWITHSHA1AND256BITAES-CBC-BC"] = "PBEWITHSHAAND256BITAES-CBC-BC"; + algorithms["PBEWITHSHA-1AND256BITAES-CBC-BC"] = "PBEWITHSHAAND256BITAES-CBC-BC"; + + algorithms["PBEWITHSHA-256AND128BITAES-CBC-BC"] = "PBEWITHSHA256AND128BITAES-CBC-BC"; + algorithms["PBEWITHSHA-256AND192BITAES-CBC-BC"] = "PBEWITHSHA256AND192BITAES-CBC-BC"; + algorithms["PBEWITHSHA-256AND256BITAES-CBC-BC"] = "PBEWITHSHA256AND256BITAES-CBC-BC"; + + + algorithms["GOST"] = "GOST28147"; + algorithms["GOST-28147"] = "GOST28147"; + algorithms[CryptoProObjectIdentifiers.GostR28147Cbc.Id] = "GOST28147/CBC/PKCS7PADDING"; + + algorithms["RC5-32"] = "RC5"; + + algorithms[NttObjectIdentifiers.IdCamellia128Cbc.Id] = "CAMELLIA/CBC/PKCS7PADDING"; + algorithms[NttObjectIdentifiers.IdCamellia192Cbc.Id] = "CAMELLIA/CBC/PKCS7PADDING"; + algorithms[NttObjectIdentifiers.IdCamellia256Cbc.Id] = "CAMELLIA/CBC/PKCS7PADDING"; + + algorithms[KisaObjectIdentifiers.IdSeedCbc.Id] = "SEED/CBC/PKCS7PADDING"; + + algorithms["1.3.6.1.4.1.3029.1.2"] = "BLOWFISH/CBC"; + } + + private CipherUtilities() + { + } + + /// + /// Returns a ObjectIdentifier for a give encoding. + /// + /// A string representation of the encoding. + /// A DerObjectIdentifier, null if the Oid is not available. + // TODO Don't really want to support this + public static DerObjectIdentifier GetObjectIdentifier( + string mechanism) + { + if (mechanism == null) + throw new ArgumentNullException("mechanism"); + + mechanism = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(mechanism); + string aliased = (string) algorithms[mechanism]; + + if (aliased != null) + mechanism = aliased; + + return (DerObjectIdentifier) oids[mechanism]; + } + + public static ICollection Algorithms + { + get { return oids.Keys; } + } + + public static IBufferedCipher GetCipher( + DerObjectIdentifier oid) + { + return GetCipher(oid.Id); + } + + public static IBufferedCipher GetCipher( + string algorithm) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + + algorithm = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + + { + string aliased = (string) algorithms[algorithm]; + + if (aliased != null) + algorithm = aliased; + } + + IBasicAgreement iesAgreement = null; + if (algorithm == "IES") + { + iesAgreement = new DHBasicAgreement(); + } + else if (algorithm == "ECIES") + { + iesAgreement = new ECDHBasicAgreement(); + } + + if (iesAgreement != null) + { + return new BufferedIesCipher( + new IesEngine( + iesAgreement, + new Kdf2BytesGenerator( + new Sha1Digest()), + new HMac( + new Sha1Digest()))); + } + + + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(algorithm, "PBE")) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(algorithm, "-CBC")) + { + if (algorithm == "PBEWITHSHA1ANDDES-CBC") + { + return new PaddedBufferedBlockCipher( + new CbcBlockCipher(new DesEngine())); + } + else if (algorithm == "PBEWITHSHA1ANDRC2-CBC") + { + return new PaddedBufferedBlockCipher( + new CbcBlockCipher(new RC2Engine())); + } + else if (Strings.IsOneOf(algorithm, + "PBEWITHSHAAND2-KEYTRIPLEDES-CBC", "PBEWITHSHAAND3-KEYTRIPLEDES-CBC")) + { + return new PaddedBufferedBlockCipher( + new CbcBlockCipher(new DesEdeEngine())); + } + else if (Strings.IsOneOf(algorithm, + "PBEWITHSHAAND128BITRC2-CBC", "PBEWITHSHAAND40BITRC2-CBC")) + { + return new PaddedBufferedBlockCipher( + new CbcBlockCipher(new RC2Engine())); + } + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(algorithm, "-BC") || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(algorithm, "-OPENSSL")) + { + if (Strings.IsOneOf(algorithm, + "PBEWITHSHAAND128BITAES-CBC-BC", + "PBEWITHSHAAND192BITAES-CBC-BC", + "PBEWITHSHAAND256BITAES-CBC-BC", + "PBEWITHSHA256AND128BITAES-CBC-BC", + "PBEWITHSHA256AND192BITAES-CBC-BC", + "PBEWITHSHA256AND256BITAES-CBC-BC", + "PBEWITHMD5AND128BITAES-CBC-OPENSSL", + "PBEWITHMD5AND192BITAES-CBC-OPENSSL", + "PBEWITHMD5AND256BITAES-CBC-OPENSSL")) + { + return new PaddedBufferedBlockCipher( + new CbcBlockCipher(new AesEngine())); + } + } + } + + + + string[] parts = algorithm.Split('/'); + + IBlockCipher blockCipher = null; + IAsymmetricBlockCipher asymBlockCipher = null; + IStreamCipher streamCipher = null; + + string algorithmName = parts[0]; + + { + string aliased = (string)algorithms[algorithmName]; + + if (aliased != null) + algorithmName = aliased; + } + + CipherAlgorithm cipherAlgorithm; + try + { + cipherAlgorithm = (CipherAlgorithm)Enums.GetEnumValue(typeof(CipherAlgorithm), algorithmName); + } + catch (ArgumentException) + { + throw new SecurityUtilityException("Cipher " + algorithm + " not recognised."); + } + + switch (cipherAlgorithm) + { + case CipherAlgorithm.AES: + blockCipher = new AesEngine(); + break; + case CipherAlgorithm.ARC4: + streamCipher = new RC4Engine(); + break; + case CipherAlgorithm.BLOWFISH: + blockCipher = new BlowfishEngine(); + break; + case CipherAlgorithm.CAMELLIA: + blockCipher = new CamelliaEngine(); + break; + case CipherAlgorithm.CAST5: + blockCipher = new Cast5Engine(); + break; + case CipherAlgorithm.CAST6: + blockCipher = new Cast6Engine(); + break; + case CipherAlgorithm.DES: + blockCipher = new DesEngine(); + break; + case CipherAlgorithm.DESEDE: + blockCipher = new DesEdeEngine(); + break; + case CipherAlgorithm.ELGAMAL: + asymBlockCipher = new ElGamalEngine(); + break; + case CipherAlgorithm.GOST28147: + blockCipher = new Gost28147Engine(); + break; + case CipherAlgorithm.HC128: + streamCipher = new HC128Engine(); + break; + case CipherAlgorithm.HC256: + streamCipher = new HC256Engine(); + break; + case CipherAlgorithm.IDEA: + blockCipher = new IdeaEngine(); + break; + case CipherAlgorithm.NOEKEON: + blockCipher = new NoekeonEngine(); + break; + case CipherAlgorithm.PBEWITHSHAAND128BITRC4: + case CipherAlgorithm.PBEWITHSHAAND40BITRC4: + streamCipher = new RC4Engine(); + break; + case CipherAlgorithm.RC2: + blockCipher = new RC2Engine(); + break; + case CipherAlgorithm.RC5: + blockCipher = new RC532Engine(); + break; + case CipherAlgorithm.RC5_64: + blockCipher = new RC564Engine(); + break; + case CipherAlgorithm.RC6: + blockCipher = new RC6Engine(); + break; + case CipherAlgorithm.RIJNDAEL: + blockCipher = new RijndaelEngine(); + break; + case CipherAlgorithm.RSA: + asymBlockCipher = new RsaBlindedEngine(); + break; + case CipherAlgorithm.SALSA20: + streamCipher = new Salsa20Engine(); + break; + case CipherAlgorithm.SEED: + blockCipher = new SeedEngine(); + break; + case CipherAlgorithm.SERPENT: + blockCipher = new SerpentEngine(); + break; + case CipherAlgorithm.SKIPJACK: + blockCipher = new SkipjackEngine(); + break; + case CipherAlgorithm.SM4: + blockCipher = new SM4Engine(); + break; + case CipherAlgorithm.TEA: + blockCipher = new TeaEngine(); + break; + case CipherAlgorithm.THREEFISH_256: + blockCipher = new ThreefishEngine(ThreefishEngine.BLOCKSIZE_256); + break; + case CipherAlgorithm.THREEFISH_512: + blockCipher = new ThreefishEngine(ThreefishEngine.BLOCKSIZE_512); + break; + case CipherAlgorithm.THREEFISH_1024: + blockCipher = new ThreefishEngine(ThreefishEngine.BLOCKSIZE_1024); + break; + case CipherAlgorithm.TNEPRES: + blockCipher = new TnepresEngine(); + break; + case CipherAlgorithm.TWOFISH: + blockCipher = new TwofishEngine(); + break; + case CipherAlgorithm.VMPC: + streamCipher = new VmpcEngine(); + break; + case CipherAlgorithm.VMPC_KSA3: + streamCipher = new VmpcKsa3Engine(); + break; + case CipherAlgorithm.XTEA: + blockCipher = new XteaEngine(); + break; + default: + throw new SecurityUtilityException("Cipher " + algorithm + " not recognised."); + } + + if (streamCipher != null) + { + if (parts.Length > 1) + throw new ArgumentException("Modes and paddings not used for stream ciphers"); + + return new BufferedStreamCipher(streamCipher); + } + + + bool cts = false; + bool padded = true; + IBlockCipherPadding padding = null; + IAeadBlockCipher aeadBlockCipher = null; + + if (parts.Length > 2) + { + if (streamCipher != null) + throw new ArgumentException("Paddings not used for stream ciphers"); + + string paddingName = parts[2]; + + CipherPadding cipherPadding; + if (paddingName == "") + { + cipherPadding = CipherPadding.RAW; + } + else if (paddingName == "X9.23PADDING") + { + cipherPadding = CipherPadding.X923PADDING; + } + else + { + try + { + cipherPadding = (CipherPadding)Enums.GetEnumValue(typeof(CipherPadding), paddingName); + } + catch (ArgumentException) + { + throw new SecurityUtilityException("Cipher " + algorithm + " not recognised."); + } + } + + switch (cipherPadding) + { + case CipherPadding.NOPADDING: + padded = false; + break; + case CipherPadding.RAW: + break; + case CipherPadding.ISO10126PADDING: + case CipherPadding.ISO10126D2PADDING: + case CipherPadding.ISO10126_2PADDING: + padding = new ISO10126d2Padding(); + break; + case CipherPadding.ISO7816_4PADDING: + case CipherPadding.ISO9797_1PADDING: + padding = new ISO7816d4Padding(); + break; + case CipherPadding.ISO9796_1: + case CipherPadding.ISO9796_1PADDING: + asymBlockCipher = new ISO9796d1Encoding(asymBlockCipher); + break; + case CipherPadding.OAEP: + case CipherPadding.OAEPPADDING: + asymBlockCipher = new OaepEncoding(asymBlockCipher); + break; + case CipherPadding.OAEPWITHMD5ANDMGF1PADDING: + asymBlockCipher = new OaepEncoding(asymBlockCipher, new MD5Digest()); + break; + case CipherPadding.OAEPWITHSHA1ANDMGF1PADDING: + case CipherPadding.OAEPWITHSHA_1ANDMGF1PADDING: + asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha1Digest()); + break; + case CipherPadding.OAEPWITHSHA224ANDMGF1PADDING: + case CipherPadding.OAEPWITHSHA_224ANDMGF1PADDING: + asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha224Digest()); + break; + case CipherPadding.OAEPWITHSHA256ANDMGF1PADDING: + case CipherPadding.OAEPWITHSHA_256ANDMGF1PADDING: + asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha256Digest()); + break; + case CipherPadding.OAEPWITHSHA384ANDMGF1PADDING: + case CipherPadding.OAEPWITHSHA_384ANDMGF1PADDING: + asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha384Digest()); + break; + case CipherPadding.OAEPWITHSHA512ANDMGF1PADDING: + case CipherPadding.OAEPWITHSHA_512ANDMGF1PADDING: + asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha512Digest()); + break; + case CipherPadding.PKCS1: + case CipherPadding.PKCS1PADDING: + asymBlockCipher = new Pkcs1Encoding(asymBlockCipher); + break; + case CipherPadding.PKCS5: + case CipherPadding.PKCS5PADDING: + case CipherPadding.PKCS7: + case CipherPadding.PKCS7PADDING: + padding = new Pkcs7Padding(); + break; + case CipherPadding.TBCPADDING: + padding = new TbcPadding(); + break; + case CipherPadding.WITHCTS: + cts = true; + break; + case CipherPadding.X923PADDING: + padding = new X923Padding(); + break; + case CipherPadding.ZEROBYTEPADDING: + padding = new ZeroBytePadding(); + break; + default: + throw new SecurityUtilityException("Cipher " + algorithm + " not recognised."); + } + } + + string mode = ""; + if (parts.Length > 1) + { + mode = parts[1]; + + int di = GetDigitIndex(mode); + string modeName = di >= 0 ? mode.Substring(0, di) : mode; + + try + { + CipherMode cipherMode = modeName == "" + ? CipherMode.NONE + : (CipherMode)Enums.GetEnumValue(typeof(CipherMode), modeName); + + switch (cipherMode) + { + case CipherMode.ECB: + case CipherMode.NONE: + break; + case CipherMode.CBC: + blockCipher = new CbcBlockCipher(blockCipher); + break; + case CipherMode.CCM: + aeadBlockCipher = new CcmBlockCipher(blockCipher); + break; + case CipherMode.CFB: + { + int bits = (di < 0) + ? 8 * blockCipher.GetBlockSize() + : int.Parse(mode.Substring(di)); + + blockCipher = new CfbBlockCipher(blockCipher, bits); + break; + } + case CipherMode.CTR: + blockCipher = new SicBlockCipher(blockCipher); + break; + case CipherMode.CTS: + cts = true; + blockCipher = new CbcBlockCipher(blockCipher); + break; + case CipherMode.EAX: + aeadBlockCipher = new EaxBlockCipher(blockCipher); + break; + case CipherMode.GCM: + aeadBlockCipher = new GcmBlockCipher(blockCipher); + break; + case CipherMode.GOFB: + blockCipher = new GOfbBlockCipher(blockCipher); + break; + case CipherMode.OCB: + aeadBlockCipher = new OcbBlockCipher(blockCipher, CreateBlockCipher(cipherAlgorithm)); + break; + case CipherMode.OFB: + { + int bits = (di < 0) + ? 8 * blockCipher.GetBlockSize() + : int.Parse(mode.Substring(di)); + + blockCipher = new OfbBlockCipher(blockCipher, bits); + break; + } + case CipherMode.OPENPGPCFB: + blockCipher = new OpenPgpCfbBlockCipher(blockCipher); + break; + case CipherMode.SIC: + if (blockCipher.GetBlockSize() < 16) + { + throw new ArgumentException("Warning: SIC-Mode can become a twotime-pad if the blocksize of the cipher is too small. Use a cipher with a block size of at least 128 bits (e.g. AES)"); + } + blockCipher = new SicBlockCipher(blockCipher); + break; + default: + throw new SecurityUtilityException("Cipher " + algorithm + " not recognised."); + } + } + catch (ArgumentException) + { + throw new SecurityUtilityException("Cipher " + algorithm + " not recognised."); + } + } + + if (aeadBlockCipher != null) + { + if (cts) + throw new SecurityUtilityException("CTS mode not valid for AEAD ciphers."); + if (padded && parts.Length > 2 && parts[2] != "") + throw new SecurityUtilityException("Bad padding specified for AEAD cipher."); + + return new BufferedAeadBlockCipher(aeadBlockCipher); + } + + if (blockCipher != null) + { + if (cts) + { + return new CtsBlockCipher(blockCipher); + } + + if (padding != null) + { + return new PaddedBufferedBlockCipher(blockCipher, padding); + } + + if (!padded || blockCipher.IsPartialBlockOkay) + { + return new BufferedBlockCipher(blockCipher); + } + + return new PaddedBufferedBlockCipher(blockCipher); + } + + if (asymBlockCipher != null) + { + return new BufferedAsymmetricBlockCipher(asymBlockCipher); + } + + throw new SecurityUtilityException("Cipher " + algorithm + " not recognised."); + } + + public static string GetAlgorithmName( + DerObjectIdentifier oid) + { + return (string) algorithms[oid.Id]; + } + + private static int GetDigitIndex( + string s) + { + for (int i = 0; i < s.Length; ++i) + { + if (char.IsDigit(s[i])) + return i; + } + + return -1; + } + + private static IBlockCipher CreateBlockCipher(CipherAlgorithm cipherAlgorithm) + { + switch (cipherAlgorithm) + { + case CipherAlgorithm.AES: return new AesEngine(); + case CipherAlgorithm.BLOWFISH: return new BlowfishEngine(); + case CipherAlgorithm.CAMELLIA: return new CamelliaEngine(); + case CipherAlgorithm.CAST5: return new Cast5Engine(); + case CipherAlgorithm.CAST6: return new Cast6Engine(); + case CipherAlgorithm.DES: return new DesEngine(); + case CipherAlgorithm.DESEDE: return new DesEdeEngine(); + case CipherAlgorithm.GOST28147: return new Gost28147Engine(); + case CipherAlgorithm.IDEA: return new IdeaEngine(); + case CipherAlgorithm.NOEKEON: return new NoekeonEngine(); + case CipherAlgorithm.RC2: return new RC2Engine(); + case CipherAlgorithm.RC5: return new RC532Engine(); + case CipherAlgorithm.RC5_64: return new RC564Engine(); + case CipherAlgorithm.RC6: return new RC6Engine(); + case CipherAlgorithm.RIJNDAEL: return new RijndaelEngine(); + case CipherAlgorithm.SEED: return new SeedEngine(); + case CipherAlgorithm.SERPENT: return new SerpentEngine(); + case CipherAlgorithm.SKIPJACK: return new SkipjackEngine(); + case CipherAlgorithm.SM4: return new SM4Engine(); + case CipherAlgorithm.TEA: return new TeaEngine(); + case CipherAlgorithm.THREEFISH_256: return new ThreefishEngine(ThreefishEngine.BLOCKSIZE_256); + case CipherAlgorithm.THREEFISH_512: return new ThreefishEngine(ThreefishEngine.BLOCKSIZE_512); + case CipherAlgorithm.THREEFISH_1024: return new ThreefishEngine(ThreefishEngine.BLOCKSIZE_1024); + case CipherAlgorithm.TNEPRES: return new TnepresEngine(); + case CipherAlgorithm.TWOFISH: return new TwofishEngine(); + case CipherAlgorithm.XTEA: return new XteaEngine(); + default: + throw new SecurityUtilityException("Cipher " + cipherAlgorithm + " not recognised or not a block cipher"); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/CipherUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/CipherUtilities.cs.meta new file mode 100644 index 00000000..8c41f894 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/CipherUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3576aacdad56d6a45a71b7f377ae1fcc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DigestUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DigestUtilities.cs new file mode 100644 index 00000000..17496326 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DigestUtilities.cs @@ -0,0 +1,289 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.UA; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + /// + /// Utility class for creating IDigest objects from their names/Oids + /// + public sealed class DigestUtilities + { + private enum DigestAlgorithm { + BLAKE2B_160, BLAKE2B_256, BLAKE2B_384, BLAKE2B_512, + BLAKE2S_128, BLAKE2S_160, BLAKE2S_224, BLAKE2S_256, + DSTU7564_256, DSTU7564_384, DSTU7564_512, + GOST3411, + GOST3411_2012_256, GOST3411_2012_512, + KECCAK_224, KECCAK_256, KECCAK_288, KECCAK_384, KECCAK_512, + MD2, MD4, MD5, + NONE, + RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD320, + SHA_1, SHA_224, SHA_256, SHA_384, SHA_512, + SHA_512_224, SHA_512_256, + SHA3_224, SHA3_256, SHA3_384, SHA3_512, + SHAKE128, SHAKE256, + SM3, + TIGER, + WHIRLPOOL, + }; + + private DigestUtilities() + { + } + + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static DigestUtilities() + { + // Signal to obfuscation tools not to change enum constants + ((DigestAlgorithm)Enums.GetArbitraryValue(typeof(DigestAlgorithm))).ToString(); + + algorithms[PkcsObjectIdentifiers.MD2.Id] = "MD2"; + algorithms[PkcsObjectIdentifiers.MD4.Id] = "MD4"; + algorithms[PkcsObjectIdentifiers.MD5.Id] = "MD5"; + + algorithms["SHA1"] = "SHA-1"; + algorithms[OiwObjectIdentifiers.IdSha1.Id] = "SHA-1"; + algorithms["SHA224"] = "SHA-224"; + algorithms[NistObjectIdentifiers.IdSha224.Id] = "SHA-224"; + algorithms["SHA256"] = "SHA-256"; + algorithms[NistObjectIdentifiers.IdSha256.Id] = "SHA-256"; + algorithms["SHA384"] = "SHA-384"; + algorithms[NistObjectIdentifiers.IdSha384.Id] = "SHA-384"; + algorithms["SHA512"] = "SHA-512"; + algorithms[NistObjectIdentifiers.IdSha512.Id] = "SHA-512"; + algorithms["SHA512/224"] = "SHA-512/224"; + algorithms[NistObjectIdentifiers.IdSha512_224.Id] = "SHA-512/224"; + algorithms["SHA512/256"] = "SHA-512/256"; + algorithms[NistObjectIdentifiers.IdSha512_256.Id] = "SHA-512/256"; + + algorithms["RIPEMD-128"] = "RIPEMD128"; + algorithms[TeleTrusTObjectIdentifiers.RipeMD128.Id] = "RIPEMD128"; + algorithms["RIPEMD-160"] = "RIPEMD160"; + algorithms[TeleTrusTObjectIdentifiers.RipeMD160.Id] = "RIPEMD160"; + algorithms["RIPEMD-256"] = "RIPEMD256"; + algorithms[TeleTrusTObjectIdentifiers.RipeMD256.Id] = "RIPEMD256"; + algorithms["RIPEMD-320"] = "RIPEMD320"; +// algorithms[TeleTrusTObjectIdentifiers.RipeMD320.Id] = "RIPEMD320"; + + algorithms[CryptoProObjectIdentifiers.GostR3411.Id] = "GOST3411"; + + algorithms["KECCAK224"] = "KECCAK-224"; + algorithms["KECCAK256"] = "KECCAK-256"; + algorithms["KECCAK288"] = "KECCAK-288"; + algorithms["KECCAK384"] = "KECCAK-384"; + algorithms["KECCAK512"] = "KECCAK-512"; + + algorithms[NistObjectIdentifiers.IdSha3_224.Id] = "SHA3-224"; + algorithms[NistObjectIdentifiers.IdSha3_256.Id] = "SHA3-256"; + algorithms[NistObjectIdentifiers.IdSha3_384.Id] = "SHA3-384"; + algorithms[NistObjectIdentifiers.IdSha3_512.Id] = "SHA3-512"; + algorithms[NistObjectIdentifiers.IdShake128.Id] = "SHAKE128"; + algorithms[NistObjectIdentifiers.IdShake256.Id] = "SHAKE256"; + + algorithms[GMObjectIdentifiers.sm3.Id] = "SM3"; + + algorithms[MiscObjectIdentifiers.id_blake2b160.Id] = "BLAKE2B-160"; + algorithms[MiscObjectIdentifiers.id_blake2b256.Id] = "BLAKE2B-256"; + algorithms[MiscObjectIdentifiers.id_blake2b384.Id] = "BLAKE2B-384"; + algorithms[MiscObjectIdentifiers.id_blake2b512.Id] = "BLAKE2B-512"; + algorithms[MiscObjectIdentifiers.id_blake2s128.Id] = "BLAKE2S-128"; + algorithms[MiscObjectIdentifiers.id_blake2s160.Id] = "BLAKE2S-160"; + algorithms[MiscObjectIdentifiers.id_blake2s224.Id] = "BLAKE2S-224"; + algorithms[MiscObjectIdentifiers.id_blake2s256.Id] = "BLAKE2S-256"; + + algorithms[RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256.Id] = "GOST3411-2012-256"; + algorithms[RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512.Id] = "GOST3411-2012-512"; + + algorithms[UAObjectIdentifiers.dstu7564digest_256.Id] = "DSTU7564-256"; + algorithms[UAObjectIdentifiers.dstu7564digest_384.Id] = "DSTU7564-384"; + algorithms[UAObjectIdentifiers.dstu7564digest_512.Id] = "DSTU7564-512"; + + oids["MD2"] = PkcsObjectIdentifiers.MD2; + oids["MD4"] = PkcsObjectIdentifiers.MD4; + oids["MD5"] = PkcsObjectIdentifiers.MD5; + oids["SHA-1"] = OiwObjectIdentifiers.IdSha1; + oids["SHA-224"] = NistObjectIdentifiers.IdSha224; + oids["SHA-256"] = NistObjectIdentifiers.IdSha256; + oids["SHA-384"] = NistObjectIdentifiers.IdSha384; + oids["SHA-512"] = NistObjectIdentifiers.IdSha512; + oids["SHA-512/224"] = NistObjectIdentifiers.IdSha512_224; + oids["SHA-512/256"] = NistObjectIdentifiers.IdSha512_256; + oids["SHA3-224"] = NistObjectIdentifiers.IdSha3_224; + oids["SHA3-256"] = NistObjectIdentifiers.IdSha3_256; + oids["SHA3-384"] = NistObjectIdentifiers.IdSha3_384; + oids["SHA3-512"] = NistObjectIdentifiers.IdSha3_512; + oids["SHAKE128"] = NistObjectIdentifiers.IdShake128; + oids["SHAKE256"] = NistObjectIdentifiers.IdShake256; + oids["RIPEMD128"] = TeleTrusTObjectIdentifiers.RipeMD128; + oids["RIPEMD160"] = TeleTrusTObjectIdentifiers.RipeMD160; + oids["RIPEMD256"] = TeleTrusTObjectIdentifiers.RipeMD256; + oids["GOST3411"] = CryptoProObjectIdentifiers.GostR3411; + oids["SM3"] = GMObjectIdentifiers.sm3; + oids["BLAKE2B-160"] = MiscObjectIdentifiers.id_blake2b160; + oids["BLAKE2B-256"] = MiscObjectIdentifiers.id_blake2b256; + oids["BLAKE2B-384"] = MiscObjectIdentifiers.id_blake2b384; + oids["BLAKE2B-512"] = MiscObjectIdentifiers.id_blake2b512; + oids["BLAKE2S-128"] = MiscObjectIdentifiers.id_blake2s128; + oids["BLAKE2S-160"] = MiscObjectIdentifiers.id_blake2s160; + oids["BLAKE2S-224"] = MiscObjectIdentifiers.id_blake2s224; + oids["BLAKE2S-256"] = MiscObjectIdentifiers.id_blake2s256; + oids["GOST3411-2012-256"] = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256; + oids["GOST3411-2012-512"] = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512; + oids["DSTU7564-256"] = UAObjectIdentifiers.dstu7564digest_256; + oids["DSTU7564-384"] = UAObjectIdentifiers.dstu7564digest_384; + oids["DSTU7564-512"] = UAObjectIdentifiers.dstu7564digest_512; + } + + /// + /// Returns a ObjectIdentifier for a given digest mechanism. + /// + /// A string representation of the digest meanism. + /// A DerObjectIdentifier, null if the Oid is not available. + + public static DerObjectIdentifier GetObjectIdentifier( + string mechanism) + { + if (mechanism == null) + throw new System.ArgumentNullException("mechanism"); + + mechanism = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(mechanism); + string aliased = (string) algorithms[mechanism]; + + if (aliased != null) + mechanism = aliased; + + return (DerObjectIdentifier) oids[mechanism]; + } + + public static ICollection Algorithms + { + get { return oids.Keys; } + } + + public static IDigest GetDigest( + DerObjectIdentifier id) + { + return GetDigest(id.Id); + } + + public static IDigest GetDigest( + string algorithm) + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + string mechanism = (string) algorithms[upper]; + + if (mechanism == null) + { + mechanism = upper; + } + + try + { + DigestAlgorithm digestAlgorithm = (DigestAlgorithm)Enums.GetEnumValue( + typeof(DigestAlgorithm), mechanism); + + switch (digestAlgorithm) + { + case DigestAlgorithm.BLAKE2B_160: return new Blake2bDigest(160); + case DigestAlgorithm.BLAKE2B_256: return new Blake2bDigest(256); + case DigestAlgorithm.BLAKE2B_384: return new Blake2bDigest(384); + case DigestAlgorithm.BLAKE2B_512: return new Blake2bDigest(512); + case DigestAlgorithm.BLAKE2S_128: return new Blake2sDigest(128); + case DigestAlgorithm.BLAKE2S_160: return new Blake2sDigest(160); + case DigestAlgorithm.BLAKE2S_224: return new Blake2sDigest(224); + case DigestAlgorithm.BLAKE2S_256: return new Blake2sDigest(256); + case DigestAlgorithm.DSTU7564_256: return new Dstu7564Digest(256); + case DigestAlgorithm.DSTU7564_384: return new Dstu7564Digest(384); + case DigestAlgorithm.DSTU7564_512: return new Dstu7564Digest(512); + case DigestAlgorithm.GOST3411: return new Gost3411Digest(); + case DigestAlgorithm.GOST3411_2012_256: return new GOST3411_2012_256Digest(); + case DigestAlgorithm.GOST3411_2012_512: return new GOST3411_2012_512Digest(); + case DigestAlgorithm.KECCAK_224: return new KeccakDigest(224); + case DigestAlgorithm.KECCAK_256: return new KeccakDigest(256); + case DigestAlgorithm.KECCAK_288: return new KeccakDigest(288); + case DigestAlgorithm.KECCAK_384: return new KeccakDigest(384); + case DigestAlgorithm.KECCAK_512: return new KeccakDigest(512); + case DigestAlgorithm.MD2: return new MD2Digest(); + case DigestAlgorithm.MD4: return new MD4Digest(); + case DigestAlgorithm.MD5: return new MD5Digest(); + case DigestAlgorithm.NONE: return new NullDigest(); + case DigestAlgorithm.RIPEMD128: return new RipeMD128Digest(); + case DigestAlgorithm.RIPEMD160: return new RipeMD160Digest(); + case DigestAlgorithm.RIPEMD256: return new RipeMD256Digest(); + case DigestAlgorithm.RIPEMD320: return new RipeMD320Digest(); + case DigestAlgorithm.SHA_1: return new Sha1Digest(); + case DigestAlgorithm.SHA_224: return new Sha224Digest(); + case DigestAlgorithm.SHA_256: return new Sha256Digest(); + case DigestAlgorithm.SHA_384: return new Sha384Digest(); + case DigestAlgorithm.SHA_512: return new Sha512Digest(); + case DigestAlgorithm.SHA_512_224: return new Sha512tDigest(224); + case DigestAlgorithm.SHA_512_256: return new Sha512tDigest(256); + case DigestAlgorithm.SHA3_224: return new Sha3Digest(224); + case DigestAlgorithm.SHA3_256: return new Sha3Digest(256); + case DigestAlgorithm.SHA3_384: return new Sha3Digest(384); + case DigestAlgorithm.SHA3_512: return new Sha3Digest(512); + case DigestAlgorithm.SHAKE128: return new ShakeDigest(128); + case DigestAlgorithm.SHAKE256: return new ShakeDigest(256); + case DigestAlgorithm.SM3: return new SM3Digest(); + case DigestAlgorithm.TIGER: return new TigerDigest(); + case DigestAlgorithm.WHIRLPOOL: return new WhirlpoolDigest(); + } + } + catch (ArgumentException) + { + } + + throw new SecurityUtilityException("Digest " + mechanism + " not recognised."); + } + + public static string GetAlgorithmName( + DerObjectIdentifier oid) + { + return (string) algorithms[oid.Id]; + } + + public static byte[] CalculateDigest(string algorithm, byte[] input) + { + IDigest digest = GetDigest(algorithm); + digest.BlockUpdate(input, 0, input.Length); + return DoFinal(digest); + } + + public static byte[] DoFinal( + IDigest digest) + { + byte[] b = new byte[digest.GetDigestSize()]; + digest.DoFinal(b, 0); + return b; + } + + public static byte[] DoFinal( + IDigest digest, + byte[] input) + { + digest.BlockUpdate(input, 0, input.Length); + return DoFinal(digest); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DigestUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DigestUtilities.cs.meta new file mode 100644 index 00000000..cb014f72 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DigestUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e02cda66c755ac94ea2ee882e29a2dfe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DotNetUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DotNetUtilities.cs new file mode 100644 index 00000000..c0620d08 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DotNetUtilities.cs @@ -0,0 +1,264 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if !(NETCF_1_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + +using System; +using System.Security.Cryptography; +using SystemX509 = System.Security.Cryptography.X509Certificates; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + /// + /// A class containing methods to interface the BouncyCastle world to the .NET Crypto world. + /// + public sealed class DotNetUtilities + { + private DotNetUtilities() + { + } + + /// + /// Create an System.Security.Cryptography.X509Certificate from an X509Certificate Structure. + /// + /// + /// A System.Security.Cryptography.X509Certificate. + public static SystemX509.X509Certificate ToX509Certificate( + X509CertificateStructure x509Struct) + { + return new SystemX509.X509Certificate(x509Struct.GetDerEncoded()); + } + + public static SystemX509.X509Certificate ToX509Certificate( + X509Certificate x509Cert) + { + return new SystemX509.X509Certificate(x509Cert.GetEncoded()); + } + + public static X509Certificate FromX509Certificate( + SystemX509.X509Certificate x509Cert) + { + return new X509CertificateParser().ReadCertificate(x509Cert.GetRawCertData()); + } + + public static AsymmetricCipherKeyPair GetDsaKeyPair(DSA dsa) + { + return GetDsaKeyPair(dsa.ExportParameters(true)); + } + + public static AsymmetricCipherKeyPair GetDsaKeyPair(DSAParameters dp) + { + DsaValidationParameters validationParameters = (dp.Seed != null) + ? new DsaValidationParameters(dp.Seed, dp.Counter) + : null; + + DsaParameters parameters = new DsaParameters( + new BigInteger(1, dp.P), + new BigInteger(1, dp.Q), + new BigInteger(1, dp.G), + validationParameters); + + DsaPublicKeyParameters pubKey = new DsaPublicKeyParameters( + new BigInteger(1, dp.Y), + parameters); + + DsaPrivateKeyParameters privKey = new DsaPrivateKeyParameters( + new BigInteger(1, dp.X), + parameters); + + return new AsymmetricCipherKeyPair(pubKey, privKey); + } + + public static DsaPublicKeyParameters GetDsaPublicKey(DSA dsa) + { + return GetDsaPublicKey(dsa.ExportParameters(false)); + } + + public static DsaPublicKeyParameters GetDsaPublicKey(DSAParameters dp) + { + DsaValidationParameters validationParameters = (dp.Seed != null) + ? new DsaValidationParameters(dp.Seed, dp.Counter) + : null; + + DsaParameters parameters = new DsaParameters( + new BigInteger(1, dp.P), + new BigInteger(1, dp.Q), + new BigInteger(1, dp.G), + validationParameters); + + return new DsaPublicKeyParameters( + new BigInteger(1, dp.Y), + parameters); + } + + public static AsymmetricCipherKeyPair GetRsaKeyPair(RSA rsa) + { + return GetRsaKeyPair(rsa.ExportParameters(true)); + } + + public static AsymmetricCipherKeyPair GetRsaKeyPair(RSAParameters rp) + { + BigInteger modulus = new BigInteger(1, rp.Modulus); + BigInteger pubExp = new BigInteger(1, rp.Exponent); + + RsaKeyParameters pubKey = new RsaKeyParameters( + false, + modulus, + pubExp); + + RsaPrivateCrtKeyParameters privKey = new RsaPrivateCrtKeyParameters( + modulus, + pubExp, + new BigInteger(1, rp.D), + new BigInteger(1, rp.P), + new BigInteger(1, rp.Q), + new BigInteger(1, rp.DP), + new BigInteger(1, rp.DQ), + new BigInteger(1, rp.InverseQ)); + + return new AsymmetricCipherKeyPair(pubKey, privKey); + } + + public static RsaKeyParameters GetRsaPublicKey(RSA rsa) + { + return GetRsaPublicKey(rsa.ExportParameters(false)); + } + + public static RsaKeyParameters GetRsaPublicKey( + RSAParameters rp) + { + return new RsaKeyParameters( + false, + new BigInteger(1, rp.Modulus), + new BigInteger(1, rp.Exponent)); + } + + public static AsymmetricCipherKeyPair GetKeyPair(AsymmetricAlgorithm privateKey) + { + if (privateKey is DSA) + { + return GetDsaKeyPair((DSA)privateKey); + } + + if (privateKey is RSA) + { + return GetRsaKeyPair((RSA)privateKey); + } + + throw new ArgumentException("Unsupported algorithm specified", "privateKey"); + } + + public static RSA ToRSA(RsaKeyParameters rsaKey) + { + // TODO This appears to not work for private keys (when no CRT info) + return CreateRSAProvider(ToRSAParameters(rsaKey)); + } + + public static RSA ToRSA(RsaKeyParameters rsaKey, CspParameters csp) + { + // TODO This appears to not work for private keys (when no CRT info) + return CreateRSAProvider(ToRSAParameters(rsaKey), csp); + } + + public static RSA ToRSA(RsaPrivateCrtKeyParameters privKey) + { + return CreateRSAProvider(ToRSAParameters(privKey)); + } + + public static RSA ToRSA(RsaPrivateCrtKeyParameters privKey, CspParameters csp) + { + return CreateRSAProvider(ToRSAParameters(privKey), csp); + } + + public static RSA ToRSA(RsaPrivateKeyStructure privKey) + { + return CreateRSAProvider(ToRSAParameters(privKey)); + } + + public static RSA ToRSA(RsaPrivateKeyStructure privKey, CspParameters csp) + { + return CreateRSAProvider(ToRSAParameters(privKey), csp); + } + + public static RSAParameters ToRSAParameters(RsaKeyParameters rsaKey) + { + RSAParameters rp = new RSAParameters(); + rp.Modulus = rsaKey.Modulus.ToByteArrayUnsigned(); + if (rsaKey.IsPrivate) + rp.D = ConvertRSAParametersField(rsaKey.Exponent, rp.Modulus.Length); + else + rp.Exponent = rsaKey.Exponent.ToByteArrayUnsigned(); + return rp; + } + + public static RSAParameters ToRSAParameters(RsaPrivateCrtKeyParameters privKey) + { + RSAParameters rp = new RSAParameters(); + rp.Modulus = privKey.Modulus.ToByteArrayUnsigned(); + rp.Exponent = privKey.PublicExponent.ToByteArrayUnsigned(); + rp.P = privKey.P.ToByteArrayUnsigned(); + rp.Q = privKey.Q.ToByteArrayUnsigned(); + rp.D = ConvertRSAParametersField(privKey.Exponent, rp.Modulus.Length); + rp.DP = ConvertRSAParametersField(privKey.DP, rp.P.Length); + rp.DQ = ConvertRSAParametersField(privKey.DQ, rp.Q.Length); + rp.InverseQ = ConvertRSAParametersField(privKey.QInv, rp.Q.Length); + return rp; + } + + public static RSAParameters ToRSAParameters(RsaPrivateKeyStructure privKey) + { + RSAParameters rp = new RSAParameters(); + rp.Modulus = privKey.Modulus.ToByteArrayUnsigned(); + rp.Exponent = privKey.PublicExponent.ToByteArrayUnsigned(); + rp.P = privKey.Prime1.ToByteArrayUnsigned(); + rp.Q = privKey.Prime2.ToByteArrayUnsigned(); + rp.D = ConvertRSAParametersField(privKey.PrivateExponent, rp.Modulus.Length); + rp.DP = ConvertRSAParametersField(privKey.Exponent1, rp.P.Length); + rp.DQ = ConvertRSAParametersField(privKey.Exponent2, rp.Q.Length); + rp.InverseQ = ConvertRSAParametersField(privKey.Coefficient, rp.Q.Length); + return rp; + } + + // TODO Move functionality to more general class + private static byte[] ConvertRSAParametersField(BigInteger n, int size) + { + byte[] bs = n.ToByteArrayUnsigned(); + + if (bs.Length == size) + return bs; + + if (bs.Length > size) + throw new ArgumentException("Specified size too small", "size"); + + byte[] padded = new byte[size]; + Array.Copy(bs, 0, padded, size - bs.Length, bs.Length); + return padded; + } + + private static RSA CreateRSAProvider(RSAParameters rp) + { + CspParameters csp = new CspParameters(); + csp.KeyContainerName = string.Format("BouncyCastle-{0}", Guid.NewGuid()); + RSACryptoServiceProvider rsaCsp = new RSACryptoServiceProvider(csp); + rsaCsp.ImportParameters(rp); + return rsaCsp; + } + + private static RSA CreateRSAProvider(RSAParameters rp, CspParameters csp) + { + RSACryptoServiceProvider rsaCsp = new RSACryptoServiceProvider(csp); + rsaCsp.ImportParameters(rp); + return rsaCsp; + } + } +} + +#endif +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DotNetUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DotNetUtilities.cs.meta new file mode 100644 index 00000000..f376fde4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/DotNetUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d8495888a65d924dac5d55806d57007 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneralSecurityException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneralSecurityException.cs new file mode 100644 index 00000000..ec37dc70 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneralSecurityException.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class GeneralSecurityException + : Exception + { + public GeneralSecurityException() + : base() + { + } + + public GeneralSecurityException( + string message) + : base(message) + { + } + + public GeneralSecurityException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneralSecurityException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneralSecurityException.cs.meta new file mode 100644 index 00000000..47ce6133 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneralSecurityException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0d8c41189aa7a947b6acbdfbd4f0401 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneratorUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneratorUtilities.cs new file mode 100644 index 00000000..09b9903e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneratorUtilities.cs @@ -0,0 +1,394 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.EdEC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Iana; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Kisa; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ntt; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + public sealed class GeneratorUtilities + { + private GeneratorUtilities() + { + } + + private static readonly IDictionary kgAlgorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary kpgAlgorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary defaultKeySizes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static GeneratorUtilities() + { + // + // key generators. + // + AddKgAlgorithm("AES", + "AESWRAP"); + AddKgAlgorithm("AES128", + "2.16.840.1.101.3.4.2", + NistObjectIdentifiers.IdAes128Cbc, + NistObjectIdentifiers.IdAes128Cfb, + NistObjectIdentifiers.IdAes128Ecb, + NistObjectIdentifiers.IdAes128Ofb, + NistObjectIdentifiers.IdAes128Wrap); + AddKgAlgorithm("AES192", + "2.16.840.1.101.3.4.22", + NistObjectIdentifiers.IdAes192Cbc, + NistObjectIdentifiers.IdAes192Cfb, + NistObjectIdentifiers.IdAes192Ecb, + NistObjectIdentifiers.IdAes192Ofb, + NistObjectIdentifiers.IdAes192Wrap); + AddKgAlgorithm("AES256", + "2.16.840.1.101.3.4.42", + NistObjectIdentifiers.IdAes256Cbc, + NistObjectIdentifiers.IdAes256Cfb, + NistObjectIdentifiers.IdAes256Ecb, + NistObjectIdentifiers.IdAes256Ofb, + NistObjectIdentifiers.IdAes256Wrap); + AddKgAlgorithm("BLOWFISH", + "1.3.6.1.4.1.3029.1.2"); + AddKgAlgorithm("CAMELLIA", + "CAMELLIAWRAP"); + AddKgAlgorithm("CAMELLIA128", + NttObjectIdentifiers.IdCamellia128Cbc, + NttObjectIdentifiers.IdCamellia128Wrap); + AddKgAlgorithm("CAMELLIA192", + NttObjectIdentifiers.IdCamellia192Cbc, + NttObjectIdentifiers.IdCamellia192Wrap); + AddKgAlgorithm("CAMELLIA256", + NttObjectIdentifiers.IdCamellia256Cbc, + NttObjectIdentifiers.IdCamellia256Wrap); + AddKgAlgorithm("CAST5", + "1.2.840.113533.7.66.10"); + AddKgAlgorithm("CAST6"); + AddKgAlgorithm("DES", + OiwObjectIdentifiers.DesCbc, + OiwObjectIdentifiers.DesCfb, + OiwObjectIdentifiers.DesEcb, + OiwObjectIdentifiers.DesOfb); + AddKgAlgorithm("DESEDE", + "DESEDEWRAP", + "TDEA", + OiwObjectIdentifiers.DesEde); + AddKgAlgorithm("DESEDE3", + PkcsObjectIdentifiers.DesEde3Cbc, + PkcsObjectIdentifiers.IdAlgCms3DesWrap); + AddKgAlgorithm("GOST28147", + "GOST", + "GOST-28147", + CryptoProObjectIdentifiers.GostR28147Cbc); + AddKgAlgorithm("HC128"); + AddKgAlgorithm("HC256"); + AddKgAlgorithm("IDEA", + "1.3.6.1.4.1.188.7.1.1.2"); + AddKgAlgorithm("NOEKEON"); + AddKgAlgorithm("RC2", + PkcsObjectIdentifiers.RC2Cbc, + PkcsObjectIdentifiers.IdAlgCmsRC2Wrap); + AddKgAlgorithm("RC4", + "ARC4", + "1.2.840.113549.3.4"); + AddKgAlgorithm("RC5", + "RC5-32"); + AddKgAlgorithm("RC5-64"); + AddKgAlgorithm("RC6"); + AddKgAlgorithm("RIJNDAEL"); + AddKgAlgorithm("SALSA20"); + AddKgAlgorithm("SEED", + KisaObjectIdentifiers.IdNpkiAppCmsSeedWrap, + KisaObjectIdentifiers.IdSeedCbc); + AddKgAlgorithm("SERPENT"); + AddKgAlgorithm("SKIPJACK"); + AddKgAlgorithm("SM4"); + AddKgAlgorithm("TEA"); + AddKgAlgorithm("THREEFISH-256"); + AddKgAlgorithm("THREEFISH-512"); + AddKgAlgorithm("THREEFISH-1024"); + AddKgAlgorithm("TNEPRES"); + AddKgAlgorithm("TWOFISH"); + AddKgAlgorithm("VMPC"); + AddKgAlgorithm("VMPC-KSA3"); + AddKgAlgorithm("XTEA"); + + // + // HMac key generators + // + AddHMacKeyGenerator("MD2"); + AddHMacKeyGenerator("MD4"); + AddHMacKeyGenerator("MD5", + IanaObjectIdentifiers.HmacMD5); + AddHMacKeyGenerator("SHA1", + PkcsObjectIdentifiers.IdHmacWithSha1, + IanaObjectIdentifiers.HmacSha1); + AddHMacKeyGenerator("SHA224", + PkcsObjectIdentifiers.IdHmacWithSha224); + AddHMacKeyGenerator("SHA256", + PkcsObjectIdentifiers.IdHmacWithSha256); + AddHMacKeyGenerator("SHA384", + PkcsObjectIdentifiers.IdHmacWithSha384); + AddHMacKeyGenerator("SHA512", + PkcsObjectIdentifiers.IdHmacWithSha512); + AddHMacKeyGenerator("SHA512/224"); + AddHMacKeyGenerator("SHA512/256"); + AddHMacKeyGenerator("KECCAK224"); + AddHMacKeyGenerator("KECCAK256"); + AddHMacKeyGenerator("KECCAK288"); + AddHMacKeyGenerator("KECCAK384"); + AddHMacKeyGenerator("KECCAK512"); + AddHMacKeyGenerator("SHA3-224", + NistObjectIdentifiers.IdHMacWithSha3_224); + AddHMacKeyGenerator("SHA3-256", + NistObjectIdentifiers.IdHMacWithSha3_256); + AddHMacKeyGenerator("SHA3-384", + NistObjectIdentifiers.IdHMacWithSha3_384); + AddHMacKeyGenerator("SHA3-512", + NistObjectIdentifiers.IdHMacWithSha3_512); + AddHMacKeyGenerator("RIPEMD128"); + AddHMacKeyGenerator("RIPEMD160", + IanaObjectIdentifiers.HmacRipeMD160); + AddHMacKeyGenerator("TIGER", + IanaObjectIdentifiers.HmacTiger); + AddHMacKeyGenerator("GOST3411-2012-256", + RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_256); + AddHMacKeyGenerator("GOST3411-2012-512", + RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_512); + + // + // key pair generators. + // + AddKpgAlgorithm("DH", + "DIFFIEHELLMAN"); + AddKpgAlgorithm("DSA"); + AddKpgAlgorithm("EC", + // TODO Should this be an alias for ECDH? + X9ObjectIdentifiers.DHSinglePassStdDHSha1KdfScheme); + AddKpgAlgorithm("ECDH", + "ECIES"); + AddKpgAlgorithm("ECDHC"); + AddKpgAlgorithm("ECMQV", + X9ObjectIdentifiers.MqvSinglePassSha1KdfScheme); + AddKpgAlgorithm("ECDSA"); + AddKpgAlgorithm("ECGOST3410", + "ECGOST-3410", + "GOST-3410-2001"); + AddKpgAlgorithm("Ed25519", + "Ed25519ctx", + "Ed25519ph", + EdECObjectIdentifiers.id_Ed25519); + AddKpgAlgorithm("Ed448", + "Ed448ph", + EdECObjectIdentifiers.id_Ed448); + AddKpgAlgorithm("ELGAMAL"); + AddKpgAlgorithm("GOST3410", + "GOST-3410", + "GOST-3410-94"); + AddKpgAlgorithm("RSA", + "1.2.840.113549.1.1.1"); + AddKpgAlgorithm("X25519", + EdECObjectIdentifiers.id_X25519); + AddKpgAlgorithm("X448", + EdECObjectIdentifiers.id_X448); + + AddDefaultKeySizeEntries(64, "DES"); + AddDefaultKeySizeEntries(80, "SKIPJACK"); + AddDefaultKeySizeEntries(128, "AES128", "BLOWFISH", "CAMELLIA128", "CAST5", "DESEDE", + "HC128", "HMACMD2", "HMACMD4", "HMACMD5", "HMACRIPEMD128", "IDEA", "NOEKEON", + "RC2", "RC4", "RC5", "SALSA20", "SEED", "SM4", "TEA", "XTEA", "VMPC", "VMPC-KSA3"); + AddDefaultKeySizeEntries(160, "HMACRIPEMD160", "HMACSHA1"); + AddDefaultKeySizeEntries(192, "AES", "AES192", "CAMELLIA192", "DESEDE3", "HMACTIGER", + "RIJNDAEL", "SERPENT", "TNEPRES"); + AddDefaultKeySizeEntries(224, "HMACSHA3-224", "HMACKECCAK224", "HMACSHA224", "HMACSHA512/224"); + AddDefaultKeySizeEntries(256, "AES256", "CAMELLIA", "CAMELLIA256", "CAST6", "GOST28147", + "HC256", "HMACGOST3411-2012-256", "HMACSHA3-256", "HMACKECCAK256", "HMACSHA256", "HMACSHA512/256", "RC5-64", "RC6", "THREEFISH-256", "TWOFISH"); + AddDefaultKeySizeEntries(288, "HMACKECCAK288"); + AddDefaultKeySizeEntries(384, "HMACSHA3-384", "HMACKECCAK384", "HMACSHA384"); + AddDefaultKeySizeEntries(512, "HMACGOST3411-2012-512", "HMACSHA3-512", "HMACKECCAK512", "HMACSHA512", "THREEFISH-512"); + AddDefaultKeySizeEntries(1024, "THREEFISH-1024"); + } + + private static void AddDefaultKeySizeEntries(int size, params string[] algorithms) + { + foreach (string algorithm in algorithms) + { + defaultKeySizes.Add(algorithm, size); + } + } + + private static void AddKgAlgorithm( + string canonicalName, + params object[] aliases) + { + kgAlgorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(canonicalName)] = canonicalName; + + foreach (object alias in aliases) + { + kgAlgorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(alias.ToString())] = canonicalName; + } + } + + private static void AddKpgAlgorithm( + string canonicalName, + params object[] aliases) + { + kpgAlgorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(canonicalName)] = canonicalName; + + foreach (object alias in aliases) + { + kpgAlgorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(alias.ToString())] = canonicalName; + } + } + + private static void AddHMacKeyGenerator( + string algorithm, + params object[] aliases) + { + string mainName = "HMAC" + algorithm; + + kgAlgorithms[mainName] = mainName; + kgAlgorithms["HMAC-" + algorithm] = mainName; + kgAlgorithms["HMAC/" + algorithm] = mainName; + + foreach (object alias in aliases) + { + kgAlgorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(alias.ToString())] = mainName; + } + } + + // TODO Consider making this public + internal static string GetCanonicalKeyGeneratorAlgorithm( + string algorithm) + { + return (string) kgAlgorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + } + + // TODO Consider making this public + internal static string GetCanonicalKeyPairGeneratorAlgorithm( + string algorithm) + { + return (string)kpgAlgorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + } + + public static CipherKeyGenerator GetKeyGenerator( + DerObjectIdentifier oid) + { + return GetKeyGenerator(oid.Id); + } + + public static CipherKeyGenerator GetKeyGenerator( + string algorithm) + { + string canonicalName = GetCanonicalKeyGeneratorAlgorithm(algorithm); + + if (canonicalName == null) + throw new SecurityUtilityException("KeyGenerator " + algorithm + " not recognised."); + + int defaultKeySize = FindDefaultKeySize(canonicalName); + if (defaultKeySize == -1) + throw new SecurityUtilityException("KeyGenerator " + algorithm + + " (" + canonicalName + ") not supported."); + + if (canonicalName == "DES") + return new DesKeyGenerator(defaultKeySize); + + if (canonicalName == "DESEDE" || canonicalName == "DESEDE3") + return new DesEdeKeyGenerator(defaultKeySize); + + return new CipherKeyGenerator(defaultKeySize); + } + + public static IAsymmetricCipherKeyPairGenerator GetKeyPairGenerator( + DerObjectIdentifier oid) + { + return GetKeyPairGenerator(oid.Id); + } + + public static IAsymmetricCipherKeyPairGenerator GetKeyPairGenerator( + string algorithm) + { + string canonicalName = GetCanonicalKeyPairGeneratorAlgorithm(algorithm); + + if (canonicalName == null) + throw new SecurityUtilityException("KeyPairGenerator " + algorithm + " not recognised."); + + if (canonicalName == "DH") + return new DHKeyPairGenerator(); + + if (canonicalName == "DSA") + return new DsaKeyPairGenerator(); + + // "EC", "ECDH", "ECDHC", "ECDSA", "ECGOST3410", "ECMQV" + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(canonicalName, "EC")) + return new ECKeyPairGenerator(canonicalName); + + if (canonicalName == "Ed25519") + return new Ed25519KeyPairGenerator(); + + if (canonicalName == "Ed448") + return new Ed448KeyPairGenerator(); + + if (canonicalName == "ELGAMAL") + return new ElGamalKeyPairGenerator(); + + if (canonicalName == "GOST3410") + return new Gost3410KeyPairGenerator(); + + if (canonicalName == "RSA") + return new RsaKeyPairGenerator(); + + if (canonicalName == "X25519") + return new X25519KeyPairGenerator(); + + if (canonicalName == "X448") + return new X448KeyPairGenerator(); + + throw new SecurityUtilityException("KeyPairGenerator " + algorithm + + " (" + canonicalName + ") not supported."); + } + + internal static int GetDefaultKeySize( + DerObjectIdentifier oid) + { + return GetDefaultKeySize(oid.Id); + } + + internal static int GetDefaultKeySize( + string algorithm) + { + string canonicalName = GetCanonicalKeyGeneratorAlgorithm(algorithm); + + if (canonicalName == null) + throw new SecurityUtilityException("KeyGenerator " + algorithm + " not recognised."); + + int defaultKeySize = FindDefaultKeySize(canonicalName); + if (defaultKeySize == -1) + throw new SecurityUtilityException("KeyGenerator " + algorithm + + " (" + canonicalName + ") not supported."); + + return defaultKeySize; + } + + private static int FindDefaultKeySize( + string canonicalName) + { + if (!defaultKeySizes.Contains(canonicalName)) + return -1; + + return (int)defaultKeySizes[canonicalName]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneratorUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneratorUtilities.cs.meta new file mode 100644 index 00000000..ed0b2e29 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/GeneratorUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 71114e4af0270f34ba2d802c33a9bd5b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidKeyException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidKeyException.cs new file mode 100644 index 00000000..0b9a79d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidKeyException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class InvalidKeyException : KeyException + { + public InvalidKeyException() : base() { } + public InvalidKeyException(string message) : base(message) { } + public InvalidKeyException(string message, Exception exception) : base(message, exception) { } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidKeyException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidKeyException.cs.meta new file mode 100644 index 00000000..8b9b345d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidKeyException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9842e68a8ae8895468c08cc98231c060 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidParameterException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidParameterException.cs new file mode 100644 index 00000000..5bce04a8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidParameterException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class InvalidParameterException : KeyException + { + public InvalidParameterException() : base() { } + public InvalidParameterException(string message) : base(message) { } + public InvalidParameterException(string message, Exception exception) : base(message, exception) { } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidParameterException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidParameterException.cs.meta new file mode 100644 index 00000000..6807bfe2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/InvalidParameterException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a02c4f553fcf8d749801284afc4da77a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/KeyException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/KeyException.cs new file mode 100644 index 00000000..91872fcb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/KeyException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class KeyException : GeneralSecurityException + { + public KeyException() : base() { } + public KeyException(string message) : base(message) { } + public KeyException(string message, Exception exception) : base(message, exception) { } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/KeyException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/KeyException.cs.meta new file mode 100644 index 00000000..17107b96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/KeyException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 981c3b6a3e40ccc479b9b7c4a5e4568e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/MacUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/MacUtilities.cs new file mode 100644 index 00000000..1a30b6f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/MacUtilities.cs @@ -0,0 +1,270 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Globalization; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Iana; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + /// + /// Utility class for creating HMac object from their names/Oids + /// + public sealed class MacUtilities + { + private MacUtilities() + { + } + + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + //private static readonly IDictionary oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static MacUtilities() + { + algorithms[IanaObjectIdentifiers.HmacMD5.Id] = "HMAC-MD5"; + algorithms[IanaObjectIdentifiers.HmacRipeMD160.Id] = "HMAC-RIPEMD160"; + algorithms[IanaObjectIdentifiers.HmacSha1.Id] = "HMAC-SHA1"; + algorithms[IanaObjectIdentifiers.HmacTiger.Id] = "HMAC-TIGER"; + + algorithms[PkcsObjectIdentifiers.IdHmacWithSha1.Id] = "HMAC-SHA1"; + algorithms[PkcsObjectIdentifiers.IdHmacWithSha224.Id] = "HMAC-SHA224"; + algorithms[PkcsObjectIdentifiers.IdHmacWithSha256.Id] = "HMAC-SHA256"; + algorithms[PkcsObjectIdentifiers.IdHmacWithSha384.Id] = "HMAC-SHA384"; + algorithms[PkcsObjectIdentifiers.IdHmacWithSha512.Id] = "HMAC-SHA512"; + + algorithms[NistObjectIdentifiers.IdHMacWithSha3_224.Id] = "HMAC-SHA3-224"; + algorithms[NistObjectIdentifiers.IdHMacWithSha3_256.Id] = "HMAC-SHA3-256"; + algorithms[NistObjectIdentifiers.IdHMacWithSha3_384.Id] = "HMAC-SHA3-384"; + algorithms[NistObjectIdentifiers.IdHMacWithSha3_512.Id] = "HMAC-SHA3-512"; + + algorithms[RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_256.Id] = "HMAC-GOST3411-2012-256"; + algorithms[RosstandartObjectIdentifiers.id_tc26_hmac_gost_3411_12_512.Id] = "HMAC-GOST3411-2012-512"; + + // TODO AESMAC? + + algorithms["DES"] = "DESMAC"; + algorithms["DES/CFB8"] = "DESMAC/CFB8"; + algorithms["DES64"] = "DESMAC64"; + algorithms["DESEDE"] = "DESEDEMAC"; + algorithms[PkcsObjectIdentifiers.DesEde3Cbc.Id] = "DESEDEMAC"; + algorithms["DESEDE/CFB8"] = "DESEDEMAC/CFB8"; + algorithms["DESISO9797MAC"] = "DESWITHISO9797"; + algorithms["DESEDE64"] = "DESEDEMAC64"; + + algorithms["DESEDE64WITHISO7816-4PADDING"] = "DESEDEMAC64WITHISO7816-4PADDING"; + algorithms["DESEDEISO9797ALG1MACWITHISO7816-4PADDING"] = "DESEDEMAC64WITHISO7816-4PADDING"; + algorithms["DESEDEISO9797ALG1WITHISO7816-4PADDING"] = "DESEDEMAC64WITHISO7816-4PADDING"; + + algorithms["ISO9797ALG3"] = "ISO9797ALG3MAC"; + algorithms["ISO9797ALG3MACWITHISO7816-4PADDING"] = "ISO9797ALG3WITHISO7816-4PADDING"; + + algorithms["SKIPJACK"] = "SKIPJACKMAC"; + algorithms["SKIPJACK/CFB8"] = "SKIPJACKMAC/CFB8"; + algorithms["IDEA"] = "IDEAMAC"; + algorithms["IDEA/CFB8"] = "IDEAMAC/CFB8"; + algorithms["RC2"] = "RC2MAC"; + algorithms["RC2/CFB8"] = "RC2MAC/CFB8"; + algorithms["RC5"] = "RC5MAC"; + algorithms["RC5/CFB8"] = "RC5MAC/CFB8"; + algorithms["GOST28147"] = "GOST28147MAC"; + algorithms["VMPC"] = "VMPCMAC"; + algorithms["VMPC-MAC"] = "VMPCMAC"; + algorithms["SIPHASH"] = "SIPHASH-2-4"; + + algorithms["PBEWITHHMACSHA"] = "PBEWITHHMACSHA1"; + algorithms["1.3.14.3.2.26"] = "PBEWITHHMACSHA1"; + } + +// /// +// /// Returns a ObjectIdentifier for a given digest mechanism. +// /// +// /// A string representation of the digest meanism. +// /// A DerObjectIdentifier, null if the Oid is not available. +// public static DerObjectIdentifier GetObjectIdentifier( +// string mechanism) +// { +// mechanism = (string) algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(mechanism)]; +// +// if (mechanism != null) +// { +// return (DerObjectIdentifier)oids[mechanism]; +// } +// +// return null; +// } + +// public static ICollection Algorithms +// { +// get { return oids.Keys; } +// } + + public static IMac GetMac( + DerObjectIdentifier id) + { + return GetMac(id.Id); + } + + public static IMac GetMac( + string algorithm) + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + + string mechanism = (string) algorithms[upper]; + + if (mechanism == null) + { + mechanism = upper; + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEWITH")) + { + mechanism = mechanism.Substring("PBEWITH".Length); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "HMAC")) + { + string digestName; + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "HMAC-") || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "HMAC/")) + { + digestName = mechanism.Substring(5); + } + else + { + digestName = mechanism.Substring(4); + } + + return new HMac(DigestUtilities.GetDigest(digestName)); + } + + if (mechanism == "AESCMAC") + { + return new CMac(new AesEngine()); + } + if (mechanism == "DESMAC") + { + return new CbcBlockCipherMac(new DesEngine()); + } + if (mechanism == "DESMAC/CFB8") + { + return new CfbBlockCipherMac(new DesEngine()); + } + if (mechanism == "DESMAC64") + { + return new CbcBlockCipherMac(new DesEngine(), 64); + } + if (mechanism == "DESEDECMAC") + { + return new CMac(new DesEdeEngine()); + } + if (mechanism == "DESEDEMAC") + { + return new CbcBlockCipherMac(new DesEdeEngine()); + } + if (mechanism == "DESEDEMAC/CFB8") + { + return new CfbBlockCipherMac(new DesEdeEngine()); + } + if (mechanism == "DESEDEMAC64") + { + return new CbcBlockCipherMac(new DesEdeEngine(), 64); + } + if (mechanism == "DESEDEMAC64WITHISO7816-4PADDING") + { + return new CbcBlockCipherMac(new DesEdeEngine(), 64, new ISO7816d4Padding()); + } + if (mechanism == "DESWITHISO9797" + || mechanism == "ISO9797ALG3MAC") + { + return new ISO9797Alg3Mac(new DesEngine()); + } + if (mechanism == "ISO9797ALG3WITHISO7816-4PADDING") + { + return new ISO9797Alg3Mac(new DesEngine(), new ISO7816d4Padding()); + } + if (mechanism == "SKIPJACKMAC") + { + return new CbcBlockCipherMac(new SkipjackEngine()); + } + if (mechanism == "SKIPJACKMAC/CFB8") + { + return new CfbBlockCipherMac(new SkipjackEngine()); + } + if (mechanism == "IDEAMAC") + { + return new CbcBlockCipherMac(new IdeaEngine()); + } + if (mechanism == "IDEAMAC/CFB8") + { + return new CfbBlockCipherMac(new IdeaEngine()); + } + if (mechanism == "RC2MAC") + { + return new CbcBlockCipherMac(new RC2Engine()); + } + if (mechanism == "RC2MAC/CFB8") + { + return new CfbBlockCipherMac(new RC2Engine()); + } + if (mechanism == "RC5MAC") + { + return new CbcBlockCipherMac(new RC532Engine()); + } + if (mechanism == "RC5MAC/CFB8") + { + return new CfbBlockCipherMac(new RC532Engine()); + } + if (mechanism == "GOST28147MAC") + { + return new Gost28147Mac(); + } + if (mechanism == "VMPCMAC") + { + return new VmpcMac(); + } + if (mechanism == "SIPHASH-2-4") + { + return new SipHash(); + } + throw new SecurityUtilityException("Mac " + mechanism + " not recognised."); + } + + public static string GetAlgorithmName( + DerObjectIdentifier oid) + { + return (string) algorithms[oid.Id]; + } + + public static byte[] CalculateMac(string algorithm, ICipherParameters cp, byte[] input) + { + IMac mac = GetMac(algorithm); + mac.Init(cp); + mac.BlockUpdate(input, 0, input.Length); + return DoFinal(mac); + } + + public static byte[] DoFinal(IMac mac) + { + byte[] b = new byte[mac.GetMacSize()]; + mac.DoFinal(b, 0); + return b; + } + + public static byte[] DoFinal(IMac mac, byte[] input) + { + mac.BlockUpdate(input, 0, input.Length); + return DoFinal(mac); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/MacUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/MacUtilities.cs.meta new file mode 100644 index 00000000..d49ea38a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/MacUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc8314b890aed0843acbd81d9e6db0cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/NoSuchAlgorithmException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/NoSuchAlgorithmException.cs new file mode 100644 index 00000000..83fe801a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/NoSuchAlgorithmException.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + [Obsolete("Never thrown")] +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class NoSuchAlgorithmException : GeneralSecurityException + { + public NoSuchAlgorithmException() : base() {} + public NoSuchAlgorithmException(string message) : base(message) {} + public NoSuchAlgorithmException(string message, Exception exception) : base(message, exception) {} + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/NoSuchAlgorithmException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/NoSuchAlgorithmException.cs.meta new file mode 100644 index 00000000..1f15b373 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/NoSuchAlgorithmException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 38a27f8bfff09634a8b5577f53682a2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/ParameterUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/ParameterUtilities.cs new file mode 100644 index 00000000..e6ad7908 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/ParameterUtilities.cs @@ -0,0 +1,340 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Kisa; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ntt; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + public sealed class ParameterUtilities + { + private ParameterUtilities() + { + } + + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary basicIVSizes = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static ParameterUtilities() + { + AddAlgorithm("AES", + "AESWRAP"); + AddAlgorithm("AES128", + "2.16.840.1.101.3.4.2", + NistObjectIdentifiers.IdAes128Cbc, + NistObjectIdentifiers.IdAes128Cfb, + NistObjectIdentifiers.IdAes128Ecb, + NistObjectIdentifiers.IdAes128Ofb, + NistObjectIdentifiers.IdAes128Wrap); + AddAlgorithm("AES192", + "2.16.840.1.101.3.4.22", + NistObjectIdentifiers.IdAes192Cbc, + NistObjectIdentifiers.IdAes192Cfb, + NistObjectIdentifiers.IdAes192Ecb, + NistObjectIdentifiers.IdAes192Ofb, + NistObjectIdentifiers.IdAes192Wrap); + AddAlgorithm("AES256", + "2.16.840.1.101.3.4.42", + NistObjectIdentifiers.IdAes256Cbc, + NistObjectIdentifiers.IdAes256Cfb, + NistObjectIdentifiers.IdAes256Ecb, + NistObjectIdentifiers.IdAes256Ofb, + NistObjectIdentifiers.IdAes256Wrap); + AddAlgorithm("BLOWFISH", + "1.3.6.1.4.1.3029.1.2"); + AddAlgorithm("CAMELLIA", + "CAMELLIAWRAP"); + AddAlgorithm("CAMELLIA128", + NttObjectIdentifiers.IdCamellia128Cbc, + NttObjectIdentifiers.IdCamellia128Wrap); + AddAlgorithm("CAMELLIA192", + NttObjectIdentifiers.IdCamellia192Cbc, + NttObjectIdentifiers.IdCamellia192Wrap); + AddAlgorithm("CAMELLIA256", + NttObjectIdentifiers.IdCamellia256Cbc, + NttObjectIdentifiers.IdCamellia256Wrap); + AddAlgorithm("CAST5", + "1.2.840.113533.7.66.10"); + AddAlgorithm("CAST6"); + AddAlgorithm("DES", + OiwObjectIdentifiers.DesCbc, + OiwObjectIdentifiers.DesCfb, + OiwObjectIdentifiers.DesEcb, + OiwObjectIdentifiers.DesOfb); + AddAlgorithm("DESEDE", + "DESEDEWRAP", + "TDEA", + OiwObjectIdentifiers.DesEde, + PkcsObjectIdentifiers.IdAlgCms3DesWrap); + AddAlgorithm("DESEDE3", + PkcsObjectIdentifiers.DesEde3Cbc); + AddAlgorithm("GOST28147", + "GOST", + "GOST-28147", + CryptoProObjectIdentifiers.GostR28147Cbc); + AddAlgorithm("HC128"); + AddAlgorithm("HC256"); + AddAlgorithm("IDEA", + "1.3.6.1.4.1.188.7.1.1.2"); + AddAlgorithm("NOEKEON"); + AddAlgorithm("RC2", + PkcsObjectIdentifiers.RC2Cbc, + PkcsObjectIdentifiers.IdAlgCmsRC2Wrap); + AddAlgorithm("RC4", + "ARC4", + "1.2.840.113549.3.4"); + AddAlgorithm("RC5", + "RC5-32"); + AddAlgorithm("RC5-64"); + AddAlgorithm("RC6"); + AddAlgorithm("RIJNDAEL"); + AddAlgorithm("SALSA20"); + AddAlgorithm("SEED", + KisaObjectIdentifiers.IdNpkiAppCmsSeedWrap, + KisaObjectIdentifiers.IdSeedCbc); + AddAlgorithm("SERPENT"); + AddAlgorithm("SKIPJACK"); + AddAlgorithm("SM4"); + AddAlgorithm("TEA"); + AddAlgorithm("THREEFISH-256"); + AddAlgorithm("THREEFISH-512"); + AddAlgorithm("THREEFISH-1024"); + AddAlgorithm("TNEPRES"); + AddAlgorithm("TWOFISH"); + AddAlgorithm("VMPC"); + AddAlgorithm("VMPC-KSA3"); + AddAlgorithm("XTEA"); + + AddBasicIVSizeEntries(8, "BLOWFISH", "DES", "DESEDE", "DESEDE3"); + AddBasicIVSizeEntries(16, "AES", "AES128", "AES192", "AES256", + "CAMELLIA", "CAMELLIA128", "CAMELLIA192", "CAMELLIA256", + "NOEKEON", "SEED", "SM4"); + + // TODO These algorithms support an IV + // but JCE doesn't seem to provide an AlgorithmParametersGenerator for them + // "RIJNDAEL", "SKIPJACK", "TWOFISH" + } + + private static void AddAlgorithm( + string canonicalName, + params object[] aliases) + { + algorithms[canonicalName] = canonicalName; + + foreach (object alias in aliases) + { + algorithms[alias.ToString()] = canonicalName; + } + } + + private static void AddBasicIVSizeEntries(int size, params string[] algorithms) + { + foreach (string algorithm in algorithms) + { + basicIVSizes.Add(algorithm, size); + } + } + + public static string GetCanonicalAlgorithmName( + string algorithm) + { + return (string) algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + } + + public static KeyParameter CreateKeyParameter( + DerObjectIdentifier algOid, + byte[] keyBytes) + { + return CreateKeyParameter(algOid.Id, keyBytes, 0, keyBytes.Length); + } + + public static KeyParameter CreateKeyParameter( + string algorithm, + byte[] keyBytes) + { + return CreateKeyParameter(algorithm, keyBytes, 0, keyBytes.Length); + } + + public static KeyParameter CreateKeyParameter( + DerObjectIdentifier algOid, + byte[] keyBytes, + int offset, + int length) + { + return CreateKeyParameter(algOid.Id, keyBytes, offset, length); + } + + public static KeyParameter CreateKeyParameter( + string algorithm, + byte[] keyBytes, + int offset, + int length) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + + string canonical = GetCanonicalAlgorithmName(algorithm); + + if (canonical == null) + throw new SecurityUtilityException("Algorithm " + algorithm + " not recognised."); + + if (canonical == "DES") + return new DesParameters(keyBytes, offset, length); + + if (canonical == "DESEDE" || canonical =="DESEDE3") + return new DesEdeParameters(keyBytes, offset, length); + + if (canonical == "RC2") + return new RC2Parameters(keyBytes, offset, length); + + return new KeyParameter(keyBytes, offset, length); + } + + public static ICipherParameters GetCipherParameters( + DerObjectIdentifier algOid, + ICipherParameters key, + Asn1Object asn1Params) + { + return GetCipherParameters(algOid.Id, key, asn1Params); + } + + public static ICipherParameters GetCipherParameters( + string algorithm, + ICipherParameters key, + Asn1Object asn1Params) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + + string canonical = GetCanonicalAlgorithmName(algorithm); + + if (canonical == null) + throw new SecurityUtilityException("Algorithm " + algorithm + " not recognised."); + + byte[] iv = null; + + try + { + // TODO These algorithms support an IV + // but JCE doesn't seem to provide an AlgorithmParametersGenerator for them + // "RIJNDAEL", "SKIPJACK", "TWOFISH" + + int basicIVKeySize = FindBasicIVSize(canonical); + if (basicIVKeySize != -1 + || canonical == "RIJNDAEL" || canonical == "SKIPJACK" || canonical == "TWOFISH") + { + iv = ((Asn1OctetString) asn1Params).GetOctets(); + } + else if (canonical == "CAST5") + { + iv = Cast5CbcParameters.GetInstance(asn1Params).GetIV(); + } + else if (canonical == "IDEA") + { + iv = IdeaCbcPar.GetInstance(asn1Params).GetIV(); + } + else if (canonical == "RC2") + { + iv = RC2CbcParameter.GetInstance(asn1Params).GetIV(); + } + } + catch (Exception e) + { + throw new ArgumentException("Could not process ASN.1 parameters", e); + } + + if (iv != null) + { + return new ParametersWithIV(key, iv); + } + + throw new SecurityUtilityException("Algorithm " + algorithm + " not recognised."); + } + + public static Asn1Encodable GenerateParameters( + DerObjectIdentifier algID, + SecureRandom random) + { + return GenerateParameters(algID.Id, random); + } + + public static Asn1Encodable GenerateParameters( + string algorithm, + SecureRandom random) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + + string canonical = GetCanonicalAlgorithmName(algorithm); + + if (canonical == null) + throw new SecurityUtilityException("Algorithm " + algorithm + " not recognised."); + + // TODO These algorithms support an IV + // but JCE doesn't seem to provide an AlgorithmParametersGenerator for them + // "RIJNDAEL", "SKIPJACK", "TWOFISH" + + int basicIVKeySize = FindBasicIVSize(canonical); + if (basicIVKeySize != -1) + return CreateIVOctetString(random, basicIVKeySize); + + if (canonical == "CAST5") + return new Cast5CbcParameters(CreateIV(random, 8), 128); + + if (canonical == "IDEA") + return new IdeaCbcPar(CreateIV(random, 8)); + + if (canonical == "RC2") + return new RC2CbcParameter(CreateIV(random, 8)); + + throw new SecurityUtilityException("Algorithm " + algorithm + " not recognised."); + } + + public static ICipherParameters WithRandom(ICipherParameters cp, SecureRandom random) + { + if (random != null) + { + cp = new ParametersWithRandom(cp, random); + } + return cp; + } + + private static Asn1OctetString CreateIVOctetString( + SecureRandom random, + int ivLength) + { + return new DerOctetString(CreateIV(random, ivLength)); + } + + private static byte[] CreateIV( + SecureRandom random, + int ivLength) + { + byte[] iv = new byte[ivLength]; + random.NextBytes(iv); + return iv; + } + + private static int FindBasicIVSize( + string canonicalName) + { + if (!basicIVSizes.Contains(canonicalName)) + return -1; + + return (int)basicIVSizes[canonicalName]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/ParameterUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/ParameterUtilities.cs.meta new file mode 100644 index 00000000..85eb922d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/ParameterUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c1511264e2b6be42bd6afc367283966 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PbeUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PbeUtilities.cs new file mode 100644 index 00000000..c0ed3bef --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PbeUtilities.cs @@ -0,0 +1,667 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.BC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Macs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Paddings; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + /// + /// + /// + public sealed class PbeUtilities + { + private PbeUtilities() + { + } + + const string Pkcs5S1 = "Pkcs5S1"; + const string Pkcs5S2 = "Pkcs5S2"; + const string Pkcs12 = "Pkcs12"; + const string OpenSsl = "OpenSsl"; + + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary algorithmType = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static PbeUtilities() + { + algorithms["PKCS5SCHEME1"] = "Pkcs5scheme1"; + algorithms["PKCS5SCHEME2"] = "Pkcs5scheme2"; + algorithms[PkcsObjectIdentifiers.IdPbeS2.Id] = "Pkcs5scheme2"; +// algorithms[PkcsObjectIdentifiers.IdPbkdf2.Id] = "Pkcs5scheme2"; + + // FIXME Add support for these? (see Pkcs8Generator) +// algorithms[PkcsObjectIdentifiers.DesEde3Cbc.Id] = "Pkcs5scheme2"; +// algorithms[NistObjectIdentifiers.IdAes128Cbc.Id] = "Pkcs5scheme2"; +// algorithms[NistObjectIdentifiers.IdAes192Cbc.Id] = "Pkcs5scheme2"; +// algorithms[NistObjectIdentifiers.IdAes256Cbc.Id] = "Pkcs5scheme2"; + + algorithms["PBEWITHMD2ANDDES-CBC"] = "PBEwithMD2andDES-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithMD2AndDesCbc.Id] = "PBEwithMD2andDES-CBC"; + algorithms["PBEWITHMD2ANDRC2-CBC"] = "PBEwithMD2andRC2-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithMD2AndRC2Cbc.Id] = "PBEwithMD2andRC2-CBC"; + algorithms["PBEWITHMD5ANDDES-CBC"] = "PBEwithMD5andDES-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithMD5AndDesCbc.Id] = "PBEwithMD5andDES-CBC"; + algorithms["PBEWITHMD5ANDRC2-CBC"] = "PBEwithMD5andRC2-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithMD5AndRC2Cbc.Id] = "PBEwithMD5andRC2-CBC"; + algorithms["PBEWITHSHA1ANDDES"] = "PBEwithSHA-1andDES-CBC"; + algorithms["PBEWITHSHA-1ANDDES"] = "PBEwithSHA-1andDES-CBC"; + algorithms["PBEWITHSHA1ANDDES-CBC"] = "PBEwithSHA-1andDES-CBC"; + algorithms["PBEWITHSHA-1ANDDES-CBC"] = "PBEwithSHA-1andDES-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithSha1AndDesCbc.Id] = "PBEwithSHA-1andDES-CBC"; + algorithms["PBEWITHSHA1ANDRC2"] = "PBEwithSHA-1andRC2-CBC"; + algorithms["PBEWITHSHA-1ANDRC2"] = "PBEwithSHA-1andRC2-CBC"; + algorithms["PBEWITHSHA1ANDRC2-CBC"] = "PBEwithSHA-1andRC2-CBC"; + algorithms["PBEWITHSHA-1ANDRC2-CBC"] = "PBEwithSHA-1andRC2-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithSha1AndRC2Cbc.Id] = "PBEwithSHA-1andRC2-CBC"; + algorithms["PKCS12"] = "Pkcs12"; + algorithms[BCObjectIdentifiers.bc_pbe_sha1_pkcs12_aes128_cbc.Id] = "PBEwithSHA-1and128bitAES-CBC-BC"; + algorithms[BCObjectIdentifiers.bc_pbe_sha1_pkcs12_aes192_cbc.Id] = "PBEwithSHA-1and192bitAES-CBC-BC"; + algorithms[BCObjectIdentifiers.bc_pbe_sha1_pkcs12_aes256_cbc.Id] = "PBEwithSHA-1and256bitAES-CBC-BC"; + algorithms[BCObjectIdentifiers.bc_pbe_sha256_pkcs12_aes128_cbc.Id] = "PBEwithSHA-256and128bitAES-CBC-BC"; + algorithms[BCObjectIdentifiers.bc_pbe_sha256_pkcs12_aes192_cbc.Id] = "PBEwithSHA-256and192bitAES-CBC-BC"; + algorithms[BCObjectIdentifiers.bc_pbe_sha256_pkcs12_aes256_cbc.Id] = "PBEwithSHA-256and256bitAES-CBC-BC"; + algorithms["PBEWITHSHAAND128BITRC4"] = "PBEwithSHA-1and128bitRC4"; + algorithms["PBEWITHSHA1AND128BITRC4"] = "PBEwithSHA-1and128bitRC4"; + algorithms["PBEWITHSHA-1AND128BITRC4"] = "PBEwithSHA-1and128bitRC4"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd128BitRC4.Id] = "PBEwithSHA-1and128bitRC4"; + algorithms["PBEWITHSHAAND40BITRC4"] = "PBEwithSHA-1and40bitRC4"; + algorithms["PBEWITHSHA1AND40BITRC4"] = "PBEwithSHA-1and40bitRC4"; + algorithms["PBEWITHSHA-1AND40BITRC4"] = "PBEwithSHA-1and40bitRC4"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd40BitRC4.Id] = "PBEwithSHA-1and40bitRC4"; + algorithms["PBEWITHSHAAND3-KEYDESEDE-CBC"] = "PBEwithSHA-1and3-keyDESEDE-CBC"; + algorithms["PBEWITHSHAAND3-KEYTRIPLEDES-CBC"] = "PBEwithSHA-1and3-keyDESEDE-CBC"; + algorithms["PBEWITHSHA1AND3-KEYDESEDE-CBC"] = "PBEwithSHA-1and3-keyDESEDE-CBC"; + algorithms["PBEWITHSHA1AND3-KEYTRIPLEDES-CBC"] = "PBEwithSHA-1and3-keyDESEDE-CBC"; + algorithms["PBEWITHSHA-1AND3-KEYDESEDE-CBC"] = "PBEwithSHA-1and3-keyDESEDE-CBC"; + algorithms["PBEWITHSHA-1AND3-KEYTRIPLEDES-CBC"] = "PBEwithSHA-1and3-keyDESEDE-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc.Id] = "PBEwithSHA-1and3-keyDESEDE-CBC"; + algorithms["PBEWITHSHAAND2-KEYDESEDE-CBC"] = "PBEwithSHA-1and2-keyDESEDE-CBC"; + algorithms["PBEWITHSHAAND2-KEYTRIPLEDES-CBC"] = "PBEwithSHA-1and2-keyDESEDE-CBC"; + algorithms["PBEWITHSHA1AND2-KEYDESEDE-CBC"] = "PBEwithSHA-1and2-keyDESEDE-CBC"; + algorithms["PBEWITHSHA1AND2-KEYTRIPLEDES-CBC"] = "PBEwithSHA-1and2-keyDESEDE-CBC"; + algorithms["PBEWITHSHA-1AND2-KEYDESEDE-CBC"] = "PBEwithSHA-1and2-keyDESEDE-CBC"; + algorithms["PBEWITHSHA-1AND2-KEYTRIPLEDES-CBC"] = "PBEwithSHA-1and2-keyDESEDE-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd2KeyTripleDesCbc.Id] = "PBEwithSHA-1and2-keyDESEDE-CBC"; + algorithms["PBEWITHSHAAND128BITRC2-CBC"] = "PBEwithSHA-1and128bitRC2-CBC"; + algorithms["PBEWITHSHA1AND128BITRC2-CBC"] = "PBEwithSHA-1and128bitRC2-CBC"; + algorithms["PBEWITHSHA-1AND128BITRC2-CBC"] = "PBEwithSHA-1and128bitRC2-CBC"; + algorithms[PkcsObjectIdentifiers.PbeWithShaAnd128BitRC2Cbc.Id] = "PBEwithSHA-1and128bitRC2-CBC"; + algorithms["PBEWITHSHAAND40BITRC2-CBC"] = "PBEwithSHA-1and40bitRC2-CBC"; + algorithms["PBEWITHSHA1AND40BITRC2-CBC"] = "PBEwithSHA-1and40bitRC2-CBC"; + algorithms["PBEWITHSHA-1AND40BITRC2-CBC"] = "PBEwithSHA-1and40bitRC2-CBC"; + algorithms[PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc.Id] = "PBEwithSHA-1and40bitRC2-CBC"; + algorithms["PBEWITHSHAAND128BITAES-CBC-BC"] = "PBEwithSHA-1and128bitAES-CBC-BC"; + algorithms["PBEWITHSHA1AND128BITAES-CBC-BC"] = "PBEwithSHA-1and128bitAES-CBC-BC"; + algorithms["PBEWITHSHA-1AND128BITAES-CBC-BC"] = "PBEwithSHA-1and128bitAES-CBC-BC"; + algorithms["PBEWITHSHAAND192BITAES-CBC-BC"] = "PBEwithSHA-1and192bitAES-CBC-BC"; + algorithms["PBEWITHSHA1AND192BITAES-CBC-BC"] = "PBEwithSHA-1and192bitAES-CBC-BC"; + algorithms["PBEWITHSHA-1AND192BITAES-CBC-BC"] = "PBEwithSHA-1and192bitAES-CBC-BC"; + algorithms["PBEWITHSHAAND256BITAES-CBC-BC"] = "PBEwithSHA-1and256bitAES-CBC-BC"; + algorithms["PBEWITHSHA1AND256BITAES-CBC-BC"] = "PBEwithSHA-1and256bitAES-CBC-BC"; + algorithms["PBEWITHSHA-1AND256BITAES-CBC-BC"] = "PBEwithSHA-1and256bitAES-CBC-BC"; + algorithms["PBEWITHSHA256AND128BITAES-CBC-BC"] = "PBEwithSHA-256and128bitAES-CBC-BC"; + algorithms["PBEWITHSHA-256AND128BITAES-CBC-BC"] = "PBEwithSHA-256and128bitAES-CBC-BC"; + algorithms["PBEWITHSHA256AND192BITAES-CBC-BC"] = "PBEwithSHA-256and192bitAES-CBC-BC"; + algorithms["PBEWITHSHA-256AND192BITAES-CBC-BC"] = "PBEwithSHA-256and192bitAES-CBC-BC"; + algorithms["PBEWITHSHA256AND256BITAES-CBC-BC"] = "PBEwithSHA-256and256bitAES-CBC-BC"; + algorithms["PBEWITHSHA-256AND256BITAES-CBC-BC"] = "PBEwithSHA-256and256bitAES-CBC-BC"; + algorithms["PBEWITHSHAANDIDEA"] = "PBEwithSHA-1andIDEA-CBC"; + algorithms["PBEWITHSHAANDIDEA-CBC"] = "PBEwithSHA-1andIDEA-CBC"; + algorithms["PBEWITHSHAANDTWOFISH"] = "PBEwithSHA-1andTWOFISH-CBC"; + algorithms["PBEWITHSHAANDTWOFISH-CBC"] = "PBEwithSHA-1andTWOFISH-CBC"; + algorithms["PBEWITHHMACSHA1"] = "PBEwithHmacSHA-1"; + algorithms["PBEWITHHMACSHA-1"] = "PBEwithHmacSHA-1"; + algorithms[OiwObjectIdentifiers.IdSha1.Id] = "PBEwithHmacSHA-1"; + algorithms["PBEWITHHMACSHA224"] = "PBEwithHmacSHA-224"; + algorithms["PBEWITHHMACSHA-224"] = "PBEwithHmacSHA-224"; + algorithms[NistObjectIdentifiers.IdSha224.Id] = "PBEwithHmacSHA-224"; + algorithms["PBEWITHHMACSHA256"] = "PBEwithHmacSHA-256"; + algorithms["PBEWITHHMACSHA-256"] = "PBEwithHmacSHA-256"; + algorithms[NistObjectIdentifiers.IdSha256.Id] = "PBEwithHmacSHA-256"; + algorithms["PBEWITHHMACRIPEMD128"] = "PBEwithHmacRipeMD128"; + algorithms[TeleTrusTObjectIdentifiers.RipeMD128.Id] = "PBEwithHmacRipeMD128"; + algorithms["PBEWITHHMACRIPEMD160"] = "PBEwithHmacRipeMD160"; + algorithms[TeleTrusTObjectIdentifiers.RipeMD160.Id] = "PBEwithHmacRipeMD160"; + algorithms["PBEWITHHMACRIPEMD256"] = "PBEwithHmacRipeMD256"; + algorithms[TeleTrusTObjectIdentifiers.RipeMD256.Id] = "PBEwithHmacRipeMD256"; + algorithms["PBEWITHHMACTIGER"] = "PBEwithHmacTiger"; + + algorithms["PBEWITHMD5AND128BITAES-CBC-OPENSSL"] = "PBEwithMD5and128bitAES-CBC-OpenSSL"; + algorithms["PBEWITHMD5AND192BITAES-CBC-OPENSSL"] = "PBEwithMD5and192bitAES-CBC-OpenSSL"; + algorithms["PBEWITHMD5AND256BITAES-CBC-OPENSSL"] = "PBEwithMD5and256bitAES-CBC-OpenSSL"; + + algorithmType["Pkcs5scheme1"] = Pkcs5S1; + algorithmType["Pkcs5scheme2"] = Pkcs5S2; + algorithmType["PBEwithMD2andDES-CBC"] = Pkcs5S1; + algorithmType["PBEwithMD2andRC2-CBC"] = Pkcs5S1; + algorithmType["PBEwithMD5andDES-CBC"] = Pkcs5S1; + algorithmType["PBEwithMD5andRC2-CBC"] = Pkcs5S1; + algorithmType["PBEwithSHA-1andDES-CBC"] = Pkcs5S1; + algorithmType["PBEwithSHA-1andRC2-CBC"] = Pkcs5S1; + algorithmType["Pkcs12"] = Pkcs12; + algorithmType["PBEwithSHA-1and128bitRC4"] = Pkcs12; + algorithmType["PBEwithSHA-1and40bitRC4"] = Pkcs12; + algorithmType["PBEwithSHA-1and3-keyDESEDE-CBC"] = Pkcs12; + algorithmType["PBEwithSHA-1and2-keyDESEDE-CBC"] = Pkcs12; + algorithmType["PBEwithSHA-1and128bitRC2-CBC"] = Pkcs12; + algorithmType["PBEwithSHA-1and40bitRC2-CBC"] = Pkcs12; + algorithmType["PBEwithSHA-1and128bitAES-CBC-BC"] = Pkcs12; + algorithmType["PBEwithSHA-1and192bitAES-CBC-BC"] = Pkcs12; + algorithmType["PBEwithSHA-1and256bitAES-CBC-BC"] = Pkcs12; + algorithmType["PBEwithSHA-256and128bitAES-CBC-BC"] = Pkcs12; + algorithmType["PBEwithSHA-256and192bitAES-CBC-BC"] = Pkcs12; + algorithmType["PBEwithSHA-256and256bitAES-CBC-BC"] = Pkcs12; + algorithmType["PBEwithSHA-1andIDEA-CBC"] = Pkcs12; + algorithmType["PBEwithSHA-1andTWOFISH-CBC"] = Pkcs12; + algorithmType["PBEwithHmacSHA-1"] = Pkcs12; + algorithmType["PBEwithHmacSHA-224"] = Pkcs12; + algorithmType["PBEwithHmacSHA-256"] = Pkcs12; + algorithmType["PBEwithHmacRipeMD128"] = Pkcs12; + algorithmType["PBEwithHmacRipeMD160"] = Pkcs12; + algorithmType["PBEwithHmacRipeMD256"] = Pkcs12; + algorithmType["PBEwithHmacTiger"] = Pkcs12; + + algorithmType["PBEwithMD5and128bitAES-CBC-OpenSSL"] = OpenSsl; + algorithmType["PBEwithMD5and192bitAES-CBC-OpenSSL"] = OpenSsl; + algorithmType["PBEwithMD5and256bitAES-CBC-OpenSSL"] = OpenSsl; + + oids["PBEwithMD2andDES-CBC"] = PkcsObjectIdentifiers.PbeWithMD2AndDesCbc; + oids["PBEwithMD2andRC2-CBC"] = PkcsObjectIdentifiers.PbeWithMD2AndRC2Cbc; + oids["PBEwithMD5andDES-CBC"] = PkcsObjectIdentifiers.PbeWithMD5AndDesCbc; + oids["PBEwithMD5andRC2-CBC"] = PkcsObjectIdentifiers.PbeWithMD5AndRC2Cbc; + oids["PBEwithSHA-1andDES-CBC"] = PkcsObjectIdentifiers.PbeWithSha1AndDesCbc; + oids["PBEwithSHA-1andRC2-CBC"] = PkcsObjectIdentifiers.PbeWithSha1AndRC2Cbc; + oids["PBEwithSHA-1and128bitRC4"] = PkcsObjectIdentifiers.PbeWithShaAnd128BitRC4; + oids["PBEwithSHA-1and40bitRC4"] = PkcsObjectIdentifiers.PbeWithShaAnd40BitRC4; + oids["PBEwithSHA-1and3-keyDESEDE-CBC"] = PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc; + oids["PBEwithSHA-1and2-keyDESEDE-CBC"] = PkcsObjectIdentifiers.PbeWithShaAnd2KeyTripleDesCbc; + oids["PBEwithSHA-1and128bitRC2-CBC"] = PkcsObjectIdentifiers.PbeWithShaAnd128BitRC2Cbc; + oids["PBEwithSHA-1and40bitRC2-CBC"] = PkcsObjectIdentifiers.PbewithShaAnd40BitRC2Cbc; + oids["PBEwithHmacSHA-1"] = OiwObjectIdentifiers.IdSha1; + oids["PBEwithHmacSHA-224"] = NistObjectIdentifiers.IdSha224; + oids["PBEwithHmacSHA-256"] = NistObjectIdentifiers.IdSha256; + oids["PBEwithHmacRipeMD128"] = TeleTrusTObjectIdentifiers.RipeMD128; + oids["PBEwithHmacRipeMD160"] = TeleTrusTObjectIdentifiers.RipeMD160; + oids["PBEwithHmacRipeMD256"] = TeleTrusTObjectIdentifiers.RipeMD256; + oids["Pkcs5scheme2"] = PkcsObjectIdentifiers.IdPbeS2; + } + + static PbeParametersGenerator MakePbeGenerator( + string type, + IDigest digest, + byte[] key, + byte[] salt, + int iterationCount) + { + PbeParametersGenerator generator; + + if (type.Equals(Pkcs5S1)) + { + generator = new Pkcs5S1ParametersGenerator(digest); + } + else if (type.Equals(Pkcs5S2)) + { + generator = new Pkcs5S2ParametersGenerator(); + } + else if (type.Equals(Pkcs12)) + { + generator = new Pkcs12ParametersGenerator(digest); + } + else if (type.Equals(OpenSsl)) + { + generator = new OpenSslPbeParametersGenerator(); + } + else + { + throw new ArgumentException("Unknown PBE type: " + type, "type"); + } + + generator.Init(key, salt, iterationCount); + return generator; + } + + /// + /// Returns a ObjectIdentifier for a give encoding. + /// + /// A string representation of the encoding. + /// A DerObjectIdentifier, null if the Oid is not available. + public static DerObjectIdentifier GetObjectIdentifier( + string mechanism) + { + mechanism = (string) algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(mechanism)]; + if (mechanism != null) + { + return (DerObjectIdentifier)oids[mechanism]; + } + return null; + } + + public static ICollection Algorithms + { + get { return oids.Keys; } + } + + public static bool IsPkcs12( + string algorithm) + { + string mechanism = (string)algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + + return mechanism != null && Pkcs12.Equals(algorithmType[mechanism]); + } + + public static bool IsPkcs5Scheme1( + string algorithm) + { + string mechanism = (string)algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + + return mechanism != null && Pkcs5S1.Equals(algorithmType[mechanism]); + } + + public static bool IsPkcs5Scheme2( + string algorithm) + { + string mechanism = (string)algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + + return mechanism != null && Pkcs5S2.Equals(algorithmType[mechanism]); + } + + public static bool IsOpenSsl( + string algorithm) + { + string mechanism = (string)algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + + return mechanism != null && OpenSsl.Equals(algorithmType[mechanism]); + } + + public static bool IsPbeAlgorithm( + string algorithm) + { + string mechanism = (string)algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + + return mechanism != null && algorithmType[mechanism] != null; + } + + public static Asn1Encodable GenerateAlgorithmParameters( + DerObjectIdentifier algorithmOid, + byte[] salt, + int iterationCount) + { + return GenerateAlgorithmParameters(algorithmOid.Id, salt, iterationCount); + } + + public static Asn1Encodable GenerateAlgorithmParameters( + string algorithm, + byte[] salt, + int iterationCount) + { + if (IsPkcs12(algorithm)) + { + return new Pkcs12PbeParams(salt, iterationCount); + } + else if (IsPkcs5Scheme2(algorithm)) + { + return new Pbkdf2Params(salt, iterationCount); + } + else + { + return new PbeParameter(salt, iterationCount); + } + } + + public static ICipherParameters GenerateCipherParameters( + DerObjectIdentifier algorithmOid, + char[] password, + Asn1Encodable pbeParameters) + { + return GenerateCipherParameters(algorithmOid.Id, password, false, pbeParameters); + } + + public static ICipherParameters GenerateCipherParameters( + DerObjectIdentifier algorithmOid, + char[] password, + bool wrongPkcs12Zero, + Asn1Encodable pbeParameters) + { + return GenerateCipherParameters(algorithmOid.Id, password, wrongPkcs12Zero, pbeParameters); + } + + public static ICipherParameters GenerateCipherParameters( + AlgorithmIdentifier algID, + char[] password) + { + return GenerateCipherParameters(algID.Algorithm.Id, password, false, algID.Parameters); + } + + public static ICipherParameters GenerateCipherParameters( + AlgorithmIdentifier algID, + char[] password, + bool wrongPkcs12Zero) + { + return GenerateCipherParameters(algID.Algorithm.Id, password, wrongPkcs12Zero, algID.Parameters); + } + + public static ICipherParameters GenerateCipherParameters( + string algorithm, + char[] password, + Asn1Encodable pbeParameters) + { + return GenerateCipherParameters(algorithm, password, false, pbeParameters); + } + + public static ICipherParameters GenerateCipherParameters( + string algorithm, + char[] password, + bool wrongPkcs12Zero, + Asn1Encodable pbeParameters) + { + string mechanism = (string)algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + + byte[] keyBytes = null; + byte[] salt = null; + int iterationCount = 0; + + if (IsPkcs12(mechanism)) + { + Pkcs12PbeParams pbeParams = Pkcs12PbeParams.GetInstance(pbeParameters); + salt = pbeParams.GetIV(); + iterationCount = pbeParams.Iterations.IntValue; + keyBytes = PbeParametersGenerator.Pkcs12PasswordToBytes(password, wrongPkcs12Zero); + } + else if (IsPkcs5Scheme2(mechanism)) + { + // See below + } + else + { + PbeParameter pbeParams = PbeParameter.GetInstance(pbeParameters); + salt = pbeParams.GetSalt(); + iterationCount = pbeParams.IterationCount.IntValue; + keyBytes = PbeParametersGenerator.Pkcs5PasswordToBytes(password); + } + + ICipherParameters parameters = null; + + if (IsPkcs5Scheme2(mechanism)) + { + PbeS2Parameters s2p = PbeS2Parameters.GetInstance(pbeParameters.ToAsn1Object()); + AlgorithmIdentifier encScheme = s2p.EncryptionScheme; + DerObjectIdentifier encOid = encScheme.Algorithm; + Asn1Object encParams = encScheme.Parameters.ToAsn1Object(); + + // TODO What about s2p.KeyDerivationFunc.Algorithm? + Pbkdf2Params pbeParams = Pbkdf2Params.GetInstance(s2p.KeyDerivationFunc.Parameters.ToAsn1Object()); + + byte[] iv; + if (encOid.Equals(PkcsObjectIdentifiers.RC2Cbc)) // PKCS5.B.2.3 + { + RC2CbcParameter rc2Params = RC2CbcParameter.GetInstance(encParams); + iv = rc2Params.GetIV(); + } + else + { + iv = Asn1OctetString.GetInstance(encParams).GetOctets(); + } + + salt = pbeParams.GetSalt(); + iterationCount = pbeParams.IterationCount.IntValue; + keyBytes = PbeParametersGenerator.Pkcs5PasswordToBytes(password); + + int keyLength = pbeParams.KeyLength != null + ? pbeParams.KeyLength.IntValue * 8 + : GeneratorUtilities.GetDefaultKeySize(encOid); + + PbeParametersGenerator gen = MakePbeGenerator( + (string)algorithmType[mechanism], null, keyBytes, salt, iterationCount); + + parameters = gen.GenerateDerivedParameters(encOid.Id, keyLength); + + if (iv != null) + { + // FIXME? OpenSSL weirdness with IV of zeros (for ECB keys?) + if (Arrays.AreEqual(iv, new byte[iv.Length])) + { + //Console.Error.Write("***** IV all 0 (length " + iv.Length + ") *****"); + } + else + { + parameters = new ParametersWithIV(parameters, iv); + } + } + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithSHA-1")) + { + PbeParametersGenerator generator = MakePbeGenerator( + (string) algorithmType[mechanism], new Sha1Digest(), keyBytes, salt, iterationCount); + + if (mechanism.Equals("PBEwithSHA-1and128bitAES-CBC-BC")) + { + parameters = generator.GenerateDerivedParameters("AES", 128, 128); + } + else if (mechanism.Equals("PBEwithSHA-1and192bitAES-CBC-BC")) + { + parameters = generator.GenerateDerivedParameters("AES", 192, 128); + } + else if (mechanism.Equals("PBEwithSHA-1and256bitAES-CBC-BC")) + { + parameters = generator.GenerateDerivedParameters("AES", 256, 128); + } + else if (mechanism.Equals("PBEwithSHA-1and128bitRC4")) + { + parameters = generator.GenerateDerivedParameters("RC4", 128); + } + else if (mechanism.Equals("PBEwithSHA-1and40bitRC4")) + { + parameters = generator.GenerateDerivedParameters("RC4", 40); + } + else if (mechanism.Equals("PBEwithSHA-1and3-keyDESEDE-CBC")) + { + parameters = generator.GenerateDerivedParameters("DESEDE", 192, 64); + } + else if (mechanism.Equals("PBEwithSHA-1and2-keyDESEDE-CBC")) + { + parameters = generator.GenerateDerivedParameters("DESEDE", 128, 64); + } + else if (mechanism.Equals("PBEwithSHA-1and128bitRC2-CBC")) + { + parameters = generator.GenerateDerivedParameters("RC2", 128, 64); + } + else if (mechanism.Equals("PBEwithSHA-1and40bitRC2-CBC")) + { + parameters = generator.GenerateDerivedParameters("RC2", 40, 64); + } + else if (mechanism.Equals("PBEwithSHA-1andDES-CBC")) + { + parameters = generator.GenerateDerivedParameters("DES", 64, 64); + } + else if (mechanism.Equals("PBEwithSHA-1andRC2-CBC")) + { + parameters = generator.GenerateDerivedParameters("RC2", 64, 64); + } + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithSHA-256")) + { + PbeParametersGenerator generator = MakePbeGenerator( + (string) algorithmType[mechanism], new Sha256Digest(), keyBytes, salt, iterationCount); + + if (mechanism.Equals("PBEwithSHA-256and128bitAES-CBC-BC")) + { + parameters = generator.GenerateDerivedParameters("AES", 128, 128); + } + else if (mechanism.Equals("PBEwithSHA-256and192bitAES-CBC-BC")) + { + parameters = generator.GenerateDerivedParameters("AES", 192, 128); + } + else if (mechanism.Equals("PBEwithSHA-256and256bitAES-CBC-BC")) + { + parameters = generator.GenerateDerivedParameters("AES", 256, 128); + } + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithMD5")) + { + PbeParametersGenerator generator = MakePbeGenerator( + (string)algorithmType[mechanism], new MD5Digest(), keyBytes, salt, iterationCount); + + if (mechanism.Equals("PBEwithMD5andDES-CBC")) + { + parameters = generator.GenerateDerivedParameters("DES", 64, 64); + } + else if (mechanism.Equals("PBEwithMD5andRC2-CBC")) + { + parameters = generator.GenerateDerivedParameters("RC2", 64, 64); + } + else if (mechanism.Equals("PBEwithMD5and128bitAES-CBC-OpenSSL")) + { + parameters = generator.GenerateDerivedParameters("AES", 128, 128); + } + else if (mechanism.Equals("PBEwithMD5and192bitAES-CBC-OpenSSL")) + { + parameters = generator.GenerateDerivedParameters("AES", 192, 128); + } + else if (mechanism.Equals("PBEwithMD5and256bitAES-CBC-OpenSSL")) + { + parameters = generator.GenerateDerivedParameters("AES", 256, 128); + } + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithMD2")) + { + PbeParametersGenerator generator = MakePbeGenerator( + (string)algorithmType[mechanism], new MD2Digest(), keyBytes, salt, iterationCount); + if (mechanism.Equals("PBEwithMD2andDES-CBC")) + { + parameters = generator.GenerateDerivedParameters("DES", 64, 64); + } + else if (mechanism.Equals("PBEwithMD2andRC2-CBC")) + { + parameters = generator.GenerateDerivedParameters("RC2", 64, 64); + } + } + else if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithHmac")) + { + string digestName = mechanism.Substring("PBEwithHmac".Length); + IDigest digest = DigestUtilities.GetDigest(digestName); + + PbeParametersGenerator generator = MakePbeGenerator( + (string) algorithmType[mechanism], digest, keyBytes, salt, iterationCount); + + int bitLen = digest.GetDigestSize() * 8; + parameters = generator.GenerateDerivedMacParameters(bitLen); + } + + Array.Clear(keyBytes, 0, keyBytes.Length); + + return FixDesParity(mechanism, parameters); + } + + public static object CreateEngine( + DerObjectIdentifier algorithmOid) + { + return CreateEngine(algorithmOid.Id); + } + + public static object CreateEngine( + AlgorithmIdentifier algID) + { + string algorithm = algID.Algorithm.Id; + + if (IsPkcs5Scheme2(algorithm)) + { + PbeS2Parameters s2p = PbeS2Parameters.GetInstance(algID.Parameters.ToAsn1Object()); + AlgorithmIdentifier encScheme = s2p.EncryptionScheme; + return CipherUtilities.GetCipher(encScheme.Algorithm); + } + + return CreateEngine(algorithm); + } + + public static object CreateEngine( + string algorithm) + { + string mechanism = (string)algorithms[BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm)]; + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithHmac")) + { + string digestName = mechanism.Substring("PBEwithHmac".Length); + + return MacUtilities.GetMac("HMAC/" + digestName); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithMD2") + || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithMD5") + || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithSHA-1") + || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "PBEwithSHA-256")) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "AES-CBC-BC") || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "AES-CBC-OPENSSL")) + { + return CipherUtilities.GetCipher("AES/CBC"); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "DES-CBC")) + { + return CipherUtilities.GetCipher("DES/CBC"); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "DESEDE-CBC")) + { + return CipherUtilities.GetCipher("DESEDE/CBC"); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "RC2-CBC")) + { + return CipherUtilities.GetCipher("RC2/CBC"); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "RC4")) + { + return CipherUtilities.GetCipher("RC4"); + } + } + + return null; + } + + public static string GetEncodingName( + DerObjectIdentifier oid) + { + return (string) algorithms[oid.Id]; + } + + private static ICipherParameters FixDesParity(string mechanism, ICipherParameters parameters) + { + if (!BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "DES-CBC") && !BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "DESEDE-CBC")) + { + return parameters; + } + + if (parameters is ParametersWithIV) + { + ParametersWithIV ivParams = (ParametersWithIV)parameters; + return new ParametersWithIV(FixDesParity(mechanism, ivParams.Parameters), ivParams.GetIV()); + } + + KeyParameter kParam = (KeyParameter)parameters; + byte[] keyBytes = kParam.GetKey(); + DesParameters.SetOddParity(keyBytes); + return new KeyParameter(keyBytes); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PbeUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PbeUtilities.cs.meta new file mode 100644 index 00000000..bd4dbdac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PbeUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfc85a93228ca944eb2c23feecec2821 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PrivateKeyFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PrivateKeyFactory.cs new file mode 100644 index 00000000..f8da7483 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PrivateKeyFactory.cs @@ -0,0 +1,259 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.EdEC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + public sealed class PrivateKeyFactory + { + private PrivateKeyFactory() + { + } + + public static AsymmetricKeyParameter CreateKey( + byte[] privateKeyInfoData) + { + return CreateKey( + PrivateKeyInfo.GetInstance( + Asn1Object.FromByteArray(privateKeyInfoData))); + } + + public static AsymmetricKeyParameter CreateKey( + Stream inStr) + { + return CreateKey( + PrivateKeyInfo.GetInstance( + Asn1Object.FromStream(inStr))); + } + + public static AsymmetricKeyParameter CreateKey( + PrivateKeyInfo keyInfo) + { + AlgorithmIdentifier algID = keyInfo.PrivateKeyAlgorithm; + DerObjectIdentifier algOid = algID.Algorithm; + + // TODO See RSAUtil.isRsaOid in Java build + if (algOid.Equals(PkcsObjectIdentifiers.RsaEncryption) + || algOid.Equals(X509ObjectIdentifiers.IdEARsa) + || algOid.Equals(PkcsObjectIdentifiers.IdRsassaPss) + || algOid.Equals(PkcsObjectIdentifiers.IdRsaesOaep)) + { + RsaPrivateKeyStructure keyStructure = RsaPrivateKeyStructure.GetInstance(keyInfo.ParsePrivateKey()); + + return new RsaPrivateCrtKeyParameters( + keyStructure.Modulus, + keyStructure.PublicExponent, + keyStructure.PrivateExponent, + keyStructure.Prime1, + keyStructure.Prime2, + keyStructure.Exponent1, + keyStructure.Exponent2, + keyStructure.Coefficient); + } + // TODO? +// else if (algOid.Equals(X9ObjectIdentifiers.DHPublicNumber)) + else if (algOid.Equals(PkcsObjectIdentifiers.DhKeyAgreement)) + { + DHParameter para = new DHParameter( + Asn1Sequence.GetInstance(algID.Parameters.ToAsn1Object())); + DerInteger derX = (DerInteger)keyInfo.ParsePrivateKey(); + + BigInteger lVal = para.L; + int l = lVal == null ? 0 : lVal.IntValue; + DHParameters dhParams = new DHParameters(para.P, para.G, null, l); + + return new DHPrivateKeyParameters(derX.Value, dhParams, algOid); + } + else if (algOid.Equals(OiwObjectIdentifiers.ElGamalAlgorithm)) + { + ElGamalParameter para = new ElGamalParameter( + Asn1Sequence.GetInstance(algID.Parameters.ToAsn1Object())); + DerInteger derX = (DerInteger)keyInfo.ParsePrivateKey(); + + return new ElGamalPrivateKeyParameters( + derX.Value, + new ElGamalParameters(para.P, para.G)); + } + else if (algOid.Equals(X9ObjectIdentifiers.IdDsa)) + { + DerInteger derX = (DerInteger)keyInfo.ParsePrivateKey(); + Asn1Encodable ae = algID.Parameters; + + DsaParameters parameters = null; + if (ae != null) + { + DsaParameter para = DsaParameter.GetInstance(ae.ToAsn1Object()); + parameters = new DsaParameters(para.P, para.Q, para.G); + } + + return new DsaPrivateKeyParameters(derX.Value, parameters); + } + else if (algOid.Equals(X9ObjectIdentifiers.IdECPublicKey)) + { + X962Parameters para = new X962Parameters(algID.Parameters.ToAsn1Object()); + + X9ECParameters x9; + if (para.IsNamedCurve) + { + x9 = ECKeyPairGenerator.FindECCurveByOid((DerObjectIdentifier)para.Parameters); + } + else + { + x9 = new X9ECParameters((Asn1Sequence)para.Parameters); + } + + ECPrivateKeyStructure ec = ECPrivateKeyStructure.GetInstance(keyInfo.ParsePrivateKey()); + BigInteger d = ec.GetKey(); + + if (para.IsNamedCurve) + { + return new ECPrivateKeyParameters("EC", d, (DerObjectIdentifier)para.Parameters); + } + + ECDomainParameters dParams = new ECDomainParameters(x9.Curve, x9.G, x9.N, x9.H, x9.GetSeed()); + return new ECPrivateKeyParameters(d, dParams); + } + else if (algOid.Equals(CryptoProObjectIdentifiers.GostR3410x2001)) + { + Gost3410PublicKeyAlgParameters gostParams = new Gost3410PublicKeyAlgParameters( + Asn1Sequence.GetInstance(algID.Parameters.ToAsn1Object())); + + ECDomainParameters ecP = ECGost3410NamedCurves.GetByOid(gostParams.PublicKeyParamSet); + + if (ecP == null) + throw new ArgumentException("Unrecognized curve OID for GostR3410x2001 private key"); + + Asn1Object privKey = keyInfo.ParsePrivateKey(); + ECPrivateKeyStructure ec; + + if (privKey is DerInteger) + { + ec = new ECPrivateKeyStructure(ecP.N.BitLength, ((DerInteger)privKey).PositiveValue); + } + else + { + ec = ECPrivateKeyStructure.GetInstance(privKey); + } + + return new ECPrivateKeyParameters("ECGOST3410", ec.GetKey(), gostParams.PublicKeyParamSet); + } + else if (algOid.Equals(CryptoProObjectIdentifiers.GostR3410x94)) + { + Gost3410PublicKeyAlgParameters gostParams = Gost3410PublicKeyAlgParameters.GetInstance(algID.Parameters); + + Asn1Object privKey = keyInfo.ParsePrivateKey(); + BigInteger x; + + if (privKey is DerInteger) + { + x = DerInteger.GetInstance(privKey).PositiveValue; + } + else + { + x = new BigInteger(1, Arrays.Reverse(Asn1OctetString.GetInstance(privKey).GetOctets())); + } + + return new Gost3410PrivateKeyParameters(x, gostParams.PublicKeyParamSet); + } + else if (algOid.Equals(EdECObjectIdentifiers.id_X25519)) + { + return new X25519PrivateKeyParameters(GetRawKey(keyInfo, X25519PrivateKeyParameters.KeySize), 0); + } + else if (algOid.Equals(EdECObjectIdentifiers.id_X448)) + { + return new X448PrivateKeyParameters(GetRawKey(keyInfo, X448PrivateKeyParameters.KeySize), 0); + } + else if (algOid.Equals(EdECObjectIdentifiers.id_Ed25519)) + { + return new Ed25519PrivateKeyParameters(GetRawKey(keyInfo, Ed25519PrivateKeyParameters.KeySize), 0); + } + else if (algOid.Equals(EdECObjectIdentifiers.id_Ed448)) + { + return new Ed448PrivateKeyParameters(GetRawKey(keyInfo, Ed448PrivateKeyParameters.KeySize), 0); + } + else + { + throw new SecurityUtilityException("algorithm identifier in private key not recognised"); + } + } + + private static byte[] GetRawKey(PrivateKeyInfo keyInfo, int expectedSize) + { + byte[] result = Asn1OctetString.GetInstance(keyInfo.ParsePrivateKey()).GetOctets(); + if (expectedSize != result.Length) + throw new SecurityUtilityException("private key encoding has incorrect length"); + + return result; + } + + public static AsymmetricKeyParameter DecryptKey( + char[] passPhrase, + EncryptedPrivateKeyInfo encInfo) + { + return CreateKey(PrivateKeyInfoFactory.CreatePrivateKeyInfo(passPhrase, encInfo)); + } + + public static AsymmetricKeyParameter DecryptKey( + char[] passPhrase, + byte[] encryptedPrivateKeyInfoData) + { + return DecryptKey(passPhrase, Asn1Object.FromByteArray(encryptedPrivateKeyInfoData)); + } + + public static AsymmetricKeyParameter DecryptKey( + char[] passPhrase, + Stream encryptedPrivateKeyInfoStream) + { + return DecryptKey(passPhrase, Asn1Object.FromStream(encryptedPrivateKeyInfoStream)); + } + + private static AsymmetricKeyParameter DecryptKey( + char[] passPhrase, + Asn1Object asn1Object) + { + return DecryptKey(passPhrase, EncryptedPrivateKeyInfo.GetInstance(asn1Object)); + } + + public static byte[] EncryptKey( + DerObjectIdentifier algorithm, + char[] passPhrase, + byte[] salt, + int iterationCount, + AsymmetricKeyParameter key) + { + return EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo( + algorithm, passPhrase, salt, iterationCount, key).GetEncoded(); + } + + public static byte[] EncryptKey( + string algorithm, + char[] passPhrase, + byte[] salt, + int iterationCount, + AsymmetricKeyParameter key) + { + return EncryptedPrivateKeyInfoFactory.CreateEncryptedPrivateKeyInfo( + algorithm, passPhrase, salt, iterationCount, key).GetEncoded(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PrivateKeyFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PrivateKeyFactory.cs.meta new file mode 100644 index 00000000..6c6f2ca9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PrivateKeyFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c8352ae57e5012f4a946e51451ff22a2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PublicKeyFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PublicKeyFactory.cs new file mode 100644 index 00000000..e57fa9d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PublicKeyFactory.cs @@ -0,0 +1,287 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.EdEC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Sec; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Generators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + public sealed class PublicKeyFactory + { + private PublicKeyFactory() + { + } + + public static AsymmetricKeyParameter CreateKey( + byte[] keyInfoData) + { + return CreateKey( + SubjectPublicKeyInfo.GetInstance( + Asn1Object.FromByteArray(keyInfoData))); + } + + public static AsymmetricKeyParameter CreateKey( + Stream inStr) + { + return CreateKey( + SubjectPublicKeyInfo.GetInstance( + Asn1Object.FromStream(inStr))); + } + + public static AsymmetricKeyParameter CreateKey( + SubjectPublicKeyInfo keyInfo) + { + AlgorithmIdentifier algID = keyInfo.AlgorithmID; + DerObjectIdentifier algOid = algID.Algorithm; + + // TODO See RSAUtil.isRsaOid in Java build + if (algOid.Equals(PkcsObjectIdentifiers.RsaEncryption) + || algOid.Equals(X509ObjectIdentifiers.IdEARsa) + || algOid.Equals(PkcsObjectIdentifiers.IdRsassaPss) + || algOid.Equals(PkcsObjectIdentifiers.IdRsaesOaep)) + { + RsaPublicKeyStructure pubKey = RsaPublicKeyStructure.GetInstance( + keyInfo.GetPublicKey()); + + return new RsaKeyParameters(false, pubKey.Modulus, pubKey.PublicExponent); + } + else if (algOid.Equals(X9ObjectIdentifiers.DHPublicNumber)) + { + Asn1Sequence seq = Asn1Sequence.GetInstance(algID.Parameters.ToAsn1Object()); + + DHPublicKey dhPublicKey = DHPublicKey.GetInstance(keyInfo.GetPublicKey()); + + BigInteger y = dhPublicKey.Y.Value; + + if (IsPkcsDHParam(seq)) + return ReadPkcsDHParam(algOid, y, seq); + + DHDomainParameters dhParams = DHDomainParameters.GetInstance(seq); + + BigInteger p = dhParams.P.Value; + BigInteger g = dhParams.G.Value; + BigInteger q = dhParams.Q.Value; + + BigInteger j = null; + if (dhParams.J != null) + { + j = dhParams.J.Value; + } + + DHValidationParameters validation = null; + DHValidationParms dhValidationParms = dhParams.ValidationParms; + if (dhValidationParms != null) + { + byte[] seed = dhValidationParms.Seed.GetBytes(); + BigInteger pgenCounter = dhValidationParms.PgenCounter.Value; + + // TODO Check pgenCounter size? + + validation = new DHValidationParameters(seed, pgenCounter.IntValue); + } + + return new DHPublicKeyParameters(y, new DHParameters(p, g, q, j, validation)); + } + else if (algOid.Equals(PkcsObjectIdentifiers.DhKeyAgreement)) + { + Asn1Sequence seq = Asn1Sequence.GetInstance(algID.Parameters.ToAsn1Object()); + + DerInteger derY = (DerInteger) keyInfo.GetPublicKey(); + + return ReadPkcsDHParam(algOid, derY.Value, seq); + } + else if (algOid.Equals(OiwObjectIdentifiers.ElGamalAlgorithm)) + { + ElGamalParameter para = new ElGamalParameter( + Asn1Sequence.GetInstance(algID.Parameters.ToAsn1Object())); + DerInteger derY = (DerInteger) keyInfo.GetPublicKey(); + + return new ElGamalPublicKeyParameters( + derY.Value, + new ElGamalParameters(para.P, para.G)); + } + else if (algOid.Equals(X9ObjectIdentifiers.IdDsa) + || algOid.Equals(OiwObjectIdentifiers.DsaWithSha1)) + { + DerInteger derY = (DerInteger) keyInfo.GetPublicKey(); + Asn1Encodable ae = algID.Parameters; + + DsaParameters parameters = null; + if (ae != null) + { + DsaParameter para = DsaParameter.GetInstance(ae.ToAsn1Object()); + parameters = new DsaParameters(para.P, para.Q, para.G); + } + + return new DsaPublicKeyParameters(derY.Value, parameters); + } + else if (algOid.Equals(X9ObjectIdentifiers.IdECPublicKey)) + { + X962Parameters para = new X962Parameters(algID.Parameters.ToAsn1Object()); + + X9ECParameters x9; + if (para.IsNamedCurve) + { + x9 = ECKeyPairGenerator.FindECCurveByOid((DerObjectIdentifier)para.Parameters); + } + else + { + x9 = new X9ECParameters((Asn1Sequence)para.Parameters); + } + + Asn1OctetString key = new DerOctetString(keyInfo.PublicKeyData.GetBytes()); + X9ECPoint derQ = new X9ECPoint(x9.Curve, key); + ECPoint q = derQ.Point; + + if (para.IsNamedCurve) + { + return new ECPublicKeyParameters("EC", q, (DerObjectIdentifier)para.Parameters); + } + + ECDomainParameters dParams = new ECDomainParameters(x9.Curve, x9.G, x9.N, x9.H, x9.GetSeed()); + return new ECPublicKeyParameters(q, dParams); + } + else if (algOid.Equals(CryptoProObjectIdentifiers.GostR3410x2001)) + { + Gost3410PublicKeyAlgParameters gostParams = new Gost3410PublicKeyAlgParameters( + (Asn1Sequence) algID.Parameters); + + Asn1OctetString key; + try + { + key = (Asn1OctetString) keyInfo.GetPublicKey(); + } + catch (IOException) + { + throw new ArgumentException("invalid info structure in GOST3410 public key"); + } + + byte[] keyEnc = key.GetOctets(); + byte[] x = new byte[32]; + byte[] y = new byte[32]; + + for (int i = 0; i != y.Length; i++) + { + x[i] = keyEnc[32 - 1 - i]; + } + + for (int i = 0; i != x.Length; i++) + { + y[i] = keyEnc[64 - 1 - i]; + } + + ECDomainParameters ecP = ECGost3410NamedCurves.GetByOid(gostParams.PublicKeyParamSet); + + if (ecP == null) + return null; + + ECPoint q = ecP.Curve.CreatePoint(new BigInteger(1, x), new BigInteger(1, y)); + + return new ECPublicKeyParameters("ECGOST3410", q, gostParams.PublicKeyParamSet); + } + else if (algOid.Equals(CryptoProObjectIdentifiers.GostR3410x94)) + { + Gost3410PublicKeyAlgParameters algParams = new Gost3410PublicKeyAlgParameters( + (Asn1Sequence) algID.Parameters); + + DerOctetString derY; + try + { + derY = (DerOctetString) keyInfo.GetPublicKey(); + } + catch (IOException) + { + throw new ArgumentException("invalid info structure in GOST3410 public key"); + } + + byte[] keyEnc = derY.GetOctets(); + byte[] keyBytes = new byte[keyEnc.Length]; + + for (int i = 0; i != keyEnc.Length; i++) + { + keyBytes[i] = keyEnc[keyEnc.Length - 1 - i]; // was little endian + } + + BigInteger y = new BigInteger(1, keyBytes); + + return new Gost3410PublicKeyParameters(y, algParams.PublicKeyParamSet); + } + else if (algOid.Equals(EdECObjectIdentifiers.id_X25519)) + { + return new X25519PublicKeyParameters(GetRawKey(keyInfo, X25519PublicKeyParameters.KeySize), 0); + } + else if (algOid.Equals(EdECObjectIdentifiers.id_X448)) + { + return new X448PublicKeyParameters(GetRawKey(keyInfo, X448PublicKeyParameters.KeySize), 0); + } + else if (algOid.Equals(EdECObjectIdentifiers.id_Ed25519)) + { + return new Ed25519PublicKeyParameters(GetRawKey(keyInfo, Ed25519PublicKeyParameters.KeySize), 0); + } + else if (algOid.Equals(EdECObjectIdentifiers.id_Ed448)) + { + return new Ed448PublicKeyParameters(GetRawKey(keyInfo, Ed448PublicKeyParameters.KeySize), 0); + } + else + { + throw new SecurityUtilityException("algorithm identifier in public key not recognised: " + algOid); + } + } + + private static byte[] GetRawKey(SubjectPublicKeyInfo keyInfo, int expectedSize) + { + /* + * TODO[RFC 8422] + * - Require keyInfo.Algorithm.Parameters == null? + */ + byte[] result = keyInfo.PublicKeyData.GetOctets(); + if (expectedSize != result.Length) + throw new SecurityUtilityException("public key encoding has incorrect length"); + + return result; + } + + private static bool IsPkcsDHParam(Asn1Sequence seq) + { + if (seq.Count == 2) + return true; + + if (seq.Count > 3) + return false; + + DerInteger l = DerInteger.GetInstance(seq[2]); + DerInteger p = DerInteger.GetInstance(seq[0]); + + return l.Value.CompareTo(BigInteger.ValueOf(p.Value.BitLength)) <= 0; + } + + private static DHPublicKeyParameters ReadPkcsDHParam(DerObjectIdentifier algOid, + BigInteger y, Asn1Sequence seq) + { + DHParameter para = new DHParameter(seq); + + BigInteger lVal = para.L; + int l = lVal == null ? 0 : lVal.IntValue; + DHParameters dhParams = new DHParameters(para.P, para.G, null, l); + + return new DHPublicKeyParameters(y, dhParams, algOid); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PublicKeyFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PublicKeyFactory.cs.meta new file mode 100644 index 00000000..b5b6405a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/PublicKeyFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bd0cb884524a32c429146ce48d62f30d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecureRandom.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecureRandom.cs new file mode 100644 index 00000000..90590d71 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecureRandom.cs @@ -0,0 +1,266 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Threading; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Prng; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + public class SecureRandom + : Random + { + private static long counter = Times.NanoTime(); + +#if NETCF_1_0 || PORTABLE || NETFX_CORE + private static object counterLock = new object(); + private static long NextCounterValue() + { + lock (counterLock) + { + return ++counter; + } + } + + private static readonly SecureRandom[] master = { null }; + private static SecureRandom Master + { + get + { + lock (master) + { + if (master[0] == null) + { + SecureRandom sr = master[0] = GetInstance("SHA256PRNG", false); + + // Even though Ticks has at most 8 or 14 bits of entropy, there's no harm in adding it. + sr.SetSeed(DateTime.Now.Ticks); + + // 32 will be enough when ThreadedSeedGenerator is fixed. Until then, ThreadedSeedGenerator returns low + // entropy, and this is not sufficient to be secure. http://www.bouncycastle.org/csharpdevmailarchive/msg00814.html + sr.SetSeed(new ThreadedSeedGenerator().GenerateSeed(32, true)); + } + + return master[0]; + } + } + } +#else + private static long NextCounterValue() + { + return Interlocked.Increment(ref counter); + } + + private static readonly SecureRandom master = new SecureRandom(new CryptoApiRandomGenerator()); + private static SecureRandom Master + { + get { return master; } + } +#endif + + private static DigestRandomGenerator CreatePrng(string digestName, bool autoSeed) + { + IDigest digest = DigestUtilities.GetDigest(digestName); + if (digest == null) + return null; + DigestRandomGenerator prng = new DigestRandomGenerator(digest); + if (autoSeed) + { + prng.AddSeedMaterial(NextCounterValue()); + prng.AddSeedMaterial(GetNextBytes(Master, digest.GetDigestSize())); + } + return prng; + } + + public static byte[] GetNextBytes(SecureRandom secureRandom, int length) + { + byte[] result = new byte[length]; + secureRandom.NextBytes(result); + return result; + } + + /// + /// Create and auto-seed an instance based on the given algorithm. + /// + /// Equivalent to GetInstance(algorithm, true) + /// e.g. "SHA256PRNG" + public static SecureRandom GetInstance(string algorithm) + { + return GetInstance(algorithm, true); + } + + /// + /// Create an instance based on the given algorithm, with optional auto-seeding + /// + /// e.g. "SHA256PRNG" + /// If true, the instance will be auto-seeded. + public static SecureRandom GetInstance(string algorithm, bool autoSeed) + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(upper, "PRNG")) + { + string digestName = upper.Substring(0, upper.Length - "PRNG".Length); + DigestRandomGenerator prng = CreatePrng(digestName, autoSeed); + if (prng != null) + { + return new SecureRandom(prng); + } + } + + throw new ArgumentException("Unrecognised PRNG algorithm: " + algorithm, "algorithm"); + } + + [Obsolete("Call GenerateSeed() on a SecureRandom instance instead")] + public static byte[] GetSeed(int length) + { + return GetNextBytes(Master, length); + } + + protected readonly IRandomGenerator generator; + + public SecureRandom() + : this(CreatePrng("SHA256", true)) + { + } + + /// + /// To replicate existing predictable output, replace with GetInstance("SHA1PRNG", false), followed by SetSeed(seed) + /// + [Obsolete("Use GetInstance/SetSeed instead")] + public SecureRandom(byte[] seed) + : this(CreatePrng("SHA1", false)) + { + SetSeed(seed); + } + + /// Use the specified instance of IRandomGenerator as random source. + /// + /// This constructor performs no seeding of either the IRandomGenerator or the + /// constructed SecureRandom. It is the responsibility of the client to provide + /// proper seed material as necessary/appropriate for the given IRandomGenerator + /// implementation. + /// + /// The source to generate all random bytes from. + public SecureRandom(IRandomGenerator generator) + : base(0) + { + this.generator = generator; + } + + public virtual byte[] GenerateSeed(int length) + { + return GetNextBytes(Master, length); + } + + public virtual void SetSeed(byte[] seed) + { + generator.AddSeedMaterial(seed); + } + + public virtual void SetSeed(long seed) + { + generator.AddSeedMaterial(seed); + } + + public override int Next() + { + return NextInt() & int.MaxValue; + } + + public override int Next(int maxValue) + { + + if (maxValue < 2) + { + if (maxValue < 0) + throw new ArgumentOutOfRangeException("maxValue", "cannot be negative"); + + return 0; + } + + int bits; + + // Test whether maxValue is a power of 2 + if ((maxValue & (maxValue - 1)) == 0) + { + bits = NextInt() & int.MaxValue; + return (int)(((long)bits * maxValue) >> 31); + } + + int result; + do + { + bits = NextInt() & int.MaxValue; + result = bits % maxValue; + } + while (bits - result + (maxValue - 1) < 0); // Ignore results near overflow + + return result; + } + + public override int Next(int minValue, int maxValue) + { + if (maxValue <= minValue) + { + if (maxValue == minValue) + return minValue; + + throw new ArgumentException("maxValue cannot be less than minValue"); + } + + int diff = maxValue - minValue; + if (diff > 0) + return minValue + Next(diff); + + for (;;) + { + int i = NextInt(); + + if (i >= minValue && i < maxValue) + return i; + } + } + + public override void NextBytes(byte[] buf) + { + generator.NextBytes(buf); + } + + public virtual void NextBytes(byte[] buf, int off, int len) + { + generator.NextBytes(buf, off, len); + } + + private static readonly double DoubleScale = System.Math.Pow(2.0, 64.0); + + public override double NextDouble() + { + return Convert.ToDouble((ulong) NextLong()) / DoubleScale; + } + + public virtual int NextInt() + { + byte[] bytes = new byte[4]; + NextBytes(bytes); + + uint result = bytes[0]; + result <<= 8; + result |= bytes[1]; + result <<= 8; + result |= bytes[2]; + result <<= 8; + result |= bytes[3]; + return (int)result; + } + + public virtual long NextLong() + { + return ((long)(uint) NextInt() << 32) | (long)(uint) NextInt(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecureRandom.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecureRandom.cs.meta new file mode 100644 index 00000000..13d3f23c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecureRandom.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dad6d1b180992fa4bbefb141195487f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecurityUtilityException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecurityUtilityException.cs new file mode 100644 index 00000000..d5a19d8a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecurityUtilityException.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class SecurityUtilityException + : Exception + { + /** + * base constructor. + */ + public SecurityUtilityException() + { + } + + /** + * create a SecurityUtilityException with the given message. + * + * @param message the message to be carried with the exception. + */ + public SecurityUtilityException( + string message) + : base(message) + { + } + + public SecurityUtilityException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecurityUtilityException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecurityUtilityException.cs.meta new file mode 100644 index 00000000..8199f5d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SecurityUtilityException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 776c8efaf8c3b3843aa42677ef63afd3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignatureException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignatureException.cs new file mode 100644 index 00000000..12849655 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignatureException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class SignatureException : GeneralSecurityException + { + public SignatureException() : base() { } + public SignatureException(string message) : base(message) { } + public SignatureException(string message, Exception exception) : base(message, exception) { } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignatureException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignatureException.cs.meta new file mode 100644 index 00000000..4fc1b8ef --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignatureException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 464c53a8485e7d44e828bede8f580c3b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignerUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignerUtilities.cs new file mode 100644 index 00000000..f64e3d42 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignerUtilities.cs @@ -0,0 +1,640 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Bsi; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Eac; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.EdEC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Digests; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Signers; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + /// + /// Signer Utility class contains methods that can not be specifically grouped into other classes. + /// + public sealed class SignerUtilities + { + private SignerUtilities() + { + } + + internal static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + internal static readonly IDictionary oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static SignerUtilities() + { + algorithms["MD2WITHRSA"] = "MD2withRSA"; + algorithms["MD2WITHRSAENCRYPTION"] = "MD2withRSA"; + algorithms[PkcsObjectIdentifiers.MD2WithRsaEncryption.Id] = "MD2withRSA"; + + algorithms["MD4WITHRSA"] = "MD4withRSA"; + algorithms["MD4WITHRSAENCRYPTION"] = "MD4withRSA"; + algorithms[PkcsObjectIdentifiers.MD4WithRsaEncryption.Id] = "MD4withRSA"; + algorithms[OiwObjectIdentifiers.MD4WithRsa.Id] = "MD4withRSA"; + algorithms[OiwObjectIdentifiers.MD4WithRsaEncryption.Id] = "MD4withRSA"; + + algorithms["MD5WITHRSA"] = "MD5withRSA"; + algorithms["MD5WITHRSAENCRYPTION"] = "MD5withRSA"; + algorithms[PkcsObjectIdentifiers.MD5WithRsaEncryption.Id] = "MD5withRSA"; + algorithms[OiwObjectIdentifiers.MD5WithRsa.Id] = "MD5withRSA"; + + algorithms["SHA1WITHRSA"] = "SHA-1withRSA"; + algorithms["SHA1WITHRSAENCRYPTION"] = "SHA-1withRSA"; + algorithms["SHA-1WITHRSA"] = "SHA-1withRSA"; + algorithms[PkcsObjectIdentifiers.Sha1WithRsaEncryption.Id] = "SHA-1withRSA"; + algorithms[OiwObjectIdentifiers.Sha1WithRsa.Id] = "SHA-1withRSA"; + + algorithms["SHA224WITHRSA"] = "SHA-224withRSA"; + algorithms["SHA224WITHRSAENCRYPTION"] = "SHA-224withRSA"; + algorithms[PkcsObjectIdentifiers.Sha224WithRsaEncryption.Id] = "SHA-224withRSA"; + algorithms["SHA-224WITHRSA"] = "SHA-224withRSA"; + + algorithms["SHA256WITHRSA"] = "SHA-256withRSA"; + algorithms["SHA256WITHRSAENCRYPTION"] = "SHA-256withRSA"; + algorithms[PkcsObjectIdentifiers.Sha256WithRsaEncryption.Id] = "SHA-256withRSA"; + algorithms["SHA-256WITHRSA"] = "SHA-256withRSA"; + + algorithms["SHA384WITHRSA"] = "SHA-384withRSA"; + algorithms["SHA384WITHRSAENCRYPTION"] = "SHA-384withRSA"; + algorithms[PkcsObjectIdentifiers.Sha384WithRsaEncryption.Id] = "SHA-384withRSA"; + algorithms["SHA-384WITHRSA"] = "SHA-384withRSA"; + + algorithms["SHA512WITHRSA"] = "SHA-512withRSA"; + algorithms["SHA512WITHRSAENCRYPTION"] = "SHA-512withRSA"; + algorithms[PkcsObjectIdentifiers.Sha512WithRsaEncryption.Id] = "SHA-512withRSA"; + algorithms["SHA-512WITHRSA"] = "SHA-512withRSA"; + + algorithms["PSSWITHRSA"] = "PSSwithRSA"; + algorithms["RSASSA-PSS"] = "PSSwithRSA"; + algorithms[PkcsObjectIdentifiers.IdRsassaPss.Id] = "PSSwithRSA"; + algorithms["RSAPSS"] = "PSSwithRSA"; + + algorithms["SHA1WITHRSAANDMGF1"] = "SHA-1withRSAandMGF1"; + algorithms["SHA-1WITHRSAANDMGF1"] = "SHA-1withRSAandMGF1"; + algorithms["SHA1WITHRSA/PSS"] = "SHA-1withRSAandMGF1"; + algorithms["SHA-1WITHRSA/PSS"] = "SHA-1withRSAandMGF1"; + + algorithms["SHA224WITHRSAANDMGF1"] = "SHA-224withRSAandMGF1"; + algorithms["SHA-224WITHRSAANDMGF1"] = "SHA-224withRSAandMGF1"; + algorithms["SHA224WITHRSA/PSS"] = "SHA-224withRSAandMGF1"; + algorithms["SHA-224WITHRSA/PSS"] = "SHA-224withRSAandMGF1"; + + algorithms["SHA256WITHRSAANDMGF1"] = "SHA-256withRSAandMGF1"; + algorithms["SHA-256WITHRSAANDMGF1"] = "SHA-256withRSAandMGF1"; + algorithms["SHA256WITHRSA/PSS"] = "SHA-256withRSAandMGF1"; + algorithms["SHA-256WITHRSA/PSS"] = "SHA-256withRSAandMGF1"; + + algorithms["SHA384WITHRSAANDMGF1"] = "SHA-384withRSAandMGF1"; + algorithms["SHA-384WITHRSAANDMGF1"] = "SHA-384withRSAandMGF1"; + algorithms["SHA384WITHRSA/PSS"] = "SHA-384withRSAandMGF1"; + algorithms["SHA-384WITHRSA/PSS"] = "SHA-384withRSAandMGF1"; + + algorithms["SHA512WITHRSAANDMGF1"] = "SHA-512withRSAandMGF1"; + algorithms["SHA-512WITHRSAANDMGF1"] = "SHA-512withRSAandMGF1"; + algorithms["SHA512WITHRSA/PSS"] = "SHA-512withRSAandMGF1"; + algorithms["SHA-512WITHRSA/PSS"] = "SHA-512withRSAandMGF1"; + + algorithms["RIPEMD128WITHRSA"] = "RIPEMD128withRSA"; + algorithms["RIPEMD128WITHRSAENCRYPTION"] = "RIPEMD128withRSA"; + algorithms[TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128.Id] = "RIPEMD128withRSA"; + + algorithms["RIPEMD160WITHRSA"] = "RIPEMD160withRSA"; + algorithms["RIPEMD160WITHRSAENCRYPTION"] = "RIPEMD160withRSA"; + algorithms[TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160.Id] = "RIPEMD160withRSA"; + + algorithms["RIPEMD256WITHRSA"] = "RIPEMD256withRSA"; + algorithms["RIPEMD256WITHRSAENCRYPTION"] = "RIPEMD256withRSA"; + algorithms[TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256.Id] = "RIPEMD256withRSA"; + + algorithms["NONEWITHRSA"] = "RSA"; + algorithms["RSAWITHNONE"] = "RSA"; + algorithms["RAWRSA"] = "RSA"; + + algorithms["RAWRSAPSS"] = "RAWRSASSA-PSS"; + algorithms["NONEWITHRSAPSS"] = "RAWRSASSA-PSS"; + algorithms["NONEWITHRSASSA-PSS"] = "RAWRSASSA-PSS"; + + algorithms["NONEWITHDSA"] = "NONEwithDSA"; + algorithms["DSAWITHNONE"] = "NONEwithDSA"; + algorithms["RAWDSA"] = "NONEwithDSA"; + + algorithms["DSA"] = "SHA-1withDSA"; + algorithms["DSAWITHSHA1"] = "SHA-1withDSA"; + algorithms["DSAWITHSHA-1"] = "SHA-1withDSA"; + algorithms["SHA/DSA"] = "SHA-1withDSA"; + algorithms["SHA1/DSA"] = "SHA-1withDSA"; + algorithms["SHA-1/DSA"] = "SHA-1withDSA"; + algorithms["SHA1WITHDSA"] = "SHA-1withDSA"; + algorithms["SHA-1WITHDSA"] = "SHA-1withDSA"; + algorithms[X9ObjectIdentifiers.IdDsaWithSha1.Id] = "SHA-1withDSA"; + algorithms[OiwObjectIdentifiers.DsaWithSha1.Id] = "SHA-1withDSA"; + + algorithms["DSAWITHSHA224"] = "SHA-224withDSA"; + algorithms["DSAWITHSHA-224"] = "SHA-224withDSA"; + algorithms["SHA224/DSA"] = "SHA-224withDSA"; + algorithms["SHA-224/DSA"] = "SHA-224withDSA"; + algorithms["SHA224WITHDSA"] = "SHA-224withDSA"; + algorithms["SHA-224WITHDSA"] = "SHA-224withDSA"; + algorithms[NistObjectIdentifiers.DsaWithSha224.Id] = "SHA-224withDSA"; + + algorithms["DSAWITHSHA256"] = "SHA-256withDSA"; + algorithms["DSAWITHSHA-256"] = "SHA-256withDSA"; + algorithms["SHA256/DSA"] = "SHA-256withDSA"; + algorithms["SHA-256/DSA"] = "SHA-256withDSA"; + algorithms["SHA256WITHDSA"] = "SHA-256withDSA"; + algorithms["SHA-256WITHDSA"] = "SHA-256withDSA"; + algorithms[NistObjectIdentifiers.DsaWithSha256.Id] = "SHA-256withDSA"; + + algorithms["DSAWITHSHA384"] = "SHA-384withDSA"; + algorithms["DSAWITHSHA-384"] = "SHA-384withDSA"; + algorithms["SHA384/DSA"] = "SHA-384withDSA"; + algorithms["SHA-384/DSA"] = "SHA-384withDSA"; + algorithms["SHA384WITHDSA"] = "SHA-384withDSA"; + algorithms["SHA-384WITHDSA"] = "SHA-384withDSA"; + algorithms[NistObjectIdentifiers.DsaWithSha384.Id] = "SHA-384withDSA"; + + algorithms["DSAWITHSHA512"] = "SHA-512withDSA"; + algorithms["DSAWITHSHA-512"] = "SHA-512withDSA"; + algorithms["SHA512/DSA"] = "SHA-512withDSA"; + algorithms["SHA-512/DSA"] = "SHA-512withDSA"; + algorithms["SHA512WITHDSA"] = "SHA-512withDSA"; + algorithms["SHA-512WITHDSA"] = "SHA-512withDSA"; + algorithms[NistObjectIdentifiers.DsaWithSha512.Id] = "SHA-512withDSA"; + + algorithms["NONEWITHECDSA"] = "NONEwithECDSA"; + algorithms["ECDSAWITHNONE"] = "NONEwithECDSA"; + + algorithms["ECDSA"] = "SHA-1withECDSA"; + algorithms["SHA1/ECDSA"] = "SHA-1withECDSA"; + algorithms["SHA-1/ECDSA"] = "SHA-1withECDSA"; + algorithms["ECDSAWITHSHA1"] = "SHA-1withECDSA"; + algorithms["ECDSAWITHSHA-1"] = "SHA-1withECDSA"; + algorithms["SHA1WITHECDSA"] = "SHA-1withECDSA"; + algorithms["SHA-1WITHECDSA"] = "SHA-1withECDSA"; + algorithms[X9ObjectIdentifiers.ECDsaWithSha1.Id] = "SHA-1withECDSA"; + algorithms[TeleTrusTObjectIdentifiers.ECSignWithSha1.Id] = "SHA-1withECDSA"; + + algorithms["SHA224/ECDSA"] = "SHA-224withECDSA"; + algorithms["SHA-224/ECDSA"] = "SHA-224withECDSA"; + algorithms["ECDSAWITHSHA224"] = "SHA-224withECDSA"; + algorithms["ECDSAWITHSHA-224"] = "SHA-224withECDSA"; + algorithms["SHA224WITHECDSA"] = "SHA-224withECDSA"; + algorithms["SHA-224WITHECDSA"] = "SHA-224withECDSA"; + algorithms[X9ObjectIdentifiers.ECDsaWithSha224.Id] = "SHA-224withECDSA"; + + algorithms["SHA256/ECDSA"] = "SHA-256withECDSA"; + algorithms["SHA-256/ECDSA"] = "SHA-256withECDSA"; + algorithms["ECDSAWITHSHA256"] = "SHA-256withECDSA"; + algorithms["ECDSAWITHSHA-256"] = "SHA-256withECDSA"; + algorithms["SHA256WITHECDSA"] = "SHA-256withECDSA"; + algorithms["SHA-256WITHECDSA"] = "SHA-256withECDSA"; + algorithms[X9ObjectIdentifiers.ECDsaWithSha256.Id] = "SHA-256withECDSA"; + + algorithms["SHA384/ECDSA"] = "SHA-384withECDSA"; + algorithms["SHA-384/ECDSA"] = "SHA-384withECDSA"; + algorithms["ECDSAWITHSHA384"] = "SHA-384withECDSA"; + algorithms["ECDSAWITHSHA-384"] = "SHA-384withECDSA"; + algorithms["SHA384WITHECDSA"] = "SHA-384withECDSA"; + algorithms["SHA-384WITHECDSA"] = "SHA-384withECDSA"; + algorithms[X9ObjectIdentifiers.ECDsaWithSha384.Id] = "SHA-384withECDSA"; + + algorithms["SHA512/ECDSA"] = "SHA-512withECDSA"; + algorithms["SHA-512/ECDSA"] = "SHA-512withECDSA"; + algorithms["ECDSAWITHSHA512"] = "SHA-512withECDSA"; + algorithms["ECDSAWITHSHA-512"] = "SHA-512withECDSA"; + algorithms["SHA512WITHECDSA"] = "SHA-512withECDSA"; + algorithms["SHA-512WITHECDSA"] = "SHA-512withECDSA"; + algorithms[X9ObjectIdentifiers.ECDsaWithSha512.Id] = "SHA-512withECDSA"; + + algorithms["RIPEMD160/ECDSA"] = "RIPEMD160withECDSA"; + algorithms["ECDSAWITHRIPEMD160"] = "RIPEMD160withECDSA"; + algorithms["RIPEMD160WITHECDSA"] = "RIPEMD160withECDSA"; + algorithms[TeleTrusTObjectIdentifiers.ECSignWithRipeMD160.Id] = "RIPEMD160withECDSA"; + + algorithms["NONEWITHCVC-ECDSA"] = "NONEwithCVC-ECDSA"; + algorithms["CVC-ECDSAWITHNONE"] = "NONEwithCVC-ECDSA"; + + algorithms["SHA1/CVC-ECDSA"] = "SHA-1withCVC-ECDSA"; + algorithms["SHA-1/CVC-ECDSA"] = "SHA-1withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA1"] = "SHA-1withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA-1"] = "SHA-1withCVC-ECDSA"; + algorithms["SHA1WITHCVC-ECDSA"] = "SHA-1withCVC-ECDSA"; + algorithms["SHA-1WITHCVC-ECDSA"] = "SHA-1withCVC-ECDSA"; + algorithms[EacObjectIdentifiers.id_TA_ECDSA_SHA_1.Id] = "SHA-1withCVC-ECDSA"; + + algorithms["SHA224/CVC-ECDSA"] = "SHA-224withCVC-ECDSA"; + algorithms["SHA-224/CVC-ECDSA"] = "SHA-224withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA224"] = "SHA-224withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA-224"] = "SHA-224withCVC-ECDSA"; + algorithms["SHA224WITHCVC-ECDSA"] = "SHA-224withCVC-ECDSA"; + algorithms["SHA-224WITHCVC-ECDSA"] = "SHA-224withCVC-ECDSA"; + algorithms[EacObjectIdentifiers.id_TA_ECDSA_SHA_224.Id] = "SHA-224withCVC-ECDSA"; + + algorithms["SHA256/CVC-ECDSA"] = "SHA-256withCVC-ECDSA"; + algorithms["SHA-256/CVC-ECDSA"] = "SHA-256withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA256"] = "SHA-256withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA-256"] = "SHA-256withCVC-ECDSA"; + algorithms["SHA256WITHCVC-ECDSA"] = "SHA-256withCVC-ECDSA"; + algorithms["SHA-256WITHCVC-ECDSA"] = "SHA-256withCVC-ECDSA"; + algorithms[EacObjectIdentifiers.id_TA_ECDSA_SHA_256.Id] = "SHA-256withCVC-ECDSA"; + + algorithms["SHA384/CVC-ECDSA"] = "SHA-384withCVC-ECDSA"; + algorithms["SHA-384/CVC-ECDSA"] = "SHA-384withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA384"] = "SHA-384withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA-384"] = "SHA-384withCVC-ECDSA"; + algorithms["SHA384WITHCVC-ECDSA"] = "SHA-384withCVC-ECDSA"; + algorithms["SHA-384WITHCVC-ECDSA"] = "SHA-384withCVC-ECDSA"; + algorithms[EacObjectIdentifiers.id_TA_ECDSA_SHA_384.Id] = "SHA-384withCVC-ECDSA"; + + algorithms["SHA512/CVC-ECDSA"] = "SHA-512withCVC-ECDSA"; + algorithms["SHA-512/CVC-ECDSA"] = "SHA-512withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA512"] = "SHA-512withCVC-ECDSA"; + algorithms["CVC-ECDSAWITHSHA-512"] = "SHA-512withCVC-ECDSA"; + algorithms["SHA512WITHCVC-ECDSA"] = "SHA-512withCVC-ECDSA"; + algorithms["SHA-512WITHCVC-ECDSA"] = "SHA-512withCVC-ECDSA"; + algorithms[EacObjectIdentifiers.id_TA_ECDSA_SHA_512.Id] = "SHA-512withCVC-ECDSA"; + + algorithms["NONEWITHPLAIN-ECDSA"] = "NONEwithPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHNONE"] = "NONEwithPLAIN-ECDSA"; + + algorithms["SHA1/PLAIN-ECDSA"] = "SHA-1withPLAIN-ECDSA"; + algorithms["SHA-1/PLAIN-ECDSA"] = "SHA-1withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA1"] = "SHA-1withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA-1"] = "SHA-1withPLAIN-ECDSA"; + algorithms["SHA1WITHPLAIN-ECDSA"] = "SHA-1withPLAIN-ECDSA"; + algorithms["SHA-1WITHPLAIN-ECDSA"] = "SHA-1withPLAIN-ECDSA"; + algorithms[BsiObjectIdentifiers.ecdsa_plain_SHA1.Id] = "SHA-1withPLAIN-ECDSA"; + + algorithms["SHA224/PLAIN-ECDSA"] = "SHA-224withPLAIN-ECDSA"; + algorithms["SHA-224/PLAIN-ECDSA"] = "SHA-224withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA224"] = "SHA-224withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA-224"] = "SHA-224withPLAIN-ECDSA"; + algorithms["SHA224WITHPLAIN-ECDSA"] = "SHA-224withPLAIN-ECDSA"; + algorithms["SHA-224WITHPLAIN-ECDSA"] = "SHA-224withPLAIN-ECDSA"; + algorithms[BsiObjectIdentifiers.ecdsa_plain_SHA224.Id] = "SHA-224withPLAIN-ECDSA"; + + algorithms["SHA256/PLAIN-ECDSA"] = "SHA-256withPLAIN-ECDSA"; + algorithms["SHA-256/PLAIN-ECDSA"] = "SHA-256withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA256"] = "SHA-256withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA-256"] = "SHA-256withPLAIN-ECDSA"; + algorithms["SHA256WITHPLAIN-ECDSA"] = "SHA-256withPLAIN-ECDSA"; + algorithms["SHA-256WITHPLAIN-ECDSA"] = "SHA-256withPLAIN-ECDSA"; + algorithms[BsiObjectIdentifiers.ecdsa_plain_SHA256.Id] = "SHA-256withPLAIN-ECDSA"; + + algorithms["SHA384/PLAIN-ECDSA"] = "SHA-384withPLAIN-ECDSA"; + algorithms["SHA-384/PLAIN-ECDSA"] = "SHA-384withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA384"] = "SHA-384withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA-384"] = "SHA-384withPLAIN-ECDSA"; + algorithms["SHA384WITHPLAIN-ECDSA"] = "SHA-384withPLAIN-ECDSA"; + algorithms["SHA-384WITHPLAIN-ECDSA"] = "SHA-384withPLAIN-ECDSA"; + algorithms[BsiObjectIdentifiers.ecdsa_plain_SHA384.Id] = "SHA-384withPLAIN-ECDSA"; + + algorithms["SHA512/PLAIN-ECDSA"] = "SHA-512withPLAIN-ECDSA"; + algorithms["SHA-512/PLAIN-ECDSA"] = "SHA-512withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA512"] = "SHA-512withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHSHA-512"] = "SHA-512withPLAIN-ECDSA"; + algorithms["SHA512WITHPLAIN-ECDSA"] = "SHA-512withPLAIN-ECDSA"; + algorithms["SHA-512WITHPLAIN-ECDSA"] = "SHA-512withPLAIN-ECDSA"; + algorithms[BsiObjectIdentifiers.ecdsa_plain_SHA512.Id] = "SHA-512withPLAIN-ECDSA"; + + algorithms["RIPEMD160/PLAIN-ECDSA"] = "RIPEMD160withPLAIN-ECDSA"; + algorithms["PLAIN-ECDSAWITHRIPEMD160"] = "RIPEMD160withPLAIN-ECDSA"; + algorithms["RIPEMD160WITHPLAIN-ECDSA"] = "RIPEMD160withPLAIN-ECDSA"; + algorithms[BsiObjectIdentifiers.ecdsa_plain_RIPEMD160.Id] = "RIPEMD160withPLAIN-ECDSA"; + + algorithms["SHA1WITHECNR"] = "SHA-1withECNR"; + algorithms["SHA-1WITHECNR"] = "SHA-1withECNR"; + algorithms["SHA224WITHECNR"] = "SHA-224withECNR"; + algorithms["SHA-224WITHECNR"] = "SHA-224withECNR"; + algorithms["SHA256WITHECNR"] = "SHA-256withECNR"; + algorithms["SHA-256WITHECNR"] = "SHA-256withECNR"; + algorithms["SHA384WITHECNR"] = "SHA-384withECNR"; + algorithms["SHA-384WITHECNR"] = "SHA-384withECNR"; + algorithms["SHA512WITHECNR"] = "SHA-512withECNR"; + algorithms["SHA-512WITHECNR"] = "SHA-512withECNR"; + + algorithms["GOST-3410"] = "GOST3410"; + algorithms["GOST-3410-94"] = "GOST3410"; + algorithms["GOST3411WITHGOST3410"] = "GOST3410"; + algorithms[CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94.Id] = "GOST3410"; + + algorithms["ECGOST-3410"] = "ECGOST3410"; + algorithms["ECGOST-3410-2001"] = "ECGOST3410"; + algorithms["GOST3411WITHECGOST3410"] = "ECGOST3410"; + algorithms[CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001.Id] = "ECGOST3410"; + + algorithms["ED25519"] = "Ed25519"; + algorithms[EdECObjectIdentifiers.id_Ed25519.Id] = "Ed25519"; + algorithms["ED25519CTX"] = "Ed25519ctx"; + algorithms["ED25519PH"] = "Ed25519ph"; + algorithms["ED448"] = "Ed448"; + algorithms[EdECObjectIdentifiers.id_Ed448.Id] = "Ed448"; + algorithms["ED448PH"] = "Ed448ph"; + + oids["MD2withRSA"] = PkcsObjectIdentifiers.MD2WithRsaEncryption; + oids["MD4withRSA"] = PkcsObjectIdentifiers.MD4WithRsaEncryption; + oids["MD5withRSA"] = PkcsObjectIdentifiers.MD5WithRsaEncryption; + + oids["SHA-1withRSA"] = PkcsObjectIdentifiers.Sha1WithRsaEncryption; + oids["SHA-224withRSA"] = PkcsObjectIdentifiers.Sha224WithRsaEncryption; + oids["SHA-256withRSA"] = PkcsObjectIdentifiers.Sha256WithRsaEncryption; + oids["SHA-384withRSA"] = PkcsObjectIdentifiers.Sha384WithRsaEncryption; + oids["SHA-512withRSA"] = PkcsObjectIdentifiers.Sha512WithRsaEncryption; + + oids["PSSwithRSA"] = PkcsObjectIdentifiers.IdRsassaPss; + oids["SHA-1withRSAandMGF1"] = PkcsObjectIdentifiers.IdRsassaPss; + oids["SHA-224withRSAandMGF1"] = PkcsObjectIdentifiers.IdRsassaPss; + oids["SHA-256withRSAandMGF1"] = PkcsObjectIdentifiers.IdRsassaPss; + oids["SHA-384withRSAandMGF1"] = PkcsObjectIdentifiers.IdRsassaPss; + oids["SHA-512withRSAandMGF1"] = PkcsObjectIdentifiers.IdRsassaPss; + + oids["RIPEMD128withRSA"] = TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128; + oids["RIPEMD160withRSA"] = TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160; + oids["RIPEMD256withRSA"] = TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256; + + oids["SHA-1withDSA"] = X9ObjectIdentifiers.IdDsaWithSha1; + + oids["SHA-1withECDSA"] = X9ObjectIdentifiers.ECDsaWithSha1; + oids["SHA-224withECDSA"] = X9ObjectIdentifiers.ECDsaWithSha224; + oids["SHA-256withECDSA"] = X9ObjectIdentifiers.ECDsaWithSha256; + oids["SHA-384withECDSA"] = X9ObjectIdentifiers.ECDsaWithSha384; + oids["SHA-512withECDSA"] = X9ObjectIdentifiers.ECDsaWithSha512; + oids["RIPEMD160withECDSA"] = TeleTrusTObjectIdentifiers.ECSignWithRipeMD160; + + oids["SHA-1withCVC-ECDSA"] = EacObjectIdentifiers.id_TA_ECDSA_SHA_1; + oids["SHA-224withCVC-ECDSA"] = EacObjectIdentifiers.id_TA_ECDSA_SHA_224; + oids["SHA-256withCVC-ECDSA"] = EacObjectIdentifiers.id_TA_ECDSA_SHA_256; + oids["SHA-384withCVC-ECDSA"] = EacObjectIdentifiers.id_TA_ECDSA_SHA_384; + oids["SHA-512withCVC-ECDSA"] = EacObjectIdentifiers.id_TA_ECDSA_SHA_512; + + oids["SHA-1withPLAIN-ECDSA"] = BsiObjectIdentifiers.ecdsa_plain_SHA1; + oids["SHA-224withPLAIN-ECDSA"] = BsiObjectIdentifiers.ecdsa_plain_SHA224; + oids["SHA-256withPLAIN-ECDSA"] = BsiObjectIdentifiers.ecdsa_plain_SHA256; + oids["SHA-384withPLAIN-ECDSA"] = BsiObjectIdentifiers.ecdsa_plain_SHA384; + oids["SHA-512withPLAIN-ECDSA"] = BsiObjectIdentifiers.ecdsa_plain_SHA512; + oids["RIPEMD160withPLAIN-ECDSA"] = BsiObjectIdentifiers.ecdsa_plain_RIPEMD160; + + oids["GOST3410"] = CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94; + oids["ECGOST3410"] = CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001; + + oids["Ed25519"] = EdECObjectIdentifiers.id_Ed25519; + oids["Ed448"] = EdECObjectIdentifiers.id_Ed448; + } + + /// + /// Returns an ObjectIdentifier for a given encoding. + /// + /// A string representation of the encoding. + /// A DerObjectIdentifier, null if the OID is not available. + // TODO Don't really want to support this + public static DerObjectIdentifier GetObjectIdentifier( + string mechanism) + { + if (mechanism == null) + throw new ArgumentNullException("mechanism"); + + mechanism = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(mechanism); + string aliased = (string) algorithms[mechanism]; + + if (aliased != null) + mechanism = aliased; + + return (DerObjectIdentifier) oids[mechanism]; + } + + public static ICollection Algorithms + { + get { return oids.Keys; } + } + + public static Asn1Encodable GetDefaultX509Parameters( + DerObjectIdentifier id) + { + return GetDefaultX509Parameters(id.Id); + } + + public static Asn1Encodable GetDefaultX509Parameters( + string algorithm) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + + algorithm = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + + string mechanism = (string) algorithms[algorithm]; + + if (mechanism == null) + mechanism = algorithm; + + if (mechanism == "PSSwithRSA") + { + // TODO The Sha1Digest here is a default. In JCE version, the actual digest + // to be used can be overridden by subsequent parameter settings. + return GetPssX509Parameters("SHA-1"); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "withRSAandMGF1")) + { + string digestName = mechanism.Substring(0, mechanism.Length - "withRSAandMGF1".Length); + return GetPssX509Parameters(digestName); + } + + return DerNull.Instance; + } + + private static Asn1Encodable GetPssX509Parameters( + string digestName) + { + AlgorithmIdentifier hashAlgorithm = new AlgorithmIdentifier( + DigestUtilities.GetObjectIdentifier(digestName), DerNull.Instance); + + // TODO Is it possible for the MGF hash alg to be different from the PSS one? + AlgorithmIdentifier maskGenAlgorithm = new AlgorithmIdentifier( + PkcsObjectIdentifiers.IdMgf1, hashAlgorithm); + + int saltLen = DigestUtilities.GetDigest(digestName).GetDigestSize(); + return new RsassaPssParameters(hashAlgorithm, maskGenAlgorithm, + new DerInteger(saltLen), new DerInteger(1)); + } + + public static ISigner GetSigner( + DerObjectIdentifier id) + { + return GetSigner(id.Id); + } + + public static ISigner GetSigner( + string algorithm) + { + if (algorithm == null) + throw new ArgumentNullException("algorithm"); + + algorithm = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + + string mechanism = (string) algorithms[algorithm]; + + if (mechanism == null) + mechanism = algorithm; + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(mechanism, "Ed")) + { + if (mechanism.Equals("Ed25519")) + { + return new Ed25519Signer(); + } + if (mechanism.Equals("Ed25519ctx")) + { + return new Ed25519ctxSigner(Arrays.EmptyBytes); + } + if (mechanism.Equals("Ed25519ph")) + { + return new Ed25519phSigner(Arrays.EmptyBytes); + } + if (mechanism.Equals("Ed448")) + { + return new Ed448Signer(Arrays.EmptyBytes); + } + if (mechanism.Equals("Ed448ph")) + { + return new Ed448phSigner(Arrays.EmptyBytes); + } + } + + if (mechanism.Equals("RSA")) + { + return (new RsaDigestSigner(new NullDigest(), (AlgorithmIdentifier)null)); + } + if (mechanism.Equals("RAWRSASSA-PSS")) + { + // TODO Add support for other parameter settings + return PssSigner.CreateRawSigner(new RsaBlindedEngine(), new Sha1Digest()); + } + if (mechanism.Equals("PSSwithRSA")) + { + // TODO The Sha1Digest here is a default. In JCE version, the actual digest + // to be used can be overridden by subsequent parameter settings. + return (new PssSigner(new RsaBlindedEngine(), new Sha1Digest())); + } + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "withRSA")) + { + string digestName = mechanism.Substring(0, mechanism.LastIndexOf("with")); + IDigest digest = DigestUtilities.GetDigest(digestName); + return new RsaDigestSigner(digest); + } + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "withRSAandMGF1")) + { + string digestName = mechanism.Substring(0, mechanism.LastIndexOf("with")); + IDigest digest = DigestUtilities.GetDigest(digestName); + return new PssSigner(new RsaBlindedEngine(), digest); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "withDSA")) + { + string digestName = mechanism.Substring(0, mechanism.LastIndexOf("with")); + IDigest digest = DigestUtilities.GetDigest(digestName); + return new DsaDigestSigner(new DsaSigner(), digest); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "withECDSA")) + { + string digestName = mechanism.Substring(0, mechanism.LastIndexOf("with")); + IDigest digest = DigestUtilities.GetDigest(digestName); + return new DsaDigestSigner(new ECDsaSigner(), digest); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "withCVC-ECDSA") + || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "withPLAIN-ECDSA")) + { + string digestName = mechanism.Substring(0, mechanism.LastIndexOf("with")); + IDigest digest = DigestUtilities.GetDigest(digestName); + return new DsaDigestSigner(new ECDsaSigner(), digest, PlainDsaEncoding.Instance); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "withECNR")) + { + string digestName = mechanism.Substring(0, mechanism.LastIndexOf("with")); + IDigest digest = DigestUtilities.GetDigest(digestName); + return new DsaDigestSigner(new ECNRSigner(), digest); + } + + if (mechanism.Equals("GOST3410")) + { + return new Gost3410DigestSigner(new Gost3410Signer(), new Gost3411Digest()); + } + if (mechanism.Equals("ECGOST3410")) + { + return new Gost3410DigestSigner(new ECGost3410Signer(), new Gost3411Digest()); + } + + if (mechanism.Equals("SHA1WITHRSA/ISO9796-2")) + { + return new Iso9796d2Signer(new RsaBlindedEngine(), new Sha1Digest(), true); + } + if (mechanism.Equals("MD5WITHRSA/ISO9796-2")) + { + return new Iso9796d2Signer(new RsaBlindedEngine(), new MD5Digest(), true); + } + if (mechanism.Equals("RIPEMD160WITHRSA/ISO9796-2")) + { + return new Iso9796d2Signer(new RsaBlindedEngine(), new RipeMD160Digest(), true); + } + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(mechanism, "/X9.31")) + { + string x931 = mechanism.Substring(0, mechanism.Length - "/X9.31".Length); + int withPos = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.IndexOf(x931, "WITH"); + if (withPos > 0) + { + int endPos = withPos + "WITH".Length; + + string digestName = x931.Substring(0, withPos); + IDigest digest = DigestUtilities.GetDigest(digestName); + + string cipherName = x931.Substring(endPos, x931.Length - endPos); + if (cipherName.Equals("RSA")) + { + IAsymmetricBlockCipher cipher = new RsaBlindedEngine(); + return new X931Signer(cipher, digest); + } + } + } + + throw new SecurityUtilityException("Signer " + algorithm + " not recognised."); + } + + public static string GetEncodingName( + DerObjectIdentifier oid) + { + return (string) algorithms[oid.Id]; + } + + public static ISigner InitSigner(DerObjectIdentifier algorithmOid, bool forSigning, AsymmetricKeyParameter privateKey, SecureRandom random) + { + return InitSigner(algorithmOid.Id, forSigning, privateKey, random); + } + + public static ISigner InitSigner(string algorithm, bool forSigning, AsymmetricKeyParameter privateKey, SecureRandom random) + { + ISigner signer = SignerUtilities.GetSigner(algorithm); + signer.Init(forSigning, ParameterUtilities.WithRandom(privateKey, random)); + return signer; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignerUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignerUtilities.cs.meta new file mode 100644 index 00000000..f77e633c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/SignerUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 06997fffd3bfe604f912392f70471c57 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/WrapperUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/WrapperUtilities.cs new file mode 100644 index 00000000..18e581d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/WrapperUtilities.cs @@ -0,0 +1,157 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Kisa; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ntt; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security +{ + /// + /// Utility class for creating IWrapper objects from their names/Oids + /// + public sealed class WrapperUtilities + { + private enum WrapAlgorithm { AESWRAP, CAMELLIAWRAP, DESEDEWRAP, RC2WRAP, SEEDWRAP, + DESEDERFC3211WRAP, AESRFC3211WRAP, CAMELLIARFC3211WRAP }; + + private WrapperUtilities() + { + } + + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + //private static readonly IDictionary oids = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static WrapperUtilities() + { + // Signal to obfuscation tools not to change enum constants + ((WrapAlgorithm)Enums.GetArbitraryValue(typeof(WrapAlgorithm))).ToString(); + + algorithms[NistObjectIdentifiers.IdAes128Wrap.Id] = "AESWRAP"; + algorithms[NistObjectIdentifiers.IdAes192Wrap.Id] = "AESWRAP"; + algorithms[NistObjectIdentifiers.IdAes256Wrap.Id] = "AESWRAP"; + + algorithms[NttObjectIdentifiers.IdCamellia128Wrap.Id] = "CAMELLIAWRAP"; + algorithms[NttObjectIdentifiers.IdCamellia192Wrap.Id] = "CAMELLIAWRAP"; + algorithms[NttObjectIdentifiers.IdCamellia256Wrap.Id] = "CAMELLIAWRAP"; + + algorithms[PkcsObjectIdentifiers.IdAlgCms3DesWrap.Id] = "DESEDEWRAP"; + algorithms["TDEAWRAP"] = "DESEDEWRAP"; + + algorithms[PkcsObjectIdentifiers.IdAlgCmsRC2Wrap.Id] = "RC2WRAP"; + + algorithms[KisaObjectIdentifiers.IdNpkiAppCmsSeedWrap.Id] = "SEEDWRAP"; + } + + public static IWrapper GetWrapper( + DerObjectIdentifier oid) + { + return GetWrapper(oid.Id); + } + + public static IWrapper GetWrapper( + string algorithm) + { + string upper = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithm); + string mechanism = (string)algorithms[upper]; + + if (mechanism == null) + { + mechanism = upper; + } + + try + { + WrapAlgorithm wrapAlgorithm = (WrapAlgorithm)Enums.GetEnumValue( + typeof(WrapAlgorithm), mechanism); + + switch (wrapAlgorithm) + { + case WrapAlgorithm.AESWRAP: return new AesWrapEngine(); + case WrapAlgorithm.CAMELLIAWRAP: return new CamelliaWrapEngine(); + case WrapAlgorithm.DESEDEWRAP: return new DesEdeWrapEngine(); + case WrapAlgorithm.RC2WRAP: return new RC2WrapEngine(); + case WrapAlgorithm.SEEDWRAP: return new SeedWrapEngine(); + case WrapAlgorithm.DESEDERFC3211WRAP: return new Rfc3211WrapEngine(new DesEdeEngine()); + case WrapAlgorithm.AESRFC3211WRAP: return new Rfc3211WrapEngine(new AesEngine()); + case WrapAlgorithm.CAMELLIARFC3211WRAP: return new Rfc3211WrapEngine(new CamelliaEngine()); + } + } + catch (ArgumentException) + { + } + + // Create an IBufferedCipher and use it as IWrapper (via BufferedCipherWrapper) + IBufferedCipher blockCipher = CipherUtilities.GetCipher(algorithm); + + if (blockCipher != null) + return new BufferedCipherWrapper(blockCipher); + + throw new SecurityUtilityException("Wrapper " + algorithm + " not recognised."); + } + + public static string GetAlgorithmName( + DerObjectIdentifier oid) + { + return (string) algorithms[oid.Id]; + } + + private class BufferedCipherWrapper + : IWrapper + { + private readonly IBufferedCipher cipher; + private bool forWrapping; + + public BufferedCipherWrapper( + IBufferedCipher cipher) + { + this.cipher = cipher; + } + + public string AlgorithmName + { + get { return cipher.AlgorithmName; } + } + + public void Init( + bool forWrapping, + ICipherParameters parameters) + { + this.forWrapping = forWrapping; + + cipher.Init(forWrapping, parameters); + } + + public byte[] Wrap( + byte[] input, + int inOff, + int length) + { + if (!forWrapping) + throw new InvalidOperationException("Not initialised for wrapping"); + + return cipher.DoFinal(input, inOff, length); + } + + public byte[] Unwrap( + byte[] input, + int inOff, + int length) + { + if (forWrapping) + throw new InvalidOperationException("Not initialised for unwrapping"); + + return cipher.DoFinal(input, inOff, length); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/WrapperUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/WrapperUtilities.cs.meta new file mode 100644 index 00000000..0f7a0223 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/WrapperUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 73ae39e593069a449ae3656aa207a8c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert.meta new file mode 100644 index 00000000..518fb0d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d73ca49e92fed5341b3ab5351606b988 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateEncodingException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateEncodingException.cs new file mode 100644 index 00000000..b4589cb9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateEncodingException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CertificateEncodingException : CertificateException + { + public CertificateEncodingException() : base() { } + public CertificateEncodingException(string msg) : base(msg) { } + public CertificateEncodingException(string msg, Exception e) : base(msg, e) { } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateEncodingException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateEncodingException.cs.meta new file mode 100644 index 00000000..8a7f8a40 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateEncodingException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d13d171e5bd63a43857b59678c5b634 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateException.cs new file mode 100644 index 00000000..2d56966a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CertificateException : GeneralSecurityException + { + public CertificateException() : base() { } + public CertificateException(string message) : base(message) { } + public CertificateException(string message, Exception exception) : base(message, exception) { } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateException.cs.meta new file mode 100644 index 00000000..b1850b5f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 312dba7b3b4d2b64f9f51f95db4ee1ca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateExpiredException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateExpiredException.cs new file mode 100644 index 00000000..c73639a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateExpiredException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CertificateExpiredException : CertificateException + { + public CertificateExpiredException() : base() { } + public CertificateExpiredException(string message) : base(message) { } + public CertificateExpiredException(string message, Exception exception) : base(message, exception) { } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateExpiredException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateExpiredException.cs.meta new file mode 100644 index 00000000..3822b60e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateExpiredException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94e5534bd782d1d4aa1d9cdf658ef365 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateNotYetValidException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateNotYetValidException.cs new file mode 100644 index 00000000..391b7440 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateNotYetValidException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CertificateNotYetValidException : CertificateException + { + public CertificateNotYetValidException() : base() { } + public CertificateNotYetValidException(string message) : base(message) { } + public CertificateNotYetValidException(string message, Exception exception) : base(message, exception) { } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateNotYetValidException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateNotYetValidException.cs.meta new file mode 100644 index 00000000..b2de4bdd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateNotYetValidException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1c062f71e1e45684aaa24f6ec45dc08c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateParsingException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateParsingException.cs new file mode 100644 index 00000000..6f6e09d4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateParsingException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CertificateParsingException : CertificateException + { + public CertificateParsingException() : base() { } + public CertificateParsingException(string message) : base(message) { } + public CertificateParsingException(string message, Exception exception) : base(message, exception) { } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateParsingException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateParsingException.cs.meta new file mode 100644 index 00000000..8a732cb0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CertificateParsingException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cf1c2ef4e5eeedd4aac155d8a36837c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CrlException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CrlException.cs new file mode 100644 index 00000000..6557a3c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CrlException.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class CrlException : GeneralSecurityException + { + public CrlException() : base() { } + public CrlException(string msg) : base(msg) {} + public CrlException(string msg, Exception e) : base(msg, e) {} + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CrlException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CrlException.cs.meta new file mode 100644 index 00000000..653afffc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/security/cert/CrlException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0c28bc603c44ba4cae418797434e798 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp.meta new file mode 100644 index 00000000..83bc41ee --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b65683262d1a3214f857d8d7a9199f0c +folderAsset: yes +timeCreated: 1547039641 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/GenTimeAccuracy.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/GenTimeAccuracy.cs new file mode 100644 index 00000000..2923eafc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/GenTimeAccuracy.cs @@ -0,0 +1,37 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + public class GenTimeAccuracy + { + private Accuracy accuracy; + + public GenTimeAccuracy( + Accuracy accuracy) + { + this.accuracy = accuracy; + } + + public int Seconds { get { return GetTimeComponent(accuracy.Seconds); } } + + public int Millis { get { return GetTimeComponent(accuracy.Millis); } } + + public int Micros { get { return GetTimeComponent(accuracy.Micros); } } + + private int GetTimeComponent( + DerInteger time) + { + return time == null ? 0 : time.Value.IntValue; + } + + public override string ToString() + { + return Seconds + "." + Millis.ToString("000") + Micros.ToString("000"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/GenTimeAccuracy.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/GenTimeAccuracy.cs.meta new file mode 100644 index 00000000..72858145 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/GenTimeAccuracy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b121e50e39f7eae438bd60a8c88d8aab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPAlgorithms.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPAlgorithms.cs new file mode 100644 index 00000000..f001c162 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPAlgorithms.cs @@ -0,0 +1,58 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + /** + * Recognised hash algorithms for the time stamp protocol. + */ + public abstract class TspAlgorithms + { + public static readonly string MD5 = PkcsObjectIdentifiers.MD5.Id; + + public static readonly string Sha1 = OiwObjectIdentifiers.IdSha1.Id; + + public static readonly string Sha224 = NistObjectIdentifiers.IdSha224.Id; + public static readonly string Sha256 = NistObjectIdentifiers.IdSha256.Id; + public static readonly string Sha384 = NistObjectIdentifiers.IdSha384.Id; + public static readonly string Sha512 = NistObjectIdentifiers.IdSha512.Id; + + public static readonly string RipeMD128 = TeleTrusTObjectIdentifiers.RipeMD128.Id; + public static readonly string RipeMD160 = TeleTrusTObjectIdentifiers.RipeMD160.Id; + public static readonly string RipeMD256 = TeleTrusTObjectIdentifiers.RipeMD256.Id; + + public static readonly string Gost3411 = CryptoProObjectIdentifiers.GostR3411.Id; + public static readonly string Gost3411_2012_256 = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256.Id; + public static readonly string Gost3411_2012_512 = RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512.Id; + + public static readonly string SM3 = GMObjectIdentifiers.sm3.Id; + + public static readonly IList Allowed; + + static TspAlgorithms() + { + string[] algs = new string[] + { + Gost3411, Gost3411_2012_256, Gost3411_2012_512, MD5, RipeMD128, RipeMD160, RipeMD256, Sha1, Sha224, Sha256, Sha384, Sha512, SM3 + }; + + Allowed = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + foreach (string alg in algs) + { + Allowed.Add(alg); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPAlgorithms.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPAlgorithms.cs.meta new file mode 100644 index 00000000..703aaa5d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPAlgorithms.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 499a88718c5a4bc4f83dbb4ea7aa4ed9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPException.cs new file mode 100644 index 00000000..3771dd5f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPException.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class TspException + : Exception + { + public TspException() + { + } + + public TspException( + string message) + : base(message) + { + } + + public TspException( + string message, + Exception e) + : base(message, e) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPException.cs.meta new file mode 100644 index 00000000..626e3ce3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7656ac180275ac84f835935c4731b5b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPUtil.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPUtil.cs new file mode 100644 index 00000000..617cc41a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPUtil.cs @@ -0,0 +1,218 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.GM; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Rosstandart; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + public class TspUtil + { + private static ISet EmptySet = CollectionUtilities.ReadOnly(new HashSet()); + private static IList EmptyList = CollectionUtilities.ReadOnly(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList()); + + private static readonly IDictionary digestLengths = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary digestNames = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + static TspUtil() + { + digestLengths.Add(PkcsObjectIdentifiers.MD5.Id, 16); + digestLengths.Add(OiwObjectIdentifiers.IdSha1.Id, 20); + digestLengths.Add(NistObjectIdentifiers.IdSha224.Id, 28); + digestLengths.Add(NistObjectIdentifiers.IdSha256.Id, 32); + digestLengths.Add(NistObjectIdentifiers.IdSha384.Id, 48); + digestLengths.Add(NistObjectIdentifiers.IdSha512.Id, 64); + digestLengths.Add(TeleTrusTObjectIdentifiers.RipeMD128.Id, 16); + digestLengths.Add(TeleTrusTObjectIdentifiers.RipeMD160.Id, 20); + digestLengths.Add(TeleTrusTObjectIdentifiers.RipeMD256.Id, 32); + digestLengths.Add(CryptoProObjectIdentifiers.GostR3411.Id, 32); + digestLengths.Add(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256.Id, 32); + digestLengths.Add(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512.Id, 64); + digestLengths.Add(GMObjectIdentifiers.sm3.Id, 32); + + digestNames.Add(PkcsObjectIdentifiers.MD5.Id, "MD5"); + digestNames.Add(OiwObjectIdentifiers.IdSha1.Id, "SHA1"); + digestNames.Add(NistObjectIdentifiers.IdSha224.Id, "SHA224"); + digestNames.Add(NistObjectIdentifiers.IdSha256.Id, "SHA256"); + digestNames.Add(NistObjectIdentifiers.IdSha384.Id, "SHA384"); + digestNames.Add(NistObjectIdentifiers.IdSha512.Id, "SHA512"); + digestNames.Add(PkcsObjectIdentifiers.MD5WithRsaEncryption.Id, "MD5"); + digestNames.Add(PkcsObjectIdentifiers.Sha1WithRsaEncryption.Id, "SHA1"); + digestNames.Add(PkcsObjectIdentifiers.Sha224WithRsaEncryption.Id, "SHA224"); + digestNames.Add(PkcsObjectIdentifiers.Sha256WithRsaEncryption.Id, "SHA256"); + digestNames.Add(PkcsObjectIdentifiers.Sha384WithRsaEncryption.Id, "SHA384"); + digestNames.Add(PkcsObjectIdentifiers.Sha512WithRsaEncryption.Id, "SHA512"); + digestNames.Add(TeleTrusTObjectIdentifiers.RipeMD128.Id, "RIPEMD128"); + digestNames.Add(TeleTrusTObjectIdentifiers.RipeMD160.Id, "RIPEMD160"); + digestNames.Add(TeleTrusTObjectIdentifiers.RipeMD256.Id, "RIPEMD256"); + digestNames.Add(CryptoProObjectIdentifiers.GostR3411.Id, "GOST3411"); + digestNames.Add(OiwObjectIdentifiers.DsaWithSha1.Id, "SHA1"); + digestNames.Add(OiwObjectIdentifiers.Sha1WithRsa.Id, "SHA1"); + digestNames.Add(OiwObjectIdentifiers.MD5WithRsa.Id, "MD5"); + digestNames.Add(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256.Id, "GOST3411-2012-256"); + digestNames.Add(RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512.Id, "GOST3411-2012-512"); + digestNames.Add(GMObjectIdentifiers.sm3.Id, "SM3"); + } + + + /** + * Fetches the signature time-stamp attributes from a SignerInformation object. + * Checks that the MessageImprint for each time-stamp matches the signature field. + * (see RFC 3161 Appendix A). + * + * @param signerInfo a SignerInformation to search for time-stamps + * @return a collection of TimeStampToken objects + * @throws TSPValidationException + */ + public static ICollection GetSignatureTimestamps( + SignerInformation signerInfo) + { + IList timestamps = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + Asn1.Cms.AttributeTable unsignedAttrs = signerInfo.UnsignedAttributes; + if (unsignedAttrs != null) + { + foreach (Asn1.Cms.Attribute tsAttr in unsignedAttrs.GetAll( + PkcsObjectIdentifiers.IdAASignatureTimeStampToken)) + { + foreach (Asn1Encodable asn1 in tsAttr.AttrValues) + { + try + { + Asn1.Cms.ContentInfo contentInfo = Asn1.Cms.ContentInfo.GetInstance( + asn1.ToAsn1Object()); + TimeStampToken timeStampToken = new TimeStampToken(contentInfo); + TimeStampTokenInfo tstInfo = timeStampToken.TimeStampInfo; + + byte[] expectedDigest = DigestUtilities.CalculateDigest( + GetDigestAlgName(tstInfo.MessageImprintAlgOid), + signerInfo.GetSignature()); + + if (!Arrays.ConstantTimeAreEqual(expectedDigest, tstInfo.GetMessageImprintDigest())) + throw new TspValidationException("Incorrect digest in message imprint"); + + timestamps.Add(timeStampToken); + } + catch (SecurityUtilityException) + { + throw new TspValidationException("Unknown hash algorithm specified in timestamp"); + } + catch (Exception) + { + throw new TspValidationException("Timestamp could not be parsed"); + } + } + } + } + + return timestamps; + } + + /** + * Validate the passed in certificate as being of the correct type to be used + * for time stamping. To be valid it must have an ExtendedKeyUsage extension + * which has a key purpose identifier of id-kp-timeStamping. + * + * @param cert the certificate of interest. + * @throws TspValidationException if the certicate fails on one of the check points. + */ + public static void ValidateCertificate( + X509Certificate cert) + { + if (cert.Version != 3) + throw new ArgumentException("Certificate must have an ExtendedKeyUsage extension."); + + Asn1OctetString ext = cert.GetExtensionValue(X509Extensions.ExtendedKeyUsage); + if (ext == null) + throw new TspValidationException("Certificate must have an ExtendedKeyUsage extension."); + + if (!cert.GetCriticalExtensionOids().Contains(X509Extensions.ExtendedKeyUsage.Id)) + throw new TspValidationException("Certificate must have an ExtendedKeyUsage extension marked as critical."); + + try + { + ExtendedKeyUsage extKey = ExtendedKeyUsage.GetInstance( + Asn1Object.FromByteArray(ext.GetOctets())); + + if (!extKey.HasKeyPurposeId(KeyPurposeID.IdKPTimeStamping) || extKey.Count != 1) + throw new TspValidationException("ExtendedKeyUsage not solely time stamping."); + } + catch (IOException) + { + throw new TspValidationException("cannot process ExtendedKeyUsage extension"); + } + } + + /// + /// Return the digest algorithm using one of the standard JCA string + /// representations rather than the algorithm identifier (if possible). + /// + internal static string GetDigestAlgName( + string digestAlgOID) + { + string digestName = (string) digestNames[digestAlgOID]; + + return digestName != null ? digestName : digestAlgOID; + } + + internal static int GetDigestLength( + string digestAlgOID) + { + if (!digestLengths.Contains(digestAlgOID)) + throw new TspException("digest algorithm cannot be found."); + + return (int)digestLengths[digestAlgOID]; + } + + internal static IDigest CreateDigestInstance( + String digestAlgOID) + { + string digestName = GetDigestAlgName(digestAlgOID); + + return DigestUtilities.GetDigest(digestName); + } + + internal static ISet GetCriticalExtensionOids(X509Extensions extensions) + { + if (extensions == null) + return EmptySet; + + return CollectionUtilities.ReadOnly(new HashSet(extensions.GetCriticalExtensionOids())); + } + + internal static ISet GetNonCriticalExtensionOids(X509Extensions extensions) + { + if (extensions == null) + return EmptySet; + + // TODO: should probably produce a set that imposes correct ordering + return CollectionUtilities.ReadOnly(new HashSet(extensions.GetNonCriticalExtensionOids())); + } + + internal static IList GetExtensionOids(X509Extensions extensions) + { + if (extensions == null) + return EmptyList; + + return CollectionUtilities.ReadOnly(BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(extensions.GetExtensionOids())); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPUtil.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPUtil.cs.meta new file mode 100644 index 00000000..26a89878 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPUtil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ac5ae719ecc37554b9cf608fb87fef41 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPValidationException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPValidationException.cs new file mode 100644 index 00000000..cb6b7e61 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPValidationException.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + /** + * Exception thrown if a TSP request or response fails to validate. + *

    + * If a failure code is associated with the exception it can be retrieved using + * the getFailureCode() method.

    + */ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class TspValidationException + : TspException + { + private int failureCode; + + public TspValidationException( + string message) + : base(message) + { + this.failureCode = -1; + } + + public TspValidationException( + string message, + int failureCode) + : base(message) + { + this.failureCode = failureCode; + } + + /** + * Return the failure code associated with this exception - if one is set. + * + * @return the failure code if set, -1 otherwise. + */ + public int FailureCode + { + get { return failureCode; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPValidationException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPValidationException.cs.meta new file mode 100644 index 00000000..47e130e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TSPValidationException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 17b0d10ccf7ab7c4c815f6d81d87f6bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequest.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequest.cs new file mode 100644 index 00000000..975424a8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequest.cs @@ -0,0 +1,190 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + /** + * Base class for an RFC 3161 Time Stamp Request. + */ + public class TimeStampRequest + : X509ExtensionBase + { + private TimeStampReq req; + private X509Extensions extensions; + + public TimeStampRequest( + TimeStampReq req) + { + this.req = req; + this.extensions = req.Extensions; + } + + /** + * Create a TimeStampRequest from the past in byte array. + * + * @param req byte array containing the request. + * @throws IOException if the request is malformed. + */ + public TimeStampRequest( + byte[] req) + : this(new Asn1InputStream(req)) + { + } + + /** + * Create a TimeStampRequest from the past in input stream. + * + * @param in input stream containing the request. + * @throws IOException if the request is malformed. + */ + public TimeStampRequest( + Stream input) + : this(new Asn1InputStream(input)) + { + } + + private TimeStampRequest( + Asn1InputStream str) + { + try + { + this.req = TimeStampReq.GetInstance(str.ReadObject()); + } + catch (InvalidCastException e) + { + throw new IOException("malformed request: " + e); + } + catch (ArgumentException e) + { + throw new IOException("malformed request: " + e); + } + } + + public int Version + { + get { return req.Version.Value.IntValue; } + } + + public string MessageImprintAlgOid + { + get { return req.MessageImprint.HashAlgorithm.Algorithm.Id; } + } + + public byte[] GetMessageImprintDigest() + { + return req.MessageImprint.GetHashedMessage(); + } + + public string ReqPolicy + { + get + { + return req.ReqPolicy == null + ? null + : req.ReqPolicy.Id; + } + } + + public BigInteger Nonce + { + get + { + return req.Nonce == null + ? null + : req.Nonce.Value; + } + } + + public bool CertReq + { + get + { + return req.CertReq == null + ? false + : req.CertReq.IsTrue; + } + } + + /** + * Validate the timestamp request, checking the digest to see if it is of an + * accepted type and whether it is of the correct length for the algorithm specified. + * + * @param algorithms a set of string OIDS giving accepted algorithms. + * @param policies if non-null a set of policies we are willing to sign under. + * @param extensions if non-null a set of extensions we are willing to accept. + * @throws TspException if the request is invalid, or processing fails. + */ + public void Validate( + IList algorithms, + IList policies, + IList extensions) + { + if (!algorithms.Contains(this.MessageImprintAlgOid)) + throw new TspValidationException("request contains unknown algorithm", PkiFailureInfo.BadAlg); + + if (policies != null && this.ReqPolicy != null && !policies.Contains(this.ReqPolicy)) + throw new TspValidationException("request contains unknown policy", PkiFailureInfo.UnacceptedPolicy); + + if (this.Extensions != null && extensions != null) + { + foreach (DerObjectIdentifier oid in this.Extensions.ExtensionOids) + { + if (!extensions.Contains(oid.Id)) + throw new TspValidationException("request contains unknown extension", PkiFailureInfo.UnacceptedExtension); + } + } + + int digestLength = TspUtil.GetDigestLength(this.MessageImprintAlgOid); + + if (digestLength != this.GetMessageImprintDigest().Length) + throw new TspValidationException("imprint digest the wrong length", PkiFailureInfo.BadDataFormat); + } + + /** + * return the ASN.1 encoded representation of this object. + */ + public byte[] GetEncoded() + { + return req.GetEncoded(); + } + + internal X509Extensions Extensions + { + get { return req.Extensions; } + } + + public virtual bool HasExtensions + { + get { return extensions != null; } + } + + public virtual X509Extension GetExtension(DerObjectIdentifier oid) + { + return extensions == null ? null : extensions.GetExtension(oid); + } + + public virtual IList GetExtensionOids() + { + return TspUtil.GetExtensionOids(extensions); + } + + protected override X509Extensions GetX509Extensions() + { + return Extensions; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequest.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequest.cs.meta new file mode 100644 index 00000000..04933edf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3f95e3ff8f9fee4d8c530f910ce5104 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequestGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequestGenerator.cs new file mode 100644 index 00000000..0b1474af --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequestGenerator.cs @@ -0,0 +1,143 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + /** + * Generator for RFC 3161 Time Stamp Request objects. + */ + public class TimeStampRequestGenerator + { + private DerObjectIdentifier reqPolicy; + + private DerBoolean certReq; + + private IDictionary extensions = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private IList extOrdering = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + public void SetReqPolicy( + string reqPolicy) + { + this.reqPolicy = new DerObjectIdentifier(reqPolicy); + } + + public void SetCertReq( + bool certReq) + { + this.certReq = DerBoolean.GetInstance(certReq); + } + + /** + * add a given extension field for the standard extensions tag (tag 3) + * @throws IOException + */ + [Obsolete("Use method taking DerObjectIdentifier")] + public void AddExtension( + string oid, + bool critical, + Asn1Encodable value) + { + this.AddExtension(oid, critical, value.GetEncoded()); + } + + /** + * add a given extension field for the standard extensions tag + * The value parameter becomes the contents of the octet string associated + * with the extension. + */ + [Obsolete("Use method taking DerObjectIdentifier")] + public void AddExtension( + string oid, + bool critical, + byte[] value) + { + DerObjectIdentifier derOid = new DerObjectIdentifier(oid); + extensions[derOid] = new X509Extension(critical, new DerOctetString(value)); + extOrdering.Add(derOid); + } + + /** + * add a given extension field for the standard extensions tag (tag 3) + * @throws IOException + */ + public virtual void AddExtension( + DerObjectIdentifier oid, + bool critical, + Asn1Encodable extValue) + { + this.AddExtension(oid, critical, extValue.GetEncoded()); + } + + /** + * add a given extension field for the standard extensions tag + * The value parameter becomes the contents of the octet string associated + * with the extension. + */ + public virtual void AddExtension( + DerObjectIdentifier oid, + bool critical, + byte[] extValue) + { + extensions.Add(oid, new X509Extension(critical, new DerOctetString(extValue))); + extOrdering.Add(oid); + } + + public TimeStampRequest Generate( + string digestAlgorithm, + byte[] digest) + { + return this.Generate(digestAlgorithm, digest, null); + } + + public TimeStampRequest Generate( + string digestAlgorithmOid, + byte[] digest, + BigInteger nonce) + { + if (digestAlgorithmOid == null) + { + throw new ArgumentException("No digest algorithm specified"); + } + + DerObjectIdentifier digestAlgOid = new DerObjectIdentifier(digestAlgorithmOid); + + AlgorithmIdentifier algID = new AlgorithmIdentifier(digestAlgOid, DerNull.Instance); + MessageImprint messageImprint = new MessageImprint(algID, digest); + + X509Extensions ext = null; + + if (extOrdering.Count != 0) + { + ext = new X509Extensions(extOrdering, extensions); + } + + DerInteger derNonce = nonce == null + ? null + : new DerInteger(nonce); + + return new TimeStampRequest( + new TimeStampReq(messageImprint, reqPolicy, derNonce, certReq, ext)); + } + + public virtual TimeStampRequest Generate(DerObjectIdentifier digestAlgorithm, byte[] digest) + { + return Generate(digestAlgorithm.Id, digest); + } + + public virtual TimeStampRequest Generate(DerObjectIdentifier digestAlgorithm, byte[] digest, BigInteger nonce) + { + return Generate(digestAlgorithm.Id, digest, nonce); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequestGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequestGenerator.cs.meta new file mode 100644 index 00000000..8e1f720f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampRequestGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1cb85a8797248f249a9b03c64d756801 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponse.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponse.cs new file mode 100644 index 00000000..5897c59c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponse.cs @@ -0,0 +1,188 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + /** + * Base class for an RFC 3161 Time Stamp Response object. + */ + public class TimeStampResponse + { + private TimeStampResp resp; + private TimeStampToken timeStampToken; + + public TimeStampResponse( + TimeStampResp resp) + { + this.resp = resp; + + if (resp.TimeStampToken != null) + { + timeStampToken = new TimeStampToken(resp.TimeStampToken); + } + } + + /** + * Create a TimeStampResponse from a byte array containing an ASN.1 encoding. + * + * @param resp the byte array containing the encoded response. + * @throws TspException if the response is malformed. + * @throws IOException if the byte array doesn't represent an ASN.1 encoding. + */ + public TimeStampResponse( + byte[] resp) + : this(readTimeStampResp(new Asn1InputStream(resp))) + { + } + + /** + * Create a TimeStampResponse from an input stream containing an ASN.1 encoding. + * + * @param input the input stream containing the encoded response. + * @throws TspException if the response is malformed. + * @throws IOException if the stream doesn't represent an ASN.1 encoding. + */ + public TimeStampResponse( + Stream input) + : this(readTimeStampResp(new Asn1InputStream(input))) + { + } + + private static TimeStampResp readTimeStampResp( + Asn1InputStream input) + { + try + { + return TimeStampResp.GetInstance(input.ReadObject()); + } + catch (ArgumentException e) + { + throw new TspException("malformed timestamp response: " + e, e); + } + catch (InvalidCastException e) + { + throw new TspException("malformed timestamp response: " + e, e); + } + } + + public int Status + { + get { return resp.Status.Status.IntValue; } + } + + public string GetStatusString() + { + if (resp.Status.StatusString == null) + { + return null; + } + + StringBuilder statusStringBuf = new StringBuilder(); + PkiFreeText text = resp.Status.StatusString; + for (int i = 0; i != text.Count; i++) + { + statusStringBuf.Append(text[i].GetString()); + } + + return statusStringBuf.ToString(); + } + + public PkiFailureInfo GetFailInfo() + { + if (resp.Status.FailInfo == null) + { + return null; + } + + return new PkiFailureInfo(resp.Status.FailInfo); + } + + public TimeStampToken TimeStampToken + { + get { return timeStampToken; } + } + + /** + * Check this response against to see if it a well formed response for + * the passed in request. Validation will include checking the time stamp + * token if the response status is GRANTED or GRANTED_WITH_MODS. + * + * @param request the request to be checked against + * @throws TspException if the request can not match this response. + */ + public void Validate( + TimeStampRequest request) + { + TimeStampToken tok = this.TimeStampToken; + + if (tok != null) + { + TimeStampTokenInfo tstInfo = tok.TimeStampInfo; + + if (request.Nonce != null && !request.Nonce.Equals(tstInfo.Nonce)) + { + throw new TspValidationException("response contains wrong nonce value."); + } + + if (this.Status != (int) PkiStatus.Granted && this.Status != (int) PkiStatus.GrantedWithMods) + { + throw new TspValidationException("time stamp token found in failed request."); + } + + if (!Arrays.ConstantTimeAreEqual(request.GetMessageImprintDigest(), tstInfo.GetMessageImprintDigest())) + { + throw new TspValidationException("response for different message imprint digest."); + } + + if (!tstInfo.MessageImprintAlgOid.Equals(request.MessageImprintAlgOid)) + { + throw new TspValidationException("response for different message imprint algorithm."); + } + + Asn1.Cms.Attribute scV1 = tok.SignedAttributes[PkcsObjectIdentifiers.IdAASigningCertificate]; + Asn1.Cms.Attribute scV2 = tok.SignedAttributes[PkcsObjectIdentifiers.IdAASigningCertificateV2]; + + if (scV1 == null && scV2 == null) + { + throw new TspValidationException("no signing certificate attribute present."); + } + + if (scV1 != null && scV2 != null) + { + /* + * RFC 5035 5.4. If both attributes exist in a single message, + * they are independently evaluated. + */ + } + + if (request.ReqPolicy != null && !request.ReqPolicy.Equals(tstInfo.Policy)) + { + throw new TspValidationException("TSA policy wrong for request."); + } + } + else if (this.Status == (int) PkiStatus.Granted || this.Status == (int) PkiStatus.GrantedWithMods) + { + throw new TspValidationException("no time stamp token found and one expected."); + } + } + + /** + * return the ASN.1 encoded representation of this object. + */ + public byte[] GetEncoded() + { + return resp.GetEncoded(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponse.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponse.cs.meta new file mode 100644 index 00000000..e965991a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b7d9336b3bad4448a81aa956426c6d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponseGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponseGenerator.cs new file mode 100644 index 00000000..21b170bd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponseGenerator.cs @@ -0,0 +1,213 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cmp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + /** + * Generator for RFC 3161 Time Stamp Responses. + */ + public class TimeStampResponseGenerator + { + private PkiStatus status; + + private Asn1EncodableVector statusStrings; + + private int failInfo; + private TimeStampTokenGenerator tokenGenerator; + private IList acceptedAlgorithms; + private IList acceptedPolicies; + private IList acceptedExtensions; + + public TimeStampResponseGenerator( + TimeStampTokenGenerator tokenGenerator, + IList acceptedAlgorithms) + : this(tokenGenerator, acceptedAlgorithms, null, null) + { + } + + public TimeStampResponseGenerator( + TimeStampTokenGenerator tokenGenerator, + IList acceptedAlgorithms, + IList acceptedPolicy) + : this(tokenGenerator, acceptedAlgorithms, acceptedPolicy, null) + { + } + + public TimeStampResponseGenerator( + TimeStampTokenGenerator tokenGenerator, + IList acceptedAlgorithms, + IList acceptedPolicies, + IList acceptedExtensions) + { + this.tokenGenerator = tokenGenerator; + this.acceptedAlgorithms = acceptedAlgorithms; + this.acceptedPolicies = acceptedPolicies; + this.acceptedExtensions = acceptedExtensions; + + statusStrings = new Asn1EncodableVector(); + } + + private void AddStatusString(string statusString) + { + statusStrings.Add(new DerUtf8String(statusString)); + } + + private void SetFailInfoField(int field) + { + failInfo |= field; + } + + private PkiStatusInfo GetPkiStatusInfo() + { + Asn1EncodableVector v = new Asn1EncodableVector( + new DerInteger((int)status)); + + if (statusStrings.Count > 0) + { + v.Add(new PkiFreeText(new DerSequence(statusStrings))); + } + + if (failInfo != 0) + { + v.Add(new FailInfo(failInfo)); + } + + return new PkiStatusInfo(new DerSequence(v)); + } + + public TimeStampResponse Generate( + TimeStampRequest request, + BigInteger serialNumber, + DateTime genTime) + { + return Generate(request, serialNumber, new DateTimeObject(genTime)); + } + + /** + * Return an appropriate TimeStampResponse. + *

    + * If genTime is null a timeNotAvailable error response will be returned. + * + * @param request the request this response is for. + * @param serialNumber serial number for the response token. + * @param genTime generation time for the response token. + * @param provider provider to use for signature calculation. + * @return + * @throws NoSuchAlgorithmException + * @throws NoSuchProviderException + * @throws TSPException + *

    + */ + public TimeStampResponse Generate( + TimeStampRequest request, + BigInteger serialNumber, + DateTimeObject genTime) + { + TimeStampResp resp; + + try + { + if (genTime == null) + throw new TspValidationException("The time source is not available.", + PkiFailureInfo.TimeNotAvailable); + + request.Validate(acceptedAlgorithms, acceptedPolicies, acceptedExtensions); + + this.status = PkiStatus.Granted; + this.AddStatusString("Operation Okay"); + + PkiStatusInfo pkiStatusInfo = GetPkiStatusInfo(); + + ContentInfo tstTokenContentInfo; + try + { + TimeStampToken token = tokenGenerator.Generate(request, serialNumber, genTime.Value); + byte[] encoded = token.ToCmsSignedData().GetEncoded(); + + tstTokenContentInfo = ContentInfo.GetInstance(Asn1Object.FromByteArray(encoded)); + } + catch (IOException e) + { + throw new TspException("Timestamp token received cannot be converted to ContentInfo", e); + } + + resp = new TimeStampResp(pkiStatusInfo, tstTokenContentInfo); + } + catch (TspValidationException e) + { + status = PkiStatus.Rejection; + + this.SetFailInfoField(e.FailureCode); + this.AddStatusString(e.Message); + + PkiStatusInfo pkiStatusInfo = GetPkiStatusInfo(); + + resp = new TimeStampResp(pkiStatusInfo, null); + } + + try + { + return new TimeStampResponse(resp); + } + catch (IOException e) + { + throw new TspException("created badly formatted response!", e); + } + } + + class FailInfo + : DerBitString + { + internal FailInfo(int failInfoValue) + : base(failInfoValue) + { + } + } + + /** + * Generate a TimeStampResponse with chosen status and FailInfoField. + * + * @param status the PKIStatus to set. + * @param failInfoField the FailInfoField to set. + * @param statusString an optional string describing the failure. + * @return a TimeStampResponse with a failInfoField and optional statusString + * @throws TSPException in case the response could not be created + */ + public TimeStampResponse GenerateFailResponse(PkiStatus status, int failInfoField, string statusString) + { + this.status = status; + + this.SetFailInfoField(failInfoField); + + if (statusString != null) + { + this.AddStatusString(statusString); + } + + PkiStatusInfo pkiStatusInfo = GetPkiStatusInfo(); + + TimeStampResp resp = new TimeStampResp(pkiStatusInfo, null); + + try + { + return new TimeStampResponse(resp); + } + catch (IOException e) + { + throw new TspException("created badly formatted response!", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponseGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponseGenerator.cs.meta new file mode 100644 index 00000000..b0393288 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampResponseGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31244340abddb5d4ca611f3cc612ee24 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampToken.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampToken.cs new file mode 100644 index 00000000..02bc29d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampToken.cs @@ -0,0 +1,309 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + public class TimeStampToken + { + private readonly CmsSignedData tsToken; + private readonly SignerInformation tsaSignerInfo; +// private readonly DateTime genTime; + private readonly TimeStampTokenInfo tstInfo; + private readonly CertID certID; + + public TimeStampToken( + Asn1.Cms.ContentInfo contentInfo) + : this(new CmsSignedData(contentInfo)) + { + } + + public TimeStampToken( + CmsSignedData signedData) + { + this.tsToken = signedData; + + if (!this.tsToken.SignedContentType.Equals(PkcsObjectIdentifiers.IdCTTstInfo)) + { + throw new TspValidationException("ContentInfo object not for a time stamp."); + } + + ICollection signers = tsToken.GetSignerInfos().GetSigners(); + + if (signers.Count != 1) + { + throw new ArgumentException("Time-stamp token signed by " + + signers.Count + + " signers, but it must contain just the TSA signature."); + } + + + IEnumerator signerEnum = signers.GetEnumerator(); + + signerEnum.MoveNext(); + tsaSignerInfo = (SignerInformation) signerEnum.Current; + + try + { + CmsProcessable content = tsToken.SignedContent; + MemoryStream bOut = new MemoryStream(); + + content.Write(bOut); + + this.tstInfo = new TimeStampTokenInfo( + TstInfo.GetInstance( + Asn1Object.FromByteArray(bOut.ToArray()))); + + Asn1.Cms.Attribute attr = tsaSignerInfo.SignedAttributes[ + PkcsObjectIdentifiers.IdAASigningCertificate]; + +// if (attr == null) +// { +// throw new TspValidationException( +// "no signing certificate attribute found, time stamp invalid."); +// } +// +// SigningCertificate signCert = SigningCertificate.GetInstance( +// attr.AttrValues[0]); +// +// this.certID = EssCertID.GetInstance(signCert.GetCerts()[0]); + + if (attr != null) + { + SigningCertificate signCert = SigningCertificate.GetInstance(attr.AttrValues[0]); + + this.certID = new CertID(EssCertID.GetInstance(signCert.GetCerts()[0])); + } + else + { + attr = tsaSignerInfo.SignedAttributes[PkcsObjectIdentifiers.IdAASigningCertificateV2]; + + if (attr == null) + throw new TspValidationException("no signing certificate attribute found, time stamp invalid."); + + SigningCertificateV2 signCertV2 = SigningCertificateV2.GetInstance(attr.AttrValues[0]); + + this.certID = new CertID(EssCertIDv2.GetInstance(signCertV2.GetCerts()[0])); + } + } + catch (CmsException e) + { + throw new TspException(e.Message, e.InnerException); + } + } + + public TimeStampTokenInfo TimeStampInfo + { + get { return tstInfo; } + } + + public SignerID SignerID + { + get { return tsaSignerInfo.SignerID; } + } + + public Asn1.Cms.AttributeTable SignedAttributes + { + get { return tsaSignerInfo.SignedAttributes; } + } + + public Asn1.Cms.AttributeTable UnsignedAttributes + { + get { return tsaSignerInfo.UnsignedAttributes; } + } + + public IX509Store GetCertificates( + string type) + { + return tsToken.GetCertificates(type); + } + + public IX509Store GetCrls( + string type) + { + return tsToken.GetCrls(type); + } + + public IX509Store GetAttributeCertificates( + string type) + { + return tsToken.GetAttributeCertificates(type); + } + + /** + * Validate the time stamp token. + *

    + * To be valid the token must be signed by the passed in certificate and + * the certificate must be the one referred to by the SigningCertificate + * attribute included in the hashed attributes of the token. The + * certificate must also have the ExtendedKeyUsageExtension with only + * KeyPurposeID.IdKPTimeStamping and have been valid at the time the + * timestamp was created. + *

    + *

    + * A successful call to validate means all the above are true. + *

    + */ + public void Validate( + X509Certificate cert) + { + try + { + byte[] hash = DigestUtilities.CalculateDigest( + certID.GetHashAlgorithmName(), cert.GetEncoded()); + + if (!Arrays.ConstantTimeAreEqual(certID.GetCertHash(), hash)) + { + throw new TspValidationException("certificate hash does not match certID hash."); + } + + if (certID.IssuerSerial != null) + { + if (!certID.IssuerSerial.Serial.Value.Equals(cert.SerialNumber)) + { + throw new TspValidationException("certificate serial number does not match certID for signature."); + } + + GeneralName[] names = certID.IssuerSerial.Issuer.GetNames(); + X509Name principal = PrincipalUtilities.GetIssuerX509Principal(cert); + bool found = false; + + for (int i = 0; i != names.Length; i++) + { + if (names[i].TagNo == 4 + && X509Name.GetInstance(names[i].Name).Equivalent(principal)) + { + found = true; + break; + } + } + + if (!found) + { + throw new TspValidationException("certificate name does not match certID for signature. "); + } + } + + TspUtil.ValidateCertificate(cert); + + cert.CheckValidity(tstInfo.GenTime); + + if (!tsaSignerInfo.Verify(cert)) + { + throw new TspValidationException("signature not created by certificate."); + } + } + catch (CmsException e) + { + if (e.InnerException != null) + { + throw new TspException(e.Message, e.InnerException); + } + + throw new TspException("CMS exception: " + e, e); + } + catch (CertificateEncodingException e) + { + throw new TspException("problem processing certificate: " + e, e); + } + catch (SecurityUtilityException e) + { + throw new TspException("cannot find algorithm: " + e.Message, e); + } + } + + /** + * Return the underlying CmsSignedData object. + * + * @return the underlying CMS structure. + */ + public CmsSignedData ToCmsSignedData() + { + return tsToken; + } + + /** + * Return a ASN.1 encoded byte stream representing the encoded object. + * + * @throws IOException if encoding fails. + */ + public byte[] GetEncoded() + { + return tsToken.GetEncoded(); + } + + + // perhaps this should be done using an interface on the ASN.1 classes... + private class CertID + { + private EssCertID certID; + private EssCertIDv2 certIDv2; + + internal CertID(EssCertID certID) + { + this.certID = certID; + this.certIDv2 = null; + } + + internal CertID(EssCertIDv2 certID) + { + this.certIDv2 = certID; + this.certID = null; + } + + public string GetHashAlgorithmName() + { + if (certID != null) + return "SHA-1"; + + if (NistObjectIdentifiers.IdSha256.Equals(certIDv2.HashAlgorithm.Algorithm)) + return "SHA-256"; + + return certIDv2.HashAlgorithm.Algorithm.Id; + } + + public AlgorithmIdentifier GetHashAlgorithm() + { + return (certID != null) + ? new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1) + : certIDv2.HashAlgorithm; + } + + public byte[] GetCertHash() + { + return certID != null + ? certID.GetCertHash() + : certIDv2.GetCertHash(); + } + + public IssuerSerial IssuerSerial + { + get + { + return certID != null + ? certID.IssuerSerial + : certIDv2.IssuerSerial; + } + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampToken.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampToken.cs.meta new file mode 100644 index 00000000..c198a606 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampToken.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e001862fca691964183bd415e4c373b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenGenerator.cs new file mode 100644 index 00000000..f769f5cb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenGenerator.cs @@ -0,0 +1,249 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Ess; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Cms; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + public class TimeStampTokenGenerator + { + private int accuracySeconds = -1; + private int accuracyMillis = -1; + private int accuracyMicros = -1; + private bool ordering = false; + private GeneralName tsa = null; + private string tsaPolicyOID; + + private AsymmetricKeyParameter key; + private X509Certificate cert; + private string digestOID; + private Asn1.Cms.AttributeTable signedAttr; + private Asn1.Cms.AttributeTable unsignedAttr; + private IX509Store x509Certs; + private IX509Store x509Crls; + + /** + * basic creation - only the default attributes will be included here. + */ + public TimeStampTokenGenerator( + AsymmetricKeyParameter key, + X509Certificate cert, + string digestOID, + string tsaPolicyOID) + : this(key, cert, digestOID, tsaPolicyOID, null, null) + { + } + + /** + * create with a signer with extra signed/unsigned attributes. + */ + public TimeStampTokenGenerator( + AsymmetricKeyParameter key, + X509Certificate cert, + string digestOID, + string tsaPolicyOID, + Asn1.Cms.AttributeTable signedAttr, + Asn1.Cms.AttributeTable unsignedAttr) + { + this.key = key; + this.cert = cert; + this.digestOID = digestOID; + this.tsaPolicyOID = tsaPolicyOID; + this.unsignedAttr = unsignedAttr; + + TspUtil.ValidateCertificate(cert); + + // + // Add the ESSCertID attribute + // + IDictionary signedAttrs; + if (signedAttr != null) + { + signedAttrs = signedAttr.ToDictionary(); + } + else + { + signedAttrs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + } + + try + { + byte[] hash = DigestUtilities.CalculateDigest("SHA-1", cert.GetEncoded()); + + EssCertID essCertid = new EssCertID(hash); + + Asn1.Cms.Attribute attr = new Asn1.Cms.Attribute( + PkcsObjectIdentifiers.IdAASigningCertificate, + new DerSet(new SigningCertificate(essCertid))); + + signedAttrs[attr.AttrType] = attr; + } + catch (CertificateEncodingException e) + { + throw new TspException("Exception processing certificate.", e); + } + catch (SecurityUtilityException e) + { + throw new TspException("Can't find a SHA-1 implementation.", e); + } + + this.signedAttr = new Asn1.Cms.AttributeTable(signedAttrs); + } + + public void SetCertificates( + IX509Store certificates) + { + this.x509Certs = certificates; + } + + public void SetCrls( + IX509Store crls) + { + this.x509Crls = crls; + } + + public void SetAccuracySeconds( + int accuracySeconds) + { + this.accuracySeconds = accuracySeconds; + } + + public void SetAccuracyMillis( + int accuracyMillis) + { + this.accuracyMillis = accuracyMillis; + } + + public void SetAccuracyMicros( + int accuracyMicros) + { + this.accuracyMicros = accuracyMicros; + } + + public void SetOrdering( + bool ordering) + { + this.ordering = ordering; + } + + public void SetTsa( + GeneralName tsa) + { + this.tsa = tsa; + } + + //------------------------------------------------------------------------------ + + public TimeStampToken Generate( + TimeStampRequest request, + BigInteger serialNumber, + DateTime genTime) + { + DerObjectIdentifier digestAlgOID = new DerObjectIdentifier(request.MessageImprintAlgOid); + + AlgorithmIdentifier algID = new AlgorithmIdentifier(digestAlgOID, DerNull.Instance); + MessageImprint messageImprint = new MessageImprint(algID, request.GetMessageImprintDigest()); + + Accuracy accuracy = null; + if (accuracySeconds > 0 || accuracyMillis > 0 || accuracyMicros > 0) + { + DerInteger seconds = null; + if (accuracySeconds > 0) + { + seconds = new DerInteger(accuracySeconds); + } + + DerInteger millis = null; + if (accuracyMillis > 0) + { + millis = new DerInteger(accuracyMillis); + } + + DerInteger micros = null; + if (accuracyMicros > 0) + { + micros = new DerInteger(accuracyMicros); + } + + accuracy = new Accuracy(seconds, millis, micros); + } + + DerBoolean derOrdering = null; + if (ordering) + { + derOrdering = DerBoolean.GetInstance(ordering); + } + + DerInteger nonce = null; + if (request.Nonce != null) + { + nonce = new DerInteger(request.Nonce); + } + + DerObjectIdentifier tsaPolicy = new DerObjectIdentifier(tsaPolicyOID); + if (request.ReqPolicy != null) + { + tsaPolicy = new DerObjectIdentifier(request.ReqPolicy); + } + + TstInfo tstInfo = new TstInfo(tsaPolicy, messageImprint, + new DerInteger(serialNumber), new DerGeneralizedTime(genTime), accuracy, + derOrdering, nonce, tsa, request.Extensions); + + try + { + CmsSignedDataGenerator signedDataGenerator = new CmsSignedDataGenerator(); + + byte[] derEncodedTstInfo = tstInfo.GetDerEncoded(); + + if (request.CertReq) + { + signedDataGenerator.AddCertificates(x509Certs); + } + + signedDataGenerator.AddCrls(x509Crls); + signedDataGenerator.AddSigner(key, cert, digestOID, signedAttr, unsignedAttr); + + CmsSignedData signedData = signedDataGenerator.Generate( + PkcsObjectIdentifiers.IdCTTstInfo.Id, + new CmsProcessableByteArray(derEncodedTstInfo), + true); + + return new TimeStampToken(signedData); + } + catch (CmsException cmsEx) + { + throw new TspException("Error generating time-stamp token", cmsEx); + } + catch (IOException e) + { + throw new TspException("Exception encoding info", e); + } + catch (X509StoreException e) + { + throw new TspException("Exception handling CertStore", e); + } +// catch (InvalidAlgorithmParameterException e) +// { +// throw new TspException("Exception handling CertStore CRLs", e); +// } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenGenerator.cs.meta new file mode 100644 index 00000000..b2c1d5e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9d1991286d37694478ba89a7c392c9bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenInfo.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenInfo.cs new file mode 100644 index 00000000..16d26df2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenInfo.cs @@ -0,0 +1,111 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Tsp; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Tsp +{ + public class TimeStampTokenInfo + { + private TstInfo tstInfo; + private DateTime genTime; + + public TimeStampTokenInfo( + TstInfo tstInfo) + { + this.tstInfo = tstInfo; + + try + { + this.genTime = tstInfo.GenTime.ToDateTime(); + } + catch (Exception e) + { + throw new TspException("unable to parse genTime field: " + e.Message); + } + } + + public bool IsOrdered + { + get { return tstInfo.Ordering.IsTrue; } + } + + public Accuracy Accuracy + { + get { return tstInfo.Accuracy; } + } + + public DateTime GenTime + { + get { return genTime; } + } + + public GenTimeAccuracy GenTimeAccuracy + { + get + { + return this.Accuracy == null + ? null + : new GenTimeAccuracy(this.Accuracy); + } + } + + public string Policy + { + get { return tstInfo.Policy.Id; } + } + + public BigInteger SerialNumber + { + get { return tstInfo.SerialNumber.Value; } + } + + public GeneralName Tsa + { + get { return tstInfo.Tsa; } + } + + /** + * @return the nonce value, null if there isn't one. + */ + public BigInteger Nonce + { + get + { + return tstInfo.Nonce == null + ? null + : tstInfo.Nonce.Value; + } + } + + public AlgorithmIdentifier HashAlgorithm + { + get { return tstInfo.MessageImprint.HashAlgorithm; } + } + + public string MessageImprintAlgOid + { + get { return tstInfo.MessageImprint.HashAlgorithm.Algorithm.Id; } + } + + public byte[] GetMessageImprintDigest() + { + return tstInfo.MessageImprint.GetHashedMessage(); + } + + public byte[] GetEncoded() + { + return tstInfo.GetEncoded(); + } + + public TstInfo TstInfo + { + get { return tstInfo; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenInfo.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenInfo.cs.meta new file mode 100644 index 00000000..e5b6969e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/tsp/TimeStampTokenInfo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb197672beb7bd749971431ab1bb00bf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util.meta new file mode 100644 index 00000000..d3cc9ad7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ba5cad752407f8545a6d90f346edc648 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Arrays.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Arrays.cs new file mode 100644 index 00000000..0200ce8a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Arrays.cs @@ -0,0 +1,729 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities +{ + /// General array utilities. + public abstract class Arrays + { + public static readonly byte[] EmptyBytes = new byte[0]; + public static readonly int[] EmptyInts = new int[0]; + + public static bool AreAllZeroes(byte[] buf, int off, int len) + { + uint bits = 0; + for (int i = 0; i < len; ++i) + { + bits |= buf[off + i]; + } + return bits == 0; + } + + public static bool AreEqual( + bool[] a, + bool[] b) + { + if (a == b) + return true; + + if (a == null || b == null) + return false; + + return HaveSameContents(a, b); + } + + public static bool AreEqual( + char[] a, + char[] b) + { + if (a == b) + return true; + + if (a == null || b == null) + return false; + + return HaveSameContents(a, b); + } + + /// + /// Are two arrays equal. + /// + /// Left side. + /// Right side. + /// True if equal. + public static bool AreEqual( + byte[] a, + byte[] b) + { + if (a == b) + return true; + + if (a == null || b == null) + return false; + + return HaveSameContents(a, b); + } + + [Obsolete("Use 'AreEqual' method instead")] + public static bool AreSame( + byte[] a, + byte[] b) + { + return AreEqual(a, b); + } + + /// + /// A constant time equals comparison - does not terminate early if + /// test will fail. + /// + /// first array + /// second array + /// true if arrays equal, false otherwise. + public static bool ConstantTimeAreEqual( + byte[] a, + byte[] b) + { + int i = a.Length; + if (i != b.Length) + return false; + int cmp = 0; + while (i != 0) + { + --i; + cmp |= (a[i] ^ b[i]); + } + return cmp == 0; + } + + public static bool AreEqual( + int[] a, + int[] b) + { + if (a == b) + return true; + + if (a == null || b == null) + return false; + + return HaveSameContents(a, b); + } + + [CLSCompliantAttribute(false)] + public static bool AreEqual(uint[] a, uint[] b) + { + if (a == b) + return true; + + if (a == null || b == null) + return false; + + return HaveSameContents(a, b); + } + + private static bool HaveSameContents( + bool[] a, + bool[] b) + { + int i = a.Length; + if (i != b.Length) + return false; + while (i != 0) + { + --i; + if (a[i] != b[i]) + return false; + } + return true; + } + + private static bool HaveSameContents( + char[] a, + char[] b) + { + int i = a.Length; + if (i != b.Length) + return false; + while (i != 0) + { + --i; + if (a[i] != b[i]) + return false; + } + return true; + } + + private static bool HaveSameContents( + byte[] a, + byte[] b) + { + int i = a.Length; + if (i != b.Length) + return false; + while (i != 0) + { + --i; + if (a[i] != b[i]) + return false; + } + return true; + } + + private static bool HaveSameContents( + int[] a, + int[] b) + { + int i = a.Length; + if (i != b.Length) + return false; + while (i != 0) + { + --i; + if (a[i] != b[i]) + return false; + } + return true; + } + + private static bool HaveSameContents(uint[] a, uint[] b) + { + int i = a.Length; + if (i != b.Length) + return false; + while (i != 0) + { + --i; + if (a[i] != b[i]) + return false; + } + return true; + } + + public static string ToString( + object[] a) + { + StringBuilder sb = new StringBuilder('['); + if (a.Length > 0) + { + sb.Append(a[0]); + for (int index = 1; index < a.Length; ++index) + { + sb.Append(", ").Append(a[index]); + } + } + sb.Append(']'); + return sb.ToString(); + } + + public static int GetHashCode(byte[] data) + { + if (data == null) + { + return 0; + } + + int i = data.Length; + int hc = i + 1; + + while (--i >= 0) + { + hc *= 257; + hc ^= data[i]; + } + + return hc; + } + + public static int GetHashCode(byte[] data, int off, int len) + { + if (data == null) + { + return 0; + } + + int i = len; + int hc = i + 1; + + while (--i >= 0) + { + hc *= 257; + hc ^= data[off + i]; + } + + return hc; + } + + public static int GetHashCode(int[] data) + { + if (data == null) + return 0; + + int i = data.Length; + int hc = i + 1; + + while (--i >= 0) + { + hc *= 257; + hc ^= data[i]; + } + + return hc; + } + + public static int GetHashCode(int[] data, int off, int len) + { + if (data == null) + return 0; + + int i = len; + int hc = i + 1; + + while (--i >= 0) + { + hc *= 257; + hc ^= data[off + i]; + } + + return hc; + } + + [CLSCompliantAttribute(false)] + public static int GetHashCode(uint[] data) + { + if (data == null) + return 0; + + int i = data.Length; + int hc = i + 1; + + while (--i >= 0) + { + hc *= 257; + hc ^= (int)data[i]; + } + + return hc; + } + + [CLSCompliantAttribute(false)] + public static int GetHashCode(uint[] data, int off, int len) + { + if (data == null) + return 0; + + int i = len; + int hc = i + 1; + + while (--i >= 0) + { + hc *= 257; + hc ^= (int)data[off + i]; + } + + return hc; + } + + [CLSCompliantAttribute(false)] + public static int GetHashCode(ulong[] data) + { + if (data == null) + return 0; + + int i = data.Length; + int hc = i + 1; + + while (--i >= 0) + { + ulong di = data[i]; + hc *= 257; + hc ^= (int)di; + hc *= 257; + hc ^= (int)(di >> 32); + } + + return hc; + } + + [CLSCompliantAttribute(false)] + public static int GetHashCode(ulong[] data, int off, int len) + { + if (data == null) + return 0; + + int i = len; + int hc = i + 1; + + while (--i >= 0) + { + ulong di = data[off + i]; + hc *= 257; + hc ^= (int)di; + hc *= 257; + hc ^= (int)(di >> 32); + } + + return hc; + } + + public static byte[] Clone( + byte[] data) + { + return data == null ? null : (byte[])data.Clone(); + } + + public static byte[] Clone( + byte[] data, + byte[] existing) + { + if (data == null) + { + return null; + } + if ((existing == null) || (existing.Length != data.Length)) + { + return Clone(data); + } + Array.Copy(data, 0, existing, 0, existing.Length); + return existing; + } + + public static int[] Clone( + int[] data) + { + return data == null ? null : (int[])data.Clone(); + } + + internal static uint[] Clone(uint[] data) + { + return data == null ? null : (uint[])data.Clone(); + } + + public static long[] Clone(long[] data) + { + return data == null ? null : (long[])data.Clone(); + } + + [CLSCompliantAttribute(false)] + public static ulong[] Clone( + ulong[] data) + { + return data == null ? null : (ulong[]) data.Clone(); + } + + [CLSCompliantAttribute(false)] + public static ulong[] Clone( + ulong[] data, + ulong[] existing) + { + if (data == null) + { + return null; + } + if ((existing == null) || (existing.Length != data.Length)) + { + return Clone(data); + } + Array.Copy(data, 0, existing, 0, existing.Length); + return existing; + } + + public static bool Contains(byte[] a, byte n) + { + for (int i = 0; i < a.Length; ++i) + { + if (a[i] == n) + return true; + } + return false; + } + + public static bool Contains(short[] a, short n) + { + for (int i = 0; i < a.Length; ++i) + { + if (a[i] == n) + return true; + } + return false; + } + + public static bool Contains(int[] a, int n) + { + for (int i = 0; i < a.Length; ++i) + { + if (a[i] == n) + return true; + } + return false; + } + + public static void Fill( + byte[] buf, + byte b) + { + int i = buf.Length; + while (i > 0) + { + buf[--i] = b; + } + } + + public static void Fill(byte[] buf, int from, int to, byte b) + { + for (int i = from; i < to; ++i) + { + buf[i] = b; + } + } + + public static byte[] CopyOf(byte[] data, int newLength) + { + byte[] tmp = new byte[newLength]; + Array.Copy(data, 0, tmp, 0, System.Math.Min(newLength, data.Length)); + return tmp; + } + + public static char[] CopyOf(char[] data, int newLength) + { + char[] tmp = new char[newLength]; + Array.Copy(data, 0, tmp, 0, System.Math.Min(newLength, data.Length)); + return tmp; + } + + public static int[] CopyOf(int[] data, int newLength) + { + int[] tmp = new int[newLength]; + Array.Copy(data, 0, tmp, 0, System.Math.Min(newLength, data.Length)); + return tmp; + } + + public static long[] CopyOf(long[] data, int newLength) + { + long[] tmp = new long[newLength]; + Array.Copy(data, 0, tmp, 0, System.Math.Min(newLength, data.Length)); + return tmp; + } + + public static BigInteger[] CopyOf(BigInteger[] data, int newLength) + { + BigInteger[] tmp = new BigInteger[newLength]; + Array.Copy(data, 0, tmp, 0, System.Math.Min(newLength, data.Length)); + return tmp; + } + + /** + * Make a copy of a range of bytes from the passed in data array. The range can + * extend beyond the end of the input array, in which case the return array will + * be padded with zeroes. + * + * @param data the array from which the data is to be copied. + * @param from the start index at which the copying should take place. + * @param to the final index of the range (exclusive). + * + * @return a new byte array containing the range given. + */ + public static byte[] CopyOfRange(byte[] data, int from, int to) + { + int newLength = GetLength(from, to); + byte[] tmp = new byte[newLength]; + Array.Copy(data, from, tmp, 0, System.Math.Min(newLength, data.Length - from)); + return tmp; + } + + public static int[] CopyOfRange(int[] data, int from, int to) + { + int newLength = GetLength(from, to); + int[] tmp = new int[newLength]; + Array.Copy(data, from, tmp, 0, System.Math.Min(newLength, data.Length - from)); + return tmp; + } + + public static long[] CopyOfRange(long[] data, int from, int to) + { + int newLength = GetLength(from, to); + long[] tmp = new long[newLength]; + Array.Copy(data, from, tmp, 0, System.Math.Min(newLength, data.Length - from)); + return tmp; + } + + public static BigInteger[] CopyOfRange(BigInteger[] data, int from, int to) + { + int newLength = GetLength(from, to); + BigInteger[] tmp = new BigInteger[newLength]; + Array.Copy(data, from, tmp, 0, System.Math.Min(newLength, data.Length - from)); + return tmp; + } + + private static int GetLength(int from, int to) + { + int newLength = to - from; + if (newLength < 0) + throw new ArgumentException(from + " > " + to); + return newLength; + } + + public static byte[] Append(byte[] a, byte b) + { + if (a == null) + return new byte[] { b }; + + int length = a.Length; + byte[] result = new byte[length + 1]; + Array.Copy(a, 0, result, 0, length); + result[length] = b; + return result; + } + + public static short[] Append(short[] a, short b) + { + if (a == null) + return new short[] { b }; + + int length = a.Length; + short[] result = new short[length + 1]; + Array.Copy(a, 0, result, 0, length); + result[length] = b; + return result; + } + + public static int[] Append(int[] a, int b) + { + if (a == null) + return new int[] { b }; + + int length = a.Length; + int[] result = new int[length + 1]; + Array.Copy(a, 0, result, 0, length); + result[length] = b; + return result; + } + + public static byte[] Concatenate(byte[] a, byte[] b) + { + if (a == null) + return Clone(b); + if (b == null) + return Clone(a); + + byte[] rv = new byte[a.Length + b.Length]; + Array.Copy(a, 0, rv, 0, a.Length); + Array.Copy(b, 0, rv, a.Length, b.Length); + return rv; + } + + public static byte[] ConcatenateAll(params byte[][] vs) + { + byte[][] nonNull = new byte[vs.Length][]; + int count = 0; + int totalLength = 0; + + for (int i = 0; i < vs.Length; ++i) + { + byte[] v = vs[i]; + if (v != null) + { + nonNull[count++] = v; + totalLength += v.Length; + } + } + + byte[] result = new byte[totalLength]; + int pos = 0; + + for (int j = 0; j < count; ++j) + { + byte[] v = nonNull[j]; + Array.Copy(v, 0, result, pos, v.Length); + pos += v.Length; + } + + return result; + } + + public static int[] Concatenate(int[] a, int[] b) + { + if (a == null) + return Clone(b); + if (b == null) + return Clone(a); + + int[] rv = new int[a.Length + b.Length]; + Array.Copy(a, 0, rv, 0, a.Length); + Array.Copy(b, 0, rv, a.Length, b.Length); + return rv; + } + + public static byte[] Prepend(byte[] a, byte b) + { + if (a == null) + return new byte[] { b }; + + int length = a.Length; + byte[] result = new byte[length + 1]; + Array.Copy(a, 0, result, 1, length); + result[0] = b; + return result; + } + + public static short[] Prepend(short[] a, short b) + { + if (a == null) + return new short[] { b }; + + int length = a.Length; + short[] result = new short[length + 1]; + Array.Copy(a, 0, result, 1, length); + result[0] = b; + return result; + } + + public static int[] Prepend(int[] a, int b) + { + if (a == null) + return new int[] { b }; + + int length = a.Length; + int[] result = new int[length + 1]; + Array.Copy(a, 0, result, 1, length); + result[0] = b; + return result; + } + + public static byte[] Reverse(byte[] a) + { + if (a == null) + return null; + + int p1 = 0, p2 = a.Length; + byte[] result = new byte[p2]; + + while (--p2 >= 0) + { + result[p2] = a[p1++]; + } + + return result; + } + + public static int[] Reverse(int[] a) + { + if (a == null) + return null; + + int p1 = 0, p2 = a.Length; + int[] result = new int[p2]; + + while (--p2 >= 0) + { + result[p2] = a[p1++]; + } + + return result; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Arrays.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Arrays.cs.meta new file mode 100644 index 00000000..0b64de1a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Arrays.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ba8c42c46160a54db30a3ddfae9ed76 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/BigIntegers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/BigIntegers.cs new file mode 100644 index 00000000..659648c5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/BigIntegers.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities +{ + /** + * BigInteger utilities. + */ + public abstract class BigIntegers + { + private const int MaxIterations = 1000; + + /** + * Return the passed in value as an unsigned byte array. + * + * @param value value to be converted. + * @return a byte array without a leading zero byte if present in the signed encoding. + */ + public static byte[] AsUnsignedByteArray( + BigInteger n) + { + return n.ToByteArrayUnsigned(); + } + + /** + * Return the passed in value as an unsigned byte array of specified length, zero-extended as necessary. + * + * @param length desired length of result array. + * @param n value to be converted. + * @return a byte array of specified length, with leading zeroes as necessary given the size of n. + */ + public static byte[] AsUnsignedByteArray(int length, BigInteger n) + { + byte[] bytes = n.ToByteArrayUnsigned(); + + if (bytes.Length > length) + throw new ArgumentException("standard length exceeded", "n"); + + if (bytes.Length == length) + return bytes; + + byte[] tmp = new byte[length]; + Array.Copy(bytes, 0, tmp, tmp.Length - bytes.Length, bytes.Length); + return tmp; + } + + /** + * Return a random BigInteger not less than 'min' and not greater than 'max' + * + * @param min the least value that may be generated + * @param max the greatest value that may be generated + * @param random the source of randomness + * @return a random BigInteger value in the range [min,max] + */ + public static BigInteger CreateRandomInRange( + BigInteger min, + BigInteger max, + // TODO Should have been just Random class + SecureRandom random) + { + int cmp = min.CompareTo(max); + if (cmp >= 0) + { + if (cmp > 0) + throw new ArgumentException("'min' may not be greater than 'max'"); + + return min; + } + + if (min.BitLength > max.BitLength / 2) + { + return CreateRandomInRange(BigInteger.Zero, max.Subtract(min), random).Add(min); + } + + for (int i = 0; i < MaxIterations; ++i) + { + BigInteger x = new BigInteger(max.BitLength, random); + if (x.CompareTo(min) >= 0 && x.CompareTo(max) <= 0) + { + return x; + } + } + + // fall back to a faster (restricted) method + return new BigInteger(max.Subtract(min).BitLength - 1, random).Add(min); + } + + public static int GetUnsignedByteLength(BigInteger n) + { + return (n.BitLength + 7) / 8; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/BigIntegers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/BigIntegers.cs.meta new file mode 100644 index 00000000..54f519bb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/BigIntegers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebdb832f8f30d6c44a1a40e88b4f3b17 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Enums.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Enums.cs new file mode 100644 index 00000000..e48c588d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Enums.cs @@ -0,0 +1,82 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE +using System.Collections; +using System.Reflection; +#endif + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities +{ + internal abstract class Enums + { + internal static Enum GetEnumValue(System.Type enumType, string s) + { + if (!IsEnumType(enumType)) + throw new ArgumentException("Not an enumeration type", "enumType"); + + // We only want to parse single named constants + if (s.Length > 0 && char.IsLetter(s[0]) && s.IndexOf(',') < 0) + { + s = s.Replace('-', '_'); + s = s.Replace('/', '_'); + +#if NETCF_1_0 + FieldInfo field = enumType.GetField(s, BindingFlags.Static | BindingFlags.Public); + if (field != null) + { + return (Enum)field.GetValue(null); + } +#else + return (Enum)Enum.Parse(enumType, s, false); +#endif + } + + throw new ArgumentException(); + } + + internal static Array GetEnumValues(System.Type enumType) + { + if (!IsEnumType(enumType)) + throw new ArgumentException("Not an enumeration type", "enumType"); + +#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT + IList result = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + FieldInfo[] fields = enumType.GetFields(BindingFlags.Static | BindingFlags.Public); + foreach (FieldInfo field in fields) + { + // Note: Argument to GetValue() ignored since the fields are static, + // but Silverlight for Windows Phone throws exception if we pass null + result.Add(field.GetValue(enumType)); + } + object[] arr = new object[result.Count]; + result.CopyTo(arr, 0); + return arr; +#else + return Enum.GetValues(enumType); +#endif + } + + internal static Enum GetArbitraryValue(System.Type enumType) + { + Array values = GetEnumValues(enumType); + int pos = (int)(DateTimeUtilities.CurrentUnixMs() & int.MaxValue) % values.Length; + return (Enum)values.GetValue(pos); + } + + internal static bool IsEnumType(System.Type t) + { +#if NEW_REFLECTION || NETFX_CORE + return t.GetTypeInfo().IsEnum; +#else + return t.IsEnum; +#endif + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Enums.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Enums.cs.meta new file mode 100644 index 00000000..f2aea4f3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Enums.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5bc960ec18e889148ae2e52c6be70ec4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/IMemoable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/IMemoable.cs new file mode 100644 index 00000000..6fd47e04 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/IMemoable.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities +{ + public interface IMemoable + { + /// + /// Produce a copy of this object with its configuration and in its current state. + /// + /// + /// The returned object may be used simply to store the state, or may be used as a similar object + /// starting from the copied state. + /// + IMemoable Copy(); + + /// + /// Restore a copied object state into this object. + /// + /// + /// Implementations of this method should try to avoid or minimise memory allocation to perform the reset. + /// + /// an object originally {@link #copy() copied} from an object of the same type as this instance. + /// if the provided object is not of the correct type. + /// if the other parameter is in some other way invalid. + void Reset(IMemoable other); + } + +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/IMemoable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/IMemoable.cs.meta new file mode 100644 index 00000000..240b1f35 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/IMemoable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e5094da18f6285e498789845689aac6f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Integers.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Integers.cs new file mode 100644 index 00000000..6a538b76 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Integers.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities +{ + public abstract class Integers + { + public static int RotateLeft(int i, int distance) + { + return (i << distance) ^ (int)((uint)i >> -distance); + } + + [CLSCompliantAttribute(false)] + public static uint RotateLeft(uint i, int distance) + { + return (i << distance) ^ (i >> -distance); + } + + public static int RotateRight(int i, int distance) + { + return (int)((uint)i >> distance) ^ (i << -distance); + } + + [CLSCompliantAttribute(false)] + public static uint RotateRight(uint i, int distance) + { + return (i >> distance) ^ (i << -distance); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Integers.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Integers.cs.meta new file mode 100644 index 00000000..72b270d4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Integers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3188e9987cc8be145a324b947c7e7475 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/MemoableResetException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/MemoableResetException.cs new file mode 100644 index 00000000..9b5d14e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/MemoableResetException.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities +{ + /** + * Exception to be thrown on a failure to reset an object implementing Memoable. + *

    + * The exception extends InvalidCastException to enable users to have a single handling case, + * only introducing specific handling of this one if required. + *

    + */ + public class MemoableResetException + : InvalidCastException + { + /** + * Basic Constructor. + * + * @param msg message to be associated with this exception. + */ + public MemoableResetException(string msg) + : base(msg) + { + } + } + +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/MemoableResetException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/MemoableResetException.cs.meta new file mode 100644 index 00000000..e3d86045 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/MemoableResetException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 20a8024aade27594aacfebde1c7c76f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Platform.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Platform.cs new file mode 100644 index 00000000..6450fe20 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Platform.cs @@ -0,0 +1,233 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Globalization; +using System.IO; +using System.Text; + +#if SILVERLIGHT || PORTABLE || NETFX_CORE +using System.Collections.Generic; +#else +using System.Collections; +#endif + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities +{ + internal abstract class Platform + { + private static readonly CompareInfo InvariantCompareInfo = CultureInfo.InvariantCulture.CompareInfo; + +#if NETCF_1_0 || NETCF_2_0 + private static string GetNewLine() + { + MemoryStream buf = new MemoryStream(); + StreamWriter w = new StreamWriter(buf, Encoding.UTF8); + w.WriteLine(); + Dispose(w); + byte[] bs = buf.ToArray(); + return Encoding.UTF8.GetString(bs, 0, bs.Length); + } +#else + private static string GetNewLine() + { + return Environment.NewLine; + } +#endif + + internal static bool EqualsIgnoreCase(string a, string b) + { +#if PORTABLE || NETFX_CORE + return String.Equals(a, b, StringComparison.OrdinalIgnoreCase); +#else + return ToUpperInvariant(a) == ToUpperInvariant(b); +#endif + } + +#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || (PORTABLE || NETFX_CORE && !DOTNET) + internal static string GetEnvironmentVariable( + string variable) + { + return null; + } +#else + internal static string GetEnvironmentVariable( + string variable) + { + try + { + return Environment.GetEnvironmentVariable(variable); + } + catch (System.Security.SecurityException) + { + // We don't have the required permission to read this environment variable, + // which is fine, just act as if it's not set + return null; + } + } +#endif + +#if NETCF_1_0 + internal static Exception CreateNotImplementedException( + string message) + { + return new Exception("Not implemented: " + message); + } + + internal static bool Equals( + object a, + object b) + { + return a == b || (a != null && b != null && a.Equals(b)); + } +#else + internal static Exception CreateNotImplementedException( + string message) + { + return new NotImplementedException(message); + } +#endif + +#if SILVERLIGHT || PORTABLE || NETFX_CORE + internal static System.Collections.IList CreateArrayList() + { + return new List(); + } + internal static System.Collections.IList CreateArrayList(int capacity) + { + return new List(capacity); + } + internal static System.Collections.IList CreateArrayList(System.Collections.ICollection collection) + { + System.Collections.IList result = new List(collection.Count); + foreach (object o in collection) + { + result.Add(o); + } + return result; + } + internal static System.Collections.IList CreateArrayList(System.Collections.IEnumerable collection) + { + System.Collections.IList result = new List(); + foreach (object o in collection) + { + result.Add(o); + } + return result; + } + internal static System.Collections.IDictionary CreateHashtable() + { + return new Dictionary(); + } + internal static System.Collections.IDictionary CreateHashtable(int capacity) + { + return new Dictionary(capacity); + } + internal static System.Collections.IDictionary CreateHashtable(System.Collections.IDictionary dictionary) + { + System.Collections.IDictionary result = new Dictionary(dictionary.Count); + foreach (System.Collections.DictionaryEntry entry in dictionary) + { + result.Add(entry.Key, entry.Value); + } + return result; + } +#else + internal static System.Collections.IList CreateArrayList() + { + return new ArrayList(); + } + internal static System.Collections.IList CreateArrayList(int capacity) + { + return new ArrayList(capacity); + } + internal static System.Collections.IList CreateArrayList(System.Collections.ICollection collection) + { + return new ArrayList(collection); + } + internal static System.Collections.IList CreateArrayList(System.Collections.IEnumerable collection) + { + ArrayList result = new ArrayList(); + foreach (object o in collection) + { + result.Add(o); + } + return result; + } + internal static System.Collections.IDictionary CreateHashtable() + { + return new Hashtable(); + } + internal static System.Collections.IDictionary CreateHashtable(int capacity) + { + return new Hashtable(capacity); + } + internal static System.Collections.IDictionary CreateHashtable(System.Collections.IDictionary dictionary) + { + return new Hashtable(dictionary); + } +#endif + + internal static string ToLowerInvariant(string s) + { +#if PORTABLE || NETFX_CORE + return s.ToLowerInvariant(); +#else + return s.ToLower(CultureInfo.InvariantCulture); +#endif + } + + internal static string ToUpperInvariant(string s) + { +#if PORTABLE || NETFX_CORE + return s.ToUpperInvariant(); +#else + return s.ToUpper(CultureInfo.InvariantCulture); +#endif + } + + internal static readonly string NewLine = GetNewLine(); + +#if PORTABLE || NETFX_CORE + internal static void Dispose(IDisposable d) + { + d.Dispose(); + } +#else + internal static void Dispose(Stream s) + { + s.Close(); + } + internal static void Dispose(TextWriter t) + { + t.Close(); + } +#endif + + internal static int IndexOf(string source, string value) + { + return InvariantCompareInfo.IndexOf(source, value, CompareOptions.Ordinal); + } + + internal static int LastIndexOf(string source, string value) + { + return InvariantCompareInfo.LastIndexOf(source, value, CompareOptions.Ordinal); + } + + internal static bool StartsWith(string source, string prefix) + { + return InvariantCompareInfo.IsPrefix(source, prefix, CompareOptions.Ordinal); + } + + internal static bool EndsWith(string source, string suffix) + { + return InvariantCompareInfo.IsSuffix(source, suffix, CompareOptions.Ordinal); + } + + internal static string GetTypeName(object obj) + { + return obj.GetType().FullName; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Platform.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Platform.cs.meta new file mode 100644 index 00000000..8013f2b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Platform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 34ac2529ba9563b4b95ceece9c95095a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Strings.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Strings.cs new file mode 100644 index 00000000..0f6dee2a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Strings.cs @@ -0,0 +1,107 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities +{ + /// General string utilities. + public abstract class Strings + { + internal static bool IsOneOf(string s, params string[] candidates) + { + foreach (string candidate in candidates) + { + if (s == candidate) + return true; + } + return false; + } + + public static string FromByteArray( + byte[] bs) + { + char[] cs = new char[bs.Length]; + for (int i = 0; i < cs.Length; ++i) + { + cs[i] = Convert.ToChar(bs[i]); + } + return new string(cs); + } + + public static byte[] ToByteArray( + char[] cs) + { + byte[] bs = new byte[cs.Length]; + for (int i = 0; i < bs.Length; ++i) + { + bs[i] = Convert.ToByte(cs[i]); + } + return bs; + } + + public static byte[] ToByteArray( + string s) + { + byte[] bs = new byte[s.Length]; + for (int i = 0; i < bs.Length; ++i) + { + bs[i] = Convert.ToByte(s[i]); + } + return bs; + } + + public static string FromAsciiByteArray( + byte[] bytes) + { +#if SILVERLIGHT || PORTABLE || NETFX_CORE + // TODO Check for non-ASCII bytes in input? + return Encoding.UTF8.GetString(bytes, 0, bytes.Length); +#else + return Encoding.ASCII.GetString(bytes, 0, bytes.Length); +#endif + } + + public static byte[] ToAsciiByteArray( + char[] cs) + { +#if SILVERLIGHT || PORTABLE || NETFX_CORE + // TODO Check for non-ASCII characters in input? + return Encoding.UTF8.GetBytes(cs); +#else + return Encoding.ASCII.GetBytes(cs); +#endif + } + + public static byte[] ToAsciiByteArray( + string s) + { +#if SILVERLIGHT || PORTABLE || NETFX_CORE + // TODO Check for non-ASCII characters in input? + return Encoding.UTF8.GetBytes(s); +#else + return Encoding.ASCII.GetBytes(s); +#endif + } + + public static string FromUtf8ByteArray( + byte[] bytes) + { + return Encoding.UTF8.GetString(bytes, 0, bytes.Length); + } + + public static byte[] ToUtf8ByteArray( + char[] cs) + { + return Encoding.UTF8.GetBytes(cs); + } + + public static byte[] ToUtf8ByteArray( + string s) + { + return Encoding.UTF8.GetBytes(s); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Strings.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Strings.cs.meta new file mode 100644 index 00000000..9c9bc239 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Strings.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1102d66cf36a07545b4ef549eb96e85e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Times.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Times.cs new file mode 100644 index 00000000..284fc3a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Times.cs @@ -0,0 +1,18 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities +{ + public sealed class Times + { + private static long NanosecondsPerTick = 100L; + + public static long NanoTime() + { + return DateTime.UtcNow.Ticks * NanosecondsPerTick; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Times.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Times.cs.meta new file mode 100644 index 00000000..c10bfa7d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/Times.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0836244bbd72b0c439240b98b61f7c5b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/TypeExtensions.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/TypeExtensions.cs new file mode 100644 index 00000000..15fdce4a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/TypeExtensions.cs @@ -0,0 +1,21 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if NEW_REFLECTION || NETFX_CORE + +using System; +using System.Reflection; + +namespace Org.BouncyCastle +{ + internal static class TypeExtensions + { + public static bool IsInstanceOfType(this Type type, object instance) + { + return instance != null && type.GetTypeInfo().IsAssignableFrom(instance.GetType().GetTypeInfo()); + } + } +} + +#endif +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/TypeExtensions.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/TypeExtensions.cs.meta new file mode 100644 index 00000000..9e1d35e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/TypeExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cc84ea3a3830f114cbeeafb42707effe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections.meta new file mode 100644 index 00000000..31f173d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0b0797c2616cd4f4bbc6332490d85557 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/CollectionUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/CollectionUtilities.cs new file mode 100644 index 00000000..de2b1b61 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/CollectionUtilities.cs @@ -0,0 +1,79 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if UNITY_WSA && !UNITY_EDITOR && !ENABLE_IL2CPP +using System.TypeFix; +#endif +using System; +using System.Collections; +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public abstract class CollectionUtilities + { + public static void AddRange(IList to, IEnumerable range) + { + foreach (object o in range) + { + to.Add(o); + } + } + + public static bool CheckElementsAreOfType(IEnumerable e, Type t) + { + foreach (object o in e) + { + if (!t.IsInstanceOfType(o)) + return false; + } + return true; + } + + public static IDictionary ReadOnly(IDictionary d) + { + return new UnmodifiableDictionaryProxy(d); + } + + public static IList ReadOnly(IList l) + { + return new UnmodifiableListProxy(l); + } + + public static ISet ReadOnly(ISet s) + { + return new UnmodifiableSetProxy(s); + } + + public static object RequireNext(IEnumerator e) + { + if (!e.MoveNext()) + throw new InvalidOperationException(); + + return e.Current; + } + + public static string ToString(IEnumerable c) + { + StringBuilder sb = new StringBuilder("["); + + IEnumerator e = c.GetEnumerator(); + + if (e.MoveNext()) + { + sb.Append(e.Current.ToString()); + + while (e.MoveNext()) + { + sb.Append(", "); + sb.Append(e.Current.ToString()); + } + } + + sb.Append(']'); + + return sb.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/CollectionUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/CollectionUtilities.cs.meta new file mode 100644 index 00000000..4df1ae19 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/CollectionUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d30cc7795a67b547845658234e4bed0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EmptyEnumerable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EmptyEnumerable.cs new file mode 100644 index 00000000..0cddf547 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EmptyEnumerable.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public sealed class EmptyEnumerable + : IEnumerable + { + public static readonly IEnumerable Instance = new EmptyEnumerable(); + + private EmptyEnumerable() + { + } + + public IEnumerator GetEnumerator() + { + return EmptyEnumerator.Instance; + } + } + + public sealed class EmptyEnumerator + : IEnumerator + { + public static readonly IEnumerator Instance = new EmptyEnumerator(); + + private EmptyEnumerator() + { + } + + public bool MoveNext() + { + return false; + } + + public void Reset() + { + } + + public object Current + { + get { throw new InvalidOperationException("No elements"); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EmptyEnumerable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EmptyEnumerable.cs.meta new file mode 100644 index 00000000..326f32f0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EmptyEnumerable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9fe693b6994f69f4ab3719bf470e98d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EnumerableProxy.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EnumerableProxy.cs new file mode 100644 index 00000000..562f380f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EnumerableProxy.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public sealed class EnumerableProxy + : IEnumerable + { + private readonly IEnumerable inner; + + public EnumerableProxy( + IEnumerable inner) + { + if (inner == null) + throw new ArgumentNullException("inner"); + + this.inner = inner; + } + + public IEnumerator GetEnumerator() + { + return inner.GetEnumerator(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EnumerableProxy.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EnumerableProxy.cs.meta new file mode 100644 index 00000000..47339c88 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/EnumerableProxy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7473b1e62cdb7be449f354cbedddd3b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/HashSet.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/HashSet.cs new file mode 100644 index 00000000..12c399b2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/HashSet.cs @@ -0,0 +1,103 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public class HashSet + : ISet + { + private readonly IDictionary impl = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + + public HashSet() + { + } + + public HashSet(IEnumerable s) + { + foreach (object o in s) + { + Add(o); + } + } + + public virtual void Add(object o) + { + impl[o] = null; + } + + public virtual void AddAll(IEnumerable e) + { + foreach (object o in e) + { + Add(o); + } + } + + public virtual void Clear() + { + impl.Clear(); + } + + public virtual bool Contains(object o) + { + return impl.Contains(o); + } + + public virtual void CopyTo(Array array, int index) + { + impl.Keys.CopyTo(array, index); + } + + public virtual int Count + { + get { return impl.Count; } + } + + public virtual IEnumerator GetEnumerator() + { + return impl.Keys.GetEnumerator(); + } + + public virtual bool IsEmpty + { + get { return impl.Count == 0; } + } + + public virtual bool IsFixedSize + { + get { return impl.IsFixedSize; } + } + + public virtual bool IsReadOnly + { + get { return impl.IsReadOnly; } + } + + public virtual bool IsSynchronized + { + get { return impl.IsSynchronized; } + } + + public virtual void Remove(object o) + { + impl.Remove(o); + } + + public virtual void RemoveAll(IEnumerable e) + { + foreach (object o in e) + { + Remove(o); + } + } + + public virtual object SyncRoot + { + get { return impl.SyncRoot; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/HashSet.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/HashSet.cs.meta new file mode 100644 index 00000000..58836e7b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/HashSet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7324bf9bc59776949bf134abc958ddeb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/ISet.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/ISet.cs new file mode 100644 index 00000000..6ab03f9a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/ISet.cs @@ -0,0 +1,23 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public interface ISet + : ICollection + { + void Add(object o); + void AddAll(IEnumerable e); + void Clear(); + bool Contains(object o); + bool IsEmpty { get; } + bool IsFixedSize { get; } + bool IsReadOnly { get; } + void Remove(object o); + void RemoveAll(IEnumerable e); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/ISet.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/ISet.cs.meta new file mode 100644 index 00000000..3e9825dd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/ISet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2f3dcb73a056604e8efd46a0ba3875a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/LinkedDictionary.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/LinkedDictionary.cs new file mode 100644 index 00000000..bb9b4fb6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/LinkedDictionary.cs @@ -0,0 +1,182 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public class LinkedDictionary + : IDictionary + { + internal readonly IDictionary hash = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + internal readonly IList keys = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + public LinkedDictionary() + { + } + + public virtual void Add(object k, object v) + { + hash.Add(k, v); + keys.Add(k); + } + + public virtual void Clear() + { + hash.Clear(); + keys.Clear(); + } + + public virtual bool Contains(object k) + { + return hash.Contains(k); + } + + public virtual void CopyTo(Array array, int index) + { + foreach (object k in keys) + { + array.SetValue(hash[k], index++); + } + } + + public virtual int Count + { + get { return hash.Count; } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public virtual IDictionaryEnumerator GetEnumerator() + { + return new LinkedDictionaryEnumerator(this); + } + + public virtual void Remove(object k) + { + hash.Remove(k); + keys.Remove(k); + } + + public virtual bool IsFixedSize + { + get { return false; } + } + + public virtual bool IsReadOnly + { + get { return false; } + } + + public virtual bool IsSynchronized + { + get { return false; } + } + + public virtual object SyncRoot + { + get { return false; } + } + + public virtual ICollection Keys + { + get { return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(keys); } + } + + public virtual ICollection Values + { + // NB: Order has to be the same as for Keys property + get + { + IList values = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(keys.Count); + foreach (object k in keys) + { + values.Add(hash[k]); + } + return values; + } + } + + public virtual object this[object k] + { + get + { + return hash[k]; + } + set + { + if (!hash.Contains(k)) + keys.Add(k); + hash[k] = value; + } + } + } + + internal class LinkedDictionaryEnumerator : IDictionaryEnumerator + { + private readonly LinkedDictionary parent; + private int pos = -1; + + internal LinkedDictionaryEnumerator(LinkedDictionary parent) + { + this.parent = parent; + } + + public virtual object Current + { + get { return Entry; } + } + + public virtual DictionaryEntry Entry + { + get + { + object k = CurrentKey; + return new DictionaryEntry(k, parent.hash[k]); + } + } + + public virtual object Key + { + get + { + return CurrentKey; + } + } + + public virtual bool MoveNext() + { + if (pos >= parent.keys.Count) + return false; + return ++pos < parent.keys.Count; + } + + public virtual void Reset() + { + this.pos = -1; + } + + public virtual object Value + { + get + { + return parent.hash[CurrentKey]; + } + } + + private object CurrentKey + { + get + { + if (pos < 0 || pos >= parent.keys.Count) + throw new InvalidOperationException(); + return parent.keys[pos]; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/LinkedDictionary.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/LinkedDictionary.cs.meta new file mode 100644 index 00000000..4edadcc9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/LinkedDictionary.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1c21a553327fa1d4aadd4151e30aa090 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionary.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionary.cs new file mode 100644 index 00000000..3a00746a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionary.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public abstract class UnmodifiableDictionary + : IDictionary + { + protected UnmodifiableDictionary() + { + } + + public virtual void Add(object k, object v) + { + throw new NotSupportedException(); + } + + public virtual void Clear() + { + throw new NotSupportedException(); + } + + public abstract bool Contains(object k); + + public abstract void CopyTo(Array array, int index); + + public abstract int Count { get; } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public abstract IDictionaryEnumerator GetEnumerator(); + + public virtual void Remove(object k) + { + throw new NotSupportedException(); + } + + public abstract bool IsFixedSize { get; } + + public virtual bool IsReadOnly + { + get { return true; } + } + + public abstract bool IsSynchronized { get; } + + public abstract object SyncRoot { get; } + + public abstract ICollection Keys { get; } + + public abstract ICollection Values { get; } + + public virtual object this[object k] + { + get { return GetValue(k); } + set { throw new NotSupportedException(); } + } + + protected abstract object GetValue(object k); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionary.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionary.cs.meta new file mode 100644 index 00000000..5626da19 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionary.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 44fabc8f92d114147b94a895ef74ca4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionaryProxy.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionaryProxy.cs new file mode 100644 index 00000000..3e344e76 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionaryProxy.cs @@ -0,0 +1,70 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public class UnmodifiableDictionaryProxy + : UnmodifiableDictionary + { + private readonly IDictionary d; + + public UnmodifiableDictionaryProxy(IDictionary d) + { + this.d = d; + } + + public override bool Contains(object k) + { + return d.Contains(k); + } + + public override void CopyTo(Array array, int index) + { + d.CopyTo(array, index); + } + + public override int Count + { + get { return d.Count; } + } + + public override IDictionaryEnumerator GetEnumerator() + { + return d.GetEnumerator(); + } + + public override bool IsFixedSize + { + get { return d.IsFixedSize; } + } + + public override bool IsSynchronized + { + get { return d.IsSynchronized; } + } + + public override object SyncRoot + { + get { return d.SyncRoot; } + } + + public override ICollection Keys + { + get { return d.Keys; } + } + + public override ICollection Values + { + get { return d.Values; } + } + + protected override object GetValue(object k) + { + return d[k]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionaryProxy.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionaryProxy.cs.meta new file mode 100644 index 00000000..efc33897 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableDictionaryProxy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2fdbffa9353f147479271e1cac8fc8e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableList.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableList.cs new file mode 100644 index 00000000..c8c49fc2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableList.cs @@ -0,0 +1,71 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public abstract class UnmodifiableList + : IList + { + protected UnmodifiableList() + { + } + + public virtual int Add(object o) + { + throw new NotSupportedException(); + } + + public virtual void Clear() + { + throw new NotSupportedException(); + } + + public abstract bool Contains(object o); + + public abstract void CopyTo(Array array, int index); + + public abstract int Count { get; } + + public abstract IEnumerator GetEnumerator(); + + public abstract int IndexOf(object o); + + public virtual void Insert(int i, object o) + { + throw new NotSupportedException(); + } + + public abstract bool IsFixedSize { get; } + + public virtual bool IsReadOnly + { + get { return true; } + } + + public abstract bool IsSynchronized { get; } + + public virtual void Remove(object o) + { + throw new NotSupportedException(); + } + + public virtual void RemoveAt(int i) + { + throw new NotSupportedException(); + } + + public abstract object SyncRoot { get; } + + public virtual object this[int i] + { + get { return GetValue(i); } + set { throw new NotSupportedException(); } + } + + protected abstract object GetValue(int i); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableList.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableList.cs.meta new file mode 100644 index 00000000..454da692 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5da823f6add0e6e4281f31de3d3b8d7b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableListProxy.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableListProxy.cs new file mode 100644 index 00000000..66793bb3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableListProxy.cs @@ -0,0 +1,65 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public class UnmodifiableListProxy + : UnmodifiableList + { + private readonly IList l; + + public UnmodifiableListProxy(IList l) + { + this.l = l; + } + + public override bool Contains(object o) + { + return l.Contains(o); + } + + public override void CopyTo(Array array, int index) + { + l.CopyTo(array, index); + } + + public override int Count + { + get { return l.Count; } + } + + public override IEnumerator GetEnumerator() + { + return l.GetEnumerator(); + } + + public override int IndexOf(object o) + { + return l.IndexOf(o); + } + + public override bool IsFixedSize + { + get { return l.IsFixedSize; } + } + + public override bool IsSynchronized + { + get { return l.IsSynchronized; } + } + + public override object SyncRoot + { + get { return l.SyncRoot; } + } + + protected override object GetValue(int i) + { + return l[i]; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableListProxy.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableListProxy.cs.meta new file mode 100644 index 00000000..ef5c3499 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableListProxy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 25fcbd1ae6e6fd6408ec969e9dc8e092 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSet.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSet.cs new file mode 100644 index 00000000..66d223b3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSet.cs @@ -0,0 +1,63 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public abstract class UnmodifiableSet + : ISet + { + protected UnmodifiableSet() + { + } + + public virtual void Add(object o) + { + throw new NotSupportedException(); + } + + public virtual void AddAll(IEnumerable e) + { + throw new NotSupportedException(); + } + + public virtual void Clear() + { + throw new NotSupportedException(); + } + + public abstract bool Contains(object o); + + public abstract void CopyTo(Array array, int index); + + public abstract int Count { get; } + + public abstract IEnumerator GetEnumerator(); + + public abstract bool IsEmpty { get; } + + public abstract bool IsFixedSize { get; } + + public virtual bool IsReadOnly + { + get { return true; } + } + + public abstract bool IsSynchronized { get; } + + public abstract object SyncRoot { get; } + + public virtual void Remove(object o) + { + throw new NotSupportedException(); + } + + public virtual void RemoveAll(IEnumerable e) + { + throw new NotSupportedException(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSet.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSet.cs.meta new file mode 100644 index 00000000..b6f89697 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e945481d510ca240a15c744d33ddfba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSetProxy.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSetProxy.cs new file mode 100644 index 00000000..f3367ce9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSetProxy.cs @@ -0,0 +1,60 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections +{ + public class UnmodifiableSetProxy + : UnmodifiableSet + { + private readonly ISet s; + + public UnmodifiableSetProxy (ISet s) + { + this.s = s; + } + + public override bool Contains(object o) + { + return s.Contains(o); + } + + public override void CopyTo(Array array, int index) + { + s.CopyTo(array, index); + } + + public override int Count + { + get { return s.Count; } + } + + public override IEnumerator GetEnumerator() + { + return s.GetEnumerator(); + } + + public override bool IsEmpty + { + get { return s.IsEmpty; } + } + + public override bool IsFixedSize + { + get { return s.IsFixedSize; } + } + + public override bool IsSynchronized + { + get { return s.IsSynchronized; } + } + + public override object SyncRoot + { + get { return s.SyncRoot; } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSetProxy.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSetProxy.cs.meta new file mode 100644 index 00000000..6e9cf2cf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/collections/UnmodifiableSetProxy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 21db2580c1539f14a9f2aaa4f1c777a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date.meta new file mode 100644 index 00000000..bb7a509a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 519a28f7f784fe741926e76c222b9da5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeObject.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeObject.cs new file mode 100644 index 00000000..2dff70cb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeObject.cs @@ -0,0 +1,29 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date +{ + public sealed class DateTimeObject + { + private readonly DateTime dt; + + public DateTimeObject( + DateTime dt) + { + this.dt = dt; + } + + public DateTime Value + { + get { return dt; } + } + + public override string ToString() + { + return dt.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeObject.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeObject.cs.meta new file mode 100644 index 00000000..137a6150 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98e7fe4e769121b419a4d266709cd137 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeUtilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeUtilities.cs new file mode 100644 index 00000000..be931933 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeUtilities.cs @@ -0,0 +1,51 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date +{ + public class DateTimeUtilities + { + public static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1); + + private DateTimeUtilities() + { + } + + /// + /// Return the number of milliseconds since the Unix epoch (1 Jan., 1970 UTC) for a given DateTime value. + /// + /// A UTC DateTime value not before epoch. + /// Number of whole milliseconds after epoch. + /// 'dateTime' is before epoch. + public static long DateTimeToUnixMs( + DateTime dateTime) + { + if (dateTime.CompareTo(UnixEpoch) < 0) + throw new ArgumentException("DateTime value may not be before the epoch", "dateTime"); + + return (dateTime.Ticks - UnixEpoch.Ticks) / TimeSpan.TicksPerMillisecond; + } + + /// + /// Create a DateTime value from the number of milliseconds since the Unix epoch (1 Jan., 1970 UTC). + /// + /// Number of milliseconds since the epoch. + /// A UTC DateTime value + public static DateTime UnixMsToDateTime( + long unixMs) + { + return new DateTime(unixMs * TimeSpan.TicksPerMillisecond + UnixEpoch.Ticks); + } + + /// + /// Return the current number of milliseconds since the Unix epoch (1 Jan., 1970 UTC). + /// + public static long CurrentUnixMs() + { + return DateTimeToUnixMs(DateTime.UtcNow); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeUtilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeUtilities.cs.meta new file mode 100644 index 00000000..0f2ca7fc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/date/DateTimeUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 85931186ecac6fa43a89af5ddc60b835 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders.meta new file mode 100644 index 00000000..ecc759a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a1c695eec32cfe44ba8bb5c6b6230161 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64.cs new file mode 100644 index 00000000..22898626 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64.cs @@ -0,0 +1,124 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + public sealed class Base64 + { + private Base64() + { + } + + public static string ToBase64String( + byte[] data) + { + return Convert.ToBase64String(data, 0, data.Length); + } + + public static string ToBase64String( + byte[] data, + int off, + int length) + { + return Convert.ToBase64String(data, off, length); + } + + /** + * encode the input data producing a base 64 encoded byte array. + * + * @return a byte array containing the base 64 encoded data. + */ + public static byte[] Encode( + byte[] data) + { + return Encode(data, 0, data.Length); + } + + /** + * encode the input data producing a base 64 encoded byte array. + * + * @return a byte array containing the base 64 encoded data. + */ + public static byte[] Encode( + byte[] data, + int off, + int length) + { + string s = Convert.ToBase64String(data, off, length); + return Strings.ToAsciiByteArray(s); + } + + /** + * Encode the byte data to base 64 writing it to the given output stream. + * + * @return the number of bytes produced. + */ + public static int Encode( + byte[] data, + Stream outStream) + { + byte[] encoded = Encode(data); + outStream.Write(encoded, 0, encoded.Length); + return encoded.Length; + } + + /** + * Encode the byte data to base 64 writing it to the given output stream. + * + * @return the number of bytes produced. + */ + public static int Encode( + byte[] data, + int off, + int length, + Stream outStream) + { + byte[] encoded = Encode(data, off, length); + outStream.Write(encoded, 0, encoded.Length); + return encoded.Length; + } + + /** + * decode the base 64 encoded input data. It is assumed the input data is valid. + * + * @return a byte array representing the decoded data. + */ + public static byte[] Decode( + byte[] data) + { + string s = Strings.FromAsciiByteArray(data); + return Convert.FromBase64String(s); + } + + /** + * decode the base 64 encoded string data - whitespace will be ignored. + * + * @return a byte array representing the decoded data. + */ + public static byte[] Decode( + string data) + { + return Convert.FromBase64String(data); + } + + /** + * decode the base 64 encoded string data writing it to the given output stream, + * whitespace characters will be ignored. + * + * @return the number of bytes produced. + */ + public static int Decode( + string data, + Stream outStream) + { + byte[] decoded = Decode(data); + outStream.Write(decoded, 0, decoded.Length); + return decoded.Length; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64.cs.meta new file mode 100644 index 00000000..3d41fa92 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d6f9d60f7dc61d48babd61d65e4a234 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64Encoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64Encoder.cs new file mode 100644 index 00000000..b7cb7776 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64Encoder.cs @@ -0,0 +1,331 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + public class Base64Encoder + : IEncoder + { + protected readonly byte[] encodingTable = + { + (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G', + (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N', + (byte)'O', (byte)'P', (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U', + (byte)'V', (byte)'W', (byte)'X', (byte)'Y', (byte)'Z', + (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f', (byte)'g', + (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l', (byte)'m', (byte)'n', + (byte)'o', (byte)'p', (byte)'q', (byte)'r', (byte)'s', (byte)'t', (byte)'u', + (byte)'v', + (byte)'w', (byte)'x', (byte)'y', (byte)'z', + (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', + (byte)'7', (byte)'8', (byte)'9', + (byte)'+', (byte)'/' + }; + + protected byte padding = (byte)'='; + + /* + * set up the decoding table. + */ + protected readonly byte[] decodingTable = new byte[128]; + + protected void InitialiseDecodingTable() + { + Arrays.Fill(decodingTable, (byte)0xff); + + for (int i = 0; i < encodingTable.Length; i++) + { + decodingTable[encodingTable[i]] = (byte)i; + } + } + + public Base64Encoder() + { + InitialiseDecodingTable(); + } + + /** + * encode the input data producing a base 64 output stream. + * + * @return the number of bytes produced. + */ + public int Encode( + byte[] data, + int off, + int length, + Stream outStream) + { + int modulus = length % 3; + int dataLength = (length - modulus); + int a1, a2, a3; + + for (int i = off; i < off + dataLength; i += 3) + { + a1 = data[i] & 0xff; + a2 = data[i + 1] & 0xff; + a3 = data[i + 2] & 0xff; + + outStream.WriteByte(encodingTable[(int) ((uint) a1 >> 2) & 0x3f]); + outStream.WriteByte(encodingTable[((a1 << 4) | (int) ((uint) a2 >> 4)) & 0x3f]); + outStream.WriteByte(encodingTable[((a2 << 2) | (int) ((uint) a3 >> 6)) & 0x3f]); + outStream.WriteByte(encodingTable[a3 & 0x3f]); + } + + /* + * process the tail end. + */ + int b1, b2, b3; + int d1, d2; + + switch (modulus) + { + case 0: /* nothing left to do */ + break; + case 1: + d1 = data[off + dataLength] & 0xff; + b1 = (d1 >> 2) & 0x3f; + b2 = (d1 << 4) & 0x3f; + + outStream.WriteByte(encodingTable[b1]); + outStream.WriteByte(encodingTable[b2]); + outStream.WriteByte(padding); + outStream.WriteByte(padding); + break; + case 2: + d1 = data[off + dataLength] & 0xff; + d2 = data[off + dataLength + 1] & 0xff; + + b1 = (d1 >> 2) & 0x3f; + b2 = ((d1 << 4) | (d2 >> 4)) & 0x3f; + b3 = (d2 << 2) & 0x3f; + + outStream.WriteByte(encodingTable[b1]); + outStream.WriteByte(encodingTable[b2]); + outStream.WriteByte(encodingTable[b3]); + outStream.WriteByte(padding); + break; + } + + return (dataLength / 3) * 4 + ((modulus == 0) ? 0 : 4); + } + + private bool ignore( + char c) + { + return (c == '\n' || c =='\r' || c == '\t' || c == ' '); + } + + /** + * decode the base 64 encoded byte data writing it to the given output stream, + * whitespace characters will be ignored. + * + * @return the number of bytes produced. + */ + public int Decode( + byte[] data, + int off, + int length, + Stream outStream) + { + byte b1, b2, b3, b4; + int outLen = 0; + + int end = off + length; + + while (end > off) + { + if (!ignore((char)data[end - 1])) + { + break; + } + + end--; + } + + int i = off; + int finish = end - 4; + + i = nextI(data, i, finish); + + while (i < finish) + { + b1 = decodingTable[data[i++]]; + + i = nextI(data, i, finish); + + b2 = decodingTable[data[i++]]; + + i = nextI(data, i, finish); + + b3 = decodingTable[data[i++]]; + + i = nextI(data, i, finish); + + b4 = decodingTable[data[i++]]; + + if ((b1 | b2 | b3 | b4) >= 0x80) + throw new IOException("invalid characters encountered in base64 data"); + + outStream.WriteByte((byte)((b1 << 2) | (b2 >> 4))); + outStream.WriteByte((byte)((b2 << 4) | (b3 >> 2))); + outStream.WriteByte((byte)((b3 << 6) | b4)); + + outLen += 3; + + i = nextI(data, i, finish); + } + + outLen += decodeLastBlock(outStream, (char)data[end - 4], (char)data[end - 3], (char)data[end - 2], (char)data[end - 1]); + + return outLen; + } + + private int nextI( + byte[] data, + int i, + int finish) + { + while ((i < finish) && ignore((char)data[i])) + { + i++; + } + return i; + } + + /** + * decode the base 64 encoded string data writing it to the given output stream, + * whitespace characters will be ignored. + * + * @return the number of bytes produced. + */ + public int DecodeString( + string data, + Stream outStream) + { + // Platform Implementation +// byte[] bytes = Convert.FromBase64String(data); +// outStream.Write(bytes, 0, bytes.Length); +// return bytes.Length; + + byte b1, b2, b3, b4; + int length = 0; + + int end = data.Length; + + while (end > 0) + { + if (!ignore(data[end - 1])) + { + break; + } + + end--; + } + + int i = 0; + int finish = end - 4; + + i = nextI(data, i, finish); + + while (i < finish) + { + b1 = decodingTable[data[i++]]; + + i = nextI(data, i, finish); + + b2 = decodingTable[data[i++]]; + + i = nextI(data, i, finish); + + b3 = decodingTable[data[i++]]; + + i = nextI(data, i, finish); + + b4 = decodingTable[data[i++]]; + + if ((b1 | b2 | b3 | b4) >= 0x80) + throw new IOException("invalid characters encountered in base64 data"); + + outStream.WriteByte((byte)((b1 << 2) | (b2 >> 4))); + outStream.WriteByte((byte)((b2 << 4) | (b3 >> 2))); + outStream.WriteByte((byte)((b3 << 6) | b4)); + + length += 3; + + i = nextI(data, i, finish); + } + + length += decodeLastBlock(outStream, data[end - 4], data[end - 3], data[end - 2], data[end - 1]); + + return length; + } + + private int decodeLastBlock( + Stream outStream, + char c1, + char c2, + char c3, + char c4) + { + if (c3 == padding) + { + if (c4 != padding) + throw new IOException("invalid characters encountered at end of base64 data"); + + byte b1 = decodingTable[c1]; + byte b2 = decodingTable[c2]; + + if ((b1 | b2) >= 0x80) + throw new IOException("invalid characters encountered at end of base64 data"); + + outStream.WriteByte((byte)((b1 << 2) | (b2 >> 4))); + + return 1; + } + + if (c4 == padding) + { + byte b1 = decodingTable[c1]; + byte b2 = decodingTable[c2]; + byte b3 = decodingTable[c3]; + + if ((b1 | b2 | b3) >= 0x80) + throw new IOException("invalid characters encountered at end of base64 data"); + + outStream.WriteByte((byte)((b1 << 2) | (b2 >> 4))); + outStream.WriteByte((byte)((b2 << 4) | (b3 >> 2))); + + return 2; + } + + { + byte b1 = decodingTable[c1]; + byte b2 = decodingTable[c2]; + byte b3 = decodingTable[c3]; + byte b4 = decodingTable[c4]; + + if ((b1 | b2 | b3 | b4) >= 0x80) + throw new IOException("invalid characters encountered at end of base64 data"); + + outStream.WriteByte((byte)((b1 << 2) | (b2 >> 4))); + outStream.WriteByte((byte)((b2 << 4) | (b3 >> 2))); + outStream.WriteByte((byte)((b3 << 6) | b4)); + + return 3; + } + } + + private int nextI(string data, int i, int finish) + { + while ((i < finish) && ignore(data[i])) + { + i++; + } + return i; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64Encoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64Encoder.cs.meta new file mode 100644 index 00000000..82aff3b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Base64Encoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f905b3d88fa2c734fb7553270ac7e0b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedDecoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedDecoder.cs new file mode 100644 index 00000000..9f72a9a6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedDecoder.cs @@ -0,0 +1,121 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + /// + /// A buffering class to allow translation from one format to another to + /// be done in discrete chunks. + /// + public class BufferedDecoder + { + internal byte[] buffer; + internal int bufOff; + + internal ITranslator translator; + + /// + /// Create a buffered Decoder. + /// + /// The translater to use. + /// The size of the buffer. + public BufferedDecoder( + ITranslator translator, + int bufferSize) + { + this.translator = translator; + + if ((bufferSize % translator.GetEncodedBlockSize()) != 0) + { + throw new ArgumentException("buffer size not multiple of input block size"); + } + + buffer = new byte[bufferSize]; +// bufOff = 0; + } + + /// + /// Process one byte of data. + /// + /// Data in. + /// Byte array for the output. + /// The offset in the output byte array to start writing from. + /// The amount of output bytes. + public int ProcessByte( + byte input, + byte[] output, + int outOff) + { + int resultLen = 0; + + buffer[bufOff++] = input; + + if (bufOff == buffer.Length) + { + resultLen = translator.Decode(buffer, 0, buffer.Length, output, outOff); + bufOff = 0; + } + + return resultLen; + } + + + /// + /// Process data from a byte array. + /// + /// The input data. + /// Start position within input data array. + /// Amount of data to process from input data array. + /// Array to store output. + /// Position in output array to start writing from. + /// The amount of output bytes. + public int ProcessBytes( + byte[] input, + int inOff, + int len, + byte[] outBytes, + int outOff) + { + if (len < 0) + { + throw new ArgumentException("Can't have a negative input length!"); + } + + int resultLen = 0; + int gapLen = buffer.Length - bufOff; + + if (len > gapLen) + { + Array.Copy(input, inOff, buffer, bufOff, gapLen); + + resultLen += translator.Decode(buffer, 0, buffer.Length, outBytes, outOff); + + bufOff = 0; + + len -= gapLen; + inOff += gapLen; + outOff += resultLen; + + int chunkSize = len - (len % buffer.Length); + + resultLen += translator.Decode(input, inOff, chunkSize, outBytes, outOff); + + len -= chunkSize; + inOff += chunkSize; + } + + if (len != 0) + { + Array.Copy(input, inOff, buffer, bufOff, len); + + bufOff += len; + } + + return resultLen; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedDecoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedDecoder.cs.meta new file mode 100644 index 00000000..1692e3fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedDecoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f6c49427e416a0845b216c1bc698f79c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedEncoder.cs new file mode 100644 index 00000000..e7c94efb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedEncoder.cs @@ -0,0 +1,121 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + /// + /// A class that allows encoding of data using a specific encoder to be processed in chunks. + /// + public class BufferedEncoder + { + internal byte[] Buffer; + internal int bufOff; + + internal ITranslator translator; + + + /// + /// Create. + /// + /// The translator to use. + /// Size of the chunks. + public BufferedEncoder( + ITranslator translator, + int bufferSize) + { + this.translator = translator; + + if ((bufferSize % translator.GetEncodedBlockSize()) != 0) + { + throw new ArgumentException("buffer size not multiple of input block size"); + } + + Buffer = new byte[bufferSize]; +// bufOff = 0; + } + + + /// + /// Process one byte of data. + /// + /// The byte. + /// An array to store output in. + /// Offset within output array to start writing from. + /// + public int ProcessByte( + byte input, + byte[] outBytes, + int outOff) + { + int resultLen = 0; + + Buffer[bufOff++] = input; + + if (bufOff == Buffer.Length) + { + resultLen = translator.Encode(Buffer, 0, Buffer.Length, outBytes, outOff); + bufOff = 0; + } + + return resultLen; + } + + /// + /// Process data from a byte array. + /// + /// Input data Byte array containing data to be processed. + /// Start position within input data array. + /// Amount of input data to be processed. + /// Output data array. + /// Offset within output data array to start writing to. + /// The amount of data written. + public int ProcessBytes( + byte[] input, + int inOff, + int len, + byte[] outBytes, + int outOff) + { + if (len < 0) + { + throw new ArgumentException("Can't have a negative input length!"); + } + + int resultLen = 0; + int gapLen = Buffer.Length - bufOff; + + if (len > gapLen) + { + Array.Copy(input, inOff, Buffer, bufOff, gapLen); + + resultLen += translator.Encode(Buffer, 0, Buffer.Length, outBytes, outOff); + + bufOff = 0; + + len -= gapLen; + inOff += gapLen; + outOff += resultLen; + + int chunkSize = len - (len % Buffer.Length); + + resultLen += translator.Encode(input, inOff, chunkSize, outBytes, outOff); + + len -= chunkSize; + inOff += chunkSize; + } + + if (len != 0) + { + Array.Copy(input, inOff, Buffer, bufOff, len); + + bufOff += len; + } + + return resultLen; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedEncoder.cs.meta new file mode 100644 index 00000000..36956819 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/BufferedEncoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 53ece357fad218446b6823b06ffea94d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Hex.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Hex.cs new file mode 100644 index 00000000..7d695266 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Hex.cs @@ -0,0 +1,134 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; +using System.Text; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + /// + /// Class to decode and encode Hex. + /// + public sealed class Hex + { + private static readonly IEncoder encoder = new HexEncoder(); + + private Hex() + { + } + + public static string ToHexString( + byte[] data) + { + return ToHexString(data, 0, data.Length); + } + + public static string ToHexString( + byte[] data, + int off, + int length) + { + byte[] hex = Encode(data, off, length); + return Strings.FromAsciiByteArray(hex); + } + + /** + * encode the input data producing a Hex encoded byte array. + * + * @return a byte array containing the Hex encoded data. + */ + public static byte[] Encode( + byte[] data) + { + return Encode(data, 0, data.Length); + } + + /** + * encode the input data producing a Hex encoded byte array. + * + * @return a byte array containing the Hex encoded data. + */ + public static byte[] Encode( + byte[] data, + int off, + int length) + { + MemoryStream bOut = new MemoryStream(length * 2); + + encoder.Encode(data, off, length, bOut); + + return bOut.ToArray(); + } + + /** + * Hex encode the byte data writing it to the given output stream. + * + * @return the number of bytes produced. + */ + public static int Encode( + byte[] data, + Stream outStream) + { + return encoder.Encode(data, 0, data.Length, outStream); + } + + /** + * Hex encode the byte data writing it to the given output stream. + * + * @return the number of bytes produced. + */ + public static int Encode( + byte[] data, + int off, + int length, + Stream outStream) + { + return encoder.Encode(data, off, length, outStream); + } + + /** + * decode the Hex encoded input data. It is assumed the input data is valid. + * + * @return a byte array representing the decoded data. + */ + public static byte[] Decode( + byte[] data) + { + MemoryStream bOut = new MemoryStream((data.Length + 1) / 2); + + encoder.Decode(data, 0, data.Length, bOut); + + return bOut.ToArray(); + } + + /** + * decode the Hex encoded string data - whitespace will be ignored. + * + * @return a byte array representing the decoded data. + */ + public static byte[] Decode( + string data) + { + MemoryStream bOut = new MemoryStream((data.Length + 1) / 2); + + encoder.DecodeString(data, bOut); + + return bOut.ToArray(); + } + + /** + * decode the Hex encoded string data writing it to the given output stream, + * whitespace characters will be ignored. + * + * @return the number of bytes produced. + */ + public static int Decode( + string data, + Stream outStream) + { + return encoder.DecodeString(data, outStream); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Hex.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Hex.cs.meta new file mode 100644 index 00000000..2748cccb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Hex.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ed222e1db807254592957eb36667273 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexEncoder.cs new file mode 100644 index 00000000..9fd07a43 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexEncoder.cs @@ -0,0 +1,180 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + public class HexEncoder + : IEncoder + { + protected readonly byte[] encodingTable = + { + (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', + (byte)'8', (byte)'9', (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f' + }; + + /* + * set up the decoding table. + */ + protected readonly byte[] decodingTable = new byte[128]; + + protected void InitialiseDecodingTable() + { + Arrays.Fill(decodingTable, (byte)0xff); + + for (int i = 0; i < encodingTable.Length; i++) + { + decodingTable[encodingTable[i]] = (byte)i; + } + + decodingTable['A'] = decodingTable['a']; + decodingTable['B'] = decodingTable['b']; + decodingTable['C'] = decodingTable['c']; + decodingTable['D'] = decodingTable['d']; + decodingTable['E'] = decodingTable['e']; + decodingTable['F'] = decodingTable['f']; + } + + public HexEncoder() + { + InitialiseDecodingTable(); + } + + /** + * encode the input data producing a Hex output stream. + * + * @return the number of bytes produced. + */ + public int Encode( + byte[] data, + int off, + int length, + Stream outStream) + { + for (int i = off; i < (off + length); i++) + { + int v = data[i]; + + outStream.WriteByte(encodingTable[v >> 4]); + outStream.WriteByte(encodingTable[v & 0xf]); + } + + return length * 2; + } + + private static bool Ignore(char c) + { + return c == '\n' || c =='\r' || c == '\t' || c == ' '; + } + + /** + * decode the Hex encoded byte data writing it to the given output stream, + * whitespace characters will be ignored. + * + * @return the number of bytes produced. + */ + public int Decode( + byte[] data, + int off, + int length, + Stream outStream) + { + byte b1, b2; + int outLen = 0; + int end = off + length; + + while (end > off) + { + if (!Ignore((char)data[end - 1])) + { + break; + } + + end--; + } + + int i = off; + while (i < end) + { + while (i < end && Ignore((char)data[i])) + { + i++; + } + + b1 = decodingTable[data[i++]]; + + while (i < end && Ignore((char)data[i])) + { + i++; + } + + b2 = decodingTable[data[i++]]; + + if ((b1 | b2) >= 0x80) + throw new IOException("invalid characters encountered in Hex data"); + + outStream.WriteByte((byte)((b1 << 4) | b2)); + + outLen++; + } + + return outLen; + } + + /** + * decode the Hex encoded string data writing it to the given output stream, + * whitespace characters will be ignored. + * + * @return the number of bytes produced. + */ + public int DecodeString( + string data, + Stream outStream) + { + byte b1, b2; + int length = 0; + + int end = data.Length; + + while (end > 0) + { + if (!Ignore(data[end - 1])) + { + break; + } + + end--; + } + + int i = 0; + while (i < end) + { + while (i < end && Ignore(data[i])) + { + i++; + } + + b1 = decodingTable[data[i++]]; + + while (i < end && Ignore(data[i])) + { + i++; + } + + b2 = decodingTable[data[i++]]; + + if ((b1 | b2) >= 0x80) + throw new IOException("invalid characters encountered in Hex data"); + + outStream.WriteByte((byte)((b1 << 4) | b2)); + + length++; + } + + return length; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexEncoder.cs.meta new file mode 100644 index 00000000..d585633d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexEncoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05d0f6c3caab0a549b8c1067b01bcbb2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexTranslator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexTranslator.cs new file mode 100644 index 00000000..c2d218df --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexTranslator.cs @@ -0,0 +1,112 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + /// + /// A hex translator. + /// + public class HexTranslator : ITranslator + { + private static readonly byte[] hexTable = + { + (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6', (byte)'7', + (byte)'8', (byte)'9', (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f' + }; + + /// + /// Return encoded block size. + /// + /// 2 + public int GetEncodedBlockSize() + { + return 2; + } + + /// + /// Encode some data. + /// + /// Input data array. + /// Start position within input data array. + /// The amount of data to process. + /// The output data array. + /// The offset within the output data array to start writing from. + /// Amount of data encoded. + public int Encode( + byte[] input, + int inOff, + int length, + byte[] outBytes, + int outOff) + { + for (int i = 0, j = 0; i < length; i++, j += 2) + { + outBytes[outOff + j] = hexTable[(input[inOff] >> 4) & 0x0f]; + outBytes[outOff + j + 1] = hexTable[input[inOff] & 0x0f]; + + inOff++; + } + + return length * 2; + } + + /// + /// Returns the decoded block size. + /// + /// 1 + public int GetDecodedBlockSize() + { + return 1; + } + + /// + /// Decode data from a byte array. + /// + /// The input data array. + /// Start position within input data array. + /// The amounty of data to process. + /// The output data array. + /// The position within the output data array to start writing from. + /// The amount of data written. + public int Decode( + byte[] input, + int inOff, + int length, + byte[] outBytes, + int outOff) + { + int halfLength = length / 2; + byte left, right; + for (int i = 0; i < halfLength; i++) + { + left = input[inOff + i * 2]; + right = input[inOff + i * 2 + 1]; + + if (left < (byte)'a') + { + outBytes[outOff] = (byte)((left - '0') << 4); + } + else + { + outBytes[outOff] = (byte)((left - 'a' + 10) << 4); + } + if (right < (byte)'a') + { + outBytes[outOff] += (byte)(right - '0'); + } + else + { + outBytes[outOff] += (byte)(right - 'a' + 10); + } + + outOff++; + } + + return halfLength; + } + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexTranslator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexTranslator.cs.meta new file mode 100644 index 00000000..38b3100b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/HexTranslator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a4cfe8d15199522458337f90de553550 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/IEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/IEncoder.cs new file mode 100644 index 00000000..80fc0a5d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/IEncoder.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + /** + * Encode and decode byte arrays (typically from binary to 7-bit ASCII + * encodings). + */ + public interface IEncoder + { + int Encode(byte[] data, int off, int length, Stream outStream); + + int Decode(byte[] data, int off, int length, Stream outStream); + + int DecodeString(string data, Stream outStream); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/IEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/IEncoder.cs.meta new file mode 100644 index 00000000..928cc8f3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/IEncoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2e240a99386c56d4c833831f5247b554 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Translator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Translator.cs new file mode 100644 index 00000000..fc3c50ad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Translator.cs @@ -0,0 +1,23 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + /// + /// Translator interface. + /// + public interface ITranslator + { + int GetEncodedBlockSize(); + + int Encode(byte[] input, int inOff, int length, byte[] outBytes, int outOff); + + int GetDecodedBlockSize(); + + int Decode(byte[] input, int inOff, int length, byte[] outBytes, int outOff); + } + +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Translator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Translator.cs.meta new file mode 100644 index 00000000..78ceb015 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/Translator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fd4d0e7a77106f047a8aab6380c5e046 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64.cs new file mode 100644 index 00000000..b065d8a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64.cs @@ -0,0 +1,131 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + /** + * Convert binary data to and from UrlBase64 encoding. This is identical to + * Base64 encoding, except that the padding character is "." and the other + * non-alphanumeric characters are "-" and "_" instead of "+" and "/". + *

    + * The purpose of UrlBase64 encoding is to provide a compact encoding of binary + * data that is safe for use as an URL parameter. Base64 encoding does not + * produce encoded values that are safe for use in URLs, since "/" can be + * interpreted as a path delimiter; "+" is the encoded form of a space; and + * "=" is used to separate a name from the corresponding value in an URL + * parameter. + *

    + */ + public class UrlBase64 + { + private static readonly IEncoder encoder = new UrlBase64Encoder(); + + /** + * Encode the input data producing a URL safe base 64 encoded byte array. + * + * @return a byte array containing the URL safe base 64 encoded data. + */ + public static byte[] Encode( + byte[] data) + { + MemoryStream bOut = new MemoryStream(); + + try + { + encoder.Encode(data, 0, data.Length, bOut); + } + catch (IOException e) + { + throw new Exception("exception encoding URL safe base64 string: " + e.Message, e); + } + + return bOut.ToArray(); + } + + /** + * Encode the byte data writing it to the given output stream. + * + * @return the number of bytes produced. + */ + public static int Encode( + byte[] data, + Stream outStr) + { + return encoder.Encode(data, 0, data.Length, outStr); + } + + /** + * Decode the URL safe base 64 encoded input data - white space will be ignored. + * + * @return a byte array representing the decoded data. + */ + public static byte[] Decode( + byte[] data) + { + MemoryStream bOut = new MemoryStream(); + + try + { + encoder.Decode(data, 0, data.Length, bOut); + } + catch (IOException e) + { + throw new Exception("exception decoding URL safe base64 string: " + e.Message, e); + } + + return bOut.ToArray(); + } + + /** + * decode the URL safe base 64 encoded byte data writing it to the given output stream, + * whitespace characters will be ignored. + * + * @return the number of bytes produced. + */ + public static int Decode( + byte[] data, + Stream outStr) + { + return encoder.Decode(data, 0, data.Length, outStr); + } + + /** + * decode the URL safe base 64 encoded string data - whitespace will be ignored. + * + * @return a byte array representing the decoded data. + */ + public static byte[] Decode( + string data) + { + MemoryStream bOut = new MemoryStream(); + + try + { + encoder.DecodeString(data, bOut); + } + catch (IOException e) + { + throw new Exception("exception decoding URL safe base64 string: " + e.Message, e); + } + + return bOut.ToArray(); + } + + /** + * Decode the URL safe base 64 encoded string data writing it to the given output stream, + * whitespace characters will be ignored. + * + * @return the number of bytes produced. + */ + public static int Decode( + string data, + Stream outStr) + { + return encoder.DecodeString(data, outStr); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64.cs.meta new file mode 100644 index 00000000..65dc9004 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3b90f1cc819741c42aa20ee7dee4e85a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64Encoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64Encoder.cs new file mode 100644 index 00000000..1a9961cc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64Encoder.cs @@ -0,0 +1,35 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders +{ + /** + * Convert binary data to and from UrlBase64 encoding. This is identical to + * Base64 encoding, except that the padding character is "." and the other + * non-alphanumeric characters are "-" and "_" instead of "+" and "/". + *

    + * The purpose of UrlBase64 encoding is to provide a compact encoding of binary + * data that is safe for use as an URL parameter. Base64 encoding does not + * produce encoded values that are safe for use in URLs, since "/" can be + * interpreted as a path delimiter; "+" is the encoded form of a space; and + * "=" is used to separate a name from the corresponding value in an URL + * parameter. + *

    + */ + public class UrlBase64Encoder + : Base64Encoder + { + public UrlBase64Encoder() + { + encodingTable[encodingTable.Length - 2] = (byte) '-'; + encodingTable[encodingTable.Length - 1] = (byte) '_'; + padding = (byte) '.'; + // we must re-create the decoding table with the new encoded values. + InitialiseDecodingTable(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64Encoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64Encoder.cs.meta new file mode 100644 index 00000000..538c1eb7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/encoders/UrlBase64Encoder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39a7d129d5716d94db71754607e15ec5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io.meta new file mode 100644 index 00000000..d963f375 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8d0ebd9539721c34daaadeafccd8ed9d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseInputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseInputStream.cs new file mode 100644 index 00000000..024694f3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseInputStream.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO +{ + public abstract class BaseInputStream : Stream + { + private bool closed; + + public sealed override bool CanRead { get { return !closed; } } + public sealed override bool CanSeek { get { return false; } } + public sealed override bool CanWrite { get { return false; } } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + closed = true; + } + base.Dispose(disposing); + } +#else + public override void Close() + { + closed = true; + base.Close(); + } +#endif + + public sealed override void Flush() {} + public sealed override long Length { get { throw new NotSupportedException(); } } + public sealed override long Position + { + get { throw new NotSupportedException(); } + set { throw new NotSupportedException(); } + } + + public override int Read(byte[] buffer, int offset, int count) + { + int pos = offset; + try + { + int end = offset + count; + while (pos < end) + { + int b = ReadByte(); + if (b == -1) break; + buffer[pos++] = (byte) b; + } + } + catch (IOException) + { + if (pos == offset) throw; + } + return pos - offset; + } + + public sealed override long Seek(long offset, SeekOrigin origin) { throw new NotSupportedException(); } + public sealed override void SetLength(long value) { throw new NotSupportedException(); } + public sealed override void Write(byte[] buffer, int offset, int count) { throw new NotSupportedException(); } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseInputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseInputStream.cs.meta new file mode 100644 index 00000000..f860ae92 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseInputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c55c7018496d63408687d3da511e3ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseOutputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseOutputStream.cs new file mode 100644 index 00000000..5536de25 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseOutputStream.cs @@ -0,0 +1,73 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO +{ + public abstract class BaseOutputStream : Stream + { + private bool closed; + + public sealed override bool CanRead { get { return false; } } + public sealed override bool CanSeek { get { return false; } } + public sealed override bool CanWrite { get { return !closed; } } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + closed = true; + } + base.Dispose(disposing); + } +#else + public override void Close() + { + closed = true; + base.Close(); + } +#endif + + public override void Flush() { } + public sealed override long Length { get { throw new NotSupportedException(); } } + public sealed override long Position + { + get { throw new NotSupportedException(); } + set { throw new NotSupportedException(); } + } + public sealed override int Read(byte[] buffer, int offset, int count) { throw new NotSupportedException(); } + public sealed override long Seek(long offset, SeekOrigin origin) { throw new NotSupportedException(); } + public sealed override void SetLength(long value) { throw new NotSupportedException(); } + + public override void Write(byte[] buffer, int offset, int count) + { + Debug.Assert(buffer != null); + Debug.Assert(0 <= offset && offset <= buffer.Length); + Debug.Assert(count >= 0); + + int end = offset + count; + + Debug.Assert(0 <= end && end <= buffer.Length); + + for (int i = offset; i < end; ++i) + { + this.WriteByte(buffer[i]); + } + } + + public virtual void Write(params byte[] buffer) + { + Write(buffer, 0, buffer.Length); + } + + public override void WriteByte(byte b) + { + Write(new byte[]{ b }, 0, 1); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseOutputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseOutputStream.cs.meta new file mode 100644 index 00000000..ff2cd329 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/BaseOutputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a6aa30f111ed30408694c452b3e0947 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/FilterStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/FilterStream.cs new file mode 100644 index 00000000..4fe84862 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/FilterStream.cs @@ -0,0 +1,82 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO +{ + public class FilterStream : Stream + { + public FilterStream(Stream s) + { + this.s = s; + } + public override bool CanRead + { + get { return s.CanRead; } + } + public override bool CanSeek + { + get { return s.CanSeek; } + } + public override bool CanWrite + { + get { return s.CanWrite; } + } + public override long Length + { + get { return s.Length; } + } + public override long Position + { + get { return s.Position; } + set { s.Position = value; } + } +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(s); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(s); + base.Close(); + } +#endif + public override void Flush() + { + s.Flush(); + } + public override long Seek(long offset, SeekOrigin origin) + { + return s.Seek(offset, origin); + } + public override void SetLength(long value) + { + s.SetLength(value); + } + public override int Read(byte[] buffer, int offset, int count) + { + return s.Read(buffer, offset, count); + } + public override int ReadByte() + { + return s.ReadByte(); + } + public override void Write(byte[] buffer, int offset, int count) + { + s.Write(buffer, offset, count); + } + public override void WriteByte(byte value) + { + s.WriteByte(value); + } + protected readonly Stream s; + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/FilterStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/FilterStream.cs.meta new file mode 100644 index 00000000..4c41df04 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/FilterStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fce67f814432d848a840ddec287f366 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/NullOutputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/NullOutputStream.cs new file mode 100644 index 00000000..3dc5c89b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/NullOutputStream.cs @@ -0,0 +1,22 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO +{ + internal class NullOutputStream + : BaseOutputStream + { + public override void WriteByte(byte b) + { + // do nothing + } + + public override void Write(byte[] buffer, int offset, int count) + { + // do nothing + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/NullOutputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/NullOutputStream.cs.meta new file mode 100644 index 00000000..2a6b930c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/NullOutputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1ee11a15bc038f4993c637d576ef943 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/PushbackStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/PushbackStream.cs new file mode 100644 index 00000000..85b666bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/PushbackStream.cs @@ -0,0 +1,56 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO +{ + public class PushbackStream + : FilterStream + { + private int buf = -1; + + public PushbackStream( + Stream s) + : base(s) + { + } + + public override int ReadByte() + { + if (buf != -1) + { + int tmp = buf; + buf = -1; + return tmp; + } + + return base.ReadByte(); + } + + public override int Read(byte[] buffer, int offset, int count) + { + if (buf != -1 && count > 0) + { + // TODO Can this case be made more efficient? + buffer[offset] = (byte) buf; + buf = -1; + return 1; + } + + return base.Read(buffer, offset, count); + } + + public virtual void Unread(int b) + { + if (buf != -1) + throw new InvalidOperationException("Can only push back one byte"); + + buf = b & 0xFF; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/PushbackStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/PushbackStream.cs.meta new file mode 100644 index 00000000..bca52c14 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/PushbackStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 43f5f3bf52001c342945b5bb8fd8fa9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/StreamOverflowException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/StreamOverflowException.cs new file mode 100644 index 00000000..97218c17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/StreamOverflowException.cs @@ -0,0 +1,34 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class StreamOverflowException + : IOException + { + public StreamOverflowException() + : base() + { + } + + public StreamOverflowException( + string message) + : base(message) + { + } + + public StreamOverflowException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/StreamOverflowException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/StreamOverflowException.cs.meta new file mode 100644 index 00000000..fa266080 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/StreamOverflowException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f9bebbf770f250c4ab5bd25ef8f384a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/Streams.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/Streams.cs new file mode 100644 index 00000000..e8a4916f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/Streams.cs @@ -0,0 +1,129 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO +{ + public sealed class Streams + { + private const int BufferSize = 512; + + private Streams() + { + } + + public static void Drain(Stream inStr) + { + byte[] bs = new byte[BufferSize]; + while (inStr.Read(bs, 0, bs.Length) > 0) + { + } + } + + public static byte[] ReadAll(Stream inStr) + { + MemoryStream buf = new MemoryStream(); + PipeAll(inStr, buf); + return buf.ToArray(); + } + + public static byte[] ReadAllLimited(Stream inStr, int limit) + { + MemoryStream buf = new MemoryStream(); + PipeAllLimited(inStr, limit, buf); + return buf.ToArray(); + } + + public static int ReadFully(Stream inStr, byte[] buf) + { + return ReadFully(inStr, buf, 0, buf.Length); + } + + public static int ReadFully(Stream inStr, byte[] buf, int off, int len) + { + int totalRead = 0; + while (totalRead < len) + { + int numRead = inStr.Read(buf, off + totalRead, len - totalRead); + if (numRead < 1) + break; + totalRead += numRead; + } + return totalRead; + } + + public static void PipeAll(Stream inStr, Stream outStr) + { + byte[] bs = new byte[BufferSize]; + int numRead; + while ((numRead = inStr.Read(bs, 0, bs.Length)) > 0) + { + outStr.Write(bs, 0, numRead); + } + } + + /// + /// Pipe all bytes from inStr to outStr, throwing StreamFlowException if greater + /// than limit bytes in inStr. + /// + /// + /// A + /// + /// + /// A + /// + /// + /// A + /// + /// The number of bytes actually transferred, if not greater than limit + /// + public static long PipeAllLimited(Stream inStr, long limit, Stream outStr) + { + byte[] bs = new byte[BufferSize]; + long total = 0; + int numRead; + while ((numRead = inStr.Read(bs, 0, bs.Length)) > 0) + { + if ((limit - total) < numRead) + throw new StreamOverflowException("Data Overflow"); + total += numRead; + outStr.Write(bs, 0, numRead); + } + return total; + } + + /// + public static void WriteBufTo(MemoryStream buf, Stream output) + { + buf.WriteTo(output); + } + + /// + public static int WriteBufTo(MemoryStream buf, byte[] output, int offset) + { +#if PORTABLE || NETFX_CORE + byte[] bytes = buf.ToArray(); + bytes.CopyTo(output, offset); + return bytes.Length; +#else + int size = (int)buf.Length; + buf.WriteTo(new MemoryStream(output, offset, size, true)); + return size; +#endif + } + + public static void WriteZeroes(Stream outStr, long count) + { + byte[] zeroes = new byte[BufferSize]; + while (count > BufferSize) + { + outStr.Write(zeroes, 0, BufferSize); + count -= BufferSize; + } + outStr.Write(zeroes, 0, (int)count); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/Streams.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/Streams.cs.meta new file mode 100644 index 00000000..8924fc4e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/Streams.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7009443e85a87f4499c540687b6cb8c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeInputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeInputStream.cs new file mode 100644 index 00000000..1f0d169e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeInputStream.cs @@ -0,0 +1,68 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO +{ + public class TeeInputStream + : BaseInputStream + { + private readonly Stream input, tee; + + public TeeInputStream(Stream input, Stream tee) + { + Debug.Assert(input.CanRead); + Debug.Assert(tee.CanWrite); + + this.input = input; + this.tee = tee; + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(input); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(tee); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(input); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(tee); + base.Close(); + } +#endif + + public override int Read(byte[] buf, int off, int len) + { + int i = input.Read(buf, off, len); + + if (i > 0) + { + tee.Write(buf, off, i); + } + + return i; + } + + public override int ReadByte() + { + int i = input.ReadByte(); + + if (i >= 0) + { + tee.WriteByte((byte)i); + } + + return i; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeInputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeInputStream.cs.meta new file mode 100644 index 00000000..a6ab6270 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeInputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae88e55e5d7dac54aa31654c14619f10 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeOutputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeOutputStream.cs new file mode 100644 index 00000000..c19eb288 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeOutputStream.cs @@ -0,0 +1,56 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Diagnostics; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO +{ + public class TeeOutputStream + : BaseOutputStream + { + private readonly Stream output, tee; + + public TeeOutputStream(Stream output, Stream tee) + { + Debug.Assert(output.CanWrite); + Debug.Assert(tee.CanWrite); + + this.output = output; + this.tee = tee; + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(output); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(tee); + } + base.Dispose(disposing); + } +#else + public override void Close() + { + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(output); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(tee); + base.Close(); + } +#endif + + public override void Write(byte[] buffer, int offset, int count) + { + output.Write(buffer, offset, count); + tee.Write(buffer, offset, count); + } + + public override void WriteByte(byte b) + { + output.WriteByte(b); + tee.WriteByte(b); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeOutputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeOutputStream.cs.meta new file mode 100644 index 00000000..a2c47db6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/TeeOutputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 94d20141b69679e4293e7365906dbe4b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem.meta new file mode 100644 index 00000000..64312356 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: facfbd283a257c247b7788a4852da32a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemGenerationException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemGenerationException.cs new file mode 100644 index 00000000..aac38dc0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemGenerationException.cs @@ -0,0 +1,33 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class PemGenerationException + : Exception + { + public PemGenerationException() + : base() + { + } + + public PemGenerationException( + string message) + : base(message) + { + } + + public PemGenerationException( + string message, + Exception exception) + : base(message, exception) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemGenerationException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemGenerationException.cs.meta new file mode 100644 index 00000000..f8c7e60a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemGenerationException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d64f3f17b41a69c4e9f8146e9a630aa6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemHeader.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemHeader.cs new file mode 100644 index 00000000..062df710 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemHeader.cs @@ -0,0 +1,59 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem +{ + public class PemHeader + { + private string name; + private string val; + + public PemHeader(string name, string val) + { + this.name = name; + this.val = val; + } + + public virtual string Name + { + get { return name; } + } + + public virtual string Value + { + get { return val; } + } + + public override int GetHashCode() + { + return GetHashCode(this.name) + 31 * GetHashCode(this.val); + } + + public override bool Equals(object obj) + { + if (obj == this) + return true; + + if (!(obj is PemHeader)) + return false; + + PemHeader other = (PemHeader)obj; + + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(this.name, other.name) + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(this.val, other.val); + } + + private int GetHashCode(string s) + { + if (s == null) + { + return 1; + } + + return s.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemHeader.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemHeader.cs.meta new file mode 100644 index 00000000..5c0d2f1d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemHeader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6145fa38ebb0c79458ea0c15c317525d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObject.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObject.cs new file mode 100644 index 00000000..5d7b1dc2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObject.cs @@ -0,0 +1,51 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem +{ + public class PemObject + : PemObjectGenerator + { + private string type; + private IList headers; + private byte[] content; + + public PemObject(string type, byte[] content) + : this(type, BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(), content) + { + } + + public PemObject(String type, IList headers, byte[] content) + { + this.type = type; + this.headers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(headers); + this.content = content; + } + + public string Type + { + get { return type; } + } + + public IList Headers + { + get { return headers; } + } + + public byte[] Content + { + get { return content; } + } + + public PemObject Generate() + { + return this; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObject.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObject.cs.meta new file mode 100644 index 00000000..3c0c8e0c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObject.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd96e7dbd869965419cb9e8ee3aad2ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectGenerator.cs new file mode 100644 index 00000000..d2cfd8e2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectGenerator.cs @@ -0,0 +1,17 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem +{ + public interface PemObjectGenerator + { + /// + /// A + /// + /// + PemObject Generate(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectGenerator.cs.meta new file mode 100644 index 00000000..12f1a17a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae784c7acdea52e429e2586f22f7d6ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectParser.cs new file mode 100644 index 00000000..ab465a49 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectParser.cs @@ -0,0 +1,21 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem +{ + public interface PemObjectParser + { + /// + /// A + /// + /// + /// A + /// + /// + object ParseObject(PemObject obj); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectParser.cs.meta new file mode 100644 index 00000000..71255e2e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemObjectParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0ed04d49054ba1445bb5b1c03b5cc613 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemReader.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemReader.cs new file mode 100644 index 00000000..197a7c9e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemReader.cs @@ -0,0 +1,100 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem +{ + public class PemReader + { + private const string BeginString = "-----BEGIN "; + private const string EndString = "-----END "; + + private readonly TextReader reader; + + public PemReader(TextReader reader) + { + if (reader == null) + throw new ArgumentNullException("reader"); + + this.reader = reader; + } + + public TextReader Reader + { + get { return reader; } + } + + /// + /// A + /// + /// + public PemObject ReadPemObject() + { + string line = reader.ReadLine(); + + if (line != null && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(line, BeginString)) + { + line = line.Substring(BeginString.Length); + int index = line.IndexOf('-'); + string type = line.Substring(0, index); + + if (index > 0) + return LoadObject(type); + } + + return null; + } + + private PemObject LoadObject(string type) + { + string endMarker = EndString + type; + IList headers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + StringBuilder buf = new StringBuilder(); + + string line; + while ((line = reader.ReadLine()) != null + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.IndexOf(line, endMarker) == -1) + { + int colonPos = line.IndexOf(':'); + + if (colonPos == -1) + { + buf.Append(line.Trim()); + } + else + { + // Process field + string fieldName = line.Substring(0, colonPos).Trim(); + + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(fieldName, "X-")) + { + fieldName = fieldName.Substring(2); + } + + string fieldValue = line.Substring(colonPos + 1).Trim(); + + headers.Add(new PemHeader(fieldName, fieldValue)); + } + } + + if (line == null) + { + throw new IOException(endMarker + " not found"); + } + + if (buf.Length % 4 != 0) + { + throw new IOException("base64 data appears to be truncated"); + } + + return new PemObject(type, headers, Base64.Decode(buf.ToString())); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemReader.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemReader.cs.meta new file mode 100644 index 00000000..088a495a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemReader.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f26fdb1978588c94ba940413500381e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemWriter.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemWriter.cs new file mode 100644 index 00000000..7074a049 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemWriter.cs @@ -0,0 +1,124 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO.Pem +{ + /** + * A generic PEM writer, based on RFC 1421 + */ + public class PemWriter + { + private const int LineLength = 64; + + private readonly TextWriter writer; + private readonly int nlLength; + private char[] buf = new char[LineLength]; + + /** + * Base constructor. + * + * @param out output stream to use. + */ + public PemWriter(TextWriter writer) + { + if (writer == null) + throw new ArgumentNullException("writer"); + + this.writer = writer; + this.nlLength = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine.Length; + } + + public TextWriter Writer + { + get { return writer; } + } + + /** + * Return the number of bytes or characters required to contain the + * passed in object if it is PEM encoded. + * + * @param obj pem object to be output + * @return an estimate of the number of bytes + */ + public int GetOutputSize(PemObject obj) + { + // BEGIN and END boundaries. + int size = (2 * (obj.Type.Length + 10 + nlLength)) + 6 + 4; + + if (obj.Headers.Count > 0) + { + foreach (PemHeader header in obj.Headers) + { + size += header.Name.Length + ": ".Length + header.Value.Length + nlLength; + } + + size += nlLength; + } + + // base64 encoding + int dataLen = ((obj.Content.Length + 2) / 3) * 4; + + size += dataLen + (((dataLen + LineLength - 1) / LineLength) * nlLength); + + return size; + } + + public void WriteObject(PemObjectGenerator objGen) + { + PemObject obj = objGen.Generate(); + + WritePreEncapsulationBoundary(obj.Type); + + if (obj.Headers.Count > 0) + { + foreach (PemHeader header in obj.Headers) + { + writer.Write(header.Name); + writer.Write(": "); + writer.WriteLine(header.Value); + } + + writer.WriteLine(); + } + + WriteEncoded(obj.Content); + WritePostEncapsulationBoundary(obj.Type); + } + + private void WriteEncoded(byte[] bytes) + { + bytes = Base64.Encode(bytes); + + for (int i = 0; i < bytes.Length; i += buf.Length) + { + int index = 0; + while (index != buf.Length) + { + if ((i + index) >= bytes.Length) + break; + + buf[index] = (char)bytes[i + index]; + index++; + } + writer.WriteLine(buf, 0, index); + } + } + + private void WritePreEncapsulationBoundary(string type) + { + writer.WriteLine("-----BEGIN " + type + "-----"); + } + + private void WritePostEncapsulationBoundary(string type) + { + writer.WriteLine("-----END " + type + "-----"); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemWriter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemWriter.cs.meta new file mode 100644 index 00000000..b2fc9fa9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/io/pem/PemWriter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 32f18cc53c19448418b7b334997da7a4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net.meta new file mode 100644 index 00000000..59e27680 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ef95faa5f016dcf42829616d382ec0fd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net/IPAddress.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net/IPAddress.cs new file mode 100644 index 00000000..e5a501c8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net/IPAddress.cs @@ -0,0 +1,201 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Globalization; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Net +{ + public class IPAddress + { + /** + * Validate the given IPv4 or IPv6 address. + * + * @param address the IP address as a string. + * + * @return true if a valid address, false otherwise + */ + public static bool IsValid( + string address) + { + return IsValidIPv4(address) || IsValidIPv6(address); + } + + /** + * Validate the given IPv4 or IPv6 address and netmask. + * + * @param address the IP address as a string. + * + * @return true if a valid address with netmask, false otherwise + */ + public static bool IsValidWithNetMask( + string address) + { + return IsValidIPv4WithNetmask(address) || IsValidIPv6WithNetmask(address); + } + + /** + * Validate the given IPv4 address. + * + * @param address the IP address as a string. + * + * @return true if a valid IPv4 address, false otherwise + */ + public static bool IsValidIPv4( + string address) + { + try + { + return unsafeIsValidIPv4(address); + } + catch (FormatException) {} + catch (OverflowException) {} + return false; + } + + private static bool unsafeIsValidIPv4( + string address) + { + if (address.Length == 0) + return false; + + int octets = 0; + string temp = address + "."; + + int pos; + int start = 0; + while (start < temp.Length + && (pos = temp.IndexOf('.', start)) > start) + { + if (octets == 4) + return false; + + string octetStr = temp.Substring(start, pos - start); + int octet = Int32.Parse(octetStr); + + if (octet < 0 || octet > 255) + return false; + + start = pos + 1; + octets++; + } + + return octets == 4; + } + + public static bool IsValidIPv4WithNetmask( + string address) + { + int index = address.IndexOf('/'); + string mask = address.Substring(index + 1); + + return (index > 0) && IsValidIPv4(address.Substring(0, index)) + && (IsValidIPv4(mask) || IsMaskValue(mask, 32)); + } + + public static bool IsValidIPv6WithNetmask( + string address) + { + int index = address.IndexOf('/'); + string mask = address.Substring(index + 1); + + return (index > 0) && (IsValidIPv6(address.Substring(0, index)) + && (IsValidIPv6(mask) || IsMaskValue(mask, 128))); + } + + private static bool IsMaskValue( + string component, + int size) + { + int val = Int32.Parse(component); + try + { + return val >= 0 && val <= size; + } + catch (FormatException) {} + catch (OverflowException) {} + return false; + } + + /** + * Validate the given IPv6 address. + * + * @param address the IP address as a string. + * + * @return true if a valid IPv4 address, false otherwise + */ + public static bool IsValidIPv6( + string address) + { + try + { + return unsafeIsValidIPv6(address); + } + catch (FormatException) {} + catch (OverflowException) {} + return false; + } + + private static bool unsafeIsValidIPv6( + string address) + { + if (address.Length == 0) + { + return false; + } + + int octets = 0; + + string temp = address + ":"; + bool doubleColonFound = false; + int pos; + int start = 0; + while (start < temp.Length + && (pos = temp.IndexOf(':', start)) >= start) + { + if (octets == 8) + { + return false; + } + + if (start != pos) + { + string value = temp.Substring(start, pos - start); + + if (pos == (temp.Length - 1) && value.IndexOf('.') > 0) + { + if (!IsValidIPv4(value)) + { + return false; + } + + octets++; // add an extra one as address covers 2 words. + } + else + { + string octetStr = temp.Substring(start, pos - start); + int octet = Int32.Parse(octetStr, NumberStyles.AllowHexSpecifier); + + if (octet < 0 || octet > 0xffff) + return false; + } + } + else + { + if (pos != 1 && pos != temp.Length - 1 && doubleColonFound) + { + return false; + } + doubleColonFound = true; + } + start = pos + 1; + octets++; + } + + return octets == 8 || doubleColonFound; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net/IPAddress.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net/IPAddress.cs.meta new file mode 100644 index 00000000..00fbfebc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/net/IPAddress.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c829f456cc2252e4da1989ca55f8c0b8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib.meta new file mode 100644 index 00000000..7218d6d8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4d3c9d4702c5ca34fa5b819f8f2c5850 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Adler32.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Adler32.cs new file mode 100644 index 00000000..422d2674 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Adler32.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +/* + * $Id: Adler32.cs,v 1.1 2006-07-31 13:59:25 bouncy Exp $ + * +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib { + + internal sealed class Adler32{ + + // largest prime smaller than 65536 + private const int BASE=65521; + // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 + private const int NMAX=5552; + + internal long adler32(long adler, byte[] buf, int index, int len){ + if(buf == null){ return 1L; } + + long s1=adler&0xffff; + long s2=(adler>>16)&0xffff; + int k; + + while(len > 0) { + k=len=16){ + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + s1+=buf[index++]&0xff; s2+=s1; + k-=16; + } + if(k!=0){ + do{ + s1+=buf[index++]&0xff; s2+=s1; + } + while(--k!=0); + } + s1%=BASE; + s2%=BASE; + } + return (s2<<16)|s1; + } + + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Adler32.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Adler32.cs.meta new file mode 100644 index 00000000..2b21780f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Adler32.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2cfff793e226e3941b78bc3b1d5a873b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Deflate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Deflate.cs new file mode 100644 index 00000000..f960f482 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Deflate.cs @@ -0,0 +1,1644 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +/* + * $Id: Deflate.cs,v 1.2 2008-05-10 09:35:40 bouncy Exp $ + * +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib { + + public sealed class Deflate{ + + private const int MAX_MEM_LEVEL=9; + + private const int Z_DEFAULT_COMPRESSION=-1; + + private const int MAX_WBITS=15; // 32K LZ77 window + private const int DEF_MEM_LEVEL=8; + + internal class Config{ + internal int good_length; // reduce lazy search above this match length + internal int max_lazy; // do not perform lazy search above this match length + internal int nice_length; // quit search above this match length + internal int max_chain; + internal int func; + internal Config(int good_length, int max_lazy, + int nice_length, int max_chain, int func){ + this.good_length=good_length; + this.max_lazy=max_lazy; + this.nice_length=nice_length; + this.max_chain=max_chain; + this.func=func; + } + } + + private const int STORED=0; + private const int FAST=1; + private const int SLOW=2; + private static readonly Config[] config_table; + + static Deflate(){ + config_table=new Config[10]; + // good lazy nice chain + config_table[0]=new Config(0, 0, 0, 0, STORED); + config_table[1]=new Config(4, 4, 8, 4, FAST); + config_table[2]=new Config(4, 5, 16, 8, FAST); + config_table[3]=new Config(4, 6, 32, 32, FAST); + + config_table[4]=new Config(4, 4, 16, 16, SLOW); + config_table[5]=new Config(8, 16, 32, 32, SLOW); + config_table[6]=new Config(8, 16, 128, 128, SLOW); + config_table[7]=new Config(8, 32, 128, 256, SLOW); + config_table[8]=new Config(32, 128, 258, 1024, SLOW); + config_table[9]=new Config(32, 258, 258, 4096, SLOW); + } + + private static readonly String[] z_errmsg = { + "need dictionary", // Z_NEED_DICT 2 + "stream end", // Z_STREAM_END 1 + "", // Z_OK 0 + "file error", // Z_ERRNO (-1) + "stream error", // Z_STREAM_ERROR (-2) + "data error", // Z_DATA_ERROR (-3) + "insufficient memory", // Z_MEM_ERROR (-4) + "buffer error", // Z_BUF_ERROR (-5) + "incompatible version",// Z_VERSION_ERROR (-6) + "" + }; + + // block not completed, need more input or more output + private const int NeedMore=0; + + // block flush performed + private const int BlockDone=1; + + // finish started, need only more output at next deflate + private const int FinishStarted=2; + + // finish done, accept no more input or output + private const int FinishDone=3; + + // preset dictionary flag in zlib header + private const int PRESET_DICT=0x20; + + private const int Z_FILTERED=1; + private const int Z_HUFFMAN_ONLY=2; + private const int Z_DEFAULT_STRATEGY=0; + + private const int Z_NO_FLUSH=0; + private const int Z_PARTIAL_FLUSH=1; + private const int Z_SYNC_FLUSH=2; + private const int Z_FULL_FLUSH=3; + private const int Z_FINISH=4; + + private const int Z_OK=0; + private const int Z_STREAM_END=1; + private const int Z_NEED_DICT=2; + private const int Z_ERRNO=-1; + private const int Z_STREAM_ERROR=-2; + private const int Z_DATA_ERROR=-3; + private const int Z_MEM_ERROR=-4; + private const int Z_BUF_ERROR=-5; + private const int Z_VERSION_ERROR=-6; + + private const int INIT_STATE=42; + private const int BUSY_STATE=113; + private const int FINISH_STATE=666; + + // The deflate compression method + private const int Z_DEFLATED=8; + + private const int STORED_BLOCK=0; + private const int STATIC_TREES=1; + private const int DYN_TREES=2; + + // The three kinds of block type + private const int Z_BINARY=0; + private const int Z_ASCII=1; + private const int Z_UNKNOWN=2; + + private const int Buf_size=8*2; + + // repeat previous bit length 3-6 times (2 bits of repeat count) + private const int REP_3_6=16; + + // repeat a zero length 3-10 times (3 bits of repeat count) + private const int REPZ_3_10=17; + + // repeat a zero length 11-138 times (7 bits of repeat count) + private const int REPZ_11_138=18; + + private const int MIN_MATCH=3; + private const int MAX_MATCH=258; + private const int MIN_LOOKAHEAD=(MAX_MATCH+MIN_MATCH+1); + + private const int MAX_BITS=15; + private const int D_CODES=30; + private const int BL_CODES=19; + private const int LENGTH_CODES=29; + private const int LITERALS=256; + private const int L_CODES=(LITERALS+1+LENGTH_CODES); + private const int HEAP_SIZE=(2*L_CODES+1); + + private const int END_BLOCK=256; + + internal ZStream strm; // pointer back to this zlib stream + internal int status; // as the name implies + internal byte[] pending_buf; // output still pending + internal int pending_buf_size; // size of pending_buf + internal int pending_out; // next pending byte to output to the stream + internal int pending; // nb of bytes in the pending buffer + internal int noheader; // suppress zlib header and adler32 + internal byte data_type; // UNKNOWN, BINARY or ASCII + internal byte method; // STORED (for zip only) or DEFLATED + internal int last_flush; // value of flush param for previous deflate call + + internal int w_size; // LZ77 window size (32K by default) + internal int w_bits; // log2(w_size) (8..16) + internal int w_mask; // w_size - 1 + + internal byte[] window; + // Sliding window. Input bytes are read into the second half of the window, + // and move to the first half later to keep a dictionary of at least wSize + // bytes. With this organization, matches are limited to a distance of + // wSize-MAX_MATCH bytes, but this ensures that IO is always + // performed with a length multiple of the block size. Also, it limits + // the window size to 64K, which is quite useful on MSDOS. + // To do: use the user input buffer as sliding window. + + internal int window_size; + // Actual size of window: 2*wSize, except when the user input buffer + // is directly used as sliding window. + + internal short[] prev; + // Link to older string with same hash index. To limit the size of this + // array to 64K, this link is maintained only for the last 32K strings. + // An index in this array is thus a window index modulo 32K. + + internal short[] head; // Heads of the hash chains or NIL. + + internal int ins_h; // hash index of string to be inserted + internal int hash_size; // number of elements in hash table + internal int hash_bits; // log2(hash_size) + internal int hash_mask; // hash_size-1 + + // Number of bits by which ins_h must be shifted at each input + // step. It must be such that after MIN_MATCH steps, the oldest + // byte no longer takes part in the hash key, that is: + // hash_shift * MIN_MATCH >= hash_bits + internal int hash_shift; + + // Window position at the beginning of the current output block. Gets + // negative when the window is moved backwards. + + internal int block_start; + + internal int match_length; // length of best match + internal int prev_match; // previous match + internal int match_available; // set if previous match exists + internal int strstart; // start of string to insert + internal int match_start; // start of matching string + internal int lookahead; // number of valid bytes ahead in window + + // Length of the best match at previous step. Matches not greater than this + // are discarded. This is used in the lazy match evaluation. + internal int prev_length; + + // To speed up deflation, hash chains are never searched beyond this + // length. A higher limit improves compression ratio but degrades the speed. + internal int max_chain_length; + + // Attempt to find a better match only when the current match is strictly + // smaller than this value. This mechanism is used only for compression + // levels >= 4. + internal int max_lazy_match; + + // Insert new strings in the hash table only if the match length is not + // greater than this length. This saves time but degrades compression. + // max_insert_length is used only for compression levels <= 3. + + internal int level; // compression level (1..9) + internal int strategy; // favor or force Huffman coding + + // Use a faster search when the previous match is longer than this + internal int good_match; + + // Stop searching when current match exceeds this + internal int nice_match; + + internal short[] dyn_ltree; // literal and length tree + internal short[] dyn_dtree; // distance tree + internal short[] bl_tree; // Huffman tree for bit lengths + + internal ZTree l_desc=new ZTree(); // desc for literal tree + internal ZTree d_desc=new ZTree(); // desc for distance tree + internal ZTree bl_desc=new ZTree(); // desc for bit length tree + + // number of codes at each bit length for an optimal tree + internal short[] bl_count=new short[MAX_BITS+1]; + + // heap used to build the Huffman trees + internal int[] heap=new int[2*L_CODES+1]; + + internal int heap_len; // number of elements in the heap + internal int heap_max; // element of largest frequency + // The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + // The same heap array is used to build all trees. + + // Depth of each subtree used as tie breaker for trees of equal frequency + internal byte[] depth=new byte[2*L_CODES+1]; + + internal int l_buf; // index for literals or lengths */ + + // Size of match buffer for literals/lengths. There are 4 reasons for + // limiting lit_bufsize to 64K: + // - frequencies can be kept in 16 bit counters + // - if compression is not successful for the first block, all input + // data is still in the window so we can still emit a stored block even + // when input comes from standard input. (This can also be done for + // all blocks if lit_bufsize is not greater than 32K.) + // - if compression is not successful for a file smaller than 64K, we can + // even emit a stored file instead of a stored block (saving 5 bytes). + // This is applicable only for zip (not gzip or zlib). + // - creating new Huffman trees less frequently may not provide fast + // adaptation to changes in the input data statistics. (Take for + // example a binary file with poorly compressible code followed by + // a highly compressible string table.) Smaller buffer sizes give + // fast adaptation but have of course the overhead of transmitting + // trees more frequently. + // - I can't count above 4 + internal int lit_bufsize; + + internal int last_lit; // running index in l_buf + + // Buffer for distances. To simplify the code, d_buf and l_buf have + // the same number of elements. To use different lengths, an extra flag + // array would be necessary. + + internal int d_buf; // index of pendig_buf + + internal int opt_len; // bit length of current block with optimal trees + internal int static_len; // bit length of current block with static trees + internal int matches; // number of string matches in current block + internal int last_eob_len; // bit length of EOB code for last block + + // Output buffer. bits are inserted starting at the bottom (least + // significant bits). + internal uint bi_buf; + + // Number of valid bits in bi_buf. All bits above the last valid bit + // are always zero. + internal int bi_valid; + + internal Deflate(){ + dyn_ltree=new short[HEAP_SIZE*2]; + dyn_dtree=new short[(2*D_CODES+1)*2]; // distance tree + bl_tree=new short[(2*BL_CODES+1)*2]; // Huffman tree for bit lengths + } + + internal void lm_init() { + window_size=2*w_size; + + head[hash_size-1]=0; + for(int i=0; i= 3; max_blindex--) { + if (bl_tree[ZTree.bl_order[max_blindex]*2+1] != 0) break; + } + // Update opt_len to include the bit length tree and counts + opt_len += 3*(max_blindex+1) + 5+5+4; + + return max_blindex; + } + + + // Send the header for a block using dynamic Huffman trees: the counts, the + // lengths of the bit length codes, the literal tree and the distance tree. + // IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + internal void send_all_trees(int lcodes, int dcodes, int blcodes){ + int rank; // index in bl_order + + send_bits(lcodes-257, 5); // not +255 as stated in appnote.txt + send_bits(dcodes-1, 5); + send_bits(blcodes-4, 4); // not -3 as stated in appnote.txt + for (rank = 0; rank < blcodes; rank++) { + send_bits(bl_tree[ZTree.bl_order[rank]*2+1], 3); + } + send_tree(dyn_ltree, lcodes-1); // literal tree + send_tree(dyn_dtree, dcodes-1); // distance tree + } + + // Send a literal or distance tree in compressed form, using the codes in + // bl_tree. + internal void send_tree (short[] tree,// the tree to be sent + int max_code // and its largest code of non zero frequency + ){ + int n; // iterates over all tree elements + int prevlen = -1; // last emitted length + int curlen; // length of current code + int nextlen = tree[0*2+1]; // length of next code + int count = 0; // repeat count of the current code + int max_count = 7; // max repeat count + int min_count = 4; // min repeat count + + if (nextlen == 0){ max_count = 138; min_count = 3; } + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[(n+1)*2+1]; + if(++count < max_count && curlen == nextlen) { + continue; + } + else if(count < min_count) { + do { send_code(curlen, bl_tree); } while (--count != 0); + } + else if(curlen != 0){ + if(curlen != prevlen){ + send_code(curlen, bl_tree); count--; + } + send_code(REP_3_6, bl_tree); + send_bits(count-3, 2); + } + else if(count <= 10){ + send_code(REPZ_3_10, bl_tree); + send_bits(count-3, 3); + } + else{ + send_code(REPZ_11_138, bl_tree); + send_bits(count-11, 7); + } + count = 0; prevlen = curlen; + if(nextlen == 0){ + max_count = 138; min_count = 3; + } + else if(curlen == nextlen){ + max_count = 6; min_count = 3; + } + else{ + max_count = 7; min_count = 4; + } + } + } + + // Output a byte on the stream. + // IN assertion: there is enough room in pending_buf. + internal void put_byte(byte[] p, int start, int len){ + System.Array.Copy(p, start, pending_buf, pending, len); + pending+=len; + } + + internal void put_byte(byte c){ + pending_buf[pending++]=c; + } + internal void put_short(int w) { + pending_buf[pending++]=(byte)(w/*&0xff*/); + pending_buf[pending++]=(byte)(w>>8); + } + internal void putShortMSB(int b){ + pending_buf[pending++]=(byte)(b>>8); + pending_buf[pending++]=(byte)(b/*&0xff*/); + } + + internal void send_code(int c, short[] tree){ + int c2=c*2; + send_bits((tree[c2]&0xffff), (tree[c2+1]&0xffff)); + } + + internal void send_bits(int val, int length){ + if (bi_valid > Buf_size - length) { + bi_buf |= (uint)(val << bi_valid); + pending_buf[pending++]=(byte)(bi_buf/*&0xff*/); + pending_buf[pending++]=(byte)(bi_buf>>8); + bi_buf = ((uint)val) >> (Buf_size - bi_valid); + bi_valid += length - Buf_size; + } else { + bi_buf |= (uint)(val << bi_valid); + bi_valid += length; + } +// int len = length; +// if (bi_valid > (int)Buf_size - len) { +// int val = value; +// // bi_buf |= (val << bi_valid); +// bi_buf = (short)((ushort)bi_buf | (ushort)((val << bi_valid)&0xffff)); +// put_short(bi_buf); +// bi_buf = (short)(((uint)val) >> (Buf_size - bi_valid)); +// bi_valid += len - Buf_size; +// } else { +// // bi_buf |= (value) << bi_valid; +// bi_buf = (short)((ushort)bi_buf | (ushort)(((value) << bi_valid)&0xffff)); +// bi_valid += len; +// } + } + + // Send one empty static block to give enough lookahead for inflate. + // This takes 10 bits, of which 7 may remain in the bit buffer. + // The current inflate code requires 9 bits of lookahead. If the + // last two codes for the previous block (real code plus EOB) were coded + // on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode + // the last real code. In this case we send two empty static blocks instead + // of one. (There are no problems if the previous block is stored or fixed.) + // To simplify the code, we assume the worst case of last real code encoded + // on one bit only. + internal void _tr_align(){ + send_bits(STATIC_TREES<<1, 3); + send_code(END_BLOCK, StaticTree.static_ltree); + + bi_flush(); + + // Of the 10 bits for the empty block, we have already sent + // (10 - bi_valid) bits. The lookahead for the last real code (before + // the EOB of the previous block) was thus at least one plus the length + // of the EOB plus what we have just sent of the empty static block. + if (1 + last_eob_len + 10 - bi_valid < 9) { + send_bits(STATIC_TREES<<1, 3); + send_code(END_BLOCK, StaticTree.static_ltree); + bi_flush(); + } + last_eob_len = 7; + } + + + // Save the match info and tally the frequency counts. Return true if + // the current block must be flushed. + internal bool _tr_tally (int dist, // distance of matched string + int lc // match length-MIN_MATCH or unmatched char (if dist==0) + ){ + + pending_buf[d_buf+last_lit*2] = (byte)(dist>>8); + pending_buf[d_buf+last_lit*2+1] = (byte)dist; + + pending_buf[l_buf+last_lit] = (byte)lc; last_lit++; + + if (dist == 0) { + // lc is the unmatched char + dyn_ltree[lc*2]++; + } + else { + matches++; + // Here, lc is the match length - MIN_MATCH + dist--; // dist = match distance - 1 + dyn_ltree[(ZTree._length_code[lc]+LITERALS+1)*2]++; + dyn_dtree[ZTree.d_code(dist)*2]++; + } + + if ((last_lit & 0x1fff) == 0 && level > 2) { + // Compute an upper bound for the compressed length + int out_length = last_lit*8; + int in_length = strstart - block_start; + int dcode; + for (dcode = 0; dcode < D_CODES; dcode++) { + out_length += (int)((int)dyn_dtree[dcode*2] * + (5L+ZTree.extra_dbits[dcode])); + } + out_length >>= 3; + if ((matches < (last_lit/2)) && out_length < in_length/2) return true; + } + + return (last_lit == lit_bufsize-1); + // We avoid equality with lit_bufsize because of wraparound at 64K + // on 16 bit machines and because stored blocks are restricted to + // 64K-1 bytes. + } + + // Send the block data compressed using the given Huffman trees + internal void compress_block(short[] ltree, short[] dtree){ + int dist; // distance of matched string + int lc; // match length or unmatched char (if dist == 0) + int lx = 0; // running index in l_buf + int code; // the code to send + int extra; // number of extra bits to send + + if (last_lit != 0){ + do{ + dist=((pending_buf[d_buf+lx*2]<<8)&0xff00)| + (pending_buf[d_buf+lx*2+1]&0xff); + lc=(pending_buf[l_buf+lx])&0xff; lx++; + + if(dist == 0){ + send_code(lc, ltree); // send a literal byte + } + else{ + // Here, lc is the match length - MIN_MATCH + code = ZTree._length_code[lc]; + + send_code(code+LITERALS+1, ltree); // send the length code + extra = ZTree.extra_lbits[code]; + if(extra != 0){ + lc -= ZTree.base_length[code]; + send_bits(lc, extra); // send the extra length bits + } + dist--; // dist is now the match distance - 1 + code = ZTree.d_code(dist); + + send_code(code, dtree); // send the distance code + extra = ZTree.extra_dbits[code]; + if (extra != 0) { + dist -= ZTree.base_dist[code]; + send_bits(dist, extra); // send the extra distance bits + } + } // literal or match pair ? + + // Check that the overlay between pending_buf and d_buf+l_buf is ok: + } + while (lx < last_lit); + } + + send_code(END_BLOCK, ltree); + last_eob_len = ltree[END_BLOCK*2+1]; + } + + // Set the data type to ASCII or BINARY, using a crude approximation: + // binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. + // IN assertion: the fields freq of dyn_ltree are set and the total of all + // frequencies does not exceed 64K (to fit in an int on 16 bit machines). + internal void set_data_type(){ + int n = 0; + int ascii_freq = 0; + int bin_freq = 0; + while(n<7){ bin_freq += dyn_ltree[n*2]; n++;} + while(n<128){ ascii_freq += dyn_ltree[n*2]; n++;} + while(n (ascii_freq >> 2) ? Z_BINARY : Z_ASCII); + } + + // Flush the bit buffer, keeping at most 7 bits in it. + internal void bi_flush(){ + if (bi_valid == 16) { + pending_buf[pending++]=(byte)(bi_buf/*&0xff*/); + pending_buf[pending++]=(byte)(bi_buf>>8); + bi_buf=0; + bi_valid=0; + } + else if (bi_valid >= 8) { + pending_buf[pending++]=(byte)(bi_buf); + bi_buf>>=8; + bi_buf &= 0x00ff; + bi_valid-=8; + } + } + + // Flush the bit buffer and align the output on a byte boundary + internal void bi_windup(){ + if (bi_valid > 8) { + pending_buf[pending++]=(byte)(bi_buf); + pending_buf[pending++]=(byte)(bi_buf>>8); + } else if (bi_valid > 0) { + pending_buf[pending++]=(byte)(bi_buf); + } + bi_buf = 0; + bi_valid = 0; + } + + // Copy a stored block, storing first the length and its + // one's complement if requested. + internal void copy_block(int buf, // the input data + int len, // its length + bool header // true if block header must be written + ){ + //int index=0; + bi_windup(); // align on byte boundary + last_eob_len = 8; // enough lookahead for inflate + + if (header) { + put_short((short)len); + put_short((short)~len); + } + + // while(len--!=0) { + // put_byte(window[buf+index]); + // index++; + // } + put_byte(window, buf, len); + } + + internal void flush_block_only(bool eof){ + _tr_flush_block(block_start>=0 ? block_start : -1, + strstart-block_start, + eof); + block_start=strstart; + strm.flush_pending(); + } + + // Copy without compression as much as possible from the input stream, return + // the current block state. + // This function does not insert new strings in the dictionary since + // uncompressible data is probably not useful. This function is used + // only for the level=0 compression option. + // NOTE: this function should be optimized to avoid extra copying from + // window to pending_buf. + internal int deflate_stored(int flush){ + // Stored blocks are limited to 0xffff bytes, pending_buf is limited + // to pending_buf_size, and each stored block has a 5 byte header: + + int max_block_size = 0xffff; + int max_start; + + if(max_block_size > pending_buf_size - 5) { + max_block_size = pending_buf_size - 5; + } + + // Copy as much as possible from input to output: + while(true){ + // Fill the window as much as possible: + if(lookahead<=1){ + fill_window(); + if(lookahead==0 && flush==Z_NO_FLUSH) return NeedMore; + if(lookahead==0) break; // flush the current block + } + + strstart+=lookahead; + lookahead=0; + + // Emit a stored block if pending_buf will be full: + max_start=block_start+max_block_size; + if(strstart==0|| strstart>=max_start) { + // strstart == 0 is possible when wraparound on 16-bit machine + lookahead = (int)(strstart-max_start); + strstart = (int)max_start; + + flush_block_only(false); + if(strm.avail_out==0) return NeedMore; + + } + + // Flush if we may have to slide, otherwise block_start may become + // negative and the data will be gone: + if(strstart-block_start >= w_size-MIN_LOOKAHEAD) { + flush_block_only(false); + if(strm.avail_out==0) return NeedMore; + } + } + + flush_block_only(flush == Z_FINISH); + if(strm.avail_out==0) + return (flush == Z_FINISH) ? FinishStarted : NeedMore; + + return flush == Z_FINISH ? FinishDone : BlockDone; + } + + // Send a stored block + internal void _tr_stored_block(int buf, // input block + int stored_len, // length of input block + bool eof // true if this is the last block for a file + ){ + send_bits((STORED_BLOCK<<1)+(eof?1:0), 3); // send block type + copy_block(buf, stored_len, true); // with header + } + + // Determine the best encoding for the current block: dynamic trees, static + // trees or store, and output the encoded block to the zip file. + internal void _tr_flush_block(int buf, // input block, or NULL if too old + int stored_len, // length of input block + bool eof // true if this is the last block for a file + ) { + int opt_lenb, static_lenb;// opt_len and static_len in bytes + int max_blindex = 0; // index of last bit length code of non zero freq + + // Build the Huffman trees unless a stored block is forced + if(level > 0) { + // Check if the file is ascii or binary + if(data_type == Z_UNKNOWN) set_data_type(); + + // Construct the literal and distance trees + l_desc.build_tree(this); + + d_desc.build_tree(this); + + // At this point, opt_len and static_len are the total bit lengths of + // the compressed block data, excluding the tree representations. + + // Build the bit length tree for the above two trees, and get the index + // in bl_order of the last bit length code to send. + max_blindex=build_bl_tree(); + + // Determine the best encoding. Compute first the block length in bytes + opt_lenb=(opt_len+3+7)>>3; + static_lenb=(static_len+3+7)>>3; + + if(static_lenb<=opt_lenb) opt_lenb=static_lenb; + } + else { + opt_lenb=static_lenb=stored_len+5; // force a stored block + } + + if(stored_len+4<=opt_lenb && buf != -1){ + // 4: two words for the lengths + // The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + // Otherwise we can't have processed more than WSIZE input bytes since + // the last block flush, because compression would have been + // successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + // transform a block into a stored block. + _tr_stored_block(buf, stored_len, eof); + } + else if(static_lenb == opt_lenb){ + send_bits((STATIC_TREES<<1)+(eof?1:0), 3); + compress_block(StaticTree.static_ltree, StaticTree.static_dtree); + } + else{ + send_bits((DYN_TREES<<1)+(eof?1:0), 3); + send_all_trees(l_desc.max_code+1, d_desc.max_code+1, max_blindex+1); + compress_block(dyn_ltree, dyn_dtree); + } + + // The above check is made mod 2^32, for files larger than 512 MB + // and uLong implemented on 32 bits. + + init_block(); + + if(eof){ + bi_windup(); + } + } + + // Fill the window when the lookahead becomes insufficient. + // Updates strstart and lookahead. + // + // IN assertion: lookahead < MIN_LOOKAHEAD + // OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + // At least one byte has been read, or avail_in == 0; reads are + // performed for at least two bytes (required for the zip translate_eol + // option -- not supported here). + internal void fill_window(){ + int n, m; + int p; + int more; // Amount of free space at the end of the window. + + do{ + more = (window_size-lookahead-strstart); + + // Deal with !@#$% 64K limit: + if(more==0 && strstart==0 && lookahead==0){ + more = w_size; + } + else if(more==-1) { + // Very unlikely, but possible on 16 bit machine if strstart == 0 + // and lookahead == 1 (input done one byte at time) + more--; + + // If the window is almost full and there is insufficient lookahead, + // move the upper half to the lower one to make room in the upper half. + } + else if(strstart >= w_size+ w_size-MIN_LOOKAHEAD) { + System.Array.Copy(window, w_size, window, 0, w_size); + match_start-=w_size; + strstart-=w_size; // we now have strstart >= MAX_DIST + block_start-=w_size; + + // Slide the hash table (could be avoided with 32 bit values + // at the expense of memory usage). We slide even when level == 0 + // to keep the hash table consistent if we switch back to level > 0 + // later. (Using level 0 permanently is not an optimal usage of + // zlib, so we don't care about this pathological case.) + + n = hash_size; + p=n; + do { + m = (head[--p]&0xffff); + head[p]=(short)(m>=w_size ? (m-w_size) : 0); + } + while (--n != 0); + + n = w_size; + p = n; + do { + m = (prev[--p]&0xffff); + prev[p] = (short)(m >= w_size ? (m-w_size) : 0); + // If n is not on any hash chain, prev[n] is garbage but + // its value will never be used. + } + while (--n!=0); + more += w_size; + } + + if (strm.avail_in == 0) return; + + // If there was no sliding: + // strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + // more == window_size - lookahead - strstart + // => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + // => more >= window_size - 2*WSIZE + 2 + // In the BIG_MEM or MMAP case (not yet supported), + // window_size == input_size + MIN_LOOKAHEAD && + // strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + // Otherwise, window_size == 2*WSIZE so more >= 2. + // If there was sliding, more >= WSIZE. So in all cases, more >= 2. + + n = strm.read_buf(window, strstart + lookahead, more); + lookahead += n; + + // Initialize the hash value now that we have some input: + if(lookahead >= MIN_MATCH) { + ins_h = window[strstart]&0xff; + ins_h=(((ins_h)<= MIN_MATCH){ + ins_h=(((ins_h)<=MIN_MATCH){ + // check_match(strstart, match_start, match_length); + + bflush=_tr_tally(strstart-match_start, match_length-MIN_MATCH); + + lookahead -= match_length; + + // Insert new strings in the hash table only if the match length + // is not too large. This saves time but degrades compression. + if(match_length <= max_lazy_match && + lookahead >= MIN_MATCH) { + match_length--; // string at strstart already in hash table + do{ + strstart++; + + ins_h=((ins_h<= MIN_MATCH) { + ins_h=(((ins_h)< 4096))) { + + // If prev_match is also MIN_MATCH, match_start is garbage + // but we will ignore the current match anyway. + match_length = MIN_MATCH-1; + } + } + + // If there was a match at the previous step and the current + // match is not better, output the previous match: + if(prev_length >= MIN_MATCH && match_length <= prev_length) { + int max_insert = strstart + lookahead - MIN_MATCH; + // Do not insert strings in hash table beyond this. + + // check_match(strstart-1, prev_match, prev_length); + + bflush=_tr_tally(strstart-1-prev_match, prev_length - MIN_MATCH); + + // Insert in hash table all strings up to the end of the match. + // strstart-1 and strstart are already inserted. If there is not + // enough lookahead, the last two strings are not inserted in + // the hash table. + lookahead -= prev_length-1; + prev_length -= 2; + do{ + if(++strstart <= max_insert) { + ins_h=(((ins_h)<(w_size-MIN_LOOKAHEAD) ? + strstart-(w_size-MIN_LOOKAHEAD) : 0; + int nice_match=this.nice_match; + + // Stop when cur_match becomes <= limit. To simplify the code, + // we prevent matches with the string of window index 0. + + int wmask = w_mask; + + int strend = strstart + MAX_MATCH; + byte scan_end1 = window[scan+best_len-1]; + byte scan_end = window[scan+best_len]; + + // The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + // It is easy to get rid of this optimization if necessary. + + // Do not waste too much time if we already have a good match: + if (prev_length >= good_match) { + chain_length >>= 2; + } + + // Do not look for matches beyond the end of the input. This is necessary + // to make deflate deterministic. + if (nice_match > lookahead) nice_match = lookahead; + + do { + match = cur_match; + + // Skip to next match if the match length cannot increase + // or if the match length is less than 2: + if (window[match+best_len] != scan_end || + window[match+best_len-1] != scan_end1 || + window[match] != window[scan] || + window[++match] != window[scan+1]) continue; + + // The check at best_len-1 can be removed because it will be made + // again later. (This heuristic is not always a win.) + // It is not necessary to compare scan[2] and match[2] since they + // are always equal when the other bytes match, given that + // the hash keys are equal and that HASH_BITS >= 8. + scan += 2; match++; + + // We check for insufficient lookahead only every 8th comparison; + // the 256th check will be made at strstart+258. + do { + } while (window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + scan < strend); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + + if(len>best_len) { + match_start = cur_match; + best_len = len; + if (len >= nice_match) break; + scan_end1 = window[scan+best_len-1]; + scan_end = window[scan+best_len]; + } + + } while ((cur_match = (prev[cur_match & wmask]&0xffff)) > limit + && --chain_length != 0); + + if (best_len <= lookahead) return best_len; + return lookahead; + } + + internal int deflateInit(ZStream strm, int level, int bits){ + return deflateInit2(strm, level, Z_DEFLATED, bits, DEF_MEM_LEVEL, + Z_DEFAULT_STRATEGY); + } + internal int deflateInit(ZStream strm, int level){ + return deflateInit(strm, level, MAX_WBITS); + } + internal int deflateInit2(ZStream strm, int level, int method, int windowBits, + int memLevel, int strategy){ + int noheader = 0; + // byte[] my_version=ZLIB_VERSION; + + // + // if (version == null || version[0] != my_version[0] + // || stream_size != sizeof(z_stream)) { + // return Z_VERSION_ERROR; + // } + + strm.msg = null; + + if (level == Z_DEFAULT_COMPRESSION) level = 6; + + if (windowBits < 0) { // undocumented feature: suppress zlib header + noheader = 1; + windowBits = -windowBits; + } + + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || + method != Z_DEFLATED || + windowBits < 9 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_HUFFMAN_ONLY) { + return Z_STREAM_ERROR; + } + + strm.dstate = (Deflate)this; + + this.noheader = noheader; + w_bits = windowBits; + w_size = 1 << w_bits; + w_mask = w_size - 1; + + hash_bits = memLevel + 7; + hash_size = 1 << hash_bits; + hash_mask = hash_size - 1; + hash_shift = ((hash_bits+MIN_MATCH-1)/MIN_MATCH); + + window = new byte[w_size*2]; + prev = new short[w_size]; + head = new short[hash_size]; + + lit_bufsize = 1 << (memLevel + 6); // 16K elements by default + + // We overlay pending_buf and d_buf+l_buf. This works since the average + // output size for (length,distance) codes is <= 24 bits. + pending_buf = new byte[lit_bufsize*4]; + pending_buf_size = lit_bufsize*4; + + d_buf = lit_bufsize/2; + l_buf = (1+2)*lit_bufsize; + + this.level = level; + + //System.out.println("level="+level); + + this.strategy = strategy; + this.method = (byte)method; + + return deflateReset(strm); + } + + internal int deflateReset(ZStream strm){ + strm.total_in = strm.total_out = 0; + strm.msg = null; // + strm.data_type = Z_UNKNOWN; + + pending = 0; + pending_out = 0; + + if(noheader < 0) { + noheader = 0; // was set to -1 by deflate(..., Z_FINISH); + } + status = (noheader!=0) ? BUSY_STATE : INIT_STATE; + strm.adler=strm._adler.adler32(0, null, 0, 0); + + last_flush = Z_NO_FLUSH; + + tr_init(); + lm_init(); + return Z_OK; + } + + internal int deflateEnd(){ + if(status!=INIT_STATE && status!=BUSY_STATE && status!=FINISH_STATE){ + return Z_STREAM_ERROR; + } + // Deallocate in reverse order of allocations: + pending_buf=null; + head=null; + prev=null; + window=null; + // free + // dstate=null; + return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; + } + + internal int deflateParams(ZStream strm, int _level, int _strategy){ + int err=Z_OK; + + if(_level == Z_DEFAULT_COMPRESSION){ + _level = 6; + } + if(_level < 0 || _level > 9 || + _strategy < 0 || _strategy > Z_HUFFMAN_ONLY) { + return Z_STREAM_ERROR; + } + + if(config_table[level].func!=config_table[_level].func && + strm.total_in != 0) { + // Flush the last buffer: + err = strm.deflate(Z_PARTIAL_FLUSH); + } + + if(level != _level) { + level = _level; + max_lazy_match = config_table[level].max_lazy; + good_match = config_table[level].good_length; + nice_match = config_table[level].nice_length; + max_chain_length = config_table[level].max_chain; + } + strategy = _strategy; + return err; + } + + internal int deflateSetDictionary (ZStream strm, byte[] dictionary, int dictLength){ + int length = dictLength; + int index=0; + + if(dictionary == null || status != INIT_STATE) + return Z_STREAM_ERROR; + + strm.adler=strm._adler.adler32(strm.adler, dictionary, 0, dictLength); + + if(length < MIN_MATCH) return Z_OK; + if(length > w_size-MIN_LOOKAHEAD){ + length = w_size-MIN_LOOKAHEAD; + index=dictLength-length; // use the tail of the dictionary + } + System.Array.Copy(dictionary, index, window, 0, length); + strstart = length; + block_start = length; + + // Insert all strings in the hash table (except for the last two bytes). + // s->lookahead stays null, so s->ins_h will be recomputed at the next + // call of fill_window. + + ins_h = window[0]&0xff; + ins_h=(((ins_h)<Z_FINISH || flush<0){ + return Z_STREAM_ERROR; + } + + if(strm.next_out == null || + (strm.next_in == null && strm.avail_in != 0) || + (status == FINISH_STATE && flush != Z_FINISH)) { + strm.msg=z_errmsg[Z_NEED_DICT-(Z_STREAM_ERROR)]; + return Z_STREAM_ERROR; + } + if(strm.avail_out == 0){ + strm.msg=z_errmsg[Z_NEED_DICT-(Z_BUF_ERROR)]; + return Z_BUF_ERROR; + } + + this.strm = strm; // just in case + old_flush = last_flush; + last_flush = flush; + + // Write the zlib header + if(status == INIT_STATE) { + int header = (Z_DEFLATED+((w_bits-8)<<4))<<8; + int level_flags=((level-1)&0xff)>>1; + + if(level_flags>3) level_flags=3; + header |= (level_flags<<6); + if(strstart!=0) header |= PRESET_DICT; + header+=31-(header % 31); + + status=BUSY_STATE; + putShortMSB(header); + + + // Save the adler32 of the preset dictionary: + if(strstart!=0){ + putShortMSB((int)(strm.adler>>16)); + putShortMSB((int)(strm.adler&0xffff)); + } + strm.adler=strm._adler.adler32(0, null, 0, 0); + } + + // Flush as much pending output as possible + if(pending != 0) { + strm.flush_pending(); + if(strm.avail_out == 0) { + //System.out.println(" avail_out==0"); + // Since avail_out is 0, deflate will be called again with + // more output space, but possibly with both pending and + // avail_in equal to zero. There won't be anything to do, + // but this is not an error situation so make sure we + // return OK instead of BUF_ERROR at next call of deflate: + last_flush = -1; + return Z_OK; + } + + // Make sure there is something to do and avoid duplicate consecutive + // flushes. For repeated and useless calls with Z_FINISH, we keep + // returning Z_STREAM_END instead of Z_BUFF_ERROR. + } + else if(strm.avail_in==0 && flush <= old_flush && + flush != Z_FINISH) { + strm.msg=z_errmsg[Z_NEED_DICT-(Z_BUF_ERROR)]; + return Z_BUF_ERROR; + } + + // User must not provide more input after the first FINISH: + if(status == FINISH_STATE && strm.avail_in != 0) { + strm.msg=z_errmsg[Z_NEED_DICT-(Z_BUF_ERROR)]; + return Z_BUF_ERROR; + } + + // Start a new block or continue the current one. + if(strm.avail_in!=0 || lookahead!=0 || + (flush != Z_NO_FLUSH && status != FINISH_STATE)) { + int bstate=-1; + switch(config_table[level].func){ + case STORED: + bstate = deflate_stored(flush); + break; + case FAST: + bstate = deflate_fast(flush); + break; + case SLOW: + bstate = deflate_slow(flush); + break; + default: + break; + } + + if (bstate==FinishStarted || bstate==FinishDone) { + status = FINISH_STATE; + } + if (bstate==NeedMore || bstate==FinishStarted) { + if(strm.avail_out == 0) { + last_flush = -1; // avoid BUF_ERROR next call, see above + } + return Z_OK; + // If flush != Z_NO_FLUSH && avail_out == 0, the next call + // of deflate should use the same flush parameter to make sure + // that the flush is complete. So we don't have to output an + // empty block here, this will be done at next call. This also + // ensures that for a very small output buffer, we emit at most + // one empty block. + } + + if (bstate==BlockDone) { + if(flush == Z_PARTIAL_FLUSH) { + _tr_align(); + } + else { // FULL_FLUSH or SYNC_FLUSH + _tr_stored_block(0, 0, false); + // For a full flush, this empty block will be recognized + // as a special marker by inflate_sync(). + if(flush == Z_FULL_FLUSH) { + //state.head[s.hash_size-1]=0; + for(int i=0; i>16)); + putShortMSB((int)(strm.adler&0xffff)); + strm.flush_pending(); + + // If avail_out is zero, the application will call deflate again + // to flush the rest. + noheader = -1; // write the trailer only once! + return pending != 0 ? Z_OK : Z_STREAM_END; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Deflate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Deflate.cs.meta new file mode 100644 index 00000000..57f333d0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/Deflate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d29c091390e4c924b9c9cd53bc19b4e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfBlocks.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfBlocks.cs new file mode 100644 index 00000000..e8de2035 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfBlocks.cs @@ -0,0 +1,622 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +/* + * $Id: InfBlocks.cs,v 1.2 2008-05-10 09:35:40 bouncy Exp $ + * +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib { + + internal sealed class InfBlocks{ + private const int MANY=1440; + + // And'ing with mask[n] masks the lower n bits + private static readonly int[] inflate_mask = { + 0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, + 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, + 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, + 0x00007fff, 0x0000ffff + }; + + // Table for deflate from PKZIP's appnote.txt. + static readonly int[] border = { // Order of the bit length code lengths + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 + }; + + private const int Z_OK=0; + private const int Z_STREAM_END=1; + private const int Z_NEED_DICT=2; + private const int Z_ERRNO=-1; + private const int Z_STREAM_ERROR=-2; + private const int Z_DATA_ERROR=-3; + private const int Z_MEM_ERROR=-4; + private const int Z_BUF_ERROR=-5; + private const int Z_VERSION_ERROR=-6; + + private const int TYPE=0; // get type bits (3, including end bit) + private const int LENS=1; // get lengths for stored + private const int STORED=2;// processing stored block + private const int TABLE=3; // get table lengths + private const int BTREE=4; // get bit lengths tree for a dynamic block + private const int DTREE=5; // get length, distance trees for a dynamic block + private const int CODES=6; // processing fixed or dynamic block + private const int DRY=7; // output remaining window bytes + private const int DONE=8; // finished last block, done + private const int BAD=9; // ot a data error--stuck here + + internal int mode; // current inflate_block mode + + internal int left; // if STORED, bytes left to copy + + internal int table; // table lengths (14 bits) + internal int index; // index into blens (or border) + internal int[] blens; // bit lengths of codes + internal int[] bb=new int[1]; // bit length tree depth + internal int[] tb=new int[1]; // bit length decoding tree + + internal InfCodes codes=new InfCodes(); // if CODES, current state + + int last; // true if this block is the last block + + // mode independent information + internal int bitk; // bits in bit buffer + internal int bitb; // bit buffer + internal int[] hufts; // single malloc for tree space + internal byte[] window; // sliding window + internal int end; // one byte after sliding window + internal int read; // window read pointer + internal int write; // window write pointer + internal Object checkfn; // check function + internal long check; // check on output + + internal InfTree inftree=new InfTree(); + + internal InfBlocks(ZStream z, Object checkfn, int w){ + hufts=new int[MANY*3]; + window=new byte[w]; + end=w; + this.checkfn = checkfn; + mode = TYPE; + reset(z, null); + } + + internal void reset(ZStream z, long[] c){ + if(c!=null) c[0]=check; + if(mode==BTREE || mode==DTREE){ + } + if(mode==CODES){ + codes.free(z); + } + mode=TYPE; + bitk=0; + bitb=0; + read=write=0; + + if(checkfn != null) + z.adler=check=z._adler.adler32(0L, null, 0, 0); + } + + internal int proc(ZStream z, int r){ + int t; // temporary storage + int b; // bit buffer + int k; // bits in bit buffer + int p; // input data pointer + int n; // bytes available there + int q; // output window write pointer + int m; { // bytes to end of window or read pointer + + // copy input/output information to locals (UPDATE macro restores) + p=z.next_in_index;n=z.avail_in;b=bitb;k=bitk;} { + q=write;m=(int)(q> 1){ + case 0: { // stored + b>>=(3);k-=(3);} + t = k & 7; { // go to byte boundary + + b>>=(t);k-=(t);} + mode = LENS; // get length of stored block + break; + case 1: { // fixed + int[] bl=new int[1]; + int[] bd=new int[1]; + int[][] tl=new int[1][]; + int[][] td=new int[1][]; + + InfTree.inflate_trees_fixed(bl, bd, tl, td, z); + codes.init(bl[0], bd[0], tl[0], 0, td[0], 0, z); + } { + + b>>=(3);k-=(3);} + + mode = CODES; + break; + case 2: { // dynamic + + b>>=(3);k-=(3);} + + mode = TABLE; + break; + case 3: { // illegal + + b>>=(3);k-=(3);} + mode = BAD; + z.msg = "invalid block type"; + r = Z_DATA_ERROR; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + break; + case LENS: + + while(k<(32)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)<> 16) & 0xffff) != (b & 0xffff)){ + mode = BAD; + z.msg = "invalid stored block lengths"; + r = Z_DATA_ERROR; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + left = (b & 0xffff); + b = k = 0; // dump bits + mode = left!=0 ? STORED : (last!=0 ? DRY : TYPE); + break; + case STORED: + if (n == 0){ + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + + if(m==0){ + if(q==end&&read!=0){ + q=0; m=(int)(qn) t = n; + if(t>m) t = m; + System.Array.Copy(z.next_in, p, window, q, t); + p += t; n -= t; + q += t; m -= t; + if ((left -= t) != 0) + break; + mode = last!=0 ? DRY : TYPE; + break; + case TABLE: + + while(k<(14)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)< 29 || ((t >> 5) & 0x1f) > 29) { + mode = BAD; + z.msg = "too many length or distance symbols"; + r = Z_DATA_ERROR; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); + if(blens==null || blens.Length>=(14);k-=(14);} + + index = 0; + mode = BTREE; + goto case BTREE; + case BTREE: + while (index < 4 + (table >> 10)){ + while(k<(3)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)<>=(3);k-=(3);} + } + + while(index < 19){ + blens[border[index++]] = 0; + } + + bb[0] = 7; + t = inftree.inflate_trees_bits(blens, bb, tb, hufts, z); + if (t != Z_OK){ + r = t; + if (r == Z_DATA_ERROR){ + blens=null; + mode = BAD; + } + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + + index = 0; + mode = DTREE; + goto case DTREE; + case DTREE: + while (true){ + t = table; + if(!(index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))){ + break; + } + + int i, j, c; + + t = bb[0]; + + while(k<(t)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)<>=(t);k-=(t); + blens[index++] = c; + } + else { // c == 16..18 + i = c == 18 ? 7 : c - 14; + j = c == 18 ? 11 : 3; + + while(k<(t+i)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)<>=(t);k-=(t); + + j += (b & inflate_mask[i]); + + b>>=(i);k-=(i); + + i = index; + t = table; + if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || + (c == 16 && i < 1)){ + blens=null; + mode = BAD; + z.msg = "invalid bit length repeat"; + r = Z_DATA_ERROR; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + + c = c == 16 ? blens[i-1] : 0; + do{ + blens[i++] = c; + } + while (--j!=0); + index = i; + } + } + + tb[0]=-1; { + int[] bl=new int[1]; + int[] bd=new int[1]; + int[] tl=new int[1]; + int[] td=new int[1]; + bl[0] = 9; // must be <= 9 for lookahead assumptions + bd[0] = 6; // must be <= 9 for lookahead assumptions + + t = table; + t = inftree.inflate_trees_dynamic(257 + (t & 0x1f), + 1 + ((t >> 5) & 0x1f), + blens, bl, bd, tl, td, hufts, z); + + if (t != Z_OK){ + if (t == Z_DATA_ERROR){ + blens=null; + mode = BAD; + } + r = t; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + codes.init(bl[0], bd[0], hufts, tl[0], hufts, td[0], z); + } + mode = CODES; + goto case CODES; + case CODES: + bitb=b; bitk=k; + z.avail_in=n; z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + + if ((r = codes.proc(this, z, r)) != Z_STREAM_END){ + return inflate_flush(z, r); + } + r = Z_OK; + codes.free(z); + + p=z.next_in_index; n=z.avail_in;b=bitb;k=bitk; + q=write;m=(int)(q z.avail_out) n = z.avail_out; + if (n!=0 && r == Z_BUF_ERROR) r = Z_OK; + + // update counters + z.avail_out -= n; + z.total_out += n; + + // update check information + if(checkfn != null) + z.adler=check=z._adler.adler32(check, window, q, n); + + // copy as far as end of window + System.Array.Copy(window, q, z.next_out, p, n); + p += n; + q += n; + + // see if more to copy at beginning of window + if (q == end){ + // wrap pointers + q = 0; + if (write == end) + write = 0; + + // compute bytes to copy + n = write - q; + if (n > z.avail_out) n = z.avail_out; + if (n!=0 && r == Z_BUF_ERROR) r = Z_OK; + + // update counters + z.avail_out -= n; + z.total_out += n; + + // update check information + if(checkfn != null) + z.adler=check=z._adler.adler32(check, window, q, n); + + // copy + System.Array.Copy(window, q, z.next_out, p, n); + p += n; + q += n; + } + + // update pointers + z.next_out_index = p; + read = q; + + // done + return r; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfBlocks.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfBlocks.cs.meta new file mode 100644 index 00000000..06e5644c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfBlocks.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 39991dab49f0a85419083ecf2f53dc90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfCodes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfCodes.cs new file mode 100644 index 00000000..2cedae17 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfCodes.cs @@ -0,0 +1,615 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +/* + * $Id: InfCodes.cs,v 1.2 2008-05-10 09:35:40 bouncy Exp $ + * +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib { + + internal sealed class InfCodes{ + + private static readonly int[] inflate_mask = { + 0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, + 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, + 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, + 0x00007fff, 0x0000ffff + }; + + private const int Z_OK=0; + private const int Z_STREAM_END=1; + private const int Z_NEED_DICT=2; + private const int Z_ERRNO=-1; + private const int Z_STREAM_ERROR=-2; + private const int Z_DATA_ERROR=-3; + private const int Z_MEM_ERROR=-4; + private const int Z_BUF_ERROR=-5; + private const int Z_VERSION_ERROR=-6; + + // waiting for "i:"=input, + // "o:"=output, + // "x:"=nothing + private const int START=0; // x: set up for LEN + private const int LEN=1; // i: get length/literal/eob next + private const int LENEXT=2; // i: getting length extra (have base) + private const int DIST=3; // i: get distance next + private const int DISTEXT=4;// i: getting distance extra + private const int COPY=5; // o: copying bytes in window, waiting for space + private const int LIT=6; // o: got literal, waiting for output space + private const int WASH=7; // o: got eob, possibly still output waiting + private const int END=8; // x: got eob and all data flushed + private const int BADCODE=9;// x: got error + + int mode; // current inflate_codes mode + + // mode dependent information + int len; + + int[] tree; // pointer into tree + int tree_index=0; + int need; // bits needed + + int lit; + + // if EXT or COPY, where and how much + int get; // bits to get for extra + int dist; // distance back to copy from + + byte lbits; // ltree bits decoded per branch + byte dbits; // dtree bits decoder per branch + int[] ltree; // literal/length/eob tree + int ltree_index; // literal/length/eob tree + int[] dtree; // distance tree + int dtree_index; // distance tree + + internal InfCodes(){ + } + internal void init(int bl, int bd, + int[] tl, int tl_index, + int[] td, int td_index, ZStream z){ + mode=START; + lbits=(byte)bl; + dbits=(byte)bd; + ltree=tl; + ltree_index=tl_index; + dtree = td; + dtree_index=td_index; + tree=null; + } + + internal int proc(InfBlocks s, ZStream z, int r){ + int j; // temporary storage + int tindex; // temporary pointer + int e; // extra bits or operation + int b=0; // bit buffer + int k=0; // bits in bit buffer + int p=0; // input data pointer + int n; // bytes available there + int q; // output window write pointer + int m; // bytes to end of window or read pointer + int f; // pointer to copy strings from + + // copy input/output information to locals (UPDATE macro restores) + p=z.next_in_index;n=z.avail_in;b=s.bitb;k=s.bitk; + q=s.write;m=q= 258 && n >= 10){ + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + r = inflate_fast(lbits, dbits, + ltree, ltree_index, + dtree, dtree_index, + s, z); + + p=z.next_in_index;n=z.avail_in;b=s.bitb;k=s.bitk; + q=s.write;m=q>=(tree[tindex+1]); + k-=(tree[tindex+1]); + + e=tree[tindex]; + + if(e == 0){ // literal + lit = tree[tindex+2]; + mode = LIT; + break; + } + if((e & 16)!=0 ){ // length + get = e & 15; + len = tree[tindex+2]; + mode = LENEXT; + break; + } + if ((e & 64) == 0){ // next table + need = e; + tree_index = tindex/3+tree[tindex+2]; + break; + } + if ((e & 32)!=0){ // end of block + mode = WASH; + break; + } + mode = BADCODE; // invalid code + z.msg = "invalid literal/length code"; + r = Z_DATA_ERROR; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + + case LENEXT: // i: getting length extra (have base) + j = get; + + while(k<(j)){ + if(n!=0)r=Z_OK; + else{ + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + } + n--; b|=(z.next_in[p++]&0xff)<>=j; + k-=j; + + need = dbits; + tree = dtree; + tree_index=dtree_index; + mode = DIST; + goto case DIST; + case DIST: // i: get distance next + j = need; + + while(k<(j)){ + if(n!=0)r=Z_OK; + else{ + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + } + n--; b|=(z.next_in[p++]&0xff)<>=tree[tindex+1]; + k-=tree[tindex+1]; + + e = (tree[tindex]); + if((e & 16)!=0){ // distance + get = e & 15; + dist = tree[tindex+2]; + mode = DISTEXT; + break; + } + if ((e & 64) == 0){ // next table + need = e; + tree_index = tindex/3 + tree[tindex+2]; + break; + } + mode = BADCODE; // invalid code + z.msg = "invalid distance code"; + r = Z_DATA_ERROR; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + + case DISTEXT: // i: getting distance extra + j = get; + + while(k<(j)){ + if(n!=0)r=Z_OK; + else{ + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + } + n--; b|=(z.next_in[p++]&0xff)<>=j; + k-=j; + + mode = COPY; + goto case COPY; + case COPY: // o: copying bytes in window, waiting for space + f = q - dist; + while(f < 0){ // modulo window size-"while" instead + f += s.end; // of "if" handles invalid distances + } + while (len!=0){ + + if(m==0){ + if(q==s.end&&s.read!=0){q=0;m=q 7){ // return unused byte, if any + k -= 8; + n++; + p--; // can always return one + } + + s.write=q; r=s.inflate_flush(z,r); + q=s.write;m=q= 258 && n >= 10 + // get literal/length code + while(k<(20)){ // max bits for literal/length code + n--; + b|=(z.next_in[p++]&0xff)<>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]); + + s.window[q++] = (byte)tp[tp_index_t_3+2]; + m--; + continue; + } + do { + + b>>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]); + + if((e&16)!=0){ + e &= 15; + c = tp[tp_index_t_3+2] + ((int)b & inflate_mask[e]); + + b>>=e; k-=e; + + // decode distance base of block to copy + while(k<(15)){ // max bits for distance code + n--; + b|=(z.next_in[p++]&0xff)<>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]); + + if((e&16)!=0){ + // get extra bits to add to distance base + e &= 15; + while(k<(e)){ // get extra bits (up to 13) + n--; + b|=(z.next_in[p++]&0xff)<>=(e); k-=(e); + + // do the copy + m -= c; + if (q >= d){ // offset before dest + // just copy + r=q-d; + if(q-r>0 && 2>(q-r)){ + s.window[q++]=s.window[r++]; // minimum count is three, + s.window[q++]=s.window[r++]; // so unroll loop a little + c-=2; + } + else{ + System.Array.Copy(s.window, r, s.window, q, 2); + q+=2; r+=2; c-=2; + } + } + else{ // else offset after destination + r=q-d; + do{ + r+=s.end; // force pointer in window + }while(r<0); // covers invalid distances + e=s.end-r; + if(c>e){ // if source crosses, + c-=e; // wrapped copy + if(q-r>0 && e>(q-r)){ + do{s.window[q++] = s.window[r++];} + while(--e!=0); + } + else{ + System.Array.Copy(s.window, r, s.window, q, e); + q+=e; r+=e; e=0; + } + r = 0; // copy rest from start of window + } + + } + + // copy all or what's left + if(q-r>0 && c>(q-r)){ + do{s.window[q++] = s.window[r++];} + while(--c!=0); + } + else{ + System.Array.Copy(s.window, r, s.window, q, c); + q+=c; r+=c; c=0; + } + break; + } + else if((e&64)==0){ + t+=tp[tp_index_t_3+2]; + t+=(b&inflate_mask[e]); + tp_index_t_3=(tp_index+t)*3; + e=tp[tp_index_t_3]; + } + else{ + z.msg = "invalid distance code"; + + c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + + return Z_DATA_ERROR; + } + } + while(true); + break; + } + + if((e&64)==0){ + t+=tp[tp_index_t_3+2]; + t+=(b&inflate_mask[e]); + tp_index_t_3=(tp_index+t)*3; + if((e=tp[tp_index_t_3])==0){ + + b>>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]); + + s.window[q++]=(byte)tp[tp_index_t_3+2]; + m--; + break; + } + } + else if((e&32)!=0){ + + c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + + return Z_STREAM_END; + } + else{ + z.msg="invalid literal/length code"; + + c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + + return Z_DATA_ERROR; + } + } + while(true); + } + while(m>=258 && n>= 10); + + // not enough input or output--restore pointers and return + c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + + return Z_OK; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfCodes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfCodes.cs.meta new file mode 100644 index 00000000..be5b50c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfCodes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5900c7f6a2d2b704596f30b1ff8334c8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfTree.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfTree.cs new file mode 100644 index 00000000..68c3e39b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/InfTree.cs @@ -0,0 +1,527 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +/* + * $Id: InfTree.cs,v 1.2 2008-05-10 09:35:40 bouncy Exp $ + * +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib { + + internal sealed class InfTree{ + + private const int MANY=1440; + + private const int Z_OK=0; + private const int Z_STREAM_END=1; + private const int Z_NEED_DICT=2; + private const int Z_ERRNO=-1; + private const int Z_STREAM_ERROR=-2; + private const int Z_DATA_ERROR=-3; + private const int Z_MEM_ERROR=-4; + private const int Z_BUF_ERROR=-5; + private const int Z_VERSION_ERROR=-6; + + private const int fixed_bl = 9; + private const int fixed_bd = 5; + + static readonly int[] fixed_tl = { + 96,7,256, 0,8,80, 0,8,16, 84,8,115, + 82,7,31, 0,8,112, 0,8,48, 0,9,192, + 80,7,10, 0,8,96, 0,8,32, 0,9,160, + 0,8,0, 0,8,128, 0,8,64, 0,9,224, + 80,7,6, 0,8,88, 0,8,24, 0,9,144, + 83,7,59, 0,8,120, 0,8,56, 0,9,208, + 81,7,17, 0,8,104, 0,8,40, 0,9,176, + 0,8,8, 0,8,136, 0,8,72, 0,9,240, + 80,7,4, 0,8,84, 0,8,20, 85,8,227, + 83,7,43, 0,8,116, 0,8,52, 0,9,200, + 81,7,13, 0,8,100, 0,8,36, 0,9,168, + 0,8,4, 0,8,132, 0,8,68, 0,9,232, + 80,7,8, 0,8,92, 0,8,28, 0,9,152, + 84,7,83, 0,8,124, 0,8,60, 0,9,216, + 82,7,23, 0,8,108, 0,8,44, 0,9,184, + 0,8,12, 0,8,140, 0,8,76, 0,9,248, + 80,7,3, 0,8,82, 0,8,18, 85,8,163, + 83,7,35, 0,8,114, 0,8,50, 0,9,196, + 81,7,11, 0,8,98, 0,8,34, 0,9,164, + 0,8,2, 0,8,130, 0,8,66, 0,9,228, + 80,7,7, 0,8,90, 0,8,26, 0,9,148, + 84,7,67, 0,8,122, 0,8,58, 0,9,212, + 82,7,19, 0,8,106, 0,8,42, 0,9,180, + 0,8,10, 0,8,138, 0,8,74, 0,9,244, + 80,7,5, 0,8,86, 0,8,22, 192,8,0, + 83,7,51, 0,8,118, 0,8,54, 0,9,204, + 81,7,15, 0,8,102, 0,8,38, 0,9,172, + 0,8,6, 0,8,134, 0,8,70, 0,9,236, + 80,7,9, 0,8,94, 0,8,30, 0,9,156, + 84,7,99, 0,8,126, 0,8,62, 0,9,220, + 82,7,27, 0,8,110, 0,8,46, 0,9,188, + 0,8,14, 0,8,142, 0,8,78, 0,9,252, + 96,7,256, 0,8,81, 0,8,17, 85,8,131, + 82,7,31, 0,8,113, 0,8,49, 0,9,194, + 80,7,10, 0,8,97, 0,8,33, 0,9,162, + 0,8,1, 0,8,129, 0,8,65, 0,9,226, + 80,7,6, 0,8,89, 0,8,25, 0,9,146, + 83,7,59, 0,8,121, 0,8,57, 0,9,210, + 81,7,17, 0,8,105, 0,8,41, 0,9,178, + 0,8,9, 0,8,137, 0,8,73, 0,9,242, + 80,7,4, 0,8,85, 0,8,21, 80,8,258, + 83,7,43, 0,8,117, 0,8,53, 0,9,202, + 81,7,13, 0,8,101, 0,8,37, 0,9,170, + 0,8,5, 0,8,133, 0,8,69, 0,9,234, + 80,7,8, 0,8,93, 0,8,29, 0,9,154, + 84,7,83, 0,8,125, 0,8,61, 0,9,218, + 82,7,23, 0,8,109, 0,8,45, 0,9,186, + 0,8,13, 0,8,141, 0,8,77, 0,9,250, + 80,7,3, 0,8,83, 0,8,19, 85,8,195, + 83,7,35, 0,8,115, 0,8,51, 0,9,198, + 81,7,11, 0,8,99, 0,8,35, 0,9,166, + 0,8,3, 0,8,131, 0,8,67, 0,9,230, + 80,7,7, 0,8,91, 0,8,27, 0,9,150, + 84,7,67, 0,8,123, 0,8,59, 0,9,214, + 82,7,19, 0,8,107, 0,8,43, 0,9,182, + 0,8,11, 0,8,139, 0,8,75, 0,9,246, + 80,7,5, 0,8,87, 0,8,23, 192,8,0, + 83,7,51, 0,8,119, 0,8,55, 0,9,206, + 81,7,15, 0,8,103, 0,8,39, 0,9,174, + 0,8,7, 0,8,135, 0,8,71, 0,9,238, + 80,7,9, 0,8,95, 0,8,31, 0,9,158, + 84,7,99, 0,8,127, 0,8,63, 0,9,222, + 82,7,27, 0,8,111, 0,8,47, 0,9,190, + 0,8,15, 0,8,143, 0,8,79, 0,9,254, + 96,7,256, 0,8,80, 0,8,16, 84,8,115, + 82,7,31, 0,8,112, 0,8,48, 0,9,193, + + 80,7,10, 0,8,96, 0,8,32, 0,9,161, + 0,8,0, 0,8,128, 0,8,64, 0,9,225, + 80,7,6, 0,8,88, 0,8,24, 0,9,145, + 83,7,59, 0,8,120, 0,8,56, 0,9,209, + 81,7,17, 0,8,104, 0,8,40, 0,9,177, + 0,8,8, 0,8,136, 0,8,72, 0,9,241, + 80,7,4, 0,8,84, 0,8,20, 85,8,227, + 83,7,43, 0,8,116, 0,8,52, 0,9,201, + 81,7,13, 0,8,100, 0,8,36, 0,9,169, + 0,8,4, 0,8,132, 0,8,68, 0,9,233, + 80,7,8, 0,8,92, 0,8,28, 0,9,153, + 84,7,83, 0,8,124, 0,8,60, 0,9,217, + 82,7,23, 0,8,108, 0,8,44, 0,9,185, + 0,8,12, 0,8,140, 0,8,76, 0,9,249, + 80,7,3, 0,8,82, 0,8,18, 85,8,163, + 83,7,35, 0,8,114, 0,8,50, 0,9,197, + 81,7,11, 0,8,98, 0,8,34, 0,9,165, + 0,8,2, 0,8,130, 0,8,66, 0,9,229, + 80,7,7, 0,8,90, 0,8,26, 0,9,149, + 84,7,67, 0,8,122, 0,8,58, 0,9,213, + 82,7,19, 0,8,106, 0,8,42, 0,9,181, + 0,8,10, 0,8,138, 0,8,74, 0,9,245, + 80,7,5, 0,8,86, 0,8,22, 192,8,0, + 83,7,51, 0,8,118, 0,8,54, 0,9,205, + 81,7,15, 0,8,102, 0,8,38, 0,9,173, + 0,8,6, 0,8,134, 0,8,70, 0,9,237, + 80,7,9, 0,8,94, 0,8,30, 0,9,157, + 84,7,99, 0,8,126, 0,8,62, 0,9,221, + 82,7,27, 0,8,110, 0,8,46, 0,9,189, + 0,8,14, 0,8,142, 0,8,78, 0,9,253, + 96,7,256, 0,8,81, 0,8,17, 85,8,131, + 82,7,31, 0,8,113, 0,8,49, 0,9,195, + 80,7,10, 0,8,97, 0,8,33, 0,9,163, + 0,8,1, 0,8,129, 0,8,65, 0,9,227, + 80,7,6, 0,8,89, 0,8,25, 0,9,147, + 83,7,59, 0,8,121, 0,8,57, 0,9,211, + 81,7,17, 0,8,105, 0,8,41, 0,9,179, + 0,8,9, 0,8,137, 0,8,73, 0,9,243, + 80,7,4, 0,8,85, 0,8,21, 80,8,258, + 83,7,43, 0,8,117, 0,8,53, 0,9,203, + 81,7,13, 0,8,101, 0,8,37, 0,9,171, + 0,8,5, 0,8,133, 0,8,69, 0,9,235, + 80,7,8, 0,8,93, 0,8,29, 0,9,155, + 84,7,83, 0,8,125, 0,8,61, 0,9,219, + 82,7,23, 0,8,109, 0,8,45, 0,9,187, + 0,8,13, 0,8,141, 0,8,77, 0,9,251, + 80,7,3, 0,8,83, 0,8,19, 85,8,195, + 83,7,35, 0,8,115, 0,8,51, 0,9,199, + 81,7,11, 0,8,99, 0,8,35, 0,9,167, + 0,8,3, 0,8,131, 0,8,67, 0,9,231, + 80,7,7, 0,8,91, 0,8,27, 0,9,151, + 84,7,67, 0,8,123, 0,8,59, 0,9,215, + 82,7,19, 0,8,107, 0,8,43, 0,9,183, + 0,8,11, 0,8,139, 0,8,75, 0,9,247, + 80,7,5, 0,8,87, 0,8,23, 192,8,0, + 83,7,51, 0,8,119, 0,8,55, 0,9,207, + 81,7,15, 0,8,103, 0,8,39, 0,9,175, + 0,8,7, 0,8,135, 0,8,71, 0,9,239, + 80,7,9, 0,8,95, 0,8,31, 0,9,159, + 84,7,99, 0,8,127, 0,8,63, 0,9,223, + 82,7,27, 0,8,111, 0,8,47, 0,9,191, + 0,8,15, 0,8,143, 0,8,79, 0,9,255 + }; + static readonly int[] fixed_td = { + 80,5,1, 87,5,257, 83,5,17, 91,5,4097, + 81,5,5, 89,5,1025, 85,5,65, 93,5,16385, + 80,5,3, 88,5,513, 84,5,33, 92,5,8193, + 82,5,9, 90,5,2049, 86,5,129, 192,5,24577, + 80,5,2, 87,5,385, 83,5,25, 91,5,6145, + 81,5,7, 89,5,1537, 85,5,97, 93,5,24577, + 80,5,4, 88,5,769, 84,5,49, 92,5,12289, + 82,5,13, 90,5,3073, 86,5,193, 192,5,24577 + }; + + // Tables for deflate from PKZIP's appnote.txt. + static readonly int[] cplens = { // Copy lengths for literal codes 257..285 + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 + }; + + // see note #13 above about 258 + static readonly int[] cplext = { // Extra bits for literal codes 257..285 + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112 // 112==invalid + }; + + static readonly int[] cpdist = { // Copy offsets for distance codes 0..29 + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577 + }; + + static readonly int[] cpdext = { // Extra bits for distance codes + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + + // If BMAX needs to be larger than 16, then h and x[] should be uLong. + const int BMAX=15; // maximum bit length of any code + + int[] hn = null; // hufts used in space + int[] v = null; // work area for huft_build + int[] c = null; // bit length count table + int[] r = null; // table entry for structure assignment + int[] u = null; // table stack + int[] x = null; // bit offsets, then code stack + + private int huft_build(int[] b, // code lengths in bits (all assumed <= BMAX) + int bindex, + int n, // number of codes (assumed <= 288) + int s, // number of simple-valued codes (0..s-1) + int[] d, // list of base values for non-simple codes + int[] e, // list of extra bits for non-simple codes + int[] t, // result: starting table + int[] m, // maximum lookup bits, returns actual + int[] hp,// space for trees + int[] hn,// hufts used in space + int[] v // working area: values in order of bit length + ){ + // Given a list of code lengths and a maximum table size, make a set of + // tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + // if the given code set is incomplete (the tables are still built in this + // case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of + // lengths), or Z_MEM_ERROR if not enough memory. + + int a; // counter for codes of length k + int f; // i repeats in table every f entries + int g; // maximum code length + int h; // table level + int i; // counter, current code + int j; // counter + int k; // number of bits in current code + int l; // bits per table (returned in m) + int mask; // (1 << w) - 1, to avoid cc -O bug on HP + int p; // pointer into c[], b[], or v[] + int q; // points to current table + int w; // bits before this table == (l * h) + int xp; // pointer into x + int y; // number of dummy codes added + int z; // number of entries in current table + + // Generate counts for each bit length + + p = 0; i = n; + do { + c[b[bindex+p]]++; p++; i--; // assume all entries <= BMAX + }while(i!=0); + + if(c[0] == n){ // null input--all zero length codes + t[0] = -1; + m[0] = 0; + return Z_OK; + } + + // Find minimum and maximum length, bound *m by those + l = m[0]; + for (j = 1; j <= BMAX; j++) + if(c[j]!=0) break; + k = j; // minimum code length + if(l < j){ + l = j; + } + for (i = BMAX; i!=0; i--){ + if(c[i]!=0) break; + } + g = i; // maximum code length + if(l > i){ + l = i; + } + m[0] = l; + + // Adjust last length count to fill out codes, if needed + for (y = 1 << j; j < i; j++, y <<= 1){ + if ((y -= c[j]) < 0){ + return Z_DATA_ERROR; + } + } + if ((y -= c[i]) < 0){ + return Z_DATA_ERROR; + } + c[i] += y; + + // Generate starting offsets into the value table for each length + x[1] = j = 0; + p = 1; xp = 2; + while (--i!=0) { // note that i == g from above + x[xp] = (j += c[p]); + xp++; + p++; + } + + // Make a table of values in order of bit lengths + i = 0; p = 0; + do { + if ((j = b[bindex+p]) != 0){ + v[x[j]++] = i; + } + p++; + } + while (++i < n); + n = x[g]; // set n to length of v + + // Generate the Huffman codes and for each, make the table entries + x[0] = i = 0; // first Huffman code is zero + p = 0; // grab values in bit order + h = -1; // no tables yet--level -1 + w = -l; // bits decoded == (l * h) + u[0] = 0; // just to keep compilers happy + q = 0; // ditto + z = 0; // ditto + + // go through the bit lengths (k already is bits in shortest code) + for (; k <= g; k++){ + a = c[k]; + while (a--!=0){ + // here i is the Huffman code of length k bits for value *p + // make tables up to required level + while (k > w + l){ + h++; + w += l; // previous table always l bits + // compute minimum size table less than or equal to l bits + z = g - w; + z = (z > l) ? l : z; // table size upper limit + if((f=1<<(j=k-w))>a+1){ // try a k-w bit table + // too few codes for k-w bit table + f -= a + 1; // deduct codes from patterns left + xp = k; + if(j < z){ + while (++j < z){ // try smaller tables up to z bits + if((f <<= 1) <= c[++xp]) + break; // enough codes to use up j bits + f -= c[xp]; // else deduct codes from patterns + } + } + } + z = 1 << j; // table entries for j-bit table + + // allocate new table + if (hn[0] + z > MANY){ // (note: doesn't matter for fixed) + return Z_DATA_ERROR; // overflow of MANY + } + u[h] = q = /*hp+*/ hn[0]; // DEBUG + hn[0] += z; + + // connect to last table, if there is one + if(h!=0){ + x[h]=i; // save pattern for backing up + r[0]=(byte)j; // bits in this table + r[1]=(byte)l; // bits to dump before this table + j=i>>(w - l); + r[2] = (int)(q - u[h-1] - j); // offset to this table + System.Array.Copy(r, 0, hp, (u[h-1]+j)*3, 3); // connect to last table + } + else{ + t[0] = q; // first table is returned result + } + } + + // set up table entry in r + r[1] = (byte)(k - w); + if (p >= n){ + r[0] = 128 + 64; // out of values--invalid code + } + else if (v[p] < s){ + r[0] = (byte)(v[p] < 256 ? 0 : 32 + 64); // 256 is end-of-block + r[2] = v[p++]; // simple code is just the value + } + else{ + r[0]=(byte)(e[v[p]-s]+16+64); // non-simple--look up in lists + r[2]=d[v[p++] - s]; + } + + // fill code-like entries with r + f=1<<(k-w); + for (j=i>>w;j>= 1){ + i ^= j; + } + i ^= j; + + // backup over finished tables + mask = (1 << w) - 1; // needed on HP, cc -O bug + while ((i & mask) != x[h]){ + h--; // don't need to update q + w -= l; + mask = (1 << w) - 1; + } + } + } + // Return Z_BUF_ERROR if we were given an incomplete table + return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; + } + + internal int inflate_trees_bits(int[] c, // 19 code lengths + int[] bb, // bits tree desired/actual depth + int[] tb, // bits tree result + int[] hp, // space for trees + ZStream z // for messages + ){ + int result; + initWorkArea(19); + hn[0]=0; + result = huft_build(c, 0, 19, 19, null, null, tb, bb, hp, hn, v); + + if(result == Z_DATA_ERROR){ + z.msg = "oversubscribed dynamic bit lengths tree"; + } + else if(result == Z_BUF_ERROR || bb[0] == 0){ + z.msg = "incomplete dynamic bit lengths tree"; + result = Z_DATA_ERROR; + } + return result; + } + + internal int inflate_trees_dynamic(int nl, // number of literal/length codes + int nd, // number of distance codes + int[] c, // that many (total) code lengths + int[] bl, // literal desired/actual bit depth + int[] bd, // distance desired/actual bit depth + int[] tl, // literal/length tree result + int[] td, // distance tree result + int[] hp, // space for trees + ZStream z // for messages + ){ + int result; + + // build literal/length tree + initWorkArea(288); + hn[0]=0; + result = huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, hn, v); + if (result != Z_OK || bl[0] == 0){ + if(result == Z_DATA_ERROR){ + z.msg = "oversubscribed literal/length tree"; + } + else if (result != Z_MEM_ERROR){ + z.msg = "incomplete literal/length tree"; + result = Z_DATA_ERROR; + } + return result; + } + + // build distance tree + initWorkArea(288); + result = huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, hn, v); + + if (result != Z_OK || (bd[0] == 0 && nl > 257)){ + if (result == Z_DATA_ERROR){ + z.msg = "oversubscribed distance tree"; + } + else if (result == Z_BUF_ERROR) { + z.msg = "incomplete distance tree"; + result = Z_DATA_ERROR; + } + else if (result != Z_MEM_ERROR){ + z.msg = "empty distance tree with lengths"; + result = Z_DATA_ERROR; + } + return result; + } + + return Z_OK; + } + + internal static int inflate_trees_fixed(int[] bl, //literal desired/actual bit depth + int[] bd, //distance desired/actual bit depth + int[][] tl,//literal/length tree result + int[][] td,//distance tree result + ZStream z //for memory allocation + ){ + bl[0]=fixed_bl; + bd[0]=fixed_bd; + tl[0]=fixed_tl; + td[0]=fixed_td; + return Z_OK; + } + + private void initWorkArea(int vsize){ + if(hn==null){ + hn=new int[1]; + v=new int[vsize]; + c=new int[BMAX+1]; + r=new int[3]; + u=new int[BMAX]; + x=new int[BMAX+1]; + } + if(v.Lengthstate); + return Z_OK; + } + + internal int inflateInit(ZStream z, int w){ + z.msg = null; + blocks = null; + + // handle undocumented nowrap option (no zlib header or check) + nowrap = 0; + if(w < 0){ + w = - w; + nowrap = 1; + } + + // set window size + if(w<8 ||w>15){ + inflateEnd(z); + return Z_STREAM_ERROR; + } + wbits=w; + + z.istate.blocks=new InfBlocks(z, + z.istate.nowrap!=0 ? null : this, + 1<>4)+8>z.istate.wbits){ + z.istate.mode = BAD; + z.msg="invalid window size"; + z.istate.marker = 5; // can't try inflateSync + break; + } + z.istate.mode=FLAG; + goto case FLAG; + case FLAG: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + b = (z.next_in[z.next_in_index++])&0xff; + + if((((z.istate.method << 8)+b) % 31)!=0){ + z.istate.mode = BAD; + z.msg = "incorrect header check"; + z.istate.marker = 5; // can't try inflateSync + break; + } + + if((b&PRESET_DICT)==0){ + z.istate.mode = BLOCKS; + break; + } + z.istate.mode = DICT4; + goto case DICT4; + case DICT4: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + z.istate.need=((z.next_in[z.next_in_index++]&0xff)<<24)&0xff000000L; + z.istate.mode=DICT3; + goto case DICT3; + case DICT3: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<16)&0xff0000L; + z.istate.mode=DICT2; + goto case DICT2; + case DICT2: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<8)&0xff00L; + z.istate.mode=DICT1; + goto case DICT1; + case DICT1: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + z.istate.need += (z.next_in[z.next_in_index++]&0xffL); + z.adler = z.istate.need; + z.istate.mode = DICT0; + return Z_NEED_DICT; + case DICT0: + z.istate.mode = BAD; + z.msg = "need dictionary"; + z.istate.marker = 0; // can try inflateSync + return Z_STREAM_ERROR; + case BLOCKS: + + r = z.istate.blocks.proc(z, r); + if(r == Z_DATA_ERROR){ + z.istate.mode = BAD; + z.istate.marker = 0; // can try inflateSync + break; + } + if(r == Z_OK){ + r = f; + } + if(r != Z_STREAM_END){ + return r; + } + r = f; + z.istate.blocks.reset(z, z.istate.was); + if(z.istate.nowrap!=0){ + z.istate.mode=DONE; + break; + } + z.istate.mode=CHECK4; + goto case CHECK4; + case CHECK4: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + z.istate.need=((z.next_in[z.next_in_index++]&0xff)<<24)&0xff000000L; + z.istate.mode=CHECK3; + goto case CHECK3; + case CHECK3: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<16)&0xff0000L; + z.istate.mode = CHECK2; + goto case CHECK2; + case CHECK2: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + z.istate.need+=((z.next_in[z.next_in_index++]&0xff)<<8)&0xff00L; + z.istate.mode = CHECK1; + goto case CHECK1; + case CHECK1: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + z.istate.need+=(z.next_in[z.next_in_index++]&0xffL); + + if(((int)(z.istate.was[0])) != ((int)(z.istate.need))){ + z.istate.mode = BAD; + z.msg = "incorrect data check"; + z.istate.marker = 5; // can't try inflateSync + break; + } + + z.istate.mode = DONE; + goto case DONE; + case DONE: + return Z_STREAM_END; + case BAD: + return Z_DATA_ERROR; + default: + return Z_STREAM_ERROR; + } + } + } + + + internal int inflateSetDictionary(ZStream z, byte[] dictionary, int dictLength){ + int index=0; + int length = dictLength; + if(z==null || z.istate == null|| z.istate.mode != DICT0) + return Z_STREAM_ERROR; + + if(z._adler.adler32(1L, dictionary, 0, dictLength)!=z.adler){ + return Z_DATA_ERROR; + } + + z.adler = z._adler.adler32(0, null, 0, 0); + + if(length >= (1< + /// Summary description for DeflaterOutputStream. + /// + [Obsolete("Use 'ZOutputStream' instead")] + public class ZDeflaterOutputStream : Stream { + protected ZStream z=new ZStream(); + protected int flushLevel=JZlib.Z_NO_FLUSH; + private const int BUFSIZE = 4192; + protected byte[] buf=new byte[BUFSIZE]; + private byte[] buf1=new byte[1]; + + protected Stream outp; + + public ZDeflaterOutputStream(Stream outp) : this(outp, 6, false) { + } + + public ZDeflaterOutputStream(Stream outp, int level) : this(outp, level, false) { + } + + public ZDeflaterOutputStream(Stream outp, int level, bool nowrap) { + this.outp=outp; + z.deflateInit(level, nowrap); + } + + + public override bool CanRead { + get { + // TODO: Add DeflaterOutputStream.CanRead getter implementation + return false; + } + } + + public override bool CanSeek { + get { + // TODO: Add DeflaterOutputStream.CanSeek getter implementation + return false; + } + } + + public override bool CanWrite { + get { + // TODO: Add DeflaterOutputStream.CanWrite getter implementation + return true; + } + } + + public override long Length { + get { + // TODO: Add DeflaterOutputStream.Length getter implementation + return 0; + } + } + + public override long Position { + get { + // TODO: Add DeflaterOutputStream.Position getter implementation + return 0; + } + set { + // TODO: Add DeflaterOutputStream.Position setter implementation + } + } + + public override void Write(byte[] b, int off, int len) { + if(len==0) + return; + int err; + z.next_in=b; + z.next_in_index=off; + z.avail_in=len; + do{ + z.next_out=buf; + z.next_out_index=0; + z.avail_out=BUFSIZE; + err=z.deflate(flushLevel); + if(err!=JZlib.Z_OK) + throw new IOException("deflating: "+z.msg); + if (z.avail_out < BUFSIZE) + { + outp.Write(buf, 0, BUFSIZE-z.avail_out); + } + } + while(z.avail_in>0 || z.avail_out==0); + } + + public override long Seek(long offset, SeekOrigin origin) { + // TODO: Add DeflaterOutputStream.Seek implementation + return 0; + } + + public override void SetLength(long value) { + // TODO: Add DeflaterOutputStream.SetLength implementation + + } + + public override int Read(byte[] buffer, int offset, int count) { + // TODO: Add DeflaterOutputStream.Read implementation + return 0; + } + + public override void Flush() { + outp.Flush(); + } + + public override void WriteByte(byte b) { + buf1[0]=(byte)b; + Write(buf1, 0, 1); + } + + public void Finish() { + int err; + do{ + z.next_out=buf; + z.next_out_index=0; + z.avail_out=BUFSIZE; + err=z.deflate(JZlib.Z_FINISH); + if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK) + throw new IOException("deflating: "+z.msg); + if(BUFSIZE-z.avail_out>0){ + outp.Write(buf, 0, BUFSIZE-z.avail_out); + } + } + while(z.avail_in>0 || z.avail_out==0); + Flush(); + } + + public void End() { + if(z==null) + return; + z.deflateEnd(); + z.free(); + z=null; + } + +#if PORTABLE || NETFX_CORE + protected override void Dispose(bool disposing) + { + if (disposing) + { + try{ + try{Finish();} + catch (IOException) {} + } + finally{ + End(); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(outp); + outp=null; + } + } + base.Dispose(disposing); + } +#else + public override void Close() { + try{ + try{Finish();} + catch (IOException) {} + } + finally{ + End(); + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(outp); + outp=null; + } + base.Close(); + } +#endif + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZDeflaterOutputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZDeflaterOutputStream.cs.meta new file mode 100644 index 00000000..7fdbca21 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZDeflaterOutputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1235cf9b25f415a43af3b5e12ebb8a8d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZInflaterInputStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZInflaterInputStream.cs new file mode 100644 index 00000000..9f695af1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZInflaterInputStream.cs @@ -0,0 +1,144 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib { + /// + /// Summary description for DeflaterOutputStream. + /// + [Obsolete("Use 'ZInputStream' instead")] + public class ZInflaterInputStream : Stream { + protected ZStream z=new ZStream(); + protected int flushLevel=JZlib.Z_NO_FLUSH; + private const int BUFSIZE = 4192; + protected byte[] buf=new byte[BUFSIZE]; + private byte[] buf1=new byte[1]; + + protected Stream inp=null; + private bool nomoreinput=false; + + public ZInflaterInputStream(Stream inp) : this(inp, false) { + } + + public ZInflaterInputStream(Stream inp, bool nowrap) { + this.inp=inp; + z.inflateInit(nowrap); + z.next_in=buf; + z.next_in_index=0; + z.avail_in=0; + } + + public override bool CanRead { + get { + // TODO: Add DeflaterOutputStream.CanRead getter implementation + return true; + } + } + + public override bool CanSeek { + get { + // TODO: Add DeflaterOutputStream.CanSeek getter implementation + return false; + } + } + + public override bool CanWrite { + get { + // TODO: Add DeflaterOutputStream.CanWrite getter implementation + return false; + } + } + + public override long Length { + get { + // TODO: Add DeflaterOutputStream.Length getter implementation + return 0; + } + } + + public override long Position { + get { + // TODO: Add DeflaterOutputStream.Position getter implementation + return 0; + } + set { + // TODO: Add DeflaterOutputStream.Position setter implementation + } + } + + public override void Write(byte[] b, int off, int len) { + } + + public override long Seek(long offset, SeekOrigin origin) { + // TODO: Add DeflaterOutputStream.Seek implementation + return 0; + } + + public override void SetLength(long value) { + // TODO: Add DeflaterOutputStream.SetLength implementation + + } + + public override int Read(byte[] b, int off, int len) { + if(len==0) + return(0); + int err; + z.next_out=b; + z.next_out_index=off; + z.avail_out=len; + do { + if((z.avail_in==0)&&(!nomoreinput)) { // if buffer is empty and more input is avaiable, refill it + z.next_in_index=0; + z.avail_in=inp.Read(buf, 0, BUFSIZE);//(BUFSIZE 0) + { + output.Write(buf, 0, count); + } + } + while (z.avail_in > 0 || z.avail_out == 0); + + Flush(); + } + + public override void Flush() + { + output.Flush(); + } + + public virtual int FlushMode + { + get { return flushLevel; } + set { this.flushLevel = value; } + } + + public sealed override long Length { get { throw new NotSupportedException(); } } + public sealed override long Position + { + get { throw new NotSupportedException(); } + set { throw new NotSupportedException(); } + } + public sealed override int Read(byte[] buffer, int offset, int count) { throw new NotSupportedException(); } + public sealed override long Seek(long offset, SeekOrigin origin) { throw new NotSupportedException(); } + public sealed override void SetLength(long value) { throw new NotSupportedException(); } + + public virtual long TotalIn + { + get { return z.total_in; } + } + + public virtual long TotalOut + { + get { return z.total_out; } + } + + public override void Write(byte[] b, int off, int len) + { + if (len == 0) + return; + + z.next_in = b; + z.next_in_index = off; + z.avail_in = len; + + do + { + z.next_out = buf; + z.next_out_index = 0; + z.avail_out = buf.Length; + + int err = compress + ? z.deflate(flushLevel) + : z.inflate(flushLevel); + + if (err != JZlib.Z_OK) + // TODO +// throw new ZStreamException((compress ? "de" : "in") + "flating: " + z.msg); + throw new IOException((compress ? "de" : "in") + "flating: " + z.msg); + + output.Write(buf, 0, buf.Length - z.avail_out); + } + while (z.avail_in > 0 || z.avail_out == 0); + } + + public override void WriteByte(byte b) + { + buf1[0] = b; + Write(buf1, 0, 1); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZOutputStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZOutputStream.cs.meta new file mode 100644 index 00000000..4a5a596e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZOutputStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7184782482afa5f43b30b456f1930268 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZStream.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZStream.cs new file mode 100644 index 00000000..ea4c53eb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZStream.cs @@ -0,0 +1,218 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +/* + * $Id: ZStream.cs,v 1.1 2006-07-31 13:59:26 bouncy Exp $ + * +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib { + + public sealed class ZStream{ + + private const int MAX_WBITS=15; // 32K LZ77 window + private const int DEF_WBITS=MAX_WBITS; + + private const int Z_NO_FLUSH=0; + private const int Z_PARTIAL_FLUSH=1; + private const int Z_SYNC_FLUSH=2; + private const int Z_FULL_FLUSH=3; + private const int Z_FINISH=4; + + private const int MAX_MEM_LEVEL=9; + + private const int Z_OK=0; + private const int Z_STREAM_END=1; + private const int Z_NEED_DICT=2; + private const int Z_ERRNO=-1; + private const int Z_STREAM_ERROR=-2; + private const int Z_DATA_ERROR=-3; + private const int Z_MEM_ERROR=-4; + private const int Z_BUF_ERROR=-5; + private const int Z_VERSION_ERROR=-6; + + public byte[] next_in; // next input byte + public int next_in_index; + public int avail_in; // number of bytes available at next_in + public long total_in; // total nb of input bytes read so far + + public byte[] next_out; // next output byte should be put there + public int next_out_index; + public int avail_out; // remaining free space at next_out + public long total_out; // total nb of bytes output so far + + public String msg; + + internal Deflate dstate; + internal Inflate istate; + + internal int data_type; // best guess about the data type: ascii or binary + + public long adler; + internal Adler32 _adler=new Adler32(); + + public int inflateInit(){ + return inflateInit(DEF_WBITS); + } + public int inflateInit(bool nowrap){ + return inflateInit(DEF_WBITS, nowrap); + } + public int inflateInit(int w){ + return inflateInit(w, false); + } + + public int inflateInit(int w, bool nowrap){ + istate=new Inflate(); + return istate.inflateInit(this, nowrap?-w:w); + } + + public int inflate(int f){ + if(istate==null) return Z_STREAM_ERROR; + return istate.inflate(this, f); + } + public int inflateEnd(){ + if(istate==null) return Z_STREAM_ERROR; + int ret=istate.inflateEnd(this); + istate = null; + return ret; + } + public int inflateSync(){ + if(istate == null) + return Z_STREAM_ERROR; + return istate.inflateSync(this); + } + public int inflateSetDictionary(byte[] dictionary, int dictLength){ + if(istate == null) + return Z_STREAM_ERROR; + return istate.inflateSetDictionary(this, dictionary, dictLength); + } + + public int deflateInit(int level){ + return deflateInit(level, MAX_WBITS); + } + public int deflateInit(int level, bool nowrap){ + return deflateInit(level, MAX_WBITS, nowrap); + } + public int deflateInit(int level, int bits){ + return deflateInit(level, bits, false); + } + public int deflateInit(int level, int bits, bool nowrap){ + dstate=new Deflate(); + return dstate.deflateInit(this, level, nowrap?-bits:bits); + } + public int deflate(int flush){ + if(dstate==null){ + return Z_STREAM_ERROR; + } + return dstate.deflate(this, flush); + } + public int deflateEnd(){ + if(dstate==null) return Z_STREAM_ERROR; + int ret=dstate.deflateEnd(); + dstate=null; + return ret; + } + public int deflateParams(int level, int strategy){ + if(dstate==null) return Z_STREAM_ERROR; + return dstate.deflateParams(this, level, strategy); + } + public int deflateSetDictionary (byte[] dictionary, int dictLength){ + if(dstate == null) + return Z_STREAM_ERROR; + return dstate.deflateSetDictionary(this, dictionary, dictLength); + } + + // Flush as much pending output as possible. All deflate() output goes + // through this function so some applications may wish to modify it + // to avoid allocating a large strm->next_out buffer and copying into it. + // (See also read_buf()). + internal void flush_pending(){ + int len=dstate.pending; + + if(len>avail_out) len=avail_out; + if(len==0) return; + + if(dstate.pending_buf.Length<=dstate.pending_out || + next_out.Length<=next_out_index || + dstate.pending_buf.Length<(dstate.pending_out+len) || + next_out.Length<(next_out_index+len)){ + // System.out.println(dstate.pending_buf.length+", "+dstate.pending_out+ + // ", "+next_out.length+", "+next_out_index+", "+len); + // System.out.println("avail_out="+avail_out); + } + + System.Array.Copy(dstate.pending_buf, dstate.pending_out, + next_out, next_out_index, len); + + next_out_index+=len; + dstate.pending_out+=len; + total_out+=len; + avail_out-=len; + dstate.pending-=len; + if(dstate.pending==0){ + dstate.pending_out=0; + } + } + + // Read a new buffer from the current input stream, update the adler32 + // and total number of bytes read. All deflate() input goes through + // this function so some applications may wish to modify it to avoid + // allocating a large strm->next_in buffer and copying from it. + // (See also flush_pending()). + internal int read_buf(byte[] buf, int start, int size) { + int len=avail_in; + + if(len>size) len=size; + if(len==0) return 0; + + avail_in-=len; + + if(dstate.noheader==0) { + adler=_adler.adler32(adler, next_in, next_in_index, len); + } + System.Array.Copy(next_in, next_in_index, buf, start, len); + next_in_index += len; + total_in += len; + return len; + } + + public void free(){ + next_in=null; + next_out=null; + msg=null; + _adler=null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZStream.cs.meta new file mode 100644 index 00000000..b4414aea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZStream.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ddcf6fa74a82c246a547246aefee100 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZTree.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZTree.cs new file mode 100644 index 00000000..068f027c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZTree.cs @@ -0,0 +1,371 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +/* + * $Id: Tree.cs,v 1.2 2008-05-10 09:35:40 bouncy Exp $ + * +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib { + + internal sealed class ZTree{ + private const int MAX_BITS=15; + private const int BL_CODES=19; + private const int D_CODES=30; + private const int LITERALS=256; + private const int LENGTH_CODES=29; + private const int L_CODES=(LITERALS+1+LENGTH_CODES); + private const int HEAP_SIZE=(2*L_CODES+1); + + // Bit length codes must not exceed MAX_BL_BITS bits + internal const int MAX_BL_BITS=7; + + // end of block literal code + internal const int END_BLOCK=256; + + // repeat previous bit length 3-6 times (2 bits of repeat count) + internal const int REP_3_6=16; + + // repeat a zero length 3-10 times (3 bits of repeat count) + internal const int REPZ_3_10=17; + + // repeat a zero length 11-138 times (7 bits of repeat count) + internal const int REPZ_11_138=18; + + // extra bits for each length code + internal static readonly int[] extra_lbits={ + 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0 + }; + + // extra bits for each distance code + internal static readonly int[] extra_dbits={ + 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 + }; + + // extra bits for each bit length code + internal static readonly int[] extra_blbits={ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7 + }; + + internal static readonly byte[] bl_order={ + 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; + + + // The lengths of the bit length codes are sent in order of decreasing + // probability, to avoid transmitting the lengths for unused bit + // length codes. + + internal const int Buf_size=8*2; + + // see definition of array dist_code below + internal const int DIST_CODE_LEN=512; + + internal static readonly byte[] _dist_code = { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, + 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, + 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 + }; + + internal static readonly byte[] _length_code={ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, + 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, + 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, + 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 + }; + + internal static readonly int[] base_length = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, + 64, 80, 96, 112, 128, 160, 192, 224, 0 + }; + + internal static readonly int[] base_dist = { + 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, + 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, + 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 + }; + + // Mapping from a distance to a distance code. dist is the distance - 1 and + // must not have side effects. _dist_code[256] and _dist_code[257] are never + // used. + internal static int d_code(int dist){ + return ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]); + } + + internal short[] dyn_tree; // the dynamic tree + internal int max_code; // largest code with non zero frequency + internal StaticTree stat_desc; // the corresponding static tree + + // Compute the optimal bit lengths for a tree and update the total bit length + // for the current block. + // IN assertion: the fields freq and dad are set, heap[heap_max] and + // above are the tree nodes sorted by increasing frequency. + // OUT assertions: the field len is set to the optimal bit length, the + // array bl_count contains the frequencies for each bit length. + // The length opt_len is updated; static_len is also updated if stree is + // not null. + internal void gen_bitlen(Deflate s){ + short[] tree = dyn_tree; + short[] stree = stat_desc.static_tree; + int[] extra = stat_desc.extra_bits; + int based = stat_desc.extra_base; + int max_length = stat_desc.max_length; + int h; // heap index + int n, m; // iterate over the tree elements + int bits; // bit length + int xbits; // extra bits + short f; // frequency + int overflow = 0; // number of elements with bit length too large + + for (bits = 0; bits <= MAX_BITS; bits++) s.bl_count[bits] = 0; + + // In a first pass, compute the optimal bit lengths (which may + // overflow in the case of the bit length tree). + tree[s.heap[s.heap_max]*2+1] = 0; // root of the heap + + for(h=s.heap_max+1; h max_length){ bits = max_length; overflow++; } + tree[n*2+1] = (short)bits; + // We overwrite tree[n*2+1] which is no longer needed + + if (n > max_code) continue; // not a leaf node + + s.bl_count[bits]++; + xbits = 0; + if (n >= based) xbits = extra[n-based]; + f = tree[n*2]; + s.opt_len += f * (bits + xbits); + if (stree!=null) s.static_len += f * (stree[n*2+1] + xbits); + } + if (overflow == 0) return; + + // This happens for example on obj2 and pic of the Calgary corpus + // Find the first bit length which could increase: + do { + bits = max_length-1; + while(s.bl_count[bits]==0) bits--; + s.bl_count[bits]--; // move one leaf down the tree + s.bl_count[bits+1]+=2; // move one overflow item as its brother + s.bl_count[max_length]--; + // The brother of the overflow item also moves one step up, + // but this does not affect bl_count[max_length] + overflow -= 2; + } + while (overflow > 0); + + for (bits = max_length; bits != 0; bits--) { + n = s.bl_count[bits]; + while (n != 0) { + m = s.heap[--h]; + if (m > max_code) continue; + if (tree[m*2+1] != bits) { + s.opt_len += (int)(((long)bits - (long)tree[m*2+1])*(long)tree[m*2]); + tree[m*2+1] = (short)bits; + } + n--; + } + } + } + + // Construct one Huffman tree and assigns the code bit strings and lengths. + // Update the total bit length for the current block. + // IN assertion: the field freq is set for all tree elements. + // OUT assertions: the fields len and code are set to the optimal bit length + // and corresponding code. The length opt_len is updated; static_len is + // also updated if stree is not null. The field max_code is set. + internal void build_tree(Deflate s){ + short[] tree=dyn_tree; + short[] stree=stat_desc.static_tree; + int elems=stat_desc.elems; + int n, m; // iterate over heap elements + int max_code=-1; // largest code with non zero frequency + int node; // new node being created + + // Construct the initial heap, with least frequent element in + // heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + // heap[0] is not used. + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for(n=0; n=1; n--) + s.pqdownheap(tree, n); + + // Construct the Huffman tree by repeatedly combining the least two + // frequent nodes. + + node=elems; // next internal node of the tree + do{ + // n = node of least frequency + n=s.heap[1]; + s.heap[1]=s.heap[s.heap_len--]; + s.pqdownheap(tree, 1); + m=s.heap[1]; // m = node of next least frequency + + s.heap[--s.heap_max] = n; // keep the nodes sorted by frequency + s.heap[--s.heap_max] = m; + + // Create a new node father of n and m + tree[node*2] = (short)(tree[n*2] + tree[m*2]); + s.depth[node] = (byte)(System.Math.Max(s.depth[n],s.depth[m])+1); + tree[n*2+1] = tree[m*2+1] = (short)node; + + // and insert the new node in the heap + s.heap[1] = node++; + s.pqdownheap(tree, 1); + } + while(s.heap_len>=2); + + s.heap[--s.heap_max] = s.heap[1]; + + // At this point, the fields freq and dad are set. We can now + // generate the bit lengths. + + gen_bitlen(s); + + // The field len is now set, we can generate the bit codes + gen_codes(tree, max_code, s.bl_count); + } + + // Generate the codes for a given tree and bit counts (which need not be + // optimal). + // IN assertion: the array bl_count contains the bit length statistics for + // the given tree and the field len is set for all tree elements. + // OUT assertion: the field code is set for all tree elements of non + // zero code length. + internal static void gen_codes(short[] tree, // the tree to decorate + int max_code, // largest code with non zero frequency + short[] bl_count // number of codes at each bit length + ){ + short[] next_code=new short[MAX_BITS+1]; // next code value for each bit length + short code = 0; // running code value + int bits; // bit index + int n; // code index + + // The distribution counts are first used to generate the code values + // without bit reversal. + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (short)((code + bl_count[bits-1]) << 1); + } + + // Check that the bit counts in bl_count are consistent. The last code + // must be all ones. + //Assert (code + bl_count[MAX_BITS]-1 == (1<>=1; + res<<=1; + } + while(--len>0); + return res>>1; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZTree.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZTree.cs.meta new file mode 100644 index 00000000..d919e1d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/util/zlib/ZTree.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6b33c17bec77554891e8c5d75de87d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509.meta new file mode 100644 index 00000000..1b5af611 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c54419453e5665246b78dd2cc005e17a +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateHolder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateHolder.cs new file mode 100644 index 00000000..122b6a88 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateHolder.cs @@ -0,0 +1,446 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// + /// The Holder object. + ///
    + 	/// Holder ::= SEQUENCE {
    + 	///		baseCertificateID   [0] IssuerSerial OPTIONAL,
    + 	///			-- the issuer and serial number of
    + 	///			-- the holder's Public Key Certificate
    + 	///		entityName          [1] GeneralNames OPTIONAL,
    + 	///			-- the name of the claimant or role
    + 	///		objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
    + 	///			-- used to directly authenticate the holder,
    + 	///			-- for example, an executable
    + 	/// }
    +	/// 
    + ///
    + public class AttributeCertificateHolder + //: CertSelector, Selector + : IX509Selector + { + internal readonly Holder holder; + + internal AttributeCertificateHolder( + Asn1Sequence seq) + { + holder = Holder.GetInstance(seq); + } + + public AttributeCertificateHolder( + X509Name issuerName, + BigInteger serialNumber) + { + holder = new Holder( + new IssuerSerial( + GenerateGeneralNames(issuerName), + new DerInteger(serialNumber))); + } + + public AttributeCertificateHolder( + X509Certificate cert) + { + X509Name name; + try + { + name = PrincipalUtilities.GetIssuerX509Principal(cert); + } + catch (Exception e) + { + throw new CertificateParsingException(e.Message); + } + + holder = new Holder(new IssuerSerial(GenerateGeneralNames(name), new DerInteger(cert.SerialNumber))); + } + + public AttributeCertificateHolder( + X509Name principal) + { + holder = new Holder(GenerateGeneralNames(principal)); + } + + /** + * Constructs a holder for v2 attribute certificates with a hash value for + * some type of object. + *

    + * digestedObjectType can be one of the following: + *

      + *
    • 0 - publicKey - A hash of the public key of the holder must be + * passed.
    • + *
    • 1 - publicKeyCert - A hash of the public key certificate of the + * holder must be passed.
    • + *
    • 2 - otherObjectDigest - A hash of some other object type must be + * passed. otherObjectTypeID must not be empty.
    • + *
    + *

    + *

    This cannot be used if a v1 attribute certificate is used.

    + * + * @param digestedObjectType The digest object type. + * @param digestAlgorithm The algorithm identifier for the hash. + * @param otherObjectTypeID The object type ID if + * digestedObjectType is + * otherObjectDigest. + * @param objectDigest The hash value. + */ + public AttributeCertificateHolder( + int digestedObjectType, + string digestAlgorithm, + string otherObjectTypeID, + byte[] objectDigest) + { + // TODO Allow 'objectDigest' to be null? + + holder = new Holder(new ObjectDigestInfo(digestedObjectType, otherObjectTypeID, + new AlgorithmIdentifier(new DerObjectIdentifier(digestAlgorithm)), Arrays.Clone(objectDigest))); + } + + /** + * Returns the digest object type if an object digest info is used. + *

    + *

      + *
    • 0 - publicKey - A hash of the public key of the holder must be + * passed.
    • + *
    • 1 - publicKeyCert - A hash of the public key certificate of the + * holder must be passed.
    • + *
    • 2 - otherObjectDigest - A hash of some other object type must be + * passed. otherObjectTypeID must not be empty.
    • + *
    + *

    + * + * @return The digest object type or -1 if no object digest info is set. + */ + public int DigestedObjectType + { + get + { + ObjectDigestInfo odi = holder.ObjectDigestInfo; + + return odi == null + ? -1 + : odi.DigestedObjectType.Value.IntValue; + } + } + + /** + * Returns the other object type ID if an object digest info is used. + * + * @return The other object type ID or null if no object + * digest info is set. + */ + public string DigestAlgorithm + { + get + { + ObjectDigestInfo odi = holder.ObjectDigestInfo; + + return odi == null + ? null + : odi.DigestAlgorithm.Algorithm.Id; + } + } + + /** + * Returns the hash if an object digest info is used. + * + * @return The hash or null if no object digest info is set. + */ + public byte[] GetObjectDigest() + { + ObjectDigestInfo odi = holder.ObjectDigestInfo; + + return odi == null + ? null + : odi.ObjectDigest.GetBytes(); + } + + /** + * Returns the digest algorithm ID if an object digest info is used. + * + * @return The digest algorithm ID or null if no object + * digest info is set. + */ + public string OtherObjectTypeID + { + get + { + ObjectDigestInfo odi = holder.ObjectDigestInfo; + + return odi == null + ? null + : odi.OtherObjectTypeID.Id; + } + } + + private GeneralNames GenerateGeneralNames( + X509Name principal) + { +// return GeneralNames.GetInstance(new DerSequence(new GeneralName(principal))); + return new GeneralNames(new GeneralName(principal)); + } + + private bool MatchesDN( + X509Name subject, + GeneralNames targets) + { + GeneralName[] names = targets.GetNames(); + + for (int i = 0; i != names.Length; i++) + { + GeneralName gn = names[i]; + + if (gn.TagNo == GeneralName.DirectoryName) + { + try + { + if (X509Name.GetInstance(gn.Name).Equivalent(subject)) + { + return true; + } + } + catch (Exception) + { + } + } + } + + return false; + } + + private object[] GetNames( + GeneralName[] names) + { + int count = 0; + for (int i = 0; i != names.Length; i++) + { + if (names[i].TagNo == GeneralName.DirectoryName) + { + ++count; + } + } + + object[] result = new object[count]; + + int pos = 0; + for (int i = 0; i != names.Length; i++) + { + if (names[i].TagNo == GeneralName.DirectoryName) + { + result[pos++] = X509Name.GetInstance(names[i].Name); + } + } + + return result; + } + + private X509Name[] GetPrincipals( + GeneralNames names) + { + object[] p = this.GetNames(names.GetNames()); + + int count = 0; + + for (int i = 0; i != p.Length; i++) + { + if (p[i] is X509Name) + { + ++count; + } + } + + X509Name[] result = new X509Name[count]; + + int pos = 0; + for (int i = 0; i != p.Length; i++) + { + if (p[i] is X509Name) + { + result[pos++] = (X509Name)p[i]; + } + } + + return result; + } + + /** + * Return any principal objects inside the attribute certificate holder entity names field. + * + * @return an array of IPrincipal objects (usually X509Name), null if no entity names field is set. + */ + public X509Name[] GetEntityNames() + { + if (holder.EntityName != null) + { + return GetPrincipals(holder.EntityName); + } + + return null; + } + + /** + * Return the principals associated with the issuer attached to this holder + * + * @return an array of principals, null if no BaseCertificateID is set. + */ + public X509Name[] GetIssuer() + { + if (holder.BaseCertificateID != null) + { + return GetPrincipals(holder.BaseCertificateID.Issuer); + } + + return null; + } + + /** + * Return the serial number associated with the issuer attached to this holder. + * + * @return the certificate serial number, null if no BaseCertificateID is set. + */ + public BigInteger SerialNumber + { + get + { + if (holder.BaseCertificateID != null) + { + return holder.BaseCertificateID.Serial.Value; + } + + return null; + } + } + + public object Clone() + { + return new AttributeCertificateHolder((Asn1Sequence)holder.ToAsn1Object()); + } + + public bool Match( +// Certificate cert) + X509Certificate x509Cert) + { +// if (!(cert is X509Certificate)) +// { +// return false; +// } +// +// X509Certificate x509Cert = (X509Certificate)cert; + + try + { + if (holder.BaseCertificateID != null) + { + return holder.BaseCertificateID.Serial.Value.Equals(x509Cert.SerialNumber) + && MatchesDN(PrincipalUtilities.GetIssuerX509Principal(x509Cert), holder.BaseCertificateID.Issuer); + } + + if (holder.EntityName != null) + { + if (MatchesDN(PrincipalUtilities.GetSubjectX509Principal(x509Cert), holder.EntityName)) + { + return true; + } + } + + if (holder.ObjectDigestInfo != null) + { + IDigest md = null; + try + { + md = DigestUtilities.GetDigest(DigestAlgorithm); + } + catch (Exception) + { + return false; + } + + switch (DigestedObjectType) + { + case ObjectDigestInfo.PublicKey: + { + // TODO: DSA Dss-parms + + //byte[] b = x509Cert.GetPublicKey().getEncoded(); + // TODO Is this the right way to encode? + byte[] b = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo( + x509Cert.GetPublicKey()).GetEncoded(); + md.BlockUpdate(b, 0, b.Length); + break; + } + + case ObjectDigestInfo.PublicKeyCert: + { + byte[] b = x509Cert.GetEncoded(); + md.BlockUpdate(b, 0, b.Length); + break; + } + + // TODO Default handler? + } + + // TODO Shouldn't this be the other way around? + if (!Arrays.AreEqual(DigestUtilities.DoFinal(md), GetObjectDigest())) + { + return false; + } + } + } + catch (CertificateEncodingException) + { + return false; + } + + return false; + } + + public override bool Equals( + object obj) + { + if (obj == this) + { + return true; + } + + if (!(obj is AttributeCertificateHolder)) + { + return false; + } + + AttributeCertificateHolder other = (AttributeCertificateHolder)obj; + + return this.holder.Equals(other.holder); + } + + public override int GetHashCode() + { + return this.holder.GetHashCode(); + } + + public bool Match( + object obj) + { + if (!(obj is X509Certificate)) + { + return false; + } + +// return Match((Certificate)obj); + return Match((X509Certificate)obj); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateHolder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateHolder.cs.meta new file mode 100644 index 00000000..4317107f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateHolder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 938387042cf639245ad61e6176058eca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateIssuer.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateIssuer.cs new file mode 100644 index 00000000..26d4b0d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateIssuer.cs @@ -0,0 +1,203 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /** + * Carrying class for an attribute certificate issuer. + */ + public class AttributeCertificateIssuer + //: CertSelector, Selector + : IX509Selector + { + internal readonly Asn1Encodable form; + + /** + * Set the issuer directly with the ASN.1 structure. + * + * @param issuer The issuer + */ + public AttributeCertificateIssuer( + AttCertIssuer issuer) + { + form = issuer.Issuer; + } + + public AttributeCertificateIssuer( + X509Name principal) + { +// form = new V2Form(GeneralNames.GetInstance(new DerSequence(new GeneralName(principal)))); + form = new V2Form(new GeneralNames(new GeneralName(principal))); + } + + private object[] GetNames() + { + GeneralNames name; + if (form is V2Form) + { + name = ((V2Form)form).IssuerName; + } + else + { + name = (GeneralNames)form; + } + + GeneralName[] names = name.GetNames(); + + int count = 0; + for (int i = 0; i != names.Length; i++) + { + if (names[i].TagNo == GeneralName.DirectoryName) + { + ++count; + } + } + + object[] result = new object[count]; + + int pos = 0; + for (int i = 0; i != names.Length; i++) + { + if (names[i].TagNo == GeneralName.DirectoryName) + { + result[pos++] = X509Name.GetInstance(names[i].Name); + } + } + + return result; + } + + /// Return any principal objects inside the attribute certificate issuer object. + /// An array of IPrincipal objects (usually X509Principal). + public X509Name[] GetPrincipals() + { + object[] p = this.GetNames(); + + int count = 0; + for (int i = 0; i != p.Length; i++) + { + if (p[i] is X509Name) + { + ++count; + } + } + + X509Name[] result = new X509Name[count]; + + int pos = 0; + for (int i = 0; i != p.Length; i++) + { + if (p[i] is X509Name) + { + result[pos++] = (X509Name)p[i]; + } + } + + return result; + } + + private bool MatchesDN( + X509Name subject, + GeneralNames targets) + { + GeneralName[] names = targets.GetNames(); + + for (int i = 0; i != names.Length; i++) + { + GeneralName gn = names[i]; + + if (gn.TagNo == GeneralName.DirectoryName) + { + try + { + if (X509Name.GetInstance(gn.Name).Equivalent(subject)) + { + return true; + } + } + catch (Exception) + { + } + } + } + + return false; + } + + public object Clone() + { + return new AttributeCertificateIssuer(AttCertIssuer.GetInstance(form)); + } + + public bool Match( +// Certificate cert) + X509Certificate x509Cert) + { +// if (!(cert is X509Certificate)) +// { +// return false; +// } +// +// X509Certificate x509Cert = (X509Certificate)cert; + + if (form is V2Form) + { + V2Form issuer = (V2Form) form; + if (issuer.BaseCertificateID != null) + { + return issuer.BaseCertificateID.Serial.Value.Equals(x509Cert.SerialNumber) + && MatchesDN(x509Cert.IssuerDN, issuer.BaseCertificateID.Issuer); + } + + return MatchesDN(x509Cert.SubjectDN, issuer.IssuerName); + } + + return MatchesDN(x509Cert.SubjectDN, (GeneralNames) form); + } + + public override bool Equals( + object obj) + { + if (obj == this) + { + return true; + } + + if (!(obj is AttributeCertificateIssuer)) + { + return false; + } + + AttributeCertificateIssuer other = (AttributeCertificateIssuer)obj; + + return this.form.Equals(other.form); + } + + public override int GetHashCode() + { + return this.form.GetHashCode(); + } + + public bool Match( + object obj) + { + if (!(obj is X509Certificate)) + { + return false; + } + + //return Match((Certificate)obj); + return Match((X509Certificate)obj); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateIssuer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateIssuer.cs.meta new file mode 100644 index 00000000..ed5fc272 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/AttributeCertificateIssuer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: acf2171ca98d9a84b9b2f630c3ed992f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509AttributeCertificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509AttributeCertificate.cs new file mode 100644 index 00000000..119e1d94 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509AttributeCertificate.cs @@ -0,0 +1,61 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// Interface for an X.509 Attribute Certificate. + public interface IX509AttributeCertificate + : IX509Extension + { + /// The version number for the certificate. + int Version { get; } + + /// The serial number for the certificate. + BigInteger SerialNumber { get; } + + /// The UTC DateTime before which the certificate is not valid. + DateTime NotBefore { get; } + + /// The UTC DateTime after which the certificate is not valid. + DateTime NotAfter { get; } + + /// The holder of the certificate. + AttributeCertificateHolder Holder { get; } + + /// The issuer details for the certificate. + AttributeCertificateIssuer Issuer { get; } + + /// Return the attributes contained in the attribute block in the certificate. + /// An array of attributes. + X509Attribute[] GetAttributes(); + + /// Return the attributes with the same type as the passed in oid. + /// The object identifier we wish to match. + /// An array of matched attributes, null if there is no match. + X509Attribute[] GetAttributes(string oid); + + bool[] GetIssuerUniqueID(); + + bool IsValidNow { get; } + bool IsValid(DateTime date); + + void CheckValidity(); + void CheckValidity(DateTime date); + + byte[] GetSignature(); + + void Verify(AsymmetricKeyParameter publicKey); + + /// Return an ASN.1 encoded byte array representing the attribute certificate. + /// An ASN.1 encoded byte array. + /// If the certificate cannot be encoded. + byte[] GetEncoded(); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509AttributeCertificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509AttributeCertificate.cs.meta new file mode 100644 index 00000000..c3a5e96d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509AttributeCertificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3760a7b484ecf0240b37666571cfc6a4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509Extension.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509Extension.cs new file mode 100644 index 00000000..1e3ab12c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509Extension.cs @@ -0,0 +1,31 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + public interface IX509Extension + { + /// + /// Get all critical extension values, by oid + /// + /// IDictionary with string (OID) keys and Asn1OctetString values + ISet GetCriticalExtensionOids(); + + /// + /// Get all non-critical extension values, by oid + /// + /// IDictionary with string (OID) keys and Asn1OctetString values + ISet GetNonCriticalExtensionOids(); + + [Obsolete("Use version taking a DerObjectIdentifier instead")] + Asn1OctetString GetExtensionValue(string oid); + + Asn1OctetString GetExtensionValue(DerObjectIdentifier oid); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509Extension.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509Extension.cs.meta new file mode 100644 index 00000000..3d5a21b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/IX509Extension.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8a0d122875ecdab4796b2617ab2d97eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PEMParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PEMParser.cs new file mode 100644 index 00000000..7d41b694 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PEMParser.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + class PemParser + { + private readonly string _header1; + private readonly string _header2; + private readonly string _footer1; + private readonly string _footer2; + + internal PemParser( + string type) + { + _header1 = "-----BEGIN " + type + "-----"; + _header2 = "-----BEGIN X509 " + type + "-----"; + _footer1 = "-----END " + type + "-----"; + _footer2 = "-----END X509 " + type + "-----"; + } + + private string ReadLine( + Stream inStream) + { + int c; + StringBuilder l = new StringBuilder(); + + do + { + while (((c = inStream.ReadByte()) != '\r') && c != '\n' && (c >= 0)) + { + if (c == '\r') + { + continue; + } + + l.Append((char)c); + } + } + while (c >= 0 && l.Length == 0); + + if (c < 0) + { + return null; + } + + return l.ToString(); + } + + internal Asn1Sequence ReadPemObject( + Stream inStream) + { + string line; + StringBuilder pemBuf = new StringBuilder(); + + while ((line = ReadLine(inStream)) != null) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(line, _header1) || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(line, _header2)) + { + break; + } + } + + while ((line = ReadLine(inStream)) != null) + { + if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(line, _footer1) || BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.StartsWith(line, _footer2)) + { + break; + } + + pemBuf.Append(line); + } + + if (pemBuf.Length != 0) + { + Asn1Object o = Asn1Object.FromByteArray(Base64.Decode(pemBuf.ToString())); + + if (!(o is Asn1Sequence)) + { + throw new IOException("malformed PEM data encountered"); + } + + return (Asn1Sequence) o; + } + + return null; + } + } +} + +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PEMParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PEMParser.cs.meta new file mode 100644 index 00000000..5a347ec6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PEMParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c0af44d6133b484fad764d838af9600 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PrincipalUtil.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PrincipalUtil.cs new file mode 100644 index 00000000..674e548a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PrincipalUtil.cs @@ -0,0 +1,74 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// + /// A utility class that will extract X509Principal objects from X.509 certificates. + ///

    + /// Use this in preference to trying to recreate a principal from a string, not all + /// DNs are what they should be, so it's best to leave them encoded where they + /// can be.

    + ///
    + public class PrincipalUtilities + { + /// Return the issuer of the given cert as an X509Principal. + public static X509Name GetIssuerX509Principal( + X509Certificate cert) + { + try + { + TbsCertificateStructure tbsCert = TbsCertificateStructure.GetInstance( + Asn1Object.FromByteArray(cert.GetTbsCertificate())); + + return tbsCert.Issuer; + } + catch (Exception e) + { + throw new CertificateEncodingException("Could not extract issuer", e); + } + } + + /// Return the subject of the given cert as an X509Principal. + public static X509Name GetSubjectX509Principal( + X509Certificate cert) + { + try + { + TbsCertificateStructure tbsCert = TbsCertificateStructure.GetInstance( + Asn1Object.FromByteArray(cert.GetTbsCertificate())); + + return tbsCert.Subject; + } + catch (Exception e) + { + throw new CertificateEncodingException("Could not extract subject", e); + } + } + + /// Return the issuer of the given CRL as an X509Principal. + public static X509Name GetIssuerX509Principal( + X509Crl crl) + { + try + { + TbsCertificateList tbsCertList = TbsCertificateList.GetInstance( + Asn1Object.FromByteArray(crl.GetTbsCertList())); + + return tbsCertList.Issuer; + } + catch (Exception e) + { + throw new CrlException("Could not extract issuer", e); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PrincipalUtil.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PrincipalUtil.cs.meta new file mode 100644 index 00000000..62598112 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/PrincipalUtil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: afc0a35c1a82d7047807b55049604a40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/SubjectPublicKeyInfoFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/SubjectPublicKeyInfoFactory.cs new file mode 100644 index 00000000..75d5f379 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/SubjectPublicKeyInfoFactory.cs @@ -0,0 +1,217 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.EdEC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// + /// A factory to produce Public Key Info Objects. + /// + public sealed class SubjectPublicKeyInfoFactory + { + private SubjectPublicKeyInfoFactory() + { + } + + /// + /// Create a Subject Public Key Info object for a given public key. + /// + /// One of ElGammalPublicKeyParameters, DSAPublicKeyParameter, DHPublicKeyParameters, RsaKeyParameters or ECPublicKeyParameters + /// A subject public key info object. + /// Throw exception if object provided is not one of the above. + public static SubjectPublicKeyInfo CreateSubjectPublicKeyInfo( + AsymmetricKeyParameter publicKey) + { + if (publicKey == null) + throw new ArgumentNullException("publicKey"); + if (publicKey.IsPrivate) + throw new ArgumentException("Private key passed - public key expected.", "publicKey"); + + if (publicKey is ElGamalPublicKeyParameters) + { + ElGamalPublicKeyParameters _key = (ElGamalPublicKeyParameters)publicKey; + ElGamalParameters kp = _key.Parameters; + + SubjectPublicKeyInfo info = new SubjectPublicKeyInfo( + new AlgorithmIdentifier( + OiwObjectIdentifiers.ElGamalAlgorithm, + new ElGamalParameter(kp.P, kp.G).ToAsn1Object()), + new DerInteger(_key.Y)); + + return info; + } + + if (publicKey is DsaPublicKeyParameters) + { + DsaPublicKeyParameters _key = (DsaPublicKeyParameters) publicKey; + DsaParameters kp = _key.Parameters; + Asn1Encodable ae = kp == null + ? null + : new DsaParameter(kp.P, kp.Q, kp.G).ToAsn1Object(); + + return new SubjectPublicKeyInfo( + new AlgorithmIdentifier(X9ObjectIdentifiers.IdDsa, ae), + new DerInteger(_key.Y)); + } + + if (publicKey is DHPublicKeyParameters) + { + DHPublicKeyParameters _key = (DHPublicKeyParameters) publicKey; + DHParameters kp = _key.Parameters; + + SubjectPublicKeyInfo info = new SubjectPublicKeyInfo( + new AlgorithmIdentifier( + _key.AlgorithmOid, + new DHParameter(kp.P, kp.G, kp.L).ToAsn1Object()), + new DerInteger(_key.Y)); + + return info; + } // End of DH + + if (publicKey is RsaKeyParameters) + { + RsaKeyParameters _key = (RsaKeyParameters) publicKey; + + SubjectPublicKeyInfo info = new SubjectPublicKeyInfo( + new AlgorithmIdentifier(PkcsObjectIdentifiers.RsaEncryption, DerNull.Instance), + new RsaPublicKeyStructure(_key.Modulus, _key.Exponent).ToAsn1Object()); + + return info; + } // End of RSA. + + if (publicKey is ECPublicKeyParameters) + { + ECPublicKeyParameters _key = (ECPublicKeyParameters) publicKey; + + if (_key.AlgorithmName == "ECGOST3410") + { + if (_key.PublicKeyParamSet == null) + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("Not a CryptoPro parameter set"); + + ECPoint q = _key.Q.Normalize(); + BigInteger bX = q.AffineXCoord.ToBigInteger(); + BigInteger bY = q.AffineYCoord.ToBigInteger(); + + byte[] encKey = new byte[64]; + ExtractBytes(encKey, 0, bX); + ExtractBytes(encKey, 32, bY); + + Gost3410PublicKeyAlgParameters gostParams = new Gost3410PublicKeyAlgParameters( + _key.PublicKeyParamSet, CryptoProObjectIdentifiers.GostR3411x94CryptoProParamSet); + + AlgorithmIdentifier algID = new AlgorithmIdentifier( + CryptoProObjectIdentifiers.GostR3410x2001, + gostParams.ToAsn1Object()); + + return new SubjectPublicKeyInfo(algID, new DerOctetString(encKey)); + } + else + { + X962Parameters x962; + if (_key.PublicKeyParamSet == null) + { + ECDomainParameters kp = _key.Parameters; + X9ECParameters ecP = new X9ECParameters(kp.Curve, kp.G, kp.N, kp.H, kp.GetSeed()); + + x962 = new X962Parameters(ecP); + } + else + { + x962 = new X962Parameters(_key.PublicKeyParamSet); + } + + byte[] pubKey = _key.Q.GetEncoded(false); + + AlgorithmIdentifier algID = new AlgorithmIdentifier( + X9ObjectIdentifiers.IdECPublicKey, x962.ToAsn1Object()); + + return new SubjectPublicKeyInfo(algID, pubKey); + } + } // End of EC + + if (publicKey is Gost3410PublicKeyParameters) + { + Gost3410PublicKeyParameters _key = (Gost3410PublicKeyParameters) publicKey; + + if (_key.PublicKeyParamSet == null) + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("Not a CryptoPro parameter set"); + + byte[] keyEnc = _key.Y.ToByteArrayUnsigned(); + byte[] keyBytes = new byte[keyEnc.Length]; + + for (int i = 0; i != keyBytes.Length; i++) + { + keyBytes[i] = keyEnc[keyEnc.Length - 1 - i]; // must be little endian + } + + Gost3410PublicKeyAlgParameters algParams = new Gost3410PublicKeyAlgParameters( + _key.PublicKeyParamSet, CryptoProObjectIdentifiers.GostR3411x94CryptoProParamSet); + + AlgorithmIdentifier algID = new AlgorithmIdentifier( + CryptoProObjectIdentifiers.GostR3410x94, + algParams.ToAsn1Object()); + + return new SubjectPublicKeyInfo(algID, new DerOctetString(keyBytes)); + } + + if (publicKey is X448PublicKeyParameters) + { + X448PublicKeyParameters key = (X448PublicKeyParameters)publicKey; + + return new SubjectPublicKeyInfo(new AlgorithmIdentifier(EdECObjectIdentifiers.id_X448), key.GetEncoded()); + } + + if (publicKey is X25519PublicKeyParameters) + { + X25519PublicKeyParameters key = (X25519PublicKeyParameters)publicKey; + + return new SubjectPublicKeyInfo(new AlgorithmIdentifier(EdECObjectIdentifiers.id_X25519), key.GetEncoded()); + } + + if (publicKey is Ed448PublicKeyParameters) + { + Ed448PublicKeyParameters key = (Ed448PublicKeyParameters)publicKey; + + return new SubjectPublicKeyInfo(new AlgorithmIdentifier(EdECObjectIdentifiers.id_Ed448), key.GetEncoded()); + } + + if (publicKey is Ed25519PublicKeyParameters) + { + Ed25519PublicKeyParameters key = (Ed25519PublicKeyParameters)publicKey; + + return new SubjectPublicKeyInfo(new AlgorithmIdentifier(EdECObjectIdentifiers.id_Ed25519), key.GetEncoded()); + } + + throw new ArgumentException("Class provided no convertible: " + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.GetTypeName(publicKey)); + } + + private static void ExtractBytes( + byte[] encKey, + int offset, + BigInteger bI) + { + byte[] val = bI.ToByteArray(); + int n = (bI.BitLength + 7) / 8; + + for (int i = 0; i < n; ++i) + { + encKey[offset + i] = val[val.Length - 1 - i]; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/SubjectPublicKeyInfoFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/SubjectPublicKeyInfoFactory.cs.meta new file mode 100644 index 00000000..bb896e5d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/SubjectPublicKeyInfoFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd36b9e69934c4e4a841a43e6b65c904 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509AttrCertParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509AttrCertParser.cs new file mode 100644 index 00000000..380789fb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509AttrCertParser.cs @@ -0,0 +1,177 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + public class X509AttrCertParser + { + private static readonly PemParser PemAttrCertParser = new PemParser("ATTRIBUTE CERTIFICATE"); + + private Asn1Set sData; + private int sDataObjectCount; + private Stream currentStream; + + private IX509AttributeCertificate ReadDerCertificate( + Asn1InputStream dIn) + { + Asn1Sequence seq = (Asn1Sequence)dIn.ReadObject(); + + if (seq.Count > 1 && seq[0] is DerObjectIdentifier) + { + if (seq[0].Equals(PkcsObjectIdentifiers.SignedData)) + { + sData = SignedData.GetInstance( + Asn1Sequence.GetInstance((Asn1TaggedObject) seq[1], true)).Certificates; + + return GetCertificate(); + } + } + +// return new X509V2AttributeCertificate(seq.getEncoded()); + return new X509V2AttributeCertificate(AttributeCertificate.GetInstance(seq)); + } + + private IX509AttributeCertificate GetCertificate() + { + if (sData != null) + { + while (sDataObjectCount < sData.Count) + { + object obj = sData[sDataObjectCount++]; + + if (obj is Asn1TaggedObject && ((Asn1TaggedObject)obj).TagNo == 2) + { + //return new X509V2AttributeCertificate( + // Asn1Sequence.GetInstance((Asn1TaggedObject)obj, false).GetEncoded()); + return new X509V2AttributeCertificate( + AttributeCertificate.GetInstance( + Asn1Sequence.GetInstance((Asn1TaggedObject)obj, false))); + } + } + } + + return null; + } + + private IX509AttributeCertificate ReadPemCertificate( + Stream inStream) + { + Asn1Sequence seq = PemAttrCertParser.ReadPemObject(inStream); + + return seq == null + ? null + //: new X509V2AttributeCertificate(seq.getEncoded()); + : new X509V2AttributeCertificate(AttributeCertificate.GetInstance(seq)); + } + + /// + /// Create loading data from byte array. + /// + /// + public IX509AttributeCertificate ReadAttrCert( + byte[] input) + { + return ReadAttrCert(new MemoryStream(input, false)); + } + + /// + /// Create loading data from byte array. + /// + /// + public ICollection ReadAttrCerts( + byte[] input) + { + return ReadAttrCerts(new MemoryStream(input, false)); + } + + /** + * Generates a certificate object and initializes it with the data + * read from the input stream inStream. + */ + public IX509AttributeCertificate ReadAttrCert( + Stream inStream) + { + if (inStream == null) + throw new ArgumentNullException("inStream"); + if (!inStream.CanRead) + throw new ArgumentException("inStream must be read-able", "inStream"); + + if (currentStream == null) + { + currentStream = inStream; + sData = null; + sDataObjectCount = 0; + } + else if (currentStream != inStream) // reset if input stream has changed + { + currentStream = inStream; + sData = null; + sDataObjectCount = 0; + } + + try + { + if (sData != null) + { + if (sDataObjectCount != sData.Count) + { + return GetCertificate(); + } + + sData = null; + sDataObjectCount = 0; + return null; + } + + PushbackStream pis = new PushbackStream(inStream); + int tag = pis.ReadByte(); + + if (tag < 0) + return null; + + pis.Unread(tag); + + if (tag != 0x30) // assume ascii PEM encoded. + { + return ReadPemCertificate(pis); + } + + return ReadDerCertificate(new Asn1InputStream(pis)); + } + catch (Exception e) + { + throw new CertificateException(e.ToString()); + } + } + + /** + * Returns a (possibly empty) collection view of the certificates + * read from the given input stream inStream. + */ + public ICollection ReadAttrCerts( + Stream inStream) + { + IX509AttributeCertificate attrCert; + IList attrCerts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + while ((attrCert = ReadAttrCert(inStream)) != null) + { + attrCerts.Add(attrCert); + } + + return attrCerts; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509AttrCertParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509AttrCertParser.cs.meta new file mode 100644 index 00000000..0d7b9543 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509AttrCertParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb17e3130c56fdb44a2169c7946d70f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Attribute.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Attribute.cs new file mode 100644 index 00000000..6f9aadba --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Attribute.cs @@ -0,0 +1,80 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /** + * Class for carrying the values in an X.509 Attribute. + */ + public class X509Attribute + : Asn1Encodable + { + private readonly AttributeX509 attr; + + /** + * @param at an object representing an attribute. + */ + internal X509Attribute( + Asn1Encodable at) + { + this.attr = AttributeX509.GetInstance(at); + } + + /** + * Create an X.509 Attribute with the type given by the passed in oid and + * the value represented by an ASN.1 Set containing value. + * + * @param oid type of the attribute + * @param value value object to go into the atribute's value set. + */ + public X509Attribute( + string oid, + Asn1Encodable value) + { + this.attr = new AttributeX509(new DerObjectIdentifier(oid), new DerSet(value)); + } + + /** + * Create an X.59 Attribute with the type given by the passed in oid and the + * value represented by an ASN.1 Set containing the objects in value. + * + * @param oid type of the attribute + * @param value vector of values to go in the attribute's value set. + */ + public X509Attribute( + string oid, + Asn1EncodableVector value) + { + this.attr = new AttributeX509(new DerObjectIdentifier(oid), new DerSet(value)); + } + + public string Oid + { + get { return attr.AttrType.Id; } + } + + public Asn1Encodable[] GetValues() + { + Asn1Set s = attr.AttrValues; + Asn1Encodable[] values = new Asn1Encodable[s.Count]; + + for (int i = 0; i != s.Count; i++) + { + values[i] = (Asn1Encodable)s[i]; + } + + return values; + } + + public override Asn1Object ToAsn1Object() + { + return attr.ToAsn1Object(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Attribute.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Attribute.cs.meta new file mode 100644 index 00000000..33aea968 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Attribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8689ae3e6241dab498e32e4185da76fc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertPairParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertPairParser.cs new file mode 100644 index 00000000..a73c1089 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertPairParser.cs @@ -0,0 +1,99 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + public class X509CertPairParser + { + private Stream currentStream; + + private X509CertificatePair ReadDerCrossCertificatePair( + Stream inStream) + { + Asn1InputStream dIn = new Asn1InputStream(inStream);//, ProviderUtil.getReadLimit(in)); + Asn1Sequence seq = (Asn1Sequence)dIn.ReadObject(); + CertificatePair pair = CertificatePair.GetInstance(seq); + return new X509CertificatePair(pair); + } + + /// + /// Create loading data from byte array. + /// + /// + public X509CertificatePair ReadCertPair( + byte[] input) + { + return ReadCertPair(new MemoryStream(input, false)); + } + + /// + /// Create loading data from byte array. + /// + /// + public ICollection ReadCertPairs( + byte[] input) + { + return ReadCertPairs(new MemoryStream(input, false)); + } + + public X509CertificatePair ReadCertPair( + Stream inStream) + { + if (inStream == null) + throw new ArgumentNullException("inStream"); + if (!inStream.CanRead) + throw new ArgumentException("inStream must be read-able", "inStream"); + + if (currentStream == null) + { + currentStream = inStream; + } + else if (currentStream != inStream) // reset if input stream has changed + { + currentStream = inStream; + } + + try + { + PushbackStream pis = new PushbackStream(inStream); + int tag = pis.ReadByte(); + + if (tag < 0) + return null; + + pis.Unread(tag); + + return ReadDerCrossCertificatePair(pis); + } + catch (Exception e) + { + throw new CertificateException(e.ToString()); + } + } + + public ICollection ReadCertPairs( + Stream inStream) + { + X509CertificatePair certPair; + IList certPairs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + while ((certPair = ReadCertPair(inStream)) != null) + { + certPairs.Add(certPair); + } + + return certPairs; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertPairParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertPairParser.cs.meta new file mode 100644 index 00000000..9b0c612e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertPairParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8127558424a84ff4b96f41dbcb52b8f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Certificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Certificate.cs new file mode 100644 index 00000000..75041f85 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Certificate.cs @@ -0,0 +1,608 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Misc; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// + /// An Object representing an X509 Certificate. + /// Has static methods for loading Certificates encoded in many forms that return X509Certificate Objects. + /// + public class X509Certificate + : X509ExtensionBase +// , PKCS12BagAttributeCarrier + { + private readonly X509CertificateStructure c; +// private Hashtable pkcs12Attributes = new Hashtable(); +// private ArrayList pkcs12Ordering = new ArrayList(); + private readonly BasicConstraints basicConstraints; + private readonly bool[] keyUsage; + + private bool hashValueSet; + private int hashValue; + + protected X509Certificate() + { + } + + public X509Certificate( + X509CertificateStructure c) + { + this.c = c; + + try + { + Asn1OctetString str = this.GetExtensionValue(new DerObjectIdentifier("2.5.29.19")); + + if (str != null) + { + basicConstraints = BasicConstraints.GetInstance( + X509ExtensionUtilities.FromExtensionValue(str)); + } + } + catch (Exception e) + { + throw new CertificateParsingException("cannot construct BasicConstraints: " + e); + } + + try + { + Asn1OctetString str = this.GetExtensionValue(new DerObjectIdentifier("2.5.29.15")); + + if (str != null) + { + DerBitString bits = DerBitString.GetInstance( + X509ExtensionUtilities.FromExtensionValue(str)); + + byte[] bytes = bits.GetBytes(); + int length = (bytes.Length * 8) - bits.PadBits; + + keyUsage = new bool[(length < 9) ? 9 : length]; + + for (int i = 0; i != length; i++) + { +// keyUsage[i] = (bytes[i / 8] & (0x80 >>> (i % 8))) != 0; + keyUsage[i] = (bytes[i / 8] & (0x80 >> (i % 8))) != 0; + } + } + else + { + keyUsage = null; + } + } + catch (Exception e) + { + throw new CertificateParsingException("cannot construct KeyUsage: " + e); + } + } + +// internal X509Certificate( +// Asn1Sequence seq) +// { +// this.c = X509CertificateStructure.GetInstance(seq); +// } + +// /// +// /// Load certificate from byte array. +// /// +// /// Byte array containing encoded X509Certificate. +// public X509Certificate( +// byte[] encoded) +// : this((Asn1Sequence) new Asn1InputStream(encoded).ReadObject()) +// { +// } +// +// /// +// /// Load certificate from Stream. +// /// Must be positioned at start of certificate. +// /// +// /// +// public X509Certificate( +// Stream input) +// : this((Asn1Sequence) new Asn1InputStream(input).ReadObject()) +// { +// } + + public virtual X509CertificateStructure CertificateStructure + { + get { return c; } + } + + /// + /// Return true if the current time is within the start and end times nominated on the certificate. + /// + /// true id certificate is valid for the current time. + public virtual bool IsValidNow + { + get { return IsValid(DateTime.UtcNow); } + } + + /// + /// Return true if the nominated time is within the start and end times nominated on the certificate. + /// + /// The time to test validity against. + /// True if certificate is valid for nominated time. + public virtual bool IsValid( + DateTime time) + { + return time.CompareTo(NotBefore) >= 0 && time.CompareTo(NotAfter) <= 0; + } + + /// + /// Checks if the current date is within certificate's validity period. + /// + public virtual void CheckValidity() + { + this.CheckValidity(DateTime.UtcNow); + } + + /// + /// Checks if the given date is within certificate's validity period. + /// + /// if the certificate is expired by given date + /// if the certificate is not yet valid on given date + public virtual void CheckValidity( + DateTime time) + { + if (time.CompareTo(NotAfter) > 0) + throw new CertificateExpiredException("certificate expired on " + c.EndDate.GetTime()); + if (time.CompareTo(NotBefore) < 0) + throw new CertificateNotYetValidException("certificate not valid until " + c.StartDate.GetTime()); + } + + /// + /// Return the certificate's version. + /// + /// An integer whose value Equals the version of the cerficate. + public virtual int Version + { + get { return c.Version; } + } + + /// + /// Return a BigInteger containing the serial number. + /// + /// The Serial number. + public virtual BigInteger SerialNumber + { + get { return c.SerialNumber.Value; } + } + + /// + /// Get the Issuer Distinguished Name. (Who signed the certificate.) + /// + /// And X509Object containing name and value pairs. +// public IPrincipal IssuerDN + public virtual X509Name IssuerDN + { + get { return c.Issuer; } + } + + /// + /// Get the subject of this certificate. + /// + /// An X509Name object containing name and value pairs. +// public IPrincipal SubjectDN + public virtual X509Name SubjectDN + { + get { return c.Subject; } + } + + /// + /// The time that this certificate is valid from. + /// + /// A DateTime object representing that time in the local time zone. + public virtual DateTime NotBefore + { + get { return c.StartDate.ToDateTime(); } + } + + /// + /// The time that this certificate is valid up to. + /// + /// A DateTime object representing that time in the local time zone. + public virtual DateTime NotAfter + { + get { return c.EndDate.ToDateTime(); } + } + + /// + /// Return the Der encoded TbsCertificate data. + /// This is the certificate component less the signature. + /// To Get the whole certificate call the GetEncoded() member. + /// + /// A byte array containing the Der encoded Certificate component. + public virtual byte[] GetTbsCertificate() + { + return c.TbsCertificate.GetDerEncoded(); + } + + /// + /// The signature. + /// + /// A byte array containg the signature of the certificate. + public virtual byte[] GetSignature() + { + return c.GetSignatureOctets(); + } + + /// + /// A meaningful version of the Signature Algorithm. (EG SHA1WITHRSA) + /// + /// A sting representing the signature algorithm. + public virtual string SigAlgName + { + get { return SignerUtilities.GetEncodingName(c.SignatureAlgorithm.Algorithm); } + } + + /// + /// Get the Signature Algorithms Object ID. + /// + /// A string containg a '.' separated object id. + public virtual string SigAlgOid + { + get { return c.SignatureAlgorithm.Algorithm.Id; } + } + + /// + /// Get the signature algorithms parameters. (EG DSA Parameters) + /// + /// A byte array containing the Der encoded version of the parameters or null if there are none. + public virtual byte[] GetSigAlgParams() + { + if (c.SignatureAlgorithm.Parameters != null) + { + return c.SignatureAlgorithm.Parameters.GetDerEncoded(); + } + + return null; + } + + /// + /// Get the issuers UID. + /// + /// A DerBitString. + public virtual DerBitString IssuerUniqueID + { + get { return c.TbsCertificate.IssuerUniqueID; } + } + + /// + /// Get the subjects UID. + /// + /// A DerBitString. + public virtual DerBitString SubjectUniqueID + { + get { return c.TbsCertificate.SubjectUniqueID; } + } + + /// + /// Get a key usage guidlines. + /// + public virtual bool[] GetKeyUsage() + { + return keyUsage == null ? null : (bool[]) keyUsage.Clone(); + } + + // TODO Replace with something that returns a list of DerObjectIdentifier + public virtual IList GetExtendedKeyUsage() + { + Asn1OctetString str = this.GetExtensionValue(new DerObjectIdentifier("2.5.29.37")); + + if (str == null) + return null; + + try + { + Asn1Sequence seq = Asn1Sequence.GetInstance( + X509ExtensionUtilities.FromExtensionValue(str)); + + IList list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + foreach (DerObjectIdentifier oid in seq) + { + list.Add(oid.Id); + } + + return list; + } + catch (Exception e) + { + throw new CertificateParsingException("error processing extended key usage extension", e); + } + } + + public virtual int GetBasicConstraints() + { + if (basicConstraints != null && basicConstraints.IsCA()) + { + if (basicConstraints.PathLenConstraint == null) + { + return int.MaxValue; + } + + return basicConstraints.PathLenConstraint.IntValue; + } + + return -1; + } + + public virtual ICollection GetSubjectAlternativeNames() + { + return GetAlternativeNames("2.5.29.17"); + } + + public virtual ICollection GetIssuerAlternativeNames() + { + return GetAlternativeNames("2.5.29.18"); + } + + protected virtual ICollection GetAlternativeNames( + string oid) + { + Asn1OctetString altNames = GetExtensionValue(new DerObjectIdentifier(oid)); + + if (altNames == null) + return null; + + Asn1Object asn1Object = X509ExtensionUtilities.FromExtensionValue(altNames); + + GeneralNames gns = GeneralNames.GetInstance(asn1Object); + + IList result = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + foreach (GeneralName gn in gns.GetNames()) + { + IList entry = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + entry.Add(gn.TagNo); + entry.Add(gn.Name.ToString()); + result.Add(entry); + } + return result; + } + + protected override X509Extensions GetX509Extensions() + { + return c.Version >= 3 + ? c.TbsCertificate.Extensions + : null; + } + + /// + /// Get the public key of the subject of the certificate. + /// + /// The public key parameters. + public virtual AsymmetricKeyParameter GetPublicKey() + { + return PublicKeyFactory.CreateKey(c.SubjectPublicKeyInfo); + } + + /// + /// Return a Der encoded version of this certificate. + /// + /// A byte array. + public virtual byte[] GetEncoded() + { + return c.GetDerEncoded(); + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + X509Certificate other = obj as X509Certificate; + + if (other == null) + return false; + + return c.Equals(other.c); + + // NB: May prefer this implementation of Equals if more than one certificate implementation in play +// return Arrays.AreEqual(this.GetEncoded(), other.GetEncoded()); + } + + public override int GetHashCode() + { + lock (this) + { + if (!hashValueSet) + { + hashValue = c.GetHashCode(); + hashValueSet = true; + } + } + + return hashValue; + } + +// public void setBagAttribute( +// DERObjectIdentifier oid, +// DEREncodable attribute) +// { +// pkcs12Attributes.put(oid, attribute); +// pkcs12Ordering.addElement(oid); +// } +// +// public DEREncodable getBagAttribute( +// DERObjectIdentifier oid) +// { +// return (DEREncodable)pkcs12Attributes.get(oid); +// } +// +// public Enumeration getBagAttributeKeys() +// { +// return pkcs12Ordering.elements(); +// } + + public override string ToString() + { + StringBuilder buf = new StringBuilder(); + string nl = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + + buf.Append(" [0] Version: ").Append(this.Version).Append(nl); + buf.Append(" SerialNumber: ").Append(this.SerialNumber).Append(nl); + buf.Append(" IssuerDN: ").Append(this.IssuerDN).Append(nl); + buf.Append(" Start Date: ").Append(this.NotBefore).Append(nl); + buf.Append(" Final Date: ").Append(this.NotAfter).Append(nl); + buf.Append(" SubjectDN: ").Append(this.SubjectDN).Append(nl); + buf.Append(" Public Key: ").Append(this.GetPublicKey()).Append(nl); + buf.Append(" Signature Algorithm: ").Append(this.SigAlgName).Append(nl); + + byte[] sig = this.GetSignature(); + buf.Append(" Signature: ").Append(Hex.ToHexString(sig, 0, 20)).Append(nl); + + for (int i = 20; i < sig.Length; i += 20) + { + int len = System.Math.Min(20, sig.Length - i); + buf.Append(" ").Append(Hex.ToHexString(sig, i, len)).Append(nl); + } + + X509Extensions extensions = c.TbsCertificate.Extensions; + + if (extensions != null) + { + IEnumerator e = extensions.ExtensionOids.GetEnumerator(); + + if (e.MoveNext()) + { + buf.Append(" Extensions: \n"); + } + + do + { + DerObjectIdentifier oid = (DerObjectIdentifier)e.Current; + X509Extension ext = extensions.GetExtension(oid); + + if (ext.Value != null) + { + byte[] octs = ext.Value.GetOctets(); + Asn1Object obj = Asn1Object.FromByteArray(octs); + buf.Append(" critical(").Append(ext.IsCritical).Append(") "); + try + { + if (oid.Equals(X509Extensions.BasicConstraints)) + { + buf.Append(BasicConstraints.GetInstance(obj)); + } + else if (oid.Equals(X509Extensions.KeyUsage)) + { + buf.Append(KeyUsage.GetInstance(obj)); + } + else if (oid.Equals(MiscObjectIdentifiers.NetscapeCertType)) + { + buf.Append(new NetscapeCertType((DerBitString) obj)); + } + else if (oid.Equals(MiscObjectIdentifiers.NetscapeRevocationUrl)) + { + buf.Append(new NetscapeRevocationUrl((DerIA5String) obj)); + } + else if (oid.Equals(MiscObjectIdentifiers.VerisignCzagExtension)) + { + buf.Append(new VerisignCzagExtension((DerIA5String) obj)); + } + else + { + buf.Append(oid.Id); + buf.Append(" value = ").Append(Asn1Dump.DumpAsString(obj)); + //buf.Append(" value = ").Append("*****").Append(nl); + } + } + catch (Exception) + { + buf.Append(oid.Id); + //buf.Append(" value = ").Append(new string(Hex.encode(ext.getValue().getOctets()))).Append(nl); + buf.Append(" value = ").Append("*****"); + } + } + + buf.Append(nl); + } + while (e.MoveNext()); + } + + return buf.ToString(); + } + + /// + /// Verify the certificate's signature using the nominated public key. + /// + /// An appropriate public key parameter object, RsaPublicKeyParameters, DsaPublicKeyParameters or ECDsaPublicKeyParameters + /// True if the signature is valid. + /// If key submitted is not of the above nominated types. + public virtual void Verify( + AsymmetricKeyParameter key) + { + CheckSignature(new Asn1VerifierFactory(c.SignatureAlgorithm, key)); + } + + /// + /// Verify the certificate's signature using a verifier created using the passed in verifier provider. + /// + /// An appropriate provider for verifying the certificate's signature. + /// True if the signature is valid. + /// If verifier provider is not appropriate or the certificate algorithm is invalid. + public virtual void Verify( + IVerifierFactoryProvider verifierProvider) + { + CheckSignature(verifierProvider.CreateVerifierFactory (c.SignatureAlgorithm)); + } + + protected virtual void CheckSignature( + IVerifierFactory verifier) + { + if (!IsAlgIDEqual(c.SignatureAlgorithm, c.TbsCertificate.Signature)) + throw new CertificateException("signature algorithm in TBS cert not same as outer cert"); + + Asn1Encodable parameters = c.SignatureAlgorithm.Parameters; + + IStreamCalculator streamCalculator = verifier.CreateCalculator(); + + byte[] b = this.GetTbsCertificate(); + + streamCalculator.Stream.Write(b, 0, b.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + + if (!((IVerifier)streamCalculator.GetResult()).IsVerified(this.GetSignature())) + { + throw new InvalidKeyException("Public key presented not for certificate signature"); + } + } + + private static bool IsAlgIDEqual(AlgorithmIdentifier id1, AlgorithmIdentifier id2) + { + if (!id1.Algorithm.Equals(id2.Algorithm)) + return false; + + Asn1Encodable p1 = id1.Parameters; + Asn1Encodable p2 = id2.Parameters; + + if ((p1 == null) == (p2 == null)) + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(p1, p2); + + // Exactly one of p1, p2 is null at this point + return p1 == null + ? p2.ToAsn1Object() is Asn1Null + : p1.ToAsn1Object() is Asn1Null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Certificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Certificate.cs.meta new file mode 100644 index 00000000..0711150f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Certificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6beadff9e85279b4e98431dba56a094f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificatePair.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificatePair.cs new file mode 100644 index 00000000..23c5b3c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificatePair.cs @@ -0,0 +1,127 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// + /// This class contains a cross certificate pair. Cross certificates pairs may + /// contain two cross signed certificates from two CAs. A certificate from the + /// other CA to this CA is contained in the forward certificate, the certificate + /// from this CA to the other CA is contained in the reverse certificate. + /// + public class X509CertificatePair + { + private readonly X509Certificate forward; + private readonly X509Certificate reverse; + + /// Constructor + /// Certificate from the other CA to this CA. + /// Certificate from this CA to the other CA. + public X509CertificatePair( + X509Certificate forward, + X509Certificate reverse) + { + this.forward = forward; + this.reverse = reverse; + } + + /// Constructor from a ASN.1 CertificatePair structure. + /// The CertificatePair ASN.1 object. + public X509CertificatePair( + CertificatePair pair) + { + if (pair.Forward != null) + { + this.forward = new X509Certificate(pair.Forward); + } + if (pair.Reverse != null) + { + this.reverse = new X509Certificate(pair.Reverse); + } + } + + public byte[] GetEncoded() + { + try + { + X509CertificateStructure f = null, r = null; + + if (forward != null) + { + f = X509CertificateStructure.GetInstance( + Asn1Object.FromByteArray(forward.GetEncoded())); + + if (f == null) + throw new CertificateEncodingException("unable to get encoding for forward"); + } + + if (reverse != null) + { + r = X509CertificateStructure.GetInstance( + Asn1Object.FromByteArray(reverse.GetEncoded())); + + if (r == null) + throw new CertificateEncodingException("unable to get encoding for reverse"); + } + + return new CertificatePair(f, r).GetDerEncoded(); + } + catch (Exception e) + { + // TODO +// throw new ExtCertificateEncodingException(e.toString(), e); + throw new CertificateEncodingException(e.Message, e); + } + } + + /// Returns the certificate from the other CA to this CA. + public X509Certificate Forward + { + get { return forward; } + } + + /// Returns the certificate from this CA to the other CA. + public X509Certificate Reverse + { + get { return reverse; } + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + X509CertificatePair other = obj as X509CertificatePair; + + if (other == null) + return false; + + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(this.forward, other.forward) + && BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Equals(this.reverse, other.reverse); + } + + public override int GetHashCode() + { + int hash = -1; + if (forward != null) + { + hash ^= forward.GetHashCode(); + } + if (reverse != null) + { + hash *= 17; + hash ^= reverse.GetHashCode(); + } + return hash; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificatePair.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificatePair.cs.meta new file mode 100644 index 00000000..cd6b3e30 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificatePair.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebb6773b53a2eae45aff0fc7c7f03d8c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificateParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificateParser.cs new file mode 100644 index 00000000..4863e700 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificateParser.cs @@ -0,0 +1,187 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /** + * class for dealing with X509 certificates. + *

    + * At the moment this will deal with "-----BEGIN CERTIFICATE-----" to "-----END CERTIFICATE-----" + * base 64 encoded certs, as well as the BER binaries of certificates and some classes of PKCS#7 + * objects.

    + */ + public class X509CertificateParser + { + private static readonly PemParser PemCertParser = new PemParser("CERTIFICATE"); + + private Asn1Set sData; + private int sDataObjectCount; + private Stream currentStream; + + private X509Certificate ReadDerCertificate( + Asn1InputStream dIn) + { + Asn1Sequence seq = (Asn1Sequence)dIn.ReadObject(); + + if (seq.Count > 1 && seq[0] is DerObjectIdentifier) + { + if (seq[0].Equals(PkcsObjectIdentifiers.SignedData)) + { + sData = SignedData.GetInstance( + Asn1Sequence.GetInstance((Asn1TaggedObject) seq[1], true)).Certificates; + + return GetCertificate(); + } + } + + return CreateX509Certificate(X509CertificateStructure.GetInstance(seq)); + } + + private X509Certificate GetCertificate() + { + if (sData != null) + { + while (sDataObjectCount < sData.Count) + { + object obj = sData[sDataObjectCount++]; + + if (obj is Asn1Sequence) + { + return CreateX509Certificate( + X509CertificateStructure.GetInstance(obj)); + } + } + } + + return null; + } + + private X509Certificate ReadPemCertificate( + Stream inStream) + { + Asn1Sequence seq = PemCertParser.ReadPemObject(inStream); + + return seq == null + ? null + : CreateX509Certificate(X509CertificateStructure.GetInstance(seq)); + } + + protected virtual X509Certificate CreateX509Certificate( + X509CertificateStructure c) + { + return new X509Certificate(c); + } + + /// + /// Create loading data from byte array. + /// + /// + public X509Certificate ReadCertificate( + byte[] input) + { + return ReadCertificate(new MemoryStream(input, false)); + } + + /// + /// Create loading data from byte array. + /// + /// + public ICollection ReadCertificates( + byte[] input) + { + return ReadCertificates(new MemoryStream(input, false)); + } + + /** + * Generates a certificate object and initializes it with the data + * read from the input stream inStream. + */ + public X509Certificate ReadCertificate( + Stream inStream) + { + if (inStream == null) + throw new ArgumentNullException("inStream"); + if (!inStream.CanRead) + throw new ArgumentException("inStream must be read-able", "inStream"); + + if (currentStream == null) + { + currentStream = inStream; + sData = null; + sDataObjectCount = 0; + } + else if (currentStream != inStream) // reset if input stream has changed + { + currentStream = inStream; + sData = null; + sDataObjectCount = 0; + } + + try + { + if (sData != null) + { + if (sDataObjectCount != sData.Count) + { + return GetCertificate(); + } + + sData = null; + sDataObjectCount = 0; + return null; + } + + PushbackStream pis = new PushbackStream(inStream); + int tag = pis.ReadByte(); + + if (tag < 0) + return null; + + pis.Unread(tag); + + if (tag != 0x30) // assume ascii PEM encoded. + { + return ReadPemCertificate(pis); + } + + return ReadDerCertificate(new Asn1InputStream(pis)); + } + catch (Exception e) + { + throw new CertificateException("Failed to read certificate", e); + } + } + + /** + * Returns a (possibly empty) collection view of the certificates + * read from the given input stream inStream. + */ + public ICollection ReadCertificates( + Stream inStream) + { + X509Certificate cert; + IList certs = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + while ((cert = ReadCertificate(inStream)) != null) + { + certs.Add(cert); + } + + return certs; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificateParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificateParser.cs.meta new file mode 100644 index 00000000..ac6cfc61 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CertificateParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7c29c36b4684094d864d3cae4db30f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Crl.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Crl.cs new file mode 100644 index 00000000..53a49311 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Crl.cs @@ -0,0 +1,430 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /** + * The following extensions are listed in RFC 2459 as relevant to CRLs + * + * Authority Key Identifier + * Issuer Alternative Name + * CRL Number + * Delta CRL Indicator (critical) + * Issuing Distribution Point (critical) + */ + public class X509Crl + : X509ExtensionBase + // TODO Add interface Crl? + { + private readonly CertificateList c; + private readonly string sigAlgName; + private readonly byte[] sigAlgParams; + private readonly bool isIndirect; + + public X509Crl( + CertificateList c) + { + this.c = c; + + try + { + this.sigAlgName = X509SignatureUtilities.GetSignatureName(c.SignatureAlgorithm); + + if (c.SignatureAlgorithm.Parameters != null) + { + this.sigAlgParams = ((Asn1Encodable)c.SignatureAlgorithm.Parameters).GetDerEncoded(); + } + else + { + this.sigAlgParams = null; + } + + this.isIndirect = IsIndirectCrl; + } + catch (Exception e) + { + throw new CrlException("CRL contents invalid: " + e); + } + } + + protected override X509Extensions GetX509Extensions() + { + return c.Version >= 2 + ? c.TbsCertList.Extensions + : null; + } + + public virtual byte[] GetEncoded() + { + try + { + return c.GetDerEncoded(); + } + catch (Exception e) + { + throw new CrlException(e.ToString()); + } + } + + public virtual void Verify( + AsymmetricKeyParameter publicKey) + { + Verify(new Asn1VerifierFactoryProvider(publicKey)); + } + + /// + /// Verify the CRL's signature using a verifier created using the passed in verifier provider. + /// + /// An appropriate provider for verifying the CRL's signature. + /// True if the signature is valid. + /// If verifier provider is not appropriate or the CRL algorithm is invalid. + public virtual void Verify( + IVerifierFactoryProvider verifierProvider) + { + CheckSignature(verifierProvider.CreateVerifierFactory(c.SignatureAlgorithm)); + } + + protected virtual void CheckSignature( + IVerifierFactory verifier) + { + if (!c.SignatureAlgorithm.Equals(c.TbsCertList.Signature)) + { + throw new CrlException("Signature algorithm on CertificateList does not match TbsCertList."); + } + + Asn1Encodable parameters = c.SignatureAlgorithm.Parameters; + + IStreamCalculator streamCalculator = verifier.CreateCalculator(); + + byte[] b = this.GetTbsCertList(); + + streamCalculator.Stream.Write(b, 0, b.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + + if (!((IVerifier)streamCalculator.GetResult()).IsVerified(this.GetSignature())) + { + throw new InvalidKeyException("CRL does not verify with supplied public key."); + } + } + + public virtual int Version + { + get { return c.Version; } + } + + public virtual X509Name IssuerDN + { + get { return c.Issuer; } + } + + public virtual DateTime ThisUpdate + { + get { return c.ThisUpdate.ToDateTime(); } + } + + public virtual DateTimeObject NextUpdate + { + get + { + return c.NextUpdate == null + ? null + : new DateTimeObject(c.NextUpdate.ToDateTime()); + } + } + + private ISet LoadCrlEntries() + { + ISet entrySet = new HashSet(); + IEnumerable certs = c.GetRevokedCertificateEnumeration(); + + X509Name previousCertificateIssuer = IssuerDN; + foreach (CrlEntry entry in certs) + { + X509CrlEntry crlEntry = new X509CrlEntry(entry, isIndirect, previousCertificateIssuer); + entrySet.Add(crlEntry); + previousCertificateIssuer = crlEntry.GetCertificateIssuer(); + } + + return entrySet; + } + + public virtual X509CrlEntry GetRevokedCertificate( + BigInteger serialNumber) + { + IEnumerable certs = c.GetRevokedCertificateEnumeration(); + + X509Name previousCertificateIssuer = IssuerDN; + foreach (CrlEntry entry in certs) + { + X509CrlEntry crlEntry = new X509CrlEntry(entry, isIndirect, previousCertificateIssuer); + + if (serialNumber.Equals(entry.UserCertificate.Value)) + { + return crlEntry; + } + + previousCertificateIssuer = crlEntry.GetCertificateIssuer(); + } + + return null; + } + + public virtual ISet GetRevokedCertificates() + { + ISet entrySet = LoadCrlEntries(); + + if (entrySet.Count > 0) + { + return entrySet; // TODO? Collections.unmodifiableSet(entrySet); + } + + return null; + } + + public virtual byte[] GetTbsCertList() + { + try + { + return c.TbsCertList.GetDerEncoded(); + } + catch (Exception e) + { + throw new CrlException(e.ToString()); + } + } + + public virtual byte[] GetSignature() + { + return c.GetSignatureOctets(); + } + + public virtual string SigAlgName + { + get { return sigAlgName; } + } + + public virtual string SigAlgOid + { + get { return c.SignatureAlgorithm.Algorithm.Id; } + } + + public virtual byte[] GetSigAlgParams() + { + return Arrays.Clone(sigAlgParams); + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + X509Crl other = obj as X509Crl; + + if (other == null) + return false; + + return c.Equals(other.c); + + // NB: May prefer this implementation of Equals if more than one certificate implementation in play + //return Arrays.AreEqual(this.GetEncoded(), other.GetEncoded()); + } + + public override int GetHashCode() + { + return c.GetHashCode(); + } + + /** + * Returns a string representation of this CRL. + * + * @return a string representation of this CRL. + */ + public override string ToString() + { + StringBuilder buf = new StringBuilder(); + string nl = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + + buf.Append(" Version: ").Append(this.Version).Append(nl); + buf.Append(" IssuerDN: ").Append(this.IssuerDN).Append(nl); + buf.Append(" This update: ").Append(this.ThisUpdate).Append(nl); + buf.Append(" Next update: ").Append(this.NextUpdate).Append(nl); + buf.Append(" Signature Algorithm: ").Append(this.SigAlgName).Append(nl); + + byte[] sig = this.GetSignature(); + + buf.Append(" Signature: "); + buf.Append(Hex.ToHexString(sig, 0, 20)).Append(nl); + + for (int i = 20; i < sig.Length; i += 20) + { + int count = System.Math.Min(20, sig.Length - i); + buf.Append(" "); + buf.Append(Hex.ToHexString(sig, i, count)).Append(nl); + } + + X509Extensions extensions = c.TbsCertList.Extensions; + + if (extensions != null) + { + IEnumerator e = extensions.ExtensionOids.GetEnumerator(); + + if (e.MoveNext()) + { + buf.Append(" Extensions: ").Append(nl); + } + + do + { + DerObjectIdentifier oid = (DerObjectIdentifier) e.Current; + X509Extension ext = extensions.GetExtension(oid); + + if (ext.Value != null) + { + Asn1Object asn1Value = X509ExtensionUtilities.FromExtensionValue(ext.Value); + + buf.Append(" critical(").Append(ext.IsCritical).Append(") "); + try + { + if (oid.Equals(X509Extensions.CrlNumber)) + { + buf.Append(new CrlNumber(DerInteger.GetInstance(asn1Value).PositiveValue)).Append(nl); + } + else if (oid.Equals(X509Extensions.DeltaCrlIndicator)) + { + buf.Append( + "Base CRL: " + + new CrlNumber(DerInteger.GetInstance( + asn1Value).PositiveValue)) + .Append(nl); + } + else if (oid.Equals(X509Extensions.IssuingDistributionPoint)) + { + buf.Append(IssuingDistributionPoint.GetInstance((Asn1Sequence) asn1Value)).Append(nl); + } + else if (oid.Equals(X509Extensions.CrlDistributionPoints)) + { + buf.Append(CrlDistPoint.GetInstance((Asn1Sequence) asn1Value)).Append(nl); + } + else if (oid.Equals(X509Extensions.FreshestCrl)) + { + buf.Append(CrlDistPoint.GetInstance((Asn1Sequence) asn1Value)).Append(nl); + } + else + { + buf.Append(oid.Id); + buf.Append(" value = ").Append( + Asn1Dump.DumpAsString(asn1Value)) + .Append(nl); + } + } + catch (Exception) + { + buf.Append(oid.Id); + buf.Append(" value = ").Append("*****").Append(nl); + } + } + else + { + buf.Append(nl); + } + } + while (e.MoveNext()); + } + + ISet certSet = GetRevokedCertificates(); + if (certSet != null) + { + foreach (X509CrlEntry entry in certSet) + { + buf.Append(entry); + buf.Append(nl); + } + } + + return buf.ToString(); + } + + /** + * Checks whether the given certificate is on this CRL. + * + * @param cert the certificate to check for. + * @return true if the given certificate is on this CRL, + * false otherwise. + */ +// public bool IsRevoked( +// Certificate cert) +// { +// if (!cert.getType().Equals("X.509")) +// { +// throw new RuntimeException("X.509 CRL used with non X.509 Cert"); +// } + public virtual bool IsRevoked( + X509Certificate cert) + { + CrlEntry[] certs = c.GetRevokedCertificates(); + + if (certs != null) + { +// BigInteger serial = ((X509Certificate)cert).SerialNumber; + BigInteger serial = cert.SerialNumber; + + for (int i = 0; i < certs.Length; i++) + { + if (certs[i].UserCertificate.Value.Equals(serial)) + { + return true; + } + } + } + + return false; + } + + protected virtual bool IsIndirectCrl + { + get + { + Asn1OctetString idp = GetExtensionValue(X509Extensions.IssuingDistributionPoint); + bool isIndirect = false; + + try + { + if (idp != null) + { + isIndirect = IssuingDistributionPoint.GetInstance( + X509ExtensionUtilities.FromExtensionValue(idp)).IsIndirectCrl; + } + } + catch (Exception e) + { + // TODO +// throw new ExtCrlException("Exception reading IssuingDistributionPoint", e); + throw new CrlException("Exception reading IssuingDistributionPoint" + e); + } + + return isIndirect; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Crl.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Crl.cs.meta new file mode 100644 index 00000000..a4305b47 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Crl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a154750ed1601f4b80aa4d215d54e31 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlEntry.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlEntry.cs new file mode 100644 index 00000000..f4c2b666 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlEntry.cs @@ -0,0 +1,205 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /** + * The following extensions are listed in RFC 2459 as relevant to CRL Entries + * + * ReasonCode Hode Instruction Code Invalidity Date Certificate Issuer + * (critical) + */ + public class X509CrlEntry + : X509ExtensionBase + { + private CrlEntry c; + private bool isIndirect; + private X509Name previousCertificateIssuer; + private X509Name certificateIssuer; + + public X509CrlEntry( + CrlEntry c) + { + this.c = c; + this.certificateIssuer = loadCertificateIssuer(); + } + + /** + * Constructor for CRLEntries of indirect CRLs. If isIndirect + * is false {@link #getCertificateIssuer()} will always + * return null, previousCertificateIssuer is + * ignored. If this isIndirect is specified and this CrlEntry + * has no certificate issuer CRL entry extension + * previousCertificateIssuer is returned by + * {@link #getCertificateIssuer()}. + * + * @param c + * TbsCertificateList.CrlEntry object. + * @param isIndirect + * true if the corresponding CRL is a indirect + * CRL. + * @param previousCertificateIssuer + * Certificate issuer of the previous CrlEntry. + */ + public X509CrlEntry( + CrlEntry c, + bool isIndirect, + X509Name previousCertificateIssuer) + { + this.c = c; + this.isIndirect = isIndirect; + this.previousCertificateIssuer = previousCertificateIssuer; + this.certificateIssuer = loadCertificateIssuer(); + } + + private X509Name loadCertificateIssuer() + { + if (!isIndirect) + { + return null; + } + + Asn1OctetString ext = GetExtensionValue(X509Extensions.CertificateIssuer); + if (ext == null) + { + return previousCertificateIssuer; + } + + try + { + GeneralName[] names = GeneralNames.GetInstance( + X509ExtensionUtilities.FromExtensionValue(ext)).GetNames(); + + for (int i = 0; i < names.Length; i++) + { + if (names[i].TagNo == GeneralName.DirectoryName) + { + return X509Name.GetInstance(names[i].Name); + } + } + } + catch (Exception) + { + } + + return null; + } + + public X509Name GetCertificateIssuer() + { + return certificateIssuer; + } + + protected override X509Extensions GetX509Extensions() + { + return c.Extensions; + } + + public byte[] GetEncoded() + { + try + { + return c.GetDerEncoded(); + } + catch (Exception e) + { + throw new CrlException(e.ToString()); + } + } + + public BigInteger SerialNumber + { + get { return c.UserCertificate.Value; } + } + + public DateTime RevocationDate + { + get { return c.RevocationDate.ToDateTime(); } + } + + public bool HasExtensions + { + get { return c.Extensions != null; } + } + + public override string ToString() + { + StringBuilder buf = new StringBuilder(); + string nl = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.NewLine; + + buf.Append(" userCertificate: ").Append(this.SerialNumber).Append(nl); + buf.Append(" revocationDate: ").Append(this.RevocationDate).Append(nl); + buf.Append(" certificateIssuer: ").Append(this.GetCertificateIssuer()).Append(nl); + + X509Extensions extensions = c.Extensions; + + if (extensions != null) + { + IEnumerator e = extensions.ExtensionOids.GetEnumerator(); + if (e.MoveNext()) + { + buf.Append(" crlEntryExtensions:").Append(nl); + + do + { + DerObjectIdentifier oid = (DerObjectIdentifier)e.Current; + X509Extension ext = extensions.GetExtension(oid); + + if (ext.Value != null) + { + Asn1Object obj = Asn1Object.FromByteArray(ext.Value.GetOctets()); + + buf.Append(" critical(") + .Append(ext.IsCritical) + .Append(") "); + try + { + if (oid.Equals(X509Extensions.ReasonCode)) + { + buf.Append(new CrlReason(DerEnumerated.GetInstance(obj))); + } + else if (oid.Equals(X509Extensions.CertificateIssuer)) + { + buf.Append("Certificate issuer: ").Append( + GeneralNames.GetInstance((Asn1Sequence)obj)); + } + else + { + buf.Append(oid.Id); + buf.Append(" value = ").Append(Asn1Dump.DumpAsString(obj)); + } + buf.Append(nl); + } + catch (Exception) + { + buf.Append(oid.Id); + buf.Append(" value = ").Append("*****").Append(nl); + } + } + else + { + buf.Append(nl); + } + } + while (e.MoveNext()); + } + } + + return buf.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlEntry.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlEntry.cs.meta new file mode 100644 index 00000000..42d2e430 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlEntry.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc6c6a5eead859647b11f57143e492fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlParser.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlParser.cs new file mode 100644 index 00000000..0121cddf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlParser.cs @@ -0,0 +1,199 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Encoders; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.IO; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + public class X509CrlParser + { + private static readonly PemParser PemCrlParser = new PemParser("CRL"); + + private readonly bool lazyAsn1; + + private Asn1Set sCrlData; + private int sCrlDataObjectCount; + private Stream currentCrlStream; + + public X509CrlParser() + : this(false) + { + } + + public X509CrlParser( + bool lazyAsn1) + { + this.lazyAsn1 = lazyAsn1; + } + + private X509Crl ReadPemCrl( + Stream inStream) + { + Asn1Sequence seq = PemCrlParser.ReadPemObject(inStream); + + return seq == null + ? null + : CreateX509Crl(CertificateList.GetInstance(seq)); + } + + private X509Crl ReadDerCrl( + Asn1InputStream dIn) + { + Asn1Sequence seq = (Asn1Sequence)dIn.ReadObject(); + + if (seq.Count > 1 && seq[0] is DerObjectIdentifier) + { + if (seq[0].Equals(PkcsObjectIdentifiers.SignedData)) + { + sCrlData = SignedData.GetInstance( + Asn1Sequence.GetInstance((Asn1TaggedObject) seq[1], true)).Crls; + + return GetCrl(); + } + } + + return CreateX509Crl(CertificateList.GetInstance(seq)); + } + + private X509Crl GetCrl() + { + if (sCrlData == null || sCrlDataObjectCount >= sCrlData.Count) + { + return null; + } + + return CreateX509Crl( + CertificateList.GetInstance( + sCrlData[sCrlDataObjectCount++])); + } + + protected virtual X509Crl CreateX509Crl( + CertificateList c) + { + return new X509Crl(c); + } + + /// + /// Create loading data from byte array. + /// + /// + public X509Crl ReadCrl( + byte[] input) + { + return ReadCrl(new MemoryStream(input, false)); + } + + /// + /// Create loading data from byte array. + /// + /// + public ICollection ReadCrls( + byte[] input) + { + return ReadCrls(new MemoryStream(input, false)); + } + + /** + * Generates a certificate revocation list (CRL) object and initializes + * it with the data read from the input stream inStream. + */ + public X509Crl ReadCrl( + Stream inStream) + { + if (inStream == null) + throw new ArgumentNullException("inStream"); + if (!inStream.CanRead) + throw new ArgumentException("inStream must be read-able", "inStream"); + + if (currentCrlStream == null) + { + currentCrlStream = inStream; + sCrlData = null; + sCrlDataObjectCount = 0; + } + else if (currentCrlStream != inStream) // reset if input stream has changed + { + currentCrlStream = inStream; + sCrlData = null; + sCrlDataObjectCount = 0; + } + + try + { + if (sCrlData != null) + { + if (sCrlDataObjectCount != sCrlData.Count) + { + return GetCrl(); + } + + sCrlData = null; + sCrlDataObjectCount = 0; + return null; + } + + PushbackStream pis = new PushbackStream(inStream); + int tag = pis.ReadByte(); + + if (tag < 0) + return null; + + pis.Unread(tag); + + if (tag != 0x30) // assume ascii PEM encoded. + { + return ReadPemCrl(pis); + } + + Asn1InputStream asn1 = lazyAsn1 + ? new LazyAsn1InputStream(pis) + : new Asn1InputStream(pis); + + return ReadDerCrl(asn1); + } + catch (CrlException e) + { + throw e; + } + catch (Exception e) + { + throw new CrlException(e.ToString()); + } + } + + /** + * Returns a (possibly empty) collection view of the CRLs read from + * the given input stream inStream. + * + * The inStream may contain a sequence of DER-encoded CRLs, or + * a PKCS#7 CRL set. This is a PKCS#7 SignedData object, with the + * only significant field being crls. In particular the signature + * and the contents are ignored. + */ + public ICollection ReadCrls( + Stream inStream) + { + X509Crl crl; + IList crls = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + while ((crl = ReadCrl(inStream)) != null) + { + crls.Add(crl); + } + + return crls; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlParser.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlParser.cs.meta new file mode 100644 index 00000000..c77b331e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509CrlParser.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3886777ef4aa57469f8e79b6e1c14ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509ExtensionBase.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509ExtensionBase.cs new file mode 100644 index 00000000..d5bebee5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509ExtensionBase.cs @@ -0,0 +1,86 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + public abstract class X509ExtensionBase + : IX509Extension + { + protected abstract X509Extensions GetX509Extensions(); + + protected virtual ISet GetExtensionOids( + bool critical) + { + X509Extensions extensions = GetX509Extensions(); + if (extensions != null) + { + HashSet set = new HashSet(); + foreach (DerObjectIdentifier oid in extensions.ExtensionOids) + { + X509Extension ext = extensions.GetExtension(oid); + if (ext.IsCritical == critical) + { + set.Add(oid.Id); + } + } + + return set; + } + + return null; + } + + /// + /// Get non critical extensions. + /// + /// A set of non critical extension oids. + public virtual ISet GetNonCriticalExtensionOids() + { + return GetExtensionOids(false); + } + + /// + /// Get any critical extensions. + /// + /// A sorted list of critical entension. + public virtual ISet GetCriticalExtensionOids() + { + return GetExtensionOids(true); + } + + /// + /// Get the value of a given extension. + /// + /// The object ID of the extension. + /// An Asn1OctetString object if that extension is found or null if not. + [Obsolete("Use version taking a DerObjectIdentifier instead")] + public Asn1OctetString GetExtensionValue( + string oid) + { + return GetExtensionValue(new DerObjectIdentifier(oid)); + } + + public virtual Asn1OctetString GetExtensionValue( + DerObjectIdentifier oid) + { + X509Extensions exts = GetX509Extensions(); + if (exts != null) + { + X509Extension ext = exts.GetExtension(oid); + if (ext != null) + { + return ext.Value; + } + } + + return null; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509ExtensionBase.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509ExtensionBase.cs.meta new file mode 100644 index 00000000..7b6af8e6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509ExtensionBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c9d43943931445544867d6e0c63383f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509KeyUsage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509KeyUsage.cs new file mode 100644 index 00000000..44bdc161 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509KeyUsage.cs @@ -0,0 +1,63 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /** + * A holding class for constructing an X509 Key Usage extension. + * + *
    +	 *    id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }
    +	 *
    +	 *    KeyUsage ::= BIT STRING {
    +	 *         digitalSignature        (0),
    +	 *         nonRepudiation          (1),
    +	 *         keyEncipherment         (2),
    +	 *         dataEncipherment        (3),
    +	 *         keyAgreement            (4),
    +	 *         keyCertSign             (5),
    +	 *         cRLSign                 (6),
    +	 *         encipherOnly            (7),
    +	 *         decipherOnly            (8) }
    +	 * 
    + */ + public class X509KeyUsage + : Asn1Encodable + { + public const int DigitalSignature = 1 << 7; + public const int NonRepudiation = 1 << 6; + public const int KeyEncipherment = 1 << 5; + public const int DataEncipherment = 1 << 4; + public const int KeyAgreement = 1 << 3; + public const int KeyCertSign = 1 << 2; + public const int CrlSign = 1 << 1; + public const int EncipherOnly = 1 << 0; + public const int DecipherOnly = 1 << 15; + + private readonly int usage; + + /** + * Basic constructor. + * + * @param usage - the bitwise OR of the Key Usage flags giving the + * allowed uses for the key. + * e.g. (X509KeyUsage.keyEncipherment | X509KeyUsage.dataEncipherment) + */ + public X509KeyUsage( + int usage) + { + this.usage = usage; + } + + public override Asn1Object ToAsn1Object() + { + return new KeyUsage(usage); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509KeyUsage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509KeyUsage.cs.meta new file mode 100644 index 00000000..36b9cf81 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509KeyUsage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 856abba21185f344ba24e505be6a75e4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509SignatureUtil.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509SignatureUtil.cs new file mode 100644 index 00000000..eaeaec65 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509SignatureUtil.cs @@ -0,0 +1,132 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + internal class X509SignatureUtilities + { + private static readonly Asn1Null derNull = DerNull.Instance; + + internal static void SetSignatureParameters( + ISigner signature, + Asn1Encodable parameters) + { + if (parameters != null && !derNull.Equals(parameters)) + { + // TODO Put back in +// AlgorithmParameters sigParams = AlgorithmParameters.GetInstance(signature.getAlgorithm()); +// +// try +// { +// sigParams.Init(parameters.ToAsn1Object().GetDerEncoded()); +// } +// catch (IOException e) +// { +// throw new SignatureException("IOException decoding parameters: " + e.Message); +// } +// +// if (BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.EndsWith(signature.getAlgorithm(), "MGF1")) +// { +// try +// { +// signature.setParameter(sigParams.getParameterSpec(PSSParameterSpec.class)); +// } +// catch (GeneralSecurityException e) +// { +// throw new SignatureException("Exception extracting parameters: " + e.Message); +// } +// } + } + } + + internal static string GetSignatureName( + AlgorithmIdentifier sigAlgId) + { + Asn1Encodable parameters = sigAlgId.Parameters; + + if (parameters != null && !derNull.Equals(parameters)) + { + if (sigAlgId.Algorithm.Equals(PkcsObjectIdentifiers.IdRsassaPss)) + { + RsassaPssParameters rsaParams = RsassaPssParameters.GetInstance(parameters); + + return GetDigestAlgName(rsaParams.HashAlgorithm.Algorithm) + "withRSAandMGF1"; + } + if (sigAlgId.Algorithm.Equals(X9ObjectIdentifiers.ECDsaWithSha2)) + { + Asn1Sequence ecDsaParams = Asn1Sequence.GetInstance(parameters); + + return GetDigestAlgName((DerObjectIdentifier)ecDsaParams[0]) + "withECDSA"; + } + } + + return sigAlgId.Algorithm.Id; + } + + /** + * Return the digest algorithm using one of the standard JCA string + * representations rather than the algorithm identifier (if possible). + */ + private static string GetDigestAlgName( + DerObjectIdentifier digestAlgOID) + { + if (PkcsObjectIdentifiers.MD5.Equals(digestAlgOID)) + { + return "MD5"; + } + else if (OiwObjectIdentifiers.IdSha1.Equals(digestAlgOID)) + { + return "SHA1"; + } + else if (NistObjectIdentifiers.IdSha224.Equals(digestAlgOID)) + { + return "SHA224"; + } + else if (NistObjectIdentifiers.IdSha256.Equals(digestAlgOID)) + { + return "SHA256"; + } + else if (NistObjectIdentifiers.IdSha384.Equals(digestAlgOID)) + { + return "SHA384"; + } + else if (NistObjectIdentifiers.IdSha512.Equals(digestAlgOID)) + { + return "SHA512"; + } + else if (TeleTrusTObjectIdentifiers.RipeMD128.Equals(digestAlgOID)) + { + return "RIPEMD128"; + } + else if (TeleTrusTObjectIdentifiers.RipeMD160.Equals(digestAlgOID)) + { + return "RIPEMD160"; + } + else if (TeleTrusTObjectIdentifiers.RipeMD256.Equals(digestAlgOID)) + { + return "RIPEMD256"; + } + else if (CryptoProObjectIdentifiers.GostR3411.Equals(digestAlgOID)) + { + return "GOST3411"; + } + else + { + return digestAlgOID.Id; + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509SignatureUtil.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509SignatureUtil.cs.meta new file mode 100644 index 00000000..22775e86 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509SignatureUtil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 622a207c30957f04fb37399eac610155 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Utilities.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Utilities.cs new file mode 100644 index 00000000..aa4a8f07 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Utilities.cs @@ -0,0 +1,191 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.CryptoPro; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Nist; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Oiw; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.Pkcs; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.TeleTrust; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X9; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + internal class X509Utilities + { + private static readonly IDictionary algorithms = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly IDictionary exParams = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateHashtable(); + private static readonly ISet noParams = new HashSet(); + + static X509Utilities() + { + algorithms.Add("MD2WITHRSAENCRYPTION", PkcsObjectIdentifiers.MD2WithRsaEncryption); + algorithms.Add("MD2WITHRSA", PkcsObjectIdentifiers.MD2WithRsaEncryption); + algorithms.Add("MD5WITHRSAENCRYPTION", PkcsObjectIdentifiers.MD5WithRsaEncryption); + algorithms.Add("MD5WITHRSA", PkcsObjectIdentifiers.MD5WithRsaEncryption); + algorithms.Add("SHA1WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha1WithRsaEncryption); + algorithms.Add("SHA1WITHRSA", PkcsObjectIdentifiers.Sha1WithRsaEncryption); + algorithms.Add("SHA224WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha224WithRsaEncryption); + algorithms.Add("SHA224WITHRSA", PkcsObjectIdentifiers.Sha224WithRsaEncryption); + algorithms.Add("SHA256WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha256WithRsaEncryption); + algorithms.Add("SHA256WITHRSA", PkcsObjectIdentifiers.Sha256WithRsaEncryption); + algorithms.Add("SHA384WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha384WithRsaEncryption); + algorithms.Add("SHA384WITHRSA", PkcsObjectIdentifiers.Sha384WithRsaEncryption); + algorithms.Add("SHA512WITHRSAENCRYPTION", PkcsObjectIdentifiers.Sha512WithRsaEncryption); + algorithms.Add("SHA512WITHRSA", PkcsObjectIdentifiers.Sha512WithRsaEncryption); + algorithms.Add("SHA1WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA224WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA256WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA384WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("SHA512WITHRSAANDMGF1", PkcsObjectIdentifiers.IdRsassaPss); + algorithms.Add("RIPEMD160WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160); + algorithms.Add("RIPEMD160WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD160); + algorithms.Add("RIPEMD128WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128); + algorithms.Add("RIPEMD128WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD128); + algorithms.Add("RIPEMD256WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256); + algorithms.Add("RIPEMD256WITHRSA", TeleTrusTObjectIdentifiers.RsaSignatureWithRipeMD256); + algorithms.Add("SHA1WITHDSA", X9ObjectIdentifiers.IdDsaWithSha1); + algorithms.Add("DSAWITHSHA1", X9ObjectIdentifiers.IdDsaWithSha1); + algorithms.Add("SHA224WITHDSA", NistObjectIdentifiers.DsaWithSha224); + algorithms.Add("SHA256WITHDSA", NistObjectIdentifiers.DsaWithSha256); + algorithms.Add("SHA384WITHDSA", NistObjectIdentifiers.DsaWithSha384); + algorithms.Add("SHA512WITHDSA", NistObjectIdentifiers.DsaWithSha512); + algorithms.Add("SHA1WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha1); + algorithms.Add("ECDSAWITHSHA1", X9ObjectIdentifiers.ECDsaWithSha1); + algorithms.Add("SHA224WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha224); + algorithms.Add("SHA256WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha256); + algorithms.Add("SHA384WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha384); + algorithms.Add("SHA512WITHECDSA", X9ObjectIdentifiers.ECDsaWithSha512); + algorithms.Add("GOST3411WITHGOST3410", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + algorithms.Add("GOST3411WITHGOST3410-94", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + algorithms.Add("GOST3411WITHECGOST3410", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + algorithms.Add("GOST3411WITHECGOST3410-2001", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + algorithms.Add("GOST3411WITHGOST3410-2001", CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + + // + // According to RFC 3279, the ASN.1 encoding SHALL (id-dsa-with-sha1) or MUST (ecdsa-with-SHA*) omit the parameters field. + // The parameters field SHALL be NULL for RSA based signature algorithms. + // + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha1); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha224); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha256); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha384); + noParams.Add(X9ObjectIdentifiers.ECDsaWithSha512); + noParams.Add(X9ObjectIdentifiers.IdDsaWithSha1); + noParams.Add(NistObjectIdentifiers.DsaWithSha224); + noParams.Add(NistObjectIdentifiers.DsaWithSha256); + noParams.Add(NistObjectIdentifiers.DsaWithSha384); + noParams.Add(NistObjectIdentifiers.DsaWithSha512); + + // + // RFC 4491 + // + noParams.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x94); + noParams.Add(CryptoProObjectIdentifiers.GostR3411x94WithGostR3410x2001); + + // + // explicit params + // + AlgorithmIdentifier sha1AlgId = new AlgorithmIdentifier(OiwObjectIdentifiers.IdSha1, DerNull.Instance); + exParams.Add("SHA1WITHRSAANDMGF1", CreatePssParams(sha1AlgId, 20)); + + AlgorithmIdentifier sha224AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha224, DerNull.Instance); + exParams.Add("SHA224WITHRSAANDMGF1", CreatePssParams(sha224AlgId, 28)); + + AlgorithmIdentifier sha256AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha256, DerNull.Instance); + exParams.Add("SHA256WITHRSAANDMGF1", CreatePssParams(sha256AlgId, 32)); + + AlgorithmIdentifier sha384AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha384, DerNull.Instance); + exParams.Add("SHA384WITHRSAANDMGF1", CreatePssParams(sha384AlgId, 48)); + + AlgorithmIdentifier sha512AlgId = new AlgorithmIdentifier(NistObjectIdentifiers.IdSha512, DerNull.Instance); + exParams.Add("SHA512WITHRSAANDMGF1", CreatePssParams(sha512AlgId, 64)); + } + + private static RsassaPssParameters CreatePssParams( + AlgorithmIdentifier hashAlgId, + int saltSize) + { + return new RsassaPssParameters( + hashAlgId, + new AlgorithmIdentifier(PkcsObjectIdentifiers.IdMgf1, hashAlgId), + new DerInteger(saltSize), + new DerInteger(1)); + } + + internal static DerObjectIdentifier GetAlgorithmOid( + string algorithmName) + { + algorithmName = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithmName); + + if (algorithms.Contains(algorithmName)) + { + return (DerObjectIdentifier) algorithms[algorithmName]; + } + + return new DerObjectIdentifier(algorithmName); + } + + internal static AlgorithmIdentifier GetSigAlgID( + DerObjectIdentifier sigOid, + string algorithmName) + { + if (noParams.Contains(sigOid)) + { + return new AlgorithmIdentifier(sigOid); + } + + algorithmName = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(algorithmName); + + if (exParams.Contains(algorithmName)) + { + return new AlgorithmIdentifier(sigOid, (Asn1Encodable) exParams[algorithmName]); + } + + return new AlgorithmIdentifier(sigOid, DerNull.Instance); + } + + internal static IEnumerable GetAlgNames() + { + return new EnumerableProxy(algorithms.Keys); + } + + internal static byte[] GetSignatureForObject( + DerObjectIdentifier sigOid, // TODO Redundant now? + string sigName, + AsymmetricKeyParameter privateKey, + SecureRandom random, + Asn1Encodable ae) + { + if (sigOid == null) + throw new ArgumentNullException("sigOid"); + + ISigner sig = SignerUtilities.GetSigner(sigName); + + if (random != null) + { + sig.Init(true, new ParametersWithRandom(privateKey, random)); + } + else + { + sig.Init(true, privateKey); + } + + byte[] encoded = ae.GetDerEncoded(); + sig.BlockUpdate(encoded, 0, encoded.Length); + + return sig.GenerateSignature(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Utilities.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Utilities.cs.meta new file mode 100644 index 00000000..891f73cc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509Utilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05c143c2146115a488ce5733be22c489 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V1CertificateGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V1CertificateGenerator.cs new file mode 100644 index 00000000..cbd75cbd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V1CertificateGenerator.cs @@ -0,0 +1,214 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.IO; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// + /// Class to Generate X509V1 Certificates. + /// + public class X509V1CertificateGenerator + { + private V1TbsCertificateGenerator tbsGen; + private DerObjectIdentifier sigOID; + private AlgorithmIdentifier sigAlgId; + private string signatureAlgorithm; + + /// + /// Default Constructor. + /// + public X509V1CertificateGenerator() + { + tbsGen = new V1TbsCertificateGenerator(); + } + + /// + /// Reset the generator. + /// + public void Reset() + { + tbsGen = new V1TbsCertificateGenerator(); + } + + /// + /// Set the certificate's serial number. + /// + /// Make serial numbers long, if you have no serial number policy make sure the number is at least 16 bytes of secure random data. + /// You will be surprised how ugly a serial number collision can get. + /// The serial number. + public void SetSerialNumber( + BigInteger serialNumber) + { + if (serialNumber.SignValue <= 0) + { + throw new ArgumentException("serial number must be a positive integer", "serialNumber"); + } + + tbsGen.SetSerialNumber(new DerInteger(serialNumber)); + } + + /// + /// Set the issuer distinguished name. + /// The issuer is the entity whose private key is used to sign the certificate. + /// + /// The issuers DN. + public void SetIssuerDN( + X509Name issuer) + { + tbsGen.SetIssuer(issuer); + } + + /// + /// Set the date that this certificate is to be valid from. + /// + /// + public void SetNotBefore( + DateTime date) + { + tbsGen.SetStartDate(new Time(date)); + } + + /// + /// Set the date after which this certificate will no longer be valid. + /// + /// + public void SetNotAfter( + DateTime date) + { + tbsGen.SetEndDate(new Time(date)); + } + + /// + /// Set the subject distinguished name. + /// The subject describes the entity associated with the public key. + /// + /// + public void SetSubjectDN( + X509Name subject) + { + tbsGen.SetSubject(subject); + } + + /// + /// Set the public key that this certificate identifies. + /// + /// + public void SetPublicKey( + AsymmetricKeyParameter publicKey) + { + try + { + tbsGen.SetSubjectPublicKeyInfo( + SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey)); + } + catch (Exception e) + { + throw new ArgumentException("unable to process key - " + e.ToString()); + } + } + + /// + /// Set the signature algorithm that will be used to sign this certificate. + /// This can be either a name or an OID, names are treated as case insensitive. + /// + /// string representation of the algorithm name + [Obsolete("Not needed if Generate used with an ISignatureFactory")] + public void SetSignatureAlgorithm( + string signatureAlgorithm) + { + this.signatureAlgorithm = signatureAlgorithm; + + try + { + sigOID = X509Utilities.GetAlgorithmOid(signatureAlgorithm); + } + catch (Exception) + { + throw new ArgumentException("Unknown signature type requested", "signatureAlgorithm"); + } + + sigAlgId = X509Utilities.GetSigAlgID(sigOID, signatureAlgorithm); + + tbsGen.SetSignature(sigAlgId); + } + + /// + /// Generate a new X509Certificate. + /// + /// The private key of the issuer used to sign this certificate. + /// An X509Certificate. + [Obsolete("Use Generate with an ISignatureFactory")] + public X509Certificate Generate( + AsymmetricKeyParameter privateKey) + { + return Generate(privateKey, null); + } + + /// + /// Generate a new X509Certificate specifying a SecureRandom instance that you would like to use. + /// + /// The private key of the issuer used to sign this certificate. + /// The Secure Random you want to use. + /// An X509Certificate. + [Obsolete("Use Generate with an ISignatureFactory")] + public X509Certificate Generate( + AsymmetricKeyParameter privateKey, + SecureRandom random) + { + return Generate(new Asn1SignatureFactory(signatureAlgorithm, privateKey, random)); + } + + /// + /// Generate a new X509Certificate using the passed in SignatureCalculator. + /// + /// A signature calculator factory with the necessary algorithm details. + /// An X509Certificate. + public X509Certificate Generate(ISignatureFactory signatureCalculatorFactory) + { + tbsGen.SetSignature ((AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails); + + TbsCertificateStructure tbsCert = tbsGen.GenerateTbsCertificate(); + + IStreamCalculator streamCalculator = signatureCalculatorFactory.CreateCalculator(); + + byte[] encoded = tbsCert.GetDerEncoded(); + + streamCalculator.Stream.Write(encoded, 0, encoded.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + + return GenerateJcaObject(tbsCert, (AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails, ((IBlockResult)streamCalculator.GetResult()).Collect()); + } + + private X509Certificate GenerateJcaObject( + TbsCertificateStructure tbsCert, + AlgorithmIdentifier sigAlg, + byte[] signature) + { + return new X509Certificate( + new X509CertificateStructure(tbsCert, sigAlg, new DerBitString(signature))); + } + + /// + /// Allows enumeration of the signature names supported by the generator. + /// + public IEnumerable SignatureAlgNames + { + get { return X509Utilities.GetAlgNames(); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V1CertificateGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V1CertificateGenerator.cs.meta new file mode 100644 index 00000000..76950c8a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V1CertificateGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a9d644b2fa83d85409041f2aa7707d64 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificate.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificate.cs new file mode 100644 index 00000000..7d292a84 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificate.cs @@ -0,0 +1,284 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// An implementation of a version 2 X.509 Attribute Certificate. + public class X509V2AttributeCertificate + : X509ExtensionBase, IX509AttributeCertificate + { + private readonly AttributeCertificate cert; + private readonly DateTime notBefore; + private readonly DateTime notAfter; + + private static AttributeCertificate GetObject(Stream input) + { + try + { + return AttributeCertificate.GetInstance(Asn1Object.FromStream(input)); + } + catch (IOException e) + { + throw e; + } + catch (Exception e) + { + throw new IOException("exception decoding certificate structure", e); + } + } + + public X509V2AttributeCertificate( + Stream encIn) + : this(GetObject(encIn)) + { + } + + public X509V2AttributeCertificate( + byte[] encoded) + : this(new MemoryStream(encoded, false)) + { + } + + internal X509V2AttributeCertificate( + AttributeCertificate cert) + { + this.cert = cert; + + try + { + this.notAfter = cert.ACInfo.AttrCertValidityPeriod.NotAfterTime.ToDateTime(); + this.notBefore = cert.ACInfo.AttrCertValidityPeriod.NotBeforeTime.ToDateTime(); + } + catch (Exception e) + { + throw new IOException("invalid data structure in certificate!", e); + } + } + + public virtual int Version + { + get { return cert.ACInfo.Version.Value.IntValue + 1; } + } + + public virtual BigInteger SerialNumber + { + get { return cert.ACInfo.SerialNumber.Value; } + } + + public virtual AttributeCertificateHolder Holder + { + get + { + return new AttributeCertificateHolder((Asn1Sequence)cert.ACInfo.Holder.ToAsn1Object()); + } + } + + public virtual AttributeCertificateIssuer Issuer + { + get + { + return new AttributeCertificateIssuer(cert.ACInfo.Issuer); + } + } + + public virtual DateTime NotBefore + { + get { return notBefore; } + } + + public virtual DateTime NotAfter + { + get { return notAfter; } + } + + public virtual bool[] GetIssuerUniqueID() + { + DerBitString id = cert.ACInfo.IssuerUniqueID; + + if (id != null) + { + byte[] bytes = id.GetBytes(); + bool[] boolId = new bool[bytes.Length * 8 - id.PadBits]; + + for (int i = 0; i != boolId.Length; i++) + { + //boolId[i] = (bytes[i / 8] & (0x80 >>> (i % 8))) != 0; + boolId[i] = (bytes[i / 8] & (0x80 >> (i % 8))) != 0; + } + + return boolId; + } + + return null; + } + + public virtual bool IsValidNow + { + get { return IsValid(DateTime.UtcNow); } + } + + public virtual bool IsValid( + DateTime date) + { + return date.CompareTo(NotBefore) >= 0 && date.CompareTo(NotAfter) <= 0; + } + + public virtual void CheckValidity() + { + this.CheckValidity(DateTime.UtcNow); + } + + public virtual void CheckValidity( + DateTime date) + { + if (date.CompareTo(NotAfter) > 0) + throw new CertificateExpiredException("certificate expired on " + NotAfter); + if (date.CompareTo(NotBefore) < 0) + throw new CertificateNotYetValidException("certificate not valid until " + NotBefore); + } + + public virtual AlgorithmIdentifier SignatureAlgorithm + { + get { return cert.SignatureAlgorithm; } + } + + public virtual byte[] GetSignature() + { + return cert.GetSignatureOctets(); + } + + public virtual void Verify( + AsymmetricKeyParameter key) + { + CheckSignature(new Asn1VerifierFactory(cert.SignatureAlgorithm, key)); + } + + /// + /// Verify the certificate's signature using a verifier created using the passed in verifier provider. + /// + /// An appropriate provider for verifying the certificate's signature. + /// True if the signature is valid. + /// If verifier provider is not appropriate or the certificate algorithm is invalid. + public virtual void Verify( + IVerifierFactoryProvider verifierProvider) + { + CheckSignature(verifierProvider.CreateVerifierFactory(cert.SignatureAlgorithm)); + } + + protected virtual void CheckSignature( + IVerifierFactory verifier) + { + if (!cert.SignatureAlgorithm.Equals(cert.ACInfo.Signature)) + { + throw new CertificateException("Signature algorithm in certificate info not same as outer certificate"); + } + + IStreamCalculator streamCalculator = verifier.CreateCalculator(); + + try + { + byte[] b = this.cert.ACInfo.GetEncoded(); + + streamCalculator.Stream.Write(b, 0, b.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + } + catch (IOException e) + { + throw new SignatureException("Exception encoding certificate info object", e); + } + + if (!((IVerifier)streamCalculator.GetResult()).IsVerified(this.GetSignature())) + { + throw new InvalidKeyException("Public key presented not for certificate signature"); + } + } + + public virtual byte[] GetEncoded() + { + return cert.GetEncoded(); + } + + protected override X509Extensions GetX509Extensions() + { + return cert.ACInfo.Extensions; + } + + public virtual X509Attribute[] GetAttributes() + { + Asn1Sequence seq = cert.ACInfo.Attributes; + X509Attribute[] attrs = new X509Attribute[seq.Count]; + + for (int i = 0; i != seq.Count; i++) + { + attrs[i] = new X509Attribute((Asn1Encodable)seq[i]); + } + + return attrs; + } + + public virtual X509Attribute[] GetAttributes( + string oid) + { + Asn1Sequence seq = cert.ACInfo.Attributes; + IList list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + for (int i = 0; i != seq.Count; i++) + { + X509Attribute attr = new X509Attribute((Asn1Encodable)seq[i]); + if (attr.Oid.Equals(oid)) + { + list.Add(attr); + } + } + + if (list.Count < 1) + { + return null; + } + + X509Attribute[] result = new X509Attribute[list.Count]; + for (int i = 0; i < list.Count; ++i) + { + result[i] = (X509Attribute)list[i]; + } + return result; + } + + public override bool Equals( + object obj) + { + if (obj == this) + return true; + + X509V2AttributeCertificate other = obj as X509V2AttributeCertificate; + + if (other == null) + return false; + + return cert.Equals(other.cert); + + // NB: May prefer this implementation of Equals if more than one certificate implementation in play + //return Arrays.AreEqual(this.GetEncoded(), other.GetEncoded()); + } + + public override int GetHashCode() + { + return cert.GetHashCode(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificate.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificate.cs.meta new file mode 100644 index 00000000..eccc88bb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f91955083bfb1549aefb0e34a5159e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificateGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificateGenerator.cs new file mode 100644 index 00000000..a88f368a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificateGenerator.cs @@ -0,0 +1,207 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// Class to produce an X.509 Version 2 AttributeCertificate. + public class X509V2AttributeCertificateGenerator + { + private readonly X509ExtensionsGenerator extGenerator = new X509ExtensionsGenerator(); + + private V2AttributeCertificateInfoGenerator acInfoGen; + private DerObjectIdentifier sigOID; + private AlgorithmIdentifier sigAlgId; + private string signatureAlgorithm; + + public X509V2AttributeCertificateGenerator() + { + acInfoGen = new V2AttributeCertificateInfoGenerator(); + } + + /// Reset the generator + public void Reset() + { + acInfoGen = new V2AttributeCertificateInfoGenerator(); + extGenerator.Reset(); + } + + /// Set the Holder of this Attribute Certificate. + public void SetHolder( + AttributeCertificateHolder holder) + { + acInfoGen.SetHolder(holder.holder); + } + + /// Set the issuer. + public void SetIssuer( + AttributeCertificateIssuer issuer) + { + acInfoGen.SetIssuer(AttCertIssuer.GetInstance(issuer.form)); + } + + /// Set the serial number for the certificate. + public void SetSerialNumber( + BigInteger serialNumber) + { + acInfoGen.SetSerialNumber(new DerInteger(serialNumber)); + } + + public void SetNotBefore( + DateTime date) + { + acInfoGen.SetStartDate(new DerGeneralizedTime(date)); + } + + public void SetNotAfter( + DateTime date) + { + acInfoGen.SetEndDate(new DerGeneralizedTime(date)); + } + + /// + /// Set the signature algorithm. This can be either a name or an OID, names + /// are treated as case insensitive. + /// + /// The algorithm name. + [Obsolete("Not needed if Generate used with an ISignatureFactory")] + public void SetSignatureAlgorithm( + string signatureAlgorithm) + { + this.signatureAlgorithm = signatureAlgorithm; + + try + { + sigOID = X509Utilities.GetAlgorithmOid(signatureAlgorithm); + } + catch (Exception) + { + throw new ArgumentException("Unknown signature type requested"); + } + + sigAlgId = X509Utilities.GetSigAlgID(sigOID, signatureAlgorithm); + + acInfoGen.SetSignature(sigAlgId); + } + + /// Add an attribute. + public void AddAttribute( + X509Attribute attribute) + { + acInfoGen.AddAttribute(AttributeX509.GetInstance(attribute.ToAsn1Object())); + } + + public void SetIssuerUniqueId( + bool[] iui) + { + // TODO convert bool array to bit string + //acInfoGen.SetIssuerUniqueID(iui); + throw BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateNotImplementedException("SetIssuerUniqueId()"); + } + + /// Add a given extension field for the standard extensions tag. + public void AddExtension( + string oid, + bool critical, + Asn1Encodable extensionValue) + { + extGenerator.AddExtension(new DerObjectIdentifier(oid), critical, extensionValue); + } + + /// + /// Add a given extension field for the standard extensions tag. + /// The value parameter becomes the contents of the octet string associated + /// with the extension. + /// + public void AddExtension( + string oid, + bool critical, + byte[] extensionValue) + { + extGenerator.AddExtension(new DerObjectIdentifier(oid), critical, extensionValue); + } + + /// + /// Generate an X509 certificate, based on the current issuer and subject. + /// + [Obsolete("Use Generate with an ISignatureFactory")] + public IX509AttributeCertificate Generate( + AsymmetricKeyParameter privateKey) + { + return Generate(privateKey, null); + } + + /// + /// Generate an X509 certificate, based on the current issuer and subject, + /// using the supplied source of randomness, if required. + /// + [Obsolete("Use Generate with an ISignatureFactory")] + public IX509AttributeCertificate Generate( + AsymmetricKeyParameter privateKey, + SecureRandom random) + { + return Generate(new Asn1SignatureFactory(signatureAlgorithm, privateKey, random)); + } + + /// + /// Generate a new X.509 Attribute Certificate using the passed in SignatureCalculator. + /// + /// A signature calculator factory with the necessary algorithm details. + /// An IX509AttributeCertificate. + public IX509AttributeCertificate Generate(ISignatureFactory signatureCalculatorFactory) + { + if (!extGenerator.IsEmpty) + { + acInfoGen.SetExtensions(extGenerator.Generate()); + } + + AlgorithmIdentifier sigAlgID = (AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails; + + acInfoGen.SetSignature(sigAlgID); + + AttributeCertificateInfo acInfo = acInfoGen.GenerateAttributeCertificateInfo(); + + byte[] encoded = acInfo.GetDerEncoded(); + + IStreamCalculator streamCalculator = signatureCalculatorFactory.CreateCalculator(); + + streamCalculator.Stream.Write(encoded, 0, encoded.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + + try + { + DerBitString signatureValue = new DerBitString(((IBlockResult)streamCalculator.GetResult()).Collect()); + + return new X509V2AttributeCertificate(new AttributeCertificate(acInfo, sigAlgID, signatureValue)); + } + catch (Exception e) + { + // TODO +// throw new ExtCertificateEncodingException("constructed invalid certificate", e); + throw new CertificateEncodingException("constructed invalid certificate", e); + } + } + + /// + /// Allows enumeration of the signature names supported by the generator. + /// + public IEnumerable SignatureAlgNames + { + get { return X509Utilities.GetAlgNames(); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificateGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificateGenerator.cs.meta new file mode 100644 index 00000000..71394ac7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2AttributeCertificateGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 443d99da7fa37d344b2315855b869d71 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2CRLGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2CRLGenerator.cs new file mode 100644 index 00000000..b2071474 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2CRLGenerator.cs @@ -0,0 +1,282 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Parameters; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /** + * class to produce an X.509 Version 2 CRL. + */ + public class X509V2CrlGenerator + { + private readonly X509ExtensionsGenerator extGenerator = new X509ExtensionsGenerator(); + + private V2TbsCertListGenerator tbsGen; + private DerObjectIdentifier sigOID; + private AlgorithmIdentifier sigAlgId; + private string signatureAlgorithm; + + public X509V2CrlGenerator() + { + tbsGen = new V2TbsCertListGenerator(); + } + + /** + * reset the generator + */ + public void Reset() + { + tbsGen = new V2TbsCertListGenerator(); + extGenerator.Reset(); + } + + /** + * Set the issuer distinguished name - the issuer is the entity whose private key is used to sign the + * certificate. + */ + public void SetIssuerDN( + X509Name issuer) + { + tbsGen.SetIssuer(issuer); + } + + public void SetThisUpdate( + DateTime date) + { + tbsGen.SetThisUpdate(new Time(date)); + } + + public void SetNextUpdate( + DateTime date) + { + tbsGen.SetNextUpdate(new Time(date)); + } + + /** + * Reason being as indicated by CrlReason, i.e. CrlReason.KeyCompromise + * or 0 if CrlReason is not to be used + **/ + public void AddCrlEntry( + BigInteger userCertificate, + DateTime revocationDate, + int reason) + { + tbsGen.AddCrlEntry(new DerInteger(userCertificate), new Time(revocationDate), reason); + } + + /** + * Add a CRL entry with an Invalidity Date extension as well as a CrlReason extension. + * Reason being as indicated by CrlReason, i.e. CrlReason.KeyCompromise + * or 0 if CrlReason is not to be used + **/ + public void AddCrlEntry( + BigInteger userCertificate, + DateTime revocationDate, + int reason, + DateTime invalidityDate) + { + tbsGen.AddCrlEntry(new DerInteger(userCertificate), new Time(revocationDate), reason, new DerGeneralizedTime(invalidityDate)); + } + + /** + * Add a CRL entry with extensions. + **/ + public void AddCrlEntry( + BigInteger userCertificate, + DateTime revocationDate, + X509Extensions extensions) + { + tbsGen.AddCrlEntry(new DerInteger(userCertificate), new Time(revocationDate), extensions); + } + + /** + * Add the CRLEntry objects contained in a previous CRL. + * + * @param other the X509Crl to source the other entries from. + */ + public void AddCrl( + X509Crl other) + { + if (other == null) + throw new ArgumentNullException("other"); + + ISet revocations = other.GetRevokedCertificates(); + + if (revocations != null) + { + foreach (X509CrlEntry entry in revocations) + { + try + { + tbsGen.AddCrlEntry( + Asn1Sequence.GetInstance( + Asn1Object.FromByteArray(entry.GetEncoded()))); + } + catch (IOException e) + { + throw new CrlException("exception processing encoding of CRL", e); + } + } + } + } + + /// + /// Set the signature algorithm that will be used to sign this CRL. + /// + /// + [Obsolete("Not needed if Generate used with an ISignatureFactory")] + public void SetSignatureAlgorithm( + string signatureAlgorithm) + { + this.signatureAlgorithm = signatureAlgorithm; + + try + { + sigOID = X509Utilities.GetAlgorithmOid(signatureAlgorithm); + } + catch (Exception e) + { + throw new ArgumentException("Unknown signature type requested", e); + } + + sigAlgId = X509Utilities.GetSigAlgID(sigOID, signatureAlgorithm); + + tbsGen.SetSignature(sigAlgId); + } + + /** + * add a given extension field for the standard extensions tag (tag 0) + */ + public void AddExtension( + string oid, + bool critical, + Asn1Encodable extensionValue) + { + extGenerator.AddExtension(new DerObjectIdentifier(oid), critical, extensionValue); + } + + /** + * add a given extension field for the standard extensions tag (tag 0) + */ + public void AddExtension( + DerObjectIdentifier oid, + bool critical, + Asn1Encodable extensionValue) + { + extGenerator.AddExtension(oid, critical, extensionValue); + } + + /** + * add a given extension field for the standard extensions tag (tag 0) + */ + public void AddExtension( + string oid, + bool critical, + byte[] extensionValue) + { + extGenerator.AddExtension(new DerObjectIdentifier(oid), critical, new DerOctetString(extensionValue)); + } + + /** + * add a given extension field for the standard extensions tag (tag 0) + */ + public void AddExtension( + DerObjectIdentifier oid, + bool critical, + byte[] extensionValue) + { + extGenerator.AddExtension(oid, critical, new DerOctetString(extensionValue)); + } + + /// + /// Generate an X.509 CRL, based on the current issuer and subject. + /// + /// The private key of the issuer that is signing this certificate. + /// An X509Crl. + [Obsolete("Use Generate with an ISignatureFactory")] + public X509Crl Generate( + AsymmetricKeyParameter privateKey) + { + return Generate(privateKey, null); + } + + /// + /// Generate an X.509 CRL, based on the current issuer and subject using the specified secure random. + /// + /// The private key of the issuer that is signing this certificate. + /// Your Secure Random instance. + /// An X509Crl. + [Obsolete("Use Generate with an ISignatureFactory")] + public X509Crl Generate( + AsymmetricKeyParameter privateKey, + SecureRandom random) + { + return Generate(new Asn1SignatureFactory(signatureAlgorithm, privateKey, random)); + } + + /// + /// Generate a new X509Crl using the passed in SignatureCalculator. + /// + /// A signature calculator factory with the necessary algorithm details. + /// An X509Crl. + public X509Crl Generate(ISignatureFactory signatureCalculatorFactory) + { + tbsGen.SetSignature((AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails); + + TbsCertificateList tbsCertList = GenerateCertList(); + + IStreamCalculator streamCalculator = signatureCalculatorFactory.CreateCalculator(); + + byte[] encoded = tbsCertList.GetDerEncoded(); + + streamCalculator.Stream.Write(encoded, 0, encoded.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + + return GenerateJcaObject(tbsCertList, (AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails, ((IBlockResult)streamCalculator.GetResult()).Collect()); + } + + private TbsCertificateList GenerateCertList() + { + if (!extGenerator.IsEmpty) + { + tbsGen.SetExtensions(extGenerator.Generate()); + } + + return tbsGen.GenerateTbsCertList(); + } + + private X509Crl GenerateJcaObject( + TbsCertificateList tbsCrl, + AlgorithmIdentifier algId, + byte[] signature) + { + return new X509Crl( + CertificateList.GetInstance( + new DerSequence(tbsCrl, algId, new DerBitString(signature)))); + } + + /// + /// Allows enumeration of the signature names supported by the generator. + /// + public IEnumerable SignatureAlgNames + { + get { return X509Utilities.GetAlgNames(); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2CRLGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2CRLGenerator.cs.meta new file mode 100644 index 00000000..d45336d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V2CRLGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4967cc865d9366a41bc51c9bc1a36da0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V3CertificateGenerator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V3CertificateGenerator.cs new file mode 100644 index 00000000..e4894a37 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V3CertificateGenerator.cs @@ -0,0 +1,348 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Operators; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509 +{ + /// + /// A class to Generate Version 3 X509Certificates. + /// + public class X509V3CertificateGenerator + { + private readonly X509ExtensionsGenerator extGenerator = new X509ExtensionsGenerator(); + + private V3TbsCertificateGenerator tbsGen; + private DerObjectIdentifier sigOid; + private AlgorithmIdentifier sigAlgId; + private string signatureAlgorithm; + + public X509V3CertificateGenerator() + { + tbsGen = new V3TbsCertificateGenerator(); + } + + /// + /// Reset the Generator. + /// + public void Reset() + { + tbsGen = new V3TbsCertificateGenerator(); + extGenerator.Reset(); + } + + /// + /// Set the certificate's serial number. + /// + /// Make serial numbers long, if you have no serial number policy make sure the number is at least 16 bytes of secure random data. + /// You will be surprised how ugly a serial number collision can Get. + /// The serial number. + public void SetSerialNumber( + BigInteger serialNumber) + { + if (serialNumber.SignValue <= 0) + { + throw new ArgumentException("serial number must be a positive integer", "serialNumber"); + } + + tbsGen.SetSerialNumber(new DerInteger(serialNumber)); + } + + /// + /// Set the distinguished name of the issuer. + /// The issuer is the entity which is signing the certificate. + /// + /// The issuer's DN. + public void SetIssuerDN( + X509Name issuer) + { + tbsGen.SetIssuer(issuer); + } + + /// + /// Set the date that this certificate is to be valid from. + /// + /// + public void SetNotBefore( + DateTime date) + { + tbsGen.SetStartDate(new Time(date)); + } + + /// + /// Set the date after which this certificate will no longer be valid. + /// + /// + public void SetNotAfter( + DateTime date) + { + tbsGen.SetEndDate(new Time(date)); + } + + /// + /// Set the DN of the entity that this certificate is about. + /// + /// + public void SetSubjectDN( + X509Name subject) + { + tbsGen.SetSubject(subject); + } + + /// + /// Set the public key that this certificate identifies. + /// + /// + public void SetPublicKey( + AsymmetricKeyParameter publicKey) + { + tbsGen.SetSubjectPublicKeyInfo(SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(publicKey)); + } + + /// + /// Set the signature algorithm that will be used to sign this certificate. + /// + /// + [Obsolete("Not needed if Generate used with an ISignatureFactory")] + public void SetSignatureAlgorithm( + string signatureAlgorithm) + { + this.signatureAlgorithm = signatureAlgorithm; + + try + { + sigOid = X509Utilities.GetAlgorithmOid(signatureAlgorithm); + } + catch (Exception) + { + throw new ArgumentException("Unknown signature type requested: " + signatureAlgorithm); + } + + sigAlgId = X509Utilities.GetSigAlgID(sigOid, signatureAlgorithm); + + tbsGen.SetSignature(sigAlgId); + } + + /// + /// Set the subject unique ID - note: it is very rare that it is correct to do this. + /// + /// + public void SetSubjectUniqueID( + bool[] uniqueID) + { + tbsGen.SetSubjectUniqueID(booleanToBitString(uniqueID)); + } + + /// + /// Set the issuer unique ID - note: it is very rare that it is correct to do this. + /// + /// + public void SetIssuerUniqueID( + bool[] uniqueID) + { + tbsGen.SetIssuerUniqueID(booleanToBitString(uniqueID)); + } + + private DerBitString booleanToBitString( + bool[] id) + { + byte[] bytes = new byte[(id.Length + 7) / 8]; + + for (int i = 0; i != id.Length; i++) + { + if (id[i]) + { + bytes[i / 8] |= (byte)(1 << ((7 - (i % 8)))); + } + } + + int pad = id.Length % 8; + + if (pad == 0) + { + return new DerBitString(bytes); + } + + return new DerBitString(bytes, 8 - pad); + } + + /// + /// Add a given extension field for the standard extensions tag (tag 3). + /// + /// string containing a dotted decimal Object Identifier. + /// Is it critical. + /// The value. + public void AddExtension( + string oid, + bool critical, + Asn1Encodable extensionValue) + { + extGenerator.AddExtension(new DerObjectIdentifier(oid), critical, extensionValue); + } + + /// + /// Add an extension to this certificate. + /// + /// Its Object Identifier. + /// Is it critical. + /// The value. + public void AddExtension( + DerObjectIdentifier oid, + bool critical, + Asn1Encodable extensionValue) + { + extGenerator.AddExtension(oid, critical, extensionValue); + } + + /// + /// Add an extension using a string with a dotted decimal OID. + /// + /// string containing a dotted decimal Object Identifier. + /// Is it critical. + /// byte[] containing the value of this extension. + public void AddExtension( + string oid, + bool critical, + byte[] extensionValue) + { + extGenerator.AddExtension(new DerObjectIdentifier(oid), critical, new DerOctetString(extensionValue)); + } + + /// + /// Add an extension to this certificate. + /// + /// Its Object Identifier. + /// Is it critical. + /// byte[] containing the value of this extension. + public void AddExtension( + DerObjectIdentifier oid, + bool critical, + byte[] extensionValue) + { + extGenerator.AddExtension(oid, critical, new DerOctetString(extensionValue)); + } + + /// + /// Add a given extension field for the standard extensions tag (tag 3), + /// copying the extension value from another certificate. + /// + public void CopyAndAddExtension( + string oid, + bool critical, + X509Certificate cert) + { + CopyAndAddExtension(new DerObjectIdentifier(oid), critical, cert); + } + + /** + * add a given extension field for the standard extensions tag (tag 3) + * copying the extension value from another certificate. + * @throws CertificateParsingException if the extension cannot be extracted. + */ + public void CopyAndAddExtension( + DerObjectIdentifier oid, + bool critical, + X509Certificate cert) + { + Asn1OctetString extValue = cert.GetExtensionValue(oid); + + if (extValue == null) + { + throw new CertificateParsingException("extension " + oid + " not present"); + } + + try + { + Asn1Encodable value = X509ExtensionUtilities.FromExtensionValue(extValue); + + this.AddExtension(oid, critical, value); + } + catch (Exception e) + { + throw new CertificateParsingException(e.Message, e); + } + } + + /// + /// Generate an X509Certificate. + /// + /// The private key of the issuer that is signing this certificate. + /// An X509Certificate. + [Obsolete("Use Generate with an ISignatureFactory")] + public X509Certificate Generate( + AsymmetricKeyParameter privateKey) + { + return Generate(privateKey, null); + } + + /// + /// Generate an X509Certificate using your own SecureRandom. + /// + /// The private key of the issuer that is signing this certificate. + /// You Secure Random instance. + /// An X509Certificate. + [Obsolete("Use Generate with an ISignatureFactory")] + public X509Certificate Generate( + AsymmetricKeyParameter privateKey, + SecureRandom random) + { + return Generate(new Asn1SignatureFactory(signatureAlgorithm, privateKey, random)); + } + + /// + /// Generate a new X509Certificate using the passed in SignatureCalculator. + /// + /// A signature calculator factory with the necessary algorithm details. + /// An X509Certificate. + public X509Certificate Generate(ISignatureFactory signatureCalculatorFactory) + { + tbsGen.SetSignature ((AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails); + + if (!extGenerator.IsEmpty) + { + tbsGen.SetExtensions(extGenerator.Generate()); + } + + TbsCertificateStructure tbsCert = tbsGen.GenerateTbsCertificate(); + + IStreamCalculator streamCalculator = signatureCalculatorFactory.CreateCalculator(); + + byte[] encoded = tbsCert.GetDerEncoded(); + + streamCalculator.Stream.Write(encoded, 0, encoded.Length); + + BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(streamCalculator.Stream); + + return GenerateJcaObject(tbsCert, (AlgorithmIdentifier)signatureCalculatorFactory.AlgorithmDetails, ((IBlockResult)streamCalculator.GetResult()).Collect()); + } + + private X509Certificate GenerateJcaObject( + TbsCertificateStructure tbsCert, + AlgorithmIdentifier sigAlg, + byte[] signature) + { + return new X509Certificate( + new X509CertificateStructure(tbsCert, sigAlg, new DerBitString(signature))); + } + + /// + /// Allows enumeration of the signature names supported by the generator. + /// + public IEnumerable SignatureAlgNames + { + get { return X509Utilities.GetAlgNames(); } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V3CertificateGenerator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V3CertificateGenerator.cs.meta new file mode 100644 index 00000000..51287d94 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/X509V3CertificateGenerator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6a3594cad87c9b4439139843a48e223c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension.meta new file mode 100644 index 00000000..66f95145 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 26902280df03e254eb103b0cc513363f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/AuthorityKeyIdentifierStructure.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/AuthorityKeyIdentifierStructure.cs new file mode 100644 index 00000000..27d80f78 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/AuthorityKeyIdentifierStructure.cs @@ -0,0 +1,106 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension +{ + /// A high level authority key identifier. + public class AuthorityKeyIdentifierStructure + : AuthorityKeyIdentifier + { + /** + * Constructor which will take the byte[] returned from getExtensionValue() + * + * @param encodedValue a DER octet encoded string with the extension structure in it. + * @throws IOException on parsing errors. + */ + // TODO Add a functional constructor from byte[]? + public AuthorityKeyIdentifierStructure( + Asn1OctetString encodedValue) + : base((Asn1Sequence) X509ExtensionUtilities.FromExtensionValue(encodedValue)) + { + } + + private static Asn1Sequence FromCertificate( + X509Certificate certificate) + { + try + { + GeneralName genName = new GeneralName( + PrincipalUtilities.GetIssuerX509Principal(certificate)); + + if (certificate.Version == 3) + { + Asn1OctetString ext = certificate.GetExtensionValue(X509Extensions.SubjectKeyIdentifier); + + if (ext != null) + { + Asn1OctetString str = (Asn1OctetString) X509ExtensionUtilities.FromExtensionValue(ext); + + return (Asn1Sequence) new AuthorityKeyIdentifier( + str.GetOctets(), new GeneralNames(genName), certificate.SerialNumber).ToAsn1Object(); + } + } + + SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo( + certificate.GetPublicKey()); + + return (Asn1Sequence) new AuthorityKeyIdentifier( + info, new GeneralNames(genName), certificate.SerialNumber).ToAsn1Object(); + } + catch (Exception e) + { + throw new CertificateParsingException("Exception extracting certificate details", e); + } + } + + private static Asn1Sequence FromKey( + AsymmetricKeyParameter pubKey) + { + try + { + SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(pubKey); + + return (Asn1Sequence) new AuthorityKeyIdentifier(info).ToAsn1Object(); + } + catch (Exception e) + { + throw new InvalidKeyException("can't process key: " + e); + } + } + + /** + * Create an AuthorityKeyIdentifier using the passed in certificate's public + * key, issuer and serial number. + * + * @param certificate the certificate providing the information. + * @throws CertificateParsingException if there is a problem processing the certificate + */ + public AuthorityKeyIdentifierStructure( + X509Certificate certificate) + : base(FromCertificate(certificate)) + { + } + + /** + * Create an AuthorityKeyIdentifier using just the hash of the + * public key. + * + * @param pubKey the key to generate the hash from. + * @throws InvalidKeyException if there is a problem using the key. + */ + public AuthorityKeyIdentifierStructure( + AsymmetricKeyParameter pubKey) + : base(FromKey(pubKey)) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/AuthorityKeyIdentifierStructure.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/AuthorityKeyIdentifierStructure.cs.meta new file mode 100644 index 00000000..f12de944 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/AuthorityKeyIdentifierStructure.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bb0f4335ed25d2a4a9fd365799fdd64a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/SubjectKeyIdentifierStructure.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/SubjectKeyIdentifierStructure.cs new file mode 100644 index 00000000..cfd8d4c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/SubjectKeyIdentifierStructure.cs @@ -0,0 +1,53 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension +{ + /** + * A high level subject key identifier. + */ + public class SubjectKeyIdentifierStructure + : SubjectKeyIdentifier + { + /** + * Constructor which will take the byte[] returned from getExtensionValue() + * + * @param encodedValue a DER octet encoded string with the extension structure in it. + * @throws IOException on parsing errors. + */ + public SubjectKeyIdentifierStructure( + Asn1OctetString encodedValue) + : base((Asn1OctetString) X509ExtensionUtilities.FromExtensionValue(encodedValue)) + { + } + + private static Asn1OctetString FromPublicKey( + AsymmetricKeyParameter pubKey) + { + try + { + SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(pubKey); + + return (Asn1OctetString) new SubjectKeyIdentifier(info).ToAsn1Object(); + } + catch (Exception e) + { + throw new CertificateParsingException("Exception extracting certificate details: " + e.ToString()); + } + } + + public SubjectKeyIdentifierStructure( + AsymmetricKeyParameter pubKey) + : base(FromPublicKey(pubKey)) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/SubjectKeyIdentifierStructure.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/SubjectKeyIdentifierStructure.cs.meta new file mode 100644 index 00000000..d21d9e24 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/SubjectKeyIdentifierStructure.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 004dfdf815abe524093ddfebf9234b73 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/X509ExtensionUtil.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/X509ExtensionUtil.cs new file mode 100644 index 00000000..de059e76 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/X509ExtensionUtil.cs @@ -0,0 +1,95 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Security.Certificates; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension +{ + public class X509ExtensionUtilities + { + public static Asn1Object FromExtensionValue( + Asn1OctetString extensionValue) + { + return Asn1Object.FromByteArray(extensionValue.GetOctets()); + } + + public static ICollection GetIssuerAlternativeNames( + X509Certificate cert) + { + Asn1OctetString extVal = cert.GetExtensionValue(X509Extensions.IssuerAlternativeName); + + return GetAlternativeName(extVal); + } + + public static ICollection GetSubjectAlternativeNames( + X509Certificate cert) + { + Asn1OctetString extVal = cert.GetExtensionValue(X509Extensions.SubjectAlternativeName); + + return GetAlternativeName(extVal); + } + + private static ICollection GetAlternativeName( + Asn1OctetString extVal) + { + IList temp = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + + if (extVal != null) + { + try + { + Asn1Sequence seq = DerSequence.GetInstance(FromExtensionValue(extVal)); + + foreach (Asn1Encodable primName in seq) + { + IList list = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + GeneralName genName = GeneralName.GetInstance(primName); + + list.Add(genName.TagNo); + + switch (genName.TagNo) + { + case GeneralName.EdiPartyName: + case GeneralName.X400Address: + case GeneralName.OtherName: + list.Add(genName.Name.ToAsn1Object()); + break; + case GeneralName.DirectoryName: + list.Add(X509Name.GetInstance(genName.Name).ToString()); + break; + case GeneralName.DnsName: + case GeneralName.Rfc822Name: + case GeneralName.UniformResourceIdentifier: + list.Add(((IAsn1String)genName.Name).GetString()); + break; + case GeneralName.RegisteredID: + list.Add(DerObjectIdentifier.GetInstance(genName.Name).Id); + break; + case GeneralName.IPAddress: + list.Add(DerOctetString.GetInstance(genName.Name).GetOctets()); + break; + default: + throw new IOException("Bad tag number: " + genName.TagNo); + } + + temp.Add(list); + } + } + catch (Exception e) + { + throw new CertificateParsingException(e.Message); + } + } + + return temp; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/X509ExtensionUtil.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/X509ExtensionUtil.cs.meta new file mode 100644 index 00000000..0435a514 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/extension/X509ExtensionUtil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1e9b9d84df723247b8211204f278332 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store.meta new file mode 100644 index 00000000..4cb4dab6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5b7983a5c52108d458439861101ff522 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Selector.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Selector.cs new file mode 100644 index 00000000..e33824b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Selector.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + public interface IX509Selector +#if !(SILVERLIGHT || PORTABLE || NETFX_CORE) + : ICloneable +#endif + { +#if SILVERLIGHT || PORTABLE || NETFX_CORE + object Clone(); +#endif + bool Match(object obj); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Selector.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Selector.cs.meta new file mode 100644 index 00000000..3aeedb70 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Selector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9ea6ae6bb5e274842b2a0eb9f889f24e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Store.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Store.cs new file mode 100644 index 00000000..b839b396 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Store.cs @@ -0,0 +1,15 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + public interface IX509Store + { +// void Init(IX509StoreParameters parameters); + ICollection GetMatches(IX509Selector selector); + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Store.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Store.cs.meta new file mode 100644 index 00000000..96a2acf3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509Store.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea9951e0032af704bb0991a2df9a955f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509StoreParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509StoreParameters.cs new file mode 100644 index 00000000..90c06bbc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509StoreParameters.cs @@ -0,0 +1,12 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + public interface IX509StoreParameters + { + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509StoreParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509StoreParameters.cs.meta new file mode 100644 index 00000000..d8479906 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/IX509StoreParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b0773463c26ca0540a74bb976fa32696 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/NoSuchStoreException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/NoSuchStoreException.cs new file mode 100644 index 00000000..aff39e51 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/NoSuchStoreException.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class NoSuchStoreException + : X509StoreException + { + public NoSuchStoreException() + { + } + + public NoSuchStoreException( + string message) + : base(message) + { + } + + public NoSuchStoreException( + string message, + Exception e) + : base(message, e) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/NoSuchStoreException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/NoSuchStoreException.cs.meta new file mode 100644 index 00000000..2917b7ac --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/NoSuchStoreException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01fab1b9163bc3e4e80d844d33d1f405 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509AttrCertStoreSelector.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509AttrCertStoreSelector.cs new file mode 100644 index 00000000..ef0005ef --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509AttrCertStoreSelector.cs @@ -0,0 +1,380 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.IO; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + /** + * This class is an Selector like implementation to select + * attribute certificates from a given set of criteria. + * + * @see org.bouncycastle.x509.X509AttributeCertificate + * @see org.bouncycastle.x509.X509Store + */ + public class X509AttrCertStoreSelector + : IX509Selector + { + // TODO: name constraints??? + + private IX509AttributeCertificate attributeCert; + private DateTimeObject attributeCertificateValid; + private AttributeCertificateHolder holder; + private AttributeCertificateIssuer issuer; + private BigInteger serialNumber; + private ISet targetNames = new HashSet(); + private ISet targetGroups = new HashSet(); + + public X509AttrCertStoreSelector() + { + } + + private X509AttrCertStoreSelector( + X509AttrCertStoreSelector o) + { + this.attributeCert = o.attributeCert; + this.attributeCertificateValid = o.attributeCertificateValid; + this.holder = o.holder; + this.issuer = o.issuer; + this.serialNumber = o.serialNumber; + this.targetGroups = new HashSet(o.targetGroups); + this.targetNames = new HashSet(o.targetNames); + } + + /// + /// Decides if the given attribute certificate should be selected. + /// + /// The attribute certificate to be checked. + /// true if the object matches this selector. + public bool Match( + object obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + + IX509AttributeCertificate attrCert = obj as IX509AttributeCertificate; + + if (attrCert == null) + return false; + + if (this.attributeCert != null && !this.attributeCert.Equals(attrCert)) + return false; + + if (serialNumber != null && !attrCert.SerialNumber.Equals(serialNumber)) + return false; + + if (holder != null && !attrCert.Holder.Equals(holder)) + return false; + + if (issuer != null && !attrCert.Issuer.Equals(issuer)) + return false; + + if (attributeCertificateValid != null && !attrCert.IsValid(attributeCertificateValid.Value)) + return false; + + if (targetNames.Count > 0 || targetGroups.Count > 0) + { + Asn1OctetString targetInfoExt = attrCert.GetExtensionValue( + X509Extensions.TargetInformation); + + if (targetInfoExt != null) + { + TargetInformation targetinfo; + try + { + targetinfo = TargetInformation.GetInstance( + X509ExtensionUtilities.FromExtensionValue(targetInfoExt)); + } + catch (Exception) + { + return false; + } + + Targets[] targetss = targetinfo.GetTargetsObjects(); + + if (targetNames.Count > 0) + { + bool found = false; + + for (int i = 0; i < targetss.Length && !found; i++) + { + Target[] targets = targetss[i].GetTargets(); + + for (int j = 0; j < targets.Length; j++) + { + GeneralName targetName = targets[j].TargetName; + + if (targetName != null && targetNames.Contains(targetName)) + { + found = true; + break; + } + } + } + if (!found) + { + return false; + } + } + + if (targetGroups.Count > 0) + { + bool found = false; + + for (int i = 0; i < targetss.Length && !found; i++) + { + Target[] targets = targetss[i].GetTargets(); + + for (int j = 0; j < targets.Length; j++) + { + GeneralName targetGroup = targets[j].TargetGroup; + + if (targetGroup != null && targetGroups.Contains(targetGroup)) + { + found = true; + break; + } + } + } + + if (!found) + { + return false; + } + } + } + } + + return true; + } + + public object Clone() + { + return new X509AttrCertStoreSelector(this); + } + + /// The attribute certificate which must be matched. + /// If null is given, any will do. + public IX509AttributeCertificate AttributeCert + { + get { return attributeCert; } + set { this.attributeCert = value; } + } + + [Obsolete("Use AttributeCertificateValid instead")] + public DateTimeObject AttribueCertificateValid + { + get { return attributeCertificateValid; } + set { this.attributeCertificateValid = value; } + } + + /// The criteria for validity + /// If null is given any will do. + public DateTimeObject AttributeCertificateValid + { + get { return attributeCertificateValid; } + set { this.attributeCertificateValid = value; } + } + + /// The holder. + /// If null is given any will do. + public AttributeCertificateHolder Holder + { + get { return holder; } + set { this.holder = value; } + } + + /// The issuer. + /// If null is given any will do. + public AttributeCertificateIssuer Issuer + { + get { return issuer; } + set { this.issuer = value; } + } + + /// The serial number. + /// If null is given any will do. + public BigInteger SerialNumber + { + get { return serialNumber; } + set { this.serialNumber = value; } + } + + /** + * Adds a target name criterion for the attribute certificate to the target + * information extension criteria. The X509AttributeCertificate + * must contain at least one of the specified target names. + *

    + * Each attribute certificate may contain a target information extension + * limiting the servers where this attribute certificate can be used. If + * this extension is not present, the attribute certificate is not targeted + * and may be accepted by any server. + *

    + * + * @param name The name as a GeneralName (not null) + */ + public void AddTargetName( + GeneralName name) + { + targetNames.Add(name); + } + + /** + * Adds a target name criterion for the attribute certificate to the target + * information extension criteria. The X509AttributeCertificate + * must contain at least one of the specified target names. + *

    + * Each attribute certificate may contain a target information extension + * limiting the servers where this attribute certificate can be used. If + * this extension is not present, the attribute certificate is not targeted + * and may be accepted by any server. + *

    + * + * @param name a byte array containing the name in ASN.1 DER encoded form of a GeneralName + * @throws IOException if a parsing error occurs. + */ + public void AddTargetName( + byte[] name) + { + AddTargetName(GeneralName.GetInstance(Asn1Object.FromByteArray(name))); + } + + /** + * Adds a collection with target names criteria. If null is + * given any will do. + *

    + * The collection consists of either GeneralName objects or byte[] arrays representing + * DER encoded GeneralName structures. + *

    + * + * @param names A collection of target names. + * @throws IOException if a parsing error occurs. + * @see #AddTargetName(byte[]) + * @see #AddTargetName(GeneralName) + */ + public void SetTargetNames( + IEnumerable names) + { + targetNames = ExtractGeneralNames(names); + } + + /** + * Gets the target names. The collection consists of Lists + * made up of an Integer in the first entry and a DER encoded + * byte array or a String in the second entry. + *

    The returned collection is immutable.

    + * + * @return The collection of target names + * @see #setTargetNames(Collection) + */ + public IEnumerable GetTargetNames() + { + return new EnumerableProxy(targetNames); + } + + /** + * Adds a target group criterion for the attribute certificate to the target + * information extension criteria. The X509AttributeCertificate + * must contain at least one of the specified target groups. + *

    + * Each attribute certificate may contain a target information extension + * limiting the servers where this attribute certificate can be used. If + * this extension is not present, the attribute certificate is not targeted + * and may be accepted by any server. + *

    + * + * @param group The group as GeneralName form (not null) + */ + public void AddTargetGroup( + GeneralName group) + { + targetGroups.Add(group); + } + + /** + * Adds a target group criterion for the attribute certificate to the target + * information extension criteria. The X509AttributeCertificate + * must contain at least one of the specified target groups. + *

    + * Each attribute certificate may contain a target information extension + * limiting the servers where this attribute certificate can be used. If + * this extension is not present, the attribute certificate is not targeted + * and may be accepted by any server. + *

    + * + * @param name a byte array containing the group in ASN.1 DER encoded form of a GeneralName + * @throws IOException if a parsing error occurs. + */ + public void AddTargetGroup( + byte[] name) + { + AddTargetGroup(GeneralName.GetInstance(Asn1Object.FromByteArray(name))); + } + + /** + * Adds a collection with target groups criteria. If null is + * given any will do. + *

    + * The collection consists of GeneralName objects or byte[] + * representing DER encoded GeneralNames. + *

    + * + * @param names A collection of target groups. + * @throws IOException if a parsing error occurs. + * @see #AddTargetGroup(byte[]) + * @see #AddTargetGroup(GeneralName) + */ + public void SetTargetGroups( + IEnumerable names) + { + targetGroups = ExtractGeneralNames(names); + } + + /** + * Gets the target groups. The collection consists of Lists + * made up of an Integer in the first entry and a DER encoded + * byte array or a String in the second entry. + *

    The returned collection is immutable.

    + * + * @return The collection of target groups. + * @see #setTargetGroups(Collection) + */ + public IEnumerable GetTargetGroups() + { + return new EnumerableProxy(targetGroups); + } + + private ISet ExtractGeneralNames( + IEnumerable names) + { + ISet result = new HashSet(); + + if (names != null) + { + foreach (object o in names) + { + if (o is GeneralName) + { + result.Add(o); + } + else + { + result.Add(GeneralName.GetInstance(Asn1Object.FromByteArray((byte[]) o))); + } + } + } + + return result; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509AttrCertStoreSelector.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509AttrCertStoreSelector.cs.meta new file mode 100644 index 00000000..22ca0207 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509AttrCertStoreSelector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05a1711d73cac0449a5f694102783ad4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertPairStoreSelector.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertPairStoreSelector.cs new file mode 100644 index 00000000..f2a2687d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertPairStoreSelector.cs @@ -0,0 +1,96 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + /// + /// This class is an IX509Selector implementation to select + /// certificate pairs, which are e.g. used for cross certificates. The set of + /// criteria is given from two X509CertStoreSelector objects, + /// each of which, if present, must match the respective component of a pair. + /// + public class X509CertPairStoreSelector + : IX509Selector + { + private static X509CertStoreSelector CloneSelector( + X509CertStoreSelector s) + { + return s == null ? null : (X509CertStoreSelector) s.Clone(); + } + + private X509CertificatePair certPair; + private X509CertStoreSelector forwardSelector; + private X509CertStoreSelector reverseSelector; + + public X509CertPairStoreSelector() + { + } + + private X509CertPairStoreSelector( + X509CertPairStoreSelector o) + { + this.certPair = o.CertPair; + this.forwardSelector = o.ForwardSelector; + this.reverseSelector = o.ReverseSelector; + } + + /// The certificate pair which is used for testing on equality. + public X509CertificatePair CertPair + { + get { return certPair; } + set { this.certPair = value; } + } + + /// The certificate selector for the forward part. + public X509CertStoreSelector ForwardSelector + { + get { return CloneSelector(forwardSelector); } + set { this.forwardSelector = CloneSelector(value); } + } + + /// The certificate selector for the reverse part. + public X509CertStoreSelector ReverseSelector + { + get { return CloneSelector(reverseSelector); } + set { this.reverseSelector = CloneSelector(value); } + } + + /// + /// Decides if the given certificate pair should be selected. If + /// obj is not a X509CertificatePair, this method + /// returns false. + /// + /// The X509CertificatePair to be tested. + /// true if the object matches this selector. + public bool Match( + object obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + + X509CertificatePair pair = obj as X509CertificatePair; + + if (pair == null) + return false; + + if (certPair != null && !certPair.Equals(pair)) + return false; + + if (forwardSelector != null && !forwardSelector.Match(pair.Forward)) + return false; + + if (reverseSelector != null && !reverseSelector.Match(pair.Reverse)) + return false; + + return true; + } + + public object Clone() + { + return new X509CertPairStoreSelector(this); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertPairStoreSelector.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertPairStoreSelector.cs.meta new file mode 100644 index 00000000..e6732f57 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertPairStoreSelector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b519c06b0ed0da4e8bca4f63037fea6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertStoreSelector.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertStoreSelector.cs new file mode 100644 index 00000000..936d9130 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertStoreSelector.cs @@ -0,0 +1,350 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Collections; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + public class X509CertStoreSelector + : IX509Selector + { + // TODO Missing criteria? + + private byte[] authorityKeyIdentifier; + private int basicConstraints = -1; + private X509Certificate certificate; + private DateTimeObject certificateValid; + private ISet extendedKeyUsage; + private bool ignoreX509NameOrdering; + private X509Name issuer; + private bool[] keyUsage; + private ISet policy; + private DateTimeObject privateKeyValid; + private BigInteger serialNumber; + private X509Name subject; + private byte[] subjectKeyIdentifier; + private SubjectPublicKeyInfo subjectPublicKey; + private DerObjectIdentifier subjectPublicKeyAlgID; + + public X509CertStoreSelector() + { + } + + public X509CertStoreSelector( + X509CertStoreSelector o) + { + this.authorityKeyIdentifier = o.AuthorityKeyIdentifier; + this.basicConstraints = o.BasicConstraints; + this.certificate = o.Certificate; + this.certificateValid = o.CertificateValid; + this.extendedKeyUsage = o.ExtendedKeyUsage; + this.ignoreX509NameOrdering = o.IgnoreX509NameOrdering; + this.issuer = o.Issuer; + this.keyUsage = o.KeyUsage; + this.policy = o.Policy; + this.privateKeyValid = o.PrivateKeyValid; + this.serialNumber = o.SerialNumber; + this.subject = o.Subject; + this.subjectKeyIdentifier = o.SubjectKeyIdentifier; + this.subjectPublicKey = o.SubjectPublicKey; + this.subjectPublicKeyAlgID = o.SubjectPublicKeyAlgID; + } + + public virtual object Clone() + { + return new X509CertStoreSelector(this); + } + + public byte[] AuthorityKeyIdentifier + { + get { return Arrays.Clone(authorityKeyIdentifier); } + set { authorityKeyIdentifier = Arrays.Clone(value); } + } + + public int BasicConstraints + { + get { return basicConstraints; } + set + { + if (value < -2) + throw new ArgumentException("value can't be less than -2", "value"); + + basicConstraints = value; + } + } + + public X509Certificate Certificate + { + get { return certificate; } + set { this.certificate = value; } + } + + public DateTimeObject CertificateValid + { + get { return certificateValid; } + set { certificateValid = value; } + } + + public ISet ExtendedKeyUsage + { + get { return CopySet(extendedKeyUsage); } + set { extendedKeyUsage = CopySet(value); } + } + + public bool IgnoreX509NameOrdering + { + get { return ignoreX509NameOrdering; } + set { this.ignoreX509NameOrdering = value; } + } + + public X509Name Issuer + { + get { return issuer; } + set { issuer = value; } + } + + [Obsolete("Avoid working with X509Name objects in string form")] + public string IssuerAsString + { + get { return issuer != null ? issuer.ToString() : null; } + } + + public bool[] KeyUsage + { + get { return CopyBoolArray(keyUsage); } + set { keyUsage = CopyBoolArray(value); } + } + + /// + /// An ISet of DerObjectIdentifier objects. + /// + public ISet Policy + { + get { return CopySet(policy); } + set { policy = CopySet(value); } + } + + public DateTimeObject PrivateKeyValid + { + get { return privateKeyValid; } + set { privateKeyValid = value; } + } + + public BigInteger SerialNumber + { + get { return serialNumber; } + set { serialNumber = value; } + } + + public X509Name Subject + { + get { return subject; } + set { subject = value; } + } + + [Obsolete("Avoid working with X509Name objects in string form")] + public string SubjectAsString + { + get { return subject != null ? subject.ToString() : null; } + } + + public byte[] SubjectKeyIdentifier + { + get { return Arrays.Clone(subjectKeyIdentifier); } + set { subjectKeyIdentifier = Arrays.Clone(value); } + } + + public SubjectPublicKeyInfo SubjectPublicKey + { + get { return subjectPublicKey; } + set { subjectPublicKey = value; } + } + + public DerObjectIdentifier SubjectPublicKeyAlgID + { + get { return subjectPublicKeyAlgID; } + set { subjectPublicKeyAlgID = value; } + } + + public virtual bool Match( + object obj) + { + X509Certificate c = obj as X509Certificate; + + if (c == null) + return false; + + if (!MatchExtension(authorityKeyIdentifier, c, X509Extensions.AuthorityKeyIdentifier)) + return false; + + if (basicConstraints != -1) + { + int bc = c.GetBasicConstraints(); + + if (basicConstraints == -2) + { + if (bc != -1) + return false; + } + else + { + if (bc < basicConstraints) + return false; + } + } + + if (certificate != null && !certificate.Equals(c)) + return false; + + if (certificateValid != null && !c.IsValid(certificateValid.Value)) + return false; + + if (extendedKeyUsage != null) + { + IList eku = c.GetExtendedKeyUsage(); + + // Note: if no extended key usage set, all key purposes are implicitly allowed + + if (eku != null) + { + foreach (DerObjectIdentifier oid in extendedKeyUsage) + { + if (!eku.Contains(oid.Id)) + return false; + } + } + } + + if (issuer != null && !issuer.Equivalent(c.IssuerDN, !ignoreX509NameOrdering)) + return false; + + if (keyUsage != null) + { + bool[] ku = c.GetKeyUsage(); + + // Note: if no key usage set, all key purposes are implicitly allowed + + if (ku != null) + { + for (int i = 0; i < 9; ++i) + { + if (keyUsage[i] && !ku[i]) + return false; + } + } + } + + if (policy != null) + { + Asn1OctetString extVal = c.GetExtensionValue(X509Extensions.CertificatePolicies); + if (extVal == null) + return false; + + Asn1Sequence certPolicies = Asn1Sequence.GetInstance( + X509ExtensionUtilities.FromExtensionValue(extVal)); + + if (policy.Count < 1 && certPolicies.Count < 1) + return false; + + bool found = false; + foreach (PolicyInformation pi in certPolicies) + { + if (policy.Contains(pi.PolicyIdentifier)) + { + found = true; + break; + } + } + + if (!found) + return false; + } + + if (privateKeyValid != null) + { + Asn1OctetString extVal = c.GetExtensionValue(X509Extensions.PrivateKeyUsagePeriod); + if (extVal == null) + return false; + + PrivateKeyUsagePeriod pkup = PrivateKeyUsagePeriod.GetInstance( + X509ExtensionUtilities.FromExtensionValue(extVal)); + + DateTime dt = privateKeyValid.Value; + DateTime notAfter = pkup.NotAfter.ToDateTime(); + DateTime notBefore = pkup.NotBefore.ToDateTime(); + + if (dt.CompareTo(notAfter) > 0 || dt.CompareTo(notBefore) < 0) + return false; + } + + if (serialNumber != null && !serialNumber.Equals(c.SerialNumber)) + return false; + + if (subject != null && !subject.Equivalent(c.SubjectDN, !ignoreX509NameOrdering)) + return false; + + if (!MatchExtension(subjectKeyIdentifier, c, X509Extensions.SubjectKeyIdentifier)) + return false; + + if (subjectPublicKey != null && !subjectPublicKey.Equals(GetSubjectPublicKey(c))) + return false; + + if (subjectPublicKeyAlgID != null + && !subjectPublicKeyAlgID.Equals(GetSubjectPublicKey(c).AlgorithmID)) + return false; + + return true; + } + + internal static bool IssuersMatch( + X509Name a, + X509Name b) + { + return a == null ? b == null : a.Equivalent(b, true); + } + + private static bool[] CopyBoolArray( + bool[] b) + { + return b == null ? null : (bool[]) b.Clone(); + } + + private static ISet CopySet( + ISet s) + { + return s == null ? null : new HashSet(s); + } + + private static SubjectPublicKeyInfo GetSubjectPublicKey( + X509Certificate c) + { + return SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(c.GetPublicKey()); + } + + private static bool MatchExtension( + byte[] b, + X509Certificate c, + DerObjectIdentifier oid) + { + if (b == null) + return true; + + Asn1OctetString extVal = c.GetExtensionValue(oid); + + if (extVal == null) + return false; + + return Arrays.AreEqual(b, extVal.GetOctets()); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertStoreSelector.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertStoreSelector.cs.meta new file mode 100644 index 00000000..abdadd30 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CertStoreSelector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12b4022923dff834aa70b6c746f2e976 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStore.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStore.cs new file mode 100644 index 00000000..79d680f7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStore.cs @@ -0,0 +1,55 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + /** + * A simple collection backed store. + */ + internal class X509CollectionStore + : IX509Store + { + private ICollection _local; + + /** + * Basic constructor. + * + * @param collection - initial contents for the store, this is copied. + */ + internal X509CollectionStore( + ICollection collection) + { + _local = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(collection); + } + + /** + * Return the matches in the collection for the passed in selector. + * + * @param selector the selector to match against. + * @return a possibly empty collection of matching objects. + */ + public ICollection GetMatches( + IX509Selector selector) + { + if (selector == null) + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(_local); + } + + IList result = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(); + foreach (object obj in _local) + { + if (selector.Match(obj)) + result.Add(obj); + } + + return result; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStore.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStore.cs.meta new file mode 100644 index 00000000..e5def697 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStore.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c62d23a23e8e043429d9fdb60117aee8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStoreParameters.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStoreParameters.cs new file mode 100644 index 00000000..16d7abf0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStoreParameters.cs @@ -0,0 +1,64 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; +using System.Text; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + /// This class contains a collection for collection based X509Stores. + public class X509CollectionStoreParameters + : IX509StoreParameters + { + private readonly IList collection; + + /// + /// Constructor. + ///

    + /// The collection is copied. + ///

    + ///
    + /// The collection containing X.509 object types. + /// If collection is null. + public X509CollectionStoreParameters( + ICollection collection) + { + if (collection == null) + throw new ArgumentNullException("collection"); + + this.collection = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(collection); + } + + // TODO Do we need to be able to Clone() these, and should it really be shallow? +// /** +// * Returns a shallow clone. The returned contents are not copied, so adding +// * or removing objects will effect this. +// * +// * @return a shallow clone. +// */ +// public object Clone() +// { +// return new X509CollectionStoreParameters(collection); +// } + + /// Returns a copy of the ICollection. + public ICollection GetCollection() + { + return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(collection); + } + + /// Returns a formatted string describing the parameters. + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("X509CollectionStoreParameters: [\n"); + sb.Append(" collection: " + collection + "\n"); + sb.Append("]"); + return sb.ToString(); + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStoreParameters.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStoreParameters.cs.meta new file mode 100644 index 00000000..d48c033d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CollectionStoreParameters.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e09969b5dbb57ba4f89c0de6827cd0e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CrlStoreSelector.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CrlStoreSelector.cs new file mode 100644 index 00000000..725967b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CrlStoreSelector.cs @@ -0,0 +1,287 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Math; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Date; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509; +using BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Extension; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + public class X509CrlStoreSelector + : IX509Selector + { + // TODO Missing criteria? + + private X509Certificate certificateChecking; + private DateTimeObject dateAndTime; + private ICollection issuers; + private BigInteger maxCrlNumber; + private BigInteger minCrlNumber; + + private IX509AttributeCertificate attrCertChecking; + private bool completeCrlEnabled; + private bool deltaCrlIndicatorEnabled; + private byte[] issuingDistributionPoint; + private bool issuingDistributionPointEnabled; + private BigInteger maxBaseCrlNumber; + + public X509CrlStoreSelector() + { + } + + public X509CrlStoreSelector( + X509CrlStoreSelector o) + { + this.certificateChecking = o.CertificateChecking; + this.dateAndTime = o.DateAndTime; + this.issuers = o.Issuers; + this.maxCrlNumber = o.MaxCrlNumber; + this.minCrlNumber = o.MinCrlNumber; + + this.deltaCrlIndicatorEnabled = o.DeltaCrlIndicatorEnabled; + this.completeCrlEnabled = o.CompleteCrlEnabled; + this.maxBaseCrlNumber = o.MaxBaseCrlNumber; + this.attrCertChecking = o.AttrCertChecking; + this.issuingDistributionPointEnabled = o.IssuingDistributionPointEnabled; + this.issuingDistributionPoint = o.IssuingDistributionPoint; + } + + public virtual object Clone() + { + return new X509CrlStoreSelector(this); + } + + public X509Certificate CertificateChecking + { + get { return certificateChecking; } + set { certificateChecking = value; } + } + + public DateTimeObject DateAndTime + { + get { return dateAndTime; } + set { dateAndTime = value; } + } + + /// + /// An ICollection of X509Name objects + /// + public ICollection Issuers + { + get { return BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(issuers); } + set { issuers = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.CreateArrayList(value); } + } + + public BigInteger MaxCrlNumber + { + get { return maxCrlNumber; } + set { maxCrlNumber = value; } + } + + public BigInteger MinCrlNumber + { + get { return minCrlNumber; } + set { minCrlNumber = value; } + } + + /** + * The attribute certificate being checked. This is not a criterion. + * Rather, it is optional information that may help a {@link X509Store} find + * CRLs that would be relevant when checking revocation for the specified + * attribute certificate. If null is specified, then no such + * optional information is provided. + * + * @param attrCert the IX509AttributeCertificate being checked (or + * null) + * @see #getAttrCertificateChecking() + */ + public IX509AttributeCertificate AttrCertChecking + { + get { return attrCertChecking; } + set { this.attrCertChecking = value; } + } + + /** + * If true only complete CRLs are returned. Defaults to + * false. + * + * @return true if only complete CRLs are returned. + */ + public bool CompleteCrlEnabled + { + get { return completeCrlEnabled; } + set { this.completeCrlEnabled = value; } + } + + /** + * Returns if this selector must match CRLs with the delta CRL indicator + * extension set. Defaults to false. + * + * @return Returns true if only CRLs with the delta CRL + * indicator extension are selected. + */ + public bool DeltaCrlIndicatorEnabled + { + get { return deltaCrlIndicatorEnabled; } + set { this.deltaCrlIndicatorEnabled = value; } + } + + /** + * The issuing distribution point. + *

    + * The issuing distribution point extension is a CRL extension which + * identifies the scope and the distribution point of a CRL. The scope + * contains among others information about revocation reasons contained in + * the CRL. Delta CRLs and complete CRLs must have matching issuing + * distribution points.

    + *

    + * The byte array is cloned to protect against subsequent modifications.

    + *

    + * You must also enable or disable this criteria with + * {@link #setIssuingDistributionPointEnabled(bool)}.

    + * + * @param issuingDistributionPoint The issuing distribution point to set. + * This is the DER encoded OCTET STRING extension value. + * @see #getIssuingDistributionPoint() + */ + public byte[] IssuingDistributionPoint + { + get { return Arrays.Clone(issuingDistributionPoint); } + set { this.issuingDistributionPoint = Arrays.Clone(value); } + } + + /** + * Whether the issuing distribution point criteria should be applied. + * Defaults to false. + *

    + * You may also set the issuing distribution point criteria if not a missing + * issuing distribution point should be assumed.

    + * + * @return Returns if the issuing distribution point check is enabled. + */ + public bool IssuingDistributionPointEnabled + { + get { return issuingDistributionPointEnabled; } + set { this.issuingDistributionPointEnabled = value; } + } + + /** + * The maximum base CRL number. Defaults to null. + * + * @return Returns the maximum base CRL number. + * @see #setMaxBaseCRLNumber(BigInteger) + */ + public BigInteger MaxBaseCrlNumber + { + get { return maxBaseCrlNumber; } + set { this.maxBaseCrlNumber = value; } + } + + public virtual bool Match( + object obj) + { + X509Crl c = obj as X509Crl; + + if (c == null) + return false; + + if (dateAndTime != null) + { + DateTime dt = dateAndTime.Value; + DateTime tu = c.ThisUpdate; + DateTimeObject nu = c.NextUpdate; + + if (dt.CompareTo(tu) < 0 || nu == null || dt.CompareTo(nu.Value) >= 0) + return false; + } + + if (issuers != null) + { + X509Name i = c.IssuerDN; + + bool found = false; + + foreach (X509Name issuer in issuers) + { + if (issuer.Equivalent(i, true)) + { + found = true; + break; + } + } + + if (!found) + return false; + } + + if (maxCrlNumber != null || minCrlNumber != null) + { + Asn1OctetString extVal = c.GetExtensionValue(X509Extensions.CrlNumber); + if (extVal == null) + return false; + + BigInteger cn = CrlNumber.GetInstance( + X509ExtensionUtilities.FromExtensionValue(extVal)).PositiveValue; + + if (maxCrlNumber != null && cn.CompareTo(maxCrlNumber) > 0) + return false; + + if (minCrlNumber != null && cn.CompareTo(minCrlNumber) < 0) + return false; + } + + DerInteger dci = null; + try + { + Asn1OctetString bytes = c.GetExtensionValue(X509Extensions.DeltaCrlIndicator); + if (bytes != null) + { + dci = DerInteger.GetInstance(X509ExtensionUtilities.FromExtensionValue(bytes)); + } + } + catch (Exception) + { + return false; + } + + if (dci == null) + { + if (DeltaCrlIndicatorEnabled) + return false; + } + else + { + if (CompleteCrlEnabled) + return false; + + if (maxBaseCrlNumber != null && dci.PositiveValue.CompareTo(maxBaseCrlNumber) > 0) + return false; + } + + if (issuingDistributionPointEnabled) + { + Asn1OctetString idp = c.GetExtensionValue(X509Extensions.IssuingDistributionPoint); + if (issuingDistributionPoint == null) + { + if (idp != null) + return false; + } + else + { + if (!Arrays.AreEqual(idp.GetOctets(), issuingDistributionPoint)) + return false; + } + } + + return true; + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CrlStoreSelector.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CrlStoreSelector.cs.meta new file mode 100644 index 00000000..2fda8c23 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509CrlStoreSelector.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d8a2c8ce56d49414a89fd32d343d68c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreException.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreException.cs new file mode 100644 index 00000000..39aeae96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreException.cs @@ -0,0 +1,32 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +using System; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ +#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE || NETFX_CORE) + [Serializable] +#endif + public class X509StoreException + : Exception + { + public X509StoreException() + { + } + + public X509StoreException( + string message) + : base(message) + { + } + + public X509StoreException( + string message, + Exception e) + : base(message, e) + { + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreException.cs.meta new file mode 100644 index 00000000..5cf72e03 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae4da7235cd49c4479cc07619ce3e51e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreFactory.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreFactory.cs new file mode 100644 index 00000000..03eba431 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreFactory.cs @@ -0,0 +1,69 @@ +#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR) +#pragma warning disable +#if UNITY_WSA && !UNITY_EDITOR && !ENABLE_IL2CPP +using System.TypeFix; +#endif +using System; +using System.Collections; + +using BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities; + +namespace BestHTTP.SecureProtocol.Org.BouncyCastle.X509.Store +{ + public sealed class X509StoreFactory + { + private X509StoreFactory() + { + } + + public static IX509Store Create( + string type, + IX509StoreParameters parameters) + { + if (type == null) + throw new ArgumentNullException("type"); + + string[] parts = BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.ToUpperInvariant(type).Split('/'); + + if (parts.Length < 2) + throw new ArgumentException("type"); + + if (parts[1] != "COLLECTION") + throw new NoSuchStoreException("X.509 store type '" + type + "' not available."); + + X509CollectionStoreParameters p = (X509CollectionStoreParameters) parameters; + ICollection coll = p.GetCollection(); + + switch (parts[0]) + { + case "ATTRIBUTECERTIFICATE": + checkCorrectType(coll, typeof(IX509AttributeCertificate)); + break; + case "CERTIFICATE": + checkCorrectType(coll, typeof(X509Certificate)); + break; + case "CERTIFICATEPAIR": + checkCorrectType(coll, typeof(X509CertificatePair)); + break; + case "CRL": + checkCorrectType(coll, typeof(X509Crl)); + break; + default: + throw new NoSuchStoreException("X.509 store type '" + type + "' not available."); + } + + return new X509CollectionStore(coll); + } + + private static void checkCorrectType(ICollection coll, Type t) + { + foreach (object o in coll) + { + if (!t.IsInstanceOfType(o)) + throw new InvalidCastException("Can't cast object to type: " + t.FullName); + } + } + } +} +#pragma warning restore +#endif diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreFactory.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreFactory.cs.meta new file mode 100644 index 00000000..f60d9498 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SecureProtocol/x509/store/X509StoreFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7fe5a804c6168c344a5147f544de5a2f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents.meta new file mode 100644 index 00000000..628329f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c39b33f2c686550498ca5741c9e33690 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSource.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSource.cs new file mode 100644 index 00000000..d3653cb3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSource.cs @@ -0,0 +1,649 @@ +#if !BESTHTTP_DISABLE_SERVERSENT_EVENTS + +using System; +using System.Collections.Generic; + +using BestHTTP.Extensions; + +#if UNITY_WEBGL && !UNITY_EDITOR + using System.Runtime.InteropServices; +#endif + +namespace BestHTTP.ServerSentEvents +{ + /// + /// Possible states of an EventSource object. + /// + public enum States + { + Initial, + Connecting, + Open, + Retrying, + Closing, + Closed + } + + public delegate void OnGeneralEventDelegate(EventSource eventSource); + public delegate void OnMessageDelegate(EventSource eventSource, BestHTTP.ServerSentEvents.Message message); + public delegate void OnErrorDelegate(EventSource eventSource, string error); + public delegate bool OnRetryDelegate(EventSource eventSource); + public delegate void OnEventDelegate(EventSource eventSource, BestHTTP.ServerSentEvents.Message message); + public delegate void OnStateChangedDelegate(EventSource eventSource, States oldState, States newState); + +#if UNITY_WEBGL && !UNITY_EDITOR + + delegate void OnWebGLEventSourceOpenDelegate(uint id); + delegate void OnWebGLEventSourceMessageDelegate(uint id, string eventStr, string data, string eventId, int retry); + delegate void OnWebGLEventSourceErrorDelegate(uint id, string reason); +#endif + + /// + /// http://www.w3.org/TR/eventsource/ + /// + public class EventSource +#if !UNITY_WEBGL || UNITY_EDITOR + : IHeartbeat +#endif + { +#region Public Properties + + /// + /// Uri of the remote endpoint. + /// + public Uri Uri { get; private set; } + + /// + /// Current state of the EventSource object. + /// + public States State + { + get + { + return _state; + } + private set + { + States oldState = _state; + _state = value; + + if (OnStateChanged != null) + { + try + { + OnStateChanged(this, oldState, _state); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("EventSource", "OnStateChanged", ex); + } + } + } + } + private States _state; + + /// + /// Time to wait to do a reconnect attempt. Default to 2 sec. The server can overwrite this setting. + /// + public TimeSpan ReconnectionTime { get; set; } + + /// + /// The last successfully received event's id. + /// + public string LastEventId { get; private set; } + +#if !UNITY_WEBGL || UNITY_EDITOR + /// + /// The internal request object of the EventSource. + /// + public HTTPRequest InternalRequest { get; private set; } +#else + public bool WithCredentials { get; set; } +#endif + +#endregion + +#region Public Events + + /// + /// Called when successfully connected to the server. + /// + public event OnGeneralEventDelegate OnOpen; + + /// + /// Called on every message received from the server. + /// + public event OnMessageDelegate OnMessage; + + /// + /// Called when an error occurs. + /// + public event OnErrorDelegate OnError; + +#if !UNITY_WEBGL || UNITY_EDITOR + /// + /// Called when the EventSource will try to do a retry attempt. If this function returns with false, it will cancel the attempt. + /// + public event OnRetryDelegate OnRetry; +#endif + + /// + /// Called when the EventSource object closed. + /// + public event OnGeneralEventDelegate OnClosed; + + /// + /// Called every time when the State property changed. + /// + public event OnStateChangedDelegate OnStateChanged; + +#endregion + +#region Privates + + /// + /// A dictionary to store eventName => delegate mapping. + /// + private Dictionary EventTable; + +#if !UNITY_WEBGL || UNITY_EDITOR + /// + /// Number of retry attempts made. + /// + private byte RetryCount; + + /// + /// When we called the Retry function. We will delay the Open call from here. + /// + private DateTime RetryCalled; +#else + private static Dictionary EventSources = new Dictionary(); + private uint Id; +#endif + +#endregion + + public EventSource(Uri uri) + { + this.Uri = uri; + this.ReconnectionTime = TimeSpan.FromMilliseconds(2000); + +#if !UNITY_WEBGL || UNITY_EDITOR + this.InternalRequest = new HTTPRequest(Uri, HTTPMethods.Get, true, true, OnRequestFinished); + + // Set headers + this.InternalRequest.SetHeader("Accept", "text/event-stream"); + this.InternalRequest.SetHeader("Cache-Control", "no-cache"); + this.InternalRequest.SetHeader("Accept-Encoding", "identity"); + + // Set protocol stuff + this.InternalRequest.ProtocolHandler = SupportedProtocols.ServerSentEvents; + this.InternalRequest.OnUpgraded = OnUpgraded; + + // Disable internal retry + this.InternalRequest.DisableRetry = true; +#else + if (!ES_IsSupported()) + throw new NotSupportedException("This browser isn't support the EventSource protocol!"); + + this.Id = ES_Create(this.Uri.ToString(), WithCredentials, OnOpenCallback, OnMessageCallback, OnErrorCallback); + + EventSources.Add(this.Id, this); +#endif + } + +#region Public Functions + + /// + /// Start to connect to the remote server. + /// + public void Open() + { + if (this.State != States.Initial && + this.State != States.Retrying && + this.State != States.Closed) + return; + + this.State = States.Connecting; + +#if !UNITY_WEBGL || UNITY_EDITOR + if (!string.IsNullOrEmpty(this.LastEventId)) + this.InternalRequest.SetHeader("Last-Event-ID", this.LastEventId); + + this.InternalRequest.Send(); +#endif + } + + /// + /// Start to close the connection. + /// + public void Close() + { + if (this.State == States.Closing || + this.State == States.Closed) + return; + + this.State = States.Closing; +#if !UNITY_WEBGL || UNITY_EDITOR + if (this.InternalRequest != null) + this.InternalRequest.Abort(); + else + this.State = States.Closed; +#else + ES_Close(this.Id); + + SetClosed("Close"); + + EventSources.Remove(this.Id); + + ES_Release(this.Id); +#endif + } + + /// + /// With this function an event handler can be subscribed for an event name. + /// + public void On(string eventName, OnEventDelegate action) + { + if (EventTable == null) + EventTable = new Dictionary(); + + EventTable[eventName] = action; +#if UNITY_WEBGL && !UNITY_EDITOR + ES_AddEventHandler(this.Id, eventName); +#endif + } + + /// + /// With this function the event handler can be removed for the given event name. + /// + /// + public void Off(string eventName) + { + if (eventName == null || EventTable == null) + return; + + EventTable.Remove(eventName); + } + +#endregion + +#region Private Helper Functions + + private void CallOnError(string error, string msg) + { + if (OnError != null) + { + try + { + OnError(this, error); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("EventSource", msg + " - OnError", ex); + } + } + } + +#if !UNITY_WEBGL || UNITY_EDITOR + private bool CallOnRetry() + { + if (OnRetry != null) + { + try + { + return OnRetry(this); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("EventSource", "CallOnRetry", ex); + } + } + + return true; + } +#endif + + private void SetClosed(string msg) + { + this.State = States.Closed; + + if (OnClosed != null) + { + try + { + OnClosed(this); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("EventSource", msg + " - OnClosed", ex); + } + } + } + +#if !UNITY_WEBGL || UNITY_EDITOR + private void Retry() + { + if (RetryCount > 0 || + !CallOnRetry()) + { + SetClosed("Retry"); + return; + } + + RetryCount++; + RetryCalled = DateTime.UtcNow; + + HTTPManager.Heartbeats.Subscribe(this); + + this.State = States.Retrying; + } +#endif + +#endregion + +#region HTTP Request Implementation +#if !UNITY_WEBGL || UNITY_EDITOR + + /// + /// We are successfully upgraded to the EventSource protocol, we can start to receive and parse the incoming data. + /// + private void OnUpgraded(HTTPRequest originalRequest, HTTPResponse response) + { + EventSourceResponse esResponse = response as EventSourceResponse; + + if (esResponse == null) + { + CallOnError("Not an EventSourceResponse!", "OnUpgraded"); + return; + } + + if (OnOpen != null) + { + try + { + OnOpen(this); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("EventSource", "OnOpen", ex); + } + } + + esResponse.OnMessage += OnMessageReceived; + esResponse.StartReceive(); + + this.RetryCount = 0; + this.State = States.Open; + } + + private void OnRequestFinished(HTTPRequest req, HTTPResponse resp) + { + if (this.State == States.Closed) + return; + + if (this.State == States.Closing || + req.State == HTTPRequestStates.Aborted) + { + SetClosed("OnRequestFinished"); + + return; + } + + string reason = string.Empty; + + // In some cases retry is prohibited + bool canRetry = true; + + switch (req.State) + { + // The server sent all the data it's wanted. + case HTTPRequestStates.Processing: + canRetry = !resp.HasHeader("content-length"); + break; + + // The request finished without any problem. + case HTTPRequestStates.Finished: + // HTTP 200 OK responses that have a Content-Type specifying an unsupported type, or that have no Content-Type at all, must cause the user agent to fail the connection. + if (resp.StatusCode == 200 && !resp.HasHeaderWithValue("content-type", "text/event-stream")) + { + reason = "No Content-Type header with value 'text/event-stream' present."; + canRetry = false; + } + + // HTTP 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, and 504 Gateway Timeout responses, and any network error that prevents the connection + // from being established in the first place (e.g. DNS errors), must cause the user agent to asynchronously reestablish the connection. + // Any other HTTP response code not listed here must cause the user agent to fail the connection. + if (canRetry && + resp.StatusCode != 500 && + resp.StatusCode != 502 && + resp.StatusCode != 503 && + resp.StatusCode != 504) + { + canRetry = false; + + reason = string.Format("Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText); + } + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + reason = "Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + // If the state is Closing, then it's a normal behaviour, and we close the EventSource + reason = "OnRequestFinished - Aborted without request. EventSource's State: " + this.State; + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + reason = "Connection Timed Out!"; + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + reason = "Processing the request Timed Out!"; + break; + } + + // If we are not closing the EventSource, then we will try to reconnect. + if (this.State < States.Closing) + { + if (!string.IsNullOrEmpty(reason)) + CallOnError(reason, "OnRequestFinished"); + + if (canRetry) + Retry(); + else + SetClosed("OnRequestFinished"); + } + else + SetClosed("OnRequestFinished"); + } +#endif +#endregion + +#region EventStreamResponse Event Handlers + + private void OnMessageReceived( +#if !UNITY_WEBGL || UNITY_EDITOR + EventSourceResponse resp, +#endif + BestHTTP.ServerSentEvents.Message message) + { + if (this.State >= States.Closing) + return; + + // 1.) Set the last event ID string of the event source to value of the last event ID buffer. + // The buffer does not get reset, so the last event ID string of the event source remains set to this value until the next time it is set by the server. + // We check here only for null, because it can be a non-null but empty string. + if (message.Id != null) + this.LastEventId = message.Id; + + if (message.Retry.TotalMilliseconds > 0) + this.ReconnectionTime = message.Retry; + + // 2.) If the data buffer is an empty string, set the data buffer and the event type buffer to the empty string and abort these steps. + if (string.IsNullOrEmpty(message.Data)) + return; + + // 3.) If the data buffer's last character is a U+000A LINE FEED (LF) character, then remove the last character from the data buffer. + // This step can be ignored. We constructed the string to be able to skip this step. + + if (OnMessage != null) + { + try + { + OnMessage(this, message); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("EventSource", "OnMessageReceived - OnMessage", ex); + } + } + + if (EventTable != null && !string.IsNullOrEmpty(message.Event)) + { + OnEventDelegate action; + if (EventTable.TryGetValue(message.Event, out action)) + { + if (action != null) + { + try + { + action(this, message); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("EventSource", "OnMessageReceived - action", ex); + } + } + } + } + } + +#endregion + +#region IHeartbeat Implementation +#if !UNITY_WEBGL || UNITY_EDITOR + + void IHeartbeat.OnHeartbeatUpdate(TimeSpan dif) + { + if (this.State != States.Retrying) + { + HTTPManager.Heartbeats.Unsubscribe(this); + + return; + } + + if (DateTime.UtcNow - RetryCalled >= ReconnectionTime) + { + Open(); + + if (this.State != States.Connecting) + SetClosed("OnHeartbeatUpdate"); + + HTTPManager.Heartbeats.Unsubscribe(this); + } + } +#endif +#endregion + +#region WebGL Static Callbacks +#if UNITY_WEBGL && !UNITY_EDITOR + + [AOT.MonoPInvokeCallback(typeof(OnWebGLEventSourceOpenDelegate))] + static void OnOpenCallback(uint id) + { + EventSource es; + if (EventSources.TryGetValue(id, out es)) + { + if (es.OnOpen != null) + { + try + { + es.OnOpen(es); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("EventSource", "OnOpen", ex); + } + } + + es.State = States.Open; + } + else + HTTPManager.Logger.Warning("EventSource", "OnOpenCallback - No EventSource found for id: " + id.ToString()); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLEventSourceMessageDelegate))] + static void OnMessageCallback(uint id, string eventStr, string data, string eventId, int retry) + { + EventSource es; + if (EventSources.TryGetValue(id, out es)) + { + var msg = new BestHTTP.ServerSentEvents.Message(); + msg.Id = eventId; + msg.Data = data; + msg.Event = eventStr; + msg.Retry = TimeSpan.FromSeconds(retry); + + es.OnMessageReceived(msg); + } + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLEventSourceErrorDelegate))] + static void OnErrorCallback(uint id, string reason) + { + EventSource es; + if (EventSources.TryGetValue(id, out es)) + { + es.CallOnError(reason, "OnErrorCallback"); + es.SetClosed("OnError"); + + EventSources.Remove(id); + } + + try + { + ES_Release(id); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("EventSource", "ES_Release", ex); + } + } + +#endif +#endregion + +#region WebGL Interface +#if UNITY_WEBGL && !UNITY_EDITOR + + [DllImport("__Internal")] + static extern bool ES_IsSupported(); + + [DllImport("__Internal")] + static extern uint ES_Create(string url, bool withCred, OnWebGLEventSourceOpenDelegate onOpen, OnWebGLEventSourceMessageDelegate onMessage, OnWebGLEventSourceErrorDelegate onError); + + [DllImport("__Internal")] + static extern void ES_AddEventHandler(uint id, string eventName); + + [DllImport("__Internal")] + static extern void ES_Close(uint id); + + [DllImport("__Internal")] + static extern void ES_Release(uint id); + +#endif +#endregion + + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSource.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSource.cs.meta new file mode 100644 index 00000000..6a2ba68b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSource.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 49e4cc3acf485d644887e96e5a2d1219 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSourceResponse.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSourceResponse.cs new file mode 100644 index 00000000..e2a8aeb9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSourceResponse.cs @@ -0,0 +1,390 @@ +#if !BESTHTTP_DISABLE_SERVERSENT_EVENTS && (!UNITY_WEBGL || UNITY_EDITOR) + +using System; +using System.IO; +using System.Threading; + +using System.Text; +using System.Collections.Generic; + +namespace BestHTTP.ServerSentEvents +{ + /// + /// A low-level class to receive and parse an EventSource(http://www.w3.org/TR/eventsource/) stream. + /// Higher level protocol representation is implemented in the EventSource class. + /// + public sealed class EventSourceResponse : HTTPResponse, IProtocol + { + public bool IsClosed { get; private set; } + + #region Public Events + + public Action OnMessage; + public Action OnClosed; + + #endregion + + #region Privates + + /// + /// Thread sync object + /// + private object FrameLock = new object(); + + /// + /// Buffer for the read data. + /// + private byte[] LineBuffer; + + /// + /// Buffer position. + /// + private int LineBufferPos = 0; + + /// + /// The currently receiving and parsing message + /// + private BestHTTP.ServerSentEvents.Message CurrentMessage; + + /// + /// Completed messages that waiting to be dispatched + /// + private List CompletedMessages = new List(); + + #endregion + + public EventSourceResponse(HTTPRequest request, Stream stream, bool isStreamed, bool isFromCache) + :base(request, stream, isStreamed, isFromCache) + { + base.IsClosedManually = true; + } + + public override bool Receive(int forceReadRawContentLength = -1, bool readPayloadData = true) + { + bool received = base.Receive(forceReadRawContentLength, false); + + string contentType = this.GetFirstHeaderValue("content-type"); + base.IsUpgraded = received && + this.StatusCode == 200 && + !string.IsNullOrEmpty(contentType) && + contentType.ToLower().StartsWith("text/event-stream"); + + // If we didn't upgraded to the protocol we have to read all the sent payload because + // next requests may read these datas as HTTP headers and will fail + if (!IsUpgraded) + ReadPayload(forceReadRawContentLength); + + return received; + } + + internal void StartReceive() + { + if (IsUpgraded) + { +#if NETFX_CORE + #pragma warning disable 4014 + Windows.System.Threading.ThreadPool.RunAsync(ReceiveThreadFunc); + #pragma warning restore 4014 +#else + ThreadPool.QueueUserWorkItem(ReceiveThreadFunc); + //new Thread(ReceiveThreadFunc) + // .Start(); +#endif + } + } + + #region Private Threading Functions + + private void ReceiveThreadFunc(object param) + { + try + { + if (HasHeaderWithValue("transfer-encoding", "chunked")) + ReadChunked(Stream); + else + ReadRaw(Stream, -1); + } +#if !NETFX_CORE + catch (ThreadAbortException) + { + this.baseRequest.State = HTTPRequestStates.Aborted; + } +#endif + catch (Exception e) + { + if (HTTPUpdateDelegator.IsCreated) + { + this.baseRequest.Exception = e; + this.baseRequest.State = HTTPRequestStates.Error; + } + else + this.baseRequest.State = HTTPRequestStates.Aborted; + } + finally + { + IsClosed = true; + } + } + + #endregion + + #region Read Implementations + + // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1 + private new void ReadChunked(Stream stream) + { + int chunkLength = ReadChunkLength(stream); + byte[] buffer = Extensions.VariableSizedBufferPool.Get(chunkLength, true); + + while (chunkLength != 0) + { + // To avoid more GC garbage we use only one buffer, and resize only if the next chunk doesn't fit. + if (buffer.Length < chunkLength) + Extensions.VariableSizedBufferPool.Resize(ref buffer, chunkLength, true); + + int readBytes = 0; + + // Fill up the buffer + do + { + int bytes = stream.Read(buffer, readBytes, chunkLength - readBytes); + if (bytes == 0) + throw new Exception("The remote server closed the connection unexpectedly!"); + + readBytes += bytes; + } while (readBytes < chunkLength); + + FeedData(buffer, readBytes); + + // Every chunk data has a trailing CRLF + ReadTo(stream, LF); + + // read the next chunk's length + chunkLength = ReadChunkLength(stream); + } + + Extensions.VariableSizedBufferPool.Release(buffer); + + // Read the trailing headers or the CRLF + ReadHeaders(stream); + } + + private new void ReadRaw(Stream stream, long contentLength) + { + byte[] buffer = Extensions.VariableSizedBufferPool.Get(1024, true); + int bytes; + + do + { + bytes = stream.Read(buffer, 0, buffer.Length); + + FeedData(buffer, bytes); + } while(bytes > 0); + + Extensions.VariableSizedBufferPool.Release(buffer); + } + + #endregion + + #region Data Parsing + + public void FeedData(byte[] buffer, int count) + { + if (count == -1) + count = buffer.Length; + + if (count == 0) + return; + + if (LineBuffer == null) + LineBuffer = Extensions.VariableSizedBufferPool.Get(1024, true); + + int newlineIdx; + int pos = 0; + + do { + + newlineIdx = -1; + int skipCount = 1; // to skip CR and/or LF + + for (int i = pos; i < count && newlineIdx == -1; ++i) + { + // Lines must be separated by either a U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair, a single U+000A LINE FEED (LF) character, or a single U+000D CARRIAGE RETURN (CR) character. + if (buffer[i] == HTTPResponse.CR) + { + if (i + 1 < count && buffer[i + 1] == HTTPResponse.LF) + skipCount = 2; + newlineIdx = i; + } + else if (buffer[i] == HTTPResponse.LF) + newlineIdx = i; + } + + int copyIndex = newlineIdx == -1 ? count : newlineIdx; + + if (LineBuffer.Length < LineBufferPos + (copyIndex - pos)) + { + int newSize = LineBufferPos + (copyIndex - pos); + Extensions.VariableSizedBufferPool.Resize(ref LineBuffer, newSize, true); + } + + Array.Copy(buffer, pos, LineBuffer, LineBufferPos, copyIndex - pos); + + LineBufferPos += copyIndex - pos; + + if (newlineIdx == -1) + return; + + ParseLine(LineBuffer, LineBufferPos); + + LineBufferPos = 0; + //pos += newlineIdx + skipCount; + pos = newlineIdx + skipCount; + + }while(newlineIdx != -1 && pos < count); + } + + void ParseLine(byte[] buffer, int count) + { + // If the line is empty (a blank line) => Dispatch the event + if (count == 0) + { + if (CurrentMessage != null) + { + lock (FrameLock) + CompletedMessages.Add(CurrentMessage); + CurrentMessage = null; + } + + return; + } + + // If the line starts with a U+003A COLON character (:) => Ignore the line. + if (buffer[0] == 0x3A) + return; + + //If the line contains a U+003A COLON character (:) + int colonIdx = -1; + for (int i = 0; i < count && colonIdx == -1; ++i) + if (buffer[i] == 0x3A) + colonIdx = i; + + string field; + string value; + + if (colonIdx != -1) + { + // Collect the characters on the line before the first U+003A COLON character (:), and let field be that string. + field = Encoding.UTF8.GetString(buffer, 0, colonIdx); + + //Collect the characters on the line after the first U+003A COLON character (:), and let value be that string. If value starts with a U+0020 SPACE character, remove it from value. + if (colonIdx + 1 < count && buffer[colonIdx + 1] == 0x20) + colonIdx++; + + colonIdx++; + + // discarded because it is not followed by a blank line + if (colonIdx >= count) + return; + + value = Encoding.UTF8.GetString(buffer, colonIdx, count - colonIdx); + } + else + { + // Otherwise, the string is not empty but does not contain a U+003A COLON character (:) => + // Process the field using the whole line as the field name, and the empty string as the field value. + field = Encoding.UTF8.GetString(buffer, 0, count); + value = string.Empty; + } + + if (CurrentMessage == null) + CurrentMessage = new BestHTTP.ServerSentEvents.Message(); + + switch(field) + { + // If the field name is "id" => Set the last event ID buffer to the field value. + case "id": + CurrentMessage.Id = value; + break; + + // If the field name is "event" => Set the event type buffer to field value. + case "event": + CurrentMessage.Event = value; + break; + + // If the field name is "data" => Append the field value to the data buffer, then append a single U+000A LINE FEED (LF) character to the data buffer. + case "data": + // Append a new line if we already have some data. This way we can skip step 3.) in the EventSource's OnMessageReceived. + // We do only null check, because empty string can be valid payload + if (CurrentMessage.Data != null) + CurrentMessage.Data += Environment.NewLine; + + CurrentMessage.Data += value; + break; + + // If the field name is "retry" => If the field value consists of only ASCII digits, then interpret the field value as an integer in base ten, + // and set the event stream's reconnection time to that integer. Otherwise, ignore the field. + case "retry": + int result; + if (int.TryParse(value, out result)) + CurrentMessage.Retry = TimeSpan.FromMilliseconds(result); + break; + + // Otherwise: The field is ignored. + default: + break; + } + } + + #endregion + + void IProtocol.HandleEvents() + { + lock(FrameLock) + { + // Send out messages. + if (CompletedMessages.Count > 0) + { + if (OnMessage != null) + for (int i = 0; i < CompletedMessages.Count; ++i) + { + try + { + OnMessage(this, CompletedMessages[i]); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("EventSourceMessage", "HandleEvents - OnMessage", ex); + } + } + + CompletedMessages.Clear(); + } + } + + // We are closed + if (IsClosed) + { + CompletedMessages.Clear(); + + if (OnClosed != null) + { + try + { + OnClosed(this); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("EventSourceMessage", "HandleEvents - OnClosed", ex); + } + finally + { + OnClosed = null; + } + } + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSourceResponse.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSourceResponse.cs.meta new file mode 100644 index 00000000..9dfa393e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/EventSourceResponse.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f1346db7284d3a04e8edd33864f9231c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/Message.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/Message.cs new file mode 100644 index 00000000..7679052c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/Message.cs @@ -0,0 +1,36 @@ +#if !BESTHTTP_DISABLE_SERVERSENT_EVENTS + +using System; + +namespace BestHTTP.ServerSentEvents +{ + public sealed class Message + { + /// + /// Event Id of the message. If it's null, then it's not present. + /// + public string Id { get; internal set; } + + /// + /// Name of the event, or an empty string. + /// + public string Event { get; internal set; } + + /// + /// The actual payload of the message. + /// + public string Data { get; internal set; } + + /// + /// A reconnection time, in milliseconds. This must initially be a user-agent-defined value, probably in the region of a few seconds. + /// + public TimeSpan Retry { get; internal set; } + + public override string ToString() + { + return string.Format("\"{0}\": \"{1}\"", Event, Data); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/Message.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/Message.cs.meta new file mode 100644 index 00000000..05418380 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/ServerSentEvents/Message.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9a3820c17c331374a82799277eb9ede0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR.meta new file mode 100644 index 00000000..121d8934 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e2d987f043f34ae48a80a57c82fa4193 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication.meta new file mode 100644 index 00000000..38db0371 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 008d5591a2cd6704fb39796bd33ff71a +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication/IAuthenticationProvider.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication/IAuthenticationProvider.cs new file mode 100644 index 00000000..a632f051 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication/IAuthenticationProvider.cs @@ -0,0 +1,37 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +namespace BestHTTP.SignalR.Authentication +{ + public delegate void OnAuthenticationSuccededDelegate(IAuthenticationProvider provider); + public delegate void OnAuthenticationFailedDelegate(IAuthenticationProvider provider, string reason); + + public interface IAuthenticationProvider + { + /// + /// The authentication must be run before any request made to build up the SignalR protocol + /// + bool IsPreAuthRequired { get; } + + /// + /// This event must be called when the pre-authentication succeded. When IsPreAuthRequired is false, no-one will subscribe to this event. + /// + event OnAuthenticationSuccededDelegate OnAuthenticationSucceded; + + /// + /// This event must be called when the pre-authentication failed. When IsPreAuthRequired is false, no-one will subscribe to this event. + /// + event OnAuthenticationFailedDelegate OnAuthenticationFailed; + + /// + /// This function called once, when the before the SignalR negotiation begins. If IsPreAuthRequired is false, then this step will be skipped. + /// + void StartAuthentication(); + + /// + /// This function will be called for every request before sending it. + /// + void PrepareRequest(HTTPRequest request, RequestTypes type); + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication/IAuthenticationProvider.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication/IAuthenticationProvider.cs.meta new file mode 100644 index 00000000..94bb950f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Authentication/IAuthenticationProvider.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e95e3e74ee7feaf4b872a3d4d23dc0a6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Connection.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Connection.cs new file mode 100644 index 00000000..acf658bf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Connection.cs @@ -0,0 +1,1306 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; +using System.Text; +using System.Collections.Generic; + +using BestHTTP.Extensions; +using BestHTTP.SignalR.Hubs; +using BestHTTP.SignalR.Messages; +using BestHTTP.SignalR.Transports; +using BestHTTP.SignalR.JsonEncoders; +using BestHTTP.SignalR.Authentication; + +using PlatformSupport.Collections.ObjectModel; + +#if !NETFX_CORE + using PlatformSupport.Collections.Specialized; +#else + using System.Collections.Specialized; +#endif + +namespace BestHTTP.SignalR +{ + public delegate void OnNonHubMessageDelegate(Connection connection, object data); + public delegate void OnConnectedDelegate(Connection connection); + public delegate void OnClosedDelegate(Connection connection); + public delegate void OnErrorDelegate(Connection connection, string error); + public delegate void OnStateChanged(Connection connection, ConnectionStates oldState, ConnectionStates newState); + public delegate void OnPrepareRequestDelegate(Connection connection, HTTPRequest req, RequestTypes type); + + /// + /// Interface to be able to hide internally used functions and properties. + /// + public interface IConnection + { + ProtocolVersions Protocol { get; } + NegotiationData NegotiationResult { get; } + IJsonEncoder JsonEncoder { get; set; } + + void OnMessage(IServerMessage msg); + void TransportStarted(); + void TransportReconnected(); + void TransportAborted(); + void Error(string reason); + Uri BuildUri(RequestTypes type); + Uri BuildUri(RequestTypes type, TransportBase transport); + HTTPRequest PrepareRequest(HTTPRequest req, RequestTypes type); + string ParseResponse(string responseStr); + } + + /// + /// Supported versions of the SignalR protocol. + /// + public enum ProtocolVersions : byte + { + Protocol_2_0, + Protocol_2_1, + Protocol_2_2 + } + + /// + /// The main SignalR class. This is the entry point to connect to a SignalR service. + /// + public sealed class Connection : IHeartbeat, IConnection + { + #region Public Properties + + /// + /// The default Json encode/decoder that will be used to encode/decode the event arguments. + /// + public static IJsonEncoder DefaultEncoder = +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + new JSonDotnetEncoder(); +#else + new DefaultJsonEncoder(); +#endif + + /// + /// The base url endpoint where the SignalR service can be found. + /// + public Uri Uri { get; private set; } + + /// + /// Current State of the SignalR connection. + /// + public ConnectionStates State + { + get { return _state; } + private set + { + ConnectionStates old = _state; + _state = value; + + if (OnStateChanged != null) + OnStateChanged(this, old, _state); + } + } + private ConnectionStates _state; + + /// + /// Result of the negotiation request from the server. + /// + public NegotiationData NegotiationResult { get; private set; } + + /// + /// The hubs that the client is connected to. + /// + public Hub[] Hubs { get; private set; } + + /// + /// The transport that is used to send and receive messages. + /// + public TransportBase Transport { get; private set; } + + /// + /// Current client protocol in use. + /// + public ProtocolVersions Protocol { get; private set; } + + /// + /// Additional query parameters that will be passed for the handshake uri. If the value is null, or an empty string it will be not appended to the query only the key. + /// The keys and values must be escaped properly, as the plugin will not escape these. + /// + public ObservableDictionary AdditionalQueryParams + { + get { return additionalQueryParams; } + set + { + // Unsubscribe from previous dictionary's events + if (additionalQueryParams != null) + additionalQueryParams.CollectionChanged -= AdditionalQueryParams_CollectionChanged; + + additionalQueryParams = value; + + // Clear out the cached value + BuiltQueryParams = null; + + // Subscribe to the collection changed event + if (value != null) + value.CollectionChanged += AdditionalQueryParams_CollectionChanged; + } + } + private ObservableDictionary additionalQueryParams; + + /// + /// If it's false, the parameters in the AdditionalQueryParams will be passed for all http requests. Its default value is true. + /// + public bool QueryParamsOnlyForHandshake { get; set; } + + /// + /// The Json encoder that will be used by the connection and the transport. + /// + public IJsonEncoder JsonEncoder { get; set; } + + /// + /// An IAuthenticationProvider implementation that will be used to authenticate the connection. + /// + public IAuthenticationProvider AuthenticationProvider { get; set; } + + /// + /// How much time we have to wait between two pings. + /// + public TimeSpan PingInterval { get; set; } + + /// + /// Wait time before the plugin should do a reconnect attempt. Its default value is 5 seconds. + /// + public TimeSpan ReconnectDelay { get; set; } + + #endregion + + #region Public Events + + /// + /// Called when the protocol is open for communication. + /// + public event OnConnectedDelegate OnConnected; + + /// + /// Called when the connection is closed, and no further messages are sent or received. + /// + public event OnClosedDelegate OnClosed; + + /// + /// Called when an error occures. If the connection is already Started, it will try to do a reconnect, otherwise it will close the connection. + /// + public event OnErrorDelegate OnError; + + /// + /// This event called when a reconnection attempt are started. If fails to reconnect an OnError and OnClosed events are called. + /// + public event OnConnectedDelegate OnReconnecting; + + /// + /// This event called when the reconnection attempt succeded. + /// + public event OnConnectedDelegate OnReconnected; + + /// + /// Called every time when the connection's state changes. + /// + public event OnStateChanged OnStateChanged; + + /// + /// It's called when a non-Hub message received. The data can be anything from primitive types to array of complex objects. + /// + public event OnNonHubMessageDelegate OnNonHubMessage; + + /// + /// With this delegate all requests can be further customized. + /// + public OnPrepareRequestDelegate RequestPreparator { get; set; } + + #endregion + + #region Indexers + + /// + /// Indexer property the access hubs by index. + /// + public Hub this[int idx] { get { return Hubs[idx] as Hub; } } + + /// + /// Indexer property the access hubs by name. + /// + public Hub this[string hubName] + { + get + { + for (int i = 0; i < Hubs.Length; ++i) + { + Hub hub = Hubs[i] as Hub; + if (hub.Name.Equals(hubName, StringComparison.OrdinalIgnoreCase)) + return hub; + } + + return null; + } + } + + #endregion + + #region Internals + + /// + /// An object to be able maintain thread safety. + /// + internal object SyncRoot = new object(); + + /// + /// Unique ID for all message sent by the client. + /// + internal UInt64 ClientMessageCounter { get; set; } + + #endregion + + #region Privates + + /// + /// Supported client protocol versions. + /// + private readonly string[] ClientProtocols = new string[] { "1.3", "1.4", "1.5" }; + + /// + /// A timestamp that will be sent with all request for easier debugging. + /// + private UInt32 Timestamp { get { return (UInt32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).Ticks; } } + + /// + /// Request counter sent with all request for easier debugging. + /// + private UInt64 RequestCounter; + + /// + /// Instance of the last received message. Used for its MessageId. + /// + private MultiMessage LastReceivedMessage; + + /// + /// The GroupsToken sent by the server that stores what groups we are joined to. + /// We will send it with the reconnect request. + /// + private string GroupsToken; + + /// + /// Received messages before the Start request finishes. + /// + private List BufferedMessages; + + /// + /// When the last message received from the server. Used for reconnecting. + /// + private DateTime LastMessageReceivedAt; + + /// + /// When we started to reconnect. When too much time passes without a successful reconnect, we will close the connection. + /// + private DateTime ReconnectStartedAt; + + private DateTime ReconnectDelayStartedAt; + + /// + /// True, if the reconnect process started. + /// + private bool ReconnectStarted; + + /// + /// When the last ping request sent out. + /// + private DateTime LastPingSentAt; + + /// + /// Reference to the ping request. + /// + private HTTPRequest PingRequest; + + /// + /// When the transport started the connection process + /// + private DateTime? TransportConnectionStartedAt; + + /// + /// Cached StringBuilder instance used in BuildUri + /// + private StringBuilder queryBuilder = new StringBuilder(); + + /// + /// Builds and returns with the connection data made from the hub names. + /// + private string ConnectionData + { + get + { + if (!string.IsNullOrEmpty(BuiltConnectionData)) + return BuiltConnectionData; + + StringBuilder sb = new StringBuilder("[", Hubs.Length * 4); + + if (Hubs != null) + for (int i = 0; i < Hubs.Length; ++i) + { + sb.Append(@"{""Name"":"""); + sb.Append(Hubs[i].Name); + sb.Append(@"""}"); + + if (i < Hubs.Length - 1) + sb.Append(","); + } + + sb.Append("]"); + + return BuiltConnectionData = Uri.EscapeUriString(sb.ToString()); + } + } + + /// + /// The cached value of the result of the ConnectionData property call. + /// + private string BuiltConnectionData; + + /// + /// Builds the keys and values from the AdditionalQueryParams to an key=value form. If AdditionalQueryParams is null or empty, it will return an empty string. + /// + private string QueryParams + { + get + { + if (AdditionalQueryParams == null || AdditionalQueryParams.Count == 0) + return string.Empty; + + if (!string.IsNullOrEmpty(BuiltQueryParams)) + return BuiltQueryParams; + + StringBuilder sb = new StringBuilder(AdditionalQueryParams.Count * 4); + + foreach (var kvp in AdditionalQueryParams) + { + sb.Append("&"); + sb.Append(kvp.Key); + + if (!string.IsNullOrEmpty(kvp.Value)) + { + sb.Append("="); + sb.Append(Uri.EscapeDataString(kvp.Value)); + } + } + + return BuiltQueryParams = sb.ToString(); + } + } + + /// + /// The cached value of the result of the QueryParams property call. + /// + private string BuiltQueryParams; + + private SupportedProtocols NextProtocolToTry; + + #endregion + + #region Constructors + + public Connection(Uri uri, params string[] hubNames) + : this(uri) + { + if (hubNames != null && hubNames.Length > 0) + { + this.Hubs = new Hub[hubNames.Length]; + + for (int i = 0; i < hubNames.Length; ++i) + this.Hubs[i] = new Hub(hubNames[i], this); + } + } + + public Connection(Uri uri, params Hub[] hubs) + :this(uri) + { + this.Hubs = hubs; + if (hubs != null) + for (int i = 0; i < hubs.Length; ++i) + (hubs[i] as IHub).Connection = this; + } + + public Connection(Uri uri) + { + this.State = ConnectionStates.Initial; + this.Uri = uri; + + this.JsonEncoder = Connection.DefaultEncoder; + this.PingInterval = TimeSpan.FromMinutes(5); + + // Expected protocol + this.Protocol = ProtocolVersions.Protocol_2_2; + + this.ReconnectDelay = TimeSpan.FromSeconds(5); + } + + #endregion + + #region Starting the protocol + + /// + /// This function will start to authenticate if required, and the SignalR protocol negotiation. + /// + public void Open() + { + if (State != ConnectionStates.Initial && State != ConnectionStates.Closed) + return; + + if (AuthenticationProvider != null && AuthenticationProvider.IsPreAuthRequired) + { + this.State = ConnectionStates.Authenticating; + + AuthenticationProvider.OnAuthenticationSucceded += OnAuthenticationSucceded; + AuthenticationProvider.OnAuthenticationFailed += OnAuthenticationFailed; + + // Start the authentication process + AuthenticationProvider.StartAuthentication(); + } + else + StartImpl(); + } + + /// + /// Called when the authentication succeeded. + /// + /// + private void OnAuthenticationSucceded(IAuthenticationProvider provider) + { + provider.OnAuthenticationSucceded -= OnAuthenticationSucceded; + provider.OnAuthenticationFailed -= OnAuthenticationFailed; + + StartImpl(); + } + + /// + /// Called when the authentication failed. + /// + private void OnAuthenticationFailed(IAuthenticationProvider provider, string reason) + { + provider.OnAuthenticationSucceded -= OnAuthenticationSucceded; + provider.OnAuthenticationFailed -= OnAuthenticationFailed; + + (this as IConnection).Error(reason); + } + + /// + /// It's the real Start implementation. It will start the negotiation + /// + private void StartImpl() + { + this.State = ConnectionStates.Negotiating; + + NegotiationResult = new NegotiationData(this); + NegotiationResult.OnReceived = OnNegotiationDataReceived; + NegotiationResult.OnError = OnNegotiationError; + NegotiationResult.Start(); + } + + #region Negotiation Event Handlers + + /// + /// Protocol negotiation finished successfully. + /// + private void OnNegotiationDataReceived(NegotiationData data) + { + // Find out what supported protocol the server speak + int protocolIdx = -1; + for (int i = 0; i < ClientProtocols.Length && protocolIdx == -1; ++i) + if (data.ProtocolVersion == ClientProtocols[i]) + protocolIdx = i; + + // No supported protocol found? Try using the latest one. + if (protocolIdx == -1) + { + protocolIdx = (byte)ProtocolVersions.Protocol_2_2; + HTTPManager.Logger.Warning("SignalR Connection", "Unknown protocol version: " + data.ProtocolVersion); + } + + this.Protocol = (ProtocolVersions)protocolIdx; + + #if !BESTHTTP_DISABLE_WEBSOCKET + if (data.TryWebSockets) + { + Transport = new WebSocketTransport(this); + + #if !BESTHTTP_DISABLE_SERVERSENT_EVENTS + NextProtocolToTry = SupportedProtocols.ServerSentEvents; + #else + NextProtocolToTry = SupportedProtocols.HTTP; + #endif + } + else + #endif + { + #if !BESTHTTP_DISABLE_SERVERSENT_EVENTS + Transport = new ServerSentEventsTransport(this); + + // Long-Poll + NextProtocolToTry = SupportedProtocols.HTTP; + #else + + Transport = new PollingTransport(this); + + NextProtocolToTry = SupportedProtocols.Unknown; + #endif + } + + this.State = ConnectionStates.Connecting; + TransportConnectionStartedAt = DateTime.UtcNow; + + Transport.Connect(); + } + + /// + /// Protocol negotiation failed. + /// + private void OnNegotiationError(NegotiationData data, string error) + { + (this as IConnection).Error(error); + } + + #endregion + + #endregion + + #region Public Interface + + /// + /// Closes the connection and shuts down the transport. + /// + public void Close() + { + if (this.State == ConnectionStates.Closed) + return; + + this.State = ConnectionStates.Closed; + + //ReconnectStartedAt = null; + ReconnectStarted = false; + + TransportConnectionStartedAt = null; + + if (Transport != null) + { + Transport.Abort(); + Transport = null; + } + + NegotiationResult = null; + + HTTPManager.Heartbeats.Unsubscribe(this); + + LastReceivedMessage = null; + + if (Hubs != null) + for (int i = 0; i < Hubs.Length; ++i) + (Hubs[i] as IHub).Close(); + + if (BufferedMessages != null) + { + BufferedMessages.Clear(); + BufferedMessages = null; + } + + if (OnClosed != null) + { + try + { + OnClosed(this); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("SignalR Connection", "OnClosed", ex); + } + } + } + + /// + /// Initiates a reconnect to the SignalR server. + /// + public void Reconnect() + { + // Return if reconnect process already started. + if (ReconnectStarted) + return; + ReconnectStarted = true; + + // Set ReconnectStartedAt only when the previous State is not Reconnecting, + // so we keep the first date&time when we started reconnecting + if (this.State != ConnectionStates.Reconnecting) + ReconnectStartedAt = DateTime.UtcNow; + + this.State = ConnectionStates.Reconnecting; + + HTTPManager.Logger.Warning("SignalR Connection", "Reconnecting"); + + Transport.Reconnect(); + + if (PingRequest != null) + PingRequest.Abort(); + + if (OnReconnecting != null) + { + try + { + OnReconnecting(this); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("SignalR Connection", "OnReconnecting", ex); + } + } + } + + + /// + /// Will encode the argument to a Json string using the Connection's JsonEncoder, then will send it to the server. + /// + /// True if the plugin was able to send out the message + public bool Send(object arg) + { + if (arg == null) + throw new ArgumentNullException("arg"); + + lock(SyncRoot) + { + if (this.State != ConnectionStates.Connected) + return false; + + string json = JsonEncoder.Encode(arg); + + if (string.IsNullOrEmpty(json)) + HTTPManager.Logger.Error("SignalR Connection", "Failed to JSon encode the given argument. Please try to use an advanced JSon encoder(check the documentation how you can do it)."); + else + Transport.Send(json); + } + + return true; + } + + /// + /// Sends the given json string to the server. + /// + /// True if the plugin was able to send out the message + public bool SendJson(string json) + { + if (json == null) + throw new ArgumentNullException("json"); + + lock(SyncRoot) + { + if (this.State != ConnectionStates.Connected) + return false; + + Transport.Send(json); + } + + return true; + } + + #endregion + + #region IManager Functions + + /// + /// Called when we receive a message from the server + /// + void IConnection.OnMessage(IServerMessage msg) + { + if (this.State == ConnectionStates.Closed) + return; + + // Store messages that we receive while we are connecting + if (this.State == ConnectionStates.Connecting) + { + if (BufferedMessages == null) + BufferedMessages = new List(); + + BufferedMessages.Add(msg); + + return; + } + + LastMessageReceivedAt = DateTime.UtcNow; + + switch(msg.Type) + { + case MessageTypes.Multiple: + LastReceivedMessage = msg as MultiMessage; + + // Not received in the reconnect process, so we can't rely on it + if (LastReceivedMessage.IsInitialization) + HTTPManager.Logger.Information("SignalR Connection", "OnMessage - Init"); + + if (LastReceivedMessage.GroupsToken != null) + GroupsToken = LastReceivedMessage.GroupsToken; + + if (LastReceivedMessage.ShouldReconnect) + { + HTTPManager.Logger.Information("SignalR Connection", "OnMessage - Should Reconnect"); + + Reconnect(); + + // Should we return here not processing the messages that may come with it? + //return; + } + + if (LastReceivedMessage.Data != null) + for (int i = 0; i < LastReceivedMessage.Data.Count; ++i) + (this as IConnection).OnMessage(LastReceivedMessage.Data[i]); + + break; + + case MessageTypes.MethodCall: + MethodCallMessage methodCall = msg as MethodCallMessage; + + Hub hub = this[methodCall.Hub]; + + if (hub != null) + (hub as IHub).OnMethod(methodCall); + else + HTTPManager.Logger.Warning("SignalR Connection", string.Format("Hub \"{0}\" not found!", methodCall.Hub)); + + break; + + case MessageTypes.Result: + case MessageTypes.Failure: + case MessageTypes.Progress: + UInt64 id = (msg as IHubMessage).InvocationId; + hub = FindHub(id); + if (hub != null) + (hub as IHub).OnMessage(msg); + else + HTTPManager.Logger.Warning("SignalR Connection", string.Format("No Hub found for Progress message! Id: {0}", id.ToString())); + break; + + case MessageTypes.Data: + if (OnNonHubMessage != null) + OnNonHubMessage(this, (msg as DataMessage).Data); + break; + + case MessageTypes.KeepAlive: + break; + + default: + HTTPManager.Logger.Warning("SignalR Connection", "Unknown message type received: " + msg.Type.ToString()); + break; + } + } + + /// + /// Called from the transport implementations when the Start request finishes successfully. + /// + void IConnection.TransportStarted() + { + if (this.State != ConnectionStates.Connecting) + return; + + InitOnStart(); + + if (OnConnected != null) + { + try + { + OnConnected(this); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("SignalR Connection", "OnOpened", ex); + } + } + + // Deliver messages that we received before the /start request returned. + // This must be after the OnStarted call, to let the clients to subrscribe to these events. + if (BufferedMessages != null) + { + for (int i = 0; i < BufferedMessages.Count; ++i) + (this as IConnection).OnMessage(BufferedMessages[i]); + + BufferedMessages.Clear(); + BufferedMessages = null; + } + } + + /// + /// Called when the transport sucessfully reconnected to the server. + /// + void IConnection.TransportReconnected() + { + if (this.State != ConnectionStates.Reconnecting) + return; + + HTTPManager.Logger.Information("SignalR Connection", "Transport Reconnected"); + + InitOnStart(); + + if (OnReconnected != null) + { + try + { + OnReconnected(this); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("SignalR Connection", "OnReconnected", ex); + } + } + } + + /// + /// Called from the transport implementation when the Abort request finishes successfully. + /// + void IConnection.TransportAborted() + { + Close(); + } + + /// + /// Called when an error occures. If the connection is in the Connected state, it will start the reconnect process, otherwise it will close the connection. + /// + void IConnection.Error(string reason) + { + // Not interested about errors we received after we already closed + if (this.State == ConnectionStates.Closed) + return; + + // If we are just quitting, don't try to reconnect. + if (HTTPManager.IsQuitting) + { + Close(); + return; + } + + HTTPManager.Logger.Error("SignalR Connection", reason); + + ReconnectStarted = false; + + if (OnError != null) + OnError(this, reason); + + if (this.State == ConnectionStates.Connected || this.State == ConnectionStates.Reconnecting) + { + this.ReconnectDelayStartedAt = DateTime.UtcNow; + if (this.State != ConnectionStates.Reconnecting) + this.ReconnectStartedAt = DateTime.UtcNow; + + //Reconnect(); + } + else + { + // Fall back if possible + if (this.State != ConnectionStates.Connecting || !TryFallbackTransport()) + Close(); + } + } + + /// + /// Creates an Uri instance for the given request type. + /// + Uri IConnection.BuildUri(RequestTypes type) + { + return (this as IConnection).BuildUri(type, null); + } + + /// + /// Creates an Uri instance from the given parameters. + /// + Uri IConnection.BuildUri(RequestTypes type, TransportBase transport) + { + lock (SyncRoot) + { + // make sure that the queryBuilder is reseted + queryBuilder.Length = 0; + + UriBuilder uriBuilder = new UriBuilder(Uri); + + if (!uriBuilder.Path.EndsWith("/")) + uriBuilder.Path += "/"; + + this.RequestCounter %= UInt64.MaxValue; + + switch (type) + { + case RequestTypes.Negotiate: + uriBuilder.Path += "negotiate"; + goto default; + + case RequestTypes.Connect: +#if !BESTHTTP_DISABLE_WEBSOCKET + if (transport != null && transport.Type == TransportTypes.WebSocket) + uriBuilder.Scheme = HTTPProtocolFactory.IsSecureProtocol(Uri) ? "wss" : "ws"; +#endif + + uriBuilder.Path += "connect"; + goto default; + + case RequestTypes.Start: + uriBuilder.Path += "start"; + goto default; + + case RequestTypes.Poll: + uriBuilder.Path += "poll"; + + if (this.LastReceivedMessage != null) + { + queryBuilder.Append("messageId="); + queryBuilder.Append(this.LastReceivedMessage.MessageId); + } + + if (!string.IsNullOrEmpty(GroupsToken)) + { + if (queryBuilder.Length > 0) + queryBuilder.Append("&"); + + queryBuilder.Append("groupsToken="); + queryBuilder.Append(GroupsToken); + } + + goto default; + + case RequestTypes.Send: + uriBuilder.Path += "send"; + goto default; + + case RequestTypes.Reconnect: +#if !BESTHTTP_DISABLE_WEBSOCKET + if (transport != null && transport.Type == TransportTypes.WebSocket) + uriBuilder.Scheme = HTTPProtocolFactory.IsSecureProtocol(Uri) ? "wss" : "ws"; +#endif + + uriBuilder.Path += "reconnect"; + + if (this.LastReceivedMessage != null) + { + queryBuilder.Append("messageId="); + queryBuilder.Append(this.LastReceivedMessage.MessageId); + } + + if (!string.IsNullOrEmpty(GroupsToken)) + { + if (queryBuilder.Length > 0) + queryBuilder.Append("&"); + + queryBuilder.Append("groupsToken="); + queryBuilder.Append(GroupsToken); + } + + goto default; + + case RequestTypes.Abort: + uriBuilder.Path += "abort"; + goto default; + + case RequestTypes.Ping: + uriBuilder.Path += "ping"; + + queryBuilder.Append("&tid="); + queryBuilder.Append(this.RequestCounter++.ToString()); + + queryBuilder.Append("&_="); + queryBuilder.Append(Timestamp.ToString()); + + break; + + default: + if (queryBuilder.Length > 0) + queryBuilder.Append("&"); + + queryBuilder.Append("tid="); + queryBuilder.Append(this.RequestCounter++.ToString()); + + queryBuilder.Append("&_="); + queryBuilder.Append(Timestamp.ToString()); + + if (transport != null) + { + queryBuilder.Append("&transport="); + queryBuilder.Append(transport.Name); + } + + queryBuilder.Append("&clientProtocol="); + queryBuilder.Append(ClientProtocols[(byte)Protocol]); + + if (NegotiationResult != null && !string.IsNullOrEmpty(this.NegotiationResult.ConnectionToken)) + { + queryBuilder.Append("&connectionToken="); + queryBuilder.Append(this.NegotiationResult.ConnectionToken); + } + + if (this.Hubs != null && this.Hubs.Length > 0) + { + queryBuilder.Append("&connectionData="); + queryBuilder.Append(this.ConnectionData); + } + + break; + } + + // Query params are added to all uri + if (this.AdditionalQueryParams != null && this.AdditionalQueryParams.Count > 0) + queryBuilder.Append(this.QueryParams); + + uriBuilder.Query = queryBuilder.ToString(); + + // reset the string builder + queryBuilder.Length = 0; + + return uriBuilder.Uri; + } + } + + /// + /// It's called on every request before sending it out to the server. + /// + HTTPRequest IConnection.PrepareRequest(HTTPRequest req, RequestTypes type) + { + if (req != null && AuthenticationProvider != null) + AuthenticationProvider.PrepareRequest(req, type); + + if (RequestPreparator != null) + RequestPreparator(this, req, type); + + return req; + } + + /// + /// Will parse a "{ 'Response': 'xyz' }" object and returns with 'xyz'. If it fails to parse, or getting the 'Response' key, it will call the Error function. + /// + string IConnection.ParseResponse(string responseStr) + { + Dictionary dic = JSON.Json.Decode(responseStr) as Dictionary; + + if (dic == null) + { + (this as IConnection).Error("Failed to parse Start response: " + responseStr); + return string.Empty; + } + + object value; + if (!dic.TryGetValue("Response", out value) || value == null) + { + (this as IConnection).Error("No 'Response' key found in response: " + responseStr); + return string.Empty; + } + + return value.ToString(); + } + + #endregion + + #region IHeartbeat Implementation + + /// + /// IHeartbeat implementation to manage timeouts. + /// + void IHeartbeat.OnHeartbeatUpdate(TimeSpan dif) + { + switch(this.State) + { + case ConnectionStates.Connected: + if (Transport.SupportsKeepAlive && NegotiationResult.KeepAliveTimeout != null && DateTime.UtcNow - LastMessageReceivedAt >= NegotiationResult.KeepAliveTimeout) + Reconnect(); + + if (PingRequest == null && DateTime.UtcNow - LastPingSentAt >= PingInterval) + Ping(); + + break; + + case ConnectionStates.Reconnecting: + if ( DateTime.UtcNow - ReconnectStartedAt >= NegotiationResult.DisconnectTimeout) + { + HTTPManager.Logger.Warning("SignalR Connection", "OnHeartbeatUpdate - Failed to reconnect in the given time!"); + + Close(); + } + else if (DateTime.UtcNow - ReconnectDelayStartedAt >= ReconnectDelay) + { + if (HTTPManager.Logger.Level <= Logger.Loglevels.Warning) + HTTPManager.Logger.Warning("SignalR Connection", this.ReconnectStarted.ToString() + " " + this.ReconnectStartedAt.ToString() + " " + NegotiationResult.DisconnectTimeout.ToString()); + Reconnect(); + } + break; + + default: + + if (TransportConnectionStartedAt != null && DateTime.UtcNow - TransportConnectionStartedAt >= NegotiationResult.TransportConnectTimeout) + { + HTTPManager.Logger.Warning("SignalR Connection", "OnHeartbeatUpdate - Transport failed to connect in the given time!"); + + // Using the Error function here instead of Close() will enable us to try to do a transport fallback. + (this as IConnection).Error("Transport failed to connect in the given time!"); + } + + break; + } + } + + #endregion + + #region Private Helper Functions + + /// + /// Init function to set the connected states and set up other variables. + /// + private void InitOnStart() + { + this.State = ConnectionStates.Connected; + + //ReconnectStartedAt = null; + ReconnectStarted = false; + TransportConnectionStartedAt = null; + + LastPingSentAt = DateTime.UtcNow; + LastMessageReceivedAt = DateTime.UtcNow; + + HTTPManager.Heartbeats.Subscribe(this); + } + + /// + /// Find and return with a Hub that has the message id. + /// + private Hub FindHub(UInt64 msgId) + { + if (Hubs != null) + for (int i = 0; i < Hubs.Length; ++i) + if ((Hubs[i] as IHub).HasSentMessageId(msgId)) + return Hubs[i]; + return null; + } + + /// + /// Try to fall back to next transport. If no more transport to try, it will return false. + /// + private bool TryFallbackTransport() + { + if (this.State == ConnectionStates.Connecting) + { + if (BufferedMessages != null) + BufferedMessages.Clear(); + + // stop the current transport + Transport.Stop(); + Transport = null; + + switch(NextProtocolToTry) + { +#if !BESTHTTP_DISABLE_WEBSOCKET + case SupportedProtocols.WebSocket: + Transport = new WebSocketTransport(this); + break; +#endif + +#if !BESTHTTP_DISABLE_SERVERSENT_EVENTS + case SupportedProtocols.ServerSentEvents: + Transport = new ServerSentEventsTransport(this); + NextProtocolToTry = SupportedProtocols.HTTP; + break; +#endif + + case SupportedProtocols.HTTP: + Transport = new PollingTransport(this); + NextProtocolToTry = SupportedProtocols.Unknown; + break; + + case SupportedProtocols.Unknown: + return false; + } + + TransportConnectionStartedAt = DateTime.UtcNow; + + Transport.Connect(); + + if (PingRequest != null) + PingRequest.Abort(); + + return true; + } + + return false; + } + + /// + /// This event will be called when the AdditonalQueryPrams dictionary changed. We have to reset the cached values. + /// + private void AdditionalQueryParams_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + BuiltQueryParams = null; + } + + #endregion + + #region Ping Implementation + + /// + /// Sends a Ping request to the SignalR server. + /// + private void Ping() + { + HTTPManager.Logger.Information("SignalR Connection", "Sending Ping request."); + + PingRequest = new HTTPRequest((this as IConnection).BuildUri(RequestTypes.Ping), OnPingRequestFinished); + PingRequest.ConnectTimeout = PingInterval; + + (this as IConnection).PrepareRequest(PingRequest, RequestTypes.Ping); + + PingRequest.Send(); + + LastPingSentAt = DateTime.UtcNow; + } + + /// + /// Called when the Ping request finished. + /// + void OnPingRequestFinished(HTTPRequest req, HTTPResponse resp) + { + PingRequest = null; + + string reason = string.Empty; + + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + // Parse the response, and do nothing when we receive the "pong" response + string response = (this as IConnection).ParseResponse(resp.DataAsText); + + if (response != "pong") + reason = "Wrong answer for ping request: " + response; + else + HTTPManager.Logger.Information("SignalR Connection", "Pong received."); + } + else + reason = string.Format("Ping - Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + reason = "Ping - Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"); + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + reason = "Ping - Connection Timed Out!"; + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + reason = "Ping - Processing the request Timed Out!"; + break; + } + + if (!string.IsNullOrEmpty(reason)) + (this as IConnection).Error(reason); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Connection.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Connection.cs.meta new file mode 100644 index 00000000..7d487bad --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Connection.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 878e20e1ec06ef542946893b5e37c3b6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Enums.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Enums.cs new file mode 100644 index 00000000..a1d78408 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Enums.cs @@ -0,0 +1,196 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +namespace BestHTTP.SignalR +{ + /// + /// Possible transport types. + /// + public enum TransportTypes + { + /// + /// Transport using WebSockets. + /// + WebSocket, + + /// + /// Transport using ServerSentEvents protocol. + /// + ServerSentEvents, + + /// + /// Transport using long-polling requests. + /// + LongPoll + } + + /// + /// Server sent message types + /// + public enum MessageTypes + { + /// + /// An empty json object {} sent by the server to check keep alive. + /// + KeepAlive, + + /// + /// A no-hub message that contains data. + /// + Data, + + /// + /// A message that can hold multiple data message alongside with other information. + /// + Multiple, + + /// + /// A method call result. + /// + Result, + + /// + /// A message about a failed method call. + /// + Failure, + + /// + /// A message with all information to be able to call a method on the client. + /// + MethodCall, + + /// + /// A long running server-method's progress. + /// + Progress + } + + /// + /// Possible SignalR Connection states. + /// + public enum ConnectionStates + { + /// + /// The initial state of the connection. + /// + Initial, + + /// + /// The client authenticates itself with the server. This state is skipped if no AuthenticationProvider is present. + /// + Authenticating, + + /// + /// The client sent out the negotiation request to the server. + /// + Negotiating, + + /// + /// The client received the negotiation data, created the transport and wait's for the transport's connection. + /// + Connecting, + + /// + /// The transport connected and started successfully. + /// + Connected, + + /// + /// The client started the reconnect process. + /// + Reconnecting, + + /// + /// The connection is closed. + /// + Closed + } + + /// + /// Possible types of SignalR requests. + /// + public enum RequestTypes + { + /// + /// Request to the /negotiate path to negotiate protocol parameters. + /// + Negotiate, + + /// + /// Request to the /connect path to connect to the server. With long-polling, it's like a regular poll request. + /// + Connect, + + /// + /// Request to the /start path to start the protocol. + /// + Start, + + /// + /// Request to the /poll path to get new messages. Not used with the WebSocketTransport. + /// + Poll, + + /// + /// Request to the /send path to send a message to the server. Not used with the WebSocketTransport. + /// + Send, + + /// + /// Request to the /reconnect path to initiate a reconnection. It's used instead of the Connect type. + /// + Reconnect, + + /// + /// Request to the /abort path to close the connection. + /// + Abort, + + /// + /// Request to the /ping path to ping the server keeping the asp.net session alive. + /// + Ping + } + + /// + /// Possible states of a transport. + /// + public enum TransportStates + { + /// + /// Initial state + /// + Initial, + + /// + /// Connecting + /// + Connecting, + + /// + /// Reconnecting + /// + Reconnecting, + + /// + /// Sending Start request + /// + Starting, + + /// + /// Start request finished successfully + /// + Started, + + /// + /// Sending Abort request + /// + Closing, + + /// + /// The transport closed after Abort request sent + /// + Closed + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Enums.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Enums.cs.meta new file mode 100644 index 00000000..1ed53210 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Enums.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: fafa6e4c8bf63324c82241199e91f437 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs.meta new file mode 100644 index 00000000..4060c0cd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7208796729371c74c9d7c3398b19f8f3 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/Hub.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/Hub.cs new file mode 100644 index 00000000..5605ff41 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/Hub.cs @@ -0,0 +1,391 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; +using System.Collections.Generic; + +using BestHTTP.SignalR.Messages; +using System.Text; + +namespace BestHTTP.SignalR.Hubs +{ + public delegate void OnMethodCallDelegate(Hub hub, string method, params object[] args); + public delegate void OnMethodCallCallbackDelegate(Hub hub, MethodCallMessage methodCall); + + public delegate void OnMethodResultDelegate(Hub hub, ClientMessage originalMessage, ResultMessage result); + public delegate void OnMethodFailedDelegate(Hub hub, ClientMessage originalMessage, FailureMessage error); + public delegate void OnMethodProgressDelegate(Hub hub, ClientMessage originialMessage, ProgressMessage progress); + + /// + /// Represents a clientside Hub. This class can be used as a base class to encapsulate proxy functionalities. + /// + public class Hub : IHub + { + + #region Public Properties + + /// + /// Name of this hub. + /// + public string Name { get; private set; } + + /// + /// Server and user set state of the hub. + /// + public Dictionary State + { + // Create only when we need to. + get + { + if (state == null) + state = new Dictionary(); + return state; + } + } + private Dictionary state; + + /// + /// Event called every time when the server sends an order to call a method on the client. + /// + public event OnMethodCallDelegate OnMethodCall; + + #endregion + + #region Privates + + /// + /// Table of the sent messages. These messages will be removed from this table when a Result message is received from the server. + /// + private Dictionary SentMessages = new Dictionary(); + + /// + /// Methodname -> callback delegate mapping. This table stores the server callable functions. + /// + private Dictionary MethodTable = new Dictionary(); + + /// + /// A reusable StringBuilder to save some GC allocs + /// + private StringBuilder builder = new StringBuilder(); + + #endregion + + Connection IHub.Connection { get; set; } + + public Hub(string name) + :this(name, null) + { + + } + + public Hub(string name, Connection manager) + { + this.Name = name; + (this as IHub).Connection = manager; + } + + #region Public Hub Functions + + /// + /// Registers a callback function to the given method. + /// + public void On(string method, OnMethodCallCallbackDelegate callback) + { + MethodTable[method] = callback; + } + + /// + /// Removes callback from the given method. + /// + /// + public void Off(string method) + { + MethodTable[method] = null; + } + + /// + /// Orders the server to call a method with the given arguments. + /// + /// True if the plugin was able to send out the message + public bool Call(string method, params object[] args) + { + return Call(method, null, null, null, args); + } + + /// + /// Orders the server to call a method with the given arguments. + /// The onResult callback will be called when the server successfully called the function. + /// + /// True if the plugin was able to send out the message + public bool Call(string method, OnMethodResultDelegate onResult, params object[] args) + { + return Call(method, onResult, null, null, args); + } + + /// + /// Orders the server to call a method with the given arguments. + /// The onResult callback will be called when the server successfully called the function. + /// The onResultError will be called when the server can't call the function, or when the function throws an exception. + /// + /// True if the plugin was able to send out the message + public bool Call(string method, OnMethodResultDelegate onResult, OnMethodFailedDelegate onResultError, params object[] args) + { + return Call(method, onResult, onResultError, null, args); + } + + /// + /// Orders the server to call a method with the given arguments. + /// The onResult callback will be called when the server successfully called the function. + /// The onProgress callback called multiple times when the method is a long running function and reports back its progress. + /// + /// True if the plugin was able to send out the message + public bool Call(string method, OnMethodResultDelegate onResult, OnMethodProgressDelegate onProgress, params object[] args) + { + return Call(method, onResult, null, onProgress, args); + } + + /// + /// Orders the server to call a method with the given arguments. + /// The onResult callback will be called when the server successfully called the function. + /// The onResultError will be called when the server can't call the function, or when the function throws an exception. + /// The onProgress callback called multiple times when the method is a long running function and reports back its progress. + /// + /// True if the plugin was able to send out the message + public bool Call(string method, OnMethodResultDelegate onResult, OnMethodFailedDelegate onResultError, OnMethodProgressDelegate onProgress, params object[] args) + { + IHub thisHub = this as IHub; + + lock (thisHub.Connection.SyncRoot) + { + // Start over the counter if we are reached the max value if the UInt64 type. + // While we are using this property only here, we don't want to make it static to avoid another thread synchronization, neither we want to make it a Hub-instance field to achieve better deuggability. + thisHub.Connection.ClientMessageCounter %= UInt64.MaxValue; + + // Create and send the client message + return thisHub.Call(new ClientMessage(this, method, args, thisHub.Connection.ClientMessageCounter++, onResult, onResultError, onProgress)); + } + } + + #endregion + + #region IHub Implementation + + bool IHub.Call(ClientMessage msg) + { + IHub thisHub = this as IHub; + + lock (thisHub.Connection.SyncRoot) + { + if (!thisHub.Connection.SendJson(BuildMessage(msg))) + return false; + + SentMessages.Add(msg.CallIdx, msg); + } + + return true; + } + + /// + /// Return true if this hub sent the message with the given id. + /// + bool IHub.HasSentMessageId(UInt64 id) + { + return SentMessages.ContainsKey(id); + } + + /// + /// Called on the manager's close. + /// + void IHub.Close() + { + SentMessages.Clear(); + } + + /// + /// Called when the client receives an order to call a hub-function. + /// + void IHub.OnMethod(MethodCallMessage msg) + { + // Merge the newly received states with the old one + MergeState(msg.State); + + if (OnMethodCall != null) + { + try + { + OnMethodCall(this, msg.Method, msg.Arguments); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("Hub - " + this.Name, "IHub.OnMethod - OnMethodCall", ex); + } + } + + OnMethodCallCallbackDelegate callback; + if (MethodTable.TryGetValue(msg.Method, out callback) && callback != null) + { + try + { + callback(this, msg); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("Hub - " + this.Name, "IHub.OnMethod - callback", ex); + } + } + else if (OnMethodCall == null) + HTTPManager.Logger.Warning("Hub - " + this.Name, string.Format("[Client] {0}.{1} (args: {2})", this.Name, msg.Method, msg.Arguments.Length)); + } + + /// + /// Called when the client receives back messages as a result of a server method call. + /// + void IHub.OnMessage(IServerMessage msg) + { + ClientMessage originalMsg; + + UInt64 id = (msg as IHubMessage).InvocationId; + if (!SentMessages.TryGetValue(id, out originalMsg)) + { + // This can happen when a result message removes the ClientMessage from the SentMessages dictionary, + // then a late come progress message tries to access it + HTTPManager.Logger.Warning("Hub - " + this.Name, "OnMessage - Sent message not found with id: " + id.ToString()); + return; + } + + switch(msg.Type) + { + case MessageTypes.Result: + ResultMessage result = msg as ResultMessage; + + // Merge the incoming State before firing the events + MergeState(result.State); + + if (originalMsg.ResultCallback != null) + { + try + { + originalMsg.ResultCallback(this, originalMsg, result); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("Hub " + this.Name, "IHub.OnMessage - ResultCallback", ex); + } + } + + SentMessages.Remove(id); + + break; + + case MessageTypes.Failure: + FailureMessage error = msg as FailureMessage; + + // Merge the incoming State before firing the events + MergeState(error.State); + + if (originalMsg.ResultErrorCallback != null) + { + try + { + originalMsg.ResultErrorCallback(this, originalMsg, error); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("Hub " + this.Name, "IHub.OnMessage - ResultErrorCallback", ex); + } + } + + SentMessages.Remove(id); + break; + + case MessageTypes.Progress: + if (originalMsg.ProgressCallback != null) + { + try + { + originalMsg.ProgressCallback(this, originalMsg, msg as ProgressMessage); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("Hub " + this.Name, "IHub.OnMessage - ProgressCallback", ex); + } + } + break; + } + } + + #endregion + + #region Helper Functions + + /// + /// Merges the current and the new states. + /// +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + private void MergeState(IDictionary state) +#else + private void MergeState(IDictionary state) +#endif + { + if (state != null && state.Count > 0) + foreach (var kvp in state) + this.State[kvp.Key] = kvp.Value; + } + + /// + /// Builds a JSon string from the given message. + /// + private string BuildMessage(ClientMessage msg) + { + try + { + builder.Append("{\"H\":\""); + builder.Append(this.Name); + builder.Append("\",\"M\":\""); + builder.Append(msg.Method); + builder.Append("\",\"A\":"); + + string jsonEncoded = string.Empty; + + // Arguments + if (msg.Args != null && msg.Args.Length > 0) + jsonEncoded = (this as IHub).Connection.JsonEncoder.Encode(msg.Args); + else + jsonEncoded = "[]"; + + builder.Append(jsonEncoded); + + builder.Append(",\"I\":\""); + builder.Append(msg.CallIdx.ToString()); + builder.Append("\""); + + // State, if any + if (msg.Hub.state != null && msg.Hub.state.Count > 0) + { + builder.Append(",\"S\":"); + + jsonEncoded = (this as IHub).Connection.JsonEncoder.Encode(msg.Hub.state); + builder.Append(jsonEncoded); + } + + builder.Append("}"); + + return builder.ToString(); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("Hub - " + this.Name, "Send", ex); + + return null; + } + finally + { + // reset the StringBuilder instance, to reuse next time + builder.Length = 0; + } + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/Hub.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/Hub.cs.meta new file mode 100644 index 00000000..ee76d02b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/Hub.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 00b4b8fd0e14de941b796a56a1272233 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/IHub.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/IHub.cs new file mode 100644 index 00000000..5426c293 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/IHub.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; + +using BestHTTP.SignalR.Messages; + +namespace BestHTTP.SignalR.Hubs +{ + /// + /// Interface to be able to hide internally used functions and properties. + /// + public interface IHub + { + Connection Connection { get; set; } + + bool Call(ClientMessage msg); + bool HasSentMessageId(UInt64 id); + void Close(); + void OnMethod(MethodCallMessage msg); + void OnMessage(IServerMessage msg); + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/IHub.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/IHub.cs.meta new file mode 100644 index 00000000..78982e77 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Hubs/IHub.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1813781a232e6c74ba3e00896327ace6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders.meta new file mode 100644 index 00000000..794d22c3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c593c51184e979a4d8e4bb2cc2a9b1d0 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs new file mode 100644 index 00000000..cc6c3c18 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using BestHTTP.JSON; +using System.Collections.Generic; + +namespace BestHTTP.SignalR.JsonEncoders +{ + public sealed class DefaultJsonEncoder : IJsonEncoder + { + public string Encode(object obj) + { + return Json.Encode(obj); + } + + public IDictionary DecodeMessage(string json) + { + bool ok = false; + IDictionary result = Json.Decode(json, ref ok) as IDictionary; + return ok ? result : null; + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs.meta new file mode 100644 index 00000000..d6d0d4ed --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/DefaultJsonEncoder.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 1a4bf647dcdcdbf44ab1edc744192ca0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/IJsonEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/IJsonEncoder.cs new file mode 100644 index 00000000..7304031f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/IJsonEncoder.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System.Collections.Generic; + +namespace BestHTTP.SignalR.JsonEncoders +{ + /// + /// Interface to be able to write custom Json encoders/decoders. + /// + public interface IJsonEncoder + { + /// + /// This function must create a json formatted string from the given object. If the encoding fails, it should return null. + /// + string Encode(object obj); + + /// + /// This function must create a dictionary the Json formatted string parameter. If the decoding fails, it should return null. + /// + IDictionary DecodeMessage(string json); + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/IJsonEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/IJsonEncoder.cs.meta new file mode 100644 index 00000000..ce9466d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/JsonEncoders/IJsonEncoder.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b494cd3e9ad9bd243bd68251a27c86b9 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages.meta new file mode 100644 index 00000000..ad774686 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3ea7772f76aa54748aa8b466ba3113a9 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ClientMessage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ClientMessage.cs new file mode 100644 index 00000000..c1c4c867 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ClientMessage.cs @@ -0,0 +1,71 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; + +using BestHTTP.SignalR.Hubs; + +namespace BestHTTP.SignalR.Messages +{ + /// + /// This struct represents a message from the client. + /// It holds every data and reference needed to construct the string represented message that will be sent to the wire. + /// + public struct ClientMessage + { + /// + /// Reference to the source Hub. The Name and the State of the hub will be user. + /// + public readonly Hub Hub; + + /// + /// Name of the method on the server to be called. + /// + public readonly string Method; + + /// + /// Arguments of the method. + /// + public readonly object[] Args; + + /// + /// Unique id on the client of this message + /// + public readonly UInt64 CallIdx; + + /// + /// The delegate that will be called when the server will sends a result of this method call. + /// + public readonly OnMethodResultDelegate ResultCallback; + + /// + /// The delegate that will be called when the server sends an error-result to this method call. + /// + public readonly OnMethodFailedDelegate ResultErrorCallback; + + /// + /// The delegate that will be called when the server sends a progress message to this method call. + /// + public readonly OnMethodProgressDelegate ProgressCallback; + + public ClientMessage(Hub hub, + string method, + object[] args, + UInt64 callIdx, + OnMethodResultDelegate resultCallback, + OnMethodFailedDelegate resultErrorCallback, + OnMethodProgressDelegate progressCallback) + { + Hub = hub; + Method = method; + Args = args; + + CallIdx = callIdx; + + ResultCallback = resultCallback; + ResultErrorCallback = resultErrorCallback; + ProgressCallback = progressCallback; + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ClientMessage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ClientMessage.cs.meta new file mode 100644 index 00000000..658559cb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ClientMessage.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: af18bb2021dd2f045b2d168d5769fab1 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/IServerMessage.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/IServerMessage.cs new file mode 100644 index 00000000..c5ffb288 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/IServerMessage.cs @@ -0,0 +1,19 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; + +namespace BestHTTP.SignalR.Messages +{ + public interface IServerMessage + { + MessageTypes Type { get; } + void Parse(object data); + } + + public interface IHubMessage + { + UInt64 InvocationId { get; } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/IServerMessage.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/IServerMessage.cs.meta new file mode 100644 index 00000000..278f6781 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/IServerMessage.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 25c60db0524552144bf03b547ae8a585 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ServerMessages.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ServerMessages.cs new file mode 100644 index 00000000..8f82c5b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ServerMessages.cs @@ -0,0 +1,354 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET +using Newtonsoft.Json.Linq; +#endif +using System; +using System.Collections; +using System.Collections.Generic; + +namespace BestHTTP.SignalR.Messages +{ + /// + /// Keep-alive message sent by the server. No data sent with it. + /// + public sealed class KeepAliveMessage : IServerMessage + { + MessageTypes IServerMessage.Type { get { return MessageTypes.KeepAlive; } } + void IServerMessage.Parse(object data) { } + } + + /// + /// A message that may contains multiple sub-messages and additional informations. + /// + public sealed class MultiMessage : IServerMessage + { + MessageTypes IServerMessage.Type { get { return MessageTypes.Multiple; } } + + /// + /// Id of the sent message + /// + public string MessageId { get; private set; } + + /// + /// True if it's an initialization message, false otherwise. + /// + public bool IsInitialization { get; private set; } + + /// + /// Group token may be sent, if the group changed that the client belongs to. + /// + public string GroupsToken { get; private set; } + + /// + /// The server suggests that the client should do a reconnect turn. + /// + public bool ShouldReconnect { get; private set; } + + /// + /// Additional poll delay sent by the server. + /// + public TimeSpan? PollDelay { get; private set; } + + /// + /// List of server messages sent inside this message. + /// + public List Data { get; private set; } + + void IServerMessage.Parse(object data) + { + IDictionary dic = data as IDictionary; + object value; + + this.MessageId = dic["C"].ToString(); + + if (dic.TryGetValue("S", out value)) + IsInitialization = int.Parse(value.ToString()) == 1 ? true : false; + else + IsInitialization = false; + + if (dic.TryGetValue("G", out value)) + GroupsToken = value.ToString(); + + if (dic.TryGetValue("T", out value)) + ShouldReconnect = int.Parse(value.ToString()) == 1 ? true : false; + else + ShouldReconnect = false; + + if (dic.TryGetValue("L", out value)) + PollDelay = TimeSpan.FromMilliseconds(double.Parse(value.ToString())); + + IEnumerable enumerable = dic["M"] as IEnumerable; + + if (enumerable != null) + { + Data = new List(); + + foreach (object subData in enumerable) + { +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + IDictionary subObj = subData as IDictionary; +#else + IDictionary subObj = subData as IDictionary; +#endif + + IServerMessage subMsg = null; + + if (subObj != null) + { + if (subObj.ContainsKey("H")) + subMsg = new MethodCallMessage(); + else if (subObj.ContainsKey("I")) + subMsg = new ProgressMessage(); + else + subMsg = new DataMessage(); + } + else + subMsg = new DataMessage(); + + subMsg.Parse(subData); + + Data.Add(subMsg); + } + } + } + } + + /// + /// A simple non-hub data message. It holds only one Data property. + /// + public sealed class DataMessage : IServerMessage + { + MessageTypes IServerMessage.Type { get { return MessageTypes.Data; } } + + public object Data { get; private set; } + + void IServerMessage.Parse(object data) + { + this.Data = data; + } + } + + /// + /// A Hub message that orders the client to call a method. + /// + public sealed class MethodCallMessage : IServerMessage + { + MessageTypes IServerMessage.Type { get { return MessageTypes.MethodCall; } } + + /// + /// The name of the Hub that the method is called on. + /// + public string Hub { get; private set; } + + /// + /// Name of the Method. + /// + public string Method { get; private set; } + + /// + /// Arguments of the method call. + /// + public object[] Arguments { get; private set; } + + /// + /// State changes of the hub. It's handled automatically by the Hub. + /// +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + public IDictionary State { get; private set; } +#else + public IDictionary State { get; private set; } +#endif + + void IServerMessage.Parse(object data) + { + #if BESTHTTP_SIGNALR_WITH_JSONDOTNET + IDictionary dic = data as IDictionary; + #else + IDictionary dic = data as IDictionary; + #endif + + Hub = dic["H"].ToString(); + Method = dic["M"].ToString(); + + List args = new List(); + foreach (object arg in dic["A"] as IEnumerable) + args.Add(arg); + Arguments = args.ToArray(); + +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + JToken value; + if (dic.TryGetValue("S", out value)) + State = value as IDictionary; +#else + object value; + if (dic.TryGetValue("S", out value)) + State = value as IDictionary; +#endif + } + } + + /// + /// Message of a server side method invocation result. + /// + public sealed class ResultMessage : IServerMessage, IHubMessage + { + MessageTypes IServerMessage.Type { get { return MessageTypes.Result; } } + + /// + /// The unique id that the client set when called the server side method. Used by the plugin to deliver this message to the good Hub. + /// + public UInt64 InvocationId { get; private set; } + + /// + /// The return value of the server side method call, or null if the method's return type is void. + /// + public object ReturnValue { get; private set; } + + /// + /// State changes of the hub. It's handled automatically by the Hub. + /// +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + public IDictionary State { get; private set; } +#else + public IDictionary State { get; private set; } +#endif + + void IServerMessage.Parse(object data) + { + IDictionary dic = data as IDictionary; + + InvocationId = UInt64.Parse(dic["I"].ToString()); + + object value; + if (dic.TryGetValue("R", out value)) + ReturnValue = value; + + if (dic.TryGetValue("S", out value)) + { +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + State = value as IDictionary; +#else + State = value as IDictionary; +#endif + } + } + } + + public sealed class FailureMessage : IServerMessage, IHubMessage + { + MessageTypes IServerMessage.Type { get { return MessageTypes.Failure; } } + + /// + /// The unique id that the client set when called the server side method. Used by the plugin to deliver this message to the good Hub. + /// + public UInt64 InvocationId { get; private set; } + + /// + /// True if it's a hub error. + /// + public bool IsHubError { get; private set; } + + /// + /// If the method call failed, it contains the error message to detail what happened. + /// + public string ErrorMessage { get; private set; } + + /// + /// A dictionary that may contain additional error data (can only be present for hub errors). It can be null. + /// +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + public IDictionary AdditionalData { get; private set; } +#else + public IDictionary AdditionalData { get; private set; } +#endif + + /// + /// Stack trace of the error. It present only if detailed error reporting is turned on on the server (https://msdn.microsoft.com/en-us/library/microsoft.aspnet.signalr.hubconfiguration.enabledetailederrors%28v=vs.118%29.aspx). + /// + public string StackTrace { get; private set; } + + /// + /// State changes of the hub. It's handled automatically by the Hub. + /// +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + public IDictionary State { get; private set; } +#else + public IDictionary State { get; private set; } +#endif + + void IServerMessage.Parse(object data) + { + IDictionary dic = data as IDictionary; + + InvocationId = UInt64.Parse(dic["I"].ToString()); + + object value; + + if (dic.TryGetValue("E", out value)) + ErrorMessage = value.ToString(); + + if (dic.TryGetValue("H", out value)) + IsHubError = int.Parse(value.ToString()) == 1 ? true : false; + + if (dic.TryGetValue("D", out value)) + { +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + AdditionalData = value as IDictionary; +#else + AdditionalData = value as IDictionary; +#endif + } + + if (dic.TryGetValue("T", out value)) + StackTrace = value.ToString(); + + if (dic.TryGetValue("S", out value)) + { +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + State = value as IDictionary; +#else + State = value as IDictionary; +#endif + } + } + } + + /// + /// When a server method is a long running method the server can send the information about the progress of execution of the method to the client. + /// + public sealed class ProgressMessage : IServerMessage, IHubMessage + { + MessageTypes IServerMessage.Type { get { return MessageTypes.Progress; } } + + /// + /// The unique id that the client set when called the server side method. Used by the plugin to deliver this message to the good Hub. + /// + public UInt64 InvocationId { get; private set; } + + /// + /// Current progress of the long running method. + /// + public double Progress { get; private set; } + + void IServerMessage.Parse(object data) + { +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + IDictionary dic = data as IDictionary; +#else + IDictionary dic = data as IDictionary; +#endif + +#if BESTHTTP_SIGNALR_WITH_JSONDOTNET + IDictionary P = dic["P"] as IDictionary; +#else + IDictionary P = dic["P"] as IDictionary; +#endif + + InvocationId = UInt64.Parse(P["I"].ToString()); + Progress = double.Parse(P["D"].ToString()); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ServerMessages.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ServerMessages.cs.meta new file mode 100644 index 00000000..eb21219b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Messages/ServerMessages.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a128625937e3c5b459b3aa221061a03f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/NegotiationData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/NegotiationData.cs new file mode 100644 index 00000000..989f81f3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/NegotiationData.cs @@ -0,0 +1,276 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; +using System.Collections.Generic; + +using BestHTTP.JSON; + +namespace BestHTTP.SignalR +{ + public sealed class NegotiationData + { + #region Public Negotiate data + + /// + /// Path to the SignalR endpoint. Currently not used by the client. + /// + public string Url { get; private set; } + + /// + /// WebSocket endpoint. + /// + public string WebSocketServerUrl { get; private set; } + + /// + /// Connection token assigned by the server. See this article for more details: http://www.asp.net/signalr/overview/security/introduction-to-security#connectiontoken. + /// This value needs to be sent in each subsequent request as the value of the connectionToken parameter + /// + public string ConnectionToken { get; private set; } + + /// + /// The id of the connection. + /// + public string ConnectionId { get; private set; } + + /// + /// The amount of time in seconds the client should wait before attempting to reconnect if it has not received a keep alive message. + /// If the server is configured to not send keep alive messages this value is null. + /// + public TimeSpan? KeepAliveTimeout { get; private set; } + + /// + /// The amount of time within which the client should try to reconnect if the connection goes away. + /// + public TimeSpan DisconnectTimeout { get; private set; } + + /// + /// Timeout of poll requests. + /// + public TimeSpan ConnectionTimeout { get; private set; } + + /// + /// Whether the server supports websockets. + /// + public bool TryWebSockets { get; private set; } + + /// + /// The version of the protocol used for communication. + /// + public string ProtocolVersion { get; private set; } + + /// + /// The maximum amount of time the client should try to connect to the server using a given transport. + /// + public TimeSpan TransportConnectTimeout { get; private set; } + + /// + /// The wait time before restablishing a long poll connection after data is sent from the server. The default value is 0. + /// + public TimeSpan LongPollDelay { get; private set; } + + #endregion + + #region Event Handlers + + /// + /// Event handler that called when the negotiation data received and parsed successfully. + /// + public Action OnReceived; + + /// + /// Event handler that called when an error happens. + /// + public Action OnError; + + #endregion + + #region Private + + private HTTPRequest NegotiationRequest; + private IConnection Connection; + + #endregion + + public NegotiationData(Connection connection) + { + this.Connection = connection; + } + + /// + /// Start to get the negotiation data. + /// + public void Start() + { + NegotiationRequest = new HTTPRequest(Connection.BuildUri(RequestTypes.Negotiate), HTTPMethods.Get, true, true, OnNegotiationRequestFinished); + Connection.PrepareRequest(NegotiationRequest, RequestTypes.Negotiate); + NegotiationRequest.Send(); + + HTTPManager.Logger.Information("NegotiationData", "Negotiation request sent"); + } + + /// + /// Abort the negotiation request. + /// + public void Abort() + { + if (NegotiationRequest != null) + { + OnReceived = null; + OnError = null; + NegotiationRequest.Abort(); + } + } + + #region Request Event Handler + + private void OnNegotiationRequestFinished(HTTPRequest req, HTTPResponse resp) + { + NegotiationRequest = null; + + switch (req.State) + { + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + HTTPManager.Logger.Information("NegotiationData", "Negotiation data arrived: " + resp.DataAsText); + + int idx = resp.DataAsText.IndexOf("{"); + if (idx < 0) + { + RaiseOnError("Invalid negotiation text: " + resp.DataAsText); + return; + } + + var Negotiation = Parse(resp.DataAsText.Substring(idx)); + + if (Negotiation == null) + { + RaiseOnError("Parsing Negotiation data failed: " + resp.DataAsText); + return; + } + + if (OnReceived != null) + { + OnReceived(this); + OnReceived = null; + } + } + else + RaiseOnError(string.Format("Negotiation request finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2} Uri: {3}", + resp.StatusCode, + resp.Message, + resp.DataAsText, + req.CurrentUri)); + break; + + case HTTPRequestStates.Error: + RaiseOnError(req.Exception != null ? (req.Exception.Message + " " + req.Exception.StackTrace) : string.Empty); + break; + + default: + RaiseOnError(req.State.ToString()); + break; + } + } + + #endregion + + #region Helper Methods + + private void RaiseOnError(string err) + { + HTTPManager.Logger.Error("NegotiationData", "Negotiation request failed with error: " + err); + + if (OnError != null) + { + OnError(this, err); + OnError = null; + } + } + + private NegotiationData Parse(string str) + { + bool success = false; + Dictionary dict = Json.Decode(str, ref success) as Dictionary; + if (!success) + return null; + + try + { + this.Url = GetString(dict, "Url"); + + if (dict.ContainsKey("webSocketServerUrl")) + this.WebSocketServerUrl = GetString(dict, "webSocketServerUrl"); + + this.ConnectionToken = Uri.EscapeDataString(GetString(dict, "ConnectionToken")); + this.ConnectionId = GetString(dict, "ConnectionId"); + + if (dict.ContainsKey("KeepAliveTimeout")) + this.KeepAliveTimeout = TimeSpan.FromSeconds(GetDouble(dict, "KeepAliveTimeout")); + + this.DisconnectTimeout = TimeSpan.FromSeconds(GetDouble(dict, "DisconnectTimeout")); + + if (dict.ContainsKey("ConnectionTimeout")) + this.ConnectionTimeout = TimeSpan.FromSeconds(GetDouble(dict, "ConnectionTimeout")); + else + this.ConnectionTimeout = TimeSpan.FromSeconds(120); + + this.TryWebSockets = (bool)Get(dict, "TryWebSockets"); + this.ProtocolVersion = GetString(dict, "ProtocolVersion"); + this.TransportConnectTimeout = TimeSpan.FromSeconds(GetDouble(dict, "TransportConnectTimeout")); + + if (dict.ContainsKey("LongPollDelay")) + this.LongPollDelay = TimeSpan.FromSeconds(GetDouble(dict, "LongPollDelay")); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("NegotiationData", "Parse", ex); + return null; + } + + return this; + } + + private static object Get(Dictionary from, string key) + { + object value; + if (!from.TryGetValue(key, out value)) + throw new System.Exception(string.Format("Can't get {0} from Negotiation data!", key)); + return value; + } + + private static string GetString(Dictionary from, string key) + { + return Get(from, key) as string; + } + + private static List GetStringList(Dictionary from, string key) + { + List value = Get(from, key) as List; + + List result = new List(value.Count); + for (int i = 0; i < value.Count; ++i) + { + string str = value[i] as string; + if (str != null) + result.Add(str); + } + + return result; + } + + private static int GetInt(Dictionary from, string key) + { + return (int)(double)Get(from, key); + } + + private static double GetDouble(Dictionary from, string key) + { + return (double)Get(from, key); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/NegotiationData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/NegotiationData.cs.meta new file mode 100644 index 00000000..69855b5a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/NegotiationData.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c20f605e63af7ef4eb7782aa663f0196 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports.meta new file mode 100644 index 00000000..7a14d7a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c390001e221f7e1429a38eb6222413c5 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PollingTransport.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PollingTransport.cs new file mode 100644 index 00000000..a77a0cfe --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PollingTransport.cs @@ -0,0 +1,256 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; + +using BestHTTP.Extensions; +using BestHTTP.SignalR.Messages; + +namespace BestHTTP.SignalR.Transports +{ + public sealed class PollingTransport : PostSendTransportBase, IHeartbeat + { + #region Overridden Properties + + public override bool SupportsKeepAlive { get { return false; } } + public override TransportTypes Type { get { return TransportTypes.LongPoll; } } + + #endregion + + #region Privates + + /// + /// When we received the last poll. + /// + private DateTime LastPoll; + + /// + /// How much time we have to wait before we can send out a new poll request. This value sent by the server. + /// + private TimeSpan PollDelay; + + /// + /// How much time we wait to a poll request to finish. It's value is the server sent negotiation's ConnectionTimeout + 10sec. + /// + private TimeSpan PollTimeout; + + /// + /// Reference to the the current poll request. + /// + private HTTPRequest pollRequest; + + #endregion + + public PollingTransport(Connection connection) + : base("longPolling", connection) + { + this.LastPoll = DateTime.MinValue; + this.PollTimeout = connection.NegotiationResult.ConnectionTimeout + TimeSpan.FromSeconds(10); + } + + #region Overrides from TransportBase + + /// + /// Polling transport specific connection logic. It's a regular GET request to the /connect path. + /// + public override void Connect() + { + HTTPManager.Logger.Information("Transport - " + this.Name, "Sending Open Request"); + + // Skip the Connecting state if we are reconnecting. If the connect succeeds, we will set the Started state directly + if (this.State != TransportStates.Reconnecting) + this.State = TransportStates.Connecting; + + RequestTypes requestType = this.State == TransportStates.Reconnecting ? RequestTypes.Reconnect : RequestTypes.Connect; + + var request = new HTTPRequest(Connection.BuildUri(requestType, this), HTTPMethods.Get, true, true, OnConnectRequestFinished); + + Connection.PrepareRequest(request, requestType); + + request.Send(); + } + + public override void Stop() + { + HTTPManager.Heartbeats.Unsubscribe(this); + + if (pollRequest != null) + { + pollRequest.Abort(); + pollRequest = null; + } + + // Should we abort the send requests in the sendRequestQueue? + } + + protected override void Started() + { + LastPoll = DateTime.UtcNow; + HTTPManager.Heartbeats.Subscribe(this); + } + + protected override void Aborted() + { + HTTPManager.Heartbeats.Unsubscribe(this); + } + + #endregion + + #region Request Handlers + + void OnConnectRequestFinished(HTTPRequest req, HTTPResponse resp) + { + // error reason if there is any. We will call the manager's Error function if it's not empty. + string reason = string.Empty; + + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + HTTPManager.Logger.Information("Transport - " + this.Name, "Connect - Request Finished Successfully! " + resp.DataAsText); + + OnConnected(); + + IServerMessage msg = TransportBase.Parse(Connection.JsonEncoder, resp.DataAsText); + + if (msg != null) + { + Connection.OnMessage(msg); + + MultiMessage multiple = msg as MultiMessage; + if (multiple != null && multiple.PollDelay.HasValue) + PollDelay = multiple.PollDelay.Value; + } + } + else + reason = string.Format("Connect - Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + reason = "Connect - Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + reason = "Connect - Request Aborted!"; + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + reason = "Connect - Connection Timed Out!"; + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + reason = "Connect - Processing the request Timed Out!"; + break; + } + + if (!string.IsNullOrEmpty(reason)) + Connection.Error(reason); + } + + void OnPollRequestFinished(HTTPRequest req, HTTPResponse resp) + { + // When Stop() called on the transport. + // In Stop() we set the pollRequest to null, but a new poll request can be made after a quick reconnection, and there is a chanse that + // in this handler function we can null out the new request. So we return early here. + if (req.State == HTTPRequestStates.Aborted) + { + HTTPManager.Logger.Warning("Transport - " + this.Name, "Poll - Request Aborted!"); + return; + } + + // Set the pollRequest to null, now we can send out a new one + pollRequest = null; + + // error reason if there is any. We will call the manager's Error function if it's not empty. + string reason = string.Empty; + + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + HTTPManager.Logger.Information("Transport - " + this.Name, "Poll - Request Finished Successfully! " + resp.DataAsText); + + IServerMessage msg = TransportBase.Parse(Connection.JsonEncoder, resp.DataAsText); + + if (msg != null) + { + Connection.OnMessage(msg); + + MultiMessage multiple = msg as MultiMessage; + if (multiple != null && multiple.PollDelay.HasValue) + PollDelay = multiple.PollDelay.Value; + + LastPoll = DateTime.UtcNow; + } + } + else + reason = string.Format("Poll - Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + reason = "Poll - Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"); + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + reason = "Poll - Connection Timed Out!"; + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + reason = "Poll - Processing the request Timed Out!"; + break; + } + + if (!string.IsNullOrEmpty(reason)) + Connection.Error(reason); + } + + #endregion + + /// + /// Polling transport speficic function. Sends a GET request to the /poll path to receive messages. + /// + private void Poll() + { + pollRequest = new HTTPRequest(Connection.BuildUri(RequestTypes.Poll, this), HTTPMethods.Get, true, true, OnPollRequestFinished); + + Connection.PrepareRequest(pollRequest, RequestTypes.Poll); + + pollRequest.Timeout = this.PollTimeout; + + pollRequest.Send(); + } + + #region IHeartbeat Implementation + + void IHeartbeat.OnHeartbeatUpdate(TimeSpan dif) + { + switch(State) + { + case TransportStates.Started: + if (pollRequest == null && DateTime.UtcNow >= (LastPoll + PollDelay + Connection.NegotiationResult.LongPollDelay)) + Poll(); + break; + } + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PollingTransport.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PollingTransport.cs.meta new file mode 100644 index 00000000..ec93c4dc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PollingTransport.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 702a1cd6038bbc347a4b568983058f63 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PostSendTransportBase.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PostSendTransportBase.cs new file mode 100644 index 00000000..7ce7c896 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PostSendTransportBase.cs @@ -0,0 +1,103 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System.Collections.Generic; + +using BestHTTP.SignalR.Messages; + +namespace BestHTTP.SignalR.Transports +{ + /// + /// A base class for implementations that must send the data in unique requests. These are currently the LongPolling and ServerSentEvents transports. + /// + public abstract class PostSendTransportBase : TransportBase + { + /// + /// Sent out send requests. Keeping a reference to them for future use. + /// + protected List sendRequestQueue = new List(); + + public PostSendTransportBase(string name, Connection con) + : base(name, con) + { + + } + + #region Send Implementation + + protected override void SendImpl(string json) + { + var request = new HTTPRequest(Connection.BuildUri(RequestTypes.Send, this), HTTPMethods.Post, true, true, OnSendRequestFinished); + + request.FormUsage = Forms.HTTPFormUsage.UrlEncoded; + request.AddField("data", json); + + Connection.PrepareRequest(request, RequestTypes.Send); + + // Set a lower priority then the default. This way requests that are sent out alongside with SignalR sent requests can be processed sooner. + request.Priority = -1; + + request.Send(); + + sendRequestQueue.Add(request); + } + + void OnSendRequestFinished(HTTPRequest req, HTTPResponse resp) + { + sendRequestQueue.Remove(req); + + // error reason if there is any. We will call the manager's Error function if it's not empty. + string reason = string.Empty; + + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + HTTPManager.Logger.Information("Transport - " + this.Name, "Send - Request Finished Successfully! " + resp.DataAsText); + + if (!string.IsNullOrEmpty(resp.DataAsText)) + { + IServerMessage msg = TransportBase.Parse(Connection.JsonEncoder, resp.DataAsText); + + if (msg != null) + Connection.OnMessage(msg); + } + } + else + reason = string.Format("Send - Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + reason = "Send - Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + reason = "Send - Request Aborted!"; + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + reason = "Send - Connection Timed Out!"; + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + reason = "Send - Processing the request Timed Out!"; + break; + } + + if (!string.IsNullOrEmpty(reason)) + Connection.Error(reason); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PostSendTransportBase.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PostSendTransportBase.cs.meta new file mode 100644 index 00000000..0d145323 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/PostSendTransportBase.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f47176f2538ccf54e855235ecb7647f3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/ServerSentEventsTransport.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/ServerSentEventsTransport.cs new file mode 100644 index 00000000..5a36384e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/ServerSentEventsTransport.cs @@ -0,0 +1,171 @@ +#if !BESTHTTP_DISABLE_SIGNALR +#if !BESTHTTP_DISABLE_SERVERSENT_EVENTS + +using System; + +using BestHTTP.ServerSentEvents; +using BestHTTP.SignalR.Messages; + +namespace BestHTTP.SignalR.Transports +{ + /// + /// A SignalR transport implementation that uses the Server-Sent Events protocol. + /// + public sealed class ServerSentEventsTransport : PostSendTransportBase + { + #region Overridden Properties + + /// + /// It's a persistent connection. We support the keep-alive mechanism. + /// + public override bool SupportsKeepAlive { get { return true; } } + + /// + /// Type of the transport. + /// + public override TransportTypes Type { get { return TransportTypes.ServerSentEvents; } } + + #endregion + + #region Privates + + /// + /// The EventSource object. + /// + private EventSource EventSource; + + #endregion + + public ServerSentEventsTransport(Connection con) + : base("serverSentEvents", con) + { + + } + + #region Overrides from TransportBase + + public override void Connect() + { + if (EventSource != null) + { + HTTPManager.Logger.Warning("ServerSentEventsTransport", "Start - EventSource already created!"); + return; + } + + // Skip the Connecting state if we are reconnecting. If the connect succeeds, we will set the Started state directly + if (this.State != TransportStates.Reconnecting) + this.State = TransportStates.Connecting; + + RequestTypes requestType = this.State == TransportStates.Reconnecting ? RequestTypes.Reconnect : RequestTypes.Connect; + + Uri uri = Connection.BuildUri(requestType, this); + + EventSource = new EventSource(uri); + + EventSource.OnOpen += OnEventSourceOpen; + EventSource.OnMessage += OnEventSourceMessage; + EventSource.OnError += OnEventSourceError; + EventSource.OnClosed += OnEventSourceClosed; + +#if !UNITY_WEBGL || UNITY_EDITOR + // Disable internal retry + EventSource.OnRetry += (es) => false; +#endif + + // Start connecting to the server. + EventSource.Open(); + } + + public override void Stop() + { + EventSource.OnOpen -= OnEventSourceOpen; + EventSource.OnMessage -= OnEventSourceMessage; + EventSource.OnError -= OnEventSourceError; + EventSource.OnClosed -= OnEventSourceClosed; + + EventSource.Close(); + + EventSource = null; + } + + protected override void Started() + { + // Nothing to do here for this transport + } + + /// + /// A custom Abort function where we will start to close the EventSource object. + /// + public override void Abort() + { + base.Abort(); + + EventSource.Close(); + } + + protected override void Aborted() + { + if (this.State == TransportStates.Closing) + this.State = TransportStates.Closed; + } + + #endregion + + #region EventSource Event Handlers + + private void OnEventSourceOpen(EventSource eventSource) + { + HTTPManager.Logger.Information("Transport - " + this.Name, "OnEventSourceOpen"); + } + + private void OnEventSourceMessage(EventSource eventSource, BestHTTP.ServerSentEvents.Message message) + { + if (message.Data.Equals("initialized")) + { + base.OnConnected(); + + return; + } + + IServerMessage msg = TransportBase.Parse(Connection.JsonEncoder, message.Data); + + if (msg != null) + Connection.OnMessage(msg); + + } + + private void OnEventSourceError(EventSource eventSource, string error) + { + HTTPManager.Logger.Information("Transport - " + this.Name, "OnEventSourceError"); + + // We are in a reconnecting phase, we have to connect now. + if (this.State == TransportStates.Reconnecting) + { + Connect(); + return; + } + + // Already closed? + if (this.State == TransportStates.Closed) + return; + + // Closing? Then we are closed now. + if (this.State == TransportStates.Closing) + this.State = TransportStates.Closed; + else // Errored when we didn't expected it. + Connection.Error(error); + } + + private void OnEventSourceClosed(ServerSentEvents.EventSource eventSource) + { + HTTPManager.Logger.Information("Transport - " + this.Name, "OnEventSourceClosed"); + + OnEventSourceError(eventSource, "EventSource Closed!"); + } + + #endregion + } +} + +#endif +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/ServerSentEventsTransport.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/ServerSentEventsTransport.cs.meta new file mode 100644 index 00000000..218dab36 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/ServerSentEventsTransport.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b8c1fc0aacfa94c4793a2e8958a34058 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/TransportBase.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/TransportBase.cs new file mode 100644 index 00000000..e2e92b16 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/TransportBase.cs @@ -0,0 +1,386 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; +using System.Collections.Generic; + +using BestHTTP.SignalR.Messages; +using BestHTTP.SignalR.JsonEncoders; + +namespace BestHTTP.SignalR.Transports +{ + public delegate void OnTransportStateChangedDelegate(TransportBase transport, TransportStates oldState, TransportStates newState); + + public abstract class TransportBase + { + private const int MaxRetryCount = 5; + + #region Public Properties + + /// + /// Name of the transport. + /// + public string Name { get; protected set; } + + /// + /// True if the manager has to check the last message received time and reconnect if too much time passes. + /// + public abstract bool SupportsKeepAlive { get; } + + /// + /// Type of the transport. Used mainly by the manager in its BuildUri function. + /// + public abstract TransportTypes Type { get; } + + /// + /// Reference to the manager. + /// + public IConnection Connection { get; protected set; } + + /// + /// The current state of the transport. + /// + public TransportStates State + { + get { return _state; } + protected set + { + TransportStates old = _state; + _state = value; + + if (OnStateChanged != null) + OnStateChanged(this, old, _state); + } + } + public TransportStates _state; + + /// + /// Thi event called when the transport's State set to a new value. + /// + public event OnTransportStateChangedDelegate OnStateChanged; + + #endregion + + public TransportBase(string name, Connection connection) + { + this.Name = name; + this.Connection = connection; + this.State = TransportStates.Initial; + } + + #region Abstract functions + + /// + /// Start to connect to the server + /// + public abstract void Connect(); + + /// + /// Stop the connection + /// + public abstract void Stop(); + + /// + /// The transport specific implementation to send the given json string to the server. + /// + protected abstract void SendImpl(string json); + + /// + /// Called when the Start request finished successfully, or after a reconnect. + /// Manager.TransportOpened(); called from the TransportBase after this call + /// + protected abstract void Started(); + + /// + /// Called when the abort request finished successfully. + /// + protected abstract void Aborted(); + + #endregion + + /// + /// Called after a succesful connect/reconnect. The transport implementations have to call this function. + /// + protected void OnConnected() + { + if (this.State != TransportStates.Reconnecting) + { + // Send the Start request + Start(); + } + else + { + Connection.TransportReconnected(); + + Started(); + + this.State = TransportStates.Started; + } + } + + #region Start Request Sending + + /// + /// Sends out the /start request to the server. + /// + protected void Start() + { + HTTPManager.Logger.Information("Transport - " + this.Name, "Sending Start Request"); + + this.State = TransportStates.Starting; + + if (this.Connection.Protocol > ProtocolVersions.Protocol_2_0) + { + var request = new HTTPRequest(Connection.BuildUri(RequestTypes.Start, this), HTTPMethods.Get, true, true, OnStartRequestFinished); + + request.Tag = 0; + request.DisableRetry = true; + + request.Timeout = Connection.NegotiationResult.ConnectionTimeout + TimeSpan.FromSeconds(10); + + Connection.PrepareRequest(request, RequestTypes.Start); + + request.Send(); + } + else + { + // The transport and the signalr protocol now started + this.State = TransportStates.Started; + + Started(); + + Connection.TransportStarted(); + } + } + + private void OnStartRequestFinished(HTTPRequest req, HTTPResponse resp) + { + switch (req.State) + { + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + HTTPManager.Logger.Information("Transport - " + this.Name, "Start - Returned: " + resp.DataAsText); + + string response = Connection.ParseResponse(resp.DataAsText); + + if (response != "started") + { + Connection.Error(string.Format("Expected 'started' response, but '{0}' found!", response)); + return; + } + + // The transport and the signalr protocol now started + this.State = TransportStates.Started; + + Started(); + + Connection.TransportStarted(); + + return; + } + else + HTTPManager.Logger.Warning("Transport - " + this.Name, string.Format("Start - request finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2} Uri: {3}", + resp.StatusCode, + resp.Message, + resp.DataAsText, + req.CurrentUri)); + goto default; + + default: + HTTPManager.Logger.Information("Transport - " + this.Name, "Start request state: " + req.State.ToString()); + + // The request may not reached the server. Try it again. + int retryCount = (int)req.Tag; + if (retryCount++ < MaxRetryCount) + { + req.Tag = retryCount; + req.Send(); + } + else + Connection.Error("Failed to send Start request."); + + break; + } + } + + #endregion + + #region Abort Implementation + + /// + /// Will abort the transport. In SignalR 'Abort'ing is a graceful process, while 'Close'ing is a hard-abortion... + /// + public virtual void Abort() + { + if (this.State != TransportStates.Started) + return; + + this.State = TransportStates.Closing; + + var request = new HTTPRequest(Connection.BuildUri(RequestTypes.Abort, this), HTTPMethods.Get, true, true, OnAbortRequestFinished); + + // Retry counter + request.Tag = 0; + request.DisableRetry = true; + + Connection.PrepareRequest(request, RequestTypes.Abort); + + request.Send(); + } + + protected void AbortFinished() + { + this.State = TransportStates.Closed; + + Connection.TransportAborted(); + + this.Aborted(); + } + + private void OnAbortRequestFinished(HTTPRequest req, HTTPResponse resp) + { + switch (req.State) + { + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + HTTPManager.Logger.Information("Transport - " + this.Name, "Abort - Returned: " + resp.DataAsText); + + if (this.State == TransportStates.Closing) + AbortFinished(); + } + else + { + HTTPManager.Logger.Warning("Transport - " + this.Name, string.Format("Abort - Handshake request finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2} Uri: {3}", + resp.StatusCode, + resp.Message, + resp.DataAsText, + req.CurrentUri)); + + // try again + goto default; + } + break; + default: + HTTPManager.Logger.Information("Transport - " + this.Name, "Abort request state: " + req.State.ToString()); + + // The request may not reached the server. Try it again. + int retryCount = (int)req.Tag; + if (retryCount++ < MaxRetryCount) + { + req.Tag = retryCount; + req.Send(); + } + else + Connection.Error("Failed to send Abort request!"); + + break; + } + } + + #endregion + + #region Send Implementation + + /// + /// Sends the given json string to the wire. + /// + /// + public void Send(string jsonStr) + { + try + { + HTTPManager.Logger.Information("Transport - " + this.Name, "Sending: " + jsonStr); + + SendImpl(jsonStr); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("Transport - " + this.Name, "Send", ex); + } + } + + #endregion + + #region Helper Functions + + /// + /// Start the reconnect process + /// + public void Reconnect() + { + HTTPManager.Logger.Information("Transport - " + this.Name, "Reconnecting"); + + Stop(); + + this.State = TransportStates.Reconnecting; + + Connect(); + } + + /// + /// When the json string is successfully parsed will return with an IServerMessage implementation. + /// + public static IServerMessage Parse(IJsonEncoder encoder, string json) + { + // Nothing to parse? + if (string.IsNullOrEmpty(json)) + { + HTTPManager.Logger.Error("MessageFactory", "Parse - called with empty or null string!"); + return null; + } + + // We don't have to do further decoding, if it's an empty json object, then it's a KeepAlive message from the server + if (json.Length == 2 && json == "{}") + return new KeepAliveMessage(); + + IDictionary msg = null; + + try + { + // try to decode the json message with the encoder + msg = encoder.DecodeMessage(json); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("MessageFactory", "Parse - encoder.DecodeMessage", ex); + return null; + } + + if (msg == null) + { + HTTPManager.Logger.Error("MessageFactory", "Parse - Json Decode failed for json string: \"" + json + "\""); + return null; + } + + // "C" is for message id + IServerMessage result = null; + if (!msg.ContainsKey("C")) + { + // If there are no ErrorMessage in the object, then it was a success + if (!msg.ContainsKey("E")) + result = new ResultMessage(); + else + result = new FailureMessage(); + } + else + result = new MultiMessage(); + + try + { + result.Parse(msg); + } + catch + { + HTTPManager.Logger.Error("MessageFactory", "Can't parse msg: " + json); + throw; + } + + return result; + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/TransportBase.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/TransportBase.cs.meta new file mode 100644 index 00000000..88831c2b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/TransportBase.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 469a77c43ea68f14da659401301834f5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/WebSocketTransport.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/WebSocketTransport.cs new file mode 100644 index 00000000..cbdee970 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/WebSocketTransport.cs @@ -0,0 +1,173 @@ +#if !BESTHTTP_DISABLE_SIGNALR +#if !BESTHTTP_DISABLE_WEBSOCKET + +using System; +using System.Text; + +using BestHTTP; +using BestHTTP.JSON; +using BestHTTP.SignalR.Hubs; +using BestHTTP.SignalR.Messages; +using BestHTTP.SignalR.JsonEncoders; + +namespace BestHTTP.SignalR.Transports +{ + public sealed class WebSocketTransport : TransportBase + { + #region Overridden Properties + + public override bool SupportsKeepAlive { get { return true; } } + public override TransportTypes Type { get { return TransportTypes.WebSocket; } } + + #endregion + + private WebSocket.WebSocket wSocket; + + public WebSocketTransport(Connection connection) + : base("webSockets", connection) + { + } + + #region Overrides from TransportBase + + /// + /// Websocket transport specific connection logic. It will create a WebSocket instance, and starts to connect to the server. + /// + public override void Connect() + { + if (wSocket != null) + { + HTTPManager.Logger.Warning("WebSocketTransport", "Start - WebSocket already created!"); + return; + } + + // Skip the Connecting state if we are reconnecting. If the connect succeeds, we will set the Started state directly + if (this.State != TransportStates.Reconnecting) + this.State = TransportStates.Connecting; + + RequestTypes requestType = this.State == TransportStates.Reconnecting ? RequestTypes.Reconnect : RequestTypes.Connect; + + Uri uri = Connection.BuildUri(requestType, this); + + // Create the WebSocket instance + wSocket = new WebSocket.WebSocket(uri); + + // Set up eventhandlers + wSocket.OnOpen += WSocket_OnOpen; + wSocket.OnMessage += WSocket_OnMessage; + wSocket.OnClosed += WSocket_OnClosed; + wSocket.OnErrorDesc += WSocket_OnError; + +#if !UNITY_WEBGL || UNITY_EDITOR + // prepare the internal http request + Connection.PrepareRequest(wSocket.InternalRequest, requestType); +#endif + + // start opening the websocket protocol + wSocket.Open(); + } + + protected override void SendImpl(string json) + { + if (wSocket != null && wSocket.IsOpen) + wSocket.Send(json); + } + + public override void Stop() + { + if (wSocket != null) + { + wSocket.OnOpen = null; + wSocket.OnMessage = null; + wSocket.OnClosed = null; + wSocket.OnErrorDesc = null; + wSocket.Close(); + wSocket = null; + } + } + + protected override void Started() + { + // Nothing to be done here for this transport + } + + /// + /// The /abort request successfully finished + /// + protected override void Aborted() + { + // if the websocket is still open, close it + if (wSocket != null && wSocket.IsOpen) + { + wSocket.Close(); + wSocket = null; + } + } + +#endregion + +#region WebSocket Events + + void WSocket_OnOpen(WebSocket.WebSocket webSocket) + { + if (webSocket != wSocket) + return; + + HTTPManager.Logger.Information("WebSocketTransport", "WSocket_OnOpen"); + + OnConnected(); + } + + void WSocket_OnMessage(WebSocket.WebSocket webSocket, string message) + { + if (webSocket != wSocket) + return; + + IServerMessage msg = TransportBase.Parse(Connection.JsonEncoder, message); + + if (msg != null) + Connection.OnMessage(msg); + } + + void WSocket_OnClosed(WebSocket.WebSocket webSocket, ushort code, string message) + { + if (webSocket != wSocket) + return; + + string reason = code.ToString() + " : " + message; + + HTTPManager.Logger.Information("WebSocketTransport", "WSocket_OnClosed " + reason); + + if (this.State == TransportStates.Closing) + this.State = TransportStates.Closed; + else + Connection.Error(reason); + } + + void WSocket_OnError(WebSocket.WebSocket webSocket, string reason) + { + if (webSocket != wSocket) + return; + + // On WP8.1, somehow we receive an exception that the remote server forcibly closed the connection instead of the + // WebSocket closed packet... Also, even the /abort request didn't finished. + if (this.State == TransportStates.Closing || + this.State == TransportStates.Closed) + { + base.AbortFinished(); + } + else + { + HTTPManager.Logger.Error("WebSocketTransport", "WSocket_OnError " + reason); + + this.State = TransportStates.Closed; + Connection.Error(reason); + } + } + +#endregion + } +} + +#endif +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/WebSocketTransport.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/WebSocketTransport.cs.meta new file mode 100644 index 00000000..e969abb9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalR/Transports/WebSocketTransport.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5efa5f8b9a034084b87f47b2b74b8173 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore.meta new file mode 100644 index 00000000..81f6b4f1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: fe53b9220e298d844bd0d53106307094 +folderAsset: yes +timeCreated: 1515237542 +licenseType: Store +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication.meta new file mode 100644 index 00000000..347a9ccb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a3fe10bda4c195348b779c549e20e0d4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication/DefaultAccessTokenAuthenticator.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication/DefaultAccessTokenAuthenticator.cs new file mode 100644 index 00000000..ab5f1b76 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication/DefaultAccessTokenAuthenticator.cs @@ -0,0 +1,59 @@ +using System; + +namespace BestHTTP.SignalRCore.Authentication +{ + public sealed class DefaultAccessTokenAuthenticator : IAuthenticationProvider + { + /// + /// No pre-auth step required for this type of authentication + /// + public bool IsPreAuthRequired { get { return false; } } + +#pragma warning disable 0067 + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationSuccededDelegate OnAuthenticationSucceded; + + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationFailedDelegate OnAuthenticationFailed; + +#pragma warning restore 0067 + + private HubConnection _connection; + + public DefaultAccessTokenAuthenticator(HubConnection connection) + { + this._connection = connection; + } + + /// + /// Not used as IsPreAuthRequired is false + /// + public void StartAuthentication() + { } + + /// + /// Prepares the request by adding two headers to it + /// + public void PrepareRequest(BestHTTP.HTTPRequest request) + { + if (HTTPProtocolFactory.GetProtocolFromUri(request.CurrentUri) == SupportedProtocols.HTTP) + request.Uri = PrepareUri(request.Uri); + } + + public Uri PrepareUri(Uri uri) + { + if (this._connection.NegotiationResult != null && !string.IsNullOrEmpty(this._connection.NegotiationResult.AccessToken)) + { + string query = string.IsNullOrEmpty(uri.Query) ? "?" : uri.Query + "&"; + UriBuilder uriBuilder = new UriBuilder(uri.Scheme, uri.Host, uri.Port, uri.AbsolutePath, query + "access_token=" + this._connection.NegotiationResult.AccessToken); + return uriBuilder.Uri; + } + else + return uri; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication/DefaultAccessTokenAuthenticator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication/DefaultAccessTokenAuthenticator.cs.meta new file mode 100644 index 00000000..c404a37c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Authentication/DefaultAccessTokenAuthenticator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd70ac39ecb098a49b5a09eef4e516f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HelperClasses.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HelperClasses.cs new file mode 100644 index 00000000..364fdadc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HelperClasses.cs @@ -0,0 +1,148 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE && !BESTHTTP_DISABLE_WEBSOCKET +using System; +using System.Collections.Generic; + +namespace BestHTTP.SignalRCore +{ + public enum TransportTypes + { + WebSocket + } + + public enum TransferModes + { + Binary, + Text + } + + public enum TransportStates + { + Initial, + Connecting, + Connected, + Closing, + Failed, + Closed + } + + /// + /// Possible states of a HubConnection + /// + public enum ConnectionStates + { + Initial, + Authenticating, + Negotiating, + Redirected, + Connected, + CloseInitiated, + Closed + } + + public interface ITransport + { + TransferModes TransferMode { get; } + TransportTypes TransportType { get; } + TransportStates State { get; } + + string ErrorReason { get; } + + event Action OnStateChanged; + + void StartConnect(); + void StartClose(); + + void Send(byte[] msg); + } + + public interface IEncoder + { + string Name { get; } + + string EncodeAsText(T value); + T DecodeAs(string text); + + byte[] EncodeAsBinary(T value); + T DecodeAs(byte[] data); + + object ConvertTo(Type toType, object obj); + } + + public class StreamItemContainer + { + public readonly long id; + + public List Items { get; private set; } + public T LastAdded { get; private set; } + + //public int newIdx; + //public int newCount; + + public bool IsCanceled; + + public StreamItemContainer(long _id) + { + this.id = _id; + this.Items = new List(); + } + + public void AddItem(T item) + { + if (this.Items == null) + this.Items = new List(); + + //this.newIdx = this.Items.Count; + //this.newCount = 1; + this.Items.Add(item); + this.LastAdded = item; + } + + //public void AddItems(T[] items) + //{ + // if (this.Items == null) + // this.Items = new List(); + // + // this.newIdx = this.Items.Count; + // this.newCount = items.Length; + // + // this.Items.AddRange(items); + //} + } + + struct CallbackDescriptor + { + public readonly Type[] ParamTypes; + public readonly Action Callback; + public CallbackDescriptor(Type[] paramTypes, Action callback) + { + this.ParamTypes = paramTypes; + this.Callback = callback; + } + } + + internal sealed class Subscription + { + public List callbacks = new List(1); + + public void Add(Type[] paramTypes, Action callback) + { + lock(callbacks) + this.callbacks.Add(new CallbackDescriptor(paramTypes, callback)); + } + + public void Remove(Action callback) + { + lock (callbacks) + { + int idx = -1; + for (int i = 0; i < this.callbacks.Count && idx == -1; ++i) + if (this.callbacks[i].Callback == callback) + idx = i; + + if (idx != -1) + this.callbacks.RemoveAt(idx); + } + } + } +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HelperClasses.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HelperClasses.cs.meta new file mode 100644 index 00000000..5180aee9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HelperClasses.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 6742bc413b5a23041b937fb3ee3b12d8 +timeCreated: 1515237548 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HubConnection.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HubConnection.cs new file mode 100644 index 00000000..8f662c01 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HubConnection.cs @@ -0,0 +1,741 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE && !BESTHTTP_DISABLE_WEBSOCKET +using BestHTTP.Futures; +using BestHTTP.SignalRCore.Authentication; +using BestHTTP.SignalRCore.Messages; +using System; +using System.Collections.Generic; + +namespace BestHTTP.SignalRCore +{ + public sealed class HubOptions + { + /// + /// When this is set to true, the plugin will skip the negotiation request if the PreferedTransport is WebSocket. Its default value is false. + /// + public bool SkipNegotiation { get; set; } + + /// + /// The preferred transport to choose when more than one available. Its default value is TransportTypes.WebSocket. + /// + public TransportTypes PreferedTransport { get; set; } + + /// + /// A ping message is only sent if the interval has elapsed without a message being sent. Its default value is 15 seconds. + /// + public TimeSpan PingInterval { get; set; } + + /// + /// The maximum count of redirect negoitiation result that the plugin will follow. Its default value is 100. + /// + public int MaxRedirects { get; set; } + + public HubOptions() + { + this.SkipNegotiation = false; + this.PreferedTransport = TransportTypes.WebSocket; + this.PingInterval = TimeSpan.FromSeconds(15); + this.MaxRedirects = 100; + } + } + + public sealed class HubConnection : BestHTTP.Extensions.IHeartbeat + { + public static readonly object[] EmptyArgs = new object[0]; + + /// + /// Uri of the Hub endpoint + /// + public Uri Uri { get; private set; } + + /// + /// Current state of this connection. + /// + public ConnectionStates State { get; private set; } + + /// + /// Current, active ITransport instance. + /// + public ITransport Transport { get; private set; } + + /// + /// The IProtocol implementation that will parse, encode and decode messages. + /// + public IProtocol Protocol { get; private set; } + + /// + /// This event is called when the connection is redirected to a new uri. + /// + public event Action OnRedirected; + + /// + /// This event is called when successfully connected to the hub. + /// + public event Action OnConnected; + + /// + /// This event is called when an unexpected error happen and the connection is closed. + /// + public event Action OnError; + + /// + /// This event is called when the connection is gracefully terminated. + /// + public event Action OnClosed; + + /// + /// This event is called for every server-sent message. When returns false, no further processing of the message is done + /// by the plugin. + /// + public event Func OnMessage; + + /// + /// An IAuthenticationProvider implementation that will be used to authenticate the connection. + /// + public IAuthenticationProvider AuthenticationProvider { get; set; } + + /// + /// Negotiation response sent by the server. + /// + public NegotiationResult NegotiationResult { get; private set; } + + /// + /// + /// + public HubOptions Options { get; private set; } + + /// + /// How many times this connection is redirected. + /// + public int RedirectCount { get; private set; } + + /// + /// This will be increment to add a unique id to every message the plugin will send. + /// + private long lastInvocationId = 0; + + /// + /// Store the callback for all sent message that expect a return value from the server. All sent message has + /// a unique invocationId that will be sent back from the server. + /// + private Dictionary> invocations = new Dictionary>(); + + /// + /// This is where we store the methodname => callback mapping. + /// + private Dictionary subscriptions = new Dictionary(StringComparer.OrdinalIgnoreCase); + + /// + /// When we sent out the last message to the server. + /// + private DateTime lastMessageSent; + + public HubConnection(Uri hubUri, IProtocol protocol) + : this(hubUri, protocol, new HubOptions()) + { + } + + public HubConnection(Uri hubUri, IProtocol protocol, HubOptions options) + { + this.Uri = hubUri; + this.State = ConnectionStates.Initial; + this.Options = options; + this.Protocol = protocol; + this.Protocol.Connection = this; + this.AuthenticationProvider = new DefaultAccessTokenAuthenticator(this); + } + + public void StartConnect() + { + if (this.State != ConnectionStates.Initial && this.State != ConnectionStates.Redirected) + { + HTTPManager.Logger.Warning("HubConnection", "StartConnect - Expected Initial or Redirected state, got " + this.State.ToString()); + return; + } + + HTTPManager.Logger.Verbose("HubConnection", "StartConnect"); + + if (this.AuthenticationProvider != null && this.AuthenticationProvider.IsPreAuthRequired) + { + HTTPManager.Logger.Information("HubConnection", "StartConnect - Authenticating"); + SetState(ConnectionStates.Authenticating); + + this.AuthenticationProvider.OnAuthenticationSucceded += OnAuthenticationSucceded; + this.AuthenticationProvider.OnAuthenticationFailed += OnAuthenticationFailed; + + // Start the authentication process + this.AuthenticationProvider.StartAuthentication(); + } + else + StartNegotiation(); + } + + private void OnAuthenticationSucceded(IAuthenticationProvider provider) + { + HTTPManager.Logger.Verbose("HubConnection", "OnAuthenticationSucceded"); + + this.AuthenticationProvider.OnAuthenticationSucceded -= OnAuthenticationSucceded; + this.AuthenticationProvider.OnAuthenticationFailed -= OnAuthenticationFailed; + + StartNegotiation(); + } + + private void OnAuthenticationFailed(IAuthenticationProvider provider, string reason) + { + HTTPManager.Logger.Error("HubConnection", "OnAuthenticationFailed: " + reason); + + this.AuthenticationProvider.OnAuthenticationSucceded -= OnAuthenticationSucceded; + this.AuthenticationProvider.OnAuthenticationFailed -= OnAuthenticationFailed; + + SetState(ConnectionStates.Closed, reason); + } + + private void StartNegotiation() + { + HTTPManager.Logger.Verbose("HubConnection", "StartNegotiation"); + + if (this.State == ConnectionStates.CloseInitiated) + { + SetState(ConnectionStates.Closed); + return; + } + + if (this.Options.SkipNegotiation) + { + HTTPManager.Logger.Verbose("HubConnection", "Skipping negotiation"); + ConnectImpl(); + + return; + } + + SetState(ConnectionStates.Negotiating); + + // https://github.com/aspnet/SignalR/blob/dev/specs/TransportProtocols.md#post-endpoint-basenegotiate-request + // Send out a negotiation request. While we could skip it and connect right with the websocket transport + // it might return with additional information that could be useful. + + UriBuilder builder = new UriBuilder(this.Uri); + builder.Path += "/negotiate"; + + var request = new HTTPRequest(builder.Uri, HTTPMethods.Post, OnNegotiationRequestFinished); + if (this.AuthenticationProvider != null) + this.AuthenticationProvider.PrepareRequest(request); + + request.Send(); + } + + private void ConnectImpl() + { + HTTPManager.Logger.Verbose("HubConnection", "ConnectImpl"); + + switch (this.Options.PreferedTransport) + { + case TransportTypes.WebSocket: + if (this.NegotiationResult != null && !IsTransportSupported("WebSockets")) + { + SetState(ConnectionStates.Closed, "The 'WebSockets' transport isn't supported by the server!"); + return; + } + + this.Transport = new Transports.WebSocketTransport(this); + this.Transport.OnStateChanged += Transport_OnStateChanged; + break; + + default: + SetState(ConnectionStates.Closed, "Unsupportted transport: " + this.Options.PreferedTransport); + break; + } + + this.Transport.StartConnect(); + } + + private bool IsTransportSupported(string transportName) + { + // https://github.com/aspnet/SignalR/blob/release/2.2/specs/TransportProtocols.md#post-endpoint-basenegotiate-request + // If the negotiation response contains only the url and accessToken, no 'availableTransports' list is sent + if (this.NegotiationResult.SupportedTransports == null) + return true; + + for (int i = 0; i < this.NegotiationResult.SupportedTransports.Count; ++i) + if (this.NegotiationResult.SupportedTransports[i].Name == transportName) + return true; + + return false; + } + + private void OnNegotiationRequestFinished(HTTPRequest req, HTTPResponse resp) + { + if (this.State == ConnectionStates.CloseInitiated) + { + SetState(ConnectionStates.Closed); + return; + } + + string errorReason = null; + + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + HTTPManager.Logger.Information("HubConnection", "Negotiation Request Finished Successfully! Response: " + resp.DataAsText); + + // Parse negotiation + this.NegotiationResult = NegotiationResult.Parse(resp.DataAsText, out errorReason, this); + + // TODO: check validity of the negotiation result: + // If url and accessToken is present, the other two must be null. + // https://github.com/aspnet/SignalR/blob/dev/specs/TransportProtocols.md#post-endpoint-basenegotiate-request + + if (string.IsNullOrEmpty(errorReason)) + { + if (this.NegotiationResult.Url != null) + { + this.SetState(ConnectionStates.Redirected); + + if (++this.RedirectCount >= this.Options.MaxRedirects) + errorReason = string.Format("MaxRedirects ({0:N0}) reached!", this.Options.MaxRedirects); + else + { + var oldUri = this.Uri; + this.Uri = this.NegotiationResult.Url; + + if (this.OnRedirected != null) + { + try + { + this.OnRedirected(this, oldUri, Uri); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("HubConnection", "OnNegotiationRequestFinished - OnRedirected", ex); + } + } + + StartConnect(); + } + } + else + ConnectImpl(); + } + } + else // Internal server error? + errorReason = string.Format("Negotiation Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + errorReason = "Negotiation Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + errorReason = "Negotiation Request Aborted!"; + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + errorReason = "Negotiation Request - Connection Timed Out!"; + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + errorReason = "Negotiation Request - Processing the request Timed Out!"; + break; + } + + if (errorReason != null) + SetState(ConnectionStates.Closed, errorReason); + } + + public void StartClose() + { + HTTPManager.Logger.Verbose("HubConnection", "StartClose"); + + SetState(ConnectionStates.CloseInitiated); + + if (this.Transport != null) + this.Transport.StartClose(); + } + + public IFuture> Stream(string target, params object[] args) + { + var future = new Future>(); + + long id = InvokeImp(target, + args, + callback: (message) => + { + switch (message.type) + { + // StreamItem message contains only one item. + case MessageTypes.StreamItem: + { + var container = future.value; + + if (container.IsCanceled) + break; + + container.AddItem((TResult)this.Protocol.ConvertTo(typeof(TResult), message.item)); + + // (re)assign the container to raise OnItem event + future.AssignItem(container); + break; + } + + case MessageTypes.Completion: + { + bool isSuccess = string.IsNullOrEmpty(message.error); + if (isSuccess) + { + var container = future.value; + + // While completion message must not contain any result, this should be future-proof + //if (!container.IsCanceled && message.Result != null) + //{ + // TResult[] results = (TResult[])this.Protocol.ConvertTo(typeof(TResult[]), message.Result); + // + // container.AddItems(results); + //} + + future.Assign(container); + } + else + future.Fail(new Exception(message.error)); + break; + } + } + }, + isStreamingInvocation: true); + + future.BeginProcess(new StreamItemContainer(id)); + + return future; + } + + public void CancelStream(StreamItemContainer container) + { + Message message = new Message { + type = MessageTypes.CancelInvocation, + invocationId = container.id.ToString() + }; + + container.IsCanceled = true; + + SendMessage(message); + } + + public IFuture Invoke(string target, params object[] args) + { + Future future = new Future(); + + InvokeImp(target, + args, + (message) => + { + bool isSuccess = string.IsNullOrEmpty(message.error); + if (isSuccess) + future.Assign((TResult)this.Protocol.ConvertTo(typeof(TResult), message.result)); + else + future.Fail(new Exception(message.error)); + }); + + return future; + } + + public IFuture Send(string target, params object[] args) + { + Future future = new Future(); + + InvokeImp(target, + args, + (message) => + { + bool isSuccess = string.IsNullOrEmpty(message.error); + if (isSuccess) + future.Assign(true); + else + future.Fail(new Exception(message.error)); + }); + + return future; + } + + private long InvokeImp(string target, object[] args, Action callback, bool isStreamingInvocation = false) + { + if (this.State != ConnectionStates.Connected) + return -1; + + long invocationId = System.Threading.Interlocked.Increment(ref this.lastInvocationId); + var message = new Message + { + type = isStreamingInvocation ? MessageTypes.StreamInvocation : MessageTypes.Invocation, + invocationId = invocationId.ToString(), + target = target, + arguments = args, + nonblocking = callback == null, + }; + + SendMessage(message); + + if (callback != null) + this.invocations.Add(invocationId, callback); + + return invocationId; + } + + private void SendMessage(Message message) + { + byte[] encoded = this.Protocol.EncodeMessage(message); + this.Transport.Send(encoded); + + this.lastMessageSent = DateTime.UtcNow; + } + + public void On(string methodName, Action callback) + { + On(methodName, null, (args) => callback()); + } + + public void On(string methodName, Action callback) + { + On(methodName, new Type[] { typeof(T1) }, (args) => callback((T1)args[0])); + } + + public void On(string methodName, Action callback) + { + On(methodName, + new Type[] { typeof(T1), typeof(T2) }, + (args) => callback((T1)args[0], (T2)args[1])); + } + + public void On(string methodName, Action callback) + { + On(methodName, + new Type[] { typeof(T1), typeof(T2), typeof(T3) }, + (args) => callback((T1)args[0], (T2)args[1], (T3)args[2])); + } + + public void On(string methodName, Action callback) + { + On(methodName, + new Type[] { typeof(T1), typeof(T2), typeof(T3), typeof(T4) }, + (args) => callback((T1)args[0], (T2)args[1], (T3)args[2], (T4)args[3])); + } + + public void On(string methodName, Type[] paramTypes, Action callback) + { + Subscription subscription = null; + if (!this.subscriptions.TryGetValue(methodName, out subscription)) + this.subscriptions.Add(methodName, subscription = new Subscription()); + + subscription.Add(paramTypes, callback); + } + + internal void OnMessages(List messages) + { + for (int messageIdx = 0; messageIdx < messages.Count; ++messageIdx) + { + var message = messages[messageIdx]; + + try + { + if (this.OnMessage != null && !this.OnMessage(this, message)) + return; + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("HubConnection", "Exception in OnMessage user code!", ex); + } + + switch (message.type) + { + case MessageTypes.Invocation: + { + Subscription subscribtion = null; + if (this.subscriptions.TryGetValue(message.target, out subscribtion)) + { + for (int i = 0; i < subscribtion.callbacks.Count; ++i) + { + var callbackDesc = subscribtion.callbacks[i]; + + object[] realArgs = null; + try + { + realArgs = this.Protocol.GetRealArguments(callbackDesc.ParamTypes, message.arguments); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("HubConnection", "OnMessages - Invocation - GetRealArguments", ex); + } + + try + { + callbackDesc.Callback.Invoke(realArgs); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("HubConnection", "OnMessages - Invocation - Invoke", ex); + } + } + } + + break; + } + + case MessageTypes.StreamItem: + { + long invocationId; + if (long.TryParse(message.invocationId, out invocationId)) + { + Action callback; + if (this.invocations.TryGetValue(invocationId, out callback) && callback != null) + { + try + { + callback(message); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("HubConnection", "OnMessages - StreamItem - callback", ex); + } + } + } + break; + } + + case MessageTypes.Completion: + { + long invocationId; + if (long.TryParse(message.invocationId, out invocationId)) + { + Action callback; + if (this.invocations.TryGetValue(invocationId, out callback) && callback != null) + { + try + { + callback(message); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("HubConnection", "OnMessages - Completion - callback", ex); + } + } + this.invocations.Remove(invocationId); + } + break; + } + + case MessageTypes.Close: + SetState(ConnectionStates.Closed, message.error); + break; + } + } + } + + private void Transport_OnStateChanged(TransportStates oldState, TransportStates newState) + { + HTTPManager.Logger.Verbose("HubConnection", string.Format("Transport_OnStateChanged - oldState: {0} newState: {1}", oldState.ToString(), newState.ToString())); + + switch (newState) + { + case TransportStates.Connected: + SetState(ConnectionStates.Connected); + break; + + case TransportStates.Failed: + SetState(ConnectionStates.Closed, this.Transport.ErrorReason); + break; + + case TransportStates.Closed: + SetState(ConnectionStates.Closed); + break; + } + } + + private void SetState(ConnectionStates state, string errorReason = null) + { + if (string.IsNullOrEmpty(errorReason)) + HTTPManager.Logger.Information("HubConnection", "SetState - from State: '" + this.State.ToString() + "' to State: '" + state.ToString() + "'"); + else + HTTPManager.Logger.Information("HubConnection", "SetState - from State: '" + this.State.ToString() + "' to State: '" + state.ToString() + "' errorReason: '" + errorReason + "'"); + + if (this.State == state) + return; + + this.State = state; + + switch (state) + { + case ConnectionStates.Initial: + case ConnectionStates.Authenticating: + case ConnectionStates.Negotiating: + case ConnectionStates.CloseInitiated: + break; + + case ConnectionStates.Connected: + try + { + if (this.OnConnected != null) + this.OnConnected(this); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("HubConnection", "Exception in OnConnected user code!", ex); + } + + HTTPManager.Heartbeats.Subscribe(this); + this.lastMessageSent = DateTime.UtcNow; + break; + + case ConnectionStates.Closed: + if (string.IsNullOrEmpty(errorReason)) + { + if (this.OnClosed != null) + { + try + { + this.OnClosed(this); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("HubConnection", "Exception in OnClosed user code!", ex); + } + } + } + else + { + if (this.OnError != null) + { + try + { + this.OnError(this, errorReason); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("HubConnection", "Exception in OnError user code!", ex); + } + } + } + HTTPManager.Heartbeats.Unsubscribe(this); + break; + } + } + + void BestHTTP.Extensions.IHeartbeat.OnHeartbeatUpdate(TimeSpan dif) + { + switch (this.State) + { + case ConnectionStates.Connected: + if (this.Options.PingInterval != TimeSpan.Zero && DateTime.UtcNow - this.lastMessageSent >= this.Options.PingInterval) + SendMessage(new Message() { type = MessageTypes.Ping }); + break; + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HubConnection.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HubConnection.cs.meta new file mode 100644 index 00000000..af016096 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/HubConnection.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e8abbf851f5c2224380d8755c487b006 +timeCreated: 1515237548 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/IAuthenticationProvider.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/IAuthenticationProvider.cs new file mode 100644 index 00000000..ce770d68 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/IAuthenticationProvider.cs @@ -0,0 +1,44 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE && !BESTHTTP_DISABLE_WEBSOCKET + +using System; + +namespace BestHTTP.SignalRCore +{ + public delegate void OnAuthenticationSuccededDelegate(IAuthenticationProvider provider); + public delegate void OnAuthenticationFailedDelegate(IAuthenticationProvider provider, string reason); + + public interface IAuthenticationProvider + { + /// + /// The authentication must be run before any request made to build up the SignalR protocol + /// + bool IsPreAuthRequired { get; } + + /// + /// This event must be called when the pre-authentication succeded. When IsPreAuthRequired is false, no-one will subscribe to this event. + /// + event OnAuthenticationSuccededDelegate OnAuthenticationSucceded; + + /// + /// This event must be called when the pre-authentication failed. When IsPreAuthRequired is false, no-one will subscribe to this event. + /// + event OnAuthenticationFailedDelegate OnAuthenticationFailed; + + /// + /// This function called once, when the before the SignalR negotiation begins. If IsPreAuthRequired is false, then this step will be skipped. + /// + void StartAuthentication(); + + /// + /// This function will be called for every request before sending it. + /// + void PrepareRequest(HTTPRequest request); + + /// + /// This function can customize the given uri. If there's no intention to modify the uri, this function + /// should return with the parameter. + /// + Uri PrepareUri(Uri uri); + } +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/IAuthenticationProvider.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/IAuthenticationProvider.cs.meta new file mode 100644 index 00000000..fbab001f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/IAuthenticationProvider.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: d30367ca9f9cbda45ad05e42d66c93cd +timeCreated: 1515237548 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/JsonProtocol.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/JsonProtocol.cs new file mode 100644 index 00000000..799e7013 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/JsonProtocol.cs @@ -0,0 +1,169 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE && !BESTHTTP_DISABLE_WEBSOCKET + +using BestHTTP.SignalRCore.Messages; +using System; +using System.Collections.Generic; + +#if NETFX_CORE || NET_4_6 +using System.Reflection; +#endif + +namespace BestHTTP.SignalRCore +{ + public interface IProtocol + { + TransferModes Type { get; } + IEncoder Encoder { get; } + HubConnection Connection { get; set; } + + /// + /// This function must parse textual representation of the messages into the list of Messages. + /// + void ParseMessages(string data, ref List messages); + + /// + /// This function must parse binary representation of the messages into the list of Messages. + /// + void ParseMessages(byte[] data, ref List messages); + + /// + /// This function must return the encoded representation of the given message. + /// + byte[] EncodeMessage(Message message); + + /// + /// This function must convert all element in the arguments array to the corresponding type from the argTypes array. + /// + object[] GetRealArguments(Type[] argTypes, object[] arguments); + + /// + /// Convert a value to the given type. + /// + object ConvertTo(Type toType, object obj); + } + + public sealed class JsonProtocol : IProtocol + { + public const char Separator = (char)0x1E; + + public TransferModes Type { get { return TransferModes.Text; } } + public IEncoder Encoder { get; private set; } + public HubConnection Connection { get; set; } + + public JsonProtocol(IEncoder encoder) + { + if (encoder == null) + throw new ArgumentNullException("encoder"); + if (encoder.Name != "json") + throw new ArgumentException("Encoder must be a json encoder!"); + + this.Encoder = encoder; + } + + public void ParseMessages(string data, ref List messages) + { + int from = 0; + int separatorIdx = data.IndexOf(JsonProtocol.Separator); + if (separatorIdx == -1) + throw new Exception("Missing separator!"); + + while (separatorIdx != -1) + { + string sub = data.Substring(from, separatorIdx - from); + + var message = this.Encoder.DecodeAs(sub); + + messages.Add(message); + + from = separatorIdx + 1; + separatorIdx = data.IndexOf(JsonProtocol.Separator, from); + } + } + + public void ParseMessages(byte[] data, ref List messages) { } + + public byte[] EncodeMessage(Message message) + { + string json = null; + switch (message.type) + { + case MessageTypes.Invocation: + case MessageTypes.StreamInvocation: + // While message contains all informations already, the spec states that no additional field are allowed in messages + // So we are creating 'specialized' messages here to send to the server. + json = this.Encoder.EncodeAsText(new InvocationMessage() + { + type = message.type, + invocationId = message.invocationId, + nonblocking = message.nonblocking, + target = message.target, + arguments = message.arguments + }); + break; + + case MessageTypes.CancelInvocation: + json = this.Encoder.EncodeAsText(new CancelInvocationMessage() + { + invocationId = message.invocationId + }); + break; + + case MessageTypes.Ping: + json = this.Encoder.EncodeAsText(new PingMessage()); + break; + } + + return !string.IsNullOrEmpty(json) ? JsonProtocol.WithSeparator(json) : null; + } + + public object[] GetRealArguments(Type[] argTypes, object[] arguments) + { + if (arguments == null || arguments.Length == 0) + return null; + + if (argTypes.Length > arguments.Length) + throw new Exception(string.Format("argType.Length({0}) < arguments.length({1})", argTypes.Length, arguments.Length)); + + object[] realArgs = new object[arguments.Length]; + + for (int i = 0; i < arguments.Length; ++i) + realArgs[i] = ConvertTo(argTypes[i], arguments[i]); + + return realArgs; + } + + public object ConvertTo(Type toType, object obj) + { + if (obj == null) + return null; +#if NETFX_CORE //|| NET_4_6 + if (toType.GetTypeInfo().IsPrimitive || toType.GetTypeInfo().IsEnum) +#else + if (toType.IsPrimitive || toType.IsEnum) +#endif + return Convert.ChangeType(obj, toType); + + if (toType == typeof(string)) + return obj.ToString(); + + return this.Encoder.ConvertTo(toType, obj); + } + + /// + /// Returns the given string parameter's bytes with the added separator(0x1E). + /// + public static byte[] WithSeparator(string str) + { + int len = System.Text.Encoding.UTF8.GetByteCount(str); + + byte[] buffer = new byte[len + 1]; + + System.Text.Encoding.UTF8.GetBytes(str, 0, str.Length, buffer, 0); + + buffer[len] = 0x1e; + + return buffer; + } + } +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/JsonProtocol.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/JsonProtocol.cs.meta new file mode 100644 index 00000000..f9ca713d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/JsonProtocol.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b98779f03b6433e4387c86a676d50027 +timeCreated: 1515237548 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages.meta new file mode 100644 index 00000000..9f91ecde --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 04849aa46f6e586469d9275d70387fb0 +folderAsset: yes +timeCreated: 1515237542 +licenseType: Store +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Invocation.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Invocation.cs new file mode 100644 index 00000000..e9fecd03 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Invocation.cs @@ -0,0 +1,26 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE && !BESTHTTP_DISABLE_WEBSOCKET +using System; + +namespace BestHTTP.SignalRCore.Messages +{ + public struct InvocationMessage + { + public MessageTypes type; + public string invocationId; + public bool nonblocking; + public string target; + public object[] arguments; + } + + public struct CancelInvocationMessage + { + public MessageTypes type { get { return MessageTypes.CancelInvocation; } } + public string invocationId; + } + + public struct PingMessage + { + public MessageTypes type { get { return MessageTypes.Ping; } } + } +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Invocation.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Invocation.cs.meta new file mode 100644 index 00000000..b05e69c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Invocation.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 80d549225d0ced34c864973a497e97bc +timeCreated: 1515237548 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Message.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Message.cs new file mode 100644 index 00000000..954d091f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Message.cs @@ -0,0 +1,84 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE && !BESTHTTP_DISABLE_WEBSOCKET +using System; + +namespace BestHTTP.SignalRCore.Messages +{ + public enum MessageTypes : int + { + /// + /// This is a made up message type, for easier handshake handling. + /// + Handshake = 0, + + /// + /// https://github.com/aspnet/SignalR/blob/dev/specs/HubProtocol.md#invocation-message-encoding + /// + Invocation = 1, + + /// + /// https://github.com/aspnet/SignalR/blob/dev/specs/HubProtocol.md#streamitem-message-encoding + /// + StreamItem = 2, + + /// + /// https://github.com/aspnet/SignalR/blob/dev/specs/HubProtocol.md#completion-message-encoding + /// + Completion = 3, + + /// + /// https://github.com/aspnet/SignalR/blob/dev/specs/HubProtocol.md#streaminvocation-message-encoding + /// + StreamInvocation = 4, + + /// + /// https://github.com/aspnet/SignalR/blob/dev/specs/HubProtocol.md#cancelinvocation-message-encoding + /// + CancelInvocation = 5, + + /// + /// https://github.com/aspnet/SignalR/blob/dev/specs/HubProtocol.md#ping-message-encoding + /// + Ping = 6, + + /// + /// https://github.com/aspnet/SignalR/blob/dev/specs/HubProtocol.md#close-message-encoding + /// + Close = 7 + } + + public struct Message + { + public MessageTypes type; + public string invocationId; + public bool nonblocking; + public string target; + public object[] arguments; + public object item; + public object result; + public string error; + + public override string ToString() + { + switch (this.type) + { + case MessageTypes.Invocation: + return string.Format("[Invocation Id: {0}, Target: '{1}', Argument count: {2}]", this.invocationId, this.target, this.arguments != null ? this.arguments.Length : 0); + case MessageTypes.StreamItem: + return string.Format("[StreamItem Id: {0}, Item: {1}]", this.invocationId, this.item.ToString()); + case MessageTypes.Completion: + return string.Format("[Completion Id: {0}, Result: {1}, Error: '{2}']", this.invocationId, this.result, this.error); + case MessageTypes.StreamInvocation: + return string.Format("[StreamInvocation Id: {0}, Target: '{1}', Argument count: {2}]", this.invocationId, this.target, this.arguments != null ? this.arguments.Length : 0); + case MessageTypes.CancelInvocation: + return string.Format("[CancelInvocation Id: {0}]", this.invocationId); + case MessageTypes.Ping: + return "[Ping]"; + case MessageTypes.Close: + return string.IsNullOrEmpty(this.error) ? "[Close]" : string.Format("[Close {0}]", this.error); + default: + return "Unknown message! Type: " + this.type; + } + } + } +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Message.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Message.cs.meta new file mode 100644 index 00000000..566711ca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/Message.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: f6a7c57303e62774fb902547acce515a +timeCreated: 1515237548 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/NegotiationResult.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/NegotiationResult.cs new file mode 100644 index 00000000..4897e056 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/NegotiationResult.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; + +namespace BestHTTP.SignalRCore.Messages +{ + public sealed class SupportedTransport + { + /// + /// Name of the transport. + /// + public string Name { get; private set; } + + /// + /// Supported transfer formats of the transport. + /// + public List SupportedFormats { get; private set; } + + internal SupportedTransport(string transportName, List transferFormats) + { + this.Name = transportName; + this.SupportedFormats = transferFormats; + } + } + + /// + /// Negotiation result of the /negotiation request. + /// + /// + public sealed class NegotiationResult + { + /// + /// The connectionId which is required by the Long Polling and Server-Sent Events transports (in order to correlate sends and receives). + /// + public string ConnectionId { get; private set; } + + /// + /// The availableTransports list which describes the transports the server supports. For each transport, the name of the transport (transport) is listed, as is a list of "transfer formats" supported by the transport (transferFormats) + /// + public List SupportedTransports { get; private set; } + + /// + /// The url which is the URL the client should connect to. + /// + public Uri Url { get; private set; } + + /// + /// The accessToken which is an optional bearer token for accessing the specified url. + /// + public string AccessToken { get; private set; } + + internal static NegotiationResult Parse(string json, out string error, HubConnection hub) + { + error = null; + + Dictionary response = BestHTTP.JSON.Json.Decode(json) as Dictionary; + if (response == null) + { + error = "Json decoding failed!"; + return null; + } + + try + { + NegotiationResult result = new NegotiationResult(); + object value; + if (response.TryGetValue("connectionId", out value)) + result.ConnectionId = value.ToString(); + + if (response.TryGetValue("availableTransports", out value)) + { + List transports = value as List; + if (transports != null) + { + List supportedTransports = new List(transports.Count); + + foreach (Dictionary transport in transports) + { + string transportName = string.Empty; + List transferModes = null; + + if (transport.TryGetValue("transport", out value)) + transportName = value.ToString(); + + if (transport.TryGetValue("transferFormats", out value)) + { + List transferFormats = value as List; + + if (transferFormats != null) + { + transferModes = new List(transferFormats.Count); + foreach (var mode in transferFormats) + transferModes.Add(mode.ToString()); + } + } + + supportedTransports.Add(new SupportedTransport(transportName, transferModes)); + } + + result.SupportedTransports = supportedTransports; + } + } + + if (response.TryGetValue("url", out value)) + { + string uriStr = value.ToString(); + + Uri redirectUri; + + // Here we will try to parse the received url. If TryCreate fails, we will throw an exception + // as it should be able to successfully parse whole (absolute) urls (like "https://server:url/path") + // and relative ones (like "/path"). + if (!Uri.TryCreate(uriStr, UriKind.RelativeOrAbsolute, out redirectUri)) + throw new Exception(string.Format("Couldn't parse url: '{0}'", uriStr)); + + // If received a relative url we will use the hub's current url to append the new path to it. + if (!redirectUri.IsAbsoluteUri) + { + Uri oldUri = hub.Uri; + var builder = new UriBuilder(oldUri); + builder.Path = uriStr; + + redirectUri = builder.Uri; + } + + result.Url = redirectUri; + } + + if (response.TryGetValue("accessToken", out value)) + result.AccessToken = value.ToString(); + else if (hub.NegotiationResult != null) + result.AccessToken = hub.NegotiationResult.AccessToken; + + return result; + } + catch (Exception ex) + { + error = "Error while parsing result: " + ex.Message + " StackTrace: " + ex.StackTrace; + return null; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/NegotiationResult.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/NegotiationResult.cs.meta new file mode 100644 index 00000000..46097767 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Messages/NegotiationResult.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ff02294dfc0839f4b8cfa92dce810808 +timeCreated: 1528093299 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports.meta new file mode 100644 index 00000000..7e926363 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 93299fbc9d294004caa37d06aea06bb5 +folderAsset: yes +timeCreated: 1515237543 +licenseType: Store +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports/WebsocketTransport.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports/WebsocketTransport.cs new file mode 100644 index 00000000..2c59d3a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports/WebsocketTransport.cs @@ -0,0 +1,247 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE && !BESTHTTP_DISABLE_WEBSOCKET +using System; +using System.Collections.Generic; +using System.Text; + +using BestHTTP.SignalRCore.Messages; + +namespace BestHTTP.SignalRCore.Transports +{ + /// + /// WebSockets transport implementation. + /// https://github.com/aspnet/SignalR/blob/dev/specs/TransportProtocols.md#websockets-full-duplex + /// + internal sealed class WebSocketTransport : ITransport + { + public TransportTypes TransportType { get { return TransportTypes.WebSocket; } } + public TransferModes TransferMode { get { return TransferModes.Binary; } } + + /// + /// Current state of the transport. All changes will be propagated to the HubConnection through the onstateChanged event. + /// + public TransportStates State { + get { return this._state; } + private set + { + if (this._state != value) + { + TransportStates oldState = this._state; + this._state = value; + + if (this.OnStateChanged != null) + this.OnStateChanged(oldState, this._state); + } + } + } + private TransportStates _state; + + /// + /// This will store the reason of failures so HubConnection can include it in its OnError event. + /// + public string ErrorReason { get; private set; } + + /// + /// Called every time when the transport's changed. + /// + public event Action OnStateChanged; + + private WebSocket.WebSocket webSocket; + private HubConnection connection; + + /// + /// Cached list of parsed messages. + /// + private List messages = new List(); + + public WebSocketTransport(HubConnection con) + { + this.connection = con; + this.State = TransportStates.Initial; + } + + void ITransport.StartConnect() + { + HTTPManager.Logger.Verbose("WebSocketTransport", "StartConnect"); + + if (this.webSocket == null) + { + Uri uri = BuildUri(this.connection.Uri); + + // Also, if there's an authentication provider it can alter further our uri. + if (this.connection.AuthenticationProvider != null) + uri = this.connection.AuthenticationProvider.PrepareUri(uri) ?? uri; + + HTTPManager.Logger.Verbose("WebSocketTransport", "StartConnect connecting to Uri: " + uri.ToString()); + + this.webSocket = new WebSocket.WebSocket(uri); + } + +#if !UNITY_WEBGL || UNITY_EDITOR + // prepare the internal http request + if (this.connection.AuthenticationProvider != null) + this.connection.AuthenticationProvider.PrepareRequest(webSocket.InternalRequest); +#endif + this.webSocket.OnOpen += OnOpen; + this.webSocket.OnMessage += OnMessage; + this.webSocket.OnBinary += OnBinary; + this.webSocket.OnErrorDesc += OnError; + this.webSocket.OnClosed += OnClosed; + + this.webSocket.Open(); + + this.State = TransportStates.Connecting; + } + + void ITransport.Send(byte[] msg) + { + // To help debugging, in the editor when the plugin's loggging level is set to All, we will + // send all messages in textual form. This will help the readability when sent through a proxy. +#if UNITY_EDITOR + if (HTTPManager.Logger.Level == Logger.Loglevels.All) + this.webSocket.Send(System.Text.Encoding.UTF8.GetString(msg, 0, msg.Length)); + else +#endif + this.webSocket.Send(msg); + } + + // The websocket connection is open + private void OnOpen(WebSocket.WebSocket webSocket) + { + HTTPManager.Logger.Verbose("WebSocketTransport", "OnOpen"); + + // https://github.com/aspnet/SignalR/blob/dev/specs/HubProtocol.md#overview + // When our websocket connection is open, send the 'negotiation' message to the server. + + string json = string.Format("{{'protocol':'{0}', 'version': 1}}", this.connection.Protocol.Encoder.Name); + + byte[] buffer = JsonProtocol.WithSeparator(json); + + (this as ITransport).Send(buffer); + } + + private string ParseHandshakeResponse(string data) + { + // The handshake response is + // -an empty json object ('{}') if the handshake process is succesfull + // -otherwise it has one 'error' field + + Dictionary response = BestHTTP.JSON.Json.Decode(data) as Dictionary; + + if (response == null) + return "Couldn't parse json data: " + data; + + object error; + if (response.TryGetValue("error", out error)) + return error.ToString(); + + return null; + } + + private void HandleHandshakeResponse(string data) + { + this.ErrorReason = ParseHandshakeResponse(data); + + this.State = string.IsNullOrEmpty(this.ErrorReason) ? TransportStates.Connected : TransportStates.Failed; + } + + private void OnMessage(WebSocket.WebSocket webSocket, string data) + { + if (this.State == TransportStates.Connecting) + { + HandleHandshakeResponse(data); + + return; + } + + this.messages.Clear(); + try + { + this.connection.Protocol.ParseMessages(data, ref this.messages); + + this.connection.OnMessages(this.messages); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocketTransport", "OnMessage(string)", ex); + } + finally + { + this.messages.Clear(); + } + } + + private void OnBinary(WebSocket.WebSocket webSocket, byte[] data) + { + if (this.State == TransportStates.Connecting) + { + HandleHandshakeResponse(System.Text.Encoding.UTF8.GetString(data, 0, data.Length)); + + return; + } + + this.messages.Clear(); + try + { + this.connection.Protocol.ParseMessages(data, ref this.messages); + + this.connection.OnMessages(this.messages); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocketTransport", "OnMessage(byte[])", ex); + } + finally + { + this.messages.Clear(); + } + } + + private void OnError(WebSocket.WebSocket webSocket, string reason) + { + HTTPManager.Logger.Verbose("WebSocketTransport", "OnError: " + reason); + + this.ErrorReason = reason; + this.State = TransportStates.Failed; + } + + private void OnClosed(WebSocket.WebSocket webSocket, ushort code, string message) + { + HTTPManager.Logger.Verbose("WebSocketTransport", "OnClosed: " + code + " " + message); + + this.webSocket = null; + + this.State = TransportStates.Closed; + } + + void ITransport.StartClose() + { + HTTPManager.Logger.Verbose("WebSocketTransport", "StartClose"); + + if (this.webSocket != null) + { + this.State = TransportStates.Closing; + this.webSocket.Close(); + } + else + this.State = TransportStates.Closed; + } + + private Uri BuildUri(Uri baseUri) + { + if (this.connection.NegotiationResult == null) + return baseUri; + + UriBuilder builder = new UriBuilder(baseUri); + StringBuilder queryBuilder = new StringBuilder(); + + queryBuilder.Append(baseUri.Query); + if (!string.IsNullOrEmpty(this.connection.NegotiationResult.ConnectionId)) + queryBuilder.Append("&id=").Append(this.connection.NegotiationResult.ConnectionId); + + builder.Query = queryBuilder.ToString(); + + return builder.Uri; + } + } +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports/WebsocketTransport.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports/WebsocketTransport.cs.meta new file mode 100644 index 00000000..7489628b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SignalRCore/Transports/WebsocketTransport.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e89b403b974cebf40845e9ca6616a0e0 +timeCreated: 1515237548 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO.meta new file mode 100644 index 00000000..563bd54f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 70d2cd72d4442e349a1cfa407bbcfe8d +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Enums.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Enums.cs new file mode 100644 index 00000000..dbc350f5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Enums.cs @@ -0,0 +1,105 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +namespace BestHTTP.SocketIO +{ + /// + /// Possible event types on the transport level. + /// + public enum TransportEventTypes : int + { + Unknown = -1, + Open = 0, + Close = 1, + Ping = 2, + Pong = 3, + Message = 4, + Upgrade = 5, + Noop = 6 + } + + /// + /// Event types of the SocketIO protocol. + /// + public enum SocketIOEventTypes : int + { + Unknown = -1, + + /// + /// Connect to a namespace, or we connected to a namespace + /// + Connect = 0, + + /// + /// Disconnect a namespace, or we disconnected from a namespace. + /// + Disconnect = 1, + + /// + /// A general event. The event's name is in the payload. + /// + Event = 2, + + /// + /// Acknowledgment of an event. + /// + Ack = 3, + + /// + /// Error sent by the server, or by the plugin + /// + Error = 4, + + /// + /// A general event with binary attached to the packet. The event's name is in the payload. + /// + BinaryEvent = 5, + + /// + /// Acknowledgment of a binary event. + /// + BinaryAck = 6 + } + + /// + /// Possible error codes that the SocketIO server can send. + /// + public enum SocketIOErrors + { + /// + /// Transport unknown + /// + UnknownTransport = 0, + + /// + /// Session ID unknown + /// + UnknownSid = 1, + + /// + /// Bad handshake method + /// + BadHandshakeMethod = 2, + + /// + /// Bad request + /// + BadRequest = 3, + + /// + /// Plugin internal error! + /// + Internal, + + /// + /// Exceptions that caught by the plugin but raised in a user code. + /// + User, + + /// + /// A custom, server sent error, most probably from a Socket.IO middleware. + /// + Custom, + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Enums.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Enums.cs.meta new file mode 100644 index 00000000..88ef434b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Enums.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 94f15ba2f99e9e148869183ae648e7e6 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Error.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Error.cs new file mode 100644 index 00000000..6f4fc606 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Error.cs @@ -0,0 +1,23 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +namespace BestHTTP.SocketIO +{ + public sealed class Error + { + public SocketIOErrors Code { get; private set; } + public string Message { get; private set; } + + public Error(SocketIOErrors code, string msg) + { + this.Code = code; + this.Message = msg; + } + + public override string ToString() + { + return string.Format("Code: {0} Message: \"{1}\"", this.Code.ToString(), this.Message); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Error.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Error.cs.meta new file mode 100644 index 00000000..56563548 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Error.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bede350068da4b74b9cc566b9bff3bdd +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events.meta new file mode 100644 index 00000000..125739a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 97e9578ca337d0f42a4145ade32a3a5c +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventDescriptor.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventDescriptor.cs new file mode 100644 index 00000000..13e177c6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventDescriptor.cs @@ -0,0 +1,97 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; +using System.Collections.Generic; + +namespace BestHTTP.SocketIO.Events +{ + public delegate void SocketIOCallback(Socket socket, Packet packet, params object[] args); + public delegate void SocketIOAckCallback(Socket socket, Packet packet, params object[] args); + + /// + /// A class to describe an event, and its metadatas. + /// + internal sealed class EventDescriptor + { + #region Public Properties + + /// + /// List of callback delegates. + /// + public List Callbacks { get; private set; } + + /// + /// If this property is true, callbacks are removed automatically after the event dispatch. + /// + public bool OnlyOnce { get; private set; } + + /// + /// If this property is true, the dispatching packet's Payload will be decoded using the Manager's Encoder. + /// + public bool AutoDecodePayload { get; private set; } + + #endregion + + /// + /// Cache an array on a hot-path. + /// + private SocketIOCallback[] CallbackArray; + + /// + /// Constructor to create an EventDescriptor instance and set the meta-datas. + /// + public EventDescriptor(bool onlyOnce, bool autoDecodePayload, SocketIOCallback callback) + { + this.OnlyOnce = onlyOnce; + this.AutoDecodePayload = autoDecodePayload; + this.Callbacks = new List(1); + + if (callback != null) + Callbacks.Add(callback); + } + + /// + /// Will call the callback delegates with the given parameters and remove the callbacks if this descriptor marked with a true OnlyOnce property. + /// + public void Call(Socket socket, Packet packet, params object[] args) + { + int callbackCount = Callbacks.Count; + if (CallbackArray == null || CallbackArray.Length < callbackCount) + Array.Resize(ref CallbackArray, callbackCount); + + // Copy the callback delegates to an array, because in one of the callbacks we can modify the list(by calling On/Once/Off in an event handler) + // This way we can prevent some strange bug + Callbacks.CopyTo(CallbackArray); + + // Go through the delegates and call them + for (int i = 0; i < callbackCount; ++i) + { + try + { + // Call the delegate. + SocketIOCallback callback = CallbackArray[i]; + if (callback!= null) + callback(socket, packet, args); + } + catch (Exception ex) + { + // Do not try to emit a new Error when we already tried to deliver an Error, possible causing a + // stack overflow + if (args == null || args.Length == 0 || !(args[0] is Error)) + (socket as ISocket).EmitError(SocketIOErrors.User, ex.Message + " " + ex.StackTrace); + + HTTPManager.Logger.Exception("EventDescriptor", "Call", ex); + } + + // If these callbacks has to be called only once, remove them from the main list + if (this.OnlyOnce) + Callbacks.Remove(CallbackArray[i]); + + // Don't keep any reference avoiding memory leaks + CallbackArray[i] = null; + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventDescriptor.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventDescriptor.cs.meta new file mode 100644 index 00000000..40d24c3a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventDescriptor.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ab942858f5ff2a4458ec312bc2955779 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventNames.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventNames.cs new file mode 100644 index 00000000..7e420349 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventNames.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; + +namespace BestHTTP.SocketIO.Events +{ + /// + /// Helper class to provide functions to an easy Enum->string conversation of the transport and SocketIO evenet types. + /// + public static class EventNames + { + public const string Connect = "connect"; + public const string Disconnect = "disconnect"; + public const string Event = "event"; + public const string Ack = "ack"; + public const string Error = "error"; + public const string BinaryEvent = "binaryevent"; + public const string BinaryAck = "binaryack"; + + private static string[] SocketIONames = new string[] { "unknown", "connect", "disconnect", "event", "ack", "error", "binaryevent", "binaryack" }; + private static string[] TransportNames = new string[] { "unknown", "open", "close", "ping", "pong", "message", "upgrade", "noop" }; + private static string[] BlacklistedEvents = new string[] { "connect", "connect_error", "connect_timeout", "disconnect", "error", "reconnect", + "reconnect_attempt", "reconnect_failed", "reconnect_error", "reconnecting" }; + + public static string GetNameFor(SocketIOEventTypes type) + { + return SocketIONames[(int)type + 1]; + } + + public static string GetNameFor(TransportEventTypes transEvent) + { + return TransportNames[(int)transEvent + 1]; + } + + /// + /// Checks an event name whether it's blacklisted or not. + /// + public static bool IsBlacklisted(string eventName) + { + for (int i = 0; i < BlacklistedEvents.Length; ++i) + if (string.Compare(BlacklistedEvents[i], eventName, StringComparison.OrdinalIgnoreCase) == 0) + return true; + return false; + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventNames.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventNames.cs.meta new file mode 100644 index 00000000..68ed6494 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventNames.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3ab78cfee54d71543bec1cdef098cd4b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventTable.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventTable.cs new file mode 100644 index 00000000..37f94326 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventTable.cs @@ -0,0 +1,154 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System.Collections.Generic; + +namespace BestHTTP.SocketIO.Events +{ + /// + /// This class helps keep track and maintain EventDescriptor instances and dispatching packets to the right delegates. + /// + internal sealed class EventTable + { + #region Privates + + /// + /// The Socket that this EventTable is bound to. + /// + private Socket Socket { get; set; } + + /// + /// The 'EventName -> List of events' mapping. + /// + private Dictionary> Table = new Dictionary>(); + + #endregion + + /// + /// Constructor to create an instance and bind it to a socket. + /// + public EventTable(Socket socket) + { + this.Socket = socket; + } + + /// + /// Register a callback to a name with the given metadata. + /// + public void Register(string eventName, SocketIOCallback callback, bool onlyOnce, bool autoDecodePayload) + { + List events; + if (!Table.TryGetValue(eventName, out events)) + Table.Add(eventName, events = new List(1)); + + // Find a matching desriptor + var desc = events.Find((d) => d.OnlyOnce == onlyOnce && d.AutoDecodePayload == autoDecodePayload); + + // If not found, create one + if (desc == null) + events.Add(new EventDescriptor(onlyOnce, autoDecodePayload, callback)); + else // if found, add the new callback + desc.Callbacks.Add(callback); + } + + /// + /// Removes all events that registered for the given name. + /// + public void Unregister(string eventName) + { + Table.Remove(eventName); + } + + /// + /// + /// + public void Unregister(string eventName, SocketIOCallback callback) + { + List events; + if (Table.TryGetValue(eventName, out events)) + for (int i = 0; i < events.Count; ++i) + events[i].Callbacks.Remove(callback); + } + + /// + /// Will call the delegates that associated to the given eventName. + /// + public void Call(string eventName, Packet packet, params object[] args) + { + if (HTTPManager.Logger.Level <= BestHTTP.Logger.Loglevels.All) + HTTPManager.Logger.Verbose("EventTable", "Call - " + eventName); + + List events; + + if (Table.TryGetValue(eventName, out events)) + for (int i = 0; i < events.Count; ++i) + events[i].Call(Socket, packet, args); + } + + /// + /// This function will get the eventName from the packet's Payload, and optionally will decode it from Json. + /// + public void Call(Packet packet) + { + string eventName = packet.DecodeEventName(); + string typeName = packet.SocketIOEvent != SocketIOEventTypes.Unknown ? EventNames.GetNameFor(packet.SocketIOEvent) : EventNames.GetNameFor(packet.TransportEvent); + object[] args = null; + + if (!HasSubsciber(eventName) && !HasSubsciber(typeName)) + return; + + // If this is an Event or BinaryEvent message, or we have a subscriber with AutoDecodePayload, then + // we have to decode the packet's Payload. + if (packet.TransportEvent == TransportEventTypes.Message && (packet.SocketIOEvent == SocketIOEventTypes.Event || packet.SocketIOEvent == SocketIOEventTypes.BinaryEvent) && ShouldDecodePayload(eventName)) + args = packet.Decode(Socket.Manager.Encoder); + + // call event callbacks registered for 'eventName' + if (!string.IsNullOrEmpty(eventName)) + Call(eventName, packet, args); + + if (!packet.IsDecoded && ShouldDecodePayload(typeName)) + args = packet.Decode(Socket.Manager.Encoder); + + // call event callbacks registered for 'typeName' + if (!string.IsNullOrEmpty(typeName)) + Call(typeName, packet, args); + } + + /// + /// Remove all event -> delegate association. + /// + public void Clear() + { + Table.Clear(); + } + + #region Private Helpers + + /// + /// Returns true, if for the given event name there are at least one event that needs a decoded + /// + /// + /// + private bool ShouldDecodePayload(string eventName) + { + List events; + + // If we find at least one EventDescriptor with AutoDecodePayload == true, we have to + // decode the whole payload + if (Table.TryGetValue(eventName, out events)) + for (int i = 0; i < events.Count; ++i) + if (events[i].AutoDecodePayload && events[i].Callbacks.Count > 0) + return true; + + return false; + } + + private bool HasSubsciber(string eventName) + { + return Table.ContainsKey(eventName); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventTable.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventTable.cs.meta new file mode 100644 index 00000000..6089fc31 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Events/EventTable.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 62b1e6227e8b13446b06cf83b7ab23e2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/HandshakeData.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/HandshakeData.cs new file mode 100644 index 00000000..a05607b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/HandshakeData.cs @@ -0,0 +1,101 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; +using System.Collections.Generic; + +namespace BestHTTP.SocketIO +{ + using BestHTTP.JSON; + + /// + /// Helper class to parse and hold handshake information. + /// + public sealed class HandshakeData + { + #region Public Handshake Data + + /// + /// Session ID of this connection. + /// + public string Sid { get; private set; } + + /// + /// List of possible upgrades. + /// + public List Upgrades { get; private set; } + + /// + /// What interval we have to set a ping message. + /// + public TimeSpan PingInterval { get; private set; } + + /// + /// What time have to pass without an answer to our ping request when we can consider the connection disconnected. + /// + public TimeSpan PingTimeout { get; private set; } + + #endregion + + #region Helper Methods + + public bool Parse(string str) + { + bool success = false; + Dictionary dict = Json.Decode(str, ref success) as Dictionary; + if (!success) + return false; + + try + { + this.Sid = GetString(dict, "sid"); + this.Upgrades = GetStringList(dict, "upgrades"); + this.PingInterval = TimeSpan.FromMilliseconds(GetInt(dict, "pingInterval")); + this.PingTimeout = TimeSpan.FromMilliseconds(GetInt(dict, "pingTimeout")); + } + catch (Exception ex) + { + BestHTTP.HTTPManager.Logger.Exception("HandshakeData", "Parse", ex); + return false; + } + + return true; + } + + private static object Get(Dictionary from, string key) + { + object value; + if (!from.TryGetValue(key, out value)) + throw new System.Exception(string.Format("Can't get {0} from Handshake data!", key)); + return value; + } + + private static string GetString(Dictionary from, string key) + { + return Get(from, key) as string; + } + + private static List GetStringList(Dictionary from, string key) + { + List value = Get(from, key) as List; + + List result = new List(value.Count); + for (int i = 0; i < value.Count; ++i) + { + string str = value[i] as string; + if (str != null) + result.Add(str); + } + + return result; + } + + private static int GetInt(Dictionary from, string key) + { + return (int)(double)Get(from, key); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/HandshakeData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/HandshakeData.cs.meta new file mode 100644 index 00000000..9ad5b710 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/HandshakeData.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 28457ee0deb7f0e4e8477f231304c601 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Interfaces.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Interfaces.cs new file mode 100644 index 00000000..7e5b1712 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Interfaces.cs @@ -0,0 +1,40 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +namespace BestHTTP.SocketIO +{ + using BestHTTP.SocketIO.Transports; + + /// + /// Interface to hide internal functions from the user by implementing it as an explicit interface. + /// + public interface IManager + { + void Remove(Socket socket); + void Close(bool removeSockets = true); + void TryToReconnect(); + bool OnTransportConnected(ITransport transport); + void OnTransportError(ITransport trans, string err); + void OnTransportProbed(ITransport trans); + void SendPacket(Packet packet); + void OnPacket(Packet packet); + void EmitEvent(string eventName, params object[] args); + void EmitEvent(SocketIOEventTypes type, params object[] args); + void EmitError(SocketIOErrors errCode, string msg); + void EmitAll(string eventName, params object[] args); + } + + /// + /// Interface to hide internal functions from the user by implementing it as an explicit interface. + /// + public interface ISocket + { + void Open(); + void Disconnect(bool remove); + void OnPacket(Packet packet); + void EmitEvent(SocketIOEventTypes type, params object[] args); + void EmitEvent(string eventName, params object[] args); + void EmitError(SocketIOErrors errCode, string msg); + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Interfaces.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Interfaces.cs.meta new file mode 100644 index 00000000..d7d93f16 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Interfaces.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e37425596e0069c4b99fea0b55dcd4cc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders.meta new file mode 100644 index 00000000..62ac15d4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ed82682a337846d47b38e6ca7189a0c8 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/DefaultJSonEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/DefaultJSonEncoder.cs new file mode 100644 index 00000000..5dee8cf6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/DefaultJSonEncoder.cs @@ -0,0 +1,25 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System.Collections.Generic; +using BestHTTP.JSON; + +namespace BestHTTP.SocketIO.JsonEncoders +{ + /// + /// The default IJsonEncoder implementation. It's uses the Json class from the BestHTTP.JSON namespace to encode and decode. + /// + public sealed class DefaultJSonEncoder : IJsonEncoder + { + public List Decode(string json) + { + return Json.Decode(json) as List; + } + + public string Encode(List obj) + { + return Json.Encode(obj); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/DefaultJSonEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/DefaultJSonEncoder.cs.meta new file mode 100644 index 00000000..d30ae655 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/DefaultJSonEncoder.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 692eedd1d08951b4fac2cd4447430cf7 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/IJSonEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/IJSonEncoder.cs new file mode 100644 index 00000000..5a8ecbc3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/IJSonEncoder.cs @@ -0,0 +1,24 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System.Collections.Generic; + +namespace BestHTTP.SocketIO.JsonEncoders +{ + /// + /// Interface to be able to write custom Json encoders/decoders. + /// + public interface IJsonEncoder + { + /// + /// The Decode function must create a list of objects from the Json formatted string parameter. If the decoding fails, it should return null. + /// + List Decode(string json); + + /// + /// The Encode function must create a json formatted string from the parameter. If the encoding fails, it should return null. + /// + string Encode(List obj); + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/IJSonEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/IJSonEncoder.cs.meta new file mode 100644 index 00000000..25f6b1f3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/JsonEncoders/IJSonEncoder.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 68459b55b5787e04186d568f4ec8bbc3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Packet.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Packet.cs new file mode 100644 index 00000000..ed1c9ebe --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Packet.cs @@ -0,0 +1,611 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System.Text; + +namespace BestHTTP.SocketIO +{ + using System; + using System.Collections.Generic; + using BestHTTP.JSON; + + public sealed class Packet + { + private enum PayloadTypes : byte + { + Textual = 0, + Binary = 1 + } + + public const string Placeholder = "_placeholder"; + + #region Public properties + + /// + /// Event type of this packet on the transport layer. + /// + public TransportEventTypes TransportEvent { get; private set; } + + /// + /// The packet's type in the Socket.IO protocol. + /// + public SocketIOEventTypes SocketIOEvent { get; private set; } + + /// + /// How many attachment should have this packet. + /// + public int AttachmentCount { get; private set; } + + /// + /// The internal ack-id of this packet. + /// + public int Id { get; private set; } + + /// + /// The sender namespace's name. + /// + public string Namespace { get; private set; } + + /// + /// The payload as a Json string. + /// + public string Payload { get; private set; } + + /// + /// The decoded event name from the payload string. + /// + public string EventName { get; private set; } + + /// + /// All binary data attached to this event. + /// + public List Attachments { get { return attachments; } set { attachments = value; AttachmentCount = attachments != null ? attachments.Count : 0; } } + private List attachments; + + /// + /// Property to check whether all attachments are received to this packet. + /// + public bool HasAllAttachment { get { return Attachments != null && Attachments.Count == AttachmentCount; } } + + /// + /// True if it's already decoded. The DecodedArgs still can be null after the Decode call. + /// + public bool IsDecoded { get; private set; } + + /// + /// The decoded arguments from the result of a Json string -> c# object convert. + /// + public object[] DecodedArgs { get; private set; } + + #endregion + + #region Constructors + + /// + /// Internal constructor. Don't use it directly! + /// + internal Packet() + { + this.TransportEvent = TransportEventTypes.Unknown; + this.SocketIOEvent = SocketIOEventTypes.Unknown; + this.Payload = string.Empty; + } + + /// + /// Internal constructor. Don't use it directly! + /// + internal Packet(string from) + { + this.Parse(from); + } + + /// + /// Internal constructor. Don't use it directly! + /// + public Packet(TransportEventTypes transportEvent, SocketIOEventTypes packetType, string nsp, string payload, int attachment = 0, int id = 0) + { + this.TransportEvent = transportEvent; + this.SocketIOEvent = packetType; + this.Namespace = nsp; + this.Payload = payload; + this.AttachmentCount = attachment; + this.Id = id; + } + + #endregion + + #region Public Functions + + public object[] Decode(BestHTTP.SocketIO.JsonEncoders.IJsonEncoder encoder) + { + if (IsDecoded || encoder == null) + return DecodedArgs; + + IsDecoded = true; + + if (string.IsNullOrEmpty(Payload)) + return DecodedArgs; + + List decoded = encoder.Decode(Payload); + + if (decoded != null && decoded.Count > 0) + { + if (this.SocketIOEvent == SocketIOEventTypes.Ack || this.SocketIOEvent == SocketIOEventTypes.BinaryAck) + DecodedArgs = decoded.ToArray(); + else + { + decoded.RemoveAt(0); + + DecodedArgs = decoded.ToArray(); + } + } + + return DecodedArgs; + } + + /// + /// Will set and return with the EventName from the packet's Payload string. + /// + public string DecodeEventName() + { + // Already decoded + if (!string.IsNullOrEmpty(EventName)) + return EventName; + + // No Payload to decode + if (string.IsNullOrEmpty(Payload)) + return string.Empty; + + // Not array encoded, we can't decode + if (Payload[0] != '[') + return string.Empty; + + int idx = 1; + + // Search for the string-begin mark( ' or " chars) + while (Payload.Length > idx && Payload[idx] != '"' && Payload[idx] != '\'') + idx++; + + // Reached the end of the string + if (Payload.Length <= idx) + return string.Empty; + + int startIdx = ++idx; + + // Search for the trailing mark of the string + while (Payload.Length > idx && Payload[idx] != '"' && Payload[idx] != '\'') + idx++; + + // Reached the end of the string + if (Payload.Length <= idx) + return string.Empty; + + return EventName = Payload.Substring(startIdx, idx - startIdx); + } + + public string RemoveEventName(bool removeArrayMarks) + { + // No Payload to decode + if (string.IsNullOrEmpty(Payload)) + return string.Empty; + + // Not array encoded, we can't decode + if (Payload[0] != '[') + return string.Empty; + + int idx = 1; + + // Search for the string-begin mark( ' or " chars) + while (Payload.Length > idx && Payload[idx] != '"' && Payload[idx] != '\'') + idx++; + + // Reached the end of the string + if (Payload.Length <= idx) + return string.Empty; + + int startIdx = idx; + + // Search for end of first element, or end of the array marks + while (Payload.Length > idx && Payload[idx] != ',' && Payload[idx] != ']') + idx++; + + // Reached the end of the string + if (Payload.Length <= ++idx) + return string.Empty; + + string payload = Payload.Remove(startIdx, idx - startIdx); + + if (removeArrayMarks) + payload = payload.Substring(1, payload.Length - 2); + + return payload; + } + + /// + /// Will switch the "{'_placeholder':true,'num':X}" to a the index num X. + /// + /// True if successfully reconstructed, false otherwise. + public bool ReconstructAttachmentAsIndex() + { + //"452-["multiImage",{"image":true,"buffer1":{"_placeholder":true,"num":0},"buffer2":{"_placeholder":true,"num":1}}]" + + return PlaceholderReplacer((json, obj) => + { + int idx = Convert.ToInt32(obj["num"]); + this.Payload = this.Payload.Replace(json, idx.ToString()); + this.IsDecoded = false; + }); + } + + /// + /// Will switch the "{'_placeholder':true,'num':X}" to a the data as a base64 encoded string. + /// + /// True if successfully reconstructed, false otherwise. + public bool ReconstructAttachmentAsBase64() + { + //"452-["multiImage",{"image":true,"buffer1":{"_placeholder":true,"num":0},"buffer2":{"_placeholder":true,"num":1}}]" + + if (!HasAllAttachment) + return false; + + return PlaceholderReplacer((json, obj) => + { + int idx = Convert.ToInt32(obj["num"]); + this.Payload = this.Payload.Replace(json, string.Format("\"{0}\"", Convert.ToBase64String(this.Attachments[idx]))); + this.IsDecoded = false; + }); + } + + #endregion + + #region Internal Functions + + /// + /// Parse the packet from a server sent textual data. The Payload will be the raw json string. + /// + internal void Parse(string from) + { + int idx = 0; + this.TransportEvent = (TransportEventTypes)ToInt(from[idx++]); + + if (from.Length > idx && ToInt(from[idx]) >= 0) + this.SocketIOEvent = (SocketIOEventTypes)ToInt(from[idx++]); + else + this.SocketIOEvent = SocketIOEventTypes.Unknown; + + // Parse Attachment + if (this.SocketIOEvent == SocketIOEventTypes.BinaryEvent || this.SocketIOEvent == SocketIOEventTypes.BinaryAck) + { + int endIdx = from.IndexOf('-', idx); + if (endIdx == -1) + endIdx = from.Length; + + int attachment = 0; + int.TryParse(from.Substring(idx, endIdx - idx), out attachment); + this.AttachmentCount = attachment; + idx = endIdx + 1; + } + + // Parse Namespace + if (from.Length > idx && from[idx] == '/') + { + int endIdx = from.IndexOf(',', idx); + if (endIdx == -1) + endIdx = from.Length; + + this.Namespace = from.Substring(idx, endIdx - idx); + idx = endIdx + 1; + } + else + this.Namespace = "/"; + + // Parse Id + if (from.Length > idx && ToInt(from[idx]) >= 0) + { + int startIdx = idx++; + while (from.Length > idx && ToInt(from[idx]) >= 0) + idx++; + + int id = 0; + int.TryParse(from.Substring(startIdx, idx - startIdx), out id); + this.Id = id; + } + + // What left is the payload data + if (from.Length > idx) + this.Payload = from.Substring(idx); + else + this.Payload = string.Empty; + } + + /// + /// Custom function instead of char.GetNumericValue, as it throws an error under WebGL using the new 4.x runtime. + /// It will return the value of the char if it's a numeric one, otherwise -1. + /// + private int ToInt(char ch) + { + int charValue = Convert.ToInt32(ch); + int num = charValue - '0'; + if (num < 0 || num > 9) + return -1; + + return num; + } + + /// + /// Encodes this packet to a Socket.IO formatted string. + /// + internal string Encode() + { + StringBuilder builder = new StringBuilder(); + + // Set to Message if not set, and we are sending attachments + if (this.TransportEvent == TransportEventTypes.Unknown && this.AttachmentCount > 0) + this.TransportEvent = TransportEventTypes.Message; + + if (this.TransportEvent != TransportEventTypes.Unknown) + builder.Append(((int)this.TransportEvent).ToString()); + + // Set to BinaryEvent if not set, and we are sending attachments + if (this.SocketIOEvent == SocketIOEventTypes.Unknown && this.AttachmentCount > 0) + this.SocketIOEvent = SocketIOEventTypes.BinaryEvent; + + if (this.SocketIOEvent != SocketIOEventTypes.Unknown) + builder.Append(((int)this.SocketIOEvent).ToString()); + + if (this.SocketIOEvent == SocketIOEventTypes.BinaryEvent || this.SocketIOEvent == SocketIOEventTypes.BinaryAck) + { + builder.Append(this.AttachmentCount.ToString()); + builder.Append("-"); + } + + // Add the namespace. If there is any other then the root nsp ("/") + // then we have to add a trailing "," if we have more data. + bool nspAdded = false; + if (this.Namespace != "/") + { + builder.Append(this.Namespace); + nspAdded = true; + } + + // ack id, if any + if (this.Id != 0) + { + if (nspAdded) + { + builder.Append(","); + nspAdded = false; + } + + builder.Append(this.Id.ToString()); + } + + // payload + if (!string.IsNullOrEmpty(this.Payload)) + { + if (nspAdded) + { + builder.Append(","); + nspAdded = false; + } + + builder.Append(this.Payload); + } + + return builder.ToString(); + } + + /// + /// Encodes this packet to a Socket.IO formatted byte array. + /// + internal byte[] EncodeBinary() + { + if (AttachmentCount != 0 || (Attachments != null && Attachments.Count != 0)) + { + if (Attachments == null) + throw new ArgumentException("packet.Attachments are null!"); + + if (AttachmentCount != Attachments.Count) + throw new ArgumentException("packet.AttachmentCount != packet.Attachments.Count. Use the packet.AddAttachment function to add data to a packet!"); + } + + // Encode it as usual + string encoded = Encode(); + + // Convert it to a byte[] + byte[] payload = Encoding.UTF8.GetBytes(encoded); + + // Encode it to a message + byte[] buffer = EncodeData(payload, PayloadTypes.Textual, null); + + // If there is any attachment, convert them too, and append them after each other + if (AttachmentCount != 0) + { + int idx = buffer.Length; + + // List to temporarily hold the converted attachments + List attachmentDatas = new List(AttachmentCount); + + // The sum size of the converted attachments to be able to resize our buffer only once. This way we can avoid some GC garbage + int attachmentDataSize = 0; + + // Encode our attachments, and store them in our list + for (int i = 0; i < AttachmentCount; i++) + { + byte[] tmpBuff = EncodeData(Attachments[i], PayloadTypes.Binary, new byte[] { 4 }); + attachmentDatas.Add(tmpBuff); + + attachmentDataSize += tmpBuff.Length; + } + + // Resize our buffer once + Array.Resize(ref buffer, buffer.Length + attachmentDataSize); + + // And copy all data into it + for (int i = 0; i < AttachmentCount; ++i) + { + byte[] data = attachmentDatas[i]; + Array.Copy(data, 0, buffer, idx, data.Length); + + idx += data.Length; + } + } + + // Return the buffer + return buffer; + } + + /// + /// Will add the byte[] that the server sent to the attachments list. + /// + internal void AddAttachmentFromServer(byte[] data, bool copyFull) + { + if (data == null || data.Length == 0) + return; + + if (this.attachments == null) + this.attachments = new List(this.AttachmentCount); + + if (copyFull) + this.Attachments.Add(data); + else + { + byte[] buff = new byte[data.Length - 1]; + Array.Copy(data, 1, buff, 0, data.Length - 1); + + this.Attachments.Add(buff); + } + } + + #endregion + + #region Private Helper Functions + + /// + /// Encodes a byte array to a Socket.IO binary encoded message + /// + private byte[] EncodeData(byte[] data, PayloadTypes type, byte[] afterHeaderData) + { + // Packet binary encoding: + // [ 0|1 ][ length of data ][ FF ][data] + // <1 = binary, 0 = string>[...] + + // Get the length of the payload. Socket.IO uses a wasteful encoding to send the length of the data. + // If the data is 16 bytes we have to send the length as two bytes: byte value of the character '1' and byte value of the character '6'. + // Instead of just one byte: 0xF. If the payload is 123 bytes, we can't send as 0x7B... + int afterHeaderLength = (afterHeaderData != null ? afterHeaderData.Length : 0); + string lenStr = (data.Length + afterHeaderLength).ToString(); + byte[] len = new byte[lenStr.Length]; + for (int cv = 0; cv < lenStr.Length; ++cv) + len[cv] = (byte)char.GetNumericValue(lenStr[cv]); + + // We need another buffer to store the final data + byte[] buffer = new byte[data.Length + len.Length + 2 + afterHeaderLength]; + + // The payload is textual -> 0 + buffer[0] = (byte)type; + + // Copy the length of the data + for (int cv = 0; cv < len.Length; ++cv) + buffer[1 + cv] = len[cv]; + + int idx = 1 + len.Length; + + // End of the header data + buffer[idx++] = 0xFF; + + if (afterHeaderData != null && afterHeaderData.Length > 0) + { + Array.Copy(afterHeaderData, 0, buffer, idx, afterHeaderData.Length); + idx += afterHeaderData.Length; + } + + // Copy our payload data to the buffer + Array.Copy(data, 0, buffer, idx, data.Length); + + return buffer; + } + + /// + /// Searches for the "{'_placeholder':true,'num':X}" string, and will call the given action to modify the PayLoad + /// + private bool PlaceholderReplacer(Action> onFound) + { + if (string.IsNullOrEmpty(this.Payload)) + return false; + + // Find the first index of the "_placeholder" str + int placeholderIdx = this.Payload.IndexOf(Placeholder); + + while (placeholderIdx >= 0) + { + // Find the object-start token + int startIdx = placeholderIdx; + while (this.Payload[startIdx] != '{') + startIdx--; + + // Find the object-end token + int endIdx = placeholderIdx; + while (this.Payload.Length > endIdx && this.Payload[endIdx] != '}') + endIdx++; + + // We reached the end + if (this.Payload.Length <= endIdx) + return false; + + // Get the object, and decode it + string placeholderJson = this.Payload.Substring(startIdx, endIdx - startIdx + 1); + bool success = false; + Dictionary obj = Json.Decode(placeholderJson, ref success) as Dictionary; + if (!success) + return false; + + // Check for presence and value of _placeholder + object value; + if (!obj.TryGetValue(Placeholder, out value) || + !(bool)value) + return false; + + // Check for presence of num + if (!obj.TryGetValue("num", out value)) + return false; + + // Let do, what we have to do + onFound(placeholderJson, obj); + + // Find the next attachment if there is any + placeholderIdx = this.Payload.IndexOf(Placeholder); + } + + return true; + } + + #endregion + + #region Overrides and Interface Implementations + + /// + /// Returns with the Payload of this packet. + /// + public override string ToString() + { + return this.Payload; + } + + /// + /// Will clone this packet to an identical packet instance. + /// + internal Packet Clone() + { + Packet packet = new Packet(this.TransportEvent, this.SocketIOEvent, this.Namespace, this.Payload, 0, this.Id); + packet.EventName = this.EventName; + packet.AttachmentCount = this.AttachmentCount; + packet.attachments = this.attachments; + + return packet; + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Packet.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Packet.cs.meta new file mode 100644 index 00000000..f5538835 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Packet.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 907cf4e3f52e02c409084c624e734c7c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Socket.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Socket.cs new file mode 100644 index 00000000..c4849180 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Socket.cs @@ -0,0 +1,475 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; +using System.Collections.Generic; + +namespace BestHTTP.SocketIO +{ + using BestHTTP; + using BestHTTP.SocketIO.Events; + + /// + /// This class represents a Socket.IO namespace. + /// + public sealed class Socket : ISocket + { + #region Public Properties + + /// + /// The SocketManager instance that created this socket. + /// + public SocketManager Manager { get; private set; } + + /// + /// The namespace that this socket is bound to. + /// + public string Namespace { get; private set; } + + /// + /// Unique Id of the socket. + /// + public string Id { get; private set; } + + /// + /// True if the socket is connected and open to the server. False otherwise. + /// + public bool IsOpen { get; private set; } + + /// + /// While this property is True, the socket will decode the Packet's Payload data using the parent SocketManager's Encoder. You must set this property before any event subscription! Its default value is True; + /// + public bool AutoDecodePayload { get; set; } + + #endregion + + #region Privates + + /// + /// A table to store acknowledgment callbacks associated to the given ids. + /// + private Dictionary AckCallbacks; + + /// + /// Tha callback table that helps this class to manage event subscription and dispatching events. + /// + private EventTable EventCallbacks; + + /// + /// Cached list to spare some GC alloc. + /// + private List arguments = new List(); + + #endregion + + /// + /// Internal constructor. + /// + internal Socket(string nsp, SocketManager manager) + { + this.Namespace = nsp; + this.Manager = manager; + this.IsOpen = false; + this.AutoDecodePayload = true; + this.EventCallbacks = new EventTable(this); + } + + #region Socket Handling + + /// + /// Internal function to start opening the socket. + /// + void ISocket.Open() + { + // The transport already established the connection + if (Manager.State == SocketManager.States.Open) + OnTransportOpen(Manager.Socket, null); + else + { + // We want to receive a message when we are connected. + Manager.Socket.Off(EventNames.Connect, OnTransportOpen); + Manager.Socket.On(EventNames.Connect, OnTransportOpen); + + if (Manager.Options.AutoConnect && Manager.State == SocketManager.States.Initial) + Manager.Open(); + } + } + + /// + /// Disconnects this socket/namespace. + /// + public void Disconnect() + { + (this as ISocket).Disconnect(true); + } + + /// + /// Disconnects this socket/namespace. + /// + void ISocket.Disconnect(bool remove) + { + // Send a disconnect packet to the server + if (IsOpen) + { + Packet packet = new Packet(TransportEventTypes.Message, SocketIOEventTypes.Disconnect, this.Namespace, string.Empty); + (Manager as IManager).SendPacket(packet); + + // IsOpen must be false, because in the OnPacket preprocessing the packet would call this function again + IsOpen = false; + (this as ISocket).OnPacket(packet); + } + + if (AckCallbacks != null) + AckCallbacks.Clear(); + + if (remove) + { + EventCallbacks.Clear(); + + (Manager as IManager).Remove(this); + } + } + + #endregion + + #region Emit Implementations + + public Socket Emit(string eventName, params object[] args) + { + return Emit(eventName, null, args); + } + + public Socket Emit(string eventName, SocketIOAckCallback callback, params object[] args) + { + bool blackListed = EventNames.IsBlacklisted(eventName); + if (blackListed) + throw new ArgumentException("Blacklisted event: " + eventName); + + arguments.Clear(); + arguments.Add(eventName); + + // Find and swap any binary data(byte[]) to a placeholder string. + // Server side these will be swapped back. + List attachments = null; + if (args != null && args.Length > 0) + { + int idx = 0; + for (int i = 0; i < args.Length; ++i) + { + byte[] binData = args[i] as byte[]; + if (binData != null) + { + if (attachments == null) + attachments = new List(); + + Dictionary placeholderObj = new Dictionary(2); + placeholderObj.Add(Packet.Placeholder, true); + placeholderObj.Add("num", idx++); + + arguments.Add(placeholderObj); + + attachments.Add(binData); + } + else + arguments.Add(args[i]); + } + } + + string payload = null; + + try + { + payload = Manager.Encoder.Encode(arguments); + } + catch(Exception ex) + { + (this as ISocket).EmitError(SocketIOErrors.Internal, "Error while encoding payload: " + ex.Message + " " + ex.StackTrace); + + return this; + } + + // We don't use it further in this function, so we can clear it to not hold any unwanted reference. + arguments.Clear(); + + if (payload == null) + throw new ArgumentException("Encoding the arguments to JSON failed!"); + + int id = 0; + + if (callback != null) + { + id = Manager.NextAckId; + + if (AckCallbacks == null) + AckCallbacks = new Dictionary(); + + AckCallbacks[id] = callback; + } + + Packet packet = new Packet(TransportEventTypes.Message, + attachments == null ? SocketIOEventTypes.Event : SocketIOEventTypes.BinaryEvent, + this.Namespace, + payload, + 0, + id); + + if (attachments != null) + packet.Attachments = attachments; // This will set the AttachmentCount property too. + + (Manager as IManager).SendPacket(packet); + + return this; + } + + public Socket EmitAck(Packet originalPacket, params object[] args) + { + if (originalPacket == null) + throw new ArgumentNullException("originalPacket == null!"); + + if (/*originalPacket.Id == 0 ||*/ + (originalPacket.SocketIOEvent != SocketIOEventTypes.Event && originalPacket.SocketIOEvent != SocketIOEventTypes.BinaryEvent)) + throw new ArgumentException("Wrong packet - you can't send an Ack for a packet with id == 0 and SocketIOEvent != Event or SocketIOEvent != BinaryEvent!"); + + arguments.Clear(); + if (args != null && args.Length > 0) + arguments.AddRange(args); + + string payload = null; + try + { + payload = Manager.Encoder.Encode(arguments); + } + catch (Exception ex) + { + (this as ISocket).EmitError(SocketIOErrors.Internal, "Error while encoding payload: " + ex.Message + " " + ex.StackTrace); + + return this; + } + + if (payload == null) + throw new ArgumentException("Encoding the arguments to JSON failed!"); + + Packet packet = new Packet(TransportEventTypes.Message, + originalPacket.SocketIOEvent == SocketIOEventTypes.Event ? SocketIOEventTypes.Ack : SocketIOEventTypes.BinaryAck, + this.Namespace, + payload, + 0, + originalPacket.Id); + + (Manager as IManager).SendPacket(packet); + + return this; + } + + #endregion + + #region On Implementations + + /// + /// Register a callback for a given name + /// + public void On(string eventName, SocketIOCallback callback) + { + EventCallbacks.Register(eventName, callback, false, this.AutoDecodePayload); + } + + public void On(SocketIOEventTypes type, SocketIOCallback callback) + { + string eventName = EventNames.GetNameFor(type); + + EventCallbacks.Register(eventName, callback, false, this.AutoDecodePayload); + } + + public void On(string eventName, SocketIOCallback callback, bool autoDecodePayload) + { + EventCallbacks.Register(eventName, callback, false, autoDecodePayload); + } + + public void On(SocketIOEventTypes type, SocketIOCallback callback, bool autoDecodePayload) + { + string eventName = EventNames.GetNameFor(type); + + EventCallbacks.Register(eventName, callback, false, autoDecodePayload); + } + + #endregion + + #region Once Implementations + + public void Once(string eventName, SocketIOCallback callback) + { + EventCallbacks.Register(eventName, callback, true, this.AutoDecodePayload); + } + + public void Once(SocketIOEventTypes type, SocketIOCallback callback) + { + EventCallbacks.Register(EventNames.GetNameFor(type), callback, true, this.AutoDecodePayload); + } + + public void Once(string eventName, SocketIOCallback callback, bool autoDecodePayload) + { + EventCallbacks.Register(eventName, callback, true, autoDecodePayload); + } + + public void Once(SocketIOEventTypes type, SocketIOCallback callback, bool autoDecodePayload) + { + EventCallbacks.Register(EventNames.GetNameFor(type), callback, true, autoDecodePayload); + } + + #endregion + + #region Off Implementations + + /// + /// Remove all callbacks for all events. + /// + public void Off() + { + EventCallbacks.Clear(); + } + + /// + /// Removes all callbacks to the given event. + /// + public void Off(string eventName) + { + EventCallbacks.Unregister(eventName); + } + + /// + /// Removes all callbacks to the given event. + /// + public void Off(SocketIOEventTypes type) + { + Off(EventNames.GetNameFor(type)); + } + + /// + /// Remove the specified callback. + /// + public void Off(string eventName, SocketIOCallback callback) + { + EventCallbacks.Unregister(eventName, callback); + } + + /// + /// Remove the specified callback. + /// + public void Off(SocketIOEventTypes type, SocketIOCallback callback) + { + EventCallbacks.Unregister(EventNames.GetNameFor(type), callback); + } + + #endregion + + #region Packet Handling + + /// + /// Last call of the OnPacket chain(Transport -> Manager -> Socket), we will dispatch the event if there is any callback + /// + void ISocket.OnPacket(Packet packet) + { + // Some preprocessing of the packet + switch(packet.SocketIOEvent) + { + case SocketIOEventTypes.Connect: + this.Id = this.Namespace != "/" ? this.Namespace + "#" + this.Manager.Handshake.Sid : this.Manager.Handshake.Sid; + break; + + case SocketIOEventTypes.Disconnect: + if (IsOpen) + { + IsOpen = false; + EventCallbacks.Call(EventNames.GetNameFor(SocketIOEventTypes.Disconnect), packet); + Disconnect(); + } + break; + + // Create an Error object from the server-sent json string + case SocketIOEventTypes.Error: + bool success = false; + object result = JSON.Json.Decode(packet.Payload, ref success); + if (success) + { + var errDict = result as Dictionary; + Error err; + + if (errDict != null && errDict.ContainsKey("code")) + err = new Error((SocketIOErrors)Convert.ToInt32(errDict["code"]), errDict["message"] as string); + else + err = new Error(SocketIOErrors.Custom, packet.Payload); + + EventCallbacks.Call(EventNames.GetNameFor(SocketIOEventTypes.Error), packet, err); + + return; + } + break; + } + + // Dispatch the event to all subscriber + EventCallbacks.Call(packet); + + // call Ack callbacks + if ((packet.SocketIOEvent == SocketIOEventTypes.Ack || packet.SocketIOEvent == SocketIOEventTypes.BinaryAck) && AckCallbacks != null) + { + SocketIOAckCallback ackCallback = null; + if (AckCallbacks.TryGetValue(packet.Id, out ackCallback) && + ackCallback != null) + { + try + { + ackCallback(this, packet, this.AutoDecodePayload ? packet.Decode(Manager.Encoder) : null); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("Socket", "ackCallback", ex); + } + } + + AckCallbacks.Remove(packet.Id); + } + } + + #endregion + + /// + /// Emits an internal packet-less event to the user level. + /// + void ISocket.EmitEvent(SocketIOEventTypes type, params object[] args) + { + (this as ISocket).EmitEvent(EventNames.GetNameFor(type), args); + } + + /// + /// Emits an internal packet-less event to the user level. + /// + void ISocket.EmitEvent(string eventName, params object[] args) + { + if (!string.IsNullOrEmpty(eventName)) + EventCallbacks.Call(eventName, null, args); + } + + void ISocket.EmitError(SocketIOErrors errCode, string msg) + { + (this as ISocket).EmitEvent(SocketIOEventTypes.Error, new Error(errCode, msg)); + } + + #region Private Helper Functions + + /// + /// Called when a "connect" event received to the root namespace + /// + private void OnTransportOpen(Socket socket, Packet packet, params object[] args) + { + // If this is not the root namespace, then we send a connect message to the server + if (this.Namespace != "/") + (Manager as IManager).SendPacket(new Packet(TransportEventTypes.Message, SocketIOEventTypes.Connect, this.Namespace, string.Empty)); + + // and we are now open + IsOpen = true; + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Socket.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Socket.cs.meta new file mode 100644 index 00000000..39295547 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Socket.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2087171a4dffa4f49a83c2c61d3debba +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketManager.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketManager.cs new file mode 100644 index 00000000..f17d1f96 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketManager.cs @@ -0,0 +1,684 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; +using System.Collections.Generic; + +using BestHTTP.SocketIO.Transports; +using BestHTTP.Extensions; +using BestHTTP.SocketIO.JsonEncoders; +using BestHTTP.SocketIO.Events; + +namespace BestHTTP.SocketIO +{ + public sealed class SocketManager : IHeartbeat, IManager + { + /// + /// Possible states of a SocketManager instance. + /// + public enum States + { + /// + /// Initial state of the SocketManager + /// + Initial, + + /// + /// The SocketManager is closed, initiated by the user or by the server + /// + Closed, + + /// + /// The SocketManager is currently opening. + /// + Opening, + + /// + /// The SocketManager is open, events can be sent to the server. + /// + Open, + + /// + /// Paused for transport upgrade + /// + Paused, + + /// + /// An error occurred, the SocketManager now trying to connect again to the server. + /// + Reconnecting + } + + /// + /// The default Json encode/decoder that will be used to encode/decode the event arguments. + /// + public static IJsonEncoder DefaultEncoder = new DefaultJSonEncoder(); + + /// + /// Supported Socket.IO protocol version + /// + public const int MinProtocolVersion = 4; + + #region Public Properties + + /// + /// The current state of this Socket.IO manager. + /// + public States State { get { return state; } private set { PreviousState = state; state = value; } } + private States state; + + /// + /// The SocketOptions instance that this manager will use. + /// + public SocketOptions Options { get; private set; } + + /// + /// The Uri to the Socket.IO endpoint. + /// + public Uri Uri { get; private set; } + + /// + /// The server sent and parsed Handshake data. + /// + public HandshakeData Handshake { get; private set; } + + /// + /// The currently used main transport instance. + /// + public ITransport Transport { get; private set; } + + /// + /// The Request counter for request-based transports. + /// + public ulong RequestCounter { get; internal set; } + + /// + /// The root("/") Socket. + /// + public Socket Socket { get { return GetSocket(); } } + + /// + /// Indexer to access socket associated to the given namespace. + /// + public Socket this[string nsp] { get { return GetSocket(nsp); } } + + /// + /// How many reconnect attempts made. + /// + public int ReconnectAttempts { get; private set; } + + /// + /// The JSon encoder that will be used to encode the sent data to json and decode the received json to an object list. + /// + public IJsonEncoder Encoder { get; set; } + + #endregion + + #region Internal Properties + + /// + /// Timestamp support to the request based transports. + /// + internal UInt32 Timestamp { get { return (UInt32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalMilliseconds; } } + + /// + /// Auto-incrementing property to return Ack ids. + /// + internal int NextAckId { get { return System.Threading.Interlocked.Increment(ref nextAckId); } } + private int nextAckId; + + /// + /// Internal property to store the previous state of the manager. + /// + internal States PreviousState { get; private set; } + + /// + /// Transport currently upgrading. + /// + internal ITransport UpgradingTransport { get; set; } + + #endregion + + #region Privates + + /// + /// Namespace name -> Socket mapping + /// + private Dictionary Namespaces = new Dictionary(); + + /// + /// List of the sockets to able to iterate over them easily. + /// + private List Sockets = new List(); + + /// + /// List of unsent packets. Only instantiated when we have to use it. + /// + private List OfflinePackets; + + /// + /// When we sent out the last heartbeat(Ping) message. + /// + private DateTime LastHeartbeat = DateTime.MinValue; + + /// + /// When we have to try to do a reconnect attempt + /// + private DateTime ReconnectAt; + + /// + /// When we started to connect to the server. + /// + private DateTime ConnectionStarted; + + /// + /// Private flag to avoid multiple Close call + /// + private bool closing; + + /// + /// Whether the connection is waiting for a ping response. + /// + private bool IsWaitingPong; + + #endregion + + #region Constructors + + /// + /// Constructor to create a SocketManager instance that will connect to the given uri. + /// + public SocketManager(Uri uri) + :this(uri, new SocketOptions()) + { + + } + + /// + /// Constructor to create a SocketManager instance. + /// + public SocketManager(Uri uri, SocketOptions options) + { + Uri = uri; + Options = options; + State = States.Initial; + PreviousState = States.Initial; + Encoder = SocketManager.DefaultEncoder; + } + + #endregion + + /// + /// Returns with the "/" namespace, the same as the Socket property. + /// + public Socket GetSocket() + { + return GetSocket("/"); + } + + /// + /// Returns with the specified namespace + /// + public Socket GetSocket(string nsp) + { + if (string.IsNullOrEmpty(nsp)) + throw new ArgumentNullException("Namespace parameter is null or empty!"); + + /*if (nsp[0] != '/') + nsp = "/" + nsp;*/ + + Socket socket = null; + if (!Namespaces.TryGetValue(nsp, out socket)) + { + // No socket found, create one + socket = new Socket(nsp, this); + + Namespaces.Add(nsp, socket); + Sockets.Add(socket); + + (socket as ISocket).Open(); + } + + return socket; + } + + /// + /// Internal function to remove a Socket instance from this manager. + /// + /// + void IManager.Remove(Socket socket) + { + Namespaces.Remove(socket.Namespace); + Sockets.Remove(socket); + + if (Sockets.Count == 0) + Close(); + } + + #region Connection to the server, and upgrading + + /// + /// This function will begin to open the Socket.IO connection by sending out the handshake request. + /// If the Options' AutoConnect is true, it will be called automatically. + /// + public void Open() + { + if (State != States.Initial && + State != States.Closed && + State != States.Reconnecting) + return; + + HTTPManager.Logger.Information("SocketManager", "Opening"); + + ReconnectAt = DateTime.MinValue; + + switch (Options.ConnectWith) + { + case TransportTypes.Polling: Transport = new PollingTransport(this); break; +#if !BESTHTTP_DISABLE_WEBSOCKET + case TransportTypes.WebSocket: Transport = new WebSocketTransport(this); break; +#endif + } + Transport.Open(); + + + (this as IManager).EmitEvent("connecting"); + + State = States.Opening; + + ConnectionStarted = DateTime.UtcNow; + + HTTPManager.Heartbeats.Subscribe(this); + + // The root namespace will be opened by default + GetSocket("/"); + } + + /// + /// Closes this Socket.IO connection. + /// + public void Close() + { + (this as IManager).Close(true); + } + + /// + /// Closes this Socket.IO connection. + /// + void IManager.Close(bool removeSockets) + { + if (State == States.Closed || closing) + return; + closing = true; + + HTTPManager.Logger.Information("SocketManager", "Closing"); + + HTTPManager.Heartbeats.Unsubscribe(this); + + // Disconnect the sockets. The Disconnect function will call the Remove function to remove it from the Sockets list. + if (removeSockets) + while (Sockets.Count > 0) + (Sockets[Sockets.Count - 1] as ISocket).Disconnect(removeSockets); + else + for (int i = 0; i < Sockets.Count; ++i) + (Sockets[i] as ISocket).Disconnect(removeSockets); + + // Set to Closed after Socket's Disconnect. This way we can send the disconnect events to the server. + State = States.Closed; + + LastHeartbeat = DateTime.MinValue; + + if (OfflinePackets != null) + OfflinePackets.Clear(); + + // Remove the references from the dictionary too. + if (removeSockets) + Namespaces.Clear(); + + Handshake = null; + + if (Transport != null) + Transport.Close(); + Transport = null; + + closing = false; + } + + /// + /// Called from a ITransport implementation when an error occurs and we may have to try to reconnect. + /// + void IManager.TryToReconnect() + { + if (State == States.Reconnecting || + State == States.Closed) + return; + + if (!Options.Reconnection || HTTPManager.IsQuitting) + { + Close(); + + return; + } + + if (++ReconnectAttempts >= Options.ReconnectionAttempts) + { + (this as IManager).EmitEvent("reconnect_failed"); + Close(); + + return; + } + + Random rand = new Random(); + + int delay = (int)Options.ReconnectionDelay.TotalMilliseconds * ReconnectAttempts; + + ReconnectAt = DateTime.UtcNow + + TimeSpan.FromMilliseconds(Math.Min(rand.Next(/*rand min:*/(int)(delay - (delay * Options.RandomizationFactor)), + /*rand max:*/(int)(delay + (delay * Options.RandomizationFactor))), + (int)Options.ReconnectionDelayMax.TotalMilliseconds)); + + (this as IManager).Close(false); + + State = States.Reconnecting; + + for (int i = 0; i < Sockets.Count; ++i) + (Sockets[i] as ISocket).Open(); + + // In the Close() function we unregistered + HTTPManager.Heartbeats.Subscribe(this); + + HTTPManager.Logger.Information("SocketManager", "Reconnecting"); + } + + /// + /// Called by transports when they are connected to the server. + /// + bool IManager.OnTransportConnected(ITransport trans) + { + if (State != States.Opening) + return false; + + if (PreviousState == States.Reconnecting) + (this as IManager).EmitEvent("reconnect"); + + State = States.Open; + + ReconnectAttempts = 0; + + // Send out packets that we collected while there were no available transport. + SendOfflinePackets(); + + HTTPManager.Logger.Information("SocketManager", "Open"); + +#if !BESTHTTP_DISABLE_WEBSOCKET + // Can we upgrade to WebSocket transport? + if (Transport.Type != TransportTypes.WebSocket && + Handshake.Upgrades.Contains("websocket")) + { + UpgradingTransport = new WebSocketTransport(this); + UpgradingTransport.Open(); + } +#endif + + return true; + } + + void IManager.OnTransportError(ITransport trans, string err) + { + (this as IManager).EmitError(SocketIOErrors.Internal, err); + + trans.Close(); + (this as IManager).TryToReconnect(); + } + + void IManager.OnTransportProbed(ITransport trans) + { + HTTPManager.Logger.Information("SocketManager", "\"probe\" packet received"); + + // If we have to reconnect, we will go straight with the transport we were able to upgrade + Options.ConnectWith = trans.Type; + + // Pause ourself to wait for any send and receive turn to finish. + State = States.Paused; + } + + #endregion + + #region Packet Handling + + /// + /// Select the best transport to send out packets. + /// + private ITransport SelectTransport() + { + if (State != States.Open || Transport == null) + return null; + + return Transport.IsRequestInProgress ? null : Transport; + } + + /// + /// Will select the best transport and sends out all packets that are in the OfflinePackets list. + /// + private void SendOfflinePackets() + { + ITransport trans = SelectTransport(); + + // Send out packets that we not sent while no transport was available. + // This function is called before the event handlers get the 'connected' event, so + // theoretically the packet orders are remains. + if (OfflinePackets != null && OfflinePackets.Count > 0 && trans != null) + { + trans.Send(OfflinePackets); + OfflinePackets.Clear(); + } + } + + /// + /// Internal function that called from the Socket class. It will send out the packet instantly, or if no transport is available it will store + /// the packet in the OfflinePackets list. + /// + void IManager.SendPacket(Packet packet) + { + ITransport trans = SelectTransport(); + + if (trans != null) + { + try + { + trans.Send(packet); + } + catch(Exception ex) + { + (this as IManager).EmitError(SocketIOErrors.Internal, ex.Message + " " + ex.StackTrace); + } + } + else + { + if (OfflinePackets == null) + OfflinePackets = new List(); + + // The same packet can be sent through multiple Sockets. + OfflinePackets.Add(packet.Clone()); + } + } + + /// + /// Called from the currently operating Transport. Will pass forward to the Socket that has to call the callbacks. + /// + void IManager.OnPacket(Packet packet) + { + if (State == States.Closed) + return; + + switch(packet.TransportEvent) + { + case TransportEventTypes.Open: + if (Handshake == null) + { + Handshake = new HandshakeData(); + if (!Handshake.Parse(packet.Payload)) + HTTPManager.Logger.Warning("SocketManager", "Expected handshake data, but wasn't able to pars. Payload: " + packet.Payload); + + (this as IManager).OnTransportConnected(Transport); + + return; + } + break; + + case TransportEventTypes.Ping: + (this as IManager).SendPacket(new Packet(TransportEventTypes.Pong, SocketIOEventTypes.Unknown, "/", string.Empty)); + break; + + case TransportEventTypes.Pong: + IsWaitingPong = false; + break; + } + + Socket socket = null; + if (Namespaces.TryGetValue(packet.Namespace, out socket)) + (socket as ISocket).OnPacket(packet); + else + HTTPManager.Logger.Warning("SocketManager", "Namespace \"" + packet.Namespace + "\" not found!"); + } + + #endregion + + /// + /// Sends an event to all available namespaces. + /// + public void EmitAll(string eventName, params object[] args) + { + for (int i = 0; i < Sockets.Count; ++i) + Sockets[i].Emit(eventName, args); + } + + /// + /// Emits an internal packet-less event to the root namespace without creating it if it isn't exists yet. + /// + void IManager.EmitEvent(string eventName, params object[] args) + { + Socket socket = null; + if (Namespaces.TryGetValue("/", out socket)) + (socket as ISocket).EmitEvent(eventName, args); + } + + /// + /// Emits an internal packet-less event to the root namespace without creating it if it isn't exists yet. + /// + void IManager.EmitEvent(SocketIOEventTypes type, params object[] args) + { + (this as IManager).EmitEvent(EventNames.GetNameFor(type), args); + } + + void IManager.EmitError(SocketIOErrors errCode, string msg) + { + (this as IManager).EmitEvent(SocketIOEventTypes.Error, new Error(errCode, msg)); + } + + void IManager.EmitAll(string eventName, params object[] args) + { + for (int i = 0; i < Sockets.Count; ++i) + (Sockets[i] as ISocket).EmitEvent(eventName, args); + } + + #region IHeartbeat Implementation + + /// + /// Called from the HTTPManager's OnUpdate function every frame. It's main function is to send out heartbeat messages. + /// + void IHeartbeat.OnHeartbeatUpdate(TimeSpan dif) + { + switch (State) + { + case States.Paused: + // To ensure no messages are lost, the upgrade packet will only be sent once all the buffers of the existing transport are flushed and the transport is considered paused. + if (!Transport.IsRequestInProgress && + !Transport.IsPollingInProgress) + { + State = States.Open; + + // Close the current transport + Transport.Close(); + + // and switch to the newly upgraded one + Transport = UpgradingTransport; + UpgradingTransport = null; + + // We will send an Upgrade("5") packet. + Transport.Send(new Packet(TransportEventTypes.Upgrade, SocketIOEventTypes.Unknown, "/", string.Empty)); + + goto case States.Open; + } + break; + + case States.Opening: + if (DateTime.UtcNow - ConnectionStarted >= Options.Timeout) + { + (this as IManager).EmitError(SocketIOErrors.Internal, "Connection timed out!"); + (this as IManager).EmitEvent("connect_error"); + (this as IManager).EmitEvent("connect_timeout"); + (this as IManager).TryToReconnect(); + } + + break; + + case States.Reconnecting: + if (ReconnectAt != DateTime.MinValue && DateTime.UtcNow >= ReconnectAt) + { + (this as IManager).EmitEvent("reconnect_attempt"); + (this as IManager).EmitEvent("reconnecting"); + + Open(); + } + break; + + case States.Open: + ITransport trans = null; + + // Select transport to use + if (Transport != null && Transport.State == TransportStates.Open) + trans = Transport; + + // not yet open? + if (trans == null || trans.State != TransportStates.Open) + return; + + // Start to poll the server for events + trans.Poll(); + + // Start to send out unsent packets + SendOfflinePackets(); + + // First time we reached this point. Set the LastHeartbeat to the current time, 'cause we are just opened. + if (LastHeartbeat == DateTime.MinValue) + { + LastHeartbeat = DateTime.UtcNow; + return; + } + + // It's time to send out a ping event to the server + if (!IsWaitingPong && DateTime.UtcNow - LastHeartbeat > Handshake.PingInterval) + { + (this as IManager).SendPacket(new Packet(TransportEventTypes.Ping, SocketIOEventTypes.Unknown, "/", string.Empty)); + + LastHeartbeat = DateTime.UtcNow; + IsWaitingPong = true; + } + + // No pong event received in the given time, we are disconnected. + if (IsWaitingPong && DateTime.UtcNow - LastHeartbeat > Handshake.PingTimeout) + { + IsWaitingPong = false; + (this as IManager).TryToReconnect(); + } + + break; // case States.Open: + } + } + + #endregion + + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketManager.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketManager.cs.meta new file mode 100644 index 00000000..6c5a75c4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketManager.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 71662b80689f3cc479fbd747b6b05ed4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketOptions.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketOptions.cs new file mode 100644 index 00000000..62596f55 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketOptions.cs @@ -0,0 +1,158 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; +using System.Text; + +using PlatformSupport.Collections.ObjectModel; + +#if !NETFX_CORE + using PlatformSupport.Collections.Specialized; +#else + using System.Collections.Specialized; +#endif + +namespace BestHTTP.SocketIO +{ + public sealed class SocketOptions + { + #region Properties + + /// + /// The SocketManager will try to connect with this transport. + /// + public Transports.TransportTypes ConnectWith { get; set; } + + /// + /// Whether to reconnect automatically after a disconnect (default true) + /// + public bool Reconnection { get; set; } + + /// + /// Number of attempts before giving up (default Int.MaxValue) + /// + public int ReconnectionAttempts { get; set; } + + /// + /// How long to initially wait before attempting a new reconnection (default 1000ms). + /// Affected by +/- RandomizationFactor, for example the default initial delay will be between 500ms to 1500ms. + /// + public TimeSpan ReconnectionDelay { get; set; } + + /// + /// Maximum amount of time to wait between reconnections (default 5000ms). + /// Each attempt increases the reconnection delay along with a randomization as above. + /// + public TimeSpan ReconnectionDelayMax { get; set; } + + /// + /// (default 0.5`), [0..1] + /// + public float RandomizationFactor { get { return randomizationFactor; } set { randomizationFactor = Math.Min(1.0f, Math.Max(0.0f, value)); } } + private float randomizationFactor; + + /// + /// Connection timeout before a connect_error and connect_timeout events are emitted (default 20000ms) + /// + public TimeSpan Timeout { get; set; } + + /// + /// By setting this false, you have to call SocketManager's Open() whenever you decide it's appropriate. + /// + public bool AutoConnect { get; set; } + + /// + /// Additional query parameters that will be passed for the handshake uri. If the value is null, or an empty string it will be not appended to the query only the key. + /// The keys and values must be escaped properly, as the plugin will not escape these. + /// + public ObservableDictionary AdditionalQueryParams + { + get { return additionalQueryParams; } + set + { + // Unsubscribe from previous dictionary's events + if (additionalQueryParams != null) + additionalQueryParams.CollectionChanged -= AdditionalQueryParams_CollectionChanged; + + additionalQueryParams = value; + + // Clear out the cached value + BuiltQueryParams = null; + + // Subscribe to the collection changed event + if (value != null) + value.CollectionChanged += AdditionalQueryParams_CollectionChanged; + } + } + private ObservableDictionary additionalQueryParams; + + /// + /// If it's false, the parameters in the AdditionalQueryParams will be passed for all HTTP requests. Its default value is true. + /// + public bool QueryParamsOnlyForHandshake { get; set; } + + #endregion + + /// + /// The cached value of the result of the BuildQueryParams() call. + /// + private string BuiltQueryParams; + + /// + /// Constructor, setting the default option values. + /// + public SocketOptions() + { + ConnectWith = Transports.TransportTypes.Polling; + Reconnection = true; + ReconnectionAttempts = int.MaxValue; + ReconnectionDelay = TimeSpan.FromMilliseconds(1000); + ReconnectionDelayMax = TimeSpan.FromMilliseconds(5000); + RandomizationFactor = 0.5f; + Timeout = TimeSpan.FromMilliseconds(20000); + AutoConnect = true; + QueryParamsOnlyForHandshake = true; + } + + #region Helper Functions + + /// + /// Builds the keys and values from the AdditionalQueryParams to an key=value form. If AdditionalQueryParams is null or empty, it will return an empty string. + /// + internal string BuildQueryParams() + { + if (AdditionalQueryParams == null || AdditionalQueryParams.Count == 0) + return string.Empty; + + if (!string.IsNullOrEmpty(BuiltQueryParams)) + return BuiltQueryParams; + + StringBuilder sb = new StringBuilder(AdditionalQueryParams.Count * 4); + + foreach(var kvp in AdditionalQueryParams) + { + sb.Append("&"); + sb.Append(kvp.Key); + + if (!string.IsNullOrEmpty(kvp.Value)) + { + sb.Append("="); + sb.Append(kvp.Value); + } + } + + return BuiltQueryParams = sb.ToString(); + } + + /// + /// This event will be called when the AdditonalQueryPrams dictionary changed. We have to reset the cached values. + /// + private void AdditionalQueryParams_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + BuiltQueryParams = null; + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketOptions.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketOptions.cs.meta new file mode 100644 index 00000000..6554f978 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/SocketOptions.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f6da26edefd917f4c9d36cc053c80415 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports.meta new file mode 100644 index 00000000..5358aa9e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: eaefe2a013280de43aa61175fa8c119a +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/ITransport.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/ITransport.cs new file mode 100644 index 00000000..abc84831 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/ITransport.cs @@ -0,0 +1,104 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System.Collections.Generic; + +namespace BestHTTP.SocketIO.Transports +{ + public enum TransportTypes + { + Polling, + +#if !BESTHTTP_DISABLE_WEBSOCKET + WebSocket +#endif + } + + /// + /// Possible states of an ITransport implementation. + /// + public enum TransportStates : int + { + /// + /// The transport is connecting to the server. + /// + Connecting = 0, + + /// + /// The transport is connected, and started the opening process. + /// + Opening = 1, + + /// + /// The transport is open, can send and receive packets. + /// + Open = 2, + + /// + /// The transport is closed. + /// + Closed = 3, + + /// + /// The transport is paused. + /// + Paused = 4 + } + + /// + /// An interface that a Socket.IO transport must implement. + /// + public interface ITransport + { + /// + /// Type of this transport. + /// + TransportTypes Type { get; } + + /// + /// Current state of the transport + /// + TransportStates State { get; } + + /// + /// SocketManager instance that this transport is bound to. + /// + SocketManager Manager { get; } + + /// + /// True if the transport is busy with sending messages. + /// + bool IsRequestInProgress { get; } + + /// + /// True if the transport is busy with a poll request. + /// + bool IsPollingInProgress { get; } + + /// + /// Start open/upgrade the transport. + /// + void Open(); + + /// + /// Do a poll for available messages on the server. + /// + void Poll(); + + /// + /// Send a single packet to the server. + /// + void Send(Packet packet); + + /// + /// Send a list of packets to the server. + /// + void Send(List packets); + + /// + /// Close this transport. + /// + void Close(); + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/ITransport.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/ITransport.cs.meta new file mode 100644 index 00000000..4b63c0c2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/ITransport.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c13819a2cd1052c4b8fd103084362fed +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/PollingTransport.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/PollingTransport.cs new file mode 100644 index 00000000..33e39c55 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/PollingTransport.cs @@ -0,0 +1,449 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; +using System.Text; + +namespace BestHTTP.SocketIO.Transports +{ + internal sealed class PollingTransport : ITransport + { + #region Public (ITransport) Properties + + public TransportTypes Type { get { return TransportTypes.Polling; } } + public TransportStates State { get; private set; } + public SocketManager Manager { get; private set; } + public bool IsRequestInProgress { get { return LastRequest != null; } } + public bool IsPollingInProgress { get { return PollRequest != null; } } + + #endregion + + #region Private Fields + + /// + /// The last POST request we sent to the server. + /// + private HTTPRequest LastRequest; + + /// + /// Last GET request we sent to the server. + /// + private HTTPRequest PollRequest; + + /// + /// The last packet with expected binary attachments + /// + private Packet PacketWithAttachment; + + #endregion + + private enum PayloadTypes : byte + { + Text, + Binary + } + + public PollingTransport(SocketManager manager) + { + Manager = manager; + } + + public void Open() + { + string format = "{0}?EIO={1}&transport=polling&t={2}-{3}{5}"; + if (Manager.Handshake != null) + format += "&sid={4}"; + + bool sendAdditionalQueryParams = !Manager.Options.QueryParamsOnlyForHandshake || (Manager.Options.QueryParamsOnlyForHandshake && Manager.Handshake == null); + + HTTPRequest request = new HTTPRequest(new Uri(string.Format(format, + Manager.Uri.ToString(), + SocketManager.MinProtocolVersion, + Manager.Timestamp.ToString(), + Manager.RequestCounter++.ToString(), + Manager.Handshake != null ? Manager.Handshake.Sid : string.Empty, + sendAdditionalQueryParams ? Manager.Options.BuildQueryParams() : string.Empty)), + OnRequestFinished); + +#if !BESTHTTP_DISABLE_CACHING + // Don't even try to cache it + request.DisableCache = true; +#endif + + request.DisableRetry = true; + + request.Send(); + + State = TransportStates.Opening; + } + + /// + /// Closes the transport and cleans up resources. + /// + public void Close() + { + if (State == TransportStates.Closed) + return; + + State = TransportStates.Closed; + + /* + if (LastRequest != null) + LastRequest.Abort(); + + if (PollRequest != null) + PollRequest.Abort();*/ + } + + #region Packet Sending Implementation + + private System.Collections.Generic.List lonelyPacketList = new System.Collections.Generic.List(1); + public void Send(Packet packet) + { + try + { + lonelyPacketList.Add(packet); + Send(lonelyPacketList); + } + finally + { + lonelyPacketList.Clear(); + } + } + + public void Send(System.Collections.Generic.List packets) + { + if (State != TransportStates.Opening && State != TransportStates.Open) + return; + + if (IsRequestInProgress) + throw new Exception("Sending packets are still in progress!"); + + byte[] buffer = null; + + try + { + buffer = packets[0].EncodeBinary(); + + for (int i = 1; i < packets.Count; ++i) + { + byte[] tmpBuffer = packets[i].EncodeBinary(); + + Array.Resize(ref buffer, buffer.Length + tmpBuffer.Length); + + Array.Copy(tmpBuffer, 0, buffer, buffer.Length - tmpBuffer.Length, tmpBuffer.Length); + } + + packets.Clear(); + } + catch (Exception ex) + { + (Manager as IManager).EmitError(SocketIOErrors.Internal, ex.Message + " " + ex.StackTrace); + return; + } + + LastRequest = new HTTPRequest(new Uri(string.Format("{0}?EIO={1}&transport=polling&t={2}-{3}&sid={4}{5}", + Manager.Uri.ToString(), + SocketManager.MinProtocolVersion, + Manager.Timestamp.ToString(), + Manager.RequestCounter++.ToString(), + Manager.Handshake.Sid, + !Manager.Options.QueryParamsOnlyForHandshake ? Manager.Options.BuildQueryParams() : string.Empty)), + HTTPMethods.Post, + OnRequestFinished); + + +#if !BESTHTTP_DISABLE_CACHING + // Don't even try to cache it + LastRequest.DisableCache = true; +#endif + + LastRequest.SetHeader("Content-Type", "application/octet-stream"); + LastRequest.RawData = buffer; + + LastRequest.Send(); + } + + private void OnRequestFinished(HTTPRequest req, HTTPResponse resp) + { + // Clear out the LastRequest variable, so we can start sending out new packets + LastRequest = null; + + if (State == TransportStates.Closed) + return; + + string errorString = null; + + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (HTTPManager.Logger.Level <= BestHTTP.Logger.Loglevels.All) + HTTPManager.Logger.Verbose("PollingTransport", "OnRequestFinished: " + resp.DataAsText); + + if (resp.IsSuccess) + { + // When we are sending data, the response is an 'ok' string + if (req.MethodType != HTTPMethods.Post) + ParseResponse(resp); + } + else + errorString = string.Format("Polling - Request finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2} Uri: {3}", + resp.StatusCode, + resp.Message, + resp.DataAsText, + req.CurrentUri); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + errorString = (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + errorString = string.Format("Polling - Request({0}) Aborted!", req.CurrentUri); + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + errorString = string.Format("Polling - Connection Timed Out! Uri: {0}", req.CurrentUri); + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + errorString = string.Format("Polling - Processing the request({0}) Timed Out!", req.CurrentUri); + break; + } + + if (!string.IsNullOrEmpty(errorString)) + (Manager as IManager).OnTransportError(this, errorString); + } + + #endregion + + #region Polling Implementation + + public void Poll() + { + if (PollRequest != null || State == TransportStates.Paused) + return; + + PollRequest = new HTTPRequest(new Uri(string.Format("{0}?EIO={1}&transport=polling&t={2}-{3}&sid={4}{5}", + Manager.Uri.ToString(), + SocketManager.MinProtocolVersion, + Manager.Timestamp.ToString(), + Manager.RequestCounter++.ToString(), + Manager.Handshake.Sid, + !Manager.Options.QueryParamsOnlyForHandshake ? Manager.Options.BuildQueryParams() : string.Empty)), + HTTPMethods.Get, + OnPollRequestFinished); + +#if !BESTHTTP_DISABLE_CACHING + // Don't even try to cache it + PollRequest.DisableCache = true; +#endif + + PollRequest.DisableRetry = true; + + PollRequest.Send(); + } + + private void OnPollRequestFinished(HTTPRequest req, HTTPResponse resp) + { + // Clear the PollRequest variable, so we can start a new poll. + PollRequest = null; + + if (State == TransportStates.Closed) + return; + + string errorString = null; + + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + + if (HTTPManager.Logger.Level <= BestHTTP.Logger.Loglevels.All) + HTTPManager.Logger.Verbose("PollingTransport", "OnPollRequestFinished: " + resp.DataAsText); + + if (resp.IsSuccess) + ParseResponse(resp); + else + errorString = string.Format("Polling - Request finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2} Uri: {3}", + resp.StatusCode, + resp.Message, + resp.DataAsText, + req.CurrentUri); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + errorString = req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"; + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + errorString = string.Format("Polling - Request({0}) Aborted!", req.CurrentUri); + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + errorString = string.Format("Polling - Connection Timed Out! Uri: {0}", req.CurrentUri); + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + errorString = string.Format("Polling - Processing the request({0}) Timed Out!", req.CurrentUri); + break; + } + + if (!string.IsNullOrEmpty(errorString)) + (Manager as IManager).OnTransportError(this, errorString); + } + + #endregion + + #region Packet Parsing and Handling + + /// + /// Preprocessing and sending out packets to the manager. + /// + private void OnPacket(Packet packet) + { + if (packet.AttachmentCount != 0 && !packet.HasAllAttachment) + { + PacketWithAttachment = packet; + return; + } + + switch (packet.TransportEvent) + { + case TransportEventTypes.Open: + if (this.State != TransportStates.Opening) + HTTPManager.Logger.Warning("PollingTransport", "Received 'Open' packet while state is '" + State.ToString() + "'"); + else + State = TransportStates.Open; + goto default; + + case TransportEventTypes.Message: + if (packet.SocketIOEvent == SocketIOEventTypes.Connect) //2:40 + this.State = TransportStates.Open; + goto default; + + default: + (Manager as IManager).OnPacket(packet); + break; + } + } + + /// + /// Will parse the response, and send out the parsed packets. + /// + private void ParseResponse(HTTPResponse resp) + { + try + { + if (resp != null && resp.Data != null && resp.Data.Length >= 1) + { + +// 1.x +//00000000 00 09 07 ff 30 7b 22 73 69 64 22 3a 22 6f 69 48 0{"sid":"oiH +//00000010 34 31 33 73 61 49 4e 52 53 67 37 41 4b 41 41 41 413saINRSg7AKAAA +//00000020 41 22 2c 22 75 70 67 72 61 64 65 73 22 3a 5b 22 A","upgrades":[" +//00000030 77 65 62 73 6f 63 6b 65 74 22 5d 2c 22 70 69 6e websocket"],"pin +//00000040 67 49 6e 74 65 72 76 61 6c 22 3a 32 35 30 30 30 gInterval":25000 +//00000050 2c 22 70 69 6e 67 54 69 6d 65 6f 75 74 22 3a 36 ,"pingTimeout":6 +//00000060 30 30 30 30 7d 0000} + +// 2.x +//00000000 39 37 3a 30 7b 22 73 69 64 22 3a 22 73 36 62 5a 97:0{"sid":"s6bZ +//00000010 6c 43 37 66 51 59 6b 4f 46 4f 62 35 41 41 41 41 lC7fQYkOFOb5AAAA +//00000020 22 2c 22 75 70 67 72 61 64 65 73 22 3a 5b 22 77 ","upgrades":["w +//00000030 65 62 73 6f 63 6b 65 74 22 5d 2c 22 70 69 6e 67 ebsocket"],"ping +//00000040 49 6e 74 65 72 76 61 6c 22 3a 32 35 30 30 30 2c Interval":25000, +//00000050 22 70 69 6e 67 54 69 6d 65 6f 75 74 22 3a 36 30 "pingTimeout":60 +//00000060 30 30 30 7d 32 3a 34 30 000}2:40 + + int idx = 0; + + while (idx < resp.Data.Length) + { + PayloadTypes type = PayloadTypes.Text; + int length = 0; + + if (resp.Data[idx] < '0') { + type = (PayloadTypes)resp.Data[idx++]; + + byte num = resp.Data[idx++]; + while (num != 0xFF) { + length = (length * 10) + num; + num = resp.Data[idx++]; + } + } + else { + byte next = resp.Data[idx++]; + while (next != ':') { + length = (length * 10) + (next - '0'); + next = resp.Data[idx++]; + } + } + + Packet packet = null; + switch(type) + { + case PayloadTypes.Text: + packet = new Packet(Encoding.UTF8.GetString(resp.Data, idx, length)); + break; + case PayloadTypes.Binary: + if (PacketWithAttachment != null) + { + // First byte is the packet type. We can skip it, so we advance our idx and we also have + // to decrease length + idx++; + length--; + + byte[] buffer = new byte[length]; + Array.Copy(resp.Data, idx, buffer, 0, length); + + PacketWithAttachment.AddAttachmentFromServer(buffer, true); + + if (PacketWithAttachment.HasAllAttachment) + { + packet = PacketWithAttachment; + PacketWithAttachment = null; + } + } + break; + } // switch + + if (packet != null) + { + try + { + OnPacket(packet); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("PollingTransport", "ParseResponse - OnPacket", ex); + (Manager as IManager).EmitError(SocketIOErrors.Internal, ex.Message + " " + ex.StackTrace); + } + } + + idx += length; + + }// while + } + } + catch (Exception ex) + { + (Manager as IManager).EmitError(SocketIOErrors.Internal, ex.Message + " " + ex.StackTrace); + + HTTPManager.Logger.Exception("PollingTransport", "ParseResponse", ex); + } + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/PollingTransport.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/PollingTransport.cs.meta new file mode 100644 index 00000000..70a0afb9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/PollingTransport.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d38d2293870da854287018c9eb086861 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/WebSocketTransport.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/WebSocketTransport.cs new file mode 100644 index 00000000..56168e9a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/WebSocketTransport.cs @@ -0,0 +1,369 @@ +#if !BESTHTTP_DISABLE_SOCKETIO +#if !BESTHTTP_DISABLE_WEBSOCKET + +using System; +using System.Collections.Generic; + +namespace BestHTTP.SocketIO.Transports +{ + using BestHTTP.WebSocket; + using Extensions; + + /// + /// A transport implementation that can communicate with a SocketIO server. + /// + internal sealed class WebSocketTransport : ITransport + { + public TransportTypes Type { get { return TransportTypes.WebSocket; } } + public TransportStates State { get; private set; } + public SocketManager Manager { get; private set; } + public bool IsRequestInProgress { get { return false; } } + public bool IsPollingInProgress { get { return false; } } + public WebSocket Implementation { get; private set; } + + private Packet PacketWithAttachment; + private byte[] Buffer; + + public WebSocketTransport(SocketManager manager) + { + State = TransportStates.Closed; + Manager = manager; + } + + #region Some ITransport Implementation + + public void Open() + { + if (State != TransportStates.Closed) + return; + + Uri uri = null; + string baseUrl = new UriBuilder(HTTPProtocolFactory.IsSecureProtocol(Manager.Uri) ? "wss" : "ws", + Manager.Uri.Host, + Manager.Uri.Port, + Manager.Uri.GetRequestPathAndQueryURL()).Uri.ToString(); + string format = "{0}?EIO={1}&transport=websocket{3}"; + if (Manager.Handshake != null) + format += "&sid={2}"; + + bool sendAdditionalQueryParams = !Manager.Options.QueryParamsOnlyForHandshake || (Manager.Options.QueryParamsOnlyForHandshake && Manager.Handshake == null); + + uri = new Uri(string.Format(format, + baseUrl, + SocketManager.MinProtocolVersion, + Manager.Handshake != null ? Manager.Handshake.Sid : string.Empty, + sendAdditionalQueryParams ? Manager.Options.BuildQueryParams() : string.Empty)); + + Implementation = new WebSocket(uri); + + Implementation.OnOpen = OnOpen; + Implementation.OnMessage = OnMessage; + Implementation.OnBinary = OnBinary; + Implementation.OnError = OnError; + Implementation.OnClosed = OnClosed; + + Implementation.Open(); + + State = TransportStates.Connecting; + } + + /// + /// Closes the transport and cleans up resources. + /// + public void Close() + { + if (State == TransportStates.Closed) + return; + + State = TransportStates.Closed; + + if (Implementation != null) + Implementation.Close(); + else + HTTPManager.Logger.Warning("WebSocketTransport", "Close - WebSocket Implementation already null!"); + Implementation = null; + } + + /// + /// Polling implementation. With WebSocket it's just a skeleton. + /// + public void Poll() + { + } + + #endregion + + #region WebSocket Events + + /// + /// WebSocket implementation OnOpen event handler. + /// + private void OnOpen(WebSocket ws) + { + if (ws != Implementation) + return; + + HTTPManager.Logger.Information("WebSocketTransport", "OnOpen"); + + State = TransportStates.Opening; + + // Send a Probe packet to test the transport. If we receive back a pong with the same payload we can upgrade + if (Manager.UpgradingTransport == this) + Send(new Packet(TransportEventTypes.Ping, SocketIOEventTypes.Unknown, "/", "probe")); + } + + /// + /// WebSocket implementation OnMessage event handler. + /// + private void OnMessage(WebSocket ws, string message) + { + if (ws != Implementation) + return; + + if (HTTPManager.Logger.Level <= BestHTTP.Logger.Loglevels.All) + HTTPManager.Logger.Verbose("WebSocketTransport", "OnMessage: " + message); + + Packet packet = null; + try + { + packet = new Packet(message); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocketTransport", "OnMessage Packet parsing", ex); + } + + if (packet == null) + { + HTTPManager.Logger.Error("WebSocketTransport", "Message parsing failed. Message: " + message); + return; + } + + try + { + + if (packet.AttachmentCount == 0) + OnPacket(packet); + else + PacketWithAttachment = packet; + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocketTransport", "OnMessage OnPacket", ex); + } + } + + /// + /// WebSocket implementation OnBinary event handler. + /// + private void OnBinary(WebSocket ws, byte[] data) + { + if (ws != Implementation) + return; + + if (HTTPManager.Logger.Level <= BestHTTP.Logger.Loglevels.All) + HTTPManager.Logger.Verbose("WebSocketTransport", "OnBinary"); + + if (PacketWithAttachment != null) + { + PacketWithAttachment.AddAttachmentFromServer(data, false); + + if (PacketWithAttachment.HasAllAttachment) + { + try + { + OnPacket(PacketWithAttachment); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocketTransport", "OnBinary", ex); + } + finally + { + PacketWithAttachment = null; + } + } + } + else + { + // TODO: we received an unwanted binary message? + } + } + + /// + /// WebSocket implementation OnError event handler. + /// + private void OnError(WebSocket ws, Exception ex) + { + if (ws != Implementation) + return; + + string errorStr = string.Empty; + + if (ex != null) + errorStr = (ex.Message + " " + ex.StackTrace); + else + { +#if !UNITY_WEBGL || UNITY_EDITOR + switch (ws.InternalRequest.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (ws.InternalRequest.Response.IsSuccess || ws.InternalRequest.Response.StatusCode == 101) + errorStr = string.Format("Request finished. Status Code: {0} Message: {1}", ws.InternalRequest.Response.StatusCode.ToString(), ws.InternalRequest.Response.Message); + else + errorStr = string.Format("Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + ws.InternalRequest.Response.StatusCode, + ws.InternalRequest.Response.Message, + ws.InternalRequest.Response.DataAsText); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + errorStr = "Request Finished with Error! : " + ws.InternalRequest.Exception != null ? (ws.InternalRequest.Exception.Message + " " + ws.InternalRequest.Exception.StackTrace) : string.Empty; + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + errorStr = "Request Aborted!"; + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + errorStr = "Connection Timed Out!"; + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + errorStr = "Processing the request Timed Out!"; + break; + } +#endif + } + + if (Manager.UpgradingTransport != this) + (Manager as IManager).OnTransportError(this, errorStr); + else + Manager.UpgradingTransport = null; + } + + /// + /// WebSocket implementation OnClosed event handler. + /// + private void OnClosed(WebSocket ws, ushort code, string message) + { + if (ws != Implementation) + return; + + HTTPManager.Logger.Information("WebSocketTransport", "OnClosed"); + + Close(); + + if (Manager.UpgradingTransport != this) + (Manager as IManager).TryToReconnect(); + else + Manager.UpgradingTransport = null; + } + +#endregion + +#region Packet Sending Implementation + + /// + /// A WebSocket implementation of the packet sending. + /// + public void Send(Packet packet) + { + if (State == TransportStates.Closed || + State == TransportStates.Paused) + return; + + string encoded = packet.Encode(); + + if (HTTPManager.Logger.Level <= BestHTTP.Logger.Loglevels.All) + HTTPManager.Logger.Verbose("WebSocketTransport", "Send: " + encoded); + + if (packet.AttachmentCount != 0 || (packet.Attachments != null && packet.Attachments.Count != 0)) + { + if (packet.Attachments == null) + throw new ArgumentException("packet.Attachments are null!"); + + if (packet.AttachmentCount != packet.Attachments.Count) + throw new ArgumentException("packet.AttachmentCount != packet.Attachments.Count. Use the packet.AddAttachment function to add data to a packet!"); + } + + Implementation.Send(encoded); + + if (packet.AttachmentCount != 0) + { + int maxLength = packet.Attachments[0].Length + 1; + for (int cv = 1; cv < packet.Attachments.Count; ++cv) + if ((packet.Attachments[cv].Length + 1) > maxLength) + maxLength = packet.Attachments[cv].Length + 1; + + if (Buffer == null || Buffer.Length < maxLength) + Array.Resize(ref Buffer, maxLength); + + for (int i = 0; i < packet.AttachmentCount; i++) + { + Buffer[0] = (byte)TransportEventTypes.Message; + + Array.Copy(packet.Attachments[i], 0, Buffer, 1, packet.Attachments[i].Length); + + Implementation.Send(Buffer, 0, (ulong)packet.Attachments[i].Length + 1UL); + } + } + } + + /// + /// A WebSocket implementation of the packet sending. + /// + public void Send(List packets) + { + for (int i = 0; i < packets.Count; ++i) + Send(packets[i]); + + packets.Clear(); + } + +#endregion + +#region Packet Handling + + /// + /// Will only process packets that need to upgrade. All other packets are passed to the Manager. + /// + private void OnPacket(Packet packet) + { + switch (packet.TransportEvent) + { + case TransportEventTypes.Open: + if (this.State != TransportStates.Opening) + HTTPManager.Logger.Warning("WebSocketTransport", "Received 'Open' packet while state is '" + State.ToString() + "'"); + else + State = TransportStates.Open; + goto default; + + case TransportEventTypes.Pong: + // Answer for a Ping Probe. + if (packet.Payload == "probe") + { + State = TransportStates.Open; + (Manager as IManager).OnTransportProbed(this); + } + + goto default; + + default: + if (Manager.UpgradingTransport != this) + (Manager as IManager).OnPacket(packet); + break; + } + } + +#endregion + } +} + +#endif +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/WebSocketTransport.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/WebSocketTransport.cs.meta new file mode 100644 index 00000000..cdaa9aa7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/SocketIO/Transports/WebSocketTransport.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 28075d7868e0f0845ab98be53d258c85 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics.meta new file mode 100644 index 00000000..c4e77194 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c93e4b20636a0bc4085d9712e1ca585d +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics/Statistics.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics/Statistics.cs new file mode 100644 index 00000000..8d577387 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics/Statistics.cs @@ -0,0 +1,90 @@ +using System; + +namespace BestHTTP.Statistics +{ + [Flags] + public enum StatisticsQueryFlags : byte + { + /// + /// Connection based statistics will be returned as the result of the query. + /// + Connections = 0x01, + + /// + /// Caching based statistics will be returned as the result of the query. + /// + Cache = 0x02, + + /// + /// Cookie based statistics will be returned as the result of the query. + /// + Cookies = 0x04, + + /// + /// All statistics will be returned as the result of the query. + /// + All = 0xFF, + } + + public struct GeneralStatistics + { + public StatisticsQueryFlags QueryFlags; + + #region Connection Statistics + + /// + /// Number of HTTPConnection instances + /// + public int Connections; + + /// + /// Number of active connections. These connections are currently processing a request. + /// + public int ActiveConnections; + + /// + /// Number of free connections. These connections are finished with there requests and waiting for another request or to recycle. + /// + public int FreeConnections; + + /// + /// Number of recycled connections. These connections will be removed as soon as possible. + /// + public int RecycledConnections; + + /// + /// Number of requests that are waiting in the queue for a free connection. + /// + public int RequestsInQueue; + + #endregion + + #region Cache Statistics + + /// + /// Number of cached responses. + /// + public int CacheEntityCount; + + /// + /// Sum size of the cached responses in bytes. + /// + public ulong CacheSize; + + #endregion + + #region Cookie Statistics + + /// + /// Number of cookies in the Cookie Jar. + /// + public int CookieCount; + + /// + /// Sum size of the stored cookies in bytes. + /// + public uint CookieJarSize; + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics/Statistics.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics/Statistics.cs.meta new file mode 100644 index 00000000..fe4e2767 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/Statistics/Statistics.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5f393cb0ae396954a8658922a9824064 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket.meta new file mode 100644 index 00000000..6d10d98f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7b831e0970fca74409c9458a8a6774de +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions.meta new file mode 100644 index 00000000..53aae1ea --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5e44072d24b360245b3b38f37c984cee +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/IExtension.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/IExtension.cs new file mode 100644 index 00000000..082c2fdf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/IExtension.cs @@ -0,0 +1,41 @@ +#if !BESTHTTP_DISABLE_WEBSOCKET && (!UNITY_WEBGL || UNITY_EDITOR) + +using BestHTTP.WebSocket.Frames; + +namespace BestHTTP.WebSocket.Extensions +{ + public interface IExtension + { + /// + /// This is the first pass: here we can add headers to the request to initiate an extension negotiation. + /// + /// + void AddNegotiation(HTTPRequest request); + + /// + /// If the websocket upgrade succeded it will call this function to be able to parse the server's negotiation + /// response. Inside this function the IsEnabled should be set. + /// + bool ParseNegotiation(WebSocketResponse resp); + + /// + /// This function should return a new header flag based on the inFlag parameter. The extension should set only the + /// Rsv1-3 bits in the header. + /// + byte GetFrameHeader(WebSocketFrame writer, byte inFlag); + + /// + /// This function will be called to be able to transform the data that will be sent to the server. + /// + /// + /// + byte[] Encode(WebSocketFrame writer); + + /// + /// This function can be used the decode the server-sent data. + /// + byte[] Decode(byte header, byte[] data, int length); + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/IExtension.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/IExtension.cs.meta new file mode 100644 index 00000000..9d0c5e91 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/IExtension.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 0ef9ac8246255ea449a40171fb654053 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/PerMessageCompression.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/PerMessageCompression.cs new file mode 100644 index 00000000..82830daa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/PerMessageCompression.cs @@ -0,0 +1,338 @@ +#if !BESTHTTP_DISABLE_WEBSOCKET && (!UNITY_WEBGL || UNITY_EDITOR) + +using System; +using BestHTTP.Extensions; +using BestHTTP.WebSocket.Frames; +using BestHTTP.Decompression.Zlib; + +namespace BestHTTP.WebSocket.Extensions +{ + /// + /// Compression Extensions for WebSocket implementation. + /// http://tools.ietf.org/html/rfc7692 + /// + public sealed class PerMessageCompression : IExtension + { + public const int MinDataLengthToCompressDefault = 256; + + private static readonly byte[] Trailer = new byte[] { 0x00, 0x00, 0xFF, 0xFF }; + + #region Public Properties + + /// + /// By including this extension parameter in an extension negotiation offer, a client informs the peer server + /// of a hint that even if the server doesn't include the "client_no_context_takeover" extension parameter in + /// the corresponding extension negotiation response to the offer, the client is not going to use context takeover. + /// + public bool ClientNoContextTakeover { get; private set; } + + /// + /// By including this extension parameter in an extension negotiation offer, a client prevents the peer server from using context takeover. + /// + public bool ServerNoContextTakeover { get; private set; } + + /// + /// This parameter indicates the base-2 logarithm of the LZ77 sliding window size of the client context. + /// + public int ClientMaxWindowBits { get; private set; } + + /// + /// This parameter indicates the base-2 logarithm of the LZ77 sliding window size of the server context. + /// + public int ServerMaxWindowBits { get; private set; } + + /// + /// The compression level that the client will use to compress the frames. + /// + public CompressionLevel Level { get; private set; } + + /// + /// What minimum data length will trigger the compression. + /// + public int MinimumDataLegthToCompress { get; set; } + + #endregion + + #region Private fields + + /// + /// Cached object to support context takeover. + /// + private BufferPoolMemoryStream compressorOutputStream; + private DeflateStream compressorDeflateStream; + + /// + /// Cached object to support context takeover. + /// + private BufferPoolMemoryStream decompressorInputStream; + private BufferPoolMemoryStream decompressorOutputStream; + private DeflateStream decompressorDeflateStream; + + #endregion + + public PerMessageCompression() + :this(CompressionLevel.Default, false, false, ZlibConstants.WindowBitsMax, ZlibConstants.WindowBitsMax, MinDataLengthToCompressDefault) + { } + + public PerMessageCompression(CompressionLevel level, + bool clientNoContextTakeover, + bool serverNoContextTakeover, + int desiredClientMaxWindowBits, + int desiredServerMaxWindowBits, + int minDatalengthToCompress) + { + this.Level = level; + this.ClientNoContextTakeover = clientNoContextTakeover; + this.ServerNoContextTakeover = ServerNoContextTakeover; + this.ClientMaxWindowBits = desiredClientMaxWindowBits; + this.ServerMaxWindowBits = desiredServerMaxWindowBits; + this.MinimumDataLegthToCompress = minDatalengthToCompress; + } + + #region IExtension Implementation + + /// + /// This will start the permessage-deflate negotiation process. + /// + /// + public void AddNegotiation(HTTPRequest request) + { + // The default header value that we will send out minimum. + string headerValue = "permessage-deflate"; + + + // http://tools.ietf.org/html/rfc7692#section-7.1.1.1 + // A client MAY include the "server_no_context_takeover" extension parameter in an extension negotiation offer. This extension parameter has no value. + // By including this extension parameter in an extension negotiation offer, a client prevents the peer server from using context takeover. + // If the peer server doesn't use context takeover, the client doesn't need to reserve memory to retain the LZ77 sliding window between messages. + if (this.ServerNoContextTakeover) + headerValue += "; server_no_context_takeover"; + + + // http://tools.ietf.org/html/rfc7692#section-7.1.1.2 + // A client MAY include the "client_no_context_takeover" extension parameter in an extension negotiation offer. + // This extension parameter has no value. By including this extension parameter in an extension negotiation offer, + // a client informs the peer server of a hint that even if the server doesn't include the "client_no_context_takeover" + // extension parameter in the corresponding extension negotiation response to the offer, the client is not going to use context takeover. + if (this.ClientNoContextTakeover) + headerValue += "; client_no_context_takeover"; + + // http://tools.ietf.org/html/rfc7692#section-7.1.2.1 + // By including this parameter in an extension negotiation offer, a client limits the LZ77 sliding window size that the server + // will use to compress messages.If the peer server uses a small LZ77 sliding window to compress messages, the client can reduce the memory needed for the LZ77 sliding window. + if (this.ServerMaxWindowBits != ZlibConstants.WindowBitsMax) + headerValue += "; server_max_window_bits=" + this.ServerMaxWindowBits.ToString(); + else + // Absence of this parameter in an extension negotiation offer indicates that the client can receive messages compressed using an LZ77 sliding window of up to 32,768 bytes. + this.ServerMaxWindowBits = ZlibConstants.WindowBitsMax; + + // http://tools.ietf.org/html/rfc7692#section-7.1.2.2 + // By including this parameter in an offer, a client informs the peer server that the client supports the "client_max_window_bits" + // extension parameter in an extension negotiation response and, optionally, a hint by attaching a value to the parameter. + if (this.ClientMaxWindowBits != ZlibConstants.WindowBitsMax) + headerValue += "; client_max_window_bits=" + this.ClientMaxWindowBits.ToString(); + else + { + headerValue += "; client_max_window_bits"; + + // If the "client_max_window_bits" extension parameter in an extension negotiation offer has a value, the parameter also informs the + // peer server of a hint that even if the server doesn't include the "client_max_window_bits" extension parameter in the corresponding + // extension negotiation response with a value greater than the one in the extension negotiation offer or if the server doesn't include + // the extension parameter at all, the client is not going to use an LZ77 sliding window size greater than the size specified + // by the value in the extension negotiation offer to compress messages. + this.ClientMaxWindowBits = ZlibConstants.WindowBitsMax; + } + + // Add the new header to the request. + request.AddHeader("Sec-WebSocket-Extensions", headerValue); + } + + public bool ParseNegotiation(WebSocketResponse resp) + { + // Search for any returned neogitation offer + var headerValues = resp.GetHeaderValues("Sec-WebSocket-Extensions"); + if (headerValues == null) + return false; + + for (int i = 0; i < headerValues.Count; ++i) + { + // If found, tokenize it + HeaderParser parser = new HeaderParser(headerValues[i]); + + for (int cv = 0; cv < parser.Values.Count; ++cv) + { + HeaderValue value = parser.Values[i]; + + if (!string.IsNullOrEmpty(value.Key) && value.Key.StartsWith("permessage-deflate", StringComparison.OrdinalIgnoreCase)) + { + HTTPManager.Logger.Information("PerMessageCompression", "Enabled with header: " + headerValues[i]); + + HeaderValue option; + if (value.TryGetOption("client_no_context_takeover", out option)) + this.ClientNoContextTakeover = true; + + if (value.TryGetOption("server_no_context_takeover", out option)) + this.ServerNoContextTakeover = true; + + if (value.TryGetOption("client_max_window_bits", out option)) + if (option.HasValue) + { + int windowBits; + if (int.TryParse(option.Value, out windowBits)) + this.ClientMaxWindowBits = windowBits; + } + + if (value.TryGetOption("server_max_window_bits", out option)) + if (option.HasValue) + { + int windowBits; + if (int.TryParse(option.Value, out windowBits)) + this.ServerMaxWindowBits = windowBits; + } + + return true; + } + } + } + + return false; + } + + /// + /// IExtension implementation to set the Rsv1 flag in the header if we are we will want to compress the data + /// in the writer. + /// + public byte GetFrameHeader(WebSocketFrame writer, byte inFlag) + { + // http://tools.ietf.org/html/rfc7692#section-7.2.3.1 + // the RSV1 bit is set only on the first frame. + if ((writer.Type == WebSocketFrameTypes.Binary || writer.Type == WebSocketFrameTypes.Text) && + writer.Data != null && writer.Data.Length >= this.MinimumDataLegthToCompress) + return (byte)(inFlag | 0x40); + else + return inFlag; + } + + /// + /// IExtension implementation to be able to compress the data hold in the writer. + /// + public byte[] Encode(WebSocketFrame writer) + { + if (writer.Data == null) + return VariableSizedBufferPool.NoData; + + // Is compressing enabled for this frame? If so, compress it. + if ((writer.Header & 0x40) != 0) + return Compress(writer.Data, writer.DataLength); + else + return writer.Data; + } + + /// + /// IExtension implementation to possible decompress the data. + /// + public byte[] Decode(byte header, byte[] data, int length) + { + // Is the server compressed the data? If so, decompress it. + if ((header & 0x40) != 0) + return Decompress(data, length); + else + return data; + } + + #endregion + + #region Private Helper Functions + + /// + /// A function to compress and return the data parameter with possible context takeover support (reusing the DeflateStream). + /// + private byte[] Compress(byte[] data, int length) + { + if (compressorOutputStream == null) + compressorOutputStream = new BufferPoolMemoryStream(); + compressorOutputStream.SetLength(0); + + if (compressorDeflateStream == null) + { + compressorDeflateStream = new DeflateStream(compressorOutputStream, CompressionMode.Compress, this.Level, true, this.ClientMaxWindowBits); + compressorDeflateStream.FlushMode = FlushType.Sync; + } + + byte[] result = null; + try + { + compressorDeflateStream.Write(data, 0, length); + compressorDeflateStream.Flush(); + + compressorOutputStream.Position = 0; + + // http://tools.ietf.org/html/rfc7692#section-7.2.1 + // Remove 4 octets (that are 0x00 0x00 0xff 0xff) from the tail end. After this step, the last octet of the compressed data contains (possibly part of) the DEFLATE header bits with the "BTYPE" bits set to 00. + compressorOutputStream.SetLength(compressorOutputStream.Length - 4); + + result = compressorOutputStream.ToArray(); + } + finally + { + if (this.ClientNoContextTakeover) + { + compressorDeflateStream.Dispose(); + compressorDeflateStream = null; + } + } + + return result; + } + + /// + /// A function to decompress and return the data parameter with possible context takeover support (reusing the DeflateStream). + /// + private byte[] Decompress(byte[] data, int length) + { + if (decompressorInputStream == null) + decompressorInputStream = new BufferPoolMemoryStream(data.Length + 4); + + decompressorInputStream.Write(data, 0, length); + + // http://tools.ietf.org/html/rfc7692#section-7.2.2 + // Append 4 octets of 0x00 0x00 0xff 0xff to the tail end of the payload of the message. + decompressorInputStream.Write(PerMessageCompression.Trailer, 0, PerMessageCompression.Trailer.Length); + + decompressorInputStream.Position = 0; + + if (decompressorDeflateStream == null) + { + decompressorDeflateStream = new DeflateStream(decompressorInputStream, CompressionMode.Decompress, CompressionLevel.Default, true, this.ServerMaxWindowBits); + decompressorDeflateStream.FlushMode = FlushType.Sync; + } + + if (decompressorOutputStream == null) + decompressorOutputStream = new BufferPoolMemoryStream(); + decompressorOutputStream.SetLength(0); + + byte[] copyBuffer = VariableSizedBufferPool.Get(1024, true); + int readCount; + while ((readCount = decompressorDeflateStream.Read(copyBuffer, 0, copyBuffer.Length)) != 0) + decompressorOutputStream.Write(copyBuffer, 0, readCount); + + VariableSizedBufferPool.Release(copyBuffer); + + decompressorDeflateStream.SetLength(0); + + byte[] result = decompressorOutputStream.ToArray(); + + if (this.ServerNoContextTakeover) + { + decompressorDeflateStream.Dispose(); + decompressorDeflateStream = null; + } + + return result; + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/PerMessageCompression.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/PerMessageCompression.cs.meta new file mode 100644 index 00000000..0acf916b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Extensions/PerMessageCompression.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4c6122052eb4822438f8d080c0f8574f +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames.meta new file mode 100644 index 00000000..9bff9d63 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d07681f5c8c854d42b668e7c6f0a8764 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrame.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrame.cs new file mode 100644 index 00000000..53925f78 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrame.cs @@ -0,0 +1,199 @@ +#if !BESTHTTP_DISABLE_WEBSOCKET && (!UNITY_WEBGL || UNITY_EDITOR) + +using BestHTTP.Extensions; +using System; +using System.IO; + +namespace BestHTTP.WebSocket.Frames +{ + public struct RawFrameData : IDisposable + { + public byte[] Data; + public int Length; + + public RawFrameData(byte[] data, int length) + { + Data = data; + Length = length; + } + + public void Dispose() + { + VariableSizedBufferPool.Release(Data); + Data = null; + } + } + /// + /// Denotes a binary frame. The "Payload data" is arbitrary binary data whose interpretation is solely up to the application layer. + /// This is the base class of all other frame writers, as all frame can be represented as a byte array. + /// + public sealed class WebSocketFrame + { + public WebSocketFrameTypes Type { get; private set; } + public bool IsFinal { get; private set; } + public byte Header { get; private set; } + + public byte[] Data { get; private set; } + public int DataLength { get; private set; } + public bool UseExtensions { get; private set; } + + #region Constructors + + public WebSocketFrame(WebSocket webSocket, WebSocketFrameTypes type, byte[] data) + :this(webSocket, type, data, true) + { } + + public WebSocketFrame(WebSocket webSocket, WebSocketFrameTypes type, byte[] data, bool useExtensions) + : this(webSocket, type, data, 0, data != null ? (UInt64)data.Length : 0, true, useExtensions) + { + } + + public WebSocketFrame(WebSocket webSocket, WebSocketFrameTypes type, byte[] data, bool isFinal, bool useExtensions) + : this(webSocket, type, data, 0, data != null ? (UInt64)data.Length : 0, isFinal, useExtensions) + { + } + + public WebSocketFrame(WebSocket webSocket, WebSocketFrameTypes type, byte[] data, UInt64 pos, UInt64 length, bool isFinal, bool useExtensions) + { + this.Type = type; + this.IsFinal = isFinal; + this.UseExtensions = useExtensions; + + this.DataLength = (int)length; + if (data != null) + { + this.Data = VariableSizedBufferPool.Get(this.DataLength, true); + Array.Copy(data, (int)pos, this.Data, 0, this.DataLength); + } + else + data = VariableSizedBufferPool.NoData; + + // First byte: Final Bit + Rsv flags + OpCode + byte finalBit = (byte)(IsFinal ? 0x80 : 0x0); + this.Header = (byte)(finalBit | (byte)Type); + + if (this.UseExtensions && webSocket != null && webSocket.Extensions != null) + { + for (int i = 0; i < webSocket.Extensions.Length; ++i) + { + var ext = webSocket.Extensions[i]; + if (ext != null) + { + this.Header |= ext.GetFrameHeader(this, this.Header); + byte[] newData = ext.Encode(this); + + if (newData != this.Data) + { + VariableSizedBufferPool.Release(this.Data); + + this.Data = newData; + this.DataLength = newData.Length; + } + } + } + } + } + + #endregion + + #region Public Functions + + public RawFrameData Get() + { + if (Data == null) + Data = VariableSizedBufferPool.NoData; + + using (var ms = new BufferPoolMemoryStream(this.DataLength + 9)) + { + // For the complete documentation for this section see: + // http://tools.ietf.org/html/rfc6455#section-5.2 + + // Write the header + ms.WriteByte(this.Header); + + // The length of the "Payload data", in bytes: if 0-125, that is the payload length. If 126, the following 2 bytes interpreted as a + // 16-bit unsigned integer are the payload length. If 127, the following 8 bytes interpreted as a 64-bit unsigned integer (the + // most significant bit MUST be 0) are the payload length. Multibyte length quantities are expressed in network byte order. + if (this.DataLength < 126) + ms.WriteByte((byte)(0x80 | (byte)this.DataLength)); + else if (this.DataLength < UInt16.MaxValue) + { + ms.WriteByte((byte)(0x80 | 126)); + byte[] len = BitConverter.GetBytes((UInt16)this.DataLength); + if (BitConverter.IsLittleEndian) + Array.Reverse(len, 0, len.Length); + + ms.Write(len, 0, len.Length); + } + else + { + ms.WriteByte((byte)(0x80 | 127)); + byte[] len = BitConverter.GetBytes((UInt64)this.DataLength); + if (BitConverter.IsLittleEndian) + Array.Reverse(len, 0, len.Length); + + ms.Write(len, 0, len.Length); + } + + // All frames sent from the client to the server are masked by a 32-bit value that is contained within the frame. This field is + // present if the mask bit is set to 1 and is absent if the mask bit is set to 0. + // If the data is being sent by the client, the frame(s) MUST be masked. + byte[] mask = BitConverter.GetBytes((Int32)this.GetHashCode()); + ms.Write(mask, 0, mask.Length); + + // Do the masking. + for (int i = 0; i < this.DataLength; ++i) + ms.WriteByte((byte)(Data[i] ^ mask[i % 4])); + + return new RawFrameData(ms.ToArray(true), (int)ms.Length); + } + } + + public WebSocketFrame[] Fragment(ushort maxFragmentSize) + { + if (this.Data == null) + return null; + + // All control frames MUST have a payload length of 125 bytes or less and MUST NOT be fragmented. + if (this.Type != WebSocketFrameTypes.Binary && this.Type != WebSocketFrameTypes.Text) + return null; + + if (this.DataLength <= maxFragmentSize) + return null; + + this.IsFinal = false; + + // Clear final bit from the header flags + this.Header &= 0x7F; + + // One chunk will remain in this fragment, so we have to allocate one less + int count = (this.DataLength / maxFragmentSize) + (this.DataLength % maxFragmentSize == 0 ? -1 : 0); + + WebSocketFrame[] fragments = new WebSocketFrame[count]; + + // Skip one chunk, for the current one + UInt64 pos = maxFragmentSize; + while (pos < (UInt64)this.DataLength) + { + UInt64 chunkLength = Math.Min(maxFragmentSize, (UInt64)this.DataLength - pos); + + fragments[fragments.Length - count--] = new WebSocketFrame(null, WebSocketFrameTypes.Continuation, this.Data, pos, chunkLength, pos + chunkLength >= (UInt64)this.DataLength, false); + + pos += chunkLength; + } + + //byte[] newData = VariableSizedBufferPool.Get(maxFragmentSize, true); + //Array.Copy(this.Data, 0, newData, 0, maxFragmentSize); + //VariableSizedBufferPool.Release(this.Data); + + //this.Data = newData; + this.DataLength = maxFragmentSize; + + return fragments; + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrame.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrame.cs.meta new file mode 100644 index 00000000..dcaea166 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrame.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2f674a60005f409438aa505311bf2e7a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameReader.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameReader.cs new file mode 100644 index 00000000..ab44856e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameReader.cs @@ -0,0 +1,229 @@ +#if !BESTHTTP_DISABLE_WEBSOCKET && (!UNITY_WEBGL || UNITY_EDITOR) + +using System; +using System.Collections.Generic; +using System.IO; + +using BestHTTP.Extensions; +using BestHTTP.WebSocket.Extensions; + +namespace BestHTTP.WebSocket.Frames +{ + /// + /// Represents an incoming WebSocket Frame. + /// + public struct WebSocketFrameReader + { +#region Properties + + public byte Header { get; private set; } + + /// + /// True if it's a final Frame in a sequence, or the only one. + /// + public bool IsFinal { get; private set; } + + /// + /// The type of the Frame. + /// + public WebSocketFrameTypes Type { get; private set; } + + /// + /// Indicates if there are any mask sent to decode the data. + /// + public bool HasMask { get; private set; } + + /// + /// The length of the Data. + /// + public UInt64 Length { get; private set; } + + /// + /// The decoded array of bytes. + /// + public byte[] Data { get; private set; } + + /// + /// Textual representation of the received Data. + /// + public string DataAsText { get; private set; } + + #endregion + + #region Internal & Private Functions + + internal void Read(Stream stream) + { + // For the complete documentation for this section see: + // http://tools.ietf.org/html/rfc6455#section-5.2 + + this.Header = ReadByte(stream); + + // The first byte is the Final Bit and the type of the frame + IsFinal = (this.Header & 0x80) != 0; + Type = (WebSocketFrameTypes)(this.Header & 0xF); + + byte maskAndLength = ReadByte(stream); + + // The second byte is the Mask Bit and the length of the payload data + HasMask = (maskAndLength & 0x80) != 0; + + // if 0-125, that is the payload length. + Length = (UInt64)(maskAndLength & 127); + + // If 126, the following 2 bytes interpreted as a 16-bit unsigned integer are the payload length. + if (Length == 126) + { + byte[] rawLen = VariableSizedBufferPool.Get(2, true); + + stream.ReadBuffer(rawLen, 2); + + if (BitConverter.IsLittleEndian) + Array.Reverse(rawLen, 0, 2); + + Length = (UInt64)BitConverter.ToUInt16(rawLen, 0); + + VariableSizedBufferPool.Release(rawLen); + } + else if (Length == 127) + { + // If 127, the following 8 bytes interpreted as a 64-bit unsigned integer (the + // most significant bit MUST be 0) are the payload length. + + byte[] rawLen = VariableSizedBufferPool.Get(8, true); + + stream.ReadBuffer(rawLen, 8); + + if (BitConverter.IsLittleEndian) + Array.Reverse(rawLen, 0, 8); + + Length = (UInt64)BitConverter.ToUInt64(rawLen, 0); + + VariableSizedBufferPool.Release(rawLen); + } + + // The sent byte array as a mask to decode the data. + byte[] mask = null; + + // Read the Mask, if has any + if (HasMask) + { + mask = VariableSizedBufferPool.Get(4, true); + if (stream.Read(mask, 0, 4) < mask.Length) + throw ExceptionHelper.ServerClosedTCPStream(); + } + + if (Type == WebSocketFrameTypes.Text || Type == WebSocketFrameTypes.Continuation) + Data = VariableSizedBufferPool.Get((long)Length, true); + else + if (Length == 0) + Data = VariableSizedBufferPool.NoData; + else + Data = new byte[Length]; + //Data = Type == WebSocketFrameTypes.Text ? VariableSizedBufferPool.Get((long)Length, true) : new byte[Length]; + + if (Length == 0L) + return; + + uint readLength = 0; + + do + { + int read = stream.Read(Data, (int)readLength, (int)(Length - readLength)); + + if (read <= 0) + throw ExceptionHelper.ServerClosedTCPStream(); + + readLength += (uint)read; + } while (readLength < Length); + + if (HasMask) + { + for (uint i = 0; i < Length; ++i) + Data[i] = (byte)(Data[i] ^ mask[i % 4]); + + VariableSizedBufferPool.Release(mask); + } + } + + private byte ReadByte(Stream stream) + { + int read = stream.ReadByte(); + + if (read < 0) + throw ExceptionHelper.ServerClosedTCPStream(); + + return (byte)read; + } + +#endregion + +#region Public Functions + + /// + /// Assembles all fragments into a final frame. Call this on the last fragment of a frame. + /// + /// The list of previously downloaded and parsed fragments of the frame + public void Assemble(List fragments) + { + // this way the following algorithms will handle this fragment's data too + fragments.Add(this); + + UInt64 finalLength = 0; + for (int i = 0; i < fragments.Count; ++i) + finalLength += fragments[i].Length; + + byte[] buffer = fragments[0].Type == WebSocketFrameTypes.Text ? VariableSizedBufferPool.Get((long)finalLength, true) : new byte[finalLength]; + UInt64 pos = 0; + for (int i = 0; i < fragments.Count; ++i) + { + Array.Copy(fragments[i].Data, 0, buffer, (int)pos, (int)fragments[i].Length); + VariableSizedBufferPool.Release(fragments[i].Data); + + pos += fragments[i].Length; + } + + // All fragments of a message are of the same type, as set by the first fragment's opcode. + this.Type = fragments[0].Type; + + // Reserver flags may be contained only in the first fragment + + this.Header = fragments[0].Header; + this.Length = finalLength; + this.Data = buffer; + } + + /// + /// This function will decode the received data incrementally with the associated websocket's extensions. + /// + public void DecodeWithExtensions(WebSocket webSocket) + { + if (webSocket.Extensions != null) + for (int i = 0; i < webSocket.Extensions.Length; ++i) + { + var ext = webSocket.Extensions[i]; + if (ext != null) + { + var newData = ext.Decode(this.Header, this.Data, (int)this.Length); + if (this.Data != newData) + { + VariableSizedBufferPool.Release(this.Data); + this.Data = newData; + this.Length = (ulong)newData.Length; + } + } + } + + if (this.Type == WebSocketFrameTypes.Text && this.Data != null) + { + this.DataAsText = System.Text.Encoding.UTF8.GetString(this.Data, 0, (int)this.Length); + VariableSizedBufferPool.Release(this.Data); + this.Data = null; + } + } + +#endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameReader.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameReader.cs.meta new file mode 100644 index 00000000..652a61d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameReader.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 551161b05e7dd8c4d85aadf44c841056 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameTypes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameTypes.cs new file mode 100644 index 00000000..168d1f49 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameTypes.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_WEBSOCKET && (!UNITY_WEBGL || UNITY_EDITOR) + +namespace BestHTTP.WebSocket.Frames +{ + public enum WebSocketFrameTypes : byte + { + /// + /// A fragmented message's first frame's contain the type of the message(binary or text), all consecutive frame of that message must be a Continuation frame. + /// Last of these frame's Fin bit must be 1. + /// + /// For a text message sent as three fragments, the first fragment would have an opcode of 0x1 (text) and a FIN bit clear, + /// the second fragment would have an opcode of 0x0 (Continuation) and a FIN bit clear, + /// and the third fragment would have an opcode of 0x0 (Continuation) and a FIN bit that is set. + Continuation = 0x0, + Text = 0x1, + Binary = 0x2, + //Reserved1 = 0x3, + //Reserved2 = 0x4, + //Reserved3 = 0x5, + //Reserved4 = 0x6, + //Reserved5 = 0x7, + + /// + /// The Close frame MAY contain a body (the "Application data" portion of the frame) that indicates a reason for closing, + /// such as an endpoint shutting down, an endpoint having received a frame too large, or an endpoint having received a frame that + /// does not conform to the format expected by the endpoint. + /// As the data is not guaranteed to be human readable, clients MUST NOT show it to end users. + /// + ConnectionClose = 0x8, + + /// + /// The Ping frame contains an opcode of 0x9. A Ping frame MAY include "Application data". + /// + Ping = 0x9, + + /// + /// A Pong frame sent in response to a Ping frame must have identical "Application data" as found in the message body of the Ping frame being replied to. + /// + Pong = 0xA, + //Reserved6 = 0xB, + //Reserved7 = 0xC, + //Reserved8 = 0xD, + //Reserved9 = 0xE, + //Reserved10 = 0xF, + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameTypes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameTypes.cs.meta new file mode 100644 index 00000000..b2742447 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/Frames/WebSocketFrameTypes.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 111b231c861908546b2c5acfa6d69bae +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocket.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocket.cs new file mode 100644 index 00000000..b9e1e60d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocket.cs @@ -0,0 +1,836 @@ +#if !BESTHTTP_DISABLE_WEBSOCKET + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using BestHTTP.Extensions; + +#if UNITY_WEBGL && !UNITY_EDITOR + using System.Runtime.InteropServices; +#else + using BestHTTP.WebSocket.Frames; + using BestHTTP.WebSocket.Extensions; +#endif + +namespace BestHTTP.WebSocket +{ + /// + /// States of the underlying browser's WebSocket implementation's state. + /// + public enum WebSocketStates : byte + { + Connecting = 0, + Open = 1, + Closing = 2, + Closed = 3, + Unknown + }; + + public delegate void OnWebSocketOpenDelegate(WebSocket webSocket); + public delegate void OnWebSocketMessageDelegate(WebSocket webSocket, string message); + public delegate void OnWebSocketBinaryDelegate(WebSocket webSocket, byte[] data); + public delegate void OnWebSocketClosedDelegate(WebSocket webSocket, UInt16 code, string message); + public delegate void OnWebSocketErrorDelegate(WebSocket webSocket, Exception ex); + public delegate void OnWebSocketErrorDescriptionDelegate(WebSocket webSocket, string reason); + +#if (!UNITY_WEBGL || UNITY_EDITOR) + public delegate void OnWebSocketIncompleteFrameDelegate(WebSocket webSocket, WebSocketFrameReader frame); +#else + delegate void OnWebGLWebSocketOpenDelegate(uint id); + delegate void OnWebGLWebSocketTextDelegate(uint id, string text); + delegate void OnWebGLWebSocketBinaryDelegate(uint id, IntPtr pBuffer, int length); + delegate void OnWebGLWebSocketErrorDelegate(uint id, string error); + delegate void OnWebGLWebSocketCloseDelegate(uint id, int code, string reason); +#endif + + public sealed class WebSocket + { +#region Properties + +#if !UNITY_WEBGL || UNITY_EDITOR + public WebSocketStates State { get; private set; } +#else + public WebSocketStates State { get { return ImplementationId != 0 ? WS_GetState(ImplementationId) : WebSocketStates.Unknown; } } +#endif + + /// + /// The connection to the WebSocket server is open. + /// + public bool IsOpen + { + get + { +#if (!UNITY_WEBGL || UNITY_EDITOR) + return webSocket != null && !webSocket.IsClosed; +#else + return ImplementationId != 0 && WS_GetState(ImplementationId) == WebSocketStates.Open; +#endif + } + } + + public int BufferedAmount + { + get + { +#if (!UNITY_WEBGL || UNITY_EDITOR) + return webSocket.BufferedAmount; +#else + return WS_GetBufferedAmount(ImplementationId); +#endif + } + } + +#if (!UNITY_WEBGL || UNITY_EDITOR) + /// + /// Set to true to start a new thread to send Pings to the WebSocket server + /// + public bool StartPingThread { get; set; } + + /// + /// The delay between two Pings in millisecs. Minimum value is 100, default is 1000. + /// + public int PingFrequency { get; set; } + + /// + /// If StartPingThread set to true, the plugin will close the connection and emit an OnError/OnErrorDesc event if no + /// message is received from the server in the given time. Its default value is 10 sec. + /// + public TimeSpan CloseAfterNoMesssage { get; set; } + + /// + /// The internal HTTPRequest object. + /// + public HTTPRequest InternalRequest { get; private set; } + + /// + /// IExtension implementations the plugin will negotiate with the server to use. + /// + public IExtension[] Extensions { get; private set; } + + /// + /// Latency calculated from the ping-pong message round-trip times. + /// + public int Latency { get { return webSocket.Latency; } } + +#endif + + /// + /// Called when the connection to the WebSocket server is established. + /// + public OnWebSocketOpenDelegate OnOpen; + + /// + /// Called when a new textual message is received from the server. + /// + public OnWebSocketMessageDelegate OnMessage; + + /// + /// Called when a new binary message is received from the server. + /// + public OnWebSocketBinaryDelegate OnBinary; + + /// + /// Called when the WebSocket connection is closed. + /// + public OnWebSocketClosedDelegate OnClosed; + + /// + /// Called when an error is encountered. The Exception parameter may be null. + /// + public OnWebSocketErrorDelegate OnError; + + /// + /// Called when an error is encountered. The parameter will be the description of the error. + /// + public OnWebSocketErrorDescriptionDelegate OnErrorDesc; + +#if (!UNITY_WEBGL || UNITY_EDITOR) + /// + /// Called when an incomplete frame received. No attempt will be made to reassemble these fragments internally, and no reference are stored after this event to this frame. + /// + public OnWebSocketIncompleteFrameDelegate OnIncompleteFrame; +#endif + + #endregion + + #region Private Fields + +#if (!UNITY_WEBGL || UNITY_EDITOR) + /// + /// Indicates wheter we sent out the connection request to the server. + /// + private bool requestSent; + + /// + /// The internal WebSocketResponse object + /// + private WebSocketResponse webSocket; +#else + internal static Dictionary WebSockets = new Dictionary(); + + private uint ImplementationId; + private Uri Uri; + private string Protocol; + +#endif + + #endregion + + #region Constructors + + /// + /// Creates a WebSocket instance from the given uri. + /// + /// The uri of the WebSocket server + public WebSocket(Uri uri) + :this(uri, string.Empty, string.Empty) + { +#if (!UNITY_WEBGL || UNITY_EDITOR) && !BESTHTTP_DISABLE_GZIP + this.Extensions = new IExtension[] { new PerMessageCompression(/*compression level: */ Decompression.Zlib.CompressionLevel.Default, + /*clientNoContextTakeover: */ false, + /*serverNoContextTakeover: */ false, + /*clientMaxWindowBits: */ Decompression.Zlib.ZlibConstants.WindowBitsMax, + /*desiredServerMaxWindowBits: */ Decompression.Zlib.ZlibConstants.WindowBitsMax, + /*minDatalengthToCompress: */ PerMessageCompression.MinDataLengthToCompressDefault) }; +#endif + } + + /// + /// Creates a WebSocket instance from the given uri, protocol and origin. + /// + /// The uri of the WebSocket server + /// Servers that are not intended to process input from any web page but only for certain sites SHOULD verify the |Origin| field is an origin they expect. + /// If the origin indicated is unacceptable to the server, then it SHOULD respond to the WebSocket handshake with a reply containing HTTP 403 Forbidden status code. + /// The application-level protocol that the client want to use(eg. "chat", "leaderboard", etc.). Can be null or empty string if not used. + /// Optional IExtensions implementations + public WebSocket(Uri uri, string origin, string protocol +#if !UNITY_WEBGL || UNITY_EDITOR + , params IExtension[] extensions +#endif + ) + + { + string scheme = HTTPProtocolFactory.IsSecureProtocol(uri) ? "wss" : "ws"; + int port = uri.Port != -1 ? uri.Port : (scheme.Equals("wss", StringComparison.OrdinalIgnoreCase) ? 443 : 80); + + // Somehow if i use the UriBuilder it's not the same as if the uri is constructed from a string... + //uri = new UriBuilder(uri.Scheme, uri.Host, uri.Scheme.Equals("wss", StringComparison.OrdinalIgnoreCase) ? 443 : 80, uri.PathAndQuery).Uri; + uri = new Uri(scheme + "://" + uri.Host + ":" + port + uri.GetRequestPathAndQueryURL()); + +#if !UNITY_WEBGL || UNITY_EDITOR + // Set up some default values. + this.PingFrequency = 1000; + this.CloseAfterNoMesssage = TimeSpan.FromSeconds(10); + + InternalRequest = new HTTPRequest(uri, OnInternalRequestCallback); + + // Called when the regular GET request is successfully upgraded to WebSocket + InternalRequest.OnUpgraded = OnInternalRequestUpgraded; + + //http://tools.ietf.org/html/rfc6455#section-4 + + //The request MUST contain a |Host| header field whose value contains /host/ plus optionally ":" followed by /port/ (when not using the default port). + if ((!HTTPProtocolFactory.IsSecureProtocol(uri) && uri.Port != 80) && (HTTPProtocolFactory.IsSecureProtocol(uri) && uri.Port != 443)) + InternalRequest.SetHeader("Host", uri.Host + ":" + uri.Port); + else + InternalRequest.SetHeader("Host", uri.Host); + + // The request MUST contain an |Upgrade| header field whose value MUST include the "websocket" keyword. + InternalRequest.SetHeader("Upgrade", "websocket"); + + // The request MUST contain a |Connection| header field whose value MUST include the "Upgrade" token. + InternalRequest.SetHeader("Connection", "Upgrade"); + + // The request MUST include a header field with the name |Sec-WebSocket-Key|. The value of this header field MUST be a nonce consisting of a + // randomly selected 16-byte value that has been base64-encoded (see Section 4 of [RFC4648]). The nonce MUST be selected randomly for each connection. + InternalRequest.SetHeader("Sec-WebSocket-Key", GetSecKey(new object[] { this, InternalRequest, uri, new object() })); + + // The request MUST include a header field with the name |Origin| [RFC6454] if the request is coming from a browser client. + // If the connection is from a non-browser client, the request MAY include this header field if the semantics of that client match the use-case described here for browser clients. + // More on Origin Considerations: http://tools.ietf.org/html/rfc6455#section-10.2 + if (!string.IsNullOrEmpty(origin)) + InternalRequest.SetHeader("Origin", origin); + + // The request MUST include a header field with the name |Sec-WebSocket-Version|. The value of this header field MUST be 13. + InternalRequest.SetHeader("Sec-WebSocket-Version", "13"); + + if (!string.IsNullOrEmpty(protocol)) + InternalRequest.SetHeader("Sec-WebSocket-Protocol", protocol); + + // Disable caching + InternalRequest.SetHeader("Cache-Control", "no-cache"); + InternalRequest.SetHeader("Pragma", "no-cache"); + + this.Extensions = extensions; + +#if !BESTHTTP_DISABLE_CACHING + InternalRequest.DisableCache = true; + InternalRequest.DisableRetry = true; +#endif + + InternalRequest.TryToMinimizeTCPLatency = true; + +#if !BESTHTTP_DISABLE_PROXY + // WebSocket is not a request-response based protocol, so we need a 'tunnel' through the proxy + HTTPProxy httpProxy = HTTPManager.Proxy as HTTPProxy; + if (httpProxy != null) + InternalRequest.Proxy = new HTTPProxy(httpProxy.Address, + httpProxy.Credentials, + false, /*turn on 'tunneling'*/ + false, /*sendWholeUri*/ + httpProxy.NonTransparentForHTTPS); +#endif +#else + this.Uri = uri; + this.Protocol = protocol; +#endif + + // Under WebGL when only the WebSocket protocol is used Setup() isn't called, so we have to call it here. + HTTPManager.Setup(); + } + +#endregion + +#region Request Callbacks + +#if (!UNITY_WEBGL || UNITY_EDITOR) + private void OnInternalRequestCallback(HTTPRequest req, HTTPResponse resp) + { + string reason = string.Empty; + + switch (req.State) + { + case HTTPRequestStates.Finished: + if (resp.IsSuccess || resp.StatusCode == 101) + { + // The request finished without any problem. + HTTPManager.Logger.Information("WebSocket", string.Format("Request finished. Status Code: {0} Message: {1}", resp.StatusCode.ToString(), resp.Message)); + + return; + } + else + reason = string.Format("Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + reason = "Request Finished with Error! " + (req.Exception != null ? ("Exception: " + req.Exception.Message + req.Exception.StackTrace) : string.Empty); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + reason = "Request Aborted!"; + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + reason = "Connection Timed Out!"; + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + reason = "Processing the request Timed Out!"; + break; + + default: + return; + } + + if (this.State != WebSocketStates.Connecting || !string.IsNullOrEmpty(reason)) + { + if (OnError != null) + OnError(this, req.Exception); + + if (OnErrorDesc != null) + OnErrorDesc(this, reason); + + if (OnError == null && OnErrorDesc == null) + HTTPManager.Logger.Error("WebSocket", reason); + } + else if (OnClosed != null) + OnClosed(this, (ushort)WebSocketStausCodes.NormalClosure, "Closed while opening"); + + if (!req.IsKeepAlive && resp != null && resp is WebSocketResponse) + (resp as WebSocketResponse).CloseStream(); + } + + private void OnInternalRequestUpgraded(HTTPRequest req, HTTPResponse resp) + { + webSocket = resp as WebSocketResponse; + + if (webSocket == null) + { + if (OnError != null) + OnError(this, req.Exception); + + if (OnErrorDesc != null) + { + string reason = string.Empty; + if (req.Exception != null) + reason = req.Exception.Message + " " + req.Exception.StackTrace; + + OnErrorDesc(this, reason); + } + + this.State = WebSocketStates.Closed; + return; + } + + // If Close called while we connected + if (this.State == WebSocketStates.Closed) + { + webSocket.CloseStream(); + return; + } + + webSocket.WebSocket = this; + + if (this.Extensions != null) + { + for (int i = 0; i < this.Extensions.Length; ++i) + { + var ext = this.Extensions[i]; + + try + { + if (ext != null && !ext.ParseNegotiation(webSocket)) + this.Extensions[i] = null; // Keep extensions only that successfully negotiated + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "ParseNegotiation", ex); + + // Do not try to use a defective extension in the future + this.Extensions[i] = null; + } + } + } + + this.State = WebSocketStates.Open; + if (OnOpen != null) + { + try + { + OnOpen(this); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "OnOpen", ex); + } + } + + webSocket.OnText = (ws, msg) => + { + if (OnMessage != null) + OnMessage(this, msg); + }; + + webSocket.OnBinary = (ws, bin) => + { + if (OnBinary != null) + OnBinary(this, bin); + }; + + webSocket.OnClosed = (ws, code, msg) => + { + this.State = WebSocketStates.Closed; + + if (OnClosed != null) + OnClosed(this, code, msg); + }; + + if (OnIncompleteFrame != null) + webSocket.OnIncompleteFrame = (ws, frame) => + { + if (OnIncompleteFrame != null) + OnIncompleteFrame(this, frame); + }; + + if (StartPingThread) + webSocket.StartPinging(Math.Max(PingFrequency, 100)); + + webSocket.StartReceive(); + } +#endif + +#endregion + +#region Public Interface + + /// + /// Start the opening process. + /// + public void Open() + { +#if (!UNITY_WEBGL || UNITY_EDITOR) + if (requestSent) + throw new InvalidOperationException("Open already called! You can't reuse this WebSocket instance!"); + + if (this.Extensions != null) + { + try + { + for (int i = 0; i < this.Extensions.Length; ++i) + { + var ext = this.Extensions[i]; + if (ext != null) + ext.AddNegotiation(InternalRequest); + } + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "Open", ex); + } + } + + InternalRequest.Send(); + requestSent = true; + this.State = WebSocketStates.Connecting; +#else + try + { + ImplementationId = WS_Create(this.Uri.OriginalString, this.Protocol, OnOpenCallback, OnTextCallback, OnBinaryCallback, OnErrorCallback, OnCloseCallback); + WebSockets.Add(ImplementationId, this); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "Open", ex); + } +#endif + } + + /// + /// It will send the given message to the server in one frame. + /// + public void Send(string message) + { + if (!IsOpen) + return; + +#if (!UNITY_WEBGL || UNITY_EDITOR) + webSocket.Send(message); +#else + WS_Send_String(this.ImplementationId, message); +#endif + } + + /// + /// It will send the given data to the server in one frame. + /// + public void Send(byte[] buffer) + { + if (!IsOpen) + return; +#if (!UNITY_WEBGL || UNITY_EDITOR) + webSocket.Send(buffer); +#else + WS_Send_Binary(this.ImplementationId, buffer, 0, buffer.Length); +#endif + } + + /// + /// Will send count bytes from a byte array, starting from offset. + /// + public void Send(byte[] buffer, ulong offset, ulong count) + { + if (!IsOpen) + return; +#if (!UNITY_WEBGL || UNITY_EDITOR) + webSocket.Send(buffer, offset, count); +#else + WS_Send_Binary(this.ImplementationId, buffer, (int)offset, (int)count); +#endif + } + +#if (!UNITY_WEBGL || UNITY_EDITOR) + /// + /// It will send the given frame to the server. + /// + public void Send(WebSocketFrame frame) + { + if (IsOpen) + webSocket.Send(frame); + } +#endif + + /// + /// It will initiate the closing of the connection to the server. + /// + public void Close() + { + if (State >= WebSocketStates.Closing) + return; + +#if !UNITY_WEBGL || UNITY_EDITOR + if (this.State == WebSocketStates.Connecting) + { + this.State = WebSocketStates.Closed; + if (OnClosed != null) + OnClosed(this, (ushort)WebSocketStausCodes.NoStatusCode, string.Empty); + } + else + { + this.State = WebSocketStates.Closing; + webSocket.Close(); + } +#else + WS_Close(this.ImplementationId, 1000, "Bye!"); +#endif + } + + /// + /// It will initiate the closing of the connection to the server sending the given code and message. + /// + public void Close(UInt16 code, string message) + { + if (!IsOpen) + return; +#if (!UNITY_WEBGL || UNITY_EDITOR) + webSocket.Close(code, message); +#else + WS_Close(this.ImplementationId, code, message); +#endif + } + + public static byte[] EncodeCloseData(UInt16 code, string message) + { + //If there is a body, the first two bytes of the body MUST be a 2-byte unsigned integer + // (in network byte order) representing a status code with value /code/ defined in Section 7.4 (http://tools.ietf.org/html/rfc6455#section-7.4). Following the 2-byte integer, + // the body MAY contain UTF-8-encoded data with value /reason/, the interpretation of which is not defined by this specification. + // This data is not necessarily human readable but may be useful for debugging or passing information relevant to the script that opened the connection. + int msgLen = Encoding.UTF8.GetByteCount(message); + using (BufferPoolMemoryStream ms = new BufferPoolMemoryStream(2 + msgLen)) + { + byte[] buff = BitConverter.GetBytes(code); + if (BitConverter.IsLittleEndian) + Array.Reverse(buff, 0, buff.Length); + + ms.Write(buff, 0, buff.Length); + + buff = Encoding.UTF8.GetBytes(message); + ms.Write(buff, 0, buff.Length); + + return ms.ToArray(); + } + } + +#endregion + +#region Private Helpers + +#if !UNITY_WEBGL || UNITY_EDITOR + private string GetSecKey(object[] from) + { + byte[] keys = new byte[16]; + int pos = 0; + + for (int i = 0; i < from.Length; ++i) + { + byte[] hash = BitConverter.GetBytes((Int32)from[i].GetHashCode()); + + for (int cv = 0; cv < hash.Length && pos < keys.Length; ++cv) + keys[pos++] = hash[cv]; + } + + return Convert.ToBase64String(keys); + } +#endif + +#endregion + +#region WebGL Static Callbacks +#if UNITY_WEBGL && !UNITY_EDITOR + + [AOT.MonoPInvokeCallback(typeof(OnWebGLWebSocketOpenDelegate))] + static void OnOpenCallback(uint id) + { + WebSocket ws; + if (WebSockets.TryGetValue(id, out ws)) + { + if (ws.OnOpen != null) + { + try + { + ws.OnOpen(ws); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "OnOpen", ex); + } + } + } + else + HTTPManager.Logger.Warning("WebSocket", "OnOpenCallback - No WebSocket found for id: " + id.ToString()); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLWebSocketTextDelegate))] + static void OnTextCallback(uint id, string text) + { + WebSocket ws; + if (WebSockets.TryGetValue(id, out ws)) + { + if (ws.OnMessage != null) + { + try + { + ws.OnMessage(ws, text); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "OnMessage", ex); + } + } + } + else + HTTPManager.Logger.Warning("WebSocket", "OnTextCallback - No WebSocket found for id: " + id.ToString()); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLWebSocketBinaryDelegate))] + static void OnBinaryCallback(uint id, IntPtr pBuffer, int length) + { + WebSocket ws; + if (WebSockets.TryGetValue(id, out ws)) + { + if (ws.OnBinary != null) + { + try + { + byte[] buffer = new byte[length]; + + // Copy data from the 'unmanaged' memory to managed memory. Buffer will be reclaimed by the GC. + Marshal.Copy(pBuffer, buffer, 0, length); + + ws.OnBinary(ws, buffer); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "OnBinary", ex); + } + } + } + else + HTTPManager.Logger.Warning("WebSocket", "OnBinaryCallback - No WebSocket found for id: " + id.ToString()); + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLWebSocketErrorDelegate))] + static void OnErrorCallback(uint id, string error) + { + WebSocket ws; + if (WebSockets.TryGetValue(id, out ws)) + { + WebSockets.Remove(id); + + if (ws.OnError != null) + { + try + { + ws.OnError(ws, new Exception(error)); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "OnError", ex); + } + } + + if (ws.OnErrorDesc != null) + { + try + { + ws.OnErrorDesc(ws, error); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "OnErrorDesc", ex); + } + } + } + else + HTTPManager.Logger.Warning("WebSocket", "OnErrorCallback - No WebSocket found for id: " + id.ToString()); + + try + { + WS_Release(id); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "WS_Release", ex); + } + } + + [AOT.MonoPInvokeCallback(typeof(OnWebGLWebSocketCloseDelegate))] + static void OnCloseCallback(uint id, int code, string reason) + { + // To match non-webgl behavior, we have to treat this client-side generated message as an error + if (code == (int)WebSocketStausCodes.ClosedAbnormally) + { + OnErrorCallback(id, "Abnormal disconnection."); + return; + } + + WebSocket ws; + if (WebSockets.TryGetValue(id, out ws)) + { + WebSockets.Remove(id); + + if (ws.OnClosed != null) + { + try + { + ws.OnClosed(ws, (ushort)code, reason); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "OnClosed", ex); + } + } + } + else + HTTPManager.Logger.Warning("WebSocket", "OnCloseCallback - No WebSocket found for id: " + id.ToString()); + + try + { + WS_Release(id); + } + catch(Exception ex) + { + HTTPManager.Logger.Exception("WebSocket", "WS_Release", ex); + } + } + +#endif +#endregion + +#region WebGL Interface +#if UNITY_WEBGL && !UNITY_EDITOR + + [DllImport("__Internal")] + static extern uint WS_Create(string url, string protocol, OnWebGLWebSocketOpenDelegate onOpen, OnWebGLWebSocketTextDelegate onText, OnWebGLWebSocketBinaryDelegate onBinary, OnWebGLWebSocketErrorDelegate onError, OnWebGLWebSocketCloseDelegate onClose); + + [DllImport("__Internal")] + static extern WebSocketStates WS_GetState(uint id); + + [DllImport("__Internal")] + static extern int WS_GetBufferedAmount(uint id); + + [DllImport("__Internal")] + static extern int WS_Send_String(uint id, string strData); + + [DllImport("__Internal")] + static extern int WS_Send_Binary(uint id, byte[] buffer, int pos, int length); + + [DllImport("__Internal")] + static extern void WS_Close(uint id, ushort code, string reason); + + [DllImport("__Internal")] + static extern void WS_Release(uint id); + +#endif +#endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocket.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocket.cs.meta new file mode 100644 index 00000000..be2a0c36 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocket.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 32e0cd2913acd794aa3fc7d414fe78e4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketResponse.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketResponse.cs new file mode 100644 index 00000000..671e1065 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketResponse.cs @@ -0,0 +1,739 @@ +#if !BESTHTTP_DISABLE_WEBSOCKET && (!UNITY_WEBGL || UNITY_EDITOR) + +using System; +using System.IO; +using System.Threading; +using System.Collections.Generic; +using System.Text; + +using BestHTTP.Extensions; +using BestHTTP.WebSocket.Frames; + +namespace BestHTTP.WebSocket +{ + public sealed class WebSocketResponse : HTTPResponse, IHeartbeat, IProtocol + { + /// + /// Capacity of the RTT buffer where the latencies are kept. + /// + public static int RTTBufferCapacity = 5; + + #region Public Interface + + /// + /// A reference to the original WebSocket instance. Used for accessing extensions. + /// + public WebSocket WebSocket { get; internal set; } + + /// + /// Called when a Text message received + /// + public Action OnText; + + /// + /// Called when a Binary message received + /// + public Action OnBinary; + + /// + /// Called when an incomplete frame received. No attempt will be made to reassemble these fragments. + /// + public Action OnIncompleteFrame; + + /// + /// Called when the connection closed. + /// + public Action OnClosed; + + /// + /// Indicates whether the connection to the server is closed or not. + /// + public bool IsClosed { get { return closed; } } + + /// + /// On what frequency we have to send a ping to the server. + /// + public TimeSpan PingFrequnecy { get; private set; } + + /// + /// Maximum size of a fragment's payload data. Its default value is 32767. + /// + public UInt16 MaxFragmentSize { get; private set; } + + /// + /// Length of unsent, buffered up data in bytes. + /// + public int BufferedAmount { get { return this._bufferedAmount; } } + private int _bufferedAmount; + + /// + /// Calculated latency from the Round-Trip Times we store in the rtts field. + /// + public int Latency { get; private set; } + + #endregion + + #region Private Fields + + private List IncompleteFrames = new List(); + private List CompletedFrames = new List(); + private List frameCache = new List(); + private WebSocketFrameReader CloseFrame; + + private object FrameLock = new object(); + private object SendLock = new object(); + + private List unsentFrames = new List(); + private volatile AutoResetEvent newFrameSignal = new AutoResetEvent(false); + private volatile bool sendThreadCreated = false; + + /// + /// True if we sent out a Close message to the server + /// + private volatile bool closeSent; + + /// + /// True if this WebSocket connection is closed + /// + private volatile bool closed; + + /// + /// When we sent out the last ping. + /// + private DateTime lastPing = DateTime.MinValue; + + /// + /// When we received the last pong. + /// + private DateTime lastMessage = DateTime.MinValue; + + /// + /// A circular buffer to store the last N rtt times calculated by the pong messages. + /// + private CircularBuffer rtts = new CircularBuffer(WebSocketResponse.RTTBufferCapacity); + + #endregion + + internal WebSocketResponse(HTTPRequest request, Stream stream, bool isStreamed, bool isFromCache) + : base(request, stream, isStreamed, isFromCache) + { + base.IsClosedManually = true; + + closed = false; + MaxFragmentSize = UInt16.MaxValue / 2; + } + + internal void StartReceive() + { + if (IsUpgraded) + { +#if NETFX_CORE + #pragma warning disable 4014 + Windows.System.Threading.ThreadPool.RunAsync(ReceiveThreadFunc); + #pragma warning restore 4014 +#else + ThreadPool.QueueUserWorkItem(ReceiveThreadFunc); +#endif + } + } + + internal void CloseStream() + { + var conn = HTTPManager.GetConnectionWith(this.baseRequest); + if (conn != null) + conn.Abort(HTTPConnectionStates.Closed); + } + + #region Public interface for interacting with the server + + /// + /// It will send the given message to the server in one frame. + /// + public void Send(string message) + { + if (message == null) + throw new ArgumentNullException("message must not be null!"); + + int count = System.Text.Encoding.UTF8.GetByteCount(message); + byte[] data = VariableSizedBufferPool.Get(count, true); + System.Text.Encoding.UTF8.GetBytes(message, 0, message.Length, data, 0); + + var frame = new WebSocketFrame(this.WebSocket, WebSocketFrameTypes.Text, data, 0, (ulong)count, true, true); + + if (frame.Data != null && frame.Data.Length > this.MaxFragmentSize) + { + WebSocketFrame[] additionalFrames = frame.Fragment(this.MaxFragmentSize); + + lock (SendLock) + { + Send(frame); + if (additionalFrames != null) + for (int i = 0; i < additionalFrames.Length; ++i) + Send(additionalFrames[i]); + } + } + else + Send(frame); + + VariableSizedBufferPool.Release(data); + } + + /// + /// It will send the given data to the server in one frame. + /// + public void Send(byte[] data) + { + if (data == null) + throw new ArgumentNullException("data must not be null!"); + + WebSocketFrame frame = new WebSocketFrame(this.WebSocket, WebSocketFrameTypes.Binary, data); + + if (frame.Data != null && frame.Data.Length > this.MaxFragmentSize) + { + WebSocketFrame[] additionalFrames = frame.Fragment(this.MaxFragmentSize); + + lock(SendLock) + { + Send(frame); + if (additionalFrames != null) + for (int i = 0; i < additionalFrames.Length; ++i) + Send(additionalFrames[i]); + } + } + else + Send(frame); + } + + /// + /// Will send count bytes from a byte array, starting from offset. + /// + public void Send(byte[] data, ulong offset, ulong count) + { + if (data == null) + throw new ArgumentNullException("data must not be null!"); + if (offset + count > (ulong)data.Length) + throw new ArgumentOutOfRangeException("offset + count >= data.Length"); + + WebSocketFrame frame = new WebSocketFrame(this.WebSocket, WebSocketFrameTypes.Binary, data, offset, count, true, true); + + if (frame.Data != null && frame.Data.Length > this.MaxFragmentSize) + { + WebSocketFrame[] additionalFrames = frame.Fragment(this.MaxFragmentSize); + + lock (SendLock) + { + Send(frame); + + if (additionalFrames != null) + for (int i = 0; i < additionalFrames.Length; ++i) + Send(additionalFrames[i]); + } + } + else + Send(frame); + } + + /// + /// It will send the given frame to the server. + /// + public void Send(WebSocketFrame frame) + { + if (frame == null) + throw new ArgumentNullException("frame is null!"); + + if (closed || closeSent) + return; + + lock (SendLock) + { + this.unsentFrames.Add(frame); + + if (!sendThreadCreated) + { + HTTPManager.Logger.Information("WebSocketResponse", "Send - Creating thread"); +#if NETFX_CORE +#pragma warning disable 4014 + Windows.System.Threading.ThreadPool.RunAsync(SendThreadFunc); +#pragma warning restore 4014 +#else + ThreadPool.QueueUserWorkItem(SendThreadFunc); +#endif + sendThreadCreated = true; + } + } + + Interlocked.Add(ref this._bufferedAmount, frame.Data != null ? frame.DataLength : 0); + + //if (HTTPManager.Logger.Level <= Logger.Loglevels.All) + // HTTPManager.Logger.Information("WebSocketResponse", "Signaling SendThread!"); + + newFrameSignal.Set(); + } + + /// + /// It will send the given frame to the server by inserting the frame into the queue as the first element. + /// + public void Insert(WebSocketFrame frame) + { + if (frame == null) + throw new ArgumentNullException("frame is null!"); + + if (closed || closeSent) + return; + + lock (SendLock) + { + this.unsentFrames.Insert(0, frame); + + if (!sendThreadCreated) + { + HTTPManager.Logger.Information("WebSocketResponse", "Insert - Creating thread"); +#if NETFX_CORE +#pragma warning disable 4014 + Windows.System.Threading.ThreadPool.RunAsync(SendThreadFunc); +#pragma warning restore 4014 +#else + ThreadPool.QueueUserWorkItem(SendThreadFunc); +#endif + sendThreadCreated = true; + } + } + + Interlocked.Add(ref this._bufferedAmount, frame.Data != null ? frame.DataLength : 0); + + newFrameSignal.Set(); + } + + public void SendNow(WebSocketFrame frame) + { + if (frame == null) + throw new ArgumentNullException("frame is null!"); + + if (closed || closeSent) + return; + + using (var rawData = frame.Get()) + { + Stream.Write(rawData.Data, 0, rawData.Length); + Stream.Flush(); + } + + } + + /// + /// It will initiate the closing of the connection to the server. + /// + public void Close() + { + Close(1000, "Bye!"); + } + + /// + /// It will initiate the closing of the connection to the server. + /// + public void Close(UInt16 code, string msg) + { + if (closed) + return; + + lock (SendLock) + this.unsentFrames.Clear(); + + Interlocked.Exchange(ref this._bufferedAmount, 0); + + Send(new WebSocketFrame(this.WebSocket, WebSocketFrameTypes.ConnectionClose, WebSocket.EncodeCloseData(code, msg))); + } + + public void StartPinging(int frequency) + { + if (frequency < 100) + throw new ArgumentException("frequency must be at least 100 milliseconds!"); + + PingFrequnecy = TimeSpan.FromMilliseconds(frequency); + lastMessage = DateTime.UtcNow; + + SendPing(); + + HTTPManager.Heartbeats.Subscribe(this); + HTTPUpdateDelegator.OnApplicationForegroundStateChanged += OnApplicationForegroundStateChanged; + } + + #endregion + + #region Private Threading Functions + + private void SendThreadFunc(object param) + { + List localFrames = new List(); + try + { + while (!closed && !closeSent) + { + //if (HTTPManager.Logger.Level <= Logger.Loglevels.All) + // HTTPManager.Logger.Information("WebSocketResponse", "SendThread - Waiting..."); + newFrameSignal.WaitOne(); + + try + { + lock (SendLock) + { + // add frames int reversed order + for (int i = this.unsentFrames.Count - 1; i >= 0; --i) + localFrames.Add(this.unsentFrames[i]); + + this.unsentFrames.Clear(); + } + + //if (HTTPManager.Logger.Level <= Logger.Loglevels.All) + // HTTPManager.Logger.Information("WebSocketResponse", "SendThread - Wait is over, " + localFrames.Count.ToString() + " new frames!"); + + while (localFrames.Count > 0) + { + WebSocketFrame frame = localFrames[localFrames.Count - 1]; + localFrames.RemoveAt(localFrames.Count - 1); + + if (!closeSent) + { + using (var rawData = frame.Get()) + { + Stream.Write(rawData.Data, 0, rawData.Length); + } + + //if (frame.Type == WebSocketFrameTypes.Text) + VariableSizedBufferPool.Release(frame.Data); + + if (frame.Type == WebSocketFrameTypes.ConnectionClose) + closeSent = true; + } + + Interlocked.Add(ref this._bufferedAmount, -frame.DataLength); + } + + Stream.Flush(); + } + catch(Exception ex) + { + if (HTTPUpdateDelegator.IsCreated) + { + this.baseRequest.Exception = ex; + this.baseRequest.State = HTTPRequestStates.Error; + } + else + this.baseRequest.State = HTTPRequestStates.Aborted; + + closed = true; + } + } + } + finally + { + sendThreadCreated = false; + (newFrameSignal as IDisposable).Dispose(); + newFrameSignal = null; + + HTTPManager.Logger.Information("WebSocketResponse", "SendThread - Closed!"); + } + } + + private void ReceiveThreadFunc(object param) + { + try + { + using (var bufferedStream = new ReadOnlyBufferedStream(this.Stream)) + { + while (!closed) + { + try + { + WebSocketFrameReader frame = new WebSocketFrameReader(); + frame.Read(bufferedStream); + + lastMessage = DateTime.UtcNow; + + // A server MUST NOT mask any frames that it sends to the client. A client MUST close a connection if it detects a masked frame. + // In this case, it MAY use the status code 1002 (protocol error) + // (These rules might be relaxed in a future specification.) + if (frame.HasMask) + { + Close(1002, "Protocol Error: masked frame received from server!"); + continue; + } + + if (!frame.IsFinal) + { + if (OnIncompleteFrame == null) + IncompleteFrames.Add(frame); + else + lock (FrameLock) CompletedFrames.Add(frame); + continue; + } + + switch (frame.Type) + { + // For a complete documentation and rules on fragmentation see http://tools.ietf.org/html/rfc6455#section-5.4 + // A fragmented Frame's last fragment's opcode is 0 (Continuation) and the FIN bit is set to 1. + case WebSocketFrameTypes.Continuation: + // Do an assemble pass only if OnFragment is not set. Otherwise put it in the CompletedFrames, we will handle it in the HandleEvent phase. + if (OnIncompleteFrame == null) + { + frame.Assemble(IncompleteFrames); + + // Remove all incomplete frames + IncompleteFrames.Clear(); + + // Control frames themselves MUST NOT be fragmented. So, its a normal text or binary frame. Go, handle it as usual. + goto case WebSocketFrameTypes.Binary; + } + else + lock (FrameLock) CompletedFrames.Add(frame); + break; + + case WebSocketFrameTypes.Text: + case WebSocketFrameTypes.Binary: + frame.DecodeWithExtensions(WebSocket); + lock (FrameLock) CompletedFrames.Add(frame); + break; + + // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in response, unless it already received a Close frame. + case WebSocketFrameTypes.Ping: + if (!closeSent && !closed) + Send(new WebSocketFrame(this.WebSocket, WebSocketFrameTypes.Pong, frame.Data)); + break; + + case WebSocketFrameTypes.Pong: + try + { + // Get the ticks from the frame's payload + long ticksSent = BitConverter.ToInt64(frame.Data, 0); + + // the difference between the current time and the time when the ping message is sent + TimeSpan diff = TimeSpan.FromTicks(lastMessage.Ticks - ticksSent); + + // add it to the buffer + this.rtts.Add((int)diff.TotalMilliseconds); + + // and calculate the new latency + this.Latency = CalculateLatency(); + } + catch + { + // https://tools.ietf.org/html/rfc6455#section-5.5 + // A Pong frame MAY be sent unsolicited. This serves as a + // unidirectional heartbeat. A response to an unsolicited Pong frame is + // not expected. + } + + break; + + // If an endpoint receives a Close frame and did not previously send a Close frame, the endpoint MUST send a Close frame in response. + case WebSocketFrameTypes.ConnectionClose: + CloseFrame = frame; + if (!closeSent) + Send(new WebSocketFrame(this.WebSocket, WebSocketFrameTypes.ConnectionClose, null)); + closed = true; + break; + } + } +#if !NETFX_CORE + catch (ThreadAbortException) + { + IncompleteFrames.Clear(); + this.baseRequest.State = HTTPRequestStates.Aborted; + + closed = true; + + newFrameSignal.Set(); + } +#endif + catch (Exception e) + { + if (HTTPUpdateDelegator.IsCreated) + { + this.baseRequest.Exception = e; + this.baseRequest.State = HTTPRequestStates.Error; + } + else + this.baseRequest.State = HTTPRequestStates.Aborted; + + closed = true; + newFrameSignal.Set(); + } + } + } + } + finally + { + HTTPManager.Heartbeats.Unsubscribe(this); + HTTPUpdateDelegator.OnApplicationForegroundStateChanged -= OnApplicationForegroundStateChanged; + + HTTPManager.Logger.Information("WebSocketResponse", "ReceiveThread - Closed!"); + } + } + + #endregion + + #region Sending Out Events + + /// + /// Internal function to send out received messages. + /// + void IProtocol.HandleEvents() + { + frameCache.Clear(); + lock (FrameLock) + { + frameCache.AddRange(CompletedFrames); + CompletedFrames.Clear(); + } + + for (int i = 0; i < frameCache.Count; ++i) + { + WebSocketFrameReader frame = frameCache[i]; + + // Bugs in the clients shouldn't interrupt the code, so we need to try-catch and ignore any exception occurring here + try + { + switch (frame.Type) + { + case WebSocketFrameTypes.Continuation: + if (OnIncompleteFrame != null) + OnIncompleteFrame(this, frame); + break; + + case WebSocketFrameTypes.Text: + // Any not Final frame is handled as a fragment + if (!frame.IsFinal) + goto case WebSocketFrameTypes.Continuation; + + if (OnText != null) + OnText(this, frame.DataAsText); + break; + + case WebSocketFrameTypes.Binary: + // Any not Final frame is handled as a fragment + if (!frame.IsFinal) + goto case WebSocketFrameTypes.Continuation; + + if (OnBinary != null) + OnBinary(this, frame.Data); + break; + } + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocketResponse", "HandleEvents", ex); + } + } + + frameCache.Clear(); + + // 2015.05.09 + // State checking added because if there is an error the OnClose called first, and then the OnError. + // Now, when there is an error only the OnError event will be called! + if (IsClosed && OnClosed != null && baseRequest.State == HTTPRequestStates.Processing) + { + try + { + UInt16 statusCode = 0; + string msg = string.Empty; + + // If we received any data, we will get the status code and the message from it + if (/*CloseFrame != null && */CloseFrame.Data != null && CloseFrame.Data.Length >= 2) + { + if (BitConverter.IsLittleEndian) + Array.Reverse(CloseFrame.Data, 0, 2); + statusCode = BitConverter.ToUInt16(CloseFrame.Data, 0); + + if (CloseFrame.Data.Length > 2) + msg = Encoding.UTF8.GetString(CloseFrame.Data, 2, CloseFrame.Data.Length - 2); + + VariableSizedBufferPool.Release(CloseFrame.Data); + } + + OnClosed(this, statusCode, msg); + } + catch (Exception ex) + { + HTTPManager.Logger.Exception("WebSocketResponse", "HandleEvents - OnClosed", ex); + } + } + } + + #endregion + + #region IHeartbeat Implementation + + void IHeartbeat.OnHeartbeatUpdate(TimeSpan dif) + { + DateTime now = DateTime.UtcNow; + + if (now - lastPing >= PingFrequnecy) + SendPing(); + + if (now - (lastMessage + this.PingFrequnecy) > this.WebSocket.CloseAfterNoMesssage) + { + HTTPManager.Logger.Warning("WebSocketResponse", + string.Format("No message received in the given time! Closing WebSocket. LastMessage: {0}, PingFrequency: {1}, Close After: {2}, Now: {3}", + this.lastMessage, this.PingFrequnecy, this.WebSocket.CloseAfterNoMesssage, now)); + + CloseWithError("No message received in the given time!"); + } + } + + #endregion + + private void OnApplicationForegroundStateChanged(bool isPaused) + { + if (!isPaused) + lastMessage = DateTime.UtcNow; + } + + private void SendPing() + { + lastPing = DateTime.UtcNow; + + try + { + long ticks = DateTime.UtcNow.Ticks; + var ticksBytes = BitConverter.GetBytes(ticks); + + var pingFrame = new WebSocketFrame(this.WebSocket, WebSocketFrameTypes.Ping, ticksBytes); + + Insert(pingFrame); + } + catch + { + HTTPManager.Logger.Information("WebSocketResponse", "Error while sending PING message! Closing WebSocket."); + CloseWithError("Error while sending PING message!"); + } + } + + private void CloseWithError(string message) + { + this.baseRequest.Exception = new Exception(message); + this.baseRequest.State = HTTPRequestStates.Error; + + this.closed = true; + + HTTPManager.Heartbeats.Unsubscribe(this); + HTTPUpdateDelegator.OnApplicationForegroundStateChanged -= OnApplicationForegroundStateChanged; + + newFrameSignal.Set(); + CloseStream(); + } + + private int CalculateLatency() + { + if (this.rtts.Count == 0) + return 0; + + int sumLatency = 0; + for (int i = 0; i < this.rtts.Count; ++i) + sumLatency += this.rtts[i]; + + return sumLatency / this.rtts.Count; + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketResponse.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketResponse.cs.meta new file mode 100644 index 00000000..72de547b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketResponse.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 46daae4eb8da43145b58819255462ded +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketStatusCodes.cs b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketStatusCodes.cs new file mode 100644 index 00000000..97b457a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketStatusCodes.cs @@ -0,0 +1,83 @@ +#if !BESTHTTP_DISABLE_WEBSOCKET + +namespace BestHTTP.WebSocket +{ + /// + /// http://tools.ietf.org/html/rfc6455#section-7.4.1 + /// + public enum WebSocketStausCodes : ushort + { + /// + /// Indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled. + /// + NormalClosure = 1000, + + /// + /// Indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page. + /// + GoingAway = 1001, + + /// + /// Indicates that an endpoint is terminating the connection due to a protocol error. + /// + ProtocolError = 1002, + + /// + /// Indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept + /// (e.g., an endpoint that understands only text data MAY send this if it receives a binary message). + /// + WrongDataType = 1003, + + /// + /// Reserved. The specific meaning might be defined in the future. + /// + Reserved = 1004, + + /// + /// A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. + /// It is designated for use in applications expecting a status code to indicate that no status code was actually present. + /// + NoStatusCode = 1005, + + /// + /// A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. + /// It is designated for use in applications expecting a status code to indicate that the connection was closed abnormally, e.g., without sending or receiving a Close control frame. + /// + ClosedAbnormally = 1006, + + /// + /// Indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [RFC3629] data within a text message). + /// + DataError = 1007, + + /// + /// Indicates that an endpoint is terminating the connection because it has received a message that violates its policy. + /// This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy. + /// + PolicyError = 1008, + + /// + /// Indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process. + /// + TooBigMessage = 1009, + + /// + /// Indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, + /// but the server didn't return them in the response message of the WebSocket handshake. + /// The list of extensions that are needed SHOULD appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the WebSocket handshake instead. + /// + ExtensionExpected = 1010, + + /// + /// Indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request. + /// + WrongRequest = 1011, + + /// + /// A reserved value and MUST NOT be set as a status code in a Close control frame by an endpoint. It is designated for use in applications expecting a status code to indicate that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified). + /// + TLSHandshakeError = 1015 + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketStatusCodes.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketStatusCodes.cs.meta new file mode 100644 index 00000000..8030e652 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTP/WebSocket/WebSocketStatusCodes.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: b782b81b6b7755d478dc07521f33f09c +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTPDocumentationEN.pdf b/JNFrame/Assets/Plugins/BestHTTP/BestHTTPDocumentationEN.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d98b11800d81581e6ce7492c207f391b6eb1ef23 GIT binary patch literal 444035 zcmd3P2|QJ6_kWWNQAh~sph$6!GanhsJcP`1Ax_9VWhhBf(x7BaR79f)Mdm`0Bq^0C zG$${%yto41?v-VnDWmQQmn#{(s_7?ab z8w(aCg>u`mi;YEA7Gvn|PQ@tMc-uI;*<*BV?5SQT9Qaxvqh;f2zmDoEX=EUd!Weja z`q+9KdQz$SZf@Qv96<`cM%%{INyBxg8~8iWuT(n}xQ;3>kI|-j+t`6Wio%g_B=}Ne zN2)K?Q`eKalj=!zwS{g&!jYk`J$cM-cPgDF+2>=A3tGc;*LqD)6_#PNl910c+Sb&P3x0->sjW-p1uVz3- z!OsMKqoCm1f-7`A-E0l0-WC{Oo)|-_pEpLs1=yb=@v zSs^(pe8*jF_n!V;vcm+M3VYAtCcpj#`@W9(^*domgWEr~<_5C)e{gCO{nqiBL#X~$ z&E6x$d-wFekBh2*-C4Z^XC`r!F+Y6yV~1DR_~0si4ucrOZ@+j0EiYGfIeDPOd>J-~ zy$DT|2;Y@e9-=KI*4JS@!ZYuPn1;vsXKzzwip)+hv>DWtukL-(kMXMO`D5 z{fT*2@dxQ2cfWtowvk}><==sVw#Jj&*^W13Sj+Ykv721=x zv-SKBRHe6h<)T|{CDw;GwmBEgTecw?wcresfYxFGO$RxV^xGpwLfB7VWn1!_g1v&- zB16wUYJ19k`c^@;oOeTOPcfzKdXmc*#xC)}bao4^phFk3HRMXI7xXak^eZwpUz8ZV zd>(hqGWwY-TiRW5sk~BH!_DpwA40|CB?oTYvZ(%wI220mlN>4y{IV6-Orpaow7po zzC*+V=}X~Esz%33`lK8k9f_3XTg}tWs$;4%6a39%a-#WPC>Y3XM-z$c1n1_w_ht_I z2Tb3~@}5aN`K#%;yM8S1d9&w=IJ4u2gFl5dm5It>a$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+L-BrlZ+K_WQM5MyCHWr!UW6zW(~~yx(12oqhiL_roD?H{YM# zKRvx1a>a-Hvmbtcd^*&t>ev6={(O~JAn)GY1SWKMetvtChV$+1#pTEI%e$M~4|i`r z9IwA`@yp@*dcXVQ<;(NSU(XMZ`(3um@^$5Y_vX#VAMf_NZwFIJ``!O^eP^GZAO1Xi dyR5UH?jIgMzx;N{Mq=i!U3#eRDf)je{U2!(KHvZV literal 0 HcmV?d00001 diff --git a/JNFrame/Assets/Plugins/BestHTTP/BestHTTPDocumentationEN.pdf.meta b/JNFrame/Assets/Plugins/BestHTTP/BestHTTPDocumentationEN.pdf.meta new file mode 100644 index 00000000..a72cabe8 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/BestHTTPDocumentationEN.pdf.meta @@ -0,0 +1,38 @@ +fileFormatVersion: 2 +guid: 2613ad626d854294e8beb55d7c422bf3 +labels: +- http +- www +- web +- cache +- stream +- wp8 +- wsa +- metro +- rest +- api +- socket +- socket.io +- websocket +- websockets +- cookie +- proxy +- il2cpp +- android +- tcp +- https +- ios +- webrequest +- signalr +- eventsource +- server-sent +- events +- server-sentevents +- authentication +- samsung +- smart +- tv +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples.meta new file mode 100644 index 00000000..de54179f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 79615ddf0d3b0fd4b9b5ebe8943947a9 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP.meta new file mode 100644 index 00000000..f01a2fff --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 56badbd91a344cf49b819809ce60c94a +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/AssetBundleSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/AssetBundleSample.cs new file mode 100644 index 00000000..8bc7457c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/AssetBundleSample.cs @@ -0,0 +1,195 @@ +using System; +using System.Collections; +using System.Collections.Generic; + +using UnityEngine; +using BestHTTP; + +namespace BestHTTP.Examples +{ + public sealed class AssetBundleSample : MonoBehaviour + { + ///

    + /// The url of the resource to download + /// + private Uri URI = new Uri(GUIHelper.BaseURL + "/AssetBundles/WebGL/demobundle.assetbundle"); + + #region Private Fields + + /// + /// Debug status text + /// + string status = "Waiting for user interaction"; + + /// + /// The downloaded and cached AssetBundle + /// + AssetBundle cachedBundle; + + /// + /// The loaded texture from the AssetBundle + /// + Texture2D texture; + + /// + /// A flag that indicates that we are processing the request/bundle to hide the "Start Download" button. + /// + bool downloading; + + #endregion + + #region Unity Events + + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + GUILayout.Label("Status: " + status); + + // Draw the texture from the downloaded bundle + if (texture != null) + GUILayout.Box(texture, GUILayout.MaxHeight(256)); + + if (!downloading && GUILayout.Button("Start Download")) + { + UnloadBundle(); + + StartCoroutine(DownloadAssetBundle()); + } + }); + } + + void OnDestroy() + { + UnloadBundle(); + } + + #endregion + + #region Private Helper Functions + + IEnumerator DownloadAssetBundle() + { + downloading = true; + + // Create and send our request + var request = new HTTPRequest(URI).Send(); + + status = "Download started"; + + // Wait while it's finishes and add some fancy dots to display something while the user waits for it. + // A simple "yield return StartCoroutine(request);" would do the job too. + while (request.State < HTTPRequestStates.Finished) + { + yield return new WaitForSeconds(0.1f); + + status += "."; + } + + // Check the outcome of our request. + switch (request.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + + if (request.Response.IsSuccess) + { +#if !BESTHTTP_DISABLE_CACHING + status = string.Format("AssetBundle downloaded! Loaded from local cache: {0}", request.Response.IsFromCache.ToString()); +#else + status = "AssetBundle downloaded!"; +#endif + + // Start creating the downloaded asset bundle + AssetBundleCreateRequest async = +#if UNITY_5_3_OR_NEWER + AssetBundle.LoadFromMemoryAsync(request.Response.Data); +#else + AssetBundle.CreateFromMemory(request.Response.Data); +#endif + + // wait for it + yield return async; + + // And process the bundle + yield return StartCoroutine(ProcessAssetBundle(async.assetBundle)); + } + else + { + status = string.Format("Request finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + request.Response.StatusCode, + request.Response.Message, + request.Response.DataAsText); + Debug.LogWarning(status); + } + + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + status = "Request Finished with Error! " + (request.Exception != null ? (request.Exception.Message + "\n" + request.Exception.StackTrace) : "No Exception"); + Debug.LogError(status); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + status = "Request Aborted!"; + Debug.LogWarning(status); + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + status = "Connection Timed Out!"; + Debug.LogError(status); + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + status = "Processing the request Timed Out!"; + Debug.LogError(status); + break; + } + + downloading = false; + } + + /// + /// In this function we can do whatever we want with the freshly downloaded bundle. + /// In this example we will cache it for later use, and we will load a texture from it. + /// + IEnumerator ProcessAssetBundle(AssetBundle bundle) + { + if (bundle == null) + yield break; + + // Save the bundle for future use + cachedBundle = bundle; + + // Start loading the asset from the bundle + var asyncAsset = +#if UNITY_5_1 || UNITY_5_2 || UNITY_5_3_OR_NEWER + cachedBundle.LoadAssetAsync("9443182_orig", typeof(Texture2D)); +#else + + cachedBundle.LoadAsync("9443182_orig", typeof(Texture2D)); +#endif + + // wait til load + yield return asyncAsset; + + // get the texture + texture = asyncAsset.asset as Texture2D; + } + + void UnloadBundle() + { + if (cachedBundle != null) + { + cachedBundle.Unload(true); + cachedBundle = null; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/AssetBundleSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/AssetBundleSample.cs.meta new file mode 100644 index 00000000..f0a2b713 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/AssetBundleSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 03eab9c6191c5cd4c9613084e817bd29 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/LargeFileDownloadSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/LargeFileDownloadSample.cs new file mode 100644 index 00000000..d969564e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/LargeFileDownloadSample.cs @@ -0,0 +1,244 @@ +using System; +using System.Collections.Generic; + +using UnityEngine; +using BestHTTP; + +namespace BestHTTP.Examples +{ + public sealed class LargeFileDownloadSample : MonoBehaviour + { + /// + /// The url of the resource to download + /// + const string URL = "https://uk3.testmy.net/dl-102400"; + + #region Private Fields + + /// + /// Cached request to be able to abort it + /// + HTTPRequest request; + + /// + /// Debug status of the request + /// + string status = string.Empty; + + /// + /// Download(processing) progress. Its range is between [0..1] + /// + float progress; + + /// + /// The fragment size that we will set to the request + /// + int fragmentSize = HTTPResponse.MinBufferSize; + + #endregion + + #region Unity Events + + void Awake() + { + // If we have a non-finished download, set the progress to the value where we left it + if (PlayerPrefs.HasKey("DownloadLength")) + progress = PlayerPrefs.GetInt("DownloadProgress") / (float)PlayerPrefs.GetInt("DownloadLength"); + } + + void OnDestroy() + { + // Stop the download if we are leaving this example + if (request != null && request.State < HTTPRequestStates.Finished) + { + request.OnProgress = null; + request.Callback = null; + request.Abort(); + } + } + + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + // Draw the current status + GUILayout.Label("Request status: " + status); + + GUILayout.Space(5); + + // Draw the current progress + GUILayout.Label(string.Format("Progress: {0:P2} of {1:N0}Mb", progress, PlayerPrefs.GetInt("DownloadLength") / 1048576 /*1 Mb*/)); + GUILayout.HorizontalSlider(progress, 0, 1); + + GUILayout.Space(50); + + if (request == null) + { + // Draw a slider to be able to change the fragment size + GUILayout.Label(string.Format("Desired Fragment Size: {0:N} KBytes", fragmentSize / 1024f)); + fragmentSize = (int)GUILayout.HorizontalSlider(fragmentSize, HTTPResponse.MinBufferSize, 10 * 1024 * 1024); + + GUILayout.Space(5); + + string buttonStr = PlayerPrefs.HasKey("DownloadProgress") ? "Continue Download" : "Start Download"; + if (GUILayout.Button(buttonStr)) + StreamLargeFileTest(); + } + else if (request.State == HTTPRequestStates.Processing && GUILayout.Button("Abort Download")) + { + // Simulate a connection lost + request.Abort(); + } + }); + } + + #endregion + + #region Private Helper Functions + + // Calling this function again when the "DownloadProgress" key in the PlayerPrefs present will + // continue the download + void StreamLargeFileTest() + { + request = new HTTPRequest(new Uri(URL), (req, resp) => + { + switch (req.State) + { + // The request is currently processed. With UseStreaming == true, we can get the streamed fragments here + case HTTPRequestStates.Processing: + + // Set the DownloadLength, so we can display the progress + if (!PlayerPrefs.HasKey("DownloadLength")) + { + string value = resp.GetFirstHeaderValue("content-length"); + if (!string.IsNullOrEmpty(value)) + PlayerPrefs.SetInt("DownloadLength", int.Parse(value)); + } + + // Get the fragments, and save them + ProcessFragments(resp.GetStreamedFragments()); + + status = "Processing"; + break; + + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + // Save any remaining fragments + ProcessFragments(resp.GetStreamedFragments()); + + // Completely finished + if (resp.IsStreamingFinished) + { + status = "Streaming finished!"; + + // We are done, delete the progress key + PlayerPrefs.DeleteKey("DownloadProgress"); + PlayerPrefs.Save(); + + request = null; + } + else + status = "Processing"; + } + else + { + status = string.Format("Request finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText); + Debug.LogWarning(status); + + request = null; + } + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + status = "Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception"); + Debug.LogError(status); + + request = null; + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + status = "Request Aborted!"; + Debug.LogWarning(status); + + request = null; + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + status = "Connection Timed Out!"; + Debug.LogError(status); + + request = null; + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + status = "Processing the request Timed Out!"; + Debug.LogError(status); + + request = null; + break; + } + }); + + // Are there any progress, that we can continue? + if (PlayerPrefs.HasKey("DownloadProgress")) + // Set the range header + request.SetRangeHeader(PlayerPrefs.GetInt("DownloadProgress")); + else + // This is a new request + PlayerPrefs.SetInt("DownloadProgress", 0); + +#if !BESTHTTP_DISABLE_CACHING + // If we are writing our own file set it true(disable), so don't duplicate it on the file-system + request.DisableCache = true; +#endif + + // We want to access the downloaded bytes while we are still downloading + request.UseStreaming = true; + + // Set a reasonable high fragment size. Here it is 5 megabytes. + request.StreamFragmentSize = fragmentSize; + + // Start Processing the request + request.Send(); + } + + /// + /// In this function we can do whatever we want with the downloaded bytes. In this sample we will do nothing, just set the metadata to display progress. + /// + void ProcessFragments(List fragments) + { + if (fragments != null && fragments.Count > 0) + { + /*string dir = "TODO!"; + string filename = "TODO!"; + + using (System.IO.FileStream fs = new System.IO.FileStream(System.IO.Path.Combine(dir, filename), System.IO.FileMode.Append)) + for (int i = 0; i < fragments.Count; ++i) + fs.Write(fragments[i], 0, fragments[i].Length);*/ + + for (int i = 0; i < fragments.Count; ++i) + { + // Save how many bytes we wrote successfully + int downloaded = PlayerPrefs.GetInt("DownloadProgress") + fragments[i].Length; + PlayerPrefs.SetInt("DownloadProgress", downloaded); + } + + PlayerPrefs.Save(); + + // Set the progress to the actually processed bytes + progress = PlayerPrefs.GetInt("DownloadProgress") / (float)PlayerPrefs.GetInt("DownloadLength"); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/LargeFileDownloadSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/LargeFileDownloadSample.cs.meta new file mode 100644 index 00000000..414e7966 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/LargeFileDownloadSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 972fc2301f87c9e46bfb5523f2bc5090 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/TextureDownloadSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/TextureDownloadSample.cs new file mode 100644 index 00000000..663e251e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/TextureDownloadSample.cs @@ -0,0 +1,181 @@ +using System; +using System.Collections.Generic; + +using UnityEngine; +using BestHTTP; + +namespace BestHTTP.Examples +{ + public sealed class TextureDownloadSample : MonoBehaviour + { + /// + /// The URL of the server that will serve the image resources + /// + string BaseURL = GUIHelper.BaseURL + "/images/Demo/"; + + #region Private Fields + + /// + /// The downloadable images + /// + string[] Images = new string[9] { "One.png", "Two.png", "Three.png", "Four.png", "Five.png", "Six.png", "Seven.png", "Eight.png", "Nine.png" }; + + /// + /// The downloaded images will be stored as textures in this array + /// + Texture2D[] Textures = new Texture2D[9]; + +#if !BESTHTTP_DISABLE_CACHING + /// + /// True if all images are loaded from the local cache instead of the server + /// + bool allDownloadedFromLocalCache; +#endif + + /// + /// How many sent requests are finished + /// + int finishedCount; + + /// + /// GUI scroll position + /// + Vector2 scrollPos; + + #endregion + + #region Unity Events + + void Awake() + { + // Set a well observable value + // This is how many concurrent requests can be made to a server + HTTPManager.MaxConnectionPerServer = 1; + + // Create placeholder textures + for (int i = 0; i < Images.Length; ++i) + Textures[i] = new Texture2D(100, 150); + } + + void OnDestroy() + { + // Set back to its defualt value. + HTTPManager.MaxConnectionPerServer = 4; + } + + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + scrollPos = GUILayout.BeginScrollView(scrollPos); + + // Draw out the textures + GUILayout.SelectionGrid(0, Textures, 3); + +#if !BESTHTTP_DISABLE_CACHING + if (finishedCount == Images.Length && allDownloadedFromLocalCache) + GUIHelper.DrawCenteredText("All images loaded from the local cache!"); +#endif + + GUILayout.FlexibleSpace(); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Max Connection/Server: ", GUILayout.Width(150)); + GUILayout.Label(HTTPManager.MaxConnectionPerServer.ToString(), GUILayout.Width(20)); + HTTPManager.MaxConnectionPerServer = (byte)GUILayout.HorizontalSlider(HTTPManager.MaxConnectionPerServer, 1, 10); + GUILayout.EndHorizontal(); + + if (GUILayout.Button("Start Download")) + DownloadImages(); + + GUILayout.EndScrollView(); + }); + } + + #endregion + + #region Private Helper Functions + + void DownloadImages() + { + // Set these metadatas to its initial values +#if !BESTHTTP_DISABLE_CACHING + allDownloadedFromLocalCache = true; +#endif + finishedCount = 0; + + for (int i = 0; i < Images.Length; ++i) + { + // Set a blank placeholder texture, overriding previously downloaded texture + Textures[i] = new Texture2D(100, 150); + + // Construct the request + var request = new HTTPRequest(new Uri(BaseURL + Images[i]), ImageDownloaded); + + // Set the Tag property, we can use it as a general storage bound to the request + request.Tag = Textures[i]; + + // Send out the request + request.Send(); + } + } + + /// + /// Callback function of the image download http requests + /// + void ImageDownloaded(HTTPRequest req, HTTPResponse resp) + { + // Increase the finished count regardless of the state of our request + finishedCount++; + + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + // Get the Texture from the Tag property + Texture2D tex = req.Tag as Texture2D; + + // Load the texture + tex.LoadImage(resp.Data); + +#if !BESTHTTP_DISABLE_CACHING + // Update the cache-info variable + allDownloadedFromLocalCache = allDownloadedFromLocalCache && resp.IsFromCache; +#endif + } + else + { + Debug.LogWarning(string.Format("Request finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText)); + } + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + Debug.LogError("Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception")); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + Debug.LogWarning("Request Aborted!"); + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + Debug.LogError("Connection Timed Out!"); + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + Debug.LogError("Processing the request Timed Out!"); + break; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/TextureDownloadSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/TextureDownloadSample.cs.meta new file mode 100644 index 00000000..004ce335 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/TextureDownloadSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: af6ffe2bbf96d2b49ba3ef0713511d45 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/UploadStream.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/UploadStream.cs new file mode 100644 index 00000000..cdc42a91 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/UploadStream.cs @@ -0,0 +1,222 @@ +using BestHTTP; +using System; +using System.IO; +using System.Threading; + +namespace BestHTTP.Examples +{ + public sealed class UploadStream : Stream + { + #region Private Fields + + /// + /// Buffer for reads + /// + MemoryStream ReadBuffer = new MemoryStream(); + + /// + /// Buffer for writes + /// + MemoryStream WriteBuffer = new MemoryStream(); + + /// + /// Indicates that we will not write more data to this stream + /// + bool noMoreData; + + /// + /// For thread synchronization + /// + AutoResetEvent ARE = new AutoResetEvent(false); + + /// + /// For thread synchronization + /// + object locker = new object(); + + #endregion + + #region Properties + + /// + /// Name of this stream for easier debugging + /// + public string Name { get; private set; } + + /// + /// true if we are read all data from the read buffer + /// + private bool IsReadBufferEmpty { get { lock (locker) return ReadBuffer.Position == ReadBuffer.Length; } } + + #endregion + + #region Constructors + + public UploadStream(string name) + : this() + { + this.Name = name; + } + + public UploadStream() + { + this.ReadBuffer = new MemoryStream(); + this.WriteBuffer = new MemoryStream(); + this.Name = string.Empty; + } + + #endregion + + #region Stream Implementation + + public override int Read(byte[] buffer, int offset, int count) + { + // We will not push more data to the write buffer + if (noMoreData) + { + // No data left in the read buffer + if (ReadBuffer.Position == ReadBuffer.Length) + { + // Is there any data in the write buffer? If so, switch the buffers + if (WriteBuffer.Length > 0) + SwitchBuffers(); + else + { + HTTPManager.Logger.Information("UploadStream", string.Format("{0} - Read - End Of Stream", this.Name)); + return -1; + } + } + else + return ReadBuffer.Read(buffer, offset, count); + } + + // There are no more data in the read buffer? Wait for it. + if (IsReadBufferEmpty) + { + ARE.WaitOne(); + + lock (locker) + if (IsReadBufferEmpty && WriteBuffer.Length > 0) + SwitchBuffers(); + } + + int read = -1; + + lock (locker) + read = ReadBuffer.Read(buffer, offset, count); + + return read; + } + + public override void Write(byte[] buffer, int offset, int count) + { + if (noMoreData) + throw new System.ArgumentException("noMoreData already set!"); + + lock (locker) + { + WriteBuffer.Write(buffer, offset, count); + + SwitchBuffers(); + } + + ARE.Set(); + } + + public override void Flush() + { + Finish(); + } + + #endregion + + #region Dispose Implementation + + protected override void Dispose(bool disposing) + { + if (disposing) + { + HTTPManager.Logger.Information("UploadStream", string.Format("{0} - Dispose", this.Name)); + + ReadBuffer.Dispose(); + ReadBuffer = null; + + WriteBuffer.Dispose(); + WriteBuffer = null; + +#if NETFX_CORE + ARE.Dispose(); +#else + ARE.Close(); +#endif + ARE = null; + } + + base.Dispose(disposing); + } + + #endregion + + #region Helper Functions + + public void Finish() + { + if (noMoreData) + throw new System.ArgumentException("noMoreData already set!"); + + HTTPManager.Logger.Information("UploadStream", string.Format("{0} - Finish", this.Name)); + + noMoreData = true; + + ARE.Set(); + } + + private bool SwitchBuffers() + { + // Switch the buffers only when all data are consumed from our read buffer + lock (locker) + { + if (ReadBuffer.Position == ReadBuffer.Length) + { + // This buffer will be the read buffer, we need to seek back to the beginning + WriteBuffer.Seek(0, SeekOrigin.Begin); + + // This will be the write buffer, set the length to zero + ReadBuffer.SetLength(0); + + // switch the two buffers + MemoryStream tmp = WriteBuffer; + WriteBuffer = ReadBuffer; + ReadBuffer = tmp; + + return true; + } + } + + return false; + } + + #endregion + + #region Not Implemented Functions and Properties + + public override bool CanRead { get { throw new NotImplementedException(); } } + public override bool CanSeek { get { throw new NotImplementedException(); } } + public override bool CanWrite { get { throw new NotImplementedException(); } } + + public override long Length { get { throw new NotImplementedException(); } } + public override long Position { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } + + public override long Seek(long offset, SeekOrigin origin) + { + throw new NotImplementedException(); + } + + public override void SetLength(long value) + { + throw new NotImplementedException(); + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/UploadStream.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/UploadStream.cs.meta new file mode 100644 index 00000000..28ecb058 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/HTTP/UploadStream.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a2ab021301a7baf45a80b5a46275a140 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers.meta new file mode 100644 index 00000000..458e48a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 61ccf02e2b33b974b9bc1bfd84f2610c +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers/GUIHelper.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers/GUIHelper.cs new file mode 100644 index 00000000..8afb4712 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers/GUIHelper.cs @@ -0,0 +1,101 @@ +using System; +using UnityEngine; + +namespace BestHTTP.Examples +{ + public static class GUIHelper + { + public static string BaseURL = "https://besthttpdemosite.azurewebsites.net"; + + private static GUIStyle centerAlignedLabel; + private static GUIStyle rightAlignedLabel; + + public static Rect ClientArea; + + private static void Setup() + { + // These has to be called from OnGUI + if (centerAlignedLabel == null) + { + centerAlignedLabel = new GUIStyle(GUI.skin.label); + centerAlignedLabel.alignment = TextAnchor.MiddleCenter; + + rightAlignedLabel = new GUIStyle(GUI.skin.label); + rightAlignedLabel.alignment = TextAnchor.MiddleRight; + } + } + + public static void DrawArea(Rect area, bool drawHeader, Action action) + { + Setup(); + + // Draw background + GUI.Box(area, string.Empty); + GUILayout.BeginArea(area); + + if (drawHeader) + { + GUIHelper.DrawCenteredText(SampleSelector.SelectedSample.DisplayName); + GUILayout.Space(5); + } + + if (action != null) + action(); + + GUILayout.EndArea(); + } + + public static void DrawCenteredText(string msg) + { + Setup(); + + GUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + GUILayout.Label(msg, centerAlignedLabel); + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + } + + public static void DrawRow(string key, string value) + { + Setup(); + + GUILayout.BeginHorizontal(); + GUILayout.Label(key); + GUILayout.FlexibleSpace(); + GUILayout.Label(value, rightAlignedLabel); + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + } + } + + public class GUIMessageList + { + System.Collections.Generic.List messages = new System.Collections.Generic.List(); + Vector2 scrollPos; + + public void Draw() + { + Draw(Screen.width, 0); + } + + public void Draw(float minWidth, float minHeight) + { + scrollPos = GUILayout.BeginScrollView(scrollPos, false, false, GUILayout.MinHeight(minHeight)); + for (int i = 0; i < messages.Count; ++i) + GUILayout.Label(messages[i], GUILayout.MinWidth(minWidth)); + GUILayout.EndScrollView(); + } + + public void Add(string msg) + { + messages.Add(msg); + scrollPos = new Vector2(scrollPos.x, float.MaxValue); + } + + public void Clear() + { + messages.Clear(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers/GUIHelper.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers/GUIHelper.cs.meta new file mode 100644 index 00000000..e0eaec51 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/Helpers/GUIHelper.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: fd560ff6f0fa60844a43a82db1ad03be +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson.meta new file mode 100644 index 00000000..bad0f3c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e1e93ac0ec69bb948b0485b8ae204cee +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/IJsonWrapper.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/IJsonWrapper.cs new file mode 100644 index 00000000..ed89b503 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/IJsonWrapper.cs @@ -0,0 +1,73 @@ +#region Header +/** + * IJsonWrapper.cs + * Interface that represents a type capable of handling all kinds of JSON + * data. This is mainly used when mapping objects through JsonMapper, and + * it's implemented by JsonData. + * + * The authors disclaim copyright to this source code. For more details, see + * the COPYING file included with this distribution. + **/ +#endregion + + +using System.Collections; +using System.Collections.Specialized; + + +namespace LitJson +{ + public enum JsonType + { + None, + + Object, + Array, + String, + Int, + Long, + Double, + Boolean + } + + public interface IOrderedDictionary : IDictionary + { + new IDictionaryEnumerator GetEnumerator(); + void Insert(int index, object key, object value); + void RemoveAt(int index); + + object this[int index] + { + get; + set; + } + } + + public interface IJsonWrapper : IList, IOrderedDictionary + { + bool IsArray { get; } + bool IsBoolean { get; } + bool IsDouble { get; } + bool IsInt { get; } + bool IsLong { get; } + bool IsObject { get; } + bool IsString { get; } + + bool GetBoolean (); + double GetDouble (); + int GetInt (); + JsonType GetJsonType (); + long GetLong (); + string GetString (); + + void SetBoolean (bool val); + void SetDouble (double val); + void SetInt (int val); + void SetJsonType (JsonType type); + void SetLong (long val); + void SetString (string val); + + string ToJson (); + void ToJson (JsonWriter writer); + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/IJsonWrapper.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/IJsonWrapper.cs.meta new file mode 100644 index 00000000..3b178d0d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/IJsonWrapper.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: db4954c0960d19d4996b2ad47fdc364d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonData.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonData.cs new file mode 100644 index 00000000..59d30daa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonData.cs @@ -0,0 +1,1004 @@ +#region Header +/** + * JsonData.cs + * Generic type to hold JSON data (objects, arrays, and so on). This is + * the default type returned by JsonMapper.ToObject(). + * + * The authors disclaim copyright to this source code. For more details, see + * the COPYING file included with this distribution. + **/ +#endregion + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.IO; + + +namespace LitJson +{ + public sealed class JsonData : IJsonWrapper, IEquatable + { + #region Fields + private IList inst_array; + private bool inst_boolean; + private double inst_double; + private int inst_int; + private long inst_long; + private IDictionary inst_object; + private string inst_string; + private string json; + private JsonType type; + + // Used to implement the IOrderedDictionary interface + private IList> object_list; + #endregion + + + #region Properties + public int Count { + get { return EnsureCollection ().Count; } + } + + public bool IsArray { + get { return type == JsonType.Array; } + } + + public bool IsBoolean { + get { return type == JsonType.Boolean; } + } + + public bool IsDouble { + get { return type == JsonType.Double; } + } + + public bool IsInt { + get { return type == JsonType.Int; } + } + + public bool IsLong { + get { return type == JsonType.Long; } + } + + public bool IsObject { + get { return type == JsonType.Object; } + } + + public bool IsString { + get { return type == JsonType.String; } + } + + public ICollection Keys { + get { EnsureDictionary (); return inst_object.Keys; } + } + #endregion + + + #region ICollection Properties + int ICollection.Count { + get { + return Count; + } + } + + bool ICollection.IsSynchronized { + get { + return EnsureCollection ().IsSynchronized; + } + } + + object ICollection.SyncRoot { + get { + return EnsureCollection ().SyncRoot; + } + } + #endregion + + + #region IDictionary Properties + bool IDictionary.IsFixedSize { + get { + return EnsureDictionary ().IsFixedSize; + } + } + + bool IDictionary.IsReadOnly { + get { + return EnsureDictionary ().IsReadOnly; + } + } + + ICollection IDictionary.Keys { + get { + EnsureDictionary (); + IList keys = new List (); + + foreach (KeyValuePair entity in + object_list) { + keys.Add (entity.Key); + } + + return (ICollection) keys; + } + } + + ICollection IDictionary.Values { + get { + EnsureDictionary (); + IList values = new List (); + + foreach (KeyValuePair entity in + object_list) { + values.Add (entity.Value); + } + + return (ICollection) values; + } + } + #endregion + + + + #region IJsonWrapper Properties + bool IJsonWrapper.IsArray { + get { return IsArray; } + } + + bool IJsonWrapper.IsBoolean { + get { return IsBoolean; } + } + + bool IJsonWrapper.IsDouble { + get { return IsDouble; } + } + + bool IJsonWrapper.IsInt { + get { return IsInt; } + } + + bool IJsonWrapper.IsLong { + get { return IsLong; } + } + + bool IJsonWrapper.IsObject { + get { return IsObject; } + } + + bool IJsonWrapper.IsString { + get { return IsString; } + } + #endregion + + + #region IList Properties + bool IList.IsFixedSize { + get { + return EnsureList ().IsFixedSize; + } + } + + bool IList.IsReadOnly { + get { + return EnsureList ().IsReadOnly; + } + } + #endregion + + + #region IDictionary Indexer + object IDictionary.this[object key] { + get { + return EnsureDictionary ()[key]; + } + + set { + if (! (key is String)) + throw new ArgumentException ( + "The key has to be a string"); + + JsonData data = ToJsonData (value); + + this[(string) key] = data; + } + } + #endregion + + + #region IOrderedDictionary Indexer + object IOrderedDictionary.this[int idx] { + get { + EnsureDictionary (); + return object_list[idx].Value; + } + + set { + EnsureDictionary (); + JsonData data = ToJsonData (value); + + KeyValuePair old_entity = object_list[idx]; + + inst_object[old_entity.Key] = data; + + KeyValuePair entity = + new KeyValuePair (old_entity.Key, data); + + object_list[idx] = entity; + } + } + #endregion + + + #region IList Indexer + object IList.this[int index] { + get { + return EnsureList ()[index]; + } + + set { + EnsureList (); + JsonData data = ToJsonData (value); + + this[index] = data; + } + } + #endregion + + + #region Public Indexers + public JsonData this[string prop_name] { + get { + EnsureDictionary (); + return inst_object[prop_name]; + } + + set { + EnsureDictionary (); + + KeyValuePair entity = + new KeyValuePair (prop_name, value); + + if (inst_object.ContainsKey (prop_name)) { + for (int i = 0; i < object_list.Count; i++) { + if (object_list[i].Key == prop_name) { + object_list[i] = entity; + break; + } + } + } else + object_list.Add (entity); + + inst_object[prop_name] = value; + + json = null; + } + } + + public JsonData this[int index] { + get { + EnsureCollection (); + + if (type == JsonType.Array) + return inst_array[index]; + + return object_list[index].Value; + } + + set { + EnsureCollection (); + + if (type == JsonType.Array) + inst_array[index] = value; + else { + KeyValuePair entity = object_list[index]; + KeyValuePair new_entity = + new KeyValuePair (entity.Key, value); + + object_list[index] = new_entity; + inst_object[entity.Key] = value; + } + + json = null; + } + } + #endregion + + + #region Constructors + public JsonData () + { + } + + public JsonData (bool boolean) + { + type = JsonType.Boolean; + inst_boolean = boolean; + } + + public JsonData (double number) + { + type = JsonType.Double; + inst_double = number; + } + + public JsonData (int number) + { + type = JsonType.Int; + inst_int = number; + } + + public JsonData (long number) + { + type = JsonType.Long; + inst_long = number; + } + + public JsonData (object obj) + { + if (obj is Boolean) { + type = JsonType.Boolean; + inst_boolean = (bool) obj; + return; + } + + if (obj is Double) { + type = JsonType.Double; + inst_double = (double) obj; + return; + } + + if (obj is Int32) { + type = JsonType.Int; + inst_int = (int) obj; + return; + } + + if (obj is Int64) { + type = JsonType.Long; + inst_long = (long) obj; + return; + } + + if (obj is String) { + type = JsonType.String; + inst_string = (string) obj; + return; + } + + throw new ArgumentException ( + "Unable to wrap the given object with JsonData"); + } + + public JsonData (string str) + { + type = JsonType.String; + inst_string = str; + } + #endregion + + + #region Implicit Conversions + public static implicit operator JsonData (Boolean data) + { + return new JsonData (data); + } + + public static implicit operator JsonData (Double data) + { + return new JsonData (data); + } + + public static implicit operator JsonData (Int32 data) + { + return new JsonData (data); + } + + public static implicit operator JsonData (Int64 data) + { + return new JsonData (data); + } + + public static implicit operator JsonData (String data) + { + return new JsonData (data); + } + #endregion + + + #region Explicit Conversions + public static explicit operator Boolean (JsonData data) + { + if (data.type != JsonType.Boolean) + throw new InvalidCastException ( + "Instance of JsonData doesn't hold a double"); + + return data.inst_boolean; + } + + public static explicit operator Double (JsonData data) + { + if (data.type != JsonType.Double) + throw new InvalidCastException ( + "Instance of JsonData doesn't hold a double"); + + return data.inst_double; + } + + public static explicit operator Int32 (JsonData data) + { + if (data.type != JsonType.Int) + throw new InvalidCastException ( + "Instance of JsonData doesn't hold an int"); + + return data.inst_int; + } + + public static explicit operator Int64 (JsonData data) + { + if (data.type != JsonType.Long) + throw new InvalidCastException ( + "Instance of JsonData doesn't hold an int"); + + return data.inst_long; + } + + public static explicit operator String (JsonData data) + { + if (data.type != JsonType.String) + throw new InvalidCastException ( + "Instance of JsonData doesn't hold a string"); + + return data.inst_string; + } + #endregion + + + #region ICollection Methods + void ICollection.CopyTo (Array array, int index) + { + EnsureCollection ().CopyTo (array, index); + } + #endregion + + + #region IDictionary Methods + void IDictionary.Add (object key, object value) + { + JsonData data = ToJsonData (value); + + EnsureDictionary ().Add (key, data); + + KeyValuePair entity = + new KeyValuePair ((string) key, data); + object_list.Add (entity); + + json = null; + } + + void IDictionary.Clear () + { + EnsureDictionary ().Clear (); + object_list.Clear (); + json = null; + } + + bool IDictionary.Contains (object key) + { + return EnsureDictionary ().Contains (key); + } + + IDictionaryEnumerator IDictionary.GetEnumerator () + { + return ((IOrderedDictionary) this).GetEnumerator (); + } + + void IDictionary.Remove (object key) + { + EnsureDictionary ().Remove (key); + + for (int i = 0; i < object_list.Count; i++) { + if (object_list[i].Key == (string) key) { + object_list.RemoveAt (i); + break; + } + } + + json = null; + } + #endregion + + + #region IEnumerable Methods + IEnumerator IEnumerable.GetEnumerator () + { + return EnsureCollection ().GetEnumerator (); + } + #endregion + + + #region IJsonWrapper Methods + bool IJsonWrapper.GetBoolean () + { + if (type != JsonType.Boolean) + throw new InvalidOperationException ( + "JsonData instance doesn't hold a boolean"); + + return inst_boolean; + } + + double IJsonWrapper.GetDouble () + { + if (type != JsonType.Double) + throw new InvalidOperationException ( + "JsonData instance doesn't hold a double"); + + return inst_double; + } + + int IJsonWrapper.GetInt () + { + if (type != JsonType.Int) + throw new InvalidOperationException ( + "JsonData instance doesn't hold an int"); + + return inst_int; + } + + long IJsonWrapper.GetLong () + { + if (type != JsonType.Long) + throw new InvalidOperationException ( + "JsonData instance doesn't hold a long"); + + return inst_long; + } + + string IJsonWrapper.GetString () + { + if (type != JsonType.String) + throw new InvalidOperationException ( + "JsonData instance doesn't hold a string"); + + return inst_string; + } + + void IJsonWrapper.SetBoolean (bool val) + { + type = JsonType.Boolean; + inst_boolean = val; + json = null; + } + + void IJsonWrapper.SetDouble (double val) + { + type = JsonType.Double; + inst_double = val; + json = null; + } + + void IJsonWrapper.SetInt (int val) + { + type = JsonType.Int; + inst_int = val; + json = null; + } + + void IJsonWrapper.SetLong (long val) + { + type = JsonType.Long; + inst_long = val; + json = null; + } + + void IJsonWrapper.SetString (string val) + { + type = JsonType.String; + inst_string = val; + json = null; + } + + string IJsonWrapper.ToJson () + { + return ToJson (); + } + + void IJsonWrapper.ToJson (JsonWriter writer) + { + ToJson (writer); + } + #endregion + + + #region IList Methods + int IList.Add (object value) + { + return Add (value); + } + + void IList.Clear () + { + EnsureList ().Clear (); + json = null; + } + + bool IList.Contains (object value) + { + return EnsureList ().Contains (value); + } + + int IList.IndexOf (object value) + { + return EnsureList ().IndexOf (value); + } + + void IList.Insert (int index, object value) + { + EnsureList ().Insert (index, value); + json = null; + } + + void IList.Remove (object value) + { + EnsureList ().Remove (value); + json = null; + } + + void IList.RemoveAt (int index) + { + EnsureList ().RemoveAt (index); + json = null; + } + #endregion + + + #region IOrderedDictionary Methods + IDictionaryEnumerator IOrderedDictionary.GetEnumerator () + { + EnsureDictionary (); + + return new OrderedDictionaryEnumerator ( + object_list.GetEnumerator ()); + } + + void IOrderedDictionary.Insert (int idx, object key, object value) + { + string property = (string) key; + JsonData data = ToJsonData (value); + + this[property] = data; + + KeyValuePair entity = + new KeyValuePair (property, data); + + object_list.Insert (idx, entity); + } + + void IOrderedDictionary.RemoveAt (int idx) + { + EnsureDictionary (); + + inst_object.Remove (object_list[idx].Key); + object_list.RemoveAt (idx); + } + #endregion + + + #region Private Methods + private ICollection EnsureCollection () + { + if (type == JsonType.Array) + return (ICollection) inst_array; + + if (type == JsonType.Object) + return (ICollection) inst_object; + + throw new InvalidOperationException ( + "The JsonData instance has to be initialized first"); + } + + private IDictionary EnsureDictionary () + { + if (type == JsonType.Object) + return (IDictionary) inst_object; + + if (type != JsonType.None) + throw new InvalidOperationException ( + "Instance of JsonData is not a dictionary"); + + type = JsonType.Object; + inst_object = new Dictionary (); + object_list = new List> (); + + return (IDictionary) inst_object; + } + + private IList EnsureList () + { + if (type == JsonType.Array) + return (IList) inst_array; + + if (type != JsonType.None) + throw new InvalidOperationException ( + "Instance of JsonData is not a list"); + + type = JsonType.Array; + inst_array = new List (); + + return (IList) inst_array; + } + + private JsonData ToJsonData (object obj) + { + if (obj == null) + return null; + + if (obj is JsonData) + return (JsonData) obj; + + return new JsonData (obj); + } + + private static void WriteJson (IJsonWrapper obj, JsonWriter writer) + { + if (obj == null) { + writer.Write (null); + return; + } + + if (obj.IsString) { + writer.Write (obj.GetString ()); + return; + } + + if (obj.IsBoolean) { + writer.Write (obj.GetBoolean ()); + return; + } + + if (obj.IsDouble) { + writer.Write (obj.GetDouble ()); + return; + } + + if (obj.IsInt) { + writer.Write (obj.GetInt ()); + return; + } + + if (obj.IsLong) { + writer.Write (obj.GetLong ()); + return; + } + + if (obj.IsArray) { + writer.WriteArrayStart (); + foreach (object elem in (IList) obj) + WriteJson ((JsonData) elem, writer); + writer.WriteArrayEnd (); + + return; + } + + if (obj.IsObject) { + writer.WriteObjectStart (); + + foreach (DictionaryEntry entity in ((IDictionary)obj)) + { + writer.WritePropertyName ((string) entity.Key); + WriteJson ((JsonData) entity.Value, writer); + } + writer.WriteObjectEnd (); + + return; + } + } + #endregion + + + public int Add (object value) + { + JsonData data = ToJsonData (value); + + json = null; + + return EnsureList ().Add (data); + } + + public void Clear () + { + if (IsObject) { + ((IDictionary) this).Clear (); + return; + } + + if (IsArray) { + ((IList) this).Clear (); + return; + } + } + + public bool Equals (JsonData x) + { + if (x == null) + return false; + + if (x.type != this.type) + return false; + + switch (this.type) { + case JsonType.None: + return true; + + case JsonType.Object: + return this.inst_object.Equals (x.inst_object); + + case JsonType.Array: + return this.inst_array.Equals (x.inst_array); + + case JsonType.String: + return this.inst_string.Equals (x.inst_string); + + case JsonType.Int: + return this.inst_int.Equals (x.inst_int); + + case JsonType.Long: + return this.inst_long.Equals (x.inst_long); + + case JsonType.Double: + return this.inst_double.Equals (x.inst_double); + + case JsonType.Boolean: + return this.inst_boolean.Equals (x.inst_boolean); + } + + return false; + } + + public JsonType GetJsonType () + { + return type; + } + + public void SetJsonType (JsonType type) + { + if (this.type == type) + return; + + switch (type) { + case JsonType.None: + break; + + case JsonType.Object: + inst_object = new Dictionary (); + object_list = new List> (); + break; + + case JsonType.Array: + inst_array = new List (); + break; + + case JsonType.String: + inst_string = default (String); + break; + + case JsonType.Int: + inst_int = default (Int32); + break; + + case JsonType.Long: + inst_long = default (Int64); + break; + + case JsonType.Double: + inst_double = default (Double); + break; + + case JsonType.Boolean: + inst_boolean = default (Boolean); + break; + } + + this.type = type; + } + + public string ToJson () + { + if (json != null) + return json; + + StringWriter sw = new StringWriter (); + JsonWriter writer = new JsonWriter (sw); + writer.Validate = false; + + WriteJson (this, writer); + json = sw.ToString (); + + return json; + } + + public void ToJson (JsonWriter writer) + { + bool old_validate = writer.Validate; + + writer.Validate = false; + + WriteJson (this, writer); + + writer.Validate = old_validate; + } + + public override string ToString () + { + switch (type) { + case JsonType.Array: + return "JsonData array"; + + case JsonType.Boolean: + return inst_boolean.ToString (); + + case JsonType.Double: + return inst_double.ToString (); + + case JsonType.Int: + return inst_int.ToString (); + + case JsonType.Long: + return inst_long.ToString (); + + case JsonType.Object: + return "JsonData object"; + + case JsonType.String: + return inst_string; + } + + return "Uninitialized JsonData"; + } + } + + + internal class OrderedDictionaryEnumerator : IDictionaryEnumerator + { + IEnumerator> list_enumerator; + + + public object Current { + get { return Entry; } + } + + public DictionaryEntry Entry + { + get { + KeyValuePair curr = list_enumerator.Current; + return new DictionaryEntry(curr.Key, curr.Value); + } + } + + public object Key { + get { return list_enumerator.Current.Key; } + } + + public object Value { + get { return list_enumerator.Current.Value; } + } + + + public OrderedDictionaryEnumerator ( + IEnumerator> enumerator) + { + list_enumerator = enumerator; + } + + + public bool MoveNext () + { + return list_enumerator.MoveNext (); + } + + public void Reset () + { + list_enumerator.Reset (); + } + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonData.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonData.cs.meta new file mode 100644 index 00000000..ba987ac1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonData.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d992e71a7032d1c458a25f6effb6e03d +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonException.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonException.cs new file mode 100644 index 00000000..61a6e423 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonException.cs @@ -0,0 +1,60 @@ +#region Header +/** + * JsonException.cs + * Base class throwed by LitJSON when a parsing error occurs. + * + * The authors disclaim copyright to this source code. For more details, see + * the COPYING file included with this distribution. + **/ +#endregion + + +using System; + + +namespace LitJson +{ + public class JsonException : Exception + { + public JsonException () : base () + { + } + + internal JsonException (ParserToken token) : + base (String.Format ( + "Invalid token '{0}' in input string", token)) + { + } + + internal JsonException (ParserToken token, + Exception inner_exception) : + base (String.Format ( + "Invalid token '{0}' in input string", token), + inner_exception) + { + } + + internal JsonException (int c) : + base (String.Format ( + "Invalid character '{0}' in input string", (char) c)) + { + } + + internal JsonException (int c, Exception inner_exception) : + base (String.Format ( + "Invalid character '{0}' in input string", (char) c), + inner_exception) + { + } + + + public JsonException (string message) : base (message) + { + } + + public JsonException (string message, Exception inner_exception) : + base (message, inner_exception) + { + } + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonException.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonException.cs.meta new file mode 100644 index 00000000..40731e51 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonException.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2d8be66110036ea4782540091a745448 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMapper.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMapper.cs new file mode 100644 index 00000000..0558aa6a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMapper.cs @@ -0,0 +1,1014 @@ +#region Header +/** + * JsonMapper.cs + * JSON to .Net object and object to JSON conversions. + * + * The authors disclaim copyright to this source code. For more details, see + * the COPYING file included with this distribution. + **/ +#endregion + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Reflection; + +#if NETFX_CORE +//using System.Reflection.IntrospectionExtensions; +#endif + +namespace LitJson +{ + internal struct PropertyMetadata + { + public MemberInfo Info; + public bool IsField; + public Type Type; + } + + + internal struct ArrayMetadata + { + private Type element_type; + private bool is_array; + private bool is_list; + + + public Type ElementType { + get { + if (element_type == null) + return typeof (JsonData); + + return element_type; + } + + set { element_type = value; } + } + + public bool IsArray { + get { return is_array; } + set { is_array = value; } + } + + public bool IsList { + get { return is_list; } + set { is_list = value; } + } + } + + + internal struct ObjectMetadata + { + private Type element_type; + private bool is_dictionary; + + private IDictionary properties; + + + public Type ElementType { + get { + if (element_type == null) + return typeof (JsonData); + + return element_type; + } + + set { element_type = value; } + } + + public bool IsDictionary { + get { return is_dictionary; } + set { is_dictionary = value; } + } + + public IDictionary Properties { + get { return properties; } + set { properties = value; } + } + } + + + internal delegate void ExporterFunc (object obj, JsonWriter writer); + public delegate void ExporterFunc (T obj, JsonWriter writer); + + internal delegate object ImporterFunc (object input); + public delegate TValue ImporterFunc (TJson input); + + public delegate IJsonWrapper WrapperFactory (); + + + public sealed class JsonMapper + { + #region Fields + private static int max_nesting_depth; + + private static IFormatProvider datetime_format; + + private static IDictionary base_exporters_table; + private static IDictionary custom_exporters_table; + + private static IDictionary> base_importers_table; + private static IDictionary> custom_importers_table; + + private static IDictionary array_metadata; + private static readonly object array_metadata_lock = new Object (); + + private static IDictionary> conv_ops; + private static readonly object conv_ops_lock = new Object (); + + private static IDictionary object_metadata; + private static readonly object object_metadata_lock = new Object (); + + private static IDictionary> type_properties; + private static readonly object type_properties_lock = new Object (); + + private static JsonWriter static_writer; + private static readonly object static_writer_lock = new Object (); + #endregion + + + #region Constructors + static JsonMapper () + { + max_nesting_depth = 100; + + array_metadata = new Dictionary (); + conv_ops = new Dictionary> (); + object_metadata = new Dictionary (); + type_properties = new Dictionary> (); + + static_writer = new JsonWriter (); + + datetime_format = DateTimeFormatInfo.InvariantInfo; + + base_exporters_table = new Dictionary (); + custom_exporters_table = new Dictionary (); + + base_importers_table = new Dictionary> (); + custom_importers_table = new Dictionary> (); + + RegisterBaseExporters (); + RegisterBaseImporters (); + } + #endregion + + #region Private Helper Mehtods + + private static bool HasInterface(Type type, string name) + { +#if NETFX_CORE + foreach (Type type1 in IntrospectionExtensions.GetTypeInfo(type).ImplementedInterfaces) + if (type1.FullName == name) + return true; + return false; +#elif NET_4_6 + Type[] interfaces = type.GetInterfaces(); + foreach (var iface in interfaces) + { + if (iface.FullName.Equals(name, StringComparison.OrdinalIgnoreCase)) + return true; + } + + return false; +#else + return type.GetInterface(name, true) != null; +#endif + } + + public static PropertyInfo[] GetPublicInstanceProperties(Type type) + { +#if NETFX_CORE + List list = new List(); + foreach (PropertyInfo propertyInfo in RuntimeReflectionExtensions.GetRuntimeProperties(type)) + { + if (propertyInfo.GetMethod.IsPublic && !propertyInfo.GetMethod.IsStatic) + list.Add(propertyInfo); + } + return list.ToArray(); +#else + return type.GetProperties(); +#endif + } + + #endregion + + #region Private Methods + private static void AddArrayMetadata (Type type) + { + if (array_metadata.ContainsKey (type)) + return; + + ArrayMetadata data = new ArrayMetadata (); + + data.IsArray = type.IsArray; + + if (HasInterface(type, "System.Collections.IList")) + data.IsList = true; + + foreach (PropertyInfo p_info in GetPublicInstanceProperties(type)) + { + if (p_info.Name != "Item") + continue; + + ParameterInfo[] parameters = p_info.GetIndexParameters (); + + if (parameters.Length != 1) + continue; + + if (parameters[0].ParameterType == typeof (int)) + data.ElementType = p_info.PropertyType; + } + + lock (array_metadata_lock) { + try { + array_metadata.Add (type, data); + } catch (ArgumentException) { + return; + } + } + } + + private static void AddObjectMetadata (Type type) + { + if (object_metadata.ContainsKey (type)) + return; + + ObjectMetadata data = new ObjectMetadata (); + + if (HasInterface(type, "System.Collections.IDictionary")) + data.IsDictionary = true; + + data.Properties = new Dictionary (StringComparer.OrdinalIgnoreCase); + + foreach (PropertyInfo p_info in GetPublicInstanceProperties(type)) + { + if (p_info.Name == "Item") { + ParameterInfo[] parameters = p_info.GetIndexParameters (); + + if (parameters.Length != 1) + continue; + + if (parameters[0].ParameterType == typeof (string)) + data.ElementType = p_info.PropertyType; + + continue; + } + + PropertyMetadata p_data = new PropertyMetadata (); + p_data.Info = p_info; + p_data.Type = p_info.PropertyType; + + data.Properties.Add (p_info.Name, p_data); + } + + foreach (FieldInfo f_info in +#if NETFX_CORE + type.GetRuntimeFields() +#else + type.GetFields() +#endif + ) + { + PropertyMetadata p_data = new PropertyMetadata (); + p_data.Info = f_info; + p_data.IsField = true; + p_data.Type = f_info.FieldType; + + if (!data.Properties.ContainsKey(f_info.Name)) + data.Properties.Add (f_info.Name, p_data); + } + + lock (object_metadata_lock) { + try { + object_metadata.Add (type, data); + } catch (ArgumentException) { + return; + } + } + } + + private static void AddTypeProperties (Type type) + { + if (type_properties.ContainsKey (type)) + return; + + IList props = new List (); + + foreach (PropertyInfo p_info in GetPublicInstanceProperties(type)) { + if (p_info.Name == "Item") + continue; + + PropertyMetadata p_data = new PropertyMetadata (); + p_data.Info = p_info; + p_data.IsField = false; + props.Add (p_data); + } + + foreach (FieldInfo f_info in +#if NETFX_CORE + type.GetRuntimeFields() +#else + type.GetFields() +#endif + ) + { + PropertyMetadata p_data = new PropertyMetadata (); + p_data.Info = f_info; + p_data.IsField = true; + + props.Add (p_data); + } + + lock (type_properties_lock) { + try { + type_properties.Add (type, props); + } catch (ArgumentException) { + return; + } + } + } + + private static MethodInfo GetConvOp (Type t1, Type t2) + { + lock (conv_ops_lock) { + if (! conv_ops.ContainsKey (t1)) + conv_ops.Add (t1, new Dictionary ()); + } + + if (conv_ops[t1].ContainsKey (t2)) + return conv_ops[t1][t2]; + + MethodInfo op = +#if NETFX_CORE + t1.GetRuntimeMethod ("op_Implicit", new Type[] { t2 }); +#else + t1.GetMethod("op_Implicit", new Type[] { t2 }); +#endif + + lock (conv_ops_lock) { + try { + conv_ops[t1].Add (t2, op); + } catch (ArgumentException) { + return conv_ops[t1][t2]; + } + } + + return op; + } + + private static object ReadValue (Type inst_type, JsonReader reader) + { + reader.Read (); + + if (reader.Token == JsonToken.ArrayEnd) + return null; + + if (reader.Token == JsonToken.Null) { + +#if NETFX_CORE + if (! inst_type.GetTypeInfo().IsClass) +#else + if (! inst_type.IsClass) +#endif + throw new JsonException (String.Format ( + "Can't assign null to an instance of type {0}", + inst_type)); + + return null; + } + + if (reader.Token == JsonToken.Double || + reader.Token == JsonToken.Int || + reader.Token == JsonToken.Long || + reader.Token == JsonToken.String || + reader.Token == JsonToken.Boolean) { + + Type json_type = reader.Value.GetType (); + +#if NETFX_CORE + if (inst_type.GetTypeInfo().IsAssignableFrom (json_type.GetTypeInfo())) +#else + if (inst_type.IsAssignableFrom(json_type)) +#endif + return reader.Value; + + // If there's a custom importer that fits, use it + if (custom_importers_table.ContainsKey (json_type) && + custom_importers_table[json_type].ContainsKey ( + inst_type)) { + + ImporterFunc importer = + custom_importers_table[json_type][inst_type]; + + return importer (reader.Value); + } + + // Maybe there's a base importer that works + if (base_importers_table.ContainsKey (json_type) && + base_importers_table[json_type].ContainsKey ( + inst_type)) { + + ImporterFunc importer = + base_importers_table[json_type][inst_type]; + + return importer (reader.Value); + } + + // Maybe it's an enum +#if NETFX_CORE + if (inst_type.GetTypeInfo().IsEnum) +#else + if (inst_type.IsEnum) +#endif + return Enum.ToObject (inst_type, reader.Value); + + // Try using an implicit conversion operator + MethodInfo conv_op = GetConvOp (inst_type, json_type); + + if (conv_op != null) + return conv_op.Invoke (null, + new object[] { reader.Value }); + + // No luck + throw new JsonException (String.Format ( + "Can't assign value '{0}' (type {1}) to type {2}", + reader.Value, json_type, inst_type)); + } + + object instance = null; + + if (reader.Token == JsonToken.ArrayStart) { + + if (inst_type.FullName == "System.Object") + inst_type = typeof(object[]); + + AddArrayMetadata (inst_type); + ArrayMetadata t_data = array_metadata[inst_type]; + + if (! t_data.IsArray && ! t_data.IsList) + throw new JsonException (String.Format ( + "Type {0} can't act as an array", + inst_type)); + + IList list; + Type elem_type; + + if (! t_data.IsArray) { + list = (IList) Activator.CreateInstance (inst_type); + elem_type = t_data.ElementType; + } else { + list = new System.Collections.Generic.List(); + elem_type = inst_type.GetElementType (); + } + + while (true) { + object item = ReadValue (elem_type, reader); + if (item == null && reader.Token == JsonToken.ArrayEnd) + break; + + list.Add (item); + } + + if (t_data.IsArray) { + int n = list.Count; + instance = Array.CreateInstance (elem_type, n); + + for (int i = 0; i < n; i++) + ((Array) instance).SetValue (list[i], i); + } else + instance = list; + + } else if (reader.Token == JsonToken.ObjectStart) { + + if (inst_type == typeof(System.Object)) + inst_type = typeof(Dictionary); + + AddObjectMetadata (inst_type); + ObjectMetadata t_data = object_metadata[inst_type]; + + instance = Activator.CreateInstance (inst_type); + + while (true) { + reader.Read (); + + if (reader.Token == JsonToken.ObjectEnd) + break; + + string property = (string) reader.Value; + + if (t_data.Properties.ContainsKey (property)) { + PropertyMetadata prop_data = + t_data.Properties[property]; + + if (prop_data.IsField) { + ((FieldInfo) prop_data.Info).SetValue ( + instance, ReadValue (prop_data.Type, reader)); + } else { + PropertyInfo p_info = + (PropertyInfo) prop_data.Info; + + if (p_info.CanWrite) + p_info.SetValue ( + instance, + ReadValue (prop_data.Type, reader), + null); + else + ReadValue (prop_data.Type, reader); + } + + } else { + if (! t_data.IsDictionary) { + + if (! reader.SkipNonMembers) { + throw new JsonException (String.Format ( + "The type {0} doesn't have the " + + "property '{1}'", + inst_type, property)); + } else { + ReadSkip (reader); + continue; + } + } + + ((IDictionary) instance).Add ( + property, ReadValue ( + t_data.ElementType, reader)); + } + + } + + } + + return instance; + } + + private static IJsonWrapper ReadValue (WrapperFactory factory, + JsonReader reader) + { + reader.Read (); + + if (reader.Token == JsonToken.ArrayEnd || + reader.Token == JsonToken.Null) + return null; + + IJsonWrapper instance = factory (); + + if (reader.Token == JsonToken.String) { + instance.SetString ((string) reader.Value); + return instance; + } + + if (reader.Token == JsonToken.Double) { + instance.SetDouble ((double) reader.Value); + return instance; + } + + if (reader.Token == JsonToken.Int) { + instance.SetInt ((int) reader.Value); + return instance; + } + + if (reader.Token == JsonToken.Long) { + instance.SetLong ((long) reader.Value); + return instance; + } + + if (reader.Token == JsonToken.Boolean) { + instance.SetBoolean ((bool) reader.Value); + return instance; + } + + if (reader.Token == JsonToken.ArrayStart) { + instance.SetJsonType (JsonType.Array); + + while (true) { + IJsonWrapper item = ReadValue (factory, reader); + if (item == null && reader.Token == JsonToken.ArrayEnd) + break; + + ((IList) instance).Add (item); + } + } + else if (reader.Token == JsonToken.ObjectStart) { + instance.SetJsonType (JsonType.Object); + + while (true) { + reader.Read (); + + if (reader.Token == JsonToken.ObjectEnd) + break; + + string property = (string) reader.Value; + + ((IDictionary) instance)[property] = ReadValue ( + factory, reader); + } + + } + + return instance; + } + + private static void ReadSkip (JsonReader reader) + { + ToWrapper ( + delegate { return new JsonMockWrapper (); }, reader); + } + + private static void RegisterBaseExporters () + { + base_exporters_table[typeof (byte)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToInt32 ((byte) obj)); + }; + + base_exporters_table[typeof (char)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToString ((char) obj)); + }; + + base_exporters_table[typeof (DateTime)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToString ((DateTime) obj, + datetime_format)); + }; + + base_exporters_table[typeof (decimal)] = + delegate (object obj, JsonWriter writer) { + writer.Write ((decimal) obj); + }; + + base_exporters_table[typeof (sbyte)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToInt32 ((sbyte) obj)); + }; + + base_exporters_table[typeof (short)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToInt32 ((short) obj)); + }; + + base_exporters_table[typeof (ushort)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToInt32 ((ushort) obj)); + }; + + base_exporters_table[typeof (uint)] = + delegate (object obj, JsonWriter writer) { + writer.Write (Convert.ToUInt64 ((uint) obj)); + }; + + base_exporters_table[typeof (ulong)] = + delegate (object obj, JsonWriter writer) { + writer.Write ((ulong) obj); + }; + } + + private static void RegisterBaseImporters () + { + ImporterFunc importer; + + importer = delegate (object input) { + return Convert.ToByte ((int) input); + }; + RegisterImporter (base_importers_table, typeof (int), + typeof (byte), importer); + + importer = delegate (object input) { + return Convert.ToUInt64 ((int) input); + }; + RegisterImporter (base_importers_table, typeof (int), + typeof (ulong), importer); + + importer = delegate (object input) { + return Convert.ToSByte ((int) input); + }; + RegisterImporter (base_importers_table, typeof (int), + typeof (sbyte), importer); + + importer = delegate (object input) { + return Convert.ToInt16 ((int) input); + }; + RegisterImporter (base_importers_table, typeof (int), + typeof (short), importer); + + importer = delegate (object input) { + return Convert.ToUInt16 ((int) input); + }; + RegisterImporter (base_importers_table, typeof (int), + typeof (ushort), importer); + + importer = delegate (object input) { + return Convert.ToUInt32 ((int) input); + }; + RegisterImporter (base_importers_table, typeof (int), + typeof (uint), importer); + + importer = delegate (object input) { + return Convert.ToSingle ((int) input); + }; + RegisterImporter (base_importers_table, typeof (int), + typeof (float), importer); + + importer = delegate (object input) { + return Convert.ToDouble ((int) input); + }; + RegisterImporter (base_importers_table, typeof (int), + typeof (double), importer); + + importer = delegate (object input) { + return Convert.ToDecimal ((double) input); + }; + RegisterImporter (base_importers_table, typeof (double), + typeof (decimal), importer); + + + importer = delegate (object input) { + return Convert.ToUInt32 ((long) input); + }; + RegisterImporter (base_importers_table, typeof (long), + typeof (uint), importer); + + importer = delegate (object input) { + return Convert.ToChar ((string) input); + }; + RegisterImporter (base_importers_table, typeof (string), + typeof (char), importer); + + importer = delegate (object input) { + return Convert.ToDateTime ((string) input, datetime_format); + }; + RegisterImporter (base_importers_table, typeof (string), + typeof (DateTime), importer); + } + + private static void RegisterImporter ( + IDictionary> table, + Type json_type, Type value_type, ImporterFunc importer) + { + if (! table.ContainsKey (json_type)) + table.Add (json_type, new Dictionary ()); + + table[json_type][value_type] = importer; + } + + private static void WriteValue (object obj, JsonWriter writer, + bool writer_is_private, + int depth) + { + if (depth > max_nesting_depth) + throw new JsonException ( + String.Format ("Max allowed object depth reached while " + + "trying to export from type {0}", + obj.GetType ())); + + if (obj == null) { + writer.Write (null); + return; + } + + if (obj is IJsonWrapper) { + if (writer_is_private) + writer.TextWriter.Write (((IJsonWrapper) obj).ToJson ()); + else + ((IJsonWrapper) obj).ToJson (writer); + + return; + } + + if (obj is String) { + writer.Write ((string) obj); + return; + } + + if (obj is Double) { + writer.Write ((double) obj); + return; + } + + if (obj is Int32) { + writer.Write ((int) obj); + return; + } + + if (obj is Boolean) { + writer.Write ((bool) obj); + return; + } + + if (obj is Int64) { + writer.Write ((long) obj); + return; + } + + if (obj is Array) { + writer.WriteArrayStart (); + + foreach (object elem in (Array) obj) + WriteValue (elem, writer, writer_is_private, depth + 1); + + writer.WriteArrayEnd (); + + return; + } + + if (obj is IList) { + writer.WriteArrayStart (); + foreach (object elem in (IList) obj) + WriteValue (elem, writer, writer_is_private, depth + 1); + writer.WriteArrayEnd (); + + return; + } + + if (obj is IDictionary) { + writer.WriteObjectStart (); + foreach (DictionaryEntry entity in (IDictionary)obj) + { + writer.WritePropertyName ((string) entity.Key); + WriteValue (entity.Value, writer, writer_is_private, + depth + 1); + } + writer.WriteObjectEnd (); + + return; + } + + Type obj_type = obj.GetType (); + + // See if there's a custom exporter for the object + if (custom_exporters_table.ContainsKey (obj_type)) { + ExporterFunc exporter = custom_exporters_table[obj_type]; + exporter (obj, writer); + + return; + } + + // If not, maybe there's a base exporter + if (base_exporters_table.ContainsKey (obj_type)) { + ExporterFunc exporter = base_exporters_table[obj_type]; + exporter (obj, writer); + + return; + } + + // Last option, let's see if it's an enum + if (obj is Enum) { + Type e_type = Enum.GetUnderlyingType (obj_type); + + if (e_type == typeof (long) + || e_type == typeof (uint) + || e_type == typeof (ulong)) + writer.Write ((ulong) obj); + else + writer.Write ((int) obj); + + return; + } + + // Okay, so it looks like the input should be exported as an + // object + AddTypeProperties (obj_type); + IList props = type_properties[obj_type]; + + writer.WriteObjectStart (); + foreach (PropertyMetadata p_data in props) { + if (p_data.IsField) { + writer.WritePropertyName (p_data.Info.Name); + WriteValue (((FieldInfo) p_data.Info).GetValue (obj), + writer, writer_is_private, depth + 1); + } + else { + PropertyInfo p_info = (PropertyInfo) p_data.Info; + + if (p_info.CanRead) { + writer.WritePropertyName (p_data.Info.Name); + WriteValue (p_info.GetValue (obj, null), + writer, writer_is_private, depth + 1); + } + } + } + writer.WriteObjectEnd (); + } + #endregion + + + public static string ToJson (object obj) + { + lock (static_writer_lock) { + static_writer.Reset (); + + WriteValue (obj, static_writer, true, 0); + + return static_writer.ToString (); + } + } + + public static void ToJson (object obj, JsonWriter writer) + { + WriteValue (obj, writer, false, 0); + } + + public static JsonData ToObject (JsonReader reader) + { + return (JsonData) ToWrapper ( + delegate { return new JsonData (); }, reader); + } + + public static JsonData ToObject (TextReader reader) + { + JsonReader json_reader = new JsonReader (reader); + + return (JsonData) ToWrapper ( + delegate { return new JsonData (); }, json_reader); + } + + public static JsonData ToObject (string json) + { + return (JsonData) ToWrapper ( + delegate { return new JsonData (); }, json); + } + + public static T ToObject (JsonReader reader) + { + return (T) ReadValue (typeof (T), reader); + } + + public static T ToObject (TextReader reader) + { + JsonReader json_reader = new JsonReader (reader); + + return (T) ReadValue (typeof (T), json_reader); + } + + public static T ToObject (string json) + { + JsonReader reader = new JsonReader (json); + + return (T) ReadValue (typeof (T), reader); + } + + public static object ToObject(Type toType, string json) + { + JsonReader reader = new JsonReader(json); + + return ReadValue(toType, reader); + } + + public static IJsonWrapper ToWrapper (WrapperFactory factory, + JsonReader reader) + { + return ReadValue (factory, reader); + } + + public static IJsonWrapper ToWrapper (WrapperFactory factory, + string json) + { + JsonReader reader = new JsonReader (json); + + return ReadValue (factory, reader); + } + + public static void RegisterExporter (ExporterFunc exporter) + { + ExporterFunc exporter_wrapper = + delegate (object obj, JsonWriter writer) { + exporter ((T) obj, writer); + }; + + custom_exporters_table[typeof (T)] = exporter_wrapper; + } + + public static void RegisterImporter ( + ImporterFunc importer) + { + ImporterFunc importer_wrapper = + delegate (object input) { + return importer ((TJson) input); + }; + + RegisterImporter (custom_importers_table, typeof (TJson), + typeof (TValue), importer_wrapper); + } + + public static void UnregisterExporters () + { + custom_exporters_table.Clear (); + } + + public static void UnregisterImporters () + { + custom_importers_table.Clear (); + } + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMapper.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMapper.cs.meta new file mode 100644 index 00000000..610a96b0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMapper.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: cd3700150c3fb4d4aa8f68e160243328 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMockWrapper.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMockWrapper.cs new file mode 100644 index 00000000..8aa42bf2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMockWrapper.cs @@ -0,0 +1,105 @@ +#region Header +/** + * JsonMockWrapper.cs + * Mock object implementing IJsonWrapper, to facilitate actions like + * skipping data more efficiently. + * + * The authors disclaim copyright to this source code. For more details, see + * the COPYING file included with this distribution. + **/ +#endregion + + +using System; +using System.Collections; +using System.Collections.Specialized; + + +namespace LitJson +{ + public sealed class JsonMockWrapper : IJsonWrapper + { + public bool IsArray { get { return false; } } + public bool IsBoolean { get { return false; } } + public bool IsDouble { get { return false; } } + public bool IsInt { get { return false; } } + public bool IsLong { get { return false; } } + public bool IsObject { get { return false; } } + public bool IsString { get { return false; } } + + public bool GetBoolean () { return false; } + public double GetDouble () { return 0.0; } + public int GetInt () { return 0; } + public JsonType GetJsonType () { return JsonType.None; } + public long GetLong () { return 0L; } + public string GetString () { return ""; } + + public void SetBoolean (bool val) {} + public void SetDouble (double val) {} + public void SetInt (int val) {} + public void SetJsonType (JsonType type) {} + public void SetLong (long val) {} + public void SetString (string val) {} + + public string ToJson () { return ""; } + public void ToJson (JsonWriter writer) {} + + + bool IList.IsFixedSize { get { return true; } } + bool IList.IsReadOnly { get { return true; } } + + object IList.this[int index] { + get { return null; } + set {} + } + + int IList.Add (object value) { return 0; } + void IList.Clear () {} + bool IList.Contains (object value) { return false; } + int IList.IndexOf (object value) { return -1; } + void IList.Insert (int i, object v) {} + void IList.Remove (object value) {} + void IList.RemoveAt (int index) {} + + + int ICollection.Count { get { return 0; } } + bool ICollection.IsSynchronized { get { return false; } } + object ICollection.SyncRoot { get { return null; } } + + void ICollection.CopyTo (Array array, int index) {} + + + IEnumerator IEnumerable.GetEnumerator () { return null; } + + + bool IDictionary.IsFixedSize { get { return true; } } + bool IDictionary.IsReadOnly { get { return true; } } + + ICollection IDictionary.Keys { get { return null; } } + ICollection IDictionary.Values { get { return null; } } + + object IDictionary.this[object key] { + get { return null; } + set {} + } + + void IDictionary.Add (object k, object v) {} + void IDictionary.Clear () {} + bool IDictionary.Contains (object key) { return false; } + void IDictionary.Remove (object key) {} + + IDictionaryEnumerator IDictionary.GetEnumerator () { return null; } + + + object IOrderedDictionary.this[int idx] { + get { return null; } + set {} + } + + IDictionaryEnumerator IOrderedDictionary.GetEnumerator () { + return null; + } + void IOrderedDictionary.Insert (int i, object k, object v) {} + void IOrderedDictionary.RemoveAt (int i) {} + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMockWrapper.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMockWrapper.cs.meta new file mode 100644 index 00000000..b3842e85 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonMockWrapper.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 21c195443705c59408ba7baf2d2b3175 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonReader.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonReader.cs new file mode 100644 index 00000000..f16325fc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonReader.cs @@ -0,0 +1,464 @@ +#region Header +/** + * JsonReader.cs + * Stream-like access to JSON text. + * + * The authors disclaim copyright to this source code. For more details, see + * the COPYING file included with this distribution. + **/ +#endregion + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + + +namespace LitJson +{ + public enum JsonToken + { + None, + + ObjectStart, + PropertyName, + ObjectEnd, + + ArrayStart, + ArrayEnd, + + Int, + Long, + Double, + + String, + + Boolean, + Null + } + + + public sealed class JsonReader + { + #region Fields + private static IDictionary> parse_table; + + private Stack automaton_stack; + private int current_input; + private int current_symbol; + private bool end_of_json; + private bool end_of_input; + private Lexer lexer; + private bool parser_in_string; + private bool parser_return; + private bool read_started; + private TextReader reader; + private bool reader_is_owned; + private bool skip_non_members; + private object token_value; + private JsonToken token; + #endregion + + + #region Public Properties + public bool AllowComments { + get { return lexer.AllowComments; } + set { lexer.AllowComments = value; } + } + + public bool AllowSingleQuotedStrings { + get { return lexer.AllowSingleQuotedStrings; } + set { lexer.AllowSingleQuotedStrings = value; } + } + + public bool SkipNonMembers { + get { return skip_non_members; } + set { skip_non_members = value; } + } + + public bool EndOfInput { + get { return end_of_input; } + } + + public bool EndOfJson { + get { return end_of_json; } + } + + public JsonToken Token { + get { return token; } + } + + public object Value { + get { return token_value; } + } + #endregion + + + #region Constructors + static JsonReader () + { + PopulateParseTable (); + } + + public JsonReader (string json_text) : + this (new StringReader (json_text), true) + { + } + + public JsonReader (TextReader reader) : + this (reader, false) + { + } + + private JsonReader (TextReader reader, bool owned) + { + if (reader == null) + throw new ArgumentNullException ("reader"); + + parser_in_string = false; + parser_return = false; + + read_started = false; + automaton_stack = new Stack (); + automaton_stack.Push ((int) ParserToken.End); + automaton_stack.Push ((int) ParserToken.Text); + + lexer = new Lexer (reader); + + end_of_input = false; + end_of_json = false; + + skip_non_members = true; + + this.reader = reader; + reader_is_owned = owned; + } + #endregion + + + #region Static Methods + private static void PopulateParseTable () + { + // See section A.2. of the manual for details + parse_table = new Dictionary> (); + + TableAddRow (ParserToken.Array); + TableAddCol (ParserToken.Array, '[', + '[', + (int) ParserToken.ArrayPrime); + + TableAddRow (ParserToken.ArrayPrime); + TableAddCol (ParserToken.ArrayPrime, '"', + (int) ParserToken.Value, + + (int) ParserToken.ValueRest, + ']'); + TableAddCol (ParserToken.ArrayPrime, '[', + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (ParserToken.ArrayPrime, ']', + ']'); + TableAddCol (ParserToken.ArrayPrime, '{', + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (ParserToken.ArrayPrime, (int) ParserToken.Number, + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (ParserToken.ArrayPrime, (int) ParserToken.True, + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (ParserToken.ArrayPrime, (int) ParserToken.False, + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + TableAddCol (ParserToken.ArrayPrime, (int) ParserToken.Null, + (int) ParserToken.Value, + (int) ParserToken.ValueRest, + ']'); + + TableAddRow (ParserToken.Object); + TableAddCol (ParserToken.Object, '{', + '{', + (int) ParserToken.ObjectPrime); + + TableAddRow (ParserToken.ObjectPrime); + TableAddCol (ParserToken.ObjectPrime, '"', + (int) ParserToken.Pair, + (int) ParserToken.PairRest, + '}'); + TableAddCol (ParserToken.ObjectPrime, '}', + '}'); + + TableAddRow (ParserToken.Pair); + TableAddCol (ParserToken.Pair, '"', + (int) ParserToken.String, + ':', + (int) ParserToken.Value); + + TableAddRow (ParserToken.PairRest); + TableAddCol (ParserToken.PairRest, ',', + ',', + (int) ParserToken.Pair, + (int) ParserToken.PairRest); + TableAddCol (ParserToken.PairRest, '}', + (int) ParserToken.Epsilon); + + TableAddRow (ParserToken.String); + TableAddCol (ParserToken.String, '"', + '"', + (int) ParserToken.CharSeq, + '"'); + + TableAddRow (ParserToken.Text); + TableAddCol (ParserToken.Text, '[', + (int) ParserToken.Array); + TableAddCol (ParserToken.Text, '{', + (int) ParserToken.Object); + + TableAddRow (ParserToken.Value); + TableAddCol (ParserToken.Value, '"', + (int) ParserToken.String); + TableAddCol (ParserToken.Value, '[', + (int) ParserToken.Array); + TableAddCol (ParserToken.Value, '{', + (int) ParserToken.Object); + TableAddCol (ParserToken.Value, (int) ParserToken.Number, + (int) ParserToken.Number); + TableAddCol (ParserToken.Value, (int) ParserToken.True, + (int) ParserToken.True); + TableAddCol (ParserToken.Value, (int) ParserToken.False, + (int) ParserToken.False); + TableAddCol (ParserToken.Value, (int) ParserToken.Null, + (int) ParserToken.Null); + + TableAddRow (ParserToken.ValueRest); + TableAddCol (ParserToken.ValueRest, ',', + ',', + (int) ParserToken.Value, + (int) ParserToken.ValueRest); + TableAddCol (ParserToken.ValueRest, ']', + (int) ParserToken.Epsilon); + } + + private static void TableAddCol (ParserToken row, int col, + params int[] symbols) + { + parse_table[(int) row].Add (col, symbols); + } + + private static void TableAddRow (ParserToken rule) + { + parse_table.Add ((int) rule, new Dictionary ()); + } + #endregion + + + #region Private Methods + private void ProcessNumber (string number) + { + if (number.IndexOf ('.') != -1 || + number.IndexOf ('e') != -1 || + number.IndexOf ('E') != -1) { + + double n_double; + if (Double.TryParse (number, out n_double)) { + token = JsonToken.Double; + token_value = n_double; + + return; + } + } + + int n_int32; + if (Int32.TryParse (number, out n_int32)) { + token = JsonToken.Int; + token_value = n_int32; + + return; + } + + long n_int64; + if (Int64.TryParse (number, out n_int64)) { + token = JsonToken.Long; + token_value = n_int64; + + return; + } + + // Shouldn't happen, but just in case, return something + token = JsonToken.Int; + token_value = 0; + } + + private void ProcessSymbol () + { + if (current_symbol == '[') { + token = JsonToken.ArrayStart; + parser_return = true; + + } else if (current_symbol == ']') { + token = JsonToken.ArrayEnd; + parser_return = true; + + } else if (current_symbol == '{') { + token = JsonToken.ObjectStart; + parser_return = true; + + } else if (current_symbol == '}') { + token = JsonToken.ObjectEnd; + parser_return = true; + + } else if (current_symbol == '"') { + if (parser_in_string) { + parser_in_string = false; + + parser_return = true; + + } else { + if (token == JsonToken.None) + token = JsonToken.String; + + parser_in_string = true; + } + + } else if (current_symbol == (int) ParserToken.CharSeq) { + token_value = lexer.StringValue; + + } else if (current_symbol == (int) ParserToken.False) { + token = JsonToken.Boolean; + token_value = false; + parser_return = true; + + } else if (current_symbol == (int) ParserToken.Null) { + token = JsonToken.Null; + parser_return = true; + + } else if (current_symbol == (int) ParserToken.Number) { + ProcessNumber (lexer.StringValue); + + parser_return = true; + + } else if (current_symbol == (int) ParserToken.Pair) { + token = JsonToken.PropertyName; + + } else if (current_symbol == (int) ParserToken.True) { + token = JsonToken.Boolean; + token_value = true; + parser_return = true; + + } + } + + private bool ReadToken () + { + if (end_of_input) + return false; + + lexer.NextToken (); + + if (lexer.EndOfInput) { + Close (); + + return false; + } + + current_input = lexer.Token; + + return true; + } + #endregion + + + public void Close () + { + if (end_of_input) + return; + + end_of_input = true; + end_of_json = true; + + if (reader_is_owned) + reader.Dispose(); + + reader = null; + } + + public bool Read () + { + if (end_of_input) + return false; + + if (end_of_json) { + end_of_json = false; + automaton_stack.Clear (); + automaton_stack.Push ((int) ParserToken.End); + automaton_stack.Push ((int) ParserToken.Text); + } + + parser_in_string = false; + parser_return = false; + + token = JsonToken.None; + token_value = null; + + if (! read_started) { + read_started = true; + + if (! ReadToken ()) + return false; + } + + + int[] entity_symbols; + + while (true) { + if (parser_return) { + if (automaton_stack.Peek () == (int) ParserToken.End) + end_of_json = true; + + return true; + } + + current_symbol = automaton_stack.Pop (); + + ProcessSymbol (); + + if (current_symbol == current_input) { + if (! ReadToken ()) { + if (automaton_stack.Peek () != (int) ParserToken.End) + throw new JsonException ( + "Input doesn't evaluate to proper JSON text"); + + if (parser_return) + return true; + + return false; + } + + continue; + } + + try { + + entity_symbols = + parse_table[current_symbol][current_input]; + + } catch (KeyNotFoundException e) { + throw new JsonException ((ParserToken) current_input, e); + } + + if (entity_symbols[0] == (int) ParserToken.Epsilon) + continue; + + for (int i = entity_symbols.Length - 1; i >= 0; i--) + automaton_stack.Push (entity_symbols[i]); + } + } + + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonReader.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonReader.cs.meta new file mode 100644 index 00000000..86ab7780 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonReader.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f93d78475ddbea54e9f40b76a8813968 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonWriter.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonWriter.cs new file mode 100644 index 00000000..6c0c1ca0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonWriter.cs @@ -0,0 +1,463 @@ +#region Header +/** + * JsonWriter.cs + * Stream-like facility to output JSON text. + * + * The authors disclaim copyright to this source code. For more details, see + * the COPYING file included with this distribution. + **/ +#endregion + + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; + + +namespace LitJson +{ + internal enum Condition + { + InArray, + InObject, + NotAProperty, + Property, + Value + } + + internal class WriterContext + { + public int Count; + public bool InArray; + public bool InObject; + public bool ExpectingValue; + public int Padding; + } + + public sealed class JsonWriter + { + #region Fields + private static NumberFormatInfo number_format; + + private WriterContext context; + private Stack ctx_stack; + private bool has_reached_end; + private char[] hex_seq; + private int indentation; + private int indent_value; + private StringBuilder inst_string_builder; + private bool pretty_print; + private bool validate; + private TextWriter writer; + #endregion + + + #region Properties + public int IndentValue { + get { return indent_value; } + set { + indentation = (indentation / indent_value) * value; + indent_value = value; + } + } + + public bool PrettyPrint { + get { return pretty_print; } + set { pretty_print = value; } + } + + public TextWriter TextWriter { + get { return writer; } + } + + public bool Validate { + get { return validate; } + set { validate = value; } + } + #endregion + + + #region Constructors + static JsonWriter () + { + number_format = NumberFormatInfo.InvariantInfo; + } + + public JsonWriter () + { + inst_string_builder = new StringBuilder (); + writer = new StringWriter (inst_string_builder); + + Init (); + } + + public JsonWriter (StringBuilder sb) : + this (new StringWriter (sb)) + { + } + + public JsonWriter (TextWriter writer) + { + if (writer == null) + throw new ArgumentNullException ("writer"); + + this.writer = writer; + + Init (); + } + #endregion + + + #region Private Methods + private void DoValidation (Condition cond) + { + if (! context.ExpectingValue) + context.Count++; + + if (! validate) + return; + + if (has_reached_end) + throw new JsonException ( + "A complete JSON symbol has already been written"); + + switch (cond) { + case Condition.InArray: + if (! context.InArray) + throw new JsonException ( + "Can't close an array here"); + break; + + case Condition.InObject: + if (! context.InObject || context.ExpectingValue) + throw new JsonException ( + "Can't close an object here"); + break; + + case Condition.NotAProperty: + if (context.InObject && ! context.ExpectingValue) + throw new JsonException ( + "Expected a property"); + break; + + case Condition.Property: + if (! context.InObject || context.ExpectingValue) + throw new JsonException ( + "Can't add a property here"); + break; + + case Condition.Value: + if (! context.InArray && + (! context.InObject || ! context.ExpectingValue)) + throw new JsonException ( + "Can't add a value here"); + + break; + } + } + + private void Init () + { + has_reached_end = false; + hex_seq = new char[4]; + indentation = 0; + indent_value = 4; + pretty_print = false; + validate = true; + + ctx_stack = new Stack (); + context = new WriterContext (); + ctx_stack.Push (context); + } + + private static void IntToHex (int n, char[] hex) + { + int num; + + for (int i = 0; i < 4; i++) { + num = n % 16; + + if (num < 10) + hex[3 - i] = (char) ('0' + num); + else + hex[3 - i] = (char) ('A' + (num - 10)); + + n >>= 4; + } + } + + private void Indent () + { + if (pretty_print) + indentation += indent_value; + } + + + private void Put (string str) + { + if (pretty_print && ! context.ExpectingValue) + for (int i = 0; i < indentation; i++) + writer.Write (' '); + + writer.Write (str); + } + + private void PutNewline () + { + PutNewline (true); + } + + private void PutNewline (bool add_comma) + { + if (add_comma && ! context.ExpectingValue && + context.Count > 1) + writer.Write (','); + + if (pretty_print && ! context.ExpectingValue) + writer.Write ('\n'); + } + + private void PutString (string str) + { + Put (String.Empty); + + writer.Write ('"'); + + int n = str.Length; + for (int i = 0; i < n; i++) { + switch (str[i]) { + case '\n': + writer.Write ("\\n"); + continue; + + case '\r': + writer.Write ("\\r"); + continue; + + case '\t': + writer.Write ("\\t"); + continue; + + case '"': + case '\\': + writer.Write ('\\'); + writer.Write (str[i]); + continue; + + case '\f': + writer.Write ("\\f"); + continue; + + case '\b': + writer.Write ("\\b"); + continue; + } + + if ((int) str[i] >= 32 && (int) str[i] <= 126) { + writer.Write (str[i]); + continue; + } + + // Default, turn into a \uXXXX sequence + IntToHex ((int) str[i], hex_seq); + writer.Write ("\\u"); + writer.Write (hex_seq); + } + + writer.Write ('"'); + } + + private void Unindent () + { + if (pretty_print) + indentation -= indent_value; + } + #endregion + + + public override string ToString () + { + if (inst_string_builder == null) + return String.Empty; + + return inst_string_builder.ToString (); + } + + public void Reset () + { + has_reached_end = false; + + ctx_stack.Clear (); + context = new WriterContext (); + ctx_stack.Push (context); + + if (inst_string_builder != null) + inst_string_builder.Remove (0, inst_string_builder.Length); + } + + public void Write (bool boolean) + { + DoValidation (Condition.Value); + PutNewline (); + + Put (boolean ? "true" : "false"); + + context.ExpectingValue = false; + } + + public void Write (decimal number) + { + DoValidation (Condition.Value); + PutNewline (); + + Put (Convert.ToString (number, number_format)); + + context.ExpectingValue = false; + } + + public void Write (double number) + { + DoValidation (Condition.Value); + PutNewline (); + + string str = Convert.ToString (number, number_format); + Put (str); + + if (str.IndexOf ('.') == -1 && + str.IndexOf ('E') == -1) + writer.Write (".0"); + + context.ExpectingValue = false; + } + + public void Write (int number) + { + DoValidation (Condition.Value); + PutNewline (); + + Put (Convert.ToString (number, number_format)); + + context.ExpectingValue = false; + } + + public void Write (long number) + { + DoValidation (Condition.Value); + PutNewline (); + + Put (Convert.ToString (number, number_format)); + + context.ExpectingValue = false; + } + + public void Write (string str) + { + DoValidation (Condition.Value); + PutNewline (); + + if (str == null) + Put ("null"); + else + PutString (str); + + context.ExpectingValue = false; + } + + //[CLSCompliant(false)] + public void Write (ulong number) + { + DoValidation (Condition.Value); + PutNewline (); + + Put (Convert.ToString (number, number_format)); + + context.ExpectingValue = false; + } + + public void WriteArrayEnd () + { + DoValidation (Condition.InArray); + PutNewline (false); + + ctx_stack.Pop (); + if (ctx_stack.Count == 1) + has_reached_end = true; + else { + context = ctx_stack.Peek (); + context.ExpectingValue = false; + } + + Unindent (); + Put ("]"); + } + + public void WriteArrayStart () + { + DoValidation (Condition.NotAProperty); + PutNewline (); + + Put ("["); + + context = new WriterContext (); + context.InArray = true; + ctx_stack.Push (context); + + Indent (); + } + + public void WriteObjectEnd () + { + DoValidation (Condition.InObject); + PutNewline (false); + + ctx_stack.Pop (); + if (ctx_stack.Count == 1) + has_reached_end = true; + else { + context = ctx_stack.Peek (); + context.ExpectingValue = false; + } + + Unindent (); + Put ("}"); + } + + public void WriteObjectStart () + { + DoValidation (Condition.NotAProperty); + PutNewline (); + + Put ("{"); + + context = new WriterContext (); + context.InObject = true; + ctx_stack.Push (context); + + Indent (); + } + + public void WritePropertyName (string property_name) + { + DoValidation (Condition.Property); + PutNewline (); + + PutString (property_name); + + if (pretty_print) { + if (property_name.Length > context.Padding) + context.Padding = property_name.Length; + + for (int i = context.Padding - property_name.Length; + i >= 0; i--) + writer.Write (' '); + + writer.Write (": "); + } else + writer.Write (':'); + + context.ExpectingValue = true; + } + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonWriter.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonWriter.cs.meta new file mode 100644 index 00000000..9c6770bf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/JsonWriter.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 902e614ca1244e2478d32eef3bd0d68e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/Lexer.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/Lexer.cs new file mode 100644 index 00000000..811c9f45 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/Lexer.cs @@ -0,0 +1,912 @@ +#region Header +/** + * Lexer.cs + * JSON lexer implementation based on a finite state machine. + * + * The authors disclaim copyright to this source code. For more details, see + * the COPYING file included with this distribution. + **/ +#endregion + + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + + +namespace LitJson +{ + internal sealed class FsmContext + { + public bool Return; + public int NextState; + public Lexer L; + public int StateStack; + } + + + internal sealed class Lexer + { + #region Fields + private delegate bool StateHandler (FsmContext ctx); + + private static int[] fsm_return_table; + private static StateHandler[] fsm_handler_table; + + private bool allow_comments; + private bool allow_single_quoted_strings; + private bool end_of_input; + private FsmContext fsm_context; + private int input_buffer; + private int input_char; + private TextReader reader; + private int state; + private StringBuilder string_buffer; + private string string_value; + private int token; + private int unichar; + #endregion + + + #region Properties + public bool AllowComments { + get { return allow_comments; } + set { allow_comments = value; } + } + + public bool AllowSingleQuotedStrings { + get { return allow_single_quoted_strings; } + set { allow_single_quoted_strings = value; } + } + + public bool EndOfInput { + get { return end_of_input; } + } + + public int Token { + get { return token; } + } + + public string StringValue { + get { return string_value; } + } + #endregion + + + #region Constructors + static Lexer () + { + PopulateFsmTables (); + } + + public Lexer (TextReader reader) + { + allow_comments = true; + allow_single_quoted_strings = true; + + input_buffer = 0; + string_buffer = new StringBuilder (128); + state = 1; + end_of_input = false; + this.reader = reader; + + fsm_context = new FsmContext (); + fsm_context.L = this; + } + #endregion + + + #region Static Methods + private static int HexValue (int digit) + { + switch (digit) { + case 'a': + case 'A': + return 10; + + case 'b': + case 'B': + return 11; + + case 'c': + case 'C': + return 12; + + case 'd': + case 'D': + return 13; + + case 'e': + case 'E': + return 14; + + case 'f': + case 'F': + return 15; + + default: + return digit - '0'; + } + } + + private static void PopulateFsmTables () + { + // See section A.1. of the manual for details of the finite + // state machine. + fsm_handler_table = new StateHandler[28] { + State1, + State2, + State3, + State4, + State5, + State6, + State7, + State8, + State9, + State10, + State11, + State12, + State13, + State14, + State15, + State16, + State17, + State18, + State19, + State20, + State21, + State22, + State23, + State24, + State25, + State26, + State27, + State28 + }; + + fsm_return_table = new int[28] { + (int) ParserToken.Char, + 0, + (int) ParserToken.Number, + (int) ParserToken.Number, + 0, + (int) ParserToken.Number, + 0, + (int) ParserToken.Number, + 0, + 0, + (int) ParserToken.True, + 0, + 0, + 0, + (int) ParserToken.False, + 0, + 0, + (int) ParserToken.Null, + (int) ParserToken.CharSeq, + (int) ParserToken.Char, + 0, + 0, + (int) ParserToken.CharSeq, + (int) ParserToken.Char, + 0, + 0, + 0, + 0 + }; + } + + private static char ProcessEscChar (int esc_char) + { + switch (esc_char) { + case '"': + case '\'': + case '\\': + case '/': + return Convert.ToChar (esc_char); + + case 'n': + return '\n'; + + case 't': + return '\t'; + + case 'r': + return '\r'; + + case 'b': + return '\b'; + + case 'f': + return '\f'; + + default: + // Unreachable + return '?'; + } + } + + private static bool State1 (FsmContext ctx) + { + while (ctx.L.GetChar ()) { + if (ctx.L.input_char == ' ' || + ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') + continue; + + if (ctx.L.input_char >= '1' && ctx.L.input_char <= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 3; + return true; + } + + switch (ctx.L.input_char) { + case '"': + ctx.NextState = 19; + ctx.Return = true; + return true; + + case ',': + case ':': + case '[': + case ']': + case '{': + case '}': + ctx.NextState = 1; + ctx.Return = true; + return true; + + case '-': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 2; + return true; + + case '0': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 4; + return true; + + case 'f': + ctx.NextState = 12; + return true; + + case 'n': + ctx.NextState = 16; + return true; + + case 't': + ctx.NextState = 9; + return true; + + case '\'': + if (! ctx.L.allow_single_quoted_strings) + return false; + + ctx.L.input_char = '"'; + ctx.NextState = 23; + ctx.Return = true; + return true; + + case '/': + if (! ctx.L.allow_comments) + return false; + + ctx.NextState = 25; + return true; + + default: + return false; + } + } + + return true; + } + + private static bool State2 (FsmContext ctx) + { + ctx.L.GetChar (); + + if (ctx.L.input_char >= '1' && ctx.L.input_char<= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 3; + return true; + } + + switch (ctx.L.input_char) { + case '0': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 4; + return true; + + default: + return false; + } + } + + private static bool State3 (FsmContext ctx) + { + while (ctx.L.GetChar ()) { + if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + continue; + } + + if (ctx.L.input_char == ' ' || + ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') { + ctx.Return = true; + ctx.NextState = 1; + return true; + } + + switch (ctx.L.input_char) { + case ',': + case ']': + case '}': + ctx.L.UngetChar (); + ctx.Return = true; + ctx.NextState = 1; + return true; + + case '.': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 5; + return true; + + case 'e': + case 'E': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 7; + return true; + + default: + return false; + } + } + return true; + } + + private static bool State4 (FsmContext ctx) + { + ctx.L.GetChar (); + + if (ctx.L.input_char == ' ' || + ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') { + ctx.Return = true; + ctx.NextState = 1; + return true; + } + + switch (ctx.L.input_char) { + case ',': + case ']': + case '}': + ctx.L.UngetChar (); + ctx.Return = true; + ctx.NextState = 1; + return true; + + case '.': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 5; + return true; + + case 'e': + case 'E': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 7; + return true; + + default: + return false; + } + } + + private static bool State5 (FsmContext ctx) + { + ctx.L.GetChar (); + + if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 6; + return true; + } + + return false; + } + + private static bool State6 (FsmContext ctx) + { + while (ctx.L.GetChar ()) { + if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + continue; + } + + if (ctx.L.input_char == ' ' || + ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') { + ctx.Return = true; + ctx.NextState = 1; + return true; + } + + switch (ctx.L.input_char) { + case ',': + case ']': + case '}': + ctx.L.UngetChar (); + ctx.Return = true; + ctx.NextState = 1; + return true; + + case 'e': + case 'E': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 7; + return true; + + default: + return false; + } + } + + return true; + } + + private static bool State7 (FsmContext ctx) + { + ctx.L.GetChar (); + + if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 8; + return true; + } + + switch (ctx.L.input_char) { + case '+': + case '-': + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + ctx.NextState = 8; + return true; + + default: + return false; + } + } + + private static bool State8 (FsmContext ctx) + { + while (ctx.L.GetChar ()) { + if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') { + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + continue; + } + + if (ctx.L.input_char == ' ' || + ctx.L.input_char >= '\t' && ctx.L.input_char<= '\r') { + ctx.Return = true; + ctx.NextState = 1; + return true; + } + + switch (ctx.L.input_char) { + case ',': + case ']': + case '}': + ctx.L.UngetChar (); + ctx.Return = true; + ctx.NextState = 1; + return true; + + default: + return false; + } + } + + return true; + } + + private static bool State9 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'r': + ctx.NextState = 10; + return true; + + default: + return false; + } + } + + private static bool State10 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'u': + ctx.NextState = 11; + return true; + + default: + return false; + } + } + + private static bool State11 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'e': + ctx.Return = true; + ctx.NextState = 1; + return true; + + default: + return false; + } + } + + private static bool State12 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'a': + ctx.NextState = 13; + return true; + + default: + return false; + } + } + + private static bool State13 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'l': + ctx.NextState = 14; + return true; + + default: + return false; + } + } + + private static bool State14 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 's': + ctx.NextState = 15; + return true; + + default: + return false; + } + } + + private static bool State15 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'e': + ctx.Return = true; + ctx.NextState = 1; + return true; + + default: + return false; + } + } + + private static bool State16 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'u': + ctx.NextState = 17; + return true; + + default: + return false; + } + } + + private static bool State17 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'l': + ctx.NextState = 18; + return true; + + default: + return false; + } + } + + private static bool State18 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'l': + ctx.Return = true; + ctx.NextState = 1; + return true; + + default: + return false; + } + } + + private static bool State19 (FsmContext ctx) + { + while (ctx.L.GetChar ()) { + switch (ctx.L.input_char) { + case '"': + ctx.L.UngetChar (); + ctx.Return = true; + ctx.NextState = 20; + return true; + + case '\\': + ctx.StateStack = 19; + ctx.NextState = 21; + return true; + + default: + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + continue; + } + } + + return true; + } + + private static bool State20 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case '"': + ctx.Return = true; + ctx.NextState = 1; + return true; + + default: + return false; + } + } + + private static bool State21 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case 'u': + ctx.NextState = 22; + return true; + + case '"': + case '\'': + case '/': + case '\\': + case 'b': + case 'f': + case 'n': + case 'r': + case 't': + ctx.L.string_buffer.Append ( + ProcessEscChar (ctx.L.input_char)); + ctx.NextState = ctx.StateStack; + return true; + + default: + return false; + } + } + + private static bool State22 (FsmContext ctx) + { + int counter = 0; + int mult = 4096; + + ctx.L.unichar = 0; + + while (ctx.L.GetChar ()) { + + if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9' || + ctx.L.input_char >= 'A' && ctx.L.input_char <= 'F' || + ctx.L.input_char >= 'a' && ctx.L.input_char <= 'f') { + + ctx.L.unichar += HexValue (ctx.L.input_char) * mult; + + counter++; + mult /= 16; + + if (counter == 4) { + ctx.L.string_buffer.Append ( + Convert.ToChar (ctx.L.unichar)); + ctx.NextState = ctx.StateStack; + return true; + } + + continue; + } + + return false; + } + + return true; + } + + private static bool State23 (FsmContext ctx) + { + while (ctx.L.GetChar ()) { + switch (ctx.L.input_char) { + case '\'': + ctx.L.UngetChar (); + ctx.Return = true; + ctx.NextState = 24; + return true; + + case '\\': + ctx.StateStack = 23; + ctx.NextState = 21; + return true; + + default: + ctx.L.string_buffer.Append ((char) ctx.L.input_char); + continue; + } + } + + return true; + } + + private static bool State24 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case '\'': + ctx.L.input_char = '"'; + ctx.Return = true; + ctx.NextState = 1; + return true; + + default: + return false; + } + } + + private static bool State25 (FsmContext ctx) + { + ctx.L.GetChar (); + + switch (ctx.L.input_char) { + case '*': + ctx.NextState = 27; + return true; + + case '/': + ctx.NextState = 26; + return true; + + default: + return false; + } + } + + private static bool State26 (FsmContext ctx) + { + while (ctx.L.GetChar ()) { + if (ctx.L.input_char == '\n') { + ctx.NextState = 1; + return true; + } + } + + return true; + } + + private static bool State27 (FsmContext ctx) + { + while (ctx.L.GetChar ()) { + if (ctx.L.input_char == '*') { + ctx.NextState = 28; + return true; + } + } + + return true; + } + + private static bool State28 (FsmContext ctx) + { + while (ctx.L.GetChar ()) { + if (ctx.L.input_char == '*') + continue; + + if (ctx.L.input_char == '/') { + ctx.NextState = 1; + return true; + } + + ctx.NextState = 27; + return true; + } + + return true; + } + #endregion + + + private bool GetChar () + { + if ((input_char = NextChar ()) != -1) + return true; + + end_of_input = true; + return false; + } + + private int NextChar () + { + if (input_buffer != 0) { + int tmp = input_buffer; + input_buffer = 0; + + return tmp; + } + + return reader.Read (); + } + + public bool NextToken () + { + StateHandler handler; + fsm_context.Return = false; + + while (true) { + handler = fsm_handler_table[state - 1]; + + if (! handler (fsm_context)) + throw new JsonException (input_char); + + if (end_of_input) + return false; + + if (fsm_context.Return) { + string_value = string_buffer.ToString (); + string_buffer.Remove (0, string_buffer.Length); + token = fsm_return_table[state - 1]; + + if (token == (int) ParserToken.Char) + token = input_char; + + state = fsm_context.NextState; + + return true; + } + + state = fsm_context.NextState; + } + } + + private void UngetChar () + { + input_buffer = input_char; + } + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/Lexer.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/Lexer.cs.meta new file mode 100644 index 00000000..fc157652 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/Lexer.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 906778e065bdcac499e4d8a01871e594 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/ParserToken.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/ParserToken.cs new file mode 100644 index 00000000..e23d477b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/ParserToken.cs @@ -0,0 +1,44 @@ +#region Header +/** + * ParserToken.cs + * Internal representation of the tokens used by the lexer and the parser. + * + * The authors disclaim copyright to this source code. For more details, see + * the COPYING file included with this distribution. + **/ +#endregion + + +namespace LitJson +{ + internal enum ParserToken + { + // Lexer tokens (see section A.1.1. of the manual) + None = System.Char.MaxValue + 1, + Number, + True, + False, + Null, + CharSeq, + // Single char + Char, + + // Parser Rules (see section A.2.1 of the manual) + Text, + Object, + ObjectPrime, + Pair, + PairRest, + Array, + ArrayPrime, + Value, + ValueRest, + String, + + // End of input + End, + + // The empty rule + Epsilon + } +} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/ParserToken.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/ParserToken.cs.meta new file mode 100644 index 00000000..cbd3d043 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/LitJson/ParserToken.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e0f6927815038254080d13c1ab81506b +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin.meta new file mode 100644 index 00000000..d1822dbb --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e4b189b8db53fae40b63e2563cc658ba +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin/CacheMaintenanceSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin/CacheMaintenanceSample.cs new file mode 100644 index 00000000..31dd06d2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin/CacheMaintenanceSample.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; + +using UnityEngine; +using BestHTTP; + +#if !BESTHTTP_DISABLE_CACHING + using BestHTTP.Caching; +#endif + +namespace BestHTTP.Examples +{ + public sealed class CacheMaintenanceSample : MonoBehaviour + { + /// + /// An enum for better readability + /// + enum DeleteOlderTypes + { + Days, + Hours, + Mins, + Secs + }; + + #region Private Fields + +#if !BESTHTTP_DISABLE_CACHING + /// + /// What methode to call on the TimeSpan + /// + DeleteOlderTypes deleteOlderType = DeleteOlderTypes.Secs; + + /// + /// The value for the TimeSpan. + /// + int value = 10; + + /// + /// What's our maximum cache size + /// + int maxCacheSize = 5 * 1024 * 1024; +#endif + + #endregion + + #region Unity Events + + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { +#if !BESTHTTP_DISABLE_CACHING + GUILayout.BeginHorizontal(); + + GUILayout.Label("Delete cached entities older then"); + + GUILayout.Label(value.ToString(), GUILayout.MinWidth(50)); + value = (int)GUILayout.HorizontalSlider(value, 1, 60, GUILayout.MinWidth(100)); + + GUILayout.Space(10); + + deleteOlderType = (DeleteOlderTypes)(int)GUILayout.SelectionGrid((int)deleteOlderType, new string[] { "Days", "Hours", "Mins", "Secs" }, 4); + GUILayout.FlexibleSpace(); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Max Cache Size (bytes): ", GUILayout.Width(150)); + GUILayout.Label(maxCacheSize.ToString("N0"), GUILayout.Width(70)); + maxCacheSize = (int)GUILayout.HorizontalSlider(maxCacheSize, 1024, 10 * 1024 * 1024); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + if (GUILayout.Button("Maintenance")) + { + TimeSpan deleteOlder = TimeSpan.FromDays(14); + + switch (deleteOlderType) + { + case DeleteOlderTypes.Days: deleteOlder = TimeSpan.FromDays(value); break; + case DeleteOlderTypes.Hours: deleteOlder = TimeSpan.FromHours(value); break; + case DeleteOlderTypes.Mins: deleteOlder = TimeSpan.FromMinutes(value); break; + case DeleteOlderTypes.Secs: deleteOlder = TimeSpan.FromSeconds(value); break; + } + + // Call the BeginMaintainence function. It will run on a thread to do not block the main thread. + HTTPCacheService.BeginMaintainence(new HTTPCacheMaintananceParams(deleteOlder, (ulong)maxCacheSize)); + } +#endif + }); + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin/CacheMaintenanceSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin/CacheMaintenanceSample.cs.meta new file mode 100644 index 00000000..7ceeb543 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/Plugin/CacheMaintenanceSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 502d4f4ff21e26a4d8d19e12ba63e376 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.cs new file mode 100644 index 00000000..67189222 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; + +using UnityEngine; +using BestHTTP; +using BestHTTP.Statistics; +using BestHTTP.Examples; + +namespace BestHTTP.Examples +{ + /// + /// A class to describe an Example and store it's metadata. + /// + public sealed class SampleDescriptor + { + public bool IsLabel { get; set; } + public Type Type { get; set; } + public string DisplayName { get; set; } + public string Description { get; set; } + + public bool IsSelected { get; set; } + public GameObject UnityObject { get; set; } + public bool IsRunning { get { return UnityObject != null; } } + + public SampleDescriptor(Type type, string displayName, string description) + { + this.Type = type; + this.DisplayName = displayName; + this.Description = description; + } + + public void CreateUnityObject() + { + if (UnityObject != null) + return; + + UnityObject = new GameObject(DisplayName); + UnityObject.AddComponent(Type); + } + + public void DestroyUnityObject() + { + if (UnityObject != null) + { + UnityEngine.Object.Destroy(UnityObject); + UnityObject = null; + } + } + } + + public class SampleSelector : MonoBehaviour + { + public const int statisticsHeight = 160; + + List Samples = new List(); + public static SampleDescriptor SelectedSample; + + Vector2 scrollPos; + + void Awake() + { + Application.runInBackground = true; + HTTPManager.Logger.Level = BestHTTP.Logger.Loglevels.All; + +#if UNITY_SAMSUNGTV + SamsungTV.touchPadMode = SamsungTV.TouchPadMode.Mouse; + + // Create a red 'cursor' to see where we are pointing to + Texture2D tex = new Texture2D(8, 8, TextureFormat.RGB24, false); + for (int i = 0; i < tex.width; ++i) + for (int cv = 0; cv < tex.height; ++cv) + tex.SetPixel(i, cv, Color.red); + tex.Apply(false, true); + Cursor.SetCursor(tex, Vector2.zero, CursorMode.Auto); +#endif + + Samples.Add(new SampleDescriptor(null, "HTTP Samples", string.Empty) { IsLabel = true }); + + Samples.Add(new SampleDescriptor(typeof(TextureDownloadSample), "Texture Download", "With HTTPManager.MaxConnectionPerServer you can control how many requests can be processed per server parallel.\n\nFeatures demoed in this example:\n-Parallel requests to the same server\n-Controlling the parallelization\n-Automatic Caching\n-Create a Texture2D from the downloaded data")); + Samples.Add(new SampleDescriptor(typeof(AssetBundleSample), "AssetBundle Download", "A small example that shows a possible way to download an AssetBundle and load a resource from it.\n\nFeatures demoed in this example:\n-Using HTTPRequest without a callback\n-Using HTTPRequest in a Coroutine\n-Loading an AssetBundle from the downloaded bytes\n-Automatic Caching")); +#if !UNITY_WEBGL || UNITY_EDITOR + Samples.Add(new SampleDescriptor(typeof(LargeFileDownloadSample), "Large File Download", "This example demonstrates how you can download a (large) file and continue the download after the connection is aborted.\n\nFeatures demoed in this example:\n-Setting up a streamed download\n-How to access the downloaded data while the download is in progress\n-Setting the HTTPRequest's StreamFragmentSize to controll the frequency and size of the fragments\n-How to use the SetRangeHeader to continue a previously disconnected download\n-How to disable the local, automatic caching")); +#endif + +#if !BESTHTTP_DISABLE_WEBSOCKET + Samples.Add(new SampleDescriptor(null, "WebSocket Samples", string.Empty) { IsLabel = true }); + Samples.Add(new SampleDescriptor(typeof(WebSocketSample), "Echo", "A WebSocket demonstration that connects to a WebSocket echo service.\n\nFeatures demoed in this example:\n-Basic usage of the WebSocket class")); +#endif + +#if !BESTHTTP_DISABLE_SOCKETIO + Samples.Add(new SampleDescriptor(null, "Socket.IO Samples", string.Empty) { IsLabel = true }); + Samples.Add(new SampleDescriptor(typeof(SocketIOChatSample), "Chat", "This example uses the Socket.IO implementation to connect to the official Chat demo server(http://chat.socket.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Changing SocketOptions property\n-Subscribing to Socket.IO events\n-Sending custom events to the server")); +#if !UNITY_WEBGL || UNITY_EDITOR + Samples.Add(new SampleDescriptor(typeof(SocketIOWePlaySample), "WePlay", "This example uses the Socket.IO implementation to connect to the official WePlay demo server(http://weplay.io/).\n\nFeatures demoed in this example:\n-Instantiating and setting up a SocketManager to connect to a Socket.IO server\n-Subscribing to Socket.IO events\n-Receiving binary data\n-How to load a texture from the received binary data\n-How to disable payload decoding for fine tune for some speed\n-Sending custom events to the server")); +#endif +#endif + +#if !BESTHTTP_DISABLE_SIGNALR_CORE + Samples.Add(new SampleDescriptor(null, "SignalR Core Samples", string.Empty) { IsLabel = true }); + Samples.Add(new SampleDescriptor(typeof(TestHubExample), "Hub Sample", "This sample demonstrates most of the functionalities of the SignalR protocol:\n-How to set up HubConnection to connect to the server\n-Subscribing to server-callable function\n-Calling client-callable function on the server\n-Calling and handling streaming\n")); + Samples.Add(new SampleDescriptor(typeof(HubWithAuthorizationSample), "Hub Authentication Sample", "This sample demonstrates the default access token authentication. The server sends a JWT token to the client with a new url. The client will connect to that new url and sends the JWT token.\n")); + Samples.Add(new SampleDescriptor(typeof(HubWithPreAuthorizationSample), "Hub Pre-Authentication Sample", "This sample demonstrates manual authentication.\n")); + Samples.Add(new SampleDescriptor(typeof(RedirectSample), "Hub Redirect Sample", "This sample demonstrates how the plugin handles redirection through the SignalR Core negotiation data.\n")); +#endif + +#if (!BESTHTTP_DISABLE_SIGNALR && !UNITY_WEBGL) || UNITY_EDITOR + Samples.Add(new SampleDescriptor(null, "SignalR Samples", string.Empty) { IsLabel = true }); + Samples.Add(new SampleDescriptor(typeof(SimpleStreamingSample), "Simple Streaming", "A very simple example of a background thread that broadcasts the server time to all connected clients every two seconds.\n\nFeatures demoed in this example:\n-Subscribing and handling non-hub messages")); + Samples.Add(new SampleDescriptor(typeof(ConnectionAPISample), "Connection API", "Demonstrates all features of the lower-level connection API including starting and stopping, sending and receiving messages, and managing groups.\n\nFeatures demoed in this example:\n-Instantiating and setting up a SignalR Connection to connect to a SignalR server\n-Changing the default Json encoder\n-Subscribing to state changes\n-Receiving and handling of non-hub messages\n-Sending non-hub messages\n-Managing groups")); + Samples.Add(new SampleDescriptor(typeof(ConnectionStatusSample), "Connection Status", "Demonstrates how to handle the events that are raised when connections connect, reconnect and disconnect from the Hub API.\n\nFeatures demoed in this example:\n-Connecting to a Hub\n-Setting up a callback for Hub events\n-Handling server-sent method call requests\n-Calling a Hub-method on the server-side\n-Opening and closing the SignalR Connection")); + Samples.Add(new SampleDescriptor(typeof(DemoHubSample), "Demo Hub", "A contrived example that exploits every feature of the Hub API.\n\nFeatures demoed in this example:\n-Creating and using wrapper Hub classes to encapsulate hub functions and events\n-Handling long running server-side functions by handling progress messages\n-Groups\n-Handling server-side functions with return value\n-Handling server-side functions throwing Exceptions\n-Calling server-side functions with complex type parameters\n-Calling server-side functions with array parameters\n-Calling overloaded server-side functions\n-Changing Hub states\n-Receiving and handling hub state changes\n-Calling server-side functions implemented in VB .NET")); +#if !UNITY_WEBGL || UNITY_EDITOR + Samples.Add(new SampleDescriptor(typeof(AuthenticationSample), "Authentication", "Demonstrates how to use the authorization features of the Hub API to restrict certain Hubs and methods to specific users.\n\nFeatures demoed in this example:\n-Creating and using wrapper Hub classes to encapsulate hub functions and events\n-Create and use a Header-based authenticator to access protected APIs\n-SignalR over HTTPS")); +#endif +#endif + +#if !BESTHTTP_DISABLE_CACHING + Samples.Add(new SampleDescriptor(null, "Plugin Samples", string.Empty) { IsLabel = true }); + Samples.Add(new SampleDescriptor(typeof(CacheMaintenanceSample), "Cache Maintenance", "With this demo you can see how you can use the HTTPCacheService's BeginMaintainence function to delete too old cached entities and keep the cache size under a specified value.\n\nFeatures demoed in this example:\n-How to set up a HTTPCacheMaintananceParams\n-How to call the BeginMaintainence function")); +#endif + + SelectedSample = Samples[1]; + } + + void Update() + { + GUIHelper.ClientArea = new Rect(0, SampleSelector.statisticsHeight + 5, Screen.width, Screen.height - SampleSelector.statisticsHeight - 50); + + if (Input.GetKeyDown(KeyCode.Escape)) + { + if (SelectedSample != null && SelectedSample.IsRunning) + SelectedSample.DestroyUnityObject(); + else + Application.Quit(); + } + + if (Input.GetKeyDown(KeyCode.KeypadEnter) || Input.GetKeyDown(KeyCode.Return)) + { + if (SelectedSample != null && !SelectedSample.IsRunning) + SelectedSample.CreateUnityObject(); + } + } + + void OnGUI() + { + var stats = HTTPManager.GetGeneralStatistics(StatisticsQueryFlags.All); + + // Connection statistics + GUIHelper.DrawArea(new Rect(0, 0, Screen.width / 3, statisticsHeight), false, () => + { + // Header + GUIHelper.DrawCenteredText("Connections"); + + GUILayout.Space(5); + + GUIHelper.DrawRow("Sum:", stats.Connections.ToString()); + GUIHelper.DrawRow("Active:", stats.ActiveConnections.ToString()); + GUIHelper.DrawRow("Free:", stats.FreeConnections.ToString()); + GUIHelper.DrawRow("Recycled:", stats.RecycledConnections.ToString()); + GUIHelper.DrawRow("Requests in queue:", stats.RequestsInQueue.ToString()); + }); + + // Cache statistics + GUIHelper.DrawArea(new Rect(Screen.width / 3, 0, Screen.width / 3, statisticsHeight), false, () => + { + GUIHelper.DrawCenteredText("Cache"); + +#if !BESTHTTP_DISABLE_CACHING + if (!BestHTTP.Caching.HTTPCacheService.IsSupported) + { +#endif + GUI.color = Color.yellow; + GUIHelper.DrawCenteredText("Disabled in WebPlayer, WebGL & Samsung Smart TV Builds!"); + GUI.color = Color.white; +#if !BESTHTTP_DISABLE_CACHING + } + else + { + GUILayout.Space(5); + + GUIHelper.DrawRow("Cached entities:", stats.CacheEntityCount.ToString()); + GUIHelper.DrawRow("Sum Size (bytes): ", stats.CacheSize.ToString("N0")); + + GUILayout.BeginVertical(); + + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Clear Cache")) + BestHTTP.Caching.HTTPCacheService.BeginClear(); + + GUILayout.EndVertical(); + } +#endif + }); + + // Cookie statistics + GUIHelper.DrawArea(new Rect((Screen.width / 3) * 2, 0, Screen.width / 3, statisticsHeight), false, () => + { + GUIHelper.DrawCenteredText("Cookies"); + +#if !BESTHTTP_DISABLE_COOKIES + if (!BestHTTP.Cookies.CookieJar.IsSavingSupported) + { +#endif + GUI.color = Color.yellow; + GUIHelper.DrawCenteredText("Saving and loading from disk is disabled in WebPlayer, WebGL & Samsung Smart TV Builds!"); + GUI.color = Color.white; +#if !BESTHTTP_DISABLE_COOKIES + } + else + { + GUILayout.Space(5); + + GUIHelper.DrawRow("Cookies:", stats.CookieCount.ToString()); + GUIHelper.DrawRow("Estimated size (bytes):", stats.CookieJarSize.ToString("N0")); + + GUILayout.BeginVertical(); + + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Clear Cookies")) + BestHTTP.Cookies.CookieJar.Clear(); + + GUILayout.EndVertical(); + } +#endif + }); + + if (SelectedSample == null || (SelectedSample != null && !SelectedSample.IsRunning)) + { + // Draw the list of samples + GUIHelper.DrawArea(new Rect(0, statisticsHeight + 5, SelectedSample == null ? Screen.width : Screen.width / 3, Screen.height - statisticsHeight - 5), false, () => + { + scrollPos = GUILayout.BeginScrollView(scrollPos); + for (int i = 0; i < Samples.Count; ++i) + DrawSample(Samples[i]); + GUILayout.EndScrollView(); + }); + + if (SelectedSample != null) + DrawSampleDetails(SelectedSample); + } + else if (SelectedSample != null && SelectedSample.IsRunning) + { + GUILayout.BeginArea(new Rect(0, Screen.height - 50, Screen.width, 50), string.Empty); + GUILayout.FlexibleSpace(); + GUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + + GUILayout.BeginVertical(); + GUILayout.FlexibleSpace(); + if (GUILayout.Button("Back", GUILayout.MinWidth(100))) + SelectedSample.DestroyUnityObject(); + GUILayout.FlexibleSpace(); + GUILayout.EndVertical(); + + GUILayout.EndHorizontal(); + GUILayout.EndArea(); + } + } + + private void DrawSample(SampleDescriptor sample) + { + if (sample.IsLabel) + { + GUILayout.Space(15); + GUIHelper.DrawCenteredText(sample.DisplayName); + GUILayout.Space(5); + } + else if (GUILayout.Button(sample.DisplayName)) + { + sample.IsSelected = true; + + if (SelectedSample != null) + SelectedSample.IsSelected = false; + + SelectedSample = sample; + } + } + + private void DrawSampleDetails(SampleDescriptor sample) + { + Rect area = new Rect(Screen.width / 3, statisticsHeight + 5, (Screen.width / 3) * 2, Screen.height - statisticsHeight - 5); + GUI.Box(area, string.Empty); + + GUILayout.BeginArea(area); + GUILayout.BeginVertical(); + GUIHelper.DrawCenteredText(sample.DisplayName); + GUILayout.Space(5); + GUILayout.Label(sample.Description); + GUILayout.FlexibleSpace(); + + if (GUILayout.Button("Start Sample")) + sample.CreateUnityObject(); + + GUILayout.EndVertical(); + GUILayout.EndArea(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.cs.meta new file mode 100644 index 00000000..6412f62c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 8265be5da926116458a8948712d2eddb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.unity b/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.unity new file mode 100644 index 00000000..9f6655f5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.unity @@ -0,0 +1,286 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657874, g: 0.49641258, b: 0.574817, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &4 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 10 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_MixedBakeMode: 1 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 0 +--- !u!196 &5 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1787359519 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1787359521} + - component: {fileID: 1787359520} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1787359520 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1787359519} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1787359521 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1787359519} + m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1927127934 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1927127940} + - component: {fileID: 1927127939} + - component: {fileID: 1927127938} + - component: {fileID: 1927127937} + - component: {fileID: 1927127936} + - component: {fileID: 1927127935} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1927127935 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1927127934} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8265be5da926116458a8948712d2eddb, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!81 &1927127936 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1927127934} + m_Enabled: 1 +--- !u!124 &1927127937 +Behaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1927127934} + m_Enabled: 1 +--- !u!92 &1927127938 +Behaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1927127934} + m_Enabled: 1 +--- !u!20 &1927127939 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1927127934} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1927127940 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1927127934} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.unity.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.unity.meta new file mode 100644 index 00000000..489c4296 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SampleSelector.unity.meta @@ -0,0 +1,6 @@ +fileFormatVersion: 2 +guid: 5ed13563a809f06489c3e97e4da02176 +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR.meta new file mode 100644 index 00000000..a6a98c84 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d69707652d0d406448aedf33b807bf6d +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers.meta new file mode 100644 index 00000000..cb6512fc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9286baa677f488b4bb493dd5436147c6 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleCookieAuthentication.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleCookieAuthentication.cs new file mode 100644 index 00000000..11b83e4a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleCookieAuthentication.cs @@ -0,0 +1,135 @@ +#if !BESTHTTP_DISABLE_SIGNALR +#if !BESTHTTP_DISABLE_COOKIES && (!UNITY_WEBGL || UNITY_EDITOR) + +using System; + +using BestHTTP.Cookies; +using BestHTTP.SignalR.Transports; + +namespace BestHTTP.SignalR.Authentication +{ + public sealed class SampleCookieAuthentication : IAuthenticationProvider + { + #region Public Properties + + public Uri AuthUri { get; private set; } + public string UserName { get; private set; } + public string Password { get; private set; } + public string UserRoles { get; private set; } + + #endregion + + #region IAuthenticationProvider properties + + public bool IsPreAuthRequired { get; private set; } + + public event OnAuthenticationSuccededDelegate OnAuthenticationSucceded; + public event OnAuthenticationFailedDelegate OnAuthenticationFailed; + + #endregion + + #region Privates + + private HTTPRequest AuthRequest; + private Cookie Cookie; + + #endregion + + public SampleCookieAuthentication(Uri authUri, string user, string passwd, string roles) + { + this.AuthUri = authUri; + this.UserName = user; + this.Password = passwd; + this.UserRoles = roles; + this.IsPreAuthRequired = true; + } + + #region IAuthenticationProvider Implementation + + public void StartAuthentication() + { + AuthRequest = new HTTPRequest(AuthUri, HTTPMethods.Post, OnAuthRequestFinished); + + // Setup the form + AuthRequest.AddField("userName", UserName); + AuthRequest.AddField("Password", Password); // not used in the sample + AuthRequest.AddField("roles", UserRoles); + + AuthRequest.Send(); + } + + public void PrepareRequest(HTTPRequest request, RequestTypes type) + { + // Adding the cookie to the request is not required, as it's managed by the plugin automatically, + // but for now, we want to be really sure that it's added + request.Cookies.Add(Cookie); + } + + #endregion + + #region Request Handler + + void OnAuthRequestFinished(HTTPRequest req, HTTPResponse resp) + { + AuthRequest = null; + string failReason = string.Empty; + + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + Cookie = resp.Cookies != null ? resp.Cookies.Find(c => c.Name.Equals(".ASPXAUTH")) : null; + + if (Cookie != null) + { + HTTPManager.Logger.Information("CookieAuthentication", "Auth. Cookie found!"); + + if (OnAuthenticationSucceded != null) + OnAuthenticationSucceded(this); + + // return now, all other paths are authentication failures + return; + } + else + HTTPManager.Logger.Warning("CookieAuthentication", failReason = "Auth. Cookie NOT found!"); + } + else + HTTPManager.Logger.Warning("CookieAuthentication", failReason = string.Format("Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText)); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + HTTPManager.Logger.Warning("CookieAuthentication", failReason = "Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception")); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + HTTPManager.Logger.Warning("CookieAuthentication", failReason = "Request Aborted!"); + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + HTTPManager.Logger.Error("CookieAuthentication", failReason = "Connection Timed Out!"); + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + HTTPManager.Logger.Error("CookieAuthentication", failReason = "Processing the request Timed Out!"); + break; + } + + if (OnAuthenticationFailed != null) + OnAuthenticationFailed(this, failReason); + } + + #endregion + } +} + +#endif +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleCookieAuthentication.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleCookieAuthentication.cs.meta new file mode 100644 index 00000000..e40c03b5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleCookieAuthentication.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 48a74a50eeb07bb4ea649a902e9d487a +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleHeaderAuthentication.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleHeaderAuthentication.cs new file mode 100644 index 00000000..1ed0cfa3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleHeaderAuthentication.cs @@ -0,0 +1,97 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +namespace BestHTTP.SignalR.Authentication +{ + /// + /// Custom http-header based authenticator. + /// + /// + /// // Server side implementation of the Header-based authenticator + /// // Use it by adding the app.Use(typeof(HeaderBasedAuthenticationMiddleware)); line to the Startup class' Configuration function. + /// private class HeaderBasedAuthenticationMiddleware : OwinMiddleware + /// { + /// public HeaderBasedAuthenticationMiddleware(OwinMiddleware next) + /// : base(next) + /// { + /// } + /// + /// public override Task Invoke(IOwinContext context) + /// { + /// string username = context.Request.Headers.Get("username"); + /// string roles = context.Request.Headers.Get("roles"); + /// + /// if (!String.IsNullOrEmpty(username) && !String.IsNullOrEmpty(roles)) + /// { + /// var identity = new System.Security.Principal.GenericIdentity(username); + /// + /// var principal = new System.Security.Principal.GenericPrincipal(identity, SplitString(roles)); + /// + /// context.Request.User = principal; + /// } + /// + /// return Next.Invoke(context); + /// } + /// + /// private static string[] SplitString(string original) + /// { + /// if (String.IsNullOrEmpty(original)) + /// return new string[0]; + /// + /// var split = from piece in original.Split(',') let trimmed = piece.Trim() where !String.IsNullOrEmpty(trimmed) select trimmed; + /// + /// return split.ToArray(); + /// } + /// } + /// + /// + /// + class HeaderAuthenticator : IAuthenticationProvider + { + public string User { get; private set; } + public string Roles { get; private set; } + + /// + /// No pre-auth step required for this type of authentication + /// + public bool IsPreAuthRequired { get { return false; } } + +#pragma warning disable 0067 + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationSuccededDelegate OnAuthenticationSucceded; + + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationFailedDelegate OnAuthenticationFailed; + +#pragma warning restore 0067 + + /// + /// Constructor to initialise the authenticator with username and roles. + /// + public HeaderAuthenticator(string user, string roles) + { + this.User = user; + this.Roles = roles; + } + + /// + /// Not used as IsPreAuthRequired is false + /// + public void StartAuthentication() + { } + + /// + /// Prepares the request by adding two headers to it + /// + public void PrepareRequest(BestHTTP.HTTPRequest request, RequestTypes type) + { + request.SetHeader("username", this.User); + request.SetHeader("roles", this.Roles); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleHeaderAuthentication.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleHeaderAuthentication.cs.meta new file mode 100644 index 00000000..4be0307e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Authentication Providers/SampleHeaderAuthentication.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5ebd4ce02d369a6498f9be6bb7141ac3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/AuthenticationSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/AuthenticationSample.cs new file mode 100644 index 00000000..f014f2c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/AuthenticationSample.cs @@ -0,0 +1,210 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; +using System.Collections.Generic; + +using UnityEngine; +using BestHTTP.SignalR; +using BestHTTP.SignalR.Hubs; +using BestHTTP.SignalR.Messages; +using BestHTTP.SignalR.Authentication; + +namespace BestHTTP.Examples +{ + public class AuthenticationSample : MonoBehaviour + { + readonly Uri URI = new Uri(GUIHelper.BaseURL + "/signalr"); + + #region Private Fields + + /// + /// Reference to the SignalR Connection + /// + Connection signalRConnection; + + string userName = string.Empty; + string role = string.Empty; + + Vector2 scrollPos; + + #endregion + + #region Unity Events + + void Start() + { + // Create the SignalR connection, and pass the hubs that we want to connect to + signalRConnection = new Connection(URI, new BaseHub("noauthhub", "Messages"), + new BaseHub("invokeauthhub", "Messages Invoked By Admin or Invoker"), + new BaseHub("authhub", "Messages Requiring Authentication to Send or Receive"), + new BaseHub("inheritauthhub", "Messages Requiring Authentication to Send or Receive Because of Inheritance"), + new BaseHub("incomingauthhub", "Messages Requiring Authentication to Send"), + new BaseHub("adminauthhub", "Messages Requiring Admin Membership to Send or Receive"), + new BaseHub("userandroleauthhub", "Messages Requiring Name to be \"User\" and Role to be \"Admin\" to Send or Receive")); + + // Set the authenticator if we have valid fields + if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(role)) + signalRConnection.AuthenticationProvider = new HeaderAuthenticator(userName, role); + + // Set up event handler + signalRConnection.OnConnected += signalRConnection_OnConnected; + + // Start to connect to the server. + signalRConnection.Open(); + } + + void OnDestroy() + { + // Close the connection when we are closing the sample + signalRConnection.Close(); + } + + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + scrollPos = GUILayout.BeginScrollView(scrollPos, false, false); + GUILayout.BeginVertical(); + + if (signalRConnection.AuthenticationProvider == null) + { + GUILayout.BeginHorizontal(); + GUILayout.Label("Username (Enter 'User'):"); + userName = GUILayout.TextField(userName, GUILayout.MinWidth(100)); + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + GUILayout.Label("Roles (Enter 'Invoker' or 'Admin'):"); + role = GUILayout.TextField(role, GUILayout.MinWidth(100)); + GUILayout.EndHorizontal(); + + if (GUILayout.Button("Log in")) + Restart(); + } + + for (int i = 0; i < signalRConnection.Hubs.Length; ++i) + (signalRConnection.Hubs[i] as BaseHub).Draw(); + + GUILayout.EndVertical(); + GUILayout.EndScrollView(); + }); + } + + #endregion + + /// + /// Called when we successfully connected to the server. + /// + void signalRConnection_OnConnected(Connection manager) + { + // call 'InvokedFromClient' on all hubs + for (int i = 0; i < signalRConnection.Hubs.Length; ++i) + (signalRConnection.Hubs[i] as BaseHub).InvokedFromClient(); + } + + /// + /// Helper function to do a hard-restart to the server. + /// + void Restart() + { + // Clean up + signalRConnection.OnConnected -= signalRConnection_OnConnected; + + // Close current connection + signalRConnection.Close(); + signalRConnection = null; + + // start again, with authentication if we filled in all input fields + Start(); + + } + } + + /// + /// Hub implementation for the authentication demo. All hubs that we connect to has the same server and client side functions. + /// + class BaseHub : Hub + { + #region Private Fields + + /// + /// Hub specific title + /// + private string Title; + + private GUIMessageList messages = new GUIMessageList(); + + #endregion + + public BaseHub(string name, string title) + : base(name) + { + this.Title = title; + + // Map the server-callable method names to the real functions. + On("joined", Joined); + On("rejoined", Rejoined); + On("left", Left); + On("invoked", Invoked); + } + + #region Server Called Functions + + private void Joined(Hub hub, MethodCallMessage methodCall) + { + Dictionary AuthInfo = methodCall.Arguments[2] as Dictionary; + messages.Add(string.Format("{0} joined at {1}\n\tIsAuthenticated: {2} IsAdmin: {3} UserName: {4}", methodCall.Arguments[0], methodCall.Arguments[1], AuthInfo["IsAuthenticated"], AuthInfo["IsAdmin"], AuthInfo["UserName"])); + } + + private void Rejoined(Hub hub, MethodCallMessage methodCall) + { + messages.Add(string.Format("{0} reconnected at {1}", methodCall.Arguments[0], methodCall.Arguments[1])); + } + + private void Left(Hub hub, MethodCallMessage methodCall) + { + messages.Add(string.Format("{0} left at {1}", methodCall.Arguments[0], methodCall.Arguments[1])); + } + + private void Invoked(Hub hub, MethodCallMessage methodCall) + { + messages.Add(string.Format("{0} invoked hub method at {1}", methodCall.Arguments[0], methodCall.Arguments[1])); + } + + #endregion + + #region Client callable function implementation + + public void InvokedFromClient() + { + base.Call("invokedFromClient", OnInvoked, OnInvokeFailed); + } + + private void OnInvoked(Hub hub, ClientMessage originalMessage, ResultMessage result) + { + Debug.Log(hub.Name + " invokedFromClient success!"); + } + + /// + /// This callback function will be called every time we try to access a protected API while we are using an non-authenticated connection. + /// + private void OnInvokeFailed(Hub hub, ClientMessage originalMessage, FailureMessage result) + { + Debug.LogWarning(hub.Name + " " + result.ErrorMessage); + } + + #endregion + + public void Draw() + { + GUILayout.Label(this.Title); + + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + messages.Draw(Screen.width - 20, 100); + GUILayout.EndHorizontal(); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/AuthenticationSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/AuthenticationSample.cs.meta new file mode 100644 index 00000000..fe1fef2e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/AuthenticationSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 02921d1602244e44cbd5103f972bf1fb +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionAPISample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionAPISample.cs new file mode 100644 index 00000000..54ba841c --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionAPISample.cs @@ -0,0 +1,275 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; + +using UnityEngine; +using BestHTTP.SignalR; + +#if !BESTHTTP_DISABLE_COOKIES && (!UNITY_WEBGL || UNITY_EDITOR) + using BestHTTP.Cookies; +#endif + +namespace BestHTTP.Examples +{ + public sealed class ConnectionAPISample : MonoBehaviour + { + readonly Uri URI = new Uri(GUIHelper.BaseURL + "/raw-connection/"); + + /// + /// Possible message types that the client can send to the server + /// + enum MessageTypes + { + Send, // 0 + Broadcast, // 1 + Join, // 2 + PrivateMessage, // 3 + AddToGroup, // 4 + RemoveFromGroup, // 5 + SendToGroup, // 6 + BroadcastExceptMe, // 7 + } + + #region Private Fields + + /// + /// Reference to the SignalR Connection + /// + Connection signalRConnection; + + // Input strings + string ToEveryBodyText = string.Empty; + string ToMeText = string.Empty; + string PrivateMessageText = string.Empty; + string PrivateMessageUserOrGroupName = string.Empty; + + GUIMessageList messages = new GUIMessageList(); + + #endregion + + #region Unity Events + + void Start() + { +#if !BESTHTTP_DISABLE_COOKIES && (!UNITY_WEBGL || UNITY_EDITOR) + // Set a "user" cookie if we previously used the 'Enter Name' button. + // The server will set this username to the new connection. + if (PlayerPrefs.HasKey("userName")) + CookieJar.Set(URI, new Cookie("user", PlayerPrefs.GetString("userName"))); +#endif + + signalRConnection = new Connection(URI); + + // to serialize the Message class, set a more advanced json encoder + signalRConnection.JsonEncoder = new BestHTTP.SignalR.JsonEncoders.LitJsonEncoder(); + + // set up event handlers + signalRConnection.OnStateChanged += signalRConnection_OnStateChanged; + signalRConnection.OnNonHubMessage += signalRConnection_OnGeneralMessage; + + // Start to connect to the server. + signalRConnection.Open(); + } + + /// + /// Draw the gui. + /// Get input strings. + /// Handle function calls. + /// + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + GUILayout.BeginVertical(); + + #region To Everybody + GUILayout.Label("To Everybody"); + + GUILayout.BeginHorizontal(); + + ToEveryBodyText = GUILayout.TextField(ToEveryBodyText, GUILayout.MinWidth(100)); + + if (GUILayout.Button("Broadcast")) + Broadcast(ToEveryBodyText); + + if (GUILayout.Button("Broadcast (All Except Me)")) + BroadcastExceptMe(ToEveryBodyText); + + if (GUILayout.Button("Enter Name")) + EnterName(ToEveryBodyText); + + if (GUILayout.Button("Join Group")) + JoinGroup(ToEveryBodyText); + + if (GUILayout.Button("Leave Group")) + LeaveGroup(ToEveryBodyText); + + GUILayout.EndHorizontal(); + #endregion + + #region To Me + GUILayout.Label("To Me"); + + GUILayout.BeginHorizontal(); + + ToMeText = GUILayout.TextField(ToMeText, GUILayout.MinWidth(100)); + + if (GUILayout.Button("Send to me")) + SendToMe(ToMeText); + + GUILayout.EndHorizontal(); + #endregion + + #region Private Message + GUILayout.Label("Private Message"); + + GUILayout.BeginHorizontal(); + + GUILayout.Label("Message:"); + PrivateMessageText = GUILayout.TextField(PrivateMessageText, GUILayout.MinWidth(100)); + + GUILayout.Label("User or Group name:"); + PrivateMessageUserOrGroupName = GUILayout.TextField(PrivateMessageUserOrGroupName, GUILayout.MinWidth(100)); + + if (GUILayout.Button("Send to user")) + SendToUser(PrivateMessageUserOrGroupName, PrivateMessageText); + + if (GUILayout.Button("Send to group")) + SendToGroup(PrivateMessageUserOrGroupName, PrivateMessageText); + + GUILayout.EndHorizontal(); + #endregion + + GUILayout.Space(20); + + if (signalRConnection.State == ConnectionStates.Closed) + { + if (GUILayout.Button("Start Connection")) + signalRConnection.Open(); + } + else if (GUILayout.Button("Stop Connection")) + signalRConnection.Close(); + + GUILayout.Space(20); + + // Draw the messages + GUILayout.Label("Messages"); + + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + messages.Draw(Screen.width - 20, 0); + GUILayout.EndHorizontal(); + + GUILayout.EndVertical(); + }); + } + + void OnDestroy() + { + // Close the connection when the sample is closed + signalRConnection.Close(); + } + + #endregion + + #region SignalR Events + + /// + /// Handle non-hub messages + /// + void signalRConnection_OnGeneralMessage(Connection manager, object data) + { + // For now, just create a Json string from the sent data again + string reencoded = BestHTTP.JSON.Json.Encode(data); + + // and display it + messages.Add("[Server Message] " + reencoded); + } + + void signalRConnection_OnStateChanged(Connection manager, ConnectionStates oldState, ConnectionStates newState) + { + // display state changes + messages.Add(string.Format("[State Change] {0} => {1}", oldState.ToString(), newState.ToString())); + } + + #endregion + + #region To EveryBody Functions + + /// + /// Broadcast a message to all connected clients + /// + private void Broadcast(string text) + { + signalRConnection.Send(new { Type = MessageTypes.Broadcast, Value = text }); + } + + /// + /// Broadcast a message to all connected clients, except this client + /// + private void BroadcastExceptMe(string text) + { + signalRConnection.Send(new { Type = MessageTypes.BroadcastExceptMe, Value = text }); + } + + /// + /// Set a name for this connection. + /// + private void EnterName(string name) + { + signalRConnection.Send(new { Type = MessageTypes.Join, Value = name }); + } + + /// + /// Join to a group + /// + private void JoinGroup(string groupName) + { + signalRConnection.Send(new { Type = MessageTypes.AddToGroup, Value = groupName }); + } + + /// + /// Leave a group + /// + private void LeaveGroup(string groupName) + { + signalRConnection.Send(new { Type = MessageTypes.RemoveFromGroup, Value = groupName }); + } + + #endregion + + #region To Me Functions + + /// + /// Send a message to the very same client through the server + /// + void SendToMe(string text) + { + signalRConnection.Send(new { Type = MessageTypes.Send, Value = text }); + } + + #endregion + + #region Private Message Functions + + /// + /// Send a private message to a user + /// + void SendToUser(string userOrGroupName, string text) + { + signalRConnection.Send(new { Type = MessageTypes.PrivateMessage, Value = string.Format("{0}|{1}", userOrGroupName, text) }); + } + + /// + /// Send a message to a group + /// + void SendToGroup(string userOrGroupName, string text) + { + signalRConnection.Send(new { Type = MessageTypes.SendToGroup, Value = string.Format("{0}|{1}", userOrGroupName, text) }); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionAPISample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionAPISample.cs.meta new file mode 100644 index 00000000..ace04ed1 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionAPISample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 872d6dfdac0e67f4d910376205532bc0 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionStatusSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionStatusSample.cs new file mode 100644 index 00000000..b1b1c767 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionStatusSample.cs @@ -0,0 +1,141 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; + +using UnityEngine; +using BestHTTP.SignalR; +using BestHTTP.SignalR.Hubs; + +namespace BestHTTP.Examples +{ + public sealed class ConnectionStatusSample : MonoBehaviour + { + readonly Uri URI = new Uri(GUIHelper.BaseURL + "/signalr"); + + /// + /// Reference to the SignalR Connection + /// + Connection signalRConnection; + + GUIMessageList messages = new GUIMessageList(); + + #region Unity Events + + void Start() + { + // Connect to the StatusHub hub + signalRConnection = new Connection(URI, "StatusHub"); + + // General events + signalRConnection.OnNonHubMessage += signalRConnection_OnNonHubMessage; + signalRConnection.OnError += signalRConnection_OnError; + signalRConnection.OnStateChanged += signalRConnection_OnStateChanged; + + // Set up a callback for Hub events + signalRConnection["StatusHub"].OnMethodCall += statusHub_OnMethodCall; + + // Connect to the server + signalRConnection.Open(); + } + + void OnDestroy() + { + // Close the connection when we are closing the sample + signalRConnection.Close(); + } + + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + GUILayout.BeginHorizontal(); + + if (GUILayout.Button("START") && signalRConnection.State != ConnectionStates.Connected) + signalRConnection.Open(); + + if (GUILayout.Button("STOP") && signalRConnection.State == ConnectionStates.Connected) + { + signalRConnection.Close(); + messages.Clear(); + } + + if (GUILayout.Button("PING") && signalRConnection.State == ConnectionStates.Connected) + { + // Call a Hub-method on the server. + signalRConnection["StatusHub"].Call("Ping"); + } + + GUILayout.EndHorizontal(); + + GUILayout.Space(20); + + GUILayout.Label("Connection Status Messages"); + + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + messages.Draw(Screen.width - 20, 0); + GUILayout.EndHorizontal(); + }); + } + + #endregion + + #region SignalR Events + + /// + /// Called on server-sent non-hub messages. + /// + void signalRConnection_OnNonHubMessage(Connection manager, object data) + { + messages.Add("[Server Message] " + data.ToString()); + } + + /// + /// Called when the SignalR Connection's state changes. + /// + void signalRConnection_OnStateChanged(Connection manager, ConnectionStates oldState, ConnectionStates newState) + { + messages.Add(string.Format("[State Change] {0} => {1}", oldState, newState)); + } + + /// + /// Called when an error occures. The plugin may close the connection after this event. + /// + void signalRConnection_OnError(Connection manager, string error) + { + messages.Add("[Error] " + error); + } + + /// + /// Called when the "StatusHub" hub wants to call a method on this client. + /// + void statusHub_OnMethodCall(Hub hub, string method, params object[] args) + { + string id = args.Length > 0 ? args[0] as string : string.Empty; + string when = args.Length > 1 ? args[1].ToString() : string.Empty; + + switch (method) + { + case "joined": + messages.Add(string.Format("[{0}] {1} joined at {2}", hub.Name, id, when)); + break; + + case "rejoined": + messages.Add(string.Format("[{0}] {1} reconnected at {2}", hub.Name, id, when)); + break; + + case "leave": + messages.Add(string.Format("[{0}] {1} leaved at {2}", hub.Name, id, when)); + break; + + default: // pong + messages.Add(string.Format("[{0}] {1}", hub.Name, method)); + break; + } + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionStatusSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionStatusSample.cs.meta new file mode 100644 index 00000000..c296aedf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/ConnectionStatusSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 0d5b759afc726754fb1e1d49d529bae5 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/DemoHubSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/DemoHubSample.cs new file mode 100644 index 00000000..e89c5822 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/DemoHubSample.cs @@ -0,0 +1,557 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; + +using UnityEngine; + +using BestHTTP.SignalR; +using BestHTTP.SignalR.Hubs; +using BestHTTP.SignalR.Messages; +using BestHTTP.SignalR.JsonEncoders; + +namespace BestHTTP.Examples +{ + public sealed class DemoHubSample : MonoBehaviour + { + readonly Uri URI = new Uri(GUIHelper.BaseURL + "/signalr"); + + /// + /// The SignalR connection instance + /// + Connection signalRConnection; + + /// + /// DemoHub client side implementation + /// + DemoHub demoHub; + + /// + /// TypedDemoHub client side implementation + /// + TypedDemoHub typedDemoHub; + + /// + /// VB .NET Hub + /// + Hub vbDemoHub; + + /// + /// Result of the VB demo's ReadStateValue call + /// + string vbReadStateResult = string.Empty; + + Vector2 scrollPos; + + void Start() + { + // Create the hubs + demoHub = new DemoHub(); + typedDemoHub = new TypedDemoHub(); + vbDemoHub = new Hub("vbdemo"); + + // Create the SignalR connection, passing all the three hubs to it + signalRConnection = new Connection(URI, demoHub, typedDemoHub, vbDemoHub); + + // Switch from the default encoder to the LitJson Encoder because it can handle the complex types too. + signalRConnection.JsonEncoder = new LitJsonEncoder(); + + // Call the demo functions when we successfully connect to the server + signalRConnection.OnConnected += (connection) => + { + var person = new { Name = "Foo", Age = 20, Address = new { Street = "One Microsoft Way", Zip = "98052" } }; + + // Call the demo functions + + demoHub.AddToGroups(); + demoHub.GetValue(); + demoHub.TaskWithException(); + demoHub.GenericTaskWithException(); + demoHub.SynchronousException(); + demoHub.DynamicTask(); + demoHub.PassingDynamicComplex(person); + demoHub.SimpleArray(new int[] { 5, 5, 6 }); + demoHub.ComplexType(person); + demoHub.ComplexArray(new object[] { person, person, person }); + demoHub.ReportProgress("Long running job!"); + + demoHub.Overload(); + + // set some state + demoHub.State["name"] = "Testing state!"; + demoHub.ReadStateValue(); + + demoHub.PlainTask(); + demoHub.GenericTaskWithContinueWith(); + + typedDemoHub.Echo("Typed echo callback"); + + // vbDemo is not wrapped in a hub class, it would contain only one function + vbDemoHub.Call("readStateValue", (hub, msg, result) => vbReadStateResult = string.Format("Read some state from VB.NET! => {0}", result.ReturnValue == null ? "undefined" : result.ReturnValue.ToString())); + }; + + // Start opening the signalR connection + signalRConnection.Open(); + } + + void OnDestroy() + { + // Close the connection when we are closing this sample + signalRConnection.Close(); + } + + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + scrollPos = GUILayout.BeginScrollView(scrollPos, false, false); + GUILayout.BeginVertical(); + + demoHub.Draw(); + + typedDemoHub.Draw(); + + GUILayout.Label("Read State Value"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(vbReadStateResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.EndVertical(); + GUILayout.EndScrollView(); + }); + + } + } + + /// + /// Wrapper class of the 'TypedDemoHub' hub + /// + class TypedDemoHub : Hub + { + string typedEchoResult = string.Empty; + string typedEchoClientResult = string.Empty; + + public TypedDemoHub() + : base("typeddemohub") + { + + // Setup server-called functions + base.On("Echo", Echo); + } + + #region Server Called Functions + + /// + /// Server-called, client side implementation of the Echo function + /// + private void Echo(Hub hub, MethodCallMessage methodCall) + { + typedEchoClientResult = string.Format("{0} #{1} triggered!", methodCall.Arguments[0], methodCall.Arguments[1]); + } + + #endregion + + #region Client Called Function(s) + + /// + /// Client-called, server side implementation of the Echo function. + /// When the function successfully executed on the server the OnEcho_Done callback function will be called. + /// + public void Echo(string msg) + { + base.Call("echo", OnEcho_Done, msg); + } + + /// + /// When the function successfully executed on the server this callback function will be called. + /// + private void OnEcho_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) + { + typedEchoResult = "TypedDemoHub.Echo(string message) invoked!"; + } + + #endregion + + public void Draw() + { + GUILayout.Label("Typed callback"); + + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.BeginVertical(); + GUILayout.Label(typedEchoResult); + GUILayout.Label(typedEchoClientResult); + GUILayout.EndVertical(); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + } + } + + /// + /// A wrapper class for the 'DemoHub' hub. + /// + class DemoHub : Hub + { + #region Private fields + + // These fields are here to store results of the function calls + + float longRunningJobProgress = 0f; + string longRunningJobStatus = "Not Started!"; + string fromArbitraryCodeResult = string.Empty; + string groupAddedResult = string.Empty; + string dynamicTaskResult = string.Empty; + string genericTaskResult = string.Empty; + string taskWithExceptionResult = string.Empty; + string genericTaskWithExceptionResult = string.Empty; + string synchronousExceptionResult = string.Empty; + string invokingHubMethodWithDynamicResult = string.Empty; + string simpleArrayResult = string.Empty; + string complexTypeResult = string.Empty; + string complexArrayResult = string.Empty; + string voidOverloadResult = string.Empty; + string intOverloadResult = string.Empty; + string readStateResult = string.Empty; + string plainTaskResult = string.Empty; + string genericTaskWithContinueWithResult = string.Empty; + GUIMessageList invokeResults = new GUIMessageList(); + + #endregion + + public DemoHub() + : base("demo") + { + + // Setup server-called functions + base.On("invoke", Invoke); + base.On("signal", Signal); + base.On("groupAdded", GroupAdded); + base.On("fromArbitraryCode", FromArbitraryCode); + } + + #region Client Called Functions + + #region ReportProgress + + public void ReportProgress(string arg) + { + Call("reportProgress", OnLongRunningJob_Done, null, OnLongRunningJob_Progress, arg); + } + + public void OnLongRunningJob_Progress(Hub hub, ClientMessage originialMessage, ProgressMessage progress) + { + longRunningJobProgress = (float)progress.Progress; + longRunningJobStatus = progress.Progress.ToString() + "%"; + } + + public void OnLongRunningJob_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) + { + longRunningJobStatus = result.ReturnValue.ToString(); + + MultipleCalls(); + } + + #endregion + + public void MultipleCalls() + { + base.Call("multipleCalls"); + } + + #region DynamicTask + + public void DynamicTask() + { + base.Call("dynamicTask", OnDynamicTask_Done, OnDynamicTask_Failed); + } + + private void OnDynamicTask_Failed(Hub hub, ClientMessage originalMessage, FailureMessage result) + { + dynamicTaskResult = string.Format("The dynamic task failed :( {0}", result.ErrorMessage); + } + + private void OnDynamicTask_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) + { + dynamicTaskResult = string.Format("The dynamic task! {0}", result.ReturnValue); + } + + #endregion + + public void AddToGroups() + { + base.Call("addToGroups"); + } + + public void GetValue() + { + base.Call("getValue", (hub, msg, result) => genericTaskResult = string.Format("The value is {0} after 5 seconds", result.ReturnValue)); + } + + public void TaskWithException() + { + // This method call must fail, so only error handler added + base.Call("taskWithException", null, (Hub hub, ClientMessage msg, FailureMessage error) => taskWithExceptionResult = string.Format("Error: {0}", error.ErrorMessage)); + } + + public void GenericTaskWithException() + { + // This method call must fail, so only error handler added + base.Call("genericTaskWithException", null, (Hub hub, ClientMessage msg, FailureMessage error) => genericTaskWithExceptionResult = string.Format("Error: {0}", error.ErrorMessage)); + } + + public void SynchronousException() + { + // This method call must fail, so only error handler added + base.Call("synchronousException", null, (Hub hub, ClientMessage msg, FailureMessage error) => synchronousExceptionResult = string.Format("Error: {0}", error.ErrorMessage)); + } + + public void PassingDynamicComplex(object person) + { + base.Call("passingDynamicComplex", (hub, msg, result) => invokingHubMethodWithDynamicResult = string.Format("The person's age is {0}", result.ReturnValue), person); + } + + public void SimpleArray(int[] array) + { + base.Call("simpleArray", (hub, msg, result) => simpleArrayResult = "Simple array works!", array); + } + + public void ComplexType(object person) + { + base.Call("complexType", (hub, msg, result) => complexTypeResult = string.Format("Complex Type -> {0}", (this as IHub).Connection.JsonEncoder.Encode(this.State["person"])), person); + } + + public void ComplexArray(object[] complexArray) + { + // We need to cast the object array to object to keep it as an array + // http://stackoverflow.com/questions/36350/how-to-pass-a-single-object-to-a-params-object + base.Call("ComplexArray", (hub, msg, result) => complexArrayResult = "Complex Array Works!", (object)complexArray); + } + + #region Overloads + + public void Overload() + { + base.Call("Overload", OnVoidOverload_Done); + } + + private void OnVoidOverload_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) + { + voidOverloadResult = "Void Overload called"; + + Overload(101); + } + + public void Overload(int number) + { + base.Call("Overload", OnIntOverload_Done, number); + } + + private void OnIntOverload_Done(Hub hub, ClientMessage originalMessage, ResultMessage result) + { + intOverloadResult = string.Format("Overload with return value called => {0}", result.ReturnValue.ToString()); + } + + #endregion + + public void ReadStateValue() + { + base.Call("readStateValue", (hub, msg, result) => readStateResult = string.Format("Read some state! => {0}", result.ReturnValue)); + } + + public void PlainTask() + { + base.Call("plainTask", (hub, msg, result) => plainTaskResult = "Plain Task Result"); + } + + public void GenericTaskWithContinueWith() + { + base.Call("genericTaskWithContinueWith", (hub, msg, result) => genericTaskWithContinueWithResult = result.ReturnValue.ToString()); + } + + #endregion + + #region Server Called Functions + + private void FromArbitraryCode(Hub hub, MethodCallMessage methodCall) + { + fromArbitraryCodeResult = methodCall.Arguments[0] as string; + } + + private void GroupAdded(Hub hub, MethodCallMessage methodCall) + { + if (!string.IsNullOrEmpty(groupAddedResult)) + groupAddedResult = "Group Already Added!"; + else + groupAddedResult = "Group Added!"; + } + + private void Signal(Hub hub, MethodCallMessage methodCall) + { + dynamicTaskResult = string.Format("The dynamic task! {0}", methodCall.Arguments[0]); + } + + private void Invoke(Hub hub, MethodCallMessage methodCall) + { + invokeResults.Add(string.Format("{0} client state index -> {1}", methodCall.Arguments[0], this.State["index"])); + } + + #endregion + + #region Draw + + /// + /// Display the result's of the function calls. + /// + public void Draw() + { + GUILayout.Label("Arbitrary Code"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(string.Format("Sending {0} from arbitrary code without the hub itself!", fromArbitraryCodeResult)); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Group Added"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(groupAddedResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Dynamic Task"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(dynamicTaskResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Report Progress"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.BeginVertical(); + GUILayout.Label(longRunningJobStatus); + GUILayout.HorizontalSlider(longRunningJobProgress, 0, 100); + GUILayout.EndVertical(); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Generic Task"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(genericTaskResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Task With Exception"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(taskWithExceptionResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Generic Task With Exception"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(genericTaskWithExceptionResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Synchronous Exception"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(synchronousExceptionResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Invoking hub method with dynamic"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(invokingHubMethodWithDynamicResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Simple Array"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(simpleArrayResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Complex Type"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(complexTypeResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Complex Array"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(complexArrayResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Overloads"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.BeginVertical(); + GUILayout.Label(voidOverloadResult); + GUILayout.Label(intOverloadResult); + GUILayout.EndVertical(); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Read State Value"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(readStateResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Plain Task"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(plainTaskResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Generic Task With ContinueWith"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + GUILayout.Label(genericTaskWithContinueWithResult); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + + GUILayout.Label("Message Pump"); + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + invokeResults.Draw(Screen.width - 40, 270); + GUILayout.EndHorizontal(); + + GUILayout.Space(10); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/DemoHubSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/DemoHubSample.cs.meta new file mode 100644 index 00000000..8ddc2d22 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/DemoHubSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 55779d2699b42c34ab1549c70402d294 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders.meta new file mode 100644 index 00000000..9688ed6b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1c996438e0be72649b8abf5fbdee3f41 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/JSonDotnetEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/JSonDotnetEncoder.cs new file mode 100644 index 00000000..27669dc9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/JSonDotnetEncoder.cs @@ -0,0 +1,23 @@ +#if !BESTHTTP_DISABLE_SIGNALR && BESTHTTP_SIGNALR_WITH_JSONDOTNET + +using System.Collections.Generic; + +using Newtonsoft.Json; + +namespace BestHTTP.SignalR.JsonEncoders +{ + public sealed class JSonDotnetEncoder : IJsonEncoder + { + public string Encode(object obj) + { + return JsonConvert.SerializeObject(obj); + } + + public IDictionary DecodeMessage(string json) + { + return JsonConvert.DeserializeObject>(json); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/JSonDotnetEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/JSonDotnetEncoder.cs.meta new file mode 100644 index 00000000..e4a7f7d0 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/JSonDotnetEncoder.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 653a0f163689052438748b7beda14886 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/LitJsonEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/LitJsonEncoder.cs new file mode 100644 index 00000000..e5d518c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/LitJsonEncoder.cs @@ -0,0 +1,28 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System.Collections.Generic; + +using LitJson; + +namespace BestHTTP.SignalR.JsonEncoders +{ + public sealed class LitJsonEncoder : IJsonEncoder + { + public string Encode(object obj) + { + JsonWriter writer = new JsonWriter(); + JsonMapper.ToJson(obj, writer); + + return writer.ToString(); + } + + public IDictionary DecodeMessage(string json) + { + JsonReader reader = new JsonReader(json); + + return JsonMapper.ToObject>(reader); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/LitJsonEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/LitJsonEncoder.cs.meta new file mode 100644 index 00000000..b143b7cf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/Json Encoders/LitJsonEncoder.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 2870a746a601b8b439c495ff39474385 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/SimpleStreamingSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/SimpleStreamingSample.cs new file mode 100644 index 00000000..135e3faf --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/SimpleStreamingSample.cs @@ -0,0 +1,91 @@ +#if !BESTHTTP_DISABLE_SIGNALR + +using System; + +using UnityEngine; +using BestHTTP.SignalR; + +namespace BestHTTP.Examples +{ + public sealed class SimpleStreamingSample : MonoBehaviour + { + readonly Uri URI = new Uri(GUIHelper.BaseURL + "/streaming-connection"); + + /// + /// Reference to the SignalR Connection + /// + Connection signalRConnection; + + /// + /// Helper GUI class to handle and display a string-list + /// + GUIMessageList messages = new GUIMessageList(); + + #region Unity Events + + void Start() + { + // Create the SignalR connection + signalRConnection = new Connection(URI); + + // set event handlers + signalRConnection.OnNonHubMessage += signalRConnection_OnNonHubMessage; + signalRConnection.OnStateChanged += signalRConnection_OnStateChanged; + signalRConnection.OnError += signalRConnection_OnError; + + // Start connecting to the server + signalRConnection.Open(); + } + + void OnDestroy() + { + // Close the connection when the sample is closed + signalRConnection.Close(); + } + + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + GUILayout.Label("Messages"); + + GUILayout.BeginHorizontal(); + GUILayout.Space(20); + messages.Draw(Screen.width - 20, 0); + GUILayout.EndHorizontal(); + }); + } + + #endregion + + #region SignalR Events + + /// + /// Handle Server-sent messages + /// + void signalRConnection_OnNonHubMessage(Connection connection, object data) + { + messages.Add("[Server Message] " + data.ToString()); + } + + /// + /// Display state changes + /// + void signalRConnection_OnStateChanged(Connection connection, ConnectionStates oldState, ConnectionStates newState) + { + messages.Add(string.Format("[State Change] {0} => {1}", oldState, newState)); + } + + /// + /// Display errors. + /// + void signalRConnection_OnError(Connection connection, string error) + { + messages.Add("[Error] " + error); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/SimpleStreamingSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/SimpleStreamingSample.cs.meta new file mode 100644 index 00000000..b2f79567 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalR/SimpleStreamingSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 0eb1f1efe4749fc489977765e40a04e4 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore.meta new file mode 100644 index 00000000..61166a65 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f7ff75ba203704d45bf1098536a2db5a +folderAsset: yes +timeCreated: 1515401610 +licenseType: Store +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers.meta new file mode 100644 index 00000000..14c0f171 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9e87559ef678942428f064af598c1696 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers/HeaderAuthenticator.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers/HeaderAuthenticator.cs new file mode 100644 index 00000000..9bd31647 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers/HeaderAuthenticator.cs @@ -0,0 +1,63 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE + +using System; + +namespace BestHTTP.SignalRCore.Authentication +{ + public sealed class HeaderAuthenticator : IAuthenticationProvider + { + /// + /// No pre-auth step required for this type of authentication + /// + public bool IsPreAuthRequired { get { return false; } } + +#pragma warning disable 0067 + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationSuccededDelegate OnAuthenticationSucceded; + + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationFailedDelegate OnAuthenticationFailed; + +#pragma warning restore 0067 + + private string _credentials; + + public HeaderAuthenticator(string credentials) + { + this._credentials = credentials; + } + + /// + /// Not used as IsPreAuthRequired is false + /// + public void StartAuthentication() + { } + + /// + /// Prepares the request by adding two headers to it + /// + public void PrepareRequest(BestHTTP.HTTPRequest request) + { +#if !UNITY_WEBGL + request.SetHeader("Authorization", "Bearer " + this._credentials); +#endif + } + + public Uri PrepareUri(Uri uri) + { +#if UNITY_WEBGL + string query = string.IsNullOrEmpty(uri.Query) ? "?" : uri.Query + "&"; + UriBuilder uriBuilder = new UriBuilder(uri.Scheme, uri.Host, uri.Port, uri.AbsolutePath, query + "access_token=" + this._credentials); + return uriBuilder.Uri; +#else + return uri; +#endif + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers/HeaderAuthenticator.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers/HeaderAuthenticator.cs.meta new file mode 100644 index 00000000..adff00fa --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Authentication Providers/HeaderAuthenticator.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 80b2246c164414c468eea4f0550eb9ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders.meta new file mode 100644 index 00000000..0e1e6944 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 35c592488a6dbbc4a96c1739cd74046c +folderAsset: yes +timeCreated: 1515401610 +licenseType: Store +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/JsonDotNetEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/JsonDotNetEncoder.cs new file mode 100644 index 00000000..3754e214 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/JsonDotNetEncoder.cs @@ -0,0 +1,38 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE && !BESTHTTP_DISABLE_WEBSOCKET +using System; + +namespace BestHTTP.SignalRCore.Encoders +{ + /*public sealed class JsonDotNetEncoder : BestHTTP.SignalRCore.IEncoder + { + public string Name { get { return "json"; } } + + public object ConvertTo(Type toType, object obj) + { + string json = Newtonsoft.Json.JsonConvert.SerializeObject(obj); + + return Newtonsoft.Json.JsonConvert.DeserializeObject(json, toType); + } + + public T DecodeAs(string text) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(text); + } + + public T DecodeAs(byte[] data) + { + throw new NotImplementedException(); + } + + public byte[] EncodeAsBinary(T value) + { + throw new NotImplementedException(); + } + + public string EncodeAsText(T value) + { + return Newtonsoft.Json.JsonConvert.SerializeObject(value); + } + }*/ +} +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/JsonDotNetEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/JsonDotNetEncoder.cs.meta new file mode 100644 index 00000000..6b9ce571 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/JsonDotNetEncoder.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5e565b09f1e97ee4c9d119735901397b +timeCreated: 1515401618 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/LitJsonEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/LitJsonEncoder.cs new file mode 100644 index 00000000..7798e8b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/LitJsonEncoder.cs @@ -0,0 +1,48 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE && !BESTHTTP_DISABLE_WEBSOCKET +using System; + +namespace BestHTTP.SignalRCore.Encoders +{ + public sealed class LitJsonEncoder : BestHTTP.SignalRCore.IEncoder + { + public string Name { get { return "json"; } } + + public LitJsonEncoder() + { + LitJson.JsonMapper.RegisterImporter((input) => input); + LitJson.JsonMapper.RegisterImporter((input) => (int)input); + LitJson.JsonMapper.RegisterImporter((input) => (int)(input + 0.5)); + LitJson.JsonMapper.RegisterImporter((input) => Convert.ToDateTime((string)input).ToUniversalTime()); + LitJson.JsonMapper.RegisterImporter((input) => (float)input); + LitJson.JsonMapper.RegisterImporter((input) => Convert.FromBase64String(input)); + } + + public T DecodeAs(string text) + { + return LitJson.JsonMapper.ToObject(text); + } + + public T DecodeAs(byte[] data) + { + throw new NotImplementedException(); + } + + public byte[] EncodeAsBinary(T value) + { + throw new NotImplementedException(); + } + + public string EncodeAsText(T value) + { + return LitJson.JsonMapper.ToJson(value); + } + + public object ConvertTo(Type toType, object obj) + { + string json = LitJson.JsonMapper.ToJson(obj); + return LitJson.JsonMapper.ToObject(toType, json); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/LitJsonEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/LitJsonEncoder.cs.meta new file mode 100644 index 00000000..2b1eb80f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/LitJsonEncoder.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: b5784b64da7c8ad47b441a9f2f27a33b +timeCreated: 1515401618 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/MessagePackProtocol.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/MessagePackProtocol.cs new file mode 100644 index 00000000..d02f1446 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/MessagePackProtocol.cs @@ -0,0 +1,92 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE + +using System; +using System.Collections.Generic; +using BestHTTP.SignalRCore.Messages; + +namespace BestHTTP.SignalRCore.Encoders +{ + public sealed class MessagePackEncoder : BestHTTP.SignalRCore.IEncoder + { + public string Name { get { return "messagepack"; } } + + public object ConvertTo(Type toType, object obj) + { + throw new NotImplementedException(); + } + + public T DecodeAs(string text) + { + throw new NotImplementedException(); + } + + public T DecodeAs(byte[] data) + { + throw new NotImplementedException(); + } + + public byte[] EncodeAsBinary(T value) + { + throw new NotImplementedException(); + } + + public string EncodeAsText(T value) + { + throw new NotImplementedException(); + } + } + + public sealed class MessagePackProtocol : BestHTTP.SignalRCore.IProtocol + { + public TransferModes Type { get { return TransferModes.Binary; } } + public IEncoder Encoder { get; private set; } + public HubConnection Connection { get; set; } + + public MessagePackProtocol() + { + this.Encoder = new MessagePackEncoder(); + } + + /// + /// Convert a value to the given type. + /// + public object ConvertTo(Type toType, object obj) + { + throw new NotImplementedException(); + } + + /// + /// This function must return the encoded representation of the given message. + /// + public byte[] EncodeMessage(Message message) + { + throw new NotImplementedException(); + } + + /// + /// This function must convert all element in the arguments array to the corresponding type from the argTypes array. + /// + public object[] GetRealArguments(Type[] argTypes, object[] arguments) + { + throw new NotImplementedException(); + } + + /// + /// This function must parse binary representation of the messages into the list of Messages. + /// + public void ParseMessages(string data, ref List messages) + { + throw new NotImplementedException(); + } + + /// + /// This function must parse textual representation of the messages into the list of Messages. + /// + public void ParseMessages(byte[] data, ref List messages) + { + throw new NotImplementedException(); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/MessagePackProtocol.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/MessagePackProtocol.cs.meta new file mode 100644 index 00000000..09c1627f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/Encoders/MessagePackProtocol.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1fe4434eade98e547aca1e026a4dbcc3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithAuthorization.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithAuthorization.cs new file mode 100644 index 00000000..07904c8d --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithAuthorization.cs @@ -0,0 +1,109 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE + +using BestHTTP.Examples; +using BestHTTP.SignalRCore; +using BestHTTP.SignalRCore.Encoders; +using System; +using UnityEngine; + +namespace BestHTTP.Examples +{ + /// + /// A sample to demonstrate Bearer token authorization on the server. The client will connect to the /redirect route + /// where it will receive the token and will receive the new url (/HubWithAuthorization) to connect to. + /// HubWithAuthorization without the token would throw an error. + /// + public sealed class HubWithAuthorizationSample : MonoBehaviour + { + // Server uri to connect to + readonly Uri URI = new Uri(GUIHelper.BaseURL + "/redirect"); + + // Instance of the HubConnection + HubConnection hub; + + Vector2 scrollPos; + string uiText; + + void Start() + { + // Server side of this example can be found here: + // https://github.com/Benedicht/BestHTTP_DemoSite/blob/master/BestHTTP_DemoSite/Hubs/ + + // Crete the HubConnection + hub = new HubConnection(URI, new JsonProtocol(new LitJsonEncoder())); + + // Subscribe to hub events + hub.OnConnected += Hub_OnConnected; + hub.OnError += Hub_OnError; + hub.OnClosed += Hub_OnClosed; + + hub.OnMessage += Hub_OnMessage; + + // And finally start to connect to the server + hub.StartConnect(); + + uiText = "StartConnect called\n"; + } + + void OnDestroy() + { + if (hub != null) + hub.StartClose(); + } + + // Draw the text stored in the 'uiText' field + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + scrollPos = GUILayout.BeginScrollView(scrollPos, false, false); + GUILayout.BeginVertical(); + + GUILayout.Label(uiText); + + GUILayout.EndVertical(); + GUILayout.EndScrollView(); + }); + } + + /// + /// This callback is called when the plugin is connected to the server successfully. Messages can be sent to the server after this point. + /// + private void Hub_OnConnected(HubConnection hub) + { + uiText += "Hub Connected\n"; + + // Call a parameterless function. We expect a string return value. + hub.Invoke("Echo", "Message from the client") + .OnSuccess(ret => uiText += string.Format(" 'Echo' returned: '{0}'\n", ret)); + } + + /// + /// This callback is called for every hub message. If false is returned, the plugin will cancel any further processing of the message. + /// + private bool Hub_OnMessage(HubConnection hub, BestHTTP.SignalRCore.Messages.Message message) + { + //uiText += string.Format("( Message received: {0} )\n", message.ToString()); + + return true; + } + + /// + /// This is called when the hub is closed after a StartClose() call. + /// + private void Hub_OnClosed(HubConnection hub) + { + uiText += "Hub Closed\n"; + } + + /// + /// Called when an unrecoverable error happen. After this event the hub will not send or receive any messages. + /// + private void Hub_OnError(HubConnection hub, string error) + { + uiText += "Hub Error: " + error + "\n"; + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithAuthorization.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithAuthorization.cs.meta new file mode 100644 index 00000000..7b72a106 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithAuthorization.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0d6f71c9108b3b419ee412fa4ddd018 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithPreAuthorizationSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithPreAuthorizationSample.cs new file mode 100644 index 00000000..ea0dfb83 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithPreAuthorizationSample.cs @@ -0,0 +1,224 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE + +using BestHTTP; +using BestHTTP.SignalRCore; +using BestHTTP.SignalRCore.Encoders; +using System; +using UnityEngine; + +namespace BestHTTP.Examples +{ + public sealed class HubWithPreAuthorizationSample : MonoBehaviour + { + // Server uri to connect to + readonly Uri URI = new Uri(GUIHelper.BaseURL + "/HubWithAuthorization"); + readonly Uri AuthURI = new Uri(GUIHelper.BaseURL + "/generateJwtToken"); + + // Instance of the HubConnection + HubConnection hub; + + Vector2 scrollPos; + string uiText; + + void Start() + { + // Server side of this example can be found here: + // https://github.com/Benedicht/BestHTTP_DemoSite/blob/master/BestHTTP_DemoSite/Hubs/ + + // Crete the HubConnection + hub = new HubConnection(URI, new JsonProtocol(new LitJsonEncoder())); + hub.AuthenticationProvider = new PreAuthAccessTokenAuthenticator(AuthURI); + hub.AuthenticationProvider.OnAuthenticationSucceded += AuthenticationProvider_OnAuthenticationSucceded; + hub.AuthenticationProvider.OnAuthenticationFailed += AuthenticationProvider_OnAuthenticationFailed; + + // Subscribe to hub events + hub.OnConnected += Hub_OnConnected; + hub.OnError += Hub_OnError; + hub.OnClosed += Hub_OnClosed; + + hub.OnMessage += Hub_OnMessage; + + // And finally start to connect to the server + hub.StartConnect(); + + uiText = "StartConnect called\n"; + } + + private void AuthenticationProvider_OnAuthenticationSucceded(IAuthenticationProvider provider) + { + string str = string.Format("Pre-Authentication Succeded! Token: '{0}' \n", (hub.AuthenticationProvider as PreAuthAccessTokenAuthenticator).Token); + Debug.Log(str); + uiText += str; + } + + private void AuthenticationProvider_OnAuthenticationFailed(IAuthenticationProvider provider, string reason) + { + uiText += string.Format("Authentication Failed! Reason: '{0}'\n", reason); + } + + void OnDestroy() + { + if (hub != null) + hub.StartClose(); + } + + // Draw the text stored in the 'uiText' field + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + scrollPos = GUILayout.BeginScrollView(scrollPos, false, false); + GUILayout.BeginVertical(); + + GUILayout.Label(uiText); + + GUILayout.EndVertical(); + GUILayout.EndScrollView(); + }); + } + + /// + /// This callback is called when the plugin is connected to the server successfully. Messages can be sent to the server after this point. + /// + private void Hub_OnConnected(HubConnection hub) + { + uiText += "Hub Connected\n"; + + // Call a parameterless function. We expect a string return value. + hub.Invoke("Echo", "Message from the client") + .OnSuccess(ret => uiText += string.Format(" 'Echo' returned: '{0}'\n", ret)); + } + + /// + /// This callback is called for every hub message. If false is returned, the plugin will cancel any further processing of the message. + /// + private bool Hub_OnMessage(HubConnection hub, BestHTTP.SignalRCore.Messages.Message message) + { + //uiText += string.Format("( Message received: {0} )\n", message.ToString()); + + return true; + } + + /// + /// This is called when the hub is closed after a StartClose() call. + /// + private void Hub_OnClosed(HubConnection hub) + { + uiText += "Hub Closed\n"; + } + + /// + /// Called when an unrecoverable error happen. After this event the hub will not send or receive any messages. + /// + private void Hub_OnError(HubConnection hub, string error) + { + uiText += "Hub Error: " + error + "\n"; + } + } + + public sealed class PreAuthAccessTokenAuthenticator : IAuthenticationProvider + { + /// + /// No pre-auth step required for this type of authentication + /// + public bool IsPreAuthRequired { get { return true; } } + +#pragma warning disable 0067 + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationSuccededDelegate OnAuthenticationSucceded; + + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationFailedDelegate OnAuthenticationFailed; + +#pragma warning restore 0067 + + private Uri authenticationUri; + + public string Token { get; private set; } + + public PreAuthAccessTokenAuthenticator(Uri authUri) + { + this.authenticationUri = authUri; + } + + public void StartAuthentication() + { + var request = new HTTPRequest(this.authenticationUri, OnAuthenticationRequestFinished); + request.Send(); + } + + private void OnAuthenticationRequestFinished(HTTPRequest req, HTTPResponse resp) + { + switch (req.State) + { + // The request finished without any problem. + case HTTPRequestStates.Finished: + if (resp.IsSuccess) + { + this.Token = resp.DataAsText; + if (this.OnAuthenticationSucceded != null) + this.OnAuthenticationSucceded(this); + } + else // Internal server error? + AuthenticationFailed(string.Format("Request Finished Successfully, but the server sent an error. Status Code: {0}-{1} Message: {2}", + resp.StatusCode, + resp.Message, + resp.DataAsText)); + break; + + // The request finished with an unexpected error. The request's Exception property may contain more info about the error. + case HTTPRequestStates.Error: + AuthenticationFailed("Request Finished with Error! " + (req.Exception != null ? (req.Exception.Message + "\n" + req.Exception.StackTrace) : "No Exception")); + break; + + // The request aborted, initiated by the user. + case HTTPRequestStates.Aborted: + AuthenticationFailed("Request Aborted!"); + break; + + // Connecting to the server is timed out. + case HTTPRequestStates.ConnectionTimedOut: + AuthenticationFailed("Connection Timed Out!"); + break; + + // The request didn't finished in the given time. + case HTTPRequestStates.TimedOut: + AuthenticationFailed("Processing the request Timed Out!"); + break; + } + } + + private void AuthenticationFailed(string reason) + { + if (this.OnAuthenticationFailed != null) + this.OnAuthenticationFailed(this, reason); + } + + /// + /// Prepares the request by adding two headers to it + /// + public void PrepareRequest(BestHTTP.HTTPRequest request) + { + if (HTTPProtocolFactory.GetProtocolFromUri(request.CurrentUri) == SupportedProtocols.HTTP) + request.Uri = PrepareUri(request.Uri); + } + + public Uri PrepareUri(Uri uri) + { + if (!string.IsNullOrEmpty(this.Token)) + { + string query = string.IsNullOrEmpty(uri.Query) ? "?" : uri.Query + "&"; + UriBuilder uriBuilder = new UriBuilder(uri.Scheme, uri.Host, uri.Port, uri.AbsolutePath, query + "access_token=" + this.Token); + return uriBuilder.Uri; + } + else + return uri; + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithPreAuthorizationSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithPreAuthorizationSample.cs.meta new file mode 100644 index 00000000..857e393f --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/HubWithPreAuthorizationSample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bfb23ec912f317944b34485c85ab6b31 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/RedirectSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/RedirectSample.cs new file mode 100644 index 00000000..64e3c3b4 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/RedirectSample.cs @@ -0,0 +1,175 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE + +using BestHTTP; +using BestHTTP.SignalRCore; +using BestHTTP.SignalRCore.Encoders; +using System; +using UnityEngine; + +namespace BestHTTP.Examples +{ + /// + /// This sample demonstrates redirection capabilities. The server will redirect a few times the client before + /// routing it to the final endpoint. + /// + public sealed class RedirectSample : MonoBehaviour + { + // Server uri to connect to + readonly Uri URI = new Uri(GUIHelper.BaseURL + "/redirect_sample"); + + // Instance of the HubConnection + public HubConnection hub; + + Vector2 scrollPos; + public string uiText; + + void Start() + { + // Server side of this example can be found here: + // https://github.com/Benedicht/BestHTTP_DemoSite/blob/master/BestHTTP_DemoSite/Hubs/ + + // Crete the HubConnection + hub = new HubConnection(URI, new JsonProtocol(new LitJsonEncoder())); + hub.AuthenticationProvider = new RedirectLoggerAccessTokenAuthenticator(hub); + + // Subscribe to hub events + hub.OnConnected += Hub_OnConnected; + hub.OnError += Hub_OnError; + hub.OnClosed += Hub_OnClosed; + + hub.OnMessage += Hub_OnMessage; + + hub.OnRedirected += Hub_Redirected; + + // And finally start to connect to the server + hub.StartConnect(); + + uiText = "StartConnect called\n"; + } + + void OnDestroy() + { + if (hub != null) + { + hub.StartClose(); + } + } + + // Draw the text stored in the 'uiText' field + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + scrollPos = GUILayout.BeginScrollView(scrollPos, false, false); + GUILayout.BeginVertical(); + + GUILayout.Label(uiText); + + GUILayout.EndVertical(); + GUILayout.EndScrollView(); + }); + } + + private void Hub_Redirected(HubConnection hub, Uri oldUri, Uri newUri) + { + uiText += string.Format("Hub connection redirected to '{0}'!\n", hub.Uri); + } + + /// + /// This callback is called when the plugin is connected to the server successfully. Messages can be sent to the server after this point. + /// + private void Hub_OnConnected(HubConnection hub) + { + uiText += "Hub Connected\n"; + + // Call a parameterless function. We expect a string return value. + hub.Invoke("Echo", "Message from the client") + .OnSuccess(ret => uiText += string.Format(" 'Echo' returned: '{0}'\n", ret)); + } + + /// + /// This callback is called for every hub message. If false is returned, the plugin will cancel any further processing of the message. + /// + private bool Hub_OnMessage(HubConnection hub, BestHTTP.SignalRCore.Messages.Message message) + { + //uiText += string.Format("( Message received: {0} )\n", message.ToString()); + + return true; + } + + /// + /// This is called when the hub is closed after a StartClose() call. + /// + private void Hub_OnClosed(HubConnection hub) + { + uiText += "Hub Closed\n"; + } + + /// + /// Called when an unrecoverable error happen. After this event the hub will not send or receive any messages. + /// + private void Hub_OnError(HubConnection hub, string error) + { + uiText += "Hub Error: " + error + "\n"; + } + } + + public sealed class RedirectLoggerAccessTokenAuthenticator : IAuthenticationProvider + { + /// + /// No pre-auth step required for this type of authentication + /// + public bool IsPreAuthRequired { get { return false; } } + +#pragma warning disable 0067 + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationSuccededDelegate OnAuthenticationSucceded; + + /// + /// Not used event as IsPreAuthRequired is false + /// + public event OnAuthenticationFailedDelegate OnAuthenticationFailed; + +#pragma warning restore 0067 + + private HubConnection _connection; + + public RedirectLoggerAccessTokenAuthenticator(HubConnection connection) + { + this._connection = connection; + } + + /// + /// Not used as IsPreAuthRequired is false + /// + public void StartAuthentication() + { } + + /// + /// Prepares the request by adding two headers to it + /// + public void PrepareRequest(BestHTTP.HTTPRequest request) + { + request.SetHeader("x-redirect-count", _connection.RedirectCount.ToString()); + + if (HTTPProtocolFactory.GetProtocolFromUri(request.CurrentUri) == SupportedProtocols.HTTP) + request.Uri = PrepareUri(request.Uri); + } + + public Uri PrepareUri(Uri uri) + { + if (this._connection.NegotiationResult != null && !string.IsNullOrEmpty(this._connection.NegotiationResult.AccessToken)) + { + string query = string.IsNullOrEmpty(uri.Query) ? "?" : uri.Query + "&"; + UriBuilder uriBuilder = new UriBuilder(uri.Scheme, uri.Host, uri.Port, uri.AbsolutePath, query + "access_token=" + this._connection.NegotiationResult.AccessToken); + return uriBuilder.Uri; + } + else + return uri; + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/RedirectSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/RedirectSample.cs.meta new file mode 100644 index 00000000..87b70da6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/RedirectSample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: febf35a5598c76843a7573e8f650079e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/TestHubExample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/TestHubExample.cs new file mode 100644 index 00000000..dec96627 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/TestHubExample.cs @@ -0,0 +1,174 @@ +#if !BESTHTTP_DISABLE_SIGNALR_CORE + +using System; +using UnityEngine; +using BestHTTP.SignalRCore; +using BestHTTP.SignalRCore.Encoders; + +namespace BestHTTP.Examples +{ + public class TestHubExample : MonoBehaviour + { + // Server uri to connect to + readonly Uri URI = new Uri(GUIHelper.BaseURL + "/TestHub"); + + // Instance of the HubConnection + HubConnection hub; + + Vector2 scrollPos; + string uiText; + + void Start() + { + // Server side of this example can be found here: + // https://github.com/Benedicht/BestHTTP_DemoSite/blob/master/BestHTTP_DemoSite/Hubs/TestHub.cs + + // Set up optional options + HubOptions options = new HubOptions(); + options.SkipNegotiation = false; + + // Crete the HubConnection + hub = new HubConnection(URI, new JsonProtocol(new LitJsonEncoder()), options); + + // Optionally add an authenticator + //hub.AuthenticationProvider = new BestHTTP.SignalRCore.Authentication.HeaderAuthenticator(""); + + // Subscribe to hub events + hub.OnConnected += Hub_OnConnected; + hub.OnError += Hub_OnError; + hub.OnClosed += Hub_OnClosed; + + hub.OnMessage += Hub_OnMessage; + + // Set up server callable functions + hub.On("Send", (string arg) => uiText += string.Format(" On Send: {0}\n", arg)); + hub.On("Person", (person) => uiText += string.Format(" On Person: {0}\n", person)); + hub.On("TwoPersons", (person1, person2) => uiText += string.Format(" On TwoPersons: {0}, {1}\n", person1, person2)); + + // And finally start to connect to the server + hub.StartConnect(); + + uiText = "StartConnect called\n"; + } + + void OnDestroy() + { + if (hub != null) + hub.StartClose(); + } + + // Draw the text stored in the 'uiText' field + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + scrollPos = GUILayout.BeginScrollView(scrollPos, false, false); + GUILayout.BeginVertical(); + + GUILayout.Label(uiText); + + GUILayout.EndVertical(); + GUILayout.EndScrollView(); + }); + + } + + /// + /// This callback is called when the plugin is connected to the server successfully. Messages can be sent to the server after this point. + /// + private void Hub_OnConnected(HubConnection hub) + { + uiText += "Hub Connected\n"; + + // Call a server function with a string param. We expect no return value. + hub.Send("Send", "my message"); + + // Call a parameterless function. We expect a string return value. + hub.Invoke("NoParam") + .OnSuccess(ret => uiText += string.Format(" 'NoParam' returned: {0}\n", ret)); + + // Call a function on the server to add two numbers. OnSuccess will be called with the result and OnError if there's an error. + hub.Invoke("Add", 10, 20) + .OnSuccess(result => uiText += string.Format(" 'Add(10, 20)' returned: {0}\n", result)) + .OnError(error => uiText += string.Format(" 'Add(10, 20)' error: {0}\n", error)); + + // Call a function that will return a Person object constructed from the function's parameters. + hub.Invoke("GetPerson", "Mr. Smith", 26) + .OnSuccess(result => uiText += string.Format(" 'GetPerson(\"Mr. Smith\", 26)' returned: {0}\n", result)) + .OnError(error => uiText += string.Format(" 'GetPerson(\"Mr. Smith\", 26)' error: {0}\n", error)); + + // To test errors/exceptions this call always throws an exception on the server side resulting in an OnError call. + // OnError expected here! + hub.Invoke("SingleResultFailure", 10, 20) + .OnSuccess(result => uiText += string.Format(" 'SingleResultFailure(10, 20)' returned: {0}\n", result)) + .OnError(error => uiText += string.Format(" 'SingleResultFailure(10, 20)' error: {0}\n", error)); + + // This call demonstrates IEnumerable<> functions, result will be the yielded numbers. + hub.Invoke("Batched", 10) + .OnSuccess(result => uiText += string.Format(" 'Batched(10)' returned items: {0}\n", result.Length)) + .OnError(error => uiText += string.Format(" 'Batched(10)' error: {0}\n", error)); + + // OnItem is called for a streaming request for every items returned by the server. OnSuccess will still be called with all the items. + hub.Stream("ObservableCounter", 10, 1000) + .OnItem(result => uiText += string.Format(" 'ObservableCounter(10, 1000)' OnItem: {0}\n", result.LastAdded)) + .OnSuccess(result => uiText += string.Format(" 'ObservableCounter(10, 1000)' OnSuccess. Final count: {0}\n", result.Items.Count)) + .OnError(error => uiText += string.Format(" 'ObservableCounter(10, 1000)' error: {0}\n", error)); + + // A stream request can be cancelled any time. + var container = hub.Stream("ChannelCounter", 10, 1000) + .OnItem(result => uiText += string.Format(" 'ChannelCounter(10, 1000)' OnItem: {0}\n", result.LastAdded)) + .OnSuccess(result => uiText += string.Format(" 'ChannelCounter(10, 1000)' OnSuccess. Final count: {0}\n", result.Items.Count)) + .OnError(error => uiText += string.Format(" 'ChannelCounter(10, 1000)' error: {0}\n", error)).value; + + // a stream can be cancelled by calling CancelStream + hub.CancelStream(container); + + // This call will stream strongly typed objects + hub.Stream("GetRandomPersons", 20, 2000) + .OnItem(result => uiText += string.Format(" 'GetRandomPersons(20, 1000)' OnItem: {0}\n", result.LastAdded)) + .OnSuccess(result => uiText += string.Format(" 'GetRandomPersons(20, 1000)' OnSuccess. Final count: {0}\n", result.Items.Count)); + } + + /// + /// This callback is called for every hub message. If false is returned, the plugin will cancel any further processing of the message. + /// + private bool Hub_OnMessage(HubConnection hub, BestHTTP.SignalRCore.Messages.Message message) + { + //UnityEngine.Debug.Log("Message Arrived: " + message.ToString()); + + return true; + } + + /// + /// This is called when the hub is closed after a StartClose() call. + /// + private void Hub_OnClosed(HubConnection hub) + { + uiText += "Hub Closed\n"; + } + + /// + /// Called when an unrecoverable error happen. After this event the hub will not send or receive any messages. + /// + private void Hub_OnError(HubConnection hub, string error) + { + uiText += "Hub Error: " + error + "\n"; + } + + /// + /// Helper class to demonstrate strongly typed callbacks + /// + sealed class Person + { + public string Name { get; set; } + public long Age { get; set; } + + public override string ToString() + { + return string.Format("[Person Name: '{0}', Age: {1}]", this.Name, this.Age.ToString()); + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/TestHubExample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/TestHubExample.cs.meta new file mode 100644 index 00000000..9294af23 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SignalRCore/TestHubExample.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6bd28a72bf1727542937e09ab435abcc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO.meta new file mode 100644 index 00000000..b0126f65 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6d952d96253d7454992111c6a4116837 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders.meta new file mode 100644 index 00000000..fee3b7a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 745fcd55afb34e4429897e798738aebd +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/JsonDotNetEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/JsonDotNetEncoder.cs new file mode 100644 index 00000000..ca7b45bc --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/JsonDotNetEncoder.cs @@ -0,0 +1,27 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; +using System.Collections.Generic; + +namespace BestHTTP.SocketIO.JsonEncoders +{ + /*using Newtonsoft.Json; + + /// + /// This class uses Newtonsoft's Json encoder (JSON .NET For Unity - http://u3d.as/5q2). + /// + public sealed class JsonDotNetEncoder : IJsonEncoder + { + public List Decode(string json) + { + return JsonConvert.DeserializeObject>(json); + } + + public string Encode(List obj) + { + return JsonConvert.SerializeObject(obj); + } + }*/ +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/JsonDotNetEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/JsonDotNetEncoder.cs.meta new file mode 100644 index 00000000..beac1f27 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/JsonDotNetEncoder.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c2d9c71662df0b641980b51cd68443fa +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/LitJsonEncoder.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/LitJsonEncoder.cs new file mode 100644 index 00000000..b57feb86 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/LitJsonEncoder.cs @@ -0,0 +1,30 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System.Collections.Generic; + +using LitJson; + +namespace BestHTTP.SocketIO.JsonEncoders +{ + /// + /// This IJsonEncoder implementation uses the LitJson library located in the Examples\LitJson directory. + /// + public sealed class LitJsonEncoder : IJsonEncoder + { + public List Decode(string json) + { + JsonReader reader = new JsonReader(json); + return JsonMapper.ToObject>(reader); + } + + public string Encode(List obj) + { + JsonWriter writer = new JsonWriter(); + JsonMapper.ToJson(obj, writer); + + return writer.ToString(); + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/LitJsonEncoder.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/LitJsonEncoder.cs.meta new file mode 100644 index 00000000..b79cb9ca --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIO Json Encoders/LitJsonEncoder.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 0329bd6a6be04394b9da7576fc41d1dc +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOChatSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOChatSample.cs new file mode 100644 index 00000000..470614c5 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOChatSample.cs @@ -0,0 +1,321 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; +using System.Collections.Generic; + +using UnityEngine; +using BestHTTP.SocketIO; + +namespace BestHTTP.Examples +{ + public sealed class SocketIOChatSample : MonoBehaviour + { + private readonly TimeSpan TYPING_TIMER_LENGTH = TimeSpan.FromMilliseconds(700); + + private enum ChatStates + { + Login, + Chat + } + + #region Fields + + /// + /// The Socket.IO manager instance. + /// + private SocketManager Manager; + + /// + /// Current state of the chat demo. + /// + private ChatStates State; + + /// + /// The selected nickname + /// + private string userName = string.Empty; + + /// + /// Currently typing message + /// + private string message = string.Empty; + + /// + /// Sent and received messages. + /// + private string chatLog = string.Empty; + + /// + /// Position of the scroller + /// + private Vector2 scrollPos; + + /// + /// True if the user is currently typing + /// + private bool typing; + + /// + /// When the message changed. + /// + private DateTime lastTypingTime = DateTime.MinValue; + + /// + /// Users that typing. + /// + private List typingUsers = new List(); + + #endregion + + #region Unity Events + + void Start() + { + // The current state is Login + State = ChatStates.Login; + + // Change an option to show how it should be done + SocketOptions options = new SocketOptions(); + options.AutoConnect = false; + options.ConnectWith = BestHTTP.SocketIO.Transports.TransportTypes.WebSocket; + + // Create the Socket.IO manager + Manager = new SocketManager(new Uri("https://socket-io-chat.now.sh/socket.io/"), options); + + // Set up custom chat events + Manager.Socket.On("login", OnLogin); + Manager.Socket.On("new message", OnNewMessage); + Manager.Socket.On("user joined", OnUserJoined); + Manager.Socket.On("user left", OnUserLeft); + Manager.Socket.On("typing", OnTyping); + Manager.Socket.On("stop typing", OnStopTyping); + + // The argument will be an Error object. + Manager.Socket.On(SocketIOEventTypes.Error, (socket, packet, args) => Debug.LogError(string.Format("Error: {0}", args[0].ToString()))); + // We set SocketOptions' AutoConnect to false, so we have to call it manually. + Manager.Open(); + } + + void OnDestroy() + { + // Leaving this sample, close the socket + Manager.Close(); + } + + void Update() + { + // Go back to the demo selector + if (Input.GetKeyDown(KeyCode.Escape)) + SampleSelector.SelectedSample.DestroyUnityObject(); + + // Stop typing if some time passed without typing + if (typing) + { + var typingTimer = DateTime.UtcNow; + var timeDiff = typingTimer - lastTypingTime; + if (timeDiff >= TYPING_TIMER_LENGTH) + { + Manager.Socket.Emit("stop typing"); + typing = false; + } + } + } + + void OnGUI() + { + switch (State) + { + case ChatStates.Login: DrawLoginScreen(); break; + case ChatStates.Chat: DrawChatScreen(); break; + } + } + + #endregion + + #region Chat Logic + + /// + /// Called from an OnGUI event to draw the Login Screen. + /// + void DrawLoginScreen() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + GUILayout.BeginVertical(); + GUILayout.FlexibleSpace(); + + GUIHelper.DrawCenteredText("What's your nickname?"); + userName = GUILayout.TextField(userName); + + if (GUILayout.Button("Join")) + SetUserName(); + + GUILayout.FlexibleSpace(); + GUILayout.EndVertical(); + }); + } + + /// + /// Called from an OnGUI event to draw the Chat Screen. + /// + void DrawChatScreen() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + GUILayout.BeginVertical(); + scrollPos = GUILayout.BeginScrollView(scrollPos); + GUILayout.Label(chatLog, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); + GUILayout.EndScrollView(); + + string typing = string.Empty; + + if (typingUsers.Count > 0) + { + typing += string.Format("{0}", typingUsers[0]); + + for (int i = 1; i < typingUsers.Count; ++i) + typing += string.Format(", {0}", typingUsers[i]); + + if (typingUsers.Count == 1) + typing += " is typing!"; + else + typing += " are typing!"; + } + + GUILayout.Label(typing); + + GUILayout.Label("Type here:"); + + GUILayout.BeginHorizontal(); + message = GUILayout.TextField(message); + + if (GUILayout.Button("Send", GUILayout.MaxWidth(100))) + SendMessage(); + GUILayout.EndHorizontal(); + + if (GUI.changed) + UpdateTyping(); + + GUILayout.EndVertical(); + }); + } + + void SetUserName() + { + if (string.IsNullOrEmpty(userName)) + return; + + State = ChatStates.Chat; + + Manager.Socket.Emit("add user", userName); + } + + void SendMessage() + { + if (string.IsNullOrEmpty(message)) + return; + + Manager.Socket.Emit("new message", message); + + chatLog += string.Format("{0}: {1}\n", userName, message); + message = string.Empty; + } + + void UpdateTyping() + { + if (!typing) + { + typing = true; + Manager.Socket.Emit("typing"); + } + + lastTypingTime = DateTime.UtcNow; + } + + void addParticipantsMessage(Dictionary data) + { + int numUsers = Convert.ToInt32(data["numUsers"]); + + if (numUsers == 1) + chatLog += "there's 1 participant\n"; + else + chatLog += "there are " + numUsers + " participants\n"; + } + + void addChatMessage(Dictionary data) + { + var username = data["username"] as string; + var msg = data["message"] as string; + + chatLog += string.Format("{0}: {1}\n", username, msg); + } + + void AddChatTyping(Dictionary data) + { + var username = data["username"] as string; + + typingUsers.Add(username); + } + + void RemoveChatTyping(Dictionary data) + { + var username = data["username"] as string; + + int idx = typingUsers.FindIndex((name) => name.Equals(username)); + if (idx != -1) + typingUsers.RemoveAt(idx); + } + + #endregion + + #region Custom SocketIO Events + + void OnLogin(Socket socket, Packet packet, params object[] args) + { + chatLog = "Welcome to Socket.IO Chat — \n"; + + addParticipantsMessage(args[0] as Dictionary); + } + + void OnNewMessage(Socket socket, Packet packet, params object[] args) + { + addChatMessage(args[0] as Dictionary); + } + + void OnUserJoined(Socket socket, Packet packet, params object[] args) + { + var data = args[0] as Dictionary; + + var username = data["username"] as string; + + chatLog += string.Format("{0} joined\n", username); + + addParticipantsMessage(data); + } + + void OnUserLeft(Socket socket, Packet packet, params object[] args) + { + var data = args[0] as Dictionary; + + var username = data["username"] as string; + + chatLog += string.Format("{0} left\n", username); + + addParticipantsMessage(data); + } + + void OnTyping(Socket socket, Packet packet, params object[] args) + { + AddChatTyping(args[0] as Dictionary); + } + + void OnStopTyping(Socket socket, Packet packet, params object[] args) + { + RemoveChatTyping(args[0] as Dictionary); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOChatSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOChatSample.cs.meta new file mode 100644 index 00000000..c66b9434 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOChatSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: feaffc82c9b6aa54ba0e8bf6572d279e +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOWePlaySample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOWePlaySample.cs new file mode 100644 index 00000000..871fee50 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOWePlaySample.cs @@ -0,0 +1,394 @@ +#if !BESTHTTP_DISABLE_SOCKETIO + +using System; +using System.Collections.Generic; + +using UnityEngine; +using BestHTTP.SocketIO; + +namespace BestHTTP.Examples +{ + public sealed class SocketIOWePlaySample : MonoBehaviour + { + /// + /// Possible states of the game. + /// + enum States + { + Connecting, + WaitForNick, + Joined + } + + /// + /// Controls that the server understands as a parameter in the move event. + /// + private string[] controls = new string[] { "left", "right", "a", "b", "up", "down", "select", "start" }; + + /// + /// Ratio of the drawn GUI texture from the screen + /// + private const float ratio = 1.5f; + + /// + /// How many messages to keep. + /// + private int MaxMessages = 50; + + /// + /// Current state of the game. + /// + private States State; + + /// + /// The root("/") Socket instance. + /// + private Socket Socket; + + /// + /// The user-selected nickname. + /// + private string Nick = string.Empty; + + /// + /// The message that the user want to send to the chat. + /// + private string messageToSend = string.Empty; + + /// + /// How many user connected to the server. + /// + private int connections; + + /// + /// Local and server sent messages. + /// + private List messages = new List(); + + /// + /// The chat scroll position. + /// + private Vector2 scrollPos; + + /// + /// The decoded texture from the server sent binary data + /// + private Texture2D FrameTexture; + + #region Unity Events + + void Start() + { + // Change an option to show how it should be done + SocketOptions options = new SocketOptions(); + options.AutoConnect = false; + + // Create the SocketManager instance + var manager = new SocketManager(new Uri("http://io.weplay.io/socket.io/"), options); + + // Keep a reference to the root namespace + Socket = manager.Socket; + + // Set up our event handlers. + Socket.On(SocketIOEventTypes.Connect, OnConnected); + Socket.On("joined", OnJoined); + Socket.On("connections", OnConnections); + Socket.On("join", OnJoin); + Socket.On("move", OnMove); + Socket.On("message", OnMessage); + Socket.On("reload", OnReload); + + // Don't waste cpu cycles on decoding the payload, we are expecting only binary data with this event, + // and we can access it through the packet's Attachments property. + Socket.On("frame", OnFrame, /*autoDecodePayload:*/ false); + + // Add error handler, so we can display it + Socket.On(SocketIOEventTypes.Error, OnError); + + // We set SocketOptions' AutoConnect to false, so we have to call it manually. + manager.Open(); + + // We are connecting to the server. + State = States.Connecting; + } + + void OnDestroy() + { + // Leaving this sample, close the socket + Socket.Manager.Close(); + } + + void Update() + { + // Go back to the demo selector + if (Input.GetKeyDown(KeyCode.Escape)) + SampleSelector.SelectedSample.DestroyUnityObject(); + } + + void OnGUI() + { + switch (State) + { + case States.Connecting: + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + GUILayout.BeginVertical(); + GUILayout.FlexibleSpace(); + GUIHelper.DrawCenteredText("Connecting to the server..."); + GUILayout.FlexibleSpace(); + GUILayout.EndVertical(); + }); + break; + + case States.WaitForNick: + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + DrawLoginScreen(); + }); + break; + + case States.Joined: + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + // Draw Texture + if (FrameTexture != null) + GUILayout.Box(FrameTexture); + + DrawControls(); + DrawChat(); + }); + break; + } + } + + #endregion + + #region Helper Functions + + /// + /// Called from an OnGUI event to draw the Login Screen. + /// + void DrawLoginScreen() + { + GUILayout.BeginVertical(); + GUILayout.FlexibleSpace(); + + GUIHelper.DrawCenteredText("What's your nickname?"); + + Nick = GUILayout.TextField(Nick); + + if (GUILayout.Button("Join")) + Join(); + + GUILayout.FlexibleSpace(); + GUILayout.EndVertical(); + } + + void DrawControls() + { + GUILayout.BeginHorizontal(); + GUILayout.Label("Controls:"); + + for (int i = 0; i < controls.Length; ++i) + if (GUILayout.Button(controls[i])) + Socket.Emit("move", controls[i]); + + GUILayout.Label(" Connections: " + connections); + + GUILayout.EndHorizontal(); + } + + void DrawChat(bool withInput = true) + { + GUILayout.BeginVertical(); + + // Draw the messages + scrollPos = GUILayout.BeginScrollView(scrollPos, false, false); + for (int i = 0; i < messages.Count; ++i) + GUILayout.Label(messages[i], GUILayout.MinWidth(Screen.width)); + GUILayout.EndScrollView(); + + if (withInput) + { + GUILayout.Label("Your message: "); + + GUILayout.BeginHorizontal(); + + messageToSend = GUILayout.TextField(messageToSend); + + if (GUILayout.Button("Send", GUILayout.MaxWidth(100))) + SendMessage(); + + GUILayout.EndHorizontal(); + } + + GUILayout.EndVertical(); + } + + /// + /// Add a message to the message log + /// + /// + void AddMessage(string msg) + { + messages.Insert(0, msg); + if (messages.Count > MaxMessages) + messages.RemoveRange(MaxMessages, messages.Count - MaxMessages); + } + + /// + /// Send a chat message. The message must be in the messageToSend field. + /// + void SendMessage() + { + if (string.IsNullOrEmpty(messageToSend)) + return; + + Socket.Emit("message", messageToSend); + AddMessage(string.Format("{0}: {1}", Nick, messageToSend)); + messageToSend = string.Empty; + } + + /// + /// Join to the game with the nickname stored in the Nick field. + /// + void Join() + { + PlayerPrefs.SetString("Nick", Nick); + + Socket.Emit("join", Nick); + } + + /// + /// Reload the game. + /// + void Reload() + { + FrameTexture = null; + + if (Socket != null) + { + Socket.Manager.Close(); + Socket = null; + + Start(); + } + } + + #endregion + + #region SocketIO Events + + /// + /// Socket connected event. + /// + private void OnConnected(Socket socket, Packet packet, params object[] args) + { + if (PlayerPrefs.HasKey("Nick")) + { + Nick = PlayerPrefs.GetString("Nick", "NickName"); + Join(); + } + else + State = States.WaitForNick; + + AddMessage("connected"); + } + + /// + /// Local player joined after sending a 'join' event + /// + private void OnJoined(Socket socket, Packet packet, params object[] args) + { + State = States.Joined; + } + + /// + /// Server sent us a 'reload' event. + /// + private void OnReload(Socket socket, Packet packet, params object[] args) + { + Reload(); + } + + /// + /// Someone wrote a message to the chat. + /// + private void OnMessage(Socket socket, Packet packet, params object[] args) + { + if (args.Length == 1) + AddMessage(args[0] as string); + else + AddMessage(string.Format("{0}: {1}", args[1], args[0])); + } + + /// + /// Someone (including us) pressed a button. + /// + private void OnMove(Socket socket, Packet packet, params object[] args) + { + AddMessage(string.Format("{0} pressed {1}", args[1], args[0])); + } + + /// + /// Someone joined to the game + /// + private void OnJoin(Socket socket, Packet packet, params object[] args) + { + string loc = args.Length > 1 ? string.Format("({0})", args[1]) : string.Empty; + + AddMessage(string.Format("{0} joined {1}", args[0], loc)); + } + + /// + /// How many players are connected to the game. + /// + private void OnConnections(Socket socket, Packet packet, params object[] args) + { + connections = Convert.ToInt32(args[0]); + } + + /// + /// The server sent us a new picture to draw the game. + /// + private void OnFrame(Socket socket, Packet packet, params object[] args) + { + if (State != States.Joined) + return; + + if (FrameTexture == null) + { + FrameTexture = new Texture2D(0, 0, TextureFormat.RGBA32, false); + FrameTexture.filterMode = FilterMode.Point; + } + + // Binary data usage case 1 - using directly the Attachments property: + byte[] data = packet.Attachments[0]; + + // Binary data usage case 2 - using the packet's ReconstructAttachmentAsIndex() function + /*packet.ReconstructAttachmentAsIndex(); + args = packet.Decode(socket.Manager.Encoder); + data = packet.Attachments[Convert.ToInt32(args[0])];*/ + + // Binary data usage case 3 - using the packet's ReconstructAttachmentAsBase64() function + /*packet.ReconstructAttachmentAsBase64(); + args = packet.Decode(socket.Manager.Encoder); + data = Convert.FromBase64String(args[0] as string);*/ + + // Load the server sent picture + FrameTexture.LoadImage(data); + } + + /// + /// Called on local or remote error. + /// + private void OnError(Socket socket, Packet packet, params object[] args) + { + AddMessage(string.Format("--ERROR - {0}", args[0].ToString())); + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOWePlaySample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOWePlaySample.cs.meta new file mode 100644 index 00000000..5e82fa37 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/SocketIO/SocketIOWePlaySample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3ce53a6e4419d8f429db4a753d71a0c2 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket.meta new file mode 100644 index 00000000..40fe3839 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3f80c43b87778214daf5495f2854dfe0 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket/WebSocketSample.cs b/JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket/WebSocketSample.cs new file mode 100644 index 00000000..82bd57dd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket/WebSocketSample.cs @@ -0,0 +1,169 @@ +#if !BESTHTTP_DISABLE_WEBSOCKET + +using System; + +using UnityEngine; + +namespace BestHTTP.Examples +{ + public class WebSocketSample : MonoBehaviour + { + #region Private Fields + + /// + /// The WebSocket address to connect + /// + string address = "wss://echo.websocket.org"; + + /// + /// Default text to send + /// + string msgToSend = "Hello World!"; + + /// + /// Debug text to draw on the gui + /// + string Text = string.Empty; + + /// + /// Saved WebSocket instance + /// + WebSocket.WebSocket webSocket; + + /// + /// GUI scroll position + /// + Vector2 scrollPos; + + #endregion + + #region Unity Events + + void OnDestroy() + { + if (webSocket != null) + { + webSocket.Close(); + } + } + + void OnGUI() + { + GUIHelper.DrawArea(GUIHelper.ClientArea, true, () => + { + scrollPos = GUILayout.BeginScrollView(scrollPos); + GUILayout.Label(Text); + GUILayout.EndScrollView(); + + GUILayout.Space(5); + + GUILayout.FlexibleSpace(); + + address = GUILayout.TextField(address); + + if (webSocket == null && GUILayout.Button("Open Web Socket")) + { + // Create the WebSocket instance + webSocket = new WebSocket.WebSocket(new Uri(address)); + +#if !UNITY_WEBGL + webSocket.StartPingThread = true; + +#if !BESTHTTP_DISABLE_PROXY + if (HTTPManager.Proxy != null) + webSocket.InternalRequest.Proxy = new HTTPProxy(HTTPManager.Proxy.Address, HTTPManager.Proxy.Credentials, false); +#endif +#endif + + // Subscribe to the WS events + webSocket.OnOpen += OnOpen; + webSocket.OnMessage += OnMessageReceived; + webSocket.OnClosed += OnClosed; + webSocket.OnError += OnError; + + // Start connecting to the server + webSocket.Open(); + + Text += "Opening Web Socket...\n"; + } + + if (webSocket != null && webSocket.IsOpen) + { + GUILayout.Space(10); + + GUILayout.BeginHorizontal(); + msgToSend = GUILayout.TextField(msgToSend); + + GUILayout.EndHorizontal(); + + if (GUILayout.Button("Send", GUILayout.MaxWidth(70))) + { + Text += "Sending message...\n"; + + // Send message to the server + webSocket.Send(msgToSend); + } + + GUILayout.Space(10); + + if (GUILayout.Button("Close")) + { + // Close the connection + webSocket.Close(1000, "Bye!"); + } + } + }); + } + + #endregion + + #region WebSocket Event Handlers + + /// + /// Called when the web socket is open, and we are ready to send and receive data + /// + void OnOpen(WebSocket.WebSocket ws) + { + Text += string.Format("-WebSocket Open!\n"); + } + + /// + /// Called when we received a text message from the server + /// + void OnMessageReceived(WebSocket.WebSocket ws, string message) + { + Text += string.Format("-Message received: {0}\n", message); + } + + /// + /// Called when the web socket closed + /// + void OnClosed(WebSocket.WebSocket ws, UInt16 code, string message) + { + Text += string.Format("-WebSocket closed! Code: {0} Message: {1}\n", code, message); + webSocket = null; + } + + /// + /// Called when an error occured on client side + /// + void OnError(WebSocket.WebSocket ws, Exception ex) + { + string errorMsg = string.Empty; +#if !UNITY_WEBGL || UNITY_EDITOR + if (ws.InternalRequest.Response != null) + { + errorMsg = string.Format("Status Code from Server: {0} and Message: {1}", ws.InternalRequest.Response.StatusCode, ws.InternalRequest.Response.Message); + } +#endif + + Text += string.Format("-An error occured: {0}\n", (ex != null ? ex.Message : "Unknown Error " + errorMsg)); + + webSocket = null; + } + + #endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket/WebSocketSample.cs.meta b/JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket/WebSocketSample.cs.meta new file mode 100644 index 00000000..33419f49 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Examples/Websocket/WebSocketSample.cs.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e62ab818fc89e124db079d6cc7323474 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Plugins.meta b/JNFrame/Assets/Plugins/BestHTTP/Plugins.meta new file mode 100644 index 00000000..261cd799 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Plugins.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f2acd3f924ae69c44b7aadb54e686d44 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL.meta b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL.meta new file mode 100644 index 00000000..aebd4cd6 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b48528ef6a3e52f4ba5e4335dff83841 +folderAsset: yes +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_EventSource.jslib b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_EventSource.jslib new file mode 100644 index 00000000..8cd86936 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_EventSource.jslib @@ -0,0 +1,154 @@ +var Lib_BEST_HTTP_WebGL_ES_Bridge = +{ + $es: { + eventSourceInstances: {}, + nextInstanceId : 1, + + Set : function(event) { + es.eventSourceInstances[es.nextInstanceId] = event; + return es.nextInstanceId++; + }, + + Get : function(id) { + return es.eventSourceInstances[id]; + }, + + Remove: function(id) { + delete es.eventSourceInstances[id]; + }, + + _callOnError: function(errCallback, id, reason) + { + if (reason) + { + var length = lengthBytesUTF8(reason) + 1; + var buffer = _malloc(length); + + stringToUTF8Array(reason, HEAPU8, buffer, length); + + Runtime.dynCall('vii', errCallback, [id, buffer]); + + _free(buffer); + } + else + Runtime.dynCall('vii', errCallback, [id, 0]); + }, + + _GenericEventHandler: function(id, eventName, e, onMessage) { + function AllocString(str) { + if (str != undefined) + { + var length = lengthBytesUTF8(str) + 1; + var buff = _malloc(length); + + stringToUTF8Array(str, HEAPU8, buff, length); + + return buff; + } + + return 0; + } + + var eventBuffer = AllocString(eventName); + var dataBuffer = AllocString(e.data); + var idBuffer = AllocString(e.id); + + Runtime.dynCall('viiiii', onMessage, [id, eventBuffer, dataBuffer, idBuffer, e.retry]); + + if (eventBuffer != 0) + _free(eventBuffer); + + if (dataBuffer != 0) + _free(dataBuffer); + + if (idBuffer != 0) + _free(idBuffer); + } + }, + + ES_IsSupported: function() { + return typeof(EventSource) !== "undefined"; + }, + + ES_Create: function(urlPtr, withCredentials, onOpen, onMessage, onError) + { + var url = /*encodeURI*/(Pointer_stringify(urlPtr)) + .replace(/\+/g, '%2B') + .replace(/%252[fF]/ig, '%2F'); + + var event = { + onError: onError + }; + + var id = es.nextInstanceId; + + console.log(id + ' ES_Create(' + url + ', ' + withCredentials + ')'); + + event.eventImpl = new EventSource(url, { withCredentials: withCredentials != 0 ? true : false } ); + event.onMessage = onMessage; + + event.eventImpl.onopen = function() { + console.log(id + ' ES_Create - onOpen'); + + Runtime.dynCall('vi', onOpen, [id]); + }; + + event.eventImpl.onmessage = function(e) { + console.log(id + ' on Generic Message'); + es._GenericEventHandler(id, undefined, e, onMessage); + }; + + event.eventImpl.onerror = function(e) { + console.log(id + ' ES_Create - onError'); + + es._callOnError(onError, id, "Unknown Error!"); + }; + + return es.Set(event); + }, + + ES_AddEventHandler: function(id, eventNamePtr) { + var eventName = Pointer_stringify(eventNamePtr); + + console.log(id + ' ES_AddEventHandler(' + eventName + ')'); + + var event = es.Get(id); + + try + { + event.eventImpl.addEventListener(eventName, function(e) { + console.log(id + ' onEvent('+ eventName + ')'); + + es._GenericEventHandler(id, eventName, e, event.onMessage); + }); + } + catch(e) { + es._callOnError(event.eventImpl.onError, id, ' ' + e.name + ': ' + e.message); + } + }, + + ES_Close: function(id) + { + console.log(id + ' ES_Close'); + + var event = es.Get(id); + + try + { + event.eventImpl.close(); + } + catch(e) { + es._callOnError(event.eventImpl.onError, id, ' ' + e.name + ': ' + e.message); + } + }, + + ES_Release: function(id) + { + console.log(id + ' ES_Release'); + + es.Remove(id); + } +}; + +autoAddDeps(Lib_BEST_HTTP_WebGL_ES_Bridge, '$es'); +mergeInto(LibraryManager.library, Lib_BEST_HTTP_WebGL_ES_Bridge); diff --git a/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_EventSource.jslib.meta b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_EventSource.jslib.meta new file mode 100644 index 00000000..8f5b9901 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_EventSource.jslib.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: ac23b06f7735b8e478ce14b0d4ac2a68 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + WebGL: + enabled: 1 + settings: {} + data: + enabled: 0 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebRequest.jslib b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebRequest.jslib new file mode 100644 index 00000000..749fcd27 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebRequest.jslib @@ -0,0 +1,259 @@ +var Lib_BEST_HTTP_WebGL_HTTP_Bridge = +{ + /*LogLevels: { + All: 0, + Information: 1, + Warning: 2, + Error: 3, + Exception: 4, + None: 5 + }*/ + + $wr: { + requestInstances: {}, + nextRequestId: 1, + loglevel: 2 + }, + + XHR_Create: function(method, url, user, passwd, withCredentials) + { + var _url = /*encodeURI*/(Pointer_stringify(url)) + .replace(/\+/g, '%2B') + .replace(/%252[fF]/ig, '%2F'); + var _method = Pointer_stringify(method); + + if (wr.loglevel <= 1) /*information*/ + console.log(wr.nextRequestId + ' XHR_Create - withCredentials: ' + withCredentials + ' method: ' + _method + ' url: ' + _url); + + var http = new XMLHttpRequest(); + + if (user && passwd) + { + var u = Pointer_stringify(user); + var p = Pointer_stringify(passwd); + + http.withCredentials = true; + http.open(_method, _url, /*async:*/ true , u, p); + } + else { + http.withCredentials = withCredentials; + http.open(_method, _url, /*async:*/ true); + } + + http.responseType = 'arraybuffer'; + + wr.requestInstances[wr.nextRequestId] = http; + return wr.nextRequestId++; + }, + + XHR_SetTimeout: function (request, timeout) + { + if (wr.loglevel <= 1) /*information*/ + console.log(request + ' XHR_SetTimeout ' + timeout); + + wr.requestInstances[request].timeout = timeout; + }, + + XHR_SetRequestHeader: function (request, header, value) + { + var _header = Pointer_stringify(header); + var _value = Pointer_stringify(value); + + if (wr.loglevel <= 1) /*information*/ + console.log(request + ' XHR_SetRequestHeader ' + _header + ' ' + _value); + + if (_header != 'Cookie') + wr.requestInstances[request].setRequestHeader(_header, _value); + else { + var cookies = _value.split(';'); + for (var i = 0; i < cookies.length; i++) { + document.cookie = cookies[i]; + } + } + }, + + XHR_SetResponseHandler: function (request, onresponse, onerror, ontimeout, onaborted) + { + if (wr.loglevel <= 1) /*information*/ + console.log(request + ' XHR_SetResponseHandler'); + + var http = wr.requestInstances[request]; + // LOAD + http.onload = function http_onload(e) { + if (wr.loglevel <= 1) /*information*/ + console.log(request + ' - onload ' + http.status + ' ' + http.statusText); + + if (onresponse) + { + var response = 0; + if (!!http.response) + response = http.response; + + var byteArray = new Uint8Array(response); + var buffer = _malloc(byteArray.length); + HEAPU8.set(byteArray, buffer); + + Runtime.dynCall('viiiii', onresponse, [request, http.status, buffer, byteArray.length, 0]); + + _free(buffer); + } + }; + + if (onerror) + { + http.onerror = function http_onerror(e) { + function HandleError(err) + { + var length = lengthBytesUTF8(err) + 1; + var buffer = _malloc(length); + + stringToUTF8Array(err, HEAPU8, buffer, length); + + Runtime.dynCall('vii', onerror, [request, buffer]); + + _free(buffer); + } + + if (e.error) + HandleError(e.error); + else + HandleError("Unknown Error! Maybe a CORS porblem?"); + }; + } + + if (ontimeout) + http.ontimeout = function http_onerror(e) { + Runtime.dynCall('vi', ontimeout, [request]); + }; + + if (onaborted) + http.onabort = function http_onerror(e) { + Runtime.dynCall('vi', onaborted, [request]); + }; + }, + + XHR_SetProgressHandler: function (request, onprogress, onuploadprogress) + { + if (wr.loglevel <= 1) /*information*/ + console.log(request + ' XHR_SetProgressHandler'); + + var http = wr.requestInstances[request]; + if (http) + { + if (onprogress) + http.onprogress = function http_onprogress(e) { + if (wr.loglevel <= 1) /*information*/ + console.log(request + ' XHR_SetProgressHandler - onProgress ' + e.loaded + ' ' + e.total); + + if (e.lengthComputable) + Runtime.dynCall('viii', onprogress, [request, e.loaded, e.total]); + }; + + if (onuploadprogress) + http.upload.addEventListener("progress", function http_onprogress(e) { + if (wr.loglevel <= 1) /*information*/ + console.log(request + ' XHR_SetProgressHandler - onUploadProgress ' + e.loaded + ' ' + e.total); + + if (e.lengthComputable) + Runtime.dynCall('viii', onuploadprogress, [request, e.loaded, e.total]); + }, true); + } + }, + + XHR_Send: function (request, ptr, length) + { + if (wr.loglevel <= 1) /*information*/ + console.log(request + ' XHR_Send ' + ptr + ' ' + length); + + var http = wr.requestInstances[request]; + + try { + if (length > 0) + http.send(HEAPU8.subarray(ptr, ptr+length)); + else + http.send(); + } + catch(e) { + if (wr.loglevel <= 4) /*exception*/ + console.error(request + ' ' + e.name + ": " + e.message); + } + }, + + XHR_GetResponseHeaders: function(request, callback) + { + if (wr.loglevel <= 1) /*information*/ + console.log(request + ' XHR_GetResponseHeaders'); + + var headers = '' + var cookies = document.cookie.split(';'); + for(var i = 0; i < cookies.length; ++i) + headers += "Set-Cookie:" + cookies[i] + "\r\n"; + + var additionalHeaders = wr.requestInstances[request].getAllResponseHeaders().trim(); + if (additionalHeaders.length > 0) { + headers += additionalHeaders; + headers += "\r\n"; + } + + if (wr.loglevel <= 1) /*information*/ + console.log(' "' + headers + '"'); + + var byteArray = new Uint8Array(headers.length); + for(var i=0,j=headers.length;i 0) + // ws._callOnError(onError, id, e.reason); + // else + // { + // switch (e.code) + // { + // case 1001: ws._callOnError(onError, id, "Endpoint going away."); + // break; + // case 1002: ws._callOnError(onError, id, "Protocol error."); + // break; + // case 1003: ws._callOnError(onError, id, "Unsupported message."); + // break; + // case 1005: ws._callOnError(onError, id, "No status."); + // break; + // case 1006: ws._callOnError(onError, id, "Abnormal disconnection."); + // break; + // case 1009: ws._callOnError(onError, id, "Data frame too large."); + // break; + // default: ws._callOnError(onError, id, "Error " + e.code); + // } + // } + //} + //else + ws._callOnClose(onClose, id, e.code, e.reason); + }; + + return ws.Set(socket); + }, + + WS_GetState: function (id) + { + var socket = ws.Get(id); + + if (typeof socket === 'undefined' || + socket == null || + typeof socket.socketImpl === 'undefined' || + socket.socketImpl == null) + return 3; // closed + + return socket.socketImpl.readyState; + }, + + WS_GetBufferedAmount: function (id) + { + var socket = ws.Get(id); + return socket.socketImpl.bufferedAmount; + }, + + WS_Send_String: function (id, str) + { + var socket = ws.Get(id); + var str = Pointer_stringify(str); + + try + { + socket.socketImpl.send(str); + } + catch(e) { + ws._callOnError(socket.onError, id, ' ' + e.name + ': ' + e.message); + } + + return socket.socketImpl.bufferedAmount; + }, + + WS_Send_Binary: function(id, ptr, pos, length) + { + var socket = ws.Get(id); + + try + { + var buff = HEAPU8.subarray(ptr + pos, ptr + pos + length); + socket.socketImpl.send(buff /*HEAPU8.buffer.slice(ptr + pos, ptr + pos + length)*/); + } + catch(e) { + ws._callOnError(socket.onError, id, ' ' + e.name + ': ' + e.message); + } + + return socket.socketImpl.bufferedAmount; + }, + + WS_Close: function (id, code, reason) + { + var socket = ws.Get(id); + var reasonStr = Pointer_stringify(reason); + + console.log(id + ' WS_Close(' + code + ', ' + reasonStr + ')'); + + socket.socketImpl.close(/*ulong*/code, reasonStr); + }, + + WS_Release: function(id) + { + console.log(id + ' WS_Release'); + + ws.Remove(id); + } +}; + +autoAddDeps(Lib_BEST_HTTP_WebGL_WS_Bridge, '$ws'); +mergeInto(LibraryManager.library, Lib_BEST_HTTP_WebGL_WS_Bridge); diff --git a/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebSocket.jslib.meta b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebSocket.jslib.meta new file mode 100644 index 00000000..3ddde4a3 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Plugins/WebGL/BestHTTP_WebSocket.jslib.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: 8efe6cedf2832a647a33465b85e4f311 +PluginImporter: + serializedVersion: 1 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + platformData: + Any: + enabled: 0 + settings: {} + Editor: + enabled: 0 + settings: + DefaultValueInitialized: true + WebGL: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/ReleaseNotes.txt b/JNFrame/Assets/Plugins/BestHTTP/ReleaseNotes.txt new file mode 100644 index 00000000..ac815c78 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/ReleaseNotes.txt @@ -0,0 +1,627 @@ +1.11.0 (2019.01.21) +General +-[New Feature] Implemented new buffer pool mechanism to reuse internal byte arrays. This is quite a large change that touches all part of the plugin, but reduces the plugin's memory garbage production very very much! (Thanks to Teemu @ Delta Cygni Labs for the base idea and code donation!) +-[New Feature] All samples are available in a public git repo too (https://github.com/Benedicht/BestHTTP_Examples) +-[New Feature] Added a new IIOService interface and the plugin now uses the file system through this abstraction. New IIOService implementations can be added and set to the HTTPManager.IOService field. +-[New Feature] Initial SOCKS proxy with basic authentication support added. +-[Improvement] All samples now placed inside a namespace +-[Improvement] Removed Unity's WWWForm option from AddField and FormUsage. +-[Improvement] Updated BouncyCastle to the latest version. +-[Improvement] BouncyCastle namespaces are moved under the BestHTTP.SecureProtocol namespace, custom class (like ICertificateVerifyer) are remaining under the Org.BouncyCastle.Crypto.Tls namespace. I hope this will help in cases where other plugins are bundling BC too. +-[BugFix] The request will fail if the proxy-authentication is failed +-[Bugfix] Caching headers set multiple times on redirection +Socket.IO +-[Bugfix] The plugin will not try to emit an error when the error callback throws an exception. +SignalRCore +-[New Feature] Added new samples +-[Improvement] New OnRedirect event handler +-[Bugfix] Implemented proper redirect and authentication handling. +-[Bugfix] Now it can handle relative redirect urls. + +1.10.10 (2018.11.04) +General +-[Improvement] New demo page added: https://besthttpdemosite.azurewebsites.net/ +-[Bugfix] One of HTTProxy's constructor didn't use a parameter to set the correct value +-[Improvement] Improved connection handling and code quality for the UWP connection layer +WebGL +-[New Feature] Partial cookie support added (cookies are managed by the browser, but the plugin is able to read and write them) +-[New Feature] Read and write cookie support added +-[New Feature] HTTPRequest has a new WithCredentials property +-[Improvement] More requests will be 'simple' to do not require a preflight request +SignalRCore +-[New Feature] Added client-sent ping messages +-[Improvement] New example added +WebSockets +-[Improvement] Increased the limit of the per-message deflate extension's minDataLengthToCompress parameter. +-[Improvement] [WebGL] Client-side generated status code of 1006 is treated as an error now to match non-webgl behavior. + +1.10.9 (2018.07.05) +General +-[Bugfix] Fixed a compile error under WebGL +-[Improvement] HTTPRequest's GetEntityBody became public api +-[Improvement] Added GetFormFields to HTTPRequest + +1.10.8 (2018.07.02) +General +-[Improvement] Greatly reduced the TCP packets that sent out for a HTTP request +WebSocket +-[Improvement] Frame downloading now isn't blocked while user code is executing on current completed frames +SocketIO +-[Bugfix] Implemented a new ToInt function instead of char.GetNumericValue as this later one throws an exception under WebGL using the new 4.x runtime +SignalR Core +-[Improvement] Fixed compile errors for WSA +-[Improvement] Added HubOptions to be able to set more options +-[Improvement] Now it's possible to skip the negotiation process and connect straigth with the (only) WebSocket protocol +-[Bugfix] Authentication provider's PrepareRequest wasn't called on the negotiation request. + +1.10.7 (2018.06.05) +General +-[Improvement] Logger will log out time infromation too +-[Improvement] HTTPRequest will send a Content-Length header with zero value when there's no data to send +WebSocket +-[Bugfix] Fixed a case where the connection reported closed unintentionally +SignalR Core +-[Improvement] Added PrepareUri function to the IAuthenticationProvider interface +-[Improvement] Added negotiation request. Negotiation result now stored in the NegotiationResult property. +-[Improvement] Added support for 'Close' server messages +-[Improvement] More documentation and code comments +-[Improvement] Code cleanup + +1.10.6 (2018.05.20) +General +-[Bugfix] Fixed a case where aborting a request throw and exception +SocketIO +-[Bugfix] Will not send a ping packet while waiting for a pong +WebSocket +-[Bugfix] OnError OnErrorDesc events not called when the websocket's State > Connecting +SignalRCore +-[Improvement] New BESTHTTP_DISABLE_SIGNALR_CORE symbol to disable SignalR Core +-[Bugfix] The SignalR Core implementation has no dependency on SignalR classes now + +1.10.5 (2018.04.17) +General +-[Improvement] HTTPRequest will send Content-Length header with zero value if there's no data +-[Improvement] Added timing info to logging +WebSocket +-[Improvement] Improved error handling +SignalR Core +-[Improvement] Added /negotiation request and NegotiationResult property to the HubConnection +-[Improvement] More code comments and logging +-[Improvement] Added support for Close server messages +-[Bugfix] Removed compile warnings + +1.10.4 (2018.04.15) +General +-[Improvement] csproj files added to the package to genereate dlls +-[Improvement] Improved compatibilty with other packages that are have theirs own Utility class in the root namespace. +-[Improvement] Improved compatibility with the Experimental (.NET 4.6) runtime +-[Improvement] Using the HTTPRequest's CustomTLSServerNameList property now it's possible to add custom SNIs +-[Bugfix] Decompressor used during streaming will buffer up data if necessary to avoid a GZip exception. +-[Bugfix] Removed unnecessary logging in the HTTPUpdateDelegator +-[Bugfix] TLS SNIs will not be sent if the host is an IPv4 or IPv6 address +-[Bugfix] Digest authentication failed with the proxy +WebSocket +-[Improvement] Now it's possible to close the websocket before it connects +-[Improvement] New State property to access the websocket's state +-[Bugfix] [WebGL] HTTPManager.Setup() isn't called when only the WebSocket protocol is used +SocketIO +-[Bugfix] proper pingTimeout implementation (thanks @carsanlop for the code!) +SignalR +-[Bugfix] It will not try to reconnect after leaving Unity's play mode. +SignalR Core +-[New Feature] New SignalR Core implementation for SignalRCore 1.0.0-alpha2 + +1.10.3 (2017.11.11) +General +-[Improvement] Added OPTIONS verb +-[Improvement] Better compatibility with Unity 2017.2 +-[Bugfix] Boundary generated for multipart/form-data will be a truely unique value that shouldn't be found in the payload +WebSocket +-[New Feature] Added new CloseAfterNoMesssage TimeSpan property to the WebSocket class. When StartPingThread is true, the plugin will check for messages and will close the connection and emit an OnError/OnErrorDesc event after the specified time. It's not available on WebGL platform! +-[New Feature] Added Latency property. When StartPingThread is true, it will calculate the latency from the Ping-Pong message round-trip times. It's not available on WebGL platform! +SignalR +-[Bugfix] Group token not sent with polling requests + +1.10.2 (2017.07.29) +General +-[Bugfix] Fixed an exception when redirected + +1.10.1 (2017.07.26) +General +-[New Feature] Added BESTHTTP_DISABLE_GZIP to be able to disable gzip Accept-Encoding requests +-[Improvement] Improved compatibility when run in an Editor window +-[Improvement] DNS query is done async with timeout (Thanks goes to chriser on the forums for the code) +-[Bugfix] The HTTPConnection object will not close the TCP stream when the "Connection: Close" header present and the http response handler's IsClosedManually set to true. +-[Bugfix] Fixed a compilation issue in RawJsonForm.cs when both BESTHTTP_DISABLE_SOCKETIO and BESTHTTP_DISABLE_SIGNALR are defined +-[Bugfix] When a request's DisableChace is set to true, it will not produce a warning if caching headers added manually +-[Bugfix] When there's no connection the CookieJar will not override saved cookies with an empty one +Websocket +-[Bugfix] Fixed an issue where receive threads are not shut down resulting in an exception +Socket.IO +-[Improvement] Compatibility with Socket.IO 2.0.0 +Server-Sent Events +-[Improvement] Added WithCredentials property to the EventSource class under WebGL +-[Improvement] EventSource constructor will thrown a NotSupportedException under WebGL when the underlying browser isn't supports the EventSource protocol +-[Bugfix] Subscibing to a named event (On(...)) isn't worked under WebGL + +1.10.0 (2017.05.05) +General +-Removed support for Windows Phone 8 +-[New Feature] HTTPManager and HTTPRequest has a new property 'TryToMinimizeTCPLatency' to turn on/off TCP NoDelay +-[New Feature] A new Form type 'RawJson' to send the fields added with AddField jon encoded +-[Improvement] Added DefaultCertificationValidator to the HTTPManger +-[Improvement] Improved compatibility with Unity 2017.1 +-[Improvement] Now the plugin capable to download files larger than 2 GB (Thanks goes to Daniel @ present4D) +-[Bugfix] Accessing streaming assets now possible under WebGL builds +-[Bugfix] Fixed a sneaky bug where the HTTPUpdateDelegator unloaded in builds +Socket.IO +-[Improvement] Sockets now have an Id property generated the same as in the JS Socket.IO lib. + +1.9.17 (2017.01.29) +General +-[New Feature] GZip content encoding is now supported when UseStreaming is on. The plugin now will automatically decompress downloaded chunks. +-[Improvement] Removed .Bind() calls from the TcpClient class to remove the need of the com.apple.security.network.server permission. +-[Improvement] Added support for PATCH requests +-[Improvement] Improved the Clear() function of the HTTPRequest to reset more properties +-[Bugfix] Sending text fields will not include additional quotes around the charset value +-[Bugfix][WebGL] Fixed multiple bugs where WebGL requests are failed early +WebSocket +-[New Feature] Send became non-blocking, buffered up data will be sent on a thread +-[New Feature] WebSocket has a new property: BufferedAmount to get the length of the unsent, buffered up data in bytes +-[Improvement] Improved compatibility with Citrix + +1.9.16 (2016.10.24) +General +-[Improvement] Using the HTTPRequest's CacheOnly property now it's possible to download a resource into the cache only. The response object's Data will not be populated in this case! (Thanks goes to Sakari for the complete patch!) +-[Bugfix] Made a workaround for a mono bug where on macOS Uri created a file:// uri from a relative path instead throwing an exception. +WebSocket +-[Bugfix] The client sent wrong number of frames for a large frame +-[Bugfix] Fixed a bug to be able to connect to Asp .NET Core hosted WebSocket servers +SignalR +-[Bugfix] The plugin will wait a little now before a new reconnect attempt + +1.9.15 (2016.09.22) +General +-[Improvement] When ConnectTimeout of the HTTPManager or HTTPRequest is set to TimeSpan.Zero, no timeout logic is executed. +-[Bugfix] Removed read&write timeouts as it caused issues in some cases +-[Bugfix] Fixed a compile error when BESTHTTP_DISABLE_CACHING was defined + +1.9.14 (2016.09.13) +General +-[Improvement] Added Read and Write timeouts +-[Improvement] Added diagnostic logging. They will be logged when LogLevels.All is used +-[Improvement] Removed a frightening warning about lock acquisition +-[Improvement] Removed an additonal BinaryWriter instantiation when sending out a request +-[Bugfix] Fixed a case where uris without a leading / would fail +-[Bugfix] [WebGL] Fixed url lowercase converting +-[Bugfix] No exceptions should be thrown now when quitting +-[Bugfix] Fixed a case where a cache entity deleted unintentionally on startup +Server-Sent Event +-[Bugfix] Content-Type header check was too strict + +1.9.13 (2016.07.20) +General +-[Improvement] Default Connection idle time lowered to 20 seconds +-[Bugfix] Made workaround for mono bugs around Uri encodings +-[Bugfix] Cached content wasnt refreshed (thanks goes to Jeff Mrochuk) +Server-Sent Events +-[Bugfix] Fixed a case where it would produce an exception when no On function is used to subscribe to an event + +1.9.12 (2016.06.21) +General +-[Improvement] Reading a file with the file:// protocol will not result in an Access Denied exception on PS4 (Thanks goes to Dong-Geun Oh for reporting and sending a patch) +-[Improvement] ThreadPools are used again instead of raw Threads +-[Improvement] Content-Length headers value will be used even with chunked encoding for download progress report +-[Improvement] Improved thread locking +-[Bugfix] Automatic retry will be done only for GET request on erro +-[Bugfix] TCP connection will be closed when the requests IsKeepAlive set to false +-[Bugfix] [WebGL] OnBeforeHeaderSend will be called now properly +-[Bugfix] [WebGL] Callbacks will be called now when an error occur in the XHR_Send function +-[Bugfix] HTTPRequest.AddField with null encoding will work now +-[Bugfix] Callback called with requests State Processing on application quit +WebSocket +-[Improvement] Documentation and code changes to emphasize that WebSocket instance cant be reused +-[Improvement] Text frames will be decoded on the read thread to further minimize cpu burden on the main Unity thread +SignalR +-[Improvement] New BESTHTTP_SIGNALR_WITH_JSONDOTNET compile-time directive to use Newtonsofts JSon.NET. Using this the plugin will default to the JsonDotnetEncoder. +SocketIO +-[Bugfix] Fixed a case where calling Off on an event caused an exception when the server sent that event again + +1.9.11 (2016.04.04) +General +-[Bugfix][WebGL] Fixed a case where http requests truncated under Microsoft Edge +-[Bugfix] The plugin will work again in editor windows +-[Bugfix] Multiple fixes around request abortion +Server-Sent Events +-[Bugfix] [WebGL] Newly created event sources will not use the same id(1) over and over +Socket.IO +-[Improvement] Rewrote handshake processing to be able to skip the polling transport +-[Improvement] Now its possible to inform the plugin what transport it should use to connect with through the SocketOptions ConnectWith property +-[Improvement][PollingTransport] Will not force the server to send textual packets +-[Improvement][PollingTransport] Greatly improved packet parsing speed +-[Bugfix] The plugin will process messages sent with the handshake data + +1.9.10 (2016.03.14) +General +-[New Feature] Apple TvOS support added. +-[New Feature] Keep-Alive header support added +-[New Feature] New OnBeforeHeaderSend event added to the HTTPRequest class to be able to access and modify headers just before they are sent out. +-[Improvement] Decreased memory allocations when no encoding is used in the response +-[Improvement] Updated link.xml +-[Improvement] The default value for UserAlternateSSL is changed to true +-[Improvement] [WebGL] The WebGL connection will use the loggers level +-[Improvement] [WebGL] The plugin will handle correctly UTF16 strings (Thanks goes to Eugen and Zorrendor) +-[Bugfix] [UWP] Because of a missing Flush() call, body-less requests are not sent out +SignalR +-[Improvement] Connections PingInterval is now set to public +-[Bugfix] PrepareRequest doesnt called for Ping requests +WebSocket +-[Bugfix] [WebGL] Fixed a bug where checking the websockets IsOpen status caused an error +-[Bugfix] Fixed a case where assembled frames decoded with extensions twice + +1.9.9 (2016.02.16) +General +-[Bugfix] On redirection the plugin tried to load from the cache for the wrong uri +-[Bugfix] On application exit HTTPUpdateDelegator will now shut down the update thread if its used +-[Bugfix] Cookies will be sent for protocols other than http too +-[Bugfix] Empty headers will no longer sent out +-[Bugfix] Null values in headers will no longer cause an exception +-[Improvement] Added some missing documentation. +-[Improvement] Exception logging now will include inner exceptions too +WebSockets +-[New Feature] Support for extensions added +-[New Feature] Per-Message Deflate compression extension added +Socket.IO +-[Improvement] Custom errors by middlewares are now supported +-[Improvement] Socket.Options AdditionalQueryParams changed from Dictionary to ObservableDictionary to automatically delete the cached value when its changed +-[Bugfix] The plugin will not decode the payload for Emit callbacks +SignalR +-[Improvement] AdditionalQueryParams changed from Dictionary to ObservableDictionary to automatically delete the cached value when its changed + +1.9.8 (2016.01.04) +General +-[Improvement] Download progress report will be more frequent now with Chunked encoding +WebSockets +-[Bugfix] Sending pings will not be capped on 100ms now +-[Bugfix] [WebGL] Binary data sending and receiving will be handled correctly now + +1.9.7 (2015.12.13) +General +-[Bugfix] Improved compatibility with 5.3 coroutine changes +-[Improvement] Example scripts are in a namespace too + +1.9.6 (2015.12.08) +General +-[Improvement] Changes made to greatly improve compatibility for Windows Store builds targeting IL2CPP scripting backend +Socket.IO +-[Improvement] The WebSocketTransport will send and Update packet to the server without any other payload to improve compatibility + +1.9.5 (2015.11.30) +General +-[Fix] The plugin will choose the Content-Length header when Content-Range present too +-[Improvement] Improved threading of HTTPUpdateDelegator +WebGL +-[Fix] The plugin will not try to decode the content as chunked, as the browser done it already +Socket.IO +-[Fix] Fixed a rare bug where WebSocket transport tried to access a null object +-[Improvement] An error event will be emitted on timeout too +SignalR +-[Improvement] Call functions now will return true if the plugin was able to send the message to the server + +1.9.4 (2015.10.16) +General +-[Bugfix] Fixed a possible connection error on editors running on non-windows +-[Improvement] Added two more constructors to the Cookie class + +1.9.3 (2015.10.10) +-WebGL support added! Check out the documentation about the limitations. +General +-[Improvement] Improved shutdown handling in the editor +-[Improvement] Cache will work on redirect uris as expected +-[Bugfix] Tcp channel disconnection is now detected much quicker +SignalR +-[Improvement] Added support for SignalR 2.0.x +-[Improvement] Improved logging in some cases +WebSocket +-[Bugfix] The plugin will detect a lost connection sooner + +1.9.2 (2015.09.03) +General +-[Improvement] WP8 support is back! +-[Improvement] Improved compatibility with Windows 10 Universal App build for Unity 5.2 +-[Improvement] Improved shutdown handling in the editor + +1.9.1 (2015.08.26) +General +-[Improvement] Improved error reporting on WSA platforms for TcpClient +-[New feature] Initial and experimental file:// protocol support +Socket.IO +-[Bugfix] Emitting binary data wrongly converted +SignalR +-[Improvement] Improved logging +ServerSentEvents +-[Bugfix] Improved compatibility + +1.9.0 (2015.07.29) +Windows Phone 8 silverlight based build support removed! +General +-[New Feature] Various features can be disabled now with the following defines: +--+BESTHTTP_DISABLE_COOKIES +--+BESTHTTP_DISABLE_CACHING +--+BESTHTTP_DISABLE_SERVERSENT_EVENTS +--+BESTHTTP_DISABLE_WEBSOCKET +--+BESTHTTP_DISABLE_SIGNALR +--+BESTHTTP_DISABLE_SOCKETIO +--+BESTHTTP_DISABLE_ALTERNATE_SSL +--+BESTHTTP_DISABLE_UNITY_FORM +--+Check the manual on how you can set these in Unity: http://docs.unity3d.com/Manual/PlatformDependentCompilation.html +-[Improvement] Removed DLL depenencies +-[Improvement] Improved HTTPConnection teardown on quitting +-[Improvement] Improved compatibility when used in an editor window +-[Bugfix] Cookies are stored from redirections +Socket.IO +-[Bugfix] WebSocketTransport not switched to secure protocol when the Uri of the socket.io endpoint is HTTPS +-[BugFix] Disconnect event not fired when the server initiated the disconnect (Thx go to Takayasu Oyama) +SignalR +-[Bugfix] WebSocketTransport not reconnected properly (Thx go to Jaakko Jumisko) + +1.8.2 (2015.06.26) +General +-[Improvement] HTTPResponses DataAsTexture2D will use the full constructor now +-[Bugfix] CookieJars SetupFolder will check for save support now +-[Bugfix] Cache service deleted all files on maitenance +SignalR +-[Improvement] Better compatibility with JSon .NET encoder +Socket.IO +-[Bugfix] Fixed a case where Disconnect event fired twice +-[Bugfix] First argument on Ack callbacks are removed unintentionally +-[Bugfix] Fixed a case where the disconnect event fired twice +Server-Sent Events +-[Improvement] Message class qualified by its namespace everywhere to prevent compile errors + +1.8.1 (2015.05.26) +General +-[New Feature] Server-Sent Events protocol added! +-[Improvement] Updated documentation +-[Improvement] Changed ICertificateVerifyer interface to receive the target servers uri for validation +-[Bugfix] Fixed a case where HTTPConnections are stuck in the Initial state blocking requests in the queue +Socket.IO +-[Bugfix] Much simpler protocol upgrade/downgrade code to avoid a case when a poll request received by the server after a websocket upgrade +SignalR +-[Improvement] Can fall back to ServerSentEvents protocol + +1.8.0 (2015.05.19) +General +-[New Feature] SignalR protocol added! +-[New Feature] Samsung Smart TV support added! +-[Improvement] HTTPManager has a new UseAlternateSSLDefaultValue property to change the default UseAlternateSSL value +-[Improvement] Custom Cookies added to the request now will overwrite cookies that are stored in the CookieJar, instead of merging and sending both +-[Improvement] Custom Cookies can be added now to the CookieJar +-[Bugfix] In some case, the HTTPManager created new connections that not used after but blocked new requests +-[Bugfix] Fixes a case where a HTTRequests State set to Finished instead of Error +-[Bugfix] Fixed a case where custom cookies are not sent +-[Bugfix] Aborting a finished request will not create a stuck connection +WebSocket +-[Improvement] Reading speed of payload data from the wire greatly improved +-[Improvement] New OnErrorDesc event added. This will receive a string errorDesc param. It has a higher chance that its stores a meaningfull error description then the previos OnError +-[Bugfix] Fixed a case when the OnError didnt called + +1.7.11 (2015.04.27) +General +-[Improvement] Greatly improved chache filename generation. New filenames are much-much shorter, therefore (very) long urls can be saved now too +-[Bugfix] Removed unnecessary entry in the link.xml. With this change, full stripping is supported in IL2CPP builds with the .NET 2.0 Subset Api Compatibility Level (Thanks goes to Andrew Wu from Scientific Games for catching/reporting it!) +-[Bugfix] Authentication headers are transformed to lowercase +WebSocket +-[Bugfix] Fixed a case where server sent messages get lost when received before the OnOpen event + +1.7.10(2015.04.17) +General +-[Improvement] The plugin will choose the best supported algorithm if multiple Proxy-Authenticate headers are present +-[Improvement] Proxy authentication is now handled for explicit https too +-[Improvement] Saved some cpu cycles and GC allocs while sending a request +-[Improvement] New NonTransparentForHTTPS property in the HTTPProxy class to be able to automotacally switch proxy mode for secure protocols(https://, wss://) +-[Improvement] More, and more accurate logging +-[Improvement] Added some missing documentation to the HTTPProxy class +-[Bugfix] Proxy authentication tried to send the wrong credentials +-[Bugfix] Waiting for the request to finish with a StartCoroutine is exited sooner in some cases +-[Bugfix] One of the HTTPProxy constructor doesnt set the SendWholeUri to its default value +-[Bugfix] AuthenticateAsClient called with the wrong host parameter when used with a proxy +-[Bugfix] HTTPConnection class now will use the request DisableRetry property, and will not retry a post request by default +-[Bugfix] Fixed a case where an Error state surfaced as Finished +Socket.IO: +-[Improvement] More improvements around transport fallback +-[Improvement] Better error logging in WebSocketTransport +WebSocket: +-[Improvement] If global proxy is set (HTTPManager.Proxy) it will use it as a tunnel automatically +-[Improvement] Better error logging + +1.7.9 (2015.04.01) +[New Feature] OnBeforeRedirection callback added to HTTPRequest. Its called before a new request is made to the new url. In this callback the redirection can be disabled, or the request can be changed. +[Improvement] Updated BouncyCastle to the latest git version +[Improvement] When UseAlternateSSL is true, the client will send the hostname with the TLS handshake request to greatly improve HTTPS compatibility +[Improvement] More logging +[Bugfix] Fixed a case, when Socket.IO does not fall back to polling when the WebSocket transport fails to connect +[Bugfix] A possible NullRef exception when the request Timed Out + +1.7.8 (2015.03.25) +[Bugfix] Fixed compile error in UploadStream.cs +[Bugfix] Fixed compile errors on WP/WSA builds when used with JSON .NET For Unity (http://u3d.as/5q2) + +1.7.7 (2015.03.17) +[New Feature] Socket.IOs SocketOptions has two new property to control additional query parameters of the requests +[Improvement] New UploadStream.cs in the Examples folder to help and demonstrate uploading streams +[Bugfix] UploadStream upload not worked + +1.7.6 (2015.03.07) +[New Feature] New CustomCertificateVerifyer property to the HTTPRequest class to be able to set custom validator for the AlternateSSL handler too +[Improvement] Improved Unity5 compatibility + +1.7.5 (2015.03.02) +[New Feature] New Priority property in the HTTPRequest class to be able prioritize queued requests +[Improvement] Additional GC alloc improvements +[Bugfix] Fixed a possible crash in the plugin under iOS + +1.7.4 (2015.02.25) +[New Feature] New UploadStream property in the HTTPRequest class +[New Feature] New OnUploadProgress callback in the HTTPRequest class +[Improvement] Switched from System.Action usage to properly named delegates +[Improvement] Removed some GC allocs +[Bugfix] Fixed an example that tried to access an internal constant + +1.7.3 (2015.02.10) +[Improvement] Timeout improvement +[Improvement] Unity 5 compatibility fixes + +1.7.2 (2015.02.09) +[Improvement] Custom cookies can be added to a HTTPRequest. More on this in the documentation +[Improvement] Queued requests can be aborted too +[Improvement] GetGeneralStatistics function added to the HTTPManager. This function will return a GeneralStatistics struct that contains infromations about connections, cache and cookies. +[Improvement] HTTPRequests Callback can be set to a new value after the requests State is changed +[Improvement] New code samples with a demo-browser! Check it out live here: http://bit.ly/1AkM6gi +-Texture Download Sample +-Asset Bundle Download Sample +-Large File Download Sample +-WebSocket - Echo Sample +-Socket.IO - Chat Sample +-Socket.IO - WePlay Sample +-Cache Maintenance Sample + +1.7.1 (2015.02.03) +[Improvement] Greater compatibility with IL2CPP + +1.7.0 (2015.01.27) +General: +-[Improvement] Improved cache compatibility +-[Improvement] Improved proxy compatibility +-[Improvement] HTTPRequests Send function will return the request to be able to chain some functions +-[Improvement] Logger Added to the HTTPManager. Initially the Socket.IO implementation will use it. +-[Improvement] HTTPManagers MaxConnectionIdleTime lowered to 30 secs +-[Improvement] HTTPRanges ToString is overridden for quicker debugging +-[Improvement] HTTPRequests GetRange function will no longer throw a null exception when there is no content-range header. It will return with null. +-[Improvement] Removed uncessary exception logging in Directory platformsupport code +-[Improvement] Renamed Tree class to remove Unity warning +-[Bugfix] Internal buffer size for streaming set to the wrong value +WebSocket changes: +-[Improvement] Added some missing documentation +-[Improvement] Removed the need of a new thread to send automatic pings +-[Improvement] New Send function to send a portion of a byte array +Socket.IO +-[New Feature] Initial Socket.IO release compatible with the latest official Socket.IO implementation + +1.6.4 (2015.01.13) +[Bugfix] POSTs with no data now will set the correct Content-Length header +[Bugfix] Parallel POSTs to the same uri will no longer block each other + +1.6.3 (2014.12.22) +[Improvement] A global default proxy can be set through HTTPManager.Proxy instead of setting it per-request +[Improvement] Added new callback-less constructor to the HTTPRequest (thx to eedok) +[Improvement] Added some documentation +[Bugfix] The proper host:port value will be set to the Host header (thx to Matthew Boehlig) +[Bugfix] Removed accidentally added WP8.1 dependency + +1.6.2 (2014.11.19) +[Improvement] Native HTTPS support in WP8 and WinRT builds +[Improvement] Removed some compiler warnings in WP8/WinRT builds +[Improvement] Improved proxy compatibility +[Improvement] Non-transparent proxy connection response(status code, message and headers) can be accessed through the requests ProxyResponse property +[Improvements] Added Known Bugs/Limitations to the documentation +[Bugfix] HTTPManager.MaxConnectionPerServer will be handled correctly with proxies +[Bugfix] Idle free connection will be removed correctly + +1.6.1 (2014.11.09) +[Bugfix] WebPlayer build failed to connect to the server +[Bugfix] Two HTTPRequest states(Aborted and Error) unintentionally swapped, now they are back as supposed +[Bugfix] Proxy header handling improvement +[Improvement] More documentation + +1.6.0 (2014.11.01) +[New Feature] Windows Store Apps support added +[Bugfix] Minor bugfixes + +1.5.1 (2014.10.21) +[Improvement] Added global ConnectTimeout and RequestTimeout properties to the HTTPManager +[Improvement] Added documentation about the new features +[Bugfix] multipart/form-data now sends the corrent line endings + +1.5.0 (2014.10.18) +[Improvement] ConnectionTimeout added to the HTTPRequest class to maximize the wait time to connect to the server. +[Improvement] TimeOut added to the HTTPRequest class to maximize the wait time to finish a request. +[Improvement] Updated BouncyCastle. +[Improvement] Rewrote the WP8 TcpClient implementation +[Improvement] Custom certification validation can be added to a HTTPRequest on iOS, Android and Desktop builds by setting the CustomCertificationValidator event. +[BugFix] Fixed handling of an empty form data. + +1.4.3 (2014.09.01) +[Bug Fix] Various bug fixes around redirection + +1.4.2 (2014.09.01) +[Bug Fix] Fixed a bug that intruduced in 1.4.0 that prevented a WebSocket connection to connect to the host in a WebPlayer build +[Improvement] Host header can be set now without overridden by the plugin +[Improvement] Improved thread safety. Now sending requests on multiple threads are safe too. + +1.4.0 (2014.08.19) +[BugFix] Form sending doesnt handled correctly in some cases +[Improvement] Rewrote form sending. Now correctly supports Url-Encoded and Multipart forms +[New Feature] Download aborting. An ongoing download can be aborted now through a HTTPRequest objects Abort() function +[New Feature] New HTTPRequestStates enum and State property in the HTTPRequest class to be able to check the current state of the request + +1.3.7 (2014.08.03) +[BugFix] In some situations a WebSocket length read incorrectly +[New Feature] HTTPRequest can be used with yield return +[New Feature] Install script to circumvent manual folder moving +[Improvement] Improved link.xml + +1.3.6 (2014.06.20) +[Imp] Added some more inline ducumentation +[Imp] Cookie parsing improvement if Path missing +[Bugfix] Digest authentication missing "opaque=" + +1.3.5 (2014.06.15) +[Improvement] Unknown Content-Encoding will be treated as identity +[Improvement] Better WebSocket error handling +[Improvement] Actualized examples +[Improvement] link.xml in the package in case of stripping error +[BugFix] Fixed WebSocket big frame reading error + +1.3.x (2014.05.04) +[New Feature] New OnProgress event in the HTTPRequest class to be able to track the download progress. + +1.3.1 (2014.04.02) +[Improvement] Improved compatibility with Good ol' Sockets + +1.3.0 (2014.03.30) +[New Feature] Transparent and Tunnel Proxy support with untested proxy authentication +[New Feature] Cookie support! It will automatically handles all cookie sending and receiving, no additional code required! +[Improvement] Handling a rare case when the server doesnt sent Content-Length header in a regular non-chunked response +[Improvement] Default User-Agent added +[Bugfix] WP8 - fixed a case where reading back a response failed + +1.2.3 (2014.01.06) +[Improvement] WebSocket - Improvements around sending large text messages + +1.2.2 (2014.01.05) +[Improvement] WebSocket - Fragmented messages compatibility improvement +[Improvement] WebSocket - New property in the WebSocketResponse class to control the maximum size of a fragments payload data (MaxFragmentSize). + +1.2.1: (pro only) +[Improvement] Ability to handle DHE_RSA_WITH_AES_256 certificates if UseAlternateSSL is set to true on a HTTPRequest object. + +1.2.0 (2013.11.05) +[New Feature] WebSockets + +1.1.5 (2013.10.02) +[New Feature] Basic and Digest authentication support through a new Credentials property in the HTTPRequest class +[Improvement] More then one redirection supported for a single request +[Improvement] New MaxRedirects property in the HTTPRequest class +[Improvement] New GetFirstHeaderValue(string headerName) function in the HTTPRequest class +[Improvement] New optimized parsers, for now only used for parsing the authentication header +[Improvement] Some code cleanup +[Bugfix] In some cases after sending the request and not receiving any data caused a new reconnect +[Bugfix] Some caching proxies return with float values in Max-Age header + +1.1.4 (2013.09.15) +[New Feature] Unity 3.5 support added. +[New Feature] WebPlayer support added. +[Improvement] POST request doesn't retry the request when downloading/parsing the response fails. If something goes bad, the request object's Exception property will hold the exception (as always). +[Improvement] There is a new property called DisableRetry to disable resending the request if downloading/parsing the response fails. The default value is true if the request's MethodType is POST, otherwise false. +[Improvement] There is new property called RawData to send data in a POST request without setting any fields. If RawData is set any field that added through AddField, AddBinaryData, SetFields to the request will be ignored. \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/ReleaseNotes.txt.meta b/JNFrame/Assets/Plugins/BestHTTP/ReleaseNotes.txt.meta new file mode 100644 index 00000000..bf5e3424 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/ReleaseNotes.txt.meta @@ -0,0 +1,38 @@ +fileFormatVersion: 2 +guid: fe366785ac6802f418654b21d3d4e972 +labels: +- http +- www +- web +- cache +- stream +- wp8 +- wsa +- metro +- rest +- api +- socket +- socket.io +- websocket +- websockets +- cookie +- proxy +- il2cpp +- android +- tcp +- https +- ios +- webrequest +- signalr +- eventsource +- server-sent +- events +- server-sentevents +- authentication +- samsung +- smart +- tv +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - Editor.csproj b/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - Editor.csproj new file mode 100644 index 00000000..e38127c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - Editor.csproj @@ -0,0 +1,67 @@ + + + + + Release + AnyCPU + {ECCE81DF-0B2C-4DA7-9A8E-D8FBE4C9E91A} + Library + Properties + BestHTTP + BestHTTP + v3.5 + 512 + + + + pdbonly + true + Plugins\Editor\ + TRACE;BESTHTTP_DISABLE_UNITY_FORM;UNITY_EDITOR + prompt + 4 + Plugins\Editor\BestHTTP.XML + 1591 + + + true + full + false + Plugins\Editor\ + DEBUG;TRACE;BESTHTTP_DISABLE_UNITY_FORM;UNITY_EDITOR + prompt + 4 + + + + + + + ..\..\..\..\..\Program Files\Unity 2017.2\Editor\Data\Managed\UnityEditor.dll + False + + + ..\..\..\..\..\Program Files\Unity 2017.2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + False + + + ..\..\..\..\..\Program Files\Unity 2017.2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + False + + + ..\..\..\..\..\Program Files\Unity 2017.2\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + False + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - Editor.csproj.meta b/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - Editor.csproj.meta new file mode 100644 index 00000000..2cd3b0f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - Editor.csproj.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3dff95aad8aa1714f9a63beb65eecdd1 +timeCreated: 1523773778 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - UWP.csproj b/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - UWP.csproj new file mode 100644 index 00000000..401d67b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - UWP.csproj @@ -0,0 +1,71 @@ + + + + + 12.0 + Debug + AnyCPU + {A5D5947F-42F4-4633-B4E2-B5F1522C7ACF} + Library + Properties + BestHTTP + BestHTTP + en-US + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile32 + v4.6 + + + pdbonly + true + Plugins\WSA\ + TRACE;NETFX_CORE;UNITY_METRO;UNITY_WSA;BESTHTTP_DISABLE_UNITY_FORM + prompt + 4 + Plugins\WSA\BestHTTP.XML + 1591 + + + true + full + false + Plugins\WSA\ + TRACE;DEBUG;NETFX_CORE;UNITY_METRO;UNITY_WSA;BESTHTTP_DISABLE_UNITY_FORM + prompt + 4 + + + + + + + + + + + ..\..\..\..\..\Program Files\Unity 2017.2\Editor\Data\PlaybackEngines\MetroSupport\Managed\UAP\UnityEngine.dll + False + + + ..\..\..\..\..\Program Files\Unity 2017.2\Editor\Data\PlaybackEngines\MetroSupport\Managed\UAP\UnityEngine.CoreModule.dll + False + + + ..\..\..\..\..\Program Files\Unity 2017.2\Editor\Data\PlaybackEngines\MetroSupport\Managed\UAP\UnityEngine.ImageConversionModule.dll + False + + + ..\..\..\..\..\Program Files\Unity 2017.2\Editor\Data\PlaybackEngines\MetroSupport\Managed\UAP\WinRTLegacy.dll + False + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - UWP.csproj.meta b/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - UWP.csproj.meta new file mode 100644 index 00000000..c9151e8b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 2017.2 and up - UWP.csproj.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 02196b990df06b642926439dc75d6e54 +timeCreated: 1523771701 +licenseType: Store +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - Editor.csproj b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - Editor.csproj new file mode 100644 index 00000000..9cf94652 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - Editor.csproj @@ -0,0 +1,62 @@ + + + + + Release + AnyCPU + {ECCE81DF-0B2C-4DA7-9A8E-D8FBE4C9E91A} + Library + Properties + BestHTTP + BestHTTP + v3.5 + 512 + + + + + pdbonly + true + Plugins\Editor\ + TRACE;BESTHTTP_DISABLE_UNITY_FORM;UNITY_EDITOR + prompt + 4 + Plugins\Editor\BestHTTP.XML + 1591 + + + + true + full + false + Plugins\Editor\ + DEBUG;TRACE;BESTHTTP_DISABLE_UNITY_FORM;UNITY_EDITOR + prompt + 4 + + + + + + + + ..\..\..\..\..\Program Files\Unity 5.1\Editor\Data\Managed\UnityEngine.dll + False + + + ..\..\..\..\..\Program Files\Unity 5.1\Editor\Data\Managed\UnityEditor.dll + False + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - Editor.csproj.meta b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - Editor.csproj.meta new file mode 100644 index 00000000..f8df6f50 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - Editor.csproj.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 11c82f406762a3842b5edee2b83f1916 +timeCreated: 1523773778 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - General.csproj b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - General.csproj new file mode 100644 index 00000000..36095bf2 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - General.csproj @@ -0,0 +1,58 @@ + + + + + Release + AnyCPU + {87475AAD-962E-4BD7-93CF-6C9CBF3128F5} + Library + Properties + BestHTTP + BestHTTP + v3.5 + 512 + + + + + pdbonly + true + Plugins\ + TRACE;BESTHTTP_DISABLE_UNITY_FORM + prompt + 4 + Plugins\BestHTTP.XML + 1591 + + + + true + full + false + Plugins\ + DEBUG;TRACE;BESTHTTP_DISABLE_UNITY_FORM + prompt + 4 + + + + + + + + ..\..\..\..\..\Program Files\Unity 5.1\Editor\Data\Managed\UnityEngine.dll + False + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - General.csproj.meta b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - General.csproj.meta new file mode 100644 index 00000000..945e5a3a --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - General.csproj.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1e0079ac594f4ff419a323c142b3bea9 +timeCreated: 1523773778 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - UWP.csproj b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - UWP.csproj new file mode 100644 index 00000000..f96e87fd --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - UWP.csproj @@ -0,0 +1,69 @@ + + + + + 12.0 + Debug + AnyCPU + {E37F457D-2037-4CB8-BE7E-8E0221C754EA} + Library + Properties + BestHTTP + BestHTTP + en-US + 512 + {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Profile32 + v4.6 + + + + pdbonly + true + Plugins\WSA\ + TRACE;NETFX_CORE;UNITY_METRO;UNITY_WSA;BESTHTTP_DISABLE_UNITY_FORM + prompt + 4 + Plugins\WSA\BestHTTP.XML + 1591 + + + + true + full + false + Plugins\WSA\ + TRACE;DEBUG;NETFX_CORE;UNITY_METRO;UNITY_WSA;BESTHTTP_DISABLE_UNITY_FORM + prompt + 4 + + + + + + + + + + + + + + ..\..\..\..\..\Program Files\Unity 5.1\Editor\Data\PlaybackEngines\metrosupport\Managed\UnityEngine.dll + False + + + ..\..\..\..\Program Files\Unity 5.1\Editor\Data\PlaybackEngines\metrosupport\Managed\WinRTLegacy.dll + False + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - UWP.csproj.meta b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - UWP.csproj.meta new file mode 100644 index 00000000..c86c6781 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - UWP.csproj.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce8ec2ceeba19f7488c66865724f75a4 +timeCreated: 1523773778 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - WebGL.csproj b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - WebGL.csproj new file mode 100644 index 00000000..bece4b70 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - WebGL.csproj @@ -0,0 +1,58 @@ + + + + + Release + AnyCPU + {06EB6705-927A-48C6-846F-C8F012FB5E80} + Library + Properties + BestHTTP + BestHTTP + v3.5 + 512 + + + + + pdbonly + true + Plugins\WebGL\ + TRACE;BESTHTTP_DISABLE_UNITY_FORM;UNITY_WEBGL + prompt + 4 + Plugins\WebGL\BestHTTP.XML + 1591 + + + + true + full + false + Plugins\WebGL\ + DEBUG;TRACE;BESTHTTP_DISABLE_UNITY_FORM;UNITY_WEBGL + prompt + 4 + + + + + + + + ..\..\..\..\..\Program Files\Unity 5.1\Editor\Data\Managed\UnityEngine.dll + False + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - WebGL.csproj.meta b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - WebGL.csproj.meta new file mode 100644 index 00000000..7dd8db3b --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/Unity 5.x and up - WebGL.csproj.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b6778a8babcdfad48a043ac6fdb2800f +timeCreated: 1523773778 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/license.txt b/JNFrame/Assets/Plugins/BestHTTP/license.txt new file mode 100644 index 00000000..6fa30884 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/license.txt @@ -0,0 +1,154 @@ +Asset Store End User License Agreement +1. Parties to the Agreement/The Subject Matter of the Agreement: +1.1 +This Unity Asset Store End User License Agreement (“EULA”) is a non-exclusive, legally binding end user license agreement between any individual or a single entity (“END-USER”) that acquires a license to an Asset from the Unity Asset Store and either (a) Unity Technologies ApS (company no. 30 71 99 13), Lovstraede 5, DK-1152 Copenhagen K, Denmark (“Licensor” or "Unity"); or, as the case may be (b) any third party (“Provider”) that distributes its Assets from the Unity Asset Store. Consequently, this EULA shall apply regardless of whether a purchased Asset is produced by Unity or by a Provider ("Licensor"). This EULA is therefore a non-exclusive, legally binding end user license agreement as the case may be between either (i) Unity and END-USER (in which case the term "Licensor" shall refer to Unity), or (ii) Provider and END-USER (in which case the term "Licensor" shall refer to Provider). + +1.2 +By installing, copying, accessing, downloading or otherwise using the Assets, END-USER agrees to be bound the provisions of this EULA. All definitions of the Terms shall also apply in this EULA unless the context clearly provides for a different understanding. + +1.3 +The subject matter of this EULA is the licensing to END-USER of any Assets from Licensor via the Unity Asset Store. The Assets are licensed, not sold. + +1.4 +END USER hereby acknowledges that in the event it acquires a license to an ASSET which in the Unity Asset Store is marked as an Asset which is distributed by Provider (as opposed to Unity), then Provider shall be considered as Licensor of such Asset and, consequently, only Provider (as opposed to Unity) shall be responsible for any liability whatsoever under, any EULA or any breach by Provider, including (without limitation) liability for infringement of any intellectual property rights, irrespective of the fact that payment takes place to Unity. + +2. END-USER's Rights and Obligations +2.1 +END-USER may use the licensed Assets only for their intended purpose. + +2.2 +2.2.1 Non-Restricted Assets. The following concerns only Assets that are not Restricted Assets: Licensor grants to the END-USER a non-exclusive, worldwide, and perpetual license to the Asset to integrate it only as incorporated and embedded components of electronic games and digital media and distribute such electronic game and digital media; reproduction and display in distributed physical advertising materials is permitted solely for marketing purposes in respect of such electronic games or digital media. Except for game services software development kits (“Services SDKs”), END-USERS may modify Assets. END-USER may otherwise not reproduce, publicly display, publicly perform, transmit, distribute, sublicense, rent, lease or lend the Assets. It is emphasized that the END-USERS shall not be entitled to distribute or transfer in any way (including, without, limitation by way of sublicense) the Assets in any other way than as integrated components of electronic games and digital media or in supporting physical marketing materials. Without limitation of the foregoing it is emphasized that END-USER shall not be entitled to share the costs related to purchasing an Asset and then let any third party that has contributed to such purchase use such Asset (forum pooling). + +2.2.2 Restricted Assets. The following concerns only Restricted Assets: Restricted Assets have license terms different from other Assets. Those license terms are found in the materials accompanying Restricted Assets ("Restricted Asset Terms"). For clarity, to the extent Restricted Asset Terms are different from this EULA, the Restricted Asset Terms will control; otherwise, this EULA will continue to apply. No other use is licensed or permitted and END-USER may otherwise not use, reproduce, publicly display, publicly perform, transmit, distribute, sublicense, rent, lease or lend Restricted Assets. Without limitation of the foregoing it is emphasized that END-USER shall not be entitled to share the costs related to purchasing a Restricted Asset and then let any third party that has contributed to such purchase use such Restricted Asset (forum pooling). + +2.3 +2.3.1 EXCEPT FOR EDITOR EXTENSION OR APPLICATION ASSETS, END-USER is granted a license to install and use Assets on an unlimited number of computers provided that these computers are either all (a) physically located at a single physical location ("Site") belonging to END-USER, or (b) laptops belonging to END-USER which have been made available by END-USER to its employees that are employed at the same Site provided all such computers have appropriately licensed Unity software installed. Consequently, any Asset may only be used at particular Site or on computers assigned to END-USER's employees employed at the same Site and may only be moved to another Site subject to prior written approval from Licensor. THIS SECTION 2.3.1 DOES NOT APPLY TO ASSETS THAT IN THE UNITY ASSET STORE ARE CATEGORIZED UNDER THE HEADING "EDITOR EXTENSIONS" OR “APPLICATIONS”. + +2.3.2 Editor Extensions; Applications: END-USER is granted a single seat license to install and use any Asset categorized in the Asset Store as "Editor Extensions" or “Application” only on a maximum of 2 computers. For the avoidance of doubt, Editor Extension and Application Assets are licensed on a per seat basis may not be shared or used concurrently on more than 2 different computers. As an exception, build farm servers and virtual machine instances used only for running, testing, or building projects with Editor Extension or Application Assets do not require separate seat license(s) or constitute use on more than 2 different computers. + +2.4 +An END-USER may use an Asset under SECTIONS 2.2 and 2.3, and may have a third party, including any “work-for-hire” contractor or “freelancer” (“Contractor”), work on that Asset on its behalf. However, any Contractor working on a project for an END-USER must have license(s) of its own to the Asset. Conversely, to use an Asset under SECTIONS 2.2 and 2.3, a person must have its own license to the Asset, regardless of whether a Contractor working on a project for that person had its own license to that Asset. For example, a person who is a Contractor must have a seat license for an Editor Extension Asset, and the persons who is hirer of the Contractor must have a seat license for that Editor Extension Asset. + +2.5 +Game Services SDKs: If END-USER downloads and integrates Services SDKs, END-USER may be required to accept a Licensor end user agreement and/or additional Licensor terms and conditions to use such services. + +2.6 +END-USER shall pay for the license to the Assets in accordance with the payment process provided in the Asset Store. END USER shall provide customary billing and tax information such as name, billing address, credit card information and VAT number (for EU residents). END USER agrees to pay for all purchases hereby authorizes the collection of such amounts including applicable taxes by charging the credit card provided, either directly by Unity or indirectly, via a third party online payment processor. VAT numbers cannot be added or changed after the purchase is completed. If you are directed to a third party payment processor, you may be subject to terms and conditions governing use of that third party’s service and that third party’s Privacy Policy. Please review such third party’s terms and conditions and privacy policy before using the services. + +2.7 +Some components of Assets (whether developed by Unity or third parties) may also be governed by applicable open source software licenses. In the event of a conflict between the applicable EULA and any such open source licenses, the open source software licenses shall prevail with respect to those components. + +2.8 +You agree that no modification or use of those Assets shall (a) infringe, misappropriate, or violate a third party’s patent, copyright, trademark, trade secret, moral rights, or other intellectual property rights, or rights of publicity or privacy; (b) violate, or encourage any conduct that would violate, any applicable law or regulation or would give rise to liability of any kind; (c) be fraudulent, false, misleading, or deceptive; (d) be defamatory, obscene, pornographic, vulgar, or offensive; (e) promote discrimination, bigotry, racism, hatred, harassment, or harm against any individual or group; (f) promote violence or actions that are threatening to any other person; or (g) promote illegal or harmful activities or substances. + +2.9 +2.9.1 All sales are final and there shall be no refunds except as expressly provided in this EULA or as required by law. + +2.9.2 On acceptance of END-USER orders for licenses to Assets, content will be immediately available for download. END-USERS expressly consent to the making available of that content immediately upon acceptance of orders. If END-USER is a resident of the European Union and purchases any license to any Asset, the right to withdraw from such purchase within 14 days of the date of purchase ("Cooling Off Period") may be available; however, this right of withdrawal will not apply where performance begins before the end of the Cooling Off Period. Therefore, END-USERS expressly agree and understand that if END-USER orders any license to any Asset, END-USER’s right of withdrawal is forfeited upon acceptance as performance begins immediately on acceptance. + +2.9.3 You may request a refund from a Provider in the following circumstances: + + (a) within 2 weeks of purchase of a license to an Asset where, + +(i) the Asset was not as advertised (including any demo made available); + +(ii) the Asset is not compatible with the most recent official release of Unity and no information was provided at the Unity Asset Store to indicate that Asset is so incompatible; or + +(iii) the Asset includes unauthorized intellectual property. + + (b) the Asset is removed from the Unity Asset Store within 4 weeks of purchase of a license to an Asset and, + + (i) the Provider caused the removal; or + + (ii) Unity removed the Asset because it is or is alleged to be defective, malicious, infringes intellectual property rights of another person, defames, violates a third party's right of publicity or privacy, or does not comply with applicable law. + +2.10 +In this EULA, “Restricted Asset” means any Asset licensed hereunder that is designated (on prior written approval from Unity) as a “Restricted Asset” in any materials accompanying the Asset. + +3. Licensor’s Rights and Obligations +3.1 +Licensor shall render support services to END-USER only in the event a special agreement to this effect has been entered into. + +4. Termination +4.1 +Without prejudice to any other rights, Licensor may terminate this EULA if END-USER fails to comply with the terms and conditions of this EULA and the Terms. + +4.2 +END-USER may terminate END-USER’s license at any time. + +4.3 +In the event that Unity at its discretion or as a result of a decision made by any competent court or authority makes a refund to END-USER of the fees paid for any Asset, then this EULA shall terminate for such Asset. + +4.4 +In the event of termination of this EULA, all license rights granted herein terminate and END-USER shall immediately destroy any and all copies of the Assets contained on any type of media under the control of END-USER and confirm such destruction in writing to LICENSOR. + +5. Duplication Rights/Back Up Copy +5.1 +END-USER may not make copies of the Assets, except incidental transient or temporary copies or otherwise to the extent that such activity is expressly permitted under mandatory statutory applicable law. In addition, Licensor acknowledges that copies of the Assets may be made when the Assets have been integrated as components of electronic games and digital media as permitted hereunder. + +5.2 +After installation of one copy of the Asset pursuant to this EULA, END USER may keep the original copy of the Asset solely for back-up or archival purposes. + +6. Reverse Engineering, Decompilation, and Disassembly +Except for Services SDKs, END USER may modify Assets. END USER shall not reverse engineer, decompile, or disassemble Services SDKs, except and only to the extent that such activity is expressly permitted under mandatory statutory applicable law. + +7. Trademarks +This EULA does not grant END-USER any rights in connection with any trademarks or service marks of Licensor, Provider or Licensor's other suppliers. + +8. Upgrades and Support +8.1 +Assets identified as upgrades replace and/or supplement the licensed Assets. + +8.2 +Licensor may at its own discretion from time to time provide upgrades of the Assets to END USER without requesting further payment. Irrespective hereof END-USER is only entitled to licenses to upgrades if END-USER has entered into an Upgrade Agreement with Licensor. END-USER may use the upgraded Assets only in accordance with the terms of this EULA. + +8.3 +END-USER is only entitled to support if END-USER has entered into a Support Agreement with Licensor. + +9. Intellectual Property +9.1 +The Assets are protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. + +9.2 +All title and intellectual property rights in and to the Assets (including but not limited to any software, images, photographs, animations, graphics, 3D graphics, video, audio, music, text, tutorials, and “applets” incorporated into the Assets), the accompanying printed materials, and any copies of the Assets are owned by Licensor. All rights not expressly granted are reserved by Licensor. For greater certainty and without limitation of the foregoing, use of Assets, whether modified as permitted hereunder or unmodified, is limited to use as expressly provided in this EULA. + +10. Disclaimer of Warranties +10.1 +END-USER UNDERSTANDS AND ACCEPTS THAT PRIOR TO PLACING ANY ASSET ON THE UNITY ASSET STORE, UNITY DOES NOT UNDERTAKE ANY LEGAL OBLIGATION TO MONITOR, PRE-SCREEN, REVIEW, FLAG, FILTER, MODIFY, REFUSE OR REMOVE ANY ASSET OR THEIR CONTENT FROM THE UNITY ASSET STORE. CONSEQUENTLY, END-USER EXPRESSLY UNDERSTANDS AND AGREES THAT ITS USE OF THE ASSETS IS AT END-USER'S SOLE RISK AND THAT THE ASSETS ARE PROVIDED “AS IS” AND “AS AVAILABLE” WITHOUT WARRANTY OF ANY KIND, TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW. IN PARTICULAR, LICENSOR, ITS SUBSIDIARIES, HOLDING COMPANIES AND AFFILIATES, AND ITS LICENSORS DO NOT REPRESENT OR WARRANT TO END-USER THAT: (A) END-USER'S USE OF THE ASSETS WILL MEET END-USER'S REQUIREMENTS, (B) END-USER'S USE OF THE ASSETS WILL BE UNINTERRUPTED, TIMELY, SECURE OR FREE FROM ERROR, (C) ANY INFORMATION OBTAINED BY END-USER AS A RESULT OF END-USER'S USE OF THE ASSETS WILL BE ACCURATE OR RELIABLE, AND (D) THAT DEFECTS IN THE OPERATION OR FUNCTIONALITY OF ANY SOFTWARE PROVIDED TO END-USER AS PART OF THE ASSETS WILL BE CORRECTED. + +10.2 +END-USER'S USE OF ANY ASSETS IS AT END-USER'S OWN DISCRETION AND RISK AND END-USER IS SOLELY RESPONSIBLE FOR ANY DAMAGE TO END-USER'S COMPUTER SYSTEM, OR OTHER DEVICE, OR LOSS OF DATA THAT RESULTS FROM SUCH USE. + +10.3 +TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES TERMS OR CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO ANY IMPLIED WARRANTIES TERMS AND CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT, WITH RESPECT TO ANY ASSETS. + +10.4 +NONE OF THE ASSETS IS INTENDED FOR USE IN THE OPERATION OF NUCLEAR FACILITIES, LIFE SUPPORT SYSTEMS, EMERGENCY COMMUNICATIONS, AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL SYSTEMS, OR ANY OTHER SUCH ACTIVITIES IN WHICH CASE THE FAILURE OF THE ASSETS COULD LEAD TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE. + +11. Limitation of Liability; Limited Defense/Indemnity +11.1 +SUBJECT TO THIS SECTION 11, LICENSOR AND ITS SUBSIDIARIES, HOLDING COMPANIES AND OTHER AFFILIATES TOTAL LIABILITY TO END-USER FROM ALL CAUSES OF ACTION AND UNDER ALL THEORIES OF LIABILITY UNDER THESE TERMS, INCLUDING WITHOUT LIMITATION ANY LIABILITY FOR DIRECT OR INDIRECT DAMAGES, LOSSES, OR INJURIES AND ANY LIABILITY UNDER SECTION 11.3.2.3, WILL BE LIMITED TO THE AMOUNTS PAID TO LICENSOR BY END-USER IN THE PAST SIX MONTHS FOR THE LICENSE TO THE ASSETS RELATING TO THE DISPUTE; SUBJECT TO THIS SECTION 11, IN NO EVENT WILL LICENSOR OR ITS SUBSIDIARIES, HOLDING COMPANIES AND OTHER AFFILIATES BE LIABLE TO END-USER FOR ANY SPECIAL, INCIDENTAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING LOSS OF DATA, BUSINESS, PROFITS OR ABILITY TO EXECUTE) OR FOR THE COST OF PROCURING SUBSTITUTE PRODUCTS ARISING OUT OF OR IN CONNECTION WITH THESE TERMS OR YOUR USE OF THE ASSET STORE OR ANY ASSETS LICENSED, DOWNLOADED OR OTHERWISE OBTAINED FROM THE UNITY ASSET STORE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON CONTRACT, INDEMNITY, WARRANTY, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, AND WHETHER OR NOT LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE. THE FOREGOING LIMITATIONS WILL SURVIVE AND APPLY EVEN IF ANY LIMITED REMEDY SPECIFIED IN THIS AGREEMENT IS FOUND TO HAVE FAILED OF ITS ESSENTIAL PURPOSE. + +11.2 +SUBJECT TO THIS SECTION 11, END-USER EXPRESSLY UNDERSTAND AND AGREE THAT LICENSOR, ITS SUBSIDIARIES, HOLDING COMPANIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO END-USER FOR ANY LOSS OR DAMAGE WHICH MAY BE INCURRED BY END-USER, INCLUDING BUT NOT LIMITED TO LOSS OR DAMAGE AS A RESULT OF (A) ANY RELIANCE PLACED BY END-USER ON THE COMPLETENESS, ACCURACY OR EXISTENCE OF ANY ADVERTISING, OR AS A RESULT OF ANY RELATIONSHIP OR TRANSACTION BETWEEN END-USER AND LICENSOR OR ANY, DEVELOPER, ADVERTISER OR SPONSOR WHOSE ADVERTISING APPEARS IN THE ASSETS OR ON THE UNITY ASSET STORE; (B) ANY CHANGES WHICH LICENSOR MAY MAKE TO THE ASSETS OR ON THE UNITY ASSET STORE, OR FOR ANY PERMANENT OR TEMPORARY CESSATION IN THE PROVISION OF THE UNITY ASSET STORE OR THE ASSETS (OR ANY FEATURES WITHIN THE ASSETS); (C) THE DELETION OF, CORRUPTION OF, OR FAILURE TO STORE, ANY CONTENT AND OTHER COMMUNICATIONS DATA MAINTAINED OR TRANSMITTED BY OR THROUGH END-USER'S USE OF THE ASSETS; OR (D) END-USER'S FAILURE TO PROVIDE UNITY WITH ACCURATE ACCOUNT INFORMATION; + +11.3 +11.3.1 Nothing in this EULA excludes the liability for Licensor, its subsidiaries or affiliates for (a) death and personal injury caused by negligence; (b) fraudulent misrepresentation; or (c) any other liability which cannot be limited by applicable law. + +11.3.2 In respect of Assets whose license is offered for any obligatory fee, charge, or price (“Paid Assets”), Licensor agrees to the limited obligation of defense and indemnity of this Section 11.3.2. + +11.3.2.1 Subject to Sections 11.3.2.2 and 11.3.2.3, Licensor will defend END-USER from claims arising out of or in connection with any claim that a Paid Asset infringes any third-party rights of copyright or of trademark, provided that this will not apply to the extent any such claim is predicated on (a) any changes or modifications of the Paid Asset by anyone other than the Licensor; (b) any changes or modifications of the Paid Asset by Licensor at the request of END-USER; (c) any combination or incorporation of the Paid Asset with any other software, media, or thing; or (d) any breach or failure to meet the obligations of this EULA by END-USER. + +11.3.2.2 In order to claim an obligation of defense under the preceding Section 11.3.2.1, END-USER must (a) inform the Licensor in writing of the existence of the claim within 10 days of it coming to END-USER’s attention; and (b) give the Licensor sole right to control the defense or settlement of the claim, provided that END-USER will have the right to approve of any proposed settlement in which there is any admission of any kind by END-USER, such approval not to be unreasonably withheld, conditioned, or delayed. END-USER will, at its expense, provide Licensor with reasonable co-operation in Licensor’s defense of the claim. Notwithstanding the foregoing, END-USER may, at its expense, participate in the defense of the claim with separate counsel of its own choosing. + +11.3.2.3 Where a claim under Section 11.3.2.1 has been either defended by Licensor or may have been defended by Licensor and ends in a final judgment/order of a court of competent jurisdiction from which no appeal is possible or in a final, binding settlement, Licensor will pay the monetary award of damages against END-USER under that final judgment/order or the monies to be paid by END-USER pursuant to the final, binding settlement; provided, however, that the obligation to pay shall (a) only be to the extent commensurate with the infringement which Licensor is obligated to defend against under Section + +11.3.2.1; and (b) be nonetheless limited by and subject to the limitation of liability provided in Section 11.1. + + + +12. Export Restrictions +Assets available on the Unity Asset Store may be subject to laws, administrative regulations and executive orders of those authorities responsible according to any applicable laws relating to the control of imports and exports of the Assets (“Export Laws”). You agree to comply with all applicable Export Laws and you shall not export or re-export directly or indirectly (including via remote access) any part of the Assets to any country to which a license is required under the Export Laws without first obtaining a license. + +13. Venue and Applicable Law +This EULA and END-USER's relationship with Licensor under this EULA, shall be governed by the laws of Denmark without regard to its conflict of laws provisions. Any dispute arising out of or in connection with this Agreement, including any disputes regarding the existence, validity or termination thereof, shall be settled by simplified arbitration arranged by The Danish Institute of Arbitration in accordance with the rules of simplified arbitration procedure adopted by The Danish Institute of Arbitration and in force at the time when such proceedings are commenced. Notwithstanding this, Provider agrees that Licensor shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/license.txt.meta b/JNFrame/Assets/Plugins/BestHTTP/license.txt.meta new file mode 100644 index 00000000..30a41c59 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/license.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d3b503aff0a21bf4db6cd58a4538485a +timeCreated: 1518595425 +licenseType: Store +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/link.xml b/JNFrame/Assets/Plugins/BestHTTP/link.xml new file mode 100644 index 00000000..18b0f09e --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/link.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/link.xml.meta b/JNFrame/Assets/Plugins/BestHTTP/link.xml.meta new file mode 100644 index 00000000..52243c09 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/link.xml.meta @@ -0,0 +1,38 @@ +fileFormatVersion: 2 +guid: ddecb9df09ed71446ba7ca31ced7e9a5 +labels: +- http +- www +- web +- cache +- stream +- wp8 +- wsa +- metro +- rest +- api +- socket +- socket.io +- websocket +- websockets +- cookie +- proxy +- il2cpp +- android +- tcp +- https +- ios +- webrequest +- signalr +- eventsource +- server-sent +- events +- server-sentevents +- authentication +- samsung +- smart +- tv +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/BestHTTP/link_android_subset.xml b/JNFrame/Assets/Plugins/BestHTTP/link_android_subset.xml new file mode 100644 index 00000000..78abf272 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/link_android_subset.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/BestHTTP/link_android_subset.xml.meta b/JNFrame/Assets/Plugins/BestHTTP/link_android_subset.xml.meta new file mode 100644 index 00000000..281b7615 --- /dev/null +++ b/JNFrame/Assets/Plugins/BestHTTP/link_android_subset.xml.meta @@ -0,0 +1,6 @@ +fileFormatVersion: 2 +guid: e735d6733fbcd8f46a2dbc2de051f0ce +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame.meta b/JNFrame/Assets/Plugins/JNGame.meta new file mode 100644 index 00000000..ad890eea --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 877b2c97c22c654488ca8ed63a2fa37d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/JNGame.cs b/JNFrame/Assets/Plugins/JNGame/JNGame.cs new file mode 100644 index 00000000..6a66d28f --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/JNGame.cs @@ -0,0 +1,18 @@ +using System; +using Cysharp.Threading.Tasks; +using Plugins.JNGame.System; +using UnityEngine; + +namespace Plugins.JNGame +{ + public static class JNGame + { + public static async UniTask Init(SystemBase[] systems) + { + foreach (var system in systems) + { + await system.OnInit(); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/JNGame.cs.meta b/JNFrame/Assets/Plugins/JNGame/JNGame.cs.meta new file mode 100644 index 00000000..9e73c51c --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/JNGame.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: dcd3abba65d143d6ae94ae99517e52d8 +timeCreated: 1705993958 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/NSystem.cs b/JNFrame/Assets/Plugins/JNGame/NSystem.cs new file mode 100644 index 00000000..d72c7030 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/NSystem.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace Plugins.JNGame +{ + public static class NSystem + { + public static void Log(string log) + { + Debug.Log($"[JNGame] {log}"); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/NSystem.cs.meta b/JNFrame/Assets/Plugins/JNGame/NSystem.cs.meta new file mode 100644 index 00000000..548f1fe6 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/NSystem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4bcab7eba2d54139b1aced9ee532b8e6 +timeCreated: 1705992865 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Network.meta b/JNFrame/Assets/Plugins/JNGame/Network.meta new file mode 100644 index 00000000..a14a7fa3 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fc18c90e1c59ed041afa7ffa5030ba23 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Action.meta b/JNFrame/Assets/Plugins/JNGame/Network/Action.meta new file mode 100644 index 00000000..70d317ce --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Action.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: dd0b2e123a2647faa14dc3c101cb9924 +timeCreated: 1706264437 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Action/NActionEnum.cs b/JNFrame/Assets/Plugins/JNGame/Network/Action/NActionEnum.cs new file mode 100644 index 00000000..2eb5e31e --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Action/NActionEnum.cs @@ -0,0 +1,15 @@ +namespace Plugins.JNGame.Network.Action +{ + public enum NActionEnum + { + Ping = 1, //PING + NActionDemo = 2, //Demo 消息 + NActionDemo2 = 3, //Demo 消息 + + NSyncFrameStart = 100, //帧同步开始 + NSyncFrameEnd = 101, //帧同步结束 + NSyncFrameBack = 102, //帧同步回调 + NSyncFrameInput = 103, //帧同步输入 + NSyncFrameReset = 104, //重置帧同步 + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Action/NActionEnum.cs.meta b/JNFrame/Assets/Plugins/JNGame/Network/Action/NActionEnum.cs.meta new file mode 100644 index 00000000..bf8778fe --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Action/NActionEnum.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 07d3dc0f03a24e18b4bee8832eef7a47 +timeCreated: 1706264441 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Entity.meta b/JNFrame/Assets/Plugins/JNGame/Network/Entity.meta new file mode 100644 index 00000000..39ef0c49 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Entity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7d3cabfc01539db4dbf0d4961f07368c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs b/JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs new file mode 100644 index 00000000..32199131 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs @@ -0,0 +1,50 @@ +using System; +using Google.Protobuf; +using UnityEditor; + +namespace Plugins.JNGame.Network.Entity +{ + public class JNetParam + { + + //请求处理 Id (用来找到处理方法) + private int _hId; + public int HId => _hId; + + //请求Id (请求标识) + private int _id; + public int ID => _id; + + + //请求参数 + private IMessage _data; + public IMessage Data => _data; + + + private byte[] _bytes; + + public byte[] Bytes => _bytes; + + public JNetParam(int id,int hId) + { + _hId = hId; + _id = id; + } + + //构造器 + public static JNetParam Build(int id,int hId){ + return new JNetParam(id,hId); + } + + + public JNetParam SetData(IMessage data){ + this._data = data; + return this; + } + public JNetParam SetByte(byte[] bytes){ + this._bytes = bytes; + return this; + } + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs.meta b/JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs.meta new file mode 100644 index 00000000..0fd1777b --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Entity/JNetParam.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f311c8c368584fab839dd72819fc55da +timeCreated: 1706004134 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Network/JNSocket.cs b/JNFrame/Assets/Plugins/JNGame/Network/JNSocket.cs new file mode 100644 index 00000000..8929804e --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/JNSocket.cs @@ -0,0 +1,135 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Threading.Tasks; +using BestHTTP.WebSocket; +using Cysharp.Threading.Tasks; +using Google.Protobuf; +using Plugins.JNGame.Network.Entity; +using Plugins.JNGame.Network.Util; +using Plugins.JNGame.System; +using Plugins.JNGame.Util; +using UnityEngine; + +namespace Plugins.JNGame.Network +{ + public abstract class JNSocket : SystemBase + { + private WebSocket _socket; + + //消息Id + int _id = 0; + + private UniTaskCompletionSource _onOpen; + + //创建通知 + private EventDispatcher _event = new(); + + public override async Task OnInit() + { + await this.OnConnect(); + } + + private async UniTask OnConnect() + { + + var url = $"{await this.GetUrl()}"; + this._socket = new WebSocket(new Uri(url)); + + this._socket.OnOpen += OnOpen; + this._socket.OnMessage += OnMessageReceived; + this._socket.OnError += OnError; + this._socket.OnClosed += OnClosed; + this._socket.OnBinary += Onbinary; + + NSystem.Log($"[JNSocket]初始化WebSocket成功,URL:{url}"); + this._socket.Open(); + + //等待连接成功 + await (this._onOpen = new UniTaskCompletionSource()).Task; + + } + + private void OnOpen(WebSocket websocket) + { + NSystem.Log($"[JNSocket] OnOpen"); + this._onOpen.TrySetResult(); + } + + private void OnMessageReceived(WebSocket websocket, string message) + { + NSystem.Log($"[JNSocket] OnMessageReceived"); + } + + private void OnError(WebSocket websocket, Exception ex) + { + NSystem.Log($"[JNSocket] OnError"); + } + + private void OnClosed(WebSocket websocket, ushort code, string message) + { + NSystem.Log($"[JNSocket] OnClosed"); + } + + private void Onbinary(WebSocket websocket, byte[] data) + { + + NSystem.Log($"[JNSocket] Onbinary"); + Dispatch(NDataUtil.Parse(data)); + + } + + //通知消息 + private void Dispatch(JNetParam data) + { + + //发送消息 + List funs = _event.EventHandlers[$"{data.HId}"]; + funs.ForEach(fun => + { + if (data.Bytes.Length <= 0) + { + ((Action)fun)(null); + return; + } + if(fun.Method.GetParameters().Length == 1 && typeof(IMessage).IsAssignableFrom(fun.Method.GetParameters()[0].ParameterType)) + { + var type = fun.Method.GetParameters()[0].ParameterType; + var cType = type.GetProperty("Parser", BindingFlags.Static | BindingFlags.Public); + if (cType != null) + { + var methodInfo = cType.PropertyType.GetMethod("ParseFrom",new[]{ typeof(byte[]) }); + if (methodInfo != null) + { + var message = methodInfo.Invoke(cType.GetValue(null), new object[] { data.Bytes }); + fun.Method.Invoke(fun.Target,new object[]{ message }); + } + } + } + }); + + } + + //外部监听消息 + public void AddListener(int hId,Action listener) where T : IMessage + { + _event.AddListener($"{hId}",listener); + } + + //删除外部监听 + public void RemoveListener(int hId,Action listener) where T : IMessage + { + _event.RemoveListener($"{hId}",listener); + } + + protected abstract UniTask GetUrl(); + + + //向服务器发送消息 + public void Send(int hId,IMessage data = null) + { + _socket.Send(NDataUtil.Encrypt(JNetParam.Build(this._id++,hId).SetData(data))); + } + + } +} diff --git a/JNFrame/Assets/Plugins/JNGame/Network/JNSocket.cs.meta b/JNFrame/Assets/Plugins/JNGame/Network/JNSocket.cs.meta new file mode 100644 index 00000000..857977d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/JNSocket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 85daeb9010873c6408e58fd210d7ec47 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Proto.meta b/JNFrame/Assets/Plugins/JNGame/Network/Proto.meta new file mode 100644 index 00000000..49fc294e --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Proto.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 48ddea52cea7e1145b20a9674aeeca02 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.cs b/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.cs new file mode 100644 index 00000000..e7e3f0f1 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.cs @@ -0,0 +1,1092 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: JNSyncMessage.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +/// Holder for reflection information generated from JNSyncMessage.proto +public static partial class JNSyncMessageReflection { + + #region Descriptor + /// File descriptor for JNSyncMessage.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static JNSyncMessageReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChNKTlN5bmNNZXNzYWdlLnByb3RvIjkKDEpORnJhbWVJbnB1dBILCgNuSWQY", + "ASABKAUSEgoFaW5wdXQYAiABKAxIAIgBAUIICgZfaW5wdXQiLgoNSk5GcmFt", + "ZUlucHV0cxIdCgZpbnB1dHMYASADKAsyDS5KTkZyYW1lSW5wdXQiPQoLSk5G", + "cmFtZUluZm8SDQoFaW5kZXgYASABKAUSHwoIbWVzc2FnZXMYAiADKAsyDS5K", + "TkZyYW1lSW5wdXQiLAoMSk5GcmFtZUluZm9zEhwKBmZyYW1lcxgBIAMoCzIM", + "LkpORnJhbWVJbmZvIisKB0pOSW5wdXQSFAoHbWVzc2FnZRgBIAEoCUgAiAEB", + "QgoKCF9tZXNzYWdlQhYKFGNuLmppc29sLm5nYW1lLnByb3RvYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::JNFrameInput), global::JNFrameInput.Parser, new[]{ "NId", "Input" }, new[]{ "Input" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::JNFrameInputs), global::JNFrameInputs.Parser, new[]{ "Inputs" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::JNFrameInfo), global::JNFrameInfo.Parser, new[]{ "Index", "Messages" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::JNFrameInfos), global::JNFrameInfos.Parser, new[]{ "Frames" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::JNInput), global::JNInput.Parser, new[]{ "Message" }, new[]{ "Message" }, null, null, null) + })); + } + #endregion + +} +#region Messages +/// +///帧同步输入 +/// +public sealed partial class JNFrameInput : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JNFrameInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::JNSyncMessageReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInput(JNFrameInput other) : this() { + nId_ = other.nId_; + input_ = other.input_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInput Clone() { + return new JNFrameInput(this); + } + + /// Field number for the "nId" field. + public const int NIdFieldNumber = 1; + private int nId_; + /// + ///输入的Id + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int NId { + get { return nId_; } + set { + nId_ = value; + } + } + + /// Field number for the "input" field. + public const int InputFieldNumber = 2; + private pb::ByteString input_; + /// + ///输入内容 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pb::ByteString Input { + get { return input_ ?? pb::ByteString.Empty; } + set { + input_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "input" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasInput { + get { return input_ != null; } + } + /// Clears the value of the "input" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearInput() { + input_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as JNFrameInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(JNFrameInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (NId != other.NId) return false; + if (Input != other.Input) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (NId != 0) hash ^= NId.GetHashCode(); + if (HasInput) hash ^= Input.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (NId != 0) { + output.WriteRawTag(8); + output.WriteInt32(NId); + } + if (HasInput) { + output.WriteRawTag(18); + output.WriteBytes(Input); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (NId != 0) { + output.WriteRawTag(8); + output.WriteInt32(NId); + } + if (HasInput) { + output.WriteRawTag(18); + output.WriteBytes(Input); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (NId != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(NId); + } + if (HasInput) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(Input); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(JNFrameInput other) { + if (other == null) { + return; + } + if (other.NId != 0) { + NId = other.NId; + } + if (other.HasInput) { + Input = other.Input; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + NId = input.ReadInt32(); + break; + } + case 18: { + Input = input.ReadBytes(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + NId = input.ReadInt32(); + break; + } + case 18: { + Input = input.ReadBytes(); + break; + } + } + } + } + #endif + +} + +/// +///帧输入列表 +/// +public sealed partial class JNFrameInputs : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JNFrameInputs()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::JNSyncMessageReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInputs() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInputs(JNFrameInputs other) : this() { + inputs_ = other.inputs_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInputs Clone() { + return new JNFrameInputs(this); + } + + /// Field number for the "inputs" field. + public const int InputsFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_inputs_codec + = pb::FieldCodec.ForMessage(10, global::JNFrameInput.Parser); + private readonly pbc::RepeatedField inputs_ = new pbc::RepeatedField(); + /// + ///输入列表 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Inputs { + get { return inputs_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as JNFrameInputs); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(JNFrameInputs other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!inputs_.Equals(other.inputs_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= inputs_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + inputs_.WriteTo(output, _repeated_inputs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + inputs_.WriteTo(ref output, _repeated_inputs_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += inputs_.CalculateSize(_repeated_inputs_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(JNFrameInputs other) { + if (other == null) { + return; + } + inputs_.Add(other.inputs_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + inputs_.AddEntriesFrom(input, _repeated_inputs_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + inputs_.AddEntriesFrom(ref input, _repeated_inputs_codec); + break; + } + } + } + } + #endif + +} + +/// +///帧同步消息 +/// +public sealed partial class JNFrameInfo : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JNFrameInfo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::JNSyncMessageReflection.Descriptor.MessageTypes[2]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInfo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInfo(JNFrameInfo other) : this() { + index_ = other.index_; + messages_ = other.messages_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInfo Clone() { + return new JNFrameInfo(this); + } + + /// Field number for the "index" field. + public const int IndexFieldNumber = 1; + private int index_; + /// + ///帧数 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int Index { + get { return index_; } + set { + index_ = value; + } + } + + /// Field number for the "messages" field. + public const int MessagesFieldNumber = 2; + private static readonly pb::FieldCodec _repeated_messages_codec + = pb::FieldCodec.ForMessage(18, global::JNFrameInput.Parser); + private readonly pbc::RepeatedField messages_ = new pbc::RepeatedField(); + /// + ///消息bytes + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Messages { + get { return messages_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as JNFrameInfo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(JNFrameInfo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Index != other.Index) return false; + if(!messages_.Equals(other.messages_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (Index != 0) hash ^= Index.GetHashCode(); + hash ^= messages_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (Index != 0) { + output.WriteRawTag(8); + output.WriteInt32(Index); + } + messages_.WriteTo(output, _repeated_messages_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (Index != 0) { + output.WriteRawTag(8); + output.WriteInt32(Index); + } + messages_.WriteTo(ref output, _repeated_messages_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (Index != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Index); + } + size += messages_.CalculateSize(_repeated_messages_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(JNFrameInfo other) { + if (other == null) { + return; + } + if (other.Index != 0) { + Index = other.Index; + } + messages_.Add(other.messages_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + Index = input.ReadInt32(); + break; + } + case 18: { + messages_.AddEntriesFrom(input, _repeated_messages_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + Index = input.ReadInt32(); + break; + } + case 18: { + messages_.AddEntriesFrom(ref input, _repeated_messages_codec); + break; + } + } + } + } + #endif + +} + +/// +///帧同步集合 +/// +public sealed partial class JNFrameInfos : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JNFrameInfos()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::JNSyncMessageReflection.Descriptor.MessageTypes[3]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInfos() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInfos(JNFrameInfos other) : this() { + frames_ = other.frames_.Clone(); + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNFrameInfos Clone() { + return new JNFrameInfos(this); + } + + /// Field number for the "frames" field. + public const int FramesFieldNumber = 1; + private static readonly pb::FieldCodec _repeated_frames_codec + = pb::FieldCodec.ForMessage(10, global::JNFrameInfo.Parser); + private readonly pbc::RepeatedField frames_ = new pbc::RepeatedField(); + /// + ///帧数集 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public pbc::RepeatedField Frames { + get { return frames_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as JNFrameInfos); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(JNFrameInfos other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if(!frames_.Equals(other.frames_)) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + hash ^= frames_.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + frames_.WriteTo(output, _repeated_frames_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + frames_.WriteTo(ref output, _repeated_frames_codec); + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + size += frames_.CalculateSize(_repeated_frames_codec); + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(JNFrameInfos other) { + if (other == null) { + return; + } + frames_.Add(other.frames_); + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + frames_.AddEntriesFrom(input, _repeated_frames_codec); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + frames_.AddEntriesFrom(ref input, _repeated_frames_codec); + break; + } + } + } + } + #endif + +} + +/// +///帧同步输入 +/// +public sealed partial class JNInput : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new JNInput()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::JNSyncMessageReflection.Descriptor.MessageTypes[4]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNInput(JNInput other) : this() { + message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public JNInput Clone() { + return new JNInput(this); + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 1; + private string message_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_ ?? ""; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "message" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMessage { + get { return message_ != null; } + } + /// Clears the value of the "message" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMessage() { + message_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as JNInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(JNInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Message != other.Message) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMessage) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMessage) { + output.WriteRawTag(10); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMessage) { + output.WriteRawTag(10); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMessage) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(JNInput other) { + if (other == null) { + return; + } + if (other.HasMessage) { + Message = other.Message; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Message = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Message = input.ReadString(); + break; + } + } + } + } + #endif + +} + +#endregion + + +#endregion Designer generated code diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.cs.meta b/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.cs.meta new file mode 100644 index 00000000..91da70f9 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 417922a615a577540b5a5f446a197bdc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.proto b/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.proto new file mode 100644 index 00000000..6892ede1 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +option java_package = "cn.jisol.ngame.proto"; + +//帧同步输入 +message JNFrameInput{ + int32 nId = 1; //输入的Id + optional bytes input = 2; //输入内容 +} +//帧输入列表 +message JNFrameInputs { + repeated JNFrameInput inputs = 1; //输入列表 +} +//帧同步消息 +message JNFrameInfo { + int32 index = 1; //帧数 + repeated JNFrameInput messages = 2; //消息bytes +} +//帧同步集合 +message JNFrameInfos{ + repeated JNFrameInfo frames = 1; //帧数集 +} + +//帧同步输入 +message JNInput { + optional string message = 1; +} diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.proto.meta b/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.proto.meta new file mode 100644 index 00000000..0d7205bd --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Proto/JNSyncMessage.proto.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f5033772dc466fc46a8ac64d8dbc5d00 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.cs b/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.cs new file mode 100644 index 00000000..c58cd8aa --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.cs @@ -0,0 +1,445 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: NActionMessage.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +/// Holder for reflection information generated from NActionMessage.proto +public static partial class NActionMessageReflection { + + #region Descriptor + /// File descriptor for NActionMessage.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static NActionMessageReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChROQWN0aW9uTWVzc2FnZS5wcm90byIvCgtOQWN0aW9uRGVtbxIUCgdtZXNz", + "YWdlGAEgASgJSACIAQFCCgoIX21lc3NhZ2UiMAoMTkFjdGlvbkRlbW8yEhQK", + "B21lc3NhZ2UYASABKAlIAIgBAUIKCghfbWVzc2FnZUIWChRjbi5qaXNvbC5u", + "Z2FtZS5wcm90b2IGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::NActionDemo), global::NActionDemo.Parser, new[]{ "Message" }, new[]{ "Message" }, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::NActionDemo2), global::NActionDemo2.Parser, new[]{ "Message" }, new[]{ "Message" }, null, null, null) + })); + } + #endregion + +} +#region Messages +public sealed partial class NActionDemo : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NActionDemo()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::NActionMessageReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NActionDemo() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NActionDemo(NActionDemo other) : this() { + message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NActionDemo Clone() { + return new NActionDemo(this); + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 1; + private string message_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_ ?? ""; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "message" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMessage { + get { return message_ != null; } + } + /// Clears the value of the "message" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMessage() { + message_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NActionDemo); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NActionDemo other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Message != other.Message) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMessage) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMessage) { + output.WriteRawTag(10); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMessage) { + output.WriteRawTag(10); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMessage) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NActionDemo other) { + if (other == null) { + return; + } + if (other.HasMessage) { + Message = other.Message; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Message = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Message = input.ReadString(); + break; + } + } + } + } + #endif + +} + +public sealed partial class NActionDemo2 : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NActionDemo2()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public static pbr::MessageDescriptor Descriptor { + get { return global::NActionMessageReflection.Descriptor.MessageTypes[1]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NActionDemo2() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NActionDemo2(NActionDemo2 other) : this() { + message_ = other.message_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public NActionDemo2 Clone() { + return new NActionDemo2(this); + } + + /// Field number for the "message" field. + public const int MessageFieldNumber = 1; + private string message_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public string Message { + get { return message_ ?? ""; } + set { + message_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + /// Gets whether the "message" field is set + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool HasMessage { + get { return message_ != null; } + } + /// Clears the value of the "message" field + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void ClearMessage() { + message_ = null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as NActionDemo2); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(NActionDemo2 other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Message != other.Message) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override int GetHashCode() { + int hash = 1; + if (HasMessage) hash ^= Message.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (HasMessage) { + output.WriteRawTag(10); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (HasMessage) { + output.WriteRawTag(10); + output.WriteString(Message); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int CalculateSize() { + int size = 0; + if (HasMessage) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(NActionDemo2 other) { + if (other == null) { + return; + } + if (other.HasMessage) { + Message = other.Message; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 10: { + Message = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 10: { + Message = input.ReadString(); + break; + } + } + } + } + #endif + +} + +#endregion + + +#endregion Designer generated code diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.cs.meta b/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.cs.meta new file mode 100644 index 00000000..c8a8f4d0 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7a64c8e0d9371ec4a8dc561dbfe81026 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.proto b/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.proto new file mode 100644 index 00000000..b6316d08 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +option java_package = "cn.jisol.ngame.proto"; + +message NActionDemo { + optional string message = 1; +} + +message NActionDemo2 { + optional string message = 1; +} + diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.proto.meta b/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.proto.meta new file mode 100644 index 00000000..a94d73a5 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Proto/NActionMessage.proto.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e48e0afd082b466081556cb81d66935f +timeCreated: 1705996154 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Util.meta b/JNFrame/Assets/Plugins/JNGame/Network/Util.meta new file mode 100644 index 00000000..cc413a4f --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Util.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: f297d4999ae14dd7a046a1faebd6845a +timeCreated: 1706004786 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Util/NDataUtil.cs b/JNFrame/Assets/Plugins/JNGame/Network/Util/NDataUtil.cs new file mode 100644 index 00000000..d3105008 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Util/NDataUtil.cs @@ -0,0 +1,41 @@ +using System; +using System.Linq; +using System.Reflection; +using Google.Protobuf; +using Plugins.JNGame.Network.Entity; +using Plugins.JNGame.Util; + +namespace Plugins.JNGame.Network.Util +{ + // 网络数据工具类 [请求Id*4,处理Id*4,...参数数据*N] + public static class NDataUtil + { + + // 解析 + public static JNetParam Parse(byte[] data) + { + + return JNetParam.Build( + ToUtil.Byte4ToInt(data.Skip(0).Take(4).ToArray()), + ToUtil.Byte4ToInt(data.Skip(4).Take(4).ToArray())) + .SetByte(data.Skip(8).Take(data.Length - 8).ToArray()); + + } + + // 编码 + public static byte[] Encrypt(JNetParam param) + { + + byte[] hId = ToUtil.IntToByte4(param.HId); + byte[] id = ToUtil.IntToByte4(param.ID); + byte[] data = Array.Empty(); + if(param.Data != null) + data = param.Data.ToByteArray(); + + return id.Concat(hId).Concat(data).ToArray(); + + } + + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Network/Util/NDataUtil.cs.meta b/JNFrame/Assets/Plugins/JNGame/Network/Util/NDataUtil.cs.meta new file mode 100644 index 00000000..d3a61a56 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Network/Util/NDataUtil.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8b05544adb2f44b4af8f86b2bc66a035 +timeCreated: 1706004790 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Sync.meta b/JNFrame/Assets/Plugins/JNGame/Sync.meta new file mode 100644 index 00000000..7b2d5a61 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Sync.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c62692a212dabc44f8d95e345f0d56e7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Sync/Frame.meta b/JNFrame/Assets/Plugins/JNGame/Sync/Frame.meta new file mode 100644 index 00000000..719169f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Sync/Frame.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 52334425574c2ff48a058ac3bb6d7419 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Sync/Frame/JNSyncFrame.cs b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/JNSyncFrame.cs new file mode 100644 index 00000000..4c0a150a --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/JNSyncFrame.cs @@ -0,0 +1,181 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Plugins.JNGame.System; +using Plugins.JNGame.Util; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace Plugins.JNGame.Sync.Frame +{ + public abstract class JNSyncFrame : SystemBase + { + + //同步时间 (和服务器保持一致) + private int _nSyncTime = 67; + //大于多少帧进行追帧 + private int _nMaxFrameBan = 3; + //大于多少帧进行快速追帧 + private int _nMaxFrameLoopBan = 18; + //将服务器帧数进行平分 + private int _nDivideFrame = 3; + + + //帧队列 + private List _nFrameQueue = new(); + + //本地帧数 + private int _nLocalFrame = 0; + //运行的帧 + private int _nFrameRun = 0; + + //暂存帧列表 + private Dictionary _nFrameTempQueue = new(); + + //ID 每添加 JNSyncFrameComponent + 1 + public Func nSyncID = RandomUtil.Next(0); + + //随机数 + public Func nRandom = RandomUtil.SyncRandom(100); + + //随机数整数 + public Func nRandomInt = RandomUtil.SyncRandomInt(100); + + //是否开始同步 + Boolean _isStart = false; + + //帧更新 + int dtTotal = 0; + //输入更新 + int dtInputTotal = 0; + + public override Task OnInit() + { + Physics.autoSimulation = false; + Physics.autoSyncTransforms = false; + return Task.CompletedTask; + } + + //重置数据 + public void Reset() + { + this.nSyncID = RandomUtil.Next(0); + this.nRandom = RandomUtil.SyncRandom(100); + this.nRandomInt = RandomUtil.SyncRandomInt(100); + } + + //更新同步 + public void Update(int dt) + { + + if(!_isStart) return; + + dtTotal += dt; + dtInputTotal += dt; + + int nSyncTime = this.DyTime(); + + if(nSyncTime > 0){ + while(nSyncTime != 0 && this.dtTotal > nSyncTime){ + this.onUpdate(); + this.dtTotal -= nSyncTime; + nSyncTime = this.DyTime(); + } + }else{ + //追帧运行 保持前端 15 帧 刷新 + int endTime = DateTime.Now.Millisecond + 66; + while(this.DyTime() == 0 && DateTime.Now.Millisecond < endTime){ + this.onUpdate(); + } + } + + } + + //运行帧 + public void onUpdate() + { + + } + + //自适应间隔时间 + private int DyTime(){ + int dt = this._nSyncTime / this._nDivideFrame; + int loop = dt; + + //大于nMaxFrameBan 进行 追帧 + if(this._nFrameQueue.Count > this._nMaxFrameBan) { + + //计算超过的帧数 + int exceed = this._nFrameQueue.Count - this._nMaxFrameBan; + int most = this._nMaxFrameLoopBan - this._nMaxFrameBan; + int ldt = ((most - exceed) / most) * dt; + + //自适应追帧算法 + if(exceed <= this._nMaxFrameLoopBan){ + loop = ldt; + }else{ + loop = 0; + } + }else{ + loop = dt; + } + return loop; + } + + /** + * 接收帧数据 + * @param frame 帧数据 + * @param isLatestData 是否最新的帧数据 + */ + public void AddInput(JNFrameInfo frame,Boolean isLatestData = false){ + + if(isLatestData){ + //如果推的帧小于本地帧 则 重开 + if(frame.Index < _nLocalFrame){ + Reset(); + return; + } + } + + //我需要的下一帧 + int index = _nLocalFrame + 1; + + //判断接受的帧是否下一帧 如果不是则加入未列入 + if (frame.Index != index){ + + _nFrameTempQueue.Add(frame.Index,frame); + + //在未列入中拿到需要的帧 + JNFrameInfo tamp = null; + + if ((tamp = _nFrameTempQueue[index]) == null){ + + //如果没有则向服务器请求我需要的帧数 + + } + else + { + //如果有则覆盖 + frame = tamp; + } + + } + + //删除临时帧 + _nFrameTempQueue.Remove(frame.Index); + + _nLocalFrame = index; + + //分帧插入 + _nFrameQueue.Add(frame); + for (var i = 0; i < this._nDivideFrame - 1; index++) { + _nFrameQueue.Add(new JNFrameInfo()); + } + + } + + //发送帧数据 + protected abstract void OnSendInput(JNFrameInputs inputs); + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Sync/Frame/JNSyncFrame.cs.meta b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/JNSyncFrame.cs.meta new file mode 100644 index 00000000..29ad290b --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/JNSyncFrame.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 44e6e0cb968b4bc0a21ed772b81d1c39 +timeCreated: 1706003302 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Sync/Frame/game.meta b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/game.meta new file mode 100644 index 00000000..f680d909 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/game.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 240dc802e5754972a9f7590feea56628 +timeCreated: 1706163840 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Sync/Frame/game/JNSyncFrameComponent.cs b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/game/JNSyncFrameComponent.cs new file mode 100644 index 00000000..8b2ab3d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/game/JNSyncFrameComponent.cs @@ -0,0 +1,51 @@ +using System; +using UnityEngine; + +namespace Plugins.JNGame.Sync.Frame.game +{ + + //所有帧同步组件的基类 + public abstract class JNSyncFrameComponent : MonoBehaviour + { + + //标识 + private int _nId; + + //当前输入 + private T _input; + + //是否有输入 + public Boolean isInput => this._input == null; + + //是否初始化完成 + public Boolean isSyncInitSuccess = false; + + + //清空输入 + public void ClearInput(){ + this._input = default(T); + } + + private void Awake() + { + //向帧同步获取Id + this._nId = GetSync().nSyncID(); + this.OnSyncLoad(); + } + + //初始化完成 + public void OnSyncInitSuccess(){} + + //获取同步类 + protected abstract JNSyncFrame GetSync(); + + //加载 + public abstract void OnSyncLoad(); + + //帧同步 + public abstract void OnSyncUpdate(int dt,JNFrameInfo frame,Input input = null); + + + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Sync/Frame/game/JNSyncFrameComponent.cs.meta b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/game/JNSyncFrameComponent.cs.meta new file mode 100644 index 00000000..10b2715d --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Sync/Frame/game/JNSyncFrameComponent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 1a802748c1744ea886c648699b51245f +timeCreated: 1706163852 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/System.meta b/JNFrame/Assets/Plugins/JNGame/System.meta new file mode 100644 index 00000000..a2828b4c --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/System.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 681de402476267c41b0fd0f6fd566e76 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/System/SystemBase.cs b/JNFrame/Assets/Plugins/JNGame/System/SystemBase.cs new file mode 100644 index 00000000..4a9e2ec3 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/System/SystemBase.cs @@ -0,0 +1,12 @@ +using Cysharp.Threading.Tasks; +using System.Threading.Tasks; + +namespace Plugins.JNGame.System +{ + public abstract class SystemBase + { + + public abstract Task OnInit(); + + } +} diff --git a/JNFrame/Assets/Plugins/JNGame/System/SystemBase.cs.meta b/JNFrame/Assets/Plugins/JNGame/System/SystemBase.cs.meta new file mode 100644 index 00000000..efaa9052 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/System/SystemBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 09143922e037a6d41aa2a9e4e2742731 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/UI.meta b/JNFrame/Assets/Plugins/JNGame/UI.meta new file mode 100644 index 00000000..e287e156 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/UI.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5f759e05d198dbb4fa441d263f243edb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/JNGame/Util.meta b/JNFrame/Assets/Plugins/JNGame/Util.meta new file mode 100644 index 00000000..bcd6b51a --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8a2a6d3b9a20443a8348bd5ba601622d +timeCreated: 1706004960 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/EventDispatcher.cs b/JNFrame/Assets/Plugins/JNGame/Util/EventDispatcher.cs new file mode 100644 index 00000000..b7262278 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/EventDispatcher.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Plugins.JNGame.Util +{ + /// + /// 静态事件分发器 + /// + public class EventDispatcher + { + public Dictionary> EventHandlers { get; private set; } = new(); + + /// + /// 添加事件监听器 + /// + /// 事件参数类型 + /// 事件标识符 + /// 事件监听器 + public void AddListener(string eventId, Action listener) + { + if (!EventHandlers.ContainsKey(eventId)) + { + EventHandlers[eventId] = new List(); + } + + EventHandlers[eventId].Add(listener); + Debug.Log(eventId+ "AddListener" + EventHandlers[eventId].Count); + //eventHandlers[eventId] = (Action)eventHandlers[eventId] + listener; + } + + /// + /// 移除事件监听器 + /// + /// 事件参数类型 + /// 事件标识符 + /// 事件监听器 + public void RemoveListener(string eventId, Action listener) + { + if (EventHandlers.ContainsKey(eventId)) + { + //eventHandlers[eventId] = (Action)eventHandlers[eventId] - listener; + EventHandlers[eventId].Remove(listener); + Debug.Log(eventId + "RemoveListener" + EventHandlers[eventId].Count); + } + } + + /// + /// 分发事件 + /// + /// 事件参数类型 + /// 事件标识符 + /// 事件参数 + public void Dispatch(string eventId, T args) + { + if (EventHandlers.ContainsKey(eventId) && EventHandlers[eventId] != null) + { + foreach(Delegate fun in EventHandlers[eventId]) + { + // 确保 fun 实际上是指向一个 Action 类型的函数 + if (fun.Method.GetParameters().Length == 1 && fun.Method.GetParameters()[0].ParameterType == typeof(T)) + { + ((Action)fun)(args); + } + } + } + } + + public void Reset() + { + EventHandlers = new(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/EventDispatcher.cs.meta b/JNFrame/Assets/Plugins/JNGame/Util/EventDispatcher.cs.meta new file mode 100644 index 00000000..b07f8d32 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/EventDispatcher.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 311db7dc834c409b81610b20f5510988 +timeCreated: 1706065209 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/ProtoUtil.cs b/JNFrame/Assets/Plugins/JNGame/Util/ProtoUtil.cs new file mode 100644 index 00000000..6f5af16f --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/ProtoUtil.cs @@ -0,0 +1,11 @@ +namespace Plugins.JNGame.Util +{ + + //Proto工具 + public class ProtoUtil + { + + + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/ProtoUtil.cs.meta b/JNFrame/Assets/Plugins/JNGame/Util/ProtoUtil.cs.meta new file mode 100644 index 00000000..2d0abaca --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/ProtoUtil.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 37c91935ad854ee1a4b199391df35004 +timeCreated: 1706006228 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/RandomUtil.cs b/JNFrame/Assets/Plugins/JNGame/Util/RandomUtil.cs new file mode 100644 index 00000000..982290d3 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/RandomUtil.cs @@ -0,0 +1,38 @@ +using System; + +namespace Plugins.JNGame.Util +{ + public static class RandomUtil + { + + public static Func SyncRandom(int seed,int start = 1) + { + + for(var i = 0; i < start; i++){ + seed = (seed * 9301 + 49297) % 233280; + } + + return () => + { + seed = (seed * 9301 + 49297) % 233280; + var rnd = seed / 233280.0; + return 0 + rnd * (1 - 0); + }; + + } + + public static Func SyncRandomInt(int seed,int start = 1) + { + var nRandom = SyncRandom(seed, start); + + return (min, max) => (int)(Math.Round(nRandom() * (max - min)) + min); + + } + + public static Func Next(int start) + { + return () => start++; + } + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/RandomUtil.cs.meta b/JNFrame/Assets/Plugins/JNGame/Util/RandomUtil.cs.meta new file mode 100644 index 00000000..25fa88e4 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/RandomUtil.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 04c0ca6d0b7f4dfab57c8dca2a3a7b94 +timeCreated: 1706164470 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/Singleton.cs b/JNFrame/Assets/Plugins/JNGame/Util/Singleton.cs new file mode 100644 index 00000000..5feb03d6 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/Singleton.cs @@ -0,0 +1,32 @@ +namespace Plugins.JNGame.Util +{ + public abstract class SingletonUtil where T : Singleton,new() { + + public static T Instance{ + get{ + if (Singleton.ins == null) + { + Singleton.ins = new T(); + Singleton.ins.Init(); + } + return Singleton.ins; + } + } + + public static void Clean() + { + Singleton.ins.Clean(); + Singleton.ins = null; + } + + } + + public class Singleton { + + public static T ins; + + public virtual void Init(){} + public virtual void Clean(){} + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/Singleton.cs.meta b/JNFrame/Assets/Plugins/JNGame/Util/Singleton.cs.meta new file mode 100644 index 00000000..572c9fe2 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/Singleton.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 80ef0477d1c9478a8d73b1e6ac21a8b9 +timeCreated: 1706167436 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/SingletonScene.cs b/JNFrame/Assets/Plugins/JNGame/Util/SingletonScene.cs new file mode 100644 index 00000000..3ed5f608 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/SingletonScene.cs @@ -0,0 +1,85 @@ +using UnityEngine; + +/// +/// Be aware this will not prevent a non singleton constructor +/// such as `T myT = new T();` +/// To prevent that, add `protected T () {}` to your singleton class. +/// +/// As a note, this is made as MonoBehaviour because we need Coroutines. +/// +public class SingletonScene : MonoBehaviour where T : MonoBehaviour +{ + private static T _instance; + + private static object _lock = new object(); + + public static T Instance + { + get + { + if (applicationIsQuitting) + { + Debug.LogWarning("[Singleton] Instance '" + typeof(T) + + "' already destroyed on application quit." + + " Won't create again - returning null."); + return null; + } + + lock (_lock) + { + if (_instance == null) + { + _instance = (T)FindObjectOfType(typeof(T)); + + if (FindObjectsOfType(typeof(T)).Length > 1) + { + Debug.LogError("[Singleton] Something went really wrong " + + " - there should never be more than 1 singleton!" + + " Reopening the scene might fix it."); + return _instance; + } + + if (_instance == null) + { + GameObject singleton = new GameObject(); + _instance = singleton.AddComponent(); + singleton.name = "(singleton) " + typeof(T).ToString(); + + DontDestroyOnLoad(singleton); + + Debug.Log("[Singleton] An instance of " + typeof(T) + + " is needed in the scene, so '" + singleton + + "' was created with DontDestroyOnLoad."); + } + else + { + Debug.Log("[Singleton] Using instance already created: " + + _instance.gameObject.name); + } + } + + return _instance; + } + } + } + + private static bool applicationIsQuitting = false; + + /// + /// When Unity quits, it destroys objects in a random order. + /// In principle, a Singleton is only destroyed when application quits. + /// If any script calls Instance after it have been destroyed, + /// it will create a buggy ghost object that will stay on the Editor scene + /// even after stopping playing the Application. Really bad! + /// So, this was made to be sure we're not creating that buggy ghost object. + /// + public void OnDestroy() + { + applicationIsQuitting = true; + OnDispose(); + } + + protected virtual void OnDispose() + { + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/SingletonScene.cs.meta b/JNFrame/Assets/Plugins/JNGame/Util/SingletonScene.cs.meta new file mode 100644 index 00000000..e6ea65a3 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/SingletonScene.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c9277ee16036443695be9ff1ff09df12 +timeCreated: 1706168129 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/ToUtil.cs b/JNFrame/Assets/Plugins/JNGame/Util/ToUtil.cs new file mode 100644 index 00000000..a2dd52c5 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/ToUtil.cs @@ -0,0 +1,19 @@ +using System; + +namespace Plugins.JNGame.Util +{ + public class ToUtil + { + public static int Byte4ToInt(byte[] data) + { + return BitConverter.ToInt32(data, 0); + } + + public static byte[] IntToByte4(int value) + { + byte[] result = new byte[4]; + BitConverter.GetBytes(value).CopyTo(result, 0); + return result; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/JNGame/Util/ToUtil.cs.meta b/JNFrame/Assets/Plugins/JNGame/Util/ToUtil.cs.meta new file mode 100644 index 00000000..5e252a43 --- /dev/null +++ b/JNFrame/Assets/Plugins/JNGame/Util/ToUtil.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 22d4030ad259466884c3fefc632770f9 +timeCreated: 1706004960 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask.meta b/JNFrame/Assets/Plugins/UniTask.meta new file mode 100644 index 00000000..6e6b5efb --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7549e6fb9e09f3349a0c86132caf7c32 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Editor.meta b/JNFrame/Assets/Plugins/UniTask/Editor.meta new file mode 100644 index 00000000..fcd2a0db --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9ea89f80d5cb1fc4d8f5f418ebb3da3b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Editor/SplitterGUILayout.cs b/JNFrame/Assets/Plugins/UniTask/Editor/SplitterGUILayout.cs new file mode 100644 index 00000000..41891337 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Editor/SplitterGUILayout.cs @@ -0,0 +1,62 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; + +namespace Cysharp.Threading.Tasks.Editor +{ + // reflection call of UnityEditor.SplitterGUILayout + internal static class SplitterGUILayout + { + static BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; + + static Lazy splitterStateType = new Lazy(() => + { + var type = typeof(EditorWindow).Assembly.GetTypes().First(x => x.FullName == "UnityEditor.SplitterState"); + return type; + }); + + static Lazy splitterStateCtor = new Lazy(() => + { + var type = splitterStateType.Value; + return type.GetConstructor(flags, null, new Type[] { typeof(float[]), typeof(int[]), typeof(int[]) }, null); + }); + + static Lazy splitterGUILayoutType = new Lazy(() => + { + var type = typeof(EditorWindow).Assembly.GetTypes().First(x => x.FullName == "UnityEditor.SplitterGUILayout"); + return type; + }); + + static Lazy beginVerticalSplit = new Lazy(() => + { + var type = splitterGUILayoutType.Value; + return type.GetMethod("BeginVerticalSplit", flags, null, new Type[] { splitterStateType.Value, typeof(GUILayoutOption[]) }, null); + }); + + static Lazy endVerticalSplit = new Lazy(() => + { + var type = splitterGUILayoutType.Value; + return type.GetMethod("EndVerticalSplit", flags, null, Type.EmptyTypes, null); + }); + + public static object CreateSplitterState(float[] relativeSizes, int[] minSizes, int[] maxSizes) + { + return splitterStateCtor.Value.Invoke(new object[] { relativeSizes, minSizes, maxSizes }); + } + + public static void BeginVerticalSplit(object splitterState, params GUILayoutOption[] options) + { + beginVerticalSplit.Value.Invoke(null, new object[] { splitterState, options }); + } + + public static void EndVerticalSplit() + { + endVerticalSplit.Value.Invoke(null, Type.EmptyTypes); + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Editor/SplitterGUILayout.cs.meta b/JNFrame/Assets/Plugins/UniTask/Editor/SplitterGUILayout.cs.meta new file mode 100644 index 00000000..4d718f4e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Editor/SplitterGUILayout.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 40ef2e46f900131419e869398a8d3c9d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Editor/UniTask.Editor.asmdef b/JNFrame/Assets/Plugins/UniTask/Editor/UniTask.Editor.asmdef new file mode 100644 index 00000000..c618c6ac --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Editor/UniTask.Editor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "UniTask.Editor", + "references": [ + "UniTask" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Editor/UniTask.Editor.asmdef.meta b/JNFrame/Assets/Plugins/UniTask/Editor/UniTask.Editor.asmdef.meta new file mode 100644 index 00000000..821b87b7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Editor/UniTask.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4129704b5a1a13841ba16f230bf24a57 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerTreeView.cs b/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerTreeView.cs new file mode 100644 index 00000000..e7b62692 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerTreeView.cs @@ -0,0 +1,182 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System; +using UnityEditor.IMGUI.Controls; +using Cysharp.Threading.Tasks.Internal; +using System.Text; +using System.Text.RegularExpressions; + +namespace Cysharp.Threading.Tasks.Editor +{ + public class UniTaskTrackerViewItem : TreeViewItem + { + static Regex removeHref = new Regex("(.+)", RegexOptions.Compiled); + + public string TaskType { get; set; } + public string Elapsed { get; set; } + public string Status { get; set; } + + string position; + public string Position + { + get { return position; } + set + { + position = value; + PositionFirstLine = GetFirstLine(position); + } + } + + public string PositionFirstLine { get; private set; } + + static string GetFirstLine(string str) + { + var sb = new StringBuilder(); + for (int i = 0; i < str.Length; i++) + { + if (str[i] == '\r' || str[i] == '\n') + { + break; + } + sb.Append(str[i]); + } + + return removeHref.Replace(sb.ToString(), "$1"); + } + + public UniTaskTrackerViewItem(int id) : base(id) + { + + } + } + + public class UniTaskTrackerTreeView : TreeView + { + const string sortedColumnIndexStateKey = "UniTaskTrackerTreeView_sortedColumnIndex"; + + public IReadOnlyList CurrentBindingItems; + + public UniTaskTrackerTreeView() + : this(new TreeViewState(), new MultiColumnHeader(new MultiColumnHeaderState(new[] + { + new MultiColumnHeaderState.Column() { headerContent = new GUIContent("TaskType"), width = 20}, + new MultiColumnHeaderState.Column() { headerContent = new GUIContent("Elapsed"), width = 10}, + new MultiColumnHeaderState.Column() { headerContent = new GUIContent("Status"), width = 10}, + new MultiColumnHeaderState.Column() { headerContent = new GUIContent("Position")}, + }))) + { + } + + UniTaskTrackerTreeView(TreeViewState state, MultiColumnHeader header) + : base(state, header) + { + rowHeight = 20; + showAlternatingRowBackgrounds = true; + showBorder = true; + header.sortingChanged += Header_sortingChanged; + + header.ResizeToFit(); + Reload(); + + header.sortedColumnIndex = SessionState.GetInt(sortedColumnIndexStateKey, 1); + } + + public void ReloadAndSort() + { + var currentSelected = this.state.selectedIDs; + Reload(); + Header_sortingChanged(this.multiColumnHeader); + this.state.selectedIDs = currentSelected; + } + + private void Header_sortingChanged(MultiColumnHeader multiColumnHeader) + { + SessionState.SetInt(sortedColumnIndexStateKey, multiColumnHeader.sortedColumnIndex); + var index = multiColumnHeader.sortedColumnIndex; + var ascending = multiColumnHeader.IsSortedAscending(multiColumnHeader.sortedColumnIndex); + + var items = rootItem.children.Cast(); + + IOrderedEnumerable orderedEnumerable; + switch (index) + { + case 0: + orderedEnumerable = ascending ? items.OrderBy(item => item.TaskType) : items.OrderByDescending(item => item.TaskType); + break; + case 1: + orderedEnumerable = ascending ? items.OrderBy(item => double.Parse(item.Elapsed)) : items.OrderByDescending(item => double.Parse(item.Elapsed)); + break; + case 2: + orderedEnumerable = ascending ? items.OrderBy(item => item.Status) : items.OrderByDescending(item => item.Elapsed); + break; + case 3: + orderedEnumerable = ascending ? items.OrderBy(item => item.Position) : items.OrderByDescending(item => item.PositionFirstLine); + break; + default: + throw new ArgumentOutOfRangeException(nameof(index), index, null); + } + + CurrentBindingItems = rootItem.children = orderedEnumerable.Cast().ToList(); + BuildRows(rootItem); + } + + protected override TreeViewItem BuildRoot() + { + var root = new TreeViewItem { depth = -1 }; + + var children = new List(); + + TaskTracker.ForEachActiveTask((trackingId, awaiterType, status, created, stackTrace) => + { + children.Add(new UniTaskTrackerViewItem(trackingId) { TaskType = awaiterType, Status = status.ToString(), Elapsed = (DateTime.UtcNow - created).TotalSeconds.ToString("00.00"), Position = stackTrace }); + }); + + CurrentBindingItems = children; + root.children = CurrentBindingItems as List; + return root; + } + + protected override bool CanMultiSelect(TreeViewItem item) + { + return false; + } + + protected override void RowGUI(RowGUIArgs args) + { + var item = args.item as UniTaskTrackerViewItem; + + for (var visibleColumnIndex = 0; visibleColumnIndex < args.GetNumVisibleColumns(); visibleColumnIndex++) + { + var rect = args.GetCellRect(visibleColumnIndex); + var columnIndex = args.GetColumn(visibleColumnIndex); + + var labelStyle = args.selected ? EditorStyles.whiteLabel : EditorStyles.label; + labelStyle.alignment = TextAnchor.MiddleLeft; + switch (columnIndex) + { + case 0: + EditorGUI.LabelField(rect, item.TaskType, labelStyle); + break; + case 1: + EditorGUI.LabelField(rect, item.Elapsed, labelStyle); + break; + case 2: + EditorGUI.LabelField(rect, item.Status, labelStyle); + break; + case 3: + EditorGUI.LabelField(rect, item.PositionFirstLine, labelStyle); + break; + default: + throw new ArgumentOutOfRangeException(nameof(columnIndex), columnIndex, null); + } + } + } + } + +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerTreeView.cs.meta b/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerTreeView.cs.meta new file mode 100644 index 00000000..9b34d7b9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerTreeView.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 52e2d973a2156674e8c1c9433ed031f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerWindow.cs b/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerWindow.cs new file mode 100644 index 00000000..242ac6db --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerWindow.cs @@ -0,0 +1,209 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System; +using UnityEditor.IMGUI.Controls; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks.Editor +{ + public class UniTaskTrackerWindow : EditorWindow + { + static int interval; + + static UniTaskTrackerWindow window; + + [MenuItem("Window/UniTask Tracker")] + public static void OpenWindow() + { + if (window != null) + { + window.Close(); + } + + // will called OnEnable(singleton instance will be set). + GetWindow("UniTask Tracker").Show(); + } + + static readonly GUILayoutOption[] EmptyLayoutOption = new GUILayoutOption[0]; + + UniTaskTrackerTreeView treeView; + object splitterState; + + void OnEnable() + { + window = this; // set singleton. + splitterState = SplitterGUILayout.CreateSplitterState(new float[] { 75f, 25f }, new int[] { 32, 32 }, null); + treeView = new UniTaskTrackerTreeView(); + TaskTracker.EditorEnableState.EnableAutoReload = EditorPrefs.GetBool(TaskTracker.EnableAutoReloadKey, false); + TaskTracker.EditorEnableState.EnableTracking = EditorPrefs.GetBool(TaskTracker.EnableTrackingKey, false); + TaskTracker.EditorEnableState.EnableStackTrace = EditorPrefs.GetBool(TaskTracker.EnableStackTraceKey, false); + } + + void OnGUI() + { + // Head + RenderHeadPanel(); + + // Splittable + SplitterGUILayout.BeginVerticalSplit(this.splitterState, EmptyLayoutOption); + { + // Column Tabble + RenderTable(); + + // StackTrace details + RenderDetailsPanel(); + } + SplitterGUILayout.EndVerticalSplit(); + } + + #region HeadPanel + + public static bool EnableAutoReload => TaskTracker.EditorEnableState.EnableAutoReload; + public static bool EnableTracking => TaskTracker.EditorEnableState.EnableTracking; + public static bool EnableStackTrace => TaskTracker.EditorEnableState.EnableStackTrace; + static readonly GUIContent EnableAutoReloadHeadContent = EditorGUIUtility.TrTextContent("Enable AutoReload", "Reload automatically.", (Texture)null); + static readonly GUIContent ReloadHeadContent = EditorGUIUtility.TrTextContent("Reload", "Reload View.", (Texture)null); + static readonly GUIContent GCHeadContent = EditorGUIUtility.TrTextContent("GC.Collect", "Invoke GC.Collect.", (Texture)null); + static readonly GUIContent EnableTrackingHeadContent = EditorGUIUtility.TrTextContent("Enable Tracking", "Start to track async/await UniTask. Performance impact: low", (Texture)null); + static readonly GUIContent EnableStackTraceHeadContent = EditorGUIUtility.TrTextContent("Enable StackTrace", "Capture StackTrace when task is started. Performance impact: high", (Texture)null); + + // [Enable Tracking] | [Enable StackTrace] + void RenderHeadPanel() + { + EditorGUILayout.BeginVertical(EmptyLayoutOption); + EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, EmptyLayoutOption); + + if (GUILayout.Toggle(EnableAutoReload, EnableAutoReloadHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption) != EnableAutoReload) + { + TaskTracker.EditorEnableState.EnableAutoReload = !EnableAutoReload; + } + + if (GUILayout.Toggle(EnableTracking, EnableTrackingHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption) != EnableTracking) + { + TaskTracker.EditorEnableState.EnableTracking = !EnableTracking; + } + + if (GUILayout.Toggle(EnableStackTrace, EnableStackTraceHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption) != EnableStackTrace) + { + TaskTracker.EditorEnableState.EnableStackTrace = !EnableStackTrace; + } + + GUILayout.FlexibleSpace(); + + if (GUILayout.Button(ReloadHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption)) + { + TaskTracker.CheckAndResetDirty(); + treeView.ReloadAndSort(); + Repaint(); + } + + if (GUILayout.Button(GCHeadContent, EditorStyles.toolbarButton, EmptyLayoutOption)) + { + GC.Collect(0); + } + + EditorGUILayout.EndHorizontal(); + EditorGUILayout.EndVertical(); + } + + #endregion + + #region TableColumn + + Vector2 tableScroll; + GUIStyle tableListStyle; + + void RenderTable() + { + if (tableListStyle == null) + { + tableListStyle = new GUIStyle("CN Box"); + tableListStyle.margin.top = 0; + tableListStyle.padding.left = 3; + } + + EditorGUILayout.BeginVertical(tableListStyle, EmptyLayoutOption); + + this.tableScroll = EditorGUILayout.BeginScrollView(this.tableScroll, new GUILayoutOption[] + { + GUILayout.ExpandWidth(true), + GUILayout.MaxWidth(2000f) + }); + var controlRect = EditorGUILayout.GetControlRect(new GUILayoutOption[] + { + GUILayout.ExpandHeight(true), + GUILayout.ExpandWidth(true) + }); + + + treeView?.OnGUI(controlRect); + + EditorGUILayout.EndScrollView(); + EditorGUILayout.EndVertical(); + } + + private void Update() + { + if (EnableAutoReload) + { + if (interval++ % 120 == 0) + { + if (TaskTracker.CheckAndResetDirty()) + { + treeView.ReloadAndSort(); + Repaint(); + } + } + } + } + + #endregion + + #region Details + + static GUIStyle detailsStyle; + Vector2 detailsScroll; + + void RenderDetailsPanel() + { + if (detailsStyle == null) + { + detailsStyle = new GUIStyle("CN Message"); + detailsStyle.wordWrap = false; + detailsStyle.stretchHeight = true; + detailsStyle.margin.right = 15; + } + + string message = ""; + var selected = treeView.state.selectedIDs; + if (selected.Count > 0) + { + var first = selected[0]; + var item = treeView.CurrentBindingItems.FirstOrDefault(x => x.id == first) as UniTaskTrackerViewItem; + if (item != null) + { + message = item.Position; + } + } + + detailsScroll = EditorGUILayout.BeginScrollView(this.detailsScroll, EmptyLayoutOption); + var vector = detailsStyle.CalcSize(new GUIContent(message)); + EditorGUILayout.SelectableLabel(message, detailsStyle, new GUILayoutOption[] + { + GUILayout.ExpandHeight(true), + GUILayout.ExpandWidth(true), + GUILayout.MinWidth(vector.x), + GUILayout.MinHeight(vector.y) + }); + EditorGUILayout.EndScrollView(); + } + + #endregion + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerWindow.cs.meta b/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerWindow.cs.meta new file mode 100644 index 00000000..ba1b7045 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Editor/UniTaskTrackerWindow.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5bee3e3860e37484aa3b861bf76d129f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime.meta b/JNFrame/Assets/Plugins/UniTask/Runtime.meta new file mode 100644 index 00000000..2fb311ea --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21f1d0bc064b47842a16974d98d6adba +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncLazy.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncLazy.cs new file mode 100644 index 00000000..51bfadc7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncLazy.cs @@ -0,0 +1,245 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public class AsyncLazy + { + static Action continuation = SetCompletionSource; + + Func taskFactory; + UniTaskCompletionSource completionSource; + UniTask.Awaiter awaiter; + + object syncLock; + bool initialized; + + public AsyncLazy(Func taskFactory) + { + this.taskFactory = taskFactory; + this.completionSource = new UniTaskCompletionSource(); + this.syncLock = new object(); + this.initialized = false; + } + + internal AsyncLazy(UniTask task) + { + this.taskFactory = null; + this.completionSource = new UniTaskCompletionSource(); + this.syncLock = null; + this.initialized = true; + + var awaiter = task.GetAwaiter(); + if (awaiter.IsCompleted) + { + SetCompletionSource(awaiter); + } + else + { + this.awaiter = awaiter; + awaiter.SourceOnCompleted(continuation, this); + } + } + + public UniTask Task + { + get + { + EnsureInitialized(); + return completionSource.Task; + } + } + + + public UniTask.Awaiter GetAwaiter() => Task.GetAwaiter(); + + void EnsureInitialized() + { + if (Volatile.Read(ref initialized)) + { + return; + } + + EnsureInitializedCore(); + } + + void EnsureInitializedCore() + { + lock (syncLock) + { + if (!Volatile.Read(ref initialized)) + { + var f = Interlocked.Exchange(ref taskFactory, null); + if (f != null) + { + var task = f(); + var awaiter = task.GetAwaiter(); + if (awaiter.IsCompleted) + { + SetCompletionSource(awaiter); + } + else + { + this.awaiter = awaiter; + awaiter.SourceOnCompleted(continuation, this); + } + + Volatile.Write(ref initialized, true); + } + } + } + } + + void SetCompletionSource(in UniTask.Awaiter awaiter) + { + try + { + awaiter.GetResult(); + completionSource.TrySetResult(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void SetCompletionSource(object state) + { + var self = (AsyncLazy)state; + try + { + self.awaiter.GetResult(); + self.completionSource.TrySetResult(); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + } + finally + { + self.awaiter = default; + } + } + } + + public class AsyncLazy + { + static Action continuation = SetCompletionSource; + + Func> taskFactory; + UniTaskCompletionSource completionSource; + UniTask.Awaiter awaiter; + + object syncLock; + bool initialized; + + public AsyncLazy(Func> taskFactory) + { + this.taskFactory = taskFactory; + this.completionSource = new UniTaskCompletionSource(); + this.syncLock = new object(); + this.initialized = false; + } + + internal AsyncLazy(UniTask task) + { + this.taskFactory = null; + this.completionSource = new UniTaskCompletionSource(); + this.syncLock = null; + this.initialized = true; + + var awaiter = task.GetAwaiter(); + if (awaiter.IsCompleted) + { + SetCompletionSource(awaiter); + } + else + { + this.awaiter = awaiter; + awaiter.SourceOnCompleted(continuation, this); + } + } + + public UniTask Task + { + get + { + EnsureInitialized(); + return completionSource.Task; + } + } + + + public UniTask.Awaiter GetAwaiter() => Task.GetAwaiter(); + + void EnsureInitialized() + { + if (Volatile.Read(ref initialized)) + { + return; + } + + EnsureInitializedCore(); + } + + void EnsureInitializedCore() + { + lock (syncLock) + { + if (!Volatile.Read(ref initialized)) + { + var f = Interlocked.Exchange(ref taskFactory, null); + if (f != null) + { + var task = f(); + var awaiter = task.GetAwaiter(); + if (awaiter.IsCompleted) + { + SetCompletionSource(awaiter); + } + else + { + this.awaiter = awaiter; + awaiter.SourceOnCompleted(continuation, this); + } + + Volatile.Write(ref initialized, true); + } + } + } + } + + void SetCompletionSource(in UniTask.Awaiter awaiter) + { + try + { + var result = awaiter.GetResult(); + completionSource.TrySetResult(result); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void SetCompletionSource(object state) + { + var self = (AsyncLazy)state; + try + { + var result = self.awaiter.GetResult(); + self.completionSource.TrySetResult(result); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + } + finally + { + self.awaiter = default; + } + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncLazy.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncLazy.cs.meta new file mode 100644 index 00000000..554d1628 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncLazy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01d1404ca421466419a7db7340ff5e77 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncReactiveProperty.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncReactiveProperty.cs new file mode 100644 index 00000000..a08844df --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncReactiveProperty.cs @@ -0,0 +1,644 @@ +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public interface IReadOnlyAsyncReactiveProperty : IUniTaskAsyncEnumerable + { + T Value { get; } + IUniTaskAsyncEnumerable WithoutCurrent(); + UniTask WaitAsync(CancellationToken cancellationToken = default); + } + + public interface IAsyncReactiveProperty : IReadOnlyAsyncReactiveProperty + { + new T Value { get; set; } + } + + [Serializable] + public class AsyncReactiveProperty : IAsyncReactiveProperty, IDisposable + { + TriggerEvent triggerEvent; + +#if UNITY_2018_3_OR_NEWER + [UnityEngine.SerializeField] +#endif + T latestValue; + + public T Value + { + get + { + return latestValue; + } + set + { + this.latestValue = value; + triggerEvent.SetResult(value); + } + } + + public AsyncReactiveProperty(T value) + { + this.latestValue = value; + this.triggerEvent = default; + } + + public IUniTaskAsyncEnumerable WithoutCurrent() + { + return new WithoutCurrentEnumerable(this); + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken) + { + return new Enumerator(this, cancellationToken, true); + } + + public void Dispose() + { + triggerEvent.SetCompleted(); + } + + public static implicit operator T(AsyncReactiveProperty value) + { + return value.Value; + } + + public override string ToString() + { + if (isValueType) return latestValue.ToString(); + return latestValue?.ToString(); + } + + public UniTask WaitAsync(CancellationToken cancellationToken = default) + { + return new UniTask(WaitAsyncSource.Create(this, cancellationToken, out var token), token); + } + + static bool isValueType; + + static AsyncReactiveProperty() + { + isValueType = typeof(T).IsValueType; + } + + sealed class WaitAsyncSource : IUniTaskSource, ITriggerHandler, ITaskPoolNode + { + static Action cancellationCallback = CancellationCallback; + + static TaskPool pool; + WaitAsyncSource nextNode; + ref WaitAsyncSource ITaskPoolNode.NextNode => ref nextNode; + + static WaitAsyncSource() + { + TaskPool.RegisterSizeGetter(typeof(WaitAsyncSource), () => pool.Size); + } + + AsyncReactiveProperty parent; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + UniTaskCompletionSourceCore core; + + WaitAsyncSource() + { + } + + public static IUniTaskSource Create(AsyncReactiveProperty parent, CancellationToken cancellationToken, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new WaitAsyncSource(); + } + + result.parent = parent; + result.cancellationToken = cancellationToken; + + if (cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, result); + } + + result.parent.triggerEvent.Add(result); + + TaskTracker.TrackActiveTask(result, 3); + + token = result.core.Version; + return result; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + cancellationTokenRegistration.Dispose(); + cancellationTokenRegistration = default; + parent.triggerEvent.Remove(this); + parent = null; + cancellationToken = default; + return pool.TryPush(this); + } + + static void CancellationCallback(object state) + { + var self = (WaitAsyncSource)state; + self.OnCanceled(self.cancellationToken); + } + + // IUniTaskSource + + public T GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + // ITriggerHandler + + ITriggerHandler ITriggerHandler.Prev { get; set; } + ITriggerHandler ITriggerHandler.Next { get; set; } + + public void OnCanceled(CancellationToken cancellationToken) + { + core.TrySetCanceled(cancellationToken); + } + + public void OnCompleted() + { + // Complete as Cancel. + core.TrySetCanceled(CancellationToken.None); + } + + public void OnError(Exception ex) + { + core.TrySetException(ex); + } + + public void OnNext(T value) + { + core.TrySetResult(value); + } + } + + sealed class WithoutCurrentEnumerable : IUniTaskAsyncEnumerable + { + readonly AsyncReactiveProperty parent; + + public WithoutCurrentEnumerable(AsyncReactiveProperty parent) + { + this.parent = parent; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new Enumerator(parent, cancellationToken, false); + } + } + + sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator, ITriggerHandler + { + static Action cancellationCallback = CancellationCallback; + + readonly AsyncReactiveProperty parent; + readonly CancellationToken cancellationToken; + readonly CancellationTokenRegistration cancellationTokenRegistration; + T value; + bool isDisposed; + bool firstCall; + + public Enumerator(AsyncReactiveProperty parent, CancellationToken cancellationToken, bool publishCurrentValue) + { + this.parent = parent; + this.cancellationToken = cancellationToken; + this.firstCall = publishCurrentValue; + + parent.triggerEvent.Add(this); + TaskTracker.TrackActiveTask(this, 3); + + if (cancellationToken.CanBeCanceled) + { + cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); + } + } + + public T Current => value; + + ITriggerHandler ITriggerHandler.Prev { get; set; } + ITriggerHandler ITriggerHandler.Next { get; set; } + + public UniTask MoveNextAsync() + { + // raise latest value on first call. + if (firstCall) + { + firstCall = false; + value = parent.Value; + return CompletedTasks.True; + } + + completionSource.Reset(); + return new UniTask(this, completionSource.Version); + } + + public UniTask DisposeAsync() + { + if (!isDisposed) + { + isDisposed = true; + TaskTracker.RemoveTracking(this); + completionSource.TrySetCanceled(cancellationToken); + parent.triggerEvent.Remove(this); + } + return default; + } + + public void OnNext(T value) + { + this.value = value; + completionSource.TrySetResult(true); + } + + public void OnCanceled(CancellationToken cancellationToken) + { + DisposeAsync().Forget(); + } + + public void OnCompleted() + { + completionSource.TrySetResult(false); + } + + public void OnError(Exception ex) + { + completionSource.TrySetException(ex); + } + + static void CancellationCallback(object state) + { + var self = (Enumerator)state; + self.DisposeAsync().Forget(); + } + } + } + + public class ReadOnlyAsyncReactiveProperty : IReadOnlyAsyncReactiveProperty, IDisposable + { + TriggerEvent triggerEvent; + + T latestValue; + IUniTaskAsyncEnumerator enumerator; + + public T Value + { + get + { + return latestValue; + } + } + + public ReadOnlyAsyncReactiveProperty(T initialValue, IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + latestValue = initialValue; + ConsumeEnumerator(source, cancellationToken).Forget(); + } + + public ReadOnlyAsyncReactiveProperty(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + ConsumeEnumerator(source, cancellationToken).Forget(); + } + + async UniTaskVoid ConsumeEnumerator(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await enumerator.MoveNextAsync()) + { + var value = enumerator.Current; + this.latestValue = value; + triggerEvent.SetResult(value); + } + } + finally + { + await enumerator.DisposeAsync(); + enumerator = null; + } + } + + public IUniTaskAsyncEnumerable WithoutCurrent() + { + return new WithoutCurrentEnumerable(this); + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken) + { + return new Enumerator(this, cancellationToken, true); + } + + public void Dispose() + { + if (enumerator != null) + { + enumerator.DisposeAsync().Forget(); + } + + triggerEvent.SetCompleted(); + } + + public static implicit operator T(ReadOnlyAsyncReactiveProperty value) + { + return value.Value; + } + + public override string ToString() + { + if (isValueType) return latestValue.ToString(); + return latestValue?.ToString(); + } + + public UniTask WaitAsync(CancellationToken cancellationToken = default) + { + return new UniTask(WaitAsyncSource.Create(this, cancellationToken, out var token), token); + } + + static bool isValueType; + + static ReadOnlyAsyncReactiveProperty() + { + isValueType = typeof(T).IsValueType; + } + + sealed class WaitAsyncSource : IUniTaskSource, ITriggerHandler, ITaskPoolNode + { + static Action cancellationCallback = CancellationCallback; + + static TaskPool pool; + WaitAsyncSource nextNode; + ref WaitAsyncSource ITaskPoolNode.NextNode => ref nextNode; + + static WaitAsyncSource() + { + TaskPool.RegisterSizeGetter(typeof(WaitAsyncSource), () => pool.Size); + } + + ReadOnlyAsyncReactiveProperty parent; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + UniTaskCompletionSourceCore core; + + WaitAsyncSource() + { + } + + public static IUniTaskSource Create(ReadOnlyAsyncReactiveProperty parent, CancellationToken cancellationToken, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new WaitAsyncSource(); + } + + result.parent = parent; + result.cancellationToken = cancellationToken; + + if (cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, result); + } + + result.parent.triggerEvent.Add(result); + + TaskTracker.TrackActiveTask(result, 3); + + token = result.core.Version; + return result; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + cancellationTokenRegistration.Dispose(); + cancellationTokenRegistration = default; + parent.triggerEvent.Remove(this); + parent = null; + cancellationToken = default; + return pool.TryPush(this); + } + + static void CancellationCallback(object state) + { + var self = (WaitAsyncSource)state; + self.OnCanceled(self.cancellationToken); + } + + // IUniTaskSource + + public T GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + // ITriggerHandler + + ITriggerHandler ITriggerHandler.Prev { get; set; } + ITriggerHandler ITriggerHandler.Next { get; set; } + + public void OnCanceled(CancellationToken cancellationToken) + { + core.TrySetCanceled(cancellationToken); + } + + public void OnCompleted() + { + // Complete as Cancel. + core.TrySetCanceled(CancellationToken.None); + } + + public void OnError(Exception ex) + { + core.TrySetException(ex); + } + + public void OnNext(T value) + { + core.TrySetResult(value); + } + } + + sealed class WithoutCurrentEnumerable : IUniTaskAsyncEnumerable + { + readonly ReadOnlyAsyncReactiveProperty parent; + + public WithoutCurrentEnumerable(ReadOnlyAsyncReactiveProperty parent) + { + this.parent = parent; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new Enumerator(parent, cancellationToken, false); + } + } + + sealed class Enumerator : MoveNextSource, IUniTaskAsyncEnumerator, ITriggerHandler + { + static Action cancellationCallback = CancellationCallback; + + readonly ReadOnlyAsyncReactiveProperty parent; + readonly CancellationToken cancellationToken; + readonly CancellationTokenRegistration cancellationTokenRegistration; + T value; + bool isDisposed; + bool firstCall; + + public Enumerator(ReadOnlyAsyncReactiveProperty parent, CancellationToken cancellationToken, bool publishCurrentValue) + { + this.parent = parent; + this.cancellationToken = cancellationToken; + this.firstCall = publishCurrentValue; + + parent.triggerEvent.Add(this); + TaskTracker.TrackActiveTask(this, 3); + + if (cancellationToken.CanBeCanceled) + { + cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); + } + } + + public T Current => value; + ITriggerHandler ITriggerHandler.Prev { get; set; } + ITriggerHandler ITriggerHandler.Next { get; set; } + + public UniTask MoveNextAsync() + { + // raise latest value on first call. + if (firstCall) + { + firstCall = false; + value = parent.Value; + return CompletedTasks.True; + } + + completionSource.Reset(); + return new UniTask(this, completionSource.Version); + } + + public UniTask DisposeAsync() + { + if (!isDisposed) + { + isDisposed = true; + TaskTracker.RemoveTracking(this); + completionSource.TrySetCanceled(cancellationToken); + parent.triggerEvent.Remove(this); + } + return default; + } + + public void OnNext(T value) + { + this.value = value; + completionSource.TrySetResult(true); + } + + public void OnCanceled(CancellationToken cancellationToken) + { + DisposeAsync().Forget(); + } + + public void OnCompleted() + { + completionSource.TrySetResult(false); + } + + public void OnError(Exception ex) + { + completionSource.TrySetException(ex); + } + + static void CancellationCallback(object state) + { + var self = (Enumerator)state; + self.DisposeAsync().Forget(); + } + } + } + + public static class StateExtensions + { + public static ReadOnlyAsyncReactiveProperty ToReadOnlyAsyncReactiveProperty(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + return new ReadOnlyAsyncReactiveProperty(source, cancellationToken); + } + + public static ReadOnlyAsyncReactiveProperty ToReadOnlyAsyncReactiveProperty(this IUniTaskAsyncEnumerable source, T initialValue, CancellationToken cancellationToken) + { + return new ReadOnlyAsyncReactiveProperty(initialValue, source, cancellationToken); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncReactiveProperty.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncReactiveProperty.cs.meta new file mode 100644 index 00000000..d64e3cff --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncReactiveProperty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8ef320b87f537ee4fb2282e765dc6166 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncUnit.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncUnit.cs new file mode 100644 index 00000000..1d4bc742 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncUnit.cs @@ -0,0 +1,26 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or + +using System; + +namespace Cysharp.Threading.Tasks +{ + public readonly struct AsyncUnit : IEquatable + { + public static readonly AsyncUnit Default = new AsyncUnit(); + + public override int GetHashCode() + { + return 0; + } + + public bool Equals(AsyncUnit other) + { + return true; + } + + public override string ToString() + { + return "()"; + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncUnit.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncUnit.cs.meta new file mode 100644 index 00000000..e0ee1329 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/AsyncUnit.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4f95ac245430d304bb5128d13b6becc8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenEqualityComparer.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenEqualityComparer.cs new file mode 100644 index 00000000..42e94451 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenEqualityComparer.cs @@ -0,0 +1,23 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public class CancellationTokenEqualityComparer : IEqualityComparer + { + public static readonly IEqualityComparer Default = new CancellationTokenEqualityComparer(); + + public bool Equals(CancellationToken x, CancellationToken y) + { + return x.Equals(y); + } + + public int GetHashCode(CancellationToken obj) + { + return obj.GetHashCode(); + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenEqualityComparer.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenEqualityComparer.cs.meta new file mode 100644 index 00000000..a4fe3fd9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenEqualityComparer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d739f510b125b74fa7290ac4335e46e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs new file mode 100644 index 00000000..3f3a532a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs @@ -0,0 +1,182 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public static class CancellationTokenExtensions + { + static readonly Action cancellationTokenCallback = Callback; + static readonly Action disposeCallback = DisposeCallback; + + public static CancellationToken ToCancellationToken(this UniTask task) + { + var cts = new CancellationTokenSource(); + ToCancellationTokenCore(task, cts).Forget(); + return cts.Token; + } + + public static CancellationToken ToCancellationToken(this UniTask task, CancellationToken linkToken) + { + if (linkToken.IsCancellationRequested) + { + return linkToken; + } + + if (!linkToken.CanBeCanceled) + { + return ToCancellationToken(task); + } + + var cts = CancellationTokenSource.CreateLinkedTokenSource(linkToken); + ToCancellationTokenCore(task, cts).Forget(); + + return cts.Token; + } + + public static CancellationToken ToCancellationToken(this UniTask task) + { + return ToCancellationToken(task.AsUniTask()); + } + + public static CancellationToken ToCancellationToken(this UniTask task, CancellationToken linkToken) + { + return ToCancellationToken(task.AsUniTask(), linkToken); + } + + static async UniTaskVoid ToCancellationTokenCore(UniTask task, CancellationTokenSource cts) + { + try + { + await task; + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + cts.Cancel(); + cts.Dispose(); + } + + public static (UniTask, CancellationTokenRegistration) ToUniTask(this CancellationToken cancellationToken) + { + if (cancellationToken.IsCancellationRequested) + { + return (UniTask.FromCanceled(cancellationToken), default(CancellationTokenRegistration)); + } + + var promise = new UniTaskCompletionSource(); + return (promise.Task, cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationTokenCallback, promise)); + } + + static void Callback(object state) + { + var promise = (UniTaskCompletionSource)state; + promise.TrySetResult(); + } + + public static CancellationTokenAwaitable WaitUntilCanceled(this CancellationToken cancellationToken) + { + return new CancellationTokenAwaitable(cancellationToken); + } + + public static CancellationTokenRegistration RegisterWithoutCaptureExecutionContext(this CancellationToken cancellationToken, Action callback) + { + var restoreFlow = false; + if (!ExecutionContext.IsFlowSuppressed()) + { + ExecutionContext.SuppressFlow(); + restoreFlow = true; + } + + try + { + return cancellationToken.Register(callback, false); + } + finally + { + if (restoreFlow) + { + ExecutionContext.RestoreFlow(); + } + } + } + + public static CancellationTokenRegistration RegisterWithoutCaptureExecutionContext(this CancellationToken cancellationToken, Action callback, object state) + { + var restoreFlow = false; + if (!ExecutionContext.IsFlowSuppressed()) + { + ExecutionContext.SuppressFlow(); + restoreFlow = true; + } + + try + { + return cancellationToken.Register(callback, state, false); + } + finally + { + if (restoreFlow) + { + ExecutionContext.RestoreFlow(); + } + } + } + + public static CancellationTokenRegistration AddTo(this IDisposable disposable, CancellationToken cancellationToken) + { + return cancellationToken.RegisterWithoutCaptureExecutionContext(disposeCallback, disposable); + } + + static void DisposeCallback(object state) + { + var d = (IDisposable)state; + d.Dispose(); + } + } + + public struct CancellationTokenAwaitable + { + CancellationToken cancellationToken; + + public CancellationTokenAwaitable(CancellationToken cancellationToken) + { + this.cancellationToken = cancellationToken; + } + + public Awaiter GetAwaiter() + { + return new Awaiter(cancellationToken); + } + + public struct Awaiter : ICriticalNotifyCompletion + { + CancellationToken cancellationToken; + + public Awaiter(CancellationToken cancellationToken) + { + this.cancellationToken = cancellationToken; + } + + public bool IsCompleted => !cancellationToken.CanBeCanceled || cancellationToken.IsCancellationRequested; + + public void GetResult() + { + } + + public void OnCompleted(Action continuation) + { + UnsafeOnCompleted(continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + cancellationToken.RegisterWithoutCaptureExecutionContext(continuation); + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs.meta new file mode 100644 index 00000000..28a69586 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4be7209f04146bd45ac5ee775a5f7c26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenSourceExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenSourceExtensions.cs new file mode 100644 index 00000000..c5199444 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenSourceExtensions.cs @@ -0,0 +1,44 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System.Threading; +using UnityEngine; +using Cysharp.Threading.Tasks.Triggers; +using System; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + + public static partial class CancellationTokenSourceExtensions + { + readonly static Action CancelCancellationTokenSourceStateDelegate = new Action(CancelCancellationTokenSourceState); + + static void CancelCancellationTokenSourceState(object state) + { + var cts = (CancellationTokenSource)state; + cts.Cancel(); + } + + public static IDisposable CancelAfterSlim(this CancellationTokenSource cts, int millisecondsDelay, DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update) + { + return CancelAfterSlim(cts, TimeSpan.FromMilliseconds(millisecondsDelay), delayType, delayTiming); + } + + public static IDisposable CancelAfterSlim(this CancellationTokenSource cts, TimeSpan delayTimeSpan, DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update) + { + return PlayerLoopTimer.StartNew(delayTimeSpan, false, delayType, delayTiming, cts.Token, CancelCancellationTokenSourceStateDelegate, cts); + } + + public static void RegisterRaiseCancelOnDestroy(this CancellationTokenSource cts, Component component) + { + RegisterRaiseCancelOnDestroy(cts, component.gameObject); + } + + public static void RegisterRaiseCancelOnDestroy(this CancellationTokenSource cts, GameObject gameObject) + { + var trigger = gameObject.GetAsyncDestroyTrigger(); + trigger.CancellationToken.RegisterWithoutCaptureExecutionContext(CancelCancellationTokenSourceStateDelegate, cts); + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenSourceExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenSourceExtensions.cs.meta new file mode 100644 index 00000000..fd09fe4b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CancellationTokenSourceExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 22d85d07f1e70ab42a7a4c25bd65e661 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Channel.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Channel.cs new file mode 100644 index 00000000..5a484fdc --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Channel.cs @@ -0,0 +1,450 @@ +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public static class Channel + { + public static Channel CreateSingleConsumerUnbounded() + { + return new SingleConsumerUnboundedChannel(); + } + } + + public abstract class Channel + { + public ChannelReader Reader { get; protected set; } + public ChannelWriter Writer { get; protected set; } + + public static implicit operator ChannelReader(Channel channel) => channel.Reader; + public static implicit operator ChannelWriter(Channel channel) => channel.Writer; + } + + public abstract class Channel : Channel + { + } + + public abstract class ChannelReader + { + public abstract bool TryRead(out T item); + public abstract UniTask WaitToReadAsync(CancellationToken cancellationToken = default(CancellationToken)); + + public abstract UniTask Completion { get; } + + public virtual UniTask ReadAsync(CancellationToken cancellationToken = default(CancellationToken)) + { + if (this.TryRead(out var item)) + { + return UniTask.FromResult(item); + } + + return ReadAsyncCore(cancellationToken); + } + + async UniTask ReadAsyncCore(CancellationToken cancellationToken = default(CancellationToken)) + { + if (await WaitToReadAsync(cancellationToken)) + { + if (TryRead(out var item)) + { + return item; + } + } + + throw new ChannelClosedException(); + } + + public abstract IUniTaskAsyncEnumerable ReadAllAsync(CancellationToken cancellationToken = default(CancellationToken)); + } + + public abstract class ChannelWriter + { + public abstract bool TryWrite(T item); + public abstract bool TryComplete(Exception error = null); + + public void Complete(Exception error = null) + { + if (!TryComplete(error)) + { + throw new ChannelClosedException(); + } + } + } + + public partial class ChannelClosedException : InvalidOperationException + { + public ChannelClosedException() : + base("Channel is already closed.") + { } + + public ChannelClosedException(string message) : base(message) { } + + public ChannelClosedException(Exception innerException) : + base("Channel is already closed", innerException) + { } + + public ChannelClosedException(string message, Exception innerException) : base(message, innerException) { } + } + + internal class SingleConsumerUnboundedChannel : Channel + { + readonly Queue items; + readonly SingleConsumerUnboundedChannelReader readerSource; + UniTaskCompletionSource completedTaskSource; + UniTask completedTask; + + Exception completionError; + bool closed; + + public SingleConsumerUnboundedChannel() + { + items = new Queue(); + Writer = new SingleConsumerUnboundedChannelWriter(this); + readerSource = new SingleConsumerUnboundedChannelReader(this); + Reader = readerSource; + } + + sealed class SingleConsumerUnboundedChannelWriter : ChannelWriter + { + readonly SingleConsumerUnboundedChannel parent; + + public SingleConsumerUnboundedChannelWriter(SingleConsumerUnboundedChannel parent) + { + this.parent = parent; + } + + public override bool TryWrite(T item) + { + bool waiting; + lock (parent.items) + { + if (parent.closed) return false; + + parent.items.Enqueue(item); + waiting = parent.readerSource.isWaiting; + } + + if (waiting) + { + parent.readerSource.SingalContinuation(); + } + + return true; + } + + public override bool TryComplete(Exception error = null) + { + bool waiting; + lock (parent.items) + { + if (parent.closed) return false; + parent.closed = true; + waiting = parent.readerSource.isWaiting; + + if (parent.items.Count == 0) + { + if (error == null) + { + if (parent.completedTaskSource != null) + { + parent.completedTaskSource.TrySetResult(); + } + else + { + parent.completedTask = UniTask.CompletedTask; + } + } + else + { + if (parent.completedTaskSource != null) + { + parent.completedTaskSource.TrySetException(error); + } + else + { + parent.completedTask = UniTask.FromException(error); + } + } + + if (waiting) + { + parent.readerSource.SingalCompleted(error); + } + } + + parent.completionError = error; + } + + return true; + } + } + + sealed class SingleConsumerUnboundedChannelReader : ChannelReader, IUniTaskSource + { + readonly Action CancellationCallbackDelegate = CancellationCallback; + readonly SingleConsumerUnboundedChannel parent; + + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + UniTaskCompletionSourceCore core; + internal bool isWaiting; + + public SingleConsumerUnboundedChannelReader(SingleConsumerUnboundedChannel parent) + { + this.parent = parent; + + TaskTracker.TrackActiveTask(this, 4); + } + + public override UniTask Completion + { + get + { + if (parent.completedTaskSource != null) return parent.completedTaskSource.Task; + + if (parent.closed) + { + return parent.completedTask; + } + + parent.completedTaskSource = new UniTaskCompletionSource(); + return parent.completedTaskSource.Task; + } + } + + public override bool TryRead(out T item) + { + lock (parent.items) + { + if (parent.items.Count != 0) + { + item = parent.items.Dequeue(); + + // complete when all value was consumed. + if (parent.closed && parent.items.Count == 0) + { + if (parent.completionError != null) + { + if (parent.completedTaskSource != null) + { + parent.completedTaskSource.TrySetException(parent.completionError); + } + else + { + parent.completedTask = UniTask.FromException(parent.completionError); + } + } + else + { + if (parent.completedTaskSource != null) + { + parent.completedTaskSource.TrySetResult(); + } + else + { + parent.completedTask = UniTask.CompletedTask; + } + } + } + } + else + { + item = default; + return false; + } + } + + return true; + } + + public override UniTask WaitToReadAsync(CancellationToken cancellationToken) + { + if (cancellationToken.IsCancellationRequested) + { + return UniTask.FromCanceled(cancellationToken); + } + + lock (parent.items) + { + if (parent.items.Count != 0) + { + return CompletedTasks.True; + } + + if (parent.closed) + { + if (parent.completionError == null) + { + return CompletedTasks.False; + } + else + { + return UniTask.FromException(parent.completionError); + } + } + + cancellationTokenRegistration.Dispose(); + + core.Reset(); + isWaiting = true; + + this.cancellationToken = cancellationToken; + if (this.cancellationToken.CanBeCanceled) + { + cancellationTokenRegistration = this.cancellationToken.RegisterWithoutCaptureExecutionContext(CancellationCallbackDelegate, this); + } + + return new UniTask(this, core.Version); + } + } + + public void SingalContinuation() + { + core.TrySetResult(true); + } + + public void SingalCancellation(CancellationToken cancellationToken) + { + TaskTracker.RemoveTracking(this); + core.TrySetCanceled(cancellationToken); + } + + public void SingalCompleted(Exception error) + { + if (error != null) + { + TaskTracker.RemoveTracking(this); + core.TrySetException(error); + } + else + { + TaskTracker.RemoveTracking(this); + core.TrySetResult(false); + } + } + + public override IUniTaskAsyncEnumerable ReadAllAsync(CancellationToken cancellationToken = default) + { + return new ReadAllAsyncEnumerable(this, cancellationToken); + } + + bool IUniTaskSource.GetResult(short token) + { + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + core.GetResult(token); + } + + UniTaskStatus IUniTaskSource.GetStatus(short token) + { + return core.GetStatus(token); + } + + void IUniTaskSource.OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + UniTaskStatus IUniTaskSource.UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + static void CancellationCallback(object state) + { + var self = (SingleConsumerUnboundedChannelReader)state; + self.SingalCancellation(self.cancellationToken); + } + + sealed class ReadAllAsyncEnumerable : IUniTaskAsyncEnumerable, IUniTaskAsyncEnumerator + { + readonly Action CancellationCallback1Delegate = CancellationCallback1; + readonly Action CancellationCallback2Delegate = CancellationCallback2; + + readonly SingleConsumerUnboundedChannelReader parent; + CancellationToken cancellationToken1; + CancellationToken cancellationToken2; + CancellationTokenRegistration cancellationTokenRegistration1; + CancellationTokenRegistration cancellationTokenRegistration2; + + T current; + bool cacheValue; + bool running; + + public ReadAllAsyncEnumerable(SingleConsumerUnboundedChannelReader parent, CancellationToken cancellationToken) + { + this.parent = parent; + this.cancellationToken1 = cancellationToken; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + if (running) + { + throw new InvalidOperationException("Enumerator is already running, does not allow call GetAsyncEnumerator twice."); + } + + if (this.cancellationToken1 != cancellationToken) + { + this.cancellationToken2 = cancellationToken; + } + + if (this.cancellationToken1.CanBeCanceled) + { + this.cancellationTokenRegistration1 = this.cancellationToken1.RegisterWithoutCaptureExecutionContext(CancellationCallback1Delegate, this); + } + + if (this.cancellationToken2.CanBeCanceled) + { + this.cancellationTokenRegistration2 = this.cancellationToken2.RegisterWithoutCaptureExecutionContext(CancellationCallback2Delegate, this); + } + + running = true; + return this; + } + + public T Current + { + get + { + if (cacheValue) + { + return current; + } + parent.TryRead(out current); + return current; + } + } + + public UniTask MoveNextAsync() + { + cacheValue = false; + return parent.WaitToReadAsync(CancellationToken.None); // ok to use None, registered in ctor. + } + + public UniTask DisposeAsync() + { + cancellationTokenRegistration1.Dispose(); + cancellationTokenRegistration2.Dispose(); + return default; + } + + static void CancellationCallback1(object state) + { + var self = (ReadAllAsyncEnumerable)state; + self.parent.SingalCancellation(self.cancellationToken1); + } + + static void CancellationCallback2(object state) + { + var self = (ReadAllAsyncEnumerable)state; + self.parent.SingalCancellation(self.cancellationToken2); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Channel.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Channel.cs.meta new file mode 100644 index 00000000..32edb9c0 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Channel.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5ceb3107bbdd1f14eb39091273798360 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices.meta new file mode 100644 index 00000000..98e8f599 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4589ba56083817248b9a16364032c678 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs new file mode 100644 index 00000000..700fc339 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs @@ -0,0 +1,17 @@ + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#pragma warning disable CS0436 + +namespace System.Runtime.CompilerServices +{ + internal sealed class AsyncMethodBuilderAttribute : Attribute + { + public Type BuilderType { get; } + + public AsyncMethodBuilderAttribute(Type builderType) + { + BuilderType = builderType; + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs.meta new file mode 100644 index 00000000..19961dfb --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncMethodBuilderAttribute.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 02ce354d37b10454e8376062f7cbe57a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs new file mode 100644 index 00000000..1aa990d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs @@ -0,0 +1,269 @@ + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; + +namespace Cysharp.Threading.Tasks.CompilerServices +{ + [StructLayout(LayoutKind.Auto)] + public struct AsyncUniTaskMethodBuilder + { + IStateMachineRunnerPromise runnerPromise; + Exception ex; + + // 1. Static Create method. + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AsyncUniTaskMethodBuilder Create() + { + return default; + } + + // 2. TaskLike Task property. + public UniTask Task + { + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + if (runnerPromise != null) + { + return runnerPromise.Task; + } + else if (ex != null) + { + return UniTask.FromException(ex); + } + else + { + return UniTask.CompletedTask; + } + } + } + + // 3. SetException + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetException(Exception exception) + { + if (runnerPromise == null) + { + ex = exception; + } + else + { + runnerPromise.SetException(exception); + } + } + + // 4. SetResult + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetResult() + { + if (runnerPromise != null) + { + runnerPromise.SetResult(); + } + } + + // 5. AwaitOnCompleted + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AwaitOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) + where TAwaiter : INotifyCompletion + where TStateMachine : IAsyncStateMachine + { + if (runnerPromise == null) + { + AsyncUniTask.SetStateMachine(ref stateMachine, ref runnerPromise); + } + + awaiter.OnCompleted(runnerPromise.MoveNext); + } + + // 6. AwaitUnsafeOnCompleted + [DebuggerHidden] + [SecuritySafeCritical] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AwaitUnsafeOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) + where TAwaiter : ICriticalNotifyCompletion + where TStateMachine : IAsyncStateMachine + { + if (runnerPromise == null) + { + AsyncUniTask.SetStateMachine(ref stateMachine, ref runnerPromise); + } + + awaiter.UnsafeOnCompleted(runnerPromise.MoveNext); + } + + // 7. Start + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Start(ref TStateMachine stateMachine) + where TStateMachine : IAsyncStateMachine + { + stateMachine.MoveNext(); + } + + // 8. SetStateMachine + [DebuggerHidden] + public void SetStateMachine(IAsyncStateMachine stateMachine) + { + // don't use boxed stateMachine. + } + +#if DEBUG || !UNITY_2018_3_OR_NEWER + // Important for IDE debugger. + object debuggingId; + private object ObjectIdForDebugger + { + get + { + if (debuggingId == null) + { + debuggingId = new object(); + } + return debuggingId; + } + } +#endif + } + + [StructLayout(LayoutKind.Auto)] + public struct AsyncUniTaskMethodBuilder + { + IStateMachineRunnerPromise runnerPromise; + Exception ex; + T result; + + // 1. Static Create method. + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AsyncUniTaskMethodBuilder Create() + { + return default; + } + + // 2. TaskLike Task property. + public UniTask Task + { + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + if (runnerPromise != null) + { + return runnerPromise.Task; + } + else if (ex != null) + { + return UniTask.FromException(ex); + } + else + { + return UniTask.FromResult(result); + } + } + } + + // 3. SetException + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetException(Exception exception) + { + if (runnerPromise == null) + { + ex = exception; + } + else + { + runnerPromise.SetException(exception); + } + } + + // 4. SetResult + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetResult(T result) + { + if (runnerPromise == null) + { + this.result = result; + } + else + { + runnerPromise.SetResult(result); + } + } + + // 5. AwaitOnCompleted + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AwaitOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) + where TAwaiter : INotifyCompletion + where TStateMachine : IAsyncStateMachine + { + if (runnerPromise == null) + { + AsyncUniTask.SetStateMachine(ref stateMachine, ref runnerPromise); + } + + awaiter.OnCompleted(runnerPromise.MoveNext); + } + + // 6. AwaitUnsafeOnCompleted + [DebuggerHidden] + [SecuritySafeCritical] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AwaitUnsafeOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) + where TAwaiter : ICriticalNotifyCompletion + where TStateMachine : IAsyncStateMachine + { + if (runnerPromise == null) + { + AsyncUniTask.SetStateMachine(ref stateMachine, ref runnerPromise); + } + + awaiter.UnsafeOnCompleted(runnerPromise.MoveNext); + } + + // 7. Start + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Start(ref TStateMachine stateMachine) + where TStateMachine : IAsyncStateMachine + { + stateMachine.MoveNext(); + } + + // 8. SetStateMachine + [DebuggerHidden] + public void SetStateMachine(IAsyncStateMachine stateMachine) + { + // don't use boxed stateMachine. + } + +#if DEBUG || !UNITY_2018_3_OR_NEWER + // Important for IDE debugger. + object debuggingId; + private object ObjectIdForDebugger + { + get + { + if (debuggingId == null) + { + debuggingId = new object(); + } + return debuggingId; + } + } +#endif + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs.meta new file mode 100644 index 00000000..ad43cfcf --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskMethodBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68d72a45afdec574ebc26e7de2c38330 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs new file mode 100644 index 00000000..82e91f38 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs @@ -0,0 +1,137 @@ + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; + +namespace Cysharp.Threading.Tasks.CompilerServices +{ + [StructLayout(LayoutKind.Auto)] + public struct AsyncUniTaskVoidMethodBuilder + { + IStateMachineRunner runner; + + // 1. Static Create method. + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AsyncUniTaskVoidMethodBuilder Create() + { + return default; + } + + // 2. TaskLike Task property(void) + public UniTaskVoid Task + { + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return default; + } + } + + // 3. SetException + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetException(Exception exception) + { + // runner is finished, return first. + if (runner != null) + { +#if ENABLE_IL2CPP + // workaround for IL2CPP bug. + PlayerLoopHelper.AddContinuation(PlayerLoopTiming.LastPostLateUpdate, runner.ReturnAction); +#else + runner.Return(); +#endif + runner = null; + } + + UniTaskScheduler.PublishUnobservedTaskException(exception); + } + + // 4. SetResult + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetResult() + { + // runner is finished, return. + if (runner != null) + { +#if ENABLE_IL2CPP + // workaround for IL2CPP bug. + PlayerLoopHelper.AddContinuation(PlayerLoopTiming.LastPostLateUpdate, runner.ReturnAction); +#else + runner.Return(); +#endif + runner = null; + } + } + + // 5. AwaitOnCompleted + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AwaitOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) + where TAwaiter : INotifyCompletion + where TStateMachine : IAsyncStateMachine + { + if (runner == null) + { + AsyncUniTaskVoid.SetStateMachine(ref stateMachine, ref runner); + } + + awaiter.OnCompleted(runner.MoveNext); + } + + // 6. AwaitUnsafeOnCompleted + [DebuggerHidden] + [SecuritySafeCritical] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AwaitUnsafeOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) + where TAwaiter : ICriticalNotifyCompletion + where TStateMachine : IAsyncStateMachine + { + if (runner == null) + { + AsyncUniTaskVoid.SetStateMachine(ref stateMachine, ref runner); + } + + awaiter.UnsafeOnCompleted(runner.MoveNext); + } + + // 7. Start + [DebuggerHidden] + public void Start(ref TStateMachine stateMachine) + where TStateMachine : IAsyncStateMachine + { + stateMachine.MoveNext(); + } + + // 8. SetStateMachine + [DebuggerHidden] + public void SetStateMachine(IAsyncStateMachine stateMachine) + { + // don't use boxed stateMachine. + } + +#if DEBUG || !UNITY_2018_3_OR_NEWER + // Important for IDE debugger. + object debuggingId; + private object ObjectIdForDebugger + { + get + { + if (debuggingId == null) + { + debuggingId = new object(); + } + return debuggingId; + } + } +#endif + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs.meta new file mode 100644 index 00000000..9bcc50e0 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/AsyncUniTaskVoidMethodBuilder.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e891aaac17b933a47a9d7fa3b8e1226f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs new file mode 100644 index 00000000..1cffeced --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs @@ -0,0 +1,380 @@ +#pragma warning disable CS1591 + +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Linq; +using System.Diagnostics; +using System.Runtime.CompilerServices; + +namespace Cysharp.Threading.Tasks.CompilerServices +{ + // #ENABLE_IL2CPP in this file is to avoid bug of IL2CPP VM. + // Issue is tracked on https://issuetracker.unity3d.com/issues/il2cpp-incorrect-results-when-calling-a-method-from-outside-class-in-a-struct + // but currently it is labeled `Won't Fix`. + + internal interface IStateMachineRunner + { + Action MoveNext { get; } + void Return(); + +#if ENABLE_IL2CPP + Action ReturnAction { get; } +#endif + } + + internal interface IStateMachineRunnerPromise : IUniTaskSource + { + Action MoveNext { get; } + UniTask Task { get; } + void SetResult(); + void SetException(Exception exception); + } + + internal interface IStateMachineRunnerPromise : IUniTaskSource + { + Action MoveNext { get; } + UniTask Task { get; } + void SetResult(T result); + void SetException(Exception exception); + } + + internal static class StateMachineUtility + { + // Get AsyncStateMachine internal state to check IL2CPP bug + public static int GetState(IAsyncStateMachine stateMachine) + { + var info = stateMachine.GetType().GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance) + .First(x => x.Name.EndsWith("__state")); + return (int)info.GetValue(stateMachine); + } + } + + internal sealed class AsyncUniTaskVoid : IStateMachineRunner, ITaskPoolNode>, IUniTaskSource + where TStateMachine : IAsyncStateMachine + { + static TaskPool> pool; + +#if ENABLE_IL2CPP + public Action ReturnAction { get; } +#endif + + TStateMachine stateMachine; + + public Action MoveNext { get; } + + public AsyncUniTaskVoid() + { + MoveNext = Run; +#if ENABLE_IL2CPP + ReturnAction = Return; +#endif + } + + public static void SetStateMachine(ref TStateMachine stateMachine, ref IStateMachineRunner runnerFieldRef) + { + if (!pool.TryPop(out var result)) + { + result = new AsyncUniTaskVoid(); + } + TaskTracker.TrackActiveTask(result, 3); + + runnerFieldRef = result; // set runner before copied. + result.stateMachine = stateMachine; // copy struct StateMachine(in release build). + } + + static AsyncUniTaskVoid() + { + TaskPool.RegisterSizeGetter(typeof(AsyncUniTaskVoid), () => pool.Size); + } + + AsyncUniTaskVoid nextNode; + public ref AsyncUniTaskVoid NextNode => ref nextNode; + + public void Return() + { + TaskTracker.RemoveTracking(this); + stateMachine = default; + pool.TryPush(this); + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + void Run() + { + stateMachine.MoveNext(); + } + + // dummy interface implementation for TaskTracker. + + UniTaskStatus IUniTaskSource.GetStatus(short token) + { + return UniTaskStatus.Pending; + } + + UniTaskStatus IUniTaskSource.UnsafeGetStatus() + { + return UniTaskStatus.Pending; + } + + void IUniTaskSource.OnCompleted(Action continuation, object state, short token) + { + } + + void IUniTaskSource.GetResult(short token) + { + } + } + + internal sealed class AsyncUniTask : IStateMachineRunnerPromise, IUniTaskSource, ITaskPoolNode> + where TStateMachine : IAsyncStateMachine + { + static TaskPool> pool; + +#if ENABLE_IL2CPP + readonly Action returnDelegate; +#endif + public Action MoveNext { get; } + + TStateMachine stateMachine; + UniTaskCompletionSourceCore core; + + AsyncUniTask() + { + MoveNext = Run; +#if ENABLE_IL2CPP + returnDelegate = Return; +#endif + } + + public static void SetStateMachine(ref TStateMachine stateMachine, ref IStateMachineRunnerPromise runnerPromiseFieldRef) + { + if (!pool.TryPop(out var result)) + { + result = new AsyncUniTask(); + } + TaskTracker.TrackActiveTask(result, 3); + + runnerPromiseFieldRef = result; // set runner before copied. + result.stateMachine = stateMachine; // copy struct StateMachine(in release build). + } + + AsyncUniTask nextNode; + public ref AsyncUniTask NextNode => ref nextNode; + + static AsyncUniTask() + { + TaskPool.RegisterSizeGetter(typeof(AsyncUniTask), () => pool.Size); + } + + void Return() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + stateMachine = default; + pool.TryPush(this); + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + stateMachine = default; + return pool.TryPush(this); + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + void Run() + { + stateMachine.MoveNext(); + } + + public UniTask Task + { + [DebuggerHidden] + get + { + return new UniTask(this, core.Version); + } + } + + [DebuggerHidden] + public void SetResult() + { + core.TrySetResult(AsyncUnit.Default); + } + + [DebuggerHidden] + public void SetException(Exception exception) + { + core.TrySetException(exception); + } + + [DebuggerHidden] + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { +#if ENABLE_IL2CPP + // workaround for IL2CPP bug. + PlayerLoopHelper.AddContinuation(PlayerLoopTiming.LastPostLateUpdate, returnDelegate); +#else + TryReturn(); +#endif + } + } + + [DebuggerHidden] + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + [DebuggerHidden] + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + [DebuggerHidden] + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + internal sealed class AsyncUniTask : IStateMachineRunnerPromise, IUniTaskSource, ITaskPoolNode> + where TStateMachine : IAsyncStateMachine + { + static TaskPool> pool; + +#if ENABLE_IL2CPP + readonly Action returnDelegate; +#endif + + public Action MoveNext { get; } + + TStateMachine stateMachine; + UniTaskCompletionSourceCore core; + + AsyncUniTask() + { + MoveNext = Run; +#if ENABLE_IL2CPP + returnDelegate = Return; +#endif + } + + public static void SetStateMachine(ref TStateMachine stateMachine, ref IStateMachineRunnerPromise runnerPromiseFieldRef) + { + if (!pool.TryPop(out var result)) + { + result = new AsyncUniTask(); + } + TaskTracker.TrackActiveTask(result, 3); + + runnerPromiseFieldRef = result; // set runner before copied. + result.stateMachine = stateMachine; // copy struct StateMachine(in release build). + } + + AsyncUniTask nextNode; + public ref AsyncUniTask NextNode => ref nextNode; + + static AsyncUniTask() + { + TaskPool.RegisterSizeGetter(typeof(AsyncUniTask), () => pool.Size); + } + + void Return() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + stateMachine = default; + pool.TryPush(this); + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + stateMachine = default; + return pool.TryPush(this); + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + void Run() + { + // UnityEngine.Debug.Log($"MoveNext State:" + StateMachineUtility.GetState(stateMachine)); + stateMachine.MoveNext(); + } + + public UniTask Task + { + [DebuggerHidden] + get + { + return new UniTask(this, core.Version); + } + } + + [DebuggerHidden] + public void SetResult(T result) + { + core.TrySetResult(result); + } + + [DebuggerHidden] + public void SetException(Exception exception) + { + core.TrySetException(exception); + } + + [DebuggerHidden] + public T GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { +#if ENABLE_IL2CPP + // workaround for IL2CPP bug. + PlayerLoopHelper.AddContinuation(PlayerLoopTiming.LastPostLateUpdate, returnDelegate); +#else + TryReturn(); +#endif + } + } + + [DebuggerHidden] + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + [DebuggerHidden] + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + [DebuggerHidden] + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + [DebuggerHidden] + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs.meta new file mode 100644 index 00000000..2cb82e08 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/CompilerServices/StateMachineRunner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98649642833cabf44a9dc060ce4c84a1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/EnumerableAsyncExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/EnumerableAsyncExtensions.cs new file mode 100644 index 00000000..004e7631 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/EnumerableAsyncExtensions.cs @@ -0,0 +1,34 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; + +namespace Cysharp.Threading.Tasks +{ + public static class EnumerableAsyncExtensions + { + // overload resolver - .Select(async x => { }) : IEnumerable> + + public static IEnumerable Select(this IEnumerable source, Func selector) + { + return System.Linq.Enumerable.Select(source, selector); + } + + public static IEnumerable> Select(this IEnumerable source, Func> selector) + { + return System.Linq.Enumerable.Select(source, selector); + } + + public static IEnumerable Select(this IEnumerable source, Func selector) + { + return System.Linq.Enumerable.Select(source, selector); + } + + public static IEnumerable> Select(this IEnumerable source, Func> selector) + { + return System.Linq.Enumerable.Select(source, selector); + } + } +} + + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/EnumerableAsyncExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/EnumerableAsyncExtensions.cs.meta new file mode 100644 index 00000000..d2e49304 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/EnumerableAsyncExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ff50260d74bd54c4b92cf99895549445 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/EnumeratorAsyncExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/EnumeratorAsyncExtensions.cs new file mode 100644 index 00000000..785bbc28 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/EnumeratorAsyncExtensions.cs @@ -0,0 +1,287 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections; +using System.Reflection; +using System.Runtime.ExceptionServices; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; +using UnityEngine; + +namespace Cysharp.Threading.Tasks +{ + public static class EnumeratorAsyncExtensions + { + public static UniTask.Awaiter GetAwaiter(this T enumerator) + where T : IEnumerator + { + var e = (IEnumerator)enumerator; + Error.ThrowArgumentNullException(e, nameof(enumerator)); + return new UniTask(EnumeratorPromise.Create(e, PlayerLoopTiming.Update, CancellationToken.None, out var token), token).GetAwaiter(); + } + + public static UniTask WithCancellation(this IEnumerator enumerator, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(enumerator, nameof(enumerator)); + return new UniTask(EnumeratorPromise.Create(enumerator, PlayerLoopTiming.Update, cancellationToken, out var token), token); + } + + public static UniTask ToUniTask(this IEnumerator enumerator, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken)) + { + Error.ThrowArgumentNullException(enumerator, nameof(enumerator)); + return new UniTask(EnumeratorPromise.Create(enumerator, timing, cancellationToken, out var token), token); + } + + public static UniTask ToUniTask(this IEnumerator enumerator, MonoBehaviour coroutineRunner) + { + var source = AutoResetUniTaskCompletionSource.Create(); + coroutineRunner.StartCoroutine(Core(enumerator, coroutineRunner, source)); + return source.Task; + } + + static IEnumerator Core(IEnumerator inner, MonoBehaviour coroutineRunner, AutoResetUniTaskCompletionSource source) + { + yield return coroutineRunner.StartCoroutine(inner); + source.TrySetResult(); + } + + sealed class EnumeratorPromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + EnumeratorPromise nextNode; + public ref EnumeratorPromise NextNode => ref nextNode; + + static EnumeratorPromise() + { + TaskPool.RegisterSizeGetter(typeof(EnumeratorPromise), () => pool.Size); + } + + IEnumerator innerEnumerator; + CancellationToken cancellationToken; + int initialFrame; + bool loopRunning; + bool calledGetResult; + + UniTaskCompletionSourceCore core; + + EnumeratorPromise() + { + } + + public static IUniTaskSource Create(IEnumerator innerEnumerator, PlayerLoopTiming timing, CancellationToken cancellationToken, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new EnumeratorPromise(); + } + TaskTracker.TrackActiveTask(result, 3); + + result.innerEnumerator = ConsumeEnumerator(innerEnumerator); + result.cancellationToken = cancellationToken; + result.loopRunning = true; + result.calledGetResult = false; + result.initialFrame = -1; + + token = result.core.Version; + + // run immediately. + if (result.MoveNext()) + { + PlayerLoopHelper.AddAction(timing, result); + } + + return result; + } + + public void GetResult(short token) + { + try + { + calledGetResult = true; + core.GetResult(token); + } + finally + { + if (!loopRunning) + { + TryReturn(); + } + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (calledGetResult) + { + loopRunning = false; + TryReturn(); + return false; + } + + if (innerEnumerator == null) // invalid status, returned but loop running? + { + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + loopRunning = false; + core.TrySetCanceled(cancellationToken); + return false; + } + + if (initialFrame == -1) + { + // Time can not touch in threadpool. + if (PlayerLoopHelper.IsMainThread) + { + initialFrame = Time.frameCount; + } + } + else if (initialFrame == Time.frameCount) + { + return true; // already executed in first frame, skip. + } + + try + { + if (innerEnumerator.MoveNext()) + { + return true; + } + } + catch (Exception ex) + { + loopRunning = false; + core.TrySetException(ex); + return false; + } + + loopRunning = false; + core.TrySetResult(null); + return false; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + innerEnumerator = default; + cancellationToken = default; + + return pool.TryPush(this); + } + + // Unwrap YieldInstructions + + static IEnumerator ConsumeEnumerator(IEnumerator enumerator) + { + while (enumerator.MoveNext()) + { + var current = enumerator.Current; + if (current == null) + { + yield return null; + } + else if (current is CustomYieldInstruction cyi) + { + // WWW, WaitForSecondsRealtime + while (cyi.keepWaiting) + { + yield return null; + } + } + else if (current is YieldInstruction) + { + IEnumerator innerCoroutine = null; + switch (current) + { + case AsyncOperation ao: + innerCoroutine = UnwrapWaitAsyncOperation(ao); + break; + case WaitForSeconds wfs: + innerCoroutine = UnwrapWaitForSeconds(wfs); + break; + } + if (innerCoroutine != null) + { + while (innerCoroutine.MoveNext()) + { + yield return null; + } + } + else + { + goto WARN; + } + } + else if (current is IEnumerator e3) + { + var e4 = ConsumeEnumerator(e3); + while (e4.MoveNext()) + { + yield return null; + } + } + else + { + goto WARN; + } + + continue; + + WARN: + // WaitForEndOfFrame, WaitForFixedUpdate, others. + UnityEngine.Debug.LogWarning($"yield {current.GetType().Name} is not supported on await IEnumerator or IEnumerator.ToUniTask(), please use ToUniTask(MonoBehaviour coroutineRunner) instead."); + yield return null; + } + } + + static readonly FieldInfo waitForSeconds_Seconds = typeof(WaitForSeconds).GetField("m_Seconds", BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic); + + static IEnumerator UnwrapWaitForSeconds(WaitForSeconds waitForSeconds) + { + var second = (float)waitForSeconds_Seconds.GetValue(waitForSeconds); + var elapsed = 0.0f; + while (true) + { + yield return null; + + elapsed += Time.deltaTime; + if (elapsed >= second) + { + break; + } + }; + } + + static IEnumerator UnwrapWaitAsyncOperation(AsyncOperation asyncOperation) + { + while (!asyncOperation.isDone) + { + yield return null; + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/EnumeratorAsyncExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/EnumeratorAsyncExtensions.cs.meta new file mode 100644 index 00000000..a07b336d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/EnumeratorAsyncExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bc661232f11e4a741af54ba1c175d5ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/ExceptionExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/ExceptionExtensions.cs new file mode 100644 index 00000000..e4118980 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/ExceptionExtensions.cs @@ -0,0 +1,14 @@ + +using System; + +namespace Cysharp.Threading.Tasks +{ + public static class ExceptionExtensions + { + public static bool IsOperationCanceledException(this Exception exception) + { + return exception is OperationCanceledException; + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/ExceptionExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/ExceptionExtensions.cs.meta new file mode 100644 index 00000000..98330016 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/ExceptionExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 930800098504c0d46958ce23a0495202 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External.meta new file mode 100644 index 00000000..5cff7925 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05d1e9ad2e72d1a4a8f1452cac7d328d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables.meta new file mode 100644 index 00000000..cd85cef7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 463a32d4fc4eb3d4ba7746db0c9da073 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs new file mode 100644 index 00000000..a0ca8a1f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs @@ -0,0 +1,433 @@ +// asmdef Version Defines, enabled when com.unity.addressables is imported. + +#if UNITASK_ADDRESSABLE_SUPPORT + +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using System.Threading; +using UnityEngine.ResourceManagement.AsyncOperations; + +namespace Cysharp.Threading.Tasks +{ + public static class AddressablesAsyncExtensions + { +#region AsyncOperationHandle + + public static UniTask.Awaiter GetAwaiter(this AsyncOperationHandle handle) + { + return ToUniTask(handle).GetAwaiter(); + } + + public static UniTask WithCancellation(this AsyncOperationHandle handle, CancellationToken cancellationToken) + { + return ToUniTask(handle, cancellationToken: cancellationToken); + } + + public static UniTask WithCancellation(this AsyncOperationHandle handle, CancellationToken cancellationToken, bool cancelImmediately) + { + return ToUniTask(handle, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately); + } + + public static UniTask ToUniTask(this AsyncOperationHandle handle, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); + + if (!handle.IsValid()) + { + // autoReleaseHandle:true handle is invalid(immediately internal handle == null) so return completed. + return UniTask.CompletedTask; + } + + if (handle.IsDone) + { + if (handle.Status == AsyncOperationStatus.Failed) + { + return UniTask.FromException(handle.OperationException); + } + return UniTask.CompletedTask; + } + + return new UniTask(AsyncOperationHandleConfiguredSource.Create(handle, timing, progress, cancellationToken, cancelImmediately, out var token), token); + } + + public struct AsyncOperationHandleAwaiter : ICriticalNotifyCompletion + { + AsyncOperationHandle handle; + Action continuationAction; + + public AsyncOperationHandleAwaiter(AsyncOperationHandle handle) + { + this.handle = handle; + this.continuationAction = null; + } + + public bool IsCompleted => handle.IsDone; + + public void GetResult() + { + if (continuationAction != null) + { + handle.Completed -= continuationAction; + continuationAction = null; + } + + if (handle.Status == AsyncOperationStatus.Failed) + { + var e = handle.OperationException; + handle = default; + ExceptionDispatchInfo.Capture(e).Throw(); + } + + var result = handle.Result; + handle = default; + } + + public void OnCompleted(Action continuation) + { + UnsafeOnCompleted(continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); + continuationAction = PooledDelegate.Create(continuation); + handle.Completed += continuationAction; + } + } + + sealed class AsyncOperationHandleConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + AsyncOperationHandleConfiguredSource nextNode; + public ref AsyncOperationHandleConfiguredSource NextNode => ref nextNode; + + static AsyncOperationHandleConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(AsyncOperationHandleConfiguredSource), () => pool.Size); + } + + readonly Action continuationAction; + AsyncOperationHandle handle; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + IProgress progress; + bool completed; + + UniTaskCompletionSourceCore core; + + AsyncOperationHandleConfiguredSource() + { + continuationAction = Continuation; + } + + public static IUniTaskSource Create(AsyncOperationHandle handle, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new AsyncOperationHandleConfiguredSource(); + } + + result.handle = handle; + result.progress = progress; + result.cancellationToken = cancellationToken; + result.completed = false; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (AsyncOperationHandleConfiguredSource)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + handle.Completed += result.continuationAction; + + token = result.core.Version; + return result; + } + + void Continuation(AsyncOperationHandle _) + { + handle.Completed -= continuationAction; + + if (completed) + { + TryReturn(); + } + else + { + completed = true; + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + } + else if (handle.Status == AsyncOperationStatus.Failed) + { + core.TrySetException(handle.OperationException); + } + else + { + core.TrySetResult(AsyncUnit.Default); + } + } + } + + public void GetResult(short token) + { + core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (completed) + { + TryReturn(); + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + completed = true; + core.TrySetCanceled(cancellationToken); + return false; + } + + if (progress != null && handle.IsValid()) + { + progress.Report(handle.PercentComplete); + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + handle = default; + progress = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + +#endregion + +#region AsyncOperationHandle_T + + public static UniTask.Awaiter GetAwaiter(this AsyncOperationHandle handle) + { + return ToUniTask(handle).GetAwaiter(); + } + + public static UniTask WithCancellation(this AsyncOperationHandle handle, CancellationToken cancellationToken) + { + return ToUniTask(handle, cancellationToken: cancellationToken); + } + + public static UniTask WithCancellation(this AsyncOperationHandle handle, CancellationToken cancellationToken, bool cancelImmediately) + { + return ToUniTask(handle, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately); + } + + public static UniTask ToUniTask(this AsyncOperationHandle handle, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); + + if (!handle.IsValid()) + { + throw new Exception("Attempting to use an invalid operation handle"); + } + + if (handle.IsDone) + { + if (handle.Status == AsyncOperationStatus.Failed) + { + return UniTask.FromException(handle.OperationException); + } + return UniTask.FromResult(handle.Result); + } + + return new UniTask(AsyncOperationHandleConfiguredSource.Create(handle, timing, progress, cancellationToken, cancelImmediately, out var token), token); + } + + sealed class AsyncOperationHandleConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode> + { + static TaskPool> pool; + AsyncOperationHandleConfiguredSource nextNode; + public ref AsyncOperationHandleConfiguredSource NextNode => ref nextNode; + + static AsyncOperationHandleConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(AsyncOperationHandleConfiguredSource), () => pool.Size); + } + + readonly Action> continuationAction; + AsyncOperationHandle handle; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + IProgress progress; + bool completed; + + UniTaskCompletionSourceCore core; + + AsyncOperationHandleConfiguredSource() + { + continuationAction = Continuation; + } + + public static IUniTaskSource Create(AsyncOperationHandle handle, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new AsyncOperationHandleConfiguredSource(); + } + + result.handle = handle; + result.cancellationToken = cancellationToken; + result.completed = false; + result.progress = progress; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (AsyncOperationHandleConfiguredSource)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + handle.Completed += result.continuationAction; + + token = result.core.Version; + return result; + } + + void Continuation(AsyncOperationHandle argHandle) + { + handle.Completed -= continuationAction; + + if (completed) + { + TryReturn(); + } + else + { + completed = true; + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + } + else if (argHandle.Status == AsyncOperationStatus.Failed) + { + core.TrySetException(argHandle.OperationException); + } + else + { + core.TrySetResult(argHandle.Result); + } + } + } + + public T GetResult(short token) + { + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (completed) + { + TryReturn(); + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + completed = true; + core.TrySetCanceled(cancellationToken); + return false; + } + + if (progress != null && handle.IsValid()) + { + progress.Report(handle.PercentComplete); + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + handle = default; + progress = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + +#endregion + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs.meta new file mode 100644 index 00000000..6927930d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/AddressablesAsyncExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3dc6441f9094f354b931dc3c79fb99e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/UniTask.Addressables.asmdef b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/UniTask.Addressables.asmdef new file mode 100644 index 00000000..0439df75 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/UniTask.Addressables.asmdef @@ -0,0 +1,27 @@ +{ + "name": "UniTask.Addressables", + "references": [ + "UniTask", + "Unity.ResourceManager" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.unity.addressables", + "expression": "", + "define": "UNITASK_ADDRESSABLE_SUPPORT" + }, + { + "name": "com.unity.addressables.cn", + "expression": "", + "define": "UNITASK_ADDRESSABLE_SUPPORT" + } + ], + "noEngineReferences": false +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/UniTask.Addressables.asmdef.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/UniTask.Addressables.asmdef.meta new file mode 100644 index 00000000..b0178c4a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/Addressables/UniTask.Addressables.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 593a5b492d29ac6448b1ebf7f035ef33 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween.meta new file mode 100644 index 00000000..e31c927b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 86dab56391359e34684c5b3d65f1a2b8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/DOTweenAsyncExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/DOTweenAsyncExtensions.cs new file mode 100644 index 00000000..ba783672 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/DOTweenAsyncExtensions.cs @@ -0,0 +1,436 @@ +// asmdef Version Defines, enabled when com.demigiant.dotween is imported. + +#if UNITASK_DOTWEEN_SUPPORT + +using Cysharp.Threading.Tasks.Internal; +using DG.Tweening; +using System; +using System.Collections.Concurrent; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public enum TweenCancelBehaviour + { + Kill, + KillWithCompleteCallback, + Complete, + CompleteWithSequenceCallback, + CancelAwait, + + // AndCancelAwait + KillAndCancelAwait, + KillWithCompleteCallbackAndCancelAwait, + CompleteAndCancelAwait, + CompleteWithSequenceCallbackAndCancelAwait + } + + public static class DOTweenAsyncExtensions + { + enum CallbackType + { + Kill, + Complete, + Pause, + Play, + Rewind, + StepComplete + } + + public static TweenAwaiter GetAwaiter(this Tween tween) + { + return new TweenAwaiter(tween); + } + + public static UniTask WithCancellation(this Tween tween, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(tween, nameof(tween)); + + if (!tween.IsActive()) return UniTask.CompletedTask; + return new UniTask(TweenConfiguredSource.Create(tween, TweenCancelBehaviour.Kill, cancellationToken, CallbackType.Kill, out var token), token); + } + + public static UniTask ToUniTask(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = TweenCancelBehaviour.Kill, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(tween, nameof(tween)); + + if (!tween.IsActive()) return UniTask.CompletedTask; + return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Kill, out var token), token); + } + + public static UniTask AwaitForComplete(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = TweenCancelBehaviour.Kill, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(tween, nameof(tween)); + + if (!tween.IsActive()) return UniTask.CompletedTask; + return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Complete, out var token), token); + } + + public static UniTask AwaitForPause(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = TweenCancelBehaviour.Kill, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(tween, nameof(tween)); + + if (!tween.IsActive()) return UniTask.CompletedTask; + return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Pause, out var token), token); + } + + public static UniTask AwaitForPlay(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = TweenCancelBehaviour.Kill, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(tween, nameof(tween)); + + if (!tween.IsActive()) return UniTask.CompletedTask; + return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Play, out var token), token); + } + + public static UniTask AwaitForRewind(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = TweenCancelBehaviour.Kill, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(tween, nameof(tween)); + + if (!tween.IsActive()) return UniTask.CompletedTask; + return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.Rewind, out var token), token); + } + + public static UniTask AwaitForStepComplete(this Tween tween, TweenCancelBehaviour tweenCancelBehaviour = TweenCancelBehaviour.Kill, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(tween, nameof(tween)); + + if (!tween.IsActive()) return UniTask.CompletedTask; + return new UniTask(TweenConfiguredSource.Create(tween, tweenCancelBehaviour, cancellationToken, CallbackType.StepComplete, out var token), token); + } + + public struct TweenAwaiter : ICriticalNotifyCompletion + { + readonly Tween tween; + + // killed(non active) as completed. + public bool IsCompleted => !tween.IsActive(); + + public TweenAwaiter(Tween tween) + { + this.tween = tween; + } + + public TweenAwaiter GetAwaiter() + { + return this; + } + + public void GetResult() + { + } + + public void OnCompleted(System.Action continuation) + { + UnsafeOnCompleted(continuation); + } + + public void UnsafeOnCompleted(System.Action continuation) + { + // onKill is called after OnCompleted, both Complete(false/true) and Kill(false/true). + tween.onKill = PooledTweenCallback.Create(continuation); + } + } + + sealed class TweenConfiguredSource : IUniTaskSource, ITaskPoolNode + { + static TaskPool pool; + TweenConfiguredSource nextNode; + public ref TweenConfiguredSource NextNode => ref nextNode; + + static TweenConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(TweenConfiguredSource), () => pool.Size); + } + + readonly TweenCallback onCompleteCallbackDelegate; + + Tween tween; + TweenCancelBehaviour cancelBehaviour; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationRegistration; + CallbackType callbackType; + bool canceled; + + TweenCallback originalCompleteAction; + UniTaskCompletionSourceCore core; + + TweenConfiguredSource() + { + onCompleteCallbackDelegate = OnCompleteCallbackDelegate; + } + + public static IUniTaskSource Create(Tween tween, TweenCancelBehaviour cancelBehaviour, CancellationToken cancellationToken, CallbackType callbackType, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + DoCancelBeforeCreate(tween, cancelBehaviour); + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new TweenConfiguredSource(); + } + + result.tween = tween; + result.cancelBehaviour = cancelBehaviour; + result.cancellationToken = cancellationToken; + result.callbackType = callbackType; + result.canceled = false; + + switch (callbackType) + { + case CallbackType.Kill: + result.originalCompleteAction = tween.onKill; + tween.onKill = result.onCompleteCallbackDelegate; + break; + case CallbackType.Complete: + result.originalCompleteAction = tween.onComplete; + tween.onComplete = result.onCompleteCallbackDelegate; + break; + case CallbackType.Pause: + result.originalCompleteAction = tween.onPause; + tween.onPause = result.onCompleteCallbackDelegate; + break; + case CallbackType.Play: + result.originalCompleteAction = tween.onPlay; + tween.onPlay = result.onCompleteCallbackDelegate; + break; + case CallbackType.Rewind: + result.originalCompleteAction = tween.onRewind; + tween.onRewind = result.onCompleteCallbackDelegate; + break; + case CallbackType.StepComplete: + result.originalCompleteAction = tween.onStepComplete; + tween.onStepComplete = result.onCompleteCallbackDelegate; + break; + default: + break; + } + + if (result.originalCompleteAction == result.onCompleteCallbackDelegate) + { + result.originalCompleteAction = null; + } + + if (cancellationToken.CanBeCanceled) + { + result.cancellationRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(x => + { + var source = (TweenConfiguredSource)x; + switch (source.cancelBehaviour) + { + case TweenCancelBehaviour.Kill: + default: + source.tween.Kill(false); + break; + case TweenCancelBehaviour.KillAndCancelAwait: + source.canceled = true; + source.tween.Kill(false); + break; + case TweenCancelBehaviour.KillWithCompleteCallback: + source.tween.Kill(true); + break; + case TweenCancelBehaviour.KillWithCompleteCallbackAndCancelAwait: + source.canceled = true; + source.tween.Kill(true); + break; + case TweenCancelBehaviour.Complete: + source.tween.Complete(false); + break; + case TweenCancelBehaviour.CompleteAndCancelAwait: + source.canceled = true; + source.tween.Complete(false); + break; + case TweenCancelBehaviour.CompleteWithSequenceCallback: + source.tween.Complete(true); + break; + case TweenCancelBehaviour.CompleteWithSequenceCallbackAndCancelAwait: + source.canceled = true; + source.tween.Complete(true); + break; + case TweenCancelBehaviour.CancelAwait: + source.RestoreOriginalCallback(); + source.core.TrySetCanceled(source.cancellationToken); + break; + } + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + token = result.core.Version; + return result; + } + + void OnCompleteCallbackDelegate() + { + if (cancellationToken.IsCancellationRequested) + { + if (this.cancelBehaviour == TweenCancelBehaviour.KillAndCancelAwait + || this.cancelBehaviour == TweenCancelBehaviour.KillWithCompleteCallbackAndCancelAwait + || this.cancelBehaviour == TweenCancelBehaviour.CompleteAndCancelAwait + || this.cancelBehaviour == TweenCancelBehaviour.CompleteWithSequenceCallbackAndCancelAwait + || this.cancelBehaviour == TweenCancelBehaviour.CancelAwait) + { + canceled = true; + } + } + if (canceled) + { + core.TrySetCanceled(cancellationToken); + } + else + { + originalCompleteAction?.Invoke(); + core.TrySetResult(AsyncUnit.Default); + } + } + + static void DoCancelBeforeCreate(Tween tween, TweenCancelBehaviour tweenCancelBehaviour) + { + + switch (tweenCancelBehaviour) + { + case TweenCancelBehaviour.Kill: + default: + tween.Kill(false); + break; + case TweenCancelBehaviour.KillAndCancelAwait: + tween.Kill(false); + break; + case TweenCancelBehaviour.KillWithCompleteCallback: + tween.Kill(true); + break; + case TweenCancelBehaviour.KillWithCompleteCallbackAndCancelAwait: + tween.Kill(true); + break; + case TweenCancelBehaviour.Complete: + tween.Complete(false); + break; + case TweenCancelBehaviour.CompleteAndCancelAwait: + tween.Complete(false); + break; + case TweenCancelBehaviour.CompleteWithSequenceCallback: + tween.Complete(true); + break; + case TweenCancelBehaviour.CompleteWithSequenceCallbackAndCancelAwait: + tween.Complete(true); + break; + case TweenCancelBehaviour.CancelAwait: + break; + } + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + cancellationRegistration.Dispose(); + + RestoreOriginalCallback(); + + tween = default; + cancellationToken = default; + originalCompleteAction = default; + return pool.TryPush(this); + } + + void RestoreOriginalCallback() + { + switch (callbackType) + { + case CallbackType.Kill: + tween.onKill = originalCompleteAction; + break; + case CallbackType.Complete: + tween.onComplete = originalCompleteAction; + break; + case CallbackType.Pause: + tween.onPause = originalCompleteAction; + break; + case CallbackType.Play: + tween.onPlay = originalCompleteAction; + break; + case CallbackType.Rewind: + tween.onRewind = originalCompleteAction; + break; + case CallbackType.StepComplete: + tween.onStepComplete = originalCompleteAction; + break; + default: + break; + } + } + } + } + + sealed class PooledTweenCallback + { + static readonly ConcurrentQueue pool = new ConcurrentQueue(); + + readonly TweenCallback runDelegate; + + Action continuation; + + + PooledTweenCallback() + { + runDelegate = Run; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static TweenCallback Create(Action continuation) + { + if (!pool.TryDequeue(out var item)) + { + item = new PooledTweenCallback(); + } + + item.continuation = continuation; + return item.runDelegate; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + void Run() + { + var call = continuation; + continuation = null; + if (call != null) + { + pool.Enqueue(this); + call.Invoke(); + } + } + } +} + +#endif diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/DOTweenAsyncExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/DOTweenAsyncExtensions.cs.meta new file mode 100644 index 00000000..63131b04 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/DOTweenAsyncExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1f448d5bc5b232e4f98d89d5d1832e8e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/UniTask.DOTween.asmdef b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/UniTask.DOTween.asmdef new file mode 100644 index 00000000..7bdb2b61 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/UniTask.DOTween.asmdef @@ -0,0 +1,22 @@ +{ + "name": "UniTask.DOTween", + "references": [ + "UniTask", + "DOTween.Modules" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.demigiant.dotween", + "expression": "", + "define": "UNITASK_DOTWEEN_SUPPORT" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/UniTask.DOTween.asmdef.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/UniTask.DOTween.asmdef.meta new file mode 100644 index 00000000..427fe290 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/DOTween/UniTask.DOTween.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 029c1c1b674aaae47a6841a0b89ad80e +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro.meta new file mode 100644 index 00000000..0ea0c29d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4ebab659ea8b5b04aaf66dc9f9f2d117 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.InputField.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.InputField.cs new file mode 100644 index 00000000..22f081c2 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.InputField.cs @@ -0,0 +1,224 @@ +#if UNITASK_TEXTMESHPRO_SUPPORT + +using System; +using System.Threading; +using TMPro; + +namespace Cysharp.Threading.Tasks +{ + public static partial class TextMeshProAsyncExtensions + { + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onValueChanged, inputField.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onValueChanged, inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onValueChanged, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this TMP_InputField inputField) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onValueChanged, inputField.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onValueChanged, cancellationToken); + } + + public static IAsyncEndEditEventHandler GetAsyncEndEditEventHandler(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncEndEditEventHandler GetAsyncEndEditEventHandler(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, cancellationToken, false); + } + + public static UniTask OnEndEditAsync(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnEndEditAsync(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnEndEditAsAsyncEnumerable(this TMP_InputField inputField) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnEndEditAsAsyncEnumerable(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onEndEdit, cancellationToken); + } + + public static IAsyncEndTextSelectionEventHandler<(string, int, int)> GetAsyncEndTextSelectionEventHandler(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler<(string, int, int)>(new TextSelectionEventConverter(inputField.onEndTextSelection), inputField.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncEndTextSelectionEventHandler<(string, int, int)> GetAsyncEndTextSelectionEventHandler(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler<(string, int, int)>(new TextSelectionEventConverter(inputField.onEndTextSelection), cancellationToken, false); + } + + public static UniTask<(string, int, int)> OnEndTextSelectionAsync(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler<(string, int, int)>(new TextSelectionEventConverter(inputField.onEndTextSelection), inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask<(string, int, int)> OnEndTextSelectionAsync(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler<(string, int, int)>(new TextSelectionEventConverter(inputField.onEndTextSelection), cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable<(string, int, int)> OnEndTextSelectionAsAsyncEnumerable(this TMP_InputField inputField) + { + return new UnityEventHandlerAsyncEnumerable<(string, int, int)>(new TextSelectionEventConverter(inputField.onEndTextSelection), inputField.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable<(string, int, int)> OnEndTextSelectionAsAsyncEnumerable(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable<(string, int, int)>(new TextSelectionEventConverter(inputField.onEndTextSelection), cancellationToken); + } + + public static IAsyncTextSelectionEventHandler<(string, int, int)> GetAsyncTextSelectionEventHandler(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler<(string, int, int)>(new TextSelectionEventConverter(inputField.onTextSelection), inputField.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncTextSelectionEventHandler<(string, int, int)> GetAsyncTextSelectionEventHandler(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler<(string, int, int)>(new TextSelectionEventConverter(inputField.onTextSelection), cancellationToken, false); + } + + public static UniTask<(string, int, int)> OnTextSelectionAsync(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler<(string, int, int)>(new TextSelectionEventConverter(inputField.onTextSelection), inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask<(string, int, int)> OnTextSelectionAsync(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler<(string, int, int)>(new TextSelectionEventConverter(inputField.onTextSelection), cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable<(string, int, int)> OnTextSelectionAsAsyncEnumerable(this TMP_InputField inputField) + { + return new UnityEventHandlerAsyncEnumerable<(string, int, int)>(new TextSelectionEventConverter(inputField.onTextSelection), inputField.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable<(string, int, int)> OnTextSelectionAsAsyncEnumerable(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable<(string, int, int)>(new TextSelectionEventConverter(inputField.onTextSelection), cancellationToken); + } + + public static IAsyncDeselectEventHandler GetAsyncDeselectEventHandler(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onDeselect, inputField.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncDeselectEventHandler GetAsyncDeselectEventHandler(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onDeselect, cancellationToken, false); + } + + public static UniTask OnDeselectAsync(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onDeselect, inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnDeselectAsync(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onDeselect, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnDeselectAsAsyncEnumerable(this TMP_InputField inputField) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onDeselect, inputField.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnDeselectAsAsyncEnumerable(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onDeselect, cancellationToken); + } + + public static IAsyncSelectEventHandler GetAsyncSelectEventHandler(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onSelect, inputField.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncSelectEventHandler GetAsyncSelectEventHandler(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onSelect, cancellationToken, false); + } + + public static UniTask OnSelectAsync(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onSelect, inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnSelectAsync(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onSelect, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnSelectAsAsyncEnumerable(this TMP_InputField inputField) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onSelect, inputField.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnSelectAsAsyncEnumerable(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onSelect, cancellationToken); + } + + public static IAsyncSubmitEventHandler GetAsyncSubmitEventHandler(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onSubmit, inputField.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncSubmitEventHandler GetAsyncSubmitEventHandler(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onSubmit, cancellationToken, false); + } + + public static UniTask OnSubmitAsync(this TMP_InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onSubmit, inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnSubmitAsync(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onSubmit, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnSubmitAsAsyncEnumerable(this TMP_InputField inputField) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onSubmit, inputField.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnSubmitAsAsyncEnumerable(this TMP_InputField inputField, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onSubmit, cancellationToken); + } + + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.InputField.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.InputField.cs.meta new file mode 100644 index 00000000..2e39d2e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.InputField.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 79f4f2475e0b2c44e97ed1dee760627b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.cs new file mode 100644 index 00000000..362aa830 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.cs @@ -0,0 +1,130 @@ +#if UNITASK_TEXTMESHPRO_SUPPORT + +using System; +using System.Threading; +using TMPro; +using UnityEngine.Events; + +namespace Cysharp.Threading.Tasks +{ + public static partial class TextMeshProAsyncExtensions + { + // -> Text + public static void BindTo(this IUniTaskAsyncEnumerable source, TMP_Text text, bool rebindOnError = true) + { + BindToCore(source, text, text.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); + } + + public static void BindTo(this IUniTaskAsyncEnumerable source, TMP_Text text, CancellationToken cancellationToken, bool rebindOnError = true) + { + BindToCore(source, text, cancellationToken, rebindOnError).Forget(); + } + + static async UniTaskVoid BindToCore(IUniTaskAsyncEnumerable source, TMP_Text text, CancellationToken cancellationToken, bool rebindOnError) + { + var repeat = false; + BIND_AGAIN: + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (true) + { + bool moveNext; + try + { + moveNext = await e.MoveNextAsync(); + repeat = false; + } + catch (Exception ex) + { + if (ex is OperationCanceledException) return; + + if (rebindOnError && !repeat) + { + repeat = true; + goto BIND_AGAIN; + } + else + { + throw; + } + } + + if (!moveNext) return; + + text.text = e.Current; + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + // -> Text + + public static void BindTo(this IUniTaskAsyncEnumerable source, TMP_Text text, bool rebindOnError = true) + { + BindToCore(source, text, text.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); + } + + public static void BindTo(this IUniTaskAsyncEnumerable source, TMP_Text text, CancellationToken cancellationToken, bool rebindOnError = true) + { + BindToCore(source, text, cancellationToken, rebindOnError).Forget(); + } + + public static void BindTo(this AsyncReactiveProperty source, TMP_Text text, bool rebindOnError = true) + { + BindToCore(source, text, text.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); + } + + static async UniTaskVoid BindToCore(IUniTaskAsyncEnumerable source, TMP_Text text, CancellationToken cancellationToken, bool rebindOnError) + { + var repeat = false; + BIND_AGAIN: + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (true) + { + bool moveNext; + try + { + moveNext = await e.MoveNextAsync(); + repeat = false; + } + catch (Exception ex) + { + if (ex is OperationCanceledException) return; + + if (rebindOnError && !repeat) + { + repeat = true; + goto BIND_AGAIN; + } + else + { + throw; + } + } + + if (!moveNext) return; + + text.text = e.Current.ToString(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.cs.meta new file mode 100644 index 00000000..752d125c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/TextMeshProAsyncExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b6ba480edafb67d4e91bb10feb64fae5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/UniTask.TextMeshPro.asmdef b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/UniTask.TextMeshPro.asmdef new file mode 100644 index 00000000..6bb01d7f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/UniTask.TextMeshPro.asmdef @@ -0,0 +1,22 @@ +{ + "name": "UniTask.TextMeshPro", + "references": [ + "UniTask", + "Unity.TextMeshPro" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.unity.textmeshpro", + "expression": "", + "define": "UNITASK_TEXTMESHPRO_SUPPORT" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/UniTask.TextMeshPro.asmdef.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/UniTask.TextMeshPro.asmdef.meta new file mode 100644 index 00000000..4b59831d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/External/TextMeshPro/UniTask.TextMeshPro.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dc47925d1a5fa2946bdd37746b2b5d48 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskAsyncEnumerable.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskAsyncEnumerable.cs new file mode 100644 index 00000000..847d4305 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskAsyncEnumerable.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public interface IUniTaskAsyncEnumerable + { + IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default); + } + + public interface IUniTaskAsyncEnumerator : IUniTaskAsyncDisposable + { + T Current { get; } + UniTask MoveNextAsync(); + } + + public interface IUniTaskAsyncDisposable + { + UniTask DisposeAsync(); + } + + public interface IUniTaskOrderedAsyncEnumerable : IUniTaskAsyncEnumerable + { + IUniTaskOrderedAsyncEnumerable CreateOrderedEnumerable(Func keySelector, IComparer comparer, bool descending); + IUniTaskOrderedAsyncEnumerable CreateOrderedEnumerable(Func> keySelector, IComparer comparer, bool descending); + IUniTaskOrderedAsyncEnumerable CreateOrderedEnumerable(Func> keySelector, IComparer comparer, bool descending); + } + + public interface IConnectableUniTaskAsyncEnumerable : IUniTaskAsyncEnumerable + { + IDisposable Connect(); + } + + // don't use AsyncGrouping. + //public interface IUniTaskAsyncGrouping : IUniTaskAsyncEnumerable + //{ + // TKey Key { get; } + //} + + public static class UniTaskAsyncEnumerableExtensions + { + public static UniTaskCancelableAsyncEnumerable WithCancellation(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + return new UniTaskCancelableAsyncEnumerable(source, cancellationToken); + } + } + + [StructLayout(LayoutKind.Auto)] + public readonly struct UniTaskCancelableAsyncEnumerable + { + private readonly IUniTaskAsyncEnumerable enumerable; + private readonly CancellationToken cancellationToken; + + internal UniTaskCancelableAsyncEnumerable(IUniTaskAsyncEnumerable enumerable, CancellationToken cancellationToken) + { + this.enumerable = enumerable; + this.cancellationToken = cancellationToken; + } + + public Enumerator GetAsyncEnumerator() + { + return new Enumerator(enumerable.GetAsyncEnumerator(cancellationToken)); + } + + [StructLayout(LayoutKind.Auto)] + public readonly struct Enumerator + { + private readonly IUniTaskAsyncEnumerator enumerator; + + internal Enumerator(IUniTaskAsyncEnumerator enumerator) + { + this.enumerator = enumerator; + } + + public T Current => enumerator.Current; + + public UniTask MoveNextAsync() + { + return enumerator.MoveNextAsync(); + } + + + public UniTask DisposeAsync() + { + return enumerator.DisposeAsync(); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskAsyncEnumerable.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskAsyncEnumerable.cs.meta new file mode 100644 index 00000000..12f0fe52 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskAsyncEnumerable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b20cf9f02ac585948a4372fa4ee06504 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskSource.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskSource.cs new file mode 100644 index 00000000..88147811 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskSource.cs @@ -0,0 +1,124 @@ +#pragma warning disable CS1591 + +using System; +using System.Runtime.CompilerServices; + +namespace Cysharp.Threading.Tasks +{ + public enum UniTaskStatus + { + /// The operation has not yet completed. + Pending = 0, + /// The operation completed successfully. + Succeeded = 1, + /// The operation completed with an error. + Faulted = 2, + /// The operation completed due to cancellation. + Canceled = 3 + } + + // similar as IValueTaskSource + public interface IUniTaskSource +#if !UNITY_2018_3_OR_NEWER && !NETSTANDARD2_0 + : System.Threading.Tasks.Sources.IValueTaskSource +#pragma warning disable CS0108 +#endif + { + UniTaskStatus GetStatus(short token); + void OnCompleted(Action continuation, object state, short token); + void GetResult(short token); + + UniTaskStatus UnsafeGetStatus(); // only for debug use. + +#if !UNITY_2018_3_OR_NEWER && !NETSTANDARD2_0 +#pragma warning restore CS0108 + + System.Threading.Tasks.Sources.ValueTaskSourceStatus System.Threading.Tasks.Sources.IValueTaskSource.GetStatus(short token) + { + return (System.Threading.Tasks.Sources.ValueTaskSourceStatus)(int)((IUniTaskSource)this).GetStatus(token); + } + + void System.Threading.Tasks.Sources.IValueTaskSource.GetResult(short token) + { + ((IUniTaskSource)this).GetResult(token); + } + + void System.Threading.Tasks.Sources.IValueTaskSource.OnCompleted(Action continuation, object state, short token, System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags flags) + { + // ignore flags, always none. + ((IUniTaskSource)this).OnCompleted(continuation, state, token); + } + +#endif + } + + public interface IUniTaskSource : IUniTaskSource +#if !UNITY_2018_3_OR_NEWER && !NETSTANDARD2_0 + , System.Threading.Tasks.Sources.IValueTaskSource +#endif + { + new T GetResult(short token); + +#if !UNITY_2018_3_OR_NEWER && !NETSTANDARD2_0 + + new public UniTaskStatus GetStatus(short token) + { + return ((IUniTaskSource)this).GetStatus(token); + } + + new public void OnCompleted(Action continuation, object state, short token) + { + ((IUniTaskSource)this).OnCompleted(continuation, state, token); + } + + System.Threading.Tasks.Sources.ValueTaskSourceStatus System.Threading.Tasks.Sources.IValueTaskSource.GetStatus(short token) + { + return (System.Threading.Tasks.Sources.ValueTaskSourceStatus)(int)((IUniTaskSource)this).GetStatus(token); + } + + T System.Threading.Tasks.Sources.IValueTaskSource.GetResult(short token) + { + return ((IUniTaskSource)this).GetResult(token); + } + + void System.Threading.Tasks.Sources.IValueTaskSource.OnCompleted(Action continuation, object state, short token, System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags flags) + { + // ignore flags, always none. + ((IUniTaskSource)this).OnCompleted(continuation, state, token); + } + +#endif + } + + public static class UniTaskStatusExtensions + { + /// status != Pending. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsCompleted(this UniTaskStatus status) + { + return status != UniTaskStatus.Pending; + } + + /// status == Succeeded. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsCompletedSuccessfully(this UniTaskStatus status) + { + return status == UniTaskStatus.Succeeded; + } + + /// status == Canceled. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsCanceled(this UniTaskStatus status) + { + return status == UniTaskStatus.Canceled; + } + + /// status == Faulted. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsFaulted(this UniTaskStatus status) + { + return status == UniTaskStatus.Faulted; + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskSource.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskSource.cs.meta new file mode 100644 index 00000000..b225d1c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/IUniTaskSource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e4d023d8404ab742b5e808c98097c3c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal.meta new file mode 100644 index 00000000..14356189 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: afeb30001a8f4724380677a83b3a646e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPool.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPool.cs new file mode 100644 index 00000000..e1d9d3b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPool.cs @@ -0,0 +1,150 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Internal +{ + // Same interface as System.Buffers.ArrayPool but only provides Shared. + + internal sealed class ArrayPool + { + // Same size as System.Buffers.DefaultArrayPool + const int DefaultMaxNumberOfArraysPerBucket = 50; + + static readonly T[] EmptyArray = new T[0]; + + public static readonly ArrayPool Shared = new ArrayPool(); + + readonly MinimumQueue[] buckets; + readonly SpinLock[] locks; + + ArrayPool() + { + // see: GetQueueIndex + buckets = new MinimumQueue[18]; + locks = new SpinLock[18]; + for (int i = 0; i < buckets.Length; i++) + { + buckets[i] = new MinimumQueue(4); + locks[i] = new SpinLock(false); + } + } + + public T[] Rent(int minimumLength) + { + if (minimumLength < 0) + { + throw new ArgumentOutOfRangeException("minimumLength"); + } + else if (minimumLength == 0) + { + return EmptyArray; + } + + var size = CalculateSize(minimumLength); + var index = GetQueueIndex(size); + if (index != -1) + { + var q = buckets[index]; + var lockTaken = false; + try + { + locks[index].Enter(ref lockTaken); + + if (q.Count != 0) + { + return q.Dequeue(); + } + } + finally + { + if (lockTaken) locks[index].Exit(false); + } + } + + return new T[size]; + } + + public void Return(T[] array, bool clearArray = false) + { + if (array == null || array.Length == 0) + { + return; + } + + var index = GetQueueIndex(array.Length); + if (index != -1) + { + if (clearArray) + { + Array.Clear(array, 0, array.Length); + } + + var q = buckets[index]; + var lockTaken = false; + + try + { + locks[index].Enter(ref lockTaken); + + if (q.Count > DefaultMaxNumberOfArraysPerBucket) + { + return; + } + + q.Enqueue(array); + } + finally + { + if (lockTaken) locks[index].Exit(false); + } + } + } + + static int CalculateSize(int size) + { + size--; + size |= size >> 1; + size |= size >> 2; + size |= size >> 4; + size |= size >> 8; + size |= size >> 16; + size += 1; + + if (size < 8) + { + size = 8; + } + + return size; + } + + static int GetQueueIndex(int size) + { + switch (size) + { + case 8: return 0; + case 16: return 1; + case 32: return 2; + case 64: return 3; + case 128: return 4; + case 256: return 5; + case 512: return 6; + case 1024: return 7; + case 2048: return 8; + case 4096: return 9; + case 8192: return 10; + case 16384: return 11; + case 32768: return 12; + case 65536: return 13; + case 131072: return 14; + case 262144: return 15; + case 524288: return 16; + case 1048576: return 17; // max array length + default: + return -1; + } + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPool.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPool.cs.meta new file mode 100644 index 00000000..693816cc --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPool.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: f83ebad81fb89fb4882331616ca6d248 +timeCreated: 1532361008 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPoolUtil.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPoolUtil.cs new file mode 100644 index 00000000..016901db --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPoolUtil.cs @@ -0,0 +1,115 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal static class ArrayPoolUtil + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void EnsureCapacity(ref T[] array, int index, ArrayPool pool) + { + if (array.Length <= index) + { + EnsureCapacityCore(ref array, index, pool); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void EnsureCapacityCore(ref T[] array, int index, ArrayPool pool) + { + if (array.Length <= index) + { + var newSize = array.Length * 2; + var newArray = pool.Rent((index < newSize) ? newSize : (index * 2)); + Array.Copy(array, 0, newArray, 0, array.Length); + + pool.Return(array, clearArray: !RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + + array = newArray; + } + } + + public static RentArray Materialize(IEnumerable source) + { + if (source is T[] array) + { + return new RentArray(array, array.Length, null); + } + + var defaultCount = 32; + if (source is ICollection coll) + { + if (coll.Count == 0) + { + return new RentArray(Array.Empty(), 0, null); + } + + defaultCount = coll.Count; + var pool = ArrayPool.Shared; + var buffer = pool.Rent(defaultCount); + coll.CopyTo(buffer, 0); + return new RentArray(buffer, coll.Count, pool); + } + else if (source is IReadOnlyCollection rcoll) + { + defaultCount = rcoll.Count; + } + + if (defaultCount == 0) + { + return new RentArray(Array.Empty(), 0, null); + } + + { + var pool = ArrayPool.Shared; + + var index = 0; + var buffer = pool.Rent(defaultCount); + foreach (var item in source) + { + EnsureCapacity(ref buffer, index, pool); + buffer[index++] = item; + } + + return new RentArray(buffer, index, pool); + } + } + + public struct RentArray : IDisposable + { + public readonly T[] Array; + public readonly int Length; + ArrayPool pool; + + public RentArray(T[] array, int length, ArrayPool pool) + { + this.Array = array; + this.Length = length; + this.pool = pool; + } + + public void Dispose() + { + DisposeManually(!RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + } + + public void DisposeManually(bool clearArray) + { + if (pool != null) + { + if (clearArray) + { + System.Array.Clear(Array, 0, Length); + } + + pool.Return(Array, clearArray: false); + pool = null; + } + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPoolUtil.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPoolUtil.cs.meta new file mode 100644 index 00000000..e06ec652 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayPoolUtil.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 424cc208fb61d4e448b08fcfa0eee25e +timeCreated: 1532361007 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayUtil.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayUtil.cs new file mode 100644 index 00000000..fc7a808c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayUtil.cs @@ -0,0 +1,73 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal static class ArrayUtil + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void EnsureCapacity(ref T[] array, int index) + { + if (array.Length <= index) + { + EnsureCore(ref array, index); + } + } + + // rare case, no inlining. + [MethodImpl(MethodImplOptions.NoInlining)] + static void EnsureCore(ref T[] array, int index) + { + var newSize = array.Length * 2; + var newArray = new T[(index < newSize) ? newSize : (index * 2)]; + Array.Copy(array, 0, newArray, 0, array.Length); + + array = newArray; + } + + /// + /// Optimizing utility to avoid .ToArray() that creates buffer copy(cut to just size). + /// + public static (T[] array, int length) Materialize(IEnumerable source) + { + if (source is T[] array) + { + return (array, array.Length); + } + + var defaultCount = 4; + if (source is ICollection coll) + { + defaultCount = coll.Count; + var buffer = new T[defaultCount]; + coll.CopyTo(buffer, 0); + return (buffer, defaultCount); + } + else if (source is IReadOnlyCollection rcoll) + { + defaultCount = rcoll.Count; + } + + if (defaultCount == 0) + { + return (Array.Empty(), 0); + } + + { + var index = 0; + var buffer = new T[defaultCount]; + foreach (var item in source) + { + EnsureCapacity(ref buffer, index); + buffer[index++] = item; + } + + return (buffer, index); + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayUtil.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayUtil.cs.meta new file mode 100644 index 00000000..645fc4ed --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ArrayUtil.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 23146a82ec99f2542a87971c8d3d7988 +timeCreated: 1532361007 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs new file mode 100644 index 00000000..a3111268 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs @@ -0,0 +1,225 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal sealed class ContinuationQueue + { + const int MaxArrayLength = 0X7FEFFFFF; + const int InitialSize = 16; + + readonly PlayerLoopTiming timing; + + SpinLock gate = new SpinLock(false); + bool dequing = false; + + int actionListCount = 0; + Action[] actionList = new Action[InitialSize]; + + int waitingListCount = 0; + Action[] waitingList = new Action[InitialSize]; + + public ContinuationQueue(PlayerLoopTiming timing) + { + this.timing = timing; + } + + public void Enqueue(Action continuation) + { + bool lockTaken = false; + try + { + gate.Enter(ref lockTaken); + + if (dequing) + { + // Ensure Capacity + if (waitingList.Length == waitingListCount) + { + var newLength = waitingListCount * 2; + if ((uint)newLength > MaxArrayLength) newLength = MaxArrayLength; + + var newArray = new Action[newLength]; + Array.Copy(waitingList, newArray, waitingListCount); + waitingList = newArray; + } + waitingList[waitingListCount] = continuation; + waitingListCount++; + } + else + { + // Ensure Capacity + if (actionList.Length == actionListCount) + { + var newLength = actionListCount * 2; + if ((uint)newLength > MaxArrayLength) newLength = MaxArrayLength; + + var newArray = new Action[newLength]; + Array.Copy(actionList, newArray, actionListCount); + actionList = newArray; + } + actionList[actionListCount] = continuation; + actionListCount++; + } + } + finally + { + if (lockTaken) gate.Exit(false); + } + } + + public int Clear() + { + var rest = actionListCount + waitingListCount; + + actionListCount = 0; + actionList = new Action[InitialSize]; + + waitingListCount = 0; + waitingList = new Action[InitialSize]; + + return rest; + } + + // delegate entrypoint. + public void Run() + { + // for debugging, create named stacktrace. +#if DEBUG + switch (timing) + { + case PlayerLoopTiming.Initialization: + Initialization(); + break; + case PlayerLoopTiming.LastInitialization: + LastInitialization(); + break; + case PlayerLoopTiming.EarlyUpdate: + EarlyUpdate(); + break; + case PlayerLoopTiming.LastEarlyUpdate: + LastEarlyUpdate(); + break; + case PlayerLoopTiming.FixedUpdate: + FixedUpdate(); + break; + case PlayerLoopTiming.LastFixedUpdate: + LastFixedUpdate(); + break; + case PlayerLoopTiming.PreUpdate: + PreUpdate(); + break; + case PlayerLoopTiming.LastPreUpdate: + LastPreUpdate(); + break; + case PlayerLoopTiming.Update: + Update(); + break; + case PlayerLoopTiming.LastUpdate: + LastUpdate(); + break; + case PlayerLoopTiming.PreLateUpdate: + PreLateUpdate(); + break; + case PlayerLoopTiming.LastPreLateUpdate: + LastPreLateUpdate(); + break; + case PlayerLoopTiming.PostLateUpdate: + PostLateUpdate(); + break; + case PlayerLoopTiming.LastPostLateUpdate: + LastPostLateUpdate(); + break; +#if UNITY_2020_2_OR_NEWER + case PlayerLoopTiming.TimeUpdate: + TimeUpdate(); + break; + case PlayerLoopTiming.LastTimeUpdate: + LastTimeUpdate(); + break; +#endif + default: + break; + } +#else + RunCore(); +#endif + } + + void Initialization() => RunCore(); + void LastInitialization() => RunCore(); + void EarlyUpdate() => RunCore(); + void LastEarlyUpdate() => RunCore(); + void FixedUpdate() => RunCore(); + void LastFixedUpdate() => RunCore(); + void PreUpdate() => RunCore(); + void LastPreUpdate() => RunCore(); + void Update() => RunCore(); + void LastUpdate() => RunCore(); + void PreLateUpdate() => RunCore(); + void LastPreLateUpdate() => RunCore(); + void PostLateUpdate() => RunCore(); + void LastPostLateUpdate() => RunCore(); +#if UNITY_2020_2_OR_NEWER + void TimeUpdate() => RunCore(); + void LastTimeUpdate() => RunCore(); +#endif + + [System.Diagnostics.DebuggerHidden] + void RunCore() + { + { + bool lockTaken = false; + try + { + gate.Enter(ref lockTaken); + if (actionListCount == 0) return; + dequing = true; + } + finally + { + if (lockTaken) gate.Exit(false); + } + } + + for (int i = 0; i < actionListCount; i++) + { + + var action = actionList[i]; + actionList[i] = null; + try + { + action(); + } + catch (Exception ex) + { + UnityEngine.Debug.LogException(ex); + } + } + + { + bool lockTaken = false; + try + { + gate.Enter(ref lockTaken); + dequing = false; + + var swapTempActionList = actionList; + + actionListCount = waitingListCount; + actionList = waitingList; + + waitingListCount = 0; + waitingList = swapTempActionList; + } + finally + { + if (lockTaken) gate.Exit(false); + } + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs.meta new file mode 100644 index 00000000..b04e5418 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ContinuationQueue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f66c32454e50f2546b17deadc80a4c77 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/DiagnosticsExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/DiagnosticsExtensions.cs new file mode 100644 index 00000000..77d998fb --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/DiagnosticsExtensions.cs @@ -0,0 +1,249 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Security; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using UnityEngine; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal static class DiagnosticsExtensions + { + static bool displayFilenames = true; + + static readonly Regex typeBeautifyRegex = new Regex("`.+$", RegexOptions.Compiled); + + static readonly Dictionary builtInTypeNames = new Dictionary + { + { typeof(void), "void" }, + { typeof(bool), "bool" }, + { typeof(byte), "byte" }, + { typeof(char), "char" }, + { typeof(decimal), "decimal" }, + { typeof(double), "double" }, + { typeof(float), "float" }, + { typeof(int), "int" }, + { typeof(long), "long" }, + { typeof(object), "object" }, + { typeof(sbyte), "sbyte" }, + { typeof(short), "short" }, + { typeof(string), "string" }, + { typeof(uint), "uint" }, + { typeof(ulong), "ulong" }, + { typeof(ushort), "ushort" }, + { typeof(Task), "Task" }, + { typeof(UniTask), "UniTask" }, + { typeof(UniTaskVoid), "UniTaskVoid" } + }; + + public static string CleanupAsyncStackTrace(this StackTrace stackTrace) + { + if (stackTrace == null) return ""; + + var sb = new StringBuilder(); + for (int i = 0; i < stackTrace.FrameCount; i++) + { + var sf = stackTrace.GetFrame(i); + + var mb = sf.GetMethod(); + + if (IgnoreLine(mb)) continue; + if (IsAsync(mb)) + { + sb.Append("async "); + TryResolveStateMachineMethod(ref mb, out var decType); + } + + // return type + if (mb is MethodInfo mi) + { + sb.Append(BeautifyType(mi.ReturnType, false)); + sb.Append(" "); + } + + // method name + sb.Append(BeautifyType(mb.DeclaringType, false)); + if (!mb.IsConstructor) + { + sb.Append("."); + } + sb.Append(mb.Name); + if (mb.IsGenericMethod) + { + sb.Append("<"); + foreach (var item in mb.GetGenericArguments()) + { + sb.Append(BeautifyType(item, true)); + } + sb.Append(">"); + } + + // parameter + sb.Append("("); + sb.Append(string.Join(", ", mb.GetParameters().Select(p => BeautifyType(p.ParameterType, true) + " " + p.Name))); + sb.Append(")"); + + // file name + if (displayFilenames && (sf.GetILOffset() != -1)) + { + String fileName = null; + + try + { + fileName = sf.GetFileName(); + } + catch (NotSupportedException) + { + displayFilenames = false; + } + catch (SecurityException) + { + displayFilenames = false; + } + + if (fileName != null) + { + sb.Append(' '); + sb.AppendFormat(CultureInfo.InvariantCulture, "(at {0})", AppendHyperLink(fileName, sf.GetFileLineNumber().ToString())); + } + } + + sb.AppendLine(); + } + return sb.ToString(); + } + + + static bool IsAsync(MethodBase methodInfo) + { + var declareType = methodInfo.DeclaringType; + return typeof(IAsyncStateMachine).IsAssignableFrom(declareType); + } + + // code from Ben.Demystifier/EnhancedStackTrace.Frame.cs + static bool TryResolveStateMachineMethod(ref MethodBase method, out Type declaringType) + { + declaringType = method.DeclaringType; + + var parentType = declaringType.DeclaringType; + if (parentType == null) + { + return false; + } + + var methods = parentType.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly); + if (methods == null) + { + return false; + } + + foreach (var candidateMethod in methods) + { + var attributes = candidateMethod.GetCustomAttributes(false); + if (attributes == null) + { + continue; + } + + foreach (var asma in attributes) + { + if (asma.StateMachineType == declaringType) + { + method = candidateMethod; + declaringType = candidateMethod.DeclaringType; + // Mark the iterator as changed; so it gets the + annotation of the original method + // async statemachines resolve directly to their builder methods so aren't marked as changed + return asma is IteratorStateMachineAttribute; + } + } + } + + return false; + } + + static string BeautifyType(Type t, bool shortName) + { + if (builtInTypeNames.TryGetValue(t, out var builtin)) + { + return builtin; + } + if (t.IsGenericParameter) return t.Name; + if (t.IsArray) return BeautifyType(t.GetElementType(), shortName) + "[]"; + if (t.FullName?.StartsWith("System.ValueTuple") ?? false) + { + return "(" + string.Join(", ", t.GetGenericArguments().Select(x => BeautifyType(x, true))) + ")"; + } + if (!t.IsGenericType) return shortName ? t.Name : t.FullName.Replace("Cysharp.Threading.Tasks.Triggers.", "").Replace("Cysharp.Threading.Tasks.Internal.", "").Replace("Cysharp.Threading.Tasks.", "") ?? t.Name; + + var innerFormat = string.Join(", ", t.GetGenericArguments().Select(x => BeautifyType(x, true))); + + var genericType = t.GetGenericTypeDefinition().FullName; + if (genericType == "System.Threading.Tasks.Task`1") + { + genericType = "Task"; + } + + return typeBeautifyRegex.Replace(genericType, "").Replace("Cysharp.Threading.Tasks.Triggers.", "").Replace("Cysharp.Threading.Tasks.Internal.", "").Replace("Cysharp.Threading.Tasks.", "") + "<" + innerFormat + ">"; + } + + static bool IgnoreLine(MethodBase methodInfo) + { + var declareType = methodInfo.DeclaringType.FullName; + if (declareType == "System.Threading.ExecutionContext") + { + return true; + } + else if (declareType.StartsWith("System.Runtime.CompilerServices")) + { + return true; + } + else if (declareType.StartsWith("Cysharp.Threading.Tasks.CompilerServices")) + { + return true; + } + else if (declareType == "System.Threading.Tasks.AwaitTaskContinuation") + { + return true; + } + else if (declareType.StartsWith("System.Threading.Tasks.Task")) + { + return true; + } + else if (declareType.StartsWith("Cysharp.Threading.Tasks.UniTaskCompletionSourceCore")) + { + return true; + } + else if (declareType.StartsWith("Cysharp.Threading.Tasks.AwaiterActions")) + { + return true; + } + + return false; + } + + static string AppendHyperLink(string path, string line) + { + var fi = new FileInfo(path); + if (fi.Directory == null) + { + return fi.Name; + } + else + { + var fname = fi.FullName.Replace(Path.DirectorySeparatorChar, '/').Replace(PlayerLoopHelper.ApplicationDataPath, ""); + var withAssetsPath = "Assets/" + fname; + return "" + withAssetsPath + ":" + line + ""; + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/DiagnosticsExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/DiagnosticsExtensions.cs.meta new file mode 100644 index 00000000..6c1f06c2 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/DiagnosticsExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f80fb1c9ed4c99447be1b0a47a8d980b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/Error.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/Error.cs new file mode 100644 index 00000000..9664491e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/Error.cs @@ -0,0 +1,79 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Runtime.CompilerServices; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal static class Error + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ThrowArgumentNullException(T value, string paramName) + where T : class + { + if (value == null) ThrowArgumentNullExceptionCore(paramName); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void ThrowArgumentNullExceptionCore(string paramName) + { + throw new ArgumentNullException(paramName); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Exception ArgumentOutOfRange(string paramName) + { + return new ArgumentOutOfRangeException(paramName); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Exception NoElements() + { + return new InvalidOperationException("Source sequence doesn't contain any elements."); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Exception MoreThanOneElement() + { + return new InvalidOperationException("Source sequence contains more than one element."); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowArgumentException(string message) + { + throw new ArgumentException(message); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowNotYetCompleted() + { + throw new InvalidOperationException("Not yet completed."); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static T ThrowNotYetCompleted() + { + throw new InvalidOperationException("Not yet completed."); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ThrowWhenContinuationIsAlreadyRegistered(T continuationField) + where T : class + { + if (continuationField != null) ThrowInvalidOperationExceptionCore("continuation is already registered."); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void ThrowInvalidOperationExceptionCore(string message) + { + throw new InvalidOperationException(message); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static void ThrowOperationCanceledException() + { + throw new OperationCanceledException(); + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/Error.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/Error.cs.meta new file mode 100644 index 00000000..2e5d219a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/Error.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 5f39f495294d4604b8082202faf98554 +timeCreated: 1532361007 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs new file mode 100644 index 00000000..a6b567ad --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs @@ -0,0 +1,112 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Runtime.CompilerServices; + +namespace Cysharp.Threading.Tasks.Internal +{ + // optimized version of Standard Queue. + internal class MinimumQueue + { + const int MinimumGrow = 4; + const int GrowFactor = 200; + + T[] array; + int head; + int tail; + int size; + + public MinimumQueue(int capacity) + { + if (capacity < 0) throw new ArgumentOutOfRangeException("capacity"); + array = new T[capacity]; + head = tail = size = 0; + } + + public int Count + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get { return size; } + } + + public T Peek() + { + if (size == 0) ThrowForEmptyQueue(); + return array[head]; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Enqueue(T item) + { + if (size == array.Length) + { + Grow(); + } + + array[tail] = item; + MoveNext(ref tail); + size++; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public T Dequeue() + { + if (size == 0) ThrowForEmptyQueue(); + + int head = this.head; + T[] array = this.array; + T removed = array[head]; + array[head] = default(T); + MoveNext(ref this.head); + size--; + return removed; + } + + void Grow() + { + int newcapacity = (int)((long)array.Length * (long)GrowFactor / 100); + if (newcapacity < array.Length + MinimumGrow) + { + newcapacity = array.Length + MinimumGrow; + } + SetCapacity(newcapacity); + } + + void SetCapacity(int capacity) + { + T[] newarray = new T[capacity]; + if (size > 0) + { + if (head < tail) + { + Array.Copy(array, head, newarray, 0, size); + } + else + { + Array.Copy(array, head, newarray, 0, array.Length - head); + Array.Copy(array, 0, newarray, array.Length - head, tail); + } + } + + array = newarray; + head = 0; + tail = (size == capacity) ? 0 : size; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + void MoveNext(ref int index) + { + int tmp = index + 1; + if (tmp == array.Length) + { + tmp = 0; + } + index = tmp; + } + + void ThrowForEmptyQueue() + { + throw new InvalidOperationException("EmptyQueue"); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs.meta new file mode 100644 index 00000000..dc067367 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/MinimumQueue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7d63add489ccc99498114d79702b904d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs new file mode 100644 index 00000000..43625ab5 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs @@ -0,0 +1,260 @@ + +using System; +using UnityEngine; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal sealed class PlayerLoopRunner + { + const int InitialSize = 16; + + readonly PlayerLoopTiming timing; + readonly object runningAndQueueLock = new object(); + readonly object arrayLock = new object(); + readonly Action unhandledExceptionCallback; + + int tail = 0; + bool running = false; + IPlayerLoopItem[] loopItems = new IPlayerLoopItem[InitialSize]; + MinimumQueue waitQueue = new MinimumQueue(InitialSize); + + + + public PlayerLoopRunner(PlayerLoopTiming timing) + { + this.unhandledExceptionCallback = ex => Debug.LogException(ex); + this.timing = timing; + } + + public void AddAction(IPlayerLoopItem item) + { + lock (runningAndQueueLock) + { + if (running) + { + waitQueue.Enqueue(item); + return; + } + } + + lock (arrayLock) + { + // Ensure Capacity + if (loopItems.Length == tail) + { + Array.Resize(ref loopItems, checked(tail * 2)); + } + loopItems[tail++] = item; + } + } + + public int Clear() + { + lock (arrayLock) + { + var rest = 0; + + for (var index = 0; index < loopItems.Length; index++) + { + if (loopItems[index] != null) + { + rest++; + } + + loopItems[index] = null; + } + + tail = 0; + return rest; + } + } + + // delegate entrypoint. + public void Run() + { + // for debugging, create named stacktrace. +#if DEBUG + switch (timing) + { + case PlayerLoopTiming.Initialization: + Initialization(); + break; + case PlayerLoopTiming.LastInitialization: + LastInitialization(); + break; + case PlayerLoopTiming.EarlyUpdate: + EarlyUpdate(); + break; + case PlayerLoopTiming.LastEarlyUpdate: + LastEarlyUpdate(); + break; + case PlayerLoopTiming.FixedUpdate: + FixedUpdate(); + break; + case PlayerLoopTiming.LastFixedUpdate: + LastFixedUpdate(); + break; + case PlayerLoopTiming.PreUpdate: + PreUpdate(); + break; + case PlayerLoopTiming.LastPreUpdate: + LastPreUpdate(); + break; + case PlayerLoopTiming.Update: + Update(); + break; + case PlayerLoopTiming.LastUpdate: + LastUpdate(); + break; + case PlayerLoopTiming.PreLateUpdate: + PreLateUpdate(); + break; + case PlayerLoopTiming.LastPreLateUpdate: + LastPreLateUpdate(); + break; + case PlayerLoopTiming.PostLateUpdate: + PostLateUpdate(); + break; + case PlayerLoopTiming.LastPostLateUpdate: + LastPostLateUpdate(); + break; +#if UNITY_2020_2_OR_NEWER + case PlayerLoopTiming.TimeUpdate: + TimeUpdate(); + break; + case PlayerLoopTiming.LastTimeUpdate: + LastTimeUpdate(); + break; +#endif + default: + break; + } +#else + RunCore(); +#endif + } + + void Initialization() => RunCore(); + void LastInitialization() => RunCore(); + void EarlyUpdate() => RunCore(); + void LastEarlyUpdate() => RunCore(); + void FixedUpdate() => RunCore(); + void LastFixedUpdate() => RunCore(); + void PreUpdate() => RunCore(); + void LastPreUpdate() => RunCore(); + void Update() => RunCore(); + void LastUpdate() => RunCore(); + void PreLateUpdate() => RunCore(); + void LastPreLateUpdate() => RunCore(); + void PostLateUpdate() => RunCore(); + void LastPostLateUpdate() => RunCore(); +#if UNITY_2020_2_OR_NEWER + void TimeUpdate() => RunCore(); + void LastTimeUpdate() => RunCore(); +#endif + + [System.Diagnostics.DebuggerHidden] + void RunCore() + { + lock (runningAndQueueLock) + { + running = true; + } + + lock (arrayLock) + { + var j = tail - 1; + + for (int i = 0; i < loopItems.Length; i++) + { + var action = loopItems[i]; + if (action != null) + { + try + { + if (!action.MoveNext()) + { + loopItems[i] = null; + } + else + { + continue; // next i + } + } + catch (Exception ex) + { + loopItems[i] = null; + try + { + unhandledExceptionCallback(ex); + } + catch { } + } + } + + // find null, loop from tail + while (i < j) + { + var fromTail = loopItems[j]; + if (fromTail != null) + { + try + { + if (!fromTail.MoveNext()) + { + loopItems[j] = null; + j--; + continue; // next j + } + else + { + // swap + loopItems[i] = fromTail; + loopItems[j] = null; + j--; + goto NEXT_LOOP; // next i + } + } + catch (Exception ex) + { + loopItems[j] = null; + j--; + try + { + unhandledExceptionCallback(ex); + } + catch { } + continue; // next j + } + } + else + { + j--; + } + } + + tail = i; // loop end + break; // LOOP END + + NEXT_LOOP: + continue; + } + + + lock (runningAndQueueLock) + { + running = false; + while (waitQueue.Count != 0) + { + if (loopItems.Length == tail) + { + Array.Resize(ref loopItems, checked(tail * 2)); + } + loopItems[tail++] = waitQueue.Dequeue(); + } + } + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs.meta new file mode 100644 index 00000000..603dbc93 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PlayerLoopRunner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 340c6d420bb4f484aa8683415ea92571 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PooledDelegate.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PooledDelegate.cs new file mode 100644 index 00000000..518244fe --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PooledDelegate.cs @@ -0,0 +1,50 @@ +using System; +using System.Runtime.CompilerServices; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal sealed class PooledDelegate : ITaskPoolNode> + { + static TaskPool> pool; + + PooledDelegate nextNode; + public ref PooledDelegate NextNode => ref nextNode; + + static PooledDelegate() + { + TaskPool.RegisterSizeGetter(typeof(PooledDelegate), () => pool.Size); + } + + readonly Action runDelegate; + Action continuation; + + PooledDelegate() + { + runDelegate = Run; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Action Create(Action continuation) + { + if (!pool.TryPop(out var item)) + { + item = new PooledDelegate(); + } + + item.continuation = continuation; + return item.runDelegate; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + void Run(T _) + { + var call = continuation; + continuation = null; + if (call != null) + { + pool.TryPush(this); + call.Invoke(); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PooledDelegate.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PooledDelegate.cs.meta new file mode 100644 index 00000000..7f92aff4 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/PooledDelegate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8932579438742fa40b010edd412dbfba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/RuntimeHelpersAbstraction.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/RuntimeHelpersAbstraction.cs new file mode 100644 index 00000000..cbabdab1 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/RuntimeHelpersAbstraction.cs @@ -0,0 +1,64 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +#if UNITY_2018_3_OR_NEWER +using UnityEngine; +#endif + +namespace Cysharp.Threading.Tasks.Internal +{ + internal static class RuntimeHelpersAbstraction + { + // If we can use RuntimeHelpers.IsReferenceOrContainsReferences(.NET Core 2.0), use it. + public static bool IsWellKnownNoReferenceContainsType() + { + return WellKnownNoReferenceContainsType.IsWellKnownType; + } + + static bool WellKnownNoReferenceContainsTypeInitialize(Type t) + { + // The primitive types are Boolean, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, IntPtr, UIntPtr, Char, Double, and Single. + if (t.IsPrimitive) return true; + + if (t.IsEnum) return true; + if (t == typeof(DateTime)) return true; + if (t == typeof(DateTimeOffset)) return true; + if (t == typeof(Guid)) return true; + if (t == typeof(decimal)) return true; + + // unwrap nullable + if (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return WellKnownNoReferenceContainsTypeInitialize(t.GetGenericArguments()[0]); + } + +#if UNITY_2018_3_OR_NEWER + + // or add other wellknown types(Vector, etc...) here + if (t == typeof(Vector2)) return true; + if (t == typeof(Vector3)) return true; + if (t == typeof(Vector4)) return true; + if (t == typeof(Color)) return true; + if (t == typeof(Rect)) return true; + if (t == typeof(Bounds)) return true; + if (t == typeof(Quaternion)) return true; + if (t == typeof(Vector2Int)) return true; + if (t == typeof(Vector3Int)) return true; + +#endif + + return false; + } + + static class WellKnownNoReferenceContainsType + { + public static readonly bool IsWellKnownType; + + static WellKnownNoReferenceContainsType() + { + IsWellKnownType = WellKnownNoReferenceContainsTypeInitialize(typeof(T)); + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/RuntimeHelpersAbstraction.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/RuntimeHelpersAbstraction.cs.meta new file mode 100644 index 00000000..42543911 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/RuntimeHelpersAbstraction.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 94975e4d4e0c0ea4ba787d3872ce9bb4 +timeCreated: 1532361007 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/StatePool.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/StatePool.cs new file mode 100644 index 00000000..e1d40bd7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/StatePool.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections.Concurrent; +using System.Runtime.CompilerServices; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal static class StateTuple + { + public static StateTuple Create(T1 item1) + { + return StatePool.Create(item1); + } + + public static StateTuple Create(T1 item1, T2 item2) + { + return StatePool.Create(item1, item2); + } + + public static StateTuple Create(T1 item1, T2 item2, T3 item3) + { + return StatePool.Create(item1, item2, item3); + } + } + + internal class StateTuple : IDisposable + { + public T1 Item1; + + public void Deconstruct(out T1 item1) + { + item1 = this.Item1; + } + + public void Dispose() + { + StatePool.Return(this); + } + } + + internal static class StatePool + { + static readonly ConcurrentQueue> queue = new ConcurrentQueue>(); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static StateTuple Create(T1 item1) + { + if (queue.TryDequeue(out var value)) + { + value.Item1 = item1; + return value; + } + + return new StateTuple { Item1 = item1 }; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Return(StateTuple tuple) + { + tuple.Item1 = default; + queue.Enqueue(tuple); + } + } + + internal class StateTuple : IDisposable + { + public T1 Item1; + public T2 Item2; + + public void Deconstruct(out T1 item1, out T2 item2) + { + item1 = this.Item1; + item2 = this.Item2; + } + + public void Dispose() + { + StatePool.Return(this); + } + } + + internal static class StatePool + { + static readonly ConcurrentQueue> queue = new ConcurrentQueue>(); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static StateTuple Create(T1 item1, T2 item2) + { + if (queue.TryDequeue(out var value)) + { + value.Item1 = item1; + value.Item2 = item2; + return value; + } + + return new StateTuple { Item1 = item1, Item2 = item2 }; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Return(StateTuple tuple) + { + tuple.Item1 = default; + tuple.Item2 = default; + queue.Enqueue(tuple); + } + } + + internal class StateTuple : IDisposable + { + public T1 Item1; + public T2 Item2; + public T3 Item3; + + public void Deconstruct(out T1 item1, out T2 item2, out T3 item3) + { + item1 = this.Item1; + item2 = this.Item2; + item3 = this.Item3; + } + + public void Dispose() + { + StatePool.Return(this); + } + } + + internal static class StatePool + { + static readonly ConcurrentQueue> queue = new ConcurrentQueue>(); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static StateTuple Create(T1 item1, T2 item2, T3 item3) + { + if (queue.TryDequeue(out var value)) + { + value.Item1 = item1; + value.Item2 = item2; + value.Item3 = item3; + return value; + } + + return new StateTuple { Item1 = item1, Item2 = item2, Item3 = item3 }; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Return(StateTuple tuple) + { + tuple.Item1 = default; + tuple.Item2 = default; + tuple.Item3 = default; + queue.Enqueue(tuple); + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/StatePool.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/StatePool.cs.meta new file mode 100644 index 00000000..6779aa1e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/StatePool.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 60cdf0bcaea36b444a7ae7263ae7598f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/TaskTracker.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/TaskTracker.cs new file mode 100644 index 00000000..c163e22d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/TaskTracker.cs @@ -0,0 +1,178 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + // public for add user custom. + + public static class TaskTracker + { +#if UNITY_EDITOR + + static int trackingId = 0; + + public const string EnableAutoReloadKey = "UniTaskTrackerWindow_EnableAutoReloadKey"; + public const string EnableTrackingKey = "UniTaskTrackerWindow_EnableTrackingKey"; + public const string EnableStackTraceKey = "UniTaskTrackerWindow_EnableStackTraceKey"; + + public static class EditorEnableState + { + static bool enableAutoReload; + public static bool EnableAutoReload + { + get { return enableAutoReload; } + set + { + enableAutoReload = value; + UnityEditor.EditorPrefs.SetBool(EnableAutoReloadKey, value); + } + } + + static bool enableTracking; + public static bool EnableTracking + { + get { return enableTracking; } + set + { + enableTracking = value; + UnityEditor.EditorPrefs.SetBool(EnableTrackingKey, value); + } + } + + static bool enableStackTrace; + public static bool EnableStackTrace + { + get { return enableStackTrace; } + set + { + enableStackTrace = value; + UnityEditor.EditorPrefs.SetBool(EnableStackTraceKey, value); + } + } + } + +#endif + + + static List> listPool = new List>(); + + static readonly WeakDictionary tracking = new WeakDictionary(); + + [Conditional("UNITY_EDITOR")] + public static void TrackActiveTask(IUniTaskSource task, int skipFrame) + { +#if UNITY_EDITOR + dirty = true; + if (!EditorEnableState.EnableTracking) return; + var stackTrace = EditorEnableState.EnableStackTrace ? new StackTrace(skipFrame, true).CleanupAsyncStackTrace() : ""; + + string typeName; + if (EditorEnableState.EnableStackTrace) + { + var sb = new StringBuilder(); + TypeBeautify(task.GetType(), sb); + typeName = sb.ToString(); + } + else + { + typeName = task.GetType().Name; + } + tracking.TryAdd(task, (typeName, Interlocked.Increment(ref trackingId), DateTime.UtcNow, stackTrace)); +#endif + } + + [Conditional("UNITY_EDITOR")] + public static void RemoveTracking(IUniTaskSource task) + { +#if UNITY_EDITOR + dirty = true; + if (!EditorEnableState.EnableTracking) return; + var success = tracking.TryRemove(task); +#endif + } + + static bool dirty; + + public static bool CheckAndResetDirty() + { + var current = dirty; + dirty = false; + return current; + } + + /// (trackingId, awaiterType, awaiterStatus, createdTime, stackTrace) + public static void ForEachActiveTask(Action action) + { + lock (listPool) + { + var count = tracking.ToList(ref listPool, clear: false); + try + { + for (int i = 0; i < count; i++) + { + action(listPool[i].Value.trackingId, listPool[i].Value.formattedType, listPool[i].Key.UnsafeGetStatus(), listPool[i].Value.addTime, listPool[i].Value.stackTrace); + listPool[i] = default; + } + } + catch + { + listPool.Clear(); + throw; + } + } + } + + static void TypeBeautify(Type type, StringBuilder sb) + { + if (type.IsNested) + { + // TypeBeautify(type.DeclaringType, sb); + sb.Append(type.DeclaringType.Name.ToString()); + sb.Append("."); + } + + if (type.IsGenericType) + { + var genericsStart = type.Name.IndexOf("`"); + if (genericsStart != -1) + { + sb.Append(type.Name.Substring(0, genericsStart)); + } + else + { + sb.Append(type.Name); + } + sb.Append("<"); + var first = true; + foreach (var item in type.GetGenericArguments()) + { + if (!first) + { + sb.Append(", "); + } + first = false; + TypeBeautify(item, sb); + } + sb.Append(">"); + } + else + { + sb.Append(type.Name); + } + } + + //static string RemoveUniTaskNamespace(string str) + //{ + // return str.Replace("Cysharp.Threading.Tasks.CompilerServices", "") + // .Replace("Cysharp.Threading.Tasks.Linq", "") + // .Replace("Cysharp.Threading.Tasks", ""); + //} + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/TaskTracker.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/TaskTracker.cs.meta new file mode 100644 index 00000000..5563bf78 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/TaskTracker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a203c73eb4ccdbb44bddfd82d38fdda9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityEqualityComparer.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityEqualityComparer.cs new file mode 100644 index 00000000..906f3b6a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityEqualityComparer.cs @@ -0,0 +1,267 @@ +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal static class UnityEqualityComparer + { + public static readonly IEqualityComparer Vector2 = new Vector2EqualityComparer(); + public static readonly IEqualityComparer Vector3 = new Vector3EqualityComparer(); + public static readonly IEqualityComparer Vector4 = new Vector4EqualityComparer(); + public static readonly IEqualityComparer Color = new ColorEqualityComparer(); + public static readonly IEqualityComparer Color32 = new Color32EqualityComparer(); + public static readonly IEqualityComparer Rect = new RectEqualityComparer(); + public static readonly IEqualityComparer Bounds = new BoundsEqualityComparer(); + public static readonly IEqualityComparer Quaternion = new QuaternionEqualityComparer(); + + static readonly RuntimeTypeHandle vector2Type = typeof(Vector2).TypeHandle; + static readonly RuntimeTypeHandle vector3Type = typeof(Vector3).TypeHandle; + static readonly RuntimeTypeHandle vector4Type = typeof(Vector4).TypeHandle; + static readonly RuntimeTypeHandle colorType = typeof(Color).TypeHandle; + static readonly RuntimeTypeHandle color32Type = typeof(Color32).TypeHandle; + static readonly RuntimeTypeHandle rectType = typeof(Rect).TypeHandle; + static readonly RuntimeTypeHandle boundsType = typeof(Bounds).TypeHandle; + static readonly RuntimeTypeHandle quaternionType = typeof(Quaternion).TypeHandle; + +#if UNITY_2017_2_OR_NEWER + + public static readonly IEqualityComparer Vector2Int = new Vector2IntEqualityComparer(); + public static readonly IEqualityComparer Vector3Int = new Vector3IntEqualityComparer(); + public static readonly IEqualityComparer RangeInt = new RangeIntEqualityComparer(); + public static readonly IEqualityComparer RectInt = new RectIntEqualityComparer(); + public static readonly IEqualityComparer BoundsInt = new BoundsIntEqualityComparer(); + + static readonly RuntimeTypeHandle vector2IntType = typeof(Vector2Int).TypeHandle; + static readonly RuntimeTypeHandle vector3IntType = typeof(Vector3Int).TypeHandle; + static readonly RuntimeTypeHandle rangeIntType = typeof(RangeInt).TypeHandle; + static readonly RuntimeTypeHandle rectIntType = typeof(RectInt).TypeHandle; + static readonly RuntimeTypeHandle boundsIntType = typeof(BoundsInt).TypeHandle; + +#endif + + static class Cache + { + public static readonly IEqualityComparer Comparer; + + static Cache() + { + var comparer = GetDefaultHelper(typeof(T)); + if (comparer == null) + { + Comparer = EqualityComparer.Default; + } + else + { + Comparer = (IEqualityComparer)comparer; + } + } + } + + public static IEqualityComparer GetDefault() + { + return Cache.Comparer; + } + + static object GetDefaultHelper(Type type) + { + var t = type.TypeHandle; + + if (t.Equals(vector2Type)) return (object)UnityEqualityComparer.Vector2; + if (t.Equals(vector3Type)) return (object)UnityEqualityComparer.Vector3; + if (t.Equals(vector4Type)) return (object)UnityEqualityComparer.Vector4; + if (t.Equals(colorType)) return (object)UnityEqualityComparer.Color; + if (t.Equals(color32Type)) return (object)UnityEqualityComparer.Color32; + if (t.Equals(rectType)) return (object)UnityEqualityComparer.Rect; + if (t.Equals(boundsType)) return (object)UnityEqualityComparer.Bounds; + if (t.Equals(quaternionType)) return (object)UnityEqualityComparer.Quaternion; + +#if UNITY_2017_2_OR_NEWER + + if (t.Equals(vector2IntType)) return (object)UnityEqualityComparer.Vector2Int; + if (t.Equals(vector3IntType)) return (object)UnityEqualityComparer.Vector3Int; + if (t.Equals(rangeIntType)) return (object)UnityEqualityComparer.RangeInt; + if (t.Equals(rectIntType)) return (object)UnityEqualityComparer.RectInt; + if (t.Equals(boundsIntType)) return (object)UnityEqualityComparer.BoundsInt; +#endif + + return null; + } + + sealed class Vector2EqualityComparer : IEqualityComparer + { + public bool Equals(Vector2 self, Vector2 vector) + { + return self.x.Equals(vector.x) && self.y.Equals(vector.y); + } + + public int GetHashCode(Vector2 obj) + { + return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2; + } + } + + sealed class Vector3EqualityComparer : IEqualityComparer + { + public bool Equals(Vector3 self, Vector3 vector) + { + return self.x.Equals(vector.x) && self.y.Equals(vector.y) && self.z.Equals(vector.z); + } + + public int GetHashCode(Vector3 obj) + { + return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2 ^ obj.z.GetHashCode() >> 2; + } + } + + sealed class Vector4EqualityComparer : IEqualityComparer + { + public bool Equals(Vector4 self, Vector4 vector) + { + return self.x.Equals(vector.x) && self.y.Equals(vector.y) && self.z.Equals(vector.z) && self.w.Equals(vector.w); + } + + public int GetHashCode(Vector4 obj) + { + return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2 ^ obj.z.GetHashCode() >> 2 ^ obj.w.GetHashCode() >> 1; + } + } + + sealed class ColorEqualityComparer : IEqualityComparer + { + public bool Equals(Color self, Color other) + { + return self.r.Equals(other.r) && self.g.Equals(other.g) && self.b.Equals(other.b) && self.a.Equals(other.a); + } + + public int GetHashCode(Color obj) + { + return obj.r.GetHashCode() ^ obj.g.GetHashCode() << 2 ^ obj.b.GetHashCode() >> 2 ^ obj.a.GetHashCode() >> 1; + } + } + + sealed class RectEqualityComparer : IEqualityComparer + { + public bool Equals(Rect self, Rect other) + { + return self.x.Equals(other.x) && self.width.Equals(other.width) && self.y.Equals(other.y) && self.height.Equals(other.height); + } + + public int GetHashCode(Rect obj) + { + return obj.x.GetHashCode() ^ obj.width.GetHashCode() << 2 ^ obj.y.GetHashCode() >> 2 ^ obj.height.GetHashCode() >> 1; + } + } + + sealed class BoundsEqualityComparer : IEqualityComparer + { + public bool Equals(Bounds self, Bounds vector) + { + return self.center.Equals(vector.center) && self.extents.Equals(vector.extents); + } + + public int GetHashCode(Bounds obj) + { + return obj.center.GetHashCode() ^ obj.extents.GetHashCode() << 2; + } + } + + sealed class QuaternionEqualityComparer : IEqualityComparer + { + public bool Equals(Quaternion self, Quaternion vector) + { + return self.x.Equals(vector.x) && self.y.Equals(vector.y) && self.z.Equals(vector.z) && self.w.Equals(vector.w); + } + + public int GetHashCode(Quaternion obj) + { + return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2 ^ obj.z.GetHashCode() >> 2 ^ obj.w.GetHashCode() >> 1; + } + } + + sealed class Color32EqualityComparer : IEqualityComparer + { + public bool Equals(Color32 self, Color32 vector) + { + return self.a.Equals(vector.a) && self.r.Equals(vector.r) && self.g.Equals(vector.g) && self.b.Equals(vector.b); + } + + public int GetHashCode(Color32 obj) + { + return obj.a.GetHashCode() ^ obj.r.GetHashCode() << 2 ^ obj.g.GetHashCode() >> 2 ^ obj.b.GetHashCode() >> 1; + } + } + +#if UNITY_2017_2_OR_NEWER + + sealed class Vector2IntEqualityComparer : IEqualityComparer + { + public bool Equals(Vector2Int self, Vector2Int vector) + { + return self.x.Equals(vector.x) && self.y.Equals(vector.y); + } + + public int GetHashCode(Vector2Int obj) + { + return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2; + } + } + + sealed class Vector3IntEqualityComparer : IEqualityComparer + { + public static readonly Vector3IntEqualityComparer Default = new Vector3IntEqualityComparer(); + + public bool Equals(Vector3Int self, Vector3Int vector) + { + return self.x.Equals(vector.x) && self.y.Equals(vector.y) && self.z.Equals(vector.z); + } + + public int GetHashCode(Vector3Int obj) + { + return obj.x.GetHashCode() ^ obj.y.GetHashCode() << 2 ^ obj.z.GetHashCode() >> 2; + } + } + + sealed class RangeIntEqualityComparer : IEqualityComparer + { + public bool Equals(RangeInt self, RangeInt vector) + { + return self.start.Equals(vector.start) && self.length.Equals(vector.length); + } + + public int GetHashCode(RangeInt obj) + { + return obj.start.GetHashCode() ^ obj.length.GetHashCode() << 2; + } + } + + sealed class RectIntEqualityComparer : IEqualityComparer + { + public bool Equals(RectInt self, RectInt other) + { + return self.x.Equals(other.x) && self.width.Equals(other.width) && self.y.Equals(other.y) && self.height.Equals(other.height); + } + + public int GetHashCode(RectInt obj) + { + return obj.x.GetHashCode() ^ obj.width.GetHashCode() << 2 ^ obj.y.GetHashCode() >> 2 ^ obj.height.GetHashCode() >> 1; + } + } + + sealed class BoundsIntEqualityComparer : IEqualityComparer + { + public bool Equals(BoundsInt self, BoundsInt vector) + { + return Vector3IntEqualityComparer.Default.Equals(self.position, vector.position) + && Vector3IntEqualityComparer.Default.Equals(self.size, vector.size); + } + + public int GetHashCode(BoundsInt obj) + { + return Vector3IntEqualityComparer.Default.GetHashCode(obj.position) ^ Vector3IntEqualityComparer.Default.GetHashCode(obj.size) << 2; + } + } + +#endif + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityEqualityComparer.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityEqualityComparer.cs.meta new file mode 100644 index 00000000..79eb04f6 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityEqualityComparer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ebaaf14253c9cfb47b23283218ff9b67 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs new file mode 100644 index 00000000..0da9f5a7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine.Networking; + +namespace Cysharp.Threading.Tasks.Internal +{ +#if ENABLE_UNITYWEBREQUEST && (!UNITY_2019_1_OR_NEWER || UNITASK_WEBREQUEST_SUPPORT) + + internal static class UnityWebRequestResultExtensions + { + public static bool IsError(this UnityWebRequest unityWebRequest) + { +#if UNITY_2020_2_OR_NEWER + var result = unityWebRequest.result; + return (result == UnityWebRequest.Result.ConnectionError) + || (result == UnityWebRequest.Result.DataProcessingError) + || (result == UnityWebRequest.Result.ProtocolError); +#else + return unityWebRequest.isHttpError || unityWebRequest.isNetworkError; +#endif + } + } + +#endif +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs.meta new file mode 100644 index 00000000..54bd2eb5 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/UnityWebRequestExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 111ba0e639de1d7428af6c823ead4918 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ValueStopwatch.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ValueStopwatch.cs new file mode 100644 index 00000000..d55d1f6c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ValueStopwatch.cs @@ -0,0 +1,37 @@ +using System; +using System.Diagnostics; + +namespace Cysharp.Threading.Tasks.Internal +{ + internal readonly struct ValueStopwatch + { + static readonly double TimestampToTicks = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency; + + readonly long startTimestamp; + + public static ValueStopwatch StartNew() => new ValueStopwatch(Stopwatch.GetTimestamp()); + + ValueStopwatch(long startTimestamp) + { + this.startTimestamp = startTimestamp; + } + + public TimeSpan Elapsed => TimeSpan.FromTicks(this.ElapsedTicks); + + public bool IsInvalid => startTimestamp == 0; + + public long ElapsedTicks + { + get + { + if (startTimestamp == 0) + { + throw new InvalidOperationException("Detected invalid initialization(use 'default'), only to create from StartNew()."); + } + + var delta = Stopwatch.GetTimestamp() - startTimestamp; + return (long)(delta * TimestampToTicks); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ValueStopwatch.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ValueStopwatch.cs.meta new file mode 100644 index 00000000..b7c6b09c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/ValueStopwatch.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f16fb466974ad034c8732c79c7fd67ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/WeakDictionary.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/WeakDictionary.cs new file mode 100644 index 00000000..3feaad88 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/WeakDictionary.cs @@ -0,0 +1,334 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Internal +{ + // Add, Remove, Enumerate with sweep. All operations are thread safe(in spinlock). + internal class WeakDictionary + where TKey : class + { + Entry[] buckets; + int size; + SpinLock gate; // mutable struct(not readonly) + + readonly float loadFactor; + readonly IEqualityComparer keyEqualityComparer; + + public WeakDictionary(int capacity = 4, float loadFactor = 0.75f, IEqualityComparer keyComparer = null) + { + var tableSize = CalculateCapacity(capacity, loadFactor); + this.buckets = new Entry[tableSize]; + this.loadFactor = loadFactor; + this.gate = new SpinLock(false); + this.keyEqualityComparer = keyComparer ?? EqualityComparer.Default; + } + + public bool TryAdd(TKey key, TValue value) + { + bool lockTaken = false; + try + { + gate.Enter(ref lockTaken); + return TryAddInternal(key, value); + } + finally + { + if (lockTaken) gate.Exit(false); + } + } + + public bool TryGetValue(TKey key, out TValue value) + { + bool lockTaken = false; + try + { + gate.Enter(ref lockTaken); + if (TryGetEntry(key, out _, out var entry)) + { + value = entry.Value; + return true; + } + + value = default(TValue); + return false; + } + finally + { + if (lockTaken) gate.Exit(false); + } + } + + public bool TryRemove(TKey key) + { + bool lockTaken = false; + try + { + gate.Enter(ref lockTaken); + if (TryGetEntry(key, out var hashIndex, out var entry)) + { + Remove(hashIndex, entry); + return true; + } + + return false; + } + finally + { + if (lockTaken) gate.Exit(false); + } + } + + bool TryAddInternal(TKey key, TValue value) + { + var nextCapacity = CalculateCapacity(size + 1, loadFactor); + + TRY_ADD_AGAIN: + if (buckets.Length < nextCapacity) + { + // rehash + var nextBucket = new Entry[nextCapacity]; + for (int i = 0; i < buckets.Length; i++) + { + var e = buckets[i]; + while (e != null) + { + AddToBuckets(nextBucket, key, e.Value, e.Hash); + e = e.Next; + } + } + + buckets = nextBucket; + goto TRY_ADD_AGAIN; + } + else + { + // add entry + var successAdd = AddToBuckets(buckets, key, value, keyEqualityComparer.GetHashCode(key)); + if (successAdd) size++; + return successAdd; + } + } + + bool AddToBuckets(Entry[] targetBuckets, TKey newKey, TValue value, int keyHash) + { + var h = keyHash; + var hashIndex = h & (targetBuckets.Length - 1); + + TRY_ADD_AGAIN: + if (targetBuckets[hashIndex] == null) + { + targetBuckets[hashIndex] = new Entry + { + Key = new WeakReference(newKey, false), + Value = value, + Hash = h + }; + + return true; + } + else + { + // add to last. + var entry = targetBuckets[hashIndex]; + while (entry != null) + { + if (entry.Key.TryGetTarget(out var target)) + { + if (keyEqualityComparer.Equals(newKey, target)) + { + return false; // duplicate + } + } + else + { + Remove(hashIndex, entry); + if (targetBuckets[hashIndex] == null) goto TRY_ADD_AGAIN; // add new entry + } + + if (entry.Next != null) + { + entry = entry.Next; + } + else + { + // found last + entry.Next = new Entry + { + Key = new WeakReference(newKey, false), + Value = value, + Hash = h + }; + entry.Next.Prev = entry; + } + } + + return false; + } + } + + bool TryGetEntry(TKey key, out int hashIndex, out Entry entry) + { + var table = buckets; + var hash = keyEqualityComparer.GetHashCode(key); + hashIndex = hash & table.Length - 1; + entry = table[hashIndex]; + + while (entry != null) + { + if (entry.Key.TryGetTarget(out var target)) + { + if (keyEqualityComparer.Equals(key, target)) + { + return true; + } + } + else + { + // sweap + Remove(hashIndex, entry); + } + + entry = entry.Next; + } + + return false; + } + + void Remove(int hashIndex, Entry entry) + { + if (entry.Prev == null && entry.Next == null) + { + buckets[hashIndex] = null; + } + else + { + if (entry.Prev == null) + { + buckets[hashIndex] = entry.Next; + } + if (entry.Prev != null) + { + entry.Prev.Next = entry.Next; + } + if (entry.Next != null) + { + entry.Next.Prev = entry.Prev; + } + } + size--; + } + + public List> ToList() + { + var list = new List>(size); + ToList(ref list, false); + return list; + } + + // avoid allocate everytime. + public int ToList(ref List> list, bool clear = true) + { + if (clear) + { + list.Clear(); + } + + var listIndex = 0; + + bool lockTaken = false; + try + { + for (int i = 0; i < buckets.Length; i++) + { + var entry = buckets[i]; + while (entry != null) + { + if (entry.Key.TryGetTarget(out var target)) + { + var item = new KeyValuePair(target, entry.Value); + if (listIndex < list.Count) + { + list[listIndex++] = item; + } + else + { + list.Add(item); + listIndex++; + } + } + else + { + // sweap + Remove(i, entry); + } + + entry = entry.Next; + } + } + } + finally + { + if (lockTaken) gate.Exit(false); + } + + return listIndex; + } + + static int CalculateCapacity(int collectionSize, float loadFactor) + { + var size = (int)(((float)collectionSize) / loadFactor); + + size--; + size |= size >> 1; + size |= size >> 2; + size |= size >> 4; + size |= size >> 8; + size |= size >> 16; + size += 1; + + if (size < 8) + { + size = 8; + } + return size; + } + + class Entry + { + public WeakReference Key; + public TValue Value; + public int Hash; + public Entry Prev; + public Entry Next; + + // debug only + public override string ToString() + { + if (Key.TryGetTarget(out var target)) + { + return target + "(" + Count() + ")"; + } + else + { + return "(Dead)"; + } + } + + int Count() + { + var count = 1; + var n = this; + while (n.Next != null) + { + count++; + n = n.Next; + } + return count; + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/WeakDictionary.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/WeakDictionary.cs.meta new file mode 100644 index 00000000..9dc1672a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Internal/WeakDictionary.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6c78563864409714593226af59bcb6f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq.meta new file mode 100644 index 00000000..efd8bd81 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97611ee00dc5dcf408d5ee6bb6a073d6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs new file mode 100644 index 00000000..78647ff3 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs @@ -0,0 +1,318 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask AggregateAsync(this IUniTaskAsyncEnumerable source, Func accumulator, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); + + return Aggregate.AggregateAsync(source, accumulator, cancellationToken); + } + + public static UniTask AggregateAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); + + return Aggregate.AggregateAsync(source, seed, accumulator, cancellationToken); + } + + public static UniTask AggregateAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, Func resultSelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); + Error.ThrowArgumentNullException(accumulator, nameof(resultSelector)); + + return Aggregate.AggregateAsync(source, seed, accumulator, resultSelector, cancellationToken); + } + + public static UniTask AggregateAwaitAsync(this IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); + + return Aggregate.AggregateAwaitAsync(source, accumulator, cancellationToken); + } + + public static UniTask AggregateAwaitAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); + + return Aggregate.AggregateAwaitAsync(source, seed, accumulator, cancellationToken); + } + + public static UniTask AggregateAwaitAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); + Error.ThrowArgumentNullException(accumulator, nameof(resultSelector)); + + return Aggregate.AggregateAwaitAsync(source, seed, accumulator, resultSelector, cancellationToken); + } + + public static UniTask AggregateAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); + + return Aggregate.AggregateAwaitWithCancellationAsync(source, accumulator, cancellationToken); + } + + public static UniTask AggregateAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); + + return Aggregate.AggregateAwaitWithCancellationAsync(source, seed, accumulator, cancellationToken); + } + + public static UniTask AggregateAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(accumulator, nameof(accumulator)); + Error.ThrowArgumentNullException(accumulator, nameof(resultSelector)); + + return Aggregate.AggregateAwaitWithCancellationAsync(source, seed, accumulator, resultSelector, cancellationToken); + } + } + + internal static class Aggregate + { + internal static async UniTask AggregateAsync(IUniTaskAsyncEnumerable source, Func accumulator, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value; + if (await e.MoveNextAsync()) + { + value = e.Current; + } + else + { + throw Error.NoElements(); + } + + while (await e.MoveNextAsync()) + { + value = accumulator(value, e.Current); + } + return value; + + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AggregateAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TAccumulate value = seed; + while (await e.MoveNextAsync()) + { + value = accumulator(value, e.Current); + } + return value; + + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AggregateAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func accumulator, Func resultSelector, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TAccumulate value = seed; + while (await e.MoveNextAsync()) + { + value = accumulator(value, e.Current); + } + return resultSelector(value); + + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + // with async + + internal static async UniTask AggregateAwaitAsync(IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value; + if (await e.MoveNextAsync()) + { + value = e.Current; + } + else + { + throw Error.NoElements(); + } + + while (await e.MoveNextAsync()) + { + value = await accumulator(value, e.Current); + } + return value; + + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AggregateAwaitAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TAccumulate value = seed; + while (await e.MoveNextAsync()) + { + value = await accumulator(value, e.Current); + } + return value; + + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AggregateAwaitAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TAccumulate value = seed; + while (await e.MoveNextAsync()) + { + value = await accumulator(value, e.Current); + } + return await resultSelector(value); + + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + + // with cancellation + + internal static async UniTask AggregateAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> accumulator, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value; + if (await e.MoveNextAsync()) + { + value = e.Current; + } + else + { + throw Error.NoElements(); + } + + while (await e.MoveNextAsync()) + { + value = await accumulator(value, e.Current, cancellationToken); + } + return value; + + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AggregateAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TAccumulate value = seed; + while (await e.MoveNextAsync()) + { + value = await accumulator(value, e.Current, cancellationToken); + } + return value; + + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AggregateAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, TAccumulate seed, Func> accumulator, Func> resultSelector, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TAccumulate value = seed; + while (await e.MoveNextAsync()) + { + value = await accumulator(value, e.Current, cancellationToken); + } + return await resultSelector(value, cancellationToken); + + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs.meta new file mode 100644 index 00000000..837df4a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5dc68c05a4228c643937f6ebd185bcca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/All.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/All.cs new file mode 100644 index 00000000..5d6d5f0e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/All.cs @@ -0,0 +1,108 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask AllAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return All.AllAsync(source, predicate, cancellationToken); + } + + public static UniTask AllAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return All.AllAwaitAsync(source, predicate, cancellationToken); + } + + public static UniTask AllAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return All.AllAwaitWithCancellationAsync(source, predicate, cancellationToken); + } + } + + internal static class All + { + internal static async UniTask AllAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (!predicate(e.Current)) + { + return false; + } + } + + return true; + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AllAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (!await predicate(e.Current)) + { + return false; + } + } + + return true; + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AllAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (!await predicate(e.Current, cancellationToken)) + { + return false; + } + } + + return true; + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/All.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/All.cs.meta new file mode 100644 index 00000000..d378ff0e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/All.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7271437e0033af2448b600ee248924dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Any.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Any.cs new file mode 100644 index 00000000..2d43167c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Any.cs @@ -0,0 +1,136 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask AnyAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Any.AnyAsync(source, cancellationToken); + } + + public static UniTask AnyAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Any.AnyAsync(source, predicate, cancellationToken); + } + + public static UniTask AnyAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Any.AnyAwaitAsync(source, predicate, cancellationToken); + } + + public static UniTask AnyAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Any.AnyAwaitWithCancellationAsync(source, predicate, cancellationToken); + } + } + + internal static class Any + { + internal static async UniTask AnyAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + if (await e.MoveNextAsync()) + { + return true; + } + + return false; + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AnyAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (predicate(e.Current)) + { + return true; + } + } + + return false; + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AnyAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (await predicate(e.Current)) + { + return true; + } + } + + return false; + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask AnyAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (await predicate(e.Current, cancellationToken)) + { + return true; + } + } + + return false; + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Any.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Any.cs.meta new file mode 100644 index 00000000..1070bcc8 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Any.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e2b2e65745263994fbe34f3e0ec8eb12 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs new file mode 100644 index 00000000..3935afd8 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs @@ -0,0 +1,151 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Append(this IUniTaskAsyncEnumerable source, TSource element) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new AppendPrepend(source, element, true); + } + + public static IUniTaskAsyncEnumerable Prepend(this IUniTaskAsyncEnumerable source, TSource element) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new AppendPrepend(source, element, false); + } + } + + internal sealed class AppendPrepend : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly TSource element; + readonly bool append; // or prepend + + public AppendPrepend(IUniTaskAsyncEnumerable source, TSource element, bool append) + { + this.source = source; + this.element = element; + this.append = append; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _AppendPrepend(source, element, append, cancellationToken); + } + + sealed class _AppendPrepend : MoveNextSource, IUniTaskAsyncEnumerator + { + enum State : byte + { + None, + RequirePrepend, + RequireAppend, + Completed + } + + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + readonly TSource element; + CancellationToken cancellationToken; + + State state; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + + public _AppendPrepend(IUniTaskAsyncEnumerable source, TSource element, bool append, CancellationToken cancellationToken) + { + this.source = source; + this.element = element; + this.state = append ? State.RequireAppend : State.RequirePrepend; + this.cancellationToken = cancellationToken; + + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (enumerator == null) + { + if (state == State.RequirePrepend) + { + Current = element; + state = State.None; + return CompletedTasks.True; + } + + enumerator = source.GetAsyncEnumerator(cancellationToken); + } + + if (state == State.Completed) + { + return CompletedTasks.False; + } + + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + + if (awaiter.IsCompleted) + { + MoveNextCoreDelegate(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + + return new UniTask(this, completionSource.Version); + } + + static void MoveNextCore(object state) + { + var self = (_AppendPrepend)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.Current = self.enumerator.Current; + self.completionSource.TrySetResult(true); + } + else + { + if (self.state == State.RequireAppend) + { + self.state = State.Completed; + self.Current = self.element; + self.completionSource.TrySetResult(true); + } + else + { + self.state = State.Completed; + self.completionSource.TrySetResult(false); + } + } + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } + +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs.meta new file mode 100644 index 00000000..6d2ee046 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AppendPrepend.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3268ec424b8055f45aa2a26d17c80468 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsUniTaskAsyncEnumerable.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsUniTaskAsyncEnumerable.cs new file mode 100644 index 00000000..c00452e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsUniTaskAsyncEnumerable.cs @@ -0,0 +1,10 @@ +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable AsUniTaskAsyncEnumerable(this IUniTaskAsyncEnumerable source) + { + return source; + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsUniTaskAsyncEnumerable.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsUniTaskAsyncEnumerable.cs.meta new file mode 100644 index 00000000..90f6207c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsUniTaskAsyncEnumerable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 69866e262589ea643bbc62a1d696077a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsyncEnumeratorBase.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsyncEnumeratorBase.cs new file mode 100644 index 00000000..e7f99685 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsyncEnumeratorBase.cs @@ -0,0 +1,356 @@ +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + // note: refactor all inherit class and should remove this. + // see Select and Where. + internal abstract class AsyncEnumeratorBase : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action moveNextCallbackDelegate = MoveNextCallBack; + + readonly IUniTaskAsyncEnumerable source; + protected CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter sourceMoveNext; + + public AsyncEnumeratorBase(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 4); + } + + // abstract + + /// + /// If return value is false, continue source.MoveNext. + /// + protected abstract bool TryMoveNextCore(bool sourceHasCurrent, out bool result); + + // Util + protected TSource SourceCurrent => enumerator.Current; + + // IUniTaskAsyncEnumerator + + public TResult Current { get; protected set; } + + public UniTask MoveNextAsync() + { + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + if (!OnFirstIteration()) + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + protected virtual bool OnFirstIteration() + { + return false; + } + + protected void SourceMoveNext() + { + CONTINUE: + sourceMoveNext = enumerator.MoveNextAsync().GetAwaiter(); + if (sourceMoveNext.IsCompleted) + { + bool result = false; + try + { + if (!TryMoveNextCore(sourceMoveNext.GetResult(), out result)) + { + goto CONTINUE; + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + } + else + { + completionSource.TrySetResult(result); + } + } + else + { + sourceMoveNext.SourceOnCompleted(moveNextCallbackDelegate, this); + } + } + + static void MoveNextCallBack(object state) + { + var self = (AsyncEnumeratorBase)state; + bool result; + try + { + if (!self.TryMoveNextCore(self.sourceMoveNext.GetResult(), out result)) + { + self.SourceMoveNext(); + return; + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + + if (self.cancellationToken.IsCancellationRequested) + { + self.completionSource.TrySetCanceled(self.cancellationToken); + } + else + { + self.completionSource.TrySetResult(result); + } + } + + // if require additional resource to dispose, override and call base.DisposeAsync. + public virtual UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + + internal abstract class AsyncEnumeratorAwaitSelectorBase : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action moveNextCallbackDelegate = MoveNextCallBack; + static readonly Action setCurrentCallbackDelegate = SetCurrentCallBack; + + + readonly IUniTaskAsyncEnumerable source; + protected CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter sourceMoveNext; + + UniTask.Awaiter resultAwaiter; + + public AsyncEnumeratorAwaitSelectorBase(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 4); + } + + // abstract + + protected abstract UniTask TransformAsync(TSource sourceCurrent); + protected abstract bool TrySetCurrentCore(TAwait awaitResult, out bool terminateIteration); + + // Util + protected TSource SourceCurrent { get; private set; } + + protected (bool waitCallback, bool requireNextIteration) ActionCompleted(bool trySetCurrentResult, out bool moveNextResult) + { + if (trySetCurrentResult) + { + moveNextResult = true; + return (false, false); + } + else + { + moveNextResult = default; + return (false, true); + } + } + protected (bool waitCallback, bool requireNextIteration) WaitAwaitCallback(out bool moveNextResult) { moveNextResult = default; return (true, false); } + protected (bool waitCallback, bool requireNextIteration) IterateFinished(out bool moveNextResult) { moveNextResult = false; return (false, false); } + + // IUniTaskAsyncEnumerator + + public TResult Current { get; protected set; } + + public UniTask MoveNextAsync() + { + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + SourceMoveNext(); + return new UniTask(this, completionSource.Version); + } + + protected void SourceMoveNext() + { + CONTINUE: + sourceMoveNext = enumerator.MoveNextAsync().GetAwaiter(); + if (sourceMoveNext.IsCompleted) + { + bool result = false; + try + { + (bool waitCallback, bool requireNextIteration) = TryMoveNextCore(sourceMoveNext.GetResult(), out result); + + if (waitCallback) + { + return; + } + + if (requireNextIteration) + { + goto CONTINUE; + } + else + { + completionSource.TrySetResult(result); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + } + else + { + sourceMoveNext.SourceOnCompleted(moveNextCallbackDelegate, this); + } + } + + (bool waitCallback, bool requireNextIteration) TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + SourceCurrent = enumerator.Current; + var task = TransformAsync(SourceCurrent); + if (UnwarapTask(task, out var taskResult)) + { + var currentResult = TrySetCurrentCore(taskResult, out var terminateIteration); + if (terminateIteration) + { + return IterateFinished(out result); + } + + return ActionCompleted(currentResult, out result); + } + else + { + return WaitAwaitCallback(out result); + } + } + + return IterateFinished(out result); + } + + protected bool UnwarapTask(UniTask taskResult, out TAwait result) + { + resultAwaiter = taskResult.GetAwaiter(); + + if (resultAwaiter.IsCompleted) + { + result = resultAwaiter.GetResult(); + return true; + } + else + { + resultAwaiter.SourceOnCompleted(setCurrentCallbackDelegate, this); + result = default; + return false; + } + } + + static void MoveNextCallBack(object state) + { + var self = (AsyncEnumeratorAwaitSelectorBase)state; + bool result = false; + try + { + (bool waitCallback, bool requireNextIteration) = self.TryMoveNextCore(self.sourceMoveNext.GetResult(), out result); + + if (waitCallback) + { + return; + } + + if (requireNextIteration) + { + self.SourceMoveNext(); + return; + } + else + { + self.completionSource.TrySetResult(result); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + } + + static void SetCurrentCallBack(object state) + { + var self = (AsyncEnumeratorAwaitSelectorBase)state; + + bool doneSetCurrent; + bool terminateIteration; + try + { + var result = self.resultAwaiter.GetResult(); + doneSetCurrent = self.TrySetCurrentCore(result, out terminateIteration); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + + if (self.cancellationToken.IsCancellationRequested) + { + self.completionSource.TrySetCanceled(self.cancellationToken); + } + else + { + if (doneSetCurrent) + { + self.completionSource.TrySetResult(true); + } + else + { + if (terminateIteration) + { + self.completionSource.TrySetResult(false); + } + else + { + self.SourceMoveNext(); + } + } + } + } + + // if require additional resource to dispose, override and call base.DisposeAsync. + public virtual UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsyncEnumeratorBase.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsyncEnumeratorBase.cs.meta new file mode 100644 index 00000000..a4e96dc0 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/AsyncEnumeratorBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01ba1d3b17e13fb4c95740131c7e6e19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Average.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Average.cs new file mode 100644 index 00000000..b2ce42c1 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Average.cs @@ -0,0 +1,1524 @@ +using System; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Average.AverageAsync(source, cancellationToken); + } + + public static UniTask AverageAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask AverageAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Average.AverageAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + } + + internal static class Average + { + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Int32 sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += e.Current; + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Int32 sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Int32 sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Int32 sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current, cancellationToken); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Int64 sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += e.Current; + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Int64 sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Int64 sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Int64 sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current, cancellationToken); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Single sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += e.Current; + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (float)(sum / count); + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Single sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (float)(sum / count); + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Single sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (float)(sum / count); + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Single sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current, cancellationToken); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (float)(sum / count); + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Double sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += e.Current; + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Double sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Double sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Double sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current, cancellationToken); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Decimal sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += e.Current; + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Decimal sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Decimal sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Decimal sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked + { + sum += await selector(e.Current, cancellationToken); + count++; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Int32? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Int32? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Int32? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Int32? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current, cancellationToken); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Int64? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Int64? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Int64? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Int64? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current, cancellationToken); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (double)sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Single? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (float)(sum / count); + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Single? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (float)(sum / count); + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Single? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (float)(sum / count); + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Single? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current, cancellationToken); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return (float)(sum / count); + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Double? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Double? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Double? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Double? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current, cancellationToken); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + Decimal? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + long count = 0; + Decimal? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Decimal? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + public static async UniTask AverageAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + long count = 0; + Decimal? sum = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = await selector(e.Current, cancellationToken); + if (v.HasValue) + { + checked + { + sum += v.Value; + count++; + } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum / count; + } + + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Average.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Average.cs.meta new file mode 100644 index 00000000..8f60dfc5 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Average.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58499f95012fb3c47bb7bcbc5862e562 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs new file mode 100644 index 00000000..be395b68 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs @@ -0,0 +1,345 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable> Buffer(this IUniTaskAsyncEnumerable source, Int32 count) + { + Error.ThrowArgumentNullException(source, nameof(source)); + if (count <= 0) throw Error.ArgumentOutOfRange(nameof(count)); + + return new Buffer(source, count); + } + + public static IUniTaskAsyncEnumerable> Buffer(this IUniTaskAsyncEnumerable source, Int32 count, Int32 skip) + { + Error.ThrowArgumentNullException(source, nameof(source)); + if (count <= 0) throw Error.ArgumentOutOfRange(nameof(count)); + if (skip <= 0) throw Error.ArgumentOutOfRange(nameof(skip)); + + return new BufferSkip(source, count, skip); + } + } + + internal sealed class Buffer : IUniTaskAsyncEnumerable> + { + readonly IUniTaskAsyncEnumerable source; + readonly int count; + + public Buffer(IUniTaskAsyncEnumerable source, int count) + { + this.source = source; + this.count = count; + } + + public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Buffer(source, count, cancellationToken); + } + + sealed class _Buffer : MoveNextSource, IUniTaskAsyncEnumerator> + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + readonly int count; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + bool continueNext; + + bool completed; + List buffer; + + public _Buffer(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + { + this.source = source; + this.count = count; + this.cancellationToken = cancellationToken; + + TaskTracker.TrackActiveTask(this, 3); + } + + public IList Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + buffer = new List(count); + } + + completionSource.Reset(); + SourceMoveNext(); + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + if (completed) + { + if (buffer != null && buffer.Count > 0) + { + var ret = buffer; + buffer = null; + Current = ret; + completionSource.TrySetResult(true); + return; + } + else + { + completionSource.TrySetResult(false); + return; + } + } + + try + { + + LOOP: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + continueNext = true; + MoveNextCore(this); + if (continueNext) + { + continueNext = false; + goto LOOP; // avoid recursive + } + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + + static void MoveNextCore(object state) + { + var self = (_Buffer)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.buffer.Add(self.enumerator.Current); + + if (self.buffer.Count == self.count) + { + self.Current = self.buffer; + self.buffer = new List(self.count); + self.continueNext = false; + self.completionSource.TrySetResult(true); + return; + } + else + { + if (!self.continueNext) + { + self.SourceMoveNext(); + } + } + } + else + { + self.continueNext = false; + self.completed = true; + self.SourceMoveNext(); + } + } + else + { + self.continueNext = false; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } + + internal sealed class BufferSkip : IUniTaskAsyncEnumerable> + { + readonly IUniTaskAsyncEnumerable source; + readonly int count; + readonly int skip; + + public BufferSkip(IUniTaskAsyncEnumerable source, int count, int skip) + { + this.source = source; + this.count = count; + this.skip = skip; + } + + public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _BufferSkip(source, count, skip, cancellationToken); + } + + sealed class _BufferSkip : MoveNextSource, IUniTaskAsyncEnumerator> + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + readonly int count; + readonly int skip; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + bool continueNext; + + bool completed; + Queue> buffers; + int index = 0; + + public _BufferSkip(IUniTaskAsyncEnumerable source, int count, int skip, CancellationToken cancellationToken) + { + this.source = source; + this.count = count; + this.skip = skip; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public IList Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + buffers = new Queue>(); + } + + completionSource.Reset(); + SourceMoveNext(); + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + if (completed) + { + if (buffers.Count > 0) + { + Current = buffers.Dequeue(); + completionSource.TrySetResult(true); + return; + } + else + { + completionSource.TrySetResult(false); + return; + } + } + + try + { + + LOOP: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + continueNext = true; + MoveNextCore(this); + if (continueNext) + { + continueNext = false; + goto LOOP; // avoid recursive + } + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + + static void MoveNextCore(object state) + { + var self = (_BufferSkip)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + if (self.index++ % self.skip == 0) + { + self.buffers.Enqueue(new List(self.count)); + } + + var item = self.enumerator.Current; + foreach (var buffer in self.buffers) + { + buffer.Add(item); + } + + if (self.buffers.Count > 0 && self.buffers.Peek().Count == self.count) + { + self.Current = self.buffers.Dequeue(); + self.continueNext = false; + self.completionSource.TrySetResult(true); + return; + } + else + { + if (!self.continueNext) + { + self.SourceMoveNext(); + } + } + } + else + { + self.continueNext = false; + self.completed = true; + self.SourceMoveNext(); + } + } + else + { + self.continueNext = false; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs.meta new file mode 100644 index 00000000..e7154e4d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Buffer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 951310243334a3148a7872977cb31c5c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs new file mode 100644 index 00000000..0a0c0f8f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs @@ -0,0 +1,53 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Cast(this IUniTaskAsyncEnumerable source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new Cast(source); + } + } + + internal sealed class Cast : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + + public Cast(IUniTaskAsyncEnumerable source) + { + this.source = source; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Cast(source, cancellationToken); + } + + class _Cast : AsyncEnumeratorBase + { + public _Cast(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + Current = (TResult)SourceCurrent; + result = true; + return true; + } + + result = false; + return true; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs.meta new file mode 100644 index 00000000..913b043c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Cast.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: edebeae8b61352b428abe9ce8f3fc71a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs new file mode 100644 index 00000000..92fb1daa --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs @@ -0,0 +1,11372 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(source7, nameof(source7)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, source7, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(source7, nameof(source7)); + Error.ThrowArgumentNullException(source8, nameof(source8)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(source7, nameof(source7)); + Error.ThrowArgumentNullException(source8, nameof(source8)); + Error.ThrowArgumentNullException(source9, nameof(source9)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(source7, nameof(source7)); + Error.ThrowArgumentNullException(source8, nameof(source8)); + Error.ThrowArgumentNullException(source9, nameof(source9)); + Error.ThrowArgumentNullException(source10, nameof(source10)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(source7, nameof(source7)); + Error.ThrowArgumentNullException(source8, nameof(source8)); + Error.ThrowArgumentNullException(source9, nameof(source9)); + Error.ThrowArgumentNullException(source10, nameof(source10)); + Error.ThrowArgumentNullException(source11, nameof(source11)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(source7, nameof(source7)); + Error.ThrowArgumentNullException(source8, nameof(source8)); + Error.ThrowArgumentNullException(source9, nameof(source9)); + Error.ThrowArgumentNullException(source10, nameof(source10)); + Error.ThrowArgumentNullException(source11, nameof(source11)); + Error.ThrowArgumentNullException(source12, nameof(source12)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, source12, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, IUniTaskAsyncEnumerable source13, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(source7, nameof(source7)); + Error.ThrowArgumentNullException(source8, nameof(source8)); + Error.ThrowArgumentNullException(source9, nameof(source9)); + Error.ThrowArgumentNullException(source10, nameof(source10)); + Error.ThrowArgumentNullException(source11, nameof(source11)); + Error.ThrowArgumentNullException(source12, nameof(source12)); + Error.ThrowArgumentNullException(source13, nameof(source13)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, source12, source13, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, IUniTaskAsyncEnumerable source13, IUniTaskAsyncEnumerable source14, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(source7, nameof(source7)); + Error.ThrowArgumentNullException(source8, nameof(source8)); + Error.ThrowArgumentNullException(source9, nameof(source9)); + Error.ThrowArgumentNullException(source10, nameof(source10)); + Error.ThrowArgumentNullException(source11, nameof(source11)); + Error.ThrowArgumentNullException(source12, nameof(source12)); + Error.ThrowArgumentNullException(source13, nameof(source13)); + Error.ThrowArgumentNullException(source14, nameof(source14)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, source12, source13, source14, resultSelector); + } + + public static IUniTaskAsyncEnumerable CombineLatest(this IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, IUniTaskAsyncEnumerable source13, IUniTaskAsyncEnumerable source14, IUniTaskAsyncEnumerable source15, Func resultSelector) + { + Error.ThrowArgumentNullException(source1, nameof(source1)); + Error.ThrowArgumentNullException(source2, nameof(source2)); + Error.ThrowArgumentNullException(source3, nameof(source3)); + Error.ThrowArgumentNullException(source4, nameof(source4)); + Error.ThrowArgumentNullException(source5, nameof(source5)); + Error.ThrowArgumentNullException(source6, nameof(source6)); + Error.ThrowArgumentNullException(source7, nameof(source7)); + Error.ThrowArgumentNullException(source8, nameof(source8)); + Error.ThrowArgumentNullException(source9, nameof(source9)); + Error.ThrowArgumentNullException(source10, nameof(source10)); + Error.ThrowArgumentNullException(source11, nameof(source11)); + Error.ThrowArgumentNullException(source12, nameof(source12)); + Error.ThrowArgumentNullException(source13, nameof(source13)); + Error.ThrowArgumentNullException(source14, nameof(source14)); + Error.ThrowArgumentNullException(source15, nameof(source15)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, source12, source13, source14, source15, resultSelector); + } + + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + const int CompleteCount = 2; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + + if (!running1 || !running2) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2) + { + result = resultSelector(current1, current2); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + const int CompleteCount = 3; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + + if (!running1 || !running2 || !running3) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3) + { + result = resultSelector(current1, current2, current3); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + const int CompleteCount = 4; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4) + { + result = resultSelector(current1, current2, current3, current4); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + const int CompleteCount = 5; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5) + { + result = resultSelector(current1, current2, current3, current4, current5); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + const int CompleteCount = 6; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6) + { + result = resultSelector(current1, current2, current3, current4, current5, current6); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, source7, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + static readonly Action Completed7Delegate = Completed7; + const int CompleteCount = 7; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + IUniTaskAsyncEnumerator enumerator7; + UniTask.Awaiter awaiter7; + bool hasCurrent7; + bool running7; + T7 current7; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + enumerator7 = source7.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + if (!running7) + { + running7 = true; + awaiter7 = enumerator7.MoveNextAsync().GetAwaiter(); + if (awaiter7.IsCompleted) + { + Completed7(this); + } + else + { + awaiter7.SourceOnCompleted(Completed7Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6 || !running7) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed7(object state) + { + var self = (_CombineLatest)state; + self.running7 = false; + + try + { + if (self.awaiter7.GetResult()) + { + self.hasCurrent7 = true; + self.current7 = self.enumerator7.Current; + goto SUCCESS; + } + else + { + self.running7 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running7 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running7 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter7 = self.enumerator7.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter7.SourceOnCompleted(Completed7Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6 && hasCurrent7) + { + result = resultSelector(current1, current2, current3, current4, current5, current6, current7); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + if (enumerator7 != null) + { + await enumerator7.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + static readonly Action Completed7Delegate = Completed7; + static readonly Action Completed8Delegate = Completed8; + const int CompleteCount = 8; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + IUniTaskAsyncEnumerator enumerator7; + UniTask.Awaiter awaiter7; + bool hasCurrent7; + bool running7; + T7 current7; + + IUniTaskAsyncEnumerator enumerator8; + UniTask.Awaiter awaiter8; + bool hasCurrent8; + bool running8; + T8 current8; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + enumerator7 = source7.GetAsyncEnumerator(cancellationToken); + enumerator8 = source8.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + if (!running7) + { + running7 = true; + awaiter7 = enumerator7.MoveNextAsync().GetAwaiter(); + if (awaiter7.IsCompleted) + { + Completed7(this); + } + else + { + awaiter7.SourceOnCompleted(Completed7Delegate, this); + } + } + if (!running8) + { + running8 = true; + awaiter8 = enumerator8.MoveNextAsync().GetAwaiter(); + if (awaiter8.IsCompleted) + { + Completed8(this); + } + else + { + awaiter8.SourceOnCompleted(Completed8Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6 || !running7 || !running8) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed7(object state) + { + var self = (_CombineLatest)state; + self.running7 = false; + + try + { + if (self.awaiter7.GetResult()) + { + self.hasCurrent7 = true; + self.current7 = self.enumerator7.Current; + goto SUCCESS; + } + else + { + self.running7 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running7 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running7 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter7 = self.enumerator7.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter7.SourceOnCompleted(Completed7Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed8(object state) + { + var self = (_CombineLatest)state; + self.running8 = false; + + try + { + if (self.awaiter8.GetResult()) + { + self.hasCurrent8 = true; + self.current8 = self.enumerator8.Current; + goto SUCCESS; + } + else + { + self.running8 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running8 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running8 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter8 = self.enumerator8.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter8.SourceOnCompleted(Completed8Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6 && hasCurrent7 && hasCurrent8) + { + result = resultSelector(current1, current2, current3, current4, current5, current6, current7, current8); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + if (enumerator7 != null) + { + await enumerator7.DisposeAsync(); + } + if (enumerator8 != null) + { + await enumerator8.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + static readonly Action Completed7Delegate = Completed7; + static readonly Action Completed8Delegate = Completed8; + static readonly Action Completed9Delegate = Completed9; + const int CompleteCount = 9; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + IUniTaskAsyncEnumerator enumerator7; + UniTask.Awaiter awaiter7; + bool hasCurrent7; + bool running7; + T7 current7; + + IUniTaskAsyncEnumerator enumerator8; + UniTask.Awaiter awaiter8; + bool hasCurrent8; + bool running8; + T8 current8; + + IUniTaskAsyncEnumerator enumerator9; + UniTask.Awaiter awaiter9; + bool hasCurrent9; + bool running9; + T9 current9; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + enumerator7 = source7.GetAsyncEnumerator(cancellationToken); + enumerator8 = source8.GetAsyncEnumerator(cancellationToken); + enumerator9 = source9.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + if (!running7) + { + running7 = true; + awaiter7 = enumerator7.MoveNextAsync().GetAwaiter(); + if (awaiter7.IsCompleted) + { + Completed7(this); + } + else + { + awaiter7.SourceOnCompleted(Completed7Delegate, this); + } + } + if (!running8) + { + running8 = true; + awaiter8 = enumerator8.MoveNextAsync().GetAwaiter(); + if (awaiter8.IsCompleted) + { + Completed8(this); + } + else + { + awaiter8.SourceOnCompleted(Completed8Delegate, this); + } + } + if (!running9) + { + running9 = true; + awaiter9 = enumerator9.MoveNextAsync().GetAwaiter(); + if (awaiter9.IsCompleted) + { + Completed9(this); + } + else + { + awaiter9.SourceOnCompleted(Completed9Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6 || !running7 || !running8 || !running9) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed7(object state) + { + var self = (_CombineLatest)state; + self.running7 = false; + + try + { + if (self.awaiter7.GetResult()) + { + self.hasCurrent7 = true; + self.current7 = self.enumerator7.Current; + goto SUCCESS; + } + else + { + self.running7 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running7 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running7 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter7 = self.enumerator7.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter7.SourceOnCompleted(Completed7Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed8(object state) + { + var self = (_CombineLatest)state; + self.running8 = false; + + try + { + if (self.awaiter8.GetResult()) + { + self.hasCurrent8 = true; + self.current8 = self.enumerator8.Current; + goto SUCCESS; + } + else + { + self.running8 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running8 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running8 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter8 = self.enumerator8.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter8.SourceOnCompleted(Completed8Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed9(object state) + { + var self = (_CombineLatest)state; + self.running9 = false; + + try + { + if (self.awaiter9.GetResult()) + { + self.hasCurrent9 = true; + self.current9 = self.enumerator9.Current; + goto SUCCESS; + } + else + { + self.running9 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running9 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running9 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter9 = self.enumerator9.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter9.SourceOnCompleted(Completed9Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6 && hasCurrent7 && hasCurrent8 && hasCurrent9) + { + result = resultSelector(current1, current2, current3, current4, current5, current6, current7, current8, current9); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + if (enumerator7 != null) + { + await enumerator7.DisposeAsync(); + } + if (enumerator8 != null) + { + await enumerator8.DisposeAsync(); + } + if (enumerator9 != null) + { + await enumerator9.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + static readonly Action Completed7Delegate = Completed7; + static readonly Action Completed8Delegate = Completed8; + static readonly Action Completed9Delegate = Completed9; + static readonly Action Completed10Delegate = Completed10; + const int CompleteCount = 10; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + IUniTaskAsyncEnumerator enumerator7; + UniTask.Awaiter awaiter7; + bool hasCurrent7; + bool running7; + T7 current7; + + IUniTaskAsyncEnumerator enumerator8; + UniTask.Awaiter awaiter8; + bool hasCurrent8; + bool running8; + T8 current8; + + IUniTaskAsyncEnumerator enumerator9; + UniTask.Awaiter awaiter9; + bool hasCurrent9; + bool running9; + T9 current9; + + IUniTaskAsyncEnumerator enumerator10; + UniTask.Awaiter awaiter10; + bool hasCurrent10; + bool running10; + T10 current10; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + enumerator7 = source7.GetAsyncEnumerator(cancellationToken); + enumerator8 = source8.GetAsyncEnumerator(cancellationToken); + enumerator9 = source9.GetAsyncEnumerator(cancellationToken); + enumerator10 = source10.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + if (!running7) + { + running7 = true; + awaiter7 = enumerator7.MoveNextAsync().GetAwaiter(); + if (awaiter7.IsCompleted) + { + Completed7(this); + } + else + { + awaiter7.SourceOnCompleted(Completed7Delegate, this); + } + } + if (!running8) + { + running8 = true; + awaiter8 = enumerator8.MoveNextAsync().GetAwaiter(); + if (awaiter8.IsCompleted) + { + Completed8(this); + } + else + { + awaiter8.SourceOnCompleted(Completed8Delegate, this); + } + } + if (!running9) + { + running9 = true; + awaiter9 = enumerator9.MoveNextAsync().GetAwaiter(); + if (awaiter9.IsCompleted) + { + Completed9(this); + } + else + { + awaiter9.SourceOnCompleted(Completed9Delegate, this); + } + } + if (!running10) + { + running10 = true; + awaiter10 = enumerator10.MoveNextAsync().GetAwaiter(); + if (awaiter10.IsCompleted) + { + Completed10(this); + } + else + { + awaiter10.SourceOnCompleted(Completed10Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6 || !running7 || !running8 || !running9 || !running10) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed7(object state) + { + var self = (_CombineLatest)state; + self.running7 = false; + + try + { + if (self.awaiter7.GetResult()) + { + self.hasCurrent7 = true; + self.current7 = self.enumerator7.Current; + goto SUCCESS; + } + else + { + self.running7 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running7 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running7 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter7 = self.enumerator7.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter7.SourceOnCompleted(Completed7Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed8(object state) + { + var self = (_CombineLatest)state; + self.running8 = false; + + try + { + if (self.awaiter8.GetResult()) + { + self.hasCurrent8 = true; + self.current8 = self.enumerator8.Current; + goto SUCCESS; + } + else + { + self.running8 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running8 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running8 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter8 = self.enumerator8.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter8.SourceOnCompleted(Completed8Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed9(object state) + { + var self = (_CombineLatest)state; + self.running9 = false; + + try + { + if (self.awaiter9.GetResult()) + { + self.hasCurrent9 = true; + self.current9 = self.enumerator9.Current; + goto SUCCESS; + } + else + { + self.running9 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running9 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running9 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter9 = self.enumerator9.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter9.SourceOnCompleted(Completed9Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed10(object state) + { + var self = (_CombineLatest)state; + self.running10 = false; + + try + { + if (self.awaiter10.GetResult()) + { + self.hasCurrent10 = true; + self.current10 = self.enumerator10.Current; + goto SUCCESS; + } + else + { + self.running10 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running10 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running10 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter10 = self.enumerator10.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter10.SourceOnCompleted(Completed10Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6 && hasCurrent7 && hasCurrent8 && hasCurrent9 && hasCurrent10) + { + result = resultSelector(current1, current2, current3, current4, current5, current6, current7, current8, current9, current10); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + if (enumerator7 != null) + { + await enumerator7.DisposeAsync(); + } + if (enumerator8 != null) + { + await enumerator8.DisposeAsync(); + } + if (enumerator9 != null) + { + await enumerator9.DisposeAsync(); + } + if (enumerator10 != null) + { + await enumerator10.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + static readonly Action Completed7Delegate = Completed7; + static readonly Action Completed8Delegate = Completed8; + static readonly Action Completed9Delegate = Completed9; + static readonly Action Completed10Delegate = Completed10; + static readonly Action Completed11Delegate = Completed11; + const int CompleteCount = 11; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + IUniTaskAsyncEnumerator enumerator7; + UniTask.Awaiter awaiter7; + bool hasCurrent7; + bool running7; + T7 current7; + + IUniTaskAsyncEnumerator enumerator8; + UniTask.Awaiter awaiter8; + bool hasCurrent8; + bool running8; + T8 current8; + + IUniTaskAsyncEnumerator enumerator9; + UniTask.Awaiter awaiter9; + bool hasCurrent9; + bool running9; + T9 current9; + + IUniTaskAsyncEnumerator enumerator10; + UniTask.Awaiter awaiter10; + bool hasCurrent10; + bool running10; + T10 current10; + + IUniTaskAsyncEnumerator enumerator11; + UniTask.Awaiter awaiter11; + bool hasCurrent11; + bool running11; + T11 current11; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + enumerator7 = source7.GetAsyncEnumerator(cancellationToken); + enumerator8 = source8.GetAsyncEnumerator(cancellationToken); + enumerator9 = source9.GetAsyncEnumerator(cancellationToken); + enumerator10 = source10.GetAsyncEnumerator(cancellationToken); + enumerator11 = source11.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + if (!running7) + { + running7 = true; + awaiter7 = enumerator7.MoveNextAsync().GetAwaiter(); + if (awaiter7.IsCompleted) + { + Completed7(this); + } + else + { + awaiter7.SourceOnCompleted(Completed7Delegate, this); + } + } + if (!running8) + { + running8 = true; + awaiter8 = enumerator8.MoveNextAsync().GetAwaiter(); + if (awaiter8.IsCompleted) + { + Completed8(this); + } + else + { + awaiter8.SourceOnCompleted(Completed8Delegate, this); + } + } + if (!running9) + { + running9 = true; + awaiter9 = enumerator9.MoveNextAsync().GetAwaiter(); + if (awaiter9.IsCompleted) + { + Completed9(this); + } + else + { + awaiter9.SourceOnCompleted(Completed9Delegate, this); + } + } + if (!running10) + { + running10 = true; + awaiter10 = enumerator10.MoveNextAsync().GetAwaiter(); + if (awaiter10.IsCompleted) + { + Completed10(this); + } + else + { + awaiter10.SourceOnCompleted(Completed10Delegate, this); + } + } + if (!running11) + { + running11 = true; + awaiter11 = enumerator11.MoveNextAsync().GetAwaiter(); + if (awaiter11.IsCompleted) + { + Completed11(this); + } + else + { + awaiter11.SourceOnCompleted(Completed11Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6 || !running7 || !running8 || !running9 || !running10 || !running11) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed7(object state) + { + var self = (_CombineLatest)state; + self.running7 = false; + + try + { + if (self.awaiter7.GetResult()) + { + self.hasCurrent7 = true; + self.current7 = self.enumerator7.Current; + goto SUCCESS; + } + else + { + self.running7 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running7 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running7 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter7 = self.enumerator7.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter7.SourceOnCompleted(Completed7Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed8(object state) + { + var self = (_CombineLatest)state; + self.running8 = false; + + try + { + if (self.awaiter8.GetResult()) + { + self.hasCurrent8 = true; + self.current8 = self.enumerator8.Current; + goto SUCCESS; + } + else + { + self.running8 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running8 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running8 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter8 = self.enumerator8.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter8.SourceOnCompleted(Completed8Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed9(object state) + { + var self = (_CombineLatest)state; + self.running9 = false; + + try + { + if (self.awaiter9.GetResult()) + { + self.hasCurrent9 = true; + self.current9 = self.enumerator9.Current; + goto SUCCESS; + } + else + { + self.running9 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running9 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running9 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter9 = self.enumerator9.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter9.SourceOnCompleted(Completed9Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed10(object state) + { + var self = (_CombineLatest)state; + self.running10 = false; + + try + { + if (self.awaiter10.GetResult()) + { + self.hasCurrent10 = true; + self.current10 = self.enumerator10.Current; + goto SUCCESS; + } + else + { + self.running10 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running10 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running10 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter10 = self.enumerator10.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter10.SourceOnCompleted(Completed10Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed11(object state) + { + var self = (_CombineLatest)state; + self.running11 = false; + + try + { + if (self.awaiter11.GetResult()) + { + self.hasCurrent11 = true; + self.current11 = self.enumerator11.Current; + goto SUCCESS; + } + else + { + self.running11 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running11 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running11 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter11 = self.enumerator11.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter11.SourceOnCompleted(Completed11Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6 && hasCurrent7 && hasCurrent8 && hasCurrent9 && hasCurrent10 && hasCurrent11) + { + result = resultSelector(current1, current2, current3, current4, current5, current6, current7, current8, current9, current10, current11); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + if (enumerator7 != null) + { + await enumerator7.DisposeAsync(); + } + if (enumerator8 != null) + { + await enumerator8.DisposeAsync(); + } + if (enumerator9 != null) + { + await enumerator9.DisposeAsync(); + } + if (enumerator10 != null) + { + await enumerator10.DisposeAsync(); + } + if (enumerator11 != null) + { + await enumerator11.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + readonly IUniTaskAsyncEnumerable source12; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + this.source12 = source12; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, source12, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + static readonly Action Completed7Delegate = Completed7; + static readonly Action Completed8Delegate = Completed8; + static readonly Action Completed9Delegate = Completed9; + static readonly Action Completed10Delegate = Completed10; + static readonly Action Completed11Delegate = Completed11; + static readonly Action Completed12Delegate = Completed12; + const int CompleteCount = 12; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + readonly IUniTaskAsyncEnumerable source12; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + IUniTaskAsyncEnumerator enumerator7; + UniTask.Awaiter awaiter7; + bool hasCurrent7; + bool running7; + T7 current7; + + IUniTaskAsyncEnumerator enumerator8; + UniTask.Awaiter awaiter8; + bool hasCurrent8; + bool running8; + T8 current8; + + IUniTaskAsyncEnumerator enumerator9; + UniTask.Awaiter awaiter9; + bool hasCurrent9; + bool running9; + T9 current9; + + IUniTaskAsyncEnumerator enumerator10; + UniTask.Awaiter awaiter10; + bool hasCurrent10; + bool running10; + T10 current10; + + IUniTaskAsyncEnumerator enumerator11; + UniTask.Awaiter awaiter11; + bool hasCurrent11; + bool running11; + T11 current11; + + IUniTaskAsyncEnumerator enumerator12; + UniTask.Awaiter awaiter12; + bool hasCurrent12; + bool running12; + T12 current12; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + this.source12 = source12; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + enumerator7 = source7.GetAsyncEnumerator(cancellationToken); + enumerator8 = source8.GetAsyncEnumerator(cancellationToken); + enumerator9 = source9.GetAsyncEnumerator(cancellationToken); + enumerator10 = source10.GetAsyncEnumerator(cancellationToken); + enumerator11 = source11.GetAsyncEnumerator(cancellationToken); + enumerator12 = source12.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + if (!running7) + { + running7 = true; + awaiter7 = enumerator7.MoveNextAsync().GetAwaiter(); + if (awaiter7.IsCompleted) + { + Completed7(this); + } + else + { + awaiter7.SourceOnCompleted(Completed7Delegate, this); + } + } + if (!running8) + { + running8 = true; + awaiter8 = enumerator8.MoveNextAsync().GetAwaiter(); + if (awaiter8.IsCompleted) + { + Completed8(this); + } + else + { + awaiter8.SourceOnCompleted(Completed8Delegate, this); + } + } + if (!running9) + { + running9 = true; + awaiter9 = enumerator9.MoveNextAsync().GetAwaiter(); + if (awaiter9.IsCompleted) + { + Completed9(this); + } + else + { + awaiter9.SourceOnCompleted(Completed9Delegate, this); + } + } + if (!running10) + { + running10 = true; + awaiter10 = enumerator10.MoveNextAsync().GetAwaiter(); + if (awaiter10.IsCompleted) + { + Completed10(this); + } + else + { + awaiter10.SourceOnCompleted(Completed10Delegate, this); + } + } + if (!running11) + { + running11 = true; + awaiter11 = enumerator11.MoveNextAsync().GetAwaiter(); + if (awaiter11.IsCompleted) + { + Completed11(this); + } + else + { + awaiter11.SourceOnCompleted(Completed11Delegate, this); + } + } + if (!running12) + { + running12 = true; + awaiter12 = enumerator12.MoveNextAsync().GetAwaiter(); + if (awaiter12.IsCompleted) + { + Completed12(this); + } + else + { + awaiter12.SourceOnCompleted(Completed12Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6 || !running7 || !running8 || !running9 || !running10 || !running11 || !running12) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed7(object state) + { + var self = (_CombineLatest)state; + self.running7 = false; + + try + { + if (self.awaiter7.GetResult()) + { + self.hasCurrent7 = true; + self.current7 = self.enumerator7.Current; + goto SUCCESS; + } + else + { + self.running7 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running7 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running7 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter7 = self.enumerator7.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter7.SourceOnCompleted(Completed7Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed8(object state) + { + var self = (_CombineLatest)state; + self.running8 = false; + + try + { + if (self.awaiter8.GetResult()) + { + self.hasCurrent8 = true; + self.current8 = self.enumerator8.Current; + goto SUCCESS; + } + else + { + self.running8 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running8 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running8 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter8 = self.enumerator8.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter8.SourceOnCompleted(Completed8Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed9(object state) + { + var self = (_CombineLatest)state; + self.running9 = false; + + try + { + if (self.awaiter9.GetResult()) + { + self.hasCurrent9 = true; + self.current9 = self.enumerator9.Current; + goto SUCCESS; + } + else + { + self.running9 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running9 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running9 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter9 = self.enumerator9.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter9.SourceOnCompleted(Completed9Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed10(object state) + { + var self = (_CombineLatest)state; + self.running10 = false; + + try + { + if (self.awaiter10.GetResult()) + { + self.hasCurrent10 = true; + self.current10 = self.enumerator10.Current; + goto SUCCESS; + } + else + { + self.running10 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running10 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running10 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter10 = self.enumerator10.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter10.SourceOnCompleted(Completed10Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed11(object state) + { + var self = (_CombineLatest)state; + self.running11 = false; + + try + { + if (self.awaiter11.GetResult()) + { + self.hasCurrent11 = true; + self.current11 = self.enumerator11.Current; + goto SUCCESS; + } + else + { + self.running11 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running11 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running11 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter11 = self.enumerator11.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter11.SourceOnCompleted(Completed11Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed12(object state) + { + var self = (_CombineLatest)state; + self.running12 = false; + + try + { + if (self.awaiter12.GetResult()) + { + self.hasCurrent12 = true; + self.current12 = self.enumerator12.Current; + goto SUCCESS; + } + else + { + self.running12 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running12 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running12 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter12 = self.enumerator12.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter12.SourceOnCompleted(Completed12Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6 && hasCurrent7 && hasCurrent8 && hasCurrent9 && hasCurrent10 && hasCurrent11 && hasCurrent12) + { + result = resultSelector(current1, current2, current3, current4, current5, current6, current7, current8, current9, current10, current11, current12); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + if (enumerator7 != null) + { + await enumerator7.DisposeAsync(); + } + if (enumerator8 != null) + { + await enumerator8.DisposeAsync(); + } + if (enumerator9 != null) + { + await enumerator9.DisposeAsync(); + } + if (enumerator10 != null) + { + await enumerator10.DisposeAsync(); + } + if (enumerator11 != null) + { + await enumerator11.DisposeAsync(); + } + if (enumerator12 != null) + { + await enumerator12.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + readonly IUniTaskAsyncEnumerable source12; + readonly IUniTaskAsyncEnumerable source13; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, IUniTaskAsyncEnumerable source13, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + this.source12 = source12; + this.source13 = source13; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, source12, source13, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + static readonly Action Completed7Delegate = Completed7; + static readonly Action Completed8Delegate = Completed8; + static readonly Action Completed9Delegate = Completed9; + static readonly Action Completed10Delegate = Completed10; + static readonly Action Completed11Delegate = Completed11; + static readonly Action Completed12Delegate = Completed12; + static readonly Action Completed13Delegate = Completed13; + const int CompleteCount = 13; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + readonly IUniTaskAsyncEnumerable source12; + readonly IUniTaskAsyncEnumerable source13; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + IUniTaskAsyncEnumerator enumerator7; + UniTask.Awaiter awaiter7; + bool hasCurrent7; + bool running7; + T7 current7; + + IUniTaskAsyncEnumerator enumerator8; + UniTask.Awaiter awaiter8; + bool hasCurrent8; + bool running8; + T8 current8; + + IUniTaskAsyncEnumerator enumerator9; + UniTask.Awaiter awaiter9; + bool hasCurrent9; + bool running9; + T9 current9; + + IUniTaskAsyncEnumerator enumerator10; + UniTask.Awaiter awaiter10; + bool hasCurrent10; + bool running10; + T10 current10; + + IUniTaskAsyncEnumerator enumerator11; + UniTask.Awaiter awaiter11; + bool hasCurrent11; + bool running11; + T11 current11; + + IUniTaskAsyncEnumerator enumerator12; + UniTask.Awaiter awaiter12; + bool hasCurrent12; + bool running12; + T12 current12; + + IUniTaskAsyncEnumerator enumerator13; + UniTask.Awaiter awaiter13; + bool hasCurrent13; + bool running13; + T13 current13; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, IUniTaskAsyncEnumerable source13, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + this.source12 = source12; + this.source13 = source13; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + enumerator7 = source7.GetAsyncEnumerator(cancellationToken); + enumerator8 = source8.GetAsyncEnumerator(cancellationToken); + enumerator9 = source9.GetAsyncEnumerator(cancellationToken); + enumerator10 = source10.GetAsyncEnumerator(cancellationToken); + enumerator11 = source11.GetAsyncEnumerator(cancellationToken); + enumerator12 = source12.GetAsyncEnumerator(cancellationToken); + enumerator13 = source13.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + if (!running7) + { + running7 = true; + awaiter7 = enumerator7.MoveNextAsync().GetAwaiter(); + if (awaiter7.IsCompleted) + { + Completed7(this); + } + else + { + awaiter7.SourceOnCompleted(Completed7Delegate, this); + } + } + if (!running8) + { + running8 = true; + awaiter8 = enumerator8.MoveNextAsync().GetAwaiter(); + if (awaiter8.IsCompleted) + { + Completed8(this); + } + else + { + awaiter8.SourceOnCompleted(Completed8Delegate, this); + } + } + if (!running9) + { + running9 = true; + awaiter9 = enumerator9.MoveNextAsync().GetAwaiter(); + if (awaiter9.IsCompleted) + { + Completed9(this); + } + else + { + awaiter9.SourceOnCompleted(Completed9Delegate, this); + } + } + if (!running10) + { + running10 = true; + awaiter10 = enumerator10.MoveNextAsync().GetAwaiter(); + if (awaiter10.IsCompleted) + { + Completed10(this); + } + else + { + awaiter10.SourceOnCompleted(Completed10Delegate, this); + } + } + if (!running11) + { + running11 = true; + awaiter11 = enumerator11.MoveNextAsync().GetAwaiter(); + if (awaiter11.IsCompleted) + { + Completed11(this); + } + else + { + awaiter11.SourceOnCompleted(Completed11Delegate, this); + } + } + if (!running12) + { + running12 = true; + awaiter12 = enumerator12.MoveNextAsync().GetAwaiter(); + if (awaiter12.IsCompleted) + { + Completed12(this); + } + else + { + awaiter12.SourceOnCompleted(Completed12Delegate, this); + } + } + if (!running13) + { + running13 = true; + awaiter13 = enumerator13.MoveNextAsync().GetAwaiter(); + if (awaiter13.IsCompleted) + { + Completed13(this); + } + else + { + awaiter13.SourceOnCompleted(Completed13Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6 || !running7 || !running8 || !running9 || !running10 || !running11 || !running12 || !running13) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed7(object state) + { + var self = (_CombineLatest)state; + self.running7 = false; + + try + { + if (self.awaiter7.GetResult()) + { + self.hasCurrent7 = true; + self.current7 = self.enumerator7.Current; + goto SUCCESS; + } + else + { + self.running7 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running7 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running7 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter7 = self.enumerator7.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter7.SourceOnCompleted(Completed7Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed8(object state) + { + var self = (_CombineLatest)state; + self.running8 = false; + + try + { + if (self.awaiter8.GetResult()) + { + self.hasCurrent8 = true; + self.current8 = self.enumerator8.Current; + goto SUCCESS; + } + else + { + self.running8 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running8 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running8 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter8 = self.enumerator8.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter8.SourceOnCompleted(Completed8Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed9(object state) + { + var self = (_CombineLatest)state; + self.running9 = false; + + try + { + if (self.awaiter9.GetResult()) + { + self.hasCurrent9 = true; + self.current9 = self.enumerator9.Current; + goto SUCCESS; + } + else + { + self.running9 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running9 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running9 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter9 = self.enumerator9.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter9.SourceOnCompleted(Completed9Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed10(object state) + { + var self = (_CombineLatest)state; + self.running10 = false; + + try + { + if (self.awaiter10.GetResult()) + { + self.hasCurrent10 = true; + self.current10 = self.enumerator10.Current; + goto SUCCESS; + } + else + { + self.running10 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running10 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running10 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter10 = self.enumerator10.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter10.SourceOnCompleted(Completed10Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed11(object state) + { + var self = (_CombineLatest)state; + self.running11 = false; + + try + { + if (self.awaiter11.GetResult()) + { + self.hasCurrent11 = true; + self.current11 = self.enumerator11.Current; + goto SUCCESS; + } + else + { + self.running11 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running11 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running11 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter11 = self.enumerator11.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter11.SourceOnCompleted(Completed11Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed12(object state) + { + var self = (_CombineLatest)state; + self.running12 = false; + + try + { + if (self.awaiter12.GetResult()) + { + self.hasCurrent12 = true; + self.current12 = self.enumerator12.Current; + goto SUCCESS; + } + else + { + self.running12 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running12 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running12 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter12 = self.enumerator12.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter12.SourceOnCompleted(Completed12Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed13(object state) + { + var self = (_CombineLatest)state; + self.running13 = false; + + try + { + if (self.awaiter13.GetResult()) + { + self.hasCurrent13 = true; + self.current13 = self.enumerator13.Current; + goto SUCCESS; + } + else + { + self.running13 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running13 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running13 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter13 = self.enumerator13.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter13.SourceOnCompleted(Completed13Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6 && hasCurrent7 && hasCurrent8 && hasCurrent9 && hasCurrent10 && hasCurrent11 && hasCurrent12 && hasCurrent13) + { + result = resultSelector(current1, current2, current3, current4, current5, current6, current7, current8, current9, current10, current11, current12, current13); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + if (enumerator7 != null) + { + await enumerator7.DisposeAsync(); + } + if (enumerator8 != null) + { + await enumerator8.DisposeAsync(); + } + if (enumerator9 != null) + { + await enumerator9.DisposeAsync(); + } + if (enumerator10 != null) + { + await enumerator10.DisposeAsync(); + } + if (enumerator11 != null) + { + await enumerator11.DisposeAsync(); + } + if (enumerator12 != null) + { + await enumerator12.DisposeAsync(); + } + if (enumerator13 != null) + { + await enumerator13.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + readonly IUniTaskAsyncEnumerable source12; + readonly IUniTaskAsyncEnumerable source13; + readonly IUniTaskAsyncEnumerable source14; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, IUniTaskAsyncEnumerable source13, IUniTaskAsyncEnumerable source14, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + this.source12 = source12; + this.source13 = source13; + this.source14 = source14; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, source12, source13, source14, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + static readonly Action Completed7Delegate = Completed7; + static readonly Action Completed8Delegate = Completed8; + static readonly Action Completed9Delegate = Completed9; + static readonly Action Completed10Delegate = Completed10; + static readonly Action Completed11Delegate = Completed11; + static readonly Action Completed12Delegate = Completed12; + static readonly Action Completed13Delegate = Completed13; + static readonly Action Completed14Delegate = Completed14; + const int CompleteCount = 14; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + readonly IUniTaskAsyncEnumerable source12; + readonly IUniTaskAsyncEnumerable source13; + readonly IUniTaskAsyncEnumerable source14; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + IUniTaskAsyncEnumerator enumerator7; + UniTask.Awaiter awaiter7; + bool hasCurrent7; + bool running7; + T7 current7; + + IUniTaskAsyncEnumerator enumerator8; + UniTask.Awaiter awaiter8; + bool hasCurrent8; + bool running8; + T8 current8; + + IUniTaskAsyncEnumerator enumerator9; + UniTask.Awaiter awaiter9; + bool hasCurrent9; + bool running9; + T9 current9; + + IUniTaskAsyncEnumerator enumerator10; + UniTask.Awaiter awaiter10; + bool hasCurrent10; + bool running10; + T10 current10; + + IUniTaskAsyncEnumerator enumerator11; + UniTask.Awaiter awaiter11; + bool hasCurrent11; + bool running11; + T11 current11; + + IUniTaskAsyncEnumerator enumerator12; + UniTask.Awaiter awaiter12; + bool hasCurrent12; + bool running12; + T12 current12; + + IUniTaskAsyncEnumerator enumerator13; + UniTask.Awaiter awaiter13; + bool hasCurrent13; + bool running13; + T13 current13; + + IUniTaskAsyncEnumerator enumerator14; + UniTask.Awaiter awaiter14; + bool hasCurrent14; + bool running14; + T14 current14; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, IUniTaskAsyncEnumerable source13, IUniTaskAsyncEnumerable source14, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + this.source12 = source12; + this.source13 = source13; + this.source14 = source14; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + enumerator7 = source7.GetAsyncEnumerator(cancellationToken); + enumerator8 = source8.GetAsyncEnumerator(cancellationToken); + enumerator9 = source9.GetAsyncEnumerator(cancellationToken); + enumerator10 = source10.GetAsyncEnumerator(cancellationToken); + enumerator11 = source11.GetAsyncEnumerator(cancellationToken); + enumerator12 = source12.GetAsyncEnumerator(cancellationToken); + enumerator13 = source13.GetAsyncEnumerator(cancellationToken); + enumerator14 = source14.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + if (!running7) + { + running7 = true; + awaiter7 = enumerator7.MoveNextAsync().GetAwaiter(); + if (awaiter7.IsCompleted) + { + Completed7(this); + } + else + { + awaiter7.SourceOnCompleted(Completed7Delegate, this); + } + } + if (!running8) + { + running8 = true; + awaiter8 = enumerator8.MoveNextAsync().GetAwaiter(); + if (awaiter8.IsCompleted) + { + Completed8(this); + } + else + { + awaiter8.SourceOnCompleted(Completed8Delegate, this); + } + } + if (!running9) + { + running9 = true; + awaiter9 = enumerator9.MoveNextAsync().GetAwaiter(); + if (awaiter9.IsCompleted) + { + Completed9(this); + } + else + { + awaiter9.SourceOnCompleted(Completed9Delegate, this); + } + } + if (!running10) + { + running10 = true; + awaiter10 = enumerator10.MoveNextAsync().GetAwaiter(); + if (awaiter10.IsCompleted) + { + Completed10(this); + } + else + { + awaiter10.SourceOnCompleted(Completed10Delegate, this); + } + } + if (!running11) + { + running11 = true; + awaiter11 = enumerator11.MoveNextAsync().GetAwaiter(); + if (awaiter11.IsCompleted) + { + Completed11(this); + } + else + { + awaiter11.SourceOnCompleted(Completed11Delegate, this); + } + } + if (!running12) + { + running12 = true; + awaiter12 = enumerator12.MoveNextAsync().GetAwaiter(); + if (awaiter12.IsCompleted) + { + Completed12(this); + } + else + { + awaiter12.SourceOnCompleted(Completed12Delegate, this); + } + } + if (!running13) + { + running13 = true; + awaiter13 = enumerator13.MoveNextAsync().GetAwaiter(); + if (awaiter13.IsCompleted) + { + Completed13(this); + } + else + { + awaiter13.SourceOnCompleted(Completed13Delegate, this); + } + } + if (!running14) + { + running14 = true; + awaiter14 = enumerator14.MoveNextAsync().GetAwaiter(); + if (awaiter14.IsCompleted) + { + Completed14(this); + } + else + { + awaiter14.SourceOnCompleted(Completed14Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6 || !running7 || !running8 || !running9 || !running10 || !running11 || !running12 || !running13 || !running14) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed7(object state) + { + var self = (_CombineLatest)state; + self.running7 = false; + + try + { + if (self.awaiter7.GetResult()) + { + self.hasCurrent7 = true; + self.current7 = self.enumerator7.Current; + goto SUCCESS; + } + else + { + self.running7 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running7 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running7 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter7 = self.enumerator7.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter7.SourceOnCompleted(Completed7Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed8(object state) + { + var self = (_CombineLatest)state; + self.running8 = false; + + try + { + if (self.awaiter8.GetResult()) + { + self.hasCurrent8 = true; + self.current8 = self.enumerator8.Current; + goto SUCCESS; + } + else + { + self.running8 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running8 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running8 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter8 = self.enumerator8.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter8.SourceOnCompleted(Completed8Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed9(object state) + { + var self = (_CombineLatest)state; + self.running9 = false; + + try + { + if (self.awaiter9.GetResult()) + { + self.hasCurrent9 = true; + self.current9 = self.enumerator9.Current; + goto SUCCESS; + } + else + { + self.running9 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running9 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running9 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter9 = self.enumerator9.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter9.SourceOnCompleted(Completed9Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed10(object state) + { + var self = (_CombineLatest)state; + self.running10 = false; + + try + { + if (self.awaiter10.GetResult()) + { + self.hasCurrent10 = true; + self.current10 = self.enumerator10.Current; + goto SUCCESS; + } + else + { + self.running10 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running10 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running10 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter10 = self.enumerator10.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter10.SourceOnCompleted(Completed10Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed11(object state) + { + var self = (_CombineLatest)state; + self.running11 = false; + + try + { + if (self.awaiter11.GetResult()) + { + self.hasCurrent11 = true; + self.current11 = self.enumerator11.Current; + goto SUCCESS; + } + else + { + self.running11 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running11 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running11 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter11 = self.enumerator11.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter11.SourceOnCompleted(Completed11Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed12(object state) + { + var self = (_CombineLatest)state; + self.running12 = false; + + try + { + if (self.awaiter12.GetResult()) + { + self.hasCurrent12 = true; + self.current12 = self.enumerator12.Current; + goto SUCCESS; + } + else + { + self.running12 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running12 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running12 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter12 = self.enumerator12.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter12.SourceOnCompleted(Completed12Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed13(object state) + { + var self = (_CombineLatest)state; + self.running13 = false; + + try + { + if (self.awaiter13.GetResult()) + { + self.hasCurrent13 = true; + self.current13 = self.enumerator13.Current; + goto SUCCESS; + } + else + { + self.running13 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running13 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running13 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter13 = self.enumerator13.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter13.SourceOnCompleted(Completed13Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed14(object state) + { + var self = (_CombineLatest)state; + self.running14 = false; + + try + { + if (self.awaiter14.GetResult()) + { + self.hasCurrent14 = true; + self.current14 = self.enumerator14.Current; + goto SUCCESS; + } + else + { + self.running14 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running14 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running14 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter14 = self.enumerator14.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter14.SourceOnCompleted(Completed14Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6 && hasCurrent7 && hasCurrent8 && hasCurrent9 && hasCurrent10 && hasCurrent11 && hasCurrent12 && hasCurrent13 && hasCurrent14) + { + result = resultSelector(current1, current2, current3, current4, current5, current6, current7, current8, current9, current10, current11, current12, current13, current14); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + if (enumerator7 != null) + { + await enumerator7.DisposeAsync(); + } + if (enumerator8 != null) + { + await enumerator8.DisposeAsync(); + } + if (enumerator9 != null) + { + await enumerator9.DisposeAsync(); + } + if (enumerator10 != null) + { + await enumerator10.DisposeAsync(); + } + if (enumerator11 != null) + { + await enumerator11.DisposeAsync(); + } + if (enumerator12 != null) + { + await enumerator12.DisposeAsync(); + } + if (enumerator13 != null) + { + await enumerator13.DisposeAsync(); + } + if (enumerator14 != null) + { + await enumerator14.DisposeAsync(); + } + } + } + } + + internal class CombineLatest : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + readonly IUniTaskAsyncEnumerable source12; + readonly IUniTaskAsyncEnumerable source13; + readonly IUniTaskAsyncEnumerable source14; + readonly IUniTaskAsyncEnumerable source15; + + readonly Func resultSelector; + + public CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, IUniTaskAsyncEnumerable source13, IUniTaskAsyncEnumerable source14, IUniTaskAsyncEnumerable source15, Func resultSelector) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + this.source12 = source12; + this.source13 = source13; + this.source14 = source14; + this.source15 = source15; + + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _CombineLatest(source1, source2, source3, source4, source5, source6, source7, source8, source9, source10, source11, source12, source13, source14, source15, resultSelector, cancellationToken); + } + + class _CombineLatest : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action Completed1Delegate = Completed1; + static readonly Action Completed2Delegate = Completed2; + static readonly Action Completed3Delegate = Completed3; + static readonly Action Completed4Delegate = Completed4; + static readonly Action Completed5Delegate = Completed5; + static readonly Action Completed6Delegate = Completed6; + static readonly Action Completed7Delegate = Completed7; + static readonly Action Completed8Delegate = Completed8; + static readonly Action Completed9Delegate = Completed9; + static readonly Action Completed10Delegate = Completed10; + static readonly Action Completed11Delegate = Completed11; + static readonly Action Completed12Delegate = Completed12; + static readonly Action Completed13Delegate = Completed13; + static readonly Action Completed14Delegate = Completed14; + static readonly Action Completed15Delegate = Completed15; + const int CompleteCount = 15; + + readonly IUniTaskAsyncEnumerable source1; + readonly IUniTaskAsyncEnumerable source2; + readonly IUniTaskAsyncEnumerable source3; + readonly IUniTaskAsyncEnumerable source4; + readonly IUniTaskAsyncEnumerable source5; + readonly IUniTaskAsyncEnumerable source6; + readonly IUniTaskAsyncEnumerable source7; + readonly IUniTaskAsyncEnumerable source8; + readonly IUniTaskAsyncEnumerable source9; + readonly IUniTaskAsyncEnumerable source10; + readonly IUniTaskAsyncEnumerable source11; + readonly IUniTaskAsyncEnumerable source12; + readonly IUniTaskAsyncEnumerable source13; + readonly IUniTaskAsyncEnumerable source14; + readonly IUniTaskAsyncEnumerable source15; + + readonly Func resultSelector; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator1; + UniTask.Awaiter awaiter1; + bool hasCurrent1; + bool running1; + T1 current1; + + IUniTaskAsyncEnumerator enumerator2; + UniTask.Awaiter awaiter2; + bool hasCurrent2; + bool running2; + T2 current2; + + IUniTaskAsyncEnumerator enumerator3; + UniTask.Awaiter awaiter3; + bool hasCurrent3; + bool running3; + T3 current3; + + IUniTaskAsyncEnumerator enumerator4; + UniTask.Awaiter awaiter4; + bool hasCurrent4; + bool running4; + T4 current4; + + IUniTaskAsyncEnumerator enumerator5; + UniTask.Awaiter awaiter5; + bool hasCurrent5; + bool running5; + T5 current5; + + IUniTaskAsyncEnumerator enumerator6; + UniTask.Awaiter awaiter6; + bool hasCurrent6; + bool running6; + T6 current6; + + IUniTaskAsyncEnumerator enumerator7; + UniTask.Awaiter awaiter7; + bool hasCurrent7; + bool running7; + T7 current7; + + IUniTaskAsyncEnumerator enumerator8; + UniTask.Awaiter awaiter8; + bool hasCurrent8; + bool running8; + T8 current8; + + IUniTaskAsyncEnumerator enumerator9; + UniTask.Awaiter awaiter9; + bool hasCurrent9; + bool running9; + T9 current9; + + IUniTaskAsyncEnumerator enumerator10; + UniTask.Awaiter awaiter10; + bool hasCurrent10; + bool running10; + T10 current10; + + IUniTaskAsyncEnumerator enumerator11; + UniTask.Awaiter awaiter11; + bool hasCurrent11; + bool running11; + T11 current11; + + IUniTaskAsyncEnumerator enumerator12; + UniTask.Awaiter awaiter12; + bool hasCurrent12; + bool running12; + T12 current12; + + IUniTaskAsyncEnumerator enumerator13; + UniTask.Awaiter awaiter13; + bool hasCurrent13; + bool running13; + T13 current13; + + IUniTaskAsyncEnumerator enumerator14; + UniTask.Awaiter awaiter14; + bool hasCurrent14; + bool running14; + T14 current14; + + IUniTaskAsyncEnumerator enumerator15; + UniTask.Awaiter awaiter15; + bool hasCurrent15; + bool running15; + T15 current15; + + int completedCount; + bool syncRunning; + TResult result; + + public _CombineLatest(IUniTaskAsyncEnumerable source1, IUniTaskAsyncEnumerable source2, IUniTaskAsyncEnumerable source3, IUniTaskAsyncEnumerable source4, IUniTaskAsyncEnumerable source5, IUniTaskAsyncEnumerable source6, IUniTaskAsyncEnumerable source7, IUniTaskAsyncEnumerable source8, IUniTaskAsyncEnumerable source9, IUniTaskAsyncEnumerable source10, IUniTaskAsyncEnumerable source11, IUniTaskAsyncEnumerable source12, IUniTaskAsyncEnumerable source13, IUniTaskAsyncEnumerable source14, IUniTaskAsyncEnumerable source15, Func resultSelector, CancellationToken cancellationToken) + { + this.source1 = source1; + this.source2 = source2; + this.source3 = source3; + this.source4 = source4; + this.source5 = source5; + this.source6 = source6; + this.source7 = source7; + this.source8 = source8; + this.source9 = source9; + this.source10 = source10; + this.source11 = source11; + this.source12 = source12; + this.source13 = source13; + this.source14 = source14; + this.source15 = source15; + + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current => result; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + if (completedCount == CompleteCount) return CompletedTasks.False; + + if (enumerator1 == null) + { + enumerator1 = source1.GetAsyncEnumerator(cancellationToken); + enumerator2 = source2.GetAsyncEnumerator(cancellationToken); + enumerator3 = source3.GetAsyncEnumerator(cancellationToken); + enumerator4 = source4.GetAsyncEnumerator(cancellationToken); + enumerator5 = source5.GetAsyncEnumerator(cancellationToken); + enumerator6 = source6.GetAsyncEnumerator(cancellationToken); + enumerator7 = source7.GetAsyncEnumerator(cancellationToken); + enumerator8 = source8.GetAsyncEnumerator(cancellationToken); + enumerator9 = source9.GetAsyncEnumerator(cancellationToken); + enumerator10 = source10.GetAsyncEnumerator(cancellationToken); + enumerator11 = source11.GetAsyncEnumerator(cancellationToken); + enumerator12 = source12.GetAsyncEnumerator(cancellationToken); + enumerator13 = source13.GetAsyncEnumerator(cancellationToken); + enumerator14 = source14.GetAsyncEnumerator(cancellationToken); + enumerator15 = source15.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + + AGAIN: + syncRunning = true; + if (!running1) + { + running1 = true; + awaiter1 = enumerator1.MoveNextAsync().GetAwaiter(); + if (awaiter1.IsCompleted) + { + Completed1(this); + } + else + { + awaiter1.SourceOnCompleted(Completed1Delegate, this); + } + } + if (!running2) + { + running2 = true; + awaiter2 = enumerator2.MoveNextAsync().GetAwaiter(); + if (awaiter2.IsCompleted) + { + Completed2(this); + } + else + { + awaiter2.SourceOnCompleted(Completed2Delegate, this); + } + } + if (!running3) + { + running3 = true; + awaiter3 = enumerator3.MoveNextAsync().GetAwaiter(); + if (awaiter3.IsCompleted) + { + Completed3(this); + } + else + { + awaiter3.SourceOnCompleted(Completed3Delegate, this); + } + } + if (!running4) + { + running4 = true; + awaiter4 = enumerator4.MoveNextAsync().GetAwaiter(); + if (awaiter4.IsCompleted) + { + Completed4(this); + } + else + { + awaiter4.SourceOnCompleted(Completed4Delegate, this); + } + } + if (!running5) + { + running5 = true; + awaiter5 = enumerator5.MoveNextAsync().GetAwaiter(); + if (awaiter5.IsCompleted) + { + Completed5(this); + } + else + { + awaiter5.SourceOnCompleted(Completed5Delegate, this); + } + } + if (!running6) + { + running6 = true; + awaiter6 = enumerator6.MoveNextAsync().GetAwaiter(); + if (awaiter6.IsCompleted) + { + Completed6(this); + } + else + { + awaiter6.SourceOnCompleted(Completed6Delegate, this); + } + } + if (!running7) + { + running7 = true; + awaiter7 = enumerator7.MoveNextAsync().GetAwaiter(); + if (awaiter7.IsCompleted) + { + Completed7(this); + } + else + { + awaiter7.SourceOnCompleted(Completed7Delegate, this); + } + } + if (!running8) + { + running8 = true; + awaiter8 = enumerator8.MoveNextAsync().GetAwaiter(); + if (awaiter8.IsCompleted) + { + Completed8(this); + } + else + { + awaiter8.SourceOnCompleted(Completed8Delegate, this); + } + } + if (!running9) + { + running9 = true; + awaiter9 = enumerator9.MoveNextAsync().GetAwaiter(); + if (awaiter9.IsCompleted) + { + Completed9(this); + } + else + { + awaiter9.SourceOnCompleted(Completed9Delegate, this); + } + } + if (!running10) + { + running10 = true; + awaiter10 = enumerator10.MoveNextAsync().GetAwaiter(); + if (awaiter10.IsCompleted) + { + Completed10(this); + } + else + { + awaiter10.SourceOnCompleted(Completed10Delegate, this); + } + } + if (!running11) + { + running11 = true; + awaiter11 = enumerator11.MoveNextAsync().GetAwaiter(); + if (awaiter11.IsCompleted) + { + Completed11(this); + } + else + { + awaiter11.SourceOnCompleted(Completed11Delegate, this); + } + } + if (!running12) + { + running12 = true; + awaiter12 = enumerator12.MoveNextAsync().GetAwaiter(); + if (awaiter12.IsCompleted) + { + Completed12(this); + } + else + { + awaiter12.SourceOnCompleted(Completed12Delegate, this); + } + } + if (!running13) + { + running13 = true; + awaiter13 = enumerator13.MoveNextAsync().GetAwaiter(); + if (awaiter13.IsCompleted) + { + Completed13(this); + } + else + { + awaiter13.SourceOnCompleted(Completed13Delegate, this); + } + } + if (!running14) + { + running14 = true; + awaiter14 = enumerator14.MoveNextAsync().GetAwaiter(); + if (awaiter14.IsCompleted) + { + Completed14(this); + } + else + { + awaiter14.SourceOnCompleted(Completed14Delegate, this); + } + } + if (!running15) + { + running15 = true; + awaiter15 = enumerator15.MoveNextAsync().GetAwaiter(); + if (awaiter15.IsCompleted) + { + Completed15(this); + } + else + { + awaiter15.SourceOnCompleted(Completed15Delegate, this); + } + } + + if (!running1 || !running2 || !running3 || !running4 || !running5 || !running6 || !running7 || !running8 || !running9 || !running10 || !running11 || !running12 || !running13 || !running14 || !running15) + { + goto AGAIN; + } + syncRunning = false; + + return new UniTask(this, completionSource.Version); + } + + static void Completed1(object state) + { + var self = (_CombineLatest)state; + self.running1 = false; + + try + { + if (self.awaiter1.GetResult()) + { + self.hasCurrent1 = true; + self.current1 = self.enumerator1.Current; + goto SUCCESS; + } + else + { + self.running1 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running1 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running1 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter1 = self.enumerator1.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter1.SourceOnCompleted(Completed1Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed2(object state) + { + var self = (_CombineLatest)state; + self.running2 = false; + + try + { + if (self.awaiter2.GetResult()) + { + self.hasCurrent2 = true; + self.current2 = self.enumerator2.Current; + goto SUCCESS; + } + else + { + self.running2 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running2 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running2 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter2 = self.enumerator2.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter2.SourceOnCompleted(Completed2Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed3(object state) + { + var self = (_CombineLatest)state; + self.running3 = false; + + try + { + if (self.awaiter3.GetResult()) + { + self.hasCurrent3 = true; + self.current3 = self.enumerator3.Current; + goto SUCCESS; + } + else + { + self.running3 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running3 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running3 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter3 = self.enumerator3.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter3.SourceOnCompleted(Completed3Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed4(object state) + { + var self = (_CombineLatest)state; + self.running4 = false; + + try + { + if (self.awaiter4.GetResult()) + { + self.hasCurrent4 = true; + self.current4 = self.enumerator4.Current; + goto SUCCESS; + } + else + { + self.running4 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running4 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running4 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter4 = self.enumerator4.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter4.SourceOnCompleted(Completed4Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed5(object state) + { + var self = (_CombineLatest)state; + self.running5 = false; + + try + { + if (self.awaiter5.GetResult()) + { + self.hasCurrent5 = true; + self.current5 = self.enumerator5.Current; + goto SUCCESS; + } + else + { + self.running5 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running5 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running5 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter5 = self.enumerator5.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter5.SourceOnCompleted(Completed5Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed6(object state) + { + var self = (_CombineLatest)state; + self.running6 = false; + + try + { + if (self.awaiter6.GetResult()) + { + self.hasCurrent6 = true; + self.current6 = self.enumerator6.Current; + goto SUCCESS; + } + else + { + self.running6 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running6 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running6 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter6 = self.enumerator6.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter6.SourceOnCompleted(Completed6Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed7(object state) + { + var self = (_CombineLatest)state; + self.running7 = false; + + try + { + if (self.awaiter7.GetResult()) + { + self.hasCurrent7 = true; + self.current7 = self.enumerator7.Current; + goto SUCCESS; + } + else + { + self.running7 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running7 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running7 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter7 = self.enumerator7.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter7.SourceOnCompleted(Completed7Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed8(object state) + { + var self = (_CombineLatest)state; + self.running8 = false; + + try + { + if (self.awaiter8.GetResult()) + { + self.hasCurrent8 = true; + self.current8 = self.enumerator8.Current; + goto SUCCESS; + } + else + { + self.running8 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running8 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running8 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter8 = self.enumerator8.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter8.SourceOnCompleted(Completed8Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed9(object state) + { + var self = (_CombineLatest)state; + self.running9 = false; + + try + { + if (self.awaiter9.GetResult()) + { + self.hasCurrent9 = true; + self.current9 = self.enumerator9.Current; + goto SUCCESS; + } + else + { + self.running9 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running9 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running9 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter9 = self.enumerator9.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter9.SourceOnCompleted(Completed9Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed10(object state) + { + var self = (_CombineLatest)state; + self.running10 = false; + + try + { + if (self.awaiter10.GetResult()) + { + self.hasCurrent10 = true; + self.current10 = self.enumerator10.Current; + goto SUCCESS; + } + else + { + self.running10 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running10 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running10 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter10 = self.enumerator10.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter10.SourceOnCompleted(Completed10Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed11(object state) + { + var self = (_CombineLatest)state; + self.running11 = false; + + try + { + if (self.awaiter11.GetResult()) + { + self.hasCurrent11 = true; + self.current11 = self.enumerator11.Current; + goto SUCCESS; + } + else + { + self.running11 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running11 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running11 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter11 = self.enumerator11.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter11.SourceOnCompleted(Completed11Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed12(object state) + { + var self = (_CombineLatest)state; + self.running12 = false; + + try + { + if (self.awaiter12.GetResult()) + { + self.hasCurrent12 = true; + self.current12 = self.enumerator12.Current; + goto SUCCESS; + } + else + { + self.running12 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running12 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running12 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter12 = self.enumerator12.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter12.SourceOnCompleted(Completed12Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed13(object state) + { + var self = (_CombineLatest)state; + self.running13 = false; + + try + { + if (self.awaiter13.GetResult()) + { + self.hasCurrent13 = true; + self.current13 = self.enumerator13.Current; + goto SUCCESS; + } + else + { + self.running13 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running13 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running13 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter13 = self.enumerator13.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter13.SourceOnCompleted(Completed13Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed14(object state) + { + var self = (_CombineLatest)state; + self.running14 = false; + + try + { + if (self.awaiter14.GetResult()) + { + self.hasCurrent14 = true; + self.current14 = self.enumerator14.Current; + goto SUCCESS; + } + else + { + self.running14 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running14 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running14 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter14 = self.enumerator14.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter14.SourceOnCompleted(Completed14Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + static void Completed15(object state) + { + var self = (_CombineLatest)state; + self.running15 = false; + + try + { + if (self.awaiter15.GetResult()) + { + self.hasCurrent15 = true; + self.current15 = self.enumerator15.Current; + goto SUCCESS; + } + else + { + self.running15 = true; // as complete, no more call MoveNextAsync. + if (Interlocked.Increment(ref self.completedCount) == CompleteCount) + { + goto COMPLETE; + } + return; + } + } + catch (Exception ex) + { + self.running15 = true; // as complete, no more call MoveNextAsync. + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + SUCCESS: + if (!self.TrySetResult()) + { + if (self.syncRunning) return; + self.running15 = true; // as complete, no more call MoveNextAsync. + try + { + self.awaiter15 = self.enumerator15.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completedCount = CompleteCount; + self.completionSource.TrySetException(ex); + return; + } + + self.awaiter15.SourceOnCompleted(Completed15Delegate, self); + } + return; + COMPLETE: + self.completionSource.TrySetResult(false); + return; + } + + bool TrySetResult() + { + if (hasCurrent1 && hasCurrent2 && hasCurrent3 && hasCurrent4 && hasCurrent5 && hasCurrent6 && hasCurrent7 && hasCurrent8 && hasCurrent9 && hasCurrent10 && hasCurrent11 && hasCurrent12 && hasCurrent13 && hasCurrent14 && hasCurrent15) + { + result = resultSelector(current1, current2, current3, current4, current5, current6, current7, current8, current9, current10, current11, current12, current13, current14, current15); + completionSource.TrySetResult(true); + return true; + } + else + { + return false; + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator1 != null) + { + await enumerator1.DisposeAsync(); + } + if (enumerator2 != null) + { + await enumerator2.DisposeAsync(); + } + if (enumerator3 != null) + { + await enumerator3.DisposeAsync(); + } + if (enumerator4 != null) + { + await enumerator4.DisposeAsync(); + } + if (enumerator5 != null) + { + await enumerator5.DisposeAsync(); + } + if (enumerator6 != null) + { + await enumerator6.DisposeAsync(); + } + if (enumerator7 != null) + { + await enumerator7.DisposeAsync(); + } + if (enumerator8 != null) + { + await enumerator8.DisposeAsync(); + } + if (enumerator9 != null) + { + await enumerator9.DisposeAsync(); + } + if (enumerator10 != null) + { + await enumerator10.DisposeAsync(); + } + if (enumerator11 != null) + { + await enumerator11.DisposeAsync(); + } + if (enumerator12 != null) + { + await enumerator12.DisposeAsync(); + } + if (enumerator13 != null) + { + await enumerator13.DisposeAsync(); + } + if (enumerator14 != null) + { + await enumerator14.DisposeAsync(); + } + if (enumerator15 != null) + { + await enumerator15.DisposeAsync(); + } + } + } + } + +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs.meta new file mode 100644 index 00000000..4e8b1c34 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6cb07f6e88287e34d9b9301a572284a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs new file mode 100644 index 00000000..715795e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs @@ -0,0 +1,164 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Concat(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + + return new Concat(first, second); + } + } + + internal sealed class Concat : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + + public Concat(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second) + { + this.first = first; + this.second = second; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Concat(first, second, cancellationToken); + } + + sealed class _Concat : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + enum IteratingState + { + IteratingFirst, + IteratingSecond, + Complete + } + + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + CancellationToken cancellationToken; + + IteratingState iteratingState; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + + public _Concat(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, CancellationToken cancellationToken) + { + this.first = first; + this.second = second; + this.cancellationToken = cancellationToken; + this.iteratingState = IteratingState.IteratingFirst; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (iteratingState == IteratingState.Complete) return CompletedTasks.False; + + completionSource.Reset(); + StartIterate(); + return new UniTask(this, completionSource.Version); + } + + void StartIterate() + { + if (enumerator == null) + { + if (iteratingState == IteratingState.IteratingFirst) + { + enumerator = first.GetAsyncEnumerator(cancellationToken); + } + else if (iteratingState == IteratingState.IteratingSecond) + { + enumerator = second.GetAsyncEnumerator(cancellationToken); + } + } + + try + { + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + + if (awaiter.IsCompleted) + { + MoveNextCoreDelegate(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + + static void MoveNextCore(object state) + { + var self = (_Concat)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.Current = self.enumerator.Current; + self.completionSource.TrySetResult(true); + } + else + { + if (self.iteratingState == IteratingState.IteratingFirst) + { + self.RunSecondAfterDisposeAsync().Forget(); + return; + } + + self.iteratingState = IteratingState.Complete; + self.completionSource.TrySetResult(false); + } + } + } + + async UniTaskVoid RunSecondAfterDisposeAsync() + { + try + { + await enumerator.DisposeAsync(); + enumerator = null; + awaiter = default; + iteratingState = IteratingState.IteratingSecond; + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + + StartIterate(); + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs.meta new file mode 100644 index 00000000..6bfcf318 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Concat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7cb9e19c449127a459851a135ce7d527 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs new file mode 100644 index 00000000..a93f566c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs @@ -0,0 +1,50 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask ContainsAsync(this IUniTaskAsyncEnumerable source, TSource value, CancellationToken cancellationToken = default) + { + return ContainsAsync(source, value, EqualityComparer.Default, cancellationToken); + } + + public static UniTask ContainsAsync(this IUniTaskAsyncEnumerable source, TSource value, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return Contains.ContainsAsync(source, value, comparer, cancellationToken); + } + } + + internal static class Contains + { + internal static async UniTask ContainsAsync(IUniTaskAsyncEnumerable source, TSource value, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (comparer.Equals(value, e.Current)) + { + return true; + } + } + + return false; + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs.meta new file mode 100644 index 00000000..9bd414b3 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Contains.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36ab06d30f3223048b4f676e05431a7f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Count.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Count.cs new file mode 100644 index 00000000..807b529b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Count.cs @@ -0,0 +1,144 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask CountAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Count.CountAsync(source, cancellationToken); + } + + public static UniTask CountAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Count.CountAsync(source, predicate, cancellationToken); + } + + public static UniTask CountAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Count.CountAwaitAsync(source, predicate, cancellationToken); + } + + public static UniTask CountAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Count.CountAwaitWithCancellationAsync(source, predicate, cancellationToken); + } + } + + internal static class Count + { + internal static async UniTask CountAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + var count = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked { count++; } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return count; + } + + internal static async UniTask CountAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + { + var count = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (predicate(e.Current)) + { + checked { count++; } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return count; + } + + internal static async UniTask CountAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + var count = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (await predicate(e.Current)) + { + checked { count++; } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return count; + } + + internal static async UniTask CountAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + var count = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (await predicate(e.Current, cancellationToken)) + { + checked { count++; } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return count; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Count.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Count.cs.meta new file mode 100644 index 00000000..35db3324 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Count.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e606d38eed688574bb2ba89d983cc9bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Create.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Create.cs new file mode 100644 index 00000000..fa34774a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Create.cs @@ -0,0 +1,184 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Create(Func, CancellationToken, UniTask> create) + { + Error.ThrowArgumentNullException(create, nameof(create)); + return new Create(create); + } + } + + public interface IAsyncWriter + { + UniTask YieldAsync(T value); + } + + internal sealed class Create : IUniTaskAsyncEnumerable + { + readonly Func, CancellationToken, UniTask> create; + + public Create(Func, CancellationToken, UniTask> create) + { + this.create = create; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Create(create, cancellationToken); + } + + sealed class _Create : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly Func, CancellationToken, UniTask> create; + readonly CancellationToken cancellationToken; + + int state = -1; + AsyncWriter writer; + + public _Create(Func, CancellationToken, UniTask> create, CancellationToken cancellationToken) + { + this.create = create; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public T Current { get; private set; } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + writer.Dispose(); + return default; + } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + try + { + switch (state) + { + case -1: // init + { + writer = new AsyncWriter(this); + RunWriterTask(create(writer, cancellationToken)).Forget(); + if (Volatile.Read(ref state) == -2) + { + return; // complete synchronously + } + state = 0; // wait YieldAsync, it set TrySetResult(true) + return; + } + case 0: + writer.SignalWriter(); + return; + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + } + + async UniTaskVoid RunWriterTask(UniTask task) + { + try + { + await task; + goto DONE; + } + catch (Exception ex) + { + Volatile.Write(ref state, -2); + completionSource.TrySetException(ex); + return; + } + + DONE: + Volatile.Write(ref state, -2); + completionSource.TrySetResult(false); + } + + public void SetResult(T value) + { + Current = value; + completionSource.TrySetResult(true); + } + } + + sealed class AsyncWriter : IUniTaskSource, IAsyncWriter, IDisposable + { + readonly _Create enumerator; + + UniTaskCompletionSourceCore core; + + public AsyncWriter(_Create enumerator) + { + this.enumerator = enumerator; + } + + public void Dispose() + { + var status = core.GetStatus(core.Version); + if (status == UniTaskStatus.Pending) + { + core.TrySetCanceled(); + } + } + + public void GetResult(short token) + { + core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTask YieldAsync(T value) + { + core.Reset(); + enumerator.SetResult(value); + return new UniTask(this, core.Version); + } + + public void SignalWriter() + { + core.TrySetResult(AsyncUnit.Default); + } + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Create.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Create.cs.meta new file mode 100644 index 00000000..5aba456f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Create.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0202f723469f93945afa063bfb440d15 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs new file mode 100644 index 00000000..3d21bd7c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs @@ -0,0 +1,142 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable DefaultIfEmpty(this IUniTaskAsyncEnumerable source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new DefaultIfEmpty(source, default); + } + + public static IUniTaskAsyncEnumerable DefaultIfEmpty(this IUniTaskAsyncEnumerable source, TSource defaultValue) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new DefaultIfEmpty(source, defaultValue); + } + } + + internal sealed class DefaultIfEmpty : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly TSource defaultValue; + + public DefaultIfEmpty(IUniTaskAsyncEnumerable source, TSource defaultValue) + { + this.source = source; + this.defaultValue = defaultValue; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _DefaultIfEmpty(source, defaultValue, cancellationToken); + } + + sealed class _DefaultIfEmpty : MoveNextSource, IUniTaskAsyncEnumerator + { + enum IteratingState : byte + { + Empty, + Iterating, + Completed + } + + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + readonly TSource defaultValue; + CancellationToken cancellationToken; + + IteratingState iteratingState; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + + public _DefaultIfEmpty(IUniTaskAsyncEnumerable source, TSource defaultValue, CancellationToken cancellationToken) + { + this.source = source; + this.defaultValue = defaultValue; + this.cancellationToken = cancellationToken; + + this.iteratingState = IteratingState.Empty; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (iteratingState == IteratingState.Completed) + { + return CompletedTasks.False; + } + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + } + + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + + if (awaiter.IsCompleted) + { + MoveNextCore(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + + return new UniTask(this, completionSource.Version); + } + + static void MoveNextCore(object state) + { + var self = (_DefaultIfEmpty)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.iteratingState = IteratingState.Iterating; + self.Current = self.enumerator.Current; + self.completionSource.TrySetResult(true); + } + else + { + if (self.iteratingState == IteratingState.Empty) + { + self.iteratingState = IteratingState.Completed; + + self.Current = self.defaultValue; + self.completionSource.TrySetResult(true); + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } + +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs.meta new file mode 100644 index 00000000..5aa59939 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DefaultIfEmpty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19e437c039ad7e1478dbce1779ef8660 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs new file mode 100644 index 00000000..85bf795b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs @@ -0,0 +1,277 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Distinct(this IUniTaskAsyncEnumerable source) + { + return Distinct(source, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable Distinct(this IUniTaskAsyncEnumerable source, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new Distinct(source, comparer); + } + + public static IUniTaskAsyncEnumerable Distinct(this IUniTaskAsyncEnumerable source, Func keySelector) + { + return Distinct(source, keySelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable Distinct(this IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new Distinct(source, keySelector, comparer); + } + + public static IUniTaskAsyncEnumerable DistinctAwait(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + return DistinctAwait(source, keySelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable DistinctAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new DistinctAwait(source, keySelector, comparer); + } + + public static IUniTaskAsyncEnumerable DistinctAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + return DistinctAwaitWithCancellation(source, keySelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable DistinctAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new DistinctAwaitWithCancellation(source, keySelector, comparer); + } + } + + internal sealed class Distinct : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly IEqualityComparer comparer; + + public Distinct(IUniTaskAsyncEnumerable source, IEqualityComparer comparer) + { + this.source = source; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Distinct(source, comparer, cancellationToken); + } + + class _Distinct : AsyncEnumeratorBase + { + readonly HashSet set; + + public _Distinct(IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.set = new HashSet(comparer); + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + var v = SourceCurrent; + if (set.Add(v)) + { + Current = v; + result = true; + return true; + } + else + { + result = default; + return false; + } + } + + result = false; + return true; + } + } + } + + internal sealed class Distinct : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func keySelector; + readonly IEqualityComparer comparer; + + public Distinct(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Distinct(source, keySelector, comparer, cancellationToken); + } + + class _Distinct : AsyncEnumeratorBase + { + readonly HashSet set; + readonly Func keySelector; + + public _Distinct(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.set = new HashSet(comparer); + this.keySelector = keySelector; + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + var v = SourceCurrent; + if (set.Add(keySelector(v))) + { + Current = v; + result = true; + return true; + } + else + { + result = default; + return false; + } + } + + result = false; + return true; + } + } + } + + internal sealed class DistinctAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly IEqualityComparer comparer; + + public DistinctAwait(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _DistinctAwait(source, keySelector, comparer, cancellationToken); + } + + class _DistinctAwait : AsyncEnumeratorAwaitSelectorBase + { + readonly HashSet set; + readonly Func> keySelector; + + public _DistinctAwait(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.set = new HashSet(comparer); + this.keySelector = keySelector; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + return keySelector(sourceCurrent); + } + + protected override bool TrySetCurrentCore(TKey awaitResult, out bool terminateIteration) + { + if (set.Add(awaitResult)) + { + Current = SourceCurrent; + terminateIteration = false; + return true; + } + else + { + terminateIteration = false; + return false; + } + } + } + } + + internal sealed class DistinctAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly IEqualityComparer comparer; + + public DistinctAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _DistinctAwaitWithCancellation(source, keySelector, comparer, cancellationToken); + } + + class _DistinctAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase + { + readonly HashSet set; + readonly Func> keySelector; + + public _DistinctAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.set = new HashSet(comparer); + this.keySelector = keySelector; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + return keySelector(sourceCurrent, cancellationToken); + } + + protected override bool TrySetCurrentCore(TKey awaitResult, out bool terminateIteration) + { + if (set.Add(awaitResult)) + { + Current = SourceCurrent; + terminateIteration = false; + return true; + } + else + { + terminateIteration = false; + return false; + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs.meta new file mode 100644 index 00000000..61804b7f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Distinct.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8f09903be66e5d943b243d7c19cb3811 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs new file mode 100644 index 00000000..d91bef9f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs @@ -0,0 +1,662 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable DistinctUntilChanged(this IUniTaskAsyncEnumerable source) + { + return DistinctUntilChanged(source, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable DistinctUntilChanged(this IUniTaskAsyncEnumerable source, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new DistinctUntilChanged(source, comparer); + } + + public static IUniTaskAsyncEnumerable DistinctUntilChanged(this IUniTaskAsyncEnumerable source, Func keySelector) + { + return DistinctUntilChanged(source, keySelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable DistinctUntilChanged(this IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new DistinctUntilChanged(source, keySelector, comparer); + } + + public static IUniTaskAsyncEnumerable DistinctUntilChangedAwait(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + return DistinctUntilChangedAwait(source, keySelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable DistinctUntilChangedAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new DistinctUntilChangedAwait(source, keySelector, comparer); + } + + public static IUniTaskAsyncEnumerable DistinctUntilChangedAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + return DistinctUntilChangedAwaitWithCancellation(source, keySelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable DistinctUntilChangedAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new DistinctUntilChangedAwaitWithCancellation(source, keySelector, comparer); + } + } + + internal sealed class DistinctUntilChanged : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly IEqualityComparer comparer; + + public DistinctUntilChanged(IUniTaskAsyncEnumerable source, IEqualityComparer comparer) + { + this.source = source; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _DistinctUntilChanged(source, comparer, cancellationToken); + } + + sealed class _DistinctUntilChanged : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly IEqualityComparer comparer; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + Action moveNextAction; + + public _DistinctUntilChanged(IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case -3; + } + else + { + state = -3; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case -3: // first + if (awaiter.GetResult()) + { + Current = enumerator.Current; + goto CONTINUE; + } + else + { + goto DONE; + } + case 0: // normal + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + var v = enumerator.Current; + if (!comparer.Equals(Current, v)) + { + Current = v; + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + } + else + { + goto DONE; + } + case -2: + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class DistinctUntilChanged : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func keySelector; + readonly IEqualityComparer comparer; + + public DistinctUntilChanged(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _DistinctUntilChanged(source, keySelector, comparer, cancellationToken); + } + + sealed class _DistinctUntilChanged : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func keySelector; + readonly IEqualityComparer comparer; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + Action moveNextAction; + TKey prev; + + public _DistinctUntilChanged(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.keySelector = keySelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case -3; + } + else + { + state = -3; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case -3: // first + if (awaiter.GetResult()) + { + Current = enumerator.Current; + goto CONTINUE; + } + else + { + goto DONE; + } + case 0: // normal + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + var v = enumerator.Current; + var key = keySelector(v); + if (!comparer.Equals(prev, key)) + { + prev = key; + Current = v; + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + } + else + { + goto DONE; + } + case -2: + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class DistinctUntilChangedAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly IEqualityComparer comparer; + + public DistinctUntilChangedAwait(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _DistinctUntilChangedAwait(source, keySelector, comparer, cancellationToken); + } + + sealed class _DistinctUntilChangedAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly IEqualityComparer comparer; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + TSource enumeratorCurrent; + TKey prev; + + public _DistinctUntilChangedAwait(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.keySelector = keySelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case -3; + } + else + { + state = -3; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case -3: // first + if (awaiter.GetResult()) + { + Current = enumerator.Current; + goto CONTINUE; + } + else + { + goto DONE; + } + case 0: // normal + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + enumeratorCurrent = enumerator.Current; + awaiter2 = keySelector(enumeratorCurrent).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + var key = awaiter2.GetResult(); + if (!comparer.Equals(prev, key)) + { + prev = key; + Current = enumeratorCurrent; + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + case -2: + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class DistinctUntilChangedAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly IEqualityComparer comparer; + + public DistinctUntilChangedAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _DistinctUntilChangedAwaitWithCancellation(source, keySelector, comparer, cancellationToken); + } + + sealed class _DistinctUntilChangedAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly IEqualityComparer comparer; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + TSource enumeratorCurrent; + TKey prev; + + public _DistinctUntilChangedAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.keySelector = keySelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case -3; + } + else + { + state = -3; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case -3: // first + if (awaiter.GetResult()) + { + Current = enumerator.Current; + goto CONTINUE; + } + else + { + goto DONE; + } + case 0: // normal + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + enumeratorCurrent = enumerator.Current; + awaiter2 = keySelector(enumeratorCurrent, cancellationToken).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + var key = awaiter2.GetResult(); + if (!comparer.Equals(prev, key)) + { + prev = key; + Current = enumeratorCurrent; + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + case -2: + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + return enumerator.DisposeAsync(); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs.meta new file mode 100644 index 00000000..84cddf8d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/DistinctUntilChanged.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0351f6767df7e644b935d4d599968162 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Do.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Do.cs new file mode 100644 index 00000000..f6df368d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Do.cs @@ -0,0 +1,258 @@ +using Cysharp.Threading.Tasks; +using Cysharp.Threading.Tasks.Internal; +using Cysharp.Threading.Tasks.Linq; +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Do(this IUniTaskAsyncEnumerable source, Action onNext) + { + Error.ThrowArgumentNullException(source, nameof(source)); + return source.Do(onNext, null, null); + } + + public static IUniTaskAsyncEnumerable Do(this IUniTaskAsyncEnumerable source, Action onNext, Action onError) + { + Error.ThrowArgumentNullException(source, nameof(source)); + return source.Do(onNext, onError, null); + } + + public static IUniTaskAsyncEnumerable Do(this IUniTaskAsyncEnumerable source, Action onNext, Action onCompleted) + { + Error.ThrowArgumentNullException(source, nameof(source)); + return source.Do(onNext, null, onCompleted); + } + + public static IUniTaskAsyncEnumerable Do(this IUniTaskAsyncEnumerable source, Action onNext, Action onError, Action onCompleted) + { + Error.ThrowArgumentNullException(source, nameof(source)); + return new Do(source, onNext, onError, onCompleted); + } + + public static IUniTaskAsyncEnumerable Do(this IUniTaskAsyncEnumerable source, IObserver observer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(observer, nameof(observer)); + + return source.Do(observer.OnNext, observer.OnError, observer.OnCompleted); // alloc delegate. + } + + // not yet impl. + + //public static IUniTaskAsyncEnumerable DoAwait(this IUniTaskAsyncEnumerable source, Func onNext) + //{ + // throw new NotImplementedException(); + //} + + //public static IUniTaskAsyncEnumerable DoAwait(this IUniTaskAsyncEnumerable source, Func onNext, Func onError) + //{ + // throw new NotImplementedException(); + //} + + //public static IUniTaskAsyncEnumerable DoAwait(this IUniTaskAsyncEnumerable source, Func onNext, Func onCompleted) + //{ + // throw new NotImplementedException(); + //} + + //public static IUniTaskAsyncEnumerable DoAwait(this IUniTaskAsyncEnumerable source, Func onNext, Func onError, Func onCompleted) + //{ + // throw new NotImplementedException(); + //} + + //public static IUniTaskAsyncEnumerable DoAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func onNext) + //{ + // throw new NotImplementedException(); + //} + + //public static IUniTaskAsyncEnumerable DoAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func onNext, Func onError) + //{ + // throw new NotImplementedException(); + //} + + //public static IUniTaskAsyncEnumerable DoAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func onNext, Func onCompleted) + //{ + // throw new NotImplementedException(); + //} + + //public static IUniTaskAsyncEnumerable DoAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func onNext, Func onError, Func onCompleted) + //{ + // throw new NotImplementedException(); + //} + } + + internal sealed class Do : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Action onNext; + readonly Action onError; + readonly Action onCompleted; + + public Do(IUniTaskAsyncEnumerable source, Action onNext, Action onError, Action onCompleted) + { + this.source = source; + this.onNext = onNext; + this.onError = onError; + this.onCompleted = onCompleted; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Do(source, onNext, onError, onCompleted, cancellationToken); + } + + sealed class _Do : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + readonly Action onNext; + readonly Action onError; + readonly Action onCompleted; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + + public _Do(IUniTaskAsyncEnumerable source, Action onNext, Action onError, Action onCompleted, CancellationToken cancellationToken) + { + this.source = source; + this.onNext = onNext; + this.onError = onError; + this.onCompleted = onCompleted; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + bool isCompleted = false; + try + { + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + } + + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + isCompleted = awaiter.IsCompleted; + } + catch (Exception ex) + { + CallTrySetExceptionAfterNotification(ex); + return new UniTask(this, completionSource.Version); + } + + if (isCompleted) + { + MoveNextCore(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + + return new UniTask(this, completionSource.Version); + } + + void CallTrySetExceptionAfterNotification(Exception ex) + { + if (onError != null) + { + try + { + onError(ex); + } + catch (Exception ex2) + { + completionSource.TrySetException(ex2); + return; + } + } + + completionSource.TrySetException(ex); + } + + bool TryGetResultWithNotification(UniTask.Awaiter awaiter, out T result) + { + try + { + result = awaiter.GetResult(); + return true; + } + catch (Exception ex) + { + CallTrySetExceptionAfterNotification(ex); + result = default; + return false; + } + } + + + static void MoveNextCore(object state) + { + var self = (_Do)state; + + if (self.TryGetResultWithNotification(self.awaiter, out var result)) + { + if (result) + { + var v = self.enumerator.Current; + + if (self.onNext != null) + { + try + { + self.onNext(v); + } + catch (Exception ex) + { + self.CallTrySetExceptionAfterNotification(ex); + } + } + + self.Current = v; + self.completionSource.TrySetResult(true); + } + else + { + if (self.onCompleted != null) + { + try + { + self.onCompleted(); + } + catch (Exception ex) + { + self.CallTrySetExceptionAfterNotification(ex); + return; + } + } + + self.completionSource.TrySetResult(false); + } + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } + +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Do.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Do.cs.meta new file mode 100644 index 00000000..766bbb5f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Do.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd83c8e12dedf75409b829b93146d130 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs new file mode 100644 index 00000000..930675e5 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs @@ -0,0 +1,58 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask ElementAtAsync(this IUniTaskAsyncEnumerable source, int index, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return ElementAt.ElementAtAsync(source, index, cancellationToken, false); + } + + public static UniTask ElementAtOrDefaultAsync(this IUniTaskAsyncEnumerable source, int index, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return ElementAt.ElementAtAsync(source, index, cancellationToken, true); + } + } + + internal static class ElementAt + { + public static async UniTask ElementAtAsync(IUniTaskAsyncEnumerable source, int index, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + int i = 0; + while (await e.MoveNextAsync()) + { + if (i++ == index) + { + return e.Current; + } + } + + if (defaultIfEmpty) + { + return default; + } + else + { + throw Error.ArgumentOutOfRange(nameof(index)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs.meta new file mode 100644 index 00000000..fb0850b6 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ElementAt.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c835bd2dd8555234c8919c7b8ef3b69a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs new file mode 100644 index 00000000..2f5b3a49 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs @@ -0,0 +1,47 @@ +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Empty() + { + return Cysharp.Threading.Tasks.Linq.Empty.Instance; + } + } + + internal class Empty : IUniTaskAsyncEnumerable + { + public static readonly IUniTaskAsyncEnumerable Instance = new Empty(); + + Empty() + { + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return _Empty.Instance; + } + + class _Empty : IUniTaskAsyncEnumerator + { + public static readonly IUniTaskAsyncEnumerator Instance = new _Empty(); + + _Empty() + { + } + + public T Current => default; + + public UniTask MoveNextAsync() + { + return CompletedTasks.False; + } + + public UniTask DisposeAsync() + { + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs.meta new file mode 100644 index 00000000..bfa577ac --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Empty.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4fa123ad6258abb4184721b719a13810 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Except.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Except.cs new file mode 100644 index 00000000..c4054823 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Except.cs @@ -0,0 +1,116 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Except(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + + return new Except(first, second, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable Except(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new Except(first, second, comparer); + } + } + + internal sealed class Except : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + readonly IEqualityComparer comparer; + + public Except(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer) + { + this.first = first; + this.second = second; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Except(first, second, comparer, cancellationToken); + } + + class _Except : AsyncEnumeratorBase + { + static Action HashSetAsyncCoreDelegate = HashSetAsyncCore; + + readonly IEqualityComparer comparer; + readonly IUniTaskAsyncEnumerable second; + + HashSet set; + UniTask>.Awaiter awaiter; + + public _Except(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) + + : base(first, cancellationToken) + { + this.second = second; + this.comparer = comparer; + } + + protected override bool OnFirstIteration() + { + if (set != null) return false; + + awaiter = second.ToHashSetAsync(cancellationToken).GetAwaiter(); + if (awaiter.IsCompleted) + { + set = awaiter.GetResult(); + SourceMoveNext(); + } + else + { + awaiter.SourceOnCompleted(HashSetAsyncCoreDelegate, this); + } + + return true; + } + + static void HashSetAsyncCore(object state) + { + var self = (_Except)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + self.set = result; + self.SourceMoveNext(); + } + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + var v = SourceCurrent; + if (set.Add(v)) + { + Current = v; + result = true; + return true; + } + else + { + result = default; + return false; + } + } + + result = false; + return true; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Except.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Except.cs.meta new file mode 100644 index 00000000..f61a1aab --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Except.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 38c1c4129f59dcb49a5b864eaf4ec63c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/First.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/First.cs new file mode 100644 index 00000000..da5688b4 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/First.cs @@ -0,0 +1,200 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask FirstAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return First.FirstAsync(source, cancellationToken, false); + } + + public static UniTask FirstAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return First.FirstAsync(source, predicate, cancellationToken, false); + } + + public static UniTask FirstAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return First.FirstAwaitAsync(source, predicate, cancellationToken, false); + } + + public static UniTask FirstAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return First.FirstAwaitWithCancellationAsync(source, predicate, cancellationToken, false); + } + + public static UniTask FirstOrDefaultAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return First.FirstAsync(source, cancellationToken, true); + } + + public static UniTask FirstOrDefaultAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return First.FirstAsync(source, predicate, cancellationToken, true); + } + + public static UniTask FirstOrDefaultAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return First.FirstAwaitAsync(source, predicate, cancellationToken, true); + } + + public static UniTask FirstOrDefaultAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return First.FirstAwaitWithCancellationAsync(source, predicate, cancellationToken, true); + } + } + + internal static class First + { + public static async UniTask FirstAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + if (await e.MoveNextAsync()) + { + return e.Current; + } + else + { + if (defaultIfEmpty) + { + return default; + } + else + { + throw Error.NoElements(); + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask FirstAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (predicate(v)) + { + return v; + } + } + + if (defaultIfEmpty) + { + return default; + } + else + { + throw Error.NoElements(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask FirstAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (await predicate(v)) + { + return v; + } + } + + if (defaultIfEmpty) + { + return default; + } + else + { + throw Error.NoElements(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask FirstAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (await predicate(v, cancellationToken)) + { + return v; + } + } + + if (defaultIfEmpty) + { + return default; + } + else + { + throw Error.NoElements(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/First.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/First.cs.meta new file mode 100644 index 00000000..6924307a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/First.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 417946e97e9eed84db6f840f57037ca6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs new file mode 100644 index 00000000..60f246dd --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs @@ -0,0 +1,193 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask ForEachAsync(this IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAsync(source, action, cancellationToken); + } + + public static UniTask ForEachAsync(this IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAsync(source, action, cancellationToken); + } + + /// Obsolete(Error), Use Use ForEachAwaitAsync instead. + [Obsolete("Use ForEachAwaitAsync instead.", true)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static UniTask ForEachAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) + { + throw new NotSupportedException("Use ForEachAwaitAsync instead."); + } + + /// Obsolete(Error), Use Use ForEachAwaitAsync instead. + [Obsolete("Use ForEachAwaitAsync instead.", true)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static UniTask ForEachAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) + { + throw new NotSupportedException("Use ForEachAwaitAsync instead."); + } + + public static UniTask ForEachAwaitAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAwaitAsync(source, action, cancellationToken); + } + + public static UniTask ForEachAwaitAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAwaitAsync(source, action, cancellationToken); + } + + public static UniTask ForEachAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAwaitWithCancellationAsync(source, action, cancellationToken); + } + + public static UniTask ForEachAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAwaitWithCancellationAsync(source, action, cancellationToken); + } + } + + internal static class ForEach + { + public static async UniTask ForEachAsync(IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + action(e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask ForEachAsync(IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + int index = 0; + while (await e.MoveNextAsync()) + { + action(e.Current, checked(index++)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask ForEachAwaitAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + await action(e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask ForEachAwaitAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + int index = 0; + while (await e.MoveNextAsync()) + { + await action(e.Current, checked(index++)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask ForEachAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + await action(e.Current, cancellationToken); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask ForEachAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + int index = 0; + while (await e.MoveNextAsync()) + { + await action(e.Current, checked(index++), cancellationToken); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs.meta new file mode 100644 index 00000000..53177562 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ca8d7f8177ba16140920af405aea3fd4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs new file mode 100644 index 00000000..b9460ae4 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs @@ -0,0 +1,923 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + // Ix-Async returns IGrouping but it is competely waste, use standard IGrouping. + + public static IUniTaskAsyncEnumerable> GroupBy(this IUniTaskAsyncEnumerable source, Func keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + return new GroupBy(source, keySelector, x => x, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable> GroupBy(this IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupBy(source, keySelector, x => x, comparer); + } + + public static IUniTaskAsyncEnumerable> GroupBy(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + return new GroupBy(source, keySelector, elementSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable> GroupBy(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupBy(source, keySelector, elementSelector, comparer); + } + + public static IUniTaskAsyncEnumerable GroupBy(this IUniTaskAsyncEnumerable source, Func keySelector, Func, TResult> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + return new GroupBy(source, keySelector, x => x, resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable GroupBy(this IUniTaskAsyncEnumerable source, Func keySelector, Func, TResult> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupBy(source, keySelector, x => x, resultSelector, comparer); + } + + public static IUniTaskAsyncEnumerable GroupBy(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + return new GroupBy(source, keySelector, elementSelector, resultSelector, EqualityComparer.Default); + } + public static IUniTaskAsyncEnumerable GroupBy(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupBy(source, keySelector, elementSelector, resultSelector, comparer); + } + + // await + + public static IUniTaskAsyncEnumerable> GroupByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + return new GroupByAwait(source, keySelector, x => UniTask.FromResult(x), EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable> GroupByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupByAwait(source, keySelector, x => UniTask.FromResult(x), comparer); + } + + public static IUniTaskAsyncEnumerable> GroupByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + return new GroupByAwait(source, keySelector, elementSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable> GroupByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupByAwait(source, keySelector, elementSelector, comparer); + } + + public static IUniTaskAsyncEnumerable GroupByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, Func, UniTask> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + return new GroupByAwait(source, keySelector, x => UniTask.FromResult(x), resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable GroupByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, UniTask> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + return new GroupByAwait(source, keySelector, elementSelector, resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable GroupByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, Func, UniTask> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupByAwait(source, keySelector, x => UniTask.FromResult(x), resultSelector, comparer); + } + + public static IUniTaskAsyncEnumerable GroupByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, UniTask> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupByAwait(source, keySelector, elementSelector, resultSelector, comparer); + } + + // with ct + + public static IUniTaskAsyncEnumerable> GroupByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + return new GroupByAwaitWithCancellation(source, keySelector, (x, _) => UniTask.FromResult(x), EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable> GroupByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupByAwaitWithCancellation(source, keySelector, (x, _) => UniTask.FromResult(x), comparer); + } + + public static IUniTaskAsyncEnumerable> GroupByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + return new GroupByAwaitWithCancellation(source, keySelector, elementSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable> GroupByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupByAwaitWithCancellation(source, keySelector, elementSelector, comparer); + } + + public static IUniTaskAsyncEnumerable GroupByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, Func, CancellationToken, UniTask> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + return new GroupByAwaitWithCancellation(source, keySelector, (x, _) => UniTask.FromResult(x), resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable GroupByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, CancellationToken, UniTask> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + return new GroupByAwaitWithCancellation(source, keySelector, elementSelector, resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable GroupByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupByAwaitWithCancellation(source, keySelector, (x, _) => UniTask.FromResult(x), resultSelector, comparer); + } + + public static IUniTaskAsyncEnumerable GroupByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + return new GroupByAwaitWithCancellation(source, keySelector, elementSelector, resultSelector, comparer); + } + } + + internal sealed class GroupBy : IUniTaskAsyncEnumerable> + { + readonly IUniTaskAsyncEnumerable source; + readonly Func keySelector; + readonly Func elementSelector; + readonly IEqualityComparer comparer; + + public GroupBy(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _GroupBy(source, keySelector, elementSelector, comparer, cancellationToken); + } + + sealed class _GroupBy : MoveNextSource, IUniTaskAsyncEnumerator> + { + readonly IUniTaskAsyncEnumerable source; + readonly Func keySelector; + readonly Func elementSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + IEnumerator> groupEnumerator; + + public _GroupBy(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public IGrouping Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (groupEnumerator == null) + { + CreateLookup().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateLookup() + { + try + { + var lookup = await source.ToLookupAsync(keySelector, elementSelector, comparer, cancellationToken); + groupEnumerator = lookup.GetEnumerator(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + if (groupEnumerator.MoveNext()) + { + Current = groupEnumerator.Current as IGrouping; + completionSource.TrySetResult(true); + } + else + { + completionSource.TrySetResult(false); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (groupEnumerator != null) + { + groupEnumerator.Dispose(); + } + + return default; + } + } + } + + internal sealed class GroupBy : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func keySelector; + readonly Func elementSelector; + readonly Func, TResult> resultSelector; + readonly IEqualityComparer comparer; + + public GroupBy(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _GroupBy(source, keySelector, elementSelector, resultSelector, comparer, cancellationToken); + } + + sealed class _GroupBy : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func keySelector; + readonly Func elementSelector; + readonly Func, TResult> resultSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + IEnumerator> groupEnumerator; + + public _GroupBy(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, Func, TResult> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (groupEnumerator == null) + { + CreateLookup().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateLookup() + { + try + { + var lookup = await source.ToLookupAsync(keySelector, elementSelector, comparer, cancellationToken); + groupEnumerator = lookup.GetEnumerator(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + if (groupEnumerator.MoveNext()) + { + var current = groupEnumerator.Current; + Current = resultSelector(current.Key, current); + completionSource.TrySetResult(true); + } + else + { + completionSource.TrySetResult(false); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (groupEnumerator != null) + { + groupEnumerator.Dispose(); + } + + return default; + } + } + } + + internal sealed class GroupByAwait : IUniTaskAsyncEnumerable> + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly Func> elementSelector; + readonly IEqualityComparer comparer; + + public GroupByAwait(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _GroupByAwait(source, keySelector, elementSelector, comparer, cancellationToken); + } + + sealed class _GroupByAwait : MoveNextSource, IUniTaskAsyncEnumerator> + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly Func> elementSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + IEnumerator> groupEnumerator; + + public _GroupByAwait(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public IGrouping Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (groupEnumerator == null) + { + CreateLookup().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateLookup() + { + try + { + var lookup = await source.ToLookupAwaitAsync(keySelector, elementSelector, comparer, cancellationToken); + groupEnumerator = lookup.GetEnumerator(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + if (groupEnumerator.MoveNext()) + { + Current = groupEnumerator.Current as IGrouping; + completionSource.TrySetResult(true); + } + else + { + completionSource.TrySetResult(false); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (groupEnumerator != null) + { + groupEnumerator.Dispose(); + } + + return default; + } + } + } + + internal sealed class GroupByAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly Func> elementSelector; + readonly Func, UniTask> resultSelector; + readonly IEqualityComparer comparer; + + public GroupByAwait(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, UniTask> resultSelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _GroupByAwait(source, keySelector, elementSelector, resultSelector, comparer, cancellationToken); + } + + sealed class _GroupByAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly static Action ResultSelectCoreDelegate = ResultSelectCore; + + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly Func> elementSelector; + readonly Func, UniTask> resultSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + IEnumerator> groupEnumerator; + UniTask.Awaiter awaiter; + + public _GroupByAwait(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (groupEnumerator == null) + { + CreateLookup().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateLookup() + { + try + { + var lookup = await source.ToLookupAwaitAsync(keySelector, elementSelector, comparer, cancellationToken); + groupEnumerator = lookup.GetEnumerator(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + if (groupEnumerator.MoveNext()) + { + var current = groupEnumerator.Current; + + awaiter = resultSelector(current.Key, current).GetAwaiter(); + if (awaiter.IsCompleted) + { + ResultSelectCore(this); + } + else + { + awaiter.SourceOnCompleted(ResultSelectCoreDelegate, this); + } + return; + } + else + { + completionSource.TrySetResult(false); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + } + + static void ResultSelectCore(object state) + { + var self = (_GroupByAwait)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + self.Current = result; + self.completionSource.TrySetResult(true); + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (groupEnumerator != null) + { + groupEnumerator.Dispose(); + } + + return default; + } + } + } + + internal sealed class GroupByAwaitWithCancellation : IUniTaskAsyncEnumerable> + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly Func> elementSelector; + readonly IEqualityComparer comparer; + + public GroupByAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator> GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _GroupByAwaitWithCancellation(source, keySelector, elementSelector, comparer, cancellationToken); + } + + sealed class _GroupByAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator> + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly Func> elementSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + IEnumerator> groupEnumerator; + + public _GroupByAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public IGrouping Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (groupEnumerator == null) + { + CreateLookup().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateLookup() + { + try + { + var lookup = await source.ToLookupAwaitWithCancellationAsync(keySelector, elementSelector, comparer, cancellationToken); + groupEnumerator = lookup.GetEnumerator(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + if (groupEnumerator.MoveNext()) + { + Current = groupEnumerator.Current as IGrouping; + completionSource.TrySetResult(true); + } + else + { + completionSource.TrySetResult(false); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (groupEnumerator != null) + { + groupEnumerator.Dispose(); + } + + return default; + } + } + } + + internal sealed class GroupByAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly Func> elementSelector; + readonly Func, CancellationToken, UniTask> resultSelector; + readonly IEqualityComparer comparer; + + public GroupByAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _GroupByAwaitWithCancellation(source, keySelector, elementSelector, resultSelector, comparer, cancellationToken); + } + + sealed class _GroupByAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly static Action ResultSelectCoreDelegate = ResultSelectCore; + + readonly IUniTaskAsyncEnumerable source; + readonly Func> keySelector; + readonly Func> elementSelector; + readonly Func, CancellationToken, UniTask> resultSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + IEnumerator> groupEnumerator; + UniTask.Awaiter awaiter; + + public _GroupByAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (groupEnumerator == null) + { + CreateLookup().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateLookup() + { + try + { + var lookup = await source.ToLookupAwaitWithCancellationAsync(keySelector, elementSelector, comparer, cancellationToken); + groupEnumerator = lookup.GetEnumerator(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + if (groupEnumerator.MoveNext()) + { + var current = groupEnumerator.Current; + + awaiter = resultSelector(current.Key, current, cancellationToken).GetAwaiter(); + if (awaiter.IsCompleted) + { + ResultSelectCore(this); + } + else + { + awaiter.SourceOnCompleted(ResultSelectCoreDelegate, this); + } + return; + } + else + { + completionSource.TrySetResult(false); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + } + + static void ResultSelectCore(object state) + { + var self = (_GroupByAwaitWithCancellation)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + self.Current = result; + self.completionSource.TrySetResult(true); + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (groupEnumerator != null) + { + groupEnumerator.Dispose(); + } + + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs.meta new file mode 100644 index 00000000..14897018 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2de80df1cc8a1240ab0ee7badd334d0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs new file mode 100644 index 00000000..607b2217 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs @@ -0,0 +1,612 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable GroupJoin(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new GroupJoin(outer, inner, outerKeySelector, innerKeySelector, resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable GroupJoin(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new GroupJoin(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); + } + + public static IUniTaskAsyncEnumerable GroupJoinAwait(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, UniTask> resultSelector) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new GroupJoinAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable GroupJoinAwait(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, UniTask> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new GroupJoinAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); + } + + public static IUniTaskAsyncEnumerable GroupJoinAwaitWithCancellation(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, UniTask> resultSelector) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new GroupJoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable GroupJoinAwaitWithCancellation(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new GroupJoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); + } + + } + + internal sealed class GroupJoin : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func outerKeySelector; + readonly Func innerKeySelector; + readonly Func, TResult> resultSelector; + readonly IEqualityComparer comparer; + + public GroupJoin(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer comparer) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _GroupJoin(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + } + + sealed class _GroupJoin : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func outerKeySelector; + readonly Func innerKeySelector; + readonly Func, TResult> resultSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + ILookup lookup; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + + + public _GroupJoin(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func, TResult> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (lookup == null) + { + CreateLookup().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateLookup() + { + try + { + lookup = await inner.ToLookupAsync(innerKeySelector, comparer, cancellationToken); + enumerator = outer.GetAsyncEnumerator(cancellationToken); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + MoveNextCore(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void MoveNextCore(object state) + { + var self = (_GroupJoin)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + var outer = self.enumerator.Current; + var key = self.outerKeySelector(outer); + var values = self.lookup[key]; + + self.Current = self.resultSelector(outer, values); + self.completionSource.TrySetResult(true); + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + + return default; + } + } + } + + internal sealed class GroupJoinAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func> outerKeySelector; + readonly Func> innerKeySelector; + readonly Func, UniTask> resultSelector; + readonly IEqualityComparer comparer; + + public GroupJoinAwait(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, UniTask> resultSelector, IEqualityComparer comparer) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _GroupJoinAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + } + + sealed class _GroupJoinAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + readonly static Action ResultSelectCoreDelegate = ResultSelectCore; + readonly static Action OuterKeySelectCoreDelegate = OuterKeySelectCore; + + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func> outerKeySelector; + readonly Func> innerKeySelector; + readonly Func, UniTask> resultSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + ILookup lookup; + IUniTaskAsyncEnumerator enumerator; + TOuter outerValue; + UniTask.Awaiter awaiter; + UniTask.Awaiter outerKeyAwaiter; + UniTask.Awaiter resultAwaiter; + + + public _GroupJoinAwait(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (lookup == null) + { + CreateLookup().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateLookup() + { + try + { + lookup = await inner.ToLookupAwaitAsync(innerKeySelector, comparer, cancellationToken); + enumerator = outer.GetAsyncEnumerator(cancellationToken); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + MoveNextCore(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void MoveNextCore(object state) + { + var self = (_GroupJoinAwait)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + try + { + + self.outerValue = self.enumerator.Current; + self.outerKeyAwaiter = self.outerKeySelector(self.outerValue).GetAwaiter(); + if (self.outerKeyAwaiter.IsCompleted) + { + OuterKeySelectCore(self); + } + else + { + self.outerKeyAwaiter.SourceOnCompleted(OuterKeySelectCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void OuterKeySelectCore(object state) + { + var self = (_GroupJoinAwait)state; + + if (self.TryGetResult(self.outerKeyAwaiter, out var result)) + { + try + { + var values = self.lookup[result]; + self.resultAwaiter = self.resultSelector(self.outerValue, values).GetAwaiter(); + if (self.resultAwaiter.IsCompleted) + { + ResultSelectCore(self); + } + else + { + self.resultAwaiter.SourceOnCompleted(ResultSelectCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + } + } + } + + static void ResultSelectCore(object state) + { + var self = (_GroupJoinAwait)state; + + if (self.TryGetResult(self.resultAwaiter, out var result)) + { + self.Current = result; + self.completionSource.TrySetResult(true); + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + + return default; + } + } + } + + internal sealed class GroupJoinAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func> outerKeySelector; + readonly Func> innerKeySelector; + readonly Func, CancellationToken, UniTask> resultSelector; + readonly IEqualityComparer comparer; + + public GroupJoinAwaitWithCancellation(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _GroupJoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + } + + sealed class _GroupJoinAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + readonly static Action ResultSelectCoreDelegate = ResultSelectCore; + readonly static Action OuterKeySelectCoreDelegate = OuterKeySelectCore; + + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func> outerKeySelector; + readonly Func> innerKeySelector; + readonly Func, CancellationToken, UniTask> resultSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + ILookup lookup; + IUniTaskAsyncEnumerator enumerator; + TOuter outerValue; + UniTask.Awaiter awaiter; + UniTask.Awaiter outerKeyAwaiter; + UniTask.Awaiter resultAwaiter; + + + public _GroupJoinAwaitWithCancellation(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func, CancellationToken, UniTask> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (lookup == null) + { + CreateLookup().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateLookup() + { + try + { + lookup = await inner.ToLookupAwaitWithCancellationAsync(innerKeySelector, comparer, cancellationToken); + enumerator = outer.GetAsyncEnumerator(cancellationToken); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + MoveNextCore(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void MoveNextCore(object state) + { + var self = (_GroupJoinAwaitWithCancellation)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + try + { + + self.outerValue = self.enumerator.Current; + self.outerKeyAwaiter = self.outerKeySelector(self.outerValue, self.cancellationToken).GetAwaiter(); + if (self.outerKeyAwaiter.IsCompleted) + { + OuterKeySelectCore(self); + } + else + { + self.outerKeyAwaiter.SourceOnCompleted(OuterKeySelectCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void OuterKeySelectCore(object state) + { + var self = (_GroupJoinAwaitWithCancellation)state; + + if (self.TryGetResult(self.outerKeyAwaiter, out var result)) + { + try + { + var values = self.lookup[result]; + self.resultAwaiter = self.resultSelector(self.outerValue, values, self.cancellationToken).GetAwaiter(); + if (self.resultAwaiter.IsCompleted) + { + ResultSelectCore(self); + } + else + { + self.resultAwaiter.SourceOnCompleted(ResultSelectCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + } + } + } + + static void ResultSelectCore(object state) + { + var self = (_GroupJoinAwaitWithCancellation)state; + + if (self.TryGetResult(self.resultAwaiter, out var result)) + { + self.Current = result; + self.completionSource.TrySetResult(true); + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs.meta new file mode 100644 index 00000000..f171ed19 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7bf7759d03bf3f64190d3ae83b182c2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs new file mode 100644 index 00000000..3faf645f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs @@ -0,0 +1,117 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Intersect(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + + return new Intersect(first, second, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable Intersect(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new Intersect(first, second, comparer); + } + } + + internal sealed class Intersect : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + readonly IEqualityComparer comparer; + + public Intersect(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer) + { + this.first = first; + this.second = second; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Intersect(first, second, comparer, cancellationToken); + } + + class _Intersect : AsyncEnumeratorBase + { + static Action HashSetAsyncCoreDelegate = HashSetAsyncCore; + + readonly IEqualityComparer comparer; + readonly IUniTaskAsyncEnumerable second; + + HashSet set; + UniTask>.Awaiter awaiter; + + public _Intersect(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) + + : base(first, cancellationToken) + { + this.second = second; + this.comparer = comparer; + } + + protected override bool OnFirstIteration() + { + if (set != null) return false; + + awaiter = second.ToHashSetAsync(cancellationToken).GetAwaiter(); + if (awaiter.IsCompleted) + { + set = awaiter.GetResult(); + SourceMoveNext(); + } + else + { + awaiter.SourceOnCompleted(HashSetAsyncCoreDelegate, this); + } + + return true; + } + + static void HashSetAsyncCore(object state) + { + var self = (_Intersect)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + self.set = result; + self.SourceMoveNext(); + } + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + var v = SourceCurrent; + + if (set.Remove(v)) + { + Current = v; + result = true; + return true; + } + else + { + result = default; + return false; + } + } + + result = false; + return true; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs.meta new file mode 100644 index 00000000..28cf8e30 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Intersect.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93999a70f5d57134bbe971f3e988c4f2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Join.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Join.cs new file mode 100644 index 00000000..2d80889e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Join.cs @@ -0,0 +1,728 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Join(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func resultSelector) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new Join(outer, inner, outerKeySelector, innerKeySelector, resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable Join(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new Join(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); + } + + public static IUniTaskAsyncEnumerable JoinAwait(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new JoinAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable JoinAwait(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new JoinAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); + } + + public static IUniTaskAsyncEnumerable JoinAwaitWithCancellation(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new JoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable JoinAwaitWithCancellation(this IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(outer, nameof(outer)); + Error.ThrowArgumentNullException(inner, nameof(inner)); + Error.ThrowArgumentNullException(outerKeySelector, nameof(outerKeySelector)); + Error.ThrowArgumentNullException(innerKeySelector, nameof(innerKeySelector)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new JoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer); + } + } + + internal sealed class Join : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func outerKeySelector; + readonly Func innerKeySelector; + readonly Func resultSelector; + readonly IEqualityComparer comparer; + + public Join(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func resultSelector, IEqualityComparer comparer) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Join(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + } + + sealed class _Join : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func outerKeySelector; + readonly Func innerKeySelector; + readonly Func resultSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + ILookup lookup; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + TOuter currentOuterValue; + IEnumerator valueEnumerator; + + bool continueNext; + + public _Join(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func outerKeySelector, Func innerKeySelector, Func resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (lookup == null) + { + CreateInnerHashSet().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateInnerHashSet() + { + try + { + lookup = await inner.ToLookupAsync(innerKeySelector, comparer, cancellationToken); + enumerator = outer.GetAsyncEnumerator(cancellationToken); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + LOOP: + if (valueEnumerator != null) + { + if (valueEnumerator.MoveNext()) + { + Current = resultSelector(currentOuterValue, valueEnumerator.Current); + goto TRY_SET_RESULT_TRUE; + } + else + { + valueEnumerator.Dispose(); + valueEnumerator = null; + } + } + + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + continueNext = true; + MoveNextCore(this); + if (continueNext) + { + continueNext = false; + goto LOOP; // avoid recursive + } + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + + return; + + TRY_SET_RESULT_TRUE: + completionSource.TrySetResult(true); + } + + + static void MoveNextCore(object state) + { + var self = (_Join)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.currentOuterValue = self.enumerator.Current; + var key = self.outerKeySelector(self.currentOuterValue); + self.valueEnumerator = self.lookup[key].GetEnumerator(); + + if (self.continueNext) + { + return; + } + else + { + self.SourceMoveNext(); + } + } + else + { + self.continueNext = false; + self.completionSource.TrySetResult(false); + } + } + else + { + self.continueNext = false; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (valueEnumerator != null) + { + valueEnumerator.Dispose(); + } + + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + + return default; + } + } + } + + internal sealed class JoinAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func> outerKeySelector; + readonly Func> innerKeySelector; + readonly Func> resultSelector; + readonly IEqualityComparer comparer; + + public JoinAwait(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _JoinAwait(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + } + + sealed class _JoinAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + static readonly Action OuterSelectCoreDelegate = OuterSelectCore; + static readonly Action ResultSelectCoreDelegate = ResultSelectCore; + + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func> outerKeySelector; + readonly Func> innerKeySelector; + readonly Func> resultSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + ILookup lookup; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + TOuter currentOuterValue; + IEnumerator valueEnumerator; + + UniTask.Awaiter resultAwaiter; + UniTask.Awaiter outerKeyAwaiter; + + bool continueNext; + + public _JoinAwait(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (lookup == null) + { + CreateInnerHashSet().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateInnerHashSet() + { + try + { + lookup = await inner.ToLookupAwaitAsync(innerKeySelector, comparer, cancellationToken); + enumerator = outer.GetAsyncEnumerator(cancellationToken); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + LOOP: + if (valueEnumerator != null) + { + if (valueEnumerator.MoveNext()) + { + resultAwaiter = resultSelector(currentOuterValue, valueEnumerator.Current).GetAwaiter(); + if (resultAwaiter.IsCompleted) + { + ResultSelectCore(this); + } + else + { + resultAwaiter.SourceOnCompleted(ResultSelectCoreDelegate, this); + } + return; + } + else + { + valueEnumerator.Dispose(); + valueEnumerator = null; + } + } + + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + continueNext = true; + MoveNextCore(this); + if (continueNext) + { + continueNext = false; + goto LOOP; // avoid recursive + } + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + + static void MoveNextCore(object state) + { + var self = (_JoinAwait)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.currentOuterValue = self.enumerator.Current; + + self.outerKeyAwaiter = self.outerKeySelector(self.currentOuterValue).GetAwaiter(); + + if (self.outerKeyAwaiter.IsCompleted) + { + OuterSelectCore(self); + } + else + { + self.continueNext = false; + self.outerKeyAwaiter.SourceOnCompleted(OuterSelectCoreDelegate, self); + } + } + else + { + self.continueNext = false; + self.completionSource.TrySetResult(false); + } + } + else + { + self.continueNext = false; + } + } + + static void OuterSelectCore(object state) + { + var self = (_JoinAwait)state; + + if (self.TryGetResult(self.outerKeyAwaiter, out var key)) + { + self.valueEnumerator = self.lookup[key].GetEnumerator(); + + if (self.continueNext) + { + return; + } + else + { + self.SourceMoveNext(); + } + } + else + { + self.continueNext = false; + } + } + + static void ResultSelectCore(object state) + { + var self = (_JoinAwait)state; + + if (self.TryGetResult(self.resultAwaiter, out var result)) + { + self.Current = result; + self.completionSource.TrySetResult(true); + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (valueEnumerator != null) + { + valueEnumerator.Dispose(); + } + + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + + return default; + } + } + } + + internal sealed class JoinAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func> outerKeySelector; + readonly Func> innerKeySelector; + readonly Func> resultSelector; + readonly IEqualityComparer comparer; + + public JoinAwaitWithCancellation(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _JoinAwaitWithCancellation(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, cancellationToken); + } + + sealed class _JoinAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + static readonly Action OuterSelectCoreDelegate = OuterSelectCore; + static readonly Action ResultSelectCoreDelegate = ResultSelectCore; + + readonly IUniTaskAsyncEnumerable outer; + readonly IUniTaskAsyncEnumerable inner; + readonly Func> outerKeySelector; + readonly Func> innerKeySelector; + readonly Func> resultSelector; + readonly IEqualityComparer comparer; + CancellationToken cancellationToken; + + ILookup lookup; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + TOuter currentOuterValue; + IEnumerator valueEnumerator; + + UniTask.Awaiter resultAwaiter; + UniTask.Awaiter outerKeyAwaiter; + + bool continueNext; + + public _JoinAwaitWithCancellation(IUniTaskAsyncEnumerable outer, IUniTaskAsyncEnumerable inner, Func> outerKeySelector, Func> innerKeySelector, Func> resultSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + this.outer = outer; + this.inner = inner; + this.outerKeySelector = outerKeySelector; + this.innerKeySelector = innerKeySelector; + this.resultSelector = resultSelector; + this.comparer = comparer; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (lookup == null) + { + CreateInnerHashSet().Forget(); + } + else + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + async UniTaskVoid CreateInnerHashSet() + { + try + { + lookup = await inner.ToLookupAwaitWithCancellationAsync(innerKeySelector, comparer, cancellationToken: cancellationToken); + enumerator = outer.GetAsyncEnumerator(cancellationToken); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + SourceMoveNext(); + } + + void SourceMoveNext() + { + try + { + LOOP: + if (valueEnumerator != null) + { + if (valueEnumerator.MoveNext()) + { + resultAwaiter = resultSelector(currentOuterValue, valueEnumerator.Current, cancellationToken).GetAwaiter(); + if (resultAwaiter.IsCompleted) + { + ResultSelectCore(this); + } + else + { + resultAwaiter.SourceOnCompleted(ResultSelectCoreDelegate, this); + } + return; + } + else + { + valueEnumerator.Dispose(); + valueEnumerator = null; + } + } + + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + continueNext = true; + MoveNextCore(this); + if (continueNext) + { + continueNext = false; + goto LOOP; // avoid recursive + } + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + + static void MoveNextCore(object state) + { + var self = (_JoinAwaitWithCancellation)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.currentOuterValue = self.enumerator.Current; + + self.outerKeyAwaiter = self.outerKeySelector(self.currentOuterValue, self.cancellationToken).GetAwaiter(); + + if (self.outerKeyAwaiter.IsCompleted) + { + OuterSelectCore(self); + } + else + { + self.continueNext = false; + self.outerKeyAwaiter.SourceOnCompleted(OuterSelectCoreDelegate, self); + } + } + else + { + self.continueNext = false; + self.completionSource.TrySetResult(false); + } + } + else + { + self.continueNext = false; + } + } + + static void OuterSelectCore(object state) + { + var self = (_JoinAwaitWithCancellation)state; + + if (self.TryGetResult(self.outerKeyAwaiter, out var key)) + { + self.valueEnumerator = self.lookup[key].GetEnumerator(); + + if (self.continueNext) + { + return; + } + else + { + self.SourceMoveNext(); + } + } + else + { + self.continueNext = false; + } + } + + static void ResultSelectCore(object state) + { + var self = (_JoinAwaitWithCancellation)state; + + if (self.TryGetResult(self.resultAwaiter, out var result)) + { + self.Current = result; + self.completionSource.TrySetResult(true); + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (valueEnumerator != null) + { + valueEnumerator.Dispose(); + } + + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + + return default; + } + } + } + +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Join.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Join.cs.meta new file mode 100644 index 00000000..3ab1015a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Join.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc4ff8cb6d7c9a64896f2f082124d6b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Last.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Last.cs new file mode 100644 index 00000000..664bb27d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Last.cs @@ -0,0 +1,240 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask LastAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Last.LastAsync(source, cancellationToken, false); + } + + public static UniTask LastAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Last.LastAsync(source, predicate, cancellationToken, false); + } + + public static UniTask LastAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Last.LastAwaitAsync(source, predicate, cancellationToken, false); + } + + public static UniTask LastAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Last.LastAwaitWithCancellationAsync(source, predicate, cancellationToken, false); + } + + public static UniTask LastOrDefaultAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Last.LastAsync(source, cancellationToken, true); + } + + public static UniTask LastOrDefaultAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Last.LastAsync(source, predicate, cancellationToken, true); + } + + public static UniTask LastOrDefaultAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Last.LastAwaitAsync(source, predicate, cancellationToken, true); + } + + public static UniTask LastOrDefaultAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return Last.LastAwaitWithCancellationAsync(source, predicate, cancellationToken, true); + } + } + + internal static class Last + { + public static async UniTask LastAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value = default; + if (await e.MoveNextAsync()) + { + value = e.Current; + } + else + { + if (defaultIfEmpty) + { + return value; + } + else + { + throw Error.NoElements(); + } + } + + while (await e.MoveNextAsync()) + { + value = e.Current; + } + return value; + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask LastAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value = default; + + bool found = false; + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (predicate(v)) + { + found = true; + value = v; + } + } + + if (defaultIfEmpty) + { + return value; + } + else + { + if (found) + { + return value; + } + else + { + throw Error.NoElements(); + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask LastAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value = default; + + bool found = false; + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (await predicate(v)) + { + found = true; + value = v; + } + } + + if (defaultIfEmpty) + { + return value; + } + else + { + if (found) + { + return value; + } + else + { + throw Error.NoElements(); + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask LastAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value = default; + + bool found = false; + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (await predicate(v, cancellationToken)) + { + found = true; + value = v; + } + } + + if (defaultIfEmpty) + { + return value; + } + else + { + if (found) + { + return value; + } + else + { + throw Error.NoElements(); + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Last.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Last.cs.meta new file mode 100644 index 00000000..edfa124a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Last.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a0ccc93be1387fa4a975f06310127c11 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs new file mode 100644 index 00000000..78ae805f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs @@ -0,0 +1,144 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask LongCountAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return LongCount.LongCountAsync(source, cancellationToken); + } + + public static UniTask LongCountAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return LongCount.LongCountAsync(source, predicate, cancellationToken); + } + + public static UniTask LongCountAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return LongCount.LongCountAwaitAsync(source, predicate, cancellationToken); + } + + public static UniTask LongCountAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return LongCount.LongCountAwaitWithCancellationAsync(source, predicate, cancellationToken); + } + } + + internal static class LongCount + { + internal static async UniTask LongCountAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + long count = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + checked { count++; } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return count; + } + + internal static async UniTask LongCountAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + { + long count = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (predicate(e.Current)) + { + checked { count++; } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return count; + } + + internal static async UniTask LongCountAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + long count = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (await predicate(e.Current)) + { + checked { count++; } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return count; + } + + internal static async UniTask LongCountAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + long count = 0; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + if (await predicate(e.Current, cancellationToken)) + { + checked { count++; } + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return count; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs.meta new file mode 100644 index 00000000..862c2bcf --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/LongCount.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 198b39e58ced3ab4f97ccbe0916787d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Max.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Max.cs new file mode 100644 index 00000000..d244a15d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Max.cs @@ -0,0 +1,200 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + } + + internal static partial class Max + { + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + TSource value = default; + var comparer = Comparer.Default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + return value; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (comparer.Compare(value, x) < 0) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + TResult value = default; + var comparer = Comparer.Default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + return value; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (comparer.Compare(value, x) < 0) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + TResult value = default; + var comparer = Comparer.Default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + return value; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (comparer.Compare(value, x) < 0) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + TResult value = default; + var comparer = Comparer.Default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + return value; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (comparer.Compare(value, x) < 0) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Max.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Max.cs.meta new file mode 100644 index 00000000..2125edf6 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Max.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5c8a118a6b664c441820b8a87d7f6e28 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Merge.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Merge.cs new file mode 100644 index 00000000..d4ea969a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Merge.cs @@ -0,0 +1,232 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Merge(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + + return new Merge(new [] { first, second }); + } + + public static IUniTaskAsyncEnumerable Merge(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IUniTaskAsyncEnumerable third) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + Error.ThrowArgumentNullException(third, nameof(third)); + + return new Merge(new[] { first, second, third }); + } + + public static IUniTaskAsyncEnumerable Merge(this IEnumerable> sources) + { + return new Merge(sources.ToArray()); + } + + public static IUniTaskAsyncEnumerable Merge(params IUniTaskAsyncEnumerable[] sources) + { + return new Merge(sources); + } + } + + internal sealed class Merge : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable[] sources; + + public Merge(IUniTaskAsyncEnumerable[] sources) + { + if (sources.Length <= 0) + { + Error.ThrowArgumentException("No source async enumerable to merge"); + } + this.sources = sources; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + => new _Merge(sources, cancellationToken); + + enum MergeSourceState + { + Pending, + Running, + Completed, + } + + sealed class _Merge : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action GetResultAtAction = GetResultAt; + + readonly int length; + readonly IUniTaskAsyncEnumerator[] enumerators; + readonly MergeSourceState[] states; + readonly Queue<(T, Exception, bool)> queuedResult = new Queue<(T, Exception, bool)>(); + readonly CancellationToken cancellationToken; + + int moveNextCompleted; + + public T Current { get; private set; } + + public _Merge(IUniTaskAsyncEnumerable[] sources, CancellationToken cancellationToken) + { + this.cancellationToken = cancellationToken; + length = sources.Length; + states = ArrayPool.Shared.Rent(length); + enumerators = ArrayPool>.Shared.Rent(length); + for (var i = 0; i < length; i++) + { + enumerators[i] = sources[i].GetAsyncEnumerator(cancellationToken); + states[i] = (int)MergeSourceState.Pending;; + } + } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + Interlocked.Exchange(ref moveNextCompleted, 0); + + if (HasQueuedResult() && Interlocked.CompareExchange(ref moveNextCompleted, 1, 0) == 0) + { + (T, Exception, bool) value; + lock (states) + { + value = queuedResult.Dequeue(); + } + var resultValue = value.Item1; + var exception = value.Item2; + var hasNext = value.Item3; + if (exception != null) + { + completionSource.TrySetException(exception); + } + else + { + Current = resultValue; + completionSource.TrySetResult(hasNext); + } + return new UniTask(this, completionSource.Version); + } + + for (var i = 0; i < length; i++) + { + lock (states) + { + if (states[i] == MergeSourceState.Pending) + { + states[i] = MergeSourceState.Running; + } + else + { + continue; + } + } + var awaiter = enumerators[i].MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + GetResultAt(i, awaiter); + } + else + { + awaiter.SourceOnCompleted(GetResultAtAction, StateTuple.Create(this, i, awaiter)); + } + } + return new UniTask(this, completionSource.Version); + } + + public async UniTask DisposeAsync() + { + for (var i = 0; i < length; i++) + { + await enumerators[i].DisposeAsync(); + } + + ArrayPool.Shared.Return(states, true); + ArrayPool>.Shared.Return(enumerators, true); + } + + static void GetResultAt(object state) + { + using (var tuple = (StateTuple<_Merge, int, UniTask.Awaiter>)state) + { + tuple.Item1.GetResultAt(tuple.Item2, tuple.Item3); + } + } + + void GetResultAt(int index, UniTask.Awaiter awaiter) + { + bool hasNext; + bool completedAll; + try + { + hasNext = awaiter.GetResult(); + } + catch (Exception ex) + { + if (Interlocked.CompareExchange(ref moveNextCompleted, 1, 0) == 0) + { + completionSource.TrySetException(ex); + } + else + { + lock (states) + { + queuedResult.Enqueue((default, ex, default)); + } + } + return; + } + + lock (states) + { + states[index] = hasNext ? MergeSourceState.Pending : MergeSourceState.Completed; + completedAll = !hasNext && IsCompletedAll(); + } + if (hasNext || completedAll) + { + if (Interlocked.CompareExchange(ref moveNextCompleted, 1, 0) == 0) + { + Current = enumerators[index].Current; + completionSource.TrySetResult(!completedAll); + } + else + { + lock (states) + { + queuedResult.Enqueue((enumerators[index].Current, null, !completedAll)); + } + } + } + } + + bool HasQueuedResult() + { + lock (states) + { + return queuedResult.Count > 0; + } + } + + bool IsCompletedAll() + { + lock (states) + { + for (var i = 0; i < length; i++) + { + if (states[i] != MergeSourceState.Completed) + { + return false; + } + } + } + return true; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Merge.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Merge.cs.meta new file mode 100644 index 00000000..2f671f4c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Merge.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ca56812f160c45d0bacb4339819edf1a +timeCreated: 1694133666 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Min.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Min.cs new file mode 100644 index 00000000..8768a86e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Min.cs @@ -0,0 +1,200 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + } + + internal static partial class Min + { + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + TSource value = default; + var comparer = Comparer.Default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + return value; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (comparer.Compare(value, x) > 0) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + TResult value = default; + var comparer = Comparer.Default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + return value; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (comparer.Compare(value, x) > 0) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + TResult value = default; + var comparer = Comparer.Default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + return value; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (comparer.Compare(value, x) > 0) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + TResult value = default; + var comparer = Comparer.Default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + return value; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (comparer.Compare(value, x) > 0) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Min.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Min.cs.meta new file mode 100644 index 00000000..91378dc9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Min.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 57ac9da21d3457849a8e45548290a508 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs new file mode 100644 index 00000000..aae3541b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs @@ -0,0 +1,3763 @@ +using System; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Min.MinAsync(source, cancellationToken); + } + + public static UniTask MinAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MinAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Min.MinAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + } + + internal static partial class Min + { + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int32 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int32 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int64 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int64 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Single value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Single value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Double value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Double value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Decimal value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Decimal value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int32? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int32? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int64? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int64? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Single? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Single? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Double? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Double? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Decimal? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Decimal? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MinAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value > x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + } + + public static partial class UniTaskAsyncEnumerable + { + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Max.MaxAsync(source, cancellationToken); + } + + public static UniTask MaxAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask MaxAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Max.MaxAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + } + + internal static partial class Max + { + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int32 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int32 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int64 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int64 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64 value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Single value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Single value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Double value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Double value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Decimal value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Decimal value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + + goto NEXT_LOOP; + } + + throw Error.NoElements(); + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int32? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int32? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int64? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int64? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Single? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Single? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Double? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Double? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Decimal? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = e.Current; + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = e.Current; + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Decimal? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + public static async UniTask MaxAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal? value = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + value = await selector(e.Current, cancellationToken); + if(value == null) continue; + + goto NEXT_LOOP; + } + + return default; + + NEXT_LOOP: + + while (await e.MoveNextAsync()) + { + var x = await selector(e.Current, cancellationToken); + if( x == null) continue; + if (value < x) + { + value = x; + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return value; + } + + } + +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs.meta new file mode 100644 index 00000000..3856b65f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/MinMax.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2d6da02d9ab970e4999daf7147d98e36 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Never.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Never.cs new file mode 100644 index 00000000..2dbce711 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Never.cs @@ -0,0 +1,56 @@ +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Never() + { + return Cysharp.Threading.Tasks.Linq.Never.Instance; + } + } + + internal class Never : IUniTaskAsyncEnumerable + { + public static readonly IUniTaskAsyncEnumerable Instance = new Never(); + + Never() + { + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Never(cancellationToken); + } + + class _Never : IUniTaskAsyncEnumerator + { + CancellationToken cancellationToken; + + public _Never(CancellationToken cancellationToken) + { + this.cancellationToken = cancellationToken; + } + + public T Current => default; + + public UniTask MoveNextAsync() + { + var tcs = new UniTaskCompletionSource(); + + cancellationToken.Register(state => + { + var task = (UniTaskCompletionSource)state; + task.TrySetCanceled(cancellationToken); + }, tcs); + + return tcs.Task; + } + + public UniTask DisposeAsync() + { + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Never.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Never.cs.meta new file mode 100644 index 00000000..ba9d358c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Never.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8b307c3d3be71a94da251564bcdefa3d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs new file mode 100644 index 00000000..fea8069f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs @@ -0,0 +1,61 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable OfType(this IUniTaskAsyncEnumerable source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new OfType(source); + } + } + + internal sealed class OfType : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + + public OfType(IUniTaskAsyncEnumerable source) + { + this.source = source; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _OfType(source, cancellationToken); + } + + class _OfType : AsyncEnumeratorBase + { + public _OfType(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + if (SourceCurrent is TResult castCurent) + { + Current = castCurent; + result = true; + return true; + } + else + { + result = default; + return false; + } + } + + result = false; + return true; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs.meta new file mode 100644 index 00000000..6ace53fd --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OfType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 111ffe87a7d700442a9ef5af554b252c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs new file mode 100644 index 00000000..d0c379fe --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs @@ -0,0 +1,558 @@ +using Cysharp.Threading.Tasks; +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + #region OrderBy_OrderByDescending + + public static IUniTaskOrderedAsyncEnumerable OrderBy(this IUniTaskAsyncEnumerable source, Func keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return new OrderedAsyncEnumerable(source, keySelector, Comparer.Default, false, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderBy(this IUniTaskAsyncEnumerable source, Func keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new OrderedAsyncEnumerable(source, keySelector, comparer, false, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return new OrderedAsyncEnumerableAwait(source, keySelector, Comparer.Default, false, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new OrderedAsyncEnumerableAwait(source, keySelector, comparer, false, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return new OrderedAsyncEnumerableAwaitWithCancellation(source, keySelector, Comparer.Default, false, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new OrderedAsyncEnumerableAwaitWithCancellation(source, keySelector, comparer, false, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByDescending(this IUniTaskAsyncEnumerable source, Func keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return new OrderedAsyncEnumerable(source, keySelector, Comparer.Default, true, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByDescending(this IUniTaskAsyncEnumerable source, Func keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new OrderedAsyncEnumerable(source, keySelector, comparer, true, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByDescendingAwait(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return new OrderedAsyncEnumerableAwait(source, keySelector, Comparer.Default, true, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByDescendingAwait(this IUniTaskAsyncEnumerable source, Func> keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new OrderedAsyncEnumerableAwait(source, keySelector, comparer, true, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByDescendingAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return new OrderedAsyncEnumerableAwaitWithCancellation(source, keySelector, Comparer.Default, true, null); + } + + public static IUniTaskOrderedAsyncEnumerable OrderByDescendingAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return new OrderedAsyncEnumerableAwaitWithCancellation(source, keySelector, comparer, true, null); + } + + #endregion + + #region ThenBy_ThenByDescending + + public static IUniTaskOrderedAsyncEnumerable ThenBy(this IUniTaskOrderedAsyncEnumerable source, Func keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return source.CreateOrderedEnumerable(keySelector, Comparer.Default, false); + } + + public static IUniTaskOrderedAsyncEnumerable ThenBy(this IUniTaskOrderedAsyncEnumerable source, Func keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return source.CreateOrderedEnumerable(keySelector, comparer, false); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByAwait(this IUniTaskOrderedAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return source.CreateOrderedEnumerable(keySelector, Comparer.Default, false); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByAwait(this IUniTaskOrderedAsyncEnumerable source, Func> keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return source.CreateOrderedEnumerable(keySelector, comparer, false); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByAwaitWithCancellation(this IUniTaskOrderedAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return source.CreateOrderedEnumerable(keySelector, Comparer.Default, false); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByAwaitWithCancellation(this IUniTaskOrderedAsyncEnumerable source, Func> keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return source.CreateOrderedEnumerable(keySelector, comparer, false); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByDescending(this IUniTaskOrderedAsyncEnumerable source, Func keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return source.CreateOrderedEnumerable(keySelector, Comparer.Default, true); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByDescending(this IUniTaskOrderedAsyncEnumerable source, Func keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return source.CreateOrderedEnumerable(keySelector, comparer, true); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByDescendingAwait(this IUniTaskOrderedAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return source.CreateOrderedEnumerable(keySelector, Comparer.Default, true); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByDescendingAwait(this IUniTaskOrderedAsyncEnumerable source, Func> keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return source.CreateOrderedEnumerable(keySelector, comparer, true); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByDescendingAwaitWithCancellation(this IUniTaskOrderedAsyncEnumerable source, Func> keySelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return source.CreateOrderedEnumerable(keySelector, Comparer.Default, true); + } + + public static IUniTaskOrderedAsyncEnumerable ThenByDescendingAwaitWithCancellation(this IUniTaskOrderedAsyncEnumerable source, Func> keySelector, IComparer comparer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return source.CreateOrderedEnumerable(keySelector, comparer, true); + } + + #endregion + } + + internal abstract class AsyncEnumerableSorter + { + internal abstract UniTask ComputeKeysAsync(TElement[] elements, int count); + + internal abstract int CompareKeys(int index1, int index2); + + internal async UniTask SortAsync(TElement[] elements, int count) + { + await ComputeKeysAsync(elements, count); + + int[] map = new int[count]; + for (int i = 0; i < count; i++) map[i] = i; + QuickSort(map, 0, count - 1); + return map; + } + + void QuickSort(int[] map, int left, int right) + { + do + { + int i = left; + int j = right; + int x = map[i + ((j - i) >> 1)]; + do + { + while (i < map.Length && CompareKeys(x, map[i]) > 0) i++; + while (j >= 0 && CompareKeys(x, map[j]) < 0) j--; + if (i > j) break; + if (i < j) + { + int temp = map[i]; + map[i] = map[j]; + map[j] = temp; + } + i++; + j--; + } while (i <= j); + if (j - left <= right - i) + { + if (left < j) QuickSort(map, left, j); + left = i; + } + else + { + if (i < right) QuickSort(map, i, right); + right = j; + } + } while (left < right); + } + } + + internal class SyncSelectorAsyncEnumerableSorter : AsyncEnumerableSorter + { + readonly Func keySelector; + readonly IComparer comparer; + readonly bool descending; + readonly AsyncEnumerableSorter next; + TKey[] keys; + + internal SyncSelectorAsyncEnumerableSorter(Func keySelector, IComparer comparer, bool descending, AsyncEnumerableSorter next) + { + this.keySelector = keySelector; + this.comparer = comparer; + this.descending = descending; + this.next = next; + } + + internal override async UniTask ComputeKeysAsync(TElement[] elements, int count) + { + keys = new TKey[count]; + for (int i = 0; i < count; i++) keys[i] = keySelector(elements[i]); + if (next != null) await next.ComputeKeysAsync(elements, count); + } + + internal override int CompareKeys(int index1, int index2) + { + int c = comparer.Compare(keys[index1], keys[index2]); + if (c == 0) + { + if (next == null) return index1 - index2; + return next.CompareKeys(index1, index2); + } + return descending ? -c : c; + } + } + + internal class AsyncSelectorEnumerableSorter : AsyncEnumerableSorter + { + readonly Func> keySelector; + readonly IComparer comparer; + readonly bool descending; + readonly AsyncEnumerableSorter next; + TKey[] keys; + + internal AsyncSelectorEnumerableSorter(Func> keySelector, IComparer comparer, bool descending, AsyncEnumerableSorter next) + { + this.keySelector = keySelector; + this.comparer = comparer; + this.descending = descending; + this.next = next; + } + + internal override async UniTask ComputeKeysAsync(TElement[] elements, int count) + { + keys = new TKey[count]; + for (int i = 0; i < count; i++) keys[i] = await keySelector(elements[i]); + if (next != null) await next.ComputeKeysAsync(elements, count); + } + + internal override int CompareKeys(int index1, int index2) + { + int c = comparer.Compare(keys[index1], keys[index2]); + if (c == 0) + { + if (next == null) return index1 - index2; + return next.CompareKeys(index1, index2); + } + return descending ? -c : c; + } + } + + internal class AsyncSelectorWithCancellationEnumerableSorter : AsyncEnumerableSorter + { + readonly Func> keySelector; + readonly IComparer comparer; + readonly bool descending; + readonly AsyncEnumerableSorter next; + CancellationToken cancellationToken; + TKey[] keys; + + internal AsyncSelectorWithCancellationEnumerableSorter(Func> keySelector, IComparer comparer, bool descending, AsyncEnumerableSorter next, CancellationToken cancellationToken) + { + this.keySelector = keySelector; + this.comparer = comparer; + this.descending = descending; + this.next = next; + this.cancellationToken = cancellationToken; + } + + internal override async UniTask ComputeKeysAsync(TElement[] elements, int count) + { + keys = new TKey[count]; + for (int i = 0; i < count; i++) keys[i] = await keySelector(elements[i], cancellationToken); + if (next != null) await next.ComputeKeysAsync(elements, count); + } + + internal override int CompareKeys(int index1, int index2) + { + int c = comparer.Compare(keys[index1], keys[index2]); + if (c == 0) + { + if (next == null) return index1 - index2; + return next.CompareKeys(index1, index2); + } + return descending ? -c : c; + } + } + + internal abstract class OrderedAsyncEnumerable : IUniTaskOrderedAsyncEnumerable + { + protected readonly IUniTaskAsyncEnumerable source; + + public OrderedAsyncEnumerable(IUniTaskAsyncEnumerable source) + { + this.source = source; + } + + public IUniTaskOrderedAsyncEnumerable CreateOrderedEnumerable(Func keySelector, IComparer comparer, bool descending) + { + return new OrderedAsyncEnumerable(source, keySelector, comparer, descending, this); + } + + public IUniTaskOrderedAsyncEnumerable CreateOrderedEnumerable(Func> keySelector, IComparer comparer, bool descending) + { + return new OrderedAsyncEnumerableAwait(source, keySelector, comparer, descending, this); + } + + public IUniTaskOrderedAsyncEnumerable CreateOrderedEnumerable(Func> keySelector, IComparer comparer, bool descending) + { + return new OrderedAsyncEnumerableAwaitWithCancellation(source, keySelector, comparer, descending, this); + } + + internal abstract AsyncEnumerableSorter GetAsyncEnumerableSorter(AsyncEnumerableSorter next, CancellationToken cancellationToken); + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _OrderedAsyncEnumerator(this, cancellationToken); + } + + class _OrderedAsyncEnumerator : MoveNextSource, IUniTaskAsyncEnumerator + { + protected readonly OrderedAsyncEnumerable parent; + CancellationToken cancellationToken; + TElement[] buffer; + int[] map; + int index; + + public _OrderedAsyncEnumerator(OrderedAsyncEnumerable parent, CancellationToken cancellationToken) + { + this.parent = parent; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TElement Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (map == null) + { + completionSource.Reset(); + CreateSortSource().Forget(); + return new UniTask(this, completionSource.Version); + } + + if (index < buffer.Length) + { + Current = buffer[map[index++]]; + return CompletedTasks.True; + } + else + { + return CompletedTasks.False; + } + } + + async UniTaskVoid CreateSortSource() + { + try + { + buffer = await parent.source.ToArrayAsync(); + if (buffer.Length == 0) + { + completionSource.TrySetResult(false); + return; + } + + var sorter = parent.GetAsyncEnumerableSorter(null, cancellationToken); + map = await sorter.SortAsync(buffer, buffer.Length); + sorter = null; + + // set first value + Current = buffer[map[index++]]; + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + + completionSource.TrySetResult(true); + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return default; + } + } + } + + internal class OrderedAsyncEnumerable : OrderedAsyncEnumerable + { + readonly Func keySelector; + readonly IComparer comparer; + readonly bool descending; + readonly OrderedAsyncEnumerable parent; + + public OrderedAsyncEnumerable(IUniTaskAsyncEnumerable source, Func keySelector, IComparer comparer, bool descending, OrderedAsyncEnumerable parent) + : base(source) + { + this.keySelector = keySelector; + this.comparer = comparer; + this.descending = descending; + this.parent = parent; + } + + internal override AsyncEnumerableSorter GetAsyncEnumerableSorter(AsyncEnumerableSorter next, CancellationToken cancellationToken) + { + AsyncEnumerableSorter sorter = new SyncSelectorAsyncEnumerableSorter(keySelector, comparer, descending, next); + if (parent != null) sorter = parent.GetAsyncEnumerableSorter(sorter, cancellationToken); + return sorter; + } + } + + internal class OrderedAsyncEnumerableAwait : OrderedAsyncEnumerable + { + readonly Func> keySelector; + readonly IComparer comparer; + readonly bool descending; + readonly OrderedAsyncEnumerable parent; + + public OrderedAsyncEnumerableAwait(IUniTaskAsyncEnumerable source, Func> keySelector, IComparer comparer, bool descending, OrderedAsyncEnumerable parent) + : base(source) + { + this.keySelector = keySelector; + this.comparer = comparer; + this.descending = descending; + this.parent = parent; + } + + internal override AsyncEnumerableSorter GetAsyncEnumerableSorter(AsyncEnumerableSorter next, CancellationToken cancellationToken) + { + AsyncEnumerableSorter sorter = new AsyncSelectorEnumerableSorter(keySelector, comparer, descending, next); + if (parent != null) sorter = parent.GetAsyncEnumerableSorter(sorter, cancellationToken); + return sorter; + } + } + + internal class OrderedAsyncEnumerableAwaitWithCancellation : OrderedAsyncEnumerable + { + readonly Func> keySelector; + readonly IComparer comparer; + readonly bool descending; + readonly OrderedAsyncEnumerable parent; + + public OrderedAsyncEnumerableAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> keySelector, IComparer comparer, bool descending, OrderedAsyncEnumerable parent) + : base(source) + { + this.keySelector = keySelector; + this.comparer = comparer; + this.descending = descending; + this.parent = parent; + } + + internal override AsyncEnumerableSorter GetAsyncEnumerableSorter(AsyncEnumerableSorter next, CancellationToken cancellationToken) + { + AsyncEnumerableSorter sorter = new AsyncSelectorWithCancellationEnumerableSorter(keySelector, comparer, descending, next, cancellationToken); + if (parent != null) sorter = parent.GetAsyncEnumerableSorter(sorter, cancellationToken); + return sorter; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs.meta new file mode 100644 index 00000000..5c6b3e4a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/OrderBy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 413883ceff8546143bdf200aafa4b8f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Pairwise.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Pairwise.cs new file mode 100644 index 00000000..5d44a9e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Pairwise.cs @@ -0,0 +1,128 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable<(TSource, TSource)> Pairwise(this IUniTaskAsyncEnumerable source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new Pairwise(source); + } + } + + internal sealed class Pairwise : IUniTaskAsyncEnumerable<(TSource, TSource)> + { + readonly IUniTaskAsyncEnumerable source; + + public Pairwise(IUniTaskAsyncEnumerable source) + { + this.source = source; + } + + public IUniTaskAsyncEnumerator<(TSource, TSource)> GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Pairwise(source, cancellationToken); + } + + sealed class _Pairwise : MoveNextSource, IUniTaskAsyncEnumerator<(TSource, TSource)> + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + + TSource prev; + bool isFirst; + + public _Pairwise(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public (TSource, TSource) Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (enumerator == null) + { + isFirst = true; + enumerator = source.GetAsyncEnumerator(cancellationToken); + } + + completionSource.Reset(); + SourceMoveNext(); + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + try + { + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + MoveNextCore(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void MoveNextCore(object state) + { + var self = (_Pairwise)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + if (self.isFirst) + { + self.isFirst = false; + self.prev = self.enumerator.Current; + self.SourceMoveNext(); // run again. okay to use recursive(only one more). + } + else + { + var p = self.prev; + self.prev = self.enumerator.Current; + self.Current = (p, self.prev); + self.completionSource.TrySetResult(true); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Pairwise.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Pairwise.cs.meta new file mode 100644 index 00000000..727b8cf4 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Pairwise.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cddbf051d2a88f549986c468b23214af +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Publish.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Publish.cs new file mode 100644 index 00000000..d218c0f2 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Publish.cs @@ -0,0 +1,173 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IConnectableUniTaskAsyncEnumerable Publish(this IUniTaskAsyncEnumerable source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new Publish(source); + } + } + + internal sealed class Publish : IConnectableUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly CancellationTokenSource cancellationTokenSource; + + TriggerEvent trigger; + IUniTaskAsyncEnumerator enumerator; + IDisposable connectedDisposable; + bool isCompleted; + + public Publish(IUniTaskAsyncEnumerable source) + { + this.source = source; + this.cancellationTokenSource = new CancellationTokenSource(); + } + + public IDisposable Connect() + { + if (connectedDisposable != null) return connectedDisposable; + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationTokenSource.Token); + } + + ConsumeEnumerator().Forget(); + + connectedDisposable = new ConnectDisposable(cancellationTokenSource); + return connectedDisposable; + } + + async UniTaskVoid ConsumeEnumerator() + { + try + { + try + { + while (await enumerator.MoveNextAsync()) + { + trigger.SetResult(enumerator.Current); + } + trigger.SetCompleted(); + } + catch (Exception ex) + { + trigger.SetError(ex); + } + } + finally + { + isCompleted = true; + await enumerator.DisposeAsync(); + } + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Publish(this, cancellationToken); + } + + sealed class ConnectDisposable : IDisposable + { + readonly CancellationTokenSource cancellationTokenSource; + + public ConnectDisposable(CancellationTokenSource cancellationTokenSource) + { + this.cancellationTokenSource = cancellationTokenSource; + } + + public void Dispose() + { + this.cancellationTokenSource.Cancel(); + } + } + + sealed class _Publish : MoveNextSource, IUniTaskAsyncEnumerator, ITriggerHandler + { + static readonly Action CancelDelegate = OnCanceled; + + readonly Publish parent; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + bool isDisposed; + + public _Publish(Publish parent, CancellationToken cancellationToken) + { + if (cancellationToken.IsCancellationRequested) return; + + this.parent = parent; + this.cancellationToken = cancellationToken; + + if (cancellationToken.CanBeCanceled) + { + this.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(CancelDelegate, this); + } + + parent.trigger.Add(this); + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + ITriggerHandler ITriggerHandler.Prev { get; set; } + ITriggerHandler ITriggerHandler.Next { get; set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (parent.isCompleted) return CompletedTasks.False; + + completionSource.Reset(); + return new UniTask(this, completionSource.Version); + } + + static void OnCanceled(object state) + { + var self = (_Publish)state; + self.completionSource.TrySetCanceled(self.cancellationToken); + self.DisposeAsync().Forget(); + } + + public UniTask DisposeAsync() + { + if (!isDisposed) + { + isDisposed = true; + TaskTracker.RemoveTracking(this); + cancellationTokenRegistration.Dispose(); + parent.trigger.Remove(this); + } + + return default; + } + + public void OnNext(TSource value) + { + Current = value; + completionSource.TrySetResult(true); + } + + public void OnCanceled(CancellationToken cancellationToken) + { + completionSource.TrySetCanceled(cancellationToken); + } + + public void OnCompleted() + { + completionSource.TrySetResult(false); + } + + public void OnError(Exception ex) + { + completionSource.TrySetException(ex); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Publish.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Publish.cs.meta new file mode 100644 index 00000000..f3a81ba3 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Publish.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 93c684d1e88c09d4e89b79437d97b810 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Queue.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Queue.cs new file mode 100644 index 00000000..b5c221fb --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Queue.cs @@ -0,0 +1,103 @@ +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Queue(this IUniTaskAsyncEnumerable source) + { + return new QueueOperator(source); + } + } + + internal sealed class QueueOperator : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + + public QueueOperator(IUniTaskAsyncEnumerable source) + { + this.source = source; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Queue(source, cancellationToken); + } + + sealed class _Queue : IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + CancellationToken cancellationToken; + + Channel channel; + IUniTaskAsyncEnumerator channelEnumerator; + IUniTaskAsyncEnumerator sourceEnumerator; + bool channelClosed; + + public _Queue(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + } + + public TSource Current => channelEnumerator.Current; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (sourceEnumerator == null) + { + sourceEnumerator = source.GetAsyncEnumerator(cancellationToken); + channel = Channel.CreateSingleConsumerUnbounded(); + + channelEnumerator = channel.Reader.ReadAllAsync().GetAsyncEnumerator(cancellationToken); + + ConsumeAll(this, sourceEnumerator, channel).Forget(); + } + + return channelEnumerator.MoveNextAsync(); + } + + static async UniTaskVoid ConsumeAll(_Queue self, IUniTaskAsyncEnumerator enumerator, ChannelWriter writer) + { + try + { + while (await enumerator.MoveNextAsync()) + { + writer.TryWrite(enumerator.Current); + } + writer.TryComplete(); + } + catch (Exception ex) + { + writer.TryComplete(ex); + } + finally + { + self.channelClosed = true; + await enumerator.DisposeAsync(); + } + } + + public async UniTask DisposeAsync() + { + if (sourceEnumerator != null) + { + await sourceEnumerator.DisposeAsync(); + } + if (channelEnumerator != null) + { + await channelEnumerator.DisposeAsync(); + } + + if (!channelClosed) + { + channelClosed = true; + channel.Writer.TryComplete(new OperationCanceledException()); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Queue.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Queue.cs.meta new file mode 100644 index 00000000..35f3fab2 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Queue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b7ea1bcf9dbebb042bc99c7816249e02 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Range.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Range.cs new file mode 100644 index 00000000..24a795d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Range.cs @@ -0,0 +1,75 @@ +using Cysharp.Threading.Tasks.Internal; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Range(int start, int count) + { + if (count < 0) throw Error.ArgumentOutOfRange(nameof(count)); + + var end = (long)start + count - 1L; + if (end > int.MaxValue) throw Error.ArgumentOutOfRange(nameof(count)); + + if (count == 0) UniTaskAsyncEnumerable.Empty(); + + return new Cysharp.Threading.Tasks.Linq.Range(start, count); + } + } + + internal class Range : IUniTaskAsyncEnumerable + { + readonly int start; + readonly int end; + + public Range(int start, int count) + { + this.start = start; + this.end = start + count; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Range(start, end, cancellationToken); + } + + class _Range : IUniTaskAsyncEnumerator + { + readonly int start; + readonly int end; + int current; + CancellationToken cancellationToken; + + public _Range(int start, int end, CancellationToken cancellationToken) + { + this.start = start; + this.end = end; + this.cancellationToken = cancellationToken; + + this.current = start - 1; + } + + public int Current => current; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + current++; + + if (current != end) + { + return CompletedTasks.True; + } + + return CompletedTasks.False; + } + + public UniTask DisposeAsync() + { + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Range.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Range.cs.meta new file mode 100644 index 00000000..36272fcf --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Range.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d826418a813498648b10542d0a5fb173 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs new file mode 100644 index 00000000..db90a1ae --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs @@ -0,0 +1,68 @@ +using Cysharp.Threading.Tasks.Internal; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Repeat(TElement element, int count) + { + if (count < 0) throw Error.ArgumentOutOfRange(nameof(count)); + + return new Repeat(element, count); + } + } + + internal class Repeat : IUniTaskAsyncEnumerable + { + readonly TElement element; + readonly int count; + + public Repeat(TElement element, int count) + { + this.element = element; + this.count = count; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Repeat(element, count, cancellationToken); + } + + class _Repeat : IUniTaskAsyncEnumerator + { + readonly TElement element; + readonly int count; + int remaining; + CancellationToken cancellationToken; + + public _Repeat(TElement element, int count, CancellationToken cancellationToken) + { + this.element = element; + this.count = count; + this.cancellationToken = cancellationToken; + + this.remaining = count; + } + + public TElement Current => element; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (remaining-- != 0) + { + return CompletedTasks.True; + } + + return CompletedTasks.False; + } + + public UniTask DisposeAsync() + { + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs.meta new file mode 100644 index 00000000..693d5790 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Repeat.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3819a3925165a674d80ee848c8600379 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Return.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Return.cs new file mode 100644 index 00000000..ba8fa8df --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Return.cs @@ -0,0 +1,63 @@ +using Cysharp.Threading.Tasks.Internal; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Return(TValue value) + { + return new Return(value); + } + } + + internal class Return : IUniTaskAsyncEnumerable + { + readonly TValue value; + + public Return(TValue value) + { + this.value = value; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Return(value, cancellationToken); + } + + class _Return : IUniTaskAsyncEnumerator + { + readonly TValue value; + CancellationToken cancellationToken; + + bool called; + + public _Return(TValue value, CancellationToken cancellationToken) + { + this.value = value; + this.cancellationToken = cancellationToken; + this.called = false; + } + + public TValue Current => value; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (!called) + { + called = true; + return CompletedTasks.True; + } + + return CompletedTasks.False; + } + + public UniTask DisposeAsync() + { + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Return.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Return.cs.meta new file mode 100644 index 00000000..ad264d0d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Return.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4313cd8ecf705e44f9064ce46e293c2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs new file mode 100644 index 00000000..48d43181 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs @@ -0,0 +1,78 @@ +using Cysharp.Threading.Tasks.Internal; +using System.Collections.Generic; +using System.Linq; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Reverse(this IUniTaskAsyncEnumerable source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + return new Reverse(source); + } + } + + internal sealed class Reverse : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + + public Reverse(IUniTaskAsyncEnumerable source) + { + this.source = source; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Reverse(source, cancellationToken); + } + + sealed class _Reverse : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + CancellationToken cancellationToken; + + TSource[] array; + int index; + + public _Reverse(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + // after consumed array, don't use await so allow async(not require UniTaskCompletionSourceCore). + public async UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (array == null) + { + array = await source.ToArrayAsync(cancellationToken); + index = array.Length - 1; + } + + if (index != -1) + { + Current = array[index]; + --index; + return true; + } + else + { + return false; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs.meta new file mode 100644 index 00000000..4a28306a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Reverse.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b2769e65c729b4f4ca6af9826d9c7b90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Select.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Select.cs new file mode 100644 index 00000000..50e9cec9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Select.cs @@ -0,0 +1,760 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Select(this IUniTaskAsyncEnumerable source, Func selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new Cysharp.Threading.Tasks.Linq.Select(source, selector); + } + + public static IUniTaskAsyncEnumerable Select(this IUniTaskAsyncEnumerable source, Func selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new Cysharp.Threading.Tasks.Linq.SelectInt(source, selector); + } + + public static IUniTaskAsyncEnumerable SelectAwait(this IUniTaskAsyncEnumerable source, Func> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new Cysharp.Threading.Tasks.Linq.SelectAwait(source, selector); + } + + public static IUniTaskAsyncEnumerable SelectAwait(this IUniTaskAsyncEnumerable source, Func> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new Cysharp.Threading.Tasks.Linq.SelectIntAwait(source, selector); + } + + public static IUniTaskAsyncEnumerable SelectAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new Cysharp.Threading.Tasks.Linq.SelectAwaitWithCancellation(source, selector); + } + + public static IUniTaskAsyncEnumerable SelectAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new Cysharp.Threading.Tasks.Linq.SelectIntAwaitWithCancellation(source, selector); + } + } + + internal sealed class Select : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func selector; + + public Select(IUniTaskAsyncEnumerable source, Func selector) + { + this.source = source; + this.selector = selector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Select(source, selector, cancellationToken); + } + + sealed class _Select : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func selector; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + Action moveNextAction; + + public _Select(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + this.source = source; + this.selector = selector; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + Current = selector(enumerator.Current); + goto CONTINUE; + } + else + { + goto DONE; + } + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class SelectInt : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func selector; + + public SelectInt(IUniTaskAsyncEnumerable source, Func selector) + { + this.source = source; + this.selector = selector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Select(source, selector, cancellationToken); + } + + sealed class _Select : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func selector; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + Action moveNextAction; + int index; + + public _Select(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + this.source = source; + this.selector = selector; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + Current = selector(enumerator.Current, checked(index++)); + goto CONTINUE; + } + else + { + goto DONE; + } + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class SelectAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> selector; + + public SelectAwait(IUniTaskAsyncEnumerable source, Func> selector) + { + this.source = source; + this.selector = selector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SelectAwait(source, selector, cancellationToken); + } + + sealed class _SelectAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> selector; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + + public _SelectAwait(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + this.source = source; + this.selector = selector; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + awaiter2 = selector(enumerator.Current).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + Current = awaiter2.GetResult(); + goto CONTINUE; + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class SelectIntAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> selector; + + public SelectIntAwait(IUniTaskAsyncEnumerable source, Func> selector) + { + this.source = source; + this.selector = selector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SelectAwait(source, selector, cancellationToken); + } + + sealed class _SelectAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> selector; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + int index; + + public _SelectAwait(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + this.source = source; + this.selector = selector; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + awaiter2 = selector(enumerator.Current, checked(index++)).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + Current = awaiter2.GetResult(); + goto CONTINUE; + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class SelectAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> selector; + + public SelectAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> selector) + { + this.source = source; + this.selector = selector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SelectAwaitWithCancellation(source, selector, cancellationToken); + } + + sealed class _SelectAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> selector; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + + public _SelectAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + this.source = source; + this.selector = selector; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + awaiter2 = selector(enumerator.Current, cancellationToken).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + Current = awaiter2.GetResult(); + goto CONTINUE; + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class SelectIntAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> selector; + + public SelectIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> selector) + { + this.source = source; + this.selector = selector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SelectAwaitWithCancellation(source, selector, cancellationToken); + } + + sealed class _SelectAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> selector; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + int index; + + public _SelectAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + this.source = source; + this.selector = selector; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + awaiter2 = selector(enumerator.Current, checked(index++), cancellationToken).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + Current = awaiter2.GetResult(); + goto CONTINUE; + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Select.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Select.cs.meta new file mode 100644 index 00000000..476e9723 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Select.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc68e598ca44a134b988dfaf5e53bfba +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs new file mode 100644 index 00000000..6cad2a50 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs @@ -0,0 +1,892 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + + public static IUniTaskAsyncEnumerable SelectMany(this IUniTaskAsyncEnumerable source, Func> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new SelectMany(source, selector, (x, y) => y); + } + + public static IUniTaskAsyncEnumerable SelectMany(this IUniTaskAsyncEnumerable source, Func> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new SelectMany(source, selector, (x, y) => y); + } + + public static IUniTaskAsyncEnumerable SelectMany(this IUniTaskAsyncEnumerable source, Func> collectionSelector, Func resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(collectionSelector, nameof(collectionSelector)); + + return new SelectMany(source, collectionSelector, resultSelector); + } + + public static IUniTaskAsyncEnumerable SelectMany(this IUniTaskAsyncEnumerable source, Func> collectionSelector, Func resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(collectionSelector, nameof(collectionSelector)); + + return new SelectMany(source, collectionSelector, resultSelector); + } + + public static IUniTaskAsyncEnumerable SelectManyAwait(this IUniTaskAsyncEnumerable source, Func>> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new SelectManyAwait(source, selector, (x, y) => UniTask.FromResult(y)); + } + + public static IUniTaskAsyncEnumerable SelectManyAwait(this IUniTaskAsyncEnumerable source, Func>> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new SelectManyAwait(source, selector, (x, y) => UniTask.FromResult(y)); + } + + public static IUniTaskAsyncEnumerable SelectManyAwait(this IUniTaskAsyncEnumerable source, Func>> collectionSelector, Func> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(collectionSelector, nameof(collectionSelector)); + + return new SelectManyAwait(source, collectionSelector, resultSelector); + } + + public static IUniTaskAsyncEnumerable SelectManyAwait(this IUniTaskAsyncEnumerable source, Func>> collectionSelector, Func> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(collectionSelector, nameof(collectionSelector)); + + return new SelectManyAwait(source, collectionSelector, resultSelector); + } + + public static IUniTaskAsyncEnumerable SelectManyAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func>> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new SelectManyAwaitWithCancellation(source, selector, (x, y, c) => UniTask.FromResult(y)); + } + + public static IUniTaskAsyncEnumerable SelectManyAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func>> selector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new SelectManyAwaitWithCancellation(source, selector, (x, y, c) => UniTask.FromResult(y)); + } + + public static IUniTaskAsyncEnumerable SelectManyAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func>> collectionSelector, Func> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(collectionSelector, nameof(collectionSelector)); + + return new SelectManyAwaitWithCancellation(source, collectionSelector, resultSelector); + } + + public static IUniTaskAsyncEnumerable SelectManyAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func>> collectionSelector, Func> resultSelector) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(collectionSelector, nameof(collectionSelector)); + + return new SelectManyAwaitWithCancellation(source, collectionSelector, resultSelector); + } + } + + internal sealed class SelectMany : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> selector1; + readonly Func> selector2; + readonly Func resultSelector; + + public SelectMany(IUniTaskAsyncEnumerable source, Func> selector, Func resultSelector) + { + this.source = source; + this.selector1 = selector; + this.selector2 = null; + this.resultSelector = resultSelector; + } + + public SelectMany(IUniTaskAsyncEnumerable source, Func> selector, Func resultSelector) + { + this.source = source; + this.selector1 = null; + this.selector2 = selector; + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SelectMany(source, selector1, selector2, resultSelector, cancellationToken); + } + + sealed class _SelectMany : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action sourceMoveNextCoreDelegate = SourceMoveNextCore; + static readonly Action selectedSourceMoveNextCoreDelegate = SeletedSourceMoveNextCore; + static readonly Action selectedEnumeratorDisposeAsyncCoreDelegate = SelectedEnumeratorDisposeAsyncCore; + + readonly IUniTaskAsyncEnumerable source; + + readonly Func> selector1; + readonly Func> selector2; + readonly Func resultSelector; + CancellationToken cancellationToken; + + TSource sourceCurrent; + int sourceIndex; + IUniTaskAsyncEnumerator sourceEnumerator; + IUniTaskAsyncEnumerator selectedEnumerator; + UniTask.Awaiter sourceAwaiter; + UniTask.Awaiter selectedAwaiter; + UniTask.Awaiter selectedDisposeAsyncAwaiter; + + public _SelectMany(IUniTaskAsyncEnumerable source, Func> selector1, Func> selector2, Func resultSelector, CancellationToken cancellationToken) + { + this.source = source; + this.selector1 = selector1; + this.selector2 = selector2; + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + completionSource.Reset(); + + // iterate selected field + if (selectedEnumerator != null) + { + MoveNextSelected(); + } + else + { + // iterate source field + if (sourceEnumerator == null) + { + sourceEnumerator = source.GetAsyncEnumerator(cancellationToken); + } + MoveNextSource(); + } + + return new UniTask(this, completionSource.Version); + } + + void MoveNextSource() + { + try + { + sourceAwaiter = sourceEnumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + + if (sourceAwaiter.IsCompleted) + { + SourceMoveNextCore(this); + } + else + { + sourceAwaiter.SourceOnCompleted(sourceMoveNextCoreDelegate, this); + } + } + + void MoveNextSelected() + { + try + { + selectedAwaiter = selectedEnumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + + if (selectedAwaiter.IsCompleted) + { + SeletedSourceMoveNextCore(this); + } + else + { + selectedAwaiter.SourceOnCompleted(selectedSourceMoveNextCoreDelegate, this); + } + } + + static void SourceMoveNextCore(object state) + { + var self = (_SelectMany)state; + + if (self.TryGetResult(self.sourceAwaiter, out var result)) + { + if (result) + { + try + { + self.sourceCurrent = self.sourceEnumerator.Current; + if (self.selector1 != null) + { + self.selectedEnumerator = self.selector1(self.sourceCurrent).GetAsyncEnumerator(self.cancellationToken); + } + else + { + self.selectedEnumerator = self.selector2(self.sourceCurrent, checked(self.sourceIndex++)).GetAsyncEnumerator(self.cancellationToken); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + + self.MoveNextSelected(); // iterated selected source. + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void SeletedSourceMoveNextCore(object state) + { + var self = (_SelectMany)state; + + if (self.TryGetResult(self.selectedAwaiter, out var result)) + { + if (result) + { + try + { + self.Current = self.resultSelector(self.sourceCurrent, self.selectedEnumerator.Current); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + + self.completionSource.TrySetResult(true); + } + else + { + // dispose selected source and try iterate source. + try + { + self.selectedDisposeAsyncAwaiter = self.selectedEnumerator.DisposeAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + if (self.selectedDisposeAsyncAwaiter.IsCompleted) + { + SelectedEnumeratorDisposeAsyncCore(self); + } + else + { + self.selectedDisposeAsyncAwaiter.SourceOnCompleted(selectedEnumeratorDisposeAsyncCoreDelegate, self); + } + } + } + } + + static void SelectedEnumeratorDisposeAsyncCore(object state) + { + var self = (_SelectMany)state; + + if (self.TryGetResult(self.selectedDisposeAsyncAwaiter)) + { + self.selectedEnumerator = null; + self.selectedAwaiter = default; + + self.MoveNextSource(); // iterate next source + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (selectedEnumerator != null) + { + await selectedEnumerator.DisposeAsync(); + } + if (sourceEnumerator != null) + { + await sourceEnumerator.DisposeAsync(); + } + } + } + } + + internal sealed class SelectManyAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func>> selector1; + readonly Func>> selector2; + readonly Func> resultSelector; + + public SelectManyAwait(IUniTaskAsyncEnumerable source, Func>> selector, Func> resultSelector) + { + this.source = source; + this.selector1 = selector; + this.selector2 = null; + this.resultSelector = resultSelector; + } + + public SelectManyAwait(IUniTaskAsyncEnumerable source, Func>> selector, Func> resultSelector) + { + this.source = source; + this.selector1 = null; + this.selector2 = selector; + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SelectManyAwait(source, selector1, selector2, resultSelector, cancellationToken); + } + + sealed class _SelectManyAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action sourceMoveNextCoreDelegate = SourceMoveNextCore; + static readonly Action selectedSourceMoveNextCoreDelegate = SeletedSourceMoveNextCore; + static readonly Action selectedEnumeratorDisposeAsyncCoreDelegate = SelectedEnumeratorDisposeAsyncCore; + static readonly Action selectorAwaitCoreDelegate = SelectorAwaitCore; + static readonly Action resultSelectorAwaitCoreDelegate = ResultSelectorAwaitCore; + + readonly IUniTaskAsyncEnumerable source; + + readonly Func>> selector1; + readonly Func>> selector2; + readonly Func> resultSelector; + CancellationToken cancellationToken; + + TSource sourceCurrent; + int sourceIndex; + IUniTaskAsyncEnumerator sourceEnumerator; + IUniTaskAsyncEnumerator selectedEnumerator; + UniTask.Awaiter sourceAwaiter; + UniTask.Awaiter selectedAwaiter; + UniTask.Awaiter selectedDisposeAsyncAwaiter; + + // await additional + UniTask>.Awaiter collectionSelectorAwaiter; + UniTask.Awaiter resultSelectorAwaiter; + + public _SelectManyAwait(IUniTaskAsyncEnumerable source, Func>> selector1, Func>> selector2, Func> resultSelector, CancellationToken cancellationToken) + { + this.source = source; + this.selector1 = selector1; + this.selector2 = selector2; + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + completionSource.Reset(); + + // iterate selected field + if (selectedEnumerator != null) + { + MoveNextSelected(); + } + else + { + // iterate source field + if (sourceEnumerator == null) + { + sourceEnumerator = source.GetAsyncEnumerator(cancellationToken); + } + MoveNextSource(); + } + + return new UniTask(this, completionSource.Version); + } + + void MoveNextSource() + { + try + { + sourceAwaiter = sourceEnumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + + if (sourceAwaiter.IsCompleted) + { + SourceMoveNextCore(this); + } + else + { + sourceAwaiter.SourceOnCompleted(sourceMoveNextCoreDelegate, this); + } + } + + void MoveNextSelected() + { + try + { + selectedAwaiter = selectedEnumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + + if (selectedAwaiter.IsCompleted) + { + SeletedSourceMoveNextCore(this); + } + else + { + selectedAwaiter.SourceOnCompleted(selectedSourceMoveNextCoreDelegate, this); + } + } + + static void SourceMoveNextCore(object state) + { + var self = (_SelectManyAwait)state; + + if (self.TryGetResult(self.sourceAwaiter, out var result)) + { + if (result) + { + try + { + self.sourceCurrent = self.sourceEnumerator.Current; + + if (self.selector1 != null) + { + self.collectionSelectorAwaiter = self.selector1(self.sourceCurrent).GetAwaiter(); + } + else + { + self.collectionSelectorAwaiter = self.selector2(self.sourceCurrent, checked(self.sourceIndex++)).GetAwaiter(); + } + + if (self.collectionSelectorAwaiter.IsCompleted) + { + SelectorAwaitCore(self); + } + else + { + self.collectionSelectorAwaiter.SourceOnCompleted(selectorAwaitCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void SeletedSourceMoveNextCore(object state) + { + var self = (_SelectManyAwait)state; + + if (self.TryGetResult(self.selectedAwaiter, out var result)) + { + if (result) + { + try + { + self.resultSelectorAwaiter = self.resultSelector(self.sourceCurrent, self.selectedEnumerator.Current).GetAwaiter(); + if (self.resultSelectorAwaiter.IsCompleted) + { + ResultSelectorAwaitCore(self); + } + else + { + self.resultSelectorAwaiter.SourceOnCompleted(resultSelectorAwaitCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + } + else + { + // dispose selected source and try iterate source. + try + { + self.selectedDisposeAsyncAwaiter = self.selectedEnumerator.DisposeAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + if (self.selectedDisposeAsyncAwaiter.IsCompleted) + { + SelectedEnumeratorDisposeAsyncCore(self); + } + else + { + self.selectedDisposeAsyncAwaiter.SourceOnCompleted(selectedEnumeratorDisposeAsyncCoreDelegate, self); + } + } + } + } + + static void SelectedEnumeratorDisposeAsyncCore(object state) + { + var self = (_SelectManyAwait)state; + + if (self.TryGetResult(self.selectedDisposeAsyncAwaiter)) + { + self.selectedEnumerator = null; + self.selectedAwaiter = default; + + self.MoveNextSource(); // iterate next source + } + } + + static void SelectorAwaitCore(object state) + { + var self = (_SelectManyAwait)state; + + if (self.TryGetResult(self.collectionSelectorAwaiter, out var result)) + { + self.selectedEnumerator = result.GetAsyncEnumerator(self.cancellationToken); + self.MoveNextSelected(); // iterated selected source. + } + } + + static void ResultSelectorAwaitCore(object state) + { + var self = (_SelectManyAwait)state; + + if (self.TryGetResult(self.resultSelectorAwaiter, out var result)) + { + self.Current = result; + self.completionSource.TrySetResult(true); + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (selectedEnumerator != null) + { + await selectedEnumerator.DisposeAsync(); + } + if (sourceEnumerator != null) + { + await sourceEnumerator.DisposeAsync(); + } + } + } + } + + internal sealed class SelectManyAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func>> selector1; + readonly Func>> selector2; + readonly Func> resultSelector; + + public SelectManyAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func>> selector, Func> resultSelector) + { + this.source = source; + this.selector1 = selector; + this.selector2 = null; + this.resultSelector = resultSelector; + } + + public SelectManyAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func>> selector, Func> resultSelector) + { + this.source = source; + this.selector1 = null; + this.selector2 = selector; + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SelectManyAwaitWithCancellation(source, selector1, selector2, resultSelector, cancellationToken); + } + + sealed class _SelectManyAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action sourceMoveNextCoreDelegate = SourceMoveNextCore; + static readonly Action selectedSourceMoveNextCoreDelegate = SeletedSourceMoveNextCore; + static readonly Action selectedEnumeratorDisposeAsyncCoreDelegate = SelectedEnumeratorDisposeAsyncCore; + static readonly Action selectorAwaitCoreDelegate = SelectorAwaitCore; + static readonly Action resultSelectorAwaitCoreDelegate = ResultSelectorAwaitCore; + + readonly IUniTaskAsyncEnumerable source; + + readonly Func>> selector1; + readonly Func>> selector2; + readonly Func> resultSelector; + CancellationToken cancellationToken; + + TSource sourceCurrent; + int sourceIndex; + IUniTaskAsyncEnumerator sourceEnumerator; + IUniTaskAsyncEnumerator selectedEnumerator; + UniTask.Awaiter sourceAwaiter; + UniTask.Awaiter selectedAwaiter; + UniTask.Awaiter selectedDisposeAsyncAwaiter; + + // await additional + UniTask>.Awaiter collectionSelectorAwaiter; + UniTask.Awaiter resultSelectorAwaiter; + + public _SelectManyAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func>> selector1, Func>> selector2, Func> resultSelector, CancellationToken cancellationToken) + { + this.source = source; + this.selector1 = selector1; + this.selector2 = selector2; + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + completionSource.Reset(); + + // iterate selected field + if (selectedEnumerator != null) + { + MoveNextSelected(); + } + else + { + // iterate source field + if (sourceEnumerator == null) + { + sourceEnumerator = source.GetAsyncEnumerator(cancellationToken); + } + MoveNextSource(); + } + + return new UniTask(this, completionSource.Version); + } + + void MoveNextSource() + { + try + { + sourceAwaiter = sourceEnumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + + if (sourceAwaiter.IsCompleted) + { + SourceMoveNextCore(this); + } + else + { + sourceAwaiter.SourceOnCompleted(sourceMoveNextCoreDelegate, this); + } + } + + void MoveNextSelected() + { + try + { + selectedAwaiter = selectedEnumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return; + } + + if (selectedAwaiter.IsCompleted) + { + SeletedSourceMoveNextCore(this); + } + else + { + selectedAwaiter.SourceOnCompleted(selectedSourceMoveNextCoreDelegate, this); + } + } + + static void SourceMoveNextCore(object state) + { + var self = (_SelectManyAwaitWithCancellation)state; + + if (self.TryGetResult(self.sourceAwaiter, out var result)) + { + if (result) + { + try + { + self.sourceCurrent = self.sourceEnumerator.Current; + + if (self.selector1 != null) + { + self.collectionSelectorAwaiter = self.selector1(self.sourceCurrent, self.cancellationToken).GetAwaiter(); + } + else + { + self.collectionSelectorAwaiter = self.selector2(self.sourceCurrent, checked(self.sourceIndex++), self.cancellationToken).GetAwaiter(); + } + + if (self.collectionSelectorAwaiter.IsCompleted) + { + SelectorAwaitCore(self); + } + else + { + self.collectionSelectorAwaiter.SourceOnCompleted(selectorAwaitCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void SeletedSourceMoveNextCore(object state) + { + var self = (_SelectManyAwaitWithCancellation)state; + + if (self.TryGetResult(self.selectedAwaiter, out var result)) + { + if (result) + { + try + { + self.resultSelectorAwaiter = self.resultSelector(self.sourceCurrent, self.selectedEnumerator.Current, self.cancellationToken).GetAwaiter(); + if (self.resultSelectorAwaiter.IsCompleted) + { + ResultSelectorAwaitCore(self); + } + else + { + self.resultSelectorAwaiter.SourceOnCompleted(resultSelectorAwaitCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + } + else + { + // dispose selected source and try iterate source. + try + { + self.selectedDisposeAsyncAwaiter = self.selectedEnumerator.DisposeAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + if (self.selectedDisposeAsyncAwaiter.IsCompleted) + { + SelectedEnumeratorDisposeAsyncCore(self); + } + else + { + self.selectedDisposeAsyncAwaiter.SourceOnCompleted(selectedEnumeratorDisposeAsyncCoreDelegate, self); + } + } + } + } + + static void SelectedEnumeratorDisposeAsyncCore(object state) + { + var self = (_SelectManyAwaitWithCancellation)state; + + if (self.TryGetResult(self.selectedDisposeAsyncAwaiter)) + { + self.selectedEnumerator = null; + self.selectedAwaiter = default; + + self.MoveNextSource(); // iterate next source + } + } + + static void SelectorAwaitCore(object state) + { + var self = (_SelectManyAwaitWithCancellation)state; + + if (self.TryGetResult(self.collectionSelectorAwaiter, out var result)) + { + self.selectedEnumerator = result.GetAsyncEnumerator(self.cancellationToken); + self.MoveNextSelected(); // iterated selected source. + } + } + + static void ResultSelectorAwaitCore(object state) + { + var self = (_SelectManyAwaitWithCancellation)state; + + if (self.TryGetResult(self.resultSelectorAwaiter, out var result)) + { + self.Current = result; + self.completionSource.TrySetResult(true); + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (selectedEnumerator != null) + { + await selectedEnumerator.DisposeAsync(); + } + if (sourceEnumerator != null) + { + await sourceEnumerator.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs.meta new file mode 100644 index 00000000..a8dbbaf6 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d81862f0eb12680479ccaaf2ac319d24 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs new file mode 100644 index 00000000..9512ea7d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs @@ -0,0 +1,87 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask SequenceEqualAsync(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, CancellationToken cancellationToken = default) + { + return SequenceEqualAsync(first, second, EqualityComparer.Default, cancellationToken); + } + + public static UniTask SequenceEqualAsync(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return SequenceEqual.SequenceEqualAsync(first, second, comparer, cancellationToken); + } + } + + internal static class SequenceEqual + { + internal static async UniTask SequenceEqualAsync(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var e1 = first.GetAsyncEnumerator(cancellationToken); + try + { + var e2 = second.GetAsyncEnumerator(cancellationToken); + try + { + while (true) + { + if (await e1.MoveNextAsync()) + { + if (await e2.MoveNextAsync()) + { + if (comparer.Equals(e1.Current, e2.Current)) + { + continue; + } + else + { + return false; + } + } + else + { + // e2 is finished, but e1 has value + return false; + } + } + else + { + // e1 is finished, e2? + if (await e2.MoveNextAsync()) + { + return false; + } + else + { + return true; + } + } + } + } + finally + { + if (e2 != null) + { + await e2.DisposeAsync(); + } + } + } + finally + { + if (e1 != null) + { + await e1.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs.meta new file mode 100644 index 00000000..ee2b75c2 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SequenceEqual.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b382772aba6128842928cdb6b2e034b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Single.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Single.cs new file mode 100644 index 00000000..30df1b3d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Single.cs @@ -0,0 +1,230 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask SingleAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return SingleOperator.SingleAsync(source, cancellationToken, false); + } + + public static UniTask SingleAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return SingleOperator.SingleAsync(source, predicate, cancellationToken, false); + } + + public static UniTask SingleAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return SingleOperator.SingleAwaitAsync(source, predicate, cancellationToken, false); + } + + public static UniTask SingleAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return SingleOperator.SingleAwaitWithCancellationAsync(source, predicate, cancellationToken, false); + } + + public static UniTask SingleOrDefaultAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return SingleOperator.SingleAsync(source, cancellationToken, true); + } + + public static UniTask SingleOrDefaultAsync(this IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return SingleOperator.SingleAsync(source, predicate, cancellationToken, true); + } + + public static UniTask SingleOrDefaultAwaitAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return SingleOperator.SingleAwaitAsync(source, predicate, cancellationToken, true); + } + + public static UniTask SingleOrDefaultAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return SingleOperator.SingleAwaitWithCancellationAsync(source, predicate, cancellationToken, true); + } + } + + internal static class SingleOperator + { + public static async UniTask SingleAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + if (await e.MoveNextAsync()) + { + var v = e.Current; + if (!await e.MoveNextAsync()) + { + return v; + } + + throw Error.MoreThanOneElement(); + } + else + { + if (defaultIfEmpty) + { + return default; + } + else + { + throw Error.NoElements(); + } + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask SingleAsync(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value = default; + bool found = false; + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (predicate(v)) + { + if (found) + { + throw Error.MoreThanOneElement(); + } + else + { + found = true; + value = v; + } + } + } + + if (found || defaultIfEmpty) + { + return value; + } + + throw Error.NoElements(); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask SingleAwaitAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value = default; + bool found = false; + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (await predicate(v)) + { + if (found) + { + throw Error.MoreThanOneElement(); + } + else + { + found = true; + value = v; + } + } + } + + if (found || defaultIfEmpty) + { + return value; + } + + throw Error.NoElements(); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTask SingleAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken, bool defaultIfEmpty) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + TSource value = default; + bool found = false; + while (await e.MoveNextAsync()) + { + var v = e.Current; + if (await predicate(v, cancellationToken)) + { + if (found) + { + throw Error.MoreThanOneElement(); + } + else + { + found = true; + value = v; + } + } + } + + if (found || defaultIfEmpty) + { + return value; + } + + throw Error.NoElements(); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Single.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Single.cs.meta new file mode 100644 index 00000000..c053dfd7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Single.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1bcd3928b90472e43a3a92c3ba708967 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs new file mode 100644 index 00000000..6f4831d1 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs @@ -0,0 +1,69 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Skip(this IUniTaskAsyncEnumerable source, Int32 count) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new Skip(source, count); + } + } + + internal sealed class Skip : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly int count; + + public Skip(IUniTaskAsyncEnumerable source, int count) + { + this.source = source; + this.count = count; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Skip(source, count, cancellationToken); + } + + sealed class _Skip : AsyncEnumeratorBase + { + readonly int count; + + int index; + + public _Skip(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + : base(source, cancellationToken) + { + this.count = count; + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + if (count <= checked(index++)) + { + Current = SourceCurrent; + result = true; + return true; + } + else + { + result = default; + return false; + } + } + else + { + result = false; + return true; + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs.meta new file mode 100644 index 00000000..25ad847b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Skip.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c46b6c7dce0cb049a73c81084c75154 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs new file mode 100644 index 00000000..9d127b87 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs @@ -0,0 +1,159 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable SkipLast(this IUniTaskAsyncEnumerable source, Int32 count) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + // non skip. + if (count <= 0) + { + return source; + } + + return new SkipLast(source, count); + } + } + + internal sealed class SkipLast : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly int count; + + public SkipLast(IUniTaskAsyncEnumerable source, int count) + { + this.source = source; + this.count = count; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SkipLast(source, count, cancellationToken); + } + + sealed class _SkipLast : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + readonly int count; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + Queue queue; + + bool continueNext; + + public _SkipLast(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + { + this.source = source; + this.count = count; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + queue = new Queue(); + } + + completionSource.Reset(); + SourceMoveNext(); + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + try + { + + LOOP: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + continueNext = true; + MoveNextCore(this); + if (continueNext) + { + continueNext = false; + goto LOOP; // avoid recursive + } + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + + static void MoveNextCore(object state) + { + var self = (_SkipLast)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + if (self.queue.Count == self.count) + { + self.continueNext = false; + + var deq = self.queue.Dequeue(); + self.Current = deq; + self.queue.Enqueue(self.enumerator.Current); + + self.completionSource.TrySetResult(true); + } + else + { + self.queue.Enqueue(self.enumerator.Current); + + if (!self.continueNext) + { + self.SourceMoveNext(); + } + } + } + else + { + self.continueNext = false; + self.completionSource.TrySetResult(false); + } + } + else + { + self.continueNext = false; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs.meta new file mode 100644 index 00000000..06b1ede4 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: df1d7f44d4fe7754f972c9e0b6fa72d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs new file mode 100644 index 00000000..5a707bb3 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs @@ -0,0 +1,187 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable SkipUntil(this IUniTaskAsyncEnumerable source, UniTask other) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new SkipUntil(source, other, null); + } + + public static IUniTaskAsyncEnumerable SkipUntil(this IUniTaskAsyncEnumerable source, Func other) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(other)); + + return new SkipUntil(source, default, other); + } + } + + internal sealed class SkipUntil : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly UniTask other; + readonly Func other2; + + public SkipUntil(IUniTaskAsyncEnumerable source, UniTask other, Func other2) + { + this.source = source; + this.other = other; + this.other2 = other2; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + if (other2 != null) + { + return new _SkipUntil(source, this.other2(cancellationToken), cancellationToken); + } + else + { + return new _SkipUntil(source, this.other, cancellationToken); + } + } + + sealed class _SkipUntil : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action CancelDelegate1 = OnCanceled1; + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + CancellationToken cancellationToken1; + + bool completed; + CancellationTokenRegistration cancellationTokenRegistration1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + bool continueNext; + Exception exception; + + public _SkipUntil(IUniTaskAsyncEnumerable source, UniTask other, CancellationToken cancellationToken1) + { + this.source = source; + this.cancellationToken1 = cancellationToken1; + if (cancellationToken1.CanBeCanceled) + { + this.cancellationTokenRegistration1 = cancellationToken1.RegisterWithoutCaptureExecutionContext(CancelDelegate1, this); + } + + TaskTracker.TrackActiveTask(this, 3); + RunOther(other).Forget(); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (exception != null) + { + return UniTask.FromException(exception); + } + + if (cancellationToken1.IsCancellationRequested) + { + return UniTask.FromCanceled(cancellationToken1); + } + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken1); + } + completionSource.Reset(); + + if (completed) + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + try + { + LOOP: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + continueNext = true; + MoveNextCore(this); + if (continueNext) + { + continueNext = false; + goto LOOP; + } + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void MoveNextCore(object state) + { + var self = (_SkipUntil)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.Current = self.enumerator.Current; + self.completionSource.TrySetResult(true); + if (self.continueNext) + { + self.SourceMoveNext(); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + async UniTaskVoid RunOther(UniTask other) + { + try + { + await other; + completed = true; + SourceMoveNext(); + } + catch (Exception ex) + { + exception = ex; + completionSource.TrySetException(ex); + } + } + + static void OnCanceled1(object state) + { + var self = (_SkipUntil)state; + self.completionSource.TrySetCanceled(self.cancellationToken1); + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + cancellationTokenRegistration1.Dispose(); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs.meta new file mode 100644 index 00000000..0772ed01 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de932d79c8d9f3841a066d05ff29edc9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs new file mode 100644 index 00000000..f4c96798 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs @@ -0,0 +1,173 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable SkipUntilCanceled(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new SkipUntilCanceled(source, cancellationToken); + } + } + + internal sealed class SkipUntilCanceled : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly CancellationToken cancellationToken; + + public SkipUntilCanceled(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SkipUntilCanceled(source, this.cancellationToken, cancellationToken); + } + + sealed class _SkipUntilCanceled : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action CancelDelegate1 = OnCanceled1; + static readonly Action CancelDelegate2 = OnCanceled2; + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + CancellationToken cancellationToken1; + CancellationToken cancellationToken2; + CancellationTokenRegistration cancellationTokenRegistration1; + CancellationTokenRegistration cancellationTokenRegistration2; + + int isCanceled; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + bool continueNext; + + public _SkipUntilCanceled(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken1, CancellationToken cancellationToken2) + { + this.source = source; + this.cancellationToken1 = cancellationToken1; + this.cancellationToken2 = cancellationToken2; + if (cancellationToken1.CanBeCanceled) + { + this.cancellationTokenRegistration1 = cancellationToken1.RegisterWithoutCaptureExecutionContext(CancelDelegate1, this); + } + if (cancellationToken1 != cancellationToken2 && cancellationToken2.CanBeCanceled) + { + this.cancellationTokenRegistration2 = cancellationToken2.RegisterWithoutCaptureExecutionContext(CancelDelegate2, this); + } + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (enumerator == null) + { + if (cancellationToken1.IsCancellationRequested) isCanceled = 1; + if (cancellationToken2.IsCancellationRequested) isCanceled = 1; + enumerator = source.GetAsyncEnumerator(cancellationToken2); // use only AsyncEnumerator provided token. + } + completionSource.Reset(); + + if (isCanceled != 0) + { + SourceMoveNext(); + } + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + try + { + LOOP: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + continueNext = true; + MoveNextCore(this); + if (continueNext) + { + continueNext = false; + goto LOOP; + } + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void MoveNextCore(object state) + { + var self = (_SkipUntilCanceled)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.Current = self.enumerator.Current; + self.completionSource.TrySetResult(true); + if (self.continueNext) + { + self.SourceMoveNext(); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void OnCanceled1(object state) + { + var self = (_SkipUntilCanceled)state; + if (self.isCanceled == 0) + { + if (Interlocked.Increment(ref self.isCanceled) == 1) + { + self.cancellationTokenRegistration2.Dispose(); + self.SourceMoveNext(); + } + } + } + + static void OnCanceled2(object state) + { + var self = (_SkipUntilCanceled)state; + if (self.isCanceled == 0) + { + if (Interlocked.Increment(ref self.isCanceled) == 1) + { + self.cancellationTokenRegistration2.Dispose(); + self.SourceMoveNext(); + } + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + cancellationTokenRegistration1.Dispose(); + cancellationTokenRegistration2.Dispose(); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs.meta new file mode 100644 index 00000000..9f67181d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b1a778aef7150d47b93a49aa1bc34ae +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs new file mode 100644 index 00000000..771a2e25 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs @@ -0,0 +1,379 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable SkipWhile(this IUniTaskAsyncEnumerable source, Func predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new SkipWhile(source, predicate); + } + + public static IUniTaskAsyncEnumerable SkipWhile(this IUniTaskAsyncEnumerable source, Func predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new SkipWhileInt(source, predicate); + } + + public static IUniTaskAsyncEnumerable SkipWhileAwait(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new SkipWhileAwait(source, predicate); + } + + public static IUniTaskAsyncEnumerable SkipWhileAwait(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new SkipWhileIntAwait(source, predicate); + } + + public static IUniTaskAsyncEnumerable SkipWhileAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new SkipWhileAwaitWithCancellation(source, predicate); + } + + public static IUniTaskAsyncEnumerable SkipWhileAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new SkipWhileIntAwaitWithCancellation(source, predicate); + } + } + + internal sealed class SkipWhile : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func predicate; + + public SkipWhile(IUniTaskAsyncEnumerable source, Func predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SkipWhile(source, predicate, cancellationToken); + } + + class _SkipWhile : AsyncEnumeratorBase + { + Func predicate; + + public _SkipWhile(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + if (predicate == null || !predicate(SourceCurrent)) + { + predicate = null; + Current = SourceCurrent; + result = true; + return true; + } + else + { + result = default; + return false; + } + } + + result = false; + return true; + } + } + } + + internal sealed class SkipWhileInt : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func predicate; + + public SkipWhileInt(IUniTaskAsyncEnumerable source, Func predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SkipWhileInt(source, predicate, cancellationToken); + } + + class _SkipWhileInt : AsyncEnumeratorBase + { + Func predicate; + int index; + + public _SkipWhileInt(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + if (predicate == null || !predicate(SourceCurrent, checked(index++))) + { + predicate = null; + Current = SourceCurrent; + result = true; + return true; + } + else + { + result = default; + return false; + } + } + + result = false; + return true; + } + } + } + + internal sealed class SkipWhileAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public SkipWhileAwait(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SkipWhileAwait(source, predicate, cancellationToken); + } + + class _SkipWhileAwait : AsyncEnumeratorAwaitSelectorBase + { + Func> predicate; + + public _SkipWhileAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + if (predicate == null) + { + return CompletedTasks.False; + } + + return predicate(sourceCurrent); + } + + protected override bool TrySetCurrentCore(bool awaitResult, out bool terminateIteration) + { + if (!awaitResult) + { + predicate = null; + Current = SourceCurrent; + terminateIteration= false; + return true; + } + else + { + terminateIteration= false; + return false; + } + } + } + } + + internal sealed class SkipWhileIntAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public SkipWhileIntAwait(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SkipWhileIntAwait(source, predicate, cancellationToken); + } + + class _SkipWhileIntAwait : AsyncEnumeratorAwaitSelectorBase + { + Func> predicate; + int index; + + public _SkipWhileIntAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + if (predicate == null) + { + return CompletedTasks.False; + } + + return predicate(sourceCurrent, checked(index++)); + } + + protected override bool TrySetCurrentCore(bool awaitResult, out bool terminateIteration) + { + terminateIteration= false; + if (!awaitResult) + { + predicate = null; + Current = SourceCurrent; + return true; + } + else + { + return false; + } + } + } + } + + internal sealed class SkipWhileAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public SkipWhileAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SkipWhileAwaitWithCancellation(source, predicate, cancellationToken); + } + + class _SkipWhileAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase + { + Func> predicate; + + public _SkipWhileAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + if (predicate == null) + { + return CompletedTasks.False; + } + + return predicate(sourceCurrent, cancellationToken); + } + + protected override bool TrySetCurrentCore(bool awaitResult, out bool terminateIteration) + { + terminateIteration= false; + if (!awaitResult) + { + predicate = null; + Current = SourceCurrent; + return true; + } + else + { + return false; + } + } + } + } + + internal sealed class SkipWhileIntAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public SkipWhileIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _SkipWhileIntAwaitWithCancellation(source, predicate, cancellationToken); + } + + class _SkipWhileIntAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase + { + Func> predicate; + int index; + + public _SkipWhileIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + if (predicate == null) + { + return CompletedTasks.False; + } + + return predicate(sourceCurrent, checked(index++), cancellationToken); + } + + protected override bool TrySetCurrentCore(bool awaitResult, out bool terminateIteration) + { + terminateIteration= false; + if (!awaitResult) + { + predicate = null; + Current = SourceCurrent; + return true; + } + else + { + return false; + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs.meta new file mode 100644 index 00000000..f2b210a9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/SkipWhile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0b74b9fe361bf7148b51a29c8b2561e8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Subscribe.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Subscribe.cs new file mode 100644 index 00000000..0785bc28 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Subscribe.cs @@ -0,0 +1,536 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; +using Subscribes = Cysharp.Threading.Tasks.Linq.Subscribe; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + // OnNext + + public static IDisposable Subscribe(this IUniTaskAsyncEnumerable source, Action action) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeCore(source, action, Subscribes.NopError, Subscribes.NopCompleted, cts.Token).Forget(); + return cts; + } + + public static IDisposable Subscribe(this IUniTaskAsyncEnumerable source, Func action) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeCore(source, action, Subscribes.NopError, Subscribes.NopCompleted, cts.Token).Forget(); + return cts; + } + + public static IDisposable Subscribe(this IUniTaskAsyncEnumerable source, Func action) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeCore(source, action, Subscribes.NopError, Subscribes.NopCompleted, cts.Token).Forget(); + return cts; + } + + public static void Subscribe(this IUniTaskAsyncEnumerable source, Action action, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + Subscribes.SubscribeCore(source, action, Subscribes.NopError, Subscribes.NopCompleted, cancellationToken).Forget(); + } + + public static void Subscribe(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + Subscribes.SubscribeCore(source, action, Subscribes.NopError, Subscribes.NopCompleted, cancellationToken).Forget(); + } + + public static void Subscribe(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(action, nameof(action)); + + Subscribes.SubscribeCore(source, action, Subscribes.NopError, Subscribes.NopCompleted, cancellationToken).Forget(); + } + + public static IDisposable SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, Subscribes.NopCompleted, cts.Token).Forget(); + return cts; + } + + public static void SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + + Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, Subscribes.NopCompleted, cancellationToken).Forget(); + } + + public static IDisposable SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, Subscribes.NopCompleted, cts.Token).Forget(); + return cts; + } + + public static void SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + + Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, Subscribes.NopCompleted, cancellationToken).Forget(); + } + + // OnNext, OnError + + public static IDisposable Subscribe(this IUniTaskAsyncEnumerable source, Action onNext, Action onError) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onError, nameof(onError)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeCore(source, onNext, onError, Subscribes.NopCompleted, cts.Token).Forget(); + return cts; + } + + public static IDisposable Subscribe(this IUniTaskAsyncEnumerable source, Func onNext, Action onError) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onError, nameof(onError)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeCore(source, onNext, onError, Subscribes.NopCompleted, cts.Token).Forget(); + return cts; + } + + public static void Subscribe(this IUniTaskAsyncEnumerable source, Action onNext, Action onError, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onError, nameof(onError)); + + Subscribes.SubscribeCore(source, onNext, onError, Subscribes.NopCompleted, cancellationToken).Forget(); + } + + public static void Subscribe(this IUniTaskAsyncEnumerable source, Func onNext, Action onError, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onError, nameof(onError)); + + Subscribes.SubscribeCore(source, onNext, onError, Subscribes.NopCompleted, cancellationToken).Forget(); + } + + public static IDisposable SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, Action onError) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onError, nameof(onError)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeAwaitCore(source, onNext, onError, Subscribes.NopCompleted, cts.Token).Forget(); + return cts; + } + + public static void SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, Action onError, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onError, nameof(onError)); + + Subscribes.SubscribeAwaitCore(source, onNext, onError, Subscribes.NopCompleted, cancellationToken).Forget(); + } + + public static IDisposable SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, Action onError) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onError, nameof(onError)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeAwaitCore(source, onNext, onError, Subscribes.NopCompleted, cts.Token).Forget(); + return cts; + } + + public static void SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, Action onError, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onError, nameof(onError)); + + Subscribes.SubscribeAwaitCore(source, onNext, onError, Subscribes.NopCompleted, cancellationToken).Forget(); + } + + // OnNext, OnCompleted + + public static IDisposable Subscribe(this IUniTaskAsyncEnumerable source, Action onNext, Action onCompleted) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onCompleted, nameof(onCompleted)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeCore(source, onNext, Subscribes.NopError, onCompleted, cts.Token).Forget(); + return cts; + } + + public static IDisposable Subscribe(this IUniTaskAsyncEnumerable source, Func onNext, Action onCompleted) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onCompleted, nameof(onCompleted)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeCore(source, onNext, Subscribes.NopError, onCompleted, cts.Token).Forget(); + return cts; + } + + public static void Subscribe(this IUniTaskAsyncEnumerable source, Action onNext, Action onCompleted, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onCompleted, nameof(onCompleted)); + + Subscribes.SubscribeCore(source, onNext, Subscribes.NopError, onCompleted, cancellationToken).Forget(); + } + + public static void Subscribe(this IUniTaskAsyncEnumerable source, Func onNext, Action onCompleted, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onCompleted, nameof(onCompleted)); + + Subscribes.SubscribeCore(source, onNext, Subscribes.NopError, onCompleted, cancellationToken).Forget(); + } + + public static IDisposable SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, Action onCompleted) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onCompleted, nameof(onCompleted)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, onCompleted, cts.Token).Forget(); + return cts; + } + + public static void SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, Action onCompleted, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onCompleted, nameof(onCompleted)); + + Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, onCompleted, cancellationToken).Forget(); + } + + public static IDisposable SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, Action onCompleted) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onCompleted, nameof(onCompleted)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, onCompleted, cts.Token).Forget(); + return cts; + } + + public static void SubscribeAwait(this IUniTaskAsyncEnumerable source, Func onNext, Action onCompleted, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(onNext, nameof(onNext)); + Error.ThrowArgumentNullException(onCompleted, nameof(onCompleted)); + + Subscribes.SubscribeAwaitCore(source, onNext, Subscribes.NopError, onCompleted, cancellationToken).Forget(); + } + + // IObserver + + public static IDisposable Subscribe(this IUniTaskAsyncEnumerable source, IObserver observer) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(observer, nameof(observer)); + + var cts = new CancellationTokenDisposable(); + Subscribes.SubscribeCore(source, observer, cts.Token).Forget(); + return cts; + } + + public static void Subscribe(this IUniTaskAsyncEnumerable source, IObserver observer, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(observer, nameof(observer)); + + Subscribes.SubscribeCore(source, observer, cancellationToken).Forget(); + } + } + + internal sealed class CancellationTokenDisposable : IDisposable + { + readonly CancellationTokenSource cts = new CancellationTokenSource(); + + public CancellationToken Token => cts.Token; + + public void Dispose() + { + if (!cts.IsCancellationRequested) + { + cts.Cancel(); + } + } + } + + internal static class Subscribe + { + public static readonly Action NopError = _ => { }; + public static readonly Action NopCompleted = () => { }; + + public static async UniTaskVoid SubscribeCore(IUniTaskAsyncEnumerable source, Action onNext, Action onError, Action onCompleted, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + try + { + onNext(e.Current); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + onCompleted(); + } + catch (Exception ex) + { + if (onError == NopError) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + return; + } + + if (ex is OperationCanceledException) return; + + onError(ex); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTaskVoid SubscribeCore(IUniTaskAsyncEnumerable source, Func onNext, Action onError, Action onCompleted, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + try + { + onNext(e.Current).Forget(); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + onCompleted(); + } + catch (Exception ex) + { + if (onError == NopError) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + return; + } + + if (ex is OperationCanceledException) return; + + onError(ex); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTaskVoid SubscribeCore(IUniTaskAsyncEnumerable source, Func onNext, Action onError, Action onCompleted, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + try + { + onNext(e.Current, cancellationToken).Forget(); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + onCompleted(); + } + catch (Exception ex) + { + if (onError == NopError) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + return; + } + + if (ex is OperationCanceledException) return; + + onError(ex); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTaskVoid SubscribeCore(IUniTaskAsyncEnumerable source, IObserver observer, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + try + { + observer.OnNext(e.Current); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + observer.OnCompleted(); + } + catch (Exception ex) + { + if (ex is OperationCanceledException) return; + + observer.OnError(ex); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTaskVoid SubscribeAwaitCore(IUniTaskAsyncEnumerable source, Func onNext, Action onError, Action onCompleted, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + try + { + await onNext(e.Current); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + onCompleted(); + } + catch (Exception ex) + { + if (onError == NopError) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + return; + } + + if (ex is OperationCanceledException) return; + + onError(ex); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + public static async UniTaskVoid SubscribeAwaitCore(IUniTaskAsyncEnumerable source, Func onNext, Action onError, Action onCompleted, CancellationToken cancellationToken) + { + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + try + { + await onNext(e.Current, cancellationToken); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + onCompleted(); + } + catch (Exception ex) + { + if (onError == NopError) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + return; + } + + if (ex is OperationCanceledException) return; + + onError(ex); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Subscribe.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Subscribe.cs.meta new file mode 100644 index 00000000..ea835671 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Subscribe.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 263479eb04c189741931fc0e2f615c2d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs new file mode 100644 index 00000000..1101cd7f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs @@ -0,0 +1,1244 @@ +using System; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Sum.SumAsync(source, cancellationToken); + } + + public static UniTask SumAsync(this IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitAsync(source, selector, cancellationToken); + } + + public static UniTask SumAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(selector)); + + return Sum.SumAwaitWithCancellationAsync(source, selector, cancellationToken); + } + + } + + internal static class Sum + { + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int32 sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current; + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int32 sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32 sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32 sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int64 sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current; + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int64 sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64 sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64 sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Single sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current; + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Single sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Double sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current; + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Double sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Decimal sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current; + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Decimal sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int32? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current.GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int32? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int32? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Int64? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current.GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Int64? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Int64? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Single? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current.GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Single? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Single? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Double? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current.GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Double? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Double? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Decimal? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += e.Current.GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAsync(IUniTaskAsyncEnumerable source, Func selector, CancellationToken cancellationToken) + { + Decimal? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += selector(e.Current).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + public static async UniTask SumAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> selector, CancellationToken cancellationToken) + { + Decimal? sum = default; + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + sum += (await selector(e.Current, cancellationToken)).GetValueOrDefault(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return sum; + } + + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs.meta new file mode 100644 index 00000000..5331e349 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Sum.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4149754066a21a341be58c04357061f6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Take.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Take.cs new file mode 100644 index 00000000..6cd4eda6 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Take.cs @@ -0,0 +1,124 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Take(this IUniTaskAsyncEnumerable source, Int32 count) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new Take(source, count); + } + } + + internal sealed class Take : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly int count; + + public Take(IUniTaskAsyncEnumerable source, int count) + { + this.source = source; + this.count = count; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Take(source, count, cancellationToken); + } + + sealed class _Take : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + readonly int count; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + int index; + + public _Take(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + { + this.source = source; + this.count = count; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + } + + if (checked(index) >= count) + { + return CompletedTasks.False; + } + + completionSource.Reset(); + SourceMoveNext(); + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + try + { + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + MoveNextCore(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void MoveNextCore(object state) + { + var self = (_Take)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + self.index++; + self.Current = self.enumerator.Current; + self.completionSource.TrySetResult(true); + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Take.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Take.cs.meta new file mode 100644 index 00000000..1cc91ab0 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Take.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42f02cb84e5875b488304755d0e1383d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs new file mode 100644 index 00000000..ca0084e9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs @@ -0,0 +1,175 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable TakeLast(this IUniTaskAsyncEnumerable source, Int32 count) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + // non take. + if (count <= 0) + { + return Empty(); + } + + return new TakeLast(source, count); + } + } + + internal sealed class TakeLast : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly int count; + + public TakeLast(IUniTaskAsyncEnumerable source, int count) + { + this.source = source; + this.count = count; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _TakeLast(source, count, cancellationToken); + } + + sealed class _TakeLast : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + readonly int count; + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + Queue queue; + + bool iterateCompleted; + bool continueNext; + + public _TakeLast(IUniTaskAsyncEnumerable source, int count, CancellationToken cancellationToken) + { + this.source = source; + this.count = count; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken); + queue = new Queue(); + } + + completionSource.Reset(); + SourceMoveNext(); + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + if (iterateCompleted) + { + if (queue.Count > 0) + { + Current = queue.Dequeue(); + completionSource.TrySetResult(true); + } + else + { + completionSource.TrySetResult(false); + } + + return; + } + + try + { + LOOP: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + continueNext = true; + MoveNextCore(this); + if (continueNext) + { + continueNext = false; + goto LOOP; // avoid recursive + } + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + + static void MoveNextCore(object state) + { + var self = (_TakeLast)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + if (self.queue.Count < self.count) + { + self.queue.Enqueue(self.enumerator.Current); + + if (!self.continueNext) + { + self.SourceMoveNext(); + } + } + else + { + self.queue.Dequeue(); + self.queue.Enqueue(self.enumerator.Current); + + if (!self.continueNext) + { + self.SourceMoveNext(); + } + } + } + else + { + self.continueNext = false; + self.iterateCompleted = true; + self.SourceMoveNext(); + } + } + else + { + self.continueNext = false; + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs.meta new file mode 100644 index 00000000..d80037f4 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeLast.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 510aa9fd35b45fc40bcdb7e59f01fd1b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntil.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntil.cs new file mode 100644 index 00000000..25371ad9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntil.cs @@ -0,0 +1,190 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable TakeUntil(this IUniTaskAsyncEnumerable source, UniTask other) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new TakeUntil(source, other, null); + } + + public static IUniTaskAsyncEnumerable TakeUntil(this IUniTaskAsyncEnumerable source, Func other) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(source, nameof(other)); + + return new TakeUntil(source, default, other); + } + } + + internal sealed class TakeUntil : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly UniTask other; + readonly Func other2; + + public TakeUntil(IUniTaskAsyncEnumerable source, UniTask other, Func other2) + { + this.source = source; + this.other = other; + this.other2 = other2; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + if (other2 != null) + { + return new _TakeUntil(source, this.other2(cancellationToken), cancellationToken); + } + else + { + return new _TakeUntil(source, this.other, cancellationToken); + } + } + + sealed class _TakeUntil : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action CancelDelegate1 = OnCanceled1; + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + CancellationToken cancellationToken1; + CancellationTokenRegistration cancellationTokenRegistration1; + + bool completed; + Exception exception; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + + public _TakeUntil(IUniTaskAsyncEnumerable source, UniTask other, CancellationToken cancellationToken1) + { + this.source = source; + this.cancellationToken1 = cancellationToken1; + + if (cancellationToken1.CanBeCanceled) + { + this.cancellationTokenRegistration1 = cancellationToken1.RegisterWithoutCaptureExecutionContext(CancelDelegate1, this); + } + + TaskTracker.TrackActiveTask(this, 3); + + RunOther(other).Forget(); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (completed) + { + return CompletedTasks.False; + } + + if (exception != null) + { + return UniTask.FromException(exception); + } + + if (cancellationToken1.IsCancellationRequested) + { + return UniTask.FromCanceled(cancellationToken1); + } + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken1); + } + + completionSource.Reset(); + SourceMoveNext(); + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + try + { + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + MoveNextCore(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void MoveNextCore(object state) + { + var self = (_TakeUntil)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + if (self.exception != null) + { + self.completionSource.TrySetException(self.exception); + } + else if (self.cancellationToken1.IsCancellationRequested) + { + self.completionSource.TrySetCanceled(self.cancellationToken1); + } + else + { + self.Current = self.enumerator.Current; + self.completionSource.TrySetResult(true); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + async UniTaskVoid RunOther(UniTask other) + { + try + { + await other; + completed = true; + completionSource.TrySetResult(false); + } + catch (Exception ex) + { + exception = ex; + completionSource.TrySetException(ex); + } + } + + static void OnCanceled1(object state) + { + var self = (_TakeUntil)state; + self.completionSource.TrySetCanceled(self.cancellationToken1); + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + cancellationTokenRegistration1.Dispose(); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntil.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntil.cs.meta new file mode 100644 index 00000000..44cf63e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 12bda324162f15349afefc2c152ac07f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntilCanceled.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntilCanceled.cs new file mode 100644 index 00000000..67ee3c8c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntilCanceled.cs @@ -0,0 +1,164 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable TakeUntilCanceled(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new TakeUntilCanceled(source, cancellationToken); + } + } + + internal sealed class TakeUntilCanceled : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly CancellationToken cancellationToken; + + public TakeUntilCanceled(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _TakeUntilCanceled(source, this.cancellationToken, cancellationToken); + } + + sealed class _TakeUntilCanceled : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action CancelDelegate1 = OnCanceled1; + static readonly Action CancelDelegate2 = OnCanceled2; + static readonly Action MoveNextCoreDelegate = MoveNextCore; + + readonly IUniTaskAsyncEnumerable source; + CancellationToken cancellationToken1; + CancellationToken cancellationToken2; + CancellationTokenRegistration cancellationTokenRegistration1; + CancellationTokenRegistration cancellationTokenRegistration2; + + bool isCanceled; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + + public _TakeUntilCanceled(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken1, CancellationToken cancellationToken2) + { + this.source = source; + this.cancellationToken1 = cancellationToken1; + this.cancellationToken2 = cancellationToken2; + + if (cancellationToken1.CanBeCanceled) + { + this.cancellationTokenRegistration1 = cancellationToken1.RegisterWithoutCaptureExecutionContext(CancelDelegate1, this); + } + + if (cancellationToken1 != cancellationToken2 && cancellationToken2.CanBeCanceled) + { + this.cancellationTokenRegistration2 = cancellationToken2.RegisterWithoutCaptureExecutionContext(CancelDelegate2, this); + } + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (cancellationToken1.IsCancellationRequested) isCanceled = true; + if (cancellationToken2.IsCancellationRequested) isCanceled = true; + + if (enumerator == null) + { + enumerator = source.GetAsyncEnumerator(cancellationToken2); // use only AsyncEnumerator provided token. + } + + if (isCanceled) return CompletedTasks.False; + + completionSource.Reset(); + SourceMoveNext(); + return new UniTask(this, completionSource.Version); + } + + void SourceMoveNext() + { + try + { + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + MoveNextCore(this); + } + else + { + awaiter.SourceOnCompleted(MoveNextCoreDelegate, this); + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + } + } + + static void MoveNextCore(object state) + { + var self = (_TakeUntilCanceled)state; + + if (self.TryGetResult(self.awaiter, out var result)) + { + if (result) + { + if (self.isCanceled) + { + self.completionSource.TrySetResult(false); + } + else + { + self.Current = self.enumerator.Current; + self.completionSource.TrySetResult(true); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void OnCanceled1(object state) + { + var self = (_TakeUntilCanceled)state; + if (!self.isCanceled) + { + self.cancellationTokenRegistration2.Dispose(); + self.completionSource.TrySetResult(false); + } + } + + static void OnCanceled2(object state) + { + var self = (_TakeUntilCanceled)state; + if (!self.isCanceled) + { + self.cancellationTokenRegistration1.Dispose(); + self.completionSource.TrySetResult(false); + } + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + cancellationTokenRegistration1.Dispose(); + cancellationTokenRegistration2.Dispose(); + if (enumerator != null) + { + return enumerator.DisposeAsync(); + } + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntilCanceled.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntilCanceled.cs.meta new file mode 100644 index 00000000..4a89be54 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeUntilCanceled.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e82f498cf3a1df04cbf646773fc11319 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs new file mode 100644 index 00000000..6239c776 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs @@ -0,0 +1,342 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable TakeWhile(this IUniTaskAsyncEnumerable source, Func predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new TakeWhile(source, predicate); + } + + public static IUniTaskAsyncEnumerable TakeWhile(this IUniTaskAsyncEnumerable source, Func predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new TakeWhileInt(source, predicate); + } + + public static IUniTaskAsyncEnumerable TakeWhileAwait(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new TakeWhileAwait(source, predicate); + } + + public static IUniTaskAsyncEnumerable TakeWhileAwait(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new TakeWhileIntAwait(source, predicate); + } + + public static IUniTaskAsyncEnumerable TakeWhileAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new TakeWhileAwaitWithCancellation(source, predicate); + } + + public static IUniTaskAsyncEnumerable TakeWhileAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new TakeWhileIntAwaitWithCancellation(source, predicate); + } + } + + internal sealed class TakeWhile : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func predicate; + + public TakeWhile(IUniTaskAsyncEnumerable source, Func predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _TakeWhile(source, predicate, cancellationToken); + } + + class _TakeWhile : AsyncEnumeratorBase + { + Func predicate; + + public _TakeWhile(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + if (predicate(SourceCurrent)) + { + Current = SourceCurrent; + result = true; + return true; + } + } + + result = false; + return true; + } + } + } + + internal sealed class TakeWhileInt : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func predicate; + + public TakeWhileInt(IUniTaskAsyncEnumerable source, Func predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _TakeWhileInt(source, predicate, cancellationToken); + } + + class _TakeWhileInt : AsyncEnumeratorBase + { + readonly Func predicate; + int index; + + public _TakeWhileInt(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override bool TryMoveNextCore(bool sourceHasCurrent, out bool result) + { + if (sourceHasCurrent) + { + if (predicate(SourceCurrent, checked(index++))) + { + Current = SourceCurrent; + result = true; + return true; + } + } + + result = false; + return true; + } + } + } + + internal sealed class TakeWhileAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public TakeWhileAwait(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _TakeWhileAwait(source, predicate, cancellationToken); + } + + class _TakeWhileAwait : AsyncEnumeratorAwaitSelectorBase + { + Func> predicate; + + public _TakeWhileAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + return predicate(sourceCurrent); + } + + protected override bool TrySetCurrentCore(bool awaitResult, out bool terminateIteration) + { + if (awaitResult) + { + Current = SourceCurrent; + terminateIteration = false; + return true; + } + else + { + terminateIteration = true; + return false; + } + } + } + } + + internal sealed class TakeWhileIntAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public TakeWhileIntAwait(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _TakeWhileIntAwait(source, predicate, cancellationToken); + } + + class _TakeWhileIntAwait : AsyncEnumeratorAwaitSelectorBase + { + readonly Func> predicate; + int index; + + public _TakeWhileIntAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + return predicate(sourceCurrent, checked(index++)); + } + + protected override bool TrySetCurrentCore(bool awaitResult, out bool terminateIteration) + { + if (awaitResult) + { + Current = SourceCurrent; + terminateIteration = false; + return true; + } + else + { + terminateIteration = true; + return false; + } + } + } + } + + internal sealed class TakeWhileAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public TakeWhileAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _TakeWhileAwaitWithCancellation(source, predicate, cancellationToken); + } + + class _TakeWhileAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase + { + Func> predicate; + + public _TakeWhileAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + return predicate(sourceCurrent, cancellationToken); + } + + protected override bool TrySetCurrentCore(bool awaitResult, out bool terminateIteration) + { + if (awaitResult) + { + Current = SourceCurrent; + terminateIteration = false; + return true; + } + else + { + terminateIteration = true; + return false; + } + } + } + } + + internal sealed class TakeWhileIntAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public TakeWhileIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _TakeWhileIntAwaitWithCancellation(source, predicate, cancellationToken); + } + + class _TakeWhileIntAwaitWithCancellation : AsyncEnumeratorAwaitSelectorBase + { + readonly Func> predicate; + int index; + + public _TakeWhileIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + : base(source, cancellationToken) + { + this.predicate = predicate; + } + + protected override UniTask TransformAsync(TSource sourceCurrent) + { + return predicate(sourceCurrent, checked(index++), cancellationToken); + } + + protected override bool TrySetCurrentCore(bool awaitResult, out bool terminateIteration) + { + if (awaitResult) + { + Current = SourceCurrent; + terminateIteration = false; + return true; + } + else + { + terminateIteration = true; + return false; + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs.meta new file mode 100644 index 00000000..f2173d59 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/TakeWhile.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bca55adabcc4b3141b50b8b09634f764 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs new file mode 100644 index 00000000..b6994c46 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs @@ -0,0 +1,54 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Throw(Exception exception) + { + return new Throw(exception); + } + } + + internal class Throw : IUniTaskAsyncEnumerable + { + readonly Exception exception; + + public Throw(Exception exception) + { + this.exception = exception; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Throw(exception, cancellationToken); + } + + class _Throw : IUniTaskAsyncEnumerator + { + readonly Exception exception; + CancellationToken cancellationToken; + + public _Throw(Exception exception, CancellationToken cancellationToken) + { + this.exception = exception; + this.cancellationToken = cancellationToken; + } + + public TValue Current => default; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + return UniTask.FromException(exception); + } + + public UniTask DisposeAsync() + { + return default; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs.meta new file mode 100644 index 00000000..c768ef1e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Throw.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9d05a7d4f4161e549b4789e1022baae8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs new file mode 100644 index 00000000..35549681 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs @@ -0,0 +1,60 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask ToArrayAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Cysharp.Threading.Tasks.Linq.ToArray.ToArrayAsync(source, cancellationToken); + } + } + + internal static class ToArray + { + internal static async UniTask ToArrayAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + var pool = ArrayPool.Shared; + var array = pool.Rent(16); + + TSource[] result = default; + IUniTaskAsyncEnumerator e = default; + try + { + e = source.GetAsyncEnumerator(cancellationToken); + var i = 0; + while (await e.MoveNextAsync()) + { + ArrayPoolUtil.EnsureCapacity(ref array, i, pool); + array[i++] = e.Current; + } + + if (i == 0) + { + result = Array.Empty(); + } + else + { + result = new TSource[i]; + Array.Copy(array, result, i); + } + } + finally + { + pool.Return(array, clearArray: !RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + + if (e != null) + { + await e.DisposeAsync(); + } + } + + return result; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs.meta new file mode 100644 index 00000000..679d61c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: debb010bbb1622e43b94fe70ec0133dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs new file mode 100644 index 00000000..083ace0c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs @@ -0,0 +1,278 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask> ToDictionaryAsync(this IUniTaskAsyncEnumerable source, Func keySelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return ToDictionary.ToDictionaryAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToDictionaryAsync(this IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToDictionary.ToDictionaryAsync(source, keySelector, comparer, cancellationToken); + } + + public static UniTask> ToDictionaryAsync(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + + return ToDictionary.ToDictionaryAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToDictionaryAsync(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToDictionary.ToDictionaryAsync(source, keySelector, elementSelector, comparer, cancellationToken); + } + + public static UniTask> ToDictionaryAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return ToDictionary.ToDictionaryAwaitAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToDictionaryAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToDictionary.ToDictionaryAwaitAsync(source, keySelector, comparer, cancellationToken); + } + + public static UniTask> ToDictionaryAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + + return ToDictionary.ToDictionaryAwaitAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToDictionaryAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToDictionary.ToDictionaryAwaitAsync(source, keySelector, elementSelector, comparer, cancellationToken); + } + + public static UniTask> ToDictionaryAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToDictionaryAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, comparer, cancellationToken); + } + + public static UniTask> ToDictionaryAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + + return ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToDictionaryAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToDictionary.ToDictionaryAwaitWithCancellationAsync(source, keySelector, elementSelector, comparer, cancellationToken); + } + } + + internal static class ToDictionary + { + internal static async UniTask> ToDictionaryAsync(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var dict = new Dictionary(comparer); + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + var key = keySelector(v); + dict.Add(key, v); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return dict; + } + + internal static async UniTask> ToDictionaryAsync(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var dict = new Dictionary(comparer); + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + var key = keySelector(v); + var value = elementSelector(v); + dict.Add(key, value); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return dict; + } + + // with await + + internal static async UniTask> ToDictionaryAwaitAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var dict = new Dictionary(comparer); + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + var key = await keySelector(v); + dict.Add(key, v); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return dict; + } + + internal static async UniTask> ToDictionaryAwaitAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var dict = new Dictionary(comparer); + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + var key = await keySelector(v); + var value = await elementSelector(v); + dict.Add(key, value); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return dict; + } + + // with cancellation + + internal static async UniTask> ToDictionaryAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var dict = new Dictionary(comparer); + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + var key = await keySelector(v, cancellationToken); + dict.Add(key, v); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return dict; + } + + internal static async UniTask> ToDictionaryAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var dict = new Dictionary(comparer); + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + var v = e.Current; + var key = await keySelector(v, cancellationToken); + var value = await elementSelector(v, cancellationToken); + dict.Add(key, value); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return dict; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs.meta new file mode 100644 index 00000000..4deed194 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToDictionary.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 03b109b1fe1f2df46aa56ffb26747654 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs new file mode 100644 index 00000000..d058cb1d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs @@ -0,0 +1,50 @@ +using Cysharp.Threading.Tasks.Internal; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask> ToHashSetAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Cysharp.Threading.Tasks.Linq.ToHashSet.ToHashSetAsync(source, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToHashSetAsync(this IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return Cysharp.Threading.Tasks.Linq.ToHashSet.ToHashSetAsync(source, comparer, cancellationToken); + } + } + + internal static class ToHashSet + { + internal static async UniTask> ToHashSetAsync(IUniTaskAsyncEnumerable source, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var set = new HashSet(comparer); + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + set.Add(e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return set; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs.meta new file mode 100644 index 00000000..8d3c4af2 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToHashSet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7a3e552113af96e4986805ec3c4fc80a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs new file mode 100644 index 00000000..e6fa35e1 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs @@ -0,0 +1,42 @@ +using Cysharp.Threading.Tasks.Internal; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask> ToListAsync(this IUniTaskAsyncEnumerable source, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return Cysharp.Threading.Tasks.Linq.ToList.ToListAsync(source, cancellationToken); + } + } + + internal static class ToList + { + internal static async UniTask> ToListAsync(IUniTaskAsyncEnumerable source, CancellationToken cancellationToken) + { + var list = new List(); + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (await e.MoveNextAsync()) + { + list.Add(e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + + return list; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs.meta new file mode 100644 index 00000000..4f093738 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToList.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3859c1b31e81d9b44b282e7d97e11635 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs new file mode 100644 index 00000000..015c1c07 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs @@ -0,0 +1,554 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static UniTask> ToLookupAsync(this IUniTaskAsyncEnumerable source, Func keySelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return ToLookup.ToLookupAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToLookupAsync(this IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToLookup.ToLookupAsync(source, keySelector, comparer, cancellationToken); + } + + public static UniTask> ToLookupAsync(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + + return ToLookup.ToLookupAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToLookupAsync(this IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToLookup.ToLookupAsync(source, keySelector, elementSelector, comparer, cancellationToken); + } + + public static UniTask> ToLookupAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return ToLookup.ToLookupAwaitAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToLookupAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToLookup.ToLookupAwaitAsync(source, keySelector, comparer, cancellationToken); + } + + public static UniTask> ToLookupAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + + return ToLookup.ToLookupAwaitAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToLookupAwaitAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToLookup.ToLookupAwaitAsync(source, keySelector, elementSelector, comparer, cancellationToken); + } + + public static UniTask> ToLookupAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + + return ToLookup.ToLookupAwaitWithCancellationAsync(source, keySelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToLookupAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToLookup.ToLookupAwaitWithCancellationAsync(source, keySelector, comparer, cancellationToken); + } + + public static UniTask> ToLookupAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + + return ToLookup.ToLookupAwaitWithCancellationAsync(source, keySelector, elementSelector, EqualityComparer.Default, cancellationToken); + } + + public static UniTask> ToLookupAwaitWithCancellationAsync(this IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(keySelector, nameof(keySelector)); + Error.ThrowArgumentNullException(elementSelector, nameof(elementSelector)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + return ToLookup.ToLookupAwaitWithCancellationAsync(source, keySelector, elementSelector, comparer, cancellationToken); + } + } + + internal static class ToLookup + { + internal static async UniTask> ToLookupAsync(IUniTaskAsyncEnumerable source, Func keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var pool = ArrayPool.Shared; + var array = pool.Rent(16); + + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + var i = 0; + while (await e.MoveNextAsync()) + { + ArrayPoolUtil.EnsureCapacity(ref array, i, pool); + array[i++] = e.Current; + } + + if (i == 0) + { + return Lookup.CreateEmpty(); + } + else + { + return Lookup.Create(new ArraySegment(array, 0, i), keySelector, comparer); + } + } + finally + { + pool.Return(array, clearArray: !RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask> ToLookupAsync(IUniTaskAsyncEnumerable source, Func keySelector, Func elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var pool = ArrayPool.Shared; + var array = pool.Rent(16); + + IUniTaskAsyncEnumerator e = default; + try + { + e = source.GetAsyncEnumerator(cancellationToken); + var i = 0; + while (await e.MoveNextAsync()) + { + ArrayPoolUtil.EnsureCapacity(ref array, i, pool); + array[i++] = e.Current; + } + + if (i == 0) + { + return Lookup.CreateEmpty(); + } + else + { + return Lookup.Create(new ArraySegment(array, 0, i), keySelector, elementSelector, comparer); + } + } + finally + { + pool.Return(array, clearArray: !RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + + // with await + + internal static async UniTask> ToLookupAwaitAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var pool = ArrayPool.Shared; + var array = pool.Rent(16); + + IUniTaskAsyncEnumerator e = default; + try + { + e = source.GetAsyncEnumerator(cancellationToken); + var i = 0; + while (await e.MoveNextAsync()) + { + ArrayPoolUtil.EnsureCapacity(ref array, i, pool); + array[i++] = e.Current; + } + + if (i == 0) + { + return Lookup.CreateEmpty(); + } + else + { + return await Lookup.CreateAsync(new ArraySegment(array, 0, i), keySelector, comparer); + } + } + finally + { + pool.Return(array, clearArray: !RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask> ToLookupAwaitAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var pool = ArrayPool.Shared; + var array = pool.Rent(16); + + IUniTaskAsyncEnumerator e = default; + try + { + e = source.GetAsyncEnumerator(cancellationToken); + var i = 0; + while (await e.MoveNextAsync()) + { + ArrayPoolUtil.EnsureCapacity(ref array, i, pool); + array[i++] = e.Current; + } + + if (i == 0) + { + return Lookup.CreateEmpty(); + } + else + { + return await Lookup.CreateAsync(new ArraySegment(array, 0, i), keySelector, elementSelector, comparer); + } + } + finally + { + pool.Return(array, clearArray: !RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + // with cancellation + + internal static async UniTask> ToLookupAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var pool = ArrayPool.Shared; + var array = pool.Rent(16); + + IUniTaskAsyncEnumerator e = default; + try + { + e = source.GetAsyncEnumerator(cancellationToken); + var i = 0; + while (await e.MoveNextAsync()) + { + ArrayPoolUtil.EnsureCapacity(ref array, i, pool); + array[i++] = e.Current; + } + + if (i == 0) + { + return Lookup.CreateEmpty(); + } + else + { + return await Lookup.CreateAsync(new ArraySegment(array, 0, i), keySelector, comparer, cancellationToken); + } + } + finally + { + pool.Return(array, clearArray: !RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal static async UniTask> ToLookupAwaitWithCancellationAsync(IUniTaskAsyncEnumerable source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var pool = ArrayPool.Shared; + var array = pool.Rent(16); + + IUniTaskAsyncEnumerator e = default; + try + { + e = source.GetAsyncEnumerator(cancellationToken); + var i = 0; + while (await e.MoveNextAsync()) + { + ArrayPoolUtil.EnsureCapacity(ref array, i, pool); + array[i++] = e.Current; + } + + if (i == 0) + { + return Lookup.CreateEmpty(); + } + else + { + return await Lookup.CreateAsync(new ArraySegment(array, 0, i), keySelector, elementSelector, comparer, cancellationToken); + } + } + finally + { + pool.Return(array, clearArray: !RuntimeHelpersAbstraction.IsWellKnownNoReferenceContainsType()); + + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + // Lookup + + class Lookup : ILookup + { + static readonly Lookup empty = new Lookup(new Dictionary>()); + + // original lookup keeps order but this impl does not(dictionary not guarantee) + readonly Dictionary> dict; + + Lookup(Dictionary> dict) + { + this.dict = dict; + } + + public static Lookup CreateEmpty() + { + return empty; + } + + public static Lookup Create(ArraySegment source, Func keySelector, IEqualityComparer comparer) + { + var dict = new Dictionary>(comparer); + + var arr = source.Array; + var c = source.Count; + for (int i = source.Offset; i < c; i++) + { + var key = keySelector(arr[i]); + + if (!dict.TryGetValue(key, out var list)) + { + list = new Grouping(key); + dict[key] = list; + } + + list.Add(arr[i]); + } + + return new Lookup(dict); + } + + public static Lookup Create(ArraySegment source, Func keySelector, Func elementSelector, IEqualityComparer comparer) + { + var dict = new Dictionary>(comparer); + + var arr = source.Array; + var c = source.Count; + for (int i = source.Offset; i < c; i++) + { + var key = keySelector(arr[i]); + var elem = elementSelector(arr[i]); + + if (!dict.TryGetValue(key, out var list)) + { + list = new Grouping(key); + dict[key] = list; + } + + list.Add(elem); + } + + return new Lookup(dict); + } + + public static async UniTask> CreateAsync(ArraySegment source, Func> keySelector, IEqualityComparer comparer) + { + var dict = new Dictionary>(comparer); + + var arr = source.Array; + var c = source.Count; + for (int i = source.Offset; i < c; i++) + { + var key = await keySelector(arr[i]); + + if (!dict.TryGetValue(key, out var list)) + { + list = new Grouping(key); + dict[key] = list; + } + + list.Add(arr[i]); + } + + return new Lookup(dict); + } + + public static async UniTask> CreateAsync(ArraySegment source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer) + { + var dict = new Dictionary>(comparer); + + var arr = source.Array; + var c = source.Count; + for (int i = source.Offset; i < c; i++) + { + var key = await keySelector(arr[i]); + var elem = await elementSelector(arr[i]); + + if (!dict.TryGetValue(key, out var list)) + { + list = new Grouping(key); + dict[key] = list; + } + + list.Add(elem); + } + + return new Lookup(dict); + } + + public static async UniTask> CreateAsync(ArraySegment source, Func> keySelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var dict = new Dictionary>(comparer); + + var arr = source.Array; + var c = source.Count; + for (int i = source.Offset; i < c; i++) + { + var key = await keySelector(arr[i], cancellationToken); + + if (!dict.TryGetValue(key, out var list)) + { + list = new Grouping(key); + dict[key] = list; + } + + list.Add(arr[i]); + } + + return new Lookup(dict); + } + + public static async UniTask> CreateAsync(ArraySegment source, Func> keySelector, Func> elementSelector, IEqualityComparer comparer, CancellationToken cancellationToken) + { + var dict = new Dictionary>(comparer); + + var arr = source.Array; + var c = source.Count; + for (int i = source.Offset; i < c; i++) + { + var key = await keySelector(arr[i], cancellationToken); + var elem = await elementSelector(arr[i], cancellationToken); + + if (!dict.TryGetValue(key, out var list)) + { + list = new Grouping(key); + dict[key] = list; + } + + list.Add(elem); + } + + return new Lookup(dict); + } + + public IEnumerable this[TKey key] => dict.TryGetValue(key, out var g) ? g : Enumerable.Empty(); + + public int Count => dict.Count; + + public bool Contains(TKey key) + { + return dict.ContainsKey(key); + } + + public IEnumerator> GetEnumerator() + { + return dict.Values.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return dict.Values.GetEnumerator(); + } + } + + class Grouping : IGrouping // , IUniTaskAsyncGrouping + { + readonly List elements; + + public TKey Key { get; private set; } + + public Grouping(TKey key) + { + this.Key = key; + this.elements = new List(); + } + + public void Add(TElement value) + { + elements.Add(value); + } + public IEnumerator GetEnumerator() + { + return elements.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return elements.GetEnumerator(); + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return this.ToUniTaskAsyncEnumerable().GetAsyncEnumerator(cancellationToken); + } + + public override string ToString() + { + return "Key: " + Key + ", Count: " + elements.Count; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs.meta new file mode 100644 index 00000000..7dd8ecd6 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 57da22563bcd6ca4aaf256d941de5cb0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToObservable.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToObservable.cs new file mode 100644 index 00000000..4f483887 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToObservable.cs @@ -0,0 +1,97 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IObservable ToObservable(this IUniTaskAsyncEnumerable source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new ToObservable(source); + } + } + + internal sealed class ToObservable : IObservable + { + readonly IUniTaskAsyncEnumerable source; + + public ToObservable(IUniTaskAsyncEnumerable source) + { + this.source = source; + } + + public IDisposable Subscribe(IObserver observer) + { + var ctd = new CancellationTokenDisposable(); + + RunAsync(source, observer, ctd.Token).Forget(); + + return ctd; + } + + static async UniTaskVoid RunAsync(IUniTaskAsyncEnumerable src, IObserver observer, CancellationToken cancellationToken) + { + // cancellationToken.IsCancellationRequested is called when Rx's Disposed. + // when disposed, finish silently. + + var e = src.GetAsyncEnumerator(cancellationToken); + try + { + bool hasNext; + + do + { + try + { + hasNext = await e.MoveNextAsync(); + } + catch (Exception ex) + { + if (cancellationToken.IsCancellationRequested) + { + return; + } + + observer.OnError(ex); + return; + } + + if (hasNext) + { + observer.OnNext(e.Current); + } + else + { + observer.OnCompleted(); + return; + } + } while (!cancellationToken.IsCancellationRequested); + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + internal sealed class CancellationTokenDisposable : IDisposable + { + readonly CancellationTokenSource cts = new CancellationTokenSource(); + + public CancellationToken Token => cts.Token; + + public void Dispose() + { + if (!cts.IsCancellationRequested) + { + cts.Cancel(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToObservable.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToObservable.cs.meta new file mode 100644 index 00000000..44d917e3 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToObservable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b4f6f48a532188e4c80b7ebe69aea3a8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs new file mode 100644 index 00000000..02523c6f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs @@ -0,0 +1,1115 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Runtime.ExceptionServices; +using System.Threading; +using System.Threading.Tasks; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable ToUniTaskAsyncEnumerable(this IEnumerable source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new ToUniTaskAsyncEnumerable(source); + } + + public static IUniTaskAsyncEnumerable ToUniTaskAsyncEnumerable(this Task source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new ToUniTaskAsyncEnumerableTask(source); + } + + public static IUniTaskAsyncEnumerable ToUniTaskAsyncEnumerable(this UniTask source) + { + return new ToUniTaskAsyncEnumerableUniTask(source); + } + + public static IUniTaskAsyncEnumerable ToUniTaskAsyncEnumerable(this IObservable source) + { + Error.ThrowArgumentNullException(source, nameof(source)); + + return new ToUniTaskAsyncEnumerableObservable(source); + } + } + + internal class ToUniTaskAsyncEnumerable : IUniTaskAsyncEnumerable + { + readonly IEnumerable source; + + public ToUniTaskAsyncEnumerable(IEnumerable source) + { + this.source = source; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _ToUniTaskAsyncEnumerable(source, cancellationToken); + } + + class _ToUniTaskAsyncEnumerable : IUniTaskAsyncEnumerator + { + readonly IEnumerable source; + CancellationToken cancellationToken; + + IEnumerator enumerator; + + public _ToUniTaskAsyncEnumerable(IEnumerable source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + } + + public T Current => enumerator.Current; + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (enumerator == null) + { + enumerator = source.GetEnumerator(); + } + + if (enumerator.MoveNext()) + { + return CompletedTasks.True; + } + + return CompletedTasks.False; + } + + public UniTask DisposeAsync() + { + enumerator.Dispose(); + return default; + } + } + } + + internal class ToUniTaskAsyncEnumerableTask : IUniTaskAsyncEnumerable + { + readonly Task source; + + public ToUniTaskAsyncEnumerableTask(Task source) + { + this.source = source; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _ToUniTaskAsyncEnumerableTask(source, cancellationToken); + } + + class _ToUniTaskAsyncEnumerableTask : IUniTaskAsyncEnumerator + { + readonly Task source; + CancellationToken cancellationToken; + + T current; + bool called; + + public _ToUniTaskAsyncEnumerableTask(Task source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + + this.called = false; + } + + public T Current => current; + + public async UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (called) + { + return false; + } + called = true; + + current = await source; + return true; + } + + public UniTask DisposeAsync() + { + return default; + } + } + } + + internal class ToUniTaskAsyncEnumerableUniTask : IUniTaskAsyncEnumerable + { + readonly UniTask source; + + public ToUniTaskAsyncEnumerableUniTask(UniTask source) + { + this.source = source; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _ToUniTaskAsyncEnumerableUniTask(source, cancellationToken); + } + + class _ToUniTaskAsyncEnumerableUniTask : IUniTaskAsyncEnumerator + { + readonly UniTask source; + CancellationToken cancellationToken; + + T current; + bool called; + + public _ToUniTaskAsyncEnumerableUniTask(UniTask source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + + this.called = false; + } + + public T Current => current; + + public async UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + + if (called) + { + return false; + } + called = true; + + current = await source; + return true; + } + + public UniTask DisposeAsync() + { + return default; + } + } + } + + internal class ToUniTaskAsyncEnumerableObservable : IUniTaskAsyncEnumerable + { + readonly IObservable source; + + public ToUniTaskAsyncEnumerableObservable(IObservable source) + { + this.source = source; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _ToUniTaskAsyncEnumerableObservable(source, cancellationToken); + } + + class _ToUniTaskAsyncEnumerableObservable : MoveNextSource, IUniTaskAsyncEnumerator, IObserver + { + static readonly Action OnCanceledDelegate = OnCanceled; + + readonly IObservable source; + CancellationToken cancellationToken; + + + bool useCachedCurrent; + T current; + bool subscribeCompleted; + readonly Queue queuedResult; + Exception error; + IDisposable subscription; + CancellationTokenRegistration cancellationTokenRegistration; + + public _ToUniTaskAsyncEnumerableObservable(IObservable source, CancellationToken cancellationToken) + { + this.source = source; + this.cancellationToken = cancellationToken; + this.queuedResult = new Queue(); + + if (cancellationToken.CanBeCanceled) + { + cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(OnCanceledDelegate, this); + } + } + + public T Current + { + get + { + if (useCachedCurrent) + { + return current; + } + + lock (queuedResult) + { + if (queuedResult.Count != 0) + { + current = queuedResult.Dequeue(); + useCachedCurrent = true; + return current; + } + else + { + return default; // undefined. + } + } + } + } + + public UniTask MoveNextAsync() + { + lock (queuedResult) + { + useCachedCurrent = false; + + if (cancellationToken.IsCancellationRequested) + { + return UniTask.FromCanceled(cancellationToken); + } + + if (subscription == null) + { + subscription = source.Subscribe(this); + } + + if (error != null) + { + return UniTask.FromException(error); + } + + if (queuedResult.Count != 0) + { + return CompletedTasks.True; + } + + if (subscribeCompleted) + { + return CompletedTasks.False; + } + + completionSource.Reset(); + return new UniTask(this, completionSource.Version); + } + } + + public UniTask DisposeAsync() + { + subscription.Dispose(); + cancellationTokenRegistration.Dispose(); + completionSource.Reset(); + return default; + } + + public void OnCompleted() + { + lock (queuedResult) + { + subscribeCompleted = true; + completionSource.TrySetResult(false); + } + } + + public void OnError(Exception error) + { + lock (queuedResult) + { + this.error = error; + completionSource.TrySetException(error); + } + } + + public void OnNext(T value) + { + lock (queuedResult) + { + queuedResult.Enqueue(value); + completionSource.TrySetResult(true); // include callback execution, too long lock? + } + } + + static void OnCanceled(object state) + { + var self = (_ToUniTaskAsyncEnumerableObservable)state; + lock (self.queuedResult) + { + self.completionSource.TrySetCanceled(self.cancellationToken); + } + } + } + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs.meta new file mode 100644 index 00000000..45fd3b08 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/ToUniTaskAsyncEnumerable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d7192de2a0581ec4db62962cc1404af5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UniTask.Linq.asmdef b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UniTask.Linq.asmdef new file mode 100644 index 00000000..db84553b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UniTask.Linq.asmdef @@ -0,0 +1,15 @@ +{ + "name": "UniTask.Linq", + "references": [ + "UniTask" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UniTask.Linq.asmdef.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UniTask.Linq.asmdef.meta new file mode 100644 index 00000000..1c85d19e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UniTask.Linq.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5c01796d064528144a599661eaab93a6 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Union.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Union.cs new file mode 100644 index 00000000..2ceefab1 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Union.cs @@ -0,0 +1,26 @@ +using Cysharp.Threading.Tasks.Internal; +using System.Collections.Generic; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Union(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + + return Union(first, second, EqualityComparer.Default); + } + + public static IUniTaskAsyncEnumerable Union(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, IEqualityComparer comparer) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + Error.ThrowArgumentNullException(comparer, nameof(comparer)); + + // improv without combinate? + return first.Concat(second).Distinct(comparer); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Union.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Union.cs.meta new file mode 100644 index 00000000..1d9c7adb --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Union.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ae57a55bdeba98b4f8ff234d98d7dd76 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions.meta new file mode 100644 index 00000000..5bc61d94 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a0a297b94526c2e44b0c8fd748d6774d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs new file mode 100644 index 00000000..8f091100 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs @@ -0,0 +1,100 @@ +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable EveryUpdate(PlayerLoopTiming updateTiming = PlayerLoopTiming.Update, bool cancelImmediately = false) + { + return new EveryUpdate(updateTiming, cancelImmediately); + } + } + + internal class EveryUpdate : IUniTaskAsyncEnumerable + { + readonly PlayerLoopTiming updateTiming; + readonly bool cancelImmediately; + + public EveryUpdate(PlayerLoopTiming updateTiming, bool cancelImmediately) + { + this.updateTiming = updateTiming; + this.cancelImmediately = cancelImmediately; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _EveryUpdate(updateTiming, cancellationToken, cancelImmediately); + } + + class _EveryUpdate : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem + { + readonly PlayerLoopTiming updateTiming; + readonly CancellationToken cancellationToken; + readonly CancellationTokenRegistration cancellationTokenRegistration; + + bool disposed; + + public _EveryUpdate(PlayerLoopTiming updateTiming, CancellationToken cancellationToken, bool cancelImmediately) + { + this.updateTiming = updateTiming; + this.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (_EveryUpdate)state; + source.completionSource.TrySetCanceled(source.cancellationToken); + }, this); + } + + TaskTracker.TrackActiveTask(this, 2); + PlayerLoopHelper.AddAction(updateTiming, this); + } + + public AsyncUnit Current => default; + + public UniTask MoveNextAsync() + { + if (disposed) return CompletedTasks.False; + + completionSource.Reset(); + + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + } + return new UniTask(this, completionSource.Version); + } + + public UniTask DisposeAsync() + { + if (!disposed) + { + cancellationTokenRegistration.Dispose(); + disposed = true; + TaskTracker.RemoveTracking(this); + } + return default; + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + return false; + } + + if (disposed) + { + completionSource.TrySetResult(false); + return false; + } + + completionSource.TrySetResult(true); + return true; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs.meta new file mode 100644 index 00000000..6336e0e3 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryUpdate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00520eb52e49b5b4e8d9870d6ff1aced +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryValueChanged.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryValueChanged.cs new file mode 100644 index 00000000..ef5739c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryValueChanged.cs @@ -0,0 +1,292 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections.Generic; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable EveryValueChanged(TTarget target, Func propertySelector, PlayerLoopTiming monitorTiming = PlayerLoopTiming.Update, IEqualityComparer equalityComparer = null, bool cancelImmediately = false) + where TTarget : class + { + var unityObject = target as UnityEngine.Object; + var isUnityObject = target is UnityEngine.Object; // don't use (unityObject == null) + + if (isUnityObject) + { + return new EveryValueChangedUnityObject(target, propertySelector, equalityComparer ?? UnityEqualityComparer.GetDefault(), monitorTiming, cancelImmediately); + } + else + { + return new EveryValueChangedStandardObject(target, propertySelector, equalityComparer ?? UnityEqualityComparer.GetDefault(), monitorTiming, cancelImmediately); + } + } + } + + internal sealed class EveryValueChangedUnityObject : IUniTaskAsyncEnumerable + { + readonly TTarget target; + readonly Func propertySelector; + readonly IEqualityComparer equalityComparer; + readonly PlayerLoopTiming monitorTiming; + readonly bool cancelImmediately; + + public EveryValueChangedUnityObject(TTarget target, Func propertySelector, IEqualityComparer equalityComparer, PlayerLoopTiming monitorTiming, bool cancelImmediately) + { + this.target = target; + this.propertySelector = propertySelector; + this.equalityComparer = equalityComparer; + this.monitorTiming = monitorTiming; + this.cancelImmediately = cancelImmediately; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _EveryValueChanged(target, propertySelector, equalityComparer, monitorTiming, cancellationToken, cancelImmediately); + } + + sealed class _EveryValueChanged : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem + { + readonly TTarget target; + readonly UnityEngine.Object targetAsUnityObject; + readonly IEqualityComparer equalityComparer; + readonly Func propertySelector; + readonly CancellationToken cancellationToken; + readonly CancellationTokenRegistration cancellationTokenRegistration; + + bool first; + TProperty currentValue; + bool disposed; + + public _EveryValueChanged(TTarget target, Func propertySelector, IEqualityComparer equalityComparer, PlayerLoopTiming monitorTiming, CancellationToken cancellationToken, bool cancelImmediately) + { + this.target = target; + this.targetAsUnityObject = target as UnityEngine.Object; + this.propertySelector = propertySelector; + this.equalityComparer = equalityComparer; + this.cancellationToken = cancellationToken; + this.first = true; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (_EveryValueChanged)state; + source.completionSource.TrySetCanceled(source.cancellationToken); + }, this); + } + + TaskTracker.TrackActiveTask(this, 2); + PlayerLoopHelper.AddAction(monitorTiming, this); + } + + public TProperty Current => currentValue; + + public UniTask MoveNextAsync() + { + if (disposed) return CompletedTasks.False; + + completionSource.Reset(); + + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + return new UniTask(this, completionSource.Version); + } + + if (first) + { + first = false; + if (targetAsUnityObject == null) + { + return CompletedTasks.False; + } + this.currentValue = propertySelector(target); + return CompletedTasks.True; + } + + return new UniTask(this, completionSource.Version); + } + + public UniTask DisposeAsync() + { + if (!disposed) + { + cancellationTokenRegistration.Dispose(); + disposed = true; + TaskTracker.RemoveTracking(this); + } + return default; + } + + public bool MoveNext() + { + if (disposed || targetAsUnityObject == null) + { + completionSource.TrySetResult(false); + DisposeAsync().Forget(); + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + return false; + } + TProperty nextValue = default(TProperty); + try + { + nextValue = propertySelector(target); + if (equalityComparer.Equals(currentValue, nextValue)) + { + return true; + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + DisposeAsync().Forget(); + return false; + } + + currentValue = nextValue; + completionSource.TrySetResult(true); + return true; + } + } + } + + internal sealed class EveryValueChangedStandardObject : IUniTaskAsyncEnumerable + where TTarget : class + { + readonly WeakReference target; + readonly Func propertySelector; + readonly IEqualityComparer equalityComparer; + readonly PlayerLoopTiming monitorTiming; + readonly bool cancelImmediately; + + public EveryValueChangedStandardObject(TTarget target, Func propertySelector, IEqualityComparer equalityComparer, PlayerLoopTiming monitorTiming, bool cancelImmediately) + { + this.target = new WeakReference(target, false); + this.propertySelector = propertySelector; + this.equalityComparer = equalityComparer; + this.monitorTiming = monitorTiming; + this.cancelImmediately = cancelImmediately; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _EveryValueChanged(target, propertySelector, equalityComparer, monitorTiming, cancellationToken, cancelImmediately); + } + + sealed class _EveryValueChanged : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem + { + readonly WeakReference target; + readonly IEqualityComparer equalityComparer; + readonly Func propertySelector; + readonly CancellationToken cancellationToken; + readonly CancellationTokenRegistration cancellationTokenRegistration; + + bool first; + TProperty currentValue; + bool disposed; + + public _EveryValueChanged(WeakReference target, Func propertySelector, IEqualityComparer equalityComparer, PlayerLoopTiming monitorTiming, CancellationToken cancellationToken, bool cancelImmediately) + { + this.target = target; + this.propertySelector = propertySelector; + this.equalityComparer = equalityComparer; + this.cancellationToken = cancellationToken; + this.first = true; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (_EveryValueChanged)state; + source.completionSource.TrySetCanceled(source.cancellationToken); + }, this); + } + + TaskTracker.TrackActiveTask(this, 2); + PlayerLoopHelper.AddAction(monitorTiming, this); + } + + public TProperty Current => currentValue; + + public UniTask MoveNextAsync() + { + if (disposed) return CompletedTasks.False; + + completionSource.Reset(); + + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + return new UniTask(this, completionSource.Version); + } + + if (first) + { + first = false; + if (!target.TryGetTarget(out var t)) + { + return CompletedTasks.False; + } + this.currentValue = propertySelector(t); + return CompletedTasks.True; + } + + return new UniTask(this, completionSource.Version); + } + + public UniTask DisposeAsync() + { + if (!disposed) + { + cancellationTokenRegistration.Dispose(); + disposed = true; + TaskTracker.RemoveTracking(this); + } + return default; + } + + public bool MoveNext() + { + if (disposed || !target.TryGetTarget(out var t)) + { + completionSource.TrySetResult(false); + DisposeAsync().Forget(); + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + return false; + } + + TProperty nextValue = default(TProperty); + try + { + nextValue = propertySelector(t); + if (equalityComparer.Equals(currentValue, nextValue)) + { + return true; + } + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + DisposeAsync().Forget(); + return false; + } + + currentValue = nextValue; + completionSource.TrySetResult(true); + return true; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryValueChanged.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryValueChanged.cs.meta new file mode 100644 index 00000000..9d2be702 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/EveryValueChanged.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1ec39f1c41c305344854782c935ad354 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs new file mode 100644 index 00000000..b8aabf23 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs @@ -0,0 +1,355 @@ +using System; +using System.Threading; +using UnityEngine; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Timer(TimeSpan dueTime, PlayerLoopTiming updateTiming = PlayerLoopTiming.Update, bool ignoreTimeScale = false, bool cancelImmediately = false) + { + return new Timer(dueTime, null, updateTiming, ignoreTimeScale, cancelImmediately); + } + + public static IUniTaskAsyncEnumerable Timer(TimeSpan dueTime, TimeSpan period, PlayerLoopTiming updateTiming = PlayerLoopTiming.Update, bool ignoreTimeScale = false, bool cancelImmediately = false) + { + return new Timer(dueTime, period, updateTiming, ignoreTimeScale, cancelImmediately); + } + + public static IUniTaskAsyncEnumerable Interval(TimeSpan period, PlayerLoopTiming updateTiming = PlayerLoopTiming.Update, bool ignoreTimeScale = false, bool cancelImmediately = false) + { + return new Timer(period, period, updateTiming, ignoreTimeScale, cancelImmediately); + } + + public static IUniTaskAsyncEnumerable TimerFrame(int dueTimeFrameCount, PlayerLoopTiming updateTiming = PlayerLoopTiming.Update, bool cancelImmediately = false) + { + if (dueTimeFrameCount < 0) + { + throw new ArgumentOutOfRangeException("Delay does not allow minus delayFrameCount. dueTimeFrameCount:" + dueTimeFrameCount); + } + + return new TimerFrame(dueTimeFrameCount, null, updateTiming, cancelImmediately); + } + + public static IUniTaskAsyncEnumerable TimerFrame(int dueTimeFrameCount, int periodFrameCount, PlayerLoopTiming updateTiming = PlayerLoopTiming.Update, bool cancelImmediately = false) + { + if (dueTimeFrameCount < 0) + { + throw new ArgumentOutOfRangeException("Delay does not allow minus delayFrameCount. dueTimeFrameCount:" + dueTimeFrameCount); + } + if (periodFrameCount < 0) + { + throw new ArgumentOutOfRangeException("Delay does not allow minus periodFrameCount. periodFrameCount:" + dueTimeFrameCount); + } + + return new TimerFrame(dueTimeFrameCount, periodFrameCount, updateTiming, cancelImmediately); + } + + public static IUniTaskAsyncEnumerable IntervalFrame(int intervalFrameCount, PlayerLoopTiming updateTiming = PlayerLoopTiming.Update, bool cancelImmediately = false) + { + if (intervalFrameCount < 0) + { + throw new ArgumentOutOfRangeException("Delay does not allow minus intervalFrameCount. intervalFrameCount:" + intervalFrameCount); + } + return new TimerFrame(intervalFrameCount, intervalFrameCount, updateTiming, cancelImmediately); + } + } + + internal class Timer : IUniTaskAsyncEnumerable + { + readonly PlayerLoopTiming updateTiming; + readonly TimeSpan dueTime; + readonly TimeSpan? period; + readonly bool ignoreTimeScale; + readonly bool cancelImmediately; + + public Timer(TimeSpan dueTime, TimeSpan? period, PlayerLoopTiming updateTiming, bool ignoreTimeScale, bool cancelImmediately) + { + this.updateTiming = updateTiming; + this.dueTime = dueTime; + this.period = period; + this.ignoreTimeScale = ignoreTimeScale; + this.cancelImmediately = cancelImmediately; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Timer(dueTime, period, updateTiming, ignoreTimeScale, cancellationToken, cancelImmediately); + } + + class _Timer : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem + { + readonly float dueTime; + readonly float? period; + readonly PlayerLoopTiming updateTiming; + readonly bool ignoreTimeScale; + readonly CancellationToken cancellationToken; + readonly CancellationTokenRegistration cancellationTokenRegistration; + + int initialFrame; + float elapsed; + bool dueTimePhase; + bool completed; + bool disposed; + + public _Timer(TimeSpan dueTime, TimeSpan? period, PlayerLoopTiming updateTiming, bool ignoreTimeScale, CancellationToken cancellationToken, bool cancelImmediately) + { + this.dueTime = (float)dueTime.TotalSeconds; + this.period = (period == null) ? null : (float?)period.Value.TotalSeconds; + + if (this.dueTime <= 0) this.dueTime = 0; + if (this.period != null) + { + if (this.period <= 0) this.period = 1; + } + + this.initialFrame = PlayerLoopHelper.IsMainThread ? Time.frameCount : -1; + this.dueTimePhase = true; + this.updateTiming = updateTiming; + this.ignoreTimeScale = ignoreTimeScale; + this.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (_Timer)state; + source.completionSource.TrySetCanceled(source.cancellationToken); + }, this); + } + + TaskTracker.TrackActiveTask(this, 2); + PlayerLoopHelper.AddAction(updateTiming, this); + } + + public AsyncUnit Current => default; + + public UniTask MoveNextAsync() + { + // return false instead of throw + if (disposed || completed) return CompletedTasks.False; + + // reset value here. + this.elapsed = 0; + + completionSource.Reset(); + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + } + return new UniTask(this, completionSource.Version); + } + + public UniTask DisposeAsync() + { + if (!disposed) + { + cancellationTokenRegistration.Dispose(); + disposed = true; + TaskTracker.RemoveTracking(this); + } + return default; + } + + public bool MoveNext() + { + if (disposed) + { + completionSource.TrySetResult(false); + return false; + } + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + return false; + } + + if (dueTimePhase) + { + if (elapsed == 0) + { + // skip in initial frame. + if (initialFrame == Time.frameCount) + { + return true; + } + } + + elapsed += (ignoreTimeScale) ? UnityEngine.Time.unscaledDeltaTime : UnityEngine.Time.deltaTime; + + if (elapsed >= dueTime) + { + dueTimePhase = false; + completionSource.TrySetResult(true); + } + } + else + { + if (period == null) + { + completed = true; + completionSource.TrySetResult(false); + return false; + } + + elapsed += (ignoreTimeScale) ? UnityEngine.Time.unscaledDeltaTime : UnityEngine.Time.deltaTime; + + if (elapsed >= period) + { + completionSource.TrySetResult(true); + } + } + + return true; + } + } + } + + internal class TimerFrame : IUniTaskAsyncEnumerable + { + readonly PlayerLoopTiming updateTiming; + readonly int dueTimeFrameCount; + readonly int? periodFrameCount; + readonly bool cancelImmediately; + + public TimerFrame(int dueTimeFrameCount, int? periodFrameCount, PlayerLoopTiming updateTiming, bool cancelImmediately) + { + this.updateTiming = updateTiming; + this.dueTimeFrameCount = dueTimeFrameCount; + this.periodFrameCount = periodFrameCount; + this.cancelImmediately = cancelImmediately; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _TimerFrame(dueTimeFrameCount, periodFrameCount, updateTiming, cancellationToken, cancelImmediately); + } + + class _TimerFrame : MoveNextSource, IUniTaskAsyncEnumerator, IPlayerLoopItem + { + readonly int dueTimeFrameCount; + readonly int? periodFrameCount; + readonly CancellationToken cancellationToken; + readonly CancellationTokenRegistration cancellationTokenRegistration; + + int initialFrame; + int currentFrame; + bool dueTimePhase; + bool completed; + bool disposed; + + public _TimerFrame(int dueTimeFrameCount, int? periodFrameCount, PlayerLoopTiming updateTiming, CancellationToken cancellationToken, bool cancelImmediately) + { + if (dueTimeFrameCount <= 0) dueTimeFrameCount = 0; + if (periodFrameCount != null) + { + if (periodFrameCount <= 0) periodFrameCount = 1; + } + + this.initialFrame = PlayerLoopHelper.IsMainThread ? Time.frameCount : -1; + this.dueTimePhase = true; + this.dueTimeFrameCount = dueTimeFrameCount; + this.periodFrameCount = periodFrameCount; + this.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (_TimerFrame)state; + source.completionSource.TrySetCanceled(source.cancellationToken); + }, this); + } + + TaskTracker.TrackActiveTask(this, 2); + PlayerLoopHelper.AddAction(updateTiming, this); + } + + public AsyncUnit Current => default; + + public UniTask MoveNextAsync() + { + if (disposed || completed) return CompletedTasks.False; + + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + } + + // reset value here. + this.currentFrame = 0; + completionSource.Reset(); + return new UniTask(this, completionSource.Version); + } + + public UniTask DisposeAsync() + { + if (!disposed) + { + cancellationTokenRegistration.Dispose(); + disposed = true; + TaskTracker.RemoveTracking(this); + } + return default; + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + completionSource.TrySetCanceled(cancellationToken); + return false; + } + if (disposed) + { + completionSource.TrySetResult(false); + return false; + } + + if (dueTimePhase) + { + if (currentFrame == 0) + { + if (dueTimeFrameCount == 0) + { + dueTimePhase = false; + completionSource.TrySetResult(true); + return true; + } + + // skip in initial frame. + if (initialFrame == Time.frameCount) + { + return true; + } + } + + if (++currentFrame >= dueTimeFrameCount) + { + dueTimePhase = false; + completionSource.TrySetResult(true); + } + else + { + } + } + else + { + if (periodFrameCount == null) + { + completed = true; + completionSource.TrySetResult(false); + return false; + } + + if (++currentFrame >= periodFrameCount) + { + completionSource.TrySetResult(true); + } + } + + return true; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs.meta new file mode 100644 index 00000000..aa790c52 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions/Timer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 382caacde439855418709c641e4d7b04 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Where.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Where.cs new file mode 100644 index 00000000..1b5ac47f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Where.cs @@ -0,0 +1,818 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + public static IUniTaskAsyncEnumerable Where(this IUniTaskAsyncEnumerable source, Func predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new Where(source, predicate); + } + + public static IUniTaskAsyncEnumerable Where(this IUniTaskAsyncEnumerable source, Func predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new WhereInt(source, predicate); + } + + public static IUniTaskAsyncEnumerable WhereAwait(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new WhereAwait(source, predicate); + } + + public static IUniTaskAsyncEnumerable WhereAwait(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new WhereIntAwait(source, predicate); + } + + public static IUniTaskAsyncEnumerable WhereAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new WhereAwaitWithCancellation(source, predicate); + } + + public static IUniTaskAsyncEnumerable WhereAwaitWithCancellation(this IUniTaskAsyncEnumerable source, Func> predicate) + { + Error.ThrowArgumentNullException(source, nameof(source)); + Error.ThrowArgumentNullException(predicate, nameof(predicate)); + + return new WhereIntAwaitWithCancellation(source, predicate); + } + } + + internal sealed class Where : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func predicate; + + public Where(IUniTaskAsyncEnumerable source, Func predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Where(source, predicate, cancellationToken); + } + + sealed class _Where : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func predicate; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + Action moveNextAction; + + public _Where(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + { + this.source = source; + this.predicate = predicate; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + Current = enumerator.Current; + if (predicate(Current)) + { + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + } + else + { + goto DONE; + } + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class WhereInt : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func predicate; + + public WhereInt(IUniTaskAsyncEnumerable source, Func predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Where(source, predicate, cancellationToken); + } + + sealed class _Where : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func predicate; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + Action moveNextAction; + int index; + + public _Where(IUniTaskAsyncEnumerable source, Func predicate, CancellationToken cancellationToken) + { + this.source = source; + this.predicate = predicate; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + Current = enumerator.Current; + if (predicate(Current, checked(index++))) + { + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + } + else + { + goto DONE; + } + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class WhereAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public WhereAwait(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _WhereAwait(source, predicate, cancellationToken); + } + + sealed class _WhereAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + + public _WhereAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + this.source = source; + this.predicate = predicate; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + Current = enumerator.Current; + + awaiter2 = predicate(Current).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + if (awaiter2.GetResult()) + { + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class WhereIntAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public WhereIntAwait(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _WhereAwait(source, predicate, cancellationToken); + } + + sealed class _WhereAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + int index; + + public _WhereAwait(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + this.source = source; + this.predicate = predicate; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + Current = enumerator.Current; + + awaiter2 = predicate(Current, checked(index++)).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + if (awaiter2.GetResult()) + { + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class WhereAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public WhereAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _WhereAwaitWithCancellation(source, predicate, cancellationToken); + } + + sealed class _WhereAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + + public _WhereAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + this.source = source; + this.predicate = predicate; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + Current = enumerator.Current; + + awaiter2 = predicate(Current, cancellationToken).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + if (awaiter2.GetResult()) + { + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } + + internal sealed class WhereIntAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + + public WhereIntAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate) + { + this.source = source; + this.predicate = predicate; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _WhereAwaitWithCancellation(source, predicate, cancellationToken); + } + + sealed class _WhereAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + readonly IUniTaskAsyncEnumerable source; + readonly Func> predicate; + readonly CancellationToken cancellationToken; + + int state = -1; + IUniTaskAsyncEnumerator enumerator; + UniTask.Awaiter awaiter; + UniTask.Awaiter awaiter2; + Action moveNextAction; + int index; + + public _WhereAwaitWithCancellation(IUniTaskAsyncEnumerable source, Func> predicate, CancellationToken cancellationToken) + { + this.source = source; + this.predicate = predicate; + this.cancellationToken = cancellationToken; + this.moveNextAction = MoveNext; + TaskTracker.TrackActiveTask(this, 3); + } + + public TSource Current { get; private set; } + + public UniTask MoveNextAsync() + { + if (state == -2) return default; + + completionSource.Reset(); + MoveNext(); + return new UniTask(this, completionSource.Version); + } + + void MoveNext() + { + REPEAT: + try + { + switch (state) + { + case -1: // init + enumerator = source.GetAsyncEnumerator(cancellationToken); + goto case 0; + case 0: + awaiter = enumerator.MoveNextAsync().GetAwaiter(); + if (awaiter.IsCompleted) + { + goto case 1; + } + else + { + state = 1; + awaiter.UnsafeOnCompleted(moveNextAction); + return; + } + case 1: + if (awaiter.GetResult()) + { + Current = enumerator.Current; + + awaiter2 = predicate(Current, checked(index++), cancellationToken).GetAwaiter(); + if (awaiter2.IsCompleted) + { + goto case 2; + } + else + { + state = 2; + awaiter2.UnsafeOnCompleted(moveNextAction); + return; + } + } + else + { + goto DONE; + } + case 2: + if (awaiter2.GetResult()) + { + goto CONTINUE; + } + else + { + state = 0; + goto REPEAT; + } + default: + goto DONE; + } + } + catch (Exception ex) + { + state = -2; + completionSource.TrySetException(ex); + return; + } + + DONE: + state = -2; + completionSource.TrySetResult(false); + return; + + CONTINUE: + state = 0; + completionSource.TrySetResult(true); + return; + } + + public UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + return enumerator.DisposeAsync(); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Where.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Where.cs.meta new file mode 100644 index 00000000..7e503375 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Where.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d882a3238d9535e4e8ce1ad3291eb7fb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs new file mode 100644 index 00000000..af6d5f17 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs @@ -0,0 +1,541 @@ +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks.Linq +{ + public static partial class UniTaskAsyncEnumerable + { + + public static IUniTaskAsyncEnumerable<(TFirst First, TSecond Second)> Zip(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + + return Zip(first, second, (x, y) => (x, y)); + } + + public static IUniTaskAsyncEnumerable Zip(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func resultSelector) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + Error.ThrowArgumentNullException(resultSelector, nameof(resultSelector)); + + return new Zip(first, second, resultSelector); + } + + public static IUniTaskAsyncEnumerable ZipAwait(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> selector) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new ZipAwait(first, second, selector); + } + + public static IUniTaskAsyncEnumerable ZipAwaitWithCancellation(this IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> selector) + { + Error.ThrowArgumentNullException(first, nameof(first)); + Error.ThrowArgumentNullException(second, nameof(second)); + Error.ThrowArgumentNullException(selector, nameof(selector)); + + return new ZipAwaitWithCancellation(first, second, selector); + } + } + + internal sealed class Zip : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + readonly Func resultSelector; + + public Zip(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func resultSelector) + { + this.first = first; + this.second = second; + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _Zip(first, second, resultSelector, cancellationToken); + } + + sealed class _Zip : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action firstMoveNextCoreDelegate = FirstMoveNextCore; + static readonly Action secondMoveNextCoreDelegate = SecondMoveNextCore; + + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + readonly Func resultSelector; + + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator firstEnumerator; + IUniTaskAsyncEnumerator secondEnumerator; + + UniTask.Awaiter firstAwaiter; + UniTask.Awaiter secondAwaiter; + + public _Zip(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func resultSelector, CancellationToken cancellationToken) + { + this.first = first; + this.second = second; + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + completionSource.Reset(); + + if (firstEnumerator == null) + { + firstEnumerator = first.GetAsyncEnumerator(cancellationToken); + secondEnumerator = second.GetAsyncEnumerator(cancellationToken); + } + + firstAwaiter = firstEnumerator.MoveNextAsync().GetAwaiter(); + + if (firstAwaiter.IsCompleted) + { + FirstMoveNextCore(this); + } + else + { + firstAwaiter.SourceOnCompleted(firstMoveNextCoreDelegate, this); + } + + return new UniTask(this, completionSource.Version); + } + + static void FirstMoveNextCore(object state) + { + var self = (_Zip)state; + + if (self.TryGetResult(self.firstAwaiter, out var result)) + { + if (result) + { + try + { + self.secondAwaiter = self.secondEnumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + + if (self.secondAwaiter.IsCompleted) + { + SecondMoveNextCore(self); + } + else + { + self.secondAwaiter.SourceOnCompleted(secondMoveNextCoreDelegate, self); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void SecondMoveNextCore(object state) + { + var self = (_Zip)state; + + if (self.TryGetResult(self.secondAwaiter, out var result)) + { + if (result) + { + try + { + self.Current = self.resultSelector(self.firstEnumerator.Current, self.secondEnumerator.Current); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + } + + if (self.cancellationToken.IsCancellationRequested) + { + self.completionSource.TrySetCanceled(self.cancellationToken); + } + else + { + self.completionSource.TrySetResult(true); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (firstEnumerator != null) + { + await firstEnumerator.DisposeAsync(); + } + if (secondEnumerator != null) + { + await secondEnumerator.DisposeAsync(); + } + } + } + } + + internal sealed class ZipAwait : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + readonly Func> resultSelector; + + public ZipAwait(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> resultSelector) + { + this.first = first; + this.second = second; + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _ZipAwait(first, second, resultSelector, cancellationToken); + } + + sealed class _ZipAwait : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action firstMoveNextCoreDelegate = FirstMoveNextCore; + static readonly Action secondMoveNextCoreDelegate = SecondMoveNextCore; + static readonly Action resultAwaitCoreDelegate = ResultAwaitCore; + + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + readonly Func> resultSelector; + + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator firstEnumerator; + IUniTaskAsyncEnumerator secondEnumerator; + + UniTask.Awaiter firstAwaiter; + UniTask.Awaiter secondAwaiter; + UniTask.Awaiter resultAwaiter; + + public _ZipAwait(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> resultSelector, CancellationToken cancellationToken) + { + this.first = first; + this.second = second; + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + completionSource.Reset(); + + if (firstEnumerator == null) + { + firstEnumerator = first.GetAsyncEnumerator(cancellationToken); + secondEnumerator = second.GetAsyncEnumerator(cancellationToken); + } + + firstAwaiter = firstEnumerator.MoveNextAsync().GetAwaiter(); + + if (firstAwaiter.IsCompleted) + { + FirstMoveNextCore(this); + } + else + { + firstAwaiter.SourceOnCompleted(firstMoveNextCoreDelegate, this); + } + + return new UniTask(this, completionSource.Version); + } + + static void FirstMoveNextCore(object state) + { + var self = (_ZipAwait)state; + + if (self.TryGetResult(self.firstAwaiter, out var result)) + { + if (result) + { + try + { + self.secondAwaiter = self.secondEnumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + + if (self.secondAwaiter.IsCompleted) + { + SecondMoveNextCore(self); + } + else + { + self.secondAwaiter.SourceOnCompleted(secondMoveNextCoreDelegate, self); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void SecondMoveNextCore(object state) + { + var self = (_ZipAwait)state; + + if (self.TryGetResult(self.secondAwaiter, out var result)) + { + if (result) + { + try + { + self.resultAwaiter = self.resultSelector(self.firstEnumerator.Current, self.secondEnumerator.Current).GetAwaiter(); + if (self.resultAwaiter.IsCompleted) + { + ResultAwaitCore(self); + } + else + { + self.resultAwaiter.SourceOnCompleted(resultAwaitCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void ResultAwaitCore(object state) + { + var self = (_ZipAwait)state; + + if (self.TryGetResult(self.resultAwaiter, out var result)) + { + self.Current = result; + + if (self.cancellationToken.IsCancellationRequested) + { + self.completionSource.TrySetCanceled(self.cancellationToken); + } + else + { + self.completionSource.TrySetResult(true); + } + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (firstEnumerator != null) + { + await firstEnumerator.DisposeAsync(); + } + if (secondEnumerator != null) + { + await secondEnumerator.DisposeAsync(); + } + } + } + } + + internal sealed class ZipAwaitWithCancellation : IUniTaskAsyncEnumerable + { + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + readonly Func> resultSelector; + + public ZipAwaitWithCancellation(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> resultSelector) + { + this.first = first; + this.second = second; + this.resultSelector = resultSelector; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new _ZipAwaitWithCancellation(first, second, resultSelector, cancellationToken); + } + + sealed class _ZipAwaitWithCancellation : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action firstMoveNextCoreDelegate = FirstMoveNextCore; + static readonly Action secondMoveNextCoreDelegate = SecondMoveNextCore; + static readonly Action resultAwaitCoreDelegate = ResultAwaitCore; + + readonly IUniTaskAsyncEnumerable first; + readonly IUniTaskAsyncEnumerable second; + readonly Func> resultSelector; + + CancellationToken cancellationToken; + + IUniTaskAsyncEnumerator firstEnumerator; + IUniTaskAsyncEnumerator secondEnumerator; + + UniTask.Awaiter firstAwaiter; + UniTask.Awaiter secondAwaiter; + UniTask.Awaiter resultAwaiter; + + public _ZipAwaitWithCancellation(IUniTaskAsyncEnumerable first, IUniTaskAsyncEnumerable second, Func> resultSelector, CancellationToken cancellationToken) + { + this.first = first; + this.second = second; + this.resultSelector = resultSelector; + this.cancellationToken = cancellationToken; + TaskTracker.TrackActiveTask(this, 3); + } + + public TResult Current { get; private set; } + + public UniTask MoveNextAsync() + { + completionSource.Reset(); + + if (firstEnumerator == null) + { + firstEnumerator = first.GetAsyncEnumerator(cancellationToken); + secondEnumerator = second.GetAsyncEnumerator(cancellationToken); + } + + firstAwaiter = firstEnumerator.MoveNextAsync().GetAwaiter(); + + if (firstAwaiter.IsCompleted) + { + FirstMoveNextCore(this); + } + else + { + firstAwaiter.SourceOnCompleted(firstMoveNextCoreDelegate, this); + } + + return new UniTask(this, completionSource.Version); + } + + static void FirstMoveNextCore(object state) + { + var self = (_ZipAwaitWithCancellation)state; + + if (self.TryGetResult(self.firstAwaiter, out var result)) + { + if (result) + { + try + { + self.secondAwaiter = self.secondEnumerator.MoveNextAsync().GetAwaiter(); + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + return; + } + + if (self.secondAwaiter.IsCompleted) + { + SecondMoveNextCore(self); + } + else + { + self.secondAwaiter.SourceOnCompleted(secondMoveNextCoreDelegate, self); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void SecondMoveNextCore(object state) + { + var self = (_ZipAwaitWithCancellation)state; + + if (self.TryGetResult(self.secondAwaiter, out var result)) + { + if (result) + { + try + { + self.resultAwaiter = self.resultSelector(self.firstEnumerator.Current, self.secondEnumerator.Current, self.cancellationToken).GetAwaiter(); + if (self.resultAwaiter.IsCompleted) + { + ResultAwaitCore(self); + } + else + { + self.resultAwaiter.SourceOnCompleted(resultAwaitCoreDelegate, self); + } + } + catch (Exception ex) + { + self.completionSource.TrySetException(ex); + } + } + else + { + self.completionSource.TrySetResult(false); + } + } + } + + static void ResultAwaitCore(object state) + { + var self = (_ZipAwaitWithCancellation)state; + + if (self.TryGetResult(self.resultAwaiter, out var result)) + { + self.Current = result; + + if (self.cancellationToken.IsCancellationRequested) + { + self.completionSource.TrySetCanceled(self.cancellationToken); + } + else + { + self.completionSource.TrySetResult(true); + } + } + } + + public async UniTask DisposeAsync() + { + TaskTracker.RemoveTracking(this); + if (firstEnumerator != null) + { + await firstEnumerator.DisposeAsync(); + } + if (secondEnumerator != null) + { + await secondEnumerator.DisposeAsync(); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs.meta new file mode 100644 index 00000000..bf121637 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: acc1acff153e347418f0f30b1c535994 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/MoveNextSource.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/MoveNextSource.cs new file mode 100644 index 00000000..3e9ca236 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/MoveNextSource.cs @@ -0,0 +1,63 @@ +using System; + +namespace Cysharp.Threading.Tasks +{ + public abstract class MoveNextSource : IUniTaskSource + { + protected UniTaskCompletionSourceCore completionSource; + + public bool GetResult(short token) + { + return completionSource.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return completionSource.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + completionSource.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return completionSource.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + completionSource.GetResult(token); + } + + protected bool TryGetResult(UniTask.Awaiter awaiter, out T result) + { + try + { + result = awaiter.GetResult(); + return true; + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + result = default; + return false; + } + } + + protected bool TryGetResult(UniTask.Awaiter awaiter) + { + try + { + awaiter.GetResult(); + return true; + } + catch (Exception ex) + { + completionSource.TrySetException(ex); + return false; + } + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/MoveNextSource.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/MoveNextSource.cs.meta new file mode 100644 index 00000000..60a0908c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/MoveNextSource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dc4c5dc2a5f246e4f8df44cab735826c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs new file mode 100644 index 00000000..b17375e7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs @@ -0,0 +1,581 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Linq; +using UnityEngine; +using Cysharp.Threading.Tasks.Internal; +using System.Threading; + +#if UNITY_2019_3_OR_NEWER +using UnityEngine.LowLevel; +using PlayerLoopType = UnityEngine.PlayerLoop; +#else +using UnityEngine.Experimental.LowLevel; +using PlayerLoopType = UnityEngine.Experimental.PlayerLoop; +#endif + +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace Cysharp.Threading.Tasks +{ + public static class UniTaskLoopRunners + { + public struct UniTaskLoopRunnerInitialization { }; + public struct UniTaskLoopRunnerEarlyUpdate { }; + public struct UniTaskLoopRunnerFixedUpdate { }; + public struct UniTaskLoopRunnerPreUpdate { }; + public struct UniTaskLoopRunnerUpdate { }; + public struct UniTaskLoopRunnerPreLateUpdate { }; + public struct UniTaskLoopRunnerPostLateUpdate { }; + + // Last + + public struct UniTaskLoopRunnerLastInitialization { }; + public struct UniTaskLoopRunnerLastEarlyUpdate { }; + public struct UniTaskLoopRunnerLastFixedUpdate { }; + public struct UniTaskLoopRunnerLastPreUpdate { }; + public struct UniTaskLoopRunnerLastUpdate { }; + public struct UniTaskLoopRunnerLastPreLateUpdate { }; + public struct UniTaskLoopRunnerLastPostLateUpdate { }; + + // Yield + + public struct UniTaskLoopRunnerYieldInitialization { }; + public struct UniTaskLoopRunnerYieldEarlyUpdate { }; + public struct UniTaskLoopRunnerYieldFixedUpdate { }; + public struct UniTaskLoopRunnerYieldPreUpdate { }; + public struct UniTaskLoopRunnerYieldUpdate { }; + public struct UniTaskLoopRunnerYieldPreLateUpdate { }; + public struct UniTaskLoopRunnerYieldPostLateUpdate { }; + + // Yield Last + + public struct UniTaskLoopRunnerLastYieldInitialization { }; + public struct UniTaskLoopRunnerLastYieldEarlyUpdate { }; + public struct UniTaskLoopRunnerLastYieldFixedUpdate { }; + public struct UniTaskLoopRunnerLastYieldPreUpdate { }; + public struct UniTaskLoopRunnerLastYieldUpdate { }; + public struct UniTaskLoopRunnerLastYieldPreLateUpdate { }; + public struct UniTaskLoopRunnerLastYieldPostLateUpdate { }; + +#if UNITY_2020_2_OR_NEWER + public struct UniTaskLoopRunnerTimeUpdate { }; + public struct UniTaskLoopRunnerLastTimeUpdate { }; + public struct UniTaskLoopRunnerYieldTimeUpdate { }; + public struct UniTaskLoopRunnerLastYieldTimeUpdate { }; +#endif + } + + public enum PlayerLoopTiming + { + Initialization = 0, + LastInitialization = 1, + + EarlyUpdate = 2, + LastEarlyUpdate = 3, + + FixedUpdate = 4, + LastFixedUpdate = 5, + + PreUpdate = 6, + LastPreUpdate = 7, + + Update = 8, + LastUpdate = 9, + + PreLateUpdate = 10, + LastPreLateUpdate = 11, + + PostLateUpdate = 12, + LastPostLateUpdate = 13, + +#if UNITY_2020_2_OR_NEWER + // Unity 2020.2 added TimeUpdate https://docs.unity3d.com/2020.2/Documentation/ScriptReference/PlayerLoop.TimeUpdate.html + TimeUpdate = 14, + LastTimeUpdate = 15, +#endif + } + + [Flags] + public enum InjectPlayerLoopTimings + { + /// + /// Preset: All loops(default). + /// + All = + Initialization | LastInitialization | + EarlyUpdate | LastEarlyUpdate | + FixedUpdate | LastFixedUpdate | + PreUpdate | LastPreUpdate | + Update | LastUpdate | + PreLateUpdate | LastPreLateUpdate | + PostLateUpdate | LastPostLateUpdate +#if UNITY_2020_2_OR_NEWER + | TimeUpdate | LastTimeUpdate, +#else + , +#endif + + /// + /// Preset: All without last except LastPostLateUpdate. + /// + Standard = + Initialization | + EarlyUpdate | + FixedUpdate | + PreUpdate | + Update | + PreLateUpdate | + PostLateUpdate | LastPostLateUpdate +#if UNITY_2020_2_OR_NEWER + | TimeUpdate +#endif + , + + /// + /// Preset: Minimum pattern, Update | FixedUpdate | LastPostLateUpdate + /// + Minimum = + Update | FixedUpdate | LastPostLateUpdate, + + // PlayerLoopTiming + + Initialization = 1, + LastInitialization = 2, + + EarlyUpdate = 4, + LastEarlyUpdate = 8, + + FixedUpdate = 16, + LastFixedUpdate = 32, + + PreUpdate = 64, + LastPreUpdate = 128, + + Update = 256, + LastUpdate = 512, + + PreLateUpdate = 1024, + LastPreLateUpdate = 2048, + + PostLateUpdate = 4096, + LastPostLateUpdate = 8192 + +#if UNITY_2020_2_OR_NEWER + , + // Unity 2020.2 added TimeUpdate https://docs.unity3d.com/2020.2/Documentation/ScriptReference/PlayerLoop.TimeUpdate.html + TimeUpdate = 16384, + LastTimeUpdate = 32768 +#endif + } + + public interface IPlayerLoopItem + { + bool MoveNext(); + } + + public static class PlayerLoopHelper + { + static readonly ContinuationQueue ThrowMarkerContinuationQueue = new ContinuationQueue(PlayerLoopTiming.Initialization); + static readonly PlayerLoopRunner ThrowMarkerPlayerLoopRunner = new PlayerLoopRunner(PlayerLoopTiming.Initialization); + + public static SynchronizationContext UnitySynchronizationContext => unitySynchronizationContext; + public static int MainThreadId => mainThreadId; + internal static string ApplicationDataPath => applicationDataPath; + + public static bool IsMainThread => Thread.CurrentThread.ManagedThreadId == mainThreadId; + + static int mainThreadId; + static string applicationDataPath; + static SynchronizationContext unitySynchronizationContext; + static ContinuationQueue[] yielders; + static PlayerLoopRunner[] runners; + internal static bool IsEditorApplicationQuitting { get; private set; } + static PlayerLoopSystem[] InsertRunner(PlayerLoopSystem loopSystem, + bool injectOnFirst, + Type loopRunnerYieldType, ContinuationQueue cq, + Type loopRunnerType, PlayerLoopRunner runner) + { + +#if UNITY_EDITOR + EditorApplication.playModeStateChanged += (state) => + { + if (state == PlayModeStateChange.EnteredEditMode || state == PlayModeStateChange.ExitingEditMode) + { + IsEditorApplicationQuitting = true; + // run rest action before clear. + if (runner != null) + { + runner.Run(); + runner.Clear(); + } + if (cq != null) + { + cq.Run(); + cq.Clear(); + } + IsEditorApplicationQuitting = false; + } + }; +#endif + + var yieldLoop = new PlayerLoopSystem + { + type = loopRunnerYieldType, + updateDelegate = cq.Run + }; + + var runnerLoop = new PlayerLoopSystem + { + type = loopRunnerType, + updateDelegate = runner.Run + }; + + // Remove items from previous initializations. + var source = RemoveRunner(loopSystem, loopRunnerYieldType, loopRunnerType); + var dest = new PlayerLoopSystem[source.Length + 2]; + + Array.Copy(source, 0, dest, injectOnFirst ? 2 : 0, source.Length); + if (injectOnFirst) + { + dest[0] = yieldLoop; + dest[1] = runnerLoop; + } + else + { + dest[dest.Length - 2] = yieldLoop; + dest[dest.Length - 1] = runnerLoop; + } + + return dest; + } + + static PlayerLoopSystem[] RemoveRunner(PlayerLoopSystem loopSystem, Type loopRunnerYieldType, Type loopRunnerType) + { + return loopSystem.subSystemList + .Where(ls => ls.type != loopRunnerYieldType && ls.type != loopRunnerType) + .ToArray(); + } + + static PlayerLoopSystem[] InsertUniTaskSynchronizationContext(PlayerLoopSystem loopSystem) + { + var loop = new PlayerLoopSystem + { + type = typeof(UniTaskSynchronizationContext), + updateDelegate = UniTaskSynchronizationContext.Run + }; + + // Remove items from previous initializations. + var source = loopSystem.subSystemList + .Where(ls => ls.type != typeof(UniTaskSynchronizationContext)) + .ToArray(); + + var dest = new System.Collections.Generic.List(source); + + var index = dest.FindIndex(x => x.type.Name == "ScriptRunDelayedTasks"); + if (index == -1) + { + index = dest.FindIndex(x => x.type.Name == "UniTaskLoopRunnerUpdate"); + } + + dest.Insert(index + 1, loop); + + return dest.ToArray(); + } + +#if UNITY_2020_1_OR_NEWER + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)] +#else + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] +#endif + static void Init() + { + // capture default(unity) sync-context. + unitySynchronizationContext = SynchronizationContext.Current; + mainThreadId = Thread.CurrentThread.ManagedThreadId; + try + { + applicationDataPath = Application.dataPath; + } + catch { } + +#if UNITY_EDITOR && UNITY_2019_3_OR_NEWER + // When domain reload is disabled, re-initialization is required when entering play mode; + // otherwise, pending tasks will leak between play mode sessions. + var domainReloadDisabled = UnityEditor.EditorSettings.enterPlayModeOptionsEnabled && + UnityEditor.EditorSettings.enterPlayModeOptions.HasFlag(UnityEditor.EnterPlayModeOptions.DisableDomainReload); + if (!domainReloadDisabled && runners != null) return; +#else + if (runners != null) return; // already initialized +#endif + + var playerLoop = +#if UNITY_2019_3_OR_NEWER + PlayerLoop.GetCurrentPlayerLoop(); +#else + PlayerLoop.GetDefaultPlayerLoop(); +#endif + + Initialize(ref playerLoop); + } + + +#if UNITY_EDITOR + + [InitializeOnLoadMethod] + static void InitOnEditor() + { + // Execute the play mode init method + Init(); + + // register an Editor update delegate, used to forcing playerLoop update + EditorApplication.update += ForceEditorPlayerLoopUpdate; + } + + private static void ForceEditorPlayerLoopUpdate() + { + if (EditorApplication.isPlayingOrWillChangePlaymode || EditorApplication.isCompiling || EditorApplication.isUpdating) + { + // Not in Edit mode, don't interfere + return; + } + + // EditorApplication.QueuePlayerLoopUpdate causes performance issue, don't call directly. + // EditorApplication.QueuePlayerLoopUpdate(); + + if (yielders != null) + { + foreach (var item in yielders) + { + if (item != null) item.Run(); + } + } + + if (runners != null) + { + foreach (var item in runners) + { + if (item != null) item.Run(); + } + } + + UniTaskSynchronizationContext.Run(); + } + +#endif + + private static int FindLoopSystemIndex(PlayerLoopSystem[] playerLoopList, Type systemType) + { + for (int i = 0; i < playerLoopList.Length; i++) + { + if (playerLoopList[i].type == systemType) + { + return i; + } + } + + throw new Exception("Target PlayerLoopSystem does not found. Type:" + systemType.FullName); + } + + static void InsertLoop(PlayerLoopSystem[] copyList, InjectPlayerLoopTimings injectTimings, Type loopType, InjectPlayerLoopTimings targetTimings, + int index, bool injectOnFirst, Type loopRunnerYieldType, Type loopRunnerType, PlayerLoopTiming playerLoopTiming) + { + var i = FindLoopSystemIndex(copyList, loopType); + if ((injectTimings & targetTimings) == targetTimings) + { + copyList[i].subSystemList = InsertRunner(copyList[i], injectOnFirst, + loopRunnerYieldType, yielders[index] = new ContinuationQueue(playerLoopTiming), + loopRunnerType, runners[index] = new PlayerLoopRunner(playerLoopTiming)); + } + else + { + copyList[i].subSystemList = RemoveRunner(copyList[i], loopRunnerYieldType, loopRunnerType); + } + } + + public static void Initialize(ref PlayerLoopSystem playerLoop, InjectPlayerLoopTimings injectTimings = InjectPlayerLoopTimings.All) + { +#if UNITY_2020_2_OR_NEWER + yielders = new ContinuationQueue[16]; + runners = new PlayerLoopRunner[16]; +#else + yielders = new ContinuationQueue[14]; + runners = new PlayerLoopRunner[14]; +#endif + + var copyList = playerLoop.subSystemList.ToArray(); + + // Initialization + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.Initialization), + InjectPlayerLoopTimings.Initialization, 0, true, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldInitialization), typeof(UniTaskLoopRunners.UniTaskLoopRunnerInitialization), PlayerLoopTiming.Initialization); + + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.Initialization), + InjectPlayerLoopTimings.LastInitialization, 1, false, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastYieldInitialization), typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastInitialization), PlayerLoopTiming.LastInitialization); + + // EarlyUpdate + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.EarlyUpdate), + InjectPlayerLoopTimings.EarlyUpdate, 2, true, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldEarlyUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerEarlyUpdate), PlayerLoopTiming.EarlyUpdate); + + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.EarlyUpdate), + InjectPlayerLoopTimings.LastEarlyUpdate, 3, false, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastYieldEarlyUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastEarlyUpdate), PlayerLoopTiming.LastEarlyUpdate); + + // FixedUpdate + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.FixedUpdate), + InjectPlayerLoopTimings.FixedUpdate, 4, true, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldFixedUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerFixedUpdate), PlayerLoopTiming.FixedUpdate); + + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.FixedUpdate), + InjectPlayerLoopTimings.LastFixedUpdate, 5, false, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastYieldFixedUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastFixedUpdate), PlayerLoopTiming.LastFixedUpdate); + + // PreUpdate + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.PreUpdate), + InjectPlayerLoopTimings.PreUpdate, 6, true, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldPreUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerPreUpdate), PlayerLoopTiming.PreUpdate); + + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.PreUpdate), + InjectPlayerLoopTimings.LastPreUpdate, 7, false, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastYieldPreUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastPreUpdate), PlayerLoopTiming.LastPreUpdate); + + // Update + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.Update), + InjectPlayerLoopTimings.Update, 8, true, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerUpdate), PlayerLoopTiming.Update); + + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.Update), + InjectPlayerLoopTimings.LastUpdate, 9, false, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastYieldUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastUpdate), PlayerLoopTiming.LastUpdate); + + // PreLateUpdate + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.PreLateUpdate), + InjectPlayerLoopTimings.PreLateUpdate, 10, true, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldPreLateUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerPreLateUpdate), PlayerLoopTiming.PreLateUpdate); + + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.PreLateUpdate), + InjectPlayerLoopTimings.LastPreLateUpdate, 11, false, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastYieldPreLateUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastPreLateUpdate), PlayerLoopTiming.LastPreLateUpdate); + + // PostLateUpdate + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.PostLateUpdate), + InjectPlayerLoopTimings.PostLateUpdate, 12, true, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldPostLateUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerPostLateUpdate), PlayerLoopTiming.PostLateUpdate); + + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.PostLateUpdate), + InjectPlayerLoopTimings.LastPostLateUpdate, 13, false, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastYieldPostLateUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastPostLateUpdate), PlayerLoopTiming.LastPostLateUpdate); + +#if UNITY_2020_2_OR_NEWER + // TimeUpdate + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.TimeUpdate), + InjectPlayerLoopTimings.TimeUpdate, 14, true, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerYieldTimeUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerTimeUpdate), PlayerLoopTiming.TimeUpdate); + + InsertLoop(copyList, injectTimings, typeof(PlayerLoopType.TimeUpdate), + InjectPlayerLoopTimings.LastTimeUpdate, 15, false, + typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastYieldTimeUpdate), typeof(UniTaskLoopRunners.UniTaskLoopRunnerLastTimeUpdate), PlayerLoopTiming.LastTimeUpdate); +#endif + + // Insert UniTaskSynchronizationContext to Update loop + var i = FindLoopSystemIndex(copyList, typeof(PlayerLoopType.Update)); + copyList[i].subSystemList = InsertUniTaskSynchronizationContext(copyList[i]); + + playerLoop.subSystemList = copyList; + PlayerLoop.SetPlayerLoop(playerLoop); + } + + public static void AddAction(PlayerLoopTiming timing, IPlayerLoopItem action) + { + var runner = runners[(int)timing]; + if (runner == null) + { + ThrowInvalidLoopTiming(timing); + } + runner.AddAction(action); + } + + static void ThrowInvalidLoopTiming(PlayerLoopTiming playerLoopTiming) + { + throw new InvalidOperationException("Target playerLoopTiming is not injected. Please check PlayerLoopHelper.Initialize. PlayerLoopTiming:" + playerLoopTiming); + } + + public static void AddContinuation(PlayerLoopTiming timing, Action continuation) + { + var q = yielders[(int)timing]; + if (q == null) + { + ThrowInvalidLoopTiming(timing); + } + q.Enqueue(continuation); + } + + // Diagnostics helper + +#if UNITY_2019_3_OR_NEWER + + public static void DumpCurrentPlayerLoop() + { + var playerLoop = UnityEngine.LowLevel.PlayerLoop.GetCurrentPlayerLoop(); + + var sb = new System.Text.StringBuilder(); + sb.AppendLine($"PlayerLoop List"); + foreach (var header in playerLoop.subSystemList) + { + sb.AppendFormat("------{0}------", header.type.Name); + sb.AppendLine(); + + if (header.subSystemList is null) + { + sb.AppendFormat("{0} has no subsystems!", header.ToString()); + sb.AppendLine(); + continue; + } + + foreach (var subSystem in header.subSystemList) + { + sb.AppendFormat("{0}", subSystem.type.Name); + sb.AppendLine(); + + if (subSystem.subSystemList != null) + { + UnityEngine.Debug.LogWarning("More Subsystem:" + subSystem.subSystemList.Length); + } + } + } + + UnityEngine.Debug.Log(sb.ToString()); + } + + public static bool IsInjectedUniTaskPlayerLoop() + { + var playerLoop = UnityEngine.LowLevel.PlayerLoop.GetCurrentPlayerLoop(); + + foreach (var header in playerLoop.subSystemList) + { + if (header.subSystemList is null) + { + continue; + } + + foreach (var subSystem in header.subSystemList) + { + if (subSystem.type == typeof(UniTaskLoopRunners.UniTaskLoopRunnerInitialization)) + { + return true; + } + } + } + + return false; + } + +#endif + + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs.meta new file mode 100644 index 00000000..2487ef77 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 15fb5b85042f19640b973ce651795aca +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopTimer.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopTimer.cs new file mode 100644 index 00000000..f8a877a4 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopTimer.cs @@ -0,0 +1,262 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System.Threading; +using System; +using Cysharp.Threading.Tasks.Internal; +using UnityEngine; + +namespace Cysharp.Threading.Tasks +{ + public abstract class PlayerLoopTimer : IDisposable, IPlayerLoopItem + { + readonly CancellationToken cancellationToken; + readonly Action timerCallback; + readonly object state; + readonly PlayerLoopTiming playerLoopTiming; + readonly bool periodic; + + bool isRunning; + bool tryStop; + bool isDisposed; + + protected PlayerLoopTimer(bool periodic, PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken, Action timerCallback, object state) + { + this.periodic = periodic; + this.playerLoopTiming = playerLoopTiming; + this.cancellationToken = cancellationToken; + this.timerCallback = timerCallback; + this.state = state; + } + + public static PlayerLoopTimer Create(TimeSpan interval, bool periodic, DelayType delayType, PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken, Action timerCallback, object state) + { +#if UNITY_EDITOR + // force use Realtime. + if (PlayerLoopHelper.IsMainThread && !UnityEditor.EditorApplication.isPlaying) + { + delayType = DelayType.Realtime; + } +#endif + + switch (delayType) + { + case DelayType.UnscaledDeltaTime: + return new IgnoreTimeScalePlayerLoopTimer(interval, periodic, playerLoopTiming, cancellationToken, timerCallback, state); + case DelayType.Realtime: + return new RealtimePlayerLoopTimer(interval, periodic, playerLoopTiming, cancellationToken, timerCallback, state); + case DelayType.DeltaTime: + default: + return new DeltaTimePlayerLoopTimer(interval, periodic, playerLoopTiming, cancellationToken, timerCallback, state); + } + } + + public static PlayerLoopTimer StartNew(TimeSpan interval, bool periodic, DelayType delayType, PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken, Action timerCallback, object state) + { + var timer = Create(interval, periodic, delayType, playerLoopTiming, cancellationToken, timerCallback, state); + timer.Restart(); + return timer; + } + + /// + /// Restart(Reset and Start) timer. + /// + public void Restart() + { + if (isDisposed) throw new ObjectDisposedException(null); + + ResetCore(null); // init state + if (!isRunning) + { + isRunning = true; + PlayerLoopHelper.AddAction(playerLoopTiming, this); + } + tryStop = false; + } + + /// + /// Restart(Reset and Start) and change interval. + /// + public void Restart(TimeSpan interval) + { + if (isDisposed) throw new ObjectDisposedException(null); + + ResetCore(interval); // init state + if (!isRunning) + { + isRunning = true; + PlayerLoopHelper.AddAction(playerLoopTiming, this); + } + tryStop = false; + } + + /// + /// Stop timer. + /// + public void Stop() + { + tryStop = true; + } + + protected abstract void ResetCore(TimeSpan? newInterval); + + public void Dispose() + { + isDisposed = true; + } + + bool IPlayerLoopItem.MoveNext() + { + if (isDisposed) + { + isRunning = false; + return false; + } + if (tryStop) + { + isRunning = false; + return false; + } + if (cancellationToken.IsCancellationRequested) + { + isRunning = false; + return false; + } + + if (!MoveNextCore()) + { + timerCallback(state); + + if (periodic) + { + ResetCore(null); + return true; + } + else + { + isRunning = false; + return false; + } + } + + return true; + } + + protected abstract bool MoveNextCore(); + } + + sealed class DeltaTimePlayerLoopTimer : PlayerLoopTimer + { + int initialFrame; + float elapsed; + float interval; + + public DeltaTimePlayerLoopTimer(TimeSpan interval, bool periodic, PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken, Action timerCallback, object state) + : base(periodic, playerLoopTiming, cancellationToken, timerCallback, state) + { + ResetCore(interval); + } + + protected override bool MoveNextCore() + { + if (elapsed == 0.0f) + { + if (initialFrame == Time.frameCount) + { + return true; + } + } + + elapsed += Time.deltaTime; + if (elapsed >= interval) + { + return false; + } + + return true; + } + + protected override void ResetCore(TimeSpan? interval) + { + this.elapsed = 0.0f; + this.initialFrame = PlayerLoopHelper.IsMainThread ? Time.frameCount : -1; + if (interval != null) + { + this.interval = (float)interval.Value.TotalSeconds; + } + } + } + + sealed class IgnoreTimeScalePlayerLoopTimer : PlayerLoopTimer + { + int initialFrame; + float elapsed; + float interval; + + public IgnoreTimeScalePlayerLoopTimer(TimeSpan interval, bool periodic, PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken, Action timerCallback, object state) + : base(periodic, playerLoopTiming, cancellationToken, timerCallback, state) + { + ResetCore(interval); + } + + protected override bool MoveNextCore() + { + if (elapsed == 0.0f) + { + if (initialFrame == Time.frameCount) + { + return true; + } + } + + elapsed += Time.unscaledDeltaTime; + if (elapsed >= interval) + { + return false; + } + + return true; + } + + protected override void ResetCore(TimeSpan? interval) + { + this.elapsed = 0.0f; + this.initialFrame = PlayerLoopHelper.IsMainThread ? Time.frameCount : -1; + if (interval != null) + { + this.interval = (float)interval.Value.TotalSeconds; + } + } + } + + sealed class RealtimePlayerLoopTimer : PlayerLoopTimer + { + ValueStopwatch stopwatch; + long intervalTicks; + + public RealtimePlayerLoopTimer(TimeSpan interval, bool periodic, PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken, Action timerCallback, object state) + : base(periodic, playerLoopTiming, cancellationToken, timerCallback, state) + { + ResetCore(interval); + } + + protected override bool MoveNextCore() + { + if (stopwatch.ElapsedTicks >= intervalTicks) + { + return false; + } + + return true; + } + + protected override void ResetCore(TimeSpan? interval) + { + this.stopwatch = ValueStopwatch.StartNew(); + if (interval != null) + { + this.intervalTicks = interval.Value.Ticks; + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopTimer.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopTimer.cs.meta new file mode 100644 index 00000000..eb2b50a0 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/PlayerLoopTimer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 57095a17fdca7ee4380450910afc7f26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Progress.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Progress.cs new file mode 100644 index 00000000..ed112902 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Progress.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + /// + /// Lightweight IProgress[T] factory. + /// + public static class Progress + { + public static IProgress Create(Action handler) + { + if (handler == null) return NullProgress.Instance; + return new AnonymousProgress(handler); + } + + public static IProgress CreateOnlyValueChanged(Action handler, IEqualityComparer comparer = null) + { + if (handler == null) return NullProgress.Instance; +#if UNITY_2018_3_OR_NEWER + return new OnlyValueChangedProgress(handler, comparer ?? UnityEqualityComparer.GetDefault()); +#else + return new OnlyValueChangedProgress(handler, comparer ?? EqualityComparer.Default); +#endif + } + + sealed class NullProgress : IProgress + { + public static readonly IProgress Instance = new NullProgress(); + + NullProgress() + { + + } + + public void Report(T value) + { + } + } + + sealed class AnonymousProgress : IProgress + { + readonly Action action; + + public AnonymousProgress(Action action) + { + this.action = action; + } + + public void Report(T value) + { + action(value); + } + } + + sealed class OnlyValueChangedProgress : IProgress + { + readonly Action action; + readonly IEqualityComparer comparer; + bool isFirstCall; + T latestValue; + + public OnlyValueChangedProgress(Action action, IEqualityComparer comparer) + { + this.action = action; + this.comparer = comparer; + this.isFirstCall = true; + } + + public void Report(T value) + { + if (isFirstCall) + { + isFirstCall = false; + } + else if (comparer.Equals(value, latestValue)) + { + return; + } + + latestValue = value; + action(value); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Progress.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Progress.cs.meta new file mode 100644 index 00000000..f0e1f197 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Progress.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e3377e2ae934ed54fb8fd5388e2d9eb9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/TaskPool.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/TaskPool.cs new file mode 100644 index 00000000..e1035598 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/TaskPool.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + // internally used but public, allow to user create custom operator with pooling. + + public static class TaskPool + { + internal static int MaxPoolSize; + + // avoid to use ConcurrentDictionary for safety of WebGL build. + static Dictionary> sizes = new Dictionary>(); + + static TaskPool() + { + try + { + var value = Environment.GetEnvironmentVariable("UNITASK_MAX_POOLSIZE"); + if (value != null) + { + if (int.TryParse(value, out var size)) + { + MaxPoolSize = size; + return; + } + } + } + catch { } + + MaxPoolSize = int.MaxValue; + } + + public static void SetMaxPoolSize(int maxPoolSize) + { + MaxPoolSize = maxPoolSize; + } + + public static IEnumerable<(Type, int)> GetCacheSizeInfo() + { + lock (sizes) + { + foreach (var item in sizes) + { + yield return (item.Key, item.Value()); + } + } + } + + public static void RegisterSizeGetter(Type type, Func getSize) + { + lock (sizes) + { + sizes[type] = getSize; + } + } + } + + public interface ITaskPoolNode + { + ref T NextNode { get; } + } + + // mutable struct, don't mark readonly. + [StructLayout(LayoutKind.Auto)] + public struct TaskPool + where T : class, ITaskPoolNode + { + int gate; + int size; + T root; + + public int Size => size; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool TryPop(out T result) + { + if (Interlocked.CompareExchange(ref gate, 1, 0) == 0) + { + var v = root; + if (!(v is null)) + { + ref var nextNode = ref v.NextNode; + root = nextNode; + nextNode = null; + size--; + result = v; + Volatile.Write(ref gate, 0); + return true; + } + + Volatile.Write(ref gate, 0); + } + result = default; + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool TryPush(T item) + { + if (Interlocked.CompareExchange(ref gate, 1, 0) == 0) + { + if (size < TaskPool.MaxPoolSize) + { + item.NextNode = root; + root = item; + size++; + Volatile.Write(ref gate, 0); + return true; + } + else + { + Volatile.Write(ref gate, 0); + } + } + return false; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/TaskPool.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/TaskPool.cs.meta new file mode 100644 index 00000000..94c78058 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/TaskPool.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19f4e6575150765449cc99f25f06f25f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/TimeoutController.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/TimeoutController.cs new file mode 100644 index 00000000..faca3478 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/TimeoutController.cs @@ -0,0 +1,129 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + // CancellationTokenSource itself can not reuse but CancelAfter(Timeout.InfiniteTimeSpan) allows reuse if did not reach timeout. + // Similar discussion: + // https://github.com/dotnet/runtime/issues/4694 + // https://github.com/dotnet/runtime/issues/48492 + // This TimeoutController emulate similar implementation, using CancelAfterSlim; to achieve zero allocation timeout. + + public sealed class TimeoutController : IDisposable + { + readonly static Action CancelCancellationTokenSourceStateDelegate = new Action(CancelCancellationTokenSourceState); + + static void CancelCancellationTokenSourceState(object state) + { + var cts = (CancellationTokenSource)state; + cts.Cancel(); + } + + CancellationTokenSource timeoutSource; + CancellationTokenSource linkedSource; + PlayerLoopTimer timer; + bool isDisposed; + + readonly DelayType delayType; + readonly PlayerLoopTiming delayTiming; + readonly CancellationTokenSource originalLinkCancellationTokenSource; + + public TimeoutController(DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update) + { + this.timeoutSource = new CancellationTokenSource(); + this.originalLinkCancellationTokenSource = null; + this.linkedSource = null; + this.delayType = delayType; + this.delayTiming = delayTiming; + } + + public TimeoutController(CancellationTokenSource linkCancellationTokenSource, DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update) + { + this.timeoutSource = new CancellationTokenSource(); + this.originalLinkCancellationTokenSource = linkCancellationTokenSource; + this.linkedSource = CancellationTokenSource.CreateLinkedTokenSource(timeoutSource.Token, linkCancellationTokenSource.Token); + this.delayType = delayType; + this.delayTiming = delayTiming; + } + + public CancellationToken Timeout(int millisecondsTimeout) + { + return Timeout(TimeSpan.FromMilliseconds(millisecondsTimeout)); + } + + public CancellationToken Timeout(TimeSpan timeout) + { + if (originalLinkCancellationTokenSource != null && originalLinkCancellationTokenSource.IsCancellationRequested) + { + return originalLinkCancellationTokenSource.Token; + } + + // Timeouted, create new source and timer. + if (timeoutSource.IsCancellationRequested) + { + timeoutSource.Dispose(); + timeoutSource = new CancellationTokenSource(); + if (linkedSource != null) + { + this.linkedSource.Cancel(); + this.linkedSource.Dispose(); + this.linkedSource = CancellationTokenSource.CreateLinkedTokenSource(timeoutSource.Token, originalLinkCancellationTokenSource.Token); + } + + timer?.Dispose(); + timer = null; + } + + var useSource = (linkedSource != null) ? linkedSource : timeoutSource; + var token = useSource.Token; + if (timer == null) + { + // Timer complete => timeoutSource.Cancel() -> linkedSource will be canceled. + // (linked)token is canceled => stop timer + timer = PlayerLoopTimer.StartNew(timeout, false, delayType, delayTiming, token, CancelCancellationTokenSourceStateDelegate, timeoutSource); + } + else + { + timer.Restart(timeout); + } + + return token; + } + + public bool IsTimeout() + { + return timeoutSource.IsCancellationRequested; + } + + public void Reset() + { + timer?.Stop(); + } + + public void Dispose() + { + if (isDisposed) return; + + try + { + // stop timer. + timer?.Dispose(); + + // cancel and dispose. + timeoutSource.Cancel(); + timeoutSource.Dispose(); + if (linkedSource != null) + { + linkedSource.Cancel(); + linkedSource.Dispose(); + } + } + finally + { + isDisposed = true; + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/TimeoutController.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/TimeoutController.cs.meta new file mode 100644 index 00000000..4f3d16d9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/TimeoutController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6347ab34d2db6d744a654e8d62d96b96 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/TriggerEvent.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/TriggerEvent.cs new file mode 100644 index 00000000..0b817fe3 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/TriggerEvent.cs @@ -0,0 +1,291 @@ +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public interface ITriggerHandler + { + void OnNext(T value); + void OnError(Exception ex); + void OnCompleted(); + void OnCanceled(CancellationToken cancellationToken); + + // set/get from TriggerEvent + ITriggerHandler Prev { get; set; } + ITriggerHandler Next { get; set; } + } + + // be careful to use, itself is struct. + public struct TriggerEvent + { + ITriggerHandler head; // head.prev is last + ITriggerHandler iteratingHead; + ITriggerHandler iteratingNode; + + void LogError(Exception ex) + { +#if UNITY_2018_3_OR_NEWER + UnityEngine.Debug.LogException(ex); +#else + Console.WriteLine(ex); +#endif + } + + public void SetResult(T value) + { + if (iteratingNode != null) + { + throw new InvalidOperationException("Can not trigger itself in iterating."); + } + + var h = head; + while (h != null) + { + iteratingNode = h; + + try + { + h.OnNext(value); + } + catch (Exception ex) + { + LogError(ex); + Remove(h); + } + + // If `h` itself is removed by OnNext, h.Next is null. + // Therefore, instead of looking at h.Next, the `iteratingNode` reference itself is replaced. + h = h == iteratingNode ? h.Next : iteratingNode; + } + + iteratingNode = null; + if (iteratingHead != null) + { + Add(iteratingHead); + iteratingHead = null; + } + } + + public void SetCanceled(CancellationToken cancellationToken) + { + if (iteratingNode != null) + { + throw new InvalidOperationException("Can not trigger itself in iterating."); + } + + var h = head; + while (h != null) + { + iteratingNode = h; + try + { + h.OnCanceled(cancellationToken); + } + catch (Exception ex) + { + LogError(ex); + } + + var next = h == iteratingNode ? h.Next : iteratingNode; + iteratingNode = null; + Remove(h); + h = next; + } + + iteratingNode = null; + if (iteratingHead != null) + { + Add(iteratingHead); + iteratingHead = null; + } + } + + public void SetCompleted() + { + if (iteratingNode != null) + { + throw new InvalidOperationException("Can not trigger itself in iterating."); + } + + var h = head; + while (h != null) + { + iteratingNode = h; + try + { + h.OnCompleted(); + } + catch (Exception ex) + { + LogError(ex); + } + + var next = h == iteratingNode ? h.Next : iteratingNode; + iteratingNode = null; + Remove(h); + h = next; + } + + iteratingNode = null; + if (iteratingHead != null) + { + Add(iteratingHead); + iteratingHead = null; + } + } + + public void SetError(Exception exception) + { + if (iteratingNode != null) + { + throw new InvalidOperationException("Can not trigger itself in iterating."); + } + + var h = head; + while (h != null) + { + iteratingNode = h; + try + { + h.OnError(exception); + } + catch (Exception ex) + { + LogError(ex); + } + + var next = h == iteratingNode ? h.Next : iteratingNode; + iteratingNode = null; + Remove(h); + h = next; + } + + iteratingNode = null; + if (iteratingHead != null) + { + Add(iteratingHead); + iteratingHead = null; + } + } + + public void Add(ITriggerHandler handler) + { + if (handler == null) throw new ArgumentNullException(nameof(handler)); + + // zero node. + if (head == null) + { + head = handler; + return; + } + + if (iteratingNode != null) + { + if (iteratingHead == null) + { + iteratingHead = handler; + return; + } + + var last = iteratingHead.Prev; + if (last == null) + { + // single node. + iteratingHead.Prev = handler; + iteratingHead.Next = handler; + handler.Prev = iteratingHead; + } + else + { + // multi node + iteratingHead.Prev = handler; + last.Next = handler; + handler.Prev = last; + } + } + else + { + var last = head.Prev; + if (last == null) + { + // single node. + head.Prev = handler; + head.Next = handler; + handler.Prev = head; + } + else + { + // multi node + head.Prev = handler; + last.Next = handler; + handler.Prev = last; + } + } + } + + public void Remove(ITriggerHandler handler) + { + if (handler == null) throw new ArgumentNullException(nameof(handler)); + + var prev = handler.Prev; + var next = handler.Next; + + if (next != null) + { + next.Prev = prev; + } + + if (handler == head) + { + head = next; + } + // when handler is head, prev indicate last so don't use it. + else if (prev != null) + { + prev.Next = next; + } + + if (handler == iteratingNode) + { + iteratingNode = next; + } + if (handler == iteratingHead) + { + iteratingHead = next; + } + + if (head != null) + { + if (head.Prev == handler) + { + if (prev != head) + { + head.Prev = prev; + } + else + { + head.Prev = null; + } + } + } + + if (iteratingHead != null) + { + if (iteratingHead.Prev == handler) + { + if (prev != iteratingHead.Prev) + { + iteratingHead.Prev = prev; + } + else + { + iteratingHead.Prev = null; + } + } + } + + handler.Prev = null; + handler.Next = null; + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/TriggerEvent.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/TriggerEvent.cs.meta new file mode 100644 index 00000000..bbd47af7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/TriggerEvent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f68b22bb8f66f5c4885f9bd3c4fc43ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers.meta new file mode 100644 index 00000000..64df468b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 503cf598f57d592459d4cfd71cfc83f4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncAwakeTrigger.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncAwakeTrigger.cs new file mode 100644 index 00000000..a734f29d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncAwakeTrigger.cs @@ -0,0 +1,32 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System.Threading; +using UnityEngine; + +namespace Cysharp.Threading.Tasks.Triggers +{ + public static partial class AsyncTriggerExtensions + { + public static AsyncAwakeTrigger GetAsyncAwakeTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncAwakeTrigger GetAsyncAwakeTrigger(this Component component) + { + return component.gameObject.GetAsyncAwakeTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncAwakeTrigger : AsyncTriggerBase + { + public UniTask AwakeAsync() + { + if (calledAwake) return UniTask.CompletedTask; + + return ((IAsyncOneShotTrigger)new AsyncTriggerHandler(this, true)).OneShotAsync(); + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncAwakeTrigger.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncAwakeTrigger.cs.meta new file mode 100644 index 00000000..097fdb61 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncAwakeTrigger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef2840a2586894741a0ae211b8fd669b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncDestroyTrigger.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncDestroyTrigger.cs new file mode 100644 index 00000000..77c92859 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncDestroyTrigger.cs @@ -0,0 +1,95 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System.Threading; +using UnityEngine; + +namespace Cysharp.Threading.Tasks.Triggers +{ + public static partial class AsyncTriggerExtensions + { + public static AsyncDestroyTrigger GetAsyncDestroyTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncDestroyTrigger GetAsyncDestroyTrigger(this Component component) + { + return component.gameObject.GetAsyncDestroyTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncDestroyTrigger : MonoBehaviour + { + bool awakeCalled = false; + bool called = false; + CancellationTokenSource cancellationTokenSource; + + public CancellationToken CancellationToken + { + get + { + if (cancellationTokenSource == null) + { + cancellationTokenSource = new CancellationTokenSource(); + if (!awakeCalled) + { + PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this)); + } + } + return cancellationTokenSource.Token; + } + } + + void Awake() + { + awakeCalled = true; + } + + void OnDestroy() + { + called = true; + + cancellationTokenSource?.Cancel(); + cancellationTokenSource?.Dispose(); + } + + public UniTask OnDestroyAsync() + { + if (called) return UniTask.CompletedTask; + + var tcs = new UniTaskCompletionSource(); + + // OnDestroy = Called Cancel. + CancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var tcs2 = (UniTaskCompletionSource)state; + tcs2.TrySetResult(); + }, tcs); + + return tcs.Task; + } + + class AwakeMonitor : IPlayerLoopItem + { + readonly AsyncDestroyTrigger trigger; + + public AwakeMonitor(AsyncDestroyTrigger trigger) + { + this.trigger = trigger; + } + + public bool MoveNext() + { + if (trigger.called || trigger.awakeCalled) return false; + if (trigger == null) + { + trigger.OnDestroy(); + return false; + } + return true; + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncDestroyTrigger.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncDestroyTrigger.cs.meta new file mode 100644 index 00000000..64500494 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncDestroyTrigger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f4afdcb1cbadf954ba8b1cf465429e17 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncStartTrigger.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncStartTrigger.cs new file mode 100644 index 00000000..63da82aa --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncStartTrigger.cs @@ -0,0 +1,38 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using UnityEngine; + +namespace Cysharp.Threading.Tasks.Triggers +{ + public static partial class AsyncTriggerExtensions + { + public static AsyncStartTrigger GetAsyncStartTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncStartTrigger GetAsyncStartTrigger(this Component component) + { + return component.gameObject.GetAsyncStartTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncStartTrigger : AsyncTriggerBase + { + bool called; + + void Start() + { + called = true; + RaiseEvent(AsyncUnit.Default); + } + + public UniTask StartAsync() + { + if (called) return UniTask.CompletedTask; + + return ((IAsyncOneShotTrigger)new AsyncTriggerHandler(this, true)).OneShotAsync(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncStartTrigger.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncStartTrigger.cs.meta new file mode 100644 index 00000000..9ef06e8e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncStartTrigger.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b4fd0f75e54ec3d4fbcb7fc65b11646b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs new file mode 100644 index 00000000..fb6ca6ef --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs @@ -0,0 +1,310 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Threading; +using UnityEngine; + +namespace Cysharp.Threading.Tasks.Triggers +{ + public abstract class AsyncTriggerBase : MonoBehaviour, IUniTaskAsyncEnumerable + { + TriggerEvent triggerEvent; + + internal protected bool calledAwake; + internal protected bool calledDestroy; + + void Awake() + { + calledAwake = true; + } + + void OnDestroy() + { + if (calledDestroy) return; + calledDestroy = true; + + triggerEvent.SetCompleted(); + } + + internal void AddHandler(ITriggerHandler handler) + { + if (!calledAwake) + { + PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this)); + } + + triggerEvent.Add(handler); + } + + internal void RemoveHandler(ITriggerHandler handler) + { + if (!calledAwake) + { + PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, new AwakeMonitor(this)); + } + + triggerEvent.Remove(handler); + } + + protected void RaiseEvent(T value) + { + triggerEvent.SetResult(value); + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return new AsyncTriggerEnumerator(this, cancellationToken); + } + + sealed class AsyncTriggerEnumerator : MoveNextSource, IUniTaskAsyncEnumerator, ITriggerHandler + { + static Action cancellationCallback = CancellationCallback; + + readonly AsyncTriggerBase parent; + CancellationToken cancellationToken; + CancellationTokenRegistration registration; + bool called; + bool isDisposed; + + public AsyncTriggerEnumerator(AsyncTriggerBase parent, CancellationToken cancellationToken) + { + this.parent = parent; + this.cancellationToken = cancellationToken; + } + + public void OnCanceled(CancellationToken cancellationToken = default) + { + completionSource.TrySetCanceled(cancellationToken); + } + + public void OnNext(T value) + { + Current = value; + completionSource.TrySetResult(true); + } + + public void OnCompleted() + { + completionSource.TrySetResult(false); + } + + public void OnError(Exception ex) + { + completionSource.TrySetException(ex); + } + + static void CancellationCallback(object state) + { + var self = (AsyncTriggerEnumerator)state; + self.DisposeAsync().Forget(); // sync + + self.completionSource.TrySetCanceled(self.cancellationToken); + } + + public T Current { get; private set; } + ITriggerHandler ITriggerHandler.Prev { get; set; } + ITriggerHandler ITriggerHandler.Next { get; set; } + + public UniTask MoveNextAsync() + { + cancellationToken.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (!called) + { + called = true; + + TaskTracker.TrackActiveTask(this, 3); + parent.AddHandler(this); + if (cancellationToken.CanBeCanceled) + { + registration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); + } + } + + return new UniTask(this, completionSource.Version); + } + + public UniTask DisposeAsync() + { + if (!isDisposed) + { + isDisposed = true; + TaskTracker.RemoveTracking(this); + registration.Dispose(); + parent.RemoveHandler(this); + } + + return default; + } + } + + class AwakeMonitor : IPlayerLoopItem + { + readonly AsyncTriggerBase trigger; + + public AwakeMonitor(AsyncTriggerBase trigger) + { + this.trigger = trigger; + } + + public bool MoveNext() + { + if (trigger.calledAwake) return false; + if (trigger == null) + { + trigger.OnDestroy(); + return false; + } + return true; + } + } + } + + public interface IAsyncOneShotTrigger + { + UniTask OneShotAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOneShotTrigger + { + UniTask IAsyncOneShotTrigger.OneShotAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)this, core.Version); + } + } + + public sealed partial class AsyncTriggerHandler : IUniTaskSource, ITriggerHandler, IDisposable + { + static Action cancellationCallback = CancellationCallback; + + readonly AsyncTriggerBase trigger; + + CancellationToken cancellationToken; + CancellationTokenRegistration registration; + bool isDisposed; + bool callOnce; + + UniTaskCompletionSourceCore core; + + internal CancellationToken CancellationToken => cancellationToken; + + ITriggerHandler ITriggerHandler.Prev { get; set; } + ITriggerHandler ITriggerHandler.Next { get; set; } + + internal AsyncTriggerHandler(AsyncTriggerBase trigger, bool callOnce) + { + if (cancellationToken.IsCancellationRequested) + { + isDisposed = true; + return; + } + + this.trigger = trigger; + this.cancellationToken = default; + this.registration = default; + this.callOnce = callOnce; + + trigger.AddHandler(this); + + TaskTracker.TrackActiveTask(this, 3); + } + + internal AsyncTriggerHandler(AsyncTriggerBase trigger, CancellationToken cancellationToken, bool callOnce) + { + if (cancellationToken.IsCancellationRequested) + { + isDisposed = true; + return; + } + + this.trigger = trigger; + this.cancellationToken = cancellationToken; + this.callOnce = callOnce; + + trigger.AddHandler(this); + + if (cancellationToken.CanBeCanceled) + { + registration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); + } + + TaskTracker.TrackActiveTask(this, 3); + } + + static void CancellationCallback(object state) + { + var self = (AsyncTriggerHandler)state; + self.Dispose(); + + self.core.TrySetCanceled(self.cancellationToken); + } + + public void Dispose() + { + if (!isDisposed) + { + isDisposed = true; + TaskTracker.RemoveTracking(this); + registration.Dispose(); + trigger.RemoveHandler(this); + } + } + + T IUniTaskSource.GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + if (callOnce) + { + Dispose(); + } + } + } + + void ITriggerHandler.OnNext(T value) + { + core.TrySetResult(value); + } + + void ITriggerHandler.OnCanceled(CancellationToken cancellationToken) + { + core.TrySetCanceled(cancellationToken); + } + + void ITriggerHandler.OnCompleted() + { + core.TrySetCanceled(CancellationToken.None); + } + + void ITriggerHandler.OnError(Exception ex) + { + core.TrySetException(ex); + } + + void IUniTaskSource.GetResult(short token) + { + ((IUniTaskSource)this).GetResult(token); + } + + UniTaskStatus IUniTaskSource.GetStatus(short token) + { + return core.GetStatus(token); + } + + UniTaskStatus IUniTaskSource.UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs.meta new file mode 100644 index 00000000..e101ea2d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2c0c2bcee832c6641b25949c412f020f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerExtensions.cs new file mode 100644 index 00000000..bad5a046 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerExtensions.cs @@ -0,0 +1,102 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System.Threading; +using UnityEngine; +using Cysharp.Threading.Tasks.Triggers; + +namespace Cysharp.Threading.Tasks +{ + public static class UniTaskCancellationExtensions + { +#if UNITY_2022_2_OR_NEWER + + /// This CancellationToken is canceled when the MonoBehaviour will be destroyed. + public static CancellationToken GetCancellationTokenOnDestroy(this MonoBehaviour monoBehaviour) + { + return monoBehaviour.destroyCancellationToken; + } + +#endif + + /// This CancellationToken is canceled when the MonoBehaviour will be destroyed. + public static CancellationToken GetCancellationTokenOnDestroy(this GameObject gameObject) + { + return gameObject.GetAsyncDestroyTrigger().CancellationToken; + } + + /// This CancellationToken is canceled when the MonoBehaviour will be destroyed. + public static CancellationToken GetCancellationTokenOnDestroy(this Component component) + { +#if UNITY_2022_2_OR_NEWER + if (component is MonoBehaviour mb) + { + return mb.destroyCancellationToken; + } +#endif + + return component.GetAsyncDestroyTrigger().CancellationToken; + } + } +} + +namespace Cysharp.Threading.Tasks.Triggers +{ + public static partial class AsyncTriggerExtensions + { + // Util. + + static T GetOrAddComponent(GameObject gameObject) + where T : Component + { +#if UNITY_2019_2_OR_NEWER + if (!gameObject.TryGetComponent(out var component)) + { + component = gameObject.AddComponent(); + } +#else + var component = gameObject.GetComponent(); + if (component == null) + { + component = gameObject.AddComponent(); + } +#endif + + return component; + } + + // Special for single operation. + + /// This function is called when the MonoBehaviour will be destroyed. + public static UniTask OnDestroyAsync(this GameObject gameObject) + { + return gameObject.GetAsyncDestroyTrigger().OnDestroyAsync(); + } + + /// This function is called when the MonoBehaviour will be destroyed. + public static UniTask OnDestroyAsync(this Component component) + { + return component.GetAsyncDestroyTrigger().OnDestroyAsync(); + } + + public static UniTask StartAsync(this GameObject gameObject) + { + return gameObject.GetAsyncStartTrigger().StartAsync(); + } + + public static UniTask StartAsync(this Component component) + { + return component.GetAsyncStartTrigger().StartAsync(); + } + + public static UniTask AwakeAsync(this GameObject gameObject) + { + return gameObject.GetAsyncAwakeTrigger().AwakeAsync(); + } + + public static UniTask AwakeAsync(this Component component) + { + return component.GetAsyncAwakeTrigger().AwakeAsync(); + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerExtensions.cs.meta new file mode 100644 index 00000000..348783dd --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/AsyncTriggerExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 59b61dbea1562a84fb7a38ae0a0a0f88 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs new file mode 100644 index 00000000..6ef50146 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs @@ -0,0 +1,4457 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System.Threading; +using UnityEngine; +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT +using UnityEngine.EventSystems; +#endif + +namespace Cysharp.Threading.Tasks.Triggers +{ +#region FixedUpdate + + public interface IAsyncFixedUpdateHandler + { + UniTask FixedUpdateAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncFixedUpdateHandler + { + UniTask IAsyncFixedUpdateHandler.FixedUpdateAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncFixedUpdateTrigger GetAsyncFixedUpdateTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncFixedUpdateTrigger GetAsyncFixedUpdateTrigger(this Component component) + { + return component.gameObject.GetAsyncFixedUpdateTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncFixedUpdateTrigger : AsyncTriggerBase + { + void FixedUpdate() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncFixedUpdateHandler GetFixedUpdateAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncFixedUpdateHandler GetFixedUpdateAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask FixedUpdateAsync() + { + return ((IAsyncFixedUpdateHandler)new AsyncTriggerHandler(this, true)).FixedUpdateAsync(); + } + + public UniTask FixedUpdateAsync(CancellationToken cancellationToken) + { + return ((IAsyncFixedUpdateHandler)new AsyncTriggerHandler(this, cancellationToken, true)).FixedUpdateAsync(); + } + } +#endregion + +#region LateUpdate + + public interface IAsyncLateUpdateHandler + { + UniTask LateUpdateAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncLateUpdateHandler + { + UniTask IAsyncLateUpdateHandler.LateUpdateAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncLateUpdateTrigger GetAsyncLateUpdateTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncLateUpdateTrigger GetAsyncLateUpdateTrigger(this Component component) + { + return component.gameObject.GetAsyncLateUpdateTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncLateUpdateTrigger : AsyncTriggerBase + { + void LateUpdate() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncLateUpdateHandler GetLateUpdateAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncLateUpdateHandler GetLateUpdateAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask LateUpdateAsync() + { + return ((IAsyncLateUpdateHandler)new AsyncTriggerHandler(this, true)).LateUpdateAsync(); + } + + public UniTask LateUpdateAsync(CancellationToken cancellationToken) + { + return ((IAsyncLateUpdateHandler)new AsyncTriggerHandler(this, cancellationToken, true)).LateUpdateAsync(); + } + } +#endregion + +#region AnimatorIK + + public interface IAsyncOnAnimatorIKHandler + { + UniTask OnAnimatorIKAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnAnimatorIKHandler + { + UniTask IAsyncOnAnimatorIKHandler.OnAnimatorIKAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncAnimatorIKTrigger GetAsyncAnimatorIKTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncAnimatorIKTrigger GetAsyncAnimatorIKTrigger(this Component component) + { + return component.gameObject.GetAsyncAnimatorIKTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncAnimatorIKTrigger : AsyncTriggerBase + { + void OnAnimatorIK(int layerIndex) + { + RaiseEvent((layerIndex)); + } + + public IAsyncOnAnimatorIKHandler GetOnAnimatorIKAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnAnimatorIKHandler GetOnAnimatorIKAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnAnimatorIKAsync() + { + return ((IAsyncOnAnimatorIKHandler)new AsyncTriggerHandler(this, true)).OnAnimatorIKAsync(); + } + + public UniTask OnAnimatorIKAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnAnimatorIKHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnAnimatorIKAsync(); + } + } +#endregion + +#region AnimatorMove + + public interface IAsyncOnAnimatorMoveHandler + { + UniTask OnAnimatorMoveAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnAnimatorMoveHandler + { + UniTask IAsyncOnAnimatorMoveHandler.OnAnimatorMoveAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncAnimatorMoveTrigger GetAsyncAnimatorMoveTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncAnimatorMoveTrigger GetAsyncAnimatorMoveTrigger(this Component component) + { + return component.gameObject.GetAsyncAnimatorMoveTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncAnimatorMoveTrigger : AsyncTriggerBase + { + void OnAnimatorMove() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnAnimatorMoveHandler GetOnAnimatorMoveAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnAnimatorMoveHandler GetOnAnimatorMoveAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnAnimatorMoveAsync() + { + return ((IAsyncOnAnimatorMoveHandler)new AsyncTriggerHandler(this, true)).OnAnimatorMoveAsync(); + } + + public UniTask OnAnimatorMoveAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnAnimatorMoveHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnAnimatorMoveAsync(); + } + } +#endregion + +#region ApplicationFocus + + public interface IAsyncOnApplicationFocusHandler + { + UniTask OnApplicationFocusAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnApplicationFocusHandler + { + UniTask IAsyncOnApplicationFocusHandler.OnApplicationFocusAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncApplicationFocusTrigger GetAsyncApplicationFocusTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncApplicationFocusTrigger GetAsyncApplicationFocusTrigger(this Component component) + { + return component.gameObject.GetAsyncApplicationFocusTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncApplicationFocusTrigger : AsyncTriggerBase + { + void OnApplicationFocus(bool hasFocus) + { + RaiseEvent((hasFocus)); + } + + public IAsyncOnApplicationFocusHandler GetOnApplicationFocusAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnApplicationFocusHandler GetOnApplicationFocusAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnApplicationFocusAsync() + { + return ((IAsyncOnApplicationFocusHandler)new AsyncTriggerHandler(this, true)).OnApplicationFocusAsync(); + } + + public UniTask OnApplicationFocusAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnApplicationFocusHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnApplicationFocusAsync(); + } + } +#endregion + +#region ApplicationPause + + public interface IAsyncOnApplicationPauseHandler + { + UniTask OnApplicationPauseAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnApplicationPauseHandler + { + UniTask IAsyncOnApplicationPauseHandler.OnApplicationPauseAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncApplicationPauseTrigger GetAsyncApplicationPauseTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncApplicationPauseTrigger GetAsyncApplicationPauseTrigger(this Component component) + { + return component.gameObject.GetAsyncApplicationPauseTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncApplicationPauseTrigger : AsyncTriggerBase + { + void OnApplicationPause(bool pauseStatus) + { + RaiseEvent((pauseStatus)); + } + + public IAsyncOnApplicationPauseHandler GetOnApplicationPauseAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnApplicationPauseHandler GetOnApplicationPauseAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnApplicationPauseAsync() + { + return ((IAsyncOnApplicationPauseHandler)new AsyncTriggerHandler(this, true)).OnApplicationPauseAsync(); + } + + public UniTask OnApplicationPauseAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnApplicationPauseHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnApplicationPauseAsync(); + } + } +#endregion + +#region ApplicationQuit + + public interface IAsyncOnApplicationQuitHandler + { + UniTask OnApplicationQuitAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnApplicationQuitHandler + { + UniTask IAsyncOnApplicationQuitHandler.OnApplicationQuitAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncApplicationQuitTrigger GetAsyncApplicationQuitTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncApplicationQuitTrigger GetAsyncApplicationQuitTrigger(this Component component) + { + return component.gameObject.GetAsyncApplicationQuitTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncApplicationQuitTrigger : AsyncTriggerBase + { + void OnApplicationQuit() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnApplicationQuitHandler GetOnApplicationQuitAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnApplicationQuitHandler GetOnApplicationQuitAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnApplicationQuitAsync() + { + return ((IAsyncOnApplicationQuitHandler)new AsyncTriggerHandler(this, true)).OnApplicationQuitAsync(); + } + + public UniTask OnApplicationQuitAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnApplicationQuitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnApplicationQuitAsync(); + } + } +#endregion + +#region AudioFilterRead + + public interface IAsyncOnAudioFilterReadHandler + { + UniTask<(float[] data, int channels)> OnAudioFilterReadAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnAudioFilterReadHandler + { + UniTask<(float[] data, int channels)> IAsyncOnAudioFilterReadHandler.OnAudioFilterReadAsync() + { + core.Reset(); + return new UniTask<(float[] data, int channels)>((IUniTaskSource<(float[] data, int channels)>)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncAudioFilterReadTrigger GetAsyncAudioFilterReadTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncAudioFilterReadTrigger GetAsyncAudioFilterReadTrigger(this Component component) + { + return component.gameObject.GetAsyncAudioFilterReadTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncAudioFilterReadTrigger : AsyncTriggerBase<(float[] data, int channels)> + { + void OnAudioFilterRead(float[] data, int channels) + { + RaiseEvent((data, channels)); + } + + public IAsyncOnAudioFilterReadHandler GetOnAudioFilterReadAsyncHandler() + { + return new AsyncTriggerHandler<(float[] data, int channels)>(this, false); + } + + public IAsyncOnAudioFilterReadHandler GetOnAudioFilterReadAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler<(float[] data, int channels)>(this, cancellationToken, false); + } + + public UniTask<(float[] data, int channels)> OnAudioFilterReadAsync() + { + return ((IAsyncOnAudioFilterReadHandler)new AsyncTriggerHandler<(float[] data, int channels)>(this, true)).OnAudioFilterReadAsync(); + } + + public UniTask<(float[] data, int channels)> OnAudioFilterReadAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnAudioFilterReadHandler)new AsyncTriggerHandler<(float[] data, int channels)>(this, cancellationToken, true)).OnAudioFilterReadAsync(); + } + } +#endregion + +#region BecameInvisible + + public interface IAsyncOnBecameInvisibleHandler + { + UniTask OnBecameInvisibleAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnBecameInvisibleHandler + { + UniTask IAsyncOnBecameInvisibleHandler.OnBecameInvisibleAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncBecameInvisibleTrigger GetAsyncBecameInvisibleTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncBecameInvisibleTrigger GetAsyncBecameInvisibleTrigger(this Component component) + { + return component.gameObject.GetAsyncBecameInvisibleTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncBecameInvisibleTrigger : AsyncTriggerBase + { + void OnBecameInvisible() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnBecameInvisibleHandler GetOnBecameInvisibleAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnBecameInvisibleHandler GetOnBecameInvisibleAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnBecameInvisibleAsync() + { + return ((IAsyncOnBecameInvisibleHandler)new AsyncTriggerHandler(this, true)).OnBecameInvisibleAsync(); + } + + public UniTask OnBecameInvisibleAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnBecameInvisibleHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnBecameInvisibleAsync(); + } + } +#endregion + +#region BecameVisible + + public interface IAsyncOnBecameVisibleHandler + { + UniTask OnBecameVisibleAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnBecameVisibleHandler + { + UniTask IAsyncOnBecameVisibleHandler.OnBecameVisibleAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncBecameVisibleTrigger GetAsyncBecameVisibleTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncBecameVisibleTrigger GetAsyncBecameVisibleTrigger(this Component component) + { + return component.gameObject.GetAsyncBecameVisibleTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncBecameVisibleTrigger : AsyncTriggerBase + { + void OnBecameVisible() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnBecameVisibleHandler GetOnBecameVisibleAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnBecameVisibleHandler GetOnBecameVisibleAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnBecameVisibleAsync() + { + return ((IAsyncOnBecameVisibleHandler)new AsyncTriggerHandler(this, true)).OnBecameVisibleAsync(); + } + + public UniTask OnBecameVisibleAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnBecameVisibleHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnBecameVisibleAsync(); + } + } +#endregion + +#region BeforeTransformParentChanged + + public interface IAsyncOnBeforeTransformParentChangedHandler + { + UniTask OnBeforeTransformParentChangedAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnBeforeTransformParentChangedHandler + { + UniTask IAsyncOnBeforeTransformParentChangedHandler.OnBeforeTransformParentChangedAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncBeforeTransformParentChangedTrigger GetAsyncBeforeTransformParentChangedTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncBeforeTransformParentChangedTrigger GetAsyncBeforeTransformParentChangedTrigger(this Component component) + { + return component.gameObject.GetAsyncBeforeTransformParentChangedTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncBeforeTransformParentChangedTrigger : AsyncTriggerBase + { + void OnBeforeTransformParentChanged() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnBeforeTransformParentChangedHandler GetOnBeforeTransformParentChangedAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnBeforeTransformParentChangedHandler GetOnBeforeTransformParentChangedAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnBeforeTransformParentChangedAsync() + { + return ((IAsyncOnBeforeTransformParentChangedHandler)new AsyncTriggerHandler(this, true)).OnBeforeTransformParentChangedAsync(); + } + + public UniTask OnBeforeTransformParentChangedAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnBeforeTransformParentChangedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnBeforeTransformParentChangedAsync(); + } + } +#endregion + +#region OnCanvasGroupChanged + + public interface IAsyncOnCanvasGroupChangedHandler + { + UniTask OnCanvasGroupChangedAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnCanvasGroupChangedHandler + { + UniTask IAsyncOnCanvasGroupChangedHandler.OnCanvasGroupChangedAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncOnCanvasGroupChangedTrigger GetAsyncOnCanvasGroupChangedTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncOnCanvasGroupChangedTrigger GetAsyncOnCanvasGroupChangedTrigger(this Component component) + { + return component.gameObject.GetAsyncOnCanvasGroupChangedTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncOnCanvasGroupChangedTrigger : AsyncTriggerBase + { + void OnCanvasGroupChanged() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnCanvasGroupChangedHandler GetOnCanvasGroupChangedAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnCanvasGroupChangedHandler GetOnCanvasGroupChangedAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnCanvasGroupChangedAsync() + { + return ((IAsyncOnCanvasGroupChangedHandler)new AsyncTriggerHandler(this, true)).OnCanvasGroupChangedAsync(); + } + + public UniTask OnCanvasGroupChangedAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnCanvasGroupChangedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCanvasGroupChangedAsync(); + } + } +#endregion + +#region CollisionEnter +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT + + public interface IAsyncOnCollisionEnterHandler + { + UniTask OnCollisionEnterAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnCollisionEnterHandler + { + UniTask IAsyncOnCollisionEnterHandler.OnCollisionEnterAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncCollisionEnterTrigger GetAsyncCollisionEnterTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncCollisionEnterTrigger GetAsyncCollisionEnterTrigger(this Component component) + { + return component.gameObject.GetAsyncCollisionEnterTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncCollisionEnterTrigger : AsyncTriggerBase + { + void OnCollisionEnter(Collision coll) + { + RaiseEvent((coll)); + } + + public IAsyncOnCollisionEnterHandler GetOnCollisionEnterAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnCollisionEnterHandler GetOnCollisionEnterAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnCollisionEnterAsync() + { + return ((IAsyncOnCollisionEnterHandler)new AsyncTriggerHandler(this, true)).OnCollisionEnterAsync(); + } + + public UniTask OnCollisionEnterAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnCollisionEnterHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionEnterAsync(); + } + } +#endif +#endregion + +#region CollisionEnter2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT + + public interface IAsyncOnCollisionEnter2DHandler + { + UniTask OnCollisionEnter2DAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnCollisionEnter2DHandler + { + UniTask IAsyncOnCollisionEnter2DHandler.OnCollisionEnter2DAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncCollisionEnter2DTrigger GetAsyncCollisionEnter2DTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncCollisionEnter2DTrigger GetAsyncCollisionEnter2DTrigger(this Component component) + { + return component.gameObject.GetAsyncCollisionEnter2DTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncCollisionEnter2DTrigger : AsyncTriggerBase + { + void OnCollisionEnter2D(Collision2D coll) + { + RaiseEvent((coll)); + } + + public IAsyncOnCollisionEnter2DHandler GetOnCollisionEnter2DAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnCollisionEnter2DHandler GetOnCollisionEnter2DAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnCollisionEnter2DAsync() + { + return ((IAsyncOnCollisionEnter2DHandler)new AsyncTriggerHandler(this, true)).OnCollisionEnter2DAsync(); + } + + public UniTask OnCollisionEnter2DAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnCollisionEnter2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionEnter2DAsync(); + } + } +#endif +#endregion + +#region CollisionExit +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT + + public interface IAsyncOnCollisionExitHandler + { + UniTask OnCollisionExitAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnCollisionExitHandler + { + UniTask IAsyncOnCollisionExitHandler.OnCollisionExitAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncCollisionExitTrigger GetAsyncCollisionExitTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncCollisionExitTrigger GetAsyncCollisionExitTrigger(this Component component) + { + return component.gameObject.GetAsyncCollisionExitTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncCollisionExitTrigger : AsyncTriggerBase + { + void OnCollisionExit(Collision coll) + { + RaiseEvent((coll)); + } + + public IAsyncOnCollisionExitHandler GetOnCollisionExitAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnCollisionExitHandler GetOnCollisionExitAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnCollisionExitAsync() + { + return ((IAsyncOnCollisionExitHandler)new AsyncTriggerHandler(this, true)).OnCollisionExitAsync(); + } + + public UniTask OnCollisionExitAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnCollisionExitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionExitAsync(); + } + } +#endif +#endregion + +#region CollisionExit2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT + + public interface IAsyncOnCollisionExit2DHandler + { + UniTask OnCollisionExit2DAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnCollisionExit2DHandler + { + UniTask IAsyncOnCollisionExit2DHandler.OnCollisionExit2DAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncCollisionExit2DTrigger GetAsyncCollisionExit2DTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncCollisionExit2DTrigger GetAsyncCollisionExit2DTrigger(this Component component) + { + return component.gameObject.GetAsyncCollisionExit2DTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncCollisionExit2DTrigger : AsyncTriggerBase + { + void OnCollisionExit2D(Collision2D coll) + { + RaiseEvent((coll)); + } + + public IAsyncOnCollisionExit2DHandler GetOnCollisionExit2DAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnCollisionExit2DHandler GetOnCollisionExit2DAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnCollisionExit2DAsync() + { + return ((IAsyncOnCollisionExit2DHandler)new AsyncTriggerHandler(this, true)).OnCollisionExit2DAsync(); + } + + public UniTask OnCollisionExit2DAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnCollisionExit2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionExit2DAsync(); + } + } +#endif +#endregion + +#region CollisionStay +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT + + public interface IAsyncOnCollisionStayHandler + { + UniTask OnCollisionStayAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnCollisionStayHandler + { + UniTask IAsyncOnCollisionStayHandler.OnCollisionStayAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncCollisionStayTrigger GetAsyncCollisionStayTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncCollisionStayTrigger GetAsyncCollisionStayTrigger(this Component component) + { + return component.gameObject.GetAsyncCollisionStayTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncCollisionStayTrigger : AsyncTriggerBase + { + void OnCollisionStay(Collision coll) + { + RaiseEvent((coll)); + } + + public IAsyncOnCollisionStayHandler GetOnCollisionStayAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnCollisionStayHandler GetOnCollisionStayAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnCollisionStayAsync() + { + return ((IAsyncOnCollisionStayHandler)new AsyncTriggerHandler(this, true)).OnCollisionStayAsync(); + } + + public UniTask OnCollisionStayAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnCollisionStayHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionStayAsync(); + } + } +#endif +#endregion + +#region CollisionStay2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT + + public interface IAsyncOnCollisionStay2DHandler + { + UniTask OnCollisionStay2DAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnCollisionStay2DHandler + { + UniTask IAsyncOnCollisionStay2DHandler.OnCollisionStay2DAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncCollisionStay2DTrigger GetAsyncCollisionStay2DTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncCollisionStay2DTrigger GetAsyncCollisionStay2DTrigger(this Component component) + { + return component.gameObject.GetAsyncCollisionStay2DTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncCollisionStay2DTrigger : AsyncTriggerBase + { + void OnCollisionStay2D(Collision2D coll) + { + RaiseEvent((coll)); + } + + public IAsyncOnCollisionStay2DHandler GetOnCollisionStay2DAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnCollisionStay2DHandler GetOnCollisionStay2DAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnCollisionStay2DAsync() + { + return ((IAsyncOnCollisionStay2DHandler)new AsyncTriggerHandler(this, true)).OnCollisionStay2DAsync(); + } + + public UniTask OnCollisionStay2DAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnCollisionStay2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCollisionStay2DAsync(); + } + } +#endif +#endregion + +#region ControllerColliderHit +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT + + public interface IAsyncOnControllerColliderHitHandler + { + UniTask OnControllerColliderHitAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnControllerColliderHitHandler + { + UniTask IAsyncOnControllerColliderHitHandler.OnControllerColliderHitAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncControllerColliderHitTrigger GetAsyncControllerColliderHitTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncControllerColliderHitTrigger GetAsyncControllerColliderHitTrigger(this Component component) + { + return component.gameObject.GetAsyncControllerColliderHitTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncControllerColliderHitTrigger : AsyncTriggerBase + { + void OnControllerColliderHit(ControllerColliderHit hit) + { + RaiseEvent((hit)); + } + + public IAsyncOnControllerColliderHitHandler GetOnControllerColliderHitAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnControllerColliderHitHandler GetOnControllerColliderHitAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnControllerColliderHitAsync() + { + return ((IAsyncOnControllerColliderHitHandler)new AsyncTriggerHandler(this, true)).OnControllerColliderHitAsync(); + } + + public UniTask OnControllerColliderHitAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnControllerColliderHitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnControllerColliderHitAsync(); + } + } +#endif +#endregion + +#region Disable + + public interface IAsyncOnDisableHandler + { + UniTask OnDisableAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnDisableHandler + { + UniTask IAsyncOnDisableHandler.OnDisableAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncDisableTrigger GetAsyncDisableTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncDisableTrigger GetAsyncDisableTrigger(this Component component) + { + return component.gameObject.GetAsyncDisableTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncDisableTrigger : AsyncTriggerBase + { + void OnDisable() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnDisableHandler GetOnDisableAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnDisableHandler GetOnDisableAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnDisableAsync() + { + return ((IAsyncOnDisableHandler)new AsyncTriggerHandler(this, true)).OnDisableAsync(); + } + + public UniTask OnDisableAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnDisableHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnDisableAsync(); + } + } +#endregion + +#region DrawGizmos + + public interface IAsyncOnDrawGizmosHandler + { + UniTask OnDrawGizmosAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnDrawGizmosHandler + { + UniTask IAsyncOnDrawGizmosHandler.OnDrawGizmosAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncDrawGizmosTrigger GetAsyncDrawGizmosTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncDrawGizmosTrigger GetAsyncDrawGizmosTrigger(this Component component) + { + return component.gameObject.GetAsyncDrawGizmosTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncDrawGizmosTrigger : AsyncTriggerBase + { + void OnDrawGizmos() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnDrawGizmosHandler GetOnDrawGizmosAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnDrawGizmosHandler GetOnDrawGizmosAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnDrawGizmosAsync() + { + return ((IAsyncOnDrawGizmosHandler)new AsyncTriggerHandler(this, true)).OnDrawGizmosAsync(); + } + + public UniTask OnDrawGizmosAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnDrawGizmosHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnDrawGizmosAsync(); + } + } +#endregion + +#region DrawGizmosSelected + + public interface IAsyncOnDrawGizmosSelectedHandler + { + UniTask OnDrawGizmosSelectedAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnDrawGizmosSelectedHandler + { + UniTask IAsyncOnDrawGizmosSelectedHandler.OnDrawGizmosSelectedAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncDrawGizmosSelectedTrigger GetAsyncDrawGizmosSelectedTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncDrawGizmosSelectedTrigger GetAsyncDrawGizmosSelectedTrigger(this Component component) + { + return component.gameObject.GetAsyncDrawGizmosSelectedTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncDrawGizmosSelectedTrigger : AsyncTriggerBase + { + void OnDrawGizmosSelected() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnDrawGizmosSelectedHandler GetOnDrawGizmosSelectedAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnDrawGizmosSelectedHandler GetOnDrawGizmosSelectedAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnDrawGizmosSelectedAsync() + { + return ((IAsyncOnDrawGizmosSelectedHandler)new AsyncTriggerHandler(this, true)).OnDrawGizmosSelectedAsync(); + } + + public UniTask OnDrawGizmosSelectedAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnDrawGizmosSelectedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnDrawGizmosSelectedAsync(); + } + } +#endregion + +#region Enable + + public interface IAsyncOnEnableHandler + { + UniTask OnEnableAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnEnableHandler + { + UniTask IAsyncOnEnableHandler.OnEnableAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncEnableTrigger GetAsyncEnableTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncEnableTrigger GetAsyncEnableTrigger(this Component component) + { + return component.gameObject.GetAsyncEnableTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncEnableTrigger : AsyncTriggerBase + { + void OnEnable() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnEnableHandler GetOnEnableAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnEnableHandler GetOnEnableAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnEnableAsync() + { + return ((IAsyncOnEnableHandler)new AsyncTriggerHandler(this, true)).OnEnableAsync(); + } + + public UniTask OnEnableAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnEnableHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnEnableAsync(); + } + } +#endregion + +#region GUI + + public interface IAsyncOnGUIHandler + { + UniTask OnGUIAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnGUIHandler + { + UniTask IAsyncOnGUIHandler.OnGUIAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncGUITrigger GetAsyncGUITrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncGUITrigger GetAsyncGUITrigger(this Component component) + { + return component.gameObject.GetAsyncGUITrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncGUITrigger : AsyncTriggerBase + { + void OnGUI() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnGUIHandler GetOnGUIAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnGUIHandler GetOnGUIAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnGUIAsync() + { + return ((IAsyncOnGUIHandler)new AsyncTriggerHandler(this, true)).OnGUIAsync(); + } + + public UniTask OnGUIAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnGUIHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnGUIAsync(); + } + } +#endregion + +#region JointBreak +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT + + public interface IAsyncOnJointBreakHandler + { + UniTask OnJointBreakAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnJointBreakHandler + { + UniTask IAsyncOnJointBreakHandler.OnJointBreakAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncJointBreakTrigger GetAsyncJointBreakTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncJointBreakTrigger GetAsyncJointBreakTrigger(this Component component) + { + return component.gameObject.GetAsyncJointBreakTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncJointBreakTrigger : AsyncTriggerBase + { + void OnJointBreak(float breakForce) + { + RaiseEvent((breakForce)); + } + + public IAsyncOnJointBreakHandler GetOnJointBreakAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnJointBreakHandler GetOnJointBreakAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnJointBreakAsync() + { + return ((IAsyncOnJointBreakHandler)new AsyncTriggerHandler(this, true)).OnJointBreakAsync(); + } + + public UniTask OnJointBreakAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnJointBreakHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnJointBreakAsync(); + } + } +#endif +#endregion + +#region JointBreak2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT + + public interface IAsyncOnJointBreak2DHandler + { + UniTask OnJointBreak2DAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnJointBreak2DHandler + { + UniTask IAsyncOnJointBreak2DHandler.OnJointBreak2DAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncJointBreak2DTrigger GetAsyncJointBreak2DTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncJointBreak2DTrigger GetAsyncJointBreak2DTrigger(this Component component) + { + return component.gameObject.GetAsyncJointBreak2DTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncJointBreak2DTrigger : AsyncTriggerBase + { + void OnJointBreak2D(Joint2D brokenJoint) + { + RaiseEvent((brokenJoint)); + } + + public IAsyncOnJointBreak2DHandler GetOnJointBreak2DAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnJointBreak2DHandler GetOnJointBreak2DAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnJointBreak2DAsync() + { + return ((IAsyncOnJointBreak2DHandler)new AsyncTriggerHandler(this, true)).OnJointBreak2DAsync(); + } + + public UniTask OnJointBreak2DAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnJointBreak2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnJointBreak2DAsync(); + } + } +#endif +#endregion + +#region MouseDown +#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) + + public interface IAsyncOnMouseDownHandler + { + UniTask OnMouseDownAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnMouseDownHandler + { + UniTask IAsyncOnMouseDownHandler.OnMouseDownAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncMouseDownTrigger GetAsyncMouseDownTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncMouseDownTrigger GetAsyncMouseDownTrigger(this Component component) + { + return component.gameObject.GetAsyncMouseDownTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncMouseDownTrigger : AsyncTriggerBase + { + void OnMouseDown() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnMouseDownHandler GetOnMouseDownAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnMouseDownHandler GetOnMouseDownAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnMouseDownAsync() + { + return ((IAsyncOnMouseDownHandler)new AsyncTriggerHandler(this, true)).OnMouseDownAsync(); + } + + public UniTask OnMouseDownAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnMouseDownHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnMouseDownAsync(); + } + } +#endif +#endregion + +#region MouseDrag +#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) + + public interface IAsyncOnMouseDragHandler + { + UniTask OnMouseDragAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnMouseDragHandler + { + UniTask IAsyncOnMouseDragHandler.OnMouseDragAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncMouseDragTrigger GetAsyncMouseDragTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncMouseDragTrigger GetAsyncMouseDragTrigger(this Component component) + { + return component.gameObject.GetAsyncMouseDragTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncMouseDragTrigger : AsyncTriggerBase + { + void OnMouseDrag() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnMouseDragHandler GetOnMouseDragAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnMouseDragHandler GetOnMouseDragAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnMouseDragAsync() + { + return ((IAsyncOnMouseDragHandler)new AsyncTriggerHandler(this, true)).OnMouseDragAsync(); + } + + public UniTask OnMouseDragAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnMouseDragHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnMouseDragAsync(); + } + } +#endif +#endregion + +#region MouseEnter +#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) + + public interface IAsyncOnMouseEnterHandler + { + UniTask OnMouseEnterAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnMouseEnterHandler + { + UniTask IAsyncOnMouseEnterHandler.OnMouseEnterAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncMouseEnterTrigger GetAsyncMouseEnterTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncMouseEnterTrigger GetAsyncMouseEnterTrigger(this Component component) + { + return component.gameObject.GetAsyncMouseEnterTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncMouseEnterTrigger : AsyncTriggerBase + { + void OnMouseEnter() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnMouseEnterHandler GetOnMouseEnterAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnMouseEnterHandler GetOnMouseEnterAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnMouseEnterAsync() + { + return ((IAsyncOnMouseEnterHandler)new AsyncTriggerHandler(this, true)).OnMouseEnterAsync(); + } + + public UniTask OnMouseEnterAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnMouseEnterHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnMouseEnterAsync(); + } + } +#endif +#endregion + +#region MouseExit +#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) + + public interface IAsyncOnMouseExitHandler + { + UniTask OnMouseExitAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnMouseExitHandler + { + UniTask IAsyncOnMouseExitHandler.OnMouseExitAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncMouseExitTrigger GetAsyncMouseExitTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncMouseExitTrigger GetAsyncMouseExitTrigger(this Component component) + { + return component.gameObject.GetAsyncMouseExitTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncMouseExitTrigger : AsyncTriggerBase + { + void OnMouseExit() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnMouseExitHandler GetOnMouseExitAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnMouseExitHandler GetOnMouseExitAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnMouseExitAsync() + { + return ((IAsyncOnMouseExitHandler)new AsyncTriggerHandler(this, true)).OnMouseExitAsync(); + } + + public UniTask OnMouseExitAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnMouseExitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnMouseExitAsync(); + } + } +#endif +#endregion + +#region MouseOver +#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) + + public interface IAsyncOnMouseOverHandler + { + UniTask OnMouseOverAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnMouseOverHandler + { + UniTask IAsyncOnMouseOverHandler.OnMouseOverAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncMouseOverTrigger GetAsyncMouseOverTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncMouseOverTrigger GetAsyncMouseOverTrigger(this Component component) + { + return component.gameObject.GetAsyncMouseOverTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncMouseOverTrigger : AsyncTriggerBase + { + void OnMouseOver() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnMouseOverHandler GetOnMouseOverAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnMouseOverHandler GetOnMouseOverAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnMouseOverAsync() + { + return ((IAsyncOnMouseOverHandler)new AsyncTriggerHandler(this, true)).OnMouseOverAsync(); + } + + public UniTask OnMouseOverAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnMouseOverHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnMouseOverAsync(); + } + } +#endif +#endregion + +#region MouseUp +#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) + + public interface IAsyncOnMouseUpHandler + { + UniTask OnMouseUpAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnMouseUpHandler + { + UniTask IAsyncOnMouseUpHandler.OnMouseUpAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncMouseUpTrigger GetAsyncMouseUpTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncMouseUpTrigger GetAsyncMouseUpTrigger(this Component component) + { + return component.gameObject.GetAsyncMouseUpTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncMouseUpTrigger : AsyncTriggerBase + { + void OnMouseUp() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnMouseUpHandler GetOnMouseUpAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnMouseUpHandler GetOnMouseUpAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnMouseUpAsync() + { + return ((IAsyncOnMouseUpHandler)new AsyncTriggerHandler(this, true)).OnMouseUpAsync(); + } + + public UniTask OnMouseUpAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnMouseUpHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnMouseUpAsync(); + } + } +#endif +#endregion + +#region MouseUpAsButton +#if !(UNITY_IPHONE || UNITY_ANDROID || UNITY_METRO) + + public interface IAsyncOnMouseUpAsButtonHandler + { + UniTask OnMouseUpAsButtonAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnMouseUpAsButtonHandler + { + UniTask IAsyncOnMouseUpAsButtonHandler.OnMouseUpAsButtonAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncMouseUpAsButtonTrigger GetAsyncMouseUpAsButtonTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncMouseUpAsButtonTrigger GetAsyncMouseUpAsButtonTrigger(this Component component) + { + return component.gameObject.GetAsyncMouseUpAsButtonTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncMouseUpAsButtonTrigger : AsyncTriggerBase + { + void OnMouseUpAsButton() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnMouseUpAsButtonHandler GetOnMouseUpAsButtonAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnMouseUpAsButtonHandler GetOnMouseUpAsButtonAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnMouseUpAsButtonAsync() + { + return ((IAsyncOnMouseUpAsButtonHandler)new AsyncTriggerHandler(this, true)).OnMouseUpAsButtonAsync(); + } + + public UniTask OnMouseUpAsButtonAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnMouseUpAsButtonHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnMouseUpAsButtonAsync(); + } + } +#endif +#endregion + +#region ParticleCollision + + public interface IAsyncOnParticleCollisionHandler + { + UniTask OnParticleCollisionAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnParticleCollisionHandler + { + UniTask IAsyncOnParticleCollisionHandler.OnParticleCollisionAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncParticleCollisionTrigger GetAsyncParticleCollisionTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncParticleCollisionTrigger GetAsyncParticleCollisionTrigger(this Component component) + { + return component.gameObject.GetAsyncParticleCollisionTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncParticleCollisionTrigger : AsyncTriggerBase + { + void OnParticleCollision(GameObject other) + { + RaiseEvent((other)); + } + + public IAsyncOnParticleCollisionHandler GetOnParticleCollisionAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnParticleCollisionHandler GetOnParticleCollisionAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnParticleCollisionAsync() + { + return ((IAsyncOnParticleCollisionHandler)new AsyncTriggerHandler(this, true)).OnParticleCollisionAsync(); + } + + public UniTask OnParticleCollisionAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnParticleCollisionHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnParticleCollisionAsync(); + } + } +#endregion + +#region ParticleSystemStopped + + public interface IAsyncOnParticleSystemStoppedHandler + { + UniTask OnParticleSystemStoppedAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnParticleSystemStoppedHandler + { + UniTask IAsyncOnParticleSystemStoppedHandler.OnParticleSystemStoppedAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncParticleSystemStoppedTrigger GetAsyncParticleSystemStoppedTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncParticleSystemStoppedTrigger GetAsyncParticleSystemStoppedTrigger(this Component component) + { + return component.gameObject.GetAsyncParticleSystemStoppedTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncParticleSystemStoppedTrigger : AsyncTriggerBase + { + void OnParticleSystemStopped() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnParticleSystemStoppedHandler GetOnParticleSystemStoppedAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnParticleSystemStoppedHandler GetOnParticleSystemStoppedAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnParticleSystemStoppedAsync() + { + return ((IAsyncOnParticleSystemStoppedHandler)new AsyncTriggerHandler(this, true)).OnParticleSystemStoppedAsync(); + } + + public UniTask OnParticleSystemStoppedAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnParticleSystemStoppedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnParticleSystemStoppedAsync(); + } + } +#endregion + +#region ParticleTrigger + + public interface IAsyncOnParticleTriggerHandler + { + UniTask OnParticleTriggerAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnParticleTriggerHandler + { + UniTask IAsyncOnParticleTriggerHandler.OnParticleTriggerAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncParticleTriggerTrigger GetAsyncParticleTriggerTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncParticleTriggerTrigger GetAsyncParticleTriggerTrigger(this Component component) + { + return component.gameObject.GetAsyncParticleTriggerTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncParticleTriggerTrigger : AsyncTriggerBase + { + void OnParticleTrigger() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnParticleTriggerHandler GetOnParticleTriggerAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnParticleTriggerHandler GetOnParticleTriggerAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnParticleTriggerAsync() + { + return ((IAsyncOnParticleTriggerHandler)new AsyncTriggerHandler(this, true)).OnParticleTriggerAsync(); + } + + public UniTask OnParticleTriggerAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnParticleTriggerHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnParticleTriggerAsync(); + } + } +#endregion + +#region ParticleUpdateJobScheduled +#if UNITY_2019_3_OR_NEWER && (!UNITY_2019_1_OR_NEWER || UNITASK_PARTICLESYSTEM_SUPPORT) + + public interface IAsyncOnParticleUpdateJobScheduledHandler + { + UniTask OnParticleUpdateJobScheduledAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnParticleUpdateJobScheduledHandler + { + UniTask IAsyncOnParticleUpdateJobScheduledHandler.OnParticleUpdateJobScheduledAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncParticleUpdateJobScheduledTrigger GetAsyncParticleUpdateJobScheduledTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncParticleUpdateJobScheduledTrigger GetAsyncParticleUpdateJobScheduledTrigger(this Component component) + { + return component.gameObject.GetAsyncParticleUpdateJobScheduledTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncParticleUpdateJobScheduledTrigger : AsyncTriggerBase + { + void OnParticleUpdateJobScheduled(UnityEngine.ParticleSystemJobs.ParticleSystemJobData particles) + { + RaiseEvent((particles)); + } + + public IAsyncOnParticleUpdateJobScheduledHandler GetOnParticleUpdateJobScheduledAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnParticleUpdateJobScheduledHandler GetOnParticleUpdateJobScheduledAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnParticleUpdateJobScheduledAsync() + { + return ((IAsyncOnParticleUpdateJobScheduledHandler)new AsyncTriggerHandler(this, true)).OnParticleUpdateJobScheduledAsync(); + } + + public UniTask OnParticleUpdateJobScheduledAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnParticleUpdateJobScheduledHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnParticleUpdateJobScheduledAsync(); + } + } +#endif +#endregion + +#region PostRender + + public interface IAsyncOnPostRenderHandler + { + UniTask OnPostRenderAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnPostRenderHandler + { + UniTask IAsyncOnPostRenderHandler.OnPostRenderAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncPostRenderTrigger GetAsyncPostRenderTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncPostRenderTrigger GetAsyncPostRenderTrigger(this Component component) + { + return component.gameObject.GetAsyncPostRenderTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncPostRenderTrigger : AsyncTriggerBase + { + void OnPostRender() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnPostRenderHandler GetOnPostRenderAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnPostRenderHandler GetOnPostRenderAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnPostRenderAsync() + { + return ((IAsyncOnPostRenderHandler)new AsyncTriggerHandler(this, true)).OnPostRenderAsync(); + } + + public UniTask OnPostRenderAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnPostRenderHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPostRenderAsync(); + } + } +#endregion + +#region PreCull + + public interface IAsyncOnPreCullHandler + { + UniTask OnPreCullAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnPreCullHandler + { + UniTask IAsyncOnPreCullHandler.OnPreCullAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncPreCullTrigger GetAsyncPreCullTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncPreCullTrigger GetAsyncPreCullTrigger(this Component component) + { + return component.gameObject.GetAsyncPreCullTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncPreCullTrigger : AsyncTriggerBase + { + void OnPreCull() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnPreCullHandler GetOnPreCullAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnPreCullHandler GetOnPreCullAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnPreCullAsync() + { + return ((IAsyncOnPreCullHandler)new AsyncTriggerHandler(this, true)).OnPreCullAsync(); + } + + public UniTask OnPreCullAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnPreCullHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPreCullAsync(); + } + } +#endregion + +#region PreRender + + public interface IAsyncOnPreRenderHandler + { + UniTask OnPreRenderAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnPreRenderHandler + { + UniTask IAsyncOnPreRenderHandler.OnPreRenderAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncPreRenderTrigger GetAsyncPreRenderTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncPreRenderTrigger GetAsyncPreRenderTrigger(this Component component) + { + return component.gameObject.GetAsyncPreRenderTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncPreRenderTrigger : AsyncTriggerBase + { + void OnPreRender() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnPreRenderHandler GetOnPreRenderAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnPreRenderHandler GetOnPreRenderAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnPreRenderAsync() + { + return ((IAsyncOnPreRenderHandler)new AsyncTriggerHandler(this, true)).OnPreRenderAsync(); + } + + public UniTask OnPreRenderAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnPreRenderHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPreRenderAsync(); + } + } +#endregion + +#region RectTransformDimensionsChange + + public interface IAsyncOnRectTransformDimensionsChangeHandler + { + UniTask OnRectTransformDimensionsChangeAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnRectTransformDimensionsChangeHandler + { + UniTask IAsyncOnRectTransformDimensionsChangeHandler.OnRectTransformDimensionsChangeAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncRectTransformDimensionsChangeTrigger GetAsyncRectTransformDimensionsChangeTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncRectTransformDimensionsChangeTrigger GetAsyncRectTransformDimensionsChangeTrigger(this Component component) + { + return component.gameObject.GetAsyncRectTransformDimensionsChangeTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncRectTransformDimensionsChangeTrigger : AsyncTriggerBase + { + void OnRectTransformDimensionsChange() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnRectTransformDimensionsChangeHandler GetOnRectTransformDimensionsChangeAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnRectTransformDimensionsChangeHandler GetOnRectTransformDimensionsChangeAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnRectTransformDimensionsChangeAsync() + { + return ((IAsyncOnRectTransformDimensionsChangeHandler)new AsyncTriggerHandler(this, true)).OnRectTransformDimensionsChangeAsync(); + } + + public UniTask OnRectTransformDimensionsChangeAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnRectTransformDimensionsChangeHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnRectTransformDimensionsChangeAsync(); + } + } +#endregion + +#region RectTransformRemoved + + public interface IAsyncOnRectTransformRemovedHandler + { + UniTask OnRectTransformRemovedAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnRectTransformRemovedHandler + { + UniTask IAsyncOnRectTransformRemovedHandler.OnRectTransformRemovedAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncRectTransformRemovedTrigger GetAsyncRectTransformRemovedTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncRectTransformRemovedTrigger GetAsyncRectTransformRemovedTrigger(this Component component) + { + return component.gameObject.GetAsyncRectTransformRemovedTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncRectTransformRemovedTrigger : AsyncTriggerBase + { + void OnRectTransformRemoved() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnRectTransformRemovedHandler GetOnRectTransformRemovedAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnRectTransformRemovedHandler GetOnRectTransformRemovedAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnRectTransformRemovedAsync() + { + return ((IAsyncOnRectTransformRemovedHandler)new AsyncTriggerHandler(this, true)).OnRectTransformRemovedAsync(); + } + + public UniTask OnRectTransformRemovedAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnRectTransformRemovedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnRectTransformRemovedAsync(); + } + } +#endregion + +#region RenderImage + + public interface IAsyncOnRenderImageHandler + { + UniTask<(RenderTexture source, RenderTexture destination)> OnRenderImageAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnRenderImageHandler + { + UniTask<(RenderTexture source, RenderTexture destination)> IAsyncOnRenderImageHandler.OnRenderImageAsync() + { + core.Reset(); + return new UniTask<(RenderTexture source, RenderTexture destination)>((IUniTaskSource<(RenderTexture source, RenderTexture destination)>)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncRenderImageTrigger GetAsyncRenderImageTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncRenderImageTrigger GetAsyncRenderImageTrigger(this Component component) + { + return component.gameObject.GetAsyncRenderImageTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncRenderImageTrigger : AsyncTriggerBase<(RenderTexture source, RenderTexture destination)> + { + void OnRenderImage(RenderTexture source, RenderTexture destination) + { + RaiseEvent((source, destination)); + } + + public IAsyncOnRenderImageHandler GetOnRenderImageAsyncHandler() + { + return new AsyncTriggerHandler<(RenderTexture source, RenderTexture destination)>(this, false); + } + + public IAsyncOnRenderImageHandler GetOnRenderImageAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler<(RenderTexture source, RenderTexture destination)>(this, cancellationToken, false); + } + + public UniTask<(RenderTexture source, RenderTexture destination)> OnRenderImageAsync() + { + return ((IAsyncOnRenderImageHandler)new AsyncTriggerHandler<(RenderTexture source, RenderTexture destination)>(this, true)).OnRenderImageAsync(); + } + + public UniTask<(RenderTexture source, RenderTexture destination)> OnRenderImageAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnRenderImageHandler)new AsyncTriggerHandler<(RenderTexture source, RenderTexture destination)>(this, cancellationToken, true)).OnRenderImageAsync(); + } + } +#endregion + +#region RenderObject + + public interface IAsyncOnRenderObjectHandler + { + UniTask OnRenderObjectAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnRenderObjectHandler + { + UniTask IAsyncOnRenderObjectHandler.OnRenderObjectAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncRenderObjectTrigger GetAsyncRenderObjectTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncRenderObjectTrigger GetAsyncRenderObjectTrigger(this Component component) + { + return component.gameObject.GetAsyncRenderObjectTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncRenderObjectTrigger : AsyncTriggerBase + { + void OnRenderObject() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnRenderObjectHandler GetOnRenderObjectAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnRenderObjectHandler GetOnRenderObjectAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnRenderObjectAsync() + { + return ((IAsyncOnRenderObjectHandler)new AsyncTriggerHandler(this, true)).OnRenderObjectAsync(); + } + + public UniTask OnRenderObjectAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnRenderObjectHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnRenderObjectAsync(); + } + } +#endregion + +#region ServerInitialized + + public interface IAsyncOnServerInitializedHandler + { + UniTask OnServerInitializedAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnServerInitializedHandler + { + UniTask IAsyncOnServerInitializedHandler.OnServerInitializedAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncServerInitializedTrigger GetAsyncServerInitializedTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncServerInitializedTrigger GetAsyncServerInitializedTrigger(this Component component) + { + return component.gameObject.GetAsyncServerInitializedTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncServerInitializedTrigger : AsyncTriggerBase + { + void OnServerInitialized() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnServerInitializedHandler GetOnServerInitializedAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnServerInitializedHandler GetOnServerInitializedAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnServerInitializedAsync() + { + return ((IAsyncOnServerInitializedHandler)new AsyncTriggerHandler(this, true)).OnServerInitializedAsync(); + } + + public UniTask OnServerInitializedAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnServerInitializedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnServerInitializedAsync(); + } + } +#endregion + +#region TransformChildrenChanged + + public interface IAsyncOnTransformChildrenChangedHandler + { + UniTask OnTransformChildrenChangedAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnTransformChildrenChangedHandler + { + UniTask IAsyncOnTransformChildrenChangedHandler.OnTransformChildrenChangedAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncTransformChildrenChangedTrigger GetAsyncTransformChildrenChangedTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncTransformChildrenChangedTrigger GetAsyncTransformChildrenChangedTrigger(this Component component) + { + return component.gameObject.GetAsyncTransformChildrenChangedTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncTransformChildrenChangedTrigger : AsyncTriggerBase + { + void OnTransformChildrenChanged() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnTransformChildrenChangedHandler GetOnTransformChildrenChangedAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnTransformChildrenChangedHandler GetOnTransformChildrenChangedAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnTransformChildrenChangedAsync() + { + return ((IAsyncOnTransformChildrenChangedHandler)new AsyncTriggerHandler(this, true)).OnTransformChildrenChangedAsync(); + } + + public UniTask OnTransformChildrenChangedAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnTransformChildrenChangedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTransformChildrenChangedAsync(); + } + } +#endregion + +#region TransformParentChanged + + public interface IAsyncOnTransformParentChangedHandler + { + UniTask OnTransformParentChangedAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnTransformParentChangedHandler + { + UniTask IAsyncOnTransformParentChangedHandler.OnTransformParentChangedAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncTransformParentChangedTrigger GetAsyncTransformParentChangedTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncTransformParentChangedTrigger GetAsyncTransformParentChangedTrigger(this Component component) + { + return component.gameObject.GetAsyncTransformParentChangedTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncTransformParentChangedTrigger : AsyncTriggerBase + { + void OnTransformParentChanged() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnTransformParentChangedHandler GetOnTransformParentChangedAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnTransformParentChangedHandler GetOnTransformParentChangedAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnTransformParentChangedAsync() + { + return ((IAsyncOnTransformParentChangedHandler)new AsyncTriggerHandler(this, true)).OnTransformParentChangedAsync(); + } + + public UniTask OnTransformParentChangedAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnTransformParentChangedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTransformParentChangedAsync(); + } + } +#endregion + +#region TriggerEnter +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT + + public interface IAsyncOnTriggerEnterHandler + { + UniTask OnTriggerEnterAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnTriggerEnterHandler + { + UniTask IAsyncOnTriggerEnterHandler.OnTriggerEnterAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncTriggerEnterTrigger GetAsyncTriggerEnterTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncTriggerEnterTrigger GetAsyncTriggerEnterTrigger(this Component component) + { + return component.gameObject.GetAsyncTriggerEnterTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncTriggerEnterTrigger : AsyncTriggerBase + { + void OnTriggerEnter(Collider other) + { + RaiseEvent((other)); + } + + public IAsyncOnTriggerEnterHandler GetOnTriggerEnterAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnTriggerEnterHandler GetOnTriggerEnterAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnTriggerEnterAsync() + { + return ((IAsyncOnTriggerEnterHandler)new AsyncTriggerHandler(this, true)).OnTriggerEnterAsync(); + } + + public UniTask OnTriggerEnterAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnTriggerEnterHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerEnterAsync(); + } + } +#endif +#endregion + +#region TriggerEnter2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT + + public interface IAsyncOnTriggerEnter2DHandler + { + UniTask OnTriggerEnter2DAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnTriggerEnter2DHandler + { + UniTask IAsyncOnTriggerEnter2DHandler.OnTriggerEnter2DAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncTriggerEnter2DTrigger GetAsyncTriggerEnter2DTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncTriggerEnter2DTrigger GetAsyncTriggerEnter2DTrigger(this Component component) + { + return component.gameObject.GetAsyncTriggerEnter2DTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncTriggerEnter2DTrigger : AsyncTriggerBase + { + void OnTriggerEnter2D(Collider2D other) + { + RaiseEvent((other)); + } + + public IAsyncOnTriggerEnter2DHandler GetOnTriggerEnter2DAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnTriggerEnter2DHandler GetOnTriggerEnter2DAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnTriggerEnter2DAsync() + { + return ((IAsyncOnTriggerEnter2DHandler)new AsyncTriggerHandler(this, true)).OnTriggerEnter2DAsync(); + } + + public UniTask OnTriggerEnter2DAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnTriggerEnter2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerEnter2DAsync(); + } + } +#endif +#endregion + +#region TriggerExit +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT + + public interface IAsyncOnTriggerExitHandler + { + UniTask OnTriggerExitAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnTriggerExitHandler + { + UniTask IAsyncOnTriggerExitHandler.OnTriggerExitAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncTriggerExitTrigger GetAsyncTriggerExitTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncTriggerExitTrigger GetAsyncTriggerExitTrigger(this Component component) + { + return component.gameObject.GetAsyncTriggerExitTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncTriggerExitTrigger : AsyncTriggerBase + { + void OnTriggerExit(Collider other) + { + RaiseEvent((other)); + } + + public IAsyncOnTriggerExitHandler GetOnTriggerExitAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnTriggerExitHandler GetOnTriggerExitAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnTriggerExitAsync() + { + return ((IAsyncOnTriggerExitHandler)new AsyncTriggerHandler(this, true)).OnTriggerExitAsync(); + } + + public UniTask OnTriggerExitAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnTriggerExitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerExitAsync(); + } + } +#endif +#endregion + +#region TriggerExit2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT + + public interface IAsyncOnTriggerExit2DHandler + { + UniTask OnTriggerExit2DAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnTriggerExit2DHandler + { + UniTask IAsyncOnTriggerExit2DHandler.OnTriggerExit2DAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncTriggerExit2DTrigger GetAsyncTriggerExit2DTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncTriggerExit2DTrigger GetAsyncTriggerExit2DTrigger(this Component component) + { + return component.gameObject.GetAsyncTriggerExit2DTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncTriggerExit2DTrigger : AsyncTriggerBase + { + void OnTriggerExit2D(Collider2D other) + { + RaiseEvent((other)); + } + + public IAsyncOnTriggerExit2DHandler GetOnTriggerExit2DAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnTriggerExit2DHandler GetOnTriggerExit2DAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnTriggerExit2DAsync() + { + return ((IAsyncOnTriggerExit2DHandler)new AsyncTriggerHandler(this, true)).OnTriggerExit2DAsync(); + } + + public UniTask OnTriggerExit2DAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnTriggerExit2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerExit2DAsync(); + } + } +#endif +#endregion + +#region TriggerStay +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS_SUPPORT + + public interface IAsyncOnTriggerStayHandler + { + UniTask OnTriggerStayAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnTriggerStayHandler + { + UniTask IAsyncOnTriggerStayHandler.OnTriggerStayAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncTriggerStayTrigger GetAsyncTriggerStayTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncTriggerStayTrigger GetAsyncTriggerStayTrigger(this Component component) + { + return component.gameObject.GetAsyncTriggerStayTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncTriggerStayTrigger : AsyncTriggerBase + { + void OnTriggerStay(Collider other) + { + RaiseEvent((other)); + } + + public IAsyncOnTriggerStayHandler GetOnTriggerStayAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnTriggerStayHandler GetOnTriggerStayAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnTriggerStayAsync() + { + return ((IAsyncOnTriggerStayHandler)new AsyncTriggerHandler(this, true)).OnTriggerStayAsync(); + } + + public UniTask OnTriggerStayAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnTriggerStayHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerStayAsync(); + } + } +#endif +#endregion + +#region TriggerStay2D +#if !UNITY_2019_1_OR_NEWER || UNITASK_PHYSICS2D_SUPPORT + + public interface IAsyncOnTriggerStay2DHandler + { + UniTask OnTriggerStay2DAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnTriggerStay2DHandler + { + UniTask IAsyncOnTriggerStay2DHandler.OnTriggerStay2DAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncTriggerStay2DTrigger GetAsyncTriggerStay2DTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncTriggerStay2DTrigger GetAsyncTriggerStay2DTrigger(this Component component) + { + return component.gameObject.GetAsyncTriggerStay2DTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncTriggerStay2DTrigger : AsyncTriggerBase + { + void OnTriggerStay2D(Collider2D other) + { + RaiseEvent((other)); + } + + public IAsyncOnTriggerStay2DHandler GetOnTriggerStay2DAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnTriggerStay2DHandler GetOnTriggerStay2DAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnTriggerStay2DAsync() + { + return ((IAsyncOnTriggerStay2DHandler)new AsyncTriggerHandler(this, true)).OnTriggerStay2DAsync(); + } + + public UniTask OnTriggerStay2DAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnTriggerStay2DHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnTriggerStay2DAsync(); + } + } +#endif +#endregion + +#region Validate + + public interface IAsyncOnValidateHandler + { + UniTask OnValidateAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnValidateHandler + { + UniTask IAsyncOnValidateHandler.OnValidateAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncValidateTrigger GetAsyncValidateTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncValidateTrigger GetAsyncValidateTrigger(this Component component) + { + return component.gameObject.GetAsyncValidateTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncValidateTrigger : AsyncTriggerBase + { + void OnValidate() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnValidateHandler GetOnValidateAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnValidateHandler GetOnValidateAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnValidateAsync() + { + return ((IAsyncOnValidateHandler)new AsyncTriggerHandler(this, true)).OnValidateAsync(); + } + + public UniTask OnValidateAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnValidateHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnValidateAsync(); + } + } +#endregion + +#region WillRenderObject + + public interface IAsyncOnWillRenderObjectHandler + { + UniTask OnWillRenderObjectAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnWillRenderObjectHandler + { + UniTask IAsyncOnWillRenderObjectHandler.OnWillRenderObjectAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncWillRenderObjectTrigger GetAsyncWillRenderObjectTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncWillRenderObjectTrigger GetAsyncWillRenderObjectTrigger(this Component component) + { + return component.gameObject.GetAsyncWillRenderObjectTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncWillRenderObjectTrigger : AsyncTriggerBase + { + void OnWillRenderObject() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncOnWillRenderObjectHandler GetOnWillRenderObjectAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnWillRenderObjectHandler GetOnWillRenderObjectAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnWillRenderObjectAsync() + { + return ((IAsyncOnWillRenderObjectHandler)new AsyncTriggerHandler(this, true)).OnWillRenderObjectAsync(); + } + + public UniTask OnWillRenderObjectAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnWillRenderObjectHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnWillRenderObjectAsync(); + } + } +#endregion + +#region Reset + + public interface IAsyncResetHandler + { + UniTask ResetAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncResetHandler + { + UniTask IAsyncResetHandler.ResetAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncResetTrigger GetAsyncResetTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncResetTrigger GetAsyncResetTrigger(this Component component) + { + return component.gameObject.GetAsyncResetTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncResetTrigger : AsyncTriggerBase + { + void Reset() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncResetHandler GetResetAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncResetHandler GetResetAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask ResetAsync() + { + return ((IAsyncResetHandler)new AsyncTriggerHandler(this, true)).ResetAsync(); + } + + public UniTask ResetAsync(CancellationToken cancellationToken) + { + return ((IAsyncResetHandler)new AsyncTriggerHandler(this, cancellationToken, true)).ResetAsync(); + } + } +#endregion + +#region Update + + public interface IAsyncUpdateHandler + { + UniTask UpdateAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncUpdateHandler + { + UniTask IAsyncUpdateHandler.UpdateAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncUpdateTrigger GetAsyncUpdateTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncUpdateTrigger GetAsyncUpdateTrigger(this Component component) + { + return component.gameObject.GetAsyncUpdateTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncUpdateTrigger : AsyncTriggerBase + { + void Update() + { + RaiseEvent(AsyncUnit.Default); + } + + public IAsyncUpdateHandler GetUpdateAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncUpdateHandler GetUpdateAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask UpdateAsync() + { + return ((IAsyncUpdateHandler)new AsyncTriggerHandler(this, true)).UpdateAsync(); + } + + public UniTask UpdateAsync(CancellationToken cancellationToken) + { + return ((IAsyncUpdateHandler)new AsyncTriggerHandler(this, cancellationToken, true)).UpdateAsync(); + } + } +#endregion + +#region BeginDrag +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnBeginDragHandler + { + UniTask OnBeginDragAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnBeginDragHandler + { + UniTask IAsyncOnBeginDragHandler.OnBeginDragAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncBeginDragTrigger GetAsyncBeginDragTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncBeginDragTrigger GetAsyncBeginDragTrigger(this Component component) + { + return component.gameObject.GetAsyncBeginDragTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncBeginDragTrigger : AsyncTriggerBase, IBeginDragHandler + { + void IBeginDragHandler.OnBeginDrag(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnBeginDragHandler GetOnBeginDragAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnBeginDragHandler GetOnBeginDragAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnBeginDragAsync() + { + return ((IAsyncOnBeginDragHandler)new AsyncTriggerHandler(this, true)).OnBeginDragAsync(); + } + + public UniTask OnBeginDragAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnBeginDragHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnBeginDragAsync(); + } + } +#endif +#endregion + +#region Cancel +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnCancelHandler + { + UniTask OnCancelAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnCancelHandler + { + UniTask IAsyncOnCancelHandler.OnCancelAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncCancelTrigger GetAsyncCancelTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncCancelTrigger GetAsyncCancelTrigger(this Component component) + { + return component.gameObject.GetAsyncCancelTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncCancelTrigger : AsyncTriggerBase, ICancelHandler + { + void ICancelHandler.OnCancel(BaseEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnCancelHandler GetOnCancelAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnCancelHandler GetOnCancelAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnCancelAsync() + { + return ((IAsyncOnCancelHandler)new AsyncTriggerHandler(this, true)).OnCancelAsync(); + } + + public UniTask OnCancelAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnCancelHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnCancelAsync(); + } + } +#endif +#endregion + +#region Deselect +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnDeselectHandler + { + UniTask OnDeselectAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnDeselectHandler + { + UniTask IAsyncOnDeselectHandler.OnDeselectAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncDeselectTrigger GetAsyncDeselectTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncDeselectTrigger GetAsyncDeselectTrigger(this Component component) + { + return component.gameObject.GetAsyncDeselectTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncDeselectTrigger : AsyncTriggerBase, IDeselectHandler + { + void IDeselectHandler.OnDeselect(BaseEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnDeselectHandler GetOnDeselectAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnDeselectHandler GetOnDeselectAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnDeselectAsync() + { + return ((IAsyncOnDeselectHandler)new AsyncTriggerHandler(this, true)).OnDeselectAsync(); + } + + public UniTask OnDeselectAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnDeselectHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnDeselectAsync(); + } + } +#endif +#endregion + +#region Drag +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnDragHandler + { + UniTask OnDragAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnDragHandler + { + UniTask IAsyncOnDragHandler.OnDragAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncDragTrigger GetAsyncDragTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncDragTrigger GetAsyncDragTrigger(this Component component) + { + return component.gameObject.GetAsyncDragTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncDragTrigger : AsyncTriggerBase, IDragHandler + { + void IDragHandler.OnDrag(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnDragHandler GetOnDragAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnDragHandler GetOnDragAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnDragAsync() + { + return ((IAsyncOnDragHandler)new AsyncTriggerHandler(this, true)).OnDragAsync(); + } + + public UniTask OnDragAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnDragHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnDragAsync(); + } + } +#endif +#endregion + +#region Drop +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnDropHandler + { + UniTask OnDropAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnDropHandler + { + UniTask IAsyncOnDropHandler.OnDropAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncDropTrigger GetAsyncDropTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncDropTrigger GetAsyncDropTrigger(this Component component) + { + return component.gameObject.GetAsyncDropTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncDropTrigger : AsyncTriggerBase, IDropHandler + { + void IDropHandler.OnDrop(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnDropHandler GetOnDropAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnDropHandler GetOnDropAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnDropAsync() + { + return ((IAsyncOnDropHandler)new AsyncTriggerHandler(this, true)).OnDropAsync(); + } + + public UniTask OnDropAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnDropHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnDropAsync(); + } + } +#endif +#endregion + +#region EndDrag +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnEndDragHandler + { + UniTask OnEndDragAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnEndDragHandler + { + UniTask IAsyncOnEndDragHandler.OnEndDragAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncEndDragTrigger GetAsyncEndDragTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncEndDragTrigger GetAsyncEndDragTrigger(this Component component) + { + return component.gameObject.GetAsyncEndDragTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncEndDragTrigger : AsyncTriggerBase, IEndDragHandler + { + void IEndDragHandler.OnEndDrag(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnEndDragHandler GetOnEndDragAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnEndDragHandler GetOnEndDragAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnEndDragAsync() + { + return ((IAsyncOnEndDragHandler)new AsyncTriggerHandler(this, true)).OnEndDragAsync(); + } + + public UniTask OnEndDragAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnEndDragHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnEndDragAsync(); + } + } +#endif +#endregion + +#region InitializePotentialDrag +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnInitializePotentialDragHandler + { + UniTask OnInitializePotentialDragAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnInitializePotentialDragHandler + { + UniTask IAsyncOnInitializePotentialDragHandler.OnInitializePotentialDragAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncInitializePotentialDragTrigger GetAsyncInitializePotentialDragTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncInitializePotentialDragTrigger GetAsyncInitializePotentialDragTrigger(this Component component) + { + return component.gameObject.GetAsyncInitializePotentialDragTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncInitializePotentialDragTrigger : AsyncTriggerBase, IInitializePotentialDragHandler + { + void IInitializePotentialDragHandler.OnInitializePotentialDrag(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnInitializePotentialDragHandler GetOnInitializePotentialDragAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnInitializePotentialDragHandler GetOnInitializePotentialDragAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnInitializePotentialDragAsync() + { + return ((IAsyncOnInitializePotentialDragHandler)new AsyncTriggerHandler(this, true)).OnInitializePotentialDragAsync(); + } + + public UniTask OnInitializePotentialDragAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnInitializePotentialDragHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnInitializePotentialDragAsync(); + } + } +#endif +#endregion + +#region Move +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnMoveHandler + { + UniTask OnMoveAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnMoveHandler + { + UniTask IAsyncOnMoveHandler.OnMoveAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncMoveTrigger GetAsyncMoveTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncMoveTrigger GetAsyncMoveTrigger(this Component component) + { + return component.gameObject.GetAsyncMoveTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncMoveTrigger : AsyncTriggerBase, IMoveHandler + { + void IMoveHandler.OnMove(AxisEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnMoveHandler GetOnMoveAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnMoveHandler GetOnMoveAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnMoveAsync() + { + return ((IAsyncOnMoveHandler)new AsyncTriggerHandler(this, true)).OnMoveAsync(); + } + + public UniTask OnMoveAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnMoveHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnMoveAsync(); + } + } +#endif +#endregion + +#region PointerClick +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnPointerClickHandler + { + UniTask OnPointerClickAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnPointerClickHandler + { + UniTask IAsyncOnPointerClickHandler.OnPointerClickAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncPointerClickTrigger GetAsyncPointerClickTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncPointerClickTrigger GetAsyncPointerClickTrigger(this Component component) + { + return component.gameObject.GetAsyncPointerClickTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncPointerClickTrigger : AsyncTriggerBase, IPointerClickHandler + { + void IPointerClickHandler.OnPointerClick(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnPointerClickHandler GetOnPointerClickAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnPointerClickHandler GetOnPointerClickAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnPointerClickAsync() + { + return ((IAsyncOnPointerClickHandler)new AsyncTriggerHandler(this, true)).OnPointerClickAsync(); + } + + public UniTask OnPointerClickAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnPointerClickHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerClickAsync(); + } + } +#endif +#endregion + +#region PointerDown +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnPointerDownHandler + { + UniTask OnPointerDownAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnPointerDownHandler + { + UniTask IAsyncOnPointerDownHandler.OnPointerDownAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncPointerDownTrigger GetAsyncPointerDownTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncPointerDownTrigger GetAsyncPointerDownTrigger(this Component component) + { + return component.gameObject.GetAsyncPointerDownTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncPointerDownTrigger : AsyncTriggerBase, IPointerDownHandler + { + void IPointerDownHandler.OnPointerDown(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnPointerDownHandler GetOnPointerDownAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnPointerDownHandler GetOnPointerDownAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnPointerDownAsync() + { + return ((IAsyncOnPointerDownHandler)new AsyncTriggerHandler(this, true)).OnPointerDownAsync(); + } + + public UniTask OnPointerDownAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnPointerDownHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerDownAsync(); + } + } +#endif +#endregion + +#region PointerEnter +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnPointerEnterHandler + { + UniTask OnPointerEnterAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnPointerEnterHandler + { + UniTask IAsyncOnPointerEnterHandler.OnPointerEnterAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncPointerEnterTrigger GetAsyncPointerEnterTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncPointerEnterTrigger GetAsyncPointerEnterTrigger(this Component component) + { + return component.gameObject.GetAsyncPointerEnterTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncPointerEnterTrigger : AsyncTriggerBase, IPointerEnterHandler + { + void IPointerEnterHandler.OnPointerEnter(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnPointerEnterHandler GetOnPointerEnterAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnPointerEnterHandler GetOnPointerEnterAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnPointerEnterAsync() + { + return ((IAsyncOnPointerEnterHandler)new AsyncTriggerHandler(this, true)).OnPointerEnterAsync(); + } + + public UniTask OnPointerEnterAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnPointerEnterHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerEnterAsync(); + } + } +#endif +#endregion + +#region PointerExit +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnPointerExitHandler + { + UniTask OnPointerExitAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnPointerExitHandler + { + UniTask IAsyncOnPointerExitHandler.OnPointerExitAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncPointerExitTrigger GetAsyncPointerExitTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncPointerExitTrigger GetAsyncPointerExitTrigger(this Component component) + { + return component.gameObject.GetAsyncPointerExitTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncPointerExitTrigger : AsyncTriggerBase, IPointerExitHandler + { + void IPointerExitHandler.OnPointerExit(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnPointerExitHandler GetOnPointerExitAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnPointerExitHandler GetOnPointerExitAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnPointerExitAsync() + { + return ((IAsyncOnPointerExitHandler)new AsyncTriggerHandler(this, true)).OnPointerExitAsync(); + } + + public UniTask OnPointerExitAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnPointerExitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerExitAsync(); + } + } +#endif +#endregion + +#region PointerUp +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnPointerUpHandler + { + UniTask OnPointerUpAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnPointerUpHandler + { + UniTask IAsyncOnPointerUpHandler.OnPointerUpAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncPointerUpTrigger GetAsyncPointerUpTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncPointerUpTrigger GetAsyncPointerUpTrigger(this Component component) + { + return component.gameObject.GetAsyncPointerUpTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncPointerUpTrigger : AsyncTriggerBase, IPointerUpHandler + { + void IPointerUpHandler.OnPointerUp(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnPointerUpHandler GetOnPointerUpAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnPointerUpHandler GetOnPointerUpAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnPointerUpAsync() + { + return ((IAsyncOnPointerUpHandler)new AsyncTriggerHandler(this, true)).OnPointerUpAsync(); + } + + public UniTask OnPointerUpAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnPointerUpHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnPointerUpAsync(); + } + } +#endif +#endregion + +#region Scroll +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnScrollHandler + { + UniTask OnScrollAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnScrollHandler + { + UniTask IAsyncOnScrollHandler.OnScrollAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncScrollTrigger GetAsyncScrollTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncScrollTrigger GetAsyncScrollTrigger(this Component component) + { + return component.gameObject.GetAsyncScrollTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncScrollTrigger : AsyncTriggerBase, IScrollHandler + { + void IScrollHandler.OnScroll(PointerEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnScrollHandler GetOnScrollAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnScrollHandler GetOnScrollAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnScrollAsync() + { + return ((IAsyncOnScrollHandler)new AsyncTriggerHandler(this, true)).OnScrollAsync(); + } + + public UniTask OnScrollAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnScrollHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnScrollAsync(); + } + } +#endif +#endregion + +#region Select +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnSelectHandler + { + UniTask OnSelectAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnSelectHandler + { + UniTask IAsyncOnSelectHandler.OnSelectAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncSelectTrigger GetAsyncSelectTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncSelectTrigger GetAsyncSelectTrigger(this Component component) + { + return component.gameObject.GetAsyncSelectTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncSelectTrigger : AsyncTriggerBase, ISelectHandler + { + void ISelectHandler.OnSelect(BaseEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnSelectHandler GetOnSelectAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnSelectHandler GetOnSelectAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnSelectAsync() + { + return ((IAsyncOnSelectHandler)new AsyncTriggerHandler(this, true)).OnSelectAsync(); + } + + public UniTask OnSelectAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnSelectHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnSelectAsync(); + } + } +#endif +#endregion + +#region Submit +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnSubmitHandler + { + UniTask OnSubmitAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnSubmitHandler + { + UniTask IAsyncOnSubmitHandler.OnSubmitAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncSubmitTrigger GetAsyncSubmitTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncSubmitTrigger GetAsyncSubmitTrigger(this Component component) + { + return component.gameObject.GetAsyncSubmitTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncSubmitTrigger : AsyncTriggerBase, ISubmitHandler + { + void ISubmitHandler.OnSubmit(BaseEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnSubmitHandler GetOnSubmitAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnSubmitHandler GetOnSubmitAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnSubmitAsync() + { + return ((IAsyncOnSubmitHandler)new AsyncTriggerHandler(this, true)).OnSubmitAsync(); + } + + public UniTask OnSubmitAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnSubmitHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnSubmitAsync(); + } + } +#endif +#endregion + +#region UpdateSelected +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + + public interface IAsyncOnUpdateSelectedHandler + { + UniTask OnUpdateSelectedAsync(); + } + + public partial class AsyncTriggerHandler : IAsyncOnUpdateSelectedHandler + { + UniTask IAsyncOnUpdateSelectedHandler.OnUpdateSelectedAsync() + { + core.Reset(); + return new UniTask((IUniTaskSource)(object)this, core.Version); + } + } + + public static partial class AsyncTriggerExtensions + { + public static AsyncUpdateSelectedTrigger GetAsyncUpdateSelectedTrigger(this GameObject gameObject) + { + return GetOrAddComponent(gameObject); + } + + public static AsyncUpdateSelectedTrigger GetAsyncUpdateSelectedTrigger(this Component component) + { + return component.gameObject.GetAsyncUpdateSelectedTrigger(); + } + } + + [DisallowMultipleComponent] + public sealed class AsyncUpdateSelectedTrigger : AsyncTriggerBase, IUpdateSelectedHandler + { + void IUpdateSelectedHandler.OnUpdateSelected(BaseEventData eventData) + { + RaiseEvent((eventData)); + } + + public IAsyncOnUpdateSelectedHandler GetOnUpdateSelectedAsyncHandler() + { + return new AsyncTriggerHandler(this, false); + } + + public IAsyncOnUpdateSelectedHandler GetOnUpdateSelectedAsyncHandler(CancellationToken cancellationToken) + { + return new AsyncTriggerHandler(this, cancellationToken, false); + } + + public UniTask OnUpdateSelectedAsync() + { + return ((IAsyncOnUpdateSelectedHandler)new AsyncTriggerHandler(this, true)).OnUpdateSelectedAsync(); + } + + public UniTask OnUpdateSelectedAsync(CancellationToken cancellationToken) + { + return ((IAsyncOnUpdateSelectedHandler)new AsyncTriggerHandler(this, cancellationToken, true)).OnUpdateSelectedAsync(); + } + } +#endif +#endregion + +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs.meta new file mode 100644 index 00000000..82aa6792 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/Triggers/MonoBehaviourMessagesTriggers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c30655636c35c3d4da44064af3d2d9a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Bridge.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Bridge.cs new file mode 100644 index 00000000..c9042999 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Bridge.cs @@ -0,0 +1,18 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections; + +namespace Cysharp.Threading.Tasks +{ + // UnityEngine Bridges. + + public partial struct UniTask + { + public static IEnumerator ToCoroutine(Func taskFactory) + { + return taskFactory().ToCoroutine(); + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Bridge.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Bridge.cs.meta new file mode 100644 index 00000000..6f8da804 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Bridge.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bd6beac8e0ebd264e9ba246c39429c72 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Delay.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Delay.cs new file mode 100644 index 00000000..7f02a1a1 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Delay.cs @@ -0,0 +1,1064 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Collections; +using System.Runtime.CompilerServices; +using System.Threading; +using UnityEngine; + +namespace Cysharp.Threading.Tasks +{ + public enum DelayType + { + /// use Time.deltaTime. + DeltaTime, + /// Ignore timescale, use Time.unscaledDeltaTime. + UnscaledDeltaTime, + /// use Stopwatch.GetTimestamp(). + Realtime + } + + public partial struct UniTask + { + public static YieldAwaitable Yield() + { + // optimized for single continuation + return new YieldAwaitable(PlayerLoopTiming.Update); + } + + public static YieldAwaitable Yield(PlayerLoopTiming timing) + { + // optimized for single continuation + return new YieldAwaitable(timing); + } + + public static UniTask Yield(CancellationToken cancellationToken, bool cancelImmediately = false) + { + return new UniTask(YieldPromise.Create(PlayerLoopTiming.Update, cancellationToken, cancelImmediately, out var token), token); + } + + public static UniTask Yield(PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately = false) + { + return new UniTask(YieldPromise.Create(timing, cancellationToken, cancelImmediately, out var token), token); + } + + /// + /// Similar as UniTask.Yield but guaranteed run on next frame. + /// + public static UniTask NextFrame() + { + return new UniTask(NextFramePromise.Create(PlayerLoopTiming.Update, CancellationToken.None, false, out var token), token); + } + + /// + /// Similar as UniTask.Yield but guaranteed run on next frame. + /// + public static UniTask NextFrame(PlayerLoopTiming timing) + { + return new UniTask(NextFramePromise.Create(timing, CancellationToken.None, false, out var token), token); + } + + /// + /// Similar as UniTask.Yield but guaranteed run on next frame. + /// + public static UniTask NextFrame(CancellationToken cancellationToken, bool cancelImmediately = false) + { + return new UniTask(NextFramePromise.Create(PlayerLoopTiming.Update, cancellationToken, cancelImmediately, out var token), token); + } + + /// + /// Similar as UniTask.Yield but guaranteed run on next frame. + /// + public static UniTask NextFrame(PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately = false) + { + return new UniTask(NextFramePromise.Create(timing, cancellationToken, cancelImmediately, out var token), token); + } + +#if UNITY_2023_1_OR_NEWER + public static async UniTask WaitForEndOfFrame(CancellationToken cancellationToken = default) + { + await Awaitable.EndOfFrameAsync(cancellationToken); + } +#else + [Obsolete("Use WaitForEndOfFrame(MonoBehaviour) instead or UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate). Equivalent for coroutine's WaitForEndOfFrame requires MonoBehaviour(runner of Coroutine).")] + public static YieldAwaitable WaitForEndOfFrame() + { + return UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate); + } + + [Obsolete("Use WaitForEndOfFrame(MonoBehaviour) instead or UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate). Equivalent for coroutine's WaitForEndOfFrame requires MonoBehaviour(runner of Coroutine).")] + public static UniTask WaitForEndOfFrame(CancellationToken cancellationToken, bool cancelImmediately = false) + { + return UniTask.Yield(PlayerLoopTiming.LastPostLateUpdate, cancellationToken, cancelImmediately); + } +#endif + + public static UniTask WaitForEndOfFrame(MonoBehaviour coroutineRunner) + { + var source = WaitForEndOfFramePromise.Create(coroutineRunner, CancellationToken.None, false, out var token); + return new UniTask(source, token); + } + + public static UniTask WaitForEndOfFrame(MonoBehaviour coroutineRunner, CancellationToken cancellationToken, bool cancelImmediately = false) + { + var source = WaitForEndOfFramePromise.Create(coroutineRunner, cancellationToken, cancelImmediately, out var token); + return new UniTask(source, token); + } + + /// + /// Same as UniTask.Yield(PlayerLoopTiming.LastFixedUpdate). + /// + public static YieldAwaitable WaitForFixedUpdate() + { + // use LastFixedUpdate instead of FixedUpdate + // https://github.com/Cysharp/UniTask/issues/377 + return UniTask.Yield(PlayerLoopTiming.LastFixedUpdate); + } + + /// + /// Same as UniTask.Yield(PlayerLoopTiming.LastFixedUpdate, cancellationToken). + /// + public static UniTask WaitForFixedUpdate(CancellationToken cancellationToken, bool cancelImmediately = false) + { + return UniTask.Yield(PlayerLoopTiming.LastFixedUpdate, cancellationToken, cancelImmediately); + } + + public static UniTask WaitForSeconds(float duration, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + return Delay(Mathf.RoundToInt(1000 * duration), ignoreTimeScale, delayTiming, cancellationToken, cancelImmediately); + } + + public static UniTask WaitForSeconds(int duration, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + return Delay(1000 * duration, ignoreTimeScale, delayTiming, cancellationToken, cancelImmediately); + } + + public static UniTask DelayFrame(int delayFrameCount, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + if (delayFrameCount < 0) + { + throw new ArgumentOutOfRangeException("Delay does not allow minus delayFrameCount. delayFrameCount:" + delayFrameCount); + } + + return new UniTask(DelayFramePromise.Create(delayFrameCount, delayTiming, cancellationToken, cancelImmediately, out var token), token); + } + + public static UniTask Delay(int millisecondsDelay, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + var delayTimeSpan = TimeSpan.FromMilliseconds(millisecondsDelay); + return Delay(delayTimeSpan, ignoreTimeScale, delayTiming, cancellationToken, cancelImmediately); + } + + public static UniTask Delay(TimeSpan delayTimeSpan, bool ignoreTimeScale = false, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + var delayType = ignoreTimeScale ? DelayType.UnscaledDeltaTime : DelayType.DeltaTime; + return Delay(delayTimeSpan, delayType, delayTiming, cancellationToken, cancelImmediately); + } + + public static UniTask Delay(int millisecondsDelay, DelayType delayType, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + var delayTimeSpan = TimeSpan.FromMilliseconds(millisecondsDelay); + return Delay(delayTimeSpan, delayType, delayTiming, cancellationToken, cancelImmediately); + } + + public static UniTask Delay(TimeSpan delayTimeSpan, DelayType delayType, PlayerLoopTiming delayTiming = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + if (delayTimeSpan < TimeSpan.Zero) + { + throw new ArgumentOutOfRangeException("Delay does not allow minus delayTimeSpan. delayTimeSpan:" + delayTimeSpan); + } + +#if UNITY_EDITOR + // force use Realtime. + if (PlayerLoopHelper.IsMainThread && !UnityEditor.EditorApplication.isPlaying) + { + delayType = DelayType.Realtime; + } +#endif + + switch (delayType) + { + case DelayType.UnscaledDeltaTime: + { + return new UniTask(DelayIgnoreTimeScalePromise.Create(delayTimeSpan, delayTiming, cancellationToken, cancelImmediately, out var token), token); + } + case DelayType.Realtime: + { + return new UniTask(DelayRealtimePromise.Create(delayTimeSpan, delayTiming, cancellationToken, cancelImmediately, out var token), token); + } + case DelayType.DeltaTime: + default: + { + return new UniTask(DelayPromise.Create(delayTimeSpan, delayTiming, cancellationToken, cancelImmediately, out var token), token); + } + } + } + + sealed class YieldPromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + YieldPromise nextNode; + public ref YieldPromise NextNode => ref nextNode; + + static YieldPromise() + { + TaskPool.RegisterSizeGetter(typeof(YieldPromise), () => pool.Size); + } + + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + UniTaskCompletionSourceCore core; + + YieldPromise() + { + } + + public static IUniTaskSource Create(PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new YieldPromise(); + } + + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (YieldPromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + core.TrySetResult(null); + return false; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + sealed class NextFramePromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + NextFramePromise nextNode; + public ref NextFramePromise NextNode => ref nextNode; + + static NextFramePromise() + { + TaskPool.RegisterSizeGetter(typeof(NextFramePromise), () => pool.Size); + } + + int frameCount; + UniTaskCompletionSourceCore core; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + NextFramePromise() + { + } + + public static IUniTaskSource Create(PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new NextFramePromise(); + } + + result.frameCount = PlayerLoopHelper.IsMainThread ? Time.frameCount : -1; + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (NextFramePromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (frameCount == Time.frameCount) + { + return true; + } + + core.TrySetResult(AsyncUnit.Default); + return false; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + sealed class WaitForEndOfFramePromise : IUniTaskSource, ITaskPoolNode, System.Collections.IEnumerator + { + static TaskPool pool; + WaitForEndOfFramePromise nextNode; + public ref WaitForEndOfFramePromise NextNode => ref nextNode; + + static WaitForEndOfFramePromise() + { + TaskPool.RegisterSizeGetter(typeof(WaitForEndOfFramePromise), () => pool.Size); + } + + UniTaskCompletionSourceCore core; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + WaitForEndOfFramePromise() + { + } + + public static IUniTaskSource Create(MonoBehaviour coroutineRunner, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new WaitForEndOfFramePromise(); + } + + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (WaitForEndOfFramePromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + coroutineRunner.StartCoroutine(result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + Reset(); // Reset Enumerator + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + + // Coroutine Runner implementation + + static readonly WaitForEndOfFrame waitForEndOfFrameYieldInstruction = new WaitForEndOfFrame(); + bool isFirst = true; + + object IEnumerator.Current => waitForEndOfFrameYieldInstruction; + + bool IEnumerator.MoveNext() + { + if (isFirst) + { + isFirst = false; + return true; // start WaitForEndOfFrame + } + + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + core.TrySetResult(null); + return false; + } + + public void Reset() + { + isFirst = true; + } + } + + sealed class DelayFramePromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + DelayFramePromise nextNode; + public ref DelayFramePromise NextNode => ref nextNode; + + static DelayFramePromise() + { + TaskPool.RegisterSizeGetter(typeof(DelayFramePromise), () => pool.Size); + } + + int initialFrame; + int delayFrameCount; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + int currentFrameCount; + UniTaskCompletionSourceCore core; + + DelayFramePromise() + { + } + + public static IUniTaskSource Create(int delayFrameCount, PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new DelayFramePromise(); + } + + result.delayFrameCount = delayFrameCount; + result.cancellationToken = cancellationToken; + result.initialFrame = PlayerLoopHelper.IsMainThread ? Time.frameCount : -1; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (DelayFramePromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (currentFrameCount == 0) + { + if (delayFrameCount == 0) // same as Yield + { + core.TrySetResult(AsyncUnit.Default); + return false; + } + + // skip in initial frame. + if (initialFrame == Time.frameCount) + { +#if UNITY_EDITOR + // force use Realtime. + if (PlayerLoopHelper.IsMainThread && !UnityEditor.EditorApplication.isPlaying) + { + //goto ++currentFrameCount + } + else + { + return true; + } +#else + return true; +#endif + } + } + + if (++currentFrameCount >= delayFrameCount) + { + core.TrySetResult(AsyncUnit.Default); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + currentFrameCount = default; + delayFrameCount = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + sealed class DelayPromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + DelayPromise nextNode; + public ref DelayPromise NextNode => ref nextNode; + + static DelayPromise() + { + TaskPool.RegisterSizeGetter(typeof(DelayPromise), () => pool.Size); + } + + int initialFrame; + float delayTimeSpan; + float elapsed; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + UniTaskCompletionSourceCore core; + + DelayPromise() + { + } + + public static IUniTaskSource Create(TimeSpan delayTimeSpan, PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new DelayPromise(); + } + + result.elapsed = 0.0f; + result.delayTimeSpan = (float)delayTimeSpan.TotalSeconds; + result.cancellationToken = cancellationToken; + result.initialFrame = PlayerLoopHelper.IsMainThread ? Time.frameCount : -1; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (DelayPromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (elapsed == 0.0f) + { + if (initialFrame == Time.frameCount) + { + return true; + } + } + + elapsed += Time.deltaTime; + if (elapsed >= delayTimeSpan) + { + core.TrySetResult(null); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + delayTimeSpan = default; + elapsed = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + sealed class DelayIgnoreTimeScalePromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + DelayIgnoreTimeScalePromise nextNode; + public ref DelayIgnoreTimeScalePromise NextNode => ref nextNode; + + static DelayIgnoreTimeScalePromise() + { + TaskPool.RegisterSizeGetter(typeof(DelayIgnoreTimeScalePromise), () => pool.Size); + } + + float delayFrameTimeSpan; + float elapsed; + int initialFrame; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + UniTaskCompletionSourceCore core; + + DelayIgnoreTimeScalePromise() + { + } + + public static IUniTaskSource Create(TimeSpan delayFrameTimeSpan, PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new DelayIgnoreTimeScalePromise(); + } + + result.elapsed = 0.0f; + result.delayFrameTimeSpan = (float)delayFrameTimeSpan.TotalSeconds; + result.initialFrame = PlayerLoopHelper.IsMainThread ? Time.frameCount : -1; + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (DelayIgnoreTimeScalePromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (elapsed == 0.0f) + { + if (initialFrame == Time.frameCount) + { + return true; + } + } + + elapsed += Time.unscaledDeltaTime; + if (elapsed >= delayFrameTimeSpan) + { + core.TrySetResult(null); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + delayFrameTimeSpan = default; + elapsed = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + sealed class DelayRealtimePromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + DelayRealtimePromise nextNode; + public ref DelayRealtimePromise NextNode => ref nextNode; + + static DelayRealtimePromise() + { + TaskPool.RegisterSizeGetter(typeof(DelayRealtimePromise), () => pool.Size); + } + + long delayTimeSpanTicks; + ValueStopwatch stopwatch; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + UniTaskCompletionSourceCore core; + + DelayRealtimePromise() + { + } + + public static IUniTaskSource Create(TimeSpan delayTimeSpan, PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new DelayRealtimePromise(); + } + + result.stopwatch = ValueStopwatch.StartNew(); + result.delayTimeSpanTicks = delayTimeSpan.Ticks; + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (DelayRealtimePromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (stopwatch.IsInvalid) + { + core.TrySetResult(AsyncUnit.Default); + return false; + } + + if (stopwatch.ElapsedTicks >= delayTimeSpanTicks) + { + core.TrySetResult(AsyncUnit.Default); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + stopwatch = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + } + + public readonly struct YieldAwaitable + { + readonly PlayerLoopTiming timing; + + public YieldAwaitable(PlayerLoopTiming timing) + { + this.timing = timing; + } + + public Awaiter GetAwaiter() + { + return new Awaiter(timing); + } + + public UniTask ToUniTask() + { + return UniTask.Yield(timing, CancellationToken.None); + } + + public readonly struct Awaiter : ICriticalNotifyCompletion + { + readonly PlayerLoopTiming timing; + + public Awaiter(PlayerLoopTiming timing) + { + this.timing = timing; + } + + public bool IsCompleted => false; + + public void GetResult() { } + + public void OnCompleted(Action continuation) + { + PlayerLoopHelper.AddContinuation(timing, continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + PlayerLoopHelper.AddContinuation(timing, continuation); + } + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Delay.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Delay.cs.meta new file mode 100644 index 00000000..08ce5793 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Delay.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ecff7972251de0848b2c0fa89bbd3489 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Factory.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Factory.cs new file mode 100644 index 00000000..2f6a6a9e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Factory.cs @@ -0,0 +1,499 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public partial struct UniTask + { + static readonly UniTask CanceledUniTask = new Func(() => + { + return new UniTask(new CanceledResultSource(CancellationToken.None), 0); + })(); + + static class CanceledUniTaskCache + { + public static readonly UniTask Task; + + static CanceledUniTaskCache() + { + Task = new UniTask(new CanceledResultSource(CancellationToken.None), 0); + } + } + + public static readonly UniTask CompletedTask = new UniTask(); + + public static UniTask FromException(Exception ex) + { + if (ex is OperationCanceledException oce) + { + return FromCanceled(oce.CancellationToken); + } + + return new UniTask(new ExceptionResultSource(ex), 0); + } + + public static UniTask FromException(Exception ex) + { + if (ex is OperationCanceledException oce) + { + return FromCanceled(oce.CancellationToken); + } + + return new UniTask(new ExceptionResultSource(ex), 0); + } + + public static UniTask FromResult(T value) + { + return new UniTask(value); + } + + public static UniTask FromCanceled(CancellationToken cancellationToken = default) + { + if (cancellationToken == CancellationToken.None) + { + return CanceledUniTask; + } + else + { + return new UniTask(new CanceledResultSource(cancellationToken), 0); + } + } + + public static UniTask FromCanceled(CancellationToken cancellationToken = default) + { + if (cancellationToken == CancellationToken.None) + { + return CanceledUniTaskCache.Task; + } + else + { + return new UniTask(new CanceledResultSource(cancellationToken), 0); + } + } + + public static UniTask Create(Func factory) + { + return factory(); + } + + public static UniTask Create(Func> factory) + { + return factory(); + } + + public static AsyncLazy Lazy(Func factory) + { + return new AsyncLazy(factory); + } + + public static AsyncLazy Lazy(Func> factory) + { + return new AsyncLazy(factory); + } + + /// + /// helper of fire and forget void action. + /// + public static void Void(Func asyncAction) + { + asyncAction().Forget(); + } + + /// + /// helper of fire and forget void action. + /// + public static void Void(Func asyncAction, CancellationToken cancellationToken) + { + asyncAction(cancellationToken).Forget(); + } + + /// + /// helper of fire and forget void action. + /// + public static void Void(Func asyncAction, T state) + { + asyncAction(state).Forget(); + } + + /// + /// helper of create add UniTaskVoid to delegate. + /// For example: FooAction = UniTask.Action(async () => { /* */ }) + /// + public static Action Action(Func asyncAction) + { + return () => asyncAction().Forget(); + } + + /// + /// helper of create add UniTaskVoid to delegate. + /// + public static Action Action(Func asyncAction, CancellationToken cancellationToken) + { + return () => asyncAction(cancellationToken).Forget(); + } + +#if UNITY_2018_3_OR_NEWER + + /// + /// Create async void(UniTaskVoid) UnityAction. + /// For exampe: onClick.AddListener(UniTask.UnityAction(async () => { /* */ } )) + /// + public static UnityEngine.Events.UnityAction UnityAction(Func asyncAction) + { + return () => asyncAction().Forget(); + } + + /// + /// Create async void(UniTaskVoid) UnityAction. + /// For exampe: onClick.AddListener(UniTask.UnityAction(FooAsync, this.GetCancellationTokenOnDestroy())) + /// + public static UnityEngine.Events.UnityAction UnityAction(Func asyncAction, CancellationToken cancellationToken) + { + return () => asyncAction(cancellationToken).Forget(); + } + +#endif + + /// + /// Defer the task creation just before call await. + /// + public static UniTask Defer(Func factory) + { + return new UniTask(new DeferPromise(factory), 0); + } + + /// + /// Defer the task creation just before call await. + /// + public static UniTask Defer(Func> factory) + { + return new UniTask(new DeferPromise(factory), 0); + } + + /// + /// Never complete. + /// + public static UniTask Never(CancellationToken cancellationToken) + { + return new UniTask(new NeverPromise(cancellationToken), 0); + } + + /// + /// Never complete. + /// + public static UniTask Never(CancellationToken cancellationToken) + { + return new UniTask(new NeverPromise(cancellationToken), 0); + } + + sealed class ExceptionResultSource : IUniTaskSource + { + readonly ExceptionDispatchInfo exception; + bool calledGet; + + public ExceptionResultSource(Exception exception) + { + this.exception = ExceptionDispatchInfo.Capture(exception); + } + + public void GetResult(short token) + { + if (!calledGet) + { + calledGet = true; + GC.SuppressFinalize(this); + } + exception.Throw(); + } + + public UniTaskStatus GetStatus(short token) + { + return UniTaskStatus.Faulted; + } + + public UniTaskStatus UnsafeGetStatus() + { + return UniTaskStatus.Faulted; + } + + public void OnCompleted(Action continuation, object state, short token) + { + continuation(state); + } + + ~ExceptionResultSource() + { + if (!calledGet) + { + UniTaskScheduler.PublishUnobservedTaskException(exception.SourceException); + } + } + } + + sealed class ExceptionResultSource : IUniTaskSource + { + readonly ExceptionDispatchInfo exception; + bool calledGet; + + public ExceptionResultSource(Exception exception) + { + this.exception = ExceptionDispatchInfo.Capture(exception); + } + + public T GetResult(short token) + { + if (!calledGet) + { + calledGet = true; + GC.SuppressFinalize(this); + } + exception.Throw(); + return default; + } + + void IUniTaskSource.GetResult(short token) + { + if (!calledGet) + { + calledGet = true; + GC.SuppressFinalize(this); + } + exception.Throw(); + } + + public UniTaskStatus GetStatus(short token) + { + return UniTaskStatus.Faulted; + } + + public UniTaskStatus UnsafeGetStatus() + { + return UniTaskStatus.Faulted; + } + + public void OnCompleted(Action continuation, object state, short token) + { + continuation(state); + } + + ~ExceptionResultSource() + { + if (!calledGet) + { + UniTaskScheduler.PublishUnobservedTaskException(exception.SourceException); + } + } + } + + sealed class CanceledResultSource : IUniTaskSource + { + readonly CancellationToken cancellationToken; + + public CanceledResultSource(CancellationToken cancellationToken) + { + this.cancellationToken = cancellationToken; + } + + public void GetResult(short token) + { + throw new OperationCanceledException(cancellationToken); + } + + public UniTaskStatus GetStatus(short token) + { + return UniTaskStatus.Canceled; + } + + public UniTaskStatus UnsafeGetStatus() + { + return UniTaskStatus.Canceled; + } + + public void OnCompleted(Action continuation, object state, short token) + { + continuation(state); + } + } + + sealed class CanceledResultSource : IUniTaskSource + { + readonly CancellationToken cancellationToken; + + public CanceledResultSource(CancellationToken cancellationToken) + { + this.cancellationToken = cancellationToken; + } + + public T GetResult(short token) + { + throw new OperationCanceledException(cancellationToken); + } + + void IUniTaskSource.GetResult(short token) + { + throw new OperationCanceledException(cancellationToken); + } + + public UniTaskStatus GetStatus(short token) + { + return UniTaskStatus.Canceled; + } + + public UniTaskStatus UnsafeGetStatus() + { + return UniTaskStatus.Canceled; + } + + public void OnCompleted(Action continuation, object state, short token) + { + continuation(state); + } + } + + sealed class DeferPromise : IUniTaskSource + { + Func factory; + UniTask task; + UniTask.Awaiter awaiter; + + public DeferPromise(Func factory) + { + this.factory = factory; + } + + public void GetResult(short token) + { + awaiter.GetResult(); + } + + public UniTaskStatus GetStatus(short token) + { + var f = Interlocked.Exchange(ref factory, null); + if (f != null) + { + task = f(); + awaiter = task.GetAwaiter(); + } + + return task.Status; + } + + public void OnCompleted(Action continuation, object state, short token) + { + awaiter.SourceOnCompleted(continuation, state); + } + + public UniTaskStatus UnsafeGetStatus() + { + return task.Status; + } + } + + sealed class DeferPromise : IUniTaskSource + { + Func> factory; + UniTask task; + UniTask.Awaiter awaiter; + + public DeferPromise(Func> factory) + { + this.factory = factory; + } + + public T GetResult(short token) + { + return awaiter.GetResult(); + } + + void IUniTaskSource.GetResult(short token) + { + awaiter.GetResult(); + } + + public UniTaskStatus GetStatus(short token) + { + var f = Interlocked.Exchange(ref factory, null); + if (f != null) + { + task = f(); + awaiter = task.GetAwaiter(); + } + + return task.Status; + } + + public void OnCompleted(Action continuation, object state, short token) + { + awaiter.SourceOnCompleted(continuation, state); + } + + public UniTaskStatus UnsafeGetStatus() + { + return task.Status; + } + } + + sealed class NeverPromise : IUniTaskSource + { + static readonly Action cancellationCallback = CancellationCallback; + + CancellationToken cancellationToken; + UniTaskCompletionSourceCore core; + + public NeverPromise(CancellationToken cancellationToken) + { + this.cancellationToken = cancellationToken; + if (this.cancellationToken.CanBeCanceled) + { + this.cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); + } + } + + static void CancellationCallback(object state) + { + var self = (NeverPromise)state; + self.core.TrySetCanceled(self.cancellationToken); + } + + public T GetResult(short token) + { + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + void IUniTaskSource.GetResult(short token) + { + core.GetResult(token); + } + } + } + + internal static class CompletedTasks + { + public static readonly UniTask AsyncUnit = UniTask.FromResult(Cysharp.Threading.Tasks.AsyncUnit.Default); + public static readonly UniTask True = UniTask.FromResult(true); + public static readonly UniTask False = UniTask.FromResult(false); + public static readonly UniTask Zero = UniTask.FromResult(0); + public static readonly UniTask MinusOne = UniTask.FromResult(-1); + public static readonly UniTask One = UniTask.FromResult(1); + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Factory.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Factory.cs.meta new file mode 100644 index 00000000..31bc0c95 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Factory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4e12b66d6b9bd7845b04a594cbe386b4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs new file mode 100644 index 00000000..ac3e7958 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs @@ -0,0 +1,289 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public partial struct UniTask + { + #region OBSOLETE_RUN + + [Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")] + public static UniTask Run(Action action, bool configureAwait = true, CancellationToken cancellationToken = default) + { + return RunOnThreadPool(action, configureAwait, cancellationToken); + } + + [Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")] + public static UniTask Run(Action action, object state, bool configureAwait = true, CancellationToken cancellationToken = default) + { + return RunOnThreadPool(action, state, configureAwait, cancellationToken); + } + + [Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")] + public static UniTask Run(Func action, bool configureAwait = true, CancellationToken cancellationToken = default) + { + return RunOnThreadPool(action, configureAwait, cancellationToken); + } + + [Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")] + public static UniTask Run(Func action, object state, bool configureAwait = true, CancellationToken cancellationToken = default) + { + return RunOnThreadPool(action, state, configureAwait, cancellationToken); + } + + [Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")] + public static UniTask Run(Func func, bool configureAwait = true, CancellationToken cancellationToken = default) + { + return RunOnThreadPool(func, configureAwait, cancellationToken); + } + + [Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")] + public static UniTask Run(Func> func, bool configureAwait = true, CancellationToken cancellationToken = default) + { + return RunOnThreadPool(func, configureAwait, cancellationToken); + } + + [Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")] + public static UniTask Run(Func func, object state, bool configureAwait = true, CancellationToken cancellationToken = default) + { + return RunOnThreadPool(func, state, configureAwait, cancellationToken); + } + + [Obsolete("UniTask.Run is similar as Task.Run, it uses ThreadPool. For equivalent behaviour, use UniTask.RunOnThreadPool instead. If you don't want to use ThreadPool, you can use UniTask.Void(async void) or UniTask.Create(async UniTask) too.")] + public static UniTask Run(Func> func, object state, bool configureAwait = true, CancellationToken cancellationToken = default) + { + return RunOnThreadPool(func, state, configureAwait, cancellationToken); + } + + #endregion + + /// Run action on the threadPool and return to main thread if configureAwait = true. + public static async UniTask RunOnThreadPool(Action action, bool configureAwait = true, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + + await UniTask.SwitchToThreadPool(); + + cancellationToken.ThrowIfCancellationRequested(); + + if (configureAwait) + { + try + { + action(); + } + finally + { + await UniTask.Yield(); + } + } + else + { + action(); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + /// Run action on the threadPool and return to main thread if configureAwait = true. + public static async UniTask RunOnThreadPool(Action action, object state, bool configureAwait = true, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + + await UniTask.SwitchToThreadPool(); + + cancellationToken.ThrowIfCancellationRequested(); + + if (configureAwait) + { + try + { + action(state); + } + finally + { + await UniTask.Yield(); + } + } + else + { + action(state); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + /// Run action on the threadPool and return to main thread if configureAwait = true. + public static async UniTask RunOnThreadPool(Func action, bool configureAwait = true, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + + await UniTask.SwitchToThreadPool(); + + cancellationToken.ThrowIfCancellationRequested(); + + if (configureAwait) + { + try + { + await action(); + } + finally + { + await UniTask.Yield(); + } + } + else + { + await action(); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + /// Run action on the threadPool and return to main thread if configureAwait = true. + public static async UniTask RunOnThreadPool(Func action, object state, bool configureAwait = true, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + + await UniTask.SwitchToThreadPool(); + + cancellationToken.ThrowIfCancellationRequested(); + + if (configureAwait) + { + try + { + await action(state); + } + finally + { + await UniTask.Yield(); + } + } + else + { + await action(state); + } + + cancellationToken.ThrowIfCancellationRequested(); + } + + /// Run action on the threadPool and return to main thread if configureAwait = true. + public static async UniTask RunOnThreadPool(Func func, bool configureAwait = true, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + + await UniTask.SwitchToThreadPool(); + + cancellationToken.ThrowIfCancellationRequested(); + + if (configureAwait) + { + try + { + return func(); + } + finally + { + await UniTask.Yield(); + cancellationToken.ThrowIfCancellationRequested(); + } + } + else + { + return func(); + } + } + + /// Run action on the threadPool and return to main thread if configureAwait = true. + public static async UniTask RunOnThreadPool(Func> func, bool configureAwait = true, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + + await UniTask.SwitchToThreadPool(); + + cancellationToken.ThrowIfCancellationRequested(); + + if (configureAwait) + { + try + { + return await func(); + } + finally + { + cancellationToken.ThrowIfCancellationRequested(); + await UniTask.Yield(); + cancellationToken.ThrowIfCancellationRequested(); + } + } + else + { + var result = await func(); + cancellationToken.ThrowIfCancellationRequested(); + return result; + } + } + + /// Run action on the threadPool and return to main thread if configureAwait = true. + public static async UniTask RunOnThreadPool(Func func, object state, bool configureAwait = true, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + + await UniTask.SwitchToThreadPool(); + + cancellationToken.ThrowIfCancellationRequested(); + + if (configureAwait) + { + try + { + return func(state); + } + finally + { + await UniTask.Yield(); + cancellationToken.ThrowIfCancellationRequested(); + } + } + else + { + return func(state); + } + } + + /// Run action on the threadPool and return to main thread if configureAwait = true. + public static async UniTask RunOnThreadPool(Func> func, object state, bool configureAwait = true, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + + await UniTask.SwitchToThreadPool(); + + cancellationToken.ThrowIfCancellationRequested(); + + if (configureAwait) + { + try + { + return await func(state); + } + finally + { + cancellationToken.ThrowIfCancellationRequested(); + await UniTask.Yield(); + cancellationToken.ThrowIfCancellationRequested(); + } + } + else + { + var result = await func(state); + cancellationToken.ThrowIfCancellationRequested(); + return result; + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs.meta new file mode 100644 index 00000000..9a780aea --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Run.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8473162fc285a5f44bcca90f7da073e7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Threading.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Threading.cs new file mode 100644 index 00000000..71d6aec2 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Threading.cs @@ -0,0 +1,412 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + public partial struct UniTask + { +#if UNITY_2018_3_OR_NEWER + + /// + /// If running on mainthread, do nothing. Otherwise, same as UniTask.Yield(PlayerLoopTiming.Update). + /// + public static SwitchToMainThreadAwaitable SwitchToMainThread(CancellationToken cancellationToken = default) + { + return new SwitchToMainThreadAwaitable(PlayerLoopTiming.Update, cancellationToken); + } + + /// + /// If running on mainthread, do nothing. Otherwise, same as UniTask.Yield(timing). + /// + public static SwitchToMainThreadAwaitable SwitchToMainThread(PlayerLoopTiming timing, CancellationToken cancellationToken = default) + { + return new SwitchToMainThreadAwaitable(timing, cancellationToken); + } + + /// + /// Return to mainthread(same as await SwitchToMainThread) after using scope is closed. + /// + public static ReturnToMainThread ReturnToMainThread(CancellationToken cancellationToken = default) + { + return new ReturnToMainThread(PlayerLoopTiming.Update, cancellationToken); + } + + /// + /// Return to mainthread(same as await SwitchToMainThread) after using scope is closed. + /// + public static ReturnToMainThread ReturnToMainThread(PlayerLoopTiming timing, CancellationToken cancellationToken = default) + { + return new ReturnToMainThread(timing, cancellationToken); + } + + /// + /// Queue the action to PlayerLoop. + /// + public static void Post(Action action, PlayerLoopTiming timing = PlayerLoopTiming.Update) + { + PlayerLoopHelper.AddContinuation(timing, action); + } + +#endif + + public static SwitchToThreadPoolAwaitable SwitchToThreadPool() + { + return new SwitchToThreadPoolAwaitable(); + } + + /// + /// Note: use SwitchToThreadPool is recommended. + /// + public static SwitchToTaskPoolAwaitable SwitchToTaskPool() + { + return new SwitchToTaskPoolAwaitable(); + } + + public static SwitchToSynchronizationContextAwaitable SwitchToSynchronizationContext(SynchronizationContext synchronizationContext, CancellationToken cancellationToken = default) + { + Error.ThrowArgumentNullException(synchronizationContext, nameof(synchronizationContext)); + return new SwitchToSynchronizationContextAwaitable(synchronizationContext, cancellationToken); + } + + public static ReturnToSynchronizationContext ReturnToSynchronizationContext(SynchronizationContext synchronizationContext, CancellationToken cancellationToken = default) + { + return new ReturnToSynchronizationContext(synchronizationContext, false, cancellationToken); + } + + public static ReturnToSynchronizationContext ReturnToCurrentSynchronizationContext(bool dontPostWhenSameContext = true, CancellationToken cancellationToken = default) + { + return new ReturnToSynchronizationContext(SynchronizationContext.Current, dontPostWhenSameContext, cancellationToken); + } + } + +#if UNITY_2018_3_OR_NEWER + + public struct SwitchToMainThreadAwaitable + { + readonly PlayerLoopTiming playerLoopTiming; + readonly CancellationToken cancellationToken; + + public SwitchToMainThreadAwaitable(PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken) + { + this.playerLoopTiming = playerLoopTiming; + this.cancellationToken = cancellationToken; + } + + public Awaiter GetAwaiter() => new Awaiter(playerLoopTiming, cancellationToken); + + public struct Awaiter : ICriticalNotifyCompletion + { + readonly PlayerLoopTiming playerLoopTiming; + readonly CancellationToken cancellationToken; + + public Awaiter(PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken) + { + this.playerLoopTiming = playerLoopTiming; + this.cancellationToken = cancellationToken; + } + + public bool IsCompleted + { + get + { + var currentThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId; + if (PlayerLoopHelper.MainThreadId == currentThreadId) + { + return true; // run immediate. + } + else + { + return false; // register continuation. + } + } + } + + public void GetResult() { cancellationToken.ThrowIfCancellationRequested(); } + + public void OnCompleted(Action continuation) + { + PlayerLoopHelper.AddContinuation(playerLoopTiming, continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + PlayerLoopHelper.AddContinuation(playerLoopTiming, continuation); + } + } + } + + public struct ReturnToMainThread + { + readonly PlayerLoopTiming playerLoopTiming; + readonly CancellationToken cancellationToken; + + public ReturnToMainThread(PlayerLoopTiming playerLoopTiming, CancellationToken cancellationToken) + { + this.playerLoopTiming = playerLoopTiming; + this.cancellationToken = cancellationToken; + } + + public Awaiter DisposeAsync() + { + return new Awaiter(playerLoopTiming, cancellationToken); // run immediate. + } + + public readonly struct Awaiter : ICriticalNotifyCompletion + { + readonly PlayerLoopTiming timing; + readonly CancellationToken cancellationToken; + + public Awaiter(PlayerLoopTiming timing, CancellationToken cancellationToken) + { + this.timing = timing; + this.cancellationToken = cancellationToken; + } + + public Awaiter GetAwaiter() => this; + + public bool IsCompleted => PlayerLoopHelper.MainThreadId == System.Threading.Thread.CurrentThread.ManagedThreadId; + + public void GetResult() { cancellationToken.ThrowIfCancellationRequested(); } + + public void OnCompleted(Action continuation) + { + PlayerLoopHelper.AddContinuation(timing, continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + PlayerLoopHelper.AddContinuation(timing, continuation); + } + } + } + +#endif + + public struct SwitchToThreadPoolAwaitable + { + public Awaiter GetAwaiter() => new Awaiter(); + + public struct Awaiter : ICriticalNotifyCompletion + { + static readonly WaitCallback switchToCallback = Callback; + + public bool IsCompleted => false; + public void GetResult() { } + + public void OnCompleted(Action continuation) + { + ThreadPool.QueueUserWorkItem(switchToCallback, continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { +#if NETCOREAPP3_1 + ThreadPool.UnsafeQueueUserWorkItem(ThreadPoolWorkItem.Create(continuation), false); +#else + ThreadPool.UnsafeQueueUserWorkItem(switchToCallback, continuation); +#endif + } + + static void Callback(object state) + { + var continuation = (Action)state; + continuation(); + } + } + +#if NETCOREAPP3_1 + + sealed class ThreadPoolWorkItem : IThreadPoolWorkItem, ITaskPoolNode + { + static TaskPool pool; + ThreadPoolWorkItem nextNode; + public ref ThreadPoolWorkItem NextNode => ref nextNode; + + static ThreadPoolWorkItem() + { + TaskPool.RegisterSizeGetter(typeof(ThreadPoolWorkItem), () => pool.Size); + } + + Action continuation; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ThreadPoolWorkItem Create(Action continuation) + { + if (!pool.TryPop(out var item)) + { + item = new ThreadPoolWorkItem(); + } + + item.continuation = continuation; + return item; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Execute() + { + var call = continuation; + continuation = null; + if (call != null) + { + pool.TryPush(this); + call.Invoke(); + } + } + } + +#endif + } + + public struct SwitchToTaskPoolAwaitable + { + public Awaiter GetAwaiter() => new Awaiter(); + + public struct Awaiter : ICriticalNotifyCompletion + { + static readonly Action switchToCallback = Callback; + + public bool IsCompleted => false; + public void GetResult() { } + + public void OnCompleted(Action continuation) + { + Task.Factory.StartNew(switchToCallback, continuation, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); + } + + public void UnsafeOnCompleted(Action continuation) + { + Task.Factory.StartNew(switchToCallback, continuation, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); + } + + static void Callback(object state) + { + var continuation = (Action)state; + continuation(); + } + } + } + + public struct SwitchToSynchronizationContextAwaitable + { + readonly SynchronizationContext synchronizationContext; + readonly CancellationToken cancellationToken; + + public SwitchToSynchronizationContextAwaitable(SynchronizationContext synchronizationContext, CancellationToken cancellationToken) + { + this.synchronizationContext = synchronizationContext; + this.cancellationToken = cancellationToken; + } + + public Awaiter GetAwaiter() => new Awaiter(synchronizationContext, cancellationToken); + + public struct Awaiter : ICriticalNotifyCompletion + { + static readonly SendOrPostCallback switchToCallback = Callback; + readonly SynchronizationContext synchronizationContext; + readonly CancellationToken cancellationToken; + + public Awaiter(SynchronizationContext synchronizationContext, CancellationToken cancellationToken) + { + this.synchronizationContext = synchronizationContext; + this.cancellationToken = cancellationToken; + } + + public bool IsCompleted => false; + public void GetResult() { cancellationToken.ThrowIfCancellationRequested(); } + + public void OnCompleted(Action continuation) + { + synchronizationContext.Post(switchToCallback, continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + synchronizationContext.Post(switchToCallback, continuation); + } + + static void Callback(object state) + { + var continuation = (Action)state; + continuation(); + } + } + } + + public struct ReturnToSynchronizationContext + { + readonly SynchronizationContext syncContext; + readonly bool dontPostWhenSameContext; + readonly CancellationToken cancellationToken; + + public ReturnToSynchronizationContext(SynchronizationContext syncContext, bool dontPostWhenSameContext, CancellationToken cancellationToken) + { + this.syncContext = syncContext; + this.dontPostWhenSameContext = dontPostWhenSameContext; + this.cancellationToken = cancellationToken; + } + + public Awaiter DisposeAsync() + { + return new Awaiter(syncContext, dontPostWhenSameContext, cancellationToken); + } + + public struct Awaiter : ICriticalNotifyCompletion + { + static readonly SendOrPostCallback switchToCallback = Callback; + + readonly SynchronizationContext synchronizationContext; + readonly bool dontPostWhenSameContext; + readonly CancellationToken cancellationToken; + + public Awaiter(SynchronizationContext synchronizationContext, bool dontPostWhenSameContext, CancellationToken cancellationToken) + { + this.synchronizationContext = synchronizationContext; + this.dontPostWhenSameContext = dontPostWhenSameContext; + this.cancellationToken = cancellationToken; + } + + public Awaiter GetAwaiter() => this; + + public bool IsCompleted + { + get + { + if (!dontPostWhenSameContext) return false; + + var current = SynchronizationContext.Current; + if (current == synchronizationContext) + { + return true; + } + else + { + return false; + } + } + } + + public void GetResult() { cancellationToken.ThrowIfCancellationRequested(); } + + public void OnCompleted(Action continuation) + { + synchronizationContext.Post(switchToCallback, continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + synchronizationContext.Post(switchToCallback, continuation); + } + + static void Callback(object state) + { + var continuation = (Action)state; + continuation(); + } + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Threading.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Threading.cs.meta new file mode 100644 index 00000000..fa512b8c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.Threading.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4132ea600454134439fa2c7eb931b5e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WaitUntil.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WaitUntil.cs new file mode 100644 index 00000000..b28a529e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WaitUntil.cs @@ -0,0 +1,637 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + public partial struct UniTask + { + public static UniTask WaitUntil(Func predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + return new UniTask(WaitUntilPromise.Create(predicate, timing, cancellationToken, cancelImmediately, out var token), token); + } + + public static UniTask WaitWhile(Func predicate, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + return new UniTask(WaitWhilePromise.Create(predicate, timing, cancellationToken, cancelImmediately, out var token), token); + } + + public static UniTask WaitUntilCanceled(CancellationToken cancellationToken, PlayerLoopTiming timing = PlayerLoopTiming.Update, bool completeImmediately = false) + { + return new UniTask(WaitUntilCanceledPromise.Create(cancellationToken, timing, completeImmediately, out var token), token); + } + + public static UniTask WaitUntilValueChanged(T target, Func monitorFunction, PlayerLoopTiming monitorTiming = PlayerLoopTiming.Update, IEqualityComparer equalityComparer = null, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + where T : class + { + var unityObject = target as UnityEngine.Object; + var isUnityObject = target is UnityEngine.Object; // don't use (unityObject == null) + + return new UniTask(isUnityObject + ? WaitUntilValueChangedUnityObjectPromise.Create(target, monitorFunction, equalityComparer, monitorTiming, cancellationToken, cancelImmediately, out var token) + : WaitUntilValueChangedStandardObjectPromise.Create(target, monitorFunction, equalityComparer, monitorTiming, cancellationToken, cancelImmediately, out token), token); + } + + sealed class WaitUntilPromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + WaitUntilPromise nextNode; + public ref WaitUntilPromise NextNode => ref nextNode; + + static WaitUntilPromise() + { + TaskPool.RegisterSizeGetter(typeof(WaitUntilPromise), () => pool.Size); + } + + Func predicate; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + UniTaskCompletionSourceCore core; + + WaitUntilPromise() + { + } + + public static IUniTaskSource Create(Func predicate, PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new WaitUntilPromise(); + } + + result.predicate = predicate; + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (WaitUntilPromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + try + { + if (!predicate()) + { + return true; + } + } + catch (Exception ex) + { + core.TrySetException(ex); + return false; + } + + core.TrySetResult(null); + return false; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + predicate = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + sealed class WaitWhilePromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + WaitWhilePromise nextNode; + public ref WaitWhilePromise NextNode => ref nextNode; + + static WaitWhilePromise() + { + TaskPool.RegisterSizeGetter(typeof(WaitWhilePromise), () => pool.Size); + } + + Func predicate; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + UniTaskCompletionSourceCore core; + + WaitWhilePromise() + { + } + + public static IUniTaskSource Create(Func predicate, PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new WaitWhilePromise(); + } + + result.predicate = predicate; + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (WaitWhilePromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + try + { + if (predicate()) + { + return true; + } + } + catch (Exception ex) + { + core.TrySetException(ex); + return false; + } + + core.TrySetResult(null); + return false; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + predicate = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + sealed class WaitUntilCanceledPromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + WaitUntilCanceledPromise nextNode; + public ref WaitUntilCanceledPromise NextNode => ref nextNode; + + static WaitUntilCanceledPromise() + { + TaskPool.RegisterSizeGetter(typeof(WaitUntilCanceledPromise), () => pool.Size); + } + + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + UniTaskCompletionSourceCore core; + + WaitUntilCanceledPromise() + { + } + + public static IUniTaskSource Create(CancellationToken cancellationToken, PlayerLoopTiming timing, bool completeImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new WaitUntilCanceledPromise(); + } + + result.cancellationToken = cancellationToken; + + if (completeImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (WaitUntilCanceledPromise)state; + promise.core.TrySetResult(null); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetResult(null); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + // where T : UnityEngine.Object, can not add constraint + sealed class WaitUntilValueChangedUnityObjectPromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode> + { + static TaskPool> pool; + WaitUntilValueChangedUnityObjectPromise nextNode; + public ref WaitUntilValueChangedUnityObjectPromise NextNode => ref nextNode; + + static WaitUntilValueChangedUnityObjectPromise() + { + TaskPool.RegisterSizeGetter(typeof(WaitUntilValueChangedUnityObjectPromise), () => pool.Size); + } + + T target; + UnityEngine.Object targetAsUnityObject; + U currentValue; + Func monitorFunction; + IEqualityComparer equalityComparer; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + UniTaskCompletionSourceCore core; + + WaitUntilValueChangedUnityObjectPromise() + { + } + + public static IUniTaskSource Create(T target, Func monitorFunction, IEqualityComparer equalityComparer, PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new WaitUntilValueChangedUnityObjectPromise(); + } + + result.target = target; + result.targetAsUnityObject = target as UnityEngine.Object; + result.monitorFunction = monitorFunction; + result.currentValue = monitorFunction(target); + result.equalityComparer = equalityComparer ?? UnityEqualityComparer.GetDefault(); + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (WaitUntilValueChangedUnityObjectPromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public U GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested || targetAsUnityObject == null) // destroyed = cancel. + { + core.TrySetCanceled(cancellationToken); + return false; + } + + U nextValue = default(U); + try + { + nextValue = monitorFunction(target); + if (equalityComparer.Equals(currentValue, nextValue)) + { + return true; + } + } + catch (Exception ex) + { + core.TrySetException(ex); + return false; + } + + core.TrySetResult(nextValue); + return false; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + target = default; + currentValue = default; + monitorFunction = default; + equalityComparer = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + sealed class WaitUntilValueChangedStandardObjectPromise : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode> + where T : class + { + static TaskPool> pool; + WaitUntilValueChangedStandardObjectPromise nextNode; + public ref WaitUntilValueChangedStandardObjectPromise NextNode => ref nextNode; + + static WaitUntilValueChangedStandardObjectPromise() + { + TaskPool.RegisterSizeGetter(typeof(WaitUntilValueChangedStandardObjectPromise), () => pool.Size); + } + + WeakReference target; + U currentValue; + Func monitorFunction; + IEqualityComparer equalityComparer; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + UniTaskCompletionSourceCore core; + + WaitUntilValueChangedStandardObjectPromise() + { + } + + public static IUniTaskSource Create(T target, Func monitorFunction, IEqualityComparer equalityComparer, PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new WaitUntilValueChangedStandardObjectPromise(); + } + + result.target = new WeakReference(target, false); // wrap in WeakReference. + result.monitorFunction = monitorFunction; + result.currentValue = monitorFunction(target); + result.equalityComparer = equalityComparer ?? UnityEqualityComparer.GetDefault(); + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (WaitUntilValueChangedStandardObjectPromise)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public U GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested || !target.TryGetTarget(out var t)) // doesn't find = cancel. + { + core.TrySetCanceled(cancellationToken); + return false; + } + + U nextValue = default(U); + try + { + nextValue = monitorFunction(t); + if (equalityComparer.Equals(currentValue, nextValue)) + { + return true; + } + } + catch (Exception ex) + { + core.TrySetException(ex); + return false; + } + + core.TrySetResult(nextValue); + return false; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + target = default; + currentValue = default; + monitorFunction = default; + equalityComparer = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WaitUntil.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WaitUntil.cs.meta new file mode 100644 index 00000000..6e64dc7e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WaitUntil.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 87c9c533491903a4288536b5ac173db8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.Generated.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.Generated.cs new file mode 100644 index 00000000..9ef07d62 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.Generated.cs @@ -0,0 +1,5011 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +using System; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + public partial struct UniTask + { + + public static UniTask<(T1, T2)> WhenAll(UniTask task1, UniTask task2) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2)>(new WhenAllPromise(task1, task2), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2)> + { + T1 t1 = default; + T2 t2 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2)> core; + + public WhenAllPromise(UniTask task1, UniTask task2) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 2) + { + self.core.TrySetResult((self.t1, self.t2)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 2) + { + self.core.TrySetResult((self.t1, self.t2)); + } + } + + + public (T1, T2) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3)> WhenAll(UniTask task1, UniTask task2, UniTask task3) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3)>(new WhenAllPromise(task1, task2, task3), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 3) + { + self.core.TrySetResult((self.t1, self.t2, self.t3)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 3) + { + self.core.TrySetResult((self.t1, self.t2, self.t3)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 3) + { + self.core.TrySetResult((self.t1, self.t2, self.t3)); + } + } + + + public (T1, T2, T3) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4)>(new WhenAllPromise(task1, task2, task3, task4), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 4) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 4) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 4) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 4) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4)); + } + } + + + public (T1, T2, T3, T4) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5)>(new WhenAllPromise(task1, task2, task3, task4, task5), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 5) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 5) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 5) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 5) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 5) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5)); + } + } + + + public (T1, T2, T3, T4, T5) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 6) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 6) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 6) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 6) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 6) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 6) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6)); + } + } + + + public (T1, T2, T3, T4, T5, T6) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully() && task7.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6, T7)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult(), task7.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6, T7)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6, T7)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + T7 t7 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6, T7)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 7) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 7) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 7) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 7) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 7) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 7) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7)); + } + } + + static void TryInvokeContinuationT7(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t7 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 7) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7)); + } + } + + + public (T1, T2, T3, T4, T5, T6, T7) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully() && task7.Status.IsCompletedSuccessfully() && task8.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult(), task7.GetAwaiter().GetResult(), task8.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7, task8), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6, T7, T8)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + T7 t7 = default; + T8 t8 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6, T7, T8)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 8) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 8) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 8) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 8) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 8) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 8) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8)); + } + } + + static void TryInvokeContinuationT7(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t7 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 8) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8)); + } + } + + static void TryInvokeContinuationT8(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t8 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 8) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8)); + } + } + + + public (T1, T2, T3, T4, T5, T6, T7, T8) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully() && task7.Status.IsCompletedSuccessfully() && task8.Status.IsCompletedSuccessfully() && task9.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult(), task7.GetAwaiter().GetResult(), task8.GetAwaiter().GetResult(), task9.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6, T7, T8, T9)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + T7 t7 = default; + T8 t8 = default; + T9 t9 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6, T7, T8, T9)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 9) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 9) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 9) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 9) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 9) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 9) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9)); + } + } + + static void TryInvokeContinuationT7(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t7 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 9) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9)); + } + } + + static void TryInvokeContinuationT8(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t8 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 9) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9)); + } + } + + static void TryInvokeContinuationT9(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t9 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 9) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9)); + } + } + + + public (T1, T2, T3, T4, T5, T6, T7, T8, T9) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully() && task7.Status.IsCompletedSuccessfully() && task8.Status.IsCompletedSuccessfully() && task9.Status.IsCompletedSuccessfully() && task10.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult(), task7.GetAwaiter().GetResult(), task8.GetAwaiter().GetResult(), task9.GetAwaiter().GetResult(), task10.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + T7 t7 = default; + T8 t8 = default; + T9 t9 = default; + T10 t10 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + static void TryInvokeContinuationT7(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t7 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + static void TryInvokeContinuationT8(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t8 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + static void TryInvokeContinuationT9(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t9 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + static void TryInvokeContinuationT10(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t10 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 10) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10)); + } + } + + + public (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully() && task7.Status.IsCompletedSuccessfully() && task8.Status.IsCompletedSuccessfully() && task9.Status.IsCompletedSuccessfully() && task10.Status.IsCompletedSuccessfully() && task11.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult(), task7.GetAwaiter().GetResult(), task8.GetAwaiter().GetResult(), task9.GetAwaiter().GetResult(), task10.GetAwaiter().GetResult(), task11.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + T7 t7 = default; + T8 t8 = default; + T9 t9 = default; + T10 t10 = default; + T11 t11 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT7(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t7 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT8(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t8 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT9(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t9 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT10(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t10 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + static void TryInvokeContinuationT11(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t11 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 11) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11)); + } + } + + + public (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully() && task7.Status.IsCompletedSuccessfully() && task8.Status.IsCompletedSuccessfully() && task9.Status.IsCompletedSuccessfully() && task10.Status.IsCompletedSuccessfully() && task11.Status.IsCompletedSuccessfully() && task12.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult(), task7.GetAwaiter().GetResult(), task8.GetAwaiter().GetResult(), task9.GetAwaiter().GetResult(), task10.GetAwaiter().GetResult(), task11.GetAwaiter().GetResult(), task12.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + T7 t7 = default; + T8 t8 = default; + T9 t9 = default; + T10 t10 = default; + T11 t11 = default; + T12 t12 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task12.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT12(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT12(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT7(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t7 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT8(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t8 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT9(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t9 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT10(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t10 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT11(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t11 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + static void TryInvokeContinuationT12(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t12 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 12) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12)); + } + } + + + public (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully() && task7.Status.IsCompletedSuccessfully() && task8.Status.IsCompletedSuccessfully() && task9.Status.IsCompletedSuccessfully() && task10.Status.IsCompletedSuccessfully() && task11.Status.IsCompletedSuccessfully() && task12.Status.IsCompletedSuccessfully() && task13.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult(), task7.GetAwaiter().GetResult(), task8.GetAwaiter().GetResult(), task9.GetAwaiter().GetResult(), task10.GetAwaiter().GetResult(), task11.GetAwaiter().GetResult(), task12.GetAwaiter().GetResult(), task13.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + T7 t7 = default; + T8 t8 = default; + T9 t9 = default; + T10 t10 = default; + T11 t11 = default; + T12 t12 = default; + T13 t13 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task12.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT12(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT12(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task13.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT13(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT13(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT7(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t7 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT8(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t8 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT9(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t9 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT10(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t10 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT11(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t11 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT12(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t12 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + static void TryInvokeContinuationT13(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t13 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 13) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13)); + } + } + + + public (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully() && task7.Status.IsCompletedSuccessfully() && task8.Status.IsCompletedSuccessfully() && task9.Status.IsCompletedSuccessfully() && task10.Status.IsCompletedSuccessfully() && task11.Status.IsCompletedSuccessfully() && task12.Status.IsCompletedSuccessfully() && task13.Status.IsCompletedSuccessfully() && task14.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult(), task7.GetAwaiter().GetResult(), task8.GetAwaiter().GetResult(), task9.GetAwaiter().GetResult(), task10.GetAwaiter().GetResult(), task11.GetAwaiter().GetResult(), task12.GetAwaiter().GetResult(), task13.GetAwaiter().GetResult(), task14.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13, task14), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + T7 t7 = default; + T8 t8 = default; + T9 t9 = default; + T10 t10 = default; + T11 t11 = default; + T12 t12 = default; + T13 t13 = default; + T14 t14 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task12.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT12(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT12(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task13.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT13(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT13(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task14.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT14(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT14(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT7(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t7 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT8(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t8 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT9(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t9 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT10(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t10 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT11(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t11 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT12(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t12 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT13(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t13 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + static void TryInvokeContinuationT14(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t14 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 14) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14)); + } + } + + + public (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> WhenAll(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14, UniTask task15) + { + if (task1.Status.IsCompletedSuccessfully() && task2.Status.IsCompletedSuccessfully() && task3.Status.IsCompletedSuccessfully() && task4.Status.IsCompletedSuccessfully() && task5.Status.IsCompletedSuccessfully() && task6.Status.IsCompletedSuccessfully() && task7.Status.IsCompletedSuccessfully() && task8.Status.IsCompletedSuccessfully() && task9.Status.IsCompletedSuccessfully() && task10.Status.IsCompletedSuccessfully() && task11.Status.IsCompletedSuccessfully() && task12.Status.IsCompletedSuccessfully() && task13.Status.IsCompletedSuccessfully() && task14.Status.IsCompletedSuccessfully() && task15.Status.IsCompletedSuccessfully()) + { + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)>((task1.GetAwaiter().GetResult(), task2.GetAwaiter().GetResult(), task3.GetAwaiter().GetResult(), task4.GetAwaiter().GetResult(), task5.GetAwaiter().GetResult(), task6.GetAwaiter().GetResult(), task7.GetAwaiter().GetResult(), task8.GetAwaiter().GetResult(), task9.GetAwaiter().GetResult(), task10.GetAwaiter().GetResult(), task11.GetAwaiter().GetResult(), task12.GetAwaiter().GetResult(), task13.GetAwaiter().GetResult(), task14.GetAwaiter().GetResult(), task15.GetAwaiter().GetResult())); + } + + return new UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)>(new WhenAllPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13, task14, task15), 0); + } + + sealed class WhenAllPromise : IUniTaskSource<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> + { + T1 t1 = default; + T2 t2 = default; + T3 t3 = default; + T4 t4 = default; + T5 t5 = default; + T6 t6 = default; + T7 t7 = default; + T8 t8 = default; + T9 t9 = default; + T10 t10 = default; + T11 t11 = default; + T12 t12 = default; + T13 t13 = default; + T14 t14 = default; + T15 t15 = default; + int completedCount; + UniTaskCompletionSourceCore<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> core; + + public WhenAllPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14, UniTask task15) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task12.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT12(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT12(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task13.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT13(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT13(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task14.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT14(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT14(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task15.GetAwaiter(); + if (awaiter.IsCompleted) + { + TryInvokeContinuationT15(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT15(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t1 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT2(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t2 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT3(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t3 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT4(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t4 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT5(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t5 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT6(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t6 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT7(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t7 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT8(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t8 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT9(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t9 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT10(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t10 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT11(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t11 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT12(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t12 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT13(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t13 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT14(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t14 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + static void TryInvokeContinuationT15(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + self.t15 = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 15) + { + self.core.TrySetResult((self.t1, self.t2, self.t3, self.t4, self.t5, self.t6, self.t7, self.t8, self.t9, self.t10, self.t11, self.t12, self.t13, self.t14, self.t15)); + } + } + + + public (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.Generated.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.Generated.cs.meta new file mode 100644 index 00000000..40ed46cd --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.Generated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5110117231c8a6d4095fd0cbd3f4c142 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs new file mode 100644 index 00000000..39f6a9ad --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs @@ -0,0 +1,237 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + public partial struct UniTask + { + public static UniTask WhenAll(params UniTask[] tasks) + { + if (tasks.Length == 0) + { + return UniTask.FromResult(Array.Empty()); + } + + return new UniTask(new WhenAllPromise(tasks, tasks.Length), 0); + } + + public static UniTask WhenAll(IEnumerable> tasks) + { + using (var span = ArrayPoolUtil.Materialize(tasks)) + { + var promise = new WhenAllPromise(span.Array, span.Length); // consumed array in constructor. + return new UniTask(promise, 0); + } + } + + public static UniTask WhenAll(params UniTask[] tasks) + { + if (tasks.Length == 0) + { + return UniTask.CompletedTask; + } + + return new UniTask(new WhenAllPromise(tasks, tasks.Length), 0); + } + + public static UniTask WhenAll(IEnumerable tasks) + { + using (var span = ArrayPoolUtil.Materialize(tasks)) + { + var promise = new WhenAllPromise(span.Array, span.Length); // consumed array in constructor. + return new UniTask(promise, 0); + } + } + + sealed class WhenAllPromise : IUniTaskSource + { + T[] result; + int completeCount; + UniTaskCompletionSourceCore core; // don't reset(called after GetResult, will invoke TrySetException.) + + public WhenAllPromise(UniTask[] tasks, int tasksLength) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completeCount = 0; + + if (tasksLength == 0) + { + this.result = Array.Empty(); + core.TrySetResult(result); + return; + } + + this.result = new T[tasksLength]; + + for (int i = 0; i < tasksLength; i++) + { + UniTask.Awaiter awaiter; + try + { + awaiter = tasks[i].GetAwaiter(); + } + catch (Exception ex) + { + core.TrySetException(ex); + continue; + } + + if (awaiter.IsCompleted) + { + TryInvokeContinuation(this, awaiter, i); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter, int>)state) + { + TryInvokeContinuation(t.Item1, t.Item2, t.Item3); + } + }, StateTuple.Create(this, awaiter, i)); + } + } + } + + static void TryInvokeContinuation(WhenAllPromise self, in UniTask.Awaiter awaiter, int i) + { + try + { + self.result[i] = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completeCount) == self.result.Length) + { + self.core.TrySetResult(self.result); + } + } + + public T[] GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + sealed class WhenAllPromise : IUniTaskSource + { + int completeCount; + int tasksLength; + UniTaskCompletionSourceCore core; // don't reset(called after GetResult, will invoke TrySetException.) + + public WhenAllPromise(UniTask[] tasks, int tasksLength) + { + TaskTracker.TrackActiveTask(this, 3); + + this.tasksLength = tasksLength; + this.completeCount = 0; + + if (tasksLength == 0) + { + core.TrySetResult(AsyncUnit.Default); + return; + } + + for (int i = 0; i < tasksLength; i++) + { + UniTask.Awaiter awaiter; + try + { + awaiter = tasks[i].GetAwaiter(); + } + catch (Exception ex) + { + core.TrySetException(ex); + continue; + } + + if (awaiter.IsCompleted) + { + TryInvokeContinuation(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple)state) + { + TryInvokeContinuation(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuation(WhenAllPromise self, in UniTask.Awaiter awaiter) + { + try + { + awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completeCount) == self.tasksLength) + { + self.core.TrySetResult(AsyncUnit.Default); + } + } + + public void GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs.meta new file mode 100644 index 00000000..0366aa87 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 355997a305ba64248822eec34998a1a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.Generated.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.Generated.cs new file mode 100644 index 00000000..09b98e62 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.Generated.cs @@ -0,0 +1,5060 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +using System; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + public partial struct UniTask + { + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2)> WhenAny(UniTask task1, UniTask task2) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2)>(new WhenAnyPromise(task1, task2), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result)); + } + } + + + public (int, T1 result1, T2 result2) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3)> WhenAny(UniTask task1, UniTask task2, UniTask task3) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3)>(new WhenAnyPromise(task1, task2, task3), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4)>(new WhenAnyPromise(task1, task2, task3, task4), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5)>(new WhenAnyPromise(task1, task2, task3, task4, task5), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6, task7), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT7(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T7 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((6, default, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6, task7, task8), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT7(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T7 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((6, default, default, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT8(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T8 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((7, default, default, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT7(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T7 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((6, default, default, default, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT8(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T8 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((7, default, default, default, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT9(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T9 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((8, default, default, default, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT7(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T7 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((6, default, default, default, default, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT8(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T8 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((7, default, default, default, default, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT9(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T9 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((8, default, default, default, default, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT10(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T10 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((9, default, default, default, default, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT7(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T7 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((6, default, default, default, default, default, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT8(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T8 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((7, default, default, default, default, default, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT9(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T9 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((8, default, default, default, default, default, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT10(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T10 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((9, default, default, default, default, default, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT11(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T11 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((10, default, default, default, default, default, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task12.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT12(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT12(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT7(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T7 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((6, default, default, default, default, default, default, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT8(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T8 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((7, default, default, default, default, default, default, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT9(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T9 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((8, default, default, default, default, default, default, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT10(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T10 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((9, default, default, default, default, default, default, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT11(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T11 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((10, default, default, default, default, default, default, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT12(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T12 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((11, default, default, default, default, default, default, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task12.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT12(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT12(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task13.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT13(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT13(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT7(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T7 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((6, default, default, default, default, default, default, result, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT8(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T8 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((7, default, default, default, default, default, default, default, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT9(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T9 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((8, default, default, default, default, default, default, default, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT10(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T10 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((9, default, default, default, default, default, default, default, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT11(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T11 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((10, default, default, default, default, default, default, default, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT12(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T12 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((11, default, default, default, default, default, default, default, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT13(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T13 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((12, default, default, default, default, default, default, default, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13, task14), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task12.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT12(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT12(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task13.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT13(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT13(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task14.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT14(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT14(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT7(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T7 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((6, default, default, default, default, default, default, result, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT8(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T8 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((7, default, default, default, default, default, default, default, result, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT9(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T9 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((8, default, default, default, default, default, default, default, default, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT10(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T10 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((9, default, default, default, default, default, default, default, default, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT11(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T11 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((10, default, default, default, default, default, default, default, default, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT12(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T12 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((11, default, default, default, default, default, default, default, default, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT13(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T13 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((12, default, default, default, default, default, default, default, default, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT14(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T14 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((13, default, default, default, default, default, default, default, default, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + public static UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14, T15 result15)> WhenAny(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14, UniTask task15) + { + return new UniTask<(int winArgumentIndex, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14, T15 result15)>(new WhenAnyPromise(task1, task2, task3, task4, task5, task6, task7, task8, task9, task10, task11, task12, task13, task14, task15), 0); + } + + sealed class WhenAnyPromise : IUniTaskSource<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14, T15 result15)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14, T15 result15)> core; + + public WhenAnyPromise(UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14, UniTask task15) + { + TaskTracker.TrackActiveTask(this, 3); + + this.completedCount = 0; + { + var awaiter = task1.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT1(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT1(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task2.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT2(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT2(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task3.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT3(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT3(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task4.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT4(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT4(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task5.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT5(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT5(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task6.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT6(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT6(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task7.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT7(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT7(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task8.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT8(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT8(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task9.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT9(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT9(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task10.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT10(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT10(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task11.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT11(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT11(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task12.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT12(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT12(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task13.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT13(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT13(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task14.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT14(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT14(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + { + var awaiter = task15.GetAwaiter(); + + if (awaiter.IsCompleted) + { + TryInvokeContinuationT15(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryInvokeContinuationT15(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryInvokeContinuationT1(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T1 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((0, result, default, default, default, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT2(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T2 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((1, default, result, default, default, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT3(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T3 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((2, default, default, result, default, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT4(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T4 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((3, default, default, default, result, default, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT5(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T5 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((4, default, default, default, default, result, default, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT6(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T6 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((5, default, default, default, default, default, result, default, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT7(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T7 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((6, default, default, default, default, default, default, result, default, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT8(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T8 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((7, default, default, default, default, default, default, default, result, default, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT9(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T9 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((8, default, default, default, default, default, default, default, default, result, default, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT10(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T10 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((9, default, default, default, default, default, default, default, default, default, result, default, default, default, default, default)); + } + } + + static void TryInvokeContinuationT11(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T11 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((10, default, default, default, default, default, default, default, default, default, default, result, default, default, default, default)); + } + } + + static void TryInvokeContinuationT12(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T12 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((11, default, default, default, default, default, default, default, default, default, default, default, result, default, default, default)); + } + } + + static void TryInvokeContinuationT13(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T13 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((12, default, default, default, default, default, default, default, default, default, default, default, default, result, default, default)); + } + } + + static void TryInvokeContinuationT14(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T14 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((13, default, default, default, default, default, default, default, default, default, default, default, default, default, result, default)); + } + } + + static void TryInvokeContinuationT15(WhenAnyPromise self, in UniTask.Awaiter awaiter) + { + T15 result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((14, default, default, default, default, default, default, default, default, default, default, default, default, default, default, result)); + } + } + + + public (int, T1 result1, T2 result2, T3 result3, T4 result4, T5 result5, T6 result6, T7 result7, T8 result8, T9 result9, T10 result10, T11 result11, T12 result12, T13 result13, T14 result14, T15 result15) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.Generated.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.Generated.cs.meta new file mode 100644 index 00000000..49a2c3fd --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.Generated.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13d604ac281570c4eac9962429f19ca9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.cs new file mode 100644 index 00000000..09eb32d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.cs @@ -0,0 +1,359 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + public partial struct UniTask + { + public static UniTask<(bool hasResultLeft, T result)> WhenAny(UniTask leftTask, UniTask rightTask) + { + return new UniTask<(bool, T)>(new WhenAnyLRPromise(leftTask, rightTask), 0); + } + + public static UniTask<(int winArgumentIndex, T result)> WhenAny(params UniTask[] tasks) + { + return new UniTask<(int, T)>(new WhenAnyPromise(tasks, tasks.Length), 0); + } + + public static UniTask<(int winArgumentIndex, T result)> WhenAny(IEnumerable> tasks) + { + using (var span = ArrayPoolUtil.Materialize(tasks)) + { + return new UniTask<(int, T)>(new WhenAnyPromise(span.Array, span.Length), 0); + } + } + + /// Return value is winArgumentIndex + public static UniTask WhenAny(params UniTask[] tasks) + { + return new UniTask(new WhenAnyPromise(tasks, tasks.Length), 0); + } + + /// Return value is winArgumentIndex + public static UniTask WhenAny(IEnumerable tasks) + { + using (var span = ArrayPoolUtil.Materialize(tasks)) + { + return new UniTask(new WhenAnyPromise(span.Array, span.Length), 0); + } + } + + sealed class WhenAnyLRPromise : IUniTaskSource<(bool, T)> + { + int completedCount; + UniTaskCompletionSourceCore<(bool, T)> core; + + public WhenAnyLRPromise(UniTask leftTask, UniTask rightTask) + { + TaskTracker.TrackActiveTask(this, 3); + + { + UniTask.Awaiter awaiter; + try + { + awaiter = leftTask.GetAwaiter(); + } + catch (Exception ex) + { + core.TrySetException(ex); + goto RIGHT; + } + + if (awaiter.IsCompleted) + { + TryLeftInvokeContinuation(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryLeftInvokeContinuation(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + RIGHT: + { + UniTask.Awaiter awaiter; + try + { + awaiter = rightTask.GetAwaiter(); + } + catch (Exception ex) + { + core.TrySetException(ex); + return; + } + + if (awaiter.IsCompleted) + { + TryRightInvokeContinuation(this, awaiter); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter>)state) + { + TryRightInvokeContinuation(t.Item1, t.Item2); + } + }, StateTuple.Create(this, awaiter)); + } + } + } + + static void TryLeftInvokeContinuation(WhenAnyLRPromise self, in UniTask.Awaiter awaiter) + { + T result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((true, result)); + } + } + + static void TryRightInvokeContinuation(WhenAnyLRPromise self, in UniTask.Awaiter awaiter) + { + try + { + awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((false, default)); + } + } + + public (bool, T) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + + sealed class WhenAnyPromise : IUniTaskSource<(int, T)> + { + int completedCount; + UniTaskCompletionSourceCore<(int, T)> core; + + public WhenAnyPromise(UniTask[] tasks, int tasksLength) + { + if (tasksLength == 0) + { + throw new ArgumentException("The tasks argument contains no tasks."); + } + + TaskTracker.TrackActiveTask(this, 3); + + for (int i = 0; i < tasksLength; i++) + { + UniTask.Awaiter awaiter; + try + { + awaiter = tasks[i].GetAwaiter(); + } + catch (Exception ex) + { + core.TrySetException(ex); + continue; // consume others. + } + + if (awaiter.IsCompleted) + { + TryInvokeContinuation(this, awaiter, i); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple, UniTask.Awaiter, int>)state) + { + TryInvokeContinuation(t.Item1, t.Item2, t.Item3); + } + }, StateTuple.Create(this, awaiter, i)); + } + } + } + + static void TryInvokeContinuation(WhenAnyPromise self, in UniTask.Awaiter awaiter, int i) + { + T result; + try + { + result = awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult((i, result)); + } + } + + public (int, T) GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + sealed class WhenAnyPromise : IUniTaskSource + { + int completedCount; + UniTaskCompletionSourceCore core; + + public WhenAnyPromise(UniTask[] tasks, int tasksLength) + { + if (tasksLength == 0) + { + throw new ArgumentException("The tasks argument contains no tasks."); + } + + TaskTracker.TrackActiveTask(this, 3); + + for (int i = 0; i < tasksLength; i++) + { + UniTask.Awaiter awaiter; + try + { + awaiter = tasks[i].GetAwaiter(); + } + catch (Exception ex) + { + core.TrySetException(ex); + continue; // consume others. + } + + if (awaiter.IsCompleted) + { + TryInvokeContinuation(this, awaiter, i); + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple)state) + { + TryInvokeContinuation(t.Item1, t.Item2, t.Item3); + } + }, StateTuple.Create(this, awaiter, i)); + } + } + } + + static void TryInvokeContinuation(WhenAnyPromise self, in UniTask.Awaiter awaiter, int i) + { + try + { + awaiter.GetResult(); + } + catch (Exception ex) + { + self.core.TrySetException(ex); + return; + } + + if (Interlocked.Increment(ref self.completedCount) == 1) + { + self.core.TrySetResult(i); + } + } + + public int GetResult(short token) + { + TaskTracker.RemoveTracking(this); + GC.SuppressFinalize(this); + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.cs.meta new file mode 100644 index 00000000..c10f7621 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.WhenAny.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c32578978c37eaf41bdd90e1b034637d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.asmdef b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.asmdef new file mode 100644 index 00000000..a5c594d7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.asmdef @@ -0,0 +1,45 @@ +{ + "name": "UniTask", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [ + { + "name": "com.unity.modules.assetbundle", + "expression": "", + "define": "UNITASK_ASSETBUNDLE_SUPPORT" + }, + { + "name": "com.unity.modules.physics", + "expression": "", + "define": "UNITASK_PHYSICS_SUPPORT" + }, + { + "name": "com.unity.modules.physics2d", + "expression": "", + "define": "UNITASK_PHYSICS2D_SUPPORT" + }, + { + "name": "com.unity.modules.particlesystem", + "expression": "", + "define": "UNITASK_PARTICLESYSTEM_SUPPORT" + }, + { + "name": "com.unity.ugui", + "expression": "", + "define": "UNITASK_UGUI_SUPPORT" + }, + { + "name": "com.unity.modules.unitywebrequest", + "expression": "", + "define": "UNITASK_WEBREQUEST_SUPPORT" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.asmdef.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.asmdef.meta new file mode 100644 index 00000000..e497045e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f51ebe6a0ceec4240a699833d6309b23 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.cs new file mode 100644 index 00000000..8eb2087a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.cs @@ -0,0 +1,707 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#pragma warning disable CS0436 + +using Cysharp.Threading.Tasks.CompilerServices; +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using System.Runtime.InteropServices; + +namespace Cysharp.Threading.Tasks +{ + internal static class AwaiterActions + { + internal static readonly Action InvokeContinuationDelegate = Continuation; + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static void Continuation(object state) + { + ((Action)state).Invoke(); + } + } + + /// + /// Lightweight unity specified task-like object. + /// + [AsyncMethodBuilder(typeof(AsyncUniTaskMethodBuilder))] + [StructLayout(LayoutKind.Auto)] + public readonly partial struct UniTask + { + readonly IUniTaskSource source; + readonly short token; + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UniTask(IUniTaskSource source, short token) + { + this.source = source; + this.token = token; + } + + public UniTaskStatus Status + { + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + if (source == null) return UniTaskStatus.Succeeded; + return source.GetStatus(token); + } + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Awaiter GetAwaiter() + { + return new Awaiter(this); + } + + /// + /// returns (bool IsCanceled) instead of throws OperationCanceledException. + /// + public UniTask SuppressCancellationThrow() + { + var status = Status; + if (status == UniTaskStatus.Succeeded) return CompletedTasks.False; + if (status == UniTaskStatus.Canceled) return CompletedTasks.True; + return new UniTask(new IsCanceledSource(source), token); + } + +#if !UNITY_2018_3_OR_NEWER + + public static implicit operator System.Threading.Tasks.ValueTask(in UniTask self) + { + if (self.source == null) + { + return default; + } + +#if NETSTANDARD2_0 + return self.AsValueTask(); +#else + return new System.Threading.Tasks.ValueTask(self.source, self.token); +#endif + } + +#endif + + public override string ToString() + { + if (source == null) return "()"; + return "(" + source.UnsafeGetStatus() + ")"; + } + + /// + /// Memoizing inner IValueTaskSource. The result UniTask can await multiple. + /// + public UniTask Preserve() + { + if (source == null) + { + return this; + } + else + { + return new UniTask(new MemoizeSource(source), token); + } + } + + public UniTask AsAsyncUnitUniTask() + { + if (this.source == null) return CompletedTasks.AsyncUnit; + + var status = this.source.GetStatus(this.token); + if (status.IsCompletedSuccessfully()) + { + this.source.GetResult(this.token); + return CompletedTasks.AsyncUnit; + } + else if(this.source is IUniTaskSource asyncUnitSource) + { + return new UniTask(asyncUnitSource, this.token); + } + + return new UniTask(new AsyncUnitSource(this.source), this.token); + } + + sealed class AsyncUnitSource : IUniTaskSource + { + readonly IUniTaskSource source; + + public AsyncUnitSource(IUniTaskSource source) + { + this.source = source; + } + + public AsyncUnit GetResult(short token) + { + source.GetResult(token); + return AsyncUnit.Default; + } + + public UniTaskStatus GetStatus(short token) + { + return source.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + source.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return source.UnsafeGetStatus(); + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + } + + sealed class IsCanceledSource : IUniTaskSource + { + readonly IUniTaskSource source; + + public IsCanceledSource(IUniTaskSource source) + { + this.source = source; + } + + public bool GetResult(short token) + { + if (source.GetStatus(token) == UniTaskStatus.Canceled) + { + return true; + } + + source.GetResult(token); + return false; + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return source.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return source.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + source.OnCompleted(continuation, state, token); + } + } + + sealed class MemoizeSource : IUniTaskSource + { + IUniTaskSource source; + ExceptionDispatchInfo exception; + UniTaskStatus status; + + public MemoizeSource(IUniTaskSource source) + { + this.source = source; + } + + public void GetResult(short token) + { + if (source == null) + { + if (exception != null) + { + exception.Throw(); + } + } + else + { + try + { + source.GetResult(token); + status = UniTaskStatus.Succeeded; + } + catch (Exception ex) + { + exception = ExceptionDispatchInfo.Capture(ex); + if (ex is OperationCanceledException) + { + status = UniTaskStatus.Canceled; + } + else + { + status = UniTaskStatus.Faulted; + } + throw; + } + finally + { + source = null; + } + } + } + + public UniTaskStatus GetStatus(short token) + { + if (source == null) + { + return status; + } + + return source.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + if (source == null) + { + continuation(state); + } + else + { + source.OnCompleted(continuation, state, token); + } + } + + public UniTaskStatus UnsafeGetStatus() + { + if (source == null) + { + return status; + } + + return source.UnsafeGetStatus(); + } + } + + public readonly struct Awaiter : ICriticalNotifyCompletion + { + readonly UniTask task; + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Awaiter(in UniTask task) + { + this.task = task; + } + + public bool IsCompleted + { + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return task.Status.IsCompleted(); + } + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void GetResult() + { + if (task.source == null) return; + task.source.GetResult(task.token); + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void OnCompleted(Action continuation) + { + if (task.source == null) + { + continuation(); + } + else + { + task.source.OnCompleted(AwaiterActions.InvokeContinuationDelegate, continuation, task.token); + } + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UnsafeOnCompleted(Action continuation) + { + if (task.source == null) + { + continuation(); + } + else + { + task.source.OnCompleted(AwaiterActions.InvokeContinuationDelegate, continuation, task.token); + } + } + + /// + /// If register manually continuation, you can use it instead of for compiler OnCompleted methods. + /// + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SourceOnCompleted(Action continuation, object state) + { + if (task.source == null) + { + continuation(state); + } + else + { + task.source.OnCompleted(continuation, state, task.token); + } + } + } + } + + /// + /// Lightweight unity specified task-like object. + /// + [AsyncMethodBuilder(typeof(AsyncUniTaskMethodBuilder<>))] + [StructLayout(LayoutKind.Auto)] + public readonly struct UniTask + { + readonly IUniTaskSource source; + readonly T result; + readonly short token; + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UniTask(T result) + { + this.source = default; + this.token = default; + this.result = result; + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UniTask(IUniTaskSource source, short token) + { + this.source = source; + this.token = token; + this.result = default; + } + + public UniTaskStatus Status + { + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return (source == null) ? UniTaskStatus.Succeeded : source.GetStatus(token); + } + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Awaiter GetAwaiter() + { + return new Awaiter(this); + } + + /// + /// Memoizing inner IValueTaskSource. The result UniTask can await multiple. + /// + public UniTask Preserve() + { + if (source == null) + { + return this; + } + else + { + return new UniTask(new MemoizeSource(source), token); + } + } + + public UniTask AsUniTask() + { + if (this.source == null) return UniTask.CompletedTask; + + var status = this.source.GetStatus(this.token); + if (status.IsCompletedSuccessfully()) + { + this.source.GetResult(this.token); + return UniTask.CompletedTask; + } + + // Converting UniTask -> UniTask is zero overhead. + return new UniTask(this.source, this.token); + } + + public static implicit operator UniTask(UniTask self) + { + return self.AsUniTask(); + } + +#if !UNITY_2018_3_OR_NEWER + + public static implicit operator System.Threading.Tasks.ValueTask(in UniTask self) + { + if (self.source == null) + { + return new System.Threading.Tasks.ValueTask(self.result); + } + +#if NETSTANDARD2_0 + return self.AsValueTask(); +#else + return new System.Threading.Tasks.ValueTask(self.source, self.token); +#endif + } + +#endif + + /// + /// returns (bool IsCanceled, T Result) instead of throws OperationCanceledException. + /// + public UniTask<(bool IsCanceled, T Result)> SuppressCancellationThrow() + { + if (source == null) + { + return new UniTask<(bool IsCanceled, T Result)>((false, result)); + } + + return new UniTask<(bool, T)>(new IsCanceledSource(source), token); + } + + public override string ToString() + { + return (this.source == null) ? result?.ToString() + : "(" + this.source.UnsafeGetStatus() + ")"; + } + + sealed class IsCanceledSource : IUniTaskSource<(bool, T)> + { + readonly IUniTaskSource source; + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public IsCanceledSource(IUniTaskSource source) + { + this.source = source; + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public (bool, T) GetResult(short token) + { + if (source.GetStatus(token) == UniTaskStatus.Canceled) + { + return (true, default); + } + + var result = source.GetResult(token); + return (false, result); + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UniTaskStatus GetStatus(short token) + { + return source.GetStatus(token); + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UniTaskStatus UnsafeGetStatus() + { + return source.UnsafeGetStatus(); + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void OnCompleted(Action continuation, object state, short token) + { + source.OnCompleted(continuation, state, token); + } + } + + sealed class MemoizeSource : IUniTaskSource + { + IUniTaskSource source; + T result; + ExceptionDispatchInfo exception; + UniTaskStatus status; + + public MemoizeSource(IUniTaskSource source) + { + this.source = source; + } + + public T GetResult(short token) + { + if (source == null) + { + if (exception != null) + { + exception.Throw(); + } + return result; + } + else + { + try + { + result = source.GetResult(token); + status = UniTaskStatus.Succeeded; + return result; + } + catch (Exception ex) + { + exception = ExceptionDispatchInfo.Capture(ex); + if (ex is OperationCanceledException) + { + status = UniTaskStatus.Canceled; + } + else + { + status = UniTaskStatus.Faulted; + } + throw; + } + finally + { + source = null; + } + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + if (source == null) + { + return status; + } + + return source.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + if (source == null) + { + continuation(state); + } + else + { + source.OnCompleted(continuation, state, token); + } + } + + public UniTaskStatus UnsafeGetStatus() + { + if (source == null) + { + return status; + } + + return source.UnsafeGetStatus(); + } + } + + public readonly struct Awaiter : ICriticalNotifyCompletion + { + readonly UniTask task; + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Awaiter(in UniTask task) + { + this.task = task; + } + + public bool IsCompleted + { + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return task.Status.IsCompleted(); + } + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public T GetResult() + { + var s = task.source; + if (s == null) + { + return task.result; + } + else + { + return s.GetResult(task.token); + } + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void OnCompleted(Action continuation) + { + var s = task.source; + if (s == null) + { + continuation(); + } + else + { + s.OnCompleted(AwaiterActions.InvokeContinuationDelegate, continuation, task.token); + } + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void UnsafeOnCompleted(Action continuation) + { + var s = task.source; + if (s == null) + { + continuation(); + } + else + { + s.OnCompleted(AwaiterActions.InvokeContinuationDelegate, continuation, task.token); + } + } + + /// + /// If register manually continuation, you can use it instead of for compiler OnCompleted methods. + /// + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SourceOnCompleted(Action continuation, object state) + { + var s = task.source; + if (s == null) + { + continuation(state); + } + else + { + s.OnCompleted(continuation, state, task.token); + } + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.cs.meta new file mode 100644 index 00000000..04eb6b64 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTask.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8947adf23181ff04db73829df217ca94 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs new file mode 100644 index 00000000..bf2d054b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs @@ -0,0 +1,944 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using System.Runtime.InteropServices; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + public interface IResolvePromise + { + bool TrySetResult(); + } + + public interface IResolvePromise + { + bool TrySetResult(T value); + } + + public interface IRejectPromise + { + bool TrySetException(Exception exception); + } + + public interface ICancelPromise + { + bool TrySetCanceled(CancellationToken cancellationToken = default); + } + + public interface IPromise : IResolvePromise, IRejectPromise, ICancelPromise + { + } + + public interface IPromise : IResolvePromise, IRejectPromise, ICancelPromise + { + } + + internal class ExceptionHolder + { + ExceptionDispatchInfo exception; + bool calledGet = false; + + public ExceptionHolder(ExceptionDispatchInfo exception) + { + this.exception = exception; + } + + public ExceptionDispatchInfo GetException() + { + if (!calledGet) + { + calledGet = true; + GC.SuppressFinalize(this); + } + return exception; + } + + ~ExceptionHolder() + { + if (!calledGet) + { + UniTaskScheduler.PublishUnobservedTaskException(exception.SourceException); + } + } + } + + [StructLayout(LayoutKind.Auto)] + public struct UniTaskCompletionSourceCore + { + // Struct Size: TResult + (8 + 2 + 1 + 1 + 8 + 8) + + TResult result; + object error; // ExceptionHolder or OperationCanceledException + short version; + bool hasUnhandledError; + int completedCount; // 0: completed == false + Action continuation; + object continuationState; + + [DebuggerHidden] + public void Reset() + { + ReportUnhandledError(); + + unchecked + { + version += 1; // incr version. + } + completedCount = 0; + result = default; + error = null; + hasUnhandledError = false; + continuation = null; + continuationState = null; + } + + void ReportUnhandledError() + { + if (hasUnhandledError) + { + try + { + if (error is OperationCanceledException oc) + { + UniTaskScheduler.PublishUnobservedTaskException(oc); + } + else if (error is ExceptionHolder e) + { + UniTaskScheduler.PublishUnobservedTaskException(e.GetException().SourceException); + } + } + catch + { + } + } + } + + internal void MarkHandled() + { + hasUnhandledError = false; + } + + /// Completes with a successful result. + /// The result. + [DebuggerHidden] + public bool TrySetResult(TResult result) + { + if (Interlocked.Increment(ref completedCount) == 1) + { + // setup result + this.result = result; + + if (continuation != null || Interlocked.CompareExchange(ref this.continuation, UniTaskCompletionSourceCoreShared.s_sentinel, null) != null) + { + continuation(continuationState); + } + return true; + } + + return false; + } + + /// Completes with an error. + /// The exception. + [DebuggerHidden] + public bool TrySetException(Exception error) + { + if (Interlocked.Increment(ref completedCount) == 1) + { + // setup result + this.hasUnhandledError = true; + if (error is OperationCanceledException) + { + this.error = error; + } + else + { + this.error = new ExceptionHolder(ExceptionDispatchInfo.Capture(error)); + } + + if (continuation != null || Interlocked.CompareExchange(ref this.continuation, UniTaskCompletionSourceCoreShared.s_sentinel, null) != null) + { + continuation(continuationState); + } + return true; + } + + return false; + } + + [DebuggerHidden] + public bool TrySetCanceled(CancellationToken cancellationToken = default) + { + if (Interlocked.Increment(ref completedCount) == 1) + { + // setup result + this.hasUnhandledError = true; + this.error = new OperationCanceledException(cancellationToken); + + if (continuation != null || Interlocked.CompareExchange(ref this.continuation, UniTaskCompletionSourceCoreShared.s_sentinel, null) != null) + { + continuation(continuationState); + } + return true; + } + + return false; + } + + /// Gets the operation version. + [DebuggerHidden] + public short Version => version; + + /// Gets the status of the operation. + /// Opaque value that was provided to the 's constructor. + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UniTaskStatus GetStatus(short token) + { + ValidateToken(token); + return (continuation == null || (completedCount == 0)) ? UniTaskStatus.Pending + : (error == null) ? UniTaskStatus.Succeeded + : (error is OperationCanceledException) ? UniTaskStatus.Canceled + : UniTaskStatus.Faulted; + } + + /// Gets the status of the operation without token validation. + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UniTaskStatus UnsafeGetStatus() + { + return (continuation == null || (completedCount == 0)) ? UniTaskStatus.Pending + : (error == null) ? UniTaskStatus.Succeeded + : (error is OperationCanceledException) ? UniTaskStatus.Canceled + : UniTaskStatus.Faulted; + } + + /// Gets the result of the operation. + /// Opaque value that was provided to the 's constructor. + // [StackTraceHidden] + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public TResult GetResult(short token) + { + ValidateToken(token); + if (completedCount == 0) + { + throw new InvalidOperationException("Not yet completed, UniTask only allow to use await."); + } + + if (error != null) + { + hasUnhandledError = false; + if (error is OperationCanceledException oce) + { + throw oce; + } + else if (error is ExceptionHolder eh) + { + eh.GetException().Throw(); + } + + throw new InvalidOperationException("Critical: invalid exception type was held."); + } + + return result; + } + + /// Schedules the continuation action for this operation. + /// The continuation to invoke when the operation has completed. + /// The state object to pass to when it's invoked. + /// Opaque value that was provided to the 's constructor. + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void OnCompleted(Action continuation, object state, short token /*, ValueTaskSourceOnCompletedFlags flags */) + { + if (continuation == null) + { + throw new ArgumentNullException(nameof(continuation)); + } + ValidateToken(token); + + /* no use ValueTaskSourceOnCOmpletedFlags, always no capture ExecutionContext and SynchronizationContext. */ + + /* + PatternA: GetStatus=Pending => OnCompleted => TrySet*** => GetResult + PatternB: TrySet*** => GetStatus=!Pending => GetResult + PatternC: GetStatus=Pending => TrySet/OnCompleted(race condition) => GetResult + C.1: win OnCompleted -> TrySet invoke saved continuation + C.2: win TrySet -> should invoke continuation here. + */ + + // not set continuation yet. + object oldContinuation = this.continuation; + if (oldContinuation == null) + { + continuationState = state; + oldContinuation = Interlocked.CompareExchange(ref this.continuation, continuation, null); + } + + if (oldContinuation != null) + { + // already running continuation in TrySet. + // It will cause call OnCompleted multiple time, invalid. + if (!ReferenceEquals(oldContinuation, UniTaskCompletionSourceCoreShared.s_sentinel)) + { + throw new InvalidOperationException("Already continuation registered, can not await twice or get Status after await."); + } + + continuation(state); + } + } + + [DebuggerHidden] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void ValidateToken(short token) + { + if (token != version) + { + throw new InvalidOperationException("Token version is not matched, can not await twice or get Status after await."); + } + } + } + + internal static class UniTaskCompletionSourceCoreShared // separated out of generic to avoid unnecessary duplication + { + internal static readonly Action s_sentinel = CompletionSentinel; + + private static void CompletionSentinel(object _) // named method to aid debugging + { + throw new InvalidOperationException("The sentinel delegate should never be invoked."); + } + } + + public class AutoResetUniTaskCompletionSource : IUniTaskSource, ITaskPoolNode, IPromise + { + static TaskPool pool; + AutoResetUniTaskCompletionSource nextNode; + public ref AutoResetUniTaskCompletionSource NextNode => ref nextNode; + + static AutoResetUniTaskCompletionSource() + { + TaskPool.RegisterSizeGetter(typeof(AutoResetUniTaskCompletionSource), () => pool.Size); + } + + UniTaskCompletionSourceCore core; + short version; + + AutoResetUniTaskCompletionSource() + { + } + + [DebuggerHidden] + public static AutoResetUniTaskCompletionSource Create() + { + if (!pool.TryPop(out var result)) + { + result = new AutoResetUniTaskCompletionSource(); + } + result.version = result.core.Version; + TaskTracker.TrackActiveTask(result, 2); + return result; + } + + [DebuggerHidden] + public static AutoResetUniTaskCompletionSource CreateFromCanceled(CancellationToken cancellationToken, out short token) + { + var source = Create(); + source.TrySetCanceled(cancellationToken); + token = source.core.Version; + return source; + } + + [DebuggerHidden] + public static AutoResetUniTaskCompletionSource CreateFromException(Exception exception, out short token) + { + var source = Create(); + source.TrySetException(exception); + token = source.core.Version; + return source; + } + + [DebuggerHidden] + public static AutoResetUniTaskCompletionSource CreateCompleted(out short token) + { + var source = Create(); + source.TrySetResult(); + token = source.core.Version; + return source; + } + + public UniTask Task + { + [DebuggerHidden] + get + { + return new UniTask(this, core.Version); + } + } + + [DebuggerHidden] + public bool TrySetResult() + { + return version == core.Version && core.TrySetResult(AsyncUnit.Default); + } + + [DebuggerHidden] + public bool TrySetCanceled(CancellationToken cancellationToken = default) + { + return version == core.Version && core.TrySetCanceled(cancellationToken); + } + + [DebuggerHidden] + public bool TrySetException(Exception exception) + { + return version == core.Version && core.TrySetException(exception); + } + + [DebuggerHidden] + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + [DebuggerHidden] + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + [DebuggerHidden] + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + [DebuggerHidden] + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + [DebuggerHidden] + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + return pool.TryPush(this); + } + } + + public class AutoResetUniTaskCompletionSource : IUniTaskSource, ITaskPoolNode>, IPromise + { + static TaskPool> pool; + AutoResetUniTaskCompletionSource nextNode; + public ref AutoResetUniTaskCompletionSource NextNode => ref nextNode; + + static AutoResetUniTaskCompletionSource() + { + TaskPool.RegisterSizeGetter(typeof(AutoResetUniTaskCompletionSource), () => pool.Size); + } + + UniTaskCompletionSourceCore core; + short version; + + AutoResetUniTaskCompletionSource() + { + } + + [DebuggerHidden] + public static AutoResetUniTaskCompletionSource Create() + { + if (!pool.TryPop(out var result)) + { + result = new AutoResetUniTaskCompletionSource(); + } + result.version = result.core.Version; + TaskTracker.TrackActiveTask(result, 2); + return result; + } + + [DebuggerHidden] + public static AutoResetUniTaskCompletionSource CreateFromCanceled(CancellationToken cancellationToken, out short token) + { + var source = Create(); + source.TrySetCanceled(cancellationToken); + token = source.core.Version; + return source; + } + + [DebuggerHidden] + public static AutoResetUniTaskCompletionSource CreateFromException(Exception exception, out short token) + { + var source = Create(); + source.TrySetException(exception); + token = source.core.Version; + return source; + } + + [DebuggerHidden] + public static AutoResetUniTaskCompletionSource CreateFromResult(T result, out short token) + { + var source = Create(); + source.TrySetResult(result); + token = source.core.Version; + return source; + } + + public UniTask Task + { + [DebuggerHidden] + get + { + return new UniTask(this, core.Version); + } + } + + [DebuggerHidden] + public bool TrySetResult(T result) + { + return version == core.Version && core.TrySetResult(result); + } + + [DebuggerHidden] + public bool TrySetCanceled(CancellationToken cancellationToken = default) + { + return version == core.Version && core.TrySetCanceled(cancellationToken); + } + + [DebuggerHidden] + public bool TrySetException(Exception exception) + { + return version == core.Version && core.TrySetException(exception); + } + + [DebuggerHidden] + public T GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + [DebuggerHidden] + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + [DebuggerHidden] + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + [DebuggerHidden] + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + [DebuggerHidden] + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + [DebuggerHidden] + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + return pool.TryPush(this); + } + } + + public class UniTaskCompletionSource : IUniTaskSource, IPromise + { + CancellationToken cancellationToken; + ExceptionHolder exception; + object gate; + Action singleContinuation; + object singleState; + List<(Action, object)> secondaryContinuationList; + + int intStatus; // UniTaskStatus + bool handled = false; + + public UniTaskCompletionSource() + { + TaskTracker.TrackActiveTask(this, 2); + } + + [DebuggerHidden] + internal void MarkHandled() + { + if (!handled) + { + handled = true; + TaskTracker.RemoveTracking(this); + } + } + + public UniTask Task + { + [DebuggerHidden] + get + { + return new UniTask(this, 0); + } + } + + [DebuggerHidden] + public bool TrySetResult() + { + return TrySignalCompletion(UniTaskStatus.Succeeded); + } + + [DebuggerHidden] + public bool TrySetCanceled(CancellationToken cancellationToken = default) + { + if (UnsafeGetStatus() != UniTaskStatus.Pending) return false; + + this.cancellationToken = cancellationToken; + return TrySignalCompletion(UniTaskStatus.Canceled); + } + + [DebuggerHidden] + public bool TrySetException(Exception exception) + { + if (exception is OperationCanceledException oce) + { + return TrySetCanceled(oce.CancellationToken); + } + + if (UnsafeGetStatus() != UniTaskStatus.Pending) return false; + + this.exception = new ExceptionHolder(ExceptionDispatchInfo.Capture(exception)); + return TrySignalCompletion(UniTaskStatus.Faulted); + } + + [DebuggerHidden] + public void GetResult(short token) + { + MarkHandled(); + + var status = (UniTaskStatus)intStatus; + switch (status) + { + case UniTaskStatus.Succeeded: + return; + case UniTaskStatus.Faulted: + exception.GetException().Throw(); + return; + case UniTaskStatus.Canceled: + throw new OperationCanceledException(cancellationToken); + default: + case UniTaskStatus.Pending: + throw new InvalidOperationException("not yet completed."); + } + } + + [DebuggerHidden] + public UniTaskStatus GetStatus(short token) + { + return (UniTaskStatus)intStatus; + } + + [DebuggerHidden] + public UniTaskStatus UnsafeGetStatus() + { + return (UniTaskStatus)intStatus; + } + + [DebuggerHidden] + public void OnCompleted(Action continuation, object state, short token) + { + if (gate == null) + { + Interlocked.CompareExchange(ref gate, new object(), null); + } + + var lockGate = Thread.VolatileRead(ref gate); + lock (lockGate) // wait TrySignalCompletion, after status is not pending. + { + if ((UniTaskStatus)intStatus != UniTaskStatus.Pending) + { + continuation(state); + return; + } + + if (singleContinuation == null) + { + singleContinuation = continuation; + singleState = state; + } + else + { + if (secondaryContinuationList == null) + { + secondaryContinuationList = new List<(Action, object)>(); + } + secondaryContinuationList.Add((continuation, state)); + } + } + } + + [DebuggerHidden] + bool TrySignalCompletion(UniTaskStatus status) + { + if (Interlocked.CompareExchange(ref intStatus, (int)status, (int)UniTaskStatus.Pending) == (int)UniTaskStatus.Pending) + { + if (gate == null) + { + Interlocked.CompareExchange(ref gate, new object(), null); + } + + var lockGate = Thread.VolatileRead(ref gate); + lock (lockGate) // wait OnCompleted. + { + if (singleContinuation != null) + { + try + { + singleContinuation(singleState); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + + if (secondaryContinuationList != null) + { + foreach (var (c, state) in secondaryContinuationList) + { + try + { + c(state); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + } + + singleContinuation = null; + singleState = null; + secondaryContinuationList = null; + } + return true; + } + return false; + } + } + + public class UniTaskCompletionSource : IUniTaskSource, IPromise + { + CancellationToken cancellationToken; + T result; + ExceptionHolder exception; + object gate; + Action singleContinuation; + object singleState; + List<(Action, object)> secondaryContinuationList; + + int intStatus; // UniTaskStatus + bool handled = false; + + public UniTaskCompletionSource() + { + TaskTracker.TrackActiveTask(this, 2); + } + + [DebuggerHidden] + internal void MarkHandled() + { + if (!handled) + { + handled = true; + TaskTracker.RemoveTracking(this); + } + } + + public UniTask Task + { + [DebuggerHidden] + get + { + return new UniTask(this, 0); + } + } + + [DebuggerHidden] + public bool TrySetResult(T result) + { + if (UnsafeGetStatus() != UniTaskStatus.Pending) return false; + + this.result = result; + return TrySignalCompletion(UniTaskStatus.Succeeded); + } + + [DebuggerHidden] + public bool TrySetCanceled(CancellationToken cancellationToken = default) + { + if (UnsafeGetStatus() != UniTaskStatus.Pending) return false; + + this.cancellationToken = cancellationToken; + return TrySignalCompletion(UniTaskStatus.Canceled); + } + + [DebuggerHidden] + public bool TrySetException(Exception exception) + { + if (exception is OperationCanceledException oce) + { + return TrySetCanceled(oce.CancellationToken); + } + + if (UnsafeGetStatus() != UniTaskStatus.Pending) return false; + + this.exception = new ExceptionHolder(ExceptionDispatchInfo.Capture(exception)); + return TrySignalCompletion(UniTaskStatus.Faulted); + } + + [DebuggerHidden] + public T GetResult(short token) + { + MarkHandled(); + + var status = (UniTaskStatus)intStatus; + switch (status) + { + case UniTaskStatus.Succeeded: + return result; + case UniTaskStatus.Faulted: + exception.GetException().Throw(); + return default; + case UniTaskStatus.Canceled: + throw new OperationCanceledException(cancellationToken); + default: + case UniTaskStatus.Pending: + throw new InvalidOperationException("not yet completed."); + } + } + + [DebuggerHidden] + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + [DebuggerHidden] + public UniTaskStatus GetStatus(short token) + { + return (UniTaskStatus)intStatus; + } + + [DebuggerHidden] + public UniTaskStatus UnsafeGetStatus() + { + return (UniTaskStatus)intStatus; + } + + [DebuggerHidden] + public void OnCompleted(Action continuation, object state, short token) + { + if (gate == null) + { + Interlocked.CompareExchange(ref gate, new object(), null); + } + + var lockGate = Thread.VolatileRead(ref gate); + lock (lockGate) // wait TrySignalCompletion, after status is not pending. + { + if ((UniTaskStatus)intStatus != UniTaskStatus.Pending) + { + continuation(state); + return; + } + + if (singleContinuation == null) + { + singleContinuation = continuation; + singleState = state; + } + else + { + if (secondaryContinuationList == null) + { + secondaryContinuationList = new List<(Action, object)>(); + } + secondaryContinuationList.Add((continuation, state)); + } + } + } + + [DebuggerHidden] + bool TrySignalCompletion(UniTaskStatus status) + { + if (Interlocked.CompareExchange(ref intStatus, (int)status, (int)UniTaskStatus.Pending) == (int)UniTaskStatus.Pending) + { + if (gate == null) + { + Interlocked.CompareExchange(ref gate, new object(), null); + } + + var lockGate = Thread.VolatileRead(ref gate); + lock (lockGate) // wait OnCompleted. + { + if (singleContinuation != null) + { + try + { + singleContinuation(singleState); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + + if (secondaryContinuationList != null) + { + foreach (var (c, state) in secondaryContinuationList) + { + try + { + c(state); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + } + + singleContinuation = null; + singleState = null; + secondaryContinuationList = null; + } + return true; + } + return false; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs.meta new file mode 100644 index 00000000..2ae5ee31 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskCompletionSource.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ed03524d09e7eb24a9fb9137198feb84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.Shorthand.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.Shorthand.cs new file mode 100644 index 00000000..0e51a459 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.Shorthand.cs @@ -0,0 +1,187 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +using System.Collections.Generic; + +namespace Cysharp.Threading.Tasks +{ + public static partial class UniTaskExtensions + { + // shorthand of WhenAll + + public static UniTask.Awaiter GetAwaiter(this UniTask[] tasks) + { + return UniTask.WhenAll(tasks).GetAwaiter(); + } + + public static UniTask.Awaiter GetAwaiter(this IEnumerable tasks) + { + return UniTask.WhenAll(tasks).GetAwaiter(); + } + + public static UniTask.Awaiter GetAwaiter(this UniTask[] tasks) + { + return UniTask.WhenAll(tasks).GetAwaiter(); + } + + public static UniTask.Awaiter GetAwaiter(this IEnumerable> tasks) + { + return UniTask.WhenAll(tasks).GetAwaiter(); + } + + public static UniTask<(T1, T2)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11, tasks.Item12).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11, tasks.Item12, tasks.Item13).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11, tasks.Item12, tasks.Item13, tasks.Item14).GetAwaiter(); + } + + public static UniTask<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)>.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14, UniTask task15) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11, tasks.Item12, tasks.Item13, tasks.Item14, tasks.Item15).GetAwaiter(); + } + + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11, tasks.Item12).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11, tasks.Item12, tasks.Item13).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11, tasks.Item12, tasks.Item13, tasks.Item14).GetAwaiter(); + } + + + public static UniTask.Awaiter GetAwaiter(this (UniTask task1, UniTask task2, UniTask task3, UniTask task4, UniTask task5, UniTask task6, UniTask task7, UniTask task8, UniTask task9, UniTask task10, UniTask task11, UniTask task12, UniTask task13, UniTask task14, UniTask task15) tasks) + { + return UniTask.WhenAll(tasks.Item1, tasks.Item2, tasks.Item3, tasks.Item4, tasks.Item5, tasks.Item6, tasks.Item7, tasks.Item8, tasks.Item9, tasks.Item10, tasks.Item11, tasks.Item12, tasks.Item13, tasks.Item14, tasks.Item15).GetAwaiter(); + } + + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.Shorthand.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.Shorthand.cs.meta new file mode 100644 index 00000000..e2dcc142 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.Shorthand.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4b4ff020f73dc6d4b8ebd4760d61fb43 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs new file mode 100644 index 00000000..362da525 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs @@ -0,0 +1,921 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Collections; +using System.Runtime.ExceptionServices; +using System.Threading; +using System.Threading.Tasks; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + public static partial class UniTaskExtensions + { + /// + /// Convert Task[T] -> UniTask[T]. + /// + public static UniTask AsUniTask(this Task task, bool useCurrentSynchronizationContext = true) + { + var promise = new UniTaskCompletionSource(); + + task.ContinueWith((x, state) => + { + var p = (UniTaskCompletionSource)state; + + switch (x.Status) + { + case TaskStatus.Canceled: + p.TrySetCanceled(); + break; + case TaskStatus.Faulted: + p.TrySetException(x.Exception.InnerException ?? x.Exception); + break; + case TaskStatus.RanToCompletion: + p.TrySetResult(x.Result); + break; + default: + throw new NotSupportedException(); + } + }, promise, useCurrentSynchronizationContext ? TaskScheduler.FromCurrentSynchronizationContext() : TaskScheduler.Current); + + return promise.Task; + } + + /// + /// Convert Task -> UniTask. + /// + public static UniTask AsUniTask(this Task task, bool useCurrentSynchronizationContext = true) + { + var promise = new UniTaskCompletionSource(); + + task.ContinueWith((x, state) => + { + var p = (UniTaskCompletionSource)state; + + switch (x.Status) + { + case TaskStatus.Canceled: + p.TrySetCanceled(); + break; + case TaskStatus.Faulted: + p.TrySetException(x.Exception.InnerException ?? x.Exception); + break; + case TaskStatus.RanToCompletion: + p.TrySetResult(); + break; + default: + throw new NotSupportedException(); + } + }, promise, useCurrentSynchronizationContext ? TaskScheduler.FromCurrentSynchronizationContext() : TaskScheduler.Current); + + return promise.Task; + } + + public static Task AsTask(this UniTask task) + { + try + { + UniTask.Awaiter awaiter; + try + { + awaiter = task.GetAwaiter(); + } + catch (Exception ex) + { + return Task.FromException(ex); + } + + if (awaiter.IsCompleted) + { + try + { + var result = awaiter.GetResult(); + return Task.FromResult(result); + } + catch (Exception ex) + { + return Task.FromException(ex); + } + } + + var tcs = new TaskCompletionSource(); + + awaiter.SourceOnCompleted(state => + { + using (var tuple = (StateTuple, UniTask.Awaiter>)state) + { + var (inTcs, inAwaiter) = tuple; + try + { + var result = inAwaiter.GetResult(); + inTcs.SetResult(result); + } + catch (Exception ex) + { + inTcs.SetException(ex); + } + } + }, StateTuple.Create(tcs, awaiter)); + + return tcs.Task; + } + catch (Exception ex) + { + return Task.FromException(ex); + } + } + + public static Task AsTask(this UniTask task) + { + try + { + UniTask.Awaiter awaiter; + try + { + awaiter = task.GetAwaiter(); + } + catch (Exception ex) + { + return Task.FromException(ex); + } + + if (awaiter.IsCompleted) + { + try + { + awaiter.GetResult(); // check token valid on Succeeded + return Task.CompletedTask; + } + catch (Exception ex) + { + return Task.FromException(ex); + } + } + + var tcs = new TaskCompletionSource(); + + awaiter.SourceOnCompleted(state => + { + using (var tuple = (StateTuple, UniTask.Awaiter>)state) + { + var (inTcs, inAwaiter) = tuple; + try + { + inAwaiter.GetResult(); + inTcs.SetResult(null); + } + catch (Exception ex) + { + inTcs.SetException(ex); + } + } + }, StateTuple.Create(tcs, awaiter)); + + return tcs.Task; + } + catch (Exception ex) + { + return Task.FromException(ex); + } + } + + public static AsyncLazy ToAsyncLazy(this UniTask task) + { + return new AsyncLazy(task); + } + + public static AsyncLazy ToAsyncLazy(this UniTask task) + { + return new AsyncLazy(task); + } + + /// + /// Ignore task result when cancel raised first. + /// + public static UniTask AttachExternalCancellation(this UniTask task, CancellationToken cancellationToken) + { + if (!cancellationToken.CanBeCanceled) + { + return task; + } + + if (cancellationToken.IsCancellationRequested) + { + return UniTask.FromCanceled(cancellationToken); + } + + if (task.Status.IsCompleted()) + { + return task; + } + + return new UniTask(new AttachExternalCancellationSource(task, cancellationToken), 0); + } + + /// + /// Ignore task result when cancel raised first. + /// + public static UniTask AttachExternalCancellation(this UniTask task, CancellationToken cancellationToken) + { + if (!cancellationToken.CanBeCanceled) + { + return task; + } + + if (cancellationToken.IsCancellationRequested) + { + return UniTask.FromCanceled(cancellationToken); + } + + if (task.Status.IsCompleted()) + { + return task; + } + + return new UniTask(new AttachExternalCancellationSource(task, cancellationToken), 0); + } + + sealed class AttachExternalCancellationSource : IUniTaskSource + { + static readonly Action cancellationCallbackDelegate = CancellationCallback; + + CancellationToken cancellationToken; + CancellationTokenRegistration tokenRegistration; + UniTaskCompletionSourceCore core; + + public AttachExternalCancellationSource(UniTask task, CancellationToken cancellationToken) + { + this.cancellationToken = cancellationToken; + this.tokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallbackDelegate, this); + RunTask(task).Forget(); + } + + async UniTaskVoid RunTask(UniTask task) + { + try + { + await task; + core.TrySetResult(AsyncUnit.Default); + } + catch (Exception ex) + { + core.TrySetException(ex); + } + finally + { + tokenRegistration.Dispose(); + } + } + + static void CancellationCallback(object state) + { + var self = (AttachExternalCancellationSource)state; + self.core.TrySetCanceled(self.cancellationToken); + } + + public void GetResult(short token) + { + core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + } + + sealed class AttachExternalCancellationSource : IUniTaskSource + { + static readonly Action cancellationCallbackDelegate = CancellationCallback; + + CancellationToken cancellationToken; + CancellationTokenRegistration tokenRegistration; + UniTaskCompletionSourceCore core; + + public AttachExternalCancellationSource(UniTask task, CancellationToken cancellationToken) + { + this.cancellationToken = cancellationToken; + this.tokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallbackDelegate, this); + RunTask(task).Forget(); + } + + async UniTaskVoid RunTask(UniTask task) + { + try + { + core.TrySetResult(await task); + } + catch (Exception ex) + { + core.TrySetException(ex); + } + finally + { + tokenRegistration.Dispose(); + } + } + + static void CancellationCallback(object state) + { + var self = (AttachExternalCancellationSource)state; + self.core.TrySetCanceled(self.cancellationToken); + } + + void IUniTaskSource.GetResult(short token) + { + core.GetResult(token); + } + + public T GetResult(short token) + { + return core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + } + +#if UNITY_2018_3_OR_NEWER + + public static IEnumerator ToCoroutine(this UniTask task, Action resultHandler = null, Action exceptionHandler = null) + { + return new ToCoroutineEnumerator(task, resultHandler, exceptionHandler); + } + + public static IEnumerator ToCoroutine(this UniTask task, Action exceptionHandler = null) + { + return new ToCoroutineEnumerator(task, exceptionHandler); + } + + public static async UniTask Timeout(this UniTask task, TimeSpan timeout, DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update, CancellationTokenSource taskCancellationTokenSource = null) + { + var delayCancellationTokenSource = new CancellationTokenSource(); + var timeoutTask = UniTask.Delay(timeout, delayType, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow(); + + int winArgIndex; + bool taskResultIsCanceled; + try + { + (winArgIndex, taskResultIsCanceled, _) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask); + } + catch + { + delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); + throw; + } + + // timeout + if (winArgIndex == 1) + { + if (taskCancellationTokenSource != null) + { + taskCancellationTokenSource.Cancel(); + taskCancellationTokenSource.Dispose(); + } + + throw new TimeoutException("Exceed Timeout:" + timeout); + } + else + { + delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); + } + + if (taskResultIsCanceled) + { + Error.ThrowOperationCanceledException(); + } + } + + public static async UniTask Timeout(this UniTask task, TimeSpan timeout, DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update, CancellationTokenSource taskCancellationTokenSource = null) + { + var delayCancellationTokenSource = new CancellationTokenSource(); + var timeoutTask = UniTask.Delay(timeout, delayType, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow(); + + int winArgIndex; + (bool IsCanceled, T Result) taskResult; + try + { + (winArgIndex, taskResult, _) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask); + } + catch + { + delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); + throw; + } + + // timeout + if (winArgIndex == 1) + { + if (taskCancellationTokenSource != null) + { + taskCancellationTokenSource.Cancel(); + taskCancellationTokenSource.Dispose(); + } + + throw new TimeoutException("Exceed Timeout:" + timeout); + } + else + { + delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); + } + + if (taskResult.IsCanceled) + { + Error.ThrowOperationCanceledException(); + } + + return taskResult.Result; + } + + /// + /// Timeout with suppress OperationCanceledException. Returns (bool, IsCacneled). + /// + public static async UniTask TimeoutWithoutException(this UniTask task, TimeSpan timeout, DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update, CancellationTokenSource taskCancellationTokenSource = null) + { + var delayCancellationTokenSource = new CancellationTokenSource(); + var timeoutTask = UniTask.Delay(timeout, delayType, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow(); + + int winArgIndex; + bool taskResultIsCanceled; + try + { + (winArgIndex, taskResultIsCanceled, _) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask); + } + catch + { + delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); + return true; + } + + // timeout + if (winArgIndex == 1) + { + if (taskCancellationTokenSource != null) + { + taskCancellationTokenSource.Cancel(); + taskCancellationTokenSource.Dispose(); + } + + return true; + } + else + { + delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); + } + + if (taskResultIsCanceled) + { + return true; + } + + return false; + } + + /// + /// Timeout with suppress OperationCanceledException. Returns (bool IsTimeout, T Result). + /// + public static async UniTask<(bool IsTimeout, T Result)> TimeoutWithoutException(this UniTask task, TimeSpan timeout, DelayType delayType = DelayType.DeltaTime, PlayerLoopTiming timeoutCheckTiming = PlayerLoopTiming.Update, CancellationTokenSource taskCancellationTokenSource = null) + { + var delayCancellationTokenSource = new CancellationTokenSource(); + var timeoutTask = UniTask.Delay(timeout, delayType, timeoutCheckTiming, delayCancellationTokenSource.Token).SuppressCancellationThrow(); + + int winArgIndex; + (bool IsCanceled, T Result) taskResult; + try + { + (winArgIndex, taskResult, _) = await UniTask.WhenAny(task.SuppressCancellationThrow(), timeoutTask); + } + catch + { + delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); + return (true, default); + } + + // timeout + if (winArgIndex == 1) + { + if (taskCancellationTokenSource != null) + { + taskCancellationTokenSource.Cancel(); + taskCancellationTokenSource.Dispose(); + } + + return (true, default); + } + else + { + delayCancellationTokenSource.Cancel(); + delayCancellationTokenSource.Dispose(); + } + + if (taskResult.IsCanceled) + { + return (true, default); + } + + return (false, taskResult.Result); + } + +#endif + + public static void Forget(this UniTask task) + { + var awaiter = task.GetAwaiter(); + if (awaiter.IsCompleted) + { + try + { + awaiter.GetResult(); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple)state) + { + try + { + t.Item1.GetResult(); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + }, StateTuple.Create(awaiter)); + } + } + + public static void Forget(this UniTask task, Action exceptionHandler, bool handleExceptionOnMainThread = true) + { + if (exceptionHandler == null) + { + Forget(task); + } + else + { + ForgetCoreWithCatch(task, exceptionHandler, handleExceptionOnMainThread).Forget(); + } + } + + static async UniTaskVoid ForgetCoreWithCatch(UniTask task, Action exceptionHandler, bool handleExceptionOnMainThread) + { + try + { + await task; + } + catch (Exception ex) + { + try + { + if (handleExceptionOnMainThread) + { +#if UNITY_2018_3_OR_NEWER + await UniTask.SwitchToMainThread(); +#endif + } + exceptionHandler(ex); + } + catch (Exception ex2) + { + UniTaskScheduler.PublishUnobservedTaskException(ex2); + } + } + } + + public static void Forget(this UniTask task) + { + var awaiter = task.GetAwaiter(); + if (awaiter.IsCompleted) + { + try + { + awaiter.GetResult(); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + else + { + awaiter.SourceOnCompleted(state => + { + using (var t = (StateTuple.Awaiter>)state) + { + try + { + t.Item1.GetResult(); + } + catch (Exception ex) + { + UniTaskScheduler.PublishUnobservedTaskException(ex); + } + } + }, StateTuple.Create(awaiter)); + } + } + + public static void Forget(this UniTask task, Action exceptionHandler, bool handleExceptionOnMainThread = true) + { + if (exceptionHandler == null) + { + task.Forget(); + } + else + { + ForgetCoreWithCatch(task, exceptionHandler, handleExceptionOnMainThread).Forget(); + } + } + + static async UniTaskVoid ForgetCoreWithCatch(UniTask task, Action exceptionHandler, bool handleExceptionOnMainThread) + { + try + { + await task; + } + catch (Exception ex) + { + try + { + if (handleExceptionOnMainThread) + { +#if UNITY_2018_3_OR_NEWER + await UniTask.SwitchToMainThread(); +#endif + } + exceptionHandler(ex); + } + catch (Exception ex2) + { + UniTaskScheduler.PublishUnobservedTaskException(ex2); + } + } + } + + public static async UniTask ContinueWith(this UniTask task, Action continuationFunction) + { + continuationFunction(await task); + } + + public static async UniTask ContinueWith(this UniTask task, Func continuationFunction) + { + await continuationFunction(await task); + } + + public static async UniTask ContinueWith(this UniTask task, Func continuationFunction) + { + return continuationFunction(await task); + } + + public static async UniTask ContinueWith(this UniTask task, Func> continuationFunction) + { + return await continuationFunction(await task); + } + + public static async UniTask ContinueWith(this UniTask task, Action continuationFunction) + { + await task; + continuationFunction(); + } + + public static async UniTask ContinueWith(this UniTask task, Func continuationFunction) + { + await task; + await continuationFunction(); + } + + public static async UniTask ContinueWith(this UniTask task, Func continuationFunction) + { + await task; + return continuationFunction(); + } + + public static async UniTask ContinueWith(this UniTask task, Func> continuationFunction) + { + await task; + return await continuationFunction(); + } + + public static async UniTask Unwrap(this UniTask> task) + { + return await await task; + } + + public static async UniTask Unwrap(this UniTask task) + { + await await task; + } + + public static async UniTask Unwrap(this Task> task) + { + return await await task; + } + + public static async UniTask Unwrap(this Task> task, bool continueOnCapturedContext) + { + return await await task.ConfigureAwait(continueOnCapturedContext); + } + + public static async UniTask Unwrap(this Task task) + { + await await task; + } + + public static async UniTask Unwrap(this Task task, bool continueOnCapturedContext) + { + await await task.ConfigureAwait(continueOnCapturedContext); + } + + public static async UniTask Unwrap(this UniTask> task) + { + return await await task; + } + + public static async UniTask Unwrap(this UniTask> task, bool continueOnCapturedContext) + { + return await (await task).ConfigureAwait(continueOnCapturedContext); + } + + public static async UniTask Unwrap(this UniTask task) + { + await await task; + } + + public static async UniTask Unwrap(this UniTask task, bool continueOnCapturedContext) + { + await (await task).ConfigureAwait(continueOnCapturedContext); + } + +#if UNITY_2018_3_OR_NEWER + + sealed class ToCoroutineEnumerator : IEnumerator + { + bool completed; + UniTask task; + Action exceptionHandler = null; + bool isStarted = false; + ExceptionDispatchInfo exception; + + public ToCoroutineEnumerator(UniTask task, Action exceptionHandler) + { + completed = false; + this.exceptionHandler = exceptionHandler; + this.task = task; + } + + async UniTaskVoid RunTask(UniTask task) + { + try + { + await task; + } + catch (Exception ex) + { + if (exceptionHandler != null) + { + exceptionHandler(ex); + } + else + { + this.exception = ExceptionDispatchInfo.Capture(ex); + } + } + finally + { + completed = true; + } + } + + public object Current => null; + + public bool MoveNext() + { + if (!isStarted) + { + isStarted = true; + RunTask(task).Forget(); + } + + if (exception != null) + { + exception.Throw(); + return false; + } + + return !completed; + } + + void IEnumerator.Reset() + { + } + } + + sealed class ToCoroutineEnumerator : IEnumerator + { + bool completed; + Action resultHandler = null; + Action exceptionHandler = null; + bool isStarted = false; + UniTask task; + object current = null; + ExceptionDispatchInfo exception; + + public ToCoroutineEnumerator(UniTask task, Action resultHandler, Action exceptionHandler) + { + completed = false; + this.task = task; + this.resultHandler = resultHandler; + this.exceptionHandler = exceptionHandler; + } + + async UniTaskVoid RunTask(UniTask task) + { + try + { + var value = await task; + current = value; // boxed if T is struct... + if (resultHandler != null) + { + resultHandler(value); + } + } + catch (Exception ex) + { + if (exceptionHandler != null) + { + exceptionHandler(ex); + } + else + { + this.exception = ExceptionDispatchInfo.Capture(ex); + } + } + finally + { + completed = true; + } + } + + public object Current => current; + + public bool MoveNext() + { + if (!isStarted) + { + isStarted = true; + RunTask(task).Forget(); + } + + if (exception != null) + { + exception.Throw(); + return false; + } + + return !completed; + } + + void IEnumerator.Reset() + { + } + } + +#endif + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs.meta new file mode 100644 index 00000000..0d229460 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 05460c617dae1e440861a7438535389f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskObservableExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskObservableExtensions.cs new file mode 100644 index 00000000..d2bd9614 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskObservableExtensions.cs @@ -0,0 +1,750 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Runtime.ExceptionServices; +using System.Threading; +using Cysharp.Threading.Tasks.Internal; + +namespace Cysharp.Threading.Tasks +{ + public static class UniTaskObservableExtensions + { + public static UniTask ToUniTask(this IObservable source, bool useFirstValue = false, CancellationToken cancellationToken = default) + { + var promise = new UniTaskCompletionSource(); + var disposable = new SingleAssignmentDisposable(); + + var observer = useFirstValue + ? (IObserver)new FirstValueToUniTaskObserver(promise, disposable, cancellationToken) + : (IObserver)new ToUniTaskObserver(promise, disposable, cancellationToken); + + try + { + disposable.Disposable = source.Subscribe(observer); + } + catch (Exception ex) + { + promise.TrySetException(ex); + } + + return promise.Task; + } + + public static IObservable ToObservable(this UniTask task) + { + if (task.Status.IsCompleted()) + { + try + { + return new ReturnObservable(task.GetAwaiter().GetResult()); + } + catch (Exception ex) + { + return new ThrowObservable(ex); + } + } + + var subject = new AsyncSubject(); + Fire(subject, task).Forget(); + return subject; + } + + /// + /// Ideally returns IObservabl[Unit] is best but Cysharp.Threading.Tasks does not have Unit so return AsyncUnit instead. + /// + public static IObservable ToObservable(this UniTask task) + { + if (task.Status.IsCompleted()) + { + try + { + task.GetAwaiter().GetResult(); + return new ReturnObservable(AsyncUnit.Default); + } + catch (Exception ex) + { + return new ThrowObservable(ex); + } + } + + var subject = new AsyncSubject(); + Fire(subject, task).Forget(); + return subject; + } + + static async UniTaskVoid Fire(AsyncSubject subject, UniTask task) + { + T value; + try + { + value = await task; + } + catch (Exception ex) + { + subject.OnError(ex); + return; + } + + subject.OnNext(value); + subject.OnCompleted(); + } + + static async UniTaskVoid Fire(AsyncSubject subject, UniTask task) + { + try + { + await task; + } + catch (Exception ex) + { + subject.OnError(ex); + return; + } + + subject.OnNext(AsyncUnit.Default); + subject.OnCompleted(); + } + + class ToUniTaskObserver : IObserver + { + static readonly Action callback = OnCanceled; + + readonly UniTaskCompletionSource promise; + readonly SingleAssignmentDisposable disposable; + readonly CancellationToken cancellationToken; + readonly CancellationTokenRegistration registration; + + bool hasValue; + T latestValue; + + public ToUniTaskObserver(UniTaskCompletionSource promise, SingleAssignmentDisposable disposable, CancellationToken cancellationToken) + { + this.promise = promise; + this.disposable = disposable; + this.cancellationToken = cancellationToken; + + if (this.cancellationToken.CanBeCanceled) + { + this.registration = this.cancellationToken.RegisterWithoutCaptureExecutionContext(callback, this); + } + } + + static void OnCanceled(object state) + { + var self = (ToUniTaskObserver)state; + self.disposable.Dispose(); + self.promise.TrySetCanceled(self.cancellationToken); + } + + public void OnNext(T value) + { + hasValue = true; + latestValue = value; + } + + public void OnError(Exception error) + { + try + { + promise.TrySetException(error); + } + finally + { + registration.Dispose(); + disposable.Dispose(); + } + } + + public void OnCompleted() + { + try + { + if (hasValue) + { + promise.TrySetResult(latestValue); + } + else + { + promise.TrySetException(new InvalidOperationException("Sequence has no elements")); + } + } + finally + { + registration.Dispose(); + disposable.Dispose(); + } + } + } + + class FirstValueToUniTaskObserver : IObserver + { + static readonly Action callback = OnCanceled; + + readonly UniTaskCompletionSource promise; + readonly SingleAssignmentDisposable disposable; + readonly CancellationToken cancellationToken; + readonly CancellationTokenRegistration registration; + + bool hasValue; + + public FirstValueToUniTaskObserver(UniTaskCompletionSource promise, SingleAssignmentDisposable disposable, CancellationToken cancellationToken) + { + this.promise = promise; + this.disposable = disposable; + this.cancellationToken = cancellationToken; + + if (this.cancellationToken.CanBeCanceled) + { + this.registration = this.cancellationToken.RegisterWithoutCaptureExecutionContext(callback, this); + } + } + + static void OnCanceled(object state) + { + var self = (FirstValueToUniTaskObserver)state; + self.disposable.Dispose(); + self.promise.TrySetCanceled(self.cancellationToken); + } + + public void OnNext(T value) + { + hasValue = true; + try + { + promise.TrySetResult(value); + } + finally + { + registration.Dispose(); + disposable.Dispose(); + } + } + + public void OnError(Exception error) + { + try + { + promise.TrySetException(error); + } + finally + { + registration.Dispose(); + disposable.Dispose(); + } + } + + public void OnCompleted() + { + try + { + if (!hasValue) + { + promise.TrySetException(new InvalidOperationException("Sequence has no elements")); + } + } + finally + { + registration.Dispose(); + disposable.Dispose(); + } + } + } + + class ReturnObservable : IObservable + { + readonly T value; + + public ReturnObservable(T value) + { + this.value = value; + } + + public IDisposable Subscribe(IObserver observer) + { + observer.OnNext(value); + observer.OnCompleted(); + return EmptyDisposable.Instance; + } + } + + class ThrowObservable : IObservable + { + readonly Exception value; + + public ThrowObservable(Exception value) + { + this.value = value; + } + + public IDisposable Subscribe(IObserver observer) + { + observer.OnError(value); + return EmptyDisposable.Instance; + } + } + } +} + +namespace Cysharp.Threading.Tasks.Internal +{ + // Bridges for Rx. + + internal class EmptyDisposable : IDisposable + { + public static EmptyDisposable Instance = new EmptyDisposable(); + + EmptyDisposable() + { + + } + + public void Dispose() + { + } + } + + internal sealed class SingleAssignmentDisposable : IDisposable + { + readonly object gate = new object(); + IDisposable current; + bool disposed; + + public bool IsDisposed { get { lock (gate) { return disposed; } } } + + public IDisposable Disposable + { + get + { + return current; + } + set + { + var old = default(IDisposable); + bool alreadyDisposed; + lock (gate) + { + alreadyDisposed = disposed; + old = current; + if (!alreadyDisposed) + { + if (value == null) return; + current = value; + } + } + + if (alreadyDisposed && value != null) + { + value.Dispose(); + return; + } + + if (old != null) throw new InvalidOperationException("Disposable is already set"); + } + } + + + public void Dispose() + { + IDisposable old = null; + + lock (gate) + { + if (!disposed) + { + disposed = true; + old = current; + current = null; + } + } + + if (old != null) old.Dispose(); + } + } + + internal sealed class AsyncSubject : IObservable, IObserver + { + object observerLock = new object(); + + T lastValue; + bool hasValue; + bool isStopped; + bool isDisposed; + Exception lastError; + IObserver outObserver = EmptyObserver.Instance; + + public T Value + { + get + { + ThrowIfDisposed(); + if (!isStopped) throw new InvalidOperationException("AsyncSubject is not completed yet"); + if (lastError != null) ExceptionDispatchInfo.Capture(lastError).Throw(); + return lastValue; + } + } + + public bool HasObservers + { + get + { + return !(outObserver is EmptyObserver) && !isStopped && !isDisposed; + } + } + + public bool IsCompleted { get { return isStopped; } } + + public void OnCompleted() + { + IObserver old; + T v; + bool hv; + lock (observerLock) + { + ThrowIfDisposed(); + if (isStopped) return; + + old = outObserver; + outObserver = EmptyObserver.Instance; + isStopped = true; + v = lastValue; + hv = hasValue; + } + + if (hv) + { + old.OnNext(v); + old.OnCompleted(); + } + else + { + old.OnCompleted(); + } + } + + public void OnError(Exception error) + { + if (error == null) throw new ArgumentNullException("error"); + + IObserver old; + lock (observerLock) + { + ThrowIfDisposed(); + if (isStopped) return; + + old = outObserver; + outObserver = EmptyObserver.Instance; + isStopped = true; + lastError = error; + } + + old.OnError(error); + } + + public void OnNext(T value) + { + lock (observerLock) + { + ThrowIfDisposed(); + if (isStopped) return; + + this.hasValue = true; + this.lastValue = value; + } + } + + public IDisposable Subscribe(IObserver observer) + { + if (observer == null) throw new ArgumentNullException("observer"); + + var ex = default(Exception); + var v = default(T); + var hv = false; + + lock (observerLock) + { + ThrowIfDisposed(); + if (!isStopped) + { + var listObserver = outObserver as ListObserver; + if (listObserver != null) + { + outObserver = listObserver.Add(observer); + } + else + { + var current = outObserver; + if (current is EmptyObserver) + { + outObserver = observer; + } + else + { + outObserver = new ListObserver(new ImmutableList>(new[] { current, observer })); + } + } + + return new Subscription(this, observer); + } + + ex = lastError; + v = lastValue; + hv = hasValue; + } + + if (ex != null) + { + observer.OnError(ex); + } + else if (hv) + { + observer.OnNext(v); + observer.OnCompleted(); + } + else + { + observer.OnCompleted(); + } + + return EmptyDisposable.Instance; + } + + public void Dispose() + { + lock (observerLock) + { + isDisposed = true; + outObserver = DisposedObserver.Instance; + lastError = null; + lastValue = default(T); + } + } + + void ThrowIfDisposed() + { + if (isDisposed) throw new ObjectDisposedException(""); + } + + class Subscription : IDisposable + { + readonly object gate = new object(); + AsyncSubject parent; + IObserver unsubscribeTarget; + + public Subscription(AsyncSubject parent, IObserver unsubscribeTarget) + { + this.parent = parent; + this.unsubscribeTarget = unsubscribeTarget; + } + + public void Dispose() + { + lock (gate) + { + if (parent != null) + { + lock (parent.observerLock) + { + var listObserver = parent.outObserver as ListObserver; + if (listObserver != null) + { + parent.outObserver = listObserver.Remove(unsubscribeTarget); + } + else + { + parent.outObserver = EmptyObserver.Instance; + } + + unsubscribeTarget = null; + parent = null; + } + } + } + } + } + } + + internal class ListObserver : IObserver + { + private readonly ImmutableList> _observers; + + public ListObserver(ImmutableList> observers) + { + _observers = observers; + } + + public void OnCompleted() + { + var targetObservers = _observers.Data; + for (int i = 0; i < targetObservers.Length; i++) + { + targetObservers[i].OnCompleted(); + } + } + + public void OnError(Exception error) + { + var targetObservers = _observers.Data; + for (int i = 0; i < targetObservers.Length; i++) + { + targetObservers[i].OnError(error); + } + } + + public void OnNext(T value) + { + var targetObservers = _observers.Data; + for (int i = 0; i < targetObservers.Length; i++) + { + targetObservers[i].OnNext(value); + } + } + + internal IObserver Add(IObserver observer) + { + return new ListObserver(_observers.Add(observer)); + } + + internal IObserver Remove(IObserver observer) + { + var i = Array.IndexOf(_observers.Data, observer); + if (i < 0) + return this; + + if (_observers.Data.Length == 2) + { + return _observers.Data[1 - i]; + } + else + { + return new ListObserver(_observers.Remove(observer)); + } + } + } + + internal class EmptyObserver : IObserver + { + public static readonly EmptyObserver Instance = new EmptyObserver(); + + EmptyObserver() + { + + } + + public void OnCompleted() + { + } + + public void OnError(Exception error) + { + } + + public void OnNext(T value) + { + } + } + + internal class ThrowObserver : IObserver + { + public static readonly ThrowObserver Instance = new ThrowObserver(); + + ThrowObserver() + { + + } + + public void OnCompleted() + { + } + + public void OnError(Exception error) + { + ExceptionDispatchInfo.Capture(error).Throw(); + } + + public void OnNext(T value) + { + } + } + + internal class DisposedObserver : IObserver + { + public static readonly DisposedObserver Instance = new DisposedObserver(); + + DisposedObserver() + { + + } + + public void OnCompleted() + { + throw new ObjectDisposedException(""); + } + + public void OnError(Exception error) + { + throw new ObjectDisposedException(""); + } + + public void OnNext(T value) + { + throw new ObjectDisposedException(""); + } + } + + internal class ImmutableList + { + public static readonly ImmutableList Empty = new ImmutableList(); + + T[] data; + + public T[] Data + { + get { return data; } + } + + ImmutableList() + { + data = new T[0]; + } + + public ImmutableList(T[] data) + { + this.data = data; + } + + public ImmutableList Add(T value) + { + var newData = new T[data.Length + 1]; + Array.Copy(data, newData, data.Length); + newData[data.Length] = value; + return new ImmutableList(newData); + } + + public ImmutableList Remove(T value) + { + var i = IndexOf(value); + if (i < 0) return this; + + var length = data.Length; + if (length == 1) return Empty; + + var newData = new T[length - 1]; + + Array.Copy(data, 0, newData, 0, i); + Array.Copy(data, i + 1, newData, i, length - i - 1); + + return new ImmutableList(newData); + } + + public int IndexOf(T value) + { + for (var i = 0; i < data.Length; ++i) + { + // ImmutableList only use for IObserver(no worry for boxed) + if (object.Equals(data[i], value)) return i; + } + return -1; + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskObservableExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskObservableExtensions.cs.meta new file mode 100644 index 00000000..527a49fc --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskObservableExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eaea262a5ad393d419c15b3b2901d664 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskScheduler.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskScheduler.cs new file mode 100644 index 00000000..2f91f2ad --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskScheduler.cs @@ -0,0 +1,103 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + // UniTask has no scheduler like TaskScheduler. + // Only handle unobserved exception. + + public static class UniTaskScheduler + { + public static event Action UnobservedTaskException; + + /// + /// Propagate OperationCanceledException to UnobservedTaskException when true. Default is false. + /// + public static bool PropagateOperationCanceledException = false; + +#if UNITY_2018_3_OR_NEWER + + /// + /// Write log type when catch unobserved exception and not registered UnobservedTaskException. Default is Exception. + /// + public static UnityEngine.LogType UnobservedExceptionWriteLogType = UnityEngine.LogType.Exception; + + /// + /// Dispatch exception event to Unity MainThread. Default is true. + /// + public static bool DispatchUnityMainThread = true; + + // cache delegate. + static readonly SendOrPostCallback handleExceptionInvoke = InvokeUnobservedTaskException; + + static void InvokeUnobservedTaskException(object state) + { + UnobservedTaskException((Exception)state); + } +#endif + + internal static void PublishUnobservedTaskException(Exception ex) + { + if (ex != null) + { + if (!PropagateOperationCanceledException && ex is OperationCanceledException) + { + return; + } + + if (UnobservedTaskException != null) + { +#if UNITY_2018_3_OR_NEWER + if (!DispatchUnityMainThread || Thread.CurrentThread.ManagedThreadId == PlayerLoopHelper.MainThreadId) + { + // allows inlining call. + UnobservedTaskException.Invoke(ex); + } + else + { + // Post to MainThread. + PlayerLoopHelper.UnitySynchronizationContext.Post(handleExceptionInvoke, ex); + } +#else + UnobservedTaskException.Invoke(ex); +#endif + } + else + { +#if UNITY_2018_3_OR_NEWER + string msg = null; + if (UnobservedExceptionWriteLogType != UnityEngine.LogType.Exception) + { + msg = "UnobservedTaskException: " + ex.ToString(); + } + switch (UnobservedExceptionWriteLogType) + { + case UnityEngine.LogType.Error: + UnityEngine.Debug.LogError(msg); + break; + case UnityEngine.LogType.Assert: + UnityEngine.Debug.LogAssertion(msg); + break; + case UnityEngine.LogType.Warning: + UnityEngine.Debug.LogWarning(msg); + break; + case UnityEngine.LogType.Log: + UnityEngine.Debug.Log(msg); + break; + case UnityEngine.LogType.Exception: + UnityEngine.Debug.LogException(ex); + break; + default: + break; + } +#else + Console.WriteLine("UnobservedTaskException: " + ex.ToString()); +#endif + } + } + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskScheduler.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskScheduler.cs.meta new file mode 100644 index 00000000..5e29191f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskScheduler.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d6cad69921702d5488d96b5ef30df1b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskSynchronizationContext.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskSynchronizationContext.cs new file mode 100644 index 00000000..450e019f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskSynchronizationContext.cs @@ -0,0 +1,158 @@ +using System; +using System.Runtime.InteropServices; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public class UniTaskSynchronizationContext : SynchronizationContext + { + const int MaxArrayLength = 0X7FEFFFFF; + const int InitialSize = 16; + + static SpinLock gate = new SpinLock(false); + static bool dequing = false; + + static int actionListCount = 0; + static Callback[] actionList = new Callback[InitialSize]; + + static int waitingListCount = 0; + static Callback[] waitingList = new Callback[InitialSize]; + + static int opCount; + + public override void Send(SendOrPostCallback d, object state) + { + d(state); + } + + public override void Post(SendOrPostCallback d, object state) + { + bool lockTaken = false; + try + { + gate.Enter(ref lockTaken); + + if (dequing) + { + // Ensure Capacity + if (waitingList.Length == waitingListCount) + { + var newLength = waitingListCount * 2; + if ((uint)newLength > MaxArrayLength) newLength = MaxArrayLength; + + var newArray = new Callback[newLength]; + Array.Copy(waitingList, newArray, waitingListCount); + waitingList = newArray; + } + waitingList[waitingListCount] = new Callback(d, state); + waitingListCount++; + } + else + { + // Ensure Capacity + if (actionList.Length == actionListCount) + { + var newLength = actionListCount * 2; + if ((uint)newLength > MaxArrayLength) newLength = MaxArrayLength; + + var newArray = new Callback[newLength]; + Array.Copy(actionList, newArray, actionListCount); + actionList = newArray; + } + actionList[actionListCount] = new Callback(d, state); + actionListCount++; + } + } + finally + { + if (lockTaken) gate.Exit(false); + } + } + + public override void OperationStarted() + { + Interlocked.Increment(ref opCount); + } + + public override void OperationCompleted() + { + Interlocked.Decrement(ref opCount); + } + + public override SynchronizationContext CreateCopy() + { + return this; + } + + // delegate entrypoint. + internal static void Run() + { + { + bool lockTaken = false; + try + { + gate.Enter(ref lockTaken); + if (actionListCount == 0) return; + dequing = true; + } + finally + { + if (lockTaken) gate.Exit(false); + } + } + + for (int i = 0; i < actionListCount; i++) + { + var action = actionList[i]; + actionList[i] = default; + action.Invoke(); + } + + { + bool lockTaken = false; + try + { + gate.Enter(ref lockTaken); + dequing = false; + + var swapTempActionList = actionList; + + actionListCount = waitingListCount; + actionList = waitingList; + + waitingListCount = 0; + waitingList = swapTempActionList; + } + finally + { + if (lockTaken) gate.Exit(false); + } + } + } + + [StructLayout(LayoutKind.Auto)] + readonly struct Callback + { + readonly SendOrPostCallback callback; + readonly object state; + + public Callback(SendOrPostCallback callback, object state) + { + this.callback = callback; + this.state = state; + } + + public void Invoke() + { + try + { + callback(state); + } + catch (Exception ex) + { + UnityEngine.Debug.LogException(ex); + } + } + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskSynchronizationContext.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskSynchronizationContext.cs.meta new file mode 100644 index 00000000..9828c893 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskSynchronizationContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: abf3aae9813db2849bce518f8596e920 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskVoid.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskVoid.cs new file mode 100644 index 00000000..c7e9ed98 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskVoid.cs @@ -0,0 +1,19 @@ +#pragma warning disable CS1591 +#pragma warning disable CS0436 + +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using Cysharp.Threading.Tasks.CompilerServices; + +namespace Cysharp.Threading.Tasks +{ + [AsyncMethodBuilder(typeof(AsyncUniTaskVoidMethodBuilder))] + public readonly struct UniTaskVoid + { + public void Forget() + { + } + } +} + diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskVoid.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskVoid.cs.meta new file mode 100644 index 00000000..01f7156c --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UniTaskVoid.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9f28cd922179634d863011548f89ae7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AssetBundleRequestAllAssets.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AssetBundleRequestAllAssets.cs new file mode 100644 index 00000000..5d34692d --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AssetBundleRequestAllAssets.cs @@ -0,0 +1,246 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +#if UNITY_2018_4 || UNITY_2019_4_OR_NEWER +#if UNITASK_ASSETBUNDLE_SUPPORT + +using Cysharp.Threading.Tasks.Internal; +using System; +using System.Runtime.CompilerServices; +using System.Threading; +using UnityEngine; + +namespace Cysharp.Threading.Tasks +{ + public static partial class UnityAsyncExtensions + { + public static AssetBundleRequestAllAssetsAwaiter AwaitForAllAssets(this AssetBundleRequest asyncOperation) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + return new AssetBundleRequestAllAssetsAwaiter(asyncOperation); + } + + public static UniTask AwaitForAllAssets(this AssetBundleRequest asyncOperation, CancellationToken cancellationToken) + { + return AwaitForAllAssets(asyncOperation, null, PlayerLoopTiming.Update, cancellationToken: cancellationToken); + } + + public static UniTask AwaitForAllAssets(this AssetBundleRequest asyncOperation, CancellationToken cancellationToken, bool cancelImmediately) + { + return AwaitForAllAssets(asyncOperation, progress: null, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately); + } + + public static UniTask AwaitForAllAssets(this AssetBundleRequest asyncOperation, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); + if (asyncOperation.isDone) return UniTask.FromResult(asyncOperation.allAssets); + return new UniTask(AssetBundleRequestAllAssetsConfiguredSource.Create(asyncOperation, timing, progress, cancellationToken, cancelImmediately, out var token), token); + } + + public struct AssetBundleRequestAllAssetsAwaiter : ICriticalNotifyCompletion + { + AssetBundleRequest asyncOperation; + Action continuationAction; + + public AssetBundleRequestAllAssetsAwaiter(AssetBundleRequest asyncOperation) + { + this.asyncOperation = asyncOperation; + this.continuationAction = null; + } + + public AssetBundleRequestAllAssetsAwaiter GetAwaiter() + { + return this; + } + + public bool IsCompleted => asyncOperation.isDone; + + public UnityEngine.Object[] GetResult() + { + if (continuationAction != null) + { + asyncOperation.completed -= continuationAction; + continuationAction = null; + var result = asyncOperation.allAssets; + asyncOperation = null; + return result; + } + else + { + var result = asyncOperation.allAssets; + asyncOperation = null; + return result; + } + } + + public void OnCompleted(Action continuation) + { + UnsafeOnCompleted(continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); + continuationAction = PooledDelegate.Create(continuation); + asyncOperation.completed += continuationAction; + } + } + + sealed class AssetBundleRequestAllAssetsConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + AssetBundleRequestAllAssetsConfiguredSource nextNode; + public ref AssetBundleRequestAllAssetsConfiguredSource NextNode => ref nextNode; + + static AssetBundleRequestAllAssetsConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(AssetBundleRequestAllAssetsConfiguredSource), () => pool.Size); + } + + AssetBundleRequest asyncOperation; + IProgress progress; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + bool completed; + + UniTaskCompletionSourceCore core; + + Action continuationAction; + + AssetBundleRequestAllAssetsConfiguredSource() + { + continuationAction = Continuation; + } + + public static IUniTaskSource Create(AssetBundleRequest asyncOperation, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new AssetBundleRequestAllAssetsConfiguredSource(); + } + + result.asyncOperation = asyncOperation; + result.progress = progress; + result.cancellationToken = cancellationToken; + result.completed = false; + + asyncOperation.completed += result.continuationAction; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (AssetBundleRequestAllAssetsConfiguredSource)state; + source.core.TrySetCanceled(source.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public UnityEngine.Object[] GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + // Already completed + if (completed || asyncOperation == null) + { + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (progress != null) + { + progress.Report(asyncOperation.progress); + } + + if (asyncOperation.isDone) + { + core.TrySetResult(asyncOperation.allAssets); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + asyncOperation = default; + progress = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + + void Continuation(AsyncOperation _) + { + if (completed) + { + TryReturn(); + } + else + { + completed = true; + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + } + else + { + core.TrySetResult(asyncOperation.allAssets); + } + } + } + } + } +} + +#endif +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AssetBundleRequestAllAssets.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AssetBundleRequestAllAssets.cs.meta new file mode 100644 index 00000000..79be9231 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AssetBundleRequestAllAssets.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9147caba40da434da95b39709c13784 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AsyncGPUReadback.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AsyncGPUReadback.cs new file mode 100644 index 00000000..5d73dc1a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AsyncGPUReadback.cs @@ -0,0 +1,155 @@ + #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Threading; +using UnityEngine.Rendering; + +namespace Cysharp.Threading.Tasks +{ + public static partial class UnityAsyncExtensions + { + #region AsyncGPUReadbackRequest + + public static UniTask.Awaiter GetAwaiter(this AsyncGPUReadbackRequest asyncOperation) + { + return ToUniTask(asyncOperation).GetAwaiter(); + } + + public static UniTask WithCancellation(this AsyncGPUReadbackRequest asyncOperation, CancellationToken cancellationToken) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken); + } + + public static UniTask WithCancellation(this AsyncGPUReadbackRequest asyncOperation, CancellationToken cancellationToken, bool cancelImmediately) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately); + } + + public static UniTask ToUniTask(this AsyncGPUReadbackRequest asyncOperation, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + if (asyncOperation.done) return UniTask.FromResult(asyncOperation); + return new UniTask(AsyncGPUReadbackRequestAwaiterConfiguredSource.Create(asyncOperation, timing, cancellationToken, cancelImmediately, out var token), token); + } + + sealed class AsyncGPUReadbackRequestAwaiterConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + AsyncGPUReadbackRequestAwaiterConfiguredSource nextNode; + public ref AsyncGPUReadbackRequestAwaiterConfiguredSource NextNode => ref nextNode; + + static AsyncGPUReadbackRequestAwaiterConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(AsyncGPUReadbackRequestAwaiterConfiguredSource), () => pool.Size); + } + + AsyncGPUReadbackRequest asyncOperation; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + + UniTaskCompletionSourceCore core; + + AsyncGPUReadbackRequestAwaiterConfiguredSource() + { + } + + public static IUniTaskSource Create(AsyncGPUReadbackRequest asyncOperation, PlayerLoopTiming timing, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new AsyncGPUReadbackRequestAwaiterConfiguredSource(); + } + + result.asyncOperation = asyncOperation; + result.cancellationToken = cancellationToken; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var promise = (AsyncGPUReadbackRequestAwaiterConfiguredSource)state; + promise.core.TrySetCanceled(promise.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public AsyncGPUReadbackRequest GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (asyncOperation.hasError) + { + core.TrySetException(new Exception("AsyncGPUReadbackRequest.hasError = true")); + return false; + } + + if (asyncOperation.done) + { + core.TrySetResult(asyncOperation); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + asyncOperation = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AsyncGPUReadback.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AsyncGPUReadback.cs.meta new file mode 100644 index 00000000..510c49e3 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.AsyncGPUReadback.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98f5fedb44749ab4688674d79126b46a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.Jobs.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.Jobs.cs new file mode 100644 index 00000000..db0a8922 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.Jobs.cs @@ -0,0 +1,102 @@ +#if ENABLE_MANAGED_JOBS +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Threading; +using Unity.Jobs; +using UnityEngine; + +namespace Cysharp.Threading.Tasks +{ + public static partial class UnityAsyncExtensions + { + public static async UniTask WaitAsync(this JobHandle jobHandle, PlayerLoopTiming waitTiming, CancellationToken cancellationToken = default) + { + await UniTask.Yield(waitTiming); + jobHandle.Complete(); + cancellationToken.ThrowIfCancellationRequested(); // call cancel after Complete. + } + + public static UniTask.Awaiter GetAwaiter(this JobHandle jobHandle) + { + var handler = JobHandlePromise.Create(jobHandle, out var token); + { + PlayerLoopHelper.AddAction(PlayerLoopTiming.EarlyUpdate, handler); + PlayerLoopHelper.AddAction(PlayerLoopTiming.PreUpdate, handler); + PlayerLoopHelper.AddAction(PlayerLoopTiming.Update, handler); + PlayerLoopHelper.AddAction(PlayerLoopTiming.PreLateUpdate, handler); + PlayerLoopHelper.AddAction(PlayerLoopTiming.PostLateUpdate, handler); + } + + return new UniTask(handler, token).GetAwaiter(); + } + + // can not pass CancellationToken because can't handle JobHandle's Complete and NativeArray.Dispose. + + public static UniTask ToUniTask(this JobHandle jobHandle, PlayerLoopTiming waitTiming) + { + var handler = JobHandlePromise.Create(jobHandle, out var token); + { + PlayerLoopHelper.AddAction(waitTiming, handler); + } + + return new UniTask(handler, token); + } + + sealed class JobHandlePromise : IUniTaskSource, IPlayerLoopItem + { + JobHandle jobHandle; + + UniTaskCompletionSourceCore core; + + // Cancellation is not supported. + public static JobHandlePromise Create(JobHandle jobHandle, out short token) + { + // not use pool. + var result = new JobHandlePromise(); + + result.jobHandle = jobHandle; + + TaskTracker.TrackActiveTask(result, 3); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + TaskTracker.RemoveTracking(this); + core.GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + if (jobHandle.IsCompleted | PlayerLoopHelper.IsEditorApplicationQuitting) + { + jobHandle.Complete(); + core.TrySetResult(AsyncUnit.Default); + return false; + } + + return true; + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.Jobs.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.Jobs.cs.meta new file mode 100644 index 00000000..c07df0b8 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.Jobs.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 30979a768fbd4b94f8694eee8a305c99 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.MonoBehaviour.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.MonoBehaviour.cs new file mode 100644 index 00000000..fdfe55ca --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.MonoBehaviour.cs @@ -0,0 +1,14 @@ +using System; +using System.Threading; + +namespace Cysharp.Threading.Tasks +{ + public static partial class UnityAsyncExtensions + { + public static UniTask StartAsyncCoroutine(this UnityEngine.MonoBehaviour monoBehaviour, Func asyncCoroutine) + { + var token = monoBehaviour.GetCancellationTokenOnDestroy(); + return asyncCoroutine(token); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.MonoBehaviour.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.MonoBehaviour.cs.meta new file mode 100644 index 00000000..6e45863f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.MonoBehaviour.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2edd588bb09eb0a4695d039d6a1f02b2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs new file mode 100644 index 00000000..b9cd1c9f --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs @@ -0,0 +1,1181 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +using System; +using System.Runtime.CompilerServices; +using System.Threading; +using UnityEngine; +using Cysharp.Threading.Tasks.Internal; +#if ENABLE_UNITYWEBREQUEST && (!UNITY_2019_1_OR_NEWER || UNITASK_WEBREQUEST_SUPPORT) +using UnityEngine.Networking; +#endif + +namespace Cysharp.Threading.Tasks +{ + public static partial class UnityAsyncExtensions + { + #region AsyncOperation + +#if !UNITY_2023_1_OR_NEWER + // from Unity2023.1.0a15, AsyncOperationAwaitableExtensions.GetAwaiter is defined in UnityEngine. + public static AsyncOperationAwaiter GetAwaiter(this AsyncOperation asyncOperation) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + return new AsyncOperationAwaiter(asyncOperation); + } +#endif + + public static UniTask WithCancellation(this AsyncOperation asyncOperation, CancellationToken cancellationToken) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken); + } + + public static UniTask WithCancellation(this AsyncOperation asyncOperation, CancellationToken cancellationToken, bool cancelImmediately) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately); + } + + public static UniTask ToUniTask(this AsyncOperation asyncOperation, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); + if (asyncOperation.isDone) return UniTask.CompletedTask; + return new UniTask(AsyncOperationConfiguredSource.Create(asyncOperation, timing, progress, cancellationToken, cancelImmediately, out var token), token); + } + + public struct AsyncOperationAwaiter : ICriticalNotifyCompletion + { + AsyncOperation asyncOperation; + Action continuationAction; + + public AsyncOperationAwaiter(AsyncOperation asyncOperation) + { + this.asyncOperation = asyncOperation; + this.continuationAction = null; + } + + public bool IsCompleted => asyncOperation.isDone; + + public void GetResult() + { + if (continuationAction != null) + { + asyncOperation.completed -= continuationAction; + continuationAction = null; + asyncOperation = null; + } + else + { + asyncOperation = null; + } + } + + public void OnCompleted(Action continuation) + { + UnsafeOnCompleted(continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); + continuationAction = PooledDelegate.Create(continuation); + asyncOperation.completed += continuationAction; + } + } + + sealed class AsyncOperationConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + AsyncOperationConfiguredSource nextNode; + public ref AsyncOperationConfiguredSource NextNode => ref nextNode; + + static AsyncOperationConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(AsyncOperationConfiguredSource), () => pool.Size); + } + + AsyncOperation asyncOperation; + IProgress progress; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + bool completed; + + UniTaskCompletionSourceCore core; + + Action continuationAction; + + AsyncOperationConfiguredSource() + { + continuationAction = Continuation; + } + + public static IUniTaskSource Create(AsyncOperation asyncOperation, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new AsyncOperationConfiguredSource(); + } + + result.asyncOperation = asyncOperation; + result.progress = progress; + result.cancellationToken = cancellationToken; + result.completed = false; + + asyncOperation.completed += result.continuationAction; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (AsyncOperationConfiguredSource)state; + source.core.TrySetCanceled(source.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public void GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + // Already completed + if (completed || asyncOperation == null) + { + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (progress != null) + { + progress.Report(asyncOperation.progress); + } + + if (asyncOperation.isDone) + { + core.TrySetResult(AsyncUnit.Default); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + asyncOperation.completed -= continuationAction; + asyncOperation = default; + progress = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + + void Continuation(AsyncOperation _) + { + if (completed) + { + TryReturn(); + } + else + { + completed = true; + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + } + else + { + core.TrySetResult(AsyncUnit.Default); + } + } + } + } + + #endregion + + #region ResourceRequest + + public static ResourceRequestAwaiter GetAwaiter(this ResourceRequest asyncOperation) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + return new ResourceRequestAwaiter(asyncOperation); + } + + public static UniTask WithCancellation(this ResourceRequest asyncOperation, CancellationToken cancellationToken) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken); + } + + public static UniTask WithCancellation(this ResourceRequest asyncOperation, CancellationToken cancellationToken, bool cancelImmediately) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately); + } + + public static UniTask ToUniTask(this ResourceRequest asyncOperation, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); + if (asyncOperation.isDone) return UniTask.FromResult(asyncOperation.asset); + return new UniTask(ResourceRequestConfiguredSource.Create(asyncOperation, timing, progress, cancellationToken, cancelImmediately, out var token), token); + } + + public struct ResourceRequestAwaiter : ICriticalNotifyCompletion + { + ResourceRequest asyncOperation; + Action continuationAction; + + public ResourceRequestAwaiter(ResourceRequest asyncOperation) + { + this.asyncOperation = asyncOperation; + this.continuationAction = null; + } + + public bool IsCompleted => asyncOperation.isDone; + + public UnityEngine.Object GetResult() + { + if (continuationAction != null) + { + asyncOperation.completed -= continuationAction; + continuationAction = null; + var result = asyncOperation.asset; + asyncOperation = null; + return result; + } + else + { + var result = asyncOperation.asset; + asyncOperation = null; + return result; + } + } + + public void OnCompleted(Action continuation) + { + UnsafeOnCompleted(continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); + continuationAction = PooledDelegate.Create(continuation); + asyncOperation.completed += continuationAction; + } + } + + sealed class ResourceRequestConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + ResourceRequestConfiguredSource nextNode; + public ref ResourceRequestConfiguredSource NextNode => ref nextNode; + + static ResourceRequestConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(ResourceRequestConfiguredSource), () => pool.Size); + } + + ResourceRequest asyncOperation; + IProgress progress; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + bool completed; + + UniTaskCompletionSourceCore core; + + Action continuationAction; + + ResourceRequestConfiguredSource() + { + continuationAction = Continuation; + } + + public static IUniTaskSource Create(ResourceRequest asyncOperation, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new ResourceRequestConfiguredSource(); + } + + result.asyncOperation = asyncOperation; + result.progress = progress; + result.cancellationToken = cancellationToken; + result.completed = false; + + asyncOperation.completed += result.continuationAction; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (ResourceRequestConfiguredSource)state; + source.core.TrySetCanceled(source.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public UnityEngine.Object GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + // Already completed + if (completed || asyncOperation == null) + { + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (progress != null) + { + progress.Report(asyncOperation.progress); + } + + if (asyncOperation.isDone) + { + core.TrySetResult(asyncOperation.asset); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + asyncOperation.completed -= continuationAction; + asyncOperation = default; + progress = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + + void Continuation(AsyncOperation _) + { + if (completed) + { + TryReturn(); + } + else + { + completed = true; + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + } + else + { + core.TrySetResult(asyncOperation.asset); + } + } + } + } + + #endregion + +#if UNITASK_ASSETBUNDLE_SUPPORT + #region AssetBundleRequest + + public static AssetBundleRequestAwaiter GetAwaiter(this AssetBundleRequest asyncOperation) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + return new AssetBundleRequestAwaiter(asyncOperation); + } + + public static UniTask WithCancellation(this AssetBundleRequest asyncOperation, CancellationToken cancellationToken) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken); + } + + public static UniTask WithCancellation(this AssetBundleRequest asyncOperation, CancellationToken cancellationToken, bool cancelImmediately) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately); + } + + public static UniTask ToUniTask(this AssetBundleRequest asyncOperation, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); + if (asyncOperation.isDone) return UniTask.FromResult(asyncOperation.asset); + return new UniTask(AssetBundleRequestConfiguredSource.Create(asyncOperation, timing, progress, cancellationToken, cancelImmediately, out var token), token); + } + + public struct AssetBundleRequestAwaiter : ICriticalNotifyCompletion + { + AssetBundleRequest asyncOperation; + Action continuationAction; + + public AssetBundleRequestAwaiter(AssetBundleRequest asyncOperation) + { + this.asyncOperation = asyncOperation; + this.continuationAction = null; + } + + public bool IsCompleted => asyncOperation.isDone; + + public UnityEngine.Object GetResult() + { + if (continuationAction != null) + { + asyncOperation.completed -= continuationAction; + continuationAction = null; + var result = asyncOperation.asset; + asyncOperation = null; + return result; + } + else + { + var result = asyncOperation.asset; + asyncOperation = null; + return result; + } + } + + public void OnCompleted(Action continuation) + { + UnsafeOnCompleted(continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); + continuationAction = PooledDelegate.Create(continuation); + asyncOperation.completed += continuationAction; + } + } + + sealed class AssetBundleRequestConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + AssetBundleRequestConfiguredSource nextNode; + public ref AssetBundleRequestConfiguredSource NextNode => ref nextNode; + + static AssetBundleRequestConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(AssetBundleRequestConfiguredSource), () => pool.Size); + } + + AssetBundleRequest asyncOperation; + IProgress progress; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + bool completed; + + UniTaskCompletionSourceCore core; + + Action continuationAction; + + AssetBundleRequestConfiguredSource() + { + continuationAction = Continuation; + } + + public static IUniTaskSource Create(AssetBundleRequest asyncOperation, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new AssetBundleRequestConfiguredSource(); + } + + result.asyncOperation = asyncOperation; + result.progress = progress; + result.cancellationToken = cancellationToken; + result.completed = false; + + asyncOperation.completed += result.continuationAction; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (AssetBundleRequestConfiguredSource)state; + source.core.TrySetCanceled(source.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public UnityEngine.Object GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + // Already completed + if (completed || asyncOperation == null) + { + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (progress != null) + { + progress.Report(asyncOperation.progress); + } + + if (asyncOperation.isDone) + { + core.TrySetResult(asyncOperation.asset); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + asyncOperation.completed -= continuationAction; + asyncOperation = default; + progress = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + + void Continuation(AsyncOperation _) + { + if (completed) + { + TryReturn(); + } + else + { + completed = true; + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + } + else + { + core.TrySetResult(asyncOperation.asset); + } + } + } + } + + #endregion +#endif + +#if UNITASK_ASSETBUNDLE_SUPPORT + #region AssetBundleCreateRequest + + public static AssetBundleCreateRequestAwaiter GetAwaiter(this AssetBundleCreateRequest asyncOperation) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + return new AssetBundleCreateRequestAwaiter(asyncOperation); + } + + public static UniTask WithCancellation(this AssetBundleCreateRequest asyncOperation, CancellationToken cancellationToken) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken); + } + + public static UniTask WithCancellation(this AssetBundleCreateRequest asyncOperation, CancellationToken cancellationToken, bool cancelImmediately) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately); + } + + public static UniTask ToUniTask(this AssetBundleCreateRequest asyncOperation, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); + if (asyncOperation.isDone) return UniTask.FromResult(asyncOperation.assetBundle); + return new UniTask(AssetBundleCreateRequestConfiguredSource.Create(asyncOperation, timing, progress, cancellationToken, cancelImmediately, out var token), token); + } + + public struct AssetBundleCreateRequestAwaiter : ICriticalNotifyCompletion + { + AssetBundleCreateRequest asyncOperation; + Action continuationAction; + + public AssetBundleCreateRequestAwaiter(AssetBundleCreateRequest asyncOperation) + { + this.asyncOperation = asyncOperation; + this.continuationAction = null; + } + + public bool IsCompleted => asyncOperation.isDone; + + public AssetBundle GetResult() + { + if (continuationAction != null) + { + asyncOperation.completed -= continuationAction; + continuationAction = null; + var result = asyncOperation.assetBundle; + asyncOperation = null; + return result; + } + else + { + var result = asyncOperation.assetBundle; + asyncOperation = null; + return result; + } + } + + public void OnCompleted(Action continuation) + { + UnsafeOnCompleted(continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); + continuationAction = PooledDelegate.Create(continuation); + asyncOperation.completed += continuationAction; + } + } + + sealed class AssetBundleCreateRequestConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + AssetBundleCreateRequestConfiguredSource nextNode; + public ref AssetBundleCreateRequestConfiguredSource NextNode => ref nextNode; + + static AssetBundleCreateRequestConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(AssetBundleCreateRequestConfiguredSource), () => pool.Size); + } + + AssetBundleCreateRequest asyncOperation; + IProgress progress; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + bool completed; + + UniTaskCompletionSourceCore core; + + Action continuationAction; + + AssetBundleCreateRequestConfiguredSource() + { + continuationAction = Continuation; + } + + public static IUniTaskSource Create(AssetBundleCreateRequest asyncOperation, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new AssetBundleCreateRequestConfiguredSource(); + } + + result.asyncOperation = asyncOperation; + result.progress = progress; + result.cancellationToken = cancellationToken; + result.completed = false; + + asyncOperation.completed += result.continuationAction; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (AssetBundleCreateRequestConfiguredSource)state; + source.core.TrySetCanceled(source.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public AssetBundle GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + // Already completed + if (completed || asyncOperation == null) + { + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + return false; + } + + if (progress != null) + { + progress.Report(asyncOperation.progress); + } + + if (asyncOperation.isDone) + { + core.TrySetResult(asyncOperation.assetBundle); + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + asyncOperation.completed -= continuationAction; + asyncOperation = default; + progress = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + + void Continuation(AsyncOperation _) + { + if (completed) + { + TryReturn(); + } + else + { + completed = true; + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + } + else + { + core.TrySetResult(asyncOperation.assetBundle); + } + } + } + } + + #endregion +#endif + +#if ENABLE_UNITYWEBREQUEST && (!UNITY_2019_1_OR_NEWER || UNITASK_WEBREQUEST_SUPPORT) + #region UnityWebRequestAsyncOperation + + public static UnityWebRequestAsyncOperationAwaiter GetAwaiter(this UnityWebRequestAsyncOperation asyncOperation) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + return new UnityWebRequestAsyncOperationAwaiter(asyncOperation); + } + + public static UniTask WithCancellation(this UnityWebRequestAsyncOperation asyncOperation, CancellationToken cancellationToken) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken); + } + + public static UniTask WithCancellation(this UnityWebRequestAsyncOperation asyncOperation, CancellationToken cancellationToken, bool cancelImmediately) + { + return ToUniTask(asyncOperation, cancellationToken: cancellationToken, cancelImmediately: cancelImmediately); + } + + public static UniTask ToUniTask(this UnityWebRequestAsyncOperation asyncOperation, IProgress progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken), bool cancelImmediately = false) + { + Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation)); + if (cancellationToken.IsCancellationRequested) return UniTask.FromCanceled(cancellationToken); + if (asyncOperation.isDone) + { + if (asyncOperation.webRequest.IsError()) + { + return UniTask.FromException(new UnityWebRequestException(asyncOperation.webRequest)); + } + return UniTask.FromResult(asyncOperation.webRequest); + } + return new UniTask(UnityWebRequestAsyncOperationConfiguredSource.Create(asyncOperation, timing, progress, cancellationToken, cancelImmediately, out var token), token); + } + + public struct UnityWebRequestAsyncOperationAwaiter : ICriticalNotifyCompletion + { + UnityWebRequestAsyncOperation asyncOperation; + Action continuationAction; + + public UnityWebRequestAsyncOperationAwaiter(UnityWebRequestAsyncOperation asyncOperation) + { + this.asyncOperation = asyncOperation; + this.continuationAction = null; + } + + public bool IsCompleted => asyncOperation.isDone; + + public UnityWebRequest GetResult() + { + if (continuationAction != null) + { + asyncOperation.completed -= continuationAction; + continuationAction = null; + var result = asyncOperation.webRequest; + asyncOperation = null; + if (result.IsError()) + { + throw new UnityWebRequestException(result); + } + return result; + } + else + { + var result = asyncOperation.webRequest; + asyncOperation = null; + if (result.IsError()) + { + throw new UnityWebRequestException(result); + } + return result; + } + } + + public void OnCompleted(Action continuation) + { + UnsafeOnCompleted(continuation); + } + + public void UnsafeOnCompleted(Action continuation) + { + Error.ThrowWhenContinuationIsAlreadyRegistered(continuationAction); + continuationAction = PooledDelegate.Create(continuation); + asyncOperation.completed += continuationAction; + } + } + + sealed class UnityWebRequestAsyncOperationConfiguredSource : IUniTaskSource, IPlayerLoopItem, ITaskPoolNode + { + static TaskPool pool; + UnityWebRequestAsyncOperationConfiguredSource nextNode; + public ref UnityWebRequestAsyncOperationConfiguredSource NextNode => ref nextNode; + + static UnityWebRequestAsyncOperationConfiguredSource() + { + TaskPool.RegisterSizeGetter(typeof(UnityWebRequestAsyncOperationConfiguredSource), () => pool.Size); + } + + UnityWebRequestAsyncOperation asyncOperation; + IProgress progress; + CancellationToken cancellationToken; + CancellationTokenRegistration cancellationTokenRegistration; + bool completed; + + UniTaskCompletionSourceCore core; + + Action continuationAction; + + UnityWebRequestAsyncOperationConfiguredSource() + { + continuationAction = Continuation; + } + + public static IUniTaskSource Create(UnityWebRequestAsyncOperation asyncOperation, PlayerLoopTiming timing, IProgress progress, CancellationToken cancellationToken, bool cancelImmediately, out short token) + { + if (cancellationToken.IsCancellationRequested) + { + return AutoResetUniTaskCompletionSource.CreateFromCanceled(cancellationToken, out token); + } + + if (!pool.TryPop(out var result)) + { + result = new UnityWebRequestAsyncOperationConfiguredSource(); + } + + result.asyncOperation = asyncOperation; + result.progress = progress; + result.cancellationToken = cancellationToken; + result.completed = false; + + asyncOperation.completed += result.continuationAction; + + if (cancelImmediately && cancellationToken.CanBeCanceled) + { + result.cancellationTokenRegistration = cancellationToken.RegisterWithoutCaptureExecutionContext(state => + { + var source = (UnityWebRequestAsyncOperationConfiguredSource)state; + source.asyncOperation.webRequest.Abort(); + source.core.TrySetCanceled(source.cancellationToken); + }, result); + } + + TaskTracker.TrackActiveTask(result, 3); + + PlayerLoopHelper.AddAction(timing, result); + + token = result.core.Version; + return result; + } + + public UnityWebRequest GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + TryReturn(); + } + } + + void IUniTaskSource.GetResult(short token) + { + GetResult(token); + } + + public UniTaskStatus GetStatus(short token) + { + return core.GetStatus(token); + } + + public UniTaskStatus UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + public void OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + + public bool MoveNext() + { + // Already completed + if (completed || asyncOperation == null) + { + return false; + } + + if (cancellationToken.IsCancellationRequested) + { + asyncOperation.webRequest.Abort(); + core.TrySetCanceled(cancellationToken); + return false; + } + + if (progress != null) + { + progress.Report(asyncOperation.progress); + } + + if (asyncOperation.isDone) + { + if (asyncOperation.webRequest.IsError()) + { + core.TrySetException(new UnityWebRequestException(asyncOperation.webRequest)); + } + else + { + core.TrySetResult(asyncOperation.webRequest); + } + return false; + } + + return true; + } + + bool TryReturn() + { + TaskTracker.RemoveTracking(this); + core.Reset(); + asyncOperation.completed -= continuationAction; + asyncOperation = default; + progress = default; + cancellationToken = default; + cancellationTokenRegistration.Dispose(); + return pool.TryPush(this); + } + + void Continuation(AsyncOperation _) + { + if (completed) + { + TryReturn(); + } + else + { + completed = true; + if (cancellationToken.IsCancellationRequested) + { + core.TrySetCanceled(cancellationToken); + } + else if (asyncOperation.webRequest.IsError()) + { + core.TrySetException(new UnityWebRequestException(asyncOperation.webRequest)); + } + else + { + core.TrySetResult(asyncOperation.webRequest); + } + } + } + } + + #endregion +#endif + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs.meta new file mode 100644 index 00000000..6dfab815 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8cc7fd65dd1433e419be4764aeb51391 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs new file mode 100644 index 00000000..7f1a90c7 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs @@ -0,0 +1,858 @@ +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT +using System; +using System.Threading; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.UI; + +namespace Cysharp.Threading.Tasks +{ + public static partial class UnityAsyncExtensions + { + public static AsyncUnityEventHandler GetAsyncEventHandler(this UnityEvent unityEvent, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(unityEvent, cancellationToken, false); + } + + public static UniTask OnInvokeAsync(this UnityEvent unityEvent, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(unityEvent, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnInvokeAsAsyncEnumerable(this UnityEvent unityEvent, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(unityEvent, cancellationToken); + } + + public static AsyncUnityEventHandler GetAsyncEventHandler(this UnityEvent unityEvent, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(unityEvent, cancellationToken, false); + } + + public static UniTask OnInvokeAsync(this UnityEvent unityEvent, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(unityEvent, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnInvokeAsAsyncEnumerable(this UnityEvent unityEvent, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(unityEvent, cancellationToken); + } + + public static IAsyncClickEventHandler GetAsyncClickEventHandler(this Button button) + { + return new AsyncUnityEventHandler(button.onClick, button.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncClickEventHandler GetAsyncClickEventHandler(this Button button, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(button.onClick, cancellationToken, false); + } + + public static UniTask OnClickAsync(this Button button) + { + return new AsyncUnityEventHandler(button.onClick, button.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnClickAsync(this Button button, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(button.onClick, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnClickAsAsyncEnumerable(this Button button) + { + return new UnityEventHandlerAsyncEnumerable(button.onClick, button.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnClickAsAsyncEnumerable(this Button button, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(button.onClick, cancellationToken); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Toggle toggle) + { + return new AsyncUnityEventHandler(toggle.onValueChanged, toggle.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Toggle toggle, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(toggle.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this Toggle toggle) + { + return new AsyncUnityEventHandler(toggle.onValueChanged, toggle.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this Toggle toggle, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(toggle.onValueChanged, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this Toggle toggle) + { + return new UnityEventHandlerAsyncEnumerable(toggle.onValueChanged, toggle.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this Toggle toggle, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(toggle.onValueChanged, cancellationToken); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Scrollbar scrollbar) + { + return new AsyncUnityEventHandler(scrollbar.onValueChanged, scrollbar.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Scrollbar scrollbar, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(scrollbar.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this Scrollbar scrollbar) + { + return new AsyncUnityEventHandler(scrollbar.onValueChanged, scrollbar.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this Scrollbar scrollbar, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(scrollbar.onValueChanged, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this Scrollbar scrollbar) + { + return new UnityEventHandlerAsyncEnumerable(scrollbar.onValueChanged, scrollbar.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this Scrollbar scrollbar, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(scrollbar.onValueChanged, cancellationToken); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this ScrollRect scrollRect) + { + return new AsyncUnityEventHandler(scrollRect.onValueChanged, scrollRect.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this ScrollRect scrollRect, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(scrollRect.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this ScrollRect scrollRect) + { + return new AsyncUnityEventHandler(scrollRect.onValueChanged, scrollRect.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this ScrollRect scrollRect, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(scrollRect.onValueChanged, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this ScrollRect scrollRect) + { + return new UnityEventHandlerAsyncEnumerable(scrollRect.onValueChanged, scrollRect.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this ScrollRect scrollRect, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(scrollRect.onValueChanged, cancellationToken); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Slider slider) + { + return new AsyncUnityEventHandler(slider.onValueChanged, slider.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Slider slider, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(slider.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this Slider slider) + { + return new AsyncUnityEventHandler(slider.onValueChanged, slider.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this Slider slider, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(slider.onValueChanged, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this Slider slider) + { + return new UnityEventHandlerAsyncEnumerable(slider.onValueChanged, slider.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this Slider slider, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(slider.onValueChanged, cancellationToken); + } + + public static IAsyncEndEditEventHandler GetAsyncEndEditEventHandler(this InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncEndEditEventHandler GetAsyncEndEditEventHandler(this InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, cancellationToken, false); + } + + public static UniTask OnEndEditAsync(this InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnEndEditAsync(this InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onEndEdit, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnEndEditAsAsyncEnumerable(this InputField inputField) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onEndEdit, inputField.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnEndEditAsAsyncEnumerable(this InputField inputField, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onEndEdit, cancellationToken); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onValueChanged, inputField.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this InputField inputField) + { + return new AsyncUnityEventHandler(inputField.onValueChanged, inputField.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this InputField inputField, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(inputField.onValueChanged, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this InputField inputField) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onValueChanged, inputField.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this InputField inputField, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(inputField.onValueChanged, cancellationToken); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Dropdown dropdown) + { + return new AsyncUnityEventHandler(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy(), false); + } + + public static IAsyncValueChangedEventHandler GetAsyncValueChangedEventHandler(this Dropdown dropdown, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(dropdown.onValueChanged, cancellationToken, false); + } + + public static UniTask OnValueChangedAsync(this Dropdown dropdown) + { + return new AsyncUnityEventHandler(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy(), true).OnInvokeAsync(); + } + + public static UniTask OnValueChangedAsync(this Dropdown dropdown, CancellationToken cancellationToken) + { + return new AsyncUnityEventHandler(dropdown.onValueChanged, cancellationToken, true).OnInvokeAsync(); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this Dropdown dropdown) + { + return new UnityEventHandlerAsyncEnumerable(dropdown.onValueChanged, dropdown.GetCancellationTokenOnDestroy()); + } + + public static IUniTaskAsyncEnumerable OnValueChangedAsAsyncEnumerable(this Dropdown dropdown, CancellationToken cancellationToken) + { + return new UnityEventHandlerAsyncEnumerable(dropdown.onValueChanged, cancellationToken); + } + } + + public interface IAsyncClickEventHandler : IDisposable + { + UniTask OnClickAsync(); + } + + public interface IAsyncValueChangedEventHandler : IDisposable + { + UniTask OnValueChangedAsync(); + } + + public interface IAsyncEndEditEventHandler : IDisposable + { + UniTask OnEndEditAsync(); + } + + // for TMP_PRO + + public interface IAsyncEndTextSelectionEventHandler : IDisposable + { + UniTask OnEndTextSelectionAsync(); + } + + public interface IAsyncTextSelectionEventHandler : IDisposable + { + UniTask OnTextSelectionAsync(); + } + + public interface IAsyncDeselectEventHandler : IDisposable + { + UniTask OnDeselectAsync(); + } + + public interface IAsyncSelectEventHandler : IDisposable + { + UniTask OnSelectAsync(); + } + + public interface IAsyncSubmitEventHandler : IDisposable + { + UniTask OnSubmitAsync(); + } + + internal class TextSelectionEventConverter : UnityEvent<(string, int, int)>, IDisposable + { + readonly UnityEvent innerEvent; + readonly UnityAction invokeDelegate; + + + public TextSelectionEventConverter(UnityEvent unityEvent) + { + this.innerEvent = unityEvent; + this.invokeDelegate = InvokeCore; + + innerEvent.AddListener(invokeDelegate); + } + + void InvokeCore(string item1, int item2, int item3) + { + innerEvent.Invoke(item1, item2, item3); + } + + public void Dispose() + { + innerEvent.RemoveListener(invokeDelegate); + } + } + + public class AsyncUnityEventHandler : IUniTaskSource, IDisposable, IAsyncClickEventHandler + { + static Action cancellationCallback = CancellationCallback; + + readonly UnityAction action; + readonly UnityEvent unityEvent; + + CancellationToken cancellationToken; + CancellationTokenRegistration registration; + bool isDisposed; + bool callOnce; + + UniTaskCompletionSourceCore core; + + public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancellationToken, bool callOnce) + { + this.cancellationToken = cancellationToken; + if (cancellationToken.IsCancellationRequested) + { + isDisposed = true; + return; + } + + this.action = Invoke; + this.unityEvent = unityEvent; + this.callOnce = callOnce; + + unityEvent.AddListener(action); + + if (cancellationToken.CanBeCanceled) + { + registration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); + } + + TaskTracker.TrackActiveTask(this, 3); + } + + public UniTask OnInvokeAsync() + { + core.Reset(); + if (isDisposed) + { + core.TrySetCanceled(this.cancellationToken); + } + return new UniTask(this, core.Version); + } + + void Invoke() + { + core.TrySetResult(AsyncUnit.Default); + } + + static void CancellationCallback(object state) + { + var self = (AsyncUnityEventHandler)state; + self.Dispose(); + } + + public void Dispose() + { + if (!isDisposed) + { + isDisposed = true; + TaskTracker.RemoveTracking(this); + registration.Dispose(); + if (unityEvent != null) + { + unityEvent.RemoveListener(action); + } + core.TrySetCanceled(cancellationToken); + } + } + + UniTask IAsyncClickEventHandler.OnClickAsync() + { + return OnInvokeAsync(); + } + + void IUniTaskSource.GetResult(short token) + { + try + { + core.GetResult(token); + } + finally + { + if (callOnce) + { + Dispose(); + } + } + } + + UniTaskStatus IUniTaskSource.GetStatus(short token) + { + return core.GetStatus(token); + } + + UniTaskStatus IUniTaskSource.UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public class AsyncUnityEventHandler : IUniTaskSource, IDisposable, IAsyncValueChangedEventHandler, IAsyncEndEditEventHandler + , IAsyncEndTextSelectionEventHandler, IAsyncTextSelectionEventHandler, IAsyncDeselectEventHandler, IAsyncSelectEventHandler, IAsyncSubmitEventHandler + { + static Action cancellationCallback = CancellationCallback; + + readonly UnityAction action; + readonly UnityEvent unityEvent; + + CancellationToken cancellationToken; + CancellationTokenRegistration registration; + bool isDisposed; + bool callOnce; + + UniTaskCompletionSourceCore core; + + public AsyncUnityEventHandler(UnityEvent unityEvent, CancellationToken cancellationToken, bool callOnce) + { + this.cancellationToken = cancellationToken; + if (cancellationToken.IsCancellationRequested) + { + isDisposed = true; + return; + } + + this.action = Invoke; + this.unityEvent = unityEvent; + this.callOnce = callOnce; + + unityEvent.AddListener(action); + + if (cancellationToken.CanBeCanceled) + { + registration = cancellationToken.RegisterWithoutCaptureExecutionContext(cancellationCallback, this); + } + + TaskTracker.TrackActiveTask(this, 3); + } + + public UniTask OnInvokeAsync() + { + core.Reset(); + if (isDisposed) + { + core.TrySetCanceled(this.cancellationToken); + } + return new UniTask(this, core.Version); + } + + void Invoke(T result) + { + core.TrySetResult(result); + } + + static void CancellationCallback(object state) + { + var self = (AsyncUnityEventHandler)state; + self.Dispose(); + } + + public void Dispose() + { + if (!isDisposed) + { + isDisposed = true; + TaskTracker.RemoveTracking(this); + registration.Dispose(); + if (unityEvent != null) + { + // Dispose inner delegate for TextSelectionEventConverter + if (unityEvent is IDisposable disp) + { + disp.Dispose(); + } + + unityEvent.RemoveListener(action); + } + + core.TrySetCanceled(); + } + } + + UniTask IAsyncValueChangedEventHandler.OnValueChangedAsync() + { + return OnInvokeAsync(); + } + + UniTask IAsyncEndEditEventHandler.OnEndEditAsync() + { + return OnInvokeAsync(); + } + + UniTask IAsyncEndTextSelectionEventHandler.OnEndTextSelectionAsync() + { + return OnInvokeAsync(); + } + + UniTask IAsyncTextSelectionEventHandler.OnTextSelectionAsync() + { + return OnInvokeAsync(); + } + + UniTask IAsyncDeselectEventHandler.OnDeselectAsync() + { + return OnInvokeAsync(); + } + + UniTask IAsyncSelectEventHandler.OnSelectAsync() + { + return OnInvokeAsync(); + } + + UniTask IAsyncSubmitEventHandler.OnSubmitAsync() + { + return OnInvokeAsync(); + } + + T IUniTaskSource.GetResult(short token) + { + try + { + return core.GetResult(token); + } + finally + { + if (callOnce) + { + Dispose(); + } + } + } + + void IUniTaskSource.GetResult(short token) + { + ((IUniTaskSource)this).GetResult(token); + } + + UniTaskStatus IUniTaskSource.GetStatus(short token) + { + return core.GetStatus(token); + } + + UniTaskStatus IUniTaskSource.UnsafeGetStatus() + { + return core.UnsafeGetStatus(); + } + + void IUniTaskSource.OnCompleted(Action continuation, object state, short token) + { + core.OnCompleted(continuation, state, token); + } + } + + public class UnityEventHandlerAsyncEnumerable : IUniTaskAsyncEnumerable + { + readonly UnityEvent unityEvent; + readonly CancellationToken cancellationToken1; + + public UnityEventHandlerAsyncEnumerable(UnityEvent unityEvent, CancellationToken cancellationToken) + { + this.unityEvent = unityEvent; + this.cancellationToken1 = cancellationToken; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + if (this.cancellationToken1 == cancellationToken) + { + return new UnityEventHandlerAsyncEnumerator(unityEvent, this.cancellationToken1, CancellationToken.None); + } + else + { + return new UnityEventHandlerAsyncEnumerator(unityEvent, this.cancellationToken1, cancellationToken); + } + } + + class UnityEventHandlerAsyncEnumerator : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action cancel1 = OnCanceled1; + static readonly Action cancel2 = OnCanceled2; + + readonly UnityEvent unityEvent; + CancellationToken cancellationToken1; + CancellationToken cancellationToken2; + + UnityAction unityAction; + CancellationTokenRegistration registration1; + CancellationTokenRegistration registration2; + bool isDisposed; + + public UnityEventHandlerAsyncEnumerator(UnityEvent unityEvent, CancellationToken cancellationToken1, CancellationToken cancellationToken2) + { + this.unityEvent = unityEvent; + this.cancellationToken1 = cancellationToken1; + this.cancellationToken2 = cancellationToken2; + } + + public AsyncUnit Current => default; + + public UniTask MoveNextAsync() + { + cancellationToken1.ThrowIfCancellationRequested(); + cancellationToken2.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (unityAction == null) + { + unityAction = Invoke; + + TaskTracker.TrackActiveTask(this, 3); + unityEvent.AddListener(unityAction); + if (cancellationToken1.CanBeCanceled) + { + registration1 = cancellationToken1.RegisterWithoutCaptureExecutionContext(cancel1, this); + } + if (cancellationToken2.CanBeCanceled) + { + registration2 = cancellationToken2.RegisterWithoutCaptureExecutionContext(cancel2, this); + } + } + + return new UniTask(this, completionSource.Version); + } + + void Invoke() + { + completionSource.TrySetResult(true); + } + + static void OnCanceled1(object state) + { + var self = (UnityEventHandlerAsyncEnumerator)state; + try + { + self.completionSource.TrySetCanceled(self.cancellationToken1); + } + finally + { + self.DisposeAsync().Forget(); + } + } + + static void OnCanceled2(object state) + { + var self = (UnityEventHandlerAsyncEnumerator)state; + try + { + self.completionSource.TrySetCanceled(self.cancellationToken2); + } + finally + { + self.DisposeAsync().Forget(); + } + } + + public UniTask DisposeAsync() + { + if (!isDisposed) + { + isDisposed = true; + TaskTracker.RemoveTracking(this); + registration1.Dispose(); + registration2.Dispose(); + unityEvent.RemoveListener(unityAction); + + completionSource.TrySetCanceled(); + } + + return default; + } + } + } + + public class UnityEventHandlerAsyncEnumerable : IUniTaskAsyncEnumerable + { + readonly UnityEvent unityEvent; + readonly CancellationToken cancellationToken1; + + public UnityEventHandlerAsyncEnumerable(UnityEvent unityEvent, CancellationToken cancellationToken) + { + this.unityEvent = unityEvent; + this.cancellationToken1 = cancellationToken; + } + + public IUniTaskAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + if (this.cancellationToken1 == cancellationToken) + { + return new UnityEventHandlerAsyncEnumerator(unityEvent, this.cancellationToken1, CancellationToken.None); + } + else + { + return new UnityEventHandlerAsyncEnumerator(unityEvent, this.cancellationToken1, cancellationToken); + } + } + + class UnityEventHandlerAsyncEnumerator : MoveNextSource, IUniTaskAsyncEnumerator + { + static readonly Action cancel1 = OnCanceled1; + static readonly Action cancel2 = OnCanceled2; + + readonly UnityEvent unityEvent; + CancellationToken cancellationToken1; + CancellationToken cancellationToken2; + + UnityAction unityAction; + CancellationTokenRegistration registration1; + CancellationTokenRegistration registration2; + bool isDisposed; + + public UnityEventHandlerAsyncEnumerator(UnityEvent unityEvent, CancellationToken cancellationToken1, CancellationToken cancellationToken2) + { + this.unityEvent = unityEvent; + this.cancellationToken1 = cancellationToken1; + this.cancellationToken2 = cancellationToken2; + } + + public T Current { get; private set; } + + public UniTask MoveNextAsync() + { + cancellationToken1.ThrowIfCancellationRequested(); + cancellationToken2.ThrowIfCancellationRequested(); + completionSource.Reset(); + + if (unityAction == null) + { + unityAction = Invoke; + + TaskTracker.TrackActiveTask(this, 3); + unityEvent.AddListener(unityAction); + if (cancellationToken1.CanBeCanceled) + { + registration1 = cancellationToken1.RegisterWithoutCaptureExecutionContext(cancel1, this); + } + if (cancellationToken2.CanBeCanceled) + { + registration2 = cancellationToken2.RegisterWithoutCaptureExecutionContext(cancel2, this); + } + } + + return new UniTask(this, completionSource.Version); + } + + void Invoke(T value) + { + Current = value; + completionSource.TrySetResult(true); + } + + static void OnCanceled1(object state) + { + var self = (UnityEventHandlerAsyncEnumerator)state; + try + { + self.completionSource.TrySetCanceled(self.cancellationToken1); + } + finally + { + self.DisposeAsync().Forget(); + } + } + + static void OnCanceled2(object state) + { + var self = (UnityEventHandlerAsyncEnumerator)state; + try + { + self.completionSource.TrySetCanceled(self.cancellationToken2); + } + finally + { + self.DisposeAsync().Forget(); + } + } + + public UniTask DisposeAsync() + { + if (!isDisposed) + { + isDisposed = true; + TaskTracker.RemoveTracking(this); + registration1.Dispose(); + registration2.Dispose(); + if (unityEvent is IDisposable disp) + { + disp.Dispose(); + } + unityEvent.RemoveListener(unityAction); + + completionSource.TrySetCanceled(); + } + + return default; + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs.meta new file mode 100644 index 00000000..90c5d515 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAsyncExtensions.uGUI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6804799fba2376d4099561d176101aff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAwaitableExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAwaitableExtensions.cs new file mode 100644 index 00000000..4580da3a --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAwaitableExtensions.cs @@ -0,0 +1,17 @@ +#if UNITY_2023_1_OR_NEWER +namespace Cysharp.Threading.Tasks +{ + public static class UnityAwaitableExtensions + { + public static async UniTask AsUniTask(this UnityEngine.Awaitable awaitable) + { + await awaitable; + } + + public static async UniTask AsUniTask(this UnityEngine.Awaitable awaitable) + { + return await awaitable; + } + } +} +#endif diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAwaitableExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAwaitableExtensions.cs.meta new file mode 100644 index 00000000..08752a42 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityAwaitableExtensions.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c29533c9e4284dee914b71a6579ea274 +timeCreated: 1698895807 \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs new file mode 100644 index 00000000..269fee2b --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs @@ -0,0 +1,245 @@ +using System; +using System.Threading; +using UnityEngine; +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT +using UnityEngine.UI; +#endif + +namespace Cysharp.Threading.Tasks +{ + public static class UnityBindingExtensions + { +#if !UNITY_2019_1_OR_NEWER || UNITASK_UGUI_SUPPORT + // -> Text + + public static void BindTo(this IUniTaskAsyncEnumerable source, UnityEngine.UI.Text text, bool rebindOnError = true) + { + BindToCore(source, text, text.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); + } + + public static void BindTo(this IUniTaskAsyncEnumerable source, UnityEngine.UI.Text text, CancellationToken cancellationToken, bool rebindOnError = true) + { + BindToCore(source, text, cancellationToken, rebindOnError).Forget(); + } + + static async UniTaskVoid BindToCore(IUniTaskAsyncEnumerable source, UnityEngine.UI.Text text, CancellationToken cancellationToken, bool rebindOnError) + { + var repeat = false; + BIND_AGAIN: + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (true) + { + bool moveNext; + try + { + moveNext = await e.MoveNextAsync(); + repeat = false; + } + catch (Exception ex) + { + if (ex is OperationCanceledException) return; + + if (rebindOnError && !repeat) + { + repeat = true; + goto BIND_AGAIN; + } + else + { + throw; + } + } + + if (!moveNext) return; + + text.text = e.Current; + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + // -> Text + + public static void BindTo(this IUniTaskAsyncEnumerable source, UnityEngine.UI.Text text, bool rebindOnError = true) + { + BindToCore(source, text, text.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); + } + + public static void BindTo(this IUniTaskAsyncEnumerable source, UnityEngine.UI.Text text, CancellationToken cancellationToken, bool rebindOnError = true) + { + BindToCore(source, text, cancellationToken, rebindOnError).Forget(); + } + + public static void BindTo(this AsyncReactiveProperty source, UnityEngine.UI.Text text, bool rebindOnError = true) + { + BindToCore(source, text, text.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); + } + + static async UniTaskVoid BindToCore(IUniTaskAsyncEnumerable source, UnityEngine.UI.Text text, CancellationToken cancellationToken, bool rebindOnError) + { + var repeat = false; + BIND_AGAIN: + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (true) + { + bool moveNext; + try + { + moveNext = await e.MoveNextAsync(); + repeat = false; + } + catch (Exception ex) + { + if (ex is OperationCanceledException) return; + + if (rebindOnError && !repeat) + { + repeat = true; + goto BIND_AGAIN; + } + else + { + throw; + } + } + + if (!moveNext) return; + + text.text = e.Current.ToString(); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + + // -> Selectable + + public static void BindTo(this IUniTaskAsyncEnumerable source, Selectable selectable, bool rebindOnError = true) + { + BindToCore(source, selectable, selectable.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); + } + + public static void BindTo(this IUniTaskAsyncEnumerable source, Selectable selectable, CancellationToken cancellationToken, bool rebindOnError = true) + { + BindToCore(source, selectable, cancellationToken, rebindOnError).Forget(); + } + + static async UniTaskVoid BindToCore(IUniTaskAsyncEnumerable source, Selectable selectable, CancellationToken cancellationToken, bool rebindOnError) + { + var repeat = false; + BIND_AGAIN: + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (true) + { + bool moveNext; + try + { + moveNext = await e.MoveNextAsync(); + repeat = false; + } + catch (Exception ex) + { + if (ex is OperationCanceledException) return; + + if (rebindOnError && !repeat) + { + repeat = true; + goto BIND_AGAIN; + } + else + { + throw; + } + } + + if (!moveNext) return; + + + selectable.interactable = e.Current; + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } +#endif + + // -> Action + + public static void BindTo(this IUniTaskAsyncEnumerable source, TObject monoBehaviour, Action bindAction, bool rebindOnError = true) + where TObject : MonoBehaviour + { + BindToCore(source, monoBehaviour, bindAction, monoBehaviour.GetCancellationTokenOnDestroy(), rebindOnError).Forget(); + } + + public static void BindTo(this IUniTaskAsyncEnumerable source, TObject bindTarget, Action bindAction, CancellationToken cancellationToken, bool rebindOnError = true) + { + BindToCore(source, bindTarget, bindAction, cancellationToken, rebindOnError).Forget(); + } + + static async UniTaskVoid BindToCore(IUniTaskAsyncEnumerable source, TObject bindTarget, Action bindAction, CancellationToken cancellationToken, bool rebindOnError) + { + var repeat = false; + BIND_AGAIN: + var e = source.GetAsyncEnumerator(cancellationToken); + try + { + while (true) + { + bool moveNext; + try + { + moveNext = await e.MoveNextAsync(); + repeat = false; + } + catch (Exception ex) + { + if (ex is OperationCanceledException) return; + + if (rebindOnError && !repeat) + { + repeat = true; + goto BIND_AGAIN; + } + else + { + throw; + } + } + + if (!moveNext) return; + + bindAction(bindTarget, e.Current); + } + } + finally + { + if (e != null) + { + await e.DisposeAsync(); + } + } + } + } +} diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs.meta new file mode 100644 index 00000000..3fae798e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityBindingExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 090b20e3528552b4a8d751f7df525c2b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs new file mode 100644 index 00000000..95857694 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs @@ -0,0 +1,67 @@ +#if ENABLE_UNITYWEBREQUEST && (!UNITY_2019_1_OR_NEWER || UNITASK_WEBREQUEST_SUPPORT) + +using System; +using System.Collections.Generic; +using UnityEngine.Networking; + +namespace Cysharp.Threading.Tasks +{ + public class UnityWebRequestException : Exception + { + public UnityWebRequest UnityWebRequest { get; } +#if UNITY_2020_2_OR_NEWER + public UnityWebRequest.Result Result { get; } +#else + public bool IsNetworkError { get; } + public bool IsHttpError { get; } +#endif + public string Error { get; } + public string Text { get; } + public long ResponseCode { get; } + public Dictionary ResponseHeaders { get; } + + string msg; + + public UnityWebRequestException(UnityWebRequest unityWebRequest) + { + this.UnityWebRequest = unityWebRequest; +#if UNITY_2020_2_OR_NEWER + this.Result = unityWebRequest.result; +#else + this.IsNetworkError = unityWebRequest.isNetworkError; + this.IsHttpError = unityWebRequest.isHttpError; +#endif + this.Error = unityWebRequest.error; + this.ResponseCode = unityWebRequest.responseCode; + if (UnityWebRequest.downloadHandler != null) + { + if (unityWebRequest.downloadHandler is DownloadHandlerBuffer dhb) + { + this.Text = dhb.text; + } + } + this.ResponseHeaders = unityWebRequest.GetResponseHeaders(); + } + + public override string Message + { + get + { + if (msg == null) + { + if(!string.IsNullOrWhiteSpace(Text)) + { + msg = Error + Environment.NewLine + Text; + } + else + { + msg = Error; + } + } + return msg; + } + } + } +} + +#endif \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs.meta new file mode 100644 index 00000000..50c475e8 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/UnityWebRequestException.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 013a499e522703a42962a779b4d9850c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/_InternalVisibleTo.cs b/JNFrame/Assets/Plugins/UniTask/Runtime/_InternalVisibleTo.cs new file mode 100644 index 00000000..ab7c10c9 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/_InternalVisibleTo.cs @@ -0,0 +1,6 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("UniTask.Linq")] +[assembly: InternalsVisibleTo("UniTask.Addressables")] +[assembly: InternalsVisibleTo("UniTask.DOTween")] +[assembly: InternalsVisibleTo("UniTask.TextMeshPro")] \ No newline at end of file diff --git a/JNFrame/Assets/Plugins/UniTask/Runtime/_InternalVisibleTo.cs.meta b/JNFrame/Assets/Plugins/UniTask/Runtime/_InternalVisibleTo.cs.meta new file mode 100644 index 00000000..2ec6cd36 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/Runtime/_InternalVisibleTo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8507e97eb606fad4b99c6edf92e19cb8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Plugins/UniTask/package.json b/JNFrame/Assets/Plugins/UniTask/package.json new file mode 100644 index 00000000..84b5b0a3 --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/package.json @@ -0,0 +1,12 @@ +{ + "name": "com.cysharp.unitask", + "displayName": "UniTask", + "author": { "name": "Cysharp, Inc.", "url": "https://cysharp.co.jp/en/" }, + "version": "2.5.0", + "unity": "2018.4", + "description": "Provides an efficient async/await integration to Unity.", + "keywords": [ "async/await", "async", "Task", "UniTask" ], + "license": "MIT", + "category": "Task", + "dependencies": {} +} diff --git a/JNFrame/Assets/Plugins/UniTask/package.json.meta b/JNFrame/Assets/Plugins/UniTask/package.json.meta new file mode 100644 index 00000000..65439e6e --- /dev/null +++ b/JNFrame/Assets/Plugins/UniTask/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d1a9a71f68bb0d04db91ddaa3329abf9 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Resources.meta b/JNFrame/Assets/Resources.meta new file mode 100644 index 00000000..88f57978 --- /dev/null +++ b/JNFrame/Assets/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3fb1a9803a5db88478a887ab9529cb94 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Scenes.meta b/JNFrame/Assets/Scenes.meta new file mode 100644 index 00000000..c95fd45e --- /dev/null +++ b/JNFrame/Assets/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9e21a189fdbf0f14e8006a71142ecb32 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Scenes/Main.unity b/JNFrame/Assets/Scenes/Main.unity new file mode 100644 index 00000000..85114b90 --- /dev/null +++ b/JNFrame/Assets/Scenes/Main.unity @@ -0,0 +1,169 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &905065527 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 905065528} + - component: {fileID: 905065529} + m_Layer: 0 + m_Name: Main + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &905065528 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 905065527} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &905065529 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 905065527} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 00b2d35a0698b224fa03e09bed92aac7, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/JNFrame/Assets/Scenes/Main.unity.meta b/JNFrame/Assets/Scenes/Main.unity.meta new file mode 100644 index 00000000..952bd1e9 --- /dev/null +++ b/JNFrame/Assets/Scenes/Main.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9fc0d4010bbf28b4594072e72b8655ab +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Scenes/UIScene.unity b/JNFrame/Assets/Scenes/UIScene.unity new file mode 100644 index 00000000..157dffd6 --- /dev/null +++ b/JNFrame/Assets/Scenes/UIScene.unity @@ -0,0 +1,620 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &121702108 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 121702109} + - component: {fileID: 121702111} + - component: {fileID: 121702110} + m_Layer: 5 + m_Name: Text (Legacy) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &121702109 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 121702108} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2008468464} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &121702110 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 121702108} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Button +--- !u!222 &121702111 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 121702108} + m_CullTransparentMesh: 1 +--- !u!1 &878636052 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 878636056} + - component: {fileID: 878636055} + - component: {fileID: 878636054} + - component: {fileID: 878636053} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &878636053 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 878636052} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &878636054 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 878636052} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &878636055 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 878636052} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &878636056 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 878636052} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2008468464} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &923265418 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 923265421} + - component: {fileID: 923265420} + m_Layer: 5 + m_Name: Camera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!20 &923265420 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 923265418} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 3 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!224 &923265421 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 923265418} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 197.5, y: 257} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1035522521 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1035522524} + - component: {fileID: 1035522523} + - component: {fileID: 1035522522} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1035522522 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1035522521} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &1035522523 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1035522521} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &1035522524 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1035522521} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1911778720 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1911778722} + - component: {fileID: 1911778721} + m_Layer: 0 + m_Name: Main + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1911778721 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1911778720} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b87c4476f7ad6954e91fa3172d2b723a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1911778722 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1911778720} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &2008468463 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2008468464} + - component: {fileID: 2008468467} + - component: {fileID: 2008468466} + - component: {fileID: 2008468465} + m_Layer: 5 + m_Name: Button (Legacy) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2008468464 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008468463} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 121702109} + m_Father: {fileID: 878636056} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 50} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2008468465 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008468463} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2008468466} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &2008468466 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008468463} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &2008468467 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008468463} + m_CullTransparentMesh: 1 diff --git a/JNFrame/Assets/Scenes/UIScene.unity.meta b/JNFrame/Assets/Scenes/UIScene.unity.meta new file mode 100644 index 00000000..64eddebd --- /dev/null +++ b/JNFrame/Assets/Scenes/UIScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 786aa53c6477525459c2f878d3c43a13 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Scenes/WorldScene.unity b/JNFrame/Assets/Scenes/WorldScene.unity new file mode 100644 index 00000000..f473ba43 --- /dev/null +++ b/JNFrame/Assets/Scenes/WorldScene.unity @@ -0,0 +1,553 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1169397908 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1169397911} + - component: {fileID: 1169397910} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!20 &1169397910 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1169397908} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1169397911 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1169397908} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1347472972 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1347472974} + - component: {fileID: 1347472973} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &1347472973 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1347472972} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &1347472974 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1347472972} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!1 &1489866731 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1489866735} + - component: {fileID: 1489866734} + - component: {fileID: 1489866733} + - component: {fileID: 1489866732} + - component: {fileID: 1489866736} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1489866732 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489866731} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1489866733 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489866731} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1489866734 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489866731} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1489866735 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489866731} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 30, y: 1, z: 30} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &1489866736 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1489866731} + serializedVersion: 2 + m_Mass: 0.5 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 0 + m_IsKinematic: 1 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 +--- !u!1 &1538924695 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1538924697} + m_Layer: 0 + m_Name: GMode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1538924697 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1538924695} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1874648403 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1874648407} + - component: {fileID: 1874648406} + - component: {fileID: 1874648405} + - component: {fileID: 1874648404} + - component: {fileID: 1874648408} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &1874648404 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1874648403} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1874648405 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1874648403} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1874648406 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1874648403} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1874648407 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1874648403} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 6.03, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!54 &1874648408 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1874648403} + serializedVersion: 2 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 diff --git a/JNFrame/Assets/Scenes/WorldScene.unity.meta b/JNFrame/Assets/Scenes/WorldScene.unity.meta new file mode 100644 index 00000000..17c54127 --- /dev/null +++ b/JNFrame/Assets/Scenes/WorldScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9249f4afb3db3c4489d1a29ea88a2f1c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Script.meta b/JNFrame/Assets/Script.meta new file mode 100644 index 00000000..5110dc41 --- /dev/null +++ b/JNFrame/Assets/Script.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21fa98a3b7cf66c49bb5a2e98a16f335 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Script/App.cs b/JNFrame/Assets/Script/App.cs new file mode 100644 index 00000000..193c9ef2 --- /dev/null +++ b/JNFrame/Assets/Script/App.cs @@ -0,0 +1,22 @@ +using Plugins.JNGame.System; +using Script.AppImpl; + +namespace Script +{ + public static class App + { + + public static JNGSocket Socket = new JNGSocket(); + public static JNGSyncFrame Sync = new JNGSyncFrame(); + + public static SystemBase[] System() + { + return new SystemBase[] + { + Socket, + Sync + }; + } + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Script/App.cs.meta b/JNFrame/Assets/Script/App.cs.meta new file mode 100644 index 00000000..f20d75b2 --- /dev/null +++ b/JNFrame/Assets/Script/App.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 41bc0098f83045f18891ef5190ac6a17 +timeCreated: 1705981534 \ No newline at end of file diff --git a/JNFrame/Assets/Script/AppImpl.meta b/JNFrame/Assets/Script/AppImpl.meta new file mode 100644 index 00000000..3e60d0d6 --- /dev/null +++ b/JNFrame/Assets/Script/AppImpl.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4d1dd27990674b32820075e52dcbda67 +timeCreated: 1705993098 \ No newline at end of file diff --git a/JNFrame/Assets/Script/AppImpl/JNGSocket.cs b/JNFrame/Assets/Script/AppImpl/JNGSocket.cs new file mode 100644 index 00000000..a40e8883 --- /dev/null +++ b/JNFrame/Assets/Script/AppImpl/JNGSocket.cs @@ -0,0 +1,14 @@ +using System.Threading.Tasks; +using Cysharp.Threading.Tasks; +using Plugins.JNGame.Network; + +namespace Script.AppImpl +{ + public class JNGSocket : JNSocket + { + protected override async UniTask GetUrl() + { + return "ws://localhost:8080/websocket"; + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Script/AppImpl/JNGSocket.cs.meta b/JNFrame/Assets/Script/AppImpl/JNGSocket.cs.meta new file mode 100644 index 00000000..d996b52c --- /dev/null +++ b/JNFrame/Assets/Script/AppImpl/JNGSocket.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6018b3436d0447f18eb907f86db6504e +timeCreated: 1705993176 \ No newline at end of file diff --git a/JNFrame/Assets/Script/AppImpl/JNGSyncFrame.cs b/JNFrame/Assets/Script/AppImpl/JNGSyncFrame.cs new file mode 100644 index 00000000..357d65bd --- /dev/null +++ b/JNFrame/Assets/Script/AppImpl/JNGSyncFrame.cs @@ -0,0 +1,12 @@ +using Plugins.JNGame.Sync.Frame; + +namespace Script.AppImpl +{ + public class JNGSyncFrame : JNSyncFrame + { + protected override void OnSendInput(JNFrameInputs inputs) + { + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Script/AppImpl/JNGSyncFrame.cs.meta b/JNFrame/Assets/Script/AppImpl/JNGSyncFrame.cs.meta new file mode 100644 index 00000000..19cc2fe0 --- /dev/null +++ b/JNFrame/Assets/Script/AppImpl/JNGSyncFrame.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c3b45cb3cc954a99bface55dd2529ce6 +timeCreated: 1706241635 \ No newline at end of file diff --git a/JNFrame/Assets/Script/Main.cs b/JNFrame/Assets/Script/Main.cs new file mode 100644 index 00000000..5f7fe335 --- /dev/null +++ b/JNFrame/Assets/Script/Main.cs @@ -0,0 +1,58 @@ +using System; +using Plugins.JNGame; +using Plugins.JNGame.Network.Action; +using Script.battle; +using UnityEditor; +using UnityEngine; +using UnityEngine.SceneManagement; + +//游戏主入口 +namespace Script +{ + public class Main : MonoBehaviour + { + + async void Start() + { + + //创建UI + SceneManager.LoadScene("UIScene", LoadSceneMode.Additive); + + //加载框架 + await JNGame.Init(App.System()); + + //初始化模式类 + await GBattleModeManager.Instance.Open(GBattleMode.Default); + + App.Socket.AddListener(3,OnNActionDemo); + App.Socket.AddListener((int)NActionEnum.NSyncFrameBack,OnNSyncFrameBack); + + //加载成功向服务器发送帧同步消息 + NActionDemo message = new NActionDemo(); + message.Message = "HelloWorld Unity NGame"; + App.Socket.Send(2,message); + + //开启帧同步 + App.Socket.Send((int)NActionEnum.NSyncFrameStart); + + + } + + public void OnNActionDemo(NActionDemo demo) + { + Debug.Log(demo.Message); + } + + public void OnNSyncFrameBack(JNFrameInfo info) + { + Debug.Log(info.Index); + } + + private void Update() + { + + App.Sync.Update((int)(Time.deltaTime * 1000)); + + } + } +} diff --git a/JNFrame/Assets/Script/Main.cs.meta b/JNFrame/Assets/Script/Main.cs.meta new file mode 100644 index 00000000..e1e1cbb4 --- /dev/null +++ b/JNFrame/Assets/Script/Main.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 00b2d35a0698b224fa03e09bed92aac7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Script/UIMain.cs b/JNFrame/Assets/Script/UIMain.cs new file mode 100644 index 00000000..82a29fc0 --- /dev/null +++ b/JNFrame/Assets/Script/UIMain.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +namespace Script +{ + public class UIMain : MonoBehaviour + { + } +} diff --git a/JNFrame/Assets/Script/UIMain.cs.meta b/JNFrame/Assets/Script/UIMain.cs.meta new file mode 100644 index 00000000..c77d9aca --- /dev/null +++ b/JNFrame/Assets/Script/UIMain.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b87c4476f7ad6954e91fa3172d2b723a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/Assets/Script/battle.meta b/JNFrame/Assets/Script/battle.meta new file mode 100644 index 00000000..d57541bf --- /dev/null +++ b/JNFrame/Assets/Script/battle.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 93f31f5f8f544a909b295c78ef4dca0b +timeCreated: 1706167370 \ No newline at end of file diff --git a/JNFrame/Assets/Script/battle/GBaseMode.cs b/JNFrame/Assets/Script/battle/GBaseMode.cs new file mode 100644 index 00000000..84fde0b5 --- /dev/null +++ b/JNFrame/Assets/Script/battle/GBaseMode.cs @@ -0,0 +1,7 @@ +namespace Script.battle +{ + public class GBaseMode + { + + } +} \ No newline at end of file diff --git a/JNFrame/Assets/Script/battle/GBaseMode.cs.meta b/JNFrame/Assets/Script/battle/GBaseMode.cs.meta new file mode 100644 index 00000000..fd69f488 --- /dev/null +++ b/JNFrame/Assets/Script/battle/GBaseMode.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 66eaac44e0ad4bf3b54c2806f86280c7 +timeCreated: 1706252585 \ No newline at end of file diff --git a/JNFrame/Assets/Script/battle/GBattleModeManager.cs b/JNFrame/Assets/Script/battle/GBattleModeManager.cs new file mode 100644 index 00000000..09a2cd79 --- /dev/null +++ b/JNFrame/Assets/Script/battle/GBattleModeManager.cs @@ -0,0 +1,83 @@ +using System.Collections.Generic; +using Cysharp.Threading.Tasks; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace Script.battle +{ + //各种模式场景 + public enum GBattleMode + { + Not = -1, + Default = 0 + } + + //初始化参数类 + public class GBattleModeInfo + { + public List modes; + public GameObject root; + } + + //全局战斗模式管理器 + public class GBattleModeManager : SingletonScene + { + + public static string[] Worlds = { "WorldScene" }; + + //当前模式 + private GBattleMode _current = GBattleMode.Not; + + //初始化管理器 + public void Init(GBattleModeInfo info) + { + + } + + //打开指定模式 + public async UniTask Open(GBattleMode mode) + { + + //销毁之前模式 + await Close(); + _current = mode; + await LoadScene(mode); + + } + + //关闭当前模式 + public async UniTask Close() + { + + await UnloadScene(_current); + _current = GBattleMode.Not; + + } + + //获取场景名称 + public string GetWorldName(GBattleMode mode) + { + return Worlds[(int)mode]; + } + + //加载场景 + private async UniTask LoadScene(GBattleMode mode) + { + if (mode == GBattleMode.Not) return; + Debug.Log($"[GBattleModeManager] 打开场景{GetWorldName(mode)}"); + await SceneManager.LoadSceneAsync(GetWorldName(mode), LoadSceneMode.Additive); + } + + //销毁场景 + private async UniTask UnloadScene(GBattleMode mode) + { + + if (mode == GBattleMode.Not) return; + Debug.Log($"[GBattleModeManager] 关闭场景{GetWorldName(mode)}"); + await SceneManager.UnloadSceneAsync(GetWorldName(mode)); + + } + + } + +} \ No newline at end of file diff --git a/JNFrame/Assets/Script/battle/GBattleModeManager.cs.meta b/JNFrame/Assets/Script/battle/GBattleModeManager.cs.meta new file mode 100644 index 00000000..bfa8bf41 --- /dev/null +++ b/JNFrame/Assets/Script/battle/GBattleModeManager.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 36bc28f3467d4641abb08e83398a8a30 +timeCreated: 1706167381 \ No newline at end of file diff --git a/JNFrame/Assets/packages.config b/JNFrame/Assets/packages.config new file mode 100644 index 00000000..41f2033c --- /dev/null +++ b/JNFrame/Assets/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/JNFrame/Assets/packages.config.meta b/JNFrame/Assets/packages.config.meta new file mode 100644 index 00000000..70c86eaa --- /dev/null +++ b/JNFrame/Assets/packages.config.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 11999abe80b2e5245a64dfb9b1d97948 +labels: +- NuGetForUnity +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JNFrame/JNFrame.sln b/JNFrame/JNFrame.sln new file mode 100644 index 00000000..084d0baa --- /dev/null +++ b/JNFrame/JNFrame.sln @@ -0,0 +1,49 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-firstpass", "Assembly-CSharp-firstpass.csproj", "{e5544f0c-cd3e-f7be-dc52-046b131df43d}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask", "UniTask.csproj", "{39f5acb9-cdbb-9f48-497c-14159a0afd38}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask.Linq", "UniTask.Linq.csproj", "{7f60f694-1f75-f2f0-5fde-36ccb7fd82d1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask.DOTween", "UniTask.DOTween.csproj", "{99c4c7d2-ca96-1038-95e0-77e225df2b06}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask.TextMeshPro", "UniTask.TextMeshPro.csproj", "{4b964c85-7c9d-2d07-a2e0-8595262e4e96}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{3ca4410c-c33b-25ce-55bc-3a432b9830ed}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask.Addressables", "UniTask.Addressables.csproj", "{6d8bd378-3e5b-6997-5e5e-288243f0f72b}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniTask.Editor", "UniTask.Editor.csproj", "{295d565d-1437-bd18-5c54-a9d5211832bd}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor", "Assembly-CSharp-Editor.csproj", "{520fb43a-8c94-8ecf-d51a-d5407030f9ec}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {e5544f0c-cd3e-f7be-dc52-046b131df43d}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {e5544f0c-cd3e-f7be-dc52-046b131df43d}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39f5acb9-cdbb-9f48-497c-14159a0afd38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39f5acb9-cdbb-9f48-497c-14159a0afd38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7f60f694-1f75-f2f0-5fde-36ccb7fd82d1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7f60f694-1f75-f2f0-5fde-36ccb7fd82d1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99c4c7d2-ca96-1038-95e0-77e225df2b06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99c4c7d2-ca96-1038-95e0-77e225df2b06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4b964c85-7c9d-2d07-a2e0-8595262e4e96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4b964c85-7c9d-2d07-a2e0-8595262e4e96}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3ca4410c-c33b-25ce-55bc-3a432b9830ed}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3ca4410c-c33b-25ce-55bc-3a432b9830ed}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6d8bd378-3e5b-6997-5e5e-288243f0f72b}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6d8bd378-3e5b-6997-5e5e-288243f0f72b}.Debug|Any CPU.Build.0 = Debug|Any CPU + {295d565d-1437-bd18-5c54-a9d5211832bd}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {295d565d-1437-bd18-5c54-a9d5211832bd}.Debug|Any CPU.Build.0 = Debug|Any CPU + {520fb43a-8c94-8ecf-d51a-d5407030f9ec}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {520fb43a-8c94-8ecf-d51a-d5407030f9ec}.Debug|Any CPU.Build.0 = Debug|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/JNFrame/Logs/AssetImportWorker0-prev.log b/JNFrame/Logs/AssetImportWorker0-prev.log new file mode 100644 index 00000000..6b5fd3c1 --- /dev/null +++ b/JNFrame/Logs/AssetImportWorker0-prev.log @@ -0,0 +1,7434 @@ +Using pre-set license +Built from '2021.3/china_unity/release' branch; Version is '2021.3.27f1c2 (3b3d9646cb47) revision 3882390'; Using compiler version '192829333'; Build Type 'Release' +OS: 'Windows 11 (10.0.22621) 64bit Professional' Language: 'zh' Physical Memory: 32651 MB +BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1 + +COMMAND LINE ARGUMENTS: +D:\Unity\2021.3.27f1c2\Editor\Unity.exe +-adb2 +-batchMode +-noUpm +-name +AssetImportWorker0 +-projectPath +D:/myproject/unity/JNFrame +-logFile +Logs/AssetImportWorker0.log +-srvPort +59192 +Successfully changed project path to: D:/myproject/unity/JNFrame +D:/myproject/unity/JNFrame +[UnityMemory] Configuration Parameters - Can be set up in boot.config + "memorysetup-bucket-allocator-granularity=16" + "memorysetup-bucket-allocator-bucket-count=8" + "memorysetup-bucket-allocator-block-size=33554432" + "memorysetup-bucket-allocator-block-count=8" + "memorysetup-main-allocator-block-size=16777216" + "memorysetup-thread-allocator-block-size=16777216" + "memorysetup-gfx-main-allocator-block-size=16777216" + "memorysetup-gfx-thread-allocator-block-size=16777216" + "memorysetup-cache-allocator-block-size=4194304" + "memorysetup-typetree-allocator-block-size=2097152" + "memorysetup-profiler-bucket-allocator-granularity=16" + "memorysetup-profiler-bucket-allocator-bucket-count=8" + "memorysetup-profiler-bucket-allocator-block-size=33554432" + "memorysetup-profiler-bucket-allocator-block-count=8" + "memorysetup-profiler-allocator-block-size=16777216" + "memorysetup-profiler-editor-allocator-block-size=1048576" + "memorysetup-temp-allocator-size-main=16777216" + "memorysetup-job-temp-allocator-block-size=2097152" + "memorysetup-job-temp-allocator-block-size-background=1048576" + "memorysetup-job-temp-allocator-reduction-small-platforms=262144" + "memorysetup-temp-allocator-size-background-worker=32768" + "memorysetup-temp-allocator-size-job-worker=262144" + "memorysetup-temp-allocator-size-preload-manager=33554432" + "memorysetup-temp-allocator-size-nav-mesh-worker=65536" + "memorysetup-temp-allocator-size-audio-worker=65536" + "memorysetup-temp-allocator-size-cloud-worker=32768" + "memorysetup-temp-allocator-size-gi-baking-worker=262144" + "memorysetup-temp-allocator-size-gfx=262144" +Player connection [41672] Host "[IP] 192.168.0.118 [Port] 0 [Flags] 2 [Guid] 1371125687 [EditorId] 1371125687 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... + +Player connection [41672] Host "[IP] 192.168.0.118 [Port] 0 [Flags] 2 [Guid] 1371125687 [EditorId] 1371125687 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... + +AS: AutoStreaming module initializing. +Refreshing native plugins compatible for Editor in 143.27 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Initialize engine version: 2021.3.27f1c2 (3b3d9646cb47) +[Subsystems] Discovering subsystems at path D:/Unity/2021.3.27f1c2/Editor/Data/Resources/UnitySubsystems +[Subsystems] Discovering subsystems at path D:/myproject/unity/JNFrame/Assets +GfxDevice: creating device client; threaded=0; jobified=0 +Direct3D: + Version: Direct3D 11.0 [level 11.1] + Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) + Vendor: NVIDIA + VRAM: 5980 MB + Driver: 31.0.15.3623 +Initialize mono +Mono path[0] = 'D:/Unity/2021.3.27f1c2/Editor/Data/Managed' +Mono path[1] = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' +Mono config path = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/etc' +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56412 +Begin MonoManager ReloadAssembly +Registering precompiled unity dll's ... +Register platform support module: D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll +Registered in 0.009432 seconds. +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 112.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.027 seconds +Domain Reload Profiling: + ReloadAssembly (1028ms) + BeginReloadAssembly (192ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (0ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (2ms) + EndReloadAssembly (649ms) + LoadAssemblies (184ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (189ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (316ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (18ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (112ms) + BeforeProcessingInitializeOnLoad (1ms) + ProcessInitializeOnLoadAttributes (125ms) + ProcessInitializeOnLoadMethodAttributes (59ms) + AfterProcessingInitializeOnLoad (0ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (0ms) +Platform modules already initialized, skipping +Registering precompiled user dll's ... +Registered in 0.012922 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.283 seconds +Domain Reload Profiling: + ReloadAssembly (1284ms) + BeginReloadAssembly (134ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (19ms) + EndReloadAssembly (935ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (323ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (59ms) + SetupLoadedEditorAssemblies (381ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (88ms) + ProcessInitializeOnLoadAttributes (248ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +======================================================================== +Worker process is ready to serve import requests +Launched and connected shader compiler UnityShaderCompiler.exe after 0.06 seconds +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 30 unused Assets / (46.8 KB). Loaded Objects now: 5254. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 2.851800 ms (FindLiveObjects: 0.351800 ms CreateObjectMapping: 0.190400 ms MarkObjects: 2.225300 ms DeleteObjects: 0.083000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 720739.729917 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '23667c764a6231d54554d7479a837180') in 0.041638 seconds +======================================================================== +Received Import Request. + Time since last request: 5.402672 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '80031748bcfe36225489c68b18d8621b') in 0.001973 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009813 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.049 seconds +Domain Reload Profiling: + ReloadAssembly (1050ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (749ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (293ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (271ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.37 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5257. +Memory consumption went from 164.3 MB to 164.2 MB. +Total: 3.254900 ms (FindLiveObjects: 0.574400 ms CreateObjectMapping: 0.264000 ms MarkObjects: 2.376200 ms DeleteObjects: 0.037900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014115 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.209 seconds +Domain Reload Profiling: + ReloadAssembly (1210ms) + BeginReloadAssembly (164ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (947ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (356ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (321ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (37ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (52ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5260. +Memory consumption went from 164.3 MB to 164.2 MB. +Total: 4.066400 ms (FindLiveObjects: 0.408800 ms CreateObjectMapping: 0.236900 ms MarkObjects: 3.377800 ms DeleteObjects: 0.040600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011536 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.025 seconds +Domain Reload Profiling: + ReloadAssembly (1026ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (763ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (294ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5263. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.757200 ms (FindLiveObjects: 0.525500 ms CreateObjectMapping: 0.196100 ms MarkObjects: 2.012900 ms DeleteObjects: 0.021600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012785 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.230 seconds +Domain Reload Profiling: + ReloadAssembly (1231ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (964ms) + LoadAssemblies (119ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (462ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (70ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5266. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.360200 ms (FindLiveObjects: 0.277000 ms CreateObjectMapping: 0.135600 ms MarkObjects: 1.929400 ms DeleteObjects: 0.017400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014930 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.127 seconds +Domain Reload Profiling: + ReloadAssembly (1129ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (844ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (259ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (385ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (242ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (22ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5269. +Memory consumption went from 164.1 MB to 164.1 MB. +Total: 2.942300 ms (FindLiveObjects: 0.387000 ms CreateObjectMapping: 0.218500 ms MarkObjects: 2.305700 ms DeleteObjects: 0.029400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013337 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.153 seconds +Domain Reload Profiling: + ReloadAssembly (1154ms) + BeginReloadAssembly (204ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (71ms) + EndReloadAssembly (812ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (333ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5272. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 4.332000 ms (FindLiveObjects: 0.338000 ms CreateObjectMapping: 0.179900 ms MarkObjects: 3.757500 ms DeleteObjects: 0.054800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010072 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.086 seconds +Domain Reload Profiling: + ReloadAssembly (1087ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (820ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (283ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (54ms) + SetupLoadedEditorAssemblies (318ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (91ms) + ProcessInitializeOnLoadAttributes (179ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5275. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.471200 ms (FindLiveObjects: 0.297600 ms CreateObjectMapping: 0.157700 ms MarkObjects: 1.992900 ms DeleteObjects: 0.021600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.023986 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.035 seconds +Domain Reload Profiling: + ReloadAssembly (1036ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (767ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (299ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4789 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5279. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 3.224400 ms (FindLiveObjects: 0.365800 ms CreateObjectMapping: 0.185900 ms MarkObjects: 2.637600 ms DeleteObjects: 0.032700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009713 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.03 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.101 seconds +Domain Reload Profiling: + ReloadAssembly (1102ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (837ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (326ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (302ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (22ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4789 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5282. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.371300 ms (FindLiveObjects: 0.326600 ms CreateObjectMapping: 0.176900 ms MarkObjects: 1.843600 ms DeleteObjects: 0.023100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012259 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.080 seconds +Domain Reload Profiling: + ReloadAssembly (1081ms) + BeginReloadAssembly (142ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (834ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (320ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (59ms) + SetupLoadedEditorAssemblies (294ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (88ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4789 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5285. +Memory consumption went from 164.2 MB to 164.1 MB. +Total: 2.351600 ms (FindLiveObjects: 0.337700 ms CreateObjectMapping: 0.142800 ms MarkObjects: 1.849400 ms DeleteObjects: 0.020700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 1283.942753 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'd1df72ba9a9ef30b888a178b3e221f42') in 0.020107 seconds +======================================================================== +Received Import Request. + Time since last request: 160.119092 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'b9fa7f2eea88328173f4ef83f9758a2d') in 0.002529 seconds +======================================================================== +Received Import Request. + Time since last request: 361.875106 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'b59b9dc96276fa2a2ef78a57faff7f01') in 0.002405 seconds +======================================================================== +Received Import Request. + Time since last request: 5.723696 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '17f09de41da54394b918957cb74f2d71') in 0.001850 seconds +======================================================================== +Received Import Request. + Time since last request: 307.473444 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '0fa1efe0506ee9b1cac26739dbf589bb') in 0.002536 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012592 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.107 seconds +Domain Reload Profiling: + ReloadAssembly (1108ms) + BeginReloadAssembly (198ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (64ms) + EndReloadAssembly (799ms) + LoadAssemblies (130ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (355ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (254ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (156ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5290. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.595400 ms (FindLiveObjects: 0.276000 ms CreateObjectMapping: 0.135400 ms MarkObjects: 2.152800 ms DeleteObjects: 0.030100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012194 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.51 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.099 seconds +Domain Reload Profiling: + ReloadAssembly (1100ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (833ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (300ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (62ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (80ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5293. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.929400 ms (FindLiveObjects: 0.273600 ms CreateObjectMapping: 0.141800 ms MarkObjects: 2.493600 ms DeleteObjects: 0.019700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012922 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.044 seconds +Domain Reload Profiling: + ReloadAssembly (1045ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (776ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (289ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (301ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (183ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5296. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.927500 ms (FindLiveObjects: 0.434500 ms CreateObjectMapping: 0.169700 ms MarkObjects: 2.299400 ms DeleteObjects: 0.022900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011095 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 3.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 8.740 seconds +Domain Reload Profiling: + ReloadAssembly (8741ms) + BeginReloadAssembly (244ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (86ms) + EndReloadAssembly (8376ms) + LoadAssemblies (171ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (7202ms) + ReleaseScriptCaches (5ms) + RebuildScriptCaches (162ms) + SetupLoadedEditorAssemblies (593ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (4ms) + BeforeProcessingInitializeOnLoad (140ms) + ProcessInitializeOnLoadAttributes (377ms) + ProcessInitializeOnLoadMethodAttributes (46ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5299. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 6.811000 ms (FindLiveObjects: 1.240500 ms CreateObjectMapping: 1.016000 ms MarkObjects: 4.493000 ms DeleteObjects: 0.058900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.018671 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.970 seconds +Domain Reload Profiling: + ReloadAssembly (1972ms) + BeginReloadAssembly (287ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (72ms) + EndReloadAssembly (1556ms) + LoadAssemblies (212ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (503ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (158ms) + SetupLoadedEditorAssemblies (656ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (110ms) + ProcessInitializeOnLoadAttributes (345ms) + ProcessInitializeOnLoadMethodAttributes (167ms) + AfterProcessingInitializeOnLoad (25ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (18ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5302. +Memory consumption went from 164.2 MB to 164.2 MB. +Total: 4.243200 ms (FindLiveObjects: 0.489500 ms CreateObjectMapping: 0.382200 ms MarkObjects: 3.307000 ms DeleteObjects: 0.060800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013034 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.147 seconds +Domain Reload Profiling: + ReloadAssembly (1148ms) + BeginReloadAssembly (192ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (829ms) + LoadAssemblies (149ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (284ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (338ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (227ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5305. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 3.167400 ms (FindLiveObjects: 0.279900 ms CreateObjectMapping: 0.588300 ms MarkObjects: 2.247100 ms DeleteObjects: 0.050300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015582 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.150 seconds +Domain Reload Profiling: + ReloadAssembly (1151ms) + BeginReloadAssembly (269ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (88ms) + EndReloadAssembly (759ms) + LoadAssemblies (187ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (267ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (280ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5308. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 3.932500 ms (FindLiveObjects: 0.642100 ms CreateObjectMapping: 0.522000 ms MarkObjects: 2.719200 ms DeleteObjects: 0.047600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 828.529410 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '4d70962ac0d01af17746754d25d12d11') in 0.007995 seconds +======================================================================== +Received Import Request. + Time since last request: 16.993327 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '940feb4c5ed3a1fabd86dc0342e6291a') in 0.002508 seconds +======================================================================== +Received Import Request. + Time since last request: 4.259123 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'f275f5cecc77b44e6ffd3977af9d9f34') in 0.002114 seconds +======================================================================== +Received Import Request. + Time since last request: 27.885216 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '3f9f42b638fcfb0bc1aec76709fde433') in 0.002056 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016155 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.068 seconds +Domain Reload Profiling: + ReloadAssembly (1069ms) + BeginReloadAssembly (177ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (784ms) + LoadAssemblies (126ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (280ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (301ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (179ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5311. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 3.187300 ms (FindLiveObjects: 0.673600 ms CreateObjectMapping: 0.365200 ms MarkObjects: 2.119100 ms DeleteObjects: 0.027800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014120 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.47 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.060 seconds +Domain Reload Profiling: + ReloadAssembly (1061ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (811ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (309ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (190ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5314. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.675900 ms (FindLiveObjects: 0.396800 ms CreateObjectMapping: 0.253400 ms MarkObjects: 1.998600 ms DeleteObjects: 0.025800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014614 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.000 seconds +Domain Reload Profiling: + ReloadAssembly (1001ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (32ms) + EndReloadAssembly (722ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (248ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5317. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.791500 ms (FindLiveObjects: 0.413400 ms CreateObjectMapping: 0.196500 ms MarkObjects: 2.145400 ms DeleteObjects: 0.034800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016116 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.451 seconds +Domain Reload Profiling: + ReloadAssembly (1453ms) + BeginReloadAssembly (385ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (14ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (101ms) + EndReloadAssembly (948ms) + LoadAssemblies (246ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (394ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (315ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (196ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.31 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5320. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 3.287200 ms (FindLiveObjects: 0.504200 ms CreateObjectMapping: 0.218900 ms MarkObjects: 2.534900 ms DeleteObjects: 0.026700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012531 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.015 seconds +Domain Reload Profiling: + ReloadAssembly (1016ms) + BeginReloadAssembly (145ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (30ms) + EndReloadAssembly (772ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (290ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (187ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5323. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.391900 ms (FindLiveObjects: 0.277700 ms CreateObjectMapping: 0.146300 ms MarkObjects: 1.950200 ms DeleteObjects: 0.016900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010997 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.010 seconds +Domain Reload Profiling: + ReloadAssembly (1011ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (748ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (260ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (179ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (20ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.30 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5326. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 4.097700 ms (FindLiveObjects: 0.334300 ms CreateObjectMapping: 0.188800 ms MarkObjects: 3.525800 ms DeleteObjects: 0.046600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.043566 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.342 seconds +Domain Reload Profiling: + ReloadAssembly (1343ms) + BeginReloadAssembly (241ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (71ms) + EndReloadAssembly (974ms) + LoadAssemblies (150ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (345ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (408ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (271ms) + ProcessInitializeOnLoadMethodAttributes (49ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5329. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 3.681000 ms (FindLiveObjects: 0.515800 ms CreateObjectMapping: 0.252300 ms MarkObjects: 2.859300 ms DeleteObjects: 0.051400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012922 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.659 seconds +Domain Reload Profiling: + ReloadAssembly (1661ms) + BeginReloadAssembly (197ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (1327ms) + LoadAssemblies (141ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (318ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (723ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (81ms) + ProcessInitializeOnLoadAttributes (376ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (231ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.28 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5332. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 2.491500 ms (FindLiveObjects: 0.369200 ms CreateObjectMapping: 0.174500 ms MarkObjects: 1.921900 ms DeleteObjects: 0.024800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013565 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.184 seconds +Domain Reload Profiling: + ReloadAssembly (1185ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (890ms) + LoadAssemblies (145ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (353ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (301ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.21 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5335. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.779300 ms (FindLiveObjects: 0.406200 ms CreateObjectMapping: 0.194000 ms MarkObjects: 2.155600 ms DeleteObjects: 0.022000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012138 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.115 seconds +Domain Reload Profiling: + ReloadAssembly (1116ms) + BeginReloadAssembly (282ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (87ms) + EndReloadAssembly (710ms) + LoadAssemblies (176ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5338. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.500200 ms (FindLiveObjects: 0.287600 ms CreateObjectMapping: 0.141000 ms MarkObjects: 2.037900 ms DeleteObjects: 0.032000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.018019 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.052 seconds +Domain Reload Profiling: + ReloadAssembly (1053ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (776ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (313ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5341. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.276900 ms (FindLiveObjects: 0.470100 ms CreateObjectMapping: 0.203200 ms MarkObjects: 2.552500 ms DeleteObjects: 0.048800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011567 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.26 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.126 seconds +Domain Reload Profiling: + ReloadAssembly (1127ms) + BeginReloadAssembly (235ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (64ms) + EndReloadAssembly (786ms) + LoadAssemblies (141ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (283ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (316ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (184ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.05 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5344. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.392400 ms (FindLiveObjects: 0.507300 ms CreateObjectMapping: 0.269900 ms MarkObjects: 2.561800 ms DeleteObjects: 0.051700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011356 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.943 seconds +Domain Reload Profiling: + ReloadAssembly (944ms) + BeginReloadAssembly (140ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (696ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (249ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5347. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.606000 ms (FindLiveObjects: 0.498600 ms CreateObjectMapping: 0.178000 ms MarkObjects: 2.882800 ms DeleteObjects: 0.043700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013336 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.207 seconds +Domain Reload Profiling: + ReloadAssembly (1207ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (958ms) + LoadAssemblies (103ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (289ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (466ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (84ms) + ProcessInitializeOnLoadAttributes (300ms) + ProcessInitializeOnLoadMethodAttributes (47ms) + AfterProcessingInitializeOnLoad (25ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5350. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 3.542300 ms (FindLiveObjects: 0.487400 ms CreateObjectMapping: 0.233100 ms MarkObjects: 2.751200 ms DeleteObjects: 0.068200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 56638.683514 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '9841464068c599ace7c437f74820bc10') in 0.021281 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012735 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.054 seconds +Domain Reload Profiling: + ReloadAssembly (1055ms) + BeginReloadAssembly (194ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (53ms) + EndReloadAssembly (748ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (271ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (293ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5354. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.575400 ms (FindLiveObjects: 0.326500 ms CreateObjectMapping: 0.174400 ms MarkObjects: 2.050000 ms DeleteObjects: 0.023300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012567 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.369 seconds +Domain Reload Profiling: + ReloadAssembly (1370ms) + BeginReloadAssembly (255ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (55ms) + EndReloadAssembly (902ms) + LoadAssemblies (235ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (333ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (188ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5357. +Memory consumption went from 164.7 MB to 164.6 MB. +Total: 2.399700 ms (FindLiveObjects: 0.308500 ms CreateObjectMapping: 0.160800 ms MarkObjects: 1.908300 ms DeleteObjects: 0.021300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 71.553680 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '6573457f19cb49223cdab9c871ed6429') in 0.008795 seconds +======================================================================== +Received Import Request. + Time since last request: 16.690861 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '857a845176b71f2ab16b90c74d488cec') in 0.001821 seconds +======================================================================== +Received Import Request. + Time since last request: 2.032284 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'a874d0ff2700ae65211a4183b3635742') in 0.002259 seconds +======================================================================== +Received Import Request. + Time since last request: 2.026412 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '49e2569f3d9e1eae74d465b87cb0a6f3') in 0.004642 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020386 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.366 seconds +Domain Reload Profiling: + ReloadAssembly (1367ms) + BeginReloadAssembly (239ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (82ms) + EndReloadAssembly (982ms) + LoadAssemblies (163ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (432ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (55ms) + SetupLoadedEditorAssemblies (307ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (21ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5360. +Memory consumption went from 164.7 MB to 164.6 MB. +Total: 2.868400 ms (FindLiveObjects: 0.401900 ms CreateObjectMapping: 0.200100 ms MarkObjects: 2.232200 ms DeleteObjects: 0.032400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011652 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.117 seconds +Domain Reload Profiling: + ReloadAssembly (1118ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (870ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (299ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (369ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (226ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5363. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.424900 ms (FindLiveObjects: 0.574100 ms CreateObjectMapping: 0.439100 ms MarkObjects: 2.352600 ms DeleteObjects: 0.057000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012556 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.261 seconds +Domain Reload Profiling: + ReloadAssembly (1262ms) + BeginReloadAssembly (212ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (78ms) + EndReloadAssembly (934ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (352ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (375ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (244ms) + ProcessInitializeOnLoadMethodAttributes (36ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5366. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 10.231000 ms (FindLiveObjects: 3.736700 ms CreateObjectMapping: 3.104600 ms MarkObjects: 3.318100 ms DeleteObjects: 0.066500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010681 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.024 seconds +Domain Reload Profiling: + ReloadAssembly (1025ms) + BeginReloadAssembly (184ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (57ms) + EndReloadAssembly (730ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (292ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (257ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (153ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5369. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.403100 ms (FindLiveObjects: 0.327100 ms CreateObjectMapping: 0.171000 ms MarkObjects: 1.874000 ms DeleteObjects: 0.029600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009758 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.098 seconds +Domain Reload Profiling: + ReloadAssembly (1099ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (830ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (254ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (385ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (257ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (23ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5372. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.703000 ms (FindLiveObjects: 0.471300 ms CreateObjectMapping: 0.182200 ms MarkObjects: 2.018900 ms DeleteObjects: 0.029200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012801 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.132 seconds +Domain Reload Profiling: + ReloadAssembly (1133ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (857ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (320ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (333ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (207ms) + ProcessInitializeOnLoadMethodAttributes (37ms) + AfterProcessingInitializeOnLoad (20ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5375. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.650500 ms (FindLiveObjects: 0.579000 ms CreateObjectMapping: 0.398100 ms MarkObjects: 2.625500 ms DeleteObjects: 0.046300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012196 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.974 seconds +Domain Reload Profiling: + ReloadAssembly (974ms) + BeginReloadAssembly (164ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (712ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (287ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (267ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.23 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5378. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.765100 ms (FindLiveObjects: 0.381100 ms CreateObjectMapping: 0.210500 ms MarkObjects: 3.128200 ms DeleteObjects: 0.042700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009638 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.129 seconds +Domain Reload Profiling: + ReloadAssembly (1130ms) + BeginReloadAssembly (195ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (70ms) + EndReloadAssembly (830ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (353ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5381. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 4.302700 ms (FindLiveObjects: 0.842900 ms CreateObjectMapping: 0.499100 ms MarkObjects: 2.916700 ms DeleteObjects: 0.042100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011978 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.143 seconds +Domain Reload Profiling: + ReloadAssembly (1144ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (887ms) + LoadAssemblies (115ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (364ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (297ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (189ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5384. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 5.269800 ms (FindLiveObjects: 0.906500 ms CreateObjectMapping: 1.137800 ms MarkObjects: 3.152300 ms DeleteObjects: 0.069800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009984 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.30 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.981 seconds +Domain Reload Profiling: + ReloadAssembly (982ms) + BeginReloadAssembly (177ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (61ms) + EndReloadAssembly (702ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (258ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (267ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5387. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.525600 ms (FindLiveObjects: 0.418600 ms CreateObjectMapping: 0.237300 ms MarkObjects: 2.819100 ms DeleteObjects: 0.048200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009995 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.029 seconds +Domain Reload Profiling: + ReloadAssembly (1030ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (775ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (308ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5390. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.759500 ms (FindLiveObjects: 0.606700 ms CreateObjectMapping: 0.763100 ms MarkObjects: 2.353500 ms DeleteObjects: 0.033800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011956 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.051 seconds +Domain Reload Profiling: + ReloadAssembly (1052ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (764ms) + LoadAssemblies (146ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (274ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5393. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 2.696700 ms (FindLiveObjects: 0.547300 ms CreateObjectMapping: 0.179900 ms MarkObjects: 1.920000 ms DeleteObjects: 0.047400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011955 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.243 seconds +Domain Reload Profiling: + ReloadAssembly (1244ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (999ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (291ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (496ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (309ms) + ProcessInitializeOnLoadMethodAttributes (80ms) + AfterProcessingInitializeOnLoad (20ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5396. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 2.727700 ms (FindLiveObjects: 0.391800 ms CreateObjectMapping: 0.215600 ms MarkObjects: 2.090100 ms DeleteObjects: 0.028700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010781 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.369 seconds +Domain Reload Profiling: + ReloadAssembly (1370ms) + BeginReloadAssembly (340ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (61ms) + EndReloadAssembly (743ms) + LoadAssemblies (302ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (29ms) + SetupLoadedEditorAssemblies (251ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (153ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5399. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.379100 ms (FindLiveObjects: 0.310400 ms CreateObjectMapping: 0.169600 ms MarkObjects: 1.875400 ms DeleteObjects: 0.022700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013626 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.038 seconds +Domain Reload Profiling: + ReloadAssembly (1039ms) + BeginReloadAssembly (216ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (61ms) + EndReloadAssembly (722ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (253ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5402. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.433600 ms (FindLiveObjects: 0.311800 ms CreateObjectMapping: 0.166200 ms MarkObjects: 1.935400 ms DeleteObjects: 0.019300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013161 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.033 seconds +Domain Reload Profiling: + ReloadAssembly (1034ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (784ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (269ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (315ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (198ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.31 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5405. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.340600 ms (FindLiveObjects: 0.330000 ms CreateObjectMapping: 0.174600 ms MarkObjects: 1.811800 ms DeleteObjects: 0.022900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011111 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.123 seconds +Domain Reload Profiling: + ReloadAssembly (1124ms) + BeginReloadAssembly (233ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (60ms) + EndReloadAssembly (764ms) + LoadAssemblies (160ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (277ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (303ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5408. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 3.886100 ms (FindLiveObjects: 0.574200 ms CreateObjectMapping: 0.328900 ms MarkObjects: 2.936300 ms DeleteObjects: 0.045100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.022279 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.472 seconds +Domain Reload Profiling: + ReloadAssembly (1474ms) + BeginReloadAssembly (308ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (111ms) + EndReloadAssembly (1029ms) + LoadAssemblies (167ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (451ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (64ms) + SetupLoadedEditorAssemblies (335ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (203ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5412. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 4.105600 ms (FindLiveObjects: 0.935200 ms CreateObjectMapping: 0.568100 ms MarkObjects: 2.567700 ms DeleteObjects: 0.033300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016723 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.108 seconds +Domain Reload Profiling: + ReloadAssembly (1108ms) + BeginReloadAssembly (226ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (66ms) + EndReloadAssembly (754ms) + LoadAssemblies (151ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (282ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5415. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.489800 ms (FindLiveObjects: 0.470300 ms CreateObjectMapping: 0.178300 ms MarkObjects: 1.814800 ms DeleteObjects: 0.025400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012674 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.998 seconds +Domain Reload Profiling: + ReloadAssembly (999ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (738ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (285ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (163ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5418. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.825400 ms (FindLiveObjects: 0.372900 ms CreateObjectMapping: 0.182000 ms MarkObjects: 2.236600 ms DeleteObjects: 0.032700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010438 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.064 seconds +Domain Reload Profiling: + ReloadAssembly (1064ms) + BeginReloadAssembly (200ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (764ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (302ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (193ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5421. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.999700 ms (FindLiveObjects: 0.600500 ms CreateObjectMapping: 0.261400 ms MarkObjects: 2.104200 ms DeleteObjects: 0.032400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012021 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.128 seconds +Domain Reload Profiling: + ReloadAssembly (1129ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (870ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (335ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (334ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (127ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5424. +Memory consumption went from 164.9 MB to 164.8 MB. +Total: 2.581600 ms (FindLiveObjects: 0.436200 ms CreateObjectMapping: 0.151000 ms MarkObjects: 1.962600 ms DeleteObjects: 0.030800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009163 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.007 seconds +Domain Reload Profiling: + ReloadAssembly (1008ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (755ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (285ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5427. +Memory consumption went from 164.9 MB to 164.8 MB. +Total: 2.278900 ms (FindLiveObjects: 0.315300 ms CreateObjectMapping: 0.167200 ms MarkObjects: 1.775700 ms DeleteObjects: 0.019800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009813 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.989 seconds +Domain Reload Profiling: + ReloadAssembly (990ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (727ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (255ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5430. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 5.111300 ms (FindLiveObjects: 0.936100 ms CreateObjectMapping: 1.416100 ms MarkObjects: 2.667300 ms DeleteObjects: 0.088800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013121 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.101 seconds +Domain Reload Profiling: + ReloadAssembly (1108ms) + BeginReloadAssembly (214ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (782ms) + LoadAssemblies (157ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (280ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5433. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.358800 ms (FindLiveObjects: 0.370200 ms CreateObjectMapping: 0.172200 ms MarkObjects: 1.796300 ms DeleteObjects: 0.019300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.026925 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.150 seconds +Domain Reload Profiling: + ReloadAssembly (1151ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (887ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (348ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (67ms) + SetupLoadedEditorAssemblies (286ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5436. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.293500 ms (FindLiveObjects: 0.344300 ms CreateObjectMapping: 0.160900 ms MarkObjects: 1.766900 ms DeleteObjects: 0.020000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013436 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.246 seconds +Domain Reload Profiling: + ReloadAssembly (1246ms) + BeginReloadAssembly (193ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (63ms) + EndReloadAssembly (927ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (394ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (308ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (37ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5439. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.596800 ms (FindLiveObjects: 0.340800 ms CreateObjectMapping: 0.166600 ms MarkObjects: 2.054400 ms DeleteObjects: 0.033500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012658 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.028 seconds +Domain Reload Profiling: + ReloadAssembly (1029ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (756ms) + LoadAssemblies (130ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (280ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.27 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5442. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.685800 ms (FindLiveObjects: 0.332500 ms CreateObjectMapping: 0.166500 ms MarkObjects: 2.170600 ms DeleteObjects: 0.015200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009943 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.128 seconds +Domain Reload Profiling: + ReloadAssembly (1129ms) + BeginReloadAssembly (145ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (887ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (341ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (24ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5445. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.622800 ms (FindLiveObjects: 0.368600 ms CreateObjectMapping: 0.211600 ms MarkObjects: 2.026300 ms DeleteObjects: 0.015400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012745 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.091 seconds +Domain Reload Profiling: + ReloadAssembly (1092ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (820ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (287ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (326ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (91ms) + ProcessInitializeOnLoadAttributes (187ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5448. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.880100 ms (FindLiveObjects: 0.477500 ms CreateObjectMapping: 0.276600 ms MarkObjects: 2.104400 ms DeleteObjects: 0.020600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013294 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.251 seconds +Domain Reload Profiling: + ReloadAssembly (1252ms) + BeginReloadAssembly (215ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (884ms) + LoadAssemblies (182ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (321ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (328ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (202ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5451. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 3.284900 ms (FindLiveObjects: 0.577500 ms CreateObjectMapping: 0.309000 ms MarkObjects: 2.360000 ms DeleteObjects: 0.036300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010210 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.935 seconds +Domain Reload Profiling: + ReloadAssembly (936ms) + BeginReloadAssembly (148ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (698ms) + LoadAssemblies (100ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (253ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (265ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5454. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.617100 ms (FindLiveObjects: 0.341800 ms CreateObjectMapping: 0.221500 ms MarkObjects: 2.033900 ms DeleteObjects: 0.018200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020784 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.166 seconds +Domain Reload Profiling: + ReloadAssembly (1167ms) + BeginReloadAssembly (205ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (58ms) + EndReloadAssembly (850ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (332ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (217ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5457. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.559200 ms (FindLiveObjects: 0.351100 ms CreateObjectMapping: 0.182200 ms MarkObjects: 1.996800 ms DeleteObjects: 0.026600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010915 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.041 seconds +Domain Reload Profiling: + ReloadAssembly (1042ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (784ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (274ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (325ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (205ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5460. +Memory consumption went from 165.0 MB to 164.9 MB. +Total: 2.521600 ms (FindLiveObjects: 0.378000 ms CreateObjectMapping: 0.219600 ms MarkObjects: 1.904500 ms DeleteObjects: 0.018200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010691 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.049 seconds +Domain Reload Profiling: + ReloadAssembly (1049ms) + BeginReloadAssembly (193ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (760ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (284ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5463. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 2.911600 ms (FindLiveObjects: 0.517800 ms CreateObjectMapping: 0.299500 ms MarkObjects: 2.072600 ms DeleteObjects: 0.020700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013672 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.223 seconds +Domain Reload Profiling: + ReloadAssembly (1224ms) + BeginReloadAssembly (183ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (893ms) + LoadAssemblies (144ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (304ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (364ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (84ms) + ProcessInitializeOnLoadAttributes (217ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.33 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5466. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 2.306500 ms (FindLiveObjects: 0.332200 ms CreateObjectMapping: 0.180000 ms MarkObjects: 1.774200 ms DeleteObjects: 0.018800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010052 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.194 seconds +Domain Reload Profiling: + ReloadAssembly (1196ms) + BeginReloadAssembly (179ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (863ms) + LoadAssemblies (147ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (284ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (361ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (240ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5469. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 2.584700 ms (FindLiveObjects: 0.411400 ms CreateObjectMapping: 0.202400 ms MarkObjects: 1.952700 ms DeleteObjects: 0.017300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011718 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.162 seconds +Domain Reload Profiling: + ReloadAssembly (1162ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (911ms) + LoadAssemblies (133ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (320ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (54ms) + SetupLoadedEditorAssemblies (330ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (210ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5472. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.494500 ms (FindLiveObjects: 0.350700 ms CreateObjectMapping: 0.187200 ms MarkObjects: 1.934100 ms DeleteObjects: 0.021300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012478 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.051 seconds +Domain Reload Profiling: + ReloadAssembly (1052ms) + BeginReloadAssembly (196ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (749ms) + LoadAssemblies (137ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5475. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 3.111200 ms (FindLiveObjects: 0.315500 ms CreateObjectMapping: 0.168200 ms MarkObjects: 2.596100 ms DeleteObjects: 0.030400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011052 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.030 seconds +Domain Reload Profiling: + ReloadAssembly (1031ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (772ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (269ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (293ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5478. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.993600 ms (FindLiveObjects: 0.565700 ms CreateObjectMapping: 0.280200 ms MarkObjects: 2.126600 ms DeleteObjects: 0.020100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011650 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.065 seconds +Domain Reload Profiling: + ReloadAssembly (1066ms) + BeginReloadAssembly (189ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (769ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (300ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (179ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5481. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.466900 ms (FindLiveObjects: 0.340700 ms CreateObjectMapping: 0.163300 ms MarkObjects: 1.943800 ms DeleteObjects: 0.018400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013495 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.015 seconds +Domain Reload Profiling: + ReloadAssembly (1015ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (749ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (277ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5484. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.404800 ms (FindLiveObjects: 0.363100 ms CreateObjectMapping: 0.165900 ms MarkObjects: 2.835300 ms DeleteObjects: 0.038800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011091 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.058 seconds +Domain Reload Profiling: + ReloadAssembly (1058ms) + BeginReloadAssembly (180ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (53ms) + EndReloadAssembly (776ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (297ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5487. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.639500 ms (FindLiveObjects: 0.357900 ms CreateObjectMapping: 0.190400 ms MarkObjects: 2.072800 ms DeleteObjects: 0.017300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011478 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.960 seconds +Domain Reload Profiling: + ReloadAssembly (961ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (1ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (693ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (256ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (263ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.47 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5490. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 4.197100 ms (FindLiveObjects: 1.026200 ms CreateObjectMapping: 0.450600 ms MarkObjects: 2.680800 ms DeleteObjects: 0.037900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013089 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.030 seconds +Domain Reload Profiling: + ReloadAssembly (1031ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (759ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (256ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (323ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (204ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5493. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.351200 ms (FindLiveObjects: 0.703700 ms CreateObjectMapping: 0.281300 ms MarkObjects: 2.346500 ms DeleteObjects: 0.018300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013804 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.173 seconds +Domain Reload Profiling: + ReloadAssembly (1173ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (889ms) + LoadAssemblies (130ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (392ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (303ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (193ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5496. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.509700 ms (FindLiveObjects: 0.392000 ms CreateObjectMapping: 0.230700 ms MarkObjects: 2.858700 ms DeleteObjects: 0.026600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014724 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.974 seconds +Domain Reload Profiling: + ReloadAssembly (975ms) + BeginReloadAssembly (145ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (733ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (277ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (265ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5499. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.302000 ms (FindLiveObjects: 0.353700 ms CreateObjectMapping: 0.169000 ms MarkObjects: 1.758500 ms DeleteObjects: 0.019800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014612 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.961 seconds +Domain Reload Profiling: + ReloadAssembly (961ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (717ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (254ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5502. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 3.378000 ms (FindLiveObjects: 0.368400 ms CreateObjectMapping: 0.187100 ms MarkObjects: 2.797300 ms DeleteObjects: 0.024100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010800 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.970 seconds +Domain Reload Profiling: + ReloadAssembly (971ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (724ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (258ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5505. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 3.091800 ms (FindLiveObjects: 0.339500 ms CreateObjectMapping: 0.167100 ms MarkObjects: 2.546500 ms DeleteObjects: 0.037200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010190 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.19 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.978 seconds +Domain Reload Profiling: + ReloadAssembly (978ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (731ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (239ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (299ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5508. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.004100 ms (FindLiveObjects: 0.433800 ms CreateObjectMapping: 0.321200 ms MarkObjects: 2.229400 ms DeleteObjects: 0.018800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011103 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.840 seconds +Domain Reload Profiling: + ReloadAssembly (2841ms) + BeginReloadAssembly (600ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (173ms) + EndReloadAssembly (2025ms) + LoadAssemblies (426ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (552ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (185ms) + SetupLoadedEditorAssemblies (903ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (7ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (188ms) + ProcessInitializeOnLoadAttributes (630ms) + ProcessInitializeOnLoadMethodAttributes (44ms) + AfterProcessingInitializeOnLoad (22ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5511. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.373100 ms (FindLiveObjects: 0.430000 ms CreateObjectMapping: 0.248700 ms MarkObjects: 2.656300 ms DeleteObjects: 0.036500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016897 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.621 seconds +Domain Reload Profiling: + ReloadAssembly (1622ms) + BeginReloadAssembly (284ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (76ms) + EndReloadAssembly (1057ms) + LoadAssemblies (226ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (346ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (62ms) + SetupLoadedEditorAssemblies (432ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (84ms) + ProcessInitializeOnLoadAttributes (265ms) + ProcessInitializeOnLoadMethodAttributes (59ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.0 KB). Loaded Objects now: 5514. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.281300 ms (FindLiveObjects: 0.331800 ms CreateObjectMapping: 0.187500 ms MarkObjects: 1.742800 ms DeleteObjects: 0.018200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 3509.741951 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '3d6653d1ac77e4d284ea72937544b83b') in 0.033670 seconds +======================================================================== +Received Import Request. + Time since last request: 65.736686 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '0cb047d5fa4e24c9d0976622f7834a61') in 0.003128 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013937 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.000 seconds +Domain Reload Profiling: + ReloadAssembly (2000ms) + BeginReloadAssembly (299ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (1427ms) + LoadAssemblies (314ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (800ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (327ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (90ms) + ProcessInitializeOnLoadAttributes (196ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5517. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.835400 ms (FindLiveObjects: 0.324200 ms CreateObjectMapping: 0.202300 ms MarkObjects: 2.290200 ms DeleteObjects: 0.017300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015823 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.916 seconds +Domain Reload Profiling: + ReloadAssembly (1919ms) + BeginReloadAssembly (220ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (75ms) + EndReloadAssembly (1548ms) + LoadAssemblies (153ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (657ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (577ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (246ms) + ProcessInitializeOnLoadMethodAttributes (168ms) + AfterProcessingInitializeOnLoad (77ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (28ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5520. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 4.278300 ms (FindLiveObjects: 1.062300 ms CreateObjectMapping: 0.753400 ms MarkObjects: 2.428700 ms DeleteObjects: 0.032300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014243 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.363 seconds +Domain Reload Profiling: + ReloadAssembly (2364ms) + BeginReloadAssembly (535ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (116ms) + EndReloadAssembly (1558ms) + LoadAssemblies (519ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (505ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (71ms) + SetupLoadedEditorAssemblies (548ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (20ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (104ms) + ProcessInitializeOnLoadAttributes (381ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 15.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5523. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 6.021500 ms (FindLiveObjects: 1.073200 ms CreateObjectMapping: 1.413700 ms MarkObjects: 3.454200 ms DeleteObjects: 0.077900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012632 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.809 seconds +Domain Reload Profiling: + ReloadAssembly (2810ms) + BeginReloadAssembly (621ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (44ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (80ms) + EndReloadAssembly (1734ms) + LoadAssemblies (486ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (656ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (118ms) + SetupLoadedEditorAssemblies (668ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (90ms) + ProcessInitializeOnLoadAttributes (517ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5526. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.070300 ms (FindLiveObjects: 0.400400 ms CreateObjectMapping: 0.243500 ms MarkObjects: 2.381300 ms DeleteObjects: 0.042700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 93.275125 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'c533b6e384536205b5c0bb308abc41d4') in 0.007973 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014980 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 4.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.752 seconds +Domain Reload Profiling: + ReloadAssembly (1753ms) + BeginReloadAssembly (511ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (15ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (103ms) + EndReloadAssembly (1063ms) + LoadAssemblies (466ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (367ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (341ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (4ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (204ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5529. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.894400 ms (FindLiveObjects: 0.813300 ms CreateObjectMapping: 0.568000 ms MarkObjects: 2.475800 ms DeleteObjects: 0.036100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 16.815026 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '58ac0d3400a49a1620e3610883475595') in 0.013032 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009238 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.17 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.058 seconds +Domain Reload Profiling: + ReloadAssembly (2059ms) + BeginReloadAssembly (515ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (17ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (172ms) + EndReloadAssembly (1368ms) + LoadAssemblies (313ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (599ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (308ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (187ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5532. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.594100 ms (FindLiveObjects: 0.361100 ms CreateObjectMapping: 0.194200 ms MarkObjects: 2.978500 ms DeleteObjects: 0.058000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014806 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.980 seconds +Domain Reload Profiling: + ReloadAssembly (981ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (720ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (163ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5535. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 3.565600 ms (FindLiveObjects: 0.354900 ms CreateObjectMapping: 0.200700 ms MarkObjects: 2.959100 ms DeleteObjects: 0.048900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 42.071241 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '1c5c502b920e1a885ccd60eaf02f6dd4') in 0.022832 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010641 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.999 seconds +Domain Reload Profiling: + ReloadAssembly (999ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (751ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5538. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 4.366800 ms (FindLiveObjects: 0.677000 ms CreateObjectMapping: 0.467200 ms MarkObjects: 3.109800 ms DeleteObjects: 0.109000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010254 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.004 seconds +Domain Reload Profiling: + ReloadAssembly (1004ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (740ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (310ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (251ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5541. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.886800 ms (FindLiveObjects: 0.558200 ms CreateObjectMapping: 0.228400 ms MarkObjects: 2.065400 ms DeleteObjects: 0.033400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011765 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.970 seconds +Domain Reload Profiling: + ReloadAssembly (971ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (713ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.18 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5544. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 4.905400 ms (FindLiveObjects: 0.406200 ms CreateObjectMapping: 0.181700 ms MarkObjects: 4.232600 ms DeleteObjects: 0.082700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010663 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.931 seconds +Domain Reload Profiling: + ReloadAssembly (1932ms) + BeginReloadAssembly (372ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (51ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (124ms) + EndReloadAssembly (1368ms) + LoadAssemblies (263ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (686ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (356ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (218ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.46 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5547. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.428500 ms (FindLiveObjects: 0.341600 ms CreateObjectMapping: 0.176600 ms MarkObjects: 2.870200 ms DeleteObjects: 0.039100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.023208 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.213 seconds +Domain Reload Profiling: + ReloadAssembly (2214ms) + BeginReloadAssembly (230ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (13ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (65ms) + EndReloadAssembly (1631ms) + LoadAssemblies (248ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (745ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (546ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (91ms) + ProcessInitializeOnLoadAttributes (380ms) + ProcessInitializeOnLoadMethodAttributes (48ms) + AfterProcessingInitializeOnLoad (20ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5550. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.954800 ms (FindLiveObjects: 0.592600 ms CreateObjectMapping: 0.228300 ms MarkObjects: 2.105600 ms DeleteObjects: 0.026600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010914 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.994 seconds +Domain Reload Profiling: + ReloadAssembly (995ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (728ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (266ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5553. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.252600 ms (FindLiveObjects: 0.554500 ms CreateObjectMapping: 0.279400 ms MarkObjects: 2.387100 ms DeleteObjects: 0.030500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012256 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.016 seconds +Domain Reload Profiling: + ReloadAssembly (1017ms) + BeginReloadAssembly (190ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (59ms) + EndReloadAssembly (719ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5556. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.771300 ms (FindLiveObjects: 0.575900 ms CreateObjectMapping: 0.247000 ms MarkObjects: 1.924500 ms DeleteObjects: 0.022200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010295 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.865 seconds +Domain Reload Profiling: + ReloadAssembly (1867ms) + BeginReloadAssembly (332ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (1272ms) + LoadAssemblies (566ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (383ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (346ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (206ms) + ProcessInitializeOnLoadMethodAttributes (43ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5559. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.575400 ms (FindLiveObjects: 0.371300 ms CreateObjectMapping: 0.184400 ms MarkObjects: 1.989200 ms DeleteObjects: 0.028200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011262 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.023 seconds +Domain Reload Profiling: + ReloadAssembly (1024ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (750ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (179ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5562. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.049800 ms (FindLiveObjects: 0.425000 ms CreateObjectMapping: 0.301100 ms MarkObjects: 2.285900 ms DeleteObjects: 0.036000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.036244 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.596 seconds +Domain Reload Profiling: + ReloadAssembly (1597ms) + BeginReloadAssembly (317ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (127ms) + EndReloadAssembly (883ms) + LoadAssemblies (178ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (318ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (312ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (186ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (35ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5565. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.923100 ms (FindLiveObjects: 0.508400 ms CreateObjectMapping: 0.225300 ms MarkObjects: 2.158200 ms DeleteObjects: 0.029600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012743 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.032 seconds +Domain Reload Profiling: + ReloadAssembly (1032ms) + BeginReloadAssembly (179ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (739ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (266ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (286ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5568. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.298800 ms (FindLiveObjects: 0.659700 ms CreateObjectMapping: 0.438400 ms MarkObjects: 2.174200 ms DeleteObjects: 0.024700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011399 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.097 seconds +Domain Reload Profiling: + ReloadAssembly (1098ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (822ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (357ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (235ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5571. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 3.755400 ms (FindLiveObjects: 1.089400 ms CreateObjectMapping: 0.355500 ms MarkObjects: 2.272100 ms DeleteObjects: 0.036800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017490 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.177 seconds +Domain Reload Profiling: + ReloadAssembly (1178ms) + BeginReloadAssembly (214ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (61ms) + EndReloadAssembly (858ms) + LoadAssemblies (126ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (339ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (307ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (185ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5574. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.557500 ms (FindLiveObjects: 0.393200 ms CreateObjectMapping: 0.184300 ms MarkObjects: 1.959800 ms DeleteObjects: 0.019100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014084 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.006 seconds +Domain Reload Profiling: + ReloadAssembly (1006ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (731ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (269ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.27 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5577. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 3.064700 ms (FindLiveObjects: 0.568700 ms CreateObjectMapping: 0.506400 ms MarkObjects: 1.948900 ms DeleteObjects: 0.039400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014329 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.010 seconds +Domain Reload Profiling: + ReloadAssembly (1010ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (756ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (256ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (310ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (190ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5580. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.916700 ms (FindLiveObjects: 0.450500 ms CreateObjectMapping: 0.229000 ms MarkObjects: 3.200300 ms DeleteObjects: 0.035000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011165 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.050 seconds +Domain Reload Profiling: + ReloadAssembly (1051ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (781ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (292ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (291ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5583. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.828400 ms (FindLiveObjects: 0.482800 ms CreateObjectMapping: 0.219500 ms MarkObjects: 2.099000 ms DeleteObjects: 0.026000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011048 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.087 seconds +Domain Reload Profiling: + ReloadAssembly (1087ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (799ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (278ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (314ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (198ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5586. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.171400 ms (FindLiveObjects: 0.440900 ms CreateObjectMapping: 0.248300 ms MarkObjects: 2.442600 ms DeleteObjects: 0.038000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009941 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.008 seconds +Domain Reload Profiling: + ReloadAssembly (1008ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (755ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (280ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5589. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 5.424500 ms (FindLiveObjects: 1.024800 ms CreateObjectMapping: 0.355600 ms MarkObjects: 4.005100 ms DeleteObjects: 0.036600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010671 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.050 seconds +Domain Reload Profiling: + ReloadAssembly (1051ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (743ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (277ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.42 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5592. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.256800 ms (FindLiveObjects: 0.541800 ms CreateObjectMapping: 0.298000 ms MarkObjects: 2.377000 ms DeleteObjects: 0.038500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011763 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.094 seconds +Domain Reload Profiling: + ReloadAssembly (1095ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (815ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (361ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5595. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.666800 ms (FindLiveObjects: 0.358000 ms CreateObjectMapping: 0.181600 ms MarkObjects: 2.101400 ms DeleteObjects: 0.024800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016388 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.087 seconds +Domain Reload Profiling: + ReloadAssembly (1088ms) + BeginReloadAssembly (211ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (71ms) + EndReloadAssembly (776ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (297ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (179ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5598. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.058400 ms (FindLiveObjects: 0.343000 ms CreateObjectMapping: 0.166200 ms MarkObjects: 2.519100 ms DeleteObjects: 0.028100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010137 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.018 seconds +Domain Reload Profiling: + ReloadAssembly (1019ms) + BeginReloadAssembly (186ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (723ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (260ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5601. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.941400 ms (FindLiveObjects: 0.581900 ms CreateObjectMapping: 0.333800 ms MarkObjects: 1.990400 ms DeleteObjects: 0.033900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016691 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.217 seconds +Domain Reload Profiling: + ReloadAssembly (1218ms) + BeginReloadAssembly (214ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (59ms) + EndReloadAssembly (831ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (342ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (52ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5604. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.893600 ms (FindLiveObjects: 0.369200 ms CreateObjectMapping: 0.177100 ms MarkObjects: 2.318800 ms DeleteObjects: 0.027000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.035530 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.257 seconds +Domain Reload Profiling: + ReloadAssembly (1258ms) + BeginReloadAssembly (218ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (55ms) + EndReloadAssembly (905ms) + LoadAssemblies (172ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (335ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (329ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (86ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5607. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.818500 ms (FindLiveObjects: 0.382000 ms CreateObjectMapping: 0.215200 ms MarkObjects: 3.162000 ms DeleteObjects: 0.057100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013213 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.109 seconds +Domain Reload Profiling: + ReloadAssembly (1109ms) + BeginReloadAssembly (209ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (65ms) + EndReloadAssembly (779ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (314ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5610. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 2.875100 ms (FindLiveObjects: 0.344100 ms CreateObjectMapping: 0.175800 ms MarkObjects: 2.311600 ms DeleteObjects: 0.042300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015635 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.053 seconds +Domain Reload Profiling: + ReloadAssembly (1054ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (780ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (307ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (270ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5613. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 2.407900 ms (FindLiveObjects: 0.332900 ms CreateObjectMapping: 0.166000 ms MarkObjects: 1.888700 ms DeleteObjects: 0.019400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014231 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.946 seconds +Domain Reload Profiling: + ReloadAssembly (947ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (694ms) + LoadAssemblies (99ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (245ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5616. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 2.955800 ms (FindLiveObjects: 0.471000 ms CreateObjectMapping: 0.211500 ms MarkObjects: 2.233800 ms DeleteObjects: 0.037700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011875 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.040 seconds +Domain Reload Profiling: + ReloadAssembly (1041ms) + BeginReloadAssembly (173ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (759ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (307ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5619. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.352100 ms (FindLiveObjects: 0.496300 ms CreateObjectMapping: 0.248400 ms MarkObjects: 2.561600 ms DeleteObjects: 0.043800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013856 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.240 seconds +Domain Reload Profiling: + ReloadAssembly (1241ms) + BeginReloadAssembly (208ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (59ms) + EndReloadAssembly (922ms) + LoadAssemblies (146ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (379ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (319ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (185ms) + ProcessInitializeOnLoadMethodAttributes (37ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5622. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 3.200200 ms (FindLiveObjects: 0.569100 ms CreateObjectMapping: 0.268800 ms MarkObjects: 2.324200 ms DeleteObjects: 0.035900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.031633 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.084 seconds +Domain Reload Profiling: + ReloadAssembly (1084ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (787ms) + LoadAssemblies (148ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (182ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5625. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.513000 ms (FindLiveObjects: 0.396100 ms CreateObjectMapping: 0.184900 ms MarkObjects: 1.908100 ms DeleteObjects: 0.022900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010298 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.973 seconds +Domain Reload Profiling: + ReloadAssembly (974ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (703ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (259ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (267ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5628. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.449100 ms (FindLiveObjects: 0.380900 ms CreateObjectMapping: 0.197500 ms MarkObjects: 1.847600 ms DeleteObjects: 0.021700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010093 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.956 seconds +Domain Reload Profiling: + ReloadAssembly (956ms) + BeginReloadAssembly (164ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (698ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (263ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (263ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.28 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5631. +Memory consumption went from 165.7 MB to 165.6 MB. +Total: 4.474500 ms (FindLiveObjects: 0.858800 ms CreateObjectMapping: 0.829400 ms MarkObjects: 2.699100 ms DeleteObjects: 0.083400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011164 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.019 seconds +Domain Reload Profiling: + ReloadAssembly (1020ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (731ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (278ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Callback registration failed. Increase kMaxCallback. +Fatal Error! Callback registration failed. Increase kMaxCallback. +Crash!!! +SymInit: Symbol-SearchPath: 'D:/Unity/2021.3.27f1c2/Editor/Data/Mono;.;D:\myproject\unity\JNFrame;D:\myproject\unity\JNFrame\Library\BurstCache\JIT;D:\Unity\2021.3.27f1c2\Editor;C:\WINDOWS;C:\WINDOWS\system32;', symOptions: 534, UserName: 'Administrator' +OS-Version: 10.0.0 +D:\Unity\2021.3.27f1c2\Editor\Unity.exe:Unity.exe (00007FF6FF7E0000), size: 81166336 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2021.3.27.15766 +C:\WINDOWS\SYSTEM32\ntdll.dll:ntdll.dll (00007FFEC0890000), size: 2191360 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\KERNEL32.DLL:KERNEL32.DLL (00007FFEBEDF0000), size: 802816 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\KERNELBASE.dll:KERNELBASE.dll (00007FFEBDBD0000), size: 3825664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\user32.dll:user32.dll (00007FFEBE930000), size: 1761280 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\win32u.dll:win32u.dll (00007FFEBE490000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\GDI32.dll:GDI32.dll (00007FFEC07A0000), size: 167936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\gdi32full.dll:gdi32full.dll (00007FFEBE4C0000), size: 1146880 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2861 +C:\WINDOWS\System32\msvcp_win.dll:msvcp_win.dll (00007FFEBE3F0000), size: 630784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\ucrtbase.dll:ucrtbase.dll (00007FFEBE1E0000), size: 1118208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\advapi32.dll:advapi32.dll (00007FFEC0620000), size: 733184 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\msvcrt.dll:msvcrt.dll (00007FFEBE780000), size: 684032 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.22621.2506 +C:\WINDOWS\System32\sechost.dll:sechost.dll (00007FFEBECD0000), size: 688128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\bcrypt.dll:bcrypt.dll (00007FFEBDF80000), size: 163840 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\RPCRT4.dll:RPCRT4.dll (00007FFEBEBA0000), size: 1142784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\shell32.dll:shell32.dll (00007FFEBF730000), size: 8757248 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\setupapi.dll:setupapi.dll (00007FFEC0180000), size: 4669440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\iphlpapi.dll:iphlpapi.dll (00007FFEBC730000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\psapi.dll:psapi.dll (00007FFEBFF90000), size: 32768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\hid.dll:hid.dll (00007FFEBC420000), size: 57344 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\WS2_32.dll:WS2_32.dll (00007FFEBF160000), size: 462848 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\WINTRUST.dll:WINTRUST.dll (00007FFEBE380000), size: 438272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\OLEAUT32.dll:OLEAUT32.dll (00007FFEBE5E0000), size: 880640 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\combase.dll:combase.dll (00007FFEBF3A0000), size: 3706880 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\dhcpcsvc.dll:dhcpcsvc.dll (00007FFEB81B0000), size: 126976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\dhcpcsvc6.dll:dhcpcsvc6.dll (00007FFEB81F0000), size: 102400 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\wsock32.dll:wsock32.dll (00007FFEB0740000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\IMM32.dll:IMM32.dll (00007FFEC0700000), size: 200704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\ole32.dll:ole32.dll (00007FFEBEFC0000), size: 1703936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\libfbxsdk.dll:libfbxsdk.dll (00007FFE7A140000), size: 10067968 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2020.3.3.0 +D:\Unity\2021.3.27f1c2\Editor\optix.6.0.0.dll:optix.6.0.0.dll (00007FFE9C190000), size: 208896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.0.0.0 +D:\Unity\2021.3.27f1c2\Editor\s3tcompress.dll:s3tcompress.dll (00007FFE9C220000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\System32\SHLWAPI.dll:SHLWAPI.dll (00007FFEBED90000), size: 385024 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\CRYPT32.dll:CRYPT32.dll (00007FFEBDFB0000), size: 1466368 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\etccompress.dll:etccompress.dll (00007FFE78CE0000), size: 5066752 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\ispc_texcomp.dll:ispc_texcomp.dll (00007FFE811A0000), size: 1740800 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\compress_bc7e.dll:compress_bc7e.dll (00007FFE7E9B0000), size: 1441792 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\FreeImage.dll:FreeImage.dll (0000000180000000), size: 6582272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.18.0.0 +D:\Unity\2021.3.27f1c2\Editor\OpenImageDenoise.dll:OpenImageDenoise.dll (00007FFE29A30000), size: 48848896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.4.2.0 +D:\Unity\2021.3.27f1c2\Editor\WinPixEventRuntime.dll:WinPixEventRuntime.dll (00007FFEBAE30000), size: 45056 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.0.1812.6001 +D:\Unity\2021.3.27f1c2\Editor\umbraoptimizer64.dll:umbraoptimizer64.dll (00007FFE7E880000), size: 1187840 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\RadeonImageFilters.dll:RadeonImageFilters.dll (00007FFE79E60000), size: 2961408 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.7.0.0 +D:\Unity\2021.3.27f1c2\Editor\SketchUpAPI.dll:SketchUpAPI.dll (00007FFE2CF60000), size: 8990720 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 23.0.0.0 +C:\WINDOWS\SYSTEM32\VERSION.dll:VERSION.dll (00007FFEB6E90000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\dwmapi.dll:dwmapi.dll (00007FFEBB570000), size: 176128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\WINMM.dll:WINMM.dll (00007FFEB3410000), size: 212992 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\WINHTTP.dll:WINHTTP.dll (00007FFEB8410000), size: 1273856 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\GLU32.dll:GLU32.dll (00007FFEB0CB0000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\OPENGL32.dll:OPENGL32.dll (00007FFE8C8E0000), size: 1048576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\MSVCP140.dll:MSVCP140.dll (00007FFE9D770000), size: 581632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll:VCRUNTIME140.dll (00007FFEAFC70000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +D:\Unity\2021.3.27f1c2\Editor\tbb12.dll:tbb12.dll (00007FFE89030000), size: 434176 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\RadeonML.dll:RadeonML.dll (00007FFEB1F90000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 0.9.11.0 +D:\Unity\2021.3.27f1c2\Editor\SketchUpCommonPreferences.dll:SketchUpCommonPreferences.dll (00007FFE87B30000), size: 499712 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 23.0.0.0 +C:\WINDOWS\SYSTEM32\VCRUNTIME140_1.dll:VCRUNTIME140_1.dll (00007FFEB16B0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +C:\WINDOWS\SYSTEM32\Secur32.dll:Secur32.dll (00007FFEBCAC0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +D:\Unity\2021.3.27f1c2\Editor\tbbmalloc.dll:tbbmalloc.dll (00007FFE8BCF0000), size: 282624 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\dxcore.dll:dxcore.dll (00007FFEBB240000), size: 221184 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\SSPICLI.DLL:SSPICLI.DLL (00007FFEBCF50000), size: 274432 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +D:\Unity\2021.3.27f1c2\Editor\OpenRL.dll:OpenRL.dll (000001541A120000), size: 12779520 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.5.0.2907 +D:\Unity\2021.3.27f1c2\Editor\embree.dll:embree.dll (00007FFE28A40000), size: 16711680 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.14.0.0 +C:\WINDOWS\SYSTEM32\MSVCP100.dll:MSVCP100.dll (0000000073640000), size: 622592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.40219.325 +C:\WINDOWS\SYSTEM32\MSVCR100.dll:MSVCR100.dll (0000000073560000), size: 860160 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.40219.325 +D:\Unity\2021.3.27f1c2\Editor\tbb.dll:tbb.dll (00007FFE86890000), size: 413696 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2017.0.2016.1004 +C:\WINDOWS\SYSTEM32\MSVCP120.dll:MSVCP120.dll (00007FFE861D0000), size: 679936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.40649.5 +C:\WINDOWS\SYSTEM32\MSVCR120.dll:MSVCR120.dll (00007FFE7E790000), size: 978944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.40649.5 +D:\Unity\2021.3.27f1c2\Editor\OpenRL_pthread.dll:OpenRL_pthread.dll (000001541AD70000), size: 61440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.9.0.0 +C:\WINDOWS\SYSTEM32\MSASN1.dll:MSASN1.dll (00007FFEBD420000), size: 73728 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\CRYPTSP.dll:CRYPTSP.dll (00007FFEBD3C0000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\rsaenh.dll:rsaenh.dll (00007FFEBCC50000), size: 217088 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\CRYPTBASE.dll:CRYPTBASE.dll (00007FFEBD3E0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\bcryptPrimitives.dll:bcryptPrimitives.dll (00007FFEBE300000), size: 499712 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\MSWSOCK.DLL:MSWSOCK.DLL (00007FFEBD170000), size: 430080 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\cfgmgr32.DLL:cfgmgr32.DLL (00007FFEBD8C0000), size: 319488 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\kernel.appcore.dll:kernel.appcore.dll (00007FFEBCCF0000), size: 98304 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2715 +C:\WINDOWS\system32\uxtheme.dll:uxtheme.dll (00007FFEBB160000), size: 700416 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\shcore.dll:shcore.dll (00007FFEBEEC0000), size: 995328 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2715 +C:\WINDOWS\SYSTEM32\windows.storage.dll:windows.storage.dll (00007FFEBBB20000), size: 9396224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wintypes.dll:wintypes.dll (00007FFEBB9E0000), size: 1302528 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\profapi.dll:profapi.dll (00007FFEBDB00000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\IconCodecService.dll:IconCodecService.dll (00007FFEB0970000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\WindowsCodecs.dll:WindowsCodecs.dll (00007FFEB93F0000), size: 1769472 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\clbcatq.dll:clbcatq.dll (00007FFEBEAF0000), size: 720896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2001.12.10941.16384 +C:\WINDOWS\System32\netprofm.dll:netprofm.dll (00007FFEB9130000), size: 491520 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\NSI.dll:NSI.dll (00007FFEBED80000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\DNSAPI.dll:DNSAPI.dll (00007FFEBC760000), size: 1019904 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\npmproxy.dll:npmproxy.dll (00007FFEB7640000), size: 98304 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\napinsp.dll:napinsp.dll (00007FFE9F0C0000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\system32\pnrpnsp.dll:pnrpnsp.dll (00007FFE9EE10000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\winrnr.dll:winrnr.dll (00007FFE9EDF0000), size: 69632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\system32\wshbth.dll:wshbth.dll (00007FFE9EDD0000), size: 86016 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\nlansp_c.dll:nlansp_c.dll (00007FFE9EDA0000), size: 135168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\fwpuclnt.dll:fwpuclnt.dll (00007FFEB78A0000), size: 536576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\Windows\System32\rasadhlp.dll:rasadhlp.dll (00007FFEAD240000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +D:\Unity\2021.3.27f1c2\Editor\NVUnityPlugin.DLL:NVUnityPlugin.DLL (00007FFE62760000), size: 1536000 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\Data\Tools\astcenc-avx2.dll:astcenc-avx2.dll (00007FFE48000000), size: 561152 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\d3d11.dll:d3d11.dll (00007FFEBA2B0000), size: 2453504 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\dxgi.dll:dxgi.dll (00007FFEBB290000), size: 1015808 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\directxdatabasehelper.dll:directxdatabasehelper.dll (00007FFEB8030000), size: 303104 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\nvldumdx.dll:nvldumdx.dll (00007FFEB43B0000), size: 770048 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 31.0.15.3623 +C:\WINDOWS\SYSTEM32\cryptnet.dll:cryptnet.dll (00007FFEB6E30000), size: 204800 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\drvstore.dll:drvstore.dll (00007FFEB6CD0000), size: 1409024 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\devobj.dll:devobj.dll (00007FFEBD890000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\wldp.dll:wldp.dll (00007FFEBD490000), size: 307200 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\imagehlp.dll:imagehlp.dll (00007FFEC0600000), size: 126976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\nvwgf2umx.dll:nvwgf2umx.dll (00007FFEA6A80000), size: 99463168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 31.0.15.3623 +C:\WINDOWS\system32\nvspcap64.dll:nvspcap64.dll (00007FFE8D340000), size: 2953216 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.27.0.112 +C:\WINDOWS\SYSTEM32\ntmarta.dll:ntmarta.dll (00007FFEBCD10000), size: 212992 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\Display.NvContainer\MessageBus.dll:MessageBus.dll (00007FFEA3BE0000), size: 7565312 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.22.2758.1620 +C:\WINDOWS\system32\wbem\wbemprox.dll:wbemprox.dll (00007FFEB5D40000), size: 65536 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wbemcomn.dll:wbemcomn.dll (00007FFEB5CC0000), size: 524288 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\wbem\wbemsvc.dll:wbemsvc.dll (00007FFEAD250000), size: 81920 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\system32\wbem\fastprox.dll:fastprox.dll (00007FFEAD270000), size: 1015808 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\amsi.dll:amsi.dll (00007FFEACF70000), size: 118784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\USERENV.dll:USERENV.dll (00007FFEBD260000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.23110.3-0\MpOav.dll:MpOav.dll (00007FFEACE50000), size: 507904 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 4.18.23110.3 +D:\Unity\2021.3.27f1c2\Editor\cudart64_90.dll:cudart64_90.dll (00007FFE43670000), size: 397312 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.14.11.9000 +C:\WINDOWS\SYSTEM32\opencl.dll:opencl.dll (00007FFE2DF20000), size: 1490944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.0.3.0 +D:\Unity\2021.3.27f1c2\Editor\radeonrays.dll:radeonrays.dll (00007FFE42630000), size: 557056 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\Data\MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll:mono-2.0-bdwgc.dll (00007FFE253E0000), size: 10682368 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\PROPSYS.dll:PROPSYS.dll (00007FFEB8D80000), size: 1052672 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.22621.2506 +C:\Windows\System32\Windows.System.Launcher.dll:Windows.System.Launcher.dll (00007FFEB69E0000), size: 1265664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\Windows\System32\msvcp110_win.dll:msvcp110_win.dll (00007FFEB9350000), size: 602112 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\windows.staterepositorycore.dll:windows.staterepositorycore.dll (00007FFEB6980000), size: 106496 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.2506_none_270c5ae97388e100\comctl32.dll:comctl32.dll (00007FFEB2400000), size: 2699264 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.10.22621.2506 +C:\Windows\System32\thumbcache.dll:thumbcache.dll (00007FFEA5810000), size: 438272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\policymanager.dll:policymanager.dll (00007FFEB9990000), size: 675840 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\dbghelp.dll:dbghelp.dll (00007FFEB2950000), size: 2306048 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 + +========== OUTPUTTING STACK TRACE ================== + +0x00007FFEBDC3567C (KERNELBASE) RaiseException +0x00007FF7011D8AFB (Unity) EditorMonoConsole::LogToConsoleImplementation +0x00007FF7011D95ED (Unity) EditorMonoConsole::LogToConsoleImplementation +0x00007FF701E68077 (Unity) DebugStringToFilePostprocessedStacktrace +0x00007FF701E677CD (Unity) DebugStringToFile +0x00007FF7016554D5 (Unity) LoadDomainAndUserAssemblies +0x00007FF701655B64 (Unity) LoadUserAssemblies +0x00007FF701B4DFFF (Unity) ::operator() +0x00007FF701B8F9A2 (Unity) asio::detail::completion_handler,asio::io_context::basic_executor_type,0> >::do_complete +0x00007FF701B7B88E (Unity) asio::detail::win_iocp_io_context::do_one +0x00007FF701B7D4F4 (Unity) asio::detail::win_iocp_io_context::run +0x00007FF701B8DD8E (Unity) IOService::Run +0x00007FF701B6049F (Unity) AssetImportWorkerClient::Run +0x00007FF701B28AA3 (Unity) RunAssetImportWorkerClientV2 +0x00007FF701B28B2B (Unity) RunAssetImporterV2 +0x00007FF701358828 (Unity) Application::InitializeProject +0x00007FF7017A5478 (Unity) WinMain +0x00007FF702BA360E (Unity) __scrt_common_main_seh +0x00007FFEBEE0257D (KERNEL32) BaseThreadInitThunk +0x00007FFEC08EAA58 (ntdll) RtlUserThreadStart + +========== END OF STACKTRACE =========== + +A crash has been intercepted by the crash handler. For call stack and other details, see the latest crash report generated in: + * C:/Users/ADMINI~1/AppData/Local/Temp/Unity/Editor/Crashes diff --git a/JNFrame/Logs/AssetImportWorker0.log b/JNFrame/Logs/AssetImportWorker0.log new file mode 100644 index 00000000..e148dddc --- /dev/null +++ b/JNFrame/Logs/AssetImportWorker0.log @@ -0,0 +1,7362 @@ +Using pre-set license +Built from '2021.3/china_unity/release' branch; Version is '2021.3.27f1c2 (3b3d9646cb47) revision 3882390'; Using compiler version '192829333'; Build Type 'Release' +OS: 'Windows 11 (10.0.22621) 64bit Professional' Language: 'zh' Physical Memory: 32651 MB +BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1 + +COMMAND LINE ARGUMENTS: +D:\Unity\2021.3.27f1c2\Editor\Unity.exe +-adb2 +-batchMode +-noUpm +-name +AssetImportWorker0 +-projectPath +D:/myproject/unity/JNFrame +-logFile +Logs/AssetImportWorker0.log +-srvPort +64124 +Successfully changed project path to: D:/myproject/unity/JNFrame +D:/myproject/unity/JNFrame +[UnityMemory] Configuration Parameters - Can be set up in boot.config + "memorysetup-bucket-allocator-granularity=16" + "memorysetup-bucket-allocator-bucket-count=8" + "memorysetup-bucket-allocator-block-size=33554432" + "memorysetup-bucket-allocator-block-count=8" + "memorysetup-main-allocator-block-size=16777216" + "memorysetup-thread-allocator-block-size=16777216" + "memorysetup-gfx-main-allocator-block-size=16777216" + "memorysetup-gfx-thread-allocator-block-size=16777216" + "memorysetup-cache-allocator-block-size=4194304" + "memorysetup-typetree-allocator-block-size=2097152" + "memorysetup-profiler-bucket-allocator-granularity=16" + "memorysetup-profiler-bucket-allocator-bucket-count=8" + "memorysetup-profiler-bucket-allocator-block-size=33554432" + "memorysetup-profiler-bucket-allocator-block-count=8" + "memorysetup-profiler-allocator-block-size=16777216" + "memorysetup-profiler-editor-allocator-block-size=1048576" + "memorysetup-temp-allocator-size-main=16777216" + "memorysetup-job-temp-allocator-block-size=2097152" + "memorysetup-job-temp-allocator-block-size-background=1048576" + "memorysetup-job-temp-allocator-reduction-small-platforms=262144" + "memorysetup-temp-allocator-size-background-worker=32768" + "memorysetup-temp-allocator-size-job-worker=262144" + "memorysetup-temp-allocator-size-preload-manager=33554432" + "memorysetup-temp-allocator-size-nav-mesh-worker=65536" + "memorysetup-temp-allocator-size-audio-worker=65536" + "memorysetup-temp-allocator-size-cloud-worker=32768" + "memorysetup-temp-allocator-size-gi-baking-worker=262144" + "memorysetup-temp-allocator-size-gfx=262144" +Player connection [19944] Host "[IP] 192.168.0.130 [Port] 0 [Flags] 2 [Guid] 1190182479 [EditorId] 1190182479 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... + +Player connection [19944] Host "[IP] 192.168.0.130 [Port] 0 [Flags] 2 [Guid] 1190182479 [EditorId] 1190182479 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... + +AS: AutoStreaming module initializing. +Refreshing native plugins compatible for Editor in 130.48 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Initialize engine version: 2021.3.27f1c2 (3b3d9646cb47) +[Subsystems] Discovering subsystems at path D:/Unity/2021.3.27f1c2/Editor/Data/Resources/UnitySubsystems +[Subsystems] Discovering subsystems at path D:/myproject/unity/JNFrame/Assets +GfxDevice: creating device client; threaded=0; jobified=0 +Direct3D: + Version: Direct3D 11.0 [level 11.1] + Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) + Vendor: NVIDIA + VRAM: 5980 MB + Driver: 31.0.15.3623 +Initialize mono +Mono path[0] = 'D:/Unity/2021.3.27f1c2/Editor/Data/Managed' +Mono path[1] = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' +Mono config path = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/etc' +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56268 +Begin MonoManager ReloadAssembly +Registering precompiled unity dll's ... +Register platform support module: D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll +Registered in 0.008832 seconds. +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 131.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.204 seconds +Domain Reload Profiling: + ReloadAssembly (1204ms) + BeginReloadAssembly (217ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (0ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (21ms) + EndReloadAssembly (720ms) + LoadAssemblies (174ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (280ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (325ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (131ms) + BeforeProcessingInitializeOnLoad (2ms) + ProcessInitializeOnLoadAttributes (134ms) + ProcessInitializeOnLoadMethodAttributes (50ms) + AfterProcessingInitializeOnLoad (0ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (0ms) +Platform modules already initialized, skipping +Registering precompiled user dll's ... +Registered in 0.014100 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.345 seconds +Domain Reload Profiling: + ReloadAssembly (1346ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (28ms) + EndReloadAssembly (1023ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (362ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (435ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (104ms) + ProcessInitializeOnLoadAttributes (277ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +======================================================================== +Worker process is ready to serve import requests +Launched and connected shader compiler UnityShaderCompiler.exe after 0.05 seconds +Refreshing native plugins compatible for Editor in 0.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 30 unused Assets / (46.6 KB). Loaded Objects now: 5260. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 5.150900 ms (FindLiveObjects: 0.805100 ms CreateObjectMapping: 0.555800 ms MarkObjects: 3.682000 ms DeleteObjects: 0.105100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 1301.820152 seconds. + path: Assets/Script/WorldMain.cs + artifactKey: Guid(b743a7d5bf6eb594e88950ac045b93be) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/WorldMain.cs using Guid(b743a7d5bf6eb594e88950ac045b93be) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '9e23b214dd5cc61e868182350690912a') in 0.068528 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012286 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.29 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.174 seconds +Domain Reload Profiling: + ReloadAssembly (1174ms) + BeginReloadAssembly (164ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (911ms) + LoadAssemblies (95ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (430ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5264. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.634700 ms (FindLiveObjects: 0.280800 ms CreateObjectMapping: 0.140700 ms MarkObjects: 2.183900 ms DeleteObjects: 0.027900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 1888.314716 seconds. + path: Assets/Script/AppImpl + artifactKey: Guid(4d1dd27990674b32820075e52dcbda67) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/AppImpl using Guid(4d1dd27990674b32820075e52dcbda67) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'c239ecf747d04b50c62d54c683e37d99') in 0.033757 seconds +======================================================================== +Received Import Request. + Time since last request: 2.720646 seconds. + path: Assets/Script/UIMain.cs + artifactKey: Guid(b87c4476f7ad6954e91fa3172d2b723a) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/UIMain.cs using Guid(b87c4476f7ad6954e91fa3172d2b723a) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '115bb65f7a272e6a88a504014a6063a2') in 0.007636 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009667 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.025 seconds +Domain Reload Profiling: + ReloadAssembly (1026ms) + BeginReloadAssembly (177ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (716ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (255ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (264ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (156ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5267. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.526400 ms (FindLiveObjects: 0.324600 ms CreateObjectMapping: 0.161900 ms MarkObjects: 2.017300 ms DeleteObjects: 0.021200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 307.528303 seconds. + path: Assets/Resources/UIScene.unity + artifactKey: Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Resources/UIScene.unity using Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '32dc05f2137fbb24c172a45d78b82445') in 0.012923 seconds +======================================================================== +Received Import Request. + Time since last request: 7.988100 seconds. + path: Assets/Resources/WorldScene.unity + artifactKey: Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Resources/WorldScene.unity using Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'ffef42ebea36be5c59c634091af010ff') in 0.007388 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013424 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.052 seconds +Domain Reload Profiling: + ReloadAssembly (1053ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (770ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (300ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.51 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5270. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 5.728200 ms (FindLiveObjects: 0.905600 ms CreateObjectMapping: 0.530800 ms MarkObjects: 4.204200 ms DeleteObjects: 0.084000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009686 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.928 seconds +Domain Reload Profiling: + ReloadAssembly (928ms) + BeginReloadAssembly (148ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (684ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (242ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (154ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5273. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.277500 ms (FindLiveObjects: 0.296300 ms CreateObjectMapping: 0.148600 ms MarkObjects: 1.810100 ms DeleteObjects: 0.021300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015351 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.137 seconds +Domain Reload Profiling: + ReloadAssembly (1138ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (896ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (367ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (70ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5276. +Memory consumption went from 164.2 MB to 164.2 MB. +Total: 2.476000 ms (FindLiveObjects: 0.309100 ms CreateObjectMapping: 0.150800 ms MarkObjects: 1.996900 ms DeleteObjects: 0.018300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014054 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.889 seconds +Domain Reload Profiling: + ReloadAssembly (889ms) + BeginReloadAssembly (139ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (33ms) + EndReloadAssembly (660ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (226ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5279. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.386400 ms (FindLiveObjects: 0.284000 ms CreateObjectMapping: 0.209600 ms MarkObjects: 1.874200 ms DeleteObjects: 0.017600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011975 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.056 seconds +Domain Reload Profiling: + ReloadAssembly (1057ms) + BeginReloadAssembly (175ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (758ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (331ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (247ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (151ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5282. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 3.401300 ms (FindLiveObjects: 0.266800 ms CreateObjectMapping: 0.141000 ms MarkObjects: 2.960600 ms DeleteObjects: 0.031500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015676 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.987 seconds +Domain Reload Profiling: + ReloadAssembly (988ms) + BeginReloadAssembly (141ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (731ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (249ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (145ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5285. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 2.440400 ms (FindLiveObjects: 0.297900 ms CreateObjectMapping: 0.147500 ms MarkObjects: 1.972700 ms DeleteObjects: 0.021100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012383 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.957 seconds +Domain Reload Profiling: + ReloadAssembly (958ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (697ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5288. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 2.541900 ms (FindLiveObjects: 0.301100 ms CreateObjectMapping: 0.168300 ms MarkObjects: 2.043300 ms DeleteObjects: 0.028000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009993 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.06 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.013 seconds +Domain Reload Profiling: + ReloadAssembly (1014ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (737ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (287ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (246ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (150ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5291. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.207300 ms (FindLiveObjects: 0.274600 ms CreateObjectMapping: 0.157400 ms MarkObjects: 1.750000 ms DeleteObjects: 0.023700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012898 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.003 seconds +Domain Reload Profiling: + ReloadAssembly (1004ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (753ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (313ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (249ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (148ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.18 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5294. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.319400 ms (FindLiveObjects: 0.309600 ms CreateObjectMapping: 0.156300 ms MarkObjects: 1.828300 ms DeleteObjects: 0.024100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010313 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.968 seconds +Domain Reload Profiling: + ReloadAssembly (968ms) + BeginReloadAssembly (143ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (737ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (297ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (255ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (146ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5297. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.216600 ms (FindLiveObjects: 0.278200 ms CreateObjectMapping: 0.139100 ms MarkObjects: 1.780800 ms DeleteObjects: 0.017600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014119 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.961 seconds +Domain Reload Profiling: + ReloadAssembly (961ms) + BeginReloadAssembly (145ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (711ms) + LoadAssemblies (94ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (240ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.06 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5300. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.443900 ms (FindLiveObjects: 0.294300 ms CreateObjectMapping: 0.165300 ms MarkObjects: 1.958600 ms DeleteObjects: 0.024700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012331 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.994 seconds +Domain Reload Profiling: + ReloadAssembly (995ms) + BeginReloadAssembly (142ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (752ms) + LoadAssemblies (97ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (260ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (305ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5303. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.790300 ms (FindLiveObjects: 0.395100 ms CreateObjectMapping: 0.203600 ms MarkObjects: 2.158200 ms DeleteObjects: 0.031600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 702.400692 seconds. + path: Assets/Resources/UIScene.unity + artifactKey: Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Resources/UIScene.unity using Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '98f33ffa9ec6e3ada7433fc19fc4e877') in 0.008526 seconds +======================================================================== +Received Import Request. + Time since last request: 2.742862 seconds. + path: Assets/Scenes/SampleScene.unity + artifactKey: Guid(9fc0d4010bbf28b4594072e72b8655ab) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/SampleScene.unity using Guid(9fc0d4010bbf28b4594072e72b8655ab) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'd0711570ab26322c668cd7295179f7b3') in 0.007468 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009974 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.023 seconds +Domain Reload Profiling: + ReloadAssembly (1023ms) + BeginReloadAssembly (180ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (735ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (283ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5306. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.619800 ms (FindLiveObjects: 0.303200 ms CreateObjectMapping: 0.165000 ms MarkObjects: 2.123400 ms DeleteObjects: 0.027100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012149 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.003 seconds +Domain Reload Profiling: + ReloadAssembly (1004ms) + BeginReloadAssembly (173ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (714ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (262ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5309. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.772000 ms (FindLiveObjects: 0.324100 ms CreateObjectMapping: 0.173300 ms MarkObjects: 2.243600 ms DeleteObjects: 0.029600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014280 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.019 seconds +Domain Reload Profiling: + ReloadAssembly (1019ms) + BeginReloadAssembly (141ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (770ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (282ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5312. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.419600 ms (FindLiveObjects: 0.319300 ms CreateObjectMapping: 0.198600 ms MarkObjects: 1.876800 ms DeleteObjects: 0.023800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013389 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.019 seconds +Domain Reload Profiling: + ReloadAssembly (1019ms) + BeginReloadAssembly (145ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (776ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (301ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (280ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5315. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.565000 ms (FindLiveObjects: 0.322500 ms CreateObjectMapping: 0.160600 ms MarkObjects: 2.058400 ms DeleteObjects: 0.022200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009541 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.962 seconds +Domain Reload Profiling: + ReloadAssembly (962ms) + BeginReloadAssembly (145ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (717ms) + LoadAssemblies (98ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (260ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5318. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 2.675800 ms (FindLiveObjects: 0.367400 ms CreateObjectMapping: 0.180000 ms MarkObjects: 2.098700 ms DeleteObjects: 0.028000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013770 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.019 seconds +Domain Reload Profiling: + ReloadAssembly (1019ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (750ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (263ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (297ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (183ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.26 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5321. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 2.639200 ms (FindLiveObjects: 0.346900 ms CreateObjectMapping: 0.209500 ms MarkObjects: 2.038100 ms DeleteObjects: 0.042800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011442 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.985 seconds +Domain Reload Profiling: + ReloadAssembly (986ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (709ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (269ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (257ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5324. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.677900 ms (FindLiveObjects: 0.422700 ms CreateObjectMapping: 0.210000 ms MarkObjects: 2.019400 ms DeleteObjects: 0.024500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010146 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.989 seconds +Domain Reload Profiling: + ReloadAssembly (990ms) + BeginReloadAssembly (188ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (71ms) + EndReloadAssembly (705ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5327. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.529900 ms (FindLiveObjects: 0.310900 ms CreateObjectMapping: 0.158600 ms MarkObjects: 2.034100 ms DeleteObjects: 0.025200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010216 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.969 seconds +Domain Reload Profiling: + ReloadAssembly (970ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (33ms) + EndReloadAssembly (713ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (236ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5330. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.024500 ms (FindLiveObjects: 0.482800 ms CreateObjectMapping: 0.266200 ms MarkObjects: 2.246200 ms DeleteObjects: 0.027000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 378.950448 seconds. + path: Assets/Scenes/Main.unity + artifactKey: Guid(9fc0d4010bbf28b4594072e72b8655ab) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/Main.unity using Guid(9fc0d4010bbf28b4594072e72b8655ab) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'e901b74242ab5ffcefcb664f2b8957f0') in 0.016953 seconds +======================================================================== +Received Import Request. + Time since last request: 2.895094 seconds. + path: Assets/Scenes/Main.unity + artifactKey: Guid(9fc0d4010bbf28b4594072e72b8655ab) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/Main.unity using Guid(9fc0d4010bbf28b4594072e72b8655ab) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'ee5c276b28c7c6030d952c2100fe77f1') in 0.002395 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013193 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.021 seconds +Domain Reload Profiling: + ReloadAssembly (1021ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (748ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (255ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (293ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5333. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.881400 ms (FindLiveObjects: 0.372400 ms CreateObjectMapping: 0.234100 ms MarkObjects: 2.243700 ms DeleteObjects: 0.030000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012848 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.957 seconds +Domain Reload Profiling: + ReloadAssembly (958ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (708ms) + LoadAssemblies (100ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (254ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5336. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.548500 ms (FindLiveObjects: 0.332800 ms CreateObjectMapping: 0.224000 ms MarkObjects: 1.965600 ms DeleteObjects: 0.024900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011585 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.999 seconds +Domain Reload Profiling: + ReloadAssembly (999ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (732ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (261ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5339. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.956100 ms (FindLiveObjects: 0.344000 ms CreateObjectMapping: 0.173700 ms MarkObjects: 2.408200 ms DeleteObjects: 0.028800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015090 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.891 seconds +Domain Reload Profiling: + ReloadAssembly (891ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (647ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (228ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (246ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (143ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5342. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 3.026900 ms (FindLiveObjects: 0.410100 ms CreateObjectMapping: 0.187300 ms MarkObjects: 2.401900 ms DeleteObjects: 0.026000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011279 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.901 seconds +Domain Reload Profiling: + ReloadAssembly (902ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (660ms) + LoadAssemblies (103ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (257ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (29ms) + SetupLoadedEditorAssemblies (248ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (150ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5345. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.623200 ms (FindLiveObjects: 0.337100 ms CreateObjectMapping: 0.176900 ms MarkObjects: 2.042100 ms DeleteObjects: 0.065200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011916 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.010 seconds +Domain Reload Profiling: + ReloadAssembly (1010ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (1ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (725ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (245ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (293ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.24 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5348. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.002900 ms (FindLiveObjects: 0.525800 ms CreateObjectMapping: 0.184500 ms MarkObjects: 2.260500 ms DeleteObjects: 0.030400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011785 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.996 seconds +Domain Reload Profiling: + ReloadAssembly (997ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (754ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (261ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (312ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (197ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5351. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.948800 ms (FindLiveObjects: 0.339100 ms CreateObjectMapping: 0.154700 ms MarkObjects: 2.412700 ms DeleteObjects: 0.040800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013209 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.140 seconds +Domain Reload Profiling: + ReloadAssembly (1141ms) + BeginReloadAssembly (190ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (839ms) + LoadAssemblies (150ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (339ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5354. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.147500 ms (FindLiveObjects: 0.575700 ms CreateObjectMapping: 0.429800 ms MarkObjects: 2.089700 ms DeleteObjects: 0.051000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013983 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.981 seconds +Domain Reload Profiling: + ReloadAssembly (982ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (720ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (267ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (284ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5357. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 3.014000 ms (FindLiveObjects: 0.290000 ms CreateObjectMapping: 0.434200 ms MarkObjects: 2.266900 ms DeleteObjects: 0.022100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012460 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.019 seconds +Domain Reload Profiling: + ReloadAssembly (1020ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (771ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (292ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5360. +Memory consumption went from 164.7 MB to 164.6 MB. +Total: 2.987400 ms (FindLiveObjects: 0.325700 ms CreateObjectMapping: 0.365400 ms MarkObjects: 2.256100 ms DeleteObjects: 0.038500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012469 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.984 seconds +Domain Reload Profiling: + ReloadAssembly (985ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (705ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (287ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (237ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (54ms) + ProcessInitializeOnLoadAttributes (145ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5363. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.425900 ms (FindLiveObjects: 0.303500 ms CreateObjectMapping: 0.133400 ms MarkObjects: 1.972300 ms DeleteObjects: 0.015900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009151 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.033 seconds +Domain Reload Profiling: + ReloadAssembly (1034ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (779ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (257ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (321ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (201ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.32 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5366. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.085800 ms (FindLiveObjects: 0.517400 ms CreateObjectMapping: 0.420800 ms MarkObjects: 2.121400 ms DeleteObjects: 0.025100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009828 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.113 seconds +Domain Reload Profiling: + ReloadAssembly (1113ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (832ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (274ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (59ms) + SetupLoadedEditorAssemblies (311ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (16ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.41 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5369. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.565800 ms (FindLiveObjects: 0.336100 ms CreateObjectMapping: 0.237200 ms MarkObjects: 1.969600 ms DeleteObjects: 0.021800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010047 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.972 seconds +Domain Reload Profiling: + ReloadAssembly (973ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (715ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (256ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (262ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (151ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5372. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 3.307000 ms (FindLiveObjects: 0.520300 ms CreateObjectMapping: 0.361500 ms MarkObjects: 2.382900 ms DeleteObjects: 0.040600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011045 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.924 seconds +Domain Reload Profiling: + ReloadAssembly (925ms) + BeginReloadAssembly (143ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (685ms) + LoadAssemblies (97ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (250ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5375. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.717100 ms (FindLiveObjects: 0.413600 ms CreateObjectMapping: 0.225700 ms MarkObjects: 2.052100 ms DeleteObjects: 0.025100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012266 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.945 seconds +Domain Reload Profiling: + ReloadAssembly (947ms) + BeginReloadAssembly (142ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (710ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (236ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.42 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5378. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.679300 ms (FindLiveObjects: 0.401700 ms CreateObjectMapping: 0.185500 ms MarkObjects: 2.065500 ms DeleteObjects: 0.025300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013027 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.952 seconds +Domain Reload Profiling: + ReloadAssembly (952ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (715ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (262ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5381. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.748600 ms (FindLiveObjects: 0.473300 ms CreateObjectMapping: 0.359500 ms MarkObjects: 2.866200 ms DeleteObjects: 0.048000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010582 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.991 seconds +Domain Reload Profiling: + ReloadAssembly (992ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (733ms) + LoadAssemblies (100ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (261ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (286ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5384. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.066000 ms (FindLiveObjects: 0.377100 ms CreateObjectMapping: 0.577800 ms MarkObjects: 2.080900 ms DeleteObjects: 0.028800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012659 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.995 seconds +Domain Reload Profiling: + ReloadAssembly (996ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (722ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (256ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5387. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 4.023700 ms (FindLiveObjects: 0.492800 ms CreateObjectMapping: 0.242100 ms MarkObjects: 3.241600 ms DeleteObjects: 0.044900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012613 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.925 seconds +Domain Reload Profiling: + ReloadAssembly (926ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (683ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (230ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5390. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 4.051900 ms (FindLiveObjects: 0.560300 ms CreateObjectMapping: 0.504700 ms MarkObjects: 2.904100 ms DeleteObjects: 0.079900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014548 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.970 seconds +Domain Reload Profiling: + ReloadAssembly (970ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (720ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (241ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (284ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5393. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 2.757200 ms (FindLiveObjects: 0.333100 ms CreateObjectMapping: 0.153000 ms MarkObjects: 2.238900 ms DeleteObjects: 0.030700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010121 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.46 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.222 seconds +Domain Reload Profiling: + ReloadAssembly (1223ms) + BeginReloadAssembly (202ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (61ms) + EndReloadAssembly (926ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (360ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (75ms) + SetupLoadedEditorAssemblies (297ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5396. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 2.324800 ms (FindLiveObjects: 0.290700 ms CreateObjectMapping: 0.142100 ms MarkObjects: 1.865400 ms DeleteObjects: 0.025900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012341 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.966 seconds +Domain Reload Profiling: + ReloadAssembly (967ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (721ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (232ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (284ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5399. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 3.137000 ms (FindLiveObjects: 0.699000 ms CreateObjectMapping: 0.253500 ms MarkObjects: 2.147500 ms DeleteObjects: 0.034400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016914 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.922 seconds +Domain Reload Profiling: + ReloadAssembly (923ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (678ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (265ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (248ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (144ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.23 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5402. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.675000 ms (FindLiveObjects: 0.426100 ms CreateObjectMapping: 0.171300 ms MarkObjects: 3.039200 ms DeleteObjects: 0.036100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013808 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.900 seconds +Domain Reload Profiling: + ReloadAssembly (901ms) + BeginReloadAssembly (142ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (33ms) + EndReloadAssembly (664ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (241ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (257ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5405. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.321800 ms (FindLiveObjects: 0.335000 ms CreateObjectMapping: 0.170700 ms MarkObjects: 2.788900 ms DeleteObjects: 0.025900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013625 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.985 seconds +Domain Reload Profiling: + ReloadAssembly (986ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (718ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (243ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5408. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.490000 ms (FindLiveObjects: 0.313400 ms CreateObjectMapping: 0.146900 ms MarkObjects: 1.882700 ms DeleteObjects: 0.146000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010759 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.108 seconds +Domain Reload Profiling: + ReloadAssembly (1109ms) + BeginReloadAssembly (190ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (818ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (250ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (56ms) + SetupLoadedEditorAssemblies (333ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (203ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5411. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 5.625200 ms (FindLiveObjects: 0.627300 ms CreateObjectMapping: 0.643300 ms MarkObjects: 4.288100 ms DeleteObjects: 0.062100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012242 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.048 seconds +Domain Reload Profiling: + ReloadAssembly (1048ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (759ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (254ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (301ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (183ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5414. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 3.174800 ms (FindLiveObjects: 0.311400 ms CreateObjectMapping: 0.445700 ms MarkObjects: 2.388600 ms DeleteObjects: 0.027700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011029 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.985 seconds +Domain Reload Profiling: + ReloadAssembly (985ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (738ms) + LoadAssemblies (95ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (253ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (309ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (188ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.45 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5417. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.721700 ms (FindLiveObjects: 0.415500 ms CreateObjectMapping: 0.176100 ms MarkObjects: 2.064500 ms DeleteObjects: 0.064500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016813 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.042 seconds +Domain Reload Profiling: + ReloadAssembly (1043ms) + BeginReloadAssembly (143ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (804ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (314ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (280ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5420. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.910600 ms (FindLiveObjects: 0.518400 ms CreateObjectMapping: 0.207300 ms MarkObjects: 2.113100 ms DeleteObjects: 0.069800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016628 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.165 seconds +Domain Reload Profiling: + ReloadAssembly (1166ms) + BeginReloadAssembly (189ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (848ms) + LoadAssemblies (161ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (279ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (320ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.46 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5423. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.887600 ms (FindLiveObjects: 0.301200 ms CreateObjectMapping: 0.150600 ms MarkObjects: 2.289500 ms DeleteObjects: 0.144500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011318 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.45 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.995 seconds +Domain Reload Profiling: + ReloadAssembly (996ms) + BeginReloadAssembly (141ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (754ms) + LoadAssemblies (90ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (250ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (306ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5426. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.653900 ms (FindLiveObjects: 0.369000 ms CreateObjectMapping: 0.158800 ms MarkObjects: 2.081100 ms DeleteObjects: 0.044300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013899 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.973 seconds +Domain Reload Profiling: + ReloadAssembly (974ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (731ms) + LoadAssemblies (100ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (270ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.27 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5429. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.890000 ms (FindLiveObjects: 0.317600 ms CreateObjectMapping: 0.312500 ms MarkObjects: 2.230600 ms DeleteObjects: 0.027700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012859 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.003 seconds +Domain Reload Profiling: + ReloadAssembly (1004ms) + BeginReloadAssembly (180ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (717ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (271ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5432. +Memory consumption went from 164.9 MB to 164.8 MB. +Total: 2.683300 ms (FindLiveObjects: 0.285700 ms CreateObjectMapping: 0.135200 ms MarkObjects: 2.243100 ms DeleteObjects: 0.018600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010087 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.948 seconds +Domain Reload Profiling: + ReloadAssembly (949ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (697ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (264ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (156ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5435. +Memory consumption went from 164.7 MB to 164.6 MB. +Total: 2.959500 ms (FindLiveObjects: 0.456200 ms CreateObjectMapping: 0.221900 ms MarkObjects: 2.169200 ms DeleteObjects: 0.111200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015231 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.101 seconds +Domain Reload Profiling: + ReloadAssembly (1101ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (826ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (346ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (59ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5438. +Memory consumption went from 164.9 MB to 164.8 MB. +Total: 3.171500 ms (FindLiveObjects: 0.320000 ms CreateObjectMapping: 0.155600 ms MarkObjects: 2.671300 ms DeleteObjects: 0.023100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011685 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.949 seconds +Domain Reload Profiling: + ReloadAssembly (950ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (701ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (243ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.45 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5441. +Memory consumption went from 165.1 MB to 165.0 MB. +Total: 2.560400 ms (FindLiveObjects: 0.332600 ms CreateObjectMapping: 0.177800 ms MarkObjects: 2.028900 ms DeleteObjects: 0.020000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011268 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.993 seconds +Domain Reload Profiling: + ReloadAssembly (993ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (732ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (303ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5444. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.568200 ms (FindLiveObjects: 0.447000 ms CreateObjectMapping: 0.221000 ms MarkObjects: 1.878400 ms DeleteObjects: 0.020700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012768 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.040 seconds +Domain Reload Profiling: + ReloadAssembly (1040ms) + BeginReloadAssembly (173ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (757ms) + LoadAssemblies (129ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (316ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (256ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (154ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5447. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 4.010600 ms (FindLiveObjects: 0.876200 ms CreateObjectMapping: 0.451300 ms MarkObjects: 2.647200 ms DeleteObjects: 0.033700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011070 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.086 seconds +Domain Reload Profiling: + ReloadAssembly (1087ms) + BeginReloadAssembly (193ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (768ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (298ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (274ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5451. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.676200 ms (FindLiveObjects: 0.413700 ms CreateObjectMapping: 0.247300 ms MarkObjects: 1.995700 ms DeleteObjects: 0.018400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009902 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.255 seconds +Domain Reload Profiling: + ReloadAssembly (1255ms) + BeginReloadAssembly (246ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (79ms) + EndReloadAssembly (883ms) + LoadAssemblies (156ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (317ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (352ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (198ms) + ProcessInitializeOnLoadMethodAttributes (52ms) + AfterProcessingInitializeOnLoad (26ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5454. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.990300 ms (FindLiveObjects: 0.506900 ms CreateObjectMapping: 0.259200 ms MarkObjects: 2.195600 ms DeleteObjects: 0.027500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016549 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.244 seconds +Domain Reload Profiling: + ReloadAssembly (1245ms) + BeginReloadAssembly (208ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (62ms) + EndReloadAssembly (894ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (421ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (260ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5457. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.789500 ms (FindLiveObjects: 0.322600 ms CreateObjectMapping: 0.165500 ms MarkObjects: 2.281300 ms DeleteObjects: 0.019100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015970 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.341 seconds +Domain Reload Profiling: + ReloadAssembly (1342ms) + BeginReloadAssembly (189ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (1037ms) + LoadAssemblies (147ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (513ms) + ReleaseScriptCaches (5ms) + RebuildScriptCaches (55ms) + SetupLoadedEditorAssemblies (278ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5460. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.486500 ms (FindLiveObjects: 0.321600 ms CreateObjectMapping: 0.163500 ms MarkObjects: 1.976200 ms DeleteObjects: 0.024500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012978 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.234 seconds +Domain Reload Profiling: + ReloadAssembly (1235ms) + BeginReloadAssembly (185ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (946ms) + LoadAssemblies (130ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (466ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5463. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 133.219200 ms (FindLiveObjects: 120.873200 ms CreateObjectMapping: 2.584700 ms MarkObjects: 9.679500 ms DeleteObjects: 0.078400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010459 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.142 seconds +Domain Reload Profiling: + ReloadAssembly (1142ms) + BeginReloadAssembly (216ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (59ms) + EndReloadAssembly (788ms) + LoadAssemblies (154ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (315ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (264ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5466. +Memory consumption went from 165.0 MB to 164.9 MB. +Total: 2.454200 ms (FindLiveObjects: 0.372900 ms CreateObjectMapping: 0.162100 ms MarkObjects: 1.902000 ms DeleteObjects: 0.016200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013612 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.077 seconds +Domain Reload Profiling: + ReloadAssembly (1078ms) + BeginReloadAssembly (187ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (781ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (334ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (252ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (54ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5469. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 11.463900 ms (FindLiveObjects: 1.859500 ms CreateObjectMapping: 4.406400 ms MarkObjects: 5.149600 ms DeleteObjects: 0.046500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011088 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.209 seconds +Domain Reload Profiling: + ReloadAssembly (1210ms) + BeginReloadAssembly (233ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (62ms) + EndReloadAssembly (868ms) + LoadAssemblies (149ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (368ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (179ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.03 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5472. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 4.289200 ms (FindLiveObjects: 0.525300 ms CreateObjectMapping: 0.356600 ms MarkObjects: 3.367000 ms DeleteObjects: 0.038800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011807 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.151 seconds +Domain Reload Profiling: + ReloadAssembly (1151ms) + BeginReloadAssembly (198ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (800ms) + LoadAssemblies (163ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (323ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.48 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5475. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 5.102100 ms (FindLiveObjects: 0.768900 ms CreateObjectMapping: 0.560000 ms MarkObjects: 3.714000 ms DeleteObjects: 0.056000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011309 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.061 seconds +Domain Reload Profiling: + ReloadAssembly (1061ms) + BeginReloadAssembly (175ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (767ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (312ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (150ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5478. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.666500 ms (FindLiveObjects: 0.310500 ms CreateObjectMapping: 0.156600 ms MarkObjects: 3.173800 ms DeleteObjects: 0.024100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012736 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.035 seconds +Domain Reload Profiling: + ReloadAssembly (1036ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (761ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (294ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5481. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 3.875000 ms (FindLiveObjects: 0.471300 ms CreateObjectMapping: 0.277300 ms MarkObjects: 3.066300 ms DeleteObjects: 0.058200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011160 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.959 seconds +Domain Reload Profiling: + ReloadAssembly (960ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (699ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (248ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.22 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5484. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.120900 ms (FindLiveObjects: 0.622800 ms CreateObjectMapping: 0.236000 ms MarkObjects: 2.235500 ms DeleteObjects: 0.025300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011727 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.982 seconds +Domain Reload Profiling: + ReloadAssembly (983ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (716ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (251ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5487. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.823700 ms (FindLiveObjects: 0.478200 ms CreateObjectMapping: 0.216400 ms MarkObjects: 2.106800 ms DeleteObjects: 0.021000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010083 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.009 seconds +Domain Reload Profiling: + ReloadAssembly (1010ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (751ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (300ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5490. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.739300 ms (FindLiveObjects: 0.371000 ms CreateObjectMapping: 0.175000 ms MarkObjects: 3.165800 ms DeleteObjects: 0.025700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010828 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.047 seconds +Domain Reload Profiling: + ReloadAssembly (1048ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (785ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (317ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (156ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5493. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.357600 ms (FindLiveObjects: 0.613700 ms CreateObjectMapping: 0.314400 ms MarkObjects: 2.385500 ms DeleteObjects: 0.042500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012472 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.988 seconds +Domain Reload Profiling: + ReloadAssembly (989ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (732ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (163ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5496. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 3.334800 ms (FindLiveObjects: 0.635900 ms CreateObjectMapping: 0.277900 ms MarkObjects: 2.374500 ms DeleteObjects: 0.044600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013559 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.062 seconds +Domain Reload Profiling: + ReloadAssembly (1062ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (793ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5499. +Memory consumption went from 165.1 MB to 165.0 MB. +Total: 5.206500 ms (FindLiveObjects: 1.137600 ms CreateObjectMapping: 0.863600 ms MarkObjects: 3.147600 ms DeleteObjects: 0.053800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012198 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.042 seconds +Domain Reload Profiling: + ReloadAssembly (1044ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (769ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (308ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5502. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.875300 ms (FindLiveObjects: 0.410300 ms CreateObjectMapping: 0.214100 ms MarkObjects: 2.219200 ms DeleteObjects: 0.030300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011333 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.39 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.124 seconds +Domain Reload Profiling: + ReloadAssembly (1125ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (861ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (299ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (357ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (27ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (106ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5505. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 3.683300 ms (FindLiveObjects: 0.412300 ms CreateObjectMapping: 0.200100 ms MarkObjects: 3.023000 ms DeleteObjects: 0.046500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009782 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.992 seconds +Domain Reload Profiling: + ReloadAssembly (992ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (741ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (248ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (55ms) + SetupLoadedEditorAssemblies (286ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 16.19 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5508. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 3.243100 ms (FindLiveObjects: 0.387900 ms CreateObjectMapping: 0.316900 ms MarkObjects: 2.495000 ms DeleteObjects: 0.040700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012704 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.124 seconds +Domain Reload Profiling: + ReloadAssembly (1124ms) + BeginReloadAssembly (183ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (824ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (324ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (305ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5511. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.578700 ms (FindLiveObjects: 0.358900 ms CreateObjectMapping: 0.187400 ms MarkObjects: 2.010900 ms DeleteObjects: 0.020300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009756 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.948 seconds +Domain Reload Profiling: + ReloadAssembly (948ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (703ms) + LoadAssemblies (99ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (263ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (263ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (154ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5514. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 3.120600 ms (FindLiveObjects: 0.340800 ms CreateObjectMapping: 0.382200 ms MarkObjects: 2.374500 ms DeleteObjects: 0.022200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016446 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.948 seconds +Domain Reload Profiling: + ReloadAssembly (948ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (684ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (249ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (261ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5517. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.309200 ms (FindLiveObjects: 0.809500 ms CreateObjectMapping: 0.305800 ms MarkObjects: 2.173600 ms DeleteObjects: 0.018200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015717 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.074 seconds +Domain Reload Profiling: + ReloadAssembly (1075ms) + BeginReloadAssembly (220ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (78ms) + EndReloadAssembly (737ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (286ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5520. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.892400 ms (FindLiveObjects: 0.511900 ms CreateObjectMapping: 0.232800 ms MarkObjects: 2.121900 ms DeleteObjects: 0.024500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011218 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.965 seconds +Domain Reload Profiling: + ReloadAssembly (966ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (696ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (276ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5523. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.386600 ms (FindLiveObjects: 0.360700 ms CreateObjectMapping: 0.163400 ms MarkObjects: 2.814700 ms DeleteObjects: 0.046400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.021511 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.283 seconds +Domain Reload Profiling: + ReloadAssembly (1284ms) + BeginReloadAssembly (175ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (978ms) + LoadAssemblies (150ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (368ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (58ms) + SetupLoadedEditorAssemblies (348ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (83ms) + ProcessInitializeOnLoadAttributes (209ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5526. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.299100 ms (FindLiveObjects: 0.645600 ms CreateObjectMapping: 0.243200 ms MarkObjects: 2.365800 ms DeleteObjects: 0.042400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011415 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.033 seconds +Domain Reload Profiling: + ReloadAssembly (1033ms) + BeginReloadAssembly (201ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (705ms) + LoadAssemblies (152ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (260ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (256ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5529. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.759400 ms (FindLiveObjects: 0.476100 ms CreateObjectMapping: 0.270300 ms MarkObjects: 1.986900 ms DeleteObjects: 0.025300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009660 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.964 seconds +Domain Reload Profiling: + ReloadAssembly (964ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (718ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (267ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5533. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 4.839000 ms (FindLiveObjects: 0.433000 ms CreateObjectMapping: 0.267500 ms MarkObjects: 4.083100 ms DeleteObjects: 0.053500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011642 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.131 seconds +Domain Reload Profiling: + ReloadAssembly (1131ms) + BeginReloadAssembly (143ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (895ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (309ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (66ms) + SetupLoadedEditorAssemblies (351ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (83ms) + ProcessInitializeOnLoadAttributes (215ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5536. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 4.617000 ms (FindLiveObjects: 0.599400 ms CreateObjectMapping: 0.465800 ms MarkObjects: 3.494200 ms DeleteObjects: 0.055500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009853 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.095 seconds +Domain Reload Profiling: + ReloadAssembly (1095ms) + BeginReloadAssembly (187ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (55ms) + EndReloadAssembly (782ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (323ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5539. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 2.654300 ms (FindLiveObjects: 0.457400 ms CreateObjectMapping: 0.168800 ms MarkObjects: 2.009900 ms DeleteObjects: 0.016900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013226 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.984 seconds +Domain Reload Profiling: + ReloadAssembly (985ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (733ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (285ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5542. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.460200 ms (FindLiveObjects: 0.346800 ms CreateObjectMapping: 0.183600 ms MarkObjects: 2.886600 ms DeleteObjects: 0.041400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014500 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.945 seconds +Domain Reload Profiling: + ReloadAssembly (945ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (694ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (265ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5545. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.463800 ms (FindLiveObjects: 0.320300 ms CreateObjectMapping: 0.166500 ms MarkObjects: 1.960100 ms DeleteObjects: 0.016100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011842 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.125 seconds +Domain Reload Profiling: + ReloadAssembly (1125ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (862ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (322ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (320ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (204ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5548. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.939700 ms (FindLiveObjects: 0.358300 ms CreateObjectMapping: 0.211000 ms MarkObjects: 2.345100 ms DeleteObjects: 0.024000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011487 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.058 seconds +Domain Reload Profiling: + ReloadAssembly (1059ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (768ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (290ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5551. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 13.601800 ms (FindLiveObjects: 1.399400 ms CreateObjectMapping: 0.545200 ms MarkObjects: 11.483200 ms DeleteObjects: 0.170700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014500 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.030 seconds +Domain Reload Profiling: + ReloadAssembly (1031ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (766ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (302ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5554. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.973300 ms (FindLiveObjects: 0.430700 ms CreateObjectMapping: 0.371200 ms MarkObjects: 2.153300 ms DeleteObjects: 0.017100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.018827 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.044 seconds +Domain Reload Profiling: + ReloadAssembly (1044ms) + BeginReloadAssembly (182ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (758ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (309ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5557. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.045400 ms (FindLiveObjects: 0.427400 ms CreateObjectMapping: 0.271800 ms MarkObjects: 2.294300 ms DeleteObjects: 0.050300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010179 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.932 seconds +Domain Reload Profiling: + ReloadAssembly (933ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (689ms) + LoadAssemblies (96ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (229ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.22 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5560. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 4.534300 ms (FindLiveObjects: 0.479200 ms CreateObjectMapping: 0.510900 ms MarkObjects: 3.510300 ms DeleteObjects: 0.032600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014038 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.079 seconds +Domain Reload Profiling: + ReloadAssembly (1080ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (822ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (334ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (59ms) + SetupLoadedEditorAssemblies (264ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (156ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5563. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.897700 ms (FindLiveObjects: 0.566600 ms CreateObjectMapping: 0.234100 ms MarkObjects: 2.076400 ms DeleteObjects: 0.019300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012945 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.057 seconds +Domain Reload Profiling: + ReloadAssembly (1058ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (784ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (311ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (294ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5566. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.717300 ms (FindLiveObjects: 1.183800 ms CreateObjectMapping: 0.321000 ms MarkObjects: 2.174100 ms DeleteObjects: 0.034300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013544 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.967 seconds +Domain Reload Profiling: + ReloadAssembly (968ms) + BeginReloadAssembly (173ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (694ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (267ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (256ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (150ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.46 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5569. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.528900 ms (FindLiveObjects: 0.356100 ms CreateObjectMapping: 0.178800 ms MarkObjects: 2.965100 ms DeleteObjects: 0.027600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014881 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.061 seconds +Domain Reload Profiling: + ReloadAssembly (1061ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (779ms) + LoadAssemblies (130ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (322ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (255ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5572. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 2.648100 ms (FindLiveObjects: 0.330400 ms CreateObjectMapping: 0.173800 ms MarkObjects: 2.123600 ms DeleteObjects: 0.019500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010138 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.993 seconds +Domain Reload Profiling: + ReloadAssembly (993ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (722ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (278ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5575. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 2.466300 ms (FindLiveObjects: 0.334600 ms CreateObjectMapping: 0.170600 ms MarkObjects: 1.943700 ms DeleteObjects: 0.016700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011937 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.22 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.049 seconds +Domain Reload Profiling: + ReloadAssembly (1050ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (796ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (269ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (337ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (201ms) + ProcessInitializeOnLoadMethodAttributes (38ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5578. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 5.360900 ms (FindLiveObjects: 0.587000 ms CreateObjectMapping: 0.284900 ms MarkObjects: 4.445000 ms DeleteObjects: 0.041400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017605 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.981 seconds +Domain Reload Profiling: + ReloadAssembly (982ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (713ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (269ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (256ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5581. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.968500 ms (FindLiveObjects: 0.578000 ms CreateObjectMapping: 0.192900 ms MarkObjects: 2.173900 ms DeleteObjects: 0.022500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012749 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.991 seconds +Domain Reload Profiling: + ReloadAssembly (991ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (723ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (285ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (253ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.31 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5584. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 4.648400 ms (FindLiveObjects: 0.655500 ms CreateObjectMapping: 0.259400 ms MarkObjects: 3.693500 ms DeleteObjects: 0.037800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012465 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.124 seconds +Domain Reload Profiling: + ReloadAssembly (1125ms) + BeginReloadAssembly (218ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (60ms) + EndReloadAssembly (794ms) + LoadAssemblies (148ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5587. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.400300 ms (FindLiveObjects: 0.668700 ms CreateObjectMapping: 0.251300 ms MarkObjects: 2.449900 ms DeleteObjects: 0.028700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013139 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.222 seconds +Domain Reload Profiling: + ReloadAssembly (1223ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (925ms) + LoadAssemblies (133ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (359ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (330ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (14ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (87ms) + ProcessInitializeOnLoadAttributes (191ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5590. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 4.643000 ms (FindLiveObjects: 0.759200 ms CreateObjectMapping: 0.336500 ms MarkObjects: 3.491800 ms DeleteObjects: 0.051800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012535 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.056 seconds +Domain Reload Profiling: + ReloadAssembly (1057ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (780ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (272ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (319ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (191ms) + ProcessInitializeOnLoadMethodAttributes (38ms) + AfterProcessingInitializeOnLoad (20ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5593. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 4.726100 ms (FindLiveObjects: 0.520900 ms CreateObjectMapping: 0.263200 ms MarkObjects: 3.866500 ms DeleteObjects: 0.071600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015500 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.062 seconds +Domain Reload Profiling: + ReloadAssembly (1063ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (786ms) + LoadAssemblies (100ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (280ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (301ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (196ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5596. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.804400 ms (FindLiveObjects: 0.325900 ms CreateObjectMapping: 0.162700 ms MarkObjects: 2.290000 ms DeleteObjects: 0.024700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010396 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.123 seconds +Domain Reload Profiling: + ReloadAssembly (1124ms) + BeginReloadAssembly (188ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (784ms) + LoadAssemblies (150ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (297ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5599. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.711200 ms (FindLiveObjects: 0.471800 ms CreateObjectMapping: 0.225200 ms MarkObjects: 1.990400 ms DeleteObjects: 0.022500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014005 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.158 seconds +Domain Reload Profiling: + ReloadAssembly (1159ms) + BeginReloadAssembly (221ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (811ms) + LoadAssemblies (166ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5602. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.062900 ms (FindLiveObjects: 0.579900 ms CreateObjectMapping: 0.244400 ms MarkObjects: 2.214500 ms DeleteObjects: 0.022800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010797 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.176 seconds +Domain Reload Profiling: + ReloadAssembly (1177ms) + BeginReloadAssembly (189ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (870ms) + LoadAssemblies (141ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (376ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (43ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.1 KB). Loaded Objects now: 5605. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.043300 ms (FindLiveObjects: 0.426300 ms CreateObjectMapping: 0.233400 ms MarkObjects: 2.342900 ms DeleteObjects: 0.039300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014019 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.161 seconds +Domain Reload Profiling: + ReloadAssembly (1161ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (869ms) + LoadAssemblies (139ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (379ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (156ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5608. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.890400 ms (FindLiveObjects: 0.361500 ms CreateObjectMapping: 0.186900 ms MarkObjects: 2.269600 ms DeleteObjects: 0.071100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015043 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.162 seconds +Domain Reload Profiling: + ReloadAssembly (1162ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (903ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (377ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (334ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (206ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 12.37 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5611. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 3.858900 ms (FindLiveObjects: 0.409300 ms CreateObjectMapping: 0.196000 ms MarkObjects: 3.199600 ms DeleteObjects: 0.052400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009743 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.090 seconds +Domain Reload Profiling: + ReloadAssembly (1090ms) + BeginReloadAssembly (195ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (783ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (343ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (156ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5614. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 4.713200 ms (FindLiveObjects: 0.369000 ms CreateObjectMapping: 0.186800 ms MarkObjects: 4.068400 ms DeleteObjects: 0.086300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010566 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.950 seconds +Domain Reload Profiling: + ReloadAssembly (951ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (693ms) + LoadAssemblies (99ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (244ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.24 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5617. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.921700 ms (FindLiveObjects: 0.429600 ms CreateObjectMapping: 0.188400 ms MarkObjects: 2.246700 ms DeleteObjects: 0.054600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010665 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.068 seconds +Domain Reload Profiling: + ReloadAssembly (1069ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (793ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (289ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (303ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (184ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5620. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 3.033800 ms (FindLiveObjects: 0.814000 ms CreateObjectMapping: 0.228800 ms MarkObjects: 1.961800 ms DeleteObjects: 0.027900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012709 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.079 seconds +Domain Reload Profiling: + ReloadAssembly (1080ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (834ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (243ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (374ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (81ms) + ProcessInitializeOnLoadAttributes (232ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5623. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 3.122400 ms (FindLiveObjects: 0.576200 ms CreateObjectMapping: 0.211500 ms MarkObjects: 2.310400 ms DeleteObjects: 0.023300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011415 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.17 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.078 seconds +Domain Reload Profiling: + ReloadAssembly (1078ms) + BeginReloadAssembly (175ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (797ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (293ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.23 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5626. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 3.235800 ms (FindLiveObjects: 0.496700 ms CreateObjectMapping: 0.247000 ms MarkObjects: 2.461600 ms DeleteObjects: 0.029400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012866 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.934 seconds +Domain Reload Profiling: + ReloadAssembly (934ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (682ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (241ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (54ms) + ProcessInitializeOnLoadAttributes (148ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5629. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 2.515100 ms (FindLiveObjects: 0.330400 ms CreateObjectMapping: 0.170500 ms MarkObjects: 1.998600 ms DeleteObjects: 0.014900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011213 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 3.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.385 seconds +Domain Reload Profiling: + ReloadAssembly (1386ms) + BeginReloadAssembly (178ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (1095ms) + LoadAssemblies (126ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (500ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (77ms) + ProcessInitializeOnLoadAttributes (340ms) + ProcessInitializeOnLoadMethodAttributes (44ms) + AfterProcessingInitializeOnLoad (23ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5632. +Memory consumption went from 165.7 MB to 165.6 MB. +Total: 2.937300 ms (FindLiveObjects: 0.465300 ms CreateObjectMapping: 0.219800 ms MarkObjects: 2.223900 ms DeleteObjects: 0.026900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010725 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.961 seconds +Domain Reload Profiling: + ReloadAssembly (961ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (697ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (271ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (253ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5635. +Memory consumption went from 165.7 MB to 165.6 MB. +Total: 3.183100 ms (FindLiveObjects: 0.429500 ms CreateObjectMapping: 0.301800 ms MarkObjects: 2.433600 ms DeleteObjects: 0.016800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013659 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.064 seconds +Domain Reload Profiling: + ReloadAssembly (1065ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (811ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (323ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (183ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Callback registration failed. Increase kMaxCallback. +Fatal Error! Callback registration failed. Increase kMaxCallback. +Crash!!! +SymInit: Symbol-SearchPath: 'D:/Unity/2021.3.27f1c2/Editor/Data/Mono;.;D:\myproject\unity\JNFrame;D:\myproject\unity\JNFrame\Library\BurstCache\JIT;D:\Unity\2021.3.27f1c2\Editor;C:\WINDOWS;C:\WINDOWS\system32;', symOptions: 534, UserName: 'Administrator' +OS-Version: 10.0.0 +D:\Unity\2021.3.27f1c2\Editor\Unity.exe:Unity.exe (00007FF79A5E0000), size: 81166336 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2021.3.27.15766 +C:\WINDOWS\SYSTEM32\ntdll.dll:ntdll.dll (00007FFF2DD70000), size: 2191360 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\KERNEL32.DLL:KERNEL32.DLL (00007FFF2CC80000), size: 802816 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\KERNELBASE.dll:KERNELBASE.dll (00007FFF2B390000), size: 3825664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\user32.dll:user32.dll (00007FFF2D480000), size: 1761280 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\win32u.dll:win32u.dll (00007FFF2B360000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\GDI32.dll:GDI32.dll (00007FFF2D7C0000), size: 167936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\gdi32full.dll:gdi32full.dll (00007FFF2B900000), size: 1146880 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2861 +C:\WINDOWS\System32\msvcp_win.dll:msvcp_win.dll (00007FFF2B860000), size: 630784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\ucrtbase.dll:ucrtbase.dll (00007FFF2B740000), size: 1118208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\advapi32.dll:advapi32.dll (00007FFF2D2C0000), size: 733184 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\msvcrt.dll:msvcrt.dll (00007FFF2BF50000), size: 684032 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.22621.2506 +C:\WINDOWS\System32\sechost.dll:sechost.dll (00007FFF2D710000), size: 688128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\bcrypt.dll:bcrypt.dll (00007FFF2BA20000), size: 163840 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\RPCRT4.dll:RPCRT4.dll (00007FFF2C0E0000), size: 1142784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\shell32.dll:shell32.dll (00007FFF2C420000), size: 8757248 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\setupapi.dll:setupapi.dll (00007FFF2BAD0000), size: 4669440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\psapi.dll:psapi.dll (00007FFF2D2B0000), size: 32768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\WS2_32.dll:WS2_32.dll (00007FFF2DCB0000), size: 462848 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\iphlpapi.dll:iphlpapi.dll (00007FFF29C10000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\hid.dll:hid.dll (00007FFF29900000), size: 57344 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\WINTRUST.dll:WINTRUST.dll (00007FFF2BA50000), size: 438272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\OLEAUT32.dll:OLEAUT32.dll (00007FFF2DBD0000), size: 880640 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\combase.dll:combase.dll (00007FFF2CF20000), size: 3706880 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\dhcpcsvc.dll:dhcpcsvc.dll (00007FFF25880000), size: 126976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\dhcpcsvc6.dll:dhcpcsvc6.dll (00007FFF258A0000), size: 102400 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\wsock32.dll:wsock32.dll (00007FFF1CFA0000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\IMM32.dll:IMM32.dll (00007FFF2C290000), size: 200704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\ole32.dll:ole32.dll (00007FFF2DA30000), size: 1703936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\SHLWAPI.dll:SHLWAPI.dll (00007FFF2D9D0000), size: 385024 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\libfbxsdk.dll:libfbxsdk.dll (00007FFE93C40000), size: 10067968 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2020.3.3.0 +D:\Unity\2021.3.27f1c2\Editor\s3tcompress.dll:s3tcompress.dll (00007FFF0BD90000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\optix.6.0.0.dll:optix.6.0.0.dll (00007FFEBEEB0000), size: 208896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.0.0.0 +C:\WINDOWS\System32\CRYPT32.dll:CRYPT32.dll (00007FFF2B1F0000), size: 1466368 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\etccompress.dll:etccompress.dll (00007FFE9E050000), size: 5066752 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\ispc_texcomp.dll:ispc_texcomp.dll (00007FFEBED00000), size: 1740800 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\compress_bc7e.dll:compress_bc7e.dll (00007FFEBEBA0000), size: 1441792 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\FreeImage.dll:FreeImage.dll (0000000180000000), size: 6582272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.18.0.0 +D:\Unity\2021.3.27f1c2\Editor\OpenImageDenoise.dll:OpenImageDenoise.dll (00007FFE945E0000), size: 48848896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.4.2.0 +D:\Unity\2021.3.27f1c2\Editor\WinPixEventRuntime.dll:WinPixEventRuntime.dll (00007FFF0BD80000), size: 45056 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.0.1812.6001 +D:\Unity\2021.3.27f1c2\Editor\umbraoptimizer64.dll:umbraoptimizer64.dll (00007FFEBEA70000), size: 1187840 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\RadeonImageFilters.dll:RadeonImageFilters.dll (00007FFEBE790000), size: 2961408 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.7.0.0 +D:\Unity\2021.3.27f1c2\Editor\SketchUpAPI.dll:SketchUpAPI.dll (00007FFE933A0000), size: 8990720 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 23.0.0.0 +C:\WINDOWS\SYSTEM32\VERSION.dll:VERSION.dll (00007FFF242F0000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\dwmapi.dll:dwmapi.dll (00007FFF28A50000), size: 176128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\WINMM.dll:WINMM.dll (00007FFF216C0000), size: 212992 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\WINHTTP.dll:WINHTTP.dll (00007FFF258C0000), size: 1273856 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\GLU32.dll:GLU32.dll (00007FFF1C120000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\OPENGL32.dll:OPENGL32.dll (00007FFF07F90000), size: 1048576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\tbb12.dll:tbb12.dll (00007FFEBE720000), size: 434176 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\MSVCP140.dll:MSVCP140.dll (00007FFEFF230000), size: 581632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll:VCRUNTIME140.dll (00007FFF1C100000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +D:\Unity\2021.3.27f1c2\Editor\RadeonML.dll:RadeonML.dll (00007FFF0BD60000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 0.9.11.0 +D:\Unity\2021.3.27f1c2\Editor\SketchUpCommonPreferences.dll:SketchUpCommonPreferences.dll (00007FFE9DF80000), size: 499712 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 23.0.0.0 +C:\WINDOWS\SYSTEM32\VCRUNTIME140_1.dll:VCRUNTIME140_1.dll (00007FFEFF2C0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +C:\WINDOWS\SYSTEM32\Secur32.dll:Secur32.dll (00007FFF29FA0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +D:\Unity\2021.3.27f1c2\Editor\tbbmalloc.dll:tbbmalloc.dll (00007FFE9E000000), size: 282624 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\dxcore.dll:dxcore.dll (00007FFF28730000), size: 221184 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\SSPICLI.DLL:SSPICLI.DLL (00007FFF2A430000), size: 274432 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +D:\Unity\2021.3.27f1c2\Editor\OpenRL.dll:OpenRL.dll (000001BA55080000), size: 12779520 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.5.0.2907 +C:\WINDOWS\SYSTEM32\MSVCP100.dll:MSVCP100.dll (0000000072190000), size: 622592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.40219.325 +D:\Unity\2021.3.27f1c2\Editor\embree.dll:embree.dll (00007FFE923B0000), size: 16711680 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.14.0.0 +C:\WINDOWS\SYSTEM32\MSVCR100.dll:MSVCR100.dll (00000000720B0000), size: 860160 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.40219.325 +D:\Unity\2021.3.27f1c2\Editor\tbb.dll:tbb.dll (00007FFE97D40000), size: 413696 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2017.0.2016.1004 +C:\WINDOWS\SYSTEM32\MSVCP120.dll:MSVCP120.dll (00007FFE92210000), size: 679936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.40649.5 +C:\WINDOWS\SYSTEM32\MSVCR120.dll:MSVCR120.dll (00007FFE922C0000), size: 978944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.40649.5 +D:\Unity\2021.3.27f1c2\Editor\OpenRL_pthread.dll:OpenRL_pthread.dll (000001BA544C0000), size: 61440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.9.0.0 +C:\WINDOWS\SYSTEM32\MSASN1.dll:MSASN1.dll (00007FFF2A900000), size: 73728 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\CRYPTSP.dll:CRYPTSP.dll (00007FFF2A8A0000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\rsaenh.dll:rsaenh.dll (00007FFF2A130000), size: 217088 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\CRYPTBASE.dll:CRYPTBASE.dll (00007FFF2A8C0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\bcryptPrimitives.dll:bcryptPrimitives.dll (00007FFF2B0B0000), size: 499712 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\MSWSOCK.DLL:MSWSOCK.DLL (00007FFF2A650000), size: 430080 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\cfgmgr32.DLL:cfgmgr32.DLL (00007FFF2AD70000), size: 319488 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\kernel.appcore.dll:kernel.appcore.dll (00007FFF2A1D0000), size: 98304 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2715 +C:\WINDOWS\system32\uxtheme.dll:uxtheme.dll (00007FFF28640000), size: 700416 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\shcore.dll:shcore.dll (00007FFF2D380000), size: 995328 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2715 +C:\WINDOWS\SYSTEM32\windows.storage.dll:windows.storage.dll (00007FFF29000000), size: 9396224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wintypes.dll:wintypes.dll (00007FFF28EC0000), size: 1302528 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\profapi.dll:profapi.dll (00007FFF2AFE0000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\IconCodecService.dll:IconCodecService.dll (00007FFEFEF60000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\WindowsCodecs.dll:WindowsCodecs.dll (00007FFF26D70000), size: 1769472 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\clbcatq.dll:clbcatq.dll (00007FFF2CD50000), size: 720896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2001.12.10941.16384 +C:\WINDOWS\System32\netprofm.dll:netprofm.dll (00007FFF264C0000), size: 491520 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\NSI.dll:NSI.dll (00007FFF2BAC0000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\DNSAPI.dll:DNSAPI.dll (00007FFF29C40000), size: 1019904 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\npmproxy.dll:npmproxy.dll (00007FFF24B20000), size: 98304 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\napinsp.dll:napinsp.dll (00007FFF0C1E0000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\system32\pnrpnsp.dll:pnrpnsp.dll (00007FFF0C1C0000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\winrnr.dll:winrnr.dll (00007FFF0C1A0000), size: 69632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\system32\wshbth.dll:wshbth.dll (00007FFF0C160000), size: 86016 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\nlansp_c.dll:nlansp_c.dll (00007FFF0C130000), size: 135168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\fwpuclnt.dll:fwpuclnt.dll (00007FFF24D80000), size: 536576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\Windows\System32\rasadhlp.dll:rasadhlp.dll (00007FFF1AD20000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +D:\Unity\2021.3.27f1c2\Editor\NVUnityPlugin.DLL:NVUnityPlugin.DLL (00007FFE8E3E0000), size: 1536000 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\Data\Tools\astcenc-avx2.dll:astcenc-avx2.dll (00007FFE8E350000), size: 561152 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\d3d11.dll:d3d11.dll (00007FFF271A0000), size: 2453504 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\dxgi.dll:dxgi.dll (00007FFF28850000), size: 1015808 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\directxdatabasehelper.dll:directxdatabasehelper.dll (00007FFF25580000), size: 303104 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\nvldumdx.dll:nvldumdx.dll (00007FFF21F30000), size: 770048 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 31.0.15.3623 +C:\WINDOWS\SYSTEM32\cryptnet.dll:cryptnet.dll (00007FFF242B0000), size: 204800 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\drvstore.dll:drvstore.dll (00007FFF23FD0000), size: 1409024 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\devobj.dll:devobj.dll (00007FFF2ADC0000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\wldp.dll:wldp.dll (00007FFF2A970000), size: 307200 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\imagehlp.dll:imagehlp.dll (00007FFF2CE00000), size: 126976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\nvwgf2umx.dll:nvwgf2umx.dll (00007FFF14530000), size: 99463168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 31.0.15.3623 +C:\WINDOWS\system32\nvspcap64.dll:nvspcap64.dll (00007FFF0AD80000), size: 2953216 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.27.0.112 +C:\WINDOWS\SYSTEM32\ntmarta.dll:ntmarta.dll (00007FFF2A1F0000), size: 212992 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\Display.NvContainer\MessageBus.dll:MessageBus.dll (00007FFF1EF90000), size: 7565312 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.22.2758.1620 +C:\WINDOWS\system32\wbem\wbemprox.dll:wbemprox.dll (00007FFF1B1D0000), size: 65536 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wbemcomn.dll:wbemcomn.dll (00007FFF1B150000), size: 524288 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\wbem\wbemsvc.dll:wbemsvc.dll (00007FFF1AC10000), size: 81920 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\system32\wbem\fastprox.dll:fastprox.dll (00007FFF1A660000), size: 1015808 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\amsi.dll:amsi.dll (00007FFF21A50000), size: 118784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\USERENV.dll:USERENV.dll (00007FFF2A740000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.23110.3-0\MpOav.dll:MpOav.dll (00007FFF219C0000), size: 507904 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 4.18.23110.3 +D:\Unity\2021.3.27f1c2\Editor\cudart64_90.dll:cudart64_90.dll (00007FFE8E270000), size: 397312 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.14.11.9000 +C:\WINDOWS\SYSTEM32\opencl.dll:opencl.dll (00007FFE8DA10000), size: 1490944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.0.3.0 +D:\Unity\2021.3.27f1c2\Editor\radeonrays.dll:radeonrays.dll (00007FFE8E1E0000), size: 557056 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\Data\MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll:mono-2.0-bdwgc.dll (00007FFE8CFE0000), size: 10682368 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\PROPSYS.dll:PROPSYS.dll (00007FFF26270000), size: 1052672 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.22621.2506 +C:\Windows\System32\Windows.System.Launcher.dll:Windows.System.Launcher.dll (00007FFF24130000), size: 1265664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\Windows\System32\msvcp110_win.dll:msvcp110_win.dll (00007FFF26830000), size: 602112 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\windows.staterepositorycore.dll:windows.staterepositorycore.dll (00007FFF23FB0000), size: 106496 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.2506_none_270c5ae97388e100\comctl32.dll:comctl32.dll (00007FFF1F980000), size: 2699264 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.10.22621.2506 +C:\Windows\System32\thumbcache.dll:thumbcache.dll (00007FFEFAC00000), size: 438272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\policymanager.dll:policymanager.dll (00007FFF26CC0000), size: 675840 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\dbghelp.dll:dbghelp.dll (00007FFF1FEB0000), size: 2306048 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 + +========== OUTPUTTING STACK TRACE ================== + +0x00007FFF2B3F567C (KERNELBASE) RaiseException +0x00007FF79BFD8AFB (Unity) EditorMonoConsole::LogToConsoleImplementation +0x00007FF79BFD95ED (Unity) EditorMonoConsole::LogToConsoleImplementation +0x00007FF79CC68077 (Unity) DebugStringToFilePostprocessedStacktrace +0x00007FF79CC677CD (Unity) DebugStringToFile +0x00007FF79C4554D5 (Unity) LoadDomainAndUserAssemblies +0x00007FF79C455B64 (Unity) LoadUserAssemblies +0x00007FF79C94DFFF (Unity) ::operator() +0x00007FF79C98F9A2 (Unity) asio::detail::completion_handler,asio::io_context::basic_executor_type,0> >::do_complete +0x00007FF79C97B88E (Unity) asio::detail::win_iocp_io_context::do_one +0x00007FF79C97D4F4 (Unity) asio::detail::win_iocp_io_context::run +0x00007FF79C98DD8E (Unity) IOService::Run +0x00007FF79C96049F (Unity) AssetImportWorkerClient::Run +0x00007FF79C928AA3 (Unity) RunAssetImportWorkerClientV2 +0x00007FF79C928B2B (Unity) RunAssetImporterV2 +0x00007FF79C158828 (Unity) Application::InitializeProject +0x00007FF79C5A5478 (Unity) WinMain +0x00007FF79D9A360E (Unity) __scrt_common_main_seh +0x00007FFF2CC9257D (KERNEL32) BaseThreadInitThunk +0x00007FFF2DDCAA58 (ntdll) RtlUserThreadStart + +========== END OF STACKTRACE =========== + +A crash has been intercepted by the crash handler. For call stack and other details, see the latest crash report generated in: + * C:/Users/ADMINI~1/AppData/Local/Temp/Unity/Editor/Crashes diff --git a/JNFrame/Logs/AssetImportWorker1-prev.log b/JNFrame/Logs/AssetImportWorker1-prev.log new file mode 100644 index 00000000..5bd212aa --- /dev/null +++ b/JNFrame/Logs/AssetImportWorker1-prev.log @@ -0,0 +1,7333 @@ +Using pre-set license +Built from '2021.3/china_unity/release' branch; Version is '2021.3.27f1c2 (3b3d9646cb47) revision 3882390'; Using compiler version '192829333'; Build Type 'Release' +OS: 'Windows 11 (10.0.22621) 64bit Professional' Language: 'zh' Physical Memory: 32651 MB +BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1 + +COMMAND LINE ARGUMENTS: +D:\Unity\2021.3.27f1c2\Editor\Unity.exe +-adb2 +-batchMode +-noUpm +-name +AssetImportWorker1 +-projectPath +D:/myproject/unity/JNFrame +-logFile +Logs/AssetImportWorker1.log +-srvPort +59192 +Successfully changed project path to: D:/myproject/unity/JNFrame +D:/myproject/unity/JNFrame +[UnityMemory] Configuration Parameters - Can be set up in boot.config + "memorysetup-bucket-allocator-granularity=16" + "memorysetup-bucket-allocator-bucket-count=8" + "memorysetup-bucket-allocator-block-size=33554432" + "memorysetup-bucket-allocator-block-count=8" + "memorysetup-main-allocator-block-size=16777216" + "memorysetup-thread-allocator-block-size=16777216" + "memorysetup-gfx-main-allocator-block-size=16777216" + "memorysetup-gfx-thread-allocator-block-size=16777216" + "memorysetup-cache-allocator-block-size=4194304" + "memorysetup-typetree-allocator-block-size=2097152" + "memorysetup-profiler-bucket-allocator-granularity=16" + "memorysetup-profiler-bucket-allocator-bucket-count=8" + "memorysetup-profiler-bucket-allocator-block-size=33554432" + "memorysetup-profiler-bucket-allocator-block-count=8" + "memorysetup-profiler-allocator-block-size=16777216" + "memorysetup-profiler-editor-allocator-block-size=1048576" + "memorysetup-temp-allocator-size-main=16777216" + "memorysetup-job-temp-allocator-block-size=2097152" + "memorysetup-job-temp-allocator-block-size-background=1048576" + "memorysetup-job-temp-allocator-reduction-small-platforms=262144" + "memorysetup-temp-allocator-size-background-worker=32768" + "memorysetup-temp-allocator-size-job-worker=262144" + "memorysetup-temp-allocator-size-preload-manager=33554432" + "memorysetup-temp-allocator-size-nav-mesh-worker=65536" + "memorysetup-temp-allocator-size-audio-worker=65536" + "memorysetup-temp-allocator-size-cloud-worker=32768" + "memorysetup-temp-allocator-size-gi-baking-worker=262144" + "memorysetup-temp-allocator-size-gfx=262144" +Player connection [35772] Host "[IP] 192.168.0.118 [Port] 0 [Flags] 2 [Guid] 779486804 [EditorId] 779486804 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... + +Player connection [35772] Host "[IP] 192.168.0.118 [Port] 0 [Flags] 2 [Guid] 779486804 [EditorId] 779486804 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... + +AS: AutoStreaming module initializing. +Refreshing native plugins compatible for Editor in 172.48 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Initialize engine version: 2021.3.27f1c2 (3b3d9646cb47) +[Subsystems] Discovering subsystems at path D:/Unity/2021.3.27f1c2/Editor/Data/Resources/UnitySubsystems +[Subsystems] Discovering subsystems at path D:/myproject/unity/JNFrame/Assets +GfxDevice: creating device client; threaded=0; jobified=0 +Direct3D: + Version: Direct3D 11.0 [level 11.1] + Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) + Vendor: NVIDIA + VRAM: 5980 MB + Driver: 31.0.15.3623 +Initialize mono +Mono path[0] = 'D:/Unity/2021.3.27f1c2/Editor/Data/Managed' +Mono path[1] = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' +Mono config path = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/etc' +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56324 +Begin MonoManager ReloadAssembly +Registering precompiled unity dll's ... +Register platform support module: D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll +Registered in 0.005160 seconds. +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 95.29 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.965 seconds +Domain Reload Profiling: + ReloadAssembly (965ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (0ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (1ms) + EndReloadAssembly (623ms) + LoadAssemblies (154ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (198ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (293ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (95ms) + BeforeProcessingInitializeOnLoad (1ms) + ProcessInitializeOnLoadAttributes (129ms) + ProcessInitializeOnLoadMethodAttributes (56ms) + AfterProcessingInitializeOnLoad (0ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (0ms) +Platform modules already initialized, skipping +Registering precompiled user dll's ... +Registered in 0.012308 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.282 seconds +Domain Reload Profiling: + ReloadAssembly (1282ms) + BeginReloadAssembly (131ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (21ms) + EndReloadAssembly (935ms) + LoadAssemblies (133ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (333ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (56ms) + SetupLoadedEditorAssemblies (375ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (250ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +======================================================================== +Worker process is ready to serve import requests +Launched and connected shader compiler UnityShaderCompiler.exe after 0.08 seconds +Refreshing native plugins compatible for Editor in 0.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 30 unused Assets / (46.8 KB). Loaded Objects now: 5254. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.641400 ms (FindLiveObjects: 0.342500 ms CreateObjectMapping: 0.184900 ms MarkObjects: 2.031700 ms DeleteObjects: 0.080900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 720582.202777 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'bf90adb40d2e457ef6da36e3230811e3') in 0.049086 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009699 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.090 seconds +Domain Reload Profiling: + ReloadAssembly (1091ms) + BeginReloadAssembly (180ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (795ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (309ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.0 KB). Loaded Objects now: 5257. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.284400 ms (FindLiveObjects: 0.289600 ms CreateObjectMapping: 0.156700 ms MarkObjects: 1.815400 ms DeleteObjects: 0.021700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010698 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.242 seconds +Domain Reload Profiling: + ReloadAssembly (1242ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (962ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (377ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (367ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (195ms) + ProcessInitializeOnLoadMethodAttributes (40ms) + AfterProcessingInitializeOnLoad (59ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5260. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.773400 ms (FindLiveObjects: 0.381500 ms CreateObjectMapping: 0.225800 ms MarkObjects: 2.130400 ms DeleteObjects: 0.034000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010983 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.025 seconds +Domain Reload Profiling: + ReloadAssembly (1026ms) + BeginReloadAssembly (173ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (760ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (294ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5263. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.438300 ms (FindLiveObjects: 0.266600 ms CreateObjectMapping: 0.147400 ms MarkObjects: 2.003800 ms DeleteObjects: 0.019600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013554 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.245 seconds +Domain Reload Profiling: + ReloadAssembly (1245ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (971ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (465ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (79ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5266. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.384500 ms (FindLiveObjects: 0.292300 ms CreateObjectMapping: 0.162500 ms MarkObjects: 1.910000 ms DeleteObjects: 0.018600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016249 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.158 seconds +Domain Reload Profiling: + ReloadAssembly (1160ms) + BeginReloadAssembly (185ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (876ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (374ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (250ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5269. +Memory consumption went from 164.1 MB to 164.1 MB. +Total: 2.639600 ms (FindLiveObjects: 0.305000 ms CreateObjectMapping: 0.156200 ms MarkObjects: 2.152300 ms DeleteObjects: 0.024900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009908 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.169 seconds +Domain Reload Profiling: + ReloadAssembly (1170ms) + BeginReloadAssembly (211ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (72ms) + EndReloadAssembly (821ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (343ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5272. +Memory consumption went from 164.2 MB to 164.1 MB. +Total: 2.957100 ms (FindLiveObjects: 0.349100 ms CreateObjectMapping: 0.169200 ms MarkObjects: 2.405800 ms DeleteObjects: 0.031500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014097 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.071 seconds +Domain Reload Profiling: + ReloadAssembly (1071ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (819ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (275ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (321ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (85ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4788 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5275. +Memory consumption went from 164.4 MB to 164.3 MB. +Total: 2.699900 ms (FindLiveObjects: 0.332500 ms CreateObjectMapping: 0.153800 ms MarkObjects: 2.184100 ms DeleteObjects: 0.027700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.019226 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.069 seconds +Domain Reload Profiling: + ReloadAssembly (1070ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (800ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (319ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (284ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4789 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5279. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 4.046300 ms (FindLiveObjects: 0.343000 ms CreateObjectMapping: 0.175900 ms MarkObjects: 3.448200 ms DeleteObjects: 0.075600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016975 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.115 seconds +Domain Reload Profiling: + ReloadAssembly (1116ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (838ms) + LoadAssemblies (115ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (326ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (316ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (186ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4789 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5282. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 3.118800 ms (FindLiveObjects: 0.501600 ms CreateObjectMapping: 0.411300 ms MarkObjects: 2.171400 ms DeleteObjects: 0.033200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013014 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.078 seconds +Domain Reload Profiling: + ReloadAssembly (1079ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (834ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (321ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (59ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (88ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4789 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5285. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.511900 ms (FindLiveObjects: 0.303600 ms CreateObjectMapping: 0.166600 ms MarkObjects: 1.985800 ms DeleteObjects: 0.054900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010520 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.109 seconds +Domain Reload Profiling: + ReloadAssembly (1110ms) + BeginReloadAssembly (198ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (62ms) + EndReloadAssembly (800ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (356ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (253ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5290. +Memory consumption went from 164.3 MB to 164.2 MB. +Total: 2.534500 ms (FindLiveObjects: 0.308600 ms CreateObjectMapping: 0.166500 ms MarkObjects: 2.034400 ms DeleteObjects: 0.023400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012989 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.113 seconds +Domain Reload Profiling: + ReloadAssembly (1114ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (856ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (336ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (57ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (81ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5293. +Memory consumption went from 164.3 MB to 164.2 MB. +Total: 3.156200 ms (FindLiveObjects: 0.572800 ms CreateObjectMapping: 0.400500 ms MarkObjects: 2.151200 ms DeleteObjects: 0.030700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012971 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.040 seconds +Domain Reload Profiling: + ReloadAssembly (1041ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (773ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (271ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (307ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (191ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5296. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 3.289300 ms (FindLiveObjects: 0.309400 ms CreateObjectMapping: 0.159100 ms MarkObjects: 2.780700 ms DeleteObjects: 0.038300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011843 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.45 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 8.849 seconds +Domain Reload Profiling: + ReloadAssembly (8850ms) + BeginReloadAssembly (255ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (88ms) + EndReloadAssembly (8477ms) + LoadAssemblies (173ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (2547ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (137ms) + SetupLoadedEditorAssemblies (597ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (24ms) + SetLoadedEditorAssemblies (3ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (126ms) + ProcessInitializeOnLoadAttributes (370ms) + ProcessInitializeOnLoadMethodAttributes (46ms) + AfterProcessingInitializeOnLoad (26ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (21ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.29 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5299. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 6.691700 ms (FindLiveObjects: 1.019500 ms CreateObjectMapping: 0.702500 ms MarkObjects: 4.931800 ms DeleteObjects: 0.034100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016082 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.21 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.959 seconds +Domain Reload Profiling: + ReloadAssembly (1961ms) + BeginReloadAssembly (280ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (71ms) + EndReloadAssembly (1540ms) + LoadAssemblies (203ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (473ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (131ms) + SetupLoadedEditorAssemblies (660ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (109ms) + ProcessInitializeOnLoadAttributes (359ms) + ProcessInitializeOnLoadMethodAttributes (45ms) + AfterProcessingInitializeOnLoad (138ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (20ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5302. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.641800 ms (FindLiveObjects: 0.297900 ms CreateObjectMapping: 0.153900 ms MarkObjects: 2.168200 ms DeleteObjects: 0.020900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015121 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.132 seconds +Domain Reload Profiling: + ReloadAssembly (1133ms) + BeginReloadAssembly (177ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (833ms) + LoadAssemblies (148ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (291ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (336ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (226ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.46 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5305. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.344700 ms (FindLiveObjects: 0.310400 ms CreateObjectMapping: 0.162700 ms MarkObjects: 1.847900 ms DeleteObjects: 0.022300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010791 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.149 seconds +Domain Reload Profiling: + ReloadAssembly (1150ms) + BeginReloadAssembly (273ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (89ms) + EndReloadAssembly (761ms) + LoadAssemblies (194ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5308. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.572300 ms (FindLiveObjects: 0.278400 ms CreateObjectMapping: 0.144000 ms MarkObjects: 2.111400 ms DeleteObjects: 0.037400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011722 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.072 seconds +Domain Reload Profiling: + ReloadAssembly (1073ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (784ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (289ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (297ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5311. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.373800 ms (FindLiveObjects: 0.289800 ms CreateObjectMapping: 0.148400 ms MarkObjects: 1.908200 ms DeleteObjects: 0.026800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011336 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.072 seconds +Domain Reload Profiling: + ReloadAssembly (1073ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (819ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (302ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (315ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (200ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5314. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.940100 ms (FindLiveObjects: 0.402400 ms CreateObjectMapping: 0.181900 ms MarkObjects: 2.323600 ms DeleteObjects: 0.030100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010480 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.000 seconds +Domain Reload Profiling: + ReloadAssembly (1000ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (718ms) + LoadAssemblies (129ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (248ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5317. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.719500 ms (FindLiveObjects: 0.351700 ms CreateObjectMapping: 0.194300 ms MarkObjects: 2.143300 ms DeleteObjects: 0.028900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011293 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.441 seconds +Domain Reload Profiling: + ReloadAssembly (1442ms) + BeginReloadAssembly (378ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (12ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (98ms) + EndReloadAssembly (939ms) + LoadAssemblies (247ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (390ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (317ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (2ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.37 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5320. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 3.968200 ms (FindLiveObjects: 0.511900 ms CreateObjectMapping: 0.263000 ms MarkObjects: 3.120700 ms DeleteObjects: 0.070400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011020 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.009 seconds +Domain Reload Profiling: + ReloadAssembly (1009ms) + BeginReloadAssembly (148ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (31ms) + EndReloadAssembly (755ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (271ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (294ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.03 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5323. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.653900 ms (FindLiveObjects: 0.421300 ms CreateObjectMapping: 0.155300 ms MarkObjects: 2.051800 ms DeleteObjects: 0.024600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010603 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.018 seconds +Domain Reload Profiling: + ReloadAssembly (1020ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (753ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (257ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (304ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5326. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 3.657300 ms (FindLiveObjects: 0.437700 ms CreateObjectMapping: 0.528400 ms MarkObjects: 2.635400 ms DeleteObjects: 0.053400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.034878 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.310 seconds +Domain Reload Profiling: + ReloadAssembly (1311ms) + BeginReloadAssembly (205ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (55ms) + EndReloadAssembly (970ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (356ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (52ms) + SetupLoadedEditorAssemblies (399ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (80ms) + ProcessInitializeOnLoadAttributes (272ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.43 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5329. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 10.500500 ms (FindLiveObjects: 0.488400 ms CreateObjectMapping: 0.345700 ms MarkObjects: 9.595700 ms DeleteObjects: 0.067600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012571 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.661 seconds +Domain Reload Profiling: + ReloadAssembly (1663ms) + BeginReloadAssembly (202ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (1324ms) + LoadAssemblies (141ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (302ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (768ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (422ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (232ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (20ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5332. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 3.131100 ms (FindLiveObjects: 0.432700 ms CreateObjectMapping: 0.313400 ms MarkObjects: 2.350300 ms DeleteObjects: 0.033200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013612 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.188 seconds +Domain Reload Profiling: + ReloadAssembly (1189ms) + BeginReloadAssembly (178ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (894ms) + LoadAssemblies (161ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (360ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.21 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5335. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.628300 ms (FindLiveObjects: 0.614500 ms CreateObjectMapping: 0.411900 ms MarkObjects: 2.413800 ms DeleteObjects: 0.186500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013294 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.100 seconds +Domain Reload Profiling: + ReloadAssembly (1101ms) + BeginReloadAssembly (275ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (92ms) + EndReloadAssembly (703ms) + LoadAssemblies (167ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (255ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5338. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.183700 ms (FindLiveObjects: 0.338600 ms CreateObjectMapping: 0.167000 ms MarkObjects: 2.638700 ms DeleteObjects: 0.037600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017407 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.052 seconds +Domain Reload Profiling: + ReloadAssembly (1053ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (774ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (326ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5341. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.490800 ms (FindLiveObjects: 0.351800 ms CreateObjectMapping: 0.174200 ms MarkObjects: 2.897000 ms DeleteObjects: 0.065700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011059 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.163 seconds +Domain Reload Profiling: + ReloadAssembly (1164ms) + BeginReloadAssembly (233ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (62ms) + EndReloadAssembly (827ms) + LoadAssemblies (146ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (314ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (312ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (190ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5344. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.720900 ms (FindLiveObjects: 0.364000 ms CreateObjectMapping: 0.177600 ms MarkObjects: 2.134500 ms DeleteObjects: 0.043400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011565 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.944 seconds +Domain Reload Profiling: + ReloadAssembly (945ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (695ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (247ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (262ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5347. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 3.644800 ms (FindLiveObjects: 0.587400 ms CreateObjectMapping: 0.235100 ms MarkObjects: 2.761100 ms DeleteObjects: 0.057000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012546 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.188 seconds +Domain Reload Profiling: + ReloadAssembly (1189ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (934ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (278ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (449ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (80ms) + ProcessInitializeOnLoadAttributes (289ms) + ProcessInitializeOnLoadMethodAttributes (46ms) + AfterProcessingInitializeOnLoad (26ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (22ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4791 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5350. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 3.485100 ms (FindLiveObjects: 0.532300 ms CreateObjectMapping: 0.199700 ms MarkObjects: 2.710700 ms DeleteObjects: 0.041000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012033 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.078 seconds +Domain Reload Profiling: + ReloadAssembly (1079ms) + BeginReloadAssembly (209ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (762ms) + LoadAssemblies (146ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (284ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (293ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5354. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.830500 ms (FindLiveObjects: 1.031400 ms CreateObjectMapping: 0.505100 ms MarkObjects: 2.237100 ms DeleteObjects: 0.054900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011051 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.380 seconds +Domain Reload Profiling: + ReloadAssembly (1380ms) + BeginReloadAssembly (257ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (64ms) + EndReloadAssembly (844ms) + LoadAssemblies (202ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (316ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (304ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (190ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5357. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.321400 ms (FindLiveObjects: 0.341600 ms CreateObjectMapping: 0.186800 ms MarkObjects: 1.765800 ms DeleteObjects: 0.026400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012493 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.365 seconds +Domain Reload Profiling: + ReloadAssembly (1366ms) + BeginReloadAssembly (240ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (84ms) + EndReloadAssembly (972ms) + LoadAssemblies (159ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (437ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (53ms) + SetupLoadedEditorAssemblies (303ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (186ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5360. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.896400 ms (FindLiveObjects: 0.483200 ms CreateObjectMapping: 0.231000 ms MarkObjects: 2.148300 ms DeleteObjects: 0.032200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010820 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.116 seconds +Domain Reload Profiling: + ReloadAssembly (1116ms) + BeginReloadAssembly (142ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (872ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (311ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (360ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (227ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.43 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5363. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.507600 ms (FindLiveObjects: 0.321900 ms CreateObjectMapping: 0.213200 ms MarkObjects: 2.930100 ms DeleteObjects: 0.040000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010667 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.263 seconds +Domain Reload Profiling: + ReloadAssembly (1264ms) + BeginReloadAssembly (215ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (80ms) + EndReloadAssembly (923ms) + LoadAssemblies (126ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (337ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (377ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (244ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.07 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5366. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 8.154600 ms (FindLiveObjects: 0.635100 ms CreateObjectMapping: 0.436900 ms MarkObjects: 6.777300 ms DeleteObjects: 0.296800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010194 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.020 seconds +Domain Reload Profiling: + ReloadAssembly (1020ms) + BeginReloadAssembly (180ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (709ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (260ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (253ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (151ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5369. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.054400 ms (FindLiveObjects: 0.370800 ms CreateObjectMapping: 0.191400 ms MarkObjects: 2.413100 ms DeleteObjects: 0.077400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009861 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.099 seconds +Domain Reload Profiling: + ReloadAssembly (1100ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (830ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (251ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (388ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (258ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (23ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5372. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.557800 ms (FindLiveObjects: 0.339900 ms CreateObjectMapping: 0.158000 ms MarkObjects: 1.914400 ms DeleteObjects: 0.144700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011525 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.137 seconds +Domain Reload Profiling: + ReloadAssembly (1138ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (864ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (323ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (335ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (209ms) + ProcessInitializeOnLoadMethodAttributes (39ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.03 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.1 KB). Loaded Objects now: 5375. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 3.850600 ms (FindLiveObjects: 0.353600 ms CreateObjectMapping: 0.248700 ms MarkObjects: 3.194500 ms DeleteObjects: 0.051900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010308 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.981 seconds +Domain Reload Profiling: + ReloadAssembly (982ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (719ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (29ms) + SetupLoadedEditorAssemblies (265ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.47 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5378. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 3.428600 ms (FindLiveObjects: 0.489700 ms CreateObjectMapping: 0.248900 ms MarkObjects: 2.629500 ms DeleteObjects: 0.058100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011635 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.110 seconds +Domain Reload Profiling: + ReloadAssembly (1111ms) + BeginReloadAssembly (196ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (68ms) + EndReloadAssembly (815ms) + LoadAssemblies (126ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (345ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5381. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.566600 ms (FindLiveObjects: 0.546900 ms CreateObjectMapping: 0.513900 ms MarkObjects: 2.442100 ms DeleteObjects: 0.061200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010262 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.149 seconds +Domain Reload Profiling: + ReloadAssembly (1150ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (883ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (368ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (301ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.45 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5384. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 4.464000 ms (FindLiveObjects: 0.346900 ms CreateObjectMapping: 0.829100 ms MarkObjects: 3.245900 ms DeleteObjects: 0.040000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009652 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.988 seconds +Domain Reload Profiling: + ReloadAssembly (989ms) + BeginReloadAssembly (175ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (59ms) + EndReloadAssembly (709ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (252ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5387. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.975500 ms (FindLiveObjects: 0.374300 ms CreateObjectMapping: 0.318400 ms MarkObjects: 2.253600 ms DeleteObjects: 0.027500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011165 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.022 seconds +Domain Reload Profiling: + ReloadAssembly (1023ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (759ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (312ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5390. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 3.957400 ms (FindLiveObjects: 0.643200 ms CreateObjectMapping: 0.601300 ms MarkObjects: 2.658000 ms DeleteObjects: 0.052000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009761 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.30 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.056 seconds +Domain Reload Profiling: + ReloadAssembly (1057ms) + BeginReloadAssembly (175ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (53ms) + EndReloadAssembly (786ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (305ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.28 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5393. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.899500 ms (FindLiveObjects: 0.408000 ms CreateObjectMapping: 0.217900 ms MarkObjects: 2.240900 ms DeleteObjects: 0.031200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009855 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.264 seconds +Domain Reload Profiling: + ReloadAssembly (1265ms) + BeginReloadAssembly (147ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (1020ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (299ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (507ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (91ms) + ProcessInitializeOnLoadAttributes (319ms) + ProcessInitializeOnLoadMethodAttributes (68ms) + AfterProcessingInitializeOnLoad (22ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5396. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.643600 ms (FindLiveObjects: 0.300300 ms CreateObjectMapping: 0.178700 ms MarkObjects: 2.126600 ms DeleteObjects: 0.036300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010936 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.350 seconds +Domain Reload Profiling: + ReloadAssembly (1351ms) + BeginReloadAssembly (346ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (707ms) + LoadAssemblies (298ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (266ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (249ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (153ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.21 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5399. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.962000 ms (FindLiveObjects: 0.372700 ms CreateObjectMapping: 0.359700 ms MarkObjects: 2.140100 ms DeleteObjects: 0.087000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009326 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.015 seconds +Domain Reload Profiling: + ReloadAssembly (1015ms) + BeginReloadAssembly (207ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (64ms) + EndReloadAssembly (706ms) + LoadAssemblies (126ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (252ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (271ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5402. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.706800 ms (FindLiveObjects: 0.294300 ms CreateObjectMapping: 0.148700 ms MarkObjects: 2.234000 ms DeleteObjects: 0.029100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011454 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.028 seconds +Domain Reload Profiling: + ReloadAssembly (1028ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (778ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (266ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (314ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (201ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5405. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.314000 ms (FindLiveObjects: 0.310600 ms CreateObjectMapping: 0.163000 ms MarkObjects: 1.814800 ms DeleteObjects: 0.024600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010299 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.115 seconds +Domain Reload Profiling: + ReloadAssembly (1116ms) + BeginReloadAssembly (234ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (747ms) + LoadAssemblies (167ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (262ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (300ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (81ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4792 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5408. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 4.452400 ms (FindLiveObjects: 0.663700 ms CreateObjectMapping: 0.395500 ms MarkObjects: 3.321700 ms DeleteObjects: 0.069500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020879 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.438 seconds +Domain Reload Profiling: + ReloadAssembly (1439ms) + BeginReloadAssembly (283ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (82ms) + EndReloadAssembly (1012ms) + LoadAssemblies (180ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (413ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (66ms) + SetupLoadedEditorAssemblies (336ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (212ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (21ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5412. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.562900 ms (FindLiveObjects: 0.993000 ms CreateObjectMapping: 0.199400 ms MarkObjects: 2.337200 ms DeleteObjects: 0.030900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011810 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.122 seconds +Domain Reload Profiling: + ReloadAssembly (1123ms) + BeginReloadAssembly (208ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (68ms) + EndReloadAssembly (780ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (295ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (183ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.07 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5415. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.514700 ms (FindLiveObjects: 0.368300 ms CreateObjectMapping: 0.180000 ms MarkObjects: 1.927400 ms DeleteObjects: 0.037500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013227 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.011 seconds +Domain Reload Profiling: + ReloadAssembly (1012ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (746ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (292ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (283ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 10.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.1 KB). Loaded Objects now: 5418. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.580900 ms (FindLiveObjects: 0.327700 ms CreateObjectMapping: 0.161000 ms MarkObjects: 2.063400 ms DeleteObjects: 0.027500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013126 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.074 seconds +Domain Reload Profiling: + ReloadAssembly (1078ms) + BeginReloadAssembly (191ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (786ms) + LoadAssemblies (103ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (310ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (187ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5421. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.266000 ms (FindLiveObjects: 0.328700 ms CreateObjectMapping: 0.161700 ms MarkObjects: 1.752600 ms DeleteObjects: 0.021800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011648 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.174 seconds +Domain Reload Profiling: + ReloadAssembly (1174ms) + BeginReloadAssembly (190ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (57ms) + EndReloadAssembly (882ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (355ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (53ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (150ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5424. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.281300 ms (FindLiveObjects: 0.298300 ms CreateObjectMapping: 0.146600 ms MarkObjects: 1.817400 ms DeleteObjects: 0.018000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014865 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.018 seconds +Domain Reload Profiling: + ReloadAssembly (1019ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (761ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (301ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5427. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.459700 ms (FindLiveObjects: 0.289300 ms CreateObjectMapping: 0.164300 ms MarkObjects: 1.972700 ms DeleteObjects: 0.032400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010235 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.974 seconds +Domain Reload Profiling: + ReloadAssembly (975ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (710ms) + LoadAssemblies (103ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (244ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (291ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (182ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5430. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 4.033200 ms (FindLiveObjects: 0.426000 ms CreateObjectMapping: 0.270100 ms MarkObjects: 3.281800 ms DeleteObjects: 0.052900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012234 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.117 seconds +Domain Reload Profiling: + ReloadAssembly (1118ms) + BeginReloadAssembly (215ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (780ms) + LoadAssemblies (167ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (278ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (52ms) + SetupLoadedEditorAssemblies (270ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (163ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5433. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.491900 ms (FindLiveObjects: 0.407500 ms CreateObjectMapping: 0.183100 ms MarkObjects: 1.877000 ms DeleteObjects: 0.022700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.019157 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.164 seconds +Domain Reload Profiling: + ReloadAssembly (1165ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (905ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (379ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (304ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (190ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5436. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.306200 ms (FindLiveObjects: 0.300200 ms CreateObjectMapping: 0.130000 ms MarkObjects: 1.855900 ms DeleteObjects: 0.019300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011731 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.296 seconds +Domain Reload Profiling: + ReloadAssembly (1298ms) + BeginReloadAssembly (212ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (69ms) + EndReloadAssembly (952ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (408ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (56ms) + SetupLoadedEditorAssemblies (317ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (197ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5439. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 5.628200 ms (FindLiveObjects: 0.658000 ms CreateObjectMapping: 0.242200 ms MarkObjects: 4.638400 ms DeleteObjects: 0.086600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011719 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.039 seconds +Domain Reload Profiling: + ReloadAssembly (1040ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (760ms) + LoadAssemblies (129ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (285ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (284ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.21 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5442. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 3.035800 ms (FindLiveObjects: 0.508000 ms CreateObjectMapping: 0.338100 ms MarkObjects: 2.148700 ms DeleteObjects: 0.039700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010304 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.075 seconds +Domain Reload Profiling: + ReloadAssembly (1076ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (833ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (319ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.47 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5445. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.513900 ms (FindLiveObjects: 0.338600 ms CreateObjectMapping: 0.179700 ms MarkObjects: 1.974300 ms DeleteObjects: 0.019800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012063 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.064 seconds +Domain Reload Profiling: + ReloadAssembly (1065ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (829ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (278ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (330ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (93ms) + ProcessInitializeOnLoadAttributes (193ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5448. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 3.162100 ms (FindLiveObjects: 0.337300 ms CreateObjectMapping: 0.166800 ms MarkObjects: 2.626600 ms DeleteObjects: 0.030000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014810 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.281 seconds +Domain Reload Profiling: + ReloadAssembly (1282ms) + BeginReloadAssembly (245ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (21ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (883ms) + LoadAssemblies (194ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (314ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (341ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (207ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5451. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 4.052800 ms (FindLiveObjects: 0.607900 ms CreateObjectMapping: 0.449800 ms MarkObjects: 2.938600 ms DeleteObjects: 0.054000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009864 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.940 seconds +Domain Reload Profiling: + ReloadAssembly (941ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (705ms) + LoadAssemblies (96ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (260ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5454. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 3.087700 ms (FindLiveObjects: 0.712600 ms CreateObjectMapping: 0.266400 ms MarkObjects: 2.088400 ms DeleteObjects: 0.019000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020243 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.196 seconds +Domain Reload Profiling: + ReloadAssembly (1197ms) + BeginReloadAssembly (214ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (63ms) + EndReloadAssembly (869ms) + LoadAssemblies (137ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (312ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (352ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (235ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5457. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 2.535900 ms (FindLiveObjects: 0.363900 ms CreateObjectMapping: 0.232300 ms MarkObjects: 1.913000 ms DeleteObjects: 0.025700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012695 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.054 seconds +Domain Reload Profiling: + ReloadAssembly (1055ms) + BeginReloadAssembly (164ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (797ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (275ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (341ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (210ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.37 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5460. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.675000 ms (FindLiveObjects: 0.338800 ms CreateObjectMapping: 0.191500 ms MarkObjects: 2.122900 ms DeleteObjects: 0.020500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013828 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.034 seconds +Domain Reload Profiling: + ReloadAssembly (1035ms) + BeginReloadAssembly (183ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (753ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (282ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5463. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.676100 ms (FindLiveObjects: 0.319200 ms CreateObjectMapping: 0.162400 ms MarkObjects: 2.173400 ms DeleteObjects: 0.020100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013952 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.186 seconds +Domain Reload Profiling: + ReloadAssembly (1186ms) + BeginReloadAssembly (185ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (857ms) + LoadAssemblies (149ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (280ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (346ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (211ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 8.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5466. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.441000 ms (FindLiveObjects: 0.367200 ms CreateObjectMapping: 0.197900 ms MarkObjects: 1.854300 ms DeleteObjects: 0.020200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009942 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.210 seconds +Domain Reload Profiling: + ReloadAssembly (1212ms) + BeginReloadAssembly (188ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (871ms) + LoadAssemblies (143ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (367ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (241ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5469. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.828600 ms (FindLiveObjects: 0.428400 ms CreateObjectMapping: 0.215300 ms MarkObjects: 2.158900 ms DeleteObjects: 0.024900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011933 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.168 seconds +Domain Reload Profiling: + ReloadAssembly (1169ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (920ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (347ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (334ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (213ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (27ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5472. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 2.810800 ms (FindLiveObjects: 0.345500 ms CreateObjectMapping: 0.171100 ms MarkObjects: 2.271600 ms DeleteObjects: 0.021400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012514 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.061 seconds +Domain Reload Profiling: + ReloadAssembly (1062ms) + BeginReloadAssembly (197ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (59ms) + EndReloadAssembly (764ms) + LoadAssemblies (140ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (277ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (183ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5475. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.491700 ms (FindLiveObjects: 0.338700 ms CreateObjectMapping: 0.182700 ms MarkObjects: 1.942900 ms DeleteObjects: 0.026500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011952 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.019 seconds +Domain Reload Profiling: + ReloadAssembly (1020ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (760ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (271ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (286ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5478. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.100900 ms (FindLiveObjects: 0.468300 ms CreateObjectMapping: 0.248400 ms MarkObjects: 2.360300 ms DeleteObjects: 0.022800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013778 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.064 seconds +Domain Reload Profiling: + ReloadAssembly (1065ms) + BeginReloadAssembly (190ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (53ms) + EndReloadAssembly (761ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5481. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.832700 ms (FindLiveObjects: 0.378400 ms CreateObjectMapping: 0.191500 ms MarkObjects: 2.238800 ms DeleteObjects: 0.023200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013748 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.992 seconds +Domain Reload Profiling: + ReloadAssembly (993ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (727ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5484. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.563700 ms (FindLiveObjects: 0.357400 ms CreateObjectMapping: 0.173700 ms MarkObjects: 2.013400 ms DeleteObjects: 0.017900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012486 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.054 seconds +Domain Reload Profiling: + ReloadAssembly (1055ms) + BeginReloadAssembly (183ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (766ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (289ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5487. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.446900 ms (FindLiveObjects: 0.382900 ms CreateObjectMapping: 0.164900 ms MarkObjects: 1.872000 ms DeleteObjects: 0.026300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012956 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.981 seconds +Domain Reload Profiling: + ReloadAssembly (982ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (717ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (253ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.46 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5490. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 4.486300 ms (FindLiveObjects: 0.754000 ms CreateObjectMapping: 0.885900 ms MarkObjects: 2.812300 ms DeleteObjects: 0.032200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010618 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.017 seconds +Domain Reload Profiling: + ReloadAssembly (1018ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (746ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (259ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (310ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (191ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.06 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5493. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 4.040200 ms (FindLiveObjects: 0.484900 ms CreateObjectMapping: 0.240800 ms MarkObjects: 3.276300 ms DeleteObjects: 0.035900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020820 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.175 seconds +Domain Reload Profiling: + ReloadAssembly (1176ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (895ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (389ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (304ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (197ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5496. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.568300 ms (FindLiveObjects: 0.387300 ms CreateObjectMapping: 0.529500 ms MarkObjects: 2.615700 ms DeleteObjects: 0.034400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014670 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.971 seconds +Domain Reload Profiling: + ReloadAssembly (972ms) + BeginReloadAssembly (143ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (732ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (274ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5499. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.358600 ms (FindLiveObjects: 0.350600 ms CreateObjectMapping: 0.184700 ms MarkObjects: 1.802200 ms DeleteObjects: 0.020100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014941 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.967 seconds +Domain Reload Profiling: + ReloadAssembly (968ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (724ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (256ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (20ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5502. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.584800 ms (FindLiveObjects: 0.318000 ms CreateObjectMapping: 0.166800 ms MarkObjects: 2.070400 ms DeleteObjects: 0.028600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010547 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.970 seconds +Domain Reload Profiling: + ReloadAssembly (970ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (719ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (257ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5505. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.531400 ms (FindLiveObjects: 0.346900 ms CreateObjectMapping: 0.206700 ms MarkObjects: 1.952500 ms DeleteObjects: 0.024200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014249 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.983 seconds +Domain Reload Profiling: + ReloadAssembly (984ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (736ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (236ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (300ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (80ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5508. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.498400 ms (FindLiveObjects: 0.753400 ms CreateObjectMapping: 0.351800 ms MarkObjects: 2.361300 ms DeleteObjects: 0.029400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014109 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 5.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.822 seconds +Domain Reload Profiling: + ReloadAssembly (2824ms) + BeginReloadAssembly (603ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (178ms) + EndReloadAssembly (2006ms) + LoadAssemblies (421ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (546ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (204ms) + SetupLoadedEditorAssemblies (859ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (15ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (5ms) + BeforeProcessingInitializeOnLoad (186ms) + ProcessInitializeOnLoadAttributes (584ms) + ProcessInitializeOnLoadMethodAttributes (47ms) + AfterProcessingInitializeOnLoad (21ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5511. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 4.991800 ms (FindLiveObjects: 1.422000 ms CreateObjectMapping: 1.084500 ms MarkObjects: 2.455700 ms DeleteObjects: 0.027800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.021484 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.612 seconds +Domain Reload Profiling: + ReloadAssembly (1613ms) + BeginReloadAssembly (293ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (79ms) + EndReloadAssembly (1095ms) + LoadAssemblies (228ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (340ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (454ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (107ms) + ProcessInitializeOnLoadAttributes (246ms) + ProcessInitializeOnLoadMethodAttributes (76ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5514. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.416400 ms (FindLiveObjects: 0.345300 ms CreateObjectMapping: 0.191600 ms MarkObjects: 1.858600 ms DeleteObjects: 0.019700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013796 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.991 seconds +Domain Reload Profiling: + ReloadAssembly (1992ms) + BeginReloadAssembly (324ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (60ms) + EndReloadAssembly (1422ms) + LoadAssemblies (250ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (824ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (327ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (207ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.46 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5517. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.774800 ms (FindLiveObjects: 0.340900 ms CreateObjectMapping: 0.180900 ms MarkObjects: 2.231000 ms DeleteObjects: 0.021000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012890 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.987 seconds +Domain Reload Profiling: + ReloadAssembly (1988ms) + BeginReloadAssembly (222ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (68ms) + EndReloadAssembly (1607ms) + LoadAssemblies (164ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (672ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (649ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (84ms) + ProcessInitializeOnLoadAttributes (262ms) + ProcessInitializeOnLoadMethodAttributes (246ms) + AfterProcessingInitializeOnLoad (48ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (21ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5520. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 5.945400 ms (FindLiveObjects: 0.751600 ms CreateObjectMapping: 0.507800 ms MarkObjects: 4.628600 ms DeleteObjects: 0.054400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014553 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.379 seconds +Domain Reload Profiling: + ReloadAssembly (2380ms) + BeginReloadAssembly (535ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (123ms) + EndReloadAssembly (1452ms) + LoadAssemblies (453ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (536ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (71ms) + SetupLoadedEditorAssemblies (525ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (13ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (92ms) + ProcessInitializeOnLoadAttributes (377ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 12.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5523. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 4.648100 ms (FindLiveObjects: 0.790600 ms CreateObjectMapping: 0.489800 ms MarkObjects: 3.292600 ms DeleteObjects: 0.071700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016088 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.837 seconds +Domain Reload Profiling: + ReloadAssembly (2838ms) + BeginReloadAssembly (611ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (50ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (87ms) + EndReloadAssembly (1777ms) + LoadAssemblies (459ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (576ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (169ms) + SetupLoadedEditorAssemblies (701ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (107ms) + ProcessInitializeOnLoadAttributes (537ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5526. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 3.688700 ms (FindLiveObjects: 0.578100 ms CreateObjectMapping: 0.407500 ms MarkObjects: 2.667000 ms DeleteObjects: 0.034500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014161 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.35 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.759 seconds +Domain Reload Profiling: + ReloadAssembly (1759ms) + BeginReloadAssembly (536ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (84ms) + EndReloadAssembly (1005ms) + LoadAssemblies (495ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (337ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (349ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (84ms) + ProcessInitializeOnLoadAttributes (207ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.29 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5529. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.605700 ms (FindLiveObjects: 0.410700 ms CreateObjectMapping: 0.194100 ms MarkObjects: 1.976200 ms DeleteObjects: 0.023100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 63568.801594 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '00000000000000000000000000000000') in 0.003373 seconds code(4) message(Build asset version error: assets/script/main.cs in SourceAssetDB has modification time of '2024-01-24T03:48:04.2981688Z' while content on disk has modification time of '2024-01-24T03:48:08.9829309Z') + ERROR: Build asset version error: assets/script/main.cs in SourceAssetDB has modification time of '2024-01-24T03:48:04.2981688Z' while content on disk has modification time of '2024-01-24T03:48:08.9829309Z' +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013776 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.954 seconds +Domain Reload Profiling: + ReloadAssembly (1954ms) + BeginReloadAssembly (437ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (27ms) + BackupInstance (0ms) + ReleaseScriptingObjects (2ms) + CreateAndSetChildDomain (197ms) + EndReloadAssembly (1359ms) + LoadAssemblies (299ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (581ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (304ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (186ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5532. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.575800 ms (FindLiveObjects: 0.360700 ms CreateObjectMapping: 0.180400 ms MarkObjects: 2.015400 ms DeleteObjects: 0.018500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 16.167820 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '1a37335cd086332ae29cd39441562004') in 0.010175 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014709 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.983 seconds +Domain Reload Profiling: + ReloadAssembly (984ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (719ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (259ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5535. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.005500 ms (FindLiveObjects: 0.371800 ms CreateObjectMapping: 0.460600 ms MarkObjects: 2.145600 ms DeleteObjects: 0.026300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009721 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.22 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.013 seconds +Domain Reload Profiling: + ReloadAssembly (1013ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (32ms) + EndReloadAssembly (765ms) + LoadAssemblies (115ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (267ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (297ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5538. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 6.053300 ms (FindLiveObjects: 0.598500 ms CreateObjectMapping: 0.805100 ms MarkObjects: 4.608700 ms DeleteObjects: 0.038500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 40.016594 seconds. + path: Assets/Script/Main.cs + artifactKey: Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Script/Main.cs using Guid(00b2d35a0698b224fa03e09bed92aac7) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '5d2d9fc71195d8f21f0d10c5ce5252e9') in 0.012650 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009130 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.017 seconds +Domain Reload Profiling: + ReloadAssembly (1018ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (750ms) + LoadAssemblies (129ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (315ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (248ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (151ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5541. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.891300 ms (FindLiveObjects: 0.595800 ms CreateObjectMapping: 0.215900 ms MarkObjects: 2.048700 ms DeleteObjects: 0.028600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011149 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.03 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.011 seconds +Domain Reload Profiling: + ReloadAssembly (1011ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (750ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (291ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5544. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.291100 ms (FindLiveObjects: 0.594900 ms CreateObjectMapping: 0.276000 ms MarkObjects: 2.391600 ms DeleteObjects: 0.027400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010263 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.913 seconds +Domain Reload Profiling: + ReloadAssembly (1914ms) + BeginReloadAssembly (366ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (30ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (120ms) + EndReloadAssembly (1401ms) + LoadAssemblies (275ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (725ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (343ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (210ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.22 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5547. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.562200 ms (FindLiveObjects: 0.399700 ms CreateObjectMapping: 0.165400 ms MarkObjects: 1.971300 ms DeleteObjects: 0.024800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014101 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.170 seconds +Domain Reload Profiling: + ReloadAssembly (2171ms) + BeginReloadAssembly (225ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (14ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (57ms) + EndReloadAssembly (1607ms) + LoadAssemblies (253ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (733ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (507ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (318ms) + ProcessInitializeOnLoadMethodAttributes (67ms) + AfterProcessingInitializeOnLoad (36ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (25ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5550. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.476700 ms (FindLiveObjects: 0.650200 ms CreateObjectMapping: 0.337900 ms MarkObjects: 2.415900 ms DeleteObjects: 0.071000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011254 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.004 seconds +Domain Reload Profiling: + ReloadAssembly (1007ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (732ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (274ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5553. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 2.593200 ms (FindLiveObjects: 0.466200 ms CreateObjectMapping: 0.223400 ms MarkObjects: 1.877100 ms DeleteObjects: 0.025100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012728 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.020 seconds +Domain Reload Profiling: + ReloadAssembly (1021ms) + BeginReloadAssembly (193ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (58ms) + EndReloadAssembly (717ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (265ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5556. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 3.489000 ms (FindLiveObjects: 0.481500 ms CreateObjectMapping: 0.499800 ms MarkObjects: 2.464700 ms DeleteObjects: 0.041400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011139 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.881 seconds +Domain Reload Profiling: + ReloadAssembly (1882ms) + BeginReloadAssembly (329ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (1299ms) + LoadAssemblies (564ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (429ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (334ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (205ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.21 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5559. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 2.943400 ms (FindLiveObjects: 0.334000 ms CreateObjectMapping: 0.170700 ms MarkObjects: 2.414000 ms DeleteObjects: 0.023100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010057 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.024 seconds +Domain Reload Profiling: + ReloadAssembly (1025ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (765ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (284ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (184ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5562. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.259200 ms (FindLiveObjects: 0.584500 ms CreateObjectMapping: 0.286400 ms MarkObjects: 2.350400 ms DeleteObjects: 0.036300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020131 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.536 seconds +Domain Reload Profiling: + ReloadAssembly (1537ms) + BeginReloadAssembly (316ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (115ms) + EndReloadAssembly (830ms) + LoadAssemblies (187ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (297ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (182ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5565. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.917000 ms (FindLiveObjects: 0.790500 ms CreateObjectMapping: 0.199800 ms MarkObjects: 2.903900 ms DeleteObjects: 0.021300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012191 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.036 seconds +Domain Reload Profiling: + ReloadAssembly (1036ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (753ms) + LoadAssemblies (138ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (276ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5568. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 4.741500 ms (FindLiveObjects: 0.397500 ms CreateObjectMapping: 0.198600 ms MarkObjects: 4.089600 ms DeleteObjects: 0.053800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010847 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.079 seconds +Domain Reload Profiling: + ReloadAssembly (1080ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (810ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (263ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (351ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (222ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5571. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.119100 ms (FindLiveObjects: 0.510500 ms CreateObjectMapping: 0.221300 ms MarkObjects: 2.363200 ms DeleteObjects: 0.022500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020874 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.147 seconds +Domain Reload Profiling: + ReloadAssembly (1148ms) + BeginReloadAssembly (210ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (64ms) + EndReloadAssembly (835ms) + LoadAssemblies (129ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (315ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (303ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (182ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5574. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.237400 ms (FindLiveObjects: 0.483100 ms CreateObjectMapping: 0.235800 ms MarkObjects: 2.488500 ms DeleteObjects: 0.028300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014779 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.020 seconds +Domain Reload Profiling: + ReloadAssembly (1021ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (752ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (284ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (278ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5577. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.498000 ms (FindLiveObjects: 0.453100 ms CreateObjectMapping: 0.189900 ms MarkObjects: 2.824000 ms DeleteObjects: 0.029800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015833 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.005 seconds +Domain Reload Profiling: + ReloadAssembly (1005ms) + BeginReloadAssembly (147ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (761ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (256ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (307ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (188ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5580. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.500700 ms (FindLiveObjects: 0.353400 ms CreateObjectMapping: 0.184900 ms MarkObjects: 1.937900 ms DeleteObjects: 0.023300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012309 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.035 seconds +Domain Reload Profiling: + ReloadAssembly (1035ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (760ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (286ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.30 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5583. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.588100 ms (FindLiveObjects: 0.398700 ms CreateObjectMapping: 0.235300 ms MarkObjects: 1.934600 ms DeleteObjects: 0.018500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010713 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.081 seconds +Domain Reload Profiling: + ReloadAssembly (1081ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (791ms) + LoadAssemblies (133ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (275ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (312ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (193ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.47 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5586. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.681000 ms (FindLiveObjects: 0.363900 ms CreateObjectMapping: 0.190700 ms MarkObjects: 2.099100 ms DeleteObjects: 0.026100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009811 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.011 seconds +Domain Reload Profiling: + ReloadAssembly (1012ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (760ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (275ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.47 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5589. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 4.625500 ms (FindLiveObjects: 0.677700 ms CreateObjectMapping: 0.273500 ms MarkObjects: 3.624500 ms DeleteObjects: 0.047200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009634 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.036 seconds +Domain Reload Profiling: + ReloadAssembly (1036ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (735ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (263ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.18 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.1 KB). Loaded Objects now: 5592. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 2.472400 ms (FindLiveObjects: 0.361800 ms CreateObjectMapping: 0.185300 ms MarkObjects: 1.901100 ms DeleteObjects: 0.023000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012729 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.107 seconds +Domain Reload Profiling: + ReloadAssembly (1108ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (827ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (362ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (270ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5595. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 3.519200 ms (FindLiveObjects: 0.438300 ms CreateObjectMapping: 0.243000 ms MarkObjects: 2.801200 ms DeleteObjects: 0.035200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020133 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.095 seconds +Domain Reload Profiling: + ReloadAssembly (1096ms) + BeginReloadAssembly (216ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (72ms) + EndReloadAssembly (772ms) + LoadAssemblies (130ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (285ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5598. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 2.557500 ms (FindLiveObjects: 0.433600 ms CreateObjectMapping: 0.186200 ms MarkObjects: 1.918400 ms DeleteObjects: 0.018200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010659 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.017 seconds +Domain Reload Profiling: + ReloadAssembly (1018ms) + BeginReloadAssembly (190ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (719ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (272ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.06 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5601. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.686500 ms (FindLiveObjects: 0.438600 ms CreateObjectMapping: 0.189200 ms MarkObjects: 2.034600 ms DeleteObjects: 0.022600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014384 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.245 seconds +Domain Reload Profiling: + ReloadAssembly (1246ms) + BeginReloadAssembly (216ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (75ms) + EndReloadAssembly (847ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (338ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (307ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (183ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5604. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.031200 ms (FindLiveObjects: 0.551600 ms CreateObjectMapping: 0.334900 ms MarkObjects: 2.121200 ms DeleteObjects: 0.022200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.031311 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.268 seconds +Domain Reload Profiling: + ReloadAssembly (1269ms) + BeginReloadAssembly (213ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (59ms) + EndReloadAssembly (921ms) + LoadAssemblies (167ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (345ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (349ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (203ms) + ProcessInitializeOnLoadMethodAttributes (36ms) + AfterProcessingInitializeOnLoad (24ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 8.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5607. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.690500 ms (FindLiveObjects: 0.472200 ms CreateObjectMapping: 0.197100 ms MarkObjects: 1.994100 ms DeleteObjects: 0.025900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013086 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.100 seconds +Domain Reload Profiling: + ReloadAssembly (1101ms) + BeginReloadAssembly (206ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (63ms) + EndReloadAssembly (776ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (303ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (280ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.0 KB). Loaded Objects now: 5610. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 3.318300 ms (FindLiveObjects: 0.478800 ms CreateObjectMapping: 0.247900 ms MarkObjects: 2.561900 ms DeleteObjects: 0.028000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014712 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.042 seconds +Domain Reload Profiling: + ReloadAssembly (1042ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (768ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (1ms) + SetupTypeCache (300ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (163ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5613. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.860400 ms (FindLiveObjects: 0.363500 ms CreateObjectMapping: 0.221400 ms MarkObjects: 2.254000 ms DeleteObjects: 0.020400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012459 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.954 seconds +Domain Reload Profiling: + ReloadAssembly (955ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (700ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (247ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (286ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.29 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5616. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 3.398500 ms (FindLiveObjects: 0.516700 ms CreateObjectMapping: 0.393300 ms MarkObjects: 2.456300 ms DeleteObjects: 0.031000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013649 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.039 seconds +Domain Reload Profiling: + ReloadAssembly (1039ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (759ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (308ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.27 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5619. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.850000 ms (FindLiveObjects: 0.753900 ms CreateObjectMapping: 0.607000 ms MarkObjects: 2.456400 ms DeleteObjects: 0.029300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013651 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.249 seconds +Domain Reload Profiling: + ReloadAssembly (1249ms) + BeginReloadAssembly (196ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (929ms) + LoadAssemblies (146ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (403ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (301ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (185ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.06 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5622. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.896000 ms (FindLiveObjects: 0.496700 ms CreateObjectMapping: 0.273100 ms MarkObjects: 2.097000 ms DeleteObjects: 0.026600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.024918 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.085 seconds +Domain Reload Profiling: + ReloadAssembly (1085ms) + BeginReloadAssembly (180ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (795ms) + LoadAssemblies (152ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (308ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (191ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5625. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.767100 ms (FindLiveObjects: 0.431600 ms CreateObjectMapping: 0.210300 ms MarkObjects: 2.098200 ms DeleteObjects: 0.025700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009865 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.965 seconds +Domain Reload Profiling: + ReloadAssembly (966ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (696ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (257ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.31 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5628. +Memory consumption went from 165.7 MB to 165.7 MB. +Total: 2.459500 ms (FindLiveObjects: 0.357700 ms CreateObjectMapping: 0.194400 ms MarkObjects: 1.886700 ms DeleteObjects: 0.019800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010020 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.957 seconds +Domain Reload Profiling: + ReloadAssembly (958ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (696ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (266ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (260ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4793 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5631. +Memory consumption went from 165.7 MB to 165.7 MB. +Total: 6.339500 ms (FindLiveObjects: 0.847000 ms CreateObjectMapping: 0.417700 ms MarkObjects: 4.933000 ms DeleteObjects: 0.139100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009507 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.029 seconds +Domain Reload Profiling: + ReloadAssembly (1030ms) + BeginReloadAssembly (179ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (733ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (280ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (270ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Callback registration failed. Increase kMaxCallback. +Fatal Error! Callback registration failed. Increase kMaxCallback. +Crash!!! +SymInit: Symbol-SearchPath: 'D:/Unity/2021.3.27f1c2/Editor/Data/Mono;.;D:\myproject\unity\JNFrame;D:\myproject\unity\JNFrame\Library\BurstCache\JIT;D:\Unity\2021.3.27f1c2\Editor;C:\WINDOWS;C:\WINDOWS\system32;', symOptions: 534, UserName: 'Administrator' +OS-Version: 10.0.0 +D:\Unity\2021.3.27f1c2\Editor\Unity.exe:Unity.exe (00007FF6FF7E0000), size: 81166336 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2021.3.27.15766 +C:\WINDOWS\SYSTEM32\ntdll.dll:ntdll.dll (00007FFEC0890000), size: 2191360 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\KERNEL32.DLL:KERNEL32.DLL (00007FFEBEDF0000), size: 802816 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\KERNELBASE.dll:KERNELBASE.dll (00007FFEBDBD0000), size: 3825664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\user32.dll:user32.dll (00007FFEBE930000), size: 1761280 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\win32u.dll:win32u.dll (00007FFEBE490000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\GDI32.dll:GDI32.dll (00007FFEC07A0000), size: 167936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\gdi32full.dll:gdi32full.dll (00007FFEBE4C0000), size: 1146880 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2861 +C:\WINDOWS\System32\msvcp_win.dll:msvcp_win.dll (00007FFEBE3F0000), size: 630784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\ucrtbase.dll:ucrtbase.dll (00007FFEBE1E0000), size: 1118208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\advapi32.dll:advapi32.dll (00007FFEC0620000), size: 733184 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\msvcrt.dll:msvcrt.dll (00007FFEBE780000), size: 684032 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.22621.2506 +C:\WINDOWS\System32\sechost.dll:sechost.dll (00007FFEBECD0000), size: 688128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\bcrypt.dll:bcrypt.dll (00007FFEBDF80000), size: 163840 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\RPCRT4.dll:RPCRT4.dll (00007FFEBEBA0000), size: 1142784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\shell32.dll:shell32.dll (00007FFEBF730000), size: 8757248 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\setupapi.dll:setupapi.dll (00007FFEC0180000), size: 4669440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\psapi.dll:psapi.dll (00007FFEBFF90000), size: 32768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\iphlpapi.dll:iphlpapi.dll (00007FFEBC730000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\WS2_32.dll:WS2_32.dll (00007FFEBF160000), size: 462848 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\hid.dll:hid.dll (00007FFEBC420000), size: 57344 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\WINTRUST.dll:WINTRUST.dll (00007FFEBE380000), size: 438272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\SYSTEM32\dhcpcsvc6.dll:dhcpcsvc6.dll (00007FFEB81F0000), size: 102400 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\OLEAUT32.dll:OLEAUT32.dll (00007FFEBE5E0000), size: 880640 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\dhcpcsvc.dll:dhcpcsvc.dll (00007FFEB81B0000), size: 126976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\combase.dll:combase.dll (00007FFEBF3A0000), size: 3706880 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wsock32.dll:wsock32.dll (00007FFEB0740000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +D:\Unity\2021.3.27f1c2\Editor\optix.6.0.0.dll:optix.6.0.0.dll (00007FFE9C190000), size: 208896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.0.0.0 +C:\WINDOWS\System32\IMM32.dll:IMM32.dll (00007FFEC0700000), size: 200704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +D:\Unity\2021.3.27f1c2\Editor\s3tcompress.dll:s3tcompress.dll (00007FFE9C220000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\libfbxsdk.dll:libfbxsdk.dll (00007FFE7A140000), size: 10067968 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2020.3.3.0 +C:\WINDOWS\System32\ole32.dll:ole32.dll (00007FFEBEFC0000), size: 1703936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\etccompress.dll:etccompress.dll (00007FFE78CE0000), size: 5066752 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\System32\SHLWAPI.dll:SHLWAPI.dll (00007FFEBED90000), size: 385024 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\ispc_texcomp.dll:ispc_texcomp.dll (00007FFE811A0000), size: 1740800 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\System32\CRYPT32.dll:CRYPT32.dll (00007FFEBDFB0000), size: 1466368 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\compress_bc7e.dll:compress_bc7e.dll (00007FFE7E9B0000), size: 1441792 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\FreeImage.dll:FreeImage.dll (0000000180000000), size: 6582272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.18.0.0 +D:\Unity\2021.3.27f1c2\Editor\OpenImageDenoise.dll:OpenImageDenoise.dll (00007FFE29A30000), size: 48848896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.4.2.0 +D:\Unity\2021.3.27f1c2\Editor\WinPixEventRuntime.dll:WinPixEventRuntime.dll (00007FFEBAE30000), size: 45056 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.0.1812.6001 +D:\Unity\2021.3.27f1c2\Editor\umbraoptimizer64.dll:umbraoptimizer64.dll (00007FFE7E880000), size: 1187840 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\RadeonImageFilters.dll:RadeonImageFilters.dll (00007FFE79E60000), size: 2961408 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.7.0.0 +D:\Unity\2021.3.27f1c2\Editor\SketchUpAPI.dll:SketchUpAPI.dll (00007FFE2CF60000), size: 8990720 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 23.0.0.0 +C:\WINDOWS\SYSTEM32\dwmapi.dll:dwmapi.dll (00007FFEBB570000), size: 176128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\VERSION.dll:VERSION.dll (00007FFEB6E90000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\WINMM.dll:WINMM.dll (00007FFEB3410000), size: 212992 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\WINHTTP.dll:WINHTTP.dll (00007FFEB8410000), size: 1273856 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\GLU32.dll:GLU32.dll (00007FFEB0CB0000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\OPENGL32.dll:OPENGL32.dll (00007FFE8C8E0000), size: 1048576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\MSVCP140.dll:MSVCP140.dll (00007FFE9D770000), size: 581632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +D:\Unity\2021.3.27f1c2\Editor\tbb12.dll:tbb12.dll (00007FFE89030000), size: 434176 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll:VCRUNTIME140.dll (00007FFEAFC70000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +D:\Unity\2021.3.27f1c2\Editor\RadeonML.dll:RadeonML.dll (00007FFEB1F90000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 0.9.11.0 +D:\Unity\2021.3.27f1c2\Editor\SketchUpCommonPreferences.dll:SketchUpCommonPreferences.dll (00007FFE87B30000), size: 499712 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 23.0.0.0 +C:\WINDOWS\SYSTEM32\VCRUNTIME140_1.dll:VCRUNTIME140_1.dll (00007FFEB16B0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +C:\WINDOWS\SYSTEM32\Secur32.dll:Secur32.dll (00007FFEBCAC0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +D:\Unity\2021.3.27f1c2\Editor\tbbmalloc.dll:tbbmalloc.dll (00007FFE8BCF0000), size: 282624 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\dxcore.dll:dxcore.dll (00007FFEBB240000), size: 221184 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\SSPICLI.DLL:SSPICLI.DLL (00007FFEBCF50000), size: 274432 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +D:\Unity\2021.3.27f1c2\Editor\OpenRL.dll:OpenRL.dll (000001E2C82F0000), size: 12779520 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.5.0.2907 +D:\Unity\2021.3.27f1c2\Editor\embree.dll:embree.dll (00007FFE28A40000), size: 16711680 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.14.0.0 +C:\WINDOWS\SYSTEM32\MSVCR100.dll:MSVCR100.dll (0000000073560000), size: 860160 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.40219.325 +C:\WINDOWS\SYSTEM32\MSVCP100.dll:MSVCP100.dll (0000000073640000), size: 622592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.40219.325 +D:\Unity\2021.3.27f1c2\Editor\tbb.dll:tbb.dll (00007FFE86890000), size: 413696 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2017.0.2016.1004 +C:\WINDOWS\SYSTEM32\MSVCP120.dll:MSVCP120.dll (00007FFE861D0000), size: 679936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.40649.5 +C:\WINDOWS\SYSTEM32\MSVCR120.dll:MSVCR120.dll (00007FFE7E790000), size: 978944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.40649.5 +D:\Unity\2021.3.27f1c2\Editor\OpenRL_pthread.dll:OpenRL_pthread.dll (000001E2C8F40000), size: 61440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.9.0.0 +C:\WINDOWS\SYSTEM32\MSASN1.dll:MSASN1.dll (00007FFEBD420000), size: 73728 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\CRYPTSP.dll:CRYPTSP.dll (00007FFEBD3C0000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\rsaenh.dll:rsaenh.dll (00007FFEBCC50000), size: 217088 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\CRYPTBASE.dll:CRYPTBASE.dll (00007FFEBD3E0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\bcryptPrimitives.dll:bcryptPrimitives.dll (00007FFEBE300000), size: 499712 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\MSWSOCK.DLL:MSWSOCK.DLL (00007FFEBD170000), size: 430080 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\cfgmgr32.DLL:cfgmgr32.DLL (00007FFEBD8C0000), size: 319488 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\kernel.appcore.dll:kernel.appcore.dll (00007FFEBCCF0000), size: 98304 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2715 +C:\WINDOWS\system32\uxtheme.dll:uxtheme.dll (00007FFEBB160000), size: 700416 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\shcore.dll:shcore.dll (00007FFEBEEC0000), size: 995328 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2715 +C:\WINDOWS\SYSTEM32\windows.storage.dll:windows.storage.dll (00007FFEBBB20000), size: 9396224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wintypes.dll:wintypes.dll (00007FFEBB9E0000), size: 1302528 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\profapi.dll:profapi.dll (00007FFEBDB00000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\IconCodecService.dll:IconCodecService.dll (00007FFEB0970000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\WindowsCodecs.dll:WindowsCodecs.dll (00007FFEB93F0000), size: 1769472 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\clbcatq.dll:clbcatq.dll (00007FFEBEAF0000), size: 720896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2001.12.10941.16384 +C:\WINDOWS\System32\netprofm.dll:netprofm.dll (00007FFEB9130000), size: 491520 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\npmproxy.dll:npmproxy.dll (00007FFEB7640000), size: 98304 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\NSI.dll:NSI.dll (00007FFEBED80000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\DNSAPI.dll:DNSAPI.dll (00007FFEBC760000), size: 1019904 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\napinsp.dll:napinsp.dll (00007FFE9F0C0000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\system32\pnrpnsp.dll:pnrpnsp.dll (00007FFE9EE10000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\winrnr.dll:winrnr.dll (00007FFE9EDF0000), size: 69632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\system32\wshbth.dll:wshbth.dll (00007FFE9EDD0000), size: 86016 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\nlansp_c.dll:nlansp_c.dll (00007FFE9EDA0000), size: 135168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\fwpuclnt.dll:fwpuclnt.dll (00007FFEB78A0000), size: 536576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\Windows\System32\rasadhlp.dll:rasadhlp.dll (00007FFEAD240000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +D:\Unity\2021.3.27f1c2\Editor\NVUnityPlugin.DLL:NVUnityPlugin.DLL (00007FFE62760000), size: 1536000 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\Data\Tools\astcenc-avx2.dll:astcenc-avx2.dll (00007FFE48000000), size: 561152 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\d3d11.dll:d3d11.dll (00007FFEBA2B0000), size: 2453504 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\dxgi.dll:dxgi.dll (00007FFEBB290000), size: 1015808 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\directxdatabasehelper.dll:directxdatabasehelper.dll (00007FFEB8030000), size: 303104 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\nvldumdx.dll:nvldumdx.dll (00007FFEB43B0000), size: 770048 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 31.0.15.3623 +C:\WINDOWS\SYSTEM32\cryptnet.dll:cryptnet.dll (00007FFEB6E30000), size: 204800 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\drvstore.dll:drvstore.dll (00007FFEB6CD0000), size: 1409024 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\devobj.dll:devobj.dll (00007FFEBD890000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\wldp.dll:wldp.dll (00007FFEBD490000), size: 307200 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\imagehlp.dll:imagehlp.dll (00007FFEC0600000), size: 126976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\nvwgf2umx.dll:nvwgf2umx.dll (00007FFEA6A80000), size: 99463168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 31.0.15.3623 +C:\WINDOWS\system32\nvspcap64.dll:nvspcap64.dll (00007FFE8D340000), size: 2953216 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.27.0.112 +C:\WINDOWS\SYSTEM32\ntmarta.dll:ntmarta.dll (00007FFEBCD10000), size: 212992 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\Display.NvContainer\MessageBus.dll:MessageBus.dll (00007FFEA3BE0000), size: 7565312 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.22.2758.1620 +C:\WINDOWS\system32\wbem\wbemprox.dll:wbemprox.dll (00007FFEB5D40000), size: 65536 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wbemcomn.dll:wbemcomn.dll (00007FFEB5CC0000), size: 524288 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\wbem\wbemsvc.dll:wbemsvc.dll (00007FFEAD250000), size: 81920 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\system32\wbem\fastprox.dll:fastprox.dll (00007FFEAD270000), size: 1015808 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\amsi.dll:amsi.dll (00007FFEACF70000), size: 118784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\USERENV.dll:USERENV.dll (00007FFEBD260000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.23110.3-0\MpOav.dll:MpOav.dll (00007FFEACE50000), size: 507904 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 4.18.23110.3 +D:\Unity\2021.3.27f1c2\Editor\cudart64_90.dll:cudart64_90.dll (00007FFE43670000), size: 397312 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.14.11.9000 +C:\WINDOWS\SYSTEM32\opencl.dll:opencl.dll (00007FFE2DF20000), size: 1490944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.0.3.0 +D:\Unity\2021.3.27f1c2\Editor\radeonrays.dll:radeonrays.dll (00007FFE42630000), size: 557056 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\Data\MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll:mono-2.0-bdwgc.dll (00007FFE253E0000), size: 10682368 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\PROPSYS.dll:PROPSYS.dll (00007FFEB8D80000), size: 1052672 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.22621.2506 +C:\Windows\System32\Windows.System.Launcher.dll:Windows.System.Launcher.dll (00007FFEB69E0000), size: 1265664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\Windows\System32\msvcp110_win.dll:msvcp110_win.dll (00007FFEB9350000), size: 602112 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\windows.staterepositorycore.dll:windows.staterepositorycore.dll (00007FFEB6980000), size: 106496 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.22621.2506_none_270c5ae97388e100\comctl32.dll:comctl32.dll (00007FFEB2400000), size: 2699264 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.10.22621.2506 +C:\Windows\System32\thumbcache.dll:thumbcache.dll (00007FFEA5810000), size: 438272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\policymanager.dll:policymanager.dll (00007FFEB9990000), size: 675840 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\dbghelp.dll:dbghelp.dll (00007FFEB2950000), size: 2306048 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 + +========== OUTPUTTING STACK TRACE ================== + +0x00007FFEBDC3567C (KERNELBASE) RaiseException +0x00007FF7011D8AFB (Unity) EditorMonoConsole::LogToConsoleImplementation +0x00007FF7011D95ED (Unity) EditorMonoConsole::LogToConsoleImplementation +0x00007FF701E68077 (Unity) DebugStringToFilePostprocessedStacktrace +0x00007FF701E677CD (Unity) DebugStringToFile +0x00007FF7016554D5 (Unity) LoadDomainAndUserAssemblies +0x00007FF701655B64 (Unity) LoadUserAssemblies +0x00007FF701B4DFFF (Unity) ::operator() +0x00007FF701B8F9A2 (Unity) asio::detail::completion_handler,asio::io_context::basic_executor_type,0> >::do_complete +0x00007FF701B7B88E (Unity) asio::detail::win_iocp_io_context::do_one +0x00007FF701B7D4F4 (Unity) asio::detail::win_iocp_io_context::run +0x00007FF701B8DD8E (Unity) IOService::Run +0x00007FF701B6049F (Unity) AssetImportWorkerClient::Run +0x00007FF701B28AA3 (Unity) RunAssetImportWorkerClientV2 +0x00007FF701B28B2B (Unity) RunAssetImporterV2 +0x00007FF701358828 (Unity) Application::InitializeProject +0x00007FF7017A5478 (Unity) WinMain +0x00007FF702BA360E (Unity) __scrt_common_main_seh +0x00007FFEBEE0257D (KERNEL32) BaseThreadInitThunk +0x00007FFEC08EAA58 (ntdll) RtlUserThreadStart + +========== END OF STACKTRACE =========== + +A crash has been intercepted by the crash handler. For call stack and other details, see the latest crash report generated in: + * C:/Users/ADMINI~1/AppData/Local/Temp/Unity/Editor/Crashes diff --git a/JNFrame/Logs/AssetImportWorker1.log b/JNFrame/Logs/AssetImportWorker1.log new file mode 100644 index 00000000..0ba51081 --- /dev/null +++ b/JNFrame/Logs/AssetImportWorker1.log @@ -0,0 +1,7301 @@ +Using pre-set license +Built from '2021.3/china_unity/release' branch; Version is '2021.3.27f1c2 (3b3d9646cb47) revision 3882390'; Using compiler version '192829333'; Build Type 'Release' +OS: 'Windows 11 (10.0.22621) 64bit Professional' Language: 'zh' Physical Memory: 32651 MB +BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1 + +COMMAND LINE ARGUMENTS: +D:\Unity\2021.3.27f1c2\Editor\Unity.exe +-adb2 +-batchMode +-noUpm +-name +AssetImportWorker1 +-projectPath +D:/myproject/unity/JNFrame +-logFile +Logs/AssetImportWorker1.log +-srvPort +64124 +Successfully changed project path to: D:/myproject/unity/JNFrame +D:/myproject/unity/JNFrame +[UnityMemory] Configuration Parameters - Can be set up in boot.config + "memorysetup-bucket-allocator-granularity=16" + "memorysetup-bucket-allocator-bucket-count=8" + "memorysetup-bucket-allocator-block-size=33554432" + "memorysetup-bucket-allocator-block-count=8" + "memorysetup-main-allocator-block-size=16777216" + "memorysetup-thread-allocator-block-size=16777216" + "memorysetup-gfx-main-allocator-block-size=16777216" + "memorysetup-gfx-thread-allocator-block-size=16777216" + "memorysetup-cache-allocator-block-size=4194304" + "memorysetup-typetree-allocator-block-size=2097152" + "memorysetup-profiler-bucket-allocator-granularity=16" + "memorysetup-profiler-bucket-allocator-bucket-count=8" + "memorysetup-profiler-bucket-allocator-block-size=33554432" + "memorysetup-profiler-bucket-allocator-block-count=8" + "memorysetup-profiler-allocator-block-size=16777216" + "memorysetup-profiler-editor-allocator-block-size=1048576" + "memorysetup-temp-allocator-size-main=16777216" + "memorysetup-job-temp-allocator-block-size=2097152" + "memorysetup-job-temp-allocator-block-size-background=1048576" + "memorysetup-job-temp-allocator-reduction-small-platforms=262144" + "memorysetup-temp-allocator-size-background-worker=32768" + "memorysetup-temp-allocator-size-job-worker=262144" + "memorysetup-temp-allocator-size-preload-manager=33554432" + "memorysetup-temp-allocator-size-nav-mesh-worker=65536" + "memorysetup-temp-allocator-size-audio-worker=65536" + "memorysetup-temp-allocator-size-cloud-worker=32768" + "memorysetup-temp-allocator-size-gi-baking-worker=262144" + "memorysetup-temp-allocator-size-gfx=262144" +Player connection [17796] Host "[IP] 192.168.0.130 [Port] 0 [Flags] 2 [Guid] 2585707074 [EditorId] 2585707074 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... + +Player connection [17796] Host "[IP] 192.168.0.130 [Port] 0 [Flags] 2 [Guid] 2585707074 [EditorId] 2585707074 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... + +AS: AutoStreaming module initializing. +Refreshing native plugins compatible for Editor in 141.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Initialize engine version: 2021.3.27f1c2 (3b3d9646cb47) +[Subsystems] Discovering subsystems at path D:/Unity/2021.3.27f1c2/Editor/Data/Resources/UnitySubsystems +[Subsystems] Discovering subsystems at path D:/myproject/unity/JNFrame/Assets +GfxDevice: creating device client; threaded=0; jobified=0 +Direct3D: + Version: Direct3D 11.0 [level 11.1] + Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) + Vendor: NVIDIA + VRAM: 5980 MB + Driver: 31.0.15.3623 +Initialize mono +Mono path[0] = 'D:/Unity/2021.3.27f1c2/Editor/Data/Managed' +Mono path[1] = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' +Mono config path = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/etc' +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56724 +Begin MonoManager ReloadAssembly +Registering precompiled unity dll's ... +Register platform support module: D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll +Registered in 0.008268 seconds. +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 138.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.200 seconds +Domain Reload Profiling: + ReloadAssembly (1201ms) + BeginReloadAssembly (119ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (0ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (1ms) + EndReloadAssembly (637ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (170ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (344ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (11ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (138ms) + BeforeProcessingInitializeOnLoad (2ms) + ProcessInitializeOnLoadAttributes (129ms) + ProcessInitializeOnLoadMethodAttributes (63ms) + AfterProcessingInitializeOnLoad (0ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (0ms) +Platform modules already initialized, skipping +Registering precompiled user dll's ... +Registered in 0.017268 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.317 seconds +Domain Reload Profiling: + ReloadAssembly (1318ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (28ms) + EndReloadAssembly (1002ms) + LoadAssemblies (129ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (359ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (63ms) + SetupLoadedEditorAssemblies (423ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (112ms) + ProcessInitializeOnLoadAttributes (268ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +======================================================================== +Worker process is ready to serve import requests +Launched and connected shader compiler UnityShaderCompiler.exe after 0.07 seconds +Refreshing native plugins compatible for Editor in 0.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 30 unused Assets / (46.6 KB). Loaded Objects now: 5260. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.923300 ms (FindLiveObjects: 0.364800 ms CreateObjectMapping: 0.201700 ms MarkObjects: 2.267400 ms DeleteObjects: 0.087400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014040 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.159 seconds +Domain Reload Profiling: + ReloadAssembly (1160ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (919ms) + LoadAssemblies (99ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (411ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (62ms) + SetupLoadedEditorAssemblies (291ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (86ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.30 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5264. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.451300 ms (FindLiveObjects: 0.290500 ms CreateObjectMapping: 0.158400 ms MarkObjects: 1.982500 ms DeleteObjects: 0.018800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009955 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.040 seconds +Domain Reload Profiling: + ReloadAssembly (1040ms) + BeginReloadAssembly (180ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (709ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (245ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5267. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.378500 ms (FindLiveObjects: 0.265500 ms CreateObjectMapping: 0.181400 ms MarkObjects: 1.911900 ms DeleteObjects: 0.018700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013872 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.039 seconds +Domain Reload Profiling: + ReloadAssembly (1039ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (767ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (295ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 7.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5270. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 5.843000 ms (FindLiveObjects: 1.051700 ms CreateObjectMapping: 0.842900 ms MarkObjects: 3.843100 ms DeleteObjects: 0.101000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013239 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.914 seconds +Domain Reload Profiling: + ReloadAssembly (914ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (668ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (242ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (255ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (149ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.1 KB). Loaded Objects now: 5273. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.260900 ms (FindLiveObjects: 0.277700 ms CreateObjectMapping: 0.146500 ms MarkObjects: 1.815900 ms DeleteObjects: 0.020000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015042 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.142 seconds +Domain Reload Profiling: + ReloadAssembly (1143ms) + BeginReloadAssembly (141ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (912ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (362ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (67ms) + SetupLoadedEditorAssemblies (304ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (185ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5276. +Memory consumption went from 164.2 MB to 164.2 MB. +Total: 2.661000 ms (FindLiveObjects: 0.295700 ms CreateObjectMapping: 0.148900 ms MarkObjects: 2.198600 ms DeleteObjects: 0.016900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014543 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.871 seconds +Domain Reload Profiling: + ReloadAssembly (871ms) + BeginReloadAssembly (140ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (33ms) + EndReloadAssembly (643ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (225ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (258ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (153ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5279. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.475600 ms (FindLiveObjects: 0.295600 ms CreateObjectMapping: 0.165200 ms MarkObjects: 1.969400 ms DeleteObjects: 0.044400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011985 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.036 seconds +Domain Reload Profiling: + ReloadAssembly (1037ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (765ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (319ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (241ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (147ms) + ProcessInitializeOnLoadMethodAttributes (19ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.37 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5282. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 3.457300 ms (FindLiveObjects: 0.295800 ms CreateObjectMapping: 0.157900 ms MarkObjects: 2.973300 ms DeleteObjects: 0.028900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016611 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.002 seconds +Domain Reload Profiling: + ReloadAssembly (1002ms) + BeginReloadAssembly (140ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (32ms) + EndReloadAssembly (748ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (300ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (243ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (140ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5285. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.792900 ms (FindLiveObjects: 0.384700 ms CreateObjectMapping: 0.250600 ms MarkObjects: 2.135200 ms DeleteObjects: 0.021200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014968 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.962 seconds +Domain Reload Profiling: + ReloadAssembly (962ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (705ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (262ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (262ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.39 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5288. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.625200 ms (FindLiveObjects: 0.365800 ms CreateObjectMapping: 0.216200 ms MarkObjects: 1.993000 ms DeleteObjects: 0.048400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010289 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.006 seconds +Domain Reload Profiling: + ReloadAssembly (1007ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (749ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (286ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (245ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (150ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5291. +Memory consumption went from 164.3 MB to 164.2 MB. +Total: 2.464200 ms (FindLiveObjects: 0.324400 ms CreateObjectMapping: 0.156900 ms MarkObjects: 1.949800 ms DeleteObjects: 0.031900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012305 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.028 seconds +Domain Reload Profiling: + ReloadAssembly (1029ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (775ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (337ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (254ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (150ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5294. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 2.644700 ms (FindLiveObjects: 0.375300 ms CreateObjectMapping: 0.192300 ms MarkObjects: 2.032800 ms DeleteObjects: 0.041900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009890 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.967 seconds +Domain Reload Profiling: + ReloadAssembly (968ms) + BeginReloadAssembly (145ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (734ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (299ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (254ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (144ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.07 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5297. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.390500 ms (FindLiveObjects: 0.314400 ms CreateObjectMapping: 0.144900 ms MarkObjects: 1.909300 ms DeleteObjects: 0.020700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009115 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.06 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.966 seconds +Domain Reload Profiling: + ReloadAssembly (966ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (706ms) + LoadAssemblies (97ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (235ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.22 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5300. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.596100 ms (FindLiveObjects: 0.386300 ms CreateObjectMapping: 0.198700 ms MarkObjects: 1.982100 ms DeleteObjects: 0.027700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012967 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.988 seconds +Domain Reload Profiling: + ReloadAssembly (989ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (732ms) + LoadAssemblies (100ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (254ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5303. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.467100 ms (FindLiveObjects: 0.305500 ms CreateObjectMapping: 0.238300 ms MarkObjects: 1.897100 ms DeleteObjects: 0.024800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010176 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.022 seconds +Domain Reload Profiling: + ReloadAssembly (1022ms) + BeginReloadAssembly (183ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (732ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (263ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5306. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 2.770900 ms (FindLiveObjects: 0.424600 ms CreateObjectMapping: 0.176400 ms MarkObjects: 2.059300 ms DeleteObjects: 0.109400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012302 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.984 seconds +Domain Reload Profiling: + ReloadAssembly (985ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (714ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (263ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5309. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.972600 ms (FindLiveObjects: 0.291300 ms CreateObjectMapping: 0.146800 ms MarkObjects: 2.511900 ms DeleteObjects: 0.021400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014640 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.018 seconds +Domain Reload Profiling: + ReloadAssembly (1018ms) + BeginReloadAssembly (139ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (33ms) + EndReloadAssembly (776ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (284ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5312. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 3.098200 ms (FindLiveObjects: 0.345900 ms CreateObjectMapping: 0.183100 ms MarkObjects: 2.529100 ms DeleteObjects: 0.038400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013135 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.019 seconds +Domain Reload Profiling: + ReloadAssembly (1019ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (775ms) + LoadAssemblies (103ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (298ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5315. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.688900 ms (FindLiveObjects: 0.282000 ms CreateObjectMapping: 0.150800 ms MarkObjects: 2.225100 ms DeleteObjects: 0.030100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010679 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.960 seconds +Domain Reload Profiling: + ReloadAssembly (961ms) + BeginReloadAssembly (142ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (722ms) + LoadAssemblies (99ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5318. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.844400 ms (FindLiveObjects: 0.445000 ms CreateObjectMapping: 0.253900 ms MarkObjects: 2.117000 ms DeleteObjects: 0.027400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010696 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.027 seconds +Domain Reload Profiling: + ReloadAssembly (1028ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (63ms) + EndReloadAssembly (759ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (272ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (186ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5321. +Memory consumption went from 164.4 MB to 164.3 MB. +Total: 2.469300 ms (FindLiveObjects: 0.331800 ms CreateObjectMapping: 0.154800 ms MarkObjects: 1.955100 ms DeleteObjects: 0.026400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011332 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.981 seconds +Domain Reload Profiling: + ReloadAssembly (981ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (707ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (266ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (257ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5324. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 3.156200 ms (FindLiveObjects: 0.502100 ms CreateObjectMapping: 0.219200 ms MarkObjects: 2.395800 ms DeleteObjects: 0.037700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009836 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.968 seconds +Domain Reload Profiling: + ReloadAssembly (968ms) + BeginReloadAssembly (185ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (65ms) + EndReloadAssembly (687ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (248ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (263ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (20ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5327. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 4.014000 ms (FindLiveObjects: 0.352200 ms CreateObjectMapping: 0.289500 ms MarkObjects: 3.330800 ms DeleteObjects: 0.039700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009381 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.984 seconds +Domain Reload Profiling: + ReloadAssembly (985ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (724ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (243ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (284ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5330. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 3.220700 ms (FindLiveObjects: 0.427800 ms CreateObjectMapping: 0.167700 ms MarkObjects: 2.570700 ms DeleteObjects: 0.051500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010830 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.024 seconds +Domain Reload Profiling: + ReloadAssembly (1025ms) + BeginReloadAssembly (175ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (746ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (259ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5333. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.141900 ms (FindLiveObjects: 0.420200 ms CreateObjectMapping: 0.303000 ms MarkObjects: 2.377500 ms DeleteObjects: 0.039800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012696 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.949 seconds +Domain Reload Profiling: + ReloadAssembly (949ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (704ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (249ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5336. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 3.638300 ms (FindLiveObjects: 0.602500 ms CreateObjectMapping: 0.250500 ms MarkObjects: 2.748400 ms DeleteObjects: 0.034500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012750 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.19 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.002 seconds +Domain Reload Profiling: + ReloadAssembly (1003ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (733ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (260ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.24 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5339. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.972200 ms (FindLiveObjects: 0.352800 ms CreateObjectMapping: 0.224400 ms MarkObjects: 2.284600 ms DeleteObjects: 0.108600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017426 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.891 seconds +Domain Reload Profiling: + ReloadAssembly (892ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (646ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (224ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (249ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (146ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5342. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.997600 ms (FindLiveObjects: 0.393500 ms CreateObjectMapping: 0.197300 ms MarkObjects: 2.369500 ms DeleteObjects: 0.036100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010456 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.904 seconds +Domain Reload Profiling: + ReloadAssembly (904ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (657ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (247ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (29ms) + SetupLoadedEditorAssemblies (253ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5345. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.369500 ms (FindLiveObjects: 0.625300 ms CreateObjectMapping: 0.389600 ms MarkObjects: 2.324900 ms DeleteObjects: 0.027300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011647 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.026 seconds +Domain Reload Profiling: + ReloadAssembly (1027ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (744ms) + LoadAssemblies (119ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (262ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (294ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5348. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.010600 ms (FindLiveObjects: 0.582700 ms CreateObjectMapping: 0.301200 ms MarkObjects: 2.098500 ms DeleteObjects: 0.026500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011994 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.001 seconds +Domain Reload Profiling: + ReloadAssembly (1002ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (757ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (267ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (307ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (190ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5351. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.528700 ms (FindLiveObjects: 0.378400 ms CreateObjectMapping: 0.167400 ms MarkObjects: 1.952300 ms DeleteObjects: 0.029000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013109 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.146 seconds +Domain Reload Profiling: + ReloadAssembly (1147ms) + BeginReloadAssembly (194ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (838ms) + LoadAssemblies (144ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (336ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5354. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.941800 ms (FindLiveObjects: 0.500100 ms CreateObjectMapping: 0.208600 ms MarkObjects: 2.194900 ms DeleteObjects: 0.036500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012580 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.970 seconds +Domain Reload Profiling: + ReloadAssembly (971ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (712ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5357. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.747100 ms (FindLiveObjects: 0.419700 ms CreateObjectMapping: 0.230400 ms MarkObjects: 2.076100 ms DeleteObjects: 0.020000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012045 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.008 seconds +Domain Reload Profiling: + ReloadAssembly (1009ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (765ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (283ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5360. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.693100 ms (FindLiveObjects: 0.351100 ms CreateObjectMapping: 0.199100 ms MarkObjects: 2.112300 ms DeleteObjects: 0.029400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012512 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.956 seconds +Domain Reload Profiling: + ReloadAssembly (957ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (699ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (286ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (234ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (53ms) + ProcessInitializeOnLoadAttributes (143ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5363. +Memory consumption went from 164.7 MB to 164.6 MB. +Total: 2.885700 ms (FindLiveObjects: 0.306200 ms CreateObjectMapping: 0.159100 ms MarkObjects: 2.385900 ms DeleteObjects: 0.032900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009765 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.030 seconds +Domain Reload Profiling: + ReloadAssembly (1031ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (779ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (256ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (325ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (203ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.50 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5366. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.977200 ms (FindLiveObjects: 0.355300 ms CreateObjectMapping: 0.405300 ms MarkObjects: 2.182700 ms DeleteObjects: 0.032200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010175 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.115 seconds +Domain Reload Profiling: + ReloadAssembly (1116ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (828ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (271ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (57ms) + SetupLoadedEditorAssemblies (309ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (14ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.48 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5369. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.395000 ms (FindLiveObjects: 0.336000 ms CreateObjectMapping: 0.183800 ms MarkObjects: 1.855700 ms DeleteObjects: 0.018700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010794 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.976 seconds +Domain Reload Profiling: + ReloadAssembly (977ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (713ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (256ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (156ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5372. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 4.387800 ms (FindLiveObjects: 0.438200 ms CreateObjectMapping: 0.208300 ms MarkObjects: 3.581100 ms DeleteObjects: 0.155300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011908 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.942 seconds +Domain Reload Profiling: + ReloadAssembly (942ms) + BeginReloadAssembly (141ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (703ms) + LoadAssemblies (96ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (244ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (278ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5375. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.495300 ms (FindLiveObjects: 0.354000 ms CreateObjectMapping: 0.141700 ms MarkObjects: 1.970300 ms DeleteObjects: 0.028500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012216 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.949 seconds +Domain Reload Profiling: + ReloadAssembly (949ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (710ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (229ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5378. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.363900 ms (FindLiveObjects: 0.331800 ms CreateObjectMapping: 0.171800 ms MarkObjects: 1.840500 ms DeleteObjects: 0.018800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013358 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.958 seconds +Domain Reload Profiling: + ReloadAssembly (958ms) + BeginReloadAssembly (142ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (722ms) + LoadAssemblies (98ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (259ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (163ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5381. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.817800 ms (FindLiveObjects: 0.537300 ms CreateObjectMapping: 0.296900 ms MarkObjects: 2.893200 ms DeleteObjects: 0.087000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011539 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.992 seconds +Domain Reload Profiling: + ReloadAssembly (993ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (735ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (256ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.22 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5384. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 3.608800 ms (FindLiveObjects: 0.625800 ms CreateObjectMapping: 0.191800 ms MarkObjects: 2.755400 ms DeleteObjects: 0.033700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011853 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.993 seconds +Domain Reload Profiling: + ReloadAssembly (993ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (718ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (254ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.97 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5387. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.728400 ms (FindLiveObjects: 0.681800 ms CreateObjectMapping: 0.258900 ms MarkObjects: 2.707300 ms DeleteObjects: 0.076800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011057 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.945 seconds +Domain Reload Profiling: + ReloadAssembly (945ms) + BeginReloadAssembly (143ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (706ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (244ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (29ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (21ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5390. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.001000 ms (FindLiveObjects: 0.373400 ms CreateObjectMapping: 0.195700 ms MarkObjects: 2.392100 ms DeleteObjects: 0.038600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011550 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.984 seconds +Domain Reload Profiling: + ReloadAssembly (985ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (733ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (249ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5393. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.100700 ms (FindLiveObjects: 0.398700 ms CreateObjectMapping: 0.224800 ms MarkObjects: 2.447300 ms DeleteObjects: 0.028400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010620 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.235 seconds +Domain Reload Profiling: + ReloadAssembly (1236ms) + BeginReloadAssembly (193ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (945ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (381ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (80ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5396. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.620200 ms (FindLiveObjects: 0.316500 ms CreateObjectMapping: 0.158200 ms MarkObjects: 2.119500 ms DeleteObjects: 0.025200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012752 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.983 seconds +Domain Reload Profiling: + ReloadAssembly (984ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (734ms) + LoadAssemblies (115ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (249ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5399. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 3.657300 ms (FindLiveObjects: 0.590100 ms CreateObjectMapping: 0.229800 ms MarkObjects: 2.768300 ms DeleteObjects: 0.064800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017097 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.925 seconds +Domain Reload Profiling: + ReloadAssembly (925ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (681ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (248ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (146ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5402. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 3.835100 ms (FindLiveObjects: 0.423200 ms CreateObjectMapping: 0.154900 ms MarkObjects: 3.222500 ms DeleteObjects: 0.032300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013373 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.898 seconds +Domain Reload Profiling: + ReloadAssembly (898ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (659ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (234ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (258ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (153ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5405. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 3.277800 ms (FindLiveObjects: 0.703100 ms CreateObjectMapping: 0.260600 ms MarkObjects: 2.291400 ms DeleteObjects: 0.021300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013149 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.016 seconds +Domain Reload Profiling: + ReloadAssembly (1017ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (746ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (251ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (36ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5408. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 3.251200 ms (FindLiveObjects: 0.666300 ms CreateObjectMapping: 0.223900 ms MarkObjects: 2.337300 ms DeleteObjects: 0.022900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009684 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.105 seconds +Domain Reload Profiling: + ReloadAssembly (1106ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (826ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (251ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (59ms) + SetupLoadedEditorAssemblies (334ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (203ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.05 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5411. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.631900 ms (FindLiveObjects: 0.320700 ms CreateObjectMapping: 0.215800 ms MarkObjects: 2.068300 ms DeleteObjects: 0.025600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012383 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.014 seconds +Domain Reload Profiling: + ReloadAssembly (1014ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (744ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (241ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5414. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.786100 ms (FindLiveObjects: 0.807300 ms CreateObjectMapping: 0.312400 ms MarkObjects: 2.611500 ms DeleteObjects: 0.051900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010002 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.004 seconds +Domain Reload Profiling: + ReloadAssembly (1005ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (748ms) + LoadAssemblies (97ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (257ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (314ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (194ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5417. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 3.460700 ms (FindLiveObjects: 0.823600 ms CreateObjectMapping: 0.244300 ms MarkObjects: 2.347100 ms DeleteObjects: 0.042900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014135 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.026 seconds +Domain Reload Profiling: + ReloadAssembly (1027ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (786ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (302ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (163ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5420. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.572000 ms (FindLiveObjects: 0.461700 ms CreateObjectMapping: 0.199200 ms MarkObjects: 1.881600 ms DeleteObjects: 0.026900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.029548 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.166 seconds +Domain Reload Profiling: + ReloadAssembly (1167ms) + BeginReloadAssembly (192ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (850ms) + LoadAssemblies (149ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (296ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (53ms) + SetupLoadedEditorAssemblies (312ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (77ms) + ProcessInitializeOnLoadAttributes (185ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5423. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 3.476200 ms (FindLiveObjects: 0.359900 ms CreateObjectMapping: 0.197700 ms MarkObjects: 2.874700 ms DeleteObjects: 0.042400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011765 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.26 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.963 seconds +Domain Reload Profiling: + ReloadAssembly (964ms) + BeginReloadAssembly (139ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (29ms) + EndReloadAssembly (730ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (243ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (308ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.05 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5426. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.405200 ms (FindLiveObjects: 0.352300 ms CreateObjectMapping: 0.174000 ms MarkObjects: 1.857200 ms DeleteObjects: 0.020200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013694 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.90 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.978 seconds +Domain Reload Profiling: + ReloadAssembly (979ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (735ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (252ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.26 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5429. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.127900 ms (FindLiveObjects: 0.492600 ms CreateObjectMapping: 0.339300 ms MarkObjects: 2.266700 ms DeleteObjects: 0.028400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012141 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.989 seconds +Domain Reload Profiling: + ReloadAssembly (990ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (32ms) + EndReloadAssembly (731ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (274ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5432. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.505600 ms (FindLiveObjects: 0.320500 ms CreateObjectMapping: 0.165900 ms MarkObjects: 1.991200 ms DeleteObjects: 0.026500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013587 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.956 seconds +Domain Reload Profiling: + ReloadAssembly (956ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (702ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (264ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.44 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5435. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.655100 ms (FindLiveObjects: 0.308300 ms CreateObjectMapping: 0.158800 ms MarkObjects: 2.164700 ms DeleteObjects: 0.022300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014593 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.111 seconds +Domain Reload Profiling: + ReloadAssembly (1111ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (839ms) + LoadAssemblies (129ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (348ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (63ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (163ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5438. +Memory consumption went from 164.9 MB to 164.8 MB. +Total: 3.371300 ms (FindLiveObjects: 0.764300 ms CreateObjectMapping: 0.196700 ms MarkObjects: 2.389200 ms DeleteObjects: 0.020200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012110 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.956 seconds +Domain Reload Profiling: + ReloadAssembly (956ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (711ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (235ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5441. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 2.515000 ms (FindLiveObjects: 0.338600 ms CreateObjectMapping: 0.163100 ms MarkObjects: 1.984900 ms DeleteObjects: 0.027500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012918 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.981 seconds +Domain Reload Profiling: + ReloadAssembly (982ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (735ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (303ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (256ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5444. +Memory consumption went from 164.9 MB to 164.8 MB. +Total: 2.222400 ms (FindLiveObjects: 0.331900 ms CreateObjectMapping: 0.163800 ms MarkObjects: 1.707800 ms DeleteObjects: 0.018000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012725 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.038 seconds +Domain Reload Profiling: + ReloadAssembly (1039ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (755ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (315ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (255ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (151ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.24 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4795 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5447. +Memory consumption went from 165.1 MB to 165.0 MB. +Total: 2.905600 ms (FindLiveObjects: 0.430500 ms CreateObjectMapping: 0.368000 ms MarkObjects: 2.079800 ms DeleteObjects: 0.026200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010675 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.085 seconds +Domain Reload Profiling: + ReloadAssembly (1086ms) + BeginReloadAssembly (185ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (768ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (312ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (265ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (163ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5451. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 3.202200 ms (FindLiveObjects: 0.676800 ms CreateObjectMapping: 0.279000 ms MarkObjects: 2.225200 ms DeleteObjects: 0.018400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010628 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.230 seconds +Domain Reload Profiling: + ReloadAssembly (1231ms) + BeginReloadAssembly (239ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (75ms) + EndReloadAssembly (868ms) + LoadAssemblies (162ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (302ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (332ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (187ms) + ProcessInitializeOnLoadMethodAttributes (43ms) + AfterProcessingInitializeOnLoad (29ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (16ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.27 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5454. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.535800 ms (FindLiveObjects: 0.334700 ms CreateObjectMapping: 0.183700 ms MarkObjects: 1.998700 ms DeleteObjects: 0.017500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012272 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.29 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.238 seconds +Domain Reload Profiling: + ReloadAssembly (1239ms) + BeginReloadAssembly (213ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (62ms) + EndReloadAssembly (905ms) + LoadAssemblies (141ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (434ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (263ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5457. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 3.143100 ms (FindLiveObjects: 0.366800 ms CreateObjectMapping: 0.203600 ms MarkObjects: 2.529000 ms DeleteObjects: 0.041900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015847 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.342 seconds +Domain Reload Profiling: + ReloadAssembly (1343ms) + BeginReloadAssembly (191ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (1047ms) + LoadAssemblies (149ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (527ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (54ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5460. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.700900 ms (FindLiveObjects: 0.446300 ms CreateObjectMapping: 0.222400 ms MarkObjects: 2.009100 ms DeleteObjects: 0.022000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009784 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.228 seconds +Domain Reload Profiling: + ReloadAssembly (1229ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (945ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (462ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5463. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 135.191500 ms (FindLiveObjects: 126.519600 ms CreateObjectMapping: 2.029600 ms MarkObjects: 6.502400 ms DeleteObjects: 0.134600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009691 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.138 seconds +Domain Reload Profiling: + ReloadAssembly (1139ms) + BeginReloadAssembly (199ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (818ms) + LoadAssemblies (147ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (331ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (270ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5466. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 3.035800 ms (FindLiveObjects: 0.370500 ms CreateObjectMapping: 0.187700 ms MarkObjects: 2.453100 ms DeleteObjects: 0.023700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012269 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.095 seconds +Domain Reload Profiling: + ReloadAssembly (1096ms) + BeginReloadAssembly (186ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (794ms) + LoadAssemblies (130ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (345ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (260ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (54ms) + ProcessInitializeOnLoadAttributes (154ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5469. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 2.769500 ms (FindLiveObjects: 0.552300 ms CreateObjectMapping: 0.229700 ms MarkObjects: 1.962400 ms DeleteObjects: 0.023700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011279 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.246 seconds +Domain Reload Profiling: + ReloadAssembly (1247ms) + BeginReloadAssembly (236ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (67ms) + EndReloadAssembly (900ms) + LoadAssemblies (155ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (373ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (324ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (193ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (27ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5472. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 2.496300 ms (FindLiveObjects: 0.360300 ms CreateObjectMapping: 0.164700 ms MarkObjects: 1.951500 ms DeleteObjects: 0.018800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012247 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.155 seconds +Domain Reload Profiling: + ReloadAssembly (1156ms) + BeginReloadAssembly (207ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (800ms) + LoadAssemblies (173ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (320ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5475. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 2.383400 ms (FindLiveObjects: 0.352000 ms CreateObjectMapping: 0.175400 ms MarkObjects: 1.833300 ms DeleteObjects: 0.021600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009535 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.037 seconds +Domain Reload Profiling: + ReloadAssembly (1038ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (756ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (310ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (146ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (22ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5478. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.995700 ms (FindLiveObjects: 0.334800 ms CreateObjectMapping: 0.216800 ms MarkObjects: 2.419500 ms DeleteObjects: 0.023000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016022 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.035 seconds +Domain Reload Profiling: + ReloadAssembly (1036ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (758ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (278ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5481. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 4.508900 ms (FindLiveObjects: 1.281000 ms CreateObjectMapping: 0.815200 ms MarkObjects: 2.373600 ms DeleteObjects: 0.035800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014451 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.957 seconds +Domain Reload Profiling: + ReloadAssembly (957ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (693ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (249ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5484. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.562500 ms (FindLiveObjects: 0.805800 ms CreateObjectMapping: 0.411400 ms MarkObjects: 2.320400 ms DeleteObjects: 0.023600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017490 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.984 seconds +Domain Reload Profiling: + ReloadAssembly (984ms) + BeginReloadAssembly (148ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (723ms) + LoadAssemblies (104ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (258ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (180ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5487. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.735700 ms (FindLiveObjects: 0.478700 ms CreateObjectMapping: 0.203200 ms MarkObjects: 2.033100 ms DeleteObjects: 0.019200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012358 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.009 seconds +Domain Reload Profiling: + ReloadAssembly (1010ms) + BeginReloadAssembly (147ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (754ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (302ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (264ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5490. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 2.956000 ms (FindLiveObjects: 0.509500 ms CreateObjectMapping: 0.211700 ms MarkObjects: 2.206600 ms DeleteObjects: 0.026500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010489 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.05 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.036 seconds +Domain Reload Profiling: + ReloadAssembly (1038ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (771ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (299ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5493. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.724800 ms (FindLiveObjects: 0.328500 ms CreateObjectMapping: 0.202700 ms MarkObjects: 2.174900 ms DeleteObjects: 0.017400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009519 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.989 seconds +Domain Reload Profiling: + ReloadAssembly (990ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (746ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (311ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (255ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5496. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 3.182400 ms (FindLiveObjects: 0.429000 ms CreateObjectMapping: 0.277100 ms MarkObjects: 2.448400 ms DeleteObjects: 0.026900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015953 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.059 seconds +Domain Reload Profiling: + ReloadAssembly (1060ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (796ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (312ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5499. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.758600 ms (FindLiveObjects: 0.325300 ms CreateObjectMapping: 0.199100 ms MarkObjects: 2.211100 ms DeleteObjects: 0.021900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012607 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.051 seconds +Domain Reload Profiling: + ReloadAssembly (1053ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (776ms) + LoadAssemblies (119ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5502. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 4.770100 ms (FindLiveObjects: 0.675000 ms CreateObjectMapping: 0.280200 ms MarkObjects: 3.770300 ms DeleteObjects: 0.042800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013247 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.138 seconds +Domain Reload Profiling: + ReloadAssembly (1139ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (881ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (325ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (18ms) + SetLoadedEditorAssemblies (2ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (84ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5505. +Memory consumption went from 165.1 MB to 165.0 MB. +Total: 2.463300 ms (FindLiveObjects: 0.340000 ms CreateObjectMapping: 0.192300 ms MarkObjects: 1.900200 ms DeleteObjects: 0.029900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014797 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.997 seconds +Domain Reload Profiling: + ReloadAssembly (997ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (742ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (247ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (53ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 7.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5508. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 4.448700 ms (FindLiveObjects: 0.587000 ms CreateObjectMapping: 0.370200 ms MarkObjects: 3.416500 ms DeleteObjects: 0.071500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016262 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.114 seconds +Domain Reload Profiling: + ReloadAssembly (1114ms) + BeginReloadAssembly (183ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (810ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (314ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (300ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5511. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.873200 ms (FindLiveObjects: 0.517900 ms CreateObjectMapping: 0.249900 ms MarkObjects: 2.082300 ms DeleteObjects: 0.022300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009232 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.950 seconds +Domain Reload Profiling: + ReloadAssembly (950ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (701ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (262ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (262ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5514. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.483400 ms (FindLiveObjects: 0.343700 ms CreateObjectMapping: 0.174400 ms MarkObjects: 1.948200 ms DeleteObjects: 0.016300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014093 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.945 seconds +Domain Reload Profiling: + ReloadAssembly (946ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (683ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (249ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (258ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5517. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.412500 ms (FindLiveObjects: 0.345200 ms CreateObjectMapping: 0.182400 ms MarkObjects: 1.866200 ms DeleteObjects: 0.017800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015752 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.059 seconds +Domain Reload Profiling: + ReloadAssembly (1060ms) + BeginReloadAssembly (216ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (77ms) + EndReloadAssembly (733ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (283ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5520. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.763300 ms (FindLiveObjects: 0.358600 ms CreateObjectMapping: 0.193200 ms MarkObjects: 2.166500 ms DeleteObjects: 0.043400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011357 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.986 seconds +Domain Reload Profiling: + ReloadAssembly (986ms) + BeginReloadAssembly (185ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (691ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (276ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (255ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5523. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.674700 ms (FindLiveObjects: 0.463000 ms CreateObjectMapping: 0.576500 ms MarkObjects: 2.599200 ms DeleteObjects: 0.034600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014456 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.268 seconds +Domain Reload Profiling: + ReloadAssembly (1268ms) + BeginReloadAssembly (173ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (960ms) + LoadAssemblies (151ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (364ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (55ms) + SetupLoadedEditorAssemblies (346ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (191ms) + ProcessInitializeOnLoadMethodAttributes (54ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5526. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.805500 ms (FindLiveObjects: 0.425700 ms CreateObjectMapping: 0.328800 ms MarkObjects: 2.026100 ms DeleteObjects: 0.023200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016303 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.048 seconds +Domain Reload Profiling: + ReloadAssembly (1049ms) + BeginReloadAssembly (200ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (715ms) + LoadAssemblies (154ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (271ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4796 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5529. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 6.617600 ms (FindLiveObjects: 0.838500 ms CreateObjectMapping: 0.644400 ms MarkObjects: 5.079200 ms DeleteObjects: 0.053200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009618 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.976 seconds +Domain Reload Profiling: + ReloadAssembly (976ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (733ms) + LoadAssemblies (103ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (274ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (20ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5533. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.840400 ms (FindLiveObjects: 0.377900 ms CreateObjectMapping: 0.186700 ms MarkObjects: 2.243400 ms DeleteObjects: 0.031200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011364 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.118 seconds +Domain Reload Profiling: + ReloadAssembly (1119ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (882ms) + LoadAssemblies (103ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (303ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (64ms) + SetupLoadedEditorAssemblies (343ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (83ms) + ProcessInitializeOnLoadAttributes (208ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5536. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 5.787600 ms (FindLiveObjects: 0.863500 ms CreateObjectMapping: 0.618000 ms MarkObjects: 4.261600 ms DeleteObjects: 0.042600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010776 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.097 seconds +Domain Reload Profiling: + ReloadAssembly (1098ms) + BeginReloadAssembly (196ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (55ms) + EndReloadAssembly (777ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (322ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5539. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.220200 ms (FindLiveObjects: 0.345800 ms CreateObjectMapping: 0.184600 ms MarkObjects: 2.460300 ms DeleteObjects: 0.224800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014162 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.984 seconds +Domain Reload Profiling: + ReloadAssembly (985ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (727ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (280ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (278ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5542. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 3.423000 ms (FindLiveObjects: 0.715700 ms CreateObjectMapping: 0.252700 ms MarkObjects: 2.425900 ms DeleteObjects: 0.027700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011826 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.945 seconds +Domain Reload Profiling: + ReloadAssembly (946ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (684ms) + LoadAssemblies (100ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (261ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (258ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (156ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.30 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5545. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 2.758300 ms (FindLiveObjects: 0.355200 ms CreateObjectMapping: 0.179200 ms MarkObjects: 2.179100 ms DeleteObjects: 0.043500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017307 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.114 seconds +Domain Reload Profiling: + ReloadAssembly (1115ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (33ms) + EndReloadAssembly (859ms) + LoadAssemblies (133ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (316ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (325ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (214ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5548. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 2.836200 ms (FindLiveObjects: 0.320700 ms CreateObjectMapping: 0.172300 ms MarkObjects: 2.247600 ms DeleteObjects: 0.094400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012016 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.054 seconds +Domain Reload Profiling: + ReloadAssembly (1055ms) + BeginReloadAssembly (178ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (763ms) + LoadAssemblies (129ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.21 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5551. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.721100 ms (FindLiveObjects: 0.436100 ms CreateObjectMapping: 0.225800 ms MarkObjects: 2.032700 ms DeleteObjects: 0.024900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011230 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.039 seconds +Domain Reload Profiling: + ReloadAssembly (1039ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (772ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (307ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5554. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.854800 ms (FindLiveObjects: 0.424400 ms CreateObjectMapping: 0.247700 ms MarkObjects: 2.147100 ms DeleteObjects: 0.034100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016770 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.044 seconds +Domain Reload Profiling: + ReloadAssembly (1045ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (1ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (758ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (304ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5557. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.647600 ms (FindLiveObjects: 0.370300 ms CreateObjectMapping: 0.178400 ms MarkObjects: 2.072500 ms DeleteObjects: 0.025300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011894 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.946 seconds +Domain Reload Profiling: + ReloadAssembly (947ms) + BeginReloadAssembly (145ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (702ms) + LoadAssemblies (99ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (229ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (308ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (189ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5560. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.772000 ms (FindLiveObjects: 0.398800 ms CreateObjectMapping: 0.186200 ms MarkObjects: 2.164000 ms DeleteObjects: 0.021900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009458 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.079 seconds +Domain Reload Profiling: + ReloadAssembly (1079ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (818ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (311ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (68ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (2ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5563. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.437800 ms (FindLiveObjects: 0.326200 ms CreateObjectMapping: 0.162700 ms MarkObjects: 1.919500 ms DeleteObjects: 0.028600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010344 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.086 seconds +Domain Reload Profiling: + ReloadAssembly (1086ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (804ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (328ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (294ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.29 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5566. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.744000 ms (FindLiveObjects: 0.487800 ms CreateObjectMapping: 0.190200 ms MarkObjects: 2.032300 ms DeleteObjects: 0.032200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013479 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.964 seconds +Domain Reload Profiling: + ReloadAssembly (965ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (701ms) + LoadAssemblies (115ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (258ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (150ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5569. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.400100 ms (FindLiveObjects: 0.337600 ms CreateObjectMapping: 0.177000 ms MarkObjects: 1.867500 ms DeleteObjects: 0.016800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011637 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.031 seconds +Domain Reload Profiling: + ReloadAssembly (1031ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (762ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (310ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (256ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (154ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5572. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.519900 ms (FindLiveObjects: 0.360100 ms CreateObjectMapping: 0.188500 ms MarkObjects: 1.952200 ms DeleteObjects: 0.018100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012371 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.964 seconds +Domain Reload Profiling: + ReloadAssembly (964ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (697ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (243ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5575. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.847200 ms (FindLiveObjects: 0.356600 ms CreateObjectMapping: 0.177800 ms MarkObjects: 2.291800 ms DeleteObjects: 0.019400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011799 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.045 seconds +Domain Reload Profiling: + ReloadAssembly (1046ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (784ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (328ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (207ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5578. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 4.567200 ms (FindLiveObjects: 0.504400 ms CreateObjectMapping: 0.243900 ms MarkObjects: 3.775500 ms DeleteObjects: 0.041200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014472 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.992 seconds +Domain Reload Profiling: + ReloadAssembly (992ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (711ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (269ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (255ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5581. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.622300 ms (FindLiveObjects: 0.351900 ms CreateObjectMapping: 0.181100 ms MarkObjects: 2.060200 ms DeleteObjects: 0.027600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012474 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.018 seconds +Domain Reload Profiling: + ReloadAssembly (1019ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (740ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (302ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (254ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (153ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5584. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 4.026200 ms (FindLiveObjects: 0.748100 ms CreateObjectMapping: 0.615900 ms MarkObjects: 2.616600 ms DeleteObjects: 0.043900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011781 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.123 seconds +Domain Reload Profiling: + ReloadAssembly (1124ms) + BeginReloadAssembly (219ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (788ms) + LoadAssemblies (153ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (300ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.1 KB). Loaded Objects now: 5587. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.539600 ms (FindLiveObjects: 0.336200 ms CreateObjectMapping: 0.176300 ms MarkObjects: 2.007700 ms DeleteObjects: 0.017900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013453 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.211 seconds +Domain Reload Profiling: + ReloadAssembly (1212ms) + BeginReloadAssembly (182ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (918ms) + LoadAssemblies (137ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (354ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (54ms) + SetupLoadedEditorAssemblies (319ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (80ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5590. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 6.655000 ms (FindLiveObjects: 0.739000 ms CreateObjectMapping: 0.339800 ms MarkObjects: 5.540900 ms DeleteObjects: 0.033100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010106 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.064 seconds +Domain Reload Profiling: + ReloadAssembly (1065ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (791ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (277ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (307ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (41ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.19 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5593. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.553900 ms (FindLiveObjects: 0.509000 ms CreateObjectMapping: 0.344200 ms MarkObjects: 2.643700 ms DeleteObjects: 0.054700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015513 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.038 seconds +Domain Reload Profiling: + ReloadAssembly (1038ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (767ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (274ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (185ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.03 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5596. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.536100 ms (FindLiveObjects: 0.365500 ms CreateObjectMapping: 0.199200 ms MarkObjects: 1.940800 ms DeleteObjects: 0.029800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010310 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.117 seconds +Domain Reload Profiling: + ReloadAssembly (1118ms) + BeginReloadAssembly (182ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (779ms) + LoadAssemblies (144ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (289ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5599. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.132700 ms (FindLiveObjects: 0.722800 ms CreateObjectMapping: 0.183200 ms MarkObjects: 2.193500 ms DeleteObjects: 0.032200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.019051 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.143 seconds +Domain Reload Profiling: + ReloadAssembly (1144ms) + BeginReloadAssembly (229ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (797ms) + LoadAssemblies (175ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (292ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5602. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.338200 ms (FindLiveObjects: 0.562900 ms CreateObjectMapping: 0.230400 ms MarkObjects: 2.519400 ms DeleteObjects: 0.023600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.019936 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.200 seconds +Domain Reload Profiling: + ReloadAssembly (1201ms) + BeginReloadAssembly (195ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (57ms) + EndReloadAssembly (877ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (380ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (301ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (191ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5605. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.996100 ms (FindLiveObjects: 0.419700 ms CreateObjectMapping: 0.214600 ms MarkObjects: 2.326200 ms DeleteObjects: 0.034700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014334 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.143 seconds +Domain Reload Profiling: + ReloadAssembly (1144ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (852ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (365ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (278ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (21ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5608. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.575100 ms (FindLiveObjects: 0.349200 ms CreateObjectMapping: 0.163900 ms MarkObjects: 2.027800 ms DeleteObjects: 0.033300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010154 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.172 seconds +Domain Reload Profiling: + ReloadAssembly (1173ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (896ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (370ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (339ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (207ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 384.17 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5611. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.110500 ms (FindLiveObjects: 0.463300 ms CreateObjectMapping: 0.392000 ms MarkObjects: 2.220000 ms DeleteObjects: 0.033500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009902 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.091 seconds +Domain Reload Profiling: + ReloadAssembly (1092ms) + BeginReloadAssembly (200ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (785ms) + LoadAssemblies (138ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (346ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (261ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (54ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5614. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.661600 ms (FindLiveObjects: 0.469600 ms CreateObjectMapping: 0.346900 ms MarkObjects: 2.801700 ms DeleteObjects: 0.042200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011929 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.952 seconds +Domain Reload Profiling: + ReloadAssembly (953ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (696ms) + LoadAssemblies (97ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (245ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5617. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.418600 ms (FindLiveObjects: 0.383900 ms CreateObjectMapping: 0.168000 ms MarkObjects: 1.849500 ms DeleteObjects: 0.016000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010570 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.063 seconds +Domain Reload Profiling: + ReloadAssembly (1063ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (779ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (275ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (304ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (182ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5620. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.317700 ms (FindLiveObjects: 0.361500 ms CreateObjectMapping: 0.178800 ms MarkObjects: 1.758300 ms DeleteObjects: 0.018300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013205 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.074 seconds +Domain Reload Profiling: + ReloadAssembly (1074ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (826ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (241ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (370ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (84ms) + ProcessInitializeOnLoadAttributes (231ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (21ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5623. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 4.337300 ms (FindLiveObjects: 0.756600 ms CreateObjectMapping: 0.416100 ms MarkObjects: 3.095700 ms DeleteObjects: 0.066700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009383 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.076 seconds +Domain Reload Profiling: + ReloadAssembly (1076ms) + BeginReloadAssembly (173ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (53ms) + EndReloadAssembly (795ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (286ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (309ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (13ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.35 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5626. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.127900 ms (FindLiveObjects: 0.553800 ms CreateObjectMapping: 0.201700 ms MarkObjects: 2.300300 ms DeleteObjects: 0.069700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012571 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.949 seconds +Domain Reload Profiling: + ReloadAssembly (950ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (685ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (244ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (145ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5629. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.771900 ms (FindLiveObjects: 0.422600 ms CreateObjectMapping: 0.196000 ms MarkObjects: 2.126100 ms DeleteObjects: 0.026200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009310 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 3.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.314 seconds +Domain Reload Profiling: + ReloadAssembly (1315ms) + BeginReloadAssembly (186ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (1013ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (302ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (494ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (4ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (323ms) + ProcessInitializeOnLoadMethodAttributes (52ms) + AfterProcessingInitializeOnLoad (22ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5632. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.750200 ms (FindLiveObjects: 0.359300 ms CreateObjectMapping: 0.245100 ms MarkObjects: 2.120400 ms DeleteObjects: 0.024500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012311 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.960 seconds +Domain Reload Profiling: + ReloadAssembly (961ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (695ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (280ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (249ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4797 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5635. +Memory consumption went from 165.6 MB to 165.6 MB. +Total: 2.981000 ms (FindLiveObjects: 0.405200 ms CreateObjectMapping: 0.247500 ms MarkObjects: 2.302500 ms DeleteObjects: 0.024800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012754 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.073 seconds +Domain Reload Profiling: + ReloadAssembly (1074ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (822ms) + LoadAssemblies (109ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (325ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (300ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (182ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Callback registration failed. Increase kMaxCallback. +Fatal Error! Callback registration failed. Increase kMaxCallback. +Crash!!! +SymInit: Symbol-SearchPath: 'D:/Unity/2021.3.27f1c2/Editor/Data/Mono;.;D:\myproject\unity\JNFrame;D:\myproject\unity\JNFrame\Library\BurstCache\JIT;D:\Unity\2021.3.27f1c2\Editor;C:\WINDOWS;C:\WINDOWS\system32;', symOptions: 534, UserName: 'Administrator' +OS-Version: 10.0.0 +D:\Unity\2021.3.27f1c2\Editor\Unity.exe:Unity.exe (00007FF79A5E0000), size: 81166336 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2021.3.27.15766 +C:\WINDOWS\SYSTEM32\ntdll.dll:ntdll.dll (00007FFF2DD70000), size: 2191360 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\KERNEL32.DLL:KERNEL32.DLL (00007FFF2CC80000), size: 802816 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\KERNELBASE.dll:KERNELBASE.dll (00007FFF2B390000), size: 3825664 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\user32.dll:user32.dll (00007FFF2D480000), size: 1761280 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\win32u.dll:win32u.dll (00007FFF2B360000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\GDI32.dll:GDI32.dll (00007FFF2D7C0000), size: 167936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\gdi32full.dll:gdi32full.dll (00007FFF2B900000), size: 1146880 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2861 +C:\WINDOWS\System32\msvcp_win.dll:msvcp_win.dll (00007FFF2B860000), size: 630784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\ucrtbase.dll:ucrtbase.dll (00007FFF2B740000), size: 1118208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\advapi32.dll:advapi32.dll (00007FFF2D2C0000), size: 733184 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\msvcrt.dll:msvcrt.dll (00007FFF2BF50000), size: 684032 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.22621.2506 +C:\WINDOWS\System32\sechost.dll:sechost.dll (00007FFF2D710000), size: 688128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\bcrypt.dll:bcrypt.dll (00007FFF2BA20000), size: 163840 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\RPCRT4.dll:RPCRT4.dll (00007FFF2C0E0000), size: 1142784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\shell32.dll:shell32.dll (00007FFF2C420000), size: 8757248 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\setupapi.dll:setupapi.dll (00007FFF2BAD0000), size: 4669440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\iphlpapi.dll:iphlpapi.dll (00007FFF29C10000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\psapi.dll:psapi.dll (00007FFF2D2B0000), size: 32768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\WS2_32.dll:WS2_32.dll (00007FFF2DCB0000), size: 462848 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\hid.dll:hid.dll (00007FFF29900000), size: 57344 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\WINTRUST.dll:WINTRUST.dll (00007FFF2BA50000), size: 438272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\OLEAUT32.dll:OLEAUT32.dll (00007FFF2DBD0000), size: 880640 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\dhcpcsvc6.dll:dhcpcsvc6.dll (00007FFF258A0000), size: 102400 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\dhcpcsvc.dll:dhcpcsvc.dll (00007FFF25880000), size: 126976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\combase.dll:combase.dll (00007FFF2CF20000), size: 3706880 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wsock32.dll:wsock32.dll (00007FFF1CFA0000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\IMM32.dll:IMM32.dll (00007FFF2C290000), size: 200704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +D:\Unity\2021.3.27f1c2\Editor\libfbxsdk.dll:libfbxsdk.dll (00007FFE93C40000), size: 10067968 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2020.3.3.0 +C:\WINDOWS\System32\ole32.dll:ole32.dll (00007FFF2DA30000), size: 1703936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\optix.6.0.0.dll:optix.6.0.0.dll (00007FFEBEEB0000), size: 208896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.0.0.0 +C:\WINDOWS\System32\SHLWAPI.dll:SHLWAPI.dll (00007FFF2D9D0000), size: 385024 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\s3tcompress.dll:s3tcompress.dll (00007FFF0BD90000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\System32\CRYPT32.dll:CRYPT32.dll (00007FFF2B1F0000), size: 1466368 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\etccompress.dll:etccompress.dll (00007FFE9E050000), size: 5066752 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\ispc_texcomp.dll:ispc_texcomp.dll (00007FFEBED00000), size: 1740800 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\compress_bc7e.dll:compress_bc7e.dll (00007FFEBEBA0000), size: 1441792 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\FreeImage.dll:FreeImage.dll (0000000180000000), size: 6582272 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.18.0.0 +D:\Unity\2021.3.27f1c2\Editor\OpenImageDenoise.dll:OpenImageDenoise.dll (00007FFE945E0000), size: 48848896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.4.2.0 +D:\Unity\2021.3.27f1c2\Editor\umbraoptimizer64.dll:umbraoptimizer64.dll (00007FFEBEA70000), size: 1187840 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\WinPixEventRuntime.dll:WinPixEventRuntime.dll (00007FFF0BD80000), size: 45056 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.0.1812.6001 +D:\Unity\2021.3.27f1c2\Editor\RadeonImageFilters.dll:RadeonImageFilters.dll (00007FFEBE790000), size: 2961408 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.7.0.0 +D:\Unity\2021.3.27f1c2\Editor\SketchUpAPI.dll:SketchUpAPI.dll (00007FFE933A0000), size: 8990720 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 23.0.0.0 +C:\WINDOWS\SYSTEM32\VERSION.dll:VERSION.dll (00007FFF242F0000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\dwmapi.dll:dwmapi.dll (00007FFF28A50000), size: 176128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\WINMM.dll:WINMM.dll (00007FFF216C0000), size: 212992 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\WINHTTP.dll:WINHTTP.dll (00007FFF258C0000), size: 1273856 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\GLU32.dll:GLU32.dll (00007FFF1C120000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\OPENGL32.dll:OPENGL32.dll (00007FFF07F90000), size: 1048576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +D:\Unity\2021.3.27f1c2\Editor\tbb12.dll:tbb12.dll (00007FFEBE720000), size: 434176 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\MSVCP140.dll:MSVCP140.dll (00007FFEFF230000), size: 581632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll:VCRUNTIME140.dll (00007FFF1C100000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +D:\Unity\2021.3.27f1c2\Editor\RadeonML.dll:RadeonML.dll (00007FFF0BD60000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 0.9.11.0 +D:\Unity\2021.3.27f1c2\Editor\SketchUpCommonPreferences.dll:SketchUpCommonPreferences.dll (00007FFE9DF80000), size: 499712 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 23.0.0.0 +C:\WINDOWS\SYSTEM32\Secur32.dll:Secur32.dll (00007FFF29FA0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\VCRUNTIME140_1.dll:VCRUNTIME140_1.dll (00007FFEFF2C0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 14.34.31931.0 +D:\Unity\2021.3.27f1c2\Editor\tbbmalloc.dll:tbbmalloc.dll (00007FFE9E000000), size: 282624 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\dxcore.dll:dxcore.dll (00007FFF28730000), size: 221184 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\SSPICLI.DLL:SSPICLI.DLL (00007FFF2A430000), size: 274432 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +D:\Unity\2021.3.27f1c2\Editor\OpenRL.dll:OpenRL.dll (0000028B65950000), size: 12779520 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.5.0.2907 +C:\WINDOWS\SYSTEM32\MSVCP100.dll:MSVCP100.dll (0000000072190000), size: 622592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.40219.325 +D:\Unity\2021.3.27f1c2\Editor\embree.dll:embree.dll (00007FFE923B0000), size: 16711680 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.14.0.0 +C:\WINDOWS\SYSTEM32\MSVCR100.dll:MSVCR100.dll (00000000720B0000), size: 860160 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.40219.325 +D:\Unity\2021.3.27f1c2\Editor\tbb.dll:tbb.dll (00007FFE97D40000), size: 413696 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2017.0.2016.1004 +C:\WINDOWS\SYSTEM32\MSVCR120.dll:MSVCR120.dll (00007FFE922C0000), size: 978944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.40649.5 +C:\WINDOWS\SYSTEM32\MSVCP120.dll:MSVCP120.dll (00007FFE92210000), size: 679936 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 12.0.40649.5 +D:\Unity\2021.3.27f1c2\Editor\OpenRL_pthread.dll:OpenRL_pthread.dll (0000028B665A0000), size: 61440 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2.9.0.0 +C:\WINDOWS\SYSTEM32\MSASN1.dll:MSASN1.dll (00007FFF2A900000), size: 73728 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\CRYPTSP.dll:CRYPTSP.dll (00007FFF2A8A0000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\rsaenh.dll:rsaenh.dll (00007FFF2A130000), size: 217088 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\CRYPTBASE.dll:CRYPTBASE.dll (00007FFF2A8C0000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\bcryptPrimitives.dll:bcryptPrimitives.dll (00007FFF2B0B0000), size: 499712 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\MSWSOCK.DLL:MSWSOCK.DLL (00007FFF2A650000), size: 430080 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\cfgmgr32.DLL:cfgmgr32.DLL (00007FFF2AD70000), size: 319488 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\kernel.appcore.dll:kernel.appcore.dll (00007FFF2A1D0000), size: 98304 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2715 +C:\WINDOWS\system32\uxtheme.dll:uxtheme.dll (00007FFF28640000), size: 700416 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.3007 +C:\WINDOWS\System32\shcore.dll:shcore.dll (00007FFF2D380000), size: 995328 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2715 +C:\WINDOWS\SYSTEM32\windows.storage.dll:windows.storage.dll (00007FFF29000000), size: 9396224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wintypes.dll:wintypes.dll (00007FFF28EC0000), size: 1302528 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\profapi.dll:profapi.dll (00007FFF2AFE0000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\IconCodecService.dll:IconCodecService.dll (00007FFEFEF60000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\WindowsCodecs.dll:WindowsCodecs.dll (00007FFF26D70000), size: 1769472 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\clbcatq.dll:clbcatq.dll (00007FFF2CD50000), size: 720896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2001.12.10941.16384 +C:\WINDOWS\System32\netprofm.dll:netprofm.dll (00007FFF264C0000), size: 491520 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\npmproxy.dll:npmproxy.dll (00007FFF24B20000), size: 98304 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\NSI.dll:NSI.dll (00007FFF2BAC0000), size: 36864 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\DNSAPI.dll:DNSAPI.dll (00007FFF29C40000), size: 1019904 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\napinsp.dll:napinsp.dll (00007FFF0C1E0000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\system32\pnrpnsp.dll:pnrpnsp.dll (00007FFF0C1C0000), size: 110592 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\winrnr.dll:winrnr.dll (00007FFF0C1A0000), size: 69632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\system32\wshbth.dll:wshbth.dll (00007FFF0C160000), size: 86016 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\nlansp_c.dll:nlansp_c.dll (00007FFF0C130000), size: 135168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\fwpuclnt.dll:fwpuclnt.dll (00007FFF24D80000), size: 536576 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\Windows\System32\rasadhlp.dll:rasadhlp.dll (00007FFF1AD20000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +D:\Unity\2021.3.27f1c2\Editor\NVUnityPlugin.DLL:NVUnityPlugin.DLL (00007FFE8E3E0000), size: 1536000 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\Data\Tools\astcenc-avx2.dll:astcenc-avx2.dll (00007FFE8E350000), size: 561152 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\d3d11.dll:d3d11.dll (00007FFF271A0000), size: 2453504 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\dxgi.dll:dxgi.dll (00007FFF28850000), size: 1015808 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\directxdatabasehelper.dll:directxdatabasehelper.dll (00007FFF25580000), size: 303104 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\nvldumdx.dll:nvldumdx.dll (00007FFF21F30000), size: 770048 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 31.0.15.3623 +C:\WINDOWS\SYSTEM32\cryptnet.dll:cryptnet.dll (00007FFF242B0000), size: 204800 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\drvstore.dll:drvstore.dll (00007FFF23FD0000), size: 1409024 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\devobj.dll:devobj.dll (00007FFF2ADC0000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\wldp.dll:wldp.dll (00007FFF2A970000), size: 307200 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\System32\imagehlp.dll:imagehlp.dll (00007FFF2CE00000), size: 126976 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\nvwgf2umx.dll:nvwgf2umx.dll (00007FFF14530000), size: 99463168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 31.0.15.3623 +C:\WINDOWS\system32\nvspcap64.dll:nvspcap64.dll (00007FFF0AD80000), size: 2953216 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.27.0.112 +C:\WINDOWS\SYSTEM32\ntmarta.dll:ntmarta.dll (00007FFF2A1F0000), size: 212992 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_7e5fd280efaa5445\Display.NvContainer\MessageBus.dll:MessageBus.dll (00007FFF1EF90000), size: 7565312 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.22.2758.1620 +C:\WINDOWS\system32\wbem\wbemprox.dll:wbemprox.dll (00007FFF1B1D0000), size: 65536 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\SYSTEM32\wbemcomn.dll:wbemcomn.dll (00007FFF1B150000), size: 524288 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\system32\wbem\wbemsvc.dll:wbemsvc.dll (00007FFF1AC10000), size: 81920 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2792 +C:\WINDOWS\system32\wbem\fastprox.dll:fastprox.dll (00007FFF1A660000), size: 1015808 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\WINDOWS\SYSTEM32\amsi.dll:amsi.dll (00007FFF21A50000), size: 118784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.1 +C:\WINDOWS\SYSTEM32\USERENV.dll:USERENV.dll (00007FFF2A740000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 +C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.23110.3-0\MpOav.dll:MpOav.dll (00007FFF219C0000), size: 507904 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 4.18.23110.3 +D:\Unity\2021.3.27f1c2\Editor\cudart64_90.dll:cudart64_90.dll (00007FFE8E270000), size: 397312 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 6.14.11.9000 +C:\WINDOWS\SYSTEM32\opencl.dll:opencl.dll (00007FFE8DA10000), size: 1490944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.0.3.0 +D:\Unity\2021.3.27f1c2\Editor\radeonrays.dll:radeonrays.dll (00007FFE8E1E0000), size: 557056 (result: 0), SymType: '-deferred-', PDB: '' +D:\Unity\2021.3.27f1c2\Editor\Data\MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll:mono-2.0-bdwgc.dll (00007FFE8CFE0000), size: 10682368 (result: 0), SymType: '-deferred-', PDB: '' +C:\WINDOWS\SYSTEM32\dbghelp.dll:dbghelp.dll (00007FFF1FEB0000), size: 2306048 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.22621.2506 + +========== OUTPUTTING STACK TRACE ================== + +0x00007FFF2B3F567C (KERNELBASE) RaiseException +0x00007FF79BFD8AFB (Unity) EditorMonoConsole::LogToConsoleImplementation +0x00007FF79BFD95ED (Unity) EditorMonoConsole::LogToConsoleImplementation +0x00007FF79CC68077 (Unity) DebugStringToFilePostprocessedStacktrace +0x00007FF79CC677CD (Unity) DebugStringToFile +0x00007FF79C4554D5 (Unity) LoadDomainAndUserAssemblies +0x00007FF79C455B64 (Unity) LoadUserAssemblies +0x00007FF79C94DFFF (Unity) ::operator() +0x00007FF79C98F9A2 (Unity) asio::detail::completion_handler,asio::io_context::basic_executor_type,0> >::do_complete +0x00007FF79C97B88E (Unity) asio::detail::win_iocp_io_context::do_one +0x00007FF79C97D4F4 (Unity) asio::detail::win_iocp_io_context::run +0x00007FF79C98DD8E (Unity) IOService::Run +0x00007FF79C96049F (Unity) AssetImportWorkerClient::Run +0x00007FF79C928AA3 (Unity) RunAssetImportWorkerClientV2 +0x00007FF79C928B2B (Unity) RunAssetImporterV2 +0x00007FF79C158828 (Unity) Application::InitializeProject +0x00007FF79C5A5478 (Unity) WinMain +0x00007FF79D9A360E (Unity) __scrt_common_main_seh +0x00007FFF2CC9257D (KERNEL32) BaseThreadInitThunk +0x00007FFF2DDCAA58 (ntdll) RtlUserThreadStart + +========== END OF STACKTRACE =========== + +A crash has been intercepted by the crash handler. For call stack and other details, see the latest crash report generated in: + * C:/Users/ADMINI~1/AppData/Local/Temp/Unity/Editor/Crashes diff --git a/JNFrame/Logs/AssetImportWorker2.log b/JNFrame/Logs/AssetImportWorker2.log new file mode 100644 index 00000000..2e791ac0 --- /dev/null +++ b/JNFrame/Logs/AssetImportWorker2.log @@ -0,0 +1,5420 @@ +Using pre-set license +Built from '2021.3/china_unity/release' branch; Version is '2021.3.27f1c2 (3b3d9646cb47) revision 3882390'; Using compiler version '192829333'; Build Type 'Release' +OS: 'Windows 11 (10.0.22621) 64bit Professional' Language: 'zh' Physical Memory: 32651 MB +BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1 + +COMMAND LINE ARGUMENTS: +D:\Unity\2021.3.27f1c2\Editor\Unity.exe +-adb2 +-batchMode +-noUpm +-name +AssetImportWorker2 +-projectPath +D:/myproject/unity/JNFrame +-logFile +Logs/AssetImportWorker2.log +-srvPort +64124 +Successfully changed project path to: D:/myproject/unity/JNFrame +D:/myproject/unity/JNFrame +[UnityMemory] Configuration Parameters - Can be set up in boot.config + "memorysetup-bucket-allocator-granularity=16" + "memorysetup-bucket-allocator-bucket-count=8" + "memorysetup-bucket-allocator-block-size=33554432" + "memorysetup-bucket-allocator-block-count=8" + "memorysetup-main-allocator-block-size=16777216" + "memorysetup-thread-allocator-block-size=16777216" + "memorysetup-gfx-main-allocator-block-size=16777216" + "memorysetup-gfx-thread-allocator-block-size=16777216" + "memorysetup-cache-allocator-block-size=4194304" + "memorysetup-typetree-allocator-block-size=2097152" + "memorysetup-profiler-bucket-allocator-granularity=16" + "memorysetup-profiler-bucket-allocator-bucket-count=8" + "memorysetup-profiler-bucket-allocator-block-size=33554432" + "memorysetup-profiler-bucket-allocator-block-count=8" + "memorysetup-profiler-allocator-block-size=16777216" + "memorysetup-profiler-editor-allocator-block-size=1048576" + "memorysetup-temp-allocator-size-main=16777216" + "memorysetup-job-temp-allocator-block-size=2097152" + "memorysetup-job-temp-allocator-block-size-background=1048576" + "memorysetup-job-temp-allocator-reduction-small-platforms=262144" + "memorysetup-temp-allocator-size-background-worker=32768" + "memorysetup-temp-allocator-size-job-worker=262144" + "memorysetup-temp-allocator-size-preload-manager=33554432" + "memorysetup-temp-allocator-size-nav-mesh-worker=65536" + "memorysetup-temp-allocator-size-audio-worker=65536" + "memorysetup-temp-allocator-size-cloud-worker=32768" + "memorysetup-temp-allocator-size-gi-baking-worker=262144" + "memorysetup-temp-allocator-size-gfx=262144" +Player connection [30660] Host "[IP] 192.168.0.130 [Port] 0 [Flags] 2 [Guid] 2799850441 [EditorId] 2799850441 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... + +Player connection [30660] Host "[IP] 192.168.0.130 [Port] 0 [Flags] 2 [Guid] 2799850441 [EditorId] 2799850441 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... + +AS: AutoStreaming module initializing. +Refreshing native plugins compatible for Editor in 90.34 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Initialize engine version: 2021.3.27f1c2 (3b3d9646cb47) +[Subsystems] Discovering subsystems at path D:/Unity/2021.3.27f1c2/Editor/Data/Resources/UnitySubsystems +[Subsystems] Discovering subsystems at path D:/myproject/unity/JNFrame/Assets +GfxDevice: creating device client; threaded=0; jobified=0 +Direct3D: + Version: Direct3D 11.0 [level 11.1] + Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) + Vendor: NVIDIA + VRAM: 5980 MB + Driver: 31.0.15.3623 +Initialize mono +Mono path[0] = 'D:/Unity/2021.3.27f1c2/Editor/Data/Managed' +Mono path[1] = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' +Mono config path = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/etc' +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56360 +Begin MonoManager ReloadAssembly +Registering precompiled unity dll's ... +Register platform support module: D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll +Registered in 0.006145 seconds. +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 84.49 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.887 seconds +Domain Reload Profiling: + ReloadAssembly (888ms) + BeginReloadAssembly (107ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (0ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (1ms) + EndReloadAssembly (544ms) + LoadAssemblies (99ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (238ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (23ms) + SetupLoadedEditorAssemblies (234ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (85ms) + BeforeProcessingInitializeOnLoad (1ms) + ProcessInitializeOnLoadAttributes (94ms) + ProcessInitializeOnLoadMethodAttributes (48ms) + AfterProcessingInitializeOnLoad (0ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (0ms) +Platform modules already initialized, skipping +Registering precompiled user dll's ... +Registered in 0.014157 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.344 seconds +Domain Reload Profiling: + ReloadAssembly (1346ms) + BeginReloadAssembly (132ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (19ms) + EndReloadAssembly (1106ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (315ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (594ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (86ms) + ProcessInitializeOnLoadAttributes (460ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +======================================================================== +Worker process is ready to serve import requests +Launched and connected shader compiler UnityShaderCompiler.exe after 0.11 seconds +Refreshing native plugins compatible for Editor in 0.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4807 Unused Serialized files (Serialized files now loaded: 0) +Unloading 30 unused Assets / (46.7 KB). Loaded Objects now: 5266. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 5.054400 ms (FindLiveObjects: 0.406400 ms CreateObjectMapping: 0.189000 ms MarkObjects: 4.319300 ms DeleteObjects: 0.137800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 19907.446310 seconds. + path: Assets/Scenes/WorldScene.unity + artifactKey: Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/WorldScene.unity using Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'fed913dccaea58e126d7b5d443d16622') in 0.020151 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010207 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.096 seconds +Domain Reload Profiling: + ReloadAssembly (1096ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (825ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (352ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (270ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5269. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 3.111800 ms (FindLiveObjects: 0.575200 ms CreateObjectMapping: 0.169600 ms MarkObjects: 2.343800 ms DeleteObjects: 0.021900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010494 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.972 seconds +Domain Reload Profiling: + ReloadAssembly (973ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (707ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (272ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (252ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (149ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5272. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.782000 ms (FindLiveObjects: 0.300500 ms CreateObjectMapping: 0.167500 ms MarkObjects: 2.281200 ms DeleteObjects: 0.031900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009882 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.179 seconds +Domain Reload Profiling: + ReloadAssembly (1180ms) + BeginReloadAssembly (199ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (870ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (369ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (293ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.44 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5275. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 2.896100 ms (FindLiveObjects: 0.625300 ms CreateObjectMapping: 0.184100 ms MarkObjects: 2.045200 ms DeleteObjects: 0.037800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014922 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.934 seconds +Domain Reload Profiling: + ReloadAssembly (935ms) + BeginReloadAssembly (147ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (692ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (240ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (265ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.97 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5278. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 7.220400 ms (FindLiveObjects: 0.900800 ms CreateObjectMapping: 0.737500 ms MarkObjects: 5.458100 ms DeleteObjects: 0.120000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014979 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.950 seconds +Domain Reload Profiling: + ReloadAssembly (951ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (689ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (261ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (252ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5281. +Memory consumption went from 164.4 MB to 164.3 MB. +Total: 5.030700 ms (FindLiveObjects: 0.484000 ms CreateObjectMapping: 0.266400 ms MarkObjects: 4.215900 ms DeleteObjects: 0.061200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011262 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.055 seconds +Domain Reload Profiling: + ReloadAssembly (1056ms) + BeginReloadAssembly (180ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (754ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (310ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (254ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (149ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5284. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 4.001000 ms (FindLiveObjects: 0.712000 ms CreateObjectMapping: 0.509900 ms MarkObjects: 2.735000 ms DeleteObjects: 0.040800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017452 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.110 seconds +Domain Reload Profiling: + ReloadAssembly (1111ms) + BeginReloadAssembly (185ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (55ms) + EndReloadAssembly (806ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (260ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (343ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (92ms) + ProcessInitializeOnLoadAttributes (197ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5287. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.927700 ms (FindLiveObjects: 0.370700 ms CreateObjectMapping: 0.201700 ms MarkObjects: 2.293400 ms DeleteObjects: 0.060600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013085 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.07 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.065 seconds +Domain Reload Profiling: + ReloadAssembly (1065ms) + BeginReloadAssembly (164ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (792ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (272ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (334ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (218ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5290. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.270000 ms (FindLiveObjects: 0.405200 ms CreateObjectMapping: 0.171100 ms MarkObjects: 2.656500 ms DeleteObjects: 0.035800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015202 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.042 seconds +Domain Reload Profiling: + ReloadAssembly (1043ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (782ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (257ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5293. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.699100 ms (FindLiveObjects: 0.304000 ms CreateObjectMapping: 0.164100 ms MarkObjects: 2.197500 ms DeleteObjects: 0.032300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013842 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.959 seconds +Domain Reload Profiling: + ReloadAssembly (960ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (705ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (276ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (256ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5296. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 3.547700 ms (FindLiveObjects: 0.280300 ms CreateObjectMapping: 0.867700 ms MarkObjects: 2.371500 ms DeleteObjects: 0.027400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014011 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.955 seconds +Domain Reload Profiling: + ReloadAssembly (956ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (711ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (275ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (255ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (155ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5299. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.488900 ms (FindLiveObjects: 0.307500 ms CreateObjectMapping: 0.147700 ms MarkObjects: 2.005500 ms DeleteObjects: 0.027300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.018082 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.322 seconds +Domain Reload Profiling: + ReloadAssembly (1323ms) + BeginReloadAssembly (189ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (1000ms) + LoadAssemblies (134ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (371ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (72ms) + SetupLoadedEditorAssemblies (373ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (88ms) + ProcessInitializeOnLoadAttributes (217ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (26ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (17ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.28 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5302. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 4.174700 ms (FindLiveObjects: 0.557700 ms CreateObjectMapping: 0.285200 ms MarkObjects: 3.276800 ms DeleteObjects: 0.052200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015071 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.26 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.963 seconds +Domain Reload Profiling: + ReloadAssembly (964ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (700ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (227ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 7.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5305. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 7.549800 ms (FindLiveObjects: 0.876700 ms CreateObjectMapping: 1.907000 ms MarkObjects: 4.670300 ms DeleteObjects: 0.088500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017011 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.041 seconds +Domain Reload Profiling: + ReloadAssembly (1042ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (769ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (291ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5308. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.733200 ms (FindLiveObjects: 0.597500 ms CreateObjectMapping: 0.661900 ms MarkObjects: 2.424100 ms DeleteObjects: 0.047600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013104 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.172 seconds +Domain Reload Profiling: + ReloadAssembly (1172ms) + BeginReloadAssembly (226ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (62ms) + EndReloadAssembly (826ms) + LoadAssemblies (165ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (346ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (270ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5311. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.729200 ms (FindLiveObjects: 0.476400 ms CreateObjectMapping: 0.290500 ms MarkObjects: 1.941500 ms DeleteObjects: 0.019600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.019311 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.036 seconds +Domain Reload Profiling: + ReloadAssembly (1037ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (739ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (278ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.16 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5314. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 3.168300 ms (FindLiveObjects: 0.467000 ms CreateObjectMapping: 0.158900 ms MarkObjects: 2.503500 ms DeleteObjects: 0.036400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013617 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.984 seconds +Domain Reload Profiling: + ReloadAssembly (984ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (714ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (275ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (267ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.27 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5317. +Memory consumption went from 164.5 MB to 164.4 MB. +Total: 2.428900 ms (FindLiveObjects: 0.306100 ms CreateObjectMapping: 0.164600 ms MarkObjects: 1.938500 ms DeleteObjects: 0.018700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009887 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.023 seconds +Domain Reload Profiling: + ReloadAssembly (1024ms) + BeginReloadAssembly (145ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (33ms) + EndReloadAssembly (771ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (257ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (299ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (185ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5320. +Memory consumption went from 164.7 MB to 164.6 MB. +Total: 2.676800 ms (FindLiveObjects: 0.342300 ms CreateObjectMapping: 0.313900 ms MarkObjects: 1.999400 ms DeleteObjects: 0.020100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009966 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.942 seconds +Domain Reload Profiling: + ReloadAssembly (943ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (675ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (254ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (253ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5323. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.521000 ms (FindLiveObjects: 0.307600 ms CreateObjectMapping: 0.150700 ms MarkObjects: 2.024200 ms DeleteObjects: 0.037000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010882 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.36 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.922 seconds +Domain Reload Profiling: + ReloadAssembly (923ms) + BeginReloadAssembly (142ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (692ms) + LoadAssemblies (97ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (239ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (283ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5326. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.477000 ms (FindLiveObjects: 0.299700 ms CreateObjectMapping: 0.167600 ms MarkObjects: 1.989200 ms DeleteObjects: 0.019600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012214 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.109 seconds +Domain Reload Profiling: + ReloadAssembly (1111ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (839ms) + LoadAssemblies (119ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (261ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (394ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (253ms) + ProcessInitializeOnLoadMethodAttributes (45ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5329. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.440000 ms (FindLiveObjects: 0.297500 ms CreateObjectMapping: 0.242500 ms MarkObjects: 2.846000 ms DeleteObjects: 0.051900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013209 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.893 seconds +Domain Reload Profiling: + ReloadAssembly (893ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (640ms) + LoadAssemblies (98ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (233ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (250ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (54ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5332. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 3.274900 ms (FindLiveObjects: 0.354500 ms CreateObjectMapping: 0.460700 ms MarkObjects: 2.430800 ms DeleteObjects: 0.027200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011234 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.031 seconds +Domain Reload Profiling: + ReloadAssembly (1032ms) + BeginReloadAssembly (183ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (729ms) + LoadAssemblies (147ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (272ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5335. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.502900 ms (FindLiveObjects: 0.284300 ms CreateObjectMapping: 0.151900 ms MarkObjects: 3.032500 ms DeleteObjects: 0.032000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009934 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.852 seconds +Domain Reload Profiling: + ReloadAssembly (1855ms) + BeginReloadAssembly (265ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (61ms) + EndReloadAssembly (1346ms) + LoadAssemblies (215ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (713ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (56ms) + SetupLoadedEditorAssemblies (332ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (206ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5338. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 4.112700 ms (FindLiveObjects: 0.295500 ms CreateObjectMapping: 0.147300 ms MarkObjects: 3.635300 ms DeleteObjects: 0.032700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.021407 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.880 seconds +Domain Reload Profiling: + ReloadAssembly (1881ms) + BeginReloadAssembly (258ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (1456ms) + LoadAssemblies (224ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (556ms) + ReleaseScriptCaches (6ms) + RebuildScriptCaches (88ms) + SetupLoadedEditorAssemblies (555ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (205ms) + ProcessInitializeOnLoadAttributes (258ms) + ProcessInitializeOnLoadMethodAttributes (64ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5341. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 7.535800 ms (FindLiveObjects: 1.196900 ms CreateObjectMapping: 0.868900 ms MarkObjects: 5.359900 ms DeleteObjects: 0.106700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012219 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.516 seconds +Domain Reload Profiling: + ReloadAssembly (1517ms) + BeginReloadAssembly (266ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (64ms) + EndReloadAssembly (1101ms) + LoadAssemblies (176ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (338ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (56ms) + SetupLoadedEditorAssemblies (501ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (2ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (116ms) + ProcessInitializeOnLoadAttributes (299ms) + ProcessInitializeOnLoadMethodAttributes (51ms) + AfterProcessingInitializeOnLoad (23ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5344. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 3.622600 ms (FindLiveObjects: 0.540000 ms CreateObjectMapping: 0.375300 ms MarkObjects: 2.655700 ms DeleteObjects: 0.049300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014214 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.42 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.096 seconds +Domain Reload Profiling: + ReloadAssembly (1096ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (814ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5347. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 5.102200 ms (FindLiveObjects: 0.766100 ms CreateObjectMapping: 0.821400 ms MarkObjects: 3.455100 ms DeleteObjects: 0.057500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013293 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.924 seconds +Domain Reload Profiling: + ReloadAssembly (925ms) + BeginReloadAssembly (147ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (683ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (255ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (267ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5350. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.320100 ms (FindLiveObjects: 0.278500 ms CreateObjectMapping: 0.134600 ms MarkObjects: 1.879500 ms DeleteObjects: 0.026500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012506 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.707 seconds +Domain Reload Profiling: + ReloadAssembly (1708ms) + BeginReloadAssembly (422ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (15ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (159ms) + EndReloadAssembly (1088ms) + LoadAssemblies (230ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (441ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (57ms) + SetupLoadedEditorAssemblies (360ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (80ms) + ProcessInitializeOnLoadAttributes (221ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5353. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 4.195400 ms (FindLiveObjects: 0.376900 ms CreateObjectMapping: 0.176700 ms MarkObjects: 3.541300 ms DeleteObjects: 0.097100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009645 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.063 seconds +Domain Reload Profiling: + ReloadAssembly (1064ms) + BeginReloadAssembly (191ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (764ms) + LoadAssemblies (147ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (294ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5356. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 5.072700 ms (FindLiveObjects: 0.656300 ms CreateObjectMapping: 0.348500 ms MarkObjects: 3.846000 ms DeleteObjects: 0.218200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016486 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.224 seconds +Domain Reload Profiling: + ReloadAssembly (1225ms) + BeginReloadAssembly (241ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (57ms) + EndReloadAssembly (860ms) + LoadAssemblies (170ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (300ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (346ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (78ms) + ProcessInitializeOnLoadAttributes (216ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5359. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 5.319200 ms (FindLiveObjects: 0.409500 ms CreateObjectMapping: 0.247400 ms MarkObjects: 4.580600 ms DeleteObjects: 0.079100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014370 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.32 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.164 seconds +Domain Reload Profiling: + ReloadAssembly (1165ms) + BeginReloadAssembly (213ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (842ms) + LoadAssemblies (174ms) + RebuildTransferFunctionScriptingTraits (1ms) + SetupTypeCache (334ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (48ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5362. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.514300 ms (FindLiveObjects: 0.316800 ms CreateObjectMapping: 0.176700 ms MarkObjects: 1.999000 ms DeleteObjects: 0.020800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010293 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.084 seconds +Domain Reload Profiling: + ReloadAssembly (1085ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (34ms) + EndReloadAssembly (810ms) + LoadAssemblies (139ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (58ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (168ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5366. +Memory consumption went from 164.9 MB to 164.8 MB. +Total: 2.566300 ms (FindLiveObjects: 0.388400 ms CreateObjectMapping: 0.150600 ms MarkObjects: 2.004200 ms DeleteObjects: 0.022200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011320 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.112 seconds +Domain Reload Profiling: + ReloadAssembly (1113ms) + BeginReloadAssembly (223ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (69ms) + EndReloadAssembly (778ms) + LoadAssemblies (147ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (295ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (294ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5369. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 3.613100 ms (FindLiveObjects: 0.551000 ms CreateObjectMapping: 0.189800 ms MarkObjects: 2.842600 ms DeleteObjects: 0.027500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017918 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.132 seconds +Domain Reload Profiling: + ReloadAssembly (1133ms) + BeginReloadAssembly (202ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (795ms) + LoadAssemblies (158ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (297ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.46 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5372. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.697800 ms (FindLiveObjects: 0.310800 ms CreateObjectMapping: 0.172800 ms MarkObjects: 2.190600 ms DeleteObjects: 0.022000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014493 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.017 seconds +Domain Reload Profiling: + ReloadAssembly (1017ms) + BeginReloadAssembly (175ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (735ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (266ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (271ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5375. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 3.261800 ms (FindLiveObjects: 0.281300 ms CreateObjectMapping: 0.145700 ms MarkObjects: 2.783500 ms DeleteObjects: 0.050200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.019703 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.218 seconds +Domain Reload Profiling: + ReloadAssembly (1219ms) + BeginReloadAssembly (209ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (866ms) + LoadAssemblies (160ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (335ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (313ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (77ms) + ProcessInitializeOnLoadAttributes (189ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5379. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.968800 ms (FindLiveObjects: 0.437300 ms CreateObjectMapping: 0.186300 ms MarkObjects: 2.276200 ms DeleteObjects: 0.067800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012667 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.97 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.026 seconds +Domain Reload Profiling: + ReloadAssembly (1026ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (752ms) + LoadAssemblies (122ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (247ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 25 unused Assets / (22.0 KB). Loaded Objects now: 5380. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 4.092400 ms (FindLiveObjects: 0.999800 ms CreateObjectMapping: 0.559400 ms MarkObjects: 2.446000 ms DeleteObjects: 0.085600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012090 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.095 seconds +Domain Reload Profiling: + ReloadAssembly (1096ms) + BeginReloadAssembly (189ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (799ms) + LoadAssemblies (131ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (299ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (183ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.2 KB). Loaded Objects now: 5384. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.455800 ms (FindLiveObjects: 0.312900 ms CreateObjectMapping: 0.161000 ms MarkObjects: 1.946600 ms DeleteObjects: 0.034300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013567 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.089 seconds +Domain Reload Profiling: + ReloadAssembly (1089ms) + BeginReloadAssembly (177ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (791ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (258ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (57ms) + SetupLoadedEditorAssemblies (306ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (83ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5387. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.949000 ms (FindLiveObjects: 0.567900 ms CreateObjectMapping: 0.200700 ms MarkObjects: 2.099900 ms DeleteObjects: 0.078400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009925 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.172 seconds +Domain Reload Profiling: + ReloadAssembly (1172ms) + BeginReloadAssembly (228ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (827ms) + LoadAssemblies (163ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (307ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (304ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (85ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5390. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 4.436600 ms (FindLiveObjects: 0.496000 ms CreateObjectMapping: 0.241100 ms MarkObjects: 3.663600 ms DeleteObjects: 0.034100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009877 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.988 seconds +Domain Reload Profiling: + ReloadAssembly (989ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (719ms) + LoadAssemblies (134ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (252ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5393. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.479200 ms (FindLiveObjects: 0.307800 ms CreateObjectMapping: 0.157600 ms MarkObjects: 1.991900 ms DeleteObjects: 0.021100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010999 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.01 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.991 seconds +Domain Reload Profiling: + ReloadAssembly (992ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (723ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (246ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5396. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 2.754500 ms (FindLiveObjects: 0.464000 ms CreateObjectMapping: 0.169900 ms MarkObjects: 2.029700 ms DeleteObjects: 0.089700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011855 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.005 seconds +Domain Reload Profiling: + ReloadAssembly (1006ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (730ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (246ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5399. +Memory consumption went from 165.0 MB to 164.9 MB. +Total: 3.840100 ms (FindLiveObjects: 0.311800 ms CreateObjectMapping: 0.156600 ms MarkObjects: 3.272700 ms DeleteObjects: 0.097200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.023356 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.011 seconds +Domain Reload Profiling: + ReloadAssembly (1012ms) + BeginReloadAssembly (153ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (751ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (277ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (184ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.17 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5402. +Memory consumption went from 165.0 MB to 164.9 MB. +Total: 3.060100 ms (FindLiveObjects: 0.462600 ms CreateObjectMapping: 0.194700 ms MarkObjects: 2.362000 ms DeleteObjects: 0.039500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013010 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.071 seconds +Domain Reload Profiling: + ReloadAssembly (1072ms) + BeginReloadAssembly (200ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (746ms) + LoadAssemblies (143ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (292ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (267ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5405. +Memory consumption went from 165.0 MB to 164.9 MB. +Total: 2.475800 ms (FindLiveObjects: 0.292200 ms CreateObjectMapping: 0.154500 ms MarkObjects: 1.947700 ms DeleteObjects: 0.080500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011500 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.263 seconds +Domain Reload Profiling: + ReloadAssembly (1264ms) + BeginReloadAssembly (206ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (12ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (920ms) + LoadAssemblies (156ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (326ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (52ms) + SetupLoadedEditorAssemblies (342ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (221ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.17 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5408. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 4.986700 ms (FindLiveObjects: 0.927700 ms CreateObjectMapping: 1.005500 ms MarkObjects: 2.979200 ms DeleteObjects: 0.071100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014079 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.121 seconds +Domain Reload Profiling: + ReloadAssembly (1121ms) + BeginReloadAssembly (177ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (824ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (291ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (323ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (196ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5411. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.643000 ms (FindLiveObjects: 0.327400 ms CreateObjectMapping: 0.191700 ms MarkObjects: 2.075500 ms DeleteObjects: 0.047400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012124 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.310 seconds +Domain Reload Profiling: + ReloadAssembly (1310ms) + BeginReloadAssembly (255ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (68ms) + EndReloadAssembly (930ms) + LoadAssemblies (220ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (342ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (58ms) + SetupLoadedEditorAssemblies (326ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (85ms) + ProcessInitializeOnLoadAttributes (194ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5414. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 2.381000 ms (FindLiveObjects: 0.296100 ms CreateObjectMapping: 0.143300 ms MarkObjects: 1.922300 ms DeleteObjects: 0.018500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011483 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.096 seconds +Domain Reload Profiling: + ReloadAssembly (1096ms) + BeginReloadAssembly (178ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (811ms) + LoadAssemblies (115ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (319ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5417. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 4.001300 ms (FindLiveObjects: 0.626700 ms CreateObjectMapping: 0.332700 ms MarkObjects: 2.899600 ms DeleteObjects: 0.139000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009777 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.915 seconds +Domain Reload Profiling: + ReloadAssembly (916ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (658ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (241ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (251ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5420. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 3.400700 ms (FindLiveObjects: 0.737500 ms CreateObjectMapping: 0.344200 ms MarkObjects: 2.288200 ms DeleteObjects: 0.028600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 83665.377336 seconds. + path: Assets/Scenes/Main.unity + artifactKey: Guid(9fc0d4010bbf28b4594072e72b8655ab) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/Main.unity using Guid(9fc0d4010bbf28b4594072e72b8655ab) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'fc22d7fd0e7a736e06f17074b57f2098') in 0.031659 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011292 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.020 seconds +Domain Reload Profiling: + ReloadAssembly (1021ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (750ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (269ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5423. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 3.101800 ms (FindLiveObjects: 0.515500 ms CreateObjectMapping: 0.273000 ms MarkObjects: 2.276300 ms DeleteObjects: 0.034300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012039 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.020 seconds +Domain Reload Profiling: + ReloadAssembly (1021ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (765ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (294ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (182ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.2 KB). Loaded Objects now: 5426. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.881500 ms (FindLiveObjects: 0.358200 ms CreateObjectMapping: 0.202600 ms MarkObjects: 2.268600 ms DeleteObjects: 0.050100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 6536.295534 seconds. + path: Assets/Scenes/WorldScene.unity + artifactKey: Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/WorldScene.unity using Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '4c4a9f5ee58333e41cd71008bec1efab') in 0.171249 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009220 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.181 seconds +Domain Reload Profiling: + ReloadAssembly (1182ms) + BeginReloadAssembly (270ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (94ms) + EndReloadAssembly (804ms) + LoadAssemblies (142ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (310ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (188ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5429. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 5.136800 ms (FindLiveObjects: 0.420700 ms CreateObjectMapping: 0.292700 ms MarkObjects: 4.318100 ms DeleteObjects: 0.103300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010169 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.063 seconds +Domain Reload Profiling: + ReloadAssembly (1064ms) + BeginReloadAssembly (207ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (751ms) + LoadAssemblies (151ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (275ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5432. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 4.066900 ms (FindLiveObjects: 0.826700 ms CreateObjectMapping: 0.551100 ms MarkObjects: 2.658400 ms DeleteObjects: 0.027700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014061 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.014 seconds +Domain Reload Profiling: + ReloadAssembly (1015ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (751ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (278ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (281ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.05 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5435. +Memory consumption went from 165.1 MB to 165.0 MB. +Total: 3.178700 ms (FindLiveObjects: 0.450300 ms CreateObjectMapping: 0.370500 ms MarkObjects: 2.307500 ms DeleteObjects: 0.048100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 214.205639 seconds. + path: Assets/Scenes/WorldScene.unity + artifactKey: Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/WorldScene.unity using Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '523c83dc5164d4d8051d7b31e6b5338e') in 0.015766 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013571 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.019 seconds +Domain Reload Profiling: + ReloadAssembly (1020ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (754ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (272ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5438. +Memory consumption went from 165.1 MB to 165.0 MB. +Total: 2.951000 ms (FindLiveObjects: 0.395700 ms CreateObjectMapping: 0.213100 ms MarkObjects: 2.294400 ms DeleteObjects: 0.045400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012550 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.073 seconds +Domain Reload Profiling: + ReloadAssembly (1074ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (798ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (276ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (313ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (196ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.47 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5441. +Memory consumption went from 165.1 MB to 165.0 MB. +Total: 2.785600 ms (FindLiveObjects: 0.345500 ms CreateObjectMapping: 0.214500 ms MarkObjects: 2.196600 ms DeleteObjects: 0.027600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013150 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.030 seconds +Domain Reload Profiling: + ReloadAssembly (1031ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (758ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (292ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5444. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 4.639800 ms (FindLiveObjects: 0.831600 ms CreateObjectMapping: 0.503300 ms MarkObjects: 3.238300 ms DeleteObjects: 0.062400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010771 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.033 seconds +Domain Reload Profiling: + ReloadAssembly (1034ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (31ms) + EndReloadAssembly (793ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (298ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (311ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (189ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.32 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5447. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.950300 ms (FindLiveObjects: 0.380900 ms CreateObjectMapping: 0.209100 ms MarkObjects: 2.320400 ms DeleteObjects: 0.037400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014280 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.930 seconds +Domain Reload Profiling: + ReloadAssembly (930ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (670ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (249ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (249ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (149ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.48 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5450. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.842600 ms (FindLiveObjects: 0.450000 ms CreateObjectMapping: 0.196500 ms MarkObjects: 3.152300 ms DeleteObjects: 0.041400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012293 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.083 seconds +Domain Reload Profiling: + ReloadAssembly (1084ms) + BeginReloadAssembly (235ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (74ms) + EndReloadAssembly (738ms) + LoadAssemblies (138ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5453. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.480800 ms (FindLiveObjects: 0.764300 ms CreateObjectMapping: 0.264900 ms MarkObjects: 2.429500 ms DeleteObjects: 0.020900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015075 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.004 seconds +Domain Reload Profiling: + ReloadAssembly (1005ms) + BeginReloadAssembly (241ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (666ms) + LoadAssemblies (193ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (243ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (254ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (11ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5456. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 2.871400 ms (FindLiveObjects: 0.347000 ms CreateObjectMapping: 0.190000 ms MarkObjects: 2.314300 ms DeleteObjects: 0.019000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017395 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.066 seconds +Domain Reload Profiling: + ReloadAssembly (1067ms) + BeginReloadAssembly (173ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (788ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (311ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (258ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (158ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.97 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5459. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.652600 ms (FindLiveObjects: 0.334600 ms CreateObjectMapping: 0.182200 ms MarkObjects: 2.116400 ms DeleteObjects: 0.018600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010966 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.090 seconds +Domain Reload Profiling: + ReloadAssembly (1091ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (786ms) + LoadAssemblies (119ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (243ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (314ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (184ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5462. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.632300 ms (FindLiveObjects: 0.391500 ms CreateObjectMapping: 0.196200 ms MarkObjects: 2.017100 ms DeleteObjects: 0.026100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014081 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.014 seconds +Domain Reload Profiling: + ReloadAssembly (1015ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (739ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (308ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (247ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (147ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5465. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.478800 ms (FindLiveObjects: 0.315200 ms CreateObjectMapping: 0.190900 ms MarkObjects: 2.940300 ms DeleteObjects: 0.031100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011058 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.048 seconds +Domain Reload Profiling: + ReloadAssembly (1048ms) + BeginReloadAssembly (182ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (762ms) + LoadAssemblies (134ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (187ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5468. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.997300 ms (FindLiveObjects: 0.460500 ms CreateObjectMapping: 0.219900 ms MarkObjects: 3.283500 ms DeleteObjects: 0.031400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010854 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.124 seconds +Domain Reload Profiling: + ReloadAssembly (1125ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (850ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (305ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (337ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (199ms) + ProcessInitializeOnLoadMethodAttributes (41ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.05 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5471. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 3.540000 ms (FindLiveObjects: 0.564000 ms CreateObjectMapping: 0.388200 ms MarkObjects: 2.554400 ms DeleteObjects: 0.031300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015543 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.127 seconds +Domain Reload Profiling: + ReloadAssembly (1128ms) + BeginReloadAssembly (164ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (849ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (303ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (317ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (204ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5474. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 4.145700 ms (FindLiveObjects: 0.395900 ms CreateObjectMapping: 0.212900 ms MarkObjects: 3.500500 ms DeleteObjects: 0.034600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013248 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.139 seconds +Domain Reload Profiling: + ReloadAssembly (1140ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (863ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (331ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (291ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5477. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 3.429100 ms (FindLiveObjects: 0.337700 ms CreateObjectMapping: 0.180900 ms MarkObjects: 2.866600 ms DeleteObjects: 0.041700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012046 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.013 seconds +Domain Reload Profiling: + ReloadAssembly (1014ms) + BeginReloadAssembly (156ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (754ms) + LoadAssemblies (116ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (269ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5480. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.817400 ms (FindLiveObjects: 0.330400 ms CreateObjectMapping: 0.211500 ms MarkObjects: 2.248700 ms DeleteObjects: 0.025600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014805 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.259 seconds +Domain Reload Profiling: + ReloadAssembly (1260ms) + BeginReloadAssembly (234ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (12ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (59ms) + EndReloadAssembly (897ms) + LoadAssemblies (145ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (371ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (49ms) + SetupLoadedEditorAssemblies (316ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.41 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5483. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.513400 ms (FindLiveObjects: 0.372700 ms CreateObjectMapping: 0.188800 ms MarkObjects: 2.926700 ms DeleteObjects: 0.023500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009749 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.090 seconds +Domain Reload Profiling: + ReloadAssembly (1091ms) + BeginReloadAssembly (159ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (820ms) + LoadAssemblies (115ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (299ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (333ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (195ms) + ProcessInitializeOnLoadMethodAttributes (45ms) + AfterProcessingInitializeOnLoad (26ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5486. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 4.331000 ms (FindLiveObjects: 0.408600 ms CreateObjectMapping: 0.235400 ms MarkObjects: 3.645400 ms DeleteObjects: 0.039800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014925 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.001 seconds +Domain Reload Profiling: + ReloadAssembly (1001ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (751ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (276ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (300ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (186ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.28 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5489. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.756300 ms (FindLiveObjects: 0.524900 ms CreateObjectMapping: 0.281700 ms MarkObjects: 2.916800 ms DeleteObjects: 0.030500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.024434 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.014 seconds +Domain Reload Profiling: + ReloadAssembly (1015ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (751ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (284ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5492. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.237500 ms (FindLiveObjects: 0.386100 ms CreateObjectMapping: 0.202400 ms MarkObjects: 2.616100 ms DeleteObjects: 0.031200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012071 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.134 seconds +Domain Reload Profiling: + ReloadAssembly (1135ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (863ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (275ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (359ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (227ms) + ProcessInitializeOnLoadMethodAttributes (44ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.89 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5496. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.902800 ms (FindLiveObjects: 0.372900 ms CreateObjectMapping: 0.180900 ms MarkObjects: 2.313600 ms DeleteObjects: 0.034000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014259 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.17 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.250 seconds +Domain Reload Profiling: + ReloadAssembly (1251ms) + BeginReloadAssembly (183ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (952ms) + LoadAssemblies (150ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (341ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (375ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (146ms) + ProcessInitializeOnLoadAttributes (182ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5499. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.422500 ms (FindLiveObjects: 0.474200 ms CreateObjectMapping: 0.203000 ms MarkObjects: 2.520400 ms DeleteObjects: 0.223400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015376 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.21 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.117 seconds +Domain Reload Profiling: + ReloadAssembly (1118ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (852ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (62ms) + SetupLoadedEditorAssemblies (323ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (80ms) + ProcessInitializeOnLoadAttributes (197ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5502. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.654400 ms (FindLiveObjects: 0.382000 ms CreateObjectMapping: 0.175400 ms MarkObjects: 2.075300 ms DeleteObjects: 0.019900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010281 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.288 seconds +Domain Reload Profiling: + ReloadAssembly (1289ms) + BeginReloadAssembly (251ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (69ms) + EndReloadAssembly (849ms) + LoadAssemblies (174ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (361ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (305ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5505. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 3.259000 ms (FindLiveObjects: 0.394000 ms CreateObjectMapping: 0.196300 ms MarkObjects: 2.641600 ms DeleteObjects: 0.025800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.018670 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.989 seconds +Domain Reload Profiling: + ReloadAssembly (990ms) + BeginReloadAssembly (179ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (701ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (266ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (251ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (154ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5508. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 2.663500 ms (FindLiveObjects: 0.350100 ms CreateObjectMapping: 0.269200 ms MarkObjects: 2.021400 ms DeleteObjects: 0.022000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012572 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.053 seconds +Domain Reload Profiling: + ReloadAssembly (1053ms) + BeginReloadAssembly (212ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (81ms) + EndReloadAssembly (720ms) + LoadAssemblies (115ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (279ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (273ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.32 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5511. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.538700 ms (FindLiveObjects: 0.352300 ms CreateObjectMapping: 0.185300 ms MarkObjects: 1.982500 ms DeleteObjects: 0.017600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.033806 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 3.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.460 seconds +Domain Reload Profiling: + ReloadAssembly (2461ms) + BeginReloadAssembly (384ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (1ms) + CreateAndSetChildDomain (120ms) + EndReloadAssembly (1845ms) + LoadAssemblies (283ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (743ms) + ReleaseScriptCaches (6ms) + RebuildScriptCaches (126ms) + SetupLoadedEditorAssemblies (666ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (15ms) + SetLoadedEditorAssemblies (2ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (367ms) + ProcessInitializeOnLoadAttributes (229ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.87 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5514. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.604200 ms (FindLiveObjects: 0.374800 ms CreateObjectMapping: 0.196800 ms MarkObjects: 2.011600 ms DeleteObjects: 0.020000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.019295 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 7.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 6.398 seconds +Domain Reload Profiling: + ReloadAssembly (6400ms) + BeginReloadAssembly (560ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (130ms) + EndReloadAssembly (5599ms) + LoadAssemblies (482ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (1991ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (163ms) + SetupLoadedEditorAssemblies (2613ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (20ms) + SetLoadedEditorAssemblies (4ms) + RefreshPlugins (8ms) + BeforeProcessingInitializeOnLoad (297ms) + ProcessInitializeOnLoadAttributes (2170ms) + ProcessInitializeOnLoadMethodAttributes (86ms) + AfterProcessingInitializeOnLoad (27ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (20ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 7.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5517. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 8.195600 ms (FindLiveObjects: 1.195400 ms CreateObjectMapping: 1.423000 ms MarkObjects: 5.500200 ms DeleteObjects: 0.073300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012940 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.154 seconds +Domain Reload Profiling: + ReloadAssembly (1155ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (847ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (354ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5520. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.950600 ms (FindLiveObjects: 0.345500 ms CreateObjectMapping: 0.187300 ms MarkObjects: 2.382200 ms DeleteObjects: 0.034400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.030962 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 3.058 seconds +Domain Reload Profiling: + ReloadAssembly (3060ms) + BeginReloadAssembly (792ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (12ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (225ms) + EndReloadAssembly (1974ms) + LoadAssemblies (509ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (664ms) + ReleaseScriptCaches (5ms) + RebuildScriptCaches (128ms) + SetupLoadedEditorAssemblies (763ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (13ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (152ms) + ProcessInitializeOnLoadAttributes (498ms) + ProcessInitializeOnLoadMethodAttributes (69ms) + AfterProcessingInitializeOnLoad (26ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (19ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.92 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5523. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.875000 ms (FindLiveObjects: 0.363400 ms CreateObjectMapping: 0.204600 ms MarkObjects: 3.255100 ms DeleteObjects: 0.050000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 6708.278806 seconds. + path: Assets/Scenes/WorldScene.unity + artifactKey: Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/WorldScene.unity using Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '4f962369aaac45752996f73abd6478a8') in 0.026396 seconds +======================================================================== +Received Import Request. + Time since last request: 8.100557 seconds. + path: Assets/Scenes/UIScene.unity + artifactKey: Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/UIScene.unity using Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: 'b3e52d370d68356f435aed119c81e8f3') in 0.014453 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010549 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.523 seconds +Domain Reload Profiling: + ReloadAssembly (2524ms) + BeginReloadAssembly (436ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (13ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (117ms) + EndReloadAssembly (1520ms) + LoadAssemblies (526ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (604ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (66ms) + SetupLoadedEditorAssemblies (393ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (95ms) + ProcessInitializeOnLoadAttributes (240ms) + ProcessInitializeOnLoadMethodAttributes (33ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5526. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.405700 ms (FindLiveObjects: 0.680900 ms CreateObjectMapping: 0.292200 ms MarkObjects: 2.397800 ms DeleteObjects: 0.032500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 171.236428 seconds. + path: Assets/Scenes/WorldScene.unity + artifactKey: Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/WorldScene.unity using Guid(9249f4afb3db3c4489d1a29ea88a2f1c) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '6daf9d87d997415b2ebdeab8c08c1dbe') in 0.009537 seconds +======================================================================== +Received Import Request. + Time since last request: 0.486034 seconds. + path: Assets/Scenes/UIScene.unity + artifactKey: Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/UIScene.unity using Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '49567c6356087bf40ac00ef1024f1c4b') in 0.007231 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016494 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.095 seconds +Domain Reload Profiling: + ReloadAssembly (1096ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (805ms) + LoadAssemblies (136ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (315ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5529. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.734000 ms (FindLiveObjects: 0.681100 ms CreateObjectMapping: 0.342200 ms MarkObjects: 2.644000 ms DeleteObjects: 0.063400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017534 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.571 seconds +Domain Reload Profiling: + ReloadAssembly (1572ms) + BeginReloadAssembly (189ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (1246ms) + LoadAssemblies (138ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (398ms) + ReleaseScriptCaches (5ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (567ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (390ms) + ProcessInitializeOnLoadMethodAttributes (49ms) + AfterProcessingInitializeOnLoad (38ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (22ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.22 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5532. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.043200 ms (FindLiveObjects: 0.438800 ms CreateObjectMapping: 0.234900 ms MarkObjects: 2.334700 ms DeleteObjects: 0.032200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013529 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.159 seconds +Domain Reload Profiling: + ReloadAssembly (1160ms) + BeginReloadAssembly (202ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (817ms) + LoadAssemblies (143ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (308ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (293ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (175ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.44 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5535. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 4.397300 ms (FindLiveObjects: 0.372000 ms CreateObjectMapping: 0.278800 ms MarkObjects: 3.647000 ms DeleteObjects: 0.096400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010491 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.184 seconds +Domain Reload Profiling: + ReloadAssembly (1185ms) + BeginReloadAssembly (249ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (30ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (834ms) + LoadAssemblies (154ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (348ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (282ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5538. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.416800 ms (FindLiveObjects: 0.354700 ms CreateObjectMapping: 0.171800 ms MarkObjects: 1.873700 ms DeleteObjects: 0.015900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010467 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.03 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.151 seconds +Domain Reload Profiling: + ReloadAssembly (1152ms) + BeginReloadAssembly (201ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (793ms) + LoadAssemblies (132ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (190ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.40 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.1 KB). Loaded Objects now: 5541. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 3.993700 ms (FindLiveObjects: 0.507600 ms CreateObjectMapping: 0.220800 ms MarkObjects: 3.212500 ms DeleteObjects: 0.049400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014199 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.092 seconds +Domain Reload Profiling: + ReloadAssembly (1093ms) + BeginReloadAssembly (208ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (59ms) + EndReloadAssembly (760ms) + LoadAssemblies (154ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (287ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5544. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 2.559400 ms (FindLiveObjects: 0.341600 ms CreateObjectMapping: 0.178000 ms MarkObjects: 2.015600 ms DeleteObjects: 0.022700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010170 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.209 seconds +Domain Reload Profiling: + ReloadAssembly (1210ms) + BeginReloadAssembly (243ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (78ms) + EndReloadAssembly (811ms) + LoadAssemblies (143ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (292ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (312ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (196ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.43 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5547. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 4.745600 ms (FindLiveObjects: 0.789600 ms CreateObjectMapping: 0.720200 ms MarkObjects: 3.199900 ms DeleteObjects: 0.033500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> diff --git a/JNFrame/Logs/AssetImportWorker3.log b/JNFrame/Logs/AssetImportWorker3.log new file mode 100644 index 00000000..30c191b5 --- /dev/null +++ b/JNFrame/Logs/AssetImportWorker3.log @@ -0,0 +1,5378 @@ +Using pre-set license +Built from '2021.3/china_unity/release' branch; Version is '2021.3.27f1c2 (3b3d9646cb47) revision 3882390'; Using compiler version '192829333'; Build Type 'Release' +OS: 'Windows 11 (10.0.22621) 64bit Professional' Language: 'zh' Physical Memory: 32651 MB +BatchMode: 1, IsHumanControllingUs: 0, StartBugReporterOnCrash: 0, Is64bit: 1, IsPro: 1 + +COMMAND LINE ARGUMENTS: +D:\Unity\2021.3.27f1c2\Editor\Unity.exe +-adb2 +-batchMode +-noUpm +-name +AssetImportWorker3 +-projectPath +D:/myproject/unity/JNFrame +-logFile +Logs/AssetImportWorker3.log +-srvPort +64124 +Successfully changed project path to: D:/myproject/unity/JNFrame +D:/myproject/unity/JNFrame +[UnityMemory] Configuration Parameters - Can be set up in boot.config + "memorysetup-bucket-allocator-granularity=16" + "memorysetup-bucket-allocator-bucket-count=8" + "memorysetup-bucket-allocator-block-size=33554432" + "memorysetup-bucket-allocator-block-count=8" + "memorysetup-main-allocator-block-size=16777216" + "memorysetup-thread-allocator-block-size=16777216" + "memorysetup-gfx-main-allocator-block-size=16777216" + "memorysetup-gfx-thread-allocator-block-size=16777216" + "memorysetup-cache-allocator-block-size=4194304" + "memorysetup-typetree-allocator-block-size=2097152" + "memorysetup-profiler-bucket-allocator-granularity=16" + "memorysetup-profiler-bucket-allocator-bucket-count=8" + "memorysetup-profiler-bucket-allocator-block-size=33554432" + "memorysetup-profiler-bucket-allocator-block-count=8" + "memorysetup-profiler-allocator-block-size=16777216" + "memorysetup-profiler-editor-allocator-block-size=1048576" + "memorysetup-temp-allocator-size-main=16777216" + "memorysetup-job-temp-allocator-block-size=2097152" + "memorysetup-job-temp-allocator-block-size-background=1048576" + "memorysetup-job-temp-allocator-reduction-small-platforms=262144" + "memorysetup-temp-allocator-size-background-worker=32768" + "memorysetup-temp-allocator-size-job-worker=262144" + "memorysetup-temp-allocator-size-preload-manager=33554432" + "memorysetup-temp-allocator-size-nav-mesh-worker=65536" + "memorysetup-temp-allocator-size-audio-worker=65536" + "memorysetup-temp-allocator-size-cloud-worker=32768" + "memorysetup-temp-allocator-size-gi-baking-worker=262144" + "memorysetup-temp-allocator-size-gfx=262144" +Player connection [16364] Host "[IP] 192.168.0.130 [Port] 0 [Flags] 2 [Guid] 1377031761 [EditorId] 1377031761 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined multi-casting on [225.0.0.222:54997]... + +Player connection [16364] Host "[IP] 192.168.0.130 [Port] 0 [Flags] 2 [Guid] 1377031761 [EditorId] 1377031761 [Version] 1048832 [Id] WindowsEditor(7,PC-20230316NUNE) [Debug] 1 [PackageName] WindowsEditor [ProjectName] Editor" joined alternative multi-casting on [225.0.0.222:34997]... + +AS: AutoStreaming module initializing. +Refreshing native plugins compatible for Editor in 107.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Initialize engine version: 2021.3.27f1c2 (3b3d9646cb47) +[Subsystems] Discovering subsystems at path D:/Unity/2021.3.27f1c2/Editor/Data/Resources/UnitySubsystems +[Subsystems] Discovering subsystems at path D:/myproject/unity/JNFrame/Assets +GfxDevice: creating device client; threaded=0; jobified=0 +Direct3D: + Version: Direct3D 11.0 [level 11.1] + Renderer: NVIDIA GeForce GTX 1660 SUPER (ID=0x21c4) + Vendor: NVIDIA + VRAM: 5980 MB + Driver: 31.0.15.3623 +Initialize mono +Mono path[0] = 'D:/Unity/2021.3.27f1c2/Editor/Data/Managed' +Mono path[1] = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/lib/mono/unityjit-win32' +Mono config path = 'D:/Unity/2021.3.27f1c2/Editor/Data/MonoBleedingEdge/etc' +Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,server=y,suspend=n,address=127.0.0.1:56884 +Begin MonoManager ReloadAssembly +Registering precompiled unity dll's ... +Register platform support module: D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll +Registered in 0.006134 seconds. +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 84.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.888 seconds +Domain Reload Profiling: + ReloadAssembly (888ms) + BeginReloadAssembly (107ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (0ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (1ms) + EndReloadAssembly (544ms) + LoadAssemblies (99ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (236ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (22ms) + SetupLoadedEditorAssemblies (237ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (85ms) + BeforeProcessingInitializeOnLoad (1ms) + ProcessInitializeOnLoadAttributes (94ms) + ProcessInitializeOnLoadMethodAttributes (50ms) + AfterProcessingInitializeOnLoad (0ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (0ms) +Platform modules already initialized, skipping +Registering precompiled user dll's ... +Registered in 0.014124 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.341 seconds +Domain Reload Profiling: + ReloadAssembly (1342ms) + BeginReloadAssembly (128ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (19ms) + EndReloadAssembly (1103ms) + LoadAssemblies (114ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (317ms) + ReleaseScriptCaches (0ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (594ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (86ms) + ProcessInitializeOnLoadAttributes (460ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +======================================================================== +Worker process is ready to serve import requests +Launched and connected shader compiler UnityShaderCompiler.exe after 0.11 seconds +Refreshing native plugins compatible for Editor in 0.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4807 Unused Serialized files (Serialized files now loaded: 0) +Unloading 30 unused Assets / (46.7 KB). Loaded Objects now: 5266. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 5.253300 ms (FindLiveObjects: 0.419500 ms CreateObjectMapping: 0.179800 ms MarkObjects: 4.472700 ms DeleteObjects: 0.179400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012423 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.104 seconds +Domain Reload Profiling: + ReloadAssembly (1104ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (829ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (358ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.19 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5269. +Memory consumption went from 164.3 MB to 164.3 MB. +Total: 3.101700 ms (FindLiveObjects: 0.602300 ms CreateObjectMapping: 0.324000 ms MarkObjects: 2.144000 ms DeleteObjects: 0.030500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011026 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.978 seconds +Domain Reload Profiling: + ReloadAssembly (979ms) + BeginReloadAssembly (165ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (710ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (274ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (250ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (151ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.75 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5272. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 3.250900 ms (FindLiveObjects: 0.445300 ms CreateObjectMapping: 0.238000 ms MarkObjects: 2.525600 ms DeleteObjects: 0.040600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011136 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.167 seconds +Domain Reload Profiling: + ReloadAssembly (1167ms) + BeginReloadAssembly (178ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (872ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (376ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (293ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5275. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 3.076700 ms (FindLiveObjects: 0.324100 ms CreateObjectMapping: 0.138800 ms MarkObjects: 2.566400 ms DeleteObjects: 0.045800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012953 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.935 seconds +Domain Reload Profiling: + ReloadAssembly (936ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (693ms) + LoadAssemblies (105ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (236ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5278. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 5.247500 ms (FindLiveObjects: 1.213100 ms CreateObjectMapping: 0.662600 ms MarkObjects: 3.311100 ms DeleteObjects: 0.057800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010846 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.959 seconds +Domain Reload Profiling: + ReloadAssembly (960ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (697ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (268ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (253ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (154ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.42 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5281. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 4.256600 ms (FindLiveObjects: 0.430700 ms CreateObjectMapping: 0.208800 ms MarkObjects: 3.533700 ms DeleteObjects: 0.079700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011293 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.26 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.068 seconds +Domain Reload Profiling: + ReloadAssembly (1069ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (770ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (330ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (251ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (151ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.85 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5284. +Memory consumption went from 164.4 MB to 164.3 MB. +Total: 2.367500 ms (FindLiveObjects: 0.343500 ms CreateObjectMapping: 0.172300 ms MarkObjects: 1.829600 ms DeleteObjects: 0.021100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015991 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.51 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.124 seconds +Domain Reload Profiling: + ReloadAssembly (1125ms) + BeginReloadAssembly (185ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (53ms) + EndReloadAssembly (803ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (254ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (354ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (2ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (92ms) + ProcessInitializeOnLoadAttributes (202ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5287. +Memory consumption went from 164.6 MB to 164.5 MB. +Total: 2.815400 ms (FindLiveObjects: 0.395800 ms CreateObjectMapping: 0.163400 ms MarkObjects: 2.221900 ms DeleteObjects: 0.032200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012511 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.069 seconds +Domain Reload Profiling: + ReloadAssembly (1070ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (796ms) + LoadAssemblies (126ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (340ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (226ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.15 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5290. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.797200 ms (FindLiveObjects: 0.408000 ms CreateObjectMapping: 0.166100 ms MarkObjects: 2.189200 ms DeleteObjects: 0.032700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015135 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.999 seconds +Domain Reload Profiling: + ReloadAssembly (1000ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (738ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (251ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.41 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5293. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.724100 ms (FindLiveObjects: 0.361200 ms CreateObjectMapping: 0.177400 ms MarkObjects: 3.152200 ms DeleteObjects: 0.032200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012564 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.925 seconds +Domain Reload Profiling: + ReloadAssembly (926ms) + BeginReloadAssembly (150ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (685ms) + LoadAssemblies (103ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (263ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (259ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (154ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5296. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.979300 ms (FindLiveObjects: 0.351700 ms CreateObjectMapping: 0.199100 ms MarkObjects: 2.390700 ms DeleteObjects: 0.035800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012351 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.918 seconds +Domain Reload Profiling: + ReloadAssembly (919ms) + BeginReloadAssembly (144ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (679ms) + LoadAssemblies (106ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (255ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (254ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (152ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.47 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5299. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.319000 ms (FindLiveObjects: 0.276500 ms CreateObjectMapping: 0.141000 ms MarkObjects: 1.875600 ms DeleteObjects: 0.025300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017344 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.364 seconds +Domain Reload Profiling: + ReloadAssembly (1365ms) + BeginReloadAssembly (188ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (1038ms) + LoadAssemblies (134ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (419ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (68ms) + SetupLoadedEditorAssemblies (372ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (85ms) + ProcessInitializeOnLoadAttributes (223ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (27ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.97 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5302. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.981500 ms (FindLiveObjects: 0.750300 ms CreateObjectMapping: 0.403500 ms MarkObjects: 2.749700 ms DeleteObjects: 0.074600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015914 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.30 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.959 seconds +Domain Reload Profiling: + ReloadAssembly (959ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (696ms) + LoadAssemblies (113ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (226ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (286ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 7.21 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5305. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 6.557100 ms (FindLiveObjects: 0.914500 ms CreateObjectMapping: 0.754700 ms MarkObjects: 4.837500 ms DeleteObjects: 0.048300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014759 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.044 seconds +Domain Reload Profiling: + ReloadAssembly (1045ms) + BeginReloadAssembly (186ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (748ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (282ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (40ms) + SetupLoadedEditorAssemblies (285ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5308. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.768200 ms (FindLiveObjects: 0.693000 ms CreateObjectMapping: 0.674900 ms MarkObjects: 2.349700 ms DeleteObjects: 0.040400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013945 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.158 seconds +Domain Reload Profiling: + ReloadAssembly (1159ms) + BeginReloadAssembly (216ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (60ms) + EndReloadAssembly (817ms) + LoadAssemblies (158ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (337ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (274ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (65ms) + ProcessInitializeOnLoadAttributes (162ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5311. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.683900 ms (FindLiveObjects: 0.334000 ms CreateObjectMapping: 0.170100 ms MarkObjects: 2.156300 ms DeleteObjects: 0.022200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015718 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.024 seconds +Domain Reload Profiling: + ReloadAssembly (1025ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (729ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (272ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (271ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5314. +Memory consumption went from 164.4 MB to 164.4 MB. +Total: 2.437900 ms (FindLiveObjects: 0.326100 ms CreateObjectMapping: 0.156100 ms MarkObjects: 1.927200 ms DeleteObjects: 0.027400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014162 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.73 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.972 seconds +Domain Reload Profiling: + ReloadAssembly (972ms) + BeginReloadAssembly (161ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (712ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (266ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5317. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.332300 ms (FindLiveObjects: 0.280700 ms CreateObjectMapping: 0.144500 ms MarkObjects: 1.890400 ms DeleteObjects: 0.015700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010685 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.037 seconds +Domain Reload Profiling: + ReloadAssembly (1038ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (33ms) + EndReloadAssembly (784ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (257ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (314ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (195ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5320. +Memory consumption went from 164.7 MB to 164.6 MB. +Total: 2.728800 ms (FindLiveObjects: 0.301600 ms CreateObjectMapping: 0.155600 ms MarkObjects: 2.250100 ms DeleteObjects: 0.020300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010810 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.919 seconds +Domain Reload Profiling: + ReloadAssembly (919ms) + BeginReloadAssembly (151ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (675ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (254ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (254ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (157ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5323. +Memory consumption went from 164.7 MB to 164.6 MB. +Total: 2.700000 ms (FindLiveObjects: 0.469400 ms CreateObjectMapping: 0.318900 ms MarkObjects: 1.884800 ms DeleteObjects: 0.025800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009763 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.38 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.928 seconds +Domain Reload Profiling: + ReloadAssembly (928ms) + BeginReloadAssembly (141ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (698ms) + LoadAssemblies (98ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (240ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (174ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5326. +Memory consumption went from 164.7 MB to 164.6 MB. +Total: 2.949300 ms (FindLiveObjects: 0.491200 ms CreateObjectMapping: 0.257000 ms MarkObjects: 2.182900 ms DeleteObjects: 0.017400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012480 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.122 seconds +Domain Reload Profiling: + ReloadAssembly (1123ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (852ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (276ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (390ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (254ms) + ProcessInitializeOnLoadMethodAttributes (36ms) + AfterProcessingInitializeOnLoad (26ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5329. +Memory consumption went from 164.5 MB to 164.5 MB. +Total: 3.308500 ms (FindLiveObjects: 0.367800 ms CreateObjectMapping: 0.185700 ms MarkObjects: 2.717200 ms DeleteObjects: 0.036100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013418 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.904 seconds +Domain Reload Profiling: + ReloadAssembly (905ms) + BeginReloadAssembly (152ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (652ms) + LoadAssemblies (102ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (238ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (253ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (55ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.96 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5332. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.912300 ms (FindLiveObjects: 0.513400 ms CreateObjectMapping: 0.202000 ms MarkObjects: 2.163100 ms DeleteObjects: 0.032100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010348 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.027 seconds +Domain Reload Profiling: + ReloadAssembly (1028ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (724ms) + LoadAssemblies (151ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (265ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (72ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (20ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5335. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 3.748100 ms (FindLiveObjects: 0.549600 ms CreateObjectMapping: 0.322400 ms MarkObjects: 2.843900 ms DeleteObjects: 0.030200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013303 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.42 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.825 seconds +Domain Reload Profiling: + ReloadAssembly (1826ms) + BeginReloadAssembly (243ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (63ms) + EndReloadAssembly (1330ms) + LoadAssemblies (190ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (681ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (72ms) + SetupLoadedEditorAssemblies (347ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (2ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (83ms) + ProcessInitializeOnLoadAttributes (201ms) + ProcessInitializeOnLoadMethodAttributes (36ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 11.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5338. +Memory consumption went from 164.8 MB to 164.7 MB. +Total: 2.745000 ms (FindLiveObjects: 0.582400 ms CreateObjectMapping: 0.223800 ms MarkObjects: 1.907000 ms DeleteObjects: 0.029900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.023372 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.898 seconds +Domain Reload Profiling: + ReloadAssembly (1899ms) + BeginReloadAssembly (255ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (1484ms) + LoadAssemblies (227ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (582ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (76ms) + SetupLoadedEditorAssemblies (571ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (224ms) + ProcessInitializeOnLoadAttributes (270ms) + ProcessInitializeOnLoadMethodAttributes (51ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.51 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5341. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 7.671100 ms (FindLiveObjects: 1.113600 ms CreateObjectMapping: 0.763900 ms MarkObjects: 5.671500 ms DeleteObjects: 0.118500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012327 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.82 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.528 seconds +Domain Reload Profiling: + ReloadAssembly (1529ms) + BeginReloadAssembly (259ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (1106ms) + LoadAssemblies (177ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (346ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (59ms) + SetupLoadedEditorAssemblies (497ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (115ms) + ProcessInitializeOnLoadAttributes (294ms) + ProcessInitializeOnLoadMethodAttributes (56ms) + AfterProcessingInitializeOnLoad (21ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (15ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.08 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5344. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 3.985200 ms (FindLiveObjects: 0.467700 ms CreateObjectMapping: 0.277900 ms MarkObjects: 3.157100 ms DeleteObjects: 0.080300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015403 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.086 seconds +Domain Reload Profiling: + ReloadAssembly (1087ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (803ms) + LoadAssemblies (138ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (294ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (13ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5347. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 5.226700 ms (FindLiveObjects: 0.604800 ms CreateObjectMapping: 0.360800 ms MarkObjects: 4.215000 ms DeleteObjects: 0.043800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013261 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.11 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.935 seconds +Domain Reload Profiling: + ReloadAssembly (935ms) + BeginReloadAssembly (149ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (693ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (264ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (30ms) + SetupLoadedEditorAssemblies (264ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5350. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 3.008300 ms (FindLiveObjects: 0.315200 ms CreateObjectMapping: 0.202900 ms MarkObjects: 2.463300 ms DeleteObjects: 0.025700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012861 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.727 seconds +Domain Reload Profiling: + ReloadAssembly (1730ms) + BeginReloadAssembly (423ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (15ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (170ms) + EndReloadAssembly (1089ms) + LoadAssemblies (222ms) + RebuildTransferFunctionScriptingTraits (1ms) + SetupTypeCache (440ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (63ms) + SetupLoadedEditorAssemblies (356ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (217ms) + ProcessInitializeOnLoadMethodAttributes (34ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5353. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 4.229400 ms (FindLiveObjects: 0.388100 ms CreateObjectMapping: 0.237100 ms MarkObjects: 3.431500 ms DeleteObjects: 0.170100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010304 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.063 seconds +Domain Reload Profiling: + ReloadAssembly (1064ms) + BeginReloadAssembly (191ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (764ms) + LoadAssemblies (146ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (300ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (268ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.39 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5356. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 5.713800 ms (FindLiveObjects: 1.962900 ms CreateObjectMapping: 0.797500 ms MarkObjects: 2.909600 ms DeleteObjects: 0.038500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.021402 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.195 seconds +Domain Reload Profiling: + ReloadAssembly (1196ms) + BeginReloadAssembly (246ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (60ms) + EndReloadAssembly (828ms) + LoadAssemblies (169ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (282ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (337ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (217ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.47 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5359. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 4.822700 ms (FindLiveObjects: 0.784900 ms CreateObjectMapping: 0.529500 ms MarkObjects: 3.465900 ms DeleteObjects: 0.040900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013001 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.13 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.172 seconds +Domain Reload Profiling: + ReloadAssembly (1173ms) + BeginReloadAssembly (213ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (849ms) + LoadAssemblies (170ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (336ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5362. +Memory consumption went from 164.6 MB to 164.6 MB. +Total: 2.295300 ms (FindLiveObjects: 0.364500 ms CreateObjectMapping: 0.173100 ms MarkObjects: 1.737600 ms DeleteObjects: 0.018600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010218 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.091 seconds +Domain Reload Profiling: + ReloadAssembly (1093ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (33ms) + EndReloadAssembly (807ms) + LoadAssemblies (145ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (315ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (62ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (71ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5366. +Memory consumption went from 164.9 MB to 164.8 MB. +Total: 2.553300 ms (FindLiveObjects: 0.304300 ms CreateObjectMapping: 0.171800 ms MarkObjects: 2.055600 ms DeleteObjects: 0.020500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009861 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.109 seconds +Domain Reload Profiling: + ReloadAssembly (1110ms) + BeginReloadAssembly (219ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (68ms) + EndReloadAssembly (779ms) + LoadAssemblies (152ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (301ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (278ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5369. +Memory consumption went from 164.9 MB to 164.8 MB. +Total: 2.966500 ms (FindLiveObjects: 0.328500 ms CreateObjectMapping: 0.172300 ms MarkObjects: 2.394000 ms DeleteObjects: 0.069100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017244 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.120 seconds +Domain Reload Profiling: + ReloadAssembly (1121ms) + BeginReloadAssembly (201ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (789ms) + LoadAssemblies (155ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (293ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (176ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5372. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 4.185600 ms (FindLiveObjects: 0.309200 ms CreateObjectMapping: 0.195000 ms MarkObjects: 3.603100 ms DeleteObjects: 0.075500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014255 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.987 seconds +Domain Reload Profiling: + ReloadAssembly (987ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (720ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (259ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5375. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 3.132700 ms (FindLiveObjects: 0.314900 ms CreateObjectMapping: 0.157500 ms MarkObjects: 2.623200 ms DeleteObjects: 0.035900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.024262 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.221 seconds +Domain Reload Profiling: + ReloadAssembly (1222ms) + BeginReloadAssembly (228ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (853ms) + LoadAssemblies (172ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (342ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (291ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (167ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.31 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5379. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 4.132100 ms (FindLiveObjects: 1.178000 ms CreateObjectMapping: 0.348300 ms MarkObjects: 2.567100 ms DeleteObjects: 0.035500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014730 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.020 seconds +Domain Reload Profiling: + ReloadAssembly (1020ms) + BeginReloadAssembly (186ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (732ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (251ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (278ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (169ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4800 Unused Serialized files (Serialized files now loaded: 0) +Unloading 25 unused Assets / (22.0 KB). Loaded Objects now: 5380. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 3.258100 ms (FindLiveObjects: 0.414100 ms CreateObjectMapping: 0.169700 ms MarkObjects: 2.615800 ms DeleteObjects: 0.055700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Import Request. + Time since last request: 103041.455637 seconds. + path: Assets/Scenes/UIScene.unity + artifactKey: Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) +Start importing Assets/Scenes/UIScene.unity using Guid(786aa53c6477525459c2f878d3c43a13) Importer(815301076,1909f56bfc062723c751e8b465ee728b) -> (artifact id: '495c24f6b126b511a15c6277f8c7e5e2') in 0.024619 seconds +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012542 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.099 seconds +Domain Reload Profiling: + ReloadAssembly (1099ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (808ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (311ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (302ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (179ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.18 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5384. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.881400 ms (FindLiveObjects: 0.329900 ms CreateObjectMapping: 0.168600 ms MarkObjects: 2.362500 ms DeleteObjects: 0.019300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.017894 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.094 seconds +Domain Reload Profiling: + ReloadAssembly (1094ms) + BeginReloadAssembly (176ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (797ms) + LoadAssemblies (135ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (259ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (58ms) + SetupLoadedEditorAssemblies (312ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (84ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.94 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5387. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 3.589300 ms (FindLiveObjects: 0.383900 ms CreateObjectMapping: 0.283800 ms MarkObjects: 2.875900 ms DeleteObjects: 0.031300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010287 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.179 seconds +Domain Reload Profiling: + ReloadAssembly (1179ms) + BeginReloadAssembly (217ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (49ms) + EndReloadAssembly (848ms) + LoadAssemblies (178ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (325ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (295ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (83ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.30 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5390. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.346800 ms (FindLiveObjects: 0.378500 ms CreateObjectMapping: 0.152000 ms MarkObjects: 1.796800 ms DeleteObjects: 0.018800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011593 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.88 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.975 seconds +Domain Reload Profiling: + ReloadAssembly (976ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (711ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (249ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (272ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5393. +Memory consumption went from 164.7 MB to 164.7 MB. +Total: 2.675600 ms (FindLiveObjects: 0.345400 ms CreateObjectMapping: 0.188500 ms MarkObjects: 2.099900 ms DeleteObjects: 0.040600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010085 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.001 seconds +Domain Reload Profiling: + ReloadAssembly (1002ms) + BeginReloadAssembly (168ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (48ms) + EndReloadAssembly (732ms) + LoadAssemblies (115ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (247ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5396. +Memory consumption went from 164.9 MB to 164.9 MB. +Total: 2.789200 ms (FindLiveObjects: 0.309000 ms CreateObjectMapping: 0.180900 ms MarkObjects: 2.276300 ms DeleteObjects: 0.022000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012630 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.992 seconds +Domain Reload Profiling: + ReloadAssembly (993ms) + BeginReloadAssembly (160ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (715ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (253ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (39ms) + SetupLoadedEditorAssemblies (276ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (160ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5399. +Memory consumption went from 165.0 MB to 164.9 MB. +Total: 3.511600 ms (FindLiveObjects: 0.501100 ms CreateObjectMapping: 0.322100 ms MarkObjects: 2.662500 ms DeleteObjects: 0.024300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020809 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.015 seconds +Domain Reload Profiling: + ReloadAssembly (1016ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (755ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (265ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (290ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (186ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.98 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5402. +Memory consumption went from 165.0 MB to 164.9 MB. +Total: 2.505400 ms (FindLiveObjects: 0.343700 ms CreateObjectMapping: 0.163700 ms MarkObjects: 1.976500 ms DeleteObjects: 0.020600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016878 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.079 seconds +Domain Reload Profiling: + ReloadAssembly (1080ms) + BeginReloadAssembly (196ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (9ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (765ms) + LoadAssemblies (145ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (295ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (280ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (170ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5405. +Memory consumption went from 165.0 MB to 164.9 MB. +Total: 3.818700 ms (FindLiveObjects: 0.853500 ms CreateObjectMapping: 0.354700 ms MarkObjects: 2.580700 ms DeleteObjects: 0.028200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.016151 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.56 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.252 seconds +Domain Reload Profiling: + ReloadAssembly (1253ms) + BeginReloadAssembly (202ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (913ms) + LoadAssemblies (160ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (329ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (54ms) + SetupLoadedEditorAssemblies (327ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (215ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5408. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 5.118600 ms (FindLiveObjects: 1.390300 ms CreateObjectMapping: 0.391000 ms MarkObjects: 3.207200 ms DeleteObjects: 0.126300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015454 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.117 seconds +Domain Reload Profiling: + ReloadAssembly (1117ms) + BeginReloadAssembly (178ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (823ms) + LoadAssemblies (140ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (289ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (44ms) + SetupLoadedEditorAssemblies (316ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (192ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5411. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 3.660300 ms (FindLiveObjects: 0.313600 ms CreateObjectMapping: 0.148400 ms MarkObjects: 3.163700 ms DeleteObjects: 0.033000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013139 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.14 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.322 seconds +Domain Reload Profiling: + ReloadAssembly (1323ms) + BeginReloadAssembly (260ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (70ms) + EndReloadAssembly (939ms) + LoadAssemblies (221ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (352ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (328ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (81ms) + ProcessInitializeOnLoadAttributes (198ms) + ProcessInitializeOnLoadMethodAttributes (26ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.34 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5414. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 2.418700 ms (FindLiveObjects: 0.328200 ms CreateObjectMapping: 0.159000 ms MarkObjects: 1.912000 ms DeleteObjects: 0.018500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011933 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.096 seconds +Domain Reload Profiling: + ReloadAssembly (1096ms) + BeginReloadAssembly (182ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (796ms) + LoadAssemblies (121ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (309ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (47ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (159ms) + ProcessInitializeOnLoadMethodAttributes (31ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.79 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5417. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 2.564400 ms (FindLiveObjects: 0.398200 ms CreateObjectMapping: 0.189600 ms MarkObjects: 1.956000 ms DeleteObjects: 0.019400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010119 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.908 seconds +Domain Reload Profiling: + ReloadAssembly (909ms) + BeginReloadAssembly (146ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (654ms) + LoadAssemblies (101ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (235ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (34ms) + SetupLoadedEditorAssemblies (252ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (153ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.67 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5420. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 2.816600 ms (FindLiveObjects: 0.340800 ms CreateObjectMapping: 0.186300 ms MarkObjects: 2.258400 ms DeleteObjects: 0.029700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009495 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.011 seconds +Domain Reload Profiling: + ReloadAssembly (1012ms) + BeginReloadAssembly (163ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (738ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (250ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (277ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5423. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 3.195300 ms (FindLiveObjects: 0.760400 ms CreateObjectMapping: 0.361100 ms MarkObjects: 2.036800 ms DeleteObjects: 0.036000 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012210 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.86 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.029 seconds +Domain Reload Profiling: + ReloadAssembly (1029ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (36ms) + EndReloadAssembly (766ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (293ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (291ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (184ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.19 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5426. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 2.776300 ms (FindLiveObjects: 0.336000 ms CreateObjectMapping: 0.179600 ms MarkObjects: 2.229900 ms DeleteObjects: 0.029200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013352 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.177 seconds +Domain Reload Profiling: + ReloadAssembly (1180ms) + BeginReloadAssembly (273ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (11ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (96ms) + EndReloadAssembly (800ms) + LoadAssemblies (133ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (317ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (76ms) + ProcessInitializeOnLoadAttributes (187ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.20 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5429. +Memory consumption went from 164.8 MB to 164.8 MB. +Total: 5.235100 ms (FindLiveObjects: 0.455200 ms CreateObjectMapping: 0.203000 ms MarkObjects: 4.385900 ms DeleteObjects: 0.185800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011112 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.062 seconds +Domain Reload Profiling: + ReloadAssembly (1063ms) + BeginReloadAssembly (207ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (751ms) + LoadAssemblies (153ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (284ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (42ms) + SetupLoadedEditorAssemblies (269ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5432. +Memory consumption went from 165.0 MB to 165.0 MB. +Total: 3.431800 ms (FindLiveObjects: 0.754100 ms CreateObjectMapping: 0.282600 ms MarkObjects: 2.365900 ms DeleteObjects: 0.026900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.019743 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.021 seconds +Domain Reload Profiling: + ReloadAssembly (1022ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (35ms) + EndReloadAssembly (760ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (283ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (280ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (165ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.48 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5435. +Memory consumption went from 165.1 MB to 165.0 MB. +Total: 4.258300 ms (FindLiveObjects: 1.415500 ms CreateObjectMapping: 0.632600 ms MarkObjects: 2.177000 ms DeleteObjects: 0.031100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013544 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.036 seconds +Domain Reload Profiling: + ReloadAssembly (1037ms) + BeginReloadAssembly (169ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (765ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (296ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (291ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (188ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (7ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.83 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5438. +Memory consumption went from 165.1 MB to 165.0 MB. +Total: 3.097900 ms (FindLiveObjects: 0.703500 ms CreateObjectMapping: 0.251500 ms MarkObjects: 2.106300 ms DeleteObjects: 0.032200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013457 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.082 seconds +Domain Reload Profiling: + ReloadAssembly (1083ms) + BeginReloadAssembly (166ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (812ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (310ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (197ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.24 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5441. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.961700 ms (FindLiveObjects: 0.507600 ms CreateObjectMapping: 0.304600 ms MarkObjects: 2.107200 ms DeleteObjects: 0.040800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010430 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.034 seconds +Domain Reload Profiling: + ReloadAssembly (1035ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (753ms) + LoadAssemblies (110ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (276ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (289ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (59ms) + ProcessInitializeOnLoadAttributes (181ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (23.0 KB). Loaded Objects now: 5444. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 4.933900 ms (FindLiveObjects: 0.620400 ms CreateObjectMapping: 0.744700 ms MarkObjects: 3.520800 ms DeleteObjects: 0.045300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009967 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.91 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.042 seconds +Domain Reload Profiling: + ReloadAssembly (1042ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (41ms) + EndReloadAssembly (790ms) + LoadAssemblies (103ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (318ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (74ms) + ProcessInitializeOnLoadAttributes (190ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.10 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5447. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.082900 ms (FindLiveObjects: 0.336200 ms CreateObjectMapping: 0.308800 ms MarkObjects: 2.407300 ms DeleteObjects: 0.029100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014717 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.58 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.933 seconds +Domain Reload Profiling: + ReloadAssembly (933ms) + BeginReloadAssembly (167ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (56ms) + EndReloadAssembly (661ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (244ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (31ms) + SetupLoadedEditorAssemblies (245ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (147ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 6.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5450. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.516100 ms (FindLiveObjects: 0.386200 ms CreateObjectMapping: 0.244300 ms MarkObjects: 1.857000 ms DeleteObjects: 0.027800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012299 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.066 seconds +Domain Reload Profiling: + ReloadAssembly (1067ms) + BeginReloadAssembly (236ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (57ms) + EndReloadAssembly (720ms) + LoadAssemblies (150ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (261ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (33ms) + SetupLoadedEditorAssemblies (274ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (63ms) + ProcessInitializeOnLoadAttributes (164ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.04 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5453. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.837400 ms (FindLiveObjects: 0.309900 ms CreateObjectMapping: 0.187400 ms MarkObjects: 2.309900 ms DeleteObjects: 0.029200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014819 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.018 seconds +Domain Reload Profiling: + ReloadAssembly (1019ms) + BeginReloadAssembly (244ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (42ms) + EndReloadAssembly (677ms) + LoadAssemblies (191ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (245ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (258ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (58ms) + ProcessInitializeOnLoadAttributes (161ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.74 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5456. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.713500 ms (FindLiveObjects: 0.308500 ms CreateObjectMapping: 0.162800 ms MarkObjects: 2.222700 ms DeleteObjects: 0.018300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013768 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.07 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.081 seconds +Domain Reload Profiling: + ReloadAssembly (1082ms) + BeginReloadAssembly (173ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (811ms) + LoadAssemblies (111ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (294ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (54ms) + SetupLoadedEditorAssemblies (291ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (73ms) + ProcessInitializeOnLoadAttributes (171ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.69 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5459. +Memory consumption went from 165.1 MB to 165.1 MB. +Total: 3.050500 ms (FindLiveObjects: 0.311700 ms CreateObjectMapping: 0.164900 ms MarkObjects: 2.542600 ms DeleteObjects: 0.029600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014805 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.03 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.093 seconds +Domain Reload Profiling: + ReloadAssembly (1093ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (790ms) + LoadAssemblies (123ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (248ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (307ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (75ms) + ProcessInitializeOnLoadAttributes (184ms) + ProcessInitializeOnLoadMethodAttributes (22ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5462. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.008300 ms (FindLiveObjects: 0.451400 ms CreateObjectMapping: 0.230400 ms MarkObjects: 2.298900 ms DeleteObjects: 0.025800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013219 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.028 seconds +Domain Reload Profiling: + ReloadAssembly (1029ms) + BeginReloadAssembly (162ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (38ms) + EndReloadAssembly (745ms) + LoadAssemblies (125ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (316ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (249ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (56ms) + ProcessInitializeOnLoadAttributes (147ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.30 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5465. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.720300 ms (FindLiveObjects: 0.391600 ms CreateObjectMapping: 0.182300 ms MarkObjects: 2.124100 ms DeleteObjects: 0.021300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012301 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.68 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.056 seconds +Domain Reload Profiling: + ReloadAssembly (1057ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (773ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (273ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (308ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (191ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (20ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.70 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5468. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.760000 ms (FindLiveObjects: 0.470500 ms CreateObjectMapping: 0.230400 ms MarkObjects: 2.035700 ms DeleteObjects: 0.021900 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014871 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.31 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.125 seconds +Domain Reload Profiling: + ReloadAssembly (1126ms) + BeginReloadAssembly (172ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (46ms) + EndReloadAssembly (837ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (302ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (41ms) + SetupLoadedEditorAssemblies (326ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (69ms) + ProcessInitializeOnLoadAttributes (193ms) + ProcessInitializeOnLoadMethodAttributes (40ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.06 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5471. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 3.021200 ms (FindLiveObjects: 0.406400 ms CreateObjectMapping: 0.245600 ms MarkObjects: 2.334700 ms DeleteObjects: 0.032700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013014 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.52 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.122 seconds +Domain Reload Profiling: + ReloadAssembly (1122ms) + BeginReloadAssembly (171ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (45ms) + EndReloadAssembly (836ms) + LoadAssemblies (138ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (297ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (314ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (203ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5474. +Memory consumption went from 165.2 MB to 165.1 MB. +Total: 2.581700 ms (FindLiveObjects: 0.347300 ms CreateObjectMapping: 0.183500 ms MarkObjects: 2.025000 ms DeleteObjects: 0.024800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012559 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.97 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.132 seconds +Domain Reload Profiling: + ReloadAssembly (1133ms) + BeginReloadAssembly (178ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (857ms) + LoadAssemblies (118ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (314ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (67ms) + SetupLoadedEditorAssemblies (299ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (79ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.64 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5477. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.485300 ms (FindLiveObjects: 0.329600 ms CreateObjectMapping: 0.167900 ms MarkObjects: 1.971600 ms DeleteObjects: 0.015300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013003 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.036 seconds +Domain Reload Profiling: + ReloadAssembly (1036ms) + BeginReloadAssembly (155ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (40ms) + EndReloadAssembly (781ms) + LoadAssemblies (107ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (291ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (292ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (19ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.06 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5480. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.720000 ms (FindLiveObjects: 0.436800 ms CreateObjectMapping: 0.201100 ms MarkObjects: 2.054400 ms DeleteObjects: 0.026100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015333 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.93 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.301 seconds +Domain Reload Profiling: + ReloadAssembly (1302ms) + BeginReloadAssembly (237ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (61ms) + EndReloadAssembly (939ms) + LoadAssemblies (148ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (400ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (43ms) + SetupLoadedEditorAssemblies (315ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (77ms) + ProcessInitializeOnLoadAttributes (190ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.65 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5483. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 3.184900 ms (FindLiveObjects: 0.315700 ms CreateObjectMapping: 0.175300 ms MarkObjects: 2.665800 ms DeleteObjects: 0.026400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.009502 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.091 seconds +Domain Reload Profiling: + ReloadAssembly (1092ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (820ms) + LoadAssemblies (120ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (300ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (327ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (61ms) + ProcessInitializeOnLoadAttributes (194ms) + ProcessInitializeOnLoadMethodAttributes (44ms) + AfterProcessingInitializeOnLoad (21ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5486. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.522100 ms (FindLiveObjects: 0.389000 ms CreateObjectMapping: 0.206400 ms MarkObjects: 1.896900 ms DeleteObjects: 0.028700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013587 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.988 seconds +Domain Reload Profiling: + ReloadAssembly (989ms) + BeginReloadAssembly (154ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (43ms) + EndReloadAssembly (741ms) + LoadAssemblies (108ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (258ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (32ms) + SetupLoadedEditorAssemblies (308ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (70ms) + ProcessInitializeOnLoadAttributes (183ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (18ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.54 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5489. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.999900 ms (FindLiveObjects: 0.481800 ms CreateObjectMapping: 0.276000 ms MarkObjects: 2.213200 ms DeleteObjects: 0.027500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.027812 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.020 seconds +Domain Reload Profiling: + ReloadAssembly (1021ms) + BeginReloadAssembly (157ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (39ms) + EndReloadAssembly (767ms) + LoadAssemblies (112ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (284ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (172ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.23 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4801 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5492. +Memory consumption went from 165.2 MB to 165.2 MB. +Total: 2.562500 ms (FindLiveObjects: 0.444600 ms CreateObjectMapping: 0.200800 ms MarkObjects: 1.894600 ms DeleteObjects: 0.021200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012364 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.78 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.167 seconds +Domain Reload Profiling: + ReloadAssembly (1168ms) + BeginReloadAssembly (158ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (37ms) + EndReloadAssembly (888ms) + LoadAssemblies (124ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (282ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (375ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (6ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (251ms) + ProcessInitializeOnLoadMethodAttributes (35ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.77 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5496. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.790700 ms (FindLiveObjects: 0.412400 ms CreateObjectMapping: 0.252600 ms MarkObjects: 2.102800 ms DeleteObjects: 0.021600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012802 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.72 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.274 seconds +Domain Reload Profiling: + ReloadAssembly (1274ms) + BeginReloadAssembly (181ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (51ms) + EndReloadAssembly (971ms) + LoadAssemblies (146ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (357ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (45ms) + SetupLoadedEditorAssemblies (361ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (9ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (134ms) + ProcessInitializeOnLoadAttributes (182ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5499. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.764900 ms (FindLiveObjects: 0.441500 ms CreateObjectMapping: 0.181300 ms MarkObjects: 2.110700 ms DeleteObjects: 0.029200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015874 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.09 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.110 seconds +Domain Reload Profiling: + ReloadAssembly (1111ms) + BeginReloadAssembly (170ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (52ms) + EndReloadAssembly (844ms) + LoadAssemblies (126ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (270ms) + ReleaseScriptCaches (2ms) + RebuildScriptCaches (65ms) + SetupLoadedEditorAssemblies (323ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (8ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (82ms) + ProcessInitializeOnLoadAttributes (193ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (13ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5502. +Memory consumption went from 165.4 MB to 165.4 MB. +Total: 2.472000 ms (FindLiveObjects: 0.321000 ms CreateObjectMapping: 0.153600 ms MarkObjects: 1.980300 ms DeleteObjects: 0.016300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.010777 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.97 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.287 seconds +Domain Reload Profiling: + ReloadAssembly (1288ms) + BeginReloadAssembly (254ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (65ms) + EndReloadAssembly (848ms) + LoadAssemblies (178ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (364ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (35ms) + SetupLoadedEditorAssemblies (299ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (67ms) + ProcessInitializeOnLoadAttributes (178ms) + ProcessInitializeOnLoadMethodAttributes (30ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (9ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5505. +Memory consumption went from 165.5 MB to 165.4 MB. +Total: 2.533700 ms (FindLiveObjects: 0.312600 ms CreateObjectMapping: 0.158500 ms MarkObjects: 2.046500 ms DeleteObjects: 0.015100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.019946 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.53 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 0.993 seconds +Domain Reload Profiling: + ReloadAssembly (994ms) + BeginReloadAssembly (174ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (715ms) + LoadAssemblies (128ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (251ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (57ms) + ProcessInitializeOnLoadAttributes (153ms) + ProcessInitializeOnLoadMethodAttributes (21ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.81 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5508. +Memory consumption went from 165.3 MB to 165.2 MB. +Total: 2.546500 ms (FindLiveObjects: 0.326300 ms CreateObjectMapping: 0.165000 ms MarkObjects: 2.028300 ms DeleteObjects: 0.026200 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013258 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.61 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.081 seconds +Domain Reload Profiling: + ReloadAssembly (1082ms) + BeginReloadAssembly (211ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (62ms) + EndReloadAssembly (753ms) + LoadAssemblies (117ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (288ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (288ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (68ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (36ms) + AfterProcessingInitializeOnLoad (12ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.02 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5511. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.052200 ms (FindLiveObjects: 0.407100 ms CreateObjectMapping: 0.382100 ms MarkObjects: 2.244200 ms DeleteObjects: 0.017800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.032011 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.50 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.504 seconds +Domain Reload Profiling: + ReloadAssembly (2505ms) + BeginReloadAssembly (387ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (126ms) + EndReloadAssembly (1888ms) + LoadAssemblies (287ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (835ms) + ReleaseScriptCaches (6ms) + RebuildScriptCaches (96ms) + SetupLoadedEditorAssemblies (366ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (10ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (84ms) + ProcessInitializeOnLoadAttributes (222ms) + ProcessInitializeOnLoadMethodAttributes (32ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (8ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.99 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5514. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 3.508700 ms (FindLiveObjects: 0.601800 ms CreateObjectMapping: 0.211500 ms MarkObjects: 2.666700 ms DeleteObjects: 0.026400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.020946 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 3.26 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 5.396 seconds +Domain Reload Profiling: + ReloadAssembly (5400ms) + BeginReloadAssembly (927ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (168ms) + EndReloadAssembly (4157ms) + LoadAssemblies (641ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (1458ms) + ReleaseScriptCaches (48ms) + RebuildScriptCaches (149ms) + SetupLoadedEditorAssemblies (1333ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (14ms) + SetLoadedEditorAssemblies (2ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (224ms) + ProcessInitializeOnLoadAttributes (970ms) + ProcessInitializeOnLoadMethodAttributes (91ms) + AfterProcessingInitializeOnLoad (28ms) + EditorAssembliesLoaded (1ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (18ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 9.95 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5517. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 9.376600 ms (FindLiveObjects: 2.380200 ms CreateObjectMapping: 1.125000 ms MarkObjects: 5.737800 ms DeleteObjects: 0.128500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015070 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.84 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.160 seconds +Domain Reload Profiling: + ReloadAssembly (1161ms) + BeginReloadAssembly (177ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (4ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (47ms) + EndReloadAssembly (856ms) + LoadAssemblies (137ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (354ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (298ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (7ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (184ms) + ProcessInitializeOnLoadMethodAttributes (24ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (11ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.66 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5520. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.738000 ms (FindLiveObjects: 0.506500 ms CreateObjectMapping: 0.192200 ms MarkObjects: 1.965300 ms DeleteObjects: 0.072300 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.025958 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 2.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 3.183 seconds +Domain Reload Profiling: + ReloadAssembly (3185ms) + BeginReloadAssembly (934ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (22ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (415ms) + EndReloadAssembly (1969ms) + LoadAssemblies (491ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (656ms) + ReleaseScriptCaches (8ms) + RebuildScriptCaches (138ms) + SetupLoadedEditorAssemblies (743ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (20ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (3ms) + BeforeProcessingInitializeOnLoad (179ms) + ProcessInitializeOnLoadAttributes (456ms) + ProcessInitializeOnLoadMethodAttributes (59ms) + AfterProcessingInitializeOnLoad (25ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (20ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 2.80 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5523. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 2.550900 ms (FindLiveObjects: 0.325200 ms CreateObjectMapping: 0.176900 ms MarkObjects: 2.025400 ms DeleteObjects: 0.021800 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.014429 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.76 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 2.509 seconds +Domain Reload Profiling: + ReloadAssembly (2510ms) + BeginReloadAssembly (444ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (23ms) + BackupInstance (0ms) + ReleaseScriptingObjects (1ms) + CreateAndSetChildDomain (116ms) + EndReloadAssembly (1477ms) + LoadAssemblies (482ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (595ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (67ms) + SetupLoadedEditorAssemblies (396ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (2ms) + BeforeProcessingInitializeOnLoad (98ms) + ProcessInitializeOnLoadAttributes (235ms) + ProcessInitializeOnLoadMethodAttributes (40ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.51 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (21.9 KB). Loaded Objects now: 5526. +Memory consumption went from 165.3 MB to 165.3 MB. +Total: 5.392800 ms (FindLiveObjects: 0.989400 ms CreateObjectMapping: 0.756400 ms MarkObjects: 3.563400 ms DeleteObjects: 0.079400 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.015380 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.62 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.112 seconds +Domain Reload Profiling: + ReloadAssembly (1113ms) + BeginReloadAssembly (178ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (8ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (50ms) + EndReloadAssembly (806ms) + LoadAssemblies (127ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (321ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (46ms) + SetupLoadedEditorAssemblies (279ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (60ms) + ProcessInitializeOnLoadAttributes (173ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (14ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 8.31 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5529. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 6.283700 ms (FindLiveObjects: 0.925400 ms CreateObjectMapping: 0.841400 ms MarkObjects: 4.438900 ms DeleteObjects: 0.074600 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.018162 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.568 seconds +Domain Reload Profiling: + ReloadAssembly (1569ms) + BeginReloadAssembly (187ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (7ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (44ms) + EndReloadAssembly (1250ms) + LoadAssemblies (140ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (392ms) + ReleaseScriptCaches (4ms) + RebuildScriptCaches (51ms) + SetupLoadedEditorAssemblies (575ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (80ms) + ProcessInitializeOnLoadAttributes (401ms) + ProcessInitializeOnLoadMethodAttributes (50ms) + AfterProcessingInitializeOnLoad (38ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (24ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.63 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5532. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 4.514200 ms (FindLiveObjects: 0.520000 ms CreateObjectMapping: 0.438300 ms MarkObjects: 3.494600 ms DeleteObjects: 0.058700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013181 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.25 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.183 seconds +Domain Reload Profiling: + ReloadAssembly (1183ms) + BeginReloadAssembly (204ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (6ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (53ms) + EndReloadAssembly (827ms) + LoadAssemblies (156ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (306ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (37ms) + SetupLoadedEditorAssemblies (296ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (1ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (27ms) + AfterProcessingInitializeOnLoad (17ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.60 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5535. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 5.811300 ms (FindLiveObjects: 0.617500 ms CreateObjectMapping: 0.667400 ms MarkObjects: 4.399800 ms DeleteObjects: 0.124700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.011826 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 1.12 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.207 seconds +Domain Reload Profiling: + ReloadAssembly (1208ms) + BeginReloadAssembly (243ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (15ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (55ms) + EndReloadAssembly (860ms) + LoadAssemblies (156ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (358ms) + ReleaseScriptCaches (3ms) + RebuildScriptCaches (38ms) + SetupLoadedEditorAssemblies (287ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (177ms) + ProcessInitializeOnLoadMethodAttributes (23ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.03 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5538. +Memory consumption went from 165.5 MB to 165.5 MB. +Total: 2.836900 ms (FindLiveObjects: 0.406200 ms CreateObjectMapping: 0.221200 ms MarkObjects: 2.185500 ms DeleteObjects: 0.022500 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012191 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.57 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.180 seconds +Domain Reload Profiling: + ReloadAssembly (1183ms) + BeginReloadAssembly (240ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (10ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (54ms) + EndReloadAssembly (814ms) + LoadAssemblies (159ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (307ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (310ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (62ms) + ProcessInitializeOnLoadAttributes (199ms) + ProcessInitializeOnLoadMethodAttributes (28ms) + AfterProcessingInitializeOnLoad (15ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (12ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 5.41 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.0 KB). Loaded Objects now: 5541. +Memory consumption went from 165.4 MB to 165.3 MB. +Total: 7.073800 ms (FindLiveObjects: 1.103500 ms CreateObjectMapping: 1.028300 ms MarkObjects: 4.629000 ms DeleteObjects: 0.308700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.012313 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.55 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.091 seconds +Domain Reload Profiling: + ReloadAssembly (1092ms) + BeginReloadAssembly (204ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (55ms) + EndReloadAssembly (763ms) + LoadAssemblies (157ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (285ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (36ms) + SetupLoadedEditorAssemblies (278ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (5ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (66ms) + ProcessInitializeOnLoadAttributes (166ms) + ProcessInitializeOnLoadMethodAttributes (25ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (10ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 3.71 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5544. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 3.558200 ms (FindLiveObjects: 0.534400 ms CreateObjectMapping: 0.257800 ms MarkObjects: 2.734600 ms DeleteObjects: 0.029700 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> +======================================================================== +Received Prepare +Registering precompiled user dll's ... +Registered in 0.013242 seconds. +Begin MonoManager ReloadAssembly +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll +Symbol file LoadedFromMemory doesn't match image D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll +Native extension for WindowsStandalone target not found +Refreshing native plugins compatible for Editor in 0.59 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Mono: successfully reloaded assembly +- Completed reload, in 1.203 seconds +Domain Reload Profiling: + ReloadAssembly (1204ms) + BeginReloadAssembly (242ms) + ExecutionOrderSort (0ms) + DisableScriptedObjects (5ms) + BackupInstance (0ms) + ReleaseScriptingObjects (0ms) + CreateAndSetChildDomain (78ms) + EndReloadAssembly (803ms) + LoadAssemblies (153ms) + RebuildTransferFunctionScriptingTraits (0ms) + SetupTypeCache (281ms) + ReleaseScriptCaches (1ms) + RebuildScriptCaches (50ms) + SetupLoadedEditorAssemblies (305ms) + LogAssemblyErrors (0ms) + InitializePlatformSupportModulesInManaged (4ms) + SetLoadedEditorAssemblies (0ms) + RefreshPlugins (1ms) + BeforeProcessingInitializeOnLoad (64ms) + ProcessInitializeOnLoadAttributes (191ms) + ProcessInitializeOnLoadMethodAttributes (29ms) + AfterProcessingInitializeOnLoad (16ms) + EditorAssembliesLoaded (0ms) + ExecutionOrderSort2 (0ms) + AwakeInstancesAfterBackupRestoration (14ms) +Platform modules already initialized, skipping +Refreshing native plugins compatible for Editor in 4.00 ms, found 3 plugins. +Preloading 0 native plugins for Editor in 0.00 ms. +Unloading 4802 Unused Serialized files (Serialized files now loaded: 0) +Unloading 23 unused Assets / (22.1 KB). Loaded Objects now: 5547. +Memory consumption went from 165.6 MB to 165.5 MB. +Total: 2.990500 ms (FindLiveObjects: 0.597400 ms CreateObjectMapping: 0.215800 ms MarkObjects: 2.140500 ms DeleteObjects: 0.035100 ms) + +AssetImportParameters requested are different than current active one (requested -> active): + custom:video-decoder-ogg-theora: a1e56fd34408186e4bbccfd4996cb3dc -> + custom:container-muxer-webm: aa71ff27fc2769a1b78a27578f13a17b -> + custom:container-demuxer-webm: 4f35f7cbe854078d1ac9338744f61a02 -> + custom:video-encoder-webm-vp8: eb34c28f22e8b96e1ab97ce403110664 -> + custom:audio-encoder-webm-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> + custom:framework-win-MediaFoundation: 216162199b28c13a410421893ffa2e32 -> + custom:container-demuxer-ogg: 62fdf1f143b41e24485cea50d1cbac27 -> + custom:video-decoder-webm-vp8: 9c59270c3fd7afecdb556c50c9e8de78 -> + custom:audio-decoder-ogg-vorbis: bf7c407c2cedff20999df2af8eb42d56 -> diff --git a/JNFrame/Logs/Packages-Update.log b/JNFrame/Logs/Packages-Update.log new file mode 100644 index 00000000..68f6a1b7 --- /dev/null +++ b/JNFrame/Logs/Packages-Update.log @@ -0,0 +1,46 @@ + +=== Tue Jan 23 11:27:18 2024 + +Packages were changed. +Update Mode: mergeDefaultDependencies + +The following packages were 已添加: + com.unity.ide.rider@3.0.21 + com.unity.ide.visualstudio@2.0.18 + com.unity.ide.vscode@1.2.5 + com.unity.modules.ai@1.0.0 + com.unity.modules.androidjni@1.0.0 + com.unity.modules.animation@1.0.0 + com.unity.modules.assetbundle@1.0.0 + com.unity.modules.audio@1.0.0 + com.unity.modules.cloth@1.0.0 + com.unity.modules.director@1.0.0 + com.unity.modules.imageconversion@1.0.0 + com.unity.modules.imgui@1.0.0 + com.unity.modules.jsonserialize@1.0.0 + com.unity.modules.particlesystem@1.0.0 + com.unity.modules.physics@1.0.0 + com.unity.modules.physics2d@1.0.0 + com.unity.modules.screencapture@1.0.0 + com.unity.modules.terrain@1.0.0 + com.unity.modules.terrainphysics@1.0.0 + com.unity.modules.tilemap@1.0.0 + com.unity.modules.ui@1.0.0 + com.unity.modules.uielements@1.0.0 + com.unity.modules.umbra@1.0.0 + com.unity.modules.unityanalytics@1.0.0 + com.unity.modules.unitywebrequest@1.0.0 + com.unity.modules.unitywebrequestassetbundle@1.0.0 + com.unity.modules.unitywebrequestaudio@1.0.0 + com.unity.modules.unitywebrequesttexture@1.0.0 + com.unity.modules.unitywebrequestwww@1.0.0 + com.unity.modules.vehicles@1.0.0 + com.unity.modules.video@1.0.0 + com.unity.modules.vr@1.0.0 + com.unity.modules.wind@1.0.0 + com.unity.modules.xr@1.0.0 + com.unity.test-framework@1.1.33 +The following packages were 已更新: + com.unity.collab-proxy 从版本 1.13.5 到 2.0.4 + com.unity.timeline 从版本 1.6.2 到 1.6.5 + com.unity.visualscripting 从版本 1.7.6 到 1.8.0 diff --git a/JNFrame/Logs/shadercompiler-AssetImportWorker0.log b/JNFrame/Logs/shadercompiler-AssetImportWorker0.log new file mode 100644 index 00000000..9615da15 --- /dev/null +++ b/JNFrame/Logs/shadercompiler-AssetImportWorker0.log @@ -0,0 +1,6 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Unhandled exception: Protocol error - failed to read magic number (error -2147483644, transferred 0/4) + +Quitting shader compiler process diff --git a/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe0.log b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe0.log new file mode 100644 index 00000000..a85f8583 --- /dev/null +++ b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe0.log @@ -0,0 +1,16 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=1647 file=Assets/DefaultResourcesExtra/Standard pass=FORWARD cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDBASE uKW=DIRECTIONAL LIGHTPROBE_SH dKW=FOG_LINEAR FOG_EXP FOG_EXP2 INSTANCING_ON _NORMALMAP _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _PARALLAXMAP SHADOWS_SHADOWMASK DYNAMICLIGHTMAP_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING DIRLIGHTMAP_COMBINED SHADOWS_SCREEN VERTEXLIGHT_ON UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=227 mask=6 start=68 ok=1 outsize=1926 + +Cmd: compileSnippet + insize=1647 file=Assets/DefaultResourcesExtra/Standard pass=FORWARD cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDBASE uKW=DIRECTIONAL LIGHTPROBE_SH _EMISSION dKW=FOG_LINEAR FOG_EXP FOG_EXP2 INSTANCING_ON _NORMALMAP _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _DETAIL_MULX2 _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _GLOSSYREFLECTIONS_OFF _PARALLAXMAP SHADOWS_SHADOWMASK DYNAMICLIGHTMAP_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING DIRLIGHTMAP_COMBINED SHADOWS_SCREEN UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=227 mask=6 start=68 ok=1 outsize=6902 + +Cmd: compileSnippet + insize=1487 file=Assets/DefaultResourcesExtra/Standard pass=FORWARD_DELTA cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDADD uKW=DIRECTIONAL dKW=FOG_LINEAR FOG_EXP FOG_EXP2 _NORMALMAP _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _PARALLAXMAP POINT SPOT POINT_COOKIE DIRECTIONAL_COOKIE SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING SHADOWS_DEPTH SHADOWS_SOFT SHADOWS_SCREEN SHADOWS_CUBE UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=227 mask=6 start=106 ok=1 outsize=1722 + +Cmd: compileSnippet + insize=1487 file=Assets/DefaultResourcesExtra/Standard pass=FORWARD_DELTA cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDADD uKW=DIRECTIONAL dKW=FOG_LINEAR FOG_EXP FOG_EXP2 _NORMALMAP _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _DETAIL_MULX2 _PARALLAXMAP POINT SPOT POINT_COOKIE DIRECTIONAL_COOKIE SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING SHADOWS_DEPTH SHADOWS_SOFT SHADOWS_SCREEN SHADOWS_CUBE UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=227 mask=6 start=106 ok=1 outsize=3390 + +Cmd: shutdown diff --git a/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe1.log b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe1.log new file mode 100644 index 00000000..a00e4aa4 --- /dev/null +++ b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe1.log @@ -0,0 +1,7 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=11944 file=Assets/DefaultResourcesExtra/Hidden/Internal-ScreenSpaceShadows pass= cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW=SHADOWS_SPLIT_SPHERES dKW=SHADOWS_SINGLE_CASCADE UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=227 mask=6 start=380 ok=1 outsize=1290 + +Cmd: shutdown diff --git a/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe2.log b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe2.log new file mode 100644 index 00000000..17e1267f --- /dev/null +++ b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe2.log @@ -0,0 +1,7 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=1647 file=Assets/DefaultResourcesExtra/Standard pass=FORWARD cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDBASE uKW=DIRECTIONAL LIGHTPROBE_SH _EMISSION dKW=FOG_LINEAR FOG_EXP FOG_EXP2 INSTANCING_ON _NORMALMAP _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _DETAIL_MULX2 _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _GLOSSYREFLECTIONS_OFF _PARALLAXMAP SHADOWS_SHADOWMASK DYNAMICLIGHTMAP_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING DIRLIGHTMAP_COMBINED SHADOWS_SCREEN UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=227 mask=6 start=68 ok=1 outsize=6902 + +Cmd: shutdown diff --git a/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe3.log b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe3.log new file mode 100644 index 00000000..fc5179fd --- /dev/null +++ b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe3.log @@ -0,0 +1,7 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=1647 file=Assets/DefaultResourcesExtra/Standard pass=FORWARD cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDBASE uKW=DIRECTIONAL LIGHTPROBE_SH SHADOWS_SCREEN _EMISSION dKW=FOG_LINEAR FOG_EXP FOG_EXP2 INSTANCING_ON _NORMALMAP _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _DETAIL_MULX2 _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _SPECULARHIGHLIGHTS_OFF _GLOSSYREFLECTIONS_OFF _PARALLAXMAP SHADOWS_SHADOWMASK DYNAMICLIGHTMAP_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING DIRLIGHTMAP_COMBINED UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=227 mask=6 start=68 ok=1 outsize=7278 + +Cmd: shutdown diff --git a/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe4.log b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe4.log new file mode 100644 index 00000000..2240bfee --- /dev/null +++ b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe4.log @@ -0,0 +1,7 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=1311 file=Assets/DefaultResourcesExtra/Standard pass=ShadowCaster cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_SHADOWCASTER uKW=SHADOWS_DEPTH dKW=INSTANCING_ON _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A _PARALLAXMAP SHADOWS_CUBE UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=227 mask=6 start=139 ok=1 outsize=250 + +Cmd: shutdown diff --git a/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe5.log b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe5.log new file mode 100644 index 00000000..0250359c --- /dev/null +++ b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe5.log @@ -0,0 +1,7 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=11944 file=Assets/DefaultResourcesExtra/Hidden/Internal-ScreenSpaceShadows pass= cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR uKW=SHADOWS_SPLIT_SPHERES dKW=SHADOWS_SINGLE_CASCADE UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Fragment platform=d3d11 reqs=227 mask=6 start=380 ok=1 outsize=5738 + +Cmd: shutdown diff --git a/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe6.log b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe6.log new file mode 100644 index 00000000..fbfed056 --- /dev/null +++ b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe6.log @@ -0,0 +1,7 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=1311 file=Assets/DefaultResourcesExtra/Standard pass=ShadowCaster cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_SHADOWCASTER uKW=SHADOWS_DEPTH dKW=INSTANCING_ON _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _PARALLAXMAP SHADOWS_CUBE UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=227 mask=6 start=139 ok=1 outsize=1446 + +Cmd: shutdown diff --git a/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe7.log b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe7.log new file mode 100644 index 00000000..1b8224a7 --- /dev/null +++ b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe7.log @@ -0,0 +1,7 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=1647 file=Assets/DefaultResourcesExtra/Standard pass=FORWARD cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDBASE uKW=DIRECTIONAL LIGHTPROBE_SH SHADOWS_SCREEN dKW=FOG_LINEAR FOG_EXP FOG_EXP2 INSTANCING_ON _NORMALMAP _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _PARALLAXMAP SHADOWS_SHADOWMASK DYNAMICLIGHTMAP_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING DIRLIGHTMAP_COMBINED VERTEXLIGHT_ON UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=227 mask=6 start=68 ok=1 outsize=2034 + +Cmd: shutdown diff --git a/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe8.log b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe8.log new file mode 100644 index 00000000..5382ceda --- /dev/null +++ b/JNFrame/Logs/shadercompiler-UnityShaderCompiler.exe8.log @@ -0,0 +1,7 @@ +Base path: 'D:/Unity/2021.3.27f1c2/Editor/Data', plugins path 'D:/Unity/2021.3.27f1c2/Editor/Data/PlaybackEngines' +Cmd: initializeCompiler + +Cmd: compileSnippet + insize=1647 file=Assets/DefaultResourcesExtra/Standard pass=FORWARD cachingPP=1 ppOnly=0 stripLineD=0 buildPlatform=19 rsLen=0 pKW=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR UNITY_PASS_FORWARDBASE uKW=DIRECTIONAL LIGHTPROBE_SH dKW=FOG_LINEAR FOG_EXP FOG_EXP2 INSTANCING_ON _NORMALMAP _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _METALLICGLOSSMAP _PARALLAXMAP SHADOWS_SHADOWMASK DYNAMICLIGHTMAP_ON LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING DIRLIGHTMAP_COMBINED SHADOWS_SCREEN VERTEXLIGHT_ON UNITY_NO_DXT5nm UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_METAL_SHADOWS_USE_POINT_FILTERING UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 UNITY_PBS_USE_BRDF3 UNITY_NO_FULL_STANDARD_SHADER UNITY_HARDWARE_TIER1 UNITY_HARDWARE_TIER2 UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS UNITY_LIGHTMAP_DLDR_ENCODING UNITY_LIGHTMAP_RGBM_ENCODING UNITY_VIRTUAL_TEXTURING UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION UNITY_ASTC_NORMALMAP_ENCODING SHADER_API_GLES30 UNITY_UNIFIED_SHADER_PRECISION_MODEL flags=0 lang=0 type=Vertex platform=d3d11 reqs=227 mask=6 start=68 ok=1 outsize=1926 + +Cmd: shutdown diff --git a/JNFrame/Packages/System.Buffers.4.4.0/.signature.p7s b/JNFrame/Packages/System.Buffers.4.4.0/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..34d8bab59ab1f8a63b9047e2f6ecf847cce2a260 GIT binary patch literal 9482 zcmdU#c|25Y|HsW@>|Y^D4D-Ov5Jp4aQSUr+z&I_J8sbDeXp@B91te$D`Nc?5z@G1@eG zmJ7lH&8ExE0(7}4C%SD2lefr%U1#A?^xAoJbUyRb%HguTX= zc1EUHPm-S&fF^jWS!`iv&!!^{0XnP%phL5=VNeJZ%ES5g)f?gN?ep<(T)&A;0@{pq zEw32D46ciS<^b3bFk3i+A8KoZ76kYi4R(G`BcdnKkU$AQnfc<;>i}WKVGe$t;NW0Y zckmP*Jf(^!lhAU24C54xUu<=RK9w3sA-JQ=j8MDD2#=9l{Q!Lm*5ykb+MJ4I`WiVx~%5Kl}4t%74B->Dblj zC!bK-3J$KEa}m8)1d}ni&9@5_qGDs8XR&ie3WvofT#tPlYU6~CQk>yV#b^XQe)(c^ z-ua0GU!_0p#`R^Px}*jQdgevkTlx06e0C5~FE?q*(fI5g-hNAKYn51a9JZ%hO=Mny zyC^rZv)b3_K2H6t(EQ$v6G5b|59fDsDJ^hNdVh0$dMZJ^F2ptlmDBu&#QxCi5IPm> zBQqTH6ytdQE*^yOkthcG%Y|L9?vd_Bna=oy93hXuWZ_QEws#F4j( zPhYkxx>uMoel>Tpq&814S?K9P&e>5`7m;8qC=9{`xqt_701|wu65J5T0vrx*q-cPf z(dK8gnE@F12asSKK*ELK0>-1~Z%&_Xq@z`Koyg6V&YU7WliYj@iB}2y^% zDESg6`NHi(g|%mi&%LP+Qr?^zEJER$hpy}+g?-@L?i$&(0ba55NlHbvr=k~cU&LEZ ztVbn3mw@k7xD=j8^2BY{ ztag6#BS2>c06JV`IdtJ{B4REbWgdYxhPTPd)~rA8T#o;0=%TS`0E0ne7{LpME=KF8 zCP4X534#XHz|8^@L}8U6Hm3R*)K3^OB)bz(HbhTfqOT_dC;uvr=h}+I!;!ob`E=P~Ub?Hfb?o`I*4<~TK63L- z*Pi08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9csCJ}f)L-5^7n(pj@H2Qs%TOPe_+_42lFBi`%2 zyyMh&sjI&{txk*j_{7Sby8Pfl0~yx6Oqq5Ugx16RDpe~mF1J=1UpTtdv$u8ZtkX*^ z6-SoZejBFlU%fuCR?~Q-{UKWqEfqbv;IJ{Pse3N-s<$YFK5=%xuk4*rkVUDpjm7KE zmi*S%$32#QZ`g<5%7up#4#sM~bv0XDt6iVFKJj3gpu&ruU$XqocbfUEq)21G@rJcu zo%3sUPLY#8u&BIuV@9~EcvWiB(@DK|$q&8f+VYN4G`VfA{RI0*C81yJc$3v=@54X&BY#(z=DIpKgym=-nK9c!vKO_}@q1`9DfqBjW%7 literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard1.1/System.Buffers.xml b/JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard1.1/System.Buffers.xml new file mode 100644 index 00000000..d3d239ec --- /dev/null +++ b/JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard1.1/System.Buffers.xml @@ -0,0 +1,39 @@ + + + + System.Buffers + + + +

    Provides a resource pool that enables reusing instances of type . + The type of the objects that are in the resource pool. + + + Initializes a new instance of the class. + + + Creates a new instance of the class. + A new instance of the class. + + + Creates a new instance of the class using the specifed configuration. + The maximum length of an array instance that may be stored in the pool. + The maximum number of array instances that may be stored in each bucket in the pool. The pool groups arrays of similar lengths into buckets for faster access. + A new instance of the class with the specified configuration. + + + Retrieves a buffer that is at least the requested length. + The minimum length of the array. + An array of type that is at least minimumLength in length. + + + Returns an array to the pool that was previously obtained using the method on the same instance. + A buffer to return to the pool that was previously obtained using the method. + Indicates whether the contents of the buffer should be cleared before reuse. If bufferLength is set to true, and if the pool will store the buffer to enable subsequent reuse, the method will clear the array of its contents so that a subsequent caller using the method will not see the content of the previous caller. If bufferLength is set to false or if the pool will release the buffer, the array's contents are left unchanged. + + + Gets a shared instance. + A shared instance. + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll b/JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll new file mode 100644 index 0000000000000000000000000000000000000000..b6d9c7782d275b83f4d0883f9bfb2d65fc5c9e9f GIT binary patch literal 27992 zcmeHw2Ut@})9{`<^%}hK`hQLI)eYi1e-?1PBm>1d|}eMp3Q}yQ0_t#oj9x#9pyC ztSI)1y(|Bm6Pn)g-tYgv_qp%;JpaMW*`1x8ZL_npvzr(^WCo%lglO<-Z%3#e-o)cU z!oLQ^kgR05TM2EGJ#AEv4L)rYmB|;gaz(-n5jTgG$`uHN5>^V2CCU@9_yU$sXe28~ zn8sr(D$1F5unzM@XfQ@aI#Y!4ou%DD#w>XZM~EO|O0n+V@Mgg$89oT9kYS3n-UNcE zKlxMx1iZs|1nu&eK#&suy5Aj90tL@wFN8vgKr%w-x|l$mjZoY`co!q20IyA+2P++jvVl*J#{(f~?az;%w=_=Fje_VX(*mJfZG>by$eN)K;xL48Xn%1B z?yp{1V}Y1vW~*v$2`m_54TR*(iV2*RoTe2*x;T|=DqvK5$yvgSK@n;Kk=$*n`E5kC zQJ^q%gj#^Gp-`mFNOwpH^-03sKM|T~)4GUhmN58oRwt#@MkKY) z@2Jgs)4OxfE%k{k_97XmWiLxA)Y*!C4ysPEG$0ZTD3*rAJ7OFQUPMn=o7pnVEsY7} zFe%am!o7$xt`~LAYv$EcP#rrz!He%7}E5(jET z4#U!#s4!926CHKc{g13GL+95L9B>IM02{LRLG4yII`qR z1+$i=8midQ3{_MxiX~`EIXNmJatwJHt+)!{sjHx=Xx)n`D@({5gT@eZfTmVfD^5|C zIgM}skir~e4;T~y?f6VZX;`*O=maQv852ED#ta#uz}OK9 z?m#9*GpeYoV4HeCoxjhMXZI0c16nV>9GDO&M5X>ywK3>L8> zJ2M%EDrs_tDnuM8Aa0N*Cu0yN&oESm2$0I?K%_T>wIQqxVJ!%2L0BtJUWO4T)eTf6 z2f3NR-%y2OXqc2D$FMp|u_V+7#j+nj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ame/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.xml new file mode 100644 index 00000000..d3d239ec --- /dev/null +++ b/JNFrame/Packages/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.xml @@ -0,0 +1,39 @@ + + + + System.Buffers + + + + Provides a resource pool that enables reusing instances of type . + The type of the objects that are in the resource pool. + + + Initializes a new instance of the class. + + + Creates a new instance of the class. + A new instance of the class. + + + Creates a new instance of the class using the specifed configuration. + The maximum length of an array instance that may be stored in the pool. + The maximum number of array instances that may be stored in each bucket in the pool. The pool groups arrays of similar lengths into buckets for faster access. + A new instance of the class with the specified configuration. + + + Retrieves a buffer that is at least the requested length. + The minimum length of the array. + An array of type that is at least minimumLength in length. + + + Returns an array to the pool that was previously obtained using the method on the same instance. + A buffer to return to the pool that was previously obtained using the method. + Indicates whether the contents of the buffer should be cleared before reuse. If bufferLength is set to true, and if the pool will store the buffer to enable subsequent reuse, the method will clear the array of its contents so that a subsequent caller using the method will not see the content of the previous caller. If bufferLength is set to false or if the pool will release the buffer, the array's contents are left unchanged. + + + Gets a shared instance. + A shared instance. + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Buffers.4.4.0/ref/netcoreapp2.0/_._ b/JNFrame/Packages/System.Buffers.4.4.0/ref/netcoreapp2.0/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard1.1/System.Buffers.dll b/JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard1.1/System.Buffers.dll new file mode 100644 index 0000000000000000000000000000000000000000..33880ef39b3751df59aec403bd20e54ecca29e15 GIT binary patch literal 21848 zcmeHv2Ut@}x9Cm?U783eH5925c0voNNUu_)gCGP5y%~ZOrA0+iKtZ~oR0SI<7E}-s z8;F3|Pz0nY7K(tPDDq|pLG*aef9|{Y|IYp2_crdeXH8wRX3d&4YbKgI?}r#52*QAO zb{2xF!54Y7>F}>XJV@pgyUYolW4$L{jaq+C+}77G3>!)b@u84{u%4v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ZGrwcqxlha zVk*1lQW__zv*5w#5jDRe8p9Ug*4;$kzxNmY2X7FHSF(X!{Ezzs41CaXjuTbMzHrqi z>WZ_GE%6GfN-Wcb3D@C-y3&LiIN{R2#q|E=S0aD>IiiKF4gKecD*6T*im;xlfugbj ztbtd6<>pLwiJwh&tW8Kb#gmLRCxQRFiGtNb{uimmD-O84fM$fcR(O4ZC6;r|Z~tHw zRW*XT^Lzw2q?n6w~ zgLCkOOGNaYYatuVf|O_A?{_bn4>K2Gf1#KD0}+|Q=@bjX4aFCE8(ucXF8P*yrqy%n z@c?1oRWTGZuGsF0SJ|}9yo|X_#wy}P1G~~@mt^0|%{YHzW$3V;>h_VQsw*A0mOlOx zouQ#qHQM??;_Z+$no(|;<5@$RwtD?H4}a;ts2iJKthR?PuMiL|_%u-#ShE+aj~!s%uOyY;yCiTXIU* zZB??-{PD?DRV6?arTG zvUS4=eTynUgWF{7a6&7b&!7TgT+y$3j;e`0o*#C{p0ypMZRHmy|a$5E5_+;4T zsS>t-x_0%x#gY%!9ORmjZhCtCzH>!K&{E9lInrx8bqmREkFJbxDY0f>5O{lW7wPE; zLwVV;LrUb{;qaWNrAr4LDn4*Gl$7v3Ro%u>DYSoAZgYFMrPs5=l>&`*tB1{E)?fq- z?^*0QTXc}3|Je!)oR?}B~6)%!zNL=kWl`yS0 zf=|mXpKslIuzEXYi0hnb7LTaz=7WP*fhZ)4jIge-D!?Zb*@=u`(S6n zso2U>57Mdw^(L9THaeS^yxe#rqdBQDf_+T>RcD1BN-!Yr!I;1|+d*ZS%Za;(v0f9O Zi7v%doyb}D<6M`RV|dyNpVE!y{{yotBANgI literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard1.1/System.Buffers.xml b/JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard1.1/System.Buffers.xml new file mode 100644 index 00000000..d3d239ec --- /dev/null +++ b/JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard1.1/System.Buffers.xml @@ -0,0 +1,39 @@ + + + + System.Buffers + + + + Provides a resource pool that enables reusing instances of type . + The type of the objects that are in the resource pool. + + + Initializes a new instance of the class. + + + Creates a new instance of the class. + A new instance of the class. + + + Creates a new instance of the class using the specifed configuration. + The maximum length of an array instance that may be stored in the pool. + The maximum number of array instances that may be stored in each bucket in the pool. The pool groups arrays of similar lengths into buckets for faster access. + A new instance of the class with the specified configuration. + + + Retrieves a buffer that is at least the requested length. + The minimum length of the array. + An array of type that is at least minimumLength in length. + + + Returns an array to the pool that was previously obtained using the method on the same instance. + A buffer to return to the pool that was previously obtained using the method. + Indicates whether the contents of the buffer should be cleared before reuse. If bufferLength is set to true, and if the pool will store the buffer to enable subsequent reuse, the method will clear the array of its contents so that a subsequent caller using the method will not see the content of the previous caller. If bufferLength is set to false or if the pool will release the buffer, the array's contents are left unchanged. + + + Gets a shared instance. + A shared instance. + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard2.0/System.Buffers.dll b/JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard2.0/System.Buffers.dll new file mode 100644 index 0000000000000000000000000000000000000000..fa635a9c6311cd320c23aec38de7a96951fee26c GIT binary patch literal 21848 zcmeHv2|QKZ*YLT6IYUGx!!=L2&b?-(%tJCy5pi+NTwT}LfGbKRDsz-MjVcWasb~

    MwT+n&8dt#NS_4mZ=eEmXkAykSFl@x^YBn1akXgCitjv5w> z^9#lqSlZ%(C|+bdCnvk)_o}T7A!t1c1D)DUahhxGB_xjHK*12S2*j|?#)>O|FAlsq z;DsO_Mi@OyHxhx+&v;@11o06@D9|sR1SBi+@5lE$ibR2@RUU#Yk$?^e&sPF)0SMZ# z7JS`j$;gs}AR&PM?FTncI->|Hz)cnu#?#1=G=R%;007b$eFbzcd~l$3JT;W+2_hM^ z>3{$;c)7s4;L!op?yF;6Z3ZLrjnt4uZ}D zp0gp53!Y`5|FH}3KMRVWWfwybyFB}nXb|K@f{>o=Iz1GGViZB>3s=Fzcx70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buffers.4.4.0/ref/netstandard2.0/System.Buffers.xml new file mode 100644 index 00000000..d3d239ec --- /dev/null +++ b/JNFrame/Packages/System.Buffers.4.4.0/ref/netstandard2.0/System.Buffers.xml @@ -0,0 +1,39 @@ + + + + System.Buffers + + + +

    Provides a resource pool that enables reusing instances of type . + The type of the objects that are in the resource pool. + + + Initializes a new instance of the class. + + + Creates a new instance of the class. + A new instance of the class. + + + Creates a new instance of the class using the specifed configuration. + The maximum length of an array instance that may be stored in the pool. + The maximum number of array instances that may be stored in each bucket in the pool. The pool groups arrays of similar lengths into buckets for faster access. + A new instance of the class with the specified configuration. + + + Retrieves a buffer that is at least the requested length. + The minimum length of the array. + An array of type that is at least minimumLength in length. + + + Returns an array to the pool that was previously obtained using the method on the same instance. + A buffer to return to the pool that was previously obtained using the method. + Indicates whether the contents of the buffer should be cleared before reuse. If bufferLength is set to true, and if the pool will store the buffer to enable subsequent reuse, the method will clear the array of its contents so that a subsequent caller using the method will not see the content of the previous caller. If bufferLength is set to false or if the pool will release the buffer, the array's contents are left unchanged. + + + Gets a shared instance. + A shared instance. + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Buffers.4.4.0/useSharedDesignerContext.txt b/JNFrame/Packages/System.Buffers.4.4.0/useSharedDesignerContext.txt new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Buffers.4.4.0/version.txt b/JNFrame/Packages/System.Buffers.4.4.0/version.txt new file mode 100644 index 00000000..1ca86a08 --- /dev/null +++ b/JNFrame/Packages/System.Buffers.4.4.0/version.txt @@ -0,0 +1 @@ +8321c729934c0f8be754953439b88e6e1c120c24 diff --git a/JNFrame/Packages/System.Memory.4.5.3/.signature.p7s b/JNFrame/Packages/System.Memory.4.5.3/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..d9e4415422873cdb263b43f174c423258cdc41eb GIT binary patch literal 18703 zcmeHPc|4R||2AXn`@S>woqNVEk?dqomK0;(mzl9w%-9Nr5EWUXlq6d!m5`+{o!m>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22tp?HkR2iN4{P@S}U|(1@X(<4KLW_dG+@i&Vuudp9R_l98wO^@w+R b?`0KBW)_ID)vv)MM~=VLD$$LfJID23+1Vxj literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Memory.4.5.3/LICENSE.TXT b/JNFrame/Packages/System.Memory.4.5.3/LICENSE.TXT new file mode 100644 index 00000000..984713a4 --- /dev/null +++ b/JNFrame/Packages/System.Memory.4.5.3/LICENSE.TXT @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +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. diff --git a/JNFrame/Packages/System.Memory.4.5.3/System.Memory.4.5.3.nupkg b/JNFrame/Packages/System.Memory.4.5.3/System.Memory.4.5.3.nupkg new file mode 100644 index 0000000000000000000000000000000000000000..5fa15502c47f9d14590e3db1ce1b8370b4d1ad95 GIT binary patch literal 154054 zcma%i1FR@Pv*xjF+qP}nwsDVb+qQk~v2EM7ZJ)jW+w5-MCYx+0UDN65>dDkpzNz`D zMnM`F1O)&900ICpC_yejFxVIo5CGuw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pw;cju-@NO_ zy8{ITVyUNZt|M)#Wo~IJZERu*7Gv?NLM~;e|df-uJKfWkAI7#=fPS0`tql zekw79_ivQw;{Asb|8*UkX`q{5bF+@JNZ_yQIHizLdS(Fv;n4lLjtt;f{@QT=y2LGY z{9~tX?TU}&uz$4|;nuGBc{jrEy&*;c`_ymzrUT|_uKz^8@2DZ dm!X0Ew5gh@At@R0Iz9Na3mkr)R^U8_{1@rt-FyH5 literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT b/JNFrame/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT new file mode 100644 index 00000000..db542ca2 --- /dev/null +++ b/JNFrame/Packages/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT @@ -0,0 +1,309 @@ +.NET Core uses third-party libraries or other resources that may be +distributed under licenses different than the .NET Core software. + +In the event that we accidentally failed to list a required notice, please +bring it to our attention. Post an issue or email us: + + dotnet@microsoft.com + +The attached notices are provided for information only. + +License notice for Slicing-by-8 +------------------------------- + +http://sourceforge.net/projects/slicing-by-8/ + +Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + + +This software program is licensed subject to the BSD License, available at +http://www.opensource.org/licenses/bsd-license.html. + + +License notice for Unicode data +------------------------------- + +http://www.unicode.org/copyright.html#License + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +License notice for Zlib +----------------------- + +https://github.com/madler/zlib +http://zlib.net/zlib_license.html + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.11, January 15th, 2017 + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +*/ + +License notice for Mono +------------------------------- + +http://www.mono-project.com/docs/about-mono/ + +Copyright (c) .NET Foundation Contributors + +MIT License + +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. + +License notice for International Organization for Standardization +----------------------------------------------------------------- + +Portions (C) International Organization for Standardization 1986: + Permission to copy in any form is granted for use with + conforming SGML systems and applications as defined in + ISO 8879, provided this notice is included in all copies. + +License notice for Intel +------------------------ + +"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License notice for Xamarin and Novell +------------------------------------- + +Copyright (c) 2015 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. + +Copyright (c) 2011 Novell, Inc (http://www.novell.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. + +Third party notice for W3C +-------------------------- + +"W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE +Status: This license takes effect 13 May, 2015. +This work is being provided by the copyright holders under the following license. +License +By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. +Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: +The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. +Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. +Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." +Disclaimers +THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders." + +License notice for Bit Twiddling Hacks +-------------------------------------- + +Bit Twiddling Hacks + +By Sean Eron Anderson +seander@cs.stanford.edu + +Individually, the code snippets here are in the public domain (unless otherwise +noted) — feel free to use them however you please. The aggregate collection and +descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are +distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and +without even the implied warranty of merchantability or fitness for a particular +purpose. + +License notice for Brotli +-------------------------------------- + +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +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. + +compress_fragment.c: +Copyright (c) 2011, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +decode_fuzzer.c: +Copyright (c) 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + diff --git a/JNFrame/Packages/System.Memory.4.5.3/lib/netcoreapp2.1/_._ b/JNFrame/Packages/System.Memory.4.5.3/lib/netcoreapp2.1/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard1.1/System.Memory.dll b/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard1.1/System.Memory.dll new file mode 100644 index 0000000000000000000000000000000000000000..342368065f3bb9a71a10f0a29279d8d7ce4a75ae GIT binary patch literal 143920 zcmdSC3!EHBbvN4E-P1kOGyCWr?aV%;?U8MX_Plnrqn9Pwl8h~3mP?_wG-c?y5R<>eQ)Ir%s)E^tE%ZGc3a}Z2W)b8N+x#p8VS-zbpToL2_U4 z!9L?Xna{3$f6q0aT|524V@svGPb}Vb;*R5`!*?t!EZ$o>bhLEhzJ=1Uh0+z*-&8uj zc;slkx7WK!qrTxv!?>o$GA@7D`)-X&d)m05l((xk3ZwH6Sf57tjCoj8mrp$#+|4g%jn zp4i_mP+325^u>z+B(0>`Ag=Fsz+KMd_}`1jSNxGS(?}V=Rq8Q*^Dhh|Be8}t{qH@- zw@~H|)c=f*Tj?=whU*Q(D_>?>r%<|W+NV%}T^=`2GRUWdA5l+BLXAO{Y6(pE93m)` zjr^o(jG-`O^sRN-`#^?S?RVe8r)N5$3vK}J0hM`O&0b%qq!vTuR>;Gd9sq!%EC3(4 zuHQIYfHawl7XxCc%tA)PUM7t$RTu(fKZAS1Ymm_l_uzM_s^EMk)Wd6IQF)cMrT~Ui zsICze8Eh+ZLP3r&>BI@t>hAC+;0q2vdKD_Eii6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P+>brmYcwr~C~Yr2+cb@dw*147y=iaq z%%Y$BDA#XABMXknSKV={Y0B0dFCVJeud-(B_*5ES#l^9uYl(YbI5GmM`butsBNbur zMF&uKB?bq}S#Vq>W#e3sEi@ds_T)kzzZ5^Ttk}23-TZ=7_ez$re!TwV%<3pB%39Q! z$j|5esdFG<8k+B>e1X>ZsnM~URpegUmLP}m`1!!zp{UZAy{niR`C9XUDHa?Dn3c3s-UimNa7_uWp>u7K

      Represents a 3x2 matrix. + + + Creates a 3x2 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a rotation matrix using the given rotation in radians. + The amount of rotation, in radians. + The rotation matrix. + + + Creates a rotation matrix using the specified rotation in radians and a center point. + The amount of rotation, in radians. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified X and Y components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the specified scale with an offset from the specified center. + The uniform scale to use. + The center offset. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The center point. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the given scale. + The uniform scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale with an offset from the specified center point. + The scale to use. + The center offset. + The scaling matrix. + + + Creates a skew matrix from the specified angles in radians. + The X angle, in radians. + The Y angle, in radians. + The skew matrix. + + + Creates a skew matrix from the specified angles in radians and a center point. + The X angle, in radians. + The Y angle, in radians. + The center point. + The skew matrix. + + + Creates a translation matrix from the specified 2-dimensional vector. + The translation position. + The translation matrix. + + + Creates a translation matrix from the specified X and Y components. + The X position. + The Y position. + The translation matrix. + + + Returns a value that indicates whether this instance and another 3x2 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant for this matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + The multiplicative identify matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Represents a 4x4 matrix. + + + Creates a object from a specified object. + A 3x2 matrix. + + + Creates a 4x4 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the third element in the first row. + The value to assign to the fourth element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the third element in the second row. + The value to assign to the third element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + The value to assign to the third element in the third row. + The value to assign to the fourth element in the third row. + The value to assign to the first element in the fourth row. + The value to assign to the second element in the fourth row. + The value to assign to the third element in the fourth row. + The value to assign to the fourth element in the fourth row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a spherical billboard that rotates around a specified object position. + The position of the object that the billboard will rotate around. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard. + + + Creates a cylindrical billboard that rotates around a specified axis. + The position of the object that the billboard will rotate around. + The position of the camera. + The axis to rotate the billboard around. + The forward vector of the camera. + The forward vector of the object. + The billboard matrix. + + + Creates a matrix that rotates around an arbitrary vector. + The axis to rotate around. + The angle to rotate around axis, in radians. + The rotation matrix. + + + Creates a rotation matrix from the specified Quaternion rotation value. + The source Quaternion. + The rotation matrix. + + + Creates a rotation matrix from the specified yaw, pitch, and roll. + The angle of rotation, in radians, around the Y axis. + The angle of rotation, in radians, around the X axis. + The angle of rotation, in radians, around the Z axis. + The rotation matrix. + + + Creates a view matrix. + The position of the camera. + The target towards which the camera is pointing. + The direction that is "up" from the camera's point of view. + The view matrix. + + + Creates an orthographic perspective matrix from the given view volume dimensions. + The width of the view volume. + The height of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a customized orthographic projection matrix. + The minimum X-value of the view volume. + The maximum X-value of the view volume. + The minimum Y-value of the view volume. + The maximum Y-value of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a perspective projection matrix from the given view volume dimensions. + The width of the view volume at the near view plane. + The height of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. + The field of view in the y direction, in radians. + The aspect ratio, defined as view space width divided by height. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + fieldOfView is less than or equal to zero. -or- fieldOfView is greater than or equal to . nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a customized perspective projection matrix. + The minimum x-value of the view volume at the near view plane. + The maximum x-value of the view volume at the near view plane. + The minimum y-value of the view volume at the near view plane. + The maximum y-value of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a matrix that reflects the coordinate system about a specified plane. + The plane about which to create a reflection. + A new matrix expressing the reflection. + + + Creates a matrix for rotating points around the X axis. + The amount, in radians, by which to rotate around the X axis. + The rotation matrix. + + + Creates a matrix for rotating points around the X axis from a center point. + The amount, in radians, by which to rotate around the X axis. + The center point. + The rotation matrix. + + + The amount, in radians, by which to rotate around the Y axis from a center point. + The amount, in radians, by which to rotate around the Y-axis. + The center point. + The rotation matrix. + + + Creates a matrix for rotating points around the Y axis. + The amount, in radians, by which to rotate around the Y-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis. + The amount, in radians, by which to rotate around the Z-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis from a center point. + The amount, in radians, by which to rotate around the Z-axis. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a uniform scaling matrix that scale equally on each axis. + The uniform scaling factor. + The scaling matrix. + + + Creates a scaling matrix with a center point. + The vector that contains the amount to scale on each axis. + The center point. + The scaling matrix. + + + Creates a uniform scaling matrix that scales equally on each axis with a center point. + The uniform scaling factor. + The center point. + The scaling matrix. + + + Creates a scaling matrix from the specified X, Y, and Z components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The center point. + The scaling matrix. + + + Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source. + The direction from which the light that will cast the shadow is coming. + The plane onto which the new matrix should flatten geometry so as to cast a shadow. + A new matrix that can be used to flatten geometry onto the specified plane from the specified direction. + + + Creates a translation matrix from the specified 3-dimensional vector. + The amount to translate in each axis. + The translation matrix. + + + Creates a translation matrix from the specified X, Y, and Z components. + The amount to translate on the X axis. + The amount to translate on the Y axis. + The amount to translate on the Z axis. + The translation matrix. + + + Creates a world matrix with the specified parameters. + The position of the object. + The forward direction of the object. + The upward direction of the object. Its value is usually [0, 1, 0]. + The world matrix. + + + Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. The return value indicates whether the operation succeeded. + The source matrix. + When this method returns, contains the scaling component of the transformation matrix if the operation succeeded. + When this method returns, contains the rotation component of the transformation matrix if the operation succeeded. + When the method returns, contains the translation component of the transformation matrix if the operation succeeded. + true if matrix was decomposed successfully; otherwise, false. + + + Returns a value that indicates whether this instance and another 4x4 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant of the current 4x4 matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + Gets the multiplicative identity matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The third element of the first row. + + + + The fourth element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The third element of the second row. + + + + The fourth element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + The third element of the third row. + + + + The fourth element of the third row. + + + + The first element of the fourth row. + + + + The second element of the fourth row. + + + + The third element of the fourth row. + + + + The fourth element of the fourth row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to care + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Transforms the specified matrix by applying the specified Quaternion rotation. + The matrix to transform. + The rotation t apply. + The transformed matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Transposes the rows and columns of a matrix. + The matrix to transpose. + The transposed matrix. + + + Represents a three-dimensional plane. + + + Creates a object from a specified four-dimensional vector. + A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. + + + Creates a object from a specified normal and the distance along the normal from the origin. + The plane's normal vector. + The plane's distance from the origin along its normal vector. + + + Creates a object from the X, Y, and Z components of its normal, and its distance from the origin on that normal. + The X component of the normal. + The Y component of the normal. + The Z component of the normal. + The distance of the plane along its normal from the origin. + + + Creates a object that contains three specified points. + The first point defining the plane. + The second point defining the plane. + The third point defining the plane. + The plane containing the three points. + + + The distance of the plane along its normal from the origin. + + + + Calculates the dot product of a plane and a 4-dimensional vector. + The plane. + The four-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. + The plane. + The 3-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the vector of this plane. + The plane. + The three-dimensional vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another plane object are equal. + The other plane. + true if the two planes are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + The normal vector of the plane. + + + + Creates a new object whose normal vector is the source plane's normal vector normalized. + The source plane. + The normalized plane. + + + Returns a value that indicates whether two planes are equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether two planes are not equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the string representation of this plane object. + A string that represents this object. + + + Transforms a normalized plane by a 4x4 matrix. + The normalized plane to transform. + The transformation matrix to apply to plane. + The transformed plane. + + + Transforms a normalized plane by a Quaternion rotation. + The normalized plane to transform. + The Quaternion rotation to apply to the plane. + A new plane that results from applying the Quaternion rotation. + + + Represents a vector that is used to encode three-dimensional physical rotations. + + + Creates a quaternion from the specified vector and rotation parts. + The vector part of the quaternion. + The rotation part of the quaternion. + + + Constructs a quaternion from the specified components. + The value to assign to the X component of the quaternion. + The value to assign to the Y component of the quaternion. + The value to assign to the Z component of the quaternion. + The value to assign to the W component of the quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Concatenates two quaternions. + The first quaternion rotation in the series. + The second quaternion rotation in the series. + A new quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. + + + Returns the conjugate of a specified quaternion. + The quaternion. + A new quaternion that is the conjugate of value. + + + Creates a quaternion from a vector and an angle to rotate about the vector. + The vector to rotate around. + The angle, in radians, to rotate around the vector. + The newly created quaternion. + + + Creates a quaternion from the specified rotation matrix. + The rotation matrix. + The newly created quaternion. + + + Creates a new quaternion from the given yaw, pitch, and roll. + The yaw angle, in radians, around the Y axis. + The pitch angle, in radians, around the X axis. + The roll angle, in radians, around the Z axis. + The resulting quaternion. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Calculates the dot product of two quaternions. + The first quaternion. + The second quaternion. + The dot product. + + + Returns a value that indicates whether this instance and another quaternion are equal. + The other quaternion. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Gets a quaternion that represents no rotation. + A quaternion whose values are (0, 0, 0, 1). + + + Returns the inverse of a quaternion. + The quaternion. + The inverted quaternion. + + + Gets a value that indicates whether the current instance is the identity quaternion. + true if the current instance is the identity quaternion; otherwise, false. + + + Calculates the length of the quaternion. + The computed length of the quaternion. + + + Calculates the squared length of the quaternion. + The length squared of the quaternion. + + + Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. + The first quaternion. + The second quaternion. + The relative weight of quaternion2 in the interpolation. + The interpolated quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Divides each component of a specified by its length. + The quaternion to normalize. + The normalized quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Returns a value that indicates whether two quaternions are equal. + The first quaternion to compare. + The second quaternion to compare. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether two quaternions are not equal. + The first quaternion to compare. + The second quaternion to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Interpolates between two quaternions, using spherical linear interpolation. + The first quaternion. + The second quaternion. + The relative weight of the second quaternion in the interpolation. + The interpolated quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this quaternion. + The string representation of this quaternion. + + + The rotation component of the quaternion. + + + + The X value of the vector component of the quaternion. + + + + The Y value of the vector component of the quaternion. + + + + The Z value of the vector component of the quaternion. + + + + Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + The vector type. T can be any primitive numeric type. + + + Creates a vector whose components are of a specified type. + The numeric type that defines the type of the components in the vector. + + + Creates a vector from a specified array. + A numeric array. + values is null. + + + Creates a vector from a specified array starting at a specified index position. + A numeric array. + The starting index position from which to create the vector. + values is null. + index is less than zero. -or- The length of values minus index is less than . + + + Copies the vector instance to a specified destination array. + The array to receive a copy of the vector values. + destination is null. + The number of elements in the current vector is greater than the number of elements available in the destination array. + + + Copies the vector instance to a specified destination array starting at a specified index position. + The array to receive a copy of the vector values. + The starting index in destination at which to begin the copy operation. + destination is null. + The number of elements in the current instance is greater than the number of elements available from startIndex to the end of the destination array. + index is less than zero or greater than the last index in destination. + + + Returns the number of elements stored in the vector. + The number of elements stored in the vector. + Access to the property getter via reflection is not supported. + + + Returns a value that indicates whether this instance is equal to a specified vector. + The vector to compare with this instance. + true if the current instance and other are equal; otherwise, false. + + + Returns a value that indicates whether this instance is equal to a specified object. + The object to compare with this instance. + true if the current instance and obj are equal; otherwise, false. The method returns false if obj is null, or if obj is a vector of a different type than the current instance. + + + Returns the hash code for this instance. + The hash code. + + + Gets the element at a specified index. + The index of the element to return. + The element at index index. + index is less than zero. -or- index is greater than or equal to . + + + Returns a vector containing all ones. + A vector containing all ones. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Returns a new vector by performing a bitwise And operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise And of left and right. + + + Returns a new vector by performing a bitwise Or operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise Or of the elements in left and right. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Returns a value that indicates whether each pair of elements in two specified vectors are equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a new vector by performing a bitwise XOr operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise XOr of the elements in left and right. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Returns a value that indicates whether any single pair of elements in the specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if any element pairs in left and right are equal. false if no element pairs are equal. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar value. + The source vector. + A scalar value. + The scaled vector. + + + Multiplies a vector by the given scalar. + The scalar value. + The source vector. + The scaled vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The one's complement vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates a given vector. + The vector to negate. + The negated vector. + + + Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Returns the string representation of this vector using default formatting. + The string representation of this vector. + + + Returns the string representation of this vector using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns a vector containing all zeroes. + A vector containing all zeroes. + + + Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors. + + + Returns a new vector whose elements are the absolute values of the given vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The absolute value vector. + + + Returns a new vector whose values are the sum of each pair of elements from two given vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The summed vector. + + + Returns a new vector by performing a bitwise And Not operation on each pair of corresponding elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a double-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of signed bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a single-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Returns a new vector by performing a bitwise And operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector by performing a bitwise Or operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Creates a new single-precision vector with elements selected between two specified single-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new double-precision vector with elements selected between two specified double-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new vector of a specified type with elements selected between two specified source vectors of the same type based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The vector type. T can be any primitive numeric type. + The new vector with elements selected based on the mask. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose values are the result of dividing the first vector's elements by the corresponding elements in the second vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The divided vector. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The dot product. + + + Returns a new integral vector whose elements signal whether the elements in two specified double-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified integral vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in two specified long integer vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified single-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in two specified vectors of the same type are equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether each pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left and right are equal; otherwise, false. + + + Returns a value that indicates whether any single pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element pair in left and right is equal; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are greater than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are greater than their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than their corresponding elements in the second vector of the same time. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the single-precision floating-point second vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than or equal to their corresponding elements in the second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than or equal to their corresponding elements in the second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than or equal to their corresponding elements in the second vector of the same type. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than or equal to all the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than or equal to the corresponding element in right; otherwise, false. + + + Gets a value that indicates whether vector operations are subject to hardware acceleration through JIT intrinsic support. + true if vector operations are subject to hardware acceleration; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision vector are less than their corresponding elements in a second single-precision vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in one vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all of the elements in the first vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than or equal to their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than or equal to their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less or equal to their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are less than or equal to their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than or equal to the corresponding element in right; otherwise, false. + + + Returns a new vector whose elements are the maximum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The maximum vector. + + + Returns a new vector whose elements are the minimum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The minimum vector. + + + Returns a new vector whose values are a scalar value multiplied by each of the values of a specified vector. + The scalar value. + The vector. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + Returns a new vector whose values are the product of each pair of elements in two specified vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The product vector. + + + Returns a new vector whose values are the values of a specified vector each multiplied by a scalar value. + The vector. + The scalar value. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose elements are the negation of the corresponding element in the specified vector. + The source vector. + The vector type. T can be any primitive numeric type. + The negated vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector whose elements are the square roots of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The square root vector. + + + Returns a new vector whose values are the difference between the elements in the second vector and their corresponding elements in the first vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The difference vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector by performing a bitwise exclusive Or (XOr) operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Represents a vector with two single-precision floating-point values. + + + Creates a new object whose two elements have the same value. + The value to assign to both elements. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of the vector. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 2 elements are equal to one. + A vector whose two elements are equal to one (that is, it returns the vector (1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 3x2 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 3x2 matrix. + The source vector. + The matrix. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0). + The vector (1,0). + + + Gets the vector (0,1). + The vector (0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + Returns a vector whose 2 elements are equal to zero. + A vector whose two elements are equal to zero (that is, it returns the vector (0,0). + + + Represents a vector with three single-precision floating-point values. + + + Creates a new object whose three elements have the same value. + The value to assign to all three elements. + + + Creates a new object from the specified object and the specified value. + The vector with two elements. + The additional value to assign to the field. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the cross product of two vectors. + The first vector. + The second vector. + The cross product. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 3 elements are equal to one. + A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0,0). + The vector (1,0,0). + + + Gets the vector (0,1,0). + The vector (0,1,0).. + + + Gets the vector (0,0,1). + The vector (0,0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 3 elements are equal to zero. + A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). + + + Represents a vector with four single-precision floating-point values. + + + Creates a new object whose four elements have the same value. + The value to assign to all four elements. + + + Constructs a new object from the specified object and a W component. + The vector to use for the X, Y, and Z components. + The W component. + + + Creates a new object from the specified object and a Z and a W component. + The vector to use for the X and Y components. + The Z component. + The W component. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 4 elements are equal to one. + Returns . + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a four-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a four-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a three-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a two-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a two-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a three-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Gets the vector (0,0,0,1). + The vector (0,0,0,1). + + + Gets the vector (1,0,0,0). + The vector (1,0,0,0). + + + Gets the vector (0,1,0,0). + The vector (0,1,0,0).. + + + Gets a vector whose 4 elements are equal to zero. + The vector (0,0,1,0). + + + The W component of the vector. + + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 4 elements are equal to zero. + A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netcoreapp2.0/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netcoreapp2.0/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard1.0/System.Numerics.Vectors.dll b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard1.0/System.Numerics.Vectors.dll new file mode 100644 index 0000000000000000000000000000000000000000..46308fdb3acf521d69320d5d9f7436fafb898d63 GIT binary patch literal 161152 zcmeFa36z}Ibsku#s;;d!{9QmdHWC0ykVP~X5X}Xo7BneRyC|BQstdG4N`@p-lqeCD zY!hf1@)l1_nYKLfI8I{Aju~Yf&&08v*l{wEV$Vq9IF?Nz$958r!YE_MImwyK@tn-b zBq#EG-@W%Ox9Ug#%?8_15<*n{_uc!w`|jKCegD$$82we(>=#hd%oBQy+Nxu@4`5-(w&7$WzZ8dhh8& zPk;O)haUgPp}XJtz@ZO6^)07wn4RriWvcJHr&fFWj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mooItz9r3 z3m^kC{r?-^EHGIotksxKf`hk}G@B3Id15RvUK=3r{mch7XFqy`6<~GmGdWl1a5Pa6 zX`JTD{kFDRzpVI;@Pf|qSP9l3b(5!r!Ir801`~C!ElqQ{z}&7qUrD>sF2~{xFT<4VltXxc`(YO#d_Q6GL+wnEEz^QJOtfixepzk}Jhz~g4 uXXAsf=li1V!6jLQt-mzuJUCn7RY`W?{hCbD8@(30ZT_X^842xu)BF!=*&KiX literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard1.0/System.Numerics.Vectors.xml b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard1.0/System.Numerics.Vectors.xml new file mode 100644 index 00000000..51297939 --- /dev/null +++ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard1.0/System.Numerics.Vectors.xml @@ -0,0 +1,2597 @@ + + + + System.Numerics.Vectors + + + + Represents a 3x2 matrix. + + + Creates a 3x2 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a rotation matrix using the given rotation in radians. + The amount of rotation, in radians. + The rotation matrix. + + + Creates a rotation matrix using the specified rotation in radians and a center point. + The amount of rotation, in radians. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified X and Y components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the specified scale with an offset from the specified center. + The uniform scale to use. + The center offset. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The center point. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the given scale. + The uniform scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale with an offset from the specified center point. + The scale to use. + The center offset. + The scaling matrix. + + + Creates a skew matrix from the specified angles in radians. + The X angle, in radians. + The Y angle, in radians. + The skew matrix. + + + Creates a skew matrix from the specified angles in radians and a center point. + The X angle, in radians. + The Y angle, in radians. + The center point. + The skew matrix. + + + Creates a translation matrix from the specified 2-dimensional vector. + The translation position. + The translation matrix. + + + Creates a translation matrix from the specified X and Y components. + The X position. + The Y position. + The translation matrix. + + + Returns a value that indicates whether this instance and another 3x2 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant for this matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + The multiplicative identify matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Represents a 4x4 matrix. + + + Creates a object from a specified object. + A 3x2 matrix. + + + Creates a 4x4 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the third element in the first row. + The value to assign to the fourth element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the third element in the second row. + The value to assign to the third element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + The value to assign to the third element in the third row. + The value to assign to the fourth element in the third row. + The value to assign to the first element in the fourth row. + The value to assign to the second element in the fourth row. + The value to assign to the third element in the fourth row. + The value to assign to the fourth element in the fourth row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a spherical billboard that rotates around a specified object position. + The position of the object that the billboard will rotate around. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard. + + + Creates a cylindrical billboard that rotates around a specified axis. + The position of the object that the billboard will rotate around. + The position of the camera. + The axis to rotate the billboard around. + The forward vector of the camera. + The forward vector of the object. + The billboard matrix. + + + Creates a matrix that rotates around an arbitrary vector. + The axis to rotate around. + The angle to rotate around axis, in radians. + The rotation matrix. + + + Creates a rotation matrix from the specified Quaternion rotation value. + The source Quaternion. + The rotation matrix. + + + Creates a rotation matrix from the specified yaw, pitch, and roll. + The angle of rotation, in radians, around the Y axis. + The angle of rotation, in radians, around the X axis. + The angle of rotation, in radians, around the Z axis. + The rotation matrix. + + + Creates a view matrix. + The position of the camera. + The target towards which the camera is pointing. + The direction that is "up" from the camera's point of view. + The view matrix. + + + Creates an orthographic perspective matrix from the given view volume dimensions. + The width of the view volume. + The height of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a customized orthographic projection matrix. + The minimum X-value of the view volume. + The maximum X-value of the view volume. + The minimum Y-value of the view volume. + The maximum Y-value of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a perspective projection matrix from the given view volume dimensions. + The width of the view volume at the near view plane. + The height of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. + The field of view in the y direction, in radians. + The aspect ratio, defined as view space width divided by height. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + fieldOfView is less than or equal to zero. -or- fieldOfView is greater than or equal to . nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a customized perspective projection matrix. + The minimum x-value of the view volume at the near view plane. + The maximum x-value of the view volume at the near view plane. + The minimum y-value of the view volume at the near view plane. + The maximum y-value of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a matrix that reflects the coordinate system about a specified plane. + The plane about which to create a reflection. + A new matrix expressing the reflection. + + + Creates a matrix for rotating points around the X axis. + The amount, in radians, by which to rotate around the X axis. + The rotation matrix. + + + Creates a matrix for rotating points around the X axis from a center point. + The amount, in radians, by which to rotate around the X axis. + The center point. + The rotation matrix. + + + The amount, in radians, by which to rotate around the Y axis from a center point. + The amount, in radians, by which to rotate around the Y-axis. + The center point. + The rotation matrix. + + + Creates a matrix for rotating points around the Y axis. + The amount, in radians, by which to rotate around the Y-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis. + The amount, in radians, by which to rotate around the Z-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis from a center point. + The amount, in radians, by which to rotate around the Z-axis. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a uniform scaling matrix that scale equally on each axis. + The uniform scaling factor. + The scaling matrix. + + + Creates a scaling matrix with a center point. + The vector that contains the amount to scale on each axis. + The center point. + The scaling matrix. + + + Creates a uniform scaling matrix that scales equally on each axis with a center point. + The uniform scaling factor. + The center point. + The scaling matrix. + + + Creates a scaling matrix from the specified X, Y, and Z components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The center point. + The scaling matrix. + + + Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source. + The direction from which the light that will cast the shadow is coming. + The plane onto which the new matrix should flatten geometry so as to cast a shadow. + A new matrix that can be used to flatten geometry onto the specified plane from the specified direction. + + + Creates a translation matrix from the specified 3-dimensional vector. + The amount to translate in each axis. + The translation matrix. + + + Creates a translation matrix from the specified X, Y, and Z components. + The amount to translate on the X axis. + The amount to translate on the Y axis. + The amount to translate on the Z axis. + The translation matrix. + + + Creates a world matrix with the specified parameters. + The position of the object. + The forward direction of the object. + The upward direction of the object. Its value is usually [0, 1, 0]. + The world matrix. + + + Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. The return value indicates whether the operation succeeded. + The source matrix. + When this method returns, contains the scaling component of the transformation matrix if the operation succeeded. + When this method returns, contains the rotation component of the transformation matrix if the operation succeeded. + When the method returns, contains the translation component of the transformation matrix if the operation succeeded. + true if matrix was decomposed successfully; otherwise, false. + + + Returns a value that indicates whether this instance and another 4x4 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant of the current 4x4 matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + Gets the multiplicative identity matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The third element of the first row. + + + + The fourth element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The third element of the second row. + + + + The fourth element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + The third element of the third row. + + + + The fourth element of the third row. + + + + The first element of the fourth row. + + + + The second element of the fourth row. + + + + The third element of the fourth row. + + + + The fourth element of the fourth row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to care + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Transforms the specified matrix by applying the specified Quaternion rotation. + The matrix to transform. + The rotation t apply. + The transformed matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Transposes the rows and columns of a matrix. + The matrix to transpose. + The transposed matrix. + + + Represents a three-dimensional plane. + + + Creates a object from a specified four-dimensional vector. + A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. + + + Creates a object from a specified normal and the distance along the normal from the origin. + The plane's normal vector. + The plane's distance from the origin along its normal vector. + + + Creates a object from the X, Y, and Z components of its normal, and its distance from the origin on that normal. + The X component of the normal. + The Y component of the normal. + The Z component of the normal. + The distance of the plane along its normal from the origin. + + + Creates a object that contains three specified points. + The first point defining the plane. + The second point defining the plane. + The third point defining the plane. + The plane containing the three points. + + + The distance of the plane along its normal from the origin. + + + + Calculates the dot product of a plane and a 4-dimensional vector. + The plane. + The four-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. + The plane. + The 3-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the vector of this plane. + The plane. + The three-dimensional vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another plane object are equal. + The other plane. + true if the two planes are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + The normal vector of the plane. + + + + Creates a new object whose normal vector is the source plane's normal vector normalized. + The source plane. + The normalized plane. + + + Returns a value that indicates whether two planes are equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether two planes are not equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the string representation of this plane object. + A string that represents this object. + + + Transforms a normalized plane by a 4x4 matrix. + The normalized plane to transform. + The transformation matrix to apply to plane. + The transformed plane. + + + Transforms a normalized plane by a Quaternion rotation. + The normalized plane to transform. + The Quaternion rotation to apply to the plane. + A new plane that results from applying the Quaternion rotation. + + + Represents a vector that is used to encode three-dimensional physical rotations. + + + Creates a quaternion from the specified vector and rotation parts. + The vector part of the quaternion. + The rotation part of the quaternion. + + + Constructs a quaternion from the specified components. + The value to assign to the X component of the quaternion. + The value to assign to the Y component of the quaternion. + The value to assign to the Z component of the quaternion. + The value to assign to the W component of the quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Concatenates two quaternions. + The first quaternion rotation in the series. + The second quaternion rotation in the series. + A new quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. + + + Returns the conjugate of a specified quaternion. + The quaternion. + A new quaternion that is the conjugate of value. + + + Creates a quaternion from a vector and an angle to rotate about the vector. + The vector to rotate around. + The angle, in radians, to rotate around the vector. + The newly created quaternion. + + + Creates a quaternion from the specified rotation matrix. + The rotation matrix. + The newly created quaternion. + + + Creates a new quaternion from the given yaw, pitch, and roll. + The yaw angle, in radians, around the Y axis. + The pitch angle, in radians, around the X axis. + The roll angle, in radians, around the Z axis. + The resulting quaternion. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Calculates the dot product of two quaternions. + The first quaternion. + The second quaternion. + The dot product. + + + Returns a value that indicates whether this instance and another quaternion are equal. + The other quaternion. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Gets a quaternion that represents no rotation. + A quaternion whose values are (0, 0, 0, 1). + + + Returns the inverse of a quaternion. + The quaternion. + The inverted quaternion. + + + Gets a value that indicates whether the current instance is the identity quaternion. + true if the current instance is the identity quaternion; otherwise, false. + + + Calculates the length of the quaternion. + The computed length of the quaternion. + + + Calculates the squared length of the quaternion. + The length squared of the quaternion. + + + Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. + The first quaternion. + The second quaternion. + The relative weight of quaternion2 in the interpolation. + The interpolated quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Divides each component of a specified by its length. + The quaternion to normalize. + The normalized quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Returns a value that indicates whether two quaternions are equal. + The first quaternion to compare. + The second quaternion to compare. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether two quaternions are not equal. + The first quaternion to compare. + The second quaternion to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Interpolates between two quaternions, using spherical linear interpolation. + The first quaternion. + The second quaternion. + The relative weight of the second quaternion in the interpolation. + The interpolated quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this quaternion. + The string representation of this quaternion. + + + The rotation component of the quaternion. + + + + The X value of the vector component of the quaternion. + + + + The Y value of the vector component of the quaternion. + + + + The Z value of the vector component of the quaternion. + + + + Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + The vector type. T can be any primitive numeric type. + + + Creates a vector whose components are of a specified type. + The numeric type that defines the type of the components in the vector. + + + Creates a vector from a specified array. + A numeric array. + values is null. + + + Creates a vector from a specified array starting at a specified index position. + A numeric array. + The starting index position from which to create the vector. + values is null. + index is less than zero. -or- The length of values minus index is less than . + + + Copies the vector instance to a specified destination array. + The array to receive a copy of the vector values. + destination is null. + The number of elements in the current vector is greater than the number of elements available in the destination array. + + + Copies the vector instance to a specified destination array starting at a specified index position. + The array to receive a copy of the vector values. + The starting index in destination at which to begin the copy operation. + destination is null. + The number of elements in the current instance is greater than the number of elements available from startIndex to the end of the destination array. + index is less than zero or greater than the last index in destination. + + + Returns the number of elements stored in the vector. + The number of elements stored in the vector. + Access to the property getter via reflection is not supported. + + + Returns a value that indicates whether this instance is equal to a specified vector. + The vector to compare with this instance. + true if the current instance and other are equal; otherwise, false. + + + Returns a value that indicates whether this instance is equal to a specified object. + The object to compare with this instance. + true if the current instance and obj are equal; otherwise, false. The method returns false if obj is null, or if obj is a vector of a different type than the current instance. + + + Returns the hash code for this instance. + The hash code. + + + Gets the element at a specified index. + The index of the element to return. + The element at index index. + index is less than zero. -or- index is greater than or equal to . + + + Returns a vector containing all ones. + A vector containing all ones. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Returns a new vector by performing a bitwise And operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise And of left and right. + + + Returns a new vector by performing a bitwise Or operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise Or of the elements in left and right. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Returns a value that indicates whether each pair of elements in two specified vectors are equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a new vector by performing a bitwise XOr operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise XOr of the elements in left and right. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Returns a value that indicates whether any single pair of elements in the specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if any element pairs in left and right are equal. false if no element pairs are equal. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar value. + The source vector. + A scalar value. + The scaled vector. + + + Multiplies a vector by the given scalar. + The scalar value. + The source vector. + The scaled vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The one's complement vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates a given vector. + The vector to negate. + The negated vector. + + + Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Returns the string representation of this vector using default formatting. + The string representation of this vector. + + + Returns the string representation of this vector using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns a vector containing all zeroes. + A vector containing all zeroes. + + + Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors. + + + Returns a new vector whose elements are the absolute values of the given vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The absolute value vector. + + + Returns a new vector whose values are the sum of each pair of elements from two given vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The summed vector. + + + Returns a new vector by performing a bitwise And Not operation on each pair of corresponding elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a double-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of signed bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a single-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Returns a new vector by performing a bitwise And operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector by performing a bitwise Or operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Creates a new single-precision vector with elements selected between two specified single-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new double-precision vector with elements selected between two specified double-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new vector of a specified type with elements selected between two specified source vectors of the same type based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The vector type. T can be any primitive numeric type. + The new vector with elements selected based on the mask. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose values are the result of dividing the first vector's elements by the corresponding elements in the second vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The divided vector. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The dot product. + + + Returns a new integral vector whose elements signal whether the elements in two specified double-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified integral vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in two specified long integer vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified single-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in two specified vectors of the same type are equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether each pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left and right are equal; otherwise, false. + + + Returns a value that indicates whether any single pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element pair in left and right is equal; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are greater than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are greater than their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than their corresponding elements in the second vector of the same time. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the single-precision floating-point second vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than or equal to their corresponding elements in the second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than or equal to their corresponding elements in the second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than or equal to their corresponding elements in the second vector of the same type. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than or equal to all the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than or equal to the corresponding element in right; otherwise, false. + + + Gets a value that indicates whether vector operations are subject to hardware acceleration through JIT intrinsic support. + true if vector operations are subject to hardware acceleration; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision vector are less than their corresponding elements in a second single-precision vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in one vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all of the elements in the first vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than or equal to their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than or equal to their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less or equal to their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are less than or equal to their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than or equal to the corresponding element in right; otherwise, false. + + + Returns a new vector whose elements are the maximum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The maximum vector. + + + Returns a new vector whose elements are the minimum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The minimum vector. + + + Returns a new vector whose values are a scalar value multiplied by each of the values of a specified vector. + The scalar value. + The vector. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + Returns a new vector whose values are the product of each pair of elements in two specified vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The product vector. + + + Returns a new vector whose values are the values of a specified vector each multiplied by a scalar value. + The vector. + The scalar value. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose elements are the negation of the corresponding element in the specified vector. + The source vector. + The vector type. T can be any primitive numeric type. + The negated vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector whose elements are the square roots of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The square root vector. + + + Returns a new vector whose values are the difference between the elements in the second vector and their corresponding elements in the first vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The difference vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector by performing a bitwise exclusive Or (XOr) operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Represents a vector with two single-precision floating-point values. + + + Creates a new object whose two elements have the same value. + The value to assign to both elements. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of the vector. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 2 elements are equal to one. + A vector whose two elements are equal to one (that is, it returns the vector (1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 3x2 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 3x2 matrix. + The source vector. + The matrix. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0). + The vector (1,0). + + + Gets the vector (0,1). + The vector (0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + Returns a vector whose 2 elements are equal to zero. + A vector whose two elements are equal to zero (that is, it returns the vector (0,0). + + + Represents a vector with three single-precision floating-point values. + + + Creates a new object whose three elements have the same value. + The value to assign to all three elements. + + + Creates a new object from the specified object and the specified value. + The vector with two elements. + The additional value to assign to the field. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the cross product of two vectors. + The first vector. + The second vector. + The cross product. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 3 elements are equal to one. + A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0,0). + The vector (1,0,0). + + + Gets the vector (0,1,0). + The vector (0,1,0).. + + + Gets the vector (0,0,1). + The vector (0,0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 3 elements are equal to zero. + A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). + + + Represents a vector with four single-precision floating-point values. + + + Creates a new object whose four elements have the same value. + The value to assign to all four elements. + + + Constructs a new object from the specified object and a W component. + The vector to use for the X, Y, and Z components. + The W component. + + + Creates a new object from the specified object and a Z and a W component. + The vector to use for the X and Y components. + The Z component. + The W component. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 4 elements are equal to one. + Returns . + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a four-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a four-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a three-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a two-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a two-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a three-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Gets the vector (0,0,0,1). + The vector (0,0,0,1). + + + Gets the vector (1,0,0,0). + The vector (1,0,0,0). + + + Gets the vector (0,1,0,0). + The vector (0,1,0,0).. + + + Gets a vector whose 4 elements are equal to zero. + The vector (0,0,1,0). + + + The W component of the vector. + + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 4 elements are equal to zero. + A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard2.0/System.Numerics.Vectors.dll b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard2.0/System.Numerics.Vectors.dll new file mode 100644 index 0000000000000000000000000000000000000000..a808165accf4b28833d22169931d4c879defd96d GIT binary patch literal 163712 zcmeFa36z}Ibsku#s;;d!{9Qm}B>|8CSwuHU5a0q(649hcEtEtt+*DPdB}y_Rk)lY6 zkYt$vWXM|_o3?B@@pwFmBP*trI8N-?j<+}?#h#JIPAr>3#>>Pb^T^}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vi literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard2.0/System.Numerics.Vectors.xml b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard2.0/System.Numerics.Vectors.xml new file mode 100644 index 00000000..51297939 --- /dev/null +++ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/netstandard2.0/System.Numerics.Vectors.xml @@ -0,0 +1,2597 @@ + + + + System.Numerics.Vectors + + + + Represents a 3x2 matrix. + + + Creates a 3x2 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a rotation matrix using the given rotation in radians. + The amount of rotation, in radians. + The rotation matrix. + + + Creates a rotation matrix using the specified rotation in radians and a center point. + The amount of rotation, in radians. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified X and Y components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the specified scale with an offset from the specified center. + The uniform scale to use. + The center offset. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The center point. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the given scale. + The uniform scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale with an offset from the specified center point. + The scale to use. + The center offset. + The scaling matrix. + + + Creates a skew matrix from the specified angles in radians. + The X angle, in radians. + The Y angle, in radians. + The skew matrix. + + + Creates a skew matrix from the specified angles in radians and a center point. + The X angle, in radians. + The Y angle, in radians. + The center point. + The skew matrix. + + + Creates a translation matrix from the specified 2-dimensional vector. + The translation position. + The translation matrix. + + + Creates a translation matrix from the specified X and Y components. + The X position. + The Y position. + The translation matrix. + + + Returns a value that indicates whether this instance and another 3x2 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant for this matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + The multiplicative identify matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Represents a 4x4 matrix. + + + Creates a object from a specified object. + A 3x2 matrix. + + + Creates a 4x4 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the third element in the first row. + The value to assign to the fourth element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the third element in the second row. + The value to assign to the third element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + The value to assign to the third element in the third row. + The value to assign to the fourth element in the third row. + The value to assign to the first element in the fourth row. + The value to assign to the second element in the fourth row. + The value to assign to the third element in the fourth row. + The value to assign to the fourth element in the fourth row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a spherical billboard that rotates around a specified object position. + The position of the object that the billboard will rotate around. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard. + + + Creates a cylindrical billboard that rotates around a specified axis. + The position of the object that the billboard will rotate around. + The position of the camera. + The axis to rotate the billboard around. + The forward vector of the camera. + The forward vector of the object. + The billboard matrix. + + + Creates a matrix that rotates around an arbitrary vector. + The axis to rotate around. + The angle to rotate around axis, in radians. + The rotation matrix. + + + Creates a rotation matrix from the specified Quaternion rotation value. + The source Quaternion. + The rotation matrix. + + + Creates a rotation matrix from the specified yaw, pitch, and roll. + The angle of rotation, in radians, around the Y axis. + The angle of rotation, in radians, around the X axis. + The angle of rotation, in radians, around the Z axis. + The rotation matrix. + + + Creates a view matrix. + The position of the camera. + The target towards which the camera is pointing. + The direction that is "up" from the camera's point of view. + The view matrix. + + + Creates an orthographic perspective matrix from the given view volume dimensions. + The width of the view volume. + The height of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a customized orthographic projection matrix. + The minimum X-value of the view volume. + The maximum X-value of the view volume. + The minimum Y-value of the view volume. + The maximum Y-value of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a perspective projection matrix from the given view volume dimensions. + The width of the view volume at the near view plane. + The height of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. + The field of view in the y direction, in radians. + The aspect ratio, defined as view space width divided by height. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + fieldOfView is less than or equal to zero. -or- fieldOfView is greater than or equal to . nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a customized perspective projection matrix. + The minimum x-value of the view volume at the near view plane. + The maximum x-value of the view volume at the near view plane. + The minimum y-value of the view volume at the near view plane. + The maximum y-value of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a matrix that reflects the coordinate system about a specified plane. + The plane about which to create a reflection. + A new matrix expressing the reflection. + + + Creates a matrix for rotating points around the X axis. + The amount, in radians, by which to rotate around the X axis. + The rotation matrix. + + + Creates a matrix for rotating points around the X axis from a center point. + The amount, in radians, by which to rotate around the X axis. + The center point. + The rotation matrix. + + + The amount, in radians, by which to rotate around the Y axis from a center point. + The amount, in radians, by which to rotate around the Y-axis. + The center point. + The rotation matrix. + + + Creates a matrix for rotating points around the Y axis. + The amount, in radians, by which to rotate around the Y-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis. + The amount, in radians, by which to rotate around the Z-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis from a center point. + The amount, in radians, by which to rotate around the Z-axis. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a uniform scaling matrix that scale equally on each axis. + The uniform scaling factor. + The scaling matrix. + + + Creates a scaling matrix with a center point. + The vector that contains the amount to scale on each axis. + The center point. + The scaling matrix. + + + Creates a uniform scaling matrix that scales equally on each axis with a center point. + The uniform scaling factor. + The center point. + The scaling matrix. + + + Creates a scaling matrix from the specified X, Y, and Z components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The center point. + The scaling matrix. + + + Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source. + The direction from which the light that will cast the shadow is coming. + The plane onto which the new matrix should flatten geometry so as to cast a shadow. + A new matrix that can be used to flatten geometry onto the specified plane from the specified direction. + + + Creates a translation matrix from the specified 3-dimensional vector. + The amount to translate in each axis. + The translation matrix. + + + Creates a translation matrix from the specified X, Y, and Z components. + The amount to translate on the X axis. + The amount to translate on the Y axis. + The amount to translate on the Z axis. + The translation matrix. + + + Creates a world matrix with the specified parameters. + The position of the object. + The forward direction of the object. + The upward direction of the object. Its value is usually [0, 1, 0]. + The world matrix. + + + Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. The return value indicates whether the operation succeeded. + The source matrix. + When this method returns, contains the scaling component of the transformation matrix if the operation succeeded. + When this method returns, contains the rotation component of the transformation matrix if the operation succeeded. + When the method returns, contains the translation component of the transformation matrix if the operation succeeded. + true if matrix was decomposed successfully; otherwise, false. + + + Returns a value that indicates whether this instance and another 4x4 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant of the current 4x4 matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + Gets the multiplicative identity matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The third element of the first row. + + + + The fourth element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The third element of the second row. + + + + The fourth element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + The third element of the third row. + + + + The fourth element of the third row. + + + + The first element of the fourth row. + + + + The second element of the fourth row. + + + + The third element of the fourth row. + + + + The fourth element of the fourth row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to care + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Transforms the specified matrix by applying the specified Quaternion rotation. + The matrix to transform. + The rotation t apply. + The transformed matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Transposes the rows and columns of a matrix. + The matrix to transpose. + The transposed matrix. + + + Represents a three-dimensional plane. + + + Creates a object from a specified four-dimensional vector. + A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. + + + Creates a object from a specified normal and the distance along the normal from the origin. + The plane's normal vector. + The plane's distance from the origin along its normal vector. + + + Creates a object from the X, Y, and Z components of its normal, and its distance from the origin on that normal. + The X component of the normal. + The Y component of the normal. + The Z component of the normal. + The distance of the plane along its normal from the origin. + + + Creates a object that contains three specified points. + The first point defining the plane. + The second point defining the plane. + The third point defining the plane. + The plane containing the three points. + + + The distance of the plane along its normal from the origin. + + + + Calculates the dot product of a plane and a 4-dimensional vector. + The plane. + The four-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. + The plane. + The 3-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the vector of this plane. + The plane. + The three-dimensional vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another plane object are equal. + The other plane. + true if the two planes are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + The normal vector of the plane. + + + + Creates a new object whose normal vector is the source plane's normal vector normalized. + The source plane. + The normalized plane. + + + Returns a value that indicates whether two planes are equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether two planes are not equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the string representation of this plane object. + A string that represents this object. + + + Transforms a normalized plane by a 4x4 matrix. + The normalized plane to transform. + The transformation matrix to apply to plane. + The transformed plane. + + + Transforms a normalized plane by a Quaternion rotation. + The normalized plane to transform. + The Quaternion rotation to apply to the plane. + A new plane that results from applying the Quaternion rotation. + + + Represents a vector that is used to encode three-dimensional physical rotations. + + + Creates a quaternion from the specified vector and rotation parts. + The vector part of the quaternion. + The rotation part of the quaternion. + + + Constructs a quaternion from the specified components. + The value to assign to the X component of the quaternion. + The value to assign to the Y component of the quaternion. + The value to assign to the Z component of the quaternion. + The value to assign to the W component of the quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Concatenates two quaternions. + The first quaternion rotation in the series. + The second quaternion rotation in the series. + A new quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. + + + Returns the conjugate of a specified quaternion. + The quaternion. + A new quaternion that is the conjugate of value. + + + Creates a quaternion from a vector and an angle to rotate about the vector. + The vector to rotate around. + The angle, in radians, to rotate around the vector. + The newly created quaternion. + + + Creates a quaternion from the specified rotation matrix. + The rotation matrix. + The newly created quaternion. + + + Creates a new quaternion from the given yaw, pitch, and roll. + The yaw angle, in radians, around the Y axis. + The pitch angle, in radians, around the X axis. + The roll angle, in radians, around the Z axis. + The resulting quaternion. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Calculates the dot product of two quaternions. + The first quaternion. + The second quaternion. + The dot product. + + + Returns a value that indicates whether this instance and another quaternion are equal. + The other quaternion. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Gets a quaternion that represents no rotation. + A quaternion whose values are (0, 0, 0, 1). + + + Returns the inverse of a quaternion. + The quaternion. + The inverted quaternion. + + + Gets a value that indicates whether the current instance is the identity quaternion. + true if the current instance is the identity quaternion; otherwise, false. + + + Calculates the length of the quaternion. + The computed length of the quaternion. + + + Calculates the squared length of the quaternion. + The length squared of the quaternion. + + + Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. + The first quaternion. + The second quaternion. + The relative weight of quaternion2 in the interpolation. + The interpolated quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Divides each component of a specified by its length. + The quaternion to normalize. + The normalized quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Returns a value that indicates whether two quaternions are equal. + The first quaternion to compare. + The second quaternion to compare. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether two quaternions are not equal. + The first quaternion to compare. + The second quaternion to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Interpolates between two quaternions, using spherical linear interpolation. + The first quaternion. + The second quaternion. + The relative weight of the second quaternion in the interpolation. + The interpolated quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this quaternion. + The string representation of this quaternion. + + + The rotation component of the quaternion. + + + + The X value of the vector component of the quaternion. + + + + The Y value of the vector component of the quaternion. + + + + The Z value of the vector component of the quaternion. + + + + Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + The vector type. T can be any primitive numeric type. + + + Creates a vector whose components are of a specified type. + The numeric type that defines the type of the components in the vector. + + + Creates a vector from a specified array. + A numeric array. + values is null. + + + Creates a vector from a specified array starting at a specified index position. + A numeric array. + The starting index position from which to create the vector. + values is null. + index is less than zero. -or- The length of values minus index is less than . + + + Copies the vector instance to a specified destination array. + The array to receive a copy of the vector values. + destination is null. + The number of elements in the current vector is greater than the number of elements available in the destination array. + + + Copies the vector instance to a specified destination array starting at a specified index position. + The array to receive a copy of the vector values. + The starting index in destination at which to begin the copy operation. + destination is null. + The number of elements in the current instance is greater than the number of elements available from startIndex to the end of the destination array. + index is less than zero or greater than the last index in destination. + + + Returns the number of elements stored in the vector. + The number of elements stored in the vector. + Access to the property getter via reflection is not supported. + + + Returns a value that indicates whether this instance is equal to a specified vector. + The vector to compare with this instance. + true if the current instance and other are equal; otherwise, false. + + + Returns a value that indicates whether this instance is equal to a specified object. + The object to compare with this instance. + true if the current instance and obj are equal; otherwise, false. The method returns false if obj is null, or if obj is a vector of a different type than the current instance. + + + Returns the hash code for this instance. + The hash code. + + + Gets the element at a specified index. + The index of the element to return. + The element at index index. + index is less than zero. -or- index is greater than or equal to . + + + Returns a vector containing all ones. + A vector containing all ones. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Returns a new vector by performing a bitwise And operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise And of left and right. + + + Returns a new vector by performing a bitwise Or operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise Or of the elements in left and right. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Returns a value that indicates whether each pair of elements in two specified vectors are equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a new vector by performing a bitwise XOr operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise XOr of the elements in left and right. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Returns a value that indicates whether any single pair of elements in the specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if any element pairs in left and right are equal. false if no element pairs are equal. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar value. + The source vector. + A scalar value. + The scaled vector. + + + Multiplies a vector by the given scalar. + The scalar value. + The source vector. + The scaled vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The one's complement vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates a given vector. + The vector to negate. + The negated vector. + + + Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Returns the string representation of this vector using default formatting. + The string representation of this vector. + + + Returns the string representation of this vector using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns a vector containing all zeroes. + A vector containing all zeroes. + + + Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors. + + + Returns a new vector whose elements are the absolute values of the given vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The absolute value vector. + + + Returns a new vector whose values are the sum of each pair of elements from two given vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The summed vector. + + + Returns a new vector by performing a bitwise And Not operation on each pair of corresponding elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a double-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of signed bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a single-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Returns a new vector by performing a bitwise And operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector by performing a bitwise Or operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Creates a new single-precision vector with elements selected between two specified single-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new double-precision vector with elements selected between two specified double-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new vector of a specified type with elements selected between two specified source vectors of the same type based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The vector type. T can be any primitive numeric type. + The new vector with elements selected based on the mask. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose values are the result of dividing the first vector's elements by the corresponding elements in the second vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The divided vector. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The dot product. + + + Returns a new integral vector whose elements signal whether the elements in two specified double-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified integral vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in two specified long integer vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified single-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in two specified vectors of the same type are equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether each pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left and right are equal; otherwise, false. + + + Returns a value that indicates whether any single pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element pair in left and right is equal; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are greater than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are greater than their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than their corresponding elements in the second vector of the same time. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the single-precision floating-point second vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than or equal to their corresponding elements in the second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than or equal to their corresponding elements in the second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than or equal to their corresponding elements in the second vector of the same type. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than or equal to all the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than or equal to the corresponding element in right; otherwise, false. + + + Gets a value that indicates whether vector operations are subject to hardware acceleration through JIT intrinsic support. + true if vector operations are subject to hardware acceleration; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision vector are less than their corresponding elements in a second single-precision vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in one vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all of the elements in the first vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than or equal to their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than or equal to their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less or equal to their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are less than or equal to their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than or equal to the corresponding element in right; otherwise, false. + + + Returns a new vector whose elements are the maximum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The maximum vector. + + + Returns a new vector whose elements are the minimum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The minimum vector. + + + Returns a new vector whose values are a scalar value multiplied by each of the values of a specified vector. + The scalar value. + The vector. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + Returns a new vector whose values are the product of each pair of elements in two specified vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The product vector. + + + Returns a new vector whose values are the values of a specified vector each multiplied by a scalar value. + The vector. + The scalar value. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose elements are the negation of the corresponding element in the specified vector. + The source vector. + The vector type. T can be any primitive numeric type. + The negated vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector whose elements are the square roots of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The square root vector. + + + Returns a new vector whose values are the difference between the elements in the second vector and their corresponding elements in the first vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The difference vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector by performing a bitwise exclusive Or (XOr) operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Represents a vector with two single-precision floating-point values. + + + Creates a new object whose two elements have the same value. + The value to assign to both elements. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of the vector. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 2 elements are equal to one. + A vector whose two elements are equal to one (that is, it returns the vector (1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 3x2 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 3x2 matrix. + The source vector. + The matrix. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0). + The vector (1,0). + + + Gets the vector (0,1). + The vector (0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + Returns a vector whose 2 elements are equal to zero. + A vector whose two elements are equal to zero (that is, it returns the vector (0,0). + + + Represents a vector with three single-precision floating-point values. + + + Creates a new object whose three elements have the same value. + The value to assign to all three elements. + + + Creates a new object from the specified object and the specified value. + The vector with two elements. + The additional value to assign to the field. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the cross product of two vectors. + The first vector. + The second vector. + The cross product. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 3 elements are equal to one. + A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0,0). + The vector (1,0,0). + + + Gets the vector (0,1,0). + The vector (0,1,0).. + + + Gets the vector (0,0,1). + The vector (0,0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 3 elements are equal to zero. + A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). + + + Represents a vector with four single-precision floating-point values. + + + Creates a new object whose four elements have the same value. + The value to assign to all four elements. + + + Constructs a new object from the specified object and a W component. + The vector to use for the X, Y, and Z components. + The W component. + + + Creates a new object from the specified object and a Z and a W component. + The vector to use for the X and Y components. + The Z component. + The W component. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 4 elements are equal to one. + Returns . + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a four-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a four-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a three-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a two-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a two-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a three-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Gets the vector (0,0,0,1). + The vector (0,0,0,1). + + + Gets the vector (1,0,0,0). + The vector (1,0,0,0). + + + Gets the vector (0,1,0,0). + The vector (0,1,0,0).. + + + Gets a vector whose 4 elements are equal to zero. + The vector (0,0,1,0). + + + The W component of the vector. + + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 4 elements are equal to zero. + A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll new file mode 100644 index 0000000000000000000000000000000000000000..46308fdb3acf521d69320d5d9f7436fafb898d63 GIT binary patch literal 161152 zcmeFa36z}Ibsku#s;;d!{9QmdHWC0ykVP~X5X}Xo7BneRyC|BQstdG4N`@p-lqeCD zY!hf1@)l1_nYKLfI8I{Aju~Yf&&08v*l{wEV$Vq9IF?Nz$958r!YE_MImwyK@tn-b zBq#EG-@W%Ox9Ug#%?8_15<*n{_uc!w`|jKCegD$$82we(>=#hd%oBQy+Nxu@4`5-(w&7$WzZ8dhh8& zPk;O)haUgPp}XJtz@ZO6^)07wn4RriWvcJHr&fFWjz;YlzyGPVP})niD-KQXI997& zSFhDN%KgOKKpz7AD6X~IPN6~4ZvG3`+GoMUf6qSBK)qJKhfw~Pu9hSV|E_}Gc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pVI;@Pf|qSP9l3b(5!r!Ir801`~C!ElqQ{z}&7qUrD>sF2~{xFT<4VltXxc`(YO#d_Q6GL+wnEEz^QJOtfixepzk}Jhz~g4 uXXAsf=li1V!6jLQt-mzuJUCn7RY`W?{hCbD8@(30ZT_X^842xu)BF!=*&KiX literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.xml b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.xml new file mode 100644 index 00000000..51297939 --- /dev/null +++ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.xml @@ -0,0 +1,2597 @@ + + + + System.Numerics.Vectors + + + + Represents a 3x2 matrix. + + + Creates a 3x2 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a rotation matrix using the given rotation in radians. + The amount of rotation, in radians. + The rotation matrix. + + + Creates a rotation matrix using the specified rotation in radians and a center point. + The amount of rotation, in radians. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified X and Y components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the specified scale with an offset from the specified center. + The uniform scale to use. + The center offset. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The center point. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the given scale. + The uniform scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale with an offset from the specified center point. + The scale to use. + The center offset. + The scaling matrix. + + + Creates a skew matrix from the specified angles in radians. + The X angle, in radians. + The Y angle, in radians. + The skew matrix. + + + Creates a skew matrix from the specified angles in radians and a center point. + The X angle, in radians. + The Y angle, in radians. + The center point. + The skew matrix. + + + Creates a translation matrix from the specified 2-dimensional vector. + The translation position. + The translation matrix. + + + Creates a translation matrix from the specified X and Y components. + The X position. + The Y position. + The translation matrix. + + + Returns a value that indicates whether this instance and another 3x2 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant for this matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + The multiplicative identify matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Represents a 4x4 matrix. + + + Creates a object from a specified object. + A 3x2 matrix. + + + Creates a 4x4 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the third element in the first row. + The value to assign to the fourth element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the third element in the second row. + The value to assign to the third element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + The value to assign to the third element in the third row. + The value to assign to the fourth element in the third row. + The value to assign to the first element in the fourth row. + The value to assign to the second element in the fourth row. + The value to assign to the third element in the fourth row. + The value to assign to the fourth element in the fourth row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a spherical billboard that rotates around a specified object position. + The position of the object that the billboard will rotate around. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard. + + + Creates a cylindrical billboard that rotates around a specified axis. + The position of the object that the billboard will rotate around. + The position of the camera. + The axis to rotate the billboard around. + The forward vector of the camera. + The forward vector of the object. + The billboard matrix. + + + Creates a matrix that rotates around an arbitrary vector. + The axis to rotate around. + The angle to rotate around axis, in radians. + The rotation matrix. + + + Creates a rotation matrix from the specified Quaternion rotation value. + The source Quaternion. + The rotation matrix. + + + Creates a rotation matrix from the specified yaw, pitch, and roll. + The angle of rotation, in radians, around the Y axis. + The angle of rotation, in radians, around the X axis. + The angle of rotation, in radians, around the Z axis. + The rotation matrix. + + + Creates a view matrix. + The position of the camera. + The target towards which the camera is pointing. + The direction that is "up" from the camera's point of view. + The view matrix. + + + Creates an orthographic perspective matrix from the given view volume dimensions. + The width of the view volume. + The height of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a customized orthographic projection matrix. + The minimum X-value of the view volume. + The maximum X-value of the view volume. + The minimum Y-value of the view volume. + The maximum Y-value of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a perspective projection matrix from the given view volume dimensions. + The width of the view volume at the near view plane. + The height of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. + The field of view in the y direction, in radians. + The aspect ratio, defined as view space width divided by height. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + fieldOfView is less than or equal to zero. -or- fieldOfView is greater than or equal to . nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a customized perspective projection matrix. + The minimum x-value of the view volume at the near view plane. + The maximum x-value of the view volume at the near view plane. + The minimum y-value of the view volume at the near view plane. + The maximum y-value of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a matrix that reflects the coordinate system about a specified plane. + The plane about which to create a reflection. + A new matrix expressing the reflection. + + + Creates a matrix for rotating points around the X axis. + The amount, in radians, by which to rotate around the X axis. + The rotation matrix. + + + Creates a matrix for rotating points around the X axis from a center point. + The amount, in radians, by which to rotate around the X axis. + The center point. + The rotation matrix. + + + The amount, in radians, by which to rotate around the Y axis from a center point. + The amount, in radians, by which to rotate around the Y-axis. + The center point. + The rotation matrix. + + + Creates a matrix for rotating points around the Y axis. + The amount, in radians, by which to rotate around the Y-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis. + The amount, in radians, by which to rotate around the Z-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis from a center point. + The amount, in radians, by which to rotate around the Z-axis. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a uniform scaling matrix that scale equally on each axis. + The uniform scaling factor. + The scaling matrix. + + + Creates a scaling matrix with a center point. + The vector that contains the amount to scale on each axis. + The center point. + The scaling matrix. + + + Creates a uniform scaling matrix that scales equally on each axis with a center point. + The uniform scaling factor. + The center point. + The scaling matrix. + + + Creates a scaling matrix from the specified X, Y, and Z components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The center point. + The scaling matrix. + + + Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source. + The direction from which the light that will cast the shadow is coming. + The plane onto which the new matrix should flatten geometry so as to cast a shadow. + A new matrix that can be used to flatten geometry onto the specified plane from the specified direction. + + + Creates a translation matrix from the specified 3-dimensional vector. + The amount to translate in each axis. + The translation matrix. + + + Creates a translation matrix from the specified X, Y, and Z components. + The amount to translate on the X axis. + The amount to translate on the Y axis. + The amount to translate on the Z axis. + The translation matrix. + + + Creates a world matrix with the specified parameters. + The position of the object. + The forward direction of the object. + The upward direction of the object. Its value is usually [0, 1, 0]. + The world matrix. + + + Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. The return value indicates whether the operation succeeded. + The source matrix. + When this method returns, contains the scaling component of the transformation matrix if the operation succeeded. + When this method returns, contains the rotation component of the transformation matrix if the operation succeeded. + When the method returns, contains the translation component of the transformation matrix if the operation succeeded. + true if matrix was decomposed successfully; otherwise, false. + + + Returns a value that indicates whether this instance and another 4x4 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant of the current 4x4 matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + Gets the multiplicative identity matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The third element of the first row. + + + + The fourth element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The third element of the second row. + + + + The fourth element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + The third element of the third row. + + + + The fourth element of the third row. + + + + The first element of the fourth row. + + + + The second element of the fourth row. + + + + The third element of the fourth row. + + + + The fourth element of the fourth row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to care + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Transforms the specified matrix by applying the specified Quaternion rotation. + The matrix to transform. + The rotation t apply. + The transformed matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Transposes the rows and columns of a matrix. + The matrix to transpose. + The transposed matrix. + + + Represents a three-dimensional plane. + + + Creates a object from a specified four-dimensional vector. + A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. + + + Creates a object from a specified normal and the distance along the normal from the origin. + The plane's normal vector. + The plane's distance from the origin along its normal vector. + + + Creates a object from the X, Y, and Z components of its normal, and its distance from the origin on that normal. + The X component of the normal. + The Y component of the normal. + The Z component of the normal. + The distance of the plane along its normal from the origin. + + + Creates a object that contains three specified points. + The first point defining the plane. + The second point defining the plane. + The third point defining the plane. + The plane containing the three points. + + + The distance of the plane along its normal from the origin. + + + + Calculates the dot product of a plane and a 4-dimensional vector. + The plane. + The four-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. + The plane. + The 3-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the vector of this plane. + The plane. + The three-dimensional vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another plane object are equal. + The other plane. + true if the two planes are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + The normal vector of the plane. + + + + Creates a new object whose normal vector is the source plane's normal vector normalized. + The source plane. + The normalized plane. + + + Returns a value that indicates whether two planes are equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether two planes are not equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the string representation of this plane object. + A string that represents this object. + + + Transforms a normalized plane by a 4x4 matrix. + The normalized plane to transform. + The transformation matrix to apply to plane. + The transformed plane. + + + Transforms a normalized plane by a Quaternion rotation. + The normalized plane to transform. + The Quaternion rotation to apply to the plane. + A new plane that results from applying the Quaternion rotation. + + + Represents a vector that is used to encode three-dimensional physical rotations. + + + Creates a quaternion from the specified vector and rotation parts. + The vector part of the quaternion. + The rotation part of the quaternion. + + + Constructs a quaternion from the specified components. + The value to assign to the X component of the quaternion. + The value to assign to the Y component of the quaternion. + The value to assign to the Z component of the quaternion. + The value to assign to the W component of the quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Concatenates two quaternions. + The first quaternion rotation in the series. + The second quaternion rotation in the series. + A new quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. + + + Returns the conjugate of a specified quaternion. + The quaternion. + A new quaternion that is the conjugate of value. + + + Creates a quaternion from a vector and an angle to rotate about the vector. + The vector to rotate around. + The angle, in radians, to rotate around the vector. + The newly created quaternion. + + + Creates a quaternion from the specified rotation matrix. + The rotation matrix. + The newly created quaternion. + + + Creates a new quaternion from the given yaw, pitch, and roll. + The yaw angle, in radians, around the Y axis. + The pitch angle, in radians, around the X axis. + The roll angle, in radians, around the Z axis. + The resulting quaternion. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Calculates the dot product of two quaternions. + The first quaternion. + The second quaternion. + The dot product. + + + Returns a value that indicates whether this instance and another quaternion are equal. + The other quaternion. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Gets a quaternion that represents no rotation. + A quaternion whose values are (0, 0, 0, 1). + + + Returns the inverse of a quaternion. + The quaternion. + The inverted quaternion. + + + Gets a value that indicates whether the current instance is the identity quaternion. + true if the current instance is the identity quaternion; otherwise, false. + + + Calculates the length of the quaternion. + The computed length of the quaternion. + + + Calculates the squared length of the quaternion. + The length squared of the quaternion. + + + Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. + The first quaternion. + The second quaternion. + The relative weight of quaternion2 in the interpolation. + The interpolated quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Divides each component of a specified by its length. + The quaternion to normalize. + The normalized quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Returns a value that indicates whether two quaternions are equal. + The first quaternion to compare. + The second quaternion to compare. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether two quaternions are not equal. + The first quaternion to compare. + The second quaternion to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Interpolates between two quaternions, using spherical linear interpolation. + The first quaternion. + The second quaternion. + The relative weight of the second quaternion in the interpolation. + The interpolated quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this quaternion. + The string representation of this quaternion. + + + The rotation component of the quaternion. + + + + The X value of the vector component of the quaternion. + + + + The Y value of the vector component of the quaternion. + + + + The Z value of the vector component of the quaternion. + + + + Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + The vector type. T can be any primitive numeric type. + + + Creates a vector whose components are of a specified type. + The numeric type that defines the type of the components in the vector. + + + Creates a vector from a specified array. + A numeric array. + values is null. + + + Creates a vector from a specified array starting at a specified index position. + A numeric array. + The starting index position from which to create the vector. + values is null. + index is less than zero. -or- The length of values minus index is less than . + + + Copies the vector instance to a specified destination array. + The array to receive a copy of the vector values. + destination is null. + The number of elements in the current vector is greater than the number of elements available in the destination array. + + + Copies the vector instance to a specified destination array starting at a specified index position. + The array to receive a copy of the vector values. + The starting index in destination at which to begin the copy operation. + destination is null. + The number of elements in the current instance is greater than the number of elements available from startIndex to the end of the destination array. + index is less than zero or greater than the last index in destination. + + + Returns the number of elements stored in the vector. + The number of elements stored in the vector. + Access to the property getter via reflection is not supported. + + + Returns a value that indicates whether this instance is equal to a specified vector. + The vector to compare with this instance. + true if the current instance and other are equal; otherwise, false. + + + Returns a value that indicates whether this instance is equal to a specified object. + The object to compare with this instance. + true if the current instance and obj are equal; otherwise, false. The method returns false if obj is null, or if obj is a vector of a different type than the current instance. + + + Returns the hash code for this instance. + The hash code. + + + Gets the element at a specified index. + The index of the element to return. + The element at index index. + index is less than zero. -or- index is greater than or equal to . + + + Returns a vector containing all ones. + A vector containing all ones. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Returns a new vector by performing a bitwise And operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise And of left and right. + + + Returns a new vector by performing a bitwise Or operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise Or of the elements in left and right. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Returns a value that indicates whether each pair of elements in two specified vectors are equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a new vector by performing a bitwise XOr operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise XOr of the elements in left and right. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Returns a value that indicates whether any single pair of elements in the specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if any element pairs in left and right are equal. false if no element pairs are equal. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar value. + The source vector. + A scalar value. + The scaled vector. + + + Multiplies a vector by the given scalar. + The scalar value. + The source vector. + The scaled vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The one's complement vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates a given vector. + The vector to negate. + The negated vector. + + + Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Returns the string representation of this vector using default formatting. + The string representation of this vector. + + + Returns the string representation of this vector using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns a vector containing all zeroes. + A vector containing all zeroes. + + + Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors. + + + Returns a new vector whose elements are the absolute values of the given vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The absolute value vector. + + + Returns a new vector whose values are the sum of each pair of elements from two given vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The summed vector. + + + Returns a new vector by performing a bitwise And Not operation on each pair of corresponding elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a double-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of signed bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a single-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Returns a new vector by performing a bitwise And operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector by performing a bitwise Or operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Creates a new single-precision vector with elements selected between two specified single-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new double-precision vector with elements selected between two specified double-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new vector of a specified type with elements selected between two specified source vectors of the same type based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The vector type. T can be any primitive numeric type. + The new vector with elements selected based on the mask. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose values are the result of dividing the first vector's elements by the corresponding elements in the second vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The divided vector. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The dot product. + + + Returns a new integral vector whose elements signal whether the elements in two specified double-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified integral vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in two specified long integer vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified single-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in two specified vectors of the same type are equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether each pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left and right are equal; otherwise, false. + + + Returns a value that indicates whether any single pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element pair in left and right is equal; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are greater than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are greater than their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than their corresponding elements in the second vector of the same time. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the single-precision floating-point second vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than or equal to their corresponding elements in the second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than or equal to their corresponding elements in the second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than or equal to their corresponding elements in the second vector of the same type. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than or equal to all the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than or equal to the corresponding element in right; otherwise, false. + + + Gets a value that indicates whether vector operations are subject to hardware acceleration through JIT intrinsic support. + true if vector operations are subject to hardware acceleration; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision vector are less than their corresponding elements in a second single-precision vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in one vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all of the elements in the first vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than or equal to their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than or equal to their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less or equal to their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are less than or equal to their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than or equal to the corresponding element in right; otherwise, false. + + + Returns a new vector whose elements are the maximum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The maximum vector. + + + Returns a new vector whose elements are the minimum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The minimum vector. + + + Returns a new vector whose values are a scalar value multiplied by each of the values of a specified vector. + The scalar value. + The vector. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + Returns a new vector whose values are the product of each pair of elements in two specified vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The product vector. + + + Returns a new vector whose values are the values of a specified vector each multiplied by a scalar value. + The vector. + The scalar value. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose elements are the negation of the corresponding element in the specified vector. + The source vector. + The vector type. T can be any primitive numeric type. + The negated vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector whose elements are the square roots of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The square root vector. + + + Returns a new vector whose values are the difference between the elements in the second vector and their corresponding elements in the first vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The difference vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector by performing a bitwise exclusive Or (XOr) operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Represents a vector with two single-precision floating-point values. + + + Creates a new object whose two elements have the same value. + The value to assign to both elements. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of the vector. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 2 elements are equal to one. + A vector whose two elements are equal to one (that is, it returns the vector (1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 3x2 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 3x2 matrix. + The source vector. + The matrix. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0). + The vector (1,0). + + + Gets the vector (0,1). + The vector (0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + Returns a vector whose 2 elements are equal to zero. + A vector whose two elements are equal to zero (that is, it returns the vector (0,0). + + + Represents a vector with three single-precision floating-point values. + + + Creates a new object whose three elements have the same value. + The value to assign to all three elements. + + + Creates a new object from the specified object and the specified value. + The vector with two elements. + The additional value to assign to the field. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the cross product of two vectors. + The first vector. + The second vector. + The cross product. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 3 elements are equal to one. + A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0,0). + The vector (1,0,0). + + + Gets the vector (0,1,0). + The vector (0,1,0).. + + + Gets the vector (0,0,1). + The vector (0,0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 3 elements are equal to zero. + A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). + + + Represents a vector with four single-precision floating-point values. + + + Creates a new object whose four elements have the same value. + The value to assign to all four elements. + + + Constructs a new object from the specified object and a W component. + The vector to use for the X, Y, and Z components. + The W component. + + + Creates a new object from the specified object and a Z and a W component. + The vector to use for the X and Y components. + The Z component. + The W component. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 4 elements are equal to one. + Returns . + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a four-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a four-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a three-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a two-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a two-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a three-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Gets the vector (0,0,0,1). + The vector (0,0,0,1). + + + Gets the vector (1,0,0,0). + The vector (1,0,0,0). + + + Gets the vector (0,1,0,0). + The vector (0,1,0,0).. + + + Gets a vector whose 4 elements are equal to zero. + The vector (0,0,1,0). + + + The W component of the vector. + + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 4 elements are equal to zero. + A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarinios10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarinios10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarinmac20/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarinmac20/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarintvos10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarintvos10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarinwatchos10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/xamarinwatchos10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/MonoAndroid10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/MonoAndroid10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/MonoTouch10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/MonoTouch10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/net46/System.Numerics.Vectors.dll b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/net46/System.Numerics.Vectors.dll new file mode 100644 index 0000000000000000000000000000000000000000..e91f855a1235992af7c79b3dd157a2bf4133db61 GIT binary patch literal 29568 zcmeHw2S60dmUi_7q9lh@zq(=oJH^ zm@{HR3@8eU5hG^*>YipqulK(DcK7{vci;9{r|LUZUAazGovKFXxrKlX0H8qg?Hd4X z(8eAMoc=ksKl`b=h83LJj-U6Wm%ZxfSV;&3G zT)Ip~Ogs#T=QR_0VsYt1Gv=`Xz-kP{ouSqo4wg3(paNB809Mif;ODTpv>Cpc$whzc z5SWnhZ}o3F`KtsO09gvh(!wz8ix|c%98)D+C~TqhtLm#ZVX3H9!sMW*CbKVjwjY13+al0GptF z7?w=Mlf{gT3s1sAgi3S9g34@95Ch%Va8$9M?Pvq-g&2k?tY2WFL)Rk+}(z|{h=FX3cSGxOc?=Lh$zse8dIq_;)h5W7*qKn@&#@* zEL17qID~>Az>|Z3K9vt5Zvycl(g+Fo5=fXw8leC`08|BTy%)!3tn-NG%^poCD0d`f2T)VN5Kya;G;(Nyvhpv^_j z_nu`$12GC3(8JJ!TXvI;Ev;tL< zQU`wHB00(?u#byWDD~hV=RH2aqfOZYIyioOdK5i~ItjmZh!Ld$94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+ + + + Represents a 3x2 matrix. + + + Creates a 3x2 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a rotation matrix using the given rotation in radians. + The amount of rotation, in radians. + The rotation matrix. + + + Creates a rotation matrix using the specified rotation in radians and a center point. + The amount of rotation, in radians. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified X and Y components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the specified scale with an offset from the specified center. + The uniform scale to use. + The center offset. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The center point. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the given scale. + The uniform scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale with an offset from the specified center point. + The scale to use. + The center offset. + The scaling matrix. + + + Creates a skew matrix from the specified angles in radians. + The X angle, in radians. + The Y angle, in radians. + The skew matrix. + + + Creates a skew matrix from the specified angles in radians and a center point. + The X angle, in radians. + The Y angle, in radians. + The center point. + The skew matrix. + + + Creates a translation matrix from the specified 2-dimensional vector. + The translation position. + The translation matrix. + + + Creates a translation matrix from the specified X and Y components. + The X position. + The Y position. + The translation matrix. + + + Returns a value that indicates whether this instance and another 3x2 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant for this matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + The multiplicative identify matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Represents a 4x4 matrix. + + + Creates a object from a specified object. + A 3x2 matrix. + + + Creates a 4x4 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the third element in the first row. + The value to assign to the fourth element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the third element in the second row. + The value to assign to the third element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + The value to assign to the third element in the third row. + The value to assign to the fourth element in the third row. + The value to assign to the first element in the fourth row. + The value to assign to the second element in the fourth row. + The value to assign to the third element in the fourth row. + The value to assign to the fourth element in the fourth row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a spherical billboard that rotates around a specified object position. + The position of the object that the billboard will rotate around. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard. + + + Creates a cylindrical billboard that rotates around a specified axis. + The position of the object that the billboard will rotate around. + The position of the camera. + The axis to rotate the billboard around. + The forward vector of the camera. + The forward vector of the object. + The billboard matrix. + + + Creates a matrix that rotates around an arbitrary vector. + The axis to rotate around. + The angle to rotate around axis, in radians. + The rotation matrix. + + + Creates a rotation matrix from the specified Quaternion rotation value. + The source Quaternion. + The rotation matrix. + + + Creates a rotation matrix from the specified yaw, pitch, and roll. + The angle of rotation, in radians, around the Y axis. + The angle of rotation, in radians, around the X axis. + The angle of rotation, in radians, around the Z axis. + The rotation matrix. + + + Creates a view matrix. + The position of the camera. + The target towards which the camera is pointing. + The direction that is "up" from the camera's point of view. + The view matrix. + + + Creates an orthographic perspective matrix from the given view volume dimensions. + The width of the view volume. + The height of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a customized orthographic projection matrix. + The minimum X-value of the view volume. + The maximum X-value of the view volume. + The minimum Y-value of the view volume. + The maximum Y-value of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a perspective projection matrix from the given view volume dimensions. + The width of the view volume at the near view plane. + The height of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. + The field of view in the y direction, in radians. + The aspect ratio, defined as view space width divided by height. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + fieldOfView is less than or equal to zero. -or- fieldOfView is greater than or equal to . nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a customized perspective projection matrix. + The minimum x-value of the view volume at the near view plane. + The maximum x-value of the view volume at the near view plane. + The minimum y-value of the view volume at the near view plane. + The maximum y-value of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a matrix that reflects the coordinate system about a specified plane. + The plane about which to create a reflection. + A new matrix expressing the reflection. + + + Creates a matrix for rotating points around the X axis. + The amount, in radians, by which to rotate around the X axis. + The rotation matrix. + + + Creates a matrix for rotating points around the X axis from a center point. + The amount, in radians, by which to rotate around the X axis. + The center point. + The rotation matrix. + + + The amount, in radians, by which to rotate around the Y axis from a center point. + The amount, in radians, by which to rotate around the Y-axis. + The center point. + The rotation matrix. + + + Creates a matrix for rotating points around the Y axis. + The amount, in radians, by which to rotate around the Y-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis. + The amount, in radians, by which to rotate around the Z-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis from a center point. + The amount, in radians, by which to rotate around the Z-axis. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a uniform scaling matrix that scale equally on each axis. + The uniform scaling factor. + The scaling matrix. + + + Creates a scaling matrix with a center point. + The vector that contains the amount to scale on each axis. + The center point. + The scaling matrix. + + + Creates a uniform scaling matrix that scales equally on each axis with a center point. + The uniform scaling factor. + The center point. + The scaling matrix. + + + Creates a scaling matrix from the specified X, Y, and Z components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The center point. + The scaling matrix. + + + Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source. + The direction from which the light that will cast the shadow is coming. + The plane onto which the new matrix should flatten geometry so as to cast a shadow. + A new matrix that can be used to flatten geometry onto the specified plane from the specified direction. + + + Creates a translation matrix from the specified 3-dimensional vector. + The amount to translate in each axis. + The translation matrix. + + + Creates a translation matrix from the specified X, Y, and Z components. + The amount to translate on the X axis. + The amount to translate on the Y axis. + The amount to translate on the Z axis. + The translation matrix. + + + Creates a world matrix with the specified parameters. + The position of the object. + The forward direction of the object. + The upward direction of the object. Its value is usually [0, 1, 0]. + The world matrix. + + + Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. The return value indicates whether the operation succeeded. + The source matrix. + When this method returns, contains the scaling component of the transformation matrix if the operation succeeded. + When this method returns, contains the rotation component of the transformation matrix if the operation succeeded. + When the method returns, contains the translation component of the transformation matrix if the operation succeeded. + true if matrix was decomposed successfully; otherwise, false. + + + Returns a value that indicates whether this instance and another 4x4 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant of the current 4x4 matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + Gets the multiplicative identity matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The third element of the first row. + + + + The fourth element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The third element of the second row. + + + + The fourth element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + The third element of the third row. + + + + The fourth element of the third row. + + + + The first element of the fourth row. + + + + The second element of the fourth row. + + + + The third element of the fourth row. + + + + The fourth element of the fourth row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to care + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Transforms the specified matrix by applying the specified Quaternion rotation. + The matrix to transform. + The rotation t apply. + The transformed matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Transposes the rows and columns of a matrix. + The matrix to transpose. + The transposed matrix. + + + Represents a three-dimensional plane. + + + Creates a object from a specified four-dimensional vector. + A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. + + + Creates a object from a specified normal and the distance along the normal from the origin. + The plane's normal vector. + The plane's distance from the origin along its normal vector. + + + Creates a object from the X, Y, and Z components of its normal, and its distance from the origin on that normal. + The X component of the normal. + The Y component of the normal. + The Z component of the normal. + The distance of the plane along its normal from the origin. + + + Creates a object that contains three specified points. + The first point defining the plane. + The second point defining the plane. + The third point defining the plane. + The plane containing the three points. + + + The distance of the plane along its normal from the origin. + + + + Calculates the dot product of a plane and a 4-dimensional vector. + The plane. + The four-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. + The plane. + The 3-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the vector of this plane. + The plane. + The three-dimensional vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another plane object are equal. + The other plane. + true if the two planes are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + The normal vector of the plane. + + + + Creates a new object whose normal vector is the source plane's normal vector normalized. + The source plane. + The normalized plane. + + + Returns a value that indicates whether two planes are equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether two planes are not equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the string representation of this plane object. + A string that represents this object. + + + Transforms a normalized plane by a 4x4 matrix. + The normalized plane to transform. + The transformation matrix to apply to plane. + The transformed plane. + + + Transforms a normalized plane by a Quaternion rotation. + The normalized plane to transform. + The Quaternion rotation to apply to the plane. + A new plane that results from applying the Quaternion rotation. + + + Represents a vector that is used to encode three-dimensional physical rotations. + + + Creates a quaternion from the specified vector and rotation parts. + The vector part of the quaternion. + The rotation part of the quaternion. + + + Constructs a quaternion from the specified components. + The value to assign to the X component of the quaternion. + The value to assign to the Y component of the quaternion. + The value to assign to the Z component of the quaternion. + The value to assign to the W component of the quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Concatenates two quaternions. + The first quaternion rotation in the series. + The second quaternion rotation in the series. + A new quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. + + + Returns the conjugate of a specified quaternion. + The quaternion. + A new quaternion that is the conjugate of value. + + + Creates a quaternion from a vector and an angle to rotate about the vector. + The vector to rotate around. + The angle, in radians, to rotate around the vector. + The newly created quaternion. + + + Creates a quaternion from the specified rotation matrix. + The rotation matrix. + The newly created quaternion. + + + Creates a new quaternion from the given yaw, pitch, and roll. + The yaw angle, in radians, around the Y axis. + The pitch angle, in radians, around the X axis. + The roll angle, in radians, around the Z axis. + The resulting quaternion. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Calculates the dot product of two quaternions. + The first quaternion. + The second quaternion. + The dot product. + + + Returns a value that indicates whether this instance and another quaternion are equal. + The other quaternion. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Gets a quaternion that represents no rotation. + A quaternion whose values are (0, 0, 0, 1). + + + Returns the inverse of a quaternion. + The quaternion. + The inverted quaternion. + + + Gets a value that indicates whether the current instance is the identity quaternion. + true if the current instance is the identity quaternion; otherwise, false. + + + Calculates the length of the quaternion. + The computed length of the quaternion. + + + Calculates the squared length of the quaternion. + The length squared of the quaternion. + + + Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. + The first quaternion. + The second quaternion. + The relative weight of quaternion2 in the interpolation. + The interpolated quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Divides each component of a specified by its length. + The quaternion to normalize. + The normalized quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Returns a value that indicates whether two quaternions are equal. + The first quaternion to compare. + The second quaternion to compare. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether two quaternions are not equal. + The first quaternion to compare. + The second quaternion to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Interpolates between two quaternions, using spherical linear interpolation. + The first quaternion. + The second quaternion. + The relative weight of the second quaternion in the interpolation. + The interpolated quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this quaternion. + The string representation of this quaternion. + + + The rotation component of the quaternion. + + + + The X value of the vector component of the quaternion. + + + + The Y value of the vector component of the quaternion. + + + + The Z value of the vector component of the quaternion. + + + + Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + The vector type. T can be any primitive numeric type. + + + Creates a vector whose components are of a specified type. + The numeric type that defines the type of the components in the vector. + + + Creates a vector from a specified array. + A numeric array. + values is null. + + + Creates a vector from a specified array starting at a specified index position. + A numeric array. + The starting index position from which to create the vector. + values is null. + index is less than zero. -or- The length of values minus index is less than . + + + Copies the vector instance to a specified destination array. + The array to receive a copy of the vector values. + destination is null. + The number of elements in the current vector is greater than the number of elements available in the destination array. + + + Copies the vector instance to a specified destination array starting at a specified index position. + The array to receive a copy of the vector values. + The starting index in destination at which to begin the copy operation. + destination is null. + The number of elements in the current instance is greater than the number of elements available from startIndex to the end of the destination array. + index is less than zero or greater than the last index in destination. + + + Returns the number of elements stored in the vector. + The number of elements stored in the vector. + Access to the property getter via reflection is not supported. + + + Returns a value that indicates whether this instance is equal to a specified vector. + The vector to compare with this instance. + true if the current instance and other are equal; otherwise, false. + + + Returns a value that indicates whether this instance is equal to a specified object. + The object to compare with this instance. + true if the current instance and obj are equal; otherwise, false. The method returns false if obj is null, or if obj is a vector of a different type than the current instance. + + + Returns the hash code for this instance. + The hash code. + + + Gets the element at a specified index. + The index of the element to return. + The element at index index. + index is less than zero. -or- index is greater than or equal to . + + + Returns a vector containing all ones. + A vector containing all ones. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Returns a new vector by performing a bitwise And operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise And of left and right. + + + Returns a new vector by performing a bitwise Or operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise Or of the elements in left and right. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Returns a value that indicates whether each pair of elements in two specified vectors are equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a new vector by performing a bitwise XOr operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise XOr of the elements in left and right. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Returns a value that indicates whether any single pair of elements in the specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if any element pairs in left and right are equal. false if no element pairs are equal. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar value. + The source vector. + A scalar value. + The scaled vector. + + + Multiplies a vector by the given scalar. + The scalar value. + The source vector. + The scaled vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The one's complement vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates a given vector. + The vector to negate. + The negated vector. + + + Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Returns the string representation of this vector using default formatting. + The string representation of this vector. + + + Returns the string representation of this vector using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns a vector containing all zeroes. + A vector containing all zeroes. + + + Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors. + + + Returns a new vector whose elements are the absolute values of the given vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The absolute value vector. + + + Returns a new vector whose values are the sum of each pair of elements from two given vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The summed vector. + + + Returns a new vector by performing a bitwise And Not operation on each pair of corresponding elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a double-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of signed bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a single-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Returns a new vector by performing a bitwise And operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector by performing a bitwise Or operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Creates a new single-precision vector with elements selected between two specified single-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new double-precision vector with elements selected between two specified double-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new vector of a specified type with elements selected between two specified source vectors of the same type based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The vector type. T can be any primitive numeric type. + The new vector with elements selected based on the mask. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose values are the result of dividing the first vector's elements by the corresponding elements in the second vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The divided vector. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The dot product. + + + Returns a new integral vector whose elements signal whether the elements in two specified double-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified integral vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in two specified long integer vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified single-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in two specified vectors of the same type are equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether each pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left and right are equal; otherwise, false. + + + Returns a value that indicates whether any single pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element pair in left and right is equal; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are greater than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are greater than their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than their corresponding elements in the second vector of the same time. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the single-precision floating-point second vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than or equal to their corresponding elements in the second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than or equal to their corresponding elements in the second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than or equal to their corresponding elements in the second vector of the same type. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than or equal to all the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than or equal to the corresponding element in right; otherwise, false. + + + Gets a value that indicates whether vector operations are subject to hardware acceleration through JIT intrinsic support. + true if vector operations are subject to hardware acceleration; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision vector are less than their corresponding elements in a second single-precision vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in one vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all of the elements in the first vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than or equal to their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than or equal to their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less or equal to their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are less than or equal to their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than or equal to the corresponding element in right; otherwise, false. + + + Returns a new vector whose elements are the maximum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The maximum vector. + + + Returns a new vector whose elements are the minimum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The minimum vector. + + + Returns a new vector whose values are a scalar value multiplied by each of the values of a specified vector. + The scalar value. + The vector. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + Returns a new vector whose values are the product of each pair of elements in two specified vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The product vector. + + + Returns a new vector whose values are the values of a specified vector each multiplied by a scalar value. + The vector. + The scalar value. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose elements are the negation of the corresponding element in the specified vector. + The source vector. + The vector type. T can be any primitive numeric type. + The negated vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector whose elements are the square roots of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The square root vector. + + + Returns a new vector whose values are the difference between the elements in the second vector and their corresponding elements in the first vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The difference vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector by performing a bitwise exclusive Or (XOr) operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Represents a vector with two single-precision floating-point values. + + + Creates a new object whose two elements have the same value. + The value to assign to both elements. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of the vector. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 2 elements are equal to one. + A vector whose two elements are equal to one (that is, it returns the vector (1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 3x2 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 3x2 matrix. + The source vector. + The matrix. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0). + The vector (1,0). + + + Gets the vector (0,1). + The vector (0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + Returns a vector whose 2 elements are equal to zero. + A vector whose two elements are equal to zero (that is, it returns the vector (0,0). + + + Represents a vector with three single-precision floating-point values. + + + Creates a new object whose three elements have the same value. + The value to assign to all three elements. + + + Creates a new object from the specified object and the specified value. + The vector with two elements. + The additional value to assign to the field. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the cross product of two vectors. + The first vector. + The second vector. + The cross product. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 3 elements are equal to one. + A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0,0). + The vector (1,0,0). + + + Gets the vector (0,1,0). + The vector (0,1,0).. + + + Gets the vector (0,0,1). + The vector (0,0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 3 elements are equal to zero. + A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). + + + Represents a vector with four single-precision floating-point values. + + + Creates a new object whose four elements have the same value. + The value to assign to all four elements. + + + Constructs a new object from the specified object and a W component. + The vector to use for the X, Y, and Z components. + The W component. + + + Creates a new object from the specified object and a Z and a W component. + The vector to use for the X and Y components. + The Z component. + The W component. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 4 elements are equal to one. + Returns . + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a four-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a four-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a three-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a two-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a two-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a three-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Gets the vector (0,0,0,1). + The vector (0,0,0,1). + + + Gets the vector (1,0,0,0). + The vector (1,0,0,0). + + + Gets the vector (0,1,0,0). + The vector (0,1,0,0).. + + + Gets a vector whose 4 elements are equal to zero. + The vector (0,0,1,0). + + + The W component of the vector. + + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 4 elements are equal to zero. + A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netcoreapp2.0/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netcoreapp2.0/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netstandard1.0/System.Numerics.Vectors.dll b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netstandard1.0/System.Numerics.Vectors.dll new file mode 100644 index 0000000000000000000000000000000000000000..d174da04775207dbbcc5c6959f409cfc37ae7855 GIT binary patch literal 38272 zcmeIb2S60dmOorQnIVfJqTmn&R6-9K1CoPE5(EQ?0}P6U!C{bKA}EGyRuD6YIcG6o z)+^?mbIv)(|EcboroDRayKi^j_jbSC!9G>LQ|VOIsZ-TeHDg$>Nr;OO;=%L%J3_VK z;*SqS|C$s*uwKipdT4{zQHxrl>rsoC{%JXqY^9=~QkE%6mStrrRFWjQM46i3+U$Wo$BkPrYI5zXB*09*+?MerbGK>0be z+?avor#`!Y0>9Zx1oiS6iKF6w4Xzqu7JRZH-w5m}0zMym)Sp;jbpn4CLOS4hrXkcq z9rU*x2_rfcT?9CUmC#Wo&sPCH*ck|fQFR5m*&hi)eI1oK%4A?tvK4_x08cnPtd9?L zm!ndip@4{3RxC4a0~7-f>*Irv9}8061-M<|gJt6&J~|;m=s_?-TA0cD)b`gjJ&XAZ zuQ|uA5klfN;>Lx7Hs0KCO(3J@JldhKn8w(lur`gcLt&@@j*lG*>(UrI6xO3Lb||b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wB3UcS<9_A1dG9chg)&YF6{>3->JASHGro+T-tD^KY5ox#Ql$ z`@*6NkA}YQmNqtJ^}?F%`^(qwkf%&&F(T}0?Ut&D9sH^HES{Lp=zZVfO0O>~w^>Du z7aF7(w6NQDKll3N(j&*mU(Gp}%s<4-OIme)z?e;6pU(e%e&Wh6>q@+TyYafe@s8c% zPlwXOg3Uzr`o8ry#k)s;uE^|u?t* + + + System.Numerics.Vectors + + + + Represents a 3x2 matrix. + + + Creates a 3x2 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a rotation matrix using the given rotation in radians. + The amount of rotation, in radians. + The rotation matrix. + + + Creates a rotation matrix using the specified rotation in radians and a center point. + The amount of rotation, in radians. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified X and Y components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the specified scale with an offset from the specified center. + The uniform scale to use. + The center offset. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The center point. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the given scale. + The uniform scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale with an offset from the specified center point. + The scale to use. + The center offset. + The scaling matrix. + + + Creates a skew matrix from the specified angles in radians. + The X angle, in radians. + The Y angle, in radians. + The skew matrix. + + + Creates a skew matrix from the specified angles in radians and a center point. + The X angle, in radians. + The Y angle, in radians. + The center point. + The skew matrix. + + + Creates a translation matrix from the specified 2-dimensional vector. + The translation position. + The translation matrix. + + + Creates a translation matrix from the specified X and Y components. + The X position. + The Y position. + The translation matrix. + + + Returns a value that indicates whether this instance and another 3x2 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant for this matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + The multiplicative identify matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Represents a 4x4 matrix. + + + Creates a object from a specified object. + A 3x2 matrix. + + + Creates a 4x4 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the third element in the first row. + The value to assign to the fourth element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the third element in the second row. + The value to assign to the third element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + The value to assign to the third element in the third row. + The value to assign to the fourth element in the third row. + The value to assign to the first element in the fourth row. + The value to assign to the second element in the fourth row. + The value to assign to the third element in the fourth row. + The value to assign to the fourth element in the fourth row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a spherical billboard that rotates around a specified object position. + The position of the object that the billboard will rotate around. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard. + + + Creates a cylindrical billboard that rotates around a specified axis. + The position of the object that the billboard will rotate around. + The position of the camera. + The axis to rotate the billboard around. + The forward vector of the camera. + The forward vector of the object. + The billboard matrix. + + + Creates a matrix that rotates around an arbitrary vector. + The axis to rotate around. + The angle to rotate around axis, in radians. + The rotation matrix. + + + Creates a rotation matrix from the specified Quaternion rotation value. + The source Quaternion. + The rotation matrix. + + + Creates a rotation matrix from the specified yaw, pitch, and roll. + The angle of rotation, in radians, around the Y axis. + The angle of rotation, in radians, around the X axis. + The angle of rotation, in radians, around the Z axis. + The rotation matrix. + + + Creates a view matrix. + The position of the camera. + The target towards which the camera is pointing. + The direction that is "up" from the camera's point of view. + The view matrix. + + + Creates an orthographic perspective matrix from the given view volume dimensions. + The width of the view volume. + The height of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a customized orthographic projection matrix. + The minimum X-value of the view volume. + The maximum X-value of the view volume. + The minimum Y-value of the view volume. + The maximum Y-value of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a perspective projection matrix from the given view volume dimensions. + The width of the view volume at the near view plane. + The height of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. + The field of view in the y direction, in radians. + The aspect ratio, defined as view space width divided by height. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + fieldOfView is less than or equal to zero. -or- fieldOfView is greater than or equal to . nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a customized perspective projection matrix. + The minimum x-value of the view volume at the near view plane. + The maximum x-value of the view volume at the near view plane. + The minimum y-value of the view volume at the near view plane. + The maximum y-value of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a matrix that reflects the coordinate system about a specified plane. + The plane about which to create a reflection. + A new matrix expressing the reflection. + + + Creates a matrix for rotating points around the X axis. + The amount, in radians, by which to rotate around the X axis. + The rotation matrix. + + + Creates a matrix for rotating points around the X axis from a center point. + The amount, in radians, by which to rotate around the X axis. + The center point. + The rotation matrix. + + + The amount, in radians, by which to rotate around the Y axis from a center point. + The amount, in radians, by which to rotate around the Y-axis. + The center point. + The rotation matrix. + + + Creates a matrix for rotating points around the Y axis. + The amount, in radians, by which to rotate around the Y-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis. + The amount, in radians, by which to rotate around the Z-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis from a center point. + The amount, in radians, by which to rotate around the Z-axis. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a uniform scaling matrix that scale equally on each axis. + The uniform scaling factor. + The scaling matrix. + + + Creates a scaling matrix with a center point. + The vector that contains the amount to scale on each axis. + The center point. + The scaling matrix. + + + Creates a uniform scaling matrix that scales equally on each axis with a center point. + The uniform scaling factor. + The center point. + The scaling matrix. + + + Creates a scaling matrix from the specified X, Y, and Z components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The center point. + The scaling matrix. + + + Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source. + The direction from which the light that will cast the shadow is coming. + The plane onto which the new matrix should flatten geometry so as to cast a shadow. + A new matrix that can be used to flatten geometry onto the specified plane from the specified direction. + + + Creates a translation matrix from the specified 3-dimensional vector. + The amount to translate in each axis. + The translation matrix. + + + Creates a translation matrix from the specified X, Y, and Z components. + The amount to translate on the X axis. + The amount to translate on the Y axis. + The amount to translate on the Z axis. + The translation matrix. + + + Creates a world matrix with the specified parameters. + The position of the object. + The forward direction of the object. + The upward direction of the object. Its value is usually [0, 1, 0]. + The world matrix. + + + Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. The return value indicates whether the operation succeeded. + The source matrix. + When this method returns, contains the scaling component of the transformation matrix if the operation succeeded. + When this method returns, contains the rotation component of the transformation matrix if the operation succeeded. + When the method returns, contains the translation component of the transformation matrix if the operation succeeded. + true if matrix was decomposed successfully; otherwise, false. + + + Returns a value that indicates whether this instance and another 4x4 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant of the current 4x4 matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + Gets the multiplicative identity matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The third element of the first row. + + + + The fourth element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The third element of the second row. + + + + The fourth element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + The third element of the third row. + + + + The fourth element of the third row. + + + + The first element of the fourth row. + + + + The second element of the fourth row. + + + + The third element of the fourth row. + + + + The fourth element of the fourth row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to care + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Transforms the specified matrix by applying the specified Quaternion rotation. + The matrix to transform. + The rotation t apply. + The transformed matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Transposes the rows and columns of a matrix. + The matrix to transpose. + The transposed matrix. + + + Represents a three-dimensional plane. + + + Creates a object from a specified four-dimensional vector. + A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. + + + Creates a object from a specified normal and the distance along the normal from the origin. + The plane's normal vector. + The plane's distance from the origin along its normal vector. + + + Creates a object from the X, Y, and Z components of its normal, and its distance from the origin on that normal. + The X component of the normal. + The Y component of the normal. + The Z component of the normal. + The distance of the plane along its normal from the origin. + + + Creates a object that contains three specified points. + The first point defining the plane. + The second point defining the plane. + The third point defining the plane. + The plane containing the three points. + + + The distance of the plane along its normal from the origin. + + + + Calculates the dot product of a plane and a 4-dimensional vector. + The plane. + The four-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. + The plane. + The 3-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the vector of this plane. + The plane. + The three-dimensional vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another plane object are equal. + The other plane. + true if the two planes are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + The normal vector of the plane. + + + + Creates a new object whose normal vector is the source plane's normal vector normalized. + The source plane. + The normalized plane. + + + Returns a value that indicates whether two planes are equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether two planes are not equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the string representation of this plane object. + A string that represents this object. + + + Transforms a normalized plane by a 4x4 matrix. + The normalized plane to transform. + The transformation matrix to apply to plane. + The transformed plane. + + + Transforms a normalized plane by a Quaternion rotation. + The normalized plane to transform. + The Quaternion rotation to apply to the plane. + A new plane that results from applying the Quaternion rotation. + + + Represents a vector that is used to encode three-dimensional physical rotations. + + + Creates a quaternion from the specified vector and rotation parts. + The vector part of the quaternion. + The rotation part of the quaternion. + + + Constructs a quaternion from the specified components. + The value to assign to the X component of the quaternion. + The value to assign to the Y component of the quaternion. + The value to assign to the Z component of the quaternion. + The value to assign to the W component of the quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Concatenates two quaternions. + The first quaternion rotation in the series. + The second quaternion rotation in the series. + A new quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. + + + Returns the conjugate of a specified quaternion. + The quaternion. + A new quaternion that is the conjugate of value. + + + Creates a quaternion from a vector and an angle to rotate about the vector. + The vector to rotate around. + The angle, in radians, to rotate around the vector. + The newly created quaternion. + + + Creates a quaternion from the specified rotation matrix. + The rotation matrix. + The newly created quaternion. + + + Creates a new quaternion from the given yaw, pitch, and roll. + The yaw angle, in radians, around the Y axis. + The pitch angle, in radians, around the X axis. + The roll angle, in radians, around the Z axis. + The resulting quaternion. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Calculates the dot product of two quaternions. + The first quaternion. + The second quaternion. + The dot product. + + + Returns a value that indicates whether this instance and another quaternion are equal. + The other quaternion. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Gets a quaternion that represents no rotation. + A quaternion whose values are (0, 0, 0, 1). + + + Returns the inverse of a quaternion. + The quaternion. + The inverted quaternion. + + + Gets a value that indicates whether the current instance is the identity quaternion. + true if the current instance is the identity quaternion; otherwise, false. + + + Calculates the length of the quaternion. + The computed length of the quaternion. + + + Calculates the squared length of the quaternion. + The length squared of the quaternion. + + + Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. + The first quaternion. + The second quaternion. + The relative weight of quaternion2 in the interpolation. + The interpolated quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Divides each component of a specified by its length. + The quaternion to normalize. + The normalized quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Returns a value that indicates whether two quaternions are equal. + The first quaternion to compare. + The second quaternion to compare. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether two quaternions are not equal. + The first quaternion to compare. + The second quaternion to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Interpolates between two quaternions, using spherical linear interpolation. + The first quaternion. + The second quaternion. + The relative weight of the second quaternion in the interpolation. + The interpolated quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this quaternion. + The string representation of this quaternion. + + + The rotation component of the quaternion. + + + + The X value of the vector component of the quaternion. + + + + The Y value of the vector component of the quaternion. + + + + The Z value of the vector component of the quaternion. + + + + Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + The vector type. T can be any primitive numeric type. + + + Creates a vector whose components are of a specified type. + The numeric type that defines the type of the components in the vector. + + + Creates a vector from a specified array. + A numeric array. + values is null. + + + Creates a vector from a specified array starting at a specified index position. + A numeric array. + The starting index position from which to create the vector. + values is null. + index is less than zero. -or- The length of values minus index is less than . + + + Copies the vector instance to a specified destination array. + The array to receive a copy of the vector values. + destination is null. + The number of elements in the current vector is greater than the number of elements available in the destination array. + + + Copies the vector instance to a specified destination array starting at a specified index position. + The array to receive a copy of the vector values. + The starting index in destination at which to begin the copy operation. + destination is null. + The number of elements in the current instance is greater than the number of elements available from startIndex to the end of the destination array. + index is less than zero or greater than the last index in destination. + + + Returns the number of elements stored in the vector. + The number of elements stored in the vector. + Access to the property getter via reflection is not supported. + + + Returns a value that indicates whether this instance is equal to a specified vector. + The vector to compare with this instance. + true if the current instance and other are equal; otherwise, false. + + + Returns a value that indicates whether this instance is equal to a specified object. + The object to compare with this instance. + true if the current instance and obj are equal; otherwise, false. The method returns false if obj is null, or if obj is a vector of a different type than the current instance. + + + Returns the hash code for this instance. + The hash code. + + + Gets the element at a specified index. + The index of the element to return. + The element at index index. + index is less than zero. -or- index is greater than or equal to . + + + Returns a vector containing all ones. + A vector containing all ones. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Returns a new vector by performing a bitwise And operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise And of left and right. + + + Returns a new vector by performing a bitwise Or operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise Or of the elements in left and right. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Returns a value that indicates whether each pair of elements in two specified vectors are equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a new vector by performing a bitwise XOr operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise XOr of the elements in left and right. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Returns a value that indicates whether any single pair of elements in the specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if any element pairs in left and right are equal. false if no element pairs are equal. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar value. + The source vector. + A scalar value. + The scaled vector. + + + Multiplies a vector by the given scalar. + The scalar value. + The source vector. + The scaled vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The one's complement vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates a given vector. + The vector to negate. + The negated vector. + + + Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Returns the string representation of this vector using default formatting. + The string representation of this vector. + + + Returns the string representation of this vector using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns a vector containing all zeroes. + A vector containing all zeroes. + + + Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors. + + + Returns a new vector whose elements are the absolute values of the given vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The absolute value vector. + + + Returns a new vector whose values are the sum of each pair of elements from two given vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The summed vector. + + + Returns a new vector by performing a bitwise And Not operation on each pair of corresponding elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a double-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of signed bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a single-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Returns a new vector by performing a bitwise And operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector by performing a bitwise Or operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Creates a new single-precision vector with elements selected between two specified single-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new double-precision vector with elements selected between two specified double-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new vector of a specified type with elements selected between two specified source vectors of the same type based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The vector type. T can be any primitive numeric type. + The new vector with elements selected based on the mask. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose values are the result of dividing the first vector's elements by the corresponding elements in the second vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The divided vector. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The dot product. + + + Returns a new integral vector whose elements signal whether the elements in two specified double-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified integral vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in two specified long integer vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified single-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in two specified vectors of the same type are equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether each pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left and right are equal; otherwise, false. + + + Returns a value that indicates whether any single pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element pair in left and right is equal; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are greater than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are greater than their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than their corresponding elements in the second vector of the same time. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the single-precision floating-point second vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than or equal to their corresponding elements in the second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than or equal to their corresponding elements in the second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than or equal to their corresponding elements in the second vector of the same type. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than or equal to all the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than or equal to the corresponding element in right; otherwise, false. + + + Gets a value that indicates whether vector operations are subject to hardware acceleration through JIT intrinsic support. + true if vector operations are subject to hardware acceleration; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision vector are less than their corresponding elements in a second single-precision vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in one vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all of the elements in the first vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than or equal to their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than or equal to their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less or equal to their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are less than or equal to their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than or equal to the corresponding element in right; otherwise, false. + + + Returns a new vector whose elements are the maximum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The maximum vector. + + + Returns a new vector whose elements are the minimum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The minimum vector. + + + Returns a new vector whose values are a scalar value multiplied by each of the values of a specified vector. + The scalar value. + The vector. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + Returns a new vector whose values are the product of each pair of elements in two specified vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The product vector. + + + Returns a new vector whose values are the values of a specified vector each multiplied by a scalar value. + The vector. + The scalar value. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose elements are the negation of the corresponding element in the specified vector. + The source vector. + The vector type. T can be any primitive numeric type. + The negated vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector whose elements are the square roots of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The square root vector. + + + Returns a new vector whose values are the difference between the elements in the second vector and their corresponding elements in the first vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The difference vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector by performing a bitwise exclusive Or (XOr) operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Represents a vector with two single-precision floating-point values. + + + Creates a new object whose two elements have the same value. + The value to assign to both elements. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of the vector. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 2 elements are equal to one. + A vector whose two elements are equal to one (that is, it returns the vector (1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 3x2 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 3x2 matrix. + The source vector. + The matrix. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0). + The vector (1,0). + + + Gets the vector (0,1). + The vector (0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + Returns a vector whose 2 elements are equal to zero. + A vector whose two elements are equal to zero (that is, it returns the vector (0,0). + + + Represents a vector with three single-precision floating-point values. + + + Creates a new object whose three elements have the same value. + The value to assign to all three elements. + + + Creates a new object from the specified object and the specified value. + The vector with two elements. + The additional value to assign to the field. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the cross product of two vectors. + The first vector. + The second vector. + The cross product. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 3 elements are equal to one. + A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0,0). + The vector (1,0,0). + + + Gets the vector (0,1,0). + The vector (0,1,0).. + + + Gets the vector (0,0,1). + The vector (0,0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 3 elements are equal to zero. + A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). + + + Represents a vector with four single-precision floating-point values. + + + Creates a new object whose four elements have the same value. + The value to assign to all four elements. + + + Constructs a new object from the specified object and a W component. + The vector to use for the X, Y, and Z components. + The W component. + + + Creates a new object from the specified object and a Z and a W component. + The vector to use for the X and Y components. + The Z component. + The W component. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 4 elements are equal to one. + Returns . + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a four-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a four-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a three-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a two-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a two-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a three-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Gets the vector (0,0,0,1). + The vector (0,0,0,1). + + + Gets the vector (1,0,0,0). + The vector (1,0,0,0). + + + Gets the vector (0,1,0,0). + The vector (0,1,0,0).. + + + Gets a vector whose 4 elements are equal to zero. + The vector (0,0,1,0). + + + The W component of the vector. + + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 4 elements are equal to zero. + A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netstandard2.0/System.Numerics.Vectors.dll b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/netstandard2.0/System.Numerics.Vectors.dll new file mode 100644 index 0000000000000000000000000000000000000000..ba0aa0cf6c56a5edd990cca24ab6588cb4d49269 GIT binary patch literal 38272 zcmeIb2S60dmOorQnJ9=Ng5V&ipoAVWDk_ph0Z9TXhyx5k!r(ASFcB1URzyVw6?4vt zsF(xhoO8}ujQ>;JGfjK--gn>bzVGdRyMukIey7r@s#B+`t7^u;zEcnvA;g2{#}90D^T}?$AY>G>)5ZBLa?_hbO0Gi8B@QB!x6x952ntkSoP;GO;2%L!6Q! z_U;uXPM0Uh>~wTAEmc_u`ydoRaM9Xv@;>U)ZlP9UErNsq;D~7Mu7Ti+;VFOzAw9~^ zq28Zlc`I6JtmIoRKwS`9n57s9$ctCb44NhmHdY}h{bS(tPjsHzUfWA^RhIdh; z5i*756QC%5vbF#nruc(+jv@hiKv82p_TQ!GaEi{N=ol)rilQ6%J%j?(p7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TB0M&9&)?|UG< zm-d@w&Ch#j4x}-&-2u1Ibbi{#_wIQ z`Nu*VP4}a(ZCnRBcXPk_>3s+{>CGI6;g462o@ex~xctb3Ehl^X&#lZ#+hR(d=rV3r zj!m1Q@jZ7=?|Vu7zKvHXclN6$>wGtD^#16flQMCK&-?8^ynH53`H{RzW5$E{w3V`= z*%zBUcl>lnr11wd25M-6HpFoFH5J nH8*R}rZFpL?989k;?kV + + + System.Numerics.Vectors + + + +

      Represents a 3x2 matrix. + + + Creates a 3x2 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a rotation matrix using the given rotation in radians. + The amount of rotation, in radians. + The rotation matrix. + + + Creates a rotation matrix using the specified rotation in radians and a center point. + The amount of rotation, in radians. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified X and Y components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the specified scale with an offset from the specified center. + The uniform scale to use. + The center offset. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The center point. + The scaling matrix. + + + Creates a scaling matrix that scales uniformly with the given scale. + The uniform scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a scaling matrix from the specified vector scale with an offset from the specified center point. + The scale to use. + The center offset. + The scaling matrix. + + + Creates a skew matrix from the specified angles in radians. + The X angle, in radians. + The Y angle, in radians. + The skew matrix. + + + Creates a skew matrix from the specified angles in radians and a center point. + The X angle, in radians. + The Y angle, in radians. + The center point. + The skew matrix. + + + Creates a translation matrix from the specified 2-dimensional vector. + The translation position. + The translation matrix. + + + Creates a translation matrix from the specified X and Y components. + The X position. + The Y position. + The translation matrix. + + + Returns a value that indicates whether this instance and another 3x2 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant for this matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + The multiplicative identify matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Represents a 4x4 matrix. + + + Creates a object from a specified object. + A 3x2 matrix. + + + Creates a 4x4 matrix from the specified components. + The value to assign to the first element in the first row. + The value to assign to the second element in the first row. + The value to assign to the third element in the first row. + The value to assign to the fourth element in the first row. + The value to assign to the first element in the second row. + The value to assign to the second element in the second row. + The value to assign to the third element in the second row. + The value to assign to the third element in the second row. + The value to assign to the first element in the third row. + The value to assign to the second element in the third row. + The value to assign to the third element in the third row. + The value to assign to the fourth element in the third row. + The value to assign to the first element in the fourth row. + The value to assign to the second element in the fourth row. + The value to assign to the third element in the fourth row. + The value to assign to the fourth element in the fourth row. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values of value1 and value2. + + + Creates a spherical billboard that rotates around a specified object position. + The position of the object that the billboard will rotate around. + The position of the camera. + The up vector of the camera. + The forward vector of the camera. + The created billboard. + + + Creates a cylindrical billboard that rotates around a specified axis. + The position of the object that the billboard will rotate around. + The position of the camera. + The axis to rotate the billboard around. + The forward vector of the camera. + The forward vector of the object. + The billboard matrix. + + + Creates a matrix that rotates around an arbitrary vector. + The axis to rotate around. + The angle to rotate around axis, in radians. + The rotation matrix. + + + Creates a rotation matrix from the specified Quaternion rotation value. + The source Quaternion. + The rotation matrix. + + + Creates a rotation matrix from the specified yaw, pitch, and roll. + The angle of rotation, in radians, around the Y axis. + The angle of rotation, in radians, around the X axis. + The angle of rotation, in radians, around the Z axis. + The rotation matrix. + + + Creates a view matrix. + The position of the camera. + The target towards which the camera is pointing. + The direction that is "up" from the camera's point of view. + The view matrix. + + + Creates an orthographic perspective matrix from the given view volume dimensions. + The width of the view volume. + The height of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a customized orthographic projection matrix. + The minimum X-value of the view volume. + The maximum X-value of the view volume. + The minimum Y-value of the view volume. + The maximum Y-value of the view volume. + The minimum Z-value of the view volume. + The maximum Z-value of the view volume. + The orthographic projection matrix. + + + Creates a perspective projection matrix from the given view volume dimensions. + The width of the view volume at the near view plane. + The height of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a perspective projection matrix based on a field of view, aspect ratio, and near and far view plane distances. + The field of view in the y direction, in radians. + The aspect ratio, defined as view space width divided by height. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + fieldOfView is less than or equal to zero. -or- fieldOfView is greater than or equal to . nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a customized perspective projection matrix. + The minimum x-value of the view volume at the near view plane. + The maximum x-value of the view volume at the near view plane. + The minimum y-value of the view volume at the near view plane. + The maximum y-value of the view volume at the near view plane. + The distance to the near view plane. + The distance to the far view plane. + The perspective projection matrix. + nearPlaneDistance is less than or equal to zero. -or- farPlaneDistance is less than or equal to zero. -or- nearPlaneDistance is greater than or equal to farPlaneDistance. + + + Creates a matrix that reflects the coordinate system about a specified plane. + The plane about which to create a reflection. + A new matrix expressing the reflection. + + + Creates a matrix for rotating points around the X axis. + The amount, in radians, by which to rotate around the X axis. + The rotation matrix. + + + Creates a matrix for rotating points around the X axis from a center point. + The amount, in radians, by which to rotate around the X axis. + The center point. + The rotation matrix. + + + The amount, in radians, by which to rotate around the Y axis from a center point. + The amount, in radians, by which to rotate around the Y-axis. + The center point. + The rotation matrix. + + + Creates a matrix for rotating points around the Y axis. + The amount, in radians, by which to rotate around the Y-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis. + The amount, in radians, by which to rotate around the Z-axis. + The rotation matrix. + + + Creates a matrix for rotating points around the Z axis from a center point. + The amount, in radians, by which to rotate around the Z-axis. + The center point. + The rotation matrix. + + + Creates a scaling matrix from the specified vector scale. + The scale to use. + The scaling matrix. + + + Creates a uniform scaling matrix that scale equally on each axis. + The uniform scaling factor. + The scaling matrix. + + + Creates a scaling matrix with a center point. + The vector that contains the amount to scale on each axis. + The center point. + The scaling matrix. + + + Creates a uniform scaling matrix that scales equally on each axis with a center point. + The uniform scaling factor. + The center point. + The scaling matrix. + + + Creates a scaling matrix from the specified X, Y, and Z components. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The scaling matrix. + + + Creates a scaling matrix that is offset by a given center point. + The value to scale by on the X axis. + The value to scale by on the Y axis. + The value to scale by on the Z axis. + The center point. + The scaling matrix. + + + Creates a matrix that flattens geometry into a specified plane as if casting a shadow from a specified light source. + The direction from which the light that will cast the shadow is coming. + The plane onto which the new matrix should flatten geometry so as to cast a shadow. + A new matrix that can be used to flatten geometry onto the specified plane from the specified direction. + + + Creates a translation matrix from the specified 3-dimensional vector. + The amount to translate in each axis. + The translation matrix. + + + Creates a translation matrix from the specified X, Y, and Z components. + The amount to translate on the X axis. + The amount to translate on the Y axis. + The amount to translate on the Z axis. + The translation matrix. + + + Creates a world matrix with the specified parameters. + The position of the object. + The forward direction of the object. + The upward direction of the object. Its value is usually [0, 1, 0]. + The world matrix. + + + Attempts to extract the scale, translation, and rotation components from the given scale, rotation, or translation matrix. The return value indicates whether the operation succeeded. + The source matrix. + When this method returns, contains the scaling component of the transformation matrix if the operation succeeded. + When this method returns, contains the rotation component of the transformation matrix if the operation succeeded. + When the method returns, contains the translation component of the transformation matrix if the operation succeeded. + true if matrix was decomposed successfully; otherwise, false. + + + Returns a value that indicates whether this instance and another 4x4 matrix are equal. + The other matrix. + true if the two matrices are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Calculates the determinant of the current 4x4 matrix. + The determinant. + + + Returns the hash code for this instance. + The hash code. + + + Gets the multiplicative identity matrix. + Gets the multiplicative identity matrix. + + + Inverts the specified matrix. The return value indicates whether the operation succeeded. + The matrix to invert. + When this method returns, contains the inverted matrix if the operation succeeded. + true if matrix was converted successfully; otherwise, false. + + + Indicates whether the current matrix is the identity matrix. + true if the current matrix is the identity matrix; otherwise, false. + + + Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. + The first matrix. + The second matrix. + The relative weighting of matrix2. + The interpolated matrix. + + + The first element of the first row. + + + + The second element of the first row. + + + + The third element of the first row. + + + + The fourth element of the first row. + + + + The first element of the second row. + + + + The second element of the second row. + + + + The third element of the second row. + + + + The fourth element of the second row. + + + + The first element of the third row. + + + + The second element of the third row. + + + + The third element of the third row. + + + + The fourth element of the third row. + + + + The first element of the fourth row. + + + + The second element of the fourth row. + + + + The third element of the fourth row. + + + + The fourth element of the fourth row. + + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Adds each element in one matrix with its corresponding element in a second matrix. + The first matrix. + The second matrix. + The matrix that contains the summed values. + + + Returns a value that indicates whether the specified matrices are equal. + The first matrix to compare. + The second matrix to care + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether the specified matrices are not equal. + The first matrix to compare. + The second matrix to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. + The matrix to scale. + The scaling value to use. + The scaled matrix. + + + Returns the matrix that results from multiplying two matrices together. + The first matrix. + The second matrix. + The product matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Negates the specified matrix by multiplying all its values by -1. + The matrix to negate. + The negated matrix. + + + Subtracts each element in a second matrix from its corresponding element in a first matrix. + The first matrix. + The second matrix. + The matrix containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this matrix. + The string representation of this matrix. + + + Transforms the specified matrix by applying the specified Quaternion rotation. + The matrix to transform. + The rotation t apply. + The transformed matrix. + + + Gets or sets the translation component of this matrix. + The translation component of the current instance. + + + Transposes the rows and columns of a matrix. + The matrix to transpose. + The transposed matrix. + + + Represents a three-dimensional plane. + + + Creates a object from a specified four-dimensional vector. + A vector whose first three elements describe the normal vector, and whose defines the distance along that normal from the origin. + + + Creates a object from a specified normal and the distance along the normal from the origin. + The plane's normal vector. + The plane's distance from the origin along its normal vector. + + + Creates a object from the X, Y, and Z components of its normal, and its distance from the origin on that normal. + The X component of the normal. + The Y component of the normal. + The Z component of the normal. + The distance of the plane along its normal from the origin. + + + Creates a object that contains three specified points. + The first point defining the plane. + The second point defining the plane. + The third point defining the plane. + The plane containing the three points. + + + The distance of the plane along its normal from the origin. + + + + Calculates the dot product of a plane and a 4-dimensional vector. + The plane. + The four-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the normal vector of this plane plus the distance () value of the plane. + The plane. + The 3-dimensional vector. + The dot product. + + + Returns the dot product of a specified three-dimensional vector and the vector of this plane. + The plane. + The three-dimensional vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another plane object are equal. + The other plane. + true if the two planes are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + The normal vector of the plane. + + + + Creates a new object whose normal vector is the source plane's normal vector normalized. + The source plane. + The normalized plane. + + + Returns a value that indicates whether two planes are equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are equal; otherwise, false. + + + Returns a value that indicates whether two planes are not equal. + The first plane to compare. + The second plane to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the string representation of this plane object. + A string that represents this object. + + + Transforms a normalized plane by a 4x4 matrix. + The normalized plane to transform. + The transformation matrix to apply to plane. + The transformed plane. + + + Transforms a normalized plane by a Quaternion rotation. + The normalized plane to transform. + The Quaternion rotation to apply to the plane. + A new plane that results from applying the Quaternion rotation. + + + Represents a vector that is used to encode three-dimensional physical rotations. + + + Creates a quaternion from the specified vector and rotation parts. + The vector part of the quaternion. + The rotation part of the quaternion. + + + Constructs a quaternion from the specified components. + The value to assign to the X component of the quaternion. + The value to assign to the Y component of the quaternion. + The value to assign to the Z component of the quaternion. + The value to assign to the W component of the quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Concatenates two quaternions. + The first quaternion rotation in the series. + The second quaternion rotation in the series. + A new quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. + + + Returns the conjugate of a specified quaternion. + The quaternion. + A new quaternion that is the conjugate of value. + + + Creates a quaternion from a vector and an angle to rotate about the vector. + The vector to rotate around. + The angle, in radians, to rotate around the vector. + The newly created quaternion. + + + Creates a quaternion from the specified rotation matrix. + The rotation matrix. + The newly created quaternion. + + + Creates a new quaternion from the given yaw, pitch, and roll. + The yaw angle, in radians, around the Y axis. + The pitch angle, in radians, around the X axis. + The roll angle, in radians, around the Z axis. + The resulting quaternion. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Calculates the dot product of two quaternions. + The first quaternion. + The second quaternion. + The dot product. + + + Returns a value that indicates whether this instance and another quaternion are equal. + The other quaternion. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Gets a quaternion that represents no rotation. + A quaternion whose values are (0, 0, 0, 1). + + + Returns the inverse of a quaternion. + The quaternion. + The inverted quaternion. + + + Gets a value that indicates whether the current instance is the identity quaternion. + true if the current instance is the identity quaternion; otherwise, false. + + + Calculates the length of the quaternion. + The computed length of the quaternion. + + + Calculates the squared length of the quaternion. + The length squared of the quaternion. + + + Performs a linear interpolation between two quaternions based on a value that specifies the weighting of the second quaternion. + The first quaternion. + The second quaternion. + The relative weight of quaternion2 in the interpolation. + The interpolated quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Divides each component of a specified by its length. + The quaternion to normalize. + The normalized quaternion. + + + Adds each element in one quaternion with its corresponding element in a second quaternion. + The first quaternion. + The second quaternion. + The quaternion that contains the summed values of value1 and value2. + + + Divides one quaternion by a second quaternion. + The dividend. + The divisor. + The quaternion that results from dividing value1 by value2. + + + Returns a value that indicates whether two quaternions are equal. + The first quaternion to compare. + The second quaternion to compare. + true if the two quaternions are equal; otherwise, false. + + + Returns a value that indicates whether two quaternions are not equal. + The first quaternion to compare. + The second quaternion to compare. + true if value1 and value2 are not equal; otherwise, false. + + + Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor. + The source quaternion. + The scalar value. + The scaled quaternion. + + + Returns the quaternion that results from multiplying two quaternions together. + The first quaternion. + The second quaternion. + The product quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Reverses the sign of each component of the quaternion. + The quaternion to negate. + The negated quaternion. + + + Interpolates between two quaternions, using spherical linear interpolation. + The first quaternion. + The second quaternion. + The relative weight of the second quaternion in the interpolation. + The interpolated quaternion. + + + Subtracts each element in a second quaternion from its corresponding element in a first quaternion. + The first quaternion. + The second quaternion. + The quaternion containing the values that result from subtracting each element in value2 from its corresponding element in value1. + + + Returns a string that represents this quaternion. + The string representation of this quaternion. + + + The rotation component of the quaternion. + + + + The X value of the vector component of the quaternion. + + + + The Y value of the vector component of the quaternion. + + + + The Z value of the vector component of the quaternion. + + + + Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + The vector type. T can be any primitive numeric type. + + + Creates a vector whose components are of a specified type. + The numeric type that defines the type of the components in the vector. + + + Creates a vector from a specified array. + A numeric array. + values is null. + + + Creates a vector from a specified array starting at a specified index position. + A numeric array. + The starting index position from which to create the vector. + values is null. + index is less than zero. -or- The length of values minus index is less than . + + + Copies the vector instance to a specified destination array. + The array to receive a copy of the vector values. + destination is null. + The number of elements in the current vector is greater than the number of elements available in the destination array. + + + Copies the vector instance to a specified destination array starting at a specified index position. + The array to receive a copy of the vector values. + The starting index in destination at which to begin the copy operation. + destination is null. + The number of elements in the current instance is greater than the number of elements available from startIndex to the end of the destination array. + index is less than zero or greater than the last index in destination. + + + Returns the number of elements stored in the vector. + The number of elements stored in the vector. + Access to the property getter via reflection is not supported. + + + Returns a value that indicates whether this instance is equal to a specified vector. + The vector to compare with this instance. + true if the current instance and other are equal; otherwise, false. + + + Returns a value that indicates whether this instance is equal to a specified object. + The object to compare with this instance. + true if the current instance and obj are equal; otherwise, false. The method returns false if obj is null, or if obj is a vector of a different type than the current instance. + + + Returns the hash code for this instance. + The hash code. + + + Gets the element at a specified index. + The index of the element to return. + The element at index index. + index is less than zero. -or- index is greater than or equal to . + + + Returns a vector containing all ones. + A vector containing all ones. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Returns a new vector by performing a bitwise And operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise And of left and right. + + + Returns a new vector by performing a bitwise Or operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise Or of the elements in left and right. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Returns a value that indicates whether each pair of elements in two specified vectors are equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a new vector by performing a bitwise XOr operation on each of the elements in two vectors. + The first vector. + The second vector. + The vector that results from the bitwise XOr of the elements in left and right. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Reinterprets the bits of the specified vector into a vector of type . + The vector to reinterpret. + The reinterpreted vector. + + + Returns a value that indicates whether any single pair of elements in the specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if any element pairs in left and right are equal. false if no element pairs are equal. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar value. + The source vector. + A scalar value. + The scaled vector. + + + Multiplies a vector by the given scalar. + The scalar value. + The source vector. + The scaled vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The one's complement vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates a given vector. + The vector to negate. + The negated vector. + + + Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Returns the string representation of this vector using default formatting. + The string representation of this vector. + + + Returns the string representation of this vector using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns a vector containing all zeroes. + A vector containing all zeroes. + + + Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors. + + + Returns a new vector whose elements are the absolute values of the given vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The absolute value vector. + + + Returns a new vector whose values are the sum of each pair of elements from two given vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The summed vector. + + + Returns a new vector by performing a bitwise And Not operation on each pair of corresponding elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a double-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of signed bytes. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a single-precision floating-point vector. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned 16-bit integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Reinterprets the bits of a specified vector into those of a vector of unsigned long integers. + The source vector. + The vector type. T can be any primitive numeric type. + The reinterpreted vector. + + + Returns a new vector by performing a bitwise And operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector by performing a bitwise Or operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Creates a new single-precision vector with elements selected between two specified single-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new double-precision vector with elements selected between two specified double-precision source vectors based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The new vector with elements selected based on the mask. + + + Creates a new vector of a specified type with elements selected between two specified source vectors of the same type based on an integral mask vector. + The integral mask vector used to drive selection. + The first source vector. + The second source vector. + The vector type. T can be any primitive numeric type. + The new vector with elements selected based on the mask. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose values are the result of dividing the first vector's elements by the corresponding elements in the second vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The divided vector. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The dot product. + + + Returns a new integral vector whose elements signal whether the elements in two specified double-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified integral vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in two specified long integer vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in two specified single-precision vectors are equal. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in two specified vectors of the same type are equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether each pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left and right are equal; otherwise, false. + + + Returns a value that indicates whether any single pair of elements in the given vectors is equal. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element pair in left and right is equal; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are greater than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are greater than their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than their corresponding elements in the second vector of the same time. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the single-precision floating-point second vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are greater than or equal to their corresponding elements in the second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are greater than or equal to their corresponding elements in the second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one vector are greater than or equal to their corresponding elements in the second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector of a specified type are greater than or equal to their corresponding elements in the second vector of the same type. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are greater than or equal to all the corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all elements in left are greater than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is greater than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is greater than or equal to the corresponding element in right; otherwise, false. + + + Gets a value that indicates whether vector operations are subject to hardware acceleration through JIT intrinsic support. + true if vector operations are subject to hardware acceleration; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less than their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision vector are less than their corresponding elements in a second single-precision vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector of a specified type whose elements signal whether the elements in one vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all of the elements in the first vector are less than their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than the corresponding element in right; otherwise, false. + + + Returns a new integral vector whose elements signal whether the elements in one double-precision floating-point vector are less than or equal to their corresponding elements in a second double-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new integral vector whose elements signal whether the elements in one integral vector are less than or equal to their corresponding elements in a second integral vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new long integer vector whose elements signal whether the elements in one long integer vector are less or equal to their corresponding elements in a second long integer vector. + The first vector to compare. + The second vector to compare. + The resulting long integer vector. + + + Returns a new integral vector whose elements signal whether the elements in one single-precision floating-point vector are less than or equal to their corresponding elements in a second single-precision floating-point vector. + The first vector to compare. + The second vector to compare. + The resulting integral vector. + + + Returns a new vector whose elements signal whether the elements in one vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a value that indicates whether all elements in the first vector are less than or equal to their corresponding elements in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if all of the elements in left are less than or equal to the corresponding elements in right; otherwise, false. + + + Returns a value that indicates whether any element in the first vector is less than or equal to the corresponding element in the second vector. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + true if any element in left is less than or equal to the corresponding element in right; otherwise, false. + + + Returns a new vector whose elements are the maximum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The maximum vector. + + + Returns a new vector whose elements are the minimum of each pair of elements in the two given vectors. + The first vector to compare. + The second vector to compare. + The vector type. T can be any primitive numeric type. + The minimum vector. + + + Returns a new vector whose values are a scalar value multiplied by each of the values of a specified vector. + The scalar value. + The vector. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + Returns a new vector whose values are the product of each pair of elements in two specified vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The product vector. + + + Returns a new vector whose values are the values of a specified vector each multiplied by a scalar value. + The vector. + The scalar value. + The vector type. T can be any primitive numeric type. + The scaled vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector whose elements are the negation of the corresponding element in the specified vector. + The source vector. + The vector type. T can be any primitive numeric type. + The negated vector. + + + Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Returns a new vector whose elements are the square roots of a specified vector's elements. + The source vector. + The vector type. T can be any primitive numeric type. + The square root vector. + + + Returns a new vector whose values are the difference between the elements in the second vector and their corresponding elements in the first vector. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The difference vector. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Returns a new vector by performing a bitwise exclusive Or (XOr) operation on each pair of elements in two vectors. + The first vector. + The second vector. + The vector type. T can be any primitive numeric type. + The resulting vector. + + + Represents a vector with two single-precision floating-point values. + + + Creates a new object whose two elements have the same value. + The value to assign to both elements. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of the vector. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 2 elements are equal to one. + A vector whose two elements are equal to one (that is, it returns the vector (1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 3x2 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 3x2 matrix. + The source vector. + The matrix. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0). + The vector (1,0). + + + Gets the vector (0,1). + The vector (0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + Returns a vector whose 2 elements are equal to zero. + A vector whose two elements are equal to zero (that is, it returns the vector (0,0). + + + Represents a vector with three single-precision floating-point values. + + + Creates a new object whose three elements have the same value. + The value to assign to all three elements. + + + Creates a new object from the specified object and the specified value. + The vector with two elements. + The additional value to assign to the field. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the cross product of two vectors. + The first vector. + The second vector. + The cross product. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 3 elements are equal to one. + A vector whose three elements are equal to one (that is, it returns the vector (1,1,1). + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns the reflection of a vector off a surface that has the specified normal. + The source vector. + The normal of the surface being reflected off. + The reflected vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a vector normal by the given 4x4 matrix. + The source vector. + The matrix. + The transformed vector. + + + Gets the vector (1,0,0). + The vector (1,0,0). + + + Gets the vector (0,1,0). + The vector (0,1,0).. + + + Gets the vector (0,0,1). + The vector (0,0,1). + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 3 elements are equal to zero. + A vector whose three elements are equal to zero (that is, it returns the vector (0,0,0). + + + Represents a vector with four single-precision floating-point values. + + + Creates a new object whose four elements have the same value. + The value to assign to all four elements. + + + Constructs a new object from the specified object and a W component. + The vector to use for the X, Y, and Z components. + The W component. + + + Creates a new object from the specified object and a Z and a W component. + The vector to use for the X and Y components. + The Z component. + The W component. + + + Creates a vector whose elements have the specified values. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + The value to assign to the field. + + + Returns a vector whose elements are the absolute values of each of the specified vector's elements. + A vector. + The absolute value vector. + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Restricts a vector between a minimum and a maximum value. + The vector to restrict. + The minimum value. + The maximum value. + The restricted vector. + + + Copies the elements of the vector to a specified array. + The destination array. + array is null. + The number of elements in the current instance is greater than in the array. + array is multidimensional. + + + Copies the elements of the vector to a specified array starting at a specified index position. + The destination array. + The index at which to copy the first element of the vector. + array is null. + The number of elements in the current instance is greater than in the array. + index is less than zero. -or- index is greater than or equal to the array length. + array is multidimensional. + + + Computes the Euclidean distance between the two given points. + The first point. + The second point. + The distance. + + + Returns the Euclidean distance squared between two specified points. + The first point. + The second point. + The distance squared. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector resulting from the division. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The vector that results from the division. + + + Returns the dot product of two vectors. + The first vector. + The second vector. + The dot product. + + + Returns a value that indicates whether this instance and another vector are equal. + The other vector. + true if the two vectors are equal; otherwise, false. + + + Returns a value that indicates whether this instance and a specified object are equal. + The object to compare with the current instance. + true if the current instance and obj are equal; otherwise, false```. If <code data-dev-comment-type="paramref">obj</code> isnull, the method returnsfalse`. + + + Returns the hash code for this instance. + The hash code. + + + Returns the length of this vector object. + The vector's length. + + + Returns the length of the vector squared. + The vector's length squared. + + + Performs a linear interpolation between two vectors based on the given weighting. + The first vector. + The second vector. + A value between 0 and 1 that indicates the weight of value2. + The interpolated vector. + + + Returns a vector whose elements are the maximum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The maximized vector. + + + Returns a vector whose elements are the minimum of each of the pairs of elements in two specified vectors. + The first vector. + The second vector. + The minimized vector. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiplies a vector by a specified scalar. + The vector to multiply. + The scalar value. + The scaled vector. + + + Multiplies a scalar value by a specified vector. + The scaled value. + The vector. + The scaled vector. + + + Negates a specified vector. + The vector to negate. + The negated vector. + + + Returns a vector with the same direction as the specified vector, but with a length of one. + The vector to normalize. + The normalized vector. + + + Gets a vector whose 4 elements are equal to one. + Returns . + + + Adds two vectors together. + The first vector to add. + The second vector to add. + The summed vector. + + + Divides the first vector by the second. + The first vector. + The second vector. + The vector that results from dividing left by right. + + + Divides the specified vector by a specified scalar value. + The vector. + The scalar value. + The result of the division. + + + Returns a value that indicates whether each pair of elements in two specified vectors is equal. + The first vector to compare. + The second vector to compare. + true if left and right are equal; otherwise, false. + + + Returns a value that indicates whether two specified vectors are not equal. + The first vector to compare. + The second vector to compare. + true if left and right are not equal; otherwise, false. + + + Multiplies two vectors together. + The first vector. + The second vector. + The product vector. + + + Multiples the specified vector by the specified scalar value. + The vector. + The scalar value. + The scaled vector. + + + Multiples the scalar value by the specified vector. + The vector. + The scalar value. + The scaled vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The vector that results from subtracting right from left. + + + Negates the specified vector. + The vector to negate. + The negated vector. + + + Returns a vector whose elements are the square root of each of a specified vector's elements. + A vector. + The square root vector. + + + Subtracts the second vector from the first. + The first vector. + The second vector. + The difference vector. + + + Returns the string representation of the current instance using default formatting. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements. + A or that defines the format of individual elements. + The string representation of the current instance. + + + Returns the string representation of the current instance using the specified format string to format individual elements and the specified format provider to define culture-specific formatting. + A or that defines the format of individual elements. + A format provider that supplies culture-specific formatting information. + The string representation of the current instance. + + + Transforms a four-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a four-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a three-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a two-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Transforms a two-dimensional vector by the specified Quaternion rotation value. + The vector to rotate. + The rotation to apply. + The transformed vector. + + + Transforms a three-dimensional vector by a specified 4x4 matrix. + The vector to transform. + The transformation matrix. + The transformed vector. + + + Gets the vector (0,0,0,1). + The vector (0,0,0,1). + + + Gets the vector (1,0,0,0). + The vector (1,0,0,0). + + + Gets the vector (0,1,0,0). + The vector (0,1,0,0).. + + + Gets a vector whose 4 elements are equal to zero. + The vector (0,0,1,0). + + + The W component of the vector. + + + + The X component of the vector. + + + + The Y component of the vector. + + + + The Z component of the vector. + + + + Gets a vector whose 4 elements are equal to zero. + A vector whose four elements are equal to zero (that is, it returns the vector (0,0,0,0). + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarinios10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarinios10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarinmac20/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarinmac20/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarintvos10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarintvos10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarinwatchos10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/ref/xamarinwatchos10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/useSharedDesignerContext.txt b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/useSharedDesignerContext.txt new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/version.txt b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/version.txt new file mode 100644 index 00000000..1ca86a08 --- /dev/null +++ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/version.txt @@ -0,0 +1 @@ +8321c729934c0f8be754953439b88e6e1c120c24 diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/.signature.p7s b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..a7fbb7345d4637e6451f79984453106e7600fc77 GIT binary patch literal 22354 zcmeHvc|4SD-@X}R?E9J}6DhlE#x8{{*@Y~*E5_J&W9&*ZmP!gqBtnrCvL+!}BS~a0 zDXBzu*(%;^Yb|erB%2l#Fi8Wg^-Z|Hh(sRq?*A@Ol`4Vj_z&>NGd9nI8sJj zP6`l5iX#D}xTLt0ICx1+6Yb@oU}lXomcuw3+WOd{EldqGwOmx3v4>gps>D4xy?7Y-gthWROTCu=>w}omLVo zZ501g(;z_jzFz?F#*h*q^dtZQLIov2AS5|-tWO73PaerXHC{Z8nl9t36d^+ zA5T3)SzNo%Okf<9XHUMYfK7Y9nBLRDj`YqAJIY-AtaFN7yu2>fj5Lb_g%v@+9AjJ&NW@he4o_1}Z2Y89q{4frH?c~oJY<>>G z+W;ZCMpxcHFgo!T>lI*gv2qS;*Nqz7?`@rXYGkUT=ap$;%9E!of~B4*MLbT4Xco@-LMBbPvald*b6%__MiMf zBWYL3Ov~an9n6bi*uHpOl@u5bJ0T$UYWcHYLS z#qMzjDZY;vssEz^Gg1->pioE@F=Pe+Y?Ir0|SxfowW|L4^|^TkW6Me-YaK=y@Rj#laZ< zOVPfBg|tw9JElXD2XXm=yUKPtR#zKMvDinPQEwMZyZ-UCC?YPGTl*A6Kh5U>Ju8j} zw`vP=J&<;ip8K*ruHAkb{4uEMLfX4MNbZ*5DXKxU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_Fxu>3*`6Op}utGA1fsN;{nu5AS2+jsA#GO1nm_w zy7u`pvi}l{+y(MuNxu!sF-)9SKRi$bHx!h>4<$_jC0Uy3vjUp>b);@RTU$035bNLU zZ6MzH?`{6Art-_aHUl;&D3Hd_H6h>pH)=Ap{8LRQVwtl}*EMNEK>@?_ho6>*-)nM! z=vf=;*&BlY{+IfTs{Yu0KUNj%_wQ8o7yb8NSM?$2PgVVUL#0yEv;SqN{?viHVgF85 zf6;-ur6`Cx>;ObO`gyDh8=;`=jf}7FzyH@`Wp?!MRP`^7Rm|rikC1N>e99S`(>|C<7Sul}zC j!2e!-BOmln;ou)i!2?g5>z6s;Le&DF?nD5O8mRvRS#^it literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT new file mode 100644 index 00000000..db542ca2 --- /dev/null +++ b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT @@ -0,0 +1,309 @@ +.NET Core uses third-party libraries or other resources that may be +distributed under licenses different than the .NET Core software. + +In the event that we accidentally failed to list a required notice, please +bring it to our attention. Post an issue or email us: + + dotnet@microsoft.com + +The attached notices are provided for information only. + +License notice for Slicing-by-8 +------------------------------- + +http://sourceforge.net/projects/slicing-by-8/ + +Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + + +This software program is licensed subject to the BSD License, available at +http://www.opensource.org/licenses/bsd-license.html. + + +License notice for Unicode data +------------------------------- + +http://www.unicode.org/copyright.html#License + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +License notice for Zlib +----------------------- + +https://github.com/madler/zlib +http://zlib.net/zlib_license.html + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.11, January 15th, 2017 + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +*/ + +License notice for Mono +------------------------------- + +http://www.mono-project.com/docs/about-mono/ + +Copyright (c) .NET Foundation Contributors + +MIT License + +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. + +License notice for International Organization for Standardization +----------------------------------------------------------------- + +Portions (C) International Organization for Standardization 1986: + Permission to copy in any form is granted for use with + conforming SGML systems and applications as defined in + ISO 8879, provided this notice is included in all copies. + +License notice for Intel +------------------------ + +"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License notice for Xamarin and Novell +------------------------------------- + +Copyright (c) 2015 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. + +Copyright (c) 2011 Novell, Inc (http://www.novell.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. + +Third party notice for W3C +-------------------------- + +"W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE +Status: This license takes effect 13 May, 2015. +This work is being provided by the copyright holders under the following license. +License +By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. +Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: +The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. +Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. +Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." +Disclaimers +THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders." + +License notice for Bit Twiddling Hacks +-------------------------------------- + +Bit Twiddling Hacks + +By Sean Eron Anderson +seander@cs.stanford.edu + +Individually, the code snippets here are in the public domain (unless otherwise +noted) — feel free to use them however you please. The aggregate collection and +descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are +distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and +without even the implied warranty of merchantability or fitness for a particular +purpose. + +License notice for Brotli +-------------------------------------- + +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +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. + +compress_fragment.c: +Copyright (c) 2011, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +decode_fuzzer.c: +Copyright (c) 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000000000000000000000000000000000000..67d56efbbd0dbc4145ca87da5700568680df9674 GIT binary patch literal 23088 zcmeHv2UrwKv*>IfXO<*!36dntE+8P1b4H>hiA#{Muq@F;P>d)dNkIh^F(ARLfS6Db z1rY;^pdgAU7!Xtt<@F2;at!A`|GoeD&VBd2S+=^Xx;j@^ch}Tn@0AVVAPB;P@6;3o zodF^87@_dbK`Kb*mO94`onX5qeFkH9OWHLoJdPMcqlVG~qKH8O(a}^oF_1!}#YYpv zqlspYF2pEmFhz}vi(QUUw39gm*|Z}_!@yP z0*D~MPPZGx(DoxClnTCp{>>Q!`en2Zf_Txt?;!(4c)^nj%C$uzM&QegL>P}a1i=O% z?hiqnGqisvB+fP+&BY3Et2z1A=#(Tn!0++_0MgLDf_Be+h@f^gS{yA1AtG%vVuS)9 zobwog6g3(pk_s5nw)%raq%2YJo%0w$kjWerjn*LJ3Ld0wScnNaAqzn_xgdxQrG5ua z#Oa~^PWg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Kk;{cC(E<&-JRPqneI%ffz0GJnJP^jTwy};IxT31z^=l zX|Le40XVH6PHVsu?0)Z|`!6E3B%Bkci&8A;SNlWy;Mb_AVdU14oq%+H&FS z$o|*&c5TglI9{-7_bG3;47meWSY#@@j#-j|LerK>cw@JjW;68%YMRQJjObUJ5>4xR zJdXrP=`Mezlb=2E$aIbJpn=7NjFo~+wgIM^ZL0Ncm2bhfVA%)D&txpi+L^mlw_fi_ z0C3=1vhT5*Ha73eQA%mMjB`|F-Sa$~POT?T-i@f|2F5L}a8vA3=n}9vxY_nWZh};x z^!pBqY?#whO)cI9T1$GK#R(TGZH`^3{ZPAXqHYgkR(ualoeGox5<11 + + System.Runtime.CompilerServices.Unsafe + + + +

      Contains generic, low-level functionality for manipulating pointers. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds a byte offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of byte offset to pointer. + + + Determines whether the specified references point to the same location. + The first reference to compare. + The second reference to compare. + The type of reference. + true if left and right point to the same location; otherwise, false. + + + Casts the given object to the specified type. + The object to cast. + The type which the object will be cast to. + The original object, casted to the given type. + + + Reinterprets the given reference as a reference to a value of type TTo. + The reference to reinterpret. + The type of reference to reinterpret.. + The desired type of the reference. + A reference to a value of type TTo. + + + Returns a pointer to the given by-ref parameter. + The object whose pointer is obtained. + The type of object. + A pointer to the given value. + + + Reinterprets the given location as a reference to a value of type T. + The location of the value to reference. + The type of the interpreted location. + A reference to a value of type T. + + + Determines the byte offset from origin to target from the given references. + The reference to origin. + The reference to target. + The type of reference. + Byte offset from origin to target i.e. target - origin. + + + Copies a value of type T to the given location. + The location to copy to. + A reference to the value to copy. + The type of value to copy. + + + Copies a value of type T to the given location. + The location to copy to. + A pointer to the value to copy. + The type of value to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Reads a value of type T from the given location. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Returns the size of an object of the given type parameter. + The type of object whose size is retrieved. + The size of an object of type T. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts a byte offset from the given reference. + The reference to subtract the offset from. + + The type of reference. + A new reference that reflects the subraction of byte offset from pointer. + + + Writes a value of type T to the given location. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000000000000000000000000000000000000..d99e9f9eb78189ae1150123aeb5555214b493989 GIT binary patch literal 23600 zcmeHv2|QKbxA?h(d3GZau35!(uAxZgd6s!h7uOW7u4`&ART`Db7-dS*U`T@oAt|MV z=A;lsX%ZDB|9y^2z75~s_r3S~e!lPj-a9&L@3r>Y)7opVz4to%X5*0t;UEaYgLiTg zf@(mBJo+g7bC3vNev>TBtc#yVXAr`1v27(57AczB{eh2o% zDbaqX{5rPDP1*Szb>JFRSY_2b{^sWR?w5ZJjsO3>u}N&dy|bw`UDqUa};@78!c zJR(-Rn)h5OfB3-zcddj&cgjU<&$E>65T>n;e_O=W^X;lP<6s}}#_s$D&yR?HHrpyT zXYSdTJ2qeU4-wj@sj1~#ruKn2vguKUdjKVZy=8z?kuFOkz!->)*);5G3( zvE5T`pYG4M`P2Qu&8R9ChyONrAyVeAY189~@Cjm2R+RU5^yw*p@QeJS+-cem`4RH3 z%4O0qs5+v30*p8?9*DgGy%E52vMxl%XIk~KXq`XexS2T!WRFVWwuc+Y_j~%Ru|oL) zJ1TdiUgW{zewW|Li$?2CI>^5DE(v3Sc)FT$y-aZ-GKxz=60U zgB~0n7>RJOgN`AlR>s*8;spC@W--!bB(>#P_4H5rvOX z_z8sq7$j8*g(fJZVpd>Sp|vPXM&S+=9t04nWvUKDI!PFQ=q-j5B7-=f0_-D(7pno{ z!0Z7`5z7f7m@L#rL^5VV%dn0B?_*+?0K-CGXE0ANSLaAgak^psK+hGKSOmaWA^jOF z6iC;Ni6vm8KtCBXSOOTaG$ytYyA|Sv3YgeV>>eP|lT0iFn+34u8L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61YY$=?h#Y%kZ+^W{f6dr?g>W8*#ZKC0+EP6Sma6wpPvyTfP5+it`Q48$ zExQJaynKV&b<)#3@3-y~x%^)>dNZeHrqNrhtg80!GJ3x$8=S@q(9<|_0Wv8APTB(} z?fS!kJPFpBIZtDR$-h02+gn*ooyLvq9aa3P0Tl3mSp0?KxIOsY;`ie?^84t&bR1`U zzGXR2@0IRsy`%cx%YtTv3;B zC1H5UdJnz%!#Q!5yB(kkO}@FKDsf5Fhh?W$^<8cKczq2-vx1FfrI+1$jVsCA<-Xv; z=?Q#KM82w}!h~~$%D2<~JJrtn`t0j;)gOG{niG(=V=}}yp{vP~Yqxx_*3dl5)qeZe zN`*D%6&EcVPgtKBk`{X?tfMDyO#G|ngY=OrC7hWl2WtSZw}zzU8eO#d2p+P8nOcuUH@ezI~pdYW37_?P$(66|t*Q74E0X9~&>rvR{3_u%pTO zS@09rhW00L{ltyuHeYz^yzK_}OU%<$xp2#kh4hxEz+U6gTMmW!cdO$yB-qbATHJZt zXV(+P77M|`WNa(&(t;lag4-jX3;*XGCyHb^LD$%rKZL{yL3DjNsaT@}wM9DATc7kp z`g~H0xC(%~EGh9|{6D;2&H7jc?h{~Hpr_UtTUc6zZ|3~BSYruU(_@+dz9dW$;22PkdIsDqA-GsHEwEug9`gmRp~9X}s<8XrRxk z%ttOBqq^EO_!5b>uNVuS#tX8H|g&d@@gle;T#7&NWtpCDG5m;j>-) zA&aN@h%f0U8S=IX!biAJbiDchoh9wMOs2f1|Mk^lez literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml new file mode 100644 index 00000000..6a7cfcff --- /dev/null +++ b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.xml @@ -0,0 +1,200 @@ + + + System.Runtime.CompilerServices.Unsafe + + + + Contains generic, low-level functionality for manipulating pointers. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds a byte offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of byte offset to pointer. + + + Determines whether the specified references point to the same location. + The first reference to compare. + The second reference to compare. + The type of reference. + true if left and right point to the same location; otherwise, false. + + + Casts the given object to the specified type. + The object to cast. + The type which the object will be cast to. + The original object, casted to the given type. + + + Reinterprets the given reference as a reference to a value of type TTo. + The reference to reinterpret. + The type of reference to reinterpret.. + The desired type of the reference. + A reference to a value of type TTo. + + + Returns a pointer to the given by-ref parameter. + The object whose pointer is obtained. + The type of object. + A pointer to the given value. + + + Reinterprets the given location as a reference to a value of type T. + The location of the value to reference. + The type of the interpreted location. + A reference to a value of type T. + + + Determines the byte offset from origin to target from the given references. + The reference to origin. + The reference to target. + The type of reference. + Byte offset from origin to target i.e. target - origin. + + + Copies a value of type T to the given location. + The location to copy to. + A reference to the value to copy. + The type of value to copy. + + + Copies a value of type T to the given location. + The location to copy to. + A pointer to the value to copy. + The type of value to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Reads a value of type T from the given location. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Returns the size of an object of the given type parameter. + The type of object whose size is retrieved. + The size of an object of type T. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts a byte offset from the given reference. + The reference to subtract the offset from. + + The type of reference. + A new reference that reflects the subraction of byte offset from pointer. + + + Writes a value of type T to the given location. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000000000000000000000000000000000000..3156239266db9cceede249731f00c3822e479a1f GIT binary patch literal 23600 zcmeHv2V4|OllW{P=ZwT92MM!eL~@p>BoUCf1PP0~OEi!a5k*juAO=uSR0P3=hrCdY9s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zoj4%F3Yx}5|3gTe0CYW}bnA z71*)hUN#dN=W&{0a9DN#VbGbE97_bJ({uN4klib`m=$J5lHr(22qm*|OnUMBr3vz< zV<{<+X5A70!`3{uTDaf^t&i-)MiVFcsvl%tE+liBrR*(FeSLv#YOpqnWZAhtF!jO) zTip`I=_*lN-4(X6J)s2-3FU>gJ)Eo>K5968Q5=sfIpr<0aA^4>f6~3|g_-rbdaW@2 z%FVnJ$A{}qaCR>=>(+IMU|-I`-fx6`V&*oH5>8CTae%!e3#!pO|Jfcz-AljPy3Thm zrDB%AB6A)Ga4(AE4?YF>M}N`Rd-t?mxAG7_-tQe$?v0FGo;xtQR-dq^#yqG{JXtdi zPMMmQ0al%u@)AxNgj4$AlnZ!5S&F(_sitC$2PJK3j-gx7AUlViaW=(gcX3^Ng_$q7 zuUYWlU?}`raKKq6yv_Y(W8#5FW<^uiFMHo+?yt$tdAQLa&iu9imFF(DY4a5lY%GvF zIoWz5Z<1Dd?z6u1(R!s?3Wk-9!`n+V=yB4BrGxd7+Wy418)DDsT*W@z8T|gj`Ziw1 z3zJ`bUObkFKYhNL>KB;&Cf&G9>|?%(w(L0nmAo4UHOD#zp<~Q>buDpQEVpSdb|&1~ zvFFZ;Vg;|_Re_5}3t#OKpV*jl{N;hPI?2?n(F<3Itc}~ec+`u*NL!kBApK(J_OV-- zVh=u{vw%Gji#@PaP4!O~Kaxp%m^is6ysP(Sb|NL;Vt_SC OyIXQg_#$)@0sTLk9O=pc literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml new file mode 100644 index 00000000..6a7cfcff --- /dev/null +++ b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml @@ -0,0 +1,200 @@ + + + System.Runtime.CompilerServices.Unsafe + + + + Contains generic, low-level functionality for manipulating pointers. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds a byte offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of byte offset to pointer. + + + Determines whether the specified references point to the same location. + The first reference to compare. + The second reference to compare. + The type of reference. + true if left and right point to the same location; otherwise, false. + + + Casts the given object to the specified type. + The object to cast. + The type which the object will be cast to. + The original object, casted to the given type. + + + Reinterprets the given reference as a reference to a value of type TTo. + The reference to reinterpret. + The type of reference to reinterpret.. + The desired type of the reference. + A reference to a value of type TTo. + + + Returns a pointer to the given by-ref parameter. + The object whose pointer is obtained. + The type of object. + A pointer to the given value. + + + Reinterprets the given location as a reference to a value of type T. + The location of the value to reference. + The type of the interpreted location. + A reference to a value of type T. + + + Determines the byte offset from origin to target from the given references. + The reference to origin. + The reference to target. + The type of reference. + Byte offset from origin to target i.e. target - origin. + + + Copies a value of type T to the given location. + The location to copy to. + A reference to the value to copy. + The type of value to copy. + + + Copies a value of type T to the given location. + The location to copy to. + A pointer to the value to copy. + The type of value to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Reads a value of type T from the given location. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Returns the size of an object of the given type parameter. + The type of object whose size is retrieved. + The size of an object of type T. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts a byte offset from the given reference. + The reference to subtract the offset from. + + The type of reference. + A new reference that reflects the subraction of byte offset from pointer. + + + Writes a value of type T to the given location. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000000000000000000000000000000000000..19ec356e3b867c8ff9ab2b09364ddfce319d44d3 GIT binary patch literal 23304 zcmeHv2Ut@}x9HwU=p6)=8hR1JPUtATcce;D2oN9w2_~W1D2kvWs8m4(rC3k|>IAct#uz zPo?3l-8}Iz^e_rRK!8_iqH1>=2y%w8P~M^PfXUXnAq6}ij6jemz;KUaFh=2`ow?3&1NxKmhXCeFb#SeDI)k0)xp2MUg0N z<`eNO5YKqbK@NdIiKc^sD6J^X=omnf;GOZ9Ly+YRke&2J#}zy%Z5W6H3dTdw6+sB% zL6I{aHPHW*8Soz^Wie`?N4y%mvywSAKp{&{M@txj*~L-X;&llKK?l(x8lfl-C>n&B zpl^z+AZQrGfnXvP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`?yLyfP z1&yA8t-h8O(FW1d)6=yg&O_AEf><$y->NBiPxk*H!@H2df4gGftd>1er z&=aSci-^J;p($Mx(bLz__n$<7TZ?f7k^rRFxT_9OY{3=3HaJW2PE-I){U8ngPYwnS z!T=v|prnGdB*%CG=P_%vfc}inF+^|^KIQAf)|AV55pMJ|ti;pc^2sz;IsSJfv;U4m zQ^V@wl?R_jf;JUiF9_{XWZ2x2B3g~f94|^;KoQLn-MjOR*%g7d%YA;C`;Umn74L6y zFym3$#bHOM+%qc5?kg}l7a+m^^{hzoD)Re>c=yQs;iAESsu#;YnCy5g(`uKppyqal zuh0>>yPL;~gSFeFn|0OQhhrTotkPe4Zr^`SCH=#zDptPx9XXRnT*~5w7V6KX(h>?@ zx+lROU08Wf9k(Pc)qcJI)aXt8i7ayL+4%cf*G}X@8*SwJ8ou?Em>x)yWL8}$-qIiU z$Rt=}Sd{R+XXn29jZ)Q55F}IZ&aU~}=Hff8GK6Q!LmPPc=C#^z9}k zbR2C1jyOO=#=K{**{%QV8Ef1d=NAh4Oj}wSOhP25%qzeNOyD;L6y*2DvH8M1O4~mi z%dhk`SlWJGe#9nb>>bqCB+c{Y^KzO#FJ`szb$dSP>H!T<^%+T5-3n7`j z_)cd1cPmoLvxc;k4sQQ5p>IB%mpHxhvBhDUXwOzL-vf7Y!^LjT>pr~mq9ZfdRz~Sg z+)|UVpp{rTV?~o!H5*%;rJ_EXvF5;+m0J5g*x_@%Y@Fm2Y1plw$Ks=fnwuT!oUl(D x=kaa#_Ddzc?~t`>5YJXvcR}!_S*qQ$cxla328*wC@{K(a+%?wQ + + System.Runtime.CompilerServices.Unsafe + + + + Contains generic, low-level functionality for manipulating pointers. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds a byte offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of byte offset to pointer. + + + Determines whether the specified references point to the same location. + The first reference to compare. + The second reference to compare. + The type of reference. + true if left and right point to the same location; otherwise, false. + + + Casts the given object to the specified type. + The object to cast. + The type which the object will be cast to. + The original object, casted to the given type. + + + Reinterprets the given reference as a reference to a value of type TTo. + The reference to reinterpret. + The type of reference to reinterpret.. + The desired type of the reference. + A reference to a value of type TTo. + + + Returns a pointer to the given by-ref parameter. + The object whose pointer is obtained. + The type of object. + A pointer to the given value. + + + Reinterprets the given location as a reference to a value of type T. + The location of the value to reference. + The type of the interpreted location. + A reference to a value of type T. + + + Determines the byte offset from origin to target from the given references. + The reference to origin. + The reference to target. + The type of reference. + Byte offset from origin to target i.e. target - origin. + + + Copies a value of type T to the given location. + The location to copy to. + A reference to the value to copy. + The type of value to copy. + + + Copies a value of type T to the given location. + The location to copy to. + A pointer to the value to copy. + The type of value to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Reads a value of type T from the given location. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Returns the size of an object of the given type parameter. + The type of object whose size is retrieved. + The size of an object of type T. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts a byte offset from the given reference. + The reference to subtract the offset from. + + The type of reference. + A new reference that reflects the subraction of byte offset from pointer. + + + Writes a value of type T to the given location. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 0000000000000000000000000000000000000000..9d996136792bee837104d1ab842731395ba66ee8 GIT binary patch literal 23816 zcmeHv2V7H2v-mkl=)I~)2^}fngkD5?uTrInAp{65n1pTtRP2IE6D(8(L}?Z*h=?65 zU@wTGG{uIXV&lIj)O+>b?|$!n_jlj_{ocW|yED6IcXoDmc6N57vtJg3g&+tA-tln= zY6LO*n6bh?4^lxkzsyN~=m^&}*+$sunyhCym4T0?)57SaXgrw|6GLO-gDH4=TnwHX zgST?^z(>1REuAO!gPSQzxnY#mw@{WlX&f+z|+KA>J#G+_o_b~G{hNQ0(LL3$Yk z@q*|vAje=b>n}z4Y0_E6IRR`p>q7#QlE?&btuP2c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smYS!mf;YTRQx%V>?mXQ+km>1t>eWc9&t|K6fz?Zj zMc=wM?YUGbm)vk%Bfl>sIH6BZyLMe~C^PYsMatgj4wx za_`c*W%ORT%~NaGe88zWvuDAdhb<=v}^%U+wN86Z_WXJxupF!f6@Ys z5ODPy{YlHj!UIkMi2tdD=MU=s{Sm;wx=6!17XZI{F$oNeNFVH>EY@{zy&~ECRA`yE z;DLO4pXJF!S#)x9-%BOHa?4(d}3DxGNbta#?Zqtb5k`>iEmvppthD@S1b?b%yJE%qpB6 zJAYJ&u6=oD4^(x;(%wm%xQ)CwMZ0Oom&{|s#J5GA%!A85j}C~8;sdX}*DNznykGaW zRLbLuqfv!{;+3t~m&e!B_4d$9f= zIlMCo{8wajye0a7(9K@Mz}*E58`SM2wic0_D=@v+WL<^un?it7iwOjh0L-?Dt2$s~ z3y%0Tfj!ARSpjhMgEaUre=uBG7;pz1Y*Im5Vq~I#a~L?~hY-D4pJRyNBz*d=4{N7f z#Eo#GpJBzHFDsr(a}?u$M>6Yo9O9V`eWd|Iw6k9?2y!MowOsZ1?)v?QJawABWb3@i z4Dza#R^mT^>^W1Pvr+o2^{KZ`@|P2tQrg-Ex<$7JG*=%> zTz)8Z;kj#Go7hi0y=f!PSo;AofBm>8&NjRIl3Q>>yY&-e*{}br(=$*4E0j#3i;qUXd}RwJ|gV=2=w*?rfc3!&AVwV_)p#{d`Lqehm%bJND>@%L)F9m^IrA3y3mS=bLT6 WzKEAQlAE;Y=?%%I!ioP<=>GwdSOVMt literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml new file mode 100644 index 00000000..6a7cfcff --- /dev/null +++ b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/ref/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml @@ -0,0 +1,200 @@ + + + System.Runtime.CompilerServices.Unsafe + + + + Contains generic, low-level functionality for manipulating pointers. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds an element offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of offset to pointer. + + + Adds a byte offset to the given reference. + The reference to add the offset to. + The offset to add. + The type of reference. + A new reference that reflects the addition of byte offset to pointer. + + + Determines whether the specified references point to the same location. + The first reference to compare. + The second reference to compare. + The type of reference. + true if left and right point to the same location; otherwise, false. + + + Casts the given object to the specified type. + The object to cast. + The type which the object will be cast to. + The original object, casted to the given type. + + + Reinterprets the given reference as a reference to a value of type TTo. + The reference to reinterpret. + The type of reference to reinterpret.. + The desired type of the reference. + A reference to a value of type TTo. + + + Returns a pointer to the given by-ref parameter. + The object whose pointer is obtained. + The type of object. + A pointer to the given value. + + + Reinterprets the given location as a reference to a value of type T. + The location of the value to reference. + The type of the interpreted location. + A reference to a value of type T. + + + Determines the byte offset from origin to target from the given references. + The reference to origin. + The reference to target. + The type of reference. + Byte offset from origin to target i.e. target - origin. + + + Copies a value of type T to the given location. + The location to copy to. + A reference to the value to copy. + The type of value to copy. + + + Copies a value of type T to the given location. + The location to copy to. + A pointer to the value to copy. + The type of value to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Copies bytes from the source address to the destination address +without assuming architecture dependent alignment of the addresses. + The destination address to copy to. + The source address to copy from. + The number of bytes to copy. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Initializes a block of memory at the given location with a given initial value +without assuming architecture dependent alignment of the address. + The address of the start of the memory block to initialize. + The value to initialize the block to. + The number of bytes to initialize. + + + Reads a value of type T from the given location. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Reads a value of type T from the given location +without assuming architecture dependent alignment of the addresses. + The location to read from. + The type to read. + An object of type T read from the given location. + + + Returns the size of an object of the given type parameter. + The type of object whose size is retrieved. + The size of an object of type T. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts an element offset from the given reference. + The reference to subtract the offset from. + The offset to subtract. + The type of reference. + A new reference that reflects the subraction of offset from pointer. + + + Subtracts a byte offset from the given reference. + The reference to subtract the offset from. + + The type of reference. + A new reference that reflects the subraction of byte offset from pointer. + + + Writes a value of type T to the given location. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + Writes a value of type T to the given location +without assuming architecture dependent alignment of the addresses. + The location to write to. + The value to write. + The type of value to write. + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/useSharedDesignerContext.txt new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt new file mode 100644 index 00000000..69308609 --- /dev/null +++ b/JNFrame/Packages/System.Runtime.CompilerServices.Unsafe.4.5.2/version.txt @@ -0,0 +1 @@ +02b11eeee1fbc5f3ef43a1452fe07efd25fa1715 diff --git a/JNFrame/Packages/manifest.json b/JNFrame/Packages/manifest.json new file mode 100644 index 00000000..86b760aa --- /dev/null +++ b/JNFrame/Packages/manifest.json @@ -0,0 +1,45 @@ +{ + "dependencies": { + "com.unity.collab-proxy": "2.0.4", + "com.unity.feature.development": "1.0.1", + "com.unity.ide.rider": "3.0.21", + "com.unity.ide.visualstudio": "2.0.18", + "com.unity.ide.vscode": "1.2.5", + "com.unity.test-framework": "1.1.33", + "com.unity.textmeshpro": "3.0.6", + "com.unity.timeline": "1.6.5", + "com.unity.ugui": "1.0.0", + "com.unity.visualscripting": "1.8.0", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } +} diff --git a/JNFrame/Packages/packages-lock.json b/JNFrame/Packages/packages-lock.json new file mode 100644 index 00000000..f0aa7dc8 --- /dev/null +++ b/JNFrame/Packages/packages-lock.json @@ -0,0 +1,393 @@ +{ + "dependencies": { + "com.unity.collab-proxy": { + "version": "2.0.4", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.editorcoroutines": { + "version": "1.0.0", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.ext.nunit": { + "version": "1.0.6", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.feature.development": { + "version": "1.0.1", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.ide.visualstudio": "2.0.18", + "com.unity.ide.rider": "3.0.21", + "com.unity.ide.vscode": "1.2.5", + "com.unity.editorcoroutines": "1.0.0", + "com.unity.performance.profile-analyzer": "1.2.2", + "com.unity.test-framework": "1.1.33", + "com.unity.testtools.codecoverage": "1.2.3" + } + }, + "com.unity.ide.rider": { + "version": "3.0.21", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.ide.visualstudio": { + "version": "2.0.18", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.9" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.ide.vscode": { + "version": "1.2.5", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.performance.profile-analyzer": { + "version": "1.2.2", + "depth": 1, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.settings-manager": { + "version": "1.0.3", + "depth": 2, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, + "com.unity.test-framework": { + "version": "1.1.33", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ext.nunit": "1.0.6", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.testtools.codecoverage": { + "version": "1.2.3", + "depth": 1, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.0.16", + "com.unity.settings-manager": "1.0.1" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.textmeshpro": { + "version": "3.0.6", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.timeline": { + "version": "1.6.5", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.director": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.ugui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0" + } + }, + "com.unity.visualscripting": { + "version": "1.8.0", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.ugui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + }, + "url": "https://packages.unity.cn" + }, + "com.unity.modules.ai": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.androidjni": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.animation": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.assetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.audio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.cloth": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.director": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.animation": "1.0.0" + } + }, + "com.unity.modules.imageconversion": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.imgui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.jsonserialize": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.particlesystem": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.physics2d": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.screencapture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.subsystems": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.terrain": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.terrainphysics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.terrain": "1.0.0" + } + }, + "com.unity.modules.tilemap": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics2d": "1.0.0" + } + }, + "com.unity.modules.ui": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.uielements": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.uielementsnative": "1.0.0" + } + }, + "com.unity.modules.uielementsnative": { + "version": "1.0.0", + "depth": 1, + "source": "builtin", + "dependencies": { + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.umbra": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unityanalytics": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0" + } + }, + "com.unity.modules.unitywebrequest": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.unitywebrequestassetbundle": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestaudio": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.audio": "1.0.0" + } + }, + "com.unity.modules.unitywebrequesttexture": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.unitywebrequestwww": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0" + } + }, + "com.unity.modules.vehicles": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0" + } + }, + "com.unity.modules.video": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0" + } + }, + "com.unity.modules.vr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } + }, + "com.unity.modules.wind": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": {} + }, + "com.unity.modules.xr": { + "version": "1.0.0", + "depth": 0, + "source": "builtin", + "dependencies": { + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.subsystems": "1.0.0" + } + } + } +} diff --git a/JNFrame/ProjectSettings/AudioManager.asset b/JNFrame/ProjectSettings/AudioManager.asset new file mode 100644 index 00000000..07ebfb05 --- /dev/null +++ b/JNFrame/ProjectSettings/AudioManager.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 1024 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 + m_RequestedDSPBufferSize: 1024 diff --git a/JNFrame/ProjectSettings/AutoStreamingSettings.asset b/JNFrame/ProjectSettings/AutoStreamingSettings.asset new file mode 100644 index 00000000..d3e071e2 --- /dev/null +++ b/JNFrame/ProjectSettings/AutoStreamingSettings.asset @@ -0,0 +1,21 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1200 &1 +AutoStreamingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + mSearchMode: 15 + mCustomSearchFile: + mTextureSearchString: + mMeshSearchString: + mTextures: [] + mAudios: [] + mMeshes: [] + mScenes: [] + mConfigCCD: + useCCD: 0 + cosKey: + projectGuid: + bucketUuid: + bucketName: + badgeName: diff --git a/JNFrame/ProjectSettings/ClusterInputManager.asset b/JNFrame/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 00000000..e7886b26 --- /dev/null +++ b/JNFrame/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/JNFrame/ProjectSettings/DynamicsManager.asset b/JNFrame/ProjectSettings/DynamicsManager.asset new file mode 100644 index 00000000..cdc1f3ea --- /dev/null +++ b/JNFrame/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_ClothInterCollisionDistance: 0 + m_ClothInterCollisionStiffness: 0 + m_ContactsGeneration: 1 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_AutoSimulation: 1 + m_AutoSyncTransforms: 0 + m_ReuseCollisionCallbacks: 1 + m_ClothInterCollisionSettingsToggle: 0 + m_ContactPairsMode: 0 + m_BroadphaseType: 0 + m_WorldBounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 250, y: 250, z: 250} + m_WorldSubdivisions: 8 + m_FrictionType: 0 + m_EnableEnhancedDeterminism: 0 + m_EnableUnifiedHeightmaps: 1 + m_DefaultMaxAngluarSpeed: 7 diff --git a/JNFrame/ProjectSettings/EditorBuildSettings.asset b/JNFrame/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 00000000..efff65a5 --- /dev/null +++ b/JNFrame/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,14 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: + - enabled: 1 + path: Assets/Scenes/UIScene.unity + guid: 786aa53c6477525459c2f878d3c43a13 + - enabled: 1 + path: Assets/Scenes/WorldScene.unity + guid: 9249f4afb3db3c4489d1a29ea88a2f1c + m_configObjects: {} diff --git a/JNFrame/ProjectSettings/EditorSettings.asset b/JNFrame/ProjectSettings/EditorSettings.asset new file mode 100644 index 00000000..1e44a0a1 --- /dev/null +++ b/JNFrame/ProjectSettings/EditorSettings.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_ExternalVersionControlSupport: Visible Meta Files + m_SerializationMode: 2 + m_LineEndingsForNewScripts: 0 + m_DefaultBehaviorMode: 0 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} + m_SpritePackerMode: 0 + m_SpritePackerPaddingPower: 1 + m_EtcTextureCompressorBehavior: 1 + m_EtcTextureFastCompressor: 1 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 4 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref + m_ProjectGenerationRootNamespace: + m_CollabEditorSettings: + inProgressEnabled: 1 + m_EnableTextureStreamingInEditMode: 1 + m_EnableTextureStreamingInPlayMode: 1 + m_AsyncShaderCompilation: 1 + m_EnterPlayModeOptionsEnabled: 0 + m_EnterPlayModeOptions: 3 + m_ShowLightmapResolutionOverlay: 1 + m_UseLegacyProbeSampleCount: 0 + m_SerializeInlineMappingsOnOneLine: 1 diff --git a/JNFrame/ProjectSettings/GraphicsSettings.asset b/JNFrame/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 00000000..43369e3c --- /dev/null +++ b/JNFrame/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,63 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_LegacyDeferred: + m_Mode: 1 + m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_AlwaysIncludedShaders: + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, + type: 0} + m_CustomRenderPipeline: {fileID: 0} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_LightsUseLinearIntensity: 0 + m_LightsUseColorTemperature: 0 + m_LogWhenShaderIsCompiled: 0 + m_AllowEnlightenSupportForUpgradedProject: 0 diff --git a/JNFrame/ProjectSettings/InputManager.asset b/JNFrame/ProjectSettings/InputManager.asset new file mode 100644 index 00000000..17c8f538 --- /dev/null +++ b/JNFrame/ProjectSettings/InputManager.asset @@ -0,0 +1,295 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 diff --git a/JNFrame/ProjectSettings/MemorySettings.asset b/JNFrame/ProjectSettings/MemorySettings.asset new file mode 100644 index 00000000..5b5facec --- /dev/null +++ b/JNFrame/ProjectSettings/MemorySettings.asset @@ -0,0 +1,35 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!387306366 &1 +MemorySettings: + m_ObjectHideFlags: 0 + m_EditorMemorySettings: + m_MainAllocatorBlockSize: -1 + m_ThreadAllocatorBlockSize: -1 + m_MainGfxBlockSize: -1 + m_ThreadGfxBlockSize: -1 + m_CacheBlockSize: -1 + m_TypetreeBlockSize: -1 + m_ProfilerBlockSize: -1 + m_ProfilerEditorBlockSize: -1 + m_BucketAllocatorGranularity: -1 + m_BucketAllocatorBucketsCount: -1 + m_BucketAllocatorBlockSize: -1 + m_BucketAllocatorBlockCount: -1 + m_ProfilerBucketAllocatorGranularity: -1 + m_ProfilerBucketAllocatorBucketsCount: -1 + m_ProfilerBucketAllocatorBlockSize: -1 + m_ProfilerBucketAllocatorBlockCount: -1 + m_TempAllocatorSizeMain: -1 + m_JobTempAllocatorBlockSize: -1 + m_BackgroundJobTempAllocatorBlockSize: -1 + m_JobTempAllocatorReducedBlockSize: -1 + m_TempAllocatorSizeGIBakingWorker: -1 + m_TempAllocatorSizeNavMeshWorker: -1 + m_TempAllocatorSizeAudioWorker: -1 + m_TempAllocatorSizeCloudWorker: -1 + m_TempAllocatorSizeGfx: -1 + m_TempAllocatorSizeJobWorker: -1 + m_TempAllocatorSizeBackgroundWorker: -1 + m_TempAllocatorSizePreloadManager: -1 + m_PlatformMemorySettings: {} diff --git a/JNFrame/ProjectSettings/NavMeshAreas.asset b/JNFrame/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 00000000..3b0b7c3d --- /dev/null +++ b/JNFrame/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,91 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.75 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_SettingNames: + - Humanoid diff --git a/JNFrame/ProjectSettings/PackageManagerSettings.asset b/JNFrame/ProjectSettings/PackageManagerSettings.asset new file mode 100644 index 00000000..d66d3aee --- /dev/null +++ b/JNFrame/ProjectSettings/PackageManagerSettings.asset @@ -0,0 +1,36 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 61 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_EnablePreReleasePackages: 0 + m_EnablePackageDependencies: 0 + m_AdvancedSettingsExpanded: 1 + m_ScopedRegistriesSettingsExpanded: 1 + m_SeeAllPackageVersions: 0 + oneTimeWarningShown: 0 + m_Registries: + - m_Id: main + m_Name: + m_Url: https://packages.unity.cn + m_Scopes: [] + m_IsDefault: 1 + m_Capabilities: 7 + m_ConfigSource: 0 + m_UserSelectedRegistryName: + m_UserAddingNewScopedRegistry: 0 + m_RegistryInfoDraft: + m_Modified: 0 + m_ErrorMessage: + m_UserModificationsInstanceId: -828 + m_OriginalInstanceId: -830 + m_LoadAssets: 0 diff --git a/JNFrame/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json b/JNFrame/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json new file mode 100644 index 00000000..ad11087f --- /dev/null +++ b/JNFrame/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json @@ -0,0 +1,7 @@ +{ + "m_Name": "Settings", + "m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json", + "m_Dictionary": { + "m_DictionaryValues": [] + } +} \ No newline at end of file diff --git a/JNFrame/ProjectSettings/Physics2DSettings.asset b/JNFrame/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 00000000..47880b1c --- /dev/null +++ b/JNFrame/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 4 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_VelocityThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_JobOptions: + serializedVersion: 2 + useMultithreading: 0 + useConsistencySorting: 0 + m_InterpolationPosesPerJob: 100 + m_NewContactsPerJob: 30 + m_CollideContactsPerJob: 100 + m_ClearFlagsPerJob: 200 + m_ClearBodyForcesPerJob: 200 + m_SyncDiscreteFixturesPerJob: 50 + m_SyncContinuousFixturesPerJob: 50 + m_FindNearestContactsPerJob: 100 + m_UpdateTriggerContactsPerJob: 100 + m_IslandSolverCostThreshold: 100 + m_IslandSolverBodyCostScale: 1 + m_IslandSolverContactCostScale: 10 + m_IslandSolverJointCostScale: 10 + m_IslandSolverBodiesPerJob: 50 + m_IslandSolverContactsPerJob: 50 + m_AutoSimulation: 1 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_CallbacksOnDisable: 1 + m_ReuseCollisionCallbacks: 1 + m_AutoSyncTransforms: 0 + m_AlwaysShowColliders: 0 + m_ShowColliderSleep: 1 + m_ShowColliderContacts: 0 + m_ShowColliderAABB: 0 + m_ContactArrowScale: 0.2 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/JNFrame/ProjectSettings/PresetManager.asset b/JNFrame/ProjectSettings/PresetManager.asset new file mode 100644 index 00000000..67a94dae --- /dev/null +++ b/JNFrame/ProjectSettings/PresetManager.asset @@ -0,0 +1,7 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_DefaultPresets: {} diff --git a/JNFrame/ProjectSettings/ProjectSettings.asset b/JNFrame/ProjectSettings/ProjectSettings.asset new file mode 100644 index 00000000..84c6e15c --- /dev/null +++ b/JNFrame/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,736 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 24 + productGUID: 01a6b5b37d55f4e40bf56260ad6847e0 + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: DefaultCompany + productName: JNFrame + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} + defaultScreenWidth: 1920 + defaultScreenHeight: 1080 + defaultScreenWidthWeb: 960 + defaultScreenHeightWeb: 600 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 1 + m_MTRendering: 1 + mipStripping: 0 + numberOfMipsStripped: 0 + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + iosUseCustomAppBackgroundBehavior: 0 + iosAllowHTTPDownload: 1 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 + disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 1 + androidUseSwappy: 1 + androidBlitType: 0 + androidResizableWindow: 0 + androidDefaultWindowWidth: 1920 + androidDefaultWindowHeight: 1080 + androidMinimumWindowWidth: 400 + androidMinimumWindowHeight: 300 + androidFullscreenMode: 1 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 1 + captureSingleScreen: 0 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 + submitAnalytics: 1 + usePlayerLog: 1 + autoStreaming: 0 + useAnimationStreaming: 0 + useFontStreaming: 0 + autoStreamingId: + instantGameAppId: + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + useFlipModelSwapchain: 1 + resizableWindow: 0 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 1 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 1 + allowFullscreenSwitch: 1 + fullscreenMode: 1 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOneEnableTypeOptimization: 0 + xboxOnePresentImmediateThreshold: 0 + switchQueueCommandMemory: 0 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + switchNVNMaxPublicTextureIDCount: 0 + switchNVNMaxPublicSamplerIDCount: 0 + stadiaPresentMode: 0 + stadiaTargetFramerate: 0 + vulkanNumSwapchainBuffers: 3 + vulkanEnableSetSRGBWrite: 0 + vulkanEnablePreTransform: 1 + vulkanEnableLateAcquireNextImage: 0 + vulkanEnableCommandBufferRecycling: 1 + m_SupportedAspectRatios: + 4:3: 1 + 5:4: 1 + 16:10: 1 + 16:9: 1 + Others: 1 + bundleVersion: 0.1 + preloadedAssets: [] + metroInputSource: 0 + wsaTransparentSwapchain: 0 + m_HolographicPauseOnTrackingLoss: 1 + xboxOneDisableKinectGpuReservation: 1 + xboxOneEnable7thCore: 1 + vrSettings: + enable360StereoCapture: 0 + isWsaHolographicRemotingEnabled: 0 + enableFrameTimingStats: 0 + enableOpenGLProfilerGPURecorders: 1 + useHDRDisplay: 0 + D3DHDRBitDepth: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 + resolutionScalingMode: 0 + resetResolutionOnWindowResize: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + applicationIdentifier: {} + buildNumber: + Standalone: 0 + iPhone: 0 + tvOS: 0 + overrideDefaultApplicationIdentifier: 0 + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 22 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + APKExpansionFiles: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 1 + VertexChannelCompressionMask: 4054 + iPhoneSdkVersion: 988 + iOSTargetOSVersionString: 12.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 12.0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] + tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] + tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 100 + iOSLaunchScreenSize: 100 + iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSLaunchScreenCustomStoryboardPath: + iOSLaunchScreeniPadCustomStoryboardPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + macOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 0 + iosCopyPluginsCodeInsteadOfSymlink: 0 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 + appleEnableAutomaticSigning: 0 + iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 + appleEnableProMotion: 0 + shaderPrecisionModel: 0 + clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea + templatePackageId: com.unity.template.3d@8.1.3 + templateDefaultScene: Assets/Scenes/SampleScene.unity + useCustomMainManifest: 0 + useCustomLauncherManifest: 0 + useCustomMainGradleTemplate: 0 + useCustomLauncherGradleManifest: 0 + useCustomBaseGradleTemplate: 0 + useCustomGradlePropertiesTemplate: 0 + useCustomProguardFile: 0 + AndroidTargetArchitectures: 1 + AndroidTargetDevices: 0 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: + AndroidKeyaliasName: + AndroidBuildApkPerCpuArchitecture: 0 + AndroidTVCompatibility: 0 + AndroidIsGame: 1 + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + chromeosInputEmulation: 1 + AndroidMinifyWithR8: 0 + AndroidMinifyRelease: 0 + AndroidMinifyDebug: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 + m_BuildTargetIcons: [] + m_BuildTargetPlatformIcons: [] + m_BuildTargetBatching: + - m_BuildTarget: Standalone + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: tvOS + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: Android + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: iPhone + m_StaticBatching: 1 + m_DynamicBatching: 0 + - m_BuildTarget: WebGL + m_StaticBatching: 0 + m_DynamicBatching: 0 + m_BuildTargetShaderSettings: [] + m_BuildTargetGraphicsJobs: + - m_BuildTarget: MacStandaloneSupport + m_GraphicsJobs: 0 + - m_BuildTarget: Switch + m_GraphicsJobs: 1 + - m_BuildTarget: MetroSupport + m_GraphicsJobs: 1 + - m_BuildTarget: AppleTVSupport + m_GraphicsJobs: 0 + - m_BuildTarget: BJMSupport + m_GraphicsJobs: 1 + - m_BuildTarget: LinuxStandaloneSupport + m_GraphicsJobs: 1 + - m_BuildTarget: PS4Player + m_GraphicsJobs: 1 + - m_BuildTarget: iOSSupport + m_GraphicsJobs: 0 + - m_BuildTarget: WindowsStandaloneSupport + m_GraphicsJobs: 1 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobs: 1 + - m_BuildTarget: LuminSupport + m_GraphicsJobs: 0 + - m_BuildTarget: AndroidPlayer + m_GraphicsJobs: 0 + - m_BuildTarget: WebGLSupport + m_GraphicsJobs: 0 + m_BuildTargetGraphicsJobMode: + - m_BuildTarget: PS4Player + m_GraphicsJobMode: 0 + - m_BuildTarget: XboxOnePlayer + m_GraphicsJobMode: 0 + m_BuildTargetGraphicsAPIs: + - m_BuildTarget: AndroidPlayer + m_APIs: 150000000b000000 + m_Automatic: 1 + - m_BuildTarget: iOSSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: AppleTVSupport + m_APIs: 10000000 + m_Automatic: 1 + - m_BuildTarget: WebGLSupport + m_APIs: 0b000000 + m_Automatic: 1 + m_BuildTargetVRSettings: + - m_BuildTarget: Standalone + m_Enabled: 0 + m_Devices: + - Oculus + - OpenVR + m_DefaultShaderChunkSizeInMB: 16 + m_DefaultShaderChunkCount: 0 + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + openGLRequireES32: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: + - m_BuildTarget: Android + m_EncodingQuality: 1 + - m_BuildTarget: iPhone + m_EncodingQuality: 1 + - m_BuildTarget: tvOS + m_EncodingQuality: 1 + m_BuildTargetGroupLightmapSettings: [] + m_BuildTargetNormalMapEncoding: + - m_BuildTarget: Android + m_Encoding: 1 + - m_BuildTarget: iPhone + m_Encoding: 1 + - m_BuildTarget: tvOS + m_Encoding: 1 + m_BuildTargetDefaultTextureCompressionFormat: + - m_BuildTarget: Android + m_Format: 3 + playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 + actionOnDotNetUnhandledException: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + bluetoothUsageDescription: + switchNMETAOverride: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchUseGOLDLinker: 0 + switchLTOSetting: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: + switchTitleNames_15: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: + switchPublisherNames_15: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} + switchIcons_15: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} + switchSmallIcons_15: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: -1 + switchCardSpecClock: -1 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchRatingsInt_12: 0 + switchLocalCommunicationIds_0: + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 + switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 + switchSupportedNpadStyles: 22 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 0 + switchSupportedNpadCount: 8 + switchEnableTouchScreen: 1 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchPlayerConnectionEnabled: 1 + switchUseNewStyleFilepaths: 0 + switchUseLegacyFmodPriorities: 1 + switchUseMicroSleepForYield: 1 + switchEnableRamDiskSupport: 0 + switchMicroSleepForYieldTime: 25 + switchRamDiskSpaceSize: 12 + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 11 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 60 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4ExtraSceSysFile: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 1 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 + ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + enableApplicationExit: 0 + resetTempFolder: 1 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4UseLowGarlicFragmentationMode: 1 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 0 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4CompatibilityPS5: 0 + ps4AllowPS5Detection: 0 + ps4GPU800MHz: 1 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + ps4attribVROutputEnabled: 0 + monoEnv: + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 + spritePackerPolicy: + webGLMemorySize: 16 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLDataCaching: 1 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLCompressionFormat: 1 + webGLWasmArithmeticExceptions: 0 + webGLLinkerTarget: 1 + webGLThreadsSupport: 0 + webGLDecompressionFallback: 0 + webGLPowerPreference: 2 + scriptingDefineSymbols: {} + additionalCompilerArguments: {} + platformArchitecture: {} + scriptingBackend: {} + il2cppCompilerConfiguration: {} + managedStrippingLevel: + EmbeddedLinux: 1 + GameCoreScarlett: 1 + GameCoreXboxOne: 1 + Lumin: 1 + Nintendo Switch: 1 + PS4: 1 + PS5: 1 + Stadia: 1 + WebGL: 1 + Windows Store Apps: 1 + XboxOne: 1 + iPhone: 1 + tvOS: 1 + incrementalIl2cppBuild: {} + suppressCommonWarnings: 1 + allowUnsafeCode: 0 + useDeterministicCompilation: 1 + enableRoslynAnalyzers: 1 + selectedPlatform: 0 + additionalIl2CppArgs: + scriptingRuntimeVersion: 1 + gcIncremental: 1 + assemblyVersionValidation: 1 + gcWBarrierValidation: 0 + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: Template_3D + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: Template_3D + wsaImages: {} + metroTileShortName: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 2 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1} + metroSplashScreenUseBackgroundColor: 0 + platformCapabilities: {} + metroTargetDeviceFamilies: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + vcxProjDefaultLanguage: + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnhancedXboxCompatibilityMode: 0 + XboxOneEnableGPUVariability: 1 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 + XboxOneOverrideIdentityName: + XboxOneOverrideIdentityPublisher: + vrEditorSettings: {} + cloudServicesEnabled: + UNet: 1 + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_SignPackage: 1 + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: + apiCompatibilityLevel: 6 + activeInputHandler: 0 + windowsGamepadBackendHint: 0 + cloudProjectId: + framebufferDepthMemorylessMode: 0 + qualitySettingsNames: [] + projectName: + organizationId: + cloudEnabled: 0 + legacyClampBlendShapeWeights: 0 + playerDataPath: + forceSRGBBlit: 1 + virtualTexturingSupportEnabled: 0 diff --git a/JNFrame/ProjectSettings/ProjectVersion.txt b/JNFrame/ProjectSettings/ProjectVersion.txt new file mode 100644 index 00000000..c3f8ae0a --- /dev/null +++ b/JNFrame/ProjectSettings/ProjectVersion.txt @@ -0,0 +1,2 @@ +m_EditorVersion: 2021.3.27f1c2 +m_EditorVersionWithRevision: 2021.3.27f1c2 (3b3d9646cb47) diff --git a/JNFrame/ProjectSettings/QualitySettings.asset b/JNFrame/ProjectSettings/QualitySettings.asset new file mode 100644 index 00000000..36c0dad5 --- /dev/null +++ b/JNFrame/ProjectSettings/QualitySettings.asset @@ -0,0 +1,234 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 5 + m_QualitySettings: + - serializedVersion: 2 + name: Very Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 15 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 1 + textureQuality: 1 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.3 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.4 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 16 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Medium + pixelLightCount: 1 + shadows: 1 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 1 + lodBias: 0.7 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 64 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: High + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 256 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Very High + pixelLightCount: 3 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 70 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1.5 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 1024 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Ultra + pixelLightCount: 4 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 4 + shadowDistance: 150 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 2 + maximumLODLevel: 0 + streamingMipmapsActive: 0 + streamingMipmapsAddAllCameras: 1 + streamingMipmapsMemoryBudget: 512 + streamingMipmapsRenderersPerFrame: 512 + streamingMipmapsMaxLevelReduction: 2 + streamingMipmapsMaxFileIORequests: 1024 + particleRaycastBudget: 4096 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 16 + asyncUploadPersistentBuffer: 1 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + m_PerPlatformDefaultQuality: + Android: 2 + Lumin: 5 + GameCoreScarlett: 5 + GameCoreXboxOne: 5 + Nintendo 3DS: 5 + Nintendo Switch: 5 + PS4: 5 + PS5: 5 + Stadia: 5 + Standalone: 5 + WebGL: 3 + Windows Store Apps: 5 + XboxOne: 5 + iPhone: 2 + tvOS: 2 diff --git a/JNFrame/ProjectSettings/SceneTemplateSettings.json b/JNFrame/ProjectSettings/SceneTemplateSettings.json new file mode 100644 index 00000000..6f3e60fd --- /dev/null +++ b/JNFrame/ProjectSettings/SceneTemplateSettings.json @@ -0,0 +1,167 @@ +{ + "templatePinStates": [], + "dependencyTypeInfos": [ + { + "userAdded": false, + "type": "UnityEngine.AnimationClip", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.Animations.AnimatorController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.AnimatorOverrideController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.Audio.AudioMixerController", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.ComputeShader", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Cubemap", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.GameObject", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.LightingDataAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": false + }, + { + "userAdded": false, + "type": "UnityEngine.LightingSettings", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Material", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.MonoScript", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicMaterial", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.PhysicsMaterial2D", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Rendering.VolumeProfile", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEditor.SceneAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": false + }, + { + "userAdded": false, + "type": "UnityEngine.Shader", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.ShaderVariantCollection", + "ignore": true, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Texture", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Texture2D", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + }, + { + "userAdded": false, + "type": "UnityEngine.Timeline.TimelineAsset", + "ignore": false, + "defaultInstantiationMode": 0, + "supportsModification": true + } + ], + "defaultDependencyTypeInfo": { + "userAdded": false, + "type": "", + "ignore": false, + "defaultInstantiationMode": 1, + "supportsModification": true + }, + "newSceneOverride": 0 +} \ No newline at end of file diff --git a/JNFrame/ProjectSettings/TagManager.asset b/JNFrame/ProjectSettings/TagManager.asset new file mode 100644 index 00000000..1c92a784 --- /dev/null +++ b/JNFrame/ProjectSettings/TagManager.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 2 + tags: [] + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 diff --git a/JNFrame/ProjectSettings/TimeManager.asset b/JNFrame/ProjectSettings/TimeManager.asset new file mode 100644 index 00000000..558a017e --- /dev/null +++ b/JNFrame/ProjectSettings/TimeManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + Fixed Timestep: 0.02 + Maximum Allowed Timestep: 0.33333334 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/JNFrame/ProjectSettings/UnityConnectSettings.asset b/JNFrame/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 00000000..4c136ae9 --- /dev/null +++ b/JNFrame/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,38 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 1 + m_Enabled: 0 + m_TestMode: 0 + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events + m_ConfigUrl: https://config.uca.cloud.unity3d.com + m_DashboardUrl: https://dashboard.unity3d.com + m_CNEventUrl: https://cdp.cloud.unity.cn/v1/events + m_CNConfigUrl: https://cdp.cloud.unity.cn/config + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity.cn + m_Enabled: 0 + m_LogBufferSize: 10 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 1 + m_TestMode: 0 + m_InitializeOnStartup: 1 + m_PackageRequiringCoreStatsPresent: 0 + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/JNFrame/ProjectSettings/VFXManager.asset b/JNFrame/ProjectSettings/VFXManager.asset new file mode 100644 index 00000000..3a95c98b --- /dev/null +++ b/JNFrame/ProjectSettings/VFXManager.asset @@ -0,0 +1,12 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_StripUpdateShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 diff --git a/JNFrame/ProjectSettings/VersionControlSettings.asset b/JNFrame/ProjectSettings/VersionControlSettings.asset new file mode 100644 index 00000000..dca28814 --- /dev/null +++ b/JNFrame/ProjectSettings/VersionControlSettings.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!890905787 &1 +VersionControlSettings: + m_ObjectHideFlags: 0 + m_Mode: Visible Meta Files + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/JNFrame/ProjectSettings/XRSettings.asset b/JNFrame/ProjectSettings/XRSettings.asset new file mode 100644 index 00000000..482590c1 --- /dev/null +++ b/JNFrame/ProjectSettings/XRSettings.asset @@ -0,0 +1,10 @@ +{ + "m_SettingKeys": [ + "VR Device Disabled", + "VR Device User Alert" + ], + "m_SettingValues": [ + "False", + "False" + ] +} \ No newline at end of file diff --git a/JNFrame/ProjectSettings/boot.config b/JNFrame/ProjectSettings/boot.config new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/UniTask.Addressables.csproj b/JNFrame/UniTask.Addressables.csproj new file mode 100644 index 00000000..189b0005 --- /dev/null +++ b/JNFrame/UniTask.Addressables.csproj @@ -0,0 +1,725 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {6d8bd378-3e5b-6997-5e5e-288243f0f72b} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + UniTask.Addressables + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\UniTask.Addressables\ + UNITY_2021_3_27;UNITY_2021_3;UNITY_2021;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;UNITY_UGP_API;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_IG;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsNativeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIWidgetsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UNETModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.PackageManagerUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIServiceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEditor.Graphs.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\Google.Protobuf.3.15.8\lib\netstandard2.0\Google.Protobuf.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Newtonsoft.Json.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\EditorAssetResources\Unity.VisualScripting.TextureAssets.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\unityplastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\log4netPlastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\myproject\unity\JNFrame\Assets\NuGet\Editor\NugetForUnity.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\ref\2.1.0\netstandard.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\Microsoft.Win32.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.AppContext.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Buffers.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Concurrent.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.NonGeneric.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Specialized.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Console.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Data.Common.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Contracts.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Debug.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Process.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.StackTrace.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tools.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TraceSource.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tracing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Drawing.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Dynamic.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Calendars.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.ZipFile.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.IsolatedStorage.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Pipes.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Expressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Queryable.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Memory.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Http.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NameResolution.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NetworkInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Ping.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Requests.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Security.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Sockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebHeaderCollection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.Client.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Numerics.Vectors.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ObjectModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.DispatchProxy.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Reader.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.ResourceManager.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Writer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Handles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Json.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Claims.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Csp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Principal.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.SecureString.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.RegularExpressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Overlapped.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Thread.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.ThreadPool.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Timer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ValueTuple.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.ReaderWriter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlSerializer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\Extensions\2.0.0\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\mscorlib.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ComponentModel.Composition.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Core.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Data.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Drawing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.IO.Compression.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Net.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Runtime.Serialization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ServiceModel.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Transactions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Windows.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Serialization.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEngine.UI.dll + + + + + {39f5acb9-cdbb-9f48-497c-14159a0afd38} + UniTask + + + + + diff --git a/JNFrame/UniTask.DOTween.csproj b/JNFrame/UniTask.DOTween.csproj new file mode 100644 index 00000000..757fc9e9 --- /dev/null +++ b/JNFrame/UniTask.DOTween.csproj @@ -0,0 +1,725 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {99c4c7d2-ca96-1038-95e0-77e225df2b06} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + UniTask.DOTween + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\UniTask.DOTween\ + UNITY_2021_3_27;UNITY_2021_3;UNITY_2021;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;UNITY_UGP_API;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_IG;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsNativeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIWidgetsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UNETModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.PackageManagerUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIServiceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEditor.Graphs.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\Google.Protobuf.3.15.8\lib\netstandard2.0\Google.Protobuf.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Newtonsoft.Json.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\EditorAssetResources\Unity.VisualScripting.TextureAssets.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\unityplastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\log4netPlastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\myproject\unity\JNFrame\Assets\NuGet\Editor\NugetForUnity.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\ref\2.1.0\netstandard.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\Microsoft.Win32.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.AppContext.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Buffers.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Concurrent.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.NonGeneric.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Specialized.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Console.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Data.Common.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Contracts.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Debug.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Process.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.StackTrace.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tools.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TraceSource.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tracing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Drawing.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Dynamic.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Calendars.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.ZipFile.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.IsolatedStorage.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Pipes.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Expressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Queryable.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Memory.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Http.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NameResolution.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NetworkInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Ping.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Requests.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Security.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Sockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebHeaderCollection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.Client.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Numerics.Vectors.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ObjectModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.DispatchProxy.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Reader.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.ResourceManager.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Writer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Handles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Json.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Claims.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Csp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Principal.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.SecureString.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.RegularExpressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Overlapped.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Thread.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.ThreadPool.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Timer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ValueTuple.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.ReaderWriter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlSerializer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\Extensions\2.0.0\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\mscorlib.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ComponentModel.Composition.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Core.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Data.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Drawing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.IO.Compression.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Net.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Runtime.Serialization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ServiceModel.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Transactions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Windows.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Serialization.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEngine.UI.dll + + + + + {39f5acb9-cdbb-9f48-497c-14159a0afd38} + UniTask + + + + + diff --git a/JNFrame/UniTask.Editor.csproj b/JNFrame/UniTask.Editor.csproj new file mode 100644 index 00000000..f3f51daf --- /dev/null +++ b/JNFrame/UniTask.Editor.csproj @@ -0,0 +1,751 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {295d565d-1437-bd18-5c54-a9d5211832bd} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + UniTask.Editor + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\UniTask.Editor\ + UNITY_2021_3_27;UNITY_2021_3;UNITY_2021;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;UNITY_UGP_API;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;NET_UNITY_4_8;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_IG;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AutoStreamingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.NVIDIAModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsNativeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIWidgetsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UNETModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.PackageManagerUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIServiceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEditor.Graphs.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\Google.Protobuf.3.15.8\lib\netstandard2.0\Google.Protobuf.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Newtonsoft.Json.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\EditorAssetResources\Unity.VisualScripting.TextureAssets.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\unityplastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\log4netPlastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\myproject\unity\JNFrame\Assets\NuGet\Editor\NugetForUnity.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.ext.nunit@1.0.6\net35\unity-custom\nunit.framework.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\mscorlib.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Core.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Runtime.Serialization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Xml.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Numerics.Vectors.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Net.Http.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.IO.Compression.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Microsoft.CSharp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Data.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Data.DataSetExtensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Drawing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.IO.Compression.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.ComponentModel.Composition.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\System.Transactions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\Microsoft.Win32.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\netstandard.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.AppContext.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Buffers.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.Concurrent.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.NonGeneric.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Collections.Specialized.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.Annotations.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Console.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Data.Common.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Contracts.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Debug.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Process.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.StackTrace.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.Tools.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Diagnostics.TraceSource.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Drawing.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Dynamic.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Globalization.Calendars.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Globalization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Globalization.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.Compression.ZipFile.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.IsolatedStorage.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.Pipes.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.Expressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Linq.Queryable.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Memory.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Http.Rtc.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.NameResolution.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.NetworkInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Ping.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Requests.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Security.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.Sockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.WebHeaderCollection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.WebSockets.Client.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Net.WebSockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ObjectModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.DispatchProxy.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Emit.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Reflection.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Resources.Reader.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Resources.ResourceManager.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Resources.Writer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Handles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.InteropServices.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Json.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Claims.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Csp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.Principal.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Security.SecureString.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Duplex.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Http.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.NetTcp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ServiceModel.Security.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Text.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Text.Encoding.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Text.RegularExpressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Overlapped.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Tasks.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Thread.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.ThreadPool.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Threading.Timer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.ValueTuple.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.ReaderWriter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XmlDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XmlSerializer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XPath.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\UnityReferenceAssemblies\unity-4.8-api\Facades\System.Xml.XPath.XDocument.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEngine.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEngine.TestRunner.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEditor.TestRunner.dll + + + + + {39f5acb9-cdbb-9f48-497c-14159a0afd38} + UniTask + + + + + diff --git a/JNFrame/UniTask.Linq.csproj b/JNFrame/UniTask.Linq.csproj new file mode 100644 index 00000000..d11ee552 --- /dev/null +++ b/JNFrame/UniTask.Linq.csproj @@ -0,0 +1,798 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {7f60f694-1f75-f2f0-5fde-36ccb7fd82d1} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + UniTask.Linq + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\UniTask.Linq\ + UNITY_2021_3_27;UNITY_2021_3;UNITY_2021;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;UNITY_UGP_API;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_IG;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsNativeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIWidgetsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UNETModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.PackageManagerUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIServiceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEditor.Graphs.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\Google.Protobuf.3.15.8\lib\netstandard2.0\Google.Protobuf.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Newtonsoft.Json.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\EditorAssetResources\Unity.VisualScripting.TextureAssets.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\unityplastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\log4netPlastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\myproject\unity\JNFrame\Assets\NuGet\Editor\NugetForUnity.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\ref\2.1.0\netstandard.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\Microsoft.Win32.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.AppContext.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Buffers.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Concurrent.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.NonGeneric.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Specialized.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Console.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Data.Common.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Contracts.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Debug.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Process.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.StackTrace.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tools.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TraceSource.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tracing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Drawing.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Dynamic.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Calendars.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.ZipFile.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.IsolatedStorage.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Pipes.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Expressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Queryable.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Memory.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Http.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NameResolution.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NetworkInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Ping.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Requests.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Security.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Sockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebHeaderCollection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.Client.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Numerics.Vectors.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ObjectModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.DispatchProxy.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Reader.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.ResourceManager.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Writer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Handles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Json.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Claims.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Csp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Principal.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.SecureString.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.RegularExpressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Overlapped.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Thread.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.ThreadPool.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Timer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ValueTuple.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.ReaderWriter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlSerializer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\Extensions\2.0.0\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\mscorlib.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ComponentModel.Composition.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Core.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Data.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Drawing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.IO.Compression.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Net.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Runtime.Serialization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ServiceModel.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Transactions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Windows.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Serialization.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEngine.UI.dll + + + + + {39f5acb9-cdbb-9f48-497c-14159a0afd38} + UniTask + + + + + diff --git a/JNFrame/UniTask.TextMeshPro.csproj b/JNFrame/UniTask.TextMeshPro.csproj new file mode 100644 index 00000000..2d7b3b53 --- /dev/null +++ b/JNFrame/UniTask.TextMeshPro.csproj @@ -0,0 +1,729 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {4b964c85-7c9d-2d07-a2e0-8595262e4e96} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + UniTask.TextMeshPro + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\UniTask.TextMeshPro\ + UNITY_2021_3_27;UNITY_2021_3;UNITY_2021;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;UNITY_UGP_API;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_IG;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;UNITASK_TEXTMESHPRO_SUPPORT;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsNativeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIWidgetsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UNETModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.PackageManagerUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIServiceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEditor.Graphs.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\Google.Protobuf.3.15.8\lib\netstandard2.0\Google.Protobuf.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Newtonsoft.Json.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\EditorAssetResources\Unity.VisualScripting.TextureAssets.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\unityplastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\log4netPlastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\myproject\unity\JNFrame\Assets\NuGet\Editor\NugetForUnity.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\ref\2.1.0\netstandard.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\Microsoft.Win32.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.AppContext.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Buffers.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Concurrent.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.NonGeneric.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Specialized.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Console.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Data.Common.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Contracts.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Debug.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Process.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.StackTrace.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tools.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TraceSource.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tracing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Drawing.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Dynamic.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Calendars.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.ZipFile.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.IsolatedStorage.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Pipes.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Expressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Queryable.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Memory.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Http.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NameResolution.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NetworkInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Ping.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Requests.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Security.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Sockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebHeaderCollection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.Client.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Numerics.Vectors.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ObjectModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.DispatchProxy.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Reader.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.ResourceManager.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Writer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Handles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Json.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Claims.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Csp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Principal.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.SecureString.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.RegularExpressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Overlapped.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Thread.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.ThreadPool.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Timer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ValueTuple.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.ReaderWriter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlSerializer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\Extensions\2.0.0\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\mscorlib.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ComponentModel.Composition.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Core.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Data.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Drawing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.IO.Compression.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Net.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Runtime.Serialization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ServiceModel.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Transactions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Windows.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Serialization.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\Unity.TextMeshPro.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEngine.UI.dll + + + + + {39f5acb9-cdbb-9f48-497c-14159a0afd38} + UniTask + + + + + diff --git a/JNFrame/UniTask.csproj b/JNFrame/UniTask.csproj new file mode 100644 index 00000000..8741a8a2 --- /dev/null +++ b/JNFrame/UniTask.csproj @@ -0,0 +1,797 @@ + + + + 9.0 + <_TargetFrameworkDirectories>non_empty_path_generated_by_unity.rider.package + <_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_unity.rider.package + true + + + Debug + AnyCPU + 10.0.20506 + 2.0 + + {39f5acb9-cdbb-9f48-497c-14159a0afd38} + {E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + UniTask + v4.7.1 + 512 + . + + + true + full + false + Temp\Bin\Debug\UniTask\ + UNITY_2021_3_27;UNITY_2021_3;UNITY_2021;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2019_1_OR_NEWER;UNITY_2019_2_OR_NEWER;UNITY_2019_3_OR_NEWER;UNITY_2019_4_OR_NEWER;UNITY_2020_1_OR_NEWER;UNITY_2020_2_OR_NEWER;UNITY_2020_3_OR_NEWER;UNITY_2021_1_OR_NEWER;UNITY_2021_2_OR_NEWER;UNITY_2021_3_OR_NEWER;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AR;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_EVENT_QUEUE;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_TEXTURE_STREAMING;ENABLE_VIRTUALTEXTURING;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_UNITYWEBREQUEST;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;ENABLE_MANAGED_AUDIO_JOBS;ENABLE_MANAGED_UNITYTLS;INCLUDE_DYNAMIC_GI;ENABLE_SCRIPTING_GC_WBARRIERS;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_VIDEO;ENABLE_ACCELERATOR_CLIENT_DEBUGGING;PLATFORM_STANDALONE;TEXTCORE_1_0_OR_NEWER;PLATFORM_STANDALONE_WIN;UNITY_STANDALONE_WIN;UNITY_STANDALONE;UNITY_UGP_API;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_NVIDIA;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITY_GAME_SERVICES_ANALYTICS_SUPPORT;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;PLATFORM_UPDATES_TIME_OUTSIDE_OF_PLAYER_LOOP;GFXDEVICE_WAITFOREVENT_MESSAGEPUMP;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_STANDARD_2_0;NET_STANDARD;NET_STANDARD_2_1;NETSTANDARD;NETSTANDARD2_1;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_IG;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_DIRECTOR;ENABLE_LOCALIZATION;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_TILEMAP;ENABLE_TIMELINE;ENABLE_LEGACY_INPUT_MANAGER;TEXTCORE_FONT_ENGINE_1_5_OR_NEWER;UNITASK_ASSETBUNDLE_SUPPORT;UNITASK_PHYSICS_SUPPORT;UNITASK_PHYSICS2D_SUPPORT;UNITASK_PARTICLESYSTEM_SUPPORT;UNITASK_UGUI_SUPPORT;UNITASK_WEBREQUEST_SUPPORT;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER + prompt + 4 + 0169,0649 + False + False + + + true + true + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ARModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AccessibilityModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AndroidJNIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AnimationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.AudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClothModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterInputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ClusterRendererModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.CrashReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DSPGraphModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.DirectorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GameCenterModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.GridModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.HotReloadModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.IMGUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ImageConversionModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.InputLegacyModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.JSONSerializeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.LocalizationModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ParticleSystemModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PerformanceReportingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.PhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.Physics2DModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ProfilerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.ScreenCaptureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SharedInternalsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteMaskModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SpriteShapeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.StreamingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubstanceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.SubsystemsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TLSModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TerrainPhysicsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TextRenderingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.TilemapModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIElementsNativeModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UIWidgetsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UNETModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UmbraModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityAnalyticsCommonModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityCurlModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityTestProtocolModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestAudioModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestTextureModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.UnityWebRequestWWWModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VFXModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VehiclesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VideoModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.VirtualTexturingModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.WindModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEngine.XRModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.CoreModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DeviceSimulatorModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.DiagnosticsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.GraphViewModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.PackageManagerUIModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.QuickSearchModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.SceneTemplateModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreFontEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.TextCoreTextEngineModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIBuilderModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIElementsSamplesModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UIServiceModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEngine\UnityEditor.UnityConnectModule.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\Managed\UnityEditor.Graphs.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\PlaybackEngines\WindowsStandaloneSupport\UnityEditor.WindowsStandalone.Extensions.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\Google.Protobuf.3.15.8\lib\netstandard2.0\Google.Protobuf.dll + + + D:\myproject\unity\JNFrame\Assets\Packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Newtonsoft.Json.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\Unity.Plastic.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\YamlDotNet\Unity.VisualScripting.YamlDotNet.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\EditorAssetResources\Unity.VisualScripting.TextureAssets.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Editor\VisualScripting.Core\Dependencies\DotNetZip\Unity.VisualScripting.IonicZip.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\unityplastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.collab-proxy@2.0.4\Lib\Editor\PlasticSCM\log4netPlastic.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.visualscripting@1.8.0\Runtime\VisualScripting.Flow\Dependencies\NCalc\Unity.VisualScripting.Antlr3.Runtime.dll + + + D:\myproject\unity\JNFrame\Library\PackageCache\com.unity.testtools.codecoverage@1.2.3\lib\ReportGenerator\ReportGeneratorMerged.dll + + + D:\myproject\unity\JNFrame\Assets\NuGet\Editor\NugetForUnity.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\ref\2.1.0\netstandard.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\Microsoft.Win32.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.AppContext.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Buffers.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Concurrent.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.NonGeneric.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Collections.Specialized.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.EventBasedAsync.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ComponentModel.TypeConverter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Console.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Data.Common.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Contracts.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Debug.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.FileVersionInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Process.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.StackTrace.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TextWriterTraceListener.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tools.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.TraceSource.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Diagnostics.Tracing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Drawing.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Dynamic.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Calendars.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Globalization.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Compression.ZipFile.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.DriveInfo.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.FileSystem.Watcher.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.IsolatedStorage.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.MemoryMappedFiles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.Pipes.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.IO.UnmanagedMemoryStream.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Expressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Linq.Queryable.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Memory.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Http.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NameResolution.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.NetworkInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Ping.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Requests.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Security.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.Sockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebHeaderCollection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.Client.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Net.WebSockets.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Numerics.Vectors.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ObjectModel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.DispatchProxy.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.ILGeneration.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Emit.Lightweight.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Reflection.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Reader.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.ResourceManager.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Resources.Writer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.CompilerServices.VisualC.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Handles.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.InteropServices.RuntimeInformation.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Formatters.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Json.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Runtime.Serialization.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Claims.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Algorithms.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Csp.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.Primitives.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Cryptography.X509Certificates.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.Principal.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Security.SecureString.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.Encoding.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Text.RegularExpressions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Overlapped.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Extensions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Tasks.Parallel.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Thread.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.ThreadPool.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Threading.Timer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.ValueTuple.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.ReaderWriter.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XmlSerializer.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netstandard\System.Xml.XPath.XDocument.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\Extensions\2.0.0\System.Runtime.InteropServices.WindowsRuntime.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\mscorlib.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ComponentModel.Composition.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Core.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Data.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Drawing.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.IO.Compression.FileSystem.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Net.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Numerics.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Runtime.Serialization.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.ServiceModel.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Transactions.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Web.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Windows.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Linq.dll + + + D:\Unity\2021.3.27f1c2\Editor\Data\NetStandard\compat\2.1.0\shims\netfx\System.Xml.Serialization.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEditor.UI.dll + + + D:\myproject\unity\JNFrame\Library\ScriptAssemblies\UnityEngine.UI.dll + + + + + + + diff --git a/JNFrame/UserSettings/EditorUserSettings.asset b/JNFrame/UserSettings/EditorUserSettings.asset new file mode 100644 index 00000000..f59cde3b --- /dev/null +++ b/JNFrame/UserSettings/EditorUserSettings.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!162 &1 +EditorUserSettings: + m_ObjectHideFlags: 0 + serializedVersion: 4 + m_ConfigSettings: + RecentlyUsedSceneGuid-0: + value: 5a03005f0301085d0f5d082043200b444e4e1c7b2d7a7f352c714532b0e6653b + flags: 0 + RecentlyUsedSceneGuid-1: + value: 5409020704005a585b5a5b7545710a44434e1b782a707168297a1e67b1e1656b + flags: 0 + RecentlyUsedSceneGuid-2: + value: 5a5757560101590a5d0c0e24427b5d44434e4c7a7b7a23677f2b4565b7b5353a + flags: 0 + vcSharedLogLevel: + value: 0d5e400f0650 + flags: 0 + m_VCAutomaticAdd: 1 + m_VCDebugCom: 0 + m_VCDebugCmd: 0 + m_VCDebugOut: 0 + m_SemanticMergeMode: 2 + m_DesiredImportWorkerCount: 3 + m_StandbyImportWorkerCount: 2 + m_IdleImportWorkerShutdownDelay: 60000 + m_VCShowFailedCheckout: 1 + m_VCOverwriteFailedCheckoutAssets: 1 + m_VCProjectOverlayIcons: 1 + m_VCHierarchyOverlayIcons: 1 + m_VCOtherOverlayIcons: 1 + m_VCAllowAsyncUpdate: 1 + m_ArtifactGarbageCollection: 1 diff --git a/JNFrame/UserSettings/Layouts/default-2021.dwlt b/JNFrame/UserSettings/Layouts/default-2021.dwlt new file mode 100644 index 00000000..4c3e2748 --- /dev/null +++ b/JNFrame/UserSettings/Layouts/default-2021.dwlt @@ -0,0 +1,1005 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &1 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12004, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_PixelRect: + serializedVersion: 2 + x: 0 + y: 43 + width: 1920 + height: 989 + m_ShowMode: 4 + m_Title: "\u63A7\u5236\u53F0" + m_RootView: {fileID: 7} + m_MinSize: {x: 875, y: 371} + m_MaxSize: {x: 10000, y: 10000} + m_Maximized: 1 +--- !u!114 &2 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} + m_Name: GameView + m_EditorClassIdentifier: + m_Children: [] + m_Position: + serializedVersion: 2 + x: 1069 + y: 0 + width: 397 + height: 556 + m_MinSize: {x: 202, y: 221} + m_MaxSize: {x: 4002, y: 4021} + m_ActualView: {fileID: 17} + m_Panes: + - {fileID: 17} + m_Selected: 0 + m_LastSelected: 0 +--- !u!114 &3 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_Children: + - {fileID: 10} + - {fileID: 4} + m_Position: + serializedVersion: 2 + x: 0 + y: 30 + width: 1920 + height: 939 + m_MinSize: {x: 400, y: 200} + m_MaxSize: {x: 32384, y: 16192} + vertical: 0 + controlID: 73 +--- !u!114 &4 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_Children: [] + m_Position: + serializedVersion: 2 + x: 1466 + y: 0 + width: 454 + height: 939 + m_MinSize: {x: 276, y: 71} + m_MaxSize: {x: 4001, y: 4021} + m_ActualView: {fileID: 14} + m_Panes: + - {fileID: 14} + m_Selected: 0 + m_LastSelected: 0 +--- !u!114 &5 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_Children: [] + m_Position: + serializedVersion: 2 + x: 0 + y: 0 + width: 281 + height: 556 + m_MinSize: {x: 201, y: 221} + m_MaxSize: {x: 4001, y: 4021} + m_ActualView: {fileID: 15} + m_Panes: + - {fileID: 15} + m_Selected: 0 + m_LastSelected: 0 +--- !u!114 &6 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} + m_Name: ConsoleWindow + m_EditorClassIdentifier: + m_Children: [] + m_Position: + serializedVersion: 2 + x: 0 + y: 556 + width: 1466 + height: 383 + m_MinSize: {x: 101, y: 121} + m_MaxSize: {x: 4001, y: 4021} + m_ActualView: {fileID: 18} + m_Panes: + - {fileID: 13} + - {fileID: 18} + m_Selected: 1 + m_LastSelected: 0 +--- !u!114 &7 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12008, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_Children: + - {fileID: 8} + - {fileID: 3} + - {fileID: 9} + m_Position: + serializedVersion: 2 + x: 0 + y: 0 + width: 1920 + height: 989 + m_MinSize: {x: 875, y: 300} + m_MaxSize: {x: 10000, y: 10000} + m_UseTopView: 1 + m_TopViewHeight: 30 + m_UseBottomView: 1 + m_BottomViewHeight: 20 +--- !u!114 &8 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12011, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_Children: [] + m_Position: + serializedVersion: 2 + x: 0 + y: 0 + width: 1920 + height: 30 + m_MinSize: {x: 0, y: 0} + m_MaxSize: {x: 0, y: 0} + m_LastLoadedLayoutName: +--- !u!114 &9 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12042, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_Children: [] + m_Position: + serializedVersion: 2 + x: 0 + y: 969 + width: 1920 + height: 20 + m_MinSize: {x: 0, y: 0} + m_MaxSize: {x: 0, y: 0} +--- !u!114 &10 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_Children: + - {fileID: 11} + - {fileID: 6} + m_Position: + serializedVersion: 2 + x: 0 + y: 0 + width: 1466 + height: 939 + m_MinSize: {x: 300, y: 200} + m_MaxSize: {x: 24288, y: 16192} + vertical: 1 + controlID: 74 +--- !u!114 &11 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12010, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_Children: + - {fileID: 5} + - {fileID: 12} + - {fileID: 2} + m_Position: + serializedVersion: 2 + x: 0 + y: 0 + width: 1466 + height: 556 + m_MinSize: {x: 300, y: 100} + m_MaxSize: {x: 24288, y: 8096} + vertical: 0 + controlID: 18 +--- !u!114 &12 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} + m_Name: SceneView + m_EditorClassIdentifier: + m_Children: [] + m_Position: + serializedVersion: 2 + x: 281 + y: 0 + width: 788 + height: 556 + m_MinSize: {x: 202, y: 221} + m_MaxSize: {x: 4002, y: 4021} + m_ActualView: {fileID: 16} + m_Panes: + - {fileID: 16} + m_Selected: 0 + m_LastSelected: 0 +--- !u!114 &13 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12014, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 230, y: 250} + m_MaxSize: {x: 10000, y: 10000} + m_TitleContent: + m_Text: "\u9879\u76EE" + m_Image: {fileID: -5467254957812901981, guid: 0000000000000000d000000000000000, type: 0} + m_Tooltip: + m_Pos: + serializedVersion: 2 + x: 0 + y: 629 + width: 1465 + height: 362 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: [] + m_OverlaysVisible: 1 + m_SearchFilter: + m_NameFilter: + m_ClassNames: [] + m_AssetLabels: [] + m_AssetBundleNames: [] + m_ReferencingInstanceIDs: + m_SceneHandles: + m_ShowAllHits: 0 + m_SkipHidden: 0 + m_SearchArea: 1 + m_Folders: + - Assets/Scenes + m_Globs: [] + m_OriginalText: + m_FilterByTypeIntersection: 0 + m_ViewMode: 1 + m_StartGridSize: 64 + m_LastFolders: + - Assets/Scenes + m_LastFoldersGridSize: -1 + m_LastProjectPath: D:\myproject\unity\JNFrame + m_LockTracker: + m_IsLocked: 0 + m_FolderTreeState: + scrollPos: {x: 0, y: 5} + m_SelectedIDs: de650000 + m_LastClickedID: 26078 + m_ExpandedIDs: 00000000c2650000c4650000c6650000c865000000ca9a3bffffff7f + m_RenameOverlay: + m_UserAcceptedRename: 0 + m_Name: + m_OriginalName: + m_EditFieldRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + m_UserData: 0 + m_IsWaitingForDelay: 0 + m_IsRenaming: 0 + m_OriginalEventType: 11 + m_IsRenamingFilename: 1 + m_ClientGUIView: {fileID: 0} + m_SearchString: + m_CreateAssetUtility: + m_EndAction: {fileID: 0} + m_InstanceID: 0 + m_Path: + m_Icon: {fileID: 0} + m_ResourceFile: + m_AssetTreeState: + scrollPos: {x: 0, y: 0} + m_SelectedIDs: + m_LastClickedID: 0 + m_ExpandedIDs: 00000000c2650000c4650000c6650000c8650000 + m_RenameOverlay: + m_UserAcceptedRename: 0 + m_Name: + m_OriginalName: + m_EditFieldRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + m_UserData: 0 + m_IsWaitingForDelay: 0 + m_IsRenaming: 0 + m_OriginalEventType: 11 + m_IsRenamingFilename: 1 + m_ClientGUIView: {fileID: 0} + m_SearchString: + m_CreateAssetUtility: + m_EndAction: {fileID: 0} + m_InstanceID: 0 + m_Path: + m_Icon: {fileID: 0} + m_ResourceFile: + m_ListAreaState: + m_SelectedInstanceIDs: + m_LastClickedInstanceID: 0 + m_HadKeyboardFocusLastEvent: 1 + m_ExpandedInstanceIDs: c6230000 + m_RenameOverlay: + m_UserAcceptedRename: 0 + m_Name: + m_OriginalName: + m_EditFieldRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + m_UserData: 0 + m_IsWaitingForDelay: 0 + m_IsRenaming: 0 + m_OriginalEventType: 11 + m_IsRenamingFilename: 1 + m_ClientGUIView: {fileID: 6} + m_CreateAssetUtility: + m_EndAction: {fileID: 0} + m_InstanceID: 0 + m_Path: + m_Icon: {fileID: 0} + m_ResourceFile: + m_NewAssetIndexInList: -1 + m_ScrollPosition: {x: 0, y: 0} + m_GridSize: 64 + m_SkipHiddenPackages: 0 + m_DirectoriesAreaWidth: 207 +--- !u!114 &14 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12019, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 275, y: 50} + m_MaxSize: {x: 4000, y: 4000} + m_TitleContent: + m_Text: "\u68C0\u67E5\u5668" + m_Image: {fileID: -2667387946076563598, guid: 0000000000000000d000000000000000, type: 0} + m_Tooltip: + m_Pos: + serializedVersion: 2 + x: 1466 + y: 73 + width: 453 + height: 918 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: [] + m_OverlaysVisible: 1 + m_ObjectsLockedBeforeSerialization: [] + m_InstanceIDsLockedBeforeSerialization: + m_PreviewResizer: + m_CachedPref: 160 + m_ControlHash: -371814159 + m_PrefName: Preview_InspectorPreview + m_LastInspectedObjectInstanceID: -1 + m_LastVerticalScrollValue: 0 + m_GlobalObjectId: + m_InspectorMode: 0 + m_LockTracker: + m_IsLocked: 0 + m_PreviewWindow: {fileID: 0} +--- !u!114 &15 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12061, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 200, y: 200} + m_MaxSize: {x: 4000, y: 4000} + m_TitleContent: + m_Text: "\u5C42\u7EA7" + m_Image: {fileID: 7966133145522015247, guid: 0000000000000000d000000000000000, type: 0} + m_Tooltip: + m_Pos: + serializedVersion: 2 + x: 0 + y: 73 + width: 280 + height: 535 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: [] + m_OverlaysVisible: 1 + m_SceneHierarchy: + m_TreeViewState: + scrollPos: {x: 0, y: 0} + m_SelectedIDs: + m_LastClickedID: 0 + m_ExpandedIDs: 80e4feffa6e5feff06e8feff48e8feff4cf6feff461affff641bffffd21fffff7820fffffe20ffff2031ffff0e33ffff603effffea42ffff20ceffffaecfffff72d3ffffc0d4ffffc0d9ffff30daffff72defffff4deffff2cdfffff66dfffffb4e2ffff0ce3fffff0e6ffff8eecffff62edffff34fbfffff4ffffff4a6b000066740000127c0000 + m_RenameOverlay: + m_UserAcceptedRename: 0 + m_Name: Sphere + m_OriginalName: Sphere + m_EditFieldRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + m_UserData: 30192 + m_IsWaitingForDelay: 0 + m_IsRenaming: 0 + m_OriginalEventType: 0 + m_IsRenamingFilename: 0 + m_ClientGUIView: {fileID: 5} + m_SearchString: + m_ExpandedScenes: [] + m_CurrenRootInstanceID: 0 + m_LockTracker: + m_IsLocked: 0 + m_CurrentSortingName: TransformSorting + m_WindowGUID: 4c969a2b90040154d917609493e03593 +--- !u!114 &16 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12013, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 200, y: 200} + m_MaxSize: {x: 4000, y: 4000} + m_TitleContent: + m_Text: "\u573A\u666F" + m_Image: {fileID: 2593428753322112591, guid: 0000000000000000d000000000000000, type: 0} + m_Tooltip: + m_Pos: + serializedVersion: 2 + x: 281 + y: 73 + width: 786 + height: 535 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: + - dockPosition: 0 + containerId: overlay-toolbar__top + floating: 0 + collapsed: 0 + displayed: 1 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: -101, y: -26} + snapCorner: 3 + id: Tool Settings + index: 0 + layout: 1 + - dockPosition: 0 + containerId: overlay-toolbar__top + floating: 0 + collapsed: 0 + displayed: 1 + snapOffset: {x: -141, y: 149} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 1 + id: unity-grid-and-snap-toolbar + index: 1 + layout: 1 + - dockPosition: 1 + containerId: overlay-toolbar__top + floating: 0 + collapsed: 0 + displayed: 1 + snapOffset: {x: 0, y: 25} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: unity-scene-view-toolbar + index: 0 + layout: 1 + - dockPosition: 1 + containerId: overlay-toolbar__top + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 1 + id: unity-search-toolbar + index: 1 + layout: 1 + - dockPosition: 0 + containerId: overlay-container--left + floating: 0 + collapsed: 0 + displayed: 1 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: unity-transform-toolbar + index: 0 + layout: 2 + - dockPosition: 0 + containerId: overlay-container--left + floating: 0 + collapsed: 0 + displayed: 1 + snapOffset: {x: 0, y: 197} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: unity-component-tools + index: 1 + layout: 2 + - dockPosition: 0 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 1 + snapOffset: {x: 67.5, y: 86} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Orientation + index: 0 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Light Settings + index: 0 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 25} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Camera + index: 1 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Cloth Constraints + index: 2 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Cloth Collisions + index: 3 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Navmesh Display + index: 4 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Agent Display + index: 5 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Obstacle Display + index: 6 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Occlusion Culling + index: 7 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Physics Debugger + index: 8 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Scene Visibility + index: 9 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Particles + index: 10 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Tilemap + index: 11 + layout: 4 + - dockPosition: 1 + containerId: overlay-container--right + floating: 0 + collapsed: 0 + displayed: 0 + snapOffset: {x: 0, y: 0} + snapOffsetDelta: {x: 0, y: 0} + snapCorner: 0 + id: Scene View/Tilemap Palette Helper + index: 12 + layout: 4 + m_OverlaysVisible: 1 + m_WindowGUID: cc27987af1a868c49b0894db9c0f5429 + m_Gizmos: 1 + m_OverrideSceneCullingMask: 6917529027641081856 + m_SceneIsLit: 1 + m_SceneLighting: 1 + m_2DMode: 1 + m_isRotationLocked: 0 + m_PlayAudio: 0 + m_AudioPlay: 0 + m_Position: + m_Target: {x: 173.08003, y: 197.96945, z: -7.0561337} + speed: 2 + m_Value: {x: 173.08003, y: 197.96945, z: -7.0561337} + m_RenderMode: 0 + m_CameraMode: + drawMode: 0 + name: Shaded + section: Shading Mode + m_ValidateTrueMetals: 0 + m_DoValidateTrueMetals: 0 + m_ExposureSliderValue: 0 + m_SceneViewState: + m_AlwaysRefresh: 0 + showFog: 1 + showSkybox: 1 + showFlares: 1 + showImageEffects: 1 + showParticleSystems: 1 + showVisualEffectGraphs: 1 + m_FxEnabled: 1 + m_Grid: + xGrid: + m_Fade: + m_Target: 0 + speed: 2 + m_Value: 0 + m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} + m_Pivot: {x: 0, y: 0, z: 0} + m_Size: {x: 0, y: 0} + yGrid: + m_Fade: + m_Target: 0 + speed: 2 + m_Value: 0 + m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} + m_Pivot: {x: 0, y: 0, z: 0} + m_Size: {x: 1, y: 1} + zGrid: + m_Fade: + m_Target: 1 + speed: 2 + m_Value: 1 + m_Color: {r: 0.5, g: 0.5, b: 0.5, a: 0.4} + m_Pivot: {x: 0, y: 0, z: 0} + m_Size: {x: 1, y: 1} + m_ShowGrid: 1 + m_GridAxis: 1 + m_gridOpacity: 0.5 + m_Rotation: + m_Target: {x: 0, y: 0, z: 0, w: 1} + speed: 2 + m_Value: {x: 0, y: 0, z: 0, w: 1} + m_Size: + m_Target: 452.1824 + speed: 2 + m_Value: 452.1824 + m_Ortho: + m_Target: 1 + speed: 2 + m_Value: 1 + m_CameraSettings: + m_Speed: 1 + m_SpeedNormalized: 0.5 + m_SpeedMin: 0.001 + m_SpeedMax: 2 + m_EasingEnabled: 1 + m_EasingDuration: 0.4 + m_AccelerationEnabled: 1 + m_FieldOfViewHorizontalOrVertical: 60 + m_NearClip: 0.03 + m_FarClip: 10000 + m_DynamicClip: 1 + m_OcclusionCulling: 0 + m_LastSceneViewRotation: {x: -0.08387249, y: 0.9159154, z: -0.2671573, w: -0.28754526} + m_LastSceneViewOrtho: 0 + m_ReplacementShader: {fileID: 0} + m_ReplacementString: + m_SceneVisActive: 1 + m_LastLockedObject: {fileID: 0} + m_ViewIsLockedToObject: 0 +--- !u!114 &17 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12015, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 200, y: 200} + m_MaxSize: {x: 4000, y: 4000} + m_TitleContent: + m_Text: "\u6E38\u620F" + m_Image: {fileID: -6423792434712278376, guid: 0000000000000000d000000000000000, type: 0} + m_Tooltip: + m_Pos: + serializedVersion: 2 + x: 1069 + y: 73 + width: 395 + height: 535 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: [] + m_OverlaysVisible: 1 + m_SerializedViewNames: [] + m_SerializedViewValues: [] + m_PlayModeViewName: GameView + m_ShowGizmos: 0 + m_TargetDisplay: 0 + m_ClearColor: {r: 0, g: 0, b: 0, a: 0} + m_TargetSize: {x: 395, y: 514} + m_TextureFilterMode: 0 + m_TextureHideFlags: 61 + m_RenderIMGUI: 1 + m_EnterPlayModeBehavior: 0 + m_UseMipMap: 0 + m_VSyncEnabled: 0 + m_Gizmos: 0 + m_Stats: 0 + m_SelectedSizes: 00000000000000000000000000000000000000000000000000000000000000000000000000000000 + m_ZoomArea: + m_HRangeLocked: 0 + m_VRangeLocked: 0 + hZoomLockedByDefault: 0 + vZoomLockedByDefault: 0 + m_HBaseRangeMin: -197.5 + m_HBaseRangeMax: 197.5 + m_VBaseRangeMin: -257 + m_VBaseRangeMax: 257 + m_HAllowExceedBaseRangeMin: 1 + m_HAllowExceedBaseRangeMax: 1 + m_VAllowExceedBaseRangeMin: 1 + m_VAllowExceedBaseRangeMax: 1 + m_ScaleWithWindow: 0 + m_HSlider: 0 + m_VSlider: 0 + m_IgnoreScrollWheelUntilClicked: 0 + m_EnableMouseInput: 1 + m_EnableSliderZoomHorizontal: 0 + m_EnableSliderZoomVertical: 0 + m_UniformScale: 1 + m_UpDirection: 1 + m_DrawArea: + serializedVersion: 2 + x: 0 + y: 21 + width: 395 + height: 514 + m_Scale: {x: 1, y: 1} + m_Translation: {x: 197.5, y: 257} + m_MarginLeft: 0 + m_MarginRight: 0 + m_MarginTop: 0 + m_MarginBottom: 0 + m_LastShownAreaInsideMargins: + serializedVersion: 2 + x: -197.5 + y: -257 + width: 395 + height: 514 + m_MinimalGUI: 1 + m_defaultScale: 1 + m_LastWindowPixelSize: {x: 395, y: 535} + m_ClearInEditMode: 1 + m_NoCameraWarning: 1 + m_LowResolutionForAspectRatios: 01000000000000000000 + m_XRRenderMode: 0 + m_RenderTexture: {fileID: 0} +--- !u!114 &18 +MonoBehaviour: + m_ObjectHideFlags: 52 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 1 + m_Script: {fileID: 12003, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_MinSize: {x: 100, y: 100} + m_MaxSize: {x: 4000, y: 4000} + m_TitleContent: + m_Text: "\u63A7\u5236\u53F0" + m_Image: {fileID: -4327648978806127646, guid: 0000000000000000d000000000000000, type: 0} + m_Tooltip: + m_Pos: + serializedVersion: 2 + x: 0 + y: 629 + width: 1465 + height: 362 + m_ViewDataDictionary: {fileID: 0} + m_OverlayCanvas: + m_LastAppliedPresetName: Default + m_SaveData: [] + m_OverlaysVisible: 1 diff --git a/JNFrame/UserSettings/Search.settings b/JNFrame/UserSettings/Search.settings new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/JNFrame/UserSettings/Search.settings @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/JNFrame/obj/Debug/.NETFramework,Version=v4.7.1.AssemblyAttributes.cs b/JNFrame/obj/Debug/.NETFramework,Version=v4.7.1.AssemblyAttributes.cs new file mode 100644 index 00000000..3d63587a --- /dev/null +++ b/JNFrame/obj/Debug/.NETFramework,Version=v4.7.1.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.1", FrameworkDisplayName = "")] diff --git a/JNFrame/obj/Debug/Assembly-CSharp-Editor.csproj.AssemblyReference.cache b/JNFrame/obj/Debug/Assembly-CSharp-Editor.csproj.AssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..384fc15debaaa24a53495584f69b22a36054731e GIT binary patch literal 7736 zcmcJUTW{k;6vyM;WmT~cyl`8tIP_1-KD!H!h{&MD=nREU=bKkq$YPG!6{^5Kgc)po; z_q&hUpS8OOmye?E{3PbNRP#Q|*?hnRTS9D~I}uARz&&rrN#c1L*7`x7-}&Xw9nbR~ z7^Z#J+$wLopYo#jqdwgGNuTK7-tdwqaMqPXNs*?1l}7iuUEue5@2t;Fmvt~Dj@)0bAjXYkbru}MfF6iB#$2t z0|N0~ml%k3k)OkoMH>S0eHYn_BFHkn;E7(Z1n8?SbV3>Ndx%t~5nl=cQQnkwJ&JX^ zH>~RkmTYn!Wd!>^`ERN((^QJ4*dtJvQl(5pZ~<$naxRtxHd>3L)h5$!==Pfe_5@E^ zu5&8^_|WxiWg!8FmSZo=AU`fdoKTYO2d;(TiYbT#k%Q9HiZZ3}Dlc*w<_cI!i#LLf z;rsjoL=1`sMb*JiWKJnHD0}!xk!eqwv`Gj$icrP00|!OGqEzB5maUptl4!z@wfsrh znqVZxfl`c9mLrOFFgPPs3RJkKr%wsPM0QPi3>1ZeYT@*PU=|W}XNt!J7MjIDs@1oy ztJhY%60k_}gvBD;=p~mnmbo5>Uk^i_VOYYSQL-$`3+FN_dDPm1JZiG|3>FvgZ2=iY zte~Jzh9_e}boSih@|=myl&_o8rFH^U>VJBR^=0+ZZ&?K2e0&RiHk%R1Z@T2+H0TFC z0u9xP5!0G2N+2}Lj6lWjcwA|LEh*LPLwC$muJVE5ozlt#2cDNV_VAUiWse;GT>$J;Z%y;wonKT*h((HflNj! z-Udqx?=>Zvp!iRM6Ro@Sl%kYDw4iF@P*<&Milt~?O@bMZmq0QUWs)hZ%Jf7TII4d$ zE-0c0NwKFCDTYWr3JGaV+PjJA*S&n*)vd=b_7A!TE$>MKz1O;XxUCI~!c#xGwb5vr zu&5*ZO@kfT`pcc>?7*!<^%Imn?LF=0#`?4mY~?mBTGK9n$@E|G;YAw0NPRZfH@I)@ zBlMzgPDb-Wpj=ijcongkw()br*6*R$JfhUzYRy_B`%uzC zo)!tCY41wUR9McILT1E{G#a|u|Cw_5ju7!m&R82qEV|MS2)pH`NKK&X{lId=2n38F yU2Bh0;)ERfq~Ot22uwwk#$=^tt)2gePR8U$bn-{GmRfQxK|`h;Optgt3dG+#+|aQA literal 0 HcmV?d00001 diff --git a/JNFrame/obj/Debug/Assembly-CSharp-firstpass.csproj.AssemblyReference.cache b/JNFrame/obj/Debug/Assembly-CSharp-firstpass.csproj.AssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..debb3c378cdeb896e403d237d4fd7a24a6360e9e GIT binary patch literal 117460 zcmeHw3!EIqdFKuY!y!OCjd+Nc!7(<>>_e*uM8;zEV8v>++S!L5BSh~^?`}&o(@Rf} zq{YaRPxjg7{NNzQCXN#&B*wvKLY$a5#3tbfcH&^*=V!nsiO<9d=h)}?a-7e^POhrE ztGcSXs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_sHMaDa^dwC*J8>9i^*=H}$2?KSc% z(VtF&jD~O3E0$M5XY!DvMhG35Fgm{S_RBx;+&3^nNPBxkLi;n>Q-qVgVsb73kugi) z!7xh>5@DIufyv@JK$x_+M^eNd1fL`Wc6xAW4j|cT*IaKFA*46olY)_mj6&qu@$0ug z^(_pMGb00r6ci!Ub)YvniIB=X5W;er0uYAN?BQdGQzj1&bRux;`98UxuV~}jh z9Yb{rS9B&TR}mkQprc4R`nIbhXF_&FinIY{Fh)oYjADn2K!TpD7M)LY+KKciJ}UHu z1U)NP5wDV<)18GD=fTpVI4qF5P^h30sOTIt_QBj7kVN+T;scye3!4}1+-&4W(N4%o zJMci=DITcRcnY|~-|74H6@hDdV}ybhL#fYNLVOkZo5SDzxp_FP7LN|4CU}%gcdf=} z6Q_=zVOZF9B2{VlKONZO^YLiiOepdRD=T5GN1|-;#{_#f?>YL^tCs{jC*~Pjv&ZC7 z9t%ypcZ2Se5SCdYGf{*s{#X|&8Cq=v#?|O!GaC|5MG!a_ P;s0Y&lm|*?CdK~`s@2c$ literal 0 HcmV?d00001 diff --git a/JNFrame/obj/Debug/Assembly-CSharp.csproj.AssemblyReference.cache b/JNFrame/obj/Debug/Assembly-CSharp.csproj.AssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..3e362ba8c84b1b0f69460fdbfefd6b3efec46ce3 GIT binary patch literal 115088 zcmeHw3!EIqdFKuY!y$}#$%uzQVB;7YX7-`g10oZ#T8R~_)oN!SdW;agGrhYl%}lR) zdL%6Y3!m(>%{eg#F*b4hi*h8!!DqrbF>#1Z!Vm1k!8SiX12#z<6DOR5&*#f=J`+2+ zs_w4ps_Lqq+MTaf+xcbrA+2`4+WsE@{_3mm`>N`7xmP+mI&xdL+)x^;JN{g$yR*A1 z-;?iNKh;(4F7;O&-}OpcEZ-{au>(fr%X1~u@s?}T${j!dCxPzzN^PRJD zx!m&LcZRgVNBCp*3;!^89R0EEZuAZMJ2y1tRP7rIg~FB_3c=_C$5A2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?lH7>tjmatf&Uv@#%WrSJiA5k{IcPE=u zJ^8Lq@n=|q!2dSfo$q{hCO9Bsg)lCNI?fg&jzrXkYutt;n#`20EFd;8z4y!6V! zAAacfPJH6aAHLwsWmkUlQ{TRE;KbIS{p^K-^S)WQrg-P}zOUT$7!(X%QC!YD%vRqLREd~G!HT3_j2*SoHF(kid5tm|Bhl_0j9Z%cU% z1vG4Lxb?1{POqypWFPfWOSwDc=kX6I1}=Vhm|{Sn$-O>&I{g#Bd%^!)+7cTL{g{RiiL`MI~$i+7%}?M*-V*OPDP>;J!RdwXTgwSW2X zbDrMyU*0#?{r>GQ-m~nzZ~W1{k3F~H2X{U8m)HKq|9-sZ=_j5%>#?rfho3s@k`F$0 z@3o(u-gUn}^ofr)`aknAZ}%$~fAxZ|eD04w^}S7@Bh+ie->E2^OHOO{!<@&^oO~kAVzHYE*v1E|5|qv^>kX5wNv)G$!=?%W!sfd z>wH(y?i9<xn8G;#C(yPtmbvY_j4fw*9gc%eKBc`3m~h|EOj5P$sdm`Ix`@D@d?Zv`gw+(yH< z>J`hYpaYxK{^RTSc%5ze4|Z1~e%#|-hHdTg=eZa>phzGk1t~< zFZ?|h%Y2l*(OnmTdK`qplj)5So*aavBm7CkajWTXX`N{8=xHa8nDEJ2Yx7;L1160F G&;CDcQ?T6t literal 0 HcmV?d00001 diff --git a/JNFrame/obj/Debug/UniTask.Addressables.csproj.AssemblyReference.cache b/JNFrame/obj/Debug/UniTask.Addressables.csproj.AssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..5f9855357b7caca705ca50327793c011283589ae GIT binary patch literal 111925 zcmd^o3w%_?^?w#nD5xMx@r9yQD~h|>yd$LuNq}GoAy1G+yxF};7B;)#?ruUvg#OT~ zRIBxY?;3yBM{Tv%{p2ERhHV&@U@ED^)ja!)v1gfxsC3cN(<%kMNJ_FZ_>zwdju# z>(Dpo??8P=JfWTx3Wcgq3hARm3`Ze@qY&mOWO8KC8J|Lbk2%tRX+dBX#mLmj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Rzyyq7`n6dJi55D->nvLs+mJT~@)97)B zPCe`K%<20*Xk6hWT>a>$N1K@x(-jN_?7#~n;fD=_aQ|Vz=JEf7Hvpy(!Gwr6 zI6Xfm8ne^&OxQ}F!;RTaJp+!}H!}h!6s#U}{*5zUFhjw?1cft!hgL@)69GgZm?3U` zlbevmO^A3Fr`zy{G{USu#iDE;Y zH+vwkx8u{{&%~SkGyIrFM|f(EjB-3%_>dR}mhdcG3XT_r>%O)A855I^bb95%lJR3| mvhhsT&?hJLYzB0njvv#M1@)20Oue@?wNy_|ZqI*S_x}P%2fQ2r literal 0 HcmV?d00001 diff --git a/JNFrame/obj/Debug/UniTask.Linq.csproj.AssemblyReference.cache b/JNFrame/obj/Debug/UniTask.Linq.csproj.AssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..5f9855357b7caca705ca50327793c011283589ae GIT binary patch literal 111925 zcmd^o3w%_?^?w#nD5xMx@r9yQD~h|>yd$LuNq}GoAy1G+yxF};7B;)#?ruUvg#OT~ zRIBxY?;3yBM{Tv%{p2ERhHV&@U@ED^)ja!)v1gfxsC3cN(<%kMNJ_FZ_>zwdju# z>(Dpo??8P=JfWTx3Wcgq3hARm3`Ze@qY&mOWO8KC8J|Lbk2%tRX+dBX#mLmjt*Vxe zr;^hPgZlrbPOi!(GFeTXo>a3LO-W3h+>mWg#G|LE{mrQrYI1rqi++>-6&T%HghrJX zmKT*51Qr0OZD#HKR4kiNdHOq$Vmn9(1r^x_s7UhBltxeCu{P9H+bF79lW?F@g$jhs1I&7Zj{p^Dqo(hBgQ@Bx71C z9-CM1;Y1E&L~;xeG{7=Q12|ZqwBO{#Dxm6HK~x{_Rx)TAaYz55tT+t4pyE#hRXoE1 zrT0b;Mgi5n2tw`Yw3?ZfO~w+cyW%G?@;FBbs{V9H)jN5hl;7;hETH-uA=ICZ#Z&Hz zpUB8!(+aBmR7jQEpH3;e-i5&-rsk?dD$^yXW{P$XsG0h7H#JivfNEY0faa=1Hl0zm z+GI~Q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;5E+!r8^h$!^{F^U + + + + + + \ No newline at end of file diff --git a/JisolGameServer/GFrameDemo/src/main/java/cn/jisol/ngame/frame/network/WebSocket.java b/JisolGameServer/GFrameDemo/src/main/java/cn/jisol/ngame/frame/network/WebSocket.java index 4c109a0d..814ea229 100644 --- a/JisolGameServer/GFrameDemo/src/main/java/cn/jisol/ngame/frame/network/WebSocket.java +++ b/JisolGameServer/GFrameDemo/src/main/java/cn/jisol/ngame/frame/network/WebSocket.java @@ -40,7 +40,7 @@ public class WebSocket { NSystem.Log("收到请求"); GClient client = CLIENTS.get(session.getId()); - JNetwork.onMessage(inputStream,client,client); + JNetwork.onMessage(inputStream,client,client,CLIENTS); }

      #Jc9;Y*1*q^r+Daq!l%xh z9`DGnjBXW`CyYJ0-I8)H4FA|}C1r=do{i5KFY$%BG=2d-KUC(hgro(F${n!$6W((R zdv)HKdC1E5roVJ<$&MvNYAQZ;ZcRdTM=BUXsiOKs?;^cQpJ5m4$}OV$BvWZGvPLY% zc_nHF%QN1SM&{z(X)ZDjEhbbWy;`3=@8lw1?Qh|a z*DxMu4!?-M*PyhBn@h2Wx=feiPxr|fQTuzDb~9{`Ozb~HZ^gCWh72gaHbMWi8vD->*90`iqx`MXI2FdD?XARJ)_-<%j^QI;&2K60 zy7LK(IlARPWt8^{e4pihQ}pMYc^_om?@>CA2JwixnfgUcgrU~( zHbHv+Y9`_<)5e~4FW`+e*?|1ssqjA-9 z*+RE!bKRrc@Kn22`!#)K50m<~UDosD-S-9mH^X^0n`h~}b@4?EGXNt=%%kkWr4UM} zG$JL2>43O0_Sjo!L>v6Os151+&F1Er?ppLDwmL^CwDQg##Hna0%pBtBM>iNh1aPbq z&nSwaSe8W>bfjlWX#lW3SX1Fi%~mf5@O29C9iQc#z5-Dv38!rH51KFD7$OD1*jZE4o|=GpopS z7ek`1CzK?T2M(hF?|wdi^8y#D$|!Fg`i?HON?n93_Alw8`K~YlB89s zXCsOKQKVj5qYf{Lufjzq!W`-ucVLR6AoDh<$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03f2GGlDCxFe5@LW*=2lld*2&p$}NgbW!82^|RO!v*f1zYLwsY++oS zXaD|LaL4cBx*{qPQW_Q#65Y8{5`Z{WcNp9Z%BkcG1zc1Jj8nr50_=6c0FD;sU?kLDf$tbDHaH?sk{aNrO(#=ngfN(Ea4j>BbTqOc9k&x7G z$=#LaxFdO2O`AhWSq%`Q`gcO8GW#&tfWoZ6-}7&mCPP9x3TgqpoG#PUx8-$nv|iI7(lHxklr3knhtMEBdp|6Kq;-(|60oVig*B0&b|crA7EMLZzBF%ST_1yz`qBczZq0{di83l!oUoHA^m}6 z3l-m*_3uUg!>~E8sh<6xBL6*>p*OWCB7Qpz`B#@=9sCsWpWw~8>irXzwM(LX?MR@- z|B39s(dNI#vMKmqWd9ej?9T(Df9YgD<-a8RoKF5}p2nFwtw{5NJg^4hsN z{C8$L?|BjbVy1r^Ab)-s^GngzfRw-aOy<{O{!PH2-;(?i;I@wT|NfUHzh3|M-wgbE eJ>eGGA72pMkw?ckd(H&>5d^G68A@~@_5T1RulP{_ literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/THIRD-PARTY-NOTICES.TXT b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/THIRD-PARTY-NOTICES.TXT new file mode 100644 index 00000000..06055ff0 --- /dev/null +++ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/THIRD-PARTY-NOTICES.TXT @@ -0,0 +1,226 @@ +.NET Core uses third-party libraries or other resources that may be +distributed under licenses different than the .NET Core software. + +In the event that we accidentally failed to list a required notice, please +bring it to our attention. Post an issue or email us: + + dotnet@microsoft.com + +The attached notices are provided for information only. + +License notice for Slicing-by-8 +------------------------------- + +http://sourceforge.net/projects/slicing-by-8/ + +Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + + +This software program is licensed subject to the BSD License, available at +http://www.opensource.org/licenses/bsd-license.html. + + +License notice for Unicode data +------------------------------- + +http://www.unicode.org/copyright.html#License + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +License notice for Zlib +----------------------- + +https://github.com/madler/zlib +http://zlib.net/zlib_license.html + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.11, January 15th, 2017 + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +*/ + +License notice for Mono +------------------------------- + +http://www.mono-project.com/docs/about-mono/ + +Copyright (c) .NET Foundation Contributors + +MIT License + +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. + +License notice for International Organization for Standardization +----------------------------------------------------------------- + +Portions (C) International Organization for Standardization 1986: + Permission to copy in any form is granted for use with + conforming SGML systems and applications as defined in + ISO 8879, provided this notice is included in all copies. + +License notice for Intel +------------------------ + +"Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License notice for Xamarin and Novell +------------------------------------- + +Copyright (c) 2015 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. + +Copyright (c) 2011 Novell, Inc (http://www.novell.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. + +Third party notice for W3C +-------------------------- + +"W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE +Status: This license takes effect 13 May, 2015. +This work is being provided by the copyright holders under the following license. +License +By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions. +Permission to copy, modify, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications: +The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. +Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software and Document Short Notice should be included. +Notice of any changes or modifications, through a copyright statement on the new code or document such as "This software or document includes material copied from or derived from [title and URI of the W3C document]. Copyright © [YEAR] W3C® (MIT, ERCIM, Keio, Beihang)." +Disclaimers +THIS WORK IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENT. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders." + +License notice for Bit Twiddling Hacks +-------------------------------------- + +Bit Twiddling Hacks + +By Sean Eron Anderson +seander@cs.stanford.edu + +Individually, the code snippets here are in the public domain (unless otherwise +noted) — feel free to use them however you please. The aggregate collection and +descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are +distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and +without even the implied warranty of merchantability or fitness for a particular +purpose. diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/MonoAndroid10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/MonoAndroid10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/MonoTouch10/_._ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/MonoTouch10/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/net46/System.Numerics.Vectors.dll b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/net46/System.Numerics.Vectors.dll new file mode 100644 index 0000000000000000000000000000000000000000..ce46d5be85cdee1a3c0ef5bc22c8e1772d0d0d98 GIT binary patch literal 115936 zcmeFadw^Y4c{jYyWzKDG*>jS~Z6=vO5>Apy$UPY@k|7Bp+|31M5)_7HNCt+PFf&0w zV?(uClu8k#YH39)V%1u!yv189D#hxH76`T2j~An+-rCQ5`>B1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ROKvV6h@ZKCU80TC%7u^zU0&LY-S^Sjd2iH+Qvu;CW9d(@T|A2RHZ!gy#V zN=w3a9Y|wgFk`)5AgD+5(DLB4aN3>lrGQs~v3krttu4J8L%s6UAdcn(n0a&fnRn*z zwF5VZuV1J&TZu0$90M_ZXR8R%6hE*T(03kWgUKRe;bWzay}g&(cgnCx{h zJZV2gL!3<9<`k~8GaVMPRr0}_gNqX)zD!%g5cN87{lTi(fzno1kqh(*1A|vlz2wBF z`XUd<|!HD1(>3}W8va=X9WueIkN zbD=3W=Sip;`Z#tZt#OBI*8RpNRf66LrBBLDgVPN|>pjmrVy`>5h8~yFGpbK8T{do~ z_m-H~87@B-Fg-m=M_O5WX0~rKzks#WYmFk?JK{{V+1to>;yNLg>XRq~n!B7`I}mrX zupB~7TD|R&`5)x?x#>$<8+6r~N#JuqZ-g3&LG&DS hVm7U;w4-p`=g_p#b=PIm1|N#6hYj`B@Jcfb_CG2(4kG{n literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/net46/System.Numerics.Vectors.xml b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/net46/System.Numerics.Vectors.xml new file mode 100644 index 00000000..51297939 --- /dev/null +++ b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/lib/net46/System.Numerics.Vectors.xml @@ -0,0 +1,2597 @@ + + + + System.Numerics.Vectors + + + +

    W0$;JCq^@X1dwlq)RPWLscfxlnh!HIMV1qC_AmCiR zR#sfkejL6^$cfp-H^f@j+SEjjQfa{@Uk4DExZ$g*+DN)h*m~~3_E_u%PAZkq1w~>f zyy~d>Xm_$_yYg2&^@H#*6VrX4GF=F=AxkL7U4;eo*rDg!i8aUK*G)%u?b+{=v*MI{ zQdTWhS~j{>x0Lu=s@6P({5)ON^skmmd&u7}oxjAemMQ|*o2DdSt8!FEYErsiytj9p zSArKV^`~Cw<6HUr%=mkAaRde=Pe_VP$|1={CRqB52neG8YxgxSs&M1!96`OJrLnbY z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qW-1Yk!>AdlE-X?|i zdhl*hqor@JW%Z9s&FHzf;P68EGT$vvem{Jna9!3>``4QW3mo!4Rv1to~-FTa=UI+XKtOFF9{oz4-E^H46jh96W9t(Co&L_cf-? zRVJ%XZ^?0Qay_BXo2kRyD(rV$*>?SkD?#-pM|3}5d}?2-+bP$gcb&YZ-ud~+y=EUx zcXVj}aHfN;kK5McZ6vPGO^YJDE{2XVT%k_hh3ckT3hxabR|IoeLH@k{ z|KahcTX?xc6xx1I}cFzgmB@v&tS5NWp_8IdiV$+ zLjdzT+_-sESY9T?zHBLTD^vLh2~uB*P}?B6P=nQJ{r(%8y$XvIYNW+w=+a_UvCb_R zQe>!_pvaNR0K{K{P19}sf9Abx9ib=<_#>;YE82Xx-h!ur64>rLJ* z?YO3zOm@m7uF26dVy%)z1-5z|X($4OhLXj!vj&jD) zw|IO8Ljzhj`o_(0sYN;DZ4Ip_``Qk-Ff%y5NqwV4GMq{OFeUTQAKYIQiEa*9MJ9 zzFl*=f+HTuvdD6qbLy!AX` z;$DZ_t+H|ly1LIXWJpXbXiv@xQB+)H<=uBzog5Q0JO1q z-9NK#&fPN;j?L@1{+^&uoj)cj>vWhnsmjN3ubT^`FN<^Qk8L~hL+jkPIk6u_9qPtj z68zES-ukvP+Ml~*cT_2#71?A-#rhwQc777G$;&izW#utX?t08Rd_O2VG*Dz9rL>i9)5_JKYBfXow%mmHjGd|vx##A!wP?QOm+b?2g9-P40N_EA_W%F@ literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard1.1/System.Memory.xml b/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard1.1/System.Memory.xml new file mode 100644 index 00000000..4d12fd71 --- /dev/null +++ b/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard1.1/System.Memory.xml @@ -0,0 +1,355 @@ + + + System.Memory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll b/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll new file mode 100644 index 0000000000000000000000000000000000000000..bdfc501e9647719549793297acb072d33067d4e5 GIT binary patch literal 148760 zcmdSC37i~PbuU~~dsp`?H9gZki!{}eEm7|3?pazRjTT#y7YXmSJhr<>vNhU_)mSsO zMq;rROAtsfHjn^GO!$&O0(pTDvJloJkc8(1!eV3+NJ9J!d=Qx{$l});n^?77rgO zb$2_LOVqbrrzkgdY091N|Iog$v}cvIxn$RbqWrK+QEU-=a6na*9Nu$yDoP)}0je1gA|3oUf{izUUI53W6+EIGgW11JKlGwN(zs+^dmh? zyOd|HPC7%|2){UzuXN(bD^4Ih^8?foX>PxOg%+GdUE(t@zgj}?iZ;V!}wPaf=pgXPpHZ$ z3PVO$TbDcuGSot^^)7lks_9$c2H+kRnb#Hd^_jp}%pHA5(63UNGJdrvr7WO43YGi{ z0c;RaYedxkNYrH_>fT7yI*vMyln0k2RWA}z(~&5&1JED8hN2Kp>;mhkL?&sYhyv>< z>K;NbnFW>*Q#TPnUd_zJe;i^SzjN2@) z7i}*gURAx6Q5T_tj?TZ6ltNt2tBacv>+~!B7Cf~Lw&#chFDagDRm}(e=EIMwz?TyE zG<9(+z&Bc10hAFB$NLQ}wUvX`#9;N=c#H!jROnwe8R{kE;OeaB|y z+r7u~Z^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!HKCi&9 zoA)id;o#85de8mL)Q!PvzJ0$J?q<;ZwDNlXr!_u1w>Qgv(1yUjZ}{jV-? zJABNeB-0rYnbTu#e_JS5 zKUsuHH}!^*?*3eR%kb}g0@q*4v$R&c)QEm{vZe3v7Y%Jz)>;2oZ``*;^$*7kGyNWs z^((*EoZ_7|X`ig@EyE^eUSJQI6P#x!4{RF?JeG#7gN{6w*2L&#AO#;@0WJdLMHxUb zKpz}CviQwyNmje(hZpb8*mvgR9lsMN*k?uNz75mny8PrG*Ls7-Uq}Wp=^Hk_GH85m z(D=llaW8OaO4Ze}mpm-}mS+H%F%4B8E@LTsHMy-S9U2sU~uc0Ct@~3y|18-rJfR zt+7AOn`hQRftd{F=kv7&{S=s5lixQt`e1K`UbVe%cv2C)}JJnBY`<>F6afwsE`0Ij<_4!(Lw#wm= z^C$niq}Vd&jAL*CtEwf(ogLCy-38lo`G4%=_dUBdG`-}T+HRwXTevp-Tvjd}JS$LA zi))>x(!s{Pyp5l>3Qphf%EoK|#>}U$c??Q=ryIPMthjsmY#4vbuC@IY{wCLh>XWUT z1g;D3h!o#cz&s&*^DC)|-0wwyy-qfYEL?1po~P3MvQwv{JuAN%@N;)v+ IXGb{$00BiQzyJUM literal 0 HcmV?d00001 diff --git a/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml b/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml new file mode 100644 index 00000000..4d12fd71 --- /dev/null +++ b/JNFrame/Packages/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.xml @@ -0,0 +1,355 @@ + + + System.Memory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JNFrame/Packages/System.Memory.4.5.3/ref/netcoreapp2.1/_._ b/JNFrame/Packages/System.Memory.4.5.3/ref/netcoreapp2.1/_._ new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Memory.4.5.3/useSharedDesignerContext.txt b/JNFrame/Packages/System.Memory.4.5.3/useSharedDesignerContext.txt new file mode 100644 index 00000000..e69de29b diff --git a/JNFrame/Packages/System.Memory.4.5.3/version.txt b/JNFrame/Packages/System.Memory.4.5.3/version.txt new file mode 100644 index 00000000..4b665b34 --- /dev/null +++ b/JNFrame/Packages/System.Memory.4.5.3/version.txt @@ -0,0 +1 @@ +c6cf790234e063b855fcdb50f3fb1b3cfac73275 diff --git a/JNFrame/Packages/System.Numerics.Vectors.4.4.0/.signature.p7s b/JNFrame/Packages/System.Numerics.Vectors.4.4.0/.signature.p7s new file mode 100644 index 0000000000000000000000000000000000000000..804a5d4539d8577faf287850ea9269ebb94cd3ce GIT binary patch literal 9482 zcmds-cUTiy+r~*D^j@WgrqnP==%RptfCvgm6@}13q=(Q|NCZ?ADT;uK6a_3;XreDl zZ%R=Rq$sdd1ym4_<_h10w&L!$yYKa0*SpvE`466%bIzQZInVF8pL+sOq!0)O*=WP) zc@_vAG=m~J4^Sj$pb!|E4PZeqI7S;nTw!o1gq8+y`K==)!y0aBXvwg|aih|7C=)YwvR0h~uwgoU@d@O(p8jS|l{@L-d zV8PaA^S`wW3Pk+J2LQep7zM&c15hB0PznS>bB~p$Wmq@DKL7MgiQ}RlXZHPf+b^BD zGu!eNsV;5f$h;8IbDJj#gVQX|myV2yd6&+}e2OnLE7H6OqE5C@b-slyDJ5&&ttp06#18> z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